From 67d4a5b15cfd8583c19a5776b0ec1564b60239eb Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Sun, 23 Aug 2009 23:50:27 +0100 Subject: mesa/swrast: use one fewer divide in swrast's choose_cube_face also Same change as for softpipe --- src/mesa/swrast/s_texfilter.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index 6b1f934647..216c107e3f 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -1905,8 +1905,12 @@ choose_cube_face(const struct gl_texture_object *texObj, } } - newCoord[0] = ( sc / ma + 1.0F ) * 0.5F; - newCoord[1] = ( tc / ma + 1.0F ) * 0.5F; + { + const float ima = 1.0F / ma; + newCoord[0] = ( sc * ima + 1.0F ) * 0.5F; + newCoord[1] = ( tc * ima + 1.0F ) * 0.5F; + } + return (const struct gl_texture_image **) texObj->Image[face]; } -- cgit v1.2.3 From d6d71e5bf4a720a1ee84c96231aec539ec17a7c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= Date: Sun, 30 Aug 2009 12:49:53 +0200 Subject: r300: Move Mesa -> RC program conversion to classic Mesa driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This really doesn't belong into the compiler itself, since the compiler should eventually be independent of Mesa's program representation. Signed-off-by: Nicolai Hähnle --- src/mesa/drivers/dri/r300/Makefile | 1 + .../drivers/dri/r300/compiler/radeon_compiler.h | 2 - .../drivers/dri/r300/compiler/radeon_program.c | 26 ---------- src/mesa/drivers/dri/r300/r300_fragprog_common.c | 3 +- src/mesa/drivers/dri/r300/r300_vertprog.c | 3 +- src/mesa/drivers/dri/r300/radeon_mesa_to_rc.c | 60 ++++++++++++++++++++++ src/mesa/drivers/dri/r300/radeon_mesa_to_rc.h | 36 +++++++++++++ 7 files changed, 101 insertions(+), 30 deletions(-) create mode 100644 src/mesa/drivers/dri/r300/radeon_mesa_to_rc.c create mode 100644 src/mesa/drivers/dri/r300/radeon_mesa_to_rc.h (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/Makefile b/src/mesa/drivers/dri/r300/Makefile index 188efcb7a0..5d1e2c0adc 100644 --- a/src/mesa/drivers/dri/r300/Makefile +++ b/src/mesa/drivers/dri/r300/Makefile @@ -53,6 +53,7 @@ DRIVER_SOURCES = \ r300_vertprog.c \ r300_fragprog_common.c \ r300_shader.c \ + radeon_mesa_to_rc.c \ r300_emit.c \ r300_swtcl.c \ $(RADEON_COMMON_SOURCES) \ diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h index e63ab8840a..fbe7c37dd1 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h @@ -67,8 +67,6 @@ void rc_destroy(struct radeon_compiler * c); void rc_debug(struct radeon_compiler * c, const char * fmt, ...); void rc_error(struct radeon_compiler * c, const char * fmt, ...); -void rc_mesa_to_rc_program(struct radeon_compiler * c, struct gl_program * program); - void rc_calculate_inputs_outputs(struct radeon_compiler * c); void rc_move_input(struct radeon_compiler * c, unsigned input, struct prog_src_register new_input); diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program.c b/src/mesa/drivers/dri/r300/compiler/radeon_program.c index bbbf0dd776..bf7f9ac92c 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program.c @@ -136,32 +136,6 @@ void rc_remove_instruction(struct rc_instruction * inst) } -void rc_mesa_to_rc_program(struct radeon_compiler * c, struct gl_program * program) -{ - struct prog_instruction *source; - unsigned int i; - - for(source = program->Instructions; source->Opcode != OPCODE_END; ++source) { - struct rc_instruction * dest = rc_insert_new_instruction(c, c->Program.Instructions.Prev); - dest->I = *source; - } - - c->Program.ShadowSamplers = program->ShadowSamplers; - c->Program.InputsRead = program->InputsRead; - c->Program.OutputsWritten = program->OutputsWritten; - - for(i = 0; i < program->Parameters->NumParameters; ++i) { - struct rc_constant constant; - - constant.Type = RC_CONSTANT_EXTERNAL; - constant.Size = 4; - constant.u.External = i; - - rc_constants_add(&c->Program.Constants, &constant); - } -} - - /** * Print program to stderr, default options. */ diff --git a/src/mesa/drivers/dri/r300/r300_fragprog_common.c b/src/mesa/drivers/dri/r300/r300_fragprog_common.c index e1dc231027..ea6ff03e61 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog_common.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog_common.c @@ -44,6 +44,7 @@ #include "compiler/radeon_compiler.h" +#include "radeon_mesa_to_rc.h" #include "r300_state.h" @@ -218,7 +219,7 @@ static void translate_fragment_program(GLcontext *ctx, struct r300_fragment_prog fflush(stderr); } - rc_mesa_to_rc_program(&compiler.Base, &cont->Base.Base); + radeon_mesa_to_rc_program(&compiler.Base, &cont->Base.Base); insert_WPOS_trailer(&compiler, fp); diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index 9fe6c18f56..be21268ba5 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -42,6 +42,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "compiler/radeon_compiler.h" #include "compiler/radeon_nqssadce.h" +#include "radeon_mesa_to_rc.h" #include "r300_context.h" #include "r300_state.h" @@ -232,7 +233,7 @@ static struct r300_vertex_program *build_program(GLcontext *ctx, _mesa_insert_mvp_code(ctx, vp->Base); } - rc_mesa_to_rc_program(&compiler.Base, &vp->Base->Base); + radeon_mesa_to_rc_program(&compiler.Base, &vp->Base->Base); rc_move_output(&compiler.Base, VERT_RESULT_PSIZ, VERT_RESULT_PSIZ, WRITEMASK_X); diff --git a/src/mesa/drivers/dri/r300/radeon_mesa_to_rc.c b/src/mesa/drivers/dri/r300/radeon_mesa_to_rc.c new file mode 100644 index 0000000000..13b9d3541f --- /dev/null +++ b/src/mesa/drivers/dri/r300/radeon_mesa_to_rc.c @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2009 Nicolai Haehnle. + * + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 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. + * + */ + +#include "radeon_mesa_to_rc.h" + +#include "main/mtypes.h" +#include "shader/prog_parameter.h" + +#include "compiler/radeon_compiler.h" +#include "compiler/radeon_program.h" + + +void radeon_mesa_to_rc_program(struct radeon_compiler * c, struct gl_program * program) +{ + struct prog_instruction *source; + unsigned int i; + + for(source = program->Instructions; source->Opcode != OPCODE_END; ++source) { + struct rc_instruction * dest = rc_insert_new_instruction(c, c->Program.Instructions.Prev); + dest->I = *source; + } + + c->Program.ShadowSamplers = program->ShadowSamplers; + c->Program.InputsRead = program->InputsRead; + c->Program.OutputsWritten = program->OutputsWritten; + + for(i = 0; i < program->Parameters->NumParameters; ++i) { + struct rc_constant constant; + + constant.Type = RC_CONSTANT_EXTERNAL; + constant.Size = 4; + constant.u.External = i; + + rc_constants_add(&c->Program.Constants, &constant); + } +} diff --git a/src/mesa/drivers/dri/r300/radeon_mesa_to_rc.h b/src/mesa/drivers/dri/r300/radeon_mesa_to_rc.h new file mode 100644 index 0000000000..9511a04f36 --- /dev/null +++ b/src/mesa/drivers/dri/r300/radeon_mesa_to_rc.h @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2009 Nicolai Haehnle. + * + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 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. + * + */ + +#ifndef RADEON_MESA_TO_RC_H +#define RADEON_MESA_TO_RC_H + +struct gl_program; +struct radeon_compiler; + +void radeon_mesa_to_rc_program(struct radeon_compiler * c, struct gl_program * program); + +#endif /* RADEON_MESA_TO_RC_H */ -- cgit v1.2.3 From d1b4351e603522be11061522cb6b685da9ef1fee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= Date: Sun, 30 Aug 2009 18:51:29 +0200 Subject: r300: Remove all Mesa dependencies from the shader compiler MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In particular, this removes the dependency on prog_instruction, which unfortunately creates some code duplication, but also opens a path towards adding some hardware-specific things in there. Signed-off-by: Nicolai Hähnle --- src/mesa/drivers/dri/r300/compiler/Makefile | 1 + src/mesa/drivers/dri/r300/compiler/r300_fragprog.c | 118 ++--- src/mesa/drivers/dri/r300/compiler/r300_fragprog.h | 5 +- .../drivers/dri/r300/compiler/r300_fragprog_emit.c | 96 ++-- .../dri/r300/compiler/r300_fragprog_swizzle.c | 84 ++-- .../dri/r300/compiler/r300_fragprog_swizzle.h | 11 +- src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c | 48 +- src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c | 321 ++++++------- src/mesa/drivers/dri/r300/compiler/r500_fragprog.c | 166 +++---- src/mesa/drivers/dri/r300/compiler/r500_fragprog.h | 9 +- .../drivers/dri/r300/compiler/r500_fragprog_emit.c | 96 ++-- src/mesa/drivers/dri/r300/compiler/radeon_code.c | 14 +- src/mesa/drivers/dri/r300/compiler/radeon_code.h | 23 +- .../drivers/dri/r300/compiler/radeon_compiler.c | 92 ++-- .../drivers/dri/r300/compiler/radeon_compiler.h | 31 +- .../drivers/dri/r300/compiler/radeon_nqssadce.c | 159 +++---- .../drivers/dri/r300/compiler/radeon_nqssadce.h | 13 +- .../drivers/dri/r300/compiler/radeon_opcodes.c | 318 +++++++++++++ .../drivers/dri/r300/compiler/radeon_opcodes.h | 202 ++++++++ .../drivers/dri/r300/compiler/radeon_program.c | 203 ++++++-- .../drivers/dri/r300/compiler/radeon_program.h | 230 +++++++-- .../drivers/dri/r300/compiler/radeon_program_alu.c | 521 ++++++++++----------- .../drivers/dri/r300/compiler/radeon_program_alu.h | 10 +- .../dri/r300/compiler/radeon_program_pair.c | 361 +++++++------- .../dri/r300/compiler/radeon_program_pair.h | 68 +-- src/mesa/drivers/dri/r300/r300_fragprog_common.c | 4 +- src/mesa/drivers/dri/r300/radeon_mesa_to_rc.c | 143 +++++- 27 files changed, 2129 insertions(+), 1218 deletions(-) create mode 100644 src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c create mode 100644 src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/Makefile b/src/mesa/drivers/dri/r300/compiler/Makefile index d973844192..080c79898b 100644 --- a/src/mesa/drivers/dri/r300/compiler/Makefile +++ b/src/mesa/drivers/dri/r300/compiler/Makefile @@ -10,6 +10,7 @@ C_SOURCES = \ radeon_compiler.c \ radeon_nqssadce.c \ radeon_program.c \ + radeon_opcodes.c \ radeon_program_alu.c \ radeon_program_pair.c \ r3xx_fragprog.c \ diff --git a/src/mesa/drivers/dri/r300/compiler/r300_fragprog.c b/src/mesa/drivers/dri/r300/compiler/r300_fragprog.c index 6c9fba4914..94f8fdfea3 100644 --- a/src/mesa/drivers/dri/r300/compiler/r300_fragprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r300_fragprog.c @@ -27,17 +27,17 @@ #include "r300_fragprog.h" -#include "shader/prog_parameter.h" +#include #include "../r300_reg.h" -static struct prog_src_register shadow_ambient(struct radeon_compiler * c, int tmu) +static struct rc_src_register shadow_ambient(struct radeon_compiler * c, int tmu) { - struct prog_src_register reg = { 0, }; + struct rc_src_register reg = { 0, }; - reg.File = PROGRAM_STATE_VAR; + reg.File = RC_FILE_CONSTANT; reg.Index = rc_constants_add_state(&c->Program.Constants, RC_STATE_SHADOW_AMBIENT, tmu); - reg.Swizzle = SWIZZLE_WWWW; + reg.Swizzle = RC_SWIZZLE_WWWW; return reg; } @@ -47,7 +47,7 @@ static struct prog_src_register shadow_ambient(struct radeon_compiler * c, int t * - extract operand swizzles * - introduce a temporary register when write masks are needed */ -GLboolean r300_transform_TEX( +int r300_transform_TEX( struct radeon_compiler * c, struct rc_instruction* inst, void* data) @@ -55,77 +55,77 @@ GLboolean r300_transform_TEX( struct r300_fragment_program_compiler *compiler = (struct r300_fragment_program_compiler*)data; - if (inst->I.Opcode != OPCODE_TEX && - inst->I.Opcode != OPCODE_TXB && - inst->I.Opcode != OPCODE_TXP && - inst->I.Opcode != OPCODE_KIL) - return GL_FALSE; + if (inst->I.Opcode != RC_OPCODE_TEX && + inst->I.Opcode != RC_OPCODE_TXB && + inst->I.Opcode != RC_OPCODE_TXP && + inst->I.Opcode != RC_OPCODE_KIL) + return 0; /* ARB_shadow & EXT_shadow_funcs */ - if (inst->I.Opcode != OPCODE_KIL && + if (inst->I.Opcode != RC_OPCODE_KIL && c->Program.ShadowSamplers & (1 << inst->I.TexSrcUnit)) { - GLuint comparefunc = GL_NEVER + compiler->state.unit[inst->I.TexSrcUnit].texture_compare_func; + rc_compare_func comparefunc = compiler->state.unit[inst->I.TexSrcUnit].texture_compare_func; - if (comparefunc == GL_NEVER || comparefunc == GL_ALWAYS) { - inst->I.Opcode = OPCODE_MOV; + if (comparefunc == RC_COMPARE_FUNC_NEVER || comparefunc == RC_COMPARE_FUNC_ALWAYS) { + inst->I.Opcode = RC_OPCODE_MOV; - if (comparefunc == GL_ALWAYS) { - inst->I.SrcReg[0].File = PROGRAM_BUILTIN; - inst->I.SrcReg[0].Swizzle = SWIZZLE_1111; + if (comparefunc == RC_COMPARE_FUNC_ALWAYS) { + inst->I.SrcReg[0].File = RC_FILE_NONE; + inst->I.SrcReg[0].Swizzle = RC_SWIZZLE_1111; } else { inst->I.SrcReg[0] = shadow_ambient(c, inst->I.TexSrcUnit); } - return GL_TRUE; + return 1; } else { - GLuint comparefunc = GL_NEVER + compiler->state.unit[inst->I.TexSrcUnit].texture_compare_func; - GLuint depthmode = compiler->state.unit[inst->I.TexSrcUnit].depth_texture_mode; + rc_compare_func comparefunc = compiler->state.unit[inst->I.TexSrcUnit].texture_compare_func; + unsigned int depthmode = compiler->state.unit[inst->I.TexSrcUnit].depth_texture_mode; struct rc_instruction * inst_rcp = rc_insert_new_instruction(c, inst); struct rc_instruction * inst_mad = rc_insert_new_instruction(c, inst_rcp); struct rc_instruction * inst_cmp = rc_insert_new_instruction(c, inst_mad); int pass, fail; - inst_rcp->I.Opcode = OPCODE_RCP; - inst_rcp->I.DstReg.File = PROGRAM_TEMPORARY; + inst_rcp->I.Opcode = RC_OPCODE_RCP; + inst_rcp->I.DstReg.File = RC_FILE_TEMPORARY; inst_rcp->I.DstReg.Index = rc_find_free_temporary(c); - inst_rcp->I.DstReg.WriteMask = WRITEMASK_W; + inst_rcp->I.DstReg.WriteMask = RC_MASK_W; inst_rcp->I.SrcReg[0] = inst->I.SrcReg[0]; - inst_rcp->I.SrcReg[0].Swizzle = SWIZZLE_WWWW; + inst_rcp->I.SrcReg[0].Swizzle = RC_SWIZZLE_WWWW; inst_cmp->I.DstReg = inst->I.DstReg; - inst->I.DstReg.File = PROGRAM_TEMPORARY; + inst->I.DstReg.File = RC_FILE_TEMPORARY; inst->I.DstReg.Index = rc_find_free_temporary(c); - inst->I.DstReg.WriteMask = WRITEMASK_XYZW; + inst->I.DstReg.WriteMask = RC_MASK_XYZW; - inst_mad->I.Opcode = OPCODE_MAD; - inst_mad->I.DstReg.File = PROGRAM_TEMPORARY; + inst_mad->I.Opcode = RC_OPCODE_MAD; + inst_mad->I.DstReg.File = RC_FILE_TEMPORARY; inst_mad->I.DstReg.Index = rc_find_free_temporary(c); inst_mad->I.SrcReg[0] = inst->I.SrcReg[0]; - inst_mad->I.SrcReg[0].Swizzle = SWIZZLE_ZZZZ; - inst_mad->I.SrcReg[1].File = PROGRAM_TEMPORARY; + inst_mad->I.SrcReg[0].Swizzle = RC_SWIZZLE_ZZZZ; + inst_mad->I.SrcReg[1].File = RC_FILE_TEMPORARY; inst_mad->I.SrcReg[1].Index = inst_rcp->I.DstReg.Index; - inst_mad->I.SrcReg[1].Swizzle = SWIZZLE_WWWW; - inst_mad->I.SrcReg[2].File = PROGRAM_TEMPORARY; + inst_mad->I.SrcReg[1].Swizzle = RC_SWIZZLE_WWWW; + inst_mad->I.SrcReg[2].File = RC_FILE_TEMPORARY; inst_mad->I.SrcReg[2].Index = inst->I.DstReg.Index; if (depthmode == 0) /* GL_LUMINANCE */ - inst_mad->I.SrcReg[2].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_Z); + inst_mad->I.SrcReg[2].Swizzle = RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_Z); else if (depthmode == 2) /* GL_ALPHA */ - inst_mad->I.SrcReg[2].Swizzle = SWIZZLE_WWWW; + inst_mad->I.SrcReg[2].Swizzle = RC_SWIZZLE_WWWW; /* Recall that SrcReg[0] is tex, SrcReg[2] is r and: * r < tex <=> -tex+r < 0 * r >= tex <=> not (-tex+r < 0 */ - if (comparefunc == GL_LESS || comparefunc == GL_GEQUAL) - inst_mad->I.SrcReg[2].Negate = inst_mad->I.SrcReg[2].Negate ^ NEGATE_XYZW; + if (comparefunc == RC_COMPARE_FUNC_LESS || comparefunc == RC_COMPARE_FUNC_GEQUAL) + inst_mad->I.SrcReg[2].Negate = inst_mad->I.SrcReg[2].Negate ^ RC_MASK_XYZW; else - inst_mad->I.SrcReg[0].Negate = inst_mad->I.SrcReg[0].Negate ^ NEGATE_XYZW; + inst_mad->I.SrcReg[0].Negate = inst_mad->I.SrcReg[0].Negate ^ RC_MASK_XYZW; - inst_cmp->I.Opcode = OPCODE_CMP; + inst_cmp->I.Opcode = RC_OPCODE_CMP; /* DstReg has been filled out above */ - inst_cmp->I.SrcReg[0].File = PROGRAM_TEMPORARY; + inst_cmp->I.SrcReg[0].File = RC_FILE_TEMPORARY; inst_cmp->I.SrcReg[0].Index = inst_mad->I.DstReg.Index; - if (comparefunc == GL_LESS || comparefunc == GL_GREATER) { + if (comparefunc == RC_COMPARE_FUNC_LESS || comparefunc == RC_COMPARE_FUNC_GREATER) { pass = 1; fail = 2; } else { @@ -133,8 +133,8 @@ GLboolean r300_transform_TEX( fail = 1; } - inst_cmp->I.SrcReg[pass].File = PROGRAM_BUILTIN; - inst_cmp->I.SrcReg[pass].Swizzle = SWIZZLE_1111; + inst_cmp->I.SrcReg[pass].File = RC_FILE_NONE; + inst_cmp->I.SrcReg[pass].Swizzle = RC_SWIZZLE_1111; inst_cmp->I.SrcReg[fail] = shadow_ambient(c, inst->I.TexSrcUnit); } } @@ -143,52 +143,52 @@ GLboolean r300_transform_TEX( * instead of [0..Width]x[0..Height]. * Add a scaling instruction. */ - if (inst->I.Opcode != OPCODE_KIL && inst->I.TexSrcTarget == TEXTURE_RECT_INDEX) { + if (inst->I.Opcode != RC_OPCODE_KIL && inst->I.TexSrcTarget == RC_TEXTURE_RECT) { struct rc_instruction * inst_mul = rc_insert_new_instruction(c, inst->Prev); - inst_mul->I.Opcode = OPCODE_MUL; - inst_mul->I.DstReg.File = PROGRAM_TEMPORARY; + inst_mul->I.Opcode = RC_OPCODE_MUL; + inst_mul->I.DstReg.File = RC_FILE_TEMPORARY; inst_mul->I.DstReg.Index = rc_find_free_temporary(c); inst_mul->I.SrcReg[0] = inst->I.SrcReg[0]; - inst_mul->I.SrcReg[1].File = PROGRAM_STATE_VAR; + inst_mul->I.SrcReg[1].File = RC_FILE_CONSTANT; inst_mul->I.SrcReg[1].Index = rc_constants_add_state(&c->Program.Constants, RC_STATE_R300_TEXRECT_FACTOR, inst->I.TexSrcUnit); reset_srcreg(&inst->I.SrcReg[0]); - inst->I.SrcReg[0].File = PROGRAM_TEMPORARY; + inst->I.SrcReg[0].File = RC_FILE_TEMPORARY; inst->I.SrcReg[0].Index = inst_mul->I.DstReg.Index; } /* Cannot write texture to output registers or with masks */ - if (inst->I.Opcode != OPCODE_KIL && - (inst->I.DstReg.File != PROGRAM_TEMPORARY || inst->I.DstReg.WriteMask != WRITEMASK_XYZW)) { + if (inst->I.Opcode != RC_OPCODE_KIL && + (inst->I.DstReg.File != RC_FILE_TEMPORARY || inst->I.DstReg.WriteMask != RC_MASK_XYZW)) { struct rc_instruction * inst_mov = rc_insert_new_instruction(c, inst); - inst_mov->I.Opcode = OPCODE_MOV; + inst_mov->I.Opcode = RC_OPCODE_MOV; inst_mov->I.DstReg = inst->I.DstReg; - inst_mov->I.SrcReg[0].File = PROGRAM_TEMPORARY; + inst_mov->I.SrcReg[0].File = RC_FILE_TEMPORARY; inst_mov->I.SrcReg[0].Index = rc_find_free_temporary(c); - inst->I.DstReg.File = PROGRAM_TEMPORARY; + inst->I.DstReg.File = RC_FILE_TEMPORARY; inst->I.DstReg.Index = inst_mov->I.SrcReg[0].Index; - inst->I.DstReg.WriteMask = WRITEMASK_XYZW; + inst->I.DstReg.WriteMask = RC_MASK_XYZW; } /* Cannot read texture coordinate from constants file */ - if (inst->I.SrcReg[0].File != PROGRAM_TEMPORARY && inst->I.SrcReg[0].File != PROGRAM_INPUT) { + if (inst->I.SrcReg[0].File != RC_FILE_TEMPORARY && inst->I.SrcReg[0].File != RC_FILE_INPUT) { struct rc_instruction * inst_mov = rc_insert_new_instruction(c, inst->Prev); - inst_mov->I.Opcode = OPCODE_MOV; - inst_mov->I.DstReg.File = PROGRAM_TEMPORARY; + inst_mov->I.Opcode = RC_OPCODE_MOV; + inst_mov->I.DstReg.File = RC_FILE_TEMPORARY; inst_mov->I.DstReg.Index = rc_find_free_temporary(c); inst_mov->I.SrcReg[0] = inst->I.SrcReg[0]; reset_srcreg(&inst->I.SrcReg[0]); - inst->I.SrcReg[0].File = PROGRAM_TEMPORARY; + inst->I.SrcReg[0].File = RC_FILE_TEMPORARY; inst->I.SrcReg[0].Index = inst_mov->I.DstReg.Index; } - return GL_TRUE; + return 1; } /* just some random things... */ diff --git a/src/mesa/drivers/dri/r300/compiler/r300_fragprog.h b/src/mesa/drivers/dri/r300/compiler/r300_fragprog.h index 0ac46dbd9c..418df36c93 100644 --- a/src/mesa/drivers/dri/r300/compiler/r300_fragprog.h +++ b/src/mesa/drivers/dri/r300/compiler/r300_fragprog.h @@ -33,9 +33,6 @@ #ifndef __R300_FRAGPROG_H_ #define __R300_FRAGPROG_H_ -#include "shader/program.h" -#include "shader/prog_instruction.h" - #include "radeon_compiler.h" #include "radeon_program.h" @@ -44,6 +41,6 @@ extern void r300BuildFragmentProgramHwCode(struct r300_fragment_program_compiler extern void r300FragmentProgramDump(struct rX00_fragment_program_code *c); -extern GLboolean r300_transform_TEX(struct radeon_compiler * c, struct rc_instruction* inst, void* data); +extern int r300_transform_TEX(struct radeon_compiler * c, struct rc_instruction* inst, void* data); #endif diff --git a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c index 305dc074ee..58953f6b04 100644 --- a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c +++ b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c @@ -69,64 +69,64 @@ struct r300_emit_state { /** * Mark a temporary register as used. */ -static void use_temporary(struct r300_fragment_program_code *code, GLuint index) +static void use_temporary(struct r300_fragment_program_code *code, unsigned int index) { if (index > code->pixsize) code->pixsize = index; } -static GLuint translate_rgb_opcode(struct r300_fragment_program_compiler * c, GLuint opcode) +static unsigned int translate_rgb_opcode(struct r300_fragment_program_compiler * c, rc_opcode opcode) { switch(opcode) { - case OPCODE_CMP: return R300_ALU_OUTC_CMP; - case OPCODE_DP3: return R300_ALU_OUTC_DP3; - case OPCODE_DP4: return R300_ALU_OUTC_DP4; - case OPCODE_FRC: return R300_ALU_OUTC_FRC; + case RC_OPCODE_CMP: return R300_ALU_OUTC_CMP; + case RC_OPCODE_DP3: return R300_ALU_OUTC_DP3; + case RC_OPCODE_DP4: return R300_ALU_OUTC_DP4; + case RC_OPCODE_FRC: return R300_ALU_OUTC_FRC; default: error("translate_rgb_opcode(%i): Unknown opcode", opcode); /* fall through */ - case OPCODE_NOP: + case RC_OPCODE_NOP: /* fall through */ - case OPCODE_MAD: return R300_ALU_OUTC_MAD; - case OPCODE_MAX: return R300_ALU_OUTC_MAX; - case OPCODE_MIN: return R300_ALU_OUTC_MIN; - case OPCODE_REPL_ALPHA: return R300_ALU_OUTC_REPL_ALPHA; + case RC_OPCODE_MAD: return R300_ALU_OUTC_MAD; + case RC_OPCODE_MAX: return R300_ALU_OUTC_MAX; + case RC_OPCODE_MIN: return R300_ALU_OUTC_MIN; + case RC_OPCODE_REPL_ALPHA: return R300_ALU_OUTC_REPL_ALPHA; } } -static GLuint translate_alpha_opcode(struct r300_fragment_program_compiler * c, GLuint opcode) +static unsigned int translate_alpha_opcode(struct r300_fragment_program_compiler * c, rc_opcode opcode) { switch(opcode) { - case OPCODE_CMP: return R300_ALU_OUTA_CMP; - case OPCODE_DP3: return R300_ALU_OUTA_DP4; - case OPCODE_DP4: return R300_ALU_OUTA_DP4; - case OPCODE_EX2: return R300_ALU_OUTA_EX2; - case OPCODE_FRC: return R300_ALU_OUTA_FRC; - case OPCODE_LG2: return R300_ALU_OUTA_LG2; + case RC_OPCODE_CMP: return R300_ALU_OUTA_CMP; + case RC_OPCODE_DP3: return R300_ALU_OUTA_DP4; + case RC_OPCODE_DP4: return R300_ALU_OUTA_DP4; + case RC_OPCODE_EX2: return R300_ALU_OUTA_EX2; + case RC_OPCODE_FRC: return R300_ALU_OUTA_FRC; + case RC_OPCODE_LG2: return R300_ALU_OUTA_LG2; default: error("translate_rgb_opcode(%i): Unknown opcode", opcode); /* fall through */ - case OPCODE_NOP: + case RC_OPCODE_NOP: /* fall through */ - case OPCODE_MAD: return R300_ALU_OUTA_MAD; - case OPCODE_MAX: return R300_ALU_OUTA_MAX; - case OPCODE_MIN: return R300_ALU_OUTA_MIN; - case OPCODE_RCP: return R300_ALU_OUTA_RCP; - case OPCODE_RSQ: return R300_ALU_OUTA_RSQ; + case RC_OPCODE_MAD: return R300_ALU_OUTA_MAD; + case RC_OPCODE_MAX: return R300_ALU_OUTA_MAX; + case RC_OPCODE_MIN: return R300_ALU_OUTA_MIN; + case RC_OPCODE_RCP: return R300_ALU_OUTA_RCP; + case RC_OPCODE_RSQ: return R300_ALU_OUTA_RSQ; } } /** * Emit one paired ALU instruction. */ -static GLboolean emit_alu(void* data, struct radeon_pair_instruction* inst) +static int emit_alu(void* data, struct radeon_pair_instruction* inst) { PROG_CODE; if (code->alu.length >= R300_PFS_MAX_ALU_INST) { error("Too many ALU instructions"); - return GL_FALSE; + return 0; } int ip = code->alu.length++; @@ -136,7 +136,7 @@ static GLboolean emit_alu(void* data, struct radeon_pair_instruction* inst) code->alu.inst[ip].alpha_inst = translate_alpha_opcode(c, inst->Alpha.Opcode); for(j = 0; j < 3; ++j) { - GLuint src = inst->RGB.Src[j].Index | (inst->RGB.Src[j].Constant << 5); + unsigned int src = inst->RGB.Src[j].Index | (inst->RGB.Src[j].Constant << 5); if (!inst->RGB.Src[j].Constant) use_temporary(code, inst->RGB.Src[j].Index); code->alu.inst[ip].rgb_addr |= src << (6*j); @@ -146,7 +146,7 @@ static GLboolean emit_alu(void* data, struct radeon_pair_instruction* inst) use_temporary(code, inst->Alpha.Src[j].Index); code->alu.inst[ip].alpha_addr |= src << (6*j); - GLuint arg = r300FPTranslateRGBSwizzle(inst->RGB.Arg[j].Source, inst->RGB.Arg[j].Swizzle); + unsigned int arg = r300FPTranslateRGBSwizzle(inst->RGB.Arg[j].Source, inst->RGB.Arg[j].Swizzle); arg |= inst->RGB.Arg[j].Abs << 6; arg |= inst->RGB.Arg[j].Negate << 5; code->alu.inst[ip].rgb_inst |= arg << (7*j); @@ -186,17 +186,17 @@ static GLboolean emit_alu(void* data, struct radeon_pair_instruction* inst) if (inst->Alpha.DepthWriteMask) { code->alu.inst[ip].alpha_addr |= R300_ALU_DSTA_DEPTH; emit->node_flags |= R300_W_OUT; - c->code->writes_depth = GL_TRUE; + c->code->writes_depth = 1; } - return GL_TRUE; + return 1; } /** * Finish the current node without advancing to the next one. */ -static GLboolean finish_node(struct r300_emit_state * emit) +static int finish_node(struct r300_emit_state * emit) { struct r300_fragment_program_compiler * c = emit->compiler; struct r300_fragment_program_code *code = &emit->compiler->code->code.r300; @@ -204,9 +204,9 @@ static GLboolean finish_node(struct r300_emit_state * emit) if (code->alu.length == emit->node_first_alu) { /* Generate a single NOP for this node */ struct radeon_pair_instruction inst; - _mesa_bzero(&inst, sizeof(inst)); + memset(&inst, 0, sizeof(inst)); if (!emit_alu(emit, &inst)) - return GL_FALSE; + return 0; } unsigned alu_offset = emit->node_first_alu; @@ -217,7 +217,7 @@ static GLboolean finish_node(struct r300_emit_state * emit) if (code->tex.length == emit->node_first_tex) { if (emit->current_node > 0) { error("Node %i has no TEX instructions", emit->current_node); - return GL_FALSE; + return 0; } tex_end = 0; @@ -240,7 +240,7 @@ static GLboolean finish_node(struct r300_emit_state * emit) (tex_end << R300_TEX_SIZE_SHIFT) | emit->node_flags; - return GL_TRUE; + return 1; } @@ -248,43 +248,43 @@ static GLboolean finish_node(struct r300_emit_state * emit) * Begin a block of texture instructions. * Create the necessary indirection. */ -static GLboolean begin_tex(void* data) +static int begin_tex(void* data) { PROG_CODE; if (code->alu.length == emit->node_first_alu && code->tex.length == emit->node_first_tex) { - return GL_TRUE; + return 1; } if (emit->current_node == 3) { error("Too many texture indirections"); - return GL_FALSE; + return 0; } if (!finish_node(emit)) - return GL_FALSE; + return 0; emit->current_node++; emit->node_first_tex = code->tex.length; emit->node_first_alu = code->alu.length; emit->node_flags = 0; - return GL_TRUE; + return 1; } -static GLboolean emit_tex(void* data, struct radeon_pair_texture_instruction* inst) +static int emit_tex(void* data, struct radeon_pair_texture_instruction* inst) { PROG_CODE; if (code->tex.length >= R300_PFS_MAX_TEX_INST) { error("Too many TEX instructions"); - return GL_FALSE; + return 0; } - GLuint unit = inst->TexSrcUnit; - GLuint dest = inst->DestIndex; - GLuint opcode; + unsigned int unit = inst->TexSrcUnit; + unsigned int dest = inst->DestIndex; + unsigned int opcode; switch(inst->Opcode) { case RADEON_OPCODE_KIL: opcode = R300_TEX_OP_KIL; break; @@ -293,7 +293,7 @@ static GLboolean emit_tex(void* data, struct radeon_pair_texture_instruction* in case RADEON_OPCODE_TXP: opcode = R300_TEX_OP_TXP; break; default: error("Unknown texture opcode %i", inst->Opcode); - return GL_FALSE; + return 0; } if (inst->Opcode == RADEON_OPCODE_KIL) { @@ -310,7 +310,7 @@ static GLboolean emit_tex(void* data, struct radeon_pair_texture_instruction* in (dest << R300_DST_ADDR_SHIFT) | (unit << R300_TEX_ID_SHIFT) | (opcode << R300_TEX_INST_SHIFT); - return GL_TRUE; + return 1; } @@ -333,7 +333,7 @@ void r300BuildFragmentProgramHwCode(struct r300_fragment_program_compiler *compi memset(&emit, 0, sizeof(emit)); emit.compiler = compiler; - _mesa_bzero(code, sizeof(struct r300_fragment_program_code)); + memset(code, 0, sizeof(struct r300_fragment_program_code)); radeonPairProgram(compiler, &pair_handler, &emit); if (compiler->Base.Error) diff --git a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_swizzle.c b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_swizzle.c index 1b14cc3888..ded6966d08 100644 --- a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_swizzle.c +++ b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_swizzle.c @@ -33,16 +33,18 @@ #include "r300_fragprog_swizzle.h" +#include + #include "../r300_reg.h" #include "radeon_nqssadce.h" #include "radeon_compiler.h" -#define MAKE_SWZ3(x, y, z) (MAKE_SWIZZLE4(SWIZZLE_##x, SWIZZLE_##y, SWIZZLE_##z, SWIZZLE_ZERO)) +#define MAKE_SWZ3(x, y, z) (RC_MAKE_SWIZZLE(RC_SWIZZLE_##x, RC_SWIZZLE_##y, RC_SWIZZLE_##z, RC_SWIZZLE_ZERO)) struct swizzle_data { - GLuint hash; /**< swizzle value this matches */ - GLuint base; /**< base value for hw swizzle */ - GLuint stride; /**< difference in base between arg0/1/2 */ + unsigned int hash; /**< swizzle value this matches */ + unsigned int base; /**< base value for hw swizzle */ + unsigned int stride; /**< difference in base between arg0/1/2 */ }; static const struct swizzle_data native_swizzles[] = { @@ -65,15 +67,15 @@ static const int num_native_swizzles = sizeof(native_swizzles)/sizeof(native_swi * Find a native RGB swizzle that matches the given swizzle. * Returns 0 if none found. */ -static const struct swizzle_data* lookup_native_swizzle(GLuint swizzle) +static const struct swizzle_data* lookup_native_swizzle(unsigned int swizzle) { int i, comp; for(i = 0; i < num_native_swizzles; ++i) { const struct swizzle_data* sd = &native_swizzles[i]; for(comp = 0; comp < 3; ++comp) { - GLuint swz = GET_SWZ(swizzle, comp); - if (swz == SWIZZLE_NIL) + unsigned int swz = GET_SWZ(swizzle, comp); + if (swz == RC_SWIZZLE_UNUSED) continue; if (swz != GET_SWZ(sd->hash, comp)) break; @@ -90,71 +92,71 @@ static const struct swizzle_data* lookup_native_swizzle(GLuint swizzle) * Check whether the given instruction supports the swizzle and negate * combinations in the given source register. */ -GLboolean r300FPIsNativeSwizzle(GLuint opcode, struct prog_src_register reg) +int r300FPIsNativeSwizzle(rc_opcode opcode, struct rc_src_register reg) { if (reg.Abs) - reg.Negate = NEGATE_NONE; + reg.Negate = RC_MASK_NONE; - if (opcode == OPCODE_KIL || - opcode == OPCODE_TEX || - opcode == OPCODE_TXB || - opcode == OPCODE_TXP) { + if (opcode == RC_OPCODE_KIL || + opcode == RC_OPCODE_TEX || + opcode == RC_OPCODE_TXB || + opcode == RC_OPCODE_TXP) { int j; if (reg.Abs || reg.Negate) - return GL_FALSE; + return 0; for(j = 0; j < 4; ++j) { - GLuint swz = GET_SWZ(reg.Swizzle, j); - if (swz == SWIZZLE_NIL) + unsigned int swz = GET_SWZ(reg.Swizzle, j); + if (swz == RC_SWIZZLE_UNUSED) continue; if (swz != j) - return GL_FALSE; + return 0; } - return GL_TRUE; + return 1; } - GLuint relevant = 0; + unsigned int relevant = 0; int j; for(j = 0; j < 3; ++j) - if (GET_SWZ(reg.Swizzle, j) != SWIZZLE_NIL) + if (GET_SWZ(reg.Swizzle, j) != RC_SWIZZLE_UNUSED) relevant |= 1 << j; if ((reg.Negate & relevant) && ((reg.Negate & relevant) != relevant)) - return GL_FALSE; + return 0; if (!lookup_native_swizzle(reg.Swizzle)) - return GL_FALSE; + return 0; - return GL_TRUE; + return 1; } /** * Generate MOV dst, src using only native swizzles. */ -void r300FPBuildSwizzle(struct nqssadce_state *s, struct prog_dst_register dst, struct prog_src_register src) +void r300FPBuildSwizzle(struct nqssadce_state *s, struct rc_dst_register dst, struct rc_src_register src) { if (src.Abs) - src.Negate = NEGATE_NONE; + src.Negate = RC_MASK_NONE; while(dst.WriteMask) { const struct swizzle_data *best_swizzle = 0; - GLuint best_matchcount = 0; - GLuint best_matchmask = 0; + unsigned int best_matchcount = 0; + unsigned int best_matchmask = 0; int i, comp; for(i = 0; i < num_native_swizzles; ++i) { const struct swizzle_data *sd = &native_swizzles[i]; - GLuint matchcount = 0; - GLuint matchmask = 0; + unsigned int matchcount = 0; + unsigned int matchmask = 0; for(comp = 0; comp < 3; ++comp) { if (!GET_BIT(dst.WriteMask, comp)) continue; - GLuint swz = GET_SWZ(src.Swizzle, comp); - if (swz == SWIZZLE_NIL) + unsigned int swz = GET_SWZ(src.Swizzle, comp); + if (swz == RC_SWIZZLE_UNUSED) continue; if (swz == GET_SWZ(sd->hash, comp)) { /* check if the negate bit of current component @@ -170,17 +172,17 @@ void r300FPBuildSwizzle(struct nqssadce_state *s, struct prog_dst_register dst, best_swizzle = sd; best_matchcount = matchcount; best_matchmask = matchmask; - if (matchmask == (dst.WriteMask & WRITEMASK_XYZ)) + if (matchmask == (dst.WriteMask & RC_MASK_XYZ)) break; } } struct rc_instruction *inst = rc_insert_new_instruction(s->Compiler, s->IP->Prev); - inst->I.Opcode = OPCODE_MOV; + inst->I.Opcode = RC_OPCODE_MOV; inst->I.DstReg = dst; - inst->I.DstReg.WriteMask &= (best_matchmask | WRITEMASK_W); + inst->I.DstReg.WriteMask &= (best_matchmask | RC_MASK_W); inst->I.SrcReg[0] = src; - inst->I.SrcReg[0].Negate = (best_matchmask & src.Negate) ? NEGATE_XYZW : NEGATE_NONE; + inst->I.SrcReg[0].Negate = (best_matchmask & src.Negate) ? RC_MASK_XYZW : RC_MASK_NONE; /* Note: We rely on NqSSA/DCE to set unused swizzle components to NIL */ dst.WriteMask &= ~inst->I.DstReg.WriteMask; @@ -192,12 +194,12 @@ void r300FPBuildSwizzle(struct nqssadce_state *s, struct prog_dst_register dst, * Translate an RGB (XYZ) swizzle into the hardware code for the given * instruction source. */ -GLuint r300FPTranslateRGBSwizzle(GLuint src, GLuint swizzle) +unsigned int r300FPTranslateRGBSwizzle(unsigned int src, unsigned int swizzle) { const struct swizzle_data* sd = lookup_native_swizzle(swizzle); if (!sd) { - _mesa_printf("Not a native swizzle: %08x\n", swizzle); + fprintf(stderr, "Not a native swizzle: %08x\n", swizzle); return 0; } @@ -209,15 +211,15 @@ GLuint r300FPTranslateRGBSwizzle(GLuint src, GLuint swizzle) * Translate an Alpha (W) swizzle into the hardware code for the given * instruction source. */ -GLuint r300FPTranslateAlphaSwizzle(GLuint src, GLuint swizzle) +unsigned int r300FPTranslateAlphaSwizzle(unsigned int src, unsigned int swizzle) { if (swizzle < 3) return swizzle + 3*src; switch(swizzle) { - case SWIZZLE_W: return R300_ALU_ARGA_SRC0A + src; - case SWIZZLE_ONE: return R300_ALU_ARGA_ONE; - case SWIZZLE_ZERO: return R300_ALU_ARGA_ZERO; + case RC_SWIZZLE_W: return R300_ALU_ARGA_SRC0A + src; + case RC_SWIZZLE_ONE: return R300_ALU_ARGA_ONE; + case RC_SWIZZLE_ZERO: return R300_ALU_ARGA_ZERO; default: return R300_ALU_ARGA_ONE; } } diff --git a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_swizzle.h b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_swizzle.h index 231bf4eef5..728c2cd972 100644 --- a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_swizzle.h +++ b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_swizzle.h @@ -28,15 +28,14 @@ #ifndef __R300_FRAGPROG_SWIZZLE_H_ #define __R300_FRAGPROG_SWIZZLE_H_ -#include "main/glheader.h" -#include "shader/prog_instruction.h" +#include "radeon_program.h" struct nqssadce_state; -GLboolean r300FPIsNativeSwizzle(GLuint opcode, struct prog_src_register reg); -void r300FPBuildSwizzle(struct nqssadce_state*, struct prog_dst_register dst, struct prog_src_register src); +int r300FPIsNativeSwizzle(rc_opcode opcode, struct rc_src_register reg); +void r300FPBuildSwizzle(struct nqssadce_state*, struct rc_dst_register dst, struct rc_src_register src); -GLuint r300FPTranslateRGBSwizzle(GLuint src, GLuint swizzle); -GLuint r300FPTranslateAlphaSwizzle(GLuint src, GLuint swizzle); +unsigned int r300FPTranslateRGBSwizzle(unsigned int src, unsigned int swizzle); +unsigned int r300FPTranslateAlphaSwizzle(unsigned int src, unsigned int swizzle); #endif /* __R300_FRAGPROG_SWIZZLE_H_ */ diff --git a/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c b/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c index 76c3a7ecfd..0aa40c0587 100644 --- a/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c @@ -22,9 +22,7 @@ #include "radeon_compiler.h" -#include "shader/prog_parameter.h" -#include "shader/prog_print.h" -#include "shader/prog_statevars.h" +#include #include "radeon_nqssadce.h" #include "radeon_program_alu.h" @@ -36,8 +34,8 @@ static void nqssadce_init(struct nqssadce_state* s) { struct r300_fragment_program_compiler * c = s->UserData; - s->Outputs[c->OutputColor].Sourced = WRITEMASK_XYZW; - s->Outputs[c->OutputDepth].Sourced = WRITEMASK_W; + s->Outputs[c->OutputColor].Sourced = RC_MASK_XYZW; + s->Outputs[c->OutputDepth].Sourced = RC_MASK_W; } static void rewrite_depth_out(struct r300_fragment_program_compiler * c) @@ -45,35 +43,35 @@ static void rewrite_depth_out(struct r300_fragment_program_compiler * c) struct rc_instruction *rci; for (rci = c->Base.Program.Instructions.Next; rci != &c->Base.Program.Instructions; rci = rci->Next) { - struct prog_instruction * inst = &rci->I; + struct rc_sub_instruction * inst = &rci->I; - if (inst->DstReg.File != PROGRAM_OUTPUT || inst->DstReg.Index != c->OutputDepth) + if (inst->DstReg.File != RC_FILE_OUTPUT || inst->DstReg.Index != c->OutputDepth) continue; - if (inst->DstReg.WriteMask & WRITEMASK_Z) { - inst->DstReg.WriteMask = WRITEMASK_W; + if (inst->DstReg.WriteMask & RC_MASK_Z) { + inst->DstReg.WriteMask = RC_MASK_W; } else { inst->DstReg.WriteMask = 0; continue; } switch (inst->Opcode) { - case OPCODE_FRC: - case OPCODE_MOV: - inst->SrcReg[0] = lmul_swizzle(SWIZZLE_ZZZZ, inst->SrcReg[0]); + case RC_OPCODE_FRC: + case RC_OPCODE_MOV: + inst->SrcReg[0] = lmul_swizzle(RC_SWIZZLE_ZZZZ, inst->SrcReg[0]); break; - case OPCODE_ADD: - case OPCODE_MAX: - case OPCODE_MIN: - case OPCODE_MUL: - inst->SrcReg[0] = lmul_swizzle(SWIZZLE_ZZZZ, inst->SrcReg[0]); - inst->SrcReg[1] = lmul_swizzle(SWIZZLE_ZZZZ, inst->SrcReg[1]); + case RC_OPCODE_ADD: + case RC_OPCODE_MAX: + case RC_OPCODE_MIN: + case RC_OPCODE_MUL: + inst->SrcReg[0] = lmul_swizzle(RC_SWIZZLE_ZZZZ, inst->SrcReg[0]); + inst->SrcReg[1] = lmul_swizzle(RC_SWIZZLE_ZZZZ, inst->SrcReg[1]); break; - case OPCODE_CMP: - case OPCODE_MAD: - inst->SrcReg[0] = lmul_swizzle(SWIZZLE_ZZZZ, inst->SrcReg[0]); - inst->SrcReg[1] = lmul_swizzle(SWIZZLE_ZZZZ, inst->SrcReg[1]); - inst->SrcReg[2] = lmul_swizzle(SWIZZLE_ZZZZ, inst->SrcReg[2]); + case RC_OPCODE_CMP: + case RC_OPCODE_MAD: + inst->SrcReg[0] = lmul_swizzle(RC_SWIZZLE_ZZZZ, inst->SrcReg[0]); + inst->SrcReg[1] = lmul_swizzle(RC_SWIZZLE_ZZZZ, inst->SrcReg[1]); + inst->SrcReg[2] = lmul_swizzle(RC_SWIZZLE_ZZZZ, inst->SrcReg[2]); break; default: // Scalar instructions needn't be reswizzled @@ -104,7 +102,7 @@ void r3xx_compile_fragment_program(struct r300_fragment_program_compiler* c) } if (c->Base.Debug) { - _mesa_printf("Fragment Program: After native rewrite:\n"); + fprintf(stderr, "Fragment Program: After native rewrite:\n"); rc_print_program(&c->Base.Program); fflush(stderr); } @@ -126,7 +124,7 @@ void r3xx_compile_fragment_program(struct r300_fragment_program_compiler* c) } if (c->Base.Debug) { - _mesa_printf("Compiler: after NqSSA-DCE:\n"); + fprintf(stderr, "Compiler: after NqSSA-DCE:\n"); rc_print_program(&c->Base.Program); fflush(stderr); } diff --git a/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c b/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c index 93a516105e..0efd2c91e6 100644 --- a/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c @@ -22,14 +22,14 @@ #include "radeon_compiler.h" +#include + #include "../r300_reg.h" #include "radeon_nqssadce.h" #include "radeon_program.h" #include "radeon_program_alu.h" -#include "shader/prog_print.h" - /* * Take an already-setup and valid source then swizzle it appropriately to @@ -42,103 +42,82 @@ t_swizzle(y), \ t_swizzle(y), \ t_src_class(vpi->SrcReg[x].File), \ - NEGATE_NONE) | (vpi->SrcReg[x].RelAddr << 4)) + RC_MASK_NONE) | (vpi->SrcReg[x].RelAddr << 4)) -static unsigned long t_dst_mask(GLuint mask) +static unsigned long t_dst_mask(unsigned int mask) { - /* WRITEMASK_* is equivalent to VSF_FLAG_* */ - return mask & WRITEMASK_XYZW; + /* RC_MASK_* is equivalent to VSF_FLAG_* */ + return mask & RC_MASK_XYZW; } -static unsigned long t_dst_class(gl_register_file file) +static unsigned long t_dst_class(rc_register_file file) { - switch (file) { - case PROGRAM_TEMPORARY: + default: + fprintf(stderr, "%s: Bad register file %i\n", __FUNCTION__, file); + /* fall-through */ + case RC_FILE_TEMPORARY: return PVS_DST_REG_TEMPORARY; - case PROGRAM_OUTPUT: + case RC_FILE_OUTPUT: return PVS_DST_REG_OUT; - case PROGRAM_ADDRESS: + case RC_FILE_ADDRESS: return PVS_DST_REG_A0; - /* - case PROGRAM_INPUT: - case PROGRAM_LOCAL_PARAM: - case PROGRAM_ENV_PARAM: - case PROGRAM_NAMED_PARAM: - case PROGRAM_STATE_VAR: - case PROGRAM_WRITE_ONLY: - case PROGRAM_ADDRESS: - */ - default: - fprintf(stderr, "problem in %s", __FUNCTION__); - _mesa_exit(-1); - return -1; } } static unsigned long t_dst_index(struct r300_vertex_program_code *vp, - struct prog_dst_register *dst) + struct rc_dst_register *dst) { - if (dst->File == PROGRAM_OUTPUT) + if (dst->File == RC_FILE_OUTPUT) return vp->outputs[dst->Index]; return dst->Index; } -static unsigned long t_src_class(gl_register_file file) +static unsigned long t_src_class(rc_register_file file) { switch (file) { - case PROGRAM_TEMPORARY: + default: + fprintf(stderr, "%s: Bad register file %i\n", __FUNCTION__, file); + /* fall-through */ + case RC_FILE_TEMPORARY: return PVS_SRC_REG_TEMPORARY; - case PROGRAM_INPUT: + case RC_FILE_INPUT: return PVS_SRC_REG_INPUT; - case PROGRAM_LOCAL_PARAM: - case PROGRAM_ENV_PARAM: - case PROGRAM_NAMED_PARAM: - case PROGRAM_CONSTANT: - case PROGRAM_STATE_VAR: + case RC_FILE_CONSTANT: return PVS_SRC_REG_CONSTANT; - /* - case PROGRAM_OUTPUT: - case PROGRAM_WRITE_ONLY: - case PROGRAM_ADDRESS: - */ - default: - fprintf(stderr, "problem in %s", __FUNCTION__); - _mesa_exit(-1); - return -1; } } -static GLboolean t_src_conflict(struct prog_src_register a, struct prog_src_register b) +static int t_src_conflict(struct rc_src_register a, struct rc_src_register b) { unsigned long aclass = t_src_class(a.File); unsigned long bclass = t_src_class(b.File); if (aclass != bclass) - return GL_FALSE; + return 0; if (aclass == PVS_SRC_REG_TEMPORARY) - return GL_FALSE; + return 0; if (a.RelAddr || b.RelAddr) - return GL_TRUE; + return 1; if (a.Index != b.Index) - return GL_TRUE; + return 1; - return GL_FALSE; + return 0; } -static INLINE unsigned long t_swizzle(GLubyte swizzle) +static inline unsigned long t_swizzle(unsigned int swizzle) { - /* this is in fact a NOP as the Mesa SWIZZLE_* are all identical to VSF_IN_COMPONENT_* */ + /* this is in fact a NOP as the Mesa RC_SWIZZLE_* are all identical to VSF_IN_COMPONENT_* */ return swizzle; } static unsigned long t_src_index(struct r300_vertex_program_code *vp, - struct prog_src_register *src) + struct rc_src_register *src) { - if (src->File == PROGRAM_INPUT) { + if (src->File == RC_FILE_INPUT) { assert(vp->inputs[src->Index] != -1); return vp->inputs[src->Index]; } else { @@ -154,9 +133,9 @@ static unsigned long t_src_index(struct r300_vertex_program_code *vp, /* these two functions should probably be merged... */ static unsigned long t_src(struct r300_vertex_program_code *vp, - struct prog_src_register *src) + struct rc_src_register *src) { - /* src->Negate uses the NEGATE_ flags from program_instruction.h, + /* src->Negate uses the RC_MASK_ flags from program_instruction.h, * which equal our VSF_FLAGS_ values, so it's safe to just pass it here. */ return PVS_SRC_OPERAND(t_src_index(vp, src), @@ -169,9 +148,9 @@ static unsigned long t_src(struct r300_vertex_program_code *vp, } static unsigned long t_src_scalar(struct r300_vertex_program_code *vp, - struct prog_src_register *src) + struct rc_src_register *src) { - /* src->Negate uses the NEGATE_ flags from program_instruction.h, + /* src->Negate uses the RC_MASK_ flags from program_instruction.h, * which equal our VSF_FLAGS_ values, so it's safe to just pass it here. */ return PVS_SRC_OPERAND(t_src_index(vp, src), @@ -180,79 +159,79 @@ static unsigned long t_src_scalar(struct r300_vertex_program_code *vp, t_swizzle(GET_SWZ(src->Swizzle, 0)), t_swizzle(GET_SWZ(src->Swizzle, 0)), t_src_class(src->File), - src->Negate ? NEGATE_XYZW : NEGATE_NONE) | + src->Negate ? RC_MASK_XYZW : RC_MASK_NONE) | (src->RelAddr << 4); } -static GLboolean valid_dst(struct r300_vertex_program_code *vp, - struct prog_dst_register *dst) +static int valid_dst(struct r300_vertex_program_code *vp, + struct rc_dst_register *dst) { - if (dst->File == PROGRAM_OUTPUT && vp->outputs[dst->Index] == -1) { - return GL_FALSE; - } else if (dst->File == PROGRAM_ADDRESS) { + if (dst->File == RC_FILE_OUTPUT && vp->outputs[dst->Index] == -1) { + return 0; + } else if (dst->File == RC_FILE_ADDRESS) { assert(dst->Index == 0); } - return GL_TRUE; + return 1; } static void ei_vector1(struct r300_vertex_program_code *vp, - GLuint hw_opcode, - struct prog_instruction *vpi, - GLuint * inst) + unsigned int hw_opcode, + struct rc_sub_instruction *vpi, + unsigned int * inst) { inst[0] = PVS_OP_DST_OPERAND(hw_opcode, - GL_FALSE, - GL_FALSE, + 0, + 0, t_dst_index(vp, &vpi->DstReg), t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); inst[1] = t_src(vp, &vpi->SrcReg[0]); - inst[2] = __CONST(0, SWIZZLE_ZERO); - inst[3] = __CONST(0, SWIZZLE_ZERO); + inst[2] = __CONST(0, RC_SWIZZLE_ZERO); + inst[3] = __CONST(0, RC_SWIZZLE_ZERO); } static void ei_vector2(struct r300_vertex_program_code *vp, - GLuint hw_opcode, - struct prog_instruction *vpi, - GLuint * inst) + unsigned int hw_opcode, + struct rc_sub_instruction *vpi, + unsigned int * inst) { inst[0] = PVS_OP_DST_OPERAND(hw_opcode, - GL_FALSE, - GL_FALSE, + 0, + 0, t_dst_index(vp, &vpi->DstReg), t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); inst[1] = t_src(vp, &vpi->SrcReg[0]); inst[2] = t_src(vp, &vpi->SrcReg[1]); - inst[3] = __CONST(1, SWIZZLE_ZERO); + inst[3] = __CONST(1, RC_SWIZZLE_ZERO); } static void ei_math1(struct r300_vertex_program_code *vp, - GLuint hw_opcode, - struct prog_instruction *vpi, - GLuint * inst) + unsigned int hw_opcode, + struct rc_sub_instruction *vpi, + unsigned int * inst) { inst[0] = PVS_OP_DST_OPERAND(hw_opcode, - GL_TRUE, - GL_FALSE, + 1, + 0, t_dst_index(vp, &vpi->DstReg), t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); inst[1] = t_src_scalar(vp, &vpi->SrcReg[0]); - inst[2] = __CONST(0, SWIZZLE_ZERO); - inst[3] = __CONST(0, SWIZZLE_ZERO); + inst[2] = __CONST(0, RC_SWIZZLE_ZERO); + inst[3] = __CONST(0, RC_SWIZZLE_ZERO); } static void ei_lit(struct r300_vertex_program_code *vp, - struct prog_instruction *vpi, - GLuint * inst) + struct rc_sub_instruction *vpi, + unsigned int * inst) { //LIT TMP 1.Y Z TMP 1{} {X W Z Y} TMP 1{} {Y W Z X} TMP 1{} {Y X Z W} inst[0] = PVS_OP_DST_OPERAND(ME_LIGHT_COEFF_DX, - GL_TRUE, - GL_FALSE, + 1, + 0, t_dst_index(vp, &vpi->DstReg), t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); @@ -262,27 +241,27 @@ static void ei_lit(struct r300_vertex_program_code *vp, PVS_SRC_SELECT_FORCE_0, // Z t_swizzle(GET_SWZ(vpi->SrcReg[0].Swizzle, 1)), // Y t_src_class(vpi->SrcReg[0].File), - vpi->SrcReg[0].Negate ? NEGATE_XYZW : NEGATE_NONE) | + vpi->SrcReg[0].Negate ? RC_MASK_XYZW : RC_MASK_NONE) | (vpi->SrcReg[0].RelAddr << 4); inst[2] = PVS_SRC_OPERAND(t_src_index(vp, &vpi->SrcReg[0]), t_swizzle(GET_SWZ(vpi->SrcReg[0].Swizzle, 1)), // Y t_swizzle(GET_SWZ(vpi->SrcReg[0].Swizzle, 3)), // W PVS_SRC_SELECT_FORCE_0, // Z t_swizzle(GET_SWZ(vpi->SrcReg[0].Swizzle, 0)), // X t_src_class(vpi->SrcReg[0].File), - vpi->SrcReg[0].Negate ? NEGATE_XYZW : NEGATE_NONE) | + vpi->SrcReg[0].Negate ? RC_MASK_XYZW : RC_MASK_NONE) | (vpi->SrcReg[0].RelAddr << 4); inst[3] = PVS_SRC_OPERAND(t_src_index(vp, &vpi->SrcReg[0]), t_swizzle(GET_SWZ(vpi->SrcReg[0].Swizzle, 1)), // Y t_swizzle(GET_SWZ(vpi->SrcReg[0].Swizzle, 0)), // X PVS_SRC_SELECT_FORCE_0, // Z t_swizzle(GET_SWZ(vpi->SrcReg[0].Swizzle, 3)), // W t_src_class(vpi->SrcReg[0].File), - vpi->SrcReg[0].Negate ? NEGATE_XYZW : NEGATE_NONE) | + vpi->SrcReg[0].Negate ? RC_MASK_XYZW : RC_MASK_NONE) | (vpi->SrcReg[0].RelAddr << 4); } static void ei_mad(struct r300_vertex_program_code *vp, - struct prog_instruction *vpi, - GLuint * inst) + struct rc_sub_instruction *vpi, + unsigned int * inst) { /* Remarks about hardware limitations of MAD * (please preserve this comment, as this information is _NOT_ @@ -310,22 +289,22 @@ static void ei_mad(struct r300_vertex_program_code *vp, * according to AMD docs, this should improve performance by one clock * as a nice side bonus. */ - if (vpi->SrcReg[0].File == PROGRAM_TEMPORARY && - vpi->SrcReg[1].File == PROGRAM_TEMPORARY && - vpi->SrcReg[2].File == PROGRAM_TEMPORARY && + if (vpi->SrcReg[0].File == RC_FILE_TEMPORARY && + vpi->SrcReg[1].File == RC_FILE_TEMPORARY && + vpi->SrcReg[2].File == RC_FILE_TEMPORARY && vpi->SrcReg[0].Index != vpi->SrcReg[1].Index && vpi->SrcReg[0].Index != vpi->SrcReg[2].Index && vpi->SrcReg[1].Index != vpi->SrcReg[2].Index) { inst[0] = PVS_OP_DST_OPERAND(PVS_MACRO_OP_2CLK_MADD, - GL_FALSE, - GL_TRUE, + 0, + 1, t_dst_index(vp, &vpi->DstReg), t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); } else { inst[0] = PVS_OP_DST_OPERAND(VE_MULTIPLY_ADD, - GL_FALSE, - GL_FALSE, + 0, + 0, t_dst_index(vp, &vpi->DstReg), t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); @@ -336,17 +315,17 @@ static void ei_mad(struct r300_vertex_program_code *vp, } static void ei_pow(struct r300_vertex_program_code *vp, - struct prog_instruction *vpi, - GLuint * inst) + struct rc_sub_instruction *vpi, + unsigned int * inst) { inst[0] = PVS_OP_DST_OPERAND(ME_POWER_FUNC_FF, - GL_TRUE, - GL_FALSE, + 1, + 0, t_dst_index(vp, &vpi->DstReg), t_dst_mask(vpi->DstReg.WriteMask), t_dst_class(vpi->DstReg.File)); inst[1] = t_src_scalar(vp, &vpi->SrcReg[0]); - inst[2] = __CONST(0, SWIZZLE_ZERO); + inst[2] = __CONST(0, RC_SWIZZLE_ZERO); inst[3] = t_src_scalar(vp, &vpi->SrcReg[1]); } @@ -361,8 +340,8 @@ static void translate_vertex_program(struct r300_vertex_program_compiler * compi compiler->SetHwInputOutput(compiler); for(rci = compiler->Base.Program.Instructions.Next; rci != &compiler->Base.Program.Instructions; rci = rci->Next) { - struct prog_instruction *vpi = &rci->I; - GLuint *inst = compiler->code->body.d + compiler->code->length; + struct rc_sub_instruction *vpi = &rci->I; + unsigned int *inst = compiler->code->body.d + compiler->code->length; /* Skip instructions writing to non-existing destination */ if (!valid_dst(compiler->code, &vpi->DstReg)) @@ -374,26 +353,26 @@ static void translate_vertex_program(struct r300_vertex_program_compiler * compi } switch (vpi->Opcode) { - case OPCODE_ADD: ei_vector2(compiler->code, VE_ADD, vpi, inst); break; - case OPCODE_ARL: ei_vector1(compiler->code, VE_FLT2FIX_DX, vpi, inst); break; - case OPCODE_DP4: ei_vector2(compiler->code, VE_DOT_PRODUCT, vpi, inst); break; - case OPCODE_DST: ei_vector2(compiler->code, VE_DISTANCE_VECTOR, vpi, inst); break; - case OPCODE_EX2: ei_math1(compiler->code, ME_EXP_BASE2_FULL_DX, vpi, inst); break; - case OPCODE_EXP: ei_math1(compiler->code, ME_EXP_BASE2_DX, vpi, inst); break; - case OPCODE_FRC: ei_vector1(compiler->code, VE_FRACTION, vpi, inst); break; - case OPCODE_LG2: ei_math1(compiler->code, ME_LOG_BASE2_FULL_DX, vpi, inst); break; - case OPCODE_LIT: ei_lit(compiler->code, vpi, inst); break; - case OPCODE_LOG: ei_math1(compiler->code, ME_LOG_BASE2_DX, vpi, inst); break; - case OPCODE_MAD: ei_mad(compiler->code, vpi, inst); break; - case OPCODE_MAX: ei_vector2(compiler->code, VE_MAXIMUM, vpi, inst); break; - case OPCODE_MIN: ei_vector2(compiler->code, VE_MINIMUM, vpi, inst); break; - case OPCODE_MOV: ei_vector1(compiler->code, VE_ADD, vpi, inst); break; - case OPCODE_MUL: ei_vector2(compiler->code, VE_MULTIPLY, vpi, inst); break; - case OPCODE_POW: ei_pow(compiler->code, vpi, inst); break; - case OPCODE_RCP: ei_math1(compiler->code, ME_RECIP_DX, vpi, inst); break; - case OPCODE_RSQ: ei_math1(compiler->code, ME_RECIP_SQRT_DX, vpi, inst); break; - case OPCODE_SGE: ei_vector2(compiler->code, VE_SET_GREATER_THAN_EQUAL, vpi, inst); break; - case OPCODE_SLT: ei_vector2(compiler->code, VE_SET_LESS_THAN, vpi, inst); break; + case RC_OPCODE_ADD: ei_vector2(compiler->code, VE_ADD, vpi, inst); break; + case RC_OPCODE_ARL: ei_vector1(compiler->code, VE_FLT2FIX_DX, vpi, inst); break; + case RC_OPCODE_DP4: ei_vector2(compiler->code, VE_DOT_PRODUCT, vpi, inst); break; + case RC_OPCODE_DST: ei_vector2(compiler->code, VE_DISTANCE_VECTOR, vpi, inst); break; + case RC_OPCODE_EX2: ei_math1(compiler->code, ME_EXP_BASE2_FULL_DX, vpi, inst); break; + case RC_OPCODE_EXP: ei_math1(compiler->code, ME_EXP_BASE2_DX, vpi, inst); break; + case RC_OPCODE_FRC: ei_vector1(compiler->code, VE_FRACTION, vpi, inst); break; + case RC_OPCODE_LG2: ei_math1(compiler->code, ME_LOG_BASE2_FULL_DX, vpi, inst); break; + case RC_OPCODE_LIT: ei_lit(compiler->code, vpi, inst); break; + case RC_OPCODE_LOG: ei_math1(compiler->code, ME_LOG_BASE2_DX, vpi, inst); break; + case RC_OPCODE_MAD: ei_mad(compiler->code, vpi, inst); break; + case RC_OPCODE_MAX: ei_vector2(compiler->code, VE_MAXIMUM, vpi, inst); break; + case RC_OPCODE_MIN: ei_vector2(compiler->code, VE_MINIMUM, vpi, inst); break; + case RC_OPCODE_MOV: ei_vector1(compiler->code, VE_ADD, vpi, inst); break; + case RC_OPCODE_MUL: ei_vector2(compiler->code, VE_MULTIPLY, vpi, inst); break; + case RC_OPCODE_POW: ei_pow(compiler->code, vpi, inst); break; + case RC_OPCODE_RCP: ei_math1(compiler->code, ME_RECIP_DX, vpi, inst); break; + case RC_OPCODE_RSQ: ei_math1(compiler->code, ME_RECIP_SQRT_DX, vpi, inst); break; + case RC_OPCODE_SGE: ei_vector2(compiler->code, VE_SET_GREATER_THAN_EQUAL, vpi, inst); break; + case RC_OPCODE_SLT: ei_vector2(compiler->code, VE_SET_LESS_THAN, vpi, inst); break; default: rc_error(&compiler->Base, "Unknown opcode %i\n", vpi->Opcode); return; @@ -407,36 +386,35 @@ static void translate_vertex_program(struct r300_vertex_program_compiler * compi } struct temporary_allocation { - GLuint Allocated:1; - GLuint HwTemp:15; + unsigned int Allocated:1; + unsigned int HwTemp:15; struct rc_instruction * LastRead; }; static void allocate_temporary_registers(struct r300_vertex_program_compiler * compiler) { struct rc_instruction *inst; - GLuint num_orig_temps = 0; - GLboolean hwtemps[VSF_MAX_FRAGMENT_TEMPS]; + unsigned int num_orig_temps = 0; + char hwtemps[VSF_MAX_FRAGMENT_TEMPS]; struct temporary_allocation * ta; - GLuint i, j; + unsigned int i, j; compiler->code->num_temporaries = 0; memset(hwtemps, 0, sizeof(hwtemps)); /* Pass 1: Count original temporaries and allocate structures */ for(inst = compiler->Base.Program.Instructions.Next; inst != &compiler->Base.Program.Instructions; inst = inst->Next) { - GLuint numsrcs = _mesa_num_inst_src_regs(inst->I.Opcode); - GLuint numdsts = _mesa_num_inst_dst_regs(inst->I.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); - for (i = 0; i < numsrcs; ++i) { - if (inst->I.SrcReg[i].File == PROGRAM_TEMPORARY) { + for (i = 0; i < opcode->NumSrcRegs; ++i) { + if (inst->I.SrcReg[i].File == RC_FILE_TEMPORARY) { if (inst->I.SrcReg[i].Index >= num_orig_temps) num_orig_temps = inst->I.SrcReg[i].Index + 1; } } - if (numdsts) { - if (inst->I.DstReg.File == PROGRAM_TEMPORARY) { + if (opcode->HasDstReg) { + if (inst->I.DstReg.File == RC_FILE_TEMPORARY) { if (inst->I.DstReg.Index >= num_orig_temps) num_orig_temps = inst->I.DstReg.Index + 1; } @@ -449,32 +427,31 @@ static void allocate_temporary_registers(struct r300_vertex_program_compiler * c /* Pass 2: Determine original temporary lifetimes */ for(inst = compiler->Base.Program.Instructions.Next; inst != &compiler->Base.Program.Instructions; inst = inst->Next) { - GLuint numsrcs = _mesa_num_inst_src_regs(inst->I.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); - for (i = 0; i < numsrcs; ++i) { - if (inst->I.SrcReg[i].File == PROGRAM_TEMPORARY) + for (i = 0; i < opcode->NumSrcRegs; ++i) { + if (inst->I.SrcReg[i].File == RC_FILE_TEMPORARY) ta[inst->I.SrcReg[i].Index].LastRead = inst; } } /* Pass 3: Register allocation */ for(inst = compiler->Base.Program.Instructions.Next; inst != &compiler->Base.Program.Instructions; inst = inst->Next) { - GLuint numsrcs = _mesa_num_inst_src_regs(inst->I.Opcode); - GLuint numdsts = _mesa_num_inst_dst_regs(inst->I.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); - for (i = 0; i < numsrcs; ++i) { - if (inst->I.SrcReg[i].File == PROGRAM_TEMPORARY) { - GLuint orig = inst->I.SrcReg[i].Index; + for (i = 0; i < opcode->NumSrcRegs; ++i) { + if (inst->I.SrcReg[i].File == RC_FILE_TEMPORARY) { + unsigned int orig = inst->I.SrcReg[i].Index; inst->I.SrcReg[i].Index = ta[orig].HwTemp; if (ta[orig].Allocated && inst == ta[orig].LastRead) - hwtemps[ta[orig].HwTemp] = GL_FALSE; + hwtemps[ta[orig].HwTemp] = 0; } } - if (numdsts) { - if (inst->I.DstReg.File == PROGRAM_TEMPORARY) { - GLuint orig = inst->I.DstReg.Index; + if (opcode->HasDstReg) { + if (inst->I.DstReg.File == RC_FILE_TEMPORARY) { + unsigned int orig = inst->I.DstReg.Index; if (!ta[orig].Allocated) { for(j = 0; j < VSF_MAX_FRAGMENT_TEMPS; ++j) { @@ -484,9 +461,9 @@ static void allocate_temporary_registers(struct r300_vertex_program_compiler * c if (j >= VSF_MAX_FRAGMENT_TEMPS) { fprintf(stderr, "Out of hw temporaries\n"); } else { - ta[orig].Allocated = GL_TRUE; + ta[orig].Allocated = 1; ta[orig].HwTemp = j; - hwtemps[j] = GL_TRUE; + hwtemps[j] = 1; if (j >= compiler->code->num_temporaries) compiler->code->num_temporaries = j + 1; @@ -504,45 +481,45 @@ static void allocate_temporary_registers(struct r300_vertex_program_compiler * c * Vertex engine cannot read two inputs or two constants at the same time. * Introduce intermediate MOVs to temporary registers to account for this. */ -static GLboolean transform_source_conflicts( +static int transform_source_conflicts( struct radeon_compiler *c, struct rc_instruction* inst, void* unused) { - GLuint num_operands = _mesa_num_inst_src_regs(inst->I.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); - if (num_operands == 3) { + if (opcode->NumSrcRegs == 3) { if (t_src_conflict(inst->I.SrcReg[1], inst->I.SrcReg[2]) || t_src_conflict(inst->I.SrcReg[0], inst->I.SrcReg[2])) { int tmpreg = rc_find_free_temporary(c); struct rc_instruction * inst_mov = rc_insert_new_instruction(c, inst->Prev); - inst_mov->I.Opcode = OPCODE_MOV; - inst_mov->I.DstReg.File = PROGRAM_TEMPORARY; + inst_mov->I.Opcode = RC_OPCODE_MOV; + inst_mov->I.DstReg.File = RC_FILE_TEMPORARY; inst_mov->I.DstReg.Index = tmpreg; inst_mov->I.SrcReg[0] = inst->I.SrcReg[2]; reset_srcreg(&inst->I.SrcReg[2]); - inst->I.SrcReg[2].File = PROGRAM_TEMPORARY; + inst->I.SrcReg[2].File = RC_FILE_TEMPORARY; inst->I.SrcReg[2].Index = tmpreg; } } - if (num_operands >= 2) { + if (opcode->NumSrcRegs >= 2) { if (t_src_conflict(inst->I.SrcReg[1], inst->I.SrcReg[0])) { int tmpreg = rc_find_free_temporary(c); struct rc_instruction * inst_mov = rc_insert_new_instruction(c, inst->Prev); - inst_mov->I.Opcode = OPCODE_MOV; - inst_mov->I.DstReg.File = PROGRAM_TEMPORARY; + inst_mov->I.Opcode = RC_OPCODE_MOV; + inst_mov->I.DstReg.File = RC_FILE_TEMPORARY; inst_mov->I.DstReg.Index = tmpreg; inst_mov->I.SrcReg[0] = inst->I.SrcReg[1]; reset_srcreg(&inst->I.SrcReg[1]); - inst->I.SrcReg[1].File = PROGRAM_TEMPORARY; + inst->I.SrcReg[1].File = RC_FILE_TEMPORARY; inst->I.SrcReg[1].Index = tmpreg; } } - return GL_TRUE; + return 1; } static void addArtificialOutputs(struct r300_vertex_program_compiler * compiler) @@ -553,15 +530,15 @@ static void addArtificialOutputs(struct r300_vertex_program_compiler * compiler) if ((compiler->RequiredOutputs & (1 << i)) && !(compiler->Base.Program.OutputsWritten & (1 << i))) { struct rc_instruction * inst = rc_insert_new_instruction(&compiler->Base, compiler->Base.Program.Instructions.Prev); - inst->I.Opcode = OPCODE_MOV; + inst->I.Opcode = RC_OPCODE_MOV; - inst->I.DstReg.File = PROGRAM_OUTPUT; + inst->I.DstReg.File = RC_FILE_OUTPUT; inst->I.DstReg.Index = i; - inst->I.DstReg.WriteMask = WRITEMASK_XYZW; + inst->I.DstReg.WriteMask = RC_MASK_XYZW; - inst->I.SrcReg[0].File = PROGRAM_CONSTANT; + inst->I.SrcReg[0].File = RC_FILE_CONSTANT; inst->I.SrcReg[0].Index = 0; - inst->I.SrcReg[0].Swizzle = SWIZZLE_XYZW; + inst->I.SrcReg[0].Swizzle = RC_SWIZZLE_XYZW; compiler->Base.Program.OutputsWritten |= 1 << i; } @@ -573,18 +550,18 @@ static void nqssadceInit(struct nqssadce_state* s) struct r300_vertex_program_compiler * compiler = s->UserData; int i; - for(i = 0; i < VERT_RESULT_MAX; ++i) { + for(i = 0; i < 32; ++i) { if (compiler->RequiredOutputs & (1 << i)) - s->Outputs[i].Sourced = WRITEMASK_XYZW; + s->Outputs[i].Sourced = RC_MASK_XYZW; } } -static GLboolean swizzleIsNative(GLuint opcode, struct prog_src_register reg) +static int swizzleIsNative(rc_opcode opcode, struct rc_src_register reg) { (void) opcode; (void) reg; - return GL_TRUE; + return 1; } diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c b/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c index 7e2faed690..3e994ebd1b 100644 --- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c @@ -27,15 +27,17 @@ #include "r500_fragprog.h" +#include + #include "../r300_reg.h" -static struct prog_src_register shadow_ambient(struct radeon_compiler * c, int tmu) +static struct rc_src_register shadow_ambient(struct radeon_compiler * c, int tmu) { - struct prog_src_register reg = { 0, }; + struct rc_src_register reg = { 0, }; - reg.File = PROGRAM_STATE_VAR; + reg.File = RC_FILE_CONSTANT; reg.Index = rc_constants_add_state(&c->Program.Constants, RC_STATE_SHADOW_AMBIENT, tmu); - reg.Swizzle = SWIZZLE_WWWW; + reg.Swizzle = RC_SWIZZLE_WWWW; return reg; } @@ -44,7 +46,7 @@ static struct prog_src_register shadow_ambient(struct radeon_compiler * c, int t * - implement texture compare (shadow extensions) * - extract non-native source / destination operands */ -GLboolean r500_transform_TEX( +int r500_transform_TEX( struct radeon_compiler * c, struct rc_instruction * inst, void* data) @@ -52,77 +54,77 @@ GLboolean r500_transform_TEX( struct r300_fragment_program_compiler *compiler = (struct r300_fragment_program_compiler*)data; - if (inst->I.Opcode != OPCODE_TEX && - inst->I.Opcode != OPCODE_TXB && - inst->I.Opcode != OPCODE_TXP && - inst->I.Opcode != OPCODE_KIL) - return GL_FALSE; + if (inst->I.Opcode != RC_OPCODE_TEX && + inst->I.Opcode != RC_OPCODE_TXB && + inst->I.Opcode != RC_OPCODE_TXP && + inst->I.Opcode != RC_OPCODE_KIL) + return 0; /* ARB_shadow & EXT_shadow_funcs */ - if (inst->I.Opcode != OPCODE_KIL && + if (inst->I.Opcode != RC_OPCODE_KIL && c->Program.ShadowSamplers & (1 << inst->I.TexSrcUnit)) { - GLuint comparefunc = GL_NEVER + compiler->state.unit[inst->I.TexSrcUnit].texture_compare_func; + rc_compare_func comparefunc = compiler->state.unit[inst->I.TexSrcUnit].texture_compare_func; - if (comparefunc == GL_NEVER || comparefunc == GL_ALWAYS) { - inst->I.Opcode = OPCODE_MOV; + if (comparefunc == RC_COMPARE_FUNC_NEVER || comparefunc == RC_COMPARE_FUNC_ALWAYS) { + inst->I.Opcode = RC_OPCODE_MOV; - if (comparefunc == GL_ALWAYS) { - inst->I.SrcReg[0].File = PROGRAM_BUILTIN; - inst->I.SrcReg[0].Swizzle = SWIZZLE_1111; + if (comparefunc == RC_COMPARE_FUNC_ALWAYS) { + inst->I.SrcReg[0].File = RC_FILE_NONE; + inst->I.SrcReg[0].Swizzle = RC_SWIZZLE_1111; } else { inst->I.SrcReg[0] = shadow_ambient(c, inst->I.TexSrcUnit); } - return GL_TRUE; + return 1; } else { - GLuint comparefunc = GL_NEVER + compiler->state.unit[inst->I.TexSrcUnit].texture_compare_func; - GLuint depthmode = compiler->state.unit[inst->I.TexSrcUnit].depth_texture_mode; + rc_compare_func comparefunc = compiler->state.unit[inst->I.TexSrcUnit].texture_compare_func; + unsigned int depthmode = compiler->state.unit[inst->I.TexSrcUnit].depth_texture_mode; struct rc_instruction * inst_rcp = rc_insert_new_instruction(c, inst); struct rc_instruction * inst_mad = rc_insert_new_instruction(c, inst_rcp); struct rc_instruction * inst_cmp = rc_insert_new_instruction(c, inst_mad); int pass, fail; - inst_rcp->I.Opcode = OPCODE_RCP; - inst_rcp->I.DstReg.File = PROGRAM_TEMPORARY; + inst_rcp->I.Opcode = RC_OPCODE_RCP; + inst_rcp->I.DstReg.File = RC_FILE_TEMPORARY; inst_rcp->I.DstReg.Index = rc_find_free_temporary(c); - inst_rcp->I.DstReg.WriteMask = WRITEMASK_W; + inst_rcp->I.DstReg.WriteMask = RC_MASK_W; inst_rcp->I.SrcReg[0] = inst->I.SrcReg[0]; - inst_rcp->I.SrcReg[0].Swizzle = SWIZZLE_WWWW; + inst_rcp->I.SrcReg[0].Swizzle = RC_SWIZZLE_WWWW; inst_cmp->I.DstReg = inst->I.DstReg; - inst->I.DstReg.File = PROGRAM_TEMPORARY; + inst->I.DstReg.File = RC_FILE_TEMPORARY; inst->I.DstReg.Index = rc_find_free_temporary(c); - inst->I.DstReg.WriteMask = WRITEMASK_XYZW; + inst->I.DstReg.WriteMask = RC_MASK_XYZW; - inst_mad->I.Opcode = OPCODE_MAD; - inst_mad->I.DstReg.File = PROGRAM_TEMPORARY; + inst_mad->I.Opcode = RC_OPCODE_MAD; + inst_mad->I.DstReg.File = RC_FILE_TEMPORARY; inst_mad->I.DstReg.Index = rc_find_free_temporary(c); inst_mad->I.SrcReg[0] = inst->I.SrcReg[0]; - inst_mad->I.SrcReg[0].Swizzle = SWIZZLE_ZZZZ; - inst_mad->I.SrcReg[1].File = PROGRAM_TEMPORARY; + inst_mad->I.SrcReg[0].Swizzle = RC_SWIZZLE_ZZZZ; + inst_mad->I.SrcReg[1].File = RC_FILE_TEMPORARY; inst_mad->I.SrcReg[1].Index = inst_rcp->I.DstReg.Index; - inst_mad->I.SrcReg[1].Swizzle = SWIZZLE_WWWW; - inst_mad->I.SrcReg[2].File = PROGRAM_TEMPORARY; + inst_mad->I.SrcReg[1].Swizzle = RC_SWIZZLE_WWWW; + inst_mad->I.SrcReg[2].File = RC_FILE_TEMPORARY; inst_mad->I.SrcReg[2].Index = inst->I.DstReg.Index; if (depthmode == 0) /* GL_LUMINANCE */ - inst_mad->I.SrcReg[2].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_Z); + inst_mad->I.SrcReg[2].Swizzle = RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_Z); else if (depthmode == 2) /* GL_ALPHA */ - inst_mad->I.SrcReg[2].Swizzle = SWIZZLE_WWWW; + inst_mad->I.SrcReg[2].Swizzle = RC_SWIZZLE_WWWW; /* Recall that SrcReg[0] is tex, SrcReg[2] is r and: * r < tex <=> -tex+r < 0 * r >= tex <=> not (-tex+r < 0 */ - if (comparefunc == GL_LESS || comparefunc == GL_GEQUAL) - inst_mad->I.SrcReg[2].Negate = inst_mad->I.SrcReg[2].Negate ^ NEGATE_XYZW; + if (comparefunc == RC_COMPARE_FUNC_LESS || comparefunc == RC_COMPARE_FUNC_GEQUAL) + inst_mad->I.SrcReg[2].Negate = inst_mad->I.SrcReg[2].Negate ^ RC_MASK_XYZW; else - inst_mad->I.SrcReg[0].Negate = inst_mad->I.SrcReg[0].Negate ^ NEGATE_XYZW; + inst_mad->I.SrcReg[0].Negate = inst_mad->I.SrcReg[0].Negate ^ RC_MASK_XYZW; - inst_cmp->I.Opcode = OPCODE_CMP; + inst_cmp->I.Opcode = RC_OPCODE_CMP; /* DstReg has been filled out above */ - inst_cmp->I.SrcReg[0].File = PROGRAM_TEMPORARY; + inst_cmp->I.SrcReg[0].File = RC_FILE_TEMPORARY; inst_cmp->I.SrcReg[0].Index = inst_mad->I.DstReg.Index; - if (comparefunc == GL_LESS || comparefunc == GL_GREATER) { + if (comparefunc == RC_COMPARE_FUNC_LESS || comparefunc == RC_COMPARE_FUNC_GREATER) { pass = 1; fail = 2; } else { @@ -130,97 +132,97 @@ GLboolean r500_transform_TEX( fail = 1; } - inst_cmp->I.SrcReg[pass].File = PROGRAM_BUILTIN; - inst_cmp->I.SrcReg[pass].Swizzle = SWIZZLE_1111; + inst_cmp->I.SrcReg[pass].File = RC_FILE_NONE; + inst_cmp->I.SrcReg[pass].Swizzle = RC_SWIZZLE_1111; inst_cmp->I.SrcReg[fail] = shadow_ambient(c, inst->I.TexSrcUnit); } } /* Cannot write texture to output registers */ - if (inst->I.Opcode != OPCODE_KIL && inst->I.DstReg.File != PROGRAM_TEMPORARY) { + if (inst->I.Opcode != RC_OPCODE_KIL && inst->I.DstReg.File != RC_FILE_TEMPORARY) { struct rc_instruction * inst_mov = rc_insert_new_instruction(c, inst); - inst_mov->I.Opcode = OPCODE_MOV; + inst_mov->I.Opcode = RC_OPCODE_MOV; inst_mov->I.DstReg = inst->I.DstReg; - inst_mov->I.SrcReg[0].File = PROGRAM_TEMPORARY; + inst_mov->I.SrcReg[0].File = RC_FILE_TEMPORARY; inst_mov->I.SrcReg[0].Index = rc_find_free_temporary(c); - inst->I.DstReg.File = PROGRAM_TEMPORARY; + inst->I.DstReg.File = RC_FILE_TEMPORARY; inst->I.DstReg.Index = inst_mov->I.SrcReg[0].Index; - inst->I.DstReg.WriteMask = WRITEMASK_XYZW; + inst->I.DstReg.WriteMask = RC_MASK_XYZW; } /* Cannot read texture coordinate from constants file */ - if (inst->I.SrcReg[0].File != PROGRAM_TEMPORARY && inst->I.SrcReg[0].File != PROGRAM_INPUT) { + if (inst->I.SrcReg[0].File != RC_FILE_TEMPORARY && inst->I.SrcReg[0].File != RC_FILE_INPUT) { struct rc_instruction * inst_mov = rc_insert_new_instruction(c, inst->Prev); - inst_mov->I.Opcode = OPCODE_MOV; - inst_mov->I.DstReg.File = PROGRAM_TEMPORARY; + inst_mov->I.Opcode = RC_OPCODE_MOV; + inst_mov->I.DstReg.File = RC_FILE_TEMPORARY; inst_mov->I.DstReg.Index = rc_find_free_temporary(c); inst_mov->I.SrcReg[0] = inst->I.SrcReg[0]; reset_srcreg(&inst->I.SrcReg[0]); - inst->I.SrcReg[0].File = PROGRAM_TEMPORARY; + inst->I.SrcReg[0].File = RC_FILE_TEMPORARY; inst->I.SrcReg[0].Index = inst_mov->I.DstReg.Index; } - return GL_TRUE; + return 1; } -GLboolean r500FPIsNativeSwizzle(GLuint opcode, struct prog_src_register reg) +int r500FPIsNativeSwizzle(rc_opcode opcode, struct rc_src_register reg) { - GLuint relevant; + unsigned int relevant; int i; - if (opcode == OPCODE_TEX || - opcode == OPCODE_TXB || - opcode == OPCODE_TXP || - opcode == OPCODE_KIL) { + if (opcode == RC_OPCODE_TEX || + opcode == RC_OPCODE_TXB || + opcode == RC_OPCODE_TXP || + opcode == RC_OPCODE_KIL) { if (reg.Abs) - return GL_FALSE; + return 0; - if (opcode == OPCODE_KIL && (reg.Swizzle != SWIZZLE_NOOP || reg.Negate != NEGATE_NONE)) - return GL_FALSE; + if (opcode == RC_OPCODE_KIL && (reg.Swizzle != RC_SWIZZLE_XYZW || reg.Negate != RC_MASK_NONE)) + return 0; if (reg.Negate) - reg.Negate ^= NEGATE_XYZW; + reg.Negate ^= RC_MASK_XYZW; for(i = 0; i < 4; ++i) { - GLuint swz = GET_SWZ(reg.Swizzle, i); - if (swz == SWIZZLE_NIL) { + unsigned int swz = GET_SWZ(reg.Swizzle, i); + if (swz == RC_SWIZZLE_UNUSED) { reg.Negate &= ~(1 << i); continue; } if (swz >= 4) - return GL_FALSE; + return 0; } if (reg.Negate) - return GL_FALSE; + return 0; - return GL_TRUE; - } else if (opcode == OPCODE_DDX || opcode == OPCODE_DDY) { + return 1; + } else if (opcode == RC_OPCODE_DDX || opcode == RC_OPCODE_DDY) { /* DDX/MDH and DDY/MDV explicitly ignore incoming swizzles; * if it doesn't fit perfectly into a .xyzw case... */ - if (reg.Swizzle == SWIZZLE_NOOP && !reg.Abs && !reg.Negate) - return GL_TRUE; + if (reg.Swizzle == RC_SWIZZLE_XYZW && !reg.Abs && !reg.Negate) + return 1; - return GL_FALSE; + return 0; } else { /* ALU instructions support almost everything */ if (reg.Abs) - return GL_TRUE; + return 1; relevant = 0; for(i = 0; i < 3; ++i) { - GLuint swz = GET_SWZ(reg.Swizzle, i); - if (swz != SWIZZLE_NIL && swz != SWIZZLE_ZERO) + unsigned int swz = GET_SWZ(reg.Swizzle, i); + if (swz != RC_SWIZZLE_UNUSED && swz != RC_SWIZZLE_ZERO) relevant |= 1 << i; } if ((reg.Negate & relevant) && ((reg.Negate & relevant) != relevant)) - return GL_FALSE; + return 0; - return GL_TRUE; + return 1; } } @@ -230,14 +232,14 @@ GLboolean r500FPIsNativeSwizzle(GLuint opcode, struct prog_src_register reg) * The only thing we *cannot* do in an ALU instruction is per-component * negation. Therefore, we split the MOV into two instructions when necessary. */ -void r500FPBuildSwizzle(struct nqssadce_state *s, struct prog_dst_register dst, struct prog_src_register src) +void r500FPBuildSwizzle(struct nqssadce_state *s, struct rc_dst_register dst, struct rc_src_register src) { - GLuint negatebase[2] = { 0, 0 }; + unsigned int negatebase[2] = { 0, 0 }; int i; for(i = 0; i < 4; ++i) { - GLuint swz = GET_SWZ(src.Swizzle, i); - if (swz == SWIZZLE_NIL) + unsigned int swz = GET_SWZ(src.Swizzle, i); + if (swz == RC_SWIZZLE_UNUSED) continue; negatebase[GET_BIT(src.Negate, i)] |= 1 << i; } @@ -247,11 +249,11 @@ void r500FPBuildSwizzle(struct nqssadce_state *s, struct prog_dst_register dst, continue; struct rc_instruction *inst = rc_insert_new_instruction(s->Compiler, s->IP->Prev); - inst->I.Opcode = OPCODE_MOV; + inst->I.Opcode = RC_OPCODE_MOV; inst->I.DstReg = dst; inst->I.DstReg.WriteMask = negatebase[i]; inst->I.SrcReg[0] = src; - inst->I.SrcReg[0].Negate = (i == 0) ? NEGATE_NONE : NEGATE_XYZW; + inst->I.SrcReg[0].Negate = (i == 0) ? RC_MASK_NONE : RC_MASK_XYZW; } } diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog.h b/src/mesa/drivers/dri/r300/compiler/r500_fragprog.h index 9091f65cd2..887d4abbd2 100644 --- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog.h +++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog.h @@ -33,9 +33,6 @@ #ifndef __R500_FRAGPROG_H_ #define __R500_FRAGPROG_H_ -#include "shader/prog_parameter.h" -#include "shader/prog_instruction.h" - #include "radeon_compiler.h" #include "radeon_nqssadce.h" @@ -43,11 +40,11 @@ extern void r500BuildFragmentProgramHwCode(struct r300_fragment_program_compiler extern void r500FragmentProgramDump(struct rX00_fragment_program_code *c); -extern GLboolean r500FPIsNativeSwizzle(GLuint opcode, struct prog_src_register reg); +extern int r500FPIsNativeSwizzle(rc_opcode opcode, struct rc_src_register reg); -extern void r500FPBuildSwizzle(struct nqssadce_state *s, struct prog_dst_register dst, struct prog_src_register src); +extern void r500FPBuildSwizzle(struct nqssadce_state *s, struct rc_dst_register dst, struct rc_src_register src); -extern GLboolean r500_transform_TEX( +extern int r500_transform_TEX( struct radeon_compiler * c, struct rc_instruction * inst, void* data); diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c index d694725c9b..2f0c0d5283 100644 --- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c +++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c @@ -60,63 +60,63 @@ } while(0) -static GLuint translate_rgb_op(struct r300_fragment_program_compiler *c, GLuint opcode) +static unsigned int translate_rgb_op(struct r300_fragment_program_compiler *c, rc_opcode opcode) { switch(opcode) { - case OPCODE_CMP: return R500_ALU_RGBA_OP_CMP; - case OPCODE_DDX: return R500_ALU_RGBA_OP_MDH; - case OPCODE_DDY: return R500_ALU_RGBA_OP_MDV; - case OPCODE_DP3: return R500_ALU_RGBA_OP_DP3; - case OPCODE_DP4: return R500_ALU_RGBA_OP_DP4; - case OPCODE_FRC: return R500_ALU_RGBA_OP_FRC; + case RC_OPCODE_CMP: return R500_ALU_RGBA_OP_CMP; + case RC_OPCODE_DDX: return R500_ALU_RGBA_OP_MDH; + case RC_OPCODE_DDY: return R500_ALU_RGBA_OP_MDV; + case RC_OPCODE_DP3: return R500_ALU_RGBA_OP_DP3; + case RC_OPCODE_DP4: return R500_ALU_RGBA_OP_DP4; + case RC_OPCODE_FRC: return R500_ALU_RGBA_OP_FRC; default: error("translate_rgb_op(%d): unknown opcode\n", opcode); /* fall through */ - case OPCODE_NOP: + case RC_OPCODE_NOP: /* fall through */ - case OPCODE_MAD: return R500_ALU_RGBA_OP_MAD; - case OPCODE_MAX: return R500_ALU_RGBA_OP_MAX; - case OPCODE_MIN: return R500_ALU_RGBA_OP_MIN; - case OPCODE_REPL_ALPHA: return R500_ALU_RGBA_OP_SOP; + case RC_OPCODE_MAD: return R500_ALU_RGBA_OP_MAD; + case RC_OPCODE_MAX: return R500_ALU_RGBA_OP_MAX; + case RC_OPCODE_MIN: return R500_ALU_RGBA_OP_MIN; + case RC_OPCODE_REPL_ALPHA: return R500_ALU_RGBA_OP_SOP; } } -static GLuint translate_alpha_op(struct r300_fragment_program_compiler *c, GLuint opcode) +static unsigned int translate_alpha_op(struct r300_fragment_program_compiler *c, rc_opcode opcode) { switch(opcode) { - case OPCODE_CMP: return R500_ALPHA_OP_CMP; - case OPCODE_COS: return R500_ALPHA_OP_COS; - case OPCODE_DDX: return R500_ALPHA_OP_MDH; - case OPCODE_DDY: return R500_ALPHA_OP_MDV; - case OPCODE_DP3: return R500_ALPHA_OP_DP; - case OPCODE_DP4: return R500_ALPHA_OP_DP; - case OPCODE_EX2: return R500_ALPHA_OP_EX2; - case OPCODE_FRC: return R500_ALPHA_OP_FRC; - case OPCODE_LG2: return R500_ALPHA_OP_LN2; + case RC_OPCODE_CMP: return R500_ALPHA_OP_CMP; + case RC_OPCODE_COS: return R500_ALPHA_OP_COS; + case RC_OPCODE_DDX: return R500_ALPHA_OP_MDH; + case RC_OPCODE_DDY: return R500_ALPHA_OP_MDV; + case RC_OPCODE_DP3: return R500_ALPHA_OP_DP; + case RC_OPCODE_DP4: return R500_ALPHA_OP_DP; + case RC_OPCODE_EX2: return R500_ALPHA_OP_EX2; + case RC_OPCODE_FRC: return R500_ALPHA_OP_FRC; + case RC_OPCODE_LG2: return R500_ALPHA_OP_LN2; default: error("translate_alpha_op(%d): unknown opcode\n", opcode); /* fall through */ - case OPCODE_NOP: + case RC_OPCODE_NOP: /* fall through */ - case OPCODE_MAD: return R500_ALPHA_OP_MAD; - case OPCODE_MAX: return R500_ALPHA_OP_MAX; - case OPCODE_MIN: return R500_ALPHA_OP_MIN; - case OPCODE_RCP: return R500_ALPHA_OP_RCP; - case OPCODE_RSQ: return R500_ALPHA_OP_RSQ; - case OPCODE_SIN: return R500_ALPHA_OP_SIN; + case RC_OPCODE_MAD: return R500_ALPHA_OP_MAD; + case RC_OPCODE_MAX: return R500_ALPHA_OP_MAX; + case RC_OPCODE_MIN: return R500_ALPHA_OP_MIN; + case RC_OPCODE_RCP: return R500_ALPHA_OP_RCP; + case RC_OPCODE_RSQ: return R500_ALPHA_OP_RSQ; + case RC_OPCODE_SIN: return R500_ALPHA_OP_SIN; } } -static GLuint fix_hw_swizzle(GLuint swz) +static unsigned int fix_hw_swizzle(unsigned int swz) { if (swz == 5) swz = 6; - if (swz == SWIZZLE_NIL) swz = 4; + if (swz == RC_SWIZZLE_UNUSED) swz = 4; return swz; } -static GLuint translate_arg_rgb(struct radeon_pair_instruction *inst, int arg) +static unsigned int translate_arg_rgb(struct radeon_pair_instruction *inst, int arg) { - GLuint t = inst->RGB.Arg[arg].Source; + unsigned int t = inst->RGB.Arg[arg].Source; int comp; t |= inst->RGB.Arg[arg].Negate << 11; t |= inst->RGB.Arg[arg].Abs << 12; @@ -127,22 +127,22 @@ static GLuint translate_arg_rgb(struct radeon_pair_instruction *inst, int arg) return t; } -static GLuint translate_arg_alpha(struct radeon_pair_instruction *inst, int i) +static unsigned int translate_arg_alpha(struct radeon_pair_instruction *inst, int i) { - GLuint t = inst->Alpha.Arg[i].Source; + unsigned int t = inst->Alpha.Arg[i].Source; t |= fix_hw_swizzle(inst->Alpha.Arg[i].Swizzle) << 2; t |= inst->Alpha.Arg[i].Negate << 5; t |= inst->Alpha.Arg[i].Abs << 6; return t; } -static void use_temporary(struct r500_fragment_program_code* code, GLuint index) +static void use_temporary(struct r500_fragment_program_code* code, unsigned int index) { if (index > code->max_temp_idx) code->max_temp_idx = index; } -static GLuint use_source(struct r500_fragment_program_code* code, struct radeon_pair_instruction_source src) +static unsigned int use_source(struct r500_fragment_program_code* code, struct radeon_pair_instruction_source src) { if (!src.Constant) use_temporary(code, src.Index); @@ -153,13 +153,13 @@ static GLuint use_source(struct r500_fragment_program_code* code, struct radeon_ /** * Emit a paired ALU instruction. */ -static GLboolean emit_paired(void *data, struct radeon_pair_instruction *inst) +static int emit_paired(void *data, struct radeon_pair_instruction *inst) { PROG_CODE; if (code->inst_end >= 511) { error("emit_alu: Too many instructions"); - return GL_FALSE; + return 0; } int ip = ++code->inst_end; @@ -177,7 +177,7 @@ static GLboolean emit_paired(void *data, struct radeon_pair_instruction *inst) code->inst[ip].inst0 |= (inst->RGB.OutputWriteMask << 15) | (inst->Alpha.OutputWriteMask << 18); if (inst->Alpha.DepthWriteMask) { code->inst[ip].inst4 |= R500_ALPHA_W_OMASK; - c->code->writes_depth = GL_TRUE; + c->code->writes_depth = 1; } code->inst[ip].inst4 |= R500_ALPHA_ADDRD(inst->Alpha.DestIndex); @@ -206,12 +206,12 @@ static GLboolean emit_paired(void *data, struct radeon_pair_instruction *inst) code->inst[ip].inst4 |= translate_arg_alpha(inst, 1) << R500_ALPHA_SEL_B_SHIFT; code->inst[ip].inst5 |= translate_arg_alpha(inst, 2) << R500_ALU_RGBA_ALPHA_SEL_C_SHIFT; - return GL_TRUE; + return 1; } -static GLuint translate_strq_swizzle(GLuint swizzle) +static unsigned int translate_strq_swizzle(unsigned int swizzle) { - GLuint swiz = 0; + unsigned int swiz = 0; int i; for (i = 0; i < 4; i++) swiz |= (GET_SWZ(swizzle, i) & 0x3) << i*2; @@ -221,13 +221,13 @@ static GLuint translate_strq_swizzle(GLuint swizzle) /** * Emit a single TEX instruction */ -static GLboolean emit_tex(void *data, struct radeon_pair_texture_instruction *inst) +static int emit_tex(void *data, struct radeon_pair_texture_instruction *inst) { PROG_CODE; if (code->inst_end >= 511) { error("emit_tex: Too many instructions"); - return GL_FALSE; + return 0; } int ip = ++code->inst_end; @@ -238,7 +238,7 @@ static GLboolean emit_tex(void *data, struct radeon_pair_texture_instruction *in code->inst[ip].inst1 = R500_TEX_ID(inst->TexSrcUnit) | R500_TEX_SEM_ACQUIRE | R500_TEX_IGNORE_UNCOVERED; - if (inst->TexSrcTarget == TEXTURE_RECT_INDEX) + if (inst->TexSrcTarget == RC_TEXTURE_RECT) code->inst[ip].inst1 |= R500_TEX_UNSCALED; switch (inst->Opcode) { @@ -264,7 +264,7 @@ static GLboolean emit_tex(void *data, struct radeon_pair_texture_instruction *in | R500_TEX_DST_R_SWIZ_R | R500_TEX_DST_G_SWIZ_G | R500_TEX_DST_B_SWIZ_B | R500_TEX_DST_A_SWIZ_A; - return GL_TRUE; + return 1; } static const struct radeon_pair_handler pair_handler = { @@ -277,7 +277,7 @@ void r500BuildFragmentProgramHwCode(struct r300_fragment_program_compiler *compi { struct r500_fragment_program_code *code = &compiler->code->code.r500; - _mesa_bzero(code, sizeof(*code)); + memset(code, 0, sizeof(*code)); code->max_temp_idx = 1; code->inst_end = -1; diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_code.c b/src/mesa/drivers/dri/r300/compiler/radeon_code.c index c7923004df..1a3d8bb641 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_code.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_code.c @@ -25,11 +25,13 @@ * */ -#include "main/mtypes.h" -#include "shader/prog_instruction.h" - #include "radeon_code.h" +#include +#include + +#include "radeon_program.h" + void rc_constants_init(struct rc_constant_list * c) { memset(c, 0, sizeof(*c)); @@ -143,7 +145,7 @@ unsigned rc_constants_add_immediate_scalar(struct rc_constant_list * c, float da if (c->Constants[index].Type == RC_CONSTANT_IMMEDIATE) { for(unsigned comp = 0; comp < c->Constants[index].Size; ++comp) { if (c->Constants[index].u.Immediate[comp] == data) { - *swizzle = MAKE_SWIZZLE4(comp, comp, comp, comp); + *swizzle = RC_MAKE_SWIZZLE(comp, comp, comp, comp); return index; } } @@ -156,7 +158,7 @@ unsigned rc_constants_add_immediate_scalar(struct rc_constant_list * c, float da if (free_index >= 0) { unsigned comp = c->Constants[free_index].Size++; c->Constants[free_index].u.Immediate[comp] = data; - *swizzle = MAKE_SWIZZLE4(comp, comp, comp, comp); + *swizzle = RC_MAKE_SWIZZLE(comp, comp, comp, comp); return free_index; } @@ -164,7 +166,7 @@ unsigned rc_constants_add_immediate_scalar(struct rc_constant_list * c, float da constant.Type = RC_CONSTANT_IMMEDIATE; constant.Size = 1; constant.u.Immediate[0] = data; - *swizzle = SWIZZLE_XXXX; + *swizzle = RC_SWIZZLE_XXXX; return rc_constants_add(c, &constant); } diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_code.h b/src/mesa/drivers/dri/r300/compiler/radeon_code.h index 0806fb1b5c..de0c88ed51 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_code.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_code.h @@ -88,6 +88,23 @@ unsigned rc_constants_add_state(struct rc_constant_list * c, unsigned state1, un unsigned rc_constants_add_immediate_vec4(struct rc_constant_list * c, const float * data); unsigned rc_constants_add_immediate_scalar(struct rc_constant_list * c, float data, unsigned * swizzle); +/** + * Compare functions. + * + * \note By design, RC_COMPARE_FUNC_xxx + GL_NEVER gives you + * the correct GL compare function. + */ +typedef enum { + RC_COMPARE_FUNC_NEVER = 0, + RC_COMPARE_FUNC_LESS, + RC_COMPARE_FUNC_EQUAL, + RC_COMPARE_FUNC_LEQUAL, + RC_COMPARE_FUNC_GREATER, + RC_COMPARE_FUNC_NOTEQUAL, + RC_COMPARE_FUNC_GEQUAL, + RC_COMPARE_FUNC_ALWAYS +} rc_compare_func; + /** * Stores state that influences the compilation of a fragment program. */ @@ -105,10 +122,12 @@ struct r300_fragment_program_external_state { /** * If the sampler is used as a shadow sampler, - * this field is (texture_compare_func - GL_NEVER). - * [e.g. if compare function is GL_LEQUAL, this field is 3] + * this field specifies the compare function. + * + * Otherwise, this field is \ref RC_COMPARE_FUNC_NEVER (aka 0). * * Otherwise, this field is 0. + * \sa rc_compare_func */ unsigned texture_compare_func : 3; } unit[16]; diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.c b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.c index da950d5289..babdcffd3a 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.c @@ -23,6 +23,8 @@ #include "radeon_compiler.h" #include +#include +#include #include "radeon_program.h" @@ -34,7 +36,7 @@ void rc_init(struct radeon_compiler * c) memory_pool_init(&c->Pool); c->Program.Instructions.Prev = &c->Program.Instructions; c->Program.Instructions.Next = &c->Program.Instructions; - c->Program.Instructions.I.Opcode = OPCODE_END; + c->Program.Instructions.I.Opcode = RC_OPCODE_ILLEGAL_OPCODE; } void rc_destroy(struct radeon_compiler * c) @@ -60,7 +62,7 @@ void rc_error(struct radeon_compiler * c, const char * fmt, ...) { va_list ap; - c->Error = GL_TRUE; + c->Error = 1; if (!c->ErrorMsg) { /* Only remember the first error */ @@ -95,18 +97,18 @@ void rc_error(struct radeon_compiler * c, const char * fmt, ...) * Rewrite the program such that everything that source the given input * register will source new_input instead. */ -void rc_move_input(struct radeon_compiler * c, unsigned input, struct prog_src_register new_input) +void rc_move_input(struct radeon_compiler * c, unsigned input, struct rc_src_register new_input) { struct rc_instruction * inst; c->Program.InputsRead &= ~(1 << input); for(inst = c->Program.Instructions.Next; inst != &c->Program.Instructions; inst = inst->Next) { - const unsigned numsrcs = _mesa_num_inst_src_regs(inst->I.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); unsigned i; - for(i = 0; i < numsrcs; ++i) { - if (inst->I.SrcReg[i].File == PROGRAM_INPUT && inst->I.SrcReg[i].Index == input) { + for(i = 0; i < opcode->NumSrcRegs; ++i) { + if (inst->I.SrcReg[i].File == RC_FILE_INPUT && inst->I.SrcReg[i].Index == input) { inst->I.SrcReg[i].File = new_input.File; inst->I.SrcReg[i].Index = new_input.Index; inst->I.SrcReg[i].Swizzle = combine_swizzles(new_input.Swizzle, inst->I.SrcReg[i].Swizzle); @@ -134,10 +136,10 @@ void rc_move_output(struct radeon_compiler * c, unsigned output, unsigned new_ou c->Program.OutputsWritten &= ~(1 << output); for(inst = c->Program.Instructions.Next; inst != &c->Program.Instructions; inst = inst->Next) { - const unsigned numdsts = _mesa_num_inst_dst_regs(inst->I.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); - if (numdsts) { - if (inst->I.DstReg.File == PROGRAM_OUTPUT && inst->I.DstReg.Index == output) { + if (opcode->HasDstReg) { + if (inst->I.DstReg.File == RC_FILE_OUTPUT && inst->I.DstReg.Index == output) { inst->I.DstReg.Index = new_output; inst->I.DstReg.WriteMask &= writemask; @@ -157,33 +159,33 @@ void rc_copy_output(struct radeon_compiler * c, unsigned output, unsigned dup_ou struct rc_instruction * inst; for(inst = c->Program.Instructions.Next; inst != &c->Program.Instructions; inst = inst->Next) { - const unsigned numdsts = _mesa_num_inst_dst_regs(inst->I.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); - if (numdsts) { - if (inst->I.DstReg.File == PROGRAM_OUTPUT && inst->I.DstReg.Index == output) { - inst->I.DstReg.File = PROGRAM_TEMPORARY; + if (opcode->HasDstReg) { + if (inst->I.DstReg.File == RC_FILE_OUTPUT && inst->I.DstReg.Index == output) { + inst->I.DstReg.File = RC_FILE_TEMPORARY; inst->I.DstReg.Index = tempreg; } } } inst = rc_insert_new_instruction(c, c->Program.Instructions.Prev); - inst->I.Opcode = OPCODE_MOV; - inst->I.DstReg.File = PROGRAM_OUTPUT; + inst->I.Opcode = RC_OPCODE_MOV; + inst->I.DstReg.File = RC_FILE_OUTPUT; inst->I.DstReg.Index = output; - inst->I.SrcReg[0].File = PROGRAM_TEMPORARY; + inst->I.SrcReg[0].File = RC_FILE_TEMPORARY; inst->I.SrcReg[0].Index = tempreg; - inst->I.SrcReg[0].Swizzle = SWIZZLE_XYZW; + inst->I.SrcReg[0].Swizzle = RC_SWIZZLE_XYZW; inst = rc_insert_new_instruction(c, c->Program.Instructions.Prev); - inst->I.Opcode = OPCODE_MOV; - inst->I.DstReg.File = PROGRAM_OUTPUT; + inst->I.Opcode = RC_OPCODE_MOV; + inst->I.DstReg.File = RC_FILE_OUTPUT; inst->I.DstReg.Index = dup_output; - inst->I.SrcReg[0].File = PROGRAM_TEMPORARY; + inst->I.SrcReg[0].File = RC_FILE_TEMPORARY; inst->I.SrcReg[0].Index = tempreg; - inst->I.SrcReg[0].Swizzle = SWIZZLE_XYZW; + inst->I.SrcReg[0].Swizzle = RC_SWIZZLE_XYZW; c->Program.OutputsWritten |= 1 << dup_output; } @@ -201,59 +203,59 @@ void rc_transform_fragment_wpos(struct radeon_compiler * c, unsigned wpos, unsig /* perspective divide */ struct rc_instruction * inst_rcp = rc_insert_new_instruction(c, &c->Program.Instructions); - inst_rcp->I.Opcode = OPCODE_RCP; + inst_rcp->I.Opcode = RC_OPCODE_RCP; - inst_rcp->I.DstReg.File = PROGRAM_TEMPORARY; + inst_rcp->I.DstReg.File = RC_FILE_TEMPORARY; inst_rcp->I.DstReg.Index = tempregi; - inst_rcp->I.DstReg.WriteMask = WRITEMASK_W; + inst_rcp->I.DstReg.WriteMask = RC_MASK_W; - inst_rcp->I.SrcReg[0].File = PROGRAM_INPUT; + inst_rcp->I.SrcReg[0].File = RC_FILE_INPUT; inst_rcp->I.SrcReg[0].Index = new_input; - inst_rcp->I.SrcReg[0].Swizzle = SWIZZLE_WWWW; + inst_rcp->I.SrcReg[0].Swizzle = RC_SWIZZLE_WWWW; struct rc_instruction * inst_mul = rc_insert_new_instruction(c, inst_rcp); - inst_mul->I.Opcode = OPCODE_MUL; + inst_mul->I.Opcode = RC_OPCODE_MUL; - inst_mul->I.DstReg.File = PROGRAM_TEMPORARY; + inst_mul->I.DstReg.File = RC_FILE_TEMPORARY; inst_mul->I.DstReg.Index = tempregi; - inst_mul->I.DstReg.WriteMask = WRITEMASK_XYZ; + inst_mul->I.DstReg.WriteMask = RC_MASK_XYZ; - inst_mul->I.SrcReg[0].File = PROGRAM_INPUT; + inst_mul->I.SrcReg[0].File = RC_FILE_INPUT; inst_mul->I.SrcReg[0].Index = new_input; - inst_mul->I.SrcReg[1].File = PROGRAM_TEMPORARY; + inst_mul->I.SrcReg[1].File = RC_FILE_TEMPORARY; inst_mul->I.SrcReg[1].Index = tempregi; - inst_mul->I.SrcReg[1].Swizzle = SWIZZLE_WWWW; + inst_mul->I.SrcReg[1].Swizzle = RC_SWIZZLE_WWWW; /* viewport transformation */ struct rc_instruction * inst_mad = rc_insert_new_instruction(c, inst_mul); - inst_mad->I.Opcode = OPCODE_MAD; + inst_mad->I.Opcode = RC_OPCODE_MAD; - inst_mad->I.DstReg.File = PROGRAM_TEMPORARY; + inst_mad->I.DstReg.File = RC_FILE_TEMPORARY; inst_mad->I.DstReg.Index = tempregi; - inst_mad->I.DstReg.WriteMask = WRITEMASK_XYZ; + inst_mad->I.DstReg.WriteMask = RC_MASK_XYZ; - inst_mad->I.SrcReg[0].File = PROGRAM_TEMPORARY; + inst_mad->I.SrcReg[0].File = RC_FILE_TEMPORARY; inst_mad->I.SrcReg[0].Index = tempregi; - inst_mad->I.SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_ZERO); + inst_mad->I.SrcReg[0].Swizzle = RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_ZERO); - inst_mad->I.SrcReg[1].File = PROGRAM_STATE_VAR; + inst_mad->I.SrcReg[1].File = RC_FILE_CONSTANT; inst_mad->I.SrcReg[1].Index = rc_constants_add_state(&c->Program.Constants, RC_STATE_R300_WINDOW_DIMENSION, 0); - inst_mad->I.SrcReg[1].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_ZERO); + inst_mad->I.SrcReg[1].Swizzle = RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_ZERO); - inst_mad->I.SrcReg[2].File = PROGRAM_STATE_VAR; + inst_mad->I.SrcReg[2].File = RC_FILE_CONSTANT; inst_mad->I.SrcReg[2].Index = inst_mad->I.SrcReg[1].Index; - inst_mad->I.SrcReg[2].Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_ZERO); + inst_mad->I.SrcReg[2].Swizzle = RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_ZERO); struct rc_instruction * inst; for (inst = inst_mad->Next; inst != &c->Program.Instructions; inst = inst->Next) { - const unsigned numsrcs = _mesa_num_inst_src_regs(inst->I.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); unsigned i; - for(i = 0; i < numsrcs; i++) { - if (inst->I.SrcReg[i].File == PROGRAM_INPUT && + for(i = 0; i < opcode->NumSrcRegs; i++) { + if (inst->I.SrcReg[i].File == RC_FILE_INPUT && inst->I.SrcReg[i].Index == wpos) { - inst->I.SrcReg[i].File = PROGRAM_TEMPORARY; + inst->I.SrcReg[i].File = RC_FILE_TEMPORARY; inst->I.SrcReg[i].Index = tempregi; } } diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h index fbe7c37dd1..018f9bba06 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h @@ -23,36 +23,11 @@ #ifndef RADEON_COMPILER_H #define RADEON_COMPILER_H -#include "main/mtypes.h" -#include "shader/prog_instruction.h" - #include "memory_pool.h" #include "radeon_code.h" +#include "radeon_program.h" -struct rc_instruction { - struct rc_instruction * Prev; - struct rc_instruction * Next; - struct prog_instruction I; -}; - -struct rc_program { - /** - * Instructions.Next points to the first instruction, - * Instructions.Prev points to the last instruction. - */ - struct rc_instruction Instructions; - - /* Long term, we should probably remove InputsRead & OutputsWritten, - * since updating dependent state can be fragile, and they aren't - * actually used very often. */ - uint32_t InputsRead; - uint32_t OutputsWritten; - uint32_t ShadowSamplers; /**< Texture units used for shadow sampling. */ - - struct rc_constant_list Constants; -}; - struct radeon_compiler { struct memory_pool Pool; struct rc_program Program; @@ -69,7 +44,7 @@ void rc_error(struct radeon_compiler * c, const char * fmt, ...); void rc_calculate_inputs_outputs(struct radeon_compiler * c); -void rc_move_input(struct radeon_compiler * c, unsigned input, struct prog_src_register new_input); +void rc_move_input(struct radeon_compiler * c, unsigned input, struct rc_src_register new_input); void rc_move_output(struct radeon_compiler * c, unsigned output, unsigned new_output, unsigned writemask); void rc_copy_output(struct radeon_compiler * c, unsigned output, unsigned dup_output); void rc_transform_fragment_wpos(struct radeon_compiler * c, unsigned wpos, unsigned new_input); @@ -95,7 +70,7 @@ void r3xx_compile_fragment_program(struct r300_fragment_program_compiler* c); struct r300_vertex_program_compiler { struct radeon_compiler Base; struct r300_vertex_program_code *code; - GLbitfield RequiredOutputs; + uint32_t RequiredOutputs; void * UserData; void (*SetHwInputOutput)(struct r300_vertex_program_compiler * c); diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_nqssadce.c b/src/mesa/drivers/dri/r300/compiler/radeon_nqssadce.c index aaaa50ad1f..3e02ebee81 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_nqssadce.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_nqssadce.c @@ -29,9 +29,6 @@ * @file * * "Not-quite SSA" and Dead-Code Elimination. - * - * @note This code uses SWIZZLE_NIL in a source register to indicate that - * the corresponding component is ignored by the corresponding instruction. */ #include "radeon_nqssadce.h" @@ -43,76 +40,55 @@ * Return the @ref register_state for the given register (or 0 for untracked * registers, i.e. constants). */ -static struct register_state *get_reg_state(struct nqssadce_state* s, GLuint file, GLuint index) +static struct register_state *get_reg_state(struct nqssadce_state* s, rc_register_file file, unsigned int index) { + if (index >= RC_REGISTER_MAX_INDEX) + return 0; + switch(file) { - case PROGRAM_TEMPORARY: return &s->Temps[index]; - case PROGRAM_OUTPUT: return &s->Outputs[index]; - case PROGRAM_ADDRESS: return &s->Address; + case RC_FILE_TEMPORARY: return &s->Temps[index]; + case RC_FILE_OUTPUT: return &s->Outputs[index]; + case RC_FILE_ADDRESS: return &s->Address; default: return 0; } } -/** - * Left multiplication of a register with a swizzle - * - * @note Works correctly only for X, Y, Z, W swizzles, not for constant swizzles. - */ -struct prog_src_register lmul_swizzle(GLuint swizzle, struct prog_src_register srcreg) -{ - struct prog_src_register tmp = srcreg; - int i; - tmp.Swizzle = 0; - tmp.Negate = NEGATE_NONE; - for(i = 0; i < 4; ++i) { - GLuint swz = GET_SWZ(swizzle, i); - if (swz < 4) { - tmp.Swizzle |= GET_SWZ(srcreg.Swizzle, swz) << (i*3); - tmp.Negate |= GET_BIT(srcreg.Negate, swz) << i; - } else { - tmp.Swizzle |= swz << (i*3); - } - } - return tmp; -} - - static void track_used_srcreg(struct nqssadce_state* s, - GLint src, GLuint sourced) + int src, unsigned int sourced) { - struct prog_instruction * inst = &s->IP->I; + struct rc_sub_instruction * inst = &s->IP->I; int i; - GLuint deswz_source = 0; + unsigned int deswz_source = 0; for(i = 0; i < 4; ++i) { if (GET_BIT(sourced, i)) { - GLuint swz = GET_SWZ(inst->SrcReg[src].Swizzle, i); + unsigned int swz = GET_SWZ(inst->SrcReg[src].Swizzle, i); deswz_source |= 1 << swz; } else { inst->SrcReg[src].Swizzle &= ~(7 << (3*i)); - inst->SrcReg[src].Swizzle |= SWIZZLE_NIL << (3*i); + inst->SrcReg[src].Swizzle |= RC_SWIZZLE_UNUSED << (3*i); } } if (!s->Descr->IsNativeSwizzle(inst->Opcode, inst->SrcReg[src])) { - struct prog_dst_register dstreg = inst->DstReg; - dstreg.File = PROGRAM_TEMPORARY; + struct rc_dst_register dstreg = inst->DstReg; + dstreg.File = RC_FILE_TEMPORARY; dstreg.Index = rc_find_free_temporary(s->Compiler); dstreg.WriteMask = sourced; s->Descr->BuildSwizzle(s, dstreg, inst->SrcReg[src]); - inst->SrcReg[src].File = PROGRAM_TEMPORARY; + inst->SrcReg[src].File = RC_FILE_TEMPORARY; inst->SrcReg[src].Index = dstreg.Index; inst->SrcReg[src].Swizzle = 0; - inst->SrcReg[src].Negate = NEGATE_NONE; + inst->SrcReg[src].Negate = RC_MASK_NONE; inst->SrcReg[src].Abs = 0; for(i = 0; i < 4; ++i) { if (GET_BIT(sourced, i)) inst->SrcReg[src].Swizzle |= i << (3*i); else - inst->SrcReg[src].Swizzle |= SWIZZLE_NIL << (3*i); + inst->SrcReg[src].Swizzle |= RC_SWIZZLE_UNUSED << (3*i); } deswz_source = sourced; } @@ -120,9 +96,9 @@ static void track_used_srcreg(struct nqssadce_state* s, struct register_state *regstate; if (inst->SrcReg[src].RelAddr) { - regstate = get_reg_state(s, PROGRAM_ADDRESS, 0); + regstate = get_reg_state(s, RC_FILE_ADDRESS, 0); if (regstate) - regstate->Sourced |= WRITEMASK_X; + regstate->Sourced |= RC_MASK_X; } else { regstate = get_reg_state(s, inst->SrcReg[src].File, inst->SrcReg[src].Index); if (regstate) @@ -130,21 +106,21 @@ static void track_used_srcreg(struct nqssadce_state* s, } } -static void unalias_srcregs(struct rc_instruction *inst, GLuint oldindex, GLuint newindex) +static void unalias_srcregs(struct rc_instruction *inst, unsigned int oldindex, unsigned int newindex) { - int nsrc = _mesa_num_inst_src_regs(inst->I.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); int i; - for(i = 0; i < nsrc; ++i) - if (inst->I.SrcReg[i].File == PROGRAM_TEMPORARY && inst->I.SrcReg[i].Index == oldindex) + for(i = 0; i < opcode->NumSrcRegs; ++i) + if (inst->I.SrcReg[i].File == RC_FILE_TEMPORARY && inst->I.SrcReg[i].Index == oldindex) inst->I.SrcReg[i].Index = newindex; } -static void unalias_temporary(struct nqssadce_state* s, GLuint oldindex) +static void unalias_temporary(struct nqssadce_state* s, unsigned int oldindex) { - GLuint newindex = rc_find_free_temporary(s->Compiler); + unsigned int newindex = rc_find_free_temporary(s->Compiler); struct rc_instruction * inst; for(inst = s->Compiler->Program.Instructions.Next; inst != s->IP; inst = inst->Next) { - if (inst->I.DstReg.File == PROGRAM_TEMPORARY && inst->I.DstReg.Index == oldindex) + if (inst->I.DstReg.File == RC_FILE_TEMPORARY && inst->I.DstReg.Index == oldindex) inst->I.DstReg.Index = newindex; unalias_srcregs(inst, oldindex, newindex); } @@ -157,13 +133,10 @@ static void unalias_temporary(struct nqssadce_state* s, GLuint oldindex) */ static void process_instruction(struct nqssadce_state* s) { - struct prog_instruction *inst = &s->IP->I; - GLuint WriteMask; - - if (inst->Opcode == OPCODE_END) - return; + struct rc_sub_instruction *inst = &s->IP->I; + unsigned int WriteMask; - if (inst->Opcode != OPCODE_KIL) { + if (inst->Opcode != RC_OPCODE_KIL) { struct register_state *regstate = get_reg_state(s, inst->DstReg.File, inst->DstReg.Index); if (!regstate) { rc_error(s->Compiler, "NqssaDce: bad destination register (%i[%i])\n", @@ -181,67 +154,67 @@ static void process_instruction(struct nqssadce_state* s) return; } - if (inst->DstReg.File == PROGRAM_TEMPORARY && !regstate->Sourced) + if (inst->DstReg.File == RC_FILE_TEMPORARY && !regstate->Sourced) unalias_temporary(s, inst->DstReg.Index); } WriteMask = inst->DstReg.WriteMask; switch (inst->Opcode) { - case OPCODE_ARL: - case OPCODE_DDX: - case OPCODE_DDY: - case OPCODE_FRC: - case OPCODE_MOV: + case RC_OPCODE_ARL: + case RC_OPCODE_DDX: + case RC_OPCODE_DDY: + case RC_OPCODE_FRC: + case RC_OPCODE_MOV: track_used_srcreg(s, 0, WriteMask); break; - case OPCODE_ADD: - case OPCODE_MAX: - case OPCODE_MIN: - case OPCODE_MUL: - case OPCODE_SGE: - case OPCODE_SLT: + case RC_OPCODE_ADD: + case RC_OPCODE_MAX: + case RC_OPCODE_MIN: + case RC_OPCODE_MUL: + case RC_OPCODE_SGE: + case RC_OPCODE_SLT: track_used_srcreg(s, 0, WriteMask); track_used_srcreg(s, 1, WriteMask); break; - case OPCODE_CMP: - case OPCODE_MAD: + case RC_OPCODE_CMP: + case RC_OPCODE_MAD: track_used_srcreg(s, 0, WriteMask); track_used_srcreg(s, 1, WriteMask); track_used_srcreg(s, 2, WriteMask); break; - case OPCODE_COS: - case OPCODE_EX2: - case OPCODE_LG2: - case OPCODE_RCP: - case OPCODE_RSQ: - case OPCODE_SIN: + case RC_OPCODE_COS: + case RC_OPCODE_EX2: + case RC_OPCODE_LG2: + case RC_OPCODE_RCP: + case RC_OPCODE_RSQ: + case RC_OPCODE_SIN: track_used_srcreg(s, 0, 0x1); break; - case OPCODE_DP3: + case RC_OPCODE_DP3: track_used_srcreg(s, 0, 0x7); track_used_srcreg(s, 1, 0x7); break; - case OPCODE_DP4: + case RC_OPCODE_DP4: track_used_srcreg(s, 0, 0xf); track_used_srcreg(s, 1, 0xf); break; - case OPCODE_KIL: - case OPCODE_TEX: - case OPCODE_TXB: - case OPCODE_TXP: + case RC_OPCODE_KIL: + case RC_OPCODE_TEX: + case RC_OPCODE_TXB: + case RC_OPCODE_TXP: track_used_srcreg(s, 0, 0xf); break; - case OPCODE_DST: + case RC_OPCODE_DST: track_used_srcreg(s, 0, 0x6); track_used_srcreg(s, 1, 0xa); break; - case OPCODE_EXP: - case OPCODE_LOG: - case OPCODE_POW: + case RC_OPCODE_EXP: + case RC_OPCODE_LOG: + case RC_OPCODE_POW: track_used_srcreg(s, 0, 0x3); break; - case OPCODE_LIT: + case RC_OPCODE_LIT: track_used_srcreg(s, 0, 0xb); break; default: @@ -261,16 +234,16 @@ void rc_calculate_inputs_outputs(struct radeon_compiler * c) for(inst = c->Program.Instructions.Next; inst != &c->Program.Instructions; inst = inst->Next) { + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); int i; - int num_src_regs = _mesa_num_inst_src_regs(inst->I.Opcode); - for (i = 0; i < num_src_regs; ++i) { - if (inst->I.SrcReg[i].File == PROGRAM_INPUT) + for (i = 0; i < opcode->NumSrcRegs; ++i) { + if (inst->I.SrcReg[i].File == RC_FILE_INPUT) c->Program.InputsRead |= 1 << inst->I.SrcReg[i].Index; } - if (_mesa_num_inst_dst_regs(inst->I.Opcode)) { - if (inst->I.DstReg.File == PROGRAM_OUTPUT) + if (opcode->HasDstReg) { + if (inst->I.DstReg.File == RC_FILE_OUTPUT) c->Program.OutputsWritten |= 1 << inst->I.DstReg.Index; } } @@ -280,7 +253,7 @@ void radeonNqssaDce(struct radeon_compiler * c, struct radeon_nqssadce_descr* de { struct nqssadce_state s; - _mesa_bzero(&s, sizeof(s)); + memset(&s, 0, sizeof(s)); s.Compiler = c; s.Descr = descr; s.UserData = data; diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_nqssadce.h b/src/mesa/drivers/dri/r300/compiler/radeon_nqssadce.h index b3fc77a35a..a2aa1eb8ca 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_nqssadce.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_nqssadce.h @@ -35,7 +35,7 @@ struct register_state { * Bitmask indicating which components of the register are sourced * by later instructions. */ - GLuint Sourced : 4; + unsigned int Sourced : 4; }; /** @@ -54,8 +54,8 @@ struct nqssadce_state { /** * Which registers are read by subsequent instructions? */ - struct register_state Temps[MAX_PROGRAM_TEMPS]; - struct register_state Outputs[VERT_RESULT_MAX]; + struct register_state Temps[RC_REGISTER_MAX_INDEX]; + struct register_state Outputs[RC_REGISTER_MAX_INDEX]; struct register_state Address; void * UserData; @@ -75,17 +75,18 @@ struct radeon_nqssadce_descr { /** * Check whether the given swizzle, absolute and negate combination * can be implemented natively by the hardware for this opcode. + * + * \return 1 if the swizzle is native for the given opcode */ - GLboolean (*IsNativeSwizzle)(GLuint opcode, struct prog_src_register reg); + int (*IsNativeSwizzle)(rc_opcode opcode, struct rc_src_register reg); /** * Emit (at the current IP) the instruction MOV dst, src; * The transformation will work recursively on the emitted instruction(s). */ - void (*BuildSwizzle)(struct nqssadce_state*, struct prog_dst_register dst, struct prog_src_register src); + void (*BuildSwizzle)(struct nqssadce_state*, struct rc_dst_register dst, struct rc_src_register src); }; void radeonNqssaDce(struct radeon_compiler * c, struct radeon_nqssadce_descr* descr, void * data); -struct prog_src_register lmul_swizzle(GLuint swizzle, struct prog_src_register srcreg); #endif /* __RADEON_PROGRAM_NQSSADCE_H_ */ diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c new file mode 100644 index 0000000000..ffe2de1a87 --- /dev/null +++ b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c @@ -0,0 +1,318 @@ +/* + * Copyright (C) 2009 Nicolai Haehnle. + * + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 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. + * + */ + +#include "radeon_opcodes.h" + +struct rc_opcode_info rc_opcodes[MAX_RC_OPCODE] = { + { + .Opcode = RC_OPCODE_NOP, + .Name = "NOP" + }, + { + .Opcode = RC_OPCODE_ILLEGAL_OPCODE, + .Name = "ILLEGAL OPCODE" + }, + { + .Opcode = RC_OPCODE_ABS, + .Name = "ABS", + .NumSrcRegs = 1, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_ADD, + .Name = "ADD", + .NumSrcRegs = 2, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_ARL, + .Name = "ARL", + .NumSrcRegs = 1, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_CMP, + .Name = "CMP", + .NumSrcRegs = 3, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_COS, + .Name = "COS", + .NumSrcRegs = 1, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_DDX, + .Name = "DDX", + .NumSrcRegs = 1, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_DDY, + .Name = "DDY", + .NumSrcRegs = 1, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_DP3, + .Name = "DP3", + .NumSrcRegs = 2, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_DP4, + .Name = "DP4", + .NumSrcRegs = 2, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_DPH, + .Name = "DPH", + .NumSrcRegs = 2, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_DST, + .Name = "DST", + .NumSrcRegs = 2, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_EX2, + .Name = "EX2", + .NumSrcRegs = 1, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_EXP, + .Name = "EXP", + .NumSrcRegs = 1, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_FLR, + .Name = "FLR", + .NumSrcRegs = 1, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_FRC, + .Name = "FRC", + .NumSrcRegs = 1, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_KIL, + .Name = "KIL", + .NumSrcRegs = 1 + }, + { + .Opcode = RC_OPCODE_LG2, + .Name = "LG2", + .NumSrcRegs = 1, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_LIT, + .Name = "LIT", + .NumSrcRegs = 1, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_LOG, + .Name = "LOG", + .NumSrcRegs = 1, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_LRP, + .Name = "LRP", + .NumSrcRegs = 3, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_MAD, + .Name = "MAD", + .NumSrcRegs = 3, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_MAX, + .Name = "MAX", + .NumSrcRegs = 2, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_MIN, + .Name = "MIN", + .NumSrcRegs = 2, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_MOV, + .Name = "MOV", + .NumSrcRegs = 1, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_MUL, + .Name = "MUL", + .NumSrcRegs = 2, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_POW, + .Name = "POW", + .NumSrcRegs = 2, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_RCP, + .Name = "RCP", + .NumSrcRegs = 1, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_RSQ, + .Name = "RSQ", + .NumSrcRegs = 1, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_SCS, + .Name = "SCS", + .NumSrcRegs = 1, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_SEQ, + .Name = "SEQ", + .NumSrcRegs = 2, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_SFL, + .Name = "SFL", + .NumSrcRegs = 0, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_SGE, + .Name = "SGE", + .NumSrcRegs = 2, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_SGT, + .Name = "SGT", + .NumSrcRegs = 2, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_SIN, + .Name = "SIN", + .NumSrcRegs = 1, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_SLE, + .Name = "SLE", + .NumSrcRegs = 2, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_SLT, + .Name = "SLT", + .NumSrcRegs = 2, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_SNE, + .Name = "SNE", + .NumSrcRegs = 2, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_SUB, + .Name = "SUB", + .NumSrcRegs = 2, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_SWZ, + .Name = "SWZ", + .NumSrcRegs = 1, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_XPD, + .Name = "XPD", + .NumSrcRegs = 2, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_TEX, + .Name = "TEX", + .HasTexture = 1, + .NumSrcRegs = 1, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_TXB, + .Name = "TXB", + .HasTexture = 1, + .NumSrcRegs = 1, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_TXD, + .Name = "TXD", + .HasTexture = 1, + .NumSrcRegs = 3, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_TXL, + .Name = "TXL", + .HasTexture = 1, + .NumSrcRegs = 1, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_TXP, + .Name = "TXP", + .HasTexture = 1, + .NumSrcRegs = 1, + .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_REPL_ALPHA, + .Name = "REPL_ALPHA", + .HasDstReg = 1 + } +}; diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h new file mode 100644 index 0000000000..4eb9be3e55 --- /dev/null +++ b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h @@ -0,0 +1,202 @@ +/* + * Copyright (C) 2009 Nicolai Haehnle. + * + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 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. + * + */ + +#ifndef RADEON_OPCODES_H +#define RADEON_OPCODES_H + +#include + +/** + * Opcodes understood by the Radeon compiler. + */ +typedef enum { + RC_OPCODE_NOP = 0, + RC_OPCODE_ILLEGAL_OPCODE, + + /** vec4 instruction: dst.c = abs(src0.c); */ + RC_OPCODE_ABS, + + /** vec4 instruction: dst.c = src0.c + src1.c; */ + RC_OPCODE_ADD, + + /** special instruction: load address register + * dst.x = floor(src.x), where dst must be an address register */ + RC_OPCODE_ARL, + + /** vec4 instruction: dst.c = src0.c < 0.0 ? src1.c : src2.c */ + RC_OPCODE_CMP, + + /** scalar instruction: dst = cos(src0.x) */ + RC_OPCODE_COS, + + /** special instruction: take vec4 partial derivative in X direction + * dst.c = d src0.c / dx */ + RC_OPCODE_DDX, + + /** special instruction: take vec4 partial derivative in Y direction + * dst.c = d src0.c / dy */ + RC_OPCODE_DDY, + + /** scalar instruction: dst = src0.x*src1.x + src0.y*src1.y + src0.z*src1.z */ + RC_OPCODE_DP3, + + /** scalar instruction: dst = src0.x*src1.x + src0.y*src1.y + src0.z*src1.z + src0.w*src1.w */ + RC_OPCODE_DP4, + + /** scalar instruction: dst = src0.x*src1.x + src0.y*src1.y + src0.z*src1.z + src1.w */ + RC_OPCODE_DPH, + + /** special instruction, see ARB_fragment_program */ + RC_OPCODE_DST, + + /** scalar instruction: dst = 2**src0.x */ + RC_OPCODE_EX2, + + /** special instruction, see ARB_vertex_program */ + RC_OPCODE_EXP, + + /** vec4 instruction: dst.c = floor(src0.c) */ + RC_OPCODE_FLR, + + /** vec4 instruction: dst.c = src0.c - floor(src0.c) */ + RC_OPCODE_FRC, + + /** special instruction: stop execution if any component of src0 is negative */ + RC_OPCODE_KIL, + + /** scalar instruction: dst = log_2(src0.x) */ + RC_OPCODE_LG2, + + /** special instruction, see ARB_vertex_program */ + RC_OPCODE_LIT, + + /** special instruction, see ARB_vertex_program */ + RC_OPCODE_LOG, + + /** vec4 instruction: dst.c = src0.c*src1.c + (1 - src0.c)*src2.c */ + RC_OPCODE_LRP, + + /** vec4 instruction: dst.c = src0.c*src1.c + src2.c */ + RC_OPCODE_MAD, + + /** vec4 instruction: dst.c = max(src0.c, src1.c) */ + RC_OPCODE_MAX, + + /** vec4 instruction: dst.c = min(src0.c, src1.c) */ + RC_OPCODE_MIN, + + /** vec4 instruction: dst.c = src0.c */ + RC_OPCODE_MOV, + + /** vec4 instruction: dst.c = src0.c*src1.c */ + RC_OPCODE_MUL, + + /** scalar instruction: dst = src0.x ** src1.x */ + RC_OPCODE_POW, + + /** scalar instruction: dst = 1 / src0.x */ + RC_OPCODE_RCP, + + /** scalar instruction: dst = 1 / sqrt(src0.x) */ + RC_OPCODE_RSQ, + + /** special instruction, see ARB_fragment_program */ + RC_OPCODE_SCS, + + /** vec4 instruction: dst.c = (src0.c == src1.c) ? 1.0 : 0.0 */ + RC_OPCODE_SEQ, + + /** vec4 instruction: dst.c = 0.0 */ + RC_OPCODE_SFL, + + /** vec4 instruction: dst.c = (src0.c >= src1.c) ? 1.0 : 0.0 */ + RC_OPCODE_SGE, + + /** vec4 instruction: dst.c = (src0.c > src1.c) ? 1.0 : 0.0 */ + RC_OPCODE_SGT, + + /** scalar instruction: dst = sin(src0.x) */ + RC_OPCODE_SIN, + + /** vec4 instruction: dst.c = (src0.c <= src1.c) ? 1.0 : 0.0 */ + RC_OPCODE_SLE, + + /** vec4 instruction: dst.c = (src0.c < src1.c) ? 1.0 : 0.0 */ + RC_OPCODE_SLT, + + /** vec4 instruction: dst.c = (src0.c != src1.c) ? 1.0 : 0.0 */ + RC_OPCODE_SNE, + + /** vec4 instruction: dst.c = src0.c - src1.c */ + RC_OPCODE_SUB, + + /** vec4 instruction: dst.c = src0.c */ + RC_OPCODE_SWZ, + + /** special instruction, see ARB_fragment_program */ + RC_OPCODE_XPD, + + RC_OPCODE_TEX, + RC_OPCODE_TXB, + RC_OPCODE_TXD, + RC_OPCODE_TXL, + RC_OPCODE_TXP, + + /** special instruction, used in R300-R500 fragment program pair instructions + * indicates that the result of the alpha operation shall be replicated + * across all other channels */ + RC_OPCODE_REPL_ALPHA, + + MAX_RC_OPCODE +} rc_opcode; + + +struct rc_opcode_info { + rc_opcode Opcode; + const char * Name; + + /** true if the instruction reads from a texture. + * + * \note This is false for the KIL instruction, even though KIL is + * a texture instruction from a hardware point of view. */ + unsigned int HasTexture:1; + + unsigned int NumSrcRegs:2; + unsigned int HasDstReg:1; +}; + +extern struct rc_opcode_info rc_opcodes[MAX_RC_OPCODE]; + +static inline const struct rc_opcode_info * rc_get_opcode_info(rc_opcode opcode) +{ + assert((unsigned int)opcode < MAX_RC_OPCODE); + assert(rc_opcodes[opcode].Opcode == opcode); + + return &rc_opcodes[opcode]; +} + +#endif /* RADEON_OPCODES_H */ diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program.c b/src/mesa/drivers/dri/r300/compiler/radeon_program.c index bf7f9ac92c..0e0c1f68e6 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program.c @@ -27,9 +27,9 @@ #include "radeon_program.h" +#include + #include "radeon_compiler.h" -#include "shader/prog_parameter.h" -#include "shader/prog_print.h" /** @@ -69,37 +69,57 @@ void radeonLocalTransform( } } +/** + * Left multiplication of a register with a swizzle + */ +struct rc_src_register lmul_swizzle(unsigned int swizzle, struct rc_src_register srcreg) +{ + struct rc_src_register tmp = srcreg; + int i; + tmp.Swizzle = 0; + tmp.Negate = 0; + for(i = 0; i < 4; ++i) { + rc_swizzle swz = GET_SWZ(swizzle, i); + if (swz < 4) { + tmp.Swizzle |= GET_SWZ(srcreg.Swizzle, swz) << (i*3); + tmp.Negate |= GET_BIT(srcreg.Negate, swz) << i; + } else { + tmp.Swizzle |= swz << (i*3); + } + } + return tmp; +} -GLint rc_find_free_temporary(struct radeon_compiler * c) +unsigned int rc_find_free_temporary(struct radeon_compiler * c) { - GLboolean used[MAX_PROGRAM_TEMPS]; - GLuint i; + char used[RC_REGISTER_MAX_INDEX]; + unsigned int i; memset(used, 0, sizeof(used)); for (struct rc_instruction * rcinst = c->Program.Instructions.Next; rcinst != &c->Program.Instructions; rcinst = rcinst->Next) { - const struct prog_instruction *inst = &rcinst->I; - const GLuint nsrc = _mesa_num_inst_src_regs(inst->Opcode); - const GLuint ndst = _mesa_num_inst_dst_regs(inst->Opcode); - GLuint k; - - for (k = 0; k < nsrc; k++) { - if (inst->SrcReg[k].File == PROGRAM_TEMPORARY) - used[inst->SrcReg[k].Index] = GL_TRUE; + const struct rc_sub_instruction *inst = &rcinst->I; + const struct rc_opcode_info *opcode = rc_get_opcode_info(inst->Opcode); + unsigned int k; + + for (k = 0; k < opcode->NumSrcRegs; k++) { + if (inst->SrcReg[k].File == RC_FILE_TEMPORARY) + used[inst->SrcReg[k].Index] = 1; } - if (ndst) { - if (inst->DstReg.File == PROGRAM_TEMPORARY) - used[inst->DstReg.Index] = GL_TRUE; + if (opcode->HasDstReg) { + if (inst->DstReg.File == RC_FILE_TEMPORARY) + used[inst->DstReg.Index] = 1; } } - for (i = 0; i < MAX_PROGRAM_TEMPS; i++) { + for (i = 0; i < RC_REGISTER_MAX_INDEX; i++) { if (!used[i]) return i; } - return -1; + rc_error(c, "Ran out of temporary registers\n"); + return 0; } @@ -107,10 +127,13 @@ struct rc_instruction *rc_alloc_instruction(struct radeon_compiler * c) { struct rc_instruction * inst = memory_pool_malloc(&c->Pool, sizeof(struct rc_instruction)); - inst->Prev = 0; - inst->Next = 0; + memset(inst, 0, sizeof(struct rc_instruction)); - _mesa_init_instructions(&inst->I, 1); + inst->I.Opcode = RC_OPCODE_ILLEGAL_OPCODE; + inst->I.DstReg.WriteMask = RC_MASK_XYZW; + inst->I.SrcReg[0].Swizzle = RC_SWIZZLE_XYZW; + inst->I.SrcReg[1].Swizzle = RC_SWIZZLE_XYZW; + inst->I.SrcReg[2].Swizzle = RC_SWIZZLE_XYZW; return inst; } @@ -135,14 +158,142 @@ void rc_remove_instruction(struct rc_instruction * inst) inst->Next->Prev = inst->Prev; } +static const char * textarget_to_string(rc_texture_target target) +{ + switch(target) { + case RC_TEXTURE_2D_ARRAY: return "2D_ARRAY"; + case RC_TEXTURE_1D_ARRAY: return "1D_ARRAY"; + case RC_TEXTURE_CUBE: return "CUBE"; + case RC_TEXTURE_3D: return "3D"; + case RC_TEXTURE_RECT: return "RECT"; + case RC_TEXTURE_2D: return "2D"; + case RC_TEXTURE_1D: return "1D"; + default: return "BAD_TEXTURE_TARGET"; + } +} + +static void rc_print_register(FILE * f, rc_register_file file, int index, unsigned int reladdr) +{ + if (file == RC_FILE_NONE) { + fprintf(f, "none"); + } else { + const char * filename; + switch(file) { + case RC_FILE_TEMPORARY: filename = "temp"; break; + case RC_FILE_INPUT: filename = "input"; break; + case RC_FILE_OUTPUT: filename = "output"; break; + case RC_FILE_ADDRESS: filename = "addr"; break; + case RC_FILE_CONSTANT: filename = "const"; break; + default: filename = "BAD FILE"; break; + } + fprintf(f, "%s[%i%s]", filename, index, reladdr ? " + addr[0]" : ""); + } +} + +static void rc_print_mask(FILE * f, unsigned int mask) +{ + if (mask & RC_MASK_X) fprintf(f, "x"); + if (mask & RC_MASK_Y) fprintf(f, "y"); + if (mask & RC_MASK_Z) fprintf(f, "z"); + if (mask & RC_MASK_W) fprintf(f, "w"); +} + +static void rc_print_dst_register(FILE * f, struct rc_dst_register dst) +{ + rc_print_register(f, dst.File, dst.Index, dst.RelAddr); + if (dst.WriteMask != RC_MASK_XYZW) { + fprintf(f, "."); + rc_print_mask(f, dst.WriteMask); + } +} + +static void rc_print_swizzle(FILE * f, unsigned int swizzle, unsigned int negate) +{ + unsigned int comp; + for(comp = 0; comp < 4; ++comp) { + rc_swizzle swz = GET_SWZ(swizzle, comp); + if (GET_BIT(negate, comp)) + fprintf(f, "-"); + switch(swz) { + case RC_SWIZZLE_X: fprintf(f, "x"); break; + case RC_SWIZZLE_Y: fprintf(f, "y"); break; + case RC_SWIZZLE_Z: fprintf(f, "z"); break; + case RC_SWIZZLE_W: fprintf(f, "w"); break; + case RC_SWIZZLE_ZERO: fprintf(f, "0"); break; + case RC_SWIZZLE_ONE: fprintf(f, "1"); break; + case RC_SWIZZLE_HALF: fprintf(f, "H"); break; + case RC_SWIZZLE_UNUSED: fprintf(f, "_"); break; + } + } +} + +static void rc_print_src_register(FILE * f, struct rc_src_register src) +{ + int trivial_negate = (src.Negate == RC_MASK_NONE || src.Negate == RC_MASK_XYZW); + + if (src.Negate == RC_MASK_XYZW) + fprintf(f, "-"); + if (src.Abs) + fprintf(f, "|"); + + rc_print_register(f, src.File, src.Index, src.RelAddr); + + if (src.Abs && !trivial_negate) + fprintf(f, "|"); + + if (src.Swizzle != RC_SWIZZLE_XYZW || !trivial_negate) { + fprintf(f, "."); + rc_print_swizzle(f, src.Swizzle, trivial_negate ? 0 : src.Negate); + } + + if (src.Abs && trivial_negate) + fprintf(f, "|"); +} + +static void rc_print_instruction(FILE * f, struct rc_instruction * inst) +{ + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); + unsigned int reg; + + fprintf(f, "%s", opcode->Name); + + switch(inst->I.SaturateMode) { + case RC_SATURATE_NONE: break; + case RC_SATURATE_ZERO_ONE: fprintf(f, "_SAT"); break; + case RC_SATURATE_MINUS_PLUS_ONE: fprintf(f, "_SAT2"); break; + default: fprintf(f, "_BAD_SAT"); break; + } + + if (opcode->HasDstReg) { + fprintf(f, " "); + rc_print_dst_register(f, inst->I.DstReg); + if (opcode->NumSrcRegs) + fprintf(f, ","); + } + + for(reg = 0; reg < opcode->NumSrcRegs; ++reg) { + if (reg > 0) + fprintf(f, ","); + fprintf(f, " "); + rc_print_src_register(f, inst->I.SrcReg[reg]); + } + + if (opcode->HasTexture) { + fprintf(f, ", %s%s[%u]", + textarget_to_string(inst->I.TexSrcTarget), + inst->I.TexShadow ? "SHADOW" : "", + inst->I.TexSrcUnit); + } + + fprintf(f, ";\n"); +} /** * Print program to stderr, default options. */ void rc_print_program(const struct rc_program *prog) { - GLuint indent = 0; - GLuint linenum = 1; + unsigned int linenum = 0; struct rc_instruction *inst; fprintf(stderr, "# Radeon Compiler Program\n"); @@ -150,11 +301,7 @@ void rc_print_program(const struct rc_program *prog) for(inst = prog->Instructions.Next; inst != &prog->Instructions; inst = inst->Next) { fprintf(stderr, "%3d: ", linenum); - /* Massive hack: We rely on the fact that the printers do not actually - * use the gl_program argument (last argument) in debug mode */ - indent = _mesa_fprint_instruction_opt( - stderr, &inst->I, - indent, PROG_PRINT_DEBUG, 0); + rc_print_instruction(stderr, inst); linenum++; } diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program.h b/src/mesa/drivers/dri/r300/compiler/radeon_program.h index 561958608c..a2ab757fec 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program.h @@ -28,37 +28,211 @@ #ifndef __RADEON_PROGRAM_H_ #define __RADEON_PROGRAM_H_ -#include "main/glheader.h" -#include "main/macros.h" -#include "main/enums.h" -#include "shader/program.h" -#include "shader/prog_instruction.h" +#include +#include + +#include "radeon_opcodes.h" +#include "radeon_code.h" struct radeon_compiler; -struct rc_instruction; -struct rc_program; -enum { - PROGRAM_BUILTIN = PROGRAM_FILE_MAX /**< not a real register, but a special swizzle constant */ +typedef enum { + RC_SATURATE_NONE = 0, + RC_SATURATE_ZERO_ONE, + RC_SATURATE_MINUS_PLUS_ONE +} rc_saturate_mode; + +typedef enum { + RC_TEXTURE_2D_ARRAY, + RC_TEXTURE_1D_ARRAY, + RC_TEXTURE_CUBE, + RC_TEXTURE_3D, + RC_TEXTURE_RECT, + RC_TEXTURE_2D, + RC_TEXTURE_1D +} rc_texture_target; + +typedef enum { + /** + * Used to indicate unused register descriptions and + * source register that use a constant swizzle. + */ + RC_FILE_NONE = 0, + RC_FILE_TEMPORARY, + + /** + * Input register. + * + * \note The compiler attaches no implicit semantics to input registers. + * Fragment/vertex program specific semantics must be defined explicitly + * using the appropriate compiler interfaces. + */ + RC_FILE_INPUT, + + /** + * Output register. + * + * \note The compiler attaches no implicit semantics to input registers. + * Fragment/vertex program specific semantics must be defined explicitly + * using the appropriate compiler interfaces. + */ + RC_FILE_OUTPUT, + RC_FILE_ADDRESS, + + /** + * Indicates a constant from the \ref rc_constant_list . + */ + RC_FILE_CONSTANT +} rc_register_file; + +#define RC_REGISTER_INDEX_BITS 10 +#define RC_REGISTER_MAX_INDEX (1 << RC_REGISTER_INDEX_BITS) + +typedef enum { + RC_SWIZZLE_X = 0, + RC_SWIZZLE_Y, + RC_SWIZZLE_Z, + RC_SWIZZLE_W, + RC_SWIZZLE_ZERO, + RC_SWIZZLE_ONE, + RC_SWIZZLE_HALF, + RC_SWIZZLE_UNUSED +} rc_swizzle; + +#define RC_MAKE_SWIZZLE(a,b,c,d) (((a)<<0) | ((b)<<3) | ((c)<<6) | ((d)<<9)) +#define RC_MAKE_SWIZZLE_SMEAR(a) RC_MAKE_SWIZZLE((a),(a),(a),(a)) +#define GET_SWZ(swz, idx) (((swz) >> ((idx)*3)) & 0x7) +#define GET_BIT(msk, idx) (((msk) >> (idx)) & 0x1) + +#define RC_SWIZZLE_XYZW RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_W) +#define RC_SWIZZLE_XXXX RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_X) +#define RC_SWIZZLE_YYYY RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_Y) +#define RC_SWIZZLE_ZZZZ RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_Z) +#define RC_SWIZZLE_WWWW RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_W) +#define RC_SWIZZLE_0000 RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_ZERO) +#define RC_SWIZZLE_1111 RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_ONE) + +/** + * \name Bitmasks for components of vectors. + * + * Used for write masks, negation masks, etc. + */ +/*@{*/ +#define RC_MASK_NONE 0 +#define RC_MASK_X 1 +#define RC_MASK_Y 2 +#define RC_MASK_Z 4 +#define RC_MASK_W 8 +#define RC_MASK_XY (RC_MASK_X|RC_MASK_Y) +#define RC_MASK_XYZ (RC_MASK_X|RC_MASK_Y|RC_MASK_Z) +#define RC_MASK_XYW (RC_MASK_X|RC_MASK_Y|RC_MASK_W) +#define RC_MASK_XYZW (RC_MASK_X|RC_MASK_Y|RC_MASK_Z|RC_MASK_W) +/*@}*/ + +struct rc_src_register { + rc_register_file File:3; + + /** Negative values may be used for relative addressing. */ + signed int Index:(RC_REGISTER_INDEX_BITS+1); + unsigned int RelAddr:1; + + unsigned int Swizzle:12; + + /** Take the component-wise absolute value */ + unsigned int Abs:1; + + /** Post-Abs negation. */ + unsigned int Negate:4; +}; + +struct rc_dst_register { + rc_register_file File:3; + + /** Negative values may be used for relative addressing. */ + signed int Index:(RC_REGISTER_INDEX_BITS+1); + unsigned int RelAddr:1; + + unsigned int WriteMask:4; +}; + +/** + * Instructions are maintained by the compiler in a doubly linked list + * of these structures. + * + * This instruction format is intended to be expanded for hardware-specific + * trickery. At different stages of compilation, a different set of + * instruction types may be valid. + */ +struct rc_sub_instruction { + struct rc_src_register SrcReg[3]; + struct rc_dst_register DstReg; + + /** + * Opcode of this instruction, according to \ref rc_opcode enums. + */ + rc_opcode Opcode:8; + + /** + * Saturate each value of the result to the range [0,1] or [-1,1], + * according to \ref rc_saturate_mode enums. + */ + rc_saturate_mode SaturateMode:2; + + /** + * \name Extra fields for TEX, TXB, TXD, TXL, TXP instructions. + */ + /*@{*/ + /** Source texture unit. */ + unsigned int TexSrcUnit:5; + + /** Source texture target, one of the \ref rc_texture_target enums */ + rc_texture_target TexSrcTarget:3; + + /** True if tex instruction should do shadow comparison */ + unsigned int TexShadow:1; + /*@}*/ +}; + +struct rc_instruction { + struct rc_instruction * Prev; + struct rc_instruction * Next; + + struct rc_sub_instruction I; +}; + +struct rc_program { + /** + * Instructions.Next points to the first instruction, + * Instructions.Prev points to the last instruction. + */ + struct rc_instruction Instructions; + + /* Long term, we should probably remove InputsRead & OutputsWritten, + * since updating dependent state can be fragile, and they aren't + * actually used very often. */ + uint32_t InputsRead; + uint32_t OutputsWritten; + uint32_t ShadowSamplers; /**< Texture units used for shadow sampling. */ + + struct rc_constant_list Constants; }; enum { - OPCODE_REPL_ALPHA = MAX_OPCODE /**< used in paired instructions */ + OPCODE_REPL_ALPHA = MAX_RC_OPCODE /**< used in paired instructions */ }; -#define SWIZZLE_0000 MAKE_SWIZZLE4(SWIZZLE_ZERO, SWIZZLE_ZERO, SWIZZLE_ZERO, SWIZZLE_ZERO) -#define SWIZZLE_1111 MAKE_SWIZZLE4(SWIZZLE_ONE, SWIZZLE_ONE, SWIZZLE_ONE, SWIZZLE_ONE) -static inline GLuint get_swz(GLuint swz, GLuint idx) +static inline rc_swizzle get_swz(unsigned int swz, rc_swizzle idx) { if (idx & 0x4) return idx; return GET_SWZ(swz, idx); } -static inline GLuint combine_swizzles4(GLuint src, GLuint swz_x, GLuint swz_y, GLuint swz_z, GLuint swz_w) +static inline unsigned int combine_swizzles4(unsigned int src, + rc_swizzle swz_x, rc_swizzle swz_y, rc_swizzle swz_z, rc_swizzle swz_w) { - GLuint ret = 0; + unsigned int ret = 0; ret |= get_swz(src, swz_x); ret |= get_swz(src, swz_y) << 3; @@ -68,22 +242,24 @@ static inline GLuint combine_swizzles4(GLuint src, GLuint swz_x, GLuint swz_y, G return ret; } -static inline GLuint combine_swizzles(GLuint src, GLuint swz) +static inline unsigned int combine_swizzles(unsigned int src, unsigned int swz) { - GLuint ret = 0; + unsigned int ret = 0; - ret |= get_swz(src, GET_SWZ(swz, SWIZZLE_X)); - ret |= get_swz(src, GET_SWZ(swz, SWIZZLE_Y)) << 3; - ret |= get_swz(src, GET_SWZ(swz, SWIZZLE_Z)) << 6; - ret |= get_swz(src, GET_SWZ(swz, SWIZZLE_W)) << 9; + ret |= get_swz(src, GET_SWZ(swz, RC_SWIZZLE_X)); + ret |= get_swz(src, GET_SWZ(swz, RC_SWIZZLE_Y)) << 3; + ret |= get_swz(src, GET_SWZ(swz, RC_SWIZZLE_Z)) << 6; + ret |= get_swz(src, GET_SWZ(swz, RC_SWIZZLE_W)) << 9; return ret; } -static INLINE void reset_srcreg(struct prog_src_register* reg) +struct rc_src_register lmul_swizzle(unsigned int swizzle, struct rc_src_register srcreg); + +static inline void reset_srcreg(struct rc_src_register* reg) { - _mesa_bzero(reg, sizeof(*reg)); - reg->Swizzle = SWIZZLE_NOOP; + memset(reg, 0, sizeof(reg)); + reg->Swizzle = RC_SWIZZLE_XYZW; } @@ -92,13 +268,13 @@ static INLINE void reset_srcreg(struct prog_src_register* reg) * * The function will be called once for each instruction. * It has to either emit the appropriate transformed code for the instruction - * and return GL_TRUE, or return GL_FALSE if it doesn't understand the + * and return true, or return false if it doesn't understand the * instruction. * * The function gets passed the userData as last parameter. */ struct radeon_program_transformation { - GLboolean (*function)( + int (*function)( struct radeon_compiler*, struct rc_instruction*, void*); @@ -110,7 +286,7 @@ void radeonLocalTransform( int num_transformations, struct radeon_program_transformation* transformations); -GLint rc_find_free_temporary(struct radeon_compiler * c); +unsigned int rc_find_free_temporary(struct radeon_compiler * c); struct rc_instruction *rc_alloc_instruction(struct radeon_compiler * c); struct rc_instruction *rc_insert_new_instruction(struct radeon_compiler * c, struct rc_instruction * after); diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c b/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c index 8071899eaa..041e3cab82 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c @@ -40,8 +40,8 @@ static struct rc_instruction *emit1( struct radeon_compiler * c, struct rc_instruction * after, - gl_inst_opcode Opcode, GLuint Saturate, struct prog_dst_register DstReg, - struct prog_src_register SrcReg) + rc_opcode Opcode, rc_saturate_mode Saturate, struct rc_dst_register DstReg, + struct rc_src_register SrcReg) { struct rc_instruction *fpi = rc_insert_new_instruction(c, after); @@ -54,8 +54,8 @@ static struct rc_instruction *emit1( static struct rc_instruction *emit2( struct radeon_compiler * c, struct rc_instruction * after, - gl_inst_opcode Opcode, GLuint Saturate, struct prog_dst_register DstReg, - struct prog_src_register SrcReg0, struct prog_src_register SrcReg1) + rc_opcode Opcode, rc_saturate_mode Saturate, struct rc_dst_register DstReg, + struct rc_src_register SrcReg0, struct rc_src_register SrcReg1) { struct rc_instruction *fpi = rc_insert_new_instruction(c, after); @@ -69,9 +69,9 @@ static struct rc_instruction *emit2( static struct rc_instruction *emit3( struct radeon_compiler * c, struct rc_instruction * after, - gl_inst_opcode Opcode, GLuint Saturate, struct prog_dst_register DstReg, - struct prog_src_register SrcReg0, struct prog_src_register SrcReg1, - struct prog_src_register SrcReg2) + rc_opcode Opcode, rc_saturate_mode Saturate, struct rc_dst_register DstReg, + struct rc_src_register SrcReg0, struct rc_src_register SrcReg1, + struct rc_src_register SrcReg2) { struct rc_instruction *fpi = rc_insert_new_instruction(c, after); @@ -84,131 +84,120 @@ static struct rc_instruction *emit3( return fpi; } -static struct prog_dst_register dstreg(int file, int index) +static struct rc_dst_register dstreg(int file, int index) { - struct prog_dst_register dst; + struct rc_dst_register dst; dst.File = file; dst.Index = index; - dst.WriteMask = WRITEMASK_XYZW; - dst.CondMask = COND_TR; + dst.WriteMask = RC_MASK_XYZW; dst.RelAddr = 0; - dst.CondSwizzle = SWIZZLE_NOOP; - dst.CondSrc = 0; - dst.pad = 0; return dst; } -static struct prog_dst_register dstregtmpmask(int index, int mask) +static struct rc_dst_register dstregtmpmask(int index, int mask) { - struct prog_dst_register dst = {0}; - dst.File = PROGRAM_TEMPORARY; + struct rc_dst_register dst = {0}; + dst.File = RC_FILE_TEMPORARY; dst.Index = index; dst.WriteMask = mask; dst.RelAddr = 0; - dst.CondMask = COND_TR; - dst.CondSwizzle = SWIZZLE_NOOP; - dst.CondSrc = 0; - dst.pad = 0; return dst; } -static const struct prog_src_register builtin_zero = { - .File = PROGRAM_BUILTIN, +static const struct rc_src_register builtin_zero = { + .File = RC_FILE_NONE, .Index = 0, - .Swizzle = SWIZZLE_0000 + .Swizzle = RC_SWIZZLE_0000 }; -static const struct prog_src_register builtin_one = { - .File = PROGRAM_BUILTIN, +static const struct rc_src_register builtin_one = { + .File = RC_FILE_NONE, .Index = 0, - .Swizzle = SWIZZLE_1111 + .Swizzle = RC_SWIZZLE_1111 }; -static const struct prog_src_register srcreg_undefined = { - .File = PROGRAM_UNDEFINED, +static const struct rc_src_register srcreg_undefined = { + .File = RC_FILE_NONE, .Index = 0, - .Swizzle = SWIZZLE_NOOP + .Swizzle = RC_SWIZZLE_XYZW }; -static struct prog_src_register srcreg(int file, int index) +static struct rc_src_register srcreg(int file, int index) { - struct prog_src_register src = srcreg_undefined; + struct rc_src_register src = srcreg_undefined; src.File = file; src.Index = index; return src; } -static struct prog_src_register srcregswz(int file, int index, int swz) +static struct rc_src_register srcregswz(int file, int index, int swz) { - struct prog_src_register src = srcreg_undefined; + struct rc_src_register src = srcreg_undefined; src.File = file; src.Index = index; src.Swizzle = swz; return src; } -static struct prog_src_register absolute(struct prog_src_register reg) +static struct rc_src_register absolute(struct rc_src_register reg) { - struct prog_src_register newreg = reg; + struct rc_src_register newreg = reg; newreg.Abs = 1; - newreg.Negate = NEGATE_NONE; + newreg.Negate = RC_MASK_NONE; return newreg; } -static struct prog_src_register negate(struct prog_src_register reg) +static struct rc_src_register negate(struct rc_src_register reg) { - struct prog_src_register newreg = reg; - newreg.Negate = newreg.Negate ^ NEGATE_XYZW; + struct rc_src_register newreg = reg; + newreg.Negate = newreg.Negate ^ RC_MASK_XYZW; return newreg; } -static struct prog_src_register swizzle(struct prog_src_register reg, GLuint x, GLuint y, GLuint z, GLuint w) +static struct rc_src_register swizzle(struct rc_src_register reg, + rc_swizzle x, rc_swizzle y, rc_swizzle z, rc_swizzle w) { - struct prog_src_register swizzled = reg; - swizzled.Swizzle = MAKE_SWIZZLE4( - x >= 4 ? x : GET_SWZ(reg.Swizzle, x), - y >= 4 ? y : GET_SWZ(reg.Swizzle, y), - z >= 4 ? z : GET_SWZ(reg.Swizzle, z), - w >= 4 ? w : GET_SWZ(reg.Swizzle, w)); + struct rc_src_register swizzled = reg; + swizzled.Swizzle = combine_swizzles4(reg.Swizzle, x, y, z, w); return swizzled; } -static struct prog_src_register scalar(struct prog_src_register reg) +static struct rc_src_register scalar(struct rc_src_register reg) { - return swizzle(reg, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X); + return swizzle(reg, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X); } static void transform_ABS(struct radeon_compiler* c, struct rc_instruction* inst) { - struct prog_src_register src = inst->I.SrcReg[0]; + struct rc_src_register src = inst->I.SrcReg[0]; src.Abs = 1; - src.Negate = NEGATE_NONE; - emit1(c, inst->Prev, OPCODE_MOV, inst->I.SaturateMode, inst->I.DstReg, src); + src.Negate = RC_MASK_NONE; + emit1(c, inst->Prev, RC_OPCODE_MOV, inst->I.SaturateMode, inst->I.DstReg, src); rc_remove_instruction(inst); } static void transform_DP3(struct radeon_compiler* c, struct rc_instruction* inst) { - struct prog_src_register src0 = inst->I.SrcReg[0]; - struct prog_src_register src1 = inst->I.SrcReg[1]; - src0.Negate &= ~NEGATE_W; + struct rc_src_register src0 = inst->I.SrcReg[0]; + struct rc_src_register src1 = inst->I.SrcReg[1]; + src0.Negate &= ~RC_MASK_W; src0.Swizzle &= ~(7 << (3 * 3)); - src0.Swizzle |= SWIZZLE_ZERO << (3 * 3); - src1.Negate &= ~NEGATE_W; + src0.Swizzle |= RC_SWIZZLE_ZERO << (3 * 3); + src1.Negate &= ~RC_MASK_W; src1.Swizzle &= ~(7 << (3 * 3)); - src1.Swizzle |= SWIZZLE_ZERO << (3 * 3); - emit2(c, inst->Prev, OPCODE_DP4, inst->I.SaturateMode, inst->I.DstReg, src0, src1); + src1.Swizzle |= RC_SWIZZLE_ZERO << (3 * 3); + emit2(c, inst->Prev, RC_OPCODE_DP4, inst->I.SaturateMode, inst->I.DstReg, src0, src1); rc_remove_instruction(inst); } static void transform_DPH(struct radeon_compiler* c, struct rc_instruction* inst) { - struct prog_src_register src0 = inst->I.SrcReg[0]; - src0.Negate &= ~NEGATE_W; + struct rc_src_register src0 = inst->I.SrcReg[0]; + src0.Negate &= ~RC_MASK_W; src0.Swizzle &= ~(7 << (3 * 3)); - src0.Swizzle |= SWIZZLE_ONE << (3 * 3); - emit2(c, inst->Prev, OPCODE_DP4, inst->I.SaturateMode, inst->I.DstReg, src0, inst->I.SrcReg[1]); + src0.Swizzle |= RC_SWIZZLE_ONE << (3 * 3); + emit2(c, inst->Prev, RC_OPCODE_DP4, inst->I.SaturateMode, inst->I.DstReg, src0, inst->I.SrcReg[1]); rc_remove_instruction(inst); } @@ -219,9 +208,9 @@ static void transform_DPH(struct radeon_compiler* c, static void transform_DST(struct radeon_compiler* c, struct rc_instruction* inst) { - emit2(c, inst->Prev, OPCODE_MUL, inst->I.SaturateMode, inst->I.DstReg, - swizzle(inst->I.SrcReg[0], SWIZZLE_ONE, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_ONE), - swizzle(inst->I.SrcReg[1], SWIZZLE_ONE, SWIZZLE_Y, SWIZZLE_ONE, SWIZZLE_W)); + emit2(c, inst->Prev, RC_OPCODE_MUL, inst->I.SaturateMode, inst->I.DstReg, + swizzle(inst->I.SrcReg[0], RC_SWIZZLE_ONE, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_ONE), + swizzle(inst->I.SrcReg[1], RC_SWIZZLE_ONE, RC_SWIZZLE_Y, RC_SWIZZLE_ONE, RC_SWIZZLE_W)); rc_remove_instruction(inst); } @@ -229,9 +218,9 @@ static void transform_FLR(struct radeon_compiler* c, struct rc_instruction* inst) { int tempreg = rc_find_free_temporary(c); - emit1(c, inst->Prev, OPCODE_FRC, 0, dstreg(PROGRAM_TEMPORARY, tempreg), inst->I.SrcReg[0]); - emit2(c, inst->Prev, OPCODE_ADD, inst->I.SaturateMode, inst->I.DstReg, - inst->I.SrcReg[0], negate(srcreg(PROGRAM_TEMPORARY, tempreg))); + emit1(c, inst->Prev, RC_OPCODE_FRC, 0, dstreg(RC_FILE_TEMPORARY, tempreg), inst->I.SrcReg[0]); + emit2(c, inst->Prev, RC_OPCODE_ADD, inst->I.SaturateMode, inst->I.DstReg, + inst->I.SrcReg[0], negate(srcreg(RC_FILE_TEMPORARY, tempreg))); rc_remove_instruction(inst); } @@ -256,64 +245,64 @@ static void transform_FLR(struct radeon_compiler* c, static void transform_LIT(struct radeon_compiler* c, struct rc_instruction* inst) { - GLuint constant; - GLuint constant_swizzle; - GLuint temp; - struct prog_src_register srctemp; + unsigned int constant; + unsigned int constant_swizzle; + unsigned int temp; + struct rc_src_register srctemp; constant = rc_constants_add_immediate_scalar(&c->Program.Constants, -127.999999, &constant_swizzle); - if (inst->I.DstReg.WriteMask != WRITEMASK_XYZW || inst->I.DstReg.File != PROGRAM_TEMPORARY) { + if (inst->I.DstReg.WriteMask != RC_MASK_XYZW || inst->I.DstReg.File != RC_FILE_TEMPORARY) { struct rc_instruction * inst_mov; inst_mov = emit1(c, inst, - OPCODE_MOV, 0, inst->I.DstReg, - srcreg(PROGRAM_TEMPORARY, rc_find_free_temporary(c))); + RC_OPCODE_MOV, 0, inst->I.DstReg, + srcreg(RC_FILE_TEMPORARY, rc_find_free_temporary(c))); - inst->I.DstReg.File = PROGRAM_TEMPORARY; + inst->I.DstReg.File = RC_FILE_TEMPORARY; inst->I.DstReg.Index = inst_mov->I.SrcReg[0].Index; - inst->I.DstReg.WriteMask = WRITEMASK_XYZW; + inst->I.DstReg.WriteMask = RC_MASK_XYZW; } temp = inst->I.DstReg.Index; - srctemp = srcreg(PROGRAM_TEMPORARY, temp); + srctemp = srcreg(RC_FILE_TEMPORARY, temp); // tmp.x = max(0.0, Src.x); // tmp.y = max(0.0, Src.y); // tmp.w = clamp(Src.z, -128+eps, 128-eps); - emit2(c, inst->Prev, OPCODE_MAX, 0, - dstregtmpmask(temp, WRITEMASK_XYW), + emit2(c, inst->Prev, RC_OPCODE_MAX, 0, + dstregtmpmask(temp, RC_MASK_XYW), inst->I.SrcReg[0], - swizzle(srcreg(PROGRAM_CONSTANT, constant), - SWIZZLE_ZERO, SWIZZLE_ZERO, SWIZZLE_ZERO, constant_swizzle&3)); - emit2(c, inst->Prev, OPCODE_MIN, 0, - dstregtmpmask(temp, WRITEMASK_Z), - swizzle(srctemp, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W), - negate(srcregswz(PROGRAM_CONSTANT, constant, constant_swizzle))); + swizzle(srcreg(RC_FILE_CONSTANT, constant), + RC_SWIZZLE_ZERO, RC_SWIZZLE_ZERO, RC_SWIZZLE_ZERO, constant_swizzle&3)); + emit2(c, inst->Prev, RC_OPCODE_MIN, 0, + dstregtmpmask(temp, RC_MASK_Z), + swizzle(srctemp, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W), + negate(srcregswz(RC_FILE_CONSTANT, constant, constant_swizzle))); // tmp.w = Pow(tmp.y, tmp.w) - emit1(c, inst->Prev, OPCODE_LG2, 0, - dstregtmpmask(temp, WRITEMASK_W), - swizzle(srctemp, SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y)); - emit2(c, inst->Prev, OPCODE_MUL, 0, - dstregtmpmask(temp, WRITEMASK_W), - swizzle(srctemp, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W), - swizzle(srctemp, SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z)); - emit1(c, inst->Prev, OPCODE_EX2, 0, - dstregtmpmask(temp, WRITEMASK_W), - swizzle(srctemp, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W)); + emit1(c, inst->Prev, RC_OPCODE_LG2, 0, + dstregtmpmask(temp, RC_MASK_W), + swizzle(srctemp, RC_SWIZZLE_Y, RC_SWIZZLE_Y, RC_SWIZZLE_Y, RC_SWIZZLE_Y)); + emit2(c, inst->Prev, RC_OPCODE_MUL, 0, + dstregtmpmask(temp, RC_MASK_W), + swizzle(srctemp, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W), + swizzle(srctemp, RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z)); + emit1(c, inst->Prev, RC_OPCODE_EX2, 0, + dstregtmpmask(temp, RC_MASK_W), + swizzle(srctemp, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W)); // tmp.z = (tmp.x > 0) ? tmp.w : 0.0 - emit3(c, inst->Prev, OPCODE_CMP, inst->I.SaturateMode, - dstregtmpmask(temp, WRITEMASK_Z), - negate(swizzle(srctemp, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X)), - swizzle(srctemp, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W), + emit3(c, inst->Prev, RC_OPCODE_CMP, inst->I.SaturateMode, + dstregtmpmask(temp, RC_MASK_Z), + negate(swizzle(srctemp, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X)), + swizzle(srctemp, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W), builtin_zero); // tmp.x, tmp.y, tmp.w = 1.0, tmp.x, 1.0 - emit1(c, inst->Prev, OPCODE_MOV, inst->I.SaturateMode, - dstregtmpmask(temp, WRITEMASK_XYW), - swizzle(srctemp, SWIZZLE_ONE, SWIZZLE_X, SWIZZLE_ONE, SWIZZLE_ONE)); + emit1(c, inst->Prev, RC_OPCODE_MOV, inst->I.SaturateMode, + dstregtmpmask(temp, RC_MASK_XYW), + swizzle(srctemp, RC_SWIZZLE_ONE, RC_SWIZZLE_X, RC_SWIZZLE_ONE, RC_SWIZZLE_ONE)); rc_remove_instruction(inst); } @@ -323,12 +312,12 @@ static void transform_LRP(struct radeon_compiler* c, { int tempreg = rc_find_free_temporary(c); - emit2(c, inst->Prev, OPCODE_ADD, 0, - dstreg(PROGRAM_TEMPORARY, tempreg), + emit2(c, inst->Prev, RC_OPCODE_ADD, 0, + dstreg(RC_FILE_TEMPORARY, tempreg), inst->I.SrcReg[1], negate(inst->I.SrcReg[2])); - emit3(c, inst->Prev, OPCODE_MAD, inst->I.SaturateMode, + emit3(c, inst->Prev, RC_OPCODE_MAD, inst->I.SaturateMode, inst->I.DstReg, - inst->I.SrcReg[0], srcreg(PROGRAM_TEMPORARY, tempreg), inst->I.SrcReg[2]); + inst->I.SrcReg[0], srcreg(RC_FILE_TEMPORARY, tempreg), inst->I.SrcReg[2]); rc_remove_instruction(inst); } @@ -337,14 +326,14 @@ static void transform_POW(struct radeon_compiler* c, struct rc_instruction* inst) { int tempreg = rc_find_free_temporary(c); - struct prog_dst_register tempdst = dstreg(PROGRAM_TEMPORARY, tempreg); - struct prog_src_register tempsrc = srcreg(PROGRAM_TEMPORARY, tempreg); - tempdst.WriteMask = WRITEMASK_W; - tempsrc.Swizzle = SWIZZLE_WWWW; + struct rc_dst_register tempdst = dstreg(RC_FILE_TEMPORARY, tempreg); + struct rc_src_register tempsrc = srcreg(RC_FILE_TEMPORARY, tempreg); + tempdst.WriteMask = RC_MASK_W; + tempsrc.Swizzle = RC_SWIZZLE_WWWW; - emit1(c, inst->Prev, OPCODE_LG2, 0, tempdst, scalar(inst->I.SrcReg[0])); - emit2(c, inst->Prev, OPCODE_MUL, 0, tempdst, tempsrc, scalar(inst->I.SrcReg[1])); - emit1(c, inst->Prev, OPCODE_EX2, inst->I.SaturateMode, inst->I.DstReg, tempsrc); + emit1(c, inst->Prev, RC_OPCODE_LG2, 0, tempdst, scalar(inst->I.SrcReg[0])); + emit2(c, inst->Prev, RC_OPCODE_MUL, 0, tempdst, tempsrc, scalar(inst->I.SrcReg[1])); + emit1(c, inst->Prev, RC_OPCODE_EX2, inst->I.SaturateMode, inst->I.DstReg, tempsrc); rc_remove_instruction(inst); } @@ -360,9 +349,9 @@ static void transform_SGE(struct radeon_compiler* c, { int tempreg = rc_find_free_temporary(c); - emit2(c, inst->Prev, OPCODE_ADD, 0, dstreg(PROGRAM_TEMPORARY, tempreg), inst->I.SrcReg[0], negate(inst->I.SrcReg[1])); - emit3(c, inst->Prev, OPCODE_CMP, inst->I.SaturateMode, inst->I.DstReg, - srcreg(PROGRAM_TEMPORARY, tempreg), builtin_zero, builtin_one); + emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dstreg(RC_FILE_TEMPORARY, tempreg), inst->I.SrcReg[0], negate(inst->I.SrcReg[1])); + emit3(c, inst->Prev, RC_OPCODE_CMP, inst->I.SaturateMode, inst->I.DstReg, + srcreg(RC_FILE_TEMPORARY, tempreg), builtin_zero, builtin_one); rc_remove_instruction(inst); } @@ -372,9 +361,9 @@ static void transform_SLT(struct radeon_compiler* c, { int tempreg = rc_find_free_temporary(c); - emit2(c, inst->Prev, OPCODE_ADD, 0, dstreg(PROGRAM_TEMPORARY, tempreg), inst->I.SrcReg[0], negate(inst->I.SrcReg[1])); - emit3(c, inst->Prev, OPCODE_CMP, inst->I.SaturateMode, inst->I.DstReg, - srcreg(PROGRAM_TEMPORARY, tempreg), builtin_one, builtin_zero); + emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dstreg(RC_FILE_TEMPORARY, tempreg), inst->I.SrcReg[0], negate(inst->I.SrcReg[1])); + emit3(c, inst->Prev, RC_OPCODE_CMP, inst->I.SaturateMode, inst->I.DstReg, + srcreg(RC_FILE_TEMPORARY, tempreg), builtin_one, builtin_zero); rc_remove_instruction(inst); } @@ -382,14 +371,14 @@ static void transform_SLT(struct radeon_compiler* c, static void transform_SUB(struct radeon_compiler* c, struct rc_instruction* inst) { - inst->I.Opcode = OPCODE_ADD; + inst->I.Opcode = RC_OPCODE_ADD; inst->I.SrcReg[1] = negate(inst->I.SrcReg[1]); } static void transform_SWZ(struct radeon_compiler* c, struct rc_instruction* inst) { - inst->I.Opcode = OPCODE_MOV; + inst->I.Opcode = RC_OPCODE_MOV; } static void transform_XPD(struct radeon_compiler* c, @@ -397,13 +386,13 @@ static void transform_XPD(struct radeon_compiler* c, { int tempreg = rc_find_free_temporary(c); - emit2(c, inst->Prev, OPCODE_MUL, 0, dstreg(PROGRAM_TEMPORARY, tempreg), - swizzle(inst->I.SrcReg[0], SWIZZLE_Z, SWIZZLE_X, SWIZZLE_Y, SWIZZLE_W), - swizzle(inst->I.SrcReg[1], SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_X, SWIZZLE_W)); - emit3(c, inst->Prev, OPCODE_MAD, inst->I.SaturateMode, inst->I.DstReg, - swizzle(inst->I.SrcReg[0], SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_X, SWIZZLE_W), - swizzle(inst->I.SrcReg[1], SWIZZLE_Z, SWIZZLE_X, SWIZZLE_Y, SWIZZLE_W), - negate(srcreg(PROGRAM_TEMPORARY, tempreg))); + emit2(c, inst->Prev, RC_OPCODE_MUL, 0, dstreg(RC_FILE_TEMPORARY, tempreg), + swizzle(inst->I.SrcReg[0], RC_SWIZZLE_Z, RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_W), + swizzle(inst->I.SrcReg[1], RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_X, RC_SWIZZLE_W)); + emit3(c, inst->Prev, RC_OPCODE_MAD, inst->I.SaturateMode, inst->I.DstReg, + swizzle(inst->I.SrcReg[0], RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_X, RC_SWIZZLE_W), + swizzle(inst->I.SrcReg[1], RC_SWIZZLE_Z, RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_W), + negate(srcreg(RC_FILE_TEMPORARY, tempreg))); rc_remove_instruction(inst); } @@ -423,27 +412,27 @@ static void transform_XPD(struct radeon_compiler* c, * * @note should be applicable to R300 and R500 fragment programs. */ -GLboolean radeonTransformALU( +int radeonTransformALU( struct radeon_compiler * c, struct rc_instruction* inst, void* unused) { switch(inst->I.Opcode) { - case OPCODE_ABS: transform_ABS(c, inst); return GL_TRUE; - case OPCODE_DPH: transform_DPH(c, inst); return GL_TRUE; - case OPCODE_DST: transform_DST(c, inst); return GL_TRUE; - case OPCODE_FLR: transform_FLR(c, inst); return GL_TRUE; - case OPCODE_LIT: transform_LIT(c, inst); return GL_TRUE; - case OPCODE_LRP: transform_LRP(c, inst); return GL_TRUE; - case OPCODE_POW: transform_POW(c, inst); return GL_TRUE; - case OPCODE_RSQ: transform_RSQ(c, inst); return GL_TRUE; - case OPCODE_SGE: transform_SGE(c, inst); return GL_TRUE; - case OPCODE_SLT: transform_SLT(c, inst); return GL_TRUE; - case OPCODE_SUB: transform_SUB(c, inst); return GL_TRUE; - case OPCODE_SWZ: transform_SWZ(c, inst); return GL_TRUE; - case OPCODE_XPD: transform_XPD(c, inst); return GL_TRUE; + case RC_OPCODE_ABS: transform_ABS(c, inst); return 1; + case RC_OPCODE_DPH: transform_DPH(c, inst); return 1; + case RC_OPCODE_DST: transform_DST(c, inst); return 1; + case RC_OPCODE_FLR: transform_FLR(c, inst); return 1; + case RC_OPCODE_LIT: transform_LIT(c, inst); return 1; + case RC_OPCODE_LRP: transform_LRP(c, inst); return 1; + case RC_OPCODE_POW: transform_POW(c, inst); return 1; + case RC_OPCODE_RSQ: transform_RSQ(c, inst); return 1; + case RC_OPCODE_SGE: transform_SGE(c, inst); return 1; + case RC_OPCODE_SLT: transform_SLT(c, inst); return 1; + case RC_OPCODE_SUB: transform_SUB(c, inst); return 1; + case RC_OPCODE_SWZ: transform_SWZ(c, inst); return 1; + case RC_OPCODE_XPD: transform_XPD(c, inst); return 1; default: - return GL_FALSE; + return 0; } } @@ -452,37 +441,37 @@ static void transform_r300_vertex_ABS(struct radeon_compiler* c, struct rc_instruction* inst) { /* Note: r500 can take absolute values, but r300 cannot. */ - inst->I.Opcode = OPCODE_MAX; + inst->I.Opcode = RC_OPCODE_MAX; inst->I.SrcReg[1] = inst->I.SrcReg[0]; - inst->I.SrcReg[1].Negate ^= NEGATE_XYZW; + inst->I.SrcReg[1].Negate ^= RC_MASK_XYZW; } /** * For use with radeonLocalTransform, this transforms non-native ALU * instructions of the r300 up to r500 vertex engine. */ -GLboolean r300_transform_vertex_alu( +int r300_transform_vertex_alu( struct radeon_compiler * c, struct rc_instruction* inst, void* unused) { switch(inst->I.Opcode) { - case OPCODE_ABS: transform_r300_vertex_ABS(c, inst); return GL_TRUE; - case OPCODE_DP3: transform_DP3(c, inst); return GL_TRUE; - case OPCODE_DPH: transform_DPH(c, inst); return GL_TRUE; - case OPCODE_FLR: transform_FLR(c, inst); return GL_TRUE; - case OPCODE_LRP: transform_LRP(c, inst); return GL_TRUE; - case OPCODE_SUB: transform_SUB(c, inst); return GL_TRUE; - case OPCODE_SWZ: transform_SWZ(c, inst); return GL_TRUE; - case OPCODE_XPD: transform_XPD(c, inst); return GL_TRUE; + case RC_OPCODE_ABS: transform_r300_vertex_ABS(c, inst); return 1; + case RC_OPCODE_DP3: transform_DP3(c, inst); return 1; + case RC_OPCODE_DPH: transform_DPH(c, inst); return 1; + case RC_OPCODE_FLR: transform_FLR(c, inst); return 1; + case RC_OPCODE_LRP: transform_LRP(c, inst); return 1; + case RC_OPCODE_SUB: transform_SUB(c, inst); return 1; + case RC_OPCODE_SWZ: transform_SWZ(c, inst); return 1; + case RC_OPCODE_XPD: transform_XPD(c, inst); return 1; default: - return GL_FALSE; + return 0; } } -static void sincos_constants(struct radeon_compiler* c, GLuint *constants) +static void sincos_constants(struct radeon_compiler* c, unsigned int *constants) { - static const GLfloat SinCosConsts[2][4] = { + static const float SinCosConsts[2][4] = { { 1.273239545, // 4/PI -0.405284735, // -4/(PI*PI) @@ -512,25 +501,25 @@ static void sincos_constants(struct radeon_compiler* c, GLuint *constants) */ static void sin_approx( struct radeon_compiler* c, struct rc_instruction * after, - struct prog_dst_register dst, struct prog_src_register src, const GLuint* constants) -{ - GLuint tempreg = rc_find_free_temporary(c); - - emit2(c, after->Prev, OPCODE_MUL, 0, dstregtmpmask(tempreg, WRITEMASK_XY), - swizzle(src, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X), - srcreg(PROGRAM_CONSTANT, constants[0])); - emit3(c, after->Prev, OPCODE_MAD, 0, dstregtmpmask(tempreg, WRITEMASK_X), - swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y), - absolute(swizzle(src, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X)), - swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X)); - emit3(c, after->Prev, OPCODE_MAD, 0, dstregtmpmask(tempreg, WRITEMASK_Y), - swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X), - absolute(swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X)), - negate(swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X))); - emit3(c, after->Prev, OPCODE_MAD, 0, dst, - swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y), - swizzle(srcreg(PROGRAM_CONSTANT, constants[0]), SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W), - swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X)); + struct rc_dst_register dst, struct rc_src_register src, const unsigned int* constants) +{ + unsigned int tempreg = rc_find_free_temporary(c); + + emit2(c, after->Prev, RC_OPCODE_MUL, 0, dstregtmpmask(tempreg, RC_MASK_XY), + swizzle(src, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X), + srcreg(RC_FILE_CONSTANT, constants[0])); + emit3(c, after->Prev, RC_OPCODE_MAD, 0, dstregtmpmask(tempreg, RC_MASK_X), + swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_Y, RC_SWIZZLE_Y, RC_SWIZZLE_Y, RC_SWIZZLE_Y), + absolute(swizzle(src, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X)), + swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X)); + emit3(c, after->Prev, RC_OPCODE_MAD, 0, dstregtmpmask(tempreg, RC_MASK_Y), + swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X), + absolute(swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X)), + negate(swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X))); + emit3(c, after->Prev, RC_OPCODE_MAD, 0, dst, + swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_Y, RC_SWIZZLE_Y, RC_SWIZZLE_Y, RC_SWIZZLE_Y), + swizzle(srcreg(RC_FILE_CONSTANT, constants[0]), RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W), + swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X)); } /** @@ -538,81 +527,81 @@ static void sin_approx( * using only the basic instructions * MOV, ADD, MUL, MAD, FRC */ -GLboolean radeonTransformTrigSimple(struct radeon_compiler* c, +int radeonTransformTrigSimple(struct radeon_compiler* c, struct rc_instruction* inst, void* unused) { - if (inst->I.Opcode != OPCODE_COS && - inst->I.Opcode != OPCODE_SIN && - inst->I.Opcode != OPCODE_SCS) - return GL_FALSE; + if (inst->I.Opcode != RC_OPCODE_COS && + inst->I.Opcode != RC_OPCODE_SIN && + inst->I.Opcode != RC_OPCODE_SCS) + return 0; - GLuint constants[2]; - GLuint tempreg = rc_find_free_temporary(c); + unsigned int constants[2]; + unsigned int tempreg = rc_find_free_temporary(c); sincos_constants(c, constants); - if (inst->I.Opcode == OPCODE_COS) { + if (inst->I.Opcode == RC_OPCODE_COS) { // MAD tmp.x, src, 1/(2*PI), 0.75 // FRC tmp.x, tmp.x // MAD tmp.z, tmp.x, 2*PI, -PI - emit3(c, inst->Prev, OPCODE_MAD, 0, dstregtmpmask(tempreg, WRITEMASK_W), - swizzle(inst->I.SrcReg[0], SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X), - swizzle(srcreg(PROGRAM_CONSTANT, constants[1]), SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z), - swizzle(srcreg(PROGRAM_CONSTANT, constants[1]), SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X)); - emit1(c, inst->Prev, OPCODE_FRC, 0, dstregtmpmask(tempreg, WRITEMASK_W), - swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W)); - emit3(c, inst->Prev, OPCODE_MAD, 0, dstregtmpmask(tempreg, WRITEMASK_W), - swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W), - swizzle(srcreg(PROGRAM_CONSTANT, constants[1]), SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W), - negate(swizzle(srcreg(PROGRAM_CONSTANT, constants[0]), SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z))); + emit3(c, inst->Prev, RC_OPCODE_MAD, 0, dstregtmpmask(tempreg, RC_MASK_W), + swizzle(inst->I.SrcReg[0], RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X), + swizzle(srcreg(RC_FILE_CONSTANT, constants[1]), RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z), + swizzle(srcreg(RC_FILE_CONSTANT, constants[1]), RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X)); + emit1(c, inst->Prev, RC_OPCODE_FRC, 0, dstregtmpmask(tempreg, RC_MASK_W), + swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W)); + emit3(c, inst->Prev, RC_OPCODE_MAD, 0, dstregtmpmask(tempreg, RC_MASK_W), + swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W), + swizzle(srcreg(RC_FILE_CONSTANT, constants[1]), RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W), + negate(swizzle(srcreg(RC_FILE_CONSTANT, constants[0]), RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z))); sin_approx(c, inst->Prev, inst->I.DstReg, - swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W), + swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W), constants); - } else if (inst->I.Opcode == OPCODE_SIN) { - emit3(c, inst->Prev, OPCODE_MAD, 0, dstregtmpmask(tempreg, WRITEMASK_W), - swizzle(inst->I.SrcReg[0], SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X), - swizzle(srcreg(PROGRAM_CONSTANT, constants[1]), SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z), - swizzle(srcreg(PROGRAM_CONSTANT, constants[1]), SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y)); - emit1(c, inst->Prev, OPCODE_FRC, 0, dstregtmpmask(tempreg, WRITEMASK_W), - swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W)); - emit3(c, inst->Prev, OPCODE_MAD, 0, dstregtmpmask(tempreg, WRITEMASK_W), - swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W), - swizzle(srcreg(PROGRAM_CONSTANT, constants[1]), SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W), - negate(swizzle(srcreg(PROGRAM_CONSTANT, constants[0]), SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z))); + } else if (inst->I.Opcode == RC_OPCODE_SIN) { + emit3(c, inst->Prev, RC_OPCODE_MAD, 0, dstregtmpmask(tempreg, RC_MASK_W), + swizzle(inst->I.SrcReg[0], RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X), + swizzle(srcreg(RC_FILE_CONSTANT, constants[1]), RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z), + swizzle(srcreg(RC_FILE_CONSTANT, constants[1]), RC_SWIZZLE_Y, RC_SWIZZLE_Y, RC_SWIZZLE_Y, RC_SWIZZLE_Y)); + emit1(c, inst->Prev, RC_OPCODE_FRC, 0, dstregtmpmask(tempreg, RC_MASK_W), + swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W)); + emit3(c, inst->Prev, RC_OPCODE_MAD, 0, dstregtmpmask(tempreg, RC_MASK_W), + swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W), + swizzle(srcreg(RC_FILE_CONSTANT, constants[1]), RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W), + negate(swizzle(srcreg(RC_FILE_CONSTANT, constants[0]), RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z))); sin_approx(c, inst->Prev, inst->I.DstReg, - swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W), + swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W), constants); } else { - emit3(c, inst->Prev, OPCODE_MAD, 0, dstregtmpmask(tempreg, WRITEMASK_XY), - swizzle(inst->I.SrcReg[0], SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X), - swizzle(srcreg(PROGRAM_CONSTANT, constants[1]), SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z), - swizzle(srcreg(PROGRAM_CONSTANT, constants[1]), SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_W)); - emit1(c, inst->Prev, OPCODE_FRC, 0, dstregtmpmask(tempreg, WRITEMASK_XY), - srcreg(PROGRAM_TEMPORARY, tempreg)); - emit3(c, inst->Prev, OPCODE_MAD, 0, dstregtmpmask(tempreg, WRITEMASK_XY), - srcreg(PROGRAM_TEMPORARY, tempreg), - swizzle(srcreg(PROGRAM_CONSTANT, constants[1]), SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W), - negate(swizzle(srcreg(PROGRAM_CONSTANT, constants[0]), SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z))); - - struct prog_dst_register dst = inst->I.DstReg; - - dst.WriteMask = inst->I.DstReg.WriteMask & WRITEMASK_X; + emit3(c, inst->Prev, RC_OPCODE_MAD, 0, dstregtmpmask(tempreg, RC_MASK_XY), + swizzle(inst->I.SrcReg[0], RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X), + swizzle(srcreg(RC_FILE_CONSTANT, constants[1]), RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z), + swizzle(srcreg(RC_FILE_CONSTANT, constants[1]), RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_W)); + emit1(c, inst->Prev, RC_OPCODE_FRC, 0, dstregtmpmask(tempreg, RC_MASK_XY), + srcreg(RC_FILE_TEMPORARY, tempreg)); + emit3(c, inst->Prev, RC_OPCODE_MAD, 0, dstregtmpmask(tempreg, RC_MASK_XY), + srcreg(RC_FILE_TEMPORARY, tempreg), + swizzle(srcreg(RC_FILE_CONSTANT, constants[1]), RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W), + negate(swizzle(srcreg(RC_FILE_CONSTANT, constants[0]), RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z))); + + struct rc_dst_register dst = inst->I.DstReg; + + dst.WriteMask = inst->I.DstReg.WriteMask & RC_MASK_X; sin_approx(c, inst->Prev, dst, - swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X), + swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X), constants); - dst.WriteMask = inst->I.DstReg.WriteMask & WRITEMASK_Y; + dst.WriteMask = inst->I.DstReg.WriteMask & RC_MASK_Y; sin_approx(c, inst->Prev, dst, - swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y), + swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_Y, RC_SWIZZLE_Y, RC_SWIZZLE_Y, RC_SWIZZLE_Y), constants); } rc_remove_instruction(inst); - return GL_TRUE; + return 1; } @@ -624,53 +613,53 @@ GLboolean radeonTransformTrigSimple(struct radeon_compiler* c, * * @warning This transformation implicitly changes the semantics of SIN and COS! */ -GLboolean radeonTransformTrigScale(struct radeon_compiler* c, +int radeonTransformTrigScale(struct radeon_compiler* c, struct rc_instruction* inst, void* unused) { - if (inst->I.Opcode != OPCODE_COS && - inst->I.Opcode != OPCODE_SIN && - inst->I.Opcode != OPCODE_SCS) - return GL_FALSE; + if (inst->I.Opcode != RC_OPCODE_COS && + inst->I.Opcode != RC_OPCODE_SIN && + inst->I.Opcode != RC_OPCODE_SCS) + return 0; - static const GLfloat RCP_2PI = 0.15915494309189535; - GLuint temp; - GLuint constant; - GLuint constant_swizzle; + static const float RCP_2PI = 0.15915494309189535; + unsigned int temp; + unsigned int constant; + unsigned int constant_swizzle; temp = rc_find_free_temporary(c); constant = rc_constants_add_immediate_scalar(&c->Program.Constants, RCP_2PI, &constant_swizzle); - emit2(c, inst->Prev, OPCODE_MUL, 0, dstregtmpmask(temp, WRITEMASK_W), - swizzle(inst->I.SrcReg[0], SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X), - srcregswz(PROGRAM_CONSTANT, constant, constant_swizzle)); - emit1(c, inst->Prev, OPCODE_FRC, 0, dstregtmpmask(temp, WRITEMASK_W), - srcreg(PROGRAM_TEMPORARY, temp)); - - if (inst->I.Opcode == OPCODE_COS) { - emit1(c, inst->Prev, OPCODE_COS, inst->I.SaturateMode, inst->I.DstReg, - srcregswz(PROGRAM_TEMPORARY, temp, SWIZZLE_WWWW)); - } else if (inst->I.Opcode == OPCODE_SIN) { - emit1(c, inst->Prev, OPCODE_SIN, inst->I.SaturateMode, - inst->I.DstReg, srcregswz(PROGRAM_TEMPORARY, temp, SWIZZLE_WWWW)); - } else if (inst->I.Opcode == OPCODE_SCS) { - struct prog_dst_register moddst = inst->I.DstReg; - - if (inst->I.DstReg.WriteMask & WRITEMASK_X) { - moddst.WriteMask = WRITEMASK_X; - emit1(c, inst->Prev, OPCODE_COS, inst->I.SaturateMode, moddst, - srcregswz(PROGRAM_TEMPORARY, temp, SWIZZLE_WWWW)); + emit2(c, inst->Prev, RC_OPCODE_MUL, 0, dstregtmpmask(temp, RC_MASK_W), + swizzle(inst->I.SrcReg[0], RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X), + srcregswz(RC_FILE_CONSTANT, constant, constant_swizzle)); + emit1(c, inst->Prev, RC_OPCODE_FRC, 0, dstregtmpmask(temp, RC_MASK_W), + srcreg(RC_FILE_TEMPORARY, temp)); + + if (inst->I.Opcode == RC_OPCODE_COS) { + emit1(c, inst->Prev, RC_OPCODE_COS, inst->I.SaturateMode, inst->I.DstReg, + srcregswz(RC_FILE_TEMPORARY, temp, RC_SWIZZLE_WWWW)); + } else if (inst->I.Opcode == RC_OPCODE_SIN) { + emit1(c, inst->Prev, RC_OPCODE_SIN, inst->I.SaturateMode, + inst->I.DstReg, srcregswz(RC_FILE_TEMPORARY, temp, RC_SWIZZLE_WWWW)); + } else if (inst->I.Opcode == RC_OPCODE_SCS) { + struct rc_dst_register moddst = inst->I.DstReg; + + if (inst->I.DstReg.WriteMask & RC_MASK_X) { + moddst.WriteMask = RC_MASK_X; + emit1(c, inst->Prev, RC_OPCODE_COS, inst->I.SaturateMode, moddst, + srcregswz(RC_FILE_TEMPORARY, temp, RC_SWIZZLE_WWWW)); } - if (inst->I.DstReg.WriteMask & WRITEMASK_Y) { - moddst.WriteMask = WRITEMASK_Y; - emit1(c, inst->Prev, OPCODE_SIN, inst->I.SaturateMode, moddst, - srcregswz(PROGRAM_TEMPORARY, temp, SWIZZLE_WWWW)); + if (inst->I.DstReg.WriteMask & RC_MASK_Y) { + moddst.WriteMask = RC_MASK_Y; + emit1(c, inst->Prev, RC_OPCODE_SIN, inst->I.SaturateMode, moddst, + srcregswz(RC_FILE_TEMPORARY, temp, RC_SWIZZLE_WWWW)); } } rc_remove_instruction(inst); - return GL_TRUE; + return 1; } /** @@ -681,15 +670,15 @@ GLboolean radeonTransformTrigScale(struct radeon_compiler* c, * @warning This explicitly changes the form of DDX and DDY! */ -GLboolean radeonTransformDeriv(struct radeon_compiler* c, +int radeonTransformDeriv(struct radeon_compiler* c, struct rc_instruction* inst, void* unused) { - if (inst->I.Opcode != OPCODE_DDX && inst->I.Opcode != OPCODE_DDY) - return GL_FALSE; + if (inst->I.Opcode != RC_OPCODE_DDX && inst->I.Opcode != RC_OPCODE_DDY) + return 0; - inst->I.SrcReg[1].Swizzle = MAKE_SWIZZLE4(SWIZZLE_ONE, SWIZZLE_ONE, SWIZZLE_ONE, SWIZZLE_ONE); - inst->I.SrcReg[1].Negate = NEGATE_XYZW; + inst->I.SrcReg[1].Swizzle = RC_MAKE_SWIZZLE(RC_SWIZZLE_ONE, RC_SWIZZLE_ONE, RC_SWIZZLE_ONE, RC_SWIZZLE_ONE); + inst->I.SrcReg[1].Negate = RC_MASK_XYZW; - return GL_TRUE; + return 1; } diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.h b/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.h index 147efec6fc..7cb5f84b7f 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.h @@ -30,27 +30,27 @@ #include "radeon_program.h" -GLboolean radeonTransformALU( +int radeonTransformALU( struct radeon_compiler * c, struct rc_instruction * inst, void*); -GLboolean r300_transform_vertex_alu( +int r300_transform_vertex_alu( struct radeon_compiler * c, struct rc_instruction * inst, void*); -GLboolean radeonTransformTrigSimple( +int radeonTransformTrigSimple( struct radeon_compiler * c, struct rc_instruction * inst, void*); -GLboolean radeonTransformTrigScale( +int radeonTransformTrigScale( struct radeon_compiler * c, struct rc_instruction * inst, void*); -GLboolean radeonTransformDeriv( +int radeonTransformDeriv( struct radeon_compiler * c, struct rc_instruction * inst, void*); diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.c b/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.c index 4c26db5d24..6cda208600 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.c @@ -35,9 +35,10 @@ #include "radeon_program_pair.h" +#include + #include "memory_pool.h" #include "radeon_compiler.h" -#include "shader/prog_print.h" #define error(fmt, args...) do { \ rc_error(&s->Compiler->Base, "%s::%s(): " fmt "\n", \ @@ -45,19 +46,19 @@ } while(0) struct pair_state_instruction { - struct prog_instruction Instruction; - GLuint IP; /**< Position of this instruction in original program */ + struct rc_sub_instruction Instruction; + unsigned int IP; /**< Position of this instruction in original program */ - GLuint IsTex:1; /**< Is a texture instruction */ - GLuint NeedRGB:1; /**< Needs the RGB ALU */ - GLuint NeedAlpha:1; /**< Needs the Alpha ALU */ - GLuint IsTranscendent:1; /**< Is a special transcendent instruction */ + unsigned int IsTex:1; /**< Is a texture instruction */ + unsigned int NeedRGB:1; /**< Needs the RGB ALU */ + unsigned int NeedAlpha:1; /**< Needs the Alpha ALU */ + unsigned int IsTranscendent:1; /**< Is a special transcendent instruction */ /** * Number of (read and write) dependencies that must be resolved before * this instruction can be scheduled. */ - GLuint NumDependencies:5; + unsigned int NumDependencies:5; /** * Next instruction in the linked list of ready instructions. @@ -81,11 +82,11 @@ struct reg_value_reader { /** * Used to keep track which values are stored in each component of a - * PROGRAM_TEMPORARY. + * RC_FILE_TEMPORARY. */ struct reg_value { struct pair_state_instruction *Writer; - struct reg_value *Next; /**< Pointer to the next value to be written to the same PROGRAM_TEMPORARY component */ + struct reg_value *Next; /**< Pointer to the next value to be written to the same RC_FILE_TEMPORARY component */ /** * Unordered linked list of instructions that read from this value. @@ -98,21 +99,21 @@ struct reg_value { * When this count reaches zero, the instruction that writes the @ref Next value * can be scheduled. */ - GLuint NumReaders; + unsigned int NumReaders; }; /** - * Used to translate a PROGRAM_INPUT or PROGRAM_TEMPORARY Mesa register + * Used to translate a RC_FILE_INPUT or RC_FILE_TEMPORARY Mesa register * to the proper hardware temporary. */ struct pair_register_translation { - GLuint Allocated:1; - GLuint HwIndex:8; - GLuint RefCount:23; /**< # of times this occurs in an unscheduled instruction SrcReg or DstReg */ + unsigned int Allocated:1; + unsigned int HwIndex:8; + unsigned int RefCount:23; /**< # of times this occurs in an unscheduled instruction SrcReg or DstReg */ /** * Notes the value that is currently contained in each component - * (only used for PROGRAM_TEMPORARY registers). + * (only used for RC_FILE_TEMPORARY registers). */ struct reg_value *Value[4]; }; @@ -120,17 +121,17 @@ struct pair_register_translation { struct pair_state { struct r300_fragment_program_compiler * Compiler; const struct radeon_pair_handler *Handler; - GLboolean Verbose; + unsigned int Verbose; void *UserData; /** * Translate Mesa registers to hardware registers */ - struct pair_register_translation Inputs[FRAG_ATTRIB_MAX]; - struct pair_register_translation Temps[MAX_PROGRAM_TEMPS]; + struct pair_register_translation Inputs[RC_REGISTER_MAX_INDEX]; + struct pair_register_translation Temps[RC_REGISTER_MAX_INDEX]; struct { - GLuint RefCount; /**< # of times this occurs in an unscheduled SrcReg or DstReg */ + unsigned int RefCount; /**< # of times this occurs in an unscheduled SrcReg or DstReg */ } HwTemps[128]; /** @@ -144,28 +145,28 @@ struct pair_state { }; -static struct pair_register_translation *get_register(struct pair_state *s, GLuint file, GLuint index) +static struct pair_register_translation *get_register(struct pair_state *s, rc_register_file file, unsigned int index) { switch(file) { - case PROGRAM_TEMPORARY: return &s->Temps[index]; - case PROGRAM_INPUT: return &s->Inputs[index]; + case RC_FILE_TEMPORARY: return &s->Temps[index]; + case RC_FILE_INPUT: return &s->Inputs[index]; default: return 0; } } -static void alloc_hw_reg(struct pair_state *s, GLuint file, GLuint index, GLuint hwindex) +static void alloc_hw_reg(struct pair_state *s, rc_register_file file, unsigned int index, unsigned int hwindex) { struct pair_register_translation *t = get_register(s, file, index); - ASSERT(!s->HwTemps[hwindex].RefCount); - ASSERT(!t->Allocated); + assert(!s->HwTemps[hwindex].RefCount); + assert(!t->Allocated); s->HwTemps[hwindex].RefCount = t->RefCount; t->Allocated = 1; t->HwIndex = hwindex; } -static GLuint get_hw_reg(struct pair_state *s, GLuint file, GLuint index) +static unsigned int get_hw_reg(struct pair_state *s, rc_register_file file, unsigned int index) { - GLuint hwindex; + unsigned int hwindex; struct pair_register_translation *t = get_register(s, file, index); if (!t) { @@ -190,7 +191,7 @@ static GLuint get_hw_reg(struct pair_state *s, GLuint file, GLuint index) } -static void deref_hw_reg(struct pair_state *s, GLuint hwindex) +static void deref_hw_reg(struct pair_state *s, unsigned int hwindex) { if (!s->HwTemps[hwindex].RefCount) { error("Hwindex %i refcount error", hwindex); @@ -213,7 +214,7 @@ static void add_pairinst_to_list(struct pair_state_instruction **list, struct pa static void instruction_ready(struct pair_state *s, struct pair_state_instruction *pairinst) { if (s->Verbose) - _mesa_printf("instruction_ready(%i)\n", pairinst->IP); + fprintf(stderr, "instruction_ready(%i)\n", pairinst->IP); if (pairinst->IsTex) add_pairinst_to_list(&s->ReadyTEX, pairinst); @@ -230,24 +231,24 @@ static void instruction_ready(struct pair_state *s, struct pair_state_instructio * Finally rewrite ADD, MOV, MUL as the appropriate native instruction * and reverse the order of arguments for CMP. */ -static void final_rewrite(struct pair_state *s, struct prog_instruction *inst) +static void final_rewrite(struct pair_state *s, struct rc_sub_instruction *inst) { - struct prog_src_register tmp; + struct rc_src_register tmp; switch(inst->Opcode) { - case OPCODE_ADD: + case RC_OPCODE_ADD: inst->SrcReg[2] = inst->SrcReg[1]; - inst->SrcReg[1].File = PROGRAM_BUILTIN; - inst->SrcReg[1].Swizzle = SWIZZLE_1111; - inst->SrcReg[1].Negate = NEGATE_NONE; - inst->Opcode = OPCODE_MAD; + inst->SrcReg[1].File = RC_FILE_NONE; + inst->SrcReg[1].Swizzle = RC_SWIZZLE_1111; + inst->SrcReg[1].Negate = RC_MASK_NONE; + inst->Opcode = RC_OPCODE_MAD; break; - case OPCODE_CMP: + case RC_OPCODE_CMP: tmp = inst->SrcReg[2]; inst->SrcReg[2] = inst->SrcReg[0]; inst->SrcReg[0] = tmp; break; - case OPCODE_MOV: + case RC_OPCODE_MOV: /* AMD say we should use CMP. * However, when we transform * KIL -r0; @@ -258,16 +259,16 @@ static void final_rewrite(struct pair_state *s, struct prog_instruction *inst) * It appears that the R500 KIL hardware treats -0.0 as less * than zero. */ - inst->SrcReg[1].File = PROGRAM_BUILTIN; - inst->SrcReg[1].Swizzle = SWIZZLE_1111; - inst->SrcReg[2].File = PROGRAM_BUILTIN; - inst->SrcReg[2].Swizzle = SWIZZLE_0000; - inst->Opcode = OPCODE_MAD; + inst->SrcReg[1].File = RC_FILE_NONE; + inst->SrcReg[1].Swizzle = RC_SWIZZLE_1111; + inst->SrcReg[2].File = RC_FILE_NONE; + inst->SrcReg[2].Swizzle = RC_SWIZZLE_0000; + inst->Opcode = RC_OPCODE_MAD; break; - case OPCODE_MUL: - inst->SrcReg[2].File = PROGRAM_BUILTIN; - inst->SrcReg[2].Swizzle = SWIZZLE_0000; - inst->Opcode = OPCODE_MAD; + case RC_OPCODE_MUL: + inst->SrcReg[2].File = RC_FILE_NONE; + inst->SrcReg[2].Swizzle = RC_SWIZZLE_0000; + inst->Opcode = RC_OPCODE_MAD; break; default: /* nothing to do */ @@ -282,41 +283,40 @@ static void final_rewrite(struct pair_state *s, struct prog_instruction *inst) static void classify_instruction(struct pair_state *s, struct pair_state_instruction *psi) { - psi->NeedRGB = (psi->Instruction.DstReg.WriteMask & WRITEMASK_XYZ) ? 1 : 0; - psi->NeedAlpha = (psi->Instruction.DstReg.WriteMask & WRITEMASK_W) ? 1 : 0; + psi->NeedRGB = (psi->Instruction.DstReg.WriteMask & RC_MASK_XYZ) ? 1 : 0; + psi->NeedAlpha = (psi->Instruction.DstReg.WriteMask & RC_MASK_W) ? 1 : 0; switch(psi->Instruction.Opcode) { - case OPCODE_ADD: - case OPCODE_CMP: - case OPCODE_DDX: - case OPCODE_DDY: - case OPCODE_FRC: - case OPCODE_MAD: - case OPCODE_MAX: - case OPCODE_MIN: - case OPCODE_MOV: - case OPCODE_MUL: + case RC_OPCODE_ADD: + case RC_OPCODE_CMP: + case RC_OPCODE_DDX: + case RC_OPCODE_DDY: + case RC_OPCODE_FRC: + case RC_OPCODE_MAD: + case RC_OPCODE_MAX: + case RC_OPCODE_MIN: + case RC_OPCODE_MOV: + case RC_OPCODE_MUL: break; - case OPCODE_COS: - case OPCODE_EX2: - case OPCODE_LG2: - case OPCODE_RCP: - case OPCODE_RSQ: - case OPCODE_SIN: + case RC_OPCODE_COS: + case RC_OPCODE_EX2: + case RC_OPCODE_LG2: + case RC_OPCODE_RCP: + case RC_OPCODE_RSQ: + case RC_OPCODE_SIN: psi->IsTranscendent = 1; psi->NeedAlpha = 1; break; - case OPCODE_DP4: + case RC_OPCODE_DP4: psi->NeedAlpha = 1; /* fall through */ - case OPCODE_DP3: + case RC_OPCODE_DP3: psi->NeedRGB = 1; break; - case OPCODE_KIL: - case OPCODE_TEX: - case OPCODE_TXB: - case OPCODE_TXP: - case OPCODE_END: + case RC_OPCODE_KIL: + case RC_OPCODE_TEX: + case RC_OPCODE_TXB: + case RC_OPCODE_TXP: psi->IsTex = 1; break; default: @@ -333,7 +333,7 @@ static void classify_instruction(struct pair_state *s, static void scan_instructions(struct pair_state *s) { struct rc_instruction *source; - GLuint ip; + unsigned int ip; for(source = s->Compiler->Base.Program.Instructions.Next, ip = 0; source != &s->Compiler->Base.Program.Instructions; @@ -346,9 +346,9 @@ static void scan_instructions(struct pair_state *s) final_rewrite(s, &pairinst->Instruction); classify_instruction(s, pairinst); - int nsrc = _mesa_num_inst_src_regs(pairinst->Instruction.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(pairinst->Instruction.Opcode); int j; - for(j = 0; j < nsrc; j++) { + for(j = 0; j < opcode->NumSrcRegs; j++) { struct pair_register_translation *t = get_register(s, pairinst->Instruction.SrcReg[j].File, pairinst->Instruction.SrcReg[j].Index); if (!t) @@ -356,10 +356,10 @@ static void scan_instructions(struct pair_state *s) t->RefCount++; - if (pairinst->Instruction.SrcReg[j].File == PROGRAM_TEMPORARY) { + if (pairinst->Instruction.SrcReg[j].File == RC_FILE_TEMPORARY) { int i; for(i = 0; i < 4; ++i) { - GLuint swz = GET_SWZ(pairinst->Instruction.SrcReg[j].Swizzle, i); + unsigned int swz = GET_SWZ(pairinst->Instruction.SrcReg[j].Swizzle, i); if (swz >= 4) continue; /* constant or NIL swizzle */ if (!t->Value[swz]) @@ -369,7 +369,7 @@ static void scan_instructions(struct pair_state *s) * also rewrites the value. The code below adds * a dependency for the DstReg, which is a superset * of the SrcReg dependency. */ - if (pairinst->Instruction.DstReg.File == PROGRAM_TEMPORARY && + if (pairinst->Instruction.DstReg.File == RC_FILE_TEMPORARY && pairinst->Instruction.DstReg.Index == pairinst->Instruction.SrcReg[j].Index && GET_BIT(pairinst->Instruction.DstReg.WriteMask, swz)) continue; @@ -384,14 +384,13 @@ static void scan_instructions(struct pair_state *s) } } - int ndst = _mesa_num_inst_dst_regs(pairinst->Instruction.Opcode); - if (ndst) { + if (opcode->HasDstReg) { struct pair_register_translation *t = get_register(s, pairinst->Instruction.DstReg.File, pairinst->Instruction.DstReg.Index); if (t) { t->RefCount++; - if (pairinst->Instruction.DstReg.File == PROGRAM_TEMPORARY) { + if (pairinst->Instruction.DstReg.File == RC_FILE_TEMPORARY) { int j; for(j = 0; j < 4; ++j) { if (!GET_BIT(pairinst->Instruction.DstReg.WriteMask, j)) @@ -412,15 +411,15 @@ static void scan_instructions(struct pair_state *s) } if (s->Verbose) - _mesa_printf("scan(%i): NumDeps = %i\n", ip, pairinst->NumDependencies); + fprintf(stderr, "scan(%i): NumDeps = %i\n", ip, pairinst->NumDependencies); if (!pairinst->NumDependencies) instruction_ready(s, pairinst); } - /* Clear the PROGRAM_TEMPORARY state */ + /* Clear the RC_FILE_TEMPORARY state */ int i, j; - for(i = 0; i < MAX_PROGRAM_TEMPS; ++i) { + for(i = 0; i < RC_REGISTER_MAX_INDEX; ++i) { for(j = 0; j < 4; ++j) s->Temps[i].Value[j] = 0; } @@ -429,7 +428,7 @@ static void scan_instructions(struct pair_state *s) static void decrement_dependencies(struct pair_state *s, struct pair_state_instruction *pairinst) { - ASSERT(pairinst->NumDependencies > 0); + assert(pairinst->NumDependencies > 0); if (!--pairinst->NumDependencies) instruction_ready(s, pairinst); } @@ -440,12 +439,12 @@ static void decrement_dependencies(struct pair_state *s, struct pair_state_instr */ static void commit_instruction(struct pair_state *s, struct pair_state_instruction *pairinst) { - struct prog_instruction *inst = &pairinst->Instruction; + struct rc_sub_instruction *inst = &pairinst->Instruction; if (s->Verbose) - _mesa_printf("commit_instruction(%i)\n", pairinst->IP); + fprintf(stderr, "commit_instruction(%i)\n", pairinst->IP); - if (inst->DstReg.File == PROGRAM_TEMPORARY) { + if (inst->DstReg.File == RC_FILE_TEMPORARY) { struct pair_register_translation *t = &s->Temps[inst->DstReg.Index]; deref_hw_reg(s, t->HwIndex); @@ -467,21 +466,21 @@ static void commit_instruction(struct pair_state *s, struct pair_state_instructi } } - int nsrc = _mesa_num_inst_src_regs(inst->Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->Opcode); int i; - for(i = 0; i < nsrc; i++) { + for(i = 0; i < opcode->NumSrcRegs; i++) { struct pair_register_translation *t = get_register(s, inst->SrcReg[i].File, inst->SrcReg[i].Index); if (!t) continue; deref_hw_reg(s, get_hw_reg(s, inst->SrcReg[i].File, inst->SrcReg[i].Index)); - if (inst->SrcReg[i].File != PROGRAM_TEMPORARY) + if (inst->SrcReg[i].File != RC_FILE_TEMPORARY) continue; int j; for(j = 0; j < 4; ++j) { - GLuint swz = GET_SWZ(inst->SrcReg[i].Swizzle, j); + unsigned int swz = GET_SWZ(inst->SrcReg[i].Swizzle, j); if (swz >= 4) continue; if (!t->Value[swz]) @@ -489,7 +488,7 @@ static void commit_instruction(struct pair_state *s, struct pair_state_instructi /* Do not free a dependency if this instruction * also rewrites the value. See scan_instructions. */ - if (inst->DstReg.File == PROGRAM_TEMPORARY && + if (inst->DstReg.File == RC_FILE_TEMPORARY && inst->DstReg.Index == inst->SrcReg[i].Index && GET_BIT(inst->DstReg.WriteMask, swz)) continue; @@ -519,7 +518,7 @@ static void emit_all_tex(struct pair_state *s) struct pair_state_instruction *readytex; struct pair_state_instruction *pairinst; - ASSERT(s->ReadyTEX); + assert(s->ReadyTEX); // Don't let the ready list change under us! readytex = s->ReadyTEX; @@ -527,39 +526,37 @@ static void emit_all_tex(struct pair_state *s) // Allocate destination hardware registers in one block to avoid conflicts. for(pairinst = readytex; pairinst; pairinst = pairinst->NextReady) { - struct prog_instruction *inst = &pairinst->Instruction; - if (inst->Opcode != OPCODE_KIL) + struct rc_sub_instruction *inst = &pairinst->Instruction; + if (inst->Opcode != RC_OPCODE_KIL) get_hw_reg(s, inst->DstReg.File, inst->DstReg.Index); } if (s->Compiler->Base.Debug) - _mesa_printf(" BEGIN_TEX\n"); + fprintf(stderr, " BEGIN_TEX\n"); if (s->Handler->BeginTexBlock) s->Compiler->Base.Error = s->Compiler->Base.Error || !s->Handler->BeginTexBlock(s->UserData); for(pairinst = readytex; pairinst; pairinst = pairinst->NextReady) { - struct prog_instruction *inst = &pairinst->Instruction; + struct rc_sub_instruction *inst = &pairinst->Instruction; commit_instruction(s, pairinst); - if (inst->Opcode != OPCODE_KIL) + if (inst->Opcode != RC_OPCODE_KIL) inst->DstReg.Index = get_hw_reg(s, inst->DstReg.File, inst->DstReg.Index); inst->SrcReg[0].Index = get_hw_reg(s, inst->SrcReg[0].File, inst->SrcReg[0].Index); if (s->Compiler->Base.Debug) { - _mesa_printf(" "); - _mesa_print_instruction(inst); - fflush(stderr); + /* Should print the TEX instruction here */ } struct radeon_pair_texture_instruction rpti; switch(inst->Opcode) { - case OPCODE_TEX: rpti.Opcode = RADEON_OPCODE_TEX; break; - case OPCODE_TXB: rpti.Opcode = RADEON_OPCODE_TXB; break; - case OPCODE_TXP: rpti.Opcode = RADEON_OPCODE_TXP; break; + case RC_OPCODE_TEX: rpti.Opcode = RADEON_OPCODE_TEX; break; + case RC_OPCODE_TXB: rpti.Opcode = RADEON_OPCODE_TXB; break; + case RC_OPCODE_TXP: rpti.Opcode = RADEON_OPCODE_TXP; break; default: - case OPCODE_KIL: rpti.Opcode = RADEON_OPCODE_KIL; break; + case RC_OPCODE_KIL: rpti.Opcode = RADEON_OPCODE_KIL; break; } rpti.DestIndex = inst->DstReg.Index; @@ -573,12 +570,12 @@ static void emit_all_tex(struct pair_state *s) } if (s->Compiler->Base.Debug) - _mesa_printf(" END_TEX\n"); + fprintf(stderr, " END_TEX\n"); } static int alloc_pair_source(struct pair_state *s, struct radeon_pair_instruction *pair, - struct prog_src_register src, GLboolean rgb, GLboolean alpha) + struct rc_src_register src, unsigned int rgb, unsigned int alpha) { int candidate = -1; int candidate_quality = -1; @@ -587,10 +584,10 @@ static int alloc_pair_source(struct pair_state *s, struct radeon_pair_instructio if (!rgb && !alpha) return 0; - GLuint constant; - GLuint index; + unsigned int constant; + unsigned int index; - if (src.File == PROGRAM_TEMPORARY || src.File == PROGRAM_INPUT) { + if (src.File == RC_FILE_TEMPORARY || src.File == RC_FILE_INPUT) { constant = 0; index = get_hw_reg(s, src.File, src.Index); } else { @@ -642,37 +639,38 @@ static int alloc_pair_source(struct pair_state *s, struct radeon_pair_instructio * Fill the given ALU instruction's opcodes and source operands into the given pair, * if possible. */ -static GLboolean fill_instruction_into_pair( +static int fill_instruction_into_pair( struct pair_state *s, struct radeon_pair_instruction *pair, struct pair_state_instruction *pairinst) { - struct prog_instruction *inst = &pairinst->Instruction; + struct rc_sub_instruction *inst = &pairinst->Instruction; - ASSERT(!pairinst->NeedRGB || pair->RGB.Opcode == OPCODE_NOP); - ASSERT(!pairinst->NeedAlpha || pair->Alpha.Opcode == OPCODE_NOP); + assert(!pairinst->NeedRGB || pair->RGB.Opcode == RC_OPCODE_NOP); + assert(!pairinst->NeedAlpha || pair->Alpha.Opcode == RC_OPCODE_NOP); if (pairinst->NeedRGB) { if (pairinst->IsTranscendent) - pair->RGB.Opcode = OPCODE_REPL_ALPHA; + pair->RGB.Opcode = RC_OPCODE_REPL_ALPHA; else pair->RGB.Opcode = inst->Opcode; - if (inst->SaturateMode == SATURATE_ZERO_ONE) + if (inst->SaturateMode == RC_SATURATE_ZERO_ONE) pair->RGB.Saturate = 1; } if (pairinst->NeedAlpha) { pair->Alpha.Opcode = inst->Opcode; - if (inst->SaturateMode == SATURATE_ZERO_ONE) + if (inst->SaturateMode == RC_SATURATE_ZERO_ONE) pair->Alpha.Saturate = 1; } - int nargs = _mesa_num_inst_src_regs(inst->Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->Opcode); + int nargs = opcode->NumSrcRegs; int i; /* Special case for DDX/DDY (MDH/MDV). */ - if (inst->Opcode == OPCODE_DDX || inst->Opcode == OPCODE_DDY) { + if (inst->Opcode == RC_OPCODE_DDX || inst->Opcode == RC_OPCODE_DDY) { if (pair->RGB.Src[0].Used || pair->Alpha.Src[0].Used) - return GL_FALSE; + return 0; else nargs++; } @@ -680,43 +678,43 @@ static GLboolean fill_instruction_into_pair( for(i = 0; i < nargs; ++i) { int source; if (pairinst->NeedRGB && !pairinst->IsTranscendent) { - GLboolean srcrgb = GL_FALSE; - GLboolean srcalpha = GL_FALSE; + unsigned int srcrgb = 0; + unsigned int srcalpha = 0; int j; for(j = 0; j < 3; ++j) { - GLuint swz = GET_SWZ(inst->SrcReg[i].Swizzle, j); + unsigned int swz = GET_SWZ(inst->SrcReg[i].Swizzle, j); if (swz < 3) - srcrgb = GL_TRUE; + srcrgb = 1; else if (swz < 4) - srcalpha = GL_TRUE; + srcalpha = 1; } source = alloc_pair_source(s, pair, inst->SrcReg[i], srcrgb, srcalpha); if (source < 0) - return GL_FALSE; + return 0; pair->RGB.Arg[i].Source = source; pair->RGB.Arg[i].Swizzle = inst->SrcReg[i].Swizzle & 0x1ff; pair->RGB.Arg[i].Abs = inst->SrcReg[i].Abs; - pair->RGB.Arg[i].Negate = !!(inst->SrcReg[i].Negate & (NEGATE_X | NEGATE_Y | NEGATE_Z)); + pair->RGB.Arg[i].Negate = !!(inst->SrcReg[i].Negate & (RC_MASK_X | RC_MASK_Y | RC_MASK_Z)); } if (pairinst->NeedAlpha) { - GLboolean srcrgb = GL_FALSE; - GLboolean srcalpha = GL_FALSE; - GLuint swz = GET_SWZ(inst->SrcReg[i].Swizzle, pairinst->IsTranscendent ? 0 : 3); + unsigned int srcrgb = 0; + unsigned int srcalpha = 0; + unsigned int swz = GET_SWZ(inst->SrcReg[i].Swizzle, pairinst->IsTranscendent ? 0 : 3); if (swz < 3) - srcrgb = GL_TRUE; + srcrgb = 1; else if (swz < 4) - srcalpha = GL_TRUE; + srcalpha = 1; source = alloc_pair_source(s, pair, inst->SrcReg[i], srcrgb, srcalpha); if (source < 0) - return GL_FALSE; + return 0; pair->Alpha.Arg[i].Source = source; pair->Alpha.Arg[i].Swizzle = swz; pair->Alpha.Arg[i].Abs = inst->SrcReg[i].Abs; - pair->Alpha.Arg[i].Negate = !!(inst->SrcReg[i].Negate & NEGATE_W); + pair->Alpha.Arg[i].Negate = !!(inst->SrcReg[i].Negate & RC_MASK_W); } } - return GL_TRUE; + return 1; } @@ -733,20 +731,20 @@ static void fill_dest_into_pair( struct radeon_pair_instruction *pair, struct pair_state_instruction *pairinst) { - struct prog_instruction *inst = &pairinst->Instruction; + struct rc_sub_instruction *inst = &pairinst->Instruction; - if (inst->DstReg.File == PROGRAM_OUTPUT) { + if (inst->DstReg.File == RC_FILE_OUTPUT) { if (inst->DstReg.Index == s->Compiler->OutputColor) { - pair->RGB.OutputWriteMask |= inst->DstReg.WriteMask & WRITEMASK_XYZ; + pair->RGB.OutputWriteMask |= inst->DstReg.WriteMask & RC_MASK_XYZ; pair->Alpha.OutputWriteMask |= GET_BIT(inst->DstReg.WriteMask, 3); } else if (inst->DstReg.Index == s->Compiler->OutputDepth) { pair->Alpha.DepthWriteMask |= GET_BIT(inst->DstReg.WriteMask, 3); } } else { - GLuint hwindex = get_hw_reg(s, inst->DstReg.File, inst->DstReg.Index); + unsigned int hwindex = get_hw_reg(s, inst->DstReg.File, inst->DstReg.Index); if (pairinst->NeedRGB) { pair->RGB.DestIndex = hwindex; - pair->RGB.WriteMask |= inst->DstReg.WriteMask & WRITEMASK_XYZ; + pair->RGB.WriteMask |= inst->DstReg.WriteMask & RC_MASK_XYZ; } if (pairinst->NeedAlpha) { pair->Alpha.DestIndex = hwindex; @@ -780,7 +778,7 @@ static void emit_alu(struct pair_state *s) s->ReadyAlpha = s->ReadyAlpha->NextReady; } - _mesa_bzero(&pair, sizeof(pair)); + memset(&pair, 0, sizeof(pair)); fill_instruction_into_pair(s, &pair, psi); fill_dest_into_pair(s, &pair, psi); commit_instruction(s, psi); @@ -794,7 +792,7 @@ static void emit_alu(struct pair_state *s) for(palpha = &s->ReadyAlpha; *palpha; palpha = &(*palpha)->NextReady) { struct pair_state_instruction * psirgb = *prgb; struct pair_state_instruction * psialpha = *palpha; - _mesa_bzero(&pair, sizeof(pair)); + memset(&pair, 0, sizeof(pair)); fill_instruction_into_pair(s, &pair, psirgb); if (!fill_instruction_into_pair(s, &pair, psialpha)) continue; @@ -812,7 +810,7 @@ static void emit_alu(struct pair_state *s) psi = s->ReadyRGB; s->ReadyRGB = s->ReadyRGB->NextReady; - _mesa_bzero(&pair, sizeof(pair)); + memset(&pair, 0, sizeof(pair)); fill_instruction_into_pair(s, &pair, psi); fill_dest_into_pair(s, &pair, psi); commit_instruction(s, psi); @@ -829,7 +827,7 @@ static void emit_alu(struct pair_state *s) static void alloc_helper(void * data, unsigned input, unsigned hwreg) { struct pair_state * s = data; - alloc_hw_reg(s, PROGRAM_INPUT, input, hwreg); + alloc_hw_reg(s, RC_FILE_INPUT, input, hwreg); } void radeonPairProgram( @@ -838,14 +836,14 @@ void radeonPairProgram( { struct pair_state s; - _mesa_bzero(&s, sizeof(s)); + memset(&s, 0, sizeof(s)); s.Compiler = compiler; s.Handler = handler; s.UserData = userdata; - s.Verbose = GL_FALSE && s.Compiler->Base.Debug; + s.Verbose = 0 && s.Compiler->Base.Debug; if (s.Compiler->Base.Debug) - _mesa_printf("Emit paired program\n"); + fprintf(stderr, "Emit paired program\n"); scan_instructions(&s); s.Compiler->AllocateHwInputs(s.Compiler, &alloc_helper, &s); @@ -860,41 +858,36 @@ void radeonPairProgram( } if (s.Compiler->Base.Debug) - _mesa_printf(" END\n"); + fprintf(stderr, " END\n"); } static void print_pair_src(int i, struct radeon_pair_instruction_source* src) { - _mesa_printf(" Src%i = %s[%i]", i, src->Constant ? "CNST" : "TEMP", src->Index); + fprintf(stderr, " Src%i = %s[%i]", i, src->Constant ? "CNST" : "TEMP", src->Index); } -static const char* opcode_string(GLuint opcode) +static const char* opcode_string(rc_opcode opcode) { - if (opcode == OPCODE_REPL_ALPHA) - return "SOP"; - else - return _mesa_opcode_string(opcode); + return rc_get_opcode_info(opcode)->Name; } -static int num_pairinst_args(GLuint opcode) +static int num_pairinst_args(rc_opcode opcode) { - if (opcode == OPCODE_REPL_ALPHA) - return 0; - else - return _mesa_num_inst_src_regs(opcode); + return rc_get_opcode_info(opcode)->NumSrcRegs; } -static char swizzle_char(GLuint swz) +static char swizzle_char(rc_swizzle swz) { switch(swz) { - case SWIZZLE_X: return 'x'; - case SWIZZLE_Y: return 'y'; - case SWIZZLE_Z: return 'z'; - case SWIZZLE_W: return 'w'; - case SWIZZLE_ZERO: return '0'; - case SWIZZLE_ONE: return '1'; - case SWIZZLE_NIL: return '_'; + case RC_SWIZZLE_X: return 'x'; + case RC_SWIZZLE_Y: return 'y'; + case RC_SWIZZLE_Z: return 'z'; + case RC_SWIZZLE_W: return 'w'; + case RC_SWIZZLE_ZERO: return '0'; + case RC_SWIZZLE_ONE: return '1'; + case RC_SWIZZLE_HALF: return 'H'; + case RC_SWIZZLE_UNUSED: return '_'; default: return '?'; } } @@ -904,27 +897,27 @@ void radeonPrintPairInstruction(struct radeon_pair_instruction *inst) int nargs; int i; - _mesa_printf(" RGB: "); + fprintf(stderr, " RGB: "); for(i = 0; i < 3; ++i) { if (inst->RGB.Src[i].Used) print_pair_src(i, inst->RGB.Src + i); } - _mesa_printf("\n"); - _mesa_printf(" Alpha:"); + fprintf(stderr, "\n"); + fprintf(stderr, " Alpha:"); for(i = 0; i < 3; ++i) { if (inst->Alpha.Src[i].Used) print_pair_src(i, inst->Alpha.Src + i); } - _mesa_printf("\n"); + fprintf(stderr, "\n"); - _mesa_printf(" %s%s", opcode_string(inst->RGB.Opcode), inst->RGB.Saturate ? "_SAT" : ""); + fprintf(stderr, " %s%s", opcode_string(inst->RGB.Opcode), inst->RGB.Saturate ? "_SAT" : ""); if (inst->RGB.WriteMask) - _mesa_printf(" TEMP[%i].%s%s%s", inst->RGB.DestIndex, + fprintf(stderr, " TEMP[%i].%s%s%s", inst->RGB.DestIndex, (inst->RGB.WriteMask & 1) ? "x" : "", (inst->RGB.WriteMask & 2) ? "y" : "", (inst->RGB.WriteMask & 4) ? "z" : ""); if (inst->RGB.OutputWriteMask) - _mesa_printf(" COLOR.%s%s%s", + fprintf(stderr, " COLOR.%s%s%s", (inst->RGB.OutputWriteMask & 1) ? "x" : "", (inst->RGB.OutputWriteMask & 2) ? "y" : "", (inst->RGB.OutputWriteMask & 4) ? "z" : ""); @@ -932,27 +925,27 @@ void radeonPrintPairInstruction(struct radeon_pair_instruction *inst) for(i = 0; i < nargs; ++i) { const char* abs = inst->RGB.Arg[i].Abs ? "|" : ""; const char* neg = inst->RGB.Arg[i].Negate ? "-" : ""; - _mesa_printf(", %s%sSrc%i.%c%c%c%s", neg, abs, inst->RGB.Arg[i].Source, + fprintf(stderr, ", %s%sSrc%i.%c%c%c%s", neg, abs, inst->RGB.Arg[i].Source, swizzle_char(GET_SWZ(inst->RGB.Arg[i].Swizzle, 0)), swizzle_char(GET_SWZ(inst->RGB.Arg[i].Swizzle, 1)), swizzle_char(GET_SWZ(inst->RGB.Arg[i].Swizzle, 2)), abs); } - _mesa_printf("\n"); + fprintf(stderr, "\n"); - _mesa_printf(" %s%s", opcode_string(inst->Alpha.Opcode), inst->Alpha.Saturate ? "_SAT" : ""); + fprintf(stderr, " %s%s", opcode_string(inst->Alpha.Opcode), inst->Alpha.Saturate ? "_SAT" : ""); if (inst->Alpha.WriteMask) - _mesa_printf(" TEMP[%i].w", inst->Alpha.DestIndex); + fprintf(stderr, " TEMP[%i].w", inst->Alpha.DestIndex); if (inst->Alpha.OutputWriteMask) - _mesa_printf(" COLOR.w"); + fprintf(stderr, " COLOR.w"); if (inst->Alpha.DepthWriteMask) - _mesa_printf(" DEPTH.w"); + fprintf(stderr, " DEPTH.w"); nargs = num_pairinst_args(inst->Alpha.Opcode); for(i = 0; i < nargs; ++i) { const char* abs = inst->Alpha.Arg[i].Abs ? "|" : ""; const char* neg = inst->Alpha.Arg[i].Negate ? "-" : ""; - _mesa_printf(", %s%sSrc%i.%c%s", neg, abs, inst->Alpha.Arg[i].Source, + fprintf(stderr, ", %s%sSrc%i.%c%s", neg, abs, inst->Alpha.Arg[i].Source, swizzle_char(inst->Alpha.Arg[i].Swizzle), abs); } - _mesa_printf("\n"); + fprintf(stderr, "\n"); } diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.h b/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.h index ff76178551..da2bcc5d89 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.h @@ -38,43 +38,43 @@ struct r300_fragment_program_compiler; * fragment programs. */ struct radeon_pair_instruction_source { - GLuint Index:8; - GLuint Constant:1; - GLuint Used:1; + unsigned int Index:8; + unsigned int Constant:1; + unsigned int Used:1; }; struct radeon_pair_instruction_rgb { - GLuint Opcode:8; - GLuint DestIndex:8; - GLuint WriteMask:3; - GLuint OutputWriteMask:3; - GLuint Saturate:1; + unsigned int Opcode:8; + unsigned int DestIndex:8; + unsigned int WriteMask:3; + unsigned int OutputWriteMask:3; + unsigned int Saturate:1; struct radeon_pair_instruction_source Src[3]; struct { - GLuint Source:2; - GLuint Swizzle:9; - GLuint Abs:1; - GLuint Negate:1; + unsigned int Source:2; + unsigned int Swizzle:9; + unsigned int Abs:1; + unsigned int Negate:1; } Arg[3]; }; struct radeon_pair_instruction_alpha { - GLuint Opcode:8; - GLuint DestIndex:8; - GLuint WriteMask:1; - GLuint OutputWriteMask:1; - GLuint DepthWriteMask:1; - GLuint Saturate:1; + unsigned int Opcode:8; + unsigned int DestIndex:8; + unsigned int WriteMask:1; + unsigned int OutputWriteMask:1; + unsigned int DepthWriteMask:1; + unsigned int Saturate:1; struct radeon_pair_instruction_source Src[3]; struct { - GLuint Source:2; - GLuint Swizzle:3; - GLuint Abs:1; - GLuint Negate:1; + unsigned int Source:2; + unsigned int Swizzle:3; + unsigned int Abs:1; + unsigned int Negate:1; } Arg[3]; }; @@ -92,16 +92,16 @@ enum { }; struct radeon_pair_texture_instruction { - GLuint Opcode:2; /**< one of RADEON_OPCODE_xxx */ + unsigned int Opcode:2; /**< one of RADEON_OPCODE_xxx */ - GLuint DestIndex:8; - GLuint WriteMask:4; + unsigned int DestIndex:8; + unsigned int WriteMask:4; - GLuint TexSrcUnit:5; - GLuint TexSrcTarget:3; + unsigned int TexSrcUnit:5; + unsigned int TexSrcTarget:3; - GLuint SrcIndex:8; - GLuint SrcSwizzle:12; + unsigned int SrcIndex:8; + unsigned int SrcSwizzle:12; }; @@ -112,24 +112,24 @@ struct radeon_pair_handler { /** * Write a paired instruction to the hardware. * - * @return GL_FALSE on error. + * @return 0 on error. */ - GLboolean (*EmitPaired)(void*, struct radeon_pair_instruction*); + int (*EmitPaired)(void*, struct radeon_pair_instruction*); /** * Write a texture instruction to the hardware. * Register indices have already been rewritten to the allocated * hardware register numbers. * - * @return GL_FALSE on error. + * @return 0 on error. */ - GLboolean (*EmitTex)(void*, struct radeon_pair_texture_instruction*); + int (*EmitTex)(void*, struct radeon_pair_texture_instruction*); /** * Called before a block of contiguous, independent texture * instructions is emitted. */ - GLboolean (*BeginTexBlock)(void*); + int (*BeginTexBlock)(void*); unsigned MaxHwTemps; }; diff --git a/src/mesa/drivers/dri/r300/r300_fragprog_common.c b/src/mesa/drivers/dri/r300/r300_fragprog_common.c index ea6ff03e61..588b9c0825 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog_common.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog_common.c @@ -125,7 +125,7 @@ static void insert_WPOS_trailer(struct r300_fragment_program_compiler *compiler, */ static void rewriteFog(struct r300_fragment_program_compiler *compiler, struct r300_fragment_program * fp) { - struct prog_src_register src; + struct rc_src_register src; int i; if (!(compiler->Base.Program.InputsRead & FRAG_BIT_FOGC)) { @@ -142,7 +142,7 @@ static void rewriteFog(struct r300_fragment_program_compiler *compiler, struct r } memset(&src, 0, sizeof(src)); - src.File = PROGRAM_INPUT; + src.File = RC_FILE_INPUT; src.Index = fp->fog_attr; src.Swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_ZERO, SWIZZLE_ZERO, SWIZZLE_ONE); rc_move_input(&compiler->Base, FRAG_ATTRIB_FOGC, src); diff --git a/src/mesa/drivers/dri/r300/radeon_mesa_to_rc.c b/src/mesa/drivers/dri/r300/radeon_mesa_to_rc.c index 13b9d3541f..1e8fc3de4e 100644 --- a/src/mesa/drivers/dri/r300/radeon_mesa_to_rc.c +++ b/src/mesa/drivers/dri/r300/radeon_mesa_to_rc.c @@ -28,12 +28,153 @@ #include "radeon_mesa_to_rc.h" #include "main/mtypes.h" +#include "shader/prog_instruction.h" #include "shader/prog_parameter.h" #include "compiler/radeon_compiler.h" #include "compiler/radeon_program.h" +static rc_opcode translate_opcode(gl_inst_opcode opcode) +{ + switch(opcode) { + case OPCODE_NOP: return RC_OPCODE_NOP; + case OPCODE_ABS: return RC_OPCODE_ABS; + case OPCODE_ADD: return RC_OPCODE_ADD; + case OPCODE_ARL: return RC_OPCODE_ARL; + case OPCODE_CMP: return RC_OPCODE_CMP; + case OPCODE_COS: return RC_OPCODE_COS; + case OPCODE_DDX: return RC_OPCODE_DDX; + case OPCODE_DDY: return RC_OPCODE_DDY; + case OPCODE_DP3: return RC_OPCODE_DP3; + case OPCODE_DP4: return RC_OPCODE_DP4; + case OPCODE_DPH: return RC_OPCODE_DPH; + case OPCODE_DST: return RC_OPCODE_DST; + case OPCODE_EX2: return RC_OPCODE_EX2; + case OPCODE_EXP: return RC_OPCODE_EXP; + case OPCODE_FLR: return RC_OPCODE_FLR; + case OPCODE_FRC: return RC_OPCODE_FRC; + case OPCODE_KIL: return RC_OPCODE_KIL; + case OPCODE_LG2: return RC_OPCODE_LG2; + case OPCODE_LIT: return RC_OPCODE_LIT; + case OPCODE_LOG: return RC_OPCODE_LOG; + case OPCODE_LRP: return RC_OPCODE_LRP; + case OPCODE_MAD: return RC_OPCODE_MAD; + case OPCODE_MAX: return RC_OPCODE_MAX; + case OPCODE_MIN: return RC_OPCODE_MIN; + case OPCODE_MOV: return RC_OPCODE_MOV; + case OPCODE_MUL: return RC_OPCODE_MUL; + case OPCODE_POW: return RC_OPCODE_POW; + case OPCODE_RCP: return RC_OPCODE_RCP; + case OPCODE_RSQ: return RC_OPCODE_RSQ; + case OPCODE_SCS: return RC_OPCODE_SCS; + case OPCODE_SEQ: return RC_OPCODE_SEQ; + case OPCODE_SFL: return RC_OPCODE_SFL; + case OPCODE_SGE: return RC_OPCODE_SGE; + case OPCODE_SGT: return RC_OPCODE_SGT; + case OPCODE_SIN: return RC_OPCODE_SIN; + case OPCODE_SLE: return RC_OPCODE_SLE; + case OPCODE_SLT: return RC_OPCODE_SLT; + case OPCODE_SNE: return RC_OPCODE_SNE; + case OPCODE_SUB: return RC_OPCODE_SUB; + case OPCODE_SWZ: return RC_OPCODE_SWZ; + case OPCODE_TEX: return RC_OPCODE_TEX; + case OPCODE_TXB: return RC_OPCODE_TXB; + case OPCODE_TXD: return RC_OPCODE_TXD; + case OPCODE_TXL: return RC_OPCODE_TXL; + case OPCODE_TXP: return RC_OPCODE_TXP; + case OPCODE_XPD: return RC_OPCODE_XPD; + default: return RC_OPCODE_ILLEGAL_OPCODE; + } +} + +static rc_saturate_mode translate_saturate(unsigned int saturate) +{ + switch(saturate) { + default: + case SATURATE_OFF: return RC_SATURATE_NONE; + case SATURATE_ZERO_ONE: return RC_SATURATE_ZERO_ONE; + case SATURATE_PLUS_MINUS_ONE: return RC_SATURATE_MINUS_PLUS_ONE; + } +} + +static rc_register_file translate_register_file(unsigned int file) +{ + switch(file) { + case PROGRAM_TEMPORARY: return RC_FILE_TEMPORARY; + case PROGRAM_INPUT: return RC_FILE_INPUT; + case PROGRAM_OUTPUT: return RC_FILE_OUTPUT; + case PROGRAM_LOCAL_PARAM: + case PROGRAM_ENV_PARAM: + case PROGRAM_STATE_VAR: + case PROGRAM_NAMED_PARAM: + case PROGRAM_CONSTANT: + case PROGRAM_UNIFORM: return RC_FILE_CONSTANT; + case PROGRAM_ADDRESS: return RC_FILE_ADDRESS; + default: return RC_FILE_NONE; + } +} + +static void translate_srcreg(struct rc_src_register * dest, struct prog_src_register * src) +{ + dest->File = translate_register_file(src->File); + dest->Index = src->Index; + dest->RelAddr = src->RelAddr; + dest->Swizzle = src->Swizzle; + dest->Abs = src->Abs; + dest->Negate = src->Negate; +} + +static void translate_dstreg(struct rc_dst_register * dest, struct prog_dst_register * src) +{ + dest->File = translate_register_file(src->File); + dest->Index = src->Index; + dest->RelAddr = src->RelAddr; + dest->WriteMask = src->WriteMask; +} + +static rc_texture_target translate_tex_target(gl_texture_index target) +{ + switch(target) { + case TEXTURE_2D_ARRAY_INDEX: return RC_TEXTURE_2D_ARRAY; + case TEXTURE_1D_ARRAY_INDEX: return RC_TEXTURE_1D_ARRAY; + case TEXTURE_CUBE_INDEX: return RC_TEXTURE_CUBE; + case TEXTURE_3D_INDEX: return RC_TEXTURE_3D; + case TEXTURE_RECT_INDEX: return RC_TEXTURE_RECT; + default: + case TEXTURE_2D_INDEX: return RC_TEXTURE_2D; + case TEXTURE_1D_INDEX: return RC_TEXTURE_1D; + } +} + +static void translate_instruction(struct radeon_compiler * c, + struct rc_instruction * dest, struct prog_instruction * src) +{ + const struct rc_opcode_info * opcode; + unsigned int i; + + dest->I.Opcode = translate_opcode(src->Opcode); + if (dest->I.Opcode == RC_OPCODE_ILLEGAL_OPCODE) { + rc_error(c, "Unsupported opcode %i\n", src->Opcode); + return; + } + dest->I.SaturateMode = translate_saturate(src->SaturateMode); + + opcode = rc_get_opcode_info(dest->I.Opcode); + + for(i = 0; i < opcode->NumSrcRegs; ++i) + translate_srcreg(&dest->I.SrcReg[i], &src->SrcReg[i]); + + if (opcode->HasDstReg) + translate_dstreg(&dest->I.DstReg, &src->DstReg); + + if (opcode->HasTexture) { + dest->I.TexSrcUnit = src->TexSrcUnit; + dest->I.TexSrcTarget = translate_tex_target(src->TexSrcTarget); + dest->I.TexShadow = src->TexShadow; + } +} + void radeon_mesa_to_rc_program(struct radeon_compiler * c, struct gl_program * program) { struct prog_instruction *source; @@ -41,7 +182,7 @@ void radeon_mesa_to_rc_program(struct radeon_compiler * c, struct gl_program * p for(source = program->Instructions; source->Opcode != OPCODE_END; ++source) { struct rc_instruction * dest = rc_insert_new_instruction(c, c->Program.Instructions.Prev); - dest->I = *source; + translate_instruction(c, dest, source); } c->Program.ShadowSamplers = program->ShadowSamplers; -- cgit v1.2.3 From efff7aa980e78dc3ee1782308f0c9f3861c9992a Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 31 Aug 2009 16:43:39 -0700 Subject: NV fp: Add tracking for NV_fragment_program_option --- src/mesa/main/extensions.c | 1 + src/mesa/main/mtypes.h | 1 + 2 files changed, 2 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 195fdde346..903da99ed0 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -162,6 +162,7 @@ static const struct { { ON, "GL_MESA_window_pos", F(ARB_window_pos) }, { OFF, "GL_NV_blend_square", F(NV_blend_square) }, { OFF, "GL_NV_fragment_program", F(NV_fragment_program) }, + { OFF, "GL_NV_fragment_program_option", F(NV_fragment_program_option) }, { ON, "GL_NV_light_max_exponent", F(NV_light_max_exponent) }, { OFF, "GL_NV_point_sprite", F(NV_point_sprite) }, { OFF, "GL_NV_texture_env_combine4", F(NV_texture_env_combine4) }, diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 53dc6360ea..a99a25597f 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2553,6 +2553,7 @@ struct gl_extensions GLboolean MESA_texture_signed_rgba; GLboolean NV_blend_square; GLboolean NV_fragment_program; + GLboolean NV_fragment_program_option; GLboolean NV_light_max_exponent; GLboolean NV_point_sprite; GLboolean NV_texgen_reflection; -- cgit v1.2.3 From dc8ec05ace3d2a0284dbe47ec2d88168b1efb517 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 31 Aug 2009 16:57:49 -0700 Subject: NV fp: Parse 'OPTION NV_fragment_program' in ARB assembly shaders --- src/mesa/shader/program_parse_extra.c | 11 +++++++++++ src/mesa/shader/program_parser.h | 1 + 2 files changed, 12 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/shader/program_parse_extra.c b/src/mesa/shader/program_parse_extra.c index 8e4be606f1..79e80c54d7 100644 --- a/src/mesa/shader/program_parse_extra.c +++ b/src/mesa/shader/program_parse_extra.c @@ -102,6 +102,17 @@ _mesa_ARBfp_parse_option(struct asm_parser_state *state, const char *option) return 1; } } + } else if (strncmp(option, "NV_fragment_program", 19) == 0) { + option += 19; + + /* Other NV_fragment_program strings may be supported later. + */ + if (option[0] == '\0') { + if (state->ctx->Extensions.NV_fragment_program_option) { + state->option.NV_fragment = 1; + return 1; + } + } } else if (strncmp(option, "MESA_", 5) == 0) { option += 5; diff --git a/src/mesa/shader/program_parser.h b/src/mesa/shader/program_parser.h index fa47d84565..be32a1bed1 100644 --- a/src/mesa/shader/program_parser.h +++ b/src/mesa/shader/program_parser.h @@ -202,6 +202,7 @@ struct asm_parser_state { unsigned Shadow:1; unsigned TexRect:1; unsigned TexArray:1; + unsigned NV_fragment:1; } option; struct { -- cgit v1.2.3 From ede0cd4d8c8eb8c6c443c84905138091944d69af Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 31 Aug 2009 17:00:31 -0700 Subject: NV fp lexer: Add new opcodes --- src/mesa/shader/lex.yy.c | 1766 ++++++++++++++++++++--------------- src/mesa/shader/program_lexer.l | 36 + src/mesa/shader/program_parse.tab.c | 671 ++++++------- src/mesa/shader/program_parse.tab.h | 171 ++-- src/mesa/shader/program_parse.y | 2 +- 5 files changed, 1455 insertions(+), 1191 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/lex.yy.c b/src/mesa/shader/lex.yy.c index 6d661bd187..5bde12a6b7 100644 --- a/src/mesa/shader/lex.yy.c +++ b/src/mesa/shader/lex.yy.c @@ -357,8 +357,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 183 -#define YY_END_OF_BUFFER 184 +#define YY_NUM_RULES 217 +#define YY_END_OF_BUFFER 218 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -366,82 +366,93 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[675] = +static yyconst flex_int16_t yy_accept[776] = { 0, - 0, 0, 184, 182, 180, 179, 182, 182, 152, 178, - 154, 154, 154, 154, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 180, 0, 0, 181, 152, 0, - 153, 155, 175, 175, 0, 0, 0, 0, 175, 0, - 0, 0, 0, 0, 0, 0, 132, 176, 133, 134, - 166, 166, 166, 166, 0, 154, 0, 140, 141, 142, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 174, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 173, 173, 0, 0, 0, + 0, 0, 218, 216, 214, 213, 216, 216, 186, 212, + 188, 188, 188, 188, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 214, 0, 0, 215, 186, + 0, 187, 189, 209, 209, 0, 0, 0, 0, 209, + 0, 0, 0, 0, 0, 0, 0, 166, 210, 167, + 168, 200, 200, 200, 200, 0, 188, 0, 174, 175, + 176, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 208, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 207, 207, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 172, 172, 172, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 163, 163, 163, 164, 164, 165, 156, - 155, 156, 0, 157, 11, 13, 152, 15, 152, 152, - 16, 18, 152, 20, 22, 24, 26, 6, 28, 30, - 31, 33, 35, 38, 36, 40, 41, 43, 45, 47, - - 49, 51, 152, 152, 152, 53, 55, 152, 57, 59, - 61, 152, 63, 65, 67, 69, 152, 71, 73, 75, - 77, 152, 152, 152, 152, 152, 152, 0, 0, 0, - 0, 155, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 93, 94, 96, 0, 171, 0, 0, 0, - 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 170, 169, 169, 122, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 160, 160, - 161, 162, 0, 158, 152, 152, 152, 152, 152, 152, - 152, 152, 143, 152, 152, 152, 152, 152, 152, 152, - - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 144, 152, 152, 152, 152, 152, 152, - 152, 152, 10, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 0, 177, 0, 0, 0, 86, 87, - 0, 0, 0, 0, 0, 0, 0, 98, 0, 0, + 206, 206, 206, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 197, 197, 197, 198, 198, 199, 190, + 189, 190, 0, 191, 11, 13, 186, 15, 186, 186, + 16, 18, 186, 20, 22, 24, 26, 28, 30, 6, + + 32, 34, 35, 37, 39, 42, 40, 44, 45, 47, + 49, 51, 53, 55, 186, 186, 186, 186, 186, 65, + 67, 186, 69, 71, 73, 75, 77, 79, 81, 186, + 83, 85, 87, 89, 91, 93, 95, 186, 97, 99, + 101, 103, 186, 109, 111, 186, 186, 186, 186, 186, + 186, 0, 0, 0, 0, 189, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 127, 128, 130, 0, + 205, 0, 0, 0, 0, 0, 0, 144, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 204, 203, + 203, 156, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 194, 194, 195, 196, 0, 192, 186, 186, + 186, 186, 186, 186, 186, 186, 177, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 57, 186, 61, + 186, 186, 186, 178, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 10, + 186, 186, 186, 186, 105, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 0, 211, 0, 0, 0, 120, + 121, 0, 0, 0, 0, 0, 0, 0, 132, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 168, 0, 0, 0, - 126, 0, 128, 0, 0, 0, 0, 0, 0, 167, - 159, 152, 152, 152, 4, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - - 152, 152, 152, 152, 152, 152, 9, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 82, 152, 152, 0, 0, 0, - 0, 0, 88, 89, 0, 0, 0, 0, 97, 0, - 0, 101, 104, 0, 0, 0, 0, 0, 0, 0, - 115, 116, 0, 0, 0, 0, 121, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 152, 152, 152, - 152, 152, 152, 5, 152, 152, 152, 152, 152, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 7, 8, 152, 152, 152, 152, 152, 152, 152, - - 152, 152, 152, 152, 152, 152, 152, 152, 152, 83, - 152, 79, 0, 0, 0, 0, 137, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 107, 0, 111, 112, - 0, 114, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 130, 131, 0, 0, 138, 12, 3, 14, - 148, 149, 152, 17, 19, 21, 23, 25, 27, 29, - 32, 34, 39, 37, 42, 44, 46, 48, 50, 52, - 54, 56, 58, 60, 62, 152, 152, 152, 64, 66, - 68, 70, 72, 74, 76, 78, 152, 81, 139, 0, - 0, 84, 0, 90, 0, 0, 0, 99, 0, 0, - - 0, 0, 0, 0, 113, 0, 0, 119, 106, 0, - 0, 0, 0, 0, 0, 135, 0, 152, 145, 146, - 152, 80, 0, 0, 0, 0, 92, 95, 100, 0, - 0, 105, 0, 0, 0, 118, 0, 0, 0, 0, - 127, 129, 0, 152, 152, 2, 1, 0, 91, 0, - 103, 0, 109, 117, 0, 0, 124, 125, 136, 152, - 147, 0, 102, 0, 120, 123, 152, 85, 108, 152, - 152, 150, 151, 0 + + 0, 0, 0, 0, 0, 0, 0, 202, 0, 0, + 0, 160, 0, 162, 0, 0, 0, 0, 0, 0, + 201, 193, 186, 186, 186, 4, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 9, + 186, 59, 186, 63, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 107, 186, 186, 186, + 186, 186, 116, 186, 186, 0, 0, 0, 0, 0, + 122, 123, 0, 0, 0, 0, 131, 0, 0, 135, + + 138, 0, 0, 0, 0, 0, 0, 0, 149, 150, + 0, 0, 0, 0, 155, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 186, 186, 186, 186, 186, + 186, 5, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 7, 8, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 117, 186, 113, 0, 0, 0, + 0, 171, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 141, 0, 145, 146, 0, 148, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 164, 165, 0, + 0, 172, 12, 3, 14, 182, 183, 186, 17, 19, + 21, 23, 25, 27, 29, 31, 33, 36, 38, 43, + 41, 46, 48, 50, 52, 54, 56, 186, 186, 186, + 186, 66, 68, 70, 72, 74, 76, 78, 80, 82, + 186, 186, 186, 84, 86, 88, 90, 92, 94, 96, + 98, 100, 102, 104, 186, 186, 110, 112, 186, 115, + 173, 0, 0, 118, 0, 124, 0, 0, 0, 133, + 0, 0, 0, 0, 0, 0, 147, 0, 0, 153, + + 140, 0, 0, 0, 0, 0, 0, 169, 0, 186, + 58, 186, 62, 186, 179, 180, 186, 106, 186, 114, + 0, 0, 0, 0, 126, 129, 134, 0, 0, 139, + 0, 0, 0, 152, 0, 0, 0, 0, 161, 163, + 0, 186, 60, 64, 186, 108, 2, 1, 0, 125, + 0, 137, 0, 143, 151, 0, 0, 158, 159, 170, + 186, 181, 0, 136, 0, 154, 157, 186, 119, 142, + 186, 186, 184, 185, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -487,280 +498,313 @@ static yyconst flex_int32_t yy_meta[68] = 2, 2, 2, 2, 2, 2, 2 } ; -static yyconst flex_int16_t yy_base[678] = +static yyconst flex_int16_t yy_base[779] = { 0, - 0, 0, 954, 955, 66, 955, 948, 949, 0, 69, - 85, 128, 140, 152, 151, 58, 39, 48, 75, 927, - 158, 160, 73, 59, 71, 170, 54, 920, 890, 889, - 901, 885, 899, 898, 142, 927, 939, 955, 0, 206, - 955, 189, 168, 171, 53, 27, 66, 119, 175, 899, - 885, 123, 170, 883, 895, 183, 955, 198, 225, 99, - 212, 219, 223, 227, 285, 297, 308, 955, 955, 955, - 904, 917, 911, 165, 900, 903, 899, 914, 224, 896, - 910, 194, 896, 909, 900, 913, 890, 901, 892, 294, - 893, 884, 893, 884, 883, 884, 878, 884, 895, 881, - - 878, 890, 893, 880, 873, 889, 865, 193, 139, 885, - 861, 846, 841, 858, 834, 839, 865, 167, 854, 259, - 849, 325, 282, 851, 832, 302, 842, 838, 833, 43, - 839, 825, 841, 838, 829, 305, 309, 831, 820, 834, - 837, 819, 834, 821, 818, 825, 275, 833, 254, 299, - 317, 327, 331, 810, 827, 828, 821, 803, 310, 804, - 826, 817, 316, 327, 331, 335, 339, 343, 347, 955, - 405, 416, 422, 428, 825, 240, 849, 0, 848, 831, - 821, 820, 840, 818, 817, 816, 815, 0, 814, 0, - 813, 812, 0, 811, 810, 0, 809, 808, 807, 806, - - 805, 804, 820, 813, 826, 800, 799, 805, 797, 796, - 795, 816, 793, 792, 791, 790, 800, 788, 787, 786, - 785, 777, 776, 761, 761, 760, 759, 802, 774, 762, - 434, 442, 416, 766, 186, 763, 757, 757, 751, 764, - 764, 749, 955, 955, 764, 752, 418, 759, 281, 756, - 762, 308, 757, 955, 748, 755, 754, 757, 743, 742, - 746, 741, 278, 746, 420, 428, 430, 955, 738, 736, - 736, 744, 745, 727, 421, 732, 738, 419, 426, 430, - 434, 438, 496, 502, 752, 764, 750, 749, 742, 756, - 746, 745, 0, 744, 743, 742, 741, 740, 739, 738, - - 737, 736, 735, 734, 733, 732, 731, 730, 733, 726, - 733, 726, 725, 0, 724, 723, 722, 725, 720, 719, - 718, 717, 0, 716, 715, 714, 713, 691, 685, 690, - 696, 679, 694, 315, 955, 693, 683, 687, 955, 955, - 677, 686, 672, 689, 672, 675, 669, 955, 670, 669, - 666, 673, 666, 674, 670, 680, 677, 659, 665, 672, - 656, 655, 673, 655, 667, 666, 955, 665, 655, 659, - 955, 646, 955, 651, 651, 659, 642, 643, 653, 955, - 955, 685, 667, 683, 0, 507, 681, 681, 680, 679, - 678, 677, 676, 675, 674, 673, 672, 671, 670, 669, - - 668, 667, 666, 665, 652, 645, 0, 662, 661, 660, - 659, 658, 636, 656, 655, 654, 653, 652, 651, 650, - 649, 618, 621, 601, 0, 602, 595, 602, 601, 602, - 594, 612, 955, 955, 594, 592, 602, 595, 955, 590, - 607, 330, 955, 598, 582, 583, 592, 583, 582, 582, - 955, 581, 590, 580, 596, 593, 955, 592, 590, 579, - 580, 576, 568, 575, 570, 571, 566, 592, 592, 590, - 604, 603, 598, 0, 586, 585, 584, 583, 582, 581, - 580, 579, 578, 577, 576, 575, 574, 573, 572, 571, - 570, 0, 0, 569, 568, 567, 566, 565, 509, 564, - - 563, 562, 561, 560, 559, 558, 557, 535, 535, 0, - 542, 0, 576, 575, 524, 542, 955, 537, 532, 525, - 521, 533, 523, 521, 517, 533, 524, 523, 955, 955, - 526, 955, 521, 514, 503, 514, 506, 510, 523, 518, - 521, 503, 955, 955, 515, 504, 955, 0, 0, 0, - 0, 0, 543, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1054, 1055, 66, 1055, 1048, 1049, 0, 69, + 85, 128, 140, 152, 151, 58, 56, 63, 76, 1027, + 158, 160, 39, 163, 173, 189, 52, 1020, 76, 990, + 989, 1001, 985, 999, 998, 105, 1027, 1039, 1055, 0, + 225, 1055, 218, 160, 157, 20, 123, 66, 119, 192, + 999, 985, 54, 162, 983, 995, 194, 1055, 200, 195, + 98, 227, 196, 231, 235, 293, 305, 316, 1055, 1055, + 1055, 1004, 1017, 1011, 223, 1000, 1003, 999, 1014, 107, + 298, 996, 1010, 246, 996, 1009, 1000, 1013, 990, 1001, + 992, 182, 993, 984, 993, 984, 983, 984, 144, 978, + + 984, 995, 986, 980, 977, 978, 982, 289, 991, 978, + 302, 985, 972, 986, 962, 65, 315, 989, 981, 980, + 956, 941, 936, 953, 929, 934, 960, 279, 949, 293, + 944, 342, 299, 946, 927, 317, 937, 933, 928, 207, + 934, 920, 936, 933, 924, 320, 324, 926, 915, 929, + 932, 914, 929, 916, 913, 920, 284, 928, 227, 288, + 327, 342, 345, 905, 922, 923, 916, 898, 318, 899, + 921, 912, 330, 341, 345, 349, 353, 357, 361, 1055, + 419, 430, 436, 442, 920, 205, 944, 0, 943, 926, + 916, 915, 935, 913, 912, 911, 910, 909, 908, 0, + + 907, 0, 906, 905, 0, 904, 903, 0, 902, 901, + 900, 899, 898, 897, 913, 906, 919, 354, 356, 893, + 892, 898, 890, 889, 888, 887, 886, 885, 884, 905, + 882, 881, 880, 879, 878, 877, 876, 886, 874, 873, + 872, 871, 357, 870, 869, 861, 860, 845, 845, 844, + 843, 886, 858, 846, 448, 456, 430, 850, 418, 847, + 841, 841, 835, 848, 848, 833, 1055, 1055, 848, 836, + 432, 843, 135, 840, 846, 433, 841, 1055, 832, 839, + 838, 841, 827, 826, 830, 825, 330, 830, 439, 442, + 451, 1055, 822, 820, 820, 828, 829, 811, 456, 816, + + 822, 441, 447, 454, 458, 462, 520, 526, 836, 848, + 834, 833, 826, 840, 830, 829, 0, 828, 827, 826, + 825, 824, 823, 822, 821, 820, 819, 818, 817, 816, + 815, 814, 813, 812, 815, 808, 815, 800, 807, 798, + 821, 804, 803, 0, 802, 801, 800, 799, 798, 797, + 796, 799, 794, 793, 792, 791, 790, 789, 788, 0, + 787, 786, 785, 784, 775, 782, 781, 780, 758, 752, + 757, 763, 746, 761, 495, 1055, 760, 750, 754, 1055, + 1055, 744, 753, 739, 756, 739, 742, 736, 1055, 737, + 736, 733, 740, 733, 741, 737, 747, 744, 726, 732, + + 739, 723, 722, 740, 722, 734, 733, 1055, 732, 722, + 726, 1055, 713, 1055, 718, 718, 726, 709, 710, 720, + 1055, 1055, 752, 734, 750, 0, 532, 748, 748, 747, + 746, 745, 744, 743, 742, 741, 740, 739, 738, 737, + 736, 735, 734, 733, 732, 731, 730, 717, 710, 0, + 710, 701, 708, 699, 723, 722, 721, 720, 719, 718, + 717, 716, 715, 693, 713, 712, 711, 710, 709, 708, + 707, 706, 705, 704, 703, 685, 676, 700, 699, 668, + 671, 651, 0, 652, 645, 652, 651, 652, 644, 662, + 1055, 1055, 644, 642, 652, 645, 1055, 640, 657, 345, + + 1055, 648, 632, 633, 642, 633, 632, 632, 1055, 631, + 640, 630, 646, 643, 1055, 642, 640, 629, 630, 626, + 618, 625, 620, 621, 616, 642, 642, 640, 654, 653, + 648, 0, 636, 635, 634, 633, 632, 631, 630, 629, + 628, 627, 626, 625, 624, 623, 622, 621, 620, 619, + 618, 0, 0, 635, 617, 633, 615, 613, 612, 611, + 610, 609, 608, 607, 606, 605, 484, 604, 603, 602, + 601, 600, 599, 598, 597, 596, 595, 594, 611, 593, + 591, 590, 568, 568, 0, 575, 0, 609, 608, 557, + 575, 1055, 570, 565, 558, 554, 566, 556, 554, 550, + + 566, 557, 556, 1055, 1055, 559, 1055, 554, 547, 536, + 547, 539, 543, 556, 551, 554, 536, 1055, 1055, 548, + 537, 1055, 0, 0, 0, 0, 0, 576, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 539, 538, 536, 0, 0, - 0, 0, 0, 0, 0, 0, 494, 0, 0, 545, - 544, 955, 491, 955, 495, 495, 504, 955, 488, 502, - - 483, 485, 482, 490, 955, 468, 479, 955, 955, 483, - 479, 472, 470, 470, 483, 955, 467, 507, 0, 0, - 507, 0, 514, 513, 472, 433, 955, 955, 955, 435, - 435, 955, 429, 386, 377, 955, 366, 365, 323, 328, - 955, 955, 339, 348, 337, 955, 955, 307, 955, 305, - 955, 257, 955, 955, 247, 221, 955, 955, 955, 236, - 0, 213, 955, 150, 955, 955, 232, 955, 955, 162, - 138, 0, 0, 955, 541, 108, 544 + 0, 0, 0, 0, 0, 0, 0, 557, 574, 555, + 572, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 568, 567, 565, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 550, 567, 0, 0, 521, 0, + 0, 572, 571, 1055, 518, 1055, 522, 522, 531, 1055, + 515, 529, 517, 519, 516, 518, 1055, 496, 507, 1055, + + 1055, 511, 507, 500, 497, 497, 510, 1055, 494, 534, + 0, 518, 0, 517, 0, 0, 532, 0, 515, 0, + 67, 187, 172, 202, 1055, 1055, 1055, 219, 243, 1055, + 245, 246, 300, 1055, 292, 315, 332, 340, 1055, 1055, + 357, 406, 0, 0, 402, 0, 1055, 1055, 381, 1055, + 423, 1055, 437, 1055, 1055, 431, 429, 1055, 1055, 1055, + 460, 0, 448, 1055, 444, 1055, 1055, 534, 1055, 1055, + 496, 528, 0, 0, 1055, 565, 546, 568 } ; -static yyconst flex_int16_t yy_def[678] = +static yyconst flex_int16_t yy_def[779] = { 0, - 674, 1, 674, 674, 674, 674, 674, 675, 676, 674, - 674, 674, 674, 674, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 674, 674, 675, 674, 676, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 677, 674, 674, 674, 674, 674, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 676, 676, 676, - 676, 676, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 676, 676, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 676, - 676, 674, 674, 674, 674, 674, 676, 674, 674, 676, - 676, 676, 676, 0, 674, 674, 674 + 775, 1, 775, 775, 775, 775, 775, 776, 777, 775, + 775, 775, 775, 775, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 775, 775, 776, 775, 777, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 778, 775, 775, 775, 775, + 775, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + + 775, 775, 775, 775, 775, 775, 775, 775, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 777, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + + 775, 775, 775, 775, 775, 775, 775, 775, 775, 777, + 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 777, 777, 777, 777, 777, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 777, 777, 775, 775, 775, 775, 775, 777, 775, 775, + 777, 777, 777, 777, 0, 775, 775, 775 } ; -static yyconst flex_int16_t yy_nxt[1023] = +static yyconst flex_int16_t yy_nxt[1123] = { 0, 4, 5, 6, 5, 7, 8, 9, 4, 10, 11, 12, 13, 14, 11, 11, 15, 9, 16, 17, 18, 19, 9, 9, 9, 20, 21, 22, 9, 23, 24, - 9, 25, 26, 27, 9, 9, 9, 28, 9, 9, - 9, 9, 9, 9, 9, 9, 29, 9, 9, 9, - 9, 9, 9, 9, 9, 9, 30, 9, 31, 32, - 33, 9, 34, 9, 9, 9, 9, 35, 79, 35, - 40, 80, 129, 108, 96, 81, 130, 41, 42, 42, - 42, 42, 42, 42, 76, 82, 77, 97, 98, 240, - 99, 109, 78, 65, 66, 66, 66, 66, 66, 66, - - 83, 241, 94, 100, 67, 127, 84, 95, 128, 39, - 43, 44, 45, 46, 47, 48, 49, 50, 51, 131, - 132, 52, 53, 54, 55, 56, 57, 58, 59, 60, - 67, 133, 61, 62, 63, 64, 65, 66, 66, 66, - 66, 66, 66, 35, 160, 35, 68, 67, 65, 66, - 66, 66, 66, 66, 66, 219, 673, 161, 69, 67, - 65, 66, 66, 66, 66, 66, 66, 71, 220, 72, - 70, 67, 140, 67, 134, 90, 73, 135, 141, 86, - 672, 87, 74, 91, 75, 67, 88, 101, 92, 89, - 178, 102, 103, 104, 93, 105, 179, 67, 42, 42, - - 42, 42, 42, 42, 106, 189, 107, 40, 122, 123, - 123, 142, 126, 123, 669, 123, 136, 137, 123, 217, - 124, 124, 123, 190, 147, 143, 123, 125, 125, 123, - 218, 337, 144, 123, 122, 148, 184, 185, 149, 151, - 152, 150, 670, 671, 338, 153, 186, 118, 119, 45, - 46, 47, 48, 154, 50, 51, 123, 162, 52, 53, - 54, 55, 56, 57, 120, 59, 60, 668, 155, 121, - 156, 286, 667, 157, 158, 163, 163, 163, 163, 666, - 287, 159, 164, 163, 165, 166, 167, 163, 163, 168, - 169, 163, 163, 163, 171, 171, 171, 171, 171, 171, - - 230, 665, 664, 260, 172, 65, 66, 66, 66, 66, - 66, 66, 198, 261, 154, 173, 67, 174, 174, 174, - 174, 174, 174, 233, 233, 364, 349, 257, 365, 233, - 172, 199, 231, 258, 232, 232, 232, 232, 232, 232, - 233, 350, 67, 233, 233, 236, 233, 233, 262, 233, - 247, 233, 233, 353, 263, 273, 233, 663, 233, 233, - 233, 428, 662, 233, 233, 274, 354, 233, 265, 233, - 661, 264, 266, 267, 233, 233, 660, 429, 233, 278, - 278, 278, 278, 524, 659, 233, 525, 658, 657, 233, - 278, 278, 278, 278, 279, 278, 278, 280, 281, 278, - - 278, 278, 278, 278, 278, 278, 282, 278, 278, 278, - 278, 278, 278, 278, 42, 42, 42, 42, 42, 42, - 656, 655, 654, 283, 122, 284, 284, 284, 284, 284, - 284, 174, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 232, 232, 232, 232, 232, 232, 653, - 122, 232, 232, 232, 232, 232, 232, 335, 335, 335, - 335, 335, 335, 335, 374, 335, 375, 335, 376, 335, - 335, 367, 335, 652, 335, 335, 335, 335, 335, 651, - 650, 377, 380, 380, 380, 380, 335, 649, 335, 380, - 380, 380, 380, 381, 380, 380, 380, 380, 380, 380, - - 380, 380, 380, 380, 380, 284, 284, 284, 284, 284, - 284, 284, 284, 284, 284, 284, 284, 471, 472, 576, - 577, 648, 647, 646, 645, 644, 643, 642, 641, 640, - 639, 638, 637, 636, 635, 634, 633, 632, 631, 473, - 578, 37, 37, 37, 170, 170, 630, 629, 628, 627, - 626, 625, 624, 623, 622, 621, 620, 619, 618, 617, - 616, 615, 614, 613, 612, 611, 610, 609, 608, 607, - 606, 605, 604, 603, 602, 601, 600, 599, 598, 597, + 9, 25, 26, 27, 28, 9, 9, 29, 9, 9, + 9, 9, 9, 9, 9, 9, 30, 9, 9, 9, + 9, 9, 9, 9, 9, 9, 31, 9, 32, 33, + 34, 9, 35, 9, 9, 9, 9, 36, 96, 36, + 41, 116, 137, 97, 80, 138, 747, 42, 43, 43, + 43, 43, 43, 43, 77, 81, 78, 119, 82, 117, + 83, 238, 79, 66, 67, 67, 67, 67, 67, 67, + + 84, 85, 239, 150, 68, 120, 36, 86, 36, 151, + 44, 45, 46, 47, 48, 49, 50, 51, 52, 141, + 142, 53, 54, 55, 56, 57, 58, 59, 60, 61, + 68, 143, 62, 63, 64, 65, 66, 67, 67, 67, + 67, 67, 67, 170, 194, 195, 69, 68, 66, 67, + 67, 67, 67, 67, 67, 218, 171, 219, 70, 68, + 66, 67, 67, 67, 67, 67, 67, 72, 139, 73, + 71, 68, 140, 68, 144, 92, 74, 145, 98, 88, + 390, 89, 75, 93, 76, 68, 90, 99, 94, 91, + 101, 100, 102, 103, 95, 391, 748, 68, 136, 133, + + 210, 133, 133, 152, 133, 104, 105, 133, 106, 107, + 108, 109, 110, 134, 111, 133, 112, 153, 133, 211, + 135, 749, 113, 114, 154, 115, 41, 43, 43, 43, + 43, 43, 43, 146, 147, 157, 310, 132, 165, 133, + 166, 161, 162, 167, 168, 311, 158, 163, 188, 159, + 133, 169, 160, 264, 189, 164, 750, 201, 133, 174, + 173, 175, 176, 132, 751, 265, 128, 129, 46, 47, + 48, 49, 172, 51, 52, 202, 284, 53, 54, 55, + 56, 57, 58, 130, 60, 61, 285, 752, 131, 753, + 173, 173, 173, 173, 177, 173, 173, 178, 179, 173, + + 173, 173, 181, 181, 181, 181, 181, 181, 228, 754, + 196, 197, 182, 66, 67, 67, 67, 67, 67, 67, + 198, 232, 229, 183, 68, 184, 184, 184, 184, 184, + 184, 240, 134, 241, 254, 233, 281, 286, 182, 135, + 257, 257, 282, 287, 242, 755, 257, 756, 164, 255, + 68, 256, 256, 256, 256, 256, 256, 257, 257, 257, + 260, 257, 257, 297, 257, 271, 257, 257, 257, 257, + 757, 257, 340, 298, 257, 257, 338, 405, 257, 365, + 406, 288, 257, 289, 257, 257, 290, 291, 339, 257, + 341, 366, 257, 302, 302, 302, 302, 758, 599, 759, + + 257, 600, 760, 257, 302, 302, 302, 302, 303, 302, + 302, 304, 305, 302, 302, 302, 302, 302, 302, 302, + 306, 302, 302, 302, 302, 302, 302, 302, 43, 43, + 43, 43, 43, 43, 761, 762, 763, 307, 132, 308, + 308, 308, 308, 308, 308, 184, 184, 184, 184, 184, + 184, 184, 184, 184, 184, 184, 184, 256, 256, 256, + 256, 256, 256, 378, 132, 256, 256, 256, 256, 256, + 256, 376, 376, 376, 376, 764, 379, 376, 394, 376, + 376, 376, 765, 376, 376, 766, 376, 767, 376, 376, + 376, 395, 408, 376, 661, 662, 768, 376, 376, 415, + + 376, 416, 769, 417, 421, 421, 421, 421, 770, 376, + 421, 421, 421, 421, 773, 663, 418, 422, 421, 421, + 421, 421, 421, 421, 421, 421, 421, 421, 421, 308, + 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, + 308, 486, 529, 530, 771, 772, 774, 40, 746, 745, + 744, 743, 742, 741, 740, 739, 738, 487, 737, 736, + 735, 734, 733, 732, 531, 38, 38, 38, 180, 180, + 731, 730, 729, 728, 727, 726, 725, 724, 723, 722, + 721, 720, 719, 718, 717, 716, 715, 714, 713, 712, + 711, 710, 709, 708, 707, 706, 705, 704, 703, 702, + + 701, 700, 699, 698, 697, 696, 695, 694, 693, 692, + 691, 690, 689, 688, 687, 686, 685, 684, 683, 682, + 681, 680, 679, 678, 677, 676, 675, 674, 673, 672, + 671, 670, 669, 668, 667, 666, 665, 664, 660, 659, + 658, 657, 656, 655, 654, 653, 652, 651, 650, 649, + 648, 647, 646, 645, 644, 643, 642, 641, 640, 639, + 638, 637, 636, 635, 634, 633, 632, 631, 630, 629, + 628, 627, 626, 625, 624, 623, 622, 621, 620, 619, + 618, 617, 616, 615, 614, 613, 612, 611, 610, 609, + 608, 607, 606, 605, 604, 603, 602, 601, 598, 597, + 596, 595, 594, 593, 592, 591, 590, 589, 588, 587, - 586, 585, 584, 583, 582, 581, 580, 579, 575, 574, - - 573, 572, 571, 570, 569, 568, 567, 566, 565, 564, - 563, 562, 561, 560, 559, 558, 557, 556, 555, 554, - 553, 552, 551, 550, 549, 548, 547, 546, 545, 544, - 543, 542, 541, 540, 539, 538, 537, 536, 535, 534, - 533, 532, 531, 530, 529, 528, 527, 526, 523, 522, - 521, 520, 519, 518, 517, 516, 515, 514, 513, 512, - 511, 510, 509, 508, 507, 506, 505, 504, 503, 502, - 501, 500, 499, 498, 497, 496, 495, 494, 493, 492, - 491, 490, 489, 488, 487, 486, 485, 484, 483, 482, - 481, 480, 479, 478, 477, 476, 475, 474, 470, 469, - - 468, 467, 466, 465, 464, 463, 462, 461, 460, 459, - 458, 457, 456, 455, 454, 453, 452, 451, 450, 449, - 448, 447, 446, 445, 444, 443, 442, 441, 440, 439, - 438, 437, 436, 435, 434, 433, 432, 431, 430, 427, - 426, 425, 424, 423, 422, 421, 420, 419, 418, 417, - 416, 415, 414, 413, 412, 411, 410, 409, 408, 407, - 406, 405, 404, 403, 402, 401, 400, 399, 398, 397, - 396, 395, 394, 393, 392, 391, 390, 389, 388, 387, - 386, 385, 384, 383, 382, 379, 378, 373, 372, 371, - 370, 369, 368, 366, 363, 362, 361, 360, 359, 358, - - 357, 356, 355, 352, 351, 348, 347, 346, 345, 344, - 343, 342, 341, 340, 339, 336, 264, 236, 334, 333, - 332, 331, 330, 329, 328, 327, 326, 325, 324, 323, - 322, 321, 320, 319, 318, 317, 316, 315, 314, 313, - 312, 311, 310, 309, 308, 307, 306, 305, 304, 303, - 302, 301, 300, 299, 298, 297, 296, 295, 294, 293, - 292, 291, 290, 289, 288, 285, 277, 276, 275, 272, - 271, 270, 269, 268, 259, 256, 255, 254, 253, 252, - 251, 250, 249, 248, 246, 245, 244, 243, 242, 239, - 238, 237, 235, 234, 162, 229, 228, 227, 226, 225, - - 224, 223, 222, 221, 216, 215, 214, 213, 212, 211, - 210, 209, 208, 207, 206, 205, 204, 203, 202, 201, - 200, 197, 196, 195, 194, 193, 192, 191, 188, 187, - 183, 182, 181, 180, 177, 176, 175, 146, 145, 139, - 138, 38, 117, 116, 115, 114, 113, 112, 111, 110, - 85, 38, 36, 674, 3, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674 + 586, 585, 584, 583, 582, 581, 580, 579, 578, 577, + 576, 575, 574, 573, 572, 571, 570, 569, 568, 567, + 566, 565, 564, 563, 562, 561, 560, 559, 558, 557, + 556, 555, 554, 553, 552, 551, 550, 549, 548, 547, + 546, 545, 544, 543, 542, 541, 540, 539, 538, 537, + 536, 535, 534, 533, 532, 528, 527, 526, 525, 524, + 523, 522, 521, 520, 519, 518, 517, 516, 515, 514, + 513, 512, 511, 510, 509, 508, 507, 506, 505, 504, + 503, 502, 501, 500, 499, 498, 497, 496, 495, 494, + + 493, 492, 491, 490, 489, 488, 485, 484, 483, 482, + 481, 480, 479, 478, 477, 476, 475, 474, 473, 472, + 471, 470, 469, 468, 467, 466, 465, 464, 463, 462, + 461, 460, 459, 458, 457, 456, 455, 454, 453, 452, + 451, 450, 449, 448, 447, 446, 445, 444, 443, 442, + 441, 440, 439, 438, 437, 436, 435, 434, 433, 432, + 431, 430, 429, 428, 427, 426, 425, 424, 423, 420, + 419, 414, 413, 412, 411, 410, 409, 407, 404, 403, + 402, 401, 400, 399, 398, 397, 396, 393, 392, 389, + 388, 387, 386, 385, 384, 383, 382, 381, 380, 377, + + 288, 260, 375, 374, 373, 372, 371, 370, 369, 368, + 367, 364, 363, 362, 361, 360, 359, 358, 357, 356, + 355, 354, 353, 352, 351, 350, 349, 348, 347, 346, + 345, 344, 343, 342, 337, 336, 335, 334, 333, 332, + 331, 330, 329, 328, 327, 326, 325, 324, 323, 322, + 321, 320, 319, 318, 317, 316, 315, 314, 313, 312, + 309, 301, 300, 299, 296, 295, 294, 293, 292, 283, + 280, 279, 278, 277, 276, 275, 274, 273, 272, 270, + 269, 268, 267, 266, 263, 262, 261, 259, 258, 172, + 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, + + 243, 237, 236, 235, 234, 231, 230, 227, 226, 225, + 224, 223, 222, 221, 220, 217, 216, 215, 214, 213, + 212, 209, 208, 207, 206, 205, 204, 203, 200, 199, + 193, 192, 191, 190, 187, 186, 185, 156, 155, 149, + 148, 39, 127, 126, 125, 124, 123, 122, 121, 118, + 87, 39, 37, 775, 3, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775 } ; -static yyconst flex_int16_t yy_chk[1023] = +static yyconst flex_int16_t yy_chk[1123] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -768,113 +812,124 @@ static yyconst flex_int16_t yy_chk[1023] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 5, 17, 5, - 10, 17, 46, 27, 24, 18, 46, 10, 10, 10, - 10, 10, 10, 10, 16, 18, 16, 24, 25, 130, - 25, 27, 16, 11, 11, 11, 11, 11, 11, 11, - - 19, 130, 23, 25, 11, 45, 19, 23, 45, 676, - 10, 10, 10, 10, 10, 10, 10, 10, 10, 47, - 47, 10, 10, 10, 10, 10, 10, 10, 10, 10, - 11, 47, 10, 10, 10, 10, 12, 12, 12, 12, - 12, 12, 12, 35, 60, 35, 12, 12, 13, 13, - 13, 13, 13, 13, 13, 109, 671, 60, 13, 13, - 14, 14, 14, 14, 14, 14, 14, 15, 109, 15, - 14, 14, 52, 12, 48, 22, 15, 48, 52, 21, - 670, 21, 15, 22, 15, 13, 21, 26, 22, 21, - 74, 26, 26, 26, 22, 26, 74, 14, 42, 42, - - 42, 42, 42, 42, 26, 82, 26, 40, 42, 43, - 43, 53, 44, 44, 664, 43, 49, 49, 44, 108, - 118, 43, 49, 82, 56, 53, 43, 118, 43, 44, - 108, 235, 53, 49, 42, 56, 79, 79, 56, 58, - 58, 56, 667, 667, 235, 58, 79, 40, 40, 40, - 40, 40, 40, 58, 40, 40, 58, 61, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 662, 59, 40, - 59, 176, 660, 59, 59, 61, 61, 61, 61, 656, - 176, 59, 62, 62, 62, 62, 63, 63, 63, 63, - 64, 64, 64, 64, 65, 65, 65, 65, 65, 65, - - 120, 655, 652, 149, 65, 66, 66, 66, 66, 66, - 66, 66, 90, 149, 120, 67, 66, 67, 67, 67, - 67, 67, 67, 123, 123, 263, 249, 147, 263, 123, - 65, 90, 122, 147, 122, 122, 122, 122, 122, 122, - 123, 249, 66, 126, 126, 126, 136, 136, 150, 126, - 137, 137, 136, 252, 150, 159, 137, 650, 151, 151, - 126, 334, 648, 136, 151, 159, 252, 137, 152, 152, - 645, 151, 153, 153, 152, 151, 644, 334, 153, 163, - 163, 163, 163, 442, 643, 152, 442, 640, 639, 153, - 164, 164, 164, 164, 165, 165, 165, 165, 166, 166, - - 166, 166, 167, 167, 167, 167, 168, 168, 168, 168, - 169, 169, 169, 169, 171, 171, 171, 171, 171, 171, - 638, 637, 635, 172, 171, 172, 172, 172, 172, 172, - 172, 173, 173, 173, 173, 173, 173, 174, 174, 174, - 174, 174, 174, 231, 231, 231, 231, 231, 231, 634, - 171, 232, 232, 232, 232, 232, 232, 233, 233, 247, - 247, 265, 265, 233, 275, 247, 275, 265, 275, 266, - 266, 267, 267, 633, 233, 266, 247, 267, 265, 631, - 630, 275, 278, 278, 278, 278, 266, 626, 267, 279, - 279, 279, 279, 280, 280, 280, 280, 281, 281, 281, - - 281, 282, 282, 282, 282, 283, 283, 283, 283, 283, - 283, 284, 284, 284, 284, 284, 284, 386, 386, 499, - 499, 625, 624, 623, 621, 618, 617, 615, 614, 613, - 612, 611, 610, 607, 606, 604, 603, 602, 601, 386, - 499, 675, 675, 675, 677, 677, 600, 599, 597, 596, - 595, 593, 591, 590, 587, 578, 577, 576, 553, 546, - 545, 542, 541, 540, 539, 538, 537, 536, 535, 534, - 533, 531, 528, 527, 526, 525, 524, 523, 522, 521, - 520, 519, 518, 516, 515, 514, 513, 511, 509, 508, - 507, 506, 505, 504, 503, 502, 501, 500, 498, 497, - - 496, 495, 494, 491, 490, 489, 488, 487, 486, 485, - 484, 483, 482, 481, 480, 479, 478, 477, 476, 475, + 1, 1, 1, 1, 1, 1, 1, 5, 23, 5, + 10, 27, 46, 23, 17, 46, 721, 10, 10, 10, + 10, 10, 10, 10, 16, 17, 16, 29, 17, 27, + 18, 116, 16, 11, 11, 11, 11, 11, 11, 11, + + 18, 19, 116, 53, 11, 29, 36, 19, 36, 53, + 10, 10, 10, 10, 10, 10, 10, 10, 10, 48, + 48, 10, 10, 10, 10, 10, 10, 10, 10, 10, + 11, 48, 10, 10, 10, 10, 12, 12, 12, 12, + 12, 12, 12, 61, 80, 80, 12, 12, 13, 13, + 13, 13, 13, 13, 13, 99, 61, 99, 13, 13, + 14, 14, 14, 14, 14, 14, 14, 15, 47, 15, + 14, 14, 47, 12, 49, 22, 15, 49, 24, 21, + 273, 21, 15, 22, 15, 13, 21, 24, 22, 21, + 25, 24, 25, 25, 22, 273, 722, 14, 45, 45, + + 92, 44, 44, 54, 45, 25, 26, 44, 26, 26, + 26, 26, 26, 44, 26, 45, 26, 54, 44, 92, + 44, 723, 26, 26, 54, 26, 41, 43, 43, 43, + 43, 43, 43, 50, 50, 57, 186, 43, 60, 50, + 60, 59, 59, 60, 60, 186, 57, 59, 75, 57, + 50, 60, 57, 140, 75, 59, 724, 84, 59, 63, + 63, 63, 63, 43, 728, 140, 41, 41, 41, 41, + 41, 41, 62, 41, 41, 84, 159, 41, 41, 41, + 41, 41, 41, 41, 41, 41, 159, 729, 41, 731, + 62, 62, 62, 62, 64, 64, 64, 64, 65, 65, + + 65, 65, 66, 66, 66, 66, 66, 66, 108, 732, + 81, 81, 66, 67, 67, 67, 67, 67, 67, 67, + 81, 111, 108, 68, 67, 68, 68, 68, 68, 68, + 68, 117, 128, 117, 130, 111, 157, 160, 66, 128, + 133, 133, 157, 160, 117, 733, 133, 735, 130, 132, + 67, 132, 132, 132, 132, 132, 132, 133, 136, 136, + 136, 146, 146, 169, 136, 147, 147, 146, 161, 161, + 736, 147, 219, 169, 161, 136, 218, 287, 146, 243, + 287, 161, 147, 162, 162, 161, 163, 163, 218, 162, + 219, 243, 163, 173, 173, 173, 173, 737, 500, 738, + + 162, 500, 741, 163, 174, 174, 174, 174, 175, 175, + 175, 175, 176, 176, 176, 176, 177, 177, 177, 177, + 178, 178, 178, 178, 179, 179, 179, 179, 181, 181, + 181, 181, 181, 181, 742, 745, 749, 182, 181, 182, + 182, 182, 182, 182, 182, 183, 183, 183, 183, 183, + 183, 184, 184, 184, 184, 184, 184, 255, 255, 255, + 255, 255, 255, 259, 181, 256, 256, 256, 256, 256, + 256, 257, 257, 271, 271, 751, 259, 257, 276, 271, + 289, 289, 753, 290, 290, 756, 289, 757, 257, 290, + 271, 276, 291, 291, 567, 567, 761, 289, 291, 299, + + 290, 299, 763, 299, 302, 302, 302, 302, 765, 291, + 303, 303, 303, 303, 771, 567, 299, 304, 304, 304, + 304, 305, 305, 305, 305, 306, 306, 306, 306, 307, + 307, 307, 307, 307, 307, 308, 308, 308, 308, 308, + 308, 375, 427, 427, 768, 768, 772, 777, 719, 717, + 714, 712, 710, 709, 707, 706, 705, 375, 704, 703, + 702, 699, 698, 696, 427, 776, 776, 776, 778, 778, + 695, 694, 693, 692, 691, 689, 688, 687, 685, 683, + 682, 679, 676, 675, 663, 662, 661, 651, 650, 649, + 648, 628, 621, 620, 617, 616, 615, 614, 613, 612, + + 611, 610, 609, 608, 606, 603, 602, 601, 600, 599, + 598, 597, 596, 595, 594, 593, 591, 590, 589, 588, + 586, 584, 583, 582, 581, 580, 579, 578, 577, 576, + 575, 574, 573, 572, 571, 570, 569, 568, 566, 565, + 564, 563, 562, 561, 560, 559, 558, 557, 556, 555, + 554, 551, 550, 549, 548, 547, 546, 545, 544, 543, + 542, 541, 540, 539, 538, 537, 536, 535, 534, 533, + 531, 530, 529, 528, 527, 526, 525, 524, 523, 522, + 521, 520, 519, 518, 517, 516, 514, 513, 512, 511, + 510, 508, 507, 506, 505, 504, 503, 502, 499, 498, + + 496, 495, 494, 493, 490, 489, 488, 487, 486, 485, + 484, 482, 481, 480, 479, 478, 477, 476, 475, 474, 473, 472, 471, 470, 469, 468, 467, 466, 465, 464, - 463, 462, 461, 460, 459, 458, 456, 455, 454, 453, - 452, 450, 449, 448, 447, 446, 445, 444, 441, 440, - 438, 437, 436, 435, 432, 431, 430, 429, 428, 427, - 426, 424, 423, 422, 421, 420, 419, 418, 417, 416, - 415, 414, 413, 412, 411, 410, 409, 408, 406, 405, - 404, 403, 402, 401, 400, 399, 398, 397, 396, 395, - 394, 393, 392, 391, 390, 389, 388, 387, 384, 383, - - 382, 379, 378, 377, 376, 375, 374, 372, 370, 369, - 368, 366, 365, 364, 363, 362, 361, 360, 359, 358, - 357, 356, 355, 354, 353, 352, 351, 350, 349, 347, - 346, 345, 344, 343, 342, 341, 338, 337, 336, 333, - 332, 331, 330, 329, 328, 327, 326, 325, 324, 322, - 321, 320, 319, 318, 317, 316, 315, 313, 312, 311, - 310, 309, 308, 307, 306, 305, 304, 303, 302, 301, - 300, 299, 298, 297, 296, 295, 294, 292, 291, 290, - 289, 288, 287, 286, 285, 277, 276, 274, 273, 272, - 271, 270, 269, 264, 262, 261, 260, 259, 258, 257, - - 256, 255, 253, 251, 250, 248, 246, 245, 242, 241, - 240, 239, 238, 237, 236, 234, 230, 229, 228, 227, - 226, 225, 224, 223, 222, 221, 220, 219, 218, 217, - 216, 215, 214, 213, 212, 211, 210, 209, 208, 207, - 206, 205, 204, 203, 202, 201, 200, 199, 198, 197, - 195, 194, 192, 191, 189, 187, 186, 185, 184, 183, - 182, 181, 180, 179, 177, 175, 162, 161, 160, 158, - 157, 156, 155, 154, 148, 146, 145, 144, 143, 142, - 141, 140, 139, 138, 135, 134, 133, 132, 131, 129, - 128, 127, 125, 124, 121, 119, 117, 116, 115, 114, - - 113, 112, 111, 110, 107, 106, 105, 104, 103, 102, - 101, 100, 99, 98, 97, 96, 95, 94, 93, 92, - 91, 89, 88, 87, 86, 85, 84, 83, 81, 80, - 78, 77, 76, 75, 73, 72, 71, 55, 54, 51, - 50, 37, 36, 34, 33, 32, 31, 30, 29, 28, - 20, 8, 7, 3, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, - 674, 674 + 463, 462, 461, 460, 459, 458, 457, 456, 455, 454, + 453, 452, 451, 449, 448, 447, 446, 445, 444, 443, + 442, 441, 440, 439, 438, 437, 436, 435, 434, 433, + 432, 431, 430, 429, 428, 425, 424, 423, 420, 419, + 418, 417, 416, 415, 413, 411, 410, 409, 407, 406, + 405, 404, 403, 402, 401, 400, 399, 398, 397, 396, + 395, 394, 393, 392, 391, 390, 388, 387, 386, 385, + + 384, 383, 382, 379, 378, 377, 374, 373, 372, 371, + 370, 369, 368, 367, 366, 365, 364, 363, 362, 361, + 359, 358, 357, 356, 355, 354, 353, 352, 351, 350, + 349, 348, 347, 346, 345, 343, 342, 341, 340, 339, + 338, 337, 336, 335, 334, 333, 332, 331, 330, 329, + 328, 327, 326, 325, 324, 323, 322, 321, 320, 319, + 318, 316, 315, 314, 313, 312, 311, 310, 309, 301, + 300, 298, 297, 296, 295, 294, 293, 288, 286, 285, + 284, 283, 282, 281, 280, 279, 277, 275, 274, 272, + 270, 269, 266, 265, 264, 263, 262, 261, 260, 258, + + 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, + 244, 242, 241, 240, 239, 238, 237, 236, 235, 234, + 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, + 223, 222, 221, 220, 217, 216, 215, 214, 213, 212, + 211, 210, 209, 207, 206, 204, 203, 201, 199, 198, + 197, 196, 195, 194, 193, 192, 191, 190, 189, 187, + 185, 172, 171, 170, 168, 167, 166, 165, 164, 158, + 156, 155, 154, 153, 152, 151, 150, 149, 148, 145, + 144, 143, 142, 141, 139, 138, 137, 135, 134, 131, + 129, 127, 126, 125, 124, 123, 122, 121, 120, 119, + + 118, 115, 114, 113, 112, 110, 109, 107, 106, 105, + 104, 103, 102, 101, 100, 98, 97, 96, 95, 94, + 93, 91, 90, 89, 88, 87, 86, 85, 83, 82, + 79, 78, 77, 76, 74, 73, 72, 56, 55, 52, + 51, 38, 37, 35, 34, 33, 32, 31, 30, 28, + 20, 8, 7, 3, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775 } ; /* The intent behind this definition is that it'll catch @@ -916,6 +971,7 @@ static yyconst flex_int16_t yy_chk[1023] = #define require_ARB_vp (yyextra->mode == ARB_vertex) #define require_ARB_fp (yyextra->mode == ARB_fragment) +#define require_NV_fp (yyextra->option.NV_fragment) #define require_shadow (yyextra->option.Shadow) #define require_rect (yyextra->option.TexRect) #define require_texarray (yyextra->option.TexArray) @@ -1011,7 +1067,7 @@ swiz_from_char(char c) } while(0); #define YY_EXTRA_TYPE struct asm_parser_state * -#line 1015 "lex.yy.c" +#line 1071 "lex.yy.c" #define INITIAL 0 @@ -1257,10 +1313,10 @@ YY_DECL register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 135 "program_lexer.l" +#line 136 "program_lexer.l" -#line 1264 "lex.yy.c" +#line 1320 "lex.yy.c" yylval = yylval_param; @@ -1317,13 +1373,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 675 ) + if ( yy_current_state >= 776 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 955 ); + while ( yy_base[yy_current_state] != 1055 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -1349,17 +1405,17 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 137 "program_lexer.l" +#line 138 "program_lexer.l" { return ARBvp_10; } YY_BREAK case 2: YY_RULE_SETUP -#line 138 "program_lexer.l" +#line 139 "program_lexer.l" { return ARBfp_10; } YY_BREAK case 3: YY_RULE_SETUP -#line 139 "program_lexer.l" +#line 140 "program_lexer.l" { yylval->integer = at_address; return_token_or_IDENTIFIER(require_ARB_vp, ADDRESS); @@ -1367,813 +1423,983 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 143 "program_lexer.l" +#line 144 "program_lexer.l" { return ALIAS; } YY_BREAK case 5: YY_RULE_SETUP -#line 144 "program_lexer.l" +#line 145 "program_lexer.l" { return ATTRIB; } YY_BREAK case 6: YY_RULE_SETUP -#line 145 "program_lexer.l" +#line 146 "program_lexer.l" { return END; } YY_BREAK case 7: YY_RULE_SETUP -#line 146 "program_lexer.l" +#line 147 "program_lexer.l" { return OPTION; } YY_BREAK case 8: YY_RULE_SETUP -#line 147 "program_lexer.l" +#line 148 "program_lexer.l" { return OUTPUT; } YY_BREAK case 9: YY_RULE_SETUP -#line 148 "program_lexer.l" +#line 149 "program_lexer.l" { return PARAM; } YY_BREAK case 10: YY_RULE_SETUP -#line 149 "program_lexer.l" +#line 150 "program_lexer.l" { yylval->integer = at_temp; return TEMP; } YY_BREAK case 11: YY_RULE_SETUP -#line 151 "program_lexer.l" +#line 152 "program_lexer.l" { return_opcode( 1, VECTOR_OP, ABS, OFF); } YY_BREAK case 12: YY_RULE_SETUP -#line 152 "program_lexer.l" +#line 153 "program_lexer.l" { return_opcode(require_ARB_fp, VECTOR_OP, ABS, ZERO_ONE); } YY_BREAK case 13: YY_RULE_SETUP -#line 153 "program_lexer.l" +#line 154 "program_lexer.l" { return_opcode( 1, BIN_OP, ADD, OFF); } YY_BREAK case 14: YY_RULE_SETUP -#line 154 "program_lexer.l" +#line 155 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, ADD, ZERO_ONE); } YY_BREAK case 15: YY_RULE_SETUP -#line 155 "program_lexer.l" +#line 156 "program_lexer.l" { return_opcode(require_ARB_vp, ARL, ARL, OFF); } YY_BREAK case 16: YY_RULE_SETUP -#line 157 "program_lexer.l" +#line 158 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, CMP, OFF); } YY_BREAK case 17: YY_RULE_SETUP -#line 158 "program_lexer.l" +#line 159 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, CMP, ZERO_ONE); } YY_BREAK case 18: YY_RULE_SETUP -#line 159 "program_lexer.l" +#line 160 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, COS, OFF); } YY_BREAK case 19: YY_RULE_SETUP -#line 160 "program_lexer.l" +#line 161 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, COS, ZERO_ONE); } YY_BREAK case 20: YY_RULE_SETUP -#line 162 "program_lexer.l" -{ return_opcode( 1, BIN_OP, DP3, OFF); } +#line 163 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, DDX, OFF); } YY_BREAK case 21: YY_RULE_SETUP -#line 163 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, DP3, ZERO_ONE); } +#line 164 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, DDX, ZERO_ONE); } YY_BREAK case 22: YY_RULE_SETUP -#line 164 "program_lexer.l" -{ return_opcode( 1, BIN_OP, DP4, OFF); } +#line 165 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, DDY, OFF); } YY_BREAK case 23: YY_RULE_SETUP -#line 165 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, DP4, ZERO_ONE); } +#line 166 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, DDY, ZERO_ONE); } YY_BREAK case 24: YY_RULE_SETUP -#line 166 "program_lexer.l" -{ return_opcode( 1, BIN_OP, DPH, OFF); } +#line 167 "program_lexer.l" +{ return_opcode( 1, BIN_OP, DP3, OFF); } YY_BREAK case 25: YY_RULE_SETUP -#line 167 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, DPH, ZERO_ONE); } +#line 168 "program_lexer.l" +{ return_opcode(require_ARB_fp, BIN_OP, DP3, ZERO_ONE); } YY_BREAK case 26: YY_RULE_SETUP -#line 168 "program_lexer.l" -{ return_opcode( 1, BIN_OP, DST, OFF); } +#line 169 "program_lexer.l" +{ return_opcode( 1, BIN_OP, DP4, OFF); } YY_BREAK case 27: YY_RULE_SETUP -#line 169 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, DST, ZERO_ONE); } +#line 170 "program_lexer.l" +{ return_opcode(require_ARB_fp, BIN_OP, DP4, ZERO_ONE); } YY_BREAK case 28: YY_RULE_SETUP #line 171 "program_lexer.l" -{ return_opcode( 1, SCALAR_OP, EX2, OFF); } +{ return_opcode( 1, BIN_OP, DPH, OFF); } YY_BREAK case 29: YY_RULE_SETUP #line 172 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, EX2, ZERO_ONE); } +{ return_opcode(require_ARB_fp, BIN_OP, DPH, ZERO_ONE); } YY_BREAK case 30: YY_RULE_SETUP #line 173 "program_lexer.l" -{ return_opcode(require_ARB_vp, SCALAR_OP, EXP, OFF); } +{ return_opcode( 1, BIN_OP, DST, OFF); } YY_BREAK case 31: YY_RULE_SETUP -#line 175 "program_lexer.l" -{ return_opcode( 1, VECTOR_OP, FLR, OFF); } +#line 174 "program_lexer.l" +{ return_opcode(require_ARB_fp, BIN_OP, DST, ZERO_ONE); } YY_BREAK case 32: YY_RULE_SETUP #line 176 "program_lexer.l" -{ return_opcode(require_ARB_fp, VECTOR_OP, FLR, ZERO_ONE); } +{ return_opcode( 1, SCALAR_OP, EX2, OFF); } YY_BREAK case 33: YY_RULE_SETUP #line 177 "program_lexer.l" -{ return_opcode( 1, VECTOR_OP, FRC, OFF); } +{ return_opcode(require_ARB_fp, SCALAR_OP, EX2, ZERO_ONE); } YY_BREAK case 34: YY_RULE_SETUP #line 178 "program_lexer.l" -{ return_opcode(require_ARB_fp, VECTOR_OP, FRC, ZERO_ONE); } +{ return_opcode(require_ARB_vp, SCALAR_OP, EXP, OFF); } YY_BREAK case 35: YY_RULE_SETUP #line 180 "program_lexer.l" -{ return_opcode(require_ARB_fp, KIL, KIL, OFF); } +{ return_opcode( 1, VECTOR_OP, FLR, OFF); } YY_BREAK case 36: YY_RULE_SETUP -#line 182 "program_lexer.l" -{ return_opcode( 1, VECTOR_OP, LIT, OFF); } +#line 181 "program_lexer.l" +{ return_opcode(require_ARB_fp, VECTOR_OP, FLR, ZERO_ONE); } YY_BREAK case 37: YY_RULE_SETUP -#line 183 "program_lexer.l" -{ return_opcode(require_ARB_fp, VECTOR_OP, LIT, ZERO_ONE); } +#line 182 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, FRC, OFF); } YY_BREAK case 38: YY_RULE_SETUP -#line 184 "program_lexer.l" -{ return_opcode( 1, SCALAR_OP, LG2, OFF); } +#line 183 "program_lexer.l" +{ return_opcode(require_ARB_fp, VECTOR_OP, FRC, ZERO_ONE); } YY_BREAK case 39: YY_RULE_SETUP #line 185 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, LG2, ZERO_ONE); } +{ return_opcode(require_ARB_fp, KIL, KIL, OFF); } YY_BREAK case 40: YY_RULE_SETUP -#line 186 "program_lexer.l" -{ return_opcode(require_ARB_vp, SCALAR_OP, LOG, OFF); } +#line 187 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, LIT, OFF); } YY_BREAK case 41: YY_RULE_SETUP -#line 187 "program_lexer.l" -{ return_opcode(require_ARB_fp, TRI_OP, LRP, OFF); } +#line 188 "program_lexer.l" +{ return_opcode(require_ARB_fp, VECTOR_OP, LIT, ZERO_ONE); } YY_BREAK case 42: YY_RULE_SETUP -#line 188 "program_lexer.l" -{ return_opcode(require_ARB_fp, TRI_OP, LRP, ZERO_ONE); } +#line 189 "program_lexer.l" +{ return_opcode( 1, SCALAR_OP, LG2, OFF); } YY_BREAK case 43: YY_RULE_SETUP #line 190 "program_lexer.l" -{ return_opcode( 1, TRI_OP, MAD, OFF); } +{ return_opcode(require_ARB_fp, SCALAR_OP, LG2, ZERO_ONE); } YY_BREAK case 44: YY_RULE_SETUP #line 191 "program_lexer.l" -{ return_opcode(require_ARB_fp, TRI_OP, MAD, ZERO_ONE); } +{ return_opcode(require_ARB_vp, SCALAR_OP, LOG, OFF); } YY_BREAK case 45: YY_RULE_SETUP #line 192 "program_lexer.l" -{ return_opcode( 1, BIN_OP, MAX, OFF); } +{ return_opcode(require_ARB_fp, TRI_OP, LRP, OFF); } YY_BREAK case 46: YY_RULE_SETUP #line 193 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, MAX, ZERO_ONE); } +{ return_opcode(require_ARB_fp, TRI_OP, LRP, ZERO_ONE); } YY_BREAK case 47: YY_RULE_SETUP -#line 194 "program_lexer.l" -{ return_opcode( 1, BIN_OP, MIN, OFF); } +#line 195 "program_lexer.l" +{ return_opcode( 1, TRI_OP, MAD, OFF); } YY_BREAK case 48: YY_RULE_SETUP -#line 195 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, MIN, ZERO_ONE); } +#line 196 "program_lexer.l" +{ return_opcode(require_ARB_fp, TRI_OP, MAD, ZERO_ONE); } YY_BREAK case 49: YY_RULE_SETUP -#line 196 "program_lexer.l" -{ return_opcode( 1, VECTOR_OP, MOV, OFF); } +#line 197 "program_lexer.l" +{ return_opcode( 1, BIN_OP, MAX, OFF); } YY_BREAK case 50: YY_RULE_SETUP -#line 197 "program_lexer.l" -{ return_opcode(require_ARB_fp, VECTOR_OP, MOV, ZERO_ONE); } +#line 198 "program_lexer.l" +{ return_opcode(require_ARB_fp, BIN_OP, MAX, ZERO_ONE); } YY_BREAK case 51: YY_RULE_SETUP -#line 198 "program_lexer.l" -{ return_opcode( 1, BIN_OP, MUL, OFF); } +#line 199 "program_lexer.l" +{ return_opcode( 1, BIN_OP, MIN, OFF); } YY_BREAK case 52: YY_RULE_SETUP -#line 199 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, MUL, ZERO_ONE); } +#line 200 "program_lexer.l" +{ return_opcode(require_ARB_fp, BIN_OP, MIN, ZERO_ONE); } YY_BREAK case 53: YY_RULE_SETUP #line 201 "program_lexer.l" -{ return_opcode( 1, BINSC_OP, POW, OFF); } +{ return_opcode( 1, VECTOR_OP, MOV, OFF); } YY_BREAK case 54: YY_RULE_SETUP #line 202 "program_lexer.l" -{ return_opcode(require_ARB_fp, BINSC_OP, POW, ZERO_ONE); } +{ return_opcode(require_ARB_fp, VECTOR_OP, MOV, ZERO_ONE); } YY_BREAK case 55: YY_RULE_SETUP -#line 204 "program_lexer.l" -{ return_opcode( 1, SCALAR_OP, RCP, OFF); } +#line 203 "program_lexer.l" +{ return_opcode( 1, BIN_OP, MUL, OFF); } YY_BREAK case 56: YY_RULE_SETUP -#line 205 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, RCP, ZERO_ONE); } +#line 204 "program_lexer.l" +{ return_opcode(require_ARB_fp, BIN_OP, MUL, ZERO_ONE); } YY_BREAK case 57: YY_RULE_SETUP #line 206 "program_lexer.l" -{ return_opcode( 1, SCALAR_OP, RSQ, OFF); } +{ return_opcode(require_NV_fp, VECTOR_OP, PK2H, OFF); } YY_BREAK case 58: YY_RULE_SETUP #line 207 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, RSQ, ZERO_ONE); } +{ return_opcode(require_NV_fp, VECTOR_OP, PK2H, ZERO_ONE); } YY_BREAK case 59: YY_RULE_SETUP -#line 209 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, SCS, OFF); } +#line 208 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, PK2US, OFF); } YY_BREAK case 60: YY_RULE_SETUP -#line 210 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, SCS, ZERO_ONE); } +#line 209 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, PK2US, ZERO_ONE); } YY_BREAK case 61: YY_RULE_SETUP -#line 211 "program_lexer.l" -{ return_opcode( 1, BIN_OP, SGE, OFF); } +#line 210 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, PK4B, OFF); } YY_BREAK case 62: YY_RULE_SETUP -#line 212 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, SGE, ZERO_ONE); } +#line 211 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, PK4B, ZERO_ONE); } YY_BREAK case 63: YY_RULE_SETUP -#line 213 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, SIN, OFF); } +#line 212 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, PK4UB, OFF); } YY_BREAK case 64: YY_RULE_SETUP -#line 214 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, SIN, ZERO_ONE); } +#line 213 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, PK4UB, ZERO_ONE); } YY_BREAK case 65: YY_RULE_SETUP -#line 215 "program_lexer.l" -{ return_opcode( 1, BIN_OP, SLT, OFF); } +#line 214 "program_lexer.l" +{ return_opcode( 1, BINSC_OP, POW, OFF); } YY_BREAK case 66: YY_RULE_SETUP -#line 216 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, SLT, ZERO_ONE); } +#line 215 "program_lexer.l" +{ return_opcode(require_ARB_fp, BINSC_OP, POW, ZERO_ONE); } YY_BREAK case 67: YY_RULE_SETUP #line 217 "program_lexer.l" -{ return_opcode( 1, BIN_OP, SUB, OFF); } +{ return_opcode( 1, SCALAR_OP, RCP, OFF); } YY_BREAK case 68: YY_RULE_SETUP #line 218 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, SUB, ZERO_ONE); } +{ return_opcode(require_ARB_fp, SCALAR_OP, RCP, ZERO_ONE); } YY_BREAK case 69: YY_RULE_SETUP #line 219 "program_lexer.l" -{ return_opcode( 1, SWZ, SWZ, OFF); } +{ return_opcode(require_NV_fp, BIN_OP, RFL, OFF); } YY_BREAK case 70: YY_RULE_SETUP #line 220 "program_lexer.l" -{ return_opcode(require_ARB_fp, SWZ, SWZ, ZERO_ONE); } +{ return_opcode(require_NV_fp, BIN_OP, RFL, ZERO_ONE); } YY_BREAK case 71: YY_RULE_SETUP -#line 222 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TEX, OFF); } +#line 221 "program_lexer.l" +{ return_opcode( 1, SCALAR_OP, RSQ, OFF); } YY_BREAK case 72: YY_RULE_SETUP -#line 223 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TEX, ZERO_ONE); } +#line 222 "program_lexer.l" +{ return_opcode(require_ARB_fp, SCALAR_OP, RSQ, ZERO_ONE); } YY_BREAK case 73: YY_RULE_SETUP #line 224 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TXB, OFF); } +{ return_opcode(require_ARB_fp, SCALAR_OP, SCS, OFF); } YY_BREAK case 74: YY_RULE_SETUP #line 225 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TXB, ZERO_ONE); } +{ return_opcode(require_ARB_fp, SCALAR_OP, SCS, ZERO_ONE); } YY_BREAK case 75: YY_RULE_SETUP #line 226 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TXP, OFF); } +{ return_opcode(require_NV_fp, BIN_OP, SEQ, OFF); } YY_BREAK case 76: YY_RULE_SETUP #line 227 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TXP, ZERO_ONE); } +{ return_opcode(require_NV_fp, BIN_OP, SEQ, ZERO_ONE); } YY_BREAK case 77: YY_RULE_SETUP -#line 229 "program_lexer.l" -{ return_opcode( 1, BIN_OP, XPD, OFF); } +#line 228 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SFL, OFF); } YY_BREAK case 78: YY_RULE_SETUP -#line 230 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, XPD, ZERO_ONE); } +#line 229 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SFL, ZERO_ONE); } YY_BREAK case 79: YY_RULE_SETUP -#line 232 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_vp, VERTEX); } +#line 230 "program_lexer.l" +{ return_opcode( 1, BIN_OP, SGE, OFF); } YY_BREAK case 80: YY_RULE_SETUP -#line 233 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, FRAGMENT); } +#line 231 "program_lexer.l" +{ return_opcode(require_ARB_fp, BIN_OP, SGE, ZERO_ONE); } YY_BREAK case 81: YY_RULE_SETUP -#line 234 "program_lexer.l" -{ return PROGRAM; } +#line 232 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SGT, OFF); } YY_BREAK case 82: YY_RULE_SETUP -#line 235 "program_lexer.l" -{ return STATE; } +#line 233 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SGT, ZERO_ONE); } YY_BREAK case 83: YY_RULE_SETUP -#line 236 "program_lexer.l" -{ return RESULT; } +#line 234 "program_lexer.l" +{ return_opcode(require_ARB_fp, SCALAR_OP, SIN, OFF); } YY_BREAK case 84: YY_RULE_SETUP -#line 238 "program_lexer.l" -{ return AMBIENT; } +#line 235 "program_lexer.l" +{ return_opcode(require_ARB_fp, SCALAR_OP, SIN, ZERO_ONE); } YY_BREAK case 85: YY_RULE_SETUP -#line 239 "program_lexer.l" -{ return ATTENUATION; } +#line 236 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SLE, OFF); } YY_BREAK case 86: YY_RULE_SETUP -#line 240 "program_lexer.l" -{ return BACK; } +#line 237 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SLE, ZERO_ONE); } YY_BREAK case 87: YY_RULE_SETUP -#line 241 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, CLIP); } +#line 238 "program_lexer.l" +{ return_opcode( 1, BIN_OP, SLT, OFF); } YY_BREAK case 88: YY_RULE_SETUP -#line 242 "program_lexer.l" -{ return COLOR; } +#line 239 "program_lexer.l" +{ return_opcode(require_ARB_fp, BIN_OP, SLT, ZERO_ONE); } YY_BREAK case 89: YY_RULE_SETUP -#line 243 "program_lexer.l" -{ return_token_or_DOT(require_ARB_fp, DEPTH); } +#line 240 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SNE, OFF); } YY_BREAK case 90: YY_RULE_SETUP -#line 244 "program_lexer.l" -{ return DIFFUSE; } +#line 241 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SNE, ZERO_ONE); } YY_BREAK case 91: YY_RULE_SETUP -#line 245 "program_lexer.l" -{ return DIRECTION; } +#line 242 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, STR, OFF); } YY_BREAK case 92: YY_RULE_SETUP -#line 246 "program_lexer.l" -{ return EMISSION; } +#line 243 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, STR, ZERO_ONE); } YY_BREAK case 93: YY_RULE_SETUP -#line 247 "program_lexer.l" -{ return ENV; } +#line 244 "program_lexer.l" +{ return_opcode( 1, BIN_OP, SUB, OFF); } YY_BREAK case 94: YY_RULE_SETUP -#line 248 "program_lexer.l" -{ return EYE; } +#line 245 "program_lexer.l" +{ return_opcode(require_ARB_fp, BIN_OP, SUB, ZERO_ONE); } YY_BREAK case 95: YY_RULE_SETUP -#line 249 "program_lexer.l" -{ return FOGCOORD; } +#line 246 "program_lexer.l" +{ return_opcode( 1, SWZ, SWZ, OFF); } YY_BREAK case 96: YY_RULE_SETUP -#line 250 "program_lexer.l" -{ return FOG; } +#line 247 "program_lexer.l" +{ return_opcode(require_ARB_fp, SWZ, SWZ, ZERO_ONE); } YY_BREAK case 97: YY_RULE_SETUP -#line 251 "program_lexer.l" -{ return FRONT; } +#line 249 "program_lexer.l" +{ return_opcode(require_ARB_fp, SAMPLE_OP, TEX, OFF); } YY_BREAK case 98: YY_RULE_SETUP -#line 252 "program_lexer.l" -{ return HALF; } +#line 250 "program_lexer.l" +{ return_opcode(require_ARB_fp, SAMPLE_OP, TEX, ZERO_ONE); } YY_BREAK case 99: YY_RULE_SETUP -#line 253 "program_lexer.l" -{ return INVERSE; } +#line 251 "program_lexer.l" +{ return_opcode(require_ARB_fp, SAMPLE_OP, TXB, OFF); } YY_BREAK case 100: YY_RULE_SETUP -#line 254 "program_lexer.l" -{ return INVTRANS; } +#line 252 "program_lexer.l" +{ return_opcode(require_ARB_fp, SAMPLE_OP, TXB, ZERO_ONE); } YY_BREAK case 101: YY_RULE_SETUP -#line 255 "program_lexer.l" -{ return LIGHT; } +#line 253 "program_lexer.l" +{ return_opcode(require_NV_fp, TXD_OP, TXD, OFF); } YY_BREAK case 102: YY_RULE_SETUP -#line 256 "program_lexer.l" -{ return LIGHTMODEL; } +#line 254 "program_lexer.l" +{ return_opcode(require_NV_fp, TXD_OP, TXD, ZERO_ONE); } YY_BREAK case 103: YY_RULE_SETUP -#line 257 "program_lexer.l" -{ return LIGHTPROD; } +#line 255 "program_lexer.l" +{ return_opcode(require_ARB_fp, SAMPLE_OP, TXP, OFF); } YY_BREAK case 104: YY_RULE_SETUP -#line 258 "program_lexer.l" -{ return LOCAL; } +#line 256 "program_lexer.l" +{ return_opcode(require_ARB_fp, SAMPLE_OP, TXP, ZERO_ONE); } YY_BREAK case 105: YY_RULE_SETUP -#line 259 "program_lexer.l" -{ return MATERIAL; } +#line 258 "program_lexer.l" +{ return_opcode(require_NV_fp, SCALAR_OP, UP2H, OFF); } YY_BREAK case 106: YY_RULE_SETUP -#line 260 "program_lexer.l" -{ return MAT_PROGRAM; } +#line 259 "program_lexer.l" +{ return_opcode(require_NV_fp, SCALAR_OP, UP2H, ZERO_ONE); } YY_BREAK case 107: YY_RULE_SETUP -#line 261 "program_lexer.l" -{ return MATRIX; } +#line 260 "program_lexer.l" +{ return_opcode(require_NV_fp, SCALAR_OP, UP2US, OFF); } YY_BREAK case 108: YY_RULE_SETUP -#line 262 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, MATRIXINDEX); } +#line 261 "program_lexer.l" +{ return_opcode(require_NV_fp, SCALAR_OP, UP2US, ZERO_ONE); } YY_BREAK case 109: YY_RULE_SETUP #line 263 "program_lexer.l" -{ return MODELVIEW; } +{ return_opcode(require_NV_fp, TRI_OP, X2D, OFF); } YY_BREAK case 110: YY_RULE_SETUP #line 264 "program_lexer.l" -{ return MVP; } +{ return_opcode(require_NV_fp, TRI_OP, X2D, ZERO_ONE); } YY_BREAK case 111: YY_RULE_SETUP #line 265 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, NORMAL); } +{ return_opcode( 1, BIN_OP, XPD, OFF); } YY_BREAK case 112: YY_RULE_SETUP #line 266 "program_lexer.l" -{ return OBJECT; } +{ return_opcode(require_ARB_fp, BIN_OP, XPD, ZERO_ONE); } YY_BREAK case 113: YY_RULE_SETUP -#line 267 "program_lexer.l" -{ return PALETTE; } +#line 268 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_vp, VERTEX); } YY_BREAK case 114: YY_RULE_SETUP -#line 268 "program_lexer.l" -{ return PARAMS; } +#line 269 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, FRAGMENT); } YY_BREAK case 115: YY_RULE_SETUP -#line 269 "program_lexer.l" -{ return PLANE; } +#line 270 "program_lexer.l" +{ return PROGRAM; } YY_BREAK case 116: YY_RULE_SETUP -#line 270 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, POINT); } +#line 271 "program_lexer.l" +{ return STATE; } YY_BREAK case 117: YY_RULE_SETUP -#line 271 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, POINTSIZE); } +#line 272 "program_lexer.l" +{ return RESULT; } YY_BREAK case 118: YY_RULE_SETUP -#line 272 "program_lexer.l" -{ return POSITION; } +#line 274 "program_lexer.l" +{ return AMBIENT; } YY_BREAK case 119: YY_RULE_SETUP -#line 273 "program_lexer.l" -{ return PRIMARY; } +#line 275 "program_lexer.l" +{ return ATTENUATION; } YY_BREAK case 120: YY_RULE_SETUP -#line 274 "program_lexer.l" -{ return PROJECTION; } +#line 276 "program_lexer.l" +{ return BACK; } YY_BREAK case 121: YY_RULE_SETUP -#line 275 "program_lexer.l" -{ return_token_or_DOT(require_ARB_fp, RANGE); } +#line 277 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, CLIP); } YY_BREAK case 122: YY_RULE_SETUP -#line 276 "program_lexer.l" -{ return ROW; } +#line 278 "program_lexer.l" +{ return COLOR; } YY_BREAK case 123: YY_RULE_SETUP -#line 277 "program_lexer.l" -{ return SCENECOLOR; } +#line 279 "program_lexer.l" +{ return_token_or_DOT(require_ARB_fp, DEPTH); } YY_BREAK case 124: YY_RULE_SETUP -#line 278 "program_lexer.l" -{ return SECONDARY; } +#line 280 "program_lexer.l" +{ return DIFFUSE; } YY_BREAK case 125: YY_RULE_SETUP -#line 279 "program_lexer.l" -{ return SHININESS; } +#line 281 "program_lexer.l" +{ return DIRECTION; } YY_BREAK case 126: YY_RULE_SETUP -#line 280 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, SIZE); } +#line 282 "program_lexer.l" +{ return EMISSION; } YY_BREAK case 127: YY_RULE_SETUP -#line 281 "program_lexer.l" -{ return SPECULAR; } +#line 283 "program_lexer.l" +{ return ENV; } YY_BREAK case 128: YY_RULE_SETUP -#line 282 "program_lexer.l" -{ return SPOT; } +#line 284 "program_lexer.l" +{ return EYE; } YY_BREAK case 129: YY_RULE_SETUP -#line 283 "program_lexer.l" -{ return TEXCOORD; } +#line 285 "program_lexer.l" +{ return FOGCOORD; } YY_BREAK case 130: YY_RULE_SETUP -#line 284 "program_lexer.l" -{ return_token_or_DOT(require_ARB_fp, TEXENV); } +#line 286 "program_lexer.l" +{ return FOG; } YY_BREAK case 131: YY_RULE_SETUP -#line 285 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, TEXGEN); } +#line 287 "program_lexer.l" +{ return FRONT; } YY_BREAK case 132: YY_RULE_SETUP -#line 286 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, TEXGEN_Q); } +#line 288 "program_lexer.l" +{ return HALF; } YY_BREAK case 133: YY_RULE_SETUP -#line 287 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, TEXGEN_S); } +#line 289 "program_lexer.l" +{ return INVERSE; } YY_BREAK case 134: YY_RULE_SETUP -#line 288 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, TEXGEN_T); } +#line 290 "program_lexer.l" +{ return INVTRANS; } YY_BREAK case 135: YY_RULE_SETUP -#line 289 "program_lexer.l" -{ return TEXTURE; } +#line 291 "program_lexer.l" +{ return LIGHT; } YY_BREAK case 136: YY_RULE_SETUP -#line 290 "program_lexer.l" -{ return TRANSPOSE; } +#line 292 "program_lexer.l" +{ return LIGHTMODEL; } YY_BREAK case 137: YY_RULE_SETUP -#line 291 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, VTXATTRIB); } +#line 293 "program_lexer.l" +{ return LIGHTPROD; } YY_BREAK case 138: YY_RULE_SETUP -#line 292 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, WEIGHT); } +#line 294 "program_lexer.l" +{ return LOCAL; } YY_BREAK case 139: YY_RULE_SETUP -#line 294 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, TEXTURE_UNIT); } +#line 295 "program_lexer.l" +{ return MATERIAL; } YY_BREAK case 140: YY_RULE_SETUP -#line 295 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_1D); } +#line 296 "program_lexer.l" +{ return MAT_PROGRAM; } YY_BREAK case 141: YY_RULE_SETUP -#line 296 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_2D); } +#line 297 "program_lexer.l" +{ return MATRIX; } YY_BREAK case 142: YY_RULE_SETUP -#line 297 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_3D); } +#line 298 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, MATRIXINDEX); } YY_BREAK case 143: YY_RULE_SETUP -#line 298 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_CUBE); } +#line 299 "program_lexer.l" +{ return MODELVIEW; } YY_BREAK case 144: YY_RULE_SETUP -#line 299 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_rect, TEX_RECT); } +#line 300 "program_lexer.l" +{ return MVP; } YY_BREAK case 145: YY_RULE_SETUP -#line 300 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW1D); } +#line 301 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, NORMAL); } YY_BREAK case 146: YY_RULE_SETUP -#line 301 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW2D); } +#line 302 "program_lexer.l" +{ return OBJECT; } YY_BREAK case 147: YY_RULE_SETUP -#line 302 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_rect, TEX_SHADOWRECT); } +#line 303 "program_lexer.l" +{ return PALETTE; } YY_BREAK case 148: YY_RULE_SETUP -#line 303 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY1D); } +#line 304 "program_lexer.l" +{ return PARAMS; } YY_BREAK case 149: YY_RULE_SETUP -#line 304 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY2D); } +#line 305 "program_lexer.l" +{ return PLANE; } YY_BREAK case 150: YY_RULE_SETUP -#line 305 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW1D); } +#line 306 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, POINT); } YY_BREAK case 151: YY_RULE_SETUP -#line 306 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW2D); } +#line 307 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, POINTSIZE); } YY_BREAK case 152: YY_RULE_SETUP #line 308 "program_lexer.l" +{ return POSITION; } + YY_BREAK +case 153: +YY_RULE_SETUP +#line 309 "program_lexer.l" +{ return PRIMARY; } + YY_BREAK +case 154: +YY_RULE_SETUP +#line 310 "program_lexer.l" +{ return PROJECTION; } + YY_BREAK +case 155: +YY_RULE_SETUP +#line 311 "program_lexer.l" +{ return_token_or_DOT(require_ARB_fp, RANGE); } + YY_BREAK +case 156: +YY_RULE_SETUP +#line 312 "program_lexer.l" +{ return ROW; } + YY_BREAK +case 157: +YY_RULE_SETUP +#line 313 "program_lexer.l" +{ return SCENECOLOR; } + YY_BREAK +case 158: +YY_RULE_SETUP +#line 314 "program_lexer.l" +{ return SECONDARY; } + YY_BREAK +case 159: +YY_RULE_SETUP +#line 315 "program_lexer.l" +{ return SHININESS; } + YY_BREAK +case 160: +YY_RULE_SETUP +#line 316 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, SIZE); } + YY_BREAK +case 161: +YY_RULE_SETUP +#line 317 "program_lexer.l" +{ return SPECULAR; } + YY_BREAK +case 162: +YY_RULE_SETUP +#line 318 "program_lexer.l" +{ return SPOT; } + YY_BREAK +case 163: +YY_RULE_SETUP +#line 319 "program_lexer.l" +{ return TEXCOORD; } + YY_BREAK +case 164: +YY_RULE_SETUP +#line 320 "program_lexer.l" +{ return_token_or_DOT(require_ARB_fp, TEXENV); } + YY_BREAK +case 165: +YY_RULE_SETUP +#line 321 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, TEXGEN); } + YY_BREAK +case 166: +YY_RULE_SETUP +#line 322 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, TEXGEN_Q); } + YY_BREAK +case 167: +YY_RULE_SETUP +#line 323 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, TEXGEN_S); } + YY_BREAK +case 168: +YY_RULE_SETUP +#line 324 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, TEXGEN_T); } + YY_BREAK +case 169: +YY_RULE_SETUP +#line 325 "program_lexer.l" +{ return TEXTURE; } + YY_BREAK +case 170: +YY_RULE_SETUP +#line 326 "program_lexer.l" +{ return TRANSPOSE; } + YY_BREAK +case 171: +YY_RULE_SETUP +#line 327 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, VTXATTRIB); } + YY_BREAK +case 172: +YY_RULE_SETUP +#line 328 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, WEIGHT); } + YY_BREAK +case 173: +YY_RULE_SETUP +#line 330 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, TEXTURE_UNIT); } + YY_BREAK +case 174: +YY_RULE_SETUP +#line 331 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_1D); } + YY_BREAK +case 175: +YY_RULE_SETUP +#line 332 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_2D); } + YY_BREAK +case 176: +YY_RULE_SETUP +#line 333 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_3D); } + YY_BREAK +case 177: +YY_RULE_SETUP +#line 334 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_CUBE); } + YY_BREAK +case 178: +YY_RULE_SETUP +#line 335 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_rect, TEX_RECT); } + YY_BREAK +case 179: +YY_RULE_SETUP +#line 336 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW1D); } + YY_BREAK +case 180: +YY_RULE_SETUP +#line 337 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW2D); } + YY_BREAK +case 181: +YY_RULE_SETUP +#line 338 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_rect, TEX_SHADOWRECT); } + YY_BREAK +case 182: +YY_RULE_SETUP +#line 339 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY1D); } + YY_BREAK +case 183: +YY_RULE_SETUP +#line 340 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY2D); } + YY_BREAK +case 184: +YY_RULE_SETUP +#line 341 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW1D); } + YY_BREAK +case 185: +YY_RULE_SETUP +#line 342 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW2D); } + YY_BREAK +case 186: +YY_RULE_SETUP +#line 344 "program_lexer.l" { yylval->string = strdup(yytext); return IDENTIFIER; } YY_BREAK -case 153: +case 187: YY_RULE_SETUP -#line 313 "program_lexer.l" +#line 349 "program_lexer.l" { return DOT_DOT; } YY_BREAK -case 154: +case 188: YY_RULE_SETUP -#line 315 "program_lexer.l" +#line 351 "program_lexer.l" { yylval->integer = strtol(yytext, NULL, 10); return INTEGER; } YY_BREAK -case 155: +case 189: YY_RULE_SETUP -#line 319 "program_lexer.l" +#line 355 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; } YY_BREAK -case 156: -/* rule 156 can match eol */ +case 190: +/* rule 190 can match eol */ *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 323 "program_lexer.l" +#line 359 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; } YY_BREAK -case 157: +case 191: YY_RULE_SETUP -#line 327 "program_lexer.l" +#line 363 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; } YY_BREAK -case 158: +case 192: YY_RULE_SETUP -#line 331 "program_lexer.l" +#line 367 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; } YY_BREAK -case 159: +case 193: YY_RULE_SETUP -#line 336 "program_lexer.l" +#line 372 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; return MASK4; } YY_BREAK -case 160: +case 194: YY_RULE_SETUP -#line 342 "program_lexer.l" +#line 378 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@ -2181,27 +2407,27 @@ YY_RULE_SETUP return MASK3; } YY_BREAK -case 161: +case 195: YY_RULE_SETUP -#line 348 "program_lexer.l" +#line 384 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; return MASK3; } YY_BREAK -case 162: +case 196: YY_RULE_SETUP -#line 353 "program_lexer.l" +#line 389 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; return MASK3; } YY_BREAK -case 163: +case 197: YY_RULE_SETUP -#line 359 "program_lexer.l" +#line 395 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@ -2209,9 +2435,9 @@ YY_RULE_SETUP return MASK2; } YY_BREAK -case 164: +case 198: YY_RULE_SETUP -#line 365 "program_lexer.l" +#line 401 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@ -2219,18 +2445,18 @@ YY_RULE_SETUP return MASK2; } YY_BREAK -case 165: +case 199: YY_RULE_SETUP -#line 371 "program_lexer.l" +#line 407 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; return MASK2; } YY_BREAK -case 166: +case 200: YY_RULE_SETUP -#line 377 "program_lexer.l" +#line 413 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@ -2238,9 +2464,9 @@ YY_RULE_SETUP return MASK1; } YY_BREAK -case 167: +case 201: YY_RULE_SETUP -#line 384 "program_lexer.l" +#line 420 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@ -2250,18 +2476,18 @@ YY_RULE_SETUP return SWIZZLE; } YY_BREAK -case 168: +case 202: YY_RULE_SETUP -#line 393 "program_lexer.l" +#line 429 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; return_token_or_DOT(require_ARB_fp, MASK4); } YY_BREAK -case 169: +case 203: YY_RULE_SETUP -#line 399 "program_lexer.l" +#line 435 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@ -2269,27 +2495,27 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK3); } YY_BREAK -case 170: +case 204: YY_RULE_SETUP -#line 405 "program_lexer.l" +#line 441 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; return_token_or_DOT(require_ARB_fp, MASK3); } YY_BREAK -case 171: +case 205: YY_RULE_SETUP -#line 410 "program_lexer.l" +#line 446 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; return_token_or_DOT(require_ARB_fp, MASK3); } YY_BREAK -case 172: +case 206: YY_RULE_SETUP -#line 416 "program_lexer.l" +#line 452 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@ -2297,9 +2523,9 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK2); } YY_BREAK -case 173: +case 207: YY_RULE_SETUP -#line 422 "program_lexer.l" +#line 458 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@ -2307,18 +2533,18 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK2); } YY_BREAK -case 174: +case 208: YY_RULE_SETUP -#line 428 "program_lexer.l" +#line 464 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; return_token_or_DOT(require_ARB_fp, MASK2); } YY_BREAK -case 175: +case 209: YY_RULE_SETUP -#line 434 "program_lexer.l" +#line 470 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@ -2326,9 +2552,9 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK1); } YY_BREAK -case 176: +case 210: YY_RULE_SETUP -#line 442 "program_lexer.l" +#line 478 "program_lexer.l" { if (require_ARB_vp) { return TEXGEN_R; @@ -2340,9 +2566,9 @@ YY_RULE_SETUP } } YY_BREAK -case 177: +case 211: YY_RULE_SETUP -#line 453 "program_lexer.l" +#line 489 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@ -2352,15 +2578,15 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, SWIZZLE); } YY_BREAK -case 178: +case 212: YY_RULE_SETUP -#line 462 "program_lexer.l" +#line 498 "program_lexer.l" { return DOT; } YY_BREAK -case 179: -/* rule 179 can match eol */ +case 213: +/* rule 213 can match eol */ YY_RULE_SETUP -#line 464 "program_lexer.l" +#line 500 "program_lexer.l" { yylloc->first_line++; yylloc->first_column = 1; @@ -2369,30 +2595,30 @@ YY_RULE_SETUP yylloc->position++; } YY_BREAK -case 180: +case 214: YY_RULE_SETUP -#line 471 "program_lexer.l" +#line 507 "program_lexer.l" /* eat whitespace */ ; YY_BREAK -case 181: +case 215: *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 472 "program_lexer.l" +#line 508 "program_lexer.l" /* eat comments */ ; YY_BREAK -case 182: +case 216: YY_RULE_SETUP -#line 473 "program_lexer.l" +#line 509 "program_lexer.l" { return yytext[0]; } YY_BREAK -case 183: +case 217: YY_RULE_SETUP -#line 474 "program_lexer.l" +#line 510 "program_lexer.l" ECHO; YY_BREAK -#line 2396 "lex.yy.c" +#line 2622 "lex.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -2686,7 +2912,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 675 ) + if ( yy_current_state >= 776 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -2715,11 +2941,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 675 ) + if ( yy_current_state >= 776 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 674); + yy_is_jam = (yy_current_state == 775); return yy_is_jam ? 0 : yy_current_state; } @@ -3567,7 +3793,7 @@ void yyfree (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 474 "program_lexer.l" +#line 510 "program_lexer.l" diff --git a/src/mesa/shader/program_lexer.l b/src/mesa/shader/program_lexer.l index c50c7c5739..62ca9b6db6 100644 --- a/src/mesa/shader/program_lexer.l +++ b/src/mesa/shader/program_lexer.l @@ -29,6 +29,7 @@ #define require_ARB_vp (yyextra->mode == ARB_vertex) #define require_ARB_fp (yyextra->mode == ARB_fragment) +#define require_NV_fp (yyextra->option.NV_fragment) #define require_shadow (yyextra->option.Shadow) #define require_rect (yyextra->option.TexRect) #define require_texarray (yyextra->option.TexArray) @@ -159,6 +160,10 @@ CMP_SAT { return_opcode(require_ARB_fp, TRI_OP, CMP, ZERO_ONE); } COS { return_opcode(require_ARB_fp, SCALAR_OP, COS, OFF); } COS_SAT { return_opcode(require_ARB_fp, SCALAR_OP, COS, ZERO_ONE); } +DDX { return_opcode(require_NV_fp, VECTOR_OP, DDX, OFF); } +DDX_SAT { return_opcode(require_NV_fp, VECTOR_OP, DDX, ZERO_ONE); } +DDY { return_opcode(require_NV_fp, VECTOR_OP, DDY, OFF); } +DDY_SAT { return_opcode(require_NV_fp, VECTOR_OP, DDY, ZERO_ONE); } DP3 { return_opcode( 1, BIN_OP, DP3, OFF); } DP3_SAT { return_opcode(require_ARB_fp, BIN_OP, DP3, ZERO_ONE); } DP4 { return_opcode( 1, BIN_OP, DP4, OFF); } @@ -198,22 +203,44 @@ MOV_SAT { return_opcode(require_ARB_fp, VECTOR_OP, MOV, ZERO_ONE); } MUL { return_opcode( 1, BIN_OP, MUL, OFF); } MUL_SAT { return_opcode(require_ARB_fp, BIN_OP, MUL, ZERO_ONE); } +PK2H { return_opcode(require_NV_fp, VECTOR_OP, PK2H, OFF); } +PK2H_SAT { return_opcode(require_NV_fp, VECTOR_OP, PK2H, ZERO_ONE); } +PK2US { return_opcode(require_NV_fp, VECTOR_OP, PK2US, OFF); } +PK2US_SAT { return_opcode(require_NV_fp, VECTOR_OP, PK2US, ZERO_ONE); } +PK4B { return_opcode(require_NV_fp, VECTOR_OP, PK4B, OFF); } +PK4B_SAT { return_opcode(require_NV_fp, VECTOR_OP, PK4B, ZERO_ONE); } +PK4UB { return_opcode(require_NV_fp, VECTOR_OP, PK4UB, OFF); } +PK4UB_SAT { return_opcode(require_NV_fp, VECTOR_OP, PK4UB, ZERO_ONE); } POW { return_opcode( 1, BINSC_OP, POW, OFF); } POW_SAT { return_opcode(require_ARB_fp, BINSC_OP, POW, ZERO_ONE); } RCP { return_opcode( 1, SCALAR_OP, RCP, OFF); } RCP_SAT { return_opcode(require_ARB_fp, SCALAR_OP, RCP, ZERO_ONE); } +RFL { return_opcode(require_NV_fp, BIN_OP, RFL, OFF); } +RFL_SAT { return_opcode(require_NV_fp, BIN_OP, RFL, ZERO_ONE); } RSQ { return_opcode( 1, SCALAR_OP, RSQ, OFF); } RSQ_SAT { return_opcode(require_ARB_fp, SCALAR_OP, RSQ, ZERO_ONE); } SCS { return_opcode(require_ARB_fp, SCALAR_OP, SCS, OFF); } SCS_SAT { return_opcode(require_ARB_fp, SCALAR_OP, SCS, ZERO_ONE); } +SEQ { return_opcode(require_NV_fp, BIN_OP, SEQ, OFF); } +SEQ_SAT { return_opcode(require_NV_fp, BIN_OP, SEQ, ZERO_ONE); } +SFL { return_opcode(require_NV_fp, BIN_OP, SFL, OFF); } +SFL_SAT { return_opcode(require_NV_fp, BIN_OP, SFL, ZERO_ONE); } SGE { return_opcode( 1, BIN_OP, SGE, OFF); } SGE_SAT { return_opcode(require_ARB_fp, BIN_OP, SGE, ZERO_ONE); } +SGT { return_opcode(require_NV_fp, BIN_OP, SGT, OFF); } +SGT_SAT { return_opcode(require_NV_fp, BIN_OP, SGT, ZERO_ONE); } SIN { return_opcode(require_ARB_fp, SCALAR_OP, SIN, OFF); } SIN_SAT { return_opcode(require_ARB_fp, SCALAR_OP, SIN, ZERO_ONE); } +SLE { return_opcode(require_NV_fp, BIN_OP, SLE, OFF); } +SLE_SAT { return_opcode(require_NV_fp, BIN_OP, SLE, ZERO_ONE); } SLT { return_opcode( 1, BIN_OP, SLT, OFF); } SLT_SAT { return_opcode(require_ARB_fp, BIN_OP, SLT, ZERO_ONE); } +SNE { return_opcode(require_NV_fp, BIN_OP, SNE, OFF); } +SNE_SAT { return_opcode(require_NV_fp, BIN_OP, SNE, ZERO_ONE); } +STR { return_opcode(require_NV_fp, BIN_OP, STR, OFF); } +STR_SAT { return_opcode(require_NV_fp, BIN_OP, STR, ZERO_ONE); } SUB { return_opcode( 1, BIN_OP, SUB, OFF); } SUB_SAT { return_opcode(require_ARB_fp, BIN_OP, SUB, ZERO_ONE); } SWZ { return_opcode( 1, SWZ, SWZ, OFF); } @@ -223,9 +250,18 @@ TEX { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, OFF); } TEX_SAT { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, ZERO_ONE); } TXB { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, OFF); } TXB_SAT { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, ZERO_ONE); } +TXD { return_opcode(require_NV_fp, TXD_OP, TXD, OFF); } +TXD_SAT { return_opcode(require_NV_fp, TXD_OP, TXD, ZERO_ONE); } TXP { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, OFF); } TXP_SAT { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, ZERO_ONE); } +UP2H { return_opcode(require_NV_fp, SCALAR_OP, UP2H, OFF); } +UP2H_SAT { return_opcode(require_NV_fp, SCALAR_OP, UP2H, ZERO_ONE); } +UP2US { return_opcode(require_NV_fp, SCALAR_OP, UP2US, OFF); } +UP2US_SAT { return_opcode(require_NV_fp, SCALAR_OP, UP2US, ZERO_ONE); } + +X2D { return_opcode(require_NV_fp, TRI_OP, X2D, OFF); } +X2D_SAT { return_opcode(require_NV_fp, TRI_OP, X2D, ZERO_ONE); } XPD { return_opcode( 1, BIN_OP, XPD, OFF); } XPD_SAT { return_opcode(require_ARB_fp, BIN_OP, XPD, ZERO_ONE); } diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 5c604c2fd1..4108374652 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -216,90 +216,91 @@ static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, ARL = 274, KIL = 275, SWZ = 276, - INTEGER = 277, - REAL = 278, - AMBIENT = 279, - ATTENUATION = 280, - BACK = 281, - CLIP = 282, - COLOR = 283, - DEPTH = 284, - DIFFUSE = 285, - DIRECTION = 286, - EMISSION = 287, - ENV = 288, - EYE = 289, - FOG = 290, - FOGCOORD = 291, - FRAGMENT = 292, - FRONT = 293, - HALF = 294, - INVERSE = 295, - INVTRANS = 296, - LIGHT = 297, - LIGHTMODEL = 298, - LIGHTPROD = 299, - LOCAL = 300, - MATERIAL = 301, - MAT_PROGRAM = 302, - MATRIX = 303, - MATRIXINDEX = 304, - MODELVIEW = 305, - MVP = 306, - NORMAL = 307, - OBJECT = 308, - PALETTE = 309, - PARAMS = 310, - PLANE = 311, - POINT = 312, - POINTSIZE = 313, - POSITION = 314, - PRIMARY = 315, - PROGRAM = 316, - PROJECTION = 317, - RANGE = 318, - RESULT = 319, - ROW = 320, - SCENECOLOR = 321, - SECONDARY = 322, - SHININESS = 323, - SIZE = 324, - SPECULAR = 325, - SPOT = 326, - STATE = 327, - TEXCOORD = 328, - TEXENV = 329, - TEXGEN = 330, - TEXGEN_Q = 331, - TEXGEN_R = 332, - TEXGEN_S = 333, - TEXGEN_T = 334, - TEXTURE = 335, - TRANSPOSE = 336, - TEXTURE_UNIT = 337, - TEX_1D = 338, - TEX_2D = 339, - TEX_3D = 340, - TEX_CUBE = 341, - TEX_RECT = 342, - TEX_SHADOW1D = 343, - TEX_SHADOW2D = 344, - TEX_SHADOWRECT = 345, - TEX_ARRAY1D = 346, - TEX_ARRAY2D = 347, - TEX_ARRAYSHADOW1D = 348, - TEX_ARRAYSHADOW2D = 349, - VERTEX = 350, - VTXATTRIB = 351, - WEIGHT = 352, - IDENTIFIER = 353, - MASK4 = 354, - MASK3 = 355, - MASK2 = 356, - MASK1 = 357, - SWIZZLE = 358, - DOT_DOT = 359, - DOT = 360 + TXD_OP = 277, + INTEGER = 278, + REAL = 279, + AMBIENT = 280, + ATTENUATION = 281, + BACK = 282, + CLIP = 283, + COLOR = 284, + DEPTH = 285, + DIFFUSE = 286, + DIRECTION = 287, + EMISSION = 288, + ENV = 289, + EYE = 290, + FOG = 291, + FOGCOORD = 292, + FRAGMENT = 293, + FRONT = 294, + HALF = 295, + INVERSE = 296, + INVTRANS = 297, + LIGHT = 298, + LIGHTMODEL = 299, + LIGHTPROD = 300, + LOCAL = 301, + MATERIAL = 302, + MAT_PROGRAM = 303, + MATRIX = 304, + MATRIXINDEX = 305, + MODELVIEW = 306, + MVP = 307, + NORMAL = 308, + OBJECT = 309, + PALETTE = 310, + PARAMS = 311, + PLANE = 312, + POINT = 313, + POINTSIZE = 314, + POSITION = 315, + PRIMARY = 316, + PROGRAM = 317, + PROJECTION = 318, + RANGE = 319, + RESULT = 320, + ROW = 321, + SCENECOLOR = 322, + SECONDARY = 323, + SHININESS = 324, + SIZE = 325, + SPECULAR = 326, + SPOT = 327, + STATE = 328, + TEXCOORD = 329, + TEXENV = 330, + TEXGEN = 331, + TEXGEN_Q = 332, + TEXGEN_R = 333, + TEXGEN_S = 334, + TEXGEN_T = 335, + TEXTURE = 336, + TRANSPOSE = 337, + TEXTURE_UNIT = 338, + TEX_1D = 339, + TEX_2D = 340, + TEX_3D = 341, + TEX_CUBE = 342, + TEX_RECT = 343, + TEX_SHADOW1D = 344, + TEX_SHADOW2D = 345, + TEX_SHADOWRECT = 346, + TEX_ARRAY1D = 347, + TEX_ARRAY2D = 348, + TEX_ARRAYSHADOW1D = 349, + TEX_ARRAYSHADOW2D = 350, + VERTEX = 351, + VTXATTRIB = 352, + WEIGHT = 353, + IDENTIFIER = 354, + MASK4 = 355, + MASK3 = 356, + MASK2 = 357, + MASK1 = 358, + SWIZZLE = 359, + DOT_DOT = 360, + DOT = 361 }; #endif @@ -339,7 +340,7 @@ typedef union YYSTYPE /* Line 214 of yacc.c */ -#line 343 "program_parse.tab.c" +#line 344 "program_parse.tab.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -370,7 +371,7 @@ extern int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, /* Line 264 of yacc.c */ -#line 374 "program_parse.tab.c" +#line 375 "program_parse.tab.c" #ifdef short # undef short @@ -590,7 +591,7 @@ union yyalloc #define YYLAST 340 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 115 +#define YYNTOKENS 116 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 134 /* YYNRULES -- Number of rules. */ @@ -600,7 +601,7 @@ union yyalloc /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 360 +#define YYMAXUTOK 361 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -612,15 +613,15 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 110, 107, 111, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 106, - 2, 112, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 111, 108, 112, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 107, + 2, 113, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 108, 2, 109, 2, 2, 2, 2, 2, 2, + 2, 109, 2, 110, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 113, 2, 114, 2, 2, 2, 2, + 2, 2, 2, 114, 2, 115, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -644,7 +645,7 @@ static const yytype_uint8 yytranslate[] = 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105 + 105, 106 }; #if YYDEBUG @@ -684,80 +685,80 @@ static const yytype_uint16 yyprhs[] = /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int16 yyrhs[] = { - 116, 0, -1, 117, 118, 120, 12, -1, 3, -1, - 4, -1, 118, 119, -1, -1, 8, 98, 106, -1, - 120, 121, -1, -1, 122, 106, -1, 158, 106, -1, - 123, -1, 124, -1, 125, -1, 126, -1, 127, -1, - 128, -1, 129, -1, 130, -1, 135, -1, 131, -1, - 132, -1, 19, 139, 107, 136, -1, 18, 138, 107, - 137, -1, 16, 138, 107, 136, -1, 14, 138, 107, - 136, 107, 136, -1, 13, 138, 107, 137, 107, 137, - -1, 17, 138, 107, 137, 107, 137, 107, 137, -1, - 15, 138, 107, 137, 107, 133, 107, 134, -1, 20, - 137, -1, 82, 243, -1, 83, -1, 84, -1, 85, - -1, 86, -1, 87, -1, 88, -1, 89, -1, 90, - -1, 91, -1, 92, -1, 93, -1, 94, -1, 21, - 138, 107, 143, 107, 140, -1, 229, 143, 155, -1, - 229, 143, 156, -1, 144, 157, -1, 152, 154, -1, - 141, 107, 141, 107, 141, 107, 141, -1, 229, 142, - -1, 22, -1, 98, -1, 98, -1, 160, -1, 145, - 108, 146, 109, -1, 174, -1, 236, -1, 98, -1, - 98, -1, 147, -1, 148, -1, 22, -1, 152, 153, - 149, -1, -1, 110, 150, -1, 111, 151, -1, 22, - -1, 22, -1, 98, -1, 102, -1, 102, -1, 102, - -1, 102, -1, 99, -1, 103, -1, -1, 99, -1, - 100, -1, 101, -1, 102, -1, -1, 159, -1, 166, - -1, 230, -1, 232, -1, 235, -1, 248, -1, 7, - 98, 112, 160, -1, 95, 161, -1, 37, 165, -1, - 59, -1, 97, 163, -1, 52, -1, 28, 241, -1, - 36, -1, 73, 242, -1, 49, 108, 164, 109, -1, - 96, 108, 162, 109, -1, 22, -1, -1, 108, 164, - 109, -1, 22, -1, 59, -1, 28, 241, -1, 36, - -1, 73, 242, -1, 167, -1, 168, -1, 10, 98, - 170, -1, 10, 98, 108, 169, 109, 171, -1, -1, - 22, -1, 112, 173, -1, 112, 113, 172, 114, -1, - 175, -1, 172, 107, 175, -1, 177, -1, 213, -1, - 223, -1, 177, -1, 213, -1, 224, -1, 176, -1, - 214, -1, 223, -1, 177, -1, 72, 201, -1, 72, - 178, -1, 72, 180, -1, 72, 183, -1, 72, 185, - -1, 72, 191, -1, 72, 187, -1, 72, 194, -1, - 72, 196, -1, 72, 198, -1, 72, 200, -1, 72, - 212, -1, 46, 240, 179, -1, 189, -1, 32, -1, - 68, -1, 42, 108, 190, 109, 181, -1, 189, -1, - 59, -1, 25, -1, 71, 182, -1, 39, -1, 31, - -1, 43, 184, -1, 24, -1, 240, 66, -1, 44, - 108, 190, 109, 240, 186, -1, 189, -1, 74, 244, - 188, -1, 28, -1, 24, -1, 30, -1, 70, -1, - 22, -1, 75, 242, 192, 193, -1, 34, -1, 53, - -1, 78, -1, 79, -1, 77, -1, 76, -1, 35, - 195, -1, 28, -1, 55, -1, 27, 108, 197, 109, - 56, -1, 22, -1, 57, 199, -1, 69, -1, 25, - -1, 203, 65, 108, 206, 109, -1, 203, 202, -1, - -1, 65, 108, 206, 104, 206, 109, -1, 48, 207, - 204, -1, -1, 205, -1, 40, -1, 81, -1, 41, - -1, 22, -1, 50, 208, -1, 62, -1, 51, -1, - 80, 242, -1, 54, 108, 210, 109, -1, 47, 108, - 211, 109, -1, -1, 209, -1, 22, -1, 22, -1, - 22, -1, 29, 63, -1, 217, -1, 220, -1, 215, - -1, 218, -1, 61, 33, 108, 216, 109, -1, 221, - -1, 221, 104, 221, -1, 61, 33, 108, 221, 109, - -1, 61, 45, 108, 219, 109, -1, 222, -1, 222, - 104, 222, -1, 61, 45, 108, 222, 109, -1, 22, - -1, 22, -1, 225, -1, 227, -1, 226, -1, 227, - -1, 228, -1, 23, -1, 22, -1, 113, 228, 114, - -1, 113, 228, 107, 228, 114, -1, 113, 228, 107, - 228, 107, 228, 114, -1, 113, 228, 107, 228, 107, - 228, 107, 228, 114, -1, 229, 23, -1, 229, 22, - -1, 110, -1, 111, -1, -1, -1, 11, 231, 234, - -1, -1, 5, 233, 234, -1, 234, 107, 98, -1, - 98, -1, 9, 98, 112, 236, -1, 64, 59, -1, - 64, 36, -1, 64, 237, -1, 64, 58, -1, 64, - 73, 242, -1, 64, 29, -1, 28, 238, 239, -1, - -1, 38, -1, 26, -1, -1, 60, -1, 67, -1, - -1, 38, -1, 26, -1, -1, 60, -1, 67, -1, - -1, 108, 245, 109, -1, -1, 108, 246, 109, -1, - -1, 108, 247, 109, -1, 22, -1, 22, -1, 22, - -1, 6, 98, 112, 98, -1 + 117, 0, -1, 118, 119, 121, 12, -1, 3, -1, + 4, -1, 119, 120, -1, -1, 8, 99, 107, -1, + 121, 122, -1, -1, 123, 107, -1, 159, 107, -1, + 124, -1, 125, -1, 126, -1, 127, -1, 128, -1, + 129, -1, 130, -1, 131, -1, 136, -1, 132, -1, + 133, -1, 19, 140, 108, 137, -1, 18, 139, 108, + 138, -1, 16, 139, 108, 137, -1, 14, 139, 108, + 137, 108, 137, -1, 13, 139, 108, 138, 108, 138, + -1, 17, 139, 108, 138, 108, 138, 108, 138, -1, + 15, 139, 108, 138, 108, 134, 108, 135, -1, 20, + 138, -1, 83, 244, -1, 84, -1, 85, -1, 86, + -1, 87, -1, 88, -1, 89, -1, 90, -1, 91, + -1, 92, -1, 93, -1, 94, -1, 95, -1, 21, + 139, 108, 144, 108, 141, -1, 230, 144, 156, -1, + 230, 144, 157, -1, 145, 158, -1, 153, 155, -1, + 142, 108, 142, 108, 142, 108, 142, -1, 230, 143, + -1, 23, -1, 99, -1, 99, -1, 161, -1, 146, + 109, 147, 110, -1, 175, -1, 237, -1, 99, -1, + 99, -1, 148, -1, 149, -1, 23, -1, 153, 154, + 150, -1, -1, 111, 151, -1, 112, 152, -1, 23, + -1, 23, -1, 99, -1, 103, -1, 103, -1, 103, + -1, 103, -1, 100, -1, 104, -1, -1, 100, -1, + 101, -1, 102, -1, 103, -1, -1, 160, -1, 167, + -1, 231, -1, 233, -1, 236, -1, 249, -1, 7, + 99, 113, 161, -1, 96, 162, -1, 38, 166, -1, + 60, -1, 98, 164, -1, 53, -1, 29, 242, -1, + 37, -1, 74, 243, -1, 50, 109, 165, 110, -1, + 97, 109, 163, 110, -1, 23, -1, -1, 109, 165, + 110, -1, 23, -1, 60, -1, 29, 242, -1, 37, + -1, 74, 243, -1, 168, -1, 169, -1, 10, 99, + 171, -1, 10, 99, 109, 170, 110, 172, -1, -1, + 23, -1, 113, 174, -1, 113, 114, 173, 115, -1, + 176, -1, 173, 108, 176, -1, 178, -1, 214, -1, + 224, -1, 178, -1, 214, -1, 225, -1, 177, -1, + 215, -1, 224, -1, 178, -1, 73, 202, -1, 73, + 179, -1, 73, 181, -1, 73, 184, -1, 73, 186, + -1, 73, 192, -1, 73, 188, -1, 73, 195, -1, + 73, 197, -1, 73, 199, -1, 73, 201, -1, 73, + 213, -1, 47, 241, 180, -1, 190, -1, 33, -1, + 69, -1, 43, 109, 191, 110, 182, -1, 190, -1, + 60, -1, 26, -1, 72, 183, -1, 40, -1, 32, + -1, 44, 185, -1, 25, -1, 241, 67, -1, 45, + 109, 191, 110, 241, 187, -1, 190, -1, 75, 245, + 189, -1, 29, -1, 25, -1, 31, -1, 71, -1, + 23, -1, 76, 243, 193, 194, -1, 35, -1, 54, + -1, 79, -1, 80, -1, 78, -1, 77, -1, 36, + 196, -1, 29, -1, 56, -1, 28, 109, 198, 110, + 57, -1, 23, -1, 58, 200, -1, 70, -1, 26, + -1, 204, 66, 109, 207, 110, -1, 204, 203, -1, + -1, 66, 109, 207, 105, 207, 110, -1, 49, 208, + 205, -1, -1, 206, -1, 41, -1, 82, -1, 42, + -1, 23, -1, 51, 209, -1, 63, -1, 52, -1, + 81, 243, -1, 55, 109, 211, 110, -1, 48, 109, + 212, 110, -1, -1, 210, -1, 23, -1, 23, -1, + 23, -1, 30, 64, -1, 218, -1, 221, -1, 216, + -1, 219, -1, 62, 34, 109, 217, 110, -1, 222, + -1, 222, 105, 222, -1, 62, 34, 109, 222, 110, + -1, 62, 46, 109, 220, 110, -1, 223, -1, 223, + 105, 223, -1, 62, 46, 109, 223, 110, -1, 23, + -1, 23, -1, 226, -1, 228, -1, 227, -1, 228, + -1, 229, -1, 24, -1, 23, -1, 114, 229, 115, + -1, 114, 229, 108, 229, 115, -1, 114, 229, 108, + 229, 108, 229, 115, -1, 114, 229, 108, 229, 108, + 229, 108, 229, 115, -1, 230, 24, -1, 230, 23, + -1, 111, -1, 112, -1, -1, -1, 11, 232, 235, + -1, -1, 5, 234, 235, -1, 235, 108, 99, -1, + 99, -1, 9, 99, 113, 237, -1, 65, 60, -1, + 65, 37, -1, 65, 238, -1, 65, 59, -1, 65, + 74, 243, -1, 65, 30, -1, 29, 239, 240, -1, + -1, 39, -1, 27, -1, -1, 61, -1, 68, -1, + -1, 39, -1, 27, -1, -1, 61, -1, 68, -1, + -1, 109, 246, 110, -1, -1, 109, 247, 110, -1, + -1, 109, 248, 110, -1, 23, -1, 23, -1, 23, + -1, 6, 99, 113, 99, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ @@ -801,9 +802,9 @@ static const char *const yytname[] = "$end", "error", "$undefined", "ARBvp_10", "ARBfp_10", "ADDRESS", "ALIAS", "ATTRIB", "OPTION", "OUTPUT", "PARAM", "TEMP", "END", "BIN_OP", "BINSC_OP", "SAMPLE_OP", "SCALAR_OP", "TRI_OP", "VECTOR_OP", "ARL", - "KIL", "SWZ", "INTEGER", "REAL", "AMBIENT", "ATTENUATION", "BACK", - "CLIP", "COLOR", "DEPTH", "DIFFUSE", "DIRECTION", "EMISSION", "ENV", - "EYE", "FOG", "FOGCOORD", "FRAGMENT", "FRONT", "HALF", "INVERSE", + "KIL", "SWZ", "TXD_OP", "INTEGER", "REAL", "AMBIENT", "ATTENUATION", + "BACK", "CLIP", "COLOR", "DEPTH", "DIFFUSE", "DIRECTION", "EMISSION", + "ENV", "EYE", "FOG", "FOGCOORD", "FRAGMENT", "FRONT", "HALF", "INVERSE", "INVTRANS", "LIGHT", "LIGHTMODEL", "LIGHTPROD", "LOCAL", "MATERIAL", "MAT_PROGRAM", "MATRIX", "MATRIXINDEX", "MODELVIEW", "MVP", "NORMAL", "OBJECT", "PALETTE", "PARAMS", "PLANE", "POINT", "POINTSIZE", "POSITION", @@ -875,41 +876,41 @@ static const yytype_uint16 yytoknum[] = 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 59, 44, 91, 93, - 43, 45, 61, 123, 125 + 355, 356, 357, 358, 359, 360, 361, 59, 44, 91, + 93, 43, 45, 61, 123, 125 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 115, 116, 117, 117, 118, 118, 119, 120, 120, - 121, 121, 122, 122, 123, 123, 123, 123, 123, 123, - 123, 124, 124, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 134, 134, 134, 134, 134, 134, 134, - 134, 134, 134, 134, 135, 136, 137, 138, 139, 140, - 141, 142, 142, 143, 143, 143, 143, 144, 144, 145, - 146, 146, 147, 148, 149, 149, 149, 150, 151, 152, - 153, 154, 155, 156, 156, 156, 156, 157, 157, 157, - 157, 157, 158, 158, 158, 158, 158, 158, 159, 160, - 160, 161, 161, 161, 161, 161, 161, 161, 161, 162, - 163, 163, 164, 165, 165, 165, 165, 166, 166, 167, - 168, 169, 169, 170, 171, 172, 172, 173, 173, 173, - 174, 174, 174, 175, 175, 175, 176, 176, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 177, 178, - 179, 179, 179, 180, 181, 181, 181, 181, 181, 182, - 183, 184, 184, 185, 186, 187, 188, 189, 189, 189, - 190, 191, 192, 192, 193, 193, 193, 193, 194, 195, - 195, 196, 197, 198, 199, 199, 200, 201, 202, 202, - 203, 204, 204, 205, 205, 205, 206, 207, 207, 207, - 207, 207, 207, 208, 208, 209, 210, 211, 212, 213, - 213, 214, 214, 215, 216, 216, 217, 218, 219, 219, - 220, 221, 222, 223, 223, 224, 224, 225, 226, 226, - 227, 227, 227, 227, 228, 228, 229, 229, 229, 231, - 230, 233, 232, 234, 234, 235, 236, 236, 236, 236, - 236, 236, 237, 238, 238, 238, 239, 239, 239, 240, - 240, 240, 241, 241, 241, 242, 242, 243, 243, 244, - 244, 245, 246, 247, 248 + 0, 116, 117, 118, 118, 119, 119, 120, 121, 121, + 122, 122, 123, 123, 124, 124, 124, 124, 124, 124, + 124, 125, 125, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 135, 135, 135, 135, 135, 135, 135, + 135, 135, 135, 135, 136, 137, 138, 139, 140, 141, + 142, 143, 143, 144, 144, 144, 144, 145, 145, 146, + 147, 147, 148, 149, 150, 150, 150, 151, 152, 153, + 154, 155, 156, 157, 157, 157, 157, 158, 158, 158, + 158, 158, 159, 159, 159, 159, 159, 159, 160, 161, + 161, 162, 162, 162, 162, 162, 162, 162, 162, 163, + 164, 164, 165, 166, 166, 166, 166, 167, 167, 168, + 169, 170, 170, 171, 172, 173, 173, 174, 174, 174, + 175, 175, 175, 176, 176, 176, 177, 177, 178, 178, + 178, 178, 178, 178, 178, 178, 178, 178, 178, 179, + 180, 180, 180, 181, 182, 182, 182, 182, 182, 183, + 184, 185, 185, 186, 187, 188, 189, 190, 190, 190, + 191, 192, 193, 193, 194, 194, 194, 194, 195, 196, + 196, 197, 198, 199, 200, 200, 201, 202, 203, 203, + 204, 205, 205, 206, 206, 206, 207, 208, 208, 208, + 208, 208, 208, 209, 209, 210, 211, 212, 213, 214, + 214, 215, 215, 216, 217, 217, 218, 219, 220, 220, + 221, 222, 223, 224, 224, 225, 225, 226, 227, 227, + 228, 228, 228, 228, 229, 229, 230, 230, 230, 232, + 231, 234, 233, 235, 235, 236, 237, 237, 237, 237, + 237, 237, 238, 239, 239, 239, 240, 240, 240, 241, + 241, 241, 242, 242, 242, 243, 243, 244, 244, 245, + 245, 246, 247, 248, 249 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -1019,50 +1020,50 @@ static const yytype_int16 yydefgoto[] = #define YYPACT_NINF -334 static const yytype_int16 yypact[] = { - 134, -334, -334, 41, -334, -334, 47, -49, -334, 169, - 20, -334, 34, 61, 75, 115, -334, -334, -19, -19, - -19, -19, -19, -19, 116, 44, -19, -334, 109, -334, + 134, -334, -334, 41, -334, -334, 47, -50, -334, 169, + 19, -334, 33, 60, 74, 114, -334, -334, -20, -20, + -20, -20, -20, -20, 115, 43, -20, -334, 108, -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, - 110, -334, -334, -334, -334, -334, -334, -334, -334, -334, - 119, 106, 107, 111, -22, 119, 4, -334, 5, 104, - -334, 113, 114, 117, 118, 120, -334, 121, 124, -334, - -334, -334, -15, 122, -334, -334, -334, 123, 133, -14, - 158, 210, -11, -334, 123, 21, -334, -334, -334, -334, - 127, -334, 44, -334, -334, -334, -334, -334, 44, 44, - 44, 44, 44, 44, -334, -334, -334, -334, 1, 68, - 87, -1, 132, 44, 65, 135, -334, -334, -334, -334, - -334, -334, -334, -334, -334, -15, 141, -334, -334, -334, - -334, 136, -334, -334, -334, -334, -334, -334, -334, 149, - -334, -334, 58, 219, -334, 137, 139, -15, 140, -334, - 142, -334, -334, 74, -334, -334, 127, -334, 143, 144, - 145, 179, 15, 146, 81, 147, 83, 89, 0, 148, - 127, -334, -334, -334, -334, -334, -334, -334, -334, -334, - -334, 183, -334, 74, -334, 150, -334, -334, 127, 151, - 152, -334, 43, -334, -334, -334, -334, -10, 155, -334, - 138, -334, -334, -334, -334, -334, -334, 154, 44, 44, - 162, 175, 44, -334, -334, -334, -334, 243, 245, 246, - -334, -334, -334, -334, 247, -334, -334, -334, -334, 204, - 247, -4, 163, 250, -334, 165, -334, 127, 27, -334, - -334, -334, 252, 248, 18, 167, -334, 255, -334, 256, - 255, -334, 44, -334, -334, 170, -334, -334, 178, 44, - 168, -334, -334, -334, -334, -334, -334, 174, 176, 177, - -334, 180, -334, 181, -334, 182, -334, 184, -334, 185, + 109, -334, -334, -334, -334, -334, -334, -334, -334, -334, + 118, 105, 106, 110, -23, 118, 3, -334, 4, 103, + -334, 112, 113, 116, 117, 119, -334, 120, 123, -334, + -334, -334, -16, 121, -334, -334, -334, 122, 132, -15, + 157, 209, -12, -334, 122, 20, -334, -334, -334, -334, + 131, -334, 43, -334, -334, -334, -334, -334, 43, 43, + 43, 43, 43, 43, -334, -334, -334, -334, 0, 67, + 86, -2, 133, 43, 64, 135, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -16, 136, -334, -334, -334, + -334, 129, -334, -334, -334, -334, -334, -334, -334, 148, + -334, -334, 57, 218, -334, 137, 138, -16, 139, -334, + 140, -334, -334, 73, -334, -334, 131, -334, 141, 142, + 143, 179, 14, 144, 80, 145, 82, 88, -1, 146, + 131, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, 183, -334, 73, -334, 147, -334, -334, 131, 149, + 150, -334, 42, -334, -334, -334, -334, -11, 152, -334, + 151, -334, -334, -334, -334, -334, -334, 153, 43, 43, + 154, 182, 43, -334, -334, -334, -334, 239, 244, 245, + -334, -334, -334, -334, 246, -334, -334, -334, -334, 203, + 246, -5, 162, 249, -334, 164, -334, 131, 26, -334, + -334, -334, 251, 247, 17, 166, -334, 254, -334, 255, + 254, -334, 43, -334, -334, 170, -334, -334, 176, 43, + 167, -334, -334, -334, -334, -334, -334, 173, 175, 177, + -334, 174, -334, 178, -334, 180, -334, 181, -334, 184, -334, -334, -334, -334, -334, -334, -334, 263, -334, -334, - -334, 264, -334, -334, -334, -334, -334, -334, -334, 186, - -334, -334, -334, -334, 131, 265, -334, 188, -334, 189, - 190, 46, -334, -334, 101, -334, 193, -5, -7, 266, - -334, 108, 44, -334, -334, 236, 14, 83, -334, 192, - -334, 194, -334, -334, -334, -334, -334, -334, -334, 195, - -334, -334, -334, 44, -334, 280, 283, -334, 44, -334, - -334, -334, 78, 87, 49, -334, -334, -334, -334, -334, - -334, -334, -334, 197, -334, -334, -334, -334, -334, -334, + -334, 264, -334, -334, -334, -334, -334, -334, -334, 185, + -334, -334, -334, -334, 130, 266, -334, 187, -334, 188, + 189, 45, -334, -334, 100, -334, 192, -6, -8, 269, + -334, 107, 43, -334, -334, 236, 13, 82, -334, 191, + -334, 193, -334, -334, -334, -334, -334, -334, -334, 194, + -334, -334, -334, 43, -334, 279, 282, -334, 43, -334, + -334, -334, 77, 86, 48, -334, -334, -334, -334, -334, + -334, -334, -334, 196, -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, - -334, -334, 276, -334, -334, 6, -334, -334, -334, 51, - -334, -334, -334, -334, 201, 202, 203, -334, 244, -7, - -334, -334, -334, -334, -334, -334, 44, -334, 44, 243, - 245, 205, -334, -334, 198, 207, 206, 212, 211, 217, - 265, -334, 44, -334, 243, -334, 245, -17, -334, -334, - -334, 265, 213, -334 + -334, -334, 275, -334, -334, 5, -334, -334, -334, 50, + -334, -334, -334, -334, 200, 201, 202, -334, 243, -8, + -334, -334, -334, -334, -334, -334, 43, -334, 43, 239, + 244, 204, -334, -334, 197, 206, 205, 211, 210, 216, + 266, -334, 43, -334, 239, -334, 244, -18, -334, -334, + -334, 266, 212, -334 }; /* YYPGOTO[NTERM-NUM]. */ @@ -1072,15 +1073,15 @@ static const yytype_int16 yypgoto[] = -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, -94, -88, 126, -334, -334, -333, -334, -91, -334, -334, -334, -334, -334, -334, -334, -334, 128, -334, -334, - -334, -334, -334, -334, -334, 249, -334, -334, -334, 73, + -334, -334, -334, -334, -334, 248, -334, -334, -334, 78, -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, - -72, -334, -81, -334, -334, -334, -334, -334, -334, -334, + -76, -334, -81, -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, -307, 99, -334, -334, -334, -334, - -334, -334, -334, -334, -334, -334, -334, -334, -23, -334, - -334, -303, -334, -334, -334, -334, -334, -334, 251, -334, - -334, -334, -334, -334, -334, -334, -327, -316, 253, -334, - -334, -334, -80, -110, -82, -334, -334, -334, -334, 277, - -334, 254, -334, -334, -334, -161, 153, -146, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -22, -334, + -334, -303, -334, -334, -334, -334, -334, -334, 250, -334, + -334, -334, -334, -334, -334, -334, -327, -316, 252, -334, + -334, -334, -80, -110, -82, -334, -334, -334, -334, 278, + -334, 256, -334, -334, -334, -161, 155, -146, -334, -334, -334, -334, -334, -334 }; @@ -1114,56 +1115,56 @@ static const yytype_int16 yytable[] = 373, 374, 375, 93, 94, 95, 96, 333, 334, 335, 336, 345, 346, 54, 66, 74, 75, 76, 78, 79, 98, 99, 56, 80, 100, 101, 104, 102, 103, 125, - 126, 127, 130, 389, 377, 143, 139, 357, 137, 199, - -59, 206, 220, 197, 208, 200, 209, 211, 245, 212, - 260, 217, 218, 219, 224, 230, 242, 267, 247, 249, - 250, 139, 259, 262, 265, 270, 317, 272, 274, 276, - 278, 287, 288, 291, 298, 305, 300, 306, 308, 312, - 313, 318, 319, 321, 322, 328, 330, 338, 362, 323, - 324, 325, 378, 326, 327, 332, 414, 340, 341, 342, + 126, 127, 130, 389, 377, 199, 139, 357, 137, 200, + 143, 206, -59, 220, 197, 208, 209, 211, 212, 245, + 217, 218, 219, 224, 230, 242, 247, 265, 249, 250, + 259, 139, 270, 262, 260, 267, 317, 272, 274, 276, + 278, 287, 288, 291, 298, 305, 300, 306, 308, 313, + 312, 318, 319, 321, 323, 322, 328, 330, 324, 338, + 325, 326, 362, 378, 327, 332, 414, 340, 341, 342, 348, 386, 390, 387, 388, 392, 401, 402, 408, 411, 409, 410, 421, 420, 422, 423, 424, 139, 357, 137, - 425, 426, 433, 310, 139, 258, 317, 413, 128, 279, - 398, 0, 84, 134, 129, 135, 246, 0, 0, 0, + 425, 426, 433, 413, 139, 258, 317, 128, 310, 279, + 0, 398, 134, 84, 135, 0, 129, 0, 246, 0, 317 }; static const yytype_int16 yycheck[] = { - 82, 82, 82, 113, 92, 166, 100, 22, 23, 103, - 156, 99, 22, 101, 102, 348, 98, 22, 100, 326, - 24, 103, 37, 37, 170, 25, 30, 28, 32, 28, - 24, 113, 28, 29, 125, 36, 30, 36, 24, 25, - 36, 0, 188, 28, 30, 64, 61, 26, 49, 98, - 61, 52, 34, 39, 61, 8, 147, 72, 59, 38, - 59, 72, 58, 59, 68, 72, 70, 40, 41, 69, - 55, 53, 73, 59, 73, 408, 70, 73, 385, 98, - 95, 95, 409, 98, 70, 71, 108, 104, 98, 422, - 112, 237, 109, 98, 410, 96, 97, 424, 113, 110, - 111, 33, 113, 110, 111, 24, 113, 26, 81, 26, - 426, 33, 107, 45, 27, 209, 29, 420, 60, 38, - 208, 38, 35, 45, 212, 67, 106, 209, 431, 42, - 43, 44, 98, 46, 60, 48, 47, 3, 4, 50, - 51, 67, 252, 54, 57, 19, 20, 21, 22, 23, - 107, 62, 26, 107, 110, 111, 107, 114, 107, 98, - 114, 74, 75, 114, 99, 114, 327, 102, 103, 80, - 252, 22, 23, 98, 5, 6, 7, 259, 9, 10, + 82, 82, 82, 113, 92, 166, 100, 23, 24, 103, + 156, 99, 23, 101, 102, 348, 98, 23, 100, 326, + 25, 103, 38, 38, 170, 26, 31, 29, 33, 29, + 25, 113, 29, 30, 125, 37, 31, 37, 25, 26, + 37, 0, 188, 29, 31, 65, 62, 27, 50, 99, + 62, 53, 35, 40, 62, 8, 147, 73, 60, 39, + 60, 73, 59, 60, 69, 73, 71, 41, 42, 70, + 56, 54, 74, 60, 74, 408, 71, 74, 385, 99, + 96, 96, 409, 99, 71, 72, 109, 105, 99, 422, + 113, 237, 110, 99, 410, 97, 98, 424, 114, 111, + 112, 34, 114, 111, 112, 25, 114, 27, 82, 27, + 426, 34, 108, 46, 28, 209, 30, 420, 61, 39, + 208, 39, 36, 46, 212, 68, 107, 209, 431, 43, + 44, 45, 99, 47, 61, 49, 48, 3, 4, 51, + 52, 68, 252, 55, 58, 19, 20, 21, 22, 23, + 108, 63, 26, 108, 111, 112, 108, 115, 108, 99, + 115, 75, 76, 115, 100, 115, 327, 103, 104, 81, + 252, 23, 24, 99, 5, 6, 7, 259, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 99, 100, 101, 102, 76, 77, 78, - 79, 110, 111, 98, 98, 106, 106, 98, 112, 112, - 107, 107, 64, 112, 107, 107, 102, 107, 107, 107, - 107, 98, 22, 343, 322, 108, 318, 318, 318, 98, - 108, 22, 63, 108, 107, 109, 107, 107, 65, 107, - 112, 108, 108, 108, 108, 108, 108, 82, 108, 108, - 108, 343, 107, 109, 102, 22, 348, 22, 22, 22, - 66, 108, 22, 108, 22, 108, 28, 22, 22, 109, - 102, 113, 108, 107, 107, 22, 22, 22, 22, 109, - 109, 109, 56, 109, 109, 109, 406, 109, 109, 109, - 107, 109, 22, 109, 109, 22, 109, 31, 107, 65, - 108, 108, 114, 108, 107, 109, 104, 399, 399, 399, - 109, 104, 109, 250, 406, 197, 408, 399, 79, 230, - 353, -1, 55, 82, 80, 82, 183, -1, -1, -1, + 21, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 100, 101, 102, 103, 77, 78, 79, + 80, 111, 112, 99, 99, 107, 107, 99, 113, 113, + 108, 108, 65, 113, 108, 108, 103, 108, 108, 108, + 108, 99, 23, 343, 322, 99, 318, 318, 318, 110, + 109, 23, 109, 64, 109, 108, 108, 108, 108, 66, + 109, 109, 109, 109, 109, 109, 109, 103, 109, 109, + 108, 343, 23, 110, 113, 83, 348, 23, 23, 23, + 67, 109, 23, 109, 23, 109, 29, 23, 23, 103, + 110, 114, 109, 108, 110, 108, 23, 23, 110, 23, + 110, 110, 23, 57, 110, 110, 406, 110, 110, 110, + 108, 110, 23, 110, 110, 23, 110, 32, 108, 66, + 109, 109, 115, 109, 108, 110, 105, 399, 399, 399, + 110, 105, 110, 399, 406, 197, 408, 79, 250, 230, + -1, 353, 82, 55, 82, -1, 80, -1, 183, -1, 422 }; @@ -1171,50 +1172,50 @@ static const yytype_int16 yycheck[] = symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 3, 4, 116, 117, 0, 118, 8, 119, 120, - 98, 5, 6, 7, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 121, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 135, - 158, 159, 166, 167, 168, 230, 232, 235, 248, 106, - 233, 98, 98, 98, 98, 231, 64, 98, 138, 144, - 236, 138, 138, 138, 138, 138, 98, 139, 152, 110, - 111, 137, 229, 138, 106, 106, 98, 234, 112, 112, - 112, 108, 112, 170, 234, 28, 29, 36, 58, 59, - 73, 237, 107, 99, 100, 101, 102, 157, 107, 107, - 107, 107, 107, 107, 102, 154, 22, 23, 37, 61, - 72, 95, 98, 113, 143, 145, 160, 174, 177, 213, - 217, 220, 224, 226, 227, 107, 107, 98, 160, 236, - 22, 169, 173, 177, 213, 223, 225, 227, 228, 229, - 26, 38, 238, 108, 242, 137, 136, 229, 137, 136, - 137, 137, 136, 28, 36, 59, 73, 165, 33, 45, - 27, 29, 35, 42, 43, 44, 46, 48, 57, 74, - 75, 178, 180, 183, 185, 187, 191, 194, 196, 198, - 200, 203, 212, 28, 36, 49, 52, 59, 73, 96, - 97, 161, 228, 99, 102, 103, 156, 108, 143, 98, - 109, 22, 23, 60, 67, 239, 22, 245, 107, 107, - 143, 107, 107, 60, 67, 241, 242, 108, 108, 108, - 63, 28, 55, 195, 108, 24, 26, 38, 184, 240, - 108, 240, 47, 50, 51, 54, 62, 80, 207, 25, - 69, 199, 108, 244, 242, 65, 241, 108, 242, 108, - 108, 163, 107, 114, 22, 146, 147, 148, 152, 107, - 112, 171, 109, 137, 136, 102, 155, 82, 133, 137, - 22, 221, 22, 222, 22, 197, 22, 190, 66, 190, - 24, 30, 32, 68, 70, 179, 189, 108, 22, 208, - 209, 108, 242, 40, 41, 81, 204, 205, 22, 247, - 28, 188, 34, 53, 192, 108, 22, 164, 22, 162, - 164, 228, 109, 102, 153, 140, 141, 229, 113, 108, - 243, 107, 107, 109, 109, 109, 109, 109, 22, 211, - 22, 210, 109, 76, 77, 78, 79, 193, 22, 206, - 109, 109, 109, 107, 114, 110, 111, 149, 107, 22, - 98, 142, 61, 72, 172, 175, 176, 177, 214, 215, - 218, 223, 22, 246, 83, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 134, 137, 56, 25, - 39, 59, 71, 181, 189, 240, 109, 109, 109, 228, - 22, 150, 22, 151, 141, 33, 45, 201, 203, 107, - 114, 109, 31, 182, 186, 189, 107, 114, 107, 108, - 108, 65, 202, 175, 228, 141, 216, 221, 219, 222, - 108, 114, 107, 109, 104, 109, 104, 206, 141, 221, - 222, 104, 206, 109 + 0, 3, 4, 117, 118, 0, 119, 8, 120, 121, + 99, 5, 6, 7, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 136, + 159, 160, 167, 168, 169, 231, 233, 236, 249, 107, + 234, 99, 99, 99, 99, 232, 65, 99, 139, 145, + 237, 139, 139, 139, 139, 139, 99, 140, 153, 111, + 112, 138, 230, 139, 107, 107, 99, 235, 113, 113, + 113, 109, 113, 171, 235, 29, 30, 37, 59, 60, + 74, 238, 108, 100, 101, 102, 103, 158, 108, 108, + 108, 108, 108, 108, 103, 155, 23, 24, 38, 62, + 73, 96, 99, 114, 144, 146, 161, 175, 178, 214, + 218, 221, 225, 227, 228, 108, 108, 99, 161, 237, + 23, 170, 174, 178, 214, 224, 226, 228, 229, 230, + 27, 39, 239, 109, 243, 138, 137, 230, 138, 137, + 138, 138, 137, 29, 37, 60, 74, 166, 34, 46, + 28, 30, 36, 43, 44, 45, 47, 49, 58, 75, + 76, 179, 181, 184, 186, 188, 192, 195, 197, 199, + 201, 204, 213, 29, 37, 50, 53, 60, 74, 97, + 98, 162, 229, 100, 103, 104, 157, 109, 144, 99, + 110, 23, 24, 61, 68, 240, 23, 246, 108, 108, + 144, 108, 108, 61, 68, 242, 243, 109, 109, 109, + 64, 29, 56, 196, 109, 25, 27, 39, 185, 241, + 109, 241, 48, 51, 52, 55, 63, 81, 208, 26, + 70, 200, 109, 245, 243, 66, 242, 109, 243, 109, + 109, 164, 108, 115, 23, 147, 148, 149, 153, 108, + 113, 172, 110, 138, 137, 103, 156, 83, 134, 138, + 23, 222, 23, 223, 23, 198, 23, 191, 67, 191, + 25, 31, 33, 69, 71, 180, 190, 109, 23, 209, + 210, 109, 243, 41, 42, 82, 205, 206, 23, 248, + 29, 189, 35, 54, 193, 109, 23, 165, 23, 163, + 165, 229, 110, 103, 154, 141, 142, 230, 114, 109, + 244, 108, 108, 110, 110, 110, 110, 110, 23, 212, + 23, 211, 110, 77, 78, 79, 80, 194, 23, 207, + 110, 110, 110, 108, 115, 111, 112, 150, 108, 23, + 99, 143, 62, 73, 173, 176, 177, 178, 215, 216, + 219, 224, 23, 247, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 135, 138, 57, 26, + 40, 60, 72, 182, 190, 241, 110, 110, 110, 229, + 23, 151, 23, 152, 142, 34, 46, 202, 204, 108, + 115, 110, 32, 183, 187, 190, 108, 115, 108, 109, + 109, 66, 203, 176, 229, 142, 217, 222, 220, 223, + 109, 115, 108, 110, 105, 110, 105, 207, 142, 222, + 223, 105, 207, 110 }; #define yyerrok (yyerrstatus = 0) @@ -4573,7 +4574,7 @@ yyreduce: /* Line 1455 of yacc.c */ -#line 4577 "program_parse.tab.c" +#line 4578 "program_parse.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); diff --git a/src/mesa/shader/program_parse.tab.h b/src/mesa/shader/program_parse.tab.h index de08fb747f..7ab6f6b23e 100644 --- a/src/mesa/shader/program_parse.tab.h +++ b/src/mesa/shader/program_parse.tab.h @@ -58,90 +58,91 @@ ARL = 274, KIL = 275, SWZ = 276, - INTEGER = 277, - REAL = 278, - AMBIENT = 279, - ATTENUATION = 280, - BACK = 281, - CLIP = 282, - COLOR = 283, - DEPTH = 284, - DIFFUSE = 285, - DIRECTION = 286, - EMISSION = 287, - ENV = 288, - EYE = 289, - FOG = 290, - FOGCOORD = 291, - FRAGMENT = 292, - FRONT = 293, - HALF = 294, - INVERSE = 295, - INVTRANS = 296, - LIGHT = 297, - LIGHTMODEL = 298, - LIGHTPROD = 299, - LOCAL = 300, - MATERIAL = 301, - MAT_PROGRAM = 302, - MATRIX = 303, - MATRIXINDEX = 304, - MODELVIEW = 305, - MVP = 306, - NORMAL = 307, - OBJECT = 308, - PALETTE = 309, - PARAMS = 310, - PLANE = 311, - POINT = 312, - POINTSIZE = 313, - POSITION = 314, - PRIMARY = 315, - PROGRAM = 316, - PROJECTION = 317, - RANGE = 318, - RESULT = 319, - ROW = 320, - SCENECOLOR = 321, - SECONDARY = 322, - SHININESS = 323, - SIZE = 324, - SPECULAR = 325, - SPOT = 326, - STATE = 327, - TEXCOORD = 328, - TEXENV = 329, - TEXGEN = 330, - TEXGEN_Q = 331, - TEXGEN_R = 332, - TEXGEN_S = 333, - TEXGEN_T = 334, - TEXTURE = 335, - TRANSPOSE = 336, - TEXTURE_UNIT = 337, - TEX_1D = 338, - TEX_2D = 339, - TEX_3D = 340, - TEX_CUBE = 341, - TEX_RECT = 342, - TEX_SHADOW1D = 343, - TEX_SHADOW2D = 344, - TEX_SHADOWRECT = 345, - TEX_ARRAY1D = 346, - TEX_ARRAY2D = 347, - TEX_ARRAYSHADOW1D = 348, - TEX_ARRAYSHADOW2D = 349, - VERTEX = 350, - VTXATTRIB = 351, - WEIGHT = 352, - IDENTIFIER = 353, - MASK4 = 354, - MASK3 = 355, - MASK2 = 356, - MASK1 = 357, - SWIZZLE = 358, - DOT_DOT = 359, - DOT = 360 + TXD_OP = 277, + INTEGER = 278, + REAL = 279, + AMBIENT = 280, + ATTENUATION = 281, + BACK = 282, + CLIP = 283, + COLOR = 284, + DEPTH = 285, + DIFFUSE = 286, + DIRECTION = 287, + EMISSION = 288, + ENV = 289, + EYE = 290, + FOG = 291, + FOGCOORD = 292, + FRAGMENT = 293, + FRONT = 294, + HALF = 295, + INVERSE = 296, + INVTRANS = 297, + LIGHT = 298, + LIGHTMODEL = 299, + LIGHTPROD = 300, + LOCAL = 301, + MATERIAL = 302, + MAT_PROGRAM = 303, + MATRIX = 304, + MATRIXINDEX = 305, + MODELVIEW = 306, + MVP = 307, + NORMAL = 308, + OBJECT = 309, + PALETTE = 310, + PARAMS = 311, + PLANE = 312, + POINT = 313, + POINTSIZE = 314, + POSITION = 315, + PRIMARY = 316, + PROGRAM = 317, + PROJECTION = 318, + RANGE = 319, + RESULT = 320, + ROW = 321, + SCENECOLOR = 322, + SECONDARY = 323, + SHININESS = 324, + SIZE = 325, + SPECULAR = 326, + SPOT = 327, + STATE = 328, + TEXCOORD = 329, + TEXENV = 330, + TEXGEN = 331, + TEXGEN_Q = 332, + TEXGEN_R = 333, + TEXGEN_S = 334, + TEXGEN_T = 335, + TEXTURE = 336, + TRANSPOSE = 337, + TEXTURE_UNIT = 338, + TEX_1D = 339, + TEX_2D = 340, + TEX_3D = 341, + TEX_CUBE = 342, + TEX_RECT = 343, + TEX_SHADOW1D = 344, + TEX_SHADOW2D = 345, + TEX_SHADOWRECT = 346, + TEX_ARRAY1D = 347, + TEX_ARRAY2D = 348, + TEX_ARRAYSHADOW1D = 349, + TEX_ARRAYSHADOW2D = 350, + VERTEX = 351, + VTXATTRIB = 352, + WEIGHT = 353, + IDENTIFIER = 354, + MASK4 = 355, + MASK3 = 356, + MASK2 = 357, + MASK1 = 358, + SWIZZLE = 359, + DOT_DOT = 360, + DOT = 361 }; #endif @@ -181,7 +182,7 @@ typedef union YYSTYPE /* Line 1676 of yacc.c */ -#line 185 "program_parse.tab.h" +#line 186 "program_parse.tab.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index e2e83e484f..9dab00c385 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -142,7 +142,7 @@ static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, /* Tokens for instructions */ %token BIN_OP BINSC_OP SAMPLE_OP SCALAR_OP TRI_OP VECTOR_OP -%token ARL KIL SWZ +%token ARL KIL SWZ TXD_OP %token INTEGER %token REAL -- cgit v1.2.3 From 8ca6fd8a83412e3a76746f0ee61027b796516f95 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 1 Sep 2009 14:16:03 -0700 Subject: NV fp parser: Parse TXD instruction --- src/mesa/shader/program_parse.tab.c | 1735 ++++++++++++++++++----------------- src/mesa/shader/program_parse.y | 48 +- 2 files changed, 941 insertions(+), 842 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 4108374652..06aefd073f 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -588,16 +588,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 5 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 340 +#define YYLAST 349 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 116 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 134 +#define YYNNTS 135 /* YYNRULES -- Number of rules. */ -#define YYNRULES 264 +#define YYNRULES 266 /* YYNRULES -- Number of states. */ -#define YYNSTATES 434 +#define YYNSTATES 447 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 @@ -655,31 +655,31 @@ static const yytype_uint16 yyprhs[] = { 0, 0, 3, 8, 10, 12, 15, 16, 20, 23, 24, 27, 30, 32, 34, 36, 38, 40, 42, 44, - 46, 48, 50, 52, 57, 62, 67, 74, 81, 90, - 99, 102, 105, 107, 109, 111, 113, 115, 117, 119, - 121, 123, 125, 127, 129, 136, 140, 144, 147, 150, - 158, 161, 163, 165, 167, 169, 174, 176, 178, 180, - 182, 184, 186, 188, 192, 193, 196, 199, 201, 203, - 205, 207, 209, 211, 213, 215, 217, 218, 220, 222, - 224, 226, 227, 229, 231, 233, 235, 237, 239, 244, - 247, 250, 252, 255, 257, 260, 262, 265, 270, 275, - 277, 278, 282, 284, 286, 289, 291, 294, 296, 298, - 302, 309, 310, 312, 315, 320, 322, 326, 328, 330, - 332, 334, 336, 338, 340, 342, 344, 346, 349, 352, - 355, 358, 361, 364, 367, 370, 373, 376, 379, 382, - 386, 388, 390, 392, 398, 400, 402, 404, 407, 409, - 411, 414, 416, 419, 426, 428, 432, 434, 436, 438, - 440, 442, 447, 449, 451, 453, 455, 457, 459, 462, - 464, 466, 472, 474, 477, 479, 481, 487, 490, 491, - 498, 502, 503, 505, 507, 509, 511, 513, 516, 518, - 520, 523, 528, 533, 534, 536, 538, 540, 542, 545, - 547, 549, 551, 553, 559, 561, 565, 571, 577, 579, - 583, 589, 591, 593, 595, 597, 599, 601, 603, 605, - 607, 611, 617, 625, 635, 638, 641, 643, 645, 646, - 647, 651, 652, 656, 660, 662, 667, 670, 673, 676, - 679, 683, 686, 690, 691, 693, 695, 696, 698, 700, - 701, 703, 705, 706, 708, 710, 711, 715, 716, 720, - 721, 725, 727, 729, 731 + 46, 48, 50, 52, 54, 59, 64, 69, 76, 83, + 92, 101, 104, 117, 120, 122, 124, 126, 128, 130, + 132, 134, 136, 138, 140, 142, 144, 151, 155, 159, + 162, 165, 173, 176, 178, 180, 182, 184, 189, 191, + 193, 195, 197, 199, 201, 203, 207, 208, 211, 214, + 216, 218, 220, 222, 224, 226, 228, 230, 232, 233, + 235, 237, 239, 241, 242, 244, 246, 248, 250, 252, + 254, 259, 262, 265, 267, 270, 272, 275, 277, 280, + 285, 290, 292, 293, 297, 299, 301, 304, 306, 309, + 311, 313, 317, 324, 325, 327, 330, 335, 337, 341, + 343, 345, 347, 349, 351, 353, 355, 357, 359, 361, + 364, 367, 370, 373, 376, 379, 382, 385, 388, 391, + 394, 397, 401, 403, 405, 407, 413, 415, 417, 419, + 422, 424, 426, 429, 431, 434, 441, 443, 447, 449, + 451, 453, 455, 457, 462, 464, 466, 468, 470, 472, + 474, 477, 479, 481, 487, 489, 492, 494, 496, 502, + 505, 506, 513, 517, 518, 520, 522, 524, 526, 528, + 531, 533, 535, 538, 543, 548, 549, 551, 553, 555, + 557, 560, 562, 564, 566, 568, 574, 576, 580, 586, + 592, 594, 598, 604, 606, 608, 610, 612, 614, 616, + 618, 620, 622, 626, 632, 640, 650, 653, 656, 658, + 660, 661, 662, 666, 667, 671, 675, 677, 682, 685, + 688, 691, 694, 698, 701, 705, 706, 708, 710, 711, + 713, 715, 716, 718, 720, 721, 723, 725, 726, 730, + 731, 735, 736, 740, 742, 744, 746 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ @@ -687,78 +687,80 @@ static const yytype_int16 yyrhs[] = { 117, 0, -1, 118, 119, 121, 12, -1, 3, -1, 4, -1, 119, 120, -1, -1, 8, 99, 107, -1, - 121, 122, -1, -1, 123, 107, -1, 159, 107, -1, + 121, 122, -1, -1, 123, 107, -1, 160, 107, -1, 124, -1, 125, -1, 126, -1, 127, -1, 128, -1, - 129, -1, 130, -1, 131, -1, 136, -1, 132, -1, - 133, -1, 19, 140, 108, 137, -1, 18, 139, 108, - 138, -1, 16, 139, 108, 137, -1, 14, 139, 108, - 137, 108, 137, -1, 13, 139, 108, 138, 108, 138, - -1, 17, 139, 108, 138, 108, 138, 108, 138, -1, - 15, 139, 108, 138, 108, 134, 108, 135, -1, 20, - 138, -1, 83, 244, -1, 84, -1, 85, -1, 86, - -1, 87, -1, 88, -1, 89, -1, 90, -1, 91, - -1, 92, -1, 93, -1, 94, -1, 95, -1, 21, - 139, 108, 144, 108, 141, -1, 230, 144, 156, -1, - 230, 144, 157, -1, 145, 158, -1, 153, 155, -1, - 142, 108, 142, 108, 142, 108, 142, -1, 230, 143, - -1, 23, -1, 99, -1, 99, -1, 161, -1, 146, - 109, 147, 110, -1, 175, -1, 237, -1, 99, -1, - 99, -1, 148, -1, 149, -1, 23, -1, 153, 154, - 150, -1, -1, 111, 151, -1, 112, 152, -1, 23, - -1, 23, -1, 99, -1, 103, -1, 103, -1, 103, - -1, 103, -1, 100, -1, 104, -1, -1, 100, -1, - 101, -1, 102, -1, 103, -1, -1, 160, -1, 167, - -1, 231, -1, 233, -1, 236, -1, 249, -1, 7, - 99, 113, 161, -1, 96, 162, -1, 38, 166, -1, - 60, -1, 98, 164, -1, 53, -1, 29, 242, -1, - 37, -1, 74, 243, -1, 50, 109, 165, 110, -1, - 97, 109, 163, 110, -1, 23, -1, -1, 109, 165, - 110, -1, 23, -1, 60, -1, 29, 242, -1, 37, - -1, 74, 243, -1, 168, -1, 169, -1, 10, 99, - 171, -1, 10, 99, 109, 170, 110, 172, -1, -1, - 23, -1, 113, 174, -1, 113, 114, 173, 115, -1, - 176, -1, 173, 108, 176, -1, 178, -1, 214, -1, - 224, -1, 178, -1, 214, -1, 225, -1, 177, -1, - 215, -1, 224, -1, 178, -1, 73, 202, -1, 73, - 179, -1, 73, 181, -1, 73, 184, -1, 73, 186, - -1, 73, 192, -1, 73, 188, -1, 73, 195, -1, - 73, 197, -1, 73, 199, -1, 73, 201, -1, 73, - 213, -1, 47, 241, 180, -1, 190, -1, 33, -1, - 69, -1, 43, 109, 191, 110, 182, -1, 190, -1, - 60, -1, 26, -1, 72, 183, -1, 40, -1, 32, - -1, 44, 185, -1, 25, -1, 241, 67, -1, 45, - 109, 191, 110, 241, 187, -1, 190, -1, 75, 245, - 189, -1, 29, -1, 25, -1, 31, -1, 71, -1, - 23, -1, 76, 243, 193, 194, -1, 35, -1, 54, - -1, 79, -1, 80, -1, 78, -1, 77, -1, 36, - 196, -1, 29, -1, 56, -1, 28, 109, 198, 110, - 57, -1, 23, -1, 58, 200, -1, 70, -1, 26, - -1, 204, 66, 109, 207, 110, -1, 204, 203, -1, - -1, 66, 109, 207, 105, 207, 110, -1, 49, 208, - 205, -1, -1, 206, -1, 41, -1, 82, -1, 42, - -1, 23, -1, 51, 209, -1, 63, -1, 52, -1, - 81, 243, -1, 55, 109, 211, 110, -1, 48, 109, - 212, 110, -1, -1, 210, -1, 23, -1, 23, -1, - 23, -1, 30, 64, -1, 218, -1, 221, -1, 216, - -1, 219, -1, 62, 34, 109, 217, 110, -1, 222, - -1, 222, 105, 222, -1, 62, 34, 109, 222, 110, - -1, 62, 46, 109, 220, 110, -1, 223, -1, 223, - 105, 223, -1, 62, 46, 109, 223, 110, -1, 23, - -1, 23, -1, 226, -1, 228, -1, 227, -1, 228, - -1, 229, -1, 24, -1, 23, -1, 114, 229, 115, - -1, 114, 229, 108, 229, 115, -1, 114, 229, 108, - 229, 108, 229, 115, -1, 114, 229, 108, 229, 108, - 229, 108, 229, 115, -1, 230, 24, -1, 230, 23, - -1, 111, -1, 112, -1, -1, -1, 11, 232, 235, - -1, -1, 5, 234, 235, -1, 235, 108, 99, -1, - 99, -1, 9, 99, 113, 237, -1, 65, 60, -1, - 65, 37, -1, 65, 238, -1, 65, 59, -1, 65, - 74, 243, -1, 65, 30, -1, 29, 239, 240, -1, - -1, 39, -1, 27, -1, -1, 61, -1, 68, -1, - -1, 39, -1, 27, -1, -1, 61, -1, 68, -1, - -1, 109, 246, 110, -1, -1, 109, 247, 110, -1, - -1, 109, 248, 110, -1, 23, -1, 23, -1, 23, - -1, 6, 99, 113, 99, -1 + 129, -1, 130, -1, 131, -1, 137, -1, 132, -1, + 133, -1, 134, -1, 19, 141, 108, 138, -1, 18, + 140, 108, 139, -1, 16, 140, 108, 138, -1, 14, + 140, 108, 138, 108, 138, -1, 13, 140, 108, 139, + 108, 139, -1, 17, 140, 108, 139, 108, 139, 108, + 139, -1, 15, 140, 108, 139, 108, 135, 108, 136, + -1, 20, 139, -1, 22, 140, 108, 139, 108, 139, + 108, 139, 108, 135, 108, 136, -1, 83, 245, -1, + 84, -1, 85, -1, 86, -1, 87, -1, 88, -1, + 89, -1, 90, -1, 91, -1, 92, -1, 93, -1, + 94, -1, 95, -1, 21, 140, 108, 145, 108, 142, + -1, 231, 145, 157, -1, 231, 145, 158, -1, 146, + 159, -1, 154, 156, -1, 143, 108, 143, 108, 143, + 108, 143, -1, 231, 144, -1, 23, -1, 99, -1, + 99, -1, 162, -1, 147, 109, 148, 110, -1, 176, + -1, 238, -1, 99, -1, 99, -1, 149, -1, 150, + -1, 23, -1, 154, 155, 151, -1, -1, 111, 152, + -1, 112, 153, -1, 23, -1, 23, -1, 99, -1, + 103, -1, 103, -1, 103, -1, 103, -1, 100, -1, + 104, -1, -1, 100, -1, 101, -1, 102, -1, 103, + -1, -1, 161, -1, 168, -1, 232, -1, 234, -1, + 237, -1, 250, -1, 7, 99, 113, 162, -1, 96, + 163, -1, 38, 167, -1, 60, -1, 98, 165, -1, + 53, -1, 29, 243, -1, 37, -1, 74, 244, -1, + 50, 109, 166, 110, -1, 97, 109, 164, 110, -1, + 23, -1, -1, 109, 166, 110, -1, 23, -1, 60, + -1, 29, 243, -1, 37, -1, 74, 244, -1, 169, + -1, 170, -1, 10, 99, 172, -1, 10, 99, 109, + 171, 110, 173, -1, -1, 23, -1, 113, 175, -1, + 113, 114, 174, 115, -1, 177, -1, 174, 108, 177, + -1, 179, -1, 215, -1, 225, -1, 179, -1, 215, + -1, 226, -1, 178, -1, 216, -1, 225, -1, 179, + -1, 73, 203, -1, 73, 180, -1, 73, 182, -1, + 73, 185, -1, 73, 187, -1, 73, 193, -1, 73, + 189, -1, 73, 196, -1, 73, 198, -1, 73, 200, + -1, 73, 202, -1, 73, 214, -1, 47, 242, 181, + -1, 191, -1, 33, -1, 69, -1, 43, 109, 192, + 110, 183, -1, 191, -1, 60, -1, 26, -1, 72, + 184, -1, 40, -1, 32, -1, 44, 186, -1, 25, + -1, 242, 67, -1, 45, 109, 192, 110, 242, 188, + -1, 191, -1, 75, 246, 190, -1, 29, -1, 25, + -1, 31, -1, 71, -1, 23, -1, 76, 244, 194, + 195, -1, 35, -1, 54, -1, 79, -1, 80, -1, + 78, -1, 77, -1, 36, 197, -1, 29, -1, 56, + -1, 28, 109, 199, 110, 57, -1, 23, -1, 58, + 201, -1, 70, -1, 26, -1, 205, 66, 109, 208, + 110, -1, 205, 204, -1, -1, 66, 109, 208, 105, + 208, 110, -1, 49, 209, 206, -1, -1, 207, -1, + 41, -1, 82, -1, 42, -1, 23, -1, 51, 210, + -1, 63, -1, 52, -1, 81, 244, -1, 55, 109, + 212, 110, -1, 48, 109, 213, 110, -1, -1, 211, + -1, 23, -1, 23, -1, 23, -1, 30, 64, -1, + 219, -1, 222, -1, 217, -1, 220, -1, 62, 34, + 109, 218, 110, -1, 223, -1, 223, 105, 223, -1, + 62, 34, 109, 223, 110, -1, 62, 46, 109, 221, + 110, -1, 224, -1, 224, 105, 224, -1, 62, 46, + 109, 224, 110, -1, 23, -1, 23, -1, 227, -1, + 229, -1, 228, -1, 229, -1, 230, -1, 24, -1, + 23, -1, 114, 230, 115, -1, 114, 230, 108, 230, + 115, -1, 114, 230, 108, 230, 108, 230, 115, -1, + 114, 230, 108, 230, 108, 230, 108, 230, 115, -1, + 231, 24, -1, 231, 23, -1, 111, -1, 112, -1, + -1, -1, 11, 233, 236, -1, -1, 5, 235, 236, + -1, 236, 108, 99, -1, 99, -1, 9, 99, 113, + 238, -1, 65, 60, -1, 65, 37, -1, 65, 239, + -1, 65, 59, -1, 65, 74, 244, -1, 65, 30, + -1, 29, 240, 241, -1, -1, 39, -1, 27, -1, + -1, 61, -1, 68, -1, -1, 39, -1, 27, -1, + -1, 61, -1, 68, -1, -1, 109, 247, 110, -1, + -1, 109, 248, 110, -1, -1, 109, 249, 110, -1, + 23, -1, 23, -1, 23, -1, 6, 99, 113, 99, + -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ @@ -766,31 +768,31 @@ static const yytype_uint16 yyrline[] = { 0, 256, 256, 259, 267, 279, 280, 283, 305, 306, 309, 324, 327, 332, 339, 340, 341, 342, 343, 344, - 345, 348, 349, 352, 358, 365, 372, 380, 387, 395, - 440, 447, 453, 454, 455, 456, 457, 458, 459, 460, - 461, 462, 463, 464, 467, 480, 493, 506, 528, 537, - 570, 577, 592, 642, 684, 695, 716, 726, 732, 763, - 780, 780, 782, 789, 801, 802, 803, 806, 818, 830, - 848, 859, 871, 873, 874, 875, 876, 879, 879, 879, - 879, 880, 883, 884, 885, 886, 887, 888, 891, 909, - 913, 919, 923, 927, 931, 940, 949, 953, 958, 964, - 975, 975, 976, 978, 982, 986, 990, 996, 996, 998, - 1014, 1037, 1040, 1051, 1057, 1063, 1064, 1071, 1077, 1083, - 1091, 1097, 1103, 1111, 1117, 1123, 1131, 1132, 1135, 1136, - 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1148, - 1157, 1161, 1165, 1171, 1180, 1184, 1188, 1197, 1201, 1207, - 1213, 1220, 1225, 1233, 1243, 1245, 1253, 1259, 1263, 1267, - 1273, 1284, 1293, 1297, 1302, 1306, 1310, 1314, 1320, 1327, - 1331, 1337, 1345, 1356, 1363, 1367, 1373, 1383, 1394, 1398, - 1416, 1425, 1428, 1434, 1438, 1442, 1448, 1459, 1464, 1469, - 1474, 1479, 1484, 1492, 1495, 1500, 1513, 1521, 1532, 1540, - 1540, 1542, 1542, 1544, 1554, 1559, 1566, 1576, 1585, 1590, - 1597, 1607, 1617, 1629, 1629, 1630, 1630, 1632, 1642, 1650, - 1660, 1668, 1676, 1685, 1696, 1700, 1706, 1707, 1708, 1711, - 1711, 1714, 1714, 1717, 1723, 1731, 1744, 1753, 1762, 1766, - 1775, 1784, 1795, 1802, 1807, 1816, 1828, 1831, 1840, 1851, - 1852, 1853, 1856, 1857, 1858, 1861, 1862, 1865, 1866, 1869, - 1870, 1873, 1884, 1895, 1906 + 345, 348, 349, 350, 353, 359, 366, 373, 381, 388, + 396, 441, 448, 493, 499, 500, 501, 502, 503, 504, + 505, 506, 507, 508, 509, 510, 513, 526, 539, 552, + 574, 583, 616, 623, 638, 688, 730, 741, 762, 772, + 778, 809, 826, 826, 828, 835, 847, 848, 849, 852, + 864, 876, 894, 905, 917, 919, 920, 921, 922, 925, + 925, 925, 925, 926, 929, 930, 931, 932, 933, 934, + 937, 955, 959, 965, 969, 973, 977, 986, 995, 999, + 1004, 1010, 1021, 1021, 1022, 1024, 1028, 1032, 1036, 1042, + 1042, 1044, 1060, 1083, 1086, 1097, 1103, 1109, 1110, 1117, + 1123, 1129, 1137, 1143, 1149, 1157, 1163, 1169, 1177, 1178, + 1181, 1182, 1183, 1184, 1185, 1186, 1187, 1188, 1189, 1190, + 1191, 1194, 1203, 1207, 1211, 1217, 1226, 1230, 1234, 1243, + 1247, 1253, 1259, 1266, 1271, 1279, 1289, 1291, 1299, 1305, + 1309, 1313, 1319, 1330, 1339, 1343, 1348, 1352, 1356, 1360, + 1366, 1373, 1377, 1383, 1391, 1402, 1409, 1413, 1419, 1429, + 1440, 1444, 1462, 1471, 1474, 1480, 1484, 1488, 1494, 1505, + 1510, 1515, 1520, 1525, 1530, 1538, 1541, 1546, 1559, 1567, + 1578, 1586, 1586, 1588, 1588, 1590, 1600, 1605, 1612, 1622, + 1631, 1636, 1643, 1653, 1663, 1675, 1675, 1676, 1676, 1678, + 1688, 1696, 1706, 1714, 1722, 1731, 1742, 1746, 1752, 1753, + 1754, 1757, 1757, 1760, 1760, 1763, 1769, 1777, 1790, 1799, + 1808, 1812, 1821, 1830, 1841, 1848, 1853, 1862, 1874, 1877, + 1886, 1897, 1898, 1899, 1902, 1903, 1904, 1907, 1908, 1911, + 1912, 1915, 1916, 1919, 1930, 1941, 1952 }; #endif @@ -822,24 +824,24 @@ static const char *const yytname[] = "TexInstruction", "ARL_instruction", "VECTORop_instruction", "SCALARop_instruction", "BINSCop_instruction", "BINop_instruction", "TRIop_instruction", "SAMPLE_instruction", "KIL_instruction", - "texImageUnit", "texTarget", "SWZ_instruction", "scalarSrcReg", - "swizzleSrcReg", "maskedDstReg", "maskedAddrReg", "extendedSwizzle", - "extSwizComp", "extSwizSel", "srcReg", "dstReg", "progParamArray", - "progParamArrayMem", "progParamArrayAbs", "progParamArrayRel", - "addrRegRelOffset", "addrRegPosOffset", "addrRegNegOffset", "addrReg", - "addrComponent", "addrWriteMask", "scalarSuffix", "swizzleSuffix", - "optionalMask", "namingStatement", "ATTRIB_statement", "attribBinding", - "vtxAttribItem", "vtxAttribNum", "vtxOptWeightNum", "vtxWeightNum", - "fragAttribItem", "PARAM_statement", "PARAM_singleStmt", - "PARAM_multipleStmt", "optArraySize", "paramSingleInit", - "paramMultipleInit", "paramMultInitList", "paramSingleItemDecl", - "paramSingleItemUse", "paramMultipleItem", "stateMultipleItem", - "stateSingleItem", "stateMaterialItem", "stateMatProperty", - "stateLightItem", "stateLightProperty", "stateSpotProperty", - "stateLightModelItem", "stateLModProperty", "stateLightProdItem", - "stateLProdProperty", "stateTexEnvItem", "stateTexEnvProperty", - "ambDiffSpecProperty", "stateLightNumber", "stateTexGenItem", - "stateTexGenType", "stateTexGenCoord", "stateFogItem", + "TXD_instruction", "texImageUnit", "texTarget", "SWZ_instruction", + "scalarSrcReg", "swizzleSrcReg", "maskedDstReg", "maskedAddrReg", + "extendedSwizzle", "extSwizComp", "extSwizSel", "srcReg", "dstReg", + "progParamArray", "progParamArrayMem", "progParamArrayAbs", + "progParamArrayRel", "addrRegRelOffset", "addrRegPosOffset", + "addrRegNegOffset", "addrReg", "addrComponent", "addrWriteMask", + "scalarSuffix", "swizzleSuffix", "optionalMask", "namingStatement", + "ATTRIB_statement", "attribBinding", "vtxAttribItem", "vtxAttribNum", + "vtxOptWeightNum", "vtxWeightNum", "fragAttribItem", "PARAM_statement", + "PARAM_singleStmt", "PARAM_multipleStmt", "optArraySize", + "paramSingleInit", "paramMultipleInit", "paramMultInitList", + "paramSingleItemDecl", "paramSingleItemUse", "paramMultipleItem", + "stateMultipleItem", "stateSingleItem", "stateMaterialItem", + "stateMatProperty", "stateLightItem", "stateLightProperty", + "stateSpotProperty", "stateLightModelItem", "stateLModProperty", + "stateLightProdItem", "stateLProdProperty", "stateTexEnvItem", + "stateTexEnvProperty", "ambDiffSpecProperty", "stateLightNumber", + "stateTexGenItem", "stateTexGenType", "stateTexGenCoord", "stateFogItem", "stateFogProperty", "stateClipPlaneItem", "stateClipPlaneNum", "statePointItem", "statePointProperty", "stateMatrixRow", "stateMatrixRows", "optMatrixRows", "stateMatrixItem", @@ -886,31 +888,31 @@ static const yytype_uint8 yyr1[] = { 0, 116, 117, 118, 118, 119, 119, 120, 121, 121, 122, 122, 123, 123, 124, 124, 124, 124, 124, 124, - 124, 125, 125, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 135, 135, 135, 135, 135, 135, 135, - 135, 135, 135, 135, 136, 137, 138, 139, 140, 141, - 142, 143, 143, 144, 144, 144, 144, 145, 145, 146, - 147, 147, 148, 149, 150, 150, 150, 151, 152, 153, - 154, 155, 156, 157, 157, 157, 157, 158, 158, 158, - 158, 158, 159, 159, 159, 159, 159, 159, 160, 161, - 161, 162, 162, 162, 162, 162, 162, 162, 162, 163, - 164, 164, 165, 166, 166, 166, 166, 167, 167, 168, - 169, 170, 170, 171, 172, 173, 173, 174, 174, 174, - 175, 175, 175, 176, 176, 176, 177, 177, 178, 178, - 178, 178, 178, 178, 178, 178, 178, 178, 178, 179, - 180, 180, 180, 181, 182, 182, 182, 182, 182, 183, - 184, 185, 185, 186, 187, 188, 189, 190, 190, 190, - 191, 192, 193, 193, 194, 194, 194, 194, 195, 196, - 196, 197, 198, 199, 200, 200, 201, 202, 203, 203, - 204, 205, 205, 206, 206, 206, 207, 208, 208, 208, - 208, 208, 208, 209, 209, 210, 211, 212, 213, 214, - 214, 215, 215, 216, 217, 217, 218, 219, 220, 220, - 221, 222, 223, 224, 224, 225, 225, 226, 227, 227, - 228, 228, 228, 228, 229, 229, 230, 230, 230, 232, - 231, 234, 233, 235, 235, 236, 237, 237, 237, 237, - 237, 237, 238, 239, 239, 239, 240, 240, 240, 241, - 241, 241, 242, 242, 242, 243, 243, 244, 244, 245, - 245, 246, 247, 248, 249 + 124, 125, 125, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 135, 136, 136, 136, 136, 136, 136, + 136, 136, 136, 136, 136, 136, 137, 138, 139, 140, + 141, 142, 143, 144, 144, 145, 145, 145, 145, 146, + 146, 147, 148, 148, 149, 150, 151, 151, 151, 152, + 153, 154, 155, 156, 157, 158, 158, 158, 158, 159, + 159, 159, 159, 159, 160, 160, 160, 160, 160, 160, + 161, 162, 162, 163, 163, 163, 163, 163, 163, 163, + 163, 164, 165, 165, 166, 167, 167, 167, 167, 168, + 168, 169, 170, 171, 171, 172, 173, 174, 174, 175, + 175, 175, 176, 176, 176, 177, 177, 177, 178, 178, + 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, + 179, 180, 181, 181, 181, 182, 183, 183, 183, 183, + 183, 184, 185, 186, 186, 187, 188, 189, 190, 191, + 191, 191, 192, 193, 194, 194, 195, 195, 195, 195, + 196, 197, 197, 198, 199, 200, 201, 201, 202, 203, + 204, 204, 205, 206, 206, 207, 207, 207, 208, 209, + 209, 209, 209, 209, 209, 210, 210, 211, 212, 213, + 214, 215, 215, 216, 216, 217, 218, 218, 219, 220, + 221, 221, 222, 223, 224, 225, 225, 226, 226, 227, + 228, 228, 229, 229, 229, 229, 230, 230, 231, 231, + 231, 233, 232, 235, 234, 236, 236, 237, 238, 238, + 238, 238, 238, 238, 239, 240, 240, 240, 241, 241, + 241, 242, 242, 242, 243, 243, 243, 244, 244, 245, + 245, 246, 246, 247, 248, 249, 250 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -918,31 +920,31 @@ static const yytype_uint8 yyr2[] = { 0, 2, 4, 1, 1, 2, 0, 3, 2, 0, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 4, 4, 4, 6, 6, 8, 8, - 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 6, 3, 3, 2, 2, 7, - 2, 1, 1, 1, 1, 4, 1, 1, 1, 1, - 1, 1, 1, 3, 0, 2, 2, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, - 1, 0, 1, 1, 1, 1, 1, 1, 4, 2, - 2, 1, 2, 1, 2, 1, 2, 4, 4, 1, - 0, 3, 1, 1, 2, 1, 2, 1, 1, 3, - 6, 0, 1, 2, 4, 1, 3, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, - 1, 1, 1, 5, 1, 1, 1, 2, 1, 1, - 2, 1, 2, 6, 1, 3, 1, 1, 1, 1, - 1, 4, 1, 1, 1, 1, 1, 1, 2, 1, - 1, 5, 1, 2, 1, 1, 5, 2, 0, 6, - 3, 0, 1, 1, 1, 1, 1, 2, 1, 1, - 2, 4, 4, 0, 1, 1, 1, 1, 2, 1, - 1, 1, 1, 5, 1, 3, 5, 5, 1, 3, - 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 3, 5, 7, 9, 2, 2, 1, 1, 0, 0, - 3, 0, 3, 3, 1, 4, 2, 2, 2, 2, - 3, 2, 3, 0, 1, 1, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 3, 0, 3, 0, - 3, 1, 1, 1, 4 + 1, 1, 1, 1, 4, 4, 4, 6, 6, 8, + 8, 2, 12, 2, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 6, 3, 3, 2, + 2, 7, 2, 1, 1, 1, 1, 4, 1, 1, + 1, 1, 1, 1, 1, 3, 0, 2, 2, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, + 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, + 4, 2, 2, 1, 2, 1, 2, 1, 2, 4, + 4, 1, 0, 3, 1, 1, 2, 1, 2, 1, + 1, 3, 6, 0, 1, 2, 4, 1, 3, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 3, 1, 1, 1, 5, 1, 1, 1, 2, + 1, 1, 2, 1, 2, 6, 1, 3, 1, 1, + 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, + 2, 1, 1, 5, 1, 2, 1, 1, 5, 2, + 0, 6, 3, 0, 1, 1, 1, 1, 1, 2, + 1, 1, 2, 4, 4, 0, 1, 1, 1, 1, + 2, 1, 1, 1, 1, 5, 1, 3, 5, 5, + 1, 3, 5, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 3, 5, 7, 9, 2, 2, 1, 1, + 0, 0, 3, 0, 3, 3, 1, 4, 2, 2, + 2, 2, 3, 2, 3, 0, 1, 1, 0, 1, + 1, 0, 1, 1, 0, 1, 1, 0, 3, 0, + 3, 0, 3, 1, 1, 1, 4 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -951,221 +953,223 @@ static const yytype_uint8 yyr2[] = static const yytype_uint16 yydefact[] = { 0, 3, 4, 0, 6, 1, 9, 0, 5, 0, - 0, 231, 0, 0, 0, 0, 229, 2, 0, 0, - 0, 0, 0, 0, 0, 228, 0, 8, 0, 12, - 13, 14, 15, 16, 17, 18, 19, 21, 22, 20, - 0, 82, 83, 107, 108, 84, 85, 86, 87, 7, - 0, 0, 0, 0, 0, 0, 0, 58, 0, 81, - 57, 0, 0, 0, 0, 0, 69, 0, 0, 226, - 227, 30, 0, 0, 10, 11, 234, 232, 0, 0, - 0, 111, 228, 109, 230, 243, 241, 237, 239, 236, - 255, 238, 228, 77, 78, 79, 80, 47, 228, 228, - 228, 228, 228, 228, 71, 48, 219, 218, 0, 0, - 0, 0, 53, 228, 76, 0, 54, 56, 120, 121, - 199, 200, 122, 215, 216, 0, 0, 264, 88, 235, - 112, 0, 113, 117, 118, 119, 213, 214, 217, 0, - 245, 244, 246, 0, 240, 0, 0, 0, 0, 25, - 0, 24, 23, 252, 105, 103, 255, 90, 0, 0, - 0, 0, 0, 0, 249, 0, 249, 0, 0, 259, - 255, 128, 129, 130, 131, 133, 132, 134, 135, 136, - 137, 0, 138, 252, 95, 0, 93, 91, 255, 0, - 100, 89, 0, 74, 73, 75, 46, 0, 0, 233, - 0, 225, 224, 247, 248, 242, 261, 0, 228, 228, - 0, 0, 228, 253, 254, 104, 106, 0, 0, 0, - 198, 169, 170, 168, 0, 151, 251, 250, 150, 0, - 0, 0, 0, 193, 189, 0, 188, 255, 181, 175, - 174, 173, 0, 0, 0, 0, 94, 0, 96, 0, - 0, 92, 228, 220, 62, 0, 60, 61, 0, 228, - 0, 110, 256, 27, 26, 72, 45, 257, 0, 0, - 211, 0, 212, 0, 172, 0, 160, 0, 152, 0, - 157, 158, 141, 142, 159, 139, 140, 0, 195, 187, - 194, 0, 190, 183, 185, 184, 180, 182, 263, 0, - 156, 155, 162, 163, 0, 0, 102, 0, 99, 0, - 0, 0, 55, 70, 64, 44, 0, 0, 228, 0, - 31, 0, 228, 206, 210, 0, 0, 249, 197, 0, - 196, 0, 260, 167, 166, 164, 165, 161, 186, 0, - 97, 98, 101, 228, 221, 0, 0, 63, 228, 51, - 52, 50, 0, 0, 0, 115, 123, 126, 124, 201, - 202, 125, 262, 0, 32, 33, 34, 35, 36, 37, - 38, 39, 40, 41, 42, 43, 29, 28, 171, 146, - 148, 145, 0, 143, 144, 0, 192, 191, 176, 0, - 67, 65, 68, 66, 0, 0, 0, 127, 178, 228, - 114, 258, 149, 147, 153, 154, 228, 222, 228, 0, - 0, 0, 177, 116, 0, 0, 0, 204, 0, 208, - 0, 223, 228, 203, 0, 207, 0, 0, 49, 205, - 209, 0, 0, 179 + 0, 233, 0, 0, 0, 0, 231, 2, 0, 0, + 0, 0, 0, 0, 0, 230, 0, 0, 8, 0, + 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, + 23, 20, 0, 84, 85, 109, 110, 86, 87, 88, + 89, 7, 0, 0, 0, 0, 0, 0, 0, 60, + 0, 83, 59, 0, 0, 0, 0, 0, 71, 0, + 0, 228, 229, 31, 0, 0, 0, 10, 11, 236, + 234, 0, 0, 0, 113, 230, 111, 232, 245, 243, + 239, 241, 238, 257, 240, 230, 79, 80, 81, 82, + 49, 230, 230, 230, 230, 230, 230, 73, 50, 221, + 220, 0, 0, 0, 0, 55, 230, 78, 0, 56, + 58, 122, 123, 201, 202, 124, 217, 218, 0, 230, + 0, 266, 90, 237, 114, 0, 115, 119, 120, 121, + 215, 216, 219, 0, 247, 246, 248, 0, 242, 0, + 0, 0, 0, 26, 0, 25, 24, 254, 107, 105, + 257, 92, 0, 0, 0, 0, 0, 0, 251, 0, + 251, 0, 0, 261, 257, 130, 131, 132, 133, 135, + 134, 136, 137, 138, 139, 0, 140, 254, 97, 0, + 95, 93, 257, 0, 102, 91, 0, 76, 75, 77, + 48, 0, 0, 0, 235, 0, 227, 226, 249, 250, + 244, 263, 0, 230, 230, 0, 0, 230, 255, 256, + 106, 108, 0, 0, 0, 200, 171, 172, 170, 0, + 153, 253, 252, 152, 0, 0, 0, 0, 195, 191, + 0, 190, 257, 183, 177, 176, 175, 0, 0, 0, + 0, 96, 0, 98, 0, 0, 94, 230, 222, 64, + 0, 62, 63, 0, 230, 230, 0, 112, 258, 28, + 27, 74, 47, 259, 0, 0, 213, 0, 214, 0, + 174, 0, 162, 0, 154, 0, 159, 160, 143, 144, + 161, 141, 142, 0, 197, 189, 196, 0, 192, 185, + 187, 186, 182, 184, 265, 0, 158, 157, 164, 165, + 0, 0, 104, 0, 101, 0, 0, 0, 57, 72, + 66, 46, 0, 0, 0, 230, 0, 33, 0, 230, + 208, 212, 0, 0, 251, 199, 0, 198, 0, 262, + 169, 168, 166, 167, 163, 188, 0, 99, 100, 103, + 230, 223, 0, 0, 65, 230, 53, 54, 52, 230, + 0, 0, 0, 117, 125, 128, 126, 203, 204, 127, + 264, 0, 34, 35, 36, 37, 38, 39, 40, 41, + 42, 43, 44, 45, 30, 29, 173, 148, 150, 147, + 0, 145, 146, 0, 194, 193, 178, 0, 69, 67, + 70, 68, 0, 0, 0, 0, 129, 180, 230, 116, + 260, 151, 149, 155, 156, 230, 224, 230, 0, 0, + 0, 0, 179, 118, 0, 0, 0, 0, 206, 0, + 210, 0, 225, 230, 0, 205, 0, 209, 0, 0, + 51, 32, 207, 211, 0, 0, 181 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 3, 4, 6, 8, 9, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 268, 376, - 39, 146, 71, 58, 67, 315, 316, 351, 114, 59, - 115, 255, 256, 257, 347, 391, 393, 68, 314, 105, - 266, 196, 97, 40, 41, 116, 191, 309, 251, 307, - 157, 42, 43, 44, 131, 83, 261, 354, 132, 117, - 355, 356, 118, 171, 285, 172, 383, 403, 173, 228, - 174, 404, 175, 301, 286, 277, 176, 304, 337, 177, - 223, 178, 275, 179, 241, 180, 397, 412, 181, 296, - 297, 339, 238, 289, 290, 331, 329, 182, 119, 358, - 359, 416, 120, 360, 418, 121, 271, 273, 361, 122, - 136, 123, 124, 138, 72, 45, 55, 46, 50, 77, - 47, 60, 91, 142, 205, 229, 215, 144, 320, 243, - 207, 363, 299, 48 + -1, 3, 4, 6, 8, 9, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 274, + 384, 41, 150, 73, 60, 69, 321, 322, 358, 117, + 61, 118, 260, 261, 262, 354, 399, 401, 70, 320, + 108, 272, 200, 100, 42, 43, 119, 195, 315, 256, + 313, 161, 44, 45, 46, 135, 86, 267, 362, 136, + 120, 363, 364, 121, 175, 291, 176, 391, 412, 177, + 233, 178, 413, 179, 307, 292, 283, 180, 310, 344, + 181, 228, 182, 281, 183, 246, 184, 406, 422, 185, + 302, 303, 346, 243, 295, 296, 338, 336, 186, 122, + 366, 367, 427, 123, 368, 429, 124, 277, 279, 369, + 125, 140, 126, 127, 142, 74, 47, 57, 48, 52, + 80, 49, 62, 94, 146, 210, 234, 220, 148, 327, + 248, 212, 371, 305, 50 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -334 +#define YYPACT_NINF -384 static const yytype_int16 yypact[] = { - 134, -334, -334, 41, -334, -334, 47, -50, -334, 169, - 19, -334, 33, 60, 74, 114, -334, -334, -20, -20, - -20, -20, -20, -20, 115, 43, -20, -334, 108, -334, - -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, - 109, -334, -334, -334, -334, -334, -334, -334, -334, -334, - 118, 105, 106, 110, -23, 118, 3, -334, 4, 103, - -334, 112, 113, 116, 117, 119, -334, 120, 123, -334, - -334, -334, -16, 121, -334, -334, -334, 122, 132, -15, - 157, 209, -12, -334, 122, 20, -334, -334, -334, -334, - 131, -334, 43, -334, -334, -334, -334, -334, 43, 43, - 43, 43, 43, 43, -334, -334, -334, -334, 0, 67, - 86, -2, 133, 43, 64, 135, -334, -334, -334, -334, - -334, -334, -334, -334, -334, -16, 136, -334, -334, -334, - -334, 129, -334, -334, -334, -334, -334, -334, -334, 148, - -334, -334, 57, 218, -334, 137, 138, -16, 139, -334, - 140, -334, -334, 73, -334, -334, 131, -334, 141, 142, - 143, 179, 14, 144, 80, 145, 82, 88, -1, 146, - 131, -334, -334, -334, -334, -334, -334, -334, -334, -334, - -334, 183, -334, 73, -334, 147, -334, -334, 131, 149, - 150, -334, 42, -334, -334, -334, -334, -11, 152, -334, - 151, -334, -334, -334, -334, -334, -334, 153, 43, 43, - 154, 182, 43, -334, -334, -334, -334, 239, 244, 245, - -334, -334, -334, -334, 246, -334, -334, -334, -334, 203, - 246, -5, 162, 249, -334, 164, -334, 131, 26, -334, - -334, -334, 251, 247, 17, 166, -334, 254, -334, 255, - 254, -334, 43, -334, -334, 170, -334, -334, 176, 43, - 167, -334, -334, -334, -334, -334, -334, 173, 175, 177, - -334, 174, -334, 178, -334, 180, -334, 181, -334, 184, - -334, -334, -334, -334, -334, -334, -334, 263, -334, -334, - -334, 264, -334, -334, -334, -334, -334, -334, -334, 185, - -334, -334, -334, -334, 130, 266, -334, 187, -334, 188, - 189, 45, -334, -334, 100, -334, 192, -6, -8, 269, - -334, 107, 43, -334, -334, 236, 13, 82, -334, 191, - -334, 193, -334, -334, -334, -334, -334, -334, -334, 194, - -334, -334, -334, 43, -334, 279, 282, -334, 43, -334, - -334, -334, 77, 86, 48, -334, -334, -334, -334, -334, - -334, -334, -334, 196, -334, -334, -334, -334, -334, -334, - -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, - -334, -334, 275, -334, -334, 5, -334, -334, -334, 50, - -334, -334, -334, -334, 200, 201, 202, -334, 243, -8, - -334, -334, -334, -334, -334, -334, 43, -334, 43, 239, - 244, 204, -334, -334, 197, 206, 205, 211, 210, 216, - 266, -334, 43, -334, 239, -334, 244, -18, -334, -334, - -334, 266, 212, -334 + 167, -384, -384, 37, -384, -384, 60, -70, -384, 171, + -23, -384, -13, 9, 12, 63, -384, -384, -33, -33, + -33, -33, -33, -33, 67, 104, -33, -33, -384, 66, + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, 68, -384, -384, -384, -384, -384, -384, -384, + -384, -384, 115, 109, 111, 112, -4, 115, 22, -384, + 113, 106, -384, 118, 120, 121, 122, 123, -384, 124, + 130, -384, -384, -384, -16, 126, 127, -384, -384, -384, + 128, 140, -18, 158, 204, -39, -384, 128, 26, -384, + -384, -384, -384, 134, -384, 104, -384, -384, -384, -384, + -384, 104, 104, 104, 104, 104, 104, -384, -384, -384, + -384, 73, 84, 76, -10, 135, 104, 64, 136, -384, + -384, -384, -384, -384, -384, -384, -384, -384, -16, 104, + 147, -384, -384, -384, -384, 137, -384, -384, -384, -384, + -384, -384, -384, 194, -384, -384, 46, 225, -384, 141, + 142, -16, 143, -384, 144, -384, -384, 87, -384, -384, + 134, -384, 145, 146, 148, 189, 15, 149, 88, 150, + 97, 80, 0, 151, 134, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, 190, -384, 87, -384, 152, + -384, -384, 134, 153, 154, -384, 42, -384, -384, -384, + -384, -8, 156, 159, -384, 160, -384, -384, -384, -384, + -384, -384, 161, 104, 104, 163, 186, 104, -384, -384, + -384, -384, 249, 251, 252, -384, -384, -384, -384, 253, + -384, -384, -384, -384, 210, 253, 8, 169, 256, -384, + 172, -384, 134, 21, -384, -384, -384, 257, 254, -7, + 173, -384, 261, -384, 262, 261, -384, 104, -384, -384, + 176, -384, -384, 184, 104, 104, 174, -384, -384, -384, + -384, -384, -384, 180, 182, 183, -384, 185, -384, 187, + -384, 188, -384, 191, -384, 193, -384, -384, -384, -384, + -384, -384, -384, 269, -384, -384, -384, 270, -384, -384, + -384, -384, -384, -384, -384, 195, -384, -384, -384, -384, + 133, 271, -384, 196, -384, 197, 198, 45, -384, -384, + 108, -384, 192, -6, 201, -17, 273, -384, 110, 104, + -384, -384, 242, 29, 97, -384, 200, -384, 202, -384, + -384, -384, -384, -384, -384, -384, 203, -384, -384, -384, + 104, -384, 281, 288, -384, 104, -384, -384, -384, 104, + 103, 76, 48, -384, -384, -384, -384, -384, -384, -384, + -384, 205, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + 282, -384, -384, 5, -384, -384, -384, 50, -384, -384, + -384, -384, 208, 209, 211, 212, -384, 260, -17, -384, + -384, -384, -384, -384, -384, 104, -384, 104, 186, 249, + 251, 213, -384, -384, 214, 219, 220, 221, 228, 224, + 230, 271, -384, 104, 110, -384, 249, -384, 251, 49, + -384, -384, -384, -384, 271, 226, -384 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, - -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, - -334, -94, -88, 126, -334, -334, -333, -334, -91, -334, - -334, -334, -334, -334, -334, -334, -334, 128, -334, -334, - -334, -334, -334, -334, -334, 248, -334, -334, -334, 78, - -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, - -76, -334, -81, -334, -334, -334, -334, -334, -334, -334, - -334, -334, -334, -334, -307, 99, -334, -334, -334, -334, - -334, -334, -334, -334, -334, -334, -334, -334, -22, -334, - -334, -303, -334, -334, -334, -334, -334, -334, 250, -334, - -334, -334, -334, -334, -334, -334, -327, -316, 252, -334, - -334, -334, -80, -110, -82, -334, -334, -334, -334, 278, - -334, 256, -334, -334, -334, -161, 155, -146, -334, -334, - -334, -334, -334, -334 + -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384, -384, -100, + -115, -384, -97, -91, 119, -384, -384, -343, -384, -93, + -384, -384, -384, -384, -384, -384, -384, -384, 138, -384, + -384, -384, -384, -384, -384, -384, 255, -384, -384, -384, + 83, -384, -384, -384, -384, -384, -384, -384, -384, -384, + -384, -68, -384, -84, -384, -384, -384, -384, -384, -384, + -384, -384, -384, -384, -384, -308, 107, -384, -384, -384, + -384, -384, -384, -384, -384, -384, -384, -384, -384, -20, + -384, -384, -383, -384, -384, -384, -384, -384, -384, 258, + -384, -384, -384, -384, -384, -384, -384, -320, -371, 259, + -384, -384, -384, -83, -113, -85, -384, -384, -384, -384, + 289, -384, 264, -384, -384, -384, -165, 162, -150, -384, + -384, -384, -384, -384, -384 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -60 +#define YYTABLE_NINF -62 static const yytype_int16 yytable[] = { - 139, 133, 137, 192, 145, 231, 149, 106, 107, 152, - 216, 148, 254, 150, 151, 394, 147, 349, 147, 384, - 280, 147, 108, 108, 244, 239, 281, 183, 282, 153, - 280, 139, 85, 86, 198, 184, 281, 154, 280, 379, - 87, 5, 248, 221, 281, 56, 109, 140, 185, 10, - 109, 186, 302, 380, 352, 7, 210, 110, 187, 141, - 155, 110, 88, 89, 283, 353, 284, 293, 294, 240, - 222, 303, 188, 381, 156, 415, 284, 90, 405, 57, - 111, 111, 417, 112, 284, 382, 81, 431, 66, 428, - 82, 292, 388, 350, 419, 189, 190, 429, 113, 69, - 70, 158, 113, 69, 70, 225, 113, 226, 295, 226, - 430, 395, 92, 159, 160, 264, 161, 427, 203, 227, - 263, 227, 162, 396, 269, 204, 49, 147, 432, 163, - 164, 165, 51, 166, 213, 167, 232, 1, 2, 233, - 234, 214, 311, 235, 168, 61, 62, 63, 64, 65, - 252, 236, 73, 343, 69, 70, 399, 253, 406, 52, - 344, 169, 170, 400, 193, 407, 385, 194, 195, 237, - 139, 201, 202, 53, 11, 12, 13, 317, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 364, 365, 366, 367, 368, 369, 370, 371, 372, - 373, 374, 375, 93, 94, 95, 96, 333, 334, 335, - 336, 345, 346, 54, 66, 74, 75, 76, 78, 79, - 98, 99, 56, 80, 100, 101, 104, 102, 103, 125, - 126, 127, 130, 389, 377, 199, 139, 357, 137, 200, - 143, 206, -59, 220, 197, 208, 209, 211, 212, 245, - 217, 218, 219, 224, 230, 242, 247, 265, 249, 250, - 259, 139, 270, 262, 260, 267, 317, 272, 274, 276, - 278, 287, 288, 291, 298, 305, 300, 306, 308, 313, - 312, 318, 319, 321, 323, 322, 328, 330, 324, 338, - 325, 326, 362, 378, 327, 332, 414, 340, 341, 342, - 348, 386, 390, 387, 388, 392, 401, 402, 408, 411, - 409, 410, 421, 420, 422, 423, 424, 139, 357, 137, - 425, 426, 433, 413, 139, 258, 317, 128, 310, 279, - 0, 398, 134, 84, 135, 0, 129, 0, 246, 0, - 317 + 143, 137, 141, 196, 149, 236, 153, 109, 110, 156, + 221, 152, 402, 154, 155, 259, 151, 356, 151, 187, + 111, 151, 111, 112, 249, 392, 244, 188, 308, 10, + 286, 143, 58, 286, 113, 202, 287, 5, 203, 287, + 189, 288, 253, 190, 226, 360, 112, 309, 439, 430, + 191, 88, 89, 144, 286, 387, 361, 113, 215, 90, + 287, 445, 299, 300, 192, 145, 59, 443, 7, 388, + 245, 227, 71, 72, 425, 116, 290, 289, 114, 290, + 114, 91, 92, 115, 51, 414, 53, 193, 194, 389, + 440, 68, 298, 357, 71, 72, 93, 116, 116, 428, + 290, 390, 157, 301, 164, 84, 165, 208, 54, 85, + 158, 55, 166, 230, 209, 231, 442, 270, 162, 167, + 168, 169, 269, 170, 231, 171, 275, 232, 237, 151, + 163, 238, 239, 159, 172, 240, 232, 404, 63, 64, + 65, 66, 67, 241, 317, 75, 76, 160, 218, 405, + 257, 173, 174, 350, 444, 219, 408, 258, 415, 396, + 351, 242, 56, 409, 197, 416, 68, 198, 199, 393, + 1, 2, 143, 77, 324, 78, 11, 12, 13, 323, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 372, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 96, 97, 98, 99, + 340, 341, 342, 343, 79, 71, 72, 206, 207, 352, + 353, 95, 81, 58, 82, 83, 101, 134, 102, 103, + 104, 105, 106, 107, 128, 129, 130, 397, 385, 131, + 143, 365, 141, 147, -61, 201, 204, 205, 211, 213, + 214, 216, 217, 225, 222, 223, 250, 224, 229, 235, + 247, 252, 254, 255, 264, 143, 271, 265, 403, 273, + 323, 268, 276, 266, 278, 280, 282, 284, 293, 294, + 304, 297, 311, 306, 312, 314, 318, 319, 325, 326, + 328, 329, 335, 337, 345, 330, 370, 331, 332, 386, + 355, 333, 424, 334, 398, 339, 347, 348, 349, 359, + 394, 400, 395, 396, 411, 410, 417, 418, 426, 441, + 419, 420, 431, 143, 365, 141, 421, 433, 434, 432, + 143, 435, 323, 436, 437, 438, 446, 132, 316, 263, + 423, 407, 285, 138, 139, 0, 87, 133, 323, 251 }; static const yytype_int16 yycheck[] = { - 82, 82, 82, 113, 92, 166, 100, 23, 24, 103, - 156, 99, 23, 101, 102, 348, 98, 23, 100, 326, - 25, 103, 38, 38, 170, 26, 31, 29, 33, 29, - 25, 113, 29, 30, 125, 37, 31, 37, 25, 26, - 37, 0, 188, 29, 31, 65, 62, 27, 50, 99, - 62, 53, 35, 40, 62, 8, 147, 73, 60, 39, - 60, 73, 59, 60, 69, 73, 71, 41, 42, 70, - 56, 54, 74, 60, 74, 408, 71, 74, 385, 99, - 96, 96, 409, 99, 71, 72, 109, 105, 99, 422, - 113, 237, 110, 99, 410, 97, 98, 424, 114, 111, - 112, 34, 114, 111, 112, 25, 114, 27, 82, 27, - 426, 34, 108, 46, 28, 209, 30, 420, 61, 39, - 208, 39, 36, 46, 212, 68, 107, 209, 431, 43, - 44, 45, 99, 47, 61, 49, 48, 3, 4, 51, - 52, 68, 252, 55, 58, 19, 20, 21, 22, 23, - 108, 63, 26, 108, 111, 112, 108, 115, 108, 99, - 115, 75, 76, 115, 100, 115, 327, 103, 104, 81, - 252, 23, 24, 99, 5, 6, 7, 259, 9, 10, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 100, 101, 102, 103, 77, 78, 79, - 80, 111, 112, 99, 99, 107, 107, 99, 113, 113, - 108, 108, 65, 113, 108, 108, 103, 108, 108, 108, - 108, 99, 23, 343, 322, 99, 318, 318, 318, 110, - 109, 23, 109, 64, 109, 108, 108, 108, 108, 66, - 109, 109, 109, 109, 109, 109, 109, 103, 109, 109, - 108, 343, 23, 110, 113, 83, 348, 23, 23, 23, - 67, 109, 23, 109, 23, 109, 29, 23, 23, 103, - 110, 114, 109, 108, 110, 108, 23, 23, 110, 23, - 110, 110, 23, 57, 110, 110, 406, 110, 110, 110, - 108, 110, 23, 110, 110, 23, 110, 32, 108, 66, - 109, 109, 115, 109, 108, 110, 105, 399, 399, 399, - 110, 105, 110, 399, 406, 197, 408, 79, 250, 230, - -1, 353, 82, 55, 82, -1, 80, -1, 183, -1, - 422 + 85, 85, 85, 116, 95, 170, 103, 23, 24, 106, + 160, 102, 355, 104, 105, 23, 101, 23, 103, 29, + 38, 106, 38, 62, 174, 333, 26, 37, 35, 99, + 25, 116, 65, 25, 73, 128, 31, 0, 129, 31, + 50, 33, 192, 53, 29, 62, 62, 54, 431, 420, + 60, 29, 30, 27, 25, 26, 73, 73, 151, 37, + 31, 444, 41, 42, 74, 39, 99, 438, 8, 40, + 70, 56, 111, 112, 417, 114, 71, 69, 96, 71, + 96, 59, 60, 99, 107, 393, 99, 97, 98, 60, + 433, 99, 242, 99, 111, 112, 74, 114, 114, 419, + 71, 72, 29, 82, 28, 109, 30, 61, 99, 113, + 37, 99, 36, 25, 68, 27, 436, 214, 34, 43, + 44, 45, 213, 47, 27, 49, 217, 39, 48, 214, + 46, 51, 52, 60, 58, 55, 39, 34, 19, 20, + 21, 22, 23, 63, 257, 26, 27, 74, 61, 46, + 108, 75, 76, 108, 105, 68, 108, 115, 108, 110, + 115, 81, 99, 115, 100, 115, 99, 103, 104, 334, + 3, 4, 257, 107, 265, 107, 5, 6, 7, 264, + 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 84, 85, 86, 87, 88, 89, + 90, 91, 92, 93, 94, 95, 100, 101, 102, 103, + 77, 78, 79, 80, 99, 111, 112, 23, 24, 111, + 112, 108, 113, 65, 113, 113, 108, 23, 108, 108, + 108, 108, 108, 103, 108, 108, 108, 350, 329, 99, + 325, 325, 325, 109, 109, 109, 99, 110, 23, 108, + 108, 108, 108, 64, 109, 109, 66, 109, 109, 109, + 109, 109, 109, 109, 108, 350, 103, 108, 359, 83, + 355, 110, 23, 113, 23, 23, 23, 67, 109, 23, + 23, 109, 109, 29, 23, 23, 110, 103, 114, 109, + 108, 108, 23, 23, 23, 110, 23, 110, 110, 57, + 108, 110, 415, 110, 23, 110, 110, 110, 110, 108, + 110, 23, 110, 110, 32, 110, 108, 108, 418, 434, + 109, 109, 109, 408, 408, 408, 66, 108, 108, 115, + 415, 110, 417, 105, 110, 105, 110, 82, 255, 201, + 408, 361, 235, 85, 85, -1, 57, 83, 433, 187 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -1174,48 +1178,49 @@ static const yytype_uint8 yystos[] = { 0, 3, 4, 117, 118, 0, 119, 8, 120, 121, 99, 5, 6, 7, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 122, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 136, - 159, 160, 167, 168, 169, 231, 233, 236, 249, 107, - 234, 99, 99, 99, 99, 232, 65, 99, 139, 145, - 237, 139, 139, 139, 139, 139, 99, 140, 153, 111, - 112, 138, 230, 139, 107, 107, 99, 235, 113, 113, - 113, 109, 113, 171, 235, 29, 30, 37, 59, 60, - 74, 238, 108, 100, 101, 102, 103, 158, 108, 108, - 108, 108, 108, 108, 103, 155, 23, 24, 38, 62, - 73, 96, 99, 114, 144, 146, 161, 175, 178, 214, - 218, 221, 225, 227, 228, 108, 108, 99, 161, 237, - 23, 170, 174, 178, 214, 224, 226, 228, 229, 230, - 27, 39, 239, 109, 243, 138, 137, 230, 138, 137, - 138, 138, 137, 29, 37, 60, 74, 166, 34, 46, - 28, 30, 36, 43, 44, 45, 47, 49, 58, 75, - 76, 179, 181, 184, 186, 188, 192, 195, 197, 199, - 201, 204, 213, 29, 37, 50, 53, 60, 74, 97, - 98, 162, 229, 100, 103, 104, 157, 109, 144, 99, - 110, 23, 24, 61, 68, 240, 23, 246, 108, 108, - 144, 108, 108, 61, 68, 242, 243, 109, 109, 109, - 64, 29, 56, 196, 109, 25, 27, 39, 185, 241, - 109, 241, 48, 51, 52, 55, 63, 81, 208, 26, - 70, 200, 109, 245, 243, 66, 242, 109, 243, 109, - 109, 164, 108, 115, 23, 147, 148, 149, 153, 108, - 113, 172, 110, 138, 137, 103, 156, 83, 134, 138, - 23, 222, 23, 223, 23, 198, 23, 191, 67, 191, - 25, 31, 33, 69, 71, 180, 190, 109, 23, 209, - 210, 109, 243, 41, 42, 82, 205, 206, 23, 248, - 29, 189, 35, 54, 193, 109, 23, 165, 23, 163, - 165, 229, 110, 103, 154, 141, 142, 230, 114, 109, - 244, 108, 108, 110, 110, 110, 110, 110, 23, 212, - 23, 211, 110, 77, 78, 79, 80, 194, 23, 207, - 110, 110, 110, 108, 115, 111, 112, 150, 108, 23, - 99, 143, 62, 73, 173, 176, 177, 178, 215, 216, - 219, 224, 23, 247, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 135, 138, 57, 26, - 40, 60, 72, 182, 190, 241, 110, 110, 110, 229, - 23, 151, 23, 152, 142, 34, 46, 202, 204, 108, - 115, 110, 32, 183, 187, 190, 108, 115, 108, 109, - 109, 66, 203, 176, 229, 142, 217, 222, 220, 223, - 109, 115, 108, 110, 105, 110, 105, 207, 142, 222, - 223, 105, 207, 110 + 15, 16, 17, 18, 19, 20, 21, 22, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, + 134, 137, 160, 161, 168, 169, 170, 232, 234, 237, + 250, 107, 235, 99, 99, 99, 99, 233, 65, 99, + 140, 146, 238, 140, 140, 140, 140, 140, 99, 141, + 154, 111, 112, 139, 231, 140, 140, 107, 107, 99, + 236, 113, 113, 113, 109, 113, 172, 236, 29, 30, + 37, 59, 60, 74, 239, 108, 100, 101, 102, 103, + 159, 108, 108, 108, 108, 108, 108, 103, 156, 23, + 24, 38, 62, 73, 96, 99, 114, 145, 147, 162, + 176, 179, 215, 219, 222, 226, 228, 229, 108, 108, + 108, 99, 162, 238, 23, 171, 175, 179, 215, 225, + 227, 229, 230, 231, 27, 39, 240, 109, 244, 139, + 138, 231, 139, 138, 139, 139, 138, 29, 37, 60, + 74, 167, 34, 46, 28, 30, 36, 43, 44, 45, + 47, 49, 58, 75, 76, 180, 182, 185, 187, 189, + 193, 196, 198, 200, 202, 205, 214, 29, 37, 50, + 53, 60, 74, 97, 98, 163, 230, 100, 103, 104, + 158, 109, 145, 139, 99, 110, 23, 24, 61, 68, + 241, 23, 247, 108, 108, 145, 108, 108, 61, 68, + 243, 244, 109, 109, 109, 64, 29, 56, 197, 109, + 25, 27, 39, 186, 242, 109, 242, 48, 51, 52, + 55, 63, 81, 209, 26, 70, 201, 109, 246, 244, + 66, 243, 109, 244, 109, 109, 165, 108, 115, 23, + 148, 149, 150, 154, 108, 108, 113, 173, 110, 139, + 138, 103, 157, 83, 135, 139, 23, 223, 23, 224, + 23, 199, 23, 192, 67, 192, 25, 31, 33, 69, + 71, 181, 191, 109, 23, 210, 211, 109, 244, 41, + 42, 82, 206, 207, 23, 249, 29, 190, 35, 54, + 194, 109, 23, 166, 23, 164, 166, 230, 110, 103, + 155, 142, 143, 231, 139, 114, 109, 245, 108, 108, + 110, 110, 110, 110, 110, 23, 213, 23, 212, 110, + 77, 78, 79, 80, 195, 23, 208, 110, 110, 110, + 108, 115, 111, 112, 151, 108, 23, 99, 144, 108, + 62, 73, 174, 177, 178, 179, 216, 217, 220, 225, + 23, 248, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 95, 136, 139, 57, 26, 40, 60, + 72, 183, 191, 242, 110, 110, 110, 230, 23, 152, + 23, 153, 143, 139, 34, 46, 203, 205, 108, 115, + 110, 32, 184, 188, 191, 108, 115, 108, 108, 109, + 109, 66, 204, 177, 230, 143, 135, 218, 223, 221, + 224, 109, 115, 108, 108, 110, 105, 110, 105, 208, + 143, 136, 223, 224, 105, 208, 110 }; #define yyerrok (yyerrstatus = 0) @@ -2159,69 +2164,69 @@ yyreduce: ;} break; - case 23: + case 24: /* Line 1455 of yacc.c */ -#line 353 "program_parse.y" +#line 354 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_ARL, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} break; - case 24: + case 25: /* Line 1455 of yacc.c */ -#line 359 "program_parse.y" +#line 360 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (4)].temp_inst).Opcode, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (4)].temp_inst).SaturateMode; ;} break; - case 25: + case 26: /* Line 1455 of yacc.c */ -#line 366 "program_parse.y" +#line 367 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (4)].temp_inst).Opcode, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (4)].temp_inst).SaturateMode; ;} break; - case 26: + case 27: /* Line 1455 of yacc.c */ -#line 373 "program_parse.y" +#line 374 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (6)].temp_inst).Opcode, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; ;} break; - case 27: + case 28: /* Line 1455 of yacc.c */ -#line 381 "program_parse.y" +#line 382 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (6)].temp_inst).Opcode, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; ;} break; - case 28: + case 29: /* Line 1455 of yacc.c */ -#line 389 "program_parse.y" +#line 390 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (8)].temp_inst).Opcode, & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), & (yyvsp[(6) - (8)].src_reg), & (yyvsp[(8) - (8)].src_reg)); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (8)].temp_inst).SaturateMode; ;} break; - case 29: + case 30: /* Line 1455 of yacc.c */ -#line 396 "program_parse.y" +#line 397 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (8)].temp_inst).Opcode, & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), NULL, NULL); if ((yyval.inst) != NULL) { @@ -2266,113 +2271,161 @@ yyreduce: ;} break; - case 30: + case 31: /* Line 1455 of yacc.c */ -#line 441 "program_parse.y" +#line 442 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_KIL, NULL, & (yyvsp[(2) - (2)].src_reg), NULL, NULL); state->fragment.UsesKill = 1; ;} break; - case 31: + case 32: + +/* Line 1455 of yacc.c */ +#line 449 "program_parse.y" + { + (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (12)].temp_inst).Opcode, & (yyvsp[(2) - (12)].dst_reg), & (yyvsp[(4) - (12)].src_reg), & (yyvsp[(6) - (12)].src_reg), & (yyvsp[(8) - (12)].src_reg)); + if ((yyval.inst) != NULL) { + const GLbitfield tex_mask = (1U << (yyvsp[(10) - (12)].integer)); + GLbitfield shadow_tex = 0; + GLbitfield target_mask = 0; + + + (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (12)].temp_inst).SaturateMode; + (yyval.inst)->Base.TexSrcUnit = (yyvsp[(10) - (12)].integer); + + if ((yyvsp[(12) - (12)].integer) < 0) { + shadow_tex = tex_mask; + + (yyval.inst)->Base.TexSrcTarget = -(yyvsp[(12) - (12)].integer); + (yyval.inst)->Base.TexShadow = 1; + } else { + (yyval.inst)->Base.TexSrcTarget = (yyvsp[(12) - (12)].integer); + } + + target_mask = (1U << (yyval.inst)->Base.TexSrcTarget); + + /* If this texture unit was previously accessed and that access + * had a different texture target, generate an error. + * + * If this texture unit was previously accessed and that access + * had a different shadow mode, generate an error. + */ + if ((state->prog->TexturesUsed[(yyvsp[(10) - (12)].integer)] != 0) + && ((state->prog->TexturesUsed[(yyvsp[(10) - (12)].integer)] != target_mask) + || ((state->prog->ShadowSamplers & tex_mask) + != shadow_tex))) { + yyerror(& (yylsp[(12) - (12)]), state, + "multiple targets used on one texture image unit"); + YYERROR; + } + + + state->prog->TexturesUsed[(yyvsp[(10) - (12)].integer)] |= target_mask; + state->prog->ShadowSamplers |= shadow_tex; + } + ;} + break; + + case 33: /* Line 1455 of yacc.c */ -#line 448 "program_parse.y" +#line 494 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; - case 32: + case 34: /* Line 1455 of yacc.c */ -#line 453 "program_parse.y" +#line 499 "program_parse.y" { (yyval.integer) = TEXTURE_1D_INDEX; ;} break; - case 33: + case 35: /* Line 1455 of yacc.c */ -#line 454 "program_parse.y" +#line 500 "program_parse.y" { (yyval.integer) = TEXTURE_2D_INDEX; ;} break; - case 34: + case 36: /* Line 1455 of yacc.c */ -#line 455 "program_parse.y" +#line 501 "program_parse.y" { (yyval.integer) = TEXTURE_3D_INDEX; ;} break; - case 35: + case 37: /* Line 1455 of yacc.c */ -#line 456 "program_parse.y" +#line 502 "program_parse.y" { (yyval.integer) = TEXTURE_CUBE_INDEX; ;} break; - case 36: + case 38: /* Line 1455 of yacc.c */ -#line 457 "program_parse.y" +#line 503 "program_parse.y" { (yyval.integer) = TEXTURE_RECT_INDEX; ;} break; - case 37: + case 39: /* Line 1455 of yacc.c */ -#line 458 "program_parse.y" +#line 504 "program_parse.y" { (yyval.integer) = -TEXTURE_1D_INDEX; ;} break; - case 38: + case 40: /* Line 1455 of yacc.c */ -#line 459 "program_parse.y" +#line 505 "program_parse.y" { (yyval.integer) = -TEXTURE_2D_INDEX; ;} break; - case 39: + case 41: /* Line 1455 of yacc.c */ -#line 460 "program_parse.y" +#line 506 "program_parse.y" { (yyval.integer) = -TEXTURE_RECT_INDEX; ;} break; - case 40: + case 42: /* Line 1455 of yacc.c */ -#line 461 "program_parse.y" +#line 507 "program_parse.y" { (yyval.integer) = TEXTURE_1D_ARRAY_INDEX; ;} break; - case 41: + case 43: /* Line 1455 of yacc.c */ -#line 462 "program_parse.y" +#line 508 "program_parse.y" { (yyval.integer) = TEXTURE_2D_ARRAY_INDEX; ;} break; - case 42: + case 44: /* Line 1455 of yacc.c */ -#line 463 "program_parse.y" +#line 509 "program_parse.y" { (yyval.integer) = -TEXTURE_1D_ARRAY_INDEX; ;} break; - case 43: + case 45: /* Line 1455 of yacc.c */ -#line 464 "program_parse.y" +#line 510 "program_parse.y" { (yyval.integer) = -TEXTURE_2D_ARRAY_INDEX; ;} break; - case 44: + case 46: /* Line 1455 of yacc.c */ -#line 468 "program_parse.y" +#line 514 "program_parse.y" { /* FIXME: Is this correct? Should the extenedSwizzle be applied * FIXME: to the existing swizzle? @@ -2385,10 +2438,10 @@ yyreduce: ;} break; - case 45: + case 47: /* Line 1455 of yacc.c */ -#line 481 "program_parse.y" +#line 527 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); @@ -2401,10 +2454,10 @@ yyreduce: ;} break; - case 46: + case 48: /* Line 1455 of yacc.c */ -#line 494 "program_parse.y" +#line 540 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); @@ -2417,10 +2470,10 @@ yyreduce: ;} break; - case 47: + case 49: /* Line 1455 of yacc.c */ -#line 507 "program_parse.y" +#line 553 "program_parse.y" { (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); (yyval.dst_reg).WriteMask = (yyvsp[(2) - (2)].swiz_mask).mask; @@ -2442,10 +2495,10 @@ yyreduce: ;} break; - case 48: + case 50: /* Line 1455 of yacc.c */ -#line 529 "program_parse.y" +#line 575 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_ADDRESS; @@ -2454,10 +2507,10 @@ yyreduce: ;} break; - case 49: + case 51: /* Line 1455 of yacc.c */ -#line 538 "program_parse.y" +#line 584 "program_parse.y" { const unsigned xyzw_valid = ((yyvsp[(1) - (7)].ext_swizzle).xyzw_valid << 0) @@ -2490,20 +2543,20 @@ yyreduce: ;} break; - case 50: + case 52: /* Line 1455 of yacc.c */ -#line 571 "program_parse.y" +#line 617 "program_parse.y" { (yyval.ext_swizzle) = (yyvsp[(2) - (2)].ext_swizzle); (yyval.ext_swizzle).negate = ((yyvsp[(1) - (2)].negate)) ? 1 : 0; ;} break; - case 51: + case 53: /* Line 1455 of yacc.c */ -#line 578 "program_parse.y" +#line 624 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) != 0) && ((yyvsp[(1) - (1)].integer) != 1)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2520,10 +2573,10 @@ yyreduce: ;} break; - case 52: + case 54: /* Line 1455 of yacc.c */ -#line 593 "program_parse.y" +#line 639 "program_parse.y" { if (strlen((yyvsp[(1) - (1)].string)) > 1) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2573,10 +2626,10 @@ yyreduce: ;} break; - case 53: + case 55: /* Line 1455 of yacc.c */ -#line 643 "program_parse.y" +#line 689 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2620,10 +2673,10 @@ yyreduce: ;} break; - case 54: + case 56: /* Line 1455 of yacc.c */ -#line 685 "program_parse.y" +#line 731 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = PROGRAM_INPUT; @@ -2636,10 +2689,10 @@ yyreduce: ;} break; - case 55: + case 57: /* Line 1455 of yacc.c */ -#line 696 "program_parse.y" +#line 742 "program_parse.y" { if (! (yyvsp[(3) - (4)].src_reg).Base.RelAddr && ((unsigned) (yyvsp[(3) - (4)].src_reg).Base.Index >= (yyvsp[(1) - (4)].sym)->param_binding_length)) { @@ -2662,10 +2715,10 @@ yyreduce: ;} break; - case 56: + case 58: /* Line 1455 of yacc.c */ -#line 717 "program_parse.y" +#line 763 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = ((yyvsp[(1) - (1)].temp_sym).name != NULL) @@ -2675,10 +2728,10 @@ yyreduce: ;} break; - case 57: + case 59: /* Line 1455 of yacc.c */ -#line 727 "program_parse.y" +#line 773 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_OUTPUT; @@ -2686,10 +2739,10 @@ yyreduce: ;} break; - case 58: + case 60: /* Line 1455 of yacc.c */ -#line 733 "program_parse.y" +#line 779 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2720,10 +2773,10 @@ yyreduce: ;} break; - case 59: + case 61: /* Line 1455 of yacc.c */ -#line 764 "program_parse.y" +#line 810 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2740,20 +2793,20 @@ yyreduce: ;} break; - case 62: + case 64: /* Line 1455 of yacc.c */ -#line 783 "program_parse.y" +#line 829 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].integer); ;} break; - case 63: + case 65: /* Line 1455 of yacc.c */ -#line 790 "program_parse.y" +#line 836 "program_parse.y" { /* FINISHME: Add support for multiple address registers. */ @@ -2765,31 +2818,31 @@ yyreduce: ;} break; - case 64: + case 66: /* Line 1455 of yacc.c */ -#line 801 "program_parse.y" +#line 847 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 65: + case 67: /* Line 1455 of yacc.c */ -#line 802 "program_parse.y" +#line 848 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; - case 66: + case 68: /* Line 1455 of yacc.c */ -#line 803 "program_parse.y" +#line 849 "program_parse.y" { (yyval.integer) = -(yyvsp[(2) - (2)].integer); ;} break; - case 67: + case 69: /* Line 1455 of yacc.c */ -#line 807 "program_parse.y" +#line 853 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 63)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2801,10 +2854,10 @@ yyreduce: ;} break; - case 68: + case 70: /* Line 1455 of yacc.c */ -#line 819 "program_parse.y" +#line 865 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 64)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2816,10 +2869,10 @@ yyreduce: ;} break; - case 69: + case 71: /* Line 1455 of yacc.c */ -#line 831 "program_parse.y" +#line 877 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2837,10 +2890,10 @@ yyreduce: ;} break; - case 70: + case 72: /* Line 1455 of yacc.c */ -#line 849 "program_parse.y" +#line 895 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, "invalid address component selector"); @@ -2851,10 +2904,10 @@ yyreduce: ;} break; - case 71: + case 73: /* Line 1455 of yacc.c */ -#line 860 "program_parse.y" +#line 906 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2866,24 +2919,24 @@ yyreduce: ;} break; - case 76: + case 78: /* Line 1455 of yacc.c */ -#line 876 "program_parse.y" +#line 922 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; - case 81: + case 83: /* Line 1455 of yacc.c */ -#line 880 "program_parse.y" +#line 926 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; - case 88: + case 90: /* Line 1455 of yacc.c */ -#line 892 "program_parse.y" +#line 938 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_attrib, & (yylsp[(2) - (4)])); @@ -2901,55 +2954,55 @@ yyreduce: ;} break; - case 89: + case 91: /* Line 1455 of yacc.c */ -#line 910 "program_parse.y" +#line 956 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} break; - case 90: + case 92: /* Line 1455 of yacc.c */ -#line 914 "program_parse.y" +#line 960 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} break; - case 91: + case 93: /* Line 1455 of yacc.c */ -#line 920 "program_parse.y" +#line 966 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_POS; ;} break; - case 92: + case 94: /* Line 1455 of yacc.c */ -#line 924 "program_parse.y" +#line 970 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_WEIGHT; ;} break; - case 93: + case 95: /* Line 1455 of yacc.c */ -#line 928 "program_parse.y" +#line 974 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_NORMAL; ;} break; - case 94: + case 96: /* Line 1455 of yacc.c */ -#line 932 "program_parse.y" +#line 978 "program_parse.y" { if (!state->ctx->Extensions.EXT_secondary_color) { yyerror(& (yylsp[(2) - (2)]), state, "GL_EXT_secondary_color not supported"); @@ -2960,10 +3013,10 @@ yyreduce: ;} break; - case 95: + case 97: /* Line 1455 of yacc.c */ -#line 941 "program_parse.y" +#line 987 "program_parse.y" { if (!state->ctx->Extensions.EXT_fog_coord) { yyerror(& (yylsp[(1) - (1)]), state, "GL_EXT_fog_coord not supported"); @@ -2974,38 +3027,38 @@ yyreduce: ;} break; - case 96: + case 98: /* Line 1455 of yacc.c */ -#line 950 "program_parse.y" +#line 996 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} break; - case 97: + case 99: /* Line 1455 of yacc.c */ -#line 954 "program_parse.y" +#line 1000 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; ;} break; - case 98: + case 100: /* Line 1455 of yacc.c */ -#line 959 "program_parse.y" +#line 1005 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_GENERIC0 + (yyvsp[(3) - (4)].integer); ;} break; - case 99: + case 101: /* Line 1455 of yacc.c */ -#line 965 "program_parse.y" +#line 1011 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxAttribs) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex attribute reference"); @@ -3016,46 +3069,46 @@ yyreduce: ;} break; - case 103: + case 105: /* Line 1455 of yacc.c */ -#line 979 "program_parse.y" +#line 1025 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_WPOS; ;} break; - case 104: + case 106: /* Line 1455 of yacc.c */ -#line 983 "program_parse.y" +#line 1029 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_COL0 + (yyvsp[(2) - (2)].integer); ;} break; - case 105: + case 107: /* Line 1455 of yacc.c */ -#line 987 "program_parse.y" +#line 1033 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_FOGC; ;} break; - case 106: + case 108: /* Line 1455 of yacc.c */ -#line 991 "program_parse.y" +#line 1037 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} break; - case 109: + case 111: /* Line 1455 of yacc.c */ -#line 999 "program_parse.y" +#line 1045 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (3)].string), at_param, & (yylsp[(2) - (3)])); @@ -3071,10 +3124,10 @@ yyreduce: ;} break; - case 110: + case 112: /* Line 1455 of yacc.c */ -#line 1015 "program_parse.y" +#line 1061 "program_parse.y" { if (((yyvsp[(4) - (6)].integer) != 0) && ((unsigned) (yyvsp[(4) - (6)].integer) != (yyvsp[(6) - (6)].temp_sym).param_binding_length)) { yyerror(& (yylsp[(4) - (6)]), state, @@ -3096,19 +3149,19 @@ yyreduce: ;} break; - case 111: + case 113: /* Line 1455 of yacc.c */ -#line 1037 "program_parse.y" +#line 1083 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 112: + case 114: /* Line 1455 of yacc.c */ -#line 1041 "program_parse.y" +#line 1087 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 1) || ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxParameters)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid parameter array size"); @@ -3119,38 +3172,38 @@ yyreduce: ;} break; - case 113: + case 115: /* Line 1455 of yacc.c */ -#line 1052 "program_parse.y" +#line 1098 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(2) - (2)].temp_sym); ;} break; - case 114: + case 116: /* Line 1455 of yacc.c */ -#line 1058 "program_parse.y" +#line 1104 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(3) - (4)].temp_sym); ;} break; - case 116: + case 118: /* Line 1455 of yacc.c */ -#line 1065 "program_parse.y" +#line 1111 "program_parse.y" { (yyvsp[(1) - (3)].temp_sym).param_binding_length += (yyvsp[(3) - (3)].temp_sym).param_binding_length; (yyval.temp_sym) = (yyvsp[(1) - (3)].temp_sym); ;} break; - case 117: + case 119: /* Line 1455 of yacc.c */ -#line 1072 "program_parse.y" +#line 1118 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3158,10 +3211,10 @@ yyreduce: ;} break; - case 118: + case 120: /* Line 1455 of yacc.c */ -#line 1078 "program_parse.y" +#line 1124 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3169,10 +3222,10 @@ yyreduce: ;} break; - case 119: + case 121: /* Line 1455 of yacc.c */ -#line 1084 "program_parse.y" +#line 1130 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3180,10 +3233,10 @@ yyreduce: ;} break; - case 120: + case 122: /* Line 1455 of yacc.c */ -#line 1092 "program_parse.y" +#line 1138 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3191,10 +3244,10 @@ yyreduce: ;} break; - case 121: + case 123: /* Line 1455 of yacc.c */ -#line 1098 "program_parse.y" +#line 1144 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3202,10 +3255,10 @@ yyreduce: ;} break; - case 122: + case 124: /* Line 1455 of yacc.c */ -#line 1104 "program_parse.y" +#line 1150 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3213,10 +3266,10 @@ yyreduce: ;} break; - case 123: + case 125: /* Line 1455 of yacc.c */ -#line 1112 "program_parse.y" +#line 1158 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3224,10 +3277,10 @@ yyreduce: ;} break; - case 124: + case 126: /* Line 1455 of yacc.c */ -#line 1118 "program_parse.y" +#line 1164 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3235,10 +3288,10 @@ yyreduce: ;} break; - case 125: + case 127: /* Line 1455 of yacc.c */ -#line 1124 "program_parse.y" +#line 1170 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3246,101 +3299,101 @@ yyreduce: ;} break; - case 126: - -/* Line 1455 of yacc.c */ -#line 1131 "program_parse.y" - { memcpy((yyval.state), (yyvsp[(1) - (1)].state), sizeof((yyval.state))); ;} - break; - - case 127: - -/* Line 1455 of yacc.c */ -#line 1132 "program_parse.y" - { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} - break; - case 128: /* Line 1455 of yacc.c */ -#line 1135 "program_parse.y" - { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} +#line 1177 "program_parse.y" + { memcpy((yyval.state), (yyvsp[(1) - (1)].state), sizeof((yyval.state))); ;} break; case 129: /* Line 1455 of yacc.c */ -#line 1136 "program_parse.y" +#line 1178 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 130: /* Line 1455 of yacc.c */ -#line 1137 "program_parse.y" +#line 1181 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 131: /* Line 1455 of yacc.c */ -#line 1138 "program_parse.y" +#line 1182 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 132: /* Line 1455 of yacc.c */ -#line 1139 "program_parse.y" +#line 1183 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 133: /* Line 1455 of yacc.c */ -#line 1140 "program_parse.y" +#line 1184 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 134: /* Line 1455 of yacc.c */ -#line 1141 "program_parse.y" +#line 1185 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 135: /* Line 1455 of yacc.c */ -#line 1142 "program_parse.y" +#line 1186 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 136: /* Line 1455 of yacc.c */ -#line 1143 "program_parse.y" +#line 1187 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 137: /* Line 1455 of yacc.c */ -#line 1144 "program_parse.y" +#line 1188 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 138: /* Line 1455 of yacc.c */ -#line 1145 "program_parse.y" +#line 1189 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 139: /* Line 1455 of yacc.c */ -#line 1149 "program_parse.y" +#line 1190 "program_parse.y" + { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} + break; + + case 140: + +/* Line 1455 of yacc.c */ +#line 1191 "program_parse.y" + { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} + break; + + case 141: + +/* Line 1455 of yacc.c */ +#line 1195 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_MATERIAL; @@ -3349,37 +3402,37 @@ yyreduce: ;} break; - case 140: + case 142: /* Line 1455 of yacc.c */ -#line 1158 "program_parse.y" +#line 1204 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 141: + case 143: /* Line 1455 of yacc.c */ -#line 1162 "program_parse.y" +#line 1208 "program_parse.y" { (yyval.integer) = STATE_EMISSION; ;} break; - case 142: + case 144: /* Line 1455 of yacc.c */ -#line 1166 "program_parse.y" +#line 1212 "program_parse.y" { (yyval.integer) = STATE_SHININESS; ;} break; - case 143: + case 145: /* Line 1455 of yacc.c */ -#line 1172 "program_parse.y" +#line 1218 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHT; @@ -3388,28 +3441,28 @@ yyreduce: ;} break; - case 144: + case 146: /* Line 1455 of yacc.c */ -#line 1181 "program_parse.y" +#line 1227 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 145: + case 147: /* Line 1455 of yacc.c */ -#line 1185 "program_parse.y" +#line 1231 "program_parse.y" { (yyval.integer) = STATE_POSITION; ;} break; - case 146: + case 148: /* Line 1455 of yacc.c */ -#line 1189 "program_parse.y" +#line 1235 "program_parse.y" { if (!state->ctx->Extensions.EXT_point_parameters) { yyerror(& (yylsp[(1) - (1)]), state, "GL_ARB_point_parameters not supported"); @@ -3420,57 +3473,57 @@ yyreduce: ;} break; - case 147: + case 149: /* Line 1455 of yacc.c */ -#line 1198 "program_parse.y" +#line 1244 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; - case 148: + case 150: /* Line 1455 of yacc.c */ -#line 1202 "program_parse.y" +#line 1248 "program_parse.y" { (yyval.integer) = STATE_HALF_VECTOR; ;} break; - case 149: + case 151: /* Line 1455 of yacc.c */ -#line 1208 "program_parse.y" +#line 1254 "program_parse.y" { (yyval.integer) = STATE_SPOT_DIRECTION; ;} break; - case 150: + case 152: /* Line 1455 of yacc.c */ -#line 1214 "program_parse.y" +#line 1260 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (2)].state)[1]; ;} break; - case 151: + case 153: /* Line 1455 of yacc.c */ -#line 1221 "program_parse.y" +#line 1267 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_AMBIENT; ;} break; - case 152: + case 154: /* Line 1455 of yacc.c */ -#line 1226 "program_parse.y" +#line 1272 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_SCENECOLOR; @@ -3478,10 +3531,10 @@ yyreduce: ;} break; - case 153: + case 155: /* Line 1455 of yacc.c */ -#line 1234 "program_parse.y" +#line 1280 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTPROD; @@ -3491,10 +3544,10 @@ yyreduce: ;} break; - case 155: + case 157: /* Line 1455 of yacc.c */ -#line 1246 "program_parse.y" +#line 1292 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(3) - (3)].integer); @@ -3502,46 +3555,46 @@ yyreduce: ;} break; - case 156: + case 158: /* Line 1455 of yacc.c */ -#line 1254 "program_parse.y" +#line 1300 "program_parse.y" { (yyval.integer) = STATE_TEXENV_COLOR; ;} break; - case 157: + case 159: /* Line 1455 of yacc.c */ -#line 1260 "program_parse.y" +#line 1306 "program_parse.y" { (yyval.integer) = STATE_AMBIENT; ;} break; - case 158: + case 160: /* Line 1455 of yacc.c */ -#line 1264 "program_parse.y" +#line 1310 "program_parse.y" { (yyval.integer) = STATE_DIFFUSE; ;} break; - case 159: + case 161: /* Line 1455 of yacc.c */ -#line 1268 "program_parse.y" +#line 1314 "program_parse.y" { (yyval.integer) = STATE_SPECULAR; ;} break; - case 160: + case 162: /* Line 1455 of yacc.c */ -#line 1274 "program_parse.y" +#line 1320 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxLights) { yyerror(& (yylsp[(1) - (1)]), state, "invalid light selector"); @@ -3552,10 +3605,10 @@ yyreduce: ;} break; - case 161: + case 163: /* Line 1455 of yacc.c */ -#line 1285 "program_parse.y" +#line 1331 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_TEXGEN; @@ -3564,92 +3617,92 @@ yyreduce: ;} break; - case 162: + case 164: /* Line 1455 of yacc.c */ -#line 1294 "program_parse.y" +#line 1340 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S; ;} break; - case 163: + case 165: /* Line 1455 of yacc.c */ -#line 1298 "program_parse.y" +#line 1344 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_OBJECT_S; ;} break; - case 164: + case 166: /* Line 1455 of yacc.c */ -#line 1303 "program_parse.y" +#line 1349 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S; ;} break; - case 165: + case 167: /* Line 1455 of yacc.c */ -#line 1307 "program_parse.y" +#line 1353 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S; ;} break; - case 166: + case 168: /* Line 1455 of yacc.c */ -#line 1311 "program_parse.y" +#line 1357 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S; ;} break; - case 167: + case 169: /* Line 1455 of yacc.c */ -#line 1315 "program_parse.y" +#line 1361 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S; ;} break; - case 168: + case 170: /* Line 1455 of yacc.c */ -#line 1321 "program_parse.y" +#line 1367 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); ;} break; - case 169: + case 171: /* Line 1455 of yacc.c */ -#line 1328 "program_parse.y" +#line 1374 "program_parse.y" { (yyval.integer) = STATE_FOG_COLOR; ;} break; - case 170: + case 172: /* Line 1455 of yacc.c */ -#line 1332 "program_parse.y" +#line 1378 "program_parse.y" { (yyval.integer) = STATE_FOG_PARAMS; ;} break; - case 171: + case 173: /* Line 1455 of yacc.c */ -#line 1338 "program_parse.y" +#line 1384 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_CLIPPLANE; @@ -3657,10 +3710,10 @@ yyreduce: ;} break; - case 172: + case 174: /* Line 1455 of yacc.c */ -#line 1346 "program_parse.y" +#line 1392 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxClipPlanes) { yyerror(& (yylsp[(1) - (1)]), state, "invalid clip plane selector"); @@ -3671,38 +3724,38 @@ yyreduce: ;} break; - case 173: + case 175: /* Line 1455 of yacc.c */ -#line 1357 "program_parse.y" +#line 1403 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); ;} break; - case 174: + case 176: /* Line 1455 of yacc.c */ -#line 1364 "program_parse.y" +#line 1410 "program_parse.y" { (yyval.integer) = STATE_POINT_SIZE; ;} break; - case 175: + case 177: /* Line 1455 of yacc.c */ -#line 1368 "program_parse.y" +#line 1414 "program_parse.y" { (yyval.integer) = STATE_POINT_ATTENUATION; ;} break; - case 176: + case 178: /* Line 1455 of yacc.c */ -#line 1374 "program_parse.y" +#line 1420 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (5)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (5)].state)[1]; @@ -3712,10 +3765,10 @@ yyreduce: ;} break; - case 177: + case 179: /* Line 1455 of yacc.c */ -#line 1384 "program_parse.y" +#line 1430 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (2)].state)[1]; @@ -3725,20 +3778,20 @@ yyreduce: ;} break; - case 178: + case 180: /* Line 1455 of yacc.c */ -#line 1394 "program_parse.y" +#line 1440 "program_parse.y" { (yyval.state)[2] = 0; (yyval.state)[3] = 3; ;} break; - case 179: + case 181: /* Line 1455 of yacc.c */ -#line 1399 "program_parse.y" +#line 1445 "program_parse.y" { /* It seems logical that the matrix row range specifier would have * to specify a range or more than one row (i.e., $5 > $3). @@ -3756,10 +3809,10 @@ yyreduce: ;} break; - case 180: + case 182: /* Line 1455 of yacc.c */ -#line 1417 "program_parse.y" +#line 1463 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (3)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (3)].state)[1]; @@ -3767,55 +3820,55 @@ yyreduce: ;} break; - case 181: + case 183: /* Line 1455 of yacc.c */ -#line 1425 "program_parse.y" +#line 1471 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 182: + case 184: /* Line 1455 of yacc.c */ -#line 1429 "program_parse.y" +#line 1475 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 183: + case 185: /* Line 1455 of yacc.c */ -#line 1435 "program_parse.y" +#line 1481 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVERSE; ;} break; - case 184: + case 186: /* Line 1455 of yacc.c */ -#line 1439 "program_parse.y" +#line 1485 "program_parse.y" { (yyval.integer) = STATE_MATRIX_TRANSPOSE; ;} break; - case 185: + case 187: /* Line 1455 of yacc.c */ -#line 1443 "program_parse.y" +#line 1489 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVTRANS; ;} break; - case 186: + case 188: /* Line 1455 of yacc.c */ -#line 1449 "program_parse.y" +#line 1495 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) > 3) { yyerror(& (yylsp[(1) - (1)]), state, "invalid matrix row reference"); @@ -3826,88 +3879,88 @@ yyreduce: ;} break; - case 187: + case 189: /* Line 1455 of yacc.c */ -#line 1460 "program_parse.y" +#line 1506 "program_parse.y" { (yyval.state)[0] = STATE_MODELVIEW_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); ;} break; - case 188: + case 190: /* Line 1455 of yacc.c */ -#line 1465 "program_parse.y" +#line 1511 "program_parse.y" { (yyval.state)[0] = STATE_PROJECTION_MATRIX; (yyval.state)[1] = 0; ;} break; - case 189: + case 191: /* Line 1455 of yacc.c */ -#line 1470 "program_parse.y" +#line 1516 "program_parse.y" { (yyval.state)[0] = STATE_MVP_MATRIX; (yyval.state)[1] = 0; ;} break; - case 190: + case 192: /* Line 1455 of yacc.c */ -#line 1475 "program_parse.y" +#line 1521 "program_parse.y" { (yyval.state)[0] = STATE_TEXTURE_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); ;} break; - case 191: + case 193: /* Line 1455 of yacc.c */ -#line 1480 "program_parse.y" +#line 1526 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; ;} break; - case 192: + case 194: /* Line 1455 of yacc.c */ -#line 1485 "program_parse.y" +#line 1531 "program_parse.y" { (yyval.state)[0] = STATE_PROGRAM_MATRIX; (yyval.state)[1] = (yyvsp[(3) - (4)].integer); ;} break; - case 193: + case 195: /* Line 1455 of yacc.c */ -#line 1492 "program_parse.y" +#line 1538 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 194: + case 196: /* Line 1455 of yacc.c */ -#line 1496 "program_parse.y" +#line 1542 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 195: + case 197: /* Line 1455 of yacc.c */ -#line 1501 "program_parse.y" +#line 1547 "program_parse.y" { /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix * zero is valid. @@ -3921,10 +3974,10 @@ yyreduce: ;} break; - case 196: + case 198: /* Line 1455 of yacc.c */ -#line 1514 "program_parse.y" +#line 1560 "program_parse.y" { /* Since GL_ARB_matrix_palette isn't supported, just let any value * through here. The error will be generated later. @@ -3933,10 +3986,10 @@ yyreduce: ;} break; - case 197: + case 199: /* Line 1455 of yacc.c */ -#line 1522 "program_parse.y" +#line 1568 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxProgramMatrices) { yyerror(& (yylsp[(1) - (1)]), state, "invalid program matrix selector"); @@ -3947,20 +4000,20 @@ yyreduce: ;} break; - case 198: + case 200: /* Line 1455 of yacc.c */ -#line 1533 "program_parse.y" +#line 1579 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_DEPTH_RANGE; ;} break; - case 203: + case 205: /* Line 1455 of yacc.c */ -#line 1545 "program_parse.y" +#line 1591 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3970,30 +4023,30 @@ yyreduce: ;} break; - case 204: + case 206: /* Line 1455 of yacc.c */ -#line 1555 "program_parse.y" +#line 1601 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); ;} break; - case 205: + case 207: /* Line 1455 of yacc.c */ -#line 1560 "program_parse.y" +#line 1606 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); ;} break; - case 206: + case 208: /* Line 1455 of yacc.c */ -#line 1567 "program_parse.y" +#line 1613 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4003,10 +4056,10 @@ yyreduce: ;} break; - case 207: + case 209: /* Line 1455 of yacc.c */ -#line 1577 "program_parse.y" +#line 1623 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4016,30 +4069,30 @@ yyreduce: ;} break; - case 208: + case 210: /* Line 1455 of yacc.c */ -#line 1586 "program_parse.y" +#line 1632 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); ;} break; - case 209: + case 211: /* Line 1455 of yacc.c */ -#line 1591 "program_parse.y" +#line 1637 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); ;} break; - case 210: + case 212: /* Line 1455 of yacc.c */ -#line 1598 "program_parse.y" +#line 1644 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4049,10 +4102,10 @@ yyreduce: ;} break; - case 211: + case 213: /* Line 1455 of yacc.c */ -#line 1608 "program_parse.y" +#line 1654 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxEnvParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid environment parameter reference"); @@ -4062,10 +4115,10 @@ yyreduce: ;} break; - case 212: + case 214: /* Line 1455 of yacc.c */ -#line 1618 "program_parse.y" +#line 1664 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxLocalParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid local parameter reference"); @@ -4075,10 +4128,10 @@ yyreduce: ;} break; - case 217: + case 219: /* Line 1455 of yacc.c */ -#line 1633 "program_parse.y" +#line 1679 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -4088,10 +4141,10 @@ yyreduce: ;} break; - case 218: + case 220: /* Line 1455 of yacc.c */ -#line 1643 "program_parse.y" +#line 1689 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -4101,10 +4154,10 @@ yyreduce: ;} break; - case 219: + case 221: /* Line 1455 of yacc.c */ -#line 1651 "program_parse.y" +#line 1697 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (float) (yyvsp[(1) - (1)].integer); @@ -4114,10 +4167,10 @@ yyreduce: ;} break; - case 220: + case 222: /* Line 1455 of yacc.c */ -#line 1661 "program_parse.y" +#line 1707 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (3)].real); @@ -4127,10 +4180,10 @@ yyreduce: ;} break; - case 221: + case 223: /* Line 1455 of yacc.c */ -#line 1669 "program_parse.y" +#line 1715 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (5)].real); @@ -4140,10 +4193,10 @@ yyreduce: ;} break; - case 222: + case 224: /* Line 1455 of yacc.c */ -#line 1678 "program_parse.y" +#line 1724 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (7)].real); @@ -4153,10 +4206,10 @@ yyreduce: ;} break; - case 223: + case 225: /* Line 1455 of yacc.c */ -#line 1687 "program_parse.y" +#line 1733 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (9)].real); @@ -4166,63 +4219,63 @@ yyreduce: ;} break; - case 224: + case 226: /* Line 1455 of yacc.c */ -#line 1697 "program_parse.y" +#line 1743 "program_parse.y" { (yyval.real) = ((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].real) : (yyvsp[(2) - (2)].real); ;} break; - case 225: + case 227: /* Line 1455 of yacc.c */ -#line 1701 "program_parse.y" +#line 1747 "program_parse.y" { (yyval.real) = (float)(((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].integer) : (yyvsp[(2) - (2)].integer)); ;} break; - case 226: + case 228: /* Line 1455 of yacc.c */ -#line 1706 "program_parse.y" +#line 1752 "program_parse.y" { (yyval.negate) = FALSE; ;} break; - case 227: + case 229: /* Line 1455 of yacc.c */ -#line 1707 "program_parse.y" +#line 1753 "program_parse.y" { (yyval.negate) = TRUE; ;} break; - case 228: + case 230: /* Line 1455 of yacc.c */ -#line 1708 "program_parse.y" +#line 1754 "program_parse.y" { (yyval.negate) = FALSE; ;} break; - case 229: + case 231: /* Line 1455 of yacc.c */ -#line 1711 "program_parse.y" +#line 1757 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 231: + case 233: /* Line 1455 of yacc.c */ -#line 1714 "program_parse.y" +#line 1760 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 233: + case 235: /* Line 1455 of yacc.c */ -#line 1718 "program_parse.y" +#line 1764 "program_parse.y" { if (!declare_variable(state, (yyvsp[(3) - (3)].string), (yyvsp[(0) - (3)].integer), & (yylsp[(3) - (3)]))) { YYERROR; @@ -4230,10 +4283,10 @@ yyreduce: ;} break; - case 234: + case 236: /* Line 1455 of yacc.c */ -#line 1724 "program_parse.y" +#line 1770 "program_parse.y" { if (!declare_variable(state, (yyvsp[(1) - (1)].string), (yyvsp[(0) - (1)].integer), & (yylsp[(1) - (1)]))) { YYERROR; @@ -4241,10 +4294,10 @@ yyreduce: ;} break; - case 235: + case 237: /* Line 1455 of yacc.c */ -#line 1732 "program_parse.y" +#line 1778 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_output, & (yylsp[(2) - (4)])); @@ -4257,10 +4310,10 @@ yyreduce: ;} break; - case 236: + case 238: /* Line 1455 of yacc.c */ -#line 1745 "program_parse.y" +#line 1791 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_HPOS; @@ -4271,10 +4324,10 @@ yyreduce: ;} break; - case 237: + case 239: /* Line 1455 of yacc.c */ -#line 1754 "program_parse.y" +#line 1800 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_FOGC; @@ -4285,19 +4338,19 @@ yyreduce: ;} break; - case 238: + case 240: /* Line 1455 of yacc.c */ -#line 1763 "program_parse.y" +#line 1809 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (2)].result); ;} break; - case 239: + case 241: /* Line 1455 of yacc.c */ -#line 1767 "program_parse.y" +#line 1813 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_PSIZ; @@ -4308,10 +4361,10 @@ yyreduce: ;} break; - case 240: + case 242: /* Line 1455 of yacc.c */ -#line 1776 "program_parse.y" +#line 1822 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_TEX0 + (yyvsp[(3) - (3)].integer); @@ -4322,10 +4375,10 @@ yyreduce: ;} break; - case 241: + case 243: /* Line 1455 of yacc.c */ -#line 1785 "program_parse.y" +#line 1831 "program_parse.y" { if (state->mode == ARB_fragment) { (yyval.result) = FRAG_RESULT_DEPTH; @@ -4336,19 +4389,19 @@ yyreduce: ;} break; - case 242: + case 244: /* Line 1455 of yacc.c */ -#line 1796 "program_parse.y" +#line 1842 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (3)].integer) + (yyvsp[(3) - (3)].integer); ;} break; - case 243: + case 245: /* Line 1455 of yacc.c */ -#line 1802 "program_parse.y" +#line 1848 "program_parse.y" { (yyval.integer) = (state->mode == ARB_vertex) ? VERT_RESULT_COL0 @@ -4356,10 +4409,10 @@ yyreduce: ;} break; - case 244: + case 246: /* Line 1455 of yacc.c */ -#line 1808 "program_parse.y" +#line 1854 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_COL0; @@ -4370,10 +4423,10 @@ yyreduce: ;} break; - case 245: + case 247: /* Line 1455 of yacc.c */ -#line 1817 "program_parse.y" +#line 1863 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_BFC0; @@ -4384,19 +4437,19 @@ yyreduce: ;} break; - case 246: + case 248: /* Line 1455 of yacc.c */ -#line 1828 "program_parse.y" +#line 1874 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 247: + case 249: /* Line 1455 of yacc.c */ -#line 1832 "program_parse.y" +#line 1878 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 0; @@ -4407,10 +4460,10 @@ yyreduce: ;} break; - case 248: + case 250: /* Line 1455 of yacc.c */ -#line 1841 "program_parse.y" +#line 1887 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 1; @@ -4421,94 +4474,94 @@ yyreduce: ;} break; - case 249: + case 251: /* Line 1455 of yacc.c */ -#line 1851 "program_parse.y" +#line 1897 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 250: + case 252: /* Line 1455 of yacc.c */ -#line 1852 "program_parse.y" +#line 1898 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 251: + case 253: /* Line 1455 of yacc.c */ -#line 1853 "program_parse.y" +#line 1899 "program_parse.y" { (yyval.integer) = 1; ;} break; - case 252: + case 254: /* Line 1455 of yacc.c */ -#line 1856 "program_parse.y" +#line 1902 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 253: + case 255: /* Line 1455 of yacc.c */ -#line 1857 "program_parse.y" +#line 1903 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 254: + case 256: /* Line 1455 of yacc.c */ -#line 1858 "program_parse.y" +#line 1904 "program_parse.y" { (yyval.integer) = 1; ;} break; - case 255: + case 257: /* Line 1455 of yacc.c */ -#line 1861 "program_parse.y" +#line 1907 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 256: + case 258: /* Line 1455 of yacc.c */ -#line 1862 "program_parse.y" +#line 1908 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 257: + case 259: /* Line 1455 of yacc.c */ -#line 1865 "program_parse.y" +#line 1911 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 258: + case 260: /* Line 1455 of yacc.c */ -#line 1866 "program_parse.y" +#line 1912 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 259: + case 261: /* Line 1455 of yacc.c */ -#line 1869 "program_parse.y" +#line 1915 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 260: + case 262: /* Line 1455 of yacc.c */ -#line 1870 "program_parse.y" +#line 1916 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 261: + case 263: /* Line 1455 of yacc.c */ -#line 1874 "program_parse.y" +#line 1920 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture coordinate unit selector"); @@ -4519,10 +4572,10 @@ yyreduce: ;} break; - case 262: + case 264: /* Line 1455 of yacc.c */ -#line 1885 "program_parse.y" +#line 1931 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture image unit selector"); @@ -4533,10 +4586,10 @@ yyreduce: ;} break; - case 263: + case 265: /* Line 1455 of yacc.c */ -#line 1896 "program_parse.y" +#line 1942 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture unit selector"); @@ -4547,10 +4600,10 @@ yyreduce: ;} break; - case 264: + case 266: /* Line 1455 of yacc.c */ -#line 1907 "program_parse.y" +#line 1953 "program_parse.y" { struct asm_symbol *exist = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(2) - (4)].string)); @@ -4574,7 +4627,7 @@ yyreduce: /* Line 1455 of yacc.c */ -#line 4578 "program_parse.tab.c" +#line 4631 "program_parse.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -4793,7 +4846,7 @@ yyreturn: /* Line 1675 of yacc.c */ -#line 1927 "program_parse.y" +#line 1973 "program_parse.y" struct asm_instruction * diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 9dab00c385..4cd459a096 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -177,7 +177,7 @@ static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, %type instruction ALU_instruction TexInstruction %type ARL_instruction VECTORop_instruction %type SCALARop_instruction BINSCop_instruction BINop_instruction -%type TRIop_instruction SWZ_instruction SAMPLE_instruction +%type TRIop_instruction TXD_instruction SWZ_instruction SAMPLE_instruction %type KIL_instruction %type dstReg maskedDstReg maskedAddrReg @@ -347,6 +347,7 @@ ALU_instruction: ARL_instruction TexInstruction: SAMPLE_instruction | KIL_instruction + | TXD_instruction ; ARL_instruction: ARL maskedAddrReg ',' scalarSrcReg @@ -444,6 +445,51 @@ KIL_instruction: KIL swizzleSrcReg } ; +TXD_instruction: TXD_OP maskedDstReg ',' swizzleSrcReg ',' swizzleSrcReg ',' swizzleSrcReg ',' texImageUnit ',' texTarget + { + $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, & $6, & $8); + if ($$ != NULL) { + const GLbitfield tex_mask = (1U << $10); + GLbitfield shadow_tex = 0; + GLbitfield target_mask = 0; + + + $$->Base.SaturateMode = $1.SaturateMode; + $$->Base.TexSrcUnit = $10; + + if ($12 < 0) { + shadow_tex = tex_mask; + + $$->Base.TexSrcTarget = -$12; + $$->Base.TexShadow = 1; + } else { + $$->Base.TexSrcTarget = $12; + } + + target_mask = (1U << $$->Base.TexSrcTarget); + + /* If this texture unit was previously accessed and that access + * had a different texture target, generate an error. + * + * If this texture unit was previously accessed and that access + * had a different shadow mode, generate an error. + */ + if ((state->prog->TexturesUsed[$10] != 0) + && ((state->prog->TexturesUsed[$10] != target_mask) + || ((state->prog->ShadowSamplers & tex_mask) + != shadow_tex))) { + yyerror(& @12, state, + "multiple targets used on one texture image unit"); + YYERROR; + } + + + state->prog->TexturesUsed[$10] |= target_mask; + state->prog->ShadowSamplers |= shadow_tex; + } + } + ; + texImageUnit: TEXTURE_UNIT optTexImageUnitNum { $$ = $2; -- cgit v1.2.3 From b8e389bb0315287b72087b93a089ab944d77ab80 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 3 Sep 2009 14:05:18 -0700 Subject: NV fp parser: Support new scalar constant behavior ARBfp requires scalar constants have a '.x' suffix, but NVfp_option does not. This shows up with instructions that require a scalar parameter (e.g., COS). --- src/mesa/shader/program_parse.tab.c | 1482 ++++++++++++++++++----------------- src/mesa/shader/program_parse.y | 17 + 2 files changed, 770 insertions(+), 729 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 06aefd073f..508ac617e4 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -588,16 +588,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 5 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 349 +#define YYLAST 351 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 116 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 135 /* YYNRULES -- Number of rules. */ -#define YYNRULES 266 +#define YYNRULES 267 /* YYNRULES -- Number of states. */ -#define YYNSTATES 447 +#define YYNSTATES 448 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 @@ -657,29 +657,29 @@ static const yytype_uint16 yyprhs[] = 24, 27, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 59, 64, 69, 76, 83, 92, 101, 104, 117, 120, 122, 124, 126, 128, 130, - 132, 134, 136, 138, 140, 142, 144, 151, 155, 159, - 162, 165, 173, 176, 178, 180, 182, 184, 189, 191, - 193, 195, 197, 199, 201, 203, 207, 208, 211, 214, - 216, 218, 220, 222, 224, 226, 228, 230, 232, 233, - 235, 237, 239, 241, 242, 244, 246, 248, 250, 252, - 254, 259, 262, 265, 267, 270, 272, 275, 277, 280, - 285, 290, 292, 293, 297, 299, 301, 304, 306, 309, - 311, 313, 317, 324, 325, 327, 330, 335, 337, 341, - 343, 345, 347, 349, 351, 353, 355, 357, 359, 361, + 132, 134, 136, 138, 140, 142, 144, 151, 155, 158, + 162, 165, 168, 176, 179, 181, 183, 185, 187, 192, + 194, 196, 198, 200, 202, 204, 206, 210, 211, 214, + 217, 219, 221, 223, 225, 227, 229, 231, 233, 235, + 236, 238, 240, 242, 244, 245, 247, 249, 251, 253, + 255, 257, 262, 265, 268, 270, 273, 275, 278, 280, + 283, 288, 293, 295, 296, 300, 302, 304, 307, 309, + 312, 314, 316, 320, 327, 328, 330, 333, 338, 340, + 344, 346, 348, 350, 352, 354, 356, 358, 360, 362, 364, 367, 370, 373, 376, 379, 382, 385, 388, 391, - 394, 397, 401, 403, 405, 407, 413, 415, 417, 419, - 422, 424, 426, 429, 431, 434, 441, 443, 447, 449, - 451, 453, 455, 457, 462, 464, 466, 468, 470, 472, - 474, 477, 479, 481, 487, 489, 492, 494, 496, 502, - 505, 506, 513, 517, 518, 520, 522, 524, 526, 528, - 531, 533, 535, 538, 543, 548, 549, 551, 553, 555, - 557, 560, 562, 564, 566, 568, 574, 576, 580, 586, - 592, 594, 598, 604, 606, 608, 610, 612, 614, 616, - 618, 620, 622, 626, 632, 640, 650, 653, 656, 658, - 660, 661, 662, 666, 667, 671, 675, 677, 682, 685, - 688, 691, 694, 698, 701, 705, 706, 708, 710, 711, - 713, 715, 716, 718, 720, 721, 723, 725, 726, 730, - 731, 735, 736, 740, 742, 744, 746 + 394, 397, 400, 404, 406, 408, 410, 416, 418, 420, + 422, 425, 427, 429, 432, 434, 437, 444, 446, 450, + 452, 454, 456, 458, 460, 465, 467, 469, 471, 473, + 475, 477, 480, 482, 484, 490, 492, 495, 497, 499, + 505, 508, 509, 516, 520, 521, 523, 525, 527, 529, + 531, 534, 536, 538, 541, 546, 551, 552, 554, 556, + 558, 560, 563, 565, 567, 569, 571, 577, 579, 583, + 589, 595, 597, 601, 607, 609, 611, 613, 615, 617, + 619, 621, 623, 625, 629, 635, 643, 653, 656, 659, + 661, 663, 664, 665, 669, 670, 674, 678, 680, 685, + 688, 691, 694, 697, 701, 704, 708, 709, 711, 713, + 714, 716, 718, 719, 721, 723, 724, 726, 728, 729, + 733, 734, 738, 739, 743, 745, 747, 749 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ @@ -700,67 +700,67 @@ static const yytype_int16 yyrhs[] = 84, -1, 85, -1, 86, -1, 87, -1, 88, -1, 89, -1, 90, -1, 91, -1, 92, -1, 93, -1, 94, -1, 95, -1, 21, 140, 108, 145, 108, 142, - -1, 231, 145, 157, -1, 231, 145, 158, -1, 146, - 159, -1, 154, 156, -1, 143, 108, 143, 108, 143, - 108, 143, -1, 231, 144, -1, 23, -1, 99, -1, - 99, -1, 162, -1, 147, 109, 148, 110, -1, 176, - -1, 238, -1, 99, -1, 99, -1, 149, -1, 150, - -1, 23, -1, 154, 155, 151, -1, -1, 111, 152, - -1, 112, 153, -1, 23, -1, 23, -1, 99, -1, - 103, -1, 103, -1, 103, -1, 103, -1, 100, -1, - 104, -1, -1, 100, -1, 101, -1, 102, -1, 103, - -1, -1, 161, -1, 168, -1, 232, -1, 234, -1, - 237, -1, 250, -1, 7, 99, 113, 162, -1, 96, - 163, -1, 38, 167, -1, 60, -1, 98, 165, -1, - 53, -1, 29, 243, -1, 37, -1, 74, 244, -1, - 50, 109, 166, 110, -1, 97, 109, 164, 110, -1, - 23, -1, -1, 109, 166, 110, -1, 23, -1, 60, - -1, 29, 243, -1, 37, -1, 74, 244, -1, 169, - -1, 170, -1, 10, 99, 172, -1, 10, 99, 109, - 171, 110, 173, -1, -1, 23, -1, 113, 175, -1, - 113, 114, 174, 115, -1, 177, -1, 174, 108, 177, - -1, 179, -1, 215, -1, 225, -1, 179, -1, 215, - -1, 226, -1, 178, -1, 216, -1, 225, -1, 179, - -1, 73, 203, -1, 73, 180, -1, 73, 182, -1, - 73, 185, -1, 73, 187, -1, 73, 193, -1, 73, - 189, -1, 73, 196, -1, 73, 198, -1, 73, 200, - -1, 73, 202, -1, 73, 214, -1, 47, 242, 181, - -1, 191, -1, 33, -1, 69, -1, 43, 109, 192, - 110, 183, -1, 191, -1, 60, -1, 26, -1, 72, - 184, -1, 40, -1, 32, -1, 44, 186, -1, 25, - -1, 242, 67, -1, 45, 109, 192, 110, 242, 188, - -1, 191, -1, 75, 246, 190, -1, 29, -1, 25, - -1, 31, -1, 71, -1, 23, -1, 76, 244, 194, - 195, -1, 35, -1, 54, -1, 79, -1, 80, -1, - 78, -1, 77, -1, 36, 197, -1, 29, -1, 56, - -1, 28, 109, 199, 110, 57, -1, 23, -1, 58, - 201, -1, 70, -1, 26, -1, 205, 66, 109, 208, - 110, -1, 205, 204, -1, -1, 66, 109, 208, 105, - 208, 110, -1, 49, 209, 206, -1, -1, 207, -1, - 41, -1, 82, -1, 42, -1, 23, -1, 51, 210, - -1, 63, -1, 52, -1, 81, 244, -1, 55, 109, - 212, 110, -1, 48, 109, 213, 110, -1, -1, 211, - -1, 23, -1, 23, -1, 23, -1, 30, 64, -1, - 219, -1, 222, -1, 217, -1, 220, -1, 62, 34, - 109, 218, 110, -1, 223, -1, 223, 105, 223, -1, - 62, 34, 109, 223, 110, -1, 62, 46, 109, 221, - 110, -1, 224, -1, 224, 105, 224, -1, 62, 46, - 109, 224, 110, -1, 23, -1, 23, -1, 227, -1, - 229, -1, 228, -1, 229, -1, 230, -1, 24, -1, - 23, -1, 114, 230, 115, -1, 114, 230, 108, 230, - 115, -1, 114, 230, 108, 230, 108, 230, 115, -1, - 114, 230, 108, 230, 108, 230, 108, 230, 115, -1, - 231, 24, -1, 231, 23, -1, 111, -1, 112, -1, - -1, -1, 11, 233, 236, -1, -1, 5, 235, 236, - -1, 236, 108, 99, -1, 99, -1, 9, 99, 113, - 238, -1, 65, 60, -1, 65, 37, -1, 65, 239, - -1, 65, 59, -1, 65, 74, 244, -1, 65, 30, - -1, 29, 240, 241, -1, -1, 39, -1, 27, -1, - -1, 61, -1, 68, -1, -1, 39, -1, 27, -1, - -1, 61, -1, 68, -1, -1, 109, 247, 110, -1, - -1, 109, 248, 110, -1, -1, 109, 249, 110, -1, - 23, -1, 23, -1, 23, -1, 6, 99, 113, 99, - -1 + -1, 231, 145, 157, -1, 231, 228, -1, 231, 145, + 158, -1, 146, 159, -1, 154, 156, -1, 143, 108, + 143, 108, 143, 108, 143, -1, 231, 144, -1, 23, + -1, 99, -1, 99, -1, 162, -1, 147, 109, 148, + 110, -1, 176, -1, 238, -1, 99, -1, 99, -1, + 149, -1, 150, -1, 23, -1, 154, 155, 151, -1, + -1, 111, 152, -1, 112, 153, -1, 23, -1, 23, + -1, 99, -1, 103, -1, 103, -1, 103, -1, 103, + -1, 100, -1, 104, -1, -1, 100, -1, 101, -1, + 102, -1, 103, -1, -1, 161, -1, 168, -1, 232, + -1, 234, -1, 237, -1, 250, -1, 7, 99, 113, + 162, -1, 96, 163, -1, 38, 167, -1, 60, -1, + 98, 165, -1, 53, -1, 29, 243, -1, 37, -1, + 74, 244, -1, 50, 109, 166, 110, -1, 97, 109, + 164, 110, -1, 23, -1, -1, 109, 166, 110, -1, + 23, -1, 60, -1, 29, 243, -1, 37, -1, 74, + 244, -1, 169, -1, 170, -1, 10, 99, 172, -1, + 10, 99, 109, 171, 110, 173, -1, -1, 23, -1, + 113, 175, -1, 113, 114, 174, 115, -1, 177, -1, + 174, 108, 177, -1, 179, -1, 215, -1, 225, -1, + 179, -1, 215, -1, 226, -1, 178, -1, 216, -1, + 225, -1, 179, -1, 73, 203, -1, 73, 180, -1, + 73, 182, -1, 73, 185, -1, 73, 187, -1, 73, + 193, -1, 73, 189, -1, 73, 196, -1, 73, 198, + -1, 73, 200, -1, 73, 202, -1, 73, 214, -1, + 47, 242, 181, -1, 191, -1, 33, -1, 69, -1, + 43, 109, 192, 110, 183, -1, 191, -1, 60, -1, + 26, -1, 72, 184, -1, 40, -1, 32, -1, 44, + 186, -1, 25, -1, 242, 67, -1, 45, 109, 192, + 110, 242, 188, -1, 191, -1, 75, 246, 190, -1, + 29, -1, 25, -1, 31, -1, 71, -1, 23, -1, + 76, 244, 194, 195, -1, 35, -1, 54, -1, 79, + -1, 80, -1, 78, -1, 77, -1, 36, 197, -1, + 29, -1, 56, -1, 28, 109, 199, 110, 57, -1, + 23, -1, 58, 201, -1, 70, -1, 26, -1, 205, + 66, 109, 208, 110, -1, 205, 204, -1, -1, 66, + 109, 208, 105, 208, 110, -1, 49, 209, 206, -1, + -1, 207, -1, 41, -1, 82, -1, 42, -1, 23, + -1, 51, 210, -1, 63, -1, 52, -1, 81, 244, + -1, 55, 109, 212, 110, -1, 48, 109, 213, 110, + -1, -1, 211, -1, 23, -1, 23, -1, 23, -1, + 30, 64, -1, 219, -1, 222, -1, 217, -1, 220, + -1, 62, 34, 109, 218, 110, -1, 223, -1, 223, + 105, 223, -1, 62, 34, 109, 223, 110, -1, 62, + 46, 109, 221, 110, -1, 224, -1, 224, 105, 224, + -1, 62, 46, 109, 224, 110, -1, 23, -1, 23, + -1, 227, -1, 229, -1, 228, -1, 229, -1, 230, + -1, 24, -1, 23, -1, 114, 230, 115, -1, 114, + 230, 108, 230, 115, -1, 114, 230, 108, 230, 108, + 230, 115, -1, 114, 230, 108, 230, 108, 230, 108, + 230, 115, -1, 231, 24, -1, 231, 23, -1, 111, + -1, 112, -1, -1, -1, 11, 233, 236, -1, -1, + 5, 235, 236, -1, 236, 108, 99, -1, 99, -1, + 9, 99, 113, 238, -1, 65, 60, -1, 65, 37, + -1, 65, 239, -1, 65, 59, -1, 65, 74, 244, + -1, 65, 30, -1, 29, 240, 241, -1, -1, 39, + -1, 27, -1, -1, 61, -1, 68, -1, -1, 39, + -1, 27, -1, -1, 61, -1, 68, -1, -1, 109, + 247, 110, -1, -1, 109, 248, 110, -1, -1, 109, + 249, 110, -1, 23, -1, 23, -1, 23, -1, 6, + 99, 113, 99, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ @@ -770,29 +770,29 @@ static const yytype_uint16 yyrline[] = 309, 324, 327, 332, 339, 340, 341, 342, 343, 344, 345, 348, 349, 350, 353, 359, 366, 373, 381, 388, 396, 441, 448, 493, 499, 500, 501, 502, 503, 504, - 505, 506, 507, 508, 509, 510, 513, 526, 539, 552, - 574, 583, 616, 623, 638, 688, 730, 741, 762, 772, - 778, 809, 826, 826, 828, 835, 847, 848, 849, 852, - 864, 876, 894, 905, 917, 919, 920, 921, 922, 925, - 925, 925, 925, 926, 929, 930, 931, 932, 933, 934, - 937, 955, 959, 965, 969, 973, 977, 986, 995, 999, - 1004, 1010, 1021, 1021, 1022, 1024, 1028, 1032, 1036, 1042, - 1042, 1044, 1060, 1083, 1086, 1097, 1103, 1109, 1110, 1117, - 1123, 1129, 1137, 1143, 1149, 1157, 1163, 1169, 1177, 1178, - 1181, 1182, 1183, 1184, 1185, 1186, 1187, 1188, 1189, 1190, - 1191, 1194, 1203, 1207, 1211, 1217, 1226, 1230, 1234, 1243, - 1247, 1253, 1259, 1266, 1271, 1279, 1289, 1291, 1299, 1305, - 1309, 1313, 1319, 1330, 1339, 1343, 1348, 1352, 1356, 1360, - 1366, 1373, 1377, 1383, 1391, 1402, 1409, 1413, 1419, 1429, - 1440, 1444, 1462, 1471, 1474, 1480, 1484, 1488, 1494, 1505, - 1510, 1515, 1520, 1525, 1530, 1538, 1541, 1546, 1559, 1567, - 1578, 1586, 1586, 1588, 1588, 1590, 1600, 1605, 1612, 1622, - 1631, 1636, 1643, 1653, 1663, 1675, 1675, 1676, 1676, 1678, - 1688, 1696, 1706, 1714, 1722, 1731, 1742, 1746, 1752, 1753, - 1754, 1757, 1757, 1760, 1760, 1763, 1769, 1777, 1790, 1799, - 1808, 1812, 1821, 1830, 1841, 1848, 1853, 1862, 1874, 1877, - 1886, 1897, 1898, 1899, 1902, 1903, 1904, 1907, 1908, 1911, - 1912, 1915, 1916, 1919, 1930, 1941, 1952 + 505, 506, 507, 508, 509, 510, 513, 526, 537, 556, + 569, 591, 600, 633, 640, 655, 705, 747, 758, 779, + 789, 795, 826, 843, 843, 845, 852, 864, 865, 866, + 869, 881, 893, 911, 922, 934, 936, 937, 938, 939, + 942, 942, 942, 942, 943, 946, 947, 948, 949, 950, + 951, 954, 972, 976, 982, 986, 990, 994, 1003, 1012, + 1016, 1021, 1027, 1038, 1038, 1039, 1041, 1045, 1049, 1053, + 1059, 1059, 1061, 1077, 1100, 1103, 1114, 1120, 1126, 1127, + 1134, 1140, 1146, 1154, 1160, 1166, 1174, 1180, 1186, 1194, + 1195, 1198, 1199, 1200, 1201, 1202, 1203, 1204, 1205, 1206, + 1207, 1208, 1211, 1220, 1224, 1228, 1234, 1243, 1247, 1251, + 1260, 1264, 1270, 1276, 1283, 1288, 1296, 1306, 1308, 1316, + 1322, 1326, 1330, 1336, 1347, 1356, 1360, 1365, 1369, 1373, + 1377, 1383, 1390, 1394, 1400, 1408, 1419, 1426, 1430, 1436, + 1446, 1457, 1461, 1479, 1488, 1491, 1497, 1501, 1505, 1511, + 1522, 1527, 1532, 1537, 1542, 1547, 1555, 1558, 1563, 1576, + 1584, 1595, 1603, 1603, 1605, 1605, 1607, 1617, 1622, 1629, + 1639, 1648, 1653, 1660, 1670, 1680, 1692, 1692, 1693, 1693, + 1695, 1705, 1713, 1723, 1731, 1739, 1748, 1759, 1763, 1769, + 1770, 1771, 1774, 1774, 1777, 1777, 1780, 1786, 1794, 1807, + 1816, 1825, 1829, 1838, 1847, 1858, 1865, 1870, 1879, 1891, + 1894, 1903, 1914, 1915, 1916, 1919, 1920, 1921, 1924, 1925, + 1928, 1929, 1932, 1933, 1936, 1947, 1958, 1969 }; #endif @@ -890,29 +890,29 @@ static const yytype_uint8 yyr1[] = 122, 122, 123, 123, 124, 124, 124, 124, 124, 124, 124, 125, 125, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 136, 136, 136, 136, 136, - 136, 136, 136, 136, 136, 136, 137, 138, 139, 140, - 141, 142, 143, 144, 144, 145, 145, 145, 145, 146, - 146, 147, 148, 148, 149, 150, 151, 151, 151, 152, - 153, 154, 155, 156, 157, 158, 158, 158, 158, 159, - 159, 159, 159, 159, 160, 160, 160, 160, 160, 160, - 161, 162, 162, 163, 163, 163, 163, 163, 163, 163, - 163, 164, 165, 165, 166, 167, 167, 167, 167, 168, - 168, 169, 170, 171, 171, 172, 173, 174, 174, 175, - 175, 175, 176, 176, 176, 177, 177, 177, 178, 178, - 179, 179, 179, 179, 179, 179, 179, 179, 179, 179, - 179, 180, 181, 181, 181, 182, 183, 183, 183, 183, - 183, 184, 185, 186, 186, 187, 188, 189, 190, 191, - 191, 191, 192, 193, 194, 194, 195, 195, 195, 195, - 196, 197, 197, 198, 199, 200, 201, 201, 202, 203, - 204, 204, 205, 206, 206, 207, 207, 207, 208, 209, - 209, 209, 209, 209, 209, 210, 210, 211, 212, 213, - 214, 215, 215, 216, 216, 217, 218, 218, 219, 220, - 221, 221, 222, 223, 224, 225, 225, 226, 226, 227, - 228, 228, 229, 229, 229, 229, 230, 230, 231, 231, - 231, 233, 232, 235, 234, 236, 236, 237, 238, 238, - 238, 238, 238, 238, 239, 240, 240, 240, 241, 241, - 241, 242, 242, 242, 243, 243, 243, 244, 244, 245, - 245, 246, 246, 247, 248, 249, 250 + 136, 136, 136, 136, 136, 136, 137, 138, 138, 139, + 140, 141, 142, 143, 144, 144, 145, 145, 145, 145, + 146, 146, 147, 148, 148, 149, 150, 151, 151, 151, + 152, 153, 154, 155, 156, 157, 158, 158, 158, 158, + 159, 159, 159, 159, 159, 160, 160, 160, 160, 160, + 160, 161, 162, 162, 163, 163, 163, 163, 163, 163, + 163, 163, 164, 165, 165, 166, 167, 167, 167, 167, + 168, 168, 169, 170, 171, 171, 172, 173, 174, 174, + 175, 175, 175, 176, 176, 176, 177, 177, 177, 178, + 178, 179, 179, 179, 179, 179, 179, 179, 179, 179, + 179, 179, 180, 181, 181, 181, 182, 183, 183, 183, + 183, 183, 184, 185, 186, 186, 187, 188, 189, 190, + 191, 191, 191, 192, 193, 194, 194, 195, 195, 195, + 195, 196, 197, 197, 198, 199, 200, 201, 201, 202, + 203, 204, 204, 205, 206, 206, 207, 207, 207, 208, + 209, 209, 209, 209, 209, 209, 210, 210, 211, 212, + 213, 214, 215, 215, 216, 216, 217, 218, 218, 219, + 220, 221, 221, 222, 223, 224, 225, 225, 226, 226, + 227, 228, 228, 229, 229, 229, 229, 230, 230, 231, + 231, 231, 233, 232, 235, 234, 236, 236, 237, 238, + 238, 238, 238, 238, 238, 239, 240, 240, 240, 241, + 241, 241, 242, 242, 242, 243, 243, 243, 244, 244, + 245, 245, 246, 246, 247, 248, 249, 250 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -922,29 +922,29 @@ static const yytype_uint8 yyr2[] = 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 6, 6, 8, 8, 2, 12, 2, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 6, 3, 3, 2, - 2, 7, 2, 1, 1, 1, 1, 4, 1, 1, - 1, 1, 1, 1, 1, 3, 0, 2, 2, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, - 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, - 4, 2, 2, 1, 2, 1, 2, 1, 2, 4, - 4, 1, 0, 3, 1, 1, 2, 1, 2, 1, - 1, 3, 6, 0, 1, 2, 4, 1, 3, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, + 1, 1, 1, 1, 1, 1, 6, 3, 2, 3, + 2, 2, 7, 2, 1, 1, 1, 1, 4, 1, + 1, 1, 1, 1, 1, 1, 3, 0, 2, 2, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, + 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, + 1, 4, 2, 2, 1, 2, 1, 2, 1, 2, + 4, 4, 1, 0, 3, 1, 1, 2, 1, 2, + 1, 1, 3, 6, 0, 1, 2, 4, 1, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 3, 1, 1, 1, 5, 1, 1, 1, 2, - 1, 1, 2, 1, 2, 6, 1, 3, 1, 1, - 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, - 2, 1, 1, 5, 1, 2, 1, 1, 5, 2, - 0, 6, 3, 0, 1, 1, 1, 1, 1, 2, - 1, 1, 2, 4, 4, 0, 1, 1, 1, 1, - 2, 1, 1, 1, 1, 5, 1, 3, 5, 5, - 1, 3, 5, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 3, 5, 7, 9, 2, 2, 1, 1, - 0, 0, 3, 0, 3, 3, 1, 4, 2, 2, - 2, 2, 3, 2, 3, 0, 1, 1, 0, 1, - 1, 0, 1, 1, 0, 1, 1, 0, 3, 0, - 3, 0, 3, 1, 1, 1, 4 + 2, 2, 3, 1, 1, 1, 5, 1, 1, 1, + 2, 1, 1, 2, 1, 2, 6, 1, 3, 1, + 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, + 1, 2, 1, 1, 5, 1, 2, 1, 1, 5, + 2, 0, 6, 3, 0, 1, 1, 1, 1, 1, + 2, 1, 1, 2, 4, 4, 0, 1, 1, 1, + 1, 2, 1, 1, 1, 1, 5, 1, 3, 5, + 5, 1, 3, 5, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 3, 5, 7, 9, 2, 2, 1, + 1, 0, 0, 3, 0, 3, 3, 1, 4, 2, + 2, 2, 2, 3, 2, 3, 0, 1, 1, 0, + 1, 1, 0, 1, 1, 0, 1, 1, 0, 3, + 0, 3, 0, 3, 1, 1, 1, 4 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -953,223 +953,225 @@ static const yytype_uint8 yyr2[] = static const yytype_uint16 yydefact[] = { 0, 3, 4, 0, 6, 1, 9, 0, 5, 0, - 0, 233, 0, 0, 0, 0, 231, 2, 0, 0, - 0, 0, 0, 0, 0, 230, 0, 0, 8, 0, + 0, 234, 0, 0, 0, 0, 232, 2, 0, 0, + 0, 0, 0, 0, 0, 231, 0, 0, 8, 0, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, - 23, 20, 0, 84, 85, 109, 110, 86, 87, 88, - 89, 7, 0, 0, 0, 0, 0, 0, 0, 60, - 0, 83, 59, 0, 0, 0, 0, 0, 71, 0, - 0, 228, 229, 31, 0, 0, 0, 10, 11, 236, - 234, 0, 0, 0, 113, 230, 111, 232, 245, 243, - 239, 241, 238, 257, 240, 230, 79, 80, 81, 82, - 49, 230, 230, 230, 230, 230, 230, 73, 50, 221, - 220, 0, 0, 0, 0, 55, 230, 78, 0, 56, - 58, 122, 123, 201, 202, 124, 217, 218, 0, 230, - 0, 266, 90, 237, 114, 0, 115, 119, 120, 121, - 215, 216, 219, 0, 247, 246, 248, 0, 242, 0, - 0, 0, 0, 26, 0, 25, 24, 254, 107, 105, - 257, 92, 0, 0, 0, 0, 0, 0, 251, 0, - 251, 0, 0, 261, 257, 130, 131, 132, 133, 135, - 134, 136, 137, 138, 139, 0, 140, 254, 97, 0, - 95, 93, 257, 0, 102, 91, 0, 76, 75, 77, - 48, 0, 0, 0, 235, 0, 227, 226, 249, 250, - 244, 263, 0, 230, 230, 0, 0, 230, 255, 256, - 106, 108, 0, 0, 0, 200, 171, 172, 170, 0, - 153, 253, 252, 152, 0, 0, 0, 0, 195, 191, - 0, 190, 257, 183, 177, 176, 175, 0, 0, 0, - 0, 96, 0, 98, 0, 0, 94, 230, 222, 64, - 0, 62, 63, 0, 230, 230, 0, 112, 258, 28, - 27, 74, 47, 259, 0, 0, 213, 0, 214, 0, - 174, 0, 162, 0, 154, 0, 159, 160, 143, 144, - 161, 141, 142, 0, 197, 189, 196, 0, 192, 185, - 187, 186, 182, 184, 265, 0, 158, 157, 164, 165, - 0, 0, 104, 0, 101, 0, 0, 0, 57, 72, - 66, 46, 0, 0, 0, 230, 0, 33, 0, 230, - 208, 212, 0, 0, 251, 199, 0, 198, 0, 262, - 169, 168, 166, 167, 163, 188, 0, 99, 100, 103, - 230, 223, 0, 0, 65, 230, 53, 54, 52, 230, - 0, 0, 0, 117, 125, 128, 126, 203, 204, 127, - 264, 0, 34, 35, 36, 37, 38, 39, 40, 41, - 42, 43, 44, 45, 30, 29, 173, 148, 150, 147, - 0, 145, 146, 0, 194, 193, 178, 0, 69, 67, - 70, 68, 0, 0, 0, 0, 129, 180, 230, 116, - 260, 151, 149, 155, 156, 230, 224, 230, 0, 0, - 0, 0, 179, 118, 0, 0, 0, 0, 206, 0, - 210, 0, 225, 230, 0, 205, 0, 209, 0, 0, - 51, 32, 207, 211, 0, 0, 181 + 23, 20, 0, 85, 86, 110, 111, 87, 88, 89, + 90, 7, 0, 0, 0, 0, 0, 0, 0, 61, + 0, 84, 60, 0, 0, 0, 0, 0, 72, 0, + 0, 229, 230, 31, 0, 0, 0, 10, 11, 237, + 235, 0, 0, 0, 114, 231, 112, 233, 246, 244, + 240, 242, 239, 258, 241, 231, 80, 81, 82, 83, + 50, 231, 231, 231, 231, 231, 231, 74, 51, 222, + 221, 0, 0, 0, 0, 56, 231, 79, 0, 57, + 59, 123, 124, 202, 203, 125, 218, 219, 0, 231, + 0, 267, 91, 238, 115, 0, 116, 120, 121, 122, + 216, 217, 220, 0, 248, 247, 249, 0, 243, 0, + 0, 0, 0, 26, 0, 25, 24, 255, 108, 106, + 258, 93, 0, 0, 0, 0, 0, 0, 252, 0, + 252, 0, 0, 262, 258, 131, 132, 133, 134, 136, + 135, 137, 138, 139, 140, 0, 141, 255, 98, 0, + 96, 94, 258, 0, 103, 92, 0, 77, 76, 78, + 49, 0, 0, 0, 236, 0, 228, 227, 250, 251, + 245, 264, 0, 231, 231, 0, 48, 0, 231, 256, + 257, 107, 109, 0, 0, 0, 201, 172, 173, 171, + 0, 154, 254, 253, 153, 0, 0, 0, 0, 196, + 192, 0, 191, 258, 184, 178, 177, 176, 0, 0, + 0, 0, 97, 0, 99, 0, 0, 95, 231, 223, + 65, 0, 63, 64, 0, 231, 231, 0, 113, 259, + 28, 27, 75, 47, 260, 0, 0, 214, 0, 215, + 0, 175, 0, 163, 0, 155, 0, 160, 161, 144, + 145, 162, 142, 143, 0, 198, 190, 197, 0, 193, + 186, 188, 187, 183, 185, 266, 0, 159, 158, 165, + 166, 0, 0, 105, 0, 102, 0, 0, 0, 58, + 73, 67, 46, 0, 0, 0, 231, 0, 33, 0, + 231, 209, 213, 0, 0, 252, 200, 0, 199, 0, + 263, 170, 169, 167, 168, 164, 189, 0, 100, 101, + 104, 231, 224, 0, 0, 66, 231, 54, 55, 53, + 231, 0, 0, 0, 118, 126, 129, 127, 204, 205, + 128, 265, 0, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 30, 29, 174, 149, 151, + 148, 0, 146, 147, 0, 195, 194, 179, 0, 70, + 68, 71, 69, 0, 0, 0, 0, 130, 181, 231, + 117, 261, 152, 150, 156, 157, 231, 225, 231, 0, + 0, 0, 0, 180, 119, 0, 0, 0, 0, 207, + 0, 211, 0, 226, 231, 0, 206, 0, 210, 0, + 0, 52, 32, 208, 212, 0, 0, 182 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 3, 4, 6, 8, 9, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 274, - 384, 41, 150, 73, 60, 69, 321, 322, 358, 117, - 61, 118, 260, 261, 262, 354, 399, 401, 70, 320, - 108, 272, 200, 100, 42, 43, 119, 195, 315, 256, - 313, 161, 44, 45, 46, 135, 86, 267, 362, 136, - 120, 363, 364, 121, 175, 291, 176, 391, 412, 177, - 233, 178, 413, 179, 307, 292, 283, 180, 310, 344, - 181, 228, 182, 281, 183, 246, 184, 406, 422, 185, - 302, 303, 346, 243, 295, 296, 338, 336, 186, 122, - 366, 367, 427, 123, 368, 429, 124, 277, 279, 369, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 275, + 385, 41, 150, 73, 60, 69, 322, 323, 359, 117, + 61, 118, 261, 262, 263, 355, 400, 402, 70, 321, + 108, 273, 200, 100, 42, 43, 119, 195, 316, 257, + 314, 161, 44, 45, 46, 135, 86, 268, 363, 136, + 120, 364, 365, 121, 175, 292, 176, 392, 413, 177, + 234, 178, 414, 179, 308, 293, 284, 180, 311, 345, + 181, 229, 182, 282, 183, 247, 184, 407, 423, 185, + 303, 304, 347, 244, 296, 297, 339, 337, 186, 122, + 367, 368, 428, 123, 369, 430, 124, 278, 280, 370, 125, 140, 126, 127, 142, 74, 47, 57, 48, 52, - 80, 49, 62, 94, 146, 210, 234, 220, 148, 327, - 248, 212, 371, 305, 50 + 80, 49, 62, 94, 146, 210, 235, 221, 148, 328, + 249, 212, 372, 306, 50 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -384 +#define YYPACT_NINF -399 static const yytype_int16 yypact[] = { - 167, -384, -384, 37, -384, -384, 60, -70, -384, 171, - -23, -384, -13, 9, 12, 63, -384, -384, -33, -33, - -33, -33, -33, -33, 67, 104, -33, -33, -384, 66, - -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, - -384, -384, 68, -384, -384, -384, -384, -384, -384, -384, - -384, -384, 115, 109, 111, 112, -4, 115, 22, -384, - 113, 106, -384, 118, 120, 121, 122, 123, -384, 124, - 130, -384, -384, -384, -16, 126, 127, -384, -384, -384, - 128, 140, -18, 158, 204, -39, -384, 128, 26, -384, - -384, -384, -384, 134, -384, 104, -384, -384, -384, -384, - -384, 104, 104, 104, 104, 104, 104, -384, -384, -384, - -384, 73, 84, 76, -10, 135, 104, 64, 136, -384, - -384, -384, -384, -384, -384, -384, -384, -384, -16, 104, - 147, -384, -384, -384, -384, 137, -384, -384, -384, -384, - -384, -384, -384, 194, -384, -384, 46, 225, -384, 141, - 142, -16, 143, -384, 144, -384, -384, 87, -384, -384, - 134, -384, 145, 146, 148, 189, 15, 149, 88, 150, - 97, 80, 0, 151, 134, -384, -384, -384, -384, -384, - -384, -384, -384, -384, -384, 190, -384, 87, -384, 152, - -384, -384, 134, 153, 154, -384, 42, -384, -384, -384, - -384, -8, 156, 159, -384, 160, -384, -384, -384, -384, - -384, -384, 161, 104, 104, 163, 186, 104, -384, -384, - -384, -384, 249, 251, 252, -384, -384, -384, -384, 253, - -384, -384, -384, -384, 210, 253, 8, 169, 256, -384, - 172, -384, 134, 21, -384, -384, -384, 257, 254, -7, - 173, -384, 261, -384, 262, 261, -384, 104, -384, -384, - 176, -384, -384, 184, 104, 104, 174, -384, -384, -384, - -384, -384, -384, 180, 182, 183, -384, 185, -384, 187, - -384, 188, -384, 191, -384, 193, -384, -384, -384, -384, - -384, -384, -384, 269, -384, -384, -384, 270, -384, -384, - -384, -384, -384, -384, -384, 195, -384, -384, -384, -384, - 133, 271, -384, 196, -384, 197, 198, 45, -384, -384, - 108, -384, 192, -6, 201, -17, 273, -384, 110, 104, - -384, -384, 242, 29, 97, -384, 200, -384, 202, -384, - -384, -384, -384, -384, -384, -384, 203, -384, -384, -384, - 104, -384, 281, 288, -384, 104, -384, -384, -384, 104, - 103, 76, 48, -384, -384, -384, -384, -384, -384, -384, - -384, 205, -384, -384, -384, -384, -384, -384, -384, -384, - -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, - 282, -384, -384, 5, -384, -384, -384, 50, -384, -384, - -384, -384, 208, 209, 211, 212, -384, 260, -17, -384, - -384, -384, -384, -384, -384, 104, -384, 104, 186, 249, - 251, 213, -384, -384, 214, 219, 220, 221, 228, 224, - 230, 271, -384, 104, 110, -384, 249, -384, 251, 49, - -384, -384, -384, -384, 271, 226, -384 + 154, -399, -399, 48, -399, -399, 51, -37, -399, 172, + -2, -399, 17, 31, 42, 47, -399, -399, -33, -33, + -33, -33, -33, -33, 54, 56, -33, -33, -399, 6, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, 52, -399, -399, -399, -399, -399, -399, -399, + -399, -399, 66, 25, 61, 112, -6, 66, 102, -399, + 118, 116, -399, 119, 120, 121, 122, 123, -399, 124, + 130, -399, -399, -399, -16, 126, 127, -399, -399, -399, + 128, 70, -15, 159, 214, -36, -399, 128, 28, -399, + -399, -399, -399, 131, -399, 56, -399, -399, -399, -399, + -399, 56, 56, 56, 56, 56, 56, -399, -399, -399, + -399, 27, 38, 76, -9, 135, 56, 60, 136, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -16, 56, + 147, -399, -399, -399, -399, 137, -399, -399, -399, -399, + -399, -399, -399, 148, -399, -399, 18, 225, -399, 141, + 142, -16, 144, -399, 145, -399, -399, 50, -399, -399, + 131, -399, 146, 149, 150, 187, 7, 151, 43, 152, + 69, 85, -1, 153, 131, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, 190, -399, 50, -399, 155, + -399, -399, 131, 156, 158, -399, 20, -399, -399, -399, + -399, -8, 160, 162, -399, 161, -399, -399, -399, -399, + -399, -399, 163, 56, 56, 169, 173, 171, 56, -399, + -399, -399, -399, 234, 240, 252, -399, -399, -399, -399, + 254, -399, -399, -399, -399, 211, 254, 2, 170, 257, + -399, 174, -399, 131, 12, -399, -399, -399, 258, 253, + -5, 175, -399, 262, -399, 263, 262, -399, 56, -399, + -399, 177, -399, -399, 185, 56, 56, 176, -399, -399, + -399, -399, -399, -399, 180, 183, 184, -399, 186, -399, + 189, -399, 191, -399, 192, -399, 194, -399, -399, -399, + -399, -399, -399, -399, 270, -399, -399, -399, 271, -399, + -399, -399, -399, -399, -399, -399, 195, -399, -399, -399, + -399, 143, 272, -399, 196, -399, 197, 198, 34, -399, + -399, 101, -399, 201, -4, 202, -12, 274, -399, 111, + 56, -399, -399, 241, 84, 69, -399, 203, -399, 204, + -399, -399, -399, -399, -399, -399, -399, 205, -399, -399, + -399, 56, -399, 277, 288, -399, 56, -399, -399, -399, + 56, 80, 76, 35, -399, -399, -399, -399, -399, -399, + -399, -399, 206, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, 280, -399, -399, 14, -399, -399, -399, 39, -399, + -399, -399, -399, 209, 210, 212, 213, -399, 261, -12, + -399, -399, -399, -399, -399, -399, 56, -399, 56, 171, + 234, 240, 219, -399, -399, 208, 221, 222, 224, 215, + 226, 227, 272, -399, 56, 111, -399, 234, -399, 240, + -13, -399, -399, -399, -399, 272, 228, -399 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -384, -384, -384, -384, -384, -384, -384, -384, -384, -384, - -384, -384, -384, -384, -384, -384, -384, -384, -384, -100, - -115, -384, -97, -91, 119, -384, -384, -343, -384, -93, - -384, -384, -384, -384, -384, -384, -384, -384, 138, -384, - -384, -384, -384, -384, -384, -384, 255, -384, -384, -384, - 83, -384, -384, -384, -384, -384, -384, -384, -384, -384, - -384, -68, -384, -84, -384, -384, -384, -384, -384, -384, - -384, -384, -384, -384, -384, -308, 107, -384, -384, -384, - -384, -384, -384, -384, -384, -384, -384, -384, -384, -20, - -384, -384, -383, -384, -384, -384, -384, -384, -384, 258, - -384, -384, -384, -384, -384, -384, -384, -320, -371, 259, - -384, -384, -384, -83, -113, -85, -384, -384, -384, -384, - 289, -384, 264, -384, -384, -384, -165, 162, -150, -384, - -384, -384, -384, -384, -384 + -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -100, + -98, -399, -97, -91, 188, -399, -399, -344, -399, -99, + -399, -399, -399, -399, -399, -399, -399, -399, 134, -399, + -399, -399, -399, -399, -399, -399, 259, -399, -399, -399, + 83, -399, -399, -399, -399, -399, -399, -399, -399, -399, + -399, -69, -399, -84, -399, -399, -399, -399, -399, -399, + -399, -399, -399, -399, -399, -317, 106, -399, -399, -399, + -399, -399, -399, -399, -399, -399, -399, -399, -399, -19, + -399, -399, -398, -399, -399, -399, -399, -399, -399, 260, + -399, -399, -399, -399, -399, -399, -399, -377, -381, 265, + -399, -399, 193, -83, -113, -85, -399, -399, -399, -399, + 289, -399, 264, -399, -399, -399, -165, 164, -150, -399, + -399, -399, -399, -399, -399 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -62 +#define YYTABLE_NINF -219 static const yytype_int16 yytable[] = { - 143, 137, 141, 196, 149, 236, 153, 109, 110, 156, - 221, 152, 402, 154, 155, 259, 151, 356, 151, 187, - 111, 151, 111, 112, 249, 392, 244, 188, 308, 10, - 286, 143, 58, 286, 113, 202, 287, 5, 203, 287, - 189, 288, 253, 190, 226, 360, 112, 309, 439, 430, - 191, 88, 89, 144, 286, 387, 361, 113, 215, 90, - 287, 445, 299, 300, 192, 145, 59, 443, 7, 388, - 245, 227, 71, 72, 425, 116, 290, 289, 114, 290, - 114, 91, 92, 115, 51, 414, 53, 193, 194, 389, - 440, 68, 298, 357, 71, 72, 93, 116, 116, 428, - 290, 390, 157, 301, 164, 84, 165, 208, 54, 85, - 158, 55, 166, 230, 209, 231, 442, 270, 162, 167, - 168, 169, 269, 170, 231, 171, 275, 232, 237, 151, - 163, 238, 239, 159, 172, 240, 232, 404, 63, 64, - 65, 66, 67, 241, 317, 75, 76, 160, 218, 405, - 257, 173, 174, 350, 444, 219, 408, 258, 415, 396, - 351, 242, 56, 409, 197, 416, 68, 198, 199, 393, - 1, 2, 143, 77, 324, 78, 11, 12, 13, 323, - 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 372, 373, 374, 375, 376, 377, - 378, 379, 380, 381, 382, 383, 96, 97, 98, 99, - 340, 341, 342, 343, 79, 71, 72, 206, 207, 352, - 353, 95, 81, 58, 82, 83, 101, 134, 102, 103, - 104, 105, 106, 107, 128, 129, 130, 397, 385, 131, - 143, 365, 141, 147, -61, 201, 204, 205, 211, 213, - 214, 216, 217, 225, 222, 223, 250, 224, 229, 235, - 247, 252, 254, 255, 264, 143, 271, 265, 403, 273, - 323, 268, 276, 266, 278, 280, 282, 284, 293, 294, - 304, 297, 311, 306, 312, 314, 318, 319, 325, 326, - 328, 329, 335, 337, 345, 330, 370, 331, 332, 386, - 355, 333, 424, 334, 398, 339, 347, 348, 349, 359, - 394, 400, 395, 396, 411, 410, 417, 418, 426, 441, - 419, 420, 431, 143, 365, 141, 421, 433, 434, 432, - 143, 435, 323, 436, 437, 438, 446, 132, 316, 263, - 423, 407, 285, 138, 139, 0, 87, 133, 323, 251 + 143, 137, 141, 196, 149, 237, 153, 109, 110, 156, + 222, 152, 403, 154, 155, 260, 151, 393, 151, 357, + 187, 151, 111, 111, 250, 245, 112, 287, 188, 202, + 309, 143, 58, 288, 440, 289, 227, 113, 203, 287, + 431, 189, 254, 429, 190, 288, 112, 446, 5, 310, + 361, 191, 215, 300, 301, 144, 157, 113, 444, 7, + 443, 362, 10, 228, 158, 192, 59, 145, 231, 246, + 232, 290, 162, 291, 426, 71, 72, 415, 116, 208, + 114, 114, 233, 115, 163, 291, 209, 159, 193, 194, + 441, 68, 445, 299, 302, 358, 232, 397, 116, 71, + 72, 160, 116, 84, 164, 51, 165, 85, 233, 287, + 388, 219, 166, 77, 405, 288, 53, 271, 220, 167, + 168, 169, 270, 170, 389, 171, 406, 276, 258, 151, + 54, 88, 89, 238, 172, 259, 239, 240, 81, 90, + 241, 55, 351, 409, 390, 318, 56, 416, 242, 352, + 410, 173, 174, 68, 417, 291, 391, 1, 2, 78, + 197, 91, 92, 198, 199, 79, 243, 71, 72, 131, + 394, 206, 207, 143, 82, 325, 93, 11, 12, 13, + 324, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 373, 374, 375, 376, 377, + 378, 379, 380, 381, 382, 383, 384, 63, 64, 65, + 66, 67, 353, 354, 75, 76, 96, 97, 98, 99, + 341, 342, 343, 344, 58, 83, 95, 101, 102, 103, + 104, 105, 106, 107, 128, 129, 130, 134, 398, 386, + 147, 143, 366, 141, -62, 201, 204, 205, 211, 213, + 214, 226, 217, 218, 274, 223, 251, 277, 224, 225, + 230, 236, 248, 279, 253, 255, 143, 256, 265, 404, + 266, 324, 272, 269, 267, 281, -218, 283, 285, 294, + 295, 305, 307, 298, 312, 313, 315, 319, 320, 327, + 326, 329, 330, 336, 338, 346, 331, 371, 387, 332, + 399, 333, 334, 425, 335, 340, 348, 349, 350, 356, + 360, 401, 412, 395, 396, 397, 411, 418, 419, 427, + 437, 420, 421, 433, 143, 366, 141, 422, 432, 434, + 435, 143, 439, 324, 436, 264, 438, 442, 447, 317, + 424, 132, 286, 408, 216, 138, 87, 133, 0, 324, + 139, 252 }; static const yytype_int16 yycheck[] = { 85, 85, 85, 116, 95, 170, 103, 23, 24, 106, - 160, 102, 355, 104, 105, 23, 101, 23, 103, 29, - 38, 106, 38, 62, 174, 333, 26, 37, 35, 99, - 25, 116, 65, 25, 73, 128, 31, 0, 129, 31, - 50, 33, 192, 53, 29, 62, 62, 54, 431, 420, - 60, 29, 30, 27, 25, 26, 73, 73, 151, 37, - 31, 444, 41, 42, 74, 39, 99, 438, 8, 40, - 70, 56, 111, 112, 417, 114, 71, 69, 96, 71, - 96, 59, 60, 99, 107, 393, 99, 97, 98, 60, - 433, 99, 242, 99, 111, 112, 74, 114, 114, 419, - 71, 72, 29, 82, 28, 109, 30, 61, 99, 113, - 37, 99, 36, 25, 68, 27, 436, 214, 34, 43, - 44, 45, 213, 47, 27, 49, 217, 39, 48, 214, - 46, 51, 52, 60, 58, 55, 39, 34, 19, 20, - 21, 22, 23, 63, 257, 26, 27, 74, 61, 46, - 108, 75, 76, 108, 105, 68, 108, 115, 108, 110, - 115, 81, 99, 115, 100, 115, 99, 103, 104, 334, - 3, 4, 257, 107, 265, 107, 5, 6, 7, 264, - 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 84, 85, 86, 87, 88, 89, - 90, 91, 92, 93, 94, 95, 100, 101, 102, 103, - 77, 78, 79, 80, 99, 111, 112, 23, 24, 111, - 112, 108, 113, 65, 113, 113, 108, 23, 108, 108, - 108, 108, 108, 103, 108, 108, 108, 350, 329, 99, - 325, 325, 325, 109, 109, 109, 99, 110, 23, 108, - 108, 108, 108, 64, 109, 109, 66, 109, 109, 109, - 109, 109, 109, 109, 108, 350, 103, 108, 359, 83, - 355, 110, 23, 113, 23, 23, 23, 67, 109, 23, - 23, 109, 109, 29, 23, 23, 110, 103, 114, 109, - 108, 108, 23, 23, 23, 110, 23, 110, 110, 57, - 108, 110, 415, 110, 23, 110, 110, 110, 110, 108, - 110, 23, 110, 110, 32, 110, 108, 108, 418, 434, - 109, 109, 109, 408, 408, 408, 66, 108, 108, 115, - 415, 110, 417, 105, 110, 105, 110, 82, 255, 201, - 408, 361, 235, 85, 85, -1, 57, 83, 433, 187 + 160, 102, 356, 104, 105, 23, 101, 334, 103, 23, + 29, 106, 38, 38, 174, 26, 62, 25, 37, 128, + 35, 116, 65, 31, 432, 33, 29, 73, 129, 25, + 421, 50, 192, 420, 53, 31, 62, 445, 0, 54, + 62, 60, 151, 41, 42, 27, 29, 73, 439, 8, + 437, 73, 99, 56, 37, 74, 99, 39, 25, 70, + 27, 69, 34, 71, 418, 111, 112, 394, 114, 61, + 96, 96, 39, 99, 46, 71, 68, 60, 97, 98, + 434, 99, 105, 243, 82, 99, 27, 110, 114, 111, + 112, 74, 114, 109, 28, 107, 30, 113, 39, 25, + 26, 61, 36, 107, 34, 31, 99, 214, 68, 43, + 44, 45, 213, 47, 40, 49, 46, 218, 108, 214, + 99, 29, 30, 48, 58, 115, 51, 52, 113, 37, + 55, 99, 108, 108, 60, 258, 99, 108, 63, 115, + 115, 75, 76, 99, 115, 71, 72, 3, 4, 107, + 100, 59, 60, 103, 104, 99, 81, 111, 112, 99, + 335, 23, 24, 258, 113, 266, 74, 5, 6, 7, + 265, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 19, 20, 21, + 22, 23, 111, 112, 26, 27, 100, 101, 102, 103, + 77, 78, 79, 80, 65, 113, 108, 108, 108, 108, + 108, 108, 108, 103, 108, 108, 108, 23, 351, 330, + 109, 326, 326, 326, 109, 109, 99, 110, 23, 108, + 108, 64, 108, 108, 83, 109, 66, 23, 109, 109, + 109, 109, 109, 23, 109, 109, 351, 109, 108, 360, + 108, 356, 103, 110, 113, 23, 103, 23, 67, 109, + 23, 23, 29, 109, 109, 23, 23, 110, 103, 109, + 114, 108, 108, 23, 23, 23, 110, 23, 57, 110, + 23, 110, 110, 416, 110, 110, 110, 110, 110, 108, + 108, 23, 32, 110, 110, 110, 110, 108, 108, 419, + 105, 109, 109, 115, 409, 409, 409, 66, 109, 108, + 108, 416, 105, 418, 110, 201, 110, 435, 110, 256, + 409, 82, 236, 362, 151, 85, 57, 83, -1, 434, + 85, 187 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -1197,30 +1199,30 @@ static const yytype_uint8 yystos[] = 193, 196, 198, 200, 202, 205, 214, 29, 37, 50, 53, 60, 74, 97, 98, 163, 230, 100, 103, 104, 158, 109, 145, 139, 99, 110, 23, 24, 61, 68, - 241, 23, 247, 108, 108, 145, 108, 108, 61, 68, - 243, 244, 109, 109, 109, 64, 29, 56, 197, 109, - 25, 27, 39, 186, 242, 109, 242, 48, 51, 52, - 55, 63, 81, 209, 26, 70, 201, 109, 246, 244, - 66, 243, 109, 244, 109, 109, 165, 108, 115, 23, - 148, 149, 150, 154, 108, 108, 113, 173, 110, 139, - 138, 103, 157, 83, 135, 139, 23, 223, 23, 224, - 23, 199, 23, 192, 67, 192, 25, 31, 33, 69, - 71, 181, 191, 109, 23, 210, 211, 109, 244, 41, - 42, 82, 206, 207, 23, 249, 29, 190, 35, 54, - 194, 109, 23, 166, 23, 164, 166, 230, 110, 103, - 155, 142, 143, 231, 139, 114, 109, 245, 108, 108, - 110, 110, 110, 110, 110, 23, 213, 23, 212, 110, - 77, 78, 79, 80, 195, 23, 208, 110, 110, 110, - 108, 115, 111, 112, 151, 108, 23, 99, 144, 108, - 62, 73, 174, 177, 178, 179, 216, 217, 220, 225, - 23, 248, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 95, 136, 139, 57, 26, 40, 60, - 72, 183, 191, 242, 110, 110, 110, 230, 23, 152, - 23, 153, 143, 139, 34, 46, 203, 205, 108, 115, - 110, 32, 184, 188, 191, 108, 115, 108, 108, 109, - 109, 66, 204, 177, 230, 143, 135, 218, 223, 221, - 224, 109, 115, 108, 108, 110, 105, 110, 105, 208, - 143, 136, 223, 224, 105, 208, 110 + 241, 23, 247, 108, 108, 145, 228, 108, 108, 61, + 68, 243, 244, 109, 109, 109, 64, 29, 56, 197, + 109, 25, 27, 39, 186, 242, 109, 242, 48, 51, + 52, 55, 63, 81, 209, 26, 70, 201, 109, 246, + 244, 66, 243, 109, 244, 109, 109, 165, 108, 115, + 23, 148, 149, 150, 154, 108, 108, 113, 173, 110, + 139, 138, 103, 157, 83, 135, 139, 23, 223, 23, + 224, 23, 199, 23, 192, 67, 192, 25, 31, 33, + 69, 71, 181, 191, 109, 23, 210, 211, 109, 244, + 41, 42, 82, 206, 207, 23, 249, 29, 190, 35, + 54, 194, 109, 23, 166, 23, 164, 166, 230, 110, + 103, 155, 142, 143, 231, 139, 114, 109, 245, 108, + 108, 110, 110, 110, 110, 110, 23, 213, 23, 212, + 110, 77, 78, 79, 80, 195, 23, 208, 110, 110, + 110, 108, 115, 111, 112, 151, 108, 23, 99, 144, + 108, 62, 73, 174, 177, 178, 179, 216, 217, 220, + 225, 23, 248, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 136, 139, 57, 26, 40, + 60, 72, 183, 191, 242, 110, 110, 110, 230, 23, + 152, 23, 153, 143, 139, 34, 46, 203, 205, 108, + 115, 110, 32, 184, 188, 191, 108, 115, 108, 108, + 109, 109, 66, 204, 177, 230, 143, 135, 218, 223, + 221, 224, 109, 115, 108, 108, 110, 105, 110, 105, + 208, 143, 136, 223, 224, 105, 208, 110 }; #define yyerrok (yyerrstatus = 0) @@ -2457,7 +2459,29 @@ yyreduce: case 48: /* Line 1455 of yacc.c */ -#line 540 "program_parse.y" +#line 538 "program_parse.y" + { + struct asm_symbol temp_sym; + + if (!state->option.NV_fragment) { + yyerror(& (yylsp[(2) - (2)]), state, "expected scalar suffix"); + YYERROR; + } + + memset(& temp_sym, 0, sizeof(temp_sym)); + temp_sym.param_binding_begin = ~0; + initialize_symbol_from_const(state->prog, & temp_sym, & (yyvsp[(2) - (2)].vector)); + + init_src_reg(& (yyval.src_reg)); + (yyval.src_reg).Base.File = PROGRAM_CONSTANT; + (yyval.src_reg).Base.Index = temp_sym.param_binding_begin; + ;} + break; + + case 49: + +/* Line 1455 of yacc.c */ +#line 557 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); @@ -2470,10 +2494,10 @@ yyreduce: ;} break; - case 49: + case 50: /* Line 1455 of yacc.c */ -#line 553 "program_parse.y" +#line 570 "program_parse.y" { (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); (yyval.dst_reg).WriteMask = (yyvsp[(2) - (2)].swiz_mask).mask; @@ -2495,10 +2519,10 @@ yyreduce: ;} break; - case 50: + case 51: /* Line 1455 of yacc.c */ -#line 575 "program_parse.y" +#line 592 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_ADDRESS; @@ -2507,10 +2531,10 @@ yyreduce: ;} break; - case 51: + case 52: /* Line 1455 of yacc.c */ -#line 584 "program_parse.y" +#line 601 "program_parse.y" { const unsigned xyzw_valid = ((yyvsp[(1) - (7)].ext_swizzle).xyzw_valid << 0) @@ -2543,20 +2567,20 @@ yyreduce: ;} break; - case 52: + case 53: /* Line 1455 of yacc.c */ -#line 617 "program_parse.y" +#line 634 "program_parse.y" { (yyval.ext_swizzle) = (yyvsp[(2) - (2)].ext_swizzle); (yyval.ext_swizzle).negate = ((yyvsp[(1) - (2)].negate)) ? 1 : 0; ;} break; - case 53: + case 54: /* Line 1455 of yacc.c */ -#line 624 "program_parse.y" +#line 641 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) != 0) && ((yyvsp[(1) - (1)].integer) != 1)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2573,10 +2597,10 @@ yyreduce: ;} break; - case 54: + case 55: /* Line 1455 of yacc.c */ -#line 639 "program_parse.y" +#line 656 "program_parse.y" { if (strlen((yyvsp[(1) - (1)].string)) > 1) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2626,10 +2650,10 @@ yyreduce: ;} break; - case 55: + case 56: /* Line 1455 of yacc.c */ -#line 689 "program_parse.y" +#line 706 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2673,10 +2697,10 @@ yyreduce: ;} break; - case 56: + case 57: /* Line 1455 of yacc.c */ -#line 731 "program_parse.y" +#line 748 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = PROGRAM_INPUT; @@ -2689,10 +2713,10 @@ yyreduce: ;} break; - case 57: + case 58: /* Line 1455 of yacc.c */ -#line 742 "program_parse.y" +#line 759 "program_parse.y" { if (! (yyvsp[(3) - (4)].src_reg).Base.RelAddr && ((unsigned) (yyvsp[(3) - (4)].src_reg).Base.Index >= (yyvsp[(1) - (4)].sym)->param_binding_length)) { @@ -2715,10 +2739,10 @@ yyreduce: ;} break; - case 58: + case 59: /* Line 1455 of yacc.c */ -#line 763 "program_parse.y" +#line 780 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = ((yyvsp[(1) - (1)].temp_sym).name != NULL) @@ -2728,10 +2752,10 @@ yyreduce: ;} break; - case 59: + case 60: /* Line 1455 of yacc.c */ -#line 773 "program_parse.y" +#line 790 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_OUTPUT; @@ -2739,10 +2763,10 @@ yyreduce: ;} break; - case 60: + case 61: /* Line 1455 of yacc.c */ -#line 779 "program_parse.y" +#line 796 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2773,10 +2797,10 @@ yyreduce: ;} break; - case 61: + case 62: /* Line 1455 of yacc.c */ -#line 810 "program_parse.y" +#line 827 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2793,20 +2817,20 @@ yyreduce: ;} break; - case 64: + case 65: /* Line 1455 of yacc.c */ -#line 829 "program_parse.y" +#line 846 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].integer); ;} break; - case 65: + case 66: /* Line 1455 of yacc.c */ -#line 836 "program_parse.y" +#line 853 "program_parse.y" { /* FINISHME: Add support for multiple address registers. */ @@ -2818,31 +2842,31 @@ yyreduce: ;} break; - case 66: + case 67: /* Line 1455 of yacc.c */ -#line 847 "program_parse.y" +#line 864 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 67: + case 68: /* Line 1455 of yacc.c */ -#line 848 "program_parse.y" +#line 865 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; - case 68: + case 69: /* Line 1455 of yacc.c */ -#line 849 "program_parse.y" +#line 866 "program_parse.y" { (yyval.integer) = -(yyvsp[(2) - (2)].integer); ;} break; - case 69: + case 70: /* Line 1455 of yacc.c */ -#line 853 "program_parse.y" +#line 870 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 63)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2854,10 +2878,10 @@ yyreduce: ;} break; - case 70: + case 71: /* Line 1455 of yacc.c */ -#line 865 "program_parse.y" +#line 882 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 64)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2869,10 +2893,10 @@ yyreduce: ;} break; - case 71: + case 72: /* Line 1455 of yacc.c */ -#line 877 "program_parse.y" +#line 894 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2890,10 +2914,10 @@ yyreduce: ;} break; - case 72: + case 73: /* Line 1455 of yacc.c */ -#line 895 "program_parse.y" +#line 912 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, "invalid address component selector"); @@ -2904,10 +2928,10 @@ yyreduce: ;} break; - case 73: + case 74: /* Line 1455 of yacc.c */ -#line 906 "program_parse.y" +#line 923 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2919,24 +2943,24 @@ yyreduce: ;} break; - case 78: + case 79: /* Line 1455 of yacc.c */ -#line 922 "program_parse.y" +#line 939 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; - case 83: + case 84: /* Line 1455 of yacc.c */ -#line 926 "program_parse.y" +#line 943 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; - case 90: + case 91: /* Line 1455 of yacc.c */ -#line 938 "program_parse.y" +#line 955 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_attrib, & (yylsp[(2) - (4)])); @@ -2954,55 +2978,55 @@ yyreduce: ;} break; - case 91: + case 92: /* Line 1455 of yacc.c */ -#line 956 "program_parse.y" +#line 973 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} break; - case 92: + case 93: /* Line 1455 of yacc.c */ -#line 960 "program_parse.y" +#line 977 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} break; - case 93: + case 94: /* Line 1455 of yacc.c */ -#line 966 "program_parse.y" +#line 983 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_POS; ;} break; - case 94: + case 95: /* Line 1455 of yacc.c */ -#line 970 "program_parse.y" +#line 987 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_WEIGHT; ;} break; - case 95: + case 96: /* Line 1455 of yacc.c */ -#line 974 "program_parse.y" +#line 991 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_NORMAL; ;} break; - case 96: + case 97: /* Line 1455 of yacc.c */ -#line 978 "program_parse.y" +#line 995 "program_parse.y" { if (!state->ctx->Extensions.EXT_secondary_color) { yyerror(& (yylsp[(2) - (2)]), state, "GL_EXT_secondary_color not supported"); @@ -3013,10 +3037,10 @@ yyreduce: ;} break; - case 97: + case 98: /* Line 1455 of yacc.c */ -#line 987 "program_parse.y" +#line 1004 "program_parse.y" { if (!state->ctx->Extensions.EXT_fog_coord) { yyerror(& (yylsp[(1) - (1)]), state, "GL_EXT_fog_coord not supported"); @@ -3027,38 +3051,38 @@ yyreduce: ;} break; - case 98: + case 99: /* Line 1455 of yacc.c */ -#line 996 "program_parse.y" +#line 1013 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} break; - case 99: + case 100: /* Line 1455 of yacc.c */ -#line 1000 "program_parse.y" +#line 1017 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; ;} break; - case 100: + case 101: /* Line 1455 of yacc.c */ -#line 1005 "program_parse.y" +#line 1022 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_GENERIC0 + (yyvsp[(3) - (4)].integer); ;} break; - case 101: + case 102: /* Line 1455 of yacc.c */ -#line 1011 "program_parse.y" +#line 1028 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxAttribs) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex attribute reference"); @@ -3069,46 +3093,46 @@ yyreduce: ;} break; - case 105: + case 106: /* Line 1455 of yacc.c */ -#line 1025 "program_parse.y" +#line 1042 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_WPOS; ;} break; - case 106: + case 107: /* Line 1455 of yacc.c */ -#line 1029 "program_parse.y" +#line 1046 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_COL0 + (yyvsp[(2) - (2)].integer); ;} break; - case 107: + case 108: /* Line 1455 of yacc.c */ -#line 1033 "program_parse.y" +#line 1050 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_FOGC; ;} break; - case 108: + case 109: /* Line 1455 of yacc.c */ -#line 1037 "program_parse.y" +#line 1054 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} break; - case 111: + case 112: /* Line 1455 of yacc.c */ -#line 1045 "program_parse.y" +#line 1062 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (3)].string), at_param, & (yylsp[(2) - (3)])); @@ -3124,10 +3148,10 @@ yyreduce: ;} break; - case 112: + case 113: /* Line 1455 of yacc.c */ -#line 1061 "program_parse.y" +#line 1078 "program_parse.y" { if (((yyvsp[(4) - (6)].integer) != 0) && ((unsigned) (yyvsp[(4) - (6)].integer) != (yyvsp[(6) - (6)].temp_sym).param_binding_length)) { yyerror(& (yylsp[(4) - (6)]), state, @@ -3149,19 +3173,19 @@ yyreduce: ;} break; - case 113: + case 114: /* Line 1455 of yacc.c */ -#line 1083 "program_parse.y" +#line 1100 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 114: + case 115: /* Line 1455 of yacc.c */ -#line 1087 "program_parse.y" +#line 1104 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 1) || ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxParameters)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid parameter array size"); @@ -3172,38 +3196,38 @@ yyreduce: ;} break; - case 115: + case 116: /* Line 1455 of yacc.c */ -#line 1098 "program_parse.y" +#line 1115 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(2) - (2)].temp_sym); ;} break; - case 116: + case 117: /* Line 1455 of yacc.c */ -#line 1104 "program_parse.y" +#line 1121 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(3) - (4)].temp_sym); ;} break; - case 118: + case 119: /* Line 1455 of yacc.c */ -#line 1111 "program_parse.y" +#line 1128 "program_parse.y" { (yyvsp[(1) - (3)].temp_sym).param_binding_length += (yyvsp[(3) - (3)].temp_sym).param_binding_length; (yyval.temp_sym) = (yyvsp[(1) - (3)].temp_sym); ;} break; - case 119: + case 120: /* Line 1455 of yacc.c */ -#line 1118 "program_parse.y" +#line 1135 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3211,10 +3235,10 @@ yyreduce: ;} break; - case 120: + case 121: /* Line 1455 of yacc.c */ -#line 1124 "program_parse.y" +#line 1141 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3222,10 +3246,10 @@ yyreduce: ;} break; - case 121: + case 122: /* Line 1455 of yacc.c */ -#line 1130 "program_parse.y" +#line 1147 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3233,10 +3257,10 @@ yyreduce: ;} break; - case 122: + case 123: /* Line 1455 of yacc.c */ -#line 1138 "program_parse.y" +#line 1155 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3244,10 +3268,10 @@ yyreduce: ;} break; - case 123: + case 124: /* Line 1455 of yacc.c */ -#line 1144 "program_parse.y" +#line 1161 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3255,10 +3279,10 @@ yyreduce: ;} break; - case 124: + case 125: /* Line 1455 of yacc.c */ -#line 1150 "program_parse.y" +#line 1167 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3266,10 +3290,10 @@ yyreduce: ;} break; - case 125: + case 126: /* Line 1455 of yacc.c */ -#line 1158 "program_parse.y" +#line 1175 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3277,10 +3301,10 @@ yyreduce: ;} break; - case 126: + case 127: /* Line 1455 of yacc.c */ -#line 1164 "program_parse.y" +#line 1181 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3288,10 +3312,10 @@ yyreduce: ;} break; - case 127: + case 128: /* Line 1455 of yacc.c */ -#line 1170 "program_parse.y" +#line 1187 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3299,101 +3323,101 @@ yyreduce: ;} break; - case 128: - -/* Line 1455 of yacc.c */ -#line 1177 "program_parse.y" - { memcpy((yyval.state), (yyvsp[(1) - (1)].state), sizeof((yyval.state))); ;} - break; - case 129: /* Line 1455 of yacc.c */ -#line 1178 "program_parse.y" - { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} +#line 1194 "program_parse.y" + { memcpy((yyval.state), (yyvsp[(1) - (1)].state), sizeof((yyval.state))); ;} break; case 130: /* Line 1455 of yacc.c */ -#line 1181 "program_parse.y" +#line 1195 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 131: /* Line 1455 of yacc.c */ -#line 1182 "program_parse.y" +#line 1198 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 132: /* Line 1455 of yacc.c */ -#line 1183 "program_parse.y" +#line 1199 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 133: /* Line 1455 of yacc.c */ -#line 1184 "program_parse.y" +#line 1200 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 134: /* Line 1455 of yacc.c */ -#line 1185 "program_parse.y" +#line 1201 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 135: /* Line 1455 of yacc.c */ -#line 1186 "program_parse.y" +#line 1202 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 136: /* Line 1455 of yacc.c */ -#line 1187 "program_parse.y" +#line 1203 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 137: /* Line 1455 of yacc.c */ -#line 1188 "program_parse.y" +#line 1204 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 138: /* Line 1455 of yacc.c */ -#line 1189 "program_parse.y" +#line 1205 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 139: /* Line 1455 of yacc.c */ -#line 1190 "program_parse.y" +#line 1206 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 140: /* Line 1455 of yacc.c */ -#line 1191 "program_parse.y" +#line 1207 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 141: /* Line 1455 of yacc.c */ -#line 1195 "program_parse.y" +#line 1208 "program_parse.y" + { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} + break; + + case 142: + +/* Line 1455 of yacc.c */ +#line 1212 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_MATERIAL; @@ -3402,37 +3426,37 @@ yyreduce: ;} break; - case 142: + case 143: /* Line 1455 of yacc.c */ -#line 1204 "program_parse.y" +#line 1221 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 143: + case 144: /* Line 1455 of yacc.c */ -#line 1208 "program_parse.y" +#line 1225 "program_parse.y" { (yyval.integer) = STATE_EMISSION; ;} break; - case 144: + case 145: /* Line 1455 of yacc.c */ -#line 1212 "program_parse.y" +#line 1229 "program_parse.y" { (yyval.integer) = STATE_SHININESS; ;} break; - case 145: + case 146: /* Line 1455 of yacc.c */ -#line 1218 "program_parse.y" +#line 1235 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHT; @@ -3441,28 +3465,28 @@ yyreduce: ;} break; - case 146: + case 147: /* Line 1455 of yacc.c */ -#line 1227 "program_parse.y" +#line 1244 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 147: + case 148: /* Line 1455 of yacc.c */ -#line 1231 "program_parse.y" +#line 1248 "program_parse.y" { (yyval.integer) = STATE_POSITION; ;} break; - case 148: + case 149: /* Line 1455 of yacc.c */ -#line 1235 "program_parse.y" +#line 1252 "program_parse.y" { if (!state->ctx->Extensions.EXT_point_parameters) { yyerror(& (yylsp[(1) - (1)]), state, "GL_ARB_point_parameters not supported"); @@ -3473,57 +3497,57 @@ yyreduce: ;} break; - case 149: + case 150: /* Line 1455 of yacc.c */ -#line 1244 "program_parse.y" +#line 1261 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; - case 150: + case 151: /* Line 1455 of yacc.c */ -#line 1248 "program_parse.y" +#line 1265 "program_parse.y" { (yyval.integer) = STATE_HALF_VECTOR; ;} break; - case 151: + case 152: /* Line 1455 of yacc.c */ -#line 1254 "program_parse.y" +#line 1271 "program_parse.y" { (yyval.integer) = STATE_SPOT_DIRECTION; ;} break; - case 152: + case 153: /* Line 1455 of yacc.c */ -#line 1260 "program_parse.y" +#line 1277 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (2)].state)[1]; ;} break; - case 153: + case 154: /* Line 1455 of yacc.c */ -#line 1267 "program_parse.y" +#line 1284 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_AMBIENT; ;} break; - case 154: + case 155: /* Line 1455 of yacc.c */ -#line 1272 "program_parse.y" +#line 1289 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_SCENECOLOR; @@ -3531,10 +3555,10 @@ yyreduce: ;} break; - case 155: + case 156: /* Line 1455 of yacc.c */ -#line 1280 "program_parse.y" +#line 1297 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTPROD; @@ -3544,10 +3568,10 @@ yyreduce: ;} break; - case 157: + case 158: /* Line 1455 of yacc.c */ -#line 1292 "program_parse.y" +#line 1309 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(3) - (3)].integer); @@ -3555,46 +3579,46 @@ yyreduce: ;} break; - case 158: + case 159: /* Line 1455 of yacc.c */ -#line 1300 "program_parse.y" +#line 1317 "program_parse.y" { (yyval.integer) = STATE_TEXENV_COLOR; ;} break; - case 159: + case 160: /* Line 1455 of yacc.c */ -#line 1306 "program_parse.y" +#line 1323 "program_parse.y" { (yyval.integer) = STATE_AMBIENT; ;} break; - case 160: + case 161: /* Line 1455 of yacc.c */ -#line 1310 "program_parse.y" +#line 1327 "program_parse.y" { (yyval.integer) = STATE_DIFFUSE; ;} break; - case 161: + case 162: /* Line 1455 of yacc.c */ -#line 1314 "program_parse.y" +#line 1331 "program_parse.y" { (yyval.integer) = STATE_SPECULAR; ;} break; - case 162: + case 163: /* Line 1455 of yacc.c */ -#line 1320 "program_parse.y" +#line 1337 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxLights) { yyerror(& (yylsp[(1) - (1)]), state, "invalid light selector"); @@ -3605,10 +3629,10 @@ yyreduce: ;} break; - case 163: + case 164: /* Line 1455 of yacc.c */ -#line 1331 "program_parse.y" +#line 1348 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_TEXGEN; @@ -3617,92 +3641,92 @@ yyreduce: ;} break; - case 164: + case 165: /* Line 1455 of yacc.c */ -#line 1340 "program_parse.y" +#line 1357 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S; ;} break; - case 165: + case 166: /* Line 1455 of yacc.c */ -#line 1344 "program_parse.y" +#line 1361 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_OBJECT_S; ;} break; - case 166: + case 167: /* Line 1455 of yacc.c */ -#line 1349 "program_parse.y" +#line 1366 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S; ;} break; - case 167: + case 168: /* Line 1455 of yacc.c */ -#line 1353 "program_parse.y" +#line 1370 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S; ;} break; - case 168: + case 169: /* Line 1455 of yacc.c */ -#line 1357 "program_parse.y" +#line 1374 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S; ;} break; - case 169: + case 170: /* Line 1455 of yacc.c */ -#line 1361 "program_parse.y" +#line 1378 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S; ;} break; - case 170: + case 171: /* Line 1455 of yacc.c */ -#line 1367 "program_parse.y" +#line 1384 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); ;} break; - case 171: + case 172: /* Line 1455 of yacc.c */ -#line 1374 "program_parse.y" +#line 1391 "program_parse.y" { (yyval.integer) = STATE_FOG_COLOR; ;} break; - case 172: + case 173: /* Line 1455 of yacc.c */ -#line 1378 "program_parse.y" +#line 1395 "program_parse.y" { (yyval.integer) = STATE_FOG_PARAMS; ;} break; - case 173: + case 174: /* Line 1455 of yacc.c */ -#line 1384 "program_parse.y" +#line 1401 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_CLIPPLANE; @@ -3710,10 +3734,10 @@ yyreduce: ;} break; - case 174: + case 175: /* Line 1455 of yacc.c */ -#line 1392 "program_parse.y" +#line 1409 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxClipPlanes) { yyerror(& (yylsp[(1) - (1)]), state, "invalid clip plane selector"); @@ -3724,38 +3748,38 @@ yyreduce: ;} break; - case 175: + case 176: /* Line 1455 of yacc.c */ -#line 1403 "program_parse.y" +#line 1420 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); ;} break; - case 176: + case 177: /* Line 1455 of yacc.c */ -#line 1410 "program_parse.y" +#line 1427 "program_parse.y" { (yyval.integer) = STATE_POINT_SIZE; ;} break; - case 177: + case 178: /* Line 1455 of yacc.c */ -#line 1414 "program_parse.y" +#line 1431 "program_parse.y" { (yyval.integer) = STATE_POINT_ATTENUATION; ;} break; - case 178: + case 179: /* Line 1455 of yacc.c */ -#line 1420 "program_parse.y" +#line 1437 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (5)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (5)].state)[1]; @@ -3765,10 +3789,10 @@ yyreduce: ;} break; - case 179: + case 180: /* Line 1455 of yacc.c */ -#line 1430 "program_parse.y" +#line 1447 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (2)].state)[1]; @@ -3778,20 +3802,20 @@ yyreduce: ;} break; - case 180: + case 181: /* Line 1455 of yacc.c */ -#line 1440 "program_parse.y" +#line 1457 "program_parse.y" { (yyval.state)[2] = 0; (yyval.state)[3] = 3; ;} break; - case 181: + case 182: /* Line 1455 of yacc.c */ -#line 1445 "program_parse.y" +#line 1462 "program_parse.y" { /* It seems logical that the matrix row range specifier would have * to specify a range or more than one row (i.e., $5 > $3). @@ -3809,10 +3833,10 @@ yyreduce: ;} break; - case 182: + case 183: /* Line 1455 of yacc.c */ -#line 1463 "program_parse.y" +#line 1480 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (3)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (3)].state)[1]; @@ -3820,55 +3844,55 @@ yyreduce: ;} break; - case 183: + case 184: /* Line 1455 of yacc.c */ -#line 1471 "program_parse.y" +#line 1488 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 184: + case 185: /* Line 1455 of yacc.c */ -#line 1475 "program_parse.y" +#line 1492 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 185: + case 186: /* Line 1455 of yacc.c */ -#line 1481 "program_parse.y" +#line 1498 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVERSE; ;} break; - case 186: + case 187: /* Line 1455 of yacc.c */ -#line 1485 "program_parse.y" +#line 1502 "program_parse.y" { (yyval.integer) = STATE_MATRIX_TRANSPOSE; ;} break; - case 187: + case 188: /* Line 1455 of yacc.c */ -#line 1489 "program_parse.y" +#line 1506 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVTRANS; ;} break; - case 188: + case 189: /* Line 1455 of yacc.c */ -#line 1495 "program_parse.y" +#line 1512 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) > 3) { yyerror(& (yylsp[(1) - (1)]), state, "invalid matrix row reference"); @@ -3879,88 +3903,88 @@ yyreduce: ;} break; - case 189: + case 190: /* Line 1455 of yacc.c */ -#line 1506 "program_parse.y" +#line 1523 "program_parse.y" { (yyval.state)[0] = STATE_MODELVIEW_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); ;} break; - case 190: + case 191: /* Line 1455 of yacc.c */ -#line 1511 "program_parse.y" +#line 1528 "program_parse.y" { (yyval.state)[0] = STATE_PROJECTION_MATRIX; (yyval.state)[1] = 0; ;} break; - case 191: + case 192: /* Line 1455 of yacc.c */ -#line 1516 "program_parse.y" +#line 1533 "program_parse.y" { (yyval.state)[0] = STATE_MVP_MATRIX; (yyval.state)[1] = 0; ;} break; - case 192: + case 193: /* Line 1455 of yacc.c */ -#line 1521 "program_parse.y" +#line 1538 "program_parse.y" { (yyval.state)[0] = STATE_TEXTURE_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); ;} break; - case 193: + case 194: /* Line 1455 of yacc.c */ -#line 1526 "program_parse.y" +#line 1543 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; ;} break; - case 194: + case 195: /* Line 1455 of yacc.c */ -#line 1531 "program_parse.y" +#line 1548 "program_parse.y" { (yyval.state)[0] = STATE_PROGRAM_MATRIX; (yyval.state)[1] = (yyvsp[(3) - (4)].integer); ;} break; - case 195: + case 196: /* Line 1455 of yacc.c */ -#line 1538 "program_parse.y" +#line 1555 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 196: + case 197: /* Line 1455 of yacc.c */ -#line 1542 "program_parse.y" +#line 1559 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 197: + case 198: /* Line 1455 of yacc.c */ -#line 1547 "program_parse.y" +#line 1564 "program_parse.y" { /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix * zero is valid. @@ -3974,10 +3998,10 @@ yyreduce: ;} break; - case 198: + case 199: /* Line 1455 of yacc.c */ -#line 1560 "program_parse.y" +#line 1577 "program_parse.y" { /* Since GL_ARB_matrix_palette isn't supported, just let any value * through here. The error will be generated later. @@ -3986,10 +4010,10 @@ yyreduce: ;} break; - case 199: + case 200: /* Line 1455 of yacc.c */ -#line 1568 "program_parse.y" +#line 1585 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxProgramMatrices) { yyerror(& (yylsp[(1) - (1)]), state, "invalid program matrix selector"); @@ -4000,20 +4024,20 @@ yyreduce: ;} break; - case 200: + case 201: /* Line 1455 of yacc.c */ -#line 1579 "program_parse.y" +#line 1596 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_DEPTH_RANGE; ;} break; - case 205: + case 206: /* Line 1455 of yacc.c */ -#line 1591 "program_parse.y" +#line 1608 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4023,30 +4047,30 @@ yyreduce: ;} break; - case 206: + case 207: /* Line 1455 of yacc.c */ -#line 1601 "program_parse.y" +#line 1618 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); ;} break; - case 207: + case 208: /* Line 1455 of yacc.c */ -#line 1606 "program_parse.y" +#line 1623 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); ;} break; - case 208: + case 209: /* Line 1455 of yacc.c */ -#line 1613 "program_parse.y" +#line 1630 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4056,10 +4080,10 @@ yyreduce: ;} break; - case 209: + case 210: /* Line 1455 of yacc.c */ -#line 1623 "program_parse.y" +#line 1640 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4069,30 +4093,30 @@ yyreduce: ;} break; - case 210: + case 211: /* Line 1455 of yacc.c */ -#line 1632 "program_parse.y" +#line 1649 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); ;} break; - case 211: + case 212: /* Line 1455 of yacc.c */ -#line 1637 "program_parse.y" +#line 1654 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); ;} break; - case 212: + case 213: /* Line 1455 of yacc.c */ -#line 1644 "program_parse.y" +#line 1661 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4102,10 +4126,10 @@ yyreduce: ;} break; - case 213: + case 214: /* Line 1455 of yacc.c */ -#line 1654 "program_parse.y" +#line 1671 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxEnvParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid environment parameter reference"); @@ -4115,10 +4139,10 @@ yyreduce: ;} break; - case 214: + case 215: /* Line 1455 of yacc.c */ -#line 1664 "program_parse.y" +#line 1681 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxLocalParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid local parameter reference"); @@ -4128,10 +4152,10 @@ yyreduce: ;} break; - case 219: + case 220: /* Line 1455 of yacc.c */ -#line 1679 "program_parse.y" +#line 1696 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -4141,10 +4165,10 @@ yyreduce: ;} break; - case 220: + case 221: /* Line 1455 of yacc.c */ -#line 1689 "program_parse.y" +#line 1706 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -4154,10 +4178,10 @@ yyreduce: ;} break; - case 221: + case 222: /* Line 1455 of yacc.c */ -#line 1697 "program_parse.y" +#line 1714 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (float) (yyvsp[(1) - (1)].integer); @@ -4167,10 +4191,10 @@ yyreduce: ;} break; - case 222: + case 223: /* Line 1455 of yacc.c */ -#line 1707 "program_parse.y" +#line 1724 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (3)].real); @@ -4180,10 +4204,10 @@ yyreduce: ;} break; - case 223: + case 224: /* Line 1455 of yacc.c */ -#line 1715 "program_parse.y" +#line 1732 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (5)].real); @@ -4193,10 +4217,10 @@ yyreduce: ;} break; - case 224: + case 225: /* Line 1455 of yacc.c */ -#line 1724 "program_parse.y" +#line 1741 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (7)].real); @@ -4206,10 +4230,10 @@ yyreduce: ;} break; - case 225: + case 226: /* Line 1455 of yacc.c */ -#line 1733 "program_parse.y" +#line 1750 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (9)].real); @@ -4219,63 +4243,63 @@ yyreduce: ;} break; - case 226: + case 227: /* Line 1455 of yacc.c */ -#line 1743 "program_parse.y" +#line 1760 "program_parse.y" { (yyval.real) = ((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].real) : (yyvsp[(2) - (2)].real); ;} break; - case 227: + case 228: /* Line 1455 of yacc.c */ -#line 1747 "program_parse.y" +#line 1764 "program_parse.y" { (yyval.real) = (float)(((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].integer) : (yyvsp[(2) - (2)].integer)); ;} break; - case 228: + case 229: /* Line 1455 of yacc.c */ -#line 1752 "program_parse.y" +#line 1769 "program_parse.y" { (yyval.negate) = FALSE; ;} break; - case 229: + case 230: /* Line 1455 of yacc.c */ -#line 1753 "program_parse.y" +#line 1770 "program_parse.y" { (yyval.negate) = TRUE; ;} break; - case 230: + case 231: /* Line 1455 of yacc.c */ -#line 1754 "program_parse.y" +#line 1771 "program_parse.y" { (yyval.negate) = FALSE; ;} break; - case 231: + case 232: /* Line 1455 of yacc.c */ -#line 1757 "program_parse.y" +#line 1774 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 233: + case 234: /* Line 1455 of yacc.c */ -#line 1760 "program_parse.y" +#line 1777 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 235: + case 236: /* Line 1455 of yacc.c */ -#line 1764 "program_parse.y" +#line 1781 "program_parse.y" { if (!declare_variable(state, (yyvsp[(3) - (3)].string), (yyvsp[(0) - (3)].integer), & (yylsp[(3) - (3)]))) { YYERROR; @@ -4283,10 +4307,10 @@ yyreduce: ;} break; - case 236: + case 237: /* Line 1455 of yacc.c */ -#line 1770 "program_parse.y" +#line 1787 "program_parse.y" { if (!declare_variable(state, (yyvsp[(1) - (1)].string), (yyvsp[(0) - (1)].integer), & (yylsp[(1) - (1)]))) { YYERROR; @@ -4294,10 +4318,10 @@ yyreduce: ;} break; - case 237: + case 238: /* Line 1455 of yacc.c */ -#line 1778 "program_parse.y" +#line 1795 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_output, & (yylsp[(2) - (4)])); @@ -4310,10 +4334,10 @@ yyreduce: ;} break; - case 238: + case 239: /* Line 1455 of yacc.c */ -#line 1791 "program_parse.y" +#line 1808 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_HPOS; @@ -4324,10 +4348,10 @@ yyreduce: ;} break; - case 239: + case 240: /* Line 1455 of yacc.c */ -#line 1800 "program_parse.y" +#line 1817 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_FOGC; @@ -4338,19 +4362,19 @@ yyreduce: ;} break; - case 240: + case 241: /* Line 1455 of yacc.c */ -#line 1809 "program_parse.y" +#line 1826 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (2)].result); ;} break; - case 241: + case 242: /* Line 1455 of yacc.c */ -#line 1813 "program_parse.y" +#line 1830 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_PSIZ; @@ -4361,10 +4385,10 @@ yyreduce: ;} break; - case 242: + case 243: /* Line 1455 of yacc.c */ -#line 1822 "program_parse.y" +#line 1839 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_TEX0 + (yyvsp[(3) - (3)].integer); @@ -4375,10 +4399,10 @@ yyreduce: ;} break; - case 243: + case 244: /* Line 1455 of yacc.c */ -#line 1831 "program_parse.y" +#line 1848 "program_parse.y" { if (state->mode == ARB_fragment) { (yyval.result) = FRAG_RESULT_DEPTH; @@ -4389,19 +4413,19 @@ yyreduce: ;} break; - case 244: + case 245: /* Line 1455 of yacc.c */ -#line 1842 "program_parse.y" +#line 1859 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (3)].integer) + (yyvsp[(3) - (3)].integer); ;} break; - case 245: + case 246: /* Line 1455 of yacc.c */ -#line 1848 "program_parse.y" +#line 1865 "program_parse.y" { (yyval.integer) = (state->mode == ARB_vertex) ? VERT_RESULT_COL0 @@ -4409,10 +4433,10 @@ yyreduce: ;} break; - case 246: + case 247: /* Line 1455 of yacc.c */ -#line 1854 "program_parse.y" +#line 1871 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_COL0; @@ -4423,10 +4447,10 @@ yyreduce: ;} break; - case 247: + case 248: /* Line 1455 of yacc.c */ -#line 1863 "program_parse.y" +#line 1880 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_BFC0; @@ -4437,19 +4461,19 @@ yyreduce: ;} break; - case 248: + case 249: /* Line 1455 of yacc.c */ -#line 1874 "program_parse.y" +#line 1891 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 249: + case 250: /* Line 1455 of yacc.c */ -#line 1878 "program_parse.y" +#line 1895 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 0; @@ -4460,10 +4484,10 @@ yyreduce: ;} break; - case 250: + case 251: /* Line 1455 of yacc.c */ -#line 1887 "program_parse.y" +#line 1904 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 1; @@ -4474,94 +4498,94 @@ yyreduce: ;} break; - case 251: + case 252: /* Line 1455 of yacc.c */ -#line 1897 "program_parse.y" +#line 1914 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 252: + case 253: /* Line 1455 of yacc.c */ -#line 1898 "program_parse.y" +#line 1915 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 253: + case 254: /* Line 1455 of yacc.c */ -#line 1899 "program_parse.y" +#line 1916 "program_parse.y" { (yyval.integer) = 1; ;} break; - case 254: + case 255: /* Line 1455 of yacc.c */ -#line 1902 "program_parse.y" +#line 1919 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 255: + case 256: /* Line 1455 of yacc.c */ -#line 1903 "program_parse.y" +#line 1920 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 256: + case 257: /* Line 1455 of yacc.c */ -#line 1904 "program_parse.y" +#line 1921 "program_parse.y" { (yyval.integer) = 1; ;} break; - case 257: + case 258: /* Line 1455 of yacc.c */ -#line 1907 "program_parse.y" +#line 1924 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 258: + case 259: /* Line 1455 of yacc.c */ -#line 1908 "program_parse.y" +#line 1925 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 259: + case 260: /* Line 1455 of yacc.c */ -#line 1911 "program_parse.y" +#line 1928 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 260: + case 261: /* Line 1455 of yacc.c */ -#line 1912 "program_parse.y" +#line 1929 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 261: + case 262: /* Line 1455 of yacc.c */ -#line 1915 "program_parse.y" +#line 1932 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 262: + case 263: /* Line 1455 of yacc.c */ -#line 1916 "program_parse.y" +#line 1933 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 263: + case 264: /* Line 1455 of yacc.c */ -#line 1920 "program_parse.y" +#line 1937 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture coordinate unit selector"); @@ -4572,10 +4596,10 @@ yyreduce: ;} break; - case 264: + case 265: /* Line 1455 of yacc.c */ -#line 1931 "program_parse.y" +#line 1948 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture image unit selector"); @@ -4586,10 +4610,10 @@ yyreduce: ;} break; - case 265: + case 266: /* Line 1455 of yacc.c */ -#line 1942 "program_parse.y" +#line 1959 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture unit selector"); @@ -4600,10 +4624,10 @@ yyreduce: ;} break; - case 266: + case 267: /* Line 1455 of yacc.c */ -#line 1953 "program_parse.y" +#line 1970 "program_parse.y" { struct asm_symbol *exist = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(2) - (4)].string)); @@ -4627,7 +4651,7 @@ yyreduce: /* Line 1455 of yacc.c */ -#line 4631 "program_parse.tab.c" +#line 4655 "program_parse.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -4846,7 +4870,7 @@ yyreturn: /* Line 1675 of yacc.c */ -#line 1973 "program_parse.y" +#line 1990 "program_parse.y" struct asm_instruction * diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 4cd459a096..fa94f763c4 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -534,6 +534,23 @@ scalarSrcReg: optionalSign srcReg scalarSuffix $$.Base.Swizzle = _mesa_combine_swizzles($$.Base.Swizzle, $3.swizzle); } + | optionalSign paramConstScalarUse + { + struct asm_symbol temp_sym; + + if (!state->option.NV_fragment) { + yyerror(& @2, state, "expected scalar suffix"); + YYERROR; + } + + memset(& temp_sym, 0, sizeof(temp_sym)); + temp_sym.param_binding_begin = ~0; + initialize_symbol_from_const(state->prog, & temp_sym, & $2); + + init_src_reg(& $$); + $$.Base.File = PROGRAM_CONSTANT; + $$.Base.Index = temp_sym.param_binding_begin; + } ; swizzleSrcReg: optionalSign srcReg swizzleSuffix -- cgit v1.2.3 From 5db8ebb8f534907614247afaf1dd8621b2d0462e Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 3 Sep 2009 14:06:42 -0700 Subject: Enable GL_NV_fragment_program_option for software rendering At this point the extension is not fully implemented. --- src/mesa/drivers/dri/swrast/swrast.c | 1 + src/mesa/main/extensions.c | 3 +++ 2 files changed, 4 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index 3aa7843b1b..d8de5cca80 100644 --- a/src/mesa/drivers/dri/swrast/swrast.c +++ b/src/mesa/drivers/dri/swrast/swrast.c @@ -109,6 +109,7 @@ const struct dri_extension card_extensions[] = { "GL_MESA_resize_buffers", GL_MESA_resize_buffers_functions }, { "GL_NV_vertex_program", GL_NV_vertex_program_functions }, { "GL_NV_fragment_program", GL_NV_fragment_program_functions }, + { "GL_NV_fragment_program_option", NULL }, { NULL, NULL } }; diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 903da99ed0..c6f5068685 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -305,6 +305,9 @@ _mesa_enable_sw_extensions(GLcontext *ctx) #endif #if FEATURE_NV_fragment_program ctx->Extensions.NV_fragment_program = GL_TRUE; +#endif +#if FEATURE_NV_fragment_program && FEATURE_ARB_fragment_program + ctx->Extensions.NV_fragment_program_option = GL_TRUE; #endif ctx->Extensions.SGI_color_matrix = GL_TRUE; ctx->Extensions.SGI_color_table = GL_TRUE; -- cgit v1.2.3 From eeb1402c0514248773e66f2077b0fb52f7245d56 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 3 Sep 2009 14:32:48 -0700 Subject: NV fp parser: Add support for absolute value operator on instruction operands --- src/mesa/shader/program_parse.tab.c | 1731 ++++++++++++++++++----------------- src/mesa/shader/program_parse.y | 51 +- 2 files changed, 942 insertions(+), 840 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 508ac617e4..505a1eb94f 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -588,16 +588,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 5 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 351 +#define YYLAST 375 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 116 +#define YYNTOKENS 117 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 135 +#define YYNNTS 136 /* YYNRULES -- Number of rules. */ -#define YYNRULES 267 +#define YYNRULES 270 /* YYNRULES -- Number of states. */ -#define YYNSTATES 448 +#define YYNSTATES 456 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 @@ -613,15 +613,15 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 111, 108, 112, 2, 2, 2, 2, + 2, 2, 2, 112, 108, 113, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 107, - 2, 113, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 114, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 109, 2, 110, 2, 2, 2, 2, 2, 2, + 2, 110, 2, 111, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 114, 2, 115, 2, 2, 2, 2, + 2, 2, 2, 115, 109, 116, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -657,110 +657,112 @@ static const yytype_uint16 yyprhs[] = 24, 27, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 59, 64, 69, 76, 83, 92, 101, 104, 117, 120, 122, 124, 126, 128, 130, - 132, 134, 136, 138, 140, 142, 144, 151, 155, 158, - 162, 165, 168, 176, 179, 181, 183, 185, 187, 192, - 194, 196, 198, 200, 202, 204, 206, 210, 211, 214, - 217, 219, 221, 223, 225, 227, 229, 231, 233, 235, - 236, 238, 240, 242, 244, 245, 247, 249, 251, 253, - 255, 257, 262, 265, 268, 270, 273, 275, 278, 280, - 283, 288, 293, 295, 296, 300, 302, 304, 307, 309, - 312, 314, 316, 320, 327, 328, 330, 333, 338, 340, - 344, 346, 348, 350, 352, 354, 356, 358, 360, 362, - 364, 367, 370, 373, 376, 379, 382, 385, 388, 391, - 394, 397, 400, 404, 406, 408, 410, 416, 418, 420, - 422, 425, 427, 429, 432, 434, 437, 444, 446, 450, - 452, 454, 456, 458, 460, 465, 467, 469, 471, 473, - 475, 477, 480, 482, 484, 490, 492, 495, 497, 499, - 505, 508, 509, 516, 520, 521, 523, 525, 527, 529, - 531, 534, 536, 538, 541, 546, 551, 552, 554, 556, - 558, 560, 563, 565, 567, 569, 571, 577, 579, 583, - 589, 595, 597, 601, 607, 609, 611, 613, 615, 617, - 619, 621, 623, 625, 629, 635, 643, 653, 656, 659, - 661, 663, 664, 665, 669, 670, 674, 678, 680, 685, - 688, 691, 694, 697, 701, 704, 708, 709, 711, 713, - 714, 716, 718, 719, 721, 723, 724, 726, 728, 729, - 733, 734, 738, 739, 743, 745, 747, 749 + 132, 134, 136, 138, 140, 142, 144, 151, 154, 159, + 162, 164, 168, 174, 177, 180, 188, 191, 193, 195, + 197, 199, 204, 206, 208, 210, 212, 214, 216, 218, + 222, 223, 226, 229, 231, 233, 235, 237, 239, 241, + 243, 245, 247, 248, 250, 252, 254, 256, 257, 259, + 261, 263, 265, 267, 269, 274, 277, 280, 282, 285, + 287, 290, 292, 295, 300, 305, 307, 308, 312, 314, + 316, 319, 321, 324, 326, 328, 332, 339, 340, 342, + 345, 350, 352, 356, 358, 360, 362, 364, 366, 368, + 370, 372, 374, 376, 379, 382, 385, 388, 391, 394, + 397, 400, 403, 406, 409, 412, 416, 418, 420, 422, + 428, 430, 432, 434, 437, 439, 441, 444, 446, 449, + 456, 458, 462, 464, 466, 468, 470, 472, 477, 479, + 481, 483, 485, 487, 489, 492, 494, 496, 502, 504, + 507, 509, 511, 517, 520, 521, 528, 532, 533, 535, + 537, 539, 541, 543, 546, 548, 550, 553, 558, 563, + 564, 566, 568, 570, 572, 575, 577, 579, 581, 583, + 589, 591, 595, 601, 607, 609, 613, 619, 621, 623, + 625, 627, 629, 631, 633, 635, 637, 641, 647, 655, + 665, 668, 671, 673, 675, 676, 677, 681, 682, 686, + 690, 692, 697, 700, 703, 706, 709, 713, 716, 720, + 721, 723, 725, 726, 728, 730, 731, 733, 735, 736, + 738, 740, 741, 745, 746, 750, 751, 755, 757, 759, + 761 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int16 yyrhs[] = { - 117, 0, -1, 118, 119, 121, 12, -1, 3, -1, - 4, -1, 119, 120, -1, -1, 8, 99, 107, -1, - 121, 122, -1, -1, 123, 107, -1, 160, 107, -1, - 124, -1, 125, -1, 126, -1, 127, -1, 128, -1, - 129, -1, 130, -1, 131, -1, 137, -1, 132, -1, - 133, -1, 134, -1, 19, 141, 108, 138, -1, 18, - 140, 108, 139, -1, 16, 140, 108, 138, -1, 14, - 140, 108, 138, 108, 138, -1, 13, 140, 108, 139, - 108, 139, -1, 17, 140, 108, 139, 108, 139, 108, - 139, -1, 15, 140, 108, 139, 108, 135, 108, 136, - -1, 20, 139, -1, 22, 140, 108, 139, 108, 139, - 108, 139, 108, 135, 108, 136, -1, 83, 245, -1, + 118, 0, -1, 119, 120, 122, 12, -1, 3, -1, + 4, -1, 120, 121, -1, -1, 8, 99, 107, -1, + 122, 123, -1, -1, 124, 107, -1, 162, 107, -1, + 125, -1, 126, -1, 127, -1, 128, -1, 129, -1, + 130, -1, 131, -1, 132, -1, 138, -1, 133, -1, + 134, -1, 135, -1, 19, 143, 108, 139, -1, 18, + 142, 108, 141, -1, 16, 142, 108, 139, -1, 14, + 142, 108, 139, 108, 139, -1, 13, 142, 108, 141, + 108, 141, -1, 17, 142, 108, 141, 108, 141, 108, + 141, -1, 15, 142, 108, 141, 108, 136, 108, 137, + -1, 20, 141, -1, 22, 142, 108, 141, 108, 141, + 108, 141, 108, 136, 108, 137, -1, 83, 247, -1, 84, -1, 85, -1, 86, -1, 87, -1, 88, -1, 89, -1, 90, -1, 91, -1, 92, -1, 93, -1, - 94, -1, 95, -1, 21, 140, 108, 145, 108, 142, - -1, 231, 145, 157, -1, 231, 228, -1, 231, 145, - 158, -1, 146, 159, -1, 154, 156, -1, 143, 108, - 143, 108, 143, 108, 143, -1, 231, 144, -1, 23, - -1, 99, -1, 99, -1, 162, -1, 147, 109, 148, - 110, -1, 176, -1, 238, -1, 99, -1, 99, -1, - 149, -1, 150, -1, 23, -1, 154, 155, 151, -1, - -1, 111, 152, -1, 112, 153, -1, 23, -1, 23, - -1, 99, -1, 103, -1, 103, -1, 103, -1, 103, - -1, 100, -1, 104, -1, -1, 100, -1, 101, -1, - 102, -1, 103, -1, -1, 161, -1, 168, -1, 232, - -1, 234, -1, 237, -1, 250, -1, 7, 99, 113, - 162, -1, 96, 163, -1, 38, 167, -1, 60, -1, - 98, 165, -1, 53, -1, 29, 243, -1, 37, -1, - 74, 244, -1, 50, 109, 166, 110, -1, 97, 109, - 164, 110, -1, 23, -1, -1, 109, 166, 110, -1, - 23, -1, 60, -1, 29, 243, -1, 37, -1, 74, - 244, -1, 169, -1, 170, -1, 10, 99, 172, -1, - 10, 99, 109, 171, 110, 173, -1, -1, 23, -1, - 113, 175, -1, 113, 114, 174, 115, -1, 177, -1, - 174, 108, 177, -1, 179, -1, 215, -1, 225, -1, - 179, -1, 215, -1, 226, -1, 178, -1, 216, -1, - 225, -1, 179, -1, 73, 203, -1, 73, 180, -1, - 73, 182, -1, 73, 185, -1, 73, 187, -1, 73, - 193, -1, 73, 189, -1, 73, 196, -1, 73, 198, - -1, 73, 200, -1, 73, 202, -1, 73, 214, -1, - 47, 242, 181, -1, 191, -1, 33, -1, 69, -1, - 43, 109, 192, 110, 183, -1, 191, -1, 60, -1, - 26, -1, 72, 184, -1, 40, -1, 32, -1, 44, - 186, -1, 25, -1, 242, 67, -1, 45, 109, 192, - 110, 242, 188, -1, 191, -1, 75, 246, 190, -1, - 29, -1, 25, -1, 31, -1, 71, -1, 23, -1, - 76, 244, 194, 195, -1, 35, -1, 54, -1, 79, - -1, 80, -1, 78, -1, 77, -1, 36, 197, -1, - 29, -1, 56, -1, 28, 109, 199, 110, 57, -1, - 23, -1, 58, 201, -1, 70, -1, 26, -1, 205, - 66, 109, 208, 110, -1, 205, 204, -1, -1, 66, - 109, 208, 105, 208, 110, -1, 49, 209, 206, -1, - -1, 207, -1, 41, -1, 82, -1, 42, -1, 23, - -1, 51, 210, -1, 63, -1, 52, -1, 81, 244, - -1, 55, 109, 212, 110, -1, 48, 109, 213, 110, - -1, -1, 211, -1, 23, -1, 23, -1, 23, -1, - 30, 64, -1, 219, -1, 222, -1, 217, -1, 220, - -1, 62, 34, 109, 218, 110, -1, 223, -1, 223, - 105, 223, -1, 62, 34, 109, 223, 110, -1, 62, - 46, 109, 221, 110, -1, 224, -1, 224, 105, 224, - -1, 62, 46, 109, 224, 110, -1, 23, -1, 23, - -1, 227, -1, 229, -1, 228, -1, 229, -1, 230, - -1, 24, -1, 23, -1, 114, 230, 115, -1, 114, - 230, 108, 230, 115, -1, 114, 230, 108, 230, 108, - 230, 115, -1, 114, 230, 108, 230, 108, 230, 108, - 230, 115, -1, 231, 24, -1, 231, 23, -1, 111, - -1, 112, -1, -1, -1, 11, 233, 236, -1, -1, - 5, 235, 236, -1, 236, 108, 99, -1, 99, -1, - 9, 99, 113, 238, -1, 65, 60, -1, 65, 37, - -1, 65, 239, -1, 65, 59, -1, 65, 74, 244, - -1, 65, 30, -1, 29, 240, 241, -1, -1, 39, - -1, 27, -1, -1, 61, -1, 68, -1, -1, 39, - -1, 27, -1, -1, 61, -1, 68, -1, -1, 109, - 247, 110, -1, -1, 109, 248, 110, -1, -1, 109, - 249, 110, -1, 23, -1, 23, -1, 23, -1, 6, - 99, 113, 99, -1 + 94, -1, 95, -1, 21, 142, 108, 147, 108, 144, + -1, 233, 140, -1, 233, 109, 140, 109, -1, 147, + 159, -1, 230, -1, 233, 147, 160, -1, 233, 109, + 147, 160, 109, -1, 148, 161, -1, 156, 158, -1, + 145, 108, 145, 108, 145, 108, 145, -1, 233, 146, + -1, 23, -1, 99, -1, 99, -1, 164, -1, 149, + 110, 150, 111, -1, 178, -1, 240, -1, 99, -1, + 99, -1, 151, -1, 152, -1, 23, -1, 156, 157, + 153, -1, -1, 112, 154, -1, 113, 155, -1, 23, + -1, 23, -1, 99, -1, 103, -1, 103, -1, 103, + -1, 103, -1, 100, -1, 104, -1, -1, 100, -1, + 101, -1, 102, -1, 103, -1, -1, 163, -1, 170, + -1, 234, -1, 236, -1, 239, -1, 252, -1, 7, + 99, 114, 164, -1, 96, 165, -1, 38, 169, -1, + 60, -1, 98, 167, -1, 53, -1, 29, 245, -1, + 37, -1, 74, 246, -1, 50, 110, 168, 111, -1, + 97, 110, 166, 111, -1, 23, -1, -1, 110, 168, + 111, -1, 23, -1, 60, -1, 29, 245, -1, 37, + -1, 74, 246, -1, 171, -1, 172, -1, 10, 99, + 174, -1, 10, 99, 110, 173, 111, 175, -1, -1, + 23, -1, 114, 177, -1, 114, 115, 176, 116, -1, + 179, -1, 176, 108, 179, -1, 181, -1, 217, -1, + 227, -1, 181, -1, 217, -1, 228, -1, 180, -1, + 218, -1, 227, -1, 181, -1, 73, 205, -1, 73, + 182, -1, 73, 184, -1, 73, 187, -1, 73, 189, + -1, 73, 195, -1, 73, 191, -1, 73, 198, -1, + 73, 200, -1, 73, 202, -1, 73, 204, -1, 73, + 216, -1, 47, 244, 183, -1, 193, -1, 33, -1, + 69, -1, 43, 110, 194, 111, 185, -1, 193, -1, + 60, -1, 26, -1, 72, 186, -1, 40, -1, 32, + -1, 44, 188, -1, 25, -1, 244, 67, -1, 45, + 110, 194, 111, 244, 190, -1, 193, -1, 75, 248, + 192, -1, 29, -1, 25, -1, 31, -1, 71, -1, + 23, -1, 76, 246, 196, 197, -1, 35, -1, 54, + -1, 79, -1, 80, -1, 78, -1, 77, -1, 36, + 199, -1, 29, -1, 56, -1, 28, 110, 201, 111, + 57, -1, 23, -1, 58, 203, -1, 70, -1, 26, + -1, 207, 66, 110, 210, 111, -1, 207, 206, -1, + -1, 66, 110, 210, 105, 210, 111, -1, 49, 211, + 208, -1, -1, 209, -1, 41, -1, 82, -1, 42, + -1, 23, -1, 51, 212, -1, 63, -1, 52, -1, + 81, 246, -1, 55, 110, 214, 111, -1, 48, 110, + 215, 111, -1, -1, 213, -1, 23, -1, 23, -1, + 23, -1, 30, 64, -1, 221, -1, 224, -1, 219, + -1, 222, -1, 62, 34, 110, 220, 111, -1, 225, + -1, 225, 105, 225, -1, 62, 34, 110, 225, 111, + -1, 62, 46, 110, 223, 111, -1, 226, -1, 226, + 105, 226, -1, 62, 46, 110, 226, 111, -1, 23, + -1, 23, -1, 229, -1, 231, -1, 230, -1, 231, + -1, 232, -1, 24, -1, 23, -1, 115, 232, 116, + -1, 115, 232, 108, 232, 116, -1, 115, 232, 108, + 232, 108, 232, 116, -1, 115, 232, 108, 232, 108, + 232, 108, 232, 116, -1, 233, 24, -1, 233, 23, + -1, 112, -1, 113, -1, -1, -1, 11, 235, 238, + -1, -1, 5, 237, 238, -1, 238, 108, 99, -1, + 99, -1, 9, 99, 114, 240, -1, 65, 60, -1, + 65, 37, -1, 65, 241, -1, 65, 59, -1, 65, + 74, 246, -1, 65, 30, -1, 29, 242, 243, -1, + -1, 39, -1, 27, -1, -1, 61, -1, 68, -1, + -1, 39, -1, 27, -1, -1, 61, -1, 68, -1, + -1, 110, 249, 111, -1, -1, 110, 250, 111, -1, + -1, 110, 251, 111, -1, 23, -1, 23, -1, 23, + -1, 6, 99, 114, 99, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ @@ -770,29 +772,30 @@ static const yytype_uint16 yyrline[] = 309, 324, 327, 332, 339, 340, 341, 342, 343, 344, 345, 348, 349, 350, 353, 359, 366, 373, 381, 388, 396, 441, 448, 493, 499, 500, 501, 502, 503, 504, - 505, 506, 507, 508, 509, 510, 513, 526, 537, 556, - 569, 591, 600, 633, 640, 655, 705, 747, 758, 779, - 789, 795, 826, 843, 843, 845, 852, 864, 865, 866, - 869, 881, 893, 911, 922, 934, 936, 937, 938, 939, - 942, 942, 942, 942, 943, 946, 947, 948, 949, 950, - 951, 954, 972, 976, 982, 986, 990, 994, 1003, 1012, - 1016, 1021, 1027, 1038, 1038, 1039, 1041, 1045, 1049, 1053, - 1059, 1059, 1061, 1077, 1100, 1103, 1114, 1120, 1126, 1127, - 1134, 1140, 1146, 1154, 1160, 1166, 1174, 1180, 1186, 1194, - 1195, 1198, 1199, 1200, 1201, 1202, 1203, 1204, 1205, 1206, - 1207, 1208, 1211, 1220, 1224, 1228, 1234, 1243, 1247, 1251, - 1260, 1264, 1270, 1276, 1283, 1288, 1296, 1306, 1308, 1316, - 1322, 1326, 1330, 1336, 1347, 1356, 1360, 1365, 1369, 1373, - 1377, 1383, 1390, 1394, 1400, 1408, 1419, 1426, 1430, 1436, - 1446, 1457, 1461, 1479, 1488, 1491, 1497, 1501, 1505, 1511, - 1522, 1527, 1532, 1537, 1542, 1547, 1555, 1558, 1563, 1576, - 1584, 1595, 1603, 1603, 1605, 1605, 1607, 1617, 1622, 1629, - 1639, 1648, 1653, 1660, 1670, 1680, 1692, 1692, 1693, 1693, - 1695, 1705, 1713, 1723, 1731, 1739, 1748, 1759, 1763, 1769, - 1770, 1771, 1774, 1774, 1777, 1777, 1780, 1786, 1794, 1807, - 1816, 1825, 1829, 1838, 1847, 1858, 1865, 1870, 1879, 1891, - 1894, 1903, 1914, 1915, 1916, 1919, 1920, 1921, 1924, 1925, - 1928, 1929, 1932, 1933, 1936, 1947, 1958, 1969 + 505, 506, 507, 508, 509, 510, 513, 526, 534, 551, + 558, 577, 588, 608, 630, 639, 672, 679, 694, 744, + 786, 797, 818, 828, 834, 865, 882, 882, 884, 891, + 903, 904, 905, 908, 920, 932, 950, 961, 973, 975, + 976, 977, 978, 981, 981, 981, 981, 982, 985, 986, + 987, 988, 989, 990, 993, 1011, 1015, 1021, 1025, 1029, + 1033, 1042, 1051, 1055, 1060, 1066, 1077, 1077, 1078, 1080, + 1084, 1088, 1092, 1098, 1098, 1100, 1116, 1139, 1142, 1153, + 1159, 1165, 1166, 1173, 1179, 1185, 1193, 1199, 1205, 1213, + 1219, 1225, 1233, 1234, 1237, 1238, 1239, 1240, 1241, 1242, + 1243, 1244, 1245, 1246, 1247, 1250, 1259, 1263, 1267, 1273, + 1282, 1286, 1290, 1299, 1303, 1309, 1315, 1322, 1327, 1335, + 1345, 1347, 1355, 1361, 1365, 1369, 1375, 1386, 1395, 1399, + 1404, 1408, 1412, 1416, 1422, 1429, 1433, 1439, 1447, 1458, + 1465, 1469, 1475, 1485, 1496, 1500, 1518, 1527, 1530, 1536, + 1540, 1544, 1550, 1561, 1566, 1571, 1576, 1581, 1586, 1594, + 1597, 1602, 1615, 1623, 1634, 1642, 1642, 1644, 1644, 1646, + 1656, 1661, 1668, 1678, 1687, 1692, 1699, 1709, 1719, 1731, + 1731, 1732, 1732, 1734, 1744, 1752, 1762, 1770, 1778, 1787, + 1798, 1802, 1808, 1809, 1810, 1813, 1813, 1816, 1816, 1819, + 1825, 1833, 1846, 1855, 1864, 1868, 1877, 1886, 1897, 1904, + 1909, 1918, 1930, 1933, 1942, 1953, 1954, 1955, 1958, 1959, + 1960, 1963, 1964, 1967, 1968, 1971, 1972, 1975, 1986, 1997, + 2008 }; #endif @@ -818,45 +821,45 @@ static const char *const yytname[] = "TEX_SHADOW2D", "TEX_SHADOWRECT", "TEX_ARRAY1D", "TEX_ARRAY2D", "TEX_ARRAYSHADOW1D", "TEX_ARRAYSHADOW2D", "VERTEX", "VTXATTRIB", "WEIGHT", "IDENTIFIER", "MASK4", "MASK3", "MASK2", "MASK1", "SWIZZLE", - "DOT_DOT", "DOT", "';'", "','", "'['", "']'", "'+'", "'-'", "'='", "'{'", - "'}'", "$accept", "program", "language", "optionSequence", "option", - "statementSequence", "statement", "instruction", "ALU_instruction", - "TexInstruction", "ARL_instruction", "VECTORop_instruction", - "SCALARop_instruction", "BINSCop_instruction", "BINop_instruction", - "TRIop_instruction", "SAMPLE_instruction", "KIL_instruction", - "TXD_instruction", "texImageUnit", "texTarget", "SWZ_instruction", - "scalarSrcReg", "swizzleSrcReg", "maskedDstReg", "maskedAddrReg", - "extendedSwizzle", "extSwizComp", "extSwizSel", "srcReg", "dstReg", - "progParamArray", "progParamArrayMem", "progParamArrayAbs", - "progParamArrayRel", "addrRegRelOffset", "addrRegPosOffset", - "addrRegNegOffset", "addrReg", "addrComponent", "addrWriteMask", - "scalarSuffix", "swizzleSuffix", "optionalMask", "namingStatement", - "ATTRIB_statement", "attribBinding", "vtxAttribItem", "vtxAttribNum", - "vtxOptWeightNum", "vtxWeightNum", "fragAttribItem", "PARAM_statement", - "PARAM_singleStmt", "PARAM_multipleStmt", "optArraySize", - "paramSingleInit", "paramMultipleInit", "paramMultInitList", - "paramSingleItemDecl", "paramSingleItemUse", "paramMultipleItem", - "stateMultipleItem", "stateSingleItem", "stateMaterialItem", - "stateMatProperty", "stateLightItem", "stateLightProperty", - "stateSpotProperty", "stateLightModelItem", "stateLModProperty", - "stateLightProdItem", "stateLProdProperty", "stateTexEnvItem", - "stateTexEnvProperty", "ambDiffSpecProperty", "stateLightNumber", - "stateTexGenItem", "stateTexGenType", "stateTexGenCoord", "stateFogItem", - "stateFogProperty", "stateClipPlaneItem", "stateClipPlaneNum", - "statePointItem", "statePointProperty", "stateMatrixRow", - "stateMatrixRows", "optMatrixRows", "stateMatrixItem", - "stateOptMatModifier", "stateMatModifier", "stateMatrixRowNum", - "stateMatrixName", "stateOptModMatNum", "stateModMatNum", - "statePaletteMatNum", "stateProgramMatNum", "stateDepthItem", - "programSingleItem", "programMultipleItem", "progEnvParams", - "progEnvParamNums", "progEnvParam", "progLocalParams", - "progLocalParamNums", "progLocalParam", "progEnvParamNum", - "progLocalParamNum", "paramConstDecl", "paramConstUse", - "paramConstScalarDecl", "paramConstScalarUse", "paramConstVector", - "signedFloatConstant", "optionalSign", "TEMP_statement", "@1", - "ADDRESS_statement", "@2", "varNameList", "OUTPUT_statement", - "resultBinding", "resultColBinding", "optResultFaceType", - "optResultColorType", "optFaceType", "optColorType", + "DOT_DOT", "DOT", "';'", "','", "'|'", "'['", "']'", "'+'", "'-'", "'='", + "'{'", "'}'", "$accept", "program", "language", "optionSequence", + "option", "statementSequence", "statement", "instruction", + "ALU_instruction", "TexInstruction", "ARL_instruction", + "VECTORop_instruction", "SCALARop_instruction", "BINSCop_instruction", + "BINop_instruction", "TRIop_instruction", "SAMPLE_instruction", + "KIL_instruction", "TXD_instruction", "texImageUnit", "texTarget", + "SWZ_instruction", "scalarSrcReg", "scalarUse", "swizzleSrcReg", + "maskedDstReg", "maskedAddrReg", "extendedSwizzle", "extSwizComp", + "extSwizSel", "srcReg", "dstReg", "progParamArray", "progParamArrayMem", + "progParamArrayAbs", "progParamArrayRel", "addrRegRelOffset", + "addrRegPosOffset", "addrRegNegOffset", "addrReg", "addrComponent", + "addrWriteMask", "scalarSuffix", "swizzleSuffix", "optionalMask", + "namingStatement", "ATTRIB_statement", "attribBinding", "vtxAttribItem", + "vtxAttribNum", "vtxOptWeightNum", "vtxWeightNum", "fragAttribItem", + "PARAM_statement", "PARAM_singleStmt", "PARAM_multipleStmt", + "optArraySize", "paramSingleInit", "paramMultipleInit", + "paramMultInitList", "paramSingleItemDecl", "paramSingleItemUse", + "paramMultipleItem", "stateMultipleItem", "stateSingleItem", + "stateMaterialItem", "stateMatProperty", "stateLightItem", + "stateLightProperty", "stateSpotProperty", "stateLightModelItem", + "stateLModProperty", "stateLightProdItem", "stateLProdProperty", + "stateTexEnvItem", "stateTexEnvProperty", "ambDiffSpecProperty", + "stateLightNumber", "stateTexGenItem", "stateTexGenType", + "stateTexGenCoord", "stateFogItem", "stateFogProperty", + "stateClipPlaneItem", "stateClipPlaneNum", "statePointItem", + "statePointProperty", "stateMatrixRow", "stateMatrixRows", + "optMatrixRows", "stateMatrixItem", "stateOptMatModifier", + "stateMatModifier", "stateMatrixRowNum", "stateMatrixName", + "stateOptModMatNum", "stateModMatNum", "statePaletteMatNum", + "stateProgramMatNum", "stateDepthItem", "programSingleItem", + "programMultipleItem", "progEnvParams", "progEnvParamNums", + "progEnvParam", "progLocalParams", "progLocalParamNums", + "progLocalParam", "progEnvParamNum", "progLocalParamNum", + "paramConstDecl", "paramConstUse", "paramConstScalarDecl", + "paramConstScalarUse", "paramConstVector", "signedFloatConstant", + "optionalSign", "TEMP_statement", "@1", "ADDRESS_statement", "@2", + "varNameList", "OUTPUT_statement", "resultBinding", "resultColBinding", + "optResultFaceType", "optResultColorType", "optFaceType", "optColorType", "optTexCoordUnitNum", "optTexImageUnitNum", "optLegacyTexUnitNum", "texCoordUnitNum", "texImageUnitNum", "legacyTexUnitNum", "ALIAS_statement", 0 @@ -878,41 +881,42 @@ static const yytype_uint16 yytoknum[] = 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 59, 44, 91, - 93, 43, 45, 61, 123, 125 + 355, 356, 357, 358, 359, 360, 361, 59, 44, 124, + 91, 93, 43, 45, 61, 123, 125 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 116, 117, 118, 118, 119, 119, 120, 121, 121, - 122, 122, 123, 123, 124, 124, 124, 124, 124, 124, - 124, 125, 125, 125, 126, 127, 128, 129, 130, 131, - 132, 133, 134, 135, 136, 136, 136, 136, 136, 136, - 136, 136, 136, 136, 136, 136, 137, 138, 138, 139, - 140, 141, 142, 143, 144, 144, 145, 145, 145, 145, - 146, 146, 147, 148, 148, 149, 150, 151, 151, 151, - 152, 153, 154, 155, 156, 157, 158, 158, 158, 158, - 159, 159, 159, 159, 159, 160, 160, 160, 160, 160, - 160, 161, 162, 162, 163, 163, 163, 163, 163, 163, - 163, 163, 164, 165, 165, 166, 167, 167, 167, 167, - 168, 168, 169, 170, 171, 171, 172, 173, 174, 174, - 175, 175, 175, 176, 176, 176, 177, 177, 177, 178, - 178, 179, 179, 179, 179, 179, 179, 179, 179, 179, - 179, 179, 180, 181, 181, 181, 182, 183, 183, 183, - 183, 183, 184, 185, 186, 186, 187, 188, 189, 190, - 191, 191, 191, 192, 193, 194, 194, 195, 195, 195, - 195, 196, 197, 197, 198, 199, 200, 201, 201, 202, - 203, 204, 204, 205, 206, 206, 207, 207, 207, 208, - 209, 209, 209, 209, 209, 209, 210, 210, 211, 212, - 213, 214, 215, 215, 216, 216, 217, 218, 218, 219, - 220, 221, 221, 222, 223, 224, 225, 225, 226, 226, - 227, 228, 228, 229, 229, 229, 229, 230, 230, 231, - 231, 231, 233, 232, 235, 234, 236, 236, 237, 238, - 238, 238, 238, 238, 238, 239, 240, 240, 240, 241, - 241, 241, 242, 242, 242, 243, 243, 243, 244, 244, - 245, 245, 246, 246, 247, 248, 249, 250 + 0, 117, 118, 119, 119, 120, 120, 121, 122, 122, + 123, 123, 124, 124, 125, 125, 125, 125, 125, 125, + 125, 126, 126, 126, 127, 128, 129, 130, 131, 132, + 133, 134, 135, 136, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 138, 139, 139, 140, + 140, 141, 141, 142, 143, 144, 145, 146, 146, 147, + 147, 147, 147, 148, 148, 149, 150, 150, 151, 152, + 153, 153, 153, 154, 155, 156, 157, 158, 159, 160, + 160, 160, 160, 161, 161, 161, 161, 161, 162, 162, + 162, 162, 162, 162, 163, 164, 164, 165, 165, 165, + 165, 165, 165, 165, 165, 166, 167, 167, 168, 169, + 169, 169, 169, 170, 170, 171, 172, 173, 173, 174, + 175, 176, 176, 177, 177, 177, 178, 178, 178, 179, + 179, 179, 180, 180, 181, 181, 181, 181, 181, 181, + 181, 181, 181, 181, 181, 182, 183, 183, 183, 184, + 185, 185, 185, 185, 185, 186, 187, 188, 188, 189, + 190, 191, 192, 193, 193, 193, 194, 195, 196, 196, + 197, 197, 197, 197, 198, 199, 199, 200, 201, 202, + 203, 203, 204, 205, 206, 206, 207, 208, 208, 209, + 209, 209, 210, 211, 211, 211, 211, 211, 211, 212, + 212, 213, 214, 215, 216, 217, 217, 218, 218, 219, + 220, 220, 221, 222, 223, 223, 224, 225, 226, 227, + 227, 228, 228, 229, 230, 230, 231, 231, 231, 231, + 232, 232, 233, 233, 233, 235, 234, 237, 236, 238, + 238, 239, 240, 240, 240, 240, 240, 240, 241, 242, + 242, 242, 243, 243, 243, 244, 244, 244, 245, 245, + 245, 246, 246, 247, 247, 248, 248, 249, 250, 251, + 252 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -922,29 +926,30 @@ static const yytype_uint8 yyr2[] = 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 6, 6, 8, 8, 2, 12, 2, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 6, 3, 2, 3, - 2, 2, 7, 2, 1, 1, 1, 1, 4, 1, - 1, 1, 1, 1, 1, 1, 3, 0, 2, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, - 1, 4, 2, 2, 1, 2, 1, 2, 1, 2, - 4, 4, 1, 0, 3, 1, 1, 2, 1, 2, - 1, 1, 3, 6, 0, 1, 2, 4, 1, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 3, 1, 1, 1, 5, 1, 1, 1, - 2, 1, 1, 2, 1, 2, 6, 1, 3, 1, - 1, 1, 1, 1, 4, 1, 1, 1, 1, 1, - 1, 2, 1, 1, 5, 1, 2, 1, 1, 5, - 2, 0, 6, 3, 0, 1, 1, 1, 1, 1, - 2, 1, 1, 2, 4, 4, 0, 1, 1, 1, - 1, 2, 1, 1, 1, 1, 5, 1, 3, 5, - 5, 1, 3, 5, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 3, 5, 7, 9, 2, 2, 1, - 1, 0, 0, 3, 0, 3, 3, 1, 4, 2, - 2, 2, 2, 3, 2, 3, 0, 1, 1, 0, - 1, 1, 0, 1, 1, 0, 1, 1, 0, 3, - 0, 3, 0, 3, 1, 1, 1, 4 + 1, 1, 1, 1, 1, 1, 6, 2, 4, 2, + 1, 3, 5, 2, 2, 7, 2, 1, 1, 1, + 1, 4, 1, 1, 1, 1, 1, 1, 1, 3, + 0, 2, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, + 1, 1, 1, 1, 4, 2, 2, 1, 2, 1, + 2, 1, 2, 4, 4, 1, 0, 3, 1, 1, + 2, 1, 2, 1, 1, 3, 6, 0, 1, 2, + 4, 1, 3, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 3, 1, 1, 1, 5, + 1, 1, 1, 2, 1, 1, 2, 1, 2, 6, + 1, 3, 1, 1, 1, 1, 1, 4, 1, 1, + 1, 1, 1, 1, 2, 1, 1, 5, 1, 2, + 1, 1, 5, 2, 0, 6, 3, 0, 1, 1, + 1, 1, 1, 2, 1, 1, 2, 4, 4, 0, + 1, 1, 1, 1, 2, 1, 1, 1, 1, 5, + 1, 3, 5, 5, 1, 3, 5, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 3, 5, 7, 9, + 2, 2, 1, 1, 0, 0, 3, 0, 3, 3, + 1, 4, 2, 2, 2, 2, 3, 2, 3, 0, + 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, + 1, 0, 3, 0, 3, 0, 3, 1, 1, 1, + 4 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -953,276 +958,283 @@ static const yytype_uint8 yyr2[] = static const yytype_uint16 yydefact[] = { 0, 3, 4, 0, 6, 1, 9, 0, 5, 0, - 0, 234, 0, 0, 0, 0, 232, 2, 0, 0, - 0, 0, 0, 0, 0, 231, 0, 0, 8, 0, + 0, 237, 0, 0, 0, 0, 235, 2, 0, 0, + 0, 0, 0, 0, 0, 234, 0, 0, 8, 0, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, - 23, 20, 0, 85, 86, 110, 111, 87, 88, 89, - 90, 7, 0, 0, 0, 0, 0, 0, 0, 61, - 0, 84, 60, 0, 0, 0, 0, 0, 72, 0, - 0, 229, 230, 31, 0, 0, 0, 10, 11, 237, - 235, 0, 0, 0, 114, 231, 112, 233, 246, 244, - 240, 242, 239, 258, 241, 231, 80, 81, 82, 83, - 50, 231, 231, 231, 231, 231, 231, 74, 51, 222, - 221, 0, 0, 0, 0, 56, 231, 79, 0, 57, - 59, 123, 124, 202, 203, 125, 218, 219, 0, 231, - 0, 267, 91, 238, 115, 0, 116, 120, 121, 122, - 216, 217, 220, 0, 248, 247, 249, 0, 243, 0, - 0, 0, 0, 26, 0, 25, 24, 255, 108, 106, - 258, 93, 0, 0, 0, 0, 0, 0, 252, 0, - 252, 0, 0, 262, 258, 131, 132, 133, 134, 136, - 135, 137, 138, 139, 140, 0, 141, 255, 98, 0, - 96, 94, 258, 0, 103, 92, 0, 77, 76, 78, - 49, 0, 0, 0, 236, 0, 228, 227, 250, 251, - 245, 264, 0, 231, 231, 0, 48, 0, 231, 256, - 257, 107, 109, 0, 0, 0, 201, 172, 173, 171, - 0, 154, 254, 253, 153, 0, 0, 0, 0, 196, - 192, 0, 191, 258, 184, 178, 177, 176, 0, 0, - 0, 0, 97, 0, 99, 0, 0, 95, 231, 223, - 65, 0, 63, 64, 0, 231, 231, 0, 113, 259, - 28, 27, 75, 47, 260, 0, 0, 214, 0, 215, - 0, 175, 0, 163, 0, 155, 0, 160, 161, 144, - 145, 162, 142, 143, 0, 198, 190, 197, 0, 193, - 186, 188, 187, 183, 185, 266, 0, 159, 158, 165, - 166, 0, 0, 105, 0, 102, 0, 0, 0, 58, - 73, 67, 46, 0, 0, 0, 231, 0, 33, 0, - 231, 209, 213, 0, 0, 252, 200, 0, 199, 0, - 263, 170, 169, 167, 168, 164, 189, 0, 100, 101, - 104, 231, 224, 0, 0, 66, 231, 54, 55, 53, - 231, 0, 0, 0, 118, 126, 129, 127, 204, 205, - 128, 265, 0, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 30, 29, 174, 149, 151, - 148, 0, 146, 147, 0, 195, 194, 179, 0, 70, - 68, 71, 69, 0, 0, 0, 0, 130, 181, 231, - 117, 261, 152, 150, 156, 157, 231, 225, 231, 0, - 0, 0, 0, 180, 119, 0, 0, 0, 0, 207, - 0, 211, 0, 226, 231, 0, 206, 0, 210, 0, - 0, 52, 32, 208, 212, 0, 0, 182 + 23, 20, 0, 88, 89, 113, 114, 90, 91, 92, + 93, 7, 0, 0, 0, 0, 0, 0, 0, 64, + 0, 87, 63, 0, 0, 0, 0, 0, 75, 0, + 0, 232, 233, 31, 0, 0, 0, 10, 11, 240, + 238, 0, 0, 0, 117, 234, 115, 236, 249, 247, + 243, 245, 242, 261, 244, 234, 83, 84, 85, 86, + 53, 234, 234, 234, 234, 234, 234, 77, 54, 225, + 224, 0, 0, 0, 0, 59, 0, 234, 82, 0, + 60, 62, 126, 127, 205, 206, 128, 221, 222, 0, + 234, 0, 270, 94, 241, 118, 0, 119, 123, 124, + 125, 219, 220, 223, 0, 251, 250, 252, 0, 246, + 0, 0, 0, 0, 26, 0, 25, 24, 258, 111, + 109, 261, 96, 0, 0, 0, 0, 0, 0, 255, + 0, 255, 0, 0, 265, 261, 134, 135, 136, 137, + 139, 138, 140, 141, 142, 143, 0, 144, 258, 101, + 0, 99, 97, 261, 0, 106, 95, 82, 0, 80, + 79, 81, 51, 0, 0, 0, 239, 0, 231, 230, + 253, 254, 248, 267, 0, 234, 234, 0, 47, 0, + 50, 0, 234, 259, 260, 110, 112, 0, 0, 0, + 204, 175, 176, 174, 0, 157, 257, 256, 156, 0, + 0, 0, 0, 199, 195, 0, 194, 261, 187, 181, + 180, 179, 0, 0, 0, 0, 100, 0, 102, 0, + 0, 98, 0, 234, 226, 68, 0, 66, 67, 0, + 234, 234, 0, 116, 262, 28, 27, 0, 78, 49, + 263, 0, 0, 217, 0, 218, 0, 178, 0, 166, + 0, 158, 0, 163, 164, 147, 148, 165, 145, 146, + 0, 201, 193, 200, 0, 196, 189, 191, 190, 186, + 188, 269, 0, 162, 161, 168, 169, 0, 0, 108, + 0, 105, 0, 0, 52, 0, 61, 76, 70, 46, + 0, 0, 0, 234, 48, 0, 33, 0, 234, 212, + 216, 0, 0, 255, 203, 0, 202, 0, 266, 173, + 172, 170, 171, 167, 192, 0, 103, 104, 107, 234, + 227, 0, 0, 69, 234, 57, 58, 56, 234, 0, + 0, 0, 121, 129, 132, 130, 207, 208, 131, 268, + 0, 34, 35, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 30, 29, 177, 152, 154, 151, 0, + 149, 150, 0, 198, 197, 182, 0, 73, 71, 74, + 72, 0, 0, 0, 0, 133, 184, 234, 120, 264, + 155, 153, 159, 160, 234, 228, 234, 0, 0, 0, + 0, 183, 122, 0, 0, 0, 0, 210, 0, 214, + 0, 229, 234, 0, 209, 0, 213, 0, 0, 55, + 32, 211, 215, 0, 0, 185 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 3, 4, 6, 8, 9, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 275, - 385, 41, 150, 73, 60, 69, 322, 323, 359, 117, - 61, 118, 261, 262, 263, 355, 400, 402, 70, 321, - 108, 273, 200, 100, 42, 43, 119, 195, 316, 257, - 314, 161, 44, 45, 46, 135, 86, 268, 363, 136, - 120, 364, 365, 121, 175, 292, 176, 392, 413, 177, - 234, 178, 414, 179, 308, 293, 284, 180, 311, 345, - 181, 229, 182, 282, 183, 247, 184, 407, 423, 185, - 303, 304, 347, 244, 296, 297, 339, 337, 186, 122, - 367, 368, 428, 123, 369, 430, 124, 278, 280, 370, - 125, 140, 126, 127, 142, 74, 47, 57, 48, 52, - 80, 49, 62, 94, 146, 210, 235, 221, 148, 328, - 249, 212, 372, 306, 50 + 32, 33, 34, 35, 36, 37, 38, 39, 40, 281, + 393, 41, 151, 218, 73, 60, 69, 329, 330, 367, + 219, 61, 119, 266, 267, 268, 363, 408, 410, 70, + 328, 108, 279, 202, 100, 42, 43, 120, 196, 322, + 261, 320, 162, 44, 45, 46, 136, 86, 273, 371, + 137, 121, 372, 373, 122, 176, 298, 177, 400, 421, + 178, 238, 179, 422, 180, 314, 299, 290, 181, 317, + 353, 182, 233, 183, 288, 184, 251, 185, 415, 431, + 186, 309, 310, 355, 248, 302, 303, 347, 345, 187, + 123, 375, 376, 436, 124, 377, 438, 125, 284, 286, + 378, 126, 141, 127, 128, 143, 74, 47, 57, 48, + 52, 80, 49, 62, 94, 147, 212, 239, 225, 149, + 336, 253, 214, 380, 312, 50 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -399 +#define YYPACT_NINF -403 static const yytype_int16 yypact[] = { - 154, -399, -399, 48, -399, -399, 51, -37, -399, 172, - -2, -399, 17, 31, 42, 47, -399, -399, -33, -33, - -33, -33, -33, -33, 54, 56, -33, -33, -399, 6, - -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, - -399, -399, 52, -399, -399, -399, -399, -399, -399, -399, - -399, -399, 66, 25, 61, 112, -6, 66, 102, -399, - 118, 116, -399, 119, 120, 121, 122, 123, -399, 124, - 130, -399, -399, -399, -16, 126, 127, -399, -399, -399, - 128, 70, -15, 159, 214, -36, -399, 128, 28, -399, - -399, -399, -399, 131, -399, 56, -399, -399, -399, -399, - -399, 56, 56, 56, 56, 56, 56, -399, -399, -399, - -399, 27, 38, 76, -9, 135, 56, 60, 136, -399, - -399, -399, -399, -399, -399, -399, -399, -399, -16, 56, - 147, -399, -399, -399, -399, 137, -399, -399, -399, -399, - -399, -399, -399, 148, -399, -399, 18, 225, -399, 141, - 142, -16, 144, -399, 145, -399, -399, 50, -399, -399, - 131, -399, 146, 149, 150, 187, 7, 151, 43, 152, - 69, 85, -1, 153, 131, -399, -399, -399, -399, -399, - -399, -399, -399, -399, -399, 190, -399, 50, -399, 155, - -399, -399, 131, 156, 158, -399, 20, -399, -399, -399, - -399, -8, 160, 162, -399, 161, -399, -399, -399, -399, - -399, -399, 163, 56, 56, 169, 173, 171, 56, -399, - -399, -399, -399, 234, 240, 252, -399, -399, -399, -399, - 254, -399, -399, -399, -399, 211, 254, 2, 170, 257, - -399, 174, -399, 131, 12, -399, -399, -399, 258, 253, - -5, 175, -399, 262, -399, 263, 262, -399, 56, -399, - -399, 177, -399, -399, 185, 56, 56, 176, -399, -399, - -399, -399, -399, -399, 180, 183, 184, -399, 186, -399, - 189, -399, 191, -399, 192, -399, 194, -399, -399, -399, - -399, -399, -399, -399, 270, -399, -399, -399, 271, -399, - -399, -399, -399, -399, -399, -399, 195, -399, -399, -399, - -399, 143, 272, -399, 196, -399, 197, 198, 34, -399, - -399, 101, -399, 201, -4, 202, -12, 274, -399, 111, - 56, -399, -399, 241, 84, 69, -399, 203, -399, 204, - -399, -399, -399, -399, -399, -399, -399, 205, -399, -399, - -399, 56, -399, 277, 288, -399, 56, -399, -399, -399, - 56, 80, 76, 35, -399, -399, -399, -399, -399, -399, - -399, -399, 206, -399, -399, -399, -399, -399, -399, -399, - -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, - -399, 280, -399, -399, 14, -399, -399, -399, 39, -399, - -399, -399, -399, 209, 210, 212, 213, -399, 261, -12, - -399, -399, -399, -399, -399, -399, 56, -399, 56, 171, - 234, 240, 219, -399, -399, 208, 221, 222, 224, 215, - 226, 227, 272, -399, 56, 111, -399, 234, -399, 240, - -13, -399, -399, -399, -399, 272, 228, -399 + 62, -403, -403, 41, -403, -403, 81, -36, -403, 198, + -8, -403, -5, 18, 20, 35, -403, -403, -23, -23, + -23, -23, -23, -23, 45, 131, -23, -23, -403, 58, + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + -403, -403, 67, -403, -403, -403, -403, -403, -403, -403, + -403, -403, 63, 86, 92, 128, 84, 63, 99, -403, + 69, 133, -403, 87, 89, 129, 145, 146, -403, 147, + 154, -403, -403, -403, -13, 150, 151, -403, -403, -403, + 152, 162, -14, 197, 240, -34, -403, 152, 98, -403, + -403, -403, -403, 155, -403, 131, -403, -403, -403, -403, + -403, 131, 131, 131, 131, 131, 131, -403, -403, -403, + -403, 72, 105, 77, 17, 156, 12, 131, 68, 157, + -403, -403, -403, -403, -403, -403, -403, -403, -403, 12, + 131, 165, -403, -403, -403, -403, 158, -403, -403, -403, + -403, -403, -403, -403, 223, -403, -403, -16, 245, -403, + 163, 164, -9, 167, -403, 168, -403, -403, 55, -403, + -403, 155, -403, 170, 171, 172, 206, 2, 173, 34, + 174, 127, 112, 1, 175, 155, -403, -403, -403, -403, + -403, -403, -403, -403, -403, -403, 207, -403, 55, -403, + 177, -403, -403, 155, 178, 179, -403, 68, 22, -403, + -403, -403, -403, -6, 169, 182, -403, 180, -403, -403, + -403, -403, -403, -403, 181, 131, 131, 12, -403, 188, + 190, 195, 131, -403, -403, -403, -403, 272, 273, 274, + -403, -403, -403, -403, 275, -403, -403, -403, -403, 232, + 275, 79, 191, 277, -403, 192, -403, 155, 15, -403, + -403, -403, 280, 276, 8, 194, -403, 283, -403, 284, + 283, -403, 199, 131, -403, -403, 200, -403, -403, 209, + 131, 131, 201, -403, -403, -403, -403, 204, -403, -403, + 205, 210, 211, -403, 203, -403, 212, -403, 213, -403, + 214, -403, 215, -403, -403, -403, -403, -403, -403, -403, + 286, -403, -403, -403, 294, -403, -403, -403, -403, -403, + -403, -403, 216, -403, -403, -403, -403, 161, 297, -403, + 217, -403, 218, 219, -403, 76, -403, -403, 139, -403, + 227, -4, 228, 30, -403, 298, -403, 137, 131, -403, + -403, 265, 130, 127, -403, 220, -403, 226, -403, -403, + -403, -403, -403, -403, -403, 229, -403, -403, -403, 131, + -403, 315, 319, -403, 131, -403, -403, -403, 131, 123, + 77, 80, -403, -403, -403, -403, -403, -403, -403, -403, + 233, -403, -403, -403, -403, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, -403, -403, -403, -403, 311, + -403, -403, 9, -403, -403, -403, 83, -403, -403, -403, + -403, 237, 238, 239, 241, -403, 281, 30, -403, -403, + -403, -403, -403, -403, 131, -403, 131, 195, 272, 273, + 242, -403, -403, 234, 246, 247, 248, 243, 249, 251, + 297, -403, 131, 137, -403, 272, -403, 273, 36, -403, + -403, -403, -403, 297, 250, -403 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -399, -399, -399, -399, -399, -399, -399, -399, -399, -399, - -399, -399, -399, -399, -399, -399, -399, -399, -399, -100, - -98, -399, -97, -91, 188, -399, -399, -344, -399, -99, - -399, -399, -399, -399, -399, -399, -399, -399, 134, -399, - -399, -399, -399, -399, -399, -399, 259, -399, -399, -399, - 83, -399, -399, -399, -399, -399, -399, -399, -399, -399, - -399, -69, -399, -84, -399, -399, -399, -399, -399, -399, - -399, -399, -399, -399, -399, -317, 106, -399, -399, -399, - -399, -399, -399, -399, -399, -399, -399, -399, -399, -19, - -399, -399, -398, -399, -399, -399, -399, -399, -399, 260, - -399, -399, -399, -399, -399, -399, -399, -377, -381, 265, - -399, -399, 193, -83, -113, -85, -399, -399, -399, -399, - 289, -399, 264, -399, -399, -399, -165, 164, -150, -399, - -399, -399, -399, -399, -399 + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, -403, -403, -403, -403, -74, + -81, -403, -98, 141, -82, 160, -403, -403, -358, -403, + -41, -403, -403, -403, -403, -403, -403, -403, -403, 166, + -403, -403, -403, 176, -403, -403, -403, 282, -403, -403, + -403, 103, -403, -403, -403, -403, -403, -403, -403, -403, + -403, -403, -52, -403, -84, -403, -403, -403, -403, -403, + -403, -403, -403, -403, -403, -403, -333, 126, -403, -403, + -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, + -3, -403, -403, -402, -403, -403, -403, -403, -403, -403, + 285, -403, -403, -403, -403, -403, -403, -403, -398, -392, + 287, -403, -403, -145, -83, -114, -85, -403, -403, -403, + -403, 314, -403, 291, -403, -403, -403, -167, 187, -149, + -403, -403, -403, -403, -403, -403 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -219 +#define YYTABLE_NINF -222 static const yytype_int16 yytable[] = { - 143, 137, 141, 196, 149, 237, 153, 109, 110, 156, - 222, 152, 403, 154, 155, 260, 151, 393, 151, 357, - 187, 151, 111, 111, 250, 245, 112, 287, 188, 202, - 309, 143, 58, 288, 440, 289, 227, 113, 203, 287, - 431, 189, 254, 429, 190, 288, 112, 446, 5, 310, - 361, 191, 215, 300, 301, 144, 157, 113, 444, 7, - 443, 362, 10, 228, 158, 192, 59, 145, 231, 246, - 232, 290, 162, 291, 426, 71, 72, 415, 116, 208, - 114, 114, 233, 115, 163, 291, 209, 159, 193, 194, - 441, 68, 445, 299, 302, 358, 232, 397, 116, 71, - 72, 160, 116, 84, 164, 51, 165, 85, 233, 287, - 388, 219, 166, 77, 405, 288, 53, 271, 220, 167, - 168, 169, 270, 170, 389, 171, 406, 276, 258, 151, - 54, 88, 89, 238, 172, 259, 239, 240, 81, 90, - 241, 55, 351, 409, 390, 318, 56, 416, 242, 352, - 410, 173, 174, 68, 417, 291, 391, 1, 2, 78, - 197, 91, 92, 198, 199, 79, 243, 71, 72, 131, - 394, 206, 207, 143, 82, 325, 93, 11, 12, 13, - 324, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 373, 374, 375, 376, 377, - 378, 379, 380, 381, 382, 383, 384, 63, 64, 65, - 66, 67, 353, 354, 75, 76, 96, 97, 98, 99, - 341, 342, 343, 344, 58, 83, 95, 101, 102, 103, - 104, 105, 106, 107, 128, 129, 130, 134, 398, 386, - 147, 143, 366, 141, -62, 201, 204, 205, 211, 213, - 214, 226, 217, 218, 274, 223, 251, 277, 224, 225, - 230, 236, 248, 279, 253, 255, 143, 256, 265, 404, - 266, 324, 272, 269, 267, 281, -218, 283, 285, 294, - 295, 305, 307, 298, 312, 313, 315, 319, 320, 327, - 326, 329, 330, 336, 338, 346, 331, 371, 387, 332, - 399, 333, 334, 425, 335, 340, 348, 349, 350, 356, - 360, 401, 412, 395, 396, 397, 411, 418, 419, 427, - 437, 420, 421, 433, 143, 366, 141, 422, 432, 434, - 435, 143, 439, 324, 436, 264, 438, 442, 447, 317, - 424, 132, 286, 408, 216, 138, 87, 133, 0, 324, - 139, 252 + 144, 138, 142, 198, 241, 154, 411, 220, 157, 401, + 109, 110, 226, 150, 109, 110, 152, 265, 152, 365, + 153, 152, 155, 156, 111, 111, 254, 249, 112, 111, + 437, 231, 144, 118, 293, 109, 110, 439, 448, 113, + 294, 5, 58, 315, 258, 210, 188, 451, 205, 112, + 111, 454, 211, 112, 189, 452, 306, 307, 232, 235, + 113, 236, 316, 10, 113, 1, 2, 190, 434, 423, + 191, 250, 220, 237, 112, 197, 59, 192, 71, 72, + 297, 117, 114, 114, 449, 113, 115, 114, 204, 7, + 115, 193, 369, 68, 53, 366, 116, 308, 305, 51, + 217, 158, 117, 370, 293, 165, 117, 166, 114, 159, + 294, 115, 295, 167, 194, 195, 223, 54, 276, 55, + 168, 169, 170, 224, 171, 145, 172, 117, 88, 89, + 263, 152, 160, 275, 56, 173, 90, 146, 264, 163, + 282, 453, 71, 72, 68, 117, 161, 405, 296, 325, + 297, 164, 174, 175, 236, 293, 396, 413, 91, 92, + 242, 294, 79, 243, 244, 77, 237, 245, 199, 414, + 397, 200, 201, 93, 78, 246, 402, 95, 144, 63, + 64, 65, 66, 67, 359, 331, 75, 76, 417, 332, + 398, 424, 360, 247, 84, 101, 418, 102, 85, 425, + 81, 297, 399, 11, 12, 13, 82, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 381, 382, 383, 384, 385, 386, 387, 388, 389, + 390, 391, 392, 96, 97, 98, 99, 103, 349, 350, + 351, 352, 83, 71, 72, 406, 208, 209, 144, 374, + 142, 361, 362, 104, 105, 106, 394, 107, 129, 130, + 131, 132, 58, 135, 206, 148, -65, 203, 213, 207, + 230, 215, 216, 255, 144, 221, 222, 270, 280, 331, + 227, 228, 229, 234, 240, 252, 412, 257, 259, 260, + 271, 278, 274, -221, 272, 283, 285, 287, 289, 291, + 301, 300, 304, 311, 318, 313, 319, 321, 324, 344, + 433, 326, 327, 334, 339, 335, 333, 346, 337, 338, + 354, 379, 395, 340, 341, 342, 343, 348, 356, 357, + 358, 403, 144, 374, 142, 364, 368, 404, 407, 144, + 405, 331, 409, 420, 419, 426, 427, 430, 445, 428, + 441, 429, 440, 435, 442, 443, 447, 331, 277, 444, + 446, 455, 450, 323, 133, 432, 292, 416, 0, 269, + 139, 87, 140, 262, 134, 256 }; static const yytype_int16 yycheck[] = { - 85, 85, 85, 116, 95, 170, 103, 23, 24, 106, - 160, 102, 356, 104, 105, 23, 101, 334, 103, 23, - 29, 106, 38, 38, 174, 26, 62, 25, 37, 128, - 35, 116, 65, 31, 432, 33, 29, 73, 129, 25, - 421, 50, 192, 420, 53, 31, 62, 445, 0, 54, - 62, 60, 151, 41, 42, 27, 29, 73, 439, 8, - 437, 73, 99, 56, 37, 74, 99, 39, 25, 70, - 27, 69, 34, 71, 418, 111, 112, 394, 114, 61, - 96, 96, 39, 99, 46, 71, 68, 60, 97, 98, - 434, 99, 105, 243, 82, 99, 27, 110, 114, 111, - 112, 74, 114, 109, 28, 107, 30, 113, 39, 25, - 26, 61, 36, 107, 34, 31, 99, 214, 68, 43, - 44, 45, 213, 47, 40, 49, 46, 218, 108, 214, - 99, 29, 30, 48, 58, 115, 51, 52, 113, 37, - 55, 99, 108, 108, 60, 258, 99, 108, 63, 115, - 115, 75, 76, 99, 115, 71, 72, 3, 4, 107, - 100, 59, 60, 103, 104, 99, 81, 111, 112, 99, - 335, 23, 24, 258, 113, 266, 74, 5, 6, 7, - 265, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 19, 20, 21, - 22, 23, 111, 112, 26, 27, 100, 101, 102, 103, - 77, 78, 79, 80, 65, 113, 108, 108, 108, 108, - 108, 108, 108, 103, 108, 108, 108, 23, 351, 330, - 109, 326, 326, 326, 109, 109, 99, 110, 23, 108, - 108, 64, 108, 108, 83, 109, 66, 23, 109, 109, - 109, 109, 109, 23, 109, 109, 351, 109, 108, 360, - 108, 356, 103, 110, 113, 23, 103, 23, 67, 109, - 23, 23, 29, 109, 109, 23, 23, 110, 103, 109, - 114, 108, 108, 23, 23, 23, 110, 23, 57, 110, - 23, 110, 110, 416, 110, 110, 110, 110, 110, 108, - 108, 23, 32, 110, 110, 110, 110, 108, 108, 419, - 105, 109, 109, 115, 409, 409, 409, 66, 109, 108, - 108, 416, 105, 418, 110, 201, 110, 435, 110, 256, - 409, 82, 236, 362, 151, 85, 57, 83, -1, 434, - 85, 187 + 85, 85, 85, 117, 171, 103, 364, 152, 106, 342, + 23, 24, 161, 95, 23, 24, 101, 23, 103, 23, + 102, 106, 104, 105, 38, 38, 175, 26, 62, 38, + 428, 29, 117, 74, 25, 23, 24, 429, 440, 73, + 31, 0, 65, 35, 193, 61, 29, 445, 130, 62, + 38, 453, 68, 62, 37, 447, 41, 42, 56, 25, + 73, 27, 54, 99, 73, 3, 4, 50, 426, 402, + 53, 70, 217, 39, 62, 116, 99, 60, 112, 113, + 71, 115, 96, 96, 442, 73, 99, 96, 129, 8, + 99, 74, 62, 99, 99, 99, 109, 82, 247, 107, + 109, 29, 115, 73, 25, 28, 115, 30, 96, 37, + 31, 99, 33, 36, 97, 98, 61, 99, 216, 99, + 43, 44, 45, 68, 47, 27, 49, 115, 29, 30, + 108, 216, 60, 215, 99, 58, 37, 39, 116, 34, + 222, 105, 112, 113, 99, 115, 74, 111, 69, 263, + 71, 46, 75, 76, 27, 25, 26, 34, 59, 60, + 48, 31, 99, 51, 52, 107, 39, 55, 100, 46, + 40, 103, 104, 74, 107, 63, 343, 108, 263, 19, + 20, 21, 22, 23, 108, 270, 26, 27, 108, 271, + 60, 108, 116, 81, 110, 108, 116, 108, 114, 116, + 114, 71, 72, 5, 6, 7, 114, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 100, 101, 102, 103, 108, 77, 78, + 79, 80, 114, 112, 113, 359, 23, 24, 333, 333, + 333, 112, 113, 108, 108, 108, 338, 103, 108, 108, + 108, 99, 65, 23, 99, 110, 110, 110, 23, 111, + 64, 108, 108, 66, 359, 108, 108, 108, 83, 364, + 110, 110, 110, 110, 110, 110, 368, 110, 110, 110, + 108, 103, 111, 103, 114, 23, 23, 23, 23, 67, + 23, 110, 110, 23, 110, 29, 23, 23, 109, 23, + 424, 111, 103, 109, 111, 110, 115, 23, 108, 108, + 23, 23, 57, 111, 111, 111, 111, 111, 111, 111, + 111, 111, 417, 417, 417, 108, 108, 111, 23, 424, + 111, 426, 23, 32, 111, 108, 108, 66, 105, 110, + 116, 110, 110, 427, 108, 108, 105, 442, 217, 111, + 111, 111, 443, 260, 82, 417, 240, 370, -1, 203, + 85, 57, 85, 197, 83, 188 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 3, 4, 117, 118, 0, 119, 8, 120, 121, + 0, 3, 4, 118, 119, 0, 120, 8, 121, 122, 99, 5, 6, 7, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 122, 123, - 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, - 134, 137, 160, 161, 168, 169, 170, 232, 234, 237, - 250, 107, 235, 99, 99, 99, 99, 233, 65, 99, - 140, 146, 238, 140, 140, 140, 140, 140, 99, 141, - 154, 111, 112, 139, 231, 140, 140, 107, 107, 99, - 236, 113, 113, 113, 109, 113, 172, 236, 29, 30, - 37, 59, 60, 74, 239, 108, 100, 101, 102, 103, - 159, 108, 108, 108, 108, 108, 108, 103, 156, 23, - 24, 38, 62, 73, 96, 99, 114, 145, 147, 162, - 176, 179, 215, 219, 222, 226, 228, 229, 108, 108, - 108, 99, 162, 238, 23, 171, 175, 179, 215, 225, - 227, 229, 230, 231, 27, 39, 240, 109, 244, 139, - 138, 231, 139, 138, 139, 139, 138, 29, 37, 60, - 74, 167, 34, 46, 28, 30, 36, 43, 44, 45, - 47, 49, 58, 75, 76, 180, 182, 185, 187, 189, - 193, 196, 198, 200, 202, 205, 214, 29, 37, 50, - 53, 60, 74, 97, 98, 163, 230, 100, 103, 104, - 158, 109, 145, 139, 99, 110, 23, 24, 61, 68, - 241, 23, 247, 108, 108, 145, 228, 108, 108, 61, - 68, 243, 244, 109, 109, 109, 64, 29, 56, 197, - 109, 25, 27, 39, 186, 242, 109, 242, 48, 51, - 52, 55, 63, 81, 209, 26, 70, 201, 109, 246, - 244, 66, 243, 109, 244, 109, 109, 165, 108, 115, - 23, 148, 149, 150, 154, 108, 108, 113, 173, 110, - 139, 138, 103, 157, 83, 135, 139, 23, 223, 23, - 224, 23, 199, 23, 192, 67, 192, 25, 31, 33, - 69, 71, 181, 191, 109, 23, 210, 211, 109, 244, - 41, 42, 82, 206, 207, 23, 249, 29, 190, 35, - 54, 194, 109, 23, 166, 23, 164, 166, 230, 110, - 103, 155, 142, 143, 231, 139, 114, 109, 245, 108, - 108, 110, 110, 110, 110, 110, 23, 213, 23, 212, - 110, 77, 78, 79, 80, 195, 23, 208, 110, 110, - 110, 108, 115, 111, 112, 151, 108, 23, 99, 144, - 108, 62, 73, 174, 177, 178, 179, 216, 217, 220, - 225, 23, 248, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 136, 139, 57, 26, 40, - 60, 72, 183, 191, 242, 110, 110, 110, 230, 23, - 152, 23, 153, 143, 139, 34, 46, 203, 205, 108, - 115, 110, 32, 184, 188, 191, 108, 115, 108, 108, - 109, 109, 66, 204, 177, 230, 143, 135, 218, 223, - 221, 224, 109, 115, 108, 108, 110, 105, 110, 105, - 208, 143, 136, 223, 224, 105, 208, 110 + 15, 16, 17, 18, 19, 20, 21, 22, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 138, 162, 163, 170, 171, 172, 234, 236, 239, + 252, 107, 237, 99, 99, 99, 99, 235, 65, 99, + 142, 148, 240, 142, 142, 142, 142, 142, 99, 143, + 156, 112, 113, 141, 233, 142, 142, 107, 107, 99, + 238, 114, 114, 114, 110, 114, 174, 238, 29, 30, + 37, 59, 60, 74, 241, 108, 100, 101, 102, 103, + 161, 108, 108, 108, 108, 108, 108, 103, 158, 23, + 24, 38, 62, 73, 96, 99, 109, 115, 147, 149, + 164, 178, 181, 217, 221, 224, 228, 230, 231, 108, + 108, 108, 99, 164, 240, 23, 173, 177, 181, 217, + 227, 229, 231, 232, 233, 27, 39, 242, 110, 246, + 141, 139, 233, 141, 139, 141, 141, 139, 29, 37, + 60, 74, 169, 34, 46, 28, 30, 36, 43, 44, + 45, 47, 49, 58, 75, 76, 182, 184, 187, 189, + 191, 195, 198, 200, 202, 204, 207, 216, 29, 37, + 50, 53, 60, 74, 97, 98, 165, 147, 232, 100, + 103, 104, 160, 110, 147, 141, 99, 111, 23, 24, + 61, 68, 243, 23, 249, 108, 108, 109, 140, 147, + 230, 108, 108, 61, 68, 245, 246, 110, 110, 110, + 64, 29, 56, 199, 110, 25, 27, 39, 188, 244, + 110, 244, 48, 51, 52, 55, 63, 81, 211, 26, + 70, 203, 110, 248, 246, 66, 245, 110, 246, 110, + 110, 167, 160, 108, 116, 23, 150, 151, 152, 156, + 108, 108, 114, 175, 111, 141, 139, 140, 103, 159, + 83, 136, 141, 23, 225, 23, 226, 23, 201, 23, + 194, 67, 194, 25, 31, 33, 69, 71, 183, 193, + 110, 23, 212, 213, 110, 246, 41, 42, 82, 208, + 209, 23, 251, 29, 192, 35, 54, 196, 110, 23, + 168, 23, 166, 168, 109, 232, 111, 103, 157, 144, + 145, 233, 141, 115, 109, 110, 247, 108, 108, 111, + 111, 111, 111, 111, 23, 215, 23, 214, 111, 77, + 78, 79, 80, 197, 23, 210, 111, 111, 111, 108, + 116, 112, 113, 153, 108, 23, 99, 146, 108, 62, + 73, 176, 179, 180, 181, 218, 219, 222, 227, 23, + 250, 84, 85, 86, 87, 88, 89, 90, 91, 92, + 93, 94, 95, 137, 141, 57, 26, 40, 60, 72, + 185, 193, 244, 111, 111, 111, 232, 23, 154, 23, + 155, 145, 141, 34, 46, 205, 207, 108, 116, 111, + 32, 186, 190, 193, 108, 116, 108, 108, 110, 110, + 66, 206, 179, 232, 145, 136, 220, 225, 223, 226, + 110, 116, 108, 108, 111, 105, 111, 105, 210, 145, + 137, 225, 226, 105, 210, 111 }; #define yyerrok (yyerrstatus = 0) @@ -2445,32 +2457,61 @@ yyreduce: /* Line 1455 of yacc.c */ #line 527 "program_parse.y" { - (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); + (yyval.src_reg) = (yyvsp[(2) - (2)].src_reg); - if ((yyvsp[(1) - (3)].negate)) { + if ((yyvsp[(1) - (2)].negate)) { + (yyval.src_reg).Base.Negate = ~(yyval.src_reg).Base.Negate; + } + ;} + break; + + case 48: + +/* Line 1455 of yacc.c */ +#line 535 "program_parse.y" + { + (yyval.src_reg) = (yyvsp[(3) - (4)].src_reg); + + if (!state->option.NV_fragment) { + yyerror(& (yylsp[(2) - (4)]), state, "unexpected character '|'"); + YYERROR; + } + + if ((yyvsp[(1) - (4)].negate)) { (yyval.src_reg).Base.Negate = ~(yyval.src_reg).Base.Negate; } + (yyval.src_reg).Base.Abs = 1; + ;} + break; + + case 49: + +/* Line 1455 of yacc.c */ +#line 552 "program_parse.y" + { + (yyval.src_reg) = (yyvsp[(1) - (2)].src_reg); + (yyval.src_reg).Base.Swizzle = _mesa_combine_swizzles((yyval.src_reg).Base.Swizzle, - (yyvsp[(3) - (3)].swiz_mask).swizzle); + (yyvsp[(2) - (2)].swiz_mask).swizzle); ;} break; - case 48: + case 50: /* Line 1455 of yacc.c */ -#line 538 "program_parse.y" +#line 559 "program_parse.y" { struct asm_symbol temp_sym; if (!state->option.NV_fragment) { - yyerror(& (yylsp[(2) - (2)]), state, "expected scalar suffix"); + yyerror(& (yylsp[(1) - (1)]), state, "expected scalar suffix"); YYERROR; } memset(& temp_sym, 0, sizeof(temp_sym)); temp_sym.param_binding_begin = ~0; - initialize_symbol_from_const(state->prog, & temp_sym, & (yyvsp[(2) - (2)].vector)); + initialize_symbol_from_const(state->prog, & temp_sym, & (yyvsp[(1) - (1)].vector)); init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = PROGRAM_CONSTANT; @@ -2478,10 +2519,10 @@ yyreduce: ;} break; - case 49: + case 51: /* Line 1455 of yacc.c */ -#line 557 "program_parse.y" +#line 578 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); @@ -2494,10 +2535,32 @@ yyreduce: ;} break; - case 50: + case 52: + +/* Line 1455 of yacc.c */ +#line 589 "program_parse.y" + { + (yyval.src_reg) = (yyvsp[(3) - (5)].src_reg); + + if (!state->option.NV_fragment) { + yyerror(& (yylsp[(2) - (5)]), state, "unexpected character '|'"); + YYERROR; + } + + if ((yyvsp[(1) - (5)].negate)) { + (yyval.src_reg).Base.Negate = ~(yyval.src_reg).Base.Negate; + } + + (yyval.src_reg).Base.Abs = 1; + (yyval.src_reg).Base.Swizzle = _mesa_combine_swizzles((yyval.src_reg).Base.Swizzle, + (yyvsp[(4) - (5)].swiz_mask).swizzle); + ;} + break; + + case 53: /* Line 1455 of yacc.c */ -#line 570 "program_parse.y" +#line 609 "program_parse.y" { (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); (yyval.dst_reg).WriteMask = (yyvsp[(2) - (2)].swiz_mask).mask; @@ -2519,10 +2582,10 @@ yyreduce: ;} break; - case 51: + case 54: /* Line 1455 of yacc.c */ -#line 592 "program_parse.y" +#line 631 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_ADDRESS; @@ -2531,10 +2594,10 @@ yyreduce: ;} break; - case 52: + case 55: /* Line 1455 of yacc.c */ -#line 601 "program_parse.y" +#line 640 "program_parse.y" { const unsigned xyzw_valid = ((yyvsp[(1) - (7)].ext_swizzle).xyzw_valid << 0) @@ -2567,20 +2630,20 @@ yyreduce: ;} break; - case 53: + case 56: /* Line 1455 of yacc.c */ -#line 634 "program_parse.y" +#line 673 "program_parse.y" { (yyval.ext_swizzle) = (yyvsp[(2) - (2)].ext_swizzle); (yyval.ext_swizzle).negate = ((yyvsp[(1) - (2)].negate)) ? 1 : 0; ;} break; - case 54: + case 57: /* Line 1455 of yacc.c */ -#line 641 "program_parse.y" +#line 680 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) != 0) && ((yyvsp[(1) - (1)].integer) != 1)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2597,10 +2660,10 @@ yyreduce: ;} break; - case 55: + case 58: /* Line 1455 of yacc.c */ -#line 656 "program_parse.y" +#line 695 "program_parse.y" { if (strlen((yyvsp[(1) - (1)].string)) > 1) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2650,10 +2713,10 @@ yyreduce: ;} break; - case 56: + case 59: /* Line 1455 of yacc.c */ -#line 706 "program_parse.y" +#line 745 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2697,10 +2760,10 @@ yyreduce: ;} break; - case 57: + case 60: /* Line 1455 of yacc.c */ -#line 748 "program_parse.y" +#line 787 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = PROGRAM_INPUT; @@ -2713,10 +2776,10 @@ yyreduce: ;} break; - case 58: + case 61: /* Line 1455 of yacc.c */ -#line 759 "program_parse.y" +#line 798 "program_parse.y" { if (! (yyvsp[(3) - (4)].src_reg).Base.RelAddr && ((unsigned) (yyvsp[(3) - (4)].src_reg).Base.Index >= (yyvsp[(1) - (4)].sym)->param_binding_length)) { @@ -2739,10 +2802,10 @@ yyreduce: ;} break; - case 59: + case 62: /* Line 1455 of yacc.c */ -#line 780 "program_parse.y" +#line 819 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = ((yyvsp[(1) - (1)].temp_sym).name != NULL) @@ -2752,10 +2815,10 @@ yyreduce: ;} break; - case 60: + case 63: /* Line 1455 of yacc.c */ -#line 790 "program_parse.y" +#line 829 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_OUTPUT; @@ -2763,10 +2826,10 @@ yyreduce: ;} break; - case 61: + case 64: /* Line 1455 of yacc.c */ -#line 796 "program_parse.y" +#line 835 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2797,10 +2860,10 @@ yyreduce: ;} break; - case 62: + case 65: /* Line 1455 of yacc.c */ -#line 827 "program_parse.y" +#line 866 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2817,20 +2880,20 @@ yyreduce: ;} break; - case 65: + case 68: /* Line 1455 of yacc.c */ -#line 846 "program_parse.y" +#line 885 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].integer); ;} break; - case 66: + case 69: /* Line 1455 of yacc.c */ -#line 853 "program_parse.y" +#line 892 "program_parse.y" { /* FINISHME: Add support for multiple address registers. */ @@ -2842,31 +2905,31 @@ yyreduce: ;} break; - case 67: + case 70: /* Line 1455 of yacc.c */ -#line 864 "program_parse.y" +#line 903 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 68: + case 71: /* Line 1455 of yacc.c */ -#line 865 "program_parse.y" +#line 904 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; - case 69: + case 72: /* Line 1455 of yacc.c */ -#line 866 "program_parse.y" +#line 905 "program_parse.y" { (yyval.integer) = -(yyvsp[(2) - (2)].integer); ;} break; - case 70: + case 73: /* Line 1455 of yacc.c */ -#line 870 "program_parse.y" +#line 909 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 63)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2878,10 +2941,10 @@ yyreduce: ;} break; - case 71: + case 74: /* Line 1455 of yacc.c */ -#line 882 "program_parse.y" +#line 921 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 64)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2893,10 +2956,10 @@ yyreduce: ;} break; - case 72: + case 75: /* Line 1455 of yacc.c */ -#line 894 "program_parse.y" +#line 933 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2914,10 +2977,10 @@ yyreduce: ;} break; - case 73: + case 76: /* Line 1455 of yacc.c */ -#line 912 "program_parse.y" +#line 951 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, "invalid address component selector"); @@ -2928,10 +2991,10 @@ yyreduce: ;} break; - case 74: + case 77: /* Line 1455 of yacc.c */ -#line 923 "program_parse.y" +#line 962 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2943,24 +3006,24 @@ yyreduce: ;} break; - case 79: + case 82: /* Line 1455 of yacc.c */ -#line 939 "program_parse.y" +#line 978 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; - case 84: + case 87: /* Line 1455 of yacc.c */ -#line 943 "program_parse.y" +#line 982 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; - case 91: + case 94: /* Line 1455 of yacc.c */ -#line 955 "program_parse.y" +#line 994 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_attrib, & (yylsp[(2) - (4)])); @@ -2978,55 +3041,55 @@ yyreduce: ;} break; - case 92: + case 95: /* Line 1455 of yacc.c */ -#line 973 "program_parse.y" +#line 1012 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} break; - case 93: + case 96: /* Line 1455 of yacc.c */ -#line 977 "program_parse.y" +#line 1016 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} break; - case 94: + case 97: /* Line 1455 of yacc.c */ -#line 983 "program_parse.y" +#line 1022 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_POS; ;} break; - case 95: + case 98: /* Line 1455 of yacc.c */ -#line 987 "program_parse.y" +#line 1026 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_WEIGHT; ;} break; - case 96: + case 99: /* Line 1455 of yacc.c */ -#line 991 "program_parse.y" +#line 1030 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_NORMAL; ;} break; - case 97: + case 100: /* Line 1455 of yacc.c */ -#line 995 "program_parse.y" +#line 1034 "program_parse.y" { if (!state->ctx->Extensions.EXT_secondary_color) { yyerror(& (yylsp[(2) - (2)]), state, "GL_EXT_secondary_color not supported"); @@ -3037,10 +3100,10 @@ yyreduce: ;} break; - case 98: + case 101: /* Line 1455 of yacc.c */ -#line 1004 "program_parse.y" +#line 1043 "program_parse.y" { if (!state->ctx->Extensions.EXT_fog_coord) { yyerror(& (yylsp[(1) - (1)]), state, "GL_EXT_fog_coord not supported"); @@ -3051,38 +3114,38 @@ yyreduce: ;} break; - case 99: + case 102: /* Line 1455 of yacc.c */ -#line 1013 "program_parse.y" +#line 1052 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} break; - case 100: + case 103: /* Line 1455 of yacc.c */ -#line 1017 "program_parse.y" +#line 1056 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; ;} break; - case 101: + case 104: /* Line 1455 of yacc.c */ -#line 1022 "program_parse.y" +#line 1061 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_GENERIC0 + (yyvsp[(3) - (4)].integer); ;} break; - case 102: + case 105: /* Line 1455 of yacc.c */ -#line 1028 "program_parse.y" +#line 1067 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxAttribs) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex attribute reference"); @@ -3093,46 +3156,46 @@ yyreduce: ;} break; - case 106: + case 109: /* Line 1455 of yacc.c */ -#line 1042 "program_parse.y" +#line 1081 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_WPOS; ;} break; - case 107: + case 110: /* Line 1455 of yacc.c */ -#line 1046 "program_parse.y" +#line 1085 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_COL0 + (yyvsp[(2) - (2)].integer); ;} break; - case 108: + case 111: /* Line 1455 of yacc.c */ -#line 1050 "program_parse.y" +#line 1089 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_FOGC; ;} break; - case 109: + case 112: /* Line 1455 of yacc.c */ -#line 1054 "program_parse.y" +#line 1093 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} break; - case 112: + case 115: /* Line 1455 of yacc.c */ -#line 1062 "program_parse.y" +#line 1101 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (3)].string), at_param, & (yylsp[(2) - (3)])); @@ -3148,10 +3211,10 @@ yyreduce: ;} break; - case 113: + case 116: /* Line 1455 of yacc.c */ -#line 1078 "program_parse.y" +#line 1117 "program_parse.y" { if (((yyvsp[(4) - (6)].integer) != 0) && ((unsigned) (yyvsp[(4) - (6)].integer) != (yyvsp[(6) - (6)].temp_sym).param_binding_length)) { yyerror(& (yylsp[(4) - (6)]), state, @@ -3173,19 +3236,19 @@ yyreduce: ;} break; - case 114: + case 117: /* Line 1455 of yacc.c */ -#line 1100 "program_parse.y" +#line 1139 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 115: + case 118: /* Line 1455 of yacc.c */ -#line 1104 "program_parse.y" +#line 1143 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 1) || ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxParameters)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid parameter array size"); @@ -3196,38 +3259,38 @@ yyreduce: ;} break; - case 116: + case 119: /* Line 1455 of yacc.c */ -#line 1115 "program_parse.y" +#line 1154 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(2) - (2)].temp_sym); ;} break; - case 117: + case 120: /* Line 1455 of yacc.c */ -#line 1121 "program_parse.y" +#line 1160 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(3) - (4)].temp_sym); ;} break; - case 119: + case 122: /* Line 1455 of yacc.c */ -#line 1128 "program_parse.y" +#line 1167 "program_parse.y" { (yyvsp[(1) - (3)].temp_sym).param_binding_length += (yyvsp[(3) - (3)].temp_sym).param_binding_length; (yyval.temp_sym) = (yyvsp[(1) - (3)].temp_sym); ;} break; - case 120: + case 123: /* Line 1455 of yacc.c */ -#line 1135 "program_parse.y" +#line 1174 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3235,10 +3298,10 @@ yyreduce: ;} break; - case 121: + case 124: /* Line 1455 of yacc.c */ -#line 1141 "program_parse.y" +#line 1180 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3246,10 +3309,10 @@ yyreduce: ;} break; - case 122: + case 125: /* Line 1455 of yacc.c */ -#line 1147 "program_parse.y" +#line 1186 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3257,10 +3320,10 @@ yyreduce: ;} break; - case 123: + case 126: /* Line 1455 of yacc.c */ -#line 1155 "program_parse.y" +#line 1194 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3268,10 +3331,10 @@ yyreduce: ;} break; - case 124: + case 127: /* Line 1455 of yacc.c */ -#line 1161 "program_parse.y" +#line 1200 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3279,10 +3342,10 @@ yyreduce: ;} break; - case 125: + case 128: /* Line 1455 of yacc.c */ -#line 1167 "program_parse.y" +#line 1206 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3290,10 +3353,10 @@ yyreduce: ;} break; - case 126: + case 129: /* Line 1455 of yacc.c */ -#line 1175 "program_parse.y" +#line 1214 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3301,10 +3364,10 @@ yyreduce: ;} break; - case 127: + case 130: /* Line 1455 of yacc.c */ -#line 1181 "program_parse.y" +#line 1220 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3312,10 +3375,10 @@ yyreduce: ;} break; - case 128: + case 131: /* Line 1455 of yacc.c */ -#line 1187 "program_parse.y" +#line 1226 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3323,101 +3386,101 @@ yyreduce: ;} break; - case 129: + case 132: /* Line 1455 of yacc.c */ -#line 1194 "program_parse.y" +#line 1233 "program_parse.y" { memcpy((yyval.state), (yyvsp[(1) - (1)].state), sizeof((yyval.state))); ;} break; - case 130: + case 133: /* Line 1455 of yacc.c */ -#line 1195 "program_parse.y" +#line 1234 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 131: + case 134: /* Line 1455 of yacc.c */ -#line 1198 "program_parse.y" +#line 1237 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 132: + case 135: /* Line 1455 of yacc.c */ -#line 1199 "program_parse.y" +#line 1238 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 133: + case 136: /* Line 1455 of yacc.c */ -#line 1200 "program_parse.y" +#line 1239 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 134: + case 137: /* Line 1455 of yacc.c */ -#line 1201 "program_parse.y" +#line 1240 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 135: + case 138: /* Line 1455 of yacc.c */ -#line 1202 "program_parse.y" +#line 1241 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 136: + case 139: /* Line 1455 of yacc.c */ -#line 1203 "program_parse.y" +#line 1242 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 137: + case 140: /* Line 1455 of yacc.c */ -#line 1204 "program_parse.y" +#line 1243 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 138: + case 141: /* Line 1455 of yacc.c */ -#line 1205 "program_parse.y" +#line 1244 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 139: + case 142: /* Line 1455 of yacc.c */ -#line 1206 "program_parse.y" +#line 1245 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 140: + case 143: /* Line 1455 of yacc.c */ -#line 1207 "program_parse.y" +#line 1246 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 141: + case 144: /* Line 1455 of yacc.c */ -#line 1208 "program_parse.y" +#line 1247 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 142: + case 145: /* Line 1455 of yacc.c */ -#line 1212 "program_parse.y" +#line 1251 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_MATERIAL; @@ -3426,37 +3489,37 @@ yyreduce: ;} break; - case 143: + case 146: /* Line 1455 of yacc.c */ -#line 1221 "program_parse.y" +#line 1260 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 144: + case 147: /* Line 1455 of yacc.c */ -#line 1225 "program_parse.y" +#line 1264 "program_parse.y" { (yyval.integer) = STATE_EMISSION; ;} break; - case 145: + case 148: /* Line 1455 of yacc.c */ -#line 1229 "program_parse.y" +#line 1268 "program_parse.y" { (yyval.integer) = STATE_SHININESS; ;} break; - case 146: + case 149: /* Line 1455 of yacc.c */ -#line 1235 "program_parse.y" +#line 1274 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHT; @@ -3465,28 +3528,28 @@ yyreduce: ;} break; - case 147: + case 150: /* Line 1455 of yacc.c */ -#line 1244 "program_parse.y" +#line 1283 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 148: + case 151: /* Line 1455 of yacc.c */ -#line 1248 "program_parse.y" +#line 1287 "program_parse.y" { (yyval.integer) = STATE_POSITION; ;} break; - case 149: + case 152: /* Line 1455 of yacc.c */ -#line 1252 "program_parse.y" +#line 1291 "program_parse.y" { if (!state->ctx->Extensions.EXT_point_parameters) { yyerror(& (yylsp[(1) - (1)]), state, "GL_ARB_point_parameters not supported"); @@ -3497,57 +3560,57 @@ yyreduce: ;} break; - case 150: + case 153: /* Line 1455 of yacc.c */ -#line 1261 "program_parse.y" +#line 1300 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; - case 151: + case 154: /* Line 1455 of yacc.c */ -#line 1265 "program_parse.y" +#line 1304 "program_parse.y" { (yyval.integer) = STATE_HALF_VECTOR; ;} break; - case 152: + case 155: /* Line 1455 of yacc.c */ -#line 1271 "program_parse.y" +#line 1310 "program_parse.y" { (yyval.integer) = STATE_SPOT_DIRECTION; ;} break; - case 153: + case 156: /* Line 1455 of yacc.c */ -#line 1277 "program_parse.y" +#line 1316 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (2)].state)[1]; ;} break; - case 154: + case 157: /* Line 1455 of yacc.c */ -#line 1284 "program_parse.y" +#line 1323 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_AMBIENT; ;} break; - case 155: + case 158: /* Line 1455 of yacc.c */ -#line 1289 "program_parse.y" +#line 1328 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_SCENECOLOR; @@ -3555,10 +3618,10 @@ yyreduce: ;} break; - case 156: + case 159: /* Line 1455 of yacc.c */ -#line 1297 "program_parse.y" +#line 1336 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTPROD; @@ -3568,10 +3631,10 @@ yyreduce: ;} break; - case 158: + case 161: /* Line 1455 of yacc.c */ -#line 1309 "program_parse.y" +#line 1348 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(3) - (3)].integer); @@ -3579,46 +3642,46 @@ yyreduce: ;} break; - case 159: + case 162: /* Line 1455 of yacc.c */ -#line 1317 "program_parse.y" +#line 1356 "program_parse.y" { (yyval.integer) = STATE_TEXENV_COLOR; ;} break; - case 160: + case 163: /* Line 1455 of yacc.c */ -#line 1323 "program_parse.y" +#line 1362 "program_parse.y" { (yyval.integer) = STATE_AMBIENT; ;} break; - case 161: + case 164: /* Line 1455 of yacc.c */ -#line 1327 "program_parse.y" +#line 1366 "program_parse.y" { (yyval.integer) = STATE_DIFFUSE; ;} break; - case 162: + case 165: /* Line 1455 of yacc.c */ -#line 1331 "program_parse.y" +#line 1370 "program_parse.y" { (yyval.integer) = STATE_SPECULAR; ;} break; - case 163: + case 166: /* Line 1455 of yacc.c */ -#line 1337 "program_parse.y" +#line 1376 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxLights) { yyerror(& (yylsp[(1) - (1)]), state, "invalid light selector"); @@ -3629,10 +3692,10 @@ yyreduce: ;} break; - case 164: + case 167: /* Line 1455 of yacc.c */ -#line 1348 "program_parse.y" +#line 1387 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_TEXGEN; @@ -3641,92 +3704,92 @@ yyreduce: ;} break; - case 165: + case 168: /* Line 1455 of yacc.c */ -#line 1357 "program_parse.y" +#line 1396 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S; ;} break; - case 166: + case 169: /* Line 1455 of yacc.c */ -#line 1361 "program_parse.y" +#line 1400 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_OBJECT_S; ;} break; - case 167: + case 170: /* Line 1455 of yacc.c */ -#line 1366 "program_parse.y" +#line 1405 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S; ;} break; - case 168: + case 171: /* Line 1455 of yacc.c */ -#line 1370 "program_parse.y" +#line 1409 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S; ;} break; - case 169: + case 172: /* Line 1455 of yacc.c */ -#line 1374 "program_parse.y" +#line 1413 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S; ;} break; - case 170: + case 173: /* Line 1455 of yacc.c */ -#line 1378 "program_parse.y" +#line 1417 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S; ;} break; - case 171: + case 174: /* Line 1455 of yacc.c */ -#line 1384 "program_parse.y" +#line 1423 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); ;} break; - case 172: + case 175: /* Line 1455 of yacc.c */ -#line 1391 "program_parse.y" +#line 1430 "program_parse.y" { (yyval.integer) = STATE_FOG_COLOR; ;} break; - case 173: + case 176: /* Line 1455 of yacc.c */ -#line 1395 "program_parse.y" +#line 1434 "program_parse.y" { (yyval.integer) = STATE_FOG_PARAMS; ;} break; - case 174: + case 177: /* Line 1455 of yacc.c */ -#line 1401 "program_parse.y" +#line 1440 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_CLIPPLANE; @@ -3734,10 +3797,10 @@ yyreduce: ;} break; - case 175: + case 178: /* Line 1455 of yacc.c */ -#line 1409 "program_parse.y" +#line 1448 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxClipPlanes) { yyerror(& (yylsp[(1) - (1)]), state, "invalid clip plane selector"); @@ -3748,38 +3811,38 @@ yyreduce: ;} break; - case 176: + case 179: /* Line 1455 of yacc.c */ -#line 1420 "program_parse.y" +#line 1459 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); ;} break; - case 177: + case 180: /* Line 1455 of yacc.c */ -#line 1427 "program_parse.y" +#line 1466 "program_parse.y" { (yyval.integer) = STATE_POINT_SIZE; ;} break; - case 178: + case 181: /* Line 1455 of yacc.c */ -#line 1431 "program_parse.y" +#line 1470 "program_parse.y" { (yyval.integer) = STATE_POINT_ATTENUATION; ;} break; - case 179: + case 182: /* Line 1455 of yacc.c */ -#line 1437 "program_parse.y" +#line 1476 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (5)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (5)].state)[1]; @@ -3789,10 +3852,10 @@ yyreduce: ;} break; - case 180: + case 183: /* Line 1455 of yacc.c */ -#line 1447 "program_parse.y" +#line 1486 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (2)].state)[1]; @@ -3802,20 +3865,20 @@ yyreduce: ;} break; - case 181: + case 184: /* Line 1455 of yacc.c */ -#line 1457 "program_parse.y" +#line 1496 "program_parse.y" { (yyval.state)[2] = 0; (yyval.state)[3] = 3; ;} break; - case 182: + case 185: /* Line 1455 of yacc.c */ -#line 1462 "program_parse.y" +#line 1501 "program_parse.y" { /* It seems logical that the matrix row range specifier would have * to specify a range or more than one row (i.e., $5 > $3). @@ -3833,10 +3896,10 @@ yyreduce: ;} break; - case 183: + case 186: /* Line 1455 of yacc.c */ -#line 1480 "program_parse.y" +#line 1519 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (3)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (3)].state)[1]; @@ -3844,55 +3907,55 @@ yyreduce: ;} break; - case 184: + case 187: /* Line 1455 of yacc.c */ -#line 1488 "program_parse.y" +#line 1527 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 185: + case 188: /* Line 1455 of yacc.c */ -#line 1492 "program_parse.y" +#line 1531 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 186: + case 189: /* Line 1455 of yacc.c */ -#line 1498 "program_parse.y" +#line 1537 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVERSE; ;} break; - case 187: + case 190: /* Line 1455 of yacc.c */ -#line 1502 "program_parse.y" +#line 1541 "program_parse.y" { (yyval.integer) = STATE_MATRIX_TRANSPOSE; ;} break; - case 188: + case 191: /* Line 1455 of yacc.c */ -#line 1506 "program_parse.y" +#line 1545 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVTRANS; ;} break; - case 189: + case 192: /* Line 1455 of yacc.c */ -#line 1512 "program_parse.y" +#line 1551 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) > 3) { yyerror(& (yylsp[(1) - (1)]), state, "invalid matrix row reference"); @@ -3903,88 +3966,88 @@ yyreduce: ;} break; - case 190: + case 193: /* Line 1455 of yacc.c */ -#line 1523 "program_parse.y" +#line 1562 "program_parse.y" { (yyval.state)[0] = STATE_MODELVIEW_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); ;} break; - case 191: + case 194: /* Line 1455 of yacc.c */ -#line 1528 "program_parse.y" +#line 1567 "program_parse.y" { (yyval.state)[0] = STATE_PROJECTION_MATRIX; (yyval.state)[1] = 0; ;} break; - case 192: + case 195: /* Line 1455 of yacc.c */ -#line 1533 "program_parse.y" +#line 1572 "program_parse.y" { (yyval.state)[0] = STATE_MVP_MATRIX; (yyval.state)[1] = 0; ;} break; - case 193: + case 196: /* Line 1455 of yacc.c */ -#line 1538 "program_parse.y" +#line 1577 "program_parse.y" { (yyval.state)[0] = STATE_TEXTURE_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); ;} break; - case 194: + case 197: /* Line 1455 of yacc.c */ -#line 1543 "program_parse.y" +#line 1582 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; ;} break; - case 195: + case 198: /* Line 1455 of yacc.c */ -#line 1548 "program_parse.y" +#line 1587 "program_parse.y" { (yyval.state)[0] = STATE_PROGRAM_MATRIX; (yyval.state)[1] = (yyvsp[(3) - (4)].integer); ;} break; - case 196: + case 199: /* Line 1455 of yacc.c */ -#line 1555 "program_parse.y" +#line 1594 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 197: + case 200: /* Line 1455 of yacc.c */ -#line 1559 "program_parse.y" +#line 1598 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 198: + case 201: /* Line 1455 of yacc.c */ -#line 1564 "program_parse.y" +#line 1603 "program_parse.y" { /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix * zero is valid. @@ -3998,10 +4061,10 @@ yyreduce: ;} break; - case 199: + case 202: /* Line 1455 of yacc.c */ -#line 1577 "program_parse.y" +#line 1616 "program_parse.y" { /* Since GL_ARB_matrix_palette isn't supported, just let any value * through here. The error will be generated later. @@ -4010,10 +4073,10 @@ yyreduce: ;} break; - case 200: + case 203: /* Line 1455 of yacc.c */ -#line 1585 "program_parse.y" +#line 1624 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxProgramMatrices) { yyerror(& (yylsp[(1) - (1)]), state, "invalid program matrix selector"); @@ -4024,20 +4087,20 @@ yyreduce: ;} break; - case 201: + case 204: /* Line 1455 of yacc.c */ -#line 1596 "program_parse.y" +#line 1635 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_DEPTH_RANGE; ;} break; - case 206: + case 209: /* Line 1455 of yacc.c */ -#line 1608 "program_parse.y" +#line 1647 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4047,30 +4110,30 @@ yyreduce: ;} break; - case 207: + case 210: /* Line 1455 of yacc.c */ -#line 1618 "program_parse.y" +#line 1657 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); ;} break; - case 208: + case 211: /* Line 1455 of yacc.c */ -#line 1623 "program_parse.y" +#line 1662 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); ;} break; - case 209: + case 212: /* Line 1455 of yacc.c */ -#line 1630 "program_parse.y" +#line 1669 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4080,10 +4143,10 @@ yyreduce: ;} break; - case 210: + case 213: /* Line 1455 of yacc.c */ -#line 1640 "program_parse.y" +#line 1679 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4093,30 +4156,30 @@ yyreduce: ;} break; - case 211: + case 214: /* Line 1455 of yacc.c */ -#line 1649 "program_parse.y" +#line 1688 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); ;} break; - case 212: + case 215: /* Line 1455 of yacc.c */ -#line 1654 "program_parse.y" +#line 1693 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); ;} break; - case 213: + case 216: /* Line 1455 of yacc.c */ -#line 1661 "program_parse.y" +#line 1700 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4126,10 +4189,10 @@ yyreduce: ;} break; - case 214: + case 217: /* Line 1455 of yacc.c */ -#line 1671 "program_parse.y" +#line 1710 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxEnvParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid environment parameter reference"); @@ -4139,10 +4202,10 @@ yyreduce: ;} break; - case 215: + case 218: /* Line 1455 of yacc.c */ -#line 1681 "program_parse.y" +#line 1720 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxLocalParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid local parameter reference"); @@ -4152,10 +4215,10 @@ yyreduce: ;} break; - case 220: + case 223: /* Line 1455 of yacc.c */ -#line 1696 "program_parse.y" +#line 1735 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -4165,10 +4228,10 @@ yyreduce: ;} break; - case 221: + case 224: /* Line 1455 of yacc.c */ -#line 1706 "program_parse.y" +#line 1745 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -4178,10 +4241,10 @@ yyreduce: ;} break; - case 222: + case 225: /* Line 1455 of yacc.c */ -#line 1714 "program_parse.y" +#line 1753 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (float) (yyvsp[(1) - (1)].integer); @@ -4191,10 +4254,10 @@ yyreduce: ;} break; - case 223: + case 226: /* Line 1455 of yacc.c */ -#line 1724 "program_parse.y" +#line 1763 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (3)].real); @@ -4204,10 +4267,10 @@ yyreduce: ;} break; - case 224: + case 227: /* Line 1455 of yacc.c */ -#line 1732 "program_parse.y" +#line 1771 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (5)].real); @@ -4217,10 +4280,10 @@ yyreduce: ;} break; - case 225: + case 228: /* Line 1455 of yacc.c */ -#line 1741 "program_parse.y" +#line 1780 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (7)].real); @@ -4230,10 +4293,10 @@ yyreduce: ;} break; - case 226: + case 229: /* Line 1455 of yacc.c */ -#line 1750 "program_parse.y" +#line 1789 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (9)].real); @@ -4243,63 +4306,63 @@ yyreduce: ;} break; - case 227: + case 230: /* Line 1455 of yacc.c */ -#line 1760 "program_parse.y" +#line 1799 "program_parse.y" { (yyval.real) = ((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].real) : (yyvsp[(2) - (2)].real); ;} break; - case 228: + case 231: /* Line 1455 of yacc.c */ -#line 1764 "program_parse.y" +#line 1803 "program_parse.y" { (yyval.real) = (float)(((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].integer) : (yyvsp[(2) - (2)].integer)); ;} break; - case 229: + case 232: /* Line 1455 of yacc.c */ -#line 1769 "program_parse.y" +#line 1808 "program_parse.y" { (yyval.negate) = FALSE; ;} break; - case 230: + case 233: /* Line 1455 of yacc.c */ -#line 1770 "program_parse.y" +#line 1809 "program_parse.y" { (yyval.negate) = TRUE; ;} break; - case 231: + case 234: /* Line 1455 of yacc.c */ -#line 1771 "program_parse.y" +#line 1810 "program_parse.y" { (yyval.negate) = FALSE; ;} break; - case 232: + case 235: /* Line 1455 of yacc.c */ -#line 1774 "program_parse.y" +#line 1813 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 234: + case 237: /* Line 1455 of yacc.c */ -#line 1777 "program_parse.y" +#line 1816 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 236: + case 239: /* Line 1455 of yacc.c */ -#line 1781 "program_parse.y" +#line 1820 "program_parse.y" { if (!declare_variable(state, (yyvsp[(3) - (3)].string), (yyvsp[(0) - (3)].integer), & (yylsp[(3) - (3)]))) { YYERROR; @@ -4307,10 +4370,10 @@ yyreduce: ;} break; - case 237: + case 240: /* Line 1455 of yacc.c */ -#line 1787 "program_parse.y" +#line 1826 "program_parse.y" { if (!declare_variable(state, (yyvsp[(1) - (1)].string), (yyvsp[(0) - (1)].integer), & (yylsp[(1) - (1)]))) { YYERROR; @@ -4318,10 +4381,10 @@ yyreduce: ;} break; - case 238: + case 241: /* Line 1455 of yacc.c */ -#line 1795 "program_parse.y" +#line 1834 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_output, & (yylsp[(2) - (4)])); @@ -4334,10 +4397,10 @@ yyreduce: ;} break; - case 239: + case 242: /* Line 1455 of yacc.c */ -#line 1808 "program_parse.y" +#line 1847 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_HPOS; @@ -4348,10 +4411,10 @@ yyreduce: ;} break; - case 240: + case 243: /* Line 1455 of yacc.c */ -#line 1817 "program_parse.y" +#line 1856 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_FOGC; @@ -4362,19 +4425,19 @@ yyreduce: ;} break; - case 241: + case 244: /* Line 1455 of yacc.c */ -#line 1826 "program_parse.y" +#line 1865 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (2)].result); ;} break; - case 242: + case 245: /* Line 1455 of yacc.c */ -#line 1830 "program_parse.y" +#line 1869 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_PSIZ; @@ -4385,10 +4448,10 @@ yyreduce: ;} break; - case 243: + case 246: /* Line 1455 of yacc.c */ -#line 1839 "program_parse.y" +#line 1878 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_TEX0 + (yyvsp[(3) - (3)].integer); @@ -4399,10 +4462,10 @@ yyreduce: ;} break; - case 244: + case 247: /* Line 1455 of yacc.c */ -#line 1848 "program_parse.y" +#line 1887 "program_parse.y" { if (state->mode == ARB_fragment) { (yyval.result) = FRAG_RESULT_DEPTH; @@ -4413,19 +4476,19 @@ yyreduce: ;} break; - case 245: + case 248: /* Line 1455 of yacc.c */ -#line 1859 "program_parse.y" +#line 1898 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (3)].integer) + (yyvsp[(3) - (3)].integer); ;} break; - case 246: + case 249: /* Line 1455 of yacc.c */ -#line 1865 "program_parse.y" +#line 1904 "program_parse.y" { (yyval.integer) = (state->mode == ARB_vertex) ? VERT_RESULT_COL0 @@ -4433,10 +4496,10 @@ yyreduce: ;} break; - case 247: + case 250: /* Line 1455 of yacc.c */ -#line 1871 "program_parse.y" +#line 1910 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_COL0; @@ -4447,10 +4510,10 @@ yyreduce: ;} break; - case 248: + case 251: /* Line 1455 of yacc.c */ -#line 1880 "program_parse.y" +#line 1919 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_BFC0; @@ -4461,19 +4524,19 @@ yyreduce: ;} break; - case 249: + case 252: /* Line 1455 of yacc.c */ -#line 1891 "program_parse.y" +#line 1930 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 250: + case 253: /* Line 1455 of yacc.c */ -#line 1895 "program_parse.y" +#line 1934 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 0; @@ -4484,10 +4547,10 @@ yyreduce: ;} break; - case 251: + case 254: /* Line 1455 of yacc.c */ -#line 1904 "program_parse.y" +#line 1943 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 1; @@ -4498,94 +4561,94 @@ yyreduce: ;} break; - case 252: + case 255: /* Line 1455 of yacc.c */ -#line 1914 "program_parse.y" +#line 1953 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 253: + case 256: /* Line 1455 of yacc.c */ -#line 1915 "program_parse.y" +#line 1954 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 254: + case 257: /* Line 1455 of yacc.c */ -#line 1916 "program_parse.y" +#line 1955 "program_parse.y" { (yyval.integer) = 1; ;} break; - case 255: + case 258: /* Line 1455 of yacc.c */ -#line 1919 "program_parse.y" +#line 1958 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 256: + case 259: /* Line 1455 of yacc.c */ -#line 1920 "program_parse.y" +#line 1959 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 257: + case 260: /* Line 1455 of yacc.c */ -#line 1921 "program_parse.y" +#line 1960 "program_parse.y" { (yyval.integer) = 1; ;} break; - case 258: + case 261: /* Line 1455 of yacc.c */ -#line 1924 "program_parse.y" +#line 1963 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 259: + case 262: /* Line 1455 of yacc.c */ -#line 1925 "program_parse.y" +#line 1964 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 260: + case 263: /* Line 1455 of yacc.c */ -#line 1928 "program_parse.y" +#line 1967 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 261: + case 264: /* Line 1455 of yacc.c */ -#line 1929 "program_parse.y" +#line 1968 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 262: + case 265: /* Line 1455 of yacc.c */ -#line 1932 "program_parse.y" +#line 1971 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 263: + case 266: /* Line 1455 of yacc.c */ -#line 1933 "program_parse.y" +#line 1972 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 264: + case 267: /* Line 1455 of yacc.c */ -#line 1937 "program_parse.y" +#line 1976 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture coordinate unit selector"); @@ -4596,10 +4659,10 @@ yyreduce: ;} break; - case 265: + case 268: /* Line 1455 of yacc.c */ -#line 1948 "program_parse.y" +#line 1987 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture image unit selector"); @@ -4610,10 +4673,10 @@ yyreduce: ;} break; - case 266: + case 269: /* Line 1455 of yacc.c */ -#line 1959 "program_parse.y" +#line 1998 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture unit selector"); @@ -4624,10 +4687,10 @@ yyreduce: ;} break; - case 267: + case 270: /* Line 1455 of yacc.c */ -#line 1970 "program_parse.y" +#line 2009 "program_parse.y" { struct asm_symbol *exist = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(2) - (4)].string)); @@ -4651,7 +4714,7 @@ yyreduce: /* Line 1455 of yacc.c */ -#line 4655 "program_parse.tab.c" +#line 4718 "program_parse.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -4870,7 +4933,7 @@ yyreturn: /* Line 1675 of yacc.c */ -#line 1990 "program_parse.y" +#line 2029 "program_parse.y" struct asm_instruction * diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index fa94f763c4..32aa9d503f 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -181,7 +181,7 @@ static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, %type KIL_instruction %type dstReg maskedDstReg maskedAddrReg -%type srcReg scalarSrcReg swizzleSrcReg +%type srcReg scalarUse scalarSrcReg swizzleSrcReg %type scalarSuffix swizzleSuffix extendedSwizzle %type extSwizComp extSwizSel %type optionalMask @@ -523,29 +523,50 @@ SWZ_instruction: SWZ maskedDstReg ',' srcReg ',' extendedSwizzle } ; -scalarSrcReg: optionalSign srcReg scalarSuffix +scalarSrcReg: optionalSign scalarUse { $$ = $2; if ($1) { $$.Base.Negate = ~$$.Base.Negate; } + } + | optionalSign '|' scalarUse '|' + { + $$ = $3; + + if (!state->option.NV_fragment) { + yyerror(& @2, state, "unexpected character '|'"); + YYERROR; + } + + if ($1) { + $$.Base.Negate = ~$$.Base.Negate; + } + + $$.Base.Abs = 1; + } + ; + +scalarUse: srcReg scalarSuffix + { + $$ = $1; $$.Base.Swizzle = _mesa_combine_swizzles($$.Base.Swizzle, - $3.swizzle); + $2.swizzle); } - | optionalSign paramConstScalarUse + | paramConstScalarUse { struct asm_symbol temp_sym; if (!state->option.NV_fragment) { - yyerror(& @2, state, "expected scalar suffix"); + yyerror(& @1, state, "expected scalar suffix"); YYERROR; } memset(& temp_sym, 0, sizeof(temp_sym)); temp_sym.param_binding_begin = ~0; - initialize_symbol_from_const(state->prog, & temp_sym, & $2); + initialize_symbol_from_const(state->prog, & temp_sym, & $1); init_src_reg(& $$); $$.Base.File = PROGRAM_CONSTANT; @@ -564,6 +585,24 @@ swizzleSrcReg: optionalSign srcReg swizzleSuffix $$.Base.Swizzle = _mesa_combine_swizzles($$.Base.Swizzle, $3.swizzle); } + | optionalSign '|' srcReg swizzleSuffix '|' + { + $$ = $3; + + if (!state->option.NV_fragment) { + yyerror(& @2, state, "unexpected character '|'"); + YYERROR; + } + + if ($1) { + $$.Base.Negate = ~$$.Base.Negate; + } + + $$.Base.Abs = 1; + $$.Base.Swizzle = _mesa_combine_swizzles($$.Base.Swizzle, + $4.swizzle); + } + ; maskedDstReg: dstReg optionalMask -- cgit v1.2.3 From 9ea4319744fb7474635cb1994e1babe1552d4d4f Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 4 Sep 2009 16:35:50 -0700 Subject: ARB prog parser: Add new constructor for asm_instruction The new constructor copies fields from the prog_instruction that the parser expects the lexer to set. --- src/mesa/shader/program_parse.tab.c | 621 +++++++++++++++++++----------------- src/mesa/shader/program_parse.tab.h | 2 +- src/mesa/shader/program_parse.y | 111 ++++--- 3 files changed, 400 insertions(+), 334 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 505a1eb94f..b9a0e557ad 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -139,10 +139,19 @@ static void init_dst_reg(struct prog_dst_register *r); static void init_src_reg(struct asm_src_register *r); +static void asm_instruction_set_operands(struct asm_instruction *inst, + const struct prog_dst_register *dst, const struct asm_src_register *src0, + const struct asm_src_register *src1, const struct asm_src_register *src2); + static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, const struct prog_dst_register *dst, const struct asm_src_register *src0, const struct asm_src_register *src1, const struct asm_src_register *src2); +static struct asm_instruction *asm_instruction_copy_ctor( + const struct prog_instruction *base, const struct prog_dst_register *dst, + const struct asm_src_register *src0, const struct asm_src_register *src1, + const struct asm_src_register *src2); + #ifndef FALSE #define FALSE 0 #define TRUE (!FALSE) @@ -170,7 +179,7 @@ static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, /* Line 189 of yacc.c */ -#line 174 "program_parse.tab.c" +#line 183 "program_parse.tab.c" /* Enabling traces. */ #ifndef YYDEBUG @@ -311,7 +320,7 @@ typedef union YYSTYPE { /* Line 214 of yacc.c */ -#line 107 "program_parse.y" +#line 116 "program_parse.y" struct asm_instruction *inst; struct asm_symbol *sym; @@ -340,7 +349,7 @@ typedef union YYSTYPE /* Line 214 of yacc.c */ -#line 344 "program_parse.tab.c" +#line 353 "program_parse.tab.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -364,14 +373,14 @@ typedef struct YYLTYPE /* Copy the second part of user declarations. */ /* Line 264 of yacc.c */ -#line 249 "program_parse.y" +#line 258 "program_parse.y" extern int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, void *yyscanner); /* Line 264 of yacc.c */ -#line 375 "program_parse.tab.c" +#line 384 "program_parse.tab.c" #ifdef short # undef short @@ -768,34 +777,34 @@ static const yytype_int16 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 256, 256, 259, 267, 279, 280, 283, 305, 306, - 309, 324, 327, 332, 339, 340, 341, 342, 343, 344, - 345, 348, 349, 350, 353, 359, 366, 373, 381, 388, - 396, 441, 448, 493, 499, 500, 501, 502, 503, 504, - 505, 506, 507, 508, 509, 510, 513, 526, 534, 551, - 558, 577, 588, 608, 630, 639, 672, 679, 694, 744, - 786, 797, 818, 828, 834, 865, 882, 882, 884, 891, - 903, 904, 905, 908, 920, 932, 950, 961, 973, 975, - 976, 977, 978, 981, 981, 981, 981, 982, 985, 986, - 987, 988, 989, 990, 993, 1011, 1015, 1021, 1025, 1029, - 1033, 1042, 1051, 1055, 1060, 1066, 1077, 1077, 1078, 1080, - 1084, 1088, 1092, 1098, 1098, 1100, 1116, 1139, 1142, 1153, - 1159, 1165, 1166, 1173, 1179, 1185, 1193, 1199, 1205, 1213, - 1219, 1225, 1233, 1234, 1237, 1238, 1239, 1240, 1241, 1242, - 1243, 1244, 1245, 1246, 1247, 1250, 1259, 1263, 1267, 1273, - 1282, 1286, 1290, 1299, 1303, 1309, 1315, 1322, 1327, 1335, - 1345, 1347, 1355, 1361, 1365, 1369, 1375, 1386, 1395, 1399, - 1404, 1408, 1412, 1416, 1422, 1429, 1433, 1439, 1447, 1458, - 1465, 1469, 1475, 1485, 1496, 1500, 1518, 1527, 1530, 1536, - 1540, 1544, 1550, 1561, 1566, 1571, 1576, 1581, 1586, 1594, - 1597, 1602, 1615, 1623, 1634, 1642, 1642, 1644, 1644, 1646, - 1656, 1661, 1668, 1678, 1687, 1692, 1699, 1709, 1719, 1731, - 1731, 1732, 1732, 1734, 1744, 1752, 1762, 1770, 1778, 1787, - 1798, 1802, 1808, 1809, 1810, 1813, 1813, 1816, 1816, 1819, - 1825, 1833, 1846, 1855, 1864, 1868, 1877, 1886, 1897, 1904, - 1909, 1918, 1930, 1933, 1942, 1953, 1954, 1955, 1958, 1959, - 1960, 1963, 1964, 1967, 1968, 1971, 1972, 1975, 1986, 1997, - 2008 + 0, 265, 265, 268, 276, 288, 289, 292, 314, 315, + 318, 333, 336, 341, 348, 349, 350, 351, 352, 353, + 354, 357, 358, 359, 362, 368, 374, 380, 387, 393, + 400, 444, 451, 495, 501, 502, 503, 504, 505, 506, + 507, 508, 509, 510, 511, 512, 515, 527, 535, 552, + 559, 578, 589, 609, 631, 640, 673, 680, 695, 745, + 787, 798, 819, 829, 835, 866, 883, 883, 885, 892, + 904, 905, 906, 909, 921, 933, 951, 962, 974, 976, + 977, 978, 979, 982, 982, 982, 982, 983, 986, 987, + 988, 989, 990, 991, 994, 1012, 1016, 1022, 1026, 1030, + 1034, 1043, 1052, 1056, 1061, 1067, 1078, 1078, 1079, 1081, + 1085, 1089, 1093, 1099, 1099, 1101, 1117, 1140, 1143, 1154, + 1160, 1166, 1167, 1174, 1180, 1186, 1194, 1200, 1206, 1214, + 1220, 1226, 1234, 1235, 1238, 1239, 1240, 1241, 1242, 1243, + 1244, 1245, 1246, 1247, 1248, 1251, 1260, 1264, 1268, 1274, + 1283, 1287, 1291, 1300, 1304, 1310, 1316, 1323, 1328, 1336, + 1346, 1348, 1356, 1362, 1366, 1370, 1376, 1387, 1396, 1400, + 1405, 1409, 1413, 1417, 1423, 1430, 1434, 1440, 1448, 1459, + 1466, 1470, 1476, 1486, 1497, 1501, 1519, 1528, 1531, 1537, + 1541, 1545, 1551, 1562, 1567, 1572, 1577, 1582, 1587, 1595, + 1598, 1603, 1616, 1624, 1635, 1643, 1643, 1645, 1645, 1647, + 1657, 1662, 1669, 1679, 1688, 1693, 1700, 1710, 1720, 1732, + 1732, 1733, 1733, 1735, 1745, 1753, 1763, 1771, 1779, 1788, + 1799, 1803, 1809, 1810, 1811, 1814, 1814, 1817, 1817, 1820, + 1826, 1834, 1847, 1856, 1865, 1869, 1878, 1887, 1898, 1905, + 1910, 1919, 1931, 1934, 1943, 1954, 1955, 1956, 1959, 1960, + 1961, 1964, 1965, 1968, 1969, 1972, 1973, 1976, 1987, 1998, + 2009 }; #endif @@ -2088,7 +2097,7 @@ yyreduce: case 3: /* Line 1455 of yacc.c */ -#line 260 "program_parse.y" +#line 269 "program_parse.y" { if (state->prog->Target != GL_VERTEX_PROGRAM_ARB) { yyerror(& (yylsp[(1) - (1)]), state, "invalid fragment program header"); @@ -2101,7 +2110,7 @@ yyreduce: case 4: /* Line 1455 of yacc.c */ -#line 268 "program_parse.y" +#line 277 "program_parse.y" { if (state->prog->Target != GL_FRAGMENT_PROGRAM_ARB) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex program header"); @@ -2116,7 +2125,7 @@ yyreduce: case 7: /* Line 1455 of yacc.c */ -#line 284 "program_parse.y" +#line 293 "program_parse.y" { int valid = 0; @@ -2141,7 +2150,7 @@ yyreduce: case 10: /* Line 1455 of yacc.c */ -#line 310 "program_parse.y" +#line 319 "program_parse.y" { if ((yyvsp[(1) - (2)].inst) != NULL) { if (state->inst_tail == NULL) { @@ -2161,7 +2170,7 @@ yyreduce: case 12: /* Line 1455 of yacc.c */ -#line 328 "program_parse.y" +#line 337 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumAluInstructions++; @@ -2171,7 +2180,7 @@ yyreduce: case 13: /* Line 1455 of yacc.c */ -#line 333 "program_parse.y" +#line 342 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumTexInstructions++; @@ -2181,7 +2190,7 @@ yyreduce: case 24: /* Line 1455 of yacc.c */ -#line 354 "program_parse.y" +#line 363 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_ARL, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} @@ -2190,66 +2199,60 @@ yyreduce: case 25: /* Line 1455 of yacc.c */ -#line 360 "program_parse.y" +#line 369 "program_parse.y" { - (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (4)].temp_inst).Opcode, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); - (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (4)].temp_inst).SaturateMode; + (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (4)].temp_inst), & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} break; case 26: /* Line 1455 of yacc.c */ -#line 367 "program_parse.y" +#line 375 "program_parse.y" { - (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (4)].temp_inst).Opcode, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); - (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (4)].temp_inst).SaturateMode; + (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (4)].temp_inst), & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} break; case 27: /* Line 1455 of yacc.c */ -#line 374 "program_parse.y" +#line 381 "program_parse.y" { - (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (6)].temp_inst).Opcode, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); - (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; + (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (6)].temp_inst), & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); ;} break; case 28: /* Line 1455 of yacc.c */ -#line 382 "program_parse.y" +#line 388 "program_parse.y" { - (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (6)].temp_inst).Opcode, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); - (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; + (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (6)].temp_inst), & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); ;} break; case 29: /* Line 1455 of yacc.c */ -#line 390 "program_parse.y" +#line 395 "program_parse.y" { - (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (8)].temp_inst).Opcode, & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), & (yyvsp[(6) - (8)].src_reg), & (yyvsp[(8) - (8)].src_reg)); - (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (8)].temp_inst).SaturateMode; + (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (8)].temp_inst), & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), & (yyvsp[(6) - (8)].src_reg), & (yyvsp[(8) - (8)].src_reg)); ;} break; case 30: /* Line 1455 of yacc.c */ -#line 397 "program_parse.y" +#line 401 "program_parse.y" { - (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (8)].temp_inst).Opcode, & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), NULL, NULL); + (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (8)].temp_inst), & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), NULL, NULL); if ((yyval.inst) != NULL) { const GLbitfield tex_mask = (1U << (yyvsp[(6) - (8)].integer)); GLbitfield shadow_tex = 0; GLbitfield target_mask = 0; - (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (8)].temp_inst).SaturateMode; (yyval.inst)->Base.TexSrcUnit = (yyvsp[(6) - (8)].integer); if ((yyvsp[(8) - (8)].integer) < 0) { @@ -2288,7 +2291,7 @@ yyreduce: case 31: /* Line 1455 of yacc.c */ -#line 442 "program_parse.y" +#line 445 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_KIL, NULL, & (yyvsp[(2) - (2)].src_reg), NULL, NULL); state->fragment.UsesKill = 1; @@ -2298,16 +2301,15 @@ yyreduce: case 32: /* Line 1455 of yacc.c */ -#line 449 "program_parse.y" +#line 452 "program_parse.y" { - (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (12)].temp_inst).Opcode, & (yyvsp[(2) - (12)].dst_reg), & (yyvsp[(4) - (12)].src_reg), & (yyvsp[(6) - (12)].src_reg), & (yyvsp[(8) - (12)].src_reg)); + (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (12)].temp_inst), & (yyvsp[(2) - (12)].dst_reg), & (yyvsp[(4) - (12)].src_reg), & (yyvsp[(6) - (12)].src_reg), & (yyvsp[(8) - (12)].src_reg)); if ((yyval.inst) != NULL) { const GLbitfield tex_mask = (1U << (yyvsp[(10) - (12)].integer)); GLbitfield shadow_tex = 0; GLbitfield target_mask = 0; - (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (12)].temp_inst).SaturateMode; (yyval.inst)->Base.TexSrcUnit = (yyvsp[(10) - (12)].integer); if ((yyvsp[(12) - (12)].integer) < 0) { @@ -2346,7 +2348,7 @@ yyreduce: case 33: /* Line 1455 of yacc.c */ -#line 494 "program_parse.y" +#line 496 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} @@ -2355,91 +2357,91 @@ yyreduce: case 34: /* Line 1455 of yacc.c */ -#line 499 "program_parse.y" +#line 501 "program_parse.y" { (yyval.integer) = TEXTURE_1D_INDEX; ;} break; case 35: /* Line 1455 of yacc.c */ -#line 500 "program_parse.y" +#line 502 "program_parse.y" { (yyval.integer) = TEXTURE_2D_INDEX; ;} break; case 36: /* Line 1455 of yacc.c */ -#line 501 "program_parse.y" +#line 503 "program_parse.y" { (yyval.integer) = TEXTURE_3D_INDEX; ;} break; case 37: /* Line 1455 of yacc.c */ -#line 502 "program_parse.y" +#line 504 "program_parse.y" { (yyval.integer) = TEXTURE_CUBE_INDEX; ;} break; case 38: /* Line 1455 of yacc.c */ -#line 503 "program_parse.y" +#line 505 "program_parse.y" { (yyval.integer) = TEXTURE_RECT_INDEX; ;} break; case 39: /* Line 1455 of yacc.c */ -#line 504 "program_parse.y" +#line 506 "program_parse.y" { (yyval.integer) = -TEXTURE_1D_INDEX; ;} break; case 40: /* Line 1455 of yacc.c */ -#line 505 "program_parse.y" +#line 507 "program_parse.y" { (yyval.integer) = -TEXTURE_2D_INDEX; ;} break; case 41: /* Line 1455 of yacc.c */ -#line 506 "program_parse.y" +#line 508 "program_parse.y" { (yyval.integer) = -TEXTURE_RECT_INDEX; ;} break; case 42: /* Line 1455 of yacc.c */ -#line 507 "program_parse.y" +#line 509 "program_parse.y" { (yyval.integer) = TEXTURE_1D_ARRAY_INDEX; ;} break; case 43: /* Line 1455 of yacc.c */ -#line 508 "program_parse.y" +#line 510 "program_parse.y" { (yyval.integer) = TEXTURE_2D_ARRAY_INDEX; ;} break; case 44: /* Line 1455 of yacc.c */ -#line 509 "program_parse.y" +#line 511 "program_parse.y" { (yyval.integer) = -TEXTURE_1D_ARRAY_INDEX; ;} break; case 45: /* Line 1455 of yacc.c */ -#line 510 "program_parse.y" +#line 512 "program_parse.y" { (yyval.integer) = -TEXTURE_2D_ARRAY_INDEX; ;} break; case 46: /* Line 1455 of yacc.c */ -#line 514 "program_parse.y" +#line 516 "program_parse.y" { /* FIXME: Is this correct? Should the extenedSwizzle be applied * FIXME: to the existing swizzle? @@ -2447,15 +2449,14 @@ yyreduce: (yyvsp[(4) - (6)].src_reg).Base.Swizzle = (yyvsp[(6) - (6)].swiz_mask).swizzle; (yyvsp[(4) - (6)].src_reg).Base.Negate = (yyvsp[(6) - (6)].swiz_mask).mask; - (yyval.inst) = asm_instruction_ctor(OPCODE_SWZ, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), NULL, NULL); - (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; + (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (6)].temp_inst), & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), NULL, NULL); ;} break; case 47: /* Line 1455 of yacc.c */ -#line 527 "program_parse.y" +#line 528 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (2)].src_reg); @@ -2468,7 +2469,7 @@ yyreduce: case 48: /* Line 1455 of yacc.c */ -#line 535 "program_parse.y" +#line 536 "program_parse.y" { (yyval.src_reg) = (yyvsp[(3) - (4)].src_reg); @@ -2488,7 +2489,7 @@ yyreduce: case 49: /* Line 1455 of yacc.c */ -#line 552 "program_parse.y" +#line 553 "program_parse.y" { (yyval.src_reg) = (yyvsp[(1) - (2)].src_reg); @@ -2500,7 +2501,7 @@ yyreduce: case 50: /* Line 1455 of yacc.c */ -#line 559 "program_parse.y" +#line 560 "program_parse.y" { struct asm_symbol temp_sym; @@ -2522,7 +2523,7 @@ yyreduce: case 51: /* Line 1455 of yacc.c */ -#line 578 "program_parse.y" +#line 579 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); @@ -2538,7 +2539,7 @@ yyreduce: case 52: /* Line 1455 of yacc.c */ -#line 589 "program_parse.y" +#line 590 "program_parse.y" { (yyval.src_reg) = (yyvsp[(3) - (5)].src_reg); @@ -2560,7 +2561,7 @@ yyreduce: case 53: /* Line 1455 of yacc.c */ -#line 609 "program_parse.y" +#line 610 "program_parse.y" { (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); (yyval.dst_reg).WriteMask = (yyvsp[(2) - (2)].swiz_mask).mask; @@ -2585,7 +2586,7 @@ yyreduce: case 54: /* Line 1455 of yacc.c */ -#line 631 "program_parse.y" +#line 632 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_ADDRESS; @@ -2597,7 +2598,7 @@ yyreduce: case 55: /* Line 1455 of yacc.c */ -#line 640 "program_parse.y" +#line 641 "program_parse.y" { const unsigned xyzw_valid = ((yyvsp[(1) - (7)].ext_swizzle).xyzw_valid << 0) @@ -2633,7 +2634,7 @@ yyreduce: case 56: /* Line 1455 of yacc.c */ -#line 673 "program_parse.y" +#line 674 "program_parse.y" { (yyval.ext_swizzle) = (yyvsp[(2) - (2)].ext_swizzle); (yyval.ext_swizzle).negate = ((yyvsp[(1) - (2)].negate)) ? 1 : 0; @@ -2643,7 +2644,7 @@ yyreduce: case 57: /* Line 1455 of yacc.c */ -#line 680 "program_parse.y" +#line 681 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) != 0) && ((yyvsp[(1) - (1)].integer) != 1)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2663,7 +2664,7 @@ yyreduce: case 58: /* Line 1455 of yacc.c */ -#line 695 "program_parse.y" +#line 696 "program_parse.y" { if (strlen((yyvsp[(1) - (1)].string)) > 1) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2716,7 +2717,7 @@ yyreduce: case 59: /* Line 1455 of yacc.c */ -#line 745 "program_parse.y" +#line 746 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2763,7 +2764,7 @@ yyreduce: case 60: /* Line 1455 of yacc.c */ -#line 787 "program_parse.y" +#line 788 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = PROGRAM_INPUT; @@ -2779,7 +2780,7 @@ yyreduce: case 61: /* Line 1455 of yacc.c */ -#line 798 "program_parse.y" +#line 799 "program_parse.y" { if (! (yyvsp[(3) - (4)].src_reg).Base.RelAddr && ((unsigned) (yyvsp[(3) - (4)].src_reg).Base.Index >= (yyvsp[(1) - (4)].sym)->param_binding_length)) { @@ -2805,7 +2806,7 @@ yyreduce: case 62: /* Line 1455 of yacc.c */ -#line 819 "program_parse.y" +#line 820 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = ((yyvsp[(1) - (1)].temp_sym).name != NULL) @@ -2818,7 +2819,7 @@ yyreduce: case 63: /* Line 1455 of yacc.c */ -#line 829 "program_parse.y" +#line 830 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_OUTPUT; @@ -2829,7 +2830,7 @@ yyreduce: case 64: /* Line 1455 of yacc.c */ -#line 835 "program_parse.y" +#line 836 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2863,7 +2864,7 @@ yyreduce: case 65: /* Line 1455 of yacc.c */ -#line 866 "program_parse.y" +#line 867 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2883,7 +2884,7 @@ yyreduce: case 68: /* Line 1455 of yacc.c */ -#line 885 "program_parse.y" +#line 886 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].integer); @@ -2893,7 +2894,7 @@ yyreduce: case 69: /* Line 1455 of yacc.c */ -#line 892 "program_parse.y" +#line 893 "program_parse.y" { /* FINISHME: Add support for multiple address registers. */ @@ -2908,28 +2909,28 @@ yyreduce: case 70: /* Line 1455 of yacc.c */ -#line 903 "program_parse.y" +#line 904 "program_parse.y" { (yyval.integer) = 0; ;} break; case 71: /* Line 1455 of yacc.c */ -#line 904 "program_parse.y" +#line 905 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; case 72: /* Line 1455 of yacc.c */ -#line 905 "program_parse.y" +#line 906 "program_parse.y" { (yyval.integer) = -(yyvsp[(2) - (2)].integer); ;} break; case 73: /* Line 1455 of yacc.c */ -#line 909 "program_parse.y" +#line 910 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 63)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2944,7 +2945,7 @@ yyreduce: case 74: /* Line 1455 of yacc.c */ -#line 921 "program_parse.y" +#line 922 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 64)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2959,7 +2960,7 @@ yyreduce: case 75: /* Line 1455 of yacc.c */ -#line 933 "program_parse.y" +#line 934 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2980,7 +2981,7 @@ yyreduce: case 76: /* Line 1455 of yacc.c */ -#line 951 "program_parse.y" +#line 952 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, "invalid address component selector"); @@ -2994,7 +2995,7 @@ yyreduce: case 77: /* Line 1455 of yacc.c */ -#line 962 "program_parse.y" +#line 963 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, @@ -3009,21 +3010,21 @@ yyreduce: case 82: /* Line 1455 of yacc.c */ -#line 978 "program_parse.y" +#line 979 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 87: /* Line 1455 of yacc.c */ -#line 982 "program_parse.y" +#line 983 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 94: /* Line 1455 of yacc.c */ -#line 994 "program_parse.y" +#line 995 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_attrib, & (yylsp[(2) - (4)])); @@ -3044,7 +3045,7 @@ yyreduce: case 95: /* Line 1455 of yacc.c */ -#line 1012 "program_parse.y" +#line 1013 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} @@ -3053,7 +3054,7 @@ yyreduce: case 96: /* Line 1455 of yacc.c */ -#line 1016 "program_parse.y" +#line 1017 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} @@ -3062,7 +3063,7 @@ yyreduce: case 97: /* Line 1455 of yacc.c */ -#line 1022 "program_parse.y" +#line 1023 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_POS; ;} @@ -3071,7 +3072,7 @@ yyreduce: case 98: /* Line 1455 of yacc.c */ -#line 1026 "program_parse.y" +#line 1027 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_WEIGHT; ;} @@ -3080,7 +3081,7 @@ yyreduce: case 99: /* Line 1455 of yacc.c */ -#line 1030 "program_parse.y" +#line 1031 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_NORMAL; ;} @@ -3089,7 +3090,7 @@ yyreduce: case 100: /* Line 1455 of yacc.c */ -#line 1034 "program_parse.y" +#line 1035 "program_parse.y" { if (!state->ctx->Extensions.EXT_secondary_color) { yyerror(& (yylsp[(2) - (2)]), state, "GL_EXT_secondary_color not supported"); @@ -3103,7 +3104,7 @@ yyreduce: case 101: /* Line 1455 of yacc.c */ -#line 1043 "program_parse.y" +#line 1044 "program_parse.y" { if (!state->ctx->Extensions.EXT_fog_coord) { yyerror(& (yylsp[(1) - (1)]), state, "GL_EXT_fog_coord not supported"); @@ -3117,7 +3118,7 @@ yyreduce: case 102: /* Line 1455 of yacc.c */ -#line 1052 "program_parse.y" +#line 1053 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} @@ -3126,7 +3127,7 @@ yyreduce: case 103: /* Line 1455 of yacc.c */ -#line 1056 "program_parse.y" +#line 1057 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; @@ -3136,7 +3137,7 @@ yyreduce: case 104: /* Line 1455 of yacc.c */ -#line 1061 "program_parse.y" +#line 1062 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_GENERIC0 + (yyvsp[(3) - (4)].integer); ;} @@ -3145,7 +3146,7 @@ yyreduce: case 105: /* Line 1455 of yacc.c */ -#line 1067 "program_parse.y" +#line 1068 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxAttribs) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex attribute reference"); @@ -3159,7 +3160,7 @@ yyreduce: case 109: /* Line 1455 of yacc.c */ -#line 1081 "program_parse.y" +#line 1082 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_WPOS; ;} @@ -3168,7 +3169,7 @@ yyreduce: case 110: /* Line 1455 of yacc.c */ -#line 1085 "program_parse.y" +#line 1086 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_COL0 + (yyvsp[(2) - (2)].integer); ;} @@ -3177,7 +3178,7 @@ yyreduce: case 111: /* Line 1455 of yacc.c */ -#line 1089 "program_parse.y" +#line 1090 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_FOGC; ;} @@ -3186,7 +3187,7 @@ yyreduce: case 112: /* Line 1455 of yacc.c */ -#line 1093 "program_parse.y" +#line 1094 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} @@ -3195,7 +3196,7 @@ yyreduce: case 115: /* Line 1455 of yacc.c */ -#line 1101 "program_parse.y" +#line 1102 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (3)].string), at_param, & (yylsp[(2) - (3)])); @@ -3214,7 +3215,7 @@ yyreduce: case 116: /* Line 1455 of yacc.c */ -#line 1117 "program_parse.y" +#line 1118 "program_parse.y" { if (((yyvsp[(4) - (6)].integer) != 0) && ((unsigned) (yyvsp[(4) - (6)].integer) != (yyvsp[(6) - (6)].temp_sym).param_binding_length)) { yyerror(& (yylsp[(4) - (6)]), state, @@ -3239,7 +3240,7 @@ yyreduce: case 117: /* Line 1455 of yacc.c */ -#line 1139 "program_parse.y" +#line 1140 "program_parse.y" { (yyval.integer) = 0; ;} @@ -3248,7 +3249,7 @@ yyreduce: case 118: /* Line 1455 of yacc.c */ -#line 1143 "program_parse.y" +#line 1144 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 1) || ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxParameters)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid parameter array size"); @@ -3262,7 +3263,7 @@ yyreduce: case 119: /* Line 1455 of yacc.c */ -#line 1154 "program_parse.y" +#line 1155 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(2) - (2)].temp_sym); ;} @@ -3271,7 +3272,7 @@ yyreduce: case 120: /* Line 1455 of yacc.c */ -#line 1160 "program_parse.y" +#line 1161 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(3) - (4)].temp_sym); ;} @@ -3280,7 +3281,7 @@ yyreduce: case 122: /* Line 1455 of yacc.c */ -#line 1167 "program_parse.y" +#line 1168 "program_parse.y" { (yyvsp[(1) - (3)].temp_sym).param_binding_length += (yyvsp[(3) - (3)].temp_sym).param_binding_length; (yyval.temp_sym) = (yyvsp[(1) - (3)].temp_sym); @@ -3290,7 +3291,7 @@ yyreduce: case 123: /* Line 1455 of yacc.c */ -#line 1174 "program_parse.y" +#line 1175 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3301,7 +3302,7 @@ yyreduce: case 124: /* Line 1455 of yacc.c */ -#line 1180 "program_parse.y" +#line 1181 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3312,7 +3313,7 @@ yyreduce: case 125: /* Line 1455 of yacc.c */ -#line 1186 "program_parse.y" +#line 1187 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3323,7 +3324,7 @@ yyreduce: case 126: /* Line 1455 of yacc.c */ -#line 1194 "program_parse.y" +#line 1195 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3334,7 +3335,7 @@ yyreduce: case 127: /* Line 1455 of yacc.c */ -#line 1200 "program_parse.y" +#line 1201 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3345,7 +3346,7 @@ yyreduce: case 128: /* Line 1455 of yacc.c */ -#line 1206 "program_parse.y" +#line 1207 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3356,7 +3357,7 @@ yyreduce: case 129: /* Line 1455 of yacc.c */ -#line 1214 "program_parse.y" +#line 1215 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3367,7 +3368,7 @@ yyreduce: case 130: /* Line 1455 of yacc.c */ -#line 1220 "program_parse.y" +#line 1221 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3378,7 +3379,7 @@ yyreduce: case 131: /* Line 1455 of yacc.c */ -#line 1226 "program_parse.y" +#line 1227 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3389,98 +3390,98 @@ yyreduce: case 132: /* Line 1455 of yacc.c */ -#line 1233 "program_parse.y" +#line 1234 "program_parse.y" { memcpy((yyval.state), (yyvsp[(1) - (1)].state), sizeof((yyval.state))); ;} break; case 133: /* Line 1455 of yacc.c */ -#line 1234 "program_parse.y" +#line 1235 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 134: /* Line 1455 of yacc.c */ -#line 1237 "program_parse.y" +#line 1238 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 135: /* Line 1455 of yacc.c */ -#line 1238 "program_parse.y" +#line 1239 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 136: /* Line 1455 of yacc.c */ -#line 1239 "program_parse.y" +#line 1240 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 137: /* Line 1455 of yacc.c */ -#line 1240 "program_parse.y" +#line 1241 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 138: /* Line 1455 of yacc.c */ -#line 1241 "program_parse.y" +#line 1242 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 139: /* Line 1455 of yacc.c */ -#line 1242 "program_parse.y" +#line 1243 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 140: /* Line 1455 of yacc.c */ -#line 1243 "program_parse.y" +#line 1244 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 141: /* Line 1455 of yacc.c */ -#line 1244 "program_parse.y" +#line 1245 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 142: /* Line 1455 of yacc.c */ -#line 1245 "program_parse.y" +#line 1246 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 143: /* Line 1455 of yacc.c */ -#line 1246 "program_parse.y" +#line 1247 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 144: /* Line 1455 of yacc.c */ -#line 1247 "program_parse.y" +#line 1248 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 145: /* Line 1455 of yacc.c */ -#line 1251 "program_parse.y" +#line 1252 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_MATERIAL; @@ -3492,7 +3493,7 @@ yyreduce: case 146: /* Line 1455 of yacc.c */ -#line 1260 "program_parse.y" +#line 1261 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3501,7 +3502,7 @@ yyreduce: case 147: /* Line 1455 of yacc.c */ -#line 1264 "program_parse.y" +#line 1265 "program_parse.y" { (yyval.integer) = STATE_EMISSION; ;} @@ -3510,7 +3511,7 @@ yyreduce: case 148: /* Line 1455 of yacc.c */ -#line 1268 "program_parse.y" +#line 1269 "program_parse.y" { (yyval.integer) = STATE_SHININESS; ;} @@ -3519,7 +3520,7 @@ yyreduce: case 149: /* Line 1455 of yacc.c */ -#line 1274 "program_parse.y" +#line 1275 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHT; @@ -3531,7 +3532,7 @@ yyreduce: case 150: /* Line 1455 of yacc.c */ -#line 1283 "program_parse.y" +#line 1284 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3540,7 +3541,7 @@ yyreduce: case 151: /* Line 1455 of yacc.c */ -#line 1287 "program_parse.y" +#line 1288 "program_parse.y" { (yyval.integer) = STATE_POSITION; ;} @@ -3549,7 +3550,7 @@ yyreduce: case 152: /* Line 1455 of yacc.c */ -#line 1291 "program_parse.y" +#line 1292 "program_parse.y" { if (!state->ctx->Extensions.EXT_point_parameters) { yyerror(& (yylsp[(1) - (1)]), state, "GL_ARB_point_parameters not supported"); @@ -3563,7 +3564,7 @@ yyreduce: case 153: /* Line 1455 of yacc.c */ -#line 1300 "program_parse.y" +#line 1301 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} @@ -3572,7 +3573,7 @@ yyreduce: case 154: /* Line 1455 of yacc.c */ -#line 1304 "program_parse.y" +#line 1305 "program_parse.y" { (yyval.integer) = STATE_HALF_VECTOR; ;} @@ -3581,7 +3582,7 @@ yyreduce: case 155: /* Line 1455 of yacc.c */ -#line 1310 "program_parse.y" +#line 1311 "program_parse.y" { (yyval.integer) = STATE_SPOT_DIRECTION; ;} @@ -3590,7 +3591,7 @@ yyreduce: case 156: /* Line 1455 of yacc.c */ -#line 1316 "program_parse.y" +#line 1317 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (2)].state)[1]; @@ -3600,7 +3601,7 @@ yyreduce: case 157: /* Line 1455 of yacc.c */ -#line 1323 "program_parse.y" +#line 1324 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_AMBIENT; @@ -3610,7 +3611,7 @@ yyreduce: case 158: /* Line 1455 of yacc.c */ -#line 1328 "program_parse.y" +#line 1329 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_SCENECOLOR; @@ -3621,7 +3622,7 @@ yyreduce: case 159: /* Line 1455 of yacc.c */ -#line 1336 "program_parse.y" +#line 1337 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTPROD; @@ -3634,7 +3635,7 @@ yyreduce: case 161: /* Line 1455 of yacc.c */ -#line 1348 "program_parse.y" +#line 1349 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(3) - (3)].integer); @@ -3645,7 +3646,7 @@ yyreduce: case 162: /* Line 1455 of yacc.c */ -#line 1356 "program_parse.y" +#line 1357 "program_parse.y" { (yyval.integer) = STATE_TEXENV_COLOR; ;} @@ -3654,7 +3655,7 @@ yyreduce: case 163: /* Line 1455 of yacc.c */ -#line 1362 "program_parse.y" +#line 1363 "program_parse.y" { (yyval.integer) = STATE_AMBIENT; ;} @@ -3663,7 +3664,7 @@ yyreduce: case 164: /* Line 1455 of yacc.c */ -#line 1366 "program_parse.y" +#line 1367 "program_parse.y" { (yyval.integer) = STATE_DIFFUSE; ;} @@ -3672,7 +3673,7 @@ yyreduce: case 165: /* Line 1455 of yacc.c */ -#line 1370 "program_parse.y" +#line 1371 "program_parse.y" { (yyval.integer) = STATE_SPECULAR; ;} @@ -3681,7 +3682,7 @@ yyreduce: case 166: /* Line 1455 of yacc.c */ -#line 1376 "program_parse.y" +#line 1377 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxLights) { yyerror(& (yylsp[(1) - (1)]), state, "invalid light selector"); @@ -3695,7 +3696,7 @@ yyreduce: case 167: /* Line 1455 of yacc.c */ -#line 1387 "program_parse.y" +#line 1388 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_TEXGEN; @@ -3707,7 +3708,7 @@ yyreduce: case 168: /* Line 1455 of yacc.c */ -#line 1396 "program_parse.y" +#line 1397 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S; ;} @@ -3716,7 +3717,7 @@ yyreduce: case 169: /* Line 1455 of yacc.c */ -#line 1400 "program_parse.y" +#line 1401 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_OBJECT_S; ;} @@ -3725,7 +3726,7 @@ yyreduce: case 170: /* Line 1455 of yacc.c */ -#line 1405 "program_parse.y" +#line 1406 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S; ;} @@ -3734,7 +3735,7 @@ yyreduce: case 171: /* Line 1455 of yacc.c */ -#line 1409 "program_parse.y" +#line 1410 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S; ;} @@ -3743,7 +3744,7 @@ yyreduce: case 172: /* Line 1455 of yacc.c */ -#line 1413 "program_parse.y" +#line 1414 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S; ;} @@ -3752,7 +3753,7 @@ yyreduce: case 173: /* Line 1455 of yacc.c */ -#line 1417 "program_parse.y" +#line 1418 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S; ;} @@ -3761,7 +3762,7 @@ yyreduce: case 174: /* Line 1455 of yacc.c */ -#line 1423 "program_parse.y" +#line 1424 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); @@ -3771,7 +3772,7 @@ yyreduce: case 175: /* Line 1455 of yacc.c */ -#line 1430 "program_parse.y" +#line 1431 "program_parse.y" { (yyval.integer) = STATE_FOG_COLOR; ;} @@ -3780,7 +3781,7 @@ yyreduce: case 176: /* Line 1455 of yacc.c */ -#line 1434 "program_parse.y" +#line 1435 "program_parse.y" { (yyval.integer) = STATE_FOG_PARAMS; ;} @@ -3789,7 +3790,7 @@ yyreduce: case 177: /* Line 1455 of yacc.c */ -#line 1440 "program_parse.y" +#line 1441 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_CLIPPLANE; @@ -3800,7 +3801,7 @@ yyreduce: case 178: /* Line 1455 of yacc.c */ -#line 1448 "program_parse.y" +#line 1449 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxClipPlanes) { yyerror(& (yylsp[(1) - (1)]), state, "invalid clip plane selector"); @@ -3814,7 +3815,7 @@ yyreduce: case 179: /* Line 1455 of yacc.c */ -#line 1459 "program_parse.y" +#line 1460 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); @@ -3824,7 +3825,7 @@ yyreduce: case 180: /* Line 1455 of yacc.c */ -#line 1466 "program_parse.y" +#line 1467 "program_parse.y" { (yyval.integer) = STATE_POINT_SIZE; ;} @@ -3833,7 +3834,7 @@ yyreduce: case 181: /* Line 1455 of yacc.c */ -#line 1470 "program_parse.y" +#line 1471 "program_parse.y" { (yyval.integer) = STATE_POINT_ATTENUATION; ;} @@ -3842,7 +3843,7 @@ yyreduce: case 182: /* Line 1455 of yacc.c */ -#line 1476 "program_parse.y" +#line 1477 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (5)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (5)].state)[1]; @@ -3855,7 +3856,7 @@ yyreduce: case 183: /* Line 1455 of yacc.c */ -#line 1486 "program_parse.y" +#line 1487 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (2)].state)[1]; @@ -3868,7 +3869,7 @@ yyreduce: case 184: /* Line 1455 of yacc.c */ -#line 1496 "program_parse.y" +#line 1497 "program_parse.y" { (yyval.state)[2] = 0; (yyval.state)[3] = 3; @@ -3878,7 +3879,7 @@ yyreduce: case 185: /* Line 1455 of yacc.c */ -#line 1501 "program_parse.y" +#line 1502 "program_parse.y" { /* It seems logical that the matrix row range specifier would have * to specify a range or more than one row (i.e., $5 > $3). @@ -3899,7 +3900,7 @@ yyreduce: case 186: /* Line 1455 of yacc.c */ -#line 1519 "program_parse.y" +#line 1520 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (3)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (3)].state)[1]; @@ -3910,7 +3911,7 @@ yyreduce: case 187: /* Line 1455 of yacc.c */ -#line 1527 "program_parse.y" +#line 1528 "program_parse.y" { (yyval.integer) = 0; ;} @@ -3919,7 +3920,7 @@ yyreduce: case 188: /* Line 1455 of yacc.c */ -#line 1531 "program_parse.y" +#line 1532 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3928,7 +3929,7 @@ yyreduce: case 189: /* Line 1455 of yacc.c */ -#line 1537 "program_parse.y" +#line 1538 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVERSE; ;} @@ -3937,7 +3938,7 @@ yyreduce: case 190: /* Line 1455 of yacc.c */ -#line 1541 "program_parse.y" +#line 1542 "program_parse.y" { (yyval.integer) = STATE_MATRIX_TRANSPOSE; ;} @@ -3946,7 +3947,7 @@ yyreduce: case 191: /* Line 1455 of yacc.c */ -#line 1545 "program_parse.y" +#line 1546 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVTRANS; ;} @@ -3955,7 +3956,7 @@ yyreduce: case 192: /* Line 1455 of yacc.c */ -#line 1551 "program_parse.y" +#line 1552 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) > 3) { yyerror(& (yylsp[(1) - (1)]), state, "invalid matrix row reference"); @@ -3969,7 +3970,7 @@ yyreduce: case 193: /* Line 1455 of yacc.c */ -#line 1562 "program_parse.y" +#line 1563 "program_parse.y" { (yyval.state)[0] = STATE_MODELVIEW_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); @@ -3979,7 +3980,7 @@ yyreduce: case 194: /* Line 1455 of yacc.c */ -#line 1567 "program_parse.y" +#line 1568 "program_parse.y" { (yyval.state)[0] = STATE_PROJECTION_MATRIX; (yyval.state)[1] = 0; @@ -3989,7 +3990,7 @@ yyreduce: case 195: /* Line 1455 of yacc.c */ -#line 1572 "program_parse.y" +#line 1573 "program_parse.y" { (yyval.state)[0] = STATE_MVP_MATRIX; (yyval.state)[1] = 0; @@ -3999,7 +4000,7 @@ yyreduce: case 196: /* Line 1455 of yacc.c */ -#line 1577 "program_parse.y" +#line 1578 "program_parse.y" { (yyval.state)[0] = STATE_TEXTURE_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); @@ -4009,7 +4010,7 @@ yyreduce: case 197: /* Line 1455 of yacc.c */ -#line 1582 "program_parse.y" +#line 1583 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; @@ -4019,7 +4020,7 @@ yyreduce: case 198: /* Line 1455 of yacc.c */ -#line 1587 "program_parse.y" +#line 1588 "program_parse.y" { (yyval.state)[0] = STATE_PROGRAM_MATRIX; (yyval.state)[1] = (yyvsp[(3) - (4)].integer); @@ -4029,7 +4030,7 @@ yyreduce: case 199: /* Line 1455 of yacc.c */ -#line 1594 "program_parse.y" +#line 1595 "program_parse.y" { (yyval.integer) = 0; ;} @@ -4038,7 +4039,7 @@ yyreduce: case 200: /* Line 1455 of yacc.c */ -#line 1598 "program_parse.y" +#line 1599 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -4047,7 +4048,7 @@ yyreduce: case 201: /* Line 1455 of yacc.c */ -#line 1603 "program_parse.y" +#line 1604 "program_parse.y" { /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix * zero is valid. @@ -4064,7 +4065,7 @@ yyreduce: case 202: /* Line 1455 of yacc.c */ -#line 1616 "program_parse.y" +#line 1617 "program_parse.y" { /* Since GL_ARB_matrix_palette isn't supported, just let any value * through here. The error will be generated later. @@ -4076,7 +4077,7 @@ yyreduce: case 203: /* Line 1455 of yacc.c */ -#line 1624 "program_parse.y" +#line 1625 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxProgramMatrices) { yyerror(& (yylsp[(1) - (1)]), state, "invalid program matrix selector"); @@ -4090,7 +4091,7 @@ yyreduce: case 204: /* Line 1455 of yacc.c */ -#line 1635 "program_parse.y" +#line 1636 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_DEPTH_RANGE; @@ -4100,7 +4101,7 @@ yyreduce: case 209: /* Line 1455 of yacc.c */ -#line 1647 "program_parse.y" +#line 1648 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4113,7 +4114,7 @@ yyreduce: case 210: /* Line 1455 of yacc.c */ -#line 1657 "program_parse.y" +#line 1658 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); @@ -4123,7 +4124,7 @@ yyreduce: case 211: /* Line 1455 of yacc.c */ -#line 1662 "program_parse.y" +#line 1663 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); @@ -4133,7 +4134,7 @@ yyreduce: case 212: /* Line 1455 of yacc.c */ -#line 1669 "program_parse.y" +#line 1670 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4146,7 +4147,7 @@ yyreduce: case 213: /* Line 1455 of yacc.c */ -#line 1679 "program_parse.y" +#line 1680 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4159,7 +4160,7 @@ yyreduce: case 214: /* Line 1455 of yacc.c */ -#line 1688 "program_parse.y" +#line 1689 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); @@ -4169,7 +4170,7 @@ yyreduce: case 215: /* Line 1455 of yacc.c */ -#line 1693 "program_parse.y" +#line 1694 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); @@ -4179,7 +4180,7 @@ yyreduce: case 216: /* Line 1455 of yacc.c */ -#line 1700 "program_parse.y" +#line 1701 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4192,7 +4193,7 @@ yyreduce: case 217: /* Line 1455 of yacc.c */ -#line 1710 "program_parse.y" +#line 1711 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxEnvParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid environment parameter reference"); @@ -4205,7 +4206,7 @@ yyreduce: case 218: /* Line 1455 of yacc.c */ -#line 1720 "program_parse.y" +#line 1721 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxLocalParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid local parameter reference"); @@ -4218,7 +4219,7 @@ yyreduce: case 223: /* Line 1455 of yacc.c */ -#line 1735 "program_parse.y" +#line 1736 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -4231,7 +4232,7 @@ yyreduce: case 224: /* Line 1455 of yacc.c */ -#line 1745 "program_parse.y" +#line 1746 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -4244,7 +4245,7 @@ yyreduce: case 225: /* Line 1455 of yacc.c */ -#line 1753 "program_parse.y" +#line 1754 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (float) (yyvsp[(1) - (1)].integer); @@ -4257,7 +4258,7 @@ yyreduce: case 226: /* Line 1455 of yacc.c */ -#line 1763 "program_parse.y" +#line 1764 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (3)].real); @@ -4270,7 +4271,7 @@ yyreduce: case 227: /* Line 1455 of yacc.c */ -#line 1771 "program_parse.y" +#line 1772 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (5)].real); @@ -4283,7 +4284,7 @@ yyreduce: case 228: /* Line 1455 of yacc.c */ -#line 1780 "program_parse.y" +#line 1781 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (7)].real); @@ -4296,7 +4297,7 @@ yyreduce: case 229: /* Line 1455 of yacc.c */ -#line 1789 "program_parse.y" +#line 1790 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (9)].real); @@ -4309,7 +4310,7 @@ yyreduce: case 230: /* Line 1455 of yacc.c */ -#line 1799 "program_parse.y" +#line 1800 "program_parse.y" { (yyval.real) = ((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].real) : (yyvsp[(2) - (2)].real); ;} @@ -4318,7 +4319,7 @@ yyreduce: case 231: /* Line 1455 of yacc.c */ -#line 1803 "program_parse.y" +#line 1804 "program_parse.y" { (yyval.real) = (float)(((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].integer) : (yyvsp[(2) - (2)].integer)); ;} @@ -4327,42 +4328,42 @@ yyreduce: case 232: /* Line 1455 of yacc.c */ -#line 1808 "program_parse.y" +#line 1809 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 233: /* Line 1455 of yacc.c */ -#line 1809 "program_parse.y" +#line 1810 "program_parse.y" { (yyval.negate) = TRUE; ;} break; case 234: /* Line 1455 of yacc.c */ -#line 1810 "program_parse.y" +#line 1811 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 235: /* Line 1455 of yacc.c */ -#line 1813 "program_parse.y" +#line 1814 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 237: /* Line 1455 of yacc.c */ -#line 1816 "program_parse.y" +#line 1817 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 239: /* Line 1455 of yacc.c */ -#line 1820 "program_parse.y" +#line 1821 "program_parse.y" { if (!declare_variable(state, (yyvsp[(3) - (3)].string), (yyvsp[(0) - (3)].integer), & (yylsp[(3) - (3)]))) { YYERROR; @@ -4373,7 +4374,7 @@ yyreduce: case 240: /* Line 1455 of yacc.c */ -#line 1826 "program_parse.y" +#line 1827 "program_parse.y" { if (!declare_variable(state, (yyvsp[(1) - (1)].string), (yyvsp[(0) - (1)].integer), & (yylsp[(1) - (1)]))) { YYERROR; @@ -4384,7 +4385,7 @@ yyreduce: case 241: /* Line 1455 of yacc.c */ -#line 1834 "program_parse.y" +#line 1835 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_output, & (yylsp[(2) - (4)])); @@ -4400,7 +4401,7 @@ yyreduce: case 242: /* Line 1455 of yacc.c */ -#line 1847 "program_parse.y" +#line 1848 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_HPOS; @@ -4414,7 +4415,7 @@ yyreduce: case 243: /* Line 1455 of yacc.c */ -#line 1856 "program_parse.y" +#line 1857 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_FOGC; @@ -4428,7 +4429,7 @@ yyreduce: case 244: /* Line 1455 of yacc.c */ -#line 1865 "program_parse.y" +#line 1866 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (2)].result); ;} @@ -4437,7 +4438,7 @@ yyreduce: case 245: /* Line 1455 of yacc.c */ -#line 1869 "program_parse.y" +#line 1870 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_PSIZ; @@ -4451,7 +4452,7 @@ yyreduce: case 246: /* Line 1455 of yacc.c */ -#line 1878 "program_parse.y" +#line 1879 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_TEX0 + (yyvsp[(3) - (3)].integer); @@ -4465,7 +4466,7 @@ yyreduce: case 247: /* Line 1455 of yacc.c */ -#line 1887 "program_parse.y" +#line 1888 "program_parse.y" { if (state->mode == ARB_fragment) { (yyval.result) = FRAG_RESULT_DEPTH; @@ -4479,7 +4480,7 @@ yyreduce: case 248: /* Line 1455 of yacc.c */ -#line 1898 "program_parse.y" +#line 1899 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (3)].integer) + (yyvsp[(3) - (3)].integer); ;} @@ -4488,7 +4489,7 @@ yyreduce: case 249: /* Line 1455 of yacc.c */ -#line 1904 "program_parse.y" +#line 1905 "program_parse.y" { (yyval.integer) = (state->mode == ARB_vertex) ? VERT_RESULT_COL0 @@ -4499,7 +4500,7 @@ yyreduce: case 250: /* Line 1455 of yacc.c */ -#line 1910 "program_parse.y" +#line 1911 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_COL0; @@ -4513,7 +4514,7 @@ yyreduce: case 251: /* Line 1455 of yacc.c */ -#line 1919 "program_parse.y" +#line 1920 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_BFC0; @@ -4527,7 +4528,7 @@ yyreduce: case 252: /* Line 1455 of yacc.c */ -#line 1930 "program_parse.y" +#line 1931 "program_parse.y" { (yyval.integer) = 0; ;} @@ -4536,7 +4537,7 @@ yyreduce: case 253: /* Line 1455 of yacc.c */ -#line 1934 "program_parse.y" +#line 1935 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 0; @@ -4550,7 +4551,7 @@ yyreduce: case 254: /* Line 1455 of yacc.c */ -#line 1943 "program_parse.y" +#line 1944 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 1; @@ -4564,91 +4565,91 @@ yyreduce: case 255: /* Line 1455 of yacc.c */ -#line 1953 "program_parse.y" +#line 1954 "program_parse.y" { (yyval.integer) = 0; ;} break; case 256: /* Line 1455 of yacc.c */ -#line 1954 "program_parse.y" +#line 1955 "program_parse.y" { (yyval.integer) = 0; ;} break; case 257: /* Line 1455 of yacc.c */ -#line 1955 "program_parse.y" +#line 1956 "program_parse.y" { (yyval.integer) = 1; ;} break; case 258: /* Line 1455 of yacc.c */ -#line 1958 "program_parse.y" +#line 1959 "program_parse.y" { (yyval.integer) = 0; ;} break; case 259: /* Line 1455 of yacc.c */ -#line 1959 "program_parse.y" +#line 1960 "program_parse.y" { (yyval.integer) = 0; ;} break; case 260: /* Line 1455 of yacc.c */ -#line 1960 "program_parse.y" +#line 1961 "program_parse.y" { (yyval.integer) = 1; ;} break; case 261: /* Line 1455 of yacc.c */ -#line 1963 "program_parse.y" +#line 1964 "program_parse.y" { (yyval.integer) = 0; ;} break; case 262: /* Line 1455 of yacc.c */ -#line 1964 "program_parse.y" +#line 1965 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 263: /* Line 1455 of yacc.c */ -#line 1967 "program_parse.y" +#line 1968 "program_parse.y" { (yyval.integer) = 0; ;} break; case 264: /* Line 1455 of yacc.c */ -#line 1968 "program_parse.y" +#line 1969 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 265: /* Line 1455 of yacc.c */ -#line 1971 "program_parse.y" +#line 1972 "program_parse.y" { (yyval.integer) = 0; ;} break; case 266: /* Line 1455 of yacc.c */ -#line 1972 "program_parse.y" +#line 1973 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 267: /* Line 1455 of yacc.c */ -#line 1976 "program_parse.y" +#line 1977 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture coordinate unit selector"); @@ -4662,7 +4663,7 @@ yyreduce: case 268: /* Line 1455 of yacc.c */ -#line 1987 "program_parse.y" +#line 1988 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture image unit selector"); @@ -4676,7 +4677,7 @@ yyreduce: case 269: /* Line 1455 of yacc.c */ -#line 1998 "program_parse.y" +#line 1999 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture unit selector"); @@ -4690,7 +4691,7 @@ yyreduce: case 270: /* Line 1455 of yacc.c */ -#line 2009 "program_parse.y" +#line 2010 "program_parse.y" { struct asm_symbol *exist = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(2) - (4)].string)); @@ -4714,7 +4715,7 @@ yyreduce: /* Line 1455 of yacc.c */ -#line 4718 "program_parse.tab.c" +#line 4719 "program_parse.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -4933,7 +4934,42 @@ yyreturn: /* Line 1675 of yacc.c */ -#line 2029 "program_parse.y" +#line 2030 "program_parse.y" + + +void +asm_instruction_set_operands(struct asm_instruction *inst, + const struct prog_dst_register *dst, + const struct asm_src_register *src0, + const struct asm_src_register *src1, + const struct asm_src_register *src2) +{ + /* In the core ARB extensions only the KIL instruction doesn't have a + * destination register. + */ + if (dst == NULL) { + init_dst_reg(& inst->Base.DstReg); + } else { + inst->Base.DstReg = *dst; + } + + inst->Base.SrcReg[0] = src0->Base; + inst->SrcReg[0] = *src0; + + if (src1 != NULL) { + inst->Base.SrcReg[1] = src1->Base; + inst->SrcReg[1] = *src1; + } else { + init_src_reg(& inst->SrcReg[1]); + } + + if (src2 != NULL) { + inst->Base.SrcReg[2] = src2->Base; + inst->SrcReg[2] = *src2; + } else { + init_src_reg(& inst->SrcReg[2]); + } +} struct asm_instruction * @@ -4943,37 +4979,34 @@ asm_instruction_ctor(gl_inst_opcode op, const struct asm_src_register *src1, const struct asm_src_register *src2) { - struct asm_instruction *inst = calloc(1, sizeof(struct asm_instruction)); + struct asm_instruction *inst = CALLOC_STRUCT(asm_instruction); if (inst) { _mesa_init_instructions(& inst->Base, 1); inst->Base.Opcode = op; - /* In the core ARB extensions only the KIL instruction doesn't have a - * destination register. - */ - if (dst == NULL) { - init_dst_reg(& inst->Base.DstReg); - } else { - inst->Base.DstReg = *dst; - } + asm_instruction_set_operands(inst, dst, src0, src1, src2); + } - inst->Base.SrcReg[0] = src0->Base; - inst->SrcReg[0] = *src0; + return inst; +} - if (src1 != NULL) { - inst->Base.SrcReg[1] = src1->Base; - inst->SrcReg[1] = *src1; - } else { - init_src_reg(& inst->SrcReg[1]); - } - if (src2 != NULL) { - inst->Base.SrcReg[2] = src2->Base; - inst->SrcReg[2] = *src2; - } else { - init_src_reg(& inst->SrcReg[2]); - } +struct asm_instruction * +asm_instruction_copy_ctor(const struct prog_instruction *base, + const struct prog_dst_register *dst, + const struct asm_src_register *src0, + const struct asm_src_register *src1, + const struct asm_src_register *src2) +{ + struct asm_instruction *inst = CALLOC_STRUCT(asm_instruction); + + if (inst) { + _mesa_init_instructions(& inst->Base, 1); + inst->Base.Opcode = base->Opcode; + inst->Base.SaturateMode = base->SaturateMode; + + asm_instruction_set_operands(inst, dst, src0, src1, src2); } return inst; diff --git a/src/mesa/shader/program_parse.tab.h b/src/mesa/shader/program_parse.tab.h index 7ab6f6b23e..5f89532d65 100644 --- a/src/mesa/shader/program_parse.tab.h +++ b/src/mesa/shader/program_parse.tab.h @@ -153,7 +153,7 @@ typedef union YYSTYPE { /* Line 1676 of yacc.c */ -#line 107 "program_parse.y" +#line 116 "program_parse.y" struct asm_instruction *inst; struct asm_symbol *sym; diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 32aa9d503f..4e2912d1c4 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -68,10 +68,19 @@ static void init_dst_reg(struct prog_dst_register *r); static void init_src_reg(struct asm_src_register *r); +static void asm_instruction_set_operands(struct asm_instruction *inst, + const struct prog_dst_register *dst, const struct asm_src_register *src0, + const struct asm_src_register *src1, const struct asm_src_register *src2); + static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, const struct prog_dst_register *dst, const struct asm_src_register *src0, const struct asm_src_register *src1, const struct asm_src_register *src2); +static struct asm_instruction *asm_instruction_copy_ctor( + const struct prog_instruction *base, const struct prog_dst_register *dst, + const struct asm_src_register *src0, const struct asm_src_register *src1, + const struct asm_src_register *src2); + #ifndef FALSE #define FALSE 0 #define TRUE (!FALSE) @@ -358,51 +367,45 @@ ARL_instruction: ARL maskedAddrReg ',' scalarSrcReg VECTORop_instruction: VECTOR_OP maskedDstReg ',' swizzleSrcReg { - $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, NULL, NULL); - $$->Base.SaturateMode = $1.SaturateMode; + $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, NULL, NULL); } ; SCALARop_instruction: SCALAR_OP maskedDstReg ',' scalarSrcReg { - $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, NULL, NULL); - $$->Base.SaturateMode = $1.SaturateMode; + $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, NULL, NULL); } ; BINSCop_instruction: BINSC_OP maskedDstReg ',' scalarSrcReg ',' scalarSrcReg { - $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, & $6, NULL); - $$->Base.SaturateMode = $1.SaturateMode; + $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, & $6, NULL); } ; BINop_instruction: BIN_OP maskedDstReg ',' swizzleSrcReg ',' swizzleSrcReg { - $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, & $6, NULL); - $$->Base.SaturateMode = $1.SaturateMode; + $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, & $6, NULL); } ; TRIop_instruction: TRI_OP maskedDstReg ',' swizzleSrcReg ',' swizzleSrcReg ',' swizzleSrcReg { - $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, & $6, & $8); - $$->Base.SaturateMode = $1.SaturateMode; + $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, & $6, & $8); } ; SAMPLE_instruction: SAMPLE_OP maskedDstReg ',' swizzleSrcReg ',' texImageUnit ',' texTarget { - $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, NULL, NULL); + $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, NULL, NULL); if ($$ != NULL) { const GLbitfield tex_mask = (1U << $6); GLbitfield shadow_tex = 0; GLbitfield target_mask = 0; - $$->Base.SaturateMode = $1.SaturateMode; $$->Base.TexSrcUnit = $6; if ($8 < 0) { @@ -447,14 +450,13 @@ KIL_instruction: KIL swizzleSrcReg TXD_instruction: TXD_OP maskedDstReg ',' swizzleSrcReg ',' swizzleSrcReg ',' swizzleSrcReg ',' texImageUnit ',' texTarget { - $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, & $6, & $8); + $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, & $6, & $8); if ($$ != NULL) { const GLbitfield tex_mask = (1U << $10); GLbitfield shadow_tex = 0; GLbitfield target_mask = 0; - $$->Base.SaturateMode = $1.SaturateMode; $$->Base.TexSrcUnit = $10; if ($12 < 0) { @@ -518,8 +520,7 @@ SWZ_instruction: SWZ maskedDstReg ',' srcReg ',' extendedSwizzle $4.Base.Swizzle = $6.swizzle; $4.Base.Negate = $6.mask; - $$ = asm_instruction_ctor(OPCODE_SWZ, & $2, & $4, NULL, NULL); - $$->Base.SaturateMode = $1.SaturateMode; + $$ = asm_instruction_copy_ctor(& $1, & $2, & $4, NULL, NULL); } ; @@ -2028,6 +2029,41 @@ ALIAS_statement: ALIAS IDENTIFIER '=' IDENTIFIER %% +void +asm_instruction_set_operands(struct asm_instruction *inst, + const struct prog_dst_register *dst, + const struct asm_src_register *src0, + const struct asm_src_register *src1, + const struct asm_src_register *src2) +{ + /* In the core ARB extensions only the KIL instruction doesn't have a + * destination register. + */ + if (dst == NULL) { + init_dst_reg(& inst->Base.DstReg); + } else { + inst->Base.DstReg = *dst; + } + + inst->Base.SrcReg[0] = src0->Base; + inst->SrcReg[0] = *src0; + + if (src1 != NULL) { + inst->Base.SrcReg[1] = src1->Base; + inst->SrcReg[1] = *src1; + } else { + init_src_reg(& inst->SrcReg[1]); + } + + if (src2 != NULL) { + inst->Base.SrcReg[2] = src2->Base; + inst->SrcReg[2] = *src2; + } else { + init_src_reg(& inst->SrcReg[2]); + } +} + + struct asm_instruction * asm_instruction_ctor(gl_inst_opcode op, const struct prog_dst_register *dst, @@ -2035,37 +2071,34 @@ asm_instruction_ctor(gl_inst_opcode op, const struct asm_src_register *src1, const struct asm_src_register *src2) { - struct asm_instruction *inst = calloc(1, sizeof(struct asm_instruction)); + struct asm_instruction *inst = CALLOC_STRUCT(asm_instruction); if (inst) { _mesa_init_instructions(& inst->Base, 1); inst->Base.Opcode = op; - /* In the core ARB extensions only the KIL instruction doesn't have a - * destination register. - */ - if (dst == NULL) { - init_dst_reg(& inst->Base.DstReg); - } else { - inst->Base.DstReg = *dst; - } + asm_instruction_set_operands(inst, dst, src0, src1, src2); + } - inst->Base.SrcReg[0] = src0->Base; - inst->SrcReg[0] = *src0; + return inst; +} - if (src1 != NULL) { - inst->Base.SrcReg[1] = src1->Base; - inst->SrcReg[1] = *src1; - } else { - init_src_reg(& inst->SrcReg[1]); - } - if (src2 != NULL) { - inst->Base.SrcReg[2] = src2->Base; - inst->SrcReg[2] = *src2; - } else { - init_src_reg(& inst->SrcReg[2]); - } +struct asm_instruction * +asm_instruction_copy_ctor(const struct prog_instruction *base, + const struct prog_dst_register *dst, + const struct asm_src_register *src0, + const struct asm_src_register *src1, + const struct asm_src_register *src2) +{ + struct asm_instruction *inst = CALLOC_STRUCT(asm_instruction); + + if (inst) { + _mesa_init_instructions(& inst->Base, 1); + inst->Base.Opcode = base->Opcode; + inst->Base.SaturateMode = base->SaturateMode; + + asm_instruction_set_operands(inst, dst, src0, src1, src2); } return inst; -- cgit v1.2.3 From d0adebb8d5ef680590b0f281a20516318c0b8b62 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 4 Sep 2009 17:27:27 -0700 Subject: NV fp parser: Support instruction and TEMP / OUTPUT sizes Adds support for declaring TEMP and OUTPUT variables as 'LONG' or 'SHORT' precision. The precision specifiers are parsed, but they are currently ignored. Some support for this may be added in the future, but neither Intel hardware nor, as far as I'm aware, Radeon hardware support multiple precisions. Also adds support for instruction precision ('X', 'H', and 'R') suffixes and instruction condition code output ('C') suffix. This results in a fairly major change to the lexer. Instructions are matched with all the possible suffix strings. The suffix string are then carved off by a context (i.e., which program mode and options are set) aware parser that converts the suffixes to bits in prog_instruction. This could have been handled in the same way _SAT was originally handled in the lexer, but it would have resulted in a very large lexer with lots of opportunity for cut-and-paste errors. --- src/mesa/shader/lex.yy.c | 1874 +++++++++++++++------------------ src/mesa/shader/program_lexer.l | 194 ++-- src/mesa/shader/program_parse.tab.c | 776 +++++++------- src/mesa/shader/program_parse.y | 50 +- src/mesa/shader/program_parse_extra.c | 61 ++ src/mesa/shader/program_parser.h | 14 + 6 files changed, 1463 insertions(+), 1506 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/lex.yy.c b/src/mesa/shader/lex.yy.c index 5bde12a6b7..d71a13c3bd 100644 --- a/src/mesa/shader/lex.yy.c +++ b/src/mesa/shader/lex.yy.c @@ -357,8 +357,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 217 -#define YY_END_OF_BUFFER 218 +#define YY_NUM_RULES 168 +#define YY_END_OF_BUFFER 169 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -366,93 +366,100 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[776] = +static yyconst flex_int16_t yy_accept[836] = { 0, - 0, 0, 218, 216, 214, 213, 216, 216, 186, 212, - 188, 188, 188, 188, 186, 186, 186, 186, 186, 186, - 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, - 186, 186, 186, 186, 186, 214, 0, 0, 215, 186, - 0, 187, 189, 209, 209, 0, 0, 0, 0, 209, - 0, 0, 0, 0, 0, 0, 0, 166, 210, 167, - 168, 200, 200, 200, 200, 0, 188, 0, 174, 175, - 176, 186, 186, 186, 186, 186, 186, 186, 186, 186, - 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, - 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, - - 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, - 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, - 186, 186, 186, 186, 186, 186, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 208, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 207, 207, 0, 0, 0, + 0, 0, 169, 167, 165, 164, 167, 167, 137, 163, + 139, 139, 139, 139, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 165, 0, 0, 166, 137, + 0, 138, 140, 160, 160, 0, 0, 0, 0, 160, + 0, 0, 0, 0, 0, 0, 0, 117, 161, 118, + 119, 151, 151, 151, 151, 0, 139, 0, 125, 126, + 127, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 159, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 158, 158, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 206, 206, 206, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 197, 197, 197, 198, 198, 199, 190, - 189, 190, 0, 191, 11, 13, 186, 15, 186, 186, - 16, 18, 186, 20, 22, 24, 26, 28, 30, 6, - - 32, 34, 35, 37, 39, 42, 40, 44, 45, 47, - 49, 51, 53, 55, 186, 186, 186, 186, 186, 65, - 67, 186, 69, 71, 73, 75, 77, 79, 81, 186, - 83, 85, 87, 89, 91, 93, 95, 186, 97, 99, - 101, 103, 186, 109, 111, 186, 186, 186, 186, 186, - 186, 0, 0, 0, 0, 189, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 127, 128, 130, 0, - 205, 0, 0, 0, 0, 0, 0, 144, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 204, 203, - 203, 156, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 194, 194, 195, 196, 0, 192, 186, 186, - 186, 186, 186, 186, 186, 186, 177, 186, 186, 186, - 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, - 186, 186, 186, 186, 186, 186, 186, 57, 186, 61, - 186, 186, 186, 178, 186, 186, 186, 186, 186, 186, - 186, 186, 186, 186, 186, 186, 186, 186, 186, 10, - 186, 186, 186, 186, 105, 186, 186, 186, 186, 186, - 186, 186, 186, 186, 0, 211, 0, 0, 0, 120, - 121, 0, 0, 0, 0, 0, 0, 0, 132, 0, + 157, 157, 157, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 148, 148, 148, 149, 149, 150, 141, + 140, 141, 0, 142, 11, 12, 137, 13, 137, 137, + 14, 15, 137, 16, 17, 18, 19, 20, 21, 6, + + 22, 23, 24, 25, 26, 28, 27, 29, 30, 31, + 32, 33, 34, 35, 137, 137, 137, 137, 137, 40, + 41, 137, 42, 43, 44, 45, 46, 47, 48, 137, + 49, 50, 51, 52, 53, 54, 55, 137, 56, 57, + 58, 59, 137, 62, 63, 137, 137, 137, 137, 137, + 137, 0, 0, 0, 0, 140, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 78, 79, 81, 0, + 156, 0, 0, 0, 0, 0, 0, 95, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 155, 154, + 154, 107, 0, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 145, 145, 146, 147, 0, 143, 11, 11, + 137, 12, 12, 12, 137, 137, 137, 137, 137, 15, + 15, 137, 128, 16, 16, 137, 17, 17, 137, 18, + 18, 137, 19, 19, 137, 20, 20, 137, 21, 21, + 137, 22, 22, 137, 24, 24, 137, 25, 25, 137, + 28, 28, 137, 27, 27, 137, 30, 30, 137, 31, + 31, 137, 32, 32, 137, 33, 33, 137, 34, 34, + 137, 35, 35, 137, 137, 137, 137, 36, 137, 38, + 137, 40, 40, 137, 41, 41, 137, 129, 42, 42, + 137, 43, 43, 137, 137, 45, 45, 137, 46, 46, + + 137, 47, 47, 137, 48, 48, 137, 137, 49, 49, + 137, 50, 50, 137, 51, 51, 137, 52, 52, 137, + 53, 53, 137, 54, 54, 137, 137, 10, 56, 137, + 57, 137, 58, 137, 59, 137, 60, 137, 62, 62, + 137, 137, 137, 137, 137, 137, 137, 137, 0, 162, + 0, 0, 0, 71, 72, 0, 0, 0, 0, 0, + 0, 0, 83, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 202, 0, 0, - 0, 160, 0, 162, 0, 0, 0, 0, 0, 0, - 201, 193, 186, 186, 186, 4, 186, 186, 186, 186, - 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, - 186, 186, 186, 186, 186, 186, 186, 186, 186, 9, - 186, 59, 186, 63, 186, 186, 186, 186, 186, 186, - 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, - 186, 186, 186, 186, 186, 186, 107, 186, 186, 186, - 186, 186, 116, 186, 186, 0, 0, 0, 0, 0, - 122, 123, 0, 0, 0, 0, 131, 0, 0, 135, - - 138, 0, 0, 0, 0, 0, 0, 0, 149, 150, - 0, 0, 0, 0, 155, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 186, 186, 186, 186, 186, - 186, 5, 186, 186, 186, 186, 186, 186, 186, 186, - 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, - 186, 7, 8, 186, 186, 186, 186, 186, 186, 186, - 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, - 186, 186, 186, 186, 186, 186, 186, 186, 186, 186, - 186, 186, 186, 186, 117, 186, 113, 0, 0, 0, - 0, 171, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 141, 0, 145, 146, 0, 148, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 164, 165, 0, - 0, 172, 12, 3, 14, 182, 183, 186, 17, 19, - 21, 23, 25, 27, 29, 31, 33, 36, 38, 43, - 41, 46, 48, 50, 52, 54, 56, 186, 186, 186, - 186, 66, 68, 70, 72, 74, 76, 78, 80, 82, - 186, 186, 186, 84, 86, 88, 90, 92, 94, 96, - 98, 100, 102, 104, 186, 186, 110, 112, 186, 115, - 173, 0, 0, 118, 0, 124, 0, 0, 0, 133, - 0, 0, 0, 0, 0, 0, 147, 0, 0, 153, - - 140, 0, 0, 0, 0, 0, 0, 169, 0, 186, - 58, 186, 62, 186, 179, 180, 186, 106, 186, 114, - 0, 0, 0, 0, 126, 129, 134, 0, 0, 139, - 0, 0, 0, 152, 0, 0, 0, 0, 161, 163, - 0, 186, 60, 64, 186, 108, 2, 1, 0, 125, - 0, 137, 0, 143, 151, 0, 0, 158, 159, 170, - 186, 181, 0, 136, 0, 154, 157, 186, 119, 142, - 186, 186, 184, 185, 0 + 0, 153, 0, 0, 0, 111, 0, 113, 0, 0, + 0, 0, 0, 0, 152, 144, 137, 137, 137, 4, + + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 9, 37, 39, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 60, 137, 61, + 137, 137, 137, 137, 137, 67, 137, 137, 0, 0, + 0, 0, 0, 73, 74, 0, 0, 0, 0, 82, + 0, 0, 86, 89, 0, 0, 0, 0, 0, 0, + 0, 100, 101, 0, 0, 0, 0, 106, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 137, 137, + + 137, 137, 137, 137, 5, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 7, 8, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, + 137, 137, 137, 137, 137, 137, 137, 137, 61, 137, + 137, 137, 137, 137, 68, 137, 64, 0, 0, 0, + 0, 122, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 92, 0, 96, 97, 0, 99, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 115, 116, 0, + 0, 123, 11, 3, 12, 133, 134, 137, 14, 15, + + 16, 17, 18, 19, 20, 21, 22, 24, 25, 28, + 27, 30, 31, 32, 33, 34, 35, 40, 41, 42, + 43, 44, 45, 46, 47, 48, 137, 137, 137, 49, + 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, + 137, 137, 62, 63, 137, 66, 124, 0, 0, 69, + 0, 75, 0, 0, 0, 84, 0, 0, 0, 0, + 0, 0, 98, 0, 0, 104, 91, 0, 0, 0, + 0, 0, 0, 120, 0, 137, 130, 131, 137, 60, + 137, 65, 0, 0, 0, 0, 77, 80, 85, 0, + 0, 90, 0, 0, 0, 103, 0, 0, 0, 0, + + 112, 114, 0, 137, 137, 61, 2, 1, 0, 76, + 0, 88, 0, 94, 102, 0, 0, 109, 110, 121, + 137, 132, 0, 87, 0, 105, 108, 137, 70, 93, + 137, 137, 135, 136, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -498,185 +505,199 @@ static yyconst flex_int32_t yy_meta[68] = 2, 2, 2, 2, 2, 2, 2 } ; -static yyconst flex_int16_t yy_base[779] = +static yyconst flex_int16_t yy_base[839] = { 0, - 0, 0, 1054, 1055, 66, 1055, 1048, 1049, 0, 69, - 85, 128, 140, 152, 151, 58, 56, 63, 76, 1027, - 158, 160, 39, 163, 173, 189, 52, 1020, 76, 990, - 989, 1001, 985, 999, 998, 105, 1027, 1039, 1055, 0, - 225, 1055, 218, 160, 157, 20, 123, 66, 119, 192, - 999, 985, 54, 162, 983, 995, 194, 1055, 200, 195, - 98, 227, 196, 231, 235, 293, 305, 316, 1055, 1055, - 1055, 1004, 1017, 1011, 223, 1000, 1003, 999, 1014, 107, - 298, 996, 1010, 246, 996, 1009, 1000, 1013, 990, 1001, - 992, 182, 993, 984, 993, 984, 983, 984, 144, 978, - - 984, 995, 986, 980, 977, 978, 982, 289, 991, 978, - 302, 985, 972, 986, 962, 65, 315, 989, 981, 980, - 956, 941, 936, 953, 929, 934, 960, 279, 949, 293, - 944, 342, 299, 946, 927, 317, 937, 933, 928, 207, - 934, 920, 936, 933, 924, 320, 324, 926, 915, 929, - 932, 914, 929, 916, 913, 920, 284, 928, 227, 288, - 327, 342, 345, 905, 922, 923, 916, 898, 318, 899, - 921, 912, 330, 341, 345, 349, 353, 357, 361, 1055, - 419, 430, 436, 442, 920, 205, 944, 0, 943, 926, - 916, 915, 935, 913, 912, 911, 910, 909, 908, 0, - - 907, 0, 906, 905, 0, 904, 903, 0, 902, 901, - 900, 899, 898, 897, 913, 906, 919, 354, 356, 893, - 892, 898, 890, 889, 888, 887, 886, 885, 884, 905, - 882, 881, 880, 879, 878, 877, 876, 886, 874, 873, - 872, 871, 357, 870, 869, 861, 860, 845, 845, 844, - 843, 886, 858, 846, 448, 456, 430, 850, 418, 847, - 841, 841, 835, 848, 848, 833, 1055, 1055, 848, 836, - 432, 843, 135, 840, 846, 433, 841, 1055, 832, 839, - 838, 841, 827, 826, 830, 825, 330, 830, 439, 442, - 451, 1055, 822, 820, 820, 828, 829, 811, 456, 816, - - 822, 441, 447, 454, 458, 462, 520, 526, 836, 848, - 834, 833, 826, 840, 830, 829, 0, 828, 827, 826, - 825, 824, 823, 822, 821, 820, 819, 818, 817, 816, - 815, 814, 813, 812, 815, 808, 815, 800, 807, 798, - 821, 804, 803, 0, 802, 801, 800, 799, 798, 797, - 796, 799, 794, 793, 792, 791, 790, 789, 788, 0, - 787, 786, 785, 784, 775, 782, 781, 780, 758, 752, - 757, 763, 746, 761, 495, 1055, 760, 750, 754, 1055, - 1055, 744, 753, 739, 756, 739, 742, 736, 1055, 737, - 736, 733, 740, 733, 741, 737, 747, 744, 726, 732, - - 739, 723, 722, 740, 722, 734, 733, 1055, 732, 722, - 726, 1055, 713, 1055, 718, 718, 726, 709, 710, 720, - 1055, 1055, 752, 734, 750, 0, 532, 748, 748, 747, - 746, 745, 744, 743, 742, 741, 740, 739, 738, 737, - 736, 735, 734, 733, 732, 731, 730, 717, 710, 0, - 710, 701, 708, 699, 723, 722, 721, 720, 719, 718, - 717, 716, 715, 693, 713, 712, 711, 710, 709, 708, - 707, 706, 705, 704, 703, 685, 676, 700, 699, 668, - 671, 651, 0, 652, 645, 652, 651, 652, 644, 662, - 1055, 1055, 644, 642, 652, 645, 1055, 640, 657, 345, - - 1055, 648, 632, 633, 642, 633, 632, 632, 1055, 631, - 640, 630, 646, 643, 1055, 642, 640, 629, 630, 626, - 618, 625, 620, 621, 616, 642, 642, 640, 654, 653, - 648, 0, 636, 635, 634, 633, 632, 631, 630, 629, - 628, 627, 626, 625, 624, 623, 622, 621, 620, 619, - 618, 0, 0, 635, 617, 633, 615, 613, 612, 611, - 610, 609, 608, 607, 606, 605, 484, 604, 603, 602, - 601, 600, 599, 598, 597, 596, 595, 594, 611, 593, - 591, 590, 568, 568, 0, 575, 0, 609, 608, 557, - 575, 1055, 570, 565, 558, 554, 566, 556, 554, 550, - - 566, 557, 556, 1055, 1055, 559, 1055, 554, 547, 536, - 547, 539, 543, 556, 551, 554, 536, 1055, 1055, 548, - 537, 1055, 0, 0, 0, 0, 0, 576, 0, 0, + 0, 0, 1283, 1284, 66, 1284, 1277, 1278, 0, 69, + 85, 128, 140, 152, 151, 58, 56, 63, 76, 1256, + 158, 160, 39, 163, 173, 189, 52, 1249, 76, 1219, + 1218, 1230, 1214, 1228, 1227, 105, 1256, 1268, 1284, 0, + 225, 1284, 218, 160, 157, 20, 123, 66, 119, 192, + 1228, 1214, 54, 162, 1212, 1224, 194, 1284, 200, 195, + 98, 227, 196, 231, 235, 293, 305, 316, 1284, 1284, + 1284, 1233, 1246, 1240, 223, 1229, 1232, 1228, 1243, 107, + 298, 1225, 1239, 246, 1225, 1238, 1229, 1242, 1219, 1230, + 1221, 182, 1222, 1213, 1222, 1213, 1212, 1213, 144, 1207, + + 1213, 1224, 1215, 1209, 1206, 1207, 1211, 289, 1220, 1207, + 302, 1214, 1201, 1215, 1191, 65, 315, 1218, 1210, 1209, + 1185, 1170, 1165, 1182, 1158, 1163, 1189, 279, 1178, 293, + 1173, 342, 299, 1175, 1156, 317, 1166, 1162, 1157, 207, + 1163, 1149, 1165, 1162, 1153, 320, 324, 1155, 1144, 1158, + 1161, 1143, 1158, 1145, 1142, 1149, 284, 1157, 227, 288, + 327, 342, 345, 1134, 1151, 1152, 1145, 1127, 318, 1128, + 1150, 1141, 330, 341, 345, 349, 353, 357, 361, 1284, + 419, 430, 436, 442, 440, 441, 1174, 0, 1173, 1156, + 1146, 443, 1166, 444, 451, 468, 470, 472, 471, 0, + + 496, 0, 497, 498, 0, 499, 500, 0, 524, 525, + 526, 536, 537, 553, 1161, 1154, 1167, 354, 356, 561, + 563, 1148, 564, 565, 1140, 580, 590, 591, 592, 1161, + 593, 617, 618, 619, 629, 630, 1138, 1148, 247, 330, + 362, 419, 445, 646, 1136, 1128, 1127, 1112, 1112, 1111, + 1110, 1153, 1125, 1113, 662, 669, 643, 1117, 487, 1114, + 1108, 1108, 1102, 1115, 1115, 1100, 1284, 1284, 1115, 1103, + 646, 1110, 135, 1107, 1113, 561, 1108, 1284, 1099, 1106, + 1105, 1108, 1094, 1093, 1097, 1092, 330, 1097, 650, 653, + 665, 1284, 1089, 1087, 1087, 1095, 1096, 1078, 670, 1083, + + 1089, 432, 460, 486, 579, 655, 715, 722, 1095, 682, + 1102, 1093, 697, 721, 1100, 1099, 1092, 1106, 1096, 1087, + 699, 1094, 0, 1085, 724, 1092, 1083, 725, 1090, 1081, + 726, 1088, 1079, 727, 1086, 1077, 728, 1084, 1075, 729, + 1082, 1073, 730, 1080, 1071, 731, 1078, 1069, 732, 1076, + 1067, 733, 1074, 1065, 734, 1072, 1063, 735, 1070, 1061, + 736, 1068, 1059, 737, 1066, 1057, 738, 1064, 1055, 739, + 1062, 1053, 740, 1060, 1063, 1056, 1063, 0, 1056, 0, + 1071, 1046, 741, 1053, 1044, 742, 1051, 0, 1042, 743, + 1049, 1040, 745, 1047, 1046, 1037, 746, 1044, 1035, 767, + + 1042, 1033, 770, 1040, 1031, 771, 1038, 1041, 1028, 772, + 1035, 1026, 773, 1033, 1024, 774, 1031, 1022, 775, 1029, + 1020, 776, 1027, 1018, 777, 1025, 1024, 0, 1015, 1022, + 1013, 1020, 1011, 1018, 1009, 1016, 778, 1015, 1006, 779, + 1013, 1012, 990, 984, 989, 995, 978, 993, 424, 1284, + 992, 982, 986, 1284, 1284, 976, 985, 971, 988, 971, + 974, 968, 1284, 969, 968, 965, 972, 965, 973, 969, + 979, 976, 958, 964, 971, 955, 954, 972, 954, 966, + 965, 1284, 964, 954, 958, 1284, 945, 1284, 950, 950, + 958, 941, 942, 952, 1284, 1284, 984, 966, 982, 0, + + 788, 980, 980, 979, 978, 977, 976, 975, 974, 973, + 972, 971, 970, 969, 968, 967, 966, 965, 964, 963, + 962, 949, 942, 0, 0, 0, 959, 958, 957, 956, + 955, 954, 953, 952, 951, 929, 949, 948, 947, 946, + 945, 944, 943, 942, 941, 940, 939, 913, 920, 783, + 936, 935, 904, 907, 887, 0, 888, 881, 888, 887, + 888, 880, 898, 1284, 1284, 880, 878, 888, 881, 1284, + 876, 893, 345, 1284, 884, 868, 869, 878, 869, 868, + 868, 1284, 867, 876, 866, 882, 879, 1284, 878, 876, + 865, 866, 862, 854, 861, 856, 857, 852, 878, 878, + + 876, 890, 889, 884, 0, 872, 871, 870, 869, 868, + 867, 866, 865, 864, 863, 862, 861, 860, 859, 858, + 857, 856, 855, 854, 0, 0, 853, 852, 851, 850, + 849, 848, 847, 846, 845, 791, 844, 843, 842, 841, + 840, 839, 838, 837, 836, 835, 834, 851, 825, 832, + 830, 829, 807, 807, 0, 814, 0, 848, 847, 796, + 814, 1284, 809, 804, 797, 793, 805, 795, 793, 789, + 805, 796, 795, 1284, 1284, 798, 1284, 793, 786, 775, + 786, 778, 782, 795, 790, 793, 775, 1284, 1284, 787, + 776, 1284, 0, 0, 0, 0, 0, 815, 0, 0, + + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 811, 803, 790, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 557, 574, 555, - 572, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 568, 567, 565, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 550, 567, 0, 0, 521, 0, - 0, 572, 571, 1055, 518, 1055, 522, 522, 531, 1055, - 515, 529, 517, 519, 516, 518, 1055, 496, 507, 1055, - - 1055, 511, 507, 500, 497, 497, 510, 1055, 494, 534, - 0, 518, 0, 517, 0, 0, 532, 0, 515, 0, - 67, 187, 172, 202, 1055, 1055, 1055, 219, 243, 1055, - 245, 246, 300, 1055, 292, 315, 332, 340, 1055, 1055, - 357, 406, 0, 0, 402, 0, 1055, 1055, 381, 1055, - 423, 1055, 437, 1055, 1055, 431, 429, 1055, 1055, 1055, - 460, 0, 448, 1055, 444, 1055, 1055, 534, 1055, 1055, - 496, 528, 0, 0, 1055, 565, 546, 568 + 775, 791, 0, 0, 745, 0, 0, 796, 795, 1284, + 737, 1284, 655, 655, 661, 1284, 644, 658, 643, 644, + 635, 620, 1284, 598, 608, 1284, 1284, 604, 586, 579, + 567, 567, 574, 1284, 557, 582, 0, 0, 582, 0, + 565, 0, 582, 580, 539, 525, 1284, 1284, 1284, 527, + 527, 1284, 525, 497, 499, 1284, 478, 451, 439, 441, + + 1284, 1284, 431, 441, 366, 0, 1284, 1284, 21, 1284, + 144, 1284, 176, 1284, 1284, 182, 187, 1284, 1284, 1284, + 220, 0, 235, 1284, 245, 1284, 1284, 424, 1284, 1284, + 327, 373, 0, 0, 1284, 824, 396, 827 } ; -static yyconst flex_int16_t yy_def[779] = +static yyconst flex_int16_t yy_def[839] = { 0, - 775, 1, 775, 775, 775, 775, 775, 776, 777, 775, - 775, 775, 775, 775, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 775, 775, 776, 775, 777, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 778, 775, 775, 775, 775, - 775, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 777, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - - 775, 775, 775, 775, 775, 775, 775, 775, 777, 777, - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 777, 777, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 777, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - - 775, 775, 775, 775, 775, 775, 775, 775, 775, 777, - 777, 777, 777, 777, 777, 777, 777, 777, 777, 777, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 775, 777, 777, 777, 777, 777, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 777, 777, 775, 775, 775, 775, 775, 777, 775, 775, - 777, 777, 777, 777, 0, 775, 775, 775 + 835, 1, 835, 835, 835, 835, 835, 836, 837, 835, + 835, 835, 835, 835, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 835, 835, 836, 835, 837, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 838, 835, 835, 835, 835, + 835, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + + 835, 835, 835, 835, 835, 835, 835, 835, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 837, 837, 837, 837, + + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 837, 837, + + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 837, 837, 837, 837, 837, 837, 837, 837, + + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 837, 837, 837, 837, 837, 837, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 837, 837, 837, 837, 837, + 837, 837, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + + 835, 835, 835, 837, 837, 837, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 837, 837, 835, 835, 835, 835, 835, 837, 835, 835, + 837, 837, 837, 837, 0, 835, 835, 835 } ; -static yyconst flex_int16_t yy_nxt[1123] = +static yyconst flex_int16_t yy_nxt[1352] = { 0, 4, 5, 6, 5, 7, 8, 9, 4, 10, 11, 12, 13, 14, 11, 11, 15, 9, 16, 17, 18, @@ -685,7 +706,7 @@ static yyconst flex_int16_t yy_nxt[1123] = 9, 9, 9, 9, 9, 9, 30, 9, 9, 9, 9, 9, 9, 9, 9, 9, 31, 9, 32, 33, 34, 9, 35, 9, 9, 9, 9, 36, 96, 36, - 41, 116, 137, 97, 80, 138, 747, 42, 43, 43, + 41, 116, 137, 97, 80, 138, 823, 42, 43, 43, 43, 43, 43, 43, 77, 81, 78, 119, 82, 117, 83, 238, 79, 66, 67, 67, 67, 67, 67, 67, @@ -697,114 +718,139 @@ static yyconst flex_int16_t yy_nxt[1123] = 67, 67, 67, 67, 67, 218, 171, 219, 70, 68, 66, 67, 67, 67, 67, 67, 67, 72, 139, 73, 71, 68, 140, 68, 144, 92, 74, 145, 98, 88, - 390, 89, 75, 93, 76, 68, 90, 99, 94, 91, - 101, 100, 102, 103, 95, 391, 748, 68, 136, 133, + 464, 89, 75, 93, 76, 68, 90, 99, 94, 91, + 101, 100, 102, 103, 95, 465, 824, 68, 136, 133, 210, 133, 133, 152, 133, 104, 105, 133, 106, 107, 108, 109, 110, 134, 111, 133, 112, 153, 133, 211, - 135, 749, 113, 114, 154, 115, 41, 43, 43, 43, - 43, 43, 43, 146, 147, 157, 310, 132, 165, 133, - 166, 161, 162, 167, 168, 311, 158, 163, 188, 159, - 133, 169, 160, 264, 189, 164, 750, 201, 133, 174, - 173, 175, 176, 132, 751, 265, 128, 129, 46, 47, + 135, 825, 113, 114, 154, 115, 41, 43, 43, 43, + 43, 43, 43, 146, 147, 157, 826, 132, 165, 133, + 166, 161, 162, 167, 168, 827, 158, 163, 188, 159, + 133, 169, 160, 264, 189, 164, 828, 201, 133, 174, + 173, 175, 176, 132, 429, 265, 128, 129, 46, 47, 48, 49, 172, 51, 52, 202, 284, 53, 54, 55, - 56, 57, 58, 130, 60, 61, 285, 752, 131, 753, + 56, 57, 58, 130, 60, 61, 285, 430, 131, 829, 173, 173, 173, 173, 177, 173, 173, 178, 179, 173, - 173, 173, 181, 181, 181, 181, 181, 181, 228, 754, + 173, 173, 181, 181, 181, 181, 181, 181, 228, 830, 196, 197, 182, 66, 67, 67, 67, 67, 67, 67, 198, 232, 229, 183, 68, 184, 184, 184, 184, 184, 184, 240, 134, 241, 254, 233, 281, 286, 182, 135, - 257, 257, 282, 287, 242, 755, 257, 756, 164, 255, + 257, 257, 282, 287, 242, 833, 257, 431, 164, 255, 68, 256, 256, 256, 256, 256, 256, 257, 257, 257, 260, 257, 257, 297, 257, 271, 257, 257, 257, 257, - 757, 257, 340, 298, 257, 257, 338, 405, 257, 365, - 406, 288, 257, 289, 257, 257, 290, 291, 339, 257, - 341, 366, 257, 302, 302, 302, 302, 758, 599, 759, + 432, 257, 380, 298, 257, 257, 378, 479, 257, 433, + 480, 288, 257, 289, 257, 257, 290, 291, 379, 257, + 381, 834, 257, 302, 302, 302, 302, 40, 669, 822, - 257, 600, 760, 257, 302, 302, 302, 302, 303, 302, + 257, 670, 434, 257, 302, 302, 302, 302, 303, 302, 302, 304, 305, 302, 302, 302, 302, 302, 302, 302, 306, 302, 302, 302, 302, 302, 302, 302, 43, 43, - 43, 43, 43, 43, 761, 762, 763, 307, 132, 308, + 43, 43, 43, 43, 831, 832, 435, 307, 132, 308, 308, 308, 308, 308, 308, 184, 184, 184, 184, 184, - 184, 184, 184, 184, 184, 184, 184, 256, 256, 256, - 256, 256, 256, 378, 132, 256, 256, 256, 256, 256, - 256, 376, 376, 376, 376, 764, 379, 376, 394, 376, - 376, 376, 765, 376, 376, 766, 376, 767, 376, 376, - 376, 395, 408, 376, 661, 662, 768, 376, 376, 415, - - 376, 416, 769, 417, 421, 421, 421, 421, 770, 376, - 421, 421, 421, 421, 773, 663, 418, 422, 421, 421, - 421, 421, 421, 421, 421, 421, 421, 421, 421, 308, - 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, - 308, 486, 529, 530, 771, 772, 774, 40, 746, 745, - 744, 743, 742, 741, 740, 739, 738, 487, 737, 736, - 735, 734, 733, 732, 531, 38, 38, 38, 180, 180, - 731, 730, 729, 728, 727, 726, 725, 724, 723, 722, - 721, 720, 719, 718, 717, 716, 715, 714, 713, 712, - 711, 710, 709, 708, 707, 706, 705, 704, 703, 702, - - 701, 700, 699, 698, 697, 696, 695, 694, 693, 692, - 691, 690, 689, 688, 687, 686, 685, 684, 683, 682, - 681, 680, 679, 678, 677, 676, 675, 674, 673, 672, - 671, 670, 669, 668, 667, 666, 665, 664, 660, 659, - 658, 657, 656, 655, 654, 653, 652, 651, 650, 649, - 648, 647, 646, 645, 644, 643, 642, 641, 640, 639, - 638, 637, 636, 635, 634, 633, 632, 631, 630, 629, - 628, 627, 626, 625, 624, 623, 622, 621, 620, 619, - 618, 617, 616, 615, 614, 613, 612, 611, 610, 609, - 608, 607, 606, 605, 604, 603, 602, 601, 598, 597, - - 596, 595, 594, 593, 592, 591, 590, 589, 588, 587, - 586, 585, 584, 583, 582, 581, 580, 579, 578, 577, - 576, 575, 574, 573, 572, 571, 570, 569, 568, 567, - 566, 565, 564, 563, 562, 561, 560, 559, 558, 557, - 556, 555, 554, 553, 552, 551, 550, 549, 548, 547, - 546, 545, 544, 543, 542, 541, 540, 539, 538, 537, - 536, 535, 534, 533, 532, 528, 527, 526, 525, 524, - 523, 522, 521, 520, 519, 518, 517, 516, 515, 514, - 513, 512, 511, 510, 509, 508, 507, 506, 505, 504, - 503, 502, 501, 500, 499, 498, 497, 496, 495, 494, - - 493, 492, 491, 490, 489, 488, 485, 484, 483, 482, - 481, 480, 479, 478, 477, 476, 475, 474, 473, 472, - 471, 470, 469, 468, 467, 466, 465, 464, 463, 462, - 461, 460, 459, 458, 457, 456, 455, 454, 453, 452, - 451, 450, 449, 448, 447, 446, 445, 444, 443, 442, - 441, 440, 439, 438, 437, 436, 435, 434, 433, 432, - 431, 430, 429, 428, 427, 426, 425, 424, 423, 420, - 419, 414, 413, 412, 411, 410, 409, 407, 404, 403, - 402, 401, 400, 399, 398, 397, 396, 393, 392, 389, - 388, 387, 386, 385, 384, 383, 382, 381, 380, 377, - - 288, 260, 375, 374, 373, 372, 371, 370, 369, 368, - 367, 364, 363, 362, 361, 360, 359, 358, 357, 356, - 355, 354, 353, 352, 351, 350, 349, 348, 347, 346, - 345, 344, 343, 342, 337, 336, 335, 334, 333, 332, - 331, 330, 329, 328, 327, 326, 325, 324, 323, 322, - 321, 320, 319, 318, 317, 316, 315, 314, 313, 312, - 309, 301, 300, 299, 296, 295, 294, 293, 292, 283, - 280, 279, 278, 277, 276, 275, 274, 273, 272, 270, - 269, 268, 267, 266, 263, 262, 261, 259, 258, 172, - 253, 252, 251, 250, 249, 248, 247, 246, 245, 244, - - 243, 237, 236, 235, 234, 231, 230, 227, 226, 225, - 224, 223, 222, 221, 220, 217, 216, 215, 214, 213, - 212, 209, 208, 207, 206, 205, 204, 203, 200, 199, - 193, 192, 191, 190, 187, 186, 185, 156, 155, 149, - 148, 39, 127, 126, 125, 124, 123, 122, 121, 118, - 87, 39, 37, 775, 3, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775 + 184, 184, 184, 184, 184, 184, 184, 309, 312, 436, + 320, 324, 310, 313, 132, 321, 325, 437, 327, 821, + 559, 310, 314, 328, 321, 325, 820, 310, 313, 438, + 311, 315, 328, 322, 326, 330, 560, 333, 339, 336, + 331, 329, 334, 340, 337, 495, 495, 495, 495, 331, + + 819, 334, 340, 337, 818, 331, 817, 334, 332, 337, + 335, 341, 338, 342, 345, 348, 351, 354, 343, 346, + 349, 352, 355, 495, 495, 495, 495, 343, 346, 349, + 352, 355, 452, 816, 346, 349, 344, 347, 350, 353, + 356, 357, 360, 363, 815, 453, 358, 361, 364, 496, + 495, 495, 495, 366, 369, 358, 361, 364, 367, 370, + 814, 358, 361, 364, 359, 362, 365, 367, 370, 813, + 372, 812, 811, 367, 370, 373, 368, 371, 382, 810, + 385, 389, 392, 383, 373, 386, 390, 393, 809, 808, + 373, 807, 383, 374, 386, 390, 393, 396, 806, 805, + + 804, 384, 397, 387, 391, 394, 468, 399, 402, 405, + 409, 397, 400, 403, 406, 410, 803, 397, 802, 469, + 398, 400, 403, 406, 410, 801, 800, 400, 403, 406, + 401, 404, 407, 411, 412, 415, 418, 799, 798, 413, + 416, 419, 495, 495, 495, 495, 421, 424, 413, 416, + 419, 422, 425, 797, 413, 416, 419, 414, 417, 420, + 422, 425, 796, 439, 795, 794, 422, 425, 440, 423, + 426, 256, 256, 256, 256, 256, 256, 440, 256, 256, + 256, 256, 256, 256, 450, 450, 441, 450, 450, 793, + 450, 450, 450, 450, 450, 450, 792, 450, 791, 309, + + 450, 450, 790, 789, 450, 788, 482, 450, 450, 787, + 786, 450, 450, 489, 312, 490, 320, 491, 495, 495, + 495, 495, 311, 450, 308, 308, 308, 308, 308, 308, + 492, 308, 308, 308, 308, 308, 308, 315, 312, 322, + 498, 324, 327, 330, 333, 336, 339, 342, 345, 348, + 351, 354, 357, 360, 363, 366, 369, 372, 382, 385, + 389, 315, 392, 396, 326, 329, 332, 335, 338, 341, + 344, 347, 350, 353, 356, 359, 362, 365, 368, 371, + 374, 384, 387, 391, 399, 394, 398, 402, 405, 409, + 412, 415, 418, 421, 424, 548, 439, 785, 602, 603, + + 649, 727, 728, 784, 783, 782, 781, 401, 780, 779, + 404, 407, 411, 414, 417, 420, 423, 426, 549, 441, + 604, 778, 729, 650, 38, 38, 38, 180, 180, 777, + 776, 775, 774, 773, 772, 771, 770, 769, 768, 767, + 766, 765, 764, 763, 762, 761, 760, 759, 758, 757, + 756, 755, 754, 753, 752, 751, 750, 749, 748, 747, + 746, 745, 744, 743, 742, 650, 741, 740, 739, 738, + 737, 736, 735, 734, 733, 732, 731, 730, 726, 725, + 724, 723, 722, 721, 720, 719, 718, 717, 716, 715, + 714, 713, 712, 711, 710, 709, 708, 707, 706, 705, + + 704, 703, 702, 701, 700, 699, 698, 697, 696, 695, + 694, 693, 692, 691, 690, 689, 688, 687, 686, 685, + 684, 683, 682, 681, 680, 679, 678, 677, 676, 675, + 674, 673, 672, 671, 668, 667, 666, 665, 664, 663, + 662, 661, 660, 659, 658, 657, 656, 655, 654, 653, + 652, 651, 648, 549, 647, 646, 645, 644, 643, 642, + 641, 640, 639, 638, 637, 636, 635, 634, 633, 632, + 631, 630, 629, 628, 627, 626, 625, 624, 623, 622, + 621, 620, 619, 618, 617, 616, 615, 614, 613, 612, + 611, 610, 609, 608, 607, 606, 605, 601, 600, 599, + + 598, 597, 596, 595, 594, 593, 592, 591, 590, 589, + 588, 587, 586, 585, 584, 583, 582, 581, 580, 579, + 578, 577, 576, 575, 574, 573, 572, 571, 570, 569, + 568, 567, 566, 565, 564, 563, 562, 561, 558, 557, + 556, 555, 554, 553, 552, 551, 441, 550, 547, 436, + 546, 434, 545, 432, 544, 430, 543, 542, 426, 541, + 423, 540, 420, 539, 417, 538, 414, 537, 411, 536, + 535, 407, 534, 404, 533, 401, 532, 398, 531, 530, + 394, 529, 391, 528, 387, 527, 384, 526, 525, 524, + 523, 522, 521, 374, 520, 371, 519, 368, 518, 365, + + 517, 362, 516, 359, 515, 356, 514, 353, 513, 350, + 512, 347, 511, 344, 510, 341, 509, 338, 508, 335, + 507, 332, 506, 329, 505, 326, 504, 322, 503, 502, + 501, 500, 499, 315, 497, 311, 494, 493, 488, 487, + 486, 485, 484, 483, 481, 478, 477, 476, 475, 474, + 473, 472, 471, 470, 467, 466, 463, 462, 461, 460, + 459, 458, 457, 456, 455, 454, 451, 288, 260, 449, + 448, 447, 446, 445, 444, 443, 442, 428, 427, 408, + 395, 388, 377, 376, 375, 323, 319, 318, 317, 316, + 301, 300, 299, 296, 295, 294, 293, 292, 283, 280, + + 279, 278, 277, 276, 275, 274, 273, 272, 270, 269, + 268, 267, 266, 263, 262, 261, 259, 258, 172, 253, + 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, + 237, 236, 235, 234, 231, 230, 227, 226, 225, 224, + 223, 222, 221, 220, 217, 216, 215, 214, 213, 212, + 209, 208, 207, 206, 205, 204, 203, 200, 199, 193, + 192, 191, 190, 187, 186, 185, 156, 155, 149, 148, + 39, 127, 126, 125, 124, 123, 122, 121, 118, 87, + 39, 37, 835, 3, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835 } ; -static yyconst flex_int16_t yy_chk[1123] = +static yyconst flex_int16_t yy_chk[1352] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -813,7 +859,7 @@ static yyconst flex_int16_t yy_chk[1123] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 23, 5, - 10, 27, 46, 23, 17, 46, 721, 10, 10, 10, + 10, 27, 46, 23, 17, 46, 809, 10, 10, 10, 10, 10, 10, 10, 16, 17, 16, 29, 17, 27, 18, 116, 16, 11, 11, 11, 11, 11, 11, 11, @@ -826,110 +872,135 @@ static yyconst flex_int16_t yy_chk[1123] = 14, 14, 14, 14, 14, 14, 14, 15, 47, 15, 14, 14, 47, 12, 49, 22, 15, 49, 24, 21, 273, 21, 15, 22, 15, 13, 21, 24, 22, 21, - 25, 24, 25, 25, 22, 273, 722, 14, 45, 45, + 25, 24, 25, 25, 22, 273, 811, 14, 45, 45, 92, 44, 44, 54, 45, 25, 26, 44, 26, 26, 26, 26, 26, 44, 26, 45, 26, 54, 44, 92, - 44, 723, 26, 26, 54, 26, 41, 43, 43, 43, - 43, 43, 43, 50, 50, 57, 186, 43, 60, 50, - 60, 59, 59, 60, 60, 186, 57, 59, 75, 57, - 50, 60, 57, 140, 75, 59, 724, 84, 59, 63, - 63, 63, 63, 43, 728, 140, 41, 41, 41, 41, + 44, 813, 26, 26, 54, 26, 41, 43, 43, 43, + 43, 43, 43, 50, 50, 57, 816, 43, 60, 50, + 60, 59, 59, 60, 60, 817, 57, 59, 75, 57, + 50, 60, 57, 140, 75, 59, 821, 84, 59, 63, + 63, 63, 63, 43, 239, 140, 41, 41, 41, 41, 41, 41, 62, 41, 41, 84, 159, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 159, 729, 41, 731, + 41, 41, 41, 41, 41, 41, 159, 239, 41, 823, 62, 62, 62, 62, 64, 64, 64, 64, 65, 65, - 65, 65, 66, 66, 66, 66, 66, 66, 108, 732, + 65, 65, 66, 66, 66, 66, 66, 66, 108, 825, 81, 81, 66, 67, 67, 67, 67, 67, 67, 67, 81, 111, 108, 68, 67, 68, 68, 68, 68, 68, 68, 117, 128, 117, 130, 111, 157, 160, 66, 128, - 133, 133, 157, 160, 117, 733, 133, 735, 130, 132, + 133, 133, 157, 160, 117, 831, 133, 240, 130, 132, 67, 132, 132, 132, 132, 132, 132, 133, 136, 136, 136, 146, 146, 169, 136, 147, 147, 146, 161, 161, - 736, 147, 219, 169, 161, 136, 218, 287, 146, 243, + 240, 147, 219, 169, 161, 136, 218, 287, 146, 241, 287, 161, 147, 162, 162, 161, 163, 163, 218, 162, - 219, 243, 163, 173, 173, 173, 173, 737, 500, 738, + 219, 832, 163, 173, 173, 173, 173, 837, 573, 805, - 162, 500, 741, 163, 174, 174, 174, 174, 175, 175, + 162, 573, 241, 163, 174, 174, 174, 174, 175, 175, 175, 175, 176, 176, 176, 176, 177, 177, 177, 177, 178, 178, 178, 178, 179, 179, 179, 179, 181, 181, - 181, 181, 181, 181, 742, 745, 749, 182, 181, 182, + 181, 181, 181, 181, 828, 828, 242, 182, 181, 182, 182, 182, 182, 182, 182, 183, 183, 183, 183, 183, - 183, 184, 184, 184, 184, 184, 184, 255, 255, 255, - 255, 255, 255, 259, 181, 256, 256, 256, 256, 256, - 256, 257, 257, 271, 271, 751, 259, 257, 276, 271, - 289, 289, 753, 290, 290, 756, 289, 757, 257, 290, - 271, 276, 291, 291, 567, 567, 761, 289, 291, 299, - - 290, 299, 763, 299, 302, 302, 302, 302, 765, 291, - 303, 303, 303, 303, 771, 567, 299, 304, 304, 304, - 304, 305, 305, 305, 305, 306, 306, 306, 306, 307, - 307, 307, 307, 307, 307, 308, 308, 308, 308, 308, - 308, 375, 427, 427, 768, 768, 772, 777, 719, 717, - 714, 712, 710, 709, 707, 706, 705, 375, 704, 703, - 702, 699, 698, 696, 427, 776, 776, 776, 778, 778, - 695, 694, 693, 692, 691, 689, 688, 687, 685, 683, - 682, 679, 676, 675, 663, 662, 661, 651, 650, 649, - 648, 628, 621, 620, 617, 616, 615, 614, 613, 612, - - 611, 610, 609, 608, 606, 603, 602, 601, 600, 599, - 598, 597, 596, 595, 594, 593, 591, 590, 589, 588, - 586, 584, 583, 582, 581, 580, 579, 578, 577, 576, - 575, 574, 573, 572, 571, 570, 569, 568, 566, 565, - 564, 563, 562, 561, 560, 559, 558, 557, 556, 555, - 554, 551, 550, 549, 548, 547, 546, 545, 544, 543, - 542, 541, 540, 539, 538, 537, 536, 535, 534, 533, - 531, 530, 529, 528, 527, 526, 525, 524, 523, 522, - 521, 520, 519, 518, 517, 516, 514, 513, 512, 511, - 510, 508, 507, 506, 505, 504, 503, 502, 499, 498, - - 496, 495, 494, 493, 490, 489, 488, 487, 486, 485, - 484, 482, 481, 480, 479, 478, 477, 476, 475, 474, - 473, 472, 471, 470, 469, 468, 467, 466, 465, 464, - 463, 462, 461, 460, 459, 458, 457, 456, 455, 454, - 453, 452, 451, 449, 448, 447, 446, 445, 444, 443, - 442, 441, 440, 439, 438, 437, 436, 435, 434, 433, - 432, 431, 430, 429, 428, 425, 424, 423, 420, 419, - 418, 417, 416, 415, 413, 411, 410, 409, 407, 406, - 405, 404, 403, 402, 401, 400, 399, 398, 397, 396, - 395, 394, 393, 392, 391, 390, 388, 387, 386, 385, - - 384, 383, 382, 379, 378, 377, 374, 373, 372, 371, - 370, 369, 368, 367, 366, 365, 364, 363, 362, 361, - 359, 358, 357, 356, 355, 354, 353, 352, 351, 350, - 349, 348, 347, 346, 345, 343, 342, 341, 340, 339, - 338, 337, 336, 335, 334, 333, 332, 331, 330, 329, - 328, 327, 326, 325, 324, 323, 322, 321, 320, 319, - 318, 316, 315, 314, 313, 312, 311, 310, 309, 301, - 300, 298, 297, 296, 295, 294, 293, 288, 286, 285, - 284, 283, 282, 281, 280, 279, 277, 275, 274, 272, - 270, 269, 266, 265, 264, 263, 262, 261, 260, 258, - - 254, 253, 252, 251, 250, 249, 248, 247, 246, 245, - 244, 242, 241, 240, 239, 238, 237, 236, 235, 234, - 233, 232, 231, 230, 229, 228, 227, 226, 225, 224, - 223, 222, 221, 220, 217, 216, 215, 214, 213, 212, - 211, 210, 209, 207, 206, 204, 203, 201, 199, 198, - 197, 196, 195, 194, 193, 192, 191, 190, 189, 187, - 185, 172, 171, 170, 168, 167, 166, 165, 164, 158, - 156, 155, 154, 153, 152, 151, 150, 149, 148, 145, - 144, 143, 142, 141, 139, 138, 137, 135, 134, 131, - 129, 127, 126, 125, 124, 123, 122, 121, 120, 119, - - 118, 115, 114, 113, 112, 110, 109, 107, 106, 105, - 104, 103, 102, 101, 100, 98, 97, 96, 95, 94, - 93, 91, 90, 89, 88, 87, 86, 85, 83, 82, - 79, 78, 77, 76, 74, 73, 72, 56, 55, 52, - 51, 38, 37, 35, 34, 33, 32, 31, 30, 28, - 20, 8, 7, 3, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, - 775, 775 + 183, 184, 184, 184, 184, 184, 184, 185, 186, 242, + 192, 194, 185, 186, 181, 192, 194, 243, 195, 804, + 449, 185, 186, 195, 192, 194, 803, 185, 186, 243, + 185, 186, 195, 192, 194, 196, 449, 197, 199, 198, + 196, 195, 197, 199, 198, 302, 302, 302, 302, 196, + + 800, 197, 199, 198, 799, 196, 798, 197, 196, 198, + 197, 199, 198, 201, 203, 204, 206, 207, 201, 203, + 204, 206, 207, 303, 303, 303, 303, 201, 203, 204, + 206, 207, 259, 797, 203, 204, 201, 203, 204, 206, + 207, 209, 210, 211, 795, 259, 209, 210, 211, 304, + 304, 304, 304, 212, 213, 209, 210, 211, 212, 213, + 794, 209, 210, 211, 209, 210, 211, 212, 213, 793, + 214, 791, 790, 212, 213, 214, 212, 213, 220, 786, + 221, 223, 224, 220, 214, 221, 223, 224, 785, 784, + 214, 783, 220, 214, 221, 223, 224, 226, 781, 779, + + 776, 220, 226, 221, 223, 224, 276, 227, 228, 229, + 231, 226, 227, 228, 229, 231, 775, 226, 773, 276, + 226, 227, 228, 229, 231, 772, 771, 227, 228, 229, + 227, 228, 229, 231, 232, 233, 234, 770, 769, 232, + 233, 234, 305, 305, 305, 305, 235, 236, 232, 233, + 234, 235, 236, 768, 232, 233, 234, 232, 233, 234, + 235, 236, 765, 244, 764, 762, 235, 236, 244, 235, + 236, 255, 255, 255, 255, 255, 255, 244, 256, 256, + 256, 256, 256, 256, 257, 257, 244, 271, 271, 761, + 257, 289, 289, 271, 290, 290, 760, 289, 759, 310, + + 290, 257, 758, 757, 271, 755, 291, 291, 289, 754, + 753, 290, 291, 299, 313, 299, 321, 299, 306, 306, + 306, 306, 310, 291, 307, 307, 307, 307, 307, 307, + 299, 308, 308, 308, 308, 308, 308, 313, 314, 321, + 314, 325, 328, 331, 334, 337, 340, 343, 346, 349, + 352, 355, 358, 361, 364, 367, 370, 373, 383, 386, + 390, 314, 393, 397, 325, 328, 331, 334, 337, 340, + 343, 346, 349, 352, 355, 358, 361, 364, 367, 370, + 373, 383, 386, 390, 400, 393, 397, 403, 406, 410, + 413, 416, 419, 422, 425, 437, 440, 751, 501, 501, + + 550, 636, 636, 749, 748, 745, 742, 400, 741, 729, + 403, 406, 410, 413, 416, 419, 422, 425, 437, 440, + 501, 728, 636, 550, 836, 836, 836, 838, 838, 727, + 698, 691, 690, 687, 686, 685, 684, 683, 682, 681, + 680, 679, 678, 676, 673, 672, 671, 670, 669, 668, + 667, 666, 665, 664, 663, 661, 660, 659, 658, 656, + 654, 653, 652, 651, 650, 649, 648, 647, 646, 645, + 644, 643, 642, 641, 640, 639, 638, 637, 635, 634, + 633, 632, 631, 630, 629, 628, 627, 624, 623, 622, + 621, 620, 619, 618, 617, 616, 615, 614, 613, 612, + + 611, 610, 609, 608, 607, 606, 604, 603, 602, 601, + 600, 599, 598, 597, 596, 595, 594, 593, 592, 591, + 590, 589, 587, 586, 585, 584, 583, 581, 580, 579, + 578, 577, 576, 575, 572, 571, 569, 568, 567, 566, + 563, 562, 561, 560, 559, 558, 557, 555, 554, 553, + 552, 551, 549, 548, 547, 546, 545, 544, 543, 542, + 541, 540, 539, 538, 537, 536, 535, 534, 533, 532, + 531, 530, 529, 528, 527, 523, 522, 521, 520, 519, + 518, 517, 516, 515, 514, 513, 512, 511, 510, 509, + 508, 507, 506, 505, 504, 503, 502, 499, 498, 497, + + 494, 493, 492, 491, 490, 489, 487, 485, 484, 483, + 481, 480, 479, 478, 477, 476, 475, 474, 473, 472, + 471, 470, 469, 468, 467, 466, 465, 464, 462, 461, + 460, 459, 458, 457, 456, 453, 452, 451, 448, 447, + 446, 445, 444, 443, 442, 441, 439, 438, 436, 435, + 434, 433, 432, 431, 430, 429, 427, 426, 424, 423, + 421, 420, 418, 417, 415, 414, 412, 411, 409, 408, + 407, 405, 404, 402, 401, 399, 398, 396, 395, 394, + 392, 391, 389, 387, 385, 384, 382, 381, 379, 377, + 376, 375, 374, 372, 371, 369, 368, 366, 365, 363, + + 362, 360, 359, 357, 356, 354, 353, 351, 350, 348, + 347, 345, 344, 342, 341, 339, 338, 336, 335, 333, + 332, 330, 329, 327, 326, 324, 322, 320, 319, 318, + 317, 316, 315, 312, 311, 309, 301, 300, 298, 297, + 296, 295, 294, 293, 288, 286, 285, 284, 283, 282, + 281, 280, 279, 277, 275, 274, 272, 270, 269, 266, + 265, 264, 263, 262, 261, 260, 258, 254, 253, 252, + 251, 250, 249, 248, 247, 246, 245, 238, 237, 230, + 225, 222, 217, 216, 215, 193, 191, 190, 189, 187, + 172, 171, 170, 168, 167, 166, 165, 164, 158, 156, + + 155, 154, 153, 152, 151, 150, 149, 148, 145, 144, + 143, 142, 141, 139, 138, 137, 135, 134, 131, 129, + 127, 126, 125, 124, 123, 122, 121, 120, 119, 118, + 115, 114, 113, 112, 110, 109, 107, 106, 105, 104, + 103, 102, 101, 100, 98, 97, 96, 95, 94, 93, + 91, 90, 89, 88, 87, 86, 85, 83, 82, 79, + 78, 77, 76, 74, 73, 72, 56, 55, 52, 51, + 38, 37, 35, 34, 33, 32, 31, 30, 28, 20, + 8, 7, 3, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, + 835 } ; /* The intent behind this definition is that it'll catch @@ -997,11 +1068,13 @@ static yyconst flex_int16_t yy_chk[1123] = } while (0) -#define return_opcode(condition, token, opcode, sat) \ +#define return_opcode(condition, token, opcode, len) \ do { \ - if (condition) { \ + if (condition && \ + _mesa_parse_instruction_suffix(yyextra, \ + yytext + len, \ + & yylval->temp_inst)) { \ yylval->temp_inst.Opcode = OPCODE_ ## opcode; \ - yylval->temp_inst.SaturateMode = SATURATE_ ## sat; \ return token; \ } else { \ yylval->string = strdup(yytext); \ @@ -1067,7 +1140,7 @@ swiz_from_char(char c) } while(0); #define YY_EXTRA_TYPE struct asm_parser_state * -#line 1071 "lex.yy.c" +#line 1144 "lex.yy.c" #define INITIAL 0 @@ -1313,10 +1386,10 @@ YY_DECL register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 136 "program_lexer.l" +#line 143 "program_lexer.l" -#line 1320 "lex.yy.c" +#line 1393 "lex.yy.c" yylval = yylval_param; @@ -1373,13 +1446,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 776 ) + if ( yy_current_state >= 836 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 1055 ); + while ( yy_base[yy_current_state] != 1284 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -1405,17 +1478,17 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 138 "program_lexer.l" +#line 145 "program_lexer.l" { return ARBvp_10; } YY_BREAK case 2: YY_RULE_SETUP -#line 139 "program_lexer.l" +#line 146 "program_lexer.l" { return ARBfp_10; } YY_BREAK case 3: YY_RULE_SETUP -#line 140 "program_lexer.l" +#line 147 "program_lexer.l" { yylval->integer = at_address; return_token_or_IDENTIFIER(require_ARB_vp, ADDRESS); @@ -1423,983 +1496,738 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 144 "program_lexer.l" +#line 151 "program_lexer.l" { return ALIAS; } YY_BREAK case 5: YY_RULE_SETUP -#line 145 "program_lexer.l" +#line 152 "program_lexer.l" { return ATTRIB; } YY_BREAK case 6: YY_RULE_SETUP -#line 146 "program_lexer.l" +#line 153 "program_lexer.l" { return END; } YY_BREAK case 7: YY_RULE_SETUP -#line 147 "program_lexer.l" +#line 154 "program_lexer.l" { return OPTION; } YY_BREAK case 8: YY_RULE_SETUP -#line 148 "program_lexer.l" +#line 155 "program_lexer.l" { return OUTPUT; } YY_BREAK case 9: YY_RULE_SETUP -#line 149 "program_lexer.l" +#line 156 "program_lexer.l" { return PARAM; } YY_BREAK case 10: YY_RULE_SETUP -#line 150 "program_lexer.l" +#line 157 "program_lexer.l" { yylval->integer = at_temp; return TEMP; } YY_BREAK case 11: YY_RULE_SETUP -#line 152 "program_lexer.l" -{ return_opcode( 1, VECTOR_OP, ABS, OFF); } +#line 159 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, ABS, 3); } YY_BREAK case 12: YY_RULE_SETUP -#line 153 "program_lexer.l" -{ return_opcode(require_ARB_fp, VECTOR_OP, ABS, ZERO_ONE); } +#line 160 "program_lexer.l" +{ return_opcode( 1, BIN_OP, ADD, 3); } YY_BREAK case 13: YY_RULE_SETUP -#line 154 "program_lexer.l" -{ return_opcode( 1, BIN_OP, ADD, OFF); } +#line 161 "program_lexer.l" +{ return_opcode(require_ARB_vp, ARL, ARL, 3); } YY_BREAK case 14: YY_RULE_SETUP -#line 155 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, ADD, ZERO_ONE); } +#line 163 "program_lexer.l" +{ return_opcode(require_ARB_fp, TRI_OP, CMP, 3); } YY_BREAK case 15: YY_RULE_SETUP -#line 156 "program_lexer.l" -{ return_opcode(require_ARB_vp, ARL, ARL, OFF); } +#line 164 "program_lexer.l" +{ return_opcode(require_ARB_fp, SCALAR_OP, COS, 3); } YY_BREAK case 16: YY_RULE_SETUP -#line 158 "program_lexer.l" -{ return_opcode(require_ARB_fp, TRI_OP, CMP, OFF); } +#line 166 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, DDX, 3); } YY_BREAK case 17: YY_RULE_SETUP -#line 159 "program_lexer.l" -{ return_opcode(require_ARB_fp, TRI_OP, CMP, ZERO_ONE); } +#line 167 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, DDY, 3); } YY_BREAK case 18: YY_RULE_SETUP -#line 160 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, COS, OFF); } +#line 168 "program_lexer.l" +{ return_opcode( 1, BIN_OP, DP3, 3); } YY_BREAK case 19: YY_RULE_SETUP -#line 161 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, COS, ZERO_ONE); } +#line 169 "program_lexer.l" +{ return_opcode( 1, BIN_OP, DP4, 3); } YY_BREAK case 20: YY_RULE_SETUP -#line 163 "program_lexer.l" -{ return_opcode(require_NV_fp, VECTOR_OP, DDX, OFF); } +#line 170 "program_lexer.l" +{ return_opcode( 1, BIN_OP, DPH, 3); } YY_BREAK case 21: YY_RULE_SETUP -#line 164 "program_lexer.l" -{ return_opcode(require_NV_fp, VECTOR_OP, DDX, ZERO_ONE); } +#line 171 "program_lexer.l" +{ return_opcode( 1, BIN_OP, DST, 3); } YY_BREAK case 22: YY_RULE_SETUP -#line 165 "program_lexer.l" -{ return_opcode(require_NV_fp, VECTOR_OP, DDY, OFF); } +#line 173 "program_lexer.l" +{ return_opcode( 1, SCALAR_OP, EX2, 3); } YY_BREAK case 23: YY_RULE_SETUP -#line 166 "program_lexer.l" -{ return_opcode(require_NV_fp, VECTOR_OP, DDY, ZERO_ONE); } +#line 174 "program_lexer.l" +{ return_opcode(require_ARB_vp, SCALAR_OP, EXP, 3); } YY_BREAK case 24: YY_RULE_SETUP -#line 167 "program_lexer.l" -{ return_opcode( 1, BIN_OP, DP3, OFF); } +#line 176 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, FLR, 3); } YY_BREAK case 25: YY_RULE_SETUP -#line 168 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, DP3, ZERO_ONE); } +#line 177 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, FRC, 3); } YY_BREAK case 26: YY_RULE_SETUP -#line 169 "program_lexer.l" -{ return_opcode( 1, BIN_OP, DP4, OFF); } +#line 179 "program_lexer.l" +{ return_opcode(require_ARB_fp, KIL, KIL, 3); } YY_BREAK case 27: YY_RULE_SETUP -#line 170 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, DP4, ZERO_ONE); } +#line 181 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, LIT, 3); } YY_BREAK case 28: YY_RULE_SETUP -#line 171 "program_lexer.l" -{ return_opcode( 1, BIN_OP, DPH, OFF); } +#line 182 "program_lexer.l" +{ return_opcode( 1, SCALAR_OP, LG2, 3); } YY_BREAK case 29: YY_RULE_SETUP -#line 172 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, DPH, ZERO_ONE); } +#line 183 "program_lexer.l" +{ return_opcode(require_ARB_vp, SCALAR_OP, LOG, 3); } YY_BREAK case 30: YY_RULE_SETUP -#line 173 "program_lexer.l" -{ return_opcode( 1, BIN_OP, DST, OFF); } +#line 184 "program_lexer.l" +{ return_opcode(require_ARB_fp, TRI_OP, LRP, 3); } YY_BREAK case 31: YY_RULE_SETUP -#line 174 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, DST, ZERO_ONE); } +#line 186 "program_lexer.l" +{ return_opcode( 1, TRI_OP, MAD, 3); } YY_BREAK case 32: YY_RULE_SETUP -#line 176 "program_lexer.l" -{ return_opcode( 1, SCALAR_OP, EX2, OFF); } +#line 187 "program_lexer.l" +{ return_opcode( 1, BIN_OP, MAX, 3); } YY_BREAK case 33: YY_RULE_SETUP -#line 177 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, EX2, ZERO_ONE); } +#line 188 "program_lexer.l" +{ return_opcode( 1, BIN_OP, MIN, 3); } YY_BREAK case 34: YY_RULE_SETUP -#line 178 "program_lexer.l" -{ return_opcode(require_ARB_vp, SCALAR_OP, EXP, OFF); } +#line 189 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, MOV, 3); } YY_BREAK case 35: YY_RULE_SETUP -#line 180 "program_lexer.l" -{ return_opcode( 1, VECTOR_OP, FLR, OFF); } +#line 190 "program_lexer.l" +{ return_opcode( 1, BIN_OP, MUL, 3); } YY_BREAK case 36: YY_RULE_SETUP -#line 181 "program_lexer.l" -{ return_opcode(require_ARB_fp, VECTOR_OP, FLR, ZERO_ONE); } +#line 192 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, PK2H, 4); } YY_BREAK case 37: YY_RULE_SETUP -#line 182 "program_lexer.l" -{ return_opcode( 1, VECTOR_OP, FRC, OFF); } +#line 193 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, PK2US, 5); } YY_BREAK case 38: YY_RULE_SETUP -#line 183 "program_lexer.l" -{ return_opcode(require_ARB_fp, VECTOR_OP, FRC, ZERO_ONE); } +#line 194 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, PK4B, 4); } YY_BREAK case 39: YY_RULE_SETUP -#line 185 "program_lexer.l" -{ return_opcode(require_ARB_fp, KIL, KIL, OFF); } +#line 195 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, PK4UB, 5); } YY_BREAK case 40: YY_RULE_SETUP -#line 187 "program_lexer.l" -{ return_opcode( 1, VECTOR_OP, LIT, OFF); } +#line 196 "program_lexer.l" +{ return_opcode( 1, BINSC_OP, POW, 3); } YY_BREAK case 41: YY_RULE_SETUP -#line 188 "program_lexer.l" -{ return_opcode(require_ARB_fp, VECTOR_OP, LIT, ZERO_ONE); } +#line 198 "program_lexer.l" +{ return_opcode( 1, SCALAR_OP, RCP, 3); } YY_BREAK case 42: YY_RULE_SETUP -#line 189 "program_lexer.l" -{ return_opcode( 1, SCALAR_OP, LG2, OFF); } +#line 199 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, RFL, 3); } YY_BREAK case 43: YY_RULE_SETUP -#line 190 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, LG2, ZERO_ONE); } +#line 200 "program_lexer.l" +{ return_opcode( 1, SCALAR_OP, RSQ, 3); } YY_BREAK case 44: YY_RULE_SETUP -#line 191 "program_lexer.l" -{ return_opcode(require_ARB_vp, SCALAR_OP, LOG, OFF); } +#line 202 "program_lexer.l" +{ return_opcode(require_ARB_fp, SCALAR_OP, SCS, 3); } YY_BREAK case 45: YY_RULE_SETUP -#line 192 "program_lexer.l" -{ return_opcode(require_ARB_fp, TRI_OP, LRP, OFF); } +#line 203 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SEQ, 3); } YY_BREAK case 46: YY_RULE_SETUP -#line 193 "program_lexer.l" -{ return_opcode(require_ARB_fp, TRI_OP, LRP, ZERO_ONE); } +#line 204 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SFL, 3); } YY_BREAK case 47: YY_RULE_SETUP -#line 195 "program_lexer.l" -{ return_opcode( 1, TRI_OP, MAD, OFF); } +#line 205 "program_lexer.l" +{ return_opcode( 1, BIN_OP, SGE, 3); } YY_BREAK case 48: YY_RULE_SETUP -#line 196 "program_lexer.l" -{ return_opcode(require_ARB_fp, TRI_OP, MAD, ZERO_ONE); } +#line 206 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SGT, 3); } YY_BREAK case 49: YY_RULE_SETUP -#line 197 "program_lexer.l" -{ return_opcode( 1, BIN_OP, MAX, OFF); } +#line 207 "program_lexer.l" +{ return_opcode(require_ARB_fp, SCALAR_OP, SIN, 3); } YY_BREAK case 50: YY_RULE_SETUP -#line 198 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, MAX, ZERO_ONE); } +#line 208 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SLE, 3); } YY_BREAK case 51: YY_RULE_SETUP -#line 199 "program_lexer.l" -{ return_opcode( 1, BIN_OP, MIN, OFF); } +#line 209 "program_lexer.l" +{ return_opcode( 1, BIN_OP, SLT, 3); } YY_BREAK case 52: YY_RULE_SETUP -#line 200 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, MIN, ZERO_ONE); } +#line 210 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SNE, 3); } YY_BREAK case 53: YY_RULE_SETUP -#line 201 "program_lexer.l" -{ return_opcode( 1, VECTOR_OP, MOV, OFF); } +#line 211 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, STR, 3); } YY_BREAK case 54: YY_RULE_SETUP -#line 202 "program_lexer.l" -{ return_opcode(require_ARB_fp, VECTOR_OP, MOV, ZERO_ONE); } +#line 212 "program_lexer.l" +{ return_opcode( 1, BIN_OP, SUB, 3); } YY_BREAK case 55: YY_RULE_SETUP -#line 203 "program_lexer.l" -{ return_opcode( 1, BIN_OP, MUL, OFF); } +#line 213 "program_lexer.l" +{ return_opcode( 1, SWZ, SWZ, 3); } YY_BREAK case 56: YY_RULE_SETUP -#line 204 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, MUL, ZERO_ONE); } +#line 215 "program_lexer.l" +{ return_opcode(require_ARB_fp, SAMPLE_OP, TEX, 3); } YY_BREAK case 57: YY_RULE_SETUP -#line 206 "program_lexer.l" -{ return_opcode(require_NV_fp, VECTOR_OP, PK2H, OFF); } +#line 216 "program_lexer.l" +{ return_opcode(require_ARB_fp, SAMPLE_OP, TXB, 3); } YY_BREAK case 58: YY_RULE_SETUP -#line 207 "program_lexer.l" -{ return_opcode(require_NV_fp, VECTOR_OP, PK2H, ZERO_ONE); } +#line 217 "program_lexer.l" +{ return_opcode(require_NV_fp, TXD_OP, TXD, 3); } YY_BREAK case 59: YY_RULE_SETUP -#line 208 "program_lexer.l" -{ return_opcode(require_NV_fp, VECTOR_OP, PK2US, OFF); } +#line 218 "program_lexer.l" +{ return_opcode(require_ARB_fp, SAMPLE_OP, TXP, 3); } YY_BREAK case 60: YY_RULE_SETUP -#line 209 "program_lexer.l" -{ return_opcode(require_NV_fp, VECTOR_OP, PK2US, ZERO_ONE); } +#line 220 "program_lexer.l" +{ return_opcode(require_NV_fp, SCALAR_OP, UP2H, 4); } YY_BREAK case 61: YY_RULE_SETUP -#line 210 "program_lexer.l" -{ return_opcode(require_NV_fp, VECTOR_OP, PK4B, OFF); } +#line 221 "program_lexer.l" +{ return_opcode(require_NV_fp, SCALAR_OP, UP2US, 5); } YY_BREAK case 62: YY_RULE_SETUP -#line 211 "program_lexer.l" -{ return_opcode(require_NV_fp, VECTOR_OP, PK4B, ZERO_ONE); } +#line 223 "program_lexer.l" +{ return_opcode(require_NV_fp, TRI_OP, X2D, 3); } YY_BREAK case 63: YY_RULE_SETUP -#line 212 "program_lexer.l" -{ return_opcode(require_NV_fp, VECTOR_OP, PK4UB, OFF); } +#line 224 "program_lexer.l" +{ return_opcode( 1, BIN_OP, XPD, 3); } YY_BREAK case 64: YY_RULE_SETUP -#line 213 "program_lexer.l" -{ return_opcode(require_NV_fp, VECTOR_OP, PK4UB, ZERO_ONE); } +#line 226 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_vp, VERTEX); } YY_BREAK case 65: YY_RULE_SETUP -#line 214 "program_lexer.l" -{ return_opcode( 1, BINSC_OP, POW, OFF); } +#line 227 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, FRAGMENT); } YY_BREAK case 66: YY_RULE_SETUP -#line 215 "program_lexer.l" -{ return_opcode(require_ARB_fp, BINSC_OP, POW, ZERO_ONE); } +#line 228 "program_lexer.l" +{ return PROGRAM; } YY_BREAK case 67: YY_RULE_SETUP -#line 217 "program_lexer.l" -{ return_opcode( 1, SCALAR_OP, RCP, OFF); } +#line 229 "program_lexer.l" +{ return STATE; } YY_BREAK case 68: YY_RULE_SETUP -#line 218 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, RCP, ZERO_ONE); } +#line 230 "program_lexer.l" +{ return RESULT; } YY_BREAK case 69: YY_RULE_SETUP -#line 219 "program_lexer.l" -{ return_opcode(require_NV_fp, BIN_OP, RFL, OFF); } +#line 232 "program_lexer.l" +{ return AMBIENT; } YY_BREAK case 70: YY_RULE_SETUP -#line 220 "program_lexer.l" -{ return_opcode(require_NV_fp, BIN_OP, RFL, ZERO_ONE); } +#line 233 "program_lexer.l" +{ return ATTENUATION; } YY_BREAK case 71: YY_RULE_SETUP -#line 221 "program_lexer.l" -{ return_opcode( 1, SCALAR_OP, RSQ, OFF); } +#line 234 "program_lexer.l" +{ return BACK; } YY_BREAK case 72: YY_RULE_SETUP -#line 222 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, RSQ, ZERO_ONE); } +#line 235 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, CLIP); } YY_BREAK case 73: YY_RULE_SETUP -#line 224 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, SCS, OFF); } +#line 236 "program_lexer.l" +{ return COLOR; } YY_BREAK case 74: YY_RULE_SETUP -#line 225 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, SCS, ZERO_ONE); } +#line 237 "program_lexer.l" +{ return_token_or_DOT(require_ARB_fp, DEPTH); } YY_BREAK case 75: YY_RULE_SETUP -#line 226 "program_lexer.l" -{ return_opcode(require_NV_fp, BIN_OP, SEQ, OFF); } +#line 238 "program_lexer.l" +{ return DIFFUSE; } YY_BREAK case 76: YY_RULE_SETUP -#line 227 "program_lexer.l" -{ return_opcode(require_NV_fp, BIN_OP, SEQ, ZERO_ONE); } +#line 239 "program_lexer.l" +{ return DIRECTION; } YY_BREAK case 77: YY_RULE_SETUP -#line 228 "program_lexer.l" -{ return_opcode(require_NV_fp, BIN_OP, SFL, OFF); } +#line 240 "program_lexer.l" +{ return EMISSION; } YY_BREAK case 78: YY_RULE_SETUP -#line 229 "program_lexer.l" -{ return_opcode(require_NV_fp, BIN_OP, SFL, ZERO_ONE); } +#line 241 "program_lexer.l" +{ return ENV; } YY_BREAK case 79: YY_RULE_SETUP -#line 230 "program_lexer.l" -{ return_opcode( 1, BIN_OP, SGE, OFF); } +#line 242 "program_lexer.l" +{ return EYE; } YY_BREAK case 80: YY_RULE_SETUP -#line 231 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, SGE, ZERO_ONE); } +#line 243 "program_lexer.l" +{ return FOGCOORD; } YY_BREAK case 81: YY_RULE_SETUP -#line 232 "program_lexer.l" -{ return_opcode(require_NV_fp, BIN_OP, SGT, OFF); } +#line 244 "program_lexer.l" +{ return FOG; } YY_BREAK case 82: YY_RULE_SETUP -#line 233 "program_lexer.l" -{ return_opcode(require_NV_fp, BIN_OP, SGT, ZERO_ONE); } +#line 245 "program_lexer.l" +{ return FRONT; } YY_BREAK case 83: YY_RULE_SETUP -#line 234 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, SIN, OFF); } +#line 246 "program_lexer.l" +{ return HALF; } YY_BREAK case 84: YY_RULE_SETUP -#line 235 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, SIN, ZERO_ONE); } +#line 247 "program_lexer.l" +{ return INVERSE; } YY_BREAK case 85: YY_RULE_SETUP -#line 236 "program_lexer.l" -{ return_opcode(require_NV_fp, BIN_OP, SLE, OFF); } +#line 248 "program_lexer.l" +{ return INVTRANS; } YY_BREAK case 86: YY_RULE_SETUP -#line 237 "program_lexer.l" -{ return_opcode(require_NV_fp, BIN_OP, SLE, ZERO_ONE); } +#line 249 "program_lexer.l" +{ return LIGHT; } YY_BREAK case 87: YY_RULE_SETUP -#line 238 "program_lexer.l" -{ return_opcode( 1, BIN_OP, SLT, OFF); } +#line 250 "program_lexer.l" +{ return LIGHTMODEL; } YY_BREAK case 88: YY_RULE_SETUP -#line 239 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, SLT, ZERO_ONE); } +#line 251 "program_lexer.l" +{ return LIGHTPROD; } YY_BREAK case 89: YY_RULE_SETUP -#line 240 "program_lexer.l" -{ return_opcode(require_NV_fp, BIN_OP, SNE, OFF); } +#line 252 "program_lexer.l" +{ return LOCAL; } YY_BREAK case 90: YY_RULE_SETUP -#line 241 "program_lexer.l" -{ return_opcode(require_NV_fp, BIN_OP, SNE, ZERO_ONE); } +#line 253 "program_lexer.l" +{ return MATERIAL; } YY_BREAK case 91: YY_RULE_SETUP -#line 242 "program_lexer.l" -{ return_opcode(require_NV_fp, BIN_OP, STR, OFF); } +#line 254 "program_lexer.l" +{ return MAT_PROGRAM; } YY_BREAK case 92: YY_RULE_SETUP -#line 243 "program_lexer.l" -{ return_opcode(require_NV_fp, BIN_OP, STR, ZERO_ONE); } +#line 255 "program_lexer.l" +{ return MATRIX; } YY_BREAK case 93: YY_RULE_SETUP -#line 244 "program_lexer.l" -{ return_opcode( 1, BIN_OP, SUB, OFF); } +#line 256 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, MATRIXINDEX); } YY_BREAK case 94: YY_RULE_SETUP -#line 245 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, SUB, ZERO_ONE); } +#line 257 "program_lexer.l" +{ return MODELVIEW; } YY_BREAK case 95: YY_RULE_SETUP -#line 246 "program_lexer.l" -{ return_opcode( 1, SWZ, SWZ, OFF); } +#line 258 "program_lexer.l" +{ return MVP; } YY_BREAK case 96: YY_RULE_SETUP -#line 247 "program_lexer.l" -{ return_opcode(require_ARB_fp, SWZ, SWZ, ZERO_ONE); } +#line 259 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, NORMAL); } YY_BREAK case 97: YY_RULE_SETUP -#line 249 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TEX, OFF); } +#line 260 "program_lexer.l" +{ return OBJECT; } YY_BREAK case 98: YY_RULE_SETUP -#line 250 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TEX, ZERO_ONE); } +#line 261 "program_lexer.l" +{ return PALETTE; } YY_BREAK case 99: YY_RULE_SETUP -#line 251 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TXB, OFF); } +#line 262 "program_lexer.l" +{ return PARAMS; } YY_BREAK case 100: YY_RULE_SETUP -#line 252 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TXB, ZERO_ONE); } +#line 263 "program_lexer.l" +{ return PLANE; } YY_BREAK case 101: YY_RULE_SETUP -#line 253 "program_lexer.l" -{ return_opcode(require_NV_fp, TXD_OP, TXD, OFF); } +#line 264 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, POINT); } YY_BREAK case 102: YY_RULE_SETUP -#line 254 "program_lexer.l" -{ return_opcode(require_NV_fp, TXD_OP, TXD, ZERO_ONE); } +#line 265 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, POINTSIZE); } YY_BREAK case 103: YY_RULE_SETUP -#line 255 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TXP, OFF); } +#line 266 "program_lexer.l" +{ return POSITION; } YY_BREAK case 104: YY_RULE_SETUP -#line 256 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TXP, ZERO_ONE); } +#line 267 "program_lexer.l" +{ return PRIMARY; } YY_BREAK case 105: YY_RULE_SETUP -#line 258 "program_lexer.l" -{ return_opcode(require_NV_fp, SCALAR_OP, UP2H, OFF); } +#line 268 "program_lexer.l" +{ return PROJECTION; } YY_BREAK case 106: YY_RULE_SETUP -#line 259 "program_lexer.l" -{ return_opcode(require_NV_fp, SCALAR_OP, UP2H, ZERO_ONE); } +#line 269 "program_lexer.l" +{ return_token_or_DOT(require_ARB_fp, RANGE); } YY_BREAK case 107: YY_RULE_SETUP -#line 260 "program_lexer.l" -{ return_opcode(require_NV_fp, SCALAR_OP, UP2US, OFF); } +#line 270 "program_lexer.l" +{ return ROW; } YY_BREAK case 108: YY_RULE_SETUP -#line 261 "program_lexer.l" -{ return_opcode(require_NV_fp, SCALAR_OP, UP2US, ZERO_ONE); } +#line 271 "program_lexer.l" +{ return SCENECOLOR; } YY_BREAK case 109: YY_RULE_SETUP -#line 263 "program_lexer.l" -{ return_opcode(require_NV_fp, TRI_OP, X2D, OFF); } +#line 272 "program_lexer.l" +{ return SECONDARY; } YY_BREAK case 110: YY_RULE_SETUP -#line 264 "program_lexer.l" -{ return_opcode(require_NV_fp, TRI_OP, X2D, ZERO_ONE); } +#line 273 "program_lexer.l" +{ return SHININESS; } YY_BREAK case 111: YY_RULE_SETUP -#line 265 "program_lexer.l" -{ return_opcode( 1, BIN_OP, XPD, OFF); } +#line 274 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, SIZE); } YY_BREAK case 112: YY_RULE_SETUP -#line 266 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, XPD, ZERO_ONE); } +#line 275 "program_lexer.l" +{ return SPECULAR; } YY_BREAK case 113: YY_RULE_SETUP -#line 268 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_vp, VERTEX); } +#line 276 "program_lexer.l" +{ return SPOT; } YY_BREAK case 114: YY_RULE_SETUP -#line 269 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, FRAGMENT); } +#line 277 "program_lexer.l" +{ return TEXCOORD; } YY_BREAK case 115: YY_RULE_SETUP -#line 270 "program_lexer.l" -{ return PROGRAM; } - YY_BREAK -case 116: -YY_RULE_SETUP -#line 271 "program_lexer.l" -{ return STATE; } - YY_BREAK -case 117: -YY_RULE_SETUP -#line 272 "program_lexer.l" -{ return RESULT; } - YY_BREAK -case 118: -YY_RULE_SETUP -#line 274 "program_lexer.l" -{ return AMBIENT; } - YY_BREAK -case 119: -YY_RULE_SETUP -#line 275 "program_lexer.l" -{ return ATTENUATION; } - YY_BREAK -case 120: -YY_RULE_SETUP -#line 276 "program_lexer.l" -{ return BACK; } - YY_BREAK -case 121: -YY_RULE_SETUP -#line 277 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, CLIP); } - YY_BREAK -case 122: -YY_RULE_SETUP #line 278 "program_lexer.l" -{ return COLOR; } - YY_BREAK -case 123: -YY_RULE_SETUP -#line 279 "program_lexer.l" -{ return_token_or_DOT(require_ARB_fp, DEPTH); } - YY_BREAK -case 124: -YY_RULE_SETUP -#line 280 "program_lexer.l" -{ return DIFFUSE; } - YY_BREAK -case 125: -YY_RULE_SETUP -#line 281 "program_lexer.l" -{ return DIRECTION; } - YY_BREAK -case 126: -YY_RULE_SETUP -#line 282 "program_lexer.l" -{ return EMISSION; } - YY_BREAK -case 127: -YY_RULE_SETUP -#line 283 "program_lexer.l" -{ return ENV; } - YY_BREAK -case 128: -YY_RULE_SETUP -#line 284 "program_lexer.l" -{ return EYE; } - YY_BREAK -case 129: -YY_RULE_SETUP -#line 285 "program_lexer.l" -{ return FOGCOORD; } - YY_BREAK -case 130: -YY_RULE_SETUP -#line 286 "program_lexer.l" -{ return FOG; } - YY_BREAK -case 131: -YY_RULE_SETUP -#line 287 "program_lexer.l" -{ return FRONT; } - YY_BREAK -case 132: -YY_RULE_SETUP -#line 288 "program_lexer.l" -{ return HALF; } - YY_BREAK -case 133: -YY_RULE_SETUP -#line 289 "program_lexer.l" -{ return INVERSE; } - YY_BREAK -case 134: -YY_RULE_SETUP -#line 290 "program_lexer.l" -{ return INVTRANS; } - YY_BREAK -case 135: -YY_RULE_SETUP -#line 291 "program_lexer.l" -{ return LIGHT; } - YY_BREAK -case 136: -YY_RULE_SETUP -#line 292 "program_lexer.l" -{ return LIGHTMODEL; } - YY_BREAK -case 137: -YY_RULE_SETUP -#line 293 "program_lexer.l" -{ return LIGHTPROD; } - YY_BREAK -case 138: -YY_RULE_SETUP -#line 294 "program_lexer.l" -{ return LOCAL; } - YY_BREAK -case 139: -YY_RULE_SETUP -#line 295 "program_lexer.l" -{ return MATERIAL; } - YY_BREAK -case 140: -YY_RULE_SETUP -#line 296 "program_lexer.l" -{ return MAT_PROGRAM; } - YY_BREAK -case 141: -YY_RULE_SETUP -#line 297 "program_lexer.l" -{ return MATRIX; } - YY_BREAK -case 142: -YY_RULE_SETUP -#line 298 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, MATRIXINDEX); } - YY_BREAK -case 143: -YY_RULE_SETUP -#line 299 "program_lexer.l" -{ return MODELVIEW; } - YY_BREAK -case 144: -YY_RULE_SETUP -#line 300 "program_lexer.l" -{ return MVP; } - YY_BREAK -case 145: -YY_RULE_SETUP -#line 301 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, NORMAL); } - YY_BREAK -case 146: -YY_RULE_SETUP -#line 302 "program_lexer.l" -{ return OBJECT; } - YY_BREAK -case 147: -YY_RULE_SETUP -#line 303 "program_lexer.l" -{ return PALETTE; } - YY_BREAK -case 148: -YY_RULE_SETUP -#line 304 "program_lexer.l" -{ return PARAMS; } - YY_BREAK -case 149: -YY_RULE_SETUP -#line 305 "program_lexer.l" -{ return PLANE; } - YY_BREAK -case 150: -YY_RULE_SETUP -#line 306 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, POINT); } - YY_BREAK -case 151: -YY_RULE_SETUP -#line 307 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, POINTSIZE); } - YY_BREAK -case 152: -YY_RULE_SETUP -#line 308 "program_lexer.l" -{ return POSITION; } - YY_BREAK -case 153: -YY_RULE_SETUP -#line 309 "program_lexer.l" -{ return PRIMARY; } - YY_BREAK -case 154: -YY_RULE_SETUP -#line 310 "program_lexer.l" -{ return PROJECTION; } - YY_BREAK -case 155: -YY_RULE_SETUP -#line 311 "program_lexer.l" -{ return_token_or_DOT(require_ARB_fp, RANGE); } - YY_BREAK -case 156: -YY_RULE_SETUP -#line 312 "program_lexer.l" -{ return ROW; } - YY_BREAK -case 157: -YY_RULE_SETUP -#line 313 "program_lexer.l" -{ return SCENECOLOR; } - YY_BREAK -case 158: -YY_RULE_SETUP -#line 314 "program_lexer.l" -{ return SECONDARY; } - YY_BREAK -case 159: -YY_RULE_SETUP -#line 315 "program_lexer.l" -{ return SHININESS; } - YY_BREAK -case 160: -YY_RULE_SETUP -#line 316 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, SIZE); } - YY_BREAK -case 161: -YY_RULE_SETUP -#line 317 "program_lexer.l" -{ return SPECULAR; } - YY_BREAK -case 162: -YY_RULE_SETUP -#line 318 "program_lexer.l" -{ return SPOT; } - YY_BREAK -case 163: -YY_RULE_SETUP -#line 319 "program_lexer.l" -{ return TEXCOORD; } - YY_BREAK -case 164: -YY_RULE_SETUP -#line 320 "program_lexer.l" { return_token_or_DOT(require_ARB_fp, TEXENV); } YY_BREAK -case 165: +case 116: YY_RULE_SETUP -#line 321 "program_lexer.l" +#line 279 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN); } YY_BREAK -case 166: +case 117: YY_RULE_SETUP -#line 322 "program_lexer.l" +#line 280 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN_Q); } YY_BREAK -case 167: +case 118: YY_RULE_SETUP -#line 323 "program_lexer.l" +#line 281 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN_S); } YY_BREAK -case 168: +case 119: YY_RULE_SETUP -#line 324 "program_lexer.l" +#line 282 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN_T); } YY_BREAK -case 169: +case 120: YY_RULE_SETUP -#line 325 "program_lexer.l" +#line 283 "program_lexer.l" { return TEXTURE; } YY_BREAK -case 170: +case 121: YY_RULE_SETUP -#line 326 "program_lexer.l" +#line 284 "program_lexer.l" { return TRANSPOSE; } YY_BREAK -case 171: +case 122: YY_RULE_SETUP -#line 327 "program_lexer.l" +#line 285 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, VTXATTRIB); } YY_BREAK -case 172: +case 123: YY_RULE_SETUP -#line 328 "program_lexer.l" +#line 286 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, WEIGHT); } YY_BREAK -case 173: +case 124: YY_RULE_SETUP -#line 330 "program_lexer.l" +#line 288 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEXTURE_UNIT); } YY_BREAK -case 174: +case 125: YY_RULE_SETUP -#line 331 "program_lexer.l" +#line 289 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_1D); } YY_BREAK -case 175: +case 126: YY_RULE_SETUP -#line 332 "program_lexer.l" +#line 290 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_2D); } YY_BREAK -case 176: +case 127: YY_RULE_SETUP -#line 333 "program_lexer.l" +#line 291 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_3D); } YY_BREAK -case 177: +case 128: YY_RULE_SETUP -#line 334 "program_lexer.l" +#line 292 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_CUBE); } YY_BREAK -case 178: +case 129: YY_RULE_SETUP -#line 335 "program_lexer.l" +#line 293 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_rect, TEX_RECT); } YY_BREAK -case 179: +case 130: YY_RULE_SETUP -#line 336 "program_lexer.l" +#line 294 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW1D); } YY_BREAK -case 180: +case 131: YY_RULE_SETUP -#line 337 "program_lexer.l" +#line 295 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW2D); } YY_BREAK -case 181: +case 132: YY_RULE_SETUP -#line 338 "program_lexer.l" +#line 296 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_rect, TEX_SHADOWRECT); } YY_BREAK -case 182: +case 133: YY_RULE_SETUP -#line 339 "program_lexer.l" +#line 297 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY1D); } YY_BREAK -case 183: +case 134: YY_RULE_SETUP -#line 340 "program_lexer.l" +#line 298 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY2D); } YY_BREAK -case 184: +case 135: YY_RULE_SETUP -#line 341 "program_lexer.l" +#line 299 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW1D); } YY_BREAK -case 185: +case 136: YY_RULE_SETUP -#line 342 "program_lexer.l" +#line 300 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW2D); } YY_BREAK -case 186: +case 137: YY_RULE_SETUP -#line 344 "program_lexer.l" +#line 302 "program_lexer.l" { yylval->string = strdup(yytext); return IDENTIFIER; } YY_BREAK -case 187: +case 138: YY_RULE_SETUP -#line 349 "program_lexer.l" +#line 307 "program_lexer.l" { return DOT_DOT; } YY_BREAK -case 188: +case 139: YY_RULE_SETUP -#line 351 "program_lexer.l" +#line 309 "program_lexer.l" { yylval->integer = strtol(yytext, NULL, 10); return INTEGER; } YY_BREAK -case 189: +case 140: YY_RULE_SETUP -#line 355 "program_lexer.l" +#line 313 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; } YY_BREAK -case 190: -/* rule 190 can match eol */ +case 141: +/* rule 141 can match eol */ *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 359 "program_lexer.l" +#line 317 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; } YY_BREAK -case 191: +case 142: YY_RULE_SETUP -#line 363 "program_lexer.l" +#line 321 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; } YY_BREAK -case 192: +case 143: YY_RULE_SETUP -#line 367 "program_lexer.l" +#line 325 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; } YY_BREAK -case 193: +case 144: YY_RULE_SETUP -#line 372 "program_lexer.l" +#line 330 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; return MASK4; } YY_BREAK -case 194: +case 145: YY_RULE_SETUP -#line 378 "program_lexer.l" +#line 336 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@ -2407,27 +2235,27 @@ YY_RULE_SETUP return MASK3; } YY_BREAK -case 195: +case 146: YY_RULE_SETUP -#line 384 "program_lexer.l" +#line 342 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; return MASK3; } YY_BREAK -case 196: +case 147: YY_RULE_SETUP -#line 389 "program_lexer.l" +#line 347 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; return MASK3; } YY_BREAK -case 197: +case 148: YY_RULE_SETUP -#line 395 "program_lexer.l" +#line 353 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@ -2435,9 +2263,9 @@ YY_RULE_SETUP return MASK2; } YY_BREAK -case 198: +case 149: YY_RULE_SETUP -#line 401 "program_lexer.l" +#line 359 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@ -2445,18 +2273,18 @@ YY_RULE_SETUP return MASK2; } YY_BREAK -case 199: +case 150: YY_RULE_SETUP -#line 407 "program_lexer.l" +#line 365 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; return MASK2; } YY_BREAK -case 200: +case 151: YY_RULE_SETUP -#line 413 "program_lexer.l" +#line 371 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@ -2464,9 +2292,9 @@ YY_RULE_SETUP return MASK1; } YY_BREAK -case 201: +case 152: YY_RULE_SETUP -#line 420 "program_lexer.l" +#line 378 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@ -2476,18 +2304,18 @@ YY_RULE_SETUP return SWIZZLE; } YY_BREAK -case 202: +case 153: YY_RULE_SETUP -#line 429 "program_lexer.l" +#line 387 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; return_token_or_DOT(require_ARB_fp, MASK4); } YY_BREAK -case 203: +case 154: YY_RULE_SETUP -#line 435 "program_lexer.l" +#line 393 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@ -2495,27 +2323,27 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK3); } YY_BREAK -case 204: +case 155: YY_RULE_SETUP -#line 441 "program_lexer.l" +#line 399 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; return_token_or_DOT(require_ARB_fp, MASK3); } YY_BREAK -case 205: +case 156: YY_RULE_SETUP -#line 446 "program_lexer.l" +#line 404 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; return_token_or_DOT(require_ARB_fp, MASK3); } YY_BREAK -case 206: +case 157: YY_RULE_SETUP -#line 452 "program_lexer.l" +#line 410 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@ -2523,9 +2351,9 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK2); } YY_BREAK -case 207: +case 158: YY_RULE_SETUP -#line 458 "program_lexer.l" +#line 416 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@ -2533,18 +2361,18 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK2); } YY_BREAK -case 208: +case 159: YY_RULE_SETUP -#line 464 "program_lexer.l" +#line 422 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; return_token_or_DOT(require_ARB_fp, MASK2); } YY_BREAK -case 209: +case 160: YY_RULE_SETUP -#line 470 "program_lexer.l" +#line 428 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@ -2552,9 +2380,9 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK1); } YY_BREAK -case 210: +case 161: YY_RULE_SETUP -#line 478 "program_lexer.l" +#line 436 "program_lexer.l" { if (require_ARB_vp) { return TEXGEN_R; @@ -2566,9 +2394,9 @@ YY_RULE_SETUP } } YY_BREAK -case 211: +case 162: YY_RULE_SETUP -#line 489 "program_lexer.l" +#line 447 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@ -2578,15 +2406,15 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, SWIZZLE); } YY_BREAK -case 212: +case 163: YY_RULE_SETUP -#line 498 "program_lexer.l" +#line 456 "program_lexer.l" { return DOT; } YY_BREAK -case 213: -/* rule 213 can match eol */ +case 164: +/* rule 164 can match eol */ YY_RULE_SETUP -#line 500 "program_lexer.l" +#line 458 "program_lexer.l" { yylloc->first_line++; yylloc->first_column = 1; @@ -2595,30 +2423,30 @@ YY_RULE_SETUP yylloc->position++; } YY_BREAK -case 214: +case 165: YY_RULE_SETUP -#line 507 "program_lexer.l" +#line 465 "program_lexer.l" /* eat whitespace */ ; YY_BREAK -case 215: +case 166: *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 508 "program_lexer.l" +#line 466 "program_lexer.l" /* eat comments */ ; YY_BREAK -case 216: +case 167: YY_RULE_SETUP -#line 509 "program_lexer.l" +#line 467 "program_lexer.l" { return yytext[0]; } YY_BREAK -case 217: +case 168: YY_RULE_SETUP -#line 510 "program_lexer.l" +#line 468 "program_lexer.l" ECHO; YY_BREAK -#line 2622 "lex.yy.c" +#line 2450 "lex.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -2912,7 +2740,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 776 ) + if ( yy_current_state >= 836 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -2941,11 +2769,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 776 ) + if ( yy_current_state >= 836 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 775); + yy_is_jam = (yy_current_state == 835); return yy_is_jam ? 0 : yy_current_state; } @@ -3793,7 +3621,7 @@ void yyfree (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 510 "program_lexer.l" +#line 468 "program_lexer.l" diff --git a/src/mesa/shader/program_lexer.l b/src/mesa/shader/program_lexer.l index 62ca9b6db6..d7493f42fa 100644 --- a/src/mesa/shader/program_lexer.l +++ b/src/mesa/shader/program_lexer.l @@ -55,11 +55,13 @@ } while (0) -#define return_opcode(condition, token, opcode, sat) \ +#define return_opcode(condition, token, opcode, len) \ do { \ - if (condition) { \ + if (condition && \ + _mesa_parse_instruction_suffix(yyextra, \ + yytext + len, \ + & yylval->temp_inst)) { \ yylval->temp_inst.Opcode = OPCODE_ ## opcode; \ - yylval->temp_inst.SaturateMode = SATURATE_ ## sat; \ return token; \ } else { \ yylval->string = strdup(yytext); \ @@ -132,6 +134,11 @@ exp [Ee][-+]?[0-9]+ frac "."[0-9]+ dot "."[ \t]* +sz [HRX]? +szf [HR]? +cc C? +sat (_SAT)? + %option bison-bridge bison-locations reentrant noyywrap %% @@ -149,121 +156,72 @@ OUTPUT { return OUTPUT; } PARAM { return PARAM; } TEMP { yylval->integer = at_temp; return TEMP; } -ABS { return_opcode( 1, VECTOR_OP, ABS, OFF); } -ABS_SAT { return_opcode(require_ARB_fp, VECTOR_OP, ABS, ZERO_ONE); } -ADD { return_opcode( 1, BIN_OP, ADD, OFF); } -ADD_SAT { return_opcode(require_ARB_fp, BIN_OP, ADD, ZERO_ONE); } -ARL { return_opcode(require_ARB_vp, ARL, ARL, OFF); } - -CMP { return_opcode(require_ARB_fp, TRI_OP, CMP, OFF); } -CMP_SAT { return_opcode(require_ARB_fp, TRI_OP, CMP, ZERO_ONE); } -COS { return_opcode(require_ARB_fp, SCALAR_OP, COS, OFF); } -COS_SAT { return_opcode(require_ARB_fp, SCALAR_OP, COS, ZERO_ONE); } - -DDX { return_opcode(require_NV_fp, VECTOR_OP, DDX, OFF); } -DDX_SAT { return_opcode(require_NV_fp, VECTOR_OP, DDX, ZERO_ONE); } -DDY { return_opcode(require_NV_fp, VECTOR_OP, DDY, OFF); } -DDY_SAT { return_opcode(require_NV_fp, VECTOR_OP, DDY, ZERO_ONE); } -DP3 { return_opcode( 1, BIN_OP, DP3, OFF); } -DP3_SAT { return_opcode(require_ARB_fp, BIN_OP, DP3, ZERO_ONE); } -DP4 { return_opcode( 1, BIN_OP, DP4, OFF); } -DP4_SAT { return_opcode(require_ARB_fp, BIN_OP, DP4, ZERO_ONE); } -DPH { return_opcode( 1, BIN_OP, DPH, OFF); } -DPH_SAT { return_opcode(require_ARB_fp, BIN_OP, DPH, ZERO_ONE); } -DST { return_opcode( 1, BIN_OP, DST, OFF); } -DST_SAT { return_opcode(require_ARB_fp, BIN_OP, DST, ZERO_ONE); } - -EX2 { return_opcode( 1, SCALAR_OP, EX2, OFF); } -EX2_SAT { return_opcode(require_ARB_fp, SCALAR_OP, EX2, ZERO_ONE); } -EXP { return_opcode(require_ARB_vp, SCALAR_OP, EXP, OFF); } - -FLR { return_opcode( 1, VECTOR_OP, FLR, OFF); } -FLR_SAT { return_opcode(require_ARB_fp, VECTOR_OP, FLR, ZERO_ONE); } -FRC { return_opcode( 1, VECTOR_OP, FRC, OFF); } -FRC_SAT { return_opcode(require_ARB_fp, VECTOR_OP, FRC, ZERO_ONE); } - -KIL { return_opcode(require_ARB_fp, KIL, KIL, OFF); } - -LIT { return_opcode( 1, VECTOR_OP, LIT, OFF); } -LIT_SAT { return_opcode(require_ARB_fp, VECTOR_OP, LIT, ZERO_ONE); } -LG2 { return_opcode( 1, SCALAR_OP, LG2, OFF); } -LG2_SAT { return_opcode(require_ARB_fp, SCALAR_OP, LG2, ZERO_ONE); } -LOG { return_opcode(require_ARB_vp, SCALAR_OP, LOG, OFF); } -LRP { return_opcode(require_ARB_fp, TRI_OP, LRP, OFF); } -LRP_SAT { return_opcode(require_ARB_fp, TRI_OP, LRP, ZERO_ONE); } - -MAD { return_opcode( 1, TRI_OP, MAD, OFF); } -MAD_SAT { return_opcode(require_ARB_fp, TRI_OP, MAD, ZERO_ONE); } -MAX { return_opcode( 1, BIN_OP, MAX, OFF); } -MAX_SAT { return_opcode(require_ARB_fp, BIN_OP, MAX, ZERO_ONE); } -MIN { return_opcode( 1, BIN_OP, MIN, OFF); } -MIN_SAT { return_opcode(require_ARB_fp, BIN_OP, MIN, ZERO_ONE); } -MOV { return_opcode( 1, VECTOR_OP, MOV, OFF); } -MOV_SAT { return_opcode(require_ARB_fp, VECTOR_OP, MOV, ZERO_ONE); } -MUL { return_opcode( 1, BIN_OP, MUL, OFF); } -MUL_SAT { return_opcode(require_ARB_fp, BIN_OP, MUL, ZERO_ONE); } - -PK2H { return_opcode(require_NV_fp, VECTOR_OP, PK2H, OFF); } -PK2H_SAT { return_opcode(require_NV_fp, VECTOR_OP, PK2H, ZERO_ONE); } -PK2US { return_opcode(require_NV_fp, VECTOR_OP, PK2US, OFF); } -PK2US_SAT { return_opcode(require_NV_fp, VECTOR_OP, PK2US, ZERO_ONE); } -PK4B { return_opcode(require_NV_fp, VECTOR_OP, PK4B, OFF); } -PK4B_SAT { return_opcode(require_NV_fp, VECTOR_OP, PK4B, ZERO_ONE); } -PK4UB { return_opcode(require_NV_fp, VECTOR_OP, PK4UB, OFF); } -PK4UB_SAT { return_opcode(require_NV_fp, VECTOR_OP, PK4UB, ZERO_ONE); } -POW { return_opcode( 1, BINSC_OP, POW, OFF); } -POW_SAT { return_opcode(require_ARB_fp, BINSC_OP, POW, ZERO_ONE); } - -RCP { return_opcode( 1, SCALAR_OP, RCP, OFF); } -RCP_SAT { return_opcode(require_ARB_fp, SCALAR_OP, RCP, ZERO_ONE); } -RFL { return_opcode(require_NV_fp, BIN_OP, RFL, OFF); } -RFL_SAT { return_opcode(require_NV_fp, BIN_OP, RFL, ZERO_ONE); } -RSQ { return_opcode( 1, SCALAR_OP, RSQ, OFF); } -RSQ_SAT { return_opcode(require_ARB_fp, SCALAR_OP, RSQ, ZERO_ONE); } - -SCS { return_opcode(require_ARB_fp, SCALAR_OP, SCS, OFF); } -SCS_SAT { return_opcode(require_ARB_fp, SCALAR_OP, SCS, ZERO_ONE); } -SEQ { return_opcode(require_NV_fp, BIN_OP, SEQ, OFF); } -SEQ_SAT { return_opcode(require_NV_fp, BIN_OP, SEQ, ZERO_ONE); } -SFL { return_opcode(require_NV_fp, BIN_OP, SFL, OFF); } -SFL_SAT { return_opcode(require_NV_fp, BIN_OP, SFL, ZERO_ONE); } -SGE { return_opcode( 1, BIN_OP, SGE, OFF); } -SGE_SAT { return_opcode(require_ARB_fp, BIN_OP, SGE, ZERO_ONE); } -SGT { return_opcode(require_NV_fp, BIN_OP, SGT, OFF); } -SGT_SAT { return_opcode(require_NV_fp, BIN_OP, SGT, ZERO_ONE); } -SIN { return_opcode(require_ARB_fp, SCALAR_OP, SIN, OFF); } -SIN_SAT { return_opcode(require_ARB_fp, SCALAR_OP, SIN, ZERO_ONE); } -SLE { return_opcode(require_NV_fp, BIN_OP, SLE, OFF); } -SLE_SAT { return_opcode(require_NV_fp, BIN_OP, SLE, ZERO_ONE); } -SLT { return_opcode( 1, BIN_OP, SLT, OFF); } -SLT_SAT { return_opcode(require_ARB_fp, BIN_OP, SLT, ZERO_ONE); } -SNE { return_opcode(require_NV_fp, BIN_OP, SNE, OFF); } -SNE_SAT { return_opcode(require_NV_fp, BIN_OP, SNE, ZERO_ONE); } -STR { return_opcode(require_NV_fp, BIN_OP, STR, OFF); } -STR_SAT { return_opcode(require_NV_fp, BIN_OP, STR, ZERO_ONE); } -SUB { return_opcode( 1, BIN_OP, SUB, OFF); } -SUB_SAT { return_opcode(require_ARB_fp, BIN_OP, SUB, ZERO_ONE); } -SWZ { return_opcode( 1, SWZ, SWZ, OFF); } -SWZ_SAT { return_opcode(require_ARB_fp, SWZ, SWZ, ZERO_ONE); } - -TEX { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, OFF); } -TEX_SAT { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, ZERO_ONE); } -TXB { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, OFF); } -TXB_SAT { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, ZERO_ONE); } -TXD { return_opcode(require_NV_fp, TXD_OP, TXD, OFF); } -TXD_SAT { return_opcode(require_NV_fp, TXD_OP, TXD, ZERO_ONE); } -TXP { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, OFF); } -TXP_SAT { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, ZERO_ONE); } - -UP2H { return_opcode(require_NV_fp, SCALAR_OP, UP2H, OFF); } -UP2H_SAT { return_opcode(require_NV_fp, SCALAR_OP, UP2H, ZERO_ONE); } -UP2US { return_opcode(require_NV_fp, SCALAR_OP, UP2US, OFF); } -UP2US_SAT { return_opcode(require_NV_fp, SCALAR_OP, UP2US, ZERO_ONE); } - -X2D { return_opcode(require_NV_fp, TRI_OP, X2D, OFF); } -X2D_SAT { return_opcode(require_NV_fp, TRI_OP, X2D, ZERO_ONE); } -XPD { return_opcode( 1, BIN_OP, XPD, OFF); } -XPD_SAT { return_opcode(require_ARB_fp, BIN_OP, XPD, ZERO_ONE); } +ABS{sz}{cc}{sat} { return_opcode( 1, VECTOR_OP, ABS, 3); } +ADD{sz}{cc}{sat} { return_opcode( 1, BIN_OP, ADD, 3); } +ARL { return_opcode(require_ARB_vp, ARL, ARL, 3); } + +CMP{sat} { return_opcode(require_ARB_fp, TRI_OP, CMP, 3); } +COS{szf}{cc}{sat} { return_opcode(require_ARB_fp, SCALAR_OP, COS, 3); } + +DDX{szf}{cc}{sat} { return_opcode(require_NV_fp, VECTOR_OP, DDX, 3); } +DDY{szf}{cc}{sat} { return_opcode(require_NV_fp, VECTOR_OP, DDY, 3); } +DP3{sz}{cc}{sat} { return_opcode( 1, BIN_OP, DP3, 3); } +DP4{sz}{cc}{sat} { return_opcode( 1, BIN_OP, DP4, 3); } +DPH{sz}{cc}{sat} { return_opcode( 1, BIN_OP, DPH, 3); } +DST{szf}{cc}{sat} { return_opcode( 1, BIN_OP, DST, 3); } + +EX2{szf}{cc}{sat} { return_opcode( 1, SCALAR_OP, EX2, 3); } +EXP { return_opcode(require_ARB_vp, SCALAR_OP, EXP, 3); } + +FLR{sz}{cc}{sat} { return_opcode( 1, VECTOR_OP, FLR, 3); } +FRC{sz}{cc}{sat} { return_opcode( 1, VECTOR_OP, FRC, 3); } + +KIL { return_opcode(require_ARB_fp, KIL, KIL, 3); } + +LIT{szf}{cc}{sat} { return_opcode( 1, VECTOR_OP, LIT, 3); } +LG2{szf}{cc}{sat} { return_opcode( 1, SCALAR_OP, LG2, 3); } +LOG { return_opcode(require_ARB_vp, SCALAR_OP, LOG, 3); } +LRP{sz}{cc}{sat} { return_opcode(require_ARB_fp, TRI_OP, LRP, 3); } + +MAD{sz}{cc}{sat} { return_opcode( 1, TRI_OP, MAD, 3); } +MAX{sz}{cc}{sat} { return_opcode( 1, BIN_OP, MAX, 3); } +MIN{sz}{cc}{sat} { return_opcode( 1, BIN_OP, MIN, 3); } +MOV{sz}{cc}{sat} { return_opcode( 1, VECTOR_OP, MOV, 3); } +MUL{sz}{cc}{sat} { return_opcode( 1, BIN_OP, MUL, 3); } + +PK2H { return_opcode(require_NV_fp, VECTOR_OP, PK2H, 4); } +PK2US { return_opcode(require_NV_fp, VECTOR_OP, PK2US, 5); } +PK4B { return_opcode(require_NV_fp, VECTOR_OP, PK4B, 4); } +PK4UB { return_opcode(require_NV_fp, VECTOR_OP, PK4UB, 5); } +POW{szf}{cc}{sat} { return_opcode( 1, BINSC_OP, POW, 3); } + +RCP{szf}{cc}{sat} { return_opcode( 1, SCALAR_OP, RCP, 3); } +RFL{szf}{cc}{sat} { return_opcode(require_NV_fp, BIN_OP, RFL, 3); } +RSQ{szf}{cc}{sat} { return_opcode( 1, SCALAR_OP, RSQ, 3); } + +SCS{sat} { return_opcode(require_ARB_fp, SCALAR_OP, SCS, 3); } +SEQ{sz}{cc}{sat} { return_opcode(require_NV_fp, BIN_OP, SEQ, 3); } +SFL{sz}{cc}{sat} { return_opcode(require_NV_fp, BIN_OP, SFL, 3); } +SGE{sz}{cc}{sat} { return_opcode( 1, BIN_OP, SGE, 3); } +SGT{sz}{cc}{sat} { return_opcode(require_NV_fp, BIN_OP, SGT, 3); } +SIN{szf}{cc}{sat} { return_opcode(require_ARB_fp, SCALAR_OP, SIN, 3); } +SLE{sz}{cc}{sat} { return_opcode(require_NV_fp, BIN_OP, SLE, 3); } +SLT{sz}{cc}{sat} { return_opcode( 1, BIN_OP, SLT, 3); } +SNE{sz}{cc}{sat} { return_opcode(require_NV_fp, BIN_OP, SNE, 3); } +STR{sz}{cc}{sat} { return_opcode(require_NV_fp, BIN_OP, STR, 3); } +SUB{sz}{cc}{sat} { return_opcode( 1, BIN_OP, SUB, 3); } +SWZ{sat} { return_opcode( 1, SWZ, SWZ, 3); } + +TEX{cc}{sat} { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, 3); } +TXB{cc}{sat} { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, 3); } +TXD{cc}{sat} { return_opcode(require_NV_fp, TXD_OP, TXD, 3); } +TXP{cc}{sat} { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, 3); } + +UP2H{cc}{sat} { return_opcode(require_NV_fp, SCALAR_OP, UP2H, 4); } +UP2US{cc}{sat} { return_opcode(require_NV_fp, SCALAR_OP, UP2US, 5); } + +X2D{szf}{cc}{sat} { return_opcode(require_NV_fp, TRI_OP, X2D, 3); } +XPD{sat} { return_opcode( 1, BIN_OP, XPD, 3); } vertex { return_token_or_IDENTIFIER(require_ARB_vp, VERTEX); } fragment { return_token_or_IDENTIFIER(require_ARB_fp, FRAGMENT); } diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index b9a0e557ad..e741e9a13b 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -597,16 +597,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 5 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 375 +#define YYLAST 383 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 117 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 136 +#define YYNNTS 137 /* YYNRULES -- Number of rules. */ -#define YYNRULES 270 +#define YYNRULES 272 /* YYNRULES -- Number of states. */ -#define YYNSTATES 456 +#define YYNSTATES 458 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 @@ -685,11 +685,11 @@ static const yytype_uint16 yyprhs[] = 564, 566, 568, 570, 572, 575, 577, 579, 581, 583, 589, 591, 595, 601, 607, 609, 613, 619, 621, 623, 625, 627, 629, 631, 633, 635, 637, 641, 647, 655, - 665, 668, 671, 673, 675, 676, 677, 681, 682, 686, - 690, 692, 697, 700, 703, 706, 709, 713, 716, 720, - 721, 723, 725, 726, 728, 730, 731, 733, 735, 736, - 738, 740, 741, 745, 746, 750, 751, 755, 757, 759, - 761 + 665, 668, 671, 673, 675, 676, 677, 682, 684, 685, + 686, 690, 694, 696, 702, 705, 708, 711, 714, 718, + 721, 725, 726, 728, 730, 731, 733, 735, 736, 738, + 740, 741, 743, 745, 746, 750, 751, 755, 756, 760, + 762, 764, 766 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ @@ -706,7 +706,7 @@ static const yytype_int16 yyrhs[] = 108, 141, -1, 17, 142, 108, 141, 108, 141, 108, 141, -1, 15, 142, 108, 141, 108, 136, 108, 137, -1, 20, 141, -1, 22, 142, 108, 141, 108, 141, - 108, 141, 108, 136, 108, 137, -1, 83, 247, -1, + 108, 141, 108, 136, 108, 137, -1, 83, 248, -1, 84, -1, 85, -1, 86, -1, 87, -1, 88, -1, 89, -1, 90, -1, 91, -1, 92, -1, 93, -1, 94, -1, 95, -1, 21, 142, 108, 147, 108, 144, @@ -715,19 +715,19 @@ static const yytype_int16 yyrhs[] = 147, 160, 109, -1, 148, 161, -1, 156, 158, -1, 145, 108, 145, 108, 145, 108, 145, -1, 233, 146, -1, 23, -1, 99, -1, 99, -1, 164, -1, 149, - 110, 150, 111, -1, 178, -1, 240, -1, 99, -1, + 110, 150, 111, -1, 178, -1, 241, -1, 99, -1, 99, -1, 151, -1, 152, -1, 23, -1, 156, 157, 153, -1, -1, 112, 154, -1, 113, 155, -1, 23, -1, 23, -1, 99, -1, 103, -1, 103, -1, 103, -1, 103, -1, 100, -1, 104, -1, -1, 100, -1, 101, -1, 102, -1, 103, -1, -1, 163, -1, 170, - -1, 234, -1, 236, -1, 239, -1, 252, -1, 7, + -1, 234, -1, 237, -1, 240, -1, 253, -1, 7, 99, 114, 164, -1, 96, 165, -1, 38, 169, -1, - 60, -1, 98, 167, -1, 53, -1, 29, 245, -1, - 37, -1, 74, 246, -1, 50, 110, 168, 111, -1, + 60, -1, 98, 167, -1, 53, -1, 29, 246, -1, + 37, -1, 74, 247, -1, 50, 110, 168, 111, -1, 97, 110, 166, 111, -1, 23, -1, -1, 110, 168, - 111, -1, 23, -1, 60, -1, 29, 245, -1, 37, - -1, 74, 246, -1, 171, -1, 172, -1, 10, 99, + 111, -1, 23, -1, 60, -1, 29, 246, -1, 37, + -1, 74, 247, -1, 171, -1, 172, -1, 10, 99, 174, -1, 10, 99, 110, 173, 111, 175, -1, -1, 23, -1, 114, 177, -1, 114, 115, 176, 116, -1, 179, -1, 176, 108, 179, -1, 181, -1, 217, -1, @@ -736,13 +736,13 @@ static const yytype_int16 yyrhs[] = 182, -1, 73, 184, -1, 73, 187, -1, 73, 189, -1, 73, 195, -1, 73, 191, -1, 73, 198, -1, 73, 200, -1, 73, 202, -1, 73, 204, -1, 73, - 216, -1, 47, 244, 183, -1, 193, -1, 33, -1, + 216, -1, 47, 245, 183, -1, 193, -1, 33, -1, 69, -1, 43, 110, 194, 111, 185, -1, 193, -1, 60, -1, 26, -1, 72, 186, -1, 40, -1, 32, - -1, 44, 188, -1, 25, -1, 244, 67, -1, 45, - 110, 194, 111, 244, 190, -1, 193, -1, 75, 248, + -1, 44, 188, -1, 25, -1, 245, 67, -1, 45, + 110, 194, 111, 245, 190, -1, 193, -1, 75, 249, 192, -1, 29, -1, 25, -1, 31, -1, 71, -1, - 23, -1, 76, 246, 196, 197, -1, 35, -1, 54, + 23, -1, 76, 247, 196, 197, -1, 35, -1, 54, -1, 79, -1, 80, -1, 78, -1, 77, -1, 36, 199, -1, 29, -1, 56, -1, 28, 110, 201, 111, 57, -1, 23, -1, 58, 203, -1, 70, -1, 26, @@ -750,7 +750,7 @@ static const yytype_int16 yyrhs[] = -1, 66, 110, 210, 105, 210, 111, -1, 49, 211, 208, -1, -1, 209, -1, 41, -1, 82, -1, 42, -1, 23, -1, 51, 212, -1, 63, -1, 52, -1, - 81, 246, -1, 55, 110, 214, 111, -1, 48, 110, + 81, 247, -1, 55, 110, 214, 111, -1, 48, 110, 215, 111, -1, -1, 213, -1, 23, -1, 23, -1, 23, -1, 30, 64, -1, 221, -1, 224, -1, 219, -1, 222, -1, 62, 34, 110, 220, 111, -1, 225, @@ -762,16 +762,17 @@ static const yytype_int16 yyrhs[] = -1, 115, 232, 108, 232, 116, -1, 115, 232, 108, 232, 108, 232, 116, -1, 115, 232, 108, 232, 108, 232, 108, 232, 116, -1, 233, 24, -1, 233, 23, - -1, 112, -1, 113, -1, -1, -1, 11, 235, 238, - -1, -1, 5, 237, 238, -1, 238, 108, 99, -1, - 99, -1, 9, 99, 114, 240, -1, 65, 60, -1, - 65, 37, -1, 65, 241, -1, 65, 59, -1, 65, - 74, 246, -1, 65, 30, -1, 29, 242, 243, -1, - -1, 39, -1, 27, -1, -1, 61, -1, 68, -1, - -1, 39, -1, 27, -1, -1, 61, -1, 68, -1, - -1, 110, 249, 111, -1, -1, 110, 250, 111, -1, - -1, 110, 251, 111, -1, 23, -1, 23, -1, 23, - -1, 6, 99, 114, 99, -1 + -1, 112, -1, 113, -1, -1, -1, 236, 11, 235, + 239, -1, 99, -1, -1, -1, 5, 238, 239, -1, + 239, 108, 99, -1, 99, -1, 236, 9, 99, 114, + 241, -1, 65, 60, -1, 65, 37, -1, 65, 242, + -1, 65, 59, -1, 65, 74, 247, -1, 65, 30, + -1, 29, 243, 244, -1, -1, 39, -1, 27, -1, + -1, 61, -1, 68, -1, -1, 39, -1, 27, -1, + -1, 61, -1, 68, -1, -1, 110, 250, 111, -1, + -1, 110, 251, 111, -1, -1, 110, 252, 111, -1, + 23, -1, 23, -1, 23, -1, 6, 99, 114, 99, + -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ @@ -800,11 +801,11 @@ static const yytype_uint16 yyrline[] = 1598, 1603, 1616, 1624, 1635, 1643, 1643, 1645, 1645, 1647, 1657, 1662, 1669, 1679, 1688, 1693, 1700, 1710, 1720, 1732, 1732, 1733, 1733, 1735, 1745, 1753, 1763, 1771, 1779, 1788, - 1799, 1803, 1809, 1810, 1811, 1814, 1814, 1817, 1817, 1820, - 1826, 1834, 1847, 1856, 1865, 1869, 1878, 1887, 1898, 1905, - 1910, 1919, 1931, 1934, 1943, 1954, 1955, 1956, 1959, 1960, - 1961, 1964, 1965, 1968, 1969, 1972, 1973, 1976, 1987, 1998, - 2009 + 1799, 1803, 1809, 1810, 1811, 1814, 1814, 1817, 1852, 1856, + 1856, 1859, 1865, 1873, 1886, 1895, 1904, 1908, 1917, 1926, + 1937, 1944, 1949, 1958, 1970, 1973, 1982, 1993, 1994, 1995, + 1998, 1999, 2000, 2003, 2004, 2007, 2008, 2011, 2012, 2015, + 2026, 2037, 2048 }; #endif @@ -866,9 +867,10 @@ static const char *const yytname[] = "progLocalParam", "progEnvParamNum", "progLocalParamNum", "paramConstDecl", "paramConstUse", "paramConstScalarDecl", "paramConstScalarUse", "paramConstVector", "signedFloatConstant", - "optionalSign", "TEMP_statement", "@1", "ADDRESS_statement", "@2", - "varNameList", "OUTPUT_statement", "resultBinding", "resultColBinding", - "optResultFaceType", "optResultColorType", "optFaceType", "optColorType", + "optionalSign", "TEMP_statement", "@1", "optVarSize", + "ADDRESS_statement", "@2", "varNameList", "OUTPUT_statement", + "resultBinding", "resultColBinding", "optResultFaceType", + "optResultColorType", "optFaceType", "optColorType", "optTexCoordUnitNum", "optTexImageUnitNum", "optLegacyTexUnitNum", "texCoordUnitNum", "texImageUnitNum", "legacyTexUnitNum", "ALIAS_statement", 0 @@ -921,11 +923,11 @@ static const yytype_uint8 yyr1[] = 212, 213, 214, 215, 216, 217, 217, 218, 218, 219, 220, 220, 221, 222, 223, 223, 224, 225, 226, 227, 227, 228, 228, 229, 230, 230, 231, 231, 231, 231, - 232, 232, 233, 233, 233, 235, 234, 237, 236, 238, - 238, 239, 240, 240, 240, 240, 240, 240, 241, 242, - 242, 242, 243, 243, 243, 244, 244, 244, 245, 245, - 245, 246, 246, 247, 247, 248, 248, 249, 250, 251, - 252 + 232, 232, 233, 233, 233, 235, 234, 236, 236, 238, + 237, 239, 239, 240, 241, 241, 241, 241, 241, 241, + 242, 243, 243, 243, 244, 244, 244, 245, 245, 245, + 246, 246, 246, 247, 247, 248, 248, 249, 249, 250, + 251, 252, 253 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -954,11 +956,11 @@ static const yytype_uint8 yyr2[] = 1, 1, 1, 1, 2, 1, 1, 1, 1, 5, 1, 3, 5, 5, 1, 3, 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 5, 7, 9, - 2, 2, 1, 1, 0, 0, 3, 0, 3, 3, - 1, 4, 2, 2, 2, 2, 3, 2, 3, 0, - 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, - 1, 0, 3, 0, 3, 0, 3, 1, 1, 1, - 4 + 2, 2, 1, 1, 0, 0, 4, 1, 0, 0, + 3, 3, 1, 5, 2, 2, 2, 2, 3, 2, + 3, 0, 1, 1, 0, 1, 1, 0, 1, 1, + 0, 1, 1, 0, 3, 0, 3, 0, 3, 1, + 1, 1, 4 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -966,143 +968,143 @@ static const yytype_uint8 yyr2[] = means the default is an error. */ static const yytype_uint16 yydefact[] = { - 0, 3, 4, 0, 6, 1, 9, 0, 5, 0, - 0, 237, 0, 0, 0, 0, 235, 2, 0, 0, - 0, 0, 0, 0, 0, 234, 0, 0, 8, 0, - 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, - 23, 20, 0, 88, 89, 113, 114, 90, 91, 92, - 93, 7, 0, 0, 0, 0, 0, 0, 0, 64, - 0, 87, 63, 0, 0, 0, 0, 0, 75, 0, - 0, 232, 233, 31, 0, 0, 0, 10, 11, 240, - 238, 0, 0, 0, 117, 234, 115, 236, 249, 247, - 243, 245, 242, 261, 244, 234, 83, 84, 85, 86, - 53, 234, 234, 234, 234, 234, 234, 77, 54, 225, - 224, 0, 0, 0, 0, 59, 0, 234, 82, 0, - 60, 62, 126, 127, 205, 206, 128, 221, 222, 0, - 234, 0, 270, 94, 241, 118, 0, 119, 123, 124, - 125, 219, 220, 223, 0, 251, 250, 252, 0, 246, - 0, 0, 0, 0, 26, 0, 25, 24, 258, 111, - 109, 261, 96, 0, 0, 0, 0, 0, 0, 255, - 0, 255, 0, 0, 265, 261, 134, 135, 136, 137, - 139, 138, 140, 141, 142, 143, 0, 144, 258, 101, - 0, 99, 97, 261, 0, 106, 95, 82, 0, 80, - 79, 81, 51, 0, 0, 0, 239, 0, 231, 230, - 253, 254, 248, 267, 0, 234, 234, 0, 47, 0, - 50, 0, 234, 259, 260, 110, 112, 0, 0, 0, - 204, 175, 176, 174, 0, 157, 257, 256, 156, 0, - 0, 0, 0, 199, 195, 0, 194, 261, 187, 181, - 180, 179, 0, 0, 0, 0, 100, 0, 102, 0, - 0, 98, 0, 234, 226, 68, 0, 66, 67, 0, - 234, 234, 0, 116, 262, 28, 27, 0, 78, 49, - 263, 0, 0, 217, 0, 218, 0, 178, 0, 166, - 0, 158, 0, 163, 164, 147, 148, 165, 145, 146, - 0, 201, 193, 200, 0, 196, 189, 191, 190, 186, - 188, 269, 0, 162, 161, 168, 169, 0, 0, 108, - 0, 105, 0, 0, 52, 0, 61, 76, 70, 46, - 0, 0, 0, 234, 48, 0, 33, 0, 234, 212, - 216, 0, 0, 255, 203, 0, 202, 0, 266, 173, - 172, 170, 171, 167, 192, 0, 103, 104, 107, 234, - 227, 0, 0, 69, 234, 57, 58, 56, 234, 0, - 0, 0, 121, 129, 132, 130, 207, 208, 131, 268, - 0, 34, 35, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 30, 29, 177, 152, 154, 151, 0, - 149, 150, 0, 198, 197, 182, 0, 73, 71, 74, - 72, 0, 0, 0, 0, 133, 184, 234, 120, 264, - 155, 153, 159, 160, 234, 228, 234, 0, 0, 0, - 0, 183, 122, 0, 0, 0, 0, 210, 0, 214, - 0, 229, 234, 0, 209, 0, 213, 0, 0, 55, - 32, 211, 215, 0, 0, 185 + 0, 3, 4, 0, 6, 1, 9, 0, 5, 238, + 0, 239, 0, 0, 0, 2, 0, 0, 0, 0, + 0, 0, 0, 234, 0, 0, 237, 8, 0, 12, + 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, + 20, 0, 88, 89, 113, 114, 90, 0, 91, 92, + 93, 7, 0, 0, 0, 0, 0, 64, 0, 87, + 63, 0, 0, 0, 0, 0, 75, 0, 0, 232, + 233, 31, 0, 0, 0, 10, 11, 0, 235, 242, + 240, 0, 0, 117, 234, 115, 251, 249, 245, 247, + 244, 263, 246, 234, 83, 84, 85, 86, 53, 234, + 234, 234, 234, 234, 234, 77, 54, 225, 224, 0, + 0, 0, 0, 59, 0, 234, 82, 0, 60, 62, + 126, 127, 205, 206, 128, 221, 222, 0, 234, 0, + 0, 0, 272, 94, 118, 0, 119, 123, 124, 125, + 219, 220, 223, 0, 253, 252, 254, 0, 248, 0, + 0, 0, 0, 26, 0, 25, 24, 260, 111, 109, + 263, 96, 0, 0, 0, 0, 0, 0, 257, 0, + 257, 0, 0, 267, 263, 134, 135, 136, 137, 139, + 138, 140, 141, 142, 143, 0, 144, 260, 101, 0, + 99, 97, 263, 0, 106, 95, 82, 0, 80, 79, + 81, 51, 0, 0, 0, 0, 236, 241, 0, 231, + 230, 255, 256, 250, 269, 0, 234, 234, 0, 47, + 0, 50, 0, 234, 261, 262, 110, 112, 0, 0, + 0, 204, 175, 176, 174, 0, 157, 259, 258, 156, + 0, 0, 0, 0, 199, 195, 0, 194, 263, 187, + 181, 180, 179, 0, 0, 0, 0, 100, 0, 102, + 0, 0, 98, 0, 234, 226, 68, 0, 66, 67, + 0, 234, 234, 243, 0, 116, 264, 28, 27, 0, + 78, 49, 265, 0, 0, 217, 0, 218, 0, 178, + 0, 166, 0, 158, 0, 163, 164, 147, 148, 165, + 145, 146, 0, 201, 193, 200, 0, 196, 189, 191, + 190, 186, 188, 271, 0, 162, 161, 168, 169, 0, + 0, 108, 0, 105, 0, 0, 52, 0, 61, 76, + 70, 46, 0, 0, 0, 234, 48, 0, 33, 0, + 234, 212, 216, 0, 0, 257, 203, 0, 202, 0, + 268, 173, 172, 170, 171, 167, 192, 0, 103, 104, + 107, 234, 227, 0, 0, 69, 234, 57, 58, 56, + 234, 0, 0, 0, 121, 129, 132, 130, 207, 208, + 131, 270, 0, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 44, 45, 30, 29, 177, 152, 154, + 151, 0, 149, 150, 0, 198, 197, 182, 0, 73, + 71, 74, 72, 0, 0, 0, 0, 133, 184, 234, + 120, 266, 155, 153, 159, 160, 234, 228, 234, 0, + 0, 0, 0, 183, 122, 0, 0, 0, 0, 210, + 0, 214, 0, 229, 234, 0, 209, 0, 213, 0, + 0, 55, 32, 211, 215, 0, 0, 185 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 3, 4, 6, 8, 9, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 281, - 393, 41, 151, 218, 73, 60, 69, 329, 330, 367, - 219, 61, 119, 266, 267, 268, 363, 408, 410, 70, - 328, 108, 279, 202, 100, 42, 43, 120, 196, 322, - 261, 320, 162, 44, 45, 46, 136, 86, 273, 371, - 137, 121, 372, 373, 122, 176, 298, 177, 400, 421, - 178, 238, 179, 422, 180, 314, 299, 290, 181, 317, - 353, 182, 233, 183, 288, 184, 251, 185, 415, 431, - 186, 309, 310, 355, 248, 302, 303, 347, 345, 187, - 123, 375, 376, 436, 124, 377, 438, 125, 284, 286, - 378, 126, 141, 127, 128, 143, 74, 47, 57, 48, - 52, 80, 49, 62, 94, 147, 212, 239, 225, 149, - 336, 253, 214, 380, 312, 50 + -1, 3, 4, 6, 8, 9, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 283, + 395, 40, 150, 219, 71, 58, 67, 331, 332, 369, + 220, 59, 117, 267, 268, 269, 365, 410, 412, 68, + 330, 106, 281, 201, 98, 41, 42, 118, 195, 324, + 262, 322, 161, 43, 44, 45, 135, 85, 275, 373, + 136, 119, 374, 375, 120, 175, 300, 176, 402, 423, + 177, 239, 178, 424, 179, 316, 301, 292, 180, 319, + 355, 181, 234, 182, 290, 183, 252, 184, 417, 433, + 185, 311, 312, 357, 249, 304, 305, 349, 347, 186, + 121, 377, 378, 438, 122, 379, 440, 123, 286, 288, + 380, 124, 140, 125, 126, 142, 72, 46, 130, 47, + 48, 52, 80, 49, 60, 92, 146, 213, 240, 226, + 148, 338, 254, 215, 382, 314, 50 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -403 +#define YYPACT_NINF -386 static const yytype_int16 yypact[] = { - 62, -403, -403, 41, -403, -403, 81, -36, -403, 198, - -8, -403, -5, 18, 20, 35, -403, -403, -23, -23, - -23, -23, -23, -23, 45, 131, -23, -23, -403, 58, - -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, - -403, -403, 67, -403, -403, -403, -403, -403, -403, -403, - -403, -403, 63, 86, 92, 128, 84, 63, 99, -403, - 69, 133, -403, 87, 89, 129, 145, 146, -403, 147, - 154, -403, -403, -403, -13, 150, 151, -403, -403, -403, - 152, 162, -14, 197, 240, -34, -403, 152, 98, -403, - -403, -403, -403, 155, -403, 131, -403, -403, -403, -403, - -403, 131, 131, 131, 131, 131, 131, -403, -403, -403, - -403, 72, 105, 77, 17, 156, 12, 131, 68, 157, - -403, -403, -403, -403, -403, -403, -403, -403, -403, 12, - 131, 165, -403, -403, -403, -403, 158, -403, -403, -403, - -403, -403, -403, -403, 223, -403, -403, -16, 245, -403, - 163, 164, -9, 167, -403, 168, -403, -403, 55, -403, - -403, 155, -403, 170, 171, 172, 206, 2, 173, 34, - 174, 127, 112, 1, 175, 155, -403, -403, -403, -403, - -403, -403, -403, -403, -403, -403, 207, -403, 55, -403, - 177, -403, -403, 155, 178, 179, -403, 68, 22, -403, - -403, -403, -403, -6, 169, 182, -403, 180, -403, -403, - -403, -403, -403, -403, 181, 131, 131, 12, -403, 188, - 190, 195, 131, -403, -403, -403, -403, 272, 273, 274, - -403, -403, -403, -403, 275, -403, -403, -403, -403, 232, - 275, 79, 191, 277, -403, 192, -403, 155, 15, -403, - -403, -403, 280, 276, 8, 194, -403, 283, -403, 284, - 283, -403, 199, 131, -403, -403, 200, -403, -403, 209, - 131, 131, 201, -403, -403, -403, -403, 204, -403, -403, - 205, 210, 211, -403, 203, -403, 212, -403, 213, -403, - 214, -403, 215, -403, -403, -403, -403, -403, -403, -403, - 286, -403, -403, -403, 294, -403, -403, -403, -403, -403, - -403, -403, 216, -403, -403, -403, -403, 161, 297, -403, - 217, -403, 218, 219, -403, 76, -403, -403, 139, -403, - 227, -4, 228, 30, -403, 298, -403, 137, 131, -403, - -403, 265, 130, 127, -403, 220, -403, 226, -403, -403, - -403, -403, -403, -403, -403, 229, -403, -403, -403, 131, - -403, 315, 319, -403, 131, -403, -403, -403, 131, 123, - 77, 80, -403, -403, -403, -403, -403, -403, -403, -403, - 233, -403, -403, -403, -403, -403, -403, -403, -403, -403, - -403, -403, -403, -403, -403, -403, -403, -403, -403, 311, - -403, -403, 9, -403, -403, -403, 83, -403, -403, -403, - -403, 237, 238, 239, 241, -403, 281, 30, -403, -403, - -403, -403, -403, -403, 131, -403, 131, 195, 272, 273, - 242, -403, -403, 234, 246, 247, 248, 243, 249, 251, - 297, -403, 131, 137, -403, 272, -403, 273, 36, -403, - -403, -403, -403, 297, 250, -403 + 203, -386, -386, 23, -386, -386, 67, -50, -386, 20, + 16, -386, 21, 37, 48, -386, -19, -19, -19, -19, + -19, -19, 58, 131, -19, -19, -386, -386, 53, -386, + -386, -386, -386, -386, -386, -386, -386, -386, -386, -386, + -386, 64, -386, -386, -386, -386, -386, 229, -386, -386, + -386, -386, 77, 81, 89, 78, 95, -386, 75, 130, + -386, 119, 139, 140, 142, 146, -386, 147, 136, -386, + -386, -386, -14, 148, 149, -386, -386, 159, -386, -386, + 152, 162, -20, 239, -6, -386, 31, -386, -386, -386, + -386, 153, -386, 131, -386, -386, -386, -386, -386, 131, + 131, 131, 131, 131, 131, -386, -386, -386, -386, 28, + 50, 123, 40, 154, 30, 131, 101, 155, -386, -386, + -386, -386, -386, -386, -386, -386, -386, 30, 131, 156, + 77, 167, -386, -386, -386, 158, -386, -386, -386, -386, + -386, -386, -386, 218, -386, -386, 13, 244, -386, 160, + 163, -10, 164, -386, 165, -386, -386, 73, -386, -386, + 153, -386, 166, 168, 169, 210, 42, 170, 91, 171, + 100, 145, 38, 173, 153, -386, -386, -386, -386, -386, + -386, -386, -386, -386, -386, 209, -386, 73, -386, 174, + -386, -386, 153, 175, 176, -386, 101, 57, -386, -386, + -386, -386, -16, 179, 180, 225, 152, -386, 177, -386, + -386, -386, -386, -386, -386, 181, 131, 131, 30, -386, + 190, 191, 212, 131, -386, -386, -386, -386, 273, 274, + 275, -386, -386, -386, -386, 276, -386, -386, -386, -386, + 233, 276, 115, 192, 278, -386, 193, -386, 153, 9, + -386, -386, -386, 281, 277, 25, 195, -386, 284, -386, + 285, 284, -386, 200, 131, -386, -386, 199, -386, -386, + 208, 131, 131, -386, 197, -386, -386, -386, -386, 206, + -386, -386, 207, 205, 211, -386, 213, -386, 214, -386, + 215, -386, 216, -386, 217, -386, -386, -386, -386, -386, + -386, -386, 293, -386, -386, -386, 295, -386, -386, -386, + -386, -386, -386, -386, 219, -386, -386, -386, -386, 157, + 297, -386, 220, -386, 221, 222, -386, 66, -386, -386, + 133, -386, 226, -12, 230, 49, -386, 298, -386, 125, + 131, -386, -386, 265, 118, 100, -386, 228, -386, 232, + -386, -386, -386, -386, -386, -386, -386, 234, -386, -386, + -386, 131, -386, 300, 306, -386, 131, -386, -386, -386, + 131, 129, 123, 69, -386, -386, -386, -386, -386, -386, + -386, -386, 235, -386, -386, -386, -386, -386, -386, -386, + -386, -386, -386, -386, -386, -386, -386, -386, -386, -386, + -386, 308, -386, -386, 41, -386, -386, -386, 86, -386, + -386, -386, -386, 240, 241, 231, 237, -386, 286, 49, + -386, -386, -386, -386, -386, -386, 131, -386, 131, 212, + 273, 274, 243, -386, -386, 238, 242, 247, 245, 246, + 248, 252, 297, -386, 131, 125, -386, 273, -386, 274, + 45, -386, -386, -386, -386, 297, 250, -386 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, - -403, -403, -403, -403, -403, -403, -403, -403, -403, -74, - -81, -403, -98, 141, -82, 160, -403, -403, -358, -403, - -41, -403, -403, -403, -403, -403, -403, -403, -403, 166, - -403, -403, -403, 176, -403, -403, -403, 282, -403, -403, - -403, 103, -403, -403, -403, -403, -403, -403, -403, -403, - -403, -403, -52, -403, -84, -403, -403, -403, -403, -403, - -403, -403, -403, -403, -403, -403, -333, 126, -403, -403, - -403, -403, -403, -403, -403, -403, -403, -403, -403, -403, - -3, -403, -403, -402, -403, -403, -403, -403, -403, -403, - 285, -403, -403, -403, -403, -403, -403, -403, -398, -392, - 287, -403, -403, -145, -83, -114, -85, -403, -403, -403, - -403, 314, -403, 291, -403, -403, -403, -167, 187, -149, - -403, -403, -403, -403, -403, -403 + -386, -386, -386, -386, -386, -386, -386, -386, -386, -386, + -386, -386, -386, -386, -386, -386, -386, -386, -386, -71, + -80, -386, -96, 144, -81, 204, -386, -386, -350, -386, + -17, -386, -386, -386, -386, -386, -386, -386, -386, 161, + -386, -386, -386, 172, -386, -386, -386, 282, -386, -386, + -386, 105, -386, -386, -386, -386, -386, -386, -386, -386, + -386, -386, -52, -386, -83, -386, -386, -386, -386, -386, + -386, -386, -386, -386, -386, -386, -300, 128, -386, -386, + -386, -386, -386, -386, -386, -386, -386, -386, -386, -386, + -2, -386, -386, -327, -386, -386, -386, -386, -386, -386, + 287, -386, -386, -386, -386, -386, -386, -386, -385, -318, + 288, -386, -386, -145, -82, -112, -84, -386, -386, -386, + -386, -386, 249, -386, 178, -386, -386, -386, -166, 186, + -131, -386, -386, -386, -386, -386, -386 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -1112,86 +1114,88 @@ static const yytype_int16 yypgoto[] = #define YYTABLE_NINF -222 static const yytype_int16 yytable[] = { - 144, 138, 142, 198, 241, 154, 411, 220, 157, 401, - 109, 110, 226, 150, 109, 110, 152, 265, 152, 365, - 153, 152, 155, 156, 111, 111, 254, 249, 112, 111, - 437, 231, 144, 118, 293, 109, 110, 439, 448, 113, - 294, 5, 58, 315, 258, 210, 188, 451, 205, 112, - 111, 454, 211, 112, 189, 452, 306, 307, 232, 235, - 113, 236, 316, 10, 113, 1, 2, 190, 434, 423, - 191, 250, 220, 237, 112, 197, 59, 192, 71, 72, - 297, 117, 114, 114, 449, 113, 115, 114, 204, 7, - 115, 193, 369, 68, 53, 366, 116, 308, 305, 51, - 217, 158, 117, 370, 293, 165, 117, 166, 114, 159, - 294, 115, 295, 167, 194, 195, 223, 54, 276, 55, - 168, 169, 170, 224, 171, 145, 172, 117, 88, 89, - 263, 152, 160, 275, 56, 173, 90, 146, 264, 163, - 282, 453, 71, 72, 68, 117, 161, 405, 296, 325, - 297, 164, 174, 175, 236, 293, 396, 413, 91, 92, - 242, 294, 79, 243, 244, 77, 237, 245, 199, 414, - 397, 200, 201, 93, 78, 246, 402, 95, 144, 63, - 64, 65, 66, 67, 359, 331, 75, 76, 417, 332, - 398, 424, 360, 247, 84, 101, 418, 102, 85, 425, - 81, 297, 399, 11, 12, 13, 82, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 381, 382, 383, 384, 385, 386, 387, 388, 389, - 390, 391, 392, 96, 97, 98, 99, 103, 349, 350, - 351, 352, 83, 71, 72, 406, 208, 209, 144, 374, - 142, 361, 362, 104, 105, 106, 394, 107, 129, 130, - 131, 132, 58, 135, 206, 148, -65, 203, 213, 207, - 230, 215, 216, 255, 144, 221, 222, 270, 280, 331, - 227, 228, 229, 234, 240, 252, 412, 257, 259, 260, - 271, 278, 274, -221, 272, 283, 285, 287, 289, 291, - 301, 300, 304, 311, 318, 313, 319, 321, 324, 344, - 433, 326, 327, 334, 339, 335, 333, 346, 337, 338, - 354, 379, 395, 340, 341, 342, 343, 348, 356, 357, - 358, 403, 144, 374, 142, 364, 368, 404, 407, 144, - 405, 331, 409, 420, 419, 426, 427, 430, 445, 428, - 441, 429, 440, 435, 442, 443, 447, 331, 277, 444, - 446, 455, 450, 323, 133, 432, 292, 416, 0, 269, - 139, 87, 140, 262, 134, 256 + 143, 137, 141, 197, 242, 153, 221, 266, 156, 107, + 108, 367, 149, 107, 108, 151, 413, 151, 109, 152, + 151, 154, 155, 5, 109, 11, 12, 13, 109, 227, + 14, 143, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 255, 403, 439, 56, 204, 110, 10, + 308, 309, 110, 107, 108, 116, 110, 157, 144, 111, + 317, 259, 453, 111, 250, 158, 295, 111, 109, 187, + 145, 232, 296, 221, 211, 7, 112, 188, 436, 318, + 57, 212, 112, 66, 162, 113, 112, 368, 159, 113, + 189, 310, 110, 190, 451, 114, 163, 196, 233, 218, + 191, 115, 160, 111, 425, 115, 69, 70, 251, 115, + 203, 371, 299, 441, 192, 450, 236, 307, 237, 26, + 53, 278, 372, 51, 86, 87, 112, 237, 456, 113, + 238, 454, 88, 151, 224, 277, 54, 193, 194, 238, + 295, 225, 284, 295, 398, 115, 296, 55, 297, 296, + 455, 164, 327, 165, 89, 90, 407, 66, 399, 166, + 75, 69, 70, 415, 115, 264, 167, 168, 169, 91, + 170, 76, 171, 265, 361, 416, 79, 419, 400, 404, + 143, 172, 362, 93, 298, 420, 299, 333, 83, 299, + 401, 334, 84, 243, 426, 81, 244, 245, 173, 174, + 246, 198, 427, 82, 199, 200, 1, 2, 247, 383, + 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, + 394, 61, 62, 63, 64, 65, 248, 99, 73, 74, + 94, 95, 96, 97, 351, 352, 353, 354, 77, 105, + 78, 209, 210, 69, 70, 363, 364, 100, 101, 408, + 102, 143, 376, 141, 103, 104, 127, 128, 129, 396, + 131, 132, 134, 147, -65, 202, 207, 214, 216, 208, + 205, 217, 222, 223, 231, 256, 228, 143, 229, 230, + 235, 241, 333, 253, 258, 260, 261, 271, 272, 414, + 56, 274, 276, 280, -221, 282, 285, 287, 289, 291, + 293, 303, 302, 306, 313, 320, 315, 321, 323, 326, + 328, 329, 335, 339, 435, 336, 346, 337, 348, 340, + 356, 381, 397, 409, 341, 342, 343, 344, 345, 411, + 350, 358, 359, 360, 366, 143, 376, 141, 370, 405, + 422, 430, 143, 406, 333, 407, 421, 431, 428, 429, + 444, 447, 432, 442, 443, 445, 446, 449, 437, 448, + 333, 457, 279, 270, 133, 452, 325, 434, 263, 294, + 418, 138, 139, 257, 0, 0, 0, 0, 0, 206, + 0, 0, 0, 273 }; static const yytype_int16 yycheck[] = { - 85, 85, 85, 117, 171, 103, 364, 152, 106, 342, - 23, 24, 161, 95, 23, 24, 101, 23, 103, 23, - 102, 106, 104, 105, 38, 38, 175, 26, 62, 38, - 428, 29, 117, 74, 25, 23, 24, 429, 440, 73, - 31, 0, 65, 35, 193, 61, 29, 445, 130, 62, - 38, 453, 68, 62, 37, 447, 41, 42, 56, 25, - 73, 27, 54, 99, 73, 3, 4, 50, 426, 402, - 53, 70, 217, 39, 62, 116, 99, 60, 112, 113, - 71, 115, 96, 96, 442, 73, 99, 96, 129, 8, - 99, 74, 62, 99, 99, 99, 109, 82, 247, 107, - 109, 29, 115, 73, 25, 28, 115, 30, 96, 37, - 31, 99, 33, 36, 97, 98, 61, 99, 216, 99, - 43, 44, 45, 68, 47, 27, 49, 115, 29, 30, - 108, 216, 60, 215, 99, 58, 37, 39, 116, 34, - 222, 105, 112, 113, 99, 115, 74, 111, 69, 263, - 71, 46, 75, 76, 27, 25, 26, 34, 59, 60, - 48, 31, 99, 51, 52, 107, 39, 55, 100, 46, - 40, 103, 104, 74, 107, 63, 343, 108, 263, 19, - 20, 21, 22, 23, 108, 270, 26, 27, 108, 271, - 60, 108, 116, 81, 110, 108, 116, 108, 114, 116, - 114, 71, 72, 5, 6, 7, 114, 9, 10, 11, - 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, - 22, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 100, 101, 102, 103, 108, 77, 78, - 79, 80, 114, 112, 113, 359, 23, 24, 333, 333, - 333, 112, 113, 108, 108, 108, 338, 103, 108, 108, - 108, 99, 65, 23, 99, 110, 110, 110, 23, 111, - 64, 108, 108, 66, 359, 108, 108, 108, 83, 364, - 110, 110, 110, 110, 110, 110, 368, 110, 110, 110, - 108, 103, 111, 103, 114, 23, 23, 23, 23, 67, - 23, 110, 110, 23, 110, 29, 23, 23, 109, 23, - 424, 111, 103, 109, 111, 110, 115, 23, 108, 108, - 23, 23, 57, 111, 111, 111, 111, 111, 111, 111, - 111, 111, 417, 417, 417, 108, 108, 111, 23, 424, - 111, 426, 23, 32, 111, 108, 108, 66, 105, 110, - 116, 110, 110, 427, 108, 108, 105, 442, 217, 111, - 111, 111, 443, 260, 82, 417, 240, 370, -1, 203, - 85, 57, 85, 197, 83, 188 + 84, 84, 84, 115, 170, 101, 151, 23, 104, 23, + 24, 23, 93, 23, 24, 99, 366, 101, 38, 100, + 104, 102, 103, 0, 38, 5, 6, 7, 38, 160, + 10, 115, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 174, 344, 430, 65, 128, 62, 99, + 41, 42, 62, 23, 24, 72, 62, 29, 27, 73, + 35, 192, 447, 73, 26, 37, 25, 73, 38, 29, + 39, 29, 31, 218, 61, 8, 96, 37, 428, 54, + 99, 68, 96, 99, 34, 99, 96, 99, 60, 99, + 50, 82, 62, 53, 444, 109, 46, 114, 56, 109, + 60, 115, 74, 73, 404, 115, 112, 113, 70, 115, + 127, 62, 71, 431, 74, 442, 25, 248, 27, 99, + 99, 217, 73, 107, 29, 30, 96, 27, 455, 99, + 39, 449, 37, 217, 61, 216, 99, 97, 98, 39, + 25, 68, 223, 25, 26, 115, 31, 99, 33, 31, + 105, 28, 264, 30, 59, 60, 111, 99, 40, 36, + 107, 112, 113, 34, 115, 108, 43, 44, 45, 74, + 47, 107, 49, 116, 108, 46, 99, 108, 60, 345, + 264, 58, 116, 108, 69, 116, 71, 271, 110, 71, + 72, 272, 114, 48, 108, 114, 51, 52, 75, 76, + 55, 100, 116, 114, 103, 104, 3, 4, 63, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 95, 17, 18, 19, 20, 21, 81, 108, 24, 25, + 100, 101, 102, 103, 77, 78, 79, 80, 9, 103, + 11, 23, 24, 112, 113, 112, 113, 108, 108, 361, + 108, 335, 335, 335, 108, 108, 108, 108, 99, 340, + 108, 99, 23, 110, 110, 110, 99, 23, 108, 111, + 114, 108, 108, 108, 64, 66, 110, 361, 110, 110, + 110, 110, 366, 110, 110, 110, 110, 108, 108, 370, + 65, 114, 111, 103, 103, 83, 23, 23, 23, 23, + 67, 23, 110, 110, 23, 110, 29, 23, 23, 109, + 111, 103, 115, 108, 426, 109, 23, 110, 23, 108, + 23, 23, 57, 23, 111, 111, 111, 111, 111, 23, + 111, 111, 111, 111, 108, 419, 419, 419, 108, 111, + 32, 110, 426, 111, 428, 111, 111, 110, 108, 108, + 108, 105, 66, 110, 116, 108, 111, 105, 429, 111, + 444, 111, 218, 202, 82, 445, 261, 419, 196, 241, + 372, 84, 84, 187, -1, -1, -1, -1, -1, 130, + -1, -1, -1, 205 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -1199,51 +1203,51 @@ static const yytype_int16 yycheck[] = static const yytype_uint8 yystos[] = { 0, 3, 4, 118, 119, 0, 120, 8, 121, 122, - 99, 5, 6, 7, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 123, 124, - 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, - 135, 138, 162, 163, 170, 171, 172, 234, 236, 239, - 252, 107, 237, 99, 99, 99, 99, 235, 65, 99, - 142, 148, 240, 142, 142, 142, 142, 142, 99, 143, - 156, 112, 113, 141, 233, 142, 142, 107, 107, 99, - 238, 114, 114, 114, 110, 114, 174, 238, 29, 30, - 37, 59, 60, 74, 241, 108, 100, 101, 102, 103, - 161, 108, 108, 108, 108, 108, 108, 103, 158, 23, - 24, 38, 62, 73, 96, 99, 109, 115, 147, 149, - 164, 178, 181, 217, 221, 224, 228, 230, 231, 108, - 108, 108, 99, 164, 240, 23, 173, 177, 181, 217, - 227, 229, 231, 232, 233, 27, 39, 242, 110, 246, - 141, 139, 233, 141, 139, 141, 141, 139, 29, 37, - 60, 74, 169, 34, 46, 28, 30, 36, 43, 44, - 45, 47, 49, 58, 75, 76, 182, 184, 187, 189, - 191, 195, 198, 200, 202, 204, 207, 216, 29, 37, - 50, 53, 60, 74, 97, 98, 165, 147, 232, 100, - 103, 104, 160, 110, 147, 141, 99, 111, 23, 24, - 61, 68, 243, 23, 249, 108, 108, 109, 140, 147, - 230, 108, 108, 61, 68, 245, 246, 110, 110, 110, - 64, 29, 56, 199, 110, 25, 27, 39, 188, 244, - 110, 244, 48, 51, 52, 55, 63, 81, 211, 26, - 70, 203, 110, 248, 246, 66, 245, 110, 246, 110, - 110, 167, 160, 108, 116, 23, 150, 151, 152, 156, - 108, 108, 114, 175, 111, 141, 139, 140, 103, 159, - 83, 136, 141, 23, 225, 23, 226, 23, 201, 23, - 194, 67, 194, 25, 31, 33, 69, 71, 183, 193, - 110, 23, 212, 213, 110, 246, 41, 42, 82, 208, - 209, 23, 251, 29, 192, 35, 54, 196, 110, 23, - 168, 23, 166, 168, 109, 232, 111, 103, 157, 144, - 145, 233, 141, 115, 109, 110, 247, 108, 108, 111, - 111, 111, 111, 111, 23, 215, 23, 214, 111, 77, - 78, 79, 80, 197, 23, 210, 111, 111, 111, 108, - 116, 112, 113, 153, 108, 23, 99, 146, 108, 62, - 73, 176, 179, 180, 181, 218, 219, 222, 227, 23, - 250, 84, 85, 86, 87, 88, 89, 90, 91, 92, - 93, 94, 95, 137, 141, 57, 26, 40, 60, 72, - 185, 193, 244, 111, 111, 111, 232, 23, 154, 23, - 155, 145, 141, 34, 46, 205, 207, 108, 116, 111, - 32, 186, 190, 193, 108, 116, 108, 108, 110, 110, - 66, 206, 179, 232, 145, 136, 220, 225, 223, 226, - 110, 116, 108, 108, 111, 105, 111, 105, 210, 145, - 137, 225, 226, 105, 210, 111 + 99, 5, 6, 7, 10, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 99, 123, 124, 125, + 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, + 138, 162, 163, 170, 171, 172, 234, 236, 237, 240, + 253, 107, 238, 99, 99, 99, 65, 99, 142, 148, + 241, 142, 142, 142, 142, 142, 99, 143, 156, 112, + 113, 141, 233, 142, 142, 107, 107, 9, 11, 99, + 239, 114, 114, 110, 114, 174, 29, 30, 37, 59, + 60, 74, 242, 108, 100, 101, 102, 103, 161, 108, + 108, 108, 108, 108, 108, 103, 158, 23, 24, 38, + 62, 73, 96, 99, 109, 115, 147, 149, 164, 178, + 181, 217, 221, 224, 228, 230, 231, 108, 108, 99, + 235, 108, 99, 164, 23, 173, 177, 181, 217, 227, + 229, 231, 232, 233, 27, 39, 243, 110, 247, 141, + 139, 233, 141, 139, 141, 141, 139, 29, 37, 60, + 74, 169, 34, 46, 28, 30, 36, 43, 44, 45, + 47, 49, 58, 75, 76, 182, 184, 187, 189, 191, + 195, 198, 200, 202, 204, 207, 216, 29, 37, 50, + 53, 60, 74, 97, 98, 165, 147, 232, 100, 103, + 104, 160, 110, 147, 141, 114, 239, 99, 111, 23, + 24, 61, 68, 244, 23, 250, 108, 108, 109, 140, + 147, 230, 108, 108, 61, 68, 246, 247, 110, 110, + 110, 64, 29, 56, 199, 110, 25, 27, 39, 188, + 245, 110, 245, 48, 51, 52, 55, 63, 81, 211, + 26, 70, 203, 110, 249, 247, 66, 246, 110, 247, + 110, 110, 167, 160, 108, 116, 23, 150, 151, 152, + 156, 108, 108, 241, 114, 175, 111, 141, 139, 140, + 103, 159, 83, 136, 141, 23, 225, 23, 226, 23, + 201, 23, 194, 67, 194, 25, 31, 33, 69, 71, + 183, 193, 110, 23, 212, 213, 110, 247, 41, 42, + 82, 208, 209, 23, 252, 29, 192, 35, 54, 196, + 110, 23, 168, 23, 166, 168, 109, 232, 111, 103, + 157, 144, 145, 233, 141, 115, 109, 110, 248, 108, + 108, 111, 111, 111, 111, 111, 23, 215, 23, 214, + 111, 77, 78, 79, 80, 197, 23, 210, 111, 111, + 111, 108, 116, 112, 113, 153, 108, 23, 99, 146, + 108, 62, 73, 176, 179, 180, 181, 218, 219, 222, + 227, 23, 251, 84, 85, 86, 87, 88, 89, 90, + 91, 92, 93, 94, 95, 137, 141, 57, 26, 40, + 60, 72, 185, 193, 245, 111, 111, 111, 232, 23, + 154, 23, 155, 145, 141, 34, 46, 205, 207, 108, + 116, 111, 32, 186, 190, 193, 108, 116, 108, 108, + 110, 110, 66, 206, 179, 232, 145, 136, 220, 225, + 223, 226, 110, 116, 108, 108, 111, 105, 111, 105, + 210, 145, 137, 225, 226, 105, 210, 111 }; #define yyerrok (yyerrstatus = 0) @@ -4350,20 +4354,67 @@ yyreduce: /* Line 1455 of yacc.c */ #line 1814 "program_parse.y" - { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} + { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; case 237: /* Line 1455 of yacc.c */ -#line 1817 "program_parse.y" - { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} +#line 1818 "program_parse.y" + { + /* NV_fragment_program_option defines the size qualifiers in a + * fairly broken way. "SHORT" or "LONG" can optionally be used + * before TEMP or OUTPUT. However, neither is a reserved word! + * This means that we have to parse it as an identifier, then check + * to make sure it's one of the valid values. *sigh* + * + * In addition, the grammar in the extension spec does *not* allow + * the size specifier to be optional, but all known implementations + * do. + */ + if (!state->option.NV_fragment) { + yyerror(& (yylsp[(1) - (1)]), state, "unexpected IDENTIFIER"); + YYERROR; + } + + if (strcmp("SHORT", (yyvsp[(1) - (1)].string)) == 0) { + } else if (strcmp("LONG", (yyvsp[(1) - (1)].string)) == 0) { + } else { + char *const err_str = + make_error_string("invalid storage size specifier \"%s\"", + (yyvsp[(1) - (1)].string)); + + yyerror(& (yylsp[(1) - (1)]), state, (err_str != NULL) + ? err_str : "invalid storage size specifier"); + + if (err_str != NULL) { + _mesa_free(err_str); + } + + YYERROR; + } + ;} + break; + + case 238: + +/* Line 1455 of yacc.c */ +#line 1852 "program_parse.y" + { + ;} break; case 239: /* Line 1455 of yacc.c */ -#line 1821 "program_parse.y" +#line 1856 "program_parse.y" + { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} + break; + + case 241: + +/* Line 1455 of yacc.c */ +#line 1860 "program_parse.y" { if (!declare_variable(state, (yyvsp[(3) - (3)].string), (yyvsp[(0) - (3)].integer), & (yylsp[(3) - (3)]))) { YYERROR; @@ -4371,10 +4422,10 @@ yyreduce: ;} break; - case 240: + case 242: /* Line 1455 of yacc.c */ -#line 1827 "program_parse.y" +#line 1866 "program_parse.y" { if (!declare_variable(state, (yyvsp[(1) - (1)].string), (yyvsp[(0) - (1)].integer), & (yylsp[(1) - (1)]))) { YYERROR; @@ -4382,26 +4433,26 @@ yyreduce: ;} break; - case 241: + case 243: /* Line 1455 of yacc.c */ -#line 1835 "program_parse.y" +#line 1874 "program_parse.y" { struct asm_symbol *const s = - declare_variable(state, (yyvsp[(2) - (4)].string), at_output, & (yylsp[(2) - (4)])); + declare_variable(state, (yyvsp[(3) - (5)].string), at_output, & (yylsp[(3) - (5)])); if (s == NULL) { YYERROR; } else { - s->output_binding = (yyvsp[(4) - (4)].result); + s->output_binding = (yyvsp[(5) - (5)].result); } ;} break; - case 242: + case 244: /* Line 1455 of yacc.c */ -#line 1848 "program_parse.y" +#line 1887 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_HPOS; @@ -4412,10 +4463,10 @@ yyreduce: ;} break; - case 243: + case 245: /* Line 1455 of yacc.c */ -#line 1857 "program_parse.y" +#line 1896 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_FOGC; @@ -4426,19 +4477,19 @@ yyreduce: ;} break; - case 244: + case 246: /* Line 1455 of yacc.c */ -#line 1866 "program_parse.y" +#line 1905 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (2)].result); ;} break; - case 245: + case 247: /* Line 1455 of yacc.c */ -#line 1870 "program_parse.y" +#line 1909 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_PSIZ; @@ -4449,10 +4500,10 @@ yyreduce: ;} break; - case 246: + case 248: /* Line 1455 of yacc.c */ -#line 1879 "program_parse.y" +#line 1918 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_TEX0 + (yyvsp[(3) - (3)].integer); @@ -4463,10 +4514,10 @@ yyreduce: ;} break; - case 247: + case 249: /* Line 1455 of yacc.c */ -#line 1888 "program_parse.y" +#line 1927 "program_parse.y" { if (state->mode == ARB_fragment) { (yyval.result) = FRAG_RESULT_DEPTH; @@ -4477,19 +4528,19 @@ yyreduce: ;} break; - case 248: + case 250: /* Line 1455 of yacc.c */ -#line 1899 "program_parse.y" +#line 1938 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (3)].integer) + (yyvsp[(3) - (3)].integer); ;} break; - case 249: + case 251: /* Line 1455 of yacc.c */ -#line 1905 "program_parse.y" +#line 1944 "program_parse.y" { (yyval.integer) = (state->mode == ARB_vertex) ? VERT_RESULT_COL0 @@ -4497,10 +4548,10 @@ yyreduce: ;} break; - case 250: + case 252: /* Line 1455 of yacc.c */ -#line 1911 "program_parse.y" +#line 1950 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_COL0; @@ -4511,10 +4562,10 @@ yyreduce: ;} break; - case 251: + case 253: /* Line 1455 of yacc.c */ -#line 1920 "program_parse.y" +#line 1959 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_BFC0; @@ -4525,19 +4576,19 @@ yyreduce: ;} break; - case 252: + case 254: /* Line 1455 of yacc.c */ -#line 1931 "program_parse.y" +#line 1970 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 253: + case 255: /* Line 1455 of yacc.c */ -#line 1935 "program_parse.y" +#line 1974 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 0; @@ -4548,10 +4599,10 @@ yyreduce: ;} break; - case 254: + case 256: /* Line 1455 of yacc.c */ -#line 1944 "program_parse.y" +#line 1983 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 1; @@ -4562,94 +4613,94 @@ yyreduce: ;} break; - case 255: + case 257: /* Line 1455 of yacc.c */ -#line 1954 "program_parse.y" +#line 1993 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 256: + case 258: /* Line 1455 of yacc.c */ -#line 1955 "program_parse.y" +#line 1994 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 257: + case 259: /* Line 1455 of yacc.c */ -#line 1956 "program_parse.y" +#line 1995 "program_parse.y" { (yyval.integer) = 1; ;} break; - case 258: + case 260: /* Line 1455 of yacc.c */ -#line 1959 "program_parse.y" +#line 1998 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 259: + case 261: /* Line 1455 of yacc.c */ -#line 1960 "program_parse.y" +#line 1999 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 260: + case 262: /* Line 1455 of yacc.c */ -#line 1961 "program_parse.y" +#line 2000 "program_parse.y" { (yyval.integer) = 1; ;} break; - case 261: + case 263: /* Line 1455 of yacc.c */ -#line 1964 "program_parse.y" +#line 2003 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 262: + case 264: /* Line 1455 of yacc.c */ -#line 1965 "program_parse.y" +#line 2004 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 263: + case 265: /* Line 1455 of yacc.c */ -#line 1968 "program_parse.y" +#line 2007 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 264: + case 266: /* Line 1455 of yacc.c */ -#line 1969 "program_parse.y" +#line 2008 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 265: + case 267: /* Line 1455 of yacc.c */ -#line 1972 "program_parse.y" +#line 2011 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 266: + case 268: /* Line 1455 of yacc.c */ -#line 1973 "program_parse.y" +#line 2012 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 267: + case 269: /* Line 1455 of yacc.c */ -#line 1977 "program_parse.y" +#line 2016 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture coordinate unit selector"); @@ -4660,10 +4711,10 @@ yyreduce: ;} break; - case 268: + case 270: /* Line 1455 of yacc.c */ -#line 1988 "program_parse.y" +#line 2027 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture image unit selector"); @@ -4674,10 +4725,10 @@ yyreduce: ;} break; - case 269: + case 271: /* Line 1455 of yacc.c */ -#line 1999 "program_parse.y" +#line 2038 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture unit selector"); @@ -4688,10 +4739,10 @@ yyreduce: ;} break; - case 270: + case 272: /* Line 1455 of yacc.c */ -#line 2010 "program_parse.y" +#line 2049 "program_parse.y" { struct asm_symbol *exist = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(2) - (4)].string)); @@ -4715,7 +4766,7 @@ yyreduce: /* Line 1455 of yacc.c */ -#line 4719 "program_parse.tab.c" +#line 4770 "program_parse.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -4934,7 +4985,7 @@ yyreturn: /* Line 1675 of yacc.c */ -#line 2030 "program_parse.y" +#line 2069 "program_parse.y" void @@ -5004,7 +5055,10 @@ asm_instruction_copy_ctor(const struct prog_instruction *base, if (inst) { _mesa_init_instructions(& inst->Base, 1); inst->Base.Opcode = base->Opcode; + inst->Base.CondUpdate = base->CondUpdate; + inst->Base.CondDst = base->CondDst; inst->Base.SaturateMode = base->SaturateMode; + inst->Base.Precision = base->Precision; asm_instruction_set_operands(inst, dst, src0, src1, src2); } diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 4e2912d1c4..51cc9f7f11 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -1811,7 +1811,46 @@ optionalSign: '+' { $$ = FALSE; } | { $$ = FALSE; } ; -TEMP_statement: TEMP { $$ = $1; } varNameList +TEMP_statement: optVarSize TEMP { $$ = $2; } varNameList + ; + +optVarSize: IDENTIFIER + { + /* NV_fragment_program_option defines the size qualifiers in a + * fairly broken way. "SHORT" or "LONG" can optionally be used + * before TEMP or OUTPUT. However, neither is a reserved word! + * This means that we have to parse it as an identifier, then check + * to make sure it's one of the valid values. *sigh* + * + * In addition, the grammar in the extension spec does *not* allow + * the size specifier to be optional, but all known implementations + * do. + */ + if (!state->option.NV_fragment) { + yyerror(& @1, state, "unexpected IDENTIFIER"); + YYERROR; + } + + if (strcmp("SHORT", $1) == 0) { + } else if (strcmp("LONG", $1) == 0) { + } else { + char *const err_str = + make_error_string("invalid storage size specifier \"%s\"", + $1); + + yyerror(& @1, state, (err_str != NULL) + ? err_str : "invalid storage size specifier"); + + if (err_str != NULL) { + _mesa_free(err_str); + } + + YYERROR; + } + } + | + { + } ; ADDRESS_statement: ADDRESS { $$ = $1; } varNameList @@ -1831,15 +1870,15 @@ varNameList: varNameList ',' IDENTIFIER } ; -OUTPUT_statement: OUTPUT IDENTIFIER '=' resultBinding +OUTPUT_statement: optVarSize OUTPUT IDENTIFIER '=' resultBinding { struct asm_symbol *const s = - declare_variable(state, $2, at_output, & @2); + declare_variable(state, $3, at_output, & @3); if (s == NULL) { YYERROR; } else { - s->output_binding = $4; + s->output_binding = $5; } } ; @@ -2096,7 +2135,10 @@ asm_instruction_copy_ctor(const struct prog_instruction *base, if (inst) { _mesa_init_instructions(& inst->Base, 1); inst->Base.Opcode = base->Opcode; + inst->Base.CondUpdate = base->CondUpdate; + inst->Base.CondDst = base->CondDst; inst->Base.SaturateMode = base->SaturateMode; + inst->Base.Precision = base->Precision; asm_instruction_set_operands(inst, dst, src0, src1, src2); } diff --git a/src/mesa/shader/program_parse_extra.c b/src/mesa/shader/program_parse_extra.c index 79e80c54d7..cb7b7a5fb2 100644 --- a/src/mesa/shader/program_parse_extra.c +++ b/src/mesa/shader/program_parse_extra.c @@ -33,6 +33,67 @@ * \author Ian Romanick */ +int +_mesa_parse_instruction_suffix(const struct asm_parser_state *state, + const char *suffix, + struct prog_instruction *inst) +{ + inst->CondUpdate = 0; + inst->CondDst = 0; + inst->SaturateMode = SATURATE_OFF; + inst->Precision = FLOAT32; + + + /* The first possible suffix element is the precision specifier from + * NV_fragment_program_option. + */ + if (state->option.NV_fragment) { + switch (suffix[0]) { + case 'H': + inst->Precision = FLOAT16; + suffix++; + break; + case 'R': + inst->Precision = FLOAT32; + suffix++; + break; + case 'X': + inst->Precision = FIXED12; + suffix++; + break; + default: + break; + } + } + + /* The next possible suffix element is the condition code modifier selection + * from NV_fragment_program_option. + */ + if (state->option.NV_fragment) { + if (suffix[0] == 'C') { + inst->CondUpdate = 1; + suffix++; + } + } + + + /* The final possible suffix element is the saturation selector from + * ARB_fragment_program. + */ + if (state->mode == ARB_fragment) { + if (strcmp(suffix, "_SAT") == 0) { + inst->SaturateMode = SATURATE_ZERO_ONE; + suffix += 4; + } + } + + + /* It is an error for all of the suffix string not to be consumed. + */ + return suffix[0] == '\0'; +} + + int _mesa_ARBvp_parse_option(struct asm_parser_state *state, const char *option) { diff --git a/src/mesa/shader/program_parser.h b/src/mesa/shader/program_parser.h index be32a1bed1..497891f53d 100644 --- a/src/mesa/shader/program_parser.h +++ b/src/mesa/shader/program_parser.h @@ -264,4 +264,18 @@ extern int _mesa_ARBvp_parse_option(struct asm_parser_state *state, extern int _mesa_ARBfp_parse_option(struct asm_parser_state *state, const char *option); +/** + * Parses and processes instruction suffixes + * + * Instruction suffixes, such as \c _SAT, are processed. The relevant bits + * are set in \c inst. If suffixes are encountered that are either not known + * or not supported by the modes and options set in \c state, zero will be + * returned. + * + * \return + * Non-zero on success, zero on failure. + */ +extern int _mesa_parse_instruction_suffix(const struct asm_parser_state *state, + const char *suffix, struct prog_instruction *inst); + /*@}*/ -- cgit v1.2.3 From e95e76e1255a3ad0ce604271301d090337b2e82b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= Date: Sun, 6 Sep 2009 11:47:40 +0200 Subject: r300/compiler: New dataflow structures and passes This replaces the old NQSSADCE code with the same functionality, but quite different design. Instead of doing a single integerated pass, we now build explicit data structures representing the dataflow. This will enable analysis of flow control instruction, and could potentially open an avenue for several dataflow based optimizations, such as peephole optimization, fusing MUL+ADD to MAD, and so on. --- src/mesa/drivers/dri/r300/compiler/Makefile | 8 +- .../dri/r300/compiler/r300_fragprog_swizzle.c | 35 +- .../dri/r300/compiler/r300_fragprog_swizzle.h | 7 +- src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c | 38 +-- src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c | 50 +-- src/mesa/drivers/dri/r300/compiler/r500_fragprog.c | 24 +- src/mesa/drivers/dri/r300/compiler/r500_fragprog.h | 6 +- .../drivers/dri/r300/compiler/radeon_compiler.c | 35 ++ .../drivers/dri/r300/compiler/radeon_compiler.h | 26 ++ .../drivers/dri/r300/compiler/radeon_dataflow.c | 106 ++++++ .../drivers/dri/r300/compiler/radeon_dataflow.h | 113 +++++++ .../dri/r300/compiler/radeon_dataflow_annotate.c | 365 +++++++++++++++++++++ .../dri/r300/compiler/radeon_dataflow_dealias.c | 150 +++++++++ .../dri/r300/compiler/radeon_dataflow_swizzles.c | 126 +++++++ .../drivers/dri/r300/compiler/radeon_nqssadce.c | 267 --------------- .../drivers/dri/r300/compiler/radeon_nqssadce.h | 92 ------ .../drivers/dri/r300/compiler/radeon_opcodes.c | 87 +++-- .../drivers/dri/r300/compiler/radeon_opcodes.h | 8 + .../drivers/dri/r300/compiler/radeon_program.c | 150 +-------- .../drivers/dri/r300/compiler/radeon_program.h | 110 +------ .../dri/r300/compiler/radeon_program_constants.h | 128 ++++++++ .../dri/r300/compiler/radeon_program_print.c | 214 ++++++++++++ .../drivers/dri/r300/compiler/radeon_swizzle.h | 57 ++++ src/mesa/drivers/dri/r300/r300_vertprog.c | 1 - 24 files changed, 1486 insertions(+), 717 deletions(-) create mode 100644 src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c create mode 100644 src/mesa/drivers/dri/r300/compiler/radeon_dataflow.h create mode 100644 src/mesa/drivers/dri/r300/compiler/radeon_dataflow_annotate.c create mode 100644 src/mesa/drivers/dri/r300/compiler/radeon_dataflow_dealias.c create mode 100644 src/mesa/drivers/dri/r300/compiler/radeon_dataflow_swizzles.c delete mode 100644 src/mesa/drivers/dri/r300/compiler/radeon_nqssadce.c delete mode 100644 src/mesa/drivers/dri/r300/compiler/radeon_nqssadce.h create mode 100644 src/mesa/drivers/dri/r300/compiler/radeon_program_constants.h create mode 100644 src/mesa/drivers/dri/r300/compiler/radeon_program_print.c create mode 100644 src/mesa/drivers/dri/r300/compiler/radeon_swizzle.h (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/Makefile b/src/mesa/drivers/dri/r300/compiler/Makefile index 080c79898b..53fb7caa95 100644 --- a/src/mesa/drivers/dri/r300/compiler/Makefile +++ b/src/mesa/drivers/dri/r300/compiler/Makefile @@ -8,11 +8,15 @@ LIBNAME = r300compiler C_SOURCES = \ radeon_code.c \ radeon_compiler.c \ - radeon_nqssadce.c \ radeon_program.c \ - radeon_opcodes.c \ + radeon_program_print.c \ + radeon_opcodes.c \ radeon_program_alu.c \ radeon_program_pair.c \ + radeon_dataflow.c \ + radeon_dataflow_annotate.c \ + radeon_dataflow_dealias.c \ + radeon_dataflow_swizzles.c \ r3xx_fragprog.c \ r300_fragprog.c \ r300_fragprog_swizzle.c \ diff --git a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_swizzle.c b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_swizzle.c index ded6966d08..cfa48a59e3 100644 --- a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_swizzle.c +++ b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_swizzle.c @@ -36,7 +36,6 @@ #include #include "../r300_reg.h" -#include "radeon_nqssadce.h" #include "radeon_compiler.h" #define MAKE_SWZ3(x, y, z) (RC_MAKE_SWIZZLE(RC_SWIZZLE_##x, RC_SWIZZLE_##y, RC_SWIZZLE_##z, RC_SWIZZLE_ZERO)) @@ -92,7 +91,7 @@ static const struct swizzle_data* lookup_native_swizzle(unsigned int swizzle) * Check whether the given instruction supports the swizzle and negate * combinations in the given source register. */ -int r300FPIsNativeSwizzle(rc_opcode opcode, struct rc_src_register reg) +static int r300_swizzle_is_native(rc_opcode opcode, struct rc_src_register reg) { if (reg.Abs) reg.Negate = RC_MASK_NONE; @@ -134,15 +133,16 @@ int r300FPIsNativeSwizzle(rc_opcode opcode, struct rc_src_register reg) } -/** - * Generate MOV dst, src using only native swizzles. - */ -void r300FPBuildSwizzle(struct nqssadce_state *s, struct rc_dst_register dst, struct rc_src_register src) +static void r300_swizzle_split( + struct rc_src_register src, unsigned int mask, + struct rc_swizzle_split * split) { if (src.Abs) src.Negate = RC_MASK_NONE; - while(dst.WriteMask) { + split->NumPhases = 0; + + while(mask) { const struct swizzle_data *best_swizzle = 0; unsigned int best_matchcount = 0; unsigned int best_matchmask = 0; @@ -153,7 +153,7 @@ void r300FPBuildSwizzle(struct nqssadce_state *s, struct rc_dst_register dst, st unsigned int matchcount = 0; unsigned int matchmask = 0; for(comp = 0; comp < 3; ++comp) { - if (!GET_BIT(dst.WriteMask, comp)) + if (!GET_BIT(mask, comp)) continue; unsigned int swz = GET_SWZ(src.Swizzle, comp); if (swz == RC_SWIZZLE_UNUSED) @@ -172,23 +172,24 @@ void r300FPBuildSwizzle(struct nqssadce_state *s, struct rc_dst_register dst, st best_swizzle = sd; best_matchcount = matchcount; best_matchmask = matchmask; - if (matchmask == (dst.WriteMask & RC_MASK_XYZ)) + if (matchmask == (mask & RC_MASK_XYZ)) break; } } - struct rc_instruction *inst = rc_insert_new_instruction(s->Compiler, s->IP->Prev); - inst->I.Opcode = RC_OPCODE_MOV; - inst->I.DstReg = dst; - inst->I.DstReg.WriteMask &= (best_matchmask | RC_MASK_W); - inst->I.SrcReg[0] = src; - inst->I.SrcReg[0].Negate = (best_matchmask & src.Negate) ? RC_MASK_XYZW : RC_MASK_NONE; - /* Note: We rely on NqSSA/DCE to set unused swizzle components to NIL */ + if (mask & RC_MASK_W) + best_matchmask |= RC_MASK_W; - dst.WriteMask &= ~inst->I.DstReg.WriteMask; + split->Phase[split->NumPhases++] = best_matchmask; + mask &= ~best_matchmask; } } +struct rc_swizzle_caps r300_swizzle_caps = { + .IsNative = r300_swizzle_is_native, + .Split = r300_swizzle_split +}; + /** * Translate an RGB (XYZ) swizzle into the hardware code for the given diff --git a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_swizzle.h b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_swizzle.h index 728c2cd972..118476af13 100644 --- a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_swizzle.h +++ b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_swizzle.h @@ -28,12 +28,9 @@ #ifndef __R300_FRAGPROG_SWIZZLE_H_ #define __R300_FRAGPROG_SWIZZLE_H_ -#include "radeon_program.h" +#include "radeon_swizzle.h" -struct nqssadce_state; - -int r300FPIsNativeSwizzle(rc_opcode opcode, struct rc_src_register reg); -void r300FPBuildSwizzle(struct nqssadce_state*, struct rc_dst_register dst, struct rc_src_register src); +extern struct rc_swizzle_caps r300_swizzle_caps; unsigned int r300FPTranslateRGBSwizzle(unsigned int src, unsigned int swizzle); unsigned int r300FPTranslateAlphaSwizzle(unsigned int src, unsigned int swizzle); diff --git a/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c b/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c index 0aa40c0587..bf9bea685a 100644 --- a/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c @@ -24,18 +24,18 @@ #include -#include "radeon_nqssadce.h" #include "radeon_program_alu.h" #include "r300_fragprog.h" #include "r300_fragprog_swizzle.h" #include "r500_fragprog.h" -static void nqssadce_init(struct nqssadce_state* s) +static void dataflow_outputs_mark_use(void * userdata, void * data, + void (*callback)(void *, unsigned int, unsigned int)) { - struct r300_fragment_program_compiler * c = s->UserData; - s->Outputs[c->OutputColor].Sourced = RC_MASK_XYZW; - s->Outputs[c->OutputDepth].Sourced = RC_MASK_W; + struct r300_fragment_program_compiler * c = userdata; + callback(data, c->OutputColor, RC_MASK_XYZW); + callback(data, c->OutputDepth, RC_MASK_W); } static void rewrite_depth_out(struct r300_fragment_program_compiler * c) @@ -92,6 +92,8 @@ void r3xx_compile_fragment_program(struct r300_fragment_program_compiler* c) { &radeonTransformTrigScale, 0 } }; radeonLocalTransform(&c->Base, 4, transformations); + + c->Base.SwizzleCaps = &r500_swizzle_caps; } else { struct radeon_program_transformation transformations[] = { { &r300_transform_TEX, c }, @@ -99,33 +101,23 @@ void r3xx_compile_fragment_program(struct r300_fragment_program_compiler* c) { &radeonTransformTrigSimple, 0 } }; radeonLocalTransform(&c->Base, 3, transformations); + + c->Base.SwizzleCaps = &r300_swizzle_caps; } if (c->Base.Debug) { fprintf(stderr, "Fragment Program: After native rewrite:\n"); - rc_print_program(&c->Base.Program); + rc_print_program(&c->Base.Program, 0); fflush(stderr); } - if (c->is_r500) { - struct radeon_nqssadce_descr nqssadce = { - .Init = &nqssadce_init, - .IsNativeSwizzle = &r500FPIsNativeSwizzle, - .BuildSwizzle = &r500FPBuildSwizzle - }; - radeonNqssaDce(&c->Base, &nqssadce, c); - } else { - struct radeon_nqssadce_descr nqssadce = { - .Init = &nqssadce_init, - .IsNativeSwizzle = &r300FPIsNativeSwizzle, - .BuildSwizzle = &r300FPBuildSwizzle - }; - radeonNqssaDce(&c->Base, &nqssadce, c); - } + rc_dataflow_annotate(&c->Base, &dataflow_outputs_mark_use, c); + rc_dataflow_dealias(&c->Base); + rc_dataflow_swizzles(&c->Base); if (c->Base.Debug) { - fprintf(stderr, "Compiler: after NqSSA-DCE:\n"); - rc_print_program(&c->Base.Program); + fprintf(stderr, "Compiler: after dataflow passes:\n"); + rc_print_program(&c->Base.Program, 0); fflush(stderr); } diff --git a/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c b/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c index 0efd2c91e6..c64648ff3b 100644 --- a/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c @@ -26,9 +26,9 @@ #include "../r300_reg.h" -#include "radeon_nqssadce.h" -#include "radeon_program.h" +#include "radeon_dataflow.h" #include "radeon_program_alu.h" +#include "radeon_swizzle.h" /* @@ -545,18 +545,19 @@ static void addArtificialOutputs(struct r300_vertex_program_compiler * compiler) } } -static void nqssadceInit(struct nqssadce_state* s) +static void dataflow_outputs_mark_used(void * userdata, void * data, + void (*callback)(void *, unsigned int, unsigned int)) { - struct r300_vertex_program_compiler * compiler = s->UserData; + struct r300_vertex_program_compiler * c = userdata; int i; for(i = 0; i < 32; ++i) { - if (compiler->RequiredOutputs & (1 << i)) - s->Outputs[i].Sourced = RC_MASK_XYZW; + if (c->RequiredOutputs & (1 << i)) + callback(data, i, RC_MASK_XYZW); } } -static int swizzleIsNative(rc_opcode opcode, struct rc_src_register reg) +static int swizzle_is_native(rc_opcode opcode, struct rc_src_register reg) { (void) opcode; (void) reg; @@ -565,9 +566,16 @@ static int swizzleIsNative(rc_opcode opcode, struct rc_src_register reg) } +static struct rc_swizzle_caps r300_vertprog_swizzle_caps = { + .IsNative = &swizzle_is_native, + .Split = 0 /* should never be called */ +}; + void r3xx_compile_vertex_program(struct r300_vertex_program_compiler* compiler) { + compiler->Base.SwizzleCaps = &r300_vertprog_swizzle_caps; + addArtificialOutputs(compiler); { @@ -579,7 +587,7 @@ void r3xx_compile_vertex_program(struct r300_vertex_program_compiler* compiler) if (compiler->Base.Debug) { fprintf(stderr, "Vertex program after native rewrite:\n"); - rc_print_program(&compiler->Base.Program); + rc_print_program(&compiler->Base.Program, 0); fflush(stderr); } @@ -596,26 +604,22 @@ void r3xx_compile_vertex_program(struct r300_vertex_program_compiler* compiler) if (compiler->Base.Debug) { fprintf(stderr, "Vertex program after source conflict resolve:\n"); - rc_print_program(&compiler->Base.Program); + rc_print_program(&compiler->Base.Program, 0); fflush(stderr); } - { - struct radeon_nqssadce_descr nqssadce = { - .Init = &nqssadceInit, - .IsNativeSwizzle = &swizzleIsNative, - .BuildSwizzle = NULL - }; - radeonNqssaDce(&compiler->Base, &nqssadce, compiler); + rc_dataflow_annotate(&compiler->Base, &dataflow_outputs_mark_used, compiler); + rc_dataflow_dealias(&compiler->Base); + rc_dataflow_swizzles(&compiler->Base); - /* We need this step for reusing temporary registers */ - allocate_temporary_registers(compiler); + /* This invalidates dataflow annotations and should be replaced + * by a future generic register allocation pass. */ + allocate_temporary_registers(compiler); - if (compiler->Base.Debug) { - fprintf(stderr, "Vertex program after NQSSADCE:\n"); - rc_print_program(&compiler->Base.Program); - fflush(stderr); - } + if (compiler->Base.Debug) { + fprintf(stderr, "Vertex program after dataflow:\n"); + rc_print_program(&compiler->Base.Program, 0); + fflush(stderr); } translate_vertex_program(compiler); diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c b/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c index 3e994ebd1b..971465e359 100644 --- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c @@ -169,7 +169,7 @@ int r500_transform_TEX( return 1; } -int r500FPIsNativeSwizzle(rc_opcode opcode, struct rc_src_register reg) +static int r500_swizzle_is_native(rc_opcode opcode, struct rc_src_register reg) { unsigned int relevant; int i; @@ -227,36 +227,38 @@ int r500FPIsNativeSwizzle(rc_opcode opcode, struct rc_src_register reg) } /** - * Implement a MOV with a potentially non-native swizzle. + * Split source register access. * * The only thing we *cannot* do in an ALU instruction is per-component - * negation. Therefore, we split the MOV into two instructions when necessary. + * negation. */ -void r500FPBuildSwizzle(struct nqssadce_state *s, struct rc_dst_register dst, struct rc_src_register src) +static void r500_swizzle_split(struct rc_src_register src, unsigned int usemask, + struct rc_swizzle_split * split) { unsigned int negatebase[2] = { 0, 0 }; int i; for(i = 0; i < 4; ++i) { unsigned int swz = GET_SWZ(src.Swizzle, i); - if (swz == RC_SWIZZLE_UNUSED) + if (swz == RC_SWIZZLE_UNUSED || !GET_BIT(usemask, i)) continue; negatebase[GET_BIT(src.Negate, i)] |= 1 << i; } + split->NumPhases = 0; + for(i = 0; i <= 1; ++i) { if (!negatebase[i]) continue; - struct rc_instruction *inst = rc_insert_new_instruction(s->Compiler, s->IP->Prev); - inst->I.Opcode = RC_OPCODE_MOV; - inst->I.DstReg = dst; - inst->I.DstReg.WriteMask = negatebase[i]; - inst->I.SrcReg[0] = src; - inst->I.SrcReg[0].Negate = (i == 0) ? RC_MASK_NONE : RC_MASK_XYZW; + split->Phase[split->NumPhases++] = negatebase[i]; } } +struct rc_swizzle_caps r500_swizzle_caps = { + .IsNative = r500_swizzle_is_native, + .Split = r500_swizzle_split +}; static char *toswiz(int swiz_val) { switch(swiz_val) { diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog.h b/src/mesa/drivers/dri/r300/compiler/r500_fragprog.h index 887d4abbd2..92ac75d5fd 100644 --- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog.h +++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog.h @@ -34,15 +34,13 @@ #define __R500_FRAGPROG_H_ #include "radeon_compiler.h" -#include "radeon_nqssadce.h" +#include "radeon_swizzle.h" extern void r500BuildFragmentProgramHwCode(struct r300_fragment_program_compiler *compiler); extern void r500FragmentProgramDump(struct rX00_fragment_program_code *c); -extern int r500FPIsNativeSwizzle(rc_opcode opcode, struct rc_src_register reg); - -extern void r500FPBuildSwizzle(struct nqssadce_state *s, struct rc_dst_register dst, struct rc_src_register src); +extern struct rc_swizzle_caps r500_swizzle_caps; extern int r500_transform_TEX( struct radeon_compiler * c, diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.c b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.c index babdcffd3a..d0b78ec1c8 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.c @@ -93,6 +93,41 @@ void rc_error(struct radeon_compiler * c, const char * fmt, ...) } } +int rc_if_fail_helper(struct radeon_compiler * c, const char * file, int line, const char * assertion) +{ + rc_error(c, "ICE at %s:%i: assertion failed: %s\n", file, line, assertion); + return 1; +} + +/** + * Recompute c->Program.InputsRead and c->Program.OutputsWritten + * based on which inputs and outputs are actually referenced + * in program instructions. + */ +void rc_calculate_inputs_outputs(struct radeon_compiler * c) +{ + struct rc_instruction *inst; + + c->Program.InputsRead = 0; + c->Program.OutputsWritten = 0; + + for(inst = c->Program.Instructions.Next; inst != &c->Program.Instructions; inst = inst->Next) + { + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); + int i; + + for (i = 0; i < opcode->NumSrcRegs; ++i) { + if (inst->I.SrcReg[i].File == RC_FILE_INPUT) + c->Program.InputsRead |= 1 << inst->I.SrcReg[i].Index; + } + + if (opcode->HasDstReg) { + if (inst->I.DstReg.File == RC_FILE_OUTPUT) + c->Program.OutputsWritten |= 1 << inst->I.DstReg.Index; + } + } +} + /** * Rewrite the program such that everything that source the given input * register will source new_input instead. diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h index 018f9bba06..87a732cd90 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.h @@ -27,6 +27,7 @@ #include "radeon_code.h" #include "radeon_program.h" +struct rc_swizzle_caps; struct radeon_compiler { struct memory_pool Pool; @@ -34,6 +35,14 @@ struct radeon_compiler { unsigned Debug:1; unsigned Error:1; char * ErrorMsg; + + /** + * Variables used internally, not be touched by callers + * of the compiler + */ + /*@{*/ + struct rc_swizzle_caps * SwizzleCaps; + /*@}*/ }; void rc_init(struct radeon_compiler * c); @@ -42,6 +51,23 @@ void rc_destroy(struct radeon_compiler * c); void rc_debug(struct radeon_compiler * c, const char * fmt, ...); void rc_error(struct radeon_compiler * c, const char * fmt, ...); +int rc_if_fail_helper(struct radeon_compiler * c, const char * file, int line, const char * assertion); + +/** + * This macro acts like an if-statement that can be used to implement + * non-aborting assertions in the compiler. + * + * It checks whether \p cond is true. If not, an internal compiler error is + * flagged and the if-clause is run. + * + * A typical use-case would be: + * + * if (rc_assert(c, condition-that-must-be-true)) + * return; + */ +#define rc_assert(c, cond) \ + (!(cond) && rc_if_fail_helper(c, __FILE__, __LINE__, #cond)) + void rc_calculate_inputs_outputs(struct radeon_compiler * c); void rc_move_input(struct radeon_compiler * c, unsigned input, struct rc_src_register new_input); diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c new file mode 100644 index 0000000000..af6777a7bd --- /dev/null +++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c @@ -0,0 +1,106 @@ +/* + * Copyright (C) 2009 Nicolai Haehnle. + * + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 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. + * + */ + +#include "radeon_dataflow.h" + +#include "radeon_compiler.h" + + +static void add_ref_to_vector(struct rc_dataflow_ref * ref, struct rc_dataflow_vector * vector) +{ + ref->Vector = vector; + ref->Prev = &vector->Refs; + ref->Next = vector->Refs.Next; + ref->Prev->Next = ref; + ref->Next->Prev = ref; +} + +struct rc_dataflow_ref * rc_dataflow_create_ref(struct radeon_compiler * c, + struct rc_dataflow_vector * vector, struct rc_instruction * inst) +{ + struct rc_dataflow_ref * ref = memory_pool_malloc(&c->Pool, sizeof(struct rc_dataflow_ref)); + ref->ReadInstruction = inst; + ref->UseMask = 0; + + add_ref_to_vector(ref, vector); + + return ref; +} + +struct rc_dataflow_vector * rc_dataflow_create_vector(struct radeon_compiler * c, + rc_register_file file, unsigned int index, struct rc_instruction * inst) +{ + struct rc_dataflow_vector * vec = memory_pool_malloc(&c->Pool, sizeof(struct rc_dataflow_vector)); + + memset(vec, 0, sizeof(struct rc_dataflow_vector)); + vec->File = file; + vec->Index = index; + vec->WriteInstruction = inst; + + vec->Refs.Next = vec->Refs.Prev = &vec->Refs; + + return vec; +} + +void rc_dataflow_remove_ref(struct rc_dataflow_ref * ref) +{ + ref->Prev->Next = ref->Next; + ref->Next->Prev = ref->Prev; +} + +void rc_dataflow_remove_instruction(struct rc_instruction * inst) +{ + for(unsigned int i = 0; i < 3; ++i) { + if (inst->Dataflow.SrcReg[i]) { + rc_dataflow_remove_ref(inst->Dataflow.SrcReg[i]); + inst->Dataflow.SrcReg[i] = 0; + } + if (inst->Dataflow.SrcRegAddress[i]) { + rc_dataflow_remove_ref(inst->Dataflow.SrcRegAddress[i]); + inst->Dataflow.SrcRegAddress[i] = 0; + } + } + + if (inst->Dataflow.DstReg) { + while(inst->Dataflow.DstReg->Refs.Next != &inst->Dataflow.DstReg->Refs) { + struct rc_dataflow_ref * ref = inst->Dataflow.DstReg->Refs.Next; + rc_dataflow_remove_ref(ref); + if (inst->Dataflow.DstRegPrev) + add_ref_to_vector(ref, inst->Dataflow.DstRegPrev->Vector); + } + + inst->Dataflow.DstReg->WriteInstruction = 0; + inst->Dataflow.DstReg = 0; + } + + if (inst->Dataflow.DstRegPrev) { + rc_dataflow_remove_ref(inst->Dataflow.DstRegPrev); + inst->Dataflow.DstRegPrev = 0; + } + + inst->Dataflow.DstRegAliased = 0; +} diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.h b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.h new file mode 100644 index 0000000000..c9856affe8 --- /dev/null +++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.h @@ -0,0 +1,113 @@ +/* + * Copyright (C) 2009 Nicolai Haehnle. + * + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 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. + * + */ + +#ifndef RADEON_DATAFLOW_H +#define RADEON_DATAFLOW_H + +#include "radeon_program_constants.h" + +struct radeon_compiler; +struct rc_instruction; +struct rc_swizzle_caps; + +struct rc_dataflow_vector; + +struct rc_dataflow_ref { + struct rc_dataflow_vector * Vector; + + /** + * Linked list of references to the above-mentioned vector. + * The linked list is \em not sorted. + */ + /*@{*/ + struct rc_dataflow_ref * Prev; + struct rc_dataflow_ref * Next; + /*@}*/ + + unsigned int UseMask:4; + struct rc_instruction * ReadInstruction; +}; + +struct rc_dataflow_vector { + rc_register_file File:3; + unsigned int Index:RC_REGISTER_INDEX_BITS; + + /** For private use in compiler passes. MUST BE RESET TO 0 by the end of each pass. + * The annotate pass uses this bit to track whether a vector is in the + * update stack. + */ + unsigned int PassBit:1; + /** Which of the components have been written with useful values */ + unsigned int ValidMask:4; + /** Which of the components are used downstream */ + unsigned int UseMask:4; + /** The instruction that produced this vector */ + struct rc_instruction * WriteInstruction; + + /** Linked list of references to this vector */ + struct rc_dataflow_ref Refs; +}; + +struct rc_instruction_dataflow { + struct rc_dataflow_ref * SrcReg[3]; + struct rc_dataflow_ref * SrcRegAddress[3]; + + /** Reference the components of the destination register + * that are carried over without being overwritten */ + struct rc_dataflow_ref * DstRegPrev; + /** Indicates whether the destination register was in use + * before this instruction */ + unsigned int DstRegAliased:1; + struct rc_dataflow_vector * DstReg; +}; + +/** + * General functions for manipulating the dataflow structures. + */ +/*@{*/ +struct rc_dataflow_ref * rc_dataflow_create_ref(struct radeon_compiler * c, + struct rc_dataflow_vector * vector, struct rc_instruction * inst); +struct rc_dataflow_vector * rc_dataflow_create_vector(struct radeon_compiler * c, + rc_register_file file, unsigned int index, struct rc_instruction * inst); +void rc_dataflow_remove_ref(struct rc_dataflow_ref * ref); + +void rc_dataflow_remove_instruction(struct rc_instruction * inst); +/*@}*/ + + +/** + * Compiler passes based on dataflow structures. + */ +/*@{*/ +typedef void (*rc_dataflow_mark_outputs_fn)(void * userdata, void * data, + void (*mark_fn)(void * data, unsigned int index, unsigned int mask)); +void rc_dataflow_annotate(struct radeon_compiler * c, rc_dataflow_mark_outputs_fn dce, void * userdata); +void rc_dataflow_dealias(struct radeon_compiler * c); +void rc_dataflow_swizzles(struct radeon_compiler * c); +/*@}*/ + +#endif /* RADEON_DATAFLOW_H */ diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_annotate.c b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_annotate.c new file mode 100644 index 0000000000..41d175a22f --- /dev/null +++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_annotate.c @@ -0,0 +1,365 @@ +/* + * Copyright (C) 2009 Nicolai Haehnle. + * + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 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. + * + */ + +#include "radeon_dataflow.h" + +#include "radeon_compiler.h" + + +struct dataflow_state { + struct radeon_compiler * C; + unsigned int DCE:1; + unsigned int UpdateRunning:1; + + struct rc_dataflow_vector * Input[RC_REGISTER_MAX_INDEX]; + struct rc_dataflow_vector * Output[RC_REGISTER_MAX_INDEX]; + struct rc_dataflow_vector * Temporary[RC_REGISTER_MAX_INDEX]; + struct rc_dataflow_vector * Address; + + struct rc_dataflow_vector ** UpdateStack; + unsigned int UpdateStackSize; + unsigned int UpdateStackReserved; +}; + +static void mark_vector_use(struct dataflow_state * s, struct rc_dataflow_vector * vector, unsigned int mask); + +static struct rc_dataflow_vector * get_register_contents(struct dataflow_state * s, + rc_register_file file, unsigned int index) +{ + if (file == RC_FILE_INPUT || file == RC_FILE_OUTPUT || file == RC_FILE_TEMPORARY) { + if (index >= RC_REGISTER_MAX_INDEX) + return 0; /* cannot happen, but be defensive */ + + if (file == RC_FILE_TEMPORARY) + return s->Temporary[index]; + if (file == RC_FILE_INPUT) + return s->Input[index]; + if (file == RC_FILE_OUTPUT) + return s->Output[index]; + } + + if (file == RC_FILE_ADDRESS) + return s->Address; + + return 0; /* can happen, constant register file */ +} + +static void mark_ref_use(struct dataflow_state * s, struct rc_dataflow_ref * ref, unsigned int mask) +{ + if (!(mask & ~ref->UseMask)) + return; + + ref->UseMask |= mask; + mark_vector_use(s, ref->Vector, ref->UseMask); +} + +static void mark_source_use(struct dataflow_state * s, struct rc_instruction * inst, + unsigned int src, unsigned int srcmask) +{ + unsigned int refmask = 0; + + for(unsigned int i = 0; i < 4; ++i) { + if (GET_BIT(srcmask, i)) + refmask |= 1 << GET_SWZ(inst->I.SrcReg[src].Swizzle, i); + } + + /* get rid of spurious bits from ZERO, ONE, etc. swizzles */ + refmask &= RC_MASK_XYZW; + + if (!refmask) + return; /* can happen if the swizzle contains constant components */ + + if (inst->Dataflow.SrcReg[src]) + mark_ref_use(s, inst->Dataflow.SrcReg[src], refmask); + + if (inst->Dataflow.SrcRegAddress[src]) + mark_ref_use(s, inst->Dataflow.SrcRegAddress[src], RC_MASK_X); +} + +static void compute_sources_for_writemask( + struct rc_instruction * inst, + unsigned int writemask, + unsigned int *srcmasks) +{ + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); + + srcmasks[0] = 0; + srcmasks[1] = 0; + srcmasks[2] = 0; + + if (inst->I.Opcode == RC_OPCODE_KIL) + srcmasks[0] |= RC_MASK_XYZW; + + if (!writemask) + return; + + if (opcode->IsComponentwise) { + for(unsigned int src = 0; src < opcode->NumSrcRegs; ++src) + srcmasks[src] |= writemask; + } else if (opcode->IsStandardScalar) { + for(unsigned int src = 0; src < opcode->NumSrcRegs; ++src) + srcmasks[src] |= RC_MASK_X; + } else { + switch(inst->I.Opcode) { + case RC_OPCODE_ARL: + srcmasks[0] |= RC_MASK_X; + break; + case RC_OPCODE_DP3: + srcmasks[0] |= RC_MASK_XYZ; + srcmasks[1] |= RC_MASK_XYZ; + break; + case RC_OPCODE_DP4: + srcmasks[0] |= RC_MASK_XYZW; + srcmasks[1] |= RC_MASK_XYZW; + break; + case RC_OPCODE_TEX: + case RC_OPCODE_TXB: + case RC_OPCODE_TXP: + srcmasks[0] |= RC_MASK_XYZW; + break; + case RC_OPCODE_DST: + srcmasks[0] |= 0x6; + srcmasks[1] |= 0xa; + break; + case RC_OPCODE_EXP: + case RC_OPCODE_LOG: + srcmasks[0] |= RC_MASK_XY; + break; + case RC_OPCODE_LIT: + srcmasks[0] |= 0xb; + break; + default: + break; + } + } +} + +static void mark_instruction_source_use(struct dataflow_state * s, + struct rc_instruction * inst, unsigned int writemask) +{ + unsigned int srcmasks[3]; + + compute_sources_for_writemask(inst, writemask, srcmasks); + + for(unsigned int src = 0; src < 3; ++src) + mark_source_use(s, inst, src, srcmasks[src]); +} + +static void run_update(struct dataflow_state * s) +{ + s->UpdateRunning = 1; + + while(s->UpdateStackSize) { + struct rc_dataflow_vector * vector = s->UpdateStack[--s->UpdateStackSize]; + vector->PassBit = 0; + + if (vector->WriteInstruction) { + struct rc_instruction * inst = vector->WriteInstruction; + + if (inst->Dataflow.DstRegPrev) { + unsigned int carryover = vector->UseMask & ~inst->I.DstReg.WriteMask; + + if (carryover) + mark_ref_use(s, inst->Dataflow.DstRegPrev, carryover); + } + + mark_instruction_source_use( + s, vector->WriteInstruction, + vector->UseMask & inst->I.DstReg.WriteMask); + } + } + + s->UpdateRunning = 0; +} + +static void mark_vector_use(struct dataflow_state * s, struct rc_dataflow_vector * vector, unsigned int mask) +{ + if (!(mask & ~vector->UseMask)) + return; /* no new used bits */ + + vector->UseMask |= mask; + if (vector->PassBit) + return; + + if (s->UpdateStackSize >= s->UpdateStackReserved) { + unsigned int new_reserve = 2 * s->UpdateStackReserved; + struct rc_dataflow_vector ** new_stack; + + if (!new_reserve) + new_reserve = 16; + + new_stack = memory_pool_malloc(&s->C->Pool, new_reserve * sizeof(struct rc_dataflow_vector *)); + memcpy(new_stack, s->UpdateStack, s->UpdateStackSize * sizeof(struct rc_dataflow_vector *)); + + s->UpdateStack = new_stack; + s->UpdateStackReserved = new_reserve; + } + + s->UpdateStack[s->UpdateStackSize++] = vector; + vector->PassBit = 1; + + if (!s->UpdateRunning) + run_update(s); +} + +static void annotate_instruction(struct dataflow_state * s, struct rc_instruction * inst) +{ + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); + unsigned int src; + + for(src = 0; src < opcode->NumSrcRegs; ++src) { + struct rc_dataflow_vector * vector = get_register_contents(s, inst->I.SrcReg[src].File, inst->I.SrcReg[src].Index); + if (vector) { + inst->Dataflow.SrcReg[src] = rc_dataflow_create_ref(s->C, vector, inst); + } + if (inst->I.SrcReg[src].RelAddr) { + struct rc_dataflow_vector * addr = get_register_contents(s, RC_FILE_ADDRESS, 0); + if (addr) + inst->Dataflow.SrcRegAddress[src] = rc_dataflow_create_ref(s->C, addr, inst); + } + } + + mark_instruction_source_use(s, inst, 0); /* for KIL */ + + if (opcode->HasDstReg) { + struct rc_dataflow_vector * oldvec = get_register_contents(s, inst->I.DstReg.File, inst->I.DstReg.Index); + struct rc_dataflow_vector * newvec = rc_dataflow_create_vector(s->C, inst->I.DstReg.File, inst->I.DstReg.Index, inst); + + newvec->ValidMask = inst->I.DstReg.WriteMask; + + if (oldvec) { + unsigned int carryover = oldvec->ValidMask & ~inst->I.DstReg.WriteMask; + + if (oldvec->ValidMask) + inst->Dataflow.DstRegAliased = 1; + + if (carryover) { + inst->Dataflow.DstRegPrev = rc_dataflow_create_ref(s->C, oldvec, inst); + newvec->ValidMask |= carryover; + + if (!s->DCE) + mark_ref_use(s, inst->Dataflow.DstRegPrev, carryover); + } + } + + inst->Dataflow.DstReg = newvec; + + if (newvec->File == RC_FILE_TEMPORARY) + s->Temporary[newvec->Index] = newvec; + else if (newvec->File == RC_FILE_OUTPUT) + s->Output[newvec->Index] = newvec; + else + s->Address = newvec; + + if (!s->DCE) + mark_vector_use(s, newvec, inst->I.DstReg.WriteMask); + } +} + +static void init_inputs(struct dataflow_state * s) +{ + unsigned int index; + + for(index = 0; index < 32; ++index) { + if (s->C->Program.InputsRead & (1 << index)) { + s->Input[index] = rc_dataflow_create_vector(s->C, RC_FILE_INPUT, index, 0); + s->Input[index]->ValidMask = RC_MASK_XYZW; + } + } +} + +static void mark_output_use(void * data, unsigned int index, unsigned int mask) +{ + struct dataflow_state * s = data; + struct rc_dataflow_vector * vec = s->Output[index]; + + if (vec) + mark_vector_use(s, vec, mask); +} + +void rc_dataflow_annotate(struct radeon_compiler * c, rc_dataflow_mark_outputs_fn dce, void * userdata) +{ + struct dataflow_state s; + struct rc_instruction * inst; + + memset(&s, 0, sizeof(s)); + s.C = c; + s.DCE = dce ? 1 : 0; + + init_inputs(&s); + + for(inst = c->Program.Instructions.Next; inst != &c->Program.Instructions; inst = inst->Next) { + annotate_instruction(&s, inst); + } + + if (s.DCE) { + dce(userdata, &s, &mark_output_use); + + for(inst = c->Program.Instructions.Next; inst != &c->Program.Instructions; inst = inst->Next) { + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); + + if (opcode->HasDstReg) { + unsigned int redundant_writes = inst->I.DstReg.WriteMask & ~inst->Dataflow.DstReg->UseMask; + + inst->I.DstReg.WriteMask &= ~redundant_writes; + + if (!inst->I.DstReg.WriteMask) { + struct rc_instruction * todelete = inst; + inst = inst->Prev; + rc_remove_instruction(todelete); + continue; + } + } + + unsigned int srcmasks[3]; + compute_sources_for_writemask(inst, inst->I.DstReg.WriteMask, srcmasks); + + for(unsigned int src = 0; src < 3; ++src) { + for(unsigned int chan = 0; chan < 4; ++chan) { + if (!GET_BIT(srcmasks[src], chan)) + SET_SWZ(inst->I.SrcReg[src].Swizzle, chan, RC_SWIZZLE_UNUSED); + } + + if (inst->Dataflow.SrcReg[src]) { + if (!inst->Dataflow.SrcReg[src]->UseMask) { + rc_dataflow_remove_ref(inst->Dataflow.SrcReg[src]); + inst->Dataflow.SrcReg[src] = 0; + } + } + + if (inst->Dataflow.SrcRegAddress[src]) { + if (!inst->Dataflow.SrcRegAddress[src]->UseMask) { + rc_dataflow_remove_ref(inst->Dataflow.SrcRegAddress[src]); + inst->Dataflow.SrcRegAddress[src] = 0; + } + } + } + } + + rc_calculate_inputs_outputs(c); + } +} diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_dealias.c b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_dealias.c new file mode 100644 index 0000000000..4596636970 --- /dev/null +++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_dealias.c @@ -0,0 +1,150 @@ +/* + * Copyright (C) 2009 Nicolai Haehnle. + * + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 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. + * + */ + +#include "radeon_dataflow.h" + +#include "radeon_compiler.h" + + +#define DEALIAS_LIST_SIZE 128 + +struct dealias_state { + struct radeon_compiler * C; + + unsigned int OldIndex:RC_REGISTER_INDEX_BITS; + unsigned int NewIndex:RC_REGISTER_INDEX_BITS; + unsigned int DealiasFail:1; + + struct rc_dataflow_vector * List[DEALIAS_LIST_SIZE]; + unsigned int Length; +}; + +static void push_dealias_vector(struct dealias_state * s, struct rc_dataflow_vector * vec) +{ + if (s->Length >= DEALIAS_LIST_SIZE) { + rc_debug(s->C, "%s: list size exceeded\n", __FUNCTION__); + s->DealiasFail = 1; + return; + } + + if (rc_assert(s->C, vec->File == RC_FILE_TEMPORARY && vec->Index == s->OldIndex)) + return; + + s->List[s->Length++] = vec; +} + +static void run_dealias(struct dealias_state * s) +{ + unsigned int i; + + for(i = 0; i < s->Length && !s->DealiasFail; ++i) { + struct rc_dataflow_vector * vec = s->List[i]; + struct rc_dataflow_ref * ref; + + for(ref = vec->Refs.Next; ref != &vec->Refs; ref = ref->Next) { + if (ref->ReadInstruction->Dataflow.DstRegPrev == ref) + push_dealias_vector(s, ref->ReadInstruction->Dataflow.DstReg); + } + } + + if (s->DealiasFail) + return; + + for(i = 0; i < s->Length; ++i) { + struct rc_dataflow_vector * vec = s->List[i]; + struct rc_dataflow_ref * ref; + + vec->Index = s->NewIndex; + vec->WriteInstruction->I.DstReg.Index = s->NewIndex; + + for(ref = vec->Refs.Next; ref != &vec->Refs; ref = ref->Next) { + struct rc_instruction * inst = ref->ReadInstruction; + unsigned int i; + + for(i = 0; i < 3; ++i) { + if (inst->Dataflow.SrcReg[i] == ref) { + if (rc_assert(s->C, inst->I.SrcReg[i].File == RC_FILE_TEMPORARY && + inst->I.SrcReg[i].Index == s->OldIndex)) + return; + + inst->I.SrcReg[i].Index = s->NewIndex; + } + } + } + } +} + +/** + * Breaks register aliasing to reduce multiple assignments to a single register. + * + * This affects sequences like: + * MUL r0, ...; + * MAD r0, r1, r2, r0; + * In this example, a new register will be used for the destination of the + * second MAD. + * + * The purpose of this dealiasing is to make the resulting code more SSA-like + * and therefore make it easier to move instructions around. + * This is of crucial importance for R300 fragment programs, where de-aliasing + * can help to reduce texture indirections, but other targets can benefit from + * it as well. + * + * \note When compiling GLSL, there may be some benefit gained from breaking + * up vectors whose components are unrelated. This is not done yet and should + * be investigated at some point (of course, a matching pass to re-merge + * components would be required). + */ +void rc_dataflow_dealias(struct radeon_compiler * c) +{ + struct dealias_state s; + + memset(&s, 0, sizeof(s)); + s.C = c; + + struct rc_instruction * inst; + for(inst = c->Program.Instructions.Prev; inst != &c->Program.Instructions; inst = inst->Prev) { + if (!inst->Dataflow.DstRegAliased || inst->Dataflow.DstReg->File != RC_FILE_TEMPORARY) + continue; + + if (inst->Dataflow.DstReg->UseMask & ~inst->I.DstReg.WriteMask) + continue; + + s.OldIndex = inst->I.DstReg.Index; + s.NewIndex = rc_find_free_temporary(c); + s.DealiasFail = 0; + s.Length = 0; + + inst->Dataflow.DstRegAliased = 0; + if (inst->Dataflow.DstRegPrev) { + rc_dataflow_remove_ref(inst->Dataflow.DstRegPrev); + inst->Dataflow.DstRegPrev = 0; + } + + push_dealias_vector(&s, inst->Dataflow.DstReg); + run_dealias(&s); + } +} diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_swizzles.c b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_swizzles.c new file mode 100644 index 0000000000..1aa91eff7c --- /dev/null +++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_swizzles.c @@ -0,0 +1,126 @@ +/* + * Copyright (C) 2009 Nicolai Haehnle. + * + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 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. + * + */ + +#include "radeon_dataflow.h" + +#include "radeon_compiler.h" +#include "radeon_swizzle.h" + + +static void rewrite_source(struct radeon_compiler * c, + struct rc_instruction * inst, unsigned src) +{ + struct rc_swizzle_split split; + unsigned int tempreg = rc_find_free_temporary(c); + unsigned int usemask; + struct rc_dataflow_ref * oldref = inst->Dataflow.SrcReg[src]; + struct rc_dataflow_vector * vector = 0; + + usemask = 0; + for(unsigned int chan = 0; chan < 4; ++chan) { + if (GET_SWZ(inst->I.SrcReg[src].Swizzle, chan) != RC_SWIZZLE_UNUSED) + usemask |= 1 << chan; + } + + c->SwizzleCaps->Split(inst->I.SrcReg[src], usemask, &split); + + for(unsigned int phase = 0; phase < split.NumPhases; ++phase) { + struct rc_instruction * mov = rc_insert_new_instruction(c, inst->Prev); + unsigned int phase_refmask; + unsigned int masked_negate; + + mov->I.Opcode = RC_OPCODE_MOV; + mov->I.DstReg.File = RC_FILE_TEMPORARY; + mov->I.DstReg.Index = tempreg; + mov->I.DstReg.WriteMask = split.Phase[phase]; + mov->I.SrcReg[0] = inst->I.SrcReg[src]; + + phase_refmask = 0; + for(unsigned int chan = 0; chan < 4; ++chan) { + if (!GET_BIT(split.Phase[phase], chan)) + SET_SWZ(mov->I.SrcReg[0].Swizzle, chan, RC_SWIZZLE_UNUSED); + else + phase_refmask |= 1 << GET_SWZ(mov->I.SrcReg[0].Swizzle, chan); + } + + phase_refmask &= RC_MASK_XYZW; + + masked_negate = split.Phase[phase] & mov->I.SrcReg[0].Negate; + if (masked_negate == 0) + mov->I.SrcReg[0].Negate = 0; + else if (masked_negate == split.Phase[phase]) + mov->I.SrcReg[0].Negate = RC_MASK_XYZW; + + if (oldref) { + mov->Dataflow.SrcReg[0] = rc_dataflow_create_ref(c, oldref->Vector, mov); + mov->Dataflow.SrcReg[0]->UseMask = phase_refmask; + } + + mov->Dataflow.DstReg = rc_dataflow_create_vector(c, RC_FILE_TEMPORARY, tempreg, mov); + mov->Dataflow.DstReg->ValidMask = split.Phase[phase]; + + if (vector) { + mov->Dataflow.DstRegPrev = rc_dataflow_create_ref(c, vector, mov); + mov->Dataflow.DstRegPrev->UseMask = vector->ValidMask; + mov->Dataflow.DstReg->ValidMask |= vector->ValidMask; + mov->Dataflow.DstRegAliased = 1; + } + + mov->Dataflow.DstReg->UseMask = mov->Dataflow.DstReg->ValidMask; + vector = mov->Dataflow.DstReg; + } + + if (oldref) + rc_dataflow_remove_ref(oldref); + inst->Dataflow.SrcReg[src] = rc_dataflow_create_ref(c, vector, inst); + inst->Dataflow.SrcReg[src]->UseMask = usemask; + + inst->I.SrcReg[src].File = RC_FILE_TEMPORARY; + inst->I.SrcReg[src].Index = tempreg; + inst->I.SrcReg[src].Swizzle = 0; + inst->I.SrcReg[src].Negate = RC_MASK_NONE; + inst->I.SrcReg[src].Abs = 0; + for(unsigned int chan = 0; chan < 4; ++chan) { + SET_SWZ(inst->I.SrcReg[src].Swizzle, chan, + GET_BIT(usemask, chan) ? chan : RC_SWIZZLE_UNUSED); + } +} + +void rc_dataflow_swizzles(struct radeon_compiler * c) +{ + struct rc_instruction * inst; + + for(inst = c->Program.Instructions.Next; inst != &c->Program.Instructions; inst = inst->Next) { + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); + unsigned int src; + + for(src = 0; src < opcode->NumSrcRegs; ++src) { + if (!c->SwizzleCaps->IsNative(inst->I.Opcode, inst->I.SrcReg[src])) + rewrite_source(c, inst, src); + } + } +} diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_nqssadce.c b/src/mesa/drivers/dri/r300/compiler/radeon_nqssadce.c deleted file mode 100644 index 3e02ebee81..0000000000 --- a/src/mesa/drivers/dri/r300/compiler/radeon_nqssadce.c +++ /dev/null @@ -1,267 +0,0 @@ -/* - * Copyright (C) 2008 Nicolai Haehnle. - * - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 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 - * - * "Not-quite SSA" and Dead-Code Elimination. - */ - -#include "radeon_nqssadce.h" - -#include "radeon_compiler.h" - - -/** - * Return the @ref register_state for the given register (or 0 for untracked - * registers, i.e. constants). - */ -static struct register_state *get_reg_state(struct nqssadce_state* s, rc_register_file file, unsigned int index) -{ - if (index >= RC_REGISTER_MAX_INDEX) - return 0; - - switch(file) { - case RC_FILE_TEMPORARY: return &s->Temps[index]; - case RC_FILE_OUTPUT: return &s->Outputs[index]; - case RC_FILE_ADDRESS: return &s->Address; - default: return 0; - } -} - - -static void track_used_srcreg(struct nqssadce_state* s, - int src, unsigned int sourced) -{ - struct rc_sub_instruction * inst = &s->IP->I; - int i; - unsigned int deswz_source = 0; - - for(i = 0; i < 4; ++i) { - if (GET_BIT(sourced, i)) { - unsigned int swz = GET_SWZ(inst->SrcReg[src].Swizzle, i); - deswz_source |= 1 << swz; - } else { - inst->SrcReg[src].Swizzle &= ~(7 << (3*i)); - inst->SrcReg[src].Swizzle |= RC_SWIZZLE_UNUSED << (3*i); - } - } - - if (!s->Descr->IsNativeSwizzle(inst->Opcode, inst->SrcReg[src])) { - struct rc_dst_register dstreg = inst->DstReg; - dstreg.File = RC_FILE_TEMPORARY; - dstreg.Index = rc_find_free_temporary(s->Compiler); - dstreg.WriteMask = sourced; - - s->Descr->BuildSwizzle(s, dstreg, inst->SrcReg[src]); - - inst->SrcReg[src].File = RC_FILE_TEMPORARY; - inst->SrcReg[src].Index = dstreg.Index; - inst->SrcReg[src].Swizzle = 0; - inst->SrcReg[src].Negate = RC_MASK_NONE; - inst->SrcReg[src].Abs = 0; - for(i = 0; i < 4; ++i) { - if (GET_BIT(sourced, i)) - inst->SrcReg[src].Swizzle |= i << (3*i); - else - inst->SrcReg[src].Swizzle |= RC_SWIZZLE_UNUSED << (3*i); - } - deswz_source = sourced; - } - - struct register_state *regstate; - - if (inst->SrcReg[src].RelAddr) { - regstate = get_reg_state(s, RC_FILE_ADDRESS, 0); - if (regstate) - regstate->Sourced |= RC_MASK_X; - } else { - regstate = get_reg_state(s, inst->SrcReg[src].File, inst->SrcReg[src].Index); - if (regstate) - regstate->Sourced |= deswz_source & 0xf; - } -} - -static void unalias_srcregs(struct rc_instruction *inst, unsigned int oldindex, unsigned int newindex) -{ - const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); - int i; - for(i = 0; i < opcode->NumSrcRegs; ++i) - if (inst->I.SrcReg[i].File == RC_FILE_TEMPORARY && inst->I.SrcReg[i].Index == oldindex) - inst->I.SrcReg[i].Index = newindex; -} - -static void unalias_temporary(struct nqssadce_state* s, unsigned int oldindex) -{ - unsigned int newindex = rc_find_free_temporary(s->Compiler); - struct rc_instruction * inst; - for(inst = s->Compiler->Program.Instructions.Next; inst != s->IP; inst = inst->Next) { - if (inst->I.DstReg.File == RC_FILE_TEMPORARY && inst->I.DstReg.Index == oldindex) - inst->I.DstReg.Index = newindex; - unalias_srcregs(inst, oldindex, newindex); - } - unalias_srcregs(s->IP, oldindex, newindex); -} - - -/** - * Handle one instruction. - */ -static void process_instruction(struct nqssadce_state* s) -{ - struct rc_sub_instruction *inst = &s->IP->I; - unsigned int WriteMask; - - if (inst->Opcode != RC_OPCODE_KIL) { - struct register_state *regstate = get_reg_state(s, inst->DstReg.File, inst->DstReg.Index); - if (!regstate) { - rc_error(s->Compiler, "NqssaDce: bad destination register (%i[%i])\n", - inst->DstReg.File, inst->DstReg.Index); - return; - } - - inst->DstReg.WriteMask &= regstate->Sourced; - regstate->Sourced &= ~inst->DstReg.WriteMask; - - if (inst->DstReg.WriteMask == 0) { - struct rc_instruction * inst_remove = s->IP; - s->IP = s->IP->Prev; - rc_remove_instruction(inst_remove); - return; - } - - if (inst->DstReg.File == RC_FILE_TEMPORARY && !regstate->Sourced) - unalias_temporary(s, inst->DstReg.Index); - } - - WriteMask = inst->DstReg.WriteMask; - - switch (inst->Opcode) { - case RC_OPCODE_ARL: - case RC_OPCODE_DDX: - case RC_OPCODE_DDY: - case RC_OPCODE_FRC: - case RC_OPCODE_MOV: - track_used_srcreg(s, 0, WriteMask); - break; - case RC_OPCODE_ADD: - case RC_OPCODE_MAX: - case RC_OPCODE_MIN: - case RC_OPCODE_MUL: - case RC_OPCODE_SGE: - case RC_OPCODE_SLT: - track_used_srcreg(s, 0, WriteMask); - track_used_srcreg(s, 1, WriteMask); - break; - case RC_OPCODE_CMP: - case RC_OPCODE_MAD: - track_used_srcreg(s, 0, WriteMask); - track_used_srcreg(s, 1, WriteMask); - track_used_srcreg(s, 2, WriteMask); - break; - case RC_OPCODE_COS: - case RC_OPCODE_EX2: - case RC_OPCODE_LG2: - case RC_OPCODE_RCP: - case RC_OPCODE_RSQ: - case RC_OPCODE_SIN: - track_used_srcreg(s, 0, 0x1); - break; - case RC_OPCODE_DP3: - track_used_srcreg(s, 0, 0x7); - track_used_srcreg(s, 1, 0x7); - break; - case RC_OPCODE_DP4: - track_used_srcreg(s, 0, 0xf); - track_used_srcreg(s, 1, 0xf); - break; - case RC_OPCODE_KIL: - case RC_OPCODE_TEX: - case RC_OPCODE_TXB: - case RC_OPCODE_TXP: - track_used_srcreg(s, 0, 0xf); - break; - case RC_OPCODE_DST: - track_used_srcreg(s, 0, 0x6); - track_used_srcreg(s, 1, 0xa); - break; - case RC_OPCODE_EXP: - case RC_OPCODE_LOG: - case RC_OPCODE_POW: - track_used_srcreg(s, 0, 0x3); - break; - case RC_OPCODE_LIT: - track_used_srcreg(s, 0, 0xb); - break; - default: - rc_error(s->Compiler, "NqssaDce: Unknown opcode %d\n", inst->Opcode); - return; - } - - s->IP = s->IP->Prev; -} - -void rc_calculate_inputs_outputs(struct radeon_compiler * c) -{ - struct rc_instruction *inst; - - c->Program.InputsRead = 0; - c->Program.OutputsWritten = 0; - - for(inst = c->Program.Instructions.Next; inst != &c->Program.Instructions; inst = inst->Next) - { - const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); - int i; - - for (i = 0; i < opcode->NumSrcRegs; ++i) { - if (inst->I.SrcReg[i].File == RC_FILE_INPUT) - c->Program.InputsRead |= 1 << inst->I.SrcReg[i].Index; - } - - if (opcode->HasDstReg) { - if (inst->I.DstReg.File == RC_FILE_OUTPUT) - c->Program.OutputsWritten |= 1 << inst->I.DstReg.Index; - } - } -} - -void radeonNqssaDce(struct radeon_compiler * c, struct radeon_nqssadce_descr* descr, void * data) -{ - struct nqssadce_state s; - - memset(&s, 0, sizeof(s)); - s.Compiler = c; - s.Descr = descr; - s.UserData = data; - s.Descr->Init(&s); - s.IP = c->Program.Instructions.Prev; - - while(s.IP != &c->Program.Instructions && !c->Error) - process_instruction(&s); - - rc_calculate_inputs_outputs(c); -} diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_nqssadce.h b/src/mesa/drivers/dri/r300/compiler/radeon_nqssadce.h deleted file mode 100644 index a2aa1eb8ca..0000000000 --- a/src/mesa/drivers/dri/r300/compiler/radeon_nqssadce.h +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (C) 2008 Nicolai Haehnle. - * - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 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. - * - */ - -#ifndef __RADEON_PROGRAM_NQSSADCE_H_ -#define __RADEON_PROGRAM_NQSSADCE_H_ - -#include "radeon_program.h" - -struct register_state { - /** - * Bitmask indicating which components of the register are sourced - * by later instructions. - */ - unsigned int Sourced : 4; -}; - -/** - * Maintain state such as which registers are used, which registers are - * read from, etc. - */ -struct nqssadce_state { - struct radeon_compiler *Compiler; - struct radeon_nqssadce_descr *Descr; - - /** - * All instructions after this instruction pointer have been dealt with. - */ - struct rc_instruction * IP; - - /** - * Which registers are read by subsequent instructions? - */ - struct register_state Temps[RC_REGISTER_MAX_INDEX]; - struct register_state Outputs[RC_REGISTER_MAX_INDEX]; - struct register_state Address; - - void * UserData; -}; - - -/** - * This structure contains a description of the hardware in-so-far as - * it is required for the NqSSA-DCE pass. - */ -struct radeon_nqssadce_descr { - /** - * Fill in which outputs - */ - void (*Init)(struct nqssadce_state *); - - /** - * Check whether the given swizzle, absolute and negate combination - * can be implemented natively by the hardware for this opcode. - * - * \return 1 if the swizzle is native for the given opcode - */ - int (*IsNativeSwizzle)(rc_opcode opcode, struct rc_src_register reg); - - /** - * Emit (at the current IP) the instruction MOV dst, src; - * The transformation will work recursively on the emitted instruction(s). - */ - void (*BuildSwizzle)(struct nqssadce_state*, struct rc_dst_register dst, struct rc_src_register src); -}; - -void radeonNqssaDce(struct radeon_compiler * c, struct radeon_nqssadce_descr* descr, void * data); - -#endif /* __RADEON_PROGRAM_NQSSADCE_H_ */ diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c index ffe2de1a87..b7200990c2 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c @@ -40,13 +40,15 @@ struct rc_opcode_info rc_opcodes[MAX_RC_OPCODE] = { .Opcode = RC_OPCODE_ABS, .Name = "ABS", .NumSrcRegs = 1, - .HasDstReg = 1 + .HasDstReg = 1, + .IsComponentwise = 1 }, { .Opcode = RC_OPCODE_ADD, .Name = "ADD", .NumSrcRegs = 2, - .HasDstReg = 1 + .HasDstReg = 1, + .IsComponentwise = 1 }, { .Opcode = RC_OPCODE_ARL, @@ -58,25 +60,29 @@ struct rc_opcode_info rc_opcodes[MAX_RC_OPCODE] = { .Opcode = RC_OPCODE_CMP, .Name = "CMP", .NumSrcRegs = 3, - .HasDstReg = 1 + .HasDstReg = 1, + .IsComponentwise = 1 }, { .Opcode = RC_OPCODE_COS, .Name = "COS", .NumSrcRegs = 1, - .HasDstReg = 1 + .HasDstReg = 1, + .IsStandardScalar = 1 }, { .Opcode = RC_OPCODE_DDX, .Name = "DDX", .NumSrcRegs = 1, - .HasDstReg = 1 + .HasDstReg = 1, + .IsComponentwise = 1 }, { .Opcode = RC_OPCODE_DDY, .Name = "DDY", .NumSrcRegs = 1, - .HasDstReg = 1 + .HasDstReg = 1, + .IsComponentwise = 1 }, { .Opcode = RC_OPCODE_DP3, @@ -106,7 +112,8 @@ struct rc_opcode_info rc_opcodes[MAX_RC_OPCODE] = { .Opcode = RC_OPCODE_EX2, .Name = "EX2", .NumSrcRegs = 1, - .HasDstReg = 1 + .HasDstReg = 1, + .IsStandardScalar = 1 }, { .Opcode = RC_OPCODE_EXP, @@ -118,13 +125,15 @@ struct rc_opcode_info rc_opcodes[MAX_RC_OPCODE] = { .Opcode = RC_OPCODE_FLR, .Name = "FLR", .NumSrcRegs = 1, - .HasDstReg = 1 + .HasDstReg = 1, + .IsComponentwise = 1 }, { .Opcode = RC_OPCODE_FRC, .Name = "FRC", .NumSrcRegs = 1, - .HasDstReg = 1 + .HasDstReg = 1, + .IsComponentwise = 1 }, { .Opcode = RC_OPCODE_KIL, @@ -135,7 +144,8 @@ struct rc_opcode_info rc_opcodes[MAX_RC_OPCODE] = { .Opcode = RC_OPCODE_LG2, .Name = "LG2", .NumSrcRegs = 1, - .HasDstReg = 1 + .HasDstReg = 1, + .IsStandardScalar = 1 }, { .Opcode = RC_OPCODE_LIT, @@ -153,55 +163,64 @@ struct rc_opcode_info rc_opcodes[MAX_RC_OPCODE] = { .Opcode = RC_OPCODE_LRP, .Name = "LRP", .NumSrcRegs = 3, - .HasDstReg = 1 + .HasDstReg = 1, + .IsComponentwise = 1 }, { .Opcode = RC_OPCODE_MAD, .Name = "MAD", .NumSrcRegs = 3, - .HasDstReg = 1 + .HasDstReg = 1, + .IsComponentwise = 1 }, { .Opcode = RC_OPCODE_MAX, .Name = "MAX", .NumSrcRegs = 2, - .HasDstReg = 1 + .HasDstReg = 1, + .IsComponentwise = 1 }, { .Opcode = RC_OPCODE_MIN, .Name = "MIN", .NumSrcRegs = 2, - .HasDstReg = 1 + .HasDstReg = 1, + .IsComponentwise = 1 }, { .Opcode = RC_OPCODE_MOV, .Name = "MOV", .NumSrcRegs = 1, - .HasDstReg = 1 + .HasDstReg = 1, + .IsComponentwise = 1 }, { .Opcode = RC_OPCODE_MUL, .Name = "MUL", .NumSrcRegs = 2, - .HasDstReg = 1 + .HasDstReg = 1, + .IsComponentwise = 1 }, { .Opcode = RC_OPCODE_POW, .Name = "POW", .NumSrcRegs = 2, - .HasDstReg = 1 + .HasDstReg = 1, + .IsStandardScalar = 1 }, { .Opcode = RC_OPCODE_RCP, .Name = "RCP", .NumSrcRegs = 1, - .HasDstReg = 1 + .HasDstReg = 1, + .IsStandardScalar = 1 }, { .Opcode = RC_OPCODE_RSQ, .Name = "RSQ", .NumSrcRegs = 1, - .HasDstReg = 1 + .HasDstReg = 1, + .IsStandardScalar = 1 }, { .Opcode = RC_OPCODE_SCS, @@ -213,61 +232,71 @@ struct rc_opcode_info rc_opcodes[MAX_RC_OPCODE] = { .Opcode = RC_OPCODE_SEQ, .Name = "SEQ", .NumSrcRegs = 2, - .HasDstReg = 1 + .HasDstReg = 1, + .IsComponentwise = 1 }, { .Opcode = RC_OPCODE_SFL, .Name = "SFL", .NumSrcRegs = 0, - .HasDstReg = 1 + .HasDstReg = 1, + .IsComponentwise = 1 }, { .Opcode = RC_OPCODE_SGE, .Name = "SGE", .NumSrcRegs = 2, - .HasDstReg = 1 + .HasDstReg = 1, + .IsComponentwise = 1 }, { .Opcode = RC_OPCODE_SGT, .Name = "SGT", .NumSrcRegs = 2, - .HasDstReg = 1 + .HasDstReg = 1, + .IsComponentwise = 1 }, { .Opcode = RC_OPCODE_SIN, .Name = "SIN", .NumSrcRegs = 1, - .HasDstReg = 1 + .HasDstReg = 1, + .IsStandardScalar = 1 }, { .Opcode = RC_OPCODE_SLE, .Name = "SLE", .NumSrcRegs = 2, - .HasDstReg = 1 + .HasDstReg = 1, + .IsComponentwise = 1 }, { .Opcode = RC_OPCODE_SLT, .Name = "SLT", .NumSrcRegs = 2, - .HasDstReg = 1 + .HasDstReg = 1, + .IsComponentwise = 1 }, { .Opcode = RC_OPCODE_SNE, .Name = "SNE", .NumSrcRegs = 2, - .HasDstReg = 1 + .HasDstReg = 1, + .IsComponentwise = 1 }, { .Opcode = RC_OPCODE_SUB, .Name = "SUB", .NumSrcRegs = 2, - .HasDstReg = 1 + .HasDstReg = 1, + .IsComponentwise = 1 }, { .Opcode = RC_OPCODE_SWZ, .Name = "SWZ", .NumSrcRegs = 1, - .HasDstReg = 1 + .HasDstReg = 1, + .IsComponentwise = 1 }, { .Opcode = RC_OPCODE_XPD, diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h index 4eb9be3e55..8e30bef1e3 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h @@ -187,6 +187,14 @@ struct rc_opcode_info { unsigned int NumSrcRegs:2; unsigned int HasDstReg:1; + + /** true if this is a vector instruction that operates on components in parallel + * without any cross-component interaction */ + unsigned int IsComponentwise:1; + + /** true if this instruction sources only its operands X components + * to compute one result which is smeared across all output channels */ + unsigned int IsStandardScalar:1; }; extern struct rc_opcode_info rc_opcodes[MAX_RC_OPCODE]; diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program.c b/src/mesa/drivers/dri/r300/compiler/radeon_program.c index 0e0c1f68e6..b97c48084b 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program.c @@ -154,155 +154,7 @@ struct rc_instruction *rc_insert_new_instruction(struct radeon_compiler * c, str void rc_remove_instruction(struct rc_instruction * inst) { + rc_dataflow_remove_instruction(inst); inst->Prev->Next = inst->Next; inst->Next->Prev = inst->Prev; } - -static const char * textarget_to_string(rc_texture_target target) -{ - switch(target) { - case RC_TEXTURE_2D_ARRAY: return "2D_ARRAY"; - case RC_TEXTURE_1D_ARRAY: return "1D_ARRAY"; - case RC_TEXTURE_CUBE: return "CUBE"; - case RC_TEXTURE_3D: return "3D"; - case RC_TEXTURE_RECT: return "RECT"; - case RC_TEXTURE_2D: return "2D"; - case RC_TEXTURE_1D: return "1D"; - default: return "BAD_TEXTURE_TARGET"; - } -} - -static void rc_print_register(FILE * f, rc_register_file file, int index, unsigned int reladdr) -{ - if (file == RC_FILE_NONE) { - fprintf(f, "none"); - } else { - const char * filename; - switch(file) { - case RC_FILE_TEMPORARY: filename = "temp"; break; - case RC_FILE_INPUT: filename = "input"; break; - case RC_FILE_OUTPUT: filename = "output"; break; - case RC_FILE_ADDRESS: filename = "addr"; break; - case RC_FILE_CONSTANT: filename = "const"; break; - default: filename = "BAD FILE"; break; - } - fprintf(f, "%s[%i%s]", filename, index, reladdr ? " + addr[0]" : ""); - } -} - -static void rc_print_mask(FILE * f, unsigned int mask) -{ - if (mask & RC_MASK_X) fprintf(f, "x"); - if (mask & RC_MASK_Y) fprintf(f, "y"); - if (mask & RC_MASK_Z) fprintf(f, "z"); - if (mask & RC_MASK_W) fprintf(f, "w"); -} - -static void rc_print_dst_register(FILE * f, struct rc_dst_register dst) -{ - rc_print_register(f, dst.File, dst.Index, dst.RelAddr); - if (dst.WriteMask != RC_MASK_XYZW) { - fprintf(f, "."); - rc_print_mask(f, dst.WriteMask); - } -} - -static void rc_print_swizzle(FILE * f, unsigned int swizzle, unsigned int negate) -{ - unsigned int comp; - for(comp = 0; comp < 4; ++comp) { - rc_swizzle swz = GET_SWZ(swizzle, comp); - if (GET_BIT(negate, comp)) - fprintf(f, "-"); - switch(swz) { - case RC_SWIZZLE_X: fprintf(f, "x"); break; - case RC_SWIZZLE_Y: fprintf(f, "y"); break; - case RC_SWIZZLE_Z: fprintf(f, "z"); break; - case RC_SWIZZLE_W: fprintf(f, "w"); break; - case RC_SWIZZLE_ZERO: fprintf(f, "0"); break; - case RC_SWIZZLE_ONE: fprintf(f, "1"); break; - case RC_SWIZZLE_HALF: fprintf(f, "H"); break; - case RC_SWIZZLE_UNUSED: fprintf(f, "_"); break; - } - } -} - -static void rc_print_src_register(FILE * f, struct rc_src_register src) -{ - int trivial_negate = (src.Negate == RC_MASK_NONE || src.Negate == RC_MASK_XYZW); - - if (src.Negate == RC_MASK_XYZW) - fprintf(f, "-"); - if (src.Abs) - fprintf(f, "|"); - - rc_print_register(f, src.File, src.Index, src.RelAddr); - - if (src.Abs && !trivial_negate) - fprintf(f, "|"); - - if (src.Swizzle != RC_SWIZZLE_XYZW || !trivial_negate) { - fprintf(f, "."); - rc_print_swizzle(f, src.Swizzle, trivial_negate ? 0 : src.Negate); - } - - if (src.Abs && trivial_negate) - fprintf(f, "|"); -} - -static void rc_print_instruction(FILE * f, struct rc_instruction * inst) -{ - const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); - unsigned int reg; - - fprintf(f, "%s", opcode->Name); - - switch(inst->I.SaturateMode) { - case RC_SATURATE_NONE: break; - case RC_SATURATE_ZERO_ONE: fprintf(f, "_SAT"); break; - case RC_SATURATE_MINUS_PLUS_ONE: fprintf(f, "_SAT2"); break; - default: fprintf(f, "_BAD_SAT"); break; - } - - if (opcode->HasDstReg) { - fprintf(f, " "); - rc_print_dst_register(f, inst->I.DstReg); - if (opcode->NumSrcRegs) - fprintf(f, ","); - } - - for(reg = 0; reg < opcode->NumSrcRegs; ++reg) { - if (reg > 0) - fprintf(f, ","); - fprintf(f, " "); - rc_print_src_register(f, inst->I.SrcReg[reg]); - } - - if (opcode->HasTexture) { - fprintf(f, ", %s%s[%u]", - textarget_to_string(inst->I.TexSrcTarget), - inst->I.TexShadow ? "SHADOW" : "", - inst->I.TexSrcUnit); - } - - fprintf(f, ";\n"); -} - -/** - * Print program to stderr, default options. - */ -void rc_print_program(const struct rc_program *prog) -{ - unsigned int linenum = 0; - struct rc_instruction *inst; - - fprintf(stderr, "# Radeon Compiler Program\n"); - - for(inst = prog->Instructions.Next; inst != &prog->Instructions; inst = inst->Next) { - fprintf(stderr, "%3d: ", linenum); - - rc_print_instruction(stderr, inst); - - linenum++; - } -} diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program.h b/src/mesa/drivers/dri/r300/compiler/radeon_program.h index a2ab757fec..d38c9a420c 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program.h @@ -33,102 +33,11 @@ #include "radeon_opcodes.h" #include "radeon_code.h" +#include "radeon_program_constants.h" +#include "radeon_dataflow.h" struct radeon_compiler; -typedef enum { - RC_SATURATE_NONE = 0, - RC_SATURATE_ZERO_ONE, - RC_SATURATE_MINUS_PLUS_ONE -} rc_saturate_mode; - -typedef enum { - RC_TEXTURE_2D_ARRAY, - RC_TEXTURE_1D_ARRAY, - RC_TEXTURE_CUBE, - RC_TEXTURE_3D, - RC_TEXTURE_RECT, - RC_TEXTURE_2D, - RC_TEXTURE_1D -} rc_texture_target; - -typedef enum { - /** - * Used to indicate unused register descriptions and - * source register that use a constant swizzle. - */ - RC_FILE_NONE = 0, - RC_FILE_TEMPORARY, - - /** - * Input register. - * - * \note The compiler attaches no implicit semantics to input registers. - * Fragment/vertex program specific semantics must be defined explicitly - * using the appropriate compiler interfaces. - */ - RC_FILE_INPUT, - - /** - * Output register. - * - * \note The compiler attaches no implicit semantics to input registers. - * Fragment/vertex program specific semantics must be defined explicitly - * using the appropriate compiler interfaces. - */ - RC_FILE_OUTPUT, - RC_FILE_ADDRESS, - - /** - * Indicates a constant from the \ref rc_constant_list . - */ - RC_FILE_CONSTANT -} rc_register_file; - -#define RC_REGISTER_INDEX_BITS 10 -#define RC_REGISTER_MAX_INDEX (1 << RC_REGISTER_INDEX_BITS) - -typedef enum { - RC_SWIZZLE_X = 0, - RC_SWIZZLE_Y, - RC_SWIZZLE_Z, - RC_SWIZZLE_W, - RC_SWIZZLE_ZERO, - RC_SWIZZLE_ONE, - RC_SWIZZLE_HALF, - RC_SWIZZLE_UNUSED -} rc_swizzle; - -#define RC_MAKE_SWIZZLE(a,b,c,d) (((a)<<0) | ((b)<<3) | ((c)<<6) | ((d)<<9)) -#define RC_MAKE_SWIZZLE_SMEAR(a) RC_MAKE_SWIZZLE((a),(a),(a),(a)) -#define GET_SWZ(swz, idx) (((swz) >> ((idx)*3)) & 0x7) -#define GET_BIT(msk, idx) (((msk) >> (idx)) & 0x1) - -#define RC_SWIZZLE_XYZW RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_W) -#define RC_SWIZZLE_XXXX RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_X) -#define RC_SWIZZLE_YYYY RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_Y) -#define RC_SWIZZLE_ZZZZ RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_Z) -#define RC_SWIZZLE_WWWW RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_W) -#define RC_SWIZZLE_0000 RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_ZERO) -#define RC_SWIZZLE_1111 RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_ONE) - -/** - * \name Bitmasks for components of vectors. - * - * Used for write masks, negation masks, etc. - */ -/*@{*/ -#define RC_MASK_NONE 0 -#define RC_MASK_X 1 -#define RC_MASK_Y 2 -#define RC_MASK_Z 4 -#define RC_MASK_W 8 -#define RC_MASK_XY (RC_MASK_X|RC_MASK_Y) -#define RC_MASK_XYZ (RC_MASK_X|RC_MASK_Y|RC_MASK_Z) -#define RC_MASK_XYW (RC_MASK_X|RC_MASK_Y|RC_MASK_W) -#define RC_MASK_XYZW (RC_MASK_X|RC_MASK_Y|RC_MASK_Z|RC_MASK_W) -/*@}*/ - struct rc_src_register { rc_register_file File:3; @@ -198,6 +107,15 @@ struct rc_instruction { struct rc_instruction * Next; struct rc_sub_instruction I; + + /** + * Dataflow annotations. + * + * These are not supplied by the caller of the compiler, + * but filled in during compilation stages that make use of + * dataflow analysis. + */ + struct rc_instruction_dataflow Dataflow; }; struct rc_program { @@ -292,6 +210,10 @@ struct rc_instruction *rc_alloc_instruction(struct radeon_compiler * c); struct rc_instruction *rc_insert_new_instruction(struct radeon_compiler * c, struct rc_instruction * after); void rc_remove_instruction(struct rc_instruction * inst); -void rc_print_program(const struct rc_program *prog); +enum { + RC_PRINT_DATAFLOW = 0x1 +}; + +void rc_print_program(const struct rc_program *prog, unsigned int flags); #endif diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_constants.h b/src/mesa/drivers/dri/r300/compiler/radeon_program_constants.h new file mode 100644 index 0000000000..69994f9880 --- /dev/null +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_constants.h @@ -0,0 +1,128 @@ +/* + * Copyright (C) 2009 Nicolai Haehnle. + * + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 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. + * + */ + +#ifndef RADEON_PROGRAM_CONSTANTS_H +#define RADEON_PROGRAM_CONSTANTS_H + +typedef enum { + RC_SATURATE_NONE = 0, + RC_SATURATE_ZERO_ONE, + RC_SATURATE_MINUS_PLUS_ONE +} rc_saturate_mode; + +typedef enum { + RC_TEXTURE_2D_ARRAY, + RC_TEXTURE_1D_ARRAY, + RC_TEXTURE_CUBE, + RC_TEXTURE_3D, + RC_TEXTURE_RECT, + RC_TEXTURE_2D, + RC_TEXTURE_1D +} rc_texture_target; + +typedef enum { + /** + * Used to indicate unused register descriptions and + * source register that use a constant swizzle. + */ + RC_FILE_NONE = 0, + RC_FILE_TEMPORARY, + + /** + * Input register. + * + * \note The compiler attaches no implicit semantics to input registers. + * Fragment/vertex program specific semantics must be defined explicitly + * using the appropriate compiler interfaces. + */ + RC_FILE_INPUT, + + /** + * Output register. + * + * \note The compiler attaches no implicit semantics to input registers. + * Fragment/vertex program specific semantics must be defined explicitly + * using the appropriate compiler interfaces. + */ + RC_FILE_OUTPUT, + RC_FILE_ADDRESS, + + /** + * Indicates a constant from the \ref rc_constant_list . + */ + RC_FILE_CONSTANT +} rc_register_file; + +#define RC_REGISTER_INDEX_BITS 10 +#define RC_REGISTER_MAX_INDEX (1 << RC_REGISTER_INDEX_BITS) + +typedef enum { + RC_SWIZZLE_X = 0, + RC_SWIZZLE_Y, + RC_SWIZZLE_Z, + RC_SWIZZLE_W, + RC_SWIZZLE_ZERO, + RC_SWIZZLE_ONE, + RC_SWIZZLE_HALF, + RC_SWIZZLE_UNUSED +} rc_swizzle; + +#define RC_MAKE_SWIZZLE(a,b,c,d) (((a)<<0) | ((b)<<3) | ((c)<<6) | ((d)<<9)) +#define RC_MAKE_SWIZZLE_SMEAR(a) RC_MAKE_SWIZZLE((a),(a),(a),(a)) +#define GET_SWZ(swz, idx) (((swz) >> ((idx)*3)) & 0x7) +#define GET_BIT(msk, idx) (((msk) >> (idx)) & 0x1) +#define SET_SWZ(swz, idx, newv) \ + do { \ + (swz) = ((swz) & ~(7 << ((idx)*3))) | ((newv) << ((idx)*3)); \ + } while(0) + +#define RC_SWIZZLE_XYZW RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_W) +#define RC_SWIZZLE_XXXX RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_X) +#define RC_SWIZZLE_YYYY RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_Y) +#define RC_SWIZZLE_ZZZZ RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_Z) +#define RC_SWIZZLE_WWWW RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_W) +#define RC_SWIZZLE_0000 RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_ZERO) +#define RC_SWIZZLE_1111 RC_MAKE_SWIZZLE_SMEAR(RC_SWIZZLE_ONE) + +/** + * \name Bitmasks for components of vectors. + * + * Used for write masks, negation masks, etc. + */ +/*@{*/ +#define RC_MASK_NONE 0 +#define RC_MASK_X 1 +#define RC_MASK_Y 2 +#define RC_MASK_Z 4 +#define RC_MASK_W 8 +#define RC_MASK_XY (RC_MASK_X|RC_MASK_Y) +#define RC_MASK_XYZ (RC_MASK_X|RC_MASK_Y|RC_MASK_Z) +#define RC_MASK_XYW (RC_MASK_X|RC_MASK_Y|RC_MASK_W) +#define RC_MASK_XYZW (RC_MASK_X|RC_MASK_Y|RC_MASK_Z|RC_MASK_W) +/*@}*/ + +#endif /* RADEON_PROGRAM_CONSTANTS_H */ diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_print.c b/src/mesa/drivers/dri/r300/compiler/radeon_program_print.c new file mode 100644 index 0000000000..38060ea3ad --- /dev/null +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_print.c @@ -0,0 +1,214 @@ +/* + * Copyright 2009 Nicolai Hähnle + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN 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. */ + +#include "radeon_program.h" + +#include + +static void print_comment(FILE * f) +{ + fprintf(f, " # "); +} + +static const char * textarget_to_string(rc_texture_target target) +{ + switch(target) { + case RC_TEXTURE_2D_ARRAY: return "2D_ARRAY"; + case RC_TEXTURE_1D_ARRAY: return "1D_ARRAY"; + case RC_TEXTURE_CUBE: return "CUBE"; + case RC_TEXTURE_3D: return "3D"; + case RC_TEXTURE_RECT: return "RECT"; + case RC_TEXTURE_2D: return "2D"; + case RC_TEXTURE_1D: return "1D"; + default: return "BAD_TEXTURE_TARGET"; + } +} + +static void rc_print_register(FILE * f, rc_register_file file, int index, unsigned int reladdr) +{ + if (file == RC_FILE_NONE) { + fprintf(f, "none"); + } else { + const char * filename; + switch(file) { + case RC_FILE_TEMPORARY: filename = "temp"; break; + case RC_FILE_INPUT: filename = "input"; break; + case RC_FILE_OUTPUT: filename = "output"; break; + case RC_FILE_ADDRESS: filename = "addr"; break; + case RC_FILE_CONSTANT: filename = "const"; break; + default: filename = "BAD FILE"; break; + } + fprintf(f, "%s[%i%s]", filename, index, reladdr ? " + addr[0]" : ""); + } +} + +static void rc_print_mask(FILE * f, unsigned int mask) +{ + if (mask & RC_MASK_X) fprintf(f, "x"); + if (mask & RC_MASK_Y) fprintf(f, "y"); + if (mask & RC_MASK_Z) fprintf(f, "z"); + if (mask & RC_MASK_W) fprintf(f, "w"); +} + +static void rc_print_dst_register(FILE * f, struct rc_dst_register dst) +{ + rc_print_register(f, dst.File, dst.Index, dst.RelAddr); + if (dst.WriteMask != RC_MASK_XYZW) { + fprintf(f, "."); + rc_print_mask(f, dst.WriteMask); + } +} + +static void rc_print_swizzle(FILE * f, unsigned int swizzle, unsigned int negate) +{ + unsigned int comp; + for(comp = 0; comp < 4; ++comp) { + rc_swizzle swz = GET_SWZ(swizzle, comp); + if (GET_BIT(negate, comp)) + fprintf(f, "-"); + switch(swz) { + case RC_SWIZZLE_X: fprintf(f, "x"); break; + case RC_SWIZZLE_Y: fprintf(f, "y"); break; + case RC_SWIZZLE_Z: fprintf(f, "z"); break; + case RC_SWIZZLE_W: fprintf(f, "w"); break; + case RC_SWIZZLE_ZERO: fprintf(f, "0"); break; + case RC_SWIZZLE_ONE: fprintf(f, "1"); break; + case RC_SWIZZLE_HALF: fprintf(f, "H"); break; + case RC_SWIZZLE_UNUSED: fprintf(f, "_"); break; + } + } +} + +static void rc_print_src_register(FILE * f, struct rc_src_register src) +{ + int trivial_negate = (src.Negate == RC_MASK_NONE || src.Negate == RC_MASK_XYZW); + + if (src.Negate == RC_MASK_XYZW) + fprintf(f, "-"); + if (src.Abs) + fprintf(f, "|"); + + rc_print_register(f, src.File, src.Index, src.RelAddr); + + if (src.Abs && !trivial_negate) + fprintf(f, "|"); + + if (src.Swizzle != RC_SWIZZLE_XYZW || !trivial_negate) { + fprintf(f, "."); + rc_print_swizzle(f, src.Swizzle, trivial_negate ? 0 : src.Negate); + } + + if (src.Abs && trivial_negate) + fprintf(f, "|"); +} + +static void rc_print_ref(FILE * f, struct rc_dataflow_ref * ref) +{ + fprintf(f, "ref(%p", ref->Vector); + + if (ref->UseMask != RC_MASK_XYZW) { + fprintf(f, "."); + rc_print_mask(f, ref->UseMask); + } + + fprintf(f, ")"); +} + +static void rc_print_instruction(FILE * f, unsigned int flags, struct rc_instruction * inst) +{ + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); + unsigned int reg; + + fprintf(f, "%s", opcode->Name); + + switch(inst->I.SaturateMode) { + case RC_SATURATE_NONE: break; + case RC_SATURATE_ZERO_ONE: fprintf(f, "_SAT"); break; + case RC_SATURATE_MINUS_PLUS_ONE: fprintf(f, "_SAT2"); break; + default: fprintf(f, "_BAD_SAT"); break; + } + + if (opcode->HasDstReg) { + fprintf(f, " "); + rc_print_dst_register(f, inst->I.DstReg); + if (opcode->NumSrcRegs) + fprintf(f, ","); + } + + for(reg = 0; reg < opcode->NumSrcRegs; ++reg) { + if (reg > 0) + fprintf(f, ","); + fprintf(f, " "); + rc_print_src_register(f, inst->I.SrcReg[reg]); + } + + if (opcode->HasTexture) { + fprintf(f, ", %s%s[%u]", + textarget_to_string(inst->I.TexSrcTarget), + inst->I.TexShadow ? "SHADOW" : "", + inst->I.TexSrcUnit); + } + + fprintf(f, ";\n"); + + if (flags & RC_PRINT_DATAFLOW) { + print_comment(f); + + fprintf(f, "Dst = %p", inst->Dataflow.DstReg); + if (inst->Dataflow.DstRegAliased) + fprintf(f, " aliased"); + if (inst->Dataflow.DstRegPrev) { + fprintf(f, " from "); + rc_print_ref(f, inst->Dataflow.DstRegPrev); + } + + for(reg = 0; reg < opcode->NumSrcRegs; ++reg) { + fprintf(f, ", "); + if (inst->Dataflow.SrcReg[reg]) + rc_print_ref(f, inst->Dataflow.SrcReg[reg]); + else + fprintf(f, ""); + } + + fprintf(f, "\n"); + } +} + +/** + * Print program to stderr, default options. + */ +void rc_print_program(const struct rc_program *prog, unsigned int flags) +{ + unsigned int linenum = 0; + struct rc_instruction *inst; + + fprintf(stderr, "# Radeon Compiler Program%s\n", + flags & RC_PRINT_DATAFLOW ? " (with dataflow annotations)" : ""); + + for(inst = prog->Instructions.Next; inst != &prog->Instructions; inst = inst->Next) { + fprintf(stderr, "%3d: ", linenum); + + rc_print_instruction(stderr, flags, inst); + + linenum++; + } +} diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_swizzle.h b/src/mesa/drivers/dri/r300/compiler/radeon_swizzle.h new file mode 100644 index 0000000000..c81d5f7a5e --- /dev/null +++ b/src/mesa/drivers/dri/r300/compiler/radeon_swizzle.h @@ -0,0 +1,57 @@ +/* + * Copyright (C) 2009 Nicolai Haehnle. + * + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 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. + * + */ + +#ifndef RADEON_SWIZZLE_H +#define RADEON_SWIZZLE_H + +#include "radeon_program.h" + +struct rc_swizzle_split { + unsigned char NumPhases; + unsigned char Phase[4]; +}; + +/** + * Describe the swizzling capability of target hardware. + */ +struct rc_swizzle_caps { + /** + * Check whether the given swizzle, absolute and negate combination + * can be implemented natively by the hardware for this opcode. + * + * \return 1 if the swizzle is native for the given opcode + */ + int (*IsNative)(rc_opcode opcode, struct rc_src_register reg); + + /** + * Determine how to split access to the masked channels of the + * given source register to obtain ALU-native swizzles. + */ + void (*Split)(struct rc_src_register reg, unsigned int mask, struct rc_swizzle_split * split); +}; + +#endif /* RADEON_SWIZZLE_H */ diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index be21268ba5..b7d5429dc5 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -41,7 +41,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "tnl/tnl.h" #include "compiler/radeon_compiler.h" -#include "compiler/radeon_nqssadce.h" #include "radeon_mesa_to_rc.h" #include "r300_context.h" #include "r300_state.h" -- cgit v1.2.3 From 0e7953366f2a8ab1b0e885d94f6635c7640b3cc7 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 10 Sep 2009 14:35:33 -0700 Subject: ARB prog parser: Differentiate between used and unused names in the lexer The lexer will return IDENTIFIER only when the name does not have an associated symbol. Otherwise USED_IDENTIFIER is returned. --- src/mesa/shader/lex.yy.c | 366 +++++----- src/mesa/shader/program_lexer.l | 20 +- src/mesa/shader/program_parse.tab.c | 1259 ++++++++++++++++++----------------- src/mesa/shader/program_parse.tab.h | 17 +- src/mesa/shader/program_parse.y | 23 +- 5 files changed, 851 insertions(+), 834 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/lex.yy.c b/src/mesa/shader/lex.yy.c index d71a13c3bd..959eb854d6 100644 --- a/src/mesa/shader/lex.yy.c +++ b/src/mesa/shader/lex.yy.c @@ -1052,8 +1052,7 @@ static yyconst flex_int16_t yy_chk[1352] = if (condition) { \ return token; \ } else { \ - yylval->string = strdup(yytext); \ - return IDENTIFIER; \ + return handle_ident(yyextra, yytext, yylval); \ } \ } while (0) @@ -1077,8 +1076,7 @@ static yyconst flex_int16_t yy_chk[1352] = yylval->temp_inst.Opcode = OPCODE_ ## opcode; \ return token; \ } else { \ - yylval->string = strdup(yytext); \ - return IDENTIFIER; \ + return handle_ident(yyextra, yytext, yylval); \ } \ } while (0) @@ -1127,6 +1125,15 @@ swiz_from_char(char c) return 0; } +static int +handle_ident(struct asm_parser_state *state, const char *text, YYSTYPE *lval) +{ + lval->string = strdup(text); + + return (_mesa_symbol_table_find_symbol(state->st, 0, text) == NULL) + ? IDENTIFIER : USED_IDENTIFIER; +} + #define YY_USER_ACTION \ do { \ yylloc->first_column = yylloc->last_column; \ @@ -1140,7 +1147,7 @@ swiz_from_char(char c) } while(0); #define YY_EXTRA_TYPE struct asm_parser_state * -#line 1144 "lex.yy.c" +#line 1151 "lex.yy.c" #define INITIAL 0 @@ -1386,10 +1393,10 @@ YY_DECL register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 143 "program_lexer.l" +#line 150 "program_lexer.l" -#line 1393 "lex.yy.c" +#line 1400 "lex.yy.c" yylval = yylval_param; @@ -1478,17 +1485,17 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 145 "program_lexer.l" +#line 152 "program_lexer.l" { return ARBvp_10; } YY_BREAK case 2: YY_RULE_SETUP -#line 146 "program_lexer.l" +#line 153 "program_lexer.l" { return ARBfp_10; } YY_BREAK case 3: YY_RULE_SETUP -#line 147 "program_lexer.l" +#line 154 "program_lexer.l" { yylval->integer = at_address; return_token_or_IDENTIFIER(require_ARB_vp, ADDRESS); @@ -1496,685 +1503,682 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 151 "program_lexer.l" +#line 158 "program_lexer.l" { return ALIAS; } YY_BREAK case 5: YY_RULE_SETUP -#line 152 "program_lexer.l" +#line 159 "program_lexer.l" { return ATTRIB; } YY_BREAK case 6: YY_RULE_SETUP -#line 153 "program_lexer.l" +#line 160 "program_lexer.l" { return END; } YY_BREAK case 7: YY_RULE_SETUP -#line 154 "program_lexer.l" +#line 161 "program_lexer.l" { return OPTION; } YY_BREAK case 8: YY_RULE_SETUP -#line 155 "program_lexer.l" +#line 162 "program_lexer.l" { return OUTPUT; } YY_BREAK case 9: YY_RULE_SETUP -#line 156 "program_lexer.l" +#line 163 "program_lexer.l" { return PARAM; } YY_BREAK case 10: YY_RULE_SETUP -#line 157 "program_lexer.l" +#line 164 "program_lexer.l" { yylval->integer = at_temp; return TEMP; } YY_BREAK case 11: YY_RULE_SETUP -#line 159 "program_lexer.l" +#line 166 "program_lexer.l" { return_opcode( 1, VECTOR_OP, ABS, 3); } YY_BREAK case 12: YY_RULE_SETUP -#line 160 "program_lexer.l" +#line 167 "program_lexer.l" { return_opcode( 1, BIN_OP, ADD, 3); } YY_BREAK case 13: YY_RULE_SETUP -#line 161 "program_lexer.l" +#line 168 "program_lexer.l" { return_opcode(require_ARB_vp, ARL, ARL, 3); } YY_BREAK case 14: YY_RULE_SETUP -#line 163 "program_lexer.l" +#line 170 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, CMP, 3); } YY_BREAK case 15: YY_RULE_SETUP -#line 164 "program_lexer.l" +#line 171 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, COS, 3); } YY_BREAK case 16: YY_RULE_SETUP -#line 166 "program_lexer.l" +#line 173 "program_lexer.l" { return_opcode(require_NV_fp, VECTOR_OP, DDX, 3); } YY_BREAK case 17: YY_RULE_SETUP -#line 167 "program_lexer.l" +#line 174 "program_lexer.l" { return_opcode(require_NV_fp, VECTOR_OP, DDY, 3); } YY_BREAK case 18: YY_RULE_SETUP -#line 168 "program_lexer.l" +#line 175 "program_lexer.l" { return_opcode( 1, BIN_OP, DP3, 3); } YY_BREAK case 19: YY_RULE_SETUP -#line 169 "program_lexer.l" +#line 176 "program_lexer.l" { return_opcode( 1, BIN_OP, DP4, 3); } YY_BREAK case 20: YY_RULE_SETUP -#line 170 "program_lexer.l" +#line 177 "program_lexer.l" { return_opcode( 1, BIN_OP, DPH, 3); } YY_BREAK case 21: YY_RULE_SETUP -#line 171 "program_lexer.l" +#line 178 "program_lexer.l" { return_opcode( 1, BIN_OP, DST, 3); } YY_BREAK case 22: YY_RULE_SETUP -#line 173 "program_lexer.l" +#line 180 "program_lexer.l" { return_opcode( 1, SCALAR_OP, EX2, 3); } YY_BREAK case 23: YY_RULE_SETUP -#line 174 "program_lexer.l" +#line 181 "program_lexer.l" { return_opcode(require_ARB_vp, SCALAR_OP, EXP, 3); } YY_BREAK case 24: YY_RULE_SETUP -#line 176 "program_lexer.l" +#line 183 "program_lexer.l" { return_opcode( 1, VECTOR_OP, FLR, 3); } YY_BREAK case 25: YY_RULE_SETUP -#line 177 "program_lexer.l" +#line 184 "program_lexer.l" { return_opcode( 1, VECTOR_OP, FRC, 3); } YY_BREAK case 26: YY_RULE_SETUP -#line 179 "program_lexer.l" +#line 186 "program_lexer.l" { return_opcode(require_ARB_fp, KIL, KIL, 3); } YY_BREAK case 27: YY_RULE_SETUP -#line 181 "program_lexer.l" +#line 188 "program_lexer.l" { return_opcode( 1, VECTOR_OP, LIT, 3); } YY_BREAK case 28: YY_RULE_SETUP -#line 182 "program_lexer.l" +#line 189 "program_lexer.l" { return_opcode( 1, SCALAR_OP, LG2, 3); } YY_BREAK case 29: YY_RULE_SETUP -#line 183 "program_lexer.l" +#line 190 "program_lexer.l" { return_opcode(require_ARB_vp, SCALAR_OP, LOG, 3); } YY_BREAK case 30: YY_RULE_SETUP -#line 184 "program_lexer.l" +#line 191 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, LRP, 3); } YY_BREAK case 31: YY_RULE_SETUP -#line 186 "program_lexer.l" +#line 193 "program_lexer.l" { return_opcode( 1, TRI_OP, MAD, 3); } YY_BREAK case 32: YY_RULE_SETUP -#line 187 "program_lexer.l" +#line 194 "program_lexer.l" { return_opcode( 1, BIN_OP, MAX, 3); } YY_BREAK case 33: YY_RULE_SETUP -#line 188 "program_lexer.l" +#line 195 "program_lexer.l" { return_opcode( 1, BIN_OP, MIN, 3); } YY_BREAK case 34: YY_RULE_SETUP -#line 189 "program_lexer.l" +#line 196 "program_lexer.l" { return_opcode( 1, VECTOR_OP, MOV, 3); } YY_BREAK case 35: YY_RULE_SETUP -#line 190 "program_lexer.l" +#line 197 "program_lexer.l" { return_opcode( 1, BIN_OP, MUL, 3); } YY_BREAK case 36: YY_RULE_SETUP -#line 192 "program_lexer.l" +#line 199 "program_lexer.l" { return_opcode(require_NV_fp, VECTOR_OP, PK2H, 4); } YY_BREAK case 37: YY_RULE_SETUP -#line 193 "program_lexer.l" +#line 200 "program_lexer.l" { return_opcode(require_NV_fp, VECTOR_OP, PK2US, 5); } YY_BREAK case 38: YY_RULE_SETUP -#line 194 "program_lexer.l" +#line 201 "program_lexer.l" { return_opcode(require_NV_fp, VECTOR_OP, PK4B, 4); } YY_BREAK case 39: YY_RULE_SETUP -#line 195 "program_lexer.l" +#line 202 "program_lexer.l" { return_opcode(require_NV_fp, VECTOR_OP, PK4UB, 5); } YY_BREAK case 40: YY_RULE_SETUP -#line 196 "program_lexer.l" +#line 203 "program_lexer.l" { return_opcode( 1, BINSC_OP, POW, 3); } YY_BREAK case 41: YY_RULE_SETUP -#line 198 "program_lexer.l" +#line 205 "program_lexer.l" { return_opcode( 1, SCALAR_OP, RCP, 3); } YY_BREAK case 42: YY_RULE_SETUP -#line 199 "program_lexer.l" +#line 206 "program_lexer.l" { return_opcode(require_NV_fp, BIN_OP, RFL, 3); } YY_BREAK case 43: YY_RULE_SETUP -#line 200 "program_lexer.l" +#line 207 "program_lexer.l" { return_opcode( 1, SCALAR_OP, RSQ, 3); } YY_BREAK case 44: YY_RULE_SETUP -#line 202 "program_lexer.l" +#line 209 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, SCS, 3); } YY_BREAK case 45: YY_RULE_SETUP -#line 203 "program_lexer.l" +#line 210 "program_lexer.l" { return_opcode(require_NV_fp, BIN_OP, SEQ, 3); } YY_BREAK case 46: YY_RULE_SETUP -#line 204 "program_lexer.l" +#line 211 "program_lexer.l" { return_opcode(require_NV_fp, BIN_OP, SFL, 3); } YY_BREAK case 47: YY_RULE_SETUP -#line 205 "program_lexer.l" +#line 212 "program_lexer.l" { return_opcode( 1, BIN_OP, SGE, 3); } YY_BREAK case 48: YY_RULE_SETUP -#line 206 "program_lexer.l" +#line 213 "program_lexer.l" { return_opcode(require_NV_fp, BIN_OP, SGT, 3); } YY_BREAK case 49: YY_RULE_SETUP -#line 207 "program_lexer.l" +#line 214 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, SIN, 3); } YY_BREAK case 50: YY_RULE_SETUP -#line 208 "program_lexer.l" +#line 215 "program_lexer.l" { return_opcode(require_NV_fp, BIN_OP, SLE, 3); } YY_BREAK case 51: YY_RULE_SETUP -#line 209 "program_lexer.l" +#line 216 "program_lexer.l" { return_opcode( 1, BIN_OP, SLT, 3); } YY_BREAK case 52: YY_RULE_SETUP -#line 210 "program_lexer.l" +#line 217 "program_lexer.l" { return_opcode(require_NV_fp, BIN_OP, SNE, 3); } YY_BREAK case 53: YY_RULE_SETUP -#line 211 "program_lexer.l" +#line 218 "program_lexer.l" { return_opcode(require_NV_fp, BIN_OP, STR, 3); } YY_BREAK case 54: YY_RULE_SETUP -#line 212 "program_lexer.l" +#line 219 "program_lexer.l" { return_opcode( 1, BIN_OP, SUB, 3); } YY_BREAK case 55: YY_RULE_SETUP -#line 213 "program_lexer.l" +#line 220 "program_lexer.l" { return_opcode( 1, SWZ, SWZ, 3); } YY_BREAK case 56: YY_RULE_SETUP -#line 215 "program_lexer.l" +#line 222 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, 3); } YY_BREAK case 57: YY_RULE_SETUP -#line 216 "program_lexer.l" +#line 223 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, 3); } YY_BREAK case 58: YY_RULE_SETUP -#line 217 "program_lexer.l" +#line 224 "program_lexer.l" { return_opcode(require_NV_fp, TXD_OP, TXD, 3); } YY_BREAK case 59: YY_RULE_SETUP -#line 218 "program_lexer.l" +#line 225 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, 3); } YY_BREAK case 60: YY_RULE_SETUP -#line 220 "program_lexer.l" +#line 227 "program_lexer.l" { return_opcode(require_NV_fp, SCALAR_OP, UP2H, 4); } YY_BREAK case 61: YY_RULE_SETUP -#line 221 "program_lexer.l" +#line 228 "program_lexer.l" { return_opcode(require_NV_fp, SCALAR_OP, UP2US, 5); } YY_BREAK case 62: YY_RULE_SETUP -#line 223 "program_lexer.l" +#line 230 "program_lexer.l" { return_opcode(require_NV_fp, TRI_OP, X2D, 3); } YY_BREAK case 63: YY_RULE_SETUP -#line 224 "program_lexer.l" +#line 231 "program_lexer.l" { return_opcode( 1, BIN_OP, XPD, 3); } YY_BREAK case 64: YY_RULE_SETUP -#line 226 "program_lexer.l" +#line 233 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_vp, VERTEX); } YY_BREAK case 65: YY_RULE_SETUP -#line 227 "program_lexer.l" +#line 234 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, FRAGMENT); } YY_BREAK case 66: YY_RULE_SETUP -#line 228 "program_lexer.l" +#line 235 "program_lexer.l" { return PROGRAM; } YY_BREAK case 67: YY_RULE_SETUP -#line 229 "program_lexer.l" +#line 236 "program_lexer.l" { return STATE; } YY_BREAK case 68: YY_RULE_SETUP -#line 230 "program_lexer.l" +#line 237 "program_lexer.l" { return RESULT; } YY_BREAK case 69: YY_RULE_SETUP -#line 232 "program_lexer.l" +#line 239 "program_lexer.l" { return AMBIENT; } YY_BREAK case 70: YY_RULE_SETUP -#line 233 "program_lexer.l" +#line 240 "program_lexer.l" { return ATTENUATION; } YY_BREAK case 71: YY_RULE_SETUP -#line 234 "program_lexer.l" +#line 241 "program_lexer.l" { return BACK; } YY_BREAK case 72: YY_RULE_SETUP -#line 235 "program_lexer.l" +#line 242 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, CLIP); } YY_BREAK case 73: YY_RULE_SETUP -#line 236 "program_lexer.l" +#line 243 "program_lexer.l" { return COLOR; } YY_BREAK case 74: YY_RULE_SETUP -#line 237 "program_lexer.l" +#line 244 "program_lexer.l" { return_token_or_DOT(require_ARB_fp, DEPTH); } YY_BREAK case 75: YY_RULE_SETUP -#line 238 "program_lexer.l" +#line 245 "program_lexer.l" { return DIFFUSE; } YY_BREAK case 76: YY_RULE_SETUP -#line 239 "program_lexer.l" +#line 246 "program_lexer.l" { return DIRECTION; } YY_BREAK case 77: YY_RULE_SETUP -#line 240 "program_lexer.l" +#line 247 "program_lexer.l" { return EMISSION; } YY_BREAK case 78: YY_RULE_SETUP -#line 241 "program_lexer.l" +#line 248 "program_lexer.l" { return ENV; } YY_BREAK case 79: YY_RULE_SETUP -#line 242 "program_lexer.l" +#line 249 "program_lexer.l" { return EYE; } YY_BREAK case 80: YY_RULE_SETUP -#line 243 "program_lexer.l" +#line 250 "program_lexer.l" { return FOGCOORD; } YY_BREAK case 81: YY_RULE_SETUP -#line 244 "program_lexer.l" +#line 251 "program_lexer.l" { return FOG; } YY_BREAK case 82: YY_RULE_SETUP -#line 245 "program_lexer.l" +#line 252 "program_lexer.l" { return FRONT; } YY_BREAK case 83: YY_RULE_SETUP -#line 246 "program_lexer.l" +#line 253 "program_lexer.l" { return HALF; } YY_BREAK case 84: YY_RULE_SETUP -#line 247 "program_lexer.l" +#line 254 "program_lexer.l" { return INVERSE; } YY_BREAK case 85: YY_RULE_SETUP -#line 248 "program_lexer.l" +#line 255 "program_lexer.l" { return INVTRANS; } YY_BREAK case 86: YY_RULE_SETUP -#line 249 "program_lexer.l" +#line 256 "program_lexer.l" { return LIGHT; } YY_BREAK case 87: YY_RULE_SETUP -#line 250 "program_lexer.l" +#line 257 "program_lexer.l" { return LIGHTMODEL; } YY_BREAK case 88: YY_RULE_SETUP -#line 251 "program_lexer.l" +#line 258 "program_lexer.l" { return LIGHTPROD; } YY_BREAK case 89: YY_RULE_SETUP -#line 252 "program_lexer.l" +#line 259 "program_lexer.l" { return LOCAL; } YY_BREAK case 90: YY_RULE_SETUP -#line 253 "program_lexer.l" +#line 260 "program_lexer.l" { return MATERIAL; } YY_BREAK case 91: YY_RULE_SETUP -#line 254 "program_lexer.l" +#line 261 "program_lexer.l" { return MAT_PROGRAM; } YY_BREAK case 92: YY_RULE_SETUP -#line 255 "program_lexer.l" +#line 262 "program_lexer.l" { return MATRIX; } YY_BREAK case 93: YY_RULE_SETUP -#line 256 "program_lexer.l" +#line 263 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, MATRIXINDEX); } YY_BREAK case 94: YY_RULE_SETUP -#line 257 "program_lexer.l" +#line 264 "program_lexer.l" { return MODELVIEW; } YY_BREAK case 95: YY_RULE_SETUP -#line 258 "program_lexer.l" +#line 265 "program_lexer.l" { return MVP; } YY_BREAK case 96: YY_RULE_SETUP -#line 259 "program_lexer.l" +#line 266 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, NORMAL); } YY_BREAK case 97: YY_RULE_SETUP -#line 260 "program_lexer.l" +#line 267 "program_lexer.l" { return OBJECT; } YY_BREAK case 98: YY_RULE_SETUP -#line 261 "program_lexer.l" +#line 268 "program_lexer.l" { return PALETTE; } YY_BREAK case 99: YY_RULE_SETUP -#line 262 "program_lexer.l" +#line 269 "program_lexer.l" { return PARAMS; } YY_BREAK case 100: YY_RULE_SETUP -#line 263 "program_lexer.l" +#line 270 "program_lexer.l" { return PLANE; } YY_BREAK case 101: YY_RULE_SETUP -#line 264 "program_lexer.l" +#line 271 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, POINT); } YY_BREAK case 102: YY_RULE_SETUP -#line 265 "program_lexer.l" +#line 272 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, POINTSIZE); } YY_BREAK case 103: YY_RULE_SETUP -#line 266 "program_lexer.l" +#line 273 "program_lexer.l" { return POSITION; } YY_BREAK case 104: YY_RULE_SETUP -#line 267 "program_lexer.l" +#line 274 "program_lexer.l" { return PRIMARY; } YY_BREAK case 105: YY_RULE_SETUP -#line 268 "program_lexer.l" +#line 275 "program_lexer.l" { return PROJECTION; } YY_BREAK case 106: YY_RULE_SETUP -#line 269 "program_lexer.l" +#line 276 "program_lexer.l" { return_token_or_DOT(require_ARB_fp, RANGE); } YY_BREAK case 107: YY_RULE_SETUP -#line 270 "program_lexer.l" +#line 277 "program_lexer.l" { return ROW; } YY_BREAK case 108: YY_RULE_SETUP -#line 271 "program_lexer.l" +#line 278 "program_lexer.l" { return SCENECOLOR; } YY_BREAK case 109: YY_RULE_SETUP -#line 272 "program_lexer.l" +#line 279 "program_lexer.l" { return SECONDARY; } YY_BREAK case 110: YY_RULE_SETUP -#line 273 "program_lexer.l" +#line 280 "program_lexer.l" { return SHININESS; } YY_BREAK case 111: YY_RULE_SETUP -#line 274 "program_lexer.l" +#line 281 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, SIZE); } YY_BREAK case 112: YY_RULE_SETUP -#line 275 "program_lexer.l" +#line 282 "program_lexer.l" { return SPECULAR; } YY_BREAK case 113: YY_RULE_SETUP -#line 276 "program_lexer.l" +#line 283 "program_lexer.l" { return SPOT; } YY_BREAK case 114: YY_RULE_SETUP -#line 277 "program_lexer.l" +#line 284 "program_lexer.l" { return TEXCOORD; } YY_BREAK case 115: YY_RULE_SETUP -#line 278 "program_lexer.l" +#line 285 "program_lexer.l" { return_token_or_DOT(require_ARB_fp, TEXENV); } YY_BREAK case 116: YY_RULE_SETUP -#line 279 "program_lexer.l" +#line 286 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN); } YY_BREAK case 117: YY_RULE_SETUP -#line 280 "program_lexer.l" +#line 287 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN_Q); } YY_BREAK case 118: YY_RULE_SETUP -#line 281 "program_lexer.l" +#line 288 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN_S); } YY_BREAK case 119: YY_RULE_SETUP -#line 282 "program_lexer.l" +#line 289 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN_T); } YY_BREAK case 120: YY_RULE_SETUP -#line 283 "program_lexer.l" +#line 290 "program_lexer.l" { return TEXTURE; } YY_BREAK case 121: YY_RULE_SETUP -#line 284 "program_lexer.l" +#line 291 "program_lexer.l" { return TRANSPOSE; } YY_BREAK case 122: YY_RULE_SETUP -#line 285 "program_lexer.l" +#line 292 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, VTXATTRIB); } YY_BREAK case 123: YY_RULE_SETUP -#line 286 "program_lexer.l" +#line 293 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, WEIGHT); } YY_BREAK case 124: YY_RULE_SETUP -#line 288 "program_lexer.l" +#line 295 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEXTURE_UNIT); } YY_BREAK case 125: YY_RULE_SETUP -#line 289 "program_lexer.l" +#line 296 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_1D); } YY_BREAK case 126: YY_RULE_SETUP -#line 290 "program_lexer.l" +#line 297 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_2D); } YY_BREAK case 127: YY_RULE_SETUP -#line 291 "program_lexer.l" +#line 298 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_3D); } YY_BREAK case 128: YY_RULE_SETUP -#line 292 "program_lexer.l" +#line 299 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_CUBE); } YY_BREAK case 129: YY_RULE_SETUP -#line 293 "program_lexer.l" +#line 300 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_rect, TEX_RECT); } YY_BREAK case 130: YY_RULE_SETUP -#line 294 "program_lexer.l" +#line 301 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW1D); } YY_BREAK case 131: YY_RULE_SETUP -#line 295 "program_lexer.l" +#line 302 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW2D); } YY_BREAK case 132: YY_RULE_SETUP -#line 296 "program_lexer.l" +#line 303 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_rect, TEX_SHADOWRECT); } YY_BREAK case 133: YY_RULE_SETUP -#line 297 "program_lexer.l" +#line 304 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY1D); } YY_BREAK case 134: YY_RULE_SETUP -#line 298 "program_lexer.l" +#line 305 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY2D); } YY_BREAK case 135: YY_RULE_SETUP -#line 299 "program_lexer.l" +#line 306 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW1D); } YY_BREAK case 136: YY_RULE_SETUP -#line 300 "program_lexer.l" +#line 307 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW2D); } YY_BREAK case 137: YY_RULE_SETUP -#line 302 "program_lexer.l" -{ - yylval->string = strdup(yytext); - return IDENTIFIER; -} +#line 309 "program_lexer.l" +{ return handle_ident(yyextra, yytext, yylval); } YY_BREAK case 138: YY_RULE_SETUP -#line 307 "program_lexer.l" +#line 311 "program_lexer.l" { return DOT_DOT; } YY_BREAK case 139: YY_RULE_SETUP -#line 309 "program_lexer.l" +#line 313 "program_lexer.l" { yylval->integer = strtol(yytext, NULL, 10); return INTEGER; @@ -2182,7 +2186,7 @@ YY_RULE_SETUP YY_BREAK case 140: YY_RULE_SETUP -#line 313 "program_lexer.l" +#line 317 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; @@ -2194,7 +2198,7 @@ case 141: yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 317 "program_lexer.l" +#line 321 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; @@ -2202,7 +2206,7 @@ YY_RULE_SETUP YY_BREAK case 142: YY_RULE_SETUP -#line 321 "program_lexer.l" +#line 325 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; @@ -2210,7 +2214,7 @@ YY_RULE_SETUP YY_BREAK case 143: YY_RULE_SETUP -#line 325 "program_lexer.l" +#line 329 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; @@ -2218,7 +2222,7 @@ YY_RULE_SETUP YY_BREAK case 144: YY_RULE_SETUP -#line 330 "program_lexer.l" +#line 334 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; @@ -2227,7 +2231,7 @@ YY_RULE_SETUP YY_BREAK case 145: YY_RULE_SETUP -#line 336 "program_lexer.l" +#line 340 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@ -2237,7 +2241,7 @@ YY_RULE_SETUP YY_BREAK case 146: YY_RULE_SETUP -#line 342 "program_lexer.l" +#line 346 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; @@ -2246,7 +2250,7 @@ YY_RULE_SETUP YY_BREAK case 147: YY_RULE_SETUP -#line 347 "program_lexer.l" +#line 351 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; @@ -2255,7 +2259,7 @@ YY_RULE_SETUP YY_BREAK case 148: YY_RULE_SETUP -#line 353 "program_lexer.l" +#line 357 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@ -2265,7 +2269,7 @@ YY_RULE_SETUP YY_BREAK case 149: YY_RULE_SETUP -#line 359 "program_lexer.l" +#line 363 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@ -2275,7 +2279,7 @@ YY_RULE_SETUP YY_BREAK case 150: YY_RULE_SETUP -#line 365 "program_lexer.l" +#line 369 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; @@ -2284,7 +2288,7 @@ YY_RULE_SETUP YY_BREAK case 151: YY_RULE_SETUP -#line 371 "program_lexer.l" +#line 375 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@ -2294,7 +2298,7 @@ YY_RULE_SETUP YY_BREAK case 152: YY_RULE_SETUP -#line 378 "program_lexer.l" +#line 382 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@ -2306,7 +2310,7 @@ YY_RULE_SETUP YY_BREAK case 153: YY_RULE_SETUP -#line 387 "program_lexer.l" +#line 391 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; @@ -2315,7 +2319,7 @@ YY_RULE_SETUP YY_BREAK case 154: YY_RULE_SETUP -#line 393 "program_lexer.l" +#line 397 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@ -2325,7 +2329,7 @@ YY_RULE_SETUP YY_BREAK case 155: YY_RULE_SETUP -#line 399 "program_lexer.l" +#line 403 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; @@ -2334,7 +2338,7 @@ YY_RULE_SETUP YY_BREAK case 156: YY_RULE_SETUP -#line 404 "program_lexer.l" +#line 408 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; @@ -2343,7 +2347,7 @@ YY_RULE_SETUP YY_BREAK case 157: YY_RULE_SETUP -#line 410 "program_lexer.l" +#line 414 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@ -2353,7 +2357,7 @@ YY_RULE_SETUP YY_BREAK case 158: YY_RULE_SETUP -#line 416 "program_lexer.l" +#line 420 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@ -2363,7 +2367,7 @@ YY_RULE_SETUP YY_BREAK case 159: YY_RULE_SETUP -#line 422 "program_lexer.l" +#line 426 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; @@ -2372,7 +2376,7 @@ YY_RULE_SETUP YY_BREAK case 160: YY_RULE_SETUP -#line 428 "program_lexer.l" +#line 432 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@ -2382,7 +2386,7 @@ YY_RULE_SETUP YY_BREAK case 161: YY_RULE_SETUP -#line 436 "program_lexer.l" +#line 440 "program_lexer.l" { if (require_ARB_vp) { return TEXGEN_R; @@ -2396,7 +2400,7 @@ YY_RULE_SETUP YY_BREAK case 162: YY_RULE_SETUP -#line 447 "program_lexer.l" +#line 451 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@ -2408,13 +2412,13 @@ YY_RULE_SETUP YY_BREAK case 163: YY_RULE_SETUP -#line 456 "program_lexer.l" +#line 460 "program_lexer.l" { return DOT; } YY_BREAK case 164: /* rule 164 can match eol */ YY_RULE_SETUP -#line 458 "program_lexer.l" +#line 462 "program_lexer.l" { yylloc->first_line++; yylloc->first_column = 1; @@ -2425,7 +2429,7 @@ YY_RULE_SETUP YY_BREAK case 165: YY_RULE_SETUP -#line 465 "program_lexer.l" +#line 469 "program_lexer.l" /* eat whitespace */ ; YY_BREAK case 166: @@ -2433,20 +2437,20 @@ case 166: yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 466 "program_lexer.l" +#line 470 "program_lexer.l" /* eat comments */ ; YY_BREAK case 167: YY_RULE_SETUP -#line 467 "program_lexer.l" +#line 471 "program_lexer.l" { return yytext[0]; } YY_BREAK case 168: YY_RULE_SETUP -#line 468 "program_lexer.l" +#line 472 "program_lexer.l" ECHO; YY_BREAK -#line 2450 "lex.yy.c" +#line 2454 "lex.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -3621,7 +3625,7 @@ void yyfree (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 468 "program_lexer.l" +#line 472 "program_lexer.l" diff --git a/src/mesa/shader/program_lexer.l b/src/mesa/shader/program_lexer.l index d7493f42fa..9e68c34ac0 100644 --- a/src/mesa/shader/program_lexer.l +++ b/src/mesa/shader/program_lexer.l @@ -39,8 +39,7 @@ if (condition) { \ return token; \ } else { \ - yylval->string = strdup(yytext); \ - return IDENTIFIER; \ + return handle_ident(yyextra, yytext, yylval); \ } \ } while (0) @@ -64,8 +63,7 @@ yylval->temp_inst.Opcode = OPCODE_ ## opcode; \ return token; \ } else { \ - yylval->string = strdup(yytext); \ - return IDENTIFIER; \ + return handle_ident(yyextra, yytext, yylval); \ } \ } while (0) @@ -114,6 +112,15 @@ swiz_from_char(char c) return 0; } +static int +handle_ident(struct asm_parser_state *state, const char *text, YYSTYPE *lval) +{ + lval->string = strdup(text); + + return (_mesa_symbol_table_find_symbol(state->st, 0, text) == NULL) + ? IDENTIFIER : USED_IDENTIFIER; +} + #define YY_USER_ACTION \ do { \ yylloc->first_column = yylloc->last_column; \ @@ -299,10 +306,7 @@ ARRAY2D { return_token_or_IDENTIFIER(require_ARB_fp && require ARRAYSHADOW1D { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW1D); } ARRAYSHADOW2D { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW2D); } -[_a-zA-Z$][_a-zA-Z0-9$]* { - yylval->string = strdup(yytext); - return IDENTIFIER; -} +[_a-zA-Z$][_a-zA-Z0-9$]* { return handle_ident(yyextra, yytext, yylval); } ".." { return DOT_DOT; } diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index e741e9a13b..d37b20ba42 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -303,13 +303,14 @@ static struct asm_instruction *asm_instruction_copy_ctor( VTXATTRIB = 352, WEIGHT = 353, IDENTIFIER = 354, - MASK4 = 355, - MASK3 = 356, - MASK2 = 357, - MASK1 = 358, - SWIZZLE = 359, - DOT_DOT = 360, - DOT = 361 + USED_IDENTIFIER = 355, + MASK4 = 356, + MASK3 = 357, + MASK2 = 358, + MASK1 = 359, + SWIZZLE = 360, + DOT_DOT = 361, + DOT = 362 }; #endif @@ -349,7 +350,7 @@ typedef union YYSTYPE /* Line 214 of yacc.c */ -#line 353 "program_parse.tab.c" +#line 354 "program_parse.tab.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -373,14 +374,14 @@ typedef struct YYLTYPE /* Copy the second part of user declarations. */ /* Line 264 of yacc.c */ -#line 258 "program_parse.y" +#line 259 "program_parse.y" extern int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, void *yyscanner); /* Line 264 of yacc.c */ -#line 384 "program_parse.tab.c" +#line 385 "program_parse.tab.c" #ifdef short # undef short @@ -597,20 +598,20 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 5 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 383 +#define YYLAST 393 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 117 +#define YYNTOKENS 118 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 137 +#define YYNNTS 138 /* YYNRULES -- Number of rules. */ -#define YYNRULES 272 +#define YYNRULES 274 /* YYNRULES -- Number of states. */ -#define YYNSTATES 458 +#define YYNSTATES 460 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 361 +#define YYMAXUTOK 362 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -622,15 +623,15 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 112, 108, 113, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 107, - 2, 114, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 113, 109, 114, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 108, + 2, 115, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 110, 2, 111, 2, 2, 2, 2, 2, 2, + 2, 111, 2, 112, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 115, 109, 116, 2, 2, 2, 2, + 2, 2, 2, 116, 110, 117, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -654,7 +655,7 @@ static const yytype_uint8 yytranslate[] = 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, - 105, 106 + 105, 106, 107 }; #if YYDEBUG @@ -689,123 +690,123 @@ static const yytype_uint16 yyprhs[] = 686, 690, 694, 696, 702, 705, 708, 711, 714, 718, 721, 725, 726, 728, 730, 731, 733, 735, 736, 738, 740, 741, 743, 745, 746, 750, 751, 755, 756, 760, - 762, 764, 766 + 762, 764, 766, 771, 773 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int16 yyrhs[] = { - 118, 0, -1, 119, 120, 122, 12, -1, 3, -1, - 4, -1, 120, 121, -1, -1, 8, 99, 107, -1, - 122, 123, -1, -1, 124, 107, -1, 162, 107, -1, - 125, -1, 126, -1, 127, -1, 128, -1, 129, -1, - 130, -1, 131, -1, 132, -1, 138, -1, 133, -1, - 134, -1, 135, -1, 19, 143, 108, 139, -1, 18, - 142, 108, 141, -1, 16, 142, 108, 139, -1, 14, - 142, 108, 139, 108, 139, -1, 13, 142, 108, 141, - 108, 141, -1, 17, 142, 108, 141, 108, 141, 108, - 141, -1, 15, 142, 108, 141, 108, 136, 108, 137, - -1, 20, 141, -1, 22, 142, 108, 141, 108, 141, - 108, 141, 108, 136, 108, 137, -1, 83, 248, -1, + 119, 0, -1, 120, 121, 123, 12, -1, 3, -1, + 4, -1, 121, 122, -1, -1, 8, 255, 108, -1, + 123, 124, -1, -1, 125, 108, -1, 163, 108, -1, + 126, -1, 127, -1, 128, -1, 129, -1, 130, -1, + 131, -1, 132, -1, 133, -1, 139, -1, 134, -1, + 135, -1, 136, -1, 19, 144, 109, 140, -1, 18, + 143, 109, 142, -1, 16, 143, 109, 140, -1, 14, + 143, 109, 140, 109, 140, -1, 13, 143, 109, 142, + 109, 142, -1, 17, 143, 109, 142, 109, 142, 109, + 142, -1, 15, 143, 109, 142, 109, 137, 109, 138, + -1, 20, 142, -1, 22, 143, 109, 142, 109, 142, + 109, 142, 109, 137, 109, 138, -1, 83, 249, -1, 84, -1, 85, -1, 86, -1, 87, -1, 88, -1, 89, -1, 90, -1, 91, -1, 92, -1, 93, -1, - 94, -1, 95, -1, 21, 142, 108, 147, 108, 144, - -1, 233, 140, -1, 233, 109, 140, 109, -1, 147, - 159, -1, 230, -1, 233, 147, 160, -1, 233, 109, - 147, 160, 109, -1, 148, 161, -1, 156, 158, -1, - 145, 108, 145, 108, 145, 108, 145, -1, 233, 146, - -1, 23, -1, 99, -1, 99, -1, 164, -1, 149, - 110, 150, 111, -1, 178, -1, 241, -1, 99, -1, - 99, -1, 151, -1, 152, -1, 23, -1, 156, 157, - 153, -1, -1, 112, 154, -1, 113, 155, -1, 23, - -1, 23, -1, 99, -1, 103, -1, 103, -1, 103, - -1, 103, -1, 100, -1, 104, -1, -1, 100, -1, - 101, -1, 102, -1, 103, -1, -1, 163, -1, 170, - -1, 234, -1, 237, -1, 240, -1, 253, -1, 7, - 99, 114, 164, -1, 96, 165, -1, 38, 169, -1, - 60, -1, 98, 167, -1, 53, -1, 29, 246, -1, - 37, -1, 74, 247, -1, 50, 110, 168, 111, -1, - 97, 110, 166, 111, -1, 23, -1, -1, 110, 168, - 111, -1, 23, -1, 60, -1, 29, 246, -1, 37, - -1, 74, 247, -1, 171, -1, 172, -1, 10, 99, - 174, -1, 10, 99, 110, 173, 111, 175, -1, -1, - 23, -1, 114, 177, -1, 114, 115, 176, 116, -1, - 179, -1, 176, 108, 179, -1, 181, -1, 217, -1, - 227, -1, 181, -1, 217, -1, 228, -1, 180, -1, - 218, -1, 227, -1, 181, -1, 73, 205, -1, 73, - 182, -1, 73, 184, -1, 73, 187, -1, 73, 189, - -1, 73, 195, -1, 73, 191, -1, 73, 198, -1, - 73, 200, -1, 73, 202, -1, 73, 204, -1, 73, - 216, -1, 47, 245, 183, -1, 193, -1, 33, -1, - 69, -1, 43, 110, 194, 111, 185, -1, 193, -1, - 60, -1, 26, -1, 72, 186, -1, 40, -1, 32, - -1, 44, 188, -1, 25, -1, 245, 67, -1, 45, - 110, 194, 111, 245, 190, -1, 193, -1, 75, 249, - 192, -1, 29, -1, 25, -1, 31, -1, 71, -1, - 23, -1, 76, 247, 196, 197, -1, 35, -1, 54, + 94, -1, 95, -1, 21, 143, 109, 148, 109, 145, + -1, 234, 141, -1, 234, 110, 141, 110, -1, 148, + 160, -1, 231, -1, 234, 148, 161, -1, 234, 110, + 148, 161, 110, -1, 149, 162, -1, 157, 159, -1, + 146, 109, 146, 109, 146, 109, 146, -1, 234, 147, + -1, 23, -1, 255, -1, 100, -1, 165, -1, 150, + 111, 151, 112, -1, 179, -1, 242, -1, 100, -1, + 100, -1, 152, -1, 153, -1, 23, -1, 157, 158, + 154, -1, -1, 113, 155, -1, 114, 156, -1, 23, + -1, 23, -1, 100, -1, 104, -1, 104, -1, 104, + -1, 104, -1, 101, -1, 105, -1, -1, 101, -1, + 102, -1, 103, -1, 104, -1, -1, 164, -1, 171, + -1, 235, -1, 238, -1, 241, -1, 254, -1, 7, + 99, 115, 165, -1, 96, 166, -1, 38, 170, -1, + 60, -1, 98, 168, -1, 53, -1, 29, 247, -1, + 37, -1, 74, 248, -1, 50, 111, 169, 112, -1, + 97, 111, 167, 112, -1, 23, -1, -1, 111, 169, + 112, -1, 23, -1, 60, -1, 29, 247, -1, 37, + -1, 74, 248, -1, 172, -1, 173, -1, 10, 99, + 175, -1, 10, 99, 111, 174, 112, 176, -1, -1, + 23, -1, 115, 178, -1, 115, 116, 177, 117, -1, + 180, -1, 177, 109, 180, -1, 182, -1, 218, -1, + 228, -1, 182, -1, 218, -1, 229, -1, 181, -1, + 219, -1, 228, -1, 182, -1, 73, 206, -1, 73, + 183, -1, 73, 185, -1, 73, 188, -1, 73, 190, + -1, 73, 196, -1, 73, 192, -1, 73, 199, -1, + 73, 201, -1, 73, 203, -1, 73, 205, -1, 73, + 217, -1, 47, 246, 184, -1, 194, -1, 33, -1, + 69, -1, 43, 111, 195, 112, 186, -1, 194, -1, + 60, -1, 26, -1, 72, 187, -1, 40, -1, 32, + -1, 44, 189, -1, 25, -1, 246, 67, -1, 45, + 111, 195, 112, 246, 191, -1, 194, -1, 75, 250, + 193, -1, 29, -1, 25, -1, 31, -1, 71, -1, + 23, -1, 76, 248, 197, 198, -1, 35, -1, 54, -1, 79, -1, 80, -1, 78, -1, 77, -1, 36, - 199, -1, 29, -1, 56, -1, 28, 110, 201, 111, - 57, -1, 23, -1, 58, 203, -1, 70, -1, 26, - -1, 207, 66, 110, 210, 111, -1, 207, 206, -1, - -1, 66, 110, 210, 105, 210, 111, -1, 49, 211, - 208, -1, -1, 209, -1, 41, -1, 82, -1, 42, - -1, 23, -1, 51, 212, -1, 63, -1, 52, -1, - 81, 247, -1, 55, 110, 214, 111, -1, 48, 110, - 215, 111, -1, -1, 213, -1, 23, -1, 23, -1, - 23, -1, 30, 64, -1, 221, -1, 224, -1, 219, - -1, 222, -1, 62, 34, 110, 220, 111, -1, 225, - -1, 225, 105, 225, -1, 62, 34, 110, 225, 111, - -1, 62, 46, 110, 223, 111, -1, 226, -1, 226, - 105, 226, -1, 62, 46, 110, 226, 111, -1, 23, - -1, 23, -1, 229, -1, 231, -1, 230, -1, 231, - -1, 232, -1, 24, -1, 23, -1, 115, 232, 116, - -1, 115, 232, 108, 232, 116, -1, 115, 232, 108, - 232, 108, 232, 116, -1, 115, 232, 108, 232, 108, - 232, 108, 232, 116, -1, 233, 24, -1, 233, 23, - -1, 112, -1, 113, -1, -1, -1, 236, 11, 235, - 239, -1, 99, -1, -1, -1, 5, 238, 239, -1, - 239, 108, 99, -1, 99, -1, 236, 9, 99, 114, - 241, -1, 65, 60, -1, 65, 37, -1, 65, 242, - -1, 65, 59, -1, 65, 74, 247, -1, 65, 30, - -1, 29, 243, 244, -1, -1, 39, -1, 27, -1, + 200, -1, 29, -1, 56, -1, 28, 111, 202, 112, + 57, -1, 23, -1, 58, 204, -1, 70, -1, 26, + -1, 208, 66, 111, 211, 112, -1, 208, 207, -1, + -1, 66, 111, 211, 106, 211, 112, -1, 49, 212, + 209, -1, -1, 210, -1, 41, -1, 82, -1, 42, + -1, 23, -1, 51, 213, -1, 63, -1, 52, -1, + 81, 248, -1, 55, 111, 215, 112, -1, 48, 111, + 216, 112, -1, -1, 214, -1, 23, -1, 23, -1, + 23, -1, 30, 64, -1, 222, -1, 225, -1, 220, + -1, 223, -1, 62, 34, 111, 221, 112, -1, 226, + -1, 226, 106, 226, -1, 62, 34, 111, 226, 112, + -1, 62, 46, 111, 224, 112, -1, 227, -1, 227, + 106, 227, -1, 62, 46, 111, 227, 112, -1, 23, + -1, 23, -1, 230, -1, 232, -1, 231, -1, 232, + -1, 233, -1, 24, -1, 23, -1, 116, 233, 117, + -1, 116, 233, 109, 233, 117, -1, 116, 233, 109, + 233, 109, 233, 117, -1, 116, 233, 109, 233, 109, + 233, 109, 233, 117, -1, 234, 24, -1, 234, 23, + -1, 113, -1, 114, -1, -1, -1, 237, 11, 236, + 240, -1, 255, -1, -1, -1, 5, 239, 240, -1, + 240, 109, 99, -1, 99, -1, 237, 9, 99, 115, + 242, -1, 65, 60, -1, 65, 37, -1, 65, 243, + -1, 65, 59, -1, 65, 74, 248, -1, 65, 30, + -1, 29, 244, 245, -1, -1, 39, -1, 27, -1, -1, 61, -1, 68, -1, -1, 39, -1, 27, -1, - -1, 61, -1, 68, -1, -1, 110, 250, 111, -1, - -1, 110, 251, 111, -1, -1, 110, 252, 111, -1, - 23, -1, 23, -1, 23, -1, 6, 99, 114, 99, - -1 + -1, 61, -1, 68, -1, -1, 111, 251, 112, -1, + -1, 111, 252, 112, -1, -1, 111, 253, 112, -1, + 23, -1, 23, -1, 23, -1, 6, 99, 115, 100, + -1, 99, -1, 100, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 265, 265, 268, 276, 288, 289, 292, 314, 315, - 318, 333, 336, 341, 348, 349, 350, 351, 352, 353, - 354, 357, 358, 359, 362, 368, 374, 380, 387, 393, - 400, 444, 451, 495, 501, 502, 503, 504, 505, 506, - 507, 508, 509, 510, 511, 512, 515, 527, 535, 552, - 559, 578, 589, 609, 631, 640, 673, 680, 695, 745, - 787, 798, 819, 829, 835, 866, 883, 883, 885, 892, - 904, 905, 906, 909, 921, 933, 951, 962, 974, 976, - 977, 978, 979, 982, 982, 982, 982, 983, 986, 987, - 988, 989, 990, 991, 994, 1012, 1016, 1022, 1026, 1030, - 1034, 1043, 1052, 1056, 1061, 1067, 1078, 1078, 1079, 1081, - 1085, 1089, 1093, 1099, 1099, 1101, 1117, 1140, 1143, 1154, - 1160, 1166, 1167, 1174, 1180, 1186, 1194, 1200, 1206, 1214, - 1220, 1226, 1234, 1235, 1238, 1239, 1240, 1241, 1242, 1243, - 1244, 1245, 1246, 1247, 1248, 1251, 1260, 1264, 1268, 1274, - 1283, 1287, 1291, 1300, 1304, 1310, 1316, 1323, 1328, 1336, - 1346, 1348, 1356, 1362, 1366, 1370, 1376, 1387, 1396, 1400, - 1405, 1409, 1413, 1417, 1423, 1430, 1434, 1440, 1448, 1459, - 1466, 1470, 1476, 1486, 1497, 1501, 1519, 1528, 1531, 1537, - 1541, 1545, 1551, 1562, 1567, 1572, 1577, 1582, 1587, 1595, - 1598, 1603, 1616, 1624, 1635, 1643, 1643, 1645, 1645, 1647, - 1657, 1662, 1669, 1679, 1688, 1693, 1700, 1710, 1720, 1732, - 1732, 1733, 1733, 1735, 1745, 1753, 1763, 1771, 1779, 1788, - 1799, 1803, 1809, 1810, 1811, 1814, 1814, 1817, 1852, 1856, - 1856, 1859, 1865, 1873, 1886, 1895, 1904, 1908, 1917, 1926, - 1937, 1944, 1949, 1958, 1970, 1973, 1982, 1993, 1994, 1995, - 1998, 1999, 2000, 2003, 2004, 2007, 2008, 2011, 2012, 2015, - 2026, 2037, 2048 + 0, 266, 266, 269, 277, 289, 290, 293, 315, 316, + 319, 334, 337, 342, 349, 350, 351, 352, 353, 354, + 355, 358, 359, 360, 363, 369, 375, 381, 388, 394, + 401, 445, 452, 496, 502, 503, 504, 505, 506, 507, + 508, 509, 510, 511, 512, 513, 516, 528, 536, 553, + 560, 579, 590, 610, 632, 641, 674, 681, 696, 746, + 788, 799, 820, 830, 836, 867, 884, 884, 886, 893, + 905, 906, 907, 910, 922, 934, 952, 963, 975, 977, + 978, 979, 980, 983, 983, 983, 983, 984, 987, 988, + 989, 990, 991, 992, 995, 1013, 1017, 1023, 1027, 1031, + 1035, 1044, 1053, 1057, 1062, 1068, 1079, 1079, 1080, 1082, + 1086, 1090, 1094, 1100, 1100, 1102, 1118, 1141, 1144, 1155, + 1161, 1167, 1168, 1175, 1181, 1187, 1195, 1201, 1207, 1215, + 1221, 1227, 1235, 1236, 1239, 1240, 1241, 1242, 1243, 1244, + 1245, 1246, 1247, 1248, 1249, 1252, 1261, 1265, 1269, 1275, + 1284, 1288, 1292, 1301, 1305, 1311, 1317, 1324, 1329, 1337, + 1347, 1349, 1357, 1363, 1367, 1371, 1377, 1388, 1397, 1401, + 1406, 1410, 1414, 1418, 1424, 1431, 1435, 1441, 1449, 1460, + 1467, 1471, 1477, 1487, 1498, 1502, 1520, 1529, 1532, 1538, + 1542, 1546, 1552, 1563, 1568, 1573, 1578, 1583, 1588, 1596, + 1599, 1604, 1617, 1625, 1636, 1644, 1644, 1646, 1646, 1648, + 1658, 1663, 1670, 1680, 1689, 1694, 1701, 1711, 1721, 1733, + 1733, 1734, 1734, 1736, 1746, 1754, 1764, 1772, 1780, 1789, + 1800, 1804, 1810, 1811, 1812, 1815, 1815, 1818, 1853, 1857, + 1857, 1860, 1866, 1874, 1887, 1896, 1905, 1909, 1918, 1927, + 1938, 1945, 1950, 1959, 1971, 1974, 1983, 1994, 1995, 1996, + 1999, 2000, 2001, 2004, 2005, 2008, 2009, 2012, 2013, 2016, + 2027, 2038, 2049, 2070, 2071 }; #endif @@ -830,11 +831,11 @@ static const char *const yytname[] = "TEX_2D", "TEX_3D", "TEX_CUBE", "TEX_RECT", "TEX_SHADOW1D", "TEX_SHADOW2D", "TEX_SHADOWRECT", "TEX_ARRAY1D", "TEX_ARRAY2D", "TEX_ARRAYSHADOW1D", "TEX_ARRAYSHADOW2D", "VERTEX", "VTXATTRIB", - "WEIGHT", "IDENTIFIER", "MASK4", "MASK3", "MASK2", "MASK1", "SWIZZLE", - "DOT_DOT", "DOT", "';'", "','", "'|'", "'['", "']'", "'+'", "'-'", "'='", - "'{'", "'}'", "$accept", "program", "language", "optionSequence", - "option", "statementSequence", "statement", "instruction", - "ALU_instruction", "TexInstruction", "ARL_instruction", + "WEIGHT", "IDENTIFIER", "USED_IDENTIFIER", "MASK4", "MASK3", "MASK2", + "MASK1", "SWIZZLE", "DOT_DOT", "DOT", "';'", "','", "'|'", "'['", "']'", + "'+'", "'-'", "'='", "'{'", "'}'", "$accept", "program", "language", + "optionSequence", "option", "statementSequence", "statement", + "instruction", "ALU_instruction", "TexInstruction", "ARL_instruction", "VECTORop_instruction", "SCALARop_instruction", "BINSCop_instruction", "BINop_instruction", "TRIop_instruction", "SAMPLE_instruction", "KIL_instruction", "TXD_instruction", "texImageUnit", "texTarget", @@ -873,7 +874,7 @@ static const char *const yytname[] = "optResultColorType", "optFaceType", "optColorType", "optTexCoordUnitNum", "optTexImageUnitNum", "optLegacyTexUnitNum", "texCoordUnitNum", "texImageUnitNum", "legacyTexUnitNum", - "ALIAS_statement", 0 + "ALIAS_statement", "string", 0 }; #endif @@ -892,42 +893,42 @@ static const yytype_uint16 yytoknum[] = 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 357, 358, 359, 360, 361, 59, 44, 124, - 91, 93, 43, 45, 61, 123, 125 + 355, 356, 357, 358, 359, 360, 361, 362, 59, 44, + 124, 91, 93, 43, 45, 61, 123, 125 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 117, 118, 119, 119, 120, 120, 121, 122, 122, - 123, 123, 124, 124, 125, 125, 125, 125, 125, 125, - 125, 126, 126, 126, 127, 128, 129, 130, 131, 132, - 133, 134, 135, 136, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 138, 139, 139, 140, - 140, 141, 141, 142, 143, 144, 145, 146, 146, 147, - 147, 147, 147, 148, 148, 149, 150, 150, 151, 152, - 153, 153, 153, 154, 155, 156, 157, 158, 159, 160, - 160, 160, 160, 161, 161, 161, 161, 161, 162, 162, - 162, 162, 162, 162, 163, 164, 164, 165, 165, 165, - 165, 165, 165, 165, 165, 166, 167, 167, 168, 169, - 169, 169, 169, 170, 170, 171, 172, 173, 173, 174, - 175, 176, 176, 177, 177, 177, 178, 178, 178, 179, - 179, 179, 180, 180, 181, 181, 181, 181, 181, 181, - 181, 181, 181, 181, 181, 182, 183, 183, 183, 184, - 185, 185, 185, 185, 185, 186, 187, 188, 188, 189, - 190, 191, 192, 193, 193, 193, 194, 195, 196, 196, - 197, 197, 197, 197, 198, 199, 199, 200, 201, 202, - 203, 203, 204, 205, 206, 206, 207, 208, 208, 209, - 209, 209, 210, 211, 211, 211, 211, 211, 211, 212, - 212, 213, 214, 215, 216, 217, 217, 218, 218, 219, - 220, 220, 221, 222, 223, 223, 224, 225, 226, 227, - 227, 228, 228, 229, 230, 230, 231, 231, 231, 231, - 232, 232, 233, 233, 233, 235, 234, 236, 236, 238, - 237, 239, 239, 240, 241, 241, 241, 241, 241, 241, - 242, 243, 243, 243, 244, 244, 244, 245, 245, 245, - 246, 246, 246, 247, 247, 248, 248, 249, 249, 250, - 251, 252, 253 + 0, 118, 119, 120, 120, 121, 121, 122, 123, 123, + 124, 124, 125, 125, 126, 126, 126, 126, 126, 126, + 126, 127, 127, 127, 128, 129, 130, 131, 132, 133, + 134, 135, 136, 137, 138, 138, 138, 138, 138, 138, + 138, 138, 138, 138, 138, 138, 139, 140, 140, 141, + 141, 142, 142, 143, 144, 145, 146, 147, 147, 148, + 148, 148, 148, 149, 149, 150, 151, 151, 152, 153, + 154, 154, 154, 155, 156, 157, 158, 159, 160, 161, + 161, 161, 161, 162, 162, 162, 162, 162, 163, 163, + 163, 163, 163, 163, 164, 165, 165, 166, 166, 166, + 166, 166, 166, 166, 166, 167, 168, 168, 169, 170, + 170, 170, 170, 171, 171, 172, 173, 174, 174, 175, + 176, 177, 177, 178, 178, 178, 179, 179, 179, 180, + 180, 180, 181, 181, 182, 182, 182, 182, 182, 182, + 182, 182, 182, 182, 182, 183, 184, 184, 184, 185, + 186, 186, 186, 186, 186, 187, 188, 189, 189, 190, + 191, 192, 193, 194, 194, 194, 195, 196, 197, 197, + 198, 198, 198, 198, 199, 200, 200, 201, 202, 203, + 204, 204, 205, 206, 207, 207, 208, 209, 209, 210, + 210, 210, 211, 212, 212, 212, 212, 212, 212, 213, + 213, 214, 215, 216, 217, 218, 218, 219, 219, 220, + 221, 221, 222, 223, 224, 224, 225, 226, 227, 228, + 228, 229, 229, 230, 231, 231, 232, 232, 232, 232, + 233, 233, 234, 234, 234, 236, 235, 237, 237, 239, + 238, 240, 240, 241, 242, 242, 242, 242, 242, 242, + 243, 244, 244, 244, 245, 245, 245, 246, 246, 246, + 247, 247, 247, 248, 248, 249, 249, 250, 250, 251, + 252, 253, 254, 255, 255 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -960,7 +961,7 @@ static const yytype_uint8 yyr2[] = 3, 3, 1, 5, 2, 2, 2, 2, 3, 2, 3, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 3, 0, 3, 0, 3, 1, - 1, 1, 4 + 1, 1, 4, 1, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -969,142 +970,142 @@ static const yytype_uint8 yyr2[] = static const yytype_uint16 yydefact[] = { 0, 3, 4, 0, 6, 1, 9, 0, 5, 238, - 0, 239, 0, 0, 0, 2, 0, 0, 0, 0, - 0, 0, 0, 234, 0, 0, 237, 8, 0, 12, - 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, - 20, 0, 88, 89, 113, 114, 90, 0, 91, 92, - 93, 7, 0, 0, 0, 0, 0, 64, 0, 87, - 63, 0, 0, 0, 0, 0, 75, 0, 0, 232, - 233, 31, 0, 0, 0, 10, 11, 0, 235, 242, - 240, 0, 0, 117, 234, 115, 251, 249, 245, 247, - 244, 263, 246, 234, 83, 84, 85, 86, 53, 234, - 234, 234, 234, 234, 234, 77, 54, 225, 224, 0, - 0, 0, 0, 59, 0, 234, 82, 0, 60, 62, - 126, 127, 205, 206, 128, 221, 222, 0, 234, 0, - 0, 0, 272, 94, 118, 0, 119, 123, 124, 125, - 219, 220, 223, 0, 253, 252, 254, 0, 248, 0, - 0, 0, 0, 26, 0, 25, 24, 260, 111, 109, - 263, 96, 0, 0, 0, 0, 0, 0, 257, 0, - 257, 0, 0, 267, 263, 134, 135, 136, 137, 139, - 138, 140, 141, 142, 143, 0, 144, 260, 101, 0, - 99, 97, 263, 0, 106, 95, 82, 0, 80, 79, - 81, 51, 0, 0, 0, 0, 236, 241, 0, 231, - 230, 255, 256, 250, 269, 0, 234, 234, 0, 47, - 0, 50, 0, 234, 261, 262, 110, 112, 0, 0, - 0, 204, 175, 176, 174, 0, 157, 259, 258, 156, - 0, 0, 0, 0, 199, 195, 0, 194, 263, 187, - 181, 180, 179, 0, 0, 0, 0, 100, 0, 102, - 0, 0, 98, 0, 234, 226, 68, 0, 66, 67, - 0, 234, 234, 243, 0, 116, 264, 28, 27, 0, - 78, 49, 265, 0, 0, 217, 0, 218, 0, 178, - 0, 166, 0, 158, 0, 163, 164, 147, 148, 165, - 145, 146, 0, 201, 193, 200, 0, 196, 189, 191, - 190, 186, 188, 271, 0, 162, 161, 168, 169, 0, - 0, 108, 0, 105, 0, 0, 52, 0, 61, 76, - 70, 46, 0, 0, 0, 234, 48, 0, 33, 0, - 234, 212, 216, 0, 0, 257, 203, 0, 202, 0, - 268, 173, 172, 170, 171, 167, 192, 0, 103, 104, - 107, 234, 227, 0, 0, 69, 234, 57, 58, 56, - 234, 0, 0, 0, 121, 129, 132, 130, 207, 208, - 131, 270, 0, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 30, 29, 177, 152, 154, - 151, 0, 149, 150, 0, 198, 197, 182, 0, 73, - 71, 74, 72, 0, 0, 0, 0, 133, 184, 234, - 120, 266, 155, 153, 159, 160, 234, 228, 234, 0, - 0, 0, 0, 183, 122, 0, 0, 0, 0, 210, - 0, 214, 0, 229, 234, 0, 209, 0, 213, 0, - 0, 55, 32, 211, 215, 0, 0, 185 + 273, 274, 0, 239, 0, 0, 0, 2, 0, 0, + 0, 0, 0, 0, 0, 234, 0, 0, 8, 0, + 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, + 23, 20, 0, 88, 89, 113, 114, 90, 0, 91, + 92, 93, 237, 7, 0, 0, 0, 0, 0, 64, + 0, 87, 63, 0, 0, 0, 0, 0, 75, 0, + 0, 232, 233, 31, 0, 0, 0, 10, 11, 0, + 235, 242, 240, 0, 0, 117, 234, 115, 251, 249, + 245, 247, 244, 263, 246, 234, 83, 84, 85, 86, + 53, 234, 234, 234, 234, 234, 234, 77, 54, 225, + 224, 0, 0, 0, 0, 59, 0, 234, 82, 0, + 60, 62, 126, 127, 205, 206, 128, 221, 222, 0, + 234, 0, 0, 0, 272, 94, 118, 0, 119, 123, + 124, 125, 219, 220, 223, 0, 253, 252, 254, 0, + 248, 0, 0, 0, 0, 26, 0, 25, 24, 260, + 111, 109, 263, 96, 0, 0, 0, 0, 0, 0, + 257, 0, 257, 0, 0, 267, 263, 134, 135, 136, + 137, 139, 138, 140, 141, 142, 143, 0, 144, 260, + 101, 0, 99, 97, 263, 0, 106, 95, 82, 0, + 80, 79, 81, 51, 0, 0, 0, 0, 236, 241, + 0, 231, 230, 255, 256, 250, 269, 0, 234, 234, + 0, 47, 0, 50, 0, 234, 261, 262, 110, 112, + 0, 0, 0, 204, 175, 176, 174, 0, 157, 259, + 258, 156, 0, 0, 0, 0, 199, 195, 0, 194, + 263, 187, 181, 180, 179, 0, 0, 0, 0, 100, + 0, 102, 0, 0, 98, 0, 234, 226, 68, 0, + 66, 67, 0, 234, 234, 243, 0, 116, 264, 28, + 27, 0, 78, 49, 265, 0, 0, 217, 0, 218, + 0, 178, 0, 166, 0, 158, 0, 163, 164, 147, + 148, 165, 145, 146, 0, 201, 193, 200, 0, 196, + 189, 191, 190, 186, 188, 271, 0, 162, 161, 168, + 169, 0, 0, 108, 0, 105, 0, 0, 52, 0, + 61, 76, 70, 46, 0, 0, 0, 234, 48, 0, + 33, 0, 234, 212, 216, 0, 0, 257, 203, 0, + 202, 0, 268, 173, 172, 170, 171, 167, 192, 0, + 103, 104, 107, 234, 227, 0, 0, 69, 234, 57, + 56, 58, 234, 0, 0, 0, 121, 129, 132, 130, + 207, 208, 131, 270, 0, 34, 35, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 30, 29, 177, + 152, 154, 151, 0, 149, 150, 0, 198, 197, 182, + 0, 73, 71, 74, 72, 0, 0, 0, 0, 133, + 184, 234, 120, 266, 155, 153, 159, 160, 234, 228, + 234, 0, 0, 0, 0, 183, 122, 0, 0, 0, + 0, 210, 0, 214, 0, 229, 234, 0, 209, 0, + 213, 0, 0, 55, 32, 211, 215, 0, 0, 185 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 3, 4, 6, 8, 9, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 39, 283, - 395, 40, 150, 219, 71, 58, 67, 331, 332, 369, - 220, 59, 117, 267, 268, 269, 365, 410, 412, 68, - 330, 106, 281, 201, 98, 41, 42, 118, 195, 324, - 262, 322, 161, 43, 44, 45, 135, 85, 275, 373, - 136, 119, 374, 375, 120, 175, 300, 176, 402, 423, - 177, 239, 178, 424, 179, 316, 301, 292, 180, 319, - 355, 181, 234, 182, 290, 183, 252, 184, 417, 433, - 185, 311, 312, 357, 249, 304, 305, 349, 347, 186, - 121, 377, 378, 438, 122, 379, 440, 123, 286, 288, - 380, 124, 140, 125, 126, 142, 72, 46, 130, 47, - 48, 52, 80, 49, 60, 92, 146, 213, 240, 226, - 148, 338, 254, 215, 382, 314, 50 + -1, 3, 4, 6, 8, 9, 28, 29, 30, 31, + 32, 33, 34, 35, 36, 37, 38, 39, 40, 285, + 397, 41, 152, 221, 73, 60, 69, 333, 334, 370, + 222, 61, 119, 269, 270, 271, 367, 412, 414, 70, + 332, 108, 283, 203, 100, 42, 43, 120, 197, 326, + 264, 324, 163, 44, 45, 46, 137, 87, 277, 375, + 138, 121, 376, 377, 122, 177, 302, 178, 404, 425, + 179, 241, 180, 426, 181, 318, 303, 294, 182, 321, + 357, 183, 236, 184, 292, 185, 254, 186, 419, 435, + 187, 313, 314, 359, 251, 306, 307, 351, 349, 188, + 123, 379, 380, 440, 124, 381, 442, 125, 288, 290, + 382, 126, 142, 127, 128, 144, 74, 47, 132, 48, + 49, 54, 82, 50, 62, 94, 148, 215, 242, 228, + 150, 340, 256, 217, 384, 316, 51, 12 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -386 +#define YYPACT_NINF -401 static const yytype_int16 yypact[] = { - 203, -386, -386, 23, -386, -386, 67, -50, -386, 20, - 16, -386, 21, 37, 48, -386, -19, -19, -19, -19, - -19, -19, 58, 131, -19, -19, -386, -386, 53, -386, - -386, -386, -386, -386, -386, -386, -386, -386, -386, -386, - -386, 64, -386, -386, -386, -386, -386, 229, -386, -386, - -386, -386, 77, 81, 89, 78, 95, -386, 75, 130, - -386, 119, 139, 140, 142, 146, -386, 147, 136, -386, - -386, -386, -14, 148, 149, -386, -386, 159, -386, -386, - 152, 162, -20, 239, -6, -386, 31, -386, -386, -386, - -386, 153, -386, 131, -386, -386, -386, -386, -386, 131, - 131, 131, 131, 131, 131, -386, -386, -386, -386, 28, - 50, 123, 40, 154, 30, 131, 101, 155, -386, -386, - -386, -386, -386, -386, -386, -386, -386, 30, 131, 156, - 77, 167, -386, -386, -386, 158, -386, -386, -386, -386, - -386, -386, -386, 218, -386, -386, 13, 244, -386, 160, - 163, -10, 164, -386, 165, -386, -386, 73, -386, -386, - 153, -386, 166, 168, 169, 210, 42, 170, 91, 171, - 100, 145, 38, 173, 153, -386, -386, -386, -386, -386, - -386, -386, -386, -386, -386, 209, -386, 73, -386, 174, - -386, -386, 153, 175, 176, -386, 101, 57, -386, -386, - -386, -386, -16, 179, 180, 225, 152, -386, 177, -386, - -386, -386, -386, -386, -386, 181, 131, 131, 30, -386, - 190, 191, 212, 131, -386, -386, -386, -386, 273, 274, - 275, -386, -386, -386, -386, 276, -386, -386, -386, -386, - 233, 276, 115, 192, 278, -386, 193, -386, 153, 9, - -386, -386, -386, 281, 277, 25, 195, -386, 284, -386, - 285, 284, -386, 200, 131, -386, -386, 199, -386, -386, - 208, 131, 131, -386, 197, -386, -386, -386, -386, 206, - -386, -386, 207, 205, 211, -386, 213, -386, 214, -386, - 215, -386, 216, -386, 217, -386, -386, -386, -386, -386, - -386, -386, 293, -386, -386, -386, 295, -386, -386, -386, - -386, -386, -386, -386, 219, -386, -386, -386, -386, 157, - 297, -386, 220, -386, 221, 222, -386, 66, -386, -386, - 133, -386, 226, -12, 230, 49, -386, 298, -386, 125, - 131, -386, -386, 265, 118, 100, -386, 228, -386, 232, - -386, -386, -386, -386, -386, -386, -386, 234, -386, -386, - -386, 131, -386, 300, 306, -386, 131, -386, -386, -386, - 131, 129, 123, 69, -386, -386, -386, -386, -386, -386, - -386, -386, 235, -386, -386, -386, -386, -386, -386, -386, - -386, -386, -386, -386, -386, -386, -386, -386, -386, -386, - -386, 308, -386, -386, 41, -386, -386, -386, 86, -386, - -386, -386, -386, 240, 241, 231, 237, -386, 286, 49, - -386, -386, -386, -386, -386, -386, 131, -386, 131, 212, - 273, 274, 243, -386, -386, 238, 242, 247, 245, 246, - 248, 252, 297, -386, 131, 125, -386, 273, -386, 274, - 45, -386, -386, -386, -386, 297, 250, -386 + 122, -401, -401, 49, -401, -401, 56, 61, -401, 20, + -401, -401, -5, -401, 7, 45, 78, -401, -47, -47, + -47, -47, -47, -47, 79, 85, -47, -47, -401, 99, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, 127, -401, -401, -401, -401, -401, 120, -401, + -401, -401, -401, -401, 135, 133, 134, 25, 129, -401, + 138, 137, -401, 145, 146, 147, 148, 151, -401, 152, + 154, -401, -401, -401, -14, 153, 155, -401, -401, 143, + -401, -401, 156, 163, 14, 243, 32, -401, 31, -401, + -401, -401, -401, 157, -401, 85, -401, -401, -401, -401, + -401, 85, 85, 85, 85, 85, 85, -401, -401, -401, + -401, 112, 149, 126, 54, 158, 27, 85, 132, 159, + -401, -401, -401, -401, -401, -401, -401, -401, -401, 27, + 85, 160, 135, 168, -401, -401, -401, 161, -401, -401, + -401, -401, -401, -401, -401, 198, -401, -401, 89, 248, + -401, 167, 169, 22, 170, -401, 171, -401, -401, 117, + -401, -401, 157, -401, 172, 173, 174, 208, -1, 175, + 53, 176, 165, 142, -3, 177, 157, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, 215, -401, 117, + -401, 179, -401, -401, 157, 180, 181, -401, 132, -38, + -401, -401, -401, -401, -10, 184, 185, 209, 156, -401, + 182, -401, -401, -401, -401, -401, -401, 183, 85, 85, + 27, -401, 192, 194, 216, 85, -401, -401, -401, -401, + 277, 278, 279, -401, -401, -401, -401, 280, -401, -401, + -401, -401, 237, 280, 68, 195, 282, -401, 196, -401, + 157, 33, -401, -401, -401, 285, 281, 19, 200, -401, + 286, -401, 289, 286, -401, 203, 85, -401, -401, 202, + -401, -401, 212, 85, 85, -401, 201, -401, -401, -401, + -401, 210, -401, -401, 207, 213, 214, -401, 218, -401, + 219, -401, 220, -401, 221, -401, 222, -401, -401, -401, + -401, -401, -401, -401, 296, -401, -401, -401, 298, -401, + -401, -401, -401, -401, -401, -401, 226, -401, -401, -401, + -401, 166, 301, -401, 227, -401, 228, 229, -401, 46, + -401, -401, 116, -401, 217, -12, 234, 51, -401, 302, + -401, 125, 85, -401, -401, 270, 37, 165, -401, 233, + -401, 235, -401, -401, -401, -401, -401, -401, -401, 236, + -401, -401, -401, 85, -401, 305, 323, -401, 85, -401, + -401, -401, 85, 162, 126, 59, -401, -401, -401, -401, + -401, -401, -401, -401, 238, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, 317, -401, -401, 41, -401, -401, -401, + 65, -401, -401, -401, -401, 242, 244, 241, 245, -401, + 288, 51, -401, -401, -401, -401, -401, -401, 85, -401, + 85, 216, 277, 278, 246, -401, -401, 247, 249, 250, + 251, 255, 253, 256, 301, -401, 85, 125, -401, 277, + -401, 278, 94, -401, -401, -401, -401, 301, 254, -401 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -386, -386, -386, -386, -386, -386, -386, -386, -386, -386, - -386, -386, -386, -386, -386, -386, -386, -386, -386, -71, - -80, -386, -96, 144, -81, 204, -386, -386, -350, -386, - -17, -386, -386, -386, -386, -386, -386, -386, -386, 161, - -386, -386, -386, 172, -386, -386, -386, 282, -386, -386, - -386, 105, -386, -386, -386, -386, -386, -386, -386, -386, - -386, -386, -52, -386, -83, -386, -386, -386, -386, -386, - -386, -386, -386, -386, -386, -386, -300, 128, -386, -386, - -386, -386, -386, -386, -386, -386, -386, -386, -386, -386, - -2, -386, -386, -327, -386, -386, -386, -386, -386, -386, - 287, -386, -386, -386, -386, -386, -386, -386, -385, -318, - 288, -386, -386, -145, -82, -112, -84, -386, -386, -386, - -386, -386, 249, -386, 178, -386, -386, -386, -166, 186, - -131, -386, -386, -386, -386, -386, -386 + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -76, + -80, -401, -98, 150, -83, 205, -401, -401, -361, -401, + -18, -401, -401, -401, -401, -401, -401, -401, -401, 164, + -401, -401, -401, 178, -401, -401, -401, 287, -401, -401, + -401, 106, -401, -401, -401, -401, -401, -401, -401, -401, + -401, -401, -49, -401, -85, -401, -401, -401, -401, -401, + -401, -401, -401, -401, -401, -401, -330, 130, -401, -401, + -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, + 0, -401, -401, -400, -401, -401, -401, -401, -401, -401, + 291, -401, -401, -401, -401, -401, -401, -401, -302, -317, + 292, -401, -401, -139, -84, -113, -86, -401, -401, -401, + -401, -401, 252, -401, 186, -401, -401, -401, -166, 190, + -133, -401, -401, -401, -401, -401, -401, -6 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -1114,140 +1115,142 @@ static const yytype_int16 yypgoto[] = #define YYTABLE_NINF -222 static const yytype_int16 yytable[] = { - 143, 137, 141, 197, 242, 153, 221, 266, 156, 107, - 108, 367, 149, 107, 108, 151, 413, 151, 109, 152, - 151, 154, 155, 5, 109, 11, 12, 13, 109, 227, - 14, 143, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 255, 403, 439, 56, 204, 110, 10, - 308, 309, 110, 107, 108, 116, 110, 157, 144, 111, - 317, 259, 453, 111, 250, 158, 295, 111, 109, 187, - 145, 232, 296, 221, 211, 7, 112, 188, 436, 318, - 57, 212, 112, 66, 162, 113, 112, 368, 159, 113, - 189, 310, 110, 190, 451, 114, 163, 196, 233, 218, - 191, 115, 160, 111, 425, 115, 69, 70, 251, 115, - 203, 371, 299, 441, 192, 450, 236, 307, 237, 26, - 53, 278, 372, 51, 86, 87, 112, 237, 456, 113, - 238, 454, 88, 151, 224, 277, 54, 193, 194, 238, - 295, 225, 284, 295, 398, 115, 296, 55, 297, 296, - 455, 164, 327, 165, 89, 90, 407, 66, 399, 166, - 75, 69, 70, 415, 115, 264, 167, 168, 169, 91, - 170, 76, 171, 265, 361, 416, 79, 419, 400, 404, - 143, 172, 362, 93, 298, 420, 299, 333, 83, 299, - 401, 334, 84, 243, 426, 81, 244, 245, 173, 174, - 246, 198, 427, 82, 199, 200, 1, 2, 247, 383, - 384, 385, 386, 387, 388, 389, 390, 391, 392, 393, - 394, 61, 62, 63, 64, 65, 248, 99, 73, 74, - 94, 95, 96, 97, 351, 352, 353, 354, 77, 105, - 78, 209, 210, 69, 70, 363, 364, 100, 101, 408, - 102, 143, 376, 141, 103, 104, 127, 128, 129, 396, - 131, 132, 134, 147, -65, 202, 207, 214, 216, 208, - 205, 217, 222, 223, 231, 256, 228, 143, 229, 230, - 235, 241, 333, 253, 258, 260, 261, 271, 272, 414, - 56, 274, 276, 280, -221, 282, 285, 287, 289, 291, - 293, 303, 302, 306, 313, 320, 315, 321, 323, 326, - 328, 329, 335, 339, 435, 336, 346, 337, 348, 340, - 356, 381, 397, 409, 341, 342, 343, 344, 345, 411, - 350, 358, 359, 360, 366, 143, 376, 141, 370, 405, - 422, 430, 143, 406, 333, 407, 421, 431, 428, 429, - 444, 447, 432, 442, 443, 445, 446, 449, 437, 448, - 333, 457, 279, 270, 133, 452, 325, 434, 263, 294, - 418, 138, 139, 257, 0, 0, 0, 0, 0, 206, - 0, 0, 0, 273 + 145, 139, 143, 52, 199, 155, 244, 415, 158, 109, + 110, 369, 151, 268, 223, 153, 405, 153, 58, 154, + 153, 156, 157, 252, 111, 13, 14, 15, 234, 229, + 16, 145, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 257, 452, 109, 110, 206, 112, 5, + 109, 110, 111, 59, 319, 235, 118, 458, 146, 113, + 111, 261, 297, 400, 7, 111, 297, 253, 298, 438, + 147, 266, 298, 320, 310, 311, 427, 401, 238, 267, + 239, 223, 114, 189, 112, 453, 115, 10, 11, 112, + 68, 190, 240, 297, 112, 113, 116, 402, 198, 298, + 113, 299, 117, 53, 191, 113, 55, 192, 301, 403, + 114, 205, 301, 373, 193, 312, 443, 309, 114, 10, + 11, 280, 115, 114, 374, 1, 2, 115, 194, 79, + 441, 80, 220, 153, 456, 279, 85, 300, 117, 301, + 86, 159, 286, 117, 56, 71, 72, 455, 117, 160, + 213, 195, 196, 329, 166, 363, 167, 214, 88, 89, + 10, 11, 168, 364, 71, 72, 90, 117, 421, 169, + 170, 171, 161, 172, 428, 173, 422, 57, 226, 68, + 145, 406, 429, 164, 174, 227, 162, 335, 91, 92, + 245, 336, 239, 246, 247, 165, 417, 248, 71, 72, + 457, 175, 176, 93, 240, 249, 409, 77, 418, 385, + 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, + 396, 211, 212, 250, 63, 64, 65, 66, 67, 365, + 366, 75, 76, 200, 81, 78, 201, 202, 96, 97, + 98, 99, 131, 353, 354, 355, 356, 95, 83, 84, + 410, 145, 378, 143, 101, 102, 103, 104, 107, 398, + 105, 106, 129, 134, 130, 133, 136, 209, 149, -65, + 204, 216, 233, 210, 58, 207, 218, 145, 219, 224, + 225, 258, 335, 230, 231, 232, 237, 243, 255, 416, + 260, 262, 263, 273, 274, 278, 282, 276, -221, 284, + 287, 289, 291, 293, 295, 305, 304, 308, 315, 323, + 317, 322, 325, 328, 330, 437, 331, 337, 339, 348, + 338, 350, 341, 342, 358, 383, 368, 399, 411, 371, + 343, 344, 345, 346, 347, 145, 378, 143, 352, 360, + 361, 362, 145, 372, 335, 407, 413, 408, 409, 424, + 423, 430, 432, 431, 434, 439, 433, 444, 446, 447, + 335, 449, 451, 448, 445, 450, 459, 454, 272, 327, + 281, 135, 436, 296, 420, 0, 265, 140, 141, 259, + 0, 0, 0, 0, 208, 0, 0, 0, 0, 0, + 0, 0, 0, 275 }; static const yytype_int16 yycheck[] = { - 84, 84, 84, 115, 170, 101, 151, 23, 104, 23, - 24, 23, 93, 23, 24, 99, 366, 101, 38, 100, - 104, 102, 103, 0, 38, 5, 6, 7, 38, 160, - 10, 115, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 174, 344, 430, 65, 128, 62, 99, - 41, 42, 62, 23, 24, 72, 62, 29, 27, 73, - 35, 192, 447, 73, 26, 37, 25, 73, 38, 29, - 39, 29, 31, 218, 61, 8, 96, 37, 428, 54, - 99, 68, 96, 99, 34, 99, 96, 99, 60, 99, - 50, 82, 62, 53, 444, 109, 46, 114, 56, 109, - 60, 115, 74, 73, 404, 115, 112, 113, 70, 115, - 127, 62, 71, 431, 74, 442, 25, 248, 27, 99, - 99, 217, 73, 107, 29, 30, 96, 27, 455, 99, - 39, 449, 37, 217, 61, 216, 99, 97, 98, 39, - 25, 68, 223, 25, 26, 115, 31, 99, 33, 31, - 105, 28, 264, 30, 59, 60, 111, 99, 40, 36, - 107, 112, 113, 34, 115, 108, 43, 44, 45, 74, - 47, 107, 49, 116, 108, 46, 99, 108, 60, 345, - 264, 58, 116, 108, 69, 116, 71, 271, 110, 71, - 72, 272, 114, 48, 108, 114, 51, 52, 75, 76, - 55, 100, 116, 114, 103, 104, 3, 4, 63, 84, + 86, 86, 86, 9, 117, 103, 172, 368, 106, 23, + 24, 23, 95, 23, 153, 101, 346, 103, 65, 102, + 106, 104, 105, 26, 38, 5, 6, 7, 29, 162, + 10, 117, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 176, 444, 23, 24, 130, 62, 0, + 23, 24, 38, 100, 35, 56, 74, 457, 27, 73, + 38, 194, 25, 26, 8, 38, 25, 70, 31, 430, + 39, 109, 31, 54, 41, 42, 406, 40, 25, 117, + 27, 220, 96, 29, 62, 446, 100, 99, 100, 62, + 100, 37, 39, 25, 62, 73, 110, 60, 116, 31, + 73, 33, 116, 108, 50, 73, 99, 53, 71, 72, + 96, 129, 71, 62, 60, 82, 433, 250, 96, 99, + 100, 219, 100, 96, 73, 3, 4, 100, 74, 9, + 432, 11, 110, 219, 451, 218, 111, 69, 116, 71, + 115, 29, 225, 116, 99, 113, 114, 449, 116, 37, + 61, 97, 98, 266, 28, 109, 30, 68, 29, 30, + 99, 100, 36, 117, 113, 114, 37, 116, 109, 43, + 44, 45, 60, 47, 109, 49, 117, 99, 61, 100, + 266, 347, 117, 34, 58, 68, 74, 273, 59, 60, + 48, 274, 27, 51, 52, 46, 34, 55, 113, 114, + 106, 75, 76, 74, 39, 63, 112, 108, 46, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 17, 18, 19, 20, 21, 81, 108, 24, 25, - 100, 101, 102, 103, 77, 78, 79, 80, 9, 103, - 11, 23, 24, 112, 113, 112, 113, 108, 108, 361, - 108, 335, 335, 335, 108, 108, 108, 108, 99, 340, - 108, 99, 23, 110, 110, 110, 99, 23, 108, 111, - 114, 108, 108, 108, 64, 66, 110, 361, 110, 110, - 110, 110, 366, 110, 110, 110, 110, 108, 108, 370, - 65, 114, 111, 103, 103, 83, 23, 23, 23, 23, - 67, 23, 110, 110, 23, 110, 29, 23, 23, 109, - 111, 103, 115, 108, 426, 109, 23, 110, 23, 108, - 23, 23, 57, 23, 111, 111, 111, 111, 111, 23, - 111, 111, 111, 111, 108, 419, 419, 419, 108, 111, - 32, 110, 426, 111, 428, 111, 111, 110, 108, 108, - 108, 105, 66, 110, 116, 108, 111, 105, 429, 111, - 444, 111, 218, 202, 82, 445, 261, 419, 196, 241, - 372, 84, 84, 187, -1, -1, -1, -1, -1, 130, - -1, -1, -1, 205 + 95, 23, 24, 81, 19, 20, 21, 22, 23, 113, + 114, 26, 27, 101, 99, 108, 104, 105, 101, 102, + 103, 104, 99, 77, 78, 79, 80, 109, 115, 115, + 363, 337, 337, 337, 109, 109, 109, 109, 104, 342, + 109, 109, 109, 100, 109, 109, 23, 99, 111, 111, + 111, 23, 64, 112, 65, 115, 109, 363, 109, 109, + 109, 66, 368, 111, 111, 111, 111, 111, 111, 372, + 111, 111, 111, 109, 109, 112, 104, 115, 104, 83, + 23, 23, 23, 23, 67, 23, 111, 111, 23, 23, + 29, 111, 23, 110, 112, 428, 104, 116, 111, 23, + 110, 23, 109, 109, 23, 23, 109, 57, 23, 335, + 112, 112, 112, 112, 112, 421, 421, 421, 112, 112, + 112, 112, 428, 109, 430, 112, 23, 112, 112, 32, + 112, 109, 111, 109, 66, 431, 111, 111, 109, 109, + 446, 106, 106, 112, 117, 112, 112, 447, 204, 263, + 220, 84, 421, 243, 374, -1, 198, 86, 86, 189, + -1, -1, -1, -1, 132, -1, -1, -1, -1, -1, + -1, -1, -1, 207 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 3, 4, 118, 119, 0, 120, 8, 121, 122, - 99, 5, 6, 7, 10, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 99, 123, 124, 125, + 0, 3, 4, 119, 120, 0, 121, 8, 122, 123, + 99, 100, 255, 5, 6, 7, 10, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 138, 162, 163, 170, 171, 172, 234, 236, 237, 240, - 253, 107, 238, 99, 99, 99, 65, 99, 142, 148, - 241, 142, 142, 142, 142, 142, 99, 143, 156, 112, - 113, 141, 233, 142, 142, 107, 107, 9, 11, 99, - 239, 114, 114, 110, 114, 174, 29, 30, 37, 59, - 60, 74, 242, 108, 100, 101, 102, 103, 161, 108, - 108, 108, 108, 108, 108, 103, 158, 23, 24, 38, - 62, 73, 96, 99, 109, 115, 147, 149, 164, 178, - 181, 217, 221, 224, 228, 230, 231, 108, 108, 99, - 235, 108, 99, 164, 23, 173, 177, 181, 217, 227, - 229, 231, 232, 233, 27, 39, 243, 110, 247, 141, - 139, 233, 141, 139, 141, 141, 139, 29, 37, 60, - 74, 169, 34, 46, 28, 30, 36, 43, 44, 45, - 47, 49, 58, 75, 76, 182, 184, 187, 189, 191, - 195, 198, 200, 202, 204, 207, 216, 29, 37, 50, - 53, 60, 74, 97, 98, 165, 147, 232, 100, 103, - 104, 160, 110, 147, 141, 114, 239, 99, 111, 23, - 24, 61, 68, 244, 23, 250, 108, 108, 109, 140, - 147, 230, 108, 108, 61, 68, 246, 247, 110, 110, - 110, 64, 29, 56, 199, 110, 25, 27, 39, 188, - 245, 110, 245, 48, 51, 52, 55, 63, 81, 211, - 26, 70, 203, 110, 249, 247, 66, 246, 110, 247, - 110, 110, 167, 160, 108, 116, 23, 150, 151, 152, - 156, 108, 108, 241, 114, 175, 111, 141, 139, 140, - 103, 159, 83, 136, 141, 23, 225, 23, 226, 23, - 201, 23, 194, 67, 194, 25, 31, 33, 69, 71, - 183, 193, 110, 23, 212, 213, 110, 247, 41, 42, - 82, 208, 209, 23, 252, 29, 192, 35, 54, 196, - 110, 23, 168, 23, 166, 168, 109, 232, 111, 103, - 157, 144, 145, 233, 141, 115, 109, 110, 248, 108, - 108, 111, 111, 111, 111, 111, 23, 215, 23, 214, - 111, 77, 78, 79, 80, 197, 23, 210, 111, 111, - 111, 108, 116, 112, 113, 153, 108, 23, 99, 146, - 108, 62, 73, 176, 179, 180, 181, 218, 219, 222, - 227, 23, 251, 84, 85, 86, 87, 88, 89, 90, - 91, 92, 93, 94, 95, 137, 141, 57, 26, 40, - 60, 72, 185, 193, 245, 111, 111, 111, 232, 23, - 154, 23, 155, 145, 141, 34, 46, 205, 207, 108, - 116, 111, 32, 186, 190, 193, 108, 116, 108, 108, - 110, 110, 66, 206, 179, 232, 145, 136, 220, 225, - 223, 226, 110, 116, 108, 108, 111, 105, 111, 105, - 210, 145, 137, 225, 226, 105, 210, 111 + 136, 139, 163, 164, 171, 172, 173, 235, 237, 238, + 241, 254, 255, 108, 239, 99, 99, 99, 65, 100, + 143, 149, 242, 143, 143, 143, 143, 143, 100, 144, + 157, 113, 114, 142, 234, 143, 143, 108, 108, 9, + 11, 99, 240, 115, 115, 111, 115, 175, 29, 30, + 37, 59, 60, 74, 243, 109, 101, 102, 103, 104, + 162, 109, 109, 109, 109, 109, 109, 104, 159, 23, + 24, 38, 62, 73, 96, 100, 110, 116, 148, 150, + 165, 179, 182, 218, 222, 225, 229, 231, 232, 109, + 109, 99, 236, 109, 100, 165, 23, 174, 178, 182, + 218, 228, 230, 232, 233, 234, 27, 39, 244, 111, + 248, 142, 140, 234, 142, 140, 142, 142, 140, 29, + 37, 60, 74, 170, 34, 46, 28, 30, 36, 43, + 44, 45, 47, 49, 58, 75, 76, 183, 185, 188, + 190, 192, 196, 199, 201, 203, 205, 208, 217, 29, + 37, 50, 53, 60, 74, 97, 98, 166, 148, 233, + 101, 104, 105, 161, 111, 148, 142, 115, 240, 99, + 112, 23, 24, 61, 68, 245, 23, 251, 109, 109, + 110, 141, 148, 231, 109, 109, 61, 68, 247, 248, + 111, 111, 111, 64, 29, 56, 200, 111, 25, 27, + 39, 189, 246, 111, 246, 48, 51, 52, 55, 63, + 81, 212, 26, 70, 204, 111, 250, 248, 66, 247, + 111, 248, 111, 111, 168, 161, 109, 117, 23, 151, + 152, 153, 157, 109, 109, 242, 115, 176, 112, 142, + 140, 141, 104, 160, 83, 137, 142, 23, 226, 23, + 227, 23, 202, 23, 195, 67, 195, 25, 31, 33, + 69, 71, 184, 194, 111, 23, 213, 214, 111, 248, + 41, 42, 82, 209, 210, 23, 253, 29, 193, 35, + 54, 197, 111, 23, 169, 23, 167, 169, 110, 233, + 112, 104, 158, 145, 146, 234, 142, 116, 110, 111, + 249, 109, 109, 112, 112, 112, 112, 112, 23, 216, + 23, 215, 112, 77, 78, 79, 80, 198, 23, 211, + 112, 112, 112, 109, 117, 113, 114, 154, 109, 23, + 147, 255, 109, 62, 73, 177, 180, 181, 182, 219, + 220, 223, 228, 23, 252, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 95, 138, 142, 57, + 26, 40, 60, 72, 186, 194, 246, 112, 112, 112, + 233, 23, 155, 23, 156, 146, 142, 34, 46, 206, + 208, 109, 117, 112, 32, 187, 191, 194, 109, 117, + 109, 109, 111, 111, 66, 207, 180, 233, 146, 137, + 221, 226, 224, 227, 111, 117, 109, 109, 112, 106, + 112, 106, 211, 146, 138, 226, 227, 106, 211, 112 }; #define yyerrok (yyerrstatus = 0) @@ -2101,7 +2104,7 @@ yyreduce: case 3: /* Line 1455 of yacc.c */ -#line 269 "program_parse.y" +#line 270 "program_parse.y" { if (state->prog->Target != GL_VERTEX_PROGRAM_ARB) { yyerror(& (yylsp[(1) - (1)]), state, "invalid fragment program header"); @@ -2114,7 +2117,7 @@ yyreduce: case 4: /* Line 1455 of yacc.c */ -#line 277 "program_parse.y" +#line 278 "program_parse.y" { if (state->prog->Target != GL_FRAGMENT_PROGRAM_ARB) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex program header"); @@ -2129,7 +2132,7 @@ yyreduce: case 7: /* Line 1455 of yacc.c */ -#line 293 "program_parse.y" +#line 294 "program_parse.y" { int valid = 0; @@ -2154,7 +2157,7 @@ yyreduce: case 10: /* Line 1455 of yacc.c */ -#line 319 "program_parse.y" +#line 320 "program_parse.y" { if ((yyvsp[(1) - (2)].inst) != NULL) { if (state->inst_tail == NULL) { @@ -2174,7 +2177,7 @@ yyreduce: case 12: /* Line 1455 of yacc.c */ -#line 337 "program_parse.y" +#line 338 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumAluInstructions++; @@ -2184,7 +2187,7 @@ yyreduce: case 13: /* Line 1455 of yacc.c */ -#line 342 "program_parse.y" +#line 343 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumTexInstructions++; @@ -2194,7 +2197,7 @@ yyreduce: case 24: /* Line 1455 of yacc.c */ -#line 363 "program_parse.y" +#line 364 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_ARL, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} @@ -2203,7 +2206,7 @@ yyreduce: case 25: /* Line 1455 of yacc.c */ -#line 369 "program_parse.y" +#line 370 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (4)].temp_inst), & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} @@ -2212,7 +2215,7 @@ yyreduce: case 26: /* Line 1455 of yacc.c */ -#line 375 "program_parse.y" +#line 376 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (4)].temp_inst), & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} @@ -2221,7 +2224,7 @@ yyreduce: case 27: /* Line 1455 of yacc.c */ -#line 381 "program_parse.y" +#line 382 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (6)].temp_inst), & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); ;} @@ -2230,7 +2233,7 @@ yyreduce: case 28: /* Line 1455 of yacc.c */ -#line 388 "program_parse.y" +#line 389 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (6)].temp_inst), & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); ;} @@ -2239,7 +2242,7 @@ yyreduce: case 29: /* Line 1455 of yacc.c */ -#line 395 "program_parse.y" +#line 396 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (8)].temp_inst), & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), & (yyvsp[(6) - (8)].src_reg), & (yyvsp[(8) - (8)].src_reg)); ;} @@ -2248,7 +2251,7 @@ yyreduce: case 30: /* Line 1455 of yacc.c */ -#line 401 "program_parse.y" +#line 402 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (8)].temp_inst), & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), NULL, NULL); if ((yyval.inst) != NULL) { @@ -2295,7 +2298,7 @@ yyreduce: case 31: /* Line 1455 of yacc.c */ -#line 445 "program_parse.y" +#line 446 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_KIL, NULL, & (yyvsp[(2) - (2)].src_reg), NULL, NULL); state->fragment.UsesKill = 1; @@ -2305,7 +2308,7 @@ yyreduce: case 32: /* Line 1455 of yacc.c */ -#line 452 "program_parse.y" +#line 453 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (12)].temp_inst), & (yyvsp[(2) - (12)].dst_reg), & (yyvsp[(4) - (12)].src_reg), & (yyvsp[(6) - (12)].src_reg), & (yyvsp[(8) - (12)].src_reg)); if ((yyval.inst) != NULL) { @@ -2352,7 +2355,7 @@ yyreduce: case 33: /* Line 1455 of yacc.c */ -#line 496 "program_parse.y" +#line 497 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} @@ -2361,91 +2364,91 @@ yyreduce: case 34: /* Line 1455 of yacc.c */ -#line 501 "program_parse.y" +#line 502 "program_parse.y" { (yyval.integer) = TEXTURE_1D_INDEX; ;} break; case 35: /* Line 1455 of yacc.c */ -#line 502 "program_parse.y" +#line 503 "program_parse.y" { (yyval.integer) = TEXTURE_2D_INDEX; ;} break; case 36: /* Line 1455 of yacc.c */ -#line 503 "program_parse.y" +#line 504 "program_parse.y" { (yyval.integer) = TEXTURE_3D_INDEX; ;} break; case 37: /* Line 1455 of yacc.c */ -#line 504 "program_parse.y" +#line 505 "program_parse.y" { (yyval.integer) = TEXTURE_CUBE_INDEX; ;} break; case 38: /* Line 1455 of yacc.c */ -#line 505 "program_parse.y" +#line 506 "program_parse.y" { (yyval.integer) = TEXTURE_RECT_INDEX; ;} break; case 39: /* Line 1455 of yacc.c */ -#line 506 "program_parse.y" +#line 507 "program_parse.y" { (yyval.integer) = -TEXTURE_1D_INDEX; ;} break; case 40: /* Line 1455 of yacc.c */ -#line 507 "program_parse.y" +#line 508 "program_parse.y" { (yyval.integer) = -TEXTURE_2D_INDEX; ;} break; case 41: /* Line 1455 of yacc.c */ -#line 508 "program_parse.y" +#line 509 "program_parse.y" { (yyval.integer) = -TEXTURE_RECT_INDEX; ;} break; case 42: /* Line 1455 of yacc.c */ -#line 509 "program_parse.y" +#line 510 "program_parse.y" { (yyval.integer) = TEXTURE_1D_ARRAY_INDEX; ;} break; case 43: /* Line 1455 of yacc.c */ -#line 510 "program_parse.y" +#line 511 "program_parse.y" { (yyval.integer) = TEXTURE_2D_ARRAY_INDEX; ;} break; case 44: /* Line 1455 of yacc.c */ -#line 511 "program_parse.y" +#line 512 "program_parse.y" { (yyval.integer) = -TEXTURE_1D_ARRAY_INDEX; ;} break; case 45: /* Line 1455 of yacc.c */ -#line 512 "program_parse.y" +#line 513 "program_parse.y" { (yyval.integer) = -TEXTURE_2D_ARRAY_INDEX; ;} break; case 46: /* Line 1455 of yacc.c */ -#line 516 "program_parse.y" +#line 517 "program_parse.y" { /* FIXME: Is this correct? Should the extenedSwizzle be applied * FIXME: to the existing swizzle? @@ -2460,7 +2463,7 @@ yyreduce: case 47: /* Line 1455 of yacc.c */ -#line 528 "program_parse.y" +#line 529 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (2)].src_reg); @@ -2473,7 +2476,7 @@ yyreduce: case 48: /* Line 1455 of yacc.c */ -#line 536 "program_parse.y" +#line 537 "program_parse.y" { (yyval.src_reg) = (yyvsp[(3) - (4)].src_reg); @@ -2493,7 +2496,7 @@ yyreduce: case 49: /* Line 1455 of yacc.c */ -#line 553 "program_parse.y" +#line 554 "program_parse.y" { (yyval.src_reg) = (yyvsp[(1) - (2)].src_reg); @@ -2505,7 +2508,7 @@ yyreduce: case 50: /* Line 1455 of yacc.c */ -#line 560 "program_parse.y" +#line 561 "program_parse.y" { struct asm_symbol temp_sym; @@ -2527,7 +2530,7 @@ yyreduce: case 51: /* Line 1455 of yacc.c */ -#line 579 "program_parse.y" +#line 580 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); @@ -2543,7 +2546,7 @@ yyreduce: case 52: /* Line 1455 of yacc.c */ -#line 590 "program_parse.y" +#line 591 "program_parse.y" { (yyval.src_reg) = (yyvsp[(3) - (5)].src_reg); @@ -2565,7 +2568,7 @@ yyreduce: case 53: /* Line 1455 of yacc.c */ -#line 610 "program_parse.y" +#line 611 "program_parse.y" { (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); (yyval.dst_reg).WriteMask = (yyvsp[(2) - (2)].swiz_mask).mask; @@ -2590,7 +2593,7 @@ yyreduce: case 54: /* Line 1455 of yacc.c */ -#line 632 "program_parse.y" +#line 633 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_ADDRESS; @@ -2602,7 +2605,7 @@ yyreduce: case 55: /* Line 1455 of yacc.c */ -#line 641 "program_parse.y" +#line 642 "program_parse.y" { const unsigned xyzw_valid = ((yyvsp[(1) - (7)].ext_swizzle).xyzw_valid << 0) @@ -2638,7 +2641,7 @@ yyreduce: case 56: /* Line 1455 of yacc.c */ -#line 674 "program_parse.y" +#line 675 "program_parse.y" { (yyval.ext_swizzle) = (yyvsp[(2) - (2)].ext_swizzle); (yyval.ext_swizzle).negate = ((yyvsp[(1) - (2)].negate)) ? 1 : 0; @@ -2648,7 +2651,7 @@ yyreduce: case 57: /* Line 1455 of yacc.c */ -#line 681 "program_parse.y" +#line 682 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) != 0) && ((yyvsp[(1) - (1)].integer) != 1)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2668,7 +2671,7 @@ yyreduce: case 58: /* Line 1455 of yacc.c */ -#line 696 "program_parse.y" +#line 697 "program_parse.y" { if (strlen((yyvsp[(1) - (1)].string)) > 1) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2721,7 +2724,7 @@ yyreduce: case 59: /* Line 1455 of yacc.c */ -#line 746 "program_parse.y" +#line 747 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2768,7 +2771,7 @@ yyreduce: case 60: /* Line 1455 of yacc.c */ -#line 788 "program_parse.y" +#line 789 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = PROGRAM_INPUT; @@ -2784,7 +2787,7 @@ yyreduce: case 61: /* Line 1455 of yacc.c */ -#line 799 "program_parse.y" +#line 800 "program_parse.y" { if (! (yyvsp[(3) - (4)].src_reg).Base.RelAddr && ((unsigned) (yyvsp[(3) - (4)].src_reg).Base.Index >= (yyvsp[(1) - (4)].sym)->param_binding_length)) { @@ -2810,7 +2813,7 @@ yyreduce: case 62: /* Line 1455 of yacc.c */ -#line 820 "program_parse.y" +#line 821 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = ((yyvsp[(1) - (1)].temp_sym).name != NULL) @@ -2823,7 +2826,7 @@ yyreduce: case 63: /* Line 1455 of yacc.c */ -#line 830 "program_parse.y" +#line 831 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_OUTPUT; @@ -2834,7 +2837,7 @@ yyreduce: case 64: /* Line 1455 of yacc.c */ -#line 836 "program_parse.y" +#line 837 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2868,7 +2871,7 @@ yyreduce: case 65: /* Line 1455 of yacc.c */ -#line 867 "program_parse.y" +#line 868 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2888,7 +2891,7 @@ yyreduce: case 68: /* Line 1455 of yacc.c */ -#line 886 "program_parse.y" +#line 887 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].integer); @@ -2898,7 +2901,7 @@ yyreduce: case 69: /* Line 1455 of yacc.c */ -#line 893 "program_parse.y" +#line 894 "program_parse.y" { /* FINISHME: Add support for multiple address registers. */ @@ -2913,28 +2916,28 @@ yyreduce: case 70: /* Line 1455 of yacc.c */ -#line 904 "program_parse.y" +#line 905 "program_parse.y" { (yyval.integer) = 0; ;} break; case 71: /* Line 1455 of yacc.c */ -#line 905 "program_parse.y" +#line 906 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; case 72: /* Line 1455 of yacc.c */ -#line 906 "program_parse.y" +#line 907 "program_parse.y" { (yyval.integer) = -(yyvsp[(2) - (2)].integer); ;} break; case 73: /* Line 1455 of yacc.c */ -#line 910 "program_parse.y" +#line 911 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 63)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2949,7 +2952,7 @@ yyreduce: case 74: /* Line 1455 of yacc.c */ -#line 922 "program_parse.y" +#line 923 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 64)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2964,7 +2967,7 @@ yyreduce: case 75: /* Line 1455 of yacc.c */ -#line 934 "program_parse.y" +#line 935 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2985,7 +2988,7 @@ yyreduce: case 76: /* Line 1455 of yacc.c */ -#line 952 "program_parse.y" +#line 953 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, "invalid address component selector"); @@ -2999,7 +3002,7 @@ yyreduce: case 77: /* Line 1455 of yacc.c */ -#line 963 "program_parse.y" +#line 964 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, @@ -3014,21 +3017,21 @@ yyreduce: case 82: /* Line 1455 of yacc.c */ -#line 979 "program_parse.y" +#line 980 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 87: /* Line 1455 of yacc.c */ -#line 983 "program_parse.y" +#line 984 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 94: /* Line 1455 of yacc.c */ -#line 995 "program_parse.y" +#line 996 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_attrib, & (yylsp[(2) - (4)])); @@ -3049,7 +3052,7 @@ yyreduce: case 95: /* Line 1455 of yacc.c */ -#line 1013 "program_parse.y" +#line 1014 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} @@ -3058,7 +3061,7 @@ yyreduce: case 96: /* Line 1455 of yacc.c */ -#line 1017 "program_parse.y" +#line 1018 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} @@ -3067,7 +3070,7 @@ yyreduce: case 97: /* Line 1455 of yacc.c */ -#line 1023 "program_parse.y" +#line 1024 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_POS; ;} @@ -3076,7 +3079,7 @@ yyreduce: case 98: /* Line 1455 of yacc.c */ -#line 1027 "program_parse.y" +#line 1028 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_WEIGHT; ;} @@ -3085,7 +3088,7 @@ yyreduce: case 99: /* Line 1455 of yacc.c */ -#line 1031 "program_parse.y" +#line 1032 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_NORMAL; ;} @@ -3094,7 +3097,7 @@ yyreduce: case 100: /* Line 1455 of yacc.c */ -#line 1035 "program_parse.y" +#line 1036 "program_parse.y" { if (!state->ctx->Extensions.EXT_secondary_color) { yyerror(& (yylsp[(2) - (2)]), state, "GL_EXT_secondary_color not supported"); @@ -3108,7 +3111,7 @@ yyreduce: case 101: /* Line 1455 of yacc.c */ -#line 1044 "program_parse.y" +#line 1045 "program_parse.y" { if (!state->ctx->Extensions.EXT_fog_coord) { yyerror(& (yylsp[(1) - (1)]), state, "GL_EXT_fog_coord not supported"); @@ -3122,7 +3125,7 @@ yyreduce: case 102: /* Line 1455 of yacc.c */ -#line 1053 "program_parse.y" +#line 1054 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} @@ -3131,7 +3134,7 @@ yyreduce: case 103: /* Line 1455 of yacc.c */ -#line 1057 "program_parse.y" +#line 1058 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; @@ -3141,7 +3144,7 @@ yyreduce: case 104: /* Line 1455 of yacc.c */ -#line 1062 "program_parse.y" +#line 1063 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_GENERIC0 + (yyvsp[(3) - (4)].integer); ;} @@ -3150,7 +3153,7 @@ yyreduce: case 105: /* Line 1455 of yacc.c */ -#line 1068 "program_parse.y" +#line 1069 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxAttribs) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex attribute reference"); @@ -3164,7 +3167,7 @@ yyreduce: case 109: /* Line 1455 of yacc.c */ -#line 1082 "program_parse.y" +#line 1083 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_WPOS; ;} @@ -3173,7 +3176,7 @@ yyreduce: case 110: /* Line 1455 of yacc.c */ -#line 1086 "program_parse.y" +#line 1087 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_COL0 + (yyvsp[(2) - (2)].integer); ;} @@ -3182,7 +3185,7 @@ yyreduce: case 111: /* Line 1455 of yacc.c */ -#line 1090 "program_parse.y" +#line 1091 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_FOGC; ;} @@ -3191,7 +3194,7 @@ yyreduce: case 112: /* Line 1455 of yacc.c */ -#line 1094 "program_parse.y" +#line 1095 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} @@ -3200,7 +3203,7 @@ yyreduce: case 115: /* Line 1455 of yacc.c */ -#line 1102 "program_parse.y" +#line 1103 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (3)].string), at_param, & (yylsp[(2) - (3)])); @@ -3219,7 +3222,7 @@ yyreduce: case 116: /* Line 1455 of yacc.c */ -#line 1118 "program_parse.y" +#line 1119 "program_parse.y" { if (((yyvsp[(4) - (6)].integer) != 0) && ((unsigned) (yyvsp[(4) - (6)].integer) != (yyvsp[(6) - (6)].temp_sym).param_binding_length)) { yyerror(& (yylsp[(4) - (6)]), state, @@ -3244,7 +3247,7 @@ yyreduce: case 117: /* Line 1455 of yacc.c */ -#line 1140 "program_parse.y" +#line 1141 "program_parse.y" { (yyval.integer) = 0; ;} @@ -3253,7 +3256,7 @@ yyreduce: case 118: /* Line 1455 of yacc.c */ -#line 1144 "program_parse.y" +#line 1145 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 1) || ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxParameters)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid parameter array size"); @@ -3267,7 +3270,7 @@ yyreduce: case 119: /* Line 1455 of yacc.c */ -#line 1155 "program_parse.y" +#line 1156 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(2) - (2)].temp_sym); ;} @@ -3276,7 +3279,7 @@ yyreduce: case 120: /* Line 1455 of yacc.c */ -#line 1161 "program_parse.y" +#line 1162 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(3) - (4)].temp_sym); ;} @@ -3285,7 +3288,7 @@ yyreduce: case 122: /* Line 1455 of yacc.c */ -#line 1168 "program_parse.y" +#line 1169 "program_parse.y" { (yyvsp[(1) - (3)].temp_sym).param_binding_length += (yyvsp[(3) - (3)].temp_sym).param_binding_length; (yyval.temp_sym) = (yyvsp[(1) - (3)].temp_sym); @@ -3295,7 +3298,7 @@ yyreduce: case 123: /* Line 1455 of yacc.c */ -#line 1175 "program_parse.y" +#line 1176 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3306,7 +3309,7 @@ yyreduce: case 124: /* Line 1455 of yacc.c */ -#line 1181 "program_parse.y" +#line 1182 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3317,7 +3320,7 @@ yyreduce: case 125: /* Line 1455 of yacc.c */ -#line 1187 "program_parse.y" +#line 1188 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3328,7 +3331,7 @@ yyreduce: case 126: /* Line 1455 of yacc.c */ -#line 1195 "program_parse.y" +#line 1196 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3339,7 +3342,7 @@ yyreduce: case 127: /* Line 1455 of yacc.c */ -#line 1201 "program_parse.y" +#line 1202 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3350,7 +3353,7 @@ yyreduce: case 128: /* Line 1455 of yacc.c */ -#line 1207 "program_parse.y" +#line 1208 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3361,7 +3364,7 @@ yyreduce: case 129: /* Line 1455 of yacc.c */ -#line 1215 "program_parse.y" +#line 1216 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3372,7 +3375,7 @@ yyreduce: case 130: /* Line 1455 of yacc.c */ -#line 1221 "program_parse.y" +#line 1222 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3383,7 +3386,7 @@ yyreduce: case 131: /* Line 1455 of yacc.c */ -#line 1227 "program_parse.y" +#line 1228 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3394,98 +3397,98 @@ yyreduce: case 132: /* Line 1455 of yacc.c */ -#line 1234 "program_parse.y" +#line 1235 "program_parse.y" { memcpy((yyval.state), (yyvsp[(1) - (1)].state), sizeof((yyval.state))); ;} break; case 133: /* Line 1455 of yacc.c */ -#line 1235 "program_parse.y" +#line 1236 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 134: /* Line 1455 of yacc.c */ -#line 1238 "program_parse.y" +#line 1239 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 135: /* Line 1455 of yacc.c */ -#line 1239 "program_parse.y" +#line 1240 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 136: /* Line 1455 of yacc.c */ -#line 1240 "program_parse.y" +#line 1241 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 137: /* Line 1455 of yacc.c */ -#line 1241 "program_parse.y" +#line 1242 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 138: /* Line 1455 of yacc.c */ -#line 1242 "program_parse.y" +#line 1243 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 139: /* Line 1455 of yacc.c */ -#line 1243 "program_parse.y" +#line 1244 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 140: /* Line 1455 of yacc.c */ -#line 1244 "program_parse.y" +#line 1245 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 141: /* Line 1455 of yacc.c */ -#line 1245 "program_parse.y" +#line 1246 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 142: /* Line 1455 of yacc.c */ -#line 1246 "program_parse.y" +#line 1247 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 143: /* Line 1455 of yacc.c */ -#line 1247 "program_parse.y" +#line 1248 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 144: /* Line 1455 of yacc.c */ -#line 1248 "program_parse.y" +#line 1249 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 145: /* Line 1455 of yacc.c */ -#line 1252 "program_parse.y" +#line 1253 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_MATERIAL; @@ -3497,7 +3500,7 @@ yyreduce: case 146: /* Line 1455 of yacc.c */ -#line 1261 "program_parse.y" +#line 1262 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3506,7 +3509,7 @@ yyreduce: case 147: /* Line 1455 of yacc.c */ -#line 1265 "program_parse.y" +#line 1266 "program_parse.y" { (yyval.integer) = STATE_EMISSION; ;} @@ -3515,7 +3518,7 @@ yyreduce: case 148: /* Line 1455 of yacc.c */ -#line 1269 "program_parse.y" +#line 1270 "program_parse.y" { (yyval.integer) = STATE_SHININESS; ;} @@ -3524,7 +3527,7 @@ yyreduce: case 149: /* Line 1455 of yacc.c */ -#line 1275 "program_parse.y" +#line 1276 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHT; @@ -3536,7 +3539,7 @@ yyreduce: case 150: /* Line 1455 of yacc.c */ -#line 1284 "program_parse.y" +#line 1285 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3545,7 +3548,7 @@ yyreduce: case 151: /* Line 1455 of yacc.c */ -#line 1288 "program_parse.y" +#line 1289 "program_parse.y" { (yyval.integer) = STATE_POSITION; ;} @@ -3554,7 +3557,7 @@ yyreduce: case 152: /* Line 1455 of yacc.c */ -#line 1292 "program_parse.y" +#line 1293 "program_parse.y" { if (!state->ctx->Extensions.EXT_point_parameters) { yyerror(& (yylsp[(1) - (1)]), state, "GL_ARB_point_parameters not supported"); @@ -3568,7 +3571,7 @@ yyreduce: case 153: /* Line 1455 of yacc.c */ -#line 1301 "program_parse.y" +#line 1302 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} @@ -3577,7 +3580,7 @@ yyreduce: case 154: /* Line 1455 of yacc.c */ -#line 1305 "program_parse.y" +#line 1306 "program_parse.y" { (yyval.integer) = STATE_HALF_VECTOR; ;} @@ -3586,7 +3589,7 @@ yyreduce: case 155: /* Line 1455 of yacc.c */ -#line 1311 "program_parse.y" +#line 1312 "program_parse.y" { (yyval.integer) = STATE_SPOT_DIRECTION; ;} @@ -3595,7 +3598,7 @@ yyreduce: case 156: /* Line 1455 of yacc.c */ -#line 1317 "program_parse.y" +#line 1318 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (2)].state)[1]; @@ -3605,7 +3608,7 @@ yyreduce: case 157: /* Line 1455 of yacc.c */ -#line 1324 "program_parse.y" +#line 1325 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_AMBIENT; @@ -3615,7 +3618,7 @@ yyreduce: case 158: /* Line 1455 of yacc.c */ -#line 1329 "program_parse.y" +#line 1330 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_SCENECOLOR; @@ -3626,7 +3629,7 @@ yyreduce: case 159: /* Line 1455 of yacc.c */ -#line 1337 "program_parse.y" +#line 1338 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTPROD; @@ -3639,7 +3642,7 @@ yyreduce: case 161: /* Line 1455 of yacc.c */ -#line 1349 "program_parse.y" +#line 1350 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(3) - (3)].integer); @@ -3650,7 +3653,7 @@ yyreduce: case 162: /* Line 1455 of yacc.c */ -#line 1357 "program_parse.y" +#line 1358 "program_parse.y" { (yyval.integer) = STATE_TEXENV_COLOR; ;} @@ -3659,7 +3662,7 @@ yyreduce: case 163: /* Line 1455 of yacc.c */ -#line 1363 "program_parse.y" +#line 1364 "program_parse.y" { (yyval.integer) = STATE_AMBIENT; ;} @@ -3668,7 +3671,7 @@ yyreduce: case 164: /* Line 1455 of yacc.c */ -#line 1367 "program_parse.y" +#line 1368 "program_parse.y" { (yyval.integer) = STATE_DIFFUSE; ;} @@ -3677,7 +3680,7 @@ yyreduce: case 165: /* Line 1455 of yacc.c */ -#line 1371 "program_parse.y" +#line 1372 "program_parse.y" { (yyval.integer) = STATE_SPECULAR; ;} @@ -3686,7 +3689,7 @@ yyreduce: case 166: /* Line 1455 of yacc.c */ -#line 1377 "program_parse.y" +#line 1378 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxLights) { yyerror(& (yylsp[(1) - (1)]), state, "invalid light selector"); @@ -3700,7 +3703,7 @@ yyreduce: case 167: /* Line 1455 of yacc.c */ -#line 1388 "program_parse.y" +#line 1389 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_TEXGEN; @@ -3712,7 +3715,7 @@ yyreduce: case 168: /* Line 1455 of yacc.c */ -#line 1397 "program_parse.y" +#line 1398 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S; ;} @@ -3721,7 +3724,7 @@ yyreduce: case 169: /* Line 1455 of yacc.c */ -#line 1401 "program_parse.y" +#line 1402 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_OBJECT_S; ;} @@ -3730,7 +3733,7 @@ yyreduce: case 170: /* Line 1455 of yacc.c */ -#line 1406 "program_parse.y" +#line 1407 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S; ;} @@ -3739,7 +3742,7 @@ yyreduce: case 171: /* Line 1455 of yacc.c */ -#line 1410 "program_parse.y" +#line 1411 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S; ;} @@ -3748,7 +3751,7 @@ yyreduce: case 172: /* Line 1455 of yacc.c */ -#line 1414 "program_parse.y" +#line 1415 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S; ;} @@ -3757,7 +3760,7 @@ yyreduce: case 173: /* Line 1455 of yacc.c */ -#line 1418 "program_parse.y" +#line 1419 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S; ;} @@ -3766,7 +3769,7 @@ yyreduce: case 174: /* Line 1455 of yacc.c */ -#line 1424 "program_parse.y" +#line 1425 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); @@ -3776,7 +3779,7 @@ yyreduce: case 175: /* Line 1455 of yacc.c */ -#line 1431 "program_parse.y" +#line 1432 "program_parse.y" { (yyval.integer) = STATE_FOG_COLOR; ;} @@ -3785,7 +3788,7 @@ yyreduce: case 176: /* Line 1455 of yacc.c */ -#line 1435 "program_parse.y" +#line 1436 "program_parse.y" { (yyval.integer) = STATE_FOG_PARAMS; ;} @@ -3794,7 +3797,7 @@ yyreduce: case 177: /* Line 1455 of yacc.c */ -#line 1441 "program_parse.y" +#line 1442 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_CLIPPLANE; @@ -3805,7 +3808,7 @@ yyreduce: case 178: /* Line 1455 of yacc.c */ -#line 1449 "program_parse.y" +#line 1450 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxClipPlanes) { yyerror(& (yylsp[(1) - (1)]), state, "invalid clip plane selector"); @@ -3819,7 +3822,7 @@ yyreduce: case 179: /* Line 1455 of yacc.c */ -#line 1460 "program_parse.y" +#line 1461 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); @@ -3829,7 +3832,7 @@ yyreduce: case 180: /* Line 1455 of yacc.c */ -#line 1467 "program_parse.y" +#line 1468 "program_parse.y" { (yyval.integer) = STATE_POINT_SIZE; ;} @@ -3838,7 +3841,7 @@ yyreduce: case 181: /* Line 1455 of yacc.c */ -#line 1471 "program_parse.y" +#line 1472 "program_parse.y" { (yyval.integer) = STATE_POINT_ATTENUATION; ;} @@ -3847,7 +3850,7 @@ yyreduce: case 182: /* Line 1455 of yacc.c */ -#line 1477 "program_parse.y" +#line 1478 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (5)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (5)].state)[1]; @@ -3860,7 +3863,7 @@ yyreduce: case 183: /* Line 1455 of yacc.c */ -#line 1487 "program_parse.y" +#line 1488 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (2)].state)[1]; @@ -3873,7 +3876,7 @@ yyreduce: case 184: /* Line 1455 of yacc.c */ -#line 1497 "program_parse.y" +#line 1498 "program_parse.y" { (yyval.state)[2] = 0; (yyval.state)[3] = 3; @@ -3883,7 +3886,7 @@ yyreduce: case 185: /* Line 1455 of yacc.c */ -#line 1502 "program_parse.y" +#line 1503 "program_parse.y" { /* It seems logical that the matrix row range specifier would have * to specify a range or more than one row (i.e., $5 > $3). @@ -3904,7 +3907,7 @@ yyreduce: case 186: /* Line 1455 of yacc.c */ -#line 1520 "program_parse.y" +#line 1521 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (3)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (3)].state)[1]; @@ -3915,7 +3918,7 @@ yyreduce: case 187: /* Line 1455 of yacc.c */ -#line 1528 "program_parse.y" +#line 1529 "program_parse.y" { (yyval.integer) = 0; ;} @@ -3924,7 +3927,7 @@ yyreduce: case 188: /* Line 1455 of yacc.c */ -#line 1532 "program_parse.y" +#line 1533 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3933,7 +3936,7 @@ yyreduce: case 189: /* Line 1455 of yacc.c */ -#line 1538 "program_parse.y" +#line 1539 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVERSE; ;} @@ -3942,7 +3945,7 @@ yyreduce: case 190: /* Line 1455 of yacc.c */ -#line 1542 "program_parse.y" +#line 1543 "program_parse.y" { (yyval.integer) = STATE_MATRIX_TRANSPOSE; ;} @@ -3951,7 +3954,7 @@ yyreduce: case 191: /* Line 1455 of yacc.c */ -#line 1546 "program_parse.y" +#line 1547 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVTRANS; ;} @@ -3960,7 +3963,7 @@ yyreduce: case 192: /* Line 1455 of yacc.c */ -#line 1552 "program_parse.y" +#line 1553 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) > 3) { yyerror(& (yylsp[(1) - (1)]), state, "invalid matrix row reference"); @@ -3974,7 +3977,7 @@ yyreduce: case 193: /* Line 1455 of yacc.c */ -#line 1563 "program_parse.y" +#line 1564 "program_parse.y" { (yyval.state)[0] = STATE_MODELVIEW_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); @@ -3984,7 +3987,7 @@ yyreduce: case 194: /* Line 1455 of yacc.c */ -#line 1568 "program_parse.y" +#line 1569 "program_parse.y" { (yyval.state)[0] = STATE_PROJECTION_MATRIX; (yyval.state)[1] = 0; @@ -3994,7 +3997,7 @@ yyreduce: case 195: /* Line 1455 of yacc.c */ -#line 1573 "program_parse.y" +#line 1574 "program_parse.y" { (yyval.state)[0] = STATE_MVP_MATRIX; (yyval.state)[1] = 0; @@ -4004,7 +4007,7 @@ yyreduce: case 196: /* Line 1455 of yacc.c */ -#line 1578 "program_parse.y" +#line 1579 "program_parse.y" { (yyval.state)[0] = STATE_TEXTURE_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); @@ -4014,7 +4017,7 @@ yyreduce: case 197: /* Line 1455 of yacc.c */ -#line 1583 "program_parse.y" +#line 1584 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; @@ -4024,7 +4027,7 @@ yyreduce: case 198: /* Line 1455 of yacc.c */ -#line 1588 "program_parse.y" +#line 1589 "program_parse.y" { (yyval.state)[0] = STATE_PROGRAM_MATRIX; (yyval.state)[1] = (yyvsp[(3) - (4)].integer); @@ -4034,7 +4037,7 @@ yyreduce: case 199: /* Line 1455 of yacc.c */ -#line 1595 "program_parse.y" +#line 1596 "program_parse.y" { (yyval.integer) = 0; ;} @@ -4043,7 +4046,7 @@ yyreduce: case 200: /* Line 1455 of yacc.c */ -#line 1599 "program_parse.y" +#line 1600 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -4052,7 +4055,7 @@ yyreduce: case 201: /* Line 1455 of yacc.c */ -#line 1604 "program_parse.y" +#line 1605 "program_parse.y" { /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix * zero is valid. @@ -4069,7 +4072,7 @@ yyreduce: case 202: /* Line 1455 of yacc.c */ -#line 1617 "program_parse.y" +#line 1618 "program_parse.y" { /* Since GL_ARB_matrix_palette isn't supported, just let any value * through here. The error will be generated later. @@ -4081,7 +4084,7 @@ yyreduce: case 203: /* Line 1455 of yacc.c */ -#line 1625 "program_parse.y" +#line 1626 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxProgramMatrices) { yyerror(& (yylsp[(1) - (1)]), state, "invalid program matrix selector"); @@ -4095,7 +4098,7 @@ yyreduce: case 204: /* Line 1455 of yacc.c */ -#line 1636 "program_parse.y" +#line 1637 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_DEPTH_RANGE; @@ -4105,7 +4108,7 @@ yyreduce: case 209: /* Line 1455 of yacc.c */ -#line 1648 "program_parse.y" +#line 1649 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4118,7 +4121,7 @@ yyreduce: case 210: /* Line 1455 of yacc.c */ -#line 1658 "program_parse.y" +#line 1659 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); @@ -4128,7 +4131,7 @@ yyreduce: case 211: /* Line 1455 of yacc.c */ -#line 1663 "program_parse.y" +#line 1664 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); @@ -4138,7 +4141,7 @@ yyreduce: case 212: /* Line 1455 of yacc.c */ -#line 1670 "program_parse.y" +#line 1671 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4151,7 +4154,7 @@ yyreduce: case 213: /* Line 1455 of yacc.c */ -#line 1680 "program_parse.y" +#line 1681 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4164,7 +4167,7 @@ yyreduce: case 214: /* Line 1455 of yacc.c */ -#line 1689 "program_parse.y" +#line 1690 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); @@ -4174,7 +4177,7 @@ yyreduce: case 215: /* Line 1455 of yacc.c */ -#line 1694 "program_parse.y" +#line 1695 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); @@ -4184,7 +4187,7 @@ yyreduce: case 216: /* Line 1455 of yacc.c */ -#line 1701 "program_parse.y" +#line 1702 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4197,7 +4200,7 @@ yyreduce: case 217: /* Line 1455 of yacc.c */ -#line 1711 "program_parse.y" +#line 1712 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxEnvParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid environment parameter reference"); @@ -4210,7 +4213,7 @@ yyreduce: case 218: /* Line 1455 of yacc.c */ -#line 1721 "program_parse.y" +#line 1722 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxLocalParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid local parameter reference"); @@ -4223,7 +4226,7 @@ yyreduce: case 223: /* Line 1455 of yacc.c */ -#line 1736 "program_parse.y" +#line 1737 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -4236,7 +4239,7 @@ yyreduce: case 224: /* Line 1455 of yacc.c */ -#line 1746 "program_parse.y" +#line 1747 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -4249,7 +4252,7 @@ yyreduce: case 225: /* Line 1455 of yacc.c */ -#line 1754 "program_parse.y" +#line 1755 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (float) (yyvsp[(1) - (1)].integer); @@ -4262,7 +4265,7 @@ yyreduce: case 226: /* Line 1455 of yacc.c */ -#line 1764 "program_parse.y" +#line 1765 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (3)].real); @@ -4275,7 +4278,7 @@ yyreduce: case 227: /* Line 1455 of yacc.c */ -#line 1772 "program_parse.y" +#line 1773 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (5)].real); @@ -4288,7 +4291,7 @@ yyreduce: case 228: /* Line 1455 of yacc.c */ -#line 1781 "program_parse.y" +#line 1782 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (7)].real); @@ -4301,7 +4304,7 @@ yyreduce: case 229: /* Line 1455 of yacc.c */ -#line 1790 "program_parse.y" +#line 1791 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (9)].real); @@ -4314,7 +4317,7 @@ yyreduce: case 230: /* Line 1455 of yacc.c */ -#line 1800 "program_parse.y" +#line 1801 "program_parse.y" { (yyval.real) = ((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].real) : (yyvsp[(2) - (2)].real); ;} @@ -4323,7 +4326,7 @@ yyreduce: case 231: /* Line 1455 of yacc.c */ -#line 1804 "program_parse.y" +#line 1805 "program_parse.y" { (yyval.real) = (float)(((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].integer) : (yyvsp[(2) - (2)].integer)); ;} @@ -4332,35 +4335,35 @@ yyreduce: case 232: /* Line 1455 of yacc.c */ -#line 1809 "program_parse.y" +#line 1810 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 233: /* Line 1455 of yacc.c */ -#line 1810 "program_parse.y" +#line 1811 "program_parse.y" { (yyval.negate) = TRUE; ;} break; case 234: /* Line 1455 of yacc.c */ -#line 1811 "program_parse.y" +#line 1812 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 235: /* Line 1455 of yacc.c */ -#line 1814 "program_parse.y" +#line 1815 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; case 237: /* Line 1455 of yacc.c */ -#line 1818 "program_parse.y" +#line 1819 "program_parse.y" { /* NV_fragment_program_option defines the size qualifiers in a * fairly broken way. "SHORT" or "LONG" can optionally be used @@ -4399,7 +4402,7 @@ yyreduce: case 238: /* Line 1455 of yacc.c */ -#line 1852 "program_parse.y" +#line 1853 "program_parse.y" { ;} break; @@ -4407,14 +4410,14 @@ yyreduce: case 239: /* Line 1455 of yacc.c */ -#line 1856 "program_parse.y" +#line 1857 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 241: /* Line 1455 of yacc.c */ -#line 1860 "program_parse.y" +#line 1861 "program_parse.y" { if (!declare_variable(state, (yyvsp[(3) - (3)].string), (yyvsp[(0) - (3)].integer), & (yylsp[(3) - (3)]))) { YYERROR; @@ -4425,7 +4428,7 @@ yyreduce: case 242: /* Line 1455 of yacc.c */ -#line 1866 "program_parse.y" +#line 1867 "program_parse.y" { if (!declare_variable(state, (yyvsp[(1) - (1)].string), (yyvsp[(0) - (1)].integer), & (yylsp[(1) - (1)]))) { YYERROR; @@ -4436,7 +4439,7 @@ yyreduce: case 243: /* Line 1455 of yacc.c */ -#line 1874 "program_parse.y" +#line 1875 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(3) - (5)].string), at_output, & (yylsp[(3) - (5)])); @@ -4452,7 +4455,7 @@ yyreduce: case 244: /* Line 1455 of yacc.c */ -#line 1887 "program_parse.y" +#line 1888 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_HPOS; @@ -4466,7 +4469,7 @@ yyreduce: case 245: /* Line 1455 of yacc.c */ -#line 1896 "program_parse.y" +#line 1897 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_FOGC; @@ -4480,7 +4483,7 @@ yyreduce: case 246: /* Line 1455 of yacc.c */ -#line 1905 "program_parse.y" +#line 1906 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (2)].result); ;} @@ -4489,7 +4492,7 @@ yyreduce: case 247: /* Line 1455 of yacc.c */ -#line 1909 "program_parse.y" +#line 1910 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_PSIZ; @@ -4503,7 +4506,7 @@ yyreduce: case 248: /* Line 1455 of yacc.c */ -#line 1918 "program_parse.y" +#line 1919 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_TEX0 + (yyvsp[(3) - (3)].integer); @@ -4517,7 +4520,7 @@ yyreduce: case 249: /* Line 1455 of yacc.c */ -#line 1927 "program_parse.y" +#line 1928 "program_parse.y" { if (state->mode == ARB_fragment) { (yyval.result) = FRAG_RESULT_DEPTH; @@ -4531,7 +4534,7 @@ yyreduce: case 250: /* Line 1455 of yacc.c */ -#line 1938 "program_parse.y" +#line 1939 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (3)].integer) + (yyvsp[(3) - (3)].integer); ;} @@ -4540,7 +4543,7 @@ yyreduce: case 251: /* Line 1455 of yacc.c */ -#line 1944 "program_parse.y" +#line 1945 "program_parse.y" { (yyval.integer) = (state->mode == ARB_vertex) ? VERT_RESULT_COL0 @@ -4551,7 +4554,7 @@ yyreduce: case 252: /* Line 1455 of yacc.c */ -#line 1950 "program_parse.y" +#line 1951 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_COL0; @@ -4565,7 +4568,7 @@ yyreduce: case 253: /* Line 1455 of yacc.c */ -#line 1959 "program_parse.y" +#line 1960 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_BFC0; @@ -4579,7 +4582,7 @@ yyreduce: case 254: /* Line 1455 of yacc.c */ -#line 1970 "program_parse.y" +#line 1971 "program_parse.y" { (yyval.integer) = 0; ;} @@ -4588,7 +4591,7 @@ yyreduce: case 255: /* Line 1455 of yacc.c */ -#line 1974 "program_parse.y" +#line 1975 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 0; @@ -4602,7 +4605,7 @@ yyreduce: case 256: /* Line 1455 of yacc.c */ -#line 1983 "program_parse.y" +#line 1984 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 1; @@ -4616,91 +4619,91 @@ yyreduce: case 257: /* Line 1455 of yacc.c */ -#line 1993 "program_parse.y" +#line 1994 "program_parse.y" { (yyval.integer) = 0; ;} break; case 258: /* Line 1455 of yacc.c */ -#line 1994 "program_parse.y" +#line 1995 "program_parse.y" { (yyval.integer) = 0; ;} break; case 259: /* Line 1455 of yacc.c */ -#line 1995 "program_parse.y" +#line 1996 "program_parse.y" { (yyval.integer) = 1; ;} break; case 260: /* Line 1455 of yacc.c */ -#line 1998 "program_parse.y" +#line 1999 "program_parse.y" { (yyval.integer) = 0; ;} break; case 261: /* Line 1455 of yacc.c */ -#line 1999 "program_parse.y" +#line 2000 "program_parse.y" { (yyval.integer) = 0; ;} break; case 262: /* Line 1455 of yacc.c */ -#line 2000 "program_parse.y" +#line 2001 "program_parse.y" { (yyval.integer) = 1; ;} break; case 263: /* Line 1455 of yacc.c */ -#line 2003 "program_parse.y" +#line 2004 "program_parse.y" { (yyval.integer) = 0; ;} break; case 264: /* Line 1455 of yacc.c */ -#line 2004 "program_parse.y" +#line 2005 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 265: /* Line 1455 of yacc.c */ -#line 2007 "program_parse.y" +#line 2008 "program_parse.y" { (yyval.integer) = 0; ;} break; case 266: /* Line 1455 of yacc.c */ -#line 2008 "program_parse.y" +#line 2009 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 267: /* Line 1455 of yacc.c */ -#line 2011 "program_parse.y" +#line 2012 "program_parse.y" { (yyval.integer) = 0; ;} break; case 268: /* Line 1455 of yacc.c */ -#line 2012 "program_parse.y" +#line 2013 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 269: /* Line 1455 of yacc.c */ -#line 2016 "program_parse.y" +#line 2017 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture coordinate unit selector"); @@ -4714,7 +4717,7 @@ yyreduce: case 270: /* Line 1455 of yacc.c */ -#line 2027 "program_parse.y" +#line 2028 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture image unit selector"); @@ -4728,7 +4731,7 @@ yyreduce: case 271: /* Line 1455 of yacc.c */ -#line 2038 "program_parse.y" +#line 2039 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture unit selector"); @@ -4742,7 +4745,7 @@ yyreduce: case 272: /* Line 1455 of yacc.c */ -#line 2049 "program_parse.y" +#line 2050 "program_parse.y" { struct asm_symbol *exist = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(2) - (4)].string)); @@ -4766,7 +4769,7 @@ yyreduce: /* Line 1455 of yacc.c */ -#line 4770 "program_parse.tab.c" +#line 4773 "program_parse.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -4985,7 +4988,7 @@ yyreturn: /* Line 1675 of yacc.c */ -#line 2069 "program_parse.y" +#line 2074 "program_parse.y" void diff --git a/src/mesa/shader/program_parse.tab.h b/src/mesa/shader/program_parse.tab.h index 5f89532d65..c6ed6c777e 100644 --- a/src/mesa/shader/program_parse.tab.h +++ b/src/mesa/shader/program_parse.tab.h @@ -136,13 +136,14 @@ VTXATTRIB = 352, WEIGHT = 353, IDENTIFIER = 354, - MASK4 = 355, - MASK3 = 356, - MASK2 = 357, - MASK1 = 358, - SWIZZLE = 359, - DOT_DOT = 360, - DOT = 361 + USED_IDENTIFIER = 355, + MASK4 = 356, + MASK3 = 357, + MASK2 = 358, + MASK1 = 359, + SWIZZLE = 360, + DOT_DOT = 361, + DOT = 362 }; #endif @@ -182,7 +183,7 @@ typedef union YYSTYPE /* Line 1676 of yacc.c */ -#line 186 "program_parse.tab.h" +#line 187 "program_parse.tab.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 51cc9f7f11..d6bac07081 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -178,7 +178,8 @@ static struct asm_instruction *asm_instruction_copy_ctor( %token VERTEX VTXATTRIB %token WEIGHT -%token IDENTIFIER +%token IDENTIFIER USED_IDENTIFIER +%type string %token MASK4 MASK3 MASK2 MASK1 SWIZZLE %token DOT_DOT %token DOT @@ -289,7 +290,7 @@ optionSequence: optionSequence option | ; -option: OPTION IDENTIFIER ';' +option: OPTION string ';' { int valid = 0; @@ -692,7 +693,7 @@ extSwizSel: INTEGER $$.xyzw_valid = 1; $$.rgba_valid = 1; } - | IDENTIFIER + | string { if (strlen($1) > 1) { yyerror(& @1, state, "invalid extended swizzle selector"); @@ -742,7 +743,7 @@ extSwizSel: INTEGER } ; -srcReg: IDENTIFIER /* temporaryReg | progParamSingle */ +srcReg: USED_IDENTIFIER /* temporaryReg | progParamSingle */ { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, $1); @@ -832,7 +833,7 @@ dstReg: resultBinding $$.File = PROGRAM_OUTPUT; $$.Index = $1; } - | IDENTIFIER /* temporaryReg | vertexResultReg */ + | USED_IDENTIFIER /* temporaryReg | vertexResultReg */ { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, $1); @@ -863,7 +864,7 @@ dstReg: resultBinding } ; -progParamArray: IDENTIFIER +progParamArray: USED_IDENTIFIER { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, $1); @@ -930,7 +931,7 @@ addrRegNegOffset: INTEGER } ; -addrReg: IDENTIFIER +addrReg: USED_IDENTIFIER { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, $1); @@ -1814,7 +1815,7 @@ optionalSign: '+' { $$ = FALSE; } TEMP_statement: optVarSize TEMP { $$ = $2; } varNameList ; -optVarSize: IDENTIFIER +optVarSize: string { /* NV_fragment_program_option defines the size qualifiers in a * fairly broken way. "SHORT" or "LONG" can optionally be used @@ -2045,7 +2046,7 @@ legacyTexUnitNum: INTEGER } ; -ALIAS_statement: ALIAS IDENTIFIER '=' IDENTIFIER +ALIAS_statement: ALIAS IDENTIFIER '=' USED_IDENTIFIER { struct asm_symbol *exist = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, $2); @@ -2066,6 +2067,10 @@ ALIAS_statement: ALIAS IDENTIFIER '=' IDENTIFIER } ; +string: IDENTIFIER + | USED_IDENTIFIER + ; + %% void -- cgit v1.2.3 From cdb719399438194c5e9d5bc1bae3458398fe4e54 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 10 Sep 2009 14:55:36 -0700 Subject: ARB prog lexer: Add missing #include to silence compile warning --- src/mesa/shader/lex.yy.c | 347 ++++++++++++++++++++-------------------- src/mesa/shader/program_lexer.l | 1 + 2 files changed, 175 insertions(+), 173 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/lex.yy.c b/src/mesa/shader/lex.yy.c index 959eb854d6..ba3512365e 100644 --- a/src/mesa/shader/lex.yy.c +++ b/src/mesa/shader/lex.yy.c @@ -1037,6 +1037,7 @@ static yyconst flex_int16_t yy_chk[1352] = #include "main/glheader.h" #include "prog_instruction.h" +#include "symbol_table.h" #include "program_parser.h" #include "program_parse.tab.h" @@ -1147,7 +1148,7 @@ handle_ident(struct asm_parser_state *state, const char *text, YYSTYPE *lval) } while(0); #define YY_EXTRA_TYPE struct asm_parser_state * -#line 1151 "lex.yy.c" +#line 1152 "lex.yy.c" #define INITIAL 0 @@ -1393,10 +1394,10 @@ YY_DECL register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 150 "program_lexer.l" +#line 151 "program_lexer.l" -#line 1400 "lex.yy.c" +#line 1401 "lex.yy.c" yylval = yylval_param; @@ -1485,17 +1486,17 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 152 "program_lexer.l" +#line 153 "program_lexer.l" { return ARBvp_10; } YY_BREAK case 2: YY_RULE_SETUP -#line 153 "program_lexer.l" +#line 154 "program_lexer.l" { return ARBfp_10; } YY_BREAK case 3: YY_RULE_SETUP -#line 154 "program_lexer.l" +#line 155 "program_lexer.l" { yylval->integer = at_address; return_token_or_IDENTIFIER(require_ARB_vp, ADDRESS); @@ -1503,682 +1504,682 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 158 "program_lexer.l" +#line 159 "program_lexer.l" { return ALIAS; } YY_BREAK case 5: YY_RULE_SETUP -#line 159 "program_lexer.l" +#line 160 "program_lexer.l" { return ATTRIB; } YY_BREAK case 6: YY_RULE_SETUP -#line 160 "program_lexer.l" +#line 161 "program_lexer.l" { return END; } YY_BREAK case 7: YY_RULE_SETUP -#line 161 "program_lexer.l" +#line 162 "program_lexer.l" { return OPTION; } YY_BREAK case 8: YY_RULE_SETUP -#line 162 "program_lexer.l" +#line 163 "program_lexer.l" { return OUTPUT; } YY_BREAK case 9: YY_RULE_SETUP -#line 163 "program_lexer.l" +#line 164 "program_lexer.l" { return PARAM; } YY_BREAK case 10: YY_RULE_SETUP -#line 164 "program_lexer.l" +#line 165 "program_lexer.l" { yylval->integer = at_temp; return TEMP; } YY_BREAK case 11: YY_RULE_SETUP -#line 166 "program_lexer.l" +#line 167 "program_lexer.l" { return_opcode( 1, VECTOR_OP, ABS, 3); } YY_BREAK case 12: YY_RULE_SETUP -#line 167 "program_lexer.l" +#line 168 "program_lexer.l" { return_opcode( 1, BIN_OP, ADD, 3); } YY_BREAK case 13: YY_RULE_SETUP -#line 168 "program_lexer.l" +#line 169 "program_lexer.l" { return_opcode(require_ARB_vp, ARL, ARL, 3); } YY_BREAK case 14: YY_RULE_SETUP -#line 170 "program_lexer.l" +#line 171 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, CMP, 3); } YY_BREAK case 15: YY_RULE_SETUP -#line 171 "program_lexer.l" +#line 172 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, COS, 3); } YY_BREAK case 16: YY_RULE_SETUP -#line 173 "program_lexer.l" +#line 174 "program_lexer.l" { return_opcode(require_NV_fp, VECTOR_OP, DDX, 3); } YY_BREAK case 17: YY_RULE_SETUP -#line 174 "program_lexer.l" +#line 175 "program_lexer.l" { return_opcode(require_NV_fp, VECTOR_OP, DDY, 3); } YY_BREAK case 18: YY_RULE_SETUP -#line 175 "program_lexer.l" +#line 176 "program_lexer.l" { return_opcode( 1, BIN_OP, DP3, 3); } YY_BREAK case 19: YY_RULE_SETUP -#line 176 "program_lexer.l" +#line 177 "program_lexer.l" { return_opcode( 1, BIN_OP, DP4, 3); } YY_BREAK case 20: YY_RULE_SETUP -#line 177 "program_lexer.l" +#line 178 "program_lexer.l" { return_opcode( 1, BIN_OP, DPH, 3); } YY_BREAK case 21: YY_RULE_SETUP -#line 178 "program_lexer.l" +#line 179 "program_lexer.l" { return_opcode( 1, BIN_OP, DST, 3); } YY_BREAK case 22: YY_RULE_SETUP -#line 180 "program_lexer.l" +#line 181 "program_lexer.l" { return_opcode( 1, SCALAR_OP, EX2, 3); } YY_BREAK case 23: YY_RULE_SETUP -#line 181 "program_lexer.l" +#line 182 "program_lexer.l" { return_opcode(require_ARB_vp, SCALAR_OP, EXP, 3); } YY_BREAK case 24: YY_RULE_SETUP -#line 183 "program_lexer.l" +#line 184 "program_lexer.l" { return_opcode( 1, VECTOR_OP, FLR, 3); } YY_BREAK case 25: YY_RULE_SETUP -#line 184 "program_lexer.l" +#line 185 "program_lexer.l" { return_opcode( 1, VECTOR_OP, FRC, 3); } YY_BREAK case 26: YY_RULE_SETUP -#line 186 "program_lexer.l" +#line 187 "program_lexer.l" { return_opcode(require_ARB_fp, KIL, KIL, 3); } YY_BREAK case 27: YY_RULE_SETUP -#line 188 "program_lexer.l" +#line 189 "program_lexer.l" { return_opcode( 1, VECTOR_OP, LIT, 3); } YY_BREAK case 28: YY_RULE_SETUP -#line 189 "program_lexer.l" +#line 190 "program_lexer.l" { return_opcode( 1, SCALAR_OP, LG2, 3); } YY_BREAK case 29: YY_RULE_SETUP -#line 190 "program_lexer.l" +#line 191 "program_lexer.l" { return_opcode(require_ARB_vp, SCALAR_OP, LOG, 3); } YY_BREAK case 30: YY_RULE_SETUP -#line 191 "program_lexer.l" +#line 192 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, LRP, 3); } YY_BREAK case 31: YY_RULE_SETUP -#line 193 "program_lexer.l" +#line 194 "program_lexer.l" { return_opcode( 1, TRI_OP, MAD, 3); } YY_BREAK case 32: YY_RULE_SETUP -#line 194 "program_lexer.l" +#line 195 "program_lexer.l" { return_opcode( 1, BIN_OP, MAX, 3); } YY_BREAK case 33: YY_RULE_SETUP -#line 195 "program_lexer.l" +#line 196 "program_lexer.l" { return_opcode( 1, BIN_OP, MIN, 3); } YY_BREAK case 34: YY_RULE_SETUP -#line 196 "program_lexer.l" +#line 197 "program_lexer.l" { return_opcode( 1, VECTOR_OP, MOV, 3); } YY_BREAK case 35: YY_RULE_SETUP -#line 197 "program_lexer.l" +#line 198 "program_lexer.l" { return_opcode( 1, BIN_OP, MUL, 3); } YY_BREAK case 36: YY_RULE_SETUP -#line 199 "program_lexer.l" +#line 200 "program_lexer.l" { return_opcode(require_NV_fp, VECTOR_OP, PK2H, 4); } YY_BREAK case 37: YY_RULE_SETUP -#line 200 "program_lexer.l" +#line 201 "program_lexer.l" { return_opcode(require_NV_fp, VECTOR_OP, PK2US, 5); } YY_BREAK case 38: YY_RULE_SETUP -#line 201 "program_lexer.l" +#line 202 "program_lexer.l" { return_opcode(require_NV_fp, VECTOR_OP, PK4B, 4); } YY_BREAK case 39: YY_RULE_SETUP -#line 202 "program_lexer.l" +#line 203 "program_lexer.l" { return_opcode(require_NV_fp, VECTOR_OP, PK4UB, 5); } YY_BREAK case 40: YY_RULE_SETUP -#line 203 "program_lexer.l" +#line 204 "program_lexer.l" { return_opcode( 1, BINSC_OP, POW, 3); } YY_BREAK case 41: YY_RULE_SETUP -#line 205 "program_lexer.l" +#line 206 "program_lexer.l" { return_opcode( 1, SCALAR_OP, RCP, 3); } YY_BREAK case 42: YY_RULE_SETUP -#line 206 "program_lexer.l" +#line 207 "program_lexer.l" { return_opcode(require_NV_fp, BIN_OP, RFL, 3); } YY_BREAK case 43: YY_RULE_SETUP -#line 207 "program_lexer.l" +#line 208 "program_lexer.l" { return_opcode( 1, SCALAR_OP, RSQ, 3); } YY_BREAK case 44: YY_RULE_SETUP -#line 209 "program_lexer.l" +#line 210 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, SCS, 3); } YY_BREAK case 45: YY_RULE_SETUP -#line 210 "program_lexer.l" +#line 211 "program_lexer.l" { return_opcode(require_NV_fp, BIN_OP, SEQ, 3); } YY_BREAK case 46: YY_RULE_SETUP -#line 211 "program_lexer.l" +#line 212 "program_lexer.l" { return_opcode(require_NV_fp, BIN_OP, SFL, 3); } YY_BREAK case 47: YY_RULE_SETUP -#line 212 "program_lexer.l" +#line 213 "program_lexer.l" { return_opcode( 1, BIN_OP, SGE, 3); } YY_BREAK case 48: YY_RULE_SETUP -#line 213 "program_lexer.l" +#line 214 "program_lexer.l" { return_opcode(require_NV_fp, BIN_OP, SGT, 3); } YY_BREAK case 49: YY_RULE_SETUP -#line 214 "program_lexer.l" +#line 215 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, SIN, 3); } YY_BREAK case 50: YY_RULE_SETUP -#line 215 "program_lexer.l" +#line 216 "program_lexer.l" { return_opcode(require_NV_fp, BIN_OP, SLE, 3); } YY_BREAK case 51: YY_RULE_SETUP -#line 216 "program_lexer.l" +#line 217 "program_lexer.l" { return_opcode( 1, BIN_OP, SLT, 3); } YY_BREAK case 52: YY_RULE_SETUP -#line 217 "program_lexer.l" +#line 218 "program_lexer.l" { return_opcode(require_NV_fp, BIN_OP, SNE, 3); } YY_BREAK case 53: YY_RULE_SETUP -#line 218 "program_lexer.l" +#line 219 "program_lexer.l" { return_opcode(require_NV_fp, BIN_OP, STR, 3); } YY_BREAK case 54: YY_RULE_SETUP -#line 219 "program_lexer.l" +#line 220 "program_lexer.l" { return_opcode( 1, BIN_OP, SUB, 3); } YY_BREAK case 55: YY_RULE_SETUP -#line 220 "program_lexer.l" +#line 221 "program_lexer.l" { return_opcode( 1, SWZ, SWZ, 3); } YY_BREAK case 56: YY_RULE_SETUP -#line 222 "program_lexer.l" +#line 223 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, 3); } YY_BREAK case 57: YY_RULE_SETUP -#line 223 "program_lexer.l" +#line 224 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, 3); } YY_BREAK case 58: YY_RULE_SETUP -#line 224 "program_lexer.l" +#line 225 "program_lexer.l" { return_opcode(require_NV_fp, TXD_OP, TXD, 3); } YY_BREAK case 59: YY_RULE_SETUP -#line 225 "program_lexer.l" +#line 226 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, 3); } YY_BREAK case 60: YY_RULE_SETUP -#line 227 "program_lexer.l" +#line 228 "program_lexer.l" { return_opcode(require_NV_fp, SCALAR_OP, UP2H, 4); } YY_BREAK case 61: YY_RULE_SETUP -#line 228 "program_lexer.l" +#line 229 "program_lexer.l" { return_opcode(require_NV_fp, SCALAR_OP, UP2US, 5); } YY_BREAK case 62: YY_RULE_SETUP -#line 230 "program_lexer.l" +#line 231 "program_lexer.l" { return_opcode(require_NV_fp, TRI_OP, X2D, 3); } YY_BREAK case 63: YY_RULE_SETUP -#line 231 "program_lexer.l" +#line 232 "program_lexer.l" { return_opcode( 1, BIN_OP, XPD, 3); } YY_BREAK case 64: YY_RULE_SETUP -#line 233 "program_lexer.l" +#line 234 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_vp, VERTEX); } YY_BREAK case 65: YY_RULE_SETUP -#line 234 "program_lexer.l" +#line 235 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, FRAGMENT); } YY_BREAK case 66: YY_RULE_SETUP -#line 235 "program_lexer.l" +#line 236 "program_lexer.l" { return PROGRAM; } YY_BREAK case 67: YY_RULE_SETUP -#line 236 "program_lexer.l" +#line 237 "program_lexer.l" { return STATE; } YY_BREAK case 68: YY_RULE_SETUP -#line 237 "program_lexer.l" +#line 238 "program_lexer.l" { return RESULT; } YY_BREAK case 69: YY_RULE_SETUP -#line 239 "program_lexer.l" +#line 240 "program_lexer.l" { return AMBIENT; } YY_BREAK case 70: YY_RULE_SETUP -#line 240 "program_lexer.l" +#line 241 "program_lexer.l" { return ATTENUATION; } YY_BREAK case 71: YY_RULE_SETUP -#line 241 "program_lexer.l" +#line 242 "program_lexer.l" { return BACK; } YY_BREAK case 72: YY_RULE_SETUP -#line 242 "program_lexer.l" +#line 243 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, CLIP); } YY_BREAK case 73: YY_RULE_SETUP -#line 243 "program_lexer.l" +#line 244 "program_lexer.l" { return COLOR; } YY_BREAK case 74: YY_RULE_SETUP -#line 244 "program_lexer.l" +#line 245 "program_lexer.l" { return_token_or_DOT(require_ARB_fp, DEPTH); } YY_BREAK case 75: YY_RULE_SETUP -#line 245 "program_lexer.l" +#line 246 "program_lexer.l" { return DIFFUSE; } YY_BREAK case 76: YY_RULE_SETUP -#line 246 "program_lexer.l" +#line 247 "program_lexer.l" { return DIRECTION; } YY_BREAK case 77: YY_RULE_SETUP -#line 247 "program_lexer.l" +#line 248 "program_lexer.l" { return EMISSION; } YY_BREAK case 78: YY_RULE_SETUP -#line 248 "program_lexer.l" +#line 249 "program_lexer.l" { return ENV; } YY_BREAK case 79: YY_RULE_SETUP -#line 249 "program_lexer.l" +#line 250 "program_lexer.l" { return EYE; } YY_BREAK case 80: YY_RULE_SETUP -#line 250 "program_lexer.l" +#line 251 "program_lexer.l" { return FOGCOORD; } YY_BREAK case 81: YY_RULE_SETUP -#line 251 "program_lexer.l" +#line 252 "program_lexer.l" { return FOG; } YY_BREAK case 82: YY_RULE_SETUP -#line 252 "program_lexer.l" +#line 253 "program_lexer.l" { return FRONT; } YY_BREAK case 83: YY_RULE_SETUP -#line 253 "program_lexer.l" +#line 254 "program_lexer.l" { return HALF; } YY_BREAK case 84: YY_RULE_SETUP -#line 254 "program_lexer.l" +#line 255 "program_lexer.l" { return INVERSE; } YY_BREAK case 85: YY_RULE_SETUP -#line 255 "program_lexer.l" +#line 256 "program_lexer.l" { return INVTRANS; } YY_BREAK case 86: YY_RULE_SETUP -#line 256 "program_lexer.l" +#line 257 "program_lexer.l" { return LIGHT; } YY_BREAK case 87: YY_RULE_SETUP -#line 257 "program_lexer.l" +#line 258 "program_lexer.l" { return LIGHTMODEL; } YY_BREAK case 88: YY_RULE_SETUP -#line 258 "program_lexer.l" +#line 259 "program_lexer.l" { return LIGHTPROD; } YY_BREAK case 89: YY_RULE_SETUP -#line 259 "program_lexer.l" +#line 260 "program_lexer.l" { return LOCAL; } YY_BREAK case 90: YY_RULE_SETUP -#line 260 "program_lexer.l" +#line 261 "program_lexer.l" { return MATERIAL; } YY_BREAK case 91: YY_RULE_SETUP -#line 261 "program_lexer.l" +#line 262 "program_lexer.l" { return MAT_PROGRAM; } YY_BREAK case 92: YY_RULE_SETUP -#line 262 "program_lexer.l" +#line 263 "program_lexer.l" { return MATRIX; } YY_BREAK case 93: YY_RULE_SETUP -#line 263 "program_lexer.l" +#line 264 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, MATRIXINDEX); } YY_BREAK case 94: YY_RULE_SETUP -#line 264 "program_lexer.l" +#line 265 "program_lexer.l" { return MODELVIEW; } YY_BREAK case 95: YY_RULE_SETUP -#line 265 "program_lexer.l" +#line 266 "program_lexer.l" { return MVP; } YY_BREAK case 96: YY_RULE_SETUP -#line 266 "program_lexer.l" +#line 267 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, NORMAL); } YY_BREAK case 97: YY_RULE_SETUP -#line 267 "program_lexer.l" +#line 268 "program_lexer.l" { return OBJECT; } YY_BREAK case 98: YY_RULE_SETUP -#line 268 "program_lexer.l" +#line 269 "program_lexer.l" { return PALETTE; } YY_BREAK case 99: YY_RULE_SETUP -#line 269 "program_lexer.l" +#line 270 "program_lexer.l" { return PARAMS; } YY_BREAK case 100: YY_RULE_SETUP -#line 270 "program_lexer.l" +#line 271 "program_lexer.l" { return PLANE; } YY_BREAK case 101: YY_RULE_SETUP -#line 271 "program_lexer.l" +#line 272 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, POINT); } YY_BREAK case 102: YY_RULE_SETUP -#line 272 "program_lexer.l" +#line 273 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, POINTSIZE); } YY_BREAK case 103: YY_RULE_SETUP -#line 273 "program_lexer.l" +#line 274 "program_lexer.l" { return POSITION; } YY_BREAK case 104: YY_RULE_SETUP -#line 274 "program_lexer.l" +#line 275 "program_lexer.l" { return PRIMARY; } YY_BREAK case 105: YY_RULE_SETUP -#line 275 "program_lexer.l" +#line 276 "program_lexer.l" { return PROJECTION; } YY_BREAK case 106: YY_RULE_SETUP -#line 276 "program_lexer.l" +#line 277 "program_lexer.l" { return_token_or_DOT(require_ARB_fp, RANGE); } YY_BREAK case 107: YY_RULE_SETUP -#line 277 "program_lexer.l" +#line 278 "program_lexer.l" { return ROW; } YY_BREAK case 108: YY_RULE_SETUP -#line 278 "program_lexer.l" +#line 279 "program_lexer.l" { return SCENECOLOR; } YY_BREAK case 109: YY_RULE_SETUP -#line 279 "program_lexer.l" +#line 280 "program_lexer.l" { return SECONDARY; } YY_BREAK case 110: YY_RULE_SETUP -#line 280 "program_lexer.l" +#line 281 "program_lexer.l" { return SHININESS; } YY_BREAK case 111: YY_RULE_SETUP -#line 281 "program_lexer.l" +#line 282 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, SIZE); } YY_BREAK case 112: YY_RULE_SETUP -#line 282 "program_lexer.l" +#line 283 "program_lexer.l" { return SPECULAR; } YY_BREAK case 113: YY_RULE_SETUP -#line 283 "program_lexer.l" +#line 284 "program_lexer.l" { return SPOT; } YY_BREAK case 114: YY_RULE_SETUP -#line 284 "program_lexer.l" +#line 285 "program_lexer.l" { return TEXCOORD; } YY_BREAK case 115: YY_RULE_SETUP -#line 285 "program_lexer.l" +#line 286 "program_lexer.l" { return_token_or_DOT(require_ARB_fp, TEXENV); } YY_BREAK case 116: YY_RULE_SETUP -#line 286 "program_lexer.l" +#line 287 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN); } YY_BREAK case 117: YY_RULE_SETUP -#line 287 "program_lexer.l" +#line 288 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN_Q); } YY_BREAK case 118: YY_RULE_SETUP -#line 288 "program_lexer.l" +#line 289 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN_S); } YY_BREAK case 119: YY_RULE_SETUP -#line 289 "program_lexer.l" +#line 290 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN_T); } YY_BREAK case 120: YY_RULE_SETUP -#line 290 "program_lexer.l" +#line 291 "program_lexer.l" { return TEXTURE; } YY_BREAK case 121: YY_RULE_SETUP -#line 291 "program_lexer.l" +#line 292 "program_lexer.l" { return TRANSPOSE; } YY_BREAK case 122: YY_RULE_SETUP -#line 292 "program_lexer.l" +#line 293 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, VTXATTRIB); } YY_BREAK case 123: YY_RULE_SETUP -#line 293 "program_lexer.l" +#line 294 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, WEIGHT); } YY_BREAK case 124: YY_RULE_SETUP -#line 295 "program_lexer.l" +#line 296 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEXTURE_UNIT); } YY_BREAK case 125: YY_RULE_SETUP -#line 296 "program_lexer.l" +#line 297 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_1D); } YY_BREAK case 126: YY_RULE_SETUP -#line 297 "program_lexer.l" +#line 298 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_2D); } YY_BREAK case 127: YY_RULE_SETUP -#line 298 "program_lexer.l" +#line 299 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_3D); } YY_BREAK case 128: YY_RULE_SETUP -#line 299 "program_lexer.l" +#line 300 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_CUBE); } YY_BREAK case 129: YY_RULE_SETUP -#line 300 "program_lexer.l" +#line 301 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_rect, TEX_RECT); } YY_BREAK case 130: YY_RULE_SETUP -#line 301 "program_lexer.l" +#line 302 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW1D); } YY_BREAK case 131: YY_RULE_SETUP -#line 302 "program_lexer.l" +#line 303 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW2D); } YY_BREAK case 132: YY_RULE_SETUP -#line 303 "program_lexer.l" +#line 304 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_rect, TEX_SHADOWRECT); } YY_BREAK case 133: YY_RULE_SETUP -#line 304 "program_lexer.l" +#line 305 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY1D); } YY_BREAK case 134: YY_RULE_SETUP -#line 305 "program_lexer.l" +#line 306 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY2D); } YY_BREAK case 135: YY_RULE_SETUP -#line 306 "program_lexer.l" +#line 307 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW1D); } YY_BREAK case 136: YY_RULE_SETUP -#line 307 "program_lexer.l" +#line 308 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW2D); } YY_BREAK case 137: YY_RULE_SETUP -#line 309 "program_lexer.l" +#line 310 "program_lexer.l" { return handle_ident(yyextra, yytext, yylval); } YY_BREAK case 138: YY_RULE_SETUP -#line 311 "program_lexer.l" +#line 312 "program_lexer.l" { return DOT_DOT; } YY_BREAK case 139: YY_RULE_SETUP -#line 313 "program_lexer.l" +#line 314 "program_lexer.l" { yylval->integer = strtol(yytext, NULL, 10); return INTEGER; @@ -2186,7 +2187,7 @@ YY_RULE_SETUP YY_BREAK case 140: YY_RULE_SETUP -#line 317 "program_lexer.l" +#line 318 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; @@ -2198,7 +2199,7 @@ case 141: yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 321 "program_lexer.l" +#line 322 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; @@ -2206,7 +2207,7 @@ YY_RULE_SETUP YY_BREAK case 142: YY_RULE_SETUP -#line 325 "program_lexer.l" +#line 326 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; @@ -2214,7 +2215,7 @@ YY_RULE_SETUP YY_BREAK case 143: YY_RULE_SETUP -#line 329 "program_lexer.l" +#line 330 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; @@ -2222,7 +2223,7 @@ YY_RULE_SETUP YY_BREAK case 144: YY_RULE_SETUP -#line 334 "program_lexer.l" +#line 335 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; @@ -2231,7 +2232,7 @@ YY_RULE_SETUP YY_BREAK case 145: YY_RULE_SETUP -#line 340 "program_lexer.l" +#line 341 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@ -2241,7 +2242,7 @@ YY_RULE_SETUP YY_BREAK case 146: YY_RULE_SETUP -#line 346 "program_lexer.l" +#line 347 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; @@ -2250,7 +2251,7 @@ YY_RULE_SETUP YY_BREAK case 147: YY_RULE_SETUP -#line 351 "program_lexer.l" +#line 352 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; @@ -2259,7 +2260,7 @@ YY_RULE_SETUP YY_BREAK case 148: YY_RULE_SETUP -#line 357 "program_lexer.l" +#line 358 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@ -2269,7 +2270,7 @@ YY_RULE_SETUP YY_BREAK case 149: YY_RULE_SETUP -#line 363 "program_lexer.l" +#line 364 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@ -2279,7 +2280,7 @@ YY_RULE_SETUP YY_BREAK case 150: YY_RULE_SETUP -#line 369 "program_lexer.l" +#line 370 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; @@ -2288,7 +2289,7 @@ YY_RULE_SETUP YY_BREAK case 151: YY_RULE_SETUP -#line 375 "program_lexer.l" +#line 376 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@ -2298,7 +2299,7 @@ YY_RULE_SETUP YY_BREAK case 152: YY_RULE_SETUP -#line 382 "program_lexer.l" +#line 383 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@ -2310,7 +2311,7 @@ YY_RULE_SETUP YY_BREAK case 153: YY_RULE_SETUP -#line 391 "program_lexer.l" +#line 392 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; @@ -2319,7 +2320,7 @@ YY_RULE_SETUP YY_BREAK case 154: YY_RULE_SETUP -#line 397 "program_lexer.l" +#line 398 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@ -2329,7 +2330,7 @@ YY_RULE_SETUP YY_BREAK case 155: YY_RULE_SETUP -#line 403 "program_lexer.l" +#line 404 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; @@ -2338,7 +2339,7 @@ YY_RULE_SETUP YY_BREAK case 156: YY_RULE_SETUP -#line 408 "program_lexer.l" +#line 409 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; @@ -2347,7 +2348,7 @@ YY_RULE_SETUP YY_BREAK case 157: YY_RULE_SETUP -#line 414 "program_lexer.l" +#line 415 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@ -2357,7 +2358,7 @@ YY_RULE_SETUP YY_BREAK case 158: YY_RULE_SETUP -#line 420 "program_lexer.l" +#line 421 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@ -2367,7 +2368,7 @@ YY_RULE_SETUP YY_BREAK case 159: YY_RULE_SETUP -#line 426 "program_lexer.l" +#line 427 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; @@ -2376,7 +2377,7 @@ YY_RULE_SETUP YY_BREAK case 160: YY_RULE_SETUP -#line 432 "program_lexer.l" +#line 433 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@ -2386,7 +2387,7 @@ YY_RULE_SETUP YY_BREAK case 161: YY_RULE_SETUP -#line 440 "program_lexer.l" +#line 441 "program_lexer.l" { if (require_ARB_vp) { return TEXGEN_R; @@ -2400,7 +2401,7 @@ YY_RULE_SETUP YY_BREAK case 162: YY_RULE_SETUP -#line 451 "program_lexer.l" +#line 452 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@ -2412,13 +2413,13 @@ YY_RULE_SETUP YY_BREAK case 163: YY_RULE_SETUP -#line 460 "program_lexer.l" +#line 461 "program_lexer.l" { return DOT; } YY_BREAK case 164: /* rule 164 can match eol */ YY_RULE_SETUP -#line 462 "program_lexer.l" +#line 463 "program_lexer.l" { yylloc->first_line++; yylloc->first_column = 1; @@ -2429,7 +2430,7 @@ YY_RULE_SETUP YY_BREAK case 165: YY_RULE_SETUP -#line 469 "program_lexer.l" +#line 470 "program_lexer.l" /* eat whitespace */ ; YY_BREAK case 166: @@ -2437,20 +2438,20 @@ case 166: yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 470 "program_lexer.l" +#line 471 "program_lexer.l" /* eat comments */ ; YY_BREAK case 167: YY_RULE_SETUP -#line 471 "program_lexer.l" +#line 472 "program_lexer.l" { return yytext[0]; } YY_BREAK case 168: YY_RULE_SETUP -#line 472 "program_lexer.l" +#line 473 "program_lexer.l" ECHO; YY_BREAK -#line 2454 "lex.yy.c" +#line 2455 "lex.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -3625,7 +3626,7 @@ void yyfree (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 472 "program_lexer.l" +#line 473 "program_lexer.l" diff --git a/src/mesa/shader/program_lexer.l b/src/mesa/shader/program_lexer.l index 9e68c34ac0..a0d1af1e07 100644 --- a/src/mesa/shader/program_lexer.l +++ b/src/mesa/shader/program_lexer.l @@ -24,6 +24,7 @@ #include "main/glheader.h" #include "prog_instruction.h" +#include "symbol_table.h" #include "program_parser.h" #include "program_parse.tab.h" -- cgit v1.2.3 From 81722c5d7e8e93d837510b9e6e5d014ec64cf4b3 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 10 Sep 2009 15:04:24 -0700 Subject: NV fp parser: Add support for condition codes Conditional write masks and the condition-code based KIL instruction are all supported. The specific behavior of KIL in the following shader may or may not match the behavior of other implementations: !!ARBfp1.0 TEMP GT; MOVC GT, fragment.texcoord[0]; KIL GT.x; END Should be it interpreted as 'KIL srcReg' or as 'KIL ccTest'? The current parser will interpret it as 'KIL srcReg'. --- src/mesa/shader/program_parse.tab.c | 1895 ++++++++++++++++++--------------- src/mesa/shader/program_parse.y | 102 +- src/mesa/shader/program_parse_extra.c | 54 + src/mesa/shader/program_parser.h | 13 + 4 files changed, 1183 insertions(+), 881 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index d37b20ba42..33195c0b16 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -374,7 +374,7 @@ typedef struct YYLTYPE /* Copy the second part of user declarations. */ /* Line 264 of yacc.c */ -#line 259 "program_parse.y" +#line 261 "program_parse.y" extern int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, void *yyscanner); @@ -598,16 +598,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 5 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 393 +#define YYLAST 396 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 118 +#define YYNTOKENS 120 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 138 +#define YYNNTS 143 /* YYNRULES -- Number of rules. */ -#define YYNRULES 274 +#define YYNRULES 282 /* YYNRULES -- Number of states. */ -#define YYNSTATES 460 +#define YYNSTATES 473 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 @@ -623,15 +623,15 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 113, 109, 114, 2, 2, 2, 2, + 115, 116, 2, 113, 109, 114, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 108, - 2, 115, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 117, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 111, 2, 112, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 116, 110, 117, 2, 2, 2, 2, + 2, 2, 2, 118, 110, 119, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -666,147 +666,151 @@ static const yytype_uint16 yyprhs[] = 0, 0, 3, 8, 10, 12, 15, 16, 20, 23, 24, 27, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 54, 59, 64, 69, 76, 83, - 92, 101, 104, 117, 120, 122, 124, 126, 128, 130, - 132, 134, 136, 138, 140, 142, 144, 151, 154, 159, - 162, 164, 168, 174, 177, 180, 188, 191, 193, 195, - 197, 199, 204, 206, 208, 210, 212, 214, 216, 218, - 222, 223, 226, 229, 231, 233, 235, 237, 239, 241, - 243, 245, 247, 248, 250, 252, 254, 256, 257, 259, - 261, 263, 265, 267, 269, 274, 277, 280, 282, 285, - 287, 290, 292, 295, 300, 305, 307, 308, 312, 314, - 316, 319, 321, 324, 326, 328, 332, 339, 340, 342, - 345, 350, 352, 356, 358, 360, 362, 364, 366, 368, - 370, 372, 374, 376, 379, 382, 385, 388, 391, 394, - 397, 400, 403, 406, 409, 412, 416, 418, 420, 422, - 428, 430, 432, 434, 437, 439, 441, 444, 446, 449, - 456, 458, 462, 464, 466, 468, 470, 472, 477, 479, - 481, 483, 485, 487, 489, 492, 494, 496, 502, 504, - 507, 509, 511, 517, 520, 521, 528, 532, 533, 535, - 537, 539, 541, 543, 546, 548, 550, 553, 558, 563, - 564, 566, 568, 570, 572, 575, 577, 579, 581, 583, - 589, 591, 595, 601, 607, 609, 613, 619, 621, 623, - 625, 627, 629, 631, 633, 635, 637, 641, 647, 655, - 665, 668, 671, 673, 675, 676, 677, 682, 684, 685, - 686, 690, 694, 696, 702, 705, 708, 711, 714, 718, - 721, 725, 726, 728, 730, 731, 733, 735, 736, 738, - 740, 741, 743, 745, 746, 750, 751, 755, 756, 760, - 762, 764, 766, 771, 773 + 92, 101, 104, 107, 120, 123, 125, 127, 129, 131, + 133, 135, 137, 139, 141, 143, 145, 147, 154, 157, + 162, 165, 167, 171, 177, 181, 184, 192, 195, 197, + 199, 201, 203, 208, 210, 212, 214, 216, 218, 220, + 222, 226, 227, 230, 233, 235, 237, 239, 241, 243, + 245, 247, 249, 251, 252, 254, 256, 258, 260, 261, + 265, 269, 270, 273, 276, 278, 280, 282, 284, 286, + 288, 290, 292, 297, 300, 303, 305, 308, 310, 313, + 315, 318, 323, 328, 330, 331, 335, 337, 339, 342, + 344, 347, 349, 351, 355, 362, 363, 365, 368, 373, + 375, 379, 381, 383, 385, 387, 389, 391, 393, 395, + 397, 399, 402, 405, 408, 411, 414, 417, 420, 423, + 426, 429, 432, 435, 439, 441, 443, 445, 451, 453, + 455, 457, 460, 462, 464, 467, 469, 472, 479, 481, + 485, 487, 489, 491, 493, 495, 500, 502, 504, 506, + 508, 510, 512, 515, 517, 519, 525, 527, 530, 532, + 534, 540, 543, 544, 551, 555, 556, 558, 560, 562, + 564, 566, 569, 571, 573, 576, 581, 586, 587, 589, + 591, 593, 595, 598, 600, 602, 604, 606, 612, 614, + 618, 624, 630, 632, 636, 642, 644, 646, 648, 650, + 652, 654, 656, 658, 660, 664, 670, 678, 688, 691, + 694, 696, 698, 699, 700, 705, 707, 708, 709, 713, + 717, 719, 725, 728, 731, 734, 737, 741, 744, 748, + 749, 751, 753, 754, 756, 758, 759, 761, 763, 764, + 766, 768, 769, 773, 774, 778, 779, 783, 785, 787, + 789, 794, 796 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int16 yyrhs[] = { - 119, 0, -1, 120, 121, 123, 12, -1, 3, -1, - 4, -1, 121, 122, -1, -1, 8, 255, 108, -1, - 123, 124, -1, -1, 125, 108, -1, 163, 108, -1, - 126, -1, 127, -1, 128, -1, 129, -1, 130, -1, - 131, -1, 132, -1, 133, -1, 139, -1, 134, -1, - 135, -1, 136, -1, 19, 144, 109, 140, -1, 18, - 143, 109, 142, -1, 16, 143, 109, 140, -1, 14, - 143, 109, 140, 109, 140, -1, 13, 143, 109, 142, - 109, 142, -1, 17, 143, 109, 142, 109, 142, 109, - 142, -1, 15, 143, 109, 142, 109, 137, 109, 138, - -1, 20, 142, -1, 22, 143, 109, 142, 109, 142, - 109, 142, 109, 137, 109, 138, -1, 83, 249, -1, - 84, -1, 85, -1, 86, -1, 87, -1, 88, -1, - 89, -1, 90, -1, 91, -1, 92, -1, 93, -1, - 94, -1, 95, -1, 21, 143, 109, 148, 109, 145, - -1, 234, 141, -1, 234, 110, 141, 110, -1, 148, - 160, -1, 231, -1, 234, 148, 161, -1, 234, 110, - 148, 161, 110, -1, 149, 162, -1, 157, 159, -1, - 146, 109, 146, 109, 146, 109, 146, -1, 234, 147, - -1, 23, -1, 255, -1, 100, -1, 165, -1, 150, - 111, 151, 112, -1, 179, -1, 242, -1, 100, -1, - 100, -1, 152, -1, 153, -1, 23, -1, 157, 158, - 154, -1, -1, 113, 155, -1, 114, 156, -1, 23, - -1, 23, -1, 100, -1, 104, -1, 104, -1, 104, - -1, 104, -1, 101, -1, 105, -1, -1, 101, -1, - 102, -1, 103, -1, 104, -1, -1, 164, -1, 171, - -1, 235, -1, 238, -1, 241, -1, 254, -1, 7, - 99, 115, 165, -1, 96, 166, -1, 38, 170, -1, - 60, -1, 98, 168, -1, 53, -1, 29, 247, -1, - 37, -1, 74, 248, -1, 50, 111, 169, 112, -1, - 97, 111, 167, 112, -1, 23, -1, -1, 111, 169, - 112, -1, 23, -1, 60, -1, 29, 247, -1, 37, - -1, 74, 248, -1, 172, -1, 173, -1, 10, 99, - 175, -1, 10, 99, 111, 174, 112, 176, -1, -1, - 23, -1, 115, 178, -1, 115, 116, 177, 117, -1, - 180, -1, 177, 109, 180, -1, 182, -1, 218, -1, - 228, -1, 182, -1, 218, -1, 229, -1, 181, -1, - 219, -1, 228, -1, 182, -1, 73, 206, -1, 73, - 183, -1, 73, 185, -1, 73, 188, -1, 73, 190, - -1, 73, 196, -1, 73, 192, -1, 73, 199, -1, - 73, 201, -1, 73, 203, -1, 73, 205, -1, 73, - 217, -1, 47, 246, 184, -1, 194, -1, 33, -1, - 69, -1, 43, 111, 195, 112, 186, -1, 194, -1, - 60, -1, 26, -1, 72, 187, -1, 40, -1, 32, - -1, 44, 189, -1, 25, -1, 246, 67, -1, 45, - 111, 195, 112, 246, 191, -1, 194, -1, 75, 250, - 193, -1, 29, -1, 25, -1, 31, -1, 71, -1, - 23, -1, 76, 248, 197, 198, -1, 35, -1, 54, - -1, 79, -1, 80, -1, 78, -1, 77, -1, 36, - 200, -1, 29, -1, 56, -1, 28, 111, 202, 112, - 57, -1, 23, -1, 58, 204, -1, 70, -1, 26, - -1, 208, 66, 111, 211, 112, -1, 208, 207, -1, - -1, 66, 111, 211, 106, 211, 112, -1, 49, 212, - 209, -1, -1, 210, -1, 41, -1, 82, -1, 42, - -1, 23, -1, 51, 213, -1, 63, -1, 52, -1, - 81, 248, -1, 55, 111, 215, 112, -1, 48, 111, - 216, 112, -1, -1, 214, -1, 23, -1, 23, -1, - 23, -1, 30, 64, -1, 222, -1, 225, -1, 220, - -1, 223, -1, 62, 34, 111, 221, 112, -1, 226, - -1, 226, 106, 226, -1, 62, 34, 111, 226, 112, - -1, 62, 46, 111, 224, 112, -1, 227, -1, 227, - 106, 227, -1, 62, 46, 111, 227, 112, -1, 23, - -1, 23, -1, 230, -1, 232, -1, 231, -1, 232, - -1, 233, -1, 24, -1, 23, -1, 116, 233, 117, - -1, 116, 233, 109, 233, 117, -1, 116, 233, 109, - 233, 109, 233, 117, -1, 116, 233, 109, 233, 109, - 233, 109, 233, 117, -1, 234, 24, -1, 234, 23, - -1, 113, -1, 114, -1, -1, -1, 237, 11, 236, - 240, -1, 255, -1, -1, -1, 5, 239, 240, -1, - 240, 109, 99, -1, 99, -1, 237, 9, 99, 115, - 242, -1, 65, 60, -1, 65, 37, -1, 65, 243, - -1, 65, 59, -1, 65, 74, 248, -1, 65, 30, - -1, 29, 244, 245, -1, -1, 39, -1, 27, -1, - -1, 61, -1, 68, -1, -1, 39, -1, 27, -1, - -1, 61, -1, 68, -1, -1, 111, 251, 112, -1, - -1, 111, 252, 112, -1, -1, 111, 253, 112, -1, - 23, -1, 23, -1, 23, -1, 6, 99, 115, 100, - -1, 99, -1, 100, -1 + 121, 0, -1, 122, 123, 125, 12, -1, 3, -1, + 4, -1, 123, 124, -1, -1, 8, 262, 108, -1, + 125, 126, -1, -1, 127, 108, -1, 170, 108, -1, + 128, -1, 129, -1, 130, -1, 131, -1, 132, -1, + 133, -1, 134, -1, 135, -1, 141, -1, 136, -1, + 137, -1, 138, -1, 19, 146, 109, 142, -1, 18, + 145, 109, 144, -1, 16, 145, 109, 142, -1, 14, + 145, 109, 142, 109, 142, -1, 13, 145, 109, 144, + 109, 144, -1, 17, 145, 109, 144, 109, 144, 109, + 144, -1, 15, 145, 109, 144, 109, 139, 109, 140, + -1, 20, 144, -1, 20, 166, -1, 22, 145, 109, + 144, 109, 144, 109, 144, 109, 139, 109, 140, -1, + 83, 256, -1, 84, -1, 85, -1, 86, -1, 87, + -1, 88, -1, 89, -1, 90, -1, 91, -1, 92, + -1, 93, -1, 94, -1, 95, -1, 21, 145, 109, + 150, 109, 147, -1, 241, 143, -1, 241, 110, 143, + 110, -1, 150, 162, -1, 238, -1, 241, 150, 163, + -1, 241, 110, 150, 163, 110, -1, 151, 164, 165, + -1, 159, 161, -1, 148, 109, 148, 109, 148, 109, + 148, -1, 241, 149, -1, 23, -1, 262, -1, 100, + -1, 172, -1, 152, 111, 153, 112, -1, 186, -1, + 249, -1, 100, -1, 100, -1, 154, -1, 155, -1, + 23, -1, 159, 160, 156, -1, -1, 113, 157, -1, + 114, 158, -1, 23, -1, 23, -1, 100, -1, 104, + -1, 104, -1, 104, -1, 104, -1, 101, -1, 105, + -1, -1, 101, -1, 102, -1, 103, -1, 104, -1, + -1, 115, 166, 116, -1, 115, 167, 116, -1, -1, + 168, 163, -1, 169, 163, -1, 99, -1, 100, -1, + 171, -1, 178, -1, 242, -1, 245, -1, 248, -1, + 261, -1, 7, 99, 117, 172, -1, 96, 173, -1, + 38, 177, -1, 60, -1, 98, 175, -1, 53, -1, + 29, 254, -1, 37, -1, 74, 255, -1, 50, 111, + 176, 112, -1, 97, 111, 174, 112, -1, 23, -1, + -1, 111, 176, 112, -1, 23, -1, 60, -1, 29, + 254, -1, 37, -1, 74, 255, -1, 179, -1, 180, + -1, 10, 99, 182, -1, 10, 99, 111, 181, 112, + 183, -1, -1, 23, -1, 117, 185, -1, 117, 118, + 184, 119, -1, 187, -1, 184, 109, 187, -1, 189, + -1, 225, -1, 235, -1, 189, -1, 225, -1, 236, + -1, 188, -1, 226, -1, 235, -1, 189, -1, 73, + 213, -1, 73, 190, -1, 73, 192, -1, 73, 195, + -1, 73, 197, -1, 73, 203, -1, 73, 199, -1, + 73, 206, -1, 73, 208, -1, 73, 210, -1, 73, + 212, -1, 73, 224, -1, 47, 253, 191, -1, 201, + -1, 33, -1, 69, -1, 43, 111, 202, 112, 193, + -1, 201, -1, 60, -1, 26, -1, 72, 194, -1, + 40, -1, 32, -1, 44, 196, -1, 25, -1, 253, + 67, -1, 45, 111, 202, 112, 253, 198, -1, 201, + -1, 75, 257, 200, -1, 29, -1, 25, -1, 31, + -1, 71, -1, 23, -1, 76, 255, 204, 205, -1, + 35, -1, 54, -1, 79, -1, 80, -1, 78, -1, + 77, -1, 36, 207, -1, 29, -1, 56, -1, 28, + 111, 209, 112, 57, -1, 23, -1, 58, 211, -1, + 70, -1, 26, -1, 215, 66, 111, 218, 112, -1, + 215, 214, -1, -1, 66, 111, 218, 106, 218, 112, + -1, 49, 219, 216, -1, -1, 217, -1, 41, -1, + 82, -1, 42, -1, 23, -1, 51, 220, -1, 63, + -1, 52, -1, 81, 255, -1, 55, 111, 222, 112, + -1, 48, 111, 223, 112, -1, -1, 221, -1, 23, + -1, 23, -1, 23, -1, 30, 64, -1, 229, -1, + 232, -1, 227, -1, 230, -1, 62, 34, 111, 228, + 112, -1, 233, -1, 233, 106, 233, -1, 62, 34, + 111, 233, 112, -1, 62, 46, 111, 231, 112, -1, + 234, -1, 234, 106, 234, -1, 62, 46, 111, 234, + 112, -1, 23, -1, 23, -1, 237, -1, 239, -1, + 238, -1, 239, -1, 240, -1, 24, -1, 23, -1, + 118, 240, 119, -1, 118, 240, 109, 240, 119, -1, + 118, 240, 109, 240, 109, 240, 119, -1, 118, 240, + 109, 240, 109, 240, 109, 240, 119, -1, 241, 24, + -1, 241, 23, -1, 113, -1, 114, -1, -1, -1, + 244, 11, 243, 247, -1, 262, -1, -1, -1, 5, + 246, 247, -1, 247, 109, 99, -1, 99, -1, 244, + 9, 99, 117, 249, -1, 65, 60, -1, 65, 37, + -1, 65, 250, -1, 65, 59, -1, 65, 74, 255, + -1, 65, 30, -1, 29, 251, 252, -1, -1, 39, + -1, 27, -1, -1, 61, -1, 68, -1, -1, 39, + -1, 27, -1, -1, 61, -1, 68, -1, -1, 111, + 258, 112, -1, -1, 111, 259, 112, -1, -1, 111, + 260, 112, -1, 23, -1, 23, -1, 23, -1, 6, + 99, 117, 100, -1, 99, -1, 100, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 266, 266, 269, 277, 289, 290, 293, 315, 316, - 319, 334, 337, 342, 349, 350, 351, 352, 353, 354, - 355, 358, 359, 360, 363, 369, 375, 381, 388, 394, - 401, 445, 452, 496, 502, 503, 504, 505, 506, 507, - 508, 509, 510, 511, 512, 513, 516, 528, 536, 553, - 560, 579, 590, 610, 632, 641, 674, 681, 696, 746, - 788, 799, 820, 830, 836, 867, 884, 884, 886, 893, - 905, 906, 907, 910, 922, 934, 952, 963, 975, 977, - 978, 979, 980, 983, 983, 983, 983, 984, 987, 988, - 989, 990, 991, 992, 995, 1013, 1017, 1023, 1027, 1031, - 1035, 1044, 1053, 1057, 1062, 1068, 1079, 1079, 1080, 1082, - 1086, 1090, 1094, 1100, 1100, 1102, 1118, 1141, 1144, 1155, - 1161, 1167, 1168, 1175, 1181, 1187, 1195, 1201, 1207, 1215, - 1221, 1227, 1235, 1236, 1239, 1240, 1241, 1242, 1243, 1244, - 1245, 1246, 1247, 1248, 1249, 1252, 1261, 1265, 1269, 1275, - 1284, 1288, 1292, 1301, 1305, 1311, 1317, 1324, 1329, 1337, - 1347, 1349, 1357, 1363, 1367, 1371, 1377, 1388, 1397, 1401, - 1406, 1410, 1414, 1418, 1424, 1431, 1435, 1441, 1449, 1460, - 1467, 1471, 1477, 1487, 1498, 1502, 1520, 1529, 1532, 1538, - 1542, 1546, 1552, 1563, 1568, 1573, 1578, 1583, 1588, 1596, - 1599, 1604, 1617, 1625, 1636, 1644, 1644, 1646, 1646, 1648, - 1658, 1663, 1670, 1680, 1689, 1694, 1701, 1711, 1721, 1733, - 1733, 1734, 1734, 1736, 1746, 1754, 1764, 1772, 1780, 1789, - 1800, 1804, 1810, 1811, 1812, 1815, 1815, 1818, 1853, 1857, - 1857, 1860, 1866, 1874, 1887, 1896, 1905, 1909, 1918, 1927, - 1938, 1945, 1950, 1959, 1971, 1974, 1983, 1994, 1995, 1996, - 1999, 2000, 2001, 2004, 2005, 2008, 2009, 2012, 2013, 2016, - 2027, 2038, 2049, 2070, 2071 + 0, 268, 268, 271, 279, 291, 292, 295, 317, 318, + 321, 336, 339, 344, 351, 352, 353, 354, 355, 356, + 357, 360, 361, 362, 365, 371, 377, 383, 390, 396, + 403, 447, 452, 462, 506, 512, 513, 514, 515, 516, + 517, 518, 519, 520, 521, 522, 523, 526, 538, 546, + 563, 570, 589, 600, 620, 645, 654, 687, 694, 709, + 759, 801, 812, 833, 843, 849, 880, 897, 897, 899, + 906, 918, 919, 920, 923, 935, 947, 965, 976, 988, + 990, 991, 992, 993, 996, 996, 996, 996, 997, 1000, + 1004, 1009, 1016, 1023, 1030, 1053, 1076, 1077, 1078, 1079, + 1080, 1081, 1084, 1102, 1106, 1112, 1116, 1120, 1124, 1133, + 1142, 1146, 1151, 1157, 1168, 1168, 1169, 1171, 1175, 1179, + 1183, 1189, 1189, 1191, 1207, 1230, 1233, 1244, 1250, 1256, + 1257, 1264, 1270, 1276, 1284, 1290, 1296, 1304, 1310, 1316, + 1324, 1325, 1328, 1329, 1330, 1331, 1332, 1333, 1334, 1335, + 1336, 1337, 1338, 1341, 1350, 1354, 1358, 1364, 1373, 1377, + 1381, 1390, 1394, 1400, 1406, 1413, 1418, 1426, 1436, 1438, + 1446, 1452, 1456, 1460, 1466, 1477, 1486, 1490, 1495, 1499, + 1503, 1507, 1513, 1520, 1524, 1530, 1538, 1549, 1556, 1560, + 1566, 1576, 1587, 1591, 1609, 1618, 1621, 1627, 1631, 1635, + 1641, 1652, 1657, 1662, 1667, 1672, 1677, 1685, 1688, 1693, + 1706, 1714, 1725, 1733, 1733, 1735, 1735, 1737, 1747, 1752, + 1759, 1769, 1778, 1783, 1790, 1800, 1810, 1822, 1822, 1823, + 1823, 1825, 1835, 1843, 1853, 1861, 1869, 1878, 1889, 1893, + 1899, 1900, 1901, 1904, 1904, 1907, 1942, 1946, 1946, 1949, + 1955, 1963, 1976, 1985, 1994, 1998, 2007, 2016, 2027, 2034, + 2039, 2048, 2060, 2063, 2072, 2083, 2084, 2085, 2088, 2089, + 2090, 2093, 2094, 2097, 2098, 2101, 2102, 2105, 2116, 2127, + 2138, 2159, 2160 }; #endif @@ -833,8 +837,8 @@ static const char *const yytname[] = "TEX_ARRAYSHADOW1D", "TEX_ARRAYSHADOW2D", "VERTEX", "VTXATTRIB", "WEIGHT", "IDENTIFIER", "USED_IDENTIFIER", "MASK4", "MASK3", "MASK2", "MASK1", "SWIZZLE", "DOT_DOT", "DOT", "';'", "','", "'|'", "'['", "']'", - "'+'", "'-'", "'='", "'{'", "'}'", "$accept", "program", "language", - "optionSequence", "option", "statementSequence", "statement", + "'+'", "'-'", "'('", "')'", "'='", "'{'", "'}'", "$accept", "program", + "language", "optionSequence", "option", "statementSequence", "statement", "instruction", "ALU_instruction", "TexInstruction", "ARL_instruction", "VECTORop_instruction", "SCALARop_instruction", "BINSCop_instruction", "BINop_instruction", "TRIop_instruction", "SAMPLE_instruction", @@ -845,6 +849,7 @@ static const char *const yytname[] = "progParamArrayAbs", "progParamArrayRel", "addrRegRelOffset", "addrRegPosOffset", "addrRegNegOffset", "addrReg", "addrComponent", "addrWriteMask", "scalarSuffix", "swizzleSuffix", "optionalMask", + "optionalCcMask", "ccTest", "ccTest2", "ccMaskRule", "ccMaskRule2", "namingStatement", "ATTRIB_statement", "attribBinding", "vtxAttribItem", "vtxAttribNum", "vtxOptWeightNum", "vtxWeightNum", "fragAttribItem", "PARAM_statement", "PARAM_singleStmt", "PARAM_multipleStmt", @@ -894,41 +899,42 @@ static const yytype_uint16 yytoknum[] = 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 59, 44, - 124, 91, 93, 43, 45, 61, 123, 125 + 124, 91, 93, 43, 45, 40, 41, 61, 123, 125 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = +static const yytype_uint16 yyr1[] = { - 0, 118, 119, 120, 120, 121, 121, 122, 123, 123, - 124, 124, 125, 125, 126, 126, 126, 126, 126, 126, - 126, 127, 127, 127, 128, 129, 130, 131, 132, 133, - 134, 135, 136, 137, 138, 138, 138, 138, 138, 138, - 138, 138, 138, 138, 138, 138, 139, 140, 140, 141, - 141, 142, 142, 143, 144, 145, 146, 147, 147, 148, - 148, 148, 148, 149, 149, 150, 151, 151, 152, 153, - 154, 154, 154, 155, 156, 157, 158, 159, 160, 161, - 161, 161, 161, 162, 162, 162, 162, 162, 163, 163, - 163, 163, 163, 163, 164, 165, 165, 166, 166, 166, - 166, 166, 166, 166, 166, 167, 168, 168, 169, 170, - 170, 170, 170, 171, 171, 172, 173, 174, 174, 175, - 176, 177, 177, 178, 178, 178, 179, 179, 179, 180, - 180, 180, 181, 181, 182, 182, 182, 182, 182, 182, - 182, 182, 182, 182, 182, 183, 184, 184, 184, 185, - 186, 186, 186, 186, 186, 187, 188, 189, 189, 190, - 191, 192, 193, 194, 194, 194, 195, 196, 197, 197, - 198, 198, 198, 198, 199, 200, 200, 201, 202, 203, - 204, 204, 205, 206, 207, 207, 208, 209, 209, 210, - 210, 210, 211, 212, 212, 212, 212, 212, 212, 213, - 213, 214, 215, 216, 217, 218, 218, 219, 219, 220, - 221, 221, 222, 223, 224, 224, 225, 226, 227, 228, - 228, 229, 229, 230, 231, 231, 232, 232, 232, 232, - 233, 233, 234, 234, 234, 236, 235, 237, 237, 239, - 238, 240, 240, 241, 242, 242, 242, 242, 242, 242, - 243, 244, 244, 244, 245, 245, 245, 246, 246, 246, - 247, 247, 247, 248, 248, 249, 249, 250, 250, 251, - 252, 253, 254, 255, 255 + 0, 120, 121, 122, 122, 123, 123, 124, 125, 125, + 126, 126, 127, 127, 128, 128, 128, 128, 128, 128, + 128, 129, 129, 129, 130, 131, 132, 133, 134, 135, + 136, 137, 137, 138, 139, 140, 140, 140, 140, 140, + 140, 140, 140, 140, 140, 140, 140, 141, 142, 142, + 143, 143, 144, 144, 145, 146, 147, 148, 149, 149, + 150, 150, 150, 150, 151, 151, 152, 153, 153, 154, + 155, 156, 156, 156, 157, 158, 159, 160, 161, 162, + 163, 163, 163, 163, 164, 164, 164, 164, 164, 165, + 165, 165, 166, 167, 168, 169, 170, 170, 170, 170, + 170, 170, 171, 172, 172, 173, 173, 173, 173, 173, + 173, 173, 173, 174, 175, 175, 176, 177, 177, 177, + 177, 178, 178, 179, 180, 181, 181, 182, 183, 184, + 184, 185, 185, 185, 186, 186, 186, 187, 187, 187, + 188, 188, 189, 189, 189, 189, 189, 189, 189, 189, + 189, 189, 189, 190, 191, 191, 191, 192, 193, 193, + 193, 193, 193, 194, 195, 196, 196, 197, 198, 199, + 200, 201, 201, 201, 202, 203, 204, 204, 205, 205, + 205, 205, 206, 207, 207, 208, 209, 210, 211, 211, + 212, 213, 214, 214, 215, 216, 216, 217, 217, 217, + 218, 219, 219, 219, 219, 219, 219, 220, 220, 221, + 222, 223, 224, 225, 225, 226, 226, 227, 228, 228, + 229, 230, 231, 231, 232, 233, 234, 235, 235, 236, + 236, 237, 238, 238, 239, 239, 239, 239, 240, 240, + 241, 241, 241, 243, 242, 244, 244, 246, 245, 247, + 247, 248, 249, 249, 249, 249, 249, 249, 250, 251, + 251, 251, 252, 252, 252, 253, 253, 253, 254, 254, + 254, 255, 255, 256, 256, 257, 257, 258, 259, 260, + 261, 262, 262 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -937,31 +943,32 @@ static const yytype_uint8 yyr2[] = 0, 2, 4, 1, 1, 2, 0, 3, 2, 0, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 6, 6, 8, - 8, 2, 12, 2, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 6, 2, 4, 2, - 1, 3, 5, 2, 2, 7, 2, 1, 1, 1, - 1, 4, 1, 1, 1, 1, 1, 1, 1, 3, - 0, 2, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, - 1, 1, 1, 1, 4, 2, 2, 1, 2, 1, - 2, 1, 2, 4, 4, 1, 0, 3, 1, 1, - 2, 1, 2, 1, 1, 3, 6, 0, 1, 2, - 4, 1, 3, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 3, 1, 1, 1, 5, - 1, 1, 1, 2, 1, 1, 2, 1, 2, 6, - 1, 3, 1, 1, 1, 1, 1, 4, 1, 1, - 1, 1, 1, 1, 2, 1, 1, 5, 1, 2, - 1, 1, 5, 2, 0, 6, 3, 0, 1, 1, - 1, 1, 1, 2, 1, 1, 2, 4, 4, 0, - 1, 1, 1, 1, 2, 1, 1, 1, 1, 5, - 1, 3, 5, 5, 1, 3, 5, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 3, 5, 7, 9, - 2, 2, 1, 1, 0, 0, 4, 1, 0, 0, - 3, 3, 1, 5, 2, 2, 2, 2, 3, 2, - 3, 0, 1, 1, 0, 1, 1, 0, 1, 1, - 0, 1, 1, 0, 3, 0, 3, 0, 3, 1, - 1, 1, 4, 1, 1 + 8, 2, 2, 12, 2, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 6, 2, 4, + 2, 1, 3, 5, 3, 2, 7, 2, 1, 1, + 1, 1, 4, 1, 1, 1, 1, 1, 1, 1, + 3, 0, 2, 2, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 0, 1, 1, 1, 1, 0, 3, + 3, 0, 2, 2, 1, 1, 1, 1, 1, 1, + 1, 1, 4, 2, 2, 1, 2, 1, 2, 1, + 2, 4, 4, 1, 0, 3, 1, 1, 2, 1, + 2, 1, 1, 3, 6, 0, 1, 2, 4, 1, + 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 3, 1, 1, 1, 5, 1, 1, + 1, 2, 1, 1, 2, 1, 2, 6, 1, 3, + 1, 1, 1, 1, 1, 4, 1, 1, 1, 1, + 1, 1, 2, 1, 1, 5, 1, 2, 1, 1, + 5, 2, 0, 6, 3, 0, 1, 1, 1, 1, + 1, 2, 1, 1, 2, 4, 4, 0, 1, 1, + 1, 1, 2, 1, 1, 1, 1, 5, 1, 3, + 5, 5, 1, 3, 5, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 3, 5, 7, 9, 2, 2, + 1, 1, 0, 0, 4, 1, 0, 0, 3, 3, + 1, 5, 2, 2, 2, 2, 3, 2, 3, 0, + 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, + 1, 0, 3, 0, 3, 0, 3, 1, 1, 1, + 4, 1, 1 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -969,288 +976,296 @@ static const yytype_uint8 yyr2[] = means the default is an error. */ static const yytype_uint16 yydefact[] = { - 0, 3, 4, 0, 6, 1, 9, 0, 5, 238, - 273, 274, 0, 239, 0, 0, 0, 2, 0, 0, - 0, 0, 0, 0, 0, 234, 0, 0, 8, 0, + 0, 3, 4, 0, 6, 1, 9, 0, 5, 246, + 281, 282, 0, 247, 0, 0, 0, 2, 0, 0, + 0, 0, 0, 0, 0, 242, 0, 0, 8, 0, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, - 23, 20, 0, 88, 89, 113, 114, 90, 0, 91, - 92, 93, 237, 7, 0, 0, 0, 0, 0, 64, - 0, 87, 63, 0, 0, 0, 0, 0, 75, 0, - 0, 232, 233, 31, 0, 0, 0, 10, 11, 0, - 235, 242, 240, 0, 0, 117, 234, 115, 251, 249, - 245, 247, 244, 263, 246, 234, 83, 84, 85, 86, - 53, 234, 234, 234, 234, 234, 234, 77, 54, 225, - 224, 0, 0, 0, 0, 59, 0, 234, 82, 0, - 60, 62, 126, 127, 205, 206, 128, 221, 222, 0, - 234, 0, 0, 0, 272, 94, 118, 0, 119, 123, - 124, 125, 219, 220, 223, 0, 253, 252, 254, 0, - 248, 0, 0, 0, 0, 26, 0, 25, 24, 260, - 111, 109, 263, 96, 0, 0, 0, 0, 0, 0, - 257, 0, 257, 0, 0, 267, 263, 134, 135, 136, - 137, 139, 138, 140, 141, 142, 143, 0, 144, 260, - 101, 0, 99, 97, 263, 0, 106, 95, 82, 0, - 80, 79, 81, 51, 0, 0, 0, 0, 236, 241, - 0, 231, 230, 255, 256, 250, 269, 0, 234, 234, - 0, 47, 0, 50, 0, 234, 261, 262, 110, 112, - 0, 0, 0, 204, 175, 176, 174, 0, 157, 259, - 258, 156, 0, 0, 0, 0, 199, 195, 0, 194, - 263, 187, 181, 180, 179, 0, 0, 0, 0, 100, - 0, 102, 0, 0, 98, 0, 234, 226, 68, 0, - 66, 67, 0, 234, 234, 243, 0, 116, 264, 28, - 27, 0, 78, 49, 265, 0, 0, 217, 0, 218, - 0, 178, 0, 166, 0, 158, 0, 163, 164, 147, - 148, 165, 145, 146, 0, 201, 193, 200, 0, 196, - 189, 191, 190, 186, 188, 271, 0, 162, 161, 168, - 169, 0, 0, 108, 0, 105, 0, 0, 52, 0, - 61, 76, 70, 46, 0, 0, 0, 234, 48, 0, - 33, 0, 234, 212, 216, 0, 0, 257, 203, 0, - 202, 0, 268, 173, 172, 170, 171, 167, 192, 0, - 103, 104, 107, 234, 227, 0, 0, 69, 234, 57, - 56, 58, 234, 0, 0, 0, 121, 129, 132, 130, - 207, 208, 131, 270, 0, 34, 35, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 30, 29, 177, - 152, 154, 151, 0, 149, 150, 0, 198, 197, 182, - 0, 73, 71, 74, 72, 0, 0, 0, 0, 133, - 184, 234, 120, 266, 155, 153, 159, 160, 234, 228, - 234, 0, 0, 0, 0, 183, 122, 0, 0, 0, - 0, 210, 0, 214, 0, 229, 234, 0, 209, 0, - 213, 0, 0, 55, 32, 211, 215, 0, 0, 185 + 23, 20, 0, 96, 97, 121, 122, 98, 0, 99, + 100, 101, 245, 7, 0, 0, 0, 0, 0, 65, + 0, 88, 64, 0, 0, 0, 0, 0, 76, 0, + 0, 94, 240, 241, 31, 32, 83, 0, 0, 0, + 10, 11, 0, 243, 250, 248, 0, 0, 125, 242, + 123, 259, 257, 253, 255, 252, 271, 254, 242, 84, + 85, 86, 87, 91, 242, 242, 242, 242, 242, 242, + 78, 55, 81, 80, 82, 92, 233, 232, 0, 0, + 0, 0, 60, 0, 242, 83, 0, 61, 63, 134, + 135, 213, 214, 136, 229, 230, 0, 242, 0, 0, + 0, 280, 102, 126, 0, 127, 131, 132, 133, 227, + 228, 231, 0, 261, 260, 262, 0, 256, 0, 0, + 54, 0, 0, 0, 26, 0, 25, 24, 268, 119, + 117, 271, 104, 0, 0, 0, 0, 0, 0, 265, + 0, 265, 0, 0, 275, 271, 142, 143, 144, 145, + 147, 146, 148, 149, 150, 151, 0, 152, 268, 109, + 0, 107, 105, 271, 0, 114, 103, 83, 0, 52, + 0, 0, 0, 0, 244, 249, 0, 239, 238, 263, + 264, 258, 277, 0, 242, 95, 0, 0, 83, 242, + 0, 48, 0, 51, 0, 242, 269, 270, 118, 120, + 0, 0, 0, 212, 183, 184, 182, 0, 165, 267, + 266, 164, 0, 0, 0, 0, 207, 203, 0, 202, + 271, 195, 189, 188, 187, 0, 0, 0, 0, 108, + 0, 110, 0, 0, 106, 0, 242, 234, 69, 0, + 67, 68, 0, 242, 242, 251, 0, 124, 272, 28, + 89, 90, 93, 27, 0, 79, 50, 273, 0, 0, + 225, 0, 226, 0, 186, 0, 174, 0, 166, 0, + 171, 172, 155, 156, 173, 153, 154, 0, 209, 201, + 208, 0, 204, 197, 199, 198, 194, 196, 279, 0, + 170, 169, 176, 177, 0, 0, 116, 0, 113, 0, + 0, 53, 0, 62, 77, 71, 47, 0, 0, 0, + 242, 49, 0, 34, 0, 242, 220, 224, 0, 0, + 265, 211, 0, 210, 0, 276, 181, 180, 178, 179, + 175, 200, 0, 111, 112, 115, 242, 235, 0, 0, + 70, 242, 58, 57, 59, 242, 0, 0, 0, 129, + 137, 140, 138, 215, 216, 139, 278, 0, 35, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 30, 29, 185, 160, 162, 159, 0, 157, 158, 0, + 206, 205, 190, 0, 74, 72, 75, 73, 0, 0, + 0, 0, 141, 192, 242, 128, 274, 163, 161, 167, + 168, 242, 236, 242, 0, 0, 0, 0, 191, 130, + 0, 0, 0, 0, 218, 0, 222, 0, 237, 242, + 0, 217, 0, 221, 0, 0, 56, 33, 219, 223, + 0, 0, 193 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 3, 4, 6, 8, 9, 28, 29, 30, 31, - 32, 33, 34, 35, 36, 37, 38, 39, 40, 285, - 397, 41, 152, 221, 73, 60, 69, 333, 334, 370, - 222, 61, 119, 269, 270, 271, 367, 412, 414, 70, - 332, 108, 283, 203, 100, 42, 43, 120, 197, 326, - 264, 324, 163, 44, 45, 46, 137, 87, 277, 375, - 138, 121, 376, 377, 122, 177, 302, 178, 404, 425, - 179, 241, 180, 426, 181, 318, 303, 294, 182, 321, - 357, 183, 236, 184, 292, 185, 254, 186, 419, 435, - 187, 313, 314, 359, 251, 306, 307, 351, 349, 188, - 123, 379, 380, 440, 124, 381, 442, 125, 288, 290, - 382, 126, 142, 127, 128, 144, 74, 47, 132, 48, - 49, 54, 82, 50, 62, 94, 148, 215, 242, 228, - 150, 340, 256, 217, 384, 316, 51, 12 + 32, 33, 34, 35, 36, 37, 38, 39, 40, 298, + 410, 41, 161, 231, 74, 60, 69, 346, 347, 383, + 232, 61, 126, 279, 280, 281, 380, 425, 427, 70, + 345, 111, 296, 115, 103, 160, 75, 227, 76, 228, + 42, 43, 127, 206, 339, 274, 337, 172, 44, 45, + 46, 144, 90, 287, 388, 145, 128, 389, 390, 129, + 186, 315, 187, 417, 438, 188, 251, 189, 439, 190, + 331, 316, 307, 191, 334, 370, 192, 246, 193, 305, + 194, 264, 195, 432, 448, 196, 326, 327, 372, 261, + 319, 320, 364, 362, 197, 130, 392, 393, 453, 131, + 394, 455, 132, 301, 303, 395, 133, 149, 134, 135, + 151, 77, 47, 139, 48, 49, 54, 85, 50, 62, + 97, 155, 221, 252, 238, 157, 353, 266, 223, 397, + 329, 51, 12 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -401 +#define YYPACT_NINF -387 static const yytype_int16 yypact[] = { - 122, -401, -401, 49, -401, -401, 56, 61, -401, 20, - -401, -401, -5, -401, 7, 45, 78, -401, -47, -47, - -47, -47, -47, -47, 79, 85, -47, -47, -401, 99, - -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, - -401, -401, 127, -401, -401, -401, -401, -401, 120, -401, - -401, -401, -401, -401, 135, 133, 134, 25, 129, -401, - 138, 137, -401, 145, 146, 147, 148, 151, -401, 152, - 154, -401, -401, -401, -14, 153, 155, -401, -401, 143, - -401, -401, 156, 163, 14, 243, 32, -401, 31, -401, - -401, -401, -401, 157, -401, 85, -401, -401, -401, -401, - -401, 85, 85, 85, 85, 85, 85, -401, -401, -401, - -401, 112, 149, 126, 54, 158, 27, 85, 132, 159, - -401, -401, -401, -401, -401, -401, -401, -401, -401, 27, - 85, 160, 135, 168, -401, -401, -401, 161, -401, -401, - -401, -401, -401, -401, -401, 198, -401, -401, 89, 248, - -401, 167, 169, 22, 170, -401, 171, -401, -401, 117, - -401, -401, 157, -401, 172, 173, 174, 208, -1, 175, - 53, 176, 165, 142, -3, 177, 157, -401, -401, -401, - -401, -401, -401, -401, -401, -401, -401, 215, -401, 117, - -401, 179, -401, -401, 157, 180, 181, -401, 132, -38, - -401, -401, -401, -401, -10, 184, 185, 209, 156, -401, - 182, -401, -401, -401, -401, -401, -401, 183, 85, 85, - 27, -401, 192, 194, 216, 85, -401, -401, -401, -401, - 277, 278, 279, -401, -401, -401, -401, 280, -401, -401, - -401, -401, 237, 280, 68, 195, 282, -401, 196, -401, - 157, 33, -401, -401, -401, 285, 281, 19, 200, -401, - 286, -401, 289, 286, -401, 203, 85, -401, -401, 202, - -401, -401, 212, 85, 85, -401, 201, -401, -401, -401, - -401, 210, -401, -401, 207, 213, 214, -401, 218, -401, - 219, -401, 220, -401, 221, -401, 222, -401, -401, -401, - -401, -401, -401, -401, 296, -401, -401, -401, 298, -401, - -401, -401, -401, -401, -401, -401, 226, -401, -401, -401, - -401, 166, 301, -401, 227, -401, 228, 229, -401, 46, - -401, -401, 116, -401, 217, -12, 234, 51, -401, 302, - -401, 125, 85, -401, -401, 270, 37, 165, -401, 233, - -401, 235, -401, -401, -401, -401, -401, -401, -401, 236, - -401, -401, -401, 85, -401, 305, 323, -401, 85, -401, - -401, -401, 85, 162, 126, 59, -401, -401, -401, -401, - -401, -401, -401, -401, 238, -401, -401, -401, -401, -401, - -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, - -401, -401, -401, 317, -401, -401, 41, -401, -401, -401, - 65, -401, -401, -401, -401, 242, 244, 241, 245, -401, - 288, 51, -401, -401, -401, -401, -401, -401, 85, -401, - 85, 216, 277, 278, 246, -401, -401, 247, 249, 250, - 251, 255, 253, 256, 301, -401, 85, 125, -401, 277, - -401, 278, 94, -401, -401, -401, -401, 301, 254, -401 + 202, -387, -387, 67, -387, -387, 73, -73, -387, 24, + -387, -387, -4, -387, 78, 84, 127, -387, -18, -18, + -18, -18, -18, -18, 66, 44, -18, -18, -387, 138, + -387, -387, -387, -387, -387, -387, -387, -387, -387, -387, + -387, -387, 144, -387, -387, -387, -387, -387, 236, -387, + -387, -387, -387, -387, 154, 140, 141, 10, 133, -387, + 145, 136, -387, 150, 151, 155, 156, 157, -387, 158, + 166, -387, -387, -387, -387, -387, 131, -13, 159, 162, + -387, -387, 173, -387, -387, 165, 175, 23, 232, 0, + -387, 125, -387, -387, -387, -387, 167, -387, 116, -387, + -387, -387, -387, 161, 116, 116, 116, 116, 116, 116, + -387, -387, -387, -387, -387, -387, -387, -387, 105, 98, + 92, 19, 168, 30, 116, 131, 169, -387, -387, -387, + -387, -387, -387, -387, -387, -387, 30, 116, 160, 154, + 174, -387, -387, -387, 170, -387, -387, -387, -387, -387, + -387, -387, 210, -387, -387, 134, 258, -387, 176, 149, + -387, 177, -10, 179, -387, 180, -387, -387, 135, -387, + -387, 167, -387, 172, 182, 183, 220, 46, 184, 106, + 185, 146, 123, 7, 186, 167, -387, -387, -387, -387, + -387, -387, -387, -387, -387, -387, 224, -387, 135, -387, + 187, -387, -387, 167, 189, 190, -387, 131, -45, -387, + 1, 193, 194, 226, 165, -387, 188, -387, -387, -387, + -387, -387, -387, 192, 116, -387, 191, 195, 131, 116, + 30, -387, 204, 205, 223, 116, -387, -387, -387, -387, + 287, 289, 290, -387, -387, -387, -387, 291, -387, -387, + -387, -387, 248, 291, 128, 206, 293, -387, 207, -387, + 167, 16, -387, -387, -387, 296, 294, 45, 209, -387, + 299, -387, 301, 299, -387, 215, 116, -387, -387, 214, + -387, -387, 225, 116, 116, -387, 212, -387, -387, -387, + -387, -387, -387, -387, 217, -387, -387, 221, 219, 222, + -387, 227, -387, 228, -387, 229, -387, 231, -387, 237, + -387, -387, -387, -387, -387, -387, -387, 310, -387, -387, + -387, 311, -387, -387, -387, -387, -387, -387, -387, 238, + -387, -387, -387, -387, 164, 312, -387, 239, -387, 241, + 243, -387, 63, -387, -387, 137, -387, 235, -15, 247, + 33, -387, 313, -387, 124, 116, -387, -387, 280, 129, + 146, -387, 245, -387, 246, -387, -387, -387, -387, -387, + -387, -387, 249, -387, -387, -387, 116, -387, 315, 325, + -387, 116, -387, -387, -387, 116, 142, 92, 71, -387, + -387, -387, -387, -387, -387, -387, -387, 250, -387, -387, + -387, -387, -387, -387, -387, -387, -387, -387, -387, -387, + -387, -387, -387, -387, -387, -387, 327, -387, -387, 40, + -387, -387, -387, 72, -387, -387, -387, -387, 251, 254, + 253, 255, -387, 302, 33, -387, -387, -387, -387, -387, + -387, 116, -387, 116, 223, 287, 289, 256, -387, -387, + 252, 260, 263, 261, 259, 262, 269, 312, -387, 116, + 124, -387, 287, -387, 289, 119, -387, -387, -387, -387, + 312, 264, -387 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, - -401, -401, -401, -401, -401, -401, -401, -401, -401, -76, - -80, -401, -98, 150, -83, 205, -401, -401, -361, -401, - -18, -401, -401, -401, -401, -401, -401, -401, -401, 164, - -401, -401, -401, 178, -401, -401, -401, 287, -401, -401, - -401, 106, -401, -401, -401, -401, -401, -401, -401, -401, - -401, -401, -49, -401, -85, -401, -401, -401, -401, -401, - -401, -401, -401, -401, -401, -401, -330, 130, -401, -401, - -401, -401, -401, -401, -401, -401, -401, -401, -401, -401, - 0, -401, -401, -400, -401, -401, -401, -401, -401, -401, - 291, -401, -401, -401, -401, -401, -401, -401, -302, -317, - 292, -401, -401, -139, -84, -113, -86, -401, -401, -401, - -401, -401, 252, -401, 186, -401, -401, -401, -166, 190, - -133, -401, -401, -401, -401, -401, -401, -6 + -387, -387, -387, -387, -387, -387, -387, -387, -387, -387, + -387, -387, -387, -387, -387, -387, -387, -387, -387, -67, + -82, -387, -100, 152, -86, 201, -387, -387, -365, -387, + -11, -387, -387, -387, -387, -387, -387, -387, -387, 171, + -387, -387, -387, -118, -387, -387, 230, -387, -387, -387, + -387, -387, 292, -387, -387, -387, 107, -387, -387, -387, + -387, -387, -387, -387, -387, -387, -387, -51, -387, -88, + -387, -387, -387, -387, -387, -387, -387, -387, -387, -387, + -387, -304, 132, -387, -387, -387, -387, -387, -387, -387, + -387, -387, -387, -387, -387, -3, -387, -387, -361, -387, + -387, -387, -387, -387, -387, 297, -387, -387, -387, -387, + -387, -387, -387, -386, -376, 298, -387, -387, -139, -87, + -120, -89, -387, -387, -387, -387, -387, 257, -387, 178, + -387, -387, -387, -176, 196, -153, -387, -387, -387, -387, + -387, -387, -6 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -222 +#define YYTABLE_NINF -230 static const yytype_int16 yytable[] = { - 145, 139, 143, 52, 199, 155, 244, 415, 158, 109, - 110, 369, 151, 268, 223, 153, 405, 153, 58, 154, - 153, 156, 157, 252, 111, 13, 14, 15, 234, 229, - 16, 145, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 257, 452, 109, 110, 206, 112, 5, - 109, 110, 111, 59, 319, 235, 118, 458, 146, 113, - 111, 261, 297, 400, 7, 111, 297, 253, 298, 438, - 147, 266, 298, 320, 310, 311, 427, 401, 238, 267, - 239, 223, 114, 189, 112, 453, 115, 10, 11, 112, - 68, 190, 240, 297, 112, 113, 116, 402, 198, 298, - 113, 299, 117, 53, 191, 113, 55, 192, 301, 403, - 114, 205, 301, 373, 193, 312, 443, 309, 114, 10, - 11, 280, 115, 114, 374, 1, 2, 115, 194, 79, - 441, 80, 220, 153, 456, 279, 85, 300, 117, 301, - 86, 159, 286, 117, 56, 71, 72, 455, 117, 160, - 213, 195, 196, 329, 166, 363, 167, 214, 88, 89, - 10, 11, 168, 364, 71, 72, 90, 117, 421, 169, - 170, 171, 161, 172, 428, 173, 422, 57, 226, 68, - 145, 406, 429, 164, 174, 227, 162, 335, 91, 92, - 245, 336, 239, 246, 247, 165, 417, 248, 71, 72, - 457, 175, 176, 93, 240, 249, 409, 77, 418, 385, - 386, 387, 388, 389, 390, 391, 392, 393, 394, 395, - 396, 211, 212, 250, 63, 64, 65, 66, 67, 365, - 366, 75, 76, 200, 81, 78, 201, 202, 96, 97, - 98, 99, 131, 353, 354, 355, 356, 95, 83, 84, - 410, 145, 378, 143, 101, 102, 103, 104, 107, 398, - 105, 106, 129, 134, 130, 133, 136, 209, 149, -65, - 204, 216, 233, 210, 58, 207, 218, 145, 219, 224, - 225, 258, 335, 230, 231, 232, 237, 243, 255, 416, - 260, 262, 263, 273, 274, 278, 282, 276, -221, 284, - 287, 289, 291, 293, 295, 305, 304, 308, 315, 323, - 317, 322, 325, 328, 330, 437, 331, 337, 339, 348, - 338, 350, 341, 342, 358, 383, 368, 399, 411, 371, - 343, 344, 345, 346, 347, 145, 378, 143, 352, 360, - 361, 362, 145, 372, 335, 407, 413, 408, 409, 424, - 423, 430, 432, 431, 434, 439, 433, 444, 446, 447, - 335, 449, 451, 448, 445, 450, 459, 454, 272, 327, - 281, 135, 436, 296, 420, 0, 265, 140, 141, 259, - 0, 0, 0, 0, 208, 0, 0, 0, 0, 0, - 0, 0, 0, 275 + 152, 146, 150, 52, 208, 254, 164, 209, 382, 167, + 116, 117, 158, 116, 117, 162, 428, 162, 239, 163, + 162, 165, 166, 233, 278, 118, 10, 11, 118, 13, + 14, 15, 267, 262, 16, 152, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 58, 198, 119, + 271, 212, 119, 116, 117, 418, 199, 323, 324, 454, + 120, 118, 119, 120, 276, 310, 125, 5, 118, 200, + 456, 311, 201, 120, 277, 244, 468, 263, 451, 202, + 332, 7, 59, 121, 10, 11, 121, 122, 469, 275, + 122, 233, 119, 203, 466, 386, 465, 123, 325, 333, + 230, 68, 245, 120, 53, 124, 387, 322, 124, 471, + 292, 314, 207, 72, 73, 440, 204, 205, 124, 121, + 175, 88, 176, 10, 11, 211, 121, 89, 177, 293, + 122, 248, 173, 249, 168, 178, 179, 180, 289, 181, + 162, 182, 169, 71, 174, 250, 72, 73, 124, 299, + 183, 124, 153, 310, 310, 413, 342, 72, 73, 311, + 311, 312, 91, 92, 154, 170, 68, 184, 185, 414, + 93, 255, 376, 249, 256, 257, 430, 55, 258, 171, + 434, 441, 377, 56, 419, 250, 259, 152, 431, 415, + 435, 442, 94, 95, 348, 219, 236, 313, 349, 314, + 314, 416, 220, 237, 260, 1, 2, 96, 398, 399, + 400, 401, 402, 403, 404, 405, 406, 407, 408, 409, + 63, 64, 65, 66, 67, 470, 57, 78, 79, 72, + 73, 422, 112, 217, 218, 113, 114, 99, 100, 101, + 102, 366, 367, 368, 369, 82, 80, 83, 71, 225, + 378, 379, 81, 84, 98, 143, 423, 86, 87, 104, + 105, 152, 391, 150, 106, 107, 108, 109, 136, 411, + 110, 137, 138, 215, 140, 141, 159, 213, 156, -66, + 210, 222, 216, 240, 243, 224, 229, 152, 234, 235, + 268, 58, 348, 241, 242, 247, 253, 265, 270, 429, + 272, 273, 283, 284, 288, 286, 297, 290, 295, -229, + 300, 291, 302, 304, 306, 308, 318, 317, 321, 328, + 335, 450, 336, 330, 338, 341, 343, 351, 354, 344, + 350, 355, 352, 361, 363, 371, 396, 412, 424, 356, + 357, 358, 384, 359, 381, 152, 391, 150, 426, 360, + 365, 373, 152, 374, 348, 375, 385, 420, 421, 437, + 443, 422, 436, 444, 445, 462, 446, 457, 447, 459, + 348, 458, 460, 461, 463, 464, 472, 452, 467, 142, + 340, 282, 294, 449, 433, 309, 147, 148, 0, 226, + 0, 285, 0, 0, 269, 0, 214 }; static const yytype_int16 yycheck[] = { - 86, 86, 86, 9, 117, 103, 172, 368, 106, 23, - 24, 23, 95, 23, 153, 101, 346, 103, 65, 102, - 106, 104, 105, 26, 38, 5, 6, 7, 29, 162, - 10, 117, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 176, 444, 23, 24, 130, 62, 0, - 23, 24, 38, 100, 35, 56, 74, 457, 27, 73, - 38, 194, 25, 26, 8, 38, 25, 70, 31, 430, - 39, 109, 31, 54, 41, 42, 406, 40, 25, 117, - 27, 220, 96, 29, 62, 446, 100, 99, 100, 62, - 100, 37, 39, 25, 62, 73, 110, 60, 116, 31, - 73, 33, 116, 108, 50, 73, 99, 53, 71, 72, - 96, 129, 71, 62, 60, 82, 433, 250, 96, 99, - 100, 219, 100, 96, 73, 3, 4, 100, 74, 9, - 432, 11, 110, 219, 451, 218, 111, 69, 116, 71, - 115, 29, 225, 116, 99, 113, 114, 449, 116, 37, - 61, 97, 98, 266, 28, 109, 30, 68, 29, 30, - 99, 100, 36, 117, 113, 114, 37, 116, 109, 43, - 44, 45, 60, 47, 109, 49, 117, 99, 61, 100, - 266, 347, 117, 34, 58, 68, 74, 273, 59, 60, - 48, 274, 27, 51, 52, 46, 34, 55, 113, 114, - 106, 75, 76, 74, 39, 63, 112, 108, 46, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 95, 23, 24, 81, 19, 20, 21, 22, 23, 113, - 114, 26, 27, 101, 99, 108, 104, 105, 101, 102, - 103, 104, 99, 77, 78, 79, 80, 109, 115, 115, - 363, 337, 337, 337, 109, 109, 109, 109, 104, 342, - 109, 109, 109, 100, 109, 109, 23, 99, 111, 111, - 111, 23, 64, 112, 65, 115, 109, 363, 109, 109, - 109, 66, 368, 111, 111, 111, 111, 111, 111, 372, - 111, 111, 111, 109, 109, 112, 104, 115, 104, 83, - 23, 23, 23, 23, 67, 23, 111, 111, 23, 23, - 29, 111, 23, 110, 112, 428, 104, 116, 111, 23, - 110, 23, 109, 109, 23, 23, 109, 57, 23, 335, - 112, 112, 112, 112, 112, 421, 421, 421, 112, 112, - 112, 112, 428, 109, 430, 112, 23, 112, 112, 32, - 112, 109, 111, 109, 66, 431, 111, 111, 109, 109, - 446, 106, 106, 112, 117, 112, 112, 447, 204, 263, - 220, 84, 421, 243, 374, -1, 198, 86, 86, 189, - -1, -1, -1, -1, 132, -1, -1, -1, -1, -1, - -1, -1, -1, 207 + 89, 89, 89, 9, 124, 181, 106, 125, 23, 109, + 23, 24, 98, 23, 24, 104, 381, 106, 171, 105, + 109, 107, 108, 162, 23, 38, 99, 100, 38, 5, + 6, 7, 185, 26, 10, 124, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 65, 29, 62, + 203, 137, 62, 23, 24, 359, 37, 41, 42, 445, + 73, 38, 62, 73, 109, 25, 77, 0, 38, 50, + 446, 31, 53, 73, 119, 29, 462, 70, 443, 60, + 35, 8, 100, 96, 99, 100, 96, 100, 464, 207, + 100, 230, 62, 74, 459, 62, 457, 110, 82, 54, + 110, 100, 56, 73, 108, 118, 73, 260, 118, 470, + 228, 71, 123, 113, 114, 419, 97, 98, 118, 96, + 28, 111, 30, 99, 100, 136, 96, 117, 36, 229, + 100, 25, 34, 27, 29, 43, 44, 45, 224, 47, + 229, 49, 37, 99, 46, 39, 113, 114, 118, 235, + 58, 118, 27, 25, 25, 26, 276, 113, 114, 31, + 31, 33, 29, 30, 39, 60, 100, 75, 76, 40, + 37, 48, 109, 27, 51, 52, 34, 99, 55, 74, + 109, 109, 119, 99, 360, 39, 63, 276, 46, 60, + 119, 119, 59, 60, 283, 61, 61, 69, 284, 71, + 71, 72, 68, 68, 81, 3, 4, 74, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 19, 20, 21, 22, 23, 106, 99, 26, 27, 113, + 114, 112, 101, 23, 24, 104, 105, 101, 102, 103, + 104, 77, 78, 79, 80, 9, 108, 11, 99, 100, + 113, 114, 108, 99, 109, 23, 376, 117, 117, 109, + 109, 350, 350, 350, 109, 109, 109, 109, 109, 355, + 104, 109, 99, 99, 109, 100, 115, 117, 111, 111, + 111, 23, 112, 111, 64, 109, 109, 376, 109, 109, + 66, 65, 381, 111, 111, 111, 111, 111, 111, 385, + 111, 111, 109, 109, 112, 117, 83, 116, 104, 104, + 23, 116, 23, 23, 23, 67, 23, 111, 111, 23, + 111, 441, 23, 29, 23, 110, 112, 110, 109, 104, + 118, 109, 111, 23, 23, 23, 23, 57, 23, 112, + 112, 112, 348, 112, 109, 434, 434, 434, 23, 112, + 112, 112, 441, 112, 443, 112, 109, 112, 112, 32, + 109, 112, 112, 109, 111, 106, 111, 111, 66, 109, + 459, 119, 109, 112, 112, 106, 112, 444, 460, 87, + 273, 210, 230, 434, 387, 253, 89, 89, -1, 159, + -1, 213, -1, -1, 198, -1, 139 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = +static const yytype_uint16 yystos[] = { - 0, 3, 4, 119, 120, 0, 121, 8, 122, 123, - 99, 100, 255, 5, 6, 7, 10, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 124, 125, - 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, - 136, 139, 163, 164, 171, 172, 173, 235, 237, 238, - 241, 254, 255, 108, 239, 99, 99, 99, 65, 100, - 143, 149, 242, 143, 143, 143, 143, 143, 100, 144, - 157, 113, 114, 142, 234, 143, 143, 108, 108, 9, - 11, 99, 240, 115, 115, 111, 115, 175, 29, 30, - 37, 59, 60, 74, 243, 109, 101, 102, 103, 104, - 162, 109, 109, 109, 109, 109, 109, 104, 159, 23, - 24, 38, 62, 73, 96, 100, 110, 116, 148, 150, - 165, 179, 182, 218, 222, 225, 229, 231, 232, 109, - 109, 99, 236, 109, 100, 165, 23, 174, 178, 182, - 218, 228, 230, 232, 233, 234, 27, 39, 244, 111, - 248, 142, 140, 234, 142, 140, 142, 142, 140, 29, - 37, 60, 74, 170, 34, 46, 28, 30, 36, 43, - 44, 45, 47, 49, 58, 75, 76, 183, 185, 188, - 190, 192, 196, 199, 201, 203, 205, 208, 217, 29, - 37, 50, 53, 60, 74, 97, 98, 166, 148, 233, - 101, 104, 105, 161, 111, 148, 142, 115, 240, 99, - 112, 23, 24, 61, 68, 245, 23, 251, 109, 109, - 110, 141, 148, 231, 109, 109, 61, 68, 247, 248, - 111, 111, 111, 64, 29, 56, 200, 111, 25, 27, - 39, 189, 246, 111, 246, 48, 51, 52, 55, 63, - 81, 212, 26, 70, 204, 111, 250, 248, 66, 247, - 111, 248, 111, 111, 168, 161, 109, 117, 23, 151, - 152, 153, 157, 109, 109, 242, 115, 176, 112, 142, - 140, 141, 104, 160, 83, 137, 142, 23, 226, 23, - 227, 23, 202, 23, 195, 67, 195, 25, 31, 33, - 69, 71, 184, 194, 111, 23, 213, 214, 111, 248, - 41, 42, 82, 209, 210, 23, 253, 29, 193, 35, - 54, 197, 111, 23, 169, 23, 167, 169, 110, 233, - 112, 104, 158, 145, 146, 234, 142, 116, 110, 111, - 249, 109, 109, 112, 112, 112, 112, 112, 23, 216, - 23, 215, 112, 77, 78, 79, 80, 198, 23, 211, - 112, 112, 112, 109, 117, 113, 114, 154, 109, 23, - 147, 255, 109, 62, 73, 177, 180, 181, 182, 219, - 220, 223, 228, 23, 252, 84, 85, 86, 87, 88, - 89, 90, 91, 92, 93, 94, 95, 138, 142, 57, - 26, 40, 60, 72, 186, 194, 246, 112, 112, 112, - 233, 23, 155, 23, 156, 146, 142, 34, 46, 206, - 208, 109, 117, 112, 32, 187, 191, 194, 109, 117, - 109, 109, 111, 111, 66, 207, 180, 233, 146, 137, - 221, 226, 224, 227, 111, 117, 109, 109, 112, 106, - 112, 106, 211, 146, 138, 226, 227, 106, 211, 112 + 0, 3, 4, 121, 122, 0, 123, 8, 124, 125, + 99, 100, 262, 5, 6, 7, 10, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 126, 127, + 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, + 138, 141, 170, 171, 178, 179, 180, 242, 244, 245, + 248, 261, 262, 108, 246, 99, 99, 99, 65, 100, + 145, 151, 249, 145, 145, 145, 145, 145, 100, 146, + 159, 99, 113, 114, 144, 166, 168, 241, 145, 145, + 108, 108, 9, 11, 99, 247, 117, 117, 111, 117, + 182, 29, 30, 37, 59, 60, 74, 250, 109, 101, + 102, 103, 104, 164, 109, 109, 109, 109, 109, 109, + 104, 161, 101, 104, 105, 163, 23, 24, 38, 62, + 73, 96, 100, 110, 118, 150, 152, 172, 186, 189, + 225, 229, 232, 236, 238, 239, 109, 109, 99, 243, + 109, 100, 172, 23, 181, 185, 189, 225, 235, 237, + 239, 240, 241, 27, 39, 251, 111, 255, 144, 115, + 165, 142, 241, 144, 142, 144, 144, 142, 29, 37, + 60, 74, 177, 34, 46, 28, 30, 36, 43, 44, + 45, 47, 49, 58, 75, 76, 190, 192, 195, 197, + 199, 203, 206, 208, 210, 212, 215, 224, 29, 37, + 50, 53, 60, 74, 97, 98, 173, 150, 240, 163, + 111, 150, 144, 117, 247, 99, 112, 23, 24, 61, + 68, 252, 23, 258, 109, 100, 166, 167, 169, 109, + 110, 143, 150, 238, 109, 109, 61, 68, 254, 255, + 111, 111, 111, 64, 29, 56, 207, 111, 25, 27, + 39, 196, 253, 111, 253, 48, 51, 52, 55, 63, + 81, 219, 26, 70, 211, 111, 257, 255, 66, 254, + 111, 255, 111, 111, 175, 163, 109, 119, 23, 153, + 154, 155, 159, 109, 109, 249, 117, 183, 112, 144, + 116, 116, 163, 142, 143, 104, 162, 83, 139, 144, + 23, 233, 23, 234, 23, 209, 23, 202, 67, 202, + 25, 31, 33, 69, 71, 191, 201, 111, 23, 220, + 221, 111, 255, 41, 42, 82, 216, 217, 23, 260, + 29, 200, 35, 54, 204, 111, 23, 176, 23, 174, + 176, 110, 240, 112, 104, 160, 147, 148, 241, 144, + 118, 110, 111, 256, 109, 109, 112, 112, 112, 112, + 112, 23, 223, 23, 222, 112, 77, 78, 79, 80, + 205, 23, 218, 112, 112, 112, 109, 119, 113, 114, + 156, 109, 23, 149, 262, 109, 62, 73, 184, 187, + 188, 189, 226, 227, 230, 235, 23, 259, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, + 140, 144, 57, 26, 40, 60, 72, 193, 201, 253, + 112, 112, 112, 240, 23, 157, 23, 158, 148, 144, + 34, 46, 213, 215, 109, 119, 112, 32, 194, 198, + 201, 109, 119, 109, 109, 111, 111, 66, 214, 187, + 240, 148, 139, 228, 233, 231, 234, 111, 119, 109, + 109, 112, 106, 112, 106, 218, 148, 140, 233, 234, + 106, 218, 112 }; #define yyerrok (yyerrstatus = 0) @@ -2104,7 +2119,7 @@ yyreduce: case 3: /* Line 1455 of yacc.c */ -#line 270 "program_parse.y" +#line 272 "program_parse.y" { if (state->prog->Target != GL_VERTEX_PROGRAM_ARB) { yyerror(& (yylsp[(1) - (1)]), state, "invalid fragment program header"); @@ -2117,7 +2132,7 @@ yyreduce: case 4: /* Line 1455 of yacc.c */ -#line 278 "program_parse.y" +#line 280 "program_parse.y" { if (state->prog->Target != GL_FRAGMENT_PROGRAM_ARB) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex program header"); @@ -2132,7 +2147,7 @@ yyreduce: case 7: /* Line 1455 of yacc.c */ -#line 294 "program_parse.y" +#line 296 "program_parse.y" { int valid = 0; @@ -2157,7 +2172,7 @@ yyreduce: case 10: /* Line 1455 of yacc.c */ -#line 320 "program_parse.y" +#line 322 "program_parse.y" { if ((yyvsp[(1) - (2)].inst) != NULL) { if (state->inst_tail == NULL) { @@ -2177,7 +2192,7 @@ yyreduce: case 12: /* Line 1455 of yacc.c */ -#line 338 "program_parse.y" +#line 340 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumAluInstructions++; @@ -2187,7 +2202,7 @@ yyreduce: case 13: /* Line 1455 of yacc.c */ -#line 343 "program_parse.y" +#line 345 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumTexInstructions++; @@ -2197,7 +2212,7 @@ yyreduce: case 24: /* Line 1455 of yacc.c */ -#line 364 "program_parse.y" +#line 366 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_ARL, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} @@ -2206,7 +2221,7 @@ yyreduce: case 25: /* Line 1455 of yacc.c */ -#line 370 "program_parse.y" +#line 372 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (4)].temp_inst), & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} @@ -2215,7 +2230,7 @@ yyreduce: case 26: /* Line 1455 of yacc.c */ -#line 376 "program_parse.y" +#line 378 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (4)].temp_inst), & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} @@ -2224,7 +2239,7 @@ yyreduce: case 27: /* Line 1455 of yacc.c */ -#line 382 "program_parse.y" +#line 384 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (6)].temp_inst), & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); ;} @@ -2233,7 +2248,7 @@ yyreduce: case 28: /* Line 1455 of yacc.c */ -#line 389 "program_parse.y" +#line 391 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (6)].temp_inst), & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); ;} @@ -2242,7 +2257,7 @@ yyreduce: case 29: /* Line 1455 of yacc.c */ -#line 396 "program_parse.y" +#line 398 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (8)].temp_inst), & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), & (yyvsp[(6) - (8)].src_reg), & (yyvsp[(8) - (8)].src_reg)); ;} @@ -2251,7 +2266,7 @@ yyreduce: case 30: /* Line 1455 of yacc.c */ -#line 402 "program_parse.y" +#line 404 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (8)].temp_inst), & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), NULL, NULL); if ((yyval.inst) != NULL) { @@ -2298,7 +2313,7 @@ yyreduce: case 31: /* Line 1455 of yacc.c */ -#line 446 "program_parse.y" +#line 448 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_KIL, NULL, & (yyvsp[(2) - (2)].src_reg), NULL, NULL); state->fragment.UsesKill = 1; @@ -2309,6 +2324,19 @@ yyreduce: /* Line 1455 of yacc.c */ #line 453 "program_parse.y" + { + (yyval.inst) = asm_instruction_ctor(OPCODE_KIL_NV, NULL, NULL, NULL, NULL); + (yyval.inst)->Base.DstReg.CondMask = (yyvsp[(2) - (2)].dst_reg).CondMask; + (yyval.inst)->Base.DstReg.CondSwizzle = (yyvsp[(2) - (2)].dst_reg).CondSwizzle; + (yyval.inst)->Base.DstReg.CondSrc = (yyvsp[(2) - (2)].dst_reg).CondSrc; + state->fragment.UsesKill = 1; + ;} + break; + + case 33: + +/* Line 1455 of yacc.c */ +#line 463 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (12)].temp_inst), & (yyvsp[(2) - (12)].dst_reg), & (yyvsp[(4) - (12)].src_reg), & (yyvsp[(6) - (12)].src_reg), & (yyvsp[(8) - (12)].src_reg)); if ((yyval.inst) != NULL) { @@ -2352,103 +2380,103 @@ yyreduce: ;} break; - case 33: + case 34: /* Line 1455 of yacc.c */ -#line 497 "program_parse.y" +#line 507 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; - case 34: + case 35: /* Line 1455 of yacc.c */ -#line 502 "program_parse.y" +#line 512 "program_parse.y" { (yyval.integer) = TEXTURE_1D_INDEX; ;} break; - case 35: + case 36: /* Line 1455 of yacc.c */ -#line 503 "program_parse.y" +#line 513 "program_parse.y" { (yyval.integer) = TEXTURE_2D_INDEX; ;} break; - case 36: + case 37: /* Line 1455 of yacc.c */ -#line 504 "program_parse.y" +#line 514 "program_parse.y" { (yyval.integer) = TEXTURE_3D_INDEX; ;} break; - case 37: + case 38: /* Line 1455 of yacc.c */ -#line 505 "program_parse.y" +#line 515 "program_parse.y" { (yyval.integer) = TEXTURE_CUBE_INDEX; ;} break; - case 38: + case 39: /* Line 1455 of yacc.c */ -#line 506 "program_parse.y" +#line 516 "program_parse.y" { (yyval.integer) = TEXTURE_RECT_INDEX; ;} break; - case 39: + case 40: /* Line 1455 of yacc.c */ -#line 507 "program_parse.y" +#line 517 "program_parse.y" { (yyval.integer) = -TEXTURE_1D_INDEX; ;} break; - case 40: + case 41: /* Line 1455 of yacc.c */ -#line 508 "program_parse.y" +#line 518 "program_parse.y" { (yyval.integer) = -TEXTURE_2D_INDEX; ;} break; - case 41: + case 42: /* Line 1455 of yacc.c */ -#line 509 "program_parse.y" +#line 519 "program_parse.y" { (yyval.integer) = -TEXTURE_RECT_INDEX; ;} break; - case 42: + case 43: /* Line 1455 of yacc.c */ -#line 510 "program_parse.y" +#line 520 "program_parse.y" { (yyval.integer) = TEXTURE_1D_ARRAY_INDEX; ;} break; - case 43: + case 44: /* Line 1455 of yacc.c */ -#line 511 "program_parse.y" +#line 521 "program_parse.y" { (yyval.integer) = TEXTURE_2D_ARRAY_INDEX; ;} break; - case 44: + case 45: /* Line 1455 of yacc.c */ -#line 512 "program_parse.y" +#line 522 "program_parse.y" { (yyval.integer) = -TEXTURE_1D_ARRAY_INDEX; ;} break; - case 45: + case 46: /* Line 1455 of yacc.c */ -#line 513 "program_parse.y" +#line 523 "program_parse.y" { (yyval.integer) = -TEXTURE_2D_ARRAY_INDEX; ;} break; - case 46: + case 47: /* Line 1455 of yacc.c */ -#line 517 "program_parse.y" +#line 527 "program_parse.y" { /* FIXME: Is this correct? Should the extenedSwizzle be applied * FIXME: to the existing swizzle? @@ -2460,10 +2488,10 @@ yyreduce: ;} break; - case 47: + case 48: /* Line 1455 of yacc.c */ -#line 529 "program_parse.y" +#line 539 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (2)].src_reg); @@ -2473,10 +2501,10 @@ yyreduce: ;} break; - case 48: + case 49: /* Line 1455 of yacc.c */ -#line 537 "program_parse.y" +#line 547 "program_parse.y" { (yyval.src_reg) = (yyvsp[(3) - (4)].src_reg); @@ -2493,10 +2521,10 @@ yyreduce: ;} break; - case 49: + case 50: /* Line 1455 of yacc.c */ -#line 554 "program_parse.y" +#line 564 "program_parse.y" { (yyval.src_reg) = (yyvsp[(1) - (2)].src_reg); @@ -2505,10 +2533,10 @@ yyreduce: ;} break; - case 50: + case 51: /* Line 1455 of yacc.c */ -#line 561 "program_parse.y" +#line 571 "program_parse.y" { struct asm_symbol temp_sym; @@ -2527,10 +2555,10 @@ yyreduce: ;} break; - case 51: + case 52: /* Line 1455 of yacc.c */ -#line 580 "program_parse.y" +#line 590 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); @@ -2543,10 +2571,10 @@ yyreduce: ;} break; - case 52: + case 53: /* Line 1455 of yacc.c */ -#line 591 "program_parse.y" +#line 601 "program_parse.y" { (yyval.src_reg) = (yyvsp[(3) - (5)].src_reg); @@ -2565,13 +2593,16 @@ yyreduce: ;} break; - case 53: + case 54: /* Line 1455 of yacc.c */ -#line 611 "program_parse.y" +#line 621 "program_parse.y" { - (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); - (yyval.dst_reg).WriteMask = (yyvsp[(2) - (2)].swiz_mask).mask; + (yyval.dst_reg) = (yyvsp[(1) - (3)].dst_reg); + (yyval.dst_reg).WriteMask = (yyvsp[(2) - (3)].swiz_mask).mask; + (yyval.dst_reg).CondMask = (yyvsp[(3) - (3)].dst_reg).CondMask; + (yyval.dst_reg).CondSwizzle = (yyvsp[(3) - (3)].dst_reg).CondSwizzle; + (yyval.dst_reg).CondSrc = (yyvsp[(3) - (3)].dst_reg).CondSrc; if ((yyval.dst_reg).File == PROGRAM_OUTPUT) { /* Technically speaking, this should check that it is in @@ -2580,7 +2611,7 @@ yyreduce: */ if (state->option.PositionInvariant && ((yyval.dst_reg).Index == VERT_RESULT_HPOS)) { - yyerror(& (yylsp[(1) - (2)]), state, "position-invariant programs cannot " + yyerror(& (yylsp[(1) - (3)]), state, "position-invariant programs cannot " "write position"); YYERROR; } @@ -2590,10 +2621,10 @@ yyreduce: ;} break; - case 54: + case 55: /* Line 1455 of yacc.c */ -#line 633 "program_parse.y" +#line 646 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_ADDRESS; @@ -2602,10 +2633,10 @@ yyreduce: ;} break; - case 55: + case 56: /* Line 1455 of yacc.c */ -#line 642 "program_parse.y" +#line 655 "program_parse.y" { const unsigned xyzw_valid = ((yyvsp[(1) - (7)].ext_swizzle).xyzw_valid << 0) @@ -2638,20 +2669,20 @@ yyreduce: ;} break; - case 56: + case 57: /* Line 1455 of yacc.c */ -#line 675 "program_parse.y" +#line 688 "program_parse.y" { (yyval.ext_swizzle) = (yyvsp[(2) - (2)].ext_swizzle); (yyval.ext_swizzle).negate = ((yyvsp[(1) - (2)].negate)) ? 1 : 0; ;} break; - case 57: + case 58: /* Line 1455 of yacc.c */ -#line 682 "program_parse.y" +#line 695 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) != 0) && ((yyvsp[(1) - (1)].integer) != 1)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2668,10 +2699,10 @@ yyreduce: ;} break; - case 58: + case 59: /* Line 1455 of yacc.c */ -#line 697 "program_parse.y" +#line 710 "program_parse.y" { if (strlen((yyvsp[(1) - (1)].string)) > 1) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2721,10 +2752,10 @@ yyreduce: ;} break; - case 59: + case 60: /* Line 1455 of yacc.c */ -#line 747 "program_parse.y" +#line 760 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2768,10 +2799,10 @@ yyreduce: ;} break; - case 60: + case 61: /* Line 1455 of yacc.c */ -#line 789 "program_parse.y" +#line 802 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = PROGRAM_INPUT; @@ -2784,10 +2815,10 @@ yyreduce: ;} break; - case 61: + case 62: /* Line 1455 of yacc.c */ -#line 800 "program_parse.y" +#line 813 "program_parse.y" { if (! (yyvsp[(3) - (4)].src_reg).Base.RelAddr && ((unsigned) (yyvsp[(3) - (4)].src_reg).Base.Index >= (yyvsp[(1) - (4)].sym)->param_binding_length)) { @@ -2810,10 +2841,10 @@ yyreduce: ;} break; - case 62: + case 63: /* Line 1455 of yacc.c */ -#line 821 "program_parse.y" +#line 834 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = ((yyvsp[(1) - (1)].temp_sym).name != NULL) @@ -2823,10 +2854,10 @@ yyreduce: ;} break; - case 63: + case 64: /* Line 1455 of yacc.c */ -#line 831 "program_parse.y" +#line 844 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_OUTPUT; @@ -2834,10 +2865,10 @@ yyreduce: ;} break; - case 64: + case 65: /* Line 1455 of yacc.c */ -#line 837 "program_parse.y" +#line 850 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2868,10 +2899,10 @@ yyreduce: ;} break; - case 65: + case 66: /* Line 1455 of yacc.c */ -#line 868 "program_parse.y" +#line 881 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2888,20 +2919,20 @@ yyreduce: ;} break; - case 68: + case 69: /* Line 1455 of yacc.c */ -#line 887 "program_parse.y" +#line 900 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].integer); ;} break; - case 69: + case 70: /* Line 1455 of yacc.c */ -#line 894 "program_parse.y" +#line 907 "program_parse.y" { /* FINISHME: Add support for multiple address registers. */ @@ -2913,31 +2944,31 @@ yyreduce: ;} break; - case 70: + case 71: /* Line 1455 of yacc.c */ -#line 905 "program_parse.y" +#line 918 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 71: + case 72: /* Line 1455 of yacc.c */ -#line 906 "program_parse.y" +#line 919 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; - case 72: + case 73: /* Line 1455 of yacc.c */ -#line 907 "program_parse.y" +#line 920 "program_parse.y" { (yyval.integer) = -(yyvsp[(2) - (2)].integer); ;} break; - case 73: + case 74: /* Line 1455 of yacc.c */ -#line 911 "program_parse.y" +#line 924 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 63)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2949,10 +2980,10 @@ yyreduce: ;} break; - case 74: + case 75: /* Line 1455 of yacc.c */ -#line 923 "program_parse.y" +#line 936 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 64)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2964,10 +2995,10 @@ yyreduce: ;} break; - case 75: + case 76: /* Line 1455 of yacc.c */ -#line 935 "program_parse.y" +#line 948 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2985,10 +3016,10 @@ yyreduce: ;} break; - case 76: + case 77: /* Line 1455 of yacc.c */ -#line 953 "program_parse.y" +#line 966 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, "invalid address component selector"); @@ -2999,10 +3030,10 @@ yyreduce: ;} break; - case 77: + case 78: /* Line 1455 of yacc.c */ -#line 964 "program_parse.y" +#line 977 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, @@ -3014,24 +3045,125 @@ yyreduce: ;} break; - case 82: + case 83: /* Line 1455 of yacc.c */ -#line 980 "program_parse.y" +#line 993 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; - case 87: + case 88: /* Line 1455 of yacc.c */ -#line 984 "program_parse.y" +#line 997 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; + case 89: + +/* Line 1455 of yacc.c */ +#line 1001 "program_parse.y" + { + (yyval.dst_reg) = (yyvsp[(2) - (3)].dst_reg); + ;} + break; + + case 90: + +/* Line 1455 of yacc.c */ +#line 1005 "program_parse.y" + { + (yyval.dst_reg) = (yyvsp[(2) - (3)].dst_reg); + ;} + break; + + case 91: + +/* Line 1455 of yacc.c */ +#line 1009 "program_parse.y" + { + (yyval.dst_reg).CondMask = COND_TR; + (yyval.dst_reg).CondSwizzle = SWIZZLE_NOOP; + (yyval.dst_reg).CondSrc = 0; + ;} + break; + + case 92: + +/* Line 1455 of yacc.c */ +#line 1017 "program_parse.y" + { + (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); + (yyval.dst_reg).CondSwizzle = (yyvsp[(2) - (2)].swiz_mask).swizzle; + ;} + break; + + case 93: + +/* Line 1455 of yacc.c */ +#line 1024 "program_parse.y" + { + (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); + (yyval.dst_reg).CondSwizzle = (yyvsp[(2) - (2)].swiz_mask).swizzle; + ;} + break; + case 94: /* Line 1455 of yacc.c */ -#line 996 "program_parse.y" +#line 1031 "program_parse.y" + { + const int cond = _mesa_parse_cc((yyvsp[(1) - (1)].string)); + if ((cond == 0) || ((yyvsp[(1) - (1)].string)[2] != '\0')) { + char *const err_str = + make_error_string("invalid condition code \"%s\"", (yyvsp[(1) - (1)].string)); + + yyerror(& (yylsp[(1) - (1)]), state, (err_str != NULL) + ? err_str : "invalid condition code"); + + if (err_str != NULL) { + _mesa_free(err_str); + } + + YYERROR; + } + + (yyval.dst_reg).CondMask = cond; + (yyval.dst_reg).CondSwizzle = SWIZZLE_NOOP; + (yyval.dst_reg).CondSrc = 0; + ;} + break; + + case 95: + +/* Line 1455 of yacc.c */ +#line 1054 "program_parse.y" + { + const int cond = _mesa_parse_cc((yyvsp[(1) - (1)].string)); + if ((cond == 0) || ((yyvsp[(1) - (1)].string)[2] != '\0')) { + char *const err_str = + make_error_string("invalid condition code \"%s\"", (yyvsp[(1) - (1)].string)); + + yyerror(& (yylsp[(1) - (1)]), state, (err_str != NULL) + ? err_str : "invalid condition code"); + + if (err_str != NULL) { + _mesa_free(err_str); + } + + YYERROR; + } + + (yyval.dst_reg).CondMask = cond; + (yyval.dst_reg).CondSwizzle = SWIZZLE_NOOP; + (yyval.dst_reg).CondSrc = 0; + ;} + break; + + case 102: + +/* Line 1455 of yacc.c */ +#line 1085 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_attrib, & (yylsp[(2) - (4)])); @@ -3049,55 +3181,55 @@ yyreduce: ;} break; - case 95: + case 103: /* Line 1455 of yacc.c */ -#line 1014 "program_parse.y" +#line 1103 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} break; - case 96: + case 104: /* Line 1455 of yacc.c */ -#line 1018 "program_parse.y" +#line 1107 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} break; - case 97: + case 105: /* Line 1455 of yacc.c */ -#line 1024 "program_parse.y" +#line 1113 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_POS; ;} break; - case 98: + case 106: /* Line 1455 of yacc.c */ -#line 1028 "program_parse.y" +#line 1117 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_WEIGHT; ;} break; - case 99: + case 107: /* Line 1455 of yacc.c */ -#line 1032 "program_parse.y" +#line 1121 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_NORMAL; ;} break; - case 100: + case 108: /* Line 1455 of yacc.c */ -#line 1036 "program_parse.y" +#line 1125 "program_parse.y" { if (!state->ctx->Extensions.EXT_secondary_color) { yyerror(& (yylsp[(2) - (2)]), state, "GL_EXT_secondary_color not supported"); @@ -3108,10 +3240,10 @@ yyreduce: ;} break; - case 101: + case 109: /* Line 1455 of yacc.c */ -#line 1045 "program_parse.y" +#line 1134 "program_parse.y" { if (!state->ctx->Extensions.EXT_fog_coord) { yyerror(& (yylsp[(1) - (1)]), state, "GL_EXT_fog_coord not supported"); @@ -3122,38 +3254,38 @@ yyreduce: ;} break; - case 102: + case 110: /* Line 1455 of yacc.c */ -#line 1054 "program_parse.y" +#line 1143 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} break; - case 103: + case 111: /* Line 1455 of yacc.c */ -#line 1058 "program_parse.y" +#line 1147 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; ;} break; - case 104: + case 112: /* Line 1455 of yacc.c */ -#line 1063 "program_parse.y" +#line 1152 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_GENERIC0 + (yyvsp[(3) - (4)].integer); ;} break; - case 105: + case 113: /* Line 1455 of yacc.c */ -#line 1069 "program_parse.y" +#line 1158 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxAttribs) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex attribute reference"); @@ -3164,46 +3296,46 @@ yyreduce: ;} break; - case 109: + case 117: /* Line 1455 of yacc.c */ -#line 1083 "program_parse.y" +#line 1172 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_WPOS; ;} break; - case 110: + case 118: /* Line 1455 of yacc.c */ -#line 1087 "program_parse.y" +#line 1176 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_COL0 + (yyvsp[(2) - (2)].integer); ;} break; - case 111: + case 119: /* Line 1455 of yacc.c */ -#line 1091 "program_parse.y" +#line 1180 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_FOGC; ;} break; - case 112: + case 120: /* Line 1455 of yacc.c */ -#line 1095 "program_parse.y" +#line 1184 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} break; - case 115: + case 123: /* Line 1455 of yacc.c */ -#line 1103 "program_parse.y" +#line 1192 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (3)].string), at_param, & (yylsp[(2) - (3)])); @@ -3219,10 +3351,10 @@ yyreduce: ;} break; - case 116: + case 124: /* Line 1455 of yacc.c */ -#line 1119 "program_parse.y" +#line 1208 "program_parse.y" { if (((yyvsp[(4) - (6)].integer) != 0) && ((unsigned) (yyvsp[(4) - (6)].integer) != (yyvsp[(6) - (6)].temp_sym).param_binding_length)) { yyerror(& (yylsp[(4) - (6)]), state, @@ -3244,19 +3376,19 @@ yyreduce: ;} break; - case 117: + case 125: /* Line 1455 of yacc.c */ -#line 1141 "program_parse.y" +#line 1230 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 118: + case 126: /* Line 1455 of yacc.c */ -#line 1145 "program_parse.y" +#line 1234 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 1) || ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxParameters)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid parameter array size"); @@ -3267,38 +3399,38 @@ yyreduce: ;} break; - case 119: + case 127: /* Line 1455 of yacc.c */ -#line 1156 "program_parse.y" +#line 1245 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(2) - (2)].temp_sym); ;} break; - case 120: + case 128: /* Line 1455 of yacc.c */ -#line 1162 "program_parse.y" +#line 1251 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(3) - (4)].temp_sym); ;} break; - case 122: + case 130: /* Line 1455 of yacc.c */ -#line 1169 "program_parse.y" +#line 1258 "program_parse.y" { (yyvsp[(1) - (3)].temp_sym).param_binding_length += (yyvsp[(3) - (3)].temp_sym).param_binding_length; (yyval.temp_sym) = (yyvsp[(1) - (3)].temp_sym); ;} break; - case 123: + case 131: /* Line 1455 of yacc.c */ -#line 1176 "program_parse.y" +#line 1265 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3306,10 +3438,10 @@ yyreduce: ;} break; - case 124: + case 132: /* Line 1455 of yacc.c */ -#line 1182 "program_parse.y" +#line 1271 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3317,10 +3449,10 @@ yyreduce: ;} break; - case 125: + case 133: /* Line 1455 of yacc.c */ -#line 1188 "program_parse.y" +#line 1277 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3328,10 +3460,10 @@ yyreduce: ;} break; - case 126: + case 134: /* Line 1455 of yacc.c */ -#line 1196 "program_parse.y" +#line 1285 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3339,10 +3471,10 @@ yyreduce: ;} break; - case 127: + case 135: /* Line 1455 of yacc.c */ -#line 1202 "program_parse.y" +#line 1291 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3350,10 +3482,10 @@ yyreduce: ;} break; - case 128: + case 136: /* Line 1455 of yacc.c */ -#line 1208 "program_parse.y" +#line 1297 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3361,10 +3493,10 @@ yyreduce: ;} break; - case 129: + case 137: /* Line 1455 of yacc.c */ -#line 1216 "program_parse.y" +#line 1305 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3372,10 +3504,10 @@ yyreduce: ;} break; - case 130: + case 138: /* Line 1455 of yacc.c */ -#line 1222 "program_parse.y" +#line 1311 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3383,10 +3515,10 @@ yyreduce: ;} break; - case 131: + case 139: /* Line 1455 of yacc.c */ -#line 1228 "program_parse.y" +#line 1317 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3394,101 +3526,101 @@ yyreduce: ;} break; - case 132: + case 140: /* Line 1455 of yacc.c */ -#line 1235 "program_parse.y" +#line 1324 "program_parse.y" { memcpy((yyval.state), (yyvsp[(1) - (1)].state), sizeof((yyval.state))); ;} break; - case 133: + case 141: /* Line 1455 of yacc.c */ -#line 1236 "program_parse.y" +#line 1325 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 134: + case 142: /* Line 1455 of yacc.c */ -#line 1239 "program_parse.y" +#line 1328 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 135: + case 143: /* Line 1455 of yacc.c */ -#line 1240 "program_parse.y" +#line 1329 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 136: + case 144: /* Line 1455 of yacc.c */ -#line 1241 "program_parse.y" +#line 1330 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 137: + case 145: /* Line 1455 of yacc.c */ -#line 1242 "program_parse.y" +#line 1331 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 138: + case 146: /* Line 1455 of yacc.c */ -#line 1243 "program_parse.y" +#line 1332 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 139: + case 147: /* Line 1455 of yacc.c */ -#line 1244 "program_parse.y" +#line 1333 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 140: + case 148: /* Line 1455 of yacc.c */ -#line 1245 "program_parse.y" +#line 1334 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 141: + case 149: /* Line 1455 of yacc.c */ -#line 1246 "program_parse.y" +#line 1335 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 142: + case 150: /* Line 1455 of yacc.c */ -#line 1247 "program_parse.y" +#line 1336 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 143: + case 151: /* Line 1455 of yacc.c */ -#line 1248 "program_parse.y" +#line 1337 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 144: + case 152: /* Line 1455 of yacc.c */ -#line 1249 "program_parse.y" +#line 1338 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 145: + case 153: /* Line 1455 of yacc.c */ -#line 1253 "program_parse.y" +#line 1342 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_MATERIAL; @@ -3497,37 +3629,37 @@ yyreduce: ;} break; - case 146: + case 154: /* Line 1455 of yacc.c */ -#line 1262 "program_parse.y" +#line 1351 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 147: + case 155: /* Line 1455 of yacc.c */ -#line 1266 "program_parse.y" +#line 1355 "program_parse.y" { (yyval.integer) = STATE_EMISSION; ;} break; - case 148: + case 156: /* Line 1455 of yacc.c */ -#line 1270 "program_parse.y" +#line 1359 "program_parse.y" { (yyval.integer) = STATE_SHININESS; ;} break; - case 149: + case 157: /* Line 1455 of yacc.c */ -#line 1276 "program_parse.y" +#line 1365 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHT; @@ -3536,28 +3668,28 @@ yyreduce: ;} break; - case 150: + case 158: /* Line 1455 of yacc.c */ -#line 1285 "program_parse.y" +#line 1374 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 151: + case 159: /* Line 1455 of yacc.c */ -#line 1289 "program_parse.y" +#line 1378 "program_parse.y" { (yyval.integer) = STATE_POSITION; ;} break; - case 152: + case 160: /* Line 1455 of yacc.c */ -#line 1293 "program_parse.y" +#line 1382 "program_parse.y" { if (!state->ctx->Extensions.EXT_point_parameters) { yyerror(& (yylsp[(1) - (1)]), state, "GL_ARB_point_parameters not supported"); @@ -3568,57 +3700,57 @@ yyreduce: ;} break; - case 153: + case 161: /* Line 1455 of yacc.c */ -#line 1302 "program_parse.y" +#line 1391 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; - case 154: + case 162: /* Line 1455 of yacc.c */ -#line 1306 "program_parse.y" +#line 1395 "program_parse.y" { (yyval.integer) = STATE_HALF_VECTOR; ;} break; - case 155: + case 163: /* Line 1455 of yacc.c */ -#line 1312 "program_parse.y" +#line 1401 "program_parse.y" { (yyval.integer) = STATE_SPOT_DIRECTION; ;} break; - case 156: + case 164: /* Line 1455 of yacc.c */ -#line 1318 "program_parse.y" +#line 1407 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (2)].state)[1]; ;} break; - case 157: + case 165: /* Line 1455 of yacc.c */ -#line 1325 "program_parse.y" +#line 1414 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_AMBIENT; ;} break; - case 158: + case 166: /* Line 1455 of yacc.c */ -#line 1330 "program_parse.y" +#line 1419 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_SCENECOLOR; @@ -3626,10 +3758,10 @@ yyreduce: ;} break; - case 159: + case 167: /* Line 1455 of yacc.c */ -#line 1338 "program_parse.y" +#line 1427 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTPROD; @@ -3639,10 +3771,10 @@ yyreduce: ;} break; - case 161: + case 169: /* Line 1455 of yacc.c */ -#line 1350 "program_parse.y" +#line 1439 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(3) - (3)].integer); @@ -3650,46 +3782,46 @@ yyreduce: ;} break; - case 162: + case 170: /* Line 1455 of yacc.c */ -#line 1358 "program_parse.y" +#line 1447 "program_parse.y" { (yyval.integer) = STATE_TEXENV_COLOR; ;} break; - case 163: + case 171: /* Line 1455 of yacc.c */ -#line 1364 "program_parse.y" +#line 1453 "program_parse.y" { (yyval.integer) = STATE_AMBIENT; ;} break; - case 164: + case 172: /* Line 1455 of yacc.c */ -#line 1368 "program_parse.y" +#line 1457 "program_parse.y" { (yyval.integer) = STATE_DIFFUSE; ;} break; - case 165: + case 173: /* Line 1455 of yacc.c */ -#line 1372 "program_parse.y" +#line 1461 "program_parse.y" { (yyval.integer) = STATE_SPECULAR; ;} break; - case 166: + case 174: /* Line 1455 of yacc.c */ -#line 1378 "program_parse.y" +#line 1467 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxLights) { yyerror(& (yylsp[(1) - (1)]), state, "invalid light selector"); @@ -3700,10 +3832,10 @@ yyreduce: ;} break; - case 167: + case 175: /* Line 1455 of yacc.c */ -#line 1389 "program_parse.y" +#line 1478 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_TEXGEN; @@ -3712,92 +3844,92 @@ yyreduce: ;} break; - case 168: + case 176: /* Line 1455 of yacc.c */ -#line 1398 "program_parse.y" +#line 1487 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S; ;} break; - case 169: + case 177: /* Line 1455 of yacc.c */ -#line 1402 "program_parse.y" +#line 1491 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_OBJECT_S; ;} break; - case 170: + case 178: /* Line 1455 of yacc.c */ -#line 1407 "program_parse.y" +#line 1496 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S; ;} break; - case 171: + case 179: /* Line 1455 of yacc.c */ -#line 1411 "program_parse.y" +#line 1500 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S; ;} break; - case 172: + case 180: /* Line 1455 of yacc.c */ -#line 1415 "program_parse.y" +#line 1504 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S; ;} break; - case 173: + case 181: /* Line 1455 of yacc.c */ -#line 1419 "program_parse.y" +#line 1508 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S; ;} break; - case 174: + case 182: /* Line 1455 of yacc.c */ -#line 1425 "program_parse.y" +#line 1514 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); ;} break; - case 175: + case 183: /* Line 1455 of yacc.c */ -#line 1432 "program_parse.y" +#line 1521 "program_parse.y" { (yyval.integer) = STATE_FOG_COLOR; ;} break; - case 176: + case 184: /* Line 1455 of yacc.c */ -#line 1436 "program_parse.y" +#line 1525 "program_parse.y" { (yyval.integer) = STATE_FOG_PARAMS; ;} break; - case 177: + case 185: /* Line 1455 of yacc.c */ -#line 1442 "program_parse.y" +#line 1531 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_CLIPPLANE; @@ -3805,10 +3937,10 @@ yyreduce: ;} break; - case 178: + case 186: /* Line 1455 of yacc.c */ -#line 1450 "program_parse.y" +#line 1539 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxClipPlanes) { yyerror(& (yylsp[(1) - (1)]), state, "invalid clip plane selector"); @@ -3819,38 +3951,38 @@ yyreduce: ;} break; - case 179: + case 187: /* Line 1455 of yacc.c */ -#line 1461 "program_parse.y" +#line 1550 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); ;} break; - case 180: + case 188: /* Line 1455 of yacc.c */ -#line 1468 "program_parse.y" +#line 1557 "program_parse.y" { (yyval.integer) = STATE_POINT_SIZE; ;} break; - case 181: + case 189: /* Line 1455 of yacc.c */ -#line 1472 "program_parse.y" +#line 1561 "program_parse.y" { (yyval.integer) = STATE_POINT_ATTENUATION; ;} break; - case 182: + case 190: /* Line 1455 of yacc.c */ -#line 1478 "program_parse.y" +#line 1567 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (5)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (5)].state)[1]; @@ -3860,10 +3992,10 @@ yyreduce: ;} break; - case 183: + case 191: /* Line 1455 of yacc.c */ -#line 1488 "program_parse.y" +#line 1577 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (2)].state)[1]; @@ -3873,20 +4005,20 @@ yyreduce: ;} break; - case 184: + case 192: /* Line 1455 of yacc.c */ -#line 1498 "program_parse.y" +#line 1587 "program_parse.y" { (yyval.state)[2] = 0; (yyval.state)[3] = 3; ;} break; - case 185: + case 193: /* Line 1455 of yacc.c */ -#line 1503 "program_parse.y" +#line 1592 "program_parse.y" { /* It seems logical that the matrix row range specifier would have * to specify a range or more than one row (i.e., $5 > $3). @@ -3904,10 +4036,10 @@ yyreduce: ;} break; - case 186: + case 194: /* Line 1455 of yacc.c */ -#line 1521 "program_parse.y" +#line 1610 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (3)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (3)].state)[1]; @@ -3915,55 +4047,55 @@ yyreduce: ;} break; - case 187: + case 195: /* Line 1455 of yacc.c */ -#line 1529 "program_parse.y" +#line 1618 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 188: + case 196: /* Line 1455 of yacc.c */ -#line 1533 "program_parse.y" +#line 1622 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 189: + case 197: /* Line 1455 of yacc.c */ -#line 1539 "program_parse.y" +#line 1628 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVERSE; ;} break; - case 190: + case 198: /* Line 1455 of yacc.c */ -#line 1543 "program_parse.y" +#line 1632 "program_parse.y" { (yyval.integer) = STATE_MATRIX_TRANSPOSE; ;} break; - case 191: + case 199: /* Line 1455 of yacc.c */ -#line 1547 "program_parse.y" +#line 1636 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVTRANS; ;} break; - case 192: + case 200: /* Line 1455 of yacc.c */ -#line 1553 "program_parse.y" +#line 1642 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) > 3) { yyerror(& (yylsp[(1) - (1)]), state, "invalid matrix row reference"); @@ -3974,88 +4106,88 @@ yyreduce: ;} break; - case 193: + case 201: /* Line 1455 of yacc.c */ -#line 1564 "program_parse.y" +#line 1653 "program_parse.y" { (yyval.state)[0] = STATE_MODELVIEW_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); ;} break; - case 194: + case 202: /* Line 1455 of yacc.c */ -#line 1569 "program_parse.y" +#line 1658 "program_parse.y" { (yyval.state)[0] = STATE_PROJECTION_MATRIX; (yyval.state)[1] = 0; ;} break; - case 195: + case 203: /* Line 1455 of yacc.c */ -#line 1574 "program_parse.y" +#line 1663 "program_parse.y" { (yyval.state)[0] = STATE_MVP_MATRIX; (yyval.state)[1] = 0; ;} break; - case 196: + case 204: /* Line 1455 of yacc.c */ -#line 1579 "program_parse.y" +#line 1668 "program_parse.y" { (yyval.state)[0] = STATE_TEXTURE_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); ;} break; - case 197: + case 205: /* Line 1455 of yacc.c */ -#line 1584 "program_parse.y" +#line 1673 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; ;} break; - case 198: + case 206: /* Line 1455 of yacc.c */ -#line 1589 "program_parse.y" +#line 1678 "program_parse.y" { (yyval.state)[0] = STATE_PROGRAM_MATRIX; (yyval.state)[1] = (yyvsp[(3) - (4)].integer); ;} break; - case 199: + case 207: /* Line 1455 of yacc.c */ -#line 1596 "program_parse.y" +#line 1685 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 200: + case 208: /* Line 1455 of yacc.c */ -#line 1600 "program_parse.y" +#line 1689 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 201: + case 209: /* Line 1455 of yacc.c */ -#line 1605 "program_parse.y" +#line 1694 "program_parse.y" { /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix * zero is valid. @@ -4069,10 +4201,10 @@ yyreduce: ;} break; - case 202: + case 210: /* Line 1455 of yacc.c */ -#line 1618 "program_parse.y" +#line 1707 "program_parse.y" { /* Since GL_ARB_matrix_palette isn't supported, just let any value * through here. The error will be generated later. @@ -4081,10 +4213,10 @@ yyreduce: ;} break; - case 203: + case 211: /* Line 1455 of yacc.c */ -#line 1626 "program_parse.y" +#line 1715 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxProgramMatrices) { yyerror(& (yylsp[(1) - (1)]), state, "invalid program matrix selector"); @@ -4095,20 +4227,20 @@ yyreduce: ;} break; - case 204: + case 212: /* Line 1455 of yacc.c */ -#line 1637 "program_parse.y" +#line 1726 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_DEPTH_RANGE; ;} break; - case 209: + case 217: /* Line 1455 of yacc.c */ -#line 1649 "program_parse.y" +#line 1738 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4118,30 +4250,30 @@ yyreduce: ;} break; - case 210: + case 218: /* Line 1455 of yacc.c */ -#line 1659 "program_parse.y" +#line 1748 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); ;} break; - case 211: + case 219: /* Line 1455 of yacc.c */ -#line 1664 "program_parse.y" +#line 1753 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); ;} break; - case 212: + case 220: /* Line 1455 of yacc.c */ -#line 1671 "program_parse.y" +#line 1760 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4151,10 +4283,10 @@ yyreduce: ;} break; - case 213: + case 221: /* Line 1455 of yacc.c */ -#line 1681 "program_parse.y" +#line 1770 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4164,30 +4296,30 @@ yyreduce: ;} break; - case 214: + case 222: /* Line 1455 of yacc.c */ -#line 1690 "program_parse.y" +#line 1779 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); ;} break; - case 215: + case 223: /* Line 1455 of yacc.c */ -#line 1695 "program_parse.y" +#line 1784 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); ;} break; - case 216: + case 224: /* Line 1455 of yacc.c */ -#line 1702 "program_parse.y" +#line 1791 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4197,10 +4329,10 @@ yyreduce: ;} break; - case 217: + case 225: /* Line 1455 of yacc.c */ -#line 1712 "program_parse.y" +#line 1801 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxEnvParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid environment parameter reference"); @@ -4210,10 +4342,10 @@ yyreduce: ;} break; - case 218: + case 226: /* Line 1455 of yacc.c */ -#line 1722 "program_parse.y" +#line 1811 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxLocalParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid local parameter reference"); @@ -4223,10 +4355,10 @@ yyreduce: ;} break; - case 223: + case 231: /* Line 1455 of yacc.c */ -#line 1737 "program_parse.y" +#line 1826 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -4236,10 +4368,10 @@ yyreduce: ;} break; - case 224: + case 232: /* Line 1455 of yacc.c */ -#line 1747 "program_parse.y" +#line 1836 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -4249,10 +4381,10 @@ yyreduce: ;} break; - case 225: + case 233: /* Line 1455 of yacc.c */ -#line 1755 "program_parse.y" +#line 1844 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (float) (yyvsp[(1) - (1)].integer); @@ -4262,10 +4394,10 @@ yyreduce: ;} break; - case 226: + case 234: /* Line 1455 of yacc.c */ -#line 1765 "program_parse.y" +#line 1854 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (3)].real); @@ -4275,10 +4407,10 @@ yyreduce: ;} break; - case 227: + case 235: /* Line 1455 of yacc.c */ -#line 1773 "program_parse.y" +#line 1862 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (5)].real); @@ -4288,10 +4420,10 @@ yyreduce: ;} break; - case 228: + case 236: /* Line 1455 of yacc.c */ -#line 1782 "program_parse.y" +#line 1871 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (7)].real); @@ -4301,10 +4433,10 @@ yyreduce: ;} break; - case 229: + case 237: /* Line 1455 of yacc.c */ -#line 1791 "program_parse.y" +#line 1880 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (9)].real); @@ -4314,56 +4446,56 @@ yyreduce: ;} break; - case 230: + case 238: /* Line 1455 of yacc.c */ -#line 1801 "program_parse.y" +#line 1890 "program_parse.y" { (yyval.real) = ((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].real) : (yyvsp[(2) - (2)].real); ;} break; - case 231: + case 239: /* Line 1455 of yacc.c */ -#line 1805 "program_parse.y" +#line 1894 "program_parse.y" { (yyval.real) = (float)(((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].integer) : (yyvsp[(2) - (2)].integer)); ;} break; - case 232: + case 240: /* Line 1455 of yacc.c */ -#line 1810 "program_parse.y" +#line 1899 "program_parse.y" { (yyval.negate) = FALSE; ;} break; - case 233: + case 241: /* Line 1455 of yacc.c */ -#line 1811 "program_parse.y" +#line 1900 "program_parse.y" { (yyval.negate) = TRUE; ;} break; - case 234: + case 242: /* Line 1455 of yacc.c */ -#line 1812 "program_parse.y" +#line 1901 "program_parse.y" { (yyval.negate) = FALSE; ;} break; - case 235: + case 243: /* Line 1455 of yacc.c */ -#line 1815 "program_parse.y" +#line 1904 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; - case 237: + case 245: /* Line 1455 of yacc.c */ -#line 1819 "program_parse.y" +#line 1908 "program_parse.y" { /* NV_fragment_program_option defines the size qualifiers in a * fairly broken way. "SHORT" or "LONG" can optionally be used @@ -4399,25 +4531,25 @@ yyreduce: ;} break; - case 238: + case 246: /* Line 1455 of yacc.c */ -#line 1853 "program_parse.y" +#line 1942 "program_parse.y" { ;} break; - case 239: + case 247: /* Line 1455 of yacc.c */ -#line 1857 "program_parse.y" +#line 1946 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 241: + case 249: /* Line 1455 of yacc.c */ -#line 1861 "program_parse.y" +#line 1950 "program_parse.y" { if (!declare_variable(state, (yyvsp[(3) - (3)].string), (yyvsp[(0) - (3)].integer), & (yylsp[(3) - (3)]))) { YYERROR; @@ -4425,10 +4557,10 @@ yyreduce: ;} break; - case 242: + case 250: /* Line 1455 of yacc.c */ -#line 1867 "program_parse.y" +#line 1956 "program_parse.y" { if (!declare_variable(state, (yyvsp[(1) - (1)].string), (yyvsp[(0) - (1)].integer), & (yylsp[(1) - (1)]))) { YYERROR; @@ -4436,10 +4568,10 @@ yyreduce: ;} break; - case 243: + case 251: /* Line 1455 of yacc.c */ -#line 1875 "program_parse.y" +#line 1964 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(3) - (5)].string), at_output, & (yylsp[(3) - (5)])); @@ -4452,10 +4584,10 @@ yyreduce: ;} break; - case 244: + case 252: /* Line 1455 of yacc.c */ -#line 1888 "program_parse.y" +#line 1977 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_HPOS; @@ -4466,10 +4598,10 @@ yyreduce: ;} break; - case 245: + case 253: /* Line 1455 of yacc.c */ -#line 1897 "program_parse.y" +#line 1986 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_FOGC; @@ -4480,19 +4612,19 @@ yyreduce: ;} break; - case 246: + case 254: /* Line 1455 of yacc.c */ -#line 1906 "program_parse.y" +#line 1995 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (2)].result); ;} break; - case 247: + case 255: /* Line 1455 of yacc.c */ -#line 1910 "program_parse.y" +#line 1999 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_PSIZ; @@ -4503,10 +4635,10 @@ yyreduce: ;} break; - case 248: + case 256: /* Line 1455 of yacc.c */ -#line 1919 "program_parse.y" +#line 2008 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_TEX0 + (yyvsp[(3) - (3)].integer); @@ -4517,10 +4649,10 @@ yyreduce: ;} break; - case 249: + case 257: /* Line 1455 of yacc.c */ -#line 1928 "program_parse.y" +#line 2017 "program_parse.y" { if (state->mode == ARB_fragment) { (yyval.result) = FRAG_RESULT_DEPTH; @@ -4531,19 +4663,19 @@ yyreduce: ;} break; - case 250: + case 258: /* Line 1455 of yacc.c */ -#line 1939 "program_parse.y" +#line 2028 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (3)].integer) + (yyvsp[(3) - (3)].integer); ;} break; - case 251: + case 259: /* Line 1455 of yacc.c */ -#line 1945 "program_parse.y" +#line 2034 "program_parse.y" { (yyval.integer) = (state->mode == ARB_vertex) ? VERT_RESULT_COL0 @@ -4551,10 +4683,10 @@ yyreduce: ;} break; - case 252: + case 260: /* Line 1455 of yacc.c */ -#line 1951 "program_parse.y" +#line 2040 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_COL0; @@ -4565,10 +4697,10 @@ yyreduce: ;} break; - case 253: + case 261: /* Line 1455 of yacc.c */ -#line 1960 "program_parse.y" +#line 2049 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_BFC0; @@ -4579,19 +4711,19 @@ yyreduce: ;} break; - case 254: + case 262: /* Line 1455 of yacc.c */ -#line 1971 "program_parse.y" +#line 2060 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 255: + case 263: /* Line 1455 of yacc.c */ -#line 1975 "program_parse.y" +#line 2064 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 0; @@ -4602,10 +4734,10 @@ yyreduce: ;} break; - case 256: + case 264: /* Line 1455 of yacc.c */ -#line 1984 "program_parse.y" +#line 2073 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 1; @@ -4616,94 +4748,94 @@ yyreduce: ;} break; - case 257: + case 265: /* Line 1455 of yacc.c */ -#line 1994 "program_parse.y" +#line 2083 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 258: + case 266: /* Line 1455 of yacc.c */ -#line 1995 "program_parse.y" +#line 2084 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 259: + case 267: /* Line 1455 of yacc.c */ -#line 1996 "program_parse.y" +#line 2085 "program_parse.y" { (yyval.integer) = 1; ;} break; - case 260: + case 268: /* Line 1455 of yacc.c */ -#line 1999 "program_parse.y" +#line 2088 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 261: + case 269: /* Line 1455 of yacc.c */ -#line 2000 "program_parse.y" +#line 2089 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 262: + case 270: /* Line 1455 of yacc.c */ -#line 2001 "program_parse.y" +#line 2090 "program_parse.y" { (yyval.integer) = 1; ;} break; - case 263: + case 271: /* Line 1455 of yacc.c */ -#line 2004 "program_parse.y" +#line 2093 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 264: + case 272: /* Line 1455 of yacc.c */ -#line 2005 "program_parse.y" +#line 2094 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 265: + case 273: /* Line 1455 of yacc.c */ -#line 2008 "program_parse.y" +#line 2097 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 266: + case 274: /* Line 1455 of yacc.c */ -#line 2009 "program_parse.y" +#line 2098 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 267: + case 275: /* Line 1455 of yacc.c */ -#line 2012 "program_parse.y" +#line 2101 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 268: + case 276: /* Line 1455 of yacc.c */ -#line 2013 "program_parse.y" +#line 2102 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 269: + case 277: /* Line 1455 of yacc.c */ -#line 2017 "program_parse.y" +#line 2106 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture coordinate unit selector"); @@ -4714,10 +4846,10 @@ yyreduce: ;} break; - case 270: + case 278: /* Line 1455 of yacc.c */ -#line 2028 "program_parse.y" +#line 2117 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture image unit selector"); @@ -4728,10 +4860,10 @@ yyreduce: ;} break; - case 271: + case 279: /* Line 1455 of yacc.c */ -#line 2039 "program_parse.y" +#line 2128 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture unit selector"); @@ -4742,10 +4874,10 @@ yyreduce: ;} break; - case 272: + case 280: /* Line 1455 of yacc.c */ -#line 2050 "program_parse.y" +#line 2139 "program_parse.y" { struct asm_symbol *exist = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(2) - (4)].string)); @@ -4769,7 +4901,7 @@ yyreduce: /* Line 1455 of yacc.c */ -#line 4773 "program_parse.tab.c" +#line 4905 "program_parse.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -4988,7 +5120,7 @@ yyreturn: /* Line 1675 of yacc.c */ -#line 2074 "program_parse.y" +#line 2163 "program_parse.y" void @@ -5007,8 +5139,15 @@ asm_instruction_set_operands(struct asm_instruction *inst, inst->Base.DstReg = *dst; } - inst->Base.SrcReg[0] = src0->Base; - inst->SrcReg[0] = *src0; + /* The only instruction that doesn't have any source registers is the + * condition-code based KIL instruction added by NV_fragment_program_option. + */ + if (src0 != NULL) { + inst->Base.SrcReg[0] = src0->Base; + inst->SrcReg[0] = *src0; + } else { + init_src_reg(& inst->SrcReg[0]); + } if (src1 != NULL) { inst->Base.SrcReg[1] = src1->Base; diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index d6bac07081..3021ae83f3 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -202,6 +202,8 @@ static struct asm_instruction *asm_instruction_copy_ctor( %type addrReg %type addrComponent addrWriteMask +%type ccMaskRule ccTest ccMaskRule2 ccTest2 optionalCcMask + %type resultBinding resultColBinding %type optFaceType optColorType %type optResultFaceType optResultColorType @@ -447,6 +449,14 @@ KIL_instruction: KIL swizzleSrcReg $$ = asm_instruction_ctor(OPCODE_KIL, NULL, & $2, NULL, NULL); state->fragment.UsesKill = 1; } + | KIL ccTest + { + $$ = asm_instruction_ctor(OPCODE_KIL_NV, NULL, NULL, NULL, NULL); + $$->Base.DstReg.CondMask = $2.CondMask; + $$->Base.DstReg.CondSwizzle = $2.CondSwizzle; + $$->Base.DstReg.CondSrc = $2.CondSrc; + state->fragment.UsesKill = 1; + } ; TXD_instruction: TXD_OP maskedDstReg ',' swizzleSrcReg ',' swizzleSrcReg ',' swizzleSrcReg ',' texImageUnit ',' texTarget @@ -607,10 +617,13 @@ swizzleSrcReg: optionalSign srcReg swizzleSuffix ; -maskedDstReg: dstReg optionalMask +maskedDstReg: dstReg optionalMask optionalCcMask { $$ = $1; $$.WriteMask = $2.mask; + $$.CondMask = $3.CondMask; + $$.CondSwizzle = $3.CondSwizzle; + $$.CondSrc = $3.CondSrc; if ($$.File == PROGRAM_OUTPUT) { /* Technically speaking, this should check that it is in @@ -984,6 +997,82 @@ optionalMask: MASK4 | MASK3 | MASK2 | MASK1 | { $$.swizzle = SWIZZLE_NOOP; $$.mask = WRITEMASK_XYZW; } ; +optionalCcMask: '(' ccTest ')' + { + $$ = $2; + } + | '(' ccTest2 ')' + { + $$ = $2; + } + | + { + $$.CondMask = COND_TR; + $$.CondSwizzle = SWIZZLE_NOOP; + $$.CondSrc = 0; + } + ; + +ccTest: ccMaskRule swizzleSuffix + { + $$ = $1; + $$.CondSwizzle = $2.swizzle; + } + ; + +ccTest2: ccMaskRule2 swizzleSuffix + { + $$ = $1; + $$.CondSwizzle = $2.swizzle; + } + ; + +ccMaskRule: IDENTIFIER + { + const int cond = _mesa_parse_cc($1); + if ((cond == 0) || ($1[2] != '\0')) { + char *const err_str = + make_error_string("invalid condition code \"%s\"", $1); + + yyerror(& @1, state, (err_str != NULL) + ? err_str : "invalid condition code"); + + if (err_str != NULL) { + _mesa_free(err_str); + } + + YYERROR; + } + + $$.CondMask = cond; + $$.CondSwizzle = SWIZZLE_NOOP; + $$.CondSrc = 0; + } + ; + +ccMaskRule2: USED_IDENTIFIER + { + const int cond = _mesa_parse_cc($1); + if ((cond == 0) || ($1[2] != '\0')) { + char *const err_str = + make_error_string("invalid condition code \"%s\"", $1); + + yyerror(& @1, state, (err_str != NULL) + ? err_str : "invalid condition code"); + + if (err_str != NULL) { + _mesa_free(err_str); + } + + YYERROR; + } + + $$.CondMask = cond; + $$.CondSwizzle = SWIZZLE_NOOP; + $$.CondSrc = 0; + } + ; + namingStatement: ATTRIB_statement | PARAM_statement | TEMP_statement @@ -2089,8 +2178,15 @@ asm_instruction_set_operands(struct asm_instruction *inst, inst->Base.DstReg = *dst; } - inst->Base.SrcReg[0] = src0->Base; - inst->SrcReg[0] = *src0; + /* The only instruction that doesn't have any source registers is the + * condition-code based KIL instruction added by NV_fragment_program_option. + */ + if (src0 != NULL) { + inst->Base.SrcReg[0] = src0->Base; + inst->SrcReg[0] = *src0; + } else { + init_src_reg(& inst->SrcReg[0]); + } if (src1 != NULL) { inst->Base.SrcReg[1] = src1->Base; diff --git a/src/mesa/shader/program_parse_extra.c b/src/mesa/shader/program_parse_extra.c index cb7b7a5fb2..0656c5eaa8 100644 --- a/src/mesa/shader/program_parse_extra.c +++ b/src/mesa/shader/program_parse_extra.c @@ -94,6 +94,60 @@ _mesa_parse_instruction_suffix(const struct asm_parser_state *state, } +int +_mesa_parse_cc(const char *s) +{ + int cond = 0; + + switch (s[0]) { + case 'E': + if (s[1] == 'Q') { + cond = COND_EQ; + } + break; + + case 'F': + if (s[1] == 'L') { + cond = COND_FL; + } + break; + + case 'G': + if (s[1] == 'E') { + cond = COND_GE; + } else if (s[1] == 'T') { + cond = COND_GT; + } + break; + + case 'L': + if (s[1] == 'E') { + cond = COND_LE; + } else if (s[1] == 'T') { + cond = COND_LT; + } + break; + + case 'N': + if (s[1] == 'E') { + cond = COND_NE; + } + break; + + case 'T': + if (s[1] == 'R') { + cond = COND_TR; + } + break; + + default: + break; + } + + return ((cond == 0) || (s[2] != '\0')) ? 0 : cond; +} + + int _mesa_ARBvp_parse_option(struct asm_parser_state *state, const char *option) { diff --git a/src/mesa/shader/program_parser.h b/src/mesa/shader/program_parser.h index 497891f53d..bce6041381 100644 --- a/src/mesa/shader/program_parser.h +++ b/src/mesa/shader/program_parser.h @@ -278,4 +278,17 @@ extern int _mesa_ARBfp_parse_option(struct asm_parser_state *state, extern int _mesa_parse_instruction_suffix(const struct asm_parser_state *state, const char *suffix, struct prog_instruction *inst); +/** + * Parses a condition code name + * + * The condition code names (e.g., \c LT, \c GT, \c NE) were added to assembly + * shaders with the \c GL_NV_fragment_program_option extension. This function + * converts a string representation into one of the \c COND_ macros. + * + * \return + * One of the \c COND_ macros defined in prog_instruction.h on success or zero + * on failure. + */ +extern int _mesa_parse_cc(const char *s); + /*@}*/ -- cgit v1.2.3 From cfa1a0a609daefffc6f8c4087ed0bc34c2665ef4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 16 Sep 2009 12:57:26 -0600 Subject: st/mesa: fix texture memory allocation bug The following example caused an incorrect GL_OUT_OF_MEMORY error to be raised in glTexSubImage2D: glTexImage2D(level=0, width=32, height=32, pixels=NULL); glTexImage2D(level=0, width=64, height=64, pixels=NULL); glTexSubImage2D(level=0, pixels!=NULL); The second glTexImage2D() call needs to cause the first image to be deallocated then reallocated at the new size. This was not happening because we were testing for pixels==NULL too early. --- src/mesa/state_tracker/st_cb_texture.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 2db28ef0a4..31196fe776 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -661,8 +661,10 @@ st_TexImage(GLcontext * ctx, format, type, pixels, unpack, "glTexImage"); } - if (!pixels) - return; + + /* Note: we can't check for pixels==NULL until after we've allocated + * memory for the texture. + */ /* See if we can do texture compression with a blit/render. */ @@ -673,6 +675,9 @@ st_TexImage(GLcontext * ctx, stImage->pt->format, stImage->pt->target, PIPE_TEXTURE_USAGE_RENDER_TARGET, 0)) { + if (!pixels) + goto done; + if (compress_with_blit(ctx, target, level, 0, 0, 0, width, height, depth, format, type, pixels, unpack, texImage)) { goto done; @@ -714,6 +719,9 @@ st_TexImage(GLcontext * ctx, return; } + if (!pixels) + goto done; + DBG("Upload image %dx%dx%d row_len %x pitch %x\n", width, height, depth, width * texelBytes, dstRowStride); -- cgit v1.2.3 From 08d39251a79a964e4a3ac0d7d8a397c2b66a0808 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 16 Sep 2009 13:07:12 -0600 Subject: st/mesa: fix some incorrect branching/clean-up code in TexImage functions We need to be sure to call the _mesa_unmap_teximage_pbo() function if we called _mesa_validate_pbo_teximage(). --- src/mesa/state_tracker/st_cb_texture.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 31196fe776..cfa33d48e1 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -764,9 +764,9 @@ st_TexImage(GLcontext * ctx, } } +done: _mesa_unmap_teximage_pbo(ctx, unpack); -done: if (stImage->pt && texImage->Data) { st_texture_image_unmap(ctx->st, stImage); texImage->Data = NULL; @@ -1107,7 +1107,7 @@ st_TexSubimage(GLcontext *ctx, GLint dims, GLenum target, GLint level, if (!texImage->Data) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage"); - return; + goto done; } src = (const GLubyte *) pixels; @@ -1138,9 +1138,9 @@ st_TexSubimage(GLcontext *ctx, GLint dims, GLenum target, GLint level, } } +done: _mesa_unmap_teximage_pbo(ctx, packing); -done: if (stImage->pt) { st_texture_image_unmap(ctx->st, stImage); texImage->Data = NULL; -- cgit v1.2.3 From fac38e8c8f1814ae54703b872db8c6dd21c34a3b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 16 Sep 2009 21:21:42 -0600 Subject: mesa: fix clip plane, fog issues --- src/mesa/drivers/common/meta.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 47090ba297..ddd476eba1 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -656,7 +656,6 @@ _mesa_meta_end(GLcontext *ctx) _mesa_MatrixMode(save->MatrixMode); - save->ClipPlanesEnabled = ctx->Transform.ClipPlanesEnabled; if (save->ClipPlanesEnabled) { GLuint i; for (i = 0; i < ctx->Const.MaxClipPlanes; i++) { @@ -692,9 +691,6 @@ _mesa_meta_end(GLcontext *ctx) if (save->Lighting) { _mesa_set_enable(ctx, GL_LIGHTING, GL_TRUE); } - if (save->Fog) { - _mesa_set_enable(ctx, GL_FOG, GL_TRUE); - } } -- cgit v1.2.3 From a66bab0e379c3add034667ed394bcead386d8c10 Mon Sep 17 00:00:00 2001 From: Zou Nan hai Date: Fri, 18 Sep 2009 13:29:28 +0800 Subject: [i965] use intel_batchbuffer_flush to flush the clear --- src/mesa/drivers/dri/intel/intel_clear.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_clear.c b/src/mesa/drivers/dri/intel/intel_clear.c index 9efe6a277c..736434d763 100644 --- a/src/mesa/drivers/dri/intel/intel_clear.c +++ b/src/mesa/drivers/dri/intel/intel_clear.c @@ -170,8 +170,9 @@ intelClear(GLcontext *ctx, GLbitfield mask) } DBG("\n"); } - intelFlush(&intel->ctx); + _mesa_meta_clear(&intel->ctx, tri_mask); + intel_batchbuffer_flush(intel->batch); } if (swrast_mask) { -- cgit v1.2.3 From 1e4c3535111dc431e4fe51da6892259a5ebe2ae6 Mon Sep 17 00:00:00 2001 From: Zou Nan hai Date: Fri, 18 Sep 2009 16:04:41 +0800 Subject: [i965] add a missing header file --- src/mesa/drivers/dri/intel/intel_clear.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_clear.c b/src/mesa/drivers/dri/intel/intel_clear.c index 736434d763..9010b910c7 100644 --- a/src/mesa/drivers/dri/intel/intel_clear.c +++ b/src/mesa/drivers/dri/intel/intel_clear.c @@ -38,6 +38,7 @@ #include "intel_fbo.h" #include "intel_pixel.h" #include "intel_regions.h" +#include "intel_batchbuffer.h" #define FILE_DEBUG_FLAG DEBUG_BLIT -- cgit v1.2.3 From fdd605e446ed174bae13171d116f498704259057 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Fonseca?= Date: Sat, 19 Sep 2009 14:33:35 +0100 Subject: mesa: Allow BlitFramebuffer from a texture. Although GL_EXT_framebuffer_blit does not mention textures, it doesn't forbid them either, and some thirdparty driver appear to support this. --- src/mesa/state_tracker/st_cb_blit.c | 56 +++++++++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 11 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_blit.c b/src/mesa/state_tracker/st_cb_blit.c index c741940bcf..5626e25323 100644 --- a/src/mesa/state_tracker/st_cb_blit.c +++ b/src/mesa/state_tracker/st_cb_blit.c @@ -39,6 +39,7 @@ #include "shader/prog_print.h" #include "st_context.h" +#include "st_texture.h" #include "st_program.h" #include "st_cb_blit.h" #include "st_cb_fbo.h" @@ -110,17 +111,50 @@ st_BlitFramebuffer(GLcontext *ctx, } if (mask & GL_COLOR_BUFFER_BIT) { - struct st_renderbuffer *srcRb = - st_renderbuffer(readFB->_ColorReadBuffer); - struct st_renderbuffer *dstRb = - st_renderbuffer(drawFB->_ColorDrawBuffers[0]); - struct pipe_surface *srcSurf = srcRb->surface; - struct pipe_surface *dstSurf = dstRb->surface; - - util_blit_pixels(st->blit, - srcSurf, srcX0, srcY0, srcX1, srcY1, - dstSurf, dstX0, dstY0, dstX1, dstY1, - 0.0, pFilter); + struct gl_renderbuffer_attachment *srcAtt = + &readFB->Attachment[readFB->_ColorReadBufferIndex]; + + if(srcAtt->Type == GL_TEXTURE) { + struct pipe_screen *screen = ctx->st->pipe->screen; + const struct st_texture_object *srcObj = + st_texture_object(srcAtt->Texture); + struct st_renderbuffer *dstRb = + st_renderbuffer(drawFB->_ColorDrawBuffers[0]); + struct pipe_surface *srcSurf; + struct pipe_surface *dstSurf = dstRb->surface; + + if (!srcObj->pt) + return; + + srcSurf = screen->get_tex_surface(screen, + srcObj->pt, + srcAtt->CubeMapFace, + srcAtt->TextureLevel, + srcAtt->Zoffset, + PIPE_BUFFER_USAGE_GPU_READ); + if(!srcSurf) + return; + + util_blit_pixels(st->blit, + srcSurf, srcX0, srcY0, srcX1, srcY1, + dstSurf, dstX0, dstY0, dstX1, dstY1, + 0.0, pFilter); + + pipe_surface_reference(&srcSurf, NULL); + } + else { + struct st_renderbuffer *srcRb = + st_renderbuffer(readFB->_ColorReadBuffer); + struct st_renderbuffer *dstRb = + st_renderbuffer(drawFB->_ColorDrawBuffers[0]); + struct pipe_surface *srcSurf = srcRb->surface; + struct pipe_surface *dstSurf = dstRb->surface; + + util_blit_pixels(st->blit, + srcSurf, srcX0, srcY0, srcX1, srcY1, + dstSurf, dstX0, dstY0, dstX1, dstY1, + 0.0, pFilter); + } } if (mask & depthStencil) { -- cgit v1.2.3 From c9a87ff441857a8af405f3df16d8c2f590e5b10e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 19 Sep 2009 10:00:19 -0600 Subject: glapi: added tokens, function for GL_ARB_provoking_vertex --- src/mesa/glapi/EXT_provoking_vertex.xml | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/glapi/EXT_provoking_vertex.xml b/src/mesa/glapi/EXT_provoking_vertex.xml index f528a2c7d3..71d2c72909 100644 --- a/src/mesa/glapi/EXT_provoking_vertex.xml +++ b/src/mesa/glapi/EXT_provoking_vertex.xml @@ -19,4 +19,17 @@ + + + + + + + + + + + + + -- cgit v1.2.3 From 22f02509f27a5cab967d42a317e58a73c7d26e0b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 19 Sep 2009 10:00:55 -0600 Subject: glapi: regenerated files --- src/mesa/drivers/dri/common/extension_helper.h | 10 +- src/mesa/glapi/glapitemp.h | 6 + src/mesa/glapi/glprocs.h | 2 + src/mesa/main/enums.c | 4808 ++++++++++++------------ src/mesa/sparc/glapi_sparc.S | 1 + src/mesa/x86-64/glapi_x86-64.S | 1 + src/mesa/x86/glapi_x86.S | 1 + 7 files changed, 2428 insertions(+), 2401 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/common/extension_helper.h b/src/mesa/drivers/dri/common/extension_helper.h index 2c89a9f58a..5e86324eec 100644 --- a/src/mesa/drivers/dri/common/extension_helper.h +++ b/src/mesa/drivers/dri/common/extension_helper.h @@ -4417,10 +4417,11 @@ static const char SpriteParameterivSGIX_names[] = ""; #endif -#if defined(need_GL_EXT_provoking_vertex) +#if defined(need_GL_EXT_provoking_vertex) || defined(need_GL_ARB_provoking_vertex) static const char ProvokingVertexEXT_names[] = "i\0" /* Parameter signature */ "glProvokingVertexEXT\0" + "glProvokingVertex\0" ""; #endif @@ -5194,6 +5195,13 @@ static const struct dri_extension_function GL_ARB_point_parameters_functions[] = }; #endif +#if defined(need_GL_ARB_provoking_vertex) +static const struct dri_extension_function GL_ARB_provoking_vertex_functions[] = { + { ProvokingVertexEXT_names, ProvokingVertexEXT_remap_index, -1 }, + { NULL, 0, 0 } +}; +#endif + #if defined(need_GL_ARB_shader_objects) static const struct dri_extension_function GL_ARB_shader_objects_functions[] = { { UniformMatrix3fvARB_names, UniformMatrix3fvARB_remap_index, -1 }, diff --git a/src/mesa/glapi/glapitemp.h b/src/mesa/glapi/glapitemp.h index 3da0f63143..d9a3690f2a 100644 --- a/src/mesa/glapi/glapitemp.h +++ b/src/mesa/glapi/glapitemp.h @@ -5677,6 +5677,11 @@ KEYWORD1 void KEYWORD2 NAME(ProvokingVertexEXT)(GLenum mode) DISPATCH(ProvokingVertexEXT, (mode), (F, "glProvokingVertexEXT(0x%x);\n", mode)); } +KEYWORD1 void KEYWORD2 NAME(ProvokingVertex)(GLenum mode) +{ + DISPATCH(ProvokingVertexEXT, (mode), (F, "glProvokingVertex(0x%x);\n", mode)); +} + KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_788)(GLenum target, GLenum pname, GLvoid ** params); KEYWORD1_ALT void KEYWORD2 NAME(_dispatch_stub_788)(GLenum target, GLenum pname, GLvoid ** params) @@ -6923,6 +6928,7 @@ static _glapi_proc UNUSED_TABLE_NAME[] = { TABLE_ENTRY(RenderbufferStorage), TABLE_ENTRY(BlitFramebuffer), TABLE_ENTRY(FramebufferTextureLayer), + TABLE_ENTRY(ProvokingVertex), }; #endif /*UNUSED_TABLE_NAME*/ diff --git a/src/mesa/glapi/glprocs.h b/src/mesa/glapi/glprocs.h index fc0fcd331a..c29f8b57be 100644 --- a/src/mesa/glapi/glprocs.h +++ b/src/mesa/glapi/glprocs.h @@ -1147,6 +1147,7 @@ static const char gl_string_table[] = "glRenderbufferStorage\0" "glBlitFramebuffer\0" "glFramebufferTextureLayer\0" + "glProvokingVertex\0" ; @@ -2353,6 +2354,7 @@ static const glprocs_table_t static_functions[] = { NAME_FUNC_OFFSET(19722, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, _gloffset_RenderbufferStorageEXT), NAME_FUNC_OFFSET(19744, gl_dispatch_stub_783, gl_dispatch_stub_783, NULL, _gloffset_BlitFramebufferEXT), NAME_FUNC_OFFSET(19762, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, _gloffset_FramebufferTextureLayerEXT), + NAME_FUNC_OFFSET(19788, glProvokingVertexEXT, glProvokingVertexEXT, NULL, _gloffset_ProvokingVertexEXT), NAME_FUNC_OFFSET(-1, NULL, NULL, NULL, 0) }; diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index 2d1594eb7a..606d50c59a 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -519,6 +519,7 @@ LONGSTRING static const char enum_string_table[] = "GL_FEEDBACK_BUFFER_SIZE\0" "GL_FEEDBACK_BUFFER_TYPE\0" "GL_FILL\0" + "GL_FIRST_VERTEX_CONVENTION\0" "GL_FIRST_VERTEX_CONVENTION_EXT\0" "GL_FLAT\0" "GL_FLOAT\0" @@ -702,6 +703,7 @@ LONGSTRING static const char enum_string_table[] = "GL_INVERSE_TRANSPOSE_NV\0" "GL_INVERT\0" "GL_KEEP\0" + "GL_LAST_VERTEX_CONVENTION\0" "GL_LAST_VERTEX_CONVENTION_EXT\0" "GL_LEFT\0" "GL_LEQUAL\0" @@ -1288,6 +1290,7 @@ LONGSTRING static const char enum_string_table[] = "GL_PROJECTION\0" "GL_PROJECTION_MATRIX\0" "GL_PROJECTION_STACK_DEPTH\0" + "GL_PROVOKING_VERTEX\0" "GL_PROVOKING_VERTEX_EXT\0" "GL_PROXY_COLOR_TABLE\0" "GL_PROXY_HISTOGRAM\0" @@ -1309,6 +1312,7 @@ LONGSTRING static const char enum_string_table[] = "GL_Q\0" "GL_QUADRATIC_ATTENUATION\0" "GL_QUADS\0" + "GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION\0" "GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT\0" "GL_QUAD_MESH_SUN\0" "GL_QUAD_STRIP\0" @@ -1896,7 +1900,7 @@ LONGSTRING static const char enum_string_table[] = "GL_ZOOM_Y\0" ; -static const enum_elt all_enums[1858] = +static const enum_elt all_enums[1862] = { { 0, 0x00000600 }, /* GL_2D */ { 6, 0x00001407 }, /* GL_2_BYTES */ @@ -2381,1460 +2385,1464 @@ static const enum_elt all_enums[1858] = { 9670, 0x00000DF1 }, /* GL_FEEDBACK_BUFFER_SIZE */ { 9694, 0x00000DF2 }, /* GL_FEEDBACK_BUFFER_TYPE */ { 9718, 0x00001B02 }, /* GL_FILL */ - { 9726, 0x00008E4D }, /* GL_FIRST_VERTEX_CONVENTION_EXT */ - { 9757, 0x00001D00 }, /* GL_FLAT */ - { 9765, 0x00001406 }, /* GL_FLOAT */ - { 9774, 0x00008B5A }, /* GL_FLOAT_MAT2 */ - { 9788, 0x00008B5A }, /* GL_FLOAT_MAT2_ARB */ - { 9806, 0x00008B65 }, /* GL_FLOAT_MAT2x3 */ - { 9822, 0x00008B66 }, /* GL_FLOAT_MAT2x4 */ - { 9838, 0x00008B5B }, /* GL_FLOAT_MAT3 */ - { 9852, 0x00008B5B }, /* GL_FLOAT_MAT3_ARB */ - { 9870, 0x00008B67 }, /* GL_FLOAT_MAT3x2 */ - { 9886, 0x00008B68 }, /* GL_FLOAT_MAT3x4 */ - { 9902, 0x00008B5C }, /* GL_FLOAT_MAT4 */ - { 9916, 0x00008B5C }, /* GL_FLOAT_MAT4_ARB */ - { 9934, 0x00008B69 }, /* GL_FLOAT_MAT4x2 */ - { 9950, 0x00008B6A }, /* GL_FLOAT_MAT4x3 */ - { 9966, 0x00008B50 }, /* GL_FLOAT_VEC2 */ - { 9980, 0x00008B50 }, /* GL_FLOAT_VEC2_ARB */ - { 9998, 0x00008B51 }, /* GL_FLOAT_VEC3 */ - { 10012, 0x00008B51 }, /* GL_FLOAT_VEC3_ARB */ - { 10030, 0x00008B52 }, /* GL_FLOAT_VEC4 */ - { 10044, 0x00008B52 }, /* GL_FLOAT_VEC4_ARB */ - { 10062, 0x00000B60 }, /* GL_FOG */ - { 10069, 0x00000080 }, /* GL_FOG_BIT */ - { 10080, 0x00000B66 }, /* GL_FOG_COLOR */ - { 10093, 0x00008451 }, /* GL_FOG_COORD */ - { 10106, 0x00008451 }, /* GL_FOG_COORDINATE */ - { 10124, 0x00008457 }, /* GL_FOG_COORDINATE_ARRAY */ - { 10148, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ - { 10187, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB */ - { 10230, 0x00008456 }, /* GL_FOG_COORDINATE_ARRAY_POINTER */ - { 10262, 0x00008455 }, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ - { 10293, 0x00008454 }, /* GL_FOG_COORDINATE_ARRAY_TYPE */ - { 10322, 0x00008450 }, /* GL_FOG_COORDINATE_SOURCE */ - { 10347, 0x00008457 }, /* GL_FOG_COORD_ARRAY */ - { 10366, 0x0000889D }, /* GL_FOG_COORD_ARRAY_BUFFER_BINDING */ - { 10400, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */ - { 10427, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */ - { 10453, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */ - { 10477, 0x00008450 }, /* GL_FOG_COORD_SRC */ - { 10494, 0x00000B62 }, /* GL_FOG_DENSITY */ - { 10509, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */ - { 10533, 0x00000B64 }, /* GL_FOG_END */ - { 10544, 0x00000C54 }, /* GL_FOG_HINT */ - { 10556, 0x00000B61 }, /* GL_FOG_INDEX */ - { 10569, 0x00000B65 }, /* GL_FOG_MODE */ - { 10581, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */ - { 10600, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */ - { 10625, 0x00000B63 }, /* GL_FOG_START */ - { 10638, 0x00008452 }, /* GL_FRAGMENT_DEPTH */ - { 10656, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */ - { 10680, 0x00008B30 }, /* GL_FRAGMENT_SHADER */ - { 10699, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */ - { 10722, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ - { 10757, 0x00008D40 }, /* GL_FRAMEBUFFER */ - { 10772, 0x00008215 }, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ - { 10809, 0x00008214 }, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ - { 10845, 0x00008210 }, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ - { 10886, 0x00008211 }, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ - { 10927, 0x00008216 }, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ - { 10964, 0x00008213 }, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ - { 11001, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ - { 11039, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */ - { 11081, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ - { 11119, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */ - { 11161, 0x00008212 }, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ - { 11196, 0x00008217 }, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ - { 11235, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */ - { 11284, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ - { 11332, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */ - { 11384, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ - { 11424, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ - { 11468, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ - { 11508, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */ - { 11552, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */ - { 11579, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE */ - { 11603, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */ - { 11631, 0x00008218 }, /* GL_FRAMEBUFFER_DEFAULT */ - { 11654, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */ - { 11673, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ - { 11710, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */ - { 11751, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ - { 11792, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ - { 11834, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ - { 11885, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ - { 11923, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ - { 11968, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */ - { 12017, 0x00008D56 }, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ - { 12055, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ - { 12097, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ - { 12129, 0x00008219 }, /* GL_FRAMEBUFFER_UNDEFINED */ - { 12154, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED */ - { 12181, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */ - { 12212, 0x00000404 }, /* GL_FRONT */ - { 12221, 0x00000408 }, /* GL_FRONT_AND_BACK */ - { 12239, 0x00000B46 }, /* GL_FRONT_FACE */ - { 12253, 0x00000400 }, /* GL_FRONT_LEFT */ - { 12267, 0x00000401 }, /* GL_FRONT_RIGHT */ - { 12282, 0x00008006 }, /* GL_FUNC_ADD */ - { 12294, 0x00008006 }, /* GL_FUNC_ADD_EXT */ - { 12310, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */ - { 12335, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */ - { 12364, 0x0000800A }, /* GL_FUNC_SUBTRACT */ - { 12381, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */ - { 12402, 0x00008191 }, /* GL_GENERATE_MIPMAP */ - { 12421, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */ - { 12445, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */ - { 12474, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */ - { 12498, 0x00000206 }, /* GL_GEQUAL */ - { 12508, 0x00000204 }, /* GL_GREATER */ - { 12519, 0x00001904 }, /* GL_GREEN */ - { 12528, 0x00000D19 }, /* GL_GREEN_BIAS */ - { 12542, 0x00000D53 }, /* GL_GREEN_BITS */ - { 12556, 0x00000D18 }, /* GL_GREEN_SCALE */ - { 12571, 0x00008000 }, /* GL_HINT_BIT */ - { 12583, 0x00008024 }, /* GL_HISTOGRAM */ - { 12596, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */ - { 12620, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */ - { 12648, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */ - { 12671, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */ - { 12698, 0x00008024 }, /* GL_HISTOGRAM_EXT */ - { 12715, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */ - { 12735, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */ - { 12759, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */ - { 12783, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */ - { 12811, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */ - { 12839, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */ - { 12871, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */ - { 12893, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */ - { 12919, 0x0000802D }, /* GL_HISTOGRAM_SINK */ - { 12937, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */ - { 12959, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */ - { 12978, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */ - { 13001, 0x0000862A }, /* GL_IDENTITY_NV */ - { 13016, 0x00008150 }, /* GL_IGNORE_BORDER_HP */ - { 13036, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ - { 13076, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ - { 13114, 0x00001E02 }, /* GL_INCR */ - { 13122, 0x00008507 }, /* GL_INCR_WRAP */ - { 13135, 0x00008507 }, /* GL_INCR_WRAP_EXT */ - { 13152, 0x00008222 }, /* GL_INDEX */ - { 13161, 0x00008077 }, /* GL_INDEX_ARRAY */ - { 13176, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */ - { 13206, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */ - { 13240, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */ - { 13263, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */ - { 13285, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */ - { 13305, 0x00000D51 }, /* GL_INDEX_BITS */ - { 13319, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */ - { 13340, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */ - { 13358, 0x00000C30 }, /* GL_INDEX_MODE */ - { 13372, 0x00000D13 }, /* GL_INDEX_OFFSET */ - { 13388, 0x00000D12 }, /* GL_INDEX_SHIFT */ - { 13403, 0x00000C21 }, /* GL_INDEX_WRITEMASK */ - { 13422, 0x00008B84 }, /* GL_INFO_LOG_LENGTH */ - { 13441, 0x00001404 }, /* GL_INT */ - { 13448, 0x00008049 }, /* GL_INTENSITY */ - { 13461, 0x0000804C }, /* GL_INTENSITY12 */ - { 13476, 0x0000804C }, /* GL_INTENSITY12_EXT */ - { 13495, 0x0000804D }, /* GL_INTENSITY16 */ - { 13510, 0x0000804D }, /* GL_INTENSITY16_EXT */ - { 13529, 0x0000804A }, /* GL_INTENSITY4 */ - { 13543, 0x0000804A }, /* GL_INTENSITY4_EXT */ - { 13561, 0x0000804B }, /* GL_INTENSITY8 */ - { 13575, 0x0000804B }, /* GL_INTENSITY8_EXT */ - { 13593, 0x00008049 }, /* GL_INTENSITY_EXT */ - { 13610, 0x00008575 }, /* GL_INTERPOLATE */ - { 13625, 0x00008575 }, /* GL_INTERPOLATE_ARB */ - { 13644, 0x00008575 }, /* GL_INTERPOLATE_EXT */ - { 13663, 0x00008B53 }, /* GL_INT_VEC2 */ - { 13675, 0x00008B53 }, /* GL_INT_VEC2_ARB */ - { 13691, 0x00008B54 }, /* GL_INT_VEC3 */ - { 13703, 0x00008B54 }, /* GL_INT_VEC3_ARB */ - { 13719, 0x00008B55 }, /* GL_INT_VEC4 */ - { 13731, 0x00008B55 }, /* GL_INT_VEC4_ARB */ - { 13747, 0x00000500 }, /* GL_INVALID_ENUM */ - { 13763, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION */ - { 13796, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ - { 13833, 0x00000502 }, /* GL_INVALID_OPERATION */ - { 13854, 0x00000501 }, /* GL_INVALID_VALUE */ - { 13871, 0x0000862B }, /* GL_INVERSE_NV */ - { 13885, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */ - { 13909, 0x0000150A }, /* GL_INVERT */ - { 13919, 0x00001E00 }, /* GL_KEEP */ - { 13927, 0x00008E4E }, /* GL_LAST_VERTEX_CONVENTION_EXT */ - { 13957, 0x00000406 }, /* GL_LEFT */ - { 13965, 0x00000203 }, /* GL_LEQUAL */ - { 13975, 0x00000201 }, /* GL_LESS */ - { 13983, 0x00004000 }, /* GL_LIGHT0 */ - { 13993, 0x00004001 }, /* GL_LIGHT1 */ - { 14003, 0x00004002 }, /* GL_LIGHT2 */ - { 14013, 0x00004003 }, /* GL_LIGHT3 */ - { 14023, 0x00004004 }, /* GL_LIGHT4 */ - { 14033, 0x00004005 }, /* GL_LIGHT5 */ - { 14043, 0x00004006 }, /* GL_LIGHT6 */ - { 14053, 0x00004007 }, /* GL_LIGHT7 */ - { 14063, 0x00000B50 }, /* GL_LIGHTING */ - { 14075, 0x00000040 }, /* GL_LIGHTING_BIT */ - { 14091, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */ - { 14114, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */ - { 14143, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */ - { 14176, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ - { 14204, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */ - { 14228, 0x00001B01 }, /* GL_LINE */ - { 14236, 0x00002601 }, /* GL_LINEAR */ - { 14246, 0x00001208 }, /* GL_LINEAR_ATTENUATION */ - { 14268, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ - { 14298, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ - { 14329, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */ - { 14353, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */ - { 14378, 0x00000001 }, /* GL_LINES */ - { 14387, 0x00000004 }, /* GL_LINE_BIT */ - { 14399, 0x00000002 }, /* GL_LINE_LOOP */ - { 14412, 0x00000707 }, /* GL_LINE_RESET_TOKEN */ - { 14432, 0x00000B20 }, /* GL_LINE_SMOOTH */ - { 14447, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */ - { 14467, 0x00000B24 }, /* GL_LINE_STIPPLE */ - { 14483, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */ - { 14507, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */ - { 14530, 0x00000003 }, /* GL_LINE_STRIP */ - { 14544, 0x00000702 }, /* GL_LINE_TOKEN */ - { 14558, 0x00000B21 }, /* GL_LINE_WIDTH */ - { 14572, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */ - { 14598, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */ - { 14618, 0x00008B82 }, /* GL_LINK_STATUS */ - { 14633, 0x00000B32 }, /* GL_LIST_BASE */ - { 14646, 0x00020000 }, /* GL_LIST_BIT */ - { 14658, 0x00000B33 }, /* GL_LIST_INDEX */ - { 14672, 0x00000B30 }, /* GL_LIST_MODE */ - { 14685, 0x00000101 }, /* GL_LOAD */ - { 14693, 0x00000BF1 }, /* GL_LOGIC_OP */ - { 14705, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */ - { 14722, 0x00008CA1 }, /* GL_LOWER_LEFT */ - { 14736, 0x00001909 }, /* GL_LUMINANCE */ - { 14749, 0x00008041 }, /* GL_LUMINANCE12 */ - { 14764, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */ - { 14787, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */ - { 14814, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */ - { 14836, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */ - { 14862, 0x00008041 }, /* GL_LUMINANCE12_EXT */ - { 14881, 0x00008042 }, /* GL_LUMINANCE16 */ - { 14896, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */ - { 14919, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */ - { 14946, 0x00008042 }, /* GL_LUMINANCE16_EXT */ - { 14965, 0x0000803F }, /* GL_LUMINANCE4 */ - { 14979, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */ - { 15000, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */ - { 15025, 0x0000803F }, /* GL_LUMINANCE4_EXT */ - { 15043, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */ - { 15064, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */ - { 15089, 0x00008040 }, /* GL_LUMINANCE8 */ - { 15103, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */ - { 15124, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */ - { 15149, 0x00008040 }, /* GL_LUMINANCE8_EXT */ - { 15167, 0x0000190A }, /* GL_LUMINANCE_ALPHA */ - { 15186, 0x00000D90 }, /* GL_MAP1_COLOR_4 */ - { 15202, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */ - { 15222, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */ - { 15244, 0x00000D91 }, /* GL_MAP1_INDEX */ - { 15258, 0x00000D92 }, /* GL_MAP1_NORMAL */ - { 15273, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */ - { 15297, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */ - { 15321, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */ - { 15345, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */ - { 15369, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */ - { 15386, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */ - { 15403, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ - { 15431, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ - { 15460, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ - { 15489, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ - { 15518, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ - { 15547, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ - { 15576, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ - { 15605, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ - { 15633, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ - { 15661, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ - { 15689, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ - { 15717, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ - { 15745, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ - { 15773, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ - { 15801, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ - { 15829, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ - { 15857, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */ - { 15873, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */ - { 15893, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */ - { 15915, 0x00000DB1 }, /* GL_MAP2_INDEX */ - { 15929, 0x00000DB2 }, /* GL_MAP2_NORMAL */ - { 15944, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */ - { 15968, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */ - { 15992, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */ - { 16016, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */ - { 16040, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */ - { 16057, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */ - { 16074, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ - { 16102, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ - { 16131, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ - { 16160, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ - { 16189, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ - { 16218, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ - { 16247, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ - { 16276, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ - { 16304, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ - { 16332, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ - { 16360, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ - { 16388, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ - { 16416, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ - { 16444, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */ - { 16472, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ - { 16500, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ - { 16528, 0x00000D10 }, /* GL_MAP_COLOR */ - { 16541, 0x00000010 }, /* GL_MAP_FLUSH_EXPLICIT_BIT */ - { 16567, 0x00000008 }, /* GL_MAP_INVALIDATE_BUFFER_BIT */ - { 16596, 0x00000004 }, /* GL_MAP_INVALIDATE_RANGE_BIT */ - { 16624, 0x00000001 }, /* GL_MAP_READ_BIT */ - { 16640, 0x00000D11 }, /* GL_MAP_STENCIL */ - { 16655, 0x00000020 }, /* GL_MAP_UNSYNCHRONIZED_BIT */ - { 16681, 0x00000002 }, /* GL_MAP_WRITE_BIT */ - { 16698, 0x000088C0 }, /* GL_MATRIX0_ARB */ - { 16713, 0x00008630 }, /* GL_MATRIX0_NV */ - { 16727, 0x000088CA }, /* GL_MATRIX10_ARB */ - { 16743, 0x000088CB }, /* GL_MATRIX11_ARB */ - { 16759, 0x000088CC }, /* GL_MATRIX12_ARB */ - { 16775, 0x000088CD }, /* GL_MATRIX13_ARB */ - { 16791, 0x000088CE }, /* GL_MATRIX14_ARB */ - { 16807, 0x000088CF }, /* GL_MATRIX15_ARB */ - { 16823, 0x000088D0 }, /* GL_MATRIX16_ARB */ - { 16839, 0x000088D1 }, /* GL_MATRIX17_ARB */ - { 16855, 0x000088D2 }, /* GL_MATRIX18_ARB */ - { 16871, 0x000088D3 }, /* GL_MATRIX19_ARB */ - { 16887, 0x000088C1 }, /* GL_MATRIX1_ARB */ - { 16902, 0x00008631 }, /* GL_MATRIX1_NV */ - { 16916, 0x000088D4 }, /* GL_MATRIX20_ARB */ - { 16932, 0x000088D5 }, /* GL_MATRIX21_ARB */ - { 16948, 0x000088D6 }, /* GL_MATRIX22_ARB */ - { 16964, 0x000088D7 }, /* GL_MATRIX23_ARB */ - { 16980, 0x000088D8 }, /* GL_MATRIX24_ARB */ - { 16996, 0x000088D9 }, /* GL_MATRIX25_ARB */ - { 17012, 0x000088DA }, /* GL_MATRIX26_ARB */ - { 17028, 0x000088DB }, /* GL_MATRIX27_ARB */ - { 17044, 0x000088DC }, /* GL_MATRIX28_ARB */ - { 17060, 0x000088DD }, /* GL_MATRIX29_ARB */ - { 17076, 0x000088C2 }, /* GL_MATRIX2_ARB */ - { 17091, 0x00008632 }, /* GL_MATRIX2_NV */ - { 17105, 0x000088DE }, /* GL_MATRIX30_ARB */ - { 17121, 0x000088DF }, /* GL_MATRIX31_ARB */ - { 17137, 0x000088C3 }, /* GL_MATRIX3_ARB */ - { 17152, 0x00008633 }, /* GL_MATRIX3_NV */ - { 17166, 0x000088C4 }, /* GL_MATRIX4_ARB */ - { 17181, 0x00008634 }, /* GL_MATRIX4_NV */ - { 17195, 0x000088C5 }, /* GL_MATRIX5_ARB */ - { 17210, 0x00008635 }, /* GL_MATRIX5_NV */ - { 17224, 0x000088C6 }, /* GL_MATRIX6_ARB */ - { 17239, 0x00008636 }, /* GL_MATRIX6_NV */ - { 17253, 0x000088C7 }, /* GL_MATRIX7_ARB */ - { 17268, 0x00008637 }, /* GL_MATRIX7_NV */ - { 17282, 0x000088C8 }, /* GL_MATRIX8_ARB */ - { 17297, 0x000088C9 }, /* GL_MATRIX9_ARB */ - { 17312, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */ - { 17338, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ - { 17372, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ - { 17403, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ - { 17436, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ - { 17467, 0x00000BA0 }, /* GL_MATRIX_MODE */ - { 17482, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */ - { 17504, 0x00008008 }, /* GL_MAX */ - { 17511, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */ - { 17534, 0x000088FF }, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ - { 17566, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */ - { 17592, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ - { 17625, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ - { 17651, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - { 17685, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */ - { 17704, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ - { 17733, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ - { 17765, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */ - { 17801, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ - { 17837, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */ - { 17877, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */ - { 17903, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */ - { 17933, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */ - { 17958, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */ - { 17987, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ - { 18016, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */ - { 18049, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS */ - { 18069, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */ - { 18093, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */ - { 18117, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */ - { 18141, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */ - { 18166, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */ - { 18184, 0x00008008 }, /* GL_MAX_EXT */ - { 18195, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ - { 18230, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */ - { 18269, 0x00000D31 }, /* GL_MAX_LIGHTS */ - { 18283, 0x00000B31 }, /* GL_MAX_LIST_NESTING */ - { 18303, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ - { 18341, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */ - { 18370, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */ - { 18394, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */ - { 18422, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */ - { 18445, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ - { 18482, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ - { 18518, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ - { 18545, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ - { 18574, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ - { 18608, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ - { 18644, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ - { 18671, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ - { 18703, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ - { 18739, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ - { 18768, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ - { 18797, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */ - { 18825, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ - { 18863, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - { 18907, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - { 18950, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ - { 18984, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - { 19023, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ - { 19060, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ - { 19098, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - { 19141, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - { 19184, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ - { 19214, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ - { 19245, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ - { 19281, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ - { 19317, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */ - { 19347, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ - { 19381, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */ - { 19414, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ - { 19443, 0x00008D57 }, /* GL_MAX_SAMPLES */ - { 19458, 0x00009111 }, /* GL_MAX_SERVER_WAIT_TIMEOUT */ - { 19485, 0x00008504 }, /* GL_MAX_SHININESS_NV */ - { 19505, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */ - { 19529, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS */ - { 19551, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */ - { 19577, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS */ - { 19604, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */ - { 19635, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */ - { 19659, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ - { 19693, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */ - { 19713, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */ - { 19740, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */ - { 19761, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */ - { 19786, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */ - { 19811, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */ - { 19846, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */ - { 19868, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */ - { 19894, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */ - { 19916, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */ - { 19942, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ - { 19976, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ - { 20014, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ - { 20047, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */ - { 20084, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */ - { 20108, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */ - { 20129, 0x00008007 }, /* GL_MIN */ - { 20136, 0x0000802E }, /* GL_MINMAX */ - { 20146, 0x0000802E }, /* GL_MINMAX_EXT */ - { 20160, 0x0000802F }, /* GL_MINMAX_FORMAT */ - { 20177, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */ - { 20198, 0x00008030 }, /* GL_MINMAX_SINK */ - { 20213, 0x00008030 }, /* GL_MINMAX_SINK_EXT */ - { 20232, 0x00008007 }, /* GL_MIN_EXT */ - { 20243, 0x00008370 }, /* GL_MIRRORED_REPEAT */ - { 20262, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */ - { 20285, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */ - { 20308, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */ - { 20328, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */ - { 20348, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ - { 20378, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */ - { 20406, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ - { 20434, 0x00001700 }, /* GL_MODELVIEW */ - { 20447, 0x00001700 }, /* GL_MODELVIEW0_ARB */ - { 20465, 0x0000872A }, /* GL_MODELVIEW10_ARB */ - { 20484, 0x0000872B }, /* GL_MODELVIEW11_ARB */ - { 20503, 0x0000872C }, /* GL_MODELVIEW12_ARB */ - { 20522, 0x0000872D }, /* GL_MODELVIEW13_ARB */ - { 20541, 0x0000872E }, /* GL_MODELVIEW14_ARB */ - { 20560, 0x0000872F }, /* GL_MODELVIEW15_ARB */ - { 20579, 0x00008730 }, /* GL_MODELVIEW16_ARB */ - { 20598, 0x00008731 }, /* GL_MODELVIEW17_ARB */ - { 20617, 0x00008732 }, /* GL_MODELVIEW18_ARB */ - { 20636, 0x00008733 }, /* GL_MODELVIEW19_ARB */ - { 20655, 0x0000850A }, /* GL_MODELVIEW1_ARB */ - { 20673, 0x00008734 }, /* GL_MODELVIEW20_ARB */ - { 20692, 0x00008735 }, /* GL_MODELVIEW21_ARB */ - { 20711, 0x00008736 }, /* GL_MODELVIEW22_ARB */ - { 20730, 0x00008737 }, /* GL_MODELVIEW23_ARB */ - { 20749, 0x00008738 }, /* GL_MODELVIEW24_ARB */ - { 20768, 0x00008739 }, /* GL_MODELVIEW25_ARB */ - { 20787, 0x0000873A }, /* GL_MODELVIEW26_ARB */ - { 20806, 0x0000873B }, /* GL_MODELVIEW27_ARB */ - { 20825, 0x0000873C }, /* GL_MODELVIEW28_ARB */ - { 20844, 0x0000873D }, /* GL_MODELVIEW29_ARB */ - { 20863, 0x00008722 }, /* GL_MODELVIEW2_ARB */ - { 20881, 0x0000873E }, /* GL_MODELVIEW30_ARB */ - { 20900, 0x0000873F }, /* GL_MODELVIEW31_ARB */ - { 20919, 0x00008723 }, /* GL_MODELVIEW3_ARB */ - { 20937, 0x00008724 }, /* GL_MODELVIEW4_ARB */ - { 20955, 0x00008725 }, /* GL_MODELVIEW5_ARB */ - { 20973, 0x00008726 }, /* GL_MODELVIEW6_ARB */ - { 20991, 0x00008727 }, /* GL_MODELVIEW7_ARB */ - { 21009, 0x00008728 }, /* GL_MODELVIEW8_ARB */ - { 21027, 0x00008729 }, /* GL_MODELVIEW9_ARB */ - { 21045, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */ - { 21065, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */ - { 21092, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */ - { 21117, 0x00002100 }, /* GL_MODULATE */ - { 21129, 0x00008744 }, /* GL_MODULATE_ADD_ATI */ - { 21149, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */ - { 21176, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */ - { 21201, 0x00000103 }, /* GL_MULT */ - { 21209, 0x0000809D }, /* GL_MULTISAMPLE */ - { 21224, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */ - { 21244, 0x0000809D }, /* GL_MULTISAMPLE_ARB */ - { 21263, 0x20000000 }, /* GL_MULTISAMPLE_BIT */ - { 21282, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */ - { 21306, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */ - { 21329, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */ - { 21359, 0x00002A25 }, /* GL_N3F_V3F */ - { 21370, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */ - { 21390, 0x0000150E }, /* GL_NAND */ - { 21398, 0x00002600 }, /* GL_NEAREST */ - { 21409, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ - { 21440, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ - { 21472, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */ - { 21497, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */ - { 21523, 0x00000200 }, /* GL_NEVER */ - { 21532, 0x00001102 }, /* GL_NICEST */ - { 21542, 0x00000000 }, /* GL_NONE */ - { 21550, 0x00001505 }, /* GL_NOOP */ - { 21558, 0x00001508 }, /* GL_NOR */ - { 21565, 0x00000BA1 }, /* GL_NORMALIZE */ - { 21578, 0x00008075 }, /* GL_NORMAL_ARRAY */ - { 21594, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ - { 21625, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */ - { 21660, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */ - { 21684, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */ - { 21707, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */ - { 21728, 0x00008511 }, /* GL_NORMAL_MAP */ - { 21742, 0x00008511 }, /* GL_NORMAL_MAP_ARB */ - { 21760, 0x00008511 }, /* GL_NORMAL_MAP_NV */ - { 21777, 0x00000205 }, /* GL_NOTEQUAL */ - { 21789, 0x00000000 }, /* GL_NO_ERROR */ - { 21801, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ - { 21835, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB */ - { 21873, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */ - { 21905, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */ - { 21947, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */ - { 21977, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */ - { 22017, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */ - { 22048, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */ - { 22077, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */ - { 22105, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */ - { 22135, 0x00002401 }, /* GL_OBJECT_LINEAR */ - { 22152, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */ - { 22178, 0x00002501 }, /* GL_OBJECT_PLANE */ - { 22194, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */ - { 22229, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */ - { 22251, 0x00009112 }, /* GL_OBJECT_TYPE */ - { 22266, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */ - { 22285, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */ - { 22315, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */ - { 22336, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */ - { 22364, 0x00000001 }, /* GL_ONE */ - { 22371, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */ - { 22399, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */ - { 22431, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */ - { 22459, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */ - { 22491, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */ - { 22514, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */ - { 22537, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */ - { 22560, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */ - { 22583, 0x00008598 }, /* GL_OPERAND0_ALPHA */ - { 22601, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */ - { 22623, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */ - { 22645, 0x00008590 }, /* GL_OPERAND0_RGB */ - { 22661, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */ - { 22681, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */ - { 22701, 0x00008599 }, /* GL_OPERAND1_ALPHA */ - { 22719, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */ - { 22741, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */ - { 22763, 0x00008591 }, /* GL_OPERAND1_RGB */ - { 22779, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */ - { 22799, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */ - { 22819, 0x0000859A }, /* GL_OPERAND2_ALPHA */ - { 22837, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */ - { 22859, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */ - { 22881, 0x00008592 }, /* GL_OPERAND2_RGB */ - { 22897, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */ - { 22917, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */ - { 22937, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */ - { 22958, 0x00008593 }, /* GL_OPERAND3_RGB_NV */ - { 22977, 0x00001507 }, /* GL_OR */ - { 22983, 0x00000A01 }, /* GL_ORDER */ - { 22992, 0x0000150D }, /* GL_OR_INVERTED */ - { 23007, 0x0000150B }, /* GL_OR_REVERSE */ - { 23021, 0x00000505 }, /* GL_OUT_OF_MEMORY */ - { 23038, 0x00000D05 }, /* GL_PACK_ALIGNMENT */ - { 23056, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */ - { 23077, 0x00008758 }, /* GL_PACK_INVERT_MESA */ - { 23097, 0x00000D01 }, /* GL_PACK_LSB_FIRST */ - { 23115, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */ - { 23134, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */ - { 23154, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */ - { 23174, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */ - { 23192, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */ - { 23211, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */ - { 23236, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */ - { 23260, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */ - { 23281, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */ - { 23303, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */ - { 23325, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */ - { 23350, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */ - { 23374, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */ - { 23395, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */ - { 23417, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */ - { 23439, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */ - { 23461, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */ - { 23492, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */ - { 23512, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */ - { 23537, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */ - { 23557, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */ - { 23582, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */ - { 23602, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */ - { 23627, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */ - { 23647, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */ - { 23672, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */ - { 23692, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */ - { 23717, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */ - { 23737, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */ - { 23762, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */ - { 23782, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */ - { 23807, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */ - { 23827, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */ - { 23852, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */ - { 23872, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */ - { 23897, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */ - { 23917, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */ - { 23942, 0x00000020 }, /* GL_PIXEL_MODE_BIT */ - { 23960, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER */ - { 23981, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING */ - { 24010, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */ - { 24043, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */ - { 24068, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER */ - { 24091, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING */ - { 24122, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */ - { 24157, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */ - { 24184, 0x00001B00 }, /* GL_POINT */ - { 24193, 0x00000000 }, /* GL_POINTS */ - { 24203, 0x00000002 }, /* GL_POINT_BIT */ - { 24216, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */ - { 24246, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */ - { 24280, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */ - { 24314, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */ - { 24349, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */ - { 24378, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */ - { 24411, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */ - { 24444, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */ - { 24478, 0x00000B11 }, /* GL_POINT_SIZE */ - { 24492, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */ - { 24518, 0x00008127 }, /* GL_POINT_SIZE_MAX */ - { 24536, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */ - { 24558, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */ - { 24580, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */ - { 24603, 0x00008126 }, /* GL_POINT_SIZE_MIN */ - { 24621, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */ - { 24643, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */ - { 24665, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */ - { 24688, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */ - { 24708, 0x00000B10 }, /* GL_POINT_SMOOTH */ - { 24724, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */ - { 24745, 0x00008861 }, /* GL_POINT_SPRITE */ - { 24761, 0x00008861 }, /* GL_POINT_SPRITE_ARB */ - { 24781, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */ - { 24810, 0x00008861 }, /* GL_POINT_SPRITE_NV */ - { 24829, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */ - { 24855, 0x00000701 }, /* GL_POINT_TOKEN */ - { 24870, 0x00000009 }, /* GL_POLYGON */ - { 24881, 0x00000008 }, /* GL_POLYGON_BIT */ - { 24896, 0x00000B40 }, /* GL_POLYGON_MODE */ - { 24912, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */ - { 24935, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */ - { 24960, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */ - { 24983, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */ - { 25006, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */ - { 25030, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */ - { 25054, 0x00000B41 }, /* GL_POLYGON_SMOOTH */ - { 25072, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */ - { 25095, 0x00000B42 }, /* GL_POLYGON_STIPPLE */ - { 25114, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */ - { 25137, 0x00000703 }, /* GL_POLYGON_TOKEN */ - { 25154, 0x00001203 }, /* GL_POSITION */ - { 25166, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ - { 25198, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */ - { 25234, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ - { 25267, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */ - { 25304, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ - { 25335, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */ - { 25370, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ - { 25402, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */ - { 25438, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ - { 25471, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ - { 25503, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */ - { 25539, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ - { 25572, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */ - { 25609, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */ - { 25639, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */ - { 25673, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */ - { 25704, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */ - { 25739, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ - { 25770, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */ - { 25805, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ - { 25837, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */ - { 25873, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */ - { 25903, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */ - { 25937, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */ - { 25968, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */ - { 26003, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */ - { 26035, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */ - { 26066, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */ - { 26101, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */ - { 26133, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */ - { 26169, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */ - { 26198, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */ - { 26231, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */ - { 26261, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */ - { 26295, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ - { 26334, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ - { 26367, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ - { 26407, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ - { 26441, 0x00008578 }, /* GL_PREVIOUS */ - { 26453, 0x00008578 }, /* GL_PREVIOUS_ARB */ - { 26469, 0x00008578 }, /* GL_PREVIOUS_EXT */ - { 26485, 0x00008577 }, /* GL_PRIMARY_COLOR */ - { 26502, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */ - { 26523, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */ - { 26544, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ - { 26577, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ - { 26609, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */ - { 26632, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */ - { 26655, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */ - { 26685, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */ - { 26714, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */ - { 26742, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */ - { 26764, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */ - { 26792, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */ - { 26820, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */ - { 26842, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */ - { 26863, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - { 26903, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - { 26942, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ - { 26972, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - { 27007, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ - { 27040, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ - { 27074, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - { 27113, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - { 27152, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */ - { 27174, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */ - { 27200, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */ - { 27224, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */ - { 27247, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */ - { 27269, 0x00008628 }, /* GL_PROGRAM_STRING_NV */ - { 27290, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */ - { 27311, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */ - { 27338, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ - { 27370, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ - { 27402, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ - { 27437, 0x00001701 }, /* GL_PROJECTION */ - { 27451, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */ - { 27472, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */ - { 27498, 0x00008E4F }, /* GL_PROVOKING_VERTEX_EXT */ - { 27522, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */ - { 27543, 0x00008025 }, /* GL_PROXY_HISTOGRAM */ - { 27562, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */ - { 27585, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ - { 27624, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ - { 27662, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */ - { 27682, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ - { 27712, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */ - { 27736, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */ - { 27756, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ - { 27786, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */ - { 27810, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */ - { 27830, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ - { 27863, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */ - { 27889, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */ - { 27919, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ - { 27950, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */ - { 27980, 0x00002003 }, /* GL_Q */ - { 27985, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */ - { 28010, 0x00000007 }, /* GL_QUADS */ - { 28019, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT */ - { 28067, 0x00008614 }, /* GL_QUAD_MESH_SUN */ - { 28084, 0x00000008 }, /* GL_QUAD_STRIP */ - { 28098, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */ - { 28120, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */ - { 28146, 0x00008866 }, /* GL_QUERY_RESULT */ - { 28162, 0x00008866 }, /* GL_QUERY_RESULT_ARB */ - { 28182, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */ - { 28208, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */ - { 28238, 0x00002002 }, /* GL_R */ - { 28243, 0x00002A10 }, /* GL_R3_G3_B2 */ - { 28255, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ - { 28288, 0x00000C02 }, /* GL_READ_BUFFER */ - { 28303, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER */ - { 28323, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ - { 28355, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */ - { 28379, 0x000088B8 }, /* GL_READ_ONLY */ - { 28392, 0x000088B8 }, /* GL_READ_ONLY_ARB */ - { 28409, 0x000088BA }, /* GL_READ_WRITE */ - { 28423, 0x000088BA }, /* GL_READ_WRITE_ARB */ - { 28441, 0x00001903 }, /* GL_RED */ - { 28448, 0x00008016 }, /* GL_REDUCE */ - { 28458, 0x00008016 }, /* GL_REDUCE_EXT */ - { 28472, 0x00000D15 }, /* GL_RED_BIAS */ - { 28484, 0x00000D52 }, /* GL_RED_BITS */ - { 28496, 0x00000D14 }, /* GL_RED_SCALE */ - { 28509, 0x00008512 }, /* GL_REFLECTION_MAP */ - { 28527, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */ - { 28549, 0x00008512 }, /* GL_REFLECTION_MAP_NV */ - { 28570, 0x00001C00 }, /* GL_RENDER */ - { 28580, 0x00008D41 }, /* GL_RENDERBUFFER */ - { 28596, 0x00008D53 }, /* GL_RENDERBUFFER_ALPHA_SIZE */ - { 28623, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */ - { 28651, 0x00008D52 }, /* GL_RENDERBUFFER_BLUE_SIZE */ - { 28677, 0x00008D54 }, /* GL_RENDERBUFFER_DEPTH_SIZE */ - { 28704, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */ - { 28724, 0x00008D51 }, /* GL_RENDERBUFFER_GREEN_SIZE */ - { 28751, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT */ - { 28774, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */ - { 28801, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ - { 28833, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ - { 28869, 0x00008D50 }, /* GL_RENDERBUFFER_RED_SIZE */ - { 28894, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES */ - { 28918, 0x00008D55 }, /* GL_RENDERBUFFER_STENCIL_SIZE */ - { 28947, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH */ - { 28969, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */ - { 28995, 0x00001F01 }, /* GL_RENDERER */ - { 29007, 0x00000C40 }, /* GL_RENDER_MODE */ - { 29022, 0x00002901 }, /* GL_REPEAT */ - { 29032, 0x00001E01 }, /* GL_REPLACE */ - { 29043, 0x00008062 }, /* GL_REPLACE_EXT */ - { 29058, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */ - { 29081, 0x0000803A }, /* GL_RESCALE_NORMAL */ - { 29099, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */ - { 29121, 0x00000102 }, /* GL_RETURN */ - { 29131, 0x00001907 }, /* GL_RGB */ - { 29138, 0x00008052 }, /* GL_RGB10 */ - { 29147, 0x00008059 }, /* GL_RGB10_A2 */ - { 29159, 0x00008059 }, /* GL_RGB10_A2_EXT */ - { 29175, 0x00008052 }, /* GL_RGB10_EXT */ - { 29188, 0x00008053 }, /* GL_RGB12 */ - { 29197, 0x00008053 }, /* GL_RGB12_EXT */ - { 29210, 0x00008054 }, /* GL_RGB16 */ - { 29219, 0x00008054 }, /* GL_RGB16_EXT */ - { 29232, 0x0000804E }, /* GL_RGB2_EXT */ - { 29244, 0x0000804F }, /* GL_RGB4 */ - { 29252, 0x0000804F }, /* GL_RGB4_EXT */ - { 29264, 0x000083A1 }, /* GL_RGB4_S3TC */ - { 29277, 0x00008050 }, /* GL_RGB5 */ - { 29285, 0x00008057 }, /* GL_RGB5_A1 */ - { 29296, 0x00008057 }, /* GL_RGB5_A1_EXT */ - { 29311, 0x00008050 }, /* GL_RGB5_EXT */ - { 29323, 0x00008051 }, /* GL_RGB8 */ - { 29331, 0x00008051 }, /* GL_RGB8_EXT */ - { 29343, 0x00001908 }, /* GL_RGBA */ - { 29351, 0x0000805A }, /* GL_RGBA12 */ - { 29361, 0x0000805A }, /* GL_RGBA12_EXT */ - { 29375, 0x0000805B }, /* GL_RGBA16 */ - { 29385, 0x0000805B }, /* GL_RGBA16_EXT */ - { 29399, 0x00008055 }, /* GL_RGBA2 */ - { 29408, 0x00008055 }, /* GL_RGBA2_EXT */ - { 29421, 0x00008056 }, /* GL_RGBA4 */ - { 29430, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */ - { 29449, 0x00008056 }, /* GL_RGBA4_EXT */ - { 29462, 0x000083A3 }, /* GL_RGBA4_S3TC */ - { 29476, 0x00008058 }, /* GL_RGBA8 */ - { 29485, 0x00008058 }, /* GL_RGBA8_EXT */ - { 29498, 0x00008F97 }, /* GL_RGBA8_SNORM */ - { 29513, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */ - { 29531, 0x00000C31 }, /* GL_RGBA_MODE */ - { 29544, 0x000083A2 }, /* GL_RGBA_S3TC */ - { 29557, 0x00008F93 }, /* GL_RGBA_SNORM */ - { 29571, 0x000083A0 }, /* GL_RGB_S3TC */ - { 29583, 0x00008573 }, /* GL_RGB_SCALE */ - { 29596, 0x00008573 }, /* GL_RGB_SCALE_ARB */ - { 29613, 0x00008573 }, /* GL_RGB_SCALE_EXT */ - { 29630, 0x00000407 }, /* GL_RIGHT */ - { 29639, 0x00002000 }, /* GL_S */ - { 29644, 0x00008B5D }, /* GL_SAMPLER_1D */ - { 29658, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */ - { 29679, 0x00008B5E }, /* GL_SAMPLER_2D */ - { 29693, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */ - { 29714, 0x00008B5F }, /* GL_SAMPLER_3D */ - { 29728, 0x00008B60 }, /* GL_SAMPLER_CUBE */ - { 29744, 0x000080A9 }, /* GL_SAMPLES */ - { 29755, 0x000086B4 }, /* GL_SAMPLES_3DFX */ - { 29771, 0x000080A9 }, /* GL_SAMPLES_ARB */ - { 29786, 0x00008914 }, /* GL_SAMPLES_PASSED */ - { 29804, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */ - { 29826, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ - { 29854, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */ - { 29886, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */ - { 29909, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */ - { 29936, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */ - { 29954, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */ - { 29977, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */ - { 29999, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */ - { 30018, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */ - { 30041, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */ - { 30067, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */ - { 30097, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */ - { 30122, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */ - { 30151, 0x00080000 }, /* GL_SCISSOR_BIT */ - { 30166, 0x00000C10 }, /* GL_SCISSOR_BOX */ - { 30181, 0x00000C11 }, /* GL_SCISSOR_TEST */ - { 30197, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */ - { 30222, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ - { 30262, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */ - { 30306, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ - { 30339, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ - { 30369, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ - { 30401, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ - { 30431, 0x00001C02 }, /* GL_SELECT */ - { 30441, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */ - { 30469, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */ - { 30494, 0x00008012 }, /* GL_SEPARABLE_2D */ - { 30510, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */ - { 30537, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */ - { 30568, 0x0000150F }, /* GL_SET */ - { 30575, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */ - { 30596, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */ - { 30620, 0x00008B4F }, /* GL_SHADER_TYPE */ - { 30635, 0x00000B54 }, /* GL_SHADE_MODEL */ - { 30650, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */ - { 30678, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */ - { 30701, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */ - { 30731, 0x00001601 }, /* GL_SHININESS */ - { 30744, 0x00001402 }, /* GL_SHORT */ - { 30753, 0x00009119 }, /* GL_SIGNALED */ - { 30765, 0x00008F9C }, /* GL_SIGNED_NORMALIZED */ - { 30786, 0x000081F9 }, /* GL_SINGLE_COLOR */ - { 30802, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */ - { 30822, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */ - { 30841, 0x00008C46 }, /* GL_SLUMINANCE */ - { 30855, 0x00008C47 }, /* GL_SLUMINANCE8 */ - { 30870, 0x00008C45 }, /* GL_SLUMINANCE8_ALPHA8 */ - { 30892, 0x00008C44 }, /* GL_SLUMINANCE_ALPHA */ - { 30912, 0x00001D01 }, /* GL_SMOOTH */ - { 30922, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */ - { 30955, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */ - { 30982, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */ - { 31015, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */ - { 31042, 0x00008588 }, /* GL_SOURCE0_ALPHA */ - { 31059, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */ - { 31080, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */ - { 31101, 0x00008580 }, /* GL_SOURCE0_RGB */ - { 31116, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */ - { 31135, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */ - { 31154, 0x00008589 }, /* GL_SOURCE1_ALPHA */ - { 31171, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */ - { 31192, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */ - { 31213, 0x00008581 }, /* GL_SOURCE1_RGB */ - { 31228, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */ - { 31247, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */ - { 31266, 0x0000858A }, /* GL_SOURCE2_ALPHA */ - { 31283, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */ - { 31304, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */ - { 31325, 0x00008582 }, /* GL_SOURCE2_RGB */ - { 31340, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */ - { 31359, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */ - { 31378, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */ - { 31398, 0x00008583 }, /* GL_SOURCE3_RGB_NV */ - { 31416, 0x00001202 }, /* GL_SPECULAR */ - { 31428, 0x00002402 }, /* GL_SPHERE_MAP */ - { 31442, 0x00001206 }, /* GL_SPOT_CUTOFF */ - { 31457, 0x00001204 }, /* GL_SPOT_DIRECTION */ - { 31475, 0x00001205 }, /* GL_SPOT_EXPONENT */ - { 31492, 0x00008588 }, /* GL_SRC0_ALPHA */ - { 31506, 0x00008580 }, /* GL_SRC0_RGB */ - { 31518, 0x00008589 }, /* GL_SRC1_ALPHA */ - { 31532, 0x00008581 }, /* GL_SRC1_RGB */ - { 31544, 0x0000858A }, /* GL_SRC2_ALPHA */ - { 31558, 0x00008582 }, /* GL_SRC2_RGB */ - { 31570, 0x00000302 }, /* GL_SRC_ALPHA */ - { 31583, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */ - { 31605, 0x00000300 }, /* GL_SRC_COLOR */ - { 31618, 0x00008C40 }, /* GL_SRGB */ - { 31626, 0x00008C41 }, /* GL_SRGB8 */ - { 31635, 0x00008C43 }, /* GL_SRGB8_ALPHA8 */ - { 31651, 0x00008C42 }, /* GL_SRGB_ALPHA */ - { 31665, 0x00000503 }, /* GL_STACK_OVERFLOW */ - { 31683, 0x00000504 }, /* GL_STACK_UNDERFLOW */ - { 31702, 0x000088E6 }, /* GL_STATIC_COPY */ - { 31717, 0x000088E6 }, /* GL_STATIC_COPY_ARB */ - { 31736, 0x000088E4 }, /* GL_STATIC_DRAW */ - { 31751, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */ - { 31770, 0x000088E5 }, /* GL_STATIC_READ */ - { 31785, 0x000088E5 }, /* GL_STATIC_READ_ARB */ - { 31804, 0x00001802 }, /* GL_STENCIL */ - { 31815, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT */ - { 31837, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */ - { 31863, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */ - { 31884, 0x00008801 }, /* GL_STENCIL_BACK_FAIL_ATI */ - { 31909, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */ - { 31930, 0x00008800 }, /* GL_STENCIL_BACK_FUNC_ATI */ - { 31955, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ - { 31987, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI */ - { 32023, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ - { 32055, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI */ - { 32091, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */ - { 32111, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */ - { 32138, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */ - { 32164, 0x00000D57 }, /* GL_STENCIL_BITS */ - { 32180, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */ - { 32202, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */ - { 32225, 0x00000B94 }, /* GL_STENCIL_FAIL */ - { 32241, 0x00000B92 }, /* GL_STENCIL_FUNC */ - { 32257, 0x00001901 }, /* GL_STENCIL_INDEX */ - { 32274, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */ - { 32297, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */ - { 32319, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */ - { 32341, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */ - { 32363, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */ - { 32384, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */ - { 32411, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */ - { 32438, 0x00000B97 }, /* GL_STENCIL_REF */ - { 32453, 0x00000B90 }, /* GL_STENCIL_TEST */ - { 32469, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ - { 32498, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */ - { 32520, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */ - { 32541, 0x00000C33 }, /* GL_STEREO */ - { 32551, 0x000085BE }, /* GL_STORAGE_CACHED_APPLE */ - { 32575, 0x000085BD }, /* GL_STORAGE_PRIVATE_APPLE */ - { 32600, 0x000085BF }, /* GL_STORAGE_SHARED_APPLE */ - { 32624, 0x000088E2 }, /* GL_STREAM_COPY */ - { 32639, 0x000088E2 }, /* GL_STREAM_COPY_ARB */ - { 32658, 0x000088E0 }, /* GL_STREAM_DRAW */ - { 32673, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */ - { 32692, 0x000088E1 }, /* GL_STREAM_READ */ - { 32707, 0x000088E1 }, /* GL_STREAM_READ_ARB */ - { 32726, 0x00000D50 }, /* GL_SUBPIXEL_BITS */ - { 32743, 0x000084E7 }, /* GL_SUBTRACT */ - { 32755, 0x000084E7 }, /* GL_SUBTRACT_ARB */ - { 32771, 0x00009113 }, /* GL_SYNC_CONDITION */ - { 32789, 0x00009116 }, /* GL_SYNC_FENCE */ - { 32803, 0x00009115 }, /* GL_SYNC_FLAGS */ - { 32817, 0x00000001 }, /* GL_SYNC_FLUSH_COMMANDS_BIT */ - { 32844, 0x00009117 }, /* GL_SYNC_GPU_COMMANDS_COMPLETE */ - { 32874, 0x00009114 }, /* GL_SYNC_STATUS */ - { 32889, 0x00002001 }, /* GL_T */ - { 32894, 0x00002A2A }, /* GL_T2F_C3F_V3F */ - { 32909, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */ - { 32928, 0x00002A29 }, /* GL_T2F_C4UB_V3F */ - { 32944, 0x00002A2B }, /* GL_T2F_N3F_V3F */ - { 32959, 0x00002A27 }, /* GL_T2F_V3F */ - { 32970, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */ - { 32989, 0x00002A28 }, /* GL_T4F_V4F */ - { 33000, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */ - { 33023, 0x00001702 }, /* GL_TEXTURE */ - { 33034, 0x000084C0 }, /* GL_TEXTURE0 */ - { 33046, 0x000084C0 }, /* GL_TEXTURE0_ARB */ - { 33062, 0x000084C1 }, /* GL_TEXTURE1 */ - { 33074, 0x000084CA }, /* GL_TEXTURE10 */ - { 33087, 0x000084CA }, /* GL_TEXTURE10_ARB */ - { 33104, 0x000084CB }, /* GL_TEXTURE11 */ - { 33117, 0x000084CB }, /* GL_TEXTURE11_ARB */ - { 33134, 0x000084CC }, /* GL_TEXTURE12 */ - { 33147, 0x000084CC }, /* GL_TEXTURE12_ARB */ - { 33164, 0x000084CD }, /* GL_TEXTURE13 */ - { 33177, 0x000084CD }, /* GL_TEXTURE13_ARB */ - { 33194, 0x000084CE }, /* GL_TEXTURE14 */ - { 33207, 0x000084CE }, /* GL_TEXTURE14_ARB */ - { 33224, 0x000084CF }, /* GL_TEXTURE15 */ - { 33237, 0x000084CF }, /* GL_TEXTURE15_ARB */ - { 33254, 0x000084D0 }, /* GL_TEXTURE16 */ - { 33267, 0x000084D0 }, /* GL_TEXTURE16_ARB */ - { 33284, 0x000084D1 }, /* GL_TEXTURE17 */ - { 33297, 0x000084D1 }, /* GL_TEXTURE17_ARB */ - { 33314, 0x000084D2 }, /* GL_TEXTURE18 */ - { 33327, 0x000084D2 }, /* GL_TEXTURE18_ARB */ - { 33344, 0x000084D3 }, /* GL_TEXTURE19 */ - { 33357, 0x000084D3 }, /* GL_TEXTURE19_ARB */ - { 33374, 0x000084C1 }, /* GL_TEXTURE1_ARB */ - { 33390, 0x000084C2 }, /* GL_TEXTURE2 */ - { 33402, 0x000084D4 }, /* GL_TEXTURE20 */ - { 33415, 0x000084D4 }, /* GL_TEXTURE20_ARB */ - { 33432, 0x000084D5 }, /* GL_TEXTURE21 */ - { 33445, 0x000084D5 }, /* GL_TEXTURE21_ARB */ - { 33462, 0x000084D6 }, /* GL_TEXTURE22 */ - { 33475, 0x000084D6 }, /* GL_TEXTURE22_ARB */ - { 33492, 0x000084D7 }, /* GL_TEXTURE23 */ - { 33505, 0x000084D7 }, /* GL_TEXTURE23_ARB */ - { 33522, 0x000084D8 }, /* GL_TEXTURE24 */ - { 33535, 0x000084D8 }, /* GL_TEXTURE24_ARB */ - { 33552, 0x000084D9 }, /* GL_TEXTURE25 */ - { 33565, 0x000084D9 }, /* GL_TEXTURE25_ARB */ - { 33582, 0x000084DA }, /* GL_TEXTURE26 */ - { 33595, 0x000084DA }, /* GL_TEXTURE26_ARB */ - { 33612, 0x000084DB }, /* GL_TEXTURE27 */ - { 33625, 0x000084DB }, /* GL_TEXTURE27_ARB */ - { 33642, 0x000084DC }, /* GL_TEXTURE28 */ - { 33655, 0x000084DC }, /* GL_TEXTURE28_ARB */ - { 33672, 0x000084DD }, /* GL_TEXTURE29 */ - { 33685, 0x000084DD }, /* GL_TEXTURE29_ARB */ - { 33702, 0x000084C2 }, /* GL_TEXTURE2_ARB */ - { 33718, 0x000084C3 }, /* GL_TEXTURE3 */ - { 33730, 0x000084DE }, /* GL_TEXTURE30 */ - { 33743, 0x000084DE }, /* GL_TEXTURE30_ARB */ - { 33760, 0x000084DF }, /* GL_TEXTURE31 */ - { 33773, 0x000084DF }, /* GL_TEXTURE31_ARB */ - { 33790, 0x000084C3 }, /* GL_TEXTURE3_ARB */ - { 33806, 0x000084C4 }, /* GL_TEXTURE4 */ - { 33818, 0x000084C4 }, /* GL_TEXTURE4_ARB */ - { 33834, 0x000084C5 }, /* GL_TEXTURE5 */ - { 33846, 0x000084C5 }, /* GL_TEXTURE5_ARB */ - { 33862, 0x000084C6 }, /* GL_TEXTURE6 */ - { 33874, 0x000084C6 }, /* GL_TEXTURE6_ARB */ - { 33890, 0x000084C7 }, /* GL_TEXTURE7 */ - { 33902, 0x000084C7 }, /* GL_TEXTURE7_ARB */ - { 33918, 0x000084C8 }, /* GL_TEXTURE8 */ - { 33930, 0x000084C8 }, /* GL_TEXTURE8_ARB */ - { 33946, 0x000084C9 }, /* GL_TEXTURE9 */ - { 33958, 0x000084C9 }, /* GL_TEXTURE9_ARB */ - { 33974, 0x00000DE0 }, /* GL_TEXTURE_1D */ - { 33988, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY_EXT */ - { 34012, 0x00000DE1 }, /* GL_TEXTURE_2D */ - { 34026, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY_EXT */ - { 34050, 0x0000806F }, /* GL_TEXTURE_3D */ - { 34064, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */ - { 34086, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */ - { 34112, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */ - { 34134, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */ - { 34156, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ - { 34188, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */ - { 34210, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ - { 34242, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */ - { 34264, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */ - { 34292, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */ - { 34324, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ - { 34357, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */ - { 34389, 0x00040000 }, /* GL_TEXTURE_BIT */ - { 34404, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */ - { 34425, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */ - { 34450, 0x00001005 }, /* GL_TEXTURE_BORDER */ - { 34468, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */ - { 34492, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ - { 34523, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ - { 34553, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ - { 34583, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ - { 34618, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ - { 34649, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - { 34687, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */ - { 34714, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ - { 34746, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - { 34780, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */ - { 34804, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */ - { 34832, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */ - { 34856, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */ - { 34884, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ - { 34917, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */ - { 34941, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */ - { 34963, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */ - { 34985, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */ - { 35011, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */ - { 35045, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ - { 35078, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */ - { 35115, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */ - { 35143, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */ - { 35175, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */ - { 35198, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ - { 35236, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */ - { 35278, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */ - { 35309, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */ - { 35337, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ - { 35367, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */ - { 35395, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */ - { 35415, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */ - { 35439, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ - { 35470, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */ - { 35505, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ - { 35536, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */ - { 35571, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ - { 35602, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */ - { 35637, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ - { 35668, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */ - { 35703, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ - { 35734, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */ - { 35769, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ - { 35800, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */ - { 35835, 0x000088F4 }, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */ - { 35864, 0x00008071 }, /* GL_TEXTURE_DEPTH */ - { 35881, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */ - { 35903, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */ - { 35929, 0x00002300 }, /* GL_TEXTURE_ENV */ - { 35944, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */ - { 35965, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */ - { 35985, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */ - { 36011, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */ - { 36031, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */ - { 36048, 0x00000C62 }, /* GL_TEXTURE_GEN_R */ - { 36065, 0x00000C60 }, /* GL_TEXTURE_GEN_S */ - { 36082, 0x00000C61 }, /* GL_TEXTURE_GEN_T */ - { 36099, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */ - { 36124, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */ - { 36146, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */ - { 36172, 0x00001001 }, /* GL_TEXTURE_HEIGHT */ - { 36190, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */ - { 36216, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */ - { 36242, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */ - { 36272, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */ - { 36299, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */ - { 36324, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */ - { 36344, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */ - { 36368, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ - { 36395, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ - { 36422, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ - { 36449, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */ - { 36475, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */ - { 36505, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */ - { 36527, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */ - { 36545, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ - { 36575, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ - { 36603, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ - { 36631, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ - { 36659, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */ - { 36680, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */ - { 36699, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */ - { 36721, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */ - { 36740, 0x00008066 }, /* GL_TEXTURE_PRIORITY */ - { 36760, 0x000085B7 }, /* GL_TEXTURE_RANGE_LENGTH_APPLE */ - { 36790, 0x000085B8 }, /* GL_TEXTURE_RANGE_POINTER_APPLE */ - { 36821, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */ - { 36846, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */ - { 36870, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */ - { 36890, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */ - { 36914, 0x00008067 }, /* GL_TEXTURE_RESIDENT */ - { 36934, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */ - { 36957, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE */ - { 36981, 0x000085BC }, /* GL_TEXTURE_STORAGE_HINT_APPLE */ - { 37011, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */ - { 37036, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ - { 37070, 0x00001000 }, /* GL_TEXTURE_WIDTH */ - { 37087, 0x00008072 }, /* GL_TEXTURE_WRAP_R */ - { 37105, 0x00002802 }, /* GL_TEXTURE_WRAP_S */ - { 37123, 0x00002803 }, /* GL_TEXTURE_WRAP_T */ - { 37141, 0x0000911B }, /* GL_TIMEOUT_EXPIRED */ - { 37160, 0xFFFFFFFFFFFFFFFF }, /* GL_TIMEOUT_IGNORED */ - { 37179, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */ - { 37199, 0x00008648 }, /* GL_TRACK_MATRIX_NV */ - { 37218, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */ - { 37247, 0x00001000 }, /* GL_TRANSFORM_BIT */ - { 37264, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */ - { 37290, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */ - { 37320, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ - { 37352, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ - { 37382, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */ - { 37416, 0x0000862C }, /* GL_TRANSPOSE_NV */ - { 37432, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */ - { 37463, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */ - { 37498, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */ - { 37526, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */ - { 37558, 0x00000004 }, /* GL_TRIANGLES */ - { 37571, 0x00000006 }, /* GL_TRIANGLE_FAN */ - { 37587, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */ - { 37608, 0x00000005 }, /* GL_TRIANGLE_STRIP */ - { 37626, 0x00000001 }, /* GL_TRUE */ - { 37634, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */ - { 37654, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */ - { 37677, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */ - { 37697, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */ - { 37718, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */ - { 37740, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */ - { 37762, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */ - { 37782, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */ - { 37803, 0x00009118 }, /* GL_UNSIGNALED */ - { 37817, 0x00001401 }, /* GL_UNSIGNED_BYTE */ - { 37834, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */ - { 37861, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */ - { 37884, 0x00001405 }, /* GL_UNSIGNED_INT */ - { 37900, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */ - { 37927, 0x000084FA }, /* GL_UNSIGNED_INT_24_8 */ - { 37948, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */ - { 37972, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */ - { 38003, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */ - { 38027, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */ - { 38055, 0x00008C17 }, /* GL_UNSIGNED_NORMALIZED */ - { 38078, 0x00001403 }, /* GL_UNSIGNED_SHORT */ - { 38096, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ - { 38126, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */ - { 38152, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ - { 38182, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */ - { 38208, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */ - { 38232, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */ - { 38260, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */ - { 38288, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */ - { 38315, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ - { 38347, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */ - { 38378, 0x00008CA2 }, /* GL_UPPER_LEFT */ - { 38392, 0x00002A20 }, /* GL_V2F */ - { 38399, 0x00002A21 }, /* GL_V3F */ - { 38406, 0x00008B83 }, /* GL_VALIDATE_STATUS */ - { 38425, 0x00001F00 }, /* GL_VENDOR */ - { 38435, 0x00001F02 }, /* GL_VERSION */ - { 38446, 0x00008074 }, /* GL_VERTEX_ARRAY */ - { 38462, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING */ - { 38486, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */ - { 38516, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ - { 38547, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */ - { 38582, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */ - { 38606, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */ - { 38627, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */ - { 38650, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */ - { 38671, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ - { 38698, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ - { 38726, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ - { 38754, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ - { 38782, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ - { 38810, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ - { 38838, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ - { 38866, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ - { 38893, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ - { 38920, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ - { 38947, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ - { 38974, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ - { 39001, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ - { 39028, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ - { 39055, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ - { 39082, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ - { 39109, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ - { 39147, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */ - { 39189, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ - { 39220, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ - { 39255, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ - { 39289, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ - { 39327, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ - { 39358, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ - { 39393, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ - { 39421, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ - { 39453, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ - { 39483, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ - { 39517, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ - { 39545, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ - { 39577, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */ - { 39597, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */ - { 39619, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */ - { 39648, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */ - { 39669, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */ - { 39698, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ - { 39731, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */ - { 39763, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */ - { 39790, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ - { 39821, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */ - { 39851, 0x00008B31 }, /* GL_VERTEX_SHADER */ - { 39868, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */ - { 39889, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */ - { 39916, 0x00000BA2 }, /* GL_VIEWPORT */ - { 39928, 0x00000800 }, /* GL_VIEWPORT_BIT */ - { 39944, 0x0000911D }, /* GL_WAIT_FAILED */ - { 39959, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */ - { 39979, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ - { 40010, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */ - { 40045, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */ - { 40073, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */ - { 40098, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ - { 40125, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */ - { 40150, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */ - { 40174, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */ - { 40193, 0x000088B9 }, /* GL_WRITE_ONLY */ - { 40207, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */ - { 40225, 0x00001506 }, /* GL_XOR */ - { 40232, 0x000085B9 }, /* GL_YCBCR_422_APPLE */ - { 40251, 0x00008757 }, /* GL_YCBCR_MESA */ - { 40265, 0x00000000 }, /* GL_ZERO */ - { 40273, 0x00000D16 }, /* GL_ZOOM_X */ - { 40283, 0x00000D17 }, /* GL_ZOOM_Y */ + { 9726, 0x00008E4D }, /* GL_FIRST_VERTEX_CONVENTION */ + { 9753, 0x00008E4D }, /* GL_FIRST_VERTEX_CONVENTION_EXT */ + { 9784, 0x00001D00 }, /* GL_FLAT */ + { 9792, 0x00001406 }, /* GL_FLOAT */ + { 9801, 0x00008B5A }, /* GL_FLOAT_MAT2 */ + { 9815, 0x00008B5A }, /* GL_FLOAT_MAT2_ARB */ + { 9833, 0x00008B65 }, /* GL_FLOAT_MAT2x3 */ + { 9849, 0x00008B66 }, /* GL_FLOAT_MAT2x4 */ + { 9865, 0x00008B5B }, /* GL_FLOAT_MAT3 */ + { 9879, 0x00008B5B }, /* GL_FLOAT_MAT3_ARB */ + { 9897, 0x00008B67 }, /* GL_FLOAT_MAT3x2 */ + { 9913, 0x00008B68 }, /* GL_FLOAT_MAT3x4 */ + { 9929, 0x00008B5C }, /* GL_FLOAT_MAT4 */ + { 9943, 0x00008B5C }, /* GL_FLOAT_MAT4_ARB */ + { 9961, 0x00008B69 }, /* GL_FLOAT_MAT4x2 */ + { 9977, 0x00008B6A }, /* GL_FLOAT_MAT4x3 */ + { 9993, 0x00008B50 }, /* GL_FLOAT_VEC2 */ + { 10007, 0x00008B50 }, /* GL_FLOAT_VEC2_ARB */ + { 10025, 0x00008B51 }, /* GL_FLOAT_VEC3 */ + { 10039, 0x00008B51 }, /* GL_FLOAT_VEC3_ARB */ + { 10057, 0x00008B52 }, /* GL_FLOAT_VEC4 */ + { 10071, 0x00008B52 }, /* GL_FLOAT_VEC4_ARB */ + { 10089, 0x00000B60 }, /* GL_FOG */ + { 10096, 0x00000080 }, /* GL_FOG_BIT */ + { 10107, 0x00000B66 }, /* GL_FOG_COLOR */ + { 10120, 0x00008451 }, /* GL_FOG_COORD */ + { 10133, 0x00008451 }, /* GL_FOG_COORDINATE */ + { 10151, 0x00008457 }, /* GL_FOG_COORDINATE_ARRAY */ + { 10175, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ + { 10214, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB */ + { 10257, 0x00008456 }, /* GL_FOG_COORDINATE_ARRAY_POINTER */ + { 10289, 0x00008455 }, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ + { 10320, 0x00008454 }, /* GL_FOG_COORDINATE_ARRAY_TYPE */ + { 10349, 0x00008450 }, /* GL_FOG_COORDINATE_SOURCE */ + { 10374, 0x00008457 }, /* GL_FOG_COORD_ARRAY */ + { 10393, 0x0000889D }, /* GL_FOG_COORD_ARRAY_BUFFER_BINDING */ + { 10427, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */ + { 10454, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */ + { 10480, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */ + { 10504, 0x00008450 }, /* GL_FOG_COORD_SRC */ + { 10521, 0x00000B62 }, /* GL_FOG_DENSITY */ + { 10536, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */ + { 10560, 0x00000B64 }, /* GL_FOG_END */ + { 10571, 0x00000C54 }, /* GL_FOG_HINT */ + { 10583, 0x00000B61 }, /* GL_FOG_INDEX */ + { 10596, 0x00000B65 }, /* GL_FOG_MODE */ + { 10608, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */ + { 10627, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */ + { 10652, 0x00000B63 }, /* GL_FOG_START */ + { 10665, 0x00008452 }, /* GL_FRAGMENT_DEPTH */ + { 10683, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */ + { 10707, 0x00008B30 }, /* GL_FRAGMENT_SHADER */ + { 10726, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */ + { 10749, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ + { 10784, 0x00008D40 }, /* GL_FRAMEBUFFER */ + { 10799, 0x00008215 }, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ + { 10836, 0x00008214 }, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ + { 10872, 0x00008210 }, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ + { 10913, 0x00008211 }, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ + { 10954, 0x00008216 }, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ + { 10991, 0x00008213 }, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ + { 11028, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ + { 11066, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */ + { 11108, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ + { 11146, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */ + { 11188, 0x00008212 }, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ + { 11223, 0x00008217 }, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ + { 11262, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */ + { 11311, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ + { 11359, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */ + { 11411, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ + { 11451, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ + { 11495, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ + { 11535, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */ + { 11579, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */ + { 11606, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE */ + { 11630, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */ + { 11658, 0x00008218 }, /* GL_FRAMEBUFFER_DEFAULT */ + { 11681, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */ + { 11700, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ + { 11737, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */ + { 11778, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ + { 11819, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ + { 11861, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ + { 11912, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ + { 11950, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ + { 11995, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */ + { 12044, 0x00008D56 }, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ + { 12082, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ + { 12124, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ + { 12156, 0x00008219 }, /* GL_FRAMEBUFFER_UNDEFINED */ + { 12181, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED */ + { 12208, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */ + { 12239, 0x00000404 }, /* GL_FRONT */ + { 12248, 0x00000408 }, /* GL_FRONT_AND_BACK */ + { 12266, 0x00000B46 }, /* GL_FRONT_FACE */ + { 12280, 0x00000400 }, /* GL_FRONT_LEFT */ + { 12294, 0x00000401 }, /* GL_FRONT_RIGHT */ + { 12309, 0x00008006 }, /* GL_FUNC_ADD */ + { 12321, 0x00008006 }, /* GL_FUNC_ADD_EXT */ + { 12337, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */ + { 12362, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */ + { 12391, 0x0000800A }, /* GL_FUNC_SUBTRACT */ + { 12408, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */ + { 12429, 0x00008191 }, /* GL_GENERATE_MIPMAP */ + { 12448, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */ + { 12472, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */ + { 12501, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */ + { 12525, 0x00000206 }, /* GL_GEQUAL */ + { 12535, 0x00000204 }, /* GL_GREATER */ + { 12546, 0x00001904 }, /* GL_GREEN */ + { 12555, 0x00000D19 }, /* GL_GREEN_BIAS */ + { 12569, 0x00000D53 }, /* GL_GREEN_BITS */ + { 12583, 0x00000D18 }, /* GL_GREEN_SCALE */ + { 12598, 0x00008000 }, /* GL_HINT_BIT */ + { 12610, 0x00008024 }, /* GL_HISTOGRAM */ + { 12623, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */ + { 12647, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */ + { 12675, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */ + { 12698, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */ + { 12725, 0x00008024 }, /* GL_HISTOGRAM_EXT */ + { 12742, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */ + { 12762, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */ + { 12786, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */ + { 12810, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */ + { 12838, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */ + { 12866, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */ + { 12898, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */ + { 12920, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */ + { 12946, 0x0000802D }, /* GL_HISTOGRAM_SINK */ + { 12964, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */ + { 12986, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */ + { 13005, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */ + { 13028, 0x0000862A }, /* GL_IDENTITY_NV */ + { 13043, 0x00008150 }, /* GL_IGNORE_BORDER_HP */ + { 13063, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ + { 13103, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ + { 13141, 0x00001E02 }, /* GL_INCR */ + { 13149, 0x00008507 }, /* GL_INCR_WRAP */ + { 13162, 0x00008507 }, /* GL_INCR_WRAP_EXT */ + { 13179, 0x00008222 }, /* GL_INDEX */ + { 13188, 0x00008077 }, /* GL_INDEX_ARRAY */ + { 13203, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */ + { 13233, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */ + { 13267, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */ + { 13290, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */ + { 13312, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */ + { 13332, 0x00000D51 }, /* GL_INDEX_BITS */ + { 13346, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */ + { 13367, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */ + { 13385, 0x00000C30 }, /* GL_INDEX_MODE */ + { 13399, 0x00000D13 }, /* GL_INDEX_OFFSET */ + { 13415, 0x00000D12 }, /* GL_INDEX_SHIFT */ + { 13430, 0x00000C21 }, /* GL_INDEX_WRITEMASK */ + { 13449, 0x00008B84 }, /* GL_INFO_LOG_LENGTH */ + { 13468, 0x00001404 }, /* GL_INT */ + { 13475, 0x00008049 }, /* GL_INTENSITY */ + { 13488, 0x0000804C }, /* GL_INTENSITY12 */ + { 13503, 0x0000804C }, /* GL_INTENSITY12_EXT */ + { 13522, 0x0000804D }, /* GL_INTENSITY16 */ + { 13537, 0x0000804D }, /* GL_INTENSITY16_EXT */ + { 13556, 0x0000804A }, /* GL_INTENSITY4 */ + { 13570, 0x0000804A }, /* GL_INTENSITY4_EXT */ + { 13588, 0x0000804B }, /* GL_INTENSITY8 */ + { 13602, 0x0000804B }, /* GL_INTENSITY8_EXT */ + { 13620, 0x00008049 }, /* GL_INTENSITY_EXT */ + { 13637, 0x00008575 }, /* GL_INTERPOLATE */ + { 13652, 0x00008575 }, /* GL_INTERPOLATE_ARB */ + { 13671, 0x00008575 }, /* GL_INTERPOLATE_EXT */ + { 13690, 0x00008B53 }, /* GL_INT_VEC2 */ + { 13702, 0x00008B53 }, /* GL_INT_VEC2_ARB */ + { 13718, 0x00008B54 }, /* GL_INT_VEC3 */ + { 13730, 0x00008B54 }, /* GL_INT_VEC3_ARB */ + { 13746, 0x00008B55 }, /* GL_INT_VEC4 */ + { 13758, 0x00008B55 }, /* GL_INT_VEC4_ARB */ + { 13774, 0x00000500 }, /* GL_INVALID_ENUM */ + { 13790, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION */ + { 13823, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ + { 13860, 0x00000502 }, /* GL_INVALID_OPERATION */ + { 13881, 0x00000501 }, /* GL_INVALID_VALUE */ + { 13898, 0x0000862B }, /* GL_INVERSE_NV */ + { 13912, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */ + { 13936, 0x0000150A }, /* GL_INVERT */ + { 13946, 0x00001E00 }, /* GL_KEEP */ + { 13954, 0x00008E4E }, /* GL_LAST_VERTEX_CONVENTION */ + { 13980, 0x00008E4E }, /* GL_LAST_VERTEX_CONVENTION_EXT */ + { 14010, 0x00000406 }, /* GL_LEFT */ + { 14018, 0x00000203 }, /* GL_LEQUAL */ + { 14028, 0x00000201 }, /* GL_LESS */ + { 14036, 0x00004000 }, /* GL_LIGHT0 */ + { 14046, 0x00004001 }, /* GL_LIGHT1 */ + { 14056, 0x00004002 }, /* GL_LIGHT2 */ + { 14066, 0x00004003 }, /* GL_LIGHT3 */ + { 14076, 0x00004004 }, /* GL_LIGHT4 */ + { 14086, 0x00004005 }, /* GL_LIGHT5 */ + { 14096, 0x00004006 }, /* GL_LIGHT6 */ + { 14106, 0x00004007 }, /* GL_LIGHT7 */ + { 14116, 0x00000B50 }, /* GL_LIGHTING */ + { 14128, 0x00000040 }, /* GL_LIGHTING_BIT */ + { 14144, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */ + { 14167, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */ + { 14196, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */ + { 14229, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ + { 14257, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */ + { 14281, 0x00001B01 }, /* GL_LINE */ + { 14289, 0x00002601 }, /* GL_LINEAR */ + { 14299, 0x00001208 }, /* GL_LINEAR_ATTENUATION */ + { 14321, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ + { 14351, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ + { 14382, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */ + { 14406, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */ + { 14431, 0x00000001 }, /* GL_LINES */ + { 14440, 0x00000004 }, /* GL_LINE_BIT */ + { 14452, 0x00000002 }, /* GL_LINE_LOOP */ + { 14465, 0x00000707 }, /* GL_LINE_RESET_TOKEN */ + { 14485, 0x00000B20 }, /* GL_LINE_SMOOTH */ + { 14500, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */ + { 14520, 0x00000B24 }, /* GL_LINE_STIPPLE */ + { 14536, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */ + { 14560, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */ + { 14583, 0x00000003 }, /* GL_LINE_STRIP */ + { 14597, 0x00000702 }, /* GL_LINE_TOKEN */ + { 14611, 0x00000B21 }, /* GL_LINE_WIDTH */ + { 14625, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */ + { 14651, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */ + { 14671, 0x00008B82 }, /* GL_LINK_STATUS */ + { 14686, 0x00000B32 }, /* GL_LIST_BASE */ + { 14699, 0x00020000 }, /* GL_LIST_BIT */ + { 14711, 0x00000B33 }, /* GL_LIST_INDEX */ + { 14725, 0x00000B30 }, /* GL_LIST_MODE */ + { 14738, 0x00000101 }, /* GL_LOAD */ + { 14746, 0x00000BF1 }, /* GL_LOGIC_OP */ + { 14758, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */ + { 14775, 0x00008CA1 }, /* GL_LOWER_LEFT */ + { 14789, 0x00001909 }, /* GL_LUMINANCE */ + { 14802, 0x00008041 }, /* GL_LUMINANCE12 */ + { 14817, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */ + { 14840, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */ + { 14867, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */ + { 14889, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */ + { 14915, 0x00008041 }, /* GL_LUMINANCE12_EXT */ + { 14934, 0x00008042 }, /* GL_LUMINANCE16 */ + { 14949, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */ + { 14972, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */ + { 14999, 0x00008042 }, /* GL_LUMINANCE16_EXT */ + { 15018, 0x0000803F }, /* GL_LUMINANCE4 */ + { 15032, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */ + { 15053, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */ + { 15078, 0x0000803F }, /* GL_LUMINANCE4_EXT */ + { 15096, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */ + { 15117, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */ + { 15142, 0x00008040 }, /* GL_LUMINANCE8 */ + { 15156, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */ + { 15177, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */ + { 15202, 0x00008040 }, /* GL_LUMINANCE8_EXT */ + { 15220, 0x0000190A }, /* GL_LUMINANCE_ALPHA */ + { 15239, 0x00000D90 }, /* GL_MAP1_COLOR_4 */ + { 15255, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */ + { 15275, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */ + { 15297, 0x00000D91 }, /* GL_MAP1_INDEX */ + { 15311, 0x00000D92 }, /* GL_MAP1_NORMAL */ + { 15326, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */ + { 15350, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */ + { 15374, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */ + { 15398, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */ + { 15422, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */ + { 15439, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */ + { 15456, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ + { 15484, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ + { 15513, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ + { 15542, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ + { 15571, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ + { 15600, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ + { 15629, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ + { 15658, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ + { 15686, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ + { 15714, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ + { 15742, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ + { 15770, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ + { 15798, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ + { 15826, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ + { 15854, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ + { 15882, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ + { 15910, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */ + { 15926, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */ + { 15946, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */ + { 15968, 0x00000DB1 }, /* GL_MAP2_INDEX */ + { 15982, 0x00000DB2 }, /* GL_MAP2_NORMAL */ + { 15997, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */ + { 16021, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */ + { 16045, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */ + { 16069, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */ + { 16093, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */ + { 16110, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */ + { 16127, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ + { 16155, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ + { 16184, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ + { 16213, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ + { 16242, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ + { 16271, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ + { 16300, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ + { 16329, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ + { 16357, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ + { 16385, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ + { 16413, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ + { 16441, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ + { 16469, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ + { 16497, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */ + { 16525, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ + { 16553, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ + { 16581, 0x00000D10 }, /* GL_MAP_COLOR */ + { 16594, 0x00000010 }, /* GL_MAP_FLUSH_EXPLICIT_BIT */ + { 16620, 0x00000008 }, /* GL_MAP_INVALIDATE_BUFFER_BIT */ + { 16649, 0x00000004 }, /* GL_MAP_INVALIDATE_RANGE_BIT */ + { 16677, 0x00000001 }, /* GL_MAP_READ_BIT */ + { 16693, 0x00000D11 }, /* GL_MAP_STENCIL */ + { 16708, 0x00000020 }, /* GL_MAP_UNSYNCHRONIZED_BIT */ + { 16734, 0x00000002 }, /* GL_MAP_WRITE_BIT */ + { 16751, 0x000088C0 }, /* GL_MATRIX0_ARB */ + { 16766, 0x00008630 }, /* GL_MATRIX0_NV */ + { 16780, 0x000088CA }, /* GL_MATRIX10_ARB */ + { 16796, 0x000088CB }, /* GL_MATRIX11_ARB */ + { 16812, 0x000088CC }, /* GL_MATRIX12_ARB */ + { 16828, 0x000088CD }, /* GL_MATRIX13_ARB */ + { 16844, 0x000088CE }, /* GL_MATRIX14_ARB */ + { 16860, 0x000088CF }, /* GL_MATRIX15_ARB */ + { 16876, 0x000088D0 }, /* GL_MATRIX16_ARB */ + { 16892, 0x000088D1 }, /* GL_MATRIX17_ARB */ + { 16908, 0x000088D2 }, /* GL_MATRIX18_ARB */ + { 16924, 0x000088D3 }, /* GL_MATRIX19_ARB */ + { 16940, 0x000088C1 }, /* GL_MATRIX1_ARB */ + { 16955, 0x00008631 }, /* GL_MATRIX1_NV */ + { 16969, 0x000088D4 }, /* GL_MATRIX20_ARB */ + { 16985, 0x000088D5 }, /* GL_MATRIX21_ARB */ + { 17001, 0x000088D6 }, /* GL_MATRIX22_ARB */ + { 17017, 0x000088D7 }, /* GL_MATRIX23_ARB */ + { 17033, 0x000088D8 }, /* GL_MATRIX24_ARB */ + { 17049, 0x000088D9 }, /* GL_MATRIX25_ARB */ + { 17065, 0x000088DA }, /* GL_MATRIX26_ARB */ + { 17081, 0x000088DB }, /* GL_MATRIX27_ARB */ + { 17097, 0x000088DC }, /* GL_MATRIX28_ARB */ + { 17113, 0x000088DD }, /* GL_MATRIX29_ARB */ + { 17129, 0x000088C2 }, /* GL_MATRIX2_ARB */ + { 17144, 0x00008632 }, /* GL_MATRIX2_NV */ + { 17158, 0x000088DE }, /* GL_MATRIX30_ARB */ + { 17174, 0x000088DF }, /* GL_MATRIX31_ARB */ + { 17190, 0x000088C3 }, /* GL_MATRIX3_ARB */ + { 17205, 0x00008633 }, /* GL_MATRIX3_NV */ + { 17219, 0x000088C4 }, /* GL_MATRIX4_ARB */ + { 17234, 0x00008634 }, /* GL_MATRIX4_NV */ + { 17248, 0x000088C5 }, /* GL_MATRIX5_ARB */ + { 17263, 0x00008635 }, /* GL_MATRIX5_NV */ + { 17277, 0x000088C6 }, /* GL_MATRIX6_ARB */ + { 17292, 0x00008636 }, /* GL_MATRIX6_NV */ + { 17306, 0x000088C7 }, /* GL_MATRIX7_ARB */ + { 17321, 0x00008637 }, /* GL_MATRIX7_NV */ + { 17335, 0x000088C8 }, /* GL_MATRIX8_ARB */ + { 17350, 0x000088C9 }, /* GL_MATRIX9_ARB */ + { 17365, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */ + { 17391, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ + { 17425, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ + { 17456, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ + { 17489, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ + { 17520, 0x00000BA0 }, /* GL_MATRIX_MODE */ + { 17535, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */ + { 17557, 0x00008008 }, /* GL_MAX */ + { 17564, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */ + { 17587, 0x000088FF }, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ + { 17619, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */ + { 17645, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ + { 17678, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ + { 17704, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + { 17738, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */ + { 17757, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ + { 17786, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ + { 17818, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */ + { 17854, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ + { 17890, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */ + { 17930, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */ + { 17956, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */ + { 17986, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */ + { 18011, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */ + { 18040, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ + { 18069, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */ + { 18102, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS */ + { 18122, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */ + { 18146, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */ + { 18170, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */ + { 18194, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */ + { 18219, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */ + { 18237, 0x00008008 }, /* GL_MAX_EXT */ + { 18248, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ + { 18283, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */ + { 18322, 0x00000D31 }, /* GL_MAX_LIGHTS */ + { 18336, 0x00000B31 }, /* GL_MAX_LIST_NESTING */ + { 18356, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ + { 18394, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */ + { 18423, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */ + { 18447, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */ + { 18475, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */ + { 18498, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ + { 18535, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ + { 18571, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ + { 18598, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ + { 18627, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ + { 18661, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ + { 18697, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ + { 18724, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ + { 18756, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ + { 18792, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ + { 18821, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ + { 18850, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */ + { 18878, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ + { 18916, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + { 18960, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + { 19003, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ + { 19037, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + { 19076, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ + { 19113, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ + { 19151, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + { 19194, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + { 19237, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ + { 19267, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ + { 19298, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ + { 19334, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ + { 19370, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */ + { 19400, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ + { 19434, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */ + { 19467, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ + { 19496, 0x00008D57 }, /* GL_MAX_SAMPLES */ + { 19511, 0x00009111 }, /* GL_MAX_SERVER_WAIT_TIMEOUT */ + { 19538, 0x00008504 }, /* GL_MAX_SHININESS_NV */ + { 19558, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */ + { 19582, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS */ + { 19604, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */ + { 19630, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS */ + { 19657, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */ + { 19688, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */ + { 19712, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ + { 19746, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */ + { 19766, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */ + { 19793, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */ + { 19814, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */ + { 19839, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */ + { 19864, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */ + { 19899, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */ + { 19921, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */ + { 19947, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */ + { 19969, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */ + { 19995, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ + { 20029, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ + { 20067, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ + { 20100, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */ + { 20137, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */ + { 20161, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */ + { 20182, 0x00008007 }, /* GL_MIN */ + { 20189, 0x0000802E }, /* GL_MINMAX */ + { 20199, 0x0000802E }, /* GL_MINMAX_EXT */ + { 20213, 0x0000802F }, /* GL_MINMAX_FORMAT */ + { 20230, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */ + { 20251, 0x00008030 }, /* GL_MINMAX_SINK */ + { 20266, 0x00008030 }, /* GL_MINMAX_SINK_EXT */ + { 20285, 0x00008007 }, /* GL_MIN_EXT */ + { 20296, 0x00008370 }, /* GL_MIRRORED_REPEAT */ + { 20315, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */ + { 20338, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */ + { 20361, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */ + { 20381, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */ + { 20401, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ + { 20431, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */ + { 20459, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ + { 20487, 0x00001700 }, /* GL_MODELVIEW */ + { 20500, 0x00001700 }, /* GL_MODELVIEW0_ARB */ + { 20518, 0x0000872A }, /* GL_MODELVIEW10_ARB */ + { 20537, 0x0000872B }, /* GL_MODELVIEW11_ARB */ + { 20556, 0x0000872C }, /* GL_MODELVIEW12_ARB */ + { 20575, 0x0000872D }, /* GL_MODELVIEW13_ARB */ + { 20594, 0x0000872E }, /* GL_MODELVIEW14_ARB */ + { 20613, 0x0000872F }, /* GL_MODELVIEW15_ARB */ + { 20632, 0x00008730 }, /* GL_MODELVIEW16_ARB */ + { 20651, 0x00008731 }, /* GL_MODELVIEW17_ARB */ + { 20670, 0x00008732 }, /* GL_MODELVIEW18_ARB */ + { 20689, 0x00008733 }, /* GL_MODELVIEW19_ARB */ + { 20708, 0x0000850A }, /* GL_MODELVIEW1_ARB */ + { 20726, 0x00008734 }, /* GL_MODELVIEW20_ARB */ + { 20745, 0x00008735 }, /* GL_MODELVIEW21_ARB */ + { 20764, 0x00008736 }, /* GL_MODELVIEW22_ARB */ + { 20783, 0x00008737 }, /* GL_MODELVIEW23_ARB */ + { 20802, 0x00008738 }, /* GL_MODELVIEW24_ARB */ + { 20821, 0x00008739 }, /* GL_MODELVIEW25_ARB */ + { 20840, 0x0000873A }, /* GL_MODELVIEW26_ARB */ + { 20859, 0x0000873B }, /* GL_MODELVIEW27_ARB */ + { 20878, 0x0000873C }, /* GL_MODELVIEW28_ARB */ + { 20897, 0x0000873D }, /* GL_MODELVIEW29_ARB */ + { 20916, 0x00008722 }, /* GL_MODELVIEW2_ARB */ + { 20934, 0x0000873E }, /* GL_MODELVIEW30_ARB */ + { 20953, 0x0000873F }, /* GL_MODELVIEW31_ARB */ + { 20972, 0x00008723 }, /* GL_MODELVIEW3_ARB */ + { 20990, 0x00008724 }, /* GL_MODELVIEW4_ARB */ + { 21008, 0x00008725 }, /* GL_MODELVIEW5_ARB */ + { 21026, 0x00008726 }, /* GL_MODELVIEW6_ARB */ + { 21044, 0x00008727 }, /* GL_MODELVIEW7_ARB */ + { 21062, 0x00008728 }, /* GL_MODELVIEW8_ARB */ + { 21080, 0x00008729 }, /* GL_MODELVIEW9_ARB */ + { 21098, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */ + { 21118, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */ + { 21145, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */ + { 21170, 0x00002100 }, /* GL_MODULATE */ + { 21182, 0x00008744 }, /* GL_MODULATE_ADD_ATI */ + { 21202, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */ + { 21229, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */ + { 21254, 0x00000103 }, /* GL_MULT */ + { 21262, 0x0000809D }, /* GL_MULTISAMPLE */ + { 21277, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */ + { 21297, 0x0000809D }, /* GL_MULTISAMPLE_ARB */ + { 21316, 0x20000000 }, /* GL_MULTISAMPLE_BIT */ + { 21335, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */ + { 21359, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */ + { 21382, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */ + { 21412, 0x00002A25 }, /* GL_N3F_V3F */ + { 21423, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */ + { 21443, 0x0000150E }, /* GL_NAND */ + { 21451, 0x00002600 }, /* GL_NEAREST */ + { 21462, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ + { 21493, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ + { 21525, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */ + { 21550, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */ + { 21576, 0x00000200 }, /* GL_NEVER */ + { 21585, 0x00001102 }, /* GL_NICEST */ + { 21595, 0x00000000 }, /* GL_NONE */ + { 21603, 0x00001505 }, /* GL_NOOP */ + { 21611, 0x00001508 }, /* GL_NOR */ + { 21618, 0x00000BA1 }, /* GL_NORMALIZE */ + { 21631, 0x00008075 }, /* GL_NORMAL_ARRAY */ + { 21647, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ + { 21678, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */ + { 21713, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */ + { 21737, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */ + { 21760, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */ + { 21781, 0x00008511 }, /* GL_NORMAL_MAP */ + { 21795, 0x00008511 }, /* GL_NORMAL_MAP_ARB */ + { 21813, 0x00008511 }, /* GL_NORMAL_MAP_NV */ + { 21830, 0x00000205 }, /* GL_NOTEQUAL */ + { 21842, 0x00000000 }, /* GL_NO_ERROR */ + { 21854, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ + { 21888, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB */ + { 21926, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */ + { 21958, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */ + { 22000, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */ + { 22030, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */ + { 22070, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */ + { 22101, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */ + { 22130, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */ + { 22158, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */ + { 22188, 0x00002401 }, /* GL_OBJECT_LINEAR */ + { 22205, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */ + { 22231, 0x00002501 }, /* GL_OBJECT_PLANE */ + { 22247, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */ + { 22282, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */ + { 22304, 0x00009112 }, /* GL_OBJECT_TYPE */ + { 22319, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */ + { 22338, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */ + { 22368, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */ + { 22389, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */ + { 22417, 0x00000001 }, /* GL_ONE */ + { 22424, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */ + { 22452, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */ + { 22484, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */ + { 22512, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */ + { 22544, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */ + { 22567, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */ + { 22590, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */ + { 22613, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */ + { 22636, 0x00008598 }, /* GL_OPERAND0_ALPHA */ + { 22654, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */ + { 22676, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */ + { 22698, 0x00008590 }, /* GL_OPERAND0_RGB */ + { 22714, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */ + { 22734, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */ + { 22754, 0x00008599 }, /* GL_OPERAND1_ALPHA */ + { 22772, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */ + { 22794, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */ + { 22816, 0x00008591 }, /* GL_OPERAND1_RGB */ + { 22832, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */ + { 22852, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */ + { 22872, 0x0000859A }, /* GL_OPERAND2_ALPHA */ + { 22890, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */ + { 22912, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */ + { 22934, 0x00008592 }, /* GL_OPERAND2_RGB */ + { 22950, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */ + { 22970, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */ + { 22990, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */ + { 23011, 0x00008593 }, /* GL_OPERAND3_RGB_NV */ + { 23030, 0x00001507 }, /* GL_OR */ + { 23036, 0x00000A01 }, /* GL_ORDER */ + { 23045, 0x0000150D }, /* GL_OR_INVERTED */ + { 23060, 0x0000150B }, /* GL_OR_REVERSE */ + { 23074, 0x00000505 }, /* GL_OUT_OF_MEMORY */ + { 23091, 0x00000D05 }, /* GL_PACK_ALIGNMENT */ + { 23109, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */ + { 23130, 0x00008758 }, /* GL_PACK_INVERT_MESA */ + { 23150, 0x00000D01 }, /* GL_PACK_LSB_FIRST */ + { 23168, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */ + { 23187, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */ + { 23207, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */ + { 23227, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */ + { 23245, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */ + { 23264, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */ + { 23289, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */ + { 23313, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */ + { 23334, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */ + { 23356, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */ + { 23378, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */ + { 23403, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */ + { 23427, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */ + { 23448, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */ + { 23470, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */ + { 23492, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */ + { 23514, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */ + { 23545, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */ + { 23565, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */ + { 23590, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */ + { 23610, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */ + { 23635, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */ + { 23655, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */ + { 23680, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */ + { 23700, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */ + { 23725, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */ + { 23745, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */ + { 23770, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */ + { 23790, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */ + { 23815, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */ + { 23835, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */ + { 23860, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */ + { 23880, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */ + { 23905, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */ + { 23925, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */ + { 23950, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */ + { 23970, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */ + { 23995, 0x00000020 }, /* GL_PIXEL_MODE_BIT */ + { 24013, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER */ + { 24034, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING */ + { 24063, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */ + { 24096, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */ + { 24121, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER */ + { 24144, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING */ + { 24175, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */ + { 24210, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */ + { 24237, 0x00001B00 }, /* GL_POINT */ + { 24246, 0x00000000 }, /* GL_POINTS */ + { 24256, 0x00000002 }, /* GL_POINT_BIT */ + { 24269, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */ + { 24299, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */ + { 24333, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */ + { 24367, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */ + { 24402, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */ + { 24431, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */ + { 24464, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */ + { 24497, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */ + { 24531, 0x00000B11 }, /* GL_POINT_SIZE */ + { 24545, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */ + { 24571, 0x00008127 }, /* GL_POINT_SIZE_MAX */ + { 24589, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */ + { 24611, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */ + { 24633, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */ + { 24656, 0x00008126 }, /* GL_POINT_SIZE_MIN */ + { 24674, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */ + { 24696, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */ + { 24718, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */ + { 24741, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */ + { 24761, 0x00000B10 }, /* GL_POINT_SMOOTH */ + { 24777, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */ + { 24798, 0x00008861 }, /* GL_POINT_SPRITE */ + { 24814, 0x00008861 }, /* GL_POINT_SPRITE_ARB */ + { 24834, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */ + { 24863, 0x00008861 }, /* GL_POINT_SPRITE_NV */ + { 24882, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */ + { 24908, 0x00000701 }, /* GL_POINT_TOKEN */ + { 24923, 0x00000009 }, /* GL_POLYGON */ + { 24934, 0x00000008 }, /* GL_POLYGON_BIT */ + { 24949, 0x00000B40 }, /* GL_POLYGON_MODE */ + { 24965, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */ + { 24988, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */ + { 25013, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */ + { 25036, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */ + { 25059, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */ + { 25083, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */ + { 25107, 0x00000B41 }, /* GL_POLYGON_SMOOTH */ + { 25125, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */ + { 25148, 0x00000B42 }, /* GL_POLYGON_STIPPLE */ + { 25167, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */ + { 25190, 0x00000703 }, /* GL_POLYGON_TOKEN */ + { 25207, 0x00001203 }, /* GL_POSITION */ + { 25219, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ + { 25251, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */ + { 25287, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ + { 25320, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */ + { 25357, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ + { 25388, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */ + { 25423, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ + { 25455, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */ + { 25491, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ + { 25524, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ + { 25556, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */ + { 25592, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ + { 25625, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */ + { 25662, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */ + { 25692, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */ + { 25726, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */ + { 25757, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */ + { 25792, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ + { 25823, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */ + { 25858, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ + { 25890, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */ + { 25926, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */ + { 25956, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */ + { 25990, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */ + { 26021, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */ + { 26056, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */ + { 26088, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */ + { 26119, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */ + { 26154, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */ + { 26186, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */ + { 26222, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */ + { 26251, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */ + { 26284, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */ + { 26314, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */ + { 26348, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ + { 26387, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ + { 26420, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ + { 26460, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ + { 26494, 0x00008578 }, /* GL_PREVIOUS */ + { 26506, 0x00008578 }, /* GL_PREVIOUS_ARB */ + { 26522, 0x00008578 }, /* GL_PREVIOUS_EXT */ + { 26538, 0x00008577 }, /* GL_PRIMARY_COLOR */ + { 26555, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */ + { 26576, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */ + { 26597, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ + { 26630, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ + { 26662, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */ + { 26685, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */ + { 26708, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */ + { 26738, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */ + { 26767, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */ + { 26795, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */ + { 26817, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */ + { 26845, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */ + { 26873, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */ + { 26895, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */ + { 26916, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + { 26956, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + { 26995, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ + { 27025, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + { 27060, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ + { 27093, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ + { 27127, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + { 27166, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + { 27205, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */ + { 27227, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */ + { 27253, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */ + { 27277, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */ + { 27300, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */ + { 27322, 0x00008628 }, /* GL_PROGRAM_STRING_NV */ + { 27343, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */ + { 27364, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */ + { 27391, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ + { 27423, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ + { 27455, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ + { 27490, 0x00001701 }, /* GL_PROJECTION */ + { 27504, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */ + { 27525, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */ + { 27551, 0x00008E4F }, /* GL_PROVOKING_VERTEX */ + { 27571, 0x00008E4F }, /* GL_PROVOKING_VERTEX_EXT */ + { 27595, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */ + { 27616, 0x00008025 }, /* GL_PROXY_HISTOGRAM */ + { 27635, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */ + { 27658, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ + { 27697, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ + { 27735, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */ + { 27755, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ + { 27785, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */ + { 27809, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */ + { 27829, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ + { 27859, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */ + { 27883, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */ + { 27903, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ + { 27936, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */ + { 27962, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */ + { 27992, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ + { 28023, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */ + { 28053, 0x00002003 }, /* GL_Q */ + { 28058, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */ + { 28083, 0x00000007 }, /* GL_QUADS */ + { 28092, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */ + { 28136, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT */ + { 28184, 0x00008614 }, /* GL_QUAD_MESH_SUN */ + { 28201, 0x00000008 }, /* GL_QUAD_STRIP */ + { 28215, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */ + { 28237, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */ + { 28263, 0x00008866 }, /* GL_QUERY_RESULT */ + { 28279, 0x00008866 }, /* GL_QUERY_RESULT_ARB */ + { 28299, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */ + { 28325, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */ + { 28355, 0x00002002 }, /* GL_R */ + { 28360, 0x00002A10 }, /* GL_R3_G3_B2 */ + { 28372, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ + { 28405, 0x00000C02 }, /* GL_READ_BUFFER */ + { 28420, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER */ + { 28440, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ + { 28472, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */ + { 28496, 0x000088B8 }, /* GL_READ_ONLY */ + { 28509, 0x000088B8 }, /* GL_READ_ONLY_ARB */ + { 28526, 0x000088BA }, /* GL_READ_WRITE */ + { 28540, 0x000088BA }, /* GL_READ_WRITE_ARB */ + { 28558, 0x00001903 }, /* GL_RED */ + { 28565, 0x00008016 }, /* GL_REDUCE */ + { 28575, 0x00008016 }, /* GL_REDUCE_EXT */ + { 28589, 0x00000D15 }, /* GL_RED_BIAS */ + { 28601, 0x00000D52 }, /* GL_RED_BITS */ + { 28613, 0x00000D14 }, /* GL_RED_SCALE */ + { 28626, 0x00008512 }, /* GL_REFLECTION_MAP */ + { 28644, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */ + { 28666, 0x00008512 }, /* GL_REFLECTION_MAP_NV */ + { 28687, 0x00001C00 }, /* GL_RENDER */ + { 28697, 0x00008D41 }, /* GL_RENDERBUFFER */ + { 28713, 0x00008D53 }, /* GL_RENDERBUFFER_ALPHA_SIZE */ + { 28740, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */ + { 28768, 0x00008D52 }, /* GL_RENDERBUFFER_BLUE_SIZE */ + { 28794, 0x00008D54 }, /* GL_RENDERBUFFER_DEPTH_SIZE */ + { 28821, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */ + { 28841, 0x00008D51 }, /* GL_RENDERBUFFER_GREEN_SIZE */ + { 28868, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT */ + { 28891, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */ + { 28918, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ + { 28950, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ + { 28986, 0x00008D50 }, /* GL_RENDERBUFFER_RED_SIZE */ + { 29011, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES */ + { 29035, 0x00008D55 }, /* GL_RENDERBUFFER_STENCIL_SIZE */ + { 29064, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH */ + { 29086, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */ + { 29112, 0x00001F01 }, /* GL_RENDERER */ + { 29124, 0x00000C40 }, /* GL_RENDER_MODE */ + { 29139, 0x00002901 }, /* GL_REPEAT */ + { 29149, 0x00001E01 }, /* GL_REPLACE */ + { 29160, 0x00008062 }, /* GL_REPLACE_EXT */ + { 29175, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */ + { 29198, 0x0000803A }, /* GL_RESCALE_NORMAL */ + { 29216, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */ + { 29238, 0x00000102 }, /* GL_RETURN */ + { 29248, 0x00001907 }, /* GL_RGB */ + { 29255, 0x00008052 }, /* GL_RGB10 */ + { 29264, 0x00008059 }, /* GL_RGB10_A2 */ + { 29276, 0x00008059 }, /* GL_RGB10_A2_EXT */ + { 29292, 0x00008052 }, /* GL_RGB10_EXT */ + { 29305, 0x00008053 }, /* GL_RGB12 */ + { 29314, 0x00008053 }, /* GL_RGB12_EXT */ + { 29327, 0x00008054 }, /* GL_RGB16 */ + { 29336, 0x00008054 }, /* GL_RGB16_EXT */ + { 29349, 0x0000804E }, /* GL_RGB2_EXT */ + { 29361, 0x0000804F }, /* GL_RGB4 */ + { 29369, 0x0000804F }, /* GL_RGB4_EXT */ + { 29381, 0x000083A1 }, /* GL_RGB4_S3TC */ + { 29394, 0x00008050 }, /* GL_RGB5 */ + { 29402, 0x00008057 }, /* GL_RGB5_A1 */ + { 29413, 0x00008057 }, /* GL_RGB5_A1_EXT */ + { 29428, 0x00008050 }, /* GL_RGB5_EXT */ + { 29440, 0x00008051 }, /* GL_RGB8 */ + { 29448, 0x00008051 }, /* GL_RGB8_EXT */ + { 29460, 0x00001908 }, /* GL_RGBA */ + { 29468, 0x0000805A }, /* GL_RGBA12 */ + { 29478, 0x0000805A }, /* GL_RGBA12_EXT */ + { 29492, 0x0000805B }, /* GL_RGBA16 */ + { 29502, 0x0000805B }, /* GL_RGBA16_EXT */ + { 29516, 0x00008055 }, /* GL_RGBA2 */ + { 29525, 0x00008055 }, /* GL_RGBA2_EXT */ + { 29538, 0x00008056 }, /* GL_RGBA4 */ + { 29547, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */ + { 29566, 0x00008056 }, /* GL_RGBA4_EXT */ + { 29579, 0x000083A3 }, /* GL_RGBA4_S3TC */ + { 29593, 0x00008058 }, /* GL_RGBA8 */ + { 29602, 0x00008058 }, /* GL_RGBA8_EXT */ + { 29615, 0x00008F97 }, /* GL_RGBA8_SNORM */ + { 29630, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */ + { 29648, 0x00000C31 }, /* GL_RGBA_MODE */ + { 29661, 0x000083A2 }, /* GL_RGBA_S3TC */ + { 29674, 0x00008F93 }, /* GL_RGBA_SNORM */ + { 29688, 0x000083A0 }, /* GL_RGB_S3TC */ + { 29700, 0x00008573 }, /* GL_RGB_SCALE */ + { 29713, 0x00008573 }, /* GL_RGB_SCALE_ARB */ + { 29730, 0x00008573 }, /* GL_RGB_SCALE_EXT */ + { 29747, 0x00000407 }, /* GL_RIGHT */ + { 29756, 0x00002000 }, /* GL_S */ + { 29761, 0x00008B5D }, /* GL_SAMPLER_1D */ + { 29775, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */ + { 29796, 0x00008B5E }, /* GL_SAMPLER_2D */ + { 29810, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */ + { 29831, 0x00008B5F }, /* GL_SAMPLER_3D */ + { 29845, 0x00008B60 }, /* GL_SAMPLER_CUBE */ + { 29861, 0x000080A9 }, /* GL_SAMPLES */ + { 29872, 0x000086B4 }, /* GL_SAMPLES_3DFX */ + { 29888, 0x000080A9 }, /* GL_SAMPLES_ARB */ + { 29903, 0x00008914 }, /* GL_SAMPLES_PASSED */ + { 29921, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */ + { 29943, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ + { 29971, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */ + { 30003, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */ + { 30026, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */ + { 30053, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */ + { 30071, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */ + { 30094, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */ + { 30116, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */ + { 30135, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */ + { 30158, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */ + { 30184, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */ + { 30214, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */ + { 30239, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */ + { 30268, 0x00080000 }, /* GL_SCISSOR_BIT */ + { 30283, 0x00000C10 }, /* GL_SCISSOR_BOX */ + { 30298, 0x00000C11 }, /* GL_SCISSOR_TEST */ + { 30314, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */ + { 30339, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ + { 30379, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */ + { 30423, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ + { 30456, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ + { 30486, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ + { 30518, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ + { 30548, 0x00001C02 }, /* GL_SELECT */ + { 30558, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */ + { 30586, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */ + { 30611, 0x00008012 }, /* GL_SEPARABLE_2D */ + { 30627, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */ + { 30654, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */ + { 30685, 0x0000150F }, /* GL_SET */ + { 30692, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */ + { 30713, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */ + { 30737, 0x00008B4F }, /* GL_SHADER_TYPE */ + { 30752, 0x00000B54 }, /* GL_SHADE_MODEL */ + { 30767, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */ + { 30795, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */ + { 30818, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */ + { 30848, 0x00001601 }, /* GL_SHININESS */ + { 30861, 0x00001402 }, /* GL_SHORT */ + { 30870, 0x00009119 }, /* GL_SIGNALED */ + { 30882, 0x00008F9C }, /* GL_SIGNED_NORMALIZED */ + { 30903, 0x000081F9 }, /* GL_SINGLE_COLOR */ + { 30919, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */ + { 30939, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */ + { 30958, 0x00008C46 }, /* GL_SLUMINANCE */ + { 30972, 0x00008C47 }, /* GL_SLUMINANCE8 */ + { 30987, 0x00008C45 }, /* GL_SLUMINANCE8_ALPHA8 */ + { 31009, 0x00008C44 }, /* GL_SLUMINANCE_ALPHA */ + { 31029, 0x00001D01 }, /* GL_SMOOTH */ + { 31039, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */ + { 31072, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */ + { 31099, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */ + { 31132, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */ + { 31159, 0x00008588 }, /* GL_SOURCE0_ALPHA */ + { 31176, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */ + { 31197, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */ + { 31218, 0x00008580 }, /* GL_SOURCE0_RGB */ + { 31233, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */ + { 31252, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */ + { 31271, 0x00008589 }, /* GL_SOURCE1_ALPHA */ + { 31288, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */ + { 31309, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */ + { 31330, 0x00008581 }, /* GL_SOURCE1_RGB */ + { 31345, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */ + { 31364, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */ + { 31383, 0x0000858A }, /* GL_SOURCE2_ALPHA */ + { 31400, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */ + { 31421, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */ + { 31442, 0x00008582 }, /* GL_SOURCE2_RGB */ + { 31457, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */ + { 31476, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */ + { 31495, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */ + { 31515, 0x00008583 }, /* GL_SOURCE3_RGB_NV */ + { 31533, 0x00001202 }, /* GL_SPECULAR */ + { 31545, 0x00002402 }, /* GL_SPHERE_MAP */ + { 31559, 0x00001206 }, /* GL_SPOT_CUTOFF */ + { 31574, 0x00001204 }, /* GL_SPOT_DIRECTION */ + { 31592, 0x00001205 }, /* GL_SPOT_EXPONENT */ + { 31609, 0x00008588 }, /* GL_SRC0_ALPHA */ + { 31623, 0x00008580 }, /* GL_SRC0_RGB */ + { 31635, 0x00008589 }, /* GL_SRC1_ALPHA */ + { 31649, 0x00008581 }, /* GL_SRC1_RGB */ + { 31661, 0x0000858A }, /* GL_SRC2_ALPHA */ + { 31675, 0x00008582 }, /* GL_SRC2_RGB */ + { 31687, 0x00000302 }, /* GL_SRC_ALPHA */ + { 31700, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */ + { 31722, 0x00000300 }, /* GL_SRC_COLOR */ + { 31735, 0x00008C40 }, /* GL_SRGB */ + { 31743, 0x00008C41 }, /* GL_SRGB8 */ + { 31752, 0x00008C43 }, /* GL_SRGB8_ALPHA8 */ + { 31768, 0x00008C42 }, /* GL_SRGB_ALPHA */ + { 31782, 0x00000503 }, /* GL_STACK_OVERFLOW */ + { 31800, 0x00000504 }, /* GL_STACK_UNDERFLOW */ + { 31819, 0x000088E6 }, /* GL_STATIC_COPY */ + { 31834, 0x000088E6 }, /* GL_STATIC_COPY_ARB */ + { 31853, 0x000088E4 }, /* GL_STATIC_DRAW */ + { 31868, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */ + { 31887, 0x000088E5 }, /* GL_STATIC_READ */ + { 31902, 0x000088E5 }, /* GL_STATIC_READ_ARB */ + { 31921, 0x00001802 }, /* GL_STENCIL */ + { 31932, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT */ + { 31954, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */ + { 31980, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */ + { 32001, 0x00008801 }, /* GL_STENCIL_BACK_FAIL_ATI */ + { 32026, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */ + { 32047, 0x00008800 }, /* GL_STENCIL_BACK_FUNC_ATI */ + { 32072, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ + { 32104, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI */ + { 32140, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ + { 32172, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI */ + { 32208, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */ + { 32228, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */ + { 32255, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */ + { 32281, 0x00000D57 }, /* GL_STENCIL_BITS */ + { 32297, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */ + { 32319, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */ + { 32342, 0x00000B94 }, /* GL_STENCIL_FAIL */ + { 32358, 0x00000B92 }, /* GL_STENCIL_FUNC */ + { 32374, 0x00001901 }, /* GL_STENCIL_INDEX */ + { 32391, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */ + { 32414, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */ + { 32436, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */ + { 32458, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */ + { 32480, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */ + { 32501, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */ + { 32528, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */ + { 32555, 0x00000B97 }, /* GL_STENCIL_REF */ + { 32570, 0x00000B90 }, /* GL_STENCIL_TEST */ + { 32586, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ + { 32615, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */ + { 32637, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */ + { 32658, 0x00000C33 }, /* GL_STEREO */ + { 32668, 0x000085BE }, /* GL_STORAGE_CACHED_APPLE */ + { 32692, 0x000085BD }, /* GL_STORAGE_PRIVATE_APPLE */ + { 32717, 0x000085BF }, /* GL_STORAGE_SHARED_APPLE */ + { 32741, 0x000088E2 }, /* GL_STREAM_COPY */ + { 32756, 0x000088E2 }, /* GL_STREAM_COPY_ARB */ + { 32775, 0x000088E0 }, /* GL_STREAM_DRAW */ + { 32790, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */ + { 32809, 0x000088E1 }, /* GL_STREAM_READ */ + { 32824, 0x000088E1 }, /* GL_STREAM_READ_ARB */ + { 32843, 0x00000D50 }, /* GL_SUBPIXEL_BITS */ + { 32860, 0x000084E7 }, /* GL_SUBTRACT */ + { 32872, 0x000084E7 }, /* GL_SUBTRACT_ARB */ + { 32888, 0x00009113 }, /* GL_SYNC_CONDITION */ + { 32906, 0x00009116 }, /* GL_SYNC_FENCE */ + { 32920, 0x00009115 }, /* GL_SYNC_FLAGS */ + { 32934, 0x00000001 }, /* GL_SYNC_FLUSH_COMMANDS_BIT */ + { 32961, 0x00009117 }, /* GL_SYNC_GPU_COMMANDS_COMPLETE */ + { 32991, 0x00009114 }, /* GL_SYNC_STATUS */ + { 33006, 0x00002001 }, /* GL_T */ + { 33011, 0x00002A2A }, /* GL_T2F_C3F_V3F */ + { 33026, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */ + { 33045, 0x00002A29 }, /* GL_T2F_C4UB_V3F */ + { 33061, 0x00002A2B }, /* GL_T2F_N3F_V3F */ + { 33076, 0x00002A27 }, /* GL_T2F_V3F */ + { 33087, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */ + { 33106, 0x00002A28 }, /* GL_T4F_V4F */ + { 33117, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */ + { 33140, 0x00001702 }, /* GL_TEXTURE */ + { 33151, 0x000084C0 }, /* GL_TEXTURE0 */ + { 33163, 0x000084C0 }, /* GL_TEXTURE0_ARB */ + { 33179, 0x000084C1 }, /* GL_TEXTURE1 */ + { 33191, 0x000084CA }, /* GL_TEXTURE10 */ + { 33204, 0x000084CA }, /* GL_TEXTURE10_ARB */ + { 33221, 0x000084CB }, /* GL_TEXTURE11 */ + { 33234, 0x000084CB }, /* GL_TEXTURE11_ARB */ + { 33251, 0x000084CC }, /* GL_TEXTURE12 */ + { 33264, 0x000084CC }, /* GL_TEXTURE12_ARB */ + { 33281, 0x000084CD }, /* GL_TEXTURE13 */ + { 33294, 0x000084CD }, /* GL_TEXTURE13_ARB */ + { 33311, 0x000084CE }, /* GL_TEXTURE14 */ + { 33324, 0x000084CE }, /* GL_TEXTURE14_ARB */ + { 33341, 0x000084CF }, /* GL_TEXTURE15 */ + { 33354, 0x000084CF }, /* GL_TEXTURE15_ARB */ + { 33371, 0x000084D0 }, /* GL_TEXTURE16 */ + { 33384, 0x000084D0 }, /* GL_TEXTURE16_ARB */ + { 33401, 0x000084D1 }, /* GL_TEXTURE17 */ + { 33414, 0x000084D1 }, /* GL_TEXTURE17_ARB */ + { 33431, 0x000084D2 }, /* GL_TEXTURE18 */ + { 33444, 0x000084D2 }, /* GL_TEXTURE18_ARB */ + { 33461, 0x000084D3 }, /* GL_TEXTURE19 */ + { 33474, 0x000084D3 }, /* GL_TEXTURE19_ARB */ + { 33491, 0x000084C1 }, /* GL_TEXTURE1_ARB */ + { 33507, 0x000084C2 }, /* GL_TEXTURE2 */ + { 33519, 0x000084D4 }, /* GL_TEXTURE20 */ + { 33532, 0x000084D4 }, /* GL_TEXTURE20_ARB */ + { 33549, 0x000084D5 }, /* GL_TEXTURE21 */ + { 33562, 0x000084D5 }, /* GL_TEXTURE21_ARB */ + { 33579, 0x000084D6 }, /* GL_TEXTURE22 */ + { 33592, 0x000084D6 }, /* GL_TEXTURE22_ARB */ + { 33609, 0x000084D7 }, /* GL_TEXTURE23 */ + { 33622, 0x000084D7 }, /* GL_TEXTURE23_ARB */ + { 33639, 0x000084D8 }, /* GL_TEXTURE24 */ + { 33652, 0x000084D8 }, /* GL_TEXTURE24_ARB */ + { 33669, 0x000084D9 }, /* GL_TEXTURE25 */ + { 33682, 0x000084D9 }, /* GL_TEXTURE25_ARB */ + { 33699, 0x000084DA }, /* GL_TEXTURE26 */ + { 33712, 0x000084DA }, /* GL_TEXTURE26_ARB */ + { 33729, 0x000084DB }, /* GL_TEXTURE27 */ + { 33742, 0x000084DB }, /* GL_TEXTURE27_ARB */ + { 33759, 0x000084DC }, /* GL_TEXTURE28 */ + { 33772, 0x000084DC }, /* GL_TEXTURE28_ARB */ + { 33789, 0x000084DD }, /* GL_TEXTURE29 */ + { 33802, 0x000084DD }, /* GL_TEXTURE29_ARB */ + { 33819, 0x000084C2 }, /* GL_TEXTURE2_ARB */ + { 33835, 0x000084C3 }, /* GL_TEXTURE3 */ + { 33847, 0x000084DE }, /* GL_TEXTURE30 */ + { 33860, 0x000084DE }, /* GL_TEXTURE30_ARB */ + { 33877, 0x000084DF }, /* GL_TEXTURE31 */ + { 33890, 0x000084DF }, /* GL_TEXTURE31_ARB */ + { 33907, 0x000084C3 }, /* GL_TEXTURE3_ARB */ + { 33923, 0x000084C4 }, /* GL_TEXTURE4 */ + { 33935, 0x000084C4 }, /* GL_TEXTURE4_ARB */ + { 33951, 0x000084C5 }, /* GL_TEXTURE5 */ + { 33963, 0x000084C5 }, /* GL_TEXTURE5_ARB */ + { 33979, 0x000084C6 }, /* GL_TEXTURE6 */ + { 33991, 0x000084C6 }, /* GL_TEXTURE6_ARB */ + { 34007, 0x000084C7 }, /* GL_TEXTURE7 */ + { 34019, 0x000084C7 }, /* GL_TEXTURE7_ARB */ + { 34035, 0x000084C8 }, /* GL_TEXTURE8 */ + { 34047, 0x000084C8 }, /* GL_TEXTURE8_ARB */ + { 34063, 0x000084C9 }, /* GL_TEXTURE9 */ + { 34075, 0x000084C9 }, /* GL_TEXTURE9_ARB */ + { 34091, 0x00000DE0 }, /* GL_TEXTURE_1D */ + { 34105, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY_EXT */ + { 34129, 0x00000DE1 }, /* GL_TEXTURE_2D */ + { 34143, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY_EXT */ + { 34167, 0x0000806F }, /* GL_TEXTURE_3D */ + { 34181, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */ + { 34203, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */ + { 34229, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */ + { 34251, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */ + { 34273, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ + { 34305, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */ + { 34327, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ + { 34359, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */ + { 34381, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */ + { 34409, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */ + { 34441, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ + { 34474, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */ + { 34506, 0x00040000 }, /* GL_TEXTURE_BIT */ + { 34521, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */ + { 34542, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */ + { 34567, 0x00001005 }, /* GL_TEXTURE_BORDER */ + { 34585, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */ + { 34609, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ + { 34640, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ + { 34670, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ + { 34700, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ + { 34735, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ + { 34766, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + { 34804, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */ + { 34831, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ + { 34863, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + { 34897, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */ + { 34921, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */ + { 34949, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */ + { 34973, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */ + { 35001, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ + { 35034, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */ + { 35058, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */ + { 35080, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */ + { 35102, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */ + { 35128, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */ + { 35162, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ + { 35195, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */ + { 35232, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */ + { 35260, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */ + { 35292, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */ + { 35315, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ + { 35353, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */ + { 35395, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */ + { 35426, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */ + { 35454, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ + { 35484, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */ + { 35512, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */ + { 35532, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */ + { 35556, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ + { 35587, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */ + { 35622, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ + { 35653, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */ + { 35688, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ + { 35719, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */ + { 35754, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ + { 35785, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */ + { 35820, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ + { 35851, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */ + { 35886, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ + { 35917, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */ + { 35952, 0x000088F4 }, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */ + { 35981, 0x00008071 }, /* GL_TEXTURE_DEPTH */ + { 35998, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */ + { 36020, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */ + { 36046, 0x00002300 }, /* GL_TEXTURE_ENV */ + { 36061, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */ + { 36082, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */ + { 36102, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */ + { 36128, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */ + { 36148, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */ + { 36165, 0x00000C62 }, /* GL_TEXTURE_GEN_R */ + { 36182, 0x00000C60 }, /* GL_TEXTURE_GEN_S */ + { 36199, 0x00000C61 }, /* GL_TEXTURE_GEN_T */ + { 36216, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */ + { 36241, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */ + { 36263, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */ + { 36289, 0x00001001 }, /* GL_TEXTURE_HEIGHT */ + { 36307, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */ + { 36333, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */ + { 36359, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */ + { 36389, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */ + { 36416, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */ + { 36441, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */ + { 36461, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */ + { 36485, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ + { 36512, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ + { 36539, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ + { 36566, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */ + { 36592, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */ + { 36622, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */ + { 36644, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */ + { 36662, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ + { 36692, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ + { 36720, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ + { 36748, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ + { 36776, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */ + { 36797, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */ + { 36816, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */ + { 36838, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */ + { 36857, 0x00008066 }, /* GL_TEXTURE_PRIORITY */ + { 36877, 0x000085B7 }, /* GL_TEXTURE_RANGE_LENGTH_APPLE */ + { 36907, 0x000085B8 }, /* GL_TEXTURE_RANGE_POINTER_APPLE */ + { 36938, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */ + { 36963, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */ + { 36987, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */ + { 37007, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */ + { 37031, 0x00008067 }, /* GL_TEXTURE_RESIDENT */ + { 37051, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */ + { 37074, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE */ + { 37098, 0x000085BC }, /* GL_TEXTURE_STORAGE_HINT_APPLE */ + { 37128, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */ + { 37153, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ + { 37187, 0x00001000 }, /* GL_TEXTURE_WIDTH */ + { 37204, 0x00008072 }, /* GL_TEXTURE_WRAP_R */ + { 37222, 0x00002802 }, /* GL_TEXTURE_WRAP_S */ + { 37240, 0x00002803 }, /* GL_TEXTURE_WRAP_T */ + { 37258, 0x0000911B }, /* GL_TIMEOUT_EXPIRED */ + { 37277, 0xFFFFFFFFFFFFFFFF }, /* GL_TIMEOUT_IGNORED */ + { 37296, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */ + { 37316, 0x00008648 }, /* GL_TRACK_MATRIX_NV */ + { 37335, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */ + { 37364, 0x00001000 }, /* GL_TRANSFORM_BIT */ + { 37381, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */ + { 37407, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */ + { 37437, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ + { 37469, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ + { 37499, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */ + { 37533, 0x0000862C }, /* GL_TRANSPOSE_NV */ + { 37549, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */ + { 37580, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */ + { 37615, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */ + { 37643, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */ + { 37675, 0x00000004 }, /* GL_TRIANGLES */ + { 37688, 0x00000006 }, /* GL_TRIANGLE_FAN */ + { 37704, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */ + { 37725, 0x00000005 }, /* GL_TRIANGLE_STRIP */ + { 37743, 0x00000001 }, /* GL_TRUE */ + { 37751, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */ + { 37771, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */ + { 37794, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */ + { 37814, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */ + { 37835, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */ + { 37857, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */ + { 37879, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */ + { 37899, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */ + { 37920, 0x00009118 }, /* GL_UNSIGNALED */ + { 37934, 0x00001401 }, /* GL_UNSIGNED_BYTE */ + { 37951, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */ + { 37978, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */ + { 38001, 0x00001405 }, /* GL_UNSIGNED_INT */ + { 38017, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */ + { 38044, 0x000084FA }, /* GL_UNSIGNED_INT_24_8 */ + { 38065, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */ + { 38089, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */ + { 38120, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */ + { 38144, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */ + { 38172, 0x00008C17 }, /* GL_UNSIGNED_NORMALIZED */ + { 38195, 0x00001403 }, /* GL_UNSIGNED_SHORT */ + { 38213, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ + { 38243, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */ + { 38269, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ + { 38299, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */ + { 38325, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */ + { 38349, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */ + { 38377, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */ + { 38405, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */ + { 38432, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ + { 38464, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */ + { 38495, 0x00008CA2 }, /* GL_UPPER_LEFT */ + { 38509, 0x00002A20 }, /* GL_V2F */ + { 38516, 0x00002A21 }, /* GL_V3F */ + { 38523, 0x00008B83 }, /* GL_VALIDATE_STATUS */ + { 38542, 0x00001F00 }, /* GL_VENDOR */ + { 38552, 0x00001F02 }, /* GL_VERSION */ + { 38563, 0x00008074 }, /* GL_VERTEX_ARRAY */ + { 38579, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING */ + { 38603, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */ + { 38633, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ + { 38664, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */ + { 38699, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */ + { 38723, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */ + { 38744, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */ + { 38767, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */ + { 38788, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ + { 38815, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ + { 38843, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ + { 38871, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ + { 38899, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ + { 38927, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ + { 38955, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ + { 38983, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ + { 39010, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ + { 39037, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ + { 39064, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ + { 39091, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ + { 39118, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ + { 39145, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ + { 39172, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ + { 39199, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ + { 39226, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ + { 39264, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */ + { 39306, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ + { 39337, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ + { 39372, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ + { 39406, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ + { 39444, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ + { 39475, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ + { 39510, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ + { 39538, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ + { 39570, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ + { 39600, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ + { 39634, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ + { 39662, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ + { 39694, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */ + { 39714, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */ + { 39736, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */ + { 39765, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */ + { 39786, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */ + { 39815, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ + { 39848, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */ + { 39880, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */ + { 39907, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ + { 39938, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */ + { 39968, 0x00008B31 }, /* GL_VERTEX_SHADER */ + { 39985, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */ + { 40006, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */ + { 40033, 0x00000BA2 }, /* GL_VIEWPORT */ + { 40045, 0x00000800 }, /* GL_VIEWPORT_BIT */ + { 40061, 0x0000911D }, /* GL_WAIT_FAILED */ + { 40076, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */ + { 40096, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ + { 40127, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */ + { 40162, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */ + { 40190, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */ + { 40215, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ + { 40242, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */ + { 40267, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */ + { 40291, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */ + { 40310, 0x000088B9 }, /* GL_WRITE_ONLY */ + { 40324, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */ + { 40342, 0x00001506 }, /* GL_XOR */ + { 40349, 0x000085B9 }, /* GL_YCBCR_422_APPLE */ + { 40368, 0x00008757 }, /* GL_YCBCR_MESA */ + { 40382, 0x00000000 }, /* GL_ZERO */ + { 40390, 0x00000D16 }, /* GL_ZOOM_X */ + { 40400, 0x00000D17 }, /* GL_ZOOM_Y */ }; static const unsigned reduced_enums[1347] = { 476, /* GL_FALSE */ - 692, /* GL_LINES */ - 694, /* GL_LINE_LOOP */ - 701, /* GL_LINE_STRIP */ - 1744, /* GL_TRIANGLES */ - 1747, /* GL_TRIANGLE_STRIP */ - 1745, /* GL_TRIANGLE_FAN */ - 1272, /* GL_QUADS */ - 1275, /* GL_QUAD_STRIP */ - 1159, /* GL_POLYGON */ - 1171, /* GL_POLYGON_STIPPLE_BIT */ - 1120, /* GL_PIXEL_MODE_BIT */ - 679, /* GL_LIGHTING_BIT */ - 505, /* GL_FOG_BIT */ + 694, /* GL_LINES */ + 696, /* GL_LINE_LOOP */ + 703, /* GL_LINE_STRIP */ + 1748, /* GL_TRIANGLES */ + 1751, /* GL_TRIANGLE_STRIP */ + 1749, /* GL_TRIANGLE_FAN */ + 1275, /* GL_QUADS */ + 1279, /* GL_QUAD_STRIP */ + 1161, /* GL_POLYGON */ + 1173, /* GL_POLYGON_STIPPLE_BIT */ + 1122, /* GL_PIXEL_MODE_BIT */ + 681, /* GL_LIGHTING_BIT */ + 506, /* GL_FOG_BIT */ 8, /* GL_ACCUM */ - 711, /* GL_LOAD */ - 1327, /* GL_RETURN */ - 992, /* GL_MULT */ + 713, /* GL_LOAD */ + 1331, /* GL_RETURN */ + 994, /* GL_MULT */ 23, /* GL_ADD */ - 1008, /* GL_NEVER */ - 669, /* GL_LESS */ + 1010, /* GL_NEVER */ + 671, /* GL_LESS */ 466, /* GL_EQUAL */ - 668, /* GL_LEQUAL */ - 591, /* GL_GREATER */ - 1023, /* GL_NOTEQUAL */ - 590, /* GL_GEQUAL */ + 670, /* GL_LEQUAL */ + 592, /* GL_GREATER */ + 1025, /* GL_NOTEQUAL */ + 591, /* GL_GEQUAL */ 47, /* GL_ALWAYS */ - 1468, /* GL_SRC_COLOR */ - 1053, /* GL_ONE_MINUS_SRC_COLOR */ - 1466, /* GL_SRC_ALPHA */ - 1052, /* GL_ONE_MINUS_SRC_ALPHA */ + 1472, /* GL_SRC_COLOR */ + 1055, /* GL_ONE_MINUS_SRC_COLOR */ + 1470, /* GL_SRC_ALPHA */ + 1054, /* GL_ONE_MINUS_SRC_ALPHA */ 445, /* GL_DST_ALPHA */ - 1050, /* GL_ONE_MINUS_DST_ALPHA */ + 1052, /* GL_ONE_MINUS_DST_ALPHA */ 446, /* GL_DST_COLOR */ - 1051, /* GL_ONE_MINUS_DST_COLOR */ - 1467, /* GL_SRC_ALPHA_SATURATE */ - 578, /* GL_FRONT_LEFT */ - 579, /* GL_FRONT_RIGHT */ + 1053, /* GL_ONE_MINUS_DST_COLOR */ + 1471, /* GL_SRC_ALPHA_SATURATE */ + 579, /* GL_FRONT_LEFT */ + 580, /* GL_FRONT_RIGHT */ 69, /* GL_BACK_LEFT */ 70, /* GL_BACK_RIGHT */ - 575, /* GL_FRONT */ + 576, /* GL_FRONT */ 68, /* GL_BACK */ - 667, /* GL_LEFT */ - 1369, /* GL_RIGHT */ - 576, /* GL_FRONT_AND_BACK */ + 669, /* GL_LEFT */ + 1373, /* GL_RIGHT */ + 577, /* GL_FRONT_AND_BACK */ 63, /* GL_AUX0 */ 64, /* GL_AUX1 */ 65, /* GL_AUX2 */ 66, /* GL_AUX3 */ - 657, /* GL_INVALID_ENUM */ - 661, /* GL_INVALID_VALUE */ - 660, /* GL_INVALID_OPERATION */ - 1473, /* GL_STACK_OVERFLOW */ - 1474, /* GL_STACK_UNDERFLOW */ - 1078, /* GL_OUT_OF_MEMORY */ - 658, /* GL_INVALID_FRAMEBUFFER_OPERATION */ + 658, /* GL_INVALID_ENUM */ + 662, /* GL_INVALID_VALUE */ + 661, /* GL_INVALID_OPERATION */ + 1477, /* GL_STACK_OVERFLOW */ + 1478, /* GL_STACK_UNDERFLOW */ + 1080, /* GL_OUT_OF_MEMORY */ + 659, /* GL_INVALID_FRAMEBUFFER_OPERATION */ 0, /* GL_2D */ 2, /* GL_3D */ 3, /* GL_3D_COLOR */ 4, /* GL_3D_COLOR_TEXTURE */ 6, /* GL_4D_COLOR_TEXTURE */ - 1098, /* GL_PASS_THROUGH_TOKEN */ - 1158, /* GL_POINT_TOKEN */ - 702, /* GL_LINE_TOKEN */ - 1172, /* GL_POLYGON_TOKEN */ + 1100, /* GL_PASS_THROUGH_TOKEN */ + 1160, /* GL_POINT_TOKEN */ + 704, /* GL_LINE_TOKEN */ + 1174, /* GL_POLYGON_TOKEN */ 74, /* GL_BITMAP_TOKEN */ 444, /* GL_DRAW_PIXEL_TOKEN */ 301, /* GL_COPY_PIXEL_TOKEN */ - 695, /* GL_LINE_RESET_TOKEN */ + 697, /* GL_LINE_RESET_TOKEN */ 469, /* GL_EXP */ 470, /* GL_EXP2 */ 337, /* GL_CW */ 125, /* GL_CCW */ 146, /* GL_COEFF */ - 1075, /* GL_ORDER */ + 1077, /* GL_ORDER */ 382, /* GL_DOMAIN */ 311, /* GL_CURRENT_COLOR */ 314, /* GL_CURRENT_INDEX */ @@ -3846,67 +3854,67 @@ static const unsigned reduced_enums[1347] = 328, /* GL_CURRENT_RASTER_POSITION */ 329, /* GL_CURRENT_RASTER_POSITION_VALID */ 326, /* GL_CURRENT_RASTER_DISTANCE */ - 1151, /* GL_POINT_SMOOTH */ - 1140, /* GL_POINT_SIZE */ - 1150, /* GL_POINT_SIZE_RANGE */ - 1141, /* GL_POINT_SIZE_GRANULARITY */ - 696, /* GL_LINE_SMOOTH */ - 703, /* GL_LINE_WIDTH */ - 705, /* GL_LINE_WIDTH_RANGE */ - 704, /* GL_LINE_WIDTH_GRANULARITY */ - 698, /* GL_LINE_STIPPLE */ - 699, /* GL_LINE_STIPPLE_PATTERN */ - 700, /* GL_LINE_STIPPLE_REPEAT */ - 710, /* GL_LIST_MODE */ - 875, /* GL_MAX_LIST_NESTING */ - 707, /* GL_LIST_BASE */ - 709, /* GL_LIST_INDEX */ - 1161, /* GL_POLYGON_MODE */ - 1168, /* GL_POLYGON_SMOOTH */ - 1170, /* GL_POLYGON_STIPPLE */ + 1153, /* GL_POINT_SMOOTH */ + 1142, /* GL_POINT_SIZE */ + 1152, /* GL_POINT_SIZE_RANGE */ + 1143, /* GL_POINT_SIZE_GRANULARITY */ + 698, /* GL_LINE_SMOOTH */ + 705, /* GL_LINE_WIDTH */ + 707, /* GL_LINE_WIDTH_RANGE */ + 706, /* GL_LINE_WIDTH_GRANULARITY */ + 700, /* GL_LINE_STIPPLE */ + 701, /* GL_LINE_STIPPLE_PATTERN */ + 702, /* GL_LINE_STIPPLE_REPEAT */ + 712, /* GL_LIST_MODE */ + 877, /* GL_MAX_LIST_NESTING */ + 709, /* GL_LIST_BASE */ + 711, /* GL_LIST_INDEX */ + 1163, /* GL_POLYGON_MODE */ + 1170, /* GL_POLYGON_SMOOTH */ + 1172, /* GL_POLYGON_STIPPLE */ 455, /* GL_EDGE_FLAG */ 304, /* GL_CULL_FACE */ 305, /* GL_CULL_FACE_MODE */ - 577, /* GL_FRONT_FACE */ - 678, /* GL_LIGHTING */ - 683, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ - 684, /* GL_LIGHT_MODEL_TWO_SIDE */ - 680, /* GL_LIGHT_MODEL_AMBIENT */ - 1415, /* GL_SHADE_MODEL */ + 578, /* GL_FRONT_FACE */ + 680, /* GL_LIGHTING */ + 685, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ + 686, /* GL_LIGHT_MODEL_TWO_SIDE */ + 682, /* GL_LIGHT_MODEL_AMBIENT */ + 1419, /* GL_SHADE_MODEL */ 193, /* GL_COLOR_MATERIAL_FACE */ 194, /* GL_COLOR_MATERIAL_PARAMETER */ 192, /* GL_COLOR_MATERIAL */ - 504, /* GL_FOG */ - 526, /* GL_FOG_INDEX */ - 522, /* GL_FOG_DENSITY */ - 530, /* GL_FOG_START */ - 524, /* GL_FOG_END */ - 527, /* GL_FOG_MODE */ - 506, /* GL_FOG_COLOR */ + 505, /* GL_FOG */ + 527, /* GL_FOG_INDEX */ + 523, /* GL_FOG_DENSITY */ + 531, /* GL_FOG_START */ + 525, /* GL_FOG_END */ + 528, /* GL_FOG_MODE */ + 507, /* GL_FOG_COLOR */ 369, /* GL_DEPTH_RANGE */ 376, /* GL_DEPTH_TEST */ 379, /* GL_DEPTH_WRITEMASK */ 357, /* GL_DEPTH_CLEAR_VALUE */ 368, /* GL_DEPTH_FUNC */ 12, /* GL_ACCUM_CLEAR_VALUE */ - 1509, /* GL_STENCIL_TEST */ - 1497, /* GL_STENCIL_CLEAR_VALUE */ - 1499, /* GL_STENCIL_FUNC */ - 1511, /* GL_STENCIL_VALUE_MASK */ - 1498, /* GL_STENCIL_FAIL */ - 1506, /* GL_STENCIL_PASS_DEPTH_FAIL */ - 1507, /* GL_STENCIL_PASS_DEPTH_PASS */ - 1508, /* GL_STENCIL_REF */ - 1512, /* GL_STENCIL_WRITEMASK */ - 844, /* GL_MATRIX_MODE */ - 1013, /* GL_NORMALIZE */ - 1838, /* GL_VIEWPORT */ - 987, /* GL_MODELVIEW_STACK_DEPTH */ - 1251, /* GL_PROJECTION_STACK_DEPTH */ - 1719, /* GL_TEXTURE_STACK_DEPTH */ - 985, /* GL_MODELVIEW_MATRIX */ - 1250, /* GL_PROJECTION_MATRIX */ - 1702, /* GL_TEXTURE_MATRIX */ + 1513, /* GL_STENCIL_TEST */ + 1501, /* GL_STENCIL_CLEAR_VALUE */ + 1503, /* GL_STENCIL_FUNC */ + 1515, /* GL_STENCIL_VALUE_MASK */ + 1502, /* GL_STENCIL_FAIL */ + 1510, /* GL_STENCIL_PASS_DEPTH_FAIL */ + 1511, /* GL_STENCIL_PASS_DEPTH_PASS */ + 1512, /* GL_STENCIL_REF */ + 1516, /* GL_STENCIL_WRITEMASK */ + 846, /* GL_MATRIX_MODE */ + 1015, /* GL_NORMALIZE */ + 1842, /* GL_VIEWPORT */ + 989, /* GL_MODELVIEW_STACK_DEPTH */ + 1253, /* GL_PROJECTION_STACK_DEPTH */ + 1723, /* GL_TEXTURE_STACK_DEPTH */ + 987, /* GL_MODELVIEW_MATRIX */ + 1252, /* GL_PROJECTION_MATRIX */ + 1706, /* GL_TEXTURE_MATRIX */ 61, /* GL_ATTRIB_STACK_DEPTH */ 136, /* GL_CLIENT_ATTRIB_STACK_DEPTH */ 43, /* GL_ALPHA_TEST */ @@ -3916,162 +3924,162 @@ static const unsigned reduced_enums[1347] = 78, /* GL_BLEND_DST */ 87, /* GL_BLEND_SRC */ 75, /* GL_BLEND */ - 713, /* GL_LOGIC_OP_MODE */ - 631, /* GL_INDEX_LOGIC_OP */ + 715, /* GL_LOGIC_OP_MODE */ + 632, /* GL_INDEX_LOGIC_OP */ 191, /* GL_COLOR_LOGIC_OP */ 67, /* GL_AUX_BUFFERS */ 392, /* GL_DRAW_BUFFER */ - 1285, /* GL_READ_BUFFER */ - 1396, /* GL_SCISSOR_BOX */ - 1397, /* GL_SCISSOR_TEST */ - 630, /* GL_INDEX_CLEAR_VALUE */ - 635, /* GL_INDEX_WRITEMASK */ + 1289, /* GL_READ_BUFFER */ + 1400, /* GL_SCISSOR_BOX */ + 1401, /* GL_SCISSOR_TEST */ + 631, /* GL_INDEX_CLEAR_VALUE */ + 636, /* GL_INDEX_WRITEMASK */ 188, /* GL_COLOR_CLEAR_VALUE */ 230, /* GL_COLOR_WRITEMASK */ - 632, /* GL_INDEX_MODE */ - 1362, /* GL_RGBA_MODE */ + 633, /* GL_INDEX_MODE */ + 1366, /* GL_RGBA_MODE */ 391, /* GL_DOUBLEBUFFER */ - 1513, /* GL_STEREO */ - 1320, /* GL_RENDER_MODE */ - 1099, /* GL_PERSPECTIVE_CORRECTION_HINT */ - 1152, /* GL_POINT_SMOOTH_HINT */ - 697, /* GL_LINE_SMOOTH_HINT */ - 1169, /* GL_POLYGON_SMOOTH_HINT */ - 525, /* GL_FOG_HINT */ - 1683, /* GL_TEXTURE_GEN_S */ - 1684, /* GL_TEXTURE_GEN_T */ - 1682, /* GL_TEXTURE_GEN_R */ - 1681, /* GL_TEXTURE_GEN_Q */ - 1112, /* GL_PIXEL_MAP_I_TO_I */ - 1118, /* GL_PIXEL_MAP_S_TO_S */ - 1114, /* GL_PIXEL_MAP_I_TO_R */ - 1110, /* GL_PIXEL_MAP_I_TO_G */ - 1108, /* GL_PIXEL_MAP_I_TO_B */ - 1106, /* GL_PIXEL_MAP_I_TO_A */ - 1116, /* GL_PIXEL_MAP_R_TO_R */ - 1104, /* GL_PIXEL_MAP_G_TO_G */ - 1102, /* GL_PIXEL_MAP_B_TO_B */ - 1100, /* GL_PIXEL_MAP_A_TO_A */ - 1113, /* GL_PIXEL_MAP_I_TO_I_SIZE */ - 1119, /* GL_PIXEL_MAP_S_TO_S_SIZE */ - 1115, /* GL_PIXEL_MAP_I_TO_R_SIZE */ - 1111, /* GL_PIXEL_MAP_I_TO_G_SIZE */ - 1109, /* GL_PIXEL_MAP_I_TO_B_SIZE */ - 1107, /* GL_PIXEL_MAP_I_TO_A_SIZE */ - 1117, /* GL_PIXEL_MAP_R_TO_R_SIZE */ - 1105, /* GL_PIXEL_MAP_G_TO_G_SIZE */ - 1103, /* GL_PIXEL_MAP_B_TO_B_SIZE */ - 1101, /* GL_PIXEL_MAP_A_TO_A_SIZE */ - 1756, /* GL_UNPACK_SWAP_BYTES */ - 1751, /* GL_UNPACK_LSB_FIRST */ - 1752, /* GL_UNPACK_ROW_LENGTH */ - 1755, /* GL_UNPACK_SKIP_ROWS */ - 1754, /* GL_UNPACK_SKIP_PIXELS */ - 1749, /* GL_UNPACK_ALIGNMENT */ - 1087, /* GL_PACK_SWAP_BYTES */ - 1082, /* GL_PACK_LSB_FIRST */ - 1083, /* GL_PACK_ROW_LENGTH */ - 1086, /* GL_PACK_SKIP_ROWS */ - 1085, /* GL_PACK_SKIP_PIXELS */ - 1079, /* GL_PACK_ALIGNMENT */ - 791, /* GL_MAP_COLOR */ - 796, /* GL_MAP_STENCIL */ - 634, /* GL_INDEX_SHIFT */ - 633, /* GL_INDEX_OFFSET */ - 1298, /* GL_RED_SCALE */ - 1296, /* GL_RED_BIAS */ - 1856, /* GL_ZOOM_X */ - 1857, /* GL_ZOOM_Y */ - 595, /* GL_GREEN_SCALE */ - 593, /* GL_GREEN_BIAS */ + 1517, /* GL_STEREO */ + 1324, /* GL_RENDER_MODE */ + 1101, /* GL_PERSPECTIVE_CORRECTION_HINT */ + 1154, /* GL_POINT_SMOOTH_HINT */ + 699, /* GL_LINE_SMOOTH_HINT */ + 1171, /* GL_POLYGON_SMOOTH_HINT */ + 526, /* GL_FOG_HINT */ + 1687, /* GL_TEXTURE_GEN_S */ + 1688, /* GL_TEXTURE_GEN_T */ + 1686, /* GL_TEXTURE_GEN_R */ + 1685, /* GL_TEXTURE_GEN_Q */ + 1114, /* GL_PIXEL_MAP_I_TO_I */ + 1120, /* GL_PIXEL_MAP_S_TO_S */ + 1116, /* GL_PIXEL_MAP_I_TO_R */ + 1112, /* GL_PIXEL_MAP_I_TO_G */ + 1110, /* GL_PIXEL_MAP_I_TO_B */ + 1108, /* GL_PIXEL_MAP_I_TO_A */ + 1118, /* GL_PIXEL_MAP_R_TO_R */ + 1106, /* GL_PIXEL_MAP_G_TO_G */ + 1104, /* GL_PIXEL_MAP_B_TO_B */ + 1102, /* GL_PIXEL_MAP_A_TO_A */ + 1115, /* GL_PIXEL_MAP_I_TO_I_SIZE */ + 1121, /* GL_PIXEL_MAP_S_TO_S_SIZE */ + 1117, /* GL_PIXEL_MAP_I_TO_R_SIZE */ + 1113, /* GL_PIXEL_MAP_I_TO_G_SIZE */ + 1111, /* GL_PIXEL_MAP_I_TO_B_SIZE */ + 1109, /* GL_PIXEL_MAP_I_TO_A_SIZE */ + 1119, /* GL_PIXEL_MAP_R_TO_R_SIZE */ + 1107, /* GL_PIXEL_MAP_G_TO_G_SIZE */ + 1105, /* GL_PIXEL_MAP_B_TO_B_SIZE */ + 1103, /* GL_PIXEL_MAP_A_TO_A_SIZE */ + 1760, /* GL_UNPACK_SWAP_BYTES */ + 1755, /* GL_UNPACK_LSB_FIRST */ + 1756, /* GL_UNPACK_ROW_LENGTH */ + 1759, /* GL_UNPACK_SKIP_ROWS */ + 1758, /* GL_UNPACK_SKIP_PIXELS */ + 1753, /* GL_UNPACK_ALIGNMENT */ + 1089, /* GL_PACK_SWAP_BYTES */ + 1084, /* GL_PACK_LSB_FIRST */ + 1085, /* GL_PACK_ROW_LENGTH */ + 1088, /* GL_PACK_SKIP_ROWS */ + 1087, /* GL_PACK_SKIP_PIXELS */ + 1081, /* GL_PACK_ALIGNMENT */ + 793, /* GL_MAP_COLOR */ + 798, /* GL_MAP_STENCIL */ + 635, /* GL_INDEX_SHIFT */ + 634, /* GL_INDEX_OFFSET */ + 1302, /* GL_RED_SCALE */ + 1300, /* GL_RED_BIAS */ + 1860, /* GL_ZOOM_X */ + 1861, /* GL_ZOOM_Y */ + 596, /* GL_GREEN_SCALE */ + 594, /* GL_GREEN_BIAS */ 93, /* GL_BLUE_SCALE */ 91, /* GL_BLUE_BIAS */ 42, /* GL_ALPHA_SCALE */ 40, /* GL_ALPHA_BIAS */ 370, /* GL_DEPTH_SCALE */ 350, /* GL_DEPTH_BIAS */ - 870, /* GL_MAX_EVAL_ORDER */ - 874, /* GL_MAX_LIGHTS */ - 853, /* GL_MAX_CLIP_PLANES */ - 920, /* GL_MAX_TEXTURE_SIZE */ - 880, /* GL_MAX_PIXEL_MAP_TABLE */ - 849, /* GL_MAX_ATTRIB_STACK_DEPTH */ - 877, /* GL_MAX_MODELVIEW_STACK_DEPTH */ - 878, /* GL_MAX_NAME_STACK_DEPTH */ - 906, /* GL_MAX_PROJECTION_STACK_DEPTH */ - 921, /* GL_MAX_TEXTURE_STACK_DEPTH */ - 935, /* GL_MAX_VIEWPORT_DIMS */ - 850, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ - 1523, /* GL_SUBPIXEL_BITS */ - 629, /* GL_INDEX_BITS */ - 1297, /* GL_RED_BITS */ - 594, /* GL_GREEN_BITS */ + 872, /* GL_MAX_EVAL_ORDER */ + 876, /* GL_MAX_LIGHTS */ + 855, /* GL_MAX_CLIP_PLANES */ + 922, /* GL_MAX_TEXTURE_SIZE */ + 882, /* GL_MAX_PIXEL_MAP_TABLE */ + 851, /* GL_MAX_ATTRIB_STACK_DEPTH */ + 879, /* GL_MAX_MODELVIEW_STACK_DEPTH */ + 880, /* GL_MAX_NAME_STACK_DEPTH */ + 908, /* GL_MAX_PROJECTION_STACK_DEPTH */ + 923, /* GL_MAX_TEXTURE_STACK_DEPTH */ + 937, /* GL_MAX_VIEWPORT_DIMS */ + 852, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ + 1527, /* GL_SUBPIXEL_BITS */ + 630, /* GL_INDEX_BITS */ + 1301, /* GL_RED_BITS */ + 595, /* GL_GREEN_BITS */ 92, /* GL_BLUE_BITS */ 41, /* GL_ALPHA_BITS */ 351, /* GL_DEPTH_BITS */ - 1495, /* GL_STENCIL_BITS */ + 1499, /* GL_STENCIL_BITS */ 14, /* GL_ACCUM_RED_BITS */ 13, /* GL_ACCUM_GREEN_BITS */ 10, /* GL_ACCUM_BLUE_BITS */ 9, /* GL_ACCUM_ALPHA_BITS */ - 1001, /* GL_NAME_STACK_DEPTH */ + 1003, /* GL_NAME_STACK_DEPTH */ 62, /* GL_AUTO_NORMAL */ - 737, /* GL_MAP1_COLOR_4 */ - 740, /* GL_MAP1_INDEX */ - 741, /* GL_MAP1_NORMAL */ - 742, /* GL_MAP1_TEXTURE_COORD_1 */ - 743, /* GL_MAP1_TEXTURE_COORD_2 */ - 744, /* GL_MAP1_TEXTURE_COORD_3 */ - 745, /* GL_MAP1_TEXTURE_COORD_4 */ - 746, /* GL_MAP1_VERTEX_3 */ - 747, /* GL_MAP1_VERTEX_4 */ - 764, /* GL_MAP2_COLOR_4 */ - 767, /* GL_MAP2_INDEX */ - 768, /* GL_MAP2_NORMAL */ - 769, /* GL_MAP2_TEXTURE_COORD_1 */ - 770, /* GL_MAP2_TEXTURE_COORD_2 */ - 771, /* GL_MAP2_TEXTURE_COORD_3 */ - 772, /* GL_MAP2_TEXTURE_COORD_4 */ - 773, /* GL_MAP2_VERTEX_3 */ - 774, /* GL_MAP2_VERTEX_4 */ - 738, /* GL_MAP1_GRID_DOMAIN */ - 739, /* GL_MAP1_GRID_SEGMENTS */ - 765, /* GL_MAP2_GRID_DOMAIN */ - 766, /* GL_MAP2_GRID_SEGMENTS */ - 1606, /* GL_TEXTURE_1D */ - 1608, /* GL_TEXTURE_2D */ + 739, /* GL_MAP1_COLOR_4 */ + 742, /* GL_MAP1_INDEX */ + 743, /* GL_MAP1_NORMAL */ + 744, /* GL_MAP1_TEXTURE_COORD_1 */ + 745, /* GL_MAP1_TEXTURE_COORD_2 */ + 746, /* GL_MAP1_TEXTURE_COORD_3 */ + 747, /* GL_MAP1_TEXTURE_COORD_4 */ + 748, /* GL_MAP1_VERTEX_3 */ + 749, /* GL_MAP1_VERTEX_4 */ + 766, /* GL_MAP2_COLOR_4 */ + 769, /* GL_MAP2_INDEX */ + 770, /* GL_MAP2_NORMAL */ + 771, /* GL_MAP2_TEXTURE_COORD_1 */ + 772, /* GL_MAP2_TEXTURE_COORD_2 */ + 773, /* GL_MAP2_TEXTURE_COORD_3 */ + 774, /* GL_MAP2_TEXTURE_COORD_4 */ + 775, /* GL_MAP2_VERTEX_3 */ + 776, /* GL_MAP2_VERTEX_4 */ + 740, /* GL_MAP1_GRID_DOMAIN */ + 741, /* GL_MAP1_GRID_SEGMENTS */ + 767, /* GL_MAP2_GRID_DOMAIN */ + 768, /* GL_MAP2_GRID_SEGMENTS */ + 1610, /* GL_TEXTURE_1D */ + 1612, /* GL_TEXTURE_2D */ 479, /* GL_FEEDBACK_BUFFER_POINTER */ 480, /* GL_FEEDBACK_BUFFER_SIZE */ 481, /* GL_FEEDBACK_BUFFER_TYPE */ - 1406, /* GL_SELECTION_BUFFER_POINTER */ - 1407, /* GL_SELECTION_BUFFER_SIZE */ - 1724, /* GL_TEXTURE_WIDTH */ - 1688, /* GL_TEXTURE_HEIGHT */ - 1643, /* GL_TEXTURE_COMPONENTS */ - 1627, /* GL_TEXTURE_BORDER_COLOR */ - 1626, /* GL_TEXTURE_BORDER */ + 1410, /* GL_SELECTION_BUFFER_POINTER */ + 1411, /* GL_SELECTION_BUFFER_SIZE */ + 1728, /* GL_TEXTURE_WIDTH */ + 1692, /* GL_TEXTURE_HEIGHT */ + 1647, /* GL_TEXTURE_COMPONENTS */ + 1631, /* GL_TEXTURE_BORDER_COLOR */ + 1630, /* GL_TEXTURE_BORDER */ 383, /* GL_DONT_CARE */ 477, /* GL_FASTEST */ - 1009, /* GL_NICEST */ + 1011, /* GL_NICEST */ 48, /* GL_AMBIENT */ 380, /* GL_DIFFUSE */ - 1455, /* GL_SPECULAR */ - 1173, /* GL_POSITION */ - 1458, /* GL_SPOT_DIRECTION */ - 1459, /* GL_SPOT_EXPONENT */ - 1457, /* GL_SPOT_CUTOFF */ + 1459, /* GL_SPECULAR */ + 1175, /* GL_POSITION */ + 1462, /* GL_SPOT_DIRECTION */ + 1463, /* GL_SPOT_EXPONENT */ + 1461, /* GL_SPOT_CUTOFF */ 275, /* GL_CONSTANT_ATTENUATION */ - 687, /* GL_LINEAR_ATTENUATION */ - 1271, /* GL_QUADRATIC_ATTENUATION */ + 689, /* GL_LINEAR_ATTENUATION */ + 1274, /* GL_QUADRATIC_ATTENUATION */ 244, /* GL_COMPILE */ 245, /* GL_COMPILE_AND_EXECUTE */ 120, /* GL_BYTE */ - 1758, /* GL_UNSIGNED_BYTE */ - 1420, /* GL_SHORT */ - 1769, /* GL_UNSIGNED_SHORT */ - 637, /* GL_INT */ - 1761, /* GL_UNSIGNED_INT */ - 485, /* GL_FLOAT */ + 1762, /* GL_UNSIGNED_BYTE */ + 1424, /* GL_SHORT */ + 1773, /* GL_UNSIGNED_SHORT */ + 638, /* GL_INT */ + 1765, /* GL_UNSIGNED_INT */ + 486, /* GL_FLOAT */ 1, /* GL_2_BYTES */ 5, /* GL_3_BYTES */ 7, /* GL_4_BYTES */ @@ -4081,284 +4089,284 @@ static const unsigned reduced_enums[1347] = 52, /* GL_AND_REVERSE */ 299, /* GL_COPY */ 51, /* GL_AND_INVERTED */ - 1011, /* GL_NOOP */ - 1852, /* GL_XOR */ - 1074, /* GL_OR */ - 1012, /* GL_NOR */ + 1013, /* GL_NOOP */ + 1856, /* GL_XOR */ + 1076, /* GL_OR */ + 1014, /* GL_NOR */ 467, /* GL_EQUIV */ - 664, /* GL_INVERT */ - 1077, /* GL_OR_REVERSE */ + 665, /* GL_INVERT */ + 1079, /* GL_OR_REVERSE */ 300, /* GL_COPY_INVERTED */ - 1076, /* GL_OR_INVERTED */ - 1002, /* GL_NAND */ - 1411, /* GL_SET */ + 1078, /* GL_OR_INVERTED */ + 1004, /* GL_NAND */ + 1415, /* GL_SET */ 464, /* GL_EMISSION */ - 1419, /* GL_SHININESS */ + 1423, /* GL_SHININESS */ 49, /* GL_AMBIENT_AND_DIFFUSE */ 190, /* GL_COLOR_INDEXES */ - 952, /* GL_MODELVIEW */ - 1249, /* GL_PROJECTION */ - 1541, /* GL_TEXTURE */ + 954, /* GL_MODELVIEW */ + 1251, /* GL_PROJECTION */ + 1545, /* GL_TEXTURE */ 147, /* GL_COLOR */ 346, /* GL_DEPTH */ - 1481, /* GL_STENCIL */ + 1485, /* GL_STENCIL */ 189, /* GL_COLOR_INDEX */ - 1500, /* GL_STENCIL_INDEX */ + 1504, /* GL_STENCIL_INDEX */ 358, /* GL_DEPTH_COMPONENT */ - 1293, /* GL_RED */ - 592, /* GL_GREEN */ + 1297, /* GL_RED */ + 593, /* GL_GREEN */ 90, /* GL_BLUE */ 31, /* GL_ALPHA */ - 1328, /* GL_RGB */ - 1347, /* GL_RGBA */ - 715, /* GL_LUMINANCE */ - 736, /* GL_LUMINANCE_ALPHA */ + 1332, /* GL_RGB */ + 1351, /* GL_RGBA */ + 717, /* GL_LUMINANCE */ + 738, /* GL_LUMINANCE_ALPHA */ 73, /* GL_BITMAP */ - 1129, /* GL_POINT */ - 685, /* GL_LINE */ + 1131, /* GL_POINT */ + 687, /* GL_LINE */ 482, /* GL_FILL */ - 1302, /* GL_RENDER */ + 1306, /* GL_RENDER */ 478, /* GL_FEEDBACK */ - 1405, /* GL_SELECT */ - 484, /* GL_FLAT */ - 1430, /* GL_SMOOTH */ - 665, /* GL_KEEP */ - 1322, /* GL_REPLACE */ - 619, /* GL_INCR */ + 1409, /* GL_SELECT */ + 485, /* GL_FLAT */ + 1434, /* GL_SMOOTH */ + 666, /* GL_KEEP */ + 1326, /* GL_REPLACE */ + 620, /* GL_INCR */ 342, /* GL_DECR */ - 1784, /* GL_VENDOR */ - 1319, /* GL_RENDERER */ - 1785, /* GL_VERSION */ + 1788, /* GL_VENDOR */ + 1323, /* GL_RENDERER */ + 1789, /* GL_VERSION */ 471, /* GL_EXTENSIONS */ - 1370, /* GL_S */ - 1532, /* GL_T */ - 1282, /* GL_R */ - 1270, /* GL_Q */ - 988, /* GL_MODULATE */ + 1374, /* GL_S */ + 1536, /* GL_T */ + 1286, /* GL_R */ + 1273, /* GL_Q */ + 990, /* GL_MODULATE */ 341, /* GL_DECAL */ - 1678, /* GL_TEXTURE_ENV_MODE */ - 1677, /* GL_TEXTURE_ENV_COLOR */ - 1676, /* GL_TEXTURE_ENV */ + 1682, /* GL_TEXTURE_ENV_MODE */ + 1681, /* GL_TEXTURE_ENV_COLOR */ + 1680, /* GL_TEXTURE_ENV */ 472, /* GL_EYE_LINEAR */ - 1035, /* GL_OBJECT_LINEAR */ - 1456, /* GL_SPHERE_MAP */ - 1680, /* GL_TEXTURE_GEN_MODE */ - 1037, /* GL_OBJECT_PLANE */ + 1037, /* GL_OBJECT_LINEAR */ + 1460, /* GL_SPHERE_MAP */ + 1684, /* GL_TEXTURE_GEN_MODE */ + 1039, /* GL_OBJECT_PLANE */ 473, /* GL_EYE_PLANE */ - 1003, /* GL_NEAREST */ - 686, /* GL_LINEAR */ - 1007, /* GL_NEAREST_MIPMAP_NEAREST */ - 691, /* GL_LINEAR_MIPMAP_NEAREST */ - 1006, /* GL_NEAREST_MIPMAP_LINEAR */ - 690, /* GL_LINEAR_MIPMAP_LINEAR */ - 1701, /* GL_TEXTURE_MAG_FILTER */ - 1709, /* GL_TEXTURE_MIN_FILTER */ - 1726, /* GL_TEXTURE_WRAP_S */ - 1727, /* GL_TEXTURE_WRAP_T */ + 1005, /* GL_NEAREST */ + 688, /* GL_LINEAR */ + 1009, /* GL_NEAREST_MIPMAP_NEAREST */ + 693, /* GL_LINEAR_MIPMAP_NEAREST */ + 1008, /* GL_NEAREST_MIPMAP_LINEAR */ + 692, /* GL_LINEAR_MIPMAP_LINEAR */ + 1705, /* GL_TEXTURE_MAG_FILTER */ + 1713, /* GL_TEXTURE_MIN_FILTER */ + 1730, /* GL_TEXTURE_WRAP_S */ + 1731, /* GL_TEXTURE_WRAP_T */ 126, /* GL_CLAMP */ - 1321, /* GL_REPEAT */ - 1167, /* GL_POLYGON_OFFSET_UNITS */ - 1166, /* GL_POLYGON_OFFSET_POINT */ - 1165, /* GL_POLYGON_OFFSET_LINE */ - 1283, /* GL_R3_G3_B2 */ - 1781, /* GL_V2F */ - 1782, /* GL_V3F */ + 1325, /* GL_REPEAT */ + 1169, /* GL_POLYGON_OFFSET_UNITS */ + 1168, /* GL_POLYGON_OFFSET_POINT */ + 1167, /* GL_POLYGON_OFFSET_LINE */ + 1287, /* GL_R3_G3_B2 */ + 1785, /* GL_V2F */ + 1786, /* GL_V3F */ 123, /* GL_C4UB_V2F */ 124, /* GL_C4UB_V3F */ 121, /* GL_C3F_V3F */ - 1000, /* GL_N3F_V3F */ + 1002, /* GL_N3F_V3F */ 122, /* GL_C4F_N3F_V3F */ - 1537, /* GL_T2F_V3F */ - 1539, /* GL_T4F_V4F */ - 1535, /* GL_T2F_C4UB_V3F */ - 1533, /* GL_T2F_C3F_V3F */ - 1536, /* GL_T2F_N3F_V3F */ - 1534, /* GL_T2F_C4F_N3F_V3F */ - 1538, /* GL_T4F_C4F_N3F_V4F */ + 1541, /* GL_T2F_V3F */ + 1543, /* GL_T4F_V4F */ + 1539, /* GL_T2F_C4UB_V3F */ + 1537, /* GL_T2F_C3F_V3F */ + 1540, /* GL_T2F_N3F_V3F */ + 1538, /* GL_T2F_C4F_N3F_V3F */ + 1542, /* GL_T4F_C4F_N3F_V4F */ 139, /* GL_CLIP_PLANE0 */ 140, /* GL_CLIP_PLANE1 */ 141, /* GL_CLIP_PLANE2 */ 142, /* GL_CLIP_PLANE3 */ 143, /* GL_CLIP_PLANE4 */ 144, /* GL_CLIP_PLANE5 */ - 670, /* GL_LIGHT0 */ - 671, /* GL_LIGHT1 */ - 672, /* GL_LIGHT2 */ - 673, /* GL_LIGHT3 */ - 674, /* GL_LIGHT4 */ - 675, /* GL_LIGHT5 */ - 676, /* GL_LIGHT6 */ - 677, /* GL_LIGHT7 */ - 596, /* GL_HINT_BIT */ + 672, /* GL_LIGHT0 */ + 673, /* GL_LIGHT1 */ + 674, /* GL_LIGHT2 */ + 675, /* GL_LIGHT3 */ + 676, /* GL_LIGHT4 */ + 677, /* GL_LIGHT5 */ + 678, /* GL_LIGHT6 */ + 679, /* GL_LIGHT7 */ + 597, /* GL_HINT_BIT */ 277, /* GL_CONSTANT_COLOR */ - 1048, /* GL_ONE_MINUS_CONSTANT_COLOR */ + 1050, /* GL_ONE_MINUS_CONSTANT_COLOR */ 272, /* GL_CONSTANT_ALPHA */ - 1046, /* GL_ONE_MINUS_CONSTANT_ALPHA */ + 1048, /* GL_ONE_MINUS_CONSTANT_ALPHA */ 76, /* GL_BLEND_COLOR */ - 580, /* GL_FUNC_ADD */ - 936, /* GL_MIN */ - 846, /* GL_MAX */ + 581, /* GL_FUNC_ADD */ + 938, /* GL_MIN */ + 848, /* GL_MAX */ 81, /* GL_BLEND_EQUATION */ - 584, /* GL_FUNC_SUBTRACT */ - 582, /* GL_FUNC_REVERSE_SUBTRACT */ + 585, /* GL_FUNC_SUBTRACT */ + 583, /* GL_FUNC_REVERSE_SUBTRACT */ 280, /* GL_CONVOLUTION_1D */ 281, /* GL_CONVOLUTION_2D */ - 1408, /* GL_SEPARABLE_2D */ + 1412, /* GL_SEPARABLE_2D */ 284, /* GL_CONVOLUTION_BORDER_MODE */ 288, /* GL_CONVOLUTION_FILTER_SCALE */ 286, /* GL_CONVOLUTION_FILTER_BIAS */ - 1294, /* GL_REDUCE */ + 1298, /* GL_REDUCE */ 290, /* GL_CONVOLUTION_FORMAT */ 294, /* GL_CONVOLUTION_WIDTH */ 292, /* GL_CONVOLUTION_HEIGHT */ - 861, /* GL_MAX_CONVOLUTION_WIDTH */ - 859, /* GL_MAX_CONVOLUTION_HEIGHT */ - 1206, /* GL_POST_CONVOLUTION_RED_SCALE */ - 1202, /* GL_POST_CONVOLUTION_GREEN_SCALE */ - 1197, /* GL_POST_CONVOLUTION_BLUE_SCALE */ - 1193, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ - 1204, /* GL_POST_CONVOLUTION_RED_BIAS */ - 1200, /* GL_POST_CONVOLUTION_GREEN_BIAS */ - 1195, /* GL_POST_CONVOLUTION_BLUE_BIAS */ - 1191, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ - 597, /* GL_HISTOGRAM */ - 1254, /* GL_PROXY_HISTOGRAM */ - 613, /* GL_HISTOGRAM_WIDTH */ - 603, /* GL_HISTOGRAM_FORMAT */ - 609, /* GL_HISTOGRAM_RED_SIZE */ - 605, /* GL_HISTOGRAM_GREEN_SIZE */ - 600, /* GL_HISTOGRAM_BLUE_SIZE */ - 598, /* GL_HISTOGRAM_ALPHA_SIZE */ - 607, /* GL_HISTOGRAM_LUMINANCE_SIZE */ - 611, /* GL_HISTOGRAM_SINK */ - 937, /* GL_MINMAX */ - 939, /* GL_MINMAX_FORMAT */ - 941, /* GL_MINMAX_SINK */ - 1540, /* GL_TABLE_TOO_LARGE_EXT */ - 1760, /* GL_UNSIGNED_BYTE_3_3_2 */ - 1771, /* GL_UNSIGNED_SHORT_4_4_4_4 */ - 1773, /* GL_UNSIGNED_SHORT_5_5_5_1 */ - 1766, /* GL_UNSIGNED_INT_8_8_8_8 */ - 1762, /* GL_UNSIGNED_INT_10_10_10_2 */ - 1164, /* GL_POLYGON_OFFSET_FILL */ - 1163, /* GL_POLYGON_OFFSET_FACTOR */ - 1162, /* GL_POLYGON_OFFSET_BIAS */ - 1325, /* GL_RESCALE_NORMAL */ + 863, /* GL_MAX_CONVOLUTION_WIDTH */ + 861, /* GL_MAX_CONVOLUTION_HEIGHT */ + 1208, /* GL_POST_CONVOLUTION_RED_SCALE */ + 1204, /* GL_POST_CONVOLUTION_GREEN_SCALE */ + 1199, /* GL_POST_CONVOLUTION_BLUE_SCALE */ + 1195, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ + 1206, /* GL_POST_CONVOLUTION_RED_BIAS */ + 1202, /* GL_POST_CONVOLUTION_GREEN_BIAS */ + 1197, /* GL_POST_CONVOLUTION_BLUE_BIAS */ + 1193, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ + 598, /* GL_HISTOGRAM */ + 1257, /* GL_PROXY_HISTOGRAM */ + 614, /* GL_HISTOGRAM_WIDTH */ + 604, /* GL_HISTOGRAM_FORMAT */ + 610, /* GL_HISTOGRAM_RED_SIZE */ + 606, /* GL_HISTOGRAM_GREEN_SIZE */ + 601, /* GL_HISTOGRAM_BLUE_SIZE */ + 599, /* GL_HISTOGRAM_ALPHA_SIZE */ + 608, /* GL_HISTOGRAM_LUMINANCE_SIZE */ + 612, /* GL_HISTOGRAM_SINK */ + 939, /* GL_MINMAX */ + 941, /* GL_MINMAX_FORMAT */ + 943, /* GL_MINMAX_SINK */ + 1544, /* GL_TABLE_TOO_LARGE_EXT */ + 1764, /* GL_UNSIGNED_BYTE_3_3_2 */ + 1775, /* GL_UNSIGNED_SHORT_4_4_4_4 */ + 1777, /* GL_UNSIGNED_SHORT_5_5_5_1 */ + 1770, /* GL_UNSIGNED_INT_8_8_8_8 */ + 1766, /* GL_UNSIGNED_INT_10_10_10_2 */ + 1166, /* GL_POLYGON_OFFSET_FILL */ + 1165, /* GL_POLYGON_OFFSET_FACTOR */ + 1164, /* GL_POLYGON_OFFSET_BIAS */ + 1329, /* GL_RESCALE_NORMAL */ 36, /* GL_ALPHA4 */ 38, /* GL_ALPHA8 */ 32, /* GL_ALPHA12 */ 34, /* GL_ALPHA16 */ - 726, /* GL_LUMINANCE4 */ - 732, /* GL_LUMINANCE8 */ - 716, /* GL_LUMINANCE12 */ - 722, /* GL_LUMINANCE16 */ - 727, /* GL_LUMINANCE4_ALPHA4 */ - 730, /* GL_LUMINANCE6_ALPHA2 */ - 733, /* GL_LUMINANCE8_ALPHA8 */ - 719, /* GL_LUMINANCE12_ALPHA4 */ - 717, /* GL_LUMINANCE12_ALPHA12 */ - 723, /* GL_LUMINANCE16_ALPHA16 */ - 638, /* GL_INTENSITY */ - 643, /* GL_INTENSITY4 */ - 645, /* GL_INTENSITY8 */ - 639, /* GL_INTENSITY12 */ - 641, /* GL_INTENSITY16 */ - 1337, /* GL_RGB2_EXT */ - 1338, /* GL_RGB4 */ - 1341, /* GL_RGB5 */ - 1345, /* GL_RGB8 */ - 1329, /* GL_RGB10 */ - 1333, /* GL_RGB12 */ - 1335, /* GL_RGB16 */ - 1352, /* GL_RGBA2 */ - 1354, /* GL_RGBA4 */ - 1342, /* GL_RGB5_A1 */ - 1358, /* GL_RGBA8 */ - 1330, /* GL_RGB10_A2 */ - 1348, /* GL_RGBA12 */ - 1350, /* GL_RGBA16 */ - 1716, /* GL_TEXTURE_RED_SIZE */ - 1686, /* GL_TEXTURE_GREEN_SIZE */ - 1624, /* GL_TEXTURE_BLUE_SIZE */ - 1611, /* GL_TEXTURE_ALPHA_SIZE */ - 1699, /* GL_TEXTURE_LUMINANCE_SIZE */ - 1690, /* GL_TEXTURE_INTENSITY_SIZE */ - 1323, /* GL_REPLACE_EXT */ - 1258, /* GL_PROXY_TEXTURE_1D */ - 1261, /* GL_PROXY_TEXTURE_2D */ - 1722, /* GL_TEXTURE_TOO_LARGE_EXT */ - 1711, /* GL_TEXTURE_PRIORITY */ - 1718, /* GL_TEXTURE_RESIDENT */ - 1614, /* GL_TEXTURE_BINDING_1D */ - 1616, /* GL_TEXTURE_BINDING_2D */ - 1618, /* GL_TEXTURE_BINDING_3D */ - 1084, /* GL_PACK_SKIP_IMAGES */ - 1080, /* GL_PACK_IMAGE_HEIGHT */ - 1753, /* GL_UNPACK_SKIP_IMAGES */ - 1750, /* GL_UNPACK_IMAGE_HEIGHT */ - 1610, /* GL_TEXTURE_3D */ - 1264, /* GL_PROXY_TEXTURE_3D */ - 1673, /* GL_TEXTURE_DEPTH */ - 1725, /* GL_TEXTURE_WRAP_R */ - 847, /* GL_MAX_3D_TEXTURE_SIZE */ - 1786, /* GL_VERTEX_ARRAY */ - 1014, /* GL_NORMAL_ARRAY */ + 728, /* GL_LUMINANCE4 */ + 734, /* GL_LUMINANCE8 */ + 718, /* GL_LUMINANCE12 */ + 724, /* GL_LUMINANCE16 */ + 729, /* GL_LUMINANCE4_ALPHA4 */ + 732, /* GL_LUMINANCE6_ALPHA2 */ + 735, /* GL_LUMINANCE8_ALPHA8 */ + 721, /* GL_LUMINANCE12_ALPHA4 */ + 719, /* GL_LUMINANCE12_ALPHA12 */ + 725, /* GL_LUMINANCE16_ALPHA16 */ + 639, /* GL_INTENSITY */ + 644, /* GL_INTENSITY4 */ + 646, /* GL_INTENSITY8 */ + 640, /* GL_INTENSITY12 */ + 642, /* GL_INTENSITY16 */ + 1341, /* GL_RGB2_EXT */ + 1342, /* GL_RGB4 */ + 1345, /* GL_RGB5 */ + 1349, /* GL_RGB8 */ + 1333, /* GL_RGB10 */ + 1337, /* GL_RGB12 */ + 1339, /* GL_RGB16 */ + 1356, /* GL_RGBA2 */ + 1358, /* GL_RGBA4 */ + 1346, /* GL_RGB5_A1 */ + 1362, /* GL_RGBA8 */ + 1334, /* GL_RGB10_A2 */ + 1352, /* GL_RGBA12 */ + 1354, /* GL_RGBA16 */ + 1720, /* GL_TEXTURE_RED_SIZE */ + 1690, /* GL_TEXTURE_GREEN_SIZE */ + 1628, /* GL_TEXTURE_BLUE_SIZE */ + 1615, /* GL_TEXTURE_ALPHA_SIZE */ + 1703, /* GL_TEXTURE_LUMINANCE_SIZE */ + 1694, /* GL_TEXTURE_INTENSITY_SIZE */ + 1327, /* GL_REPLACE_EXT */ + 1261, /* GL_PROXY_TEXTURE_1D */ + 1264, /* GL_PROXY_TEXTURE_2D */ + 1726, /* GL_TEXTURE_TOO_LARGE_EXT */ + 1715, /* GL_TEXTURE_PRIORITY */ + 1722, /* GL_TEXTURE_RESIDENT */ + 1618, /* GL_TEXTURE_BINDING_1D */ + 1620, /* GL_TEXTURE_BINDING_2D */ + 1622, /* GL_TEXTURE_BINDING_3D */ + 1086, /* GL_PACK_SKIP_IMAGES */ + 1082, /* GL_PACK_IMAGE_HEIGHT */ + 1757, /* GL_UNPACK_SKIP_IMAGES */ + 1754, /* GL_UNPACK_IMAGE_HEIGHT */ + 1614, /* GL_TEXTURE_3D */ + 1267, /* GL_PROXY_TEXTURE_3D */ + 1677, /* GL_TEXTURE_DEPTH */ + 1729, /* GL_TEXTURE_WRAP_R */ + 849, /* GL_MAX_3D_TEXTURE_SIZE */ + 1790, /* GL_VERTEX_ARRAY */ + 1016, /* GL_NORMAL_ARRAY */ 148, /* GL_COLOR_ARRAY */ - 623, /* GL_INDEX_ARRAY */ - 1651, /* GL_TEXTURE_COORD_ARRAY */ + 624, /* GL_INDEX_ARRAY */ + 1655, /* GL_TEXTURE_COORD_ARRAY */ 456, /* GL_EDGE_FLAG_ARRAY */ - 1792, /* GL_VERTEX_ARRAY_SIZE */ - 1794, /* GL_VERTEX_ARRAY_TYPE */ - 1793, /* GL_VERTEX_ARRAY_STRIDE */ - 1019, /* GL_NORMAL_ARRAY_TYPE */ - 1018, /* GL_NORMAL_ARRAY_STRIDE */ + 1796, /* GL_VERTEX_ARRAY_SIZE */ + 1798, /* GL_VERTEX_ARRAY_TYPE */ + 1797, /* GL_VERTEX_ARRAY_STRIDE */ + 1021, /* GL_NORMAL_ARRAY_TYPE */ + 1020, /* GL_NORMAL_ARRAY_STRIDE */ 152, /* GL_COLOR_ARRAY_SIZE */ 154, /* GL_COLOR_ARRAY_TYPE */ 153, /* GL_COLOR_ARRAY_STRIDE */ - 628, /* GL_INDEX_ARRAY_TYPE */ - 627, /* GL_INDEX_ARRAY_STRIDE */ - 1655, /* GL_TEXTURE_COORD_ARRAY_SIZE */ - 1657, /* GL_TEXTURE_COORD_ARRAY_TYPE */ - 1656, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ + 629, /* GL_INDEX_ARRAY_TYPE */ + 628, /* GL_INDEX_ARRAY_STRIDE */ + 1659, /* GL_TEXTURE_COORD_ARRAY_SIZE */ + 1661, /* GL_TEXTURE_COORD_ARRAY_TYPE */ + 1660, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ 460, /* GL_EDGE_FLAG_ARRAY_STRIDE */ - 1791, /* GL_VERTEX_ARRAY_POINTER */ - 1017, /* GL_NORMAL_ARRAY_POINTER */ + 1795, /* GL_VERTEX_ARRAY_POINTER */ + 1019, /* GL_NORMAL_ARRAY_POINTER */ 151, /* GL_COLOR_ARRAY_POINTER */ - 626, /* GL_INDEX_ARRAY_POINTER */ - 1654, /* GL_TEXTURE_COORD_ARRAY_POINTER */ + 627, /* GL_INDEX_ARRAY_POINTER */ + 1658, /* GL_TEXTURE_COORD_ARRAY_POINTER */ 459, /* GL_EDGE_FLAG_ARRAY_POINTER */ - 993, /* GL_MULTISAMPLE */ - 1382, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ - 1384, /* GL_SAMPLE_ALPHA_TO_ONE */ - 1389, /* GL_SAMPLE_COVERAGE */ - 1386, /* GL_SAMPLE_BUFFERS */ - 1377, /* GL_SAMPLES */ - 1393, /* GL_SAMPLE_COVERAGE_VALUE */ - 1391, /* GL_SAMPLE_COVERAGE_INVERT */ + 995, /* GL_MULTISAMPLE */ + 1386, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ + 1388, /* GL_SAMPLE_ALPHA_TO_ONE */ + 1393, /* GL_SAMPLE_COVERAGE */ + 1390, /* GL_SAMPLE_BUFFERS */ + 1381, /* GL_SAMPLES */ + 1397, /* GL_SAMPLE_COVERAGE_VALUE */ + 1395, /* GL_SAMPLE_COVERAGE_INVERT */ 195, /* GL_COLOR_MATRIX */ 197, /* GL_COLOR_MATRIX_STACK_DEPTH */ - 855, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ - 1189, /* GL_POST_COLOR_MATRIX_RED_SCALE */ - 1185, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ - 1180, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ - 1176, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ - 1187, /* GL_POST_COLOR_MATRIX_RED_BIAS */ - 1183, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ - 1178, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ - 1174, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ - 1634, /* GL_TEXTURE_COLOR_TABLE_SGI */ - 1265, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ - 1636, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + 857, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ + 1191, /* GL_POST_COLOR_MATRIX_RED_SCALE */ + 1187, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ + 1182, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ + 1178, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ + 1189, /* GL_POST_COLOR_MATRIX_RED_BIAS */ + 1185, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ + 1180, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ + 1176, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ + 1638, /* GL_TEXTURE_COLOR_TABLE_SGI */ + 1268, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ + 1640, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ 80, /* GL_BLEND_DST_RGB */ 89, /* GL_BLEND_SRC_RGB */ 79, /* GL_BLEND_DST_ALPHA */ 88, /* GL_BLEND_SRC_ALPHA */ 201, /* GL_COLOR_TABLE */ - 1199, /* GL_POST_CONVOLUTION_COLOR_TABLE */ - 1182, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ - 1253, /* GL_PROXY_COLOR_TABLE */ - 1257, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ - 1256, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ + 1201, /* GL_POST_CONVOLUTION_COLOR_TABLE */ + 1184, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ + 1256, /* GL_PROXY_COLOR_TABLE */ + 1260, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ + 1259, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ 225, /* GL_COLOR_TABLE_SCALE */ 205, /* GL_COLOR_TABLE_BIAS */ 210, /* GL_COLOR_TABLE_FORMAT */ @@ -4371,380 +4379,380 @@ static const unsigned reduced_enums[1347] = 216, /* GL_COLOR_TABLE_INTENSITY_SIZE */ 71, /* GL_BGR */ 72, /* GL_BGRA */ - 869, /* GL_MAX_ELEMENTS_VERTICES */ - 868, /* GL_MAX_ELEMENTS_INDICES */ - 1689, /* GL_TEXTURE_INDEX_SIZE_EXT */ + 871, /* GL_MAX_ELEMENTS_VERTICES */ + 870, /* GL_MAX_ELEMENTS_INDICES */ + 1693, /* GL_TEXTURE_INDEX_SIZE_EXT */ 145, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */ - 1146, /* GL_POINT_SIZE_MIN */ - 1142, /* GL_POINT_SIZE_MAX */ - 1136, /* GL_POINT_FADE_THRESHOLD_SIZE */ - 1132, /* GL_POINT_DISTANCE_ATTENUATION */ + 1148, /* GL_POINT_SIZE_MIN */ + 1144, /* GL_POINT_SIZE_MAX */ + 1138, /* GL_POINT_FADE_THRESHOLD_SIZE */ + 1134, /* GL_POINT_DISTANCE_ATTENUATION */ 127, /* GL_CLAMP_TO_BORDER */ 130, /* GL_CLAMP_TO_EDGE */ - 1710, /* GL_TEXTURE_MIN_LOD */ - 1708, /* GL_TEXTURE_MAX_LOD */ - 1613, /* GL_TEXTURE_BASE_LEVEL */ - 1707, /* GL_TEXTURE_MAX_LEVEL */ - 616, /* GL_IGNORE_BORDER_HP */ + 1714, /* GL_TEXTURE_MIN_LOD */ + 1712, /* GL_TEXTURE_MAX_LOD */ + 1617, /* GL_TEXTURE_BASE_LEVEL */ + 1711, /* GL_TEXTURE_MAX_LEVEL */ + 617, /* GL_IGNORE_BORDER_HP */ 276, /* GL_CONSTANT_BORDER_HP */ - 1324, /* GL_REPLICATE_BORDER_HP */ + 1328, /* GL_REPLICATE_BORDER_HP */ 282, /* GL_CONVOLUTION_BORDER_COLOR */ - 1043, /* GL_OCCLUSION_TEST_HP */ - 1044, /* GL_OCCLUSION_TEST_RESULT_HP */ - 688, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ - 1628, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ - 1630, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ - 1632, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ - 1633, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - 1631, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ - 1629, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ - 851, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ - 852, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - 1209, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ - 1211, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ - 1208, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ - 1210, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ - 1697, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ - 1698, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ - 1696, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ - 586, /* GL_GENERATE_MIPMAP */ - 587, /* GL_GENERATE_MIPMAP_HINT */ - 528, /* GL_FOG_OFFSET_SGIX */ - 529, /* GL_FOG_OFFSET_VALUE_SGIX */ - 1642, /* GL_TEXTURE_COMPARE_SGIX */ - 1641, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ - 1693, /* GL_TEXTURE_LEQUAL_R_SGIX */ - 1685, /* GL_TEXTURE_GEQUAL_R_SGIX */ + 1045, /* GL_OCCLUSION_TEST_HP */ + 1046, /* GL_OCCLUSION_TEST_RESULT_HP */ + 690, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ + 1632, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ + 1634, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ + 1636, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ + 1637, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + 1635, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ + 1633, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ + 853, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ + 854, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + 1211, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ + 1213, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ + 1210, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ + 1212, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ + 1701, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ + 1702, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ + 1700, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ + 587, /* GL_GENERATE_MIPMAP */ + 588, /* GL_GENERATE_MIPMAP_HINT */ + 529, /* GL_FOG_OFFSET_SGIX */ + 530, /* GL_FOG_OFFSET_VALUE_SGIX */ + 1646, /* GL_TEXTURE_COMPARE_SGIX */ + 1645, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ + 1697, /* GL_TEXTURE_LEQUAL_R_SGIX */ + 1689, /* GL_TEXTURE_GEQUAL_R_SGIX */ 359, /* GL_DEPTH_COMPONENT16 */ 362, /* GL_DEPTH_COMPONENT24 */ 365, /* GL_DEPTH_COMPONENT32 */ 306, /* GL_CULL_VERTEX_EXT */ 308, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ 307, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ - 1849, /* GL_WRAP_BORDER_SUN */ - 1635, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ - 681, /* GL_LIGHT_MODEL_COLOR_CONTROL */ - 1423, /* GL_SINGLE_COLOR */ - 1409, /* GL_SEPARATE_SPECULAR_COLOR */ - 1418, /* GL_SHARED_TEXTURE_PALETTE_EXT */ - 539, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ - 540, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ - 547, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ - 542, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ - 538, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ - 537, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ - 541, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ - 548, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ - 559, /* GL_FRAMEBUFFER_DEFAULT */ - 572, /* GL_FRAMEBUFFER_UNDEFINED */ + 1853, /* GL_WRAP_BORDER_SUN */ + 1639, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ + 683, /* GL_LIGHT_MODEL_COLOR_CONTROL */ + 1427, /* GL_SINGLE_COLOR */ + 1413, /* GL_SEPARATE_SPECULAR_COLOR */ + 1422, /* GL_SHARED_TEXTURE_PALETTE_EXT */ + 540, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ + 541, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ + 548, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ + 543, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ + 539, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ + 538, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ + 542, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ + 549, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ + 560, /* GL_FRAMEBUFFER_DEFAULT */ + 573, /* GL_FRAMEBUFFER_UNDEFINED */ 372, /* GL_DEPTH_STENCIL_ATTACHMENT */ - 622, /* GL_INDEX */ - 1759, /* GL_UNSIGNED_BYTE_2_3_3_REV */ - 1774, /* GL_UNSIGNED_SHORT_5_6_5 */ - 1775, /* GL_UNSIGNED_SHORT_5_6_5_REV */ - 1772, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ - 1770, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ - 1767, /* GL_UNSIGNED_INT_8_8_8_8_REV */ - 1765, /* GL_UNSIGNED_INT_2_10_10_10_REV */ - 1705, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ - 1706, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ - 1704, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ - 944, /* GL_MIRRORED_REPEAT */ - 1365, /* GL_RGB_S3TC */ - 1340, /* GL_RGB4_S3TC */ - 1363, /* GL_RGBA_S3TC */ - 1357, /* GL_RGBA4_S3TC */ - 1361, /* GL_RGBA_DXT5_S3TC */ - 1355, /* GL_RGBA4_DXT5_S3TC */ + 623, /* GL_INDEX */ + 1763, /* GL_UNSIGNED_BYTE_2_3_3_REV */ + 1778, /* GL_UNSIGNED_SHORT_5_6_5 */ + 1779, /* GL_UNSIGNED_SHORT_5_6_5_REV */ + 1776, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ + 1774, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ + 1771, /* GL_UNSIGNED_INT_8_8_8_8_REV */ + 1769, /* GL_UNSIGNED_INT_2_10_10_10_REV */ + 1709, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ + 1710, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ + 1708, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ + 946, /* GL_MIRRORED_REPEAT */ + 1369, /* GL_RGB_S3TC */ + 1344, /* GL_RGB4_S3TC */ + 1367, /* GL_RGBA_S3TC */ + 1361, /* GL_RGBA4_S3TC */ + 1365, /* GL_RGBA_DXT5_S3TC */ + 1359, /* GL_RGBA4_DXT5_S3TC */ 264, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */ 259, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */ 260, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */ 261, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */ - 1005, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ - 1004, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ - 689, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ - 515, /* GL_FOG_COORDINATE_SOURCE */ - 507, /* GL_FOG_COORD */ - 531, /* GL_FRAGMENT_DEPTH */ + 1007, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ + 1006, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ + 691, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ + 516, /* GL_FOG_COORDINATE_SOURCE */ + 508, /* GL_FOG_COORD */ + 532, /* GL_FRAGMENT_DEPTH */ 312, /* GL_CURRENT_FOG_COORD */ - 514, /* GL_FOG_COORDINATE_ARRAY_TYPE */ - 513, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ - 512, /* GL_FOG_COORDINATE_ARRAY_POINTER */ - 509, /* GL_FOG_COORDINATE_ARRAY */ + 515, /* GL_FOG_COORDINATE_ARRAY_TYPE */ + 514, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ + 513, /* GL_FOG_COORDINATE_ARRAY_POINTER */ + 510, /* GL_FOG_COORDINATE_ARRAY */ 199, /* GL_COLOR_SUM */ 332, /* GL_CURRENT_SECONDARY_COLOR */ - 1402, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ - 1404, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ - 1403, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ - 1401, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ - 1398, /* GL_SECONDARY_COLOR_ARRAY */ + 1406, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ + 1408, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ + 1407, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ + 1405, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ + 1402, /* GL_SECONDARY_COLOR_ARRAY */ 330, /* GL_CURRENT_RASTER_SECONDARY_COLOR */ 28, /* GL_ALIASED_POINT_SIZE_RANGE */ 27, /* GL_ALIASED_LINE_WIDTH_RANGE */ - 1542, /* GL_TEXTURE0 */ - 1544, /* GL_TEXTURE1 */ - 1566, /* GL_TEXTURE2 */ - 1588, /* GL_TEXTURE3 */ - 1594, /* GL_TEXTURE4 */ - 1596, /* GL_TEXTURE5 */ - 1598, /* GL_TEXTURE6 */ - 1600, /* GL_TEXTURE7 */ - 1602, /* GL_TEXTURE8 */ - 1604, /* GL_TEXTURE9 */ - 1545, /* GL_TEXTURE10 */ - 1547, /* GL_TEXTURE11 */ - 1549, /* GL_TEXTURE12 */ - 1551, /* GL_TEXTURE13 */ - 1553, /* GL_TEXTURE14 */ - 1555, /* GL_TEXTURE15 */ - 1557, /* GL_TEXTURE16 */ - 1559, /* GL_TEXTURE17 */ - 1561, /* GL_TEXTURE18 */ - 1563, /* GL_TEXTURE19 */ - 1567, /* GL_TEXTURE20 */ - 1569, /* GL_TEXTURE21 */ - 1571, /* GL_TEXTURE22 */ - 1573, /* GL_TEXTURE23 */ - 1575, /* GL_TEXTURE24 */ - 1577, /* GL_TEXTURE25 */ - 1579, /* GL_TEXTURE26 */ - 1581, /* GL_TEXTURE27 */ - 1583, /* GL_TEXTURE28 */ - 1585, /* GL_TEXTURE29 */ - 1589, /* GL_TEXTURE30 */ - 1591, /* GL_TEXTURE31 */ + 1546, /* GL_TEXTURE0 */ + 1548, /* GL_TEXTURE1 */ + 1570, /* GL_TEXTURE2 */ + 1592, /* GL_TEXTURE3 */ + 1598, /* GL_TEXTURE4 */ + 1600, /* GL_TEXTURE5 */ + 1602, /* GL_TEXTURE6 */ + 1604, /* GL_TEXTURE7 */ + 1606, /* GL_TEXTURE8 */ + 1608, /* GL_TEXTURE9 */ + 1549, /* GL_TEXTURE10 */ + 1551, /* GL_TEXTURE11 */ + 1553, /* GL_TEXTURE12 */ + 1555, /* GL_TEXTURE13 */ + 1557, /* GL_TEXTURE14 */ + 1559, /* GL_TEXTURE15 */ + 1561, /* GL_TEXTURE16 */ + 1563, /* GL_TEXTURE17 */ + 1565, /* GL_TEXTURE18 */ + 1567, /* GL_TEXTURE19 */ + 1571, /* GL_TEXTURE20 */ + 1573, /* GL_TEXTURE21 */ + 1575, /* GL_TEXTURE22 */ + 1577, /* GL_TEXTURE23 */ + 1579, /* GL_TEXTURE24 */ + 1581, /* GL_TEXTURE25 */ + 1583, /* GL_TEXTURE26 */ + 1585, /* GL_TEXTURE27 */ + 1587, /* GL_TEXTURE28 */ + 1589, /* GL_TEXTURE29 */ + 1593, /* GL_TEXTURE30 */ + 1595, /* GL_TEXTURE31 */ 18, /* GL_ACTIVE_TEXTURE */ 133, /* GL_CLIENT_ACTIVE_TEXTURE */ - 922, /* GL_MAX_TEXTURE_UNITS */ - 1737, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ - 1740, /* GL_TRANSPOSE_PROJECTION_MATRIX */ - 1742, /* GL_TRANSPOSE_TEXTURE_MATRIX */ - 1734, /* GL_TRANSPOSE_COLOR_MATRIX */ - 1524, /* GL_SUBTRACT */ - 909, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ + 924, /* GL_MAX_TEXTURE_UNITS */ + 1741, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ + 1744, /* GL_TRANSPOSE_PROJECTION_MATRIX */ + 1746, /* GL_TRANSPOSE_TEXTURE_MATRIX */ + 1738, /* GL_TRANSPOSE_COLOR_MATRIX */ + 1528, /* GL_SUBTRACT */ + 911, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ 247, /* GL_COMPRESSED_ALPHA */ 251, /* GL_COMPRESSED_LUMINANCE */ 252, /* GL_COMPRESSED_LUMINANCE_ALPHA */ 249, /* GL_COMPRESSED_INTENSITY */ 255, /* GL_COMPRESSED_RGB */ 256, /* GL_COMPRESSED_RGBA */ - 1649, /* GL_TEXTURE_COMPRESSION_HINT */ - 1714, /* GL_TEXTURE_RECTANGLE_ARB */ - 1621, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ - 1268, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ - 907, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ + 1653, /* GL_TEXTURE_COMPRESSION_HINT */ + 1718, /* GL_TEXTURE_RECTANGLE_ARB */ + 1625, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ + 1271, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ + 909, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ 371, /* GL_DEPTH_STENCIL */ - 1763, /* GL_UNSIGNED_INT_24_8 */ - 918, /* GL_MAX_TEXTURE_LOD_BIAS */ - 1703, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ - 919, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ - 1679, /* GL_TEXTURE_FILTER_CONTROL */ - 1694, /* GL_TEXTURE_LOD_BIAS */ + 1767, /* GL_UNSIGNED_INT_24_8 */ + 920, /* GL_MAX_TEXTURE_LOD_BIAS */ + 1707, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ + 921, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ + 1683, /* GL_TEXTURE_FILTER_CONTROL */ + 1698, /* GL_TEXTURE_LOD_BIAS */ 232, /* GL_COMBINE4 */ - 912, /* GL_MAX_SHININESS_NV */ - 913, /* GL_MAX_SPOT_EXPONENT_NV */ - 620, /* GL_INCR_WRAP */ + 914, /* GL_MAX_SHININESS_NV */ + 915, /* GL_MAX_SPOT_EXPONENT_NV */ + 621, /* GL_INCR_WRAP */ 343, /* GL_DECR_WRAP */ - 964, /* GL_MODELVIEW1_ARB */ - 1020, /* GL_NORMAL_MAP */ - 1299, /* GL_REFLECTION_MAP */ - 1658, /* GL_TEXTURE_CUBE_MAP */ - 1619, /* GL_TEXTURE_BINDING_CUBE_MAP */ - 1666, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ - 1660, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ - 1668, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ - 1662, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ - 1670, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ - 1664, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ - 1266, /* GL_PROXY_TEXTURE_CUBE_MAP */ - 863, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ - 999, /* GL_MULTISAMPLE_FILTER_HINT_NV */ - 523, /* GL_FOG_DISTANCE_MODE_NV */ + 966, /* GL_MODELVIEW1_ARB */ + 1022, /* GL_NORMAL_MAP */ + 1303, /* GL_REFLECTION_MAP */ + 1662, /* GL_TEXTURE_CUBE_MAP */ + 1623, /* GL_TEXTURE_BINDING_CUBE_MAP */ + 1670, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ + 1664, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ + 1672, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ + 1666, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ + 1674, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ + 1668, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ + 1269, /* GL_PROXY_TEXTURE_CUBE_MAP */ + 865, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ + 1001, /* GL_MULTISAMPLE_FILTER_HINT_NV */ + 524, /* GL_FOG_DISTANCE_MODE_NV */ 475, /* GL_EYE_RADIAL_NV */ 474, /* GL_EYE_PLANE_ABSOLUTE_NV */ 231, /* GL_COMBINE */ 238, /* GL_COMBINE_RGB */ 233, /* GL_COMBINE_ALPHA */ - 1366, /* GL_RGB_SCALE */ + 1370, /* GL_RGB_SCALE */ 24, /* GL_ADD_SIGNED */ - 648, /* GL_INTERPOLATE */ + 649, /* GL_INTERPOLATE */ 271, /* GL_CONSTANT */ - 1215, /* GL_PRIMARY_COLOR */ - 1212, /* GL_PREVIOUS */ - 1438, /* GL_SOURCE0_RGB */ - 1444, /* GL_SOURCE1_RGB */ - 1450, /* GL_SOURCE2_RGB */ - 1454, /* GL_SOURCE3_RGB_NV */ - 1435, /* GL_SOURCE0_ALPHA */ - 1441, /* GL_SOURCE1_ALPHA */ - 1447, /* GL_SOURCE2_ALPHA */ - 1453, /* GL_SOURCE3_ALPHA_NV */ - 1057, /* GL_OPERAND0_RGB */ - 1063, /* GL_OPERAND1_RGB */ - 1069, /* GL_OPERAND2_RGB */ - 1073, /* GL_OPERAND3_RGB_NV */ - 1054, /* GL_OPERAND0_ALPHA */ - 1060, /* GL_OPERAND1_ALPHA */ - 1066, /* GL_OPERAND2_ALPHA */ - 1072, /* GL_OPERAND3_ALPHA_NV */ - 1787, /* GL_VERTEX_ARRAY_BINDING */ - 1712, /* GL_TEXTURE_RANGE_LENGTH_APPLE */ - 1713, /* GL_TEXTURE_RANGE_POINTER_APPLE */ - 1853, /* GL_YCBCR_422_APPLE */ - 1776, /* GL_UNSIGNED_SHORT_8_8_APPLE */ - 1778, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ - 1721, /* GL_TEXTURE_STORAGE_HINT_APPLE */ - 1515, /* GL_STORAGE_PRIVATE_APPLE */ - 1514, /* GL_STORAGE_CACHED_APPLE */ - 1516, /* GL_STORAGE_SHARED_APPLE */ - 1425, /* GL_SLICE_ACCUM_SUN */ - 1274, /* GL_QUAD_MESH_SUN */ - 1746, /* GL_TRIANGLE_MESH_SUN */ - 1826, /* GL_VERTEX_PROGRAM_ARB */ - 1837, /* GL_VERTEX_STATE_PROGRAM_NV */ - 1813, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ - 1819, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ - 1821, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ - 1823, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ + 1217, /* GL_PRIMARY_COLOR */ + 1214, /* GL_PREVIOUS */ + 1442, /* GL_SOURCE0_RGB */ + 1448, /* GL_SOURCE1_RGB */ + 1454, /* GL_SOURCE2_RGB */ + 1458, /* GL_SOURCE3_RGB_NV */ + 1439, /* GL_SOURCE0_ALPHA */ + 1445, /* GL_SOURCE1_ALPHA */ + 1451, /* GL_SOURCE2_ALPHA */ + 1457, /* GL_SOURCE3_ALPHA_NV */ + 1059, /* GL_OPERAND0_RGB */ + 1065, /* GL_OPERAND1_RGB */ + 1071, /* GL_OPERAND2_RGB */ + 1075, /* GL_OPERAND3_RGB_NV */ + 1056, /* GL_OPERAND0_ALPHA */ + 1062, /* GL_OPERAND1_ALPHA */ + 1068, /* GL_OPERAND2_ALPHA */ + 1074, /* GL_OPERAND3_ALPHA_NV */ + 1791, /* GL_VERTEX_ARRAY_BINDING */ + 1716, /* GL_TEXTURE_RANGE_LENGTH_APPLE */ + 1717, /* GL_TEXTURE_RANGE_POINTER_APPLE */ + 1857, /* GL_YCBCR_422_APPLE */ + 1780, /* GL_UNSIGNED_SHORT_8_8_APPLE */ + 1782, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ + 1725, /* GL_TEXTURE_STORAGE_HINT_APPLE */ + 1519, /* GL_STORAGE_PRIVATE_APPLE */ + 1518, /* GL_STORAGE_CACHED_APPLE */ + 1520, /* GL_STORAGE_SHARED_APPLE */ + 1429, /* GL_SLICE_ACCUM_SUN */ + 1278, /* GL_QUAD_MESH_SUN */ + 1750, /* GL_TRIANGLE_MESH_SUN */ + 1830, /* GL_VERTEX_PROGRAM_ARB */ + 1841, /* GL_VERTEX_STATE_PROGRAM_NV */ + 1817, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ + 1823, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ + 1825, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ + 1827, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ 334, /* GL_CURRENT_VERTEX_ATTRIB */ - 1228, /* GL_PROGRAM_LENGTH_ARB */ - 1242, /* GL_PROGRAM_STRING_ARB */ - 986, /* GL_MODELVIEW_PROJECTION_NV */ - 615, /* GL_IDENTITY_NV */ - 662, /* GL_INVERSE_NV */ - 1739, /* GL_TRANSPOSE_NV */ - 663, /* GL_INVERSE_TRANSPOSE_NV */ - 893, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ - 892, /* GL_MAX_PROGRAM_MATRICES_ARB */ - 800, /* GL_MATRIX0_NV */ - 812, /* GL_MATRIX1_NV */ - 824, /* GL_MATRIX2_NV */ - 828, /* GL_MATRIX3_NV */ - 830, /* GL_MATRIX4_NV */ - 832, /* GL_MATRIX5_NV */ - 834, /* GL_MATRIX6_NV */ - 836, /* GL_MATRIX7_NV */ + 1230, /* GL_PROGRAM_LENGTH_ARB */ + 1244, /* GL_PROGRAM_STRING_ARB */ + 988, /* GL_MODELVIEW_PROJECTION_NV */ + 616, /* GL_IDENTITY_NV */ + 663, /* GL_INVERSE_NV */ + 1743, /* GL_TRANSPOSE_NV */ + 664, /* GL_INVERSE_TRANSPOSE_NV */ + 895, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ + 894, /* GL_MAX_PROGRAM_MATRICES_ARB */ + 802, /* GL_MATRIX0_NV */ + 814, /* GL_MATRIX1_NV */ + 826, /* GL_MATRIX2_NV */ + 830, /* GL_MATRIX3_NV */ + 832, /* GL_MATRIX4_NV */ + 834, /* GL_MATRIX5_NV */ + 836, /* GL_MATRIX6_NV */ + 838, /* GL_MATRIX7_NV */ 318, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ 315, /* GL_CURRENT_MATRIX_ARB */ - 1829, /* GL_VERTEX_PROGRAM_POINT_SIZE */ - 1832, /* GL_VERTEX_PROGRAM_TWO_SIDE */ - 1240, /* GL_PROGRAM_PARAMETER_NV */ - 1817, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ - 1244, /* GL_PROGRAM_TARGET_NV */ - 1241, /* GL_PROGRAM_RESIDENT_NV */ - 1731, /* GL_TRACK_MATRIX_NV */ - 1732, /* GL_TRACK_MATRIX_TRANSFORM_NV */ - 1827, /* GL_VERTEX_PROGRAM_BINDING_NV */ - 1222, /* GL_PROGRAM_ERROR_POSITION_ARB */ + 1833, /* GL_VERTEX_PROGRAM_POINT_SIZE */ + 1836, /* GL_VERTEX_PROGRAM_TWO_SIDE */ + 1242, /* GL_PROGRAM_PARAMETER_NV */ + 1821, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ + 1246, /* GL_PROGRAM_TARGET_NV */ + 1243, /* GL_PROGRAM_RESIDENT_NV */ + 1735, /* GL_TRACK_MATRIX_NV */ + 1736, /* GL_TRACK_MATRIX_TRANSFORM_NV */ + 1831, /* GL_VERTEX_PROGRAM_BINDING_NV */ + 1224, /* GL_PROGRAM_ERROR_POSITION_ARB */ 355, /* GL_DEPTH_CLAMP */ - 1795, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ - 1802, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ - 1803, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ - 1804, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ - 1805, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ - 1806, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ - 1807, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ - 1808, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ - 1809, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ - 1810, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ - 1796, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ - 1797, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ - 1798, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ - 1799, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ - 1800, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ - 1801, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ - 748, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ - 755, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ - 756, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ - 757, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ - 758, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ - 759, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ - 760, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ - 761, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ - 762, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ - 763, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ - 749, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ - 750, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ - 751, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ - 752, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ - 753, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ - 754, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ - 775, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ - 782, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ - 783, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ - 784, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ - 785, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ - 786, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ - 787, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ - 1221, /* GL_PROGRAM_BINDING_ARB */ - 789, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ - 790, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ - 776, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ - 777, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ - 778, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ - 779, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ - 780, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ - 781, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ - 1647, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ - 1644, /* GL_TEXTURE_COMPRESSED */ - 1025, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ + 1799, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ + 1806, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ + 1807, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ + 1808, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ + 1809, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ + 1810, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ + 1811, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ + 1812, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ + 1813, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ + 1814, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ + 1800, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ + 1801, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ + 1802, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ + 1803, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ + 1804, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ + 1805, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ + 750, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ + 757, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ + 758, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ + 759, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ + 760, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ + 761, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ + 762, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ + 763, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ + 764, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ + 765, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ + 751, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ + 752, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ + 753, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ + 754, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ + 755, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ + 756, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ + 777, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ + 784, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ + 785, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ + 786, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ + 787, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ + 788, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ + 789, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ + 1223, /* GL_PROGRAM_BINDING_ARB */ + 791, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ + 792, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ + 778, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ + 779, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ + 780, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ + 781, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ + 782, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ + 783, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ + 1651, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ + 1648, /* GL_TEXTURE_COMPRESSED */ + 1027, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ 269, /* GL_COMPRESSED_TEXTURE_FORMATS */ - 934, /* GL_MAX_VERTEX_UNITS_ARB */ + 936, /* GL_MAX_VERTEX_UNITS_ARB */ 22, /* GL_ACTIVE_VERTEX_UNITS_ARB */ - 1848, /* GL_WEIGHT_SUM_UNITY_ARB */ - 1825, /* GL_VERTEX_BLEND_ARB */ + 1852, /* GL_WEIGHT_SUM_UNITY_ARB */ + 1829, /* GL_VERTEX_BLEND_ARB */ 336, /* GL_CURRENT_WEIGHT_ARB */ - 1847, /* GL_WEIGHT_ARRAY_TYPE_ARB */ - 1846, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ - 1845, /* GL_WEIGHT_ARRAY_SIZE_ARB */ - 1844, /* GL_WEIGHT_ARRAY_POINTER_ARB */ - 1841, /* GL_WEIGHT_ARRAY_ARB */ + 1851, /* GL_WEIGHT_ARRAY_TYPE_ARB */ + 1850, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ + 1849, /* GL_WEIGHT_ARRAY_SIZE_ARB */ + 1848, /* GL_WEIGHT_ARRAY_POINTER_ARB */ + 1845, /* GL_WEIGHT_ARRAY_ARB */ 384, /* GL_DOT3_RGB */ 385, /* GL_DOT3_RGBA */ 263, /* GL_COMPRESSED_RGB_FXT1_3DFX */ 258, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ - 994, /* GL_MULTISAMPLE_3DFX */ - 1387, /* GL_SAMPLE_BUFFERS_3DFX */ - 1378, /* GL_SAMPLES_3DFX */ - 975, /* GL_MODELVIEW2_ARB */ - 978, /* GL_MODELVIEW3_ARB */ - 979, /* GL_MODELVIEW4_ARB */ - 980, /* GL_MODELVIEW5_ARB */ - 981, /* GL_MODELVIEW6_ARB */ - 982, /* GL_MODELVIEW7_ARB */ - 983, /* GL_MODELVIEW8_ARB */ - 984, /* GL_MODELVIEW9_ARB */ - 954, /* GL_MODELVIEW10_ARB */ - 955, /* GL_MODELVIEW11_ARB */ - 956, /* GL_MODELVIEW12_ARB */ - 957, /* GL_MODELVIEW13_ARB */ - 958, /* GL_MODELVIEW14_ARB */ - 959, /* GL_MODELVIEW15_ARB */ - 960, /* GL_MODELVIEW16_ARB */ - 961, /* GL_MODELVIEW17_ARB */ - 962, /* GL_MODELVIEW18_ARB */ - 963, /* GL_MODELVIEW19_ARB */ - 965, /* GL_MODELVIEW20_ARB */ - 966, /* GL_MODELVIEW21_ARB */ - 967, /* GL_MODELVIEW22_ARB */ - 968, /* GL_MODELVIEW23_ARB */ - 969, /* GL_MODELVIEW24_ARB */ - 970, /* GL_MODELVIEW25_ARB */ - 971, /* GL_MODELVIEW26_ARB */ - 972, /* GL_MODELVIEW27_ARB */ - 973, /* GL_MODELVIEW28_ARB */ - 974, /* GL_MODELVIEW29_ARB */ - 976, /* GL_MODELVIEW30_ARB */ - 977, /* GL_MODELVIEW31_ARB */ + 996, /* GL_MULTISAMPLE_3DFX */ + 1391, /* GL_SAMPLE_BUFFERS_3DFX */ + 1382, /* GL_SAMPLES_3DFX */ + 977, /* GL_MODELVIEW2_ARB */ + 980, /* GL_MODELVIEW3_ARB */ + 981, /* GL_MODELVIEW4_ARB */ + 982, /* GL_MODELVIEW5_ARB */ + 983, /* GL_MODELVIEW6_ARB */ + 984, /* GL_MODELVIEW7_ARB */ + 985, /* GL_MODELVIEW8_ARB */ + 986, /* GL_MODELVIEW9_ARB */ + 956, /* GL_MODELVIEW10_ARB */ + 957, /* GL_MODELVIEW11_ARB */ + 958, /* GL_MODELVIEW12_ARB */ + 959, /* GL_MODELVIEW13_ARB */ + 960, /* GL_MODELVIEW14_ARB */ + 961, /* GL_MODELVIEW15_ARB */ + 962, /* GL_MODELVIEW16_ARB */ + 963, /* GL_MODELVIEW17_ARB */ + 964, /* GL_MODELVIEW18_ARB */ + 965, /* GL_MODELVIEW19_ARB */ + 967, /* GL_MODELVIEW20_ARB */ + 968, /* GL_MODELVIEW21_ARB */ + 969, /* GL_MODELVIEW22_ARB */ + 970, /* GL_MODELVIEW23_ARB */ + 971, /* GL_MODELVIEW24_ARB */ + 972, /* GL_MODELVIEW25_ARB */ + 973, /* GL_MODELVIEW26_ARB */ + 974, /* GL_MODELVIEW27_ARB */ + 975, /* GL_MODELVIEW28_ARB */ + 976, /* GL_MODELVIEW29_ARB */ + 978, /* GL_MODELVIEW30_ARB */ + 979, /* GL_MODELVIEW31_ARB */ 389, /* GL_DOT3_RGB_EXT */ 387, /* GL_DOT3_RGBA_EXT */ - 948, /* GL_MIRROR_CLAMP_EXT */ - 951, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ - 989, /* GL_MODULATE_ADD_ATI */ - 990, /* GL_MODULATE_SIGNED_ADD_ATI */ - 991, /* GL_MODULATE_SUBTRACT_ATI */ - 1854, /* GL_YCBCR_MESA */ - 1081, /* GL_PACK_INVERT_MESA */ + 950, /* GL_MIRROR_CLAMP_EXT */ + 953, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ + 991, /* GL_MODULATE_ADD_ATI */ + 992, /* GL_MODULATE_SIGNED_ADD_ATI */ + 993, /* GL_MODULATE_SUBTRACT_ATI */ + 1858, /* GL_YCBCR_MESA */ + 1083, /* GL_PACK_INVERT_MESA */ 339, /* GL_DEBUG_OBJECT_MESA */ 340, /* GL_DEBUG_PRINT_MESA */ 338, /* GL_DEBUG_ASSERT_MESA */ @@ -4758,24 +4766,24 @@ static const unsigned reduced_enums[1347] = 447, /* GL_DU8DV8_ATI */ 114, /* GL_BUMP_ENVMAP_ATI */ 118, /* GL_BUMP_TARGET_ATI */ - 1486, /* GL_STENCIL_BACK_FUNC */ - 1484, /* GL_STENCIL_BACK_FAIL */ - 1488, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ - 1490, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ - 532, /* GL_FRAGMENT_PROGRAM_ARB */ - 1219, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ - 1247, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ - 1246, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ - 1231, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - 1237, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - 1236, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - 882, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ - 905, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ - 904, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ - 895, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - 901, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - 900, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - 865, /* GL_MAX_DRAW_BUFFERS */ + 1490, /* GL_STENCIL_BACK_FUNC */ + 1488, /* GL_STENCIL_BACK_FAIL */ + 1492, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ + 1494, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ + 533, /* GL_FRAGMENT_PROGRAM_ARB */ + 1221, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ + 1249, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ + 1248, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ + 1233, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + 1239, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + 1238, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + 884, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ + 907, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ + 906, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ + 897, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + 903, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + 902, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + 867, /* GL_MAX_DRAW_BUFFERS */ 393, /* GL_DRAW_BUFFER0 */ 396, /* GL_DRAW_BUFFER1 */ 417, /* GL_DRAW_BUFFER2 */ @@ -4793,253 +4801,253 @@ static const unsigned reduced_enums[1347] = 409, /* GL_DRAW_BUFFER14 */ 412, /* GL_DRAW_BUFFER15 */ 82, /* GL_BLEND_EQUATION_ALPHA */ - 845, /* GL_MATRIX_PALETTE_ARB */ - 876, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ - 879, /* GL_MAX_PALETTE_MATRICES_ARB */ + 847, /* GL_MATRIX_PALETTE_ARB */ + 878, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ + 881, /* GL_MAX_PALETTE_MATRICES_ARB */ 321, /* GL_CURRENT_PALETTE_MATRIX_ARB */ - 839, /* GL_MATRIX_INDEX_ARRAY_ARB */ + 841, /* GL_MATRIX_INDEX_ARRAY_ARB */ 316, /* GL_CURRENT_MATRIX_INDEX_ARB */ - 841, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ - 843, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ - 842, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ - 840, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ - 1674, /* GL_TEXTURE_DEPTH_SIZE */ + 843, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ + 845, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ + 844, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ + 842, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ + 1678, /* GL_TEXTURE_DEPTH_SIZE */ 377, /* GL_DEPTH_TEXTURE_MODE */ - 1639, /* GL_TEXTURE_COMPARE_MODE */ - 1637, /* GL_TEXTURE_COMPARE_FUNC */ + 1643, /* GL_TEXTURE_COMPARE_MODE */ + 1641, /* GL_TEXTURE_COMPARE_FUNC */ 242, /* GL_COMPARE_R_TO_TEXTURE */ - 1153, /* GL_POINT_SPRITE */ + 1155, /* GL_POINT_SPRITE */ 296, /* GL_COORD_REPLACE */ - 1157, /* GL_POINT_SPRITE_R_MODE_NV */ - 1276, /* GL_QUERY_COUNTER_BITS */ + 1159, /* GL_POINT_SPRITE_R_MODE_NV */ + 1280, /* GL_QUERY_COUNTER_BITS */ 323, /* GL_CURRENT_QUERY */ - 1278, /* GL_QUERY_RESULT */ - 1280, /* GL_QUERY_RESULT_AVAILABLE */ - 928, /* GL_MAX_VERTEX_ATTRIBS */ - 1815, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ + 1282, /* GL_QUERY_RESULT */ + 1284, /* GL_QUERY_RESULT_AVAILABLE */ + 930, /* GL_MAX_VERTEX_ATTRIBS */ + 1819, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ 375, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ 374, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ - 914, /* GL_MAX_TEXTURE_COORDS */ - 916, /* GL_MAX_TEXTURE_IMAGE_UNITS */ - 1224, /* GL_PROGRAM_ERROR_STRING_ARB */ - 1226, /* GL_PROGRAM_FORMAT_ASCII_ARB */ - 1225, /* GL_PROGRAM_FORMAT_ARB */ - 1723, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ + 916, /* GL_MAX_TEXTURE_COORDS */ + 918, /* GL_MAX_TEXTURE_IMAGE_UNITS */ + 1226, /* GL_PROGRAM_ERROR_STRING_ARB */ + 1228, /* GL_PROGRAM_FORMAT_ASCII_ARB */ + 1227, /* GL_PROGRAM_FORMAT_ARB */ + 1727, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ 353, /* GL_DEPTH_BOUNDS_TEST_EXT */ 352, /* GL_DEPTH_BOUNDS_EXT */ 53, /* GL_ARRAY_BUFFER */ 461, /* GL_ELEMENT_ARRAY_BUFFER */ 54, /* GL_ARRAY_BUFFER_BINDING */ 462, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ - 1789, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ - 1015, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ + 1793, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ + 1017, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ 149, /* GL_COLOR_ARRAY_BUFFER_BINDING */ - 624, /* GL_INDEX_ARRAY_BUFFER_BINDING */ - 1652, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ + 625, /* GL_INDEX_ARRAY_BUFFER_BINDING */ + 1656, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ 457, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ - 1399, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ - 510, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ - 1842, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ - 1811, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ - 1227, /* GL_PROGRAM_INSTRUCTIONS_ARB */ - 888, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ - 1233, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - 897, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - 1245, /* GL_PROGRAM_TEMPORARIES_ARB */ - 903, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ - 1235, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ - 899, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ - 1239, /* GL_PROGRAM_PARAMETERS_ARB */ - 902, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ - 1234, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ - 898, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ - 1220, /* GL_PROGRAM_ATTRIBS_ARB */ - 883, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ - 1232, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ - 896, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ - 1218, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ - 881, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ - 1230, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - 894, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - 889, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ - 885, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ - 1248, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ - 1736, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ - 1289, /* GL_READ_ONLY */ - 1850, /* GL_WRITE_ONLY */ - 1291, /* GL_READ_WRITE */ + 1403, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ + 511, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ + 1846, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ + 1815, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ + 1229, /* GL_PROGRAM_INSTRUCTIONS_ARB */ + 890, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ + 1235, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + 899, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + 1247, /* GL_PROGRAM_TEMPORARIES_ARB */ + 905, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ + 1237, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ + 901, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ + 1241, /* GL_PROGRAM_PARAMETERS_ARB */ + 904, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ + 1236, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ + 900, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ + 1222, /* GL_PROGRAM_ATTRIBS_ARB */ + 885, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ + 1234, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ + 898, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ + 1220, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ + 883, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ + 1232, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + 896, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + 891, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ + 887, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ + 1250, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ + 1740, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ + 1293, /* GL_READ_ONLY */ + 1854, /* GL_WRITE_ONLY */ + 1295, /* GL_READ_WRITE */ 102, /* GL_BUFFER_ACCESS */ 105, /* GL_BUFFER_MAPPED */ 107, /* GL_BUFFER_MAP_POINTER */ - 1730, /* GL_TIME_ELAPSED_EXT */ - 799, /* GL_MATRIX0_ARB */ - 811, /* GL_MATRIX1_ARB */ - 823, /* GL_MATRIX2_ARB */ - 827, /* GL_MATRIX3_ARB */ - 829, /* GL_MATRIX4_ARB */ - 831, /* GL_MATRIX5_ARB */ - 833, /* GL_MATRIX6_ARB */ - 835, /* GL_MATRIX7_ARB */ - 837, /* GL_MATRIX8_ARB */ - 838, /* GL_MATRIX9_ARB */ - 801, /* GL_MATRIX10_ARB */ - 802, /* GL_MATRIX11_ARB */ - 803, /* GL_MATRIX12_ARB */ - 804, /* GL_MATRIX13_ARB */ - 805, /* GL_MATRIX14_ARB */ - 806, /* GL_MATRIX15_ARB */ - 807, /* GL_MATRIX16_ARB */ - 808, /* GL_MATRIX17_ARB */ - 809, /* GL_MATRIX18_ARB */ - 810, /* GL_MATRIX19_ARB */ - 813, /* GL_MATRIX20_ARB */ - 814, /* GL_MATRIX21_ARB */ - 815, /* GL_MATRIX22_ARB */ - 816, /* GL_MATRIX23_ARB */ - 817, /* GL_MATRIX24_ARB */ - 818, /* GL_MATRIX25_ARB */ - 819, /* GL_MATRIX26_ARB */ - 820, /* GL_MATRIX27_ARB */ - 821, /* GL_MATRIX28_ARB */ - 822, /* GL_MATRIX29_ARB */ - 825, /* GL_MATRIX30_ARB */ - 826, /* GL_MATRIX31_ARB */ - 1519, /* GL_STREAM_DRAW */ - 1521, /* GL_STREAM_READ */ - 1517, /* GL_STREAM_COPY */ - 1477, /* GL_STATIC_DRAW */ - 1479, /* GL_STATIC_READ */ - 1475, /* GL_STATIC_COPY */ + 1734, /* GL_TIME_ELAPSED_EXT */ + 801, /* GL_MATRIX0_ARB */ + 813, /* GL_MATRIX1_ARB */ + 825, /* GL_MATRIX2_ARB */ + 829, /* GL_MATRIX3_ARB */ + 831, /* GL_MATRIX4_ARB */ + 833, /* GL_MATRIX5_ARB */ + 835, /* GL_MATRIX6_ARB */ + 837, /* GL_MATRIX7_ARB */ + 839, /* GL_MATRIX8_ARB */ + 840, /* GL_MATRIX9_ARB */ + 803, /* GL_MATRIX10_ARB */ + 804, /* GL_MATRIX11_ARB */ + 805, /* GL_MATRIX12_ARB */ + 806, /* GL_MATRIX13_ARB */ + 807, /* GL_MATRIX14_ARB */ + 808, /* GL_MATRIX15_ARB */ + 809, /* GL_MATRIX16_ARB */ + 810, /* GL_MATRIX17_ARB */ + 811, /* GL_MATRIX18_ARB */ + 812, /* GL_MATRIX19_ARB */ + 815, /* GL_MATRIX20_ARB */ + 816, /* GL_MATRIX21_ARB */ + 817, /* GL_MATRIX22_ARB */ + 818, /* GL_MATRIX23_ARB */ + 819, /* GL_MATRIX24_ARB */ + 820, /* GL_MATRIX25_ARB */ + 821, /* GL_MATRIX26_ARB */ + 822, /* GL_MATRIX27_ARB */ + 823, /* GL_MATRIX28_ARB */ + 824, /* GL_MATRIX29_ARB */ + 827, /* GL_MATRIX30_ARB */ + 828, /* GL_MATRIX31_ARB */ + 1523, /* GL_STREAM_DRAW */ + 1525, /* GL_STREAM_READ */ + 1521, /* GL_STREAM_COPY */ + 1481, /* GL_STATIC_DRAW */ + 1483, /* GL_STATIC_READ */ + 1479, /* GL_STATIC_COPY */ 451, /* GL_DYNAMIC_DRAW */ 453, /* GL_DYNAMIC_READ */ 449, /* GL_DYNAMIC_COPY */ - 1121, /* GL_PIXEL_PACK_BUFFER */ - 1125, /* GL_PIXEL_UNPACK_BUFFER */ - 1122, /* GL_PIXEL_PACK_BUFFER_BINDING */ - 1126, /* GL_PIXEL_UNPACK_BUFFER_BINDING */ + 1123, /* GL_PIXEL_PACK_BUFFER */ + 1127, /* GL_PIXEL_UNPACK_BUFFER */ + 1124, /* GL_PIXEL_PACK_BUFFER_BINDING */ + 1128, /* GL_PIXEL_UNPACK_BUFFER_BINDING */ 347, /* GL_DEPTH24_STENCIL8 */ - 1720, /* GL_TEXTURE_STENCIL_SIZE */ - 1672, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */ - 884, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ - 887, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ - 891, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ - 890, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ - 848, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ - 1510, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ + 1724, /* GL_TEXTURE_STENCIL_SIZE */ + 1676, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */ + 886, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ + 889, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ + 893, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ + 892, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ + 850, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ + 1514, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ 17, /* GL_ACTIVE_STENCIL_FACE_EXT */ - 949, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ - 1380, /* GL_SAMPLES_PASSED */ + 951, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ + 1384, /* GL_SAMPLES_PASSED */ 109, /* GL_BUFFER_SERIALIZED_MODIFY_APPLE */ 104, /* GL_BUFFER_FLUSHING_UNMAP_APPLE */ - 533, /* GL_FRAGMENT_SHADER */ - 1835, /* GL_VERTEX_SHADER */ - 1238, /* GL_PROGRAM_OBJECT_ARB */ - 1412, /* GL_SHADER_OBJECT_ARB */ - 872, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ - 932, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ - 926, /* GL_MAX_VARYING_FLOATS */ - 930, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ - 857, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ - 1041, /* GL_OBJECT_TYPE_ARB */ - 1414, /* GL_SHADER_TYPE */ - 498, /* GL_FLOAT_VEC2 */ - 500, /* GL_FLOAT_VEC3 */ - 502, /* GL_FLOAT_VEC4 */ - 651, /* GL_INT_VEC2 */ - 653, /* GL_INT_VEC3 */ - 655, /* GL_INT_VEC4 */ + 534, /* GL_FRAGMENT_SHADER */ + 1839, /* GL_VERTEX_SHADER */ + 1240, /* GL_PROGRAM_OBJECT_ARB */ + 1416, /* GL_SHADER_OBJECT_ARB */ + 874, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ + 934, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ + 928, /* GL_MAX_VARYING_FLOATS */ + 932, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ + 859, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ + 1043, /* GL_OBJECT_TYPE_ARB */ + 1418, /* GL_SHADER_TYPE */ + 499, /* GL_FLOAT_VEC2 */ + 501, /* GL_FLOAT_VEC3 */ + 503, /* GL_FLOAT_VEC4 */ + 652, /* GL_INT_VEC2 */ + 654, /* GL_INT_VEC3 */ + 656, /* GL_INT_VEC4 */ 94, /* GL_BOOL */ 96, /* GL_BOOL_VEC2 */ 98, /* GL_BOOL_VEC3 */ 100, /* GL_BOOL_VEC4 */ - 486, /* GL_FLOAT_MAT2 */ - 490, /* GL_FLOAT_MAT3 */ - 494, /* GL_FLOAT_MAT4 */ - 1371, /* GL_SAMPLER_1D */ - 1373, /* GL_SAMPLER_2D */ - 1375, /* GL_SAMPLER_3D */ - 1376, /* GL_SAMPLER_CUBE */ - 1372, /* GL_SAMPLER_1D_SHADOW */ - 1374, /* GL_SAMPLER_2D_SHADOW */ - 488, /* GL_FLOAT_MAT2x3 */ - 489, /* GL_FLOAT_MAT2x4 */ - 492, /* GL_FLOAT_MAT3x2 */ - 493, /* GL_FLOAT_MAT3x4 */ - 496, /* GL_FLOAT_MAT4x2 */ - 497, /* GL_FLOAT_MAT4x3 */ + 487, /* GL_FLOAT_MAT2 */ + 491, /* GL_FLOAT_MAT3 */ + 495, /* GL_FLOAT_MAT4 */ + 1375, /* GL_SAMPLER_1D */ + 1377, /* GL_SAMPLER_2D */ + 1379, /* GL_SAMPLER_3D */ + 1380, /* GL_SAMPLER_CUBE */ + 1376, /* GL_SAMPLER_1D_SHADOW */ + 1378, /* GL_SAMPLER_2D_SHADOW */ + 489, /* GL_FLOAT_MAT2x3 */ + 490, /* GL_FLOAT_MAT2x4 */ + 493, /* GL_FLOAT_MAT3x2 */ + 494, /* GL_FLOAT_MAT3x4 */ + 497, /* GL_FLOAT_MAT4x2 */ + 498, /* GL_FLOAT_MAT4x3 */ 345, /* GL_DELETE_STATUS */ 246, /* GL_COMPILE_STATUS */ - 706, /* GL_LINK_STATUS */ - 1783, /* GL_VALIDATE_STATUS */ - 636, /* GL_INFO_LOG_LENGTH */ + 708, /* GL_LINK_STATUS */ + 1787, /* GL_VALIDATE_STATUS */ + 637, /* GL_INFO_LOG_LENGTH */ 56, /* GL_ATTACHED_SHADERS */ 20, /* GL_ACTIVE_UNIFORMS */ 21, /* GL_ACTIVE_UNIFORM_MAX_LENGTH */ - 1413, /* GL_SHADER_SOURCE_LENGTH */ + 1417, /* GL_SHADER_SOURCE_LENGTH */ 15, /* GL_ACTIVE_ATTRIBUTES */ 16, /* GL_ACTIVE_ATTRIBUTE_MAX_LENGTH */ - 535, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ - 1416, /* GL_SHADING_LANGUAGE_VERSION */ + 536, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ + 1420, /* GL_SHADING_LANGUAGE_VERSION */ 322, /* GL_CURRENT_PROGRAM */ - 1090, /* GL_PALETTE4_RGB8_OES */ - 1092, /* GL_PALETTE4_RGBA8_OES */ - 1088, /* GL_PALETTE4_R5_G6_B5_OES */ - 1091, /* GL_PALETTE4_RGBA4_OES */ - 1089, /* GL_PALETTE4_RGB5_A1_OES */ - 1095, /* GL_PALETTE8_RGB8_OES */ - 1097, /* GL_PALETTE8_RGBA8_OES */ - 1093, /* GL_PALETTE8_R5_G6_B5_OES */ - 1096, /* GL_PALETTE8_RGBA4_OES */ - 1094, /* GL_PALETTE8_RGB5_A1_OES */ - 618, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ - 617, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ - 1768, /* GL_UNSIGNED_NORMALIZED */ - 1607, /* GL_TEXTURE_1D_ARRAY_EXT */ - 1259, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ - 1609, /* GL_TEXTURE_2D_ARRAY_EXT */ - 1262, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ - 1615, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ - 1617, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ - 1469, /* GL_SRGB */ - 1470, /* GL_SRGB8 */ - 1472, /* GL_SRGB_ALPHA */ - 1471, /* GL_SRGB8_ALPHA8 */ - 1429, /* GL_SLUMINANCE_ALPHA */ - 1428, /* GL_SLUMINANCE8_ALPHA8 */ - 1426, /* GL_SLUMINANCE */ - 1427, /* GL_SLUMINANCE8 */ + 1092, /* GL_PALETTE4_RGB8_OES */ + 1094, /* GL_PALETTE4_RGBA8_OES */ + 1090, /* GL_PALETTE4_R5_G6_B5_OES */ + 1093, /* GL_PALETTE4_RGBA4_OES */ + 1091, /* GL_PALETTE4_RGB5_A1_OES */ + 1097, /* GL_PALETTE8_RGB8_OES */ + 1099, /* GL_PALETTE8_RGBA8_OES */ + 1095, /* GL_PALETTE8_R5_G6_B5_OES */ + 1098, /* GL_PALETTE8_RGBA4_OES */ + 1096, /* GL_PALETTE8_RGB5_A1_OES */ + 619, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ + 618, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ + 1772, /* GL_UNSIGNED_NORMALIZED */ + 1611, /* GL_TEXTURE_1D_ARRAY_EXT */ + 1262, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ + 1613, /* GL_TEXTURE_2D_ARRAY_EXT */ + 1265, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ + 1619, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ + 1621, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ + 1473, /* GL_SRGB */ + 1474, /* GL_SRGB8 */ + 1476, /* GL_SRGB_ALPHA */ + 1475, /* GL_SRGB8_ALPHA8 */ + 1433, /* GL_SLUMINANCE_ALPHA */ + 1432, /* GL_SLUMINANCE8_ALPHA8 */ + 1430, /* GL_SLUMINANCE */ + 1431, /* GL_SLUMINANCE8 */ 267, /* GL_COMPRESSED_SRGB */ 268, /* GL_COMPRESSED_SRGB_ALPHA */ 265, /* GL_COMPRESSED_SLUMINANCE */ 266, /* GL_COMPRESSED_SLUMINANCE_ALPHA */ - 1155, /* GL_POINT_SPRITE_COORD_ORIGIN */ - 714, /* GL_LOWER_LEFT */ - 1780, /* GL_UPPER_LEFT */ - 1492, /* GL_STENCIL_BACK_REF */ - 1493, /* GL_STENCIL_BACK_VALUE_MASK */ - 1494, /* GL_STENCIL_BACK_WRITEMASK */ + 1157, /* GL_POINT_SPRITE_COORD_ORIGIN */ + 716, /* GL_LOWER_LEFT */ + 1784, /* GL_UPPER_LEFT */ + 1496, /* GL_STENCIL_BACK_REF */ + 1497, /* GL_STENCIL_BACK_VALUE_MASK */ + 1498, /* GL_STENCIL_BACK_WRITEMASK */ 442, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ - 1305, /* GL_RENDERBUFFER_BINDING_EXT */ - 1286, /* GL_READ_FRAMEBUFFER */ + 1309, /* GL_RENDERBUFFER_BINDING_EXT */ + 1290, /* GL_READ_FRAMEBUFFER */ 441, /* GL_DRAW_FRAMEBUFFER */ - 1287, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ - 1315, /* GL_RENDERBUFFER_SAMPLES */ - 545, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ - 543, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ - 554, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ - 550, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ - 552, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ - 557, /* GL_FRAMEBUFFER_COMPLETE */ - 561, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ - 567, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ - 565, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ - 563, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ - 566, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ - 564, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ - 570, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ - 573, /* GL_FRAMEBUFFER_UNSUPPORTED */ - 571, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ - 854, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ + 1291, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ + 1319, /* GL_RENDERBUFFER_SAMPLES */ + 546, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ + 544, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ + 555, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ + 551, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ + 553, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ + 558, /* GL_FRAMEBUFFER_COMPLETE */ + 562, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ + 568, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ + 566, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ + 564, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ + 567, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ + 565, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ + 571, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ + 574, /* GL_FRAMEBUFFER_UNSUPPORTED */ + 572, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ + 856, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ 155, /* GL_COLOR_ATTACHMENT0 */ 157, /* GL_COLOR_ATTACHMENT1 */ 171, /* GL_COLOR_ATTACHMENT2 */ @@ -5057,56 +5065,56 @@ static const unsigned reduced_enums[1347] = 166, /* GL_COLOR_ATTACHMENT14 */ 168, /* GL_COLOR_ATTACHMENT15 */ 348, /* GL_DEPTH_ATTACHMENT */ - 1482, /* GL_STENCIL_ATTACHMENT */ - 536, /* GL_FRAMEBUFFER */ - 1303, /* GL_RENDERBUFFER */ - 1317, /* GL_RENDERBUFFER_WIDTH */ - 1310, /* GL_RENDERBUFFER_HEIGHT */ - 1312, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ - 1505, /* GL_STENCIL_INDEX_EXT */ - 1502, /* GL_STENCIL_INDEX1_EXT */ - 1503, /* GL_STENCIL_INDEX4_EXT */ - 1504, /* GL_STENCIL_INDEX8_EXT */ - 1501, /* GL_STENCIL_INDEX16_EXT */ - 1314, /* GL_RENDERBUFFER_RED_SIZE */ - 1309, /* GL_RENDERBUFFER_GREEN_SIZE */ - 1306, /* GL_RENDERBUFFER_BLUE_SIZE */ - 1304, /* GL_RENDERBUFFER_ALPHA_SIZE */ - 1307, /* GL_RENDERBUFFER_DEPTH_SIZE */ - 1316, /* GL_RENDERBUFFER_STENCIL_SIZE */ - 569, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ - 910, /* GL_MAX_SAMPLES */ - 1273, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT */ - 483, /* GL_FIRST_VERTEX_CONVENTION_EXT */ - 666, /* GL_LAST_VERTEX_CONVENTION_EXT */ - 1252, /* GL_PROVOKING_VERTEX_EXT */ + 1486, /* GL_STENCIL_ATTACHMENT */ + 537, /* GL_FRAMEBUFFER */ + 1307, /* GL_RENDERBUFFER */ + 1321, /* GL_RENDERBUFFER_WIDTH */ + 1314, /* GL_RENDERBUFFER_HEIGHT */ + 1316, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ + 1509, /* GL_STENCIL_INDEX_EXT */ + 1506, /* GL_STENCIL_INDEX1_EXT */ + 1507, /* GL_STENCIL_INDEX4_EXT */ + 1508, /* GL_STENCIL_INDEX8_EXT */ + 1505, /* GL_STENCIL_INDEX16_EXT */ + 1318, /* GL_RENDERBUFFER_RED_SIZE */ + 1313, /* GL_RENDERBUFFER_GREEN_SIZE */ + 1310, /* GL_RENDERBUFFER_BLUE_SIZE */ + 1308, /* GL_RENDERBUFFER_ALPHA_SIZE */ + 1311, /* GL_RENDERBUFFER_DEPTH_SIZE */ + 1320, /* GL_RENDERBUFFER_STENCIL_SIZE */ + 570, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ + 912, /* GL_MAX_SAMPLES */ + 1276, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */ + 483, /* GL_FIRST_VERTEX_CONVENTION */ + 667, /* GL_LAST_VERTEX_CONVENTION */ + 1254, /* GL_PROVOKING_VERTEX */ 302, /* GL_COPY_READ_BUFFER */ 303, /* GL_COPY_WRITE_BUFFER */ - 1364, /* GL_RGBA_SNORM */ - 1360, /* GL_RGBA8_SNORM */ - 1422, /* GL_SIGNED_NORMALIZED */ - 911, /* GL_MAX_SERVER_WAIT_TIMEOUT */ - 1040, /* GL_OBJECT_TYPE */ - 1526, /* GL_SYNC_CONDITION */ - 1531, /* GL_SYNC_STATUS */ - 1528, /* GL_SYNC_FLAGS */ - 1527, /* GL_SYNC_FENCE */ - 1530, /* GL_SYNC_GPU_COMMANDS_COMPLETE */ - 1757, /* GL_UNSIGNALED */ - 1421, /* GL_SIGNALED */ + 1368, /* GL_RGBA_SNORM */ + 1364, /* GL_RGBA8_SNORM */ + 1426, /* GL_SIGNED_NORMALIZED */ + 913, /* GL_MAX_SERVER_WAIT_TIMEOUT */ + 1042, /* GL_OBJECT_TYPE */ + 1530, /* GL_SYNC_CONDITION */ + 1535, /* GL_SYNC_STATUS */ + 1532, /* GL_SYNC_FLAGS */ + 1531, /* GL_SYNC_FENCE */ + 1534, /* GL_SYNC_GPU_COMMANDS_COMPLETE */ + 1761, /* GL_UNSIGNALED */ + 1425, /* GL_SIGNALED */ 46, /* GL_ALREADY_SIGNALED */ - 1728, /* GL_TIMEOUT_EXPIRED */ + 1732, /* GL_TIMEOUT_EXPIRED */ 270, /* GL_CONDITION_SATISFIED */ - 1840, /* GL_WAIT_FAILED */ + 1844, /* GL_WAIT_FAILED */ 468, /* GL_EVAL_BIT */ - 1284, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ - 708, /* GL_LIST_BIT */ - 1623, /* GL_TEXTURE_BIT */ - 1395, /* GL_SCISSOR_BIT */ + 1288, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ + 710, /* GL_LIST_BIT */ + 1627, /* GL_TEXTURE_BIT */ + 1399, /* GL_SCISSOR_BIT */ 29, /* GL_ALL_ATTRIB_BITS */ - 996, /* GL_MULTISAMPLE_BIT */ + 998, /* GL_MULTISAMPLE_BIT */ 30, /* GL_ALL_CLIENT_ATTRIB_BITS */ - 1729, /* GL_TIMEOUT_IGNORED */ + 1733, /* GL_TIMEOUT_IGNORED */ }; typedef int (*cfunc)(const void *, const void *); diff --git a/src/mesa/sparc/glapi_sparc.S b/src/mesa/sparc/glapi_sparc.S index 50a2037034..aaa17e6a3b 100644 --- a/src/mesa/sparc/glapi_sparc.S +++ b/src/mesa/sparc/glapi_sparc.S @@ -1362,6 +1362,7 @@ gl_dispatch_functions_start: GL_STUB_ALIAS(glIsRenderbuffer, glIsRenderbufferEXT) GL_STUB_ALIAS(glRenderbufferStorage, glRenderbufferStorageEXT) GL_STUB_ALIAS(glFramebufferTextureLayer, glFramebufferTextureLayerEXT) + GL_STUB_ALIAS(glProvokingVertex, glProvokingVertexEXT) .globl gl_dispatch_functions_end HIDDEN(gl_dispatch_functions_end) diff --git a/src/mesa/x86-64/glapi_x86-64.S b/src/mesa/x86-64/glapi_x86-64.S index 907deb4d2f..72d0532906 100644 --- a/src/mesa/x86-64/glapi_x86-64.S +++ b/src/mesa/x86-64/glapi_x86-64.S @@ -30393,6 +30393,7 @@ GL_PREFIX(_dispatch_stub_794): .globl GL_PREFIX(RenderbufferStorage) ; .set GL_PREFIX(RenderbufferStorage), GL_PREFIX(RenderbufferStorageEXT) .globl GL_PREFIX(BlitFramebuffer) ; .set GL_PREFIX(BlitFramebuffer), GL_PREFIX(_dispatch_stub_783) .globl GL_PREFIX(FramebufferTextureLayer) ; .set GL_PREFIX(FramebufferTextureLayer), GL_PREFIX(FramebufferTextureLayerEXT) + .globl GL_PREFIX(ProvokingVertex) ; .set GL_PREFIX(ProvokingVertex), GL_PREFIX(ProvokingVertexEXT) #if defined(GLX_USE_TLS) && defined(__linux__) .section ".note.ABI-tag", "a" diff --git a/src/mesa/x86/glapi_x86.S b/src/mesa/x86/glapi_x86.S index 5f12b4fb6a..12c77f434e 100644 --- a/src/mesa/x86/glapi_x86.S +++ b/src/mesa/x86/glapi_x86.S @@ -1316,6 +1316,7 @@ GLNAME(gl_dispatch_functions_start): GL_STUB_ALIAS(IsRenderbuffer, _gloffset_IsRenderbufferEXT, IsRenderbuffer@4, IsRenderbufferEXT, IsRenderbufferEXT@4) GL_STUB_ALIAS(RenderbufferStorage, _gloffset_RenderbufferStorageEXT, RenderbufferStorage@16, RenderbufferStorageEXT, RenderbufferStorageEXT@16) GL_STUB_ALIAS(FramebufferTextureLayer, _gloffset_FramebufferTextureLayerEXT, FramebufferTextureLayer@20, FramebufferTextureLayerEXT, FramebufferTextureLayerEXT@20) + GL_STUB_ALIAS(ProvokingVertex, _gloffset_ProvokingVertexEXT, ProvokingVertex@4, ProvokingVertexEXT, ProvokingVertexEXT@4) GLOBL GLNAME(gl_dispatch_functions_end) HIDDEN(GLNAME(gl_dispatch_functions_end)) -- cgit v1.2.3 From af693464466aab161fe24700a0c2865c774ccf80 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 19 Sep 2009 10:58:07 -0600 Subject: intel: use new _mesa_meta_CopyTex[Sub]Image() functions --- src/mesa/drivers/dri/intel/intel_tex_copy.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c index 148e8c048c..ac557a9200 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_copy.c +++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c @@ -30,7 +30,8 @@ #include "main/image.h" #include "main/teximage.h" #include "main/mipmap.h" -#include "swrast/swrast.h" + +#include "drivers/common/meta.h" #include "intel_screen.h" #include "intel_context.h" @@ -215,8 +216,8 @@ intelCopyTexImage1D(GLcontext * ctx, GLenum target, GLint level, return; fail: - _swrast_copy_teximage1d(ctx, target, level, internalFormat, x, y, - width, border); + _mesa_meta_CopyTexImage1D(ctx, target, level, internalFormat, x, y, + width, border); } @@ -263,8 +264,8 @@ intelCopyTexImage2D(GLcontext * ctx, GLenum target, GLint level, return; fail: - _swrast_copy_teximage2d(ctx, target, level, internalFormat, x, y, - width, height, border); + _mesa_meta_CopyTexImage2D(ctx, target, level, internalFormat, x, y, + width, height, border); } @@ -288,7 +289,7 @@ intelCopyTexSubImage1D(GLcontext * ctx, GLenum target, GLint level, if (!do_copy_texsubimage(intel_context(ctx), target, intel_texture_image(texImage), internalFormat, xoffset, 0, x, y, width, 1)) { - _swrast_copy_texsubimage1d(ctx, target, level, xoffset, x, y, width); + _mesa_meta_CopyTexSubImage1D(ctx, target, level, xoffset, x, y, width); } } @@ -314,10 +315,10 @@ intelCopyTexSubImage2D(GLcontext * ctx, GLenum target, GLint level, internalFormat, xoffset, yoffset, x, y, width, height)) { - DBG("%s - fallback to swrast\n", __FUNCTION__); + DBG("%s - fallback to _mesa_meta_CopyTexSubImage2D\n", __FUNCTION__); - _swrast_copy_texsubimage2d(ctx, target, level, - xoffset, yoffset, x, y, width, height); + _mesa_meta_CopyTexSubImage2D(ctx, target, level, + xoffset, yoffset, x, y, width, height); } } -- cgit v1.2.3 From 6f9dbe773953b024075910b3bec11ebc96c2e8e0 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 19 Sep 2009 10:55:09 -0600 Subject: mesa: use new _mesa_meta_CopyTex[Sub]Image() functions --- src/mesa/drivers/common/driverfuncs.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index a9f3c8e727..e72fcd3d9a 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -56,6 +56,7 @@ #include "swrast/swrast.h" #include "driverfuncs.h" +#include "meta.h" @@ -100,11 +101,11 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->TexSubImage2D = _mesa_store_texsubimage2d; driver->TexSubImage3D = _mesa_store_texsubimage3d; driver->GetTexImage = _mesa_get_teximage; - driver->CopyTexImage1D = _swrast_copy_teximage1d; - driver->CopyTexImage2D = _swrast_copy_teximage2d; - driver->CopyTexSubImage1D = _swrast_copy_texsubimage1d; - driver->CopyTexSubImage2D = _swrast_copy_texsubimage2d; - driver->CopyTexSubImage3D = _swrast_copy_texsubimage3d; + driver->CopyTexImage1D = _mesa_meta_CopyTexImage1D; + driver->CopyTexImage2D = _mesa_meta_CopyTexImage2D; + driver->CopyTexSubImage1D = _mesa_meta_CopyTexSubImage1D; + driver->CopyTexSubImage2D = _mesa_meta_CopyTexSubImage2D; + driver->CopyTexSubImage3D = _mesa_meta_CopyTexSubImage3D; driver->GenerateMipmap = _mesa_generate_mipmap; driver->TestProxyTexImage = _mesa_test_proxy_teximage; driver->CompressedTexImage1D = _mesa_store_compressed_teximage1d; -- cgit v1.2.3 From e2e0735e0e3d8ffe560ae9a9176c9aaf0a7e27a5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 19 Sep 2009 11:01:07 -0600 Subject: gldirect: remove refs to soon-to-be-obsolete functions I don't know if this driver is anywhere near build-able, but anyway. --- .../windows/gldirect/mesasw/gld_wgl_mesasw.c | 26 ++-------------------- 1 file changed, 2 insertions(+), 24 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c b/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c index 342a742867..7ac425a109 100644 --- a/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c +++ b/src/mesa/drivers/windows/gldirect/mesasw/gld_wgl_mesasw.c @@ -1346,6 +1346,8 @@ static void wmesa_update_state_first_time( struct swrast_device_driver *swdd = _swrast_GetDeviceDriverReference( ctx ); TNLcontext *tnl = TNL_CONTEXT(ctx); + _mesa_init_driver_functions(&ctx->Driver); + /* * XXX these function pointers could be initialized just once during * context creation since they don't depend on any state changes. @@ -1362,8 +1364,6 @@ static void wmesa_update_state_first_time( ctx->Driver.Viewport = wmesa_viewport; - ctx->Driver.Accum = _swrast_Accum; - ctx->Driver.Bitmap = _swrast_Bitmap; ctx->Driver.Clear = clear; ctx->Driver.Flush = flush; @@ -1371,28 +1371,6 @@ static void wmesa_update_state_first_time( ctx->Driver.ClearColor = clear_color; ctx->Driver.Enable = enable; - ctx->Driver.CopyPixels = _swrast_CopyPixels; - ctx->Driver.DrawPixels = _swrast_DrawPixels; - ctx->Driver.ReadPixels = _swrast_ReadPixels; - - ctx->Driver.ChooseTextureFormat = _mesa_choose_tex_format; - ctx->Driver.TexImage1D = _mesa_store_teximage1d; - ctx->Driver.TexImage2D = _mesa_store_teximage2d; - ctx->Driver.TexImage3D = _mesa_store_teximage3d; - ctx->Driver.TexSubImage1D = _mesa_store_texsubimage1d; - ctx->Driver.TexSubImage2D = _mesa_store_texsubimage2d; - ctx->Driver.TexSubImage3D = _mesa_store_texsubimage3d; - ctx->Driver.TestProxyTexImage = _mesa_test_proxy_teximage; - - ctx->Driver.CopyTexImage1D = _swrast_copy_teximage1d; - ctx->Driver.CopyTexImage2D = _swrast_copy_teximage2d; - ctx->Driver.CopyTexSubImage1D = _swrast_copy_texsubimage1d; - ctx->Driver.CopyTexSubImage2D = _swrast_copy_texsubimage2d; - ctx->Driver.CopyTexSubImage3D = _swrast_copy_texsubimage3d; - ctx->Driver.CopyColorTable = _swrast_CopyColorTable; - ctx->Driver.CopyColorSubTable = _swrast_CopyColorSubTable; - ctx->Driver.CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; - ctx->Driver.CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; // Does not apply for Mesa 5.x //ctx->Driver.BaseCompressedTexFormat = _mesa_base_compressed_texformat; -- cgit v1.2.3 From 41a171b7148abbc5b3aeec61b8d6e5f38a146541 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 19 Sep 2009 11:03:33 -0600 Subject: windows: replace old TexCopy functions w/ new --- src/mesa/drivers/windows/gdi/mesa.def | 10 +++++----- src/mesa/drivers/windows/icd/mesa.def | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/windows/gdi/mesa.def b/src/mesa/drivers/windows/gdi/mesa.def index bd3e5b2137..c588c5703c 100644 --- a/src/mesa/drivers/windows/gdi/mesa.def +++ b/src/mesa/drivers/windows/gdi/mesa.def @@ -943,6 +943,11 @@ EXPORTS _mesa_update_framebuffer_visual _mesa_use_program _mesa_Viewport + _mesa_meta_CopyTexImage1D + _mesa_meta_CopyTexImage2D + _mesa_meta_CopyTexSubImage1D + _mesa_meta_CopyTexSubImage2D + _mesa_meta_CopyTexSubImage3D _mesa_wait_query _swrast_Accum _swrast_Bitmap @@ -957,11 +962,6 @@ EXPORTS _swrast_CopyColorTable _swrast_CopyConvolutionFilter1D _swrast_CopyConvolutionFilter2D - _swrast_copy_teximage1d - _swrast_copy_teximage2d - _swrast_copy_texsubimage1d - _swrast_copy_texsubimage2d - _swrast_copy_texsubimage3d _swrast_CreateContext _swrast_DestroyContext _swrast_exec_fragment_program diff --git a/src/mesa/drivers/windows/icd/mesa.def b/src/mesa/drivers/windows/icd/mesa.def index 465b380a0c..000dc9d983 100644 --- a/src/mesa/drivers/windows/icd/mesa.def +++ b/src/mesa/drivers/windows/icd/mesa.def @@ -75,6 +75,11 @@ EXPORTS _mesa_strcmp _mesa_test_proxy_teximage _mesa_Viewport + _mesa_meta_CopyTexImage1D + _mesa_meta_CopyTexImage2D + _mesa_meta_CopyTexSubImage1D + _mesa_meta_CopyTexSubImage2D + _mesa_meta_CopyTexSubImage3D _swrast_Accum _swrast_Bitmap _swrast_CopyPixels @@ -88,11 +93,6 @@ EXPORTS _swrast_CopyColorTable _swrast_CopyConvolutionFilter1D _swrast_CopyConvolutionFilter2D - _swrast_copy_teximage1d - _swrast_copy_teximage2d - _swrast_copy_texsubimage1d - _swrast_copy_texsubimage2d - _swrast_copy_texsubimage3d _swrast_CreateContext _swrast_DestroyContext _swrast_InvalidateState -- cgit v1.2.3 From a9c64daf02b7a7715abc3912e2f7db4ab481ce79 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 19 Sep 2009 11:05:54 -0600 Subject: glapi: replace old TexCopy functions w/ new --- src/mesa/glapi/mesadef.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/glapi/mesadef.py b/src/mesa/glapi/mesadef.py index 0f410fc482..92d956761b 100644 --- a/src/mesa/glapi/mesadef.py +++ b/src/mesa/glapi/mesadef.py @@ -155,6 +155,11 @@ def PrintTail(): print '\t_mesa_strcmp' print '\t_mesa_test_proxy_teximage' print '\t_mesa_Viewport' + print '\t_mesa_meta_CopyTexImage1D' + print '\t_mesa_meta_CopyTexImage2D' + print '\t_mesa_meta_CopyTexSubImage1D' + print '\t_mesa_meta_CopyTexSubImage2D' + print '\t_mesa_meta_CopyTexSubImage3D' print '\t_swrast_Accum' print '\t_swrast_alloc_buffers' print '\t_swrast_Bitmap' @@ -168,11 +173,6 @@ def PrintTail(): print '\t_swrast_CopyColorTable' print '\t_swrast_CopyConvolutionFilter1D' print '\t_swrast_CopyConvolutionFilter2D' - print '\t_swrast_copy_teximage1d' - print '\t_swrast_copy_teximage2d' - print '\t_swrast_copy_texsubimage1d' - print '\t_swrast_copy_texsubimage2d' - print '\t_swrast_copy_texsubimage3d' print '\t_swrast_CreateContext' print '\t_swrast_DestroyContext' print '\t_swrast_InvalidateState' -- cgit v1.2.3 From 14869c09847f7d2f638acb13064fb1bb8bce620c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 19 Sep 2009 11:08:20 -0600 Subject: mesa: remove s_texstore.c from makefile/project files --- src/mesa/sources.mak | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak index fa2a6307a4..0ae1a11cae 100644 --- a/src/mesa/sources.mak +++ b/src/mesa/sources.mak @@ -125,7 +125,6 @@ SWRAST_SOURCES = \ swrast/s_stencil.c \ swrast/s_texcombine.c \ swrast/s_texfilter.c \ - swrast/s_texstore.c \ swrast/s_triangle.c \ swrast/s_zoom.c -- cgit v1.2.3 From 2f89044e6f2ed92ec4ea7a4f98efcac8c1ce3aab Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 19 Sep 2009 11:08:49 -0600 Subject: swrast: remove prototypes for obsolete functions --- src/mesa/swrast/swrast.h | 33 --------------------------------- 1 file changed, 33 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/swrast.h b/src/mesa/swrast/swrast.h index c319ca62f9..3a352a2f4d 100644 --- a/src/mesa/swrast/swrast.h +++ b/src/mesa/swrast/swrast.h @@ -229,39 +229,6 @@ _swrast_CopyColorTable( GLcontext *ctx, GLint x, GLint y, GLsizei width); -/* - * Texture fallbacks. Could also live in a new module - * with the rest of the texture store fallbacks? - */ -extern void -_swrast_copy_teximage1d(GLcontext *ctx, GLenum target, GLint level, - GLenum internalFormat, - GLint x, GLint y, GLsizei width, GLint border); - -extern void -_swrast_copy_teximage2d(GLcontext *ctx, GLenum target, GLint level, - GLenum internalFormat, - GLint x, GLint y, GLsizei width, GLsizei height, - GLint border); - - -extern void -_swrast_copy_texsubimage1d(GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, GLint x, GLint y, GLsizei width); - -extern void -_swrast_copy_texsubimage2d(GLcontext *ctx, - GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint x, GLint y, GLsizei width, GLsizei height); - -extern void -_swrast_copy_texsubimage3d(GLcontext *ctx, - GLenum target, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLint x, GLint y, GLsizei width, GLsizei height); - - extern void _swrast_eject_texture_images(GLcontext *ctx); -- cgit v1.2.3 From 67cad78e08f1a0770c5a7f67ecaf8145b2fdbdc4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 19 Sep 2009 11:09:25 -0600 Subject: swrast: remove obsolete s_texstore.c Replaced by new, simpler meta functions. --- src/mesa/swrast/s_texstore.c | 576 ------------------------------------------- 1 file changed, 576 deletions(-) delete mode 100644 src/mesa/swrast/s_texstore.c (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_texstore.c b/src/mesa/swrast/s_texstore.c deleted file mode 100644 index 4f19d19ab1..0000000000 --- a/src/mesa/swrast/s_texstore.c +++ /dev/null @@ -1,576 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.2 - * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * 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. - */ - -/* - * Authors: - * Brian Paul - */ - - -/* - * The functions in this file are mostly related to software texture fallbacks. - * This includes texture image transfer/packing and texel fetching. - * Hardware drivers will likely override most of this. - */ - - - -#include "main/glheader.h" -#include "main/imports.h" -#include "main/colormac.h" -#include "main/context.h" -#include "main/convolve.h" -#include "main/image.h" -#include "main/macros.h" -#include "main/mipmap.h" -#include "main/texformat.h" -#include "main/teximage.h" -#include "main/texstore.h" - -#include "s_context.h" -#include "s_depth.h" -#include "s_span.h" - - -/** - * Read an RGBA image from the frame buffer. - * This is used by glCopyTex[Sub]Image[12]D(). - * \param x window source x - * \param y window source y - * \param width image width - * \param height image height - * \param type datatype for returned GL_RGBA image - * \return pointer to image - */ -static GLvoid * -read_color_image( GLcontext *ctx, GLint x, GLint y, GLenum type, - GLsizei width, GLsizei height ) -{ - struct gl_renderbuffer *rb = ctx->ReadBuffer->_ColorReadBuffer; - const GLint pixelSize = _mesa_bytes_per_pixel(GL_RGBA, type); - const GLint stride = width * pixelSize; - GLint row; - GLubyte *image, *dst; - - image = (GLubyte *) _mesa_malloc(width * height * pixelSize); - if (!image) - return NULL; - - swrast_render_start(ctx); - - dst = image; - for (row = 0; row < height; row++) { - _swrast_read_rgba_span(ctx, rb, width, x, y + row, type, dst); - dst += stride; - } - - swrast_render_finish(ctx); - - return image; -} - - -/** - * As above, but read data from depth buffer. Returned as GLuints. - * \sa read_color_image - */ -static GLuint * -read_depth_image( GLcontext *ctx, GLint x, GLint y, - GLsizei width, GLsizei height ) -{ - struct gl_renderbuffer *rb = ctx->ReadBuffer->_DepthBuffer; - GLuint *image, *dst; - GLint i; - - image = (GLuint *) _mesa_malloc(width * height * sizeof(GLuint)); - if (!image) - return NULL; - - swrast_render_start(ctx); - - dst = image; - for (i = 0; i < height; i++) { - _swrast_read_depth_span_uint(ctx, rb, width, x, y + i, dst); - dst += width; - } - - swrast_render_finish(ctx); - - return image; -} - - -/** - * As above, but read data from depth+stencil buffers. - */ -static GLuint * -read_depth_stencil_image(GLcontext *ctx, GLint x, GLint y, - GLsizei width, GLsizei height) -{ - struct gl_renderbuffer *depthRb = ctx->ReadBuffer->_DepthBuffer; - struct gl_renderbuffer *stencilRb = ctx->ReadBuffer->_StencilBuffer; - GLuint *image, *dst; - GLint i; - - ASSERT(depthRb); - ASSERT(stencilRb); - - image = (GLuint *) _mesa_malloc(width * height * sizeof(GLuint)); - if (!image) - return NULL; - - swrast_render_start(ctx); - - /* read from depth buffer */ - dst = image; - if (depthRb->DataType == GL_UNSIGNED_INT) { - for (i = 0; i < height; i++) { - _swrast_get_row(ctx, depthRb, width, x, y + i, dst, sizeof(GLuint)); - dst += width; - } - } - else { - GLushort z16[MAX_WIDTH]; - ASSERT(depthRb->DataType == GL_UNSIGNED_SHORT); - for (i = 0; i < height; i++) { - GLint j; - _swrast_get_row(ctx, depthRb, width, x, y + i, z16, sizeof(GLushort)); - /* convert GLushorts to GLuints */ - for (j = 0; j < width; j++) { - dst[j] = z16[j]; - } - dst += width; - } - } - - /* put depth values into bits 0xffffff00 */ - if (ctx->ReadBuffer->Visual.depthBits == 24) { - GLint j; - for (j = 0; j < width * height; j++) { - image[j] <<= 8; - } - } - else if (ctx->ReadBuffer->Visual.depthBits == 16) { - GLint j; - for (j = 0; j < width * height; j++) { - image[j] = (image[j] << 16) | (image[j] & 0xff00); - } - } - else { - /* this handles arbitrary depthBits >= 12 */ - const GLint rShift = ctx->ReadBuffer->Visual.depthBits; - const GLint lShift = 32 - rShift; - GLint j; - for (j = 0; j < width * height; j++) { - GLuint z = (image[j] << lShift); - image[j] = z | (z >> rShift); - } - } - - /* read stencil values and interleave into image array */ - dst = image; - for (i = 0; i < height; i++) { - GLstencil stencil[MAX_WIDTH]; - GLint j; - ASSERT(8 * sizeof(GLstencil) == stencilRb->StencilBits); - _swrast_get_row(ctx, stencilRb, width, x, y + i, - stencil, sizeof(GLstencil)); - for (j = 0; j < width; j++) { - dst[j] = (dst[j] & 0xffffff00) | (stencil[j] & 0xff); - } - dst += width; - } - - swrast_render_finish(ctx); - - return image; -} - - -static GLboolean -is_depth_format(GLenum format) -{ - switch (format) { - case GL_DEPTH_COMPONENT: - case GL_DEPTH_COMPONENT16: - case GL_DEPTH_COMPONENT24: - case GL_DEPTH_COMPONENT32: - return GL_TRUE; - default: - return GL_FALSE; - } -} - - -static GLboolean -is_depth_stencil_format(GLenum format) -{ - switch (format) { - case GL_DEPTH_STENCIL_EXT: - case GL_DEPTH24_STENCIL8_EXT: - return GL_TRUE; - default: - return GL_FALSE; - } -} - - -/* - * Fallback for Driver.CopyTexImage1D(). - */ -void -_swrast_copy_teximage1d( GLcontext *ctx, GLenum target, GLint level, - GLenum internalFormat, - GLint x, GLint y, GLsizei width, GLint border ) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - ASSERT(texObj); - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - ASSERT(texImage); - - ASSERT(ctx->Driver.TexImage1D); - - if (is_depth_format(internalFormat)) { - /* read depth image from framebuffer */ - GLuint *image = read_depth_image(ctx, x, y, width, 1); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage1D"); - return; - } - /* call glTexImage1D to redefine the texture */ - ctx->Driver.TexImage1D(ctx, target, level, internalFormat, - width, border, - GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else if (is_depth_stencil_format(internalFormat)) { - /* read depth/stencil image from framebuffer */ - GLuint *image = read_depth_stencil_image(ctx, x, y, width, 1); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage1D"); - return; - } - /* call glTexImage1D to redefine the texture */ - ctx->Driver.TexImage1D(ctx, target, level, internalFormat, - width, border, - GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, - image, &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else { - /* read RGBA image from framebuffer */ - const GLenum format = GL_RGBA; - const GLenum type = ctx->ReadBuffer->_ColorReadBuffer->DataType; - GLvoid *image = read_color_image(ctx, x, y, type, width, 1); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage1D"); - return; - } - /* call glTexImage1D to redefine the texture */ - ctx->Driver.TexImage1D(ctx, target, level, internalFormat, - width, border, format, type, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } -} - - -/** - * Fallback for Driver.CopyTexImage2D(). - * - * We implement CopyTexImage by reading the image from the framebuffer - * then passing it to the ctx->Driver.TexImage2D() function. - * - * Device drivers should try to implement direct framebuffer->texture copies. - */ -void -_swrast_copy_teximage2d( GLcontext *ctx, GLenum target, GLint level, - GLenum internalFormat, - GLint x, GLint y, GLsizei width, GLsizei height, - GLint border ) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - ASSERT(texObj); - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - ASSERT(texImage); - - ASSERT(ctx->Driver.TexImage2D); - - if (is_depth_format(internalFormat)) { - /* read depth image from framebuffer */ - GLuint *image = read_depth_image(ctx, x, y, width, height); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage2D"); - return; - } - /* call glTexImage2D to redefine the texture */ - ctx->Driver.TexImage2D(ctx, target, level, internalFormat, - width, height, border, - GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else if (is_depth_stencil_format(internalFormat)) { - GLuint *image = read_depth_stencil_image(ctx, x, y, width, height); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage2D"); - return; - } - /* call glTexImage2D to redefine the texture */ - ctx->Driver.TexImage2D(ctx, target, level, internalFormat, - width, height, border, - GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, - image, &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else { - /* read RGBA image from framebuffer */ - const GLenum format = GL_RGBA; - const GLenum type = ctx->ReadBuffer->_ColorReadBuffer->DataType; - GLvoid *image = read_color_image(ctx, x, y, type, width, height); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexImage2D"); - return; - } - /* call glTexImage2D to redefine the texture */ - ctx->Driver.TexImage2D(ctx, target, level, internalFormat, - width, height, border, format, type, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } -} - - -/* - * Fallback for Driver.CopyTexSubImage1D(). - */ -void -_swrast_copy_texsubimage1d( GLcontext *ctx, GLenum target, GLint level, - GLint xoffset, GLint x, GLint y, GLsizei width ) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - ASSERT(texObj); - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - ASSERT(texImage); - - ASSERT(ctx->Driver.TexImage1D); - - if (texImage->_BaseFormat == GL_DEPTH_COMPONENT) { - /* read depth image from framebuffer */ - GLuint *image = read_depth_image(ctx, x, y, width, 1); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage1D"); - return; - } - - /* call glTexSubImage1D to redefine the texture */ - ctx->Driver.TexSubImage1D(ctx, target, level, xoffset, width, - GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else if (texImage->_BaseFormat == GL_DEPTH_STENCIL_EXT) { - /* read depth/stencil image from framebuffer */ - GLuint *image = read_depth_stencil_image(ctx, x, y, width, 1); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage1D"); - return; - } - /* call glTexImage1D to redefine the texture */ - ctx->Driver.TexSubImage1D(ctx, target, level, xoffset, width, - GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, - image, &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else { - /* read RGBA image from framebuffer */ - const GLenum format = GL_RGBA; - const GLenum type = ctx->ReadBuffer->_ColorReadBuffer->DataType; - GLvoid *image = read_color_image(ctx, x, y, type, width, 1); - if (!image) { - _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage1D" ); - return; - } - /* now call glTexSubImage1D to do the real work */ - ctx->Driver.TexSubImage1D(ctx, target, level, xoffset, width, - format, type, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } -} - - -/** - * Fallback for Driver.CopyTexSubImage2D(). - * - * Read the image from the framebuffer then hand it - * off to ctx->Driver.TexSubImage2D(). - */ -void -_swrast_copy_texsubimage2d( GLcontext *ctx, - GLenum target, GLint level, - GLint xoffset, GLint yoffset, - GLint x, GLint y, GLsizei width, GLsizei height ) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - ASSERT(texObj); - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - ASSERT(texImage); - - ASSERT(ctx->Driver.TexImage2D); - - if (texImage->_BaseFormat == GL_DEPTH_COMPONENT) { - /* read depth image from framebuffer */ - GLuint *image = read_depth_image(ctx, x, y, width, height); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage2D"); - return; - } - /* call glTexImage2D to redefine the texture */ - ctx->Driver.TexSubImage2D(ctx, target, level, - xoffset, yoffset, width, height, - GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else if (texImage->_BaseFormat == GL_DEPTH_STENCIL_EXT) { - /* read depth/stencil image from framebuffer */ - GLuint *image = read_depth_stencil_image(ctx, x, y, width, height); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage2D"); - return; - } - /* call glTexImage2D to redefine the texture */ - ctx->Driver.TexSubImage2D(ctx, target, level, - xoffset, yoffset, width, height, - GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, - image, &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else { - /* read RGBA image from framebuffer */ - const GLenum format = GL_RGBA; - const GLenum type = ctx->ReadBuffer->_ColorReadBuffer->DataType; - GLvoid *image = read_color_image(ctx, x, y, type, width, height); - if (!image) { - _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage2D" ); - return; - } - /* now call glTexSubImage2D to do the real work */ - ctx->Driver.TexSubImage2D(ctx, target, level, - xoffset, yoffset, width, height, - format, type, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } -} - - -/* - * Fallback for Driver.CopyTexSubImage3D(). - */ -void -_swrast_copy_texsubimage3d( GLcontext *ctx, - GLenum target, GLint level, - GLint xoffset, GLint yoffset, GLint zoffset, - GLint x, GLint y, GLsizei width, GLsizei height ) -{ - struct gl_texture_unit *texUnit; - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(ctx, texUnit, target); - ASSERT(texObj); - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - ASSERT(texImage); - - ASSERT(ctx->Driver.TexImage3D); - - if (texImage->_BaseFormat == GL_DEPTH_COMPONENT) { - /* read depth image from framebuffer */ - GLuint *image = read_depth_image(ctx, x, y, width, height); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage3D"); - return; - } - /* call glTexImage3D to redefine the texture */ - ctx->Driver.TexSubImage3D(ctx, target, level, - xoffset, yoffset, zoffset, width, height, 1, - GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else if (texImage->_BaseFormat == GL_DEPTH_STENCIL_EXT) { - /* read depth/stencil image from framebuffer */ - GLuint *image = read_depth_stencil_image(ctx, x, y, width, height); - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage3D"); - return; - } - /* call glTexImage3D to redefine the texture */ - ctx->Driver.TexSubImage3D(ctx, target, level, - xoffset, yoffset, zoffset, width, height, 1, - GL_DEPTH_STENCIL_EXT, GL_UNSIGNED_INT_24_8_EXT, - image, &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } - else { - /* read RGBA image from framebuffer */ - const GLenum format = GL_RGBA; - const GLenum type = ctx->ReadBuffer->_ColorReadBuffer->DataType; - GLvoid *image = read_color_image(ctx, x, y, type, width, height); - if (!image) { - _mesa_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexSubImage3D" ); - return; - } - /* now call glTexSubImage3D to do the real work */ - ctx->Driver.TexSubImage3D(ctx, target, level, - xoffset, yoffset, zoffset, width, height, 1, - format, type, image, - &ctx->DefaultPacking, texObj, texImage); - _mesa_free(image); - } -} -- cgit v1.2.3 From 368fb578f86c53d888324f9bb25369216b3187b1 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Sat, 19 Sep 2009 14:46:06 -0400 Subject: r600: fix polygon offset --- src/mesa/drivers/dri/r600/r700_state.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index e91aa43118..8477c88c58 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -1130,20 +1130,25 @@ static void r700PolygonOffset(GLcontext * ctx, GLfloat factor, GLfloat units) // context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); GLfloat constant = units; + GLchar depth = 0; + + R600_STATECHANGE(context, poly); switch (ctx->Visual.depthBits) { case 16: constant *= 4.0; + depth = -16; break; case 24: constant *= 2.0; + depth = -24; break; } factor *= 12.0; - - R600_STATECHANGE(context, poly); - + SETfield(r700->PA_SU_POLY_OFFSET_DB_FMT_CNTL.u32All, depth, + POLY_OFFSET_NEG_NUM_DB_BITS_shift, POLY_OFFSET_NEG_NUM_DB_BITS_mask); + //r700->PA_SU_POLY_OFFSET_CLAMP.f32All = constant; //??? r700->PA_SU_POLY_OFFSET_FRONT_SCALE.f32All = factor; r700->PA_SU_POLY_OFFSET_FRONT_OFFSET.f32All = constant; r700->PA_SU_POLY_OFFSET_BACK_SCALE.f32All = factor; -- cgit v1.2.3 From b8477f079bd72d15b2d4e9c1453374d744da5ce7 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Sat, 19 Sep 2009 15:18:42 -0400 Subject: r600: fix point sizes registers takes radius --- src/mesa/drivers/dri/r600/r700_state.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index 8477c88c58..fc0b511684 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -845,9 +845,9 @@ static void r700PointSize(GLcontext * ctx, GLfloat size) size = CLAMP(size, ctx->Const.MinPointSize, ctx->Const.MaxPointSize); /* format is 12.4 fixed point */ - SETfield(r700->PA_SU_POINT_SIZE.u32All, (int)(size * 16), + SETfield(r700->PA_SU_POINT_SIZE.u32All, (int)(size * 8.0), PA_SU_POINT_SIZE__HEIGHT_shift, PA_SU_POINT_SIZE__HEIGHT_mask); - SETfield(r700->PA_SU_POINT_SIZE.u32All, (int)(size * 16), + SETfield(r700->PA_SU_POINT_SIZE.u32All, (int)(size * 8.0), PA_SU_POINT_SIZE__WIDTH_shift, PA_SU_POINT_SIZE__WIDTH_mask); } @@ -862,11 +862,11 @@ static void r700PointParameter(GLcontext * ctx, GLenum pname, const GLfloat * pa /* format is 12.4 fixed point */ switch (pname) { case GL_POINT_SIZE_MIN: - SETfield(r700->PA_SU_POINT_MINMAX.u32All, (int)(ctx->Point.MinSize * 16.0), + SETfield(r700->PA_SU_POINT_MINMAX.u32All, (int)(ctx->Point.MinSize * 8.0), MIN_SIZE_shift, MIN_SIZE_mask); break; case GL_POINT_SIZE_MAX: - SETfield(r700->PA_SU_POINT_MINMAX.u32All, (int)(ctx->Point.MaxSize * 16.0), + SETfield(r700->PA_SU_POINT_MINMAX.u32All, (int)(ctx->Point.MaxSize * 8.0), MAX_SIZE_shift, MAX_SIZE_mask); break; case GL_POINT_DISTANCE_ATTENUATION: -- cgit v1.2.3 From 651cffd626a82d9bf539437ca4bdf8ea4b396fab Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 19 Sep 2009 12:58:55 -0600 Subject: mesa: move _mesa_meta_init/free() calls to core Mesa --- src/mesa/drivers/dri/intel/intel_context.c | 5 ----- src/mesa/drivers/dri/radeon/radeon_common_context.c | 5 ----- src/mesa/drivers/x11/xm_api.c | 7 ------- src/mesa/main/context.c | 5 +++++ 4 files changed, 5 insertions(+), 17 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 03db8b1c68..ab1cf40387 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -38,7 +38,6 @@ #include "swrast_setup/swrast_setup.h" #include "tnl/tnl.h" #include "drivers/common/driverfuncs.h" -#include "drivers/common/meta.h" #include "i830_dri.h" @@ -712,8 +711,6 @@ intelInitContext(struct intel_context *intel, _swrast_allow_pixel_fog(ctx, GL_FALSE); _swrast_allow_vertex_fog(ctx, GL_TRUE); - _mesa_meta_init(ctx); - intel->hw_stencil = mesaVis->stencilBits && mesaVis->depthBits == 24; intel->hw_stipple = 1; @@ -817,8 +814,6 @@ intelDestroyContext(__DRIcontextPrivate * driContextPriv) INTEL_FIREVERTICES(intel); - _mesa_meta_free(&intel->ctx); - meta_destroy_metaops(&intel->meta); intel->vtbl.destroy(intel); diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.c b/src/mesa/drivers/dri/radeon/radeon_common_context.c index 1c53c04da7..d4bea86796 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.c @@ -37,7 +37,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "utils.h" #include "vblank.h" #include "drirenderbuffer.h" -#include "drivers/common/meta.h" #include "main/context.h" #include "main/framebuffer.h" #include "main/renderbuffer.h" @@ -209,8 +208,6 @@ GLboolean radeonInitContext(radeonContextPtr radeon, meta_init_metaops(ctx, &radeon->meta); - _mesa_meta_init(ctx); - /* DRI fields */ radeon->dri.context = driContextPriv; radeon->dri.screen = sPriv; @@ -306,8 +303,6 @@ void radeonDestroyContext(__DRIcontextPrivate *driContextPriv ) assert(radeon); - _mesa_meta_free(radeon->glCtx); - if (radeon == current) { radeon_firevertices(radeon); _mesa_make_current(NULL, NULL, NULL); diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 662c61ae7e..90efd86a6b 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -79,7 +79,6 @@ #include "tnl/t_context.h" #include "tnl/t_pipeline.h" #include "drivers/common/driverfuncs.h" -#include "drivers/common/meta.h" /** * Global X driver lock @@ -1648,9 +1647,6 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) xmesa_register_swrast_functions( mesaCtx ); _swsetup_Wakeup(mesaCtx); - if (TEST_META_FUNCS) - _mesa_meta_init(mesaCtx); - return c; } @@ -1665,9 +1661,6 @@ void XMesaDestroyContext( XMesaContext c ) FXdestroyContext( XMESA_BUFFER(mesaCtx->DrawBuffer) ); #endif - if (TEST_META_FUNCS) - _mesa_meta_free( mesaCtx ); - _swsetup_DestroyContext( mesaCtx ); _swrast_DestroyContext( mesaCtx ); _tnl_DestroyContext( mesaCtx ); diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index f6d4ac4595..4c69e688da 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -149,6 +149,7 @@ #include "version.h" #include "viewport.h" #include "vtxfmt.h" +#include "drivers/common/meta.h" #include "glapi/glthread.h" #include "glapi/glapioffsets.h" #include "glapi/glapitable.h" @@ -926,6 +927,8 @@ _mesa_initialize_context(GLcontext *ctx, _mesa_initialize_context_extra(ctx); #endif + _mesa_meta_init(ctx); + ctx->FirstTimeCurrent = GL_TRUE; return GL_TRUE; @@ -991,6 +994,8 @@ _mesa_free_context_data( GLcontext *ctx ) _mesa_make_current(ctx, NULL, NULL); } + _mesa_meta_free(ctx); + /* unreference WinSysDraw/Read buffers */ _mesa_reference_framebuffer(&ctx->WinSysDrawBuffer, NULL); _mesa_reference_framebuffer(&ctx->WinSysReadBuffer, NULL); -- cgit v1.2.3 From b0e9ea60840b5161634767e391c601ad0cc935b2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 19 Sep 2009 13:37:28 -0600 Subject: mesa: fix some glCopyTex[Sub]Image regressions related to convolution --- src/mesa/drivers/common/meta.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index aa7c73ba36..b1465d1fba 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -38,6 +38,7 @@ #include "main/blend.h" #include "main/bufferobj.h" #include "main/buffers.h" +#include "main/convolve.h" #include "main/depth.h" #include "main/enable.h" #include "main/fbobject.h" @@ -49,6 +50,7 @@ #include "main/readpix.h" #include "main/scissor.h" #include "main/shaders.h" +#include "main/state.h" #include "main/stencil.h" #include "main/texobj.h" #include "main/texenv.h" @@ -2156,6 +2158,7 @@ copy_tex_image(GLcontext *ctx, GLuint dims, GLenum target, GLint level, struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; + GLsizei postConvWidth = width, postConvHeight = height; GLenum format, type; GLint bpp; void *buf; @@ -2191,10 +2194,31 @@ copy_tex_image(GLcontext *ctx, GLuint dims, GLenum target, GLint level, format, type, &ctx->Pack, buf); _mesa_meta_end(ctx); + /* + * Prepare for new texture image size/data + */ +#if FEATURE_convolve + if (_mesa_is_color_format(internalFormat)) { + _mesa_adjust_image_for_convolution(ctx, 2, + &postConvWidth, &postConvHeight); + } +#endif + + if (texImage->Data) { + ctx->Driver.FreeTexImageData(ctx, texImage); + } + + _mesa_init_teximage_fields(ctx, target, texImage, + postConvWidth, postConvHeight, 1, + border, internalFormat); + /* * Store texture data (with pixel transfer ops) */ _mesa_meta_begin(ctx, META_PIXEL_STORE); + + _mesa_update_state(ctx); /* to update pixel transfer state */ + if (target == GL_TEXTURE_1D) { ctx->Driver.TexImage1D(ctx, target, level, internalFormat, width, border, format, type, @@ -2282,6 +2306,8 @@ copy_tex_sub_image(GLcontext *ctx, GLuint dims, GLenum target, GLint level, format, type, &ctx->Pack, buf); _mesa_meta_end(ctx); + _mesa_update_state(ctx); /* to update pixel transfer state */ + /* * Store texture data (with pixel transfer ops) */ -- cgit v1.2.3 From 3ed9dab19cfb2576f2a0fef92107f9246db7bdc1 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 19 Sep 2009 16:13:01 -0600 Subject: mesa: use _mesa_get_current_tex_unit() helper --- src/mesa/main/colortab.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c index 5a7de5f209..fcd54bc5cc 100644 --- a/src/mesa/main/colortab.c +++ b/src/mesa/main/colortab.c @@ -31,6 +31,7 @@ #include "macros.h" #include "state.h" #include "teximage.h" +#include "texstate.h" /** @@ -278,7 +279,7 @@ _mesa_ColorTable( GLenum target, GLenum internalFormat, static const GLfloat one[4] = { 1.0, 1.0, 1.0, 1.0 }; static const GLfloat zero[4] = { 0.0, 0.0, 0.0, 0.0 }; GET_CURRENT_CONTEXT(ctx); - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); struct gl_texture_object *texObj = NULL; struct gl_color_table *table = NULL; GLboolean proxy = GL_FALSE; @@ -443,7 +444,7 @@ _mesa_ColorSubTable( GLenum target, GLsizei start, static const GLfloat one[4] = { 1.0, 1.0, 1.0, 1.0 }; static const GLfloat zero[4] = { 0.0, 0.0, 0.0, 0.0 }; GET_CURRENT_CONTEXT(ctx); - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); struct gl_texture_object *texObj = NULL; struct gl_color_table *table = NULL; const GLfloat *scale = one, *bias = zero; @@ -565,7 +566,7 @@ _mesa_GetColorTable( GLenum target, GLenum format, GLenum type, GLvoid *data ) { GET_CURRENT_CONTEXT(ctx); - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); struct gl_color_table *table = NULL; GLfloat rgba[MAX_COLOR_TABLE_SIZE][4]; ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); @@ -766,7 +767,7 @@ void GLAPIENTRY _mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ) { GET_CURRENT_CONTEXT(ctx); - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); struct gl_color_table *table = NULL; ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -893,7 +894,7 @@ void GLAPIENTRY _mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ) { GET_CURRENT_CONTEXT(ctx); - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); struct gl_color_table *table = NULL; ASSERT_OUTSIDE_BEGIN_END(ctx); -- cgit v1.2.3 From 883dd9d770f0d25fb8474dc381faa99ee38de0e6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 19 Sep 2009 16:16:48 -0600 Subject: mesa: use _mesa_get_current_tex_unit() helper --- src/mesa/main/texgen.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texgen.c b/src/mesa/main/texgen.c index e3feb024c3..b3ecfc784e 100644 --- a/src/mesa/main/texgen.c +++ b/src/mesa/main/texgen.c @@ -35,6 +35,7 @@ #include "main/enums.h" #include "main/macros.h" #include "main/texgen.h" +#include "main/texstate.h" #include "math/m_matrix.h" @@ -79,7 +80,7 @@ _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) return; } - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + texUnit = _mesa_get_current_tex_unit(ctx); texgen = get_texgen(texUnit, coord); if (!texgen) { @@ -231,7 +232,7 @@ _mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ) return; } - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + texUnit = _mesa_get_current_tex_unit(ctx); texgen = get_texgen(texUnit, coord); if (!texgen) { @@ -269,7 +270,7 @@ _mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ) return; } - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + texUnit = _mesa_get_current_tex_unit(ctx); texgen = get_texgen(texUnit, coord); if (!texgen) { @@ -307,7 +308,7 @@ _mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ) return; } - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + texUnit = _mesa_get_current_tex_unit(ctx); texgen = get_texgen(texUnit, coord); if (!texgen) { -- cgit v1.2.3 From dc3839ef3dc032627b7bb10b2c24786efc3ef5ec Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 19 Sep 2009 16:27:59 -0600 Subject: mesa: move readbuffer tests --- src/mesa/main/colortab.c | 9 ++++++++- src/mesa/main/convolve.c | 8 ++++++++ src/mesa/swrast/s_imaging.c | 20 -------------------- 3 files changed, 16 insertions(+), 21 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c index fcd54bc5cc..5447eb18ef 100644 --- a/src/mesa/main/colortab.c +++ b/src/mesa/main/colortab.c @@ -543,7 +543,10 @@ _mesa_CopyColorTable(GLenum target, GLenum internalformat, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - /* Select buffer to read from */ + if (!ctx->ReadBuffer->_ColorReadBuffer) { + return; /* no readbuffer - OK */ + } + ctx->Driver.CopyColorTable( ctx, target, internalformat, x, y, width ); } @@ -556,6 +559,10 @@ _mesa_CopyColorSubTable(GLenum target, GLsizei start, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (!ctx->ReadBuffer->_ColorReadBuffer) { + return; /* no readbuffer - OK */ + } + ctx->Driver.CopyColorSubTable( ctx, target, start, x, y, width ); } diff --git a/src/mesa/main/convolve.c b/src/mesa/main/convolve.c index 70951112a1..bf6f6619d4 100644 --- a/src/mesa/main/convolve.c +++ b/src/mesa/main/convolve.c @@ -482,6 +482,10 @@ _mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat, GLint x, GLi return; } + if (!ctx->ReadBuffer->_ColorReadBuffer) { + return; /* no readbuffer - OK */ + } + ctx->Driver.CopyConvolutionFilter1D( ctx, target, internalFormat, x, y, width); } @@ -514,6 +518,10 @@ _mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLi return; } + if (!ctx->ReadBuffer->_ColorReadBuffer) { + return; /* no readbuffer - OK */ + } + ctx->Driver.CopyConvolutionFilter2D( ctx, target, internalFormat, x, y, width, height ); } diff --git a/src/mesa/swrast/s_imaging.c b/src/mesa/swrast/s_imaging.c index 3578b713f6..5a860a51ba 100644 --- a/src/mesa/swrast/s_imaging.c +++ b/src/mesa/swrast/s_imaging.c @@ -42,11 +42,6 @@ _swrast_CopyColorTable( GLcontext *ctx, GLchan data[MAX_WIDTH][4]; struct gl_buffer_object *bufferSave; - if (!ctx->ReadBuffer->_ColorReadBuffer) { - /* no readbuffer - OK */ - return; - } - if (width > MAX_WIDTH) width = MAX_WIDTH; @@ -76,11 +71,6 @@ _swrast_CopyColorSubTable( GLcontext *ctx,GLenum target, GLsizei start, GLchan data[MAX_WIDTH][4]; struct gl_buffer_object *bufferSave; - if (!ctx->ReadBuffer->_ColorReadBuffer) { - /* no readbuffer - OK */ - return; - } - if (width > MAX_WIDTH) width = MAX_WIDTH; @@ -111,11 +101,6 @@ _swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target, GLchan rgba[MAX_CONVOLUTION_WIDTH][4]; struct gl_buffer_object *bufferSave; - if (!ctx->ReadBuffer->_ColorReadBuffer) { - /* no readbuffer - OK */ - return; - } - swrast_render_start(ctx); /* read the data from framebuffer */ @@ -147,11 +132,6 @@ _swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, GLint i; struct gl_buffer_object *bufferSave; - if (!ctx->ReadBuffer->_ColorReadBuffer) { - /* no readbuffer - OK */ - return; - } - swrast_render_start(ctx); /* read pixels from framebuffer */ -- cgit v1.2.3 From 3e5a35269b201d25e2a63743d8d4b1b4311b6fb0 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 19 Sep 2009 16:32:42 -0600 Subject: mesa: meta functions for glCopyColorTable, glCopyConvolutionFilter, etc --- src/mesa/drivers/common/meta.c | 122 +++++++++++++++++++++++++++++++++++++++++ src/mesa/drivers/common/meta.h | 19 +++++++ 2 files changed, 141 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index b1465d1fba..5857feb4b5 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -38,6 +38,7 @@ #include "main/blend.h" #include "main/bufferobj.h" #include "main/buffers.h" +#include "main/colortab.h" #include "main/convolve.h" #include "main/depth.h" #include "main/enable.h" @@ -2365,3 +2366,124 @@ _mesa_meta_CopyTexSubImage3D(GLcontext *ctx, GLenum target, GLint level, copy_tex_sub_image(ctx, 3, target, level, xoffset, yoffset, zoffset, x, y, width, height); } + + +void +_mesa_meta_CopyColorTable(GLcontext *ctx, + GLenum target, GLenum internalformat, + GLint x, GLint y, GLsizei width) +{ + GLfloat *buf; + + buf = (GLfloat *) _mesa_malloc(width * 4 * sizeof(GLfloat)); + if (!buf) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyColorTable"); + return; + } + + /* + * Read image from framebuffer (disable pixel transfer ops) + */ + _mesa_meta_begin(ctx, META_PIXEL_STORE | META_PIXEL_TRANSFER); + ctx->Driver.ReadPixels(ctx, x, y, width, 1, + GL_RGBA, GL_FLOAT, &ctx->Pack, buf); + + _mesa_ColorTable(target, internalformat, width, GL_RGBA, GL_FLOAT, buf); + + _mesa_meta_end(ctx); + + _mesa_free(buf); +} + + +void +_mesa_meta_CopyColorSubTable(GLcontext *ctx,GLenum target, GLsizei start, + GLint x, GLint y, GLsizei width) +{ + GLfloat *buf; + + buf = (GLfloat *) _mesa_malloc(width * 4 * sizeof(GLfloat)); + if (!buf) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyColorSubTable"); + return; + } + + /* + * Read image from framebuffer (disable pixel transfer ops) + */ + _mesa_meta_begin(ctx, META_PIXEL_STORE | META_PIXEL_TRANSFER); + ctx->Driver.ReadPixels(ctx, x, y, width, 1, + GL_RGBA, GL_FLOAT, &ctx->Pack, buf); + + _mesa_ColorSubTable(target, start, width, GL_RGBA, GL_FLOAT, buf); + + _mesa_meta_end(ctx); + + _mesa_free(buf); +} + + +void +_mesa_meta_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target, + GLenum internalFormat, + GLint x, GLint y, GLsizei width) +{ + GLfloat *buf; + + buf = (GLfloat *) _mesa_malloc(width * 4 * sizeof(GLfloat)); + if (!buf) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyConvolutionFilter2D"); + return; + } + + /* + * Read image from framebuffer (disable pixel transfer ops) + */ + _mesa_meta_begin(ctx, META_PIXEL_STORE | META_PIXEL_TRANSFER); + _mesa_update_state(ctx); + ctx->Driver.ReadPixels(ctx, x, y, width, 1, + GL_RGBA, GL_FLOAT, &ctx->Pack, buf); + + _mesa_ConvolutionFilter1D(target, internalFormat, width, + GL_RGBA, GL_FLOAT, buf); + + _mesa_meta_end(ctx); + + _mesa_free(buf); +} + + +void +_mesa_meta_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, + GLenum internalFormat, GLint x, GLint y, + GLsizei width, GLsizei height) +{ + GLfloat *buf; + + if (!ctx->ReadBuffer->_ColorReadBuffer) { + /* no readbuffer - OK */ + return; + } + + buf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); + if (!buf) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyConvolutionFilter2D"); + return; + } + + /* + * Read image from framebuffer (disable pixel transfer ops) + */ + _mesa_meta_begin(ctx, META_PIXEL_STORE | META_PIXEL_TRANSFER); + _mesa_update_state(ctx); + + ctx->Driver.ReadPixels(ctx, x, y, width, height, + GL_RGBA, GL_FLOAT, &ctx->Pack, buf); + + _mesa_ConvolutionFilter2D(target, internalFormat, width, height, + GL_RGBA, GL_FLOAT, buf); + + _mesa_meta_end(ctx); + + _mesa_free(buf); +} diff --git a/src/mesa/drivers/common/meta.h b/src/mesa/drivers/common/meta.h index 9f7100f09c..c30671741f 100644 --- a/src/mesa/drivers/common/meta.h +++ b/src/mesa/drivers/common/meta.h @@ -91,5 +91,24 @@ _mesa_meta_CopyTexSubImage3D(GLcontext *ctx, GLenum target, GLint level, GLint x, GLint y, GLsizei width, GLsizei height); +extern void +_mesa_meta_CopyColorTable(GLcontext *ctx, + GLenum target, GLenum internalformat, + GLint x, GLint y, GLsizei width); + +extern void +_mesa_meta_CopyColorSubTable(GLcontext *ctx,GLenum target, GLsizei start, + GLint x, GLint y, GLsizei width); + +extern void +_mesa_meta_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target, + GLenum internalFormat, + GLint x, GLint y, GLsizei width); + +extern void +_mesa_meta_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, + GLenum internalFormat, GLint x, GLint y, + GLsizei width, GLsizei height); + #endif /* META_H */ -- cgit v1.2.3 From bc1c8d4af768be12ae96bc080e7e52b0c4cbfbdb Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 19 Sep 2009 16:33:09 -0600 Subject: mesa: use new meta functions --- src/mesa/drivers/common/driverfuncs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index e72fcd3d9a..f09106b77c 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -130,10 +130,10 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->UpdateTexturePalette = NULL; /* imaging */ - driver->CopyColorTable = _swrast_CopyColorTable; - driver->CopyColorSubTable = _swrast_CopyColorSubTable; - driver->CopyConvolutionFilter1D = _swrast_CopyConvolutionFilter1D; - driver->CopyConvolutionFilter2D = _swrast_CopyConvolutionFilter2D; + driver->CopyColorTable = _mesa_meta_CopyColorTable; + driver->CopyColorSubTable = _mesa_meta_CopyColorSubTable; + driver->CopyConvolutionFilter1D = _mesa_meta_CopyConvolutionFilter1D; + driver->CopyConvolutionFilter2D = _mesa_meta_CopyConvolutionFilter2D; /* Vertex/fragment programs */ driver->BindProgram = NULL; -- cgit v1.2.3 From 32e4b6c6073b71cac195ca011c4a0eaad8b0851c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 19 Sep 2009 16:36:15 -0600 Subject: windows: replace old ColorTable, Convolution functions with new --- src/mesa/drivers/windows/gdi/mesa.def | 8 ++++---- src/mesa/drivers/windows/icd/mesa.def | 8 ++++---- src/mesa/glapi/mesadef.py | 8 ++++---- 3 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/windows/gdi/mesa.def b/src/mesa/drivers/windows/gdi/mesa.def index c588c5703c..5abcd1d927 100644 --- a/src/mesa/drivers/windows/gdi/mesa.def +++ b/src/mesa/drivers/windows/gdi/mesa.def @@ -943,6 +943,10 @@ EXPORTS _mesa_update_framebuffer_visual _mesa_use_program _mesa_Viewport + _mesa_meta_CopyColorSubTable + _mesa_meta_CopyColorTable + _mesa_meta_CopyConvolutionFilter1D + _mesa_meta_CopyConvolutionFilter2D _mesa_meta_CopyTexImage1D _mesa_meta_CopyTexImage2D _mesa_meta_CopyTexSubImage1D @@ -958,10 +962,6 @@ EXPORTS _swrast_Clear _swrast_choose_line _swrast_choose_triangle - _swrast_CopyColorSubTable - _swrast_CopyColorTable - _swrast_CopyConvolutionFilter1D - _swrast_CopyConvolutionFilter2D _swrast_CreateContext _swrast_DestroyContext _swrast_exec_fragment_program diff --git a/src/mesa/drivers/windows/icd/mesa.def b/src/mesa/drivers/windows/icd/mesa.def index 000dc9d983..25ac08a2f0 100644 --- a/src/mesa/drivers/windows/icd/mesa.def +++ b/src/mesa/drivers/windows/icd/mesa.def @@ -75,6 +75,10 @@ EXPORTS _mesa_strcmp _mesa_test_proxy_teximage _mesa_Viewport + _mesa_meta_CopyColorSubTable + _mesa_meta_CopyColorTable + _mesa_meta_CopyConvolutionFilter1D + _mesa_meta_CopyConvolutionFilter2D _mesa_meta_CopyTexImage1D _mesa_meta_CopyTexImage2D _mesa_meta_CopyTexSubImage1D @@ -89,10 +93,6 @@ EXPORTS _swrast_Clear _swrast_choose_line _swrast_choose_triangle - _swrast_CopyColorSubTable - _swrast_CopyColorTable - _swrast_CopyConvolutionFilter1D - _swrast_CopyConvolutionFilter2D _swrast_CreateContext _swrast_DestroyContext _swrast_InvalidateState diff --git a/src/mesa/glapi/mesadef.py b/src/mesa/glapi/mesadef.py index 92d956761b..342c9cde46 100644 --- a/src/mesa/glapi/mesadef.py +++ b/src/mesa/glapi/mesadef.py @@ -155,6 +155,10 @@ def PrintTail(): print '\t_mesa_strcmp' print '\t_mesa_test_proxy_teximage' print '\t_mesa_Viewport' + print '\t_mesa_meta_CopyColorSubTable' + print '\t_mesa_meta_CopyColorTable' + print '\t_mesa_meta_CopyConvolutionFilter1D' + print '\t_mesa_meta_CopyConvolutionFilter2D' print '\t_mesa_meta_CopyTexImage1D' print '\t_mesa_meta_CopyTexImage2D' print '\t_mesa_meta_CopyTexSubImage1D' @@ -169,10 +173,6 @@ def PrintTail(): print '\t_swrast_Clear' print '\t_swrast_choose_line' print '\t_swrast_choose_triangle' - print '\t_swrast_CopyColorSubTable' - print '\t_swrast_CopyColorTable' - print '\t_swrast_CopyConvolutionFilter1D' - print '\t_swrast_CopyConvolutionFilter2D' print '\t_swrast_CreateContext' print '\t_swrast_DestroyContext' print '\t_swrast_InvalidateState' -- cgit v1.2.3 From 58e843dda05e2addfe6584c5480fb2181b0aff53 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 19 Sep 2009 16:40:09 -0600 Subject: mesa: remove s_imaging.c from build --- src/mesa/sources.mak | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak index 0ae1a11cae..7107538cee 100644 --- a/src/mesa/sources.mak +++ b/src/mesa/sources.mak @@ -115,7 +115,6 @@ SWRAST_SOURCES = \ swrast/s_feedback.c \ swrast/s_fog.c \ swrast/s_fragprog.c \ - swrast/s_imaging.c \ swrast/s_lines.c \ swrast/s_logic.c \ swrast/s_masking.c \ -- cgit v1.2.3 From 7e0f2ce9410506277a9f17e2713006a2b510c319 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 19 Sep 2009 16:41:37 -0600 Subject: swrast: remove prototypes for obsolete functions --- src/mesa/swrast/swrast.h | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/swrast.h b/src/mesa/swrast/swrast.h index 3a352a2f4d..c183b315b6 100644 --- a/src/mesa/swrast/swrast.h +++ b/src/mesa/swrast/swrast.h @@ -207,27 +207,6 @@ extern void _swrast_print_vertex( GLcontext *ctx, const SWvertex *v ); -/* - * Imaging fallbacks (a better solution should be found, perhaps - * moving all the imaging fallback code to a new module) - */ -extern void -_swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, - GLenum internalFormat, - GLint x, GLint y, GLsizei width, - GLsizei height); -extern void -_swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target, - GLenum internalFormat, - GLint x, GLint y, GLsizei width); -extern void -_swrast_CopyColorSubTable( GLcontext *ctx,GLenum target, GLsizei start, - GLint x, GLint y, GLsizei width); -extern void -_swrast_CopyColorTable( GLcontext *ctx, - GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width); - extern void _swrast_eject_texture_images(GLcontext *ctx); -- cgit v1.2.3 From 232fc7d333fff6895d892929e438b7a808f774b0 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 19 Sep 2009 16:42:36 -0600 Subject: swrast: remove obsolete s_imaging.c file --- src/mesa/swrast/s_imaging.c | 176 -------------------------------------------- 1 file changed, 176 deletions(-) delete mode 100644 src/mesa/swrast/s_imaging.c (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_imaging.c b/src/mesa/swrast/s_imaging.c deleted file mode 100644 index 5a860a51ba..0000000000 --- a/src/mesa/swrast/s_imaging.c +++ /dev/null @@ -1,176 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5 - * - * Copyright (C) 1999-2005 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * 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. - */ - -/* KW: Moved these here to remove knowledge of swrast from core mesa. - * Should probably pull the entire software implementation of these - * extensions into either swrast or a sister module. - */ - -#include "main/glheader.h" -#include "main/colortab.h" -#include "main/convolve.h" -#include "s_context.h" -#include "s_span.h" - - -void -_swrast_CopyColorTable( GLcontext *ctx, - GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width) -{ - GLchan data[MAX_WIDTH][4]; - struct gl_buffer_object *bufferSave; - - if (width > MAX_WIDTH) - width = MAX_WIDTH; - - swrast_render_start(ctx); - - /* read the data from framebuffer */ - _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, x, y, CHAN_TYPE, data ); - - swrast_render_finish(ctx); - - /* save PBO binding */ - bufferSave = ctx->Unpack.BufferObj; - ctx->Unpack.BufferObj = ctx->Shared->NullBufferObj; - - _mesa_ColorTable(target, internalformat, width, GL_RGBA, CHAN_TYPE, data); - - /* restore PBO binding */ - ctx->Unpack.BufferObj = bufferSave; -} - - -void -_swrast_CopyColorSubTable( GLcontext *ctx,GLenum target, GLsizei start, - GLint x, GLint y, GLsizei width) -{ - GLchan data[MAX_WIDTH][4]; - struct gl_buffer_object *bufferSave; - - if (width > MAX_WIDTH) - width = MAX_WIDTH; - - swrast_render_start(ctx); - - /* read the data from framebuffer */ - _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, x, y, CHAN_TYPE, data ); - - swrast_render_finish(ctx); - - /* save PBO binding */ - bufferSave = ctx->Unpack.BufferObj; - ctx->Unpack.BufferObj = ctx->Shared->NullBufferObj; - - _mesa_ColorSubTable(target, start, width, GL_RGBA, CHAN_TYPE, data); - - /* restore PBO binding */ - ctx->Unpack.BufferObj = bufferSave; -} - - -void -_swrast_CopyConvolutionFilter1D(GLcontext *ctx, GLenum target, - GLenum internalFormat, - GLint x, GLint y, GLsizei width) -{ - GLchan rgba[MAX_CONVOLUTION_WIDTH][4]; - struct gl_buffer_object *bufferSave; - - swrast_render_start(ctx); - - /* read the data from framebuffer */ - _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, x, y, CHAN_TYPE, rgba ); - - swrast_render_finish(ctx); - - /* save PBO binding */ - bufferSave = ctx->Unpack.BufferObj; - ctx->Unpack.BufferObj = ctx->Shared->NullBufferObj; - - /* store as convolution filter */ - _mesa_ConvolutionFilter1D(target, internalFormat, width, - GL_RGBA, CHAN_TYPE, rgba); - - /* restore PBO binding */ - ctx->Unpack.BufferObj = bufferSave; -} - - -void -_swrast_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, - GLenum internalFormat, - GLint x, GLint y, GLsizei width, GLsizei height) -{ - struct gl_pixelstore_attrib packSave; - GLchan rgba[MAX_CONVOLUTION_HEIGHT][MAX_CONVOLUTION_WIDTH][4]; - GLint i; - struct gl_buffer_object *bufferSave; - - swrast_render_start(ctx); - - /* read pixels from framebuffer */ - for (i = 0; i < height; i++) { - _swrast_read_rgba_span( ctx, ctx->ReadBuffer->_ColorReadBuffer, - width, x, y + i, CHAN_TYPE, rgba[i] ); - } - - swrast_render_finish(ctx); - - /* - * HACK: save & restore context state so we can store this as a - * convolution filter via the GL api. Doesn't call any callbacks - * hanging off ctx->Unpack statechanges. - */ - - packSave = ctx->Unpack; /* save pixel packing params */ - - ctx->Unpack.Alignment = 1; - ctx->Unpack.RowLength = MAX_CONVOLUTION_WIDTH; - ctx->Unpack.SkipPixels = 0; - ctx->Unpack.SkipRows = 0; - ctx->Unpack.ImageHeight = 0; - ctx->Unpack.SkipImages = 0; - ctx->Unpack.SwapBytes = GL_FALSE; - ctx->Unpack.LsbFirst = GL_FALSE; - ctx->Unpack.BufferObj = ctx->Shared->NullBufferObj; - ctx->NewState |= _NEW_PACKUNPACK; - - /* save PBO binding */ - bufferSave = ctx->Unpack.BufferObj; - ctx->Unpack.BufferObj = ctx->Shared->NullBufferObj; - - _mesa_ConvolutionFilter2D(target, internalFormat, width, height, - GL_RGBA, CHAN_TYPE, rgba); - - /* restore PBO binding */ - ctx->Unpack.BufferObj = bufferSave; - - ctx->Unpack = packSave; /* restore pixel packing params */ - ctx->NewState |= _NEW_PACKUNPACK; -} -- cgit v1.2.3 From 4de8e2123ebeb50db252b2bb57fb167058fa4683 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 19 Sep 2009 17:06:15 -0600 Subject: mesa: rename functions to be more consistant with rest of mesa --- src/mesa/drivers/common/meta.c | 49 +++++++++++++-------------- src/mesa/drivers/common/meta.h | 32 ++++++++--------- src/mesa/drivers/dri/intel/intel_clear.c | 2 +- src/mesa/drivers/dri/intel/intel_fbo.c | 2 +- src/mesa/drivers/dri/intel/intel_pixel_copy.c | 2 +- src/mesa/drivers/dri/intel/intel_pixel_draw.c | 8 ++--- src/mesa/drivers/dri/radeon/radeon_common.c | 2 +- src/mesa/drivers/dri/radeon/radeon_fbo.c | 2 +- src/mesa/drivers/x11/xm_dd.c | 10 +++--- 9 files changed, 54 insertions(+), 55 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 5857feb4b5..be32ae6902 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -274,12 +274,12 @@ struct gl_meta_state struct temp_texture TempTex; - struct blit_state Blit; /**< For _mesa_meta_blit_framebuffer() */ - struct clear_state Clear; /**< For _mesa_meta_clear() */ - struct copypix_state CopyPix; /**< For _mesa_meta_copy_pixels() */ - struct drawpix_state DrawPix; /**< For _mesa_meta_draw_pixels() */ - struct bitmap_state Bitmap; /**< For _mesa_meta_bitmap() */ - struct gen_mipmap_state Mipmap; /**< For _mesa_meta_generate_mipmap() */ + struct blit_state Blit; /**< For _mesa_meta_BlitFramebuffer() */ + struct clear_state Clear; /**< For _mesa_meta_Clear() */ + struct copypix_state CopyPix; /**< For _mesa_meta_CopyPixels() */ + struct drawpix_state DrawPix; /**< For _mesa_meta_DrawPixels() */ + struct bitmap_state Bitmap; /**< For _mesa_meta_Bitmap() */ + struct gen_mipmap_state Mipmap; /**< For _mesa_meta_GenerateMipmap() */ }; @@ -1055,10 +1055,10 @@ init_blit_depth_pixels(GLcontext *ctx) * of texture mapping and polygon rendering. */ void -_mesa_meta_blit_framebuffer(GLcontext *ctx, - GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, - GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, - GLbitfield mask, GLenum filter) +_mesa_meta_BlitFramebuffer(GLcontext *ctx, + GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, + GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, + GLbitfield mask, GLenum filter) { struct blit_state *blit = &ctx->Meta->Blit; struct temp_texture *tex = get_temp_texture(ctx); @@ -1204,7 +1204,7 @@ _mesa_meta_blit_framebuffer(GLcontext *ctx, * Meta implementation of ctx->Driver.Clear() in terms of polygon rendering. */ void -_mesa_meta_clear(GLcontext *ctx, GLbitfield buffers) +_mesa_meta_Clear(GLcontext *ctx, GLbitfield buffers) { struct clear_state *clear = &ctx->Meta->Clear; struct vertex { @@ -1323,9 +1323,9 @@ _mesa_meta_clear(GLcontext *ctx, GLbitfield buffers) * of texture mapping and polygon rendering. */ void -_mesa_meta_copy_pixels(GLcontext *ctx, GLint srcX, GLint srcY, - GLsizei width, GLsizei height, - GLint dstX, GLint dstY, GLenum type) +_mesa_meta_CopyPixels(GLcontext *ctx, GLint srcX, GLint srcY, + GLsizei width, GLsizei height, + GLint dstX, GLint dstY, GLenum type) { struct copypix_state *copypix = &ctx->Meta->CopyPix; struct temp_texture *tex = get_temp_texture(ctx); @@ -1462,9 +1462,8 @@ tiled_draw_pixels(GLcontext *ctx, tileUnpack.SkipRows = unpack->SkipRows + j; - _mesa_meta_draw_pixels(ctx, tileX, tileY, - tileWidth, tileHeight, - format, type, &tileUnpack, pixels); + _mesa_meta_DrawPixels(ctx, tileX, tileY, tileWidth, tileHeight, + format, type, &tileUnpack, pixels); } } } @@ -1573,11 +1572,11 @@ init_draw_depth_pixels(GLcontext *ctx) * of texture mapping and polygon rendering. */ void -_mesa_meta_draw_pixels(GLcontext *ctx, - GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *unpack, - const GLvoid *pixels) +_mesa_meta_DrawPixels(GLcontext *ctx, + GLint x, GLint y, GLsizei width, GLsizei height, + GLenum format, GLenum type, + const struct gl_pixelstore_attrib *unpack, + const GLvoid *pixels) { struct drawpix_state *drawpix = &ctx->Meta->DrawPix; struct temp_texture *tex = get_temp_texture(ctx); @@ -1812,7 +1811,7 @@ _mesa_meta_draw_pixels(GLcontext *ctx, * improve performance a lot. */ void -_mesa_meta_bitmap(GLcontext *ctx, +_mesa_meta_Bitmap(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, const struct gl_pixelstore_attrib *unpack, const GLubyte *bitmap1) @@ -1953,8 +1952,8 @@ _mesa_meta_bitmap(GLcontext *ctx, void -_mesa_meta_generate_mipmap(GLcontext *ctx, GLenum target, - struct gl_texture_object *texObj) +_mesa_meta_GenerateMipmap(GLcontext *ctx, GLenum target, + struct gl_texture_object *texObj) { struct gen_mipmap_state *mipmap = &ctx->Meta->Mipmap; struct vertex { diff --git a/src/mesa/drivers/common/meta.h b/src/mesa/drivers/common/meta.h index c30671741f..7f659528dc 100644 --- a/src/mesa/drivers/common/meta.h +++ b/src/mesa/drivers/common/meta.h @@ -34,35 +34,35 @@ extern void _mesa_meta_free(GLcontext *ctx); extern void -_mesa_meta_blit_framebuffer(GLcontext *ctx, - GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, - GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, - GLbitfield mask, GLenum filter); +_mesa_meta_BlitFramebuffer(GLcontext *ctx, + GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, + GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, + GLbitfield mask, GLenum filter); extern void -_mesa_meta_clear(GLcontext *ctx, GLbitfield buffers); +_mesa_meta_Clear(GLcontext *ctx, GLbitfield buffers); extern void -_mesa_meta_copy_pixels(GLcontext *ctx, GLint srcx, GLint srcy, - GLsizei width, GLsizei height, - GLint dstx, GLint dsty, GLenum type); +_mesa_meta_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, + GLsizei width, GLsizei height, + GLint dstx, GLint dsty, GLenum type); extern void -_mesa_meta_draw_pixels(GLcontext *ctx, - GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, - const struct gl_pixelstore_attrib *unpack, - const GLvoid *pixels); +_mesa_meta_DrawPixels(GLcontext *ctx, + GLint x, GLint y, GLsizei width, GLsizei height, + GLenum format, GLenum type, + const struct gl_pixelstore_attrib *unpack, + const GLvoid *pixels); extern void -_mesa_meta_bitmap(GLcontext *ctx, +_mesa_meta_Bitmap(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, const struct gl_pixelstore_attrib *unpack, const GLubyte *bitmap); extern void -_mesa_meta_generate_mipmap(GLcontext *ctx, GLenum target, - struct gl_texture_object *texObj); +_mesa_meta_GenerateMipmap(GLcontext *ctx, GLenum target, + struct gl_texture_object *texObj); extern void _mesa_meta_CopyTexImage1D(GLcontext *ctx, GLenum target, GLint level, diff --git a/src/mesa/drivers/dri/intel/intel_clear.c b/src/mesa/drivers/dri/intel/intel_clear.c index 9efe6a277c..4ce783f450 100644 --- a/src/mesa/drivers/dri/intel/intel_clear.c +++ b/src/mesa/drivers/dri/intel/intel_clear.c @@ -171,7 +171,7 @@ intelClear(GLcontext *ctx, GLbitfield mask) DBG("\n"); } intelFlush(&intel->ctx); - _mesa_meta_clear(&intel->ctx, tri_mask); + _mesa_meta_Clear(&intel->ctx, tri_mask); } if (swrast_mask) { diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 804c034840..8dfb24290d 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -715,5 +715,5 @@ intel_fbo_init(struct intel_context *intel) intel->ctx.Driver.FinishRenderTexture = intel_finish_render_texture; intel->ctx.Driver.ResizeBuffers = intel_resize_buffers; intel->ctx.Driver.ValidateFramebuffer = intel_validate_framebuffer; - intel->ctx.Driver.BlitFramebuffer = _mesa_meta_blit_framebuffer; + intel->ctx.Driver.BlitFramebuffer = _mesa_meta_BlitFramebuffer; } diff --git a/src/mesa/drivers/dri/intel/intel_pixel_copy.c b/src/mesa/drivers/dri/intel/intel_pixel_copy.c index 07ca8f7ddb..f058b3c8e4 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_copy.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_copy.c @@ -240,5 +240,5 @@ intelCopyPixels(GLcontext * ctx, return; /* this will use swrast if needed */ - _mesa_meta_copy_pixels(ctx, srcx, srcy, width, height, destx, desty, type); + _mesa_meta_CopyPixels(ctx, srcx, srcy, width, height, destx, desty, type); } diff --git a/src/mesa/drivers/dri/intel/intel_pixel_draw.c b/src/mesa/drivers/dri/intel/intel_pixel_draw.c index 7fbb89fd6a..5ffa847fd4 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_draw.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_draw.c @@ -54,7 +54,7 @@ #include "intel_fbo.h" -/** XXX compare perf of this vs. _mesa_meta_draw_pixels(STENCIL) */ +/** XXX compare perf of this vs. _mesa_meta_DrawPixels(STENCIL) */ static GLboolean intel_stencil_drawpixels(GLcontext * ctx, GLint x, GLint y, @@ -265,7 +265,7 @@ intelDrawPixels(GLcontext * ctx, /* XXX this function doesn't seem to work reliably even when all * the pre-requisite conditions are met. * Note that this function is never hit with conform. - * Fall back to swrast because even the _mesa_meta_draw_pixels() approach + * Fall back to swrast because even the _mesa_meta_DrawPixels() approach * isn't working because of an apparent stencil bug. */ if (intel_stencil_drawpixels(ctx, x, y, width, height, format, type, @@ -280,6 +280,6 @@ intelDrawPixels(GLcontext * ctx, } #endif - _mesa_meta_draw_pixels(ctx, x, y, width, height, format, type, - unpack, pixels); + _mesa_meta_DrawPixels(ctx, x, y, width, height, format, type, + unpack, pixels); } diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c b/src/mesa/drivers/dri/radeon/radeon_common.c index a4c7b40798..264392b327 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common.c +++ b/src/mesa/drivers/dri/radeon/radeon_common.c @@ -1345,5 +1345,5 @@ void rcommonBeginBatch(radeonContextPtr rmesa, int n, void radeonUserClear(GLcontext *ctx, GLuint mask) { - _mesa_meta_clear(ctx, mask); + _mesa_meta_Clear(ctx, mask); } diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index d83b166742..7ac53ec0ca 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -583,7 +583,7 @@ void radeon_fbo_init(struct radeon_context *radeon) radeon->glCtx->Driver.FinishRenderTexture = radeon_finish_render_texture; radeon->glCtx->Driver.ResizeBuffers = radeon_resize_buffers; radeon->glCtx->Driver.ValidateFramebuffer = radeon_validate_framebuffer; - radeon->glCtx->Driver.BlitFramebuffer = _mesa_meta_blit_framebuffer; + radeon->glCtx->Driver.BlitFramebuffer = _mesa_meta_BlitFramebuffer; } diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c index 4e9c001cc7..e2d4aa9b2d 100644 --- a/src/mesa/drivers/x11/xm_dd.c +++ b/src/mesa/drivers/x11/xm_dd.c @@ -1150,11 +1150,11 @@ xmesa_init_driver_functions( XMesaVisual xmvisual, driver->Enable = enable; driver->Viewport = xmesa_viewport; if (TEST_META_FUNCS) { - driver->Clear = _mesa_meta_clear; - driver->CopyPixels = _mesa_meta_copy_pixels; - driver->BlitFramebuffer = _mesa_meta_blit_framebuffer; - driver->DrawPixels = _mesa_meta_draw_pixels; - driver->Bitmap = _mesa_meta_bitmap; + driver->Clear = _mesa_meta_Clear; + driver->CopyPixels = _mesa_meta_CopyPixels; + driver->BlitFramebuffer = _mesa_meta_BlitFramebuffer; + driver->DrawPixels = _mesa_meta_DrawPixels; + driver->Bitmap = _mesa_meta_Bitmap; } else { driver->Clear = clear_buffers; -- cgit v1.2.3 From ed4076b5b8c5d3c024e291f42a8730b4f71226c9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 19 Sep 2009 17:26:14 -0600 Subject: mesa: remove redundant readbuffer check --- src/mesa/drivers/common/meta.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index be32ae6902..e9b892e33f 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -2459,11 +2459,6 @@ _mesa_meta_CopyConvolutionFilter2D(GLcontext *ctx, GLenum target, { GLfloat *buf; - if (!ctx->ReadBuffer->_ColorReadBuffer) { - /* no readbuffer - OK */ - return; - } - buf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); if (!buf) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCopyConvolutionFilter2D"); -- cgit v1.2.3 From 6c323a2473cbfcdf41a8b3c395fcd277e16b963c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= Date: Sun, 20 Sep 2009 16:33:59 +0200 Subject: r300/compiler: Fix R300 fragment program regression introduced by 0723cd1... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We obviously need to move the code addr register backwards because their may be overlap. This bug affected in particular the Compiz water plugin. Signed-off-by: Nicolai Hähnle --- src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c index 305dc074ee..c7227bbd15 100644 --- a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c +++ b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c @@ -352,7 +352,7 @@ void r300BuildFragmentProgramHwCode(struct r300_fragment_program_compiler *compi if (emit.current_node < 3) { int shift = 3 - emit.current_node; int i; - for(i = 0; i <= emit.current_node; ++i) + for(i = emit.current_node; i >= 0; --i) code->code_addr[shift + i] = code->code_addr[i]; for(i = 0; i < shift; ++i) code->code_addr[i] = 0; -- cgit v1.2.3 From c4ce6f6a7c124c62a8ee9bd9fba28fc69a38e18c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= Date: Sat, 12 Sep 2009 12:13:35 +0200 Subject: mesa/st: Initialize format bits of framebuffer renderbuffers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicolai Hähnle --- src/mesa/state_tracker/st_cb_fbo.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 21ddf2fc7a..6762ed39c3 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -256,6 +256,7 @@ st_new_renderbuffer_fb(enum pipe_format format, int samples, boolean sw) strb->Base.ClassID = 0x4242; /* just a unique value */ strb->Base.NumSamples = samples; strb->format = format; + init_renderbuffer_bits(strb, format); strb->software = sw; switch (format) { -- cgit v1.2.3 From e617dd14ab4863921c02612ab76faa94b02a155c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= Date: Sat, 12 Sep 2009 16:49:31 +0200 Subject: mesa/st: Create front renderbuffer on the fly when supplied with a surface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Normally, the mesa/st would create a fake front buffer out of a client-allocated surface. In the DRI setting, however, st/dri provides a front buffer surface which is created and maintained by the X server. Prefer to use this surface instead, so that front buffer rendering and reading works correctly. Signed-off-by: Nicolai Hähnle --- src/mesa/state_tracker/st_framebuffer.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_framebuffer.c b/src/mesa/state_tracker/st_framebuffer.c index ca32b2e573..5c0d335d62 100644 --- a/src/mesa/state_tracker/st_framebuffer.c +++ b/src/mesa/state_tracker/st_framebuffer.c @@ -66,7 +66,7 @@ st_create_framebuffer( const __GLcontextModes *visual, else { /* Only allocate front buffer right now if we're single buffered. * If double-buffered, allocate front buffer on demand later. - * See check_create_front_buffers(). + * See check_create_front_buffers() and st_set_framebuffer_surface(). */ struct gl_renderbuffer *rb = st_new_renderbuffer_fb(colorFormat, samples, FALSE); @@ -170,8 +170,20 @@ st_set_framebuffer_surface(struct st_framebuffer *stfb, strb = st_renderbuffer(stfb->Base.Attachment[surfIndex].Renderbuffer); - /* fail */ - if (!strb) return; + if (!strb) { + if (surfIndex == ST_SURFACE_FRONT_LEFT) { + /* Delayed creation when the window system supplies a fake front buffer */ + struct st_renderbuffer *strb_back + = st_renderbuffer(stfb->Base.Attachment[ST_SURFACE_BACK_LEFT].Renderbuffer); + struct gl_renderbuffer *rb + = st_new_renderbuffer_fb(surf->format, strb_back->Base.NumSamples, FALSE); + _mesa_add_renderbuffer(&stfb->Base, BUFFER_FRONT_LEFT, rb); + strb = st_renderbuffer(rb); + } else { + /* fail */ + return; + } + } /* replace the renderbuffer's surface/texture pointers */ pipe_surface_reference( &strb->surface, surf ); -- cgit v1.2.3 From 94a3c5979fdfa7e5da97523456ee89848528aab0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= Date: Sun, 20 Sep 2009 18:45:32 +0200 Subject: radeon: Fix "verts" debugging enable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Copy'n'paste apparently prevented the RADEON_VERTS flag from being enabled. Signed-off-by: Nicolai Hähnle --- src/mesa/drivers/dri/radeon/radeon_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_debug.c b/src/mesa/drivers/dri/radeon/radeon_debug.c index 3b6f003803..413000b6c0 100644 --- a/src/mesa/drivers/dri/radeon/radeon_debug.c +++ b/src/mesa/drivers/dri/radeon/radeon_debug.c @@ -39,7 +39,7 @@ static const struct dri_debug_control debug_control[] = { {"fall", RADEON_FALLBACKS}, {"tex", RADEON_TEXTURE}, {"ioctl", RADEON_IOCTL}, - {"verts", RADEON_RENDER}, + {"verts", RADEON_VERTS}, {"render", RADEON_RENDER}, {"swrender", RADEON_SWRENDER}, {"state", RADEON_STATE}, -- cgit v1.2.3 From 5fa9a7a9a9cb87c8a86402981cc1b4affde95777 Mon Sep 17 00:00:00 2001 From: Pauli Nieminen Date: Sun, 20 Sep 2009 20:07:35 +0300 Subject: radeon: Improve WARN_ONCE macro to appear as single statement. Do-while makes macro safe to be used with if and for constructions. Also remove __LINE__ macro from variable name because scope is local to macro anyway. --- src/mesa/drivers/dri/radeon/radeon_debug.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_debug.h b/src/mesa/drivers/dri/radeon/radeon_debug.h index 2a8302293b..a59104168f 100644 --- a/src/mesa/drivers/dri/radeon/radeon_debug.h +++ b/src/mesa/drivers/dri/radeon/radeon_debug.h @@ -149,21 +149,22 @@ static inline void radeon_debug_remove_indent(void) } } + /* From http://gcc. gnu.org/onlinedocs/gcc-3.2.3/gcc/Variadic-Macros.html . I suppose we could inline this and use macro to fetch out __LINE__ and stuff in case we run into trouble with other compilers ... GLUE! */ -#define WARN_ONCE(a, ...) { \ - static int warn##__LINE__=1; \ - if(warn##__LINE__){ \ +#define WARN_ONCE(a, ...) do { \ + static int __warn_once=1; \ + if(__warn__once){ \ radeon_warning("*********************************WARN_ONCE*********************************\n"); \ radeon_warning("File %s function %s line %d\n", \ __FILE__, __FUNCTION__, __LINE__); \ radeon_warning( (a), ## __VA_ARGS__);\ radeon_warning("***************************************************************************\n"); \ - warn##__LINE__=0;\ + __warn_once=0;\ } \ - } + } while(0) #endif -- cgit v1.2.3 From 3640e4acde2fb050b1659271d1687a8a5f90365d Mon Sep 17 00:00:00 2001 From: Pauli Nieminen Date: Sun, 20 Sep 2009 21:08:42 +0300 Subject: radeon: Fix typo in variable name. --- src/mesa/drivers/dri/radeon/radeon_debug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_debug.h b/src/mesa/drivers/dri/radeon/radeon_debug.h index a59104168f..26da31c1c4 100644 --- a/src/mesa/drivers/dri/radeon/radeon_debug.h +++ b/src/mesa/drivers/dri/radeon/radeon_debug.h @@ -156,7 +156,7 @@ static inline void radeon_debug_remove_indent(void) */ #define WARN_ONCE(a, ...) do { \ static int __warn_once=1; \ - if(__warn__once){ \ + if(__warn_once){ \ radeon_warning("*********************************WARN_ONCE*********************************\n"); \ radeon_warning("File %s function %s line %d\n", \ __FILE__, __FUNCTION__, __LINE__); \ -- cgit v1.2.3 From 7e3b8b0d8fdfd7cffbb57afce67a3fe54827d90a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= Date: Sun, 20 Sep 2009 20:40:03 +0200 Subject: r300/compiler: Fix trig instructions in R300 fp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicolai Hähnle --- .../drivers/dri/r300/compiler/radeon_program_alu.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c b/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c index 8071899eaa..f23ce301ca 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c @@ -511,23 +511,23 @@ static void sincos_constants(struct radeon_compiler* c, GLuint *constants) * MAD dest, tmp.y, weight, tmp.x */ static void sin_approx( - struct radeon_compiler* c, struct rc_instruction * after, + struct radeon_compiler* c, struct rc_instruction * before, struct prog_dst_register dst, struct prog_src_register src, const GLuint* constants) { GLuint tempreg = rc_find_free_temporary(c); - emit2(c, after->Prev, OPCODE_MUL, 0, dstregtmpmask(tempreg, WRITEMASK_XY), + emit2(c, before->Prev, OPCODE_MUL, 0, dstregtmpmask(tempreg, WRITEMASK_XY), swizzle(src, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X), srcreg(PROGRAM_CONSTANT, constants[0])); - emit3(c, after->Prev, OPCODE_MAD, 0, dstregtmpmask(tempreg, WRITEMASK_X), + emit3(c, before->Prev, OPCODE_MAD, 0, dstregtmpmask(tempreg, WRITEMASK_X), swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y), absolute(swizzle(src, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X)), swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X)); - emit3(c, after->Prev, OPCODE_MAD, 0, dstregtmpmask(tempreg, WRITEMASK_Y), + emit3(c, before->Prev, OPCODE_MAD, 0, dstregtmpmask(tempreg, WRITEMASK_Y), swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X), absolute(swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X)), negate(swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X))); - emit3(c, after->Prev, OPCODE_MAD, 0, dst, + emit3(c, before->Prev, OPCODE_MAD, 0, dst, swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y), swizzle(srcreg(PROGRAM_CONSTANT, constants[0]), SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W), swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X)); @@ -567,7 +567,7 @@ GLboolean radeonTransformTrigSimple(struct radeon_compiler* c, swizzle(srcreg(PROGRAM_CONSTANT, constants[1]), SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W), negate(swizzle(srcreg(PROGRAM_CONSTANT, constants[0]), SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z))); - sin_approx(c, inst->Prev, inst->I.DstReg, + sin_approx(c, inst, inst->I.DstReg, swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W), constants); } else if (inst->I.Opcode == OPCODE_SIN) { @@ -582,7 +582,7 @@ GLboolean radeonTransformTrigSimple(struct radeon_compiler* c, swizzle(srcreg(PROGRAM_CONSTANT, constants[1]), SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W), negate(swizzle(srcreg(PROGRAM_CONSTANT, constants[0]), SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z, SWIZZLE_Z))); - sin_approx(c, inst->Prev, inst->I.DstReg, + sin_approx(c, inst, inst->I.DstReg, swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_W, SWIZZLE_W, SWIZZLE_W, SWIZZLE_W), constants); } else { @@ -600,12 +600,12 @@ GLboolean radeonTransformTrigSimple(struct radeon_compiler* c, struct prog_dst_register dst = inst->I.DstReg; dst.WriteMask = inst->I.DstReg.WriteMask & WRITEMASK_X; - sin_approx(c, inst->Prev, dst, + sin_approx(c, inst, dst, swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_X, SWIZZLE_X, SWIZZLE_X, SWIZZLE_X), constants); dst.WriteMask = inst->I.DstReg.WriteMask & WRITEMASK_Y; - sin_approx(c, inst->Prev, dst, + sin_approx(c, inst, dst, swizzle(srcreg(PROGRAM_TEMPORARY, tempreg), SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y, SWIZZLE_Y), constants); } -- cgit v1.2.3 From 284a7af274bc148f112bd0ebb40583923ee26b49 Mon Sep 17 00:00:00 2001 From: Pauli Nieminen Date: Sun, 20 Sep 2009 22:24:35 +0300 Subject: radeon: Fix legacy bo not to reuse dma buffers before refcount is 1. This should help detecting possible memory leaks with dma buffers and prevent possible visual corruption if data would be overwriten too early. --- src/mesa/drivers/dri/radeon/radeon_dma.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_dma.c b/src/mesa/drivers/dri/radeon/radeon_dma.c index c9a32c808b..c6edbae9a1 100644 --- a/src/mesa/drivers/dri/radeon/radeon_dma.c +++ b/src/mesa/drivers/dri/radeon/radeon_dma.c @@ -207,7 +207,6 @@ again_alloc: counter on unused buffers for later freeing them from begin of list */ dma_bo = last_elem(&rmesa->dma.free); - assert(dma_bo->bo->cref == 1); remove_from_list(dma_bo); insert_at_head(&rmesa->dma.reserved, dma_bo); } @@ -307,6 +306,10 @@ static int radeon_bo_is_idle(struct radeon_bo* bo) WARN_ONCE("Your libdrm or kernel doesn't have support for busy query.\n" "This may cause small performance drop for you.\n"); } + /* Protect against bug in legacy bo handling that causes bos stay + * referenced even after they should be freed */ + if (bo->cref != 1) + return 0; return ret != -EBUSY; } @@ -343,7 +346,9 @@ void radeonReleaseDmaRegions(radeonContextPtr rmesa) foreach_s(dma_bo, temp, &rmesa->dma.wait) { if (dma_bo->expire_counter == time) { WARN_ONCE("Leaking dma buffer object!\n"); - radeon_bo_unref(dma_bo->bo); + /* force free of buffer so we don't realy start + * leaking stuff now*/ + while ((dma_bo->bo = radeon_bo_unref(dma_bo->bo))) {} remove_from_list(dma_bo); FREE(dma_bo); continue; -- cgit v1.2.3 From 81bac6e2a811ee537c38070f19e70e730ea1169f Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Mon, 21 Sep 2009 10:52:07 +0800 Subject: intel: meta clear has a new name. It was renamed to _mesa_meta_Clear. Signed-off-by: Chia-I Wu --- src/mesa/drivers/dri/intel/intel_clear.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_clear.c b/src/mesa/drivers/dri/intel/intel_clear.c index 9010b910c7..fef977f465 100644 --- a/src/mesa/drivers/dri/intel/intel_clear.c +++ b/src/mesa/drivers/dri/intel/intel_clear.c @@ -172,7 +172,7 @@ intelClear(GLcontext *ctx, GLbitfield mask) DBG("\n"); } - _mesa_meta_clear(&intel->ctx, tri_mask); + _mesa_meta_Clear(&intel->ctx, tri_mask); intel_batchbuffer_flush(intel->batch); } -- cgit v1.2.3 From 6c5726cd39ab12b86fae391d075fa74bc24b615c Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Mon, 21 Sep 2009 10:57:14 +0800 Subject: st/mesa: Compile in meta.c. meta was moved to core Mesa since 651cffd626a82d9bf539437ca4bdf8ea4b396fab. Signed-off-by: Chia-I Wu --- src/mesa/sources.mak | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak index 7107538cee..c8d2f5a1a7 100644 --- a/src/mesa/sources.mak +++ b/src/mesa/sources.mak @@ -333,6 +333,7 @@ MESA_GALLIUM_SOURCES = \ $(VBO_SOURCES) \ $(STATETRACKER_SOURCES) \ $(SHADER_SOURCES) \ + drivers/common/meta.c \ ppc/common_ppc.c \ x86/common_x86.c \ $(SLANG_SOURCES) -- cgit v1.2.3 From 41fefe88c50376a57876b498c8619c8c9f535de6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 20 Sep 2009 21:31:38 -0600 Subject: scons: add meta.c to sources --- src/mesa/SConscript | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/SConscript b/src/mesa/SConscript index cad5676320..fbe5be0dcd 100644 --- a/src/mesa/SConscript +++ b/src/mesa/SConscript @@ -234,11 +234,16 @@ if env['platform'] != 'winddk': 'shader/slang/slang_utility.c', ] + driver_sources = [ + 'drivers/common/meta.c' + ] + mesa_sources = ( main_sources + math_sources + vbo_sources + vf_sources + + driver_soruces + statetracker_sources + shader_sources + slang_sources -- cgit v1.2.3 From da9d8f192431b0142e65bceb5ca8a2e52e21ac90 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 20 Sep 2009 22:06:03 -0600 Subject: Revert "mesa: move _mesa_meta_init/free() calls to core Mesa" This reverts commit 651cffd626a82d9bf539437ca4bdf8ea4b396fab. The commit inadvertantly introduced a new gallium dependency on the meta code. --- src/mesa/drivers/dri/intel/intel_context.c | 5 +++++ src/mesa/drivers/dri/radeon/radeon_common_context.c | 5 +++++ src/mesa/drivers/x11/xm_api.c | 7 +++++++ src/mesa/main/context.c | 5 ----- 4 files changed, 17 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index ab1cf40387..03db8b1c68 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -38,6 +38,7 @@ #include "swrast_setup/swrast_setup.h" #include "tnl/tnl.h" #include "drivers/common/driverfuncs.h" +#include "drivers/common/meta.h" #include "i830_dri.h" @@ -711,6 +712,8 @@ intelInitContext(struct intel_context *intel, _swrast_allow_pixel_fog(ctx, GL_FALSE); _swrast_allow_vertex_fog(ctx, GL_TRUE); + _mesa_meta_init(ctx); + intel->hw_stencil = mesaVis->stencilBits && mesaVis->depthBits == 24; intel->hw_stipple = 1; @@ -814,6 +817,8 @@ intelDestroyContext(__DRIcontextPrivate * driContextPriv) INTEL_FIREVERTICES(intel); + _mesa_meta_free(&intel->ctx); + meta_destroy_metaops(&intel->meta); intel->vtbl.destroy(intel); diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.c b/src/mesa/drivers/dri/radeon/radeon_common_context.c index d4bea86796..1c53c04da7 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.c @@ -37,6 +37,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "utils.h" #include "vblank.h" #include "drirenderbuffer.h" +#include "drivers/common/meta.h" #include "main/context.h" #include "main/framebuffer.h" #include "main/renderbuffer.h" @@ -208,6 +209,8 @@ GLboolean radeonInitContext(radeonContextPtr radeon, meta_init_metaops(ctx, &radeon->meta); + _mesa_meta_init(ctx); + /* DRI fields */ radeon->dri.context = driContextPriv; radeon->dri.screen = sPriv; @@ -303,6 +306,8 @@ void radeonDestroyContext(__DRIcontextPrivate *driContextPriv ) assert(radeon); + _mesa_meta_free(radeon->glCtx); + if (radeon == current) { radeon_firevertices(radeon); _mesa_make_current(NULL, NULL, NULL); diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 90efd86a6b..662c61ae7e 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -79,6 +79,7 @@ #include "tnl/t_context.h" #include "tnl/t_pipeline.h" #include "drivers/common/driverfuncs.h" +#include "drivers/common/meta.h" /** * Global X driver lock @@ -1647,6 +1648,9 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) xmesa_register_swrast_functions( mesaCtx ); _swsetup_Wakeup(mesaCtx); + if (TEST_META_FUNCS) + _mesa_meta_init(mesaCtx); + return c; } @@ -1661,6 +1665,9 @@ void XMesaDestroyContext( XMesaContext c ) FXdestroyContext( XMESA_BUFFER(mesaCtx->DrawBuffer) ); #endif + if (TEST_META_FUNCS) + _mesa_meta_free( mesaCtx ); + _swsetup_DestroyContext( mesaCtx ); _swrast_DestroyContext( mesaCtx ); _tnl_DestroyContext( mesaCtx ); diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 4c69e688da..f6d4ac4595 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -149,7 +149,6 @@ #include "version.h" #include "viewport.h" #include "vtxfmt.h" -#include "drivers/common/meta.h" #include "glapi/glthread.h" #include "glapi/glapioffsets.h" #include "glapi/glapitable.h" @@ -927,8 +926,6 @@ _mesa_initialize_context(GLcontext *ctx, _mesa_initialize_context_extra(ctx); #endif - _mesa_meta_init(ctx); - ctx->FirstTimeCurrent = GL_TRUE; return GL_TRUE; @@ -994,8 +991,6 @@ _mesa_free_context_data( GLcontext *ctx ) _mesa_make_current(ctx, NULL, NULL); } - _mesa_meta_free(ctx); - /* unreference WinSysDraw/Read buffers */ _mesa_reference_framebuffer(&ctx->WinSysDrawBuffer, NULL); _mesa_reference_framebuffer(&ctx->WinSysReadBuffer, NULL); -- cgit v1.2.3 From 1eda10d073b17e1d2ba1089eae378b6e257614be Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 20 Sep 2009 22:08:21 -0600 Subject: Revert "scons: add meta.c to sources" This reverts commit 41fefe88c50376a57876b498c8619c8c9f535de6. --- src/mesa/SConscript | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/SConscript b/src/mesa/SConscript index fbe5be0dcd..cad5676320 100644 --- a/src/mesa/SConscript +++ b/src/mesa/SConscript @@ -234,16 +234,11 @@ if env['platform'] != 'winddk': 'shader/slang/slang_utility.c', ] - driver_sources = [ - 'drivers/common/meta.c' - ] - mesa_sources = ( main_sources + math_sources + vbo_sources + vf_sources + - driver_soruces + statetracker_sources + shader_sources + slang_sources -- cgit v1.2.3 From a1cf9b6abe0250f1496cea2cf49e29430ceab028 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 20 Sep 2009 22:08:30 -0600 Subject: Revert "st/mesa: Compile in meta.c." This reverts commit 6c5726cd39ab12b86fae391d075fa74bc24b615c. --- src/mesa/sources.mak | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak index c8d2f5a1a7..7107538cee 100644 --- a/src/mesa/sources.mak +++ b/src/mesa/sources.mak @@ -333,7 +333,6 @@ MESA_GALLIUM_SOURCES = \ $(VBO_SOURCES) \ $(STATETRACKER_SOURCES) \ $(SHADER_SOURCES) \ - drivers/common/meta.c \ ppc/common_ppc.c \ x86/common_x86.c \ $(SLANG_SOURCES) -- cgit v1.2.3 From 1741bc1a79b6a243e841bca704f1a720b028124a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 20 Sep 2009 22:13:09 -0600 Subject: osmesa: call _mesa_meta_init/free() --- src/mesa/drivers/osmesa/osmesa.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index 904659e345..692657a5df 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -50,6 +50,7 @@ #include "tnl/t_context.h" #include "tnl/t_pipeline.h" #include "drivers/common/driverfuncs.h" +#include "drivers/common/meta.h" #include "vbo/vbo.h" @@ -1258,6 +1259,8 @@ OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits, osmesa->bInd = bind; osmesa->aInd = aind; + _mesa_meta_init(&osmesa->mesa); + /* Initialize the software rasterizer and helper modules. */ { GLcontext *ctx = &osmesa->mesa; @@ -1304,6 +1307,8 @@ OSMesaDestroyContext( OSMesaContext osmesa ) if (osmesa->rb) _mesa_reference_renderbuffer(&osmesa->rb, NULL); + _mesa_meta_free( &osmesa->mesa ); + _swsetup_DestroyContext( &osmesa->mesa ); _tnl_DestroyContext( &osmesa->mesa ); _vbo_DestroyContext( &osmesa->mesa ); -- cgit v1.2.3 From 4a4914e4146b78e99277ab494226136a4e68cdb4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 20 Sep 2009 22:13:28 -0600 Subject: dri/swrast: call _mesa_meta_init/free() --- src/mesa/drivers/dri/swrast/swrast.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index 3016987d56..cd499cd5d2 100644 --- a/src/mesa/drivers/dri/swrast/swrast.c +++ b/src/mesa/drivers/dri/swrast/swrast.c @@ -43,6 +43,7 @@ #include "tnl/t_pipeline.h" #include "vbo/vbo.h" #include "drivers/common/driverfuncs.h" +#include "drivers/common/meta.h" #include "utils.h" #include "swrast_priv.h" @@ -649,6 +650,8 @@ driCreateNewContext(__DRIscreen *screen, const __DRIconfig *config, _mesa_enable_2_0_extensions(mesaCtx); _mesa_enable_2_1_extensions(mesaCtx); + _mesa_meta_init(mesaCtx); + return ctx; } @@ -660,6 +663,7 @@ driDestroyContext(__DRIcontext *ctx) if (ctx) { mesaCtx = &ctx->Base; + _mesa_meta_free(mesaCtx); _swsetup_DestroyContext( mesaCtx ); _swrast_DestroyContext( mesaCtx ); _tnl_DestroyContext( mesaCtx ); -- cgit v1.2.3 From 2c1937480a68b066a1a0b8ee3770e675bfad859b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 20 Sep 2009 22:19:06 -0600 Subject: xlib: always call _mesa_meta_init/free() --- src/mesa/drivers/x11/xm_api.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 662c61ae7e..79b058634c 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -1648,8 +1648,7 @@ XMesaContext XMesaCreateContext( XMesaVisual v, XMesaContext share_list ) xmesa_register_swrast_functions( mesaCtx ); _swsetup_Wakeup(mesaCtx); - if (TEST_META_FUNCS) - _mesa_meta_init(mesaCtx); + _mesa_meta_init(mesaCtx); return c; } @@ -1665,8 +1664,7 @@ void XMesaDestroyContext( XMesaContext c ) FXdestroyContext( XMESA_BUFFER(mesaCtx->DrawBuffer) ); #endif - if (TEST_META_FUNCS) - _mesa_meta_free( mesaCtx ); + _mesa_meta_free( mesaCtx ); _swsetup_DestroyContext( mesaCtx ); _swrast_DestroyContext( mesaCtx ); -- cgit v1.2.3 From e3384a0d533fe69c1b26f1b03e98beac0b42ccfb Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 20 Sep 2009 22:19:28 -0600 Subject: windows: call _mesa_meta_init/free() --- src/mesa/drivers/windows/gdi/wmesa.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/windows/gdi/wmesa.c b/src/mesa/drivers/windows/gdi/wmesa.c index e1971db693..8929b22af1 100644 --- a/src/mesa/drivers/windows/gdi/wmesa.c +++ b/src/mesa/drivers/windows/gdi/wmesa.c @@ -12,6 +12,7 @@ #include "framebuffer.h" #include "renderbuffer.h" #include "drivers/common/driverfuncs.h" +#include "drivers/common/meta.h" #include "vbo/vbo.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" @@ -1515,6 +1516,8 @@ WMesaContext WMesaCreateContext(HDC hDC, _mesa_enable_2_0_extensions(ctx); _mesa_enable_2_1_extensions(ctx); + _mesa_meta_init(ctx); + /* Initialize the software rasterizer and helper modules. */ if (!_swrast_CreateContext(ctx) || !_vbo_CreateContext(ctx) || @@ -1558,6 +1561,8 @@ void WMesaDestroyContext( WMesaContext pwc ) DeleteObject(pwc->clearPen); DeleteObject(pwc->clearBrush); + _mesa_meta_free(ctx); + _swsetup_DestroyContext(ctx); _tnl_DestroyContext(ctx); _vbo_DestroyContext(ctx); -- cgit v1.2.3 From 999592745f40a96a7307da374cab4d68254acf75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Mon, 21 Sep 2009 10:08:11 +0200 Subject: intel: Fix crash in intel_flush(). Since commit 2921a2555d0a76fa649b23c31e3264bbc78b2ff5 ('intel: Deassociated drawables from private context struct in intelUnbindContext'), intel->driDrawable may be NULL in intel_flush(). --- src/mesa/drivers/dri/intel/intel_context.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 7fa70e428d..e593b236a7 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -500,7 +500,8 @@ intel_flush(GLcontext *ctx, GLboolean needs_mi_flush) if (screen->dri2.loader && (screen->dri2.loader->base.version >= 2) - && (screen->dri2.loader->flushFrontBuffer != NULL)) { + && (screen->dri2.loader->flushFrontBuffer != NULL) && + intel->driDrawable && intel->driDrawable->loaderPrivate) { (*screen->dri2.loader->flushFrontBuffer)(intel->driDrawable, intel->driDrawable->loaderPrivate); -- cgit v1.2.3 From 736e1ae42fd61f2b9f982b0491ca7daea7e615ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= Date: Wed, 9 Sep 2009 19:56:57 +0200 Subject: r300: Fix handling of NV_vertex_program parameters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The handling is a bit inefficient, unfortunately, but I don't want to make any intrusive changes for Mesa 7.6. Signed-off-by: Nicolai Hähnle --- .../drivers/dri/r300/compiler/radeon_program.c | 35 ++++++++++++++++++---- src/mesa/shader/program.c | 1 + 2 files changed, 30 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program.c b/src/mesa/drivers/dri/r300/compiler/radeon_program.c index bbbf0dd776..b636f90a96 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program.c @@ -150,14 +150,37 @@ void rc_mesa_to_rc_program(struct radeon_compiler * c, struct gl_program * progr c->Program.InputsRead = program->InputsRead; c->Program.OutputsWritten = program->OutputsWritten; - for(i = 0; i < program->Parameters->NumParameters; ++i) { - struct rc_constant constant; + int isNVProgram = 0; - constant.Type = RC_CONSTANT_EXTERNAL; - constant.Size = 4; - constant.u.External = i; + if (program->Target == GL_VERTEX_PROGRAM_ARB) { + struct gl_vertex_program * vp = (struct gl_vertex_program *) program; + isNVProgram = vp->IsNVProgram; + } + + if (isNVProgram) { + /* NV_vertex_program has a fixed-sized constant environment. + * This could be handled more efficiently for programs that + * do not use relative addressing. + */ + for(i = 0; i < 96; ++i) { + struct rc_constant constant; - rc_constants_add(&c->Program.Constants, &constant); + constant.Type = RC_CONSTANT_EXTERNAL; + constant.Size = 4; + constant.u.External = i; + + rc_constants_add(&c->Program.Constants, &constant); + } + } else { + for(i = 0; i < program->Parameters->NumParameters; ++i) { + struct rc_constant constant; + + constant.Type = RC_CONSTANT_EXTERNAL; + constant.Size = 4; + constant.u.External = i; + + rc_constants_add(&c->Program.Constants, &constant); + } } } diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index 963478fccd..2cd6eb8a38 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -502,6 +502,7 @@ _mesa_clone_program(GLcontext *ctx, const struct gl_program *prog) = (const struct gl_vertex_program *) prog; struct gl_vertex_program *vpc = (struct gl_vertex_program *) clone; vpc->IsPositionInvariant = vp->IsPositionInvariant; + vpc->IsNVProgram = vp->IsNVProgram; } break; case GL_FRAGMENT_PROGRAM_ARB: -- cgit v1.2.3 From 526430ade1d7ec0e1b3743d69e1ee9fb89cbaa2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= Date: Mon, 21 Sep 2009 12:50:33 +0200 Subject: r300: Zero-initialize register for NV_vertex_program MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicolai Hähnle --- src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c | 1 + src/mesa/drivers/dri/r300/r300_vertprog.c | 31 ++++++++++++++++++++++ 2 files changed, 32 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c b/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c index 93a516105e..dad27fc98e 100644 --- a/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c @@ -89,6 +89,7 @@ static unsigned long t_dst_index(struct r300_vertex_program_code *vp, static unsigned long t_src_class(gl_register_file file) { switch (file) { + case PROGRAM_BUILTIN: case PROGRAM_TEMPORARY: return PVS_SRC_REG_TEMPORARY; case PROGRAM_INPUT: diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index dd0f27f9cb..0cb7dde985 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -203,6 +203,34 @@ static void t_inputs_outputs(struct r300_vertex_program_compiler * c) } } +/** + * The NV_vertex_program spec mandates that all registers be + * initialized to zero. We do this here unconditionally. + * + * \note We rely on dead-code elimination in the compiler. + */ +static void initialize_NV_registers(struct radeon_compiler * compiler) +{ + unsigned int reg; + struct rc_instruction * inst; + + for(reg = 0; reg < 12; ++reg) { + inst = rc_insert_new_instruction(compiler, &compiler->Program.Instructions); + inst->I.Opcode = OPCODE_MOV; + inst->I.DstReg.File = PROGRAM_TEMPORARY; + inst->I.DstReg.Index = reg; + inst->I.SrcReg[0].File = PROGRAM_BUILTIN; + inst->I.SrcReg[0].Swizzle = SWIZZLE_0000; + } + + inst = rc_insert_new_instruction(compiler, &compiler->Program.Instructions); + inst->I.Opcode = OPCODE_ARL; + inst->I.DstReg.File = PROGRAM_ADDRESS; + inst->I.DstReg.Index = 0; + inst->I.DstReg.WriteMask = WRITEMASK_X; + inst->I.SrcReg[0].File = PROGRAM_BUILTIN; + inst->I.SrcReg[0].Swizzle = SWIZZLE_0000; +} static struct r300_vertex_program *build_program(GLcontext *ctx, struct r300_vertex_program_key *wanted_key, @@ -234,6 +262,9 @@ static struct r300_vertex_program *build_program(GLcontext *ctx, rc_mesa_to_rc_program(&compiler.Base, &vp->Base->Base); + if (mesa_vp->IsNVProgram) + initialize_NV_registers(&compiler.Base); + rc_move_output(&compiler.Base, VERT_RESULT_PSIZ, VERT_RESULT_PSIZ, WRITEMASK_X); if (vp->key.WPosAttr != FRAG_ATTRIB_MAX) { -- cgit v1.2.3 From 2d729e6e3bcb0af84790cafb9824a3937954e078 Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Mon, 21 Sep 2009 10:14:25 -0400 Subject: r600: fix some issues with LIT instruction - MUL_LIT is ALU.Trans instruction - some Trans instructions can take 3 arguments - don't clobber dst.x, use dst.z as temp, it'll get written correct value in last insn - respect source swizzles --- src/mesa/drivers/dri/r600/r700_assembler.c | 69 ++++++++++++++++-------------- 1 file changed, 36 insertions(+), 33 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index efeccb25f1..f46bc32201 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -2024,7 +2024,7 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) return GL_FALSE; } - if (pAsm->D.dst.math == 0) + if (uNumSrc > 1) { // Process source 1 current_source_index = 1; @@ -2880,6 +2880,11 @@ GLboolean assemble_LIT(r700_AssemblerBase *pAsm) return GL_FALSE; } + if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + { + return GL_FALSE; + } + /* dst.y = max(src.x, 0.0) */ pAsm->D.dst.opcode = SQ_OP2_INST_MAX; pAsm->D.dst.rtype = dstType; @@ -2891,11 +2896,6 @@ GLboolean assemble_LIT(r700_AssemblerBase *pAsm) pAsm->S[0].src.rtype = srcType; pAsm->S[0].src.reg = srcReg; setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); - noneg_PVSSRC(&(pAsm->S[0].src)); - pAsm->S[0].src.swizzlex = SQ_SEL_X; - pAsm->S[0].src.swizzley = SQ_SEL_X; - pAsm->S[0].src.swizzlez = SQ_SEL_X; - pAsm->S[0].src.swizzlew = SQ_SEL_X; pAsm->S[1].src.rtype = SRC_REG_TEMPORARY; pAsm->S[1].src.reg = tmp; setaddrmode_PVSSRC(&(pAsm->S[1].src), ADDR_ABSOLUTE); @@ -2909,34 +2909,47 @@ GLboolean assemble_LIT(r700_AssemblerBase *pAsm) return GL_FALSE; } - /* before: dst.w = log(src.y) - * after : dst.x = log(src.y) - * why change dest register is that dst.w has been initialized as 1 before - */ + if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + { + return GL_FALSE; + } + + swizzleagain_PVSSRC(&(pAsm->S[0].src), SQ_SEL_Y, SQ_SEL_Y, SQ_SEL_Y, SQ_SEL_Y); + + /* dst.z = log(src.y) */ pAsm->D.dst.opcode = SQ_OP2_INST_LOG_CLAMPED; pAsm->D.dst.math = 1; pAsm->D.dst.rtype = dstType; pAsm->D.dst.reg = dstReg; - pAsm->D.dst.writex = 1; + pAsm->D.dst.writex = 0; pAsm->D.dst.writey = 0; - pAsm->D.dst.writez = 0; + pAsm->D.dst.writez = 1; pAsm->D.dst.writew = 0; pAsm->S[0].src.rtype = srcType; pAsm->S[0].src.reg = srcReg; setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); - noneg_PVSSRC(&(pAsm->S[0].src)); - pAsm->S[0].src.swizzlex = SQ_SEL_Y; - pAsm->S[0].src.swizzley = SQ_SEL_Y; - pAsm->S[0].src.swizzlez = SQ_SEL_Y; - pAsm->S[0].src.swizzlew = SQ_SEL_Y; if( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } - /* before: tmp.x = amd MUL_LIT(src.w, dst.w, src.x ) */ - /* after : tmp.x = amd MUL_LIT(src.w, dst.x, src.x ) */ + if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + { + return GL_FALSE; + } + + if( GL_FALSE == assemble_src(pAsm, 0, 2) ) + { + return GL_FALSE; + } + + swizzleagain_PVSSRC(&(pAsm->S[0].src), SQ_SEL_W, SQ_SEL_W, SQ_SEL_W, SQ_SEL_W); + + swizzleagain_PVSSRC(&(pAsm->S[2].src), SQ_SEL_X, SQ_SEL_X, SQ_SEL_X, SQ_SEL_X); + + /* tmp.x = amd MUL_LIT(src.w, dst.z, src.x ) */ pAsm->D.dst.opcode = SQ_OP3_INST_MUL_LIT; + pAsm->D.dst.math = 1; pAsm->D.dst.op3 = 1; pAsm->D.dst.rtype = DST_REG_TEMPORARY; pAsm->D.dst.reg = tmp; @@ -2948,29 +2961,19 @@ GLboolean assemble_LIT(r700_AssemblerBase *pAsm) pAsm->S[0].src.rtype = srcType; pAsm->S[0].src.reg = srcReg; setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); - noneg_PVSSRC(&(pAsm->S[0].src)); - pAsm->S[0].src.swizzlex = SQ_SEL_W; - pAsm->S[0].src.swizzley = SQ_SEL_W; - pAsm->S[0].src.swizzlez = SQ_SEL_W; - pAsm->S[0].src.swizzlew = SQ_SEL_W; pAsm->S[1].src.rtype = SRC_REG_TEMPORARY; pAsm->S[1].src.reg = dstReg; setaddrmode_PVSSRC(&(pAsm->S[1].src), ADDR_ABSOLUTE); noneg_PVSSRC(&(pAsm->S[1].src)); - pAsm->S[1].src.swizzlex = SQ_SEL_X; - pAsm->S[1].src.swizzley = SQ_SEL_X; - pAsm->S[1].src.swizzlez = SQ_SEL_X; - pAsm->S[1].src.swizzlew = SQ_SEL_X; + pAsm->S[1].src.swizzlex = SQ_SEL_Z; + pAsm->S[1].src.swizzley = SQ_SEL_Z; + pAsm->S[1].src.swizzlez = SQ_SEL_Z; + pAsm->S[1].src.swizzlew = SQ_SEL_Z; pAsm->S[2].src.rtype = srcType; pAsm->S[2].src.reg = srcReg; setaddrmode_PVSSRC(&(pAsm->S[2].src), ADDR_ABSOLUTE); - noneg_PVSSRC(&(pAsm->S[2].src)); - pAsm->S[2].src.swizzlex = SQ_SEL_X; - pAsm->S[2].src.swizzley = SQ_SEL_X; - pAsm->S[2].src.swizzlez = SQ_SEL_X; - pAsm->S[2].src.swizzlew = SQ_SEL_X; if( GL_FALSE == next_ins(pAsm) ) { -- cgit v1.2.3 From 077e3de98977ca0046d4f09eb7936f6006719739 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 21 Sep 2009 08:32:43 -0600 Subject: swrast: fix cube face selection If arx and ary are equal, we still want to choose from one of them, and not arz. This is the same as Michal's softpipe fix. --- src/mesa/swrast/s_texfilter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index dd59314cd9..ea749c0113 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -1863,7 +1863,7 @@ choose_cube_face(const struct gl_texture_object *texObj, GLuint face; GLfloat sc, tc, ma; - if (arx > ary && arx > arz) { + if (arx >= ary && arx >= arz) { if (rx >= 0.0F) { face = FACE_POS_X; sc = -rz; @@ -1877,7 +1877,7 @@ choose_cube_face(const struct gl_texture_object *texObj, ma = arx; } } - else if (ary > arx && ary > arz) { + else if (ary >= arx && ary >= arz) { if (ry >= 0.0F) { face = FACE_POS_Y; sc = rx; -- cgit v1.2.3 From 2b83483fb43386bd4b8d199d371a3e513828695f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 20 May 2009 14:05:03 -0700 Subject: intel: Mark the FBO as incomplete if there's no intel_renderbuffer for it. This happens to rendering with textures with a border, which had resulted in a segfault on dereferencing the irb. (cherry-picked from commit 8bba183b9eeb162661a287bf2e118c6dd419dd24) --- src/mesa/drivers/dri/intel/intel_fbo.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 30f58b1f44..ed7c78e06c 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -680,6 +680,11 @@ intel_validate_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb) if (rb == NULL) continue; + if (irb == NULL) { + fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT; + continue; + } + switch (irb->texformat->MesaFormat) { case MESA_FORMAT_ARGB8888: case MESA_FORMAT_RGB565: -- cgit v1.2.3 From 734a498ed47b35c9e8e7172d19465aca640fa323 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Fonseca?= Date: Mon, 21 Sep 2009 19:57:57 +0100 Subject: mesa: Ensure TGSI tokens are freed with gallium's free. To avoid breaking the gallium's builtin malloc debugging. --- src/mesa/state_tracker/st_cb_program.c | 9 +++++---- src/mesa/state_tracker/st_mesa_to_tgsi.c | 11 +++++++++++ src/mesa/state_tracker/st_mesa_to_tgsi.h | 3 +++ src/mesa/state_tracker/st_program.c | 2 +- 4 files changed, 20 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_program.c b/src/mesa/state_tracker/st_cb_program.c index 4398ab2839..b2d5c39a3a 100644 --- a/src/mesa/state_tracker/st_cb_program.c +++ b/src/mesa/state_tracker/st_cb_program.c @@ -45,6 +45,7 @@ #include "st_context.h" #include "st_program.h" #include "st_atom_shader.h" +#include "st_mesa_to_tgsi.h" #include "st_cb_program.h" @@ -152,7 +153,7 @@ st_delete_program(GLcontext *ctx, struct gl_program *prog) } if (stvp->state.tokens) { - _mesa_free((void *) stvp->state.tokens); + st_free_tokens(stvp->state.tokens); stvp->state.tokens = NULL; } } @@ -167,7 +168,7 @@ st_delete_program(GLcontext *ctx, struct gl_program *prog) } if (stfp->state.tokens) { - _mesa_free((void *) stfp->state.tokens); + st_free_tokens(stfp->state.tokens); stfp->state.tokens = NULL; } @@ -214,7 +215,7 @@ static void st_program_string_notify( GLcontext *ctx, } if (stfp->state.tokens) { - _mesa_free((void *) stfp->state.tokens); + st_free_tokens(stfp->state.tokens); stfp->state.tokens = NULL; } @@ -242,7 +243,7 @@ static void st_program_string_notify( GLcontext *ctx, } if (stvp->state.tokens) { - _mesa_free((void *) stvp->state.tokens); + st_free_tokens(stvp->state.tokens); stvp->state.tokens = NULL; } diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c index 04be57f8ff..b0a1b529f1 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -869,3 +869,14 @@ out: return tokens; } + + +/** + * Tokens cannot be free with _mesa_free otherwise the builtin gallium + * malloc debugging will get confused. + */ +void +st_free_tokens(const struct tgsi_token *tokens) +{ + FREE((void *)tokens); +} diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.h b/src/mesa/state_tracker/st_mesa_to_tgsi.h index 679d0ddd41..c0d1ff59e1 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.h +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.h @@ -56,6 +56,9 @@ st_translate_mesa_program( const ubyte outputSemanticIndex[], const GLbitfield outputFlags[] ); +void +st_free_tokens(const struct tgsi_token *tokens); + #if defined __cplusplus } /* extern "C" */ diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 5f9d2a6dad..927f60cc7e 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -317,7 +317,7 @@ st_translate_vertex_program(struct st_context *st, /* free old shader state, if any */ if (stvp->state.tokens) { - _mesa_free((void *) stvp->state.tokens); + st_free_tokens(stvp->state.tokens); stvp->state.tokens = NULL; } if (stvp->driver_shader) { -- cgit v1.2.3 From ab4ec85f6c04fdb5fabb0c74593643c31f630ac3 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 19 Sep 2009 18:46:51 +0200 Subject: r300: fix a typo --- src/mesa/drivers/dri/r300/r300_render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index b5ddfdc9f8..3cd38753b8 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -475,7 +475,7 @@ void r300SwitchFallback(GLcontext *ctx, uint32_t bit, GLboolean mode) /* update only if we have disabled all tcl fallbacks */ if (rmesa->options.hw_tcl_enabled) { - if ((old_fallback & R300_RASTER_FALLBACK_MASK) == bit) { + if ((old_fallback & R300_TCL_FALLBACK_MASK) == bit) { R300_STATECHANGE(rmesa, vap_cntl_status); rmesa->hw.vap_cntl_status.cmd[1] &= ~R300_VAP_TCL_BYPASS; } -- cgit v1.2.3 From db928a5e9155001fd441a32aa5af7d59af02ca5d Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 19 Sep 2009 18:47:36 +0200 Subject: mesa: add some debug info to teximage.c --- src/mesa/main/teximage.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 8228303040..a8160c2735 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -36,6 +36,7 @@ #if FEATURE_convolve #include "convolve.h" #endif +#include "enums.h" #include "fbobject.h" #include "framebuffer.h" #include "hash.h" @@ -2131,6 +2132,13 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glTexImage1D %s %d %s %d %d %s %s %p\n", + _mesa_lookup_enum_by_nr(target), level, + _mesa_lookup_enum_by_nr(internalFormat), width, border, + _mesa_lookup_enum_by_nr(format), + _mesa_lookup_enum_by_nr(type), pixels); + internalFormat = override_internal_format(internalFormat, width, 1); #if FEATURE_convolve @@ -2230,6 +2238,13 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glTexImage2D %s %d %s %d %d %d %s %s %p\n", + _mesa_lookup_enum_by_nr(target), level, + _mesa_lookup_enum_by_nr(internalFormat), width, height, + border, _mesa_lookup_enum_by_nr(format), + _mesa_lookup_enum_by_nr(type), pixels); + internalFormat = override_internal_format(internalFormat, width, height); #if FEATURE_convolve @@ -2346,6 +2361,13 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glTexImage3D %s %d %s %d %d %d %d %s %s %p\n", + _mesa_lookup_enum_by_nr(target), level, + _mesa_lookup_enum_by_nr(internalFormat), width, height, + depth, border, _mesa_lookup_enum_by_nr(format), + _mesa_lookup_enum_by_nr(type), pixels); + internalFormat = override_internal_format(internalFormat, width, height); if (target == GL_TEXTURE_3D || @@ -2455,6 +2477,12 @@ _mesa_TexSubImage1D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glTexSubImage1D %s %d %d %d %s %s %p\n", + _mesa_lookup_enum_by_nr(target), level, + xoffset, width, _mesa_lookup_enum_by_nr(format), + _mesa_lookup_enum_by_nr(type), pixels); + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); @@ -2515,6 +2543,13 @@ _mesa_TexSubImage2D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glTexSubImage2D %s %d %d %d %d %d %s %s %p\n", + _mesa_lookup_enum_by_nr(target), level, + xoffset, yoffset, width, height, + _mesa_lookup_enum_by_nr(format), + _mesa_lookup_enum_by_nr(type), pixels); + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); @@ -2575,6 +2610,13 @@ _mesa_TexSubImage3D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glTexSubImage3D %s %d %d %d %d %d %d %d %s %s %p\n", + _mesa_lookup_enum_by_nr(target), level, + xoffset, yoffset, zoffset, width, height, depth, + _mesa_lookup_enum_by_nr(format), + _mesa_lookup_enum_by_nr(type), pixels); + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); @@ -2631,6 +2673,12 @@ _mesa_CopyTexImage1D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glCopyTexImage1D %s %d %s %d %d %d %d\n", + _mesa_lookup_enum_by_nr(target), level, + _mesa_lookup_enum_by_nr(internalFormat), + x, y, width, border); + if (ctx->NewState & NEW_COPY_TEX_STATE) _mesa_update_state(ctx); @@ -2696,6 +2744,12 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glCopyTexImage2D %s %d %s %d %d %d %d %d\n", + _mesa_lookup_enum_by_nr(target), level, + _mesa_lookup_enum_by_nr(internalFormat), + x, y, width, height, border); + if (ctx->NewState & NEW_COPY_TEX_STATE) _mesa_update_state(ctx); @@ -2764,6 +2818,11 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glCopyTexSubImage1D %s %d %d %d %d %d\n", + _mesa_lookup_enum_by_nr(target), + level, xoffset, x, y, width); + if (ctx->NewState & NEW_COPY_TEX_STATE) _mesa_update_state(ctx); @@ -2819,6 +2878,11 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glCopyTexSubImage2D %s %d %d %d %d %d %d %d\n", + _mesa_lookup_enum_by_nr(target), + level, xoffset, yoffset, x, y, width, height); + if (ctx->NewState & NEW_COPY_TEX_STATE) _mesa_update_state(ctx); @@ -2874,6 +2938,11 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glCopyTexSubImage3D %s %d %d %d %d %d %d %d %d\n", + _mesa_lookup_enum_by_nr(target), + level, xoffset, yoffset, zoffset, x, y, width, height); + if (ctx->NewState & NEW_COPY_TEX_STATE) _mesa_update_state(ctx); @@ -3122,6 +3191,12 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glCompressedTexImage1DARB %s %d %s %d %d %d %p\n", + _mesa_lookup_enum_by_nr(target), level, + _mesa_lookup_enum_by_nr(internalFormat), + width, border, imageSize, data); + if (target == GL_TEXTURE_1D) { /* non-proxy target */ struct gl_texture_unit *texUnit; @@ -3216,6 +3291,12 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glCompressedTexImage2DARB %s %d %s %d %d %d %d %p\n", + _mesa_lookup_enum_by_nr(target), level, + _mesa_lookup_enum_by_nr(internalFormat), + width, height, border, imageSize, data); + if (target == GL_TEXTURE_2D || (ctx->Extensions.ARB_texture_cube_map && target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && @@ -3315,6 +3396,12 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glCompressedTexImage3DARB %s %d %s %d %d %d %d %d %p\n", + _mesa_lookup_enum_by_nr(target), level, + _mesa_lookup_enum_by_nr(internalFormat), + width, height, depth, border, imageSize, data); + if (target == GL_TEXTURE_3D) { /* non-proxy target */ struct gl_texture_unit *texUnit; -- cgit v1.2.3 From ff5535c5219047fc56f89c55ee44899d218dc234 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sun, 20 Sep 2009 13:54:59 +0200 Subject: radeon: update buffer map/unmap code for changes introduced in 92033a9516942d7272ce4bf36ecd422009bbaf60 and 822c7964819ca1fcc270880d4ca8b3de8a4276d0 --- src/mesa/drivers/dri/radeon/radeon_buffer_objects.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c b/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c index a24b6dac26..8fac5c6c51 100644 --- a/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c +++ b/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c @@ -187,7 +187,11 @@ radeonMapBuffer(GLcontext * ctx, radeon_bo_map(radeon_obj->bo, access == GL_WRITE_ONLY_ARB); - return obj->Pointer = radeon_obj->bo->ptr; + obj->Pointer = radeon_obj->bo->ptr; + obj->Length = obj->Size; + obj->Offset = 0; + + return obj->Pointer; } @@ -203,9 +207,12 @@ radeonUnmapBuffer(GLcontext * ctx, if (radeon_obj->bo != NULL) { radeon_bo_unmap(radeon_obj->bo); - obj->Pointer = NULL; } + obj->Pointer = NULL; + obj->Offset = 0; + obj->Length = 0; + return GL_TRUE; } -- cgit v1.2.3 From 44d260329efaea2bc844afa42fb1b4f882ab74fd Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 21 Sep 2009 14:07:35 -0600 Subject: mesa: make max_buffer_index() a non-static function --- src/mesa/main/api_validate.c | 16 ++++++++-------- src/mesa/main/api_validate.h | 6 ++++++ 2 files changed, 14 insertions(+), 8 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index 2df4f17389..507e21fe81 100644 --- a/src/mesa/main/api_validate.c +++ b/src/mesa/main/api_validate.c @@ -54,10 +54,10 @@ index_bytes(GLenum type, GLsizei count) /** * Find the max index in the given element/index buffer */ -static GLuint -max_buffer_index(GLcontext *ctx, GLuint count, GLenum type, - const void *indices, - struct gl_buffer_object *elementBuf) +GLuint +_mesa_max_buffer_index(GLcontext *ctx, GLuint count, GLenum type, + const void *indices, + struct gl_buffer_object *elementBuf) { const GLubyte *map = NULL; GLuint max = 0; @@ -179,8 +179,8 @@ _mesa_validate_DrawElements(GLcontext *ctx, if (ctx->Const.CheckArrayBounds) { /* find max array index */ - GLuint max = max_buffer_index(ctx, count, type, indices, - ctx->Array.ElementArrayBufferObj); + GLuint max = _mesa_max_buffer_index(ctx, count, type, indices, + ctx->Array.ElementArrayBufferObj); if (max >= ctx->Array.ArrayObj->_MaxElement) { /* the max element is out of bounds of one or more enabled arrays */ _mesa_warning(ctx, "glDrawElements() index=%u is " @@ -251,8 +251,8 @@ _mesa_validate_DrawRangeElements(GLcontext *ctx, GLenum mode, } if (ctx->Const.CheckArrayBounds) { - GLuint max = max_buffer_index(ctx, count, type, indices, - ctx->Array.ElementArrayBufferObj); + GLuint max = _mesa_max_buffer_index(ctx, count, type, indices, + ctx->Array.ElementArrayBufferObj); if (max >= ctx->Array.ArrayObj->_MaxElement) { /* the max element is out of bounds of one or more enabled arrays */ return GL_FALSE; diff --git a/src/mesa/main/api_validate.h b/src/mesa/main/api_validate.h index 10f0c34e66..ff82a2966c 100644 --- a/src/mesa/main/api_validate.h +++ b/src/mesa/main/api_validate.h @@ -30,6 +30,12 @@ #include "mtypes.h" + +extern GLuint +_mesa_max_buffer_index(GLcontext *ctx, GLuint count, GLenum type, + const void *indices, + struct gl_buffer_object *elementBuf); + extern GLboolean _mesa_validate_DrawArrays(GLcontext *ctx, GLenum mode, GLint start, GLsizei count); -- cgit v1.2.3 From 2655d437569c5bce7c56782792cbd4460b9f758b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 21 Sep 2009 14:23:07 -0600 Subject: mesa: refine the error checking vbo_exec_DrawRangeElements() If the 'end' index is out of bounds issue a warning as before. But instead of just no-op'ing the draw call, examine the actual array indices to see if they're OK. If the max array index is out of bounds, issue another warning and no-op the draw call. Otherwise, draw normally. This is a debug build-only feature since it could impact performance. This "fixes" the missing torus in the OGL Distilled / Picking demo. --- src/mesa/vbo/vbo_exec_array.c | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index 12911f5750..3f0656a816 100644 --- a/src/mesa/vbo/vbo_exec_array.c +++ b/src/mesa/vbo/vbo_exec_array.c @@ -677,9 +677,10 @@ vbo_exec_DrawRangeElements(GLenum mode, /* the max element is out of bounds of one or more enabled arrays */ _mesa_warning(ctx, "glDraw[Range]Elements(start %u, end %u, count %d, " "type 0x%x, indices=%p)\n" - "\tindex=%u is out of bounds (max=%u) " - "Element Buffer %u (size %d)", - start, end, count, type, indices, end, + "\tend is out of bounds (max=%u) " + "Element Buffer %u (size %d)\n" + "\tThis should probably be fixed in the application.", + start, end, count, type, indices, ctx->Array.ArrayObj->_MaxElement - 1, ctx->Array.ElementArrayBufferObj->Name, ctx->Array.ElementArrayBufferObj->Size); @@ -689,7 +690,33 @@ vbo_exec_DrawRangeElements(GLenum mode, if (0) _mesa_print_arrays(ctx); - return; + +#ifdef DEBUG + /* 'end' was out of bounds, but now let's check the actual array + * indexes to see if any of them are out of bounds. If so, warn + * and skip the draw to avoid potential segfault, etc. + */ + { + GLuint max = _mesa_max_buffer_index(ctx, count, type, indices, + ctx->Array.ElementArrayBufferObj); + if (max >= ctx->Array.ArrayObj->_MaxElement) { + _mesa_warning(ctx, "glDraw[Range]Elements(start %u, end %u, " + "count %d, type 0x%x, indices=%p)\n" + "\tindex=%u is out of bounds (max=%u) " + "Element Buffer %u (size %d)\n" + "\tSkipping the glDrawRangeElements() call", + start, end, count, type, indices, max, + ctx->Array.ArrayObj->_MaxElement - 1, + ctx->Array.ElementArrayBufferObj->Name, + ctx->Array.ElementArrayBufferObj->Size); + return; + } + /* XXX we could also find the min index and compare to 'start' + * to see if start is correct. But it's more likely to get the + * upper bound wrong. + */ + } +#endif } else if (0) { _mesa_printf("glDraw[Range]Elements" -- cgit v1.2.3 From 1869bdabbac0926c7da8bfd9e22616cab9457126 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 21 Sep 2009 16:30:14 -0400 Subject: r600: various cleanups - max texture size is 8k, but mesa doesn't support that at the moment. - attempt to set shader limits to what the hw actually supports - clean up some old r300 cruft - no need to explicitly disable irqs. This is fixed in the drm now. Signed-off-by: Alex Deucher --- src/mesa/drivers/dri/r600/r600_context.c | 43 +++++++++++----------- src/mesa/drivers/dri/r600/r600_context.h | 19 ---------- .../drivers/dri/radeon/radeon_common_context.c | 7 +--- 3 files changed, 24 insertions(+), 45 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index f8fd9c13d7..6a90a5bcd1 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -284,8 +284,8 @@ GLboolean r600CreateContext(const __GLcontextModes * glVisual, ctx->Const.MaxTextureMaxAnisotropy = 16.0; ctx->Const.MaxTextureLodBias = 16.0; - ctx->Const.MaxTextureLevels = 13; - ctx->Const.MaxTextureRectSize = 4096; + ctx->Const.MaxTextureLevels = 13; /* hw support 14 */ + ctx->Const.MaxTextureRectSize = 4096; /* hw support 8192 */ ctx->Const.MinPointSize = 0x0001 / 8.0; ctx->Const.MinPointSizeAA = 0x0001 / 8.0; @@ -331,25 +331,26 @@ GLboolean r600CreateContext(const __GLcontextModes * glVisual, _tnl_allow_vertex_fog(ctx, GL_TRUE); /* currently bogus data */ - ctx->Const.VertexProgram.MaxInstructions = VSF_MAX_FRAGMENT_LENGTH / 4; - ctx->Const.VertexProgram.MaxNativeInstructions = - VSF_MAX_FRAGMENT_LENGTH / 4; - ctx->Const.VertexProgram.MaxNativeAttribs = 16; /* r420 */ - ctx->Const.VertexProgram.MaxTemps = 32; - ctx->Const.VertexProgram.MaxNativeTemps = - /*VSF_MAX_FRAGMENT_TEMPS */ 32; - ctx->Const.VertexProgram.MaxNativeParameters = 256; /* r420 */ - ctx->Const.VertexProgram.MaxNativeAddressRegs = 1; - - ctx->Const.FragmentProgram.MaxNativeTemps = PFS_NUM_TEMP_REGS; - ctx->Const.FragmentProgram.MaxNativeAttribs = 11; /* copy i915... */ - ctx->Const.FragmentProgram.MaxNativeParameters = PFS_NUM_CONST_REGS; - ctx->Const.FragmentProgram.MaxNativeAluInstructions = PFS_MAX_ALU_INST; - ctx->Const.FragmentProgram.MaxNativeTexInstructions = PFS_MAX_TEX_INST; - ctx->Const.FragmentProgram.MaxNativeInstructions = - PFS_MAX_ALU_INST + PFS_MAX_TEX_INST; - ctx->Const.FragmentProgram.MaxNativeTexIndirections = - PFS_MAX_TEX_INDIRECT; + ctx->Const.VertexProgram.MaxInstructions = 8192; /* in theory no limit */ + ctx->Const.VertexProgram.MaxNativeInstructions = 8192; + ctx->Const.VertexProgram.MaxNativeAttribs = 160; + ctx->Const.VertexProgram.MaxTemps = 256; /* 256 for reg-based constants, inline consts also supported */ + ctx->Const.VertexProgram.MaxNativeTemps = 256; + ctx->Const.VertexProgram.MaxNativeParameters = 256; /* ??? */ + ctx->Const.VertexProgram.MaxNativeAddressRegs = 1; /* ??? */ + + ctx->Const.FragmentProgram.MaxNativeTemps = 256; + ctx->Const.FragmentProgram.MaxNativeAttribs = 32; + ctx->Const.FragmentProgram.MaxNativeParameters = 256; + ctx->Const.FragmentProgram.MaxNativeAluInstructions = 8192; + /* 8 per clause on r6xx, 16 on rv670/r7xx */ + if ((screen->chip_family == CHIP_FAMILY_RV670) || + (screen->chip_family >= CHIP_FAMILY_RV770)) + ctx->Const.FragmentProgram.MaxNativeTexInstructions = 16; + else + ctx->Const.FragmentProgram.MaxNativeTexInstructions = 8; + ctx->Const.FragmentProgram.MaxNativeInstructions = 8192; + ctx->Const.FragmentProgram.MaxNativeTexIndirections = 8; /* ??? */ ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; /* and these are?? */ ctx->VertexProgram._MaintainTnlProgram = GL_TRUE; ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE; diff --git a/src/mesa/drivers/dri/r600/r600_context.h b/src/mesa/drivers/dri/r600/r600_context.h index c59df7505a..9397ecde81 100644 --- a/src/mesa/drivers/dri/r600/r600_context.h +++ b/src/mesa/drivers/dri/r600/r600_context.h @@ -86,29 +86,10 @@ extern int hw_tcl_on; #include "tnl_dd/t_dd_vertex.h" #undef TAG -#define PFS_MAX_ALU_INST 64 -#define PFS_MAX_TEX_INST 64 -#define PFS_MAX_TEX_INDIRECT 4 -#define PFS_NUM_TEMP_REGS 32 -#define PFS_NUM_CONST_REGS 16 - -#define R600_MAX_AOS_ARRAYS 16 - -#define REG_COORDS 0 -#define REG_COLOR0 1 -#define REG_TEX0 2 - #define R600_FALLBACK_NONE 0 #define R600_FALLBACK_TCL 1 #define R600_FALLBACK_RAST 2 -enum -{ - NO_SHIFT = 0, - LEFT_SHIFT = 1, - RIGHT_SHIFT = 2, -}; - struct r600_hw_state { struct radeon_state_atom sq; struct radeon_state_atom db; diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.c b/src/mesa/drivers/dri/radeon/radeon_common_context.c index 1c53c04da7..6b9b1e3c5e 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.c @@ -227,11 +227,8 @@ GLboolean radeonInitContext(radeonContextPtr radeon, fthrottle_mode = driQueryOptioni(&radeon->optionCache, "fthrottle_mode"); radeon->iw.irq_seq = -1; radeon->irqsEmitted = 0; - if (IS_R600_CLASS(radeon->radeonScreen)) - radeon->do_irqs = 0; - else - radeon->do_irqs = (fthrottle_mode == DRI_CONF_FTHROTTLE_IRQS && - radeon->radeonScreen->irq); + radeon->do_irqs = (fthrottle_mode == DRI_CONF_FTHROTTLE_IRQS && + radeon->radeonScreen->irq); radeon->do_usleeps = (fthrottle_mode == DRI_CONF_FTHROTTLE_USLEEPS); -- cgit v1.2.3 From c63e78b3e583e39ef296f1c2c9a34c90eb221503 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 21 Sep 2009 16:48:55 -0400 Subject: r600: fix typo in the last commit 128 gprs, 256 reg-based consts --- src/mesa/drivers/dri/r600/r600_context.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index 6a90a5bcd1..354b263f5c 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -330,16 +330,16 @@ GLboolean r600CreateContext(const __GLcontextModes * glVisual, _tnl_allow_pixel_fog(ctx, GL_FALSE); _tnl_allow_vertex_fog(ctx, GL_TRUE); - /* currently bogus data */ + /* 256 for reg-based consts, inline consts also supported */ ctx->Const.VertexProgram.MaxInstructions = 8192; /* in theory no limit */ ctx->Const.VertexProgram.MaxNativeInstructions = 8192; ctx->Const.VertexProgram.MaxNativeAttribs = 160; - ctx->Const.VertexProgram.MaxTemps = 256; /* 256 for reg-based constants, inline consts also supported */ - ctx->Const.VertexProgram.MaxNativeTemps = 256; - ctx->Const.VertexProgram.MaxNativeParameters = 256; /* ??? */ + ctx->Const.VertexProgram.MaxTemps = 128; + ctx->Const.VertexProgram.MaxNativeTemps = 128; + ctx->Const.VertexProgram.MaxNativeParameters = 256; ctx->Const.VertexProgram.MaxNativeAddressRegs = 1; /* ??? */ - ctx->Const.FragmentProgram.MaxNativeTemps = 256; + ctx->Const.FragmentProgram.MaxNativeTemps = 128; ctx->Const.FragmentProgram.MaxNativeAttribs = 32; ctx->Const.FragmentProgram.MaxNativeParameters = 256; ctx->Const.FragmentProgram.MaxNativeAluInstructions = 8192; -- cgit v1.2.3 From d504a7669d7b71229c2d15503a095d71ee1584e6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 21 Sep 2009 08:32:43 -0600 Subject: swrast: fix cube face selection If arx and ary are equal, we still want to choose from one of them, and not arz. This is the same as Michal's softpipe fix. --- src/mesa/swrast/s_texfilter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index 6b1f934647..efe6f23474 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -1862,7 +1862,7 @@ choose_cube_face(const struct gl_texture_object *texObj, GLuint face; GLfloat sc, tc, ma; - if (arx > ary && arx > arz) { + if (arx >= ary && arx >= arz) { if (rx >= 0.0F) { face = FACE_POS_X; sc = -rz; @@ -1876,7 +1876,7 @@ choose_cube_face(const struct gl_texture_object *texObj, ma = arx; } } - else if (ary > arx && ary > arz) { + else if (ary >= arx && ary >= arz) { if (ry >= 0.0F) { face = FACE_POS_Y; sc = rx; -- cgit v1.2.3 From b1c9c5a800a485e3e066312f5736c93ef2774c9b Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 19 Sep 2009 18:46:51 +0200 Subject: r300: fix a typo --- src/mesa/drivers/dri/r300/r300_render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index b5ddfdc9f8..3cd38753b8 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -475,7 +475,7 @@ void r300SwitchFallback(GLcontext *ctx, uint32_t bit, GLboolean mode) /* update only if we have disabled all tcl fallbacks */ if (rmesa->options.hw_tcl_enabled) { - if ((old_fallback & R300_RASTER_FALLBACK_MASK) == bit) { + if ((old_fallback & R300_TCL_FALLBACK_MASK) == bit) { R300_STATECHANGE(rmesa, vap_cntl_status); rmesa->hw.vap_cntl_status.cmd[1] &= ~R300_VAP_TCL_BYPASS; } -- cgit v1.2.3 From d100cbf721010f4eacc87507cc87c5314150d493 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 19 Sep 2009 18:47:36 +0200 Subject: mesa: add some debug info to teximage.c --- src/mesa/main/teximage.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index b0aa04e9aa..b555624d88 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -36,6 +36,7 @@ #if FEATURE_convolve #include "convolve.h" #endif +#include "enums.h" #include "fbobject.h" #include "framebuffer.h" #include "hash.h" @@ -2148,6 +2149,13 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glTexImage1D %s %d %s %d %d %s %s %p\n", + _mesa_lookup_enum_by_nr(target), level, + _mesa_lookup_enum_by_nr(internalFormat), width, border, + _mesa_lookup_enum_by_nr(format), + _mesa_lookup_enum_by_nr(type), pixels); + internalFormat = override_internal_format(internalFormat, width, 1); #if FEATURE_convolve @@ -2247,6 +2255,13 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glTexImage2D %s %d %s %d %d %d %s %s %p\n", + _mesa_lookup_enum_by_nr(target), level, + _mesa_lookup_enum_by_nr(internalFormat), width, height, + border, _mesa_lookup_enum_by_nr(format), + _mesa_lookup_enum_by_nr(type), pixels); + internalFormat = override_internal_format(internalFormat, width, height); #if FEATURE_convolve @@ -2363,6 +2378,13 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glTexImage3D %s %d %s %d %d %d %d %s %s %p\n", + _mesa_lookup_enum_by_nr(target), level, + _mesa_lookup_enum_by_nr(internalFormat), width, height, + depth, border, _mesa_lookup_enum_by_nr(format), + _mesa_lookup_enum_by_nr(type), pixels); + internalFormat = override_internal_format(internalFormat, width, height); if (target == GL_TEXTURE_3D || @@ -2472,6 +2494,12 @@ _mesa_TexSubImage1D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glTexSubImage1D %s %d %d %d %s %s %p\n", + _mesa_lookup_enum_by_nr(target), level, + xoffset, width, _mesa_lookup_enum_by_nr(format), + _mesa_lookup_enum_by_nr(type), pixels); + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); @@ -2533,6 +2561,13 @@ _mesa_TexSubImage2D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glTexSubImage2D %s %d %d %d %d %d %s %s %p\n", + _mesa_lookup_enum_by_nr(target), level, + xoffset, yoffset, width, height, + _mesa_lookup_enum_by_nr(format), + _mesa_lookup_enum_by_nr(type), pixels); + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); @@ -2594,6 +2629,13 @@ _mesa_TexSubImage3D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glTexSubImage3D %s %d %d %d %d %d %d %d %s %s %p\n", + _mesa_lookup_enum_by_nr(target), level, + xoffset, yoffset, zoffset, width, height, depth, + _mesa_lookup_enum_by_nr(format), + _mesa_lookup_enum_by_nr(type), pixels); + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); @@ -2652,6 +2694,12 @@ _mesa_CopyTexImage1D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glCopyTexImage1D %s %d %s %d %d %d %d\n", + _mesa_lookup_enum_by_nr(target), level, + _mesa_lookup_enum_by_nr(internalFormat), + x, y, width, border); + if (ctx->NewState & NEW_COPY_TEX_STATE) _mesa_update_state(ctx); @@ -2718,6 +2766,12 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glCopyTexImage2D %s %d %s %d %d %d %d %d\n", + _mesa_lookup_enum_by_nr(target), level, + _mesa_lookup_enum_by_nr(internalFormat), + x, y, width, height, border); + if (ctx->NewState & NEW_COPY_TEX_STATE) _mesa_update_state(ctx); @@ -2787,6 +2841,11 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glCopyTexSubImage1D %s %d %d %d %d %d\n", + _mesa_lookup_enum_by_nr(target), + level, xoffset, x, y, width); + if (ctx->NewState & NEW_COPY_TEX_STATE) _mesa_update_state(ctx); @@ -2844,6 +2903,11 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glCopyTexSubImage2D %s %d %d %d %d %d %d %d\n", + _mesa_lookup_enum_by_nr(target), + level, xoffset, yoffset, x, y, width, height); + if (ctx->NewState & NEW_COPY_TEX_STATE) _mesa_update_state(ctx); @@ -2904,6 +2968,11 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glCopyTexSubImage3D %s %d %d %d %d %d %d %d %d\n", + _mesa_lookup_enum_by_nr(target), + level, xoffset, yoffset, zoffset, x, y, width, height); + if (ctx->NewState & NEW_COPY_TEX_STATE) _mesa_update_state(ctx); @@ -3155,6 +3224,12 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glCompressedTexImage1DARB %s %d %s %d %d %d %p\n", + _mesa_lookup_enum_by_nr(target), level, + _mesa_lookup_enum_by_nr(internalFormat), + width, border, imageSize, data); + if (target == GL_TEXTURE_1D) { /* non-proxy target */ struct gl_texture_unit *texUnit; @@ -3250,6 +3325,12 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glCompressedTexImage2DARB %s %d %s %d %d %d %d %p\n", + _mesa_lookup_enum_by_nr(target), level, + _mesa_lookup_enum_by_nr(internalFormat), + width, height, border, imageSize, data); + if (target == GL_TEXTURE_2D || (ctx->Extensions.ARB_texture_cube_map && target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && @@ -3350,6 +3431,12 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glCompressedTexImage3DARB %s %d %s %d %d %d %d %d %p\n", + _mesa_lookup_enum_by_nr(target), level, + _mesa_lookup_enum_by_nr(internalFormat), + width, height, depth, border, imageSize, data); + if (target == GL_TEXTURE_3D) { /* non-proxy target */ struct gl_texture_unit *texUnit; -- cgit v1.2.3 From 4916a5a2e72b05c176809dd0db5066a966a45b80 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sun, 20 Sep 2009 13:54:59 +0200 Subject: radeon: update buffer map/unmap code for changes introduced in 92033a9516942d7272ce4bf36ecd422009bbaf60 and 822c7964819ca1fcc270880d4ca8b3de8a4276d0 --- src/mesa/drivers/dri/radeon/radeon_buffer_objects.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c b/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c index a24b6dac26..8fac5c6c51 100644 --- a/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c +++ b/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c @@ -187,7 +187,11 @@ radeonMapBuffer(GLcontext * ctx, radeon_bo_map(radeon_obj->bo, access == GL_WRITE_ONLY_ARB); - return obj->Pointer = radeon_obj->bo->ptr; + obj->Pointer = radeon_obj->bo->ptr; + obj->Length = obj->Size; + obj->Offset = 0; + + return obj->Pointer; } @@ -203,9 +207,12 @@ radeonUnmapBuffer(GLcontext * ctx, if (radeon_obj->bo != NULL) { radeon_bo_unmap(radeon_obj->bo); - obj->Pointer = NULL; } + obj->Pointer = NULL; + obj->Offset = 0; + obj->Length = 0; + return GL_TRUE; } -- cgit v1.2.3 From e5d29ebb5e5dd923c9c60972170d072120007aab Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 21 Sep 2009 14:07:35 -0600 Subject: mesa: make max_buffer_index() a non-static function --- src/mesa/main/api_validate.c | 45 ++++++++++++++++++++++++++++++++++++++++++++ src/mesa/main/api_validate.h | 6 ++++++ 2 files changed, 51 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/api_validate.c b/src/mesa/main/api_validate.c index 4a1448deee..e71e5a6ce8 100644 --- a/src/mesa/main/api_validate.c +++ b/src/mesa/main/api_validate.c @@ -51,6 +51,51 @@ index_bytes(GLenum type, GLsizei count) } +/** + * Find the max index in the given element/index buffer + */ +GLuint +_mesa_max_buffer_index(GLcontext *ctx, GLuint count, GLenum type, + const void *indices, + struct gl_buffer_object *elementBuf) +{ + const GLubyte *map = NULL; + GLuint max = 0; + GLuint i; + + if (_mesa_is_bufferobj(elementBuf)) { + /* elements are in a user-defined buffer object. need to map it */ + map = ctx->Driver.MapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER, + GL_READ_ONLY, elementBuf); + /* Actual address is the sum of pointers */ + indices = (const GLvoid *) ADD_POINTERS(map, (const GLubyte *) indices); + } + + if (type == GL_UNSIGNED_INT) { + for (i = 0; i < count; i++) + if (((GLuint *) indices)[i] > max) + max = ((GLuint *) indices)[i]; + } + else if (type == GL_UNSIGNED_SHORT) { + for (i = 0; i < count; i++) + if (((GLushort *) indices)[i] > max) + max = ((GLushort *) indices)[i]; + } + else { + ASSERT(type == GL_UNSIGNED_BYTE); + for (i = 0; i < count; i++) + if (((GLubyte *) indices)[i] > max) + max = ((GLubyte *) indices)[i]; + } + + if (map) { + ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, elementBuf); + } + + return max; +} + + /** * Check if OK to draw arrays/elements. */ diff --git a/src/mesa/main/api_validate.h b/src/mesa/main/api_validate.h index 1d3ae157d7..6064d15fe6 100644 --- a/src/mesa/main/api_validate.h +++ b/src/mesa/main/api_validate.h @@ -30,6 +30,12 @@ #include "mtypes.h" + +extern GLuint +_mesa_max_buffer_index(GLcontext *ctx, GLuint count, GLenum type, + const void *indices, + struct gl_buffer_object *elementBuf); + extern GLboolean _mesa_validate_DrawArrays(GLcontext *ctx, GLenum mode, GLint start, GLsizei count); -- cgit v1.2.3 From 40603526f478a59b89a4c0a07c75a97dfe56b8c3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 21 Sep 2009 14:23:07 -0600 Subject: mesa: refine the error checking vbo_exec_DrawRangeElements() If the 'end' index is out of bounds issue a warning as before. But instead of just no-op'ing the draw call, examine the actual array indices to see if they're OK. If the max array index is out of bounds, issue another warning and no-op the draw call. Otherwise, draw normally. This is a debug build-only feature since it could impact performance. This "fixes" the missing torus in the OGL Distilled / Picking demo. --- src/mesa/vbo/vbo_exec_array.c | 39 +++++++++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index b9550d6106..7eca7f5057 100644 --- a/src/mesa/vbo/vbo_exec_array.c +++ b/src/mesa/vbo/vbo_exec_array.c @@ -680,11 +680,12 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, if (end >= ctx->Array.ArrayObj->_MaxElement) { /* the max element is out of bounds of one or more enabled arrays */ - _mesa_warning(ctx, "glDraw[Range]Elements{,BaseVertex}(start %u, end %u, " - "count %d, type 0x%x, indices=%p, base=%d)\n" - "\tindex=%u is out of bounds (max=%u) " - "Element Buffer %u (size %d)", - start, end, count, type, indices, end, basevertex, + _mesa_warning(ctx, "glDraw[Range]Elements(start %u, end %u, count %d, " + "type 0x%x, indices=%p)\n" + "\tend is out of bounds (max=%u) " + "Element Buffer %u (size %d)\n" + "\tThis should probably be fixed in the application.", + start, end, count, type, indices, ctx->Array.ArrayObj->_MaxElement - 1, ctx->Array.ElementArrayBufferObj->Name, ctx->Array.ElementArrayBufferObj->Size); @@ -694,7 +695,33 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, if (0) _mesa_print_arrays(ctx); - return; + +#ifdef DEBUG + /* 'end' was out of bounds, but now let's check the actual array + * indexes to see if any of them are out of bounds. If so, warn + * and skip the draw to avoid potential segfault, etc. + */ + { + GLuint max = _mesa_max_buffer_index(ctx, count, type, indices, + ctx->Array.ElementArrayBufferObj); + if (max >= ctx->Array.ArrayObj->_MaxElement) { + _mesa_warning(ctx, "glDraw[Range]Elements(start %u, end %u, " + "count %d, type 0x%x, indices=%p)\n" + "\tindex=%u is out of bounds (max=%u) " + "Element Buffer %u (size %d)\n" + "\tSkipping the glDrawRangeElements() call", + start, end, count, type, indices, max, + ctx->Array.ArrayObj->_MaxElement - 1, + ctx->Array.ElementArrayBufferObj->Name, + ctx->Array.ElementArrayBufferObj->Size); + return; + } + /* XXX we could also find the min index and compare to 'start' + * to see if start is correct. But it's more likely to get the + * upper bound wrong. + */ + } +#endif } else if (0) { _mesa_printf("glDraw[Range]Elements{,BaseVertex}" -- cgit v1.2.3 From 83019ffc0708708af7ee1ddbf3cbf949bcf076bd Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Mon, 21 Sep 2009 17:03:58 -0400 Subject: selinux: Fix mmap() return value check --- src/mesa/main/execmem.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/execmem.c b/src/mesa/main/execmem.c index 57c1e117c8..4c6139985f 100644 --- a/src/mesa/main/execmem.c +++ b/src/mesa/main/execmem.c @@ -80,11 +80,10 @@ init_heap(void) exec_heap = mmInit( 0, EXEC_HEAP_SIZE ); if (!exec_mem) - exec_mem = (unsigned char *) mmap(0, EXEC_HEAP_SIZE, - PROT_EXEC | PROT_READ | PROT_WRITE, - MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); + exec_mem = mmap(NULL, EXEC_HEAP_SIZE, PROT_EXEC | PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_ANONYMOUS, -1, 0); - return (exec_mem != NULL); + return (exec_mem != MAP_FAILED); } -- cgit v1.2.3 From 972e995b148c220d32f2bf8c0a17c138deec6506 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 21 Sep 2009 16:07:14 -0600 Subject: vbo: disable the GL_ARB_draw_elements_base_vertex rebase path This was introduced with commit 92d7ed8a20d4a018ce5324e6537ae7b478b9e5bf. It causes rendering of stray polygons (with sw rendering at least) when running the OGL Distilled / Picking demo (click on an object). This needs additional debugging to fix/restore. Found one suspect thing: in _tnl_draw_prims() there's some mixed signed/ unsigned arithmetic/comparing at line 422 that may be incorrect. --- src/mesa/vbo/vbo_rebase.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/vbo/vbo_rebase.c b/src/mesa/vbo/vbo_rebase.c index 799a25fc1c..55a82ee369 100644 --- a/src/mesa/vbo/vbo_rebase.c +++ b/src/mesa/vbo/vbo_rebase.c @@ -127,7 +127,10 @@ void vbo_rebase_prims( GLcontext *ctx, _mesa_printf("%s %d..%d\n", __FUNCTION__, min_index, max_index); - if (ib && ctx->Extensions.ARB_draw_elements_base_vertex) { + /* XXX this path is disabled for now. + * There's rendering corruption in some apps when it's enabled. + */ + if (0 && ib && ctx->Extensions.ARB_draw_elements_base_vertex) { /* If we can just tell the hardware or the TNL to interpret our * indices with a different base, do so. */ -- cgit v1.2.3 From 9a3333f43600ed4b9a17e49f79004f0c8d289378 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 21 Sep 2009 16:51:34 -0600 Subject: vbo: restore some lost warning output --- src/mesa/vbo/vbo_exec_array.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index 7eca7f5057..ee37eeb937 100644 --- a/src/mesa/vbo/vbo_exec_array.c +++ b/src/mesa/vbo/vbo_exec_array.c @@ -681,11 +681,11 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, if (end >= ctx->Array.ArrayObj->_MaxElement) { /* the max element is out of bounds of one or more enabled arrays */ _mesa_warning(ctx, "glDraw[Range]Elements(start %u, end %u, count %d, " - "type 0x%x, indices=%p)\n" + "type 0x%x, indices %p, base %d)\n" "\tend is out of bounds (max=%u) " "Element Buffer %u (size %d)\n" "\tThis should probably be fixed in the application.", - start, end, count, type, indices, + start, end, count, type, indices, basevertex, ctx->Array.ArrayObj->_MaxElement - 1, ctx->Array.ElementArrayBufferObj->Name, ctx->Array.ElementArrayBufferObj->Size); @@ -706,11 +706,12 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, ctx->Array.ElementArrayBufferObj); if (max >= ctx->Array.ArrayObj->_MaxElement) { _mesa_warning(ctx, "glDraw[Range]Elements(start %u, end %u, " - "count %d, type 0x%x, indices=%p)\n" + "count %d, type 0x%x, indices %p, base %p)\n" "\tindex=%u is out of bounds (max=%u) " "Element Buffer %u (size %d)\n" "\tSkipping the glDrawRangeElements() call", - start, end, count, type, indices, max, + start, end, count, type, indices, basevertex, + max, ctx->Array.ArrayObj->_MaxElement - 1, ctx->Array.ElementArrayBufferObj->Name, ctx->Array.ElementArrayBufferObj->Size); -- cgit v1.2.3 From 94a020cfe6cb1da04695897eed38b530af31f524 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 21 Sep 2009 16:54:35 -0600 Subject: vbo: added comment about max array index --- src/mesa/vbo/vbo_exec_array.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index ee37eeb937..668dc6eb24 100644 --- a/src/mesa/vbo/vbo_exec_array.c +++ b/src/mesa/vbo/vbo_exec_array.c @@ -678,6 +678,12 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, type, indices, basevertex )) return; + /* NOTE: It's important that 'end' is a reasonable value. + * in _tnl_draw_prims(), we use end to determine how many vertices + * to transform. If it's too large, we can unnecessarily split prims + * or we can read/write out of memory in several different places! + */ + if (end >= ctx->Array.ArrayObj->_MaxElement) { /* the max element is out of bounds of one or more enabled arrays */ _mesa_warning(ctx, "glDraw[Range]Elements(start %u, end %u, count %d, " -- cgit v1.2.3 From 8cc12ffb34769a84050be034d19921af811a3406 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= Date: Tue, 22 Sep 2009 20:57:05 +0200 Subject: r300: Fix crash reported in bug #24066 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicolai Hähnle --- src/mesa/drivers/dri/r300/r300_vertprog.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index 0cb7dde985..2f7b67c143 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -43,6 +43,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "compiler/radeon_compiler.h" #include "compiler/radeon_nqssadce.h" #include "r300_context.h" +#include "r300_fragprog_common.h" #include "r300_state.h" /** @@ -298,6 +299,20 @@ struct r300_vertex_program * r300SelectAndTranslateVertexShader(GLcontext *ctx) struct r300_vertex_program *vp; vpc = (struct r300_vertex_program_cont *)ctx->VertexProgram._Current; + + if (!r300->selected_fp) { + /* This can happen when GetProgramiv is called to check + * whether the program runs natively. + * + * To be honest, this is not a very good solution, + * but solving the problem of reporting good values + * for those queries is tough anyway considering that + * we recompile vertex programs based on the precise + * fragment program that is in use. + */ + r300SelectAndTranslateFragmentShader(ctx); + } + wanted_key.FpReads = r300->selected_fp->InputsRead; wanted_key.FogAttr = r300->selected_fp->fog_attr; wanted_key.WPosAttr = r300->selected_fp->wpos_attr; -- cgit v1.2.3 From 52cadf7592c980eb9cebb1e2b50b552bb61d9f21 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 22 Sep 2009 13:14:55 -0600 Subject: mesa: fix error message text --- src/mesa/main/bufferobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index c8d160baa9..2d1be5b776 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -1040,7 +1040,7 @@ _mesa_MapBufferARB(GLenum target, GLenum access) ASSERT(ctx->Driver.MapBuffer); bufObj->Pointer = ctx->Driver.MapBuffer( ctx, target, access, bufObj ); if (!bufObj->Pointer) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glMapBufferARB(access)"); + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glMapBufferARB(map failed)"); } bufObj->Access = access; -- cgit v1.2.3 From f338de4018f2cfcb462f98c7d76bf6cc36ab6f47 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 22 Sep 2009 13:47:49 -0600 Subject: mesa: fix more buffer object error messages --- src/mesa/main/bufferobj.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index b95e00af5b..189b5e1655 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -1173,7 +1173,7 @@ _mesa_BufferDataARB(GLenum target, GLsizeiptrARB size, ASSERT(ctx->Driver.BufferData); if (!ctx->Driver.BufferData( ctx, target, size, data, usage, bufObj )) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBufferDataARB(access)"); + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBufferDataARB()"); } } @@ -1262,7 +1262,7 @@ _mesa_MapBufferARB(GLenum target, GLenum access) ASSERT(ctx->Driver.MapBuffer); map = ctx->Driver.MapBuffer( ctx, target, access, bufObj ); if (!map) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glMapBufferARB(access)"); + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glMapBufferARB(map failed)"); return NULL; } else { @@ -1593,7 +1593,7 @@ _mesa_MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, map = ctx->Driver.MapBufferRange(ctx, target, offset, length, access, bufObj); if (!map) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glMapBufferARB(access)"); + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glMapBufferARB(map failed)"); } else { /* The driver callback should have set all these fields. -- cgit v1.2.3 From 81283b0bf0a8f7b31517adc224c20531e27fab42 Mon Sep 17 00:00:00 2001 From: Richard Li Date: Tue, 22 Sep 2009 16:39:11 -0400 Subject: r600 : add draw_prim support. --- src/mesa/drivers/dri/r600/Makefile | 1 + src/mesa/drivers/dri/r600/r600_context.c | 3 + src/mesa/drivers/dri/r600/r600_context.h | 32 ++ src/mesa/drivers/dri/r600/r700_assembler.c | 127 ++++ src/mesa/drivers/dri/r600/r700_assembler.h | 8 + src/mesa/drivers/dri/r600/r700_chip.c | 100 +++- src/mesa/drivers/dri/r600/r700_render.c | 667 +++++++++++++++++++++- src/mesa/drivers/dri/r600/r700_shader.c | 90 +++ src/mesa/drivers/dri/r600/r700_shader.h | 1 + src/mesa/drivers/dri/r600/r700_state.c | 20 +- src/mesa/drivers/dri/r600/r700_state.h | 1 + src/mesa/drivers/dri/r600/r700_vertprog.c | 195 ++++++- src/mesa/drivers/dri/r600/r700_vertprog.h | 17 +- src/mesa/drivers/dri/r600/radeon_buffer_objects.c | 1 + src/mesa/drivers/dri/r600/radeon_buffer_objects.h | 1 + 15 files changed, 1217 insertions(+), 47 deletions(-) create mode 120000 src/mesa/drivers/dri/r600/radeon_buffer_objects.c create mode 120000 src/mesa/drivers/dri/r600/radeon_buffer_objects.h (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/Makefile b/src/mesa/drivers/dri/r600/Makefile index 36bf773c05..7d5a7b1ab6 100644 --- a/src/mesa/drivers/dri/r600/Makefile +++ b/src/mesa/drivers/dri/r600/Makefile @@ -29,6 +29,7 @@ COMMON_SOURCES = \ RADEON_COMMON_SOURCES = \ radeon_bo_legacy.c \ radeon_common_context.c \ + radeon_buffer_objects.c \ radeon_common.c \ radeon_cs_legacy.c \ radeon_dma.c \ diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index 354b263f5c..6fc6d9d7bf 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -257,6 +257,7 @@ GLboolean r600CreateContext(const __GLcontextModes * glVisual, r600InitTextureFuncs(&functions); r700InitShaderFuncs(&functions); r700InitIoctlFuncs(&functions); + radeonInitBufferObjectFuncs(&functions); if (!radeonInitContext(&r600->radeon, &functions, glVisual, driContextPriv, @@ -375,6 +376,8 @@ GLboolean r600CreateContext(const __GLcontextModes * glVisual, _mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc"); } + r700InitDraw(ctx); + radeon_fbo_init(&r600->radeon); radeonInitSpanFuncs( ctx ); diff --git a/src/mesa/drivers/dri/r600/r600_context.h b/src/mesa/drivers/dri/r600/r600_context.h index 9397ecde81..a296ea23fa 100644 --- a/src/mesa/drivers/dri/r600/r600_context.h +++ b/src/mesa/drivers/dri/r600/r600_context.h @@ -126,6 +126,34 @@ struct r600_hw_state { struct radeon_state_atom tx_brdr_clr; }; +typedef struct StreamDesc +{ + GLint size; //number of data element + GLenum type; //data element type + GLsizei stride; + + struct radeon_bo *bo; + GLint bo_offset; + + GLuint dwords; + GLuint dst_loc; + GLuint _signed; + GLboolean normalize; + GLboolean is_named_bo; + GLubyte element; +} StreamDesc; + +typedef struct r700_index_buffer +{ + struct radeon_bo *bo; + int bo_offset; + + GLboolean is_32bit; + GLuint count; + + GLboolean bHostIb; +} r700_index_buffer; + /** * \brief R600 context structure. */ @@ -144,6 +172,9 @@ struct r600_context { GLvector4f dummy_attrib[_TNL_ATTRIB_MAX]; GLvector4f *temp_attrib[_TNL_ATTRIB_MAX]; + GLint nNumActiveAos; + StreamDesc stream_desc[VERT_ATTRIB_MAX]; + struct r700_index_buffer ind_buf; }; #define R700_CONTEXT(ctx) ((context_t *)(ctx->DriverCtx)) @@ -177,6 +208,7 @@ extern GLboolean r700SyncSurf(context_t *context, extern void r700SetupStreams(GLcontext * ctx); extern void r700Start3D(context_t *context); extern void r600InitAtoms(context_t *context); +extern void r700InitDraw(GLcontext *ctx); #define RADEON_D_CAPTURE 0 #define RADEON_D_PLAYBACK 1 diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index f46bc32201..81269350e4 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -786,6 +786,133 @@ GLboolean assemble_vfetch_instruction(r700_AssemblerBase* pAsm, return GL_TRUE; } +GLboolean assemble_vfetch_instruction2(r700_AssemblerBase* pAsm, + GLuint destination_register, + GLenum type, + GLint size, + GLubyte element, + GLuint _signed, + GLboolean normalize, + VTX_FETCH_METHOD * pFetchMethod) +{ + GLuint client_size_inbyte; + GLuint data_format; + GLuint mega_fetch_count; + GLuint is_mega_fetch_flag; + + R700VertexGenericFetch* vfetch_instruction_ptr; + R700VertexGenericFetch* assembled_vfetch_instruction_ptr + = pAsm->vfetch_instruction_ptr_array[element]; + + if (assembled_vfetch_instruction_ptr == NULL) + { + vfetch_instruction_ptr = (R700VertexGenericFetch*) CALLOC_STRUCT(R700VertexGenericFetch); + if (vfetch_instruction_ptr == NULL) + { + return GL_FALSE; + } + Init_R700VertexGenericFetch(vfetch_instruction_ptr); + } + else + { + vfetch_instruction_ptr = assembled_vfetch_instruction_ptr; + } + + data_format = GetSurfaceFormat(type, size, &client_size_inbyte); + + if(GL_TRUE == pFetchMethod->bEnableMini) //More conditions here + { + //TODO : mini fetch + } + else + { + mega_fetch_count = MEGA_FETCH_BYTES - 1; + is_mega_fetch_flag = 0x1; + pFetchMethod->mega_fetch_remainder = MEGA_FETCH_BYTES - client_size_inbyte; + } + + vfetch_instruction_ptr->m_Word0.f.vtx_inst = SQ_VTX_INST_FETCH; + vfetch_instruction_ptr->m_Word0.f.fetch_type = SQ_VTX_FETCH_VERTEX_DATA; + vfetch_instruction_ptr->m_Word0.f.fetch_whole_quad = 0x0; + + vfetch_instruction_ptr->m_Word0.f.buffer_id = element; + vfetch_instruction_ptr->m_Word0.f.src_gpr = 0x0; + vfetch_instruction_ptr->m_Word0.f.src_rel = SQ_ABSOLUTE; + vfetch_instruction_ptr->m_Word0.f.src_sel_x = SQ_SEL_X; + vfetch_instruction_ptr->m_Word0.f.mega_fetch_count = mega_fetch_count; + + vfetch_instruction_ptr->m_Word1.f.dst_sel_x = (size < 1) ? SQ_SEL_0 : SQ_SEL_X; + vfetch_instruction_ptr->m_Word1.f.dst_sel_y = (size < 2) ? SQ_SEL_0 : SQ_SEL_Y; + vfetch_instruction_ptr->m_Word1.f.dst_sel_z = (size < 3) ? SQ_SEL_0 : SQ_SEL_Z; + vfetch_instruction_ptr->m_Word1.f.dst_sel_w = (size < 4) ? SQ_SEL_1 : SQ_SEL_W; + + vfetch_instruction_ptr->m_Word1.f.use_const_fields = 1; + vfetch_instruction_ptr->m_Word1.f.data_format = data_format; + vfetch_instruction_ptr->m_Word2.f.endian_swap = SQ_ENDIAN_NONE; + + if(1 == _signed) + { + vfetch_instruction_ptr->m_Word1.f.format_comp_all = SQ_FORMAT_COMP_SIGNED; + } + else + { + vfetch_instruction_ptr->m_Word1.f.format_comp_all = SQ_FORMAT_COMP_UNSIGNED; + } + + if(GL_TRUE == normalize) + { + vfetch_instruction_ptr->m_Word1.f.num_format_all = SQ_NUM_FORMAT_NORM; + } + else + { + vfetch_instruction_ptr->m_Word1.f.num_format_all = SQ_NUM_FORMAT_INT; + } + + // Destination register + vfetch_instruction_ptr->m_Word1_GPR.f.dst_gpr = destination_register; + vfetch_instruction_ptr->m_Word1_GPR.f.dst_rel = SQ_ABSOLUTE; + + vfetch_instruction_ptr->m_Word2.f.offset = 0; + vfetch_instruction_ptr->m_Word2.f.const_buf_no_stride = 0x0; + + vfetch_instruction_ptr->m_Word2.f.mega_fetch = is_mega_fetch_flag; + + if (assembled_vfetch_instruction_ptr == NULL) + { + if ( GL_FALSE == add_vfetch_instruction(pAsm, (R700VertexInstruction *)vfetch_instruction_ptr) ) + { + return GL_FALSE; + } + + if (pAsm->vfetch_instruction_ptr_array[element] != NULL) + { + return GL_FALSE; + } + else + { + pAsm->vfetch_instruction_ptr_array[element] = vfetch_instruction_ptr; + } + } + + return GL_TRUE; +} + +GLboolean cleanup_vfetch_instructions(r700_AssemblerBase* pAsm) +{ + GLint i; + pAsm->cf_current_clause_type = CF_EMPTY_CLAUSE; + pAsm->cf_current_vtx_clause_ptr = NULL; + + for (i=0; ivfetch_instruction_ptr_array[ i ] = NULL; + } + + cleanup_vfetch_shaderinst(pAsm->pR700Shader); + + return GL_TRUE; +} + GLuint gethelpr(r700_AssemblerBase* pAsm) { GLuint r = pAsm->uHelpReg; diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index f9c4d849c6..4e6e20011a 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -411,6 +411,14 @@ GLboolean assemble_vfetch_instruction(r700_AssemblerBase* pAsm, GLuint number_of_elements, GLenum dataElementType, VTX_FETCH_METHOD* pFetchMethod); +GLboolean assemble_vfetch_instruction2(r700_AssemblerBase* pAsm, + GLuint destination_register, + GLenum type, + GLint size, + GLubyte element, + GLuint _signed, + GLboolean normalize, + VTX_FETCH_METHOD * pFetchMethod); GLuint gethelpr(r700_AssemblerBase* pAsm); void resethelpr(r700_AssemblerBase* pAsm); void checkop_init(r700_AssemblerBase* pAsm); diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index 06d7e9c9ab..783427a94c 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -208,6 +208,80 @@ static void r700SetupVTXConstants(GLcontext * ctx, } +extern int getTypeSize(GLenum type); +static void r700SetupVTXConstants2(GLcontext * ctx, + void * pAos, + StreamDesc * pStreamDesc) +{ + context_t *context = R700_CONTEXT(ctx); + struct radeon_aos * paos = (struct radeon_aos *)pAos; + unsigned int nVBsize; + BATCH_LOCALS(&context->radeon); + + unsigned int uSQ_VTX_CONSTANT_WORD0_0; + unsigned int uSQ_VTX_CONSTANT_WORD1_0; + unsigned int uSQ_VTX_CONSTANT_WORD2_0 = 0; + unsigned int uSQ_VTX_CONSTANT_WORD3_0 = 0; + unsigned int uSQ_VTX_CONSTANT_WORD6_0 = 0; + + if (!paos->bo) + return; + + if ((context->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV610) || + (context->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV620) || + (context->radeon.radeonScreen->chip_family == CHIP_FAMILY_RS780) || + (context->radeon.radeonScreen->chip_family == CHIP_FAMILY_RS880) || + (context->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV710)) + r700SyncSurf(context, paos->bo, RADEON_GEM_DOMAIN_GTT, 0, TC_ACTION_ENA_bit); + else + r700SyncSurf(context, paos->bo, RADEON_GEM_DOMAIN_GTT, 0, VC_ACTION_ENA_bit); + + if(0 == pStreamDesc->stride) + { + nVBsize = paos->count * pStreamDesc->size * getTypeSize(pStreamDesc->type); + } + else + { + nVBsize = paos->count * pStreamDesc->stride; + } + + uSQ_VTX_CONSTANT_WORD0_0 = paos->offset; + uSQ_VTX_CONSTANT_WORD1_0 = nVBsize - 1; + + SETfield(uSQ_VTX_CONSTANT_WORD2_0, 0, BASE_ADDRESS_HI_shift, BASE_ADDRESS_HI_mask); /* TODO */ + SETfield(uSQ_VTX_CONSTANT_WORD2_0, pStreamDesc->stride, SQ_VTX_CONSTANT_WORD2_0__STRIDE_shift, + SQ_VTX_CONSTANT_WORD2_0__STRIDE_mask); + SETfield(uSQ_VTX_CONSTANT_WORD2_0, GetSurfaceFormat(pStreamDesc->type, pStreamDesc->size, NULL), + SQ_VTX_CONSTANT_WORD2_0__DATA_FORMAT_shift, + SQ_VTX_CONSTANT_WORD2_0__DATA_FORMAT_mask); /* TODO : trace back api for initial data type, not only GL_FLOAT */ + SETfield(uSQ_VTX_CONSTANT_WORD2_0, SQ_NUM_FORMAT_SCALED, + SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_shift, SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_mask); + SETbit(uSQ_VTX_CONSTANT_WORD2_0, SQ_VTX_CONSTANT_WORD2_0__FORMAT_COMP_ALL_bit); + + SETfield(uSQ_VTX_CONSTANT_WORD3_0, 1, MEM_REQUEST_SIZE_shift, MEM_REQUEST_SIZE_mask); + SETfield(uSQ_VTX_CONSTANT_WORD6_0, SQ_TEX_VTX_VALID_BUFFER, + SQ_TEX_RESOURCE_WORD6_0__TYPE_shift, SQ_TEX_RESOURCE_WORD6_0__TYPE_mask); + + BEGIN_BATCH_NO_AUTOSTATE(9 + 2); + + R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_RESOURCE, 7)); + R600_OUT_BATCH((pStreamDesc->element + SQ_FETCH_RESOURCE_VS_OFFSET) * FETCH_RESOURCE_STRIDE); + R600_OUT_BATCH(uSQ_VTX_CONSTANT_WORD0_0); + R600_OUT_BATCH(uSQ_VTX_CONSTANT_WORD1_0); + R600_OUT_BATCH(uSQ_VTX_CONSTANT_WORD2_0); + R600_OUT_BATCH(uSQ_VTX_CONSTANT_WORD3_0); + R600_OUT_BATCH(0); + R600_OUT_BATCH(0); + R600_OUT_BATCH(uSQ_VTX_CONSTANT_WORD6_0); + R600_OUT_BATCH_RELOC(uSQ_VTX_CONSTANT_WORD0_0, + paos->bo, + uSQ_VTX_CONSTANT_WORD0_0, + RADEON_GEM_DOMAIN_GTT, 0, 0); + END_BATCH(); + COMMIT_BATCH(); + +} + void r700SetupStreams(GLcontext *ctx) { context_t *context = R700_CONTEXT(ctx); @@ -256,14 +330,24 @@ static void r700SendVTXState(GLcontext *ctx, struct radeon_state_atom *atom) COMMIT_BATCH(); for(i=0; imesa_program->Base.InputsRead & (1 << i)) { - /* currently aos are packed */ - r700SetupVTXConstants(ctx, - i, - (void*)(&context->radeon.tcl.aos[j]), - (unsigned int)context->radeon.tcl.aos[j].components, - (unsigned int)context->radeon.tcl.aos[j].stride * 4, - (unsigned int)context->radeon.tcl.aos[j].count); + if(vp->mesa_program->Base.InputsRead & (1 << i)) + { + if(1 == context->selected_vp->uiVersion) + { + /* currently aos are packed */ + r700SetupVTXConstants(ctx, + i, + (void*)(&context->radeon.tcl.aos[j]), + (unsigned int)context->radeon.tcl.aos[j].components, + (unsigned int)context->radeon.tcl.aos[j].stride * 4, + (unsigned int)context->radeon.tcl.aos[j].count); + } + else + { /* context->selected_vp->uiVersion == 2 : aos not always packed */ + r700SetupVTXConstants2(ctx, + (void*)(&context->radeon.tcl.aos[j]), + &(context->stream_desc[j])); + } j++; } } diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c index b1c3648ca5..b58859b6ba 100644 --- a/src/mesa/drivers/dri/r600/r700_render.c +++ b/src/mesa/drivers/dri/r600/r700_render.c @@ -43,6 +43,7 @@ #include "tnl/t_context.h" #include "tnl/t_vertex.h" #include "tnl/t_pipeline.h" +#include "vbo/vbo_context.h" #include "r600_context.h" #include "r600_cmdbuf.h" @@ -53,6 +54,7 @@ #include "r700_fragprog.h" #include "r700_state.h" +#include "radeon_buffer_objects.h" #include "radeon_common_context.h" void r700WaitForIdle(context_t *context); @@ -270,46 +272,82 @@ static void r700RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim if (type < 0 || num_indices <= 0) return; - total_emit = 3 /* VGT_PRIMITIVE_TYPE */ - + 2 /* VGT_INDEX_TYPE */ - + 2 /* NUM_INSTANCES */ - + num_indices + 3; /* DRAW_INDEX_IMMD */ + total_emit = 3 /* VGT_PRIMITIVE_TYPE */ + + 2 /* VGT_INDEX_TYPE */ + + 2 /* NUM_INSTANCES */ + + num_indices + 3; /* DRAW_INDEX_IMMD */ - BEGIN_BATCH_NO_AUTOSTATE(total_emit); + BEGIN_BATCH_NO_AUTOSTATE(total_emit); // prim - SETfield(vgt_primitive_type, type, - VGT_PRIMITIVE_TYPE__PRIM_TYPE_shift, VGT_PRIMITIVE_TYPE__PRIM_TYPE_mask); - R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_CONFIG_REG, 1)); - R600_OUT_BATCH(mmVGT_PRIMITIVE_TYPE - ASIC_CONFIG_BASE_INDEX); - R600_OUT_BATCH(vgt_primitive_type); + SETfield(vgt_primitive_type, type, + VGT_PRIMITIVE_TYPE__PRIM_TYPE_shift, VGT_PRIMITIVE_TYPE__PRIM_TYPE_mask); + R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_CONFIG_REG, 1)); + R600_OUT_BATCH(mmVGT_PRIMITIVE_TYPE - ASIC_CONFIG_BASE_INDEX); + R600_OUT_BATCH(vgt_primitive_type); // index type - SETfield(vgt_index_type, DI_INDEX_SIZE_32_BIT, INDEX_TYPE_shift, INDEX_TYPE_mask); - R600_OUT_BATCH(CP_PACKET3(R600_IT_INDEX_TYPE, 0)); - R600_OUT_BATCH(vgt_index_type); + SETfield(vgt_index_type, DI_INDEX_SIZE_32_BIT, INDEX_TYPE_shift, INDEX_TYPE_mask); + R600_OUT_BATCH(CP_PACKET3(R600_IT_INDEX_TYPE, 0)); + R600_OUT_BATCH(vgt_index_type); // num instances R600_OUT_BATCH(CP_PACKET3(R600_IT_NUM_INSTANCES, 0)); R600_OUT_BATCH(1); // draw packet - vgt_num_indices = num_indices; - SETfield(vgt_draw_initiator, DI_SRC_SEL_IMMEDIATE, SOURCE_SELECT_shift, SOURCE_SELECT_mask); + vgt_num_indices = num_indices; + SETfield(vgt_draw_initiator, DI_SRC_SEL_IMMEDIATE, SOURCE_SELECT_shift, SOURCE_SELECT_mask); SETfield(vgt_draw_initiator, DI_MAJOR_MODE_0, MAJOR_MODE_shift, MAJOR_MODE_mask); - R600_OUT_BATCH(CP_PACKET3(R600_IT_DRAW_INDEX_IMMD, (num_indices + 1))); - R600_OUT_BATCH(vgt_num_indices); - R600_OUT_BATCH(vgt_draw_initiator); + R600_OUT_BATCH(CP_PACKET3(R600_IT_DRAW_INDEX_IMMD, (num_indices + 1))); + R600_OUT_BATCH(vgt_num_indices); + R600_OUT_BATCH(vgt_draw_initiator); + if(NULL == context->ind_buf.bo) + { for (i = start; i < (start + num_indices); i++) { - if(vb->Elts) - R600_OUT_BATCH(vb->Elts[i]); - else - R600_OUT_BATCH(i); + if(vb->Elts) + { + R600_OUT_BATCH(vb->Elts[i]); + } + else + R600_OUT_BATCH(i); } - END_BATCH(); - COMMIT_BATCH(); + } + else + { + if(GL_TRUE == context->ind_buf.bHostIb) + { + if(GL_TRUE != context->ind_buf.is_32bit) + { + GLushort * pIndex = (GLushort*)ADD_POINTERS(context->ind_buf.bo->ptr, context->ind_buf.bo_offset); + pIndex += start; + for (i = 0; i < num_indices; i++) + { + R600_OUT_BATCH(*pIndex); + pIndex++; + } + } + else + { + GLuint * pIndex = (GLuint*)ADD_POINTERS(context->ind_buf.bo->ptr, context->ind_buf.bo_offset); + pIndex += start; + + for (i = 0; i < num_indices; i++) + { + R600_OUT_BATCH(*pIndex); + pIndex++; + } + } + } + else + { + /* TODO : hw ib draw */ + } + } + END_BATCH(); + COMMIT_BATCH(); } /* start 3d, idle, cb/db flush */ @@ -477,4 +515,585 @@ const struct tnl_pipeline_stage *r700_pipeline[] = 0, }; +#define CONVERT( TYPE, MACRO ) do { \ + GLuint i, j, sz; \ + sz = input->Size; \ + if (input->Normalized) { \ + for (i = 0; i < count; i++) { \ + const TYPE *in = (TYPE *)src_ptr; \ + for (j = 0; j < sz; j++) { \ + *dst_ptr++ = MACRO(*in); \ + in++; \ + } \ + src_ptr += stride; \ + } \ + } else { \ + for (i = 0; i < count; i++) { \ + const TYPE *in = (TYPE *)src_ptr; \ + for (j = 0; j < sz; j++) { \ + *dst_ptr++ = (GLfloat)(*in); \ + in++; \ + } \ + src_ptr += stride; \ + } \ + } \ +} while (0) + +/** + * Convert attribute data type to float + * If the attribute uses named buffer object replace the bo with newly allocated bo + */ +static void r700ConvertAttrib(GLcontext *ctx, int count, + const struct gl_client_array *input, + struct StreamDesc *attr) +{ + context_t *context = R700_CONTEXT(ctx); + const GLvoid *src_ptr; + GLboolean mapped_named_bo = GL_FALSE; + GLfloat *dst_ptr; + GLuint stride; + + stride = (input->StrideB == 0) ? getTypeSize(input->Type) * input->Size : input->StrideB; + + /* Convert value for first element only */ + if (input->StrideB == 0) + { + count = 1; + } + + if (input->BufferObj->Name) + { + if (!input->BufferObj->Pointer) + { + ctx->Driver.MapBuffer(ctx, GL_ARRAY_BUFFER, GL_READ_ONLY_ARB, input->BufferObj); + mapped_named_bo = GL_TRUE; + } + + src_ptr = ADD_POINTERS(input->BufferObj->Pointer, input->Ptr); + } + else + { + src_ptr = input->Ptr; + } + + radeonAllocDmaRegion(&context->radeon, &attr->bo, &attr->bo_offset, + sizeof(GLfloat) * input->Size * count, 32); + dst_ptr = (GLfloat *)ADD_POINTERS(attr->bo->ptr, attr->bo_offset); + + assert(src_ptr != NULL); + + switch (input->Type) + { + case GL_DOUBLE: + CONVERT(GLdouble, (GLfloat)); + break; + case GL_UNSIGNED_INT: + CONVERT(GLuint, UINT_TO_FLOAT); + break; + case GL_INT: + CONVERT(GLint, INT_TO_FLOAT); + break; + case GL_UNSIGNED_SHORT: + CONVERT(GLushort, USHORT_TO_FLOAT); + break; + case GL_SHORT: + CONVERT(GLshort, SHORT_TO_FLOAT); + break; + case GL_UNSIGNED_BYTE: + assert(input->Format != GL_BGRA); + CONVERT(GLubyte, UBYTE_TO_FLOAT); + break; + case GL_BYTE: + CONVERT(GLbyte, BYTE_TO_FLOAT); + break; + default: + assert(0); + break; + } + + if (mapped_named_bo) + { + ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER, input->BufferObj); + } +} + +static void r700AlignDataToDword(GLcontext *ctx, + const struct gl_client_array *input, + int count, + struct StreamDesc *attr) +{ + context_t *context = R700_CONTEXT(ctx); + const int dst_stride = (input->StrideB + 3) & ~3; + const int size = getTypeSize(input->Type) * input->Size * count; + GLboolean mapped_named_bo = GL_FALSE; + + radeonAllocDmaRegion(&context->radeon, &attr->bo, &attr->bo_offset, size, 32); + + if (!input->BufferObj->Pointer) + { + ctx->Driver.MapBuffer(ctx, GL_ARRAY_BUFFER, GL_READ_ONLY_ARB, input->BufferObj); + mapped_named_bo = GL_TRUE; + } + + { + GLvoid *src_ptr = ADD_POINTERS(input->BufferObj->Pointer, input->Ptr); + GLvoid *dst_ptr = ADD_POINTERS(attr->bo->ptr, attr->bo_offset); + int i; + + for (i = 0; i < count; ++i) + { + _mesa_memcpy(dst_ptr, src_ptr, input->StrideB); + src_ptr += input->StrideB; + dst_ptr += dst_stride; + } + } + + if (mapped_named_bo) + { + ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER, input->BufferObj); + } + + attr->stride = dst_stride; +} + +static void r700SetupStreams2(GLcontext *ctx, const struct gl_client_array *input[], int count) +{ + context_t *context = R700_CONTEXT(ctx); + GLuint stride; + int ret; + int i, index; + + R600_STATECHANGE(context, vtx); + + for(index = 0; index < context->nNumActiveAos; index++) + { + struct radeon_aos *aos = &context->radeon.tcl.aos[index]; + i = context->stream_desc[index].element; + + stride = (input[i]->StrideB == 0) ? getTypeSize(input[i]->Type) * input[i]->Size : input[i]->StrideB; + + if (input[i]->Type == GL_DOUBLE || input[i]->Type == GL_UNSIGNED_INT || input[i]->Type == GL_INT || +#if MESA_BIG_ENDIAN + getTypeSize(input[i]->Type) != 4 || +#endif + stride < 4) + { + r700ConvertAttrib(ctx, count, input[i], &context->stream_desc[index]); + } + else + { + if (input[i]->BufferObj->Name) + { + if (stride % 4 != 0) + { + assert(((intptr_t) input[i]->Ptr) % input[i]->StrideB == 0); + r700AlignDataToDword(ctx, input[i], count, &context->stream_desc[index]); + context->stream_desc[index].is_named_bo = GL_FALSE; + } + else + { + context->stream_desc[index].stride = input[i]->StrideB; + context->stream_desc[index].bo_offset = (intptr_t) input[i]->Ptr; + context->stream_desc[index].bo = get_radeon_buffer_object(input[i]->BufferObj)->bo; + context->stream_desc[index].is_named_bo = GL_TRUE; + } + } + else + { + int size; + int local_count = count; + uint32_t *dst; + + if (input[i]->StrideB == 0) + { + size = getTypeSize(input[i]->Type) * input[i]->Size; + local_count = 1; + } + else + { + size = getTypeSize(input[i]->Type) * input[i]->Size * local_count; + } + + radeonAllocDmaRegion(&context->radeon, &context->stream_desc[index].bo, + &context->stream_desc[index].bo_offset, size, 32); + assert(context->stream_desc[index].bo->ptr != NULL); + dst = (uint32_t *)ADD_POINTERS(context->stream_desc[index].bo->ptr, + context->stream_desc[index].bo_offset); + + switch (context->stream_desc[index].dwords) + { + case 1: + radeonEmitVec4(dst, input[i]->Ptr, input[i]->StrideB, local_count); + context->stream_desc[index].stride = 4; + break; + case 2: + radeonEmitVec8(dst, input[i]->Ptr, input[i]->StrideB, local_count); + context->stream_desc[index].stride = 8; + break; + case 3: + radeonEmitVec12(dst, input[i]->Ptr, input[i]->StrideB, local_count); + context->stream_desc[index].stride = 12; + break; + case 4: + radeonEmitVec16(dst, input[i]->Ptr, input[i]->StrideB, local_count); + context->stream_desc[index].stride = 16; + break; + default: + assert(0); + break; + } + } + } + + aos->count = context->stream_desc[index].stride == 0 ? 1 : count; + aos->stride = context->stream_desc[index].stride / sizeof(float); + aos->components = context->stream_desc[index].dwords; + aos->bo = context->stream_desc[index].bo; + aos->offset = context->stream_desc[index].bo_offset; + + if(context->stream_desc[index].is_named_bo) + { + radeon_cs_space_add_persistent_bo(context->radeon.cmdbuf.cs, + context->stream_desc[index].bo, + RADEON_GEM_DOMAIN_GTT, 0); + } + } + + context->radeon.tcl.aos_count = context->nNumActiveAos; + ret = radeon_cs_space_check_with_bo(context->radeon.cmdbuf.cs, + first_elem(&context->radeon.dma.reserved)->bo, + RADEON_GEM_DOMAIN_GTT, 0); +} + +static void r700FreeData(GLcontext *ctx) +{ + /* Need to zero tcl.aos[n].bo and tcl.elt_dma_bo + * to prevent double unref in radeonReleaseArrays + * called during context destroy + */ + context_t *context = R700_CONTEXT(ctx); + + int i; + + for (i = 0; i < context->nNumActiveAos; i++) + { + if (!context->stream_desc[i].is_named_bo) + { + radeon_bo_unref(context->stream_desc[i].bo); + } + context->radeon.tcl.aos[i].bo = NULL; + } + + if (context->ind_buf.bo != NULL) + { + if(context->ind_buf.bHostIb != GL_TRUE) + { + radeon_bo_unref(context->ind_buf.bo); + } + else + { + FREE(context->ind_buf.bo->ptr); + FREE(context->ind_buf.bo); + context->ind_buf.bo = NULL; + } + } +} + +static void r700FixupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer *mesa_ind_buf) +{ + context_t *context = R700_CONTEXT(ctx); + GLvoid *src_ptr; + GLuint *out; + int i; + GLboolean mapped_named_bo = GL_FALSE; + + if (mesa_ind_buf->obj->Name && !mesa_ind_buf->obj->Pointer) + { + ctx->Driver.MapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER, GL_READ_ONLY_ARB, mesa_ind_buf->obj); + mapped_named_bo = GL_TRUE; + assert(mesa_ind_buf->obj->Pointer != NULL); + } + src_ptr = ADD_POINTERS(mesa_ind_buf->obj->Pointer, mesa_ind_buf->ptr); + + if (mesa_ind_buf->type == GL_UNSIGNED_BYTE) + { + GLuint size = sizeof(GLushort) * ((mesa_ind_buf->count + 1) & ~1); + GLubyte *in = (GLubyte *)src_ptr; + + if(context->ind_buf.bHostIb != GL_TRUE) + { + radeonAllocDmaRegion(&context->radeon, &context->ind_buf.bo, + &context->ind_buf.bo_offset, size, 4); + + assert(context->ind_buf.bo->ptr != NULL); + out = (GLuint *)ADD_POINTERS(context->ind_buf.bo->ptr, context->ind_buf.bo_offset); + } + else + { + context->ind_buf.bo = MALLOC_STRUCT(radeon_bo); + context->ind_buf.bo->ptr = ALIGN_MALLOC(size, 4); + context->ind_buf.bo_offset = 0; + out = (GLuint *)context->ind_buf.bo->ptr; + } + + for (i = 0; i + 1 < mesa_ind_buf->count; i += 2) + { + *out++ = in[i] | in[i + 1] << 16; + } + + if (i < mesa_ind_buf->count) + { + *out++ = in[i]; + } + +#if MESA_BIG_ENDIAN + } + else + { /* if (mesa_ind_buf->type == GL_UNSIGNED_SHORT) */ + GLushort *in = (GLushort *)src_ptr; + GLuint size = sizeof(GLushort) * ((mesa_ind_buf->count + 1) & ~1); + + if(context->ind_buf.bHostIb != GL_TRUE) + { + radeonAllocDmaRegion(&context->radeon, &r300->ind_buf.bo, + &context->ind_buf.bo_offset, size, 4); + + assert(context->ind_buf.bo->ptr != NULL); + out = (GLuint *)ADD_POINTERS(context->ind_buf.bo->ptr, context->ind_buf.bo_offset); + } + else + { + context->ind_buf.bo = MALLOC_STRUCT(radeon_bo); + context->ind_buf.bo->ptr = ALIGN_MALLOC(size, 4); + context->ind_buf.bo_offset = 0; + out = (GLuint *)context->ind_buf.bo->ptr; + } + + for (i = 0; i + 1 < mesa_ind_buf->count; i += 2) + { + *out++ = in[i] | in[i + 1] << 16; + } + + if (i < mesa_ind_buf->count) + { + *out++ = in[i]; + } +#endif + } + + context->ind_buf.is_32bit = GL_FALSE; + context->ind_buf.count = mesa_ind_buf->count; + + if (mapped_named_bo) + { + ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER, mesa_ind_buf->obj); + } +} + +static void r700SetupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer *mesa_ind_buf) +{ + context_t *context = R700_CONTEXT(ctx); + + if (!mesa_ind_buf) { + context->ind_buf.bo = NULL; + return; + } + + context->ind_buf.bHostIb = GL_TRUE; + +#if MESA_BIG_ENDIAN + if (mesa_ind_buf->type == GL_UNSIGNED_INT) + { +#else + if (mesa_ind_buf->type != GL_UNSIGNED_BYTE) + { +#endif + const GLvoid *src_ptr; + GLvoid *dst_ptr; + GLboolean mapped_named_bo = GL_FALSE; + + if (mesa_ind_buf->obj->Name && !mesa_ind_buf->obj->Pointer) + { + ctx->Driver.MapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER, GL_READ_ONLY_ARB, mesa_ind_buf->obj); + assert(mesa_ind_buf->obj->Pointer != NULL); + mapped_named_bo = GL_TRUE; + } + + src_ptr = ADD_POINTERS(mesa_ind_buf->obj->Pointer, mesa_ind_buf->ptr); + + const GLuint size = mesa_ind_buf->count * getTypeSize(mesa_ind_buf->type); + + if(context->ind_buf.bHostIb != GL_TRUE) + { + radeonAllocDmaRegion(&context->radeon, &context->ind_buf.bo, + &context->ind_buf.bo_offset, size, 4); + assert(context->ind_buf.bo->ptr != NULL); + dst_ptr = ADD_POINTERS(context->ind_buf.bo->ptr, context->ind_buf.bo_offset); + } + else + { + context->ind_buf.bo = MALLOC_STRUCT(radeon_bo); + context->ind_buf.bo->ptr = ALIGN_MALLOC(size, 4); + context->ind_buf.bo_offset = 0; + dst_ptr = context->ind_buf.bo->ptr; + } + + _mesa_memcpy(dst_ptr, src_ptr, size); + + context->ind_buf.is_32bit = (mesa_ind_buf->type == GL_UNSIGNED_INT); + context->ind_buf.count = mesa_ind_buf->count; + + if (mapped_named_bo) + { + ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER, mesa_ind_buf->obj); + } + } + else + { + r700FixupIndexBuffer(ctx, mesa_ind_buf); + } +} + +static GLboolean r700TryDrawPrims(GLcontext *ctx, + const struct gl_client_array *arrays[], + const struct _mesa_prim *prim, + GLuint nr_prims, + const struct _mesa_index_buffer *ib, + GLuint min_index, + GLuint max_index ) +{ + context_t *context = R700_CONTEXT(ctx); + radeonContextPtr radeon = &context->radeon; + GLuint i, id = 0; + GLboolean bValidedbuffer; + struct radeon_renderbuffer *rrb; + + if (ctx->NewState) + { + _mesa_update_state( ctx ); + } + + bValidedbuffer = r600ValidateBuffers(ctx); + + /* always emit CB base to prevent + * lock ups on some chips. + */ + R600_STATECHANGE(context, cb_target); + /* mark vtx as dirty since it changes per-draw */ + R600_STATECHANGE(context, vtx); + + _tnl_UpdateFixedFunctionProgram(ctx); + r700SetVertexFormat(ctx, arrays, max_index + 1); + r700SetupStreams2(ctx, arrays, max_index + 1); + r700UpdateShaders2(ctx); + + r700SetScissor(context); + + r700SetupVertexProgram(ctx); + + r700SetupFragmentProgram(ctx); + + r600UpdateTextureState(ctx); + + GLuint emit_end = r700PredictRenderSize(ctx) + + context->radeon.cmdbuf.cs->cdw; + + r700SetupIndexBuffer(ctx, ib); + + radeonEmitState(radeon); + + for (i = 0; i < nr_prims; ++i) + { + r700RunRenderPrimitive(ctx, + prim[i].start, + prim[i].start + prim[i].count, + prim[i].mode); + } + + /* Flush render op cached for last several quads. */ + r700WaitForIdleClean(context); + + rrb = radeon_get_colorbuffer(&context->radeon); + if (rrb && rrb->bo) + r700SyncSurf(context, rrb->bo, 0, RADEON_GEM_DOMAIN_VRAM, + CB_ACTION_ENA_bit | (1 << (id + 6))); + + rrb = radeon_get_depthbuffer(&context->radeon); + if (rrb && rrb->bo) + r700SyncSurf(context, rrb->bo, 0, RADEON_GEM_DOMAIN_VRAM, + DB_ACTION_ENA_bit | DB_DEST_BASE_ENA_bit); + + r700FreeData(ctx); + + if (emit_end < context->radeon.cmdbuf.cs->cdw) + { + WARN_ONCE("Rendering was %d commands larger than predicted size." + " We might overflow command buffer.\n", context->radeon.cmdbuf.cs->cdw - emit_end); + } + + return GL_TRUE; +} + +static void r700DrawPrimsRe(GLcontext *ctx, + const struct gl_client_array *arrays[], + const struct _mesa_prim *prim, + GLuint nr_prims, + const struct _mesa_index_buffer *ib, + GLboolean index_bounds_valid, + GLuint min_index, + GLuint max_index) +{ + GLboolean retval = GL_FALSE; + + /* This check should get folded into just the places that + * min/max index are really needed. + */ + if (!index_bounds_valid) { + vbo_get_minmax_index(ctx, prim, ib, &min_index, &max_index); + } + + if (min_index) { + vbo_rebase_prims( ctx, arrays, prim, nr_prims, ib, min_index, max_index, r700DrawPrimsRe ); + return; + } + + /* Make an attempt at drawing */ + retval = r700TryDrawPrims(ctx, arrays, prim, nr_prims, ib, min_index, max_index); + + /* If failed run tnl pipeline - it should take care of fallbacks */ + if (!retval) + _tnl_draw_prims(ctx, arrays, prim, nr_prims, ib, min_index, max_index); +} + +static void r700DrawPrims(GLcontext *ctx, + const struct gl_client_array *arrays[], + const struct _mesa_prim *prim, + GLuint nr_prims, + const struct _mesa_index_buffer *ib, + GLboolean index_bounds_valid, + GLuint min_index, + GLuint max_index) +{ + context_t *context = R700_CONTEXT(ctx); + + /* For non indexed drawing, using tnl pipe. */ + if(!ib) + { + context->ind_buf.bo = NULL; + + _tnl_vbo_draw_prims(ctx, arrays, prim, nr_prims, ib, + index_bounds_valid, min_index, max_index); + return; + } + + r700DrawPrimsRe(ctx, arrays, prim, nr_prims, ib, index_bounds_valid, min_index, max_index); +} + +void r700InitDraw(GLcontext *ctx) +{ + struct vbo_context *vbo = vbo_context(ctx); + + vbo->draw_prims = r700DrawPrims; +} + diff --git a/src/mesa/drivers/dri/r600/r700_shader.c b/src/mesa/drivers/dri/r600/r700_shader.c index b4fd51c137..955ea4e4e1 100644 --- a/src/mesa/drivers/dri/r600/r700_shader.c +++ b/src/mesa/drivers/dri/r600/r700_shader.c @@ -60,6 +60,55 @@ void AddInstToList(TypedShaderList * plstCFInstructions, R700ShaderInstruction * plstCFInstructions->uNumOfNode++; } +void TakeInstOutFromList(TypedShaderList * plstCFInstructions, R700ShaderInstruction * pInst) +{ + GLuint ulIndex = 0; + GLboolean bFound = GL_FALSE; + R700ShaderInstruction * pPrevInst = NULL; + R700ShaderInstruction * pCurInst = plstCFInstructions->pHead; + + /* Need go thro list to make sure pInst is there. */ + while(NULL != pCurInst) + { + if(pCurInst == pInst) + { + bFound = GL_TRUE; + break; + } + + pPrevInst = pCurInst; + pCurInst = pCurInst->pNextInst; + } + if(GL_TRUE == bFound) + { + plstCFInstructions->uNumOfNode--; + + pCurInst = pInst->pNextInst; + ulIndex = pInst->m_uIndex; + while(NULL != pCurInst) + { + pCurInst->m_uIndex = ulIndex; + ulIndex++; + pCurInst = pCurInst->pNextInst; + } + + if(plstCFInstructions->pHead == pInst) + { + plstCFInstructions->pHead = pInst->pNextInst; + } + if(plstCFInstructions->pTail == pInst) + { + plstCFInstructions->pTail = pPrevInst; + } + if(NULL != pPrevInst) + { + pPrevInst->pNextInst = pInst->pNextInst; + } + + FREE(pInst); + } +} + void Init_R700_Shader(R700_Shader * pShader) { pShader->Type = R700_SHADER_INVALID; @@ -488,6 +537,47 @@ void DebugPrint(void) { } +void cleanup_vfetch_shaderinst(R700_Shader *pShader) +{ + R700ShaderInstruction *pInst; + R700ShaderInstruction *pInstToFree; + R700VertexInstruction *pVTXInst; + R700ControlFlowInstruction *pCFInst; + + pInst = pShader->lstVTXInstructions.pHead; + while(NULL != pInst) + { + pVTXInst = (R700VertexInstruction *)pInst; + pShader->uShaderBinaryDWORDSize -= GetInstructionSize(pVTXInst->m_ShaderInstType); + + if(NULL != pVTXInst->m_pLinkedGenericClause) + { + pCFInst = (R700ControlFlowInstruction*)(pVTXInst->m_pLinkedGenericClause); + + TakeInstOutFromList(&(pShader->lstCFInstructions), + (R700ShaderInstruction*)pCFInst); + + pShader->uShaderBinaryDWORDSize -= GetInstructionSize(pCFInst->m_ShaderInstType); + } + + pInst = pInst->pNextInst; + }; + + //destroy each item in pShader->lstVTXInstructions; + pInst = pShader->lstVTXInstructions.pHead; + while(NULL != pInst) + { + pInstToFree = pInst; + pInst = pInst->pNextInst; + FREE(pInstToFree); + }; + + //set NULL pShader->lstVTXInstructions + pShader->lstVTXInstructions.pHead=NULL; + pShader->lstVTXInstructions.pTail=NULL; + pShader->lstVTXInstructions.uNumOfNode=0; +} + void Clean_Up_Shader(R700_Shader *pShader) { FREE(pShader->pProgram); diff --git a/src/mesa/drivers/dri/r600/r700_shader.h b/src/mesa/drivers/dri/r600/r700_shader.h index bfd01e1a93..997cb05aaf 100644 --- a/src/mesa/drivers/dri/r600/r700_shader.h +++ b/src/mesa/drivers/dri/r600/r700_shader.h @@ -143,6 +143,7 @@ void LoadProgram(R700_Shader *pShader); void UpdateShaderRegisters(R700_Shader *pShader); void DeleteInstructions(R700_Shader *pShader); void DebugPrint(void); +void cleanup_vfetch_shaderinst(R700_Shader *pShader); void Clean_Up_Shader(R700_Shader *pShader); diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index fc0b511684..1043eabb14 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -92,7 +92,25 @@ void r700UpdateShaders (GLcontext * ctx) //---------------------------------- } } - r700SelectVertexShader(ctx); + r700SelectVertexShader(ctx, 1); + r700UpdateStateParameters(ctx, _NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS); + context->radeon.NewGLState = 0; +} + +void r700UpdateShaders2(GLcontext * ctx) +{ + context_t *context = R700_CONTEXT(ctx); + + /* should only happenen once, just after context is created */ + /* TODO: shouldn't we fallback to sw here? */ + if (!ctx->FragmentProgram._Current) { + _mesa_fprintf(stderr, "No ctx->FragmentProgram._Current!!\n"); + return; + } + + r700SelectFragmentShader(ctx); + + r700SelectVertexShader(ctx, 2); r700UpdateStateParameters(ctx, _NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS); context->radeon.NewGLState = 0; } diff --git a/src/mesa/drivers/dri/r600/r700_state.h b/src/mesa/drivers/dri/r600/r700_state.h index 0f53d5b4c5..209189d8d7 100644 --- a/src/mesa/drivers/dri/r600/r700_state.h +++ b/src/mesa/drivers/dri/r600/r700_state.h @@ -35,6 +35,7 @@ extern void r700UpdateStateParameters(GLcontext * ctx, GLuint new_state); extern void r700UpdateShaders (GLcontext * ctx); +extern void r700UpdateShaders2(GLcontext * ctx); extern void r700UpdateViewportOffset(GLcontext * ctx); diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.c b/src/mesa/drivers/dri/r600/r700_vertprog.c index 9ee26286d9..e7a209be9d 100644 --- a/src/mesa/drivers/dri/r600/r700_vertprog.c +++ b/src/mesa/drivers/dri/r600/r700_vertprog.c @@ -159,7 +159,35 @@ GLboolean Process_Vertex_Program_Vfetch_Instructions( return GL_TRUE; } -void Map_Vertex_Program(struct r700_vertex_program *vp, +GLboolean Process_Vertex_Program_Vfetch_Instructions2( + GLcontext *ctx, + struct r700_vertex_program *vp, + struct gl_vertex_program *mesa_vp) +{ + int i; + context_t *context = R700_CONTEXT(ctx); + + VTX_FETCH_METHOD vtxFetchMethod; + vtxFetchMethod.bEnableMini = GL_FALSE; + vtxFetchMethod.mega_fetch_remainder = 0; + + for(i=0; inNumActiveAos; i++) + { + assemble_vfetch_instruction2(&vp->r700AsmCode, + vp->r700AsmCode.ucVP_AttributeMap[context->stream_desc[i].element], + context->stream_desc[i].type, + context->stream_desc[i].size, + context->stream_desc[i].element, + context->stream_desc[i]._signed, + context->stream_desc[i].normalize, + &vtxFetchMethod); + } + + return GL_TRUE; +} + +void Map_Vertex_Program(GLcontext *ctx, + struct r700_vertex_program *vp, struct gl_vertex_program *mesa_vp) { GLuint ui; @@ -175,11 +203,22 @@ void Map_Vertex_Program(struct r700_vertex_program *vp, pAsm->number_used_registers += num_inputs; // Create VFETCH instructions for inputs - if (GL_TRUE != Process_Vertex_Program_Vfetch_Instructions(vp, mesa_vp) ) - { - radeon_error("Calling Process_Vertex_Program_Vfetch_Instructions return error. \n"); - return; //error - } + if(1 == vp->uiVersion) + { + if (GL_TRUE != Process_Vertex_Program_Vfetch_Instructions(vp, mesa_vp) ) + { + radeon_error("Calling Process_Vertex_Program_Vfetch_Instructions return error. \n"); + return; + } + } + else + { + if (GL_TRUE != Process_Vertex_Program_Vfetch_Instructions2(ctx, vp, mesa_vp) ) + { + radeon_error("Calling Process_Vertex_Program_Vfetch_Instructions2 return error. \n"); + return; + } + } // Map Outputs pAsm->number_of_exports = Map_Vertex_Output(pAsm, mesa_vp, pAsm->number_used_registers); @@ -261,7 +300,8 @@ GLboolean Find_Instruction_Dependencies_vp(struct r700_vertex_program *vp, } struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, - struct gl_vertex_program *mesa_vp) + struct gl_vertex_program *mesa_vp, + GLint nVer) { context_t *context = R700_CONTEXT(ctx); struct r700_vertex_program *vp; @@ -271,6 +311,7 @@ struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, unsigned int i; vp = _mesa_calloc(sizeof(*vp)); + vp->uiVersion = nVer; vp->mesa_program = (struct gl_vertex_program *)_mesa_clone_program(ctx, &mesa_vp->Base); if (mesa_vp->IsPositionInvariant) @@ -296,7 +337,7 @@ struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, //Init_Program Init_r700_AssemblerBase(SPT_VP, &(vp->r700AsmCode), &(vp->r700Shader) ); - Map_Vertex_Program( vp, vp->mesa_program ); + Map_Vertex_Program(ctx, vp, vp->mesa_program ); if(GL_FALSE == Find_Instruction_Dependencies_vp(vp, vp->mesa_program)) { @@ -325,7 +366,7 @@ struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, return vp; } -void r700SelectVertexShader(GLcontext *ctx) +void r700SelectVertexShader(GLcontext *ctx, GLint nVersion) { context_t *context = R700_CONTEXT(ctx); struct r700_vertex_program_cont *vpc; @@ -365,7 +406,7 @@ void r700SelectVertexShader(GLcontext *ctx) } } - vp = r700TranslateVertexShader(ctx, &(vpc->mesa_program) ); + vp = r700TranslateVertexShader(ctx, &(vpc->mesa_program), nVersion); if(!vp) { radeon_error("Failed to translate vertex shader. \n"); @@ -377,6 +418,140 @@ void r700SelectVertexShader(GLcontext *ctx) return; } +int getTypeSize(GLenum type) +{ + switch (type) + { + case GL_DOUBLE: + return sizeof(GLdouble); + case GL_FLOAT: + return sizeof(GLfloat); + case GL_INT: + return sizeof(GLint); + case GL_UNSIGNED_INT: + return sizeof(GLuint); + case GL_SHORT: + return sizeof(GLshort); + case GL_UNSIGNED_SHORT: + return sizeof(GLushort); + case GL_BYTE: + return sizeof(GLbyte); + case GL_UNSIGNED_BYTE: + return sizeof(GLubyte); + default: + assert(0); + return 0; + } +} + +static void r700TranslateAttrib(GLcontext *ctx, GLuint unLoc, int count, const struct gl_client_array *input) +{ + context_t *context = R700_CONTEXT(ctx); + + StreamDesc * pStreamDesc = &(context->stream_desc[context->nNumActiveAos]); + + GLuint stride; + + stride = (input->StrideB == 0) ? getTypeSize(input->Type) * input->Size + : input->StrideB; + + if (input->Type == GL_DOUBLE || input->Type == GL_UNSIGNED_INT || input->Type == GL_INT || +#if MESA_BIG_ENDIAN + getTypeSize(input->Type) != 4 || +#endif + stride < 4) + { + pStreamDesc->type = GL_FLOAT; + + if (input->StrideB == 0) + { + pStreamDesc->stride = 0; + } + else + { + pStreamDesc->stride = sizeof(GLfloat) * input->Size; + } + pStreamDesc->dwords = input->Size; + pStreamDesc->is_named_bo = GL_FALSE; + } + else + { + pStreamDesc->type = input->Type; + pStreamDesc->dwords = (getTypeSize(input->Type) * input->Size + 3)/ 4; + if (!input->BufferObj->Name) + { + if (input->StrideB == 0) + { + pStreamDesc->stride = 0; + } + else + { + pStreamDesc->stride = (getTypeSize(pStreamDesc->type) * input->Size + 3) & ~3; + } + + pStreamDesc->is_named_bo = GL_FALSE; + } + } + + pStreamDesc->size = input->Size; + pStreamDesc->dst_loc = context->nNumActiveAos; + pStreamDesc->element = unLoc; + + switch (pStreamDesc->type) + { //GetSurfaceFormat + case GL_FLOAT: + pStreamDesc->_signed = 0; + pStreamDesc->normalize = GL_FALSE; + break; + case GL_SHORT: + pStreamDesc->_signed = 1; + pStreamDesc->normalize = input->Normalized; + break; + case GL_BYTE: + pStreamDesc->_signed = 1; + pStreamDesc->normalize = input->Normalized; + break; + case GL_UNSIGNED_SHORT: + pStreamDesc->_signed = 0; + pStreamDesc->normalize = input->Normalized; + break; + case GL_UNSIGNED_BYTE: + pStreamDesc->_signed = 0; + pStreamDesc->normalize = input->Normalized; + break; + default: + case GL_INT: + case GL_UNSIGNED_INT: + case GL_DOUBLE: + assert(0); + break; + } + context->nNumActiveAos++; +} + +void r700SetVertexFormat(GLcontext *ctx, const struct gl_client_array *arrays[], int count) +{ + context_t *context = R700_CONTEXT(ctx); + struct r700_vertex_program *vpc + = (struct r700_vertex_program *)ctx->VertexProgram._Current; + + struct gl_vertex_program * mesa_vp = (struct gl_vertex_program *)&(vpc->mesa_program); + unsigned int unLoc = 0; + unsigned int unBit = mesa_vp->Base.InputsRead; + context->nNumActiveAos = 0; + + while(unBit) + { + if(unBit & 1) + { + r700TranslateAttrib(ctx, unLoc, count, arrays[unLoc]); + } + + unBit >>= 1; + ++unLoc; + } +} + void * r700GetActiveVpShaderBo(GLcontext * ctx) { context_t *context = R700_CONTEXT(ctx); diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.h b/src/mesa/drivers/dri/r600/r700_vertprog.h index c48764c43b..f9a3e395ee 100644 --- a/src/mesa/drivers/dri/r600/r700_vertprog.h +++ b/src/mesa/drivers/dri/r600/r700_vertprog.h @@ -52,7 +52,7 @@ struct r700_vertex_program GLboolean translated; GLboolean loaded; - GLboolean needUpdateVF; + GLint uiVersion; void * shaderbo; @@ -76,19 +76,28 @@ unsigned int Map_Vertex_Input(r700_AssemblerBase *pAsm, GLboolean Process_Vertex_Program_Vfetch_Instructions( struct r700_vertex_program *vp, struct gl_vertex_program *mesa_vp); -void Map_Vertex_Program(struct r700_vertex_program *vp, +GLboolean Process_Vertex_Program_Vfetch_Instructions2( + GLcontext *ctx, + struct r700_vertex_program *vp, + struct gl_vertex_program *mesa_vp); +void Map_Vertex_Program(GLcontext *ctx, + struct r700_vertex_program *vp, struct gl_vertex_program *mesa_vp); GLboolean Find_Instruction_Dependencies_vp(struct r700_vertex_program *vp, struct gl_vertex_program *mesa_vp); struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, - struct gl_vertex_program *mesa_vp); + struct gl_vertex_program *mesa_vp, + GLint nVer); /* Interface */ -extern void r700SelectVertexShader(GLcontext *ctx); +extern void r700SelectVertexShader(GLcontext *ctx, GLint nVersion); +extern void r700SetVertexFormat(GLcontext *ctx, const struct gl_client_array *arrays[], int count); extern GLboolean r700SetupVertexProgram(GLcontext * ctx); extern void * r700GetActiveVpShaderBo(GLcontext * ctx); +extern int getTypeSize(GLenum type); + #endif /* _R700_VERTPROG_H_ */ diff --git a/src/mesa/drivers/dri/r600/radeon_buffer_objects.c b/src/mesa/drivers/dri/r600/radeon_buffer_objects.c new file mode 120000 index 0000000000..f6a5f66470 --- /dev/null +++ b/src/mesa/drivers/dri/r600/radeon_buffer_objects.c @@ -0,0 +1 @@ +../radeon/radeon_buffer_objects.c \ No newline at end of file diff --git a/src/mesa/drivers/dri/r600/radeon_buffer_objects.h b/src/mesa/drivers/dri/r600/radeon_buffer_objects.h new file mode 120000 index 0000000000..2f134fd17b --- /dev/null +++ b/src/mesa/drivers/dri/r600/radeon_buffer_objects.h @@ -0,0 +1 @@ +../radeon/radeon_buffer_objects.h \ No newline at end of file -- cgit v1.2.3 From 98d5ec10d0918f6619e7b2285278b83e9de6d86f Mon Sep 17 00:00:00 2001 From: Richard Li Date: Tue, 22 Sep 2009 17:26:23 -0400 Subject: r600 : add draw_prim support, make up one lost change. --- src/mesa/drivers/dri/r600/r600_context.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index 6fc6d9d7bf..969144ba12 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -59,6 +59,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "radeon_debug.h" #include "r600_context.h" #include "radeon_common_context.h" +#include "radeon_buffer_objects.h" #include "radeon_span.h" #include "r600_cmdbuf.h" #include "r600_emit.h" -- cgit v1.2.3 From 926b965ed53efc06a9d7cc6e07eff853b263960a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 22 Sep 2009 15:58:12 -0600 Subject: mesa: don't re-use the meta glDrawPixels VBO; create a new one each time This should help to work around bugs 24083 and 23670. --- src/mesa/drivers/common/meta.c | 52 ++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 30 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index ddd476eba1..2741a41bf3 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -174,7 +174,6 @@ struct copypix_state struct drawpix_state { GLuint ArrayObj; - GLuint VBO; GLuint StencilFP; /**< Fragment program for drawing stencil images */ GLuint DepthFP; /**< Fragment program for drawing depth images */ @@ -262,7 +261,6 @@ _mesa_meta_free(GLcontext *ctx) _mesa_DeleteVertexArraysAPPLE(1, &meta->CopyPix.ArrayObj); /* glDrawPixels */ - _mesa_DeleteBuffersARB(1, & meta->DrawPix.VBO); _mesa_DeleteVertexArraysAPPLE(1, &meta->DrawPix.ArrayObj); _mesa_DeletePrograms(1, &meta->DrawPix.DepthFP); _mesa_DeletePrograms(1, &meta->DrawPix.StencilFP); @@ -1430,6 +1428,7 @@ _mesa_meta_draw_pixels(GLcontext *ctx, GLenum texIntFormat; GLboolean fallback, newTex; GLbitfield metaExtraSave = 0x0; + GLuint vbo; /* * Determine if we can do the glDrawPixels with texture mapping. @@ -1509,32 +1508,6 @@ _mesa_meta_draw_pixels(GLcontext *ctx, META_VIEWPORT | metaExtraSave)); - if (drawpix->ArrayObj == 0) { - /* one-time setup */ - - /* create vertex array object */ - _mesa_GenVertexArrays(1, &drawpix->ArrayObj); - _mesa_BindVertexArray(drawpix->ArrayObj); - - /* create vertex array buffer */ - _mesa_GenBuffersARB(1, &drawpix->VBO); - _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, drawpix->VBO); - _mesa_BufferDataARB(GL_ARRAY_BUFFER_ARB, sizeof(verts), - NULL, GL_DYNAMIC_DRAW_ARB); - - /* setup vertex arrays */ - _mesa_VertexPointer(3, GL_FLOAT, sizeof(verts[0]), - (void *) (0 * sizeof(GLfloat))); - _mesa_TexCoordPointer(2, GL_FLOAT, sizeof(verts[0]), - (void *) (3 * sizeof(GLfloat))); - _mesa_EnableClientState(GL_VERTEX_ARRAY); - _mesa_EnableClientState(GL_TEXTURE_COORD_ARRAY); - } - else { - _mesa_BindVertexArray(drawpix->ArrayObj); - _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, drawpix->VBO); - } - newTex = alloc_texture(tex, width, height, texIntFormat); /* vertex positions, texcoords (after texture allocation!) */ @@ -1565,10 +1538,27 @@ _mesa_meta_draw_pixels(GLcontext *ctx, verts[3][2] = z; verts[3][3] = 0.0F; verts[3][4] = tex->Ttop; + } - /* upload new vertex data */ - _mesa_BufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, sizeof(verts), verts); + if (drawpix->ArrayObj == 0) { + /* one-time setup: create vertex array object */ + _mesa_GenVertexArrays(1, &drawpix->ArrayObj); } + _mesa_BindVertexArray(drawpix->ArrayObj); + + /* create vertex array buffer */ + _mesa_GenBuffersARB(1, &vbo); + _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, vbo); + _mesa_BufferDataARB(GL_ARRAY_BUFFER_ARB, sizeof(verts), + verts, GL_DYNAMIC_DRAW_ARB); + + /* setup vertex arrays */ + _mesa_VertexPointer(3, GL_FLOAT, sizeof(verts[0]), + (void *) (0 * sizeof(GLfloat))); + _mesa_TexCoordPointer(2, GL_FLOAT, sizeof(verts[0]), + (void *) (3 * sizeof(GLfloat))); + _mesa_EnableClientState(GL_VERTEX_ARRAY); + _mesa_EnableClientState(GL_TEXTURE_COORD_ARRAY); /* set given unpack params */ ctx->Unpack = *unpack; @@ -1639,6 +1629,8 @@ _mesa_meta_draw_pixels(GLcontext *ctx, _mesa_Disable(tex->Target); + _mesa_DeleteBuffersARB(1, &vbo); + /* restore unpack params */ ctx->Unpack = unpackSave; -- cgit v1.2.3 From be66ff51ec98cf583044b3e53a49c41edd803134 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 23 Sep 2009 14:40:45 +0100 Subject: st/mesa: trim calculated userbuffer size In get_array_bounds we were previously defining a user buffer sized as (nr_vertices * stride). The trouble is that if the vertex data occupies less than stride bytes, the extra tailing (stride - size) bytes may extend outside the memory actually allocated by the app and caused a segfault. To fix this, define a the buffer bounds to be: ptr .. ptr + (nr-1)*stride + element_size --- src/mesa/state_tracker/st_draw.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index 225541a30b..11699d5b1b 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -317,23 +317,29 @@ get_arrays_bounds(const struct st_vertex_program *vp, const GLubyte **low, const GLubyte **high) { const GLubyte *low_addr = NULL; + const GLubyte *high_addr = NULL; GLuint attr; - GLint stride; for (attr = 0; attr < vp->num_inputs; attr++) { const GLuint mesaAttr = vp->index_to_input[attr]; + const GLint stride = arrays[mesaAttr]->StrideB; const GLubyte *start = arrays[mesaAttr]->Ptr; - stride = arrays[mesaAttr]->StrideB; + const unsigned sz = (arrays[mesaAttr]->Size * + _mesa_sizeof_type(arrays[mesaAttr]->Type)); + const GLubyte *end = start + (max_index * stride) + sz; + if (attr == 0) { low_addr = start; + high_addr = end; } else { low_addr = MIN2(low_addr, start); + high_addr = MAX2(high_addr, end); } } *low = low_addr; - *high = low_addr + (max_index + 1) * stride; + *high = high_addr; } -- cgit v1.2.3 From 2d2f49c91952e18f3362346e19b45c72b1f6db32 Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Wed, 23 Sep 2009 14:20:59 +0300 Subject: r600: add support for CUBE textures, also TXP seems to work here ... --- src/mesa/drivers/dri/r600/r700_assembler.c | 306 ++++++++++++++++++++++++----- src/mesa/drivers/dri/r600/r700_assembler.h | 4 + 2 files changed, 263 insertions(+), 47 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 81269350e4..dc25f3b418 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -213,7 +213,7 @@ GLboolean is_reduction_opcode(PVSDWORD* dest) { if (dest->dst.op3 == 0) { - if ( (dest->dst.opcode == SQ_OP2_INST_DOT4 || dest->dst.opcode == SQ_OP2_INST_DOT4_IEEE) ) + if ( (dest->dst.opcode == SQ_OP2_INST_DOT4 || dest->dst.opcode == SQ_OP2_INST_DOT4_IEEE || dest->dst.opcode == SQ_OP2_INST_CUBE) ) { return GL_TRUE; } @@ -350,6 +350,7 @@ unsigned int r700GetNumOperands(r700_AssemblerBase* pAsm) case SQ_OP2_INST_PRED_SETNE: case SQ_OP2_INST_DOT4: case SQ_OP2_INST_DOT4_IEEE: + case SQ_OP2_INST_CUBE: return 2; case SQ_OP2_INST_MOV: @@ -469,6 +470,9 @@ int Init_r700_AssemblerBase(SHADER_PIPE_TYPE spt, r700_AssemblerBase* pAsm, R700 pAsm->number_of_inputs = 0; + pAsm->is_tex = GL_FALSE; + pAsm->need_tex_barrier = GL_FALSE; + return 0; } @@ -682,7 +686,7 @@ GLboolean add_tex_instruction(r700_AssemblerBase* pAsm, // If this clause constains any TEX instruction that is dependent on a previous instruction, // set the barrier bit - if( pAsm->pInstDeps[pAsm->uiCurInst].nDstDep > (-1) ) + if( pAsm->pInstDeps[pAsm->uiCurInst].nDstDep > (-1) || pAsm->need_tex_barrier == GL_TRUE ) { pAsm->cf_current_tex_clause_ptr->m_Word1.f.barrier = 0x1; } @@ -1279,42 +1283,48 @@ GLboolean tex_src(r700_AssemblerBase *pAsm) GLboolean bValidTexCoord = GL_FALSE; + if(pAsm->aArgSubst[1] >= 0) + { + bValidTexCoord = GL_TRUE; + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[0].src.reg = pAsm->aArgSubst[1]; + } + else + { switch (pILInst->SrcReg[0].File) { - case PROGRAM_CONSTANT: - case PROGRAM_LOCAL_PARAM: - case PROGRAM_ENV_PARAM: - case PROGRAM_STATE_VAR: - bValidTexCoord = GL_TRUE; - setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); - pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; - pAsm->S[0].src.reg = pAsm->aArgSubst[1]; - break; - case PROGRAM_TEMPORARY: - bValidTexCoord = GL_TRUE; - pAsm->S[0].src.reg = pILInst->SrcReg[0].Index + - pAsm->starting_temp_register_number; - pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; - break; - case PROGRAM_INPUT: - switch (pILInst->SrcReg[0].Index) - { - case FRAG_ATTRIB_COL0: - case FRAG_ATTRIB_COL1: - case FRAG_ATTRIB_TEX0: - case FRAG_ATTRIB_TEX1: - case FRAG_ATTRIB_TEX2: - case FRAG_ATTRIB_TEX3: - case FRAG_ATTRIB_TEX4: - case FRAG_ATTRIB_TEX5: - case FRAG_ATTRIB_TEX6: - case FRAG_ATTRIB_TEX7: - bValidTexCoord = GL_TRUE; - pAsm->S[0].src.reg = - pAsm->uiFP_AttributeMap[pILInst->SrcReg[0].Index]; - pAsm->S[0].src.rtype = SRC_REG_INPUT; - break; - } - break; + case PROGRAM_CONSTANT: + case PROGRAM_LOCAL_PARAM: + case PROGRAM_ENV_PARAM: + case PROGRAM_STATE_VAR: + break; + case PROGRAM_TEMPORARY: + bValidTexCoord = GL_TRUE; + pAsm->S[0].src.reg = pILInst->SrcReg[0].Index + + pAsm->starting_temp_register_number; + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + break; + case PROGRAM_INPUT: + switch (pILInst->SrcReg[0].Index) + { + case FRAG_ATTRIB_COL0: + case FRAG_ATTRIB_COL1: + case FRAG_ATTRIB_TEX0: + case FRAG_ATTRIB_TEX1: + case FRAG_ATTRIB_TEX2: + case FRAG_ATTRIB_TEX3: + case FRAG_ATTRIB_TEX4: + case FRAG_ATTRIB_TEX5: + case FRAG_ATTRIB_TEX6: + case FRAG_ATTRIB_TEX7: + bValidTexCoord = GL_TRUE; + pAsm->S[0].src.reg = + pAsm->uiFP_AttributeMap[pILInst->SrcReg[0].Index]; + pAsm->S[0].src.rtype = SRC_REG_INPUT; + break; + } + break; + } } if(GL_TRUE == bValidTexCoord) @@ -2082,7 +2092,9 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) { is_single_scalar_operation = GL_FALSE; number_of_scalar_operations = 4; - + +/* current assembler doesn't do more than 1 register per source */ +#if 0 /* check read port, only very preliminary algorithm, not count in src0/1 same comp case and prev slot repeat case; also not count relative addressing. TODO: improve performance. */ @@ -2117,6 +2129,7 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) { bSplitInst = GL_TRUE; } +#endif } contiguous_slots_needed = 0; @@ -2337,9 +2350,7 @@ GLboolean next_ins(r700_AssemblerBase *pAsm) { struct prog_instruction *pILInst = &(pAsm->pILInst[pAsm->uiCurInst]); - if( GL_TRUE == IsTex(pILInst->Opcode) && - /* handle const moves to temp register */ - !(pAsm->D.dst.opcode == SQ_OP2_INST_MOV) ) + if( GL_TRUE == pAsm->is_tex ) { if (pILInst->TexSrcTarget == TEXTURE_RECT_INDEX) { if( GL_FALSE == assemble_tex_instruction(pAsm, GL_FALSE) ) @@ -2383,7 +2394,8 @@ GLboolean next_ins(r700_AssemblerBase *pAsm) pAsm->S[0].bits = 0; pAsm->S[1].bits = 0; pAsm->S[2].bits = 0; - + pAsm->is_tex = GL_FALSE; + pAsm->need_tex_barrier = GL_FALSE; return GL_TRUE; } @@ -3506,7 +3518,10 @@ GLboolean assemble_STP(r700_AssemblerBase *pAsm) GLboolean assemble_TEX(r700_AssemblerBase *pAsm) { GLboolean src_const; + GLboolean need_barrier = GL_FALSE; + checkop1(pAsm); + switch (pAsm->pILInst[pAsm->uiCurInst].SrcReg[0].File) { case PROGRAM_CONSTANT: @@ -3526,20 +3541,18 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) { if ( GL_FALSE == mov_temp(pAsm, 0) ) return GL_FALSE; + need_barrier = GL_TRUE; } switch (pAsm->pILInst[pAsm->uiCurInst].Opcode) { case OPCODE_TEX: - pAsm->D.dst.opcode = SQ_TEX_INST_SAMPLE; break; case OPCODE_TXB: radeon_error("do not support TXB yet\n"); return GL_FALSE; break; case OPCODE_TXP: - /* TODO : tex proj version : divid first 3 components by 4th */ - pAsm->D.dst.opcode = SQ_TEX_INST_SAMPLE; break; default: radeon_error("Internal error: bad texture op (not TEX)\n"); @@ -3547,6 +3560,190 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) break; } + if (pAsm->pILInst[pAsm->uiCurInst].Opcode == OPCODE_TXP) + { + GLuint tmp = gethelpr(pAsm); + pAsm->D.dst.opcode = SQ_OP2_INST_RECIP_IEEE; + pAsm->D.dst.math = 1; + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = tmp; + pAsm->D.dst.writew = 1; + + if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + { + return GL_FALSE; + } + swizzleagain_PVSSRC(&(pAsm->S[0].src), SQ_SEL_W, SQ_SEL_W, SQ_SEL_W, SQ_SEL_W); + if( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } + + pAsm->D.dst.opcode = SQ_OP2_INST_MUL; + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = tmp; + pAsm->D.dst.writex = 1; + pAsm->D.dst.writey = 1; + pAsm->D.dst.writez = 1; + pAsm->D.dst.writew = 0; + + if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + { + return GL_FALSE; + } + setaddrmode_PVSSRC(&(pAsm->S[1].src), ADDR_ABSOLUTE); + pAsm->S[1].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[1].src.reg = tmp; + setswizzle_PVSSRC(&(pAsm->S[1].src), SQ_SEL_W); + + if( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } + + pAsm->aArgSubst[1] = tmp; + need_barrier = GL_TRUE; + } + + if (pAsm->pILInst[pAsm->uiCurInst].TexSrcTarget == TEXTURE_CUBE_INDEX ) + { + GLuint tmp1 = gethelpr(pAsm); + GLuint tmp2 = gethelpr(pAsm); + + /* tmp1.xyzw = CUBE(R0.zzxy, R0.yxzz) */ + pAsm->D.dst.opcode = SQ_OP2_INST_CUBE; + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = tmp1; + nomask_PVSDST(&(pAsm->D.dst)); + + if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + { + return GL_FALSE; + } + + if( GL_FALSE == assemble_src(pAsm, 0, 1) ) + { + return GL_FALSE; + } + + swizzleagain_PVSSRC(&(pAsm->S[0].src), SQ_SEL_Z, SQ_SEL_Z, SQ_SEL_X, SQ_SEL_Y); + swizzleagain_PVSSRC(&(pAsm->S[1].src), SQ_SEL_Y, SQ_SEL_X, SQ_SEL_Z, SQ_SEL_Z); + + if( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } + + /* tmp1.z = ABS(tmp1.z) dont have abs support in assembler currently + * have to do explicit instruction + */ + pAsm->D.dst.opcode = SQ_OP2_INST_MAX; + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = tmp1; + pAsm->D.dst.writez = 1; + + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[0].src.reg = tmp1; + noswizzle_PVSSRC(&(pAsm->S[0].src)); + pAsm->S[1].bits = pAsm->S[0].bits; + flipneg_PVSSRC(&(pAsm->S[1].src)); + + next_ins(pAsm); + + /* tmp1.z = RCP_e(|tmp1.z|) */ + pAsm->D.dst.opcode = SQ_OP2_INST_RECIP_IEEE; + pAsm->D.dst.math = 1; + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = tmp1; + pAsm->D.dst.writez = 1; + + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[0].src.reg = tmp1; + pAsm->S[0].src.swizzlex = SQ_SEL_Z; + + next_ins(pAsm); + + /* MULADD R0.x, R0.x, PS1, (0x3FC00000, 1.5f).x + * MULADD R0.y, R0.y, PS1, (0x3FC00000, 1.5f).x + * muladd has no writemask, have to use another temp + * also no support for imm constants, so add 1 here + */ + pAsm->D.dst.opcode = SQ_OP3_INST_MULADD; + pAsm->D.dst.op3 = 1; + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = tmp2; + + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[0].src.reg = tmp1; + noswizzle_PVSSRC(&(pAsm->S[0].src)); + setaddrmode_PVSSRC(&(pAsm->S[1].src), ADDR_ABSOLUTE); + pAsm->S[1].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[1].src.reg = tmp1; + setswizzle_PVSSRC(&(pAsm->S[1].src), SQ_SEL_Z); + setaddrmode_PVSSRC(&(pAsm->S[2].src), ADDR_ABSOLUTE); + pAsm->S[2].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[2].src.reg = tmp1; + setswizzle_PVSSRC(&(pAsm->S[2].src), SQ_SEL_1); + + next_ins(pAsm); + + /* ADD the remaining .5 */ + pAsm->D.dst.opcode = SQ_OP2_INST_ADD; + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = tmp2; + pAsm->D.dst.writex = 1; + pAsm->D.dst.writey = 1; + pAsm->D.dst.writez = 0; + pAsm->D.dst.writew = 0; + + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[0].src.reg = tmp2; + noswizzle_PVSSRC(&(pAsm->S[0].src)); + setaddrmode_PVSSRC(&(pAsm->S[1].src), ADDR_ABSOLUTE); + pAsm->S[1].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[1].src.reg = 252; // SQ_ALU_SRC_0_5 + noswizzle_PVSSRC(&(pAsm->S[1].src)); + + next_ins(pAsm); + + /* tmp1.xy = temp2.xy */ + pAsm->D.dst.opcode = SQ_OP2_INST_MOV; + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = tmp1; + pAsm->D.dst.writex = 1; + pAsm->D.dst.writey = 1; + pAsm->D.dst.writez = 0; + pAsm->D.dst.writew = 0; + + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[0].src.reg = tmp2; + noswizzle_PVSSRC(&(pAsm->S[0].src)); + + next_ins(pAsm); + pAsm->aArgSubst[1] = tmp1; + need_barrier = GL_TRUE; + + } + + pAsm->D.dst.opcode = SQ_TEX_INST_SAMPLE; + pAsm->is_tex = GL_TRUE; + if ( GL_TRUE == need_barrier ) + { + pAsm->need_tex_barrier = GL_TRUE; + } // Set src1 to tex unit id pAsm->S[1].src.reg = pAsm->pILInst[pAsm->uiCurInst].TexSrcUnit; pAsm->S[1].src.rtype = SRC_REG_TEMPORARY; @@ -3567,10 +3764,25 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) return GL_FALSE; } - if ( GL_FALSE == next_ins(pAsm) ) + if(pAsm->pILInst[pAsm->uiCurInst].Opcode == OPCODE_TXP) { - return GL_FALSE; + /* hopefully did swizzles before */ + noswizzle_PVSSRC(&(pAsm->S[0].src)); } + + if(pAsm->pILInst[pAsm->uiCurInst].TexSrcTarget == TEXTURE_CUBE_INDEX) + { + /* SAMPLE dst, tmp.yxwy, CUBE */ + pAsm->S[0].src.swizzlex = SQ_SEL_Y; + pAsm->S[0].src.swizzley = SQ_SEL_X; + pAsm->S[0].src.swizzlez = SQ_SEL_W; + pAsm->S[0].src.swizzlew = SQ_SEL_Y; + } + + if ( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } return GL_TRUE; } diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index 4e6e20011a..bd6df94ff9 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -374,6 +374,10 @@ typedef struct r700_AssemblerBase struct prog_instruction * pILInst; GLuint uiCurInst; GLboolean bR6xx; + /* helper to decide which type of instruction to assemble */ + GLboolean is_tex; + /* we inserted helper intructions and need barrier on next TEX ins */ + GLboolean need_tex_barrier; } r700_AssemblerBase; //Internal use -- cgit v1.2.3 From ec205bbd577a2619e4b1910527e5e5d1d7426ddb Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Wed, 23 Sep 2009 14:56:56 -0400 Subject: r600: fix some warnings --- src/mesa/drivers/dri/r600/r700_assembler.c | 6 +++--- src/mesa/drivers/dri/r600/r700_assembler.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index dc25f3b418..903b6968be 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -2078,9 +2078,9 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) GLuint contiguous_slots_needed; GLuint uNumSrc = r700GetNumOperands(pAsm); - GLuint channel_swizzle, j; - GLuint chan_counter[4] = {0, 0, 0, 0}; - PVSSRC * pSource[3]; + //GLuint channel_swizzle, j; + //GLuint chan_counter[4] = {0, 0, 0, 0}; + //PVSSRC * pSource[3]; GLboolean bSplitInst = GL_FALSE; if (1 == pAsm->D.dst.math) diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index bd6df94ff9..0d4283e4ba 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -423,6 +423,7 @@ GLboolean assemble_vfetch_instruction2(r700_AssemblerBase* pAsm, GLuint _signed, GLboolean normalize, VTX_FETCH_METHOD * pFetchMethod); +GLboolean cleanup_vfetch_instructions(r700_AssemblerBase* pAsm); GLuint gethelpr(r700_AssemblerBase* pAsm); void resethelpr(r700_AssemblerBase* pAsm); void checkop_init(r700_AssemblerBase* pAsm); -- cgit v1.2.3 From 53051b8cb5b4804e3eab21262c91ea59f1ea24b8 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Wed, 23 Sep 2009 15:02:19 -0400 Subject: r600: fix copy/paste typo --- src/mesa/drivers/dri/r600/r700_render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c index b58859b6ba..daa05f653d 100644 --- a/src/mesa/drivers/dri/r600/r700_render.c +++ b/src/mesa/drivers/dri/r600/r700_render.c @@ -855,7 +855,7 @@ static void r700FixupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer if(context->ind_buf.bHostIb != GL_TRUE) { - radeonAllocDmaRegion(&context->radeon, &r300->ind_buf.bo, + radeonAllocDmaRegion(&context->radeon, &context->ind_buf.bo, &context->ind_buf.bo_offset, size, 4); assert(context->ind_buf.bo->ptr != NULL); -- cgit v1.2.3 From 8abe77a75a681637cb00017711f5009601bcd348 Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 23 Sep 2009 15:22:19 -0400 Subject: Finish removing glcore --- src/mesa/drivers/dri/glcore/Makefile | 84 ------------------------------------ 1 file changed, 84 deletions(-) delete mode 100644 src/mesa/drivers/dri/glcore/Makefile (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/glcore/Makefile b/src/mesa/drivers/dri/glcore/Makefile deleted file mode 100644 index ac7e1de928..0000000000 --- a/src/mesa/drivers/dri/glcore/Makefile +++ /dev/null @@ -1,84 +0,0 @@ -# src/mesa/drivers/dri/glcore/Makefile - -TOP = ../../../../.. -include $(TOP)/configs/current - -LIBNAME = glcore_dri.so - -DRIVER_SOURCES = glcore_driver.c \ - $(TOP)/src/mesa/drivers/common/driverfuncs.c \ - ../common/dri_util.c - -C_SOURCES = \ - $(DRIVER_SOURCES) \ - $(DRI_SOURCES) - - -# Include directories -INCLUDE_DIRS = \ - -I. \ - -I../common \ - -I../dri_client \ - -I../dri_client/imports \ - -Iserver \ - -I$(TOP)/include \ - -I$(DRM_SOURCE_PATH)/shared-core \ - -I$(TOP)/src/mesa \ - -I$(TOP)/src/mesa/main \ - -I$(TOP)/src/mesa/glapi \ - -I$(TOP)/src/mesa/math \ - -I$(TOP)/src/mesa/transform \ - -I$(TOP)/src/mesa/shader \ - -I$(TOP)/src/mesa/swrast \ - -I$(TOP)/src/mesa/swrast_setup - -# Core Mesa objects -MESA_MODULES = $(TOP)/src/mesa/libmesa.a - -# Libraries that the driver shared lib depends on -LIB_DEPS = -lm -lpthread -lc -# LIB_DEPS = -lGL -lm -lpthread -lc - - -ASM_SOURCES = - -OBJECTS = $(C_SOURCES:.c=.o) \ - $(ASM_SOURCES:.S=.o) - - -##### RULES ##### - -.c.o: - $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@ - -.S.o: - $(CC) -c $(INCLUDE_DIRS) $(CFLAGS) $(DEFINES) $< -o $@ - - -##### TARGETS ##### - -default: depend $(TOP)/$(LIB_DIR)/$(LIBNAME) - - -$(TOP)/$(LIB_DIR)/$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(WINOBJ) Makefile - CC="$(CC)" CXX="$(CXX)" $(TOP)/bin/mklib -o $(LIBNAME) -noprefix -install $(TOP)/$(LIB_DIR) \ - $(OBJECTS) $(WINLIB) $(LIB_DEPS) $(WINOBJ) $(MESA_MODULES) - - -depend: $(C_SOURCES) $(ASM_SOURCES) - rm -f depend - touch depend - $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDE_DIRS) $(C_SOURCES) $(ASM_SOURCES) \ - > /dev/null - - -# Emacs tags -tags: - etags `find . -name \*.[ch]` `find ../include` - - -clean: - -rm -f *.o server/*.o - - -include depend -- cgit v1.2.3 From ad935c3f4708417641dd3c257912ccce11485acc Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 23 Sep 2009 12:54:14 -0600 Subject: swrast: fix typo in partial derivatives parameter passing --- src/mesa/swrast/s_fragprog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index b71fb9eae9..144f78b024 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -108,7 +108,7 @@ fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4], lambda = _swrast_compute_lambda(texdx[0], texdy[0], /* ds/dx, ds/dy */ texdx[1], texdy[1], /* dt/dx, dt/dy */ - texdx[3], texdy[2], /* dq/dx, dq/dy */ + texdx[3], texdy[3], /* dq/dx, dq/dy */ texW, texH, texcoord[0], texcoord[1], texcoord[3], 1.0F / texcoord[3]) + lodBias; -- cgit v1.2.3 From 890f37d4d96471a5c3d8ae286dfc13ad18ff78e5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 23 Sep 2009 13:34:30 -0600 Subject: mesa: don't bias LOD in shader interpreter; do it in swrast --- src/mesa/shader/prog_execute.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/prog_execute.c b/src/mesa/shader/prog_execute.c index 68a59350a1..7cb463cd07 100644 --- a/src/mesa/shader/prog_execute.c +++ b/src/mesa/shader/prog_execute.c @@ -1527,17 +1527,12 @@ _mesa_execute_program(GLcontext * ctx, case OPCODE_TXB: /* GL_ARB_fragment_program only */ /* Texel lookup with LOD bias */ { - const GLuint unit = machine->Samplers[inst->TexSrcUnit]; - const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; GLfloat texcoord[4], color[4], lodBias; fetch_vector4(&inst->SrcReg[0], machine, texcoord); /* texcoord[3] is the bias to add to lambda */ - lodBias = texUnit->LodBias + texcoord[3]; - if (texUnit->_Current) { - lodBias += texUnit->_Current->LodBias; - } + lodBias = texcoord[3]; fetch_texel(ctx, machine, inst, texcoord, lodBias, color); -- cgit v1.2.3 From 2acd5de22651a3461c0576107c8e8fab1f01469a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 23 Sep 2009 13:35:03 -0600 Subject: swrast: add lod bias when texture sampling Mostly fixes progs/demos/lodbias when MESA_TEX_PROG=1. But the LOD still seems off by -1 or so. May be an issue with the params passed to _swrast_compute_lambda() --- src/mesa/swrast/s_fragprog.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index 144f78b024..b326acf3e3 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -89,6 +89,8 @@ fetch_texel_lod( GLcontext *ctx, const GLfloat texcoord[4], GLfloat lambda, * Fetch a texel with the given partial derivatives to compute a level * of detail in the mipmap. * Called via machine->FetchTexelDeriv() + * \param lodBias the lod bias which may be specified by a TXB instruction, + * otherwise zero. */ static void fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4], @@ -96,7 +98,8 @@ fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4], GLfloat lodBias, GLuint unit, GLfloat color[4] ) { SWcontext *swrast = SWRAST_CONTEXT(ctx); - const struct gl_texture_object *texObj = ctx->Texture.Unit[unit]._Current; + const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; + const struct gl_texture_object *texObj = texUnit->_Current; if (texObj) { const struct gl_texture_image *texImg = @@ -111,7 +114,9 @@ fetch_texel_deriv( GLcontext *ctx, const GLfloat texcoord[4], texdx[3], texdy[3], /* dq/dx, dq/dy */ texW, texH, texcoord[0], texcoord[1], texcoord[3], - 1.0F / texcoord[3]) + lodBias; + 1.0F / texcoord[3]); + + lambda += lodBias + texUnit->LodBias + texObj->LodBias; lambda = CLAMP(lambda, texObj->MinLod, texObj->MaxLod); -- cgit v1.2.3 From 8a2b0f6415654c03cd399e59b0946ab90dc44331 Mon Sep 17 00:00:00 2001 From: Richard Li Date: Wed, 23 Sep 2009 16:10:20 -0400 Subject: r600 : add hw index buffer draw support. --- src/mesa/drivers/dri/r600/r700_render.c | 73 +++++++++++++++++++++++++++------ 1 file changed, 61 insertions(+), 12 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c index daa05f653d..1f7a76e538 100644 --- a/src/mesa/drivers/dri/r600/r700_render.c +++ b/src/mesa/drivers/dri/r600/r700_render.c @@ -262,6 +262,16 @@ static void r700RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim TNLcontext *tnl = TNL_CONTEXT(ctx); struct vertex_buffer *vb = &tnl->vb; + GLboolean bUseDrawIndex; + if( (NULL != context->ind_buf.bo) && (GL_TRUE != context->ind_buf.bHostIb) ) + { + bUseDrawIndex = GL_TRUE; + } + else + { + bUseDrawIndex = GL_FALSE; + } + type = r700PrimitiveType(prim); num_indices = r700NumVerts(end - start, prim); @@ -272,10 +282,20 @@ static void r700RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim if (type < 0 || num_indices <= 0) return; - total_emit = 3 /* VGT_PRIMITIVE_TYPE */ - + 2 /* VGT_INDEX_TYPE */ - + 2 /* NUM_INSTANCES */ + if(GL_TRUE == bUseDrawIndex) + { + total_emit = 3 /* VGT_PRIMITIVE_TYPE */ + + 2 /* VGT_INDEX_TYPE */ + + 2 /* NUM_INSTANCES */ + + 5+2; /* DRAW_INDEX */ + } + else + { + total_emit = 3 /* VGT_PRIMITIVE_TYPE */ + + 2 /* VGT_INDEX_TYPE */ + + 2 /* NUM_INSTANCES */ + num_indices + 3; /* DRAW_INDEX_IMMD */ + } BEGIN_BATCH_NO_AUTOSTATE(total_emit); // prim @@ -287,6 +307,15 @@ static void r700RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim // index type SETfield(vgt_index_type, DI_INDEX_SIZE_32_BIT, INDEX_TYPE_shift, INDEX_TYPE_mask); + + if(GL_TRUE == bUseDrawIndex) + { + if(GL_TRUE != context->ind_buf.is_32bit) + { + SETfield(vgt_index_type, DI_INDEX_SIZE_16_BIT, INDEX_TYPE_shift, INDEX_TYPE_mask); + } + } + R600_OUT_BATCH(CP_PACKET3(R600_IT_INDEX_TYPE, 0)); R600_OUT_BATCH(vgt_index_type); @@ -296,12 +325,36 @@ static void r700RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim // draw packet vgt_num_indices = num_indices; - SETfield(vgt_draw_initiator, DI_SRC_SEL_IMMEDIATE, SOURCE_SELECT_shift, SOURCE_SELECT_mask); + + if(GL_TRUE == bUseDrawIndex) + { + SETfield(vgt_draw_initiator, DI_SRC_SEL_DMA, SOURCE_SELECT_shift, SOURCE_SELECT_mask); + } + else + { + SETfield(vgt_draw_initiator, DI_SRC_SEL_IMMEDIATE, SOURCE_SELECT_shift, SOURCE_SELECT_mask); + } + SETfield(vgt_draw_initiator, DI_MAJOR_MODE_0, MAJOR_MODE_shift, MAJOR_MODE_mask); - R600_OUT_BATCH(CP_PACKET3(R600_IT_DRAW_INDEX_IMMD, (num_indices + 1))); - R600_OUT_BATCH(vgt_num_indices); - R600_OUT_BATCH(vgt_draw_initiator); + if(GL_TRUE == bUseDrawIndex) + { + R600_OUT_BATCH(CP_PACKET3(R600_IT_DRAW_INDEX, 3)); + R600_OUT_BATCH(context->ind_buf.bo_offset); + R600_OUT_BATCH(0); + R600_OUT_BATCH(vgt_num_indices); + R600_OUT_BATCH(vgt_draw_initiator); + R600_OUT_BATCH_RELOC(context->ind_buf.bo_offset, + context->ind_buf.bo, + context->ind_buf.bo_offset, + RADEON_GEM_DOMAIN_GTT, 0, 0); + } + else + { + R600_OUT_BATCH(CP_PACKET3(R600_IT_DRAW_INDEX_IMMD, (num_indices + 1))); + R600_OUT_BATCH(vgt_num_indices); + R600_OUT_BATCH(vgt_draw_initiator); + } if(NULL == context->ind_buf.bo) { @@ -340,10 +393,6 @@ static void r700RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim } } } - else - { - /* TODO : hw ib draw */ - } } END_BATCH(); @@ -899,7 +948,7 @@ static void r700SetupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer return; } - context->ind_buf.bHostIb = GL_TRUE; + context->ind_buf.bHostIb = GL_FALSE; #if MESA_BIG_ENDIAN if (mesa_ind_buf->type == GL_UNSIGNED_INT) -- cgit v1.2.3 From 20e77382935b24e9e2be89cd2b686fa2f1f67635 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Wed, 23 Sep 2009 16:54:12 -0400 Subject: r600: fix r700PredictRenderSize for draw prims path --- src/mesa/drivers/dri/r600/r700_render.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c index 1f7a76e538..bdf0bfc0e4 100644 --- a/src/mesa/drivers/dri/r600/r700_render.c +++ b/src/mesa/drivers/dri/r600/r700_render.c @@ -402,12 +402,10 @@ static void r700RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim /* start 3d, idle, cb/db flush */ #define PRE_EMIT_STATE_BUFSZ 10 + 5 + 14 -static GLuint r700PredictRenderSize(GLcontext* ctx) +static GLuint r700PredictRenderSize(GLcontext* ctx, GLuint nr_prims) { context_t *context = R700_CONTEXT(ctx); - TNLcontext *tnl = TNL_CONTEXT(ctx); struct r700_vertex_program *vp = context->selected_vp; - struct vertex_buffer *vb = &tnl->vb; GLboolean flushed; GLuint dwords, i; GLuint state_size; @@ -415,8 +413,15 @@ static GLuint r700PredictRenderSize(GLcontext* ctx) context->radeon.tcl.aos_count = _mesa_bitcount(vp->mesa_program->Base.InputsRead); dwords = PRE_EMIT_STATE_BUFSZ; - for (i = 0; i < vb->PrimitiveCount; i++) - dwords += vb->Primitive[i].count + 10; + if (nr_prims) + dwords += nr_prims * 14; + else { + TNLcontext *tnl = TNL_CONTEXT(ctx); + struct vertex_buffer *vb = &tnl->vb; + + for (i = 0; i < vb->PrimitiveCount; i++) + dwords += vb->Primitive[i].count + 10; + } state_size = radeonCountStateEmitSize(&context->radeon); flushed = rcommonEnsureCmdBufSpace(&context->radeon, dwords + state_size, __FUNCTION__); @@ -456,7 +461,7 @@ static GLboolean r700RunRender(GLcontext * ctx, r700SetupFragmentProgram(ctx); r600UpdateTextureState(ctx); - GLuint emit_end = r700PredictRenderSize(ctx) + GLuint emit_end = r700PredictRenderSize(ctx, 0) + context->radeon.cmdbuf.cs->cdw; r700SetupStreams(ctx); @@ -1044,7 +1049,7 @@ static GLboolean r700TryDrawPrims(GLcontext *ctx, r600UpdateTextureState(ctx); - GLuint emit_end = r700PredictRenderSize(ctx) + GLuint emit_end = r700PredictRenderSize(ctx, nr_prims) + context->radeon.cmdbuf.cs->cdw; r700SetupIndexBuffer(ctx, ib); -- cgit v1.2.3 From 84c7afd9e0f2df72d90dd82d38384c4f2f45173e Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 19 Sep 2009 18:45:59 +0200 Subject: r300: fallback to software rendering if we are out of free texcoords Fixes #22741 --- src/mesa/drivers/dri/r300/r300_fragprog_common.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_fragprog_common.c b/src/mesa/drivers/dri/r300/r300_fragprog_common.c index 469c278b51..0bdc90b4a8 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog_common.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog_common.c @@ -99,8 +99,8 @@ static void insert_WPOS_trailer(struct r300_fragment_program_compiler *compiler, { int i; + fp->wpos_attr = FRAG_ATTRIB_MAX; if (!(compiler->Base.Program.InputsRead & FRAG_BIT_WPOS)) { - fp->wpos_attr = FRAG_ATTRIB_MAX; return; } @@ -112,6 +112,13 @@ static void insert_WPOS_trailer(struct r300_fragment_program_compiler *compiler, } } + /* No free texcoord found, fall-back to software rendering */ + if (fp->wpos_attr == FRAG_ATTRIB_MAX) + { + compiler->Base.Error = 1; + return; + } + rc_transform_fragment_wpos(&compiler->Base, FRAG_ATTRIB_WPOS, fp->wpos_attr); } @@ -127,8 +134,8 @@ static void rewriteFog(struct r300_fragment_program_compiler *compiler, struct r struct prog_src_register src; int i; + fp->fog_attr = FRAG_ATTRIB_MAX; if (!(compiler->Base.Program.InputsRead & FRAG_BIT_FOGC)) { - fp->fog_attr = FRAG_ATTRIB_MAX; return; } @@ -140,6 +147,13 @@ static void rewriteFog(struct r300_fragment_program_compiler *compiler, struct r } } + /* No free texcoord found, fall-back to software rendering */ + if (fp->fog_attr == FRAG_ATTRIB_MAX) + { + compiler->Base.Error = 1; + return; + } + memset(&src, 0, sizeof(src)); src.File = PROGRAM_INPUT; src.Index = fp->fog_attr; -- cgit v1.2.3 From 1bf0651d9b58a5c150fcf37016ae1bda425bb05a Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Wed, 23 Sep 2009 19:42:07 -0400 Subject: r600: fix up ordering of functions in draw prims path Shaders and IB need to be updated and allocated before calling validatebuffers. --- src/mesa/drivers/dri/r600/r700_render.c | 31 +++++++++++++++---------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c index bdf0bfc0e4..bbe364bc6a 100644 --- a/src/mesa/drivers/dri/r600/r700_render.c +++ b/src/mesa/drivers/dri/r600/r700_render.c @@ -1019,7 +1019,6 @@ static GLboolean r700TryDrawPrims(GLcontext *ctx, context_t *context = R700_CONTEXT(ctx); radeonContextPtr radeon = &context->radeon; GLuint i, id = 0; - GLboolean bValidedbuffer; struct radeon_renderbuffer *rrb; if (ctx->NewState) @@ -1027,7 +1026,13 @@ static GLboolean r700TryDrawPrims(GLcontext *ctx, _mesa_update_state( ctx ); } - bValidedbuffer = r600ValidateBuffers(ctx); + _tnl_UpdateFixedFunctionProgram(ctx); + r700SetVertexFormat(ctx, arrays, max_index + 1); + r700SetupIndexBuffer(ctx, ib); + /* shaders need to be updated before buffers are validated */ + r700UpdateShaders2(ctx); + if (!r600ValidateBuffers(ctx)) + return GL_FALSE; /* always emit CB base to prevent * lock ups on some chips. @@ -1036,34 +1041,28 @@ static GLboolean r700TryDrawPrims(GLcontext *ctx, /* mark vtx as dirty since it changes per-draw */ R600_STATECHANGE(context, vtx); - _tnl_UpdateFixedFunctionProgram(ctx); - r700SetVertexFormat(ctx, arrays, max_index + 1); - r700SetupStreams2(ctx, arrays, max_index + 1); - r700UpdateShaders2(ctx); - r700SetScissor(context); - r700SetupVertexProgram(ctx); - r700SetupFragmentProgram(ctx); - r600UpdateTextureState(ctx); GLuint emit_end = r700PredictRenderSize(ctx, nr_prims) + context->radeon.cmdbuf.cs->cdw; - r700SetupIndexBuffer(ctx, ib); + r700SetupStreams2(ctx, arrays, max_index + 1); radeonEmitState(radeon); - for (i = 0; i < nr_prims; ++i) + radeon_debug_add_indent(); + for (i = 0; i < nr_prims; ++i) { - r700RunRenderPrimitive(ctx, - prim[i].start, - prim[i].start + prim[i].count, + r700RunRenderPrimitive(ctx, + prim[i].start, + prim[i].start + prim[i].count, prim[i].mode); } - + radeon_debug_remove_indent(); + /* Flush render op cached for last several quads. */ r700WaitForIdleClean(context); -- cgit v1.2.3 From 622bdecabd73167d2f2f3aff0e223a8c64433f99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Fonseca?= Date: Thu, 24 Sep 2009 12:36:11 +0100 Subject: mesa: Fix missing finite symbol error on Windows. Caused by some weird logic regarding the __WIN32__ define which made the finite definition dependent on the header include order. --- src/mesa/main/compiler.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h index 9319505a75..380663ec97 100644 --- a/src/mesa/main/compiler.h +++ b/src/mesa/main/compiler.h @@ -107,8 +107,7 @@ extern "C" { /** * finite macro. */ -#if defined(_WIN32) && !defined(__WIN32__) && !defined(__CYGWIN__) && !defined(BUILD_FOR_SNAP) -# define __WIN32__ +#if defined(_MSC_VER) # define finite _finite #elif defined(__WATCOMC__) # define finite _finite -- cgit v1.2.3 From cbab3d7f2a77f187fb688593c17396d4967c75b5 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Tue, 8 Sep 2009 16:03:25 -0400 Subject: r600: fix dri2 clipping --- src/mesa/drivers/dri/r600/r700_state.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index 1f4724e838..2a0b419256 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -1272,8 +1272,8 @@ void r700SetScissor(context_t *context) //--------------- if (context->radeon.radeonScreen->driScreen->dri2.enabled) { x1 = 0; y1 = 0; - x2 = rrb->base.Width - 1; - y2 = rrb->base.Height - 1; + x2 = rrb->base.Width; + y2 = rrb->base.Height; } else { x1 = rrb->dPriv->x; y1 = rrb->dPriv->y; -- cgit v1.2.3 From b1e417413f2da8aad1872fa009949da101156431 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 9 Sep 2009 15:02:16 +1000 Subject: r600: don't setup hardware state if TFP if we have a BO here it means TFP and we should have set it up already. tested by b0le on #radeon --- src/mesa/drivers/dri/r600/r600_texstate.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r600_texstate.c b/src/mesa/drivers/dri/r600/r600_texstate.c index 49b603b65e..6436a5d7e9 100644 --- a/src/mesa/drivers/dri/r600/r600_texstate.c +++ b/src/mesa/drivers/dri/r600/r600_texstate.c @@ -565,6 +565,10 @@ static void setup_hardware_state(context_t *rmesa, struct gl_texture_object *tex int firstlevel = t->mt ? t->mt->firstLevel : 0; GLuint uTexelPitch, row_align; + if ( t->bo ) { + return GL_TRUE; + } + firstImage = t->base.Image[0][firstlevel]; if (!t->image_override) { -- cgit v1.2.3 From 65b01d449cc594e1c7e1a44c5d87fdc698300e9a Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Wed, 9 Sep 2009 01:41:46 -0400 Subject: r600: fix ftp for dri1 We use t->bo for dri1 since r600 uses CS for dri1. --- src/mesa/drivers/dri/r600/r600_texstate.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r600_texstate.c b/src/mesa/drivers/dri/r600/r600_texstate.c index 6436a5d7e9..f30dd11230 100644 --- a/src/mesa/drivers/dri/r600/r600_texstate.c +++ b/src/mesa/drivers/dri/r600/r600_texstate.c @@ -565,9 +565,10 @@ static void setup_hardware_state(context_t *rmesa, struct gl_texture_object *tex int firstlevel = t->mt ? t->mt->firstLevel : 0; GLuint uTexelPitch, row_align; - if ( t->bo ) { - return GL_TRUE; - } + if (rmesa->radeon.radeonScreen->driScreen->dri2.enabled && + t->image_override && + t->bo) + return; firstImage = t->base.Image[0][firstlevel]; -- cgit v1.2.3 From 6552a103f903a2b767464cd2d267f706a6baf7d5 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Wed, 9 Sep 2009 11:14:17 -0400 Subject: r600: check if textures are actually enabled before submission noticed by taiu on IRC. --- src/mesa/drivers/dri/r600/r600_texstate.c | 2 +- src/mesa/drivers/dri/r600/r700_chip.c | 118 ++++++++++++++++-------------- 2 files changed, 64 insertions(+), 56 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r600_texstate.c b/src/mesa/drivers/dri/r600/r600_texstate.c index f30dd11230..bcb8d7c73d 100644 --- a/src/mesa/drivers/dri/r600/r600_texstate.c +++ b/src/mesa/drivers/dri/r600/r600_texstate.c @@ -69,7 +69,7 @@ void r600UpdateTextureState(GLcontext * ctx) for (unit = 0; unit < R700_MAX_TEXTURE_UNITS; unit++) { texUnit = &ctx->Texture.Unit[unit]; t = radeon_tex_obj(ctx->Texture.Unit[unit]._Current); - + r700->textures[unit] = NULL; if (texUnit->_ReallyEnabled) { if (!t) continue; diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index 37bff56f5a..312cacffda 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -52,38 +52,40 @@ static void r700SendTexState(GLcontext *ctx, struct radeon_state_atom *atom) radeon_print(RADEON_STATE, RADEON_VERBOSE, "%s\n", __func__); for (i = 0; i < R700_TEXTURE_NUMBERUNITS; i++) { - radeonTexObj *t = r700->textures[i]; - if (t) { - if (!t->image_override) - bo = t->mt->bo; - else - bo = t->bo; - if (bo) { - - r700SyncSurf(context, bo, - RADEON_GEM_DOMAIN_GTT|RADEON_GEM_DOMAIN_VRAM, - 0, TC_ACTION_ENA_bit); - - BEGIN_BATCH_NO_AUTOSTATE(9 + 4); - R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_RESOURCE, 7)); - R600_OUT_BATCH(i * 7); - R600_OUT_BATCH(r700->textures[i]->SQ_TEX_RESOURCE0); - R600_OUT_BATCH(r700->textures[i]->SQ_TEX_RESOURCE1); - R600_OUT_BATCH(r700->textures[i]->SQ_TEX_RESOURCE2); - R600_OUT_BATCH(r700->textures[i]->SQ_TEX_RESOURCE3); - R600_OUT_BATCH(r700->textures[i]->SQ_TEX_RESOURCE4); - R600_OUT_BATCH(r700->textures[i]->SQ_TEX_RESOURCE5); - R600_OUT_BATCH(r700->textures[i]->SQ_TEX_RESOURCE6); - R600_OUT_BATCH_RELOC(r700->textures[i]->SQ_TEX_RESOURCE2, - bo, - 0, - RADEON_GEM_DOMAIN_GTT|RADEON_GEM_DOMAIN_VRAM, 0, 0); - R600_OUT_BATCH_RELOC(r700->textures[i]->SQ_TEX_RESOURCE3, - bo, - r700->textures[i]->SQ_TEX_RESOURCE3, - RADEON_GEM_DOMAIN_GTT|RADEON_GEM_DOMAIN_VRAM, 0, 0); - END_BATCH(); - COMMIT_BATCH(); + if (ctx->Texture.Unit[i]._ReallyEnabled) { + radeonTexObj *t = r700->textures[i]; + if (t) { + if (!t->image_override) + bo = t->mt->bo; + else + bo = t->bo; + if (bo) { + + r700SyncSurf(context, bo, + RADEON_GEM_DOMAIN_GTT|RADEON_GEM_DOMAIN_VRAM, + 0, TC_ACTION_ENA_bit); + + BEGIN_BATCH_NO_AUTOSTATE(9 + 4); + R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_RESOURCE, 7)); + R600_OUT_BATCH(i * 7); + R600_OUT_BATCH(r700->textures[i]->SQ_TEX_RESOURCE0); + R600_OUT_BATCH(r700->textures[i]->SQ_TEX_RESOURCE1); + R600_OUT_BATCH(r700->textures[i]->SQ_TEX_RESOURCE2); + R600_OUT_BATCH(r700->textures[i]->SQ_TEX_RESOURCE3); + R600_OUT_BATCH(r700->textures[i]->SQ_TEX_RESOURCE4); + R600_OUT_BATCH(r700->textures[i]->SQ_TEX_RESOURCE5); + R600_OUT_BATCH(r700->textures[i]->SQ_TEX_RESOURCE6); + R600_OUT_BATCH_RELOC(r700->textures[i]->SQ_TEX_RESOURCE2, + bo, + 0, + RADEON_GEM_DOMAIN_GTT|RADEON_GEM_DOMAIN_VRAM, 0, 0); + R600_OUT_BATCH_RELOC(r700->textures[i]->SQ_TEX_RESOURCE3, + bo, + r700->textures[i]->SQ_TEX_RESOURCE3, + RADEON_GEM_DOMAIN_GTT|RADEON_GEM_DOMAIN_VRAM, 0, 0); + END_BATCH(); + COMMIT_BATCH(); + } } } } @@ -98,16 +100,18 @@ static void r700SendTexSamplerState(GLcontext *ctx, struct radeon_state_atom *at radeon_print(RADEON_STATE, RADEON_VERBOSE, "%s\n", __func__); for (i = 0; i < R700_TEXTURE_NUMBERUNITS; i++) { - radeonTexObj *t = r700->textures[i]; - if (t) { - BEGIN_BATCH_NO_AUTOSTATE(5); - R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_SAMPLER, 3)); - R600_OUT_BATCH(i * 3); - R600_OUT_BATCH(r700->textures[i]->SQ_TEX_SAMPLER0); - R600_OUT_BATCH(r700->textures[i]->SQ_TEX_SAMPLER1); - R600_OUT_BATCH(r700->textures[i]->SQ_TEX_SAMPLER2); - END_BATCH(); - COMMIT_BATCH(); + if (ctx->Texture.Unit[i]._ReallyEnabled) { + radeonTexObj *t = r700->textures[i]; + if (t) { + BEGIN_BATCH_NO_AUTOSTATE(5); + R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_SAMPLER, 3)); + R600_OUT_BATCH(i * 3); + R600_OUT_BATCH(r700->textures[i]->SQ_TEX_SAMPLER0); + R600_OUT_BATCH(r700->textures[i]->SQ_TEX_SAMPLER1); + R600_OUT_BATCH(r700->textures[i]->SQ_TEX_SAMPLER2); + END_BATCH(); + COMMIT_BATCH(); + } } } } @@ -121,16 +125,18 @@ static void r700SendTexBorderColorState(GLcontext *ctx, struct radeon_state_atom radeon_print(RADEON_STATE, RADEON_VERBOSE, "%s\n", __func__); for (i = 0; i < R700_TEXTURE_NUMBERUNITS; i++) { - radeonTexObj *t = r700->textures[i]; - if (t) { - BEGIN_BATCH_NO_AUTOSTATE(2 + 4); - R600_OUT_BATCH_REGSEQ((TD_PS_SAMPLER0_BORDER_RED + (i * 16)), 4); - R600_OUT_BATCH(r700->textures[i]->TD_PS_SAMPLER0_BORDER_RED); - R600_OUT_BATCH(r700->textures[i]->TD_PS_SAMPLER0_BORDER_GREEN); - R600_OUT_BATCH(r700->textures[i]->TD_PS_SAMPLER0_BORDER_BLUE); - R600_OUT_BATCH(r700->textures[i]->TD_PS_SAMPLER0_BORDER_ALPHA); - END_BATCH(); - COMMIT_BATCH(); + if (ctx->Texture.Unit[i]._ReallyEnabled) { + radeonTexObj *t = r700->textures[i]; + if (t) { + BEGIN_BATCH_NO_AUTOSTATE(2 + 4); + R600_OUT_BATCH_REGSEQ((TD_PS_SAMPLER0_BORDER_RED + (i * 16)), 4); + R600_OUT_BATCH(r700->textures[i]->TD_PS_SAMPLER0_BORDER_RED); + R600_OUT_BATCH(r700->textures[i]->TD_PS_SAMPLER0_BORDER_GREEN); + R600_OUT_BATCH(r700->textures[i]->TD_PS_SAMPLER0_BORDER_BLUE); + R600_OUT_BATCH(r700->textures[i]->TD_PS_SAMPLER0_BORDER_ALPHA); + END_BATCH(); + COMMIT_BATCH(); + } } } } @@ -1176,9 +1182,11 @@ static int check_tx(GLcontext *ctx, struct radeon_state_atom *atom) R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); for (i = 0; i < R700_TEXTURE_NUMBERUNITS; i++) { - radeonTexObj *t = r700->textures[i]; - if (t) - count++; + if (ctx->Texture.Unit[i]._ReallyEnabled) { + radeonTexObj *t = r700->textures[i]; + if (t) + count++; + } } radeon_print(RADEON_STATE, RADEON_TRACE, "%s %d\n", __func__, count); return count * 31; -- cgit v1.2.3 From 9edd1a441c3c0c3f018ae561cd5711398ca56f95 Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Fri, 11 Sep 2009 10:59:05 -0400 Subject: r600: enable caching of vertex programs --- src/mesa/drivers/dri/r600/r600_context.h | 3 + src/mesa/drivers/dri/r600/r700_chip.c | 10 ++- src/mesa/drivers/dri/r600/r700_oglprog.c | 36 ++++++----- src/mesa/drivers/dri/r600/r700_render.c | 9 +-- src/mesa/drivers/dri/r600/r700_vertprog.c | 103 ++++++++++++++++++++---------- src/mesa/drivers/dri/r600/r700_vertprog.h | 11 +++- 6 files changed, 110 insertions(+), 62 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r600_context.h b/src/mesa/drivers/dri/r600/r600_context.h index 8ae05a301c..c59df7505a 100644 --- a/src/mesa/drivers/dri/r600/r600_context.h +++ b/src/mesa/drivers/dri/r600/r600_context.h @@ -51,6 +51,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r700_chip.h" #include "r600_tex.h" #include "r700_oglprog.h" +#include "r700_vertprog.h" struct r600_context; typedef struct r600_context context_t; @@ -155,6 +156,8 @@ struct r600_context { struct r600_hw_state atoms; + struct r700_vertex_program *selected_vp; + /* Vertex buffers */ GLvector4f dummy_attrib[_TNL_ATTRIB_MAX]; diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index 312cacffda..1b56059197 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -211,8 +211,7 @@ static void r700SetupVTXConstants(GLcontext * ctx, void r700SetupStreams(GLcontext *ctx) { context_t *context = R700_CONTEXT(ctx); - struct r700_vertex_program *vpc - = (struct r700_vertex_program *)ctx->VertexProgram._Current; + struct r700_vertex_program *vp = context->selected_vp; TNLcontext *tnl = TNL_CONTEXT(ctx); struct vertex_buffer *vb = &tnl->vb; unsigned int i, j = 0; @@ -221,7 +220,7 @@ void r700SetupStreams(GLcontext *ctx) R600_STATECHANGE(context, vtx); for(i=0; imesa_program.Base.InputsRead & (1 << i)) { + if(vp->mesa_program->Base.InputsRead & (1 << i)) { rcommon_emit_vector(ctx, &context->radeon.tcl.aos[j], vb->AttribPtr[i]->data, @@ -237,8 +236,7 @@ void r700SetupStreams(GLcontext *ctx) static void r700SendVTXState(GLcontext *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); - struct r700_vertex_program *vpc - = (struct r700_vertex_program *)ctx->VertexProgram._Current; + struct r700_vertex_program *vp = context->selected_vp; unsigned int i, j = 0; BATCH_LOCALS(&context->radeon); radeon_print(RADEON_STATE, RADEON_VERBOSE, "%s\n", __func__); @@ -258,7 +256,7 @@ static void r700SendVTXState(GLcontext *ctx, struct radeon_state_atom *atom) COMMIT_BATCH(); for(i=0; imesa_program.Base.InputsRead & (1 << i)) { + if(vp->mesa_program->Base.InputsRead & (1 << i)) { /* currently aos are packed */ r700SetupVTXConstants(ctx, i, diff --git a/src/mesa/drivers/dri/r600/r700_oglprog.c b/src/mesa/drivers/dri/r600/r700_oglprog.c index 3c8c1fd7a3..5290ef31be 100644 --- a/src/mesa/drivers/dri/r600/r700_oglprog.c +++ b/src/mesa/drivers/dri/r600/r700_oglprog.c @@ -46,7 +46,7 @@ static struct gl_program *r700NewProgram(GLcontext * ctx, { struct gl_program *pProgram = NULL; - struct r700_vertex_program *vp; + struct r700_vertex_program_cont *vpc; struct r700_fragment_program *fp; radeon_print(RADEON_SHADER, RADEON_VERBOSE, @@ -56,16 +56,11 @@ static struct gl_program *r700NewProgram(GLcontext * ctx, { case GL_VERTEX_STATE_PROGRAM_NV: case GL_VERTEX_PROGRAM_ARB: - vp = CALLOC_STRUCT(r700_vertex_program); + vpc = CALLOC_STRUCT(r700_vertex_program_cont); pProgram = _mesa_init_vertex_program(ctx, - &vp->mesa_program, + &vpc->mesa_program, target, id); - vp->translated = GL_FALSE; - vp->loaded = GL_FALSE; - - vp->shaderbo = NULL; - break; case GL_FRAGMENT_PROGRAM_NV: case GL_FRAGMENT_PROGRAM_ARB: @@ -89,7 +84,8 @@ static struct gl_program *r700NewProgram(GLcontext * ctx, static void r700DeleteProgram(GLcontext * ctx, struct gl_program *prog) { - struct r700_vertex_program * vp; + struct r700_vertex_program_cont * vpc; + struct r700_vertex_program *vp, *tmp; struct r700_fragment_program * fp; radeon_print(RADEON_SHADER, RADEON_VERBOSE, @@ -99,14 +95,20 @@ static void r700DeleteProgram(GLcontext * ctx, struct gl_program *prog) { case GL_VERTEX_STATE_PROGRAM_NV: case GL_VERTEX_PROGRAM_ARB: - vp = (struct r700_vertex_program*)prog; - /* Release DMA region */ - - r600DeleteShader(ctx, vp->shaderbo); - - /* Clean up */ - Clean_Up_Assembler(&(vp->r700AsmCode)); - Clean_Up_Shader(&(vp->r700Shader)); + vpc = (struct r700_vertex_program_cont*)prog; + vp = vpc->progs; + while (vp) { + tmp = vp->next; + /* Release DMA region */ + + r600DeleteShader(ctx, vp->shaderbo); + + /* Clean up */ + Clean_Up_Assembler(&(vp->r700AsmCode)); + Clean_Up_Shader(&(vp->r700Shader)); + _mesa_free(vp); + vp = tmp; + } break; case GL_FRAGMENT_PROGRAM_NV: case GL_FRAGMENT_PROGRAM_ARB: diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c index 3566bf3ca7..b1c3648ca5 100644 --- a/src/mesa/drivers/dri/r600/r700_render.c +++ b/src/mesa/drivers/dri/r600/r700_render.c @@ -319,14 +319,13 @@ static GLuint r700PredictRenderSize(GLcontext* ctx) { context_t *context = R700_CONTEXT(ctx); TNLcontext *tnl = TNL_CONTEXT(ctx); - struct r700_vertex_program *vpc - = (struct r700_vertex_program *)ctx->VertexProgram._Current; + struct r700_vertex_program *vp = context->selected_vp; struct vertex_buffer *vb = &tnl->vb; GLboolean flushed; GLuint dwords, i; GLuint state_size; /* pre calculate aos count so state prediction works */ - context->radeon.tcl.aos_count = _mesa_bitcount(vpc->mesa_program.Base.InputsRead); + context->radeon.tcl.aos_count = _mesa_bitcount(vp->mesa_program->Base.InputsRead); dwords = PRE_EMIT_STATE_BUFSZ; for (i = 0; i < vb->PrimitiveCount; i++) @@ -365,7 +364,6 @@ static GLboolean r700RunRender(GLcontext * ctx, /* mark vtx as dirty since it changes per-draw */ R600_STATECHANGE(context, vtx); - r700UpdateShaders(ctx); r700SetScissor(context); r700SetupVertexProgram(ctx); r700SetupFragmentProgram(ctx); @@ -427,7 +425,10 @@ static GLboolean r700RunTCLRender(GLcontext * ctx, /*----------------------*/ /* TODO : sw fallback */ + /* Need shader bo's setup before bo check */ + r700UpdateShaders(ctx); /** + * Ensure all enabled and complete textures are uploaded along with any buffers being used. */ if(!r600ValidateBuffers(ctx)) diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.c b/src/mesa/drivers/dri/r600/r700_vertprog.c index d107f99e7b..8c2b0071df 100644 --- a/src/mesa/drivers/dri/r600/r700_vertprog.c +++ b/src/mesa/drivers/dri/r600/r700_vertprog.c @@ -35,6 +35,7 @@ #include "main/mtypes.h" #include "tnl/t_context.h" +#include "shader/program.h" #include "shader/prog_parameter.h" #include "shader/prog_statevars.h" @@ -258,28 +259,54 @@ GLboolean Find_Instruction_Dependencies_vp(struct r700_vertex_program *vp, return GL_TRUE; } -GLboolean r700TranslateVertexShader(struct r700_vertex_program *vp, - struct gl_vertex_program *mesa_vp) +struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, + struct gl_vertex_program *mesa_vp) { + context_t *context = R700_CONTEXT(ctx); + struct r700_vertex_program *vp; + TNLcontext *tnl = TNL_CONTEXT(ctx); + struct vertex_buffer *vb = &tnl->vb; + unsigned int unBit; + unsigned int i; + + vp = _mesa_calloc(sizeof(*vp)); + vp->mesa_program = (struct gl_vertex_program *)_mesa_clone_program(ctx, &mesa_vp->Base); + + for(i=0; imesa_program->Base.InputsRead & unBit) /* ctx->Array.ArrayObj->xxxxxxx */ + { + vp->aos_desc[i].size = vb->AttribPtr[i]->size; + vp->aos_desc[i].stride = vb->AttribPtr[i]->size * sizeof(GL_FLOAT);/* when emit array, data is packed. vb->AttribPtr[i]->stride;*/ + vp->aos_desc[i].type = GL_FLOAT; + } + } + + if (context->radeon.radeonScreen->chip_family < CHIP_FAMILY_RV770) + { + vp->r700AsmCode.bR6xx = 1; + } + //Init_Program Init_r700_AssemblerBase(SPT_VP, &(vp->r700AsmCode), &(vp->r700Shader) ); Map_Vertex_Program( vp, mesa_vp ); if(GL_FALSE == Find_Instruction_Dependencies_vp(vp, mesa_vp)) { - return GL_FALSE; + return NULL; } if(GL_FALSE == AssembleInstr(mesa_vp->Base.NumInstructions, &(mesa_vp->Base.Instructions[0]), &(vp->r700AsmCode)) ) { - return GL_FALSE; + return NULL; } if(GL_FALSE == Process_Vertex_Exports(&(vp->r700AsmCode), mesa_vp->Base.OutputsWritten) ) { - return GL_FALSE; + return NULL; } vp->r700Shader.nRegs = (vp->r700AsmCode.number_used_registers == 0) ? 0 @@ -289,72 +316,82 @@ GLboolean r700TranslateVertexShader(struct r700_vertex_program *vp, vp->translated = GL_TRUE; - return GL_TRUE; + return vp; } void r700SelectVertexShader(GLcontext *ctx) { context_t *context = R700_CONTEXT(ctx); - struct r700_vertex_program *vpc - = (struct r700_vertex_program *)ctx->VertexProgram._Current; + struct r700_vertex_program_cont *vpc; + struct r700_vertex_program *vp; TNLcontext *tnl = TNL_CONTEXT(ctx); struct vertex_buffer *vb = &tnl->vb; unsigned int unBit; unsigned int i; + GLboolean match; + vpc = (struct r700_vertex_program_cont *)ctx->VertexProgram._Current; + +#if 0 if (context->radeon.NewGLState & (_NEW_PROGRAM_CONSTANTS|_NEW_PROGRAM)) { vpc->needUpdateVF = 1; } +#endif - if (context->radeon.radeonScreen->chip_family < CHIP_FAMILY_RV770) + for (vp = vpc->progs; vp; vp = vp->next) { - vpc->r700AsmCode.bR6xx = 1; - } - + match = GL_TRUE; for(i=0; imesa_program.Base.InputsRead & unBit) /* ctx->Array.ArrayObj->xxxxxxx */ + if(vpc->mesa_program.Base.InputsRead & unBit) { - vpc->aos_desc[i].size = vb->AttribPtr[i]->size; - vpc->aos_desc[i].stride = vb->AttribPtr[i]->size * sizeof(GL_FLOAT);/* when emit array, data is packed. vb->AttribPtr[i]->stride;*/ - vpc->aos_desc[i].type = GL_FLOAT; + if (vp->aos_desc[i].size != vb->AttribPtr[i]->size) + match = GL_FALSE; + break; } } - - if(GL_FALSE == vpc->translated) { - r700TranslateVertexShader(vpc, &(vpc->mesa_program) ); + if (match) + { + context->selected_vp = vp; + return; } + } + + vp = r700TranslateVertexShader(ctx, &(vpc->mesa_program) ); + if(!vp) + { + radeon_error("Failed to translate vertex shader. \n"); + return; + } + vp->next = vpc->progs; + vpc->progs = vp; + context->selected_vp = vp; + return; } void * r700GetActiveVpShaderBo(GLcontext * ctx) { - struct r700_vertex_program *vp - = (struct r700_vertex_program *)ctx->VertexProgram._Current; + context_t *context = R700_CONTEXT(ctx); + struct r700_vertex_program *vp = context->selected_vp;; - return vp->shaderbo; + if (vp) + return vp->shaderbo; + else + return NULL; } GLboolean r700SetupVertexProgram(GLcontext * ctx) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); - struct r700_vertex_program *vp - = (struct r700_vertex_program *)ctx->VertexProgram._Current; + struct r700_vertex_program *vp = context->selected_vp; struct gl_program_parameter_list *paramList; unsigned int unNumParamData; unsigned int ui; - if (vp->needUpdateVF) - { - vp->loaded = GL_FALSE; - vp->r700Shader.bNeedsAssembly = GL_TRUE; - Process_Vertex_Program_Vfetch_Instructions(vp, &(vp->mesa_program)); - r600DeleteShader(ctx, vp->shaderbo); - } - if(GL_FALSE == vp->loaded) { if(vp->r700Shader.bNeedsAssembly == GL_TRUE) @@ -410,7 +447,7 @@ GLboolean r700SetupVertexProgram(GLcontext * ctx) */ /* sent out shader constants. */ - paramList = vp->mesa_program.Base.Parameters; + paramList = vp->mesa_program->Base.Parameters; if(NULL != paramList) { _mesa_load_state_parameters(ctx, paramList); diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.h b/src/mesa/drivers/dri/r600/r700_vertprog.h index e2e65021fd..c48764c43b 100644 --- a/src/mesa/drivers/dri/r600/r700_vertprog.h +++ b/src/mesa/drivers/dri/r600/r700_vertprog.h @@ -43,7 +43,7 @@ typedef struct ArrayDesc //TEMP struct r700_vertex_program { - struct gl_vertex_program mesa_program; /* Must be first */ + struct gl_vertex_program *mesa_program; /* Must be first */ struct r700_vertex_program *next; @@ -59,6 +59,13 @@ struct r700_vertex_program ArrayDesc aos_desc[VERT_ATTRIB_MAX]; }; +struct r700_vertex_program_cont +{ + struct gl_vertex_program mesa_program; + + struct r700_vertex_program *progs; +}; + //Internal unsigned int Map_Vertex_Output(r700_AssemblerBase *pAsm, struct gl_vertex_program *mesa_vp, @@ -74,7 +81,7 @@ void Map_Vertex_Program(struct r700_vertex_program *vp, GLboolean Find_Instruction_Dependencies_vp(struct r700_vertex_program *vp, struct gl_vertex_program *mesa_vp); -GLboolean r700TranslateVertexShader(struct r700_vertex_program *vp, +struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, struct gl_vertex_program *mesa_vp); /* Interface */ -- cgit v1.2.3 From 7f5a958c80f0fcd7681d515fd1c1b8bc00524a7a Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Fri, 11 Sep 2009 15:59:55 -0400 Subject: r600: fix texcoords from constants with some minor updates from Richard. --- src/mesa/drivers/dri/r600/r700_assembler.c | 92 +++++++++++++++++------------- 1 file changed, 52 insertions(+), 40 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 2d8480daaf..fda6692725 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -1149,41 +1149,49 @@ GLboolean tex_dst(r700_AssemblerBase *pAsm) GLboolean tex_src(r700_AssemblerBase *pAsm) { struct prog_instruction *pILInst = &(pAsm->pILInst[pAsm->uiCurInst]); - + GLboolean bValidTexCoord = GL_FALSE; - switch (pILInst->SrcReg[0].File) - { + switch (pILInst->SrcReg[0].File) { + case PROGRAM_CONSTANT: + case PROGRAM_LOCAL_PARAM: + case PROGRAM_ENV_PARAM: + case PROGRAM_STATE_VAR: + bValidTexCoord = GL_TRUE; + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[0].src.reg = pAsm->aArgSubst[1]; + break; case PROGRAM_TEMPORARY: - bValidTexCoord = GL_TRUE; - - pAsm->S[0].src.reg = pILInst->SrcReg[0].Index + pAsm->starting_temp_register_number; - pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; - - break; + bValidTexCoord = GL_TRUE; + pAsm->S[0].src.reg = pILInst->SrcReg[0].Index + + pAsm->starting_temp_register_number; + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + break; case PROGRAM_INPUT: - switch (pILInst->SrcReg[0].Index) - { - case FRAG_ATTRIB_COL0: - case FRAG_ATTRIB_COL1: - case FRAG_ATTRIB_TEX0: - case FRAG_ATTRIB_TEX1: - case FRAG_ATTRIB_TEX2: - case FRAG_ATTRIB_TEX3: - case FRAG_ATTRIB_TEX4: - case FRAG_ATTRIB_TEX5: - case FRAG_ATTRIB_TEX6: - case FRAG_ATTRIB_TEX7: - bValidTexCoord = GL_TRUE; - - pAsm->S[0].src.reg = pAsm->uiFP_AttributeMap[pILInst->SrcReg[0].Index]; - pAsm->S[0].src.rtype = SRC_REG_INPUT; - } - break; + switch (pILInst->SrcReg[0].Index) + { + case FRAG_ATTRIB_COL0: + case FRAG_ATTRIB_COL1: + case FRAG_ATTRIB_TEX0: + case FRAG_ATTRIB_TEX1: + case FRAG_ATTRIB_TEX2: + case FRAG_ATTRIB_TEX3: + case FRAG_ATTRIB_TEX4: + case FRAG_ATTRIB_TEX5: + case FRAG_ATTRIB_TEX6: + case FRAG_ATTRIB_TEX7: + bValidTexCoord = GL_TRUE; + pAsm->S[0].src.reg = + pAsm->uiFP_AttributeMap[pILInst->SrcReg[0].Index]; + pAsm->S[0].src.rtype = SRC_REG_INPUT; + break; + } + break; } if(GL_TRUE == bValidTexCoord) - { + { setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); } else @@ -1201,7 +1209,7 @@ GLboolean tex_src(r700_AssemblerBase *pAsm) pAsm->S[0].src.negy = (pILInst->SrcReg[0].Negate >> 1) & 0x1; pAsm->S[0].src.negz = (pILInst->SrcReg[0].Negate >> 2) & 0x1; pAsm->S[0].src.negw = (pILInst->SrcReg[0].Negate >> 3) & 0x1; - + return GL_TRUE; } @@ -2202,7 +2210,9 @@ GLboolean next_ins(r700_AssemblerBase *pAsm) { struct prog_instruction *pILInst = &(pAsm->pILInst[pAsm->uiCurInst]); - if( GL_TRUE == IsTex(pILInst->Opcode) ) + if( GL_TRUE == IsTex(pILInst->Opcode) && + /* handle const moves to temp register */ + !(pAsm->D.dst.opcode == SQ_OP2_INST_MOV) ) { if (pILInst->TexSrcTarget == TEXTURE_RECT_INDEX) { if( GL_FALSE == assemble_tex_instruction(pAsm, GL_FALSE) ) @@ -3374,28 +3384,30 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) case PROGRAM_ENV_PARAM: case PROGRAM_STATE_VAR: src_const = GL_TRUE; + break; case PROGRAM_TEMPORARY: case PROGRAM_INPUT: src_const = GL_FALSE; + break; } - if (GL_TRUE == src_const) + if (GL_TRUE == src_const) { - radeon_error("TODO: Texture coordinates from a constant register not supported.\n"); - return GL_FALSE; + if ( GL_FALSE == mov_temp(pAsm, 0) ) + return GL_FALSE; } - switch (pAsm->pILInst[pAsm->uiCurInst].Opcode) + switch (pAsm->pILInst[pAsm->uiCurInst].Opcode) { case OPCODE_TEX: - pAsm->D.dst.opcode = SQ_TEX_INST_SAMPLE; + pAsm->D.dst.opcode = SQ_TEX_INST_SAMPLE; break; - case OPCODE_TXB: + case OPCODE_TXB: radeon_error("do not support TXB yet\n"); return GL_FALSE; break; - case OPCODE_TXP: - /* TODO : tex proj version : divid first 3 components by 4th */ + case OPCODE_TXP: + /* TODO : tex proj version : divid first 3 components by 4th */ pAsm->D.dst.opcode = SQ_TEX_INST_SAMPLE; break; default: @@ -3418,13 +3430,13 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) { return GL_FALSE; } - + if( GL_FALSE == tex_src(pAsm) ) { return GL_FALSE; } - if ( GL_FALSE == next_ins(pAsm) ) + if ( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } -- cgit v1.2.3 From 93a7ea6ba0d5700e18b28c23da226e055f7c2fa1 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 14 Sep 2009 17:08:26 -0400 Subject: r600: fix warning Noticed by rnoland on IRC. --- src/mesa/drivers/dri/r600/r700_assembler.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index fda6692725..efeccb25f1 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -3387,6 +3387,7 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) break; case PROGRAM_TEMPORARY: case PROGRAM_INPUT: + default: src_const = GL_FALSE; break; } -- cgit v1.2.3 From 9437ac9bccd294bd5a8b838e7ca7597e5dc6d5b0 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 14 Sep 2009 18:05:15 -0400 Subject: r600: add span support for 1D tiles 1D tile span support for depth/stencil/color/textures Z and stencil buffers are always tiled, so this fixes sw access to Z and stencil buffers. color and textures are currently linear, but this adds span support when we implement 1D tiling. This fixes the text in progs/demos/engine and progs/tests/z* --- src/mesa/drivers/dri/r600/r600_reg_auto_r6xx.h | 2 + src/mesa/drivers/dri/r600/r700_chip.c | 2 +- src/mesa/drivers/dri/radeon/radeon_span.c | 220 +++++++++++++++++++++++++ 3 files changed, 223 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r600_reg_auto_r6xx.h b/src/mesa/drivers/dri/r600/r600_reg_auto_r6xx.h index 9d5aa3c7e4..edd85b0fac 100644 --- a/src/mesa/drivers/dri/r600/r600_reg_auto_r6xx.h +++ b/src/mesa/drivers/dri/r600/r600_reg_auto_r6xx.h @@ -1366,6 +1366,7 @@ enum { DB_DEPTH_INFO__READ_SIZE_bit = 1 << 3, DB_DEPTH_INFO__ARRAY_MODE_mask = 0x0f << 15, DB_DEPTH_INFO__ARRAY_MODE_shift = 15, + ARRAY_1D_TILED_THIN1 = 0x02, ARRAY_2D_TILED_THIN1 = 0x04, TILE_SURFACE_ENABLE_bit = 1 << 25, TILE_COMPACT_bit = 1 << 26, @@ -1449,6 +1450,7 @@ enum { CB_COLOR0_INFO__ARRAY_MODE_shift = 8, ARRAY_LINEAR_GENERAL = 0x00, ARRAY_LINEAR_ALIGNED = 0x01, +/* ARRAY_1D_TILED_THIN1 = 0x02, */ /* ARRAY_2D_TILED_THIN1 = 0x04, */ NUMBER_TYPE_mask = 0x07 << 12, NUMBER_TYPE_shift = 12, diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index 1b56059197..06d7e9c9ab 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -351,7 +351,7 @@ static void r700SetDepthTarget(context_t *context) SETfield(r700->DB_DEPTH_INFO.u32All, DEPTH_16, DB_DEPTH_INFO__FORMAT_shift, DB_DEPTH_INFO__FORMAT_mask); } - SETfield(r700->DB_DEPTH_INFO.u32All, ARRAY_2D_TILED_THIN1, + SETfield(r700->DB_DEPTH_INFO.u32All, ARRAY_1D_TILED_THIN1, DB_DEPTH_INFO__ARRAY_MODE_shift, DB_DEPTH_INFO__ARRAY_MODE_mask); /* r700->DB_PREFETCH_LIMIT.bits.DEPTH_HEIGHT_TILE_MAX = (context->currentDraw->h >> 3) - 1; */ /* z buffer sie may much bigger than what need, so use actual used h. */ } diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c b/src/mesa/drivers/dri/radeon/radeon_span.c index 4e100d854e..aa2035338c 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.c +++ b/src/mesa/drivers/dri/radeon/radeon_span.c @@ -106,6 +106,142 @@ static GLubyte *r200_depth_4byte(const struct radeon_renderbuffer * rrb, } #endif +/* r600 tiling + * two main types: + * - 1D (akin to macro-linear/micro-tiled on older asics) + * - 2D (akin to macro-tiled/micro-tiled on older asics) + * only 1D tiling is implemented below + */ +#if defined(RADEON_COMMON_FOR_R600) +static GLint r600_1d_tile_helper(const struct radeon_renderbuffer * rrb, + GLint x, GLint y, GLint is_depth, GLint is_stencil) +{ + GLint element_bytes = rrb->cpp; + GLint num_samples = 1; + GLint tile_width = 8; + GLint tile_height = 8; + GLint tile_thickness = 1; + GLint pitch_elements = rrb->pitch / element_bytes; + GLint height = rrb->base.Height; + GLint z = 0; + GLint sample_number = 0; + /* */ + GLint tile_bytes; + GLint tiles_per_row; + GLint tiles_per_slice; + GLint slice_offset; + GLint tile_row_index; + GLint tile_column_index; + GLint tile_offset; + GLint pixel_number = 0; + GLint element_offset; + GLint offset = 0; + + tile_bytes = tile_width * tile_height * tile_thickness * element_bytes * num_samples; + tiles_per_row = pitch_elements /tile_width; + tiles_per_slice = tiles_per_row * (height / tile_height); + slice_offset = (z / tile_thickness) * tiles_per_slice * tile_bytes; + tile_row_index = y / tile_height; + tile_column_index = x / tile_width; + tile_offset = ((tile_row_index * tiles_per_row) + tile_column_index) * tile_bytes; + + if (is_depth) { + GLint pixel_offset = 0; + + pixel_number |= ((x >> 0) & 1) << 0; // pn[0] = x[0] + pixel_number |= ((y >> 0) & 1) << 1; // pn[1] = y[0] + pixel_number |= ((x >> 1) & 1) << 2; // pn[2] = x[1] + pixel_number |= ((y >> 1) & 1) << 3; // pn[3] = y[1] + pixel_number |= ((x >> 2) & 1) << 4; // pn[4] = x[2] + pixel_number |= ((y >> 2) & 1) << 5; // pn[5] = y[2] + switch (element_bytes) { + case 2: + pixel_offset = pixel_number * element_bytes * num_samples; + element_offset = pixel_offset + (sample_number * element_bytes); + break; + case 4: + /* stencil and depth data are stored separately within a tile. + * stencil is stored in a contiguous tile before the depth tile. + * stencil element is 1 byte, depth element is 3 bytes. + * stencil tile is 64 bytes. + */ + if (is_stencil) + pixel_offset = pixel_number * 1 * num_samples; + else + pixel_offset = (pixel_number * 3 * num_samples) + 64; + break; + } + element_offset = pixel_offset + (sample_number * element_bytes); + } else { + GLint sample_offset; + + switch (element_bytes) { + case 1: + pixel_number |= ((x >> 0) & 1) << 0; // pn[0] = x[0] + pixel_number |= ((x >> 1) & 1) << 1; // pn[1] = x[1] + pixel_number |= ((x >> 2) & 1) << 2; // pn[2] = x[2] + pixel_number |= ((y >> 1) & 1) << 3; // pn[3] = y[1] + pixel_number |= ((y >> 0) & 1) << 4; // pn[4] = y[0] + pixel_number |= ((y >> 2) & 1) << 5; // pn[5] = y[2] + break; + case 2: + pixel_number |= ((x >> 0) & 1) << 0; // pn[0] = x[0] + pixel_number |= ((x >> 1) & 1) << 1; // pn[1] = x[1] + pixel_number |= ((x >> 2) & 1) << 2; // pn[2] = x[2] + pixel_number |= ((y >> 0) & 1) << 3; // pn[3] = y[0] + pixel_number |= ((y >> 1) & 1) << 4; // pn[4] = y[1] + pixel_number |= ((y >> 2) & 1) << 5; // pn[5] = y[2] + break; + case 4: + pixel_number |= ((x >> 0) & 1) << 0; // pn[0] = x[0] + pixel_number |= ((x >> 1) & 1) << 1; // pn[1] = x[1] + pixel_number |= ((y >> 0) & 1) << 2; // pn[2] = y[0] + pixel_number |= ((x >> 2) & 1) << 3; // pn[3] = x[2] + pixel_number |= ((y >> 1) & 1) << 4; // pn[4] = y[1] + pixel_number |= ((y >> 2) & 1) << 5; // pn[5] = y[2] + break; + } + sample_offset = sample_number * (tile_bytes / num_samples); + element_offset = sample_offset + (pixel_number * element_bytes); + } + offset = slice_offset + tile_offset + element_offset; + return offset; +} + +/* depth buffers */ +static GLubyte *r600_ptr_depth(const struct radeon_renderbuffer * rrb, + GLint x, GLint y) +{ + GLubyte *ptr = rrb->bo->ptr; + GLint offset = r600_1d_tile_helper(rrb, x, y, 1, 0); + return &ptr[offset]; +} + +static GLubyte *r600_ptr_stencil(const struct radeon_renderbuffer * rrb, + GLint x, GLint y) +{ + GLubyte *ptr = rrb->bo->ptr; + GLint offset = r600_1d_tile_helper(rrb, x, y, 1, 1); + return &ptr[offset]; +} + +static GLubyte *r600_ptr_color(const struct radeon_renderbuffer * rrb, + GLint x, GLint y) +{ + GLubyte *ptr = rrb->bo->ptr; + uint32_t mask = RADEON_BO_FLAGS_MACRO_TILE | RADEON_BO_FLAGS_MICRO_TILE; + GLint offset; + + if (rrb->has_surface || !(rrb->bo->flags & mask)) { + offset = x * rrb->cpp + y * rrb->pitch; + } else { + offset = r600_1d_tile_helper(rrb, x, y, 0, 0); + } + return &ptr[offset]; +} + +#endif + /* radeon tiling on r300-r500 has 4 states, macro-linear/micro-linear macro-linear/micro-tiled @@ -270,7 +406,11 @@ s8z24_to_z24s8(uint32_t val) #define TAG(x) radeon##x##_RGB565 #define TAG2(x,y) radeon##x##_RGB565##y +#if defined(RADEON_COMMON_FOR_R600) +#define GET_PTR(X,Y) r600_ptr_color(rrb, (X) + x_off, (Y) + y_off) +#else #define GET_PTR(X,Y) radeon_ptr_2byte_8x2(rrb, (X) + x_off, (Y) + y_off) +#endif #include "spantmp2.h" /* 16 bit, ARGB1555 color spanline and pixel functions @@ -280,7 +420,11 @@ s8z24_to_z24s8(uint32_t val) #define TAG(x) radeon##x##_ARGB1555 #define TAG2(x,y) radeon##x##_ARGB1555##y +#if defined(RADEON_COMMON_FOR_R600) +#define GET_PTR(X,Y) r600_ptr_color(rrb, (X) + x_off, (Y) + y_off) +#else #define GET_PTR(X,Y) radeon_ptr_2byte_8x2(rrb, (X) + x_off, (Y) + y_off) +#endif #include "spantmp2.h" /* 16 bit, RGBA4 color spanline and pixel functions @@ -290,7 +434,11 @@ s8z24_to_z24s8(uint32_t val) #define TAG(x) radeon##x##_ARGB4444 #define TAG2(x,y) radeon##x##_ARGB4444##y +#if defined(RADEON_COMMON_FOR_R600) +#define GET_PTR(X,Y) r600_ptr_color(rrb, (X) + x_off, (Y) + y_off) +#else #define GET_PTR(X,Y) radeon_ptr_2byte_8x2(rrb, (X) + x_off, (Y) + y_off) +#endif #include "spantmp2.h" /* 32 bit, xRGB8888 color spanline and pixel functions @@ -300,11 +448,19 @@ s8z24_to_z24s8(uint32_t val) #define TAG(x) radeon##x##_xRGB8888 #define TAG2(x,y) radeon##x##_xRGB8888##y +#if defined(RADEON_COMMON_FOR_R600) +#define GET_VALUE(_x, _y) ((*(GLuint*)(r600_ptr_color(rrb, _x + x_off, _y + y_off)) | 0xff000000)) +#define PUT_VALUE(_x, _y, d) { \ + GLuint *_ptr = (GLuint*)r600_ptr_color( rrb, _x + x_off, _y + y_off ); \ + *_ptr = d; \ +} while (0) +#else #define GET_VALUE(_x, _y) ((*(GLuint*)(radeon_ptr_4byte(rrb, _x + x_off, _y + y_off)) | 0xff000000)) #define PUT_VALUE(_x, _y, d) { \ GLuint *_ptr = (GLuint*)radeon_ptr_4byte( rrb, _x + x_off, _y + y_off ); \ *_ptr = d; \ } while (0) +#endif #include "spantmp2.h" /* 32 bit, ARGB8888 color spanline and pixel functions @@ -314,11 +470,19 @@ s8z24_to_z24s8(uint32_t val) #define TAG(x) radeon##x##_ARGB8888 #define TAG2(x,y) radeon##x##_ARGB8888##y +#if defined(RADEON_COMMON_FOR_R600) +#define GET_VALUE(_x, _y) (*(GLuint*)(r600_ptr_color(rrb, _x + x_off, _y + y_off))) +#define PUT_VALUE(_x, _y, d) { \ + GLuint *_ptr = (GLuint*)r600_ptr_color( rrb, _x + x_off, _y + y_off ); \ + *_ptr = d; \ +} while (0) +#else #define GET_VALUE(_x, _y) (*(GLuint*)(radeon_ptr_4byte(rrb, _x + x_off, _y + y_off))) #define PUT_VALUE(_x, _y, d) { \ GLuint *_ptr = (GLuint*)radeon_ptr_4byte( rrb, _x + x_off, _y + y_off ); \ *_ptr = d; \ } while (0) +#endif #include "spantmp2.h" /* ================================================================ @@ -342,6 +506,9 @@ s8z24_to_z24s8(uint32_t val) #if defined(RADEON_COMMON_FOR_R200) #define WRITE_DEPTH( _x, _y, d ) \ *(GLushort *)r200_depth_2byte(rrb, _x + x_off, _y + y_off) = d +#elif defined(RADEON_COMMON_FOR_R600) +#define WRITE_DEPTH( _x, _y, d ) \ + *(GLushort *)r600_ptr_depth(rrb, _x + x_off, _y + y_off) = d #else #define WRITE_DEPTH( _x, _y, d ) \ *(GLushort *)radeon_ptr_2byte_8x2(rrb, _x + x_off, _y + y_off) = d @@ -350,6 +517,9 @@ s8z24_to_z24s8(uint32_t val) #if defined(RADEON_COMMON_FOR_R200) #define READ_DEPTH( d, _x, _y ) \ d = *(GLushort *)r200_depth_2byte(rrb, _x + x_off, _y + y_off) +#elif defined(RADEON_COMMON_FOR_R600) +#define READ_DEPTH( d, _x, _y ) \ + d = *(GLushort *)r600_ptr_depth(rrb, _x + x_off, _y + y_off) #else #define READ_DEPTH( d, _x, _y ) \ d = *(GLushort *)radeon_ptr_2byte_8x2(rrb, _x + x_off, _y + y_off) @@ -374,6 +544,15 @@ do { \ tmp |= ((d << 8) & 0xffffff00); \ *_ptr = tmp; \ } while (0) +#elif defined(RADEON_COMMON_FOR_R600) +#define WRITE_DEPTH( _x, _y, d ) \ +do { \ + GLuint *_ptr = (GLuint*)r600_ptr_depth( rrb, _x + x_off, _y + y_off ); \ + GLuint tmp = *_ptr; \ + tmp &= 0xff000000; \ + tmp |= ((d) & 0x00ffffff); \ + *_ptr = tmp; \ +} while (0) #elif defined(RADEON_COMMON_FOR_R200) #define WRITE_DEPTH( _x, _y, d ) \ do { \ @@ -399,6 +578,11 @@ do { \ do { \ d = (*(GLuint*)(radeon_ptr_4byte(rrb, _x + x_off, _y + y_off)) & 0xffffff00) >> 8; \ }while(0) +#elif defined(RADEON_COMMON_FOR_R600) +#define READ_DEPTH( d, _x, _y ) \ + do { \ + d = (*(GLuint*)(r600_ptr_depth(rrb, _x + x_off, _y + y_off)) & 0x00ffffff); \ + }while(0) #elif defined(RADEON_COMMON_FOR_R200) #define READ_DEPTH( d, _x, _y ) \ do { \ @@ -426,6 +610,20 @@ do { \ GLuint *_ptr = (GLuint*)radeon_ptr_4byte( rrb, _x + x_off, _y + y_off ); \ *_ptr = d; \ } while (0) +#elif defined(RADEON_COMMON_FOR_R600) +#define WRITE_DEPTH( _x, _y, d ) \ +do { \ + GLuint *_ptr = (GLuint*)r600_ptr_depth( rrb, _x + x_off, _y + y_off ); \ + GLuint tmp = *_ptr; \ + tmp &= 0xff000000; \ + tmp |= (((d) >> 8) & 0x00ffffff); \ + *_ptr = tmp; \ + _ptr = (GLuint*)r600_ptr_stencil(rrb, _x + x_off, _y + y_off); \ + tmp = *_ptr; \ + tmp &= 0xffffff00; \ + tmp |= (d) & 0xff; \ + *_ptr = tmp; \ +} while (0) #elif defined(RADEON_COMMON_FOR_R200) #define WRITE_DEPTH( _x, _y, d ) \ do { \ @@ -447,6 +645,12 @@ do { \ do { \ d = (*(GLuint*)(radeon_ptr_4byte(rrb, _x + x_off, _y + y_off))); \ }while(0) +#elif defined(RADEON_COMMON_FOR_R600) +#define READ_DEPTH( d, _x, _y ) \ + do { \ + d = ((*(GLuint*)(r600_ptr_depth(rrb, _x + x_off, _y + y_off))) << 8) & 0xffffff00; \ + d |= (*(GLuint*)(r600_ptr_stencil(rrb, _x + x_off, _y + y_off))) & 0x000000ff; \ + }while(0) #elif defined(RADEON_COMMON_FOR_R200) #define READ_DEPTH( d, _x, _y ) \ do { \ @@ -476,6 +680,15 @@ do { \ tmp |= (d) & 0xff; \ *_ptr = tmp; \ } while (0) +#elif defined(RADEON_COMMON_FOR_R600) +#define WRITE_STENCIL( _x, _y, d ) \ +do { \ + GLuint *_ptr = (GLuint*)r600_ptr_stencil(rrb, _x + x_off, _y + y_off); \ + GLuint tmp = *_ptr; \ + tmp &= 0xffffff00; \ + tmp |= (d) & 0xff; \ + *_ptr = tmp; \ +} while (0) #elif defined(RADEON_COMMON_FOR_R200) #define WRITE_STENCIL( _x, _y, d ) \ do { \ @@ -503,6 +716,13 @@ do { \ GLuint tmp = *_ptr; \ d = tmp & 0x000000ff; \ } while (0) +#elif defined(RADEON_COMMON_FOR_R600) +#define READ_STENCIL( d, _x, _y ) \ +do { \ + GLuint *_ptr = (GLuint*)r600_ptr_stencil( rrb, _x + x_off, _y + y_off ); \ + GLuint tmp = *_ptr; \ + d = tmp & 0x000000ff; \ +} while (0) #elif defined(RADEON_COMMON_FOR_R200) #define READ_STENCIL( d, _x, _y ) \ do { \ -- cgit v1.2.3 From 2cd2dc34ac93dd929ec8f01cf1f7f8dfa6b34d0d Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Tue, 15 Sep 2009 11:27:51 -0400 Subject: r600: support position_invariant programs --- src/mesa/drivers/dri/r600/r700_vertprog.c | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.c b/src/mesa/drivers/dri/r600/r700_vertprog.c index 8c2b0071df..9ee26286d9 100644 --- a/src/mesa/drivers/dri/r600/r700_vertprog.c +++ b/src/mesa/drivers/dri/r600/r700_vertprog.c @@ -42,6 +42,7 @@ #include "radeon_debug.h" #include "r600_context.h" #include "r600_cmdbuf.h" +#include "shader/programopt.c" #include "r700_debug.h" #include "r700_vertprog.h" @@ -272,6 +273,11 @@ struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, vp = _mesa_calloc(sizeof(*vp)); vp->mesa_program = (struct gl_vertex_program *)_mesa_clone_program(ctx, &mesa_vp->Base); + if (mesa_vp->IsPositionInvariant) + { + _mesa_insert_mvp_code(ctx, vp->mesa_program); + } + for(i=0; ir700AsmCode), &(vp->r700Shader) ); - Map_Vertex_Program( vp, mesa_vp ); + Map_Vertex_Program( vp, vp->mesa_program ); - if(GL_FALSE == Find_Instruction_Dependencies_vp(vp, mesa_vp)) + if(GL_FALSE == Find_Instruction_Dependencies_vp(vp, vp->mesa_program)) { return NULL; } - if(GL_FALSE == AssembleInstr(mesa_vp->Base.NumInstructions, - &(mesa_vp->Base.Instructions[0]), + if(GL_FALSE == AssembleInstr(vp->mesa_program->Base.NumInstructions, + &(vp->mesa_program->Base.Instructions[0]), &(vp->r700AsmCode)) ) { return NULL; } - if(GL_FALSE == Process_Vertex_Exports(&(vp->r700AsmCode), mesa_vp->Base.OutputsWritten) ) + if(GL_FALSE == Process_Vertex_Exports(&(vp->r700AsmCode), vp->mesa_program->Base.OutputsWritten) ) { return NULL; } @@ -329,23 +335,23 @@ void r700SelectVertexShader(GLcontext *ctx) unsigned int unBit; unsigned int i; GLboolean match; + GLbitfield InputsRead; vpc = (struct r700_vertex_program_cont *)ctx->VertexProgram._Current; -#if 0 - if (context->radeon.NewGLState & (_NEW_PROGRAM_CONSTANTS|_NEW_PROGRAM)) + InputsRead = vpc->mesa_program.Base.InputsRead; + if (vpc->mesa_program.IsPositionInvariant) { - vpc->needUpdateVF = 1; - } -#endif - + InputsRead |= VERT_BIT_POS; + } + for (vp = vpc->progs; vp; vp = vp->next) { match = GL_TRUE; for(i=0; imesa_program.Base.InputsRead & unBit) + if(InputsRead & unBit) { if (vp->aos_desc[i].size != vb->AttribPtr[i]->size) match = GL_FALSE; -- cgit v1.2.3 From dbec27be856584bc5205c7eeeca2b7e98299d4cb Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Tue, 15 Sep 2009 16:58:37 -0400 Subject: r600: minor span cleanups --- src/mesa/drivers/dri/radeon/radeon_span.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c b/src/mesa/drivers/dri/radeon/radeon_span.c index aa2035338c..9959da011e 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.c +++ b/src/mesa/drivers/dri/radeon/radeon_span.c @@ -113,8 +113,8 @@ static GLubyte *r200_depth_4byte(const struct radeon_renderbuffer * rrb, * only 1D tiling is implemented below */ #if defined(RADEON_COMMON_FOR_R600) -static GLint r600_1d_tile_helper(const struct radeon_renderbuffer * rrb, - GLint x, GLint y, GLint is_depth, GLint is_stencil) +static inline GLint r600_1d_tile_helper(const struct radeon_renderbuffer * rrb, + GLint x, GLint y, GLint is_depth, GLint is_stencil) { GLint element_bytes = rrb->cpp; GLint num_samples = 1; @@ -138,7 +138,7 @@ static GLint r600_1d_tile_helper(const struct radeon_renderbuffer * rrb, GLint offset = 0; tile_bytes = tile_width * tile_height * tile_thickness * element_bytes * num_samples; - tiles_per_row = pitch_elements /tile_width; + tiles_per_row = pitch_elements / tile_width; tiles_per_slice = tiles_per_row * (height / tile_height); slice_offset = (z / tile_thickness) * tiles_per_slice * tile_bytes; tile_row_index = y / tile_height; @@ -157,7 +157,6 @@ static GLint r600_1d_tile_helper(const struct radeon_renderbuffer * rrb, switch (element_bytes) { case 2: pixel_offset = pixel_number * element_bytes * num_samples; - element_offset = pixel_offset + (sample_number * element_bytes); break; case 4: /* stencil and depth data are stored separately within a tile. -- cgit v1.2.3 From ec14d59afa952b4e53ad268971098584686a6fca Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Tue, 15 Sep 2009 17:12:03 -0400 Subject: radeon: don't build non-r600 span code on r600 --- src/mesa/drivers/dri/radeon/radeon_span.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c b/src/mesa/drivers/dri/radeon/radeon_span.c index 9959da011e..d603f52df7 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.c +++ b/src/mesa/drivers/dri/radeon/radeon_span.c @@ -239,7 +239,7 @@ static GLubyte *r600_ptr_color(const struct radeon_renderbuffer * rrb, return &ptr[offset]; } -#endif +#else /* radeon tiling on r300-r500 has 4 states, macro-linear/micro-linear @@ -332,7 +332,10 @@ static GLubyte *radeon_ptr_2byte_8x2(const struct radeon_renderbuffer * rrb, return &ptr[offset]; } +#endif + #ifndef COMPILE_R300 +#ifndef COMPILE_R600 static uint32_t z24s8_to_s8z24(uint32_t val) { @@ -345,6 +348,7 @@ s8z24_to_z24s8(uint32_t val) return (val >> 24) | (val << 8); } #endif +#endif /* * Note that all information needed to access pixels in a renderbuffer -- cgit v1.2.3 From 095db818c6c7ed5706b5f31d17d0cb19c03cb67a Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Sat, 19 Sep 2009 14:46:06 -0400 Subject: r600: fix polygon offset --- src/mesa/drivers/dri/r600/r700_state.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index 2a0b419256..d8190efe47 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -1122,20 +1122,25 @@ static void r700PolygonOffset(GLcontext * ctx, GLfloat factor, GLfloat units) // context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); GLfloat constant = units; + GLchar depth = 0; + + R600_STATECHANGE(context, poly); switch (ctx->Visual.depthBits) { case 16: constant *= 4.0; + depth = -16; break; case 24: constant *= 2.0; + depth = -24; break; } factor *= 12.0; - - R600_STATECHANGE(context, poly); - + SETfield(r700->PA_SU_POLY_OFFSET_DB_FMT_CNTL.u32All, depth, + POLY_OFFSET_NEG_NUM_DB_BITS_shift, POLY_OFFSET_NEG_NUM_DB_BITS_mask); + //r700->PA_SU_POLY_OFFSET_CLAMP.f32All = constant; //??? r700->PA_SU_POLY_OFFSET_FRONT_SCALE.f32All = factor; r700->PA_SU_POLY_OFFSET_FRONT_OFFSET.f32All = constant; r700->PA_SU_POLY_OFFSET_BACK_SCALE.f32All = factor; -- cgit v1.2.3 From 48559c76056e09ca4f9e4f39e9008f6d32ecd5b0 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Sat, 19 Sep 2009 15:18:42 -0400 Subject: r600: fix point sizes registers takes radius --- src/mesa/drivers/dri/r600/r700_state.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index d8190efe47..8571563149 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -837,9 +837,9 @@ static void r700PointSize(GLcontext * ctx, GLfloat size) size = CLAMP(size, ctx->Const.MinPointSize, ctx->Const.MaxPointSize); /* format is 12.4 fixed point */ - SETfield(r700->PA_SU_POINT_SIZE.u32All, (int)(size * 16), + SETfield(r700->PA_SU_POINT_SIZE.u32All, (int)(size * 8.0), PA_SU_POINT_SIZE__HEIGHT_shift, PA_SU_POINT_SIZE__HEIGHT_mask); - SETfield(r700->PA_SU_POINT_SIZE.u32All, (int)(size * 16), + SETfield(r700->PA_SU_POINT_SIZE.u32All, (int)(size * 8.0), PA_SU_POINT_SIZE__WIDTH_shift, PA_SU_POINT_SIZE__WIDTH_mask); } @@ -854,11 +854,11 @@ static void r700PointParameter(GLcontext * ctx, GLenum pname, const GLfloat * pa /* format is 12.4 fixed point */ switch (pname) { case GL_POINT_SIZE_MIN: - SETfield(r700->PA_SU_POINT_MINMAX.u32All, (int)(ctx->Point.MinSize * 16.0), + SETfield(r700->PA_SU_POINT_MINMAX.u32All, (int)(ctx->Point.MinSize * 8.0), MIN_SIZE_shift, MIN_SIZE_mask); break; case GL_POINT_SIZE_MAX: - SETfield(r700->PA_SU_POINT_MINMAX.u32All, (int)(ctx->Point.MaxSize * 16.0), + SETfield(r700->PA_SU_POINT_MINMAX.u32All, (int)(ctx->Point.MaxSize * 8.0), MAX_SIZE_shift, MAX_SIZE_mask); break; case GL_POINT_DISTANCE_ATTENUATION: -- cgit v1.2.3 From ed91d103477d563f73be3555d1022ec9af073467 Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Mon, 21 Sep 2009 10:14:25 -0400 Subject: r600: fix some issues with LIT instruction - MUL_LIT is ALU.Trans instruction - some Trans instructions can take 3 arguments - don't clobber dst.x, use dst.z as temp, it'll get written correct value in last insn - respect source swizzles --- src/mesa/drivers/dri/r600/r700_assembler.c | 69 ++++++++++++++++-------------- 1 file changed, 36 insertions(+), 33 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index efeccb25f1..f46bc32201 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -2024,7 +2024,7 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) return GL_FALSE; } - if (pAsm->D.dst.math == 0) + if (uNumSrc > 1) { // Process source 1 current_source_index = 1; @@ -2880,6 +2880,11 @@ GLboolean assemble_LIT(r700_AssemblerBase *pAsm) return GL_FALSE; } + if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + { + return GL_FALSE; + } + /* dst.y = max(src.x, 0.0) */ pAsm->D.dst.opcode = SQ_OP2_INST_MAX; pAsm->D.dst.rtype = dstType; @@ -2891,11 +2896,6 @@ GLboolean assemble_LIT(r700_AssemblerBase *pAsm) pAsm->S[0].src.rtype = srcType; pAsm->S[0].src.reg = srcReg; setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); - noneg_PVSSRC(&(pAsm->S[0].src)); - pAsm->S[0].src.swizzlex = SQ_SEL_X; - pAsm->S[0].src.swizzley = SQ_SEL_X; - pAsm->S[0].src.swizzlez = SQ_SEL_X; - pAsm->S[0].src.swizzlew = SQ_SEL_X; pAsm->S[1].src.rtype = SRC_REG_TEMPORARY; pAsm->S[1].src.reg = tmp; setaddrmode_PVSSRC(&(pAsm->S[1].src), ADDR_ABSOLUTE); @@ -2909,34 +2909,47 @@ GLboolean assemble_LIT(r700_AssemblerBase *pAsm) return GL_FALSE; } - /* before: dst.w = log(src.y) - * after : dst.x = log(src.y) - * why change dest register is that dst.w has been initialized as 1 before - */ + if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + { + return GL_FALSE; + } + + swizzleagain_PVSSRC(&(pAsm->S[0].src), SQ_SEL_Y, SQ_SEL_Y, SQ_SEL_Y, SQ_SEL_Y); + + /* dst.z = log(src.y) */ pAsm->D.dst.opcode = SQ_OP2_INST_LOG_CLAMPED; pAsm->D.dst.math = 1; pAsm->D.dst.rtype = dstType; pAsm->D.dst.reg = dstReg; - pAsm->D.dst.writex = 1; + pAsm->D.dst.writex = 0; pAsm->D.dst.writey = 0; - pAsm->D.dst.writez = 0; + pAsm->D.dst.writez = 1; pAsm->D.dst.writew = 0; pAsm->S[0].src.rtype = srcType; pAsm->S[0].src.reg = srcReg; setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); - noneg_PVSSRC(&(pAsm->S[0].src)); - pAsm->S[0].src.swizzlex = SQ_SEL_Y; - pAsm->S[0].src.swizzley = SQ_SEL_Y; - pAsm->S[0].src.swizzlez = SQ_SEL_Y; - pAsm->S[0].src.swizzlew = SQ_SEL_Y; if( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } - /* before: tmp.x = amd MUL_LIT(src.w, dst.w, src.x ) */ - /* after : tmp.x = amd MUL_LIT(src.w, dst.x, src.x ) */ + if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + { + return GL_FALSE; + } + + if( GL_FALSE == assemble_src(pAsm, 0, 2) ) + { + return GL_FALSE; + } + + swizzleagain_PVSSRC(&(pAsm->S[0].src), SQ_SEL_W, SQ_SEL_W, SQ_SEL_W, SQ_SEL_W); + + swizzleagain_PVSSRC(&(pAsm->S[2].src), SQ_SEL_X, SQ_SEL_X, SQ_SEL_X, SQ_SEL_X); + + /* tmp.x = amd MUL_LIT(src.w, dst.z, src.x ) */ pAsm->D.dst.opcode = SQ_OP3_INST_MUL_LIT; + pAsm->D.dst.math = 1; pAsm->D.dst.op3 = 1; pAsm->D.dst.rtype = DST_REG_TEMPORARY; pAsm->D.dst.reg = tmp; @@ -2948,29 +2961,19 @@ GLboolean assemble_LIT(r700_AssemblerBase *pAsm) pAsm->S[0].src.rtype = srcType; pAsm->S[0].src.reg = srcReg; setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); - noneg_PVSSRC(&(pAsm->S[0].src)); - pAsm->S[0].src.swizzlex = SQ_SEL_W; - pAsm->S[0].src.swizzley = SQ_SEL_W; - pAsm->S[0].src.swizzlez = SQ_SEL_W; - pAsm->S[0].src.swizzlew = SQ_SEL_W; pAsm->S[1].src.rtype = SRC_REG_TEMPORARY; pAsm->S[1].src.reg = dstReg; setaddrmode_PVSSRC(&(pAsm->S[1].src), ADDR_ABSOLUTE); noneg_PVSSRC(&(pAsm->S[1].src)); - pAsm->S[1].src.swizzlex = SQ_SEL_X; - pAsm->S[1].src.swizzley = SQ_SEL_X; - pAsm->S[1].src.swizzlez = SQ_SEL_X; - pAsm->S[1].src.swizzlew = SQ_SEL_X; + pAsm->S[1].src.swizzlex = SQ_SEL_Z; + pAsm->S[1].src.swizzley = SQ_SEL_Z; + pAsm->S[1].src.swizzlez = SQ_SEL_Z; + pAsm->S[1].src.swizzlew = SQ_SEL_Z; pAsm->S[2].src.rtype = srcType; pAsm->S[2].src.reg = srcReg; setaddrmode_PVSSRC(&(pAsm->S[2].src), ADDR_ABSOLUTE); - noneg_PVSSRC(&(pAsm->S[2].src)); - pAsm->S[2].src.swizzlex = SQ_SEL_X; - pAsm->S[2].src.swizzley = SQ_SEL_X; - pAsm->S[2].src.swizzlez = SQ_SEL_X; - pAsm->S[2].src.swizzlew = SQ_SEL_X; if( GL_FALSE == next_ins(pAsm) ) { -- cgit v1.2.3 From 28308c92605229129a12a2273dda47c6a2ca4790 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 21 Sep 2009 16:30:14 -0400 Subject: r600: various cleanups - max texture size is 8k, but mesa doesn't support that at the moment. - attempt to set shader limits to what the hw actually supports - clean up some old r300 cruft - no need to explicitly disable irqs. This is fixed in the drm now. Signed-off-by: Alex Deucher --- src/mesa/drivers/dri/r600/r600_context.c | 43 +++++++++++----------- src/mesa/drivers/dri/r600/r600_context.h | 19 ---------- .../drivers/dri/radeon/radeon_common_context.c | 7 +--- 3 files changed, 24 insertions(+), 45 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index 251c124cbf..414c5aec59 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -281,8 +281,8 @@ GLboolean r600CreateContext(const __GLcontextModes * glVisual, ctx->Const.MaxTextureMaxAnisotropy = 16.0; ctx->Const.MaxTextureLodBias = 16.0; - ctx->Const.MaxTextureLevels = 13; - ctx->Const.MaxTextureRectSize = 4096; + ctx->Const.MaxTextureLevels = 13; /* hw support 14 */ + ctx->Const.MaxTextureRectSize = 4096; /* hw support 8192 */ ctx->Const.MinPointSize = 0x0001 / 8.0; ctx->Const.MinPointSizeAA = 0x0001 / 8.0; @@ -328,25 +328,26 @@ GLboolean r600CreateContext(const __GLcontextModes * glVisual, _tnl_allow_vertex_fog(ctx, GL_TRUE); /* currently bogus data */ - ctx->Const.VertexProgram.MaxInstructions = VSF_MAX_FRAGMENT_LENGTH / 4; - ctx->Const.VertexProgram.MaxNativeInstructions = - VSF_MAX_FRAGMENT_LENGTH / 4; - ctx->Const.VertexProgram.MaxNativeAttribs = 16; /* r420 */ - ctx->Const.VertexProgram.MaxTemps = 32; - ctx->Const.VertexProgram.MaxNativeTemps = - /*VSF_MAX_FRAGMENT_TEMPS */ 32; - ctx->Const.VertexProgram.MaxNativeParameters = 256; /* r420 */ - ctx->Const.VertexProgram.MaxNativeAddressRegs = 1; - - ctx->Const.FragmentProgram.MaxNativeTemps = PFS_NUM_TEMP_REGS; - ctx->Const.FragmentProgram.MaxNativeAttribs = 11; /* copy i915... */ - ctx->Const.FragmentProgram.MaxNativeParameters = PFS_NUM_CONST_REGS; - ctx->Const.FragmentProgram.MaxNativeAluInstructions = PFS_MAX_ALU_INST; - ctx->Const.FragmentProgram.MaxNativeTexInstructions = PFS_MAX_TEX_INST; - ctx->Const.FragmentProgram.MaxNativeInstructions = - PFS_MAX_ALU_INST + PFS_MAX_TEX_INST; - ctx->Const.FragmentProgram.MaxNativeTexIndirections = - PFS_MAX_TEX_INDIRECT; + ctx->Const.VertexProgram.MaxInstructions = 8192; /* in theory no limit */ + ctx->Const.VertexProgram.MaxNativeInstructions = 8192; + ctx->Const.VertexProgram.MaxNativeAttribs = 160; + ctx->Const.VertexProgram.MaxTemps = 256; /* 256 for reg-based constants, inline consts also supported */ + ctx->Const.VertexProgram.MaxNativeTemps = 256; + ctx->Const.VertexProgram.MaxNativeParameters = 256; /* ??? */ + ctx->Const.VertexProgram.MaxNativeAddressRegs = 1; /* ??? */ + + ctx->Const.FragmentProgram.MaxNativeTemps = 256; + ctx->Const.FragmentProgram.MaxNativeAttribs = 32; + ctx->Const.FragmentProgram.MaxNativeParameters = 256; + ctx->Const.FragmentProgram.MaxNativeAluInstructions = 8192; + /* 8 per clause on r6xx, 16 on rv670/r7xx */ + if ((screen->chip_family == CHIP_FAMILY_RV670) || + (screen->chip_family >= CHIP_FAMILY_RV770)) + ctx->Const.FragmentProgram.MaxNativeTexInstructions = 16; + else + ctx->Const.FragmentProgram.MaxNativeTexInstructions = 8; + ctx->Const.FragmentProgram.MaxNativeInstructions = 8192; + ctx->Const.FragmentProgram.MaxNativeTexIndirections = 8; /* ??? */ ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; /* and these are?? */ ctx->VertexProgram._MaintainTnlProgram = GL_TRUE; ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE; diff --git a/src/mesa/drivers/dri/r600/r600_context.h b/src/mesa/drivers/dri/r600/r600_context.h index c59df7505a..9397ecde81 100644 --- a/src/mesa/drivers/dri/r600/r600_context.h +++ b/src/mesa/drivers/dri/r600/r600_context.h @@ -86,29 +86,10 @@ extern int hw_tcl_on; #include "tnl_dd/t_dd_vertex.h" #undef TAG -#define PFS_MAX_ALU_INST 64 -#define PFS_MAX_TEX_INST 64 -#define PFS_MAX_TEX_INDIRECT 4 -#define PFS_NUM_TEMP_REGS 32 -#define PFS_NUM_CONST_REGS 16 - -#define R600_MAX_AOS_ARRAYS 16 - -#define REG_COORDS 0 -#define REG_COLOR0 1 -#define REG_TEX0 2 - #define R600_FALLBACK_NONE 0 #define R600_FALLBACK_TCL 1 #define R600_FALLBACK_RAST 2 -enum -{ - NO_SHIFT = 0, - LEFT_SHIFT = 1, - RIGHT_SHIFT = 2, -}; - struct r600_hw_state { struct radeon_state_atom sq; struct radeon_state_atom db; diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.c b/src/mesa/drivers/dri/radeon/radeon_common_context.c index 71ee06d9a7..330721acee 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.c @@ -227,11 +227,8 @@ GLboolean radeonInitContext(radeonContextPtr radeon, fthrottle_mode = driQueryOptioni(&radeon->optionCache, "fthrottle_mode"); radeon->iw.irq_seq = -1; radeon->irqsEmitted = 0; - if (IS_R600_CLASS(radeon->radeonScreen)) - radeon->do_irqs = 0; - else - radeon->do_irqs = (fthrottle_mode == DRI_CONF_FTHROTTLE_IRQS && - radeon->radeonScreen->irq); + radeon->do_irqs = (fthrottle_mode == DRI_CONF_FTHROTTLE_IRQS && + radeon->radeonScreen->irq); radeon->do_usleeps = (fthrottle_mode == DRI_CONF_FTHROTTLE_USLEEPS); -- cgit v1.2.3 From 639fb1472d09281a8df3792c9bcbc59cd4424688 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 21 Sep 2009 16:48:55 -0400 Subject: r600: fix typo in the last commit 128 gprs, 256 reg-based consts --- src/mesa/drivers/dri/r600/r600_context.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index 414c5aec59..e0b77d4385 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -327,16 +327,16 @@ GLboolean r600CreateContext(const __GLcontextModes * glVisual, _tnl_allow_pixel_fog(ctx, GL_FALSE); _tnl_allow_vertex_fog(ctx, GL_TRUE); - /* currently bogus data */ + /* 256 for reg-based consts, inline consts also supported */ ctx->Const.VertexProgram.MaxInstructions = 8192; /* in theory no limit */ ctx->Const.VertexProgram.MaxNativeInstructions = 8192; ctx->Const.VertexProgram.MaxNativeAttribs = 160; - ctx->Const.VertexProgram.MaxTemps = 256; /* 256 for reg-based constants, inline consts also supported */ - ctx->Const.VertexProgram.MaxNativeTemps = 256; - ctx->Const.VertexProgram.MaxNativeParameters = 256; /* ??? */ + ctx->Const.VertexProgram.MaxTemps = 128; + ctx->Const.VertexProgram.MaxNativeTemps = 128; + ctx->Const.VertexProgram.MaxNativeParameters = 256; ctx->Const.VertexProgram.MaxNativeAddressRegs = 1; /* ??? */ - ctx->Const.FragmentProgram.MaxNativeTemps = 256; + ctx->Const.FragmentProgram.MaxNativeTemps = 128; ctx->Const.FragmentProgram.MaxNativeAttribs = 32; ctx->Const.FragmentProgram.MaxNativeParameters = 256; ctx->Const.FragmentProgram.MaxNativeAluInstructions = 8192; -- cgit v1.2.3 From 2058dfaa47704abc62aa5aa9719013624f26764d Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Wed, 23 Sep 2009 14:20:59 +0300 Subject: r600: add support for CUBE textures, also TXP seems to work here ... --- src/mesa/drivers/dri/r600/r700_assembler.c | 306 ++++++++++++++++++++++++----- src/mesa/drivers/dri/r600/r700_assembler.h | 4 + 2 files changed, 263 insertions(+), 47 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index f46bc32201..00eda544d4 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -213,7 +213,7 @@ GLboolean is_reduction_opcode(PVSDWORD* dest) { if (dest->dst.op3 == 0) { - if ( (dest->dst.opcode == SQ_OP2_INST_DOT4 || dest->dst.opcode == SQ_OP2_INST_DOT4_IEEE) ) + if ( (dest->dst.opcode == SQ_OP2_INST_DOT4 || dest->dst.opcode == SQ_OP2_INST_DOT4_IEEE || dest->dst.opcode == SQ_OP2_INST_CUBE) ) { return GL_TRUE; } @@ -350,6 +350,7 @@ unsigned int r700GetNumOperands(r700_AssemblerBase* pAsm) case SQ_OP2_INST_PRED_SETNE: case SQ_OP2_INST_DOT4: case SQ_OP2_INST_DOT4_IEEE: + case SQ_OP2_INST_CUBE: return 2; case SQ_OP2_INST_MOV: @@ -469,6 +470,9 @@ int Init_r700_AssemblerBase(SHADER_PIPE_TYPE spt, r700_AssemblerBase* pAsm, R700 pAsm->number_of_inputs = 0; + pAsm->is_tex = GL_FALSE; + pAsm->need_tex_barrier = GL_FALSE; + return 0; } @@ -682,7 +686,7 @@ GLboolean add_tex_instruction(r700_AssemblerBase* pAsm, // If this clause constains any TEX instruction that is dependent on a previous instruction, // set the barrier bit - if( pAsm->pInstDeps[pAsm->uiCurInst].nDstDep > (-1) ) + if( pAsm->pInstDeps[pAsm->uiCurInst].nDstDep > (-1) || pAsm->need_tex_barrier == GL_TRUE ) { pAsm->cf_current_tex_clause_ptr->m_Word1.f.barrier = 0x1; } @@ -1152,42 +1156,48 @@ GLboolean tex_src(r700_AssemblerBase *pAsm) GLboolean bValidTexCoord = GL_FALSE; + if(pAsm->aArgSubst[1] >= 0) + { + bValidTexCoord = GL_TRUE; + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[0].src.reg = pAsm->aArgSubst[1]; + } + else + { switch (pILInst->SrcReg[0].File) { - case PROGRAM_CONSTANT: - case PROGRAM_LOCAL_PARAM: - case PROGRAM_ENV_PARAM: - case PROGRAM_STATE_VAR: - bValidTexCoord = GL_TRUE; - setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); - pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; - pAsm->S[0].src.reg = pAsm->aArgSubst[1]; - break; - case PROGRAM_TEMPORARY: - bValidTexCoord = GL_TRUE; - pAsm->S[0].src.reg = pILInst->SrcReg[0].Index + - pAsm->starting_temp_register_number; - pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; - break; - case PROGRAM_INPUT: - switch (pILInst->SrcReg[0].Index) - { - case FRAG_ATTRIB_COL0: - case FRAG_ATTRIB_COL1: - case FRAG_ATTRIB_TEX0: - case FRAG_ATTRIB_TEX1: - case FRAG_ATTRIB_TEX2: - case FRAG_ATTRIB_TEX3: - case FRAG_ATTRIB_TEX4: - case FRAG_ATTRIB_TEX5: - case FRAG_ATTRIB_TEX6: - case FRAG_ATTRIB_TEX7: - bValidTexCoord = GL_TRUE; - pAsm->S[0].src.reg = - pAsm->uiFP_AttributeMap[pILInst->SrcReg[0].Index]; - pAsm->S[0].src.rtype = SRC_REG_INPUT; - break; - } - break; + case PROGRAM_CONSTANT: + case PROGRAM_LOCAL_PARAM: + case PROGRAM_ENV_PARAM: + case PROGRAM_STATE_VAR: + break; + case PROGRAM_TEMPORARY: + bValidTexCoord = GL_TRUE; + pAsm->S[0].src.reg = pILInst->SrcReg[0].Index + + pAsm->starting_temp_register_number; + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + break; + case PROGRAM_INPUT: + switch (pILInst->SrcReg[0].Index) + { + case FRAG_ATTRIB_COL0: + case FRAG_ATTRIB_COL1: + case FRAG_ATTRIB_TEX0: + case FRAG_ATTRIB_TEX1: + case FRAG_ATTRIB_TEX2: + case FRAG_ATTRIB_TEX3: + case FRAG_ATTRIB_TEX4: + case FRAG_ATTRIB_TEX5: + case FRAG_ATTRIB_TEX6: + case FRAG_ATTRIB_TEX7: + bValidTexCoord = GL_TRUE; + pAsm->S[0].src.reg = + pAsm->uiFP_AttributeMap[pILInst->SrcReg[0].Index]; + pAsm->S[0].src.rtype = SRC_REG_INPUT; + break; + } + break; + } } if(GL_TRUE == bValidTexCoord) @@ -1955,7 +1965,9 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) { is_single_scalar_operation = GL_FALSE; number_of_scalar_operations = 4; - + +/* current assembler doesn't do more than 1 register per source */ +#if 0 /* check read port, only very preliminary algorithm, not count in src0/1 same comp case and prev slot repeat case; also not count relative addressing. TODO: improve performance. */ @@ -1990,6 +2002,7 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) { bSplitInst = GL_TRUE; } +#endif } contiguous_slots_needed = 0; @@ -2210,9 +2223,7 @@ GLboolean next_ins(r700_AssemblerBase *pAsm) { struct prog_instruction *pILInst = &(pAsm->pILInst[pAsm->uiCurInst]); - if( GL_TRUE == IsTex(pILInst->Opcode) && - /* handle const moves to temp register */ - !(pAsm->D.dst.opcode == SQ_OP2_INST_MOV) ) + if( GL_TRUE == pAsm->is_tex ) { if (pILInst->TexSrcTarget == TEXTURE_RECT_INDEX) { if( GL_FALSE == assemble_tex_instruction(pAsm, GL_FALSE) ) @@ -2256,7 +2267,8 @@ GLboolean next_ins(r700_AssemblerBase *pAsm) pAsm->S[0].bits = 0; pAsm->S[1].bits = 0; pAsm->S[2].bits = 0; - + pAsm->is_tex = GL_FALSE; + pAsm->need_tex_barrier = GL_FALSE; return GL_TRUE; } @@ -3379,7 +3391,10 @@ GLboolean assemble_STP(r700_AssemblerBase *pAsm) GLboolean assemble_TEX(r700_AssemblerBase *pAsm) { GLboolean src_const; + GLboolean need_barrier = GL_FALSE; + checkop1(pAsm); + switch (pAsm->pILInst[pAsm->uiCurInst].SrcReg[0].File) { case PROGRAM_CONSTANT: @@ -3399,20 +3414,18 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) { if ( GL_FALSE == mov_temp(pAsm, 0) ) return GL_FALSE; + need_barrier = GL_TRUE; } switch (pAsm->pILInst[pAsm->uiCurInst].Opcode) { case OPCODE_TEX: - pAsm->D.dst.opcode = SQ_TEX_INST_SAMPLE; break; case OPCODE_TXB: radeon_error("do not support TXB yet\n"); return GL_FALSE; break; case OPCODE_TXP: - /* TODO : tex proj version : divid first 3 components by 4th */ - pAsm->D.dst.opcode = SQ_TEX_INST_SAMPLE; break; default: radeon_error("Internal error: bad texture op (not TEX)\n"); @@ -3420,6 +3433,190 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) break; } + if (pAsm->pILInst[pAsm->uiCurInst].Opcode == OPCODE_TXP) + { + GLuint tmp = gethelpr(pAsm); + pAsm->D.dst.opcode = SQ_OP2_INST_RECIP_IEEE; + pAsm->D.dst.math = 1; + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = tmp; + pAsm->D.dst.writew = 1; + + if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + { + return GL_FALSE; + } + swizzleagain_PVSSRC(&(pAsm->S[0].src), SQ_SEL_W, SQ_SEL_W, SQ_SEL_W, SQ_SEL_W); + if( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } + + pAsm->D.dst.opcode = SQ_OP2_INST_MUL; + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = tmp; + pAsm->D.dst.writex = 1; + pAsm->D.dst.writey = 1; + pAsm->D.dst.writez = 1; + pAsm->D.dst.writew = 0; + + if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + { + return GL_FALSE; + } + setaddrmode_PVSSRC(&(pAsm->S[1].src), ADDR_ABSOLUTE); + pAsm->S[1].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[1].src.reg = tmp; + setswizzle_PVSSRC(&(pAsm->S[1].src), SQ_SEL_W); + + if( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } + + pAsm->aArgSubst[1] = tmp; + need_barrier = GL_TRUE; + } + + if (pAsm->pILInst[pAsm->uiCurInst].TexSrcTarget == TEXTURE_CUBE_INDEX ) + { + GLuint tmp1 = gethelpr(pAsm); + GLuint tmp2 = gethelpr(pAsm); + + /* tmp1.xyzw = CUBE(R0.zzxy, R0.yxzz) */ + pAsm->D.dst.opcode = SQ_OP2_INST_CUBE; + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = tmp1; + nomask_PVSDST(&(pAsm->D.dst)); + + if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + { + return GL_FALSE; + } + + if( GL_FALSE == assemble_src(pAsm, 0, 1) ) + { + return GL_FALSE; + } + + swizzleagain_PVSSRC(&(pAsm->S[0].src), SQ_SEL_Z, SQ_SEL_Z, SQ_SEL_X, SQ_SEL_Y); + swizzleagain_PVSSRC(&(pAsm->S[1].src), SQ_SEL_Y, SQ_SEL_X, SQ_SEL_Z, SQ_SEL_Z); + + if( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } + + /* tmp1.z = ABS(tmp1.z) dont have abs support in assembler currently + * have to do explicit instruction + */ + pAsm->D.dst.opcode = SQ_OP2_INST_MAX; + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = tmp1; + pAsm->D.dst.writez = 1; + + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[0].src.reg = tmp1; + noswizzle_PVSSRC(&(pAsm->S[0].src)); + pAsm->S[1].bits = pAsm->S[0].bits; + flipneg_PVSSRC(&(pAsm->S[1].src)); + + next_ins(pAsm); + + /* tmp1.z = RCP_e(|tmp1.z|) */ + pAsm->D.dst.opcode = SQ_OP2_INST_RECIP_IEEE; + pAsm->D.dst.math = 1; + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = tmp1; + pAsm->D.dst.writez = 1; + + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[0].src.reg = tmp1; + pAsm->S[0].src.swizzlex = SQ_SEL_Z; + + next_ins(pAsm); + + /* MULADD R0.x, R0.x, PS1, (0x3FC00000, 1.5f).x + * MULADD R0.y, R0.y, PS1, (0x3FC00000, 1.5f).x + * muladd has no writemask, have to use another temp + * also no support for imm constants, so add 1 here + */ + pAsm->D.dst.opcode = SQ_OP3_INST_MULADD; + pAsm->D.dst.op3 = 1; + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = tmp2; + + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[0].src.reg = tmp1; + noswizzle_PVSSRC(&(pAsm->S[0].src)); + setaddrmode_PVSSRC(&(pAsm->S[1].src), ADDR_ABSOLUTE); + pAsm->S[1].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[1].src.reg = tmp1; + setswizzle_PVSSRC(&(pAsm->S[1].src), SQ_SEL_Z); + setaddrmode_PVSSRC(&(pAsm->S[2].src), ADDR_ABSOLUTE); + pAsm->S[2].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[2].src.reg = tmp1; + setswizzle_PVSSRC(&(pAsm->S[2].src), SQ_SEL_1); + + next_ins(pAsm); + + /* ADD the remaining .5 */ + pAsm->D.dst.opcode = SQ_OP2_INST_ADD; + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = tmp2; + pAsm->D.dst.writex = 1; + pAsm->D.dst.writey = 1; + pAsm->D.dst.writez = 0; + pAsm->D.dst.writew = 0; + + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[0].src.reg = tmp2; + noswizzle_PVSSRC(&(pAsm->S[0].src)); + setaddrmode_PVSSRC(&(pAsm->S[1].src), ADDR_ABSOLUTE); + pAsm->S[1].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[1].src.reg = 252; // SQ_ALU_SRC_0_5 + noswizzle_PVSSRC(&(pAsm->S[1].src)); + + next_ins(pAsm); + + /* tmp1.xy = temp2.xy */ + pAsm->D.dst.opcode = SQ_OP2_INST_MOV; + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = tmp1; + pAsm->D.dst.writex = 1; + pAsm->D.dst.writey = 1; + pAsm->D.dst.writez = 0; + pAsm->D.dst.writew = 0; + + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[0].src.reg = tmp2; + noswizzle_PVSSRC(&(pAsm->S[0].src)); + + next_ins(pAsm); + pAsm->aArgSubst[1] = tmp1; + need_barrier = GL_TRUE; + + } + + pAsm->D.dst.opcode = SQ_TEX_INST_SAMPLE; + pAsm->is_tex = GL_TRUE; + if ( GL_TRUE == need_barrier ) + { + pAsm->need_tex_barrier = GL_TRUE; + } // Set src1 to tex unit id pAsm->S[1].src.reg = pAsm->pILInst[pAsm->uiCurInst].TexSrcUnit; pAsm->S[1].src.rtype = SRC_REG_TEMPORARY; @@ -3440,10 +3637,25 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) return GL_FALSE; } - if ( GL_FALSE == next_ins(pAsm) ) + if(pAsm->pILInst[pAsm->uiCurInst].Opcode == OPCODE_TXP) { - return GL_FALSE; + /* hopefully did swizzles before */ + noswizzle_PVSSRC(&(pAsm->S[0].src)); } + + if(pAsm->pILInst[pAsm->uiCurInst].TexSrcTarget == TEXTURE_CUBE_INDEX) + { + /* SAMPLE dst, tmp.yxwy, CUBE */ + pAsm->S[0].src.swizzlex = SQ_SEL_Y; + pAsm->S[0].src.swizzley = SQ_SEL_X; + pAsm->S[0].src.swizzlez = SQ_SEL_W; + pAsm->S[0].src.swizzlew = SQ_SEL_Y; + } + + if ( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } return GL_TRUE; } diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index f9c4d849c6..73bb8bac55 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -374,6 +374,10 @@ typedef struct r700_AssemblerBase struct prog_instruction * pILInst; GLuint uiCurInst; GLboolean bR6xx; + /* helper to decide which type of instruction to assemble */ + GLboolean is_tex; + /* we inserted helper intructions and need barrier on next TEX ins */ + GLboolean need_tex_barrier; } r700_AssemblerBase; //Internal use -- cgit v1.2.3 From 41c5f113b5d41649db2027c3f32deaf4d38035ce Mon Sep 17 00:00:00 2001 From: Richard Li Date: Thu, 24 Sep 2009 10:12:40 -0400 Subject: r600 : disable draw_prim for now. --- src/mesa/drivers/dri/r600/r700_render.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c index bbe364bc6a..5627984cf9 100644 --- a/src/mesa/drivers/dri/r600/r700_render.c +++ b/src/mesa/drivers/dri/r600/r700_render.c @@ -1145,8 +1145,11 @@ static void r700DrawPrims(GLcontext *ctx, void r700InitDraw(GLcontext *ctx) { struct vbo_context *vbo = vbo_context(ctx); - + + /* to be enabled */ + /* vbo->draw_prims = r700DrawPrims; + */ } -- cgit v1.2.3 From 5f06064b616099712dbb2854351d0740c1dbfc60 Mon Sep 17 00:00:00 2001 From: Richard Li Date: Thu, 24 Sep 2009 11:26:15 -0400 Subject: r600 : fix draw_prim bug: vertex fetcher setting. --- src/mesa/drivers/dri/r600/r700_chip.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index 783427a94c..e3b8a4081a 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -254,9 +254,22 @@ static void r700SetupVTXConstants2(GLcontext * ctx, SETfield(uSQ_VTX_CONSTANT_WORD2_0, GetSurfaceFormat(pStreamDesc->type, pStreamDesc->size, NULL), SQ_VTX_CONSTANT_WORD2_0__DATA_FORMAT_shift, SQ_VTX_CONSTANT_WORD2_0__DATA_FORMAT_mask); /* TODO : trace back api for initial data type, not only GL_FLOAT */ - SETfield(uSQ_VTX_CONSTANT_WORD2_0, SQ_NUM_FORMAT_SCALED, - SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_shift, SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_mask); - SETbit(uSQ_VTX_CONSTANT_WORD2_0, SQ_VTX_CONSTANT_WORD2_0__FORMAT_COMP_ALL_bit); + + if(GL_TRUE == pStreamDesc->normalize) + { + SETfield(uSQ_VTX_CONSTANT_WORD2_0, SQ_NUM_FORMAT_NORM, + SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_shift, SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_mask); + } + //else + //{ + // SETfield(uSQ_VTX_CONSTANT_WORD2_0, SQ_NUM_FORMAT_INT, + // SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_shift, SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_mask); + //} + + if(1 == pStreamDesc->_signed) + { + SETbit(uSQ_VTX_CONSTANT_WORD2_0, SQ_VTX_CONSTANT_WORD2_0__FORMAT_COMP_ALL_bit); + } SETfield(uSQ_VTX_CONSTANT_WORD3_0, 1, MEM_REQUEST_SIZE_shift, MEM_REQUEST_SIZE_mask); SETfield(uSQ_VTX_CONSTANT_WORD6_0, SQ_TEX_VTX_VALID_BUFFER, -- cgit v1.2.3 From e44c084be536c021985a8908db4300c764c63bbc Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 23 Sep 2009 15:44:02 -0600 Subject: glsl: fix missing initializers warning --- src/mesa/shader/slang/slang_builtin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/slang/slang_builtin.c b/src/mesa/shader/slang/slang_builtin.c index bef0f85653..e5809509c9 100644 --- a/src/mesa/shader/slang/slang_builtin.c +++ b/src/mesa/shader/slang/slang_builtin.c @@ -741,7 +741,7 @@ static const struct input_info vertInputs[] = { { "gl_MultiTexCoord5", VERT_ATTRIB_TEX5, GL_FLOAT_VEC4, SWIZZLE_NOOP }, { "gl_MultiTexCoord6", VERT_ATTRIB_TEX6, GL_FLOAT_VEC4, SWIZZLE_NOOP }, { "gl_MultiTexCoord7", VERT_ATTRIB_TEX7, GL_FLOAT_VEC4, SWIZZLE_NOOP }, - { NULL, 0, SWIZZLE_NOOP } + { NULL, 0, GL_NONE, SWIZZLE_NOOP } }; /** Predefined fragment shader inputs */ @@ -754,7 +754,7 @@ static const struct input_info fragInputs[] = { { "gl_FogFragCoord", FRAG_ATTRIB_FOGC, GL_FLOAT, SWIZZLE_XXXX }, { "gl_FrontFacing", FRAG_ATTRIB_FACE, GL_FLOAT, SWIZZLE_XXXX }, { "gl_PointCoord", FRAG_ATTRIB_PNTC, GL_FLOAT_VEC2, SWIZZLE_XYZW }, - { NULL, 0, SWIZZLE_NOOP } + { NULL, 0, GL_NONE, SWIZZLE_NOOP } }; -- cgit v1.2.3 From 00ddd4f9e9680132872f98f2d18b52dfc30c6f2f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 23 Sep 2009 15:44:18 -0600 Subject: glsl: init var to silence warning --- src/mesa/shader/slang/slang_codegen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 349f432dec..703af9f874 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -2775,7 +2775,7 @@ _slang_gen_while(slang_assemble_ctx * A, slang_operation *oper) * body code (child[1]) */ slang_ir_node *loop, *breakIf, *body; - GLboolean isConst, constTrue; + GLboolean isConst, constTrue = GL_FALSE; if (!A->EmitContReturn) { /* We don't want to emit CONT instructions. If this while-loop has -- cgit v1.2.3 From a491e25b1fa8683f538ed0d67a6389f2cdf7e4bc Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 23 Sep 2009 15:44:37 -0600 Subject: mesa: added default case return to silence warning --- src/mesa/main/texenvprogram.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index 2f3e47e69e..d7e77e759e 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -276,6 +276,7 @@ need_saturate( GLuint mode ) return GL_TRUE; default: assert(0); + return GL_FALSE; } } -- cgit v1.2.3 From 1d2dca194cebe6e25735b6820f85b8d1231aae63 Mon Sep 17 00:00:00 2001 From: Pauli Nieminen Date: Thu, 24 Sep 2009 19:58:09 +0300 Subject: radeon: Fix scissors for r600 KMS. Radeon generic scissors code had problem that some of code was using exclusive and some inclusive bottom right corner. Only r600 driver is using exclusive coordinate so changed generic code to pass inclusive coordinate and r600 driver changes BR coordinate to be exclusive. --- src/mesa/drivers/dri/r600/r700_state.c | 5 +++-- src/mesa/drivers/dri/radeon/radeon_common.c | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index 8571563149..124469b5a6 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -1269,10 +1269,11 @@ void r700SetScissor(context_t *context) //--------------- return; } if (context->radeon.state.scissor.enabled) { + /* r600 has exclusive scissors */ x1 = context->radeon.state.scissor.rect.x1; y1 = context->radeon.state.scissor.rect.y1; - x2 = context->radeon.state.scissor.rect.x2; - y2 = context->radeon.state.scissor.rect.y2; + x2 = context->radeon.state.scissor.rect.x2 + 1; + y2 = context->radeon.state.scissor.rect.y2 + 1; } else { if (context->radeon.radeonScreen->driScreen->dri2.enabled) { x1 = 0; diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c b/src/mesa/drivers/dri/radeon/radeon_common.c index a4c7b40798..9817ff856b 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common.c +++ b/src/mesa/drivers/dri/radeon/radeon_common.c @@ -232,13 +232,13 @@ void radeonUpdateScissor( GLcontext *ctx ) __DRIdrawablePrivate *dPriv = radeon_get_drawable(rmesa); x1 += dPriv->x; - x2 += dPriv->x + 1; + x2 += dPriv->x; min_x += dPriv->x; - max_x += dPriv->x + 1; + max_x += dPriv->x; y1 += dPriv->y; - y2 += dPriv->y + 1; + y2 += dPriv->y; min_y += dPriv->y; - max_y += dPriv->y + 1; + max_y += dPriv->y; } rmesa->state.scissor.rect.x1 = CLAMP(x1, min_x, max_x); -- cgit v1.2.3 From 1a816117258e594a073f6925edfcd2387071904d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 24 Sep 2009 12:35:51 -0600 Subject: vbo: limit number of warnings to 10 Otherwise some apps will emit tons of warnings. --- src/mesa/vbo/vbo_exec_array.c | 43 +++++++++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 18 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index 3f0656a816..39c2957631 100644 --- a/src/mesa/vbo/vbo_exec_array.c +++ b/src/mesa/vbo/vbo_exec_array.c @@ -667,6 +667,7 @@ vbo_exec_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices) { + static GLuint warnCount = 0; GET_CURRENT_CONTEXT(ctx); if (!_mesa_validate_DrawRangeElements( ctx, mode, start, end, count, @@ -675,15 +676,19 @@ vbo_exec_DrawRangeElements(GLenum mode, if (end >= ctx->Array.ArrayObj->_MaxElement) { /* the max element is out of bounds of one or more enabled arrays */ - _mesa_warning(ctx, "glDraw[Range]Elements(start %u, end %u, count %d, " - "type 0x%x, indices=%p)\n" - "\tend is out of bounds (max=%u) " - "Element Buffer %u (size %d)\n" - "\tThis should probably be fixed in the application.", - start, end, count, type, indices, - ctx->Array.ArrayObj->_MaxElement - 1, - ctx->Array.ElementArrayBufferObj->Name, - ctx->Array.ElementArrayBufferObj->Size); + warnCount++; + + if (warnCount < 10) { + _mesa_warning(ctx, "glDraw[Range]Elements(start %u, end %u, count %d, " + "type 0x%x, indices=%p)\n" + "\tend is out of bounds (max=%u) " + "Element Buffer %u (size %d)\n" + "\tThis should probably be fixed in the application.", + start, end, count, type, indices, + ctx->Array.ArrayObj->_MaxElement - 1, + ctx->Array.ElementArrayBufferObj->Name, + ctx->Array.ElementArrayBufferObj->Size); + } if (0) dump_element_buffer(ctx, type); @@ -700,15 +705,17 @@ vbo_exec_DrawRangeElements(GLenum mode, GLuint max = _mesa_max_buffer_index(ctx, count, type, indices, ctx->Array.ElementArrayBufferObj); if (max >= ctx->Array.ArrayObj->_MaxElement) { - _mesa_warning(ctx, "glDraw[Range]Elements(start %u, end %u, " - "count %d, type 0x%x, indices=%p)\n" - "\tindex=%u is out of bounds (max=%u) " - "Element Buffer %u (size %d)\n" - "\tSkipping the glDrawRangeElements() call", - start, end, count, type, indices, max, - ctx->Array.ArrayObj->_MaxElement - 1, - ctx->Array.ElementArrayBufferObj->Name, - ctx->Array.ElementArrayBufferObj->Size); + if (warnCount < 10) { + _mesa_warning(ctx, "glDraw[Range]Elements(start %u, end %u, " + "count %d, type 0x%x, indices=%p)\n" + "\tindex=%u is out of bounds (max=%u) " + "Element Buffer %u (size %d)\n" + "\tSkipping the glDrawRangeElements() call", + start, end, count, type, indices, max, + ctx->Array.ArrayObj->_MaxElement - 1, + ctx->Array.ElementArrayBufferObj->Name, + ctx->Array.ElementArrayBufferObj->Size); + } return; } /* XXX we could also find the min index and compare to 'start' -- cgit v1.2.3 From 964792b0250ece9fe585a4a02544f0e9c4d453a0 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 24 Sep 2009 12:37:06 -0600 Subject: mesa: added comment --- src/mesa/shader/prog_parameter.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index 6b9e73b2cb..2f029b02e5 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -100,6 +100,7 @@ _mesa_free_parameter_list(struct gl_program_parameter_list *paramList) * \param type type of parameter, such as * \param name the parameter name, will be duplicated/copied! * \param size number of elements in 'values' vector (1..4, or more) + * \param datatype GL_FLOAT, GL_FLOAT_VECx, GL_INT, GL_INT_VECx or GL_NONE. * \param values initial parameter value, up to 4 GLfloats, or NULL * \param state state indexes, or NULL * \return index of new parameter in the list, or -1 if error (out of mem) -- cgit v1.2.3 From f0339f502cf96499bc5cac8c0611f76f3fd39461 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 24 Sep 2009 12:37:34 -0600 Subject: mesa: replace assertion with no-op function assignment --- src/mesa/main/texrender.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c index cc74d58fbd..53be83b05c 100644 --- a/src/mesa/main/texrender.c +++ b/src/mesa/main/texrender.c @@ -397,6 +397,14 @@ texture_put_mono_values(GLcontext *ctx, struct gl_renderbuffer *rb, } +static void +store_nop(struct gl_texture_image *texImage, + GLint col, GLint row, GLint img, + const void *texel) +{ +} + + static void delete_texture_wrapper(struct gl_renderbuffer *rb) { @@ -462,7 +470,10 @@ update_wrapper(GLcontext *ctx, const struct gl_renderbuffer_attachment *att) ASSERT(trb->TexImage); trb->Store = trb->TexImage->TexFormat->StoreTexel; - ASSERT(trb->Store); + if (!trb->Store) { + /* we'll never draw into some textures (compressed formats) */ + trb->Store = store_nop; + } if (att->Texture->Target == GL_TEXTURE_1D_ARRAY_EXT) { trb->Yoffset = att->Zoffset; -- cgit v1.2.3 From b849c6f1b3b38a68fae32d4dea16dd7431e41b6e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 24 Sep 2009 12:41:14 -0600 Subject: intel: use default array/element buffers in intel_generate_mipmap() If there happened to be a bound VBO when intel_generate_mipmap() was called we blew up because of a bad vertex array pointer. Fixes regnumonline, bug 23859. --- src/mesa/drivers/dri/intel/intel_generatemipmap.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_generatemipmap.c b/src/mesa/drivers/dri/intel/intel_generatemipmap.c index fe986092db..12059e122c 100644 --- a/src/mesa/drivers/dri/intel/intel_generatemipmap.c +++ b/src/mesa/drivers/dri/intel/intel_generatemipmap.c @@ -125,6 +125,8 @@ intel_generate_mipmap_2d(GLcontext *ctx, GLuint fb_name; GLboolean success = GL_FALSE; struct gl_framebuffer *saved_fbo = NULL; + struct gl_buffer_object *saved_array_buffer = NULL; + struct gl_buffer_object *saved_element_buffer = NULL; _mesa_PushAttrib(GL_ENABLE_BIT | GL_TEXTURE_BIT | GL_CURRENT_BIT | GL_COLOR_BUFFER_BIT | @@ -133,6 +135,16 @@ intel_generate_mipmap_2d(GLcontext *ctx, old_active_texture = ctx->Texture.CurrentUnit; _mesa_reference_framebuffer(&saved_fbo, ctx->DrawBuffer); + /* use default array/index buffers */ + _mesa_reference_buffer_object(ctx, &saved_array_buffer, + ctx->Array.ArrayBufferObj); + _mesa_reference_buffer_object(ctx, &ctx->Array.ArrayBufferObj, + ctx->Shared->NullBufferObj); + _mesa_reference_buffer_object(ctx, &saved_element_buffer, + ctx->Array.ElementArrayBufferObj); + _mesa_reference_buffer_object(ctx, &ctx->Array.ElementArrayBufferObj, + ctx->Shared->NullBufferObj); + _mesa_Disable(GL_POLYGON_STIPPLE); _mesa_Disable(GL_DEPTH_TEST); _mesa_Disable(GL_STENCIL_TEST); @@ -205,6 +217,15 @@ fail: meta_restore_fragment_program(&intel->meta); meta_restore_vertex_program(&intel->meta); + /* restore array/index buffers */ + _mesa_reference_buffer_object(ctx, &ctx->Array.ArrayBufferObj, + saved_array_buffer); + _mesa_reference_buffer_object(ctx, &saved_array_buffer, NULL); + _mesa_reference_buffer_object(ctx, &ctx->Array.ElementArrayBufferObj, + saved_element_buffer); + _mesa_reference_buffer_object(ctx, &saved_element_buffer, NULL); + + _mesa_DeleteFramebuffersEXT(1, &fb_name); _mesa_ActiveTextureARB(GL_TEXTURE0_ARB + old_active_texture); if (saved_fbo) -- cgit v1.2.3 From adfa778c8ea436d6e62c37327b44f6ff359ed63f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 24 Sep 2009 14:19:06 -0600 Subject: mesa: remove rgbMode check in enable_texture() If the currently bound FBO isn't yet validated it's possible for rgbMode to be zero so we'll lose the texture enable. This could fix some FBO rendering glitches, but I don't know of any specific instances. --- src/mesa/main/enable.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index f432be183c..47d19ab932 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -231,7 +231,7 @@ enable_texture(GLcontext *ctx, GLboolean state, GLbitfield bit) const GLuint newenabled = (!state) ? (texUnit->Enabled & ~bit) : (texUnit->Enabled | bit); - if (!ctx->DrawBuffer->Visual.rgbMode || texUnit->Enabled == newenabled) + if (texUnit->Enabled == newenabled) return GL_FALSE; FLUSH_VERTICES(ctx, _NEW_TEXTURE); -- cgit v1.2.3 From 60b152a1b366b1c9b9326dda1d91ab600fbb0d86 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 24 Sep 2009 14:24:14 -0600 Subject: mesa: remove glEnable(GL_DEPTH_BOUNDS_TEST_EXT) check/warning At the time of the enable there may not be a Z buffer, but one may be attached to the FBO later. --- src/mesa/main/enable.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 47d19ab932..d1b21756fe 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -933,11 +933,6 @@ _mesa_set_enable(GLcontext *ctx, GLenum cap, GLboolean state) /* GL_EXT_depth_bounds_test */ case GL_DEPTH_BOUNDS_TEST_EXT: CHECK_EXTENSION(EXT_depth_bounds_test, cap); - if (state && ctx->DrawBuffer->Visual.depthBits == 0) { - _mesa_warning(ctx, - "glEnable(GL_DEPTH_BOUNDS_TEST_EXT) but no depth buffer"); - return; - } if (ctx->Depth.BoundsTest == state) return; FLUSH_VERTICES(ctx, _NEW_DEPTH); -- cgit v1.2.3 From 601769a2c0071e23ade32de4e8911d75d7f324d2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 23 Sep 2009 16:49:52 -0700 Subject: mesa: Initialize NV_vertex_program fields for the parameter lists and such. This helps let drivers treat NV_vp like ARB_vp. --- src/mesa/shader/nvprogram.c | 28 ++++++++++++++++++++++++++++ src/mesa/shader/nvprogram.h | 2 ++ src/mesa/shader/nvvertparse.c | 25 +++++++++++++++++++++++++ 3 files changed, 55 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c index d6469b17be..fdb2f4210a 100644 --- a/src/mesa/shader/nvprogram.c +++ b/src/mesa/shader/nvprogram.c @@ -511,6 +511,34 @@ _mesa_GetVertexAttribPointervNV(GLuint index, GLenum pname, GLvoid **pointer) +void +_mesa_setup_nv_temporary_count(GLcontext *ctx, struct gl_program *program) +{ + int i; + + program->NumTemporaries = 0; + for (i = 0; i < program->NumInstructions; i++) { + struct prog_instruction *inst = &program->Instructions[i]; + + if (inst->DstReg.File == PROGRAM_TEMPORARY) { + program->NumTemporaries = MAX2(program->NumTemporaries, + inst->DstReg.Index + 1); + } + if (inst->SrcReg[0].File == PROGRAM_TEMPORARY) { + program->NumTemporaries = MAX2(program->NumTemporaries, + inst->SrcReg[0].Index + 1); + } + if (inst->SrcReg[1].File == PROGRAM_TEMPORARY) { + program->NumTemporaries = MAX2(program->NumTemporaries, + inst->SrcReg[1].Index + 1); + } + if (inst->SrcReg[2].File == PROGRAM_TEMPORARY) { + program->NumTemporaries = MAX2(program->NumTemporaries, + inst->SrcReg[2].Index + 1); + } + } +} + /** * Load/parse/compile a program. * \note Called from the GL API dispatcher. diff --git a/src/mesa/shader/nvprogram.h b/src/mesa/shader/nvprogram.h index bfac165b5e..0ed143d52f 100644 --- a/src/mesa/shader/nvprogram.h +++ b/src/mesa/shader/nvprogram.h @@ -103,5 +103,7 @@ extern void GLAPIENTRY _mesa_GetProgramNamedParameterdvNV(GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); +extern void +_mesa_setup_nv_temporary_count(GLcontext *ctx, struct gl_program *program); #endif diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index f5e2df2670..a94e6b8b80 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -44,6 +44,7 @@ #include "nvprogram.h" #include "nvvertparse.h" #include "prog_instruction.h" +#include "prog_parameter.h" #include "prog_print.h" #include "program.h" @@ -1345,6 +1346,9 @@ _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget, if (Parse_Program(&parseState, instBuffer)) { + gl_state_index state_tokens[STATE_LENGTH] = {0, 0, 0, 0, 0}; + int i; + /* successful parse! */ if (parseState.isStateProgram) { @@ -1398,6 +1402,27 @@ _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget, _mesa_fprint_program_opt(stdout, &program->Base, PROG_PRINT_NV, 0); _mesa_printf("------------------------------\n"); #endif + + if (program->Base.Parameters) + _mesa_free_parameter_list(program->Base.Parameters); + + program->Base.Parameters = _mesa_new_parameter_list (); + program->Base.NumParameters = 0; + + state_tokens[0] = STATE_VERTEX_PROGRAM; + state_tokens[1] = STATE_ENV; + /* Add refs to all of the potential params, in order. If we want to not + * upload everything, _mesa_layout_parameters is the answer. + */ + for (i = 0; i < MAX_NV_VERTEX_PROGRAM_PARAMS; i++) { + state_tokens[2] = i; + int index = _mesa_add_state_reference(program->Base.Parameters, + state_tokens); + assert(index == i); + } + program->Base.NumParameters = program->Base.Parameters->NumParameters; + + _mesa_setup_nv_temporary_count(ctx, &program->Base); } else { /* Error! */ -- cgit v1.2.3 From 9018a7dd175caa9a0fbf940b7e66aa9411d2d965 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 24 Sep 2009 10:40:32 -0700 Subject: i965: Load NV program matrices when required. --- src/mesa/drivers/dri/i965/brw_curbe.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_curbe.c b/src/mesa/drivers/dri/i965/brw_curbe.c index 0b0e6931a0..4be6c77aa1 100644 --- a/src/mesa/drivers/dri/i965/brw_curbe.c +++ b/src/mesa/drivers/dri/i965/brw_curbe.c @@ -248,6 +248,9 @@ static void prepare_constant_buffer(struct brw_context *brw) GLuint offset = brw->curbe.vs_start * 16; GLuint nr = brw->vs.prog_data->nr_params / 4; + if (brw->vertex_program->IsNVProgram) + _mesa_load_tracked_matrices(ctx); + /* Updates the ParamaterValues[i] pointers for all parameters of the * basic type of PROGRAM_STATE_VAR. */ -- cgit v1.2.3 From a9a47afe7e87075432ce2d393b55409fcb7149ac Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 23 Sep 2009 16:50:59 -0700 Subject: i965: Remove assert about NV_vp now that it somewhat works. --- src/mesa/drivers/dri/i965/brw_vs.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c index e3111c6680..f0c79efbd9 100644 --- a/src/mesa/drivers/dri/i965/brw_vs.c +++ b/src/mesa/drivers/dri/i965/brw_vs.c @@ -90,8 +90,6 @@ static void brw_upload_vs_prog(struct brw_context *brw) struct brw_vertex_program *vp = (struct brw_vertex_program *)brw->vertex_program; - assert (vp && !vp->program.IsNVProgram); - memset(&key, 0, sizeof(key)); /* Just upload the program verbatim for now. Always send it all -- cgit v1.2.3 From 726a04a2cd1bf159a6c40584b4b2b9bc5948a82e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 24 Sep 2009 11:58:33 -0700 Subject: i965: Emit zero initialization for NV VP temporaries as required. This is similar to what r300 does inside the driver, but I've added it as a generic option since it seems most hardware will want it. Fixes piglit nv-init-zero-reg.vpfp and nv-init-zero-addr.vpfp. --- src/mesa/drivers/dri/i965/brw_context.c | 1 + src/mesa/main/mtypes.h | 1 + src/mesa/shader/nvprogram.c | 44 +++++++++++++++++++++++++++++++++ src/mesa/shader/nvprogram.h | 4 +++ src/mesa/shader/nvvertparse.c | 1 + 5 files changed, 51 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 3c5b848319..c300c33adc 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -125,6 +125,7 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis, /* We want the GLSL compiler to emit code that uses condition codes */ ctx->Shader.EmitCondCodes = GL_TRUE; + ctx->Shader.EmitNVTempInitialization = GL_TRUE; ctx->Const.VertexProgram.MaxNativeInstructions = (16 * 1024); ctx->Const.VertexProgram.MaxAluInstructions = 0; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 6b64bf8139..f8e4e41583 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2079,6 +2079,7 @@ struct gl_shader_state GLboolean EmitContReturn; /**< Emit CONT/RET opcodes? */ GLboolean EmitCondCodes; /**< Use condition codes? */ GLboolean EmitComments; /**< Annotated instructions */ + GLboolean EmitNVTempInitialization; /**< 0-fill NV temp registers */ void *MemPool; GLbitfield Flags; /**< Mask of GLSL_x flags */ struct gl_sl_pragmas DefaultPragmas; /**< Default #pragma settings */ diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c index fdb2f4210a..471a7358a2 100644 --- a/src/mesa/shader/nvprogram.c +++ b/src/mesa/shader/nvprogram.c @@ -509,7 +509,51 @@ _mesa_GetVertexAttribPointervNV(GLuint index, GLenum pname, GLvoid **pointer) *pointer = (GLvoid *) ctx->Array.ArrayObj->VertexAttrib[index].Ptr; } +void +_mesa_emit_nv_temp_initialization(GLcontext *ctx, + struct gl_program *program) +{ + struct prog_instruction *inst; + int i; + + if (!ctx->Shader.EmitNVTempInitialization) + return; + /* We'll swizzle up a zero temporary so we can use it for the + * ARL. + */ + if (program->NumTemporaries == 0) + program->NumTemporaries = 1; + + _mesa_insert_instructions(program, 0, program->NumTemporaries + 1); + + for (i = 0; i < program->NumTemporaries; i++) { + struct prog_instruction *inst = &program->Instructions[i]; + + inst->Opcode = OPCODE_SWZ; + inst->DstReg.File = PROGRAM_TEMPORARY; + inst->DstReg.Index = i; + inst->DstReg.WriteMask = WRITEMASK_XYZW; + inst->SrcReg[0].File = PROGRAM_TEMPORARY; + inst->SrcReg[0].Index = 0; + inst->SrcReg[0].Swizzle = MAKE_SWIZZLE4(SWIZZLE_ZERO, + SWIZZLE_ZERO, + SWIZZLE_ZERO, + SWIZZLE_ZERO); + } + + inst = &program->Instructions[i]; + inst->Opcode = OPCODE_ARL; + inst->DstReg.File = PROGRAM_ADDRESS; + inst->DstReg.Index = 0; + inst->DstReg.WriteMask = WRITEMASK_XYZW; + inst->SrcReg[0].File = PROGRAM_TEMPORARY; + inst->SrcReg[0].Index = 0; + inst->SrcReg[0].Swizzle = SWIZZLE_XXXX; + + if (program->NumAddressRegs == 0) + program->NumAddressRegs = 1; +} void _mesa_setup_nv_temporary_count(GLcontext *ctx, struct gl_program *program) diff --git a/src/mesa/shader/nvprogram.h b/src/mesa/shader/nvprogram.h index 0ed143d52f..8ee59661bd 100644 --- a/src/mesa/shader/nvprogram.h +++ b/src/mesa/shader/nvprogram.h @@ -106,4 +106,8 @@ _mesa_GetProgramNamedParameterdvNV(GLuint id, GLsizei len, const GLubyte *name, extern void _mesa_setup_nv_temporary_count(GLcontext *ctx, struct gl_program *program); +extern void +_mesa_emit_nv_temp_initialization(GLcontext *ctx, + struct gl_program *program); + #endif diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index a94e6b8b80..6ab8a14cb9 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -1423,6 +1423,7 @@ _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget, program->Base.NumParameters = program->Base.Parameters->NumParameters; _mesa_setup_nv_temporary_count(ctx, &program->Base); + _mesa_emit_nv_temp_initialization(ctx, &program->Base); } else { /* Error! */ -- cgit v1.2.3 From 54107a097904129ff794534542acd09ed152ea2e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 24 Sep 2009 14:53:49 -0700 Subject: i965: Clean up some mess with the batch cache. Its flagging of extra state that's already flagged by the vtbl new_batch when appropriate was confusing my tracking down of the OA clear bug. --- src/mesa/drivers/dri/i965/brw_state.h | 5 +---- src/mesa/drivers/dri/i965/brw_state_batch.c | 15 ++------------- src/mesa/drivers/dri/i965/brw_state_upload.c | 3 ++- 3 files changed, 5 insertions(+), 18 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h index 78572356a3..5335eac895 100644 --- a/src/mesa/drivers/dri/i965/brw_state.h +++ b/src/mesa/drivers/dri/i965/brw_state.h @@ -86,9 +86,6 @@ const struct brw_tracked_state brw_psp_urb_cbs; const struct brw_tracked_state brw_pipe_control; -const struct brw_tracked_state brw_clear_surface_cache; -const struct brw_tracked_state brw_clear_batch_cache; - const struct brw_tracked_state brw_drawing_rect; const struct brw_tracked_state brw_indices; const struct brw_tracked_state brw_vertices; @@ -165,7 +162,7 @@ GLboolean brw_cached_batch_struct( struct brw_context *brw, const void *data, GLuint sz ); void brw_destroy_batch_cache( struct brw_context *brw ); -void brw_clear_batch_cache_flush( struct brw_context *brw ); +void brw_clear_batch_cache( struct brw_context *brw ); /* brw_wm_surface_state.c */ dri_bo * diff --git a/src/mesa/drivers/dri/i965/brw_state_batch.c b/src/mesa/drivers/dri/i965/brw_state_batch.c index 811940edc0..7821898cf9 100644 --- a/src/mesa/drivers/dri/i965/brw_state_batch.c +++ b/src/mesa/drivers/dri/i965/brw_state_batch.c @@ -79,7 +79,7 @@ GLboolean brw_cached_batch_struct( struct brw_context *brw, return GL_TRUE; } -static void clear_batch_cache( struct brw_context *brw ) +void brw_clear_batch_cache( struct brw_context *brw ) { struct brw_cached_batch_item *item = brw->cached_batch_items; @@ -93,18 +93,7 @@ static void clear_batch_cache( struct brw_context *brw ) brw->cached_batch_items = NULL; } -void brw_clear_batch_cache_flush( struct brw_context *brw ) -{ - clear_batch_cache(brw); - - brw->state.dirty.mesa |= ~0; - brw->state.dirty.brw |= ~0; - brw->state.dirty.cache |= ~0; -} - - - void brw_destroy_batch_cache( struct brw_context *brw ) { - clear_batch_cache(brw); + brw_clear_batch_cache(brw); } diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index 414620d0b3..b817b741e7 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -287,6 +287,7 @@ void brw_validate_state( struct brw_context *brw ) if (brw->emit_state_always) { state->mesa |= ~0; state->brw |= ~0; + state->cache |= ~0; } if (brw->fragment_program != ctx->FragmentProgram._Current) { @@ -305,7 +306,7 @@ void brw_validate_state( struct brw_context *brw ) return; if (brw->state.dirty.brw & BRW_NEW_CONTEXT) - brw_clear_batch_cache_flush(brw); + brw_clear_batch_cache(brw); brw->intel.Fallback = 0; -- cgit v1.2.3 From cc8084932cc552587e3036dbbf62c77db3b4a08e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 24 Sep 2009 16:15:52 -0700 Subject: intel: Flush the batch when we're about to subdata into a VBO. This fixes the clears in openarena with the new metaops clear code, and the new piglit vbo-subdata-sync test. Bug #23857. --- src/mesa/drivers/dri/intel/intel_buffer_objects.c | 6 +++++- src/mesa/drivers/dri/intel/intel_clear.c | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c b/src/mesa/drivers/dri/intel/intel_buffer_objects.c index c55c5c426e..7f6fb66d52 100644 --- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c +++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c @@ -207,8 +207,12 @@ intel_bufferobj_subdata(GLcontext * ctx, if (intel_obj->sys_buffer) memcpy((char *)intel_obj->sys_buffer + offset, data, size); - else + else { + /* Flush any existing batchbuffer that might reference this data. */ + intelFlush(ctx); + dri_bo_subdata(intel_obj->buffer, offset, size, data); + } } diff --git a/src/mesa/drivers/dri/intel/intel_clear.c b/src/mesa/drivers/dri/intel/intel_clear.c index 9010b910c7..1b0e221789 100644 --- a/src/mesa/drivers/dri/intel/intel_clear.c +++ b/src/mesa/drivers/dri/intel/intel_clear.c @@ -173,7 +173,6 @@ intelClear(GLcontext *ctx, GLbitfield mask) } _mesa_meta_clear(&intel->ctx, tri_mask); - intel_batchbuffer_flush(intel->batch); } if (swrast_mask) { -- cgit v1.2.3 From 09af58d7ed7dfa8f2ce2b881bb849064e136c830 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 24 Sep 2009 18:27:20 -0700 Subject: NV fp lexer: Add UP4B and UP4UB instructions that were previously missing --- src/mesa/shader/lex.yy.c | 1351 ++++++++++++++++++++------------------- src/mesa/shader/program_lexer.l | 2 + 2 files changed, 686 insertions(+), 667 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/lex.yy.c b/src/mesa/shader/lex.yy.c index 3c4e97b650..3c86913fdf 100644 --- a/src/mesa/shader/lex.yy.c +++ b/src/mesa/shader/lex.yy.c @@ -357,8 +357,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 168 -#define YY_END_OF_BUFFER 169 +#define YY_NUM_RULES 170 +#define YY_END_OF_BUFFER 171 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -366,100 +366,101 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[836] = +static yyconst flex_int16_t yy_accept[850] = { 0, - 0, 0, 169, 167, 165, 164, 167, 167, 137, 163, - 139, 139, 139, 139, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 165, 0, 0, 166, 137, - 0, 138, 140, 160, 160, 0, 0, 0, 0, 160, - 0, 0, 0, 0, 0, 0, 0, 117, 161, 118, - 119, 151, 151, 151, 151, 0, 139, 0, 125, 126, - 127, 137, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, - - 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 159, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 158, 158, 0, 0, 0, + 0, 0, 171, 169, 167, 166, 169, 169, 139, 165, + 141, 141, 141, 141, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 167, 0, 0, 168, 139, + 0, 140, 142, 162, 162, 0, 0, 0, 0, 162, + 0, 0, 0, 0, 0, 0, 0, 119, 163, 120, + 121, 153, 153, 153, 153, 0, 141, 0, 127, 128, + 129, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 161, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 160, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 157, 157, 157, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 148, 148, 148, 149, 149, 150, 141, - 140, 141, 0, 142, 11, 12, 137, 13, 137, 137, - 14, 15, 137, 16, 17, 18, 19, 20, 21, 6, + 159, 159, 159, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 150, 150, 150, 151, 151, 152, 143, + 142, 143, 0, 144, 11, 12, 139, 13, 139, 139, + 14, 15, 139, 16, 17, 18, 19, 20, 21, 6, 22, 23, 24, 25, 26, 28, 27, 29, 30, 31, - 32, 33, 34, 35, 137, 137, 137, 137, 137, 40, - 41, 137, 42, 43, 44, 45, 46, 47, 48, 137, - 49, 50, 51, 52, 53, 54, 55, 137, 56, 57, - 58, 59, 137, 62, 63, 137, 137, 137, 137, 137, - 137, 0, 0, 0, 0, 140, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 78, 79, 81, 0, - 156, 0, 0, 0, 0, 0, 0, 95, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 155, 154, - 154, 107, 0, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 145, 145, 146, 147, 0, 143, 11, 11, - 137, 12, 12, 12, 137, 137, 137, 137, 137, 15, - 15, 137, 128, 16, 16, 137, 17, 17, 137, 18, - 18, 137, 19, 19, 137, 20, 20, 137, 21, 21, - 137, 22, 22, 137, 24, 24, 137, 25, 25, 137, - 28, 28, 137, 27, 27, 137, 30, 30, 137, 31, - 31, 137, 32, 32, 137, 33, 33, 137, 34, 34, - 137, 35, 35, 137, 137, 137, 137, 36, 137, 38, - 137, 40, 40, 137, 41, 41, 137, 129, 42, 42, - 137, 43, 43, 137, 137, 45, 45, 137, 46, 46, - - 137, 47, 47, 137, 48, 48, 137, 137, 49, 49, - 137, 50, 50, 137, 51, 51, 137, 52, 52, 137, - 53, 53, 137, 54, 54, 137, 137, 10, 56, 137, - 57, 137, 58, 137, 59, 137, 60, 137, 62, 62, - 137, 137, 137, 137, 137, 137, 137, 137, 0, 162, - 0, 0, 0, 71, 72, 0, 0, 0, 0, 0, - 0, 0, 83, 0, 0, 0, 0, 0, 0, 0, + 32, 33, 34, 35, 139, 139, 139, 139, 139, 40, + 41, 139, 42, 43, 44, 45, 46, 47, 48, 139, + 49, 50, 51, 52, 53, 54, 55, 139, 56, 57, + 58, 59, 139, 139, 64, 65, 139, 139, 139, 139, + 139, 139, 0, 0, 0, 0, 142, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 80, 81, 83, + 0, 158, 0, 0, 0, 0, 0, 0, 97, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 157, + 156, 156, 109, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 147, 147, 148, 149, 0, 145, 11, + 11, 139, 12, 12, 12, 139, 139, 139, 139, 139, + 15, 15, 139, 130, 16, 16, 139, 17, 17, 139, + 18, 18, 139, 19, 19, 139, 20, 20, 139, 21, + 21, 139, 22, 22, 139, 24, 24, 139, 25, 25, + 139, 28, 28, 139, 27, 27, 139, 30, 30, 139, + 31, 31, 139, 32, 32, 139, 33, 33, 139, 34, + 34, 139, 35, 35, 139, 139, 139, 139, 36, 139, + 38, 139, 40, 40, 139, 41, 41, 139, 131, 42, + 42, 139, 43, 43, 139, 139, 45, 45, 139, 46, + + 46, 139, 47, 47, 139, 48, 48, 139, 139, 49, + 49, 139, 50, 50, 139, 51, 51, 139, 52, 52, + 139, 53, 53, 139, 54, 54, 139, 139, 10, 56, + 139, 57, 139, 58, 139, 59, 139, 60, 139, 62, + 139, 64, 64, 139, 139, 139, 139, 139, 139, 139, + 139, 0, 164, 0, 0, 0, 73, 74, 0, 0, + 0, 0, 0, 0, 0, 85, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 153, 0, 0, 0, 111, 0, 113, 0, 0, - 0, 0, 0, 0, 152, 144, 137, 137, 137, 4, - - 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 9, 37, 39, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 60, 137, 61, - 137, 137, 137, 137, 137, 67, 137, 137, 0, 0, - 0, 0, 0, 73, 74, 0, 0, 0, 0, 82, - 0, 0, 86, 89, 0, 0, 0, 0, 0, 0, - 0, 100, 101, 0, 0, 0, 0, 106, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 137, 137, - - 137, 137, 137, 137, 5, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 7, 8, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 137, 137, - 137, 137, 137, 137, 137, 137, 137, 137, 61, 137, - 137, 137, 137, 137, 68, 137, 64, 0, 0, 0, - 0, 122, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 92, 0, 96, 97, 0, 99, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 115, 116, 0, - 0, 123, 11, 3, 12, 133, 134, 137, 14, 15, - - 16, 17, 18, 19, 20, 21, 22, 24, 25, 28, - 27, 30, 31, 32, 33, 34, 35, 40, 41, 42, - 43, 44, 45, 46, 47, 48, 137, 137, 137, 49, - 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, - 137, 137, 62, 63, 137, 66, 124, 0, 0, 69, - 0, 75, 0, 0, 0, 84, 0, 0, 0, 0, - 0, 0, 98, 0, 0, 104, 91, 0, 0, 0, - 0, 0, 0, 120, 0, 137, 130, 131, 137, 60, - 137, 65, 0, 0, 0, 0, 77, 80, 85, 0, - 0, 90, 0, 0, 0, 103, 0, 0, 0, 0, - - 112, 114, 0, 137, 137, 61, 2, 1, 0, 76, - 0, 88, 0, 94, 102, 0, 0, 109, 110, 121, - 137, 132, 0, 87, 0, 105, 108, 137, 70, 93, - 137, 137, 135, 136, 0 + 0, 0, 0, 0, 155, 0, 0, 0, 113, 0, + 115, 0, 0, 0, 0, 0, 0, 154, 146, 139, + + 139, 139, 4, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 9, 37, 39, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 60, 139, 61, 62, 139, 63, 139, 139, 139, 139, + 139, 69, 139, 139, 0, 0, 0, 0, 0, 75, + 76, 0, 0, 0, 0, 84, 0, 0, 88, 91, + 0, 0, 0, 0, 0, 0, 0, 102, 103, 0, + 0, 0, 0, 108, 0, 0, 0, 0, 0, 0, + + 0, 0, 0, 0, 139, 139, 139, 139, 139, 139, + 5, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 7, 8, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 61, 139, 139, 63, 139, 139, + 139, 139, 139, 70, 139, 66, 0, 0, 0, 0, + 124, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 94, 0, 98, 99, 0, 101, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 117, 118, 0, 0, + + 125, 11, 3, 12, 135, 136, 139, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 24, 25, 28, 27, + 30, 31, 32, 33, 34, 35, 40, 41, 42, 43, + 44, 45, 46, 47, 48, 139, 139, 139, 49, 50, + 51, 52, 53, 54, 55, 56, 57, 58, 59, 139, + 139, 139, 139, 64, 65, 139, 68, 126, 0, 0, + 71, 0, 77, 0, 0, 0, 86, 0, 0, 0, + 0, 0, 0, 100, 0, 0, 106, 93, 0, 0, + 0, 0, 0, 0, 122, 0, 139, 132, 133, 139, + 60, 139, 62, 139, 67, 0, 0, 0, 0, 79, + + 82, 87, 0, 0, 92, 0, 0, 0, 105, 0, + 0, 0, 0, 114, 116, 0, 139, 139, 61, 63, + 2, 1, 0, 78, 0, 90, 0, 96, 104, 0, + 0, 111, 112, 123, 139, 134, 0, 89, 0, 107, + 110, 139, 72, 95, 139, 139, 137, 138, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -505,199 +506,203 @@ static yyconst flex_int32_t yy_meta[68] = 2, 2, 2, 2, 2, 2, 2 } ; -static yyconst flex_int16_t yy_base[839] = +static yyconst flex_int16_t yy_base[853] = { 0, - 0, 0, 1283, 1284, 66, 1284, 1277, 1278, 0, 69, - 85, 128, 140, 152, 151, 58, 56, 63, 76, 1256, - 158, 160, 39, 163, 173, 189, 52, 1249, 76, 1219, - 1218, 1230, 1214, 1228, 1227, 105, 1256, 1268, 1284, 0, - 225, 1284, 218, 160, 157, 20, 123, 66, 119, 192, - 1228, 1214, 54, 162, 1212, 1224, 194, 1284, 200, 195, - 98, 227, 196, 231, 235, 293, 305, 316, 1284, 1284, - 1284, 1233, 1246, 1240, 223, 1229, 1232, 1228, 1243, 107, - 298, 1225, 1239, 246, 1225, 1238, 1229, 1242, 1219, 1230, - 1221, 182, 1222, 1213, 1222, 1213, 1212, 1213, 144, 1207, - - 1213, 1224, 1215, 1209, 1206, 1207, 1211, 289, 1220, 1207, - 302, 1214, 1201, 1215, 1191, 65, 315, 1218, 1210, 1209, - 1185, 1170, 1165, 1182, 1158, 1163, 1189, 279, 1178, 293, - 1173, 342, 299, 1175, 1156, 317, 1166, 1162, 1157, 207, - 1163, 1149, 1165, 1162, 1153, 320, 324, 1155, 1144, 1158, - 1161, 1143, 1158, 1145, 1142, 1149, 284, 1157, 227, 288, - 327, 342, 345, 1134, 1151, 1152, 1145, 1127, 318, 1128, - 1150, 1141, 330, 341, 345, 349, 353, 357, 361, 1284, - 419, 430, 436, 442, 440, 441, 1174, 0, 1173, 1156, - 1146, 443, 1166, 444, 451, 468, 470, 472, 471, 0, + 0, 0, 1299, 1300, 66, 1300, 1293, 1294, 0, 69, + 85, 128, 140, 152, 151, 58, 56, 63, 76, 1272, + 158, 160, 39, 163, 173, 189, 52, 1265, 76, 1235, + 1234, 1246, 1230, 1244, 1243, 105, 1272, 1284, 1300, 0, + 225, 1300, 218, 160, 157, 20, 123, 66, 119, 192, + 1244, 1230, 54, 162, 1228, 1240, 194, 1300, 200, 195, + 98, 227, 196, 231, 235, 293, 305, 316, 1300, 1300, + 1300, 1249, 1262, 1256, 223, 1245, 1248, 1244, 1259, 107, + 298, 1241, 1255, 246, 1241, 1254, 1245, 1258, 1235, 1246, + 1237, 182, 1238, 1229, 1238, 1229, 1228, 1229, 144, 1223, + + 1229, 1240, 1231, 1225, 1222, 1223, 1227, 289, 1236, 1223, + 302, 1230, 1217, 1231, 1207, 65, 315, 276, 1227, 1226, + 1202, 1187, 1182, 1199, 1175, 1180, 1206, 279, 1195, 293, + 1190, 342, 299, 1192, 1173, 317, 1183, 1179, 1174, 207, + 1180, 1166, 1182, 1179, 1170, 320, 324, 1172, 1161, 1175, + 1178, 1160, 1175, 1162, 1159, 1166, 284, 1174, 227, 288, + 327, 342, 345, 1151, 1168, 1169, 1162, 1144, 318, 1145, + 1167, 1158, 330, 341, 345, 349, 353, 357, 361, 1300, + 419, 430, 436, 442, 440, 441, 1191, 0, 1190, 1173, + 1163, 443, 1183, 444, 451, 468, 470, 472, 471, 0, 496, 0, 497, 498, 0, 499, 500, 0, 524, 525, - 526, 536, 537, 553, 1161, 1154, 1167, 354, 356, 561, - 563, 1148, 564, 565, 1140, 580, 590, 591, 592, 1161, - 593, 617, 618, 619, 629, 630, 1138, 1148, 247, 330, - 362, 419, 445, 646, 1136, 1128, 1127, 1112, 1112, 1111, - 1110, 1153, 1125, 1113, 662, 669, 643, 1117, 487, 1114, - 1108, 1108, 1102, 1115, 1115, 1100, 1284, 1284, 1115, 1103, - 646, 1110, 135, 1107, 1113, 561, 1108, 1284, 1099, 1106, - 1105, 1108, 1094, 1093, 1097, 1092, 330, 1097, 650, 653, - 665, 1284, 1089, 1087, 1087, 1095, 1096, 1078, 670, 1083, - - 1089, 432, 460, 486, 579, 655, 715, 722, 1095, 682, - 1102, 1093, 697, 721, 1100, 1099, 1092, 1106, 1096, 1087, - 699, 1094, 0, 1085, 724, 1092, 1083, 725, 1090, 1081, - 726, 1088, 1079, 727, 1086, 1077, 728, 1084, 1075, 729, - 1082, 1073, 730, 1080, 1071, 731, 1078, 1069, 732, 1076, - 1067, 733, 1074, 1065, 734, 1072, 1063, 735, 1070, 1061, - 736, 1068, 1059, 737, 1066, 1057, 738, 1064, 1055, 739, - 1062, 1053, 740, 1060, 1063, 1056, 1063, 0, 1056, 0, - 1071, 1046, 741, 1053, 1044, 742, 1051, 0, 1042, 743, - 1049, 1040, 745, 1047, 1046, 1037, 746, 1044, 1035, 767, - - 1042, 1033, 770, 1040, 1031, 771, 1038, 1041, 1028, 772, - 1035, 1026, 773, 1033, 1024, 774, 1031, 1022, 775, 1029, - 1020, 776, 1027, 1018, 777, 1025, 1024, 0, 1015, 1022, - 1013, 1020, 1011, 1018, 1009, 1016, 778, 1015, 1006, 779, - 1013, 1012, 990, 984, 989, 995, 978, 993, 424, 1284, - 992, 982, 986, 1284, 1284, 976, 985, 971, 988, 971, - 974, 968, 1284, 969, 968, 965, 972, 965, 973, 969, - 979, 976, 958, 964, 971, 955, 954, 972, 954, 966, - 965, 1284, 964, 954, 958, 1284, 945, 1284, 950, 950, - 958, 941, 942, 952, 1284, 1284, 984, 966, 982, 0, - - 788, 980, 980, 979, 978, 977, 976, 975, 974, 973, - 972, 971, 970, 969, 968, 967, 966, 965, 964, 963, - 962, 949, 942, 0, 0, 0, 959, 958, 957, 956, - 955, 954, 953, 952, 951, 929, 949, 948, 947, 946, - 945, 944, 943, 942, 941, 940, 939, 913, 920, 783, - 936, 935, 904, 907, 887, 0, 888, 881, 888, 887, - 888, 880, 898, 1284, 1284, 880, 878, 888, 881, 1284, - 876, 893, 345, 1284, 884, 868, 869, 878, 869, 868, - 868, 1284, 867, 876, 866, 882, 879, 1284, 878, 876, - 865, 866, 862, 854, 861, 856, 857, 852, 878, 878, - - 876, 890, 889, 884, 0, 872, 871, 870, 869, 868, - 867, 866, 865, 864, 863, 862, 861, 860, 859, 858, - 857, 856, 855, 854, 0, 0, 853, 852, 851, 850, - 849, 848, 847, 846, 845, 791, 844, 843, 842, 841, - 840, 839, 838, 837, 836, 835, 834, 851, 825, 832, - 830, 829, 807, 807, 0, 814, 0, 848, 847, 796, - 814, 1284, 809, 804, 797, 793, 805, 795, 793, 789, - 805, 796, 795, 1284, 1284, 798, 1284, 793, 786, 775, - 786, 778, 782, 795, 790, 793, 775, 1284, 1284, 787, - 776, 1284, 0, 0, 0, 0, 0, 815, 0, 0, - - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 526, 536, 537, 553, 1178, 1171, 1184, 354, 356, 561, + 563, 1165, 564, 565, 1157, 580, 590, 591, 592, 1178, + 593, 617, 618, 619, 629, 630, 1155, 1165, 330, 362, + 419, 483, 445, 364, 646, 1153, 1145, 1144, 1129, 1129, + 1128, 1127, 1170, 1142, 1130, 662, 669, 643, 1134, 487, + 1131, 1125, 1125, 1119, 1132, 1132, 1117, 1300, 1300, 1132, + 1120, 646, 1127, 135, 1124, 1130, 561, 1125, 1300, 1116, + 1123, 1122, 1125, 1111, 1110, 1114, 1109, 448, 1114, 650, + 653, 665, 1300, 1106, 1104, 1104, 1112, 1113, 1095, 670, + + 1100, 1106, 486, 579, 655, 661, 668, 726, 732, 1112, + 682, 1119, 1110, 688, 730, 1117, 1116, 1109, 1123, 1113, + 1104, 712, 1111, 0, 1102, 731, 1109, 1100, 733, 1107, + 1098, 734, 1105, 1096, 736, 1103, 1094, 737, 1101, 1092, + 738, 1099, 1090, 739, 1097, 1088, 740, 1095, 1086, 741, + 1093, 1084, 742, 1091, 1082, 743, 1089, 1080, 744, 1087, + 1078, 745, 1085, 1076, 746, 1083, 1074, 747, 1081, 1072, + 748, 1079, 1070, 749, 1077, 1080, 1073, 1080, 0, 1073, + 0, 1088, 1063, 750, 1070, 1061, 751, 1068, 0, 1059, + 752, 1066, 1057, 755, 1064, 1063, 1054, 758, 1061, 1052, + + 776, 1059, 1050, 777, 1057, 1048, 779, 1055, 1058, 1045, + 780, 1052, 1043, 782, 1050, 1041, 783, 1048, 1039, 784, + 1046, 1037, 785, 1044, 1035, 786, 1042, 1041, 0, 1032, + 1039, 1030, 1037, 1028, 1035, 1026, 1033, 787, 1032, 788, + 1047, 1022, 789, 1029, 1028, 1006, 1000, 1005, 1011, 994, + 1009, 424, 1300, 1008, 998, 1002, 1300, 1300, 992, 1001, + 987, 1004, 987, 990, 984, 1300, 985, 984, 981, 988, + 981, 989, 985, 995, 992, 974, 980, 987, 971, 970, + 988, 970, 982, 981, 1300, 980, 970, 974, 1300, 961, + 1300, 966, 966, 974, 957, 958, 968, 1300, 1300, 1000, + + 982, 998, 0, 798, 996, 996, 995, 994, 993, 992, + 991, 990, 989, 988, 987, 986, 985, 984, 983, 982, + 981, 980, 979, 978, 965, 958, 0, 0, 0, 975, + 974, 973, 972, 971, 970, 969, 968, 967, 945, 965, + 964, 963, 962, 961, 960, 959, 958, 957, 956, 955, + 929, 936, 793, 927, 934, 794, 950, 949, 918, 921, + 901, 0, 902, 895, 902, 901, 902, 894, 912, 1300, + 1300, 894, 892, 902, 895, 1300, 890, 907, 516, 1300, + 898, 882, 883, 892, 883, 882, 882, 1300, 881, 890, + 880, 896, 893, 1300, 892, 890, 879, 880, 876, 868, + + 875, 870, 871, 866, 892, 892, 890, 904, 903, 898, + 0, 886, 885, 884, 883, 882, 881, 880, 879, 878, + 877, 876, 875, 874, 873, 872, 871, 870, 869, 868, + 0, 0, 867, 866, 865, 864, 863, 862, 861, 860, + 859, 804, 858, 857, 856, 855, 854, 853, 852, 851, + 850, 849, 848, 865, 839, 846, 862, 836, 843, 841, + 840, 818, 818, 0, 825, 0, 859, 858, 807, 825, + 1300, 820, 815, 808, 804, 816, 806, 804, 800, 816, + 807, 806, 1300, 1300, 809, 1300, 804, 797, 786, 797, + 789, 793, 806, 801, 804, 786, 1300, 1300, 798, 787, + + 1300, 0, 0, 0, 0, 0, 826, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 811, 803, 790, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 775, 791, 0, 0, 745, 0, 0, 796, 795, 1284, - 737, 1284, 655, 655, 661, 1284, 644, 658, 643, 644, - 635, 620, 1284, 598, 608, 1284, 1284, 604, 586, 579, - 567, 567, 574, 1284, 557, 582, 0, 0, 582, 0, - 565, 0, 582, 580, 539, 525, 1284, 1284, 1284, 527, - 527, 1284, 525, 497, 499, 1284, 478, 451, 439, 441, - - 1284, 1284, 431, 441, 366, 0, 1284, 1284, 21, 1284, - 144, 1284, 176, 1284, 1284, 182, 187, 1284, 1284, 1284, - 220, 0, 235, 1284, 245, 1284, 1284, 424, 1284, 1284, - 327, 373, 0, 0, 1284, 824, 396, 827 + 0, 0, 0, 0, 0, 814, 813, 802, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 785, + 798, 779, 792, 0, 0, 656, 0, 0, 706, 702, + 1300, 649, 1300, 648, 648, 654, 1300, 637, 645, 610, + 612, 608, 608, 1300, 572, 583, 1300, 1300, 577, 573, + 560, 557, 542, 555, 1300, 539, 573, 0, 0, 572, + 0, 555, 0, 546, 0, 562, 551, 495, 479, 1300, + + 1300, 1300, 481, 481, 1300, 480, 443, 31, 1300, 141, + 166, 171, 186, 1300, 1300, 211, 236, 276, 0, 0, + 1300, 1300, 290, 1300, 325, 1300, 346, 1300, 1300, 343, + 341, 1300, 1300, 1300, 365, 0, 380, 1300, 371, 1300, + 1300, 486, 1300, 1300, 451, 458, 0, 0, 1300, 836, + 503, 839 } ; -static yyconst flex_int16_t yy_def[839] = +static yyconst flex_int16_t yy_def[853] = { 0, - 835, 1, 835, 835, 835, 835, 835, 836, 837, 835, - 835, 835, 835, 835, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 835, 835, 836, 835, 837, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 838, 835, 835, 835, 835, - 835, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - - 835, 835, 835, 835, 835, 835, 835, 835, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 837, 837, 837, 837, - - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 837, 837, - - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 837, 837, 837, 837, 837, 837, 837, 837, - - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, - 837, 837, 837, 837, 837, 837, 837, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 837, 837, 837, 837, 837, - 837, 837, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - - 835, 835, 835, 837, 837, 837, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 837, 837, 835, 835, 835, 835, 835, 837, 835, 835, - 837, 837, 837, 837, 0, 835, 835, 835 + 849, 1, 849, 849, 849, 849, 849, 850, 851, 849, + 849, 849, 849, 849, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 849, 849, 850, 849, 851, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 852, 849, 849, 849, 849, + 849, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + + 849, 849, 849, 849, 849, 849, 849, 849, 849, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 851, + + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + + 849, 849, 849, 849, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + + 849, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 851, 851, 851, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 851, 851, 851, 851, + 851, 851, 851, 851, 851, 849, 849, 849, 849, 849, + + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 851, 851, 851, 851, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 851, 851, 849, 849, 849, 849, + 849, 851, 849, 849, 851, 851, 851, 851, 0, 849, + 849, 849 } ; -static yyconst flex_int16_t yy_nxt[1352] = +static yyconst flex_int16_t yy_nxt[1368] = { 0, 4, 5, 6, 5, 7, 8, 9, 4, 10, 11, 12, 13, 14, 11, 11, 15, 9, 16, 17, 18, @@ -706,7 +711,7 @@ static yyconst flex_int16_t yy_nxt[1352] = 9, 9, 9, 9, 9, 9, 30, 9, 9, 9, 9, 9, 9, 9, 9, 9, 31, 9, 32, 33, 34, 9, 35, 9, 9, 9, 9, 36, 96, 36, - 41, 116, 137, 97, 80, 138, 823, 42, 43, 43, + 41, 116, 137, 97, 80, 138, 829, 42, 43, 43, 43, 43, 43, 43, 77, 81, 78, 119, 82, 117, 83, 238, 79, 66, 67, 67, 67, 67, 67, 67, @@ -718,139 +723,140 @@ static yyconst flex_int16_t yy_nxt[1352] = 67, 67, 67, 67, 67, 218, 171, 219, 70, 68, 66, 67, 67, 67, 67, 67, 67, 72, 139, 73, 71, 68, 140, 68, 144, 92, 74, 145, 98, 88, - 464, 89, 75, 93, 76, 68, 90, 99, 94, 91, - 101, 100, 102, 103, 95, 465, 824, 68, 136, 133, + 467, 89, 75, 93, 76, 68, 90, 99, 94, 91, + 101, 100, 102, 103, 95, 468, 830, 68, 136, 133, 210, 133, 133, 152, 133, 104, 105, 133, 106, 107, 108, 109, 110, 134, 111, 133, 112, 153, 133, 211, - 135, 825, 113, 114, 154, 115, 41, 43, 43, 43, - 43, 43, 43, 146, 147, 157, 826, 132, 165, 133, - 166, 161, 162, 167, 168, 827, 158, 163, 188, 159, - 133, 169, 160, 264, 189, 164, 828, 201, 133, 174, - 173, 175, 176, 132, 429, 265, 128, 129, 46, 47, - 48, 49, 172, 51, 52, 202, 284, 53, 54, 55, - 56, 57, 58, 130, 60, 61, 285, 430, 131, 829, + 135, 831, 113, 114, 154, 115, 41, 43, 43, 43, + 43, 43, 43, 146, 147, 157, 832, 132, 165, 133, + 166, 161, 162, 167, 168, 833, 158, 163, 188, 159, + 133, 169, 160, 265, 189, 164, 834, 201, 133, 174, + 173, 175, 176, 132, 835, 266, 128, 129, 46, 47, + 48, 49, 172, 51, 52, 202, 285, 53, 54, 55, + 56, 57, 58, 130, 60, 61, 286, 243, 131, 244, 173, 173, 173, 173, 177, 173, 173, 178, 179, 173, - 173, 173, 181, 181, 181, 181, 181, 181, 228, 830, + 173, 173, 181, 181, 181, 181, 181, 181, 228, 836, 196, 197, 182, 66, 67, 67, 67, 67, 67, 67, 198, 232, 229, 183, 68, 184, 184, 184, 184, 184, - 184, 240, 134, 241, 254, 233, 281, 286, 182, 135, - 257, 257, 282, 287, 242, 833, 257, 431, 164, 255, - 68, 256, 256, 256, 256, 256, 256, 257, 257, 257, - 260, 257, 257, 297, 257, 271, 257, 257, 257, 257, - 432, 257, 380, 298, 257, 257, 378, 479, 257, 433, - 480, 288, 257, 289, 257, 257, 290, 291, 379, 257, - 381, 834, 257, 302, 302, 302, 302, 40, 669, 822, - - 257, 670, 434, 257, 302, 302, 302, 302, 303, 302, - 302, 304, 305, 302, 302, 302, 302, 302, 302, 302, - 306, 302, 302, 302, 302, 302, 302, 302, 43, 43, - 43, 43, 43, 43, 831, 832, 435, 307, 132, 308, - 308, 308, 308, 308, 308, 184, 184, 184, 184, 184, - 184, 184, 184, 184, 184, 184, 184, 309, 312, 436, - 320, 324, 310, 313, 132, 321, 325, 437, 327, 821, - 559, 310, 314, 328, 321, 325, 820, 310, 313, 438, - 311, 315, 328, 322, 326, 330, 560, 333, 339, 336, - 331, 329, 334, 340, 337, 495, 495, 495, 495, 331, - - 819, 334, 340, 337, 818, 331, 817, 334, 332, 337, - 335, 341, 338, 342, 345, 348, 351, 354, 343, 346, - 349, 352, 355, 495, 495, 495, 495, 343, 346, 349, - 352, 355, 452, 816, 346, 349, 344, 347, 350, 353, - 356, 357, 360, 363, 815, 453, 358, 361, 364, 496, - 495, 495, 495, 366, 369, 358, 361, 364, 367, 370, - 814, 358, 361, 364, 359, 362, 365, 367, 370, 813, - 372, 812, 811, 367, 370, 373, 368, 371, 382, 810, - 385, 389, 392, 383, 373, 386, 390, 393, 809, 808, - 373, 807, 383, 374, 386, 390, 393, 396, 806, 805, - - 804, 384, 397, 387, 391, 394, 468, 399, 402, 405, - 409, 397, 400, 403, 406, 410, 803, 397, 802, 469, - 398, 400, 403, 406, 410, 801, 800, 400, 403, 406, - 401, 404, 407, 411, 412, 415, 418, 799, 798, 413, - 416, 419, 495, 495, 495, 495, 421, 424, 413, 416, - 419, 422, 425, 797, 413, 416, 419, 414, 417, 420, - 422, 425, 796, 439, 795, 794, 422, 425, 440, 423, - 426, 256, 256, 256, 256, 256, 256, 440, 256, 256, - 256, 256, 256, 256, 450, 450, 441, 450, 450, 793, - 450, 450, 450, 450, 450, 450, 792, 450, 791, 309, - - 450, 450, 790, 789, 450, 788, 482, 450, 450, 787, - 786, 450, 450, 489, 312, 490, 320, 491, 495, 495, - 495, 495, 311, 450, 308, 308, 308, 308, 308, 308, - 492, 308, 308, 308, 308, 308, 308, 315, 312, 322, - 498, 324, 327, 330, 333, 336, 339, 342, 345, 348, - 351, 354, 357, 360, 363, 366, 369, 372, 382, 385, - 389, 315, 392, 396, 326, 329, 332, 335, 338, 341, - 344, 347, 350, 353, 356, 359, 362, 365, 368, 371, - 374, 384, 387, 391, 399, 394, 398, 402, 405, 409, - 412, 415, 418, 421, 424, 548, 439, 785, 602, 603, - - 649, 727, 728, 784, 783, 782, 781, 401, 780, 779, - 404, 407, 411, 414, 417, 420, 423, 426, 549, 441, - 604, 778, 729, 650, 38, 38, 38, 180, 180, 777, - 776, 775, 774, 773, 772, 771, 770, 769, 768, 767, - 766, 765, 764, 763, 762, 761, 760, 759, 758, 757, - 756, 755, 754, 753, 752, 751, 750, 749, 748, 747, - 746, 745, 744, 743, 742, 650, 741, 740, 739, 738, - 737, 736, 735, 734, 733, 732, 731, 730, 726, 725, - 724, 723, 722, 721, 720, 719, 718, 717, 716, 715, - 714, 713, 712, 711, 710, 709, 708, 707, 706, 705, - - 704, 703, 702, 701, 700, 699, 698, 697, 696, 695, - 694, 693, 692, 691, 690, 689, 688, 687, 686, 685, - 684, 683, 682, 681, 680, 679, 678, 677, 676, 675, - 674, 673, 672, 671, 668, 667, 666, 665, 664, 663, - 662, 661, 660, 659, 658, 657, 656, 655, 654, 653, - 652, 651, 648, 549, 647, 646, 645, 644, 643, 642, - 641, 640, 639, 638, 637, 636, 635, 634, 633, 632, - 631, 630, 629, 628, 627, 626, 625, 624, 623, 622, - 621, 620, 619, 618, 617, 616, 615, 614, 613, 612, - 611, 610, 609, 608, 607, 606, 605, 601, 600, 599, - - 598, 597, 596, 595, 594, 593, 592, 591, 590, 589, - 588, 587, 586, 585, 584, 583, 582, 581, 580, 579, - 578, 577, 576, 575, 574, 573, 572, 571, 570, 569, - 568, 567, 566, 565, 564, 563, 562, 561, 558, 557, - 556, 555, 554, 553, 552, 551, 441, 550, 547, 436, - 546, 434, 545, 432, 544, 430, 543, 542, 426, 541, - 423, 540, 420, 539, 417, 538, 414, 537, 411, 536, - 535, 407, 534, 404, 533, 401, 532, 398, 531, 530, - 394, 529, 391, 528, 387, 527, 384, 526, 525, 524, - 523, 522, 521, 374, 520, 371, 519, 368, 518, 365, - - 517, 362, 516, 359, 515, 356, 514, 353, 513, 350, - 512, 347, 511, 344, 510, 341, 509, 338, 508, 335, - 507, 332, 506, 329, 505, 326, 504, 322, 503, 502, - 501, 500, 499, 315, 497, 311, 494, 493, 488, 487, - 486, 485, 484, 483, 481, 478, 477, 476, 475, 474, - 473, 472, 471, 470, 467, 466, 463, 462, 461, 460, - 459, 458, 457, 456, 455, 454, 451, 288, 260, 449, - 448, 447, 446, 445, 444, 443, 442, 428, 427, 408, - 395, 388, 377, 376, 375, 323, 319, 318, 317, 316, - 301, 300, 299, 296, 295, 294, 293, 292, 283, 280, - - 279, 278, 277, 276, 275, 274, 273, 272, 270, 269, - 268, 267, 266, 263, 262, 261, 259, 258, 172, 253, - 252, 251, 250, 249, 248, 247, 246, 245, 244, 243, - 237, 236, 235, 234, 231, 230, 227, 226, 225, 224, - 223, 222, 221, 220, 217, 216, 215, 214, 213, 212, - 209, 208, 207, 206, 205, 204, 203, 200, 199, 193, - 192, 191, 190, 187, 186, 185, 156, 155, 149, 148, - 39, 127, 126, 125, 124, 123, 122, 121, 118, 87, - 39, 37, 835, 3, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835 + 184, 240, 134, 241, 255, 233, 282, 287, 182, 135, + 258, 258, 283, 288, 242, 837, 258, 430, 164, 256, + 68, 257, 257, 257, 257, 257, 257, 258, 258, 258, + 261, 258, 258, 298, 258, 272, 258, 258, 258, 258, + 431, 258, 381, 299, 258, 258, 379, 838, 258, 432, + 440, 289, 258, 290, 258, 258, 291, 292, 380, 258, + 382, 839, 258, 303, 303, 303, 303, 840, 441, 841, + + 258, 842, 433, 258, 303, 303, 303, 303, 304, 303, + 303, 305, 306, 303, 303, 303, 303, 303, 303, 303, + 307, 303, 303, 303, 303, 303, 303, 303, 43, 43, + 43, 43, 43, 43, 843, 844, 434, 308, 132, 309, + 309, 309, 309, 309, 309, 184, 184, 184, 184, 184, + 184, 184, 184, 184, 184, 184, 184, 310, 313, 435, + 321, 325, 311, 314, 132, 322, 326, 438, 328, 847, + 565, 311, 315, 329, 322, 326, 848, 311, 314, 439, + 312, 316, 329, 323, 327, 331, 566, 334, 340, 337, + 332, 330, 335, 341, 338, 482, 845, 846, 483, 332, + + 436, 335, 341, 338, 40, 332, 828, 335, 333, 338, + 336, 342, 339, 343, 346, 349, 352, 355, 344, 347, + 350, 353, 356, 437, 827, 826, 825, 344, 347, 350, + 353, 356, 455, 824, 347, 350, 345, 348, 351, 354, + 357, 358, 361, 364, 823, 456, 359, 362, 365, 498, + 498, 498, 498, 367, 370, 359, 362, 365, 368, 371, + 822, 359, 362, 365, 360, 363, 366, 368, 371, 678, + 373, 821, 679, 368, 371, 374, 369, 372, 383, 820, + 386, 390, 393, 384, 374, 387, 391, 394, 819, 818, + 374, 817, 384, 375, 387, 391, 394, 397, 816, 815, + + 814, 385, 398, 388, 392, 395, 471, 400, 403, 406, + 410, 398, 401, 404, 407, 411, 813, 398, 812, 472, + 399, 401, 404, 407, 411, 811, 810, 401, 404, 407, + 402, 405, 408, 412, 413, 416, 419, 809, 808, 414, + 417, 420, 498, 498, 498, 498, 422, 425, 414, 417, + 420, 423, 426, 807, 414, 417, 420, 415, 418, 421, + 423, 426, 806, 442, 805, 804, 423, 426, 443, 424, + 427, 257, 257, 257, 257, 257, 257, 443, 257, 257, + 257, 257, 257, 257, 453, 453, 444, 453, 453, 803, + 453, 453, 453, 453, 453, 453, 802, 453, 801, 310, + + 453, 453, 800, 799, 453, 313, 485, 453, 453, 798, + 797, 453, 453, 492, 796, 493, 795, 494, 499, 498, + 498, 498, 312, 453, 498, 498, 498, 498, 316, 321, + 495, 498, 498, 498, 498, 309, 309, 309, 309, 309, + 309, 309, 309, 309, 309, 309, 309, 313, 325, 501, + 328, 331, 323, 334, 337, 340, 343, 346, 349, 352, + 355, 358, 361, 364, 367, 370, 373, 383, 386, 390, + 316, 327, 393, 330, 333, 397, 336, 339, 342, 345, + 348, 351, 354, 357, 360, 363, 366, 369, 372, 375, + 385, 388, 392, 400, 403, 395, 406, 410, 399, 413, + + 416, 419, 422, 425, 551, 554, 442, 794, 608, 609, + 655, 658, 793, 792, 736, 737, 402, 405, 791, 408, + 412, 790, 415, 418, 421, 424, 427, 552, 555, 444, + 610, 789, 788, 656, 659, 738, 38, 38, 38, 180, + 180, 787, 786, 785, 784, 783, 782, 781, 780, 779, + 778, 777, 776, 775, 774, 773, 772, 771, 770, 769, + 768, 767, 766, 765, 764, 763, 762, 761, 760, 759, + 758, 757, 756, 755, 754, 753, 659, 752, 751, 656, + 750, 749, 748, 747, 746, 745, 744, 743, 742, 741, + 740, 739, 735, 734, 733, 732, 731, 730, 729, 728, + + 727, 726, 725, 724, 723, 722, 721, 720, 719, 718, + 717, 716, 715, 714, 713, 712, 711, 710, 709, 708, + 707, 706, 705, 704, 703, 702, 701, 700, 699, 698, + 697, 696, 695, 694, 693, 692, 691, 690, 689, 688, + 687, 686, 685, 684, 683, 682, 681, 680, 677, 676, + 675, 674, 673, 672, 671, 670, 669, 668, 667, 666, + 665, 664, 663, 662, 661, 660, 657, 555, 654, 552, + 653, 652, 651, 650, 649, 648, 647, 646, 645, 644, + 643, 642, 641, 640, 639, 638, 637, 636, 635, 634, + 633, 632, 631, 630, 629, 628, 627, 626, 625, 624, + + 623, 622, 621, 620, 619, 618, 617, 616, 615, 614, + 613, 612, 611, 607, 606, 605, 604, 603, 602, 601, + 600, 599, 598, 597, 596, 595, 594, 593, 592, 591, + 590, 589, 588, 587, 586, 585, 584, 583, 582, 581, + 580, 579, 578, 577, 576, 575, 574, 573, 572, 571, + 570, 569, 568, 567, 564, 563, 562, 561, 560, 559, + 558, 557, 444, 556, 553, 550, 437, 549, 435, 548, + 433, 547, 431, 546, 545, 427, 544, 424, 543, 421, + 542, 418, 541, 415, 540, 412, 539, 538, 408, 537, + 405, 536, 402, 535, 399, 534, 533, 395, 532, 392, + + 531, 388, 530, 385, 529, 528, 527, 526, 525, 524, + 375, 523, 372, 522, 369, 521, 366, 520, 363, 519, + 360, 518, 357, 517, 354, 516, 351, 515, 348, 514, + 345, 513, 342, 512, 339, 511, 336, 510, 333, 509, + 330, 508, 327, 507, 323, 506, 505, 504, 503, 502, + 316, 500, 312, 497, 496, 491, 490, 489, 488, 487, + 486, 484, 481, 480, 479, 478, 477, 476, 475, 474, + 473, 470, 469, 466, 465, 464, 463, 462, 461, 460, + 459, 458, 457, 454, 289, 261, 452, 451, 450, 449, + 448, 447, 446, 445, 429, 428, 409, 396, 389, 378, + + 377, 376, 324, 320, 319, 318, 317, 302, 301, 300, + 297, 296, 295, 294, 293, 284, 281, 280, 279, 278, + 277, 276, 275, 274, 273, 271, 270, 269, 268, 267, + 264, 263, 262, 260, 259, 172, 254, 253, 252, 251, + 250, 249, 248, 247, 246, 245, 237, 236, 235, 234, + 231, 230, 227, 226, 225, 224, 223, 222, 221, 220, + 217, 216, 215, 214, 213, 212, 209, 208, 207, 206, + 205, 204, 203, 200, 199, 193, 192, 191, 190, 187, + 186, 185, 156, 155, 149, 148, 39, 127, 126, 125, + 124, 123, 122, 121, 118, 87, 39, 37, 849, 3, + + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849 } ; -static yyconst flex_int16_t yy_chk[1352] = +static yyconst flex_int16_t yy_chk[1368] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -859,7 +865,7 @@ static yyconst flex_int16_t yy_chk[1352] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 23, 5, - 10, 27, 46, 23, 17, 46, 809, 10, 10, 10, + 10, 27, 46, 23, 17, 46, 808, 10, 10, 10, 10, 10, 10, 10, 16, 17, 16, 29, 17, 27, 18, 116, 16, 11, 11, 11, 11, 11, 11, 11, @@ -871,136 +877,137 @@ static yyconst flex_int16_t yy_chk[1352] = 13, 13, 13, 13, 13, 99, 61, 99, 13, 13, 14, 14, 14, 14, 14, 14, 14, 15, 47, 15, 14, 14, 47, 12, 49, 22, 15, 49, 24, 21, - 273, 21, 15, 22, 15, 13, 21, 24, 22, 21, - 25, 24, 25, 25, 22, 273, 811, 14, 45, 45, + 274, 21, 15, 22, 15, 13, 21, 24, 22, 21, + 25, 24, 25, 25, 22, 274, 810, 14, 45, 45, 92, 44, 44, 54, 45, 25, 26, 44, 26, 26, 26, 26, 26, 44, 26, 45, 26, 54, 44, 92, - 44, 813, 26, 26, 54, 26, 41, 43, 43, 43, - 43, 43, 43, 50, 50, 57, 816, 43, 60, 50, - 60, 59, 59, 60, 60, 817, 57, 59, 75, 57, - 50, 60, 57, 140, 75, 59, 821, 84, 59, 63, - 63, 63, 63, 43, 239, 140, 41, 41, 41, 41, + 44, 811, 26, 26, 54, 26, 41, 43, 43, 43, + 43, 43, 43, 50, 50, 57, 812, 43, 60, 50, + 60, 59, 59, 60, 60, 813, 57, 59, 75, 57, + 50, 60, 57, 140, 75, 59, 816, 84, 59, 63, + 63, 63, 63, 43, 817, 140, 41, 41, 41, 41, 41, 41, 62, 41, 41, 84, 159, 41, 41, 41, - 41, 41, 41, 41, 41, 41, 159, 239, 41, 823, + 41, 41, 41, 41, 41, 41, 159, 118, 41, 118, 62, 62, 62, 62, 64, 64, 64, 64, 65, 65, - 65, 65, 66, 66, 66, 66, 66, 66, 108, 825, + 65, 65, 66, 66, 66, 66, 66, 66, 108, 818, 81, 81, 66, 67, 67, 67, 67, 67, 67, 67, 81, 111, 108, 68, 67, 68, 68, 68, 68, 68, 68, 117, 128, 117, 130, 111, 157, 160, 66, 128, - 133, 133, 157, 160, 117, 831, 133, 240, 130, 132, + 133, 133, 157, 160, 117, 823, 133, 239, 130, 132, 67, 132, 132, 132, 132, 132, 132, 133, 136, 136, 136, 146, 146, 169, 136, 147, 147, 146, 161, 161, - 240, 147, 219, 169, 161, 136, 218, 287, 146, 241, - 287, 161, 147, 162, 162, 161, 163, 163, 218, 162, - 219, 832, 163, 173, 173, 173, 173, 837, 573, 805, + 239, 147, 219, 169, 161, 136, 218, 825, 146, 240, + 244, 161, 147, 162, 162, 161, 163, 163, 218, 162, + 219, 827, 163, 173, 173, 173, 173, 830, 244, 831, - 162, 573, 241, 163, 174, 174, 174, 174, 175, 175, + 162, 835, 240, 163, 174, 174, 174, 174, 175, 175, 175, 175, 176, 176, 176, 176, 177, 177, 177, 177, 178, 178, 178, 178, 179, 179, 179, 179, 181, 181, - 181, 181, 181, 181, 828, 828, 242, 182, 181, 182, + 181, 181, 181, 181, 837, 839, 241, 182, 181, 182, 182, 182, 182, 182, 182, 183, 183, 183, 183, 183, - 183, 184, 184, 184, 184, 184, 184, 185, 186, 242, - 192, 194, 185, 186, 181, 192, 194, 243, 195, 804, - 449, 185, 186, 195, 192, 194, 803, 185, 186, 243, - 185, 186, 195, 192, 194, 196, 449, 197, 199, 198, - 196, 195, 197, 199, 198, 302, 302, 302, 302, 196, + 183, 184, 184, 184, 184, 184, 184, 185, 186, 241, + 192, 194, 185, 186, 181, 192, 194, 243, 195, 845, + 452, 185, 186, 195, 192, 194, 846, 185, 186, 243, + 185, 186, 195, 192, 194, 196, 452, 197, 199, 198, + 196, 195, 197, 199, 198, 288, 842, 842, 288, 196, - 800, 197, 199, 198, 799, 196, 798, 197, 196, 198, + 242, 197, 199, 198, 851, 196, 807, 197, 196, 198, 197, 199, 198, 201, 203, 204, 206, 207, 201, 203, - 204, 206, 207, 303, 303, 303, 303, 201, 203, 204, - 206, 207, 259, 797, 203, 204, 201, 203, 204, 206, - 207, 209, 210, 211, 795, 259, 209, 210, 211, 304, - 304, 304, 304, 212, 213, 209, 210, 211, 212, 213, - 794, 209, 210, 211, 209, 210, 211, 212, 213, 793, - 214, 791, 790, 212, 213, 214, 212, 213, 220, 786, - 221, 223, 224, 220, 214, 221, 223, 224, 785, 784, - 214, 783, 220, 214, 221, 223, 224, 226, 781, 779, - - 776, 220, 226, 221, 223, 224, 276, 227, 228, 229, - 231, 226, 227, 228, 229, 231, 775, 226, 773, 276, - 226, 227, 228, 229, 231, 772, 771, 227, 228, 229, - 227, 228, 229, 231, 232, 233, 234, 770, 769, 232, - 233, 234, 305, 305, 305, 305, 235, 236, 232, 233, - 234, 235, 236, 768, 232, 233, 234, 232, 233, 234, - 235, 236, 765, 244, 764, 762, 235, 236, 244, 235, - 236, 255, 255, 255, 255, 255, 255, 244, 256, 256, - 256, 256, 256, 256, 257, 257, 244, 271, 271, 761, - 257, 289, 289, 271, 290, 290, 760, 289, 759, 310, - - 290, 257, 758, 757, 271, 755, 291, 291, 289, 754, - 753, 290, 291, 299, 313, 299, 321, 299, 306, 306, - 306, 306, 310, 291, 307, 307, 307, 307, 307, 307, - 299, 308, 308, 308, 308, 308, 308, 313, 314, 321, - 314, 325, 328, 331, 334, 337, 340, 343, 346, 349, - 352, 355, 358, 361, 364, 367, 370, 373, 383, 386, - 390, 314, 393, 397, 325, 328, 331, 334, 337, 340, - 343, 346, 349, 352, 355, 358, 361, 364, 367, 370, - 373, 383, 386, 390, 400, 393, 397, 403, 406, 410, - 413, 416, 419, 422, 425, 437, 440, 751, 501, 501, - - 550, 636, 636, 749, 748, 745, 742, 400, 741, 729, - 403, 406, 410, 413, 416, 419, 422, 425, 437, 440, - 501, 728, 636, 550, 836, 836, 836, 838, 838, 727, - 698, 691, 690, 687, 686, 685, 684, 683, 682, 681, - 680, 679, 678, 676, 673, 672, 671, 670, 669, 668, - 667, 666, 665, 664, 663, 661, 660, 659, 658, 656, + 204, 206, 207, 242, 806, 804, 803, 201, 203, 204, + 206, 207, 260, 799, 203, 204, 201, 203, 204, 206, + 207, 209, 210, 211, 798, 260, 209, 210, 211, 303, + 303, 303, 303, 212, 213, 209, 210, 211, 212, 213, + 797, 209, 210, 211, 209, 210, 211, 212, 213, 579, + 214, 796, 579, 212, 213, 214, 212, 213, 220, 794, + 221, 223, 224, 220, 214, 221, 223, 224, 792, 790, + 214, 787, 220, 214, 221, 223, 224, 226, 786, 784, + + 783, 220, 226, 221, 223, 224, 277, 227, 228, 229, + 231, 226, 227, 228, 229, 231, 782, 226, 781, 277, + 226, 227, 228, 229, 231, 780, 779, 227, 228, 229, + 227, 228, 229, 231, 232, 233, 234, 776, 775, 232, + 233, 234, 304, 304, 304, 304, 235, 236, 232, 233, + 234, 235, 236, 773, 232, 233, 234, 232, 233, 234, + 235, 236, 772, 245, 771, 770, 235, 236, 245, 235, + 236, 256, 256, 256, 256, 256, 256, 245, 257, 257, + 257, 257, 257, 257, 258, 258, 245, 272, 272, 769, + 258, 290, 290, 272, 291, 291, 768, 290, 766, 311, + + 291, 258, 765, 764, 272, 314, 292, 292, 290, 762, + 760, 291, 292, 300, 759, 300, 756, 300, 305, 305, + 305, 305, 311, 292, 306, 306, 306, 306, 314, 322, + 300, 307, 307, 307, 307, 308, 308, 308, 308, 308, + 308, 309, 309, 309, 309, 309, 309, 315, 326, 315, + 329, 332, 322, 335, 338, 341, 344, 347, 350, 353, + 356, 359, 362, 365, 368, 371, 374, 384, 387, 391, + 315, 326, 394, 329, 332, 398, 335, 338, 341, 344, + 347, 350, 353, 356, 359, 362, 365, 368, 371, 374, + 384, 387, 391, 401, 404, 394, 407, 411, 398, 414, + + 417, 420, 423, 426, 438, 440, 443, 753, 504, 504, + 553, 556, 752, 751, 642, 642, 401, 404, 750, 407, + 411, 738, 414, 417, 420, 423, 426, 438, 440, 443, + 504, 737, 736, 553, 556, 642, 850, 850, 850, 852, + 852, 707, 700, 699, 696, 695, 694, 693, 692, 691, + 690, 689, 688, 687, 685, 682, 681, 680, 679, 678, + 677, 676, 675, 674, 673, 672, 670, 669, 668, 667, + 665, 663, 662, 661, 660, 659, 658, 657, 656, 655, 654, 653, 652, 651, 650, 649, 648, 647, 646, 645, - 644, 643, 642, 641, 640, 639, 638, 637, 635, 634, - 633, 632, 631, 630, 629, 628, 627, 624, 623, 622, - 621, 620, 619, 618, 617, 616, 615, 614, 613, 612, + 644, 643, 641, 640, 639, 638, 637, 636, 635, 634, - 611, 610, 609, 608, 607, 606, 604, 603, 602, 601, - 600, 599, 598, 597, 596, 595, 594, 593, 592, 591, - 590, 589, 587, 586, 585, 584, 583, 581, 580, 579, - 578, 577, 576, 575, 572, 571, 569, 568, 567, 566, - 563, 562, 561, 560, 559, 558, 557, 555, 554, 553, - 552, 551, 549, 548, 547, 546, 545, 544, 543, 542, - 541, 540, 539, 538, 537, 536, 535, 534, 533, 532, - 531, 530, 529, 528, 527, 523, 522, 521, 520, 519, - 518, 517, 516, 515, 514, 513, 512, 511, 510, 509, - 508, 507, 506, 505, 504, 503, 502, 499, 498, 497, - - 494, 493, 492, 491, 490, 489, 487, 485, 484, 483, - 481, 480, 479, 478, 477, 476, 475, 474, 473, 472, - 471, 470, 469, 468, 467, 466, 465, 464, 462, 461, - 460, 459, 458, 457, 456, 453, 452, 451, 448, 447, - 446, 445, 444, 443, 442, 441, 439, 438, 436, 435, - 434, 433, 432, 431, 430, 429, 427, 426, 424, 423, - 421, 420, 418, 417, 415, 414, 412, 411, 409, 408, - 407, 405, 404, 402, 401, 399, 398, 396, 395, 394, - 392, 391, 389, 387, 385, 384, 382, 381, 379, 377, - 376, 375, 374, 372, 371, 369, 368, 366, 365, 363, - - 362, 360, 359, 357, 356, 354, 353, 351, 350, 348, - 347, 345, 344, 342, 341, 339, 338, 336, 335, 333, - 332, 330, 329, 327, 326, 324, 322, 320, 319, 318, - 317, 316, 315, 312, 311, 309, 301, 300, 298, 297, - 296, 295, 294, 293, 288, 286, 285, 284, 283, 282, - 281, 280, 279, 277, 275, 274, 272, 270, 269, 266, - 265, 264, 263, 262, 261, 260, 258, 254, 253, 252, - 251, 250, 249, 248, 247, 246, 245, 238, 237, 230, - 225, 222, 217, 216, 215, 193, 191, 190, 189, 187, - 172, 171, 170, 168, 167, 166, 165, 164, 158, 156, - - 155, 154, 153, 152, 151, 150, 149, 148, 145, 144, - 143, 142, 141, 139, 138, 137, 135, 134, 131, 129, - 127, 126, 125, 124, 123, 122, 121, 120, 119, 118, - 115, 114, 113, 112, 110, 109, 107, 106, 105, 104, - 103, 102, 101, 100, 98, 97, 96, 95, 94, 93, - 91, 90, 89, 88, 87, 86, 85, 83, 82, 79, - 78, 77, 76, 74, 73, 72, 56, 55, 52, 51, - 38, 37, 35, 34, 33, 32, 31, 30, 28, 20, - 8, 7, 3, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835, 835, 835, 835, 835, 835, 835, 835, 835, 835, - 835 + 633, 630, 629, 628, 627, 626, 625, 624, 623, 622, + 621, 620, 619, 618, 617, 616, 615, 614, 613, 612, + 610, 609, 608, 607, 606, 605, 604, 603, 602, 601, + 600, 599, 598, 597, 596, 595, 593, 592, 591, 590, + 589, 587, 586, 585, 584, 583, 582, 581, 578, 577, + 575, 574, 573, 572, 569, 568, 567, 566, 565, 564, + 563, 561, 560, 559, 558, 557, 555, 554, 552, 551, + 550, 549, 548, 547, 546, 545, 544, 543, 542, 541, + 540, 539, 538, 537, 536, 535, 534, 533, 532, 531, + 530, 526, 525, 524, 523, 522, 521, 520, 519, 518, + + 517, 516, 515, 514, 513, 512, 511, 510, 509, 508, + 507, 506, 505, 502, 501, 500, 497, 496, 495, 494, + 493, 492, 490, 488, 487, 486, 484, 483, 482, 481, + 480, 479, 478, 477, 476, 475, 474, 473, 472, 471, + 470, 469, 468, 467, 465, 464, 463, 462, 461, 460, + 459, 456, 455, 454, 451, 450, 449, 448, 447, 446, + 445, 444, 442, 441, 439, 437, 436, 435, 434, 433, + 432, 431, 430, 428, 427, 425, 424, 422, 421, 419, + 418, 416, 415, 413, 412, 410, 409, 408, 406, 405, + 403, 402, 400, 399, 397, 396, 395, 393, 392, 390, + + 388, 386, 385, 383, 382, 380, 378, 377, 376, 375, + 373, 372, 370, 369, 367, 366, 364, 363, 361, 360, + 358, 357, 355, 354, 352, 351, 349, 348, 346, 345, + 343, 342, 340, 339, 337, 336, 334, 333, 331, 330, + 328, 327, 325, 323, 321, 320, 319, 318, 317, 316, + 313, 312, 310, 302, 301, 299, 298, 297, 296, 295, + 294, 289, 287, 286, 285, 284, 283, 282, 281, 280, + 278, 276, 275, 273, 271, 270, 267, 266, 265, 264, + 263, 262, 261, 259, 255, 254, 253, 252, 251, 250, + 249, 248, 247, 246, 238, 237, 230, 225, 222, 217, + + 216, 215, 193, 191, 190, 189, 187, 172, 171, 170, + 168, 167, 166, 165, 164, 158, 156, 155, 154, 153, + 152, 151, 150, 149, 148, 145, 144, 143, 142, 141, + 139, 138, 137, 135, 134, 131, 129, 127, 126, 125, + 124, 123, 122, 121, 120, 119, 115, 114, 113, 112, + 110, 109, 107, 106, 105, 104, 103, 102, 101, 100, + 98, 97, 96, 95, 94, 93, 91, 90, 89, 88, + 87, 86, 85, 83, 82, 79, 78, 77, 76, 74, + 73, 72, 56, 55, 52, 51, 38, 37, 35, 34, + 33, 32, 31, 30, 28, 20, 8, 7, 3, 849, + + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, + 849, 849, 849, 849, 849, 849, 849 } ; /* The intent behind this definition is that it'll catch @@ -1153,7 +1160,7 @@ handle_ident(struct asm_parser_state *state, const char *text, YYSTYPE *lval) } while(0); #define YY_EXTRA_TYPE struct asm_parser_state * -#line 1157 "lex.yy.c" +#line 1164 "lex.yy.c" #define INITIAL 0 @@ -1402,7 +1409,7 @@ YY_DECL #line 156 "program_lexer.l" -#line 1406 "lex.yy.c" +#line 1413 "lex.yy.c" yylval = yylval_param; @@ -1459,13 +1466,13 @@ yy_match: while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 836 ) + if ( yy_current_state >= 850 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; ++yy_cp; } - while ( yy_base[yy_current_state] != 1284 ); + while ( yy_base[yy_current_state] != 1300 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -1799,445 +1806,455 @@ YY_RULE_SETUP YY_BREAK case 62: YY_RULE_SETUP -#line 236 "program_lexer.l" -{ return_opcode(require_NV_fp, TRI_OP, X2D, 3); } +#line 235 "program_lexer.l" +{ return_opcode(require_NV_fp, SCALAR_OP, UP4B, 4); } YY_BREAK case 63: YY_RULE_SETUP -#line 237 "program_lexer.l" -{ return_opcode( 1, BIN_OP, XPD, 3); } +#line 236 "program_lexer.l" +{ return_opcode(require_NV_fp, SCALAR_OP, UP4UB, 5); } YY_BREAK case 64: YY_RULE_SETUP -#line 239 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_vp, VERTEX); } +#line 238 "program_lexer.l" +{ return_opcode(require_NV_fp, TRI_OP, X2D, 3); } YY_BREAK case 65: YY_RULE_SETUP -#line 240 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, FRAGMENT); } +#line 239 "program_lexer.l" +{ return_opcode( 1, BIN_OP, XPD, 3); } YY_BREAK case 66: YY_RULE_SETUP #line 241 "program_lexer.l" -{ return PROGRAM; } +{ return_token_or_IDENTIFIER(require_ARB_vp, VERTEX); } YY_BREAK case 67: YY_RULE_SETUP #line 242 "program_lexer.l" -{ return STATE; } +{ return_token_or_IDENTIFIER(require_ARB_fp, FRAGMENT); } YY_BREAK case 68: YY_RULE_SETUP #line 243 "program_lexer.l" -{ return RESULT; } +{ return PROGRAM; } YY_BREAK case 69: YY_RULE_SETUP -#line 245 "program_lexer.l" -{ return AMBIENT; } +#line 244 "program_lexer.l" +{ return STATE; } YY_BREAK case 70: YY_RULE_SETUP -#line 246 "program_lexer.l" -{ return ATTENUATION; } +#line 245 "program_lexer.l" +{ return RESULT; } YY_BREAK case 71: YY_RULE_SETUP #line 247 "program_lexer.l" -{ return BACK; } +{ return AMBIENT; } YY_BREAK case 72: YY_RULE_SETUP #line 248 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, CLIP); } +{ return ATTENUATION; } YY_BREAK case 73: YY_RULE_SETUP #line 249 "program_lexer.l" -{ return COLOR; } +{ return BACK; } YY_BREAK case 74: YY_RULE_SETUP #line 250 "program_lexer.l" -{ return_token_or_DOT(require_ARB_fp, DEPTH); } +{ return_token_or_DOT(require_ARB_vp, CLIP); } YY_BREAK case 75: YY_RULE_SETUP #line 251 "program_lexer.l" -{ return DIFFUSE; } +{ return COLOR; } YY_BREAK case 76: YY_RULE_SETUP #line 252 "program_lexer.l" -{ return DIRECTION; } +{ return_token_or_DOT(require_ARB_fp, DEPTH); } YY_BREAK case 77: YY_RULE_SETUP #line 253 "program_lexer.l" -{ return EMISSION; } +{ return DIFFUSE; } YY_BREAK case 78: YY_RULE_SETUP #line 254 "program_lexer.l" -{ return ENV; } +{ return DIRECTION; } YY_BREAK case 79: YY_RULE_SETUP #line 255 "program_lexer.l" -{ return EYE; } +{ return EMISSION; } YY_BREAK case 80: YY_RULE_SETUP #line 256 "program_lexer.l" -{ return FOGCOORD; } +{ return ENV; } YY_BREAK case 81: YY_RULE_SETUP #line 257 "program_lexer.l" -{ return FOG; } +{ return EYE; } YY_BREAK case 82: YY_RULE_SETUP #line 258 "program_lexer.l" -{ return FRONT; } +{ return FOGCOORD; } YY_BREAK case 83: YY_RULE_SETUP #line 259 "program_lexer.l" -{ return HALF; } +{ return FOG; } YY_BREAK case 84: YY_RULE_SETUP #line 260 "program_lexer.l" -{ return INVERSE; } +{ return FRONT; } YY_BREAK case 85: YY_RULE_SETUP #line 261 "program_lexer.l" -{ return INVTRANS; } +{ return HALF; } YY_BREAK case 86: YY_RULE_SETUP #line 262 "program_lexer.l" -{ return LIGHT; } +{ return INVERSE; } YY_BREAK case 87: YY_RULE_SETUP #line 263 "program_lexer.l" -{ return LIGHTMODEL; } +{ return INVTRANS; } YY_BREAK case 88: YY_RULE_SETUP #line 264 "program_lexer.l" -{ return LIGHTPROD; } +{ return LIGHT; } YY_BREAK case 89: YY_RULE_SETUP #line 265 "program_lexer.l" -{ return LOCAL; } +{ return LIGHTMODEL; } YY_BREAK case 90: YY_RULE_SETUP #line 266 "program_lexer.l" -{ return MATERIAL; } +{ return LIGHTPROD; } YY_BREAK case 91: YY_RULE_SETUP #line 267 "program_lexer.l" -{ return MAT_PROGRAM; } +{ return LOCAL; } YY_BREAK case 92: YY_RULE_SETUP #line 268 "program_lexer.l" -{ return MATRIX; } +{ return MATERIAL; } YY_BREAK case 93: YY_RULE_SETUP #line 269 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, MATRIXINDEX); } +{ return MAT_PROGRAM; } YY_BREAK case 94: YY_RULE_SETUP #line 270 "program_lexer.l" -{ return MODELVIEW; } +{ return MATRIX; } YY_BREAK case 95: YY_RULE_SETUP #line 271 "program_lexer.l" -{ return MVP; } +{ return_token_or_DOT(require_ARB_vp, MATRIXINDEX); } YY_BREAK case 96: YY_RULE_SETUP #line 272 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, NORMAL); } +{ return MODELVIEW; } YY_BREAK case 97: YY_RULE_SETUP #line 273 "program_lexer.l" -{ return OBJECT; } +{ return MVP; } YY_BREAK case 98: YY_RULE_SETUP #line 274 "program_lexer.l" -{ return PALETTE; } +{ return_token_or_DOT(require_ARB_vp, NORMAL); } YY_BREAK case 99: YY_RULE_SETUP #line 275 "program_lexer.l" -{ return PARAMS; } +{ return OBJECT; } YY_BREAK case 100: YY_RULE_SETUP #line 276 "program_lexer.l" -{ return PLANE; } +{ return PALETTE; } YY_BREAK case 101: YY_RULE_SETUP #line 277 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, POINT_TOK); } +{ return PARAMS; } YY_BREAK case 102: YY_RULE_SETUP #line 278 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, POINTSIZE); } +{ return PLANE; } YY_BREAK case 103: YY_RULE_SETUP #line 279 "program_lexer.l" -{ return POSITION; } +{ return_token_or_DOT(require_ARB_vp, POINT_TOK); } YY_BREAK case 104: YY_RULE_SETUP #line 280 "program_lexer.l" -{ return PRIMARY; } +{ return_token_or_DOT(require_ARB_vp, POINTSIZE); } YY_BREAK case 105: YY_RULE_SETUP #line 281 "program_lexer.l" -{ return PROJECTION; } +{ return POSITION; } YY_BREAK case 106: YY_RULE_SETUP #line 282 "program_lexer.l" -{ return_token_or_DOT(require_ARB_fp, RANGE); } +{ return PRIMARY; } YY_BREAK case 107: YY_RULE_SETUP #line 283 "program_lexer.l" -{ return ROW; } +{ return PROJECTION; } YY_BREAK case 108: YY_RULE_SETUP #line 284 "program_lexer.l" -{ return SCENECOLOR; } +{ return_token_or_DOT(require_ARB_fp, RANGE); } YY_BREAK case 109: YY_RULE_SETUP #line 285 "program_lexer.l" -{ return SECONDARY; } +{ return ROW; } YY_BREAK case 110: YY_RULE_SETUP #line 286 "program_lexer.l" -{ return SHININESS; } +{ return SCENECOLOR; } YY_BREAK case 111: YY_RULE_SETUP #line 287 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, SIZE_TOK); } +{ return SECONDARY; } YY_BREAK case 112: YY_RULE_SETUP #line 288 "program_lexer.l" -{ return SPECULAR; } +{ return SHININESS; } YY_BREAK case 113: YY_RULE_SETUP #line 289 "program_lexer.l" -{ return SPOT; } +{ return_token_or_DOT(require_ARB_vp, SIZE_TOK); } YY_BREAK case 114: YY_RULE_SETUP #line 290 "program_lexer.l" -{ return TEXCOORD; } +{ return SPECULAR; } YY_BREAK case 115: YY_RULE_SETUP #line 291 "program_lexer.l" -{ return_token_or_DOT(require_ARB_fp, TEXENV); } +{ return SPOT; } YY_BREAK case 116: YY_RULE_SETUP #line 292 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, TEXGEN); } +{ return TEXCOORD; } YY_BREAK case 117: YY_RULE_SETUP #line 293 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, TEXGEN_Q); } +{ return_token_or_DOT(require_ARB_fp, TEXENV); } YY_BREAK case 118: YY_RULE_SETUP #line 294 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, TEXGEN_S); } +{ return_token_or_DOT(require_ARB_vp, TEXGEN); } YY_BREAK case 119: YY_RULE_SETUP #line 295 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, TEXGEN_T); } +{ return_token_or_DOT(require_ARB_vp, TEXGEN_Q); } YY_BREAK case 120: YY_RULE_SETUP #line 296 "program_lexer.l" -{ return TEXTURE; } +{ return_token_or_DOT(require_ARB_vp, TEXGEN_S); } YY_BREAK case 121: YY_RULE_SETUP #line 297 "program_lexer.l" -{ return TRANSPOSE; } +{ return_token_or_DOT(require_ARB_vp, TEXGEN_T); } YY_BREAK case 122: YY_RULE_SETUP #line 298 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, VTXATTRIB); } +{ return TEXTURE; } YY_BREAK case 123: YY_RULE_SETUP #line 299 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, WEIGHT); } +{ return TRANSPOSE; } YY_BREAK case 124: YY_RULE_SETUP -#line 301 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, TEXTURE_UNIT); } +#line 300 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, VTXATTRIB); } YY_BREAK case 125: YY_RULE_SETUP -#line 302 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_1D); } +#line 301 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, WEIGHT); } YY_BREAK case 126: YY_RULE_SETUP #line 303 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_2D); } +{ return_token_or_IDENTIFIER(require_ARB_fp, TEXTURE_UNIT); } YY_BREAK case 127: YY_RULE_SETUP #line 304 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_3D); } +{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_1D); } YY_BREAK case 128: YY_RULE_SETUP #line 305 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_CUBE); } +{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_2D); } YY_BREAK case 129: YY_RULE_SETUP #line 306 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_rect, TEX_RECT); } +{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_3D); } YY_BREAK case 130: YY_RULE_SETUP #line 307 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW1D); } +{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_CUBE); } YY_BREAK case 131: YY_RULE_SETUP #line 308 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW2D); } +{ return_token_or_IDENTIFIER(require_ARB_fp && require_rect, TEX_RECT); } YY_BREAK case 132: YY_RULE_SETUP #line 309 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_rect, TEX_SHADOWRECT); } +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW1D); } YY_BREAK case 133: YY_RULE_SETUP #line 310 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY1D); } +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW2D); } YY_BREAK case 134: YY_RULE_SETUP #line 311 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY2D); } +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_rect, TEX_SHADOWRECT); } YY_BREAK case 135: YY_RULE_SETUP #line 312 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW1D); } +{ return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY1D); } YY_BREAK case 136: YY_RULE_SETUP #line 313 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW2D); } +{ return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY2D); } YY_BREAK case 137: YY_RULE_SETUP -#line 315 "program_lexer.l" -{ return handle_ident(yyextra, yytext, yylval); } +#line 314 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW1D); } YY_BREAK case 138: YY_RULE_SETUP -#line 317 "program_lexer.l" -{ return DOT_DOT; } +#line 315 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW2D); } YY_BREAK case 139: YY_RULE_SETUP +#line 317 "program_lexer.l" +{ return handle_ident(yyextra, yytext, yylval); } + YY_BREAK +case 140: +YY_RULE_SETUP #line 319 "program_lexer.l" +{ return DOT_DOT; } + YY_BREAK +case 141: +YY_RULE_SETUP +#line 321 "program_lexer.l" { yylval->integer = strtol(yytext, NULL, 10); return INTEGER; } YY_BREAK -case 140: +case 142: YY_RULE_SETUP -#line 323 "program_lexer.l" +#line 325 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; } YY_BREAK -case 141: -/* rule 141 can match eol */ +case 143: +/* rule 143 can match eol */ *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 327 "program_lexer.l" +#line 329 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; } YY_BREAK -case 142: +case 144: YY_RULE_SETUP -#line 331 "program_lexer.l" +#line 333 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; } YY_BREAK -case 143: +case 145: YY_RULE_SETUP -#line 335 "program_lexer.l" +#line 337 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; } YY_BREAK -case 144: +case 146: YY_RULE_SETUP -#line 340 "program_lexer.l" +#line 342 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; return MASK4; } YY_BREAK -case 145: +case 147: YY_RULE_SETUP -#line 346 "program_lexer.l" +#line 348 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@ -2245,27 +2262,27 @@ YY_RULE_SETUP return MASK3; } YY_BREAK -case 146: +case 148: YY_RULE_SETUP -#line 352 "program_lexer.l" +#line 354 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; return MASK3; } YY_BREAK -case 147: +case 149: YY_RULE_SETUP -#line 357 "program_lexer.l" +#line 359 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; return MASK3; } YY_BREAK -case 148: +case 150: YY_RULE_SETUP -#line 363 "program_lexer.l" +#line 365 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@ -2273,9 +2290,9 @@ YY_RULE_SETUP return MASK2; } YY_BREAK -case 149: +case 151: YY_RULE_SETUP -#line 369 "program_lexer.l" +#line 371 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@ -2283,18 +2300,18 @@ YY_RULE_SETUP return MASK2; } YY_BREAK -case 150: +case 152: YY_RULE_SETUP -#line 375 "program_lexer.l" +#line 377 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; return MASK2; } YY_BREAK -case 151: +case 153: YY_RULE_SETUP -#line 381 "program_lexer.l" +#line 383 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@ -2302,9 +2319,9 @@ YY_RULE_SETUP return MASK1; } YY_BREAK -case 152: +case 154: YY_RULE_SETUP -#line 388 "program_lexer.l" +#line 390 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@ -2314,18 +2331,18 @@ YY_RULE_SETUP return SWIZZLE; } YY_BREAK -case 153: +case 155: YY_RULE_SETUP -#line 397 "program_lexer.l" +#line 399 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; return_token_or_DOT(require_ARB_fp, MASK4); } YY_BREAK -case 154: +case 156: YY_RULE_SETUP -#line 403 "program_lexer.l" +#line 405 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@ -2333,27 +2350,27 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK3); } YY_BREAK -case 155: +case 157: YY_RULE_SETUP -#line 409 "program_lexer.l" +#line 411 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; return_token_or_DOT(require_ARB_fp, MASK3); } YY_BREAK -case 156: +case 158: YY_RULE_SETUP -#line 414 "program_lexer.l" +#line 416 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; return_token_or_DOT(require_ARB_fp, MASK3); } YY_BREAK -case 157: +case 159: YY_RULE_SETUP -#line 420 "program_lexer.l" +#line 422 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@ -2361,9 +2378,9 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK2); } YY_BREAK -case 158: +case 160: YY_RULE_SETUP -#line 426 "program_lexer.l" +#line 428 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@ -2371,18 +2388,18 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK2); } YY_BREAK -case 159: +case 161: YY_RULE_SETUP -#line 432 "program_lexer.l" +#line 434 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; return_token_or_DOT(require_ARB_fp, MASK2); } YY_BREAK -case 160: +case 162: YY_RULE_SETUP -#line 438 "program_lexer.l" +#line 440 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@ -2390,9 +2407,9 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK1); } YY_BREAK -case 161: +case 163: YY_RULE_SETUP -#line 446 "program_lexer.l" +#line 448 "program_lexer.l" { if (require_ARB_vp) { return TEXGEN_R; @@ -2404,9 +2421,9 @@ YY_RULE_SETUP } } YY_BREAK -case 162: +case 164: YY_RULE_SETUP -#line 457 "program_lexer.l" +#line 459 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@ -2416,15 +2433,15 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, SWIZZLE); } YY_BREAK -case 163: +case 165: YY_RULE_SETUP -#line 466 "program_lexer.l" +#line 468 "program_lexer.l" { return DOT; } YY_BREAK -case 164: -/* rule 164 can match eol */ +case 166: +/* rule 166 can match eol */ YY_RULE_SETUP -#line 468 "program_lexer.l" +#line 470 "program_lexer.l" { yylloc->first_line++; yylloc->first_column = 1; @@ -2433,30 +2450,30 @@ YY_RULE_SETUP yylloc->position++; } YY_BREAK -case 165: +case 167: YY_RULE_SETUP -#line 475 "program_lexer.l" +#line 477 "program_lexer.l" /* eat whitespace */ ; YY_BREAK -case 166: +case 168: *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 476 "program_lexer.l" +#line 478 "program_lexer.l" /* eat comments */ ; YY_BREAK -case 167: +case 169: YY_RULE_SETUP -#line 477 "program_lexer.l" +#line 479 "program_lexer.l" { return yytext[0]; } YY_BREAK -case 168: +case 170: YY_RULE_SETUP -#line 478 "program_lexer.l" +#line 480 "program_lexer.l" ECHO; YY_BREAK -#line 2460 "lex.yy.c" +#line 2477 "lex.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -2750,7 +2767,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 836 ) + if ( yy_current_state >= 850 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -2779,11 +2796,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 836 ) + if ( yy_current_state >= 850 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 835); + yy_is_jam = (yy_current_state == 849); return yy_is_jam ? 0 : yy_current_state; } @@ -3631,7 +3648,7 @@ void yyfree (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 478 "program_lexer.l" +#line 480 "program_lexer.l" diff --git a/src/mesa/shader/program_lexer.l b/src/mesa/shader/program_lexer.l index 750c6acf42..8498c3d8fc 100644 --- a/src/mesa/shader/program_lexer.l +++ b/src/mesa/shader/program_lexer.l @@ -232,6 +232,8 @@ TXP{cc}{sat} { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, 3); } UP2H{cc}{sat} { return_opcode(require_NV_fp, SCALAR_OP, UP2H, 4); } UP2US{cc}{sat} { return_opcode(require_NV_fp, SCALAR_OP, UP2US, 5); } +UP4B{cc}{sat} { return_opcode(require_NV_fp, SCALAR_OP, UP4B, 4); } +UP4UB{cc}{sat} { return_opcode(require_NV_fp, SCALAR_OP, UP4UB, 5); } X2D{szf}{cc}{sat} { return_opcode(require_NV_fp, TRI_OP, X2D, 3); } XPD{sat} { return_opcode( 1, BIN_OP, XPD, 3); } -- cgit v1.2.3 From e33ea11c143596d511331aceabbf60016869c304 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 24 Sep 2009 13:38:27 -0600 Subject: mesa: remove: unused gl_vertex_program::TnlData field --- src/mesa/main/mtypes.h | 1 - src/mesa/shader/program.c | 7 ------- 2 files changed, 8 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 54fa8981dd..4757c3efa5 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1834,7 +1834,6 @@ struct gl_vertex_program struct gl_program Base; /**< base class */ GLboolean IsNVProgram; /**< is this a GL_NV_vertex_program program? */ GLboolean IsPositionInvariant; - void *TnlData; /**< should probably use Base.DriverData */ }; diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index 2cd6eb8a38..532adf4d36 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -351,13 +351,6 @@ _mesa_delete_program(GLcontext *ctx, struct gl_program *prog) _mesa_free_parameter_list(prog->Attributes); } - /* XXX this is a little ugly */ - if (prog->Target == GL_VERTEX_PROGRAM_ARB) { - struct gl_vertex_program *vprog = (struct gl_vertex_program *) prog; - if (vprog->TnlData) - _mesa_free(vprog->TnlData); - } - _mesa_free(prog); } -- cgit v1.2.3 From 0876618a8d118b39b80963cc0d5e7a118961aa83 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 24 Sep 2009 19:33:22 -0600 Subject: mesa: _mesa_meta_GenerateMipmap() now working Handles GL_TEXTURE_1D, GL_TEXTURE_2D, GL_TEXTURE_CUBE_MAP. But GL_TEXTURE_3D and texture borders not supported yet. --- src/mesa/drivers/common/meta.c | 205 ++++++++++++++++++++++++++++++++++------- 1 file changed, 172 insertions(+), 33 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 21756786c5..b445323aab 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -1939,6 +1939,10 @@ _mesa_meta_Bitmap(GLcontext *ctx, } +/** + * Called via ctx->Driver.GenerateMipmap() + * Note: texture borders and 3D texture support not yet complete. + */ void _mesa_meta_GenerateMipmap(GLcontext *ctx, GLenum target, struct gl_texture_object *texObj) @@ -1952,13 +1956,20 @@ _mesa_meta_GenerateMipmap(GLcontext *ctx, GLenum target, const GLuint maxLevel = texObj->MaxLevel; const GLenum minFilterSave = texObj->MinFilter; const GLenum magFilterSave = texObj->MagFilter; + const GLint baseLevelSave = texObj->BaseLevel; + const GLint maxLevelSave = texObj->MaxLevel; + const GLboolean genMipmapSave = texObj->GenerateMipmap; + const GLenum wrapSSave = texObj->WrapS; + const GLenum wrapTSave = texObj->WrapT; + const GLenum wrapRSave = texObj->WrapR; const GLuint fboSave = ctx->DrawBuffer->Name; GLenum faceTarget; - GLuint level; + GLuint dstLevel; GLuint border = 0; /* check for fallbacks */ - if (!ctx->Extensions.EXT_framebuffer_object) { + if (!ctx->Extensions.EXT_framebuffer_object || + target == GL_TEXTURE_3D) { _mesa_generate_mipmap(ctx, target, texObj); return; } @@ -2007,12 +2018,16 @@ _mesa_meta_GenerateMipmap(GLcontext *ctx, GLenum target, _mesa_TexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_LINEAR); _mesa_TexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + _mesa_TexParameteri(target, GL_GENERATE_MIPMAP, GL_FALSE); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); + _mesa_set_enable(ctx, target, GL_TRUE); /* setup texcoords once (XXX what about border?) */ switch (faceTarget) { - case GL_TEXTURE_CUBE_MAP_POSITIVE_X: - break; + case GL_TEXTURE_1D: case GL_TEXTURE_2D: verts[0].s = 0.0F; verts[0].t = 0.0F; @@ -2027,63 +2042,180 @@ _mesa_meta_GenerateMipmap(GLcontext *ctx, GLenum target, verts[3].t = 1.0F; verts[3].r = 0.0F; break; + case GL_TEXTURE_3D: + abort(); + break; + default: + /* cube face */ + { + static const GLfloat st[4][2] = { + {0.0f, 0.0f}, {1.0f, 0.0f}, {1.0f, 1.0f}, {0.0f, 1.0f} + }; + GLuint i; + + /* loop over quad verts */ + for (i = 0; i < 4; i++) { + /* Compute sc = +/-scale and tc = +/-scale. + * Not +/-1 to avoid cube face selection ambiguity near the edges, + * though that can still sometimes happen with this scale factor... + */ + const GLfloat scale = 0.9999f; + const GLfloat sc = (2.0f * st[i][0] - 1.0f) * scale; + const GLfloat tc = (2.0f * st[i][1] - 1.0f) * scale; + + switch (faceTarget) { + case GL_TEXTURE_CUBE_MAP_POSITIVE_X: + verts[i].s = 1.0f; + verts[i].t = -tc; + verts[i].r = -sc; + break; + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + verts[i].s = -1.0f; + verts[i].t = -tc; + verts[i].r = sc; + break; + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + verts[i].s = sc; + verts[i].t = 1.0f; + verts[i].r = tc; + break; + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + verts[i].s = sc; + verts[i].t = -1.0f; + verts[i].r = -tc; + break; + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + verts[i].s = sc; + verts[i].t = -tc; + verts[i].r = 1.0f; + break; + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + verts[i].s = -sc; + verts[i].t = -tc; + verts[i].r = -1.0f; + break; + default: + assert(0); + } + } + } } + _mesa_set_enable(ctx, target, GL_TRUE); + + /* texture is already locked, unlock now */ + _mesa_unlock_texture(ctx, texObj); - for (level = baseLevel + 1; level <= maxLevel; level++) { + for (dstLevel = baseLevel + 1; dstLevel <= maxLevel; dstLevel++) { const struct gl_texture_image *srcImage; - const GLuint srcLevel = level - 1; - GLsizei srcWidth, srcHeight; - GLsizei newWidth, newHeight; + const GLuint srcLevel = dstLevel - 1; + GLsizei srcWidth, srcHeight, srcDepth; + GLsizei dstWidth, dstHeight, dstDepth; GLenum status; - srcImage = _mesa_select_tex_image(ctx, texObj, target, srcLevel); + srcImage = _mesa_select_tex_image(ctx, texObj, faceTarget, srcLevel); assert(srcImage->Border == 0); /* XXX we can fix this */ + /* src size w/out border */ srcWidth = srcImage->Width - 2 * border; srcHeight = srcImage->Height - 2 * border; + srcDepth = srcImage->Depth - 2 * border; - newWidth = MAX2(1, srcWidth / 2) + 2 * border; - newHeight = MAX2(1, srcHeight / 2) + 2 * border; + /* new dst size w/ border */ + dstWidth = MAX2(1, srcWidth / 2) + 2 * border; + dstHeight = MAX2(1, srcHeight / 2) + 2 * border; + dstDepth = MAX2(1, srcDepth / 2) + 2 * border; - if (newWidth == srcImage->Width && newHeight == srcImage->Height) { - break; + if (dstWidth == srcImage->Width && + dstHeight == srcImage->Height && + dstDepth == srcImage->Depth) { + /* all done */ + break; } - /* Create empty image */ - _mesa_TexImage2D(GL_TEXTURE_2D, level, srcImage->InternalFormat, - newWidth, newHeight, border, - GL_RGBA, GL_UNSIGNED_BYTE, NULL); + /* Create empty dest image */ + if (target == GL_TEXTURE_1D) { + _mesa_TexImage1D(target, dstLevel, srcImage->InternalFormat, + dstWidth, border, + GL_RGBA, GL_UNSIGNED_BYTE, NULL); + } + else if (target == GL_TEXTURE_3D) { + _mesa_TexImage3D(target, dstLevel, srcImage->InternalFormat, + dstWidth, dstHeight, dstDepth, border, + GL_RGBA, GL_UNSIGNED_BYTE, NULL); + } + else { + /* 2D or cube */ + _mesa_TexImage2D(faceTarget, dstLevel, srcImage->InternalFormat, + dstWidth, dstHeight, border, + GL_RGBA, GL_UNSIGNED_BYTE, NULL); + + if (target == GL_TEXTURE_CUBE_MAP) { + /* If texturing from a cube, we need to make sure all src faces + * have been defined (even if we're not sampling from them.) + * Otherwise the texture object will be 'incomplete' and + * texturing from it will not be allowed. + */ + GLuint face; + for (face = 0; face < 6; face++) { + if (!texObj->Image[face][srcLevel] || + texObj->Image[face][srcLevel]->Width != srcWidth) { + _mesa_TexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + face, + srcLevel, srcImage->InternalFormat, + srcWidth, srcHeight, border, + GL_RGBA, GL_UNSIGNED_BYTE, NULL); + } + } + } + } - /* vertex positions */ + /* setup vertex positions */ { verts[0].x = 0.0F; verts[0].y = 0.0F; - verts[1].x = (GLfloat) newWidth; + verts[1].x = (GLfloat) dstWidth; verts[1].y = 0.0F; - verts[2].x = (GLfloat) newWidth; - verts[2].y = (GLfloat) newHeight; + verts[2].x = (GLfloat) dstWidth; + verts[2].y = (GLfloat) dstHeight; verts[3].x = 0.0F; - verts[3].y = (GLfloat) newHeight; + verts[3].y = (GLfloat) dstHeight; /* upload new vertex data */ _mesa_BufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, sizeof(verts), verts); } /* limit sampling to src level */ - _mesa_TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, srcLevel); - _mesa_TexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, srcLevel); - - /* Set to draw into the current level */ - _mesa_FramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, - GL_COLOR_ATTACHMENT0_EXT, - target, - texObj->Name, - level); + _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, srcLevel); + _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, srcLevel); + + /* Set to draw into the current dstLevel */ + if (target == GL_TEXTURE_1D) { + _mesa_FramebufferTexture1DEXT(GL_FRAMEBUFFER_EXT, + GL_COLOR_ATTACHMENT0_EXT, + target, + texObj->Name, + dstLevel); + } + else if (target == GL_TEXTURE_3D) { + GLint zoffset = 0; /* XXX unfinished */ + _mesa_FramebufferTexture3DEXT(GL_FRAMEBUFFER_EXT, + GL_COLOR_ATTACHMENT0_EXT, + target, + texObj->Name, + dstLevel, zoffset); + } + else { + /* 2D / cube */ + _mesa_FramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, + GL_COLOR_ATTACHMENT0_EXT, + faceTarget, + texObj->Name, + dstLevel); + } - /* Choose to render to the color attachment. */ _mesa_DrawBuffer(GL_COLOR_ATTACHMENT0_EXT); + /* sanity check */ status = _mesa_CheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT); if (status != GL_FRAMEBUFFER_COMPLETE_EXT) { abort(); @@ -2093,12 +2225,19 @@ _mesa_meta_GenerateMipmap(GLcontext *ctx, GLenum target, _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4); } + _mesa_lock_texture(ctx, texObj); /* relock */ + _mesa_meta_end(ctx); _mesa_TexParameteri(target, GL_TEXTURE_MIN_FILTER, minFilterSave); _mesa_TexParameteri(target, GL_TEXTURE_MAG_FILTER, magFilterSave); + _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, baseLevelSave); + _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, maxLevelSave); + _mesa_TexParameteri(target, GL_GENERATE_MIPMAP, genMipmapSave); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, wrapSSave); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, wrapTSave); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_R, wrapRSave); - /* restore (XXX add to meta_begin/end()? */ _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, fboSave); } -- cgit v1.2.3 From 126d62edd18f22ff9e744efea81e0383cd0a19c5 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 24 Sep 2009 20:03:21 -0700 Subject: i915: Fix GetBufferSubData in the case of a system-memory BO. Bug #23760 (crashes in wine) --- src/mesa/drivers/dri/intel/intel_buffer_objects.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c b/src/mesa/drivers/dri/intel/intel_buffer_objects.c index 2e6b77824d..db0de0343a 100644 --- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c +++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c @@ -209,7 +209,10 @@ intel_bufferobj_get_subdata(GLcontext * ctx, struct intel_buffer_object *intel_obj = intel_buffer_object(obj); assert(intel_obj); - dri_bo_get_subdata(intel_obj->buffer, offset, size, data); + if (intel_obj->sys_buffer) + memcpy(data, (char *)intel_obj->sys_buffer + offset, size); + else + dri_bo_get_subdata(intel_obj->buffer, offset, size, data); } -- cgit v1.2.3 From 17099f5e19dc0ce65cb4e4110d9d22de803c4e52 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Mon, 7 Sep 2009 17:51:33 +0800 Subject: mesa/main: Add comments to mfeatures.h. The comments document the conventions that a feature may follow. --- src/mesa/main/mfeatures.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h index e23cdb1f42..6318934c6b 100644 --- a/src/mesa/main/mfeatures.h +++ b/src/mesa/main/mfeatures.h @@ -36,6 +36,38 @@ #define _HAVE_FULL_GL 1 #endif +/* assert that a feature is disabled and should never be used */ +#define ASSERT_NO_FEATURE() ASSERT(0) + +/** + * A feature can be anything. But most of them share certain characteristics. + * + * When a feature defines driver entries, they can be initialized by + * _MESA_INIT__FUNCTIONS + * + * When a feature defines vtxfmt entries, they can be initialized and + * installed by + * _MESA_INIT__VTXFMT + * _mesa_install__vtxfmt + * + * When a feature defines dispatch entries, they are initialized by + * _mesa_init__dispatch + * + * When a feature has states, they are initialized and freed by + * _mesa_init_ + * _mesa_free__data + * + * Except for states, the others compile to no-op when a feature is disabled. + * + * The GLAPIENTRYs and helper functions defined by a feature should also + * compile to no-op when it is disabled. But to save typings and to catch + * bugs, some of them may be unavailable, or compile to ASSERT_NO_FEATURE() + * when the feature is disabled. + * + * A feature following the conventions may be used without knowing if it is + * enabled or not. + */ + #define FEATURE_accum _HAVE_FULL_GL #define FEATURE_attrib_stack _HAVE_FULL_GL #define FEATURE_colortable _HAVE_FULL_GL -- cgit v1.2.3 From dbb8fb8de9a9deca0ae22015e4680f4e631d6d32 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Mon, 7 Sep 2009 16:59:27 +0800 Subject: mesa/main: Make FEATURE_pixel_transfer follow feature conventions. As shown in mfeatures.h, this allows users of pixel.h to work without knowing if the feature is available. --- src/mesa/main/api_exec.c | 16 +++------------- src/mesa/main/pixel.c | 40 +++++++++++++++++++++++++++++++--------- src/mesa/main/pixel.h | 47 +++++++++++++++++------------------------------ src/mesa/main/state.c | 4 ---- 4 files changed, 51 insertions(+), 56 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index 02550ae108..39941a1b03 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -93,9 +93,7 @@ #include "macros.h" #include "matrix.h" #include "multisample.h" -#if FEATURE_pixel_transfer #include "pixel.h" -#endif #include "pixelstore.h" #include "points.h" #include "polygon.h" @@ -284,17 +282,9 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_MapGrid2f(exec, _mesa_MapGrid2f); #endif SET_MultMatrixd(exec, _mesa_MultMatrixd); -#if FEATURE_pixel_transfer - SET_GetPixelMapfv(exec, _mesa_GetPixelMapfv); - SET_GetPixelMapuiv(exec, _mesa_GetPixelMapuiv); - SET_GetPixelMapusv(exec, _mesa_GetPixelMapusv); - SET_PixelMapfv(exec, _mesa_PixelMapfv); - SET_PixelMapuiv(exec, _mesa_PixelMapuiv); - SET_PixelMapusv(exec, _mesa_PixelMapusv); - SET_PixelTransferf(exec, _mesa_PixelTransferf); - SET_PixelTransferi(exec, _mesa_PixelTransferi); - SET_PixelZoom(exec, _mesa_PixelZoom); -#endif + + _mesa_init_pixel_dispatch(exec); + SET_PixelStoref(exec, _mesa_PixelStoref); SET_PointSize(exec, _mesa_PointSize); SET_PolygonMode(exec, _mesa_PolygonMode); diff --git a/src/mesa/main/pixel.c b/src/mesa/main/pixel.c index fcef6dfd42..3820ebd889 100644 --- a/src/mesa/main/pixel.c +++ b/src/mesa/main/pixel.c @@ -36,13 +36,17 @@ #include "macros.h" #include "pixel.h" #include "mtypes.h" +#include "glapi/dispatch.h" + + +#if FEATURE_pixel_transfer /**********************************************************************/ /***** glPixelZoom *****/ /**********************************************************************/ -void GLAPIENTRY +static void GLAPIENTRY _mesa_PixelZoom( GLfloat xfactor, GLfloat yfactor ) { GET_CURRENT_CONTEXT(ctx); @@ -163,7 +167,7 @@ validate_pbo_access(GLcontext *ctx, struct gl_pixelstore_attrib *pack, } -void GLAPIENTRY +static void GLAPIENTRY _mesa_PixelMapfv( GLenum map, GLsizei mapsize, const GLfloat *values ) { GET_CURRENT_CONTEXT(ctx); @@ -205,7 +209,7 @@ _mesa_PixelMapfv( GLenum map, GLsizei mapsize, const GLfloat *values ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values ) { GLfloat fvalues[MAX_PIXEL_MAP_TABLE]; @@ -261,7 +265,7 @@ _mesa_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_PixelMapusv(GLenum map, GLsizei mapsize, const GLushort *values ) { GLfloat fvalues[MAX_PIXEL_MAP_TABLE]; @@ -317,7 +321,7 @@ _mesa_PixelMapusv(GLenum map, GLsizei mapsize, const GLushort *values ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetPixelMapfv( GLenum map, GLfloat *values ) { GET_CURRENT_CONTEXT(ctx); @@ -362,7 +366,7 @@ _mesa_GetPixelMapfv( GLenum map, GLfloat *values ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetPixelMapuiv( GLenum map, GLuint *values ) { GET_CURRENT_CONTEXT(ctx); @@ -406,7 +410,7 @@ _mesa_GetPixelMapuiv( GLenum map, GLuint *values ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetPixelMapusv( GLenum map, GLushort *values ) { GET_CURRENT_CONTEXT(ctx); @@ -468,7 +472,7 @@ _mesa_GetPixelMapusv( GLenum map, GLushort *values ) * Implements glPixelTransfer[fi] whether called immediately or from a * display list. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_PixelTransferf( GLenum pname, GLfloat param ) { GET_CURRENT_CONTEXT(ctx); @@ -662,7 +666,7 @@ _mesa_PixelTransferf( GLenum pname, GLfloat param ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_PixelTransferi( GLenum pname, GLint param ) { _mesa_PixelTransferf( pname, (GLfloat) param ); @@ -756,6 +760,24 @@ void _mesa_update_pixel( GLcontext *ctx, GLuint new_state ) } +void +_mesa_init_pixel_dispatch(struct _glapi_table *disp) +{ + SET_GetPixelMapfv(disp, _mesa_GetPixelMapfv); + SET_GetPixelMapuiv(disp, _mesa_GetPixelMapuiv); + SET_GetPixelMapusv(disp, _mesa_GetPixelMapusv); + SET_PixelMapfv(disp, _mesa_PixelMapfv); + SET_PixelMapuiv(disp, _mesa_PixelMapuiv); + SET_PixelMapusv(disp, _mesa_PixelMapusv); + SET_PixelTransferf(disp, _mesa_PixelTransferf); + SET_PixelTransferi(disp, _mesa_PixelTransferi); + SET_PixelZoom(disp, _mesa_PixelZoom); +} + + +#endif /* FEATURE_pixel_transfer */ + + /**********************************************************************/ /***** Initialization *****/ /**********************************************************************/ diff --git a/src/mesa/main/pixel.h b/src/mesa/main/pixel.h index cb6c5262a3..f4d3f1efdb 100644 --- a/src/mesa/main/pixel.h +++ b/src/mesa/main/pixel.h @@ -33,48 +33,35 @@ #define PIXEL_H -#include "mtypes.h" +#include "main/mtypes.h" -/** \name API functions */ -/*@{*/ +#if FEATURE_pixel_transfer -extern void GLAPIENTRY -_mesa_GetPixelMapfv( GLenum map, GLfloat *values ); - -extern void GLAPIENTRY -_mesa_GetPixelMapuiv( GLenum map, GLuint *values ); - -extern void GLAPIENTRY -_mesa_GetPixelMapusv( GLenum map, GLushort *values ); - -extern void GLAPIENTRY -_mesa_PixelMapfv( GLenum map, GLsizei mapsize, const GLfloat *values ); - -extern void GLAPIENTRY -_mesa_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values ); - -extern void GLAPIENTRY -_mesa_PixelMapusv(GLenum map, GLsizei mapsize, const GLushort *values ); +extern void +_mesa_update_pixel( GLcontext *ctx, GLuint newstate ); -extern void GLAPIENTRY -_mesa_PixelTransferf( GLenum pname, GLfloat param ); +extern void +_mesa_init_pixel_dispatch( struct _glapi_table * disp ); -extern void GLAPIENTRY -_mesa_PixelTransferi( GLenum pname, GLint param ); +#else /* FEATURE_pixel_transfer */ -extern void GLAPIENTRY -_mesa_PixelZoom( GLfloat xfactor, GLfloat yfactor ); +static INLINE void +_mesa_update_pixel(GLcontext *ctx, GLuint newstate) +{ +} -/*@}*/ +static INLINE void +_mesa_init_pixel_dispatch(struct _glapi_table *disp) +{ +} +#endif /* FEATURE_pixel_transfer */ -extern void -_mesa_update_pixel( GLcontext *ctx, GLuint newstate ); extern void _mesa_init_pixel( GLcontext * ctx ); /*@}*/ -#endif +#endif /* PIXEL_H */ diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c index 140a998df2..f10e6b04b7 100644 --- a/src/mesa/main/state.c +++ b/src/mesa/main/state.c @@ -40,9 +40,7 @@ #include "framebuffer.h" #include "light.h" #include "matrix.h" -#if FEATURE_pixel_transfer #include "pixel.h" -#endif #include "shader/program.h" #include "shader/prog_parameter.h" #include "state.h" @@ -585,10 +583,8 @@ _mesa_update_state_locked( GLcontext *ctx ) if (new_state & (_NEW_STENCIL | _NEW_BUFFERS)) _mesa_update_stencil( ctx ); -#if FEATURE_pixel_transfer if (new_state & _MESA_NEW_TRANSFER_STATE) _mesa_update_pixel( ctx, new_state ); -#endif if (new_state & _DD_NEW_SEPARATE_SPECULAR) update_separate_specular( ctx ); -- cgit v1.2.3 From cb4f24e51d0f4f4b867b2c01ed26d2a5ce73aeab Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Mon, 7 Sep 2009 17:17:11 +0800 Subject: mesa/main: Make FEATURE_colortable follow feature conventions. As shown in mfeatures.h, this allows users of colortab.h to work without knowing if the feature is available. --- src/mesa/main/api_exec.c | 14 +--------- src/mesa/main/colortab.c | 37 ++++++++++++++++++++----- src/mesa/main/colortab.h | 71 ++++++++++++++++++++++-------------------------- src/mesa/main/context.c | 6 ---- src/mesa/main/texobj.c | 4 --- src/mesa/main/texstate.c | 6 ---- 6 files changed, 64 insertions(+), 74 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index 39941a1b03..30c142e53a 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -54,9 +54,7 @@ #endif #include "clear.h" #include "clip.h" -#if FEATURE_colortable #include "colortab.h" -#endif #include "context.h" #if FEATURE_convolve #include "convolve.h" @@ -385,17 +383,7 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_BlendEquation(exec, _mesa_BlendEquation); SET_BlendEquationSeparateEXT(exec, _mesa_BlendEquationSeparateEXT); -#if FEATURE_colortable - SET_ColorSubTable(exec, _mesa_ColorSubTable); - SET_ColorTable(exec, _mesa_ColorTable); - SET_ColorTableParameterfv(exec, _mesa_ColorTableParameterfv); - SET_ColorTableParameteriv(exec, _mesa_ColorTableParameteriv); - SET_CopyColorSubTable(exec, _mesa_CopyColorSubTable); - SET_CopyColorTable(exec, _mesa_CopyColorTable); - SET_GetColorTable(exec, _mesa_GetColorTable); - SET_GetColorTableParameterfv(exec, _mesa_GetColorTableParameterfv); - SET_GetColorTableParameteriv(exec, _mesa_GetColorTableParameteriv); -#endif + _mesa_init_colortable_dispatch(exec); #if FEATURE_convolve SET_ConvolutionFilter1D(exec, _mesa_ConvolutionFilter1D); diff --git a/src/mesa/main/colortab.c b/src/mesa/main/colortab.c index 5447eb18ef..5ede76c1fb 100644 --- a/src/mesa/main/colortab.c +++ b/src/mesa/main/colortab.c @@ -32,6 +32,10 @@ #include "state.h" #include "teximage.h" #include "texstate.h" +#include "glapi/dispatch.h" + + +#if FEATURE_colortable /** @@ -536,7 +540,7 @@ _mesa_ColorSubTable( GLenum target, GLsizei start, -void GLAPIENTRY +static void GLAPIENTRY _mesa_CopyColorTable(GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width) { @@ -552,7 +556,7 @@ _mesa_CopyColorTable(GLenum target, GLenum internalformat, -void GLAPIENTRY +static void GLAPIENTRY _mesa_CopyColorSubTable(GLenum target, GLsizei start, GLint x, GLint y, GLsizei width) { @@ -568,7 +572,7 @@ _mesa_CopyColorSubTable(GLenum target, GLsizei start, -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetColorTable( GLenum target, GLenum format, GLenum type, GLvoid *data ) { @@ -702,7 +706,7 @@ _mesa_GetColorTable( GLenum target, GLenum format, -void GLAPIENTRY +static void GLAPIENTRY _mesa_ColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params) { GLfloat *scale, *bias; @@ -747,7 +751,7 @@ _mesa_ColorTableParameterfv(GLenum target, GLenum pname, const GLfloat *params) -void GLAPIENTRY +static void GLAPIENTRY _mesa_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params) { GLfloat fparams[4]; @@ -770,7 +774,7 @@ _mesa_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params) -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ) { GET_CURRENT_CONTEXT(ctx); @@ -897,7 +901,7 @@ _mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ) -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ) { GET_CURRENT_CONTEXT(ctx); @@ -1052,6 +1056,25 @@ _mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ) } } + +void +_mesa_init_colortable_dispatch(struct _glapi_table *disp) +{ + SET_ColorSubTable(disp, _mesa_ColorSubTable); + SET_ColorTable(disp, _mesa_ColorTable); + SET_ColorTableParameterfv(disp, _mesa_ColorTableParameterfv); + SET_ColorTableParameteriv(disp, _mesa_ColorTableParameteriv); + SET_CopyColorSubTable(disp, _mesa_CopyColorSubTable); + SET_CopyColorTable(disp, _mesa_CopyColorTable); + SET_GetColorTable(disp, _mesa_GetColorTable); + SET_GetColorTableParameterfv(disp, _mesa_GetColorTableParameterfv); + SET_GetColorTableParameteriv(disp, _mesa_GetColorTableParameteriv); +} + + +#endif /* FEATURE_colortable */ + + /**********************************************************************/ /***** Initialization *****/ /**********************************************************************/ diff --git a/src/mesa/main/colortab.h b/src/mesa/main/colortab.h index b6ff737a65..652fb58246 100644 --- a/src/mesa/main/colortab.h +++ b/src/mesa/main/colortab.h @@ -27,9 +27,16 @@ #define COLORTAB_H -#include "mtypes.h" +#include "main/mtypes.h" -#if _HAVE_FULL_GL +#if FEATURE_colortable + +#define _MESA_INIT_COLORTABLE_FUNCTIONS(driver, impl) \ + do { \ + (driver)->CopyColorTable = impl ## CopyColorTable; \ + (driver)->CopyColorSubTable = impl ## CopyColorSubTable; \ + (driver)->UpdateTexturePalette = impl ## UpdateTexturePalette; \ + } while (0) extern void GLAPIENTRY _mesa_ColorTable( GLenum target, GLenum internalformat, @@ -41,32 +48,35 @@ _mesa_ColorSubTable( GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *table ); -extern void GLAPIENTRY -_mesa_CopyColorSubTable(GLenum target, GLsizei start, - GLint x, GLint y, GLsizei width); - -extern void GLAPIENTRY -_mesa_CopyColorTable(GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width); +extern void +_mesa_init_colortable_dispatch(struct _glapi_table *disp); -extern void GLAPIENTRY -_mesa_GetColorTable( GLenum target, GLenum format, - GLenum type, GLvoid *table ); +#else /* FEATURE_colortable */ -extern void GLAPIENTRY -_mesa_ColorTableParameterfv(GLenum target, GLenum pname, - const GLfloat *params); +#define _MESA_INIT_COLORTABLE_FUNCTIONS(driver, impl) do { } while (0) -extern void GLAPIENTRY -_mesa_ColorTableParameteriv(GLenum target, GLenum pname, - const GLint *params); +static INLINE void GLAPIENTRY +_mesa_ColorTable( GLenum target, GLenum internalformat, + GLsizei width, GLenum format, GLenum type, + const GLvoid *table ) +{ + ASSERT_NO_FEATURE(); +} -extern void GLAPIENTRY -_mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ); +static INLINE void GLAPIENTRY +_mesa_ColorSubTable( GLenum target, GLsizei start, + GLsizei count, GLenum format, GLenum type, + const GLvoid *table ) +{ + ASSERT_NO_FEATURE(); +} -extern void GLAPIENTRY -_mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ); +static INLINE void +_mesa_init_colortable_dispatch(struct _glapi_table *disp) +{ +} +#endif /* FEATURE_colortable */ extern void @@ -81,20 +91,5 @@ _mesa_init_colortables( GLcontext *ctx ); extern void _mesa_free_colortables_data( GLcontext *ctx ); -#else - -/** No-op */ -#define _mesa_init_colortable( p ) ((void) 0) - -/** No-op */ -#define _mesa_free_colortable_data( p ) ((void) 0) - -/** No-op */ -#define _mesa_init_colortables( p ) ((void)0) - -/** No-op */ -#define _mesa_free_colortables_data( p ) ((void)0) - -#endif -#endif +#endif /* COLORTAB_H */ diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index f6d4ac4595..1907c799df 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -90,9 +90,7 @@ #include "blend.h" #include "buffers.h" #include "bufferobj.h" -#if FEATURE_colortable #include "colortab.h" -#endif #include "context.h" #include "cpuinfo.h" #include "debug.h" @@ -686,9 +684,7 @@ init_attrib_groups(GLcontext *ctx) #endif _mesa_init_buffer_objects( ctx ); _mesa_init_color( ctx ); -#if FEATURE_colortable _mesa_init_colortables( ctx ); -#endif _mesa_init_current( ctx ); _mesa_init_depth( ctx ); _mesa_init_debug( ctx ); @@ -1015,9 +1011,7 @@ _mesa_free_context_data( GLcontext *ctx ) _mesa_free_texture_data( ctx ); _mesa_free_matrix_data( ctx ); _mesa_free_viewport_data( ctx ); -#if FEATURE_colortable _mesa_free_colortables_data( ctx ); -#endif _mesa_free_program_data(ctx); _mesa_free_shader_state(ctx); #if FEATURE_ARB_occlusion_query diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index d09c439250..678845ece0 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -29,9 +29,7 @@ #include "mfeatures.h" -#if FEATURE_colortable #include "colortab.h" -#endif #include "context.h" #include "enums.h" #include "fbobject.h" @@ -194,9 +192,7 @@ _mesa_delete_texture_object( GLcontext *ctx, struct gl_texture_object *texObj ) */ texObj->Target = 0x99; -#if FEATURE_colortable _mesa_free_colortable_data(&texObj->Palette); -#endif /* free the texture images */ for (face = 0; face < 6; face++) { diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 861c5f37c4..b9311d0ffc 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -31,9 +31,7 @@ #include "glheader.h" #include "mfeatures.h" #include "colormac.h" -#if FEATURE_colortable #include "colortab.h" -#endif #include "context.h" #include "enums.h" #include "macros.h" @@ -753,9 +751,7 @@ _mesa_init_texture(GLcontext *ctx) ctx->Texture.CurrentUnit = 0; /* multitexture */ ctx->Texture._EnabledUnits = 0x0; ctx->Texture.SharedPalette = GL_FALSE; -#if FEATURE_colortable _mesa_init_colortable(&ctx->Texture.Palette); -#endif for (u = 0; u < MAX_TEXTURE_UNITS; u++) init_texture_unit(ctx, u); @@ -796,10 +792,8 @@ _mesa_free_texture_data(GLcontext *ctx) for (tgt = 0; tgt < NUM_TEXTURE_TARGETS; tgt++) ctx->Driver.DeleteTexture(ctx, ctx->Texture.ProxyTex[tgt]); -#if FEATURE_colortable for (u = 0; u < MAX_TEXTURE_IMAGE_UNITS; u++) _mesa_free_colortable_data(&ctx->Texture.Unit[u].ColorTable); -#endif } -- cgit v1.2.3 From 5a1e25afac8eac5df1c0c9d3165b9812f54909a6 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Wed, 23 Sep 2009 16:56:20 +0800 Subject: mesa/main: Make FEATURE_convolve follow feature conventions. As shown in mfeatures.h, this allows users of convolve.h to work without knowing if the feature is available. --- src/mesa/main/api_exec.c | 19 +------- src/mesa/main/convolve.c | 48 ++++++++++++++----- src/mesa/main/convolve.h | 118 ++++++++++++++++++++++++++--------------------- src/mesa/main/teximage.c | 2 - src/mesa/main/texstore.c | 2 - 5 files changed, 103 insertions(+), 86 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index 30c142e53a..6317639075 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -56,9 +56,7 @@ #include "clip.h" #include "colortab.h" #include "context.h" -#if FEATURE_convolve #include "convolve.h" -#endif #include "depth.h" #if FEATURE_dlist #include "dlist.h" @@ -384,21 +382,7 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_BlendEquationSeparateEXT(exec, _mesa_BlendEquationSeparateEXT); _mesa_init_colortable_dispatch(exec); - -#if FEATURE_convolve - SET_ConvolutionFilter1D(exec, _mesa_ConvolutionFilter1D); - SET_ConvolutionFilter2D(exec, _mesa_ConvolutionFilter2D); - SET_ConvolutionParameterf(exec, _mesa_ConvolutionParameterf); - SET_ConvolutionParameterfv(exec, _mesa_ConvolutionParameterfv); - SET_ConvolutionParameteri(exec, _mesa_ConvolutionParameteri); - SET_ConvolutionParameteriv(exec, _mesa_ConvolutionParameteriv); - SET_CopyConvolutionFilter1D(exec, _mesa_CopyConvolutionFilter1D); - SET_CopyConvolutionFilter2D(exec, _mesa_CopyConvolutionFilter2D); - SET_GetConvolutionFilter(exec, _mesa_GetConvolutionFilter); - SET_GetConvolutionParameterfv(exec, _mesa_GetConvolutionParameterfv); - SET_GetConvolutionParameteriv(exec, _mesa_GetConvolutionParameteriv); - SET_SeparableFilter2D(exec, _mesa_SeparableFilter2D); -#endif + _mesa_init_convolve_dispatch(exec); #if FEATURE_histogram SET_GetHistogram(exec, _mesa_GetHistogram); SET_GetHistogramParameterfv(exec, _mesa_GetHistogramParameterfv); @@ -406,7 +390,6 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_GetMinmax(exec, _mesa_GetMinmax); SET_GetMinmaxParameterfv(exec, _mesa_GetMinmaxParameterfv); SET_GetMinmaxParameteriv(exec, _mesa_GetMinmaxParameteriv); - SET_GetSeparableFilter(exec, _mesa_GetSeparableFilter); SET_Histogram(exec, _mesa_Histogram); SET_Minmax(exec, _mesa_Minmax); SET_ResetHistogram(exec, _mesa_ResetHistogram); diff --git a/src/mesa/main/convolve.c b/src/mesa/main/convolve.c index bf6f6619d4..8db3e79d38 100644 --- a/src/mesa/main/convolve.c +++ b/src/mesa/main/convolve.c @@ -40,6 +40,10 @@ #include "mtypes.h" #include "pixel.h" #include "state.h" +#include "glapi/dispatch.h" + + +#if FEATURE_convolve /* @@ -256,7 +260,7 @@ _mesa_ConvolutionFilter2D(GLenum target, GLenum internalFormat, GLsizei width, G } -void GLAPIENTRY +static void GLAPIENTRY _mesa_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat param) { GET_CURRENT_CONTEXT(ctx); @@ -299,7 +303,7 @@ _mesa_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat param) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_ConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat *params) { GET_CURRENT_CONTEXT(ctx); @@ -351,7 +355,7 @@ _mesa_ConvolutionParameterfv(GLenum target, GLenum pname, const GLfloat *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_ConvolutionParameteri(GLenum target, GLenum pname, GLint param) { GET_CURRENT_CONTEXT(ctx); @@ -394,7 +398,7 @@ _mesa_ConvolutionParameteri(GLenum target, GLenum pname, GLint param) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params) { GET_CURRENT_CONTEXT(ctx); @@ -459,7 +463,7 @@ _mesa_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width) { GLint baseFormat; @@ -491,7 +495,7 @@ _mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalFormat, GLint x, GLi } -void GLAPIENTRY +static void GLAPIENTRY _mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height) { GLint baseFormat; @@ -527,7 +531,7 @@ _mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLi } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, GLvoid *image) { @@ -586,7 +590,7 @@ _mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params) { GET_CURRENT_CONTEXT(ctx); @@ -647,7 +651,7 @@ _mesa_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params) { GET_CURRENT_CONTEXT(ctx); @@ -717,7 +721,7 @@ _mesa_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span) { @@ -784,7 +788,7 @@ _mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type, } -void GLAPIENTRY +static void GLAPIENTRY _mesa_SeparableFilter2D(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column) { const GLint colStart = MAX_CONVOLUTION_WIDTH * 4; @@ -1433,3 +1437,25 @@ _mesa_adjust_image_for_convolution(const GLcontext *ctx, GLuint dimensions, *height = *height - (MAX2(ctx->Separable2D.Height, 1) - 1); } } + + +void +_mesa_init_convolve_dispatch(struct _glapi_table *disp) +{ + SET_ConvolutionFilter1D(disp, _mesa_ConvolutionFilter1D); + SET_ConvolutionFilter2D(disp, _mesa_ConvolutionFilter2D); + SET_ConvolutionParameterf(disp, _mesa_ConvolutionParameterf); + SET_ConvolutionParameterfv(disp, _mesa_ConvolutionParameterfv); + SET_ConvolutionParameteri(disp, _mesa_ConvolutionParameteri); + SET_ConvolutionParameteriv(disp, _mesa_ConvolutionParameteriv); + SET_CopyConvolutionFilter1D(disp, _mesa_CopyConvolutionFilter1D); + SET_CopyConvolutionFilter2D(disp, _mesa_CopyConvolutionFilter2D); + SET_GetConvolutionFilter(disp, _mesa_GetConvolutionFilter); + SET_GetConvolutionParameterfv(disp, _mesa_GetConvolutionParameterfv); + SET_GetConvolutionParameteriv(disp, _mesa_GetConvolutionParameteriv); + SET_SeparableFilter2D(disp, _mesa_SeparableFilter2D); + SET_GetSeparableFilter(disp, _mesa_GetSeparableFilter); +} + + +#endif /* FEATURE_convolve */ diff --git a/src/mesa/main/convolve.h b/src/mesa/main/convolve.h index 4505cdae01..59492bc7c5 100644 --- a/src/mesa/main/convolve.h +++ b/src/mesa/main/convolve.h @@ -28,10 +28,17 @@ #define CONVOLVE_H -#include "mtypes.h" +#include "main/mtypes.h" -#if _HAVE_FULL_GL +#if FEATURE_convolve + +#define _MESA_INIT_CONVOLVE_FUNCTIONS(driver, impl) \ + do { \ + (driver)->CopyConvolutionFilter1D = impl ## CopyConvolutionFilter1D; \ + (driver)->CopyConvolutionFilter2D = impl ## CopyConvolutionFilter2D; \ + } while (0) + extern void GLAPIENTRY _mesa_ConvolutionFilter1D(GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); @@ -41,74 +48,79 @@ _mesa_ConvolutionFilter2D(GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); -extern void GLAPIENTRY -_mesa_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat params); - -extern void GLAPIENTRY -_mesa_ConvolutionParameterfv(GLenum target, GLenum pname, - const GLfloat *params); - -extern void GLAPIENTRY -_mesa_ConvolutionParameteri(GLenum target, GLenum pname, GLint params); - -extern void GLAPIENTRY -_mesa_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params); - -extern void GLAPIENTRY -_mesa_CopyConvolutionFilter1D(GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width); +extern void +_mesa_convolve_1d_image(const GLcontext *ctx, GLsizei *width, + const GLfloat *srcImage, GLfloat *dstImage); -extern void GLAPIENTRY -_mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalformat, - GLint x, GLint y, GLsizei width, GLsizei height); +extern void +_mesa_convolve_2d_image(const GLcontext *ctx, GLsizei *width, GLsizei *height, + const GLfloat *srcImage, GLfloat *dstImage); -extern void GLAPIENTRY -_mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, - GLvoid *image); +extern void +_mesa_convolve_sep_image(const GLcontext *ctx, + GLsizei *width, GLsizei *height, + const GLfloat *srcImage, GLfloat *dstImage); -extern void GLAPIENTRY -_mesa_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params); +extern void +_mesa_adjust_image_for_convolution(const GLcontext *ctx, GLuint dimensions, + GLsizei *width, GLsizei *height); -extern void GLAPIENTRY -_mesa_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params); +extern void +_mesa_init_convolve_dispatch(struct _glapi_table *disp); -extern void GLAPIENTRY -_mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type, - GLvoid *row, GLvoid *column, GLvoid *span); +#else /* FEATURE_convolve */ -extern void GLAPIENTRY -_mesa_SeparableFilter2D(GLenum target, GLenum internalformat, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const GLvoid *row, const GLvoid *column); +#define _MESA_INIT_CONVOLVE_FUNCTIONS(driver, impl) do { } while (0) +static INLINE void GLAPIENTRY +_mesa_ConvolutionFilter1D(GLenum target, GLenum internalformat, GLsizei width, + GLenum format, GLenum type, const GLvoid *image) +{ + ASSERT_NO_FEATURE(); +} +static INLINE void GLAPIENTRY +_mesa_ConvolutionFilter2D(GLenum target, GLenum internalformat, GLsizei width, + GLsizei height, GLenum format, GLenum type, + const GLvoid *image) +{ + ASSERT_NO_FEATURE(); +} -extern void +static INLINE void _mesa_convolve_1d_image(const GLcontext *ctx, GLsizei *width, - const GLfloat *srcImage, GLfloat *dstImage); - + const GLfloat *srcImage, GLfloat *dstImage) +{ + ASSERT_NO_FEATURE(); +} -extern void +static INLINE void _mesa_convolve_2d_image(const GLcontext *ctx, GLsizei *width, GLsizei *height, - const GLfloat *srcImage, GLfloat *dstImage); + const GLfloat *srcImage, GLfloat *dstImage) +{ + ASSERT_NO_FEATURE(); +} -extern void +static INLINE void _mesa_convolve_sep_image(const GLcontext *ctx, GLsizei *width, GLsizei *height, - const GLfloat *srcImage, GLfloat *dstImage); - + const GLfloat *srcImage, GLfloat *dstImage) +{ + ASSERT_NO_FEATURE(); +} -extern void +static INLINE void _mesa_adjust_image_for_convolution(const GLcontext *ctx, GLuint dimensions, - GLsizei *width, GLsizei *height); + GLsizei *width, GLsizei *height) +{ +} + +static INLINE void +_mesa_init_convolve_dispatch(struct _glapi_table *disp) +{ +} -#else -#define _mesa_adjust_image_for_convolution(c, d, w, h) ((void)0) -#define _mesa_convolve_1d_image(c,w,s,d) ((void)0) -#define _mesa_convolve_2d_image(c,w,h,s,d) ((void)0) -#define _mesa_convolve_sep_image(c,w,h,s,d) ((void)0) -#endif +#endif /* FEATURE_convolve */ -#endif +#endif /* CONVOLVE_H */ diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index b555624d88..465da6b046 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -33,9 +33,7 @@ #include "glheader.h" #include "bufferobj.h" #include "context.h" -#if FEATURE_convolve #include "convolve.h" -#endif #include "enums.h" #include "fbobject.h" #include "framebuffer.h" diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index ab9973b810..f553a898f9 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -56,9 +56,7 @@ #include "bufferobj.h" #include "colormac.h" #include "context.h" -#if FEATURE_convolve #include "convolve.h" -#endif #include "image.h" #include "macros.h" #include "mipmap.h" -- cgit v1.2.3 From 46da1f2c9b67e3b4c3659f2d029140b639571407 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 25 Sep 2009 08:51:57 -0600 Subject: mesa: move declaration before code --- src/mesa/shader/nvvertparse.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/nvvertparse.c b/src/mesa/shader/nvvertparse.c index 6ab8a14cb9..8574016050 100644 --- a/src/mesa/shader/nvvertparse.c +++ b/src/mesa/shader/nvvertparse.c @@ -1415,9 +1415,10 @@ _mesa_parse_nv_vertex_program(GLcontext *ctx, GLenum dstTarget, * upload everything, _mesa_layout_parameters is the answer. */ for (i = 0; i < MAX_NV_VERTEX_PROGRAM_PARAMS; i++) { + GLint index; state_tokens[2] = i; - int index = _mesa_add_state_reference(program->Base.Parameters, - state_tokens); + index = _mesa_add_state_reference(program->Base.Parameters, + state_tokens); assert(index == i); } program->Base.NumParameters = program->Base.Parameters->NumParameters; -- cgit v1.2.3 From 02b81187dcf606ebf064ac23888e5c57d0528edf Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 25 Sep 2009 18:51:55 +0200 Subject: radeon: Fix newlines. --- src/mesa/drivers/dri/r600/r700_chip.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index e3b8a4081a..3b7f6fffe0 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -255,20 +255,20 @@ static void r700SetupVTXConstants2(GLcontext * ctx, SQ_VTX_CONSTANT_WORD2_0__DATA_FORMAT_shift, SQ_VTX_CONSTANT_WORD2_0__DATA_FORMAT_mask); /* TODO : trace back api for initial data type, not only GL_FLOAT */ - if(GL_TRUE == pStreamDesc->normalize) - { - SETfield(uSQ_VTX_CONSTANT_WORD2_0, SQ_NUM_FORMAT_NORM, - SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_shift, SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_mask); - } - //else - //{ - // SETfield(uSQ_VTX_CONSTANT_WORD2_0, SQ_NUM_FORMAT_INT, - // SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_shift, SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_mask); - //} - - if(1 == pStreamDesc->_signed) - { - SETbit(uSQ_VTX_CONSTANT_WORD2_0, SQ_VTX_CONSTANT_WORD2_0__FORMAT_COMP_ALL_bit); + if(GL_TRUE == pStreamDesc->normalize) + { + SETfield(uSQ_VTX_CONSTANT_WORD2_0, SQ_NUM_FORMAT_NORM, + SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_shift, SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_mask); + } + //else + //{ + // SETfield(uSQ_VTX_CONSTANT_WORD2_0, SQ_NUM_FORMAT_INT, + // SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_shift, SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_mask); + //} + + if(1 == pStreamDesc->_signed) + { + SETbit(uSQ_VTX_CONSTANT_WORD2_0, SQ_VTX_CONSTANT_WORD2_0__FORMAT_COMP_ALL_bit); } SETfield(uSQ_VTX_CONSTANT_WORD3_0, 1, MEM_REQUEST_SIZE_shift, MEM_REQUEST_SIZE_mask); -- cgit v1.2.3 From 151e0c0aeaa78f4eb6a87d2b3dd86b4807db1523 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Fri, 25 Sep 2009 20:59:44 +0200 Subject: intel: Handle GL_RGB8 for glCopyTex(Sub)Image. Avoids an unnecessary fallback. --- src/mesa/drivers/dri/intel/intel_tex_copy.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c index 028b49c14d..74f7f58bbe 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_copy.c +++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c @@ -74,6 +74,7 @@ get_teximage_source(struct intel_context *intel, GLenum internalFormat) case GL_RGBA: case GL_RGBA8: case GL_RGB: + case GL_RGB8: return intel_readbuf_region(intel); default: return NULL; -- cgit v1.2.3 From 813870fd9588de101f68728507cff726d7513695 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 26 Sep 2009 12:21:03 -0600 Subject: mesa: initial check-in of new formats.[ch] files --- src/mesa/main/formats.c | 851 ++++++++++++++++++++++++++++++++++++++++++++++++ src/mesa/main/formats.h | 213 ++++++++++++ 2 files changed, 1064 insertions(+) create mode 100644 src/mesa/main/formats.c create mode 100644 src/mesa/main/formats.h (limited to 'src/mesa') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c new file mode 100644 index 0000000000..32884cb41d --- /dev/null +++ b/src/mesa/main/formats.c @@ -0,0 +1,851 @@ +/* + * Mesa 3-D graphics library + * Version: 7.7 + * + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (c) 2008-2009 VMware, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * 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. + */ + + +#include "formats.h" +#include "config.h" +#include "texstore.h" + + +/** + * Info about each format. + * These must be in the same order as the MESA_FORMAT_* enums so that + * we can do lookups without searching. + */ +static struct gl_format_info format_info[MESA_FORMAT_COUNT] = +{ + { + MESA_FORMAT_RGBA8888, /* Name */ + GL_RGBA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 8, 8, 8, 8, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_RGBA8888_REV, /* Name */ + GL_RGBA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 8, 8, 8, 8, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_ARGB8888, /* Name */ + GL_RGBA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 8, 8, 8, 8, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_ARGB8888_REV, /* Name */ + GL_RGBA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 8, 8, 8, 8, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_RGB888, /* Name */ + GL_RGB, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 3 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_BGR888, /* Name */ + GL_RGB, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 3 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_RGB565, /* Name */ + GL_RGB, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 5, 6, 5, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 2 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_RGB565_REV, /* Name */ + GL_RGB, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 5, 6, 5, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 2 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_RGBA4444, /* Name */ + GL_RGBA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 4, 4, 4, 4, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 2 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_ARGB4444, /* Name */ + GL_RGBA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 4, 4, 4, 4, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 2 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_ARGB4444_REV, /* Name */ + GL_RGBA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 4, 4, 4, 4, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 2 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_RGBA5551, /* Name */ + GL_RGBA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 5, 5, 5, 1, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 2 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_ARGB1555, /* Name */ + GL_RGBA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 5, 5, 5, 1, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 2 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_ARGB1555_REV, /* Name */ + GL_RGBA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 5, 5, 5, 1, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 2 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_AL88, /* Name */ + GL_LUMINANCE_ALPHA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 0, 0, 0, 8, /* Red/Green/Blue/AlphaBits */ + 8, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 2 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_AL88_REV, /* Name */ + GL_LUMINANCE_ALPHA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 0, 0, 0, 8, /* Red/Green/Blue/AlphaBits */ + 8, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 2 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_RGB332, /* Name */ + GL_RGB, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 3, 3, 2, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 1 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_A8, /* Name */ + GL_ALPHA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 0, 0, 0, 8, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 1 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_L8, /* Name */ + GL_LUMINANCE, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 8, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 1 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_I8, /* Name */ + GL_INTENSITY, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 8, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 1 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_CI8, /* Name */ + GL_COLOR_INDEX, /* BaseFormat */ + GL_UNSIGNED_INT, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 8, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 1 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_YCBCR, /* Name */ + GL_YCBCR_MESA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 2 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_YCBCR_REV, /* Name */ + GL_YCBCR_MESA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 2 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_Z24_S8, /* Name */ + GL_DEPTH_STENCIL, /* BaseFormat */ + GL_UNSIGNED_INT, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 24, 8, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_S8_Z24, /* Name */ + GL_DEPTH_STENCIL, /* BaseFormat */ + GL_UNSIGNED_INT, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 24, 8, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_Z16, /* Name */ + GL_DEPTH_COMPONENT, /* BaseFormat */ + GL_UNSIGNED_INT, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 16, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 2 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_Z32, /* Name */ + GL_DEPTH_COMPONENT, /* BaseFormat */ + GL_UNSIGNED_INT, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 32, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_S8, /* Name */ + GL_STENCIL_INDEX, /* BaseFormat */ + GL_UNSIGNED_INT, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 8, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 1 /* BlockWidth/Height,Bytes */ + }, + +#if FEATURE_EXT_texture_sRGB + { + MESA_FORMAT_SRGB8, + GL_RGB, + GL_UNSIGNED_NORMALIZED, + 8, 8, 8, 0, + 0, 0, 0, 0, 0, + 1, 1, 3 + }, + { + MESA_FORMAT_SRGBA8, + GL_RGBA, + GL_UNSIGNED_NORMALIZED, + 8, 8, 8, 8, + 0, 0, 0, 0, 0, + 1, 1, 4 + }, + { + MESA_FORMAT_SARGB8, + GL_RGBA, + GL_UNSIGNED_NORMALIZED, + 8, 8, 8, 8, + 0, 0, 0, 0, 0, + 1, 1, 4 + }, + { + MESA_FORMAT_SL8, + GL_LUMINANCE_ALPHA, + GL_UNSIGNED_NORMALIZED, + 0, 0, 0, 8, + 8, 0, 0, 0, 0, + 1, 1, 2 + }, + { + MESA_FORMAT_SLA8, + GL_LUMINANCE_ALPHA, + GL_UNSIGNED_NORMALIZED, + 0, 0, 0, 8, + 8, 0, 0, 0, 0, + 1, 1, 2 + }, +#if FEATURE_texture_s3tc + { + MESA_FORMAT_SRGB_DXT1, /* Name */ + GL_RGB, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 4, 4, 4, 0, /* approx Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 4, 4, 8 /* 8 bytes per 4x4 block */ + }, + { + MESA_FORMAT_SRGBA_DXT1, + GL_RGBA, + GL_UNSIGNED_NORMALIZED, + 4, 4, 4, 4, + 0, 0, 0, 0, 0, + 4, 4, 8 /* 8 bytes per 4x4 block */ + }, + { + MESA_FORMAT_SRGBA_DXT3, + GL_RGBA, + GL_UNSIGNED_NORMALIZED, + 4, 4, 4, 4, + 0, 0, 0, 0, 0, + 4, 4, 16 /* 16 bytes per 4x4 block */ + }, + { + MESA_FORMAT_SRGBA_DXT5, + GL_RGBA, + GL_UNSIGNED_NORMALIZED, + 4, 4, 4, 4, + 0, 0, 0, 0, 0, + 4, 4, 16 /* 16 bytes per 4x4 block */ + }, +#endif +#endif + +#if FEATURE_texture_fxt1 + { + MESA_FORMAT_RGB_FXT1, + GL_RGB, + GL_UNSIGNED_NORMALIZED, + 8, 8, 8, 0, + 0, 0, 0, 0, 0, + 8, 4, 16 /* 16 bytes per 8x4 block */ + }, + { + MESA_FORMAT_RGBA_FXT1, + GL_RGBA, + GL_UNSIGNED_NORMALIZED, + 8, 8, 8, 8, + 0, 0, 0, 0, 0, + 8, 4, 16 /* 16 bytes per 8x4 block */ + }, +#endif + +#if FEATURE_texture_s3tc + { + MESA_FORMAT_RGB_DXT1, /* Name */ + GL_RGB, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 4, 4, 4, 0, /* approx Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 4, 4, 8 /* 8 bytes per 4x4 block */ + }, + { + MESA_FORMAT_RGBA_DXT1, + GL_RGBA, + GL_UNSIGNED_NORMALIZED, + 4, 4, 4, 4, + 0, 0, 0, 0, 0, + 4, 4, 8 /* 8 bytes per 4x4 block */ + }, + { + MESA_FORMAT_RGBA_DXT3, + GL_RGBA, + GL_UNSIGNED_NORMALIZED, + 4, 4, 4, 4, + 0, 0, 0, 0, 0, + 4, 4, 16 /* 16 bytes per 4x4 block */ + }, + { + MESA_FORMAT_RGBA_DXT5, + GL_RGBA, + GL_UNSIGNED_NORMALIZED, + 4, 4, 4, 4, + 0, 0, 0, 0, 0, + 4, 4, 16 /* 16 bytes per 4x4 block */ + }, +#endif + + { + MESA_FORMAT_RGBA, + GL_RGBA, + GL_UNSIGNED_NORMALIZED, + CHAN_BITS, CHAN_BITS, CHAN_BITS, CHAN_BITS, + 0, 0, 0, 0, 0, + 1, 1, 4 * CHAN_BITS / 8 + }, + { + MESA_FORMAT_RGB, + GL_RGB, + GL_UNSIGNED_NORMALIZED, + CHAN_BITS, CHAN_BITS, CHAN_BITS, 0, + 0, 0, 0, 0, 0, + 1, 1, 3 * CHAN_BITS / 8 + }, + { + MESA_FORMAT_ALPHA, + GL_ALPHA, + GL_UNSIGNED_NORMALIZED, + 0, 0, 0, CHAN_BITS, + 0, 0, 0, 0, 0, + 1, 1, 1 * CHAN_BITS / 8 + }, + { + MESA_FORMAT_LUMINANCE, + GL_LUMINANCE, + GL_UNSIGNED_NORMALIZED, + 0, 0, 0, 0, + CHAN_BITS, 0, 0, 0, 0, + 1, 1, 1 * CHAN_BITS / 8 + }, + { + MESA_FORMAT_LUMINANCE_ALPHA, + GL_LUMINANCE_ALPHA, + GL_UNSIGNED_NORMALIZED, + 0, 0, 0, CHAN_BITS, + CHAN_BITS, 0, 0, 0, 0, + 1, 1, 2 * CHAN_BITS / 8 + }, + { + MESA_FORMAT_INTENSITY, + GL_INTENSITY, + GL_UNSIGNED_NORMALIZED, + 0, 0, 0, 0, + 0, CHAN_BITS, 0, 0, 0, + 1, 1, 1 * CHAN_BITS / 8 + }, + { + MESA_FORMAT_RGBA_FLOAT32, + GL_RGBA, + GL_FLOAT, + 32, 32, 32, 32, + 0, 0, 0, 0, 0, + 1, 1, 16 + }, + { + MESA_FORMAT_RGBA_FLOAT16, + GL_RGBA, + GL_FLOAT, + 16, 16, 16, 16, + 0, 0, 0, 0, 0, + 1, 1, 8 + }, + { + MESA_FORMAT_RGB_FLOAT32, + GL_RGB, + GL_FLOAT, + 32, 32, 32, 0, + 0, 0, 0, 0, 0, + 1, 1, 12 + }, + { + MESA_FORMAT_RGB_FLOAT16, + GL_RGB, + GL_FLOAT, + 16, 16, 16, 0, + 0, 0, 0, 0, 0, + 1, 1, 6 + }, + { + MESA_FORMAT_ALPHA_FLOAT32, + GL_ALPHA, + GL_FLOAT, + 0, 0, 0, 32, + 0, 0, 0, 0, 0, + 1, 1, 4 + }, + { + MESA_FORMAT_ALPHA_FLOAT16, + GL_ALPHA, + GL_FLOAT, + 0, 0, 0, 16, + 0, 0, 0, 0, 0, + 1, 1, 2 + }, + { + MESA_FORMAT_LUMINANCE_FLOAT32, + GL_ALPHA, + GL_FLOAT, + 0, 0, 0, 0, + 32, 0, 0, 0, 0, + 1, 1, 4 + }, + { + MESA_FORMAT_LUMINANCE_FLOAT16, + GL_ALPHA, + GL_FLOAT, + 0, 0, 0, 0, + 16, 0, 0, 0, 0, + 1, 1, 2 + }, + { + MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32, + GL_LUMINANCE_ALPHA, + GL_FLOAT, + 0, 0, 0, 32, + 32, 0, 0, 0, 0, + 1, 1, 8 + }, + { + MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16, + GL_LUMINANCE_ALPHA, + GL_FLOAT, + 0, 0, 0, 16, + 16, 0, 0, 0, 0, + 1, 1, 4 + }, + { + MESA_FORMAT_INTENSITY_FLOAT32, + GL_INTENSITY, + GL_FLOAT, + 0, 0, 0, 0, + 0, 32, 0, 0, 0, + 1, 1, 4 + }, + { + MESA_FORMAT_INTENSITY_FLOAT16, + GL_INTENSITY, + GL_FLOAT, + 0, 0, 0, 0, + 0, 16, 0, 0, 0, + 1, 1, 2 + }, + + { + MESA_FORMAT_DUDV8, + GL_DUDV_ATI, + GL_SIGNED_NORMALIZED, + 0, 0, 0, 0, + 0, 0, 0, 0, 0, + 1, 1, 2 + }, + + { + MESA_FORMAT_SIGNED_RGBA8888, + GL_RGBA, + GL_SIGNED_NORMALIZED, + 8, 8, 8, 8, + 0, 0, 0, 0, 0, + 1, 1, 4 + }, + { + MESA_FORMAT_SIGNED_RGBA8888_REV, + GL_RGBA, + GL_SIGNED_NORMALIZED, + 8, 8, 8, 8, + 0, 0, 0, 0, 0, + 1, 1, 4 + }, + +}; + + +static struct { + gl_format Name; + StoreTexImageFunc Store; +} +texstore_funcs[MESA_FORMAT_COUNT] = +{ + { MESA_FORMAT_RGBA, _mesa_texstore_rgba }, + { MESA_FORMAT_RGB, _mesa_texstore_rgba }, + { MESA_FORMAT_ALPHA, _mesa_texstore_rgba }, + { MESA_FORMAT_LUMINANCE, _mesa_texstore_rgba }, + { MESA_FORMAT_LUMINANCE_ALPHA, _mesa_texstore_rgba }, + { MESA_FORMAT_INTENSITY, _mesa_texstore_rgba }, + { MESA_FORMAT_SRGB8, _mesa_texstore_srgb8 }, + { MESA_FORMAT_SRGBA8, _mesa_texstore_srgba8 }, + { MESA_FORMAT_SARGB8, _mesa_texstore_sargb8 }, + { MESA_FORMAT_SL8, _mesa_texstore_sl8 }, + { MESA_FORMAT_SLA8, _mesa_texstore_sla8 }, + { MESA_FORMAT_RGBA_FLOAT32, _mesa_texstore_rgba_float32 }, + { MESA_FORMAT_RGBA_FLOAT16, _mesa_texstore_rgba_float16 }, + { MESA_FORMAT_RGB_FLOAT32, _mesa_texstore_rgba_float32 }, + { MESA_FORMAT_RGB_FLOAT16, _mesa_texstore_rgba_float16 }, + { MESA_FORMAT_ALPHA_FLOAT32, _mesa_texstore_rgba_float32 }, + { MESA_FORMAT_ALPHA_FLOAT16, _mesa_texstore_rgba_float16 }, + { MESA_FORMAT_LUMINANCE_FLOAT32, _mesa_texstore_rgba_float32 }, + { MESA_FORMAT_LUMINANCE_FLOAT16, _mesa_texstore_rgba_float16 }, + { MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32, _mesa_texstore_rgba_float32 }, + { MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16, _mesa_texstore_rgba_float16 }, + { MESA_FORMAT_INTENSITY_FLOAT32, _mesa_texstore_rgba_float32 }, + { MESA_FORMAT_INTENSITY_FLOAT16, _mesa_texstore_rgba_float16 }, + { MESA_FORMAT_DUDV8, _mesa_texstore_dudv8 }, + { MESA_FORMAT_SIGNED_RGBA8888, _mesa_texstore_signed_rgba8888 }, + { MESA_FORMAT_SIGNED_RGBA8888_REV, _mesa_texstore_signed_rgba8888 }, + { MESA_FORMAT_RGBA8888, _mesa_texstore_rgba8888 }, + { MESA_FORMAT_RGBA8888_REV, _mesa_texstore_rgba8888 }, + { MESA_FORMAT_ARGB8888, _mesa_texstore_argb8888 }, + { MESA_FORMAT_ARGB8888_REV, _mesa_texstore_argb8888 }, + { MESA_FORMAT_RGB888, _mesa_texstore_rgb888 }, + { MESA_FORMAT_BGR888, _mesa_texstore_bgr888 }, + { MESA_FORMAT_RGB565, _mesa_texstore_rgb565 }, + { MESA_FORMAT_RGB565_REV, _mesa_texstore_rgb565 }, + { MESA_FORMAT_RGBA4444, _mesa_texstore_rgba4444 }, + { MESA_FORMAT_ARGB4444, _mesa_texstore_argb4444 }, + { MESA_FORMAT_ARGB4444_REV, _mesa_texstore_argb4444 }, + { MESA_FORMAT_RGBA5551, _mesa_texstore_rgba5551 }, + { MESA_FORMAT_ARGB1555, _mesa_texstore_argb1555 }, + { MESA_FORMAT_ARGB1555_REV, _mesa_texstore_argb1555 }, + { MESA_FORMAT_AL88, _mesa_texstore_al88 }, + { MESA_FORMAT_AL88_REV, _mesa_texstore_al88 }, + { MESA_FORMAT_RGB332, _mesa_texstore_rgb332 }, + { MESA_FORMAT_A8, _mesa_texstore_a8 }, + { MESA_FORMAT_L8, _mesa_texstore_a8 }, + { MESA_FORMAT_I8, _mesa_texstore_a8 }, + { MESA_FORMAT_CI8, _mesa_texstore_ci8 }, + { MESA_FORMAT_YCBCR, _mesa_texstore_ycbcr }, + { MESA_FORMAT_YCBCR_REV, _mesa_texstore_ycbcr }, + { MESA_FORMAT_Z24_S8, _mesa_texstore_z24_s8 }, + { MESA_FORMAT_S8_Z24, _mesa_texstore_s8_z24 }, + { MESA_FORMAT_Z16, _mesa_texstore_z16 }, + { MESA_FORMAT_Z32, _mesa_texstore_z32 }, + { MESA_FORMAT_S8, NULL/*_mesa_texstore_s8*/ }, +}; + + +static const struct gl_format_info * +_mesa_get_format_info(gl_format format) +{ + const struct gl_format_info *info = &format_info[format]; + assert(info->Name == format); + return info; +} + + +GLuint +_mesa_get_format_bytes(gl_format format) +{ + const struct gl_format_info *info = _mesa_get_format_info(format); + ASSERT(info->BytesPerBlock); + return info->BytesPerBlock; +} + + +GLenum +_mesa_get_format_base_format(gl_format format) +{ + const struct gl_format_info *info = _mesa_get_format_info(format); + return info->BaseFormat; +} + + +GLboolean +_mesa_is_format_compressed(gl_format format) +{ + const struct gl_format_info *info = _mesa_get_format_info(format); + return info->BlockWidth > 1 || info->BlockHeight > 1; +} + + +/* XXX move to texstore.c */ +StoreTexImageFunc +_mesa_get_texstore_func(gl_format format) +{ + GLuint i; + for (i = 0; i < MESA_FORMAT_COUNT; i++) { + if (texstore_funcs[i].Name == format) + return texstore_funcs[i].Store; + } + return NULL; +} + + +/** + * Do sanity checking of the format info table. + */ +void +_mesa_test_formats(void) +{ + GLuint i; + + assert(Elements(format_info) == MESA_FORMAT_COUNT); + + for (i = 0; i < MESA_FORMAT_COUNT; i++) { + const struct gl_format_info *info = _mesa_get_format_info(i); + assert(info); + + assert(info->Name == i); + + if (info->BlockWidth == 1 && info->BlockHeight == 1) { + if (info->RedBits > 0) { + GLuint t = info->RedBits + info->GreenBits + + info->BlueBits + info->AlphaBits; + assert(t / 8 == info->BytesPerBlock); + } + } + + assert(info->DataType == GL_UNSIGNED_NORMALIZED || + info->DataType == GL_SIGNED_NORMALIZED || + info->DataType == GL_UNSIGNED_INT || + info->DataType == GL_FLOAT); + + if (info->BaseFormat == GL_RGB) { + assert(info->RedBits > 0); + assert(info->GreenBits > 0); + assert(info->BlueBits > 0); + assert(info->AlphaBits == 0); + assert(info->LuminanceBits == 0); + assert(info->IntensityBits == 0); + } + else if (info->BaseFormat == GL_RGBA) { + assert(info->RedBits > 0); + assert(info->GreenBits > 0); + assert(info->BlueBits > 0); + assert(info->AlphaBits > 0); + assert(info->LuminanceBits == 0); + assert(info->IntensityBits == 0); + } + else if (info->BaseFormat == GL_LUMINANCE) { + assert(info->RedBits == 0); + assert(info->GreenBits == 0); + assert(info->BlueBits == 0); + assert(info->AlphaBits == 0); + assert(info->LuminanceBits > 0); + assert(info->IntensityBits == 0); + } + else if (info->BaseFormat == GL_INTENSITY) { + assert(info->RedBits == 0); + assert(info->GreenBits == 0); + assert(info->BlueBits == 0); + assert(info->AlphaBits == 0); + assert(info->LuminanceBits == 0); + assert(info->IntensityBits > 0); + } + + } +} + + +/** + * XXX possible replacement for _mesa_format_to_type_and_comps() + * Used for mipmap generation. + */ +void +_mesa_format_to_type_and_comps2(gl_format format, + GLenum *datatype, GLuint *comps) +{ + const struct gl_format_info *info = _mesa_get_format_info(format); + + /* We use a bunch of heuristics here. If this gets too ugly we could + * just encode the info the in the gl_format_info structures. + */ + if (info->BaseFormat == GL_RGB || + info->BaseFormat == GL_RGBA || + info->BaseFormat == GL_ALPHA) { + *comps = ((info->RedBits > 0) + + (info->GreenBits > 0) + + (info->BlueBits > 0) + + (info->AlphaBits > 0)); + + if (info->DataType== GL_FLOAT) { + if (info->RedBits == 32) + *datatype = GL_FLOAT; + else + *datatype = GL_HALF_FLOAT; + } + else if (info->GreenBits == 3) { + *datatype = GL_UNSIGNED_BYTE_3_3_2; + } + else if (info->GreenBits == 4) { + *datatype = GL_UNSIGNED_SHORT_4_4_4_4; + } + else if (info->GreenBits == 6) { + *datatype = GL_UNSIGNED_SHORT_5_6_5; + } + else if (info->GreenBits == 5) { + *datatype = GL_UNSIGNED_SHORT_1_5_5_5_REV; + } + else if (info->RedBits == 8) { + *datatype = GL_UNSIGNED_BYTE; + } + else { + ASSERT(info->RedBits == 16); + *datatype = GL_UNSIGNED_SHORT; + } + } + else if (info->BaseFormat == GL_LUMINANCE || + info->BaseFormat == GL_LUMINANCE_ALPHA) { + *comps = ((info->LuminanceBits > 0) + + (info->AlphaBits > 0)); + if (info->LuminanceBits == 8) { + *datatype = GL_UNSIGNED_BYTE; + } + else if (info->LuminanceBits == 16) { + *datatype = GL_UNSIGNED_SHORT; + } + else { + *datatype = GL_FLOAT; + } + } + else if (info->BaseFormat == GL_INTENSITY) { + *comps = 1; + if (info->IntensityBits == 8) { + *datatype = GL_UNSIGNED_BYTE; + } + else if (info->IntensityBits == 16) { + *datatype = GL_UNSIGNED_SHORT; + } + else { + *datatype = GL_FLOAT; + } + } + else if (info->BaseFormat == GL_COLOR_INDEX) { + *comps = 1; + *datatype = GL_UNSIGNED_BYTE; + } + else if (info->BaseFormat == GL_DEPTH_COMPONENT) { + *comps = 1; + if (info->DepthBits == 16) { + *datatype = GL_UNSIGNED_SHORT; + } + else { + ASSERT(info->DepthBits == 32); + *datatype = GL_UNSIGNED_INT; + } + } + else if (info->BaseFormat == GL_DEPTH_STENCIL) { + *comps = 1; + *datatype = GL_UNSIGNED_INT; + } + else if (info->BaseFormat == GL_YCBCR_MESA) { + *comps = 2; + *datatype = GL_UNSIGNED_SHORT; + } + else if (info->BaseFormat == GL_DUDV_ATI) { + *comps = 2; + *datatype = GL_BYTE; + } + else { + /* any other formats? */ + ASSERT(0); + *comps = 1; + *datatype = GL_UNSIGNED_BYTE; + } +} + diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h new file mode 100644 index 0000000000..61bbd8e79a --- /dev/null +++ b/src/mesa/main/formats.h @@ -0,0 +1,213 @@ +/* + * Mesa 3-D graphics library + * Version: 7.7 + * + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (c) 2008-2009 VMware, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * 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. + */ + +/* + * Authors: + * Brian Paul + */ + + +#ifndef FORMATS_H +#define FORMATS_H + + +#include "main/mtypes.h" + + + +/** + * Mesa texture/renderbuffer image formats. + */ +typedef enum +{ + /** + * \name Basic hardware formats + */ + /*@{*/ + /* msb <------ TEXEL BITS -----------> lsb */ + /* ---- ---- ---- ---- ---- ---- ---- ---- */ + MESA_FORMAT_RGBA8888, /* RRRR RRRR GGGG GGGG BBBB BBBB AAAA AAAA */ + MESA_FORMAT_RGBA8888_REV, /* AAAA AAAA BBBB BBBB GGGG GGGG RRRR RRRR */ + MESA_FORMAT_ARGB8888, /* AAAA AAAA RRRR RRRR GGGG GGGG BBBB BBBB */ + MESA_FORMAT_ARGB8888_REV, /* BBBB BBBB GGGG GGGG RRRR RRRR AAAA AAAA */ + MESA_FORMAT_RGB888, /* RRRR RRRR GGGG GGGG BBBB BBBB */ + MESA_FORMAT_BGR888, /* BBBB BBBB GGGG GGGG RRRR RRRR */ + MESA_FORMAT_RGB565, /* RRRR RGGG GGGB BBBB */ + MESA_FORMAT_RGB565_REV, /* GGGB BBBB RRRR RGGG */ + MESA_FORMAT_RGBA4444, /* RRRR GGGG BBBB AAAA */ + MESA_FORMAT_ARGB4444, /* AAAA RRRR GGGG BBBB */ + MESA_FORMAT_ARGB4444_REV, /* GGGG BBBB AAAA RRRR */ + MESA_FORMAT_RGBA5551, /* RRRR RGGG GGBB BBBA */ + MESA_FORMAT_ARGB1555, /* ARRR RRGG GGGB BBBB */ + MESA_FORMAT_ARGB1555_REV, /* GGGB BBBB ARRR RRGG */ + MESA_FORMAT_AL88, /* AAAA AAAA LLLL LLLL */ + MESA_FORMAT_AL88_REV, /* LLLL LLLL AAAA AAAA */ + MESA_FORMAT_RGB332, /* RRRG GGBB */ + MESA_FORMAT_A8, /* AAAA AAAA */ + MESA_FORMAT_L8, /* LLLL LLLL */ + MESA_FORMAT_I8, /* IIII IIII */ + MESA_FORMAT_CI8, /* CCCC CCCC */ + MESA_FORMAT_YCBCR, /* YYYY YYYY UorV UorV */ + MESA_FORMAT_YCBCR_REV, /* UorV UorV YYYY YYYY */ + MESA_FORMAT_Z24_S8, /* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ SSSS SSSS */ + MESA_FORMAT_S8_Z24, /* SSSS SSSS ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */ + MESA_FORMAT_Z16, /* ZZZZ ZZZZ ZZZZ ZZZZ */ + MESA_FORMAT_Z32, /* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */ + MESA_FORMAT_S8, /* SSSS SSSS */ + /*@}*/ + +#if FEATURE_EXT_texture_sRGB + /** + * \name 8-bit/channel sRGB formats + */ + /*@{*/ + MESA_FORMAT_SRGB8, + MESA_FORMAT_SRGBA8, + MESA_FORMAT_SARGB8, + MESA_FORMAT_SL8, + MESA_FORMAT_SLA8, +#if FEATURE_texture_s3tc + MESA_FORMAT_SRGB_DXT1, + MESA_FORMAT_SRGBA_DXT1, + MESA_FORMAT_SRGBA_DXT3, + MESA_FORMAT_SRGBA_DXT5, +#endif + /*@}*/ +#endif + + /** + * \name Compressed texture formats. + */ + /*@{*/ +#if FEATURE_texture_fxt1 + MESA_FORMAT_RGB_FXT1, + MESA_FORMAT_RGBA_FXT1, +#endif +#if FEATURE_texture_s3tc + MESA_FORMAT_RGB_DXT1, + MESA_FORMAT_RGBA_DXT1, + MESA_FORMAT_RGBA_DXT3, + MESA_FORMAT_RGBA_DXT5, +#endif + /*@}*/ + + /** + * \name Generic GLchan-based formats. (XXX obsolete!) + */ + /*@{*/ + MESA_FORMAT_RGBA, + MESA_FORMAT_RGB, + MESA_FORMAT_ALPHA, + MESA_FORMAT_LUMINANCE, + MESA_FORMAT_LUMINANCE_ALPHA, + MESA_FORMAT_INTENSITY, + /*@}*/ + + /** + * \name Floating point texture formats. + */ + /*@{*/ + MESA_FORMAT_RGBA_FLOAT32, + MESA_FORMAT_RGBA_FLOAT16, + MESA_FORMAT_RGB_FLOAT32, + MESA_FORMAT_RGB_FLOAT16, + MESA_FORMAT_ALPHA_FLOAT32, + MESA_FORMAT_ALPHA_FLOAT16, + MESA_FORMAT_LUMINANCE_FLOAT32, + MESA_FORMAT_LUMINANCE_FLOAT16, + MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32, + MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16, + MESA_FORMAT_INTENSITY_FLOAT32, + MESA_FORMAT_INTENSITY_FLOAT16, + /*@}*/ + + /** + * \name Signed fixed point texture formats. + */ + /*@{*/ + MESA_FORMAT_DUDV8, + MESA_FORMAT_SIGNED_RGBA8888, + MESA_FORMAT_SIGNED_RGBA8888_REV, + /*@}*/ + + MESA_FORMAT_COUNT, +} gl_format; + + +/** + * Information about texture formats. + */ +struct gl_format_info +{ + gl_format Name; + + /** + * Base format is one of GL_RGB, GL_RGBA, GL_ALPHA, GL_LUMINANCE, + * GL_LUMINANCE_ALPHA, GL_INTENSITY, GL_COLOR_INDEX, GL_DEPTH_COMPONENT. + */ + GLenum BaseFormat; + + /** + * Logical data type: one of GL_UNSIGNED_NORMALIZED, GL_SIGNED_NORMALED, + * GL_UNSIGNED_INT, GL_SIGNED_INT, GL_FLOAT. + */ + GLenum DataType; + + GLubyte RedBits; + GLubyte GreenBits; + GLubyte BlueBits; + GLubyte AlphaBits; + GLubyte LuminanceBits; + GLubyte IntensityBits; + GLubyte IndexBits; + GLubyte DepthBits; + GLubyte StencilBits; + + /** + * To describe compressed formats. If not compressed, Width=Height=1. + */ + GLubyte BlockWidth, BlockHeight; + GLubyte BytesPerBlock; +}; + + + +extern GLuint +_mesa_get_format_bytes(gl_format format); + +extern GLenum +_mesa_get_format_base_format(gl_format format); + +extern GLboolean +_mesa_is_format_compressed(gl_format format); + +extern void +_mesa_format_to_type_and_comps2(gl_format format, + GLenum *datatype, GLuint *comps); + +extern void +_mesa_test_formats(void); + +#endif /* FORMATS_H */ -- cgit v1.2.3 From 9e7b56c98006033daa206c51b320b1b6cbc2f281 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 26 Sep 2009 12:24:17 -0600 Subject: mesa: include formats.h --- src/mesa/main/texformat.h | 137 +--------------------------------------------- 1 file changed, 1 insertion(+), 136 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texformat.h b/src/mesa/main/texformat.h index 5aa1d756cb..b860a10d86 100644 --- a/src/mesa/main/texformat.h +++ b/src/mesa/main/texformat.h @@ -37,142 +37,7 @@ #include "mtypes.h" - - -/** - * Mesa internal texture image formats. - * All texture images are stored in one of these formats. - * - * NOTE: when you add a new format, be sure to update the do_row() - * function in texstore.c used for auto mipmap generation. - */ -enum _format { - /** - * \name Hardware-friendly formats. - * - * Drivers can override the default formats and convert texture images to - * one of these as required. The driver's - * dd_function_table::ChooseTextureFormat function will choose one of these - * formats. - * - * \note In the default case, some of these formats will be duplicates of - * the generic formats listed below. However, these formats guarantee their - * internal component sizes, while GLchan may vary between GLubyte, GLushort - * and GLfloat. - */ - /*@{*/ - /* msb <------ TEXEL BITS -----------> lsb */ - /* ---- ---- ---- ---- ---- ---- ---- ---- */ - MESA_FORMAT_RGBA8888, /* RRRR RRRR GGGG GGGG BBBB BBBB AAAA AAAA */ - MESA_FORMAT_RGBA8888_REV, /* AAAA AAAA BBBB BBBB GGGG GGGG RRRR RRRR */ - MESA_FORMAT_ARGB8888, /* AAAA AAAA RRRR RRRR GGGG GGGG BBBB BBBB */ - MESA_FORMAT_ARGB8888_REV, /* BBBB BBBB GGGG GGGG RRRR RRRR AAAA AAAA */ - MESA_FORMAT_RGB888, /* RRRR RRRR GGGG GGGG BBBB BBBB */ - MESA_FORMAT_BGR888, /* BBBB BBBB GGGG GGGG RRRR RRRR */ - MESA_FORMAT_RGB565, /* RRRR RGGG GGGB BBBB */ - MESA_FORMAT_RGB565_REV, /* GGGB BBBB RRRR RGGG */ - MESA_FORMAT_RGBA4444, /* RRRR GGGG BBBB AAAA */ - MESA_FORMAT_ARGB4444, /* AAAA RRRR GGGG BBBB */ - MESA_FORMAT_ARGB4444_REV, /* GGGG BBBB AAAA RRRR */ - MESA_FORMAT_RGBA5551, /* RRRR RGGG GGBB BBBA */ - MESA_FORMAT_ARGB1555, /* ARRR RRGG GGGB BBBB */ - MESA_FORMAT_ARGB1555_REV, /* GGGB BBBB ARRR RRGG */ - MESA_FORMAT_AL88, /* AAAA AAAA LLLL LLLL */ - MESA_FORMAT_AL88_REV, /* LLLL LLLL AAAA AAAA */ - MESA_FORMAT_RGB332, /* RRRG GGBB */ - MESA_FORMAT_A8, /* AAAA AAAA */ - MESA_FORMAT_L8, /* LLLL LLLL */ - MESA_FORMAT_I8, /* IIII IIII */ - MESA_FORMAT_CI8, /* CCCC CCCC */ - MESA_FORMAT_YCBCR, /* YYYY YYYY UorV UorV */ - MESA_FORMAT_YCBCR_REV, /* UorV UorV YYYY YYYY */ - MESA_FORMAT_Z24_S8, /* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ SSSS SSSS */ - MESA_FORMAT_S8_Z24, /* SSSS SSSS ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */ - MESA_FORMAT_Z16, /* ZZZZ ZZZZ ZZZZ ZZZZ */ - MESA_FORMAT_Z32, /* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */ - /*@}*/ - -#if FEATURE_EXT_texture_sRGB - /** - * \name 8-bit/channel sRGB formats - */ - /*@{*/ - MESA_FORMAT_SRGB8, - MESA_FORMAT_SRGBA8, - MESA_FORMAT_SARGB8, - MESA_FORMAT_SL8, - MESA_FORMAT_SLA8, -#if FEATURE_texture_s3tc - MESA_FORMAT_SRGB_DXT1, - MESA_FORMAT_SRGBA_DXT1, - MESA_FORMAT_SRGBA_DXT3, - MESA_FORMAT_SRGBA_DXT5, -#endif - /*@}*/ -#endif - - /** - * \name Compressed texture formats. - */ - /*@{*/ -#if FEATURE_texture_fxt1 - MESA_FORMAT_RGB_FXT1, - MESA_FORMAT_RGBA_FXT1, -#endif -#if FEATURE_texture_s3tc - MESA_FORMAT_RGB_DXT1, - MESA_FORMAT_RGBA_DXT1, - MESA_FORMAT_RGBA_DXT3, - MESA_FORMAT_RGBA_DXT5, -#endif - /*@}*/ - - /** - * \name Generic GLchan-based formats. - * - * Software-oriented texture formats. Texels are arrays of GLchan - * values so there are no byte order issues. - * - * \note Because these are based on the GLchan data type, one cannot assume - * 8 bits per channel with these formats. If you require GLubyte channels, - * use one of the hardware formats above. - */ - /*@{*/ - MESA_FORMAT_RGBA, - MESA_FORMAT_RGB, - MESA_FORMAT_ALPHA, - MESA_FORMAT_LUMINANCE, - MESA_FORMAT_LUMINANCE_ALPHA, - MESA_FORMAT_INTENSITY, - /*@}*/ - - /** - * \name Floating point texture formats. - */ - /*@{*/ - MESA_FORMAT_RGBA_FLOAT32, - MESA_FORMAT_RGBA_FLOAT16, - MESA_FORMAT_RGB_FLOAT32, - MESA_FORMAT_RGB_FLOAT16, - MESA_FORMAT_ALPHA_FLOAT32, - MESA_FORMAT_ALPHA_FLOAT16, - MESA_FORMAT_LUMINANCE_FLOAT32, - MESA_FORMAT_LUMINANCE_FLOAT16, - MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32, - MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16, - MESA_FORMAT_INTENSITY_FLOAT32, - MESA_FORMAT_INTENSITY_FLOAT16, - /*@}*/ - - /** - * \name Signed fixed point texture formats. - */ - /*@{*/ - MESA_FORMAT_DUDV8, - MESA_FORMAT_SIGNED_RGBA8888, - MESA_FORMAT_SIGNED_RGBA8888_REV - /*@}*/ -}; +#include "formats.h" /** GLchan-valued formats */ -- cgit v1.2.3 From a7455f9fc64f0e2e09e65c0b7d76b539bce8a79b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 26 Sep 2009 12:25:02 -0600 Subject: mesa: added formats.c to build --- src/mesa/SConscript | 1 + src/mesa/sources.mak | 1 + 2 files changed, 2 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/SConscript b/src/mesa/SConscript index cad5676320..6dfbd26d94 100644 --- a/src/mesa/SConscript +++ b/src/mesa/SConscript @@ -56,6 +56,7 @@ if env['platform'] != 'winddk': 'main/feedback.c', 'main/ffvertex_prog.c', 'main/fog.c', + 'main/formats.c', 'main/framebuffer.c', 'main/get.c', 'main/getstring.c', diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak index 7107538cee..dab3e56038 100644 --- a/src/mesa/sources.mak +++ b/src/mesa/sources.mak @@ -33,6 +33,7 @@ MAIN_SOURCES = \ main/feedback.c \ main/ffvertex_prog.c \ main/fog.c \ + main/formats.c \ main/framebuffer.c \ main/get.c \ main/getstring.c \ -- cgit v1.2.3 From 22108bb571808542b89677752d62d3901698265f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 26 Sep 2009 12:26:18 -0600 Subject: mesa: begin removing dependencies on gl_texture_format in texstore code --- src/mesa/main/texstore.c | 241 ++++++++++++++++++++++++++++------------------- 1 file changed, 144 insertions(+), 97 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index f553a898f9..5b13581b3a 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -940,7 +940,8 @@ memcpy_texture(GLcontext *ctx, srcWidth, srcHeight, srcFormat, srcType); const GLubyte *srcImage = (const GLubyte *) _mesa_image_address(dimensions, srcPacking, srcAddr, srcWidth, srcHeight, srcFormat, srcType, 0, 0, 0); - const GLint bytesPerRow = srcWidth * dstFormat->TexelBytes; + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); + const GLint bytesPerRow = srcWidth * texelBytes; #if 0 /* XXX update/re-enable for dstImageOffsets array */ @@ -949,7 +950,7 @@ memcpy_texture(GLcontext *ctx, GLubyte *dstImage = (GLubyte *) dstAddr + dstZoffset * dstImageStride + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; if (dstRowStride == srcRowStride && dstRowStride == bytesPerRow && @@ -980,9 +981,9 @@ memcpy_texture(GLcontext *ctx, for (img = 0; img < srcDepth; img++) { const GLubyte *srcRow = srcImage; GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { ctx->Driver.TextureMemCpy(dstRow, srcRow, bytesPerRow); dstRow += dstRowStride; @@ -1008,6 +1009,8 @@ GLboolean _mesa_texstore_rgba(TEXSTORE_PARAMS) { const GLint components = _mesa_components_in_format(baseInternalFormat); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); ASSERT(dstFormat == &_mesa_texformat_rgba || dstFormat == &_mesa_texformat_rgb || @@ -1021,7 +1024,7 @@ _mesa_texstore_rgba(TEXSTORE_PARAMS) baseInternalFormat == GL_LUMINANCE || baseInternalFormat == GL_LUMINANCE_ALPHA || baseInternalFormat == GL_INTENSITY); - ASSERT(dstFormat->TexelBytes == components * sizeof(GLchan)); + ASSERT(texelBytes == components * sizeof(GLchan)); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -1045,9 +1048,9 @@ _mesa_texstore_rgba(TEXSTORE_PARAMS) for (img = 0; img < srcDepth; img++) { GLchan *dstImage = (GLchan *) ((GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes); + + dstXoffset * texelBytes); const GLint srcRowStride = _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType); @@ -1121,7 +1124,7 @@ _mesa_texstore_rgba(TEXSTORE_PARAMS) /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + baseFormat, srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -1134,9 +1137,9 @@ _mesa_texstore_rgba(TEXSTORE_PARAMS) bytesPerRow = srcWidth * components * sizeof(GLchan); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { _mesa_memcpy(dstRow, src, bytesPerRow); dstRow += dstRowStride; @@ -1157,9 +1160,10 @@ GLboolean _mesa_texstore_z32(TEXSTORE_PARAMS) { const GLuint depthScale = 0xffffffff; + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); (void) dims; ASSERT(dstFormat == &_mesa_texformat_z32); - ASSERT(dstFormat->TexelBytes == sizeof(GLuint)); + ASSERT(texelBytes == sizeof(GLuint)); if (ctx->Pixel.DepthScale == 1.0f && ctx->Pixel.DepthBias == 0.0f && @@ -1180,9 +1184,9 @@ _mesa_texstore_z32(TEXSTORE_PARAMS) GLint img, row; for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { const GLvoid *src = _mesa_image_address(dims, srcPacking, srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, row, 0); @@ -1205,9 +1209,10 @@ GLboolean _mesa_texstore_z16(TEXSTORE_PARAMS) { const GLuint depthScale = 0xffff; + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); (void) dims; ASSERT(dstFormat == &_mesa_texformat_z16); - ASSERT(dstFormat->TexelBytes == sizeof(GLushort)); + ASSERT(texelBytes == sizeof(GLushort)); if (ctx->Pixel.DepthScale == 1.0f && ctx->Pixel.DepthBias == 0.0f && @@ -1228,9 +1233,9 @@ _mesa_texstore_z16(TEXSTORE_PARAMS) GLint img, row; for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { const GLvoid *src = _mesa_image_address(dims, srcPacking, srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, row, 0); @@ -1252,9 +1257,12 @@ _mesa_texstore_z16(TEXSTORE_PARAMS) GLboolean _mesa_texstore_rgb565(TEXSTORE_PARAMS) { + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); + ASSERT(dstFormat == &_mesa_texformat_rgb565 || dstFormat == &_mesa_texformat_rgb565_rev); - ASSERT(dstFormat->TexelBytes == 2); + ASSERT(texelBytes == 2); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -1284,7 +1292,7 @@ _mesa_texstore_rgb565(TEXSTORE_PARAMS) srcFormat, srcType, 0, 0, 0); GLubyte *dst = (GLubyte *) dstAddr + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; GLint row, col; for (row = 0; row < srcHeight; row++) { const GLubyte *srcUB = (const GLubyte *) src; @@ -1310,7 +1318,7 @@ _mesa_texstore_rgb565(TEXSTORE_PARAMS) /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + baseFormat, srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -1321,9 +1329,9 @@ _mesa_texstore_rgb565(TEXSTORE_PARAMS) _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLushort *dstUS = (GLushort *) dstRow; /* check for byteswapped format */ @@ -1359,10 +1367,12 @@ GLboolean _mesa_texstore_rgba8888(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); ASSERT(dstFormat == &_mesa_texformat_rgba8888 || dstFormat == &_mesa_texformat_rgba8888_rev); - ASSERT(dstFormat->TexelBytes == 4); + ASSERT(texelBytes == 4); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -1435,7 +1445,7 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS) /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + baseFormat, srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -1446,9 +1456,9 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS) _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLuint *dstUI = (GLuint *) dstRow; if (dstFormat == &_mesa_texformat_rgba8888) { @@ -1482,10 +1492,12 @@ GLboolean _mesa_texstore_argb8888(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); ASSERT(dstFormat == &_mesa_texformat_argb8888 || dstFormat == &_mesa_texformat_argb8888_rev); - ASSERT(dstFormat->TexelBytes == 4); + ASSERT(texelBytes == 4); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -1531,9 +1543,9 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) GLubyte *srcRow = (GLubyte *) _mesa_image_address(dims, srcPacking, srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, 0, 0); GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLuint *d4 = (GLuint *) dstRow; for (col = 0; col < srcWidth; col++) { @@ -1567,9 +1579,9 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) GLubyte *srcRow = (GLubyte *) _mesa_image_address(dims, srcPacking, srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, 0, 0); GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLuint *d4 = (GLuint *) dstRow; for (col = 0; col < srcWidth; col++) { @@ -1626,7 +1638,7 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + baseFormat, srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -1637,9 +1649,9 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLuint *dstUI = (GLuint *) dstRow; if (dstFormat == &_mesa_texformat_argb8888) { @@ -1673,9 +1685,11 @@ GLboolean _mesa_texstore_rgb888(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); ASSERT(dstFormat == &_mesa_texformat_rgb888); - ASSERT(dstFormat->TexelBytes == 3); + ASSERT(texelBytes == 3); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -1703,9 +1717,9 @@ _mesa_texstore_rgb888(TEXSTORE_PARAMS) GLubyte *srcRow = (GLubyte *) _mesa_image_address(dims, srcPacking, srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, 0, 0); GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { for (col = 0; col < srcWidth; col++) { dstRow[col * 3 + 0] = srcRow[col * 4 + BCOMP]; @@ -1745,7 +1759,7 @@ _mesa_texstore_rgb888(TEXSTORE_PARAMS) /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + baseFormat, srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -1756,9 +1770,9 @@ _mesa_texstore_rgb888(TEXSTORE_PARAMS) _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { #if 0 if (littleEndian) { @@ -1798,9 +1812,11 @@ GLboolean _mesa_texstore_bgr888(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); ASSERT(dstFormat == &_mesa_texformat_bgr888); - ASSERT(dstFormat->TexelBytes == 3); + ASSERT(texelBytes == 3); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -1828,9 +1844,9 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS) GLubyte *srcRow = (GLubyte *) _mesa_image_address(dims, srcPacking, srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, 0, 0); GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { for (col = 0; col < srcWidth; col++) { dstRow[col * 3 + 0] = srcRow[col * 4 + RCOMP]; @@ -1870,7 +1886,7 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS) /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + baseFormat, srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -1881,9 +1897,9 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS) _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { for (col = 0; col < srcWidth; col++) { dstRow[col * 3 + 0] = CHAN_TO_UBYTE(src[RCOMP]); @@ -1902,8 +1918,11 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS) GLboolean _mesa_texstore_rgba4444(TEXSTORE_PARAMS) { + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); + ASSERT(dstFormat == &_mesa_texformat_rgba4444); - ASSERT(dstFormat->TexelBytes == 2); + ASSERT(texelBytes == 2); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -1923,7 +1942,7 @@ _mesa_texstore_rgba4444(TEXSTORE_PARAMS) /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + baseFormat, srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -1934,9 +1953,9 @@ _mesa_texstore_rgba4444(TEXSTORE_PARAMS) _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLushort *dstUS = (GLushort *) dstRow; for (col = 0; col < srcWidth; col++) { @@ -1957,9 +1976,12 @@ _mesa_texstore_rgba4444(TEXSTORE_PARAMS) GLboolean _mesa_texstore_argb4444(TEXSTORE_PARAMS) { + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); + ASSERT(dstFormat == &_mesa_texformat_argb4444 || dstFormat == &_mesa_texformat_argb4444_rev); - ASSERT(dstFormat->TexelBytes == 2); + ASSERT(texelBytes == 2); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -1979,7 +2001,7 @@ _mesa_texstore_argb4444(TEXSTORE_PARAMS) /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + baseFormat, srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -1990,9 +2012,9 @@ _mesa_texstore_argb4444(TEXSTORE_PARAMS) _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLushort *dstUS = (GLushort *) dstRow; if (dstFormat == &_mesa_texformat_argb4444) { @@ -2024,8 +2046,11 @@ _mesa_texstore_argb4444(TEXSTORE_PARAMS) GLboolean _mesa_texstore_rgba5551(TEXSTORE_PARAMS) { + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); + ASSERT(dstFormat == &_mesa_texformat_rgba5551); - ASSERT(dstFormat->TexelBytes == 2); + ASSERT(texelBytes == 2); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -2045,7 +2070,7 @@ _mesa_texstore_rgba5551(TEXSTORE_PARAMS) /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + baseFormat, srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -2056,9 +2081,9 @@ _mesa_texstore_rgba5551(TEXSTORE_PARAMS) _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLushort *dstUS = (GLushort *) dstRow; for (col = 0; col < srcWidth; col++) { @@ -2079,9 +2104,12 @@ _mesa_texstore_rgba5551(TEXSTORE_PARAMS) GLboolean _mesa_texstore_argb1555(TEXSTORE_PARAMS) { + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); + ASSERT(dstFormat == &_mesa_texformat_argb1555 || dstFormat == &_mesa_texformat_argb1555_rev); - ASSERT(dstFormat->TexelBytes == 2); + ASSERT(texelBytes == 2); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -2101,7 +2129,7 @@ _mesa_texstore_argb1555(TEXSTORE_PARAMS) /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + baseFormat, srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -2112,9 +2140,9 @@ _mesa_texstore_argb1555(TEXSTORE_PARAMS) _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLushort *dstUS = (GLushort *) dstRow; if (dstFormat == &_mesa_texformat_argb1555) { @@ -2148,10 +2176,12 @@ GLboolean _mesa_texstore_al88(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); ASSERT(dstFormat == &_mesa_texformat_al88 || dstFormat == &_mesa_texformat_al88_rev); - ASSERT(dstFormat->TexelBytes == 2); + ASSERT(texelBytes == 2); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -2204,7 +2234,7 @@ _mesa_texstore_al88(TEXSTORE_PARAMS) /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + baseFormat, srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -2215,9 +2245,9 @@ _mesa_texstore_al88(TEXSTORE_PARAMS) _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLushort *dstUS = (GLushort *) dstRow; if (dstFormat == &_mesa_texformat_al88) { @@ -2248,8 +2278,11 @@ _mesa_texstore_al88(TEXSTORE_PARAMS) GLboolean _mesa_texstore_rgb332(TEXSTORE_PARAMS) { + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); + ASSERT(dstFormat == &_mesa_texformat_rgb332); - ASSERT(dstFormat->TexelBytes == 1); + ASSERT(texelBytes == 1); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -2267,7 +2300,7 @@ _mesa_texstore_rgb332(TEXSTORE_PARAMS) /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + baseFormat, srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -2278,9 +2311,9 @@ _mesa_texstore_rgb332(TEXSTORE_PARAMS) _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { for (col = 0; col < srcWidth; col++) { dstRow[col] = PACK_COLOR_332( CHAN_TO_UBYTE(src[RCOMP]), @@ -2303,10 +2336,13 @@ _mesa_texstore_rgb332(TEXSTORE_PARAMS) GLboolean _mesa_texstore_a8(TEXSTORE_PARAMS) { + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); + ASSERT(dstFormat == &_mesa_texformat_a8 || dstFormat == &_mesa_texformat_l8 || dstFormat == &_mesa_texformat_i8); - ASSERT(dstFormat->TexelBytes == 1); + ASSERT(texelBytes == 1); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -2353,7 +2389,7 @@ _mesa_texstore_a8(TEXSTORE_PARAMS) /* general path */ const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + baseFormat, srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -2364,9 +2400,9 @@ _mesa_texstore_a8(TEXSTORE_PARAMS) _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { for (col = 0; col < srcWidth; col++) { dstRow[col] = CHAN_TO_UBYTE(src[col]); @@ -2385,9 +2421,11 @@ _mesa_texstore_a8(TEXSTORE_PARAMS) GLboolean _mesa_texstore_ci8(TEXSTORE_PARAMS) { + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); + (void) dims; (void) baseInternalFormat; ASSERT(dstFormat == &_mesa_texformat_ci8); - ASSERT(dstFormat->TexelBytes == 1); + ASSERT(texelBytes == 1); ASSERT(baseInternalFormat == GL_COLOR_INDEX); if (!ctx->_ImageTransferState && @@ -2407,9 +2445,9 @@ _mesa_texstore_ci8(TEXSTORE_PARAMS) GLint img, row; for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { const GLvoid *src = _mesa_image_address(dims, srcPacking, srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, row, 0); @@ -2431,11 +2469,13 @@ GLboolean _mesa_texstore_ycbcr(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); + (void) ctx; (void) dims; (void) baseInternalFormat; ASSERT((dstFormat == &_mesa_texformat_ycbcr) || (dstFormat == &_mesa_texformat_ycbcr_rev)); - ASSERT(dstFormat->TexelBytes == 2); + ASSERT(texelBytes == 2); ASSERT(ctx->Extensions.MESA_ycbcr_texture); ASSERT(srcFormat == GL_YCBCR_MESA); ASSERT((srcType == GL_UNSIGNED_SHORT_8_8_MESA) || @@ -2459,9 +2499,9 @@ _mesa_texstore_ycbcr(TEXSTORE_PARAMS) GLint img, row; for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { _mesa_swap2((GLushort *) dstRow, srcWidth); dstRow += dstRowStride; @@ -2475,9 +2515,10 @@ GLboolean _mesa_texstore_dudv8(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); ASSERT(dstFormat == &_mesa_texformat_dudv8); - ASSERT(dstFormat->TexelBytes == 2); + ASSERT(texelBytes == 2); ASSERT(ctx->Extensions.ATI_envmap_bumpmap); ASSERT((srcFormat == GL_DU8DV8_ATI) || (srcFormat == GL_DUDV_ATI)); @@ -2550,11 +2591,11 @@ _mesa_texstore_dudv8(TEXSTORE_PARAMS) src = tempImage; dst = (GLbyte *) dstAddr + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { - memcpy(dst, src, srcWidth * dstFormat->TexelBytes); + memcpy(dst, src, srcWidth * texelBytes); dst += dstRowStride; - src += srcWidth * dstFormat->TexelBytes; + src += srcWidth * texelBytes; } _mesa_free((void *) tempImage); } @@ -2568,10 +2609,12 @@ GLboolean _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); ASSERT(dstFormat == &_mesa_texformat_signed_rgba8888 || dstFormat == &_mesa_texformat_signed_rgba8888_rev); - ASSERT(dstFormat->TexelBytes == 4); + ASSERT(texelBytes == 4); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -2638,7 +2681,7 @@ _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS) /* general path */ const GLfloat *tempImage = make_temp_float_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + baseFormat, srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -2649,9 +2692,9 @@ _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS) _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLuint *dstUI = (GLuint *) dstRow; if (dstFormat == &_mesa_texformat_signed_rgba8888) { @@ -2876,7 +2919,9 @@ _mesa_texstore_s8_z24(TEXSTORE_PARAMS) GLboolean _mesa_texstore_rgba_float32(TEXSTORE_PARAMS) { - const GLint components = _mesa_components_in_format(dstFormat->BaseFormat); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); + const GLint components = _mesa_components_in_format(baseFormat); ASSERT(dstFormat == &_mesa_texformat_rgba_float32 || dstFormat == &_mesa_texformat_rgb_float32 || @@ -2890,7 +2935,7 @@ _mesa_texstore_rgba_float32(TEXSTORE_PARAMS) baseInternalFormat == GL_LUMINANCE || baseInternalFormat == GL_LUMINANCE_ALPHA || baseInternalFormat == GL_INTENSITY); - ASSERT(dstFormat->TexelBytes == components * sizeof(GLfloat)); + ASSERT(texelBytes == components * sizeof(GLfloat)); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -2908,7 +2953,7 @@ _mesa_texstore_rgba_float32(TEXSTORE_PARAMS) /* general path */ const GLfloat *tempImage = make_temp_float_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + baseFormat, srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -2921,9 +2966,9 @@ _mesa_texstore_rgba_float32(TEXSTORE_PARAMS) bytesPerRow = srcWidth * components * sizeof(GLfloat); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { _mesa_memcpy(dstRow, srcRow, bytesPerRow); dstRow += dstRowStride; @@ -2943,7 +2988,9 @@ _mesa_texstore_rgba_float32(TEXSTORE_PARAMS) GLboolean _mesa_texstore_rgba_float16(TEXSTORE_PARAMS) { - const GLint components = _mesa_components_in_format(dstFormat->BaseFormat); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); + const GLint components = _mesa_components_in_format(baseFormat); ASSERT(dstFormat == &_mesa_texformat_rgba_float16 || dstFormat == &_mesa_texformat_rgb_float16 || @@ -2957,7 +3004,7 @@ _mesa_texstore_rgba_float16(TEXSTORE_PARAMS) baseInternalFormat == GL_LUMINANCE || baseInternalFormat == GL_LUMINANCE_ALPHA || baseInternalFormat == GL_INTENSITY); - ASSERT(dstFormat->TexelBytes == components * sizeof(GLhalfARB)); + ASSERT(texelBytes == components * sizeof(GLhalfARB)); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && @@ -2975,7 +3022,7 @@ _mesa_texstore_rgba_float16(TEXSTORE_PARAMS) /* general path */ const GLfloat *tempImage = make_temp_float_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + baseFormat, srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -2986,9 +3033,9 @@ _mesa_texstore_rgba_float16(TEXSTORE_PARAMS) _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLhalfARB *dstTexel = (GLhalfARB *) dstRow; GLint i; -- cgit v1.2.3 From 485105ed182e2e997b084f047e72d5a2c3460057 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 26 Sep 2009 12:32:13 -0600 Subject: mesa: move _mesa_get_texstore_func() to texstore.c --- src/mesa/main/formats.c | 75 ------------------------------------------ src/mesa/main/texstore.c | 85 ++++++++++++++++++++++++++++++++++++++++++++++++ src/mesa/main/texstore.h | 5 +++ 3 files changed, 90 insertions(+), 75 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index 32884cb41d..8aa0d107b7 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -566,68 +566,6 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }; -static struct { - gl_format Name; - StoreTexImageFunc Store; -} -texstore_funcs[MESA_FORMAT_COUNT] = -{ - { MESA_FORMAT_RGBA, _mesa_texstore_rgba }, - { MESA_FORMAT_RGB, _mesa_texstore_rgba }, - { MESA_FORMAT_ALPHA, _mesa_texstore_rgba }, - { MESA_FORMAT_LUMINANCE, _mesa_texstore_rgba }, - { MESA_FORMAT_LUMINANCE_ALPHA, _mesa_texstore_rgba }, - { MESA_FORMAT_INTENSITY, _mesa_texstore_rgba }, - { MESA_FORMAT_SRGB8, _mesa_texstore_srgb8 }, - { MESA_FORMAT_SRGBA8, _mesa_texstore_srgba8 }, - { MESA_FORMAT_SARGB8, _mesa_texstore_sargb8 }, - { MESA_FORMAT_SL8, _mesa_texstore_sl8 }, - { MESA_FORMAT_SLA8, _mesa_texstore_sla8 }, - { MESA_FORMAT_RGBA_FLOAT32, _mesa_texstore_rgba_float32 }, - { MESA_FORMAT_RGBA_FLOAT16, _mesa_texstore_rgba_float16 }, - { MESA_FORMAT_RGB_FLOAT32, _mesa_texstore_rgba_float32 }, - { MESA_FORMAT_RGB_FLOAT16, _mesa_texstore_rgba_float16 }, - { MESA_FORMAT_ALPHA_FLOAT32, _mesa_texstore_rgba_float32 }, - { MESA_FORMAT_ALPHA_FLOAT16, _mesa_texstore_rgba_float16 }, - { MESA_FORMAT_LUMINANCE_FLOAT32, _mesa_texstore_rgba_float32 }, - { MESA_FORMAT_LUMINANCE_FLOAT16, _mesa_texstore_rgba_float16 }, - { MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32, _mesa_texstore_rgba_float32 }, - { MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16, _mesa_texstore_rgba_float16 }, - { MESA_FORMAT_INTENSITY_FLOAT32, _mesa_texstore_rgba_float32 }, - { MESA_FORMAT_INTENSITY_FLOAT16, _mesa_texstore_rgba_float16 }, - { MESA_FORMAT_DUDV8, _mesa_texstore_dudv8 }, - { MESA_FORMAT_SIGNED_RGBA8888, _mesa_texstore_signed_rgba8888 }, - { MESA_FORMAT_SIGNED_RGBA8888_REV, _mesa_texstore_signed_rgba8888 }, - { MESA_FORMAT_RGBA8888, _mesa_texstore_rgba8888 }, - { MESA_FORMAT_RGBA8888_REV, _mesa_texstore_rgba8888 }, - { MESA_FORMAT_ARGB8888, _mesa_texstore_argb8888 }, - { MESA_FORMAT_ARGB8888_REV, _mesa_texstore_argb8888 }, - { MESA_FORMAT_RGB888, _mesa_texstore_rgb888 }, - { MESA_FORMAT_BGR888, _mesa_texstore_bgr888 }, - { MESA_FORMAT_RGB565, _mesa_texstore_rgb565 }, - { MESA_FORMAT_RGB565_REV, _mesa_texstore_rgb565 }, - { MESA_FORMAT_RGBA4444, _mesa_texstore_rgba4444 }, - { MESA_FORMAT_ARGB4444, _mesa_texstore_argb4444 }, - { MESA_FORMAT_ARGB4444_REV, _mesa_texstore_argb4444 }, - { MESA_FORMAT_RGBA5551, _mesa_texstore_rgba5551 }, - { MESA_FORMAT_ARGB1555, _mesa_texstore_argb1555 }, - { MESA_FORMAT_ARGB1555_REV, _mesa_texstore_argb1555 }, - { MESA_FORMAT_AL88, _mesa_texstore_al88 }, - { MESA_FORMAT_AL88_REV, _mesa_texstore_al88 }, - { MESA_FORMAT_RGB332, _mesa_texstore_rgb332 }, - { MESA_FORMAT_A8, _mesa_texstore_a8 }, - { MESA_FORMAT_L8, _mesa_texstore_a8 }, - { MESA_FORMAT_I8, _mesa_texstore_a8 }, - { MESA_FORMAT_CI8, _mesa_texstore_ci8 }, - { MESA_FORMAT_YCBCR, _mesa_texstore_ycbcr }, - { MESA_FORMAT_YCBCR_REV, _mesa_texstore_ycbcr }, - { MESA_FORMAT_Z24_S8, _mesa_texstore_z24_s8 }, - { MESA_FORMAT_S8_Z24, _mesa_texstore_s8_z24 }, - { MESA_FORMAT_Z16, _mesa_texstore_z16 }, - { MESA_FORMAT_Z32, _mesa_texstore_z32 }, - { MESA_FORMAT_S8, NULL/*_mesa_texstore_s8*/ }, -}; - static const struct gl_format_info * _mesa_get_format_info(gl_format format) @@ -663,19 +601,6 @@ _mesa_is_format_compressed(gl_format format) } -/* XXX move to texstore.c */ -StoreTexImageFunc -_mesa_get_texstore_func(gl_format format) -{ - GLuint i; - for (i = 0; i < MESA_FORMAT_COUNT; i++) { - if (texstore_funcs[i].Name == format) - return texstore_funcs[i].Store; - } - return NULL; -} - - /** * Do sanity checking of the format info table. */ diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 5b13581b3a..7f2e71585e 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -3168,6 +3168,91 @@ _mesa_texstore_sla8(TEXSTORE_PARAMS) #endif /* FEATURE_EXT_texture_sRGB */ + + +/** + * Table mapping MESA_FORMAT_8 to _mesa_texstore_*() + * XXX this is somewhat temporary. + */ +static struct { + gl_format Name; + StoreTexImageFunc Store; +} +texstore_funcs[MESA_FORMAT_COUNT] = +{ + { MESA_FORMAT_RGBA, _mesa_texstore_rgba }, + { MESA_FORMAT_RGB, _mesa_texstore_rgba }, + { MESA_FORMAT_ALPHA, _mesa_texstore_rgba }, + { MESA_FORMAT_LUMINANCE, _mesa_texstore_rgba }, + { MESA_FORMAT_LUMINANCE_ALPHA, _mesa_texstore_rgba }, + { MESA_FORMAT_INTENSITY, _mesa_texstore_rgba }, + { MESA_FORMAT_SRGB8, _mesa_texstore_srgb8 }, + { MESA_FORMAT_SRGBA8, _mesa_texstore_srgba8 }, + { MESA_FORMAT_SARGB8, _mesa_texstore_sargb8 }, + { MESA_FORMAT_SL8, _mesa_texstore_sl8 }, + { MESA_FORMAT_SLA8, _mesa_texstore_sla8 }, + { MESA_FORMAT_RGBA_FLOAT32, _mesa_texstore_rgba_float32 }, + { MESA_FORMAT_RGBA_FLOAT16, _mesa_texstore_rgba_float16 }, + { MESA_FORMAT_RGB_FLOAT32, _mesa_texstore_rgba_float32 }, + { MESA_FORMAT_RGB_FLOAT16, _mesa_texstore_rgba_float16 }, + { MESA_FORMAT_ALPHA_FLOAT32, _mesa_texstore_rgba_float32 }, + { MESA_FORMAT_ALPHA_FLOAT16, _mesa_texstore_rgba_float16 }, + { MESA_FORMAT_LUMINANCE_FLOAT32, _mesa_texstore_rgba_float32 }, + { MESA_FORMAT_LUMINANCE_FLOAT16, _mesa_texstore_rgba_float16 }, + { MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32, _mesa_texstore_rgba_float32 }, + { MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16, _mesa_texstore_rgba_float16 }, + { MESA_FORMAT_INTENSITY_FLOAT32, _mesa_texstore_rgba_float32 }, + { MESA_FORMAT_INTENSITY_FLOAT16, _mesa_texstore_rgba_float16 }, + { MESA_FORMAT_DUDV8, _mesa_texstore_dudv8 }, + { MESA_FORMAT_SIGNED_RGBA8888, _mesa_texstore_signed_rgba8888 }, + { MESA_FORMAT_SIGNED_RGBA8888_REV, _mesa_texstore_signed_rgba8888 }, + { MESA_FORMAT_RGBA8888, _mesa_texstore_rgba8888 }, + { MESA_FORMAT_RGBA8888_REV, _mesa_texstore_rgba8888 }, + { MESA_FORMAT_ARGB8888, _mesa_texstore_argb8888 }, + { MESA_FORMAT_ARGB8888_REV, _mesa_texstore_argb8888 }, + { MESA_FORMAT_RGB888, _mesa_texstore_rgb888 }, + { MESA_FORMAT_BGR888, _mesa_texstore_bgr888 }, + { MESA_FORMAT_RGB565, _mesa_texstore_rgb565 }, + { MESA_FORMAT_RGB565_REV, _mesa_texstore_rgb565 }, + { MESA_FORMAT_RGBA4444, _mesa_texstore_rgba4444 }, + { MESA_FORMAT_ARGB4444, _mesa_texstore_argb4444 }, + { MESA_FORMAT_ARGB4444_REV, _mesa_texstore_argb4444 }, + { MESA_FORMAT_RGBA5551, _mesa_texstore_rgba5551 }, + { MESA_FORMAT_ARGB1555, _mesa_texstore_argb1555 }, + { MESA_FORMAT_ARGB1555_REV, _mesa_texstore_argb1555 }, + { MESA_FORMAT_AL88, _mesa_texstore_al88 }, + { MESA_FORMAT_AL88_REV, _mesa_texstore_al88 }, + { MESA_FORMAT_RGB332, _mesa_texstore_rgb332 }, + { MESA_FORMAT_A8, _mesa_texstore_a8 }, + { MESA_FORMAT_L8, _mesa_texstore_a8 }, + { MESA_FORMAT_I8, _mesa_texstore_a8 }, + { MESA_FORMAT_CI8, _mesa_texstore_ci8 }, + { MESA_FORMAT_YCBCR, _mesa_texstore_ycbcr }, + { MESA_FORMAT_YCBCR_REV, _mesa_texstore_ycbcr }, + { MESA_FORMAT_Z24_S8, _mesa_texstore_z24_s8 }, + { MESA_FORMAT_S8_Z24, _mesa_texstore_s8_z24 }, + { MESA_FORMAT_Z16, _mesa_texstore_z16 }, + { MESA_FORMAT_Z32, _mesa_texstore_z32 }, + { MESA_FORMAT_S8, NULL/*_mesa_texstore_s8*/ }, +}; + + +/** + * Return the StoreTexImageFunc pointer to store an image in the given format. + */ +StoreTexImageFunc +_mesa_get_texstore_func(gl_format format) +{ + GLuint i; + for (i = 0; i < MESA_FORMAT_COUNT; i++) { + if (texstore_funcs[i].Name == format) + return texstore_funcs[i].Store; + } + return NULL; +} + + + /** * Check if an unpack PBO is active prior to fetching a texture image. * If so, do bounds checking and map the buffer into main memory. diff --git a/src/mesa/main/texstore.h b/src/mesa/main/texstore.h index 313f2d6a59..629854b446 100644 --- a/src/mesa/main/texstore.h +++ b/src/mesa/main/texstore.h @@ -37,6 +37,7 @@ #include "mtypes.h" +#include "formats.h" extern GLboolean _mesa_texstore_rgba(TEXSTORE_PARAMS); @@ -154,6 +155,10 @@ _mesa_store_texsubimage3d(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_image *texImage); +extern StoreTexImageFunc +_mesa_get_texstore_func(gl_format format); + + extern void _mesa_store_compressed_teximage1d(GLcontext *ctx, GLenum target, GLint level, GLint internalFormat, -- cgit v1.2.3 From eea30906de37ea3b2f8a594c2b33b643d3dde987 Mon Sep 17 00:00:00 2001 From: Richard Li Date: Sun, 27 Sep 2009 14:47:12 -0400 Subject: r600 : Enable draw_prim. --- src/mesa/drivers/dri/r600/r700_render.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c index 5627984cf9..4949bf013d 100644 --- a/src/mesa/drivers/dri/r600/r700_render.c +++ b/src/mesa/drivers/dri/r600/r700_render.c @@ -1147,9 +1147,7 @@ void r700InitDraw(GLcontext *ctx) struct vbo_context *vbo = vbo_context(ctx); /* to be enabled */ - /* vbo->draw_prims = r700DrawPrims; - */ } -- cgit v1.2.3 From 722b76156486bbb03f8504e8f7a5db05b9257da5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 17:01:41 -0600 Subject: mesa: use _mesa_get_texstore_func() to get texture image store func --- src/mesa/main/texstore.c | 136 ++++++++++++++++++++++++++++------------------- 1 file changed, 82 insertions(+), 54 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 7f2e71585e..f457e08a5b 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -3501,15 +3501,19 @@ _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level, else { const GLint dstRowStride = 0; GLboolean success; - ASSERT(texImage->TexFormat->StoreImage); - success = texImage->TexFormat->StoreImage(ctx, 1, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, - texImage->ImageOffsets, - width, 1, 1, - format, type, pixels, packing); + const StoreTexImageFunc storeImage = + _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); + + ASSERT(storeImage); + + success = storeImage(ctx, 1, texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + 0, 0, 0, /* dstX/Y/Zoffset */ + dstRowStride, + texImage->ImageOffsets, + width, 1, 1, + format, type, pixels, packing); if (!success) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D"); } @@ -3572,6 +3576,11 @@ _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level, else { GLint dstRowStride; GLboolean success; + const StoreTexImageFunc storeImage = + _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); + + ASSERT(storeImage); + if (texImage->IsCompressed) { dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, width); @@ -3579,15 +3588,15 @@ _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level, else { dstRowStride = texImage->RowStride * texImage->TexFormat->TexelBytes; } - ASSERT(texImage->TexFormat->StoreImage); - success = texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, - texImage->ImageOffsets, - width, height, 1, - format, type, pixels, packing); + + success = storeImage(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + 0, 0, 0, /* dstX/Y/Zoffset */ + dstRowStride, + texImage->ImageOffsets, + width, height, 1, + format, type, pixels, packing); if (!success) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); } @@ -3646,6 +3655,11 @@ _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level, else { GLint dstRowStride; GLboolean success; + const StoreTexImageFunc storeImage = + _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); + + ASSERT(storeImage); + if (texImage->IsCompressed) { dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, width); @@ -3653,15 +3667,15 @@ _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level, else { dstRowStride = texImage->RowStride * texImage->TexFormat->TexelBytes; } - ASSERT(texImage->TexFormat->StoreImage); - success = texImage->TexFormat->StoreImage(ctx, 3, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, - texImage->ImageOffsets, - width, height, depth, - format, type, pixels, packing); + + success = storeImage(ctx, 3, texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + 0, 0, 0, /* dstX/Y/Zoffset */ + dstRowStride, + texImage->ImageOffsets, + width, height, depth, + format, type, pixels, packing); if (!success) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage3D"); } @@ -3694,15 +3708,19 @@ _mesa_store_texsubimage1d(GLcontext *ctx, GLenum target, GLint level, { const GLint dstRowStride = 0; GLboolean success; - ASSERT(texImage->TexFormat->StoreImage); - success = texImage->TexFormat->StoreImage(ctx, 1, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - xoffset, 0, 0, /* offsets */ - dstRowStride, - texImage->ImageOffsets, - width, 1, 1, - format, type, pixels, packing); + const StoreTexImageFunc storeImage = + _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); + + ASSERT(storeImage); + + success = storeImage(ctx, 1, texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + xoffset, 0, 0, /* offsets */ + dstRowStride, + texImage->ImageOffsets, + width, 1, 1, + format, type, pixels, packing); if (!success) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage1D"); } @@ -3735,6 +3753,11 @@ _mesa_store_texsubimage2d(GLcontext *ctx, GLenum target, GLint level, { GLint dstRowStride = 0; GLboolean success; + const StoreTexImageFunc storeImage = + _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); + + ASSERT(storeImage); + if (texImage->IsCompressed) { dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, texImage->Width); @@ -3742,15 +3765,15 @@ _mesa_store_texsubimage2d(GLcontext *ctx, GLenum target, GLint level, else { dstRowStride = texImage->RowStride * texImage->TexFormat->TexelBytes; } - ASSERT(texImage->TexFormat->StoreImage); - success = texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - xoffset, yoffset, 0, - dstRowStride, - texImage->ImageOffsets, - width, height, 1, - format, type, pixels, packing); + + success = storeImage(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + xoffset, yoffset, 0, + dstRowStride, + texImage->ImageOffsets, + width, height, 1, + format, type, pixels, packing); if (!success) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage2D"); } @@ -3783,6 +3806,11 @@ _mesa_store_texsubimage3d(GLcontext *ctx, GLenum target, GLint level, { GLint dstRowStride; GLboolean success; + const StoreTexImageFunc storeImage = + _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); + + ASSERT(storeImage); + if (texImage->IsCompressed) { dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, texImage->Width); @@ -3790,15 +3818,15 @@ _mesa_store_texsubimage3d(GLcontext *ctx, GLenum target, GLint level, else { dstRowStride = texImage->RowStride * texImage->TexFormat->TexelBytes; } - ASSERT(texImage->TexFormat->StoreImage); - success = texImage->TexFormat->StoreImage(ctx, 3, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - xoffset, yoffset, zoffset, - dstRowStride, - texImage->ImageOffsets, - width, height, depth, - format, type, pixels, packing); + + success = storeImage(ctx, 3, texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + xoffset, yoffset, zoffset, + dstRowStride, + texImage->ImageOffsets, + width, height, depth, + format, type, pixels, packing); if (!success) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage3D"); } -- cgit v1.2.3 From 0f91e4461fb3a7410c948acde270d97caa851ed6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 17:07:22 -0600 Subject: mesa: minor clean-up in _mesa_texstore_srgb8() --- src/mesa/main/texstore.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index f457e08a5b..f4df71d769 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -3058,16 +3058,14 @@ GLboolean _mesa_texstore_srgb8(TEXSTORE_PARAMS) { const struct gl_texture_format *newDstFormat; - StoreTexImageFunc store; GLboolean k; ASSERT(dstFormat == &_mesa_texformat_srgb8); /* reuse normal rgb texstore code */ newDstFormat = &_mesa_texformat_rgb888; - store = _mesa_texstore_rgb888; - k = store(ctx, dims, baseInternalFormat, + k = _mesa_texstore_rgb888(ctx, dims, baseInternalFormat, newDstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, dstRowStride, dstImageOffsets, -- cgit v1.2.3 From 7116ae857c6ef3809c712e96b28bd69d92b3cd33 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 18:08:49 -0600 Subject: mesa: make some s3tc/fxt1 functions public --- src/mesa/main/texcompress_fxt1.c | 45 ++++++++++--------- src/mesa/main/texcompress_fxt1.h | 51 +++++++++++++++++++++ src/mesa/main/texcompress_s3tc.c | 97 ++++++++++++++++++++-------------------- src/mesa/main/texcompress_s3tc.h | 73 ++++++++++++++++++++++++++++++ 4 files changed, 196 insertions(+), 70 deletions(-) create mode 100644 src/mesa/main/texcompress_fxt1.h create mode 100644 src/mesa/main/texcompress_s3tc.h (limited to 'src/mesa') diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c index fc151605c9..e3ac37999c 100644 --- a/src/mesa/main/texcompress_fxt1.c +++ b/src/mesa/main/texcompress_fxt1.c @@ -37,6 +37,7 @@ #include "image.h" #include "mipmap.h" #include "texcompress.h" +#include "texcompress_fxt1.h" #include "texformat.h" #include "texstore.h" @@ -64,8 +65,8 @@ _mesa_init_texture_fxt1( GLcontext *ctx ) /** * Called via TexFormat->StoreImage to store an RGB_FXT1 texture. */ -static GLboolean -texstore_rgb_fxt1(TEXSTORE_PARAMS) +GLboolean +_mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS) { const GLchan *pixels; GLint srcRowStride; @@ -121,8 +122,8 @@ texstore_rgb_fxt1(TEXSTORE_PARAMS) /** * Called via TexFormat->StoreImage to store an RGBA_FXT1 texture. */ -static GLboolean -texstore_rgba_fxt1(TEXSTORE_PARAMS) +GLboolean +_mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS) { const GLchan *pixels; GLint srcRowStride; @@ -175,18 +176,18 @@ texstore_rgba_fxt1(TEXSTORE_PARAMS) } -static void -fetch_texel_2d_rgba_fxt1( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) +void +_mesa_fetch_texel_2d_rgba_fxt1( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLchan *texel ) { (void) k; fxt1_decode_1(texImage->Data, texImage->RowStride, i, j, texel); } -static void -fetch_texel_2d_f_rgba_fxt1( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) +void +_mesa_fetch_texel_2d_f_rgba_fxt1( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) { /* just sample as GLchan and convert to float here */ GLchan rgba[4]; @@ -199,9 +200,9 @@ fetch_texel_2d_f_rgba_fxt1( const struct gl_texture_image *texImage, } -static void -fetch_texel_2d_rgb_fxt1( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) +void +_mesa_fetch_texel_2d_rgb_fxt1( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLchan *texel ) { (void) k; fxt1_decode_1(texImage->Data, texImage->RowStride, i, j, texel); @@ -209,9 +210,9 @@ fetch_texel_2d_rgb_fxt1( const struct gl_texture_image *texImage, } -static void -fetch_texel_2d_f_rgb_fxt1( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) +void +_mesa_fetch_texel_2d_f_rgb_fxt1( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) { /* just sample as GLchan and convert to float here */ GLchan rgba[4]; @@ -239,12 +240,12 @@ const struct gl_texture_format _mesa_texformat_rgb_fxt1 = { 0, /* DepthBits */ 0, /* StencilBits */ 0, /* TexelBytes */ - texstore_rgb_fxt1, /* StoreTexImageFunc */ + _mesa_texstore_rgb_fxt1, /* StoreTexImageFunc */ NULL, /*impossible*/ /* FetchTexel1D */ - fetch_texel_2d_rgb_fxt1, /* FetchTexel2D */ + _mesa_fetch_texel_2d_rgb_fxt1, /* FetchTexel2D */ NULL, /*impossible*/ /* FetchTexel3D */ NULL, /*impossible*/ /* FetchTexel1Df */ - fetch_texel_2d_f_rgb_fxt1, /* FetchTexel2Df */ + _mesa_fetch_texel_2d_f_rgb_fxt1, /* FetchTexel2Df */ NULL, /*impossible*/ /* FetchTexel3Df */ NULL /* StoreTexel */ }; @@ -263,12 +264,12 @@ const struct gl_texture_format _mesa_texformat_rgba_fxt1 = { 0, /* DepthBits */ 0, /* StencilBits */ 0, /* TexelBytes */ - texstore_rgba_fxt1, /* StoreTexImageFunc */ + _mesa_texstore_rgba_fxt1, /* StoreTexImageFunc */ NULL, /*impossible*/ /* FetchTexel1D */ - fetch_texel_2d_rgba_fxt1, /* FetchTexel2D */ + _mesa_fetch_texel_2d_rgba_fxt1, /* FetchTexel2D */ NULL, /*impossible*/ /* FetchTexel3D */ NULL, /*impossible*/ /* FetchTexel1Df */ - fetch_texel_2d_f_rgba_fxt1, /* FetchTexel2Df */ + _mesa_fetch_texel_2d_f_rgba_fxt1, /* FetchTexel2Df */ NULL, /*impossible*/ /* FetchTexel3Df */ NULL /* StoreTexel */ }; diff --git a/src/mesa/main/texcompress_fxt1.h b/src/mesa/main/texcompress_fxt1.h new file mode 100644 index 0000000000..a9ddce9a8c --- /dev/null +++ b/src/mesa/main/texcompress_fxt1.h @@ -0,0 +1,51 @@ +/* + * Mesa 3-D graphics library + * Version: 7.1 + * + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * 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. + */ + +#ifndef TEXCOMPRESS_FXT1_H +#define TEXCOMPRESS_FXT1_H + +extern GLboolean +_mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS); + +extern GLboolean +_mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS); + +extern void +_mesa_fetch_texel_2d_rgba_fxt1(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLchan *texel); + +extern void +_mesa_fetch_texel_2d_f_rgba_fxt1(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel); + +extern void +_mesa_fetch_texel_2d_rgb_fxt1(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLchan *texel); + +extern void +_mesa_fetch_texel_2d_f_rgb_fxt1(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel); + + +#endif /* TEXCOMPRESS_FXT1_H */ diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c index a1c0f18f36..c880119c3c 100644 --- a/src/mesa/main/texcompress_s3tc.c +++ b/src/mesa/main/texcompress_s3tc.c @@ -41,6 +41,7 @@ #include "dlopen.h" #include "image.h" #include "texcompress.h" +#include "texcompress_s3tc.h" #include "texformat.h" #include "texstore.h" @@ -155,8 +156,8 @@ _mesa_init_texture_s3tc( GLcontext *ctx ) /** * Called via TexFormat->StoreImage to store an RGB_DXT1 texture. */ -static GLboolean -texstore_rgb_dxt1(TEXSTORE_PARAMS) +GLboolean +_mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS) { const GLchan *pixels; GLint srcRowStride; @@ -218,8 +219,8 @@ texstore_rgb_dxt1(TEXSTORE_PARAMS) /** * Called via TexFormat->StoreImage to store an RGBA_DXT1 texture. */ -static GLboolean -texstore_rgba_dxt1(TEXSTORE_PARAMS) +GLboolean +_mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS) { const GLchan *pixels; GLint srcRowStride; @@ -280,8 +281,8 @@ texstore_rgba_dxt1(TEXSTORE_PARAMS) /** * Called via TexFormat->StoreImage to store an RGBA_DXT3 texture. */ -static GLboolean -texstore_rgba_dxt3(TEXSTORE_PARAMS) +GLboolean +_mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS) { const GLchan *pixels; GLint srcRowStride; @@ -341,8 +342,8 @@ texstore_rgba_dxt3(TEXSTORE_PARAMS) /** * Called via TexFormat->StoreImage to store an RGBA_DXT5 texture. */ -static GLboolean -texstore_rgba_dxt5(TEXSTORE_PARAMS) +GLboolean +_mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS) { const GLchan *pixels; GLint srcRowStride; @@ -414,9 +415,9 @@ fetch_texel_2d_rgb_dxt1( const struct gl_texture_image *texImage, } -static void -fetch_texel_2d_f_rgb_dxt1( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) +void +_mesa_fetch_texel_2d_f_rgb_dxt1(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel) { /* just sample as GLchan and convert to float here */ GLchan rgba[4]; @@ -442,9 +443,9 @@ fetch_texel_2d_rgba_dxt1( const struct gl_texture_image *texImage, } -static void -fetch_texel_2d_f_rgba_dxt1( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) +void +_mesa_fetch_texel_2d_f_rgba_dxt1(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel) { /* just sample as GLchan and convert to float here */ GLchan rgba[4]; @@ -471,9 +472,9 @@ fetch_texel_2d_rgba_dxt3( const struct gl_texture_image *texImage, } -static void -fetch_texel_2d_f_rgba_dxt3( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) +void +_mesa_fetch_texel_2d_f_rgba_dxt3(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel) { /* just sample as GLchan and convert to float here */ GLchan rgba[4]; @@ -499,9 +500,9 @@ fetch_texel_2d_rgba_dxt5( const struct gl_texture_image *texImage, } -static void -fetch_texel_2d_f_rgba_dxt5( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) +void +_mesa_fetch_texel_2d_f_rgba_dxt5(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel) { /* just sample as GLchan and convert to float here */ GLchan rgba[4]; @@ -513,9 +514,9 @@ fetch_texel_2d_f_rgba_dxt5( const struct gl_texture_image *texImage, } #if FEATURE_EXT_texture_sRGB -static void -fetch_texel_2d_f_srgb_dxt1( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) +void +_mesa_fetch_texel_2d_f_srgb_dxt1( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) { /* just sample as GLchan and convert to float here */ GLchan rgba[4]; @@ -526,9 +527,9 @@ fetch_texel_2d_f_srgb_dxt1( const struct gl_texture_image *texImage, texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]); } -static void -fetch_texel_2d_f_srgba_dxt1( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) +void +_mesa_fetch_texel_2d_f_srgba_dxt1(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel) { /* just sample as GLchan and convert to float here */ GLchan rgba[4]; @@ -539,9 +540,9 @@ fetch_texel_2d_f_srgba_dxt1( const struct gl_texture_image *texImage, texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]); } -static void -fetch_texel_2d_f_srgba_dxt3( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) +void +_mesa_fetch_texel_2d_f_srgba_dxt3(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel) { /* just sample as GLchan and convert to float here */ GLchan rgba[4]; @@ -552,9 +553,9 @@ fetch_texel_2d_f_srgba_dxt3( const struct gl_texture_image *texImage, texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]); } -static void -fetch_texel_2d_f_srgba_dxt5( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) +void +_mesa_fetch_texel_2d_f_srgba_dxt5(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel) { /* just sample as GLchan and convert to float here */ GLchan rgba[4]; @@ -580,12 +581,12 @@ const struct gl_texture_format _mesa_texformat_rgb_dxt1 = { 0, /* DepthBits */ 0, /* StencilBits */ 0, /* TexelBytes */ - texstore_rgb_dxt1, /* StoreTexImageFunc */ + _mesa_texstore_rgb_dxt1, /* StoreTexImageFunc */ NULL, /*impossible*/ /* FetchTexel1D */ fetch_texel_2d_rgb_dxt1, /* FetchTexel2D */ NULL, /*impossible*/ /* FetchTexel3D */ NULL, /*impossible*/ /* FetchTexel1Df */ - fetch_texel_2d_f_rgb_dxt1, /* FetchTexel2Df */ + _mesa_fetch_texel_2d_f_rgb_dxt1, /* FetchTexel2Df */ NULL, /*impossible*/ /* FetchTexel3Df */ NULL /* StoreTexel */ }; @@ -604,12 +605,12 @@ const struct gl_texture_format _mesa_texformat_rgba_dxt1 = { 0, /* DepthBits */ 0, /* StencilBits */ 0, /* TexelBytes */ - texstore_rgba_dxt1, /* StoreTexImageFunc */ + _mesa_texstore_rgba_dxt1, /* StoreTexImageFunc */ NULL, /*impossible*/ /* FetchTexel1D */ fetch_texel_2d_rgba_dxt1, /* FetchTexel2D */ NULL, /*impossible*/ /* FetchTexel3D */ NULL, /*impossible*/ /* FetchTexel1Df */ - fetch_texel_2d_f_rgba_dxt1, /* FetchTexel2Df */ + _mesa_fetch_texel_2d_f_rgba_dxt1, /* FetchTexel2Df */ NULL, /*impossible*/ /* FetchTexel3Df */ NULL /* StoreTexel */ }; @@ -628,12 +629,12 @@ const struct gl_texture_format _mesa_texformat_rgba_dxt3 = { 0, /* DepthBits */ 0, /* StencilBits */ 0, /* TexelBytes */ - texstore_rgba_dxt3, /* StoreTexImageFunc */ + _mesa_texstore_rgba_dxt3, /* StoreTexImageFunc */ NULL, /*impossible*/ /* FetchTexel1D */ fetch_texel_2d_rgba_dxt3, /* FetchTexel2D */ NULL, /*impossible*/ /* FetchTexel3D */ NULL, /*impossible*/ /* FetchTexel1Df */ - fetch_texel_2d_f_rgba_dxt3, /* FetchTexel2Df */ + _mesa_fetch_texel_2d_f_rgba_dxt3, /* FetchTexel2Df */ NULL, /*impossible*/ /* FetchTexel3Df */ NULL /* StoreTexel */ }; @@ -652,12 +653,12 @@ const struct gl_texture_format _mesa_texformat_rgba_dxt5 = { 0, /* DepthBits */ 0, /* StencilBits */ 0, /* TexelBytes */ - texstore_rgba_dxt5, /* StoreTexImageFunc */ + _mesa_texstore_rgba_dxt5, /* StoreTexImageFunc */ NULL, /*impossible*/ /* FetchTexel1D */ fetch_texel_2d_rgba_dxt5, /* FetchTexel2D */ NULL, /*impossible*/ /* FetchTexel3D */ NULL, /*impossible*/ /* FetchTexel1Df */ - fetch_texel_2d_f_rgba_dxt5, /* FetchTexel2Df */ + _mesa_fetch_texel_2d_f_rgba_dxt5, /* FetchTexel2Df */ NULL, /*impossible*/ /* FetchTexel3Df */ NULL /* StoreTexel */ }; @@ -677,12 +678,12 @@ const struct gl_texture_format _mesa_texformat_srgb_dxt1 = { 0, /* DepthBits */ 0, /* StencilBits */ 0, /* TexelBytes */ - texstore_rgb_dxt1, /* StoreTexImageFunc */ + _mesa_texstore_rgb_dxt1, /* StoreTexImageFunc */ NULL, /*impossible*/ /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /*impossible*/ /* FetchTexel3D */ NULL, /*impossible*/ /* FetchTexel1Df */ - fetch_texel_2d_f_srgb_dxt1, /* FetchTexel2Df */ + _mesa_fetch_texel_2d_f_srgb_dxt1, /* FetchTexel2Df */ NULL, /*impossible*/ /* FetchTexel3Df */ NULL /* StoreTexel */ }; @@ -701,12 +702,12 @@ const struct gl_texture_format _mesa_texformat_srgba_dxt1 = { 0, /* DepthBits */ 0, /* StencilBits */ 0, /* TexelBytes */ - texstore_rgba_dxt1, /* StoreTexImageFunc */ + _mesa_texstore_rgba_dxt1, /* StoreTexImageFunc */ NULL, /*impossible*/ /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /*impossible*/ /* FetchTexel3D */ NULL, /*impossible*/ /* FetchTexel1Df */ - fetch_texel_2d_f_srgba_dxt1, /* FetchTexel2Df */ + _mesa_fetch_texel_2d_f_srgba_dxt1, /* FetchTexel2Df */ NULL, /*impossible*/ /* FetchTexel3Df */ NULL /* StoreTexel */ }; @@ -725,12 +726,12 @@ const struct gl_texture_format _mesa_texformat_srgba_dxt3 = { 0, /* DepthBits */ 0, /* StencilBits */ 0, /* TexelBytes */ - texstore_rgba_dxt3, /* StoreTexImageFunc */ + _mesa_texstore_rgba_dxt3, /* StoreTexImageFunc */ NULL, /*impossible*/ /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /*impossible*/ /* FetchTexel3D */ NULL, /*impossible*/ /* FetchTexel1Df */ - fetch_texel_2d_f_srgba_dxt3, /* FetchTexel2Df */ + _mesa_fetch_texel_2d_f_srgba_dxt3, /* FetchTexel2Df */ NULL, /*impossible*/ /* FetchTexel3Df */ NULL /* StoreTexel */ }; @@ -749,12 +750,12 @@ const struct gl_texture_format _mesa_texformat_srgba_dxt5 = { 0, /* DepthBits */ 0, /* StencilBits */ 0, /* TexelBytes */ - texstore_rgba_dxt5, /* StoreTexImageFunc */ + _mesa_texstore_rgba_dxt5, /* StoreTexImageFunc */ NULL, /*impossible*/ /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /*impossible*/ /* FetchTexel3D */ NULL, /*impossible*/ /* FetchTexel1Df */ - fetch_texel_2d_f_srgba_dxt5, /* FetchTexel2Df */ + _mesa_fetch_texel_2d_f_srgba_dxt5, /* FetchTexel2Df */ NULL, /*impossible*/ /* FetchTexel3Df */ NULL /* StoreTexel */ }; diff --git a/src/mesa/main/texcompress_s3tc.h b/src/mesa/main/texcompress_s3tc.h new file mode 100644 index 0000000000..866bb0e3d3 --- /dev/null +++ b/src/mesa/main/texcompress_s3tc.h @@ -0,0 +1,73 @@ +/* + * Mesa 3-D graphics library + * Version: 7.1 + * + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * 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. + */ + +#ifndef TEXCOMPRESS_S3TC_H +#define TEXCOMPRESS_S3TC_H + +extern GLboolean +_mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS); + +extern GLboolean +_mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS); + +extern GLboolean +_mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS); + +extern GLboolean +_mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS); + +extern void +_mesa_fetch_texel_2d_f_rgb_dxt1(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel); + +extern void +_mesa_fetch_texel_2d_f_rgba_dxt1(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel); + +extern void +_mesa_fetch_texel_2d_f_rgba_dxt3(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel); + +extern void +_mesa_fetch_texel_2d_f_rgba_dxt5(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel); + +extern void +_mesa_fetch_texel_2d_f_srgb_dxt1(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel); + +extern void +_mesa_fetch_texel_2d_f_srgba_dxt1(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel); + +extern void +_mesa_fetch_texel_2d_f_srgba_dxt3(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel); + +extern void +_mesa_fetch_texel_2d_f_srgba_dxt5(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel); + + +#endif /* TEXCOMPRESS_S3TC_H */ -- cgit v1.2.3 From da5722bea6e2f613933d3e3da214da8cd0047d2e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 18:09:23 -0600 Subject: mesa: use new look-up table to get texel fetch/store funcs --- src/mesa/main/texformat.c | 822 +++++++++++++++++++++++++++++++++++++--------- src/mesa/main/texformat.h | 6 + src/mesa/main/texstore.c | 22 +- 3 files changed, 671 insertions(+), 179 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index c709004784..b6c0a252d3 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -34,6 +34,9 @@ #include "colormac.h" #include "context.h" +#include "texcompress.h" +#include "texcompress_fxt1.h" +#include "texcompress_s3tc.h" #include "texformat.h" #include "texstore.h" @@ -157,9 +160,9 @@ const struct gl_texture_format _mesa_texformat_rgba = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_rgba, /* FetchTexel1Df */ - fetch_texel_2d_f_rgba, /* FetchTexel2Df */ - fetch_texel_3d_f_rgba, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_rgba /* StoreTexel */ }; @@ -181,9 +184,9 @@ const struct gl_texture_format _mesa_texformat_rgb = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_rgb, /* FetchTexel1Df */ - fetch_texel_2d_f_rgb, /* FetchTexel2Df */ - fetch_texel_3d_f_rgb, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_rgb /* StoreTexel */ }; @@ -205,9 +208,9 @@ const struct gl_texture_format _mesa_texformat_alpha = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_alpha, /* FetchTexel1Df */ - fetch_texel_2d_f_alpha, /* FetchTexel2Df */ - fetch_texel_3d_f_alpha, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_alpha /* StoreTexel */ }; @@ -229,9 +232,9 @@ const struct gl_texture_format _mesa_texformat_luminance = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_luminance, /* FetchTexel1Df */ - fetch_texel_2d_f_luminance, /* FetchTexel2Df */ - fetch_texel_3d_f_luminance, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_luminance /* StoreTexel */ }; @@ -253,9 +256,9 @@ const struct gl_texture_format _mesa_texformat_luminance_alpha = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_luminance_alpha, /* FetchTexel1Df */ - fetch_texel_2d_f_luminance_alpha, /* FetchTexel2Df */ - fetch_texel_3d_f_luminance_alpha, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_luminance_alpha /* StoreTexel */ }; @@ -277,9 +280,9 @@ const struct gl_texture_format _mesa_texformat_intensity = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_intensity, /* FetchTexel1Df */ - fetch_texel_2d_f_intensity, /* FetchTexel2Df */ - fetch_texel_3d_f_intensity, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_intensity /* StoreTexel */ }; @@ -304,9 +307,9 @@ const struct gl_texture_format _mesa_texformat_srgb8 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_srgb8, /* FetchTexel1Df */ - fetch_texel_2d_srgb8, /* FetchTexel2Df */ - fetch_texel_3d_srgb8, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_srgb8 /* StoreTexel */ }; @@ -328,9 +331,9 @@ const struct gl_texture_format _mesa_texformat_srgba8 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_srgba8, /* FetchTexel1Df */ - fetch_texel_2d_srgba8, /* FetchTexel2Df */ - fetch_texel_3d_srgba8, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_srgba8 /* StoreTexel */ }; @@ -352,9 +355,9 @@ const struct gl_texture_format _mesa_texformat_sargb8 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_sargb8, /* FetchTexel1Df */ - fetch_texel_2d_sargb8, /* FetchTexel2Df */ - fetch_texel_3d_sargb8, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_sargb8 /* StoreTexel */ }; @@ -376,9 +379,9 @@ const struct gl_texture_format _mesa_texformat_sl8 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_sl8, /* FetchTexel1Df */ - fetch_texel_2d_sl8, /* FetchTexel2Df */ - fetch_texel_3d_sl8, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_sl8 /* StoreTexel */ }; @@ -401,9 +404,9 @@ const struct gl_texture_format _mesa_texformat_sla8 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_sla8, /* FetchTexel1Df */ - fetch_texel_2d_sla8, /* FetchTexel2Df */ - fetch_texel_3d_sla8, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_sla8 /* StoreTexel */ }; @@ -427,9 +430,9 @@ const struct gl_texture_format _mesa_texformat_rgba_float32 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ - fetch_texel_1d_f_rgba_f32, /* FetchTexel1Df */ - fetch_texel_2d_f_rgba_f32, /* FetchTexel2Df */ - fetch_texel_3d_f_rgba_f32, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel1Df */ store_texel_rgba_f32 /* StoreTexel */ }; @@ -451,9 +454,9 @@ const struct gl_texture_format _mesa_texformat_rgba_float16 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ - fetch_texel_1d_f_rgba_f16, /* FetchTexel1Df */ - fetch_texel_2d_f_rgba_f16, /* FetchTexel2Df */ - fetch_texel_3d_f_rgba_f16, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel1Df */ store_texel_rgba_f16 /* StoreTexel */ }; @@ -475,9 +478,9 @@ const struct gl_texture_format _mesa_texformat_rgb_float32 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ - fetch_texel_1d_f_rgb_f32, /* FetchTexel1Df */ - fetch_texel_2d_f_rgb_f32, /* FetchTexel2Df */ - fetch_texel_3d_f_rgb_f32, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel1Df */ store_texel_rgb_f32 /* StoreTexel */ }; @@ -499,9 +502,9 @@ const struct gl_texture_format _mesa_texformat_rgb_float16 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ - fetch_texel_1d_f_rgb_f16, /* FetchTexel1Df */ - fetch_texel_2d_f_rgb_f16, /* FetchTexel2Df */ - fetch_texel_3d_f_rgb_f16, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel1Df */ store_texel_rgb_f16 /* StoreTexel */ }; @@ -523,9 +526,9 @@ const struct gl_texture_format _mesa_texformat_alpha_float32 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ - fetch_texel_1d_f_alpha_f32, /* FetchTexel1Df */ - fetch_texel_2d_f_alpha_f32, /* FetchTexel2Df */ - fetch_texel_3d_f_alpha_f32, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel1Df */ store_texel_alpha_f32 /* StoreTexel */ }; @@ -547,9 +550,9 @@ const struct gl_texture_format _mesa_texformat_alpha_float16 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ - fetch_texel_1d_f_alpha_f16, /* FetchTexel1Df */ - fetch_texel_2d_f_alpha_f16, /* FetchTexel2Df */ - fetch_texel_3d_f_alpha_f16, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel1Df */ store_texel_alpha_f16 /* StoreTexel */ }; @@ -571,9 +574,9 @@ const struct gl_texture_format _mesa_texformat_luminance_float32 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_luminance_f32, /* FetchTexel1Df */ - fetch_texel_2d_f_luminance_f32, /* FetchTexel2Df */ - fetch_texel_3d_f_luminance_f32, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_luminance_f32 /* StoreTexel */ }; @@ -595,9 +598,9 @@ const struct gl_texture_format _mesa_texformat_luminance_float16 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_luminance_f16, /* FetchTexel1Df */ - fetch_texel_2d_f_luminance_f16, /* FetchTexel2Df */ - fetch_texel_3d_f_luminance_f16, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_luminance_f16 /* StoreTexel */ }; @@ -619,9 +622,9 @@ const struct gl_texture_format _mesa_texformat_luminance_alpha_float32 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_luminance_alpha_f32,/* FetchTexel1Df */ - fetch_texel_2d_f_luminance_alpha_f32,/* FetchTexel2Df */ - fetch_texel_3d_f_luminance_alpha_f32,/* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_luminance_alpha_f32 /* StoreTexel */ }; @@ -643,9 +646,9 @@ const struct gl_texture_format _mesa_texformat_luminance_alpha_float16 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_luminance_alpha_f16,/* FetchTexel1Df */ - fetch_texel_2d_f_luminance_alpha_f16,/* FetchTexel2Df */ - fetch_texel_3d_f_luminance_alpha_f16,/* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_luminance_alpha_f16 /* StoreTexel */ }; @@ -667,9 +670,9 @@ const struct gl_texture_format _mesa_texformat_intensity_float32 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_intensity_f32, /* FetchTexel1Df */ - fetch_texel_2d_f_intensity_f32, /* FetchTexel2Df */ - fetch_texel_3d_f_intensity_f32, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_intensity_f32 /* StoreTexel */ }; @@ -691,9 +694,9 @@ const struct gl_texture_format _mesa_texformat_intensity_float16 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_intensity_f16, /* FetchTexel1Df */ - fetch_texel_2d_f_intensity_f16, /* FetchTexel2Df */ - fetch_texel_3d_f_intensity_f16, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_intensity_f16 /* StoreTexel */ }; @@ -717,9 +720,9 @@ const struct gl_texture_format _mesa_texformat_dudv8 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_dudv8, /* FetchTexel1Df */ - fetch_texel_2d_dudv8, /* FetchTexel2Df */ - fetch_texel_3d_dudv8, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ NULL /* StoreTexel */ }; @@ -741,9 +744,9 @@ const struct gl_texture_format _mesa_texformat_signed_rgba8888 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_signed_rgba8888, /* FetchTexel1Df */ - fetch_texel_2d_signed_rgba8888, /* FetchTexel2Df */ - fetch_texel_3d_signed_rgba8888, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_signed_rgba8888 /* StoreTexel */ }; @@ -765,9 +768,9 @@ const struct gl_texture_format _mesa_texformat_signed_rgba8888_rev = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_signed_rgba8888_rev, /* FetchTexel1Df */ - fetch_texel_2d_signed_rgba8888_rev, /* FetchTexel2Df */ - fetch_texel_3d_signed_rgba8888_rev, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_signed_rgba8888_rev /* StoreTexel */ }; @@ -796,9 +799,9 @@ const struct gl_texture_format _mesa_texformat_rgba8888 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_rgba8888, /* FetchTexel1Df */ - fetch_texel_2d_f_rgba8888, /* FetchTexel2Df */ - fetch_texel_3d_f_rgba8888, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_rgba8888 /* StoreTexel */ }; @@ -820,9 +823,9 @@ const struct gl_texture_format _mesa_texformat_rgba8888_rev = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_rgba8888_rev, /* FetchTexel1Df */ - fetch_texel_2d_f_rgba8888_rev, /* FetchTexel2Df */ - fetch_texel_3d_f_rgba8888_rev, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_rgba8888_rev /* StoreTexel */ }; @@ -844,9 +847,9 @@ const struct gl_texture_format _mesa_texformat_argb8888 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_argb8888, /* FetchTexel1Df */ - fetch_texel_2d_f_argb8888, /* FetchTexel2Df */ - fetch_texel_3d_f_argb8888, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_argb8888 /* StoreTexel */ }; @@ -868,9 +871,9 @@ const struct gl_texture_format _mesa_texformat_argb8888_rev = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_argb8888_rev, /* FetchTexel1Df */ - fetch_texel_2d_f_argb8888_rev, /* FetchTexel2Df */ - fetch_texel_3d_f_argb8888_rev, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_argb8888_rev /* StoreTexel */ }; @@ -892,9 +895,9 @@ const struct gl_texture_format _mesa_texformat_rgb888 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_rgb888, /* FetchTexel1Df */ - fetch_texel_2d_f_rgb888, /* FetchTexel2Df */ - fetch_texel_3d_f_rgb888, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_rgb888 /* StoreTexel */ }; @@ -916,9 +919,9 @@ const struct gl_texture_format _mesa_texformat_bgr888 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_bgr888, /* FetchTexel1Df */ - fetch_texel_2d_f_bgr888, /* FetchTexel2Df */ - fetch_texel_3d_f_bgr888, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_bgr888 /* StoreTexel */ }; @@ -940,9 +943,9 @@ const struct gl_texture_format _mesa_texformat_rgb565 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_rgb565, /* FetchTexel1Df */ - fetch_texel_2d_f_rgb565, /* FetchTexel2Df */ - fetch_texel_3d_f_rgb565, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_rgb565 /* StoreTexel */ }; @@ -964,9 +967,9 @@ const struct gl_texture_format _mesa_texformat_rgb565_rev = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_rgb565_rev, /* FetchTexel1Df */ - fetch_texel_2d_f_rgb565_rev, /* FetchTexel2Df */ - fetch_texel_3d_f_rgb565_rev, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_rgb565_rev /* StoreTexel */ }; @@ -988,9 +991,9 @@ const struct gl_texture_format _mesa_texformat_rgba4444 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_rgba4444, /* FetchTexel1Df */ - fetch_texel_2d_f_rgba4444, /* FetchTexel2Df */ - fetch_texel_3d_f_rgba4444, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_rgba4444 /* StoreTexel */ }; @@ -1012,9 +1015,9 @@ const struct gl_texture_format _mesa_texformat_argb4444 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_argb4444, /* FetchTexel1Df */ - fetch_texel_2d_f_argb4444, /* FetchTexel2Df */ - fetch_texel_3d_f_argb4444, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_argb4444 /* StoreTexel */ }; @@ -1036,9 +1039,9 @@ const struct gl_texture_format _mesa_texformat_argb4444_rev = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_argb4444_rev, /* FetchTexel1Df */ - fetch_texel_2d_f_argb4444_rev, /* FetchTexel2Df */ - fetch_texel_3d_f_argb4444_rev, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_argb4444_rev /* StoreTexel */ }; @@ -1060,9 +1063,9 @@ const struct gl_texture_format _mesa_texformat_rgba5551 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_rgba5551, /* FetchTexel1Df */ - fetch_texel_2d_f_rgba5551, /* FetchTexel2Df */ - fetch_texel_3d_f_rgba5551, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_rgba5551 /* StoreTexel */ }; @@ -1084,9 +1087,9 @@ const struct gl_texture_format _mesa_texformat_argb1555 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_argb1555, /* FetchTexel1Df */ - fetch_texel_2d_f_argb1555, /* FetchTexel2Df */ - fetch_texel_3d_f_argb1555, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_argb1555 /* StoreTexel */ }; @@ -1108,9 +1111,9 @@ const struct gl_texture_format _mesa_texformat_argb1555_rev = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_argb1555_rev, /* FetchTexel1Df */ - fetch_texel_2d_f_argb1555_rev, /* FetchTexel2Df */ - fetch_texel_3d_f_argb1555_rev, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_argb1555_rev /* StoreTexel */ }; @@ -1132,9 +1135,9 @@ const struct gl_texture_format _mesa_texformat_al88 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_al88, /* FetchTexel1Df */ - fetch_texel_2d_f_al88, /* FetchTexel2Df */ - fetch_texel_3d_f_al88, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_al88 /* StoreTexel */ }; @@ -1156,9 +1159,9 @@ const struct gl_texture_format _mesa_texformat_al88_rev = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_al88_rev, /* FetchTexel1Df */ - fetch_texel_2d_f_al88_rev, /* FetchTexel2Df */ - fetch_texel_3d_f_al88_rev, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_al88_rev /* StoreTexel */ }; @@ -1180,9 +1183,9 @@ const struct gl_texture_format _mesa_texformat_rgb332 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_rgb332, /* FetchTexel1Df */ - fetch_texel_2d_f_rgb332, /* FetchTexel2Df */ - fetch_texel_3d_f_rgb332, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_rgb332 /* StoreTexel */ }; @@ -1204,9 +1207,9 @@ const struct gl_texture_format _mesa_texformat_a8 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_a8, /* FetchTexel1Df */ - fetch_texel_2d_f_a8, /* FetchTexel2Df */ - fetch_texel_3d_f_a8, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_a8 /* StoreTexel */ }; @@ -1228,9 +1231,9 @@ const struct gl_texture_format _mesa_texformat_l8 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_l8, /* FetchTexel1Df */ - fetch_texel_2d_f_l8, /* FetchTexel2Df */ - fetch_texel_3d_f_l8, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_l8 /* StoreTexel */ }; @@ -1252,9 +1255,9 @@ const struct gl_texture_format _mesa_texformat_i8 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_i8, /* FetchTexel1Df */ - fetch_texel_2d_f_i8, /* FetchTexel2Df */ - fetch_texel_3d_f_i8, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_i8 /* StoreTexel */ }; @@ -1276,9 +1279,9 @@ const struct gl_texture_format _mesa_texformat_ci8 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_ci8, /* FetchTexel1Df */ - fetch_texel_2d_f_ci8, /* FetchTexel2Df */ - fetch_texel_3d_f_ci8, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_ci8 /* StoreTexel */ }; @@ -1300,9 +1303,9 @@ const struct gl_texture_format _mesa_texformat_ycbcr = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_ycbcr, /* FetchTexel1Df */ - fetch_texel_2d_f_ycbcr, /* FetchTexel2Df */ - fetch_texel_3d_f_ycbcr, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_ycbcr /* StoreTexel */ }; @@ -1324,9 +1327,9 @@ const struct gl_texture_format _mesa_texformat_ycbcr_rev = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_ycbcr_rev, /* FetchTexel1Df */ - fetch_texel_2d_f_ycbcr_rev, /* FetchTexel2Df */ - fetch_texel_3d_f_ycbcr_rev, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_ycbcr_rev /* StoreTexel */ }; @@ -1348,9 +1351,9 @@ const struct gl_texture_format _mesa_texformat_z24_s8 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_z24_s8, /* FetchTexel1Df */ - fetch_texel_2d_f_z24_s8, /* FetchTexel2Df */ - fetch_texel_3d_f_z24_s8, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_z24_s8 /* StoreTexel */ }; @@ -1372,9 +1375,9 @@ const struct gl_texture_format _mesa_texformat_s8_z24 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ - fetch_texel_1d_f_s8_z24, /* FetchTexel1Df */ - fetch_texel_2d_f_s8_z24, /* FetchTexel2Df */ - fetch_texel_3d_f_s8_z24, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel2Df */ + NULL, /* FetchTexel3Df */ store_texel_s8_z24 /* StoreTexel */ }; @@ -1396,9 +1399,9 @@ const struct gl_texture_format _mesa_texformat_z16 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ - fetch_texel_1d_f_z16, /* FetchTexel1Df */ - fetch_texel_2d_f_z16, /* FetchTexel2Df */ - fetch_texel_3d_f_z16, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel1Df */ store_texel_z16 /* StoreTexel */ }; @@ -1420,9 +1423,9 @@ const struct gl_texture_format _mesa_texformat_z32 = { NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ - fetch_texel_1d_f_z32, /* FetchTexel1Df */ - fetch_texel_2d_f_z32, /* FetchTexel2Df */ - fetch_texel_3d_f_z32, /* FetchTexel3Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel1Df */ store_texel_z32 /* StoreTexel */ }; @@ -1449,11 +1452,11 @@ const struct gl_texture_format _mesa_null_texformat = { 0, /* TexelBytes */ NULL, /* StoreTexImageFunc */ fetch_null_texel, /* FetchTexel1D */ - fetch_null_texel, /* FetchTexel2D */ - fetch_null_texel, /* FetchTexel3D */ + fetch_null_texel, /* FetchTexel1D */ + fetch_null_texel, /* FetchTexel1D */ + fetch_null_texelf, /* FetchTexel1Df */ + fetch_null_texelf, /* FetchTexel1Df */ fetch_null_texelf, /* FetchTexel1Df */ - fetch_null_texelf, /* FetchTexel2Df */ - fetch_null_texelf, /* FetchTexel3Df */ store_null_texel /* StoreTexel */ }; @@ -1987,3 +1990,496 @@ _mesa_format_to_type_and_comps(const struct gl_texture_format *format, *comps = 1; } } + + + +/** + * Table to map MESA_FORMAT_ to texel fetch/store funcs. + * XXX this is somewhat temporary. + */ +static struct { + GLuint Name; + FetchTexelFuncF Fetch1D; + FetchTexelFuncF Fetch2D; + FetchTexelFuncF Fetch3D; + StoreTexelFunc StoreTexel; +} +texfetch_funcs[MESA_FORMAT_COUNT] = +{ + { + MESA_FORMAT_RGBA, + fetch_texel_1d_f_rgba, + fetch_texel_2d_f_rgba, + fetch_texel_3d_f_rgba, + store_texel_rgba + }, + { + MESA_FORMAT_RGB, + fetch_texel_1d_f_rgb, + fetch_texel_2d_f_rgb, + fetch_texel_3d_f_rgb, + store_texel_rgb + }, + { + MESA_FORMAT_ALPHA, + fetch_texel_1d_f_alpha, + fetch_texel_2d_f_alpha, + fetch_texel_3d_f_alpha, + store_texel_alpha + }, + { + MESA_FORMAT_LUMINANCE, + fetch_texel_1d_f_luminance, + fetch_texel_2d_f_luminance, + fetch_texel_3d_f_luminance, + store_texel_luminance + }, + { + MESA_FORMAT_LUMINANCE_ALPHA, + fetch_texel_1d_f_luminance_alpha, + fetch_texel_2d_f_luminance_alpha, + fetch_texel_3d_f_luminance_alpha, + store_texel_luminance_alpha + }, + { + MESA_FORMAT_INTENSITY, + fetch_texel_1d_f_intensity, + fetch_texel_2d_f_intensity, + fetch_texel_3d_f_intensity, + store_texel_intensity + }, + { + MESA_FORMAT_SRGB8, + fetch_texel_1d_srgb8, + fetch_texel_2d_srgb8, + fetch_texel_3d_srgb8, + store_texel_srgb8 + }, + { + MESA_FORMAT_SRGBA8, + fetch_texel_1d_srgba8, + fetch_texel_2d_srgba8, + fetch_texel_3d_srgba8, + store_texel_srgba8 + }, + { + MESA_FORMAT_SARGB8, + fetch_texel_1d_sargb8, + fetch_texel_2d_sargb8, + fetch_texel_3d_sargb8, + store_texel_sargb8 + }, + { + MESA_FORMAT_SL8, + fetch_texel_1d_sl8, + fetch_texel_2d_sl8, + fetch_texel_3d_sl8, + store_texel_sl8 + }, + { + MESA_FORMAT_SLA8, + fetch_texel_1d_sla8, + fetch_texel_2d_sla8, + fetch_texel_3d_sla8, + store_texel_sla8 + }, + { + MESA_FORMAT_RGB_FXT1, + NULL, + _mesa_fetch_texel_2d_f_rgb_fxt1, + NULL, + NULL + }, + { + MESA_FORMAT_RGBA_FXT1, + NULL, + _mesa_fetch_texel_2d_f_rgba_fxt1, + NULL, + NULL + }, + { + MESA_FORMAT_RGB_DXT1, + NULL, + _mesa_fetch_texel_2d_f_rgb_dxt1, + NULL, + NULL + }, + { + MESA_FORMAT_RGBA_DXT1, + NULL, + _mesa_fetch_texel_2d_f_rgba_dxt1, + NULL, + NULL + }, + { + MESA_FORMAT_RGBA_DXT3, + NULL, + _mesa_fetch_texel_2d_f_rgba_dxt3, + NULL, + NULL + }, + { + MESA_FORMAT_RGBA_DXT5, + NULL, + _mesa_fetch_texel_2d_f_rgba_dxt5, + NULL, + NULL + }, + { + MESA_FORMAT_SRGB_DXT1, + NULL, + _mesa_fetch_texel_2d_f_srgb_dxt1, + NULL, + NULL + }, + { + MESA_FORMAT_SRGBA_DXT1, + NULL, + _mesa_fetch_texel_2d_f_srgba_dxt1, + NULL, + NULL + }, + { + MESA_FORMAT_SRGBA_DXT3, + NULL, + _mesa_fetch_texel_2d_f_srgba_dxt3, + NULL, + NULL + }, + { + MESA_FORMAT_SRGBA_DXT5, + NULL, + _mesa_fetch_texel_2d_f_srgba_dxt5, + NULL, + NULL + }, + { + MESA_FORMAT_RGBA_FLOAT32, + fetch_texel_1d_f_rgba_f32, + fetch_texel_2d_f_rgba_f32, + fetch_texel_3d_f_rgba_f32, + store_texel_rgba_f32 + }, + { + MESA_FORMAT_RGBA_FLOAT16, + fetch_texel_1d_f_rgba_f16, + fetch_texel_2d_f_rgba_f16, + fetch_texel_3d_f_rgba_f16, + store_texel_rgba_f16 + }, + { + MESA_FORMAT_RGB_FLOAT32, + fetch_texel_1d_f_rgb_f32, + fetch_texel_2d_f_rgb_f32, + fetch_texel_3d_f_rgb_f32, + store_texel_rgb_f32 + }, + { + MESA_FORMAT_RGB_FLOAT16, + fetch_texel_1d_f_rgb_f16, + fetch_texel_2d_f_rgb_f16, + fetch_texel_3d_f_rgb_f16, + store_texel_rgb_f16 + }, + { + MESA_FORMAT_ALPHA_FLOAT32, + fetch_texel_1d_f_alpha_f32, + fetch_texel_2d_f_alpha_f32, + fetch_texel_3d_f_alpha_f32, + store_texel_alpha_f32 + }, + { + MESA_FORMAT_ALPHA_FLOAT16, + fetch_texel_1d_f_alpha_f16, + fetch_texel_2d_f_alpha_f16, + fetch_texel_3d_f_alpha_f16, + store_texel_alpha_f16 + }, + { + MESA_FORMAT_LUMINANCE_FLOAT32, + fetch_texel_1d_f_luminance_f32, + fetch_texel_2d_f_luminance_f32, + fetch_texel_3d_f_luminance_f32, + store_texel_luminance_f32 + }, + { + MESA_FORMAT_LUMINANCE_FLOAT16, + fetch_texel_1d_f_luminance_f16, + fetch_texel_2d_f_luminance_f16, + fetch_texel_3d_f_luminance_f16, + store_texel_luminance_f16 + }, + { + MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32, + fetch_texel_1d_f_luminance_alpha_f32, + fetch_texel_2d_f_luminance_alpha_f32, + fetch_texel_3d_f_luminance_alpha_f32, + store_texel_luminance_alpha_f32 + }, + { + MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16, + fetch_texel_1d_f_luminance_alpha_f16, + fetch_texel_2d_f_luminance_alpha_f16, + fetch_texel_3d_f_luminance_alpha_f16, + store_texel_luminance_alpha_f16 + }, + { + MESA_FORMAT_INTENSITY_FLOAT32, + fetch_texel_1d_f_intensity_f32, + fetch_texel_2d_f_intensity_f32, + fetch_texel_3d_f_intensity_f32, + store_texel_intensity_f32 + }, + { + MESA_FORMAT_INTENSITY_FLOAT16, + fetch_texel_1d_f_intensity_f16, + fetch_texel_2d_f_intensity_f16, + fetch_texel_3d_f_intensity_f16, + store_texel_intensity_f16 + }, + { + MESA_FORMAT_DUDV8, + fetch_texel_1d_dudv8, + fetch_texel_2d_dudv8, + fetch_texel_3d_dudv8, + NULL + }, + { + MESA_FORMAT_SIGNED_RGBA8888, + fetch_texel_1d_signed_rgba8888, + fetch_texel_2d_signed_rgba8888, + fetch_texel_3d_signed_rgba8888, + store_texel_signed_rgba8888 + }, + { + MESA_FORMAT_SIGNED_RGBA8888_REV, + fetch_texel_1d_signed_rgba8888_rev, + fetch_texel_2d_signed_rgba8888_rev, + fetch_texel_3d_signed_rgba8888_rev, + store_texel_signed_rgba8888_rev + }, + { + MESA_FORMAT_RGBA8888, + fetch_texel_1d_f_rgba8888, + fetch_texel_2d_f_rgba8888, + fetch_texel_3d_f_rgba8888, + store_texel_rgba8888 + }, + { + MESA_FORMAT_RGBA8888_REV, + fetch_texel_1d_f_rgba8888_rev, + fetch_texel_2d_f_rgba8888_rev, + fetch_texel_3d_f_rgba8888_rev, + store_texel_rgba8888_rev + }, + { + MESA_FORMAT_ARGB8888, + fetch_texel_1d_f_argb8888, + fetch_texel_2d_f_argb8888, + fetch_texel_3d_f_argb8888, + store_texel_argb8888 + }, + { + MESA_FORMAT_ARGB8888_REV, + fetch_texel_1d_f_argb8888_rev, + fetch_texel_2d_f_argb8888_rev, + fetch_texel_3d_f_argb8888_rev, + store_texel_argb8888_rev + }, + { + MESA_FORMAT_RGB888, + fetch_texel_1d_f_rgb888, + fetch_texel_2d_f_rgb888, + fetch_texel_3d_f_rgb888, + store_texel_rgb888 + }, + { + MESA_FORMAT_BGR888, + fetch_texel_1d_f_bgr888, + fetch_texel_2d_f_bgr888, + fetch_texel_3d_f_bgr888, + store_texel_bgr888 + }, + { + MESA_FORMAT_RGB565, + fetch_texel_1d_f_rgb565, + fetch_texel_2d_f_rgb565, + fetch_texel_3d_f_rgb565, + store_texel_rgb565 + }, + { + MESA_FORMAT_RGB565_REV, + fetch_texel_1d_f_rgb565_rev, + fetch_texel_2d_f_rgb565_rev, + fetch_texel_3d_f_rgb565_rev, + store_texel_rgb565_rev + }, + { + MESA_FORMAT_RGBA4444, + fetch_texel_1d_f_rgba4444, + fetch_texel_2d_f_rgba4444, + fetch_texel_3d_f_rgba4444, + store_texel_rgba4444 + }, + { + MESA_FORMAT_ARGB4444, + fetch_texel_1d_f_argb4444, + fetch_texel_2d_f_argb4444, + fetch_texel_3d_f_argb4444, + store_texel_argb4444 + }, + { + MESA_FORMAT_ARGB4444_REV, + fetch_texel_1d_f_argb4444_rev, + fetch_texel_2d_f_argb4444_rev, + fetch_texel_3d_f_argb4444_rev, + store_texel_argb4444_rev + }, + { + MESA_FORMAT_RGBA5551, + fetch_texel_1d_f_rgba5551, + fetch_texel_2d_f_rgba5551, + fetch_texel_3d_f_rgba5551, + store_texel_rgba5551 + }, + { + MESA_FORMAT_ARGB1555, + fetch_texel_1d_f_argb1555, + fetch_texel_2d_f_argb1555, + fetch_texel_3d_f_argb1555, + store_texel_argb1555 + }, + { + MESA_FORMAT_ARGB1555_REV, + fetch_texel_1d_f_argb1555_rev, + fetch_texel_2d_f_argb1555_rev, + fetch_texel_3d_f_argb1555_rev, + store_texel_argb1555_rev + }, + { + MESA_FORMAT_AL88, + fetch_texel_1d_f_al88, + fetch_texel_2d_f_al88, + fetch_texel_3d_f_al88, + store_texel_al88 + }, + { + MESA_FORMAT_AL88_REV, + fetch_texel_1d_f_al88_rev, + fetch_texel_2d_f_al88_rev, + fetch_texel_3d_f_al88_rev, + store_texel_al88_rev + }, + { + MESA_FORMAT_RGB332, + fetch_texel_1d_f_rgb332, + fetch_texel_2d_f_rgb332, + fetch_texel_3d_f_rgb332, + store_texel_rgb332 + }, + { + MESA_FORMAT_A8, + fetch_texel_1d_f_a8, + fetch_texel_2d_f_a8, + fetch_texel_3d_f_a8, + store_texel_a8 + }, + { + MESA_FORMAT_L8, + fetch_texel_1d_f_l8, + fetch_texel_2d_f_l8, + fetch_texel_3d_f_l8, + store_texel_l8 + }, + { + MESA_FORMAT_I8, + fetch_texel_1d_f_i8, + fetch_texel_2d_f_i8, + fetch_texel_3d_f_i8, + store_texel_i8 + }, + { + MESA_FORMAT_CI8, + fetch_texel_1d_f_ci8, + fetch_texel_2d_f_ci8, + fetch_texel_3d_f_ci8, + store_texel_ci8 + }, + { + MESA_FORMAT_YCBCR, + fetch_texel_1d_f_ycbcr, + fetch_texel_2d_f_ycbcr, + fetch_texel_3d_f_ycbcr, + store_texel_ycbcr + }, + { + MESA_FORMAT_YCBCR_REV, + fetch_texel_1d_f_ycbcr_rev, + fetch_texel_2d_f_ycbcr_rev, + fetch_texel_3d_f_ycbcr_rev, + store_texel_ycbcr_rev + }, + { + MESA_FORMAT_Z24_S8, + fetch_texel_1d_f_z24_s8, + fetch_texel_2d_f_z24_s8, + fetch_texel_3d_f_z24_s8, + store_texel_z24_s8 + }, + { + MESA_FORMAT_S8_Z24, + fetch_texel_1d_f_s8_z24, + fetch_texel_2d_f_s8_z24, + fetch_texel_3d_f_s8_z24, + store_texel_s8_z24 + }, + { + MESA_FORMAT_Z16, + fetch_texel_1d_f_z16, + fetch_texel_2d_f_z16, + fetch_texel_3d_f_z16, + store_texel_z16 + }, + { + MESA_FORMAT_Z32, + fetch_texel_1d_f_z32, + fetch_texel_2d_f_z32, + fetch_texel_3d_f_z32, + store_texel_z32 + } +}; + + +FetchTexelFuncF +_mesa_get_texel_fetch_func(GLuint format, GLuint dims) +{ + GLuint i; + /* XXX replace loop with direct table lookup */ + for (i = 0; i < MESA_FORMAT_COUNT; i++) { + if (texfetch_funcs[i].Name == format) { + switch (dims) { + case 1: + return texfetch_funcs[i].Fetch1D; + case 2: + return texfetch_funcs[i].Fetch2D; + case 3: + return texfetch_funcs[i].Fetch3D; + } + } + } + return NULL; +} + + +StoreTexelFunc +_mesa_get_texel_store_func(GLuint format) +{ + GLuint i; + /* XXX replace loop with direct table lookup */ + for (i = 0; i < MESA_FORMAT_COUNT; i++) { + if (texfetch_funcs[i].Name == format) { + return texfetch_funcs[i].StoreTexel; + } + } + return NULL; +} diff --git a/src/mesa/main/texformat.h b/src/mesa/main/texformat.h index b860a10d86..39d5ec640a 100644 --- a/src/mesa/main/texformat.h +++ b/src/mesa/main/texformat.h @@ -154,5 +154,11 @@ extern void _mesa_format_to_type_and_comps(const struct gl_texture_format *format, GLenum *datatype, GLuint *comps); +extern FetchTexelFuncF +_mesa_get_texel_fetch_func(GLuint format, GLuint dims); + +extern StoreTexelFunc +_mesa_get_texel_store_func(GLuint format); + #endif diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index f4df71d769..33edf8a56a 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -62,6 +62,8 @@ #include "mipmap.h" #include "imports.h" #include "texcompress.h" +#include "texcompress_fxt1.h" +#include "texcompress_s3tc.h" #include "texformat.h" #include "teximage.h" #include "texstore.h" @@ -3227,6 +3229,8 @@ texstore_funcs[MESA_FORMAT_COUNT] = { MESA_FORMAT_CI8, _mesa_texstore_ci8 }, { MESA_FORMAT_YCBCR, _mesa_texstore_ycbcr }, { MESA_FORMAT_YCBCR_REV, _mesa_texstore_ycbcr }, + { MESA_FORMAT_RGB_FXT1, _mesa_texstore_rgb_fxt1 }, + { MESA_FORMAT_RGBA_FXT1, _mesa_texstore_rgba_fxt1 }, { MESA_FORMAT_Z24_S8, _mesa_texstore_z24_s8 }, { MESA_FORMAT_S8_Z24, _mesa_texstore_s8_z24 }, { MESA_FORMAT_Z16, _mesa_texstore_z16 }, @@ -3399,22 +3403,8 @@ _mesa_set_fetch_functions(struct gl_texture_image *texImage, GLuint dims) ASSERT(dims == 1 || dims == 2 || dims == 3); ASSERT(texImage->TexFormat); - switch (dims) { - case 1: - texImage->FetchTexelc = texImage->TexFormat->FetchTexel1D; - texImage->FetchTexelf = texImage->TexFormat->FetchTexel1Df; - break; - case 2: - texImage->FetchTexelc = texImage->TexFormat->FetchTexel2D; - texImage->FetchTexelf = texImage->TexFormat->FetchTexel2Df; - break; - case 3: - texImage->FetchTexelc = texImage->TexFormat->FetchTexel3D; - texImage->FetchTexelf = texImage->TexFormat->FetchTexel3Df; - break; - default: - ; - } + texImage->FetchTexelf = + _mesa_get_texel_fetch_func(texImage->TexFormat->MesaFormat, dims); /* now check if we need to use a float/chan adaptor */ if (!texImage->FetchTexelc) { -- cgit v1.2.3 From 431ba64222ad5365dfcdac1f06d80f0e7a26dbfd Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 18:17:32 -0600 Subject: mesa: use _mesa_get_texel_store_func() --- src/mesa/main/texformat.c | 104 +++++++++++++++++++++++----------------------- src/mesa/main/texrender.c | 2 +- 2 files changed, 53 insertions(+), 53 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index b6c0a252d3..85a7fe6e2c 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -163,7 +163,7 @@ const struct gl_texture_format _mesa_texformat_rgba = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_rgba /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgb = { @@ -187,7 +187,7 @@ const struct gl_texture_format _mesa_texformat_rgb = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_rgb /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_alpha = { @@ -211,7 +211,7 @@ const struct gl_texture_format _mesa_texformat_alpha = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_alpha /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_luminance = { @@ -235,7 +235,7 @@ const struct gl_texture_format _mesa_texformat_luminance = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_luminance /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_luminance_alpha = { @@ -259,7 +259,7 @@ const struct gl_texture_format _mesa_texformat_luminance_alpha = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_luminance_alpha /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_intensity = { @@ -283,7 +283,7 @@ const struct gl_texture_format _mesa_texformat_intensity = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_intensity /* StoreTexel */ + NULL /* StoreTexel */ }; @@ -310,7 +310,7 @@ const struct gl_texture_format _mesa_texformat_srgb8 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_srgb8 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_srgba8 = { @@ -334,7 +334,7 @@ const struct gl_texture_format _mesa_texformat_srgba8 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_srgba8 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_sargb8 = { @@ -358,7 +358,7 @@ const struct gl_texture_format _mesa_texformat_sargb8 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_sargb8 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_sl8 = { @@ -382,7 +382,7 @@ const struct gl_texture_format _mesa_texformat_sl8 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_sl8 /* StoreTexel */ + NULL /* StoreTexel */ }; /* Note: this format name looks like a misnomer, make it sal8? */ @@ -407,7 +407,7 @@ const struct gl_texture_format _mesa_texformat_sla8 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_sla8 /* StoreTexel */ + NULL /* StoreTexel */ }; #endif /* FEATURE_EXT_texture_sRGB */ @@ -433,7 +433,7 @@ const struct gl_texture_format _mesa_texformat_rgba_float32 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel1Df */ NULL, /* FetchTexel1Df */ - store_texel_rgba_f32 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgba_float16 = { @@ -457,7 +457,7 @@ const struct gl_texture_format _mesa_texformat_rgba_float16 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel1Df */ NULL, /* FetchTexel1Df */ - store_texel_rgba_f16 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgb_float32 = { @@ -481,7 +481,7 @@ const struct gl_texture_format _mesa_texformat_rgb_float32 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel1Df */ NULL, /* FetchTexel1Df */ - store_texel_rgb_f32 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgb_float16 = { @@ -505,7 +505,7 @@ const struct gl_texture_format _mesa_texformat_rgb_float16 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel1Df */ NULL, /* FetchTexel1Df */ - store_texel_rgb_f16 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_alpha_float32 = { @@ -529,7 +529,7 @@ const struct gl_texture_format _mesa_texformat_alpha_float32 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel1Df */ NULL, /* FetchTexel1Df */ - store_texel_alpha_f32 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_alpha_float16 = { @@ -553,7 +553,7 @@ const struct gl_texture_format _mesa_texformat_alpha_float16 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel1Df */ NULL, /* FetchTexel1Df */ - store_texel_alpha_f16 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_luminance_float32 = { @@ -577,7 +577,7 @@ const struct gl_texture_format _mesa_texformat_luminance_float32 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_luminance_f32 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_luminance_float16 = { @@ -601,7 +601,7 @@ const struct gl_texture_format _mesa_texformat_luminance_float16 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_luminance_f16 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_luminance_alpha_float32 = { @@ -625,7 +625,7 @@ const struct gl_texture_format _mesa_texformat_luminance_alpha_float32 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_luminance_alpha_f32 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_luminance_alpha_float16 = { @@ -649,7 +649,7 @@ const struct gl_texture_format _mesa_texformat_luminance_alpha_float16 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_luminance_alpha_f16 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_intensity_float32 = { @@ -673,7 +673,7 @@ const struct gl_texture_format _mesa_texformat_intensity_float32 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_intensity_f32 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_intensity_float16 = { @@ -697,7 +697,7 @@ const struct gl_texture_format _mesa_texformat_intensity_float16 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_intensity_f16 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_dudv8 = { @@ -747,7 +747,7 @@ const struct gl_texture_format _mesa_texformat_signed_rgba8888 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_signed_rgba8888 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_signed_rgba8888_rev = { @@ -771,7 +771,7 @@ const struct gl_texture_format _mesa_texformat_signed_rgba8888_rev = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_signed_rgba8888_rev /* StoreTexel */ + NULL /* StoreTexel */ }; /*@}*/ @@ -802,7 +802,7 @@ const struct gl_texture_format _mesa_texformat_rgba8888 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_rgba8888 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgba8888_rev = { @@ -826,7 +826,7 @@ const struct gl_texture_format _mesa_texformat_rgba8888_rev = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_rgba8888_rev /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_argb8888 = { @@ -850,7 +850,7 @@ const struct gl_texture_format _mesa_texformat_argb8888 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_argb8888 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_argb8888_rev = { @@ -874,7 +874,7 @@ const struct gl_texture_format _mesa_texformat_argb8888_rev = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_argb8888_rev /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgb888 = { @@ -898,7 +898,7 @@ const struct gl_texture_format _mesa_texformat_rgb888 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_rgb888 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_bgr888 = { @@ -922,7 +922,7 @@ const struct gl_texture_format _mesa_texformat_bgr888 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_bgr888 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgb565 = { @@ -946,7 +946,7 @@ const struct gl_texture_format _mesa_texformat_rgb565 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_rgb565 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgb565_rev = { @@ -970,7 +970,7 @@ const struct gl_texture_format _mesa_texformat_rgb565_rev = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_rgb565_rev /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgba4444 = { @@ -994,7 +994,7 @@ const struct gl_texture_format _mesa_texformat_rgba4444 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_rgba4444 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_argb4444 = { @@ -1018,7 +1018,7 @@ const struct gl_texture_format _mesa_texformat_argb4444 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_argb4444 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_argb4444_rev = { @@ -1042,7 +1042,7 @@ const struct gl_texture_format _mesa_texformat_argb4444_rev = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_argb4444_rev /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgba5551 = { @@ -1066,7 +1066,7 @@ const struct gl_texture_format _mesa_texformat_rgba5551 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_rgba5551 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_argb1555 = { @@ -1090,7 +1090,7 @@ const struct gl_texture_format _mesa_texformat_argb1555 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_argb1555 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_argb1555_rev = { @@ -1114,7 +1114,7 @@ const struct gl_texture_format _mesa_texformat_argb1555_rev = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_argb1555_rev /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_al88 = { @@ -1138,7 +1138,7 @@ const struct gl_texture_format _mesa_texformat_al88 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_al88 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_al88_rev = { @@ -1162,7 +1162,7 @@ const struct gl_texture_format _mesa_texformat_al88_rev = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_al88_rev /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgb332 = { @@ -1186,7 +1186,7 @@ const struct gl_texture_format _mesa_texformat_rgb332 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_rgb332 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_a8 = { @@ -1210,7 +1210,7 @@ const struct gl_texture_format _mesa_texformat_a8 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_a8 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_l8 = { @@ -1234,7 +1234,7 @@ const struct gl_texture_format _mesa_texformat_l8 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_l8 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_i8 = { @@ -1258,7 +1258,7 @@ const struct gl_texture_format _mesa_texformat_i8 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_i8 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_ci8 = { @@ -1282,7 +1282,7 @@ const struct gl_texture_format _mesa_texformat_ci8 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_ci8 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_ycbcr = { @@ -1306,7 +1306,7 @@ const struct gl_texture_format _mesa_texformat_ycbcr = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_ycbcr /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_ycbcr_rev = { @@ -1330,7 +1330,7 @@ const struct gl_texture_format _mesa_texformat_ycbcr_rev = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_ycbcr_rev /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_z24_s8 = { @@ -1354,7 +1354,7 @@ const struct gl_texture_format _mesa_texformat_z24_s8 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_z24_s8 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_s8_z24 = { @@ -1378,7 +1378,7 @@ const struct gl_texture_format _mesa_texformat_s8_z24 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel2Df */ NULL, /* FetchTexel3Df */ - store_texel_s8_z24 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_z16 = { @@ -1402,7 +1402,7 @@ const struct gl_texture_format _mesa_texformat_z16 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel1Df */ NULL, /* FetchTexel1Df */ - store_texel_z16 /* StoreTexel */ + NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_z32 = { @@ -1426,7 +1426,7 @@ const struct gl_texture_format _mesa_texformat_z32 = { NULL, /* FetchTexel1Df */ NULL, /* FetchTexel1Df */ NULL, /* FetchTexel1Df */ - store_texel_z32 /* StoreTexel */ + NULL /* StoreTexel */ }; /*@}*/ diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c index 53be83b05c..50e09c5d15 100644 --- a/src/mesa/main/texrender.c +++ b/src/mesa/main/texrender.c @@ -469,7 +469,7 @@ update_wrapper(GLcontext *ctx, const struct gl_renderbuffer_attachment *att) trb->TexImage = att->Texture->Image[att->CubeMapFace][att->TextureLevel]; ASSERT(trb->TexImage); - trb->Store = trb->TexImage->TexFormat->StoreTexel; + trb->Store = _mesa_get_texel_store_func(trb->TexImage->TexFormat->MesaFormat); if (!trb->Store) { /* we'll never draw into some textures (compressed formats) */ trb->Store = store_nop; -- cgit v1.2.3 From 8abb984dc93235e00b5006187bf177da5db257e1 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 18:19:24 -0600 Subject: mesa: null-out StoreTexImageFunc fields --- src/mesa/main/texformat.c | 106 +++++++++++++++++++++++----------------------- 1 file changed, 53 insertions(+), 53 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index 85a7fe6e2c..2169d294c6 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -156,7 +156,7 @@ const struct gl_texture_format _mesa_texformat_rgba = { 0, /* DepthBits */ 0, /* StencilBits */ 4 * sizeof(GLchan), /* TexelBytes */ - _mesa_texstore_rgba, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -180,7 +180,7 @@ const struct gl_texture_format _mesa_texformat_rgb = { 0, /* DepthBits */ 0, /* StencilBits */ 3 * sizeof(GLchan), /* TexelBytes */ - _mesa_texstore_rgba,/*yes*/ /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -204,7 +204,7 @@ const struct gl_texture_format _mesa_texformat_alpha = { 0, /* DepthBits */ 0, /* StencilBits */ sizeof(GLchan), /* TexelBytes */ - _mesa_texstore_rgba,/*yes*/ /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -228,7 +228,7 @@ const struct gl_texture_format _mesa_texformat_luminance = { 0, /* DepthBits */ 0, /* StencilBits */ sizeof(GLchan), /* TexelBytes */ - _mesa_texstore_rgba,/*yes*/ /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -252,7 +252,7 @@ const struct gl_texture_format _mesa_texformat_luminance_alpha = { 0, /* DepthBits */ 0, /* StencilBits */ 2 * sizeof(GLchan), /* TexelBytes */ - _mesa_texstore_rgba,/*yes*/ /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -276,7 +276,7 @@ const struct gl_texture_format _mesa_texformat_intensity = { 0, /* DepthBits */ 0, /* StencilBits */ sizeof(GLchan), /* TexelBytes */ - _mesa_texstore_rgba,/*yes*/ /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -303,7 +303,7 @@ const struct gl_texture_format _mesa_texformat_srgb8 = { 0, /* DepthBits */ 0, /* StencilBits */ 3, /* TexelBytes */ - _mesa_texstore_srgb8, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -327,7 +327,7 @@ const struct gl_texture_format _mesa_texformat_srgba8 = { 0, /* DepthBits */ 0, /* StencilBits */ 4, /* TexelBytes */ - _mesa_texstore_srgba8, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -351,7 +351,7 @@ const struct gl_texture_format _mesa_texformat_sargb8 = { 0, /* DepthBits */ 0, /* StencilBits */ 4, /* TexelBytes */ - _mesa_texstore_sargb8, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -375,7 +375,7 @@ const struct gl_texture_format _mesa_texformat_sl8 = { 0, /* DepthBits */ 0, /* StencilBits */ 1, /* TexelBytes */ - _mesa_texstore_sl8, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -400,7 +400,7 @@ const struct gl_texture_format _mesa_texformat_sla8 = { 0, /* DepthBits */ 0, /* StencilBits */ 2, /* TexelBytes */ - _mesa_texstore_sla8, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -426,7 +426,7 @@ const struct gl_texture_format _mesa_texformat_rgba_float32 = { 0, /* DepthBits */ 0, /* StencilBits */ 4 * sizeof(GLfloat), /* TexelBytes */ - _mesa_texstore_rgba_float32, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ @@ -450,7 +450,7 @@ const struct gl_texture_format _mesa_texformat_rgba_float16 = { 0, /* DepthBits */ 0, /* StencilBits */ 4 * sizeof(GLhalfARB), /* TexelBytes */ - _mesa_texstore_rgba_float16, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ @@ -474,7 +474,7 @@ const struct gl_texture_format _mesa_texformat_rgb_float32 = { 0, /* DepthBits */ 0, /* StencilBits */ 3 * sizeof(GLfloat), /* TexelBytes */ - _mesa_texstore_rgba_float32,/*yes*/ /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ @@ -498,7 +498,7 @@ const struct gl_texture_format _mesa_texformat_rgb_float16 = { 0, /* DepthBits */ 0, /* StencilBits */ 3 * sizeof(GLhalfARB), /* TexelBytes */ - _mesa_texstore_rgba_float16,/*yes*/ /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ @@ -522,7 +522,7 @@ const struct gl_texture_format _mesa_texformat_alpha_float32 = { 0, /* DepthBits */ 0, /* StencilBits */ 1 * sizeof(GLfloat), /* TexelBytes */ - _mesa_texstore_rgba_float32,/*yes*/ /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ @@ -546,7 +546,7 @@ const struct gl_texture_format _mesa_texformat_alpha_float16 = { 0, /* DepthBits */ 0, /* StencilBits */ 1 * sizeof(GLhalfARB), /* TexelBytes */ - _mesa_texstore_rgba_float16,/*yes*/ /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ @@ -570,7 +570,7 @@ const struct gl_texture_format _mesa_texformat_luminance_float32 = { 0, /* DepthBits */ 0, /* StencilBits */ 1 * sizeof(GLfloat), /* TexelBytes */ - _mesa_texstore_rgba_float32,/*yes*/ /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -594,7 +594,7 @@ const struct gl_texture_format _mesa_texformat_luminance_float16 = { 0, /* DepthBits */ 0, /* StencilBits */ 1 * sizeof(GLhalfARB), /* TexelBytes */ - _mesa_texstore_rgba_float16,/*yes*/ /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -618,7 +618,7 @@ const struct gl_texture_format _mesa_texformat_luminance_alpha_float32 = { 0, /* DepthBits */ 0, /* StencilBits */ 2 * sizeof(GLfloat), /* TexelBytes */ - _mesa_texstore_rgba_float32, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -642,7 +642,7 @@ const struct gl_texture_format _mesa_texformat_luminance_alpha_float16 = { 0, /* DepthBits */ 0, /* StencilBits */ 2 * sizeof(GLhalfARB), /* TexelBytes */ - _mesa_texstore_rgba_float16, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -666,7 +666,7 @@ const struct gl_texture_format _mesa_texformat_intensity_float32 = { 0, /* DepthBits */ 0, /* StencilBits */ 1 * sizeof(GLfloat), /* TexelBytes */ - _mesa_texstore_rgba_float32,/*yes*/ /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -690,7 +690,7 @@ const struct gl_texture_format _mesa_texformat_intensity_float16 = { 0, /* DepthBits */ 0, /* StencilBits */ 1 * sizeof(GLhalfARB), /* TexelBytes */ - _mesa_texstore_rgba_float16,/*yes*/ /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -716,7 +716,7 @@ const struct gl_texture_format _mesa_texformat_dudv8 = { 0, /* DepthBits */ 0, /* StencilBits */ 2, /* TexelBytes */ - _mesa_texstore_dudv8, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -740,7 +740,7 @@ const struct gl_texture_format _mesa_texformat_signed_rgba8888 = { 0, /* DepthBits */ 0, /* StencilBits */ 4, /* TexelBytes */ - _mesa_texstore_signed_rgba8888, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -764,7 +764,7 @@ const struct gl_texture_format _mesa_texformat_signed_rgba8888_rev = { 0, /* DepthBits */ 0, /* StencilBits */ 4, /* TexelBytes */ - _mesa_texstore_signed_rgba8888, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -795,7 +795,7 @@ const struct gl_texture_format _mesa_texformat_rgba8888 = { 0, /* DepthBits */ 0, /* StencilBits */ 4, /* TexelBytes */ - _mesa_texstore_rgba8888, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -819,7 +819,7 @@ const struct gl_texture_format _mesa_texformat_rgba8888_rev = { 0, /* DepthBits */ 0, /* StencilBits */ 4, /* TexelBytes */ - _mesa_texstore_rgba8888, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -843,7 +843,7 @@ const struct gl_texture_format _mesa_texformat_argb8888 = { 0, /* DepthBits */ 0, /* StencilBits */ 4, /* TexelBytes */ - _mesa_texstore_argb8888, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -867,7 +867,7 @@ const struct gl_texture_format _mesa_texformat_argb8888_rev = { 0, /* DepthBits */ 0, /* StencilBits */ 4, /* TexelBytes */ - _mesa_texstore_argb8888, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -891,7 +891,7 @@ const struct gl_texture_format _mesa_texformat_rgb888 = { 0, /* DepthBits */ 0, /* StencilBits */ 3, /* TexelBytes */ - _mesa_texstore_rgb888, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -915,7 +915,7 @@ const struct gl_texture_format _mesa_texformat_bgr888 = { 0, /* DepthBits */ 0, /* StencilBits */ 3, /* TexelBytes */ - _mesa_texstore_bgr888, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -939,7 +939,7 @@ const struct gl_texture_format _mesa_texformat_rgb565 = { 0, /* DepthBits */ 0, /* StencilBits */ 2, /* TexelBytes */ - _mesa_texstore_rgb565, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -963,7 +963,7 @@ const struct gl_texture_format _mesa_texformat_rgb565_rev = { 0, /* DepthBits */ 0, /* StencilBits */ 2, /* TexelBytes */ - _mesa_texstore_rgb565, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -987,7 +987,7 @@ const struct gl_texture_format _mesa_texformat_rgba4444 = { 0, /* DepthBits */ 0, /* StencilBits */ 2, /* TexelBytes */ - _mesa_texstore_rgba4444, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -1011,7 +1011,7 @@ const struct gl_texture_format _mesa_texformat_argb4444 = { 0, /* DepthBits */ 0, /* StencilBits */ 2, /* TexelBytes */ - _mesa_texstore_argb4444, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -1035,7 +1035,7 @@ const struct gl_texture_format _mesa_texformat_argb4444_rev = { 0, /* DepthBits */ 0, /* StencilBits */ 2, /* TexelBytes */ - _mesa_texstore_argb4444, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -1059,7 +1059,7 @@ const struct gl_texture_format _mesa_texformat_rgba5551 = { 0, /* DepthBits */ 0, /* StencilBits */ 2, /* TexelBytes */ - _mesa_texstore_rgba5551, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -1083,7 +1083,7 @@ const struct gl_texture_format _mesa_texformat_argb1555 = { 0, /* DepthBits */ 0, /* StencilBits */ 2, /* TexelBytes */ - _mesa_texstore_argb1555, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -1107,7 +1107,7 @@ const struct gl_texture_format _mesa_texformat_argb1555_rev = { 0, /* DepthBits */ 0, /* StencilBits */ 2, /* TexelBytes */ - _mesa_texstore_argb1555, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -1131,7 +1131,7 @@ const struct gl_texture_format _mesa_texformat_al88 = { 0, /* DepthBits */ 0, /* StencilBits */ 2, /* TexelBytes */ - _mesa_texstore_al88, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -1155,7 +1155,7 @@ const struct gl_texture_format _mesa_texformat_al88_rev = { 0, /* DepthBits */ 0, /* StencilBits */ 2, /* TexelBytes */ - _mesa_texstore_al88, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -1179,7 +1179,7 @@ const struct gl_texture_format _mesa_texformat_rgb332 = { 0, /* DepthBits */ 0, /* StencilBits */ 1, /* TexelBytes */ - _mesa_texstore_rgb332, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -1203,7 +1203,7 @@ const struct gl_texture_format _mesa_texformat_a8 = { 0, /* DepthBits */ 0, /* StencilBits */ 1, /* TexelBytes */ - _mesa_texstore_a8, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -1227,7 +1227,7 @@ const struct gl_texture_format _mesa_texformat_l8 = { 0, /* DepthBits */ 0, /* StencilBits */ 1, /* TexelBytes */ - _mesa_texstore_a8,/*yes*/ /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -1251,7 +1251,7 @@ const struct gl_texture_format _mesa_texformat_i8 = { 0, /* DepthBits */ 0, /* StencilBits */ 1, /* TexelBytes */ - _mesa_texstore_a8,/*yes*/ /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -1275,7 +1275,7 @@ const struct gl_texture_format _mesa_texformat_ci8 = { 0, /* DepthBits */ 0, /* StencilBits */ 1, /* TexelBytes */ - _mesa_texstore_ci8, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -1299,7 +1299,7 @@ const struct gl_texture_format _mesa_texformat_ycbcr = { 0, /* DepthBits */ 0, /* StencilBits */ 2, /* TexelBytes */ - _mesa_texstore_ycbcr, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -1323,7 +1323,7 @@ const struct gl_texture_format _mesa_texformat_ycbcr_rev = { 0, /* DepthBits */ 0, /* StencilBits */ 2, /* TexelBytes */ - _mesa_texstore_ycbcr, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -1347,7 +1347,7 @@ const struct gl_texture_format _mesa_texformat_z24_s8 = { 24, /* DepthBits */ 8, /* StencilBits */ 4, /* TexelBytes */ - _mesa_texstore_z24_s8, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -1371,7 +1371,7 @@ const struct gl_texture_format _mesa_texformat_s8_z24 = { 24, /* DepthBits */ 8, /* StencilBits */ 4, /* TexelBytes */ - _mesa_texstore_s8_z24, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /* FetchTexel3D */ @@ -1395,7 +1395,7 @@ const struct gl_texture_format _mesa_texformat_z16 = { sizeof(GLushort) * 8, /* DepthBits */ 0, /* StencilBits */ sizeof(GLushort), /* TexelBytes */ - _mesa_texstore_z16, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ @@ -1419,7 +1419,7 @@ const struct gl_texture_format _mesa_texformat_z32 = { sizeof(GLuint) * 8, /* DepthBits */ 0, /* StencilBits */ sizeof(GLuint), /* TexelBytes */ - _mesa_texstore_z32, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ NULL, /* FetchTexel1D */ -- cgit v1.2.3 From e07862d2c949bcae7c71e9fc8e90e4694ed25bb3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 18:27:59 -0600 Subject: st/mesa: use _mesa_get_texstore_func() --- src/mesa/state_tracker/st_cb_drawpixels.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 99f3ba678b..c56f987628 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -35,6 +35,7 @@ #include "main/bufferobj.h" #include "main/macros.h" #include "main/texformat.h" +#include "main/texstore.h" #include "main/state.h" #include "shader/program.h" #include "shader/prog_parameter.h" @@ -391,6 +392,8 @@ make_texture(struct st_context *st, GLboolean success; GLubyte *dest; const GLbitfield imageTransferStateSave = ctx->_ImageTransferState; + const StoreTexImageFunc storeImage = + _mesa_get_texstore_func(mformat->MesaFormat); /* we'll do pixel transfer in a fragment shader */ ctx->_ImageTransferState = 0x0; @@ -402,21 +405,22 @@ make_texture(struct st_context *st, /* map texture transfer */ dest = screen->transfer_map(screen, transfer); + /* Put image into texture transfer. * Note that the image is actually going to be upside down in * the texture. We deal with that with texcoords. */ - success = mformat->StoreImage(ctx, 2, /* dims */ - baseFormat, /* baseInternalFormat */ - mformat, /* gl_texture_format */ - dest, /* dest */ - 0, 0, 0, /* dstX/Y/Zoffset */ - transfer->stride, /* dstRowStride, bytes */ - &dstImageOffsets, /* dstImageOffsets */ - width, height, 1, /* size */ - format, type, /* src format/type */ - pixels, /* data source */ - unpack); + success = storeImage(ctx, 2, /* dims */ + baseFormat, /* baseInternalFormat */ + mformat, /* gl_texture_format */ + dest, /* dest */ + 0, 0, 0, /* dstX/Y/Zoffset */ + transfer->stride, /* dstRowStride, bytes */ + &dstImageOffsets, /* dstImageOffsets */ + width, height, 1, /* size */ + format, type, /* src format/type */ + pixels, /* data source */ + unpack); /* unmap */ screen->transfer_unmap(screen, transfer); -- cgit v1.2.3 From f76cbac04abf26617bd65b50e923db8728a4f33f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 18:28:22 -0600 Subject: mesa: use _mesa_get_texstore_func() --- src/mesa/main/mipmap.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 3dca09d9f2..5b70200cd5 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -32,6 +32,7 @@ #include "texcompress.h" #include "texformat.h" #include "teximage.h" +#include "texstore.h" #include "image.h" @@ -1665,16 +1666,21 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, const GLenum srcFormat = convertFormat->BaseFormat; GLint dstRowStride = _mesa_compressed_row_stride(dstImage->TexFormat->MesaFormat, dstWidth); + const StoreTexImageFunc storeImage = + _mesa_get_texstore_func(dstImage->TexFormat->MesaFormat); + ASSERT(srcFormat == GL_RGB || srcFormat == GL_RGBA); - dstImage->TexFormat->StoreImage(ctx, 2, dstImage->_BaseFormat, - dstImage->TexFormat, - dstImage->Data, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, 0, /* strides */ - dstWidth, dstHeight, 1, /* size */ - srcFormat, CHAN_TYPE, - dstData, /* src data, actually */ - &ctx->DefaultPacking); + + storeImage(ctx, 2, dstImage->_BaseFormat, + dstImage->TexFormat, + dstImage->Data, + 0, 0, 0, /* dstX/Y/Zoffset */ + dstRowStride, 0, /* strides */ + dstWidth, dstHeight, 1, /* size */ + srcFormat, CHAN_TYPE, + dstData, /* src data, actually */ + &ctx->DefaultPacking); + /* swap src and dest pointers */ temp = (GLubyte *) srcData; srcData = dstData; -- cgit v1.2.3 From 9525b92efbe0d2b44b3b5518464ca28575188bf7 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 18:28:48 -0600 Subject: mesa: NULL-out unused texformat field initializers --- src/mesa/main/texcompress_fxt1.c | 12 ++++++------ src/mesa/main/texcompress_s3tc.c | 40 ++++++++++++++++++++-------------------- 2 files changed, 26 insertions(+), 26 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c index e3ac37999c..cee1b468af 100644 --- a/src/mesa/main/texcompress_fxt1.c +++ b/src/mesa/main/texcompress_fxt1.c @@ -240,12 +240,12 @@ const struct gl_texture_format _mesa_texformat_rgb_fxt1 = { 0, /* DepthBits */ 0, /* StencilBits */ 0, /* TexelBytes */ - _mesa_texstore_rgb_fxt1, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /*impossible*/ /* FetchTexel1D */ - _mesa_fetch_texel_2d_rgb_fxt1, /* FetchTexel2D */ + NULL, /* FetchTexel2D */ NULL, /*impossible*/ /* FetchTexel3D */ NULL, /*impossible*/ /* FetchTexel1Df */ - _mesa_fetch_texel_2d_f_rgb_fxt1, /* FetchTexel2Df */ + NULL, /* FetchTexel2Df */ NULL, /*impossible*/ /* FetchTexel3Df */ NULL /* StoreTexel */ }; @@ -264,12 +264,12 @@ const struct gl_texture_format _mesa_texformat_rgba_fxt1 = { 0, /* DepthBits */ 0, /* StencilBits */ 0, /* TexelBytes */ - _mesa_texstore_rgba_fxt1, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /*impossible*/ /* FetchTexel1D */ - _mesa_fetch_texel_2d_rgba_fxt1, /* FetchTexel2D */ + NULL, /* FetchTexel2D */ NULL, /*impossible*/ /* FetchTexel3D */ NULL, /*impossible*/ /* FetchTexel1Df */ - _mesa_fetch_texel_2d_f_rgba_fxt1, /* FetchTexel2Df */ + NULL, /* FetchTexel2Df */ NULL, /*impossible*/ /* FetchTexel3Df */ NULL /* StoreTexel */ }; diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c index c880119c3c..14046bd266 100644 --- a/src/mesa/main/texcompress_s3tc.c +++ b/src/mesa/main/texcompress_s3tc.c @@ -581,12 +581,12 @@ const struct gl_texture_format _mesa_texformat_rgb_dxt1 = { 0, /* DepthBits */ 0, /* StencilBits */ 0, /* TexelBytes */ - _mesa_texstore_rgb_dxt1, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /*impossible*/ /* FetchTexel1D */ - fetch_texel_2d_rgb_dxt1, /* FetchTexel2D */ + NULL, /* FetchTexel2D */ NULL, /*impossible*/ /* FetchTexel3D */ NULL, /*impossible*/ /* FetchTexel1Df */ - _mesa_fetch_texel_2d_f_rgb_dxt1, /* FetchTexel2Df */ + NULL, /* FetchTexel2Df */ NULL, /*impossible*/ /* FetchTexel3Df */ NULL /* StoreTexel */ }; @@ -605,12 +605,12 @@ const struct gl_texture_format _mesa_texformat_rgba_dxt1 = { 0, /* DepthBits */ 0, /* StencilBits */ 0, /* TexelBytes */ - _mesa_texstore_rgba_dxt1, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /*impossible*/ /* FetchTexel1D */ - fetch_texel_2d_rgba_dxt1, /* FetchTexel2D */ + NULL, /* FetchTexel2D */ NULL, /*impossible*/ /* FetchTexel3D */ NULL, /*impossible*/ /* FetchTexel1Df */ - _mesa_fetch_texel_2d_f_rgba_dxt1, /* FetchTexel2Df */ + NULL, /* FetchTexel2Df */ NULL, /*impossible*/ /* FetchTexel3Df */ NULL /* StoreTexel */ }; @@ -629,12 +629,12 @@ const struct gl_texture_format _mesa_texformat_rgba_dxt3 = { 0, /* DepthBits */ 0, /* StencilBits */ 0, /* TexelBytes */ - _mesa_texstore_rgba_dxt3, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /*impossible*/ /* FetchTexel1D */ - fetch_texel_2d_rgba_dxt3, /* FetchTexel2D */ + NULL, /* FetchTexel2D */ NULL, /*impossible*/ /* FetchTexel3D */ NULL, /*impossible*/ /* FetchTexel1Df */ - _mesa_fetch_texel_2d_f_rgba_dxt3, /* FetchTexel2Df */ + NULL, /* FetchTexel2Df */ NULL, /*impossible*/ /* FetchTexel3Df */ NULL /* StoreTexel */ }; @@ -653,12 +653,12 @@ const struct gl_texture_format _mesa_texformat_rgba_dxt5 = { 0, /* DepthBits */ 0, /* StencilBits */ 0, /* TexelBytes */ - _mesa_texstore_rgba_dxt5, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /*impossible*/ /* FetchTexel1D */ - fetch_texel_2d_rgba_dxt5, /* FetchTexel2D */ + NULL, /* FetchTexel2D */ NULL, /*impossible*/ /* FetchTexel3D */ NULL, /*impossible*/ /* FetchTexel1Df */ - _mesa_fetch_texel_2d_f_rgba_dxt5, /* FetchTexel2Df */ + NULL, /* FetchTexel2Df */ NULL, /*impossible*/ /* FetchTexel3Df */ NULL /* StoreTexel */ }; @@ -678,12 +678,12 @@ const struct gl_texture_format _mesa_texformat_srgb_dxt1 = { 0, /* DepthBits */ 0, /* StencilBits */ 0, /* TexelBytes */ - _mesa_texstore_rgb_dxt1, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /*impossible*/ /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /*impossible*/ /* FetchTexel3D */ NULL, /*impossible*/ /* FetchTexel1Df */ - _mesa_fetch_texel_2d_f_srgb_dxt1, /* FetchTexel2Df */ + NULL, /* FetchTexel2Df */ NULL, /*impossible*/ /* FetchTexel3Df */ NULL /* StoreTexel */ }; @@ -702,12 +702,12 @@ const struct gl_texture_format _mesa_texformat_srgba_dxt1 = { 0, /* DepthBits */ 0, /* StencilBits */ 0, /* TexelBytes */ - _mesa_texstore_rgba_dxt1, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /*impossible*/ /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /*impossible*/ /* FetchTexel3D */ NULL, /*impossible*/ /* FetchTexel1Df */ - _mesa_fetch_texel_2d_f_srgba_dxt1, /* FetchTexel2Df */ + NULL, /* FetchTexel2Df */ NULL, /*impossible*/ /* FetchTexel3Df */ NULL /* StoreTexel */ }; @@ -726,12 +726,12 @@ const struct gl_texture_format _mesa_texformat_srgba_dxt3 = { 0, /* DepthBits */ 0, /* StencilBits */ 0, /* TexelBytes */ - _mesa_texstore_rgba_dxt3, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /*impossible*/ /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /*impossible*/ /* FetchTexel3D */ NULL, /*impossible*/ /* FetchTexel1Df */ - _mesa_fetch_texel_2d_f_srgba_dxt3, /* FetchTexel2Df */ + NULL, /* FetchTexel2Df */ NULL, /*impossible*/ /* FetchTexel3Df */ NULL /* StoreTexel */ }; @@ -750,12 +750,12 @@ const struct gl_texture_format _mesa_texformat_srgba_dxt5 = { 0, /* DepthBits */ 0, /* StencilBits */ 0, /* TexelBytes */ - _mesa_texstore_rgba_dxt5, /* StoreTexImageFunc */ + NULL, /* StoreTexImageFunc */ NULL, /*impossible*/ /* FetchTexel1D */ NULL, /* FetchTexel2D */ NULL, /*impossible*/ /* FetchTexel3D */ NULL, /*impossible*/ /* FetchTexel1Df */ - _mesa_fetch_texel_2d_f_srgba_dxt5, /* FetchTexel2Df */ + NULL, /* FetchTexel2Df */ NULL, /*impossible*/ /* FetchTexel3Df */ NULL /* StoreTexel */ }; -- cgit v1.2.3 From d73cd703161dab3f2a6890bbe62d92fd548c1ed6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 18:34:12 -0600 Subject: glide: use _mesa_get_texstore_func() --- src/mesa/drivers/glide/fxddtex.c | 86 ++++++++++++++++++++++++---------------- 1 file changed, 51 insertions(+), 35 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c index f3cd908181..a63301d964 100644 --- a/src/mesa/drivers/glide/fxddtex.c +++ b/src/mesa/drivers/glide/fxddtex.c @@ -42,6 +42,7 @@ #include "main/enums.h" #include "main/image.h" #include "main/teximage.h" +#include "main/texstore.h" #include "main/texformat.h" #include "main/texcompress.h" #include "main/texobj.h" @@ -135,15 +136,18 @@ _mesa_halve2x2_teximage2d ( GLcontext *ctx, } if (bpt) { + StoreTexImageFunc storeImage = + _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); + src = _s; dst = _d; - texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, dstImage, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstWidth * bpt, - 0, /* dstImageStride */ - dstWidth, dstHeight, 1, - GL_BGRA, CHAN_TYPE, dst, &ctx->DefaultPacking); + storeImage(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, dstImage, + 0, 0, 0, /* dstX/Y/Zoffset */ + dstWidth * bpt, + 0, /* dstImageStride */ + dstWidth, dstHeight, 1, + GL_BGRA, CHAN_TYPE, dst, &ctx->DefaultPacking); FREE(dst); FREE(src); } @@ -1234,18 +1238,21 @@ adjust2DRatio (GLcontext *ctx, if (!texImage->IsCompressed) { GLubyte *destAddr; + StoreTexImageFunc storeImage = + _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); + tempImage = MALLOC(width * height * texelBytes); if (!tempImage) { return GL_FALSE; } - texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, tempImage, - 0, 0, 0, /* dstX/Y/Zoffset */ - width * texelBytes, /* dstRowStride */ - 0, /* dstImageStride */ - width, height, 1, - format, type, pixels, packing); + storeImage(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, tempImage, + 0, 0, 0, /* dstX/Y/Zoffset */ + width * texelBytes, /* dstRowStride */ + 0, /* dstImageStride */ + width, height, 1, + format, type, pixels, packing); /* now rescale */ /* compute address of dest subimage within the overal tex image */ @@ -1262,6 +1269,9 @@ adjust2DRatio (GLcontext *ctx, } else { const GLint rawBytes = 4; GLvoid *rawImage = MALLOC(width * height * rawBytes); + StoreTexImageFunc storeImage = + _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); + if (!rawImage) { return GL_FALSE; } @@ -1283,13 +1293,13 @@ adjust2DRatio (GLcontext *ctx, width, height, /* src */ newWidth, newHeight, /* dst */ rawImage /*src*/, tempImage /*dst*/ ); - texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, texImage->Data, - xoffset * mml->wScale, yoffset * mml->hScale, 0, /* dstX/Y/Zoffset */ - dstRowStride, - 0, /* dstImageStride */ - newWidth, newHeight, 1, - GL_RGBA, CHAN_TYPE, tempImage, &ctx->DefaultPacking); + storeImage(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, texImage->Data, + xoffset * mml->wScale, yoffset * mml->hScale, 0, /* dstX/Y/Zoffset */ + dstRowStride, + 0, /* dstImageStride */ + newWidth, newHeight, 1, + GL_RGBA, CHAN_TYPE, tempImage, &ctx->DefaultPacking); FREE(rawImage); } @@ -1430,13 +1440,16 @@ fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level, else { /* no rescaling needed */ /* unpack image, apply transfer ops and store in texImage->Data */ - texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, texImage->Data, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, - 0, /* dstImageStride */ - width, height, 1, - format, type, pixels, packing); + StoreTexImageFunc storeImage = + _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); + + storeImage(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, texImage->Data, + 0, 0, 0, /* dstX/Y/Zoffset */ + dstRowStride, + 0, /* dstImageStride */ + width, height, 1, + format, type, pixels, packing); } /* GL_SGIS_generate_mipmap */ @@ -1543,13 +1556,16 @@ fxDDTexSubImage2D(GLcontext * ctx, GLenum target, GLint level, } else { /* no rescaling needed */ - texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, (GLubyte *) texImage->Data, - xoffset, yoffset, 0, /* dstX/Y/Zoffset */ - dstRowStride, - 0, /* dstImageStride */ - width, height, 1, - format, type, pixels, packing); + StoreTexImageFunc storeImage = + _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); + + storeImage(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, (GLubyte *) texImage->Data, + xoffset, yoffset, 0, /* dstX/Y/Zoffset */ + dstRowStride, + 0, /* dstImageStride */ + width, height, 1, + format, type, pixels, packing); } /* GL_SGIS_generate_mipmap */ -- cgit v1.2.3 From f782f90c45fc9a483483ebd36c1971ecd0c7988d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 18:38:50 -0600 Subject: mesa: use _mesa_get_texstore_func() --- src/mesa/drivers/dri/intel/intel_tex_image.c | 20 ++++--- src/mesa/drivers/dri/intel/intel_tex_subimage.c | 19 ++++--- src/mesa/drivers/dri/radeon/radeon_texture.c | 9 ++- src/mesa/drivers/dri/tdfx/tdfx_tex.c | 73 +++++++++++++++---------- src/mesa/drivers/dri/unichrome/via_tex.c | 23 ++++---- 5 files changed, 87 insertions(+), 57 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index 66201b1f46..aa36390689 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -8,6 +8,7 @@ #include "main/context.h" #include "main/texcompress.h" #include "main/texformat.h" +#include "main/texstore.h" #include "main/texgetimage.h" #include "main/texobj.h" #include "main/texstore.h" @@ -513,6 +514,9 @@ intelTexImage(GLcontext * ctx, * conversion and copy: */ if (pixels) { + StoreTexImageFunc storeImage = + _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); + if (compressed) { if (intelImage->mt) { struct intel_region *dst = intelImage->mt->region; @@ -525,14 +529,14 @@ intelTexImage(GLcontext * ctx, 0, 0); } else memcpy(texImage->Data, pixels, imageSize); - } else if (!texImage->TexFormat->StoreImage(ctx, dims, - texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, - texImage->ImageOffsets, - width, height, depth, - format, type, pixels, unpack)) { + } else if (!storeImage(ctx, dims, + texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, 0, 0, 0, /* dstX/Y/Zoffset */ + dstRowStride, + texImage->ImageOffsets, + width, height, depth, + format, type, pixels, unpack)) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage"); } } diff --git a/src/mesa/drivers/dri/intel/intel_tex_subimage.c b/src/mesa/drivers/dri/intel/intel_tex_subimage.c index 751ec2c98c..f75d2ae004 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_subimage.c +++ b/src/mesa/drivers/dri/intel/intel_tex_subimage.c @@ -109,14 +109,17 @@ intelTexSubimage(GLcontext * ctx, memcpy(texImage->Data, pixels, imageSize); } else { - if (!texImage->TexFormat->StoreImage(ctx, dims, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - xoffset, yoffset, zoffset, - dstRowStride, - texImage->ImageOffsets, - width, height, depth, - format, type, pixels, packing)) { + StoreTexImageFunc storeImage = + _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); + + if (!storeImage(ctx, dims, texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + xoffset, yoffset, zoffset, + dstRowStride, + texImage->ImageOffsets, + width, height, depth, + format, type, pixels, packing)) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "intelTexSubImage"); } } diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 049284ef8c..4a22131486 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -624,6 +624,8 @@ static void radeon_teximage( } else { GLuint dstRowStride; GLuint *dstImageOffsets; + StoreTexImageFunc storeImage = + _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); if (image->mt) { radeon_mipmap_level *lvl = &image->mt->levels[image->mtlevel]; @@ -646,7 +648,7 @@ static void radeon_teximage( dstImageOffsets = texImage->ImageOffsets; } - if (!texImage->TexFormat->StoreImage(ctx, dims, + if (!storeImage(ctx, dims, texImage->_BaseFormat, texImage->TexFormat, texImage->Data, 0, 0, 0, /* dstX/Y/Zoffset */ @@ -778,7 +780,10 @@ static void radeon_texsubimage(GLcontext* ctx, int dims, GLenum target, int leve copy_rows(img_start, dstRowStride, pixels, srcRowStride, rows, bytesPerRow); } else { - if (!texImage->TexFormat->StoreImage(ctx, dims, texImage->_BaseFormat, + StoreTexImageFunc storeImage = + _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); + + if (!storeImage(ctx, dims, texImage->_BaseFormat, texImage->TexFormat, texImage->Data, xoffset, yoffset, zoffset, dstRowStride, diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tex.c b/src/mesa/drivers/dri/tdfx/tdfx_tex.c index f6a48b3ae1..91650088b9 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_tex.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_tex.c @@ -138,9 +138,12 @@ _mesa_halve2x2_teximage2d ( GLcontext *ctx, } if (bpt) { + StoreTexImageFunc storeImage = + _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); + src = _s; dst = _d; - texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat, + storeImage(ctx, 2, texImage->_BaseFormat, texImage->TexFormat, dstImage, 0, 0, 0, /* dstX/Y/Zoffset */ dstWidth * bpt, @@ -1228,18 +1231,21 @@ adjust2DRatio (GLcontext *ctx, if (!texImage->IsCompressed) { GLubyte *destAddr; + StoreTexImageFunc storeImage = + _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); + tempImage = MALLOC(width * height * texelBytes); if (!tempImage) { return GL_FALSE; } - texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, tempImage, - 0, 0, 0, /* dstX/Y/Zoffset */ - width * texelBytes, /* dstRowStride */ - &dstImageOffsets, - width, height, 1, - format, type, pixels, packing); + storeImage(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, tempImage, + 0, 0, 0, /* dstX/Y/Zoffset */ + width * texelBytes, /* dstRowStride */ + &dstImageOffsets, + width, height, 1, + format, type, pixels, packing); /* now rescale */ /* compute address of dest subimage within the overal tex image */ @@ -1256,6 +1262,9 @@ adjust2DRatio (GLcontext *ctx, } else { const GLint rawBytes = 4; GLvoid *rawImage = MALLOC(width * height * rawBytes); + StoreTexImageFunc storeImage = + _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); + if (!rawImage) { return GL_FALSE; } @@ -1278,13 +1287,13 @@ adjust2DRatio (GLcontext *ctx, width, height, /* src */ newWidth, newHeight, /* dst */ rawImage /*src*/, tempImage /*dst*/ ); - texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, texImage->Data, - xoffset * mml->wScale, yoffset * mml->hScale, 0, /* dstX/Y/Zoffset */ - dstRowStride, - &dstImageOffsets, - newWidth, newHeight, 1, - GL_RGBA, CHAN_TYPE, tempImage, &ctx->DefaultPacking); + storeImage(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, texImage->Data, + xoffset * mml->wScale, yoffset * mml->hScale, 0, /* dstX/Y/Zoffset */ + dstRowStride, + &dstImageOffsets, + newWidth, newHeight, 1, + GL_RGBA, CHAN_TYPE, tempImage, &ctx->DefaultPacking); FREE(rawImage); } @@ -1437,13 +1446,16 @@ tdfxTexImage2D(GLcontext *ctx, GLenum target, GLint level, else { /* no rescaling needed */ /* unpack image, apply transfer ops and store in texImage->Data */ - texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, texImage->Data, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, - texImage->ImageOffsets, - width, height, 1, - format, type, pixels, packing); + StoreTexImageFunc storeImage = + _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); + + storeImage(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, texImage->Data, + 0, 0, 0, /* dstX/Y/Zoffset */ + dstRowStride, + texImage->ImageOffsets, + width, height, 1, + format, type, pixels, packing); } } @@ -1507,13 +1519,16 @@ tdfxTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, } else { /* no rescaling needed */ - texImage->TexFormat->StoreImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, texImage->Data, - xoffset, yoffset, 0, - dstRowStride, - texImage->ImageOffsets, - width, height, 1, - format, type, pixels, packing); + StoreTexImageFunc storeImage = + _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); + + storeImage(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, texImage->Data, + xoffset, yoffset, 0, + dstRowStride, + texImage->ImageOffsets, + width, height, 1, + format, type, pixels, packing); } ti->reloadImages = GL_TRUE; /* signal the image needs to be reloaded */ diff --git a/src/mesa/drivers/dri/unichrome/via_tex.c b/src/mesa/drivers/dri/unichrome/via_tex.c index 54073e7691..388fd9392c 100644 --- a/src/mesa/drivers/dri/unichrome/via_tex.c +++ b/src/mesa/drivers/dri/unichrome/via_tex.c @@ -797,22 +797,25 @@ static void viaTexImage(GLcontext *ctx, else { GLint dstRowStride; GLboolean success; + StoreTexImageFunc storeImage = + _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); + if (texImage->IsCompressed) { dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, width); } else { dstRowStride = postConvWidth * texImage->TexFormat->TexelBytes; } - ASSERT(texImage->TexFormat->StoreImage); - success = texImage->TexFormat->StoreImage(ctx, dims, - texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, - texImage->ImageOffsets, - width, height, 1, - format, type, pixels, packing); + ASSERT(storeImage); + success = storeImage(ctx, dims, + texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + 0, 0, 0, /* dstX/Y/Zoffset */ + dstRowStride, + texImage->ImageOffsets, + width, height, 1, + format, type, pixels, packing); if (!success) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage"); } -- cgit v1.2.3 From adce34e23b431e184c4a511464f5cb0281c74db5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 18:39:17 -0600 Subject: st/mesa: use _mesa_get_texstore_func() --- src/mesa/state_tracker/st_cb_texture.c | 84 +++++++++++++++++++--------------- 1 file changed, 47 insertions(+), 37 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 3520c986b4..62ebdd8056 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -417,7 +417,7 @@ compress_with_blit(GLcontext * ctx, struct pipe_surface *dst_surface; struct pipe_transfer *tex_xfer; void *map; - + StoreTexImageFunc storeImage; if (!stImage->pt) { /* XXX: Can this happen? Should we assert? */ @@ -464,15 +464,18 @@ compress_with_blit(GLcontext * ctx, 0, 0, width, height); /* x, y, w, h */ map = screen->transfer_map(screen, tex_xfer); - mesa_format->StoreImage(ctx, 2, GL_RGBA, mesa_format, - map, /* dest ptr */ - 0, 0, 0, /* dest x/y/z offset */ - tex_xfer->stride, /* dest row stride (bytes) */ - dstImageOffsets, /* image offsets (for 3D only) */ - width, height, 1, /* size */ - format, type, /* source format/type */ - pixels, /* source data */ - unpack); /* source data packing */ + storeImage = _mesa_get_texstore_func(mesa_format->MesaFormat); + + + storeImage(ctx, 2, GL_RGBA, mesa_format, + map, /* dest ptr */ + 0, 0, 0, /* dest x/y/z offset */ + tex_xfer->stride, /* dest row stride (bytes) */ + dstImageOffsets, /* image offsets (for 3D only) */ + width, height, 1, /* size */ + format, type, /* source format/type */ + pixels, /* source data */ + unpack); /* source data packing */ screen->transfer_unmap(screen, tex_xfer); screen->tex_transfer_destroy(tex_xfer); @@ -734,17 +737,19 @@ st_TexImage(GLcontext * ctx, _mesa_image_image_stride(unpack, width, height, format, type); GLint i; const GLubyte *src = (const GLubyte *) pixels; + StoreTexImageFunc storeImage = + _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); for (i = 0; i < depth; i++) { - if (!texImage->TexFormat->StoreImage(ctx, dims, - texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, - texImage->ImageOffsets, - width, height, 1, - format, type, src, unpack)) { + if (!storeImage(ctx, dims, + texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + 0, 0, 0, /* dstX/Y/Zoffset */ + dstRowStride, + texImage->ImageOffsets, + width, height, 1, + format, type, src, unpack)) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage"); } @@ -1051,6 +1056,9 @@ st_TexSubimage(GLcontext *ctx, GLint dims, GLenum target, GLint level, const GLubyte *src; /* init to silence warning only: */ enum pipe_transfer_usage transfer_usage = PIPE_TRANSFER_WRITE; + StoreTexImageFunc storeImage = + _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); + DBG("%s target %s level %d offset %d,%d %dx%d\n", __FUNCTION__, _mesa_lookup_enum_by_nr(target), @@ -1107,14 +1115,14 @@ st_TexSubimage(GLcontext *ctx, GLint dims, GLenum target, GLint level, dstRowStride = stImage->transfer->stride; for (i = 0; i < depth; i++) { - if (!texImage->TexFormat->StoreImage(ctx, dims, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - 0, 0, 0, - dstRowStride, - texImage->ImageOffsets, - width, height, 1, - format, type, src, packing)) { + if (!storeImage(ctx, dims, texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + 0, 0, 0, + dstRowStride, + texImage->ImageOffsets, + width, height, 1, + format, type, src, packing)) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage"); } @@ -1353,6 +1361,8 @@ fallback_copy_texsubimage(GLcontext *ctx, GLenum target, GLint level, const GLint dstRowStride = stImage->transfer->stride; struct gl_texture_image *texImage = &stImage->base; struct gl_pixelstore_attrib unpack = ctx->DefaultPacking; + StoreTexImageFunc storeImage = + _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); if (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP) { unpack.Invert = GL_TRUE; @@ -1370,16 +1380,16 @@ fallback_copy_texsubimage(GLcontext *ctx, GLenum target, GLint level, * is actually RGBA but the user created the texture as GL_RGB we * need to fill-in/override the alpha channel with 1.0. */ - texImage->TexFormat->StoreImage(ctx, dims, - texImage->_BaseFormat, - texImage->TexFormat, - texDest, - 0, 0, 0, - dstRowStride, - texImage->ImageOffsets, - width, height, 1, - GL_RGBA, GL_FLOAT, tempSrc, /* src */ - &unpack); + storeImage(ctx, dims, + texImage->_BaseFormat, + texImage->TexFormat, + texDest, + 0, 0, 0, + dstRowStride, + texImage->ImageOffsets, + width, height, 1, + GL_RGBA, GL_FLOAT, tempSrc, /* src */ + &unpack); } else { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage"); -- cgit v1.2.3 From 05e73cc8e23e348ea8243dd2584a44ee5d3a4dd2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 18:39:48 -0600 Subject: mesa: replace function pointer types with void * These fields are no longer used and will be removed soon. --- src/mesa/main/mtypes.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index d7bf7689f3..8468f74ca1 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1203,21 +1203,21 @@ struct gl_texture_format GLuint TexelBytes; /**< Bytes per texel, 0 if compressed format */ - StoreTexImageFunc StoreImage; + void *StoreImage; /** * \name Texel fetch function pointers */ /*@{*/ - FetchTexelFuncC FetchTexel1D; - FetchTexelFuncC FetchTexel2D; - FetchTexelFuncC FetchTexel3D; - FetchTexelFuncF FetchTexel1Df; - FetchTexelFuncF FetchTexel2Df; - FetchTexelFuncF FetchTexel3Df; + void *FetchTexel1D; + void *FetchTexel2D; + void *FetchTexel3D; + void *FetchTexel1Df; + void *FetchTexel2Df; + void *FetchTexel3Df; /*@}*/ - StoreTexelFunc StoreTexel; + void *toreTexel; }; -- cgit v1.2.3 From 27e201e9c4dd66bbf8fd2bc3ac3292550b94a14a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 18:49:14 -0600 Subject: mesa: rework null texel fetch/store funcs --- src/mesa/main/texformat.c | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index 2169d294c6..8eb777b939 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -90,17 +90,6 @@ nonlinear_to_linear(GLubyte cs8) * * Have to have this so the FetchTexel function pointer is never NULL. */ -static void fetch_null_texel( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - (void) texImage; (void) i; (void) j; (void) k; - texel[RCOMP] = 0; - texel[GCOMP] = 0; - texel[BCOMP] = 0; - texel[ACOMP] = 0; - _mesa_warning(NULL, "fetch_null_texel() called!"); -} - static void fetch_null_texelf( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { @@ -1451,13 +1440,13 @@ const struct gl_texture_format _mesa_null_texformat = { 0, /* StencilBits */ 0, /* TexelBytes */ NULL, /* StoreTexImageFunc */ - fetch_null_texel, /* FetchTexel1D */ - fetch_null_texel, /* FetchTexel1D */ - fetch_null_texel, /* FetchTexel1D */ - fetch_null_texelf, /* FetchTexel1Df */ - fetch_null_texelf, /* FetchTexel1Df */ - fetch_null_texelf, /* FetchTexel1Df */ - store_null_texel /* StoreTexel */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel1D */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel1Df */ + NULL, /* FetchTexel1Df */ + NULL, /* StoreTexel */ }; /*@}*/ @@ -2453,18 +2442,25 @@ texfetch_funcs[MESA_FORMAT_COUNT] = FetchTexelFuncF _mesa_get_texel_fetch_func(GLuint format, GLuint dims) { + FetchTexelFuncF f; GLuint i; /* XXX replace loop with direct table lookup */ for (i = 0; i < MESA_FORMAT_COUNT; i++) { if (texfetch_funcs[i].Name == format) { switch (dims) { case 1: - return texfetch_funcs[i].Fetch1D; + f = texfetch_funcs[i].Fetch1D; + break; case 2: - return texfetch_funcs[i].Fetch2D; + f = texfetch_funcs[i].Fetch2D; + break; case 3: - return texfetch_funcs[i].Fetch3D; + f = texfetch_funcs[i].Fetch3D; + break; } + if (!f) + f = fetch_null_texelf; + return f; } } return NULL; @@ -2478,7 +2474,10 @@ _mesa_get_texel_store_func(GLuint format) /* XXX replace loop with direct table lookup */ for (i = 0; i < MESA_FORMAT_COUNT; i++) { if (texfetch_funcs[i].Name == format) { - return texfetch_funcs[i].StoreTexel; + if (texfetch_funcs[i].StoreTexel) + return texfetch_funcs[i].StoreTexel; + else + return store_null_texel; } } return NULL; -- cgit v1.2.3 From cccdc43fa9a8c49cdbdb545de8ff91c528b1ed47 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 18:50:04 -0600 Subject: mesa: move StoreTexImageFunc to texstore.h --- src/mesa/main/mtypes.h | 35 ----------------------------------- src/mesa/main/texcompress_fxt1.h | 2 ++ src/mesa/main/texcompress_s3tc.h | 2 ++ src/mesa/main/texstore.h | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 40 insertions(+), 35 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 8468f74ca1..20fa6d8e3c 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1136,41 +1136,6 @@ typedef void (*StoreTexelFunc)(struct gl_texture_image *texImage, const void *texel); -/** - * This macro defines the (many) parameters to the texstore functions. - * \param dims either 1 or 2 or 3 - * \param baseInternalFormat user-specified base internal format - * \param dstFormat destination Mesa texture format - * \param dstAddr destination image address - * \param dstX/Y/Zoffset destination x/y/z offset (ala TexSubImage), in texels - * \param dstRowStride destination image row stride, in bytes - * \param dstImageOffsets offset of each 2D slice within 3D texture, in texels - * \param srcWidth/Height/Depth source image size, in pixels - * \param srcFormat incoming image format - * \param srcType incoming image data type - * \param srcAddr source image address - * \param srcPacking source image packing parameters - */ -#define TEXSTORE_PARAMS \ - GLcontext *ctx, GLuint dims, \ - GLenum baseInternalFormat, \ - const struct gl_texture_format *dstFormat, \ - GLvoid *dstAddr, \ - GLint dstXoffset, GLint dstYoffset, GLint dstZoffset, \ - GLint dstRowStride, const GLuint *dstImageOffsets, \ - GLint srcWidth, GLint srcHeight, GLint srcDepth, \ - GLenum srcFormat, GLenum srcType, \ - const GLvoid *srcAddr, \ - const struct gl_pixelstore_attrib *srcPacking - - - -/** - * Texture image storage function. - */ -typedef GLboolean (*StoreTexImageFunc)(TEXSTORE_PARAMS); - - /** * Texture format record */ diff --git a/src/mesa/main/texcompress_fxt1.h b/src/mesa/main/texcompress_fxt1.h index a9ddce9a8c..b74f955fcd 100644 --- a/src/mesa/main/texcompress_fxt1.h +++ b/src/mesa/main/texcompress_fxt1.h @@ -25,6 +25,8 @@ #ifndef TEXCOMPRESS_FXT1_H #define TEXCOMPRESS_FXT1_H +#include "texstore.h" + extern GLboolean _mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS); diff --git a/src/mesa/main/texcompress_s3tc.h b/src/mesa/main/texcompress_s3tc.h index 866bb0e3d3..4041d244d1 100644 --- a/src/mesa/main/texcompress_s3tc.h +++ b/src/mesa/main/texcompress_s3tc.h @@ -25,6 +25,8 @@ #ifndef TEXCOMPRESS_S3TC_H #define TEXCOMPRESS_S3TC_H +#include "texstore.h" + extern GLboolean _mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS); diff --git a/src/mesa/main/texstore.h b/src/mesa/main/texstore.h index 629854b446..771493cec6 100644 --- a/src/mesa/main/texstore.h +++ b/src/mesa/main/texstore.h @@ -40,6 +40,42 @@ #include "formats.h" +/** + * This macro defines the (many) parameters to the texstore functions. + * \param dims either 1 or 2 or 3 + * \param baseInternalFormat user-specified base internal format + * \param dstFormat destination Mesa texture format + * \param dstAddr destination image address + * \param dstX/Y/Zoffset destination x/y/z offset (ala TexSubImage), in texels + * \param dstRowStride destination image row stride, in bytes + * \param dstImageOffsets offset of each 2D slice within 3D texture, in texels + * \param srcWidth/Height/Depth source image size, in pixels + * \param srcFormat incoming image format + * \param srcType incoming image data type + * \param srcAddr source image address + * \param srcPacking source image packing parameters + */ +#define TEXSTORE_PARAMS \ + GLcontext *ctx, GLuint dims, \ + GLenum baseInternalFormat, \ + const struct gl_texture_format *dstFormat, \ + GLvoid *dstAddr, \ + GLint dstXoffset, GLint dstYoffset, GLint dstZoffset, \ + GLint dstRowStride, const GLuint *dstImageOffsets, \ + GLint srcWidth, GLint srcHeight, GLint srcDepth, \ + GLenum srcFormat, GLenum srcType, \ + const GLvoid *srcAddr, \ + const struct gl_pixelstore_attrib *srcPacking + + + +/** + * Texture image storage function. + */ +typedef GLboolean (*StoreTexImageFunc)(TEXSTORE_PARAMS); + + + extern GLboolean _mesa_texstore_rgba(TEXSTORE_PARAMS); extern GLboolean _mesa_texstore_color_index(TEXSTORE_PARAMS); extern GLboolean _mesa_texstore_rgba8888(TEXSTORE_PARAMS); -- cgit v1.2.3 From e8eed5003b01fe8a4349711382411ac80b1c0aa3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 18:53:22 -0600 Subject: mesa: added MESA_FORMAT_NONE --- src/mesa/main/formats.c | 11 +++++++++++ src/mesa/main/formats.h | 1 + 2 files changed, 12 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index 8aa0d107b7..5c2bf5ece3 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -36,6 +36,14 @@ */ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = { + { + MESA_FORMAT_NONE, /* Name */ + GL_NONE, /* BaseFormat */ + GL_NONE, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 0, 0, 0 /* BlockWidth/Height,Bytes */ + }, { MESA_FORMAT_RGBA8888, /* Name */ GL_RGBA, /* BaseFormat */ @@ -617,6 +625,9 @@ _mesa_test_formats(void) assert(info->Name == i); + if (info->Name == MESA_FORMAT_NONE) + continue; + if (info->BlockWidth == 1 && info->BlockHeight == 1) { if (info->RedBits > 0) { GLuint t = info->RedBits + info->GreenBits diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index 61bbd8e79a..e79991ad41 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -42,6 +42,7 @@ */ typedef enum { + MESA_FORMAT_NONE = 0, /** * \name Basic hardware formats */ -- cgit v1.2.3 From a608257a02d2ba4e8119be462bbd40ed238b184a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 18:57:02 -0600 Subject: mesa: remove unused gl_texture_format fields --- src/mesa/main/mtypes.h | 16 -- src/mesa/main/texcompress_fxt1.c | 20 +- src/mesa/main/texcompress_s3tc.c | 64 ------ src/mesa/main/texformat.c | 432 --------------------------------------- 4 files changed, 2 insertions(+), 530 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 20fa6d8e3c..d448e3e158 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1167,22 +1167,6 @@ struct gl_texture_format /*@}*/ GLuint TexelBytes; /**< Bytes per texel, 0 if compressed format */ - - void *StoreImage; - - /** - * \name Texel fetch function pointers - */ - /*@{*/ - void *FetchTexel1D; - void *FetchTexel2D; - void *FetchTexel3D; - void *FetchTexel1Df; - void *FetchTexel2Df; - void *FetchTexel3Df; - /*@}*/ - - void *toreTexel; }; diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c index cee1b468af..1a103ff14e 100644 --- a/src/mesa/main/texcompress_fxt1.c +++ b/src/mesa/main/texcompress_fxt1.c @@ -239,15 +239,7 @@ const struct gl_texture_format _mesa_texformat_rgb_fxt1 = { 0, /* IndexBits */ 0, /* DepthBits */ 0, /* StencilBits */ - 0, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /*impossible*/ /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /*impossible*/ /* FetchTexel3D */ - NULL, /*impossible*/ /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /*impossible*/ /* FetchTexel3Df */ - NULL /* StoreTexel */ + 0 /* TexelBytes */ }; const struct gl_texture_format _mesa_texformat_rgba_fxt1 = { @@ -263,15 +255,7 @@ const struct gl_texture_format _mesa_texformat_rgba_fxt1 = { 0, /* IndexBits */ 0, /* DepthBits */ 0, /* StencilBits */ - 0, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /*impossible*/ /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /*impossible*/ /* FetchTexel3D */ - NULL, /*impossible*/ /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /*impossible*/ /* FetchTexel3Df */ - NULL /* StoreTexel */ + 0 /* TexelBytes */ }; diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c index 14046bd266..86492d05fb 100644 --- a/src/mesa/main/texcompress_s3tc.c +++ b/src/mesa/main/texcompress_s3tc.c @@ -581,14 +581,6 @@ const struct gl_texture_format _mesa_texformat_rgb_dxt1 = { 0, /* DepthBits */ 0, /* StencilBits */ 0, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /*impossible*/ /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /*impossible*/ /* FetchTexel3D */ - NULL, /*impossible*/ /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /*impossible*/ /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgba_dxt1 = { @@ -605,14 +597,6 @@ const struct gl_texture_format _mesa_texformat_rgba_dxt1 = { 0, /* DepthBits */ 0, /* StencilBits */ 0, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /*impossible*/ /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /*impossible*/ /* FetchTexel3D */ - NULL, /*impossible*/ /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /*impossible*/ /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgba_dxt3 = { @@ -629,14 +613,6 @@ const struct gl_texture_format _mesa_texformat_rgba_dxt3 = { 0, /* DepthBits */ 0, /* StencilBits */ 0, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /*impossible*/ /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /*impossible*/ /* FetchTexel3D */ - NULL, /*impossible*/ /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /*impossible*/ /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgba_dxt5 = { @@ -653,14 +629,6 @@ const struct gl_texture_format _mesa_texformat_rgba_dxt5 = { 0, /* DepthBits */ 0, /* StencilBits */ 0, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /*impossible*/ /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /*impossible*/ /* FetchTexel3D */ - NULL, /*impossible*/ /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /*impossible*/ /* FetchTexel3Df */ - NULL /* StoreTexel */ }; #if FEATURE_EXT_texture_sRGB @@ -678,14 +646,6 @@ const struct gl_texture_format _mesa_texformat_srgb_dxt1 = { 0, /* DepthBits */ 0, /* StencilBits */ 0, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /*impossible*/ /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /*impossible*/ /* FetchTexel3D */ - NULL, /*impossible*/ /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /*impossible*/ /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_srgba_dxt1 = { @@ -702,14 +662,6 @@ const struct gl_texture_format _mesa_texformat_srgba_dxt1 = { 0, /* DepthBits */ 0, /* StencilBits */ 0, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /*impossible*/ /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /*impossible*/ /* FetchTexel3D */ - NULL, /*impossible*/ /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /*impossible*/ /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_srgba_dxt3 = { @@ -726,14 +678,6 @@ const struct gl_texture_format _mesa_texformat_srgba_dxt3 = { 0, /* DepthBits */ 0, /* StencilBits */ 0, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /*impossible*/ /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /*impossible*/ /* FetchTexel3D */ - NULL, /*impossible*/ /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /*impossible*/ /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_srgba_dxt5 = { @@ -750,13 +694,5 @@ const struct gl_texture_format _mesa_texformat_srgba_dxt5 = { 0, /* DepthBits */ 0, /* StencilBits */ 0, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /*impossible*/ /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /*impossible*/ /* FetchTexel3D */ - NULL, /*impossible*/ /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /*impossible*/ /* FetchTexel3Df */ - NULL /* StoreTexel */ }; #endif diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index 8eb777b939..dae98bcc6f 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -145,14 +145,6 @@ const struct gl_texture_format _mesa_texformat_rgba = { 0, /* DepthBits */ 0, /* StencilBits */ 4 * sizeof(GLchan), /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgb = { @@ -169,14 +161,6 @@ const struct gl_texture_format _mesa_texformat_rgb = { 0, /* DepthBits */ 0, /* StencilBits */ 3 * sizeof(GLchan), /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_alpha = { @@ -193,14 +177,6 @@ const struct gl_texture_format _mesa_texformat_alpha = { 0, /* DepthBits */ 0, /* StencilBits */ sizeof(GLchan), /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_luminance = { @@ -217,14 +193,6 @@ const struct gl_texture_format _mesa_texformat_luminance = { 0, /* DepthBits */ 0, /* StencilBits */ sizeof(GLchan), /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_luminance_alpha = { @@ -241,14 +209,6 @@ const struct gl_texture_format _mesa_texformat_luminance_alpha = { 0, /* DepthBits */ 0, /* StencilBits */ 2 * sizeof(GLchan), /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_intensity = { @@ -265,14 +225,6 @@ const struct gl_texture_format _mesa_texformat_intensity = { 0, /* DepthBits */ 0, /* StencilBits */ sizeof(GLchan), /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; @@ -292,14 +244,6 @@ const struct gl_texture_format _mesa_texformat_srgb8 = { 0, /* DepthBits */ 0, /* StencilBits */ 3, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_srgba8 = { @@ -316,14 +260,6 @@ const struct gl_texture_format _mesa_texformat_srgba8 = { 0, /* DepthBits */ 0, /* StencilBits */ 4, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_sargb8 = { @@ -340,14 +276,6 @@ const struct gl_texture_format _mesa_texformat_sargb8 = { 0, /* DepthBits */ 0, /* StencilBits */ 4, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_sl8 = { @@ -364,14 +292,6 @@ const struct gl_texture_format _mesa_texformat_sl8 = { 0, /* DepthBits */ 0, /* StencilBits */ 1, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; /* Note: this format name looks like a misnomer, make it sal8? */ @@ -389,14 +309,6 @@ const struct gl_texture_format _mesa_texformat_sla8 = { 0, /* DepthBits */ 0, /* StencilBits */ 2, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; #endif /* FEATURE_EXT_texture_sRGB */ @@ -415,14 +327,6 @@ const struct gl_texture_format _mesa_texformat_rgba_float32 = { 0, /* DepthBits */ 0, /* StencilBits */ 4 * sizeof(GLfloat), /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel1Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgba_float16 = { @@ -439,14 +343,6 @@ const struct gl_texture_format _mesa_texformat_rgba_float16 = { 0, /* DepthBits */ 0, /* StencilBits */ 4 * sizeof(GLhalfARB), /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel1Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgb_float32 = { @@ -463,14 +359,6 @@ const struct gl_texture_format _mesa_texformat_rgb_float32 = { 0, /* DepthBits */ 0, /* StencilBits */ 3 * sizeof(GLfloat), /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel1Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgb_float16 = { @@ -487,14 +375,6 @@ const struct gl_texture_format _mesa_texformat_rgb_float16 = { 0, /* DepthBits */ 0, /* StencilBits */ 3 * sizeof(GLhalfARB), /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel1Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_alpha_float32 = { @@ -511,14 +391,6 @@ const struct gl_texture_format _mesa_texformat_alpha_float32 = { 0, /* DepthBits */ 0, /* StencilBits */ 1 * sizeof(GLfloat), /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel1Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_alpha_float16 = { @@ -535,14 +407,6 @@ const struct gl_texture_format _mesa_texformat_alpha_float16 = { 0, /* DepthBits */ 0, /* StencilBits */ 1 * sizeof(GLhalfARB), /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel1Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_luminance_float32 = { @@ -559,14 +423,6 @@ const struct gl_texture_format _mesa_texformat_luminance_float32 = { 0, /* DepthBits */ 0, /* StencilBits */ 1 * sizeof(GLfloat), /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_luminance_float16 = { @@ -583,14 +439,6 @@ const struct gl_texture_format _mesa_texformat_luminance_float16 = { 0, /* DepthBits */ 0, /* StencilBits */ 1 * sizeof(GLhalfARB), /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_luminance_alpha_float32 = { @@ -607,14 +455,6 @@ const struct gl_texture_format _mesa_texformat_luminance_alpha_float32 = { 0, /* DepthBits */ 0, /* StencilBits */ 2 * sizeof(GLfloat), /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_luminance_alpha_float16 = { @@ -631,14 +471,6 @@ const struct gl_texture_format _mesa_texformat_luminance_alpha_float16 = { 0, /* DepthBits */ 0, /* StencilBits */ 2 * sizeof(GLhalfARB), /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_intensity_float32 = { @@ -655,14 +487,6 @@ const struct gl_texture_format _mesa_texformat_intensity_float32 = { 0, /* DepthBits */ 0, /* StencilBits */ 1 * sizeof(GLfloat), /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_intensity_float16 = { @@ -679,14 +503,6 @@ const struct gl_texture_format _mesa_texformat_intensity_float16 = { 0, /* DepthBits */ 0, /* StencilBits */ 1 * sizeof(GLhalfARB), /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_dudv8 = { @@ -705,14 +521,6 @@ const struct gl_texture_format _mesa_texformat_dudv8 = { 0, /* DepthBits */ 0, /* StencilBits */ 2, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_signed_rgba8888 = { @@ -729,14 +537,6 @@ const struct gl_texture_format _mesa_texformat_signed_rgba8888 = { 0, /* DepthBits */ 0, /* StencilBits */ 4, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_signed_rgba8888_rev = { @@ -753,14 +553,6 @@ const struct gl_texture_format _mesa_texformat_signed_rgba8888_rev = { 0, /* DepthBits */ 0, /* StencilBits */ 4, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; /*@}*/ @@ -784,14 +576,6 @@ const struct gl_texture_format _mesa_texformat_rgba8888 = { 0, /* DepthBits */ 0, /* StencilBits */ 4, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgba8888_rev = { @@ -808,14 +592,6 @@ const struct gl_texture_format _mesa_texformat_rgba8888_rev = { 0, /* DepthBits */ 0, /* StencilBits */ 4, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_argb8888 = { @@ -832,14 +608,6 @@ const struct gl_texture_format _mesa_texformat_argb8888 = { 0, /* DepthBits */ 0, /* StencilBits */ 4, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_argb8888_rev = { @@ -856,14 +624,6 @@ const struct gl_texture_format _mesa_texformat_argb8888_rev = { 0, /* DepthBits */ 0, /* StencilBits */ 4, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgb888 = { @@ -880,14 +640,6 @@ const struct gl_texture_format _mesa_texformat_rgb888 = { 0, /* DepthBits */ 0, /* StencilBits */ 3, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_bgr888 = { @@ -904,14 +656,6 @@ const struct gl_texture_format _mesa_texformat_bgr888 = { 0, /* DepthBits */ 0, /* StencilBits */ 3, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgb565 = { @@ -928,14 +672,6 @@ const struct gl_texture_format _mesa_texformat_rgb565 = { 0, /* DepthBits */ 0, /* StencilBits */ 2, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgb565_rev = { @@ -952,14 +688,6 @@ const struct gl_texture_format _mesa_texformat_rgb565_rev = { 0, /* DepthBits */ 0, /* StencilBits */ 2, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgba4444 = { @@ -976,14 +704,6 @@ const struct gl_texture_format _mesa_texformat_rgba4444 = { 0, /* DepthBits */ 0, /* StencilBits */ 2, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_argb4444 = { @@ -1000,14 +720,6 @@ const struct gl_texture_format _mesa_texformat_argb4444 = { 0, /* DepthBits */ 0, /* StencilBits */ 2, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_argb4444_rev = { @@ -1024,14 +736,6 @@ const struct gl_texture_format _mesa_texformat_argb4444_rev = { 0, /* DepthBits */ 0, /* StencilBits */ 2, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgba5551 = { @@ -1048,14 +752,6 @@ const struct gl_texture_format _mesa_texformat_rgba5551 = { 0, /* DepthBits */ 0, /* StencilBits */ 2, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_argb1555 = { @@ -1072,14 +768,6 @@ const struct gl_texture_format _mesa_texformat_argb1555 = { 0, /* DepthBits */ 0, /* StencilBits */ 2, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_argb1555_rev = { @@ -1096,14 +784,6 @@ const struct gl_texture_format _mesa_texformat_argb1555_rev = { 0, /* DepthBits */ 0, /* StencilBits */ 2, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_al88 = { @@ -1120,14 +800,6 @@ const struct gl_texture_format _mesa_texformat_al88 = { 0, /* DepthBits */ 0, /* StencilBits */ 2, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_al88_rev = { @@ -1144,14 +816,6 @@ const struct gl_texture_format _mesa_texformat_al88_rev = { 0, /* DepthBits */ 0, /* StencilBits */ 2, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_rgb332 = { @@ -1168,14 +832,6 @@ const struct gl_texture_format _mesa_texformat_rgb332 = { 0, /* DepthBits */ 0, /* StencilBits */ 1, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_a8 = { @@ -1192,14 +848,6 @@ const struct gl_texture_format _mesa_texformat_a8 = { 0, /* DepthBits */ 0, /* StencilBits */ 1, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_l8 = { @@ -1216,14 +864,6 @@ const struct gl_texture_format _mesa_texformat_l8 = { 0, /* DepthBits */ 0, /* StencilBits */ 1, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_i8 = { @@ -1240,14 +880,6 @@ const struct gl_texture_format _mesa_texformat_i8 = { 0, /* DepthBits */ 0, /* StencilBits */ 1, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_ci8 = { @@ -1264,14 +896,6 @@ const struct gl_texture_format _mesa_texformat_ci8 = { 0, /* DepthBits */ 0, /* StencilBits */ 1, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_ycbcr = { @@ -1288,14 +912,6 @@ const struct gl_texture_format _mesa_texformat_ycbcr = { 0, /* DepthBits */ 0, /* StencilBits */ 2, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_ycbcr_rev = { @@ -1312,14 +928,6 @@ const struct gl_texture_format _mesa_texformat_ycbcr_rev = { 0, /* DepthBits */ 0, /* StencilBits */ 2, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_z24_s8 = { @@ -1336,14 +944,6 @@ const struct gl_texture_format _mesa_texformat_z24_s8 = { 24, /* DepthBits */ 8, /* StencilBits */ 4, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_s8_z24 = { @@ -1360,14 +960,6 @@ const struct gl_texture_format _mesa_texformat_s8_z24 = { 24, /* DepthBits */ 8, /* StencilBits */ 4, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel2D */ - NULL, /* FetchTexel3D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel2Df */ - NULL, /* FetchTexel3Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_z16 = { @@ -1384,14 +976,6 @@ const struct gl_texture_format _mesa_texformat_z16 = { sizeof(GLushort) * 8, /* DepthBits */ 0, /* StencilBits */ sizeof(GLushort), /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel1Df */ - NULL /* StoreTexel */ }; const struct gl_texture_format _mesa_texformat_z32 = { @@ -1408,14 +992,6 @@ const struct gl_texture_format _mesa_texformat_z32 = { sizeof(GLuint) * 8, /* DepthBits */ 0, /* StencilBits */ sizeof(GLuint), /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel1Df */ - NULL /* StoreTexel */ }; /*@}*/ @@ -1439,14 +1015,6 @@ const struct gl_texture_format _mesa_null_texformat = { 0, /* DepthBits */ 0, /* StencilBits */ 0, /* TexelBytes */ - NULL, /* StoreTexImageFunc */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1D */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel1Df */ - NULL, /* FetchTexel1Df */ - NULL, /* StoreTexel */ }; /*@}*/ -- cgit v1.2.3 From c28d78f8324cfc17936af63c258a1cc55d590d60 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 19:07:44 -0600 Subject: mesa: added _mesa_get_format_bits() --- src/mesa/main/formats.c | 31 +++++++++++++++++++++++++++++++ src/mesa/main/formats.h | 4 ++++ 2 files changed, 35 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index 5c2bf5ece3..62a2d70744 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -24,6 +24,7 @@ */ +#include "imports.h" #include "formats.h" #include "config.h" #include "texstore.h" @@ -785,3 +786,33 @@ _mesa_format_to_type_and_comps2(gl_format format, } } + +GLint +_mesa_get_format_bits(gl_format format, GLenum pname) +{ + const struct gl_format_info *info = _mesa_get_format_info(format); + + switch (pname) { + case GL_TEXTURE_RED_SIZE: + return info->RedBits; + case GL_TEXTURE_GREEN_SIZE: + return info->GreenBits; + case GL_TEXTURE_BLUE_SIZE: + return info->BlueBits; + case GL_TEXTURE_ALPHA_SIZE: + return info->AlphaBits; + case GL_TEXTURE_INTENSITY_SIZE: + return info->IntensityBits; + case GL_TEXTURE_LUMINANCE_SIZE: + return info->LuminanceBits; + case GL_TEXTURE_INDEX_SIZE_EXT: + return info->IndexBits; + case GL_TEXTURE_DEPTH_SIZE_ARB: + return info->DepthBits; + case GL_TEXTURE_STENCIL_SIZE_EXT: + return info->StencilBits; + default: + _mesa_problem(NULL, "bad pname in _mesa_get_format_bits()"); + return 0; + } +} diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index e79991ad41..441cf3eac6 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -208,6 +208,10 @@ extern void _mesa_format_to_type_and_comps2(gl_format format, GLenum *datatype, GLuint *comps); +extern GLint +_mesa_get_format_bits(gl_format format, GLenum pname); + + extern void _mesa_test_formats(void); -- cgit v1.2.3 From b64d478a5bd4af4128938782d787abe02a0896ee Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 19:38:21 -0600 Subject: mesa: use _mesa_get_format_bits() --- src/mesa/main/texparam.c | 47 +++++++++++++++++++++++------------------------ 1 file changed, 23 insertions(+), 24 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index b2fbe2205b..1a88ad53b4 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -31,9 +31,10 @@ #include "main/glheader.h" +#include "main/colormac.h" #include "main/context.h" #include "main/enums.h" -#include "main/colormac.h" +#include "main/formats.h" #include "main/macros.h" #include "main/texcompress.h" #include "main/texparam.h" @@ -782,20 +783,10 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, *params = img->Border; break; case GL_TEXTURE_RED_SIZE: - if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA) - *params = img->TexFormat->RedBits; - else - *params = 0; - break; case GL_TEXTURE_GREEN_SIZE: - if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA) - *params = img->TexFormat->GreenBits; - else - *params = 0; - break; case GL_TEXTURE_BLUE_SIZE: if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA) - *params = img->TexFormat->BlueBits; + *params = _mesa_get_format_bits(img->TexFormat->MesaFormat, pname); else *params = 0; break; @@ -803,36 +794,44 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, if (img->_BaseFormat == GL_ALPHA || img->_BaseFormat == GL_LUMINANCE_ALPHA || img->_BaseFormat == GL_RGBA) - *params = img->TexFormat->AlphaBits; + *params = _mesa_get_format_bits(img->TexFormat->MesaFormat, pname); else *params = 0; break; case GL_TEXTURE_INTENSITY_SIZE: if (img->_BaseFormat != GL_INTENSITY) *params = 0; - else if (img->TexFormat->IntensityBits > 0) - *params = img->TexFormat->IntensityBits; - else /* intensity probably stored as rgb texture */ - *params = MIN2(img->TexFormat->RedBits, img->TexFormat->GreenBits); + else { + *params = _mesa_get_format_bits(img->TexFormat->MesaFormat, pname); + if (*params == 0) { + /* intensity probably stored as rgb texture */ + *params = MIN2(_mesa_get_format_bits(img->TexFormat->MesaFormat, GL_TEXTURE_RED_SIZE), + _mesa_get_format_bits(img->TexFormat->MesaFormat, GL_TEXTURE_GREEN_SIZE)); + } + } break; case GL_TEXTURE_LUMINANCE_SIZE: if (img->_BaseFormat != GL_LUMINANCE && img->_BaseFormat != GL_LUMINANCE_ALPHA) *params = 0; - else if (img->TexFormat->LuminanceBits > 0) - *params = img->TexFormat->LuminanceBits; - else /* luminance probably stored as rgb texture */ - *params = MIN2(img->TexFormat->RedBits, img->TexFormat->GreenBits); + else { + *params = _mesa_get_format_bits(img->TexFormat->MesaFormat, pname); + if (img->TexFormat->LuminanceBits == 0) { + /* luminance probably stored as rgb texture */ + *params = MIN2(_mesa_get_format_bits(img->TexFormat->MesaFormat, GL_TEXTURE_RED_SIZE), + _mesa_get_format_bits(img->TexFormat->MesaFormat, GL_TEXTURE_GREEN_SIZE)); + } + } break; case GL_TEXTURE_INDEX_SIZE_EXT: if (img->_BaseFormat == GL_COLOR_INDEX) - *params = img->TexFormat->IndexBits; + *params = _mesa_get_format_bits(img->TexFormat->MesaFormat, pname); else *params = 0; break; case GL_TEXTURE_DEPTH_SIZE_ARB: if (ctx->Extensions.ARB_depth_texture) - *params = img->TexFormat->DepthBits; + *params = _mesa_get_format_bits(img->TexFormat->MesaFormat, pname); else _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexLevelParameter[if]v(pname)"); @@ -840,7 +839,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, case GL_TEXTURE_STENCIL_SIZE_EXT: if (ctx->Extensions.EXT_packed_depth_stencil || ctx->Extensions.ARB_framebuffer_object) { - *params = img->TexFormat->StencilBits; + *params = _mesa_get_format_bits(img->TexFormat->MesaFormat, pname); } else { _mesa_error(ctx, GL_INVALID_ENUM, -- cgit v1.2.3 From 5ab5f16919f6aaa19f5c92fd562e43dee18e30bc Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 19:42:36 -0600 Subject: mesa: added _mesa_get_format_datatype() --- src/mesa/main/formats.c | 8 ++++++++ src/mesa/main/formats.h | 3 +++ 2 files changed, 11 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index 62a2d70744..afa2398ed4 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -816,3 +816,11 @@ _mesa_get_format_bits(gl_format format, GLenum pname) return 0; } } + + +GLenum +_mesa_get_format_datatype(gl_format format) +{ + const struct gl_format_info *info = _mesa_get_format_info(format); + return info->DataType; +} diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index 441cf3eac6..ad93fef2fc 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -211,6 +211,9 @@ _mesa_format_to_type_and_comps2(gl_format format, extern GLint _mesa_get_format_bits(gl_format format, GLenum pname); +extern GLenum +_mesa_get_format_datatype(gl_format format); + extern void _mesa_test_formats(void); -- cgit v1.2.3 From db8aca3a398e16f7dc23d3321787274d07d13138 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 19:49:51 -0600 Subject: mesa: use _mesa_get_format_bytes() --- src/mesa/main/mipmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 5b70200cd5..faa6c47cb7 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -28,6 +28,7 @@ */ #include "imports.h" +#include "formats.h" #include "mipmap.h" #include "texcompress.h" #include "texformat.h" @@ -1641,7 +1642,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, ASSERT(dstData); } else { - bytesPerTexel = dstImage->TexFormat->TexelBytes; + bytesPerTexel = _mesa_get_format_bytes(dstImage->TexFormat->MesaFormat); ASSERT(dstWidth * dstHeight * dstDepth * bytesPerTexel > 0); dstImage->Data = _mesa_alloc_texmemory(dstWidth * dstHeight * dstDepth * bytesPerTexel); -- cgit v1.2.3 From 2de768328067fa42501bdd4b753490e7a00167a4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 19:51:45 -0600 Subject: mesa: use _mesa_get_format_base_format() --- src/mesa/drivers/common/meta.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index b445323aab..94cfdfe533 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -43,6 +43,7 @@ #include "main/depth.h" #include "main/enable.h" #include "main/fbobject.h" +#include "main/formats.h" #include "main/image.h" #include "main/macros.h" #include "main/matrix.h" @@ -2406,7 +2407,7 @@ copy_tex_sub_image(GLcontext *ctx, GLuint dims, GLenum target, GLint level, texObj = _mesa_select_tex_object(ctx, texUnit, target); texImage = _mesa_select_tex_image(ctx, texObj, target, level); - format = texImage->TexFormat->BaseFormat; + format = _mesa_get_format_base_format(texImage->TexFormat->MesaFormat); type = get_temp_image_type(ctx, format); bpp = _mesa_bytes_per_pixel(format, type); if (bpp <= 0) { -- cgit v1.2.3 From 21db8959c1134b43c9fe6d6179ee8fd9cde0b911 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 19:53:54 -0600 Subject: glide: use _mesa_get_format_bytes() --- src/mesa/drivers/glide/fxddtex.c | 5 +++-- src/mesa/drivers/glide/fxsetup.c | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c index a63301d964..035c2ab92a 100644 --- a/src/mesa/drivers/glide/fxddtex.c +++ b/src/mesa/drivers/glide/fxddtex.c @@ -40,6 +40,7 @@ #include "fxdrv.h" #include "main/enums.h" +#include "main/formats.h" #include "main/image.h" #include "main/teximage.h" #include "main/texstore.h" @@ -1396,7 +1397,7 @@ fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level, texImage->TexFormat = (*ctx->Driver.ChooseTextureFormat)(ctx, internalFormat, format, type); assert(texImage->TexFormat); - texelBytes = texImage->TexFormat->TexelBytes; + texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); /*if (!fxMesa->HaveTexFmt) assert(texelBytes == 1 || texelBytes == 2);*/ mml->glideFormat = fxGlideFormat(texImage->TexFormat->MesaFormat); @@ -1531,7 +1532,7 @@ fxDDTexSubImage2D(GLcontext * ctx, GLenum target, GLint level, assert(texImage->Data); /* must have an existing texture image! */ assert(texImage->_BaseFormat); - texelBytes = texImage->TexFormat->TexelBytes; + texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); if (texImage->IsCompressed) { dstRowStride = _mesa_compressed_row_stride(texImage->InternalFormat, mml->width); } else { diff --git a/src/mesa/drivers/glide/fxsetup.c b/src/mesa/drivers/glide/fxsetup.c index d48726a62a..9bf37967cd 100644 --- a/src/mesa/drivers/glide/fxsetup.c +++ b/src/mesa/drivers/glide/fxsetup.c @@ -42,6 +42,7 @@ #include "fxdrv.h" #include "main/enums.h" +#include "main/formats.h" #include "main/texstore.h" #include "tnl/tnl.h" #include "tnl/t_context.h" @@ -91,7 +92,7 @@ fxTexValidate(GLcontext * ctx, struct gl_texture_object *tObj) GLint _w, _h, maxSize = 1 << fxMesa->textureMaxLod; if ((mml->width > maxSize) || (mml->height > maxSize)) { /* need to rescale */ - GLint texelBytes = texImage->TexFormat->TexelBytes; + GLint texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); GLvoid *texImage_Data = texImage->Data; _w = MIN2(texImage->Width, maxSize); _h = MIN2(texImage->Height, maxSize); -- cgit v1.2.3 From b58bc12ed4a3de6c828bd26c4820d7ddbb1eabd6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 19:58:18 -0600 Subject: via: use mesa texture format helper functions --- src/mesa/drivers/dri/unichrome/via_tex.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/unichrome/via_tex.c b/src/mesa/drivers/dri/unichrome/via_tex.c index 388fd9392c..02a0043bbe 100644 --- a/src/mesa/drivers/dri/unichrome/via_tex.c +++ b/src/mesa/drivers/dri/unichrome/via_tex.c @@ -30,6 +30,7 @@ #include "main/macros.h" #include "main/mtypes.h" #include "main/enums.h" +#include "main/formats.h" #include "main/colortab.h" #include "main/convolve.h" #include "main/context.h" @@ -689,15 +690,9 @@ static void viaTexImage(GLcontext *ctx, assert(texImage->TexFormat); - if (dims == 1) { - texImage->FetchTexelc = texImage->TexFormat->FetchTexel1D; - texImage->FetchTexelf = texImage->TexFormat->FetchTexel1Df; - } - else { - texImage->FetchTexelc = texImage->TexFormat->FetchTexel2D; - texImage->FetchTexelf = texImage->TexFormat->FetchTexel2Df; - } - texelBytes = texImage->TexFormat->TexelBytes; + _mesa_set_fetch_functions(texImage, dims); + + texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); if (texelBytes == 0) { /* compressed format */ @@ -804,7 +799,7 @@ static void viaTexImage(GLcontext *ctx, dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, width); } else { - dstRowStride = postConvWidth * texImage->TexFormat->TexelBytes; + dstRowStride = postConvWidth * _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); } ASSERT(storeImage); success = storeImage(ctx, dims, -- cgit v1.2.3 From e0bc4533ebccbfb844522e2b6ddd171b97d693e8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 20:07:41 -0600 Subject: mesa/drivers: use _mesa_get_format_bytes() --- src/mesa/drivers/dri/intel/intel_tex_image.c | 5 ++--- src/mesa/drivers/dri/intel/intel_tex_subimage.c | 2 +- src/mesa/drivers/dri/mga/mgatexmem.c | 2 +- src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c | 2 +- src/mesa/drivers/dri/radeon/radeon_texture.c | 12 ++++++------ src/mesa/drivers/dri/sis/sis_tex.c | 4 ++-- src/mesa/drivers/dri/tdfx/tdfx_tex.c | 4 ++-- 7 files changed, 15 insertions(+), 16 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index aa36390689..5c98860cda 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -333,8 +333,7 @@ intelTexImage(GLcontext * ctx, _mesa_set_fetch_functions(texImage, dims); - if (texImage->TexFormat->TexelBytes == 0) { - /* must be a compressed format */ + if (_mesa_is_format_compressed(texImage->TexFormat->MesaFormat)) { texelBytes = 0; texImage->IsCompressed = GL_TRUE; texImage->CompressedSize = @@ -342,7 +341,7 @@ intelTexImage(GLcontext * ctx, texImage->Height, texImage->Depth, texImage->TexFormat->MesaFormat); } else { - texelBytes = texImage->TexFormat->TexelBytes; + texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); /* Minimum pitch of 32 bytes */ if (postConvWidth * texelBytes < 32) { diff --git a/src/mesa/drivers/dri/intel/intel_tex_subimage.c b/src/mesa/drivers/dri/intel/intel_tex_subimage.c index f75d2ae004..c8de38bc72 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_subimage.c +++ b/src/mesa/drivers/dri/intel/intel_tex_subimage.c @@ -91,7 +91,7 @@ intelTexSubimage(GLcontext * ctx, assert(dims != 3); } else { - dstRowStride = texImage->RowStride * texImage->TexFormat->TexelBytes; + dstRowStride = texImage->RowStride * _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); } } diff --git a/src/mesa/drivers/dri/mga/mgatexmem.c b/src/mesa/drivers/dri/mga/mgatexmem.c index 9a2d62b53b..86816c0d81 100644 --- a/src/mesa/drivers/dri/mga/mgatexmem.c +++ b/src/mesa/drivers/dri/mga/mgatexmem.c @@ -137,7 +137,7 @@ static void mgaUploadSubImage( mgaContextPtr mmesa, * directly used by the hardware for texturing. */ - texelBytes = texImage->TexFormat->TexelBytes; + texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); length = texImage->Width * texImage->Height * texelBytes; if ( t->base.heap->heapId == MGA_CARD_HEAP ) { unsigned tex_offset = 0; diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c index 38db305e2a..11c21037c4 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c @@ -325,7 +325,7 @@ GLboolean radeon_miptree_matches_image(radeon_mipmap_tree *mt, if (!texImage->IsCompressed && !mt->compressed && - texImage->TexFormat->TexelBytes != mt->bpp) + _mesa_get_format_bytes(texImage->TexFormat->MesaFormat) != mt->bpp) return GL_FALSE; lvl = &mt->levels[level - mt->firstLevel]; diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 4a22131486..a35c783d2e 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -544,7 +544,7 @@ static void radeon_teximage( texImage->TexFormat = radeonChooseTextureFormat(ctx, internalFormat, format, type, 0); _mesa_set_fetch_functions(texImage, dims); - if (texImage->TexFormat->TexelBytes == 0) { + if (_mesa_is_format_compressed(texImage->TexFormat->MesaFormat)) { texelBytes = 0; texImage->IsCompressed = GL_TRUE; texImage->CompressedSize = @@ -555,7 +555,7 @@ static void radeon_teximage( texImage->IsCompressed = GL_FALSE; texImage->CompressedSize = 0; - texelBytes = texImage->TexFormat->TexelBytes; + texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); /* Minimum pitch of 32 bytes */ if (postConvWidth * texelBytes < 32) { postConvWidth = 32 / texelBytes; @@ -593,7 +593,7 @@ static void radeon_teximage( if (texImage->IsCompressed) { size = texImage->CompressedSize; } else { - size = texImage->Width * texImage->Height * texImage->Depth * texImage->TexFormat->TexelBytes; + size = texImage->Width * texImage->Height * texImage->Depth * _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); } texImage->Data = _mesa_alloc_texmemory(size); } @@ -631,7 +631,7 @@ static void radeon_teximage( radeon_mipmap_level *lvl = &image->mt->levels[image->mtlevel]; dstRowStride = lvl->rowstride; } else { - dstRowStride = texImage->Width * texImage->TexFormat->TexelBytes; + dstRowStride = texImage->Width * _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); } if (dims == 3) { @@ -642,7 +642,7 @@ static void radeon_teximage( _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage"); for (i = 0; i < depth; ++i) { - dstImageOffsets[i] = dstRowStride/texImage->TexFormat->TexelBytes * height * i; + dstImageOffsets[i] = dstRowStride/_mesa_get_format_bytes(texImage->TexFormat->MesaFormat) * height * i; } } else { dstImageOffsets = texImage->ImageOffsets; @@ -757,7 +757,7 @@ static void radeon_texsubimage(GLcontext* ctx, int dims, GLenum target, int leve radeon_mipmap_level *lvl = &image->mt->levels[image->mtlevel]; dstRowStride = lvl->rowstride; } else { - dstRowStride = texImage->RowStride * texImage->TexFormat->TexelBytes; + dstRowStride = texImage->RowStride * _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); } if (compressed) { diff --git a/src/mesa/drivers/dri/sis/sis_tex.c b/src/mesa/drivers/dri/sis/sis_tex.c index 28ced6cfd5..f40a873209 100644 --- a/src/mesa/drivers/dri/sis/sis_tex.c +++ b/src/mesa/drivers/dri/sis/sis_tex.c @@ -425,7 +425,7 @@ static void sisTexSubImage1D( GLcontext *ctx, /* Upload the texture */ WaitEngIdle(smesa); - texelBytes = texImage->TexFormat->TexelBytes; + texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); copySize = width * texelBytes; src = (char *)texImage->Data + xoffset * texelBytes; @@ -513,7 +513,7 @@ static void sisTexSubImage2D( GLcontext *ctx, /* Upload the texture */ WaitEngIdle(smesa); - texelBytes = texImage->TexFormat->TexelBytes; + texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); copySize = width * texelBytes; src = (char *)texImage->Data + (xoffset + yoffset * texImage->Width) * diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tex.c b/src/mesa/drivers/dri/tdfx/tdfx_tex.c index 91650088b9..e87ee9eba2 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_tex.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_tex.c @@ -1407,7 +1407,7 @@ tdfxTexImage2D(GLcontext *ctx, GLenum target, GLint level, mml->glideFormat = fxGlideFormat(mesaFormat); ti->info.format = mml->glideFormat; texImage->FetchTexelc = fxFetchFunction(mesaFormat); - texelBytes = texImage->TexFormat->TexelBytes; + texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); if (texImage->IsCompressed) { texImage->CompressedSize = _mesa_compressed_texture_size(ctx, @@ -1494,7 +1494,7 @@ tdfxTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, assert(texImage->Data); /* must have an existing texture image! */ assert(texImage->_BaseFormat); - texelBytes = texImage->TexFormat->TexelBytes; + texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); if (texImage->IsCompressed) { dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, mml->width); } else { -- cgit v1.2.3 From 9fbb8884f034e0d691fed0e099d4d796f3b42848 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 20:24:59 -0600 Subject: mesa/drivers: use _mesa_get_format_bytes() --- src/mesa/drivers/dri/i810/i810texmem.c | 59 +++++++++++++----------- src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 2 +- src/mesa/drivers/dri/intel/intel_tex_image.c | 10 +++- src/mesa/drivers/dri/intel/intel_tex_validate.c | 3 +- src/mesa/drivers/dri/mach64/mach64_texmem.c | 16 +++++-- src/mesa/drivers/dri/mach64/mach64_texstate.c | 2 +- src/mesa/drivers/dri/mga/mga_texstate.c | 2 +- src/mesa/drivers/dri/r128/r128_texmem.c | 8 ++-- src/mesa/drivers/dri/r128/r128_texstate.c | 2 +- src/mesa/drivers/dri/r200/r200_texstate.c | 2 +- src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c | 9 +++- src/mesa/drivers/dri/radeon/radeon_texstate.c | 2 +- src/mesa/drivers/dri/radeon/radeon_texture.c | 2 +- src/mesa/drivers/dri/sis/sis_tex.c | 2 +- 14 files changed, 72 insertions(+), 49 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i810/i810texmem.c b/src/mesa/drivers/dri/i810/i810texmem.c index 5ad66dbf5c..8cbe38f5fc 100644 --- a/src/mesa/drivers/dri/i810/i810texmem.c +++ b/src/mesa/drivers/dri/i810/i810texmem.c @@ -92,44 +92,47 @@ static void i810UploadTexLevel( i810ContextPtr imesa, { const struct gl_texture_image *image = t->image[hwlevel].image; int j; + GLuint texelBytes; if (!image || !image->Data) return; - if (image->Width * image->TexFormat->TexelBytes == t->Pitch) { + texelBytes = _mesa_get_format_bytes(image->TexFormat->MesaFormat); + + if (image->Width * texelBytes == t->Pitch) { GLubyte *dst = (GLubyte *)(t->BufAddr + t->image[hwlevel].offset); GLubyte *src = (GLubyte *)image->Data; memcpy( dst, src, t->Pitch * image->Height ); } - else switch (image->TexFormat->TexelBytes) { - case 1: - { - GLubyte *dst = (GLubyte *)(t->BufAddr + t->image[hwlevel].offset); - GLubyte *src = (GLubyte *)image->Data; - - for (j = 0 ; j < image->Height ; j++, dst += t->Pitch) { - __memcpy(dst, src, image->Width ); - src += image->Width; - } + else { + switch (texelBytes) { + case 1: + { + GLubyte *dst = (GLubyte *)(t->BufAddr + t->image[hwlevel].offset); + GLubyte *src = (GLubyte *)image->Data; + + for (j = 0 ; j < image->Height ; j++, dst += t->Pitch) { + __memcpy(dst, src, image->Width ); + src += image->Width; + } + } + break; + case 2: + { + GLushort *dst = (GLushort *)(t->BufAddr + t->image[hwlevel].offset); + GLushort *src = (GLushort *)image->Data; + + for (j = 0 ; j < image->Height ; j++, dst += (t->Pitch/2)) { + __memcpy(dst, src, image->Width * 2 ); + src += image->Width; + } + } + break; + default: + fprintf(stderr, "%s: Not supported texel size %d\n", + __FUNCTION__, texelBytes); } - break; - - case 2: - { - GLushort *dst = (GLushort *)(t->BufAddr + t->image[hwlevel].offset); - GLushort *src = (GLushort *)image->Data; - - for (j = 0 ; j < image->Height ; j++, dst += (t->Pitch/2)) { - __memcpy(dst, src, image->Width * 2 ); - src += image->Width; - } - } - break; - - default: - fprintf(stderr, "%s: Not supported texel size %d\n", - __FUNCTION__, image->TexFormat->TexelBytes); } } diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c index c985da5aa2..188333c75f 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@ -307,7 +307,7 @@ intel_miptree_match_image(struct intel_mipmap_tree *mt, if (!image->IsCompressed && !mt->compressed && - image->TexFormat->TexelBytes != mt->cpp) + _mesa_get_format_bytes(image->TexFormat->MesaFormat) != mt->cpp) return GL_FALSE; /* Test image dimensions against the base level image adjusted for diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index 5c98860cda..3bafbba371 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -70,6 +70,7 @@ guess_and_alloc_mipmap_tree(struct intel_context *intel, GLuint depth = intelImage->base.Depth; GLuint l2width, l2height, l2depth; GLuint i, comp_byte = 0; + GLuint texelBytes; DBG("%s\n", __FUNCTION__); @@ -126,6 +127,9 @@ guess_and_alloc_mipmap_tree(struct intel_context *intel, assert(!intelObj->mt); if (intelImage->base.IsCompressed) comp_byte = intel_compressed_num_bytes(intelImage->base.TexFormat->MesaFormat); + + texelBytes = _mesa_get_format_bytes(intelImage->base.TexFormat->MesaFormat); + intelObj->mt = intel_miptree_create(intel, intelObj->base.Target, intelImage->base._BaseFormat, @@ -135,7 +139,7 @@ guess_and_alloc_mipmap_tree(struct intel_context *intel, width, height, depth, - intelImage->base.TexFormat->TexelBytes, + texelBytes, comp_byte, expect_accelerated_upload); @@ -399,12 +403,14 @@ intelTexImage(GLcontext * ctx, assert(intelImage->mt); } else if (intelImage->base.Border == 0) { int comp_byte = 0; + GLuint texelBytes = _mesa_get_format_bytes(intelImage->base.TexFormat->MesaFormat); if (intelImage->base.IsCompressed) { comp_byte = intel_compressed_num_bytes(intelImage->base.TexFormat->MesaFormat); } + /* Didn't fit in the object miptree, but it's suitable for inclusion in * a miptree, so create one just for our level and store it in the image. * It'll get moved into the object miptree at validate time. @@ -414,7 +420,7 @@ intelTexImage(GLcontext * ctx, internalFormat, level, level, width, height, depth, - intelImage->base.TexFormat->TexelBytes, + texelBytes, comp_byte, pixels == NULL); } diff --git a/src/mesa/drivers/dri/intel/intel_tex_validate.c b/src/mesa/drivers/dri/intel/intel_tex_validate.c index a284d5475f..0393d7915a 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_validate.c +++ b/src/mesa/drivers/dri/intel/intel_tex_validate.c @@ -169,7 +169,8 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit) comp_byte = intel_compressed_num_bytes(firstImage->base.TexFormat->MesaFormat); cpp = comp_byte; } - else cpp = firstImage->base.TexFormat->TexelBytes; + else + cpp = _mesa_get_format_bytes(firstImage->base.TexFormat->MesaFormat); /* Check tree can hold all active levels. Check tree matches * target, imageFormat, etc. diff --git a/src/mesa/drivers/dri/mach64/mach64_texmem.c b/src/mesa/drivers/dri/mach64/mach64_texmem.c index 734e547952..843b231051 100644 --- a/src/mesa/drivers/dri/mach64/mach64_texmem.c +++ b/src/mesa/drivers/dri/mach64/mach64_texmem.c @@ -76,6 +76,7 @@ static void mach64UploadAGPSubImage( mach64ContextPtr mmesa, struct gl_texture_image *image; int texelsPerDword = 0; int dwords; + GLuint texelBytes; /* Ensure we have a valid texture to upload */ if ( ( level < 0 ) || ( level > mmesa->glCtx->Const.MaxTextureLevels ) ) @@ -85,7 +86,9 @@ static void mach64UploadAGPSubImage( mach64ContextPtr mmesa, if ( !image ) return; - switch ( image->TexFormat->TexelBytes ) { + texelBytes = _mesa_get_format_bytes(image->TexFormat->MesaFormat); + + switch ( texelBytes ) { case 1: texelsPerDword = 4; break; case 2: texelsPerDword = 2; break; case 4: texelsPerDword = 1; break; @@ -118,8 +121,8 @@ static void mach64UploadAGPSubImage( mach64ContextPtr mmesa, { CARD32 *dst = (CARD32 *)((char *)mach64Screen->agpTextures.map + t->base.memBlock->ofs); const GLubyte *src = (const GLubyte *) image->Data + - (y * image->Width + x) * image->TexFormat->TexelBytes; - const GLuint bytes = width * height * image->TexFormat->TexelBytes; + (y * image->Width + x) * texelBytes; + const GLuint bytes = width * height * texelBytes; memcpy(dst, src, bytes); } @@ -140,6 +143,7 @@ static void mach64UploadLocalSubImage( mach64ContextPtr mmesa, const int maxdwords = (MACH64_BUFFER_MAX_DWORDS - (MACH64_HOSTDATA_BLIT_OFFSET / 4)); CARD32 pitch, offset; int i; + GLuint texelBytes; /* Ensure we have a valid texture to upload */ if ( ( level < 0 ) || ( level > mmesa->glCtx->Const.MaxTextureLevels ) ) @@ -149,7 +153,9 @@ static void mach64UploadLocalSubImage( mach64ContextPtr mmesa, if ( !image ) return; - switch ( image->TexFormat->TexelBytes ) { + texelBytes = _mesa_get_format_bytes(image->TexFormat->MesaFormat); + + switch ( texelBytes ) { case 1: texelsPerDword = 4; break; case 2: texelsPerDword = 2; break; case 4: texelsPerDword = 1; break; @@ -259,7 +265,7 @@ static void mach64UploadLocalSubImage( mach64ContextPtr mmesa, { const GLubyte *src = (const GLubyte *) image->Data + - (y * image->Width + x) * image->TexFormat->TexelBytes; + (y * image->Width + x) * texelBytes; mach64FireBlitLocked( mmesa, (void *)src, offset, pitch, format, x, y, width, height ); diff --git a/src/mesa/drivers/dri/mach64/mach64_texstate.c b/src/mesa/drivers/dri/mach64/mach64_texstate.c index fd2369dd88..ff03b0c40a 100644 --- a/src/mesa/drivers/dri/mach64/mach64_texstate.c +++ b/src/mesa/drivers/dri/mach64/mach64_texstate.c @@ -89,7 +89,7 @@ static void mach64SetTexImages( mach64ContextPtr mmesa, totalSize = ( baseImage->Height * baseImage->Width * - baseImage->TexFormat->TexelBytes ); + _mesa_get_format_bytes(baseImage->TexFormat->MesaFormat) ); totalSize = (totalSize + 31) & ~31; diff --git a/src/mesa/drivers/dri/mga/mga_texstate.c b/src/mesa/drivers/dri/mga/mga_texstate.c index ad765d1dd7..8f78ab9bd4 100644 --- a/src/mesa/drivers/dri/mga/mga_texstate.c +++ b/src/mesa/drivers/dri/mga/mga_texstate.c @@ -131,7 +131,7 @@ mgaSetTexImages( mgaContextPtr mmesa, break; size = texImage->Width * texImage->Height * - baseImage->TexFormat->TexelBytes; + _mesa_get_format_bytes(baseImage->TexFormat->MesaFormat); t->offsets[i] = totalSize; t->base.dirty_images[0] |= (1<TexFormat->TexelBytes ) { + switch ( _mesa_get_format_bytes(image->TexFormat->MesaFormat) ) { case 1: texelsPerDword = 4; break; case 2: texelsPerDword = 2; break; case 4: texelsPerDword = 1; break; @@ -215,9 +215,11 @@ static void uploadSubImage( r128ContextPtr rmesa, r128TexObjPtr t, /* Copy the next chunck of the texture image into the blit buffer */ { + const GLuint texelBytes = + _mesa_get_format_bytes(image->TexFormat->MesaFormat); const GLubyte *src = (const GLubyte *) image->Data + - (y * image->Width + x) * image->TexFormat->TexelBytes; - const GLuint bytes = width * height * image->TexFormat->TexelBytes; + (y * image->Width + x) * texelBytes; + const GLuint bytes = width * height * texelBytes; memcpy(dst, src, bytes); } diff --git a/src/mesa/drivers/dri/r128/r128_texstate.c b/src/mesa/drivers/dri/r128/r128_texstate.c index a9c9568003..9f4f9aea2d 100644 --- a/src/mesa/drivers/dri/r128/r128_texstate.c +++ b/src/mesa/drivers/dri/r128/r128_texstate.c @@ -123,7 +123,7 @@ static void r128SetTexImages( r128ContextPtr rmesa, totalSize += (tObj->Image[0][i]->Height * tObj->Image[0][i]->Width * - tObj->Image[0][i]->TexFormat->TexelBytes); + _mesa_get_format_bytes(tObj->Image[0][i]->TexFormat->MesaFormat)); /* Offsets must be 32-byte aligned for host data blits and tiling */ totalSize = (totalSize + 31) & ~31; diff --git a/src/mesa/drivers/dri/r200/r200_texstate.c b/src/mesa/drivers/dri/r200/r200_texstate.c index c94834752e..03f0613e7a 100644 --- a/src/mesa/drivers/dri/r200/r200_texstate.c +++ b/src/mesa/drivers/dri/r200/r200_texstate.c @@ -1437,7 +1437,7 @@ static void setup_hardware_state(r200ContextPtr rmesa, radeonTexObj *t) log2Width = firstImage->WidthLog2; log2Height = firstImage->HeightLog2; log2Depth = firstImage->DepthLog2; - texelBytes = firstImage->TexFormat->TexelBytes; + texelBytes = _mesa_get_format_bytes(firstImage->TexFormat->MesaFormat); if (!t->image_override) { diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c index 11c21037c4..851474f871 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c @@ -347,6 +347,7 @@ GLboolean radeon_miptree_matches_texture(radeon_mipmap_tree *mt, struct gl_textu GLuint compressed; GLuint numfaces = 1; GLuint firstLevel, lastLevel; + GLuint texelBytes; calculate_first_last_level(texObj, &firstLevel, &lastLevel, 0, texObj->BaseLevel); if (texObj->Target == GL_TEXTURE_CUBE_MAP) @@ -354,6 +355,7 @@ GLboolean radeon_miptree_matches_texture(radeon_mipmap_tree *mt, struct gl_textu firstImage = texObj->Image[0][firstLevel]; compressed = firstImage->IsCompressed ? firstImage->TexFormat->MesaFormat : 0; + texelBytes = _mesa_get_format_bytes(firstImage->TexFormat->MesaFormat); return (mt->firstLevel == firstLevel && mt->lastLevel == lastLevel && @@ -361,7 +363,7 @@ GLboolean radeon_miptree_matches_texture(radeon_mipmap_tree *mt, struct gl_textu mt->height0 == firstImage->Height && mt->depth0 == firstImage->Depth && mt->compressed == compressed && - (!mt->compressed ? (mt->bpp == firstImage->TexFormat->TexelBytes) : 1)); + (!mt->compressed ? (mt->bpp == texelBytes) : 1)); } @@ -375,6 +377,7 @@ void radeon_try_alloc_miptree(radeonContextPtr rmesa, radeonTexObj *t, GLuint compressed = image->base.IsCompressed ? image->base.TexFormat->MesaFormat : 0; GLuint numfaces = 1; GLuint firstLevel, lastLevel; + GLuint texelBytes; assert(!t->mt); @@ -385,11 +388,13 @@ void radeon_try_alloc_miptree(radeonContextPtr rmesa, radeonTexObj *t, if (level != firstLevel || face >= numfaces) return; + texelBytes = _mesa_get_format_bytes(image->base.TexFormat->MesaFormat); + t->mt = radeon_miptree_create(rmesa, t, t->base.Target, image->base.InternalFormat, firstLevel, lastLevel, image->base.Width, image->base.Height, image->base.Depth, - image->base.TexFormat->TexelBytes, t->tile_bits, compressed); + texelBytes, t->tile_bits, compressed); } /* Although we use the image_offset[] array to store relative offsets diff --git a/src/mesa/drivers/dri/radeon/radeon_texstate.c b/src/mesa/drivers/dri/radeon/radeon_texstate.c index ae41b90efe..a00497a8f9 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texstate.c +++ b/src/mesa/drivers/dri/radeon/radeon_texstate.c @@ -1031,7 +1031,7 @@ static GLboolean setup_hardware_state(r100ContextPtr rmesa, radeonTexObj *t, int log2Width = firstImage->WidthLog2; log2Height = firstImage->HeightLog2; log2Depth = firstImage->DepthLog2; - texelBytes = firstImage->TexFormat->TexelBytes; + texelBytes = _mesa_get_format_bytes(firstImage->TexFormat->MesaFormat); if (!t->image_override) { if (VALID_FORMAT(firstImage->TexFormat->MesaFormat)) { diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index a35c783d2e..416ca1974b 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -900,7 +900,7 @@ static void migrate_image_to_miptree(radeon_mipmap_tree *mt, radeon_texture_imag srcrowstride = _mesa_compressed_row_stride(image->base.TexFormat->MesaFormat, image->base.Width); } else { height = image->base.Height * image->base.Depth; - srcrowstride = image->base.Width * image->base.TexFormat->TexelBytes; + srcrowstride = image->base.Width * _mesa_get_format_bytes(image->base.TexFormat->MesaFormat); } // if (mt->tilebits) diff --git a/src/mesa/drivers/dri/sis/sis_tex.c b/src/mesa/drivers/dri/sis/sis_tex.c index f40a873209..38a309d41f 100644 --- a/src/mesa/drivers/dri/sis/sis_tex.c +++ b/src/mesa/drivers/dri/sis/sis_tex.c @@ -107,7 +107,7 @@ sisAllocTexImage( sisContextPtr smesa, sisTexObjPtr t, int level, } assert(t->format == image->_BaseFormat); - texel_size = image->TexFormat->TexelBytes; + texel_size = _mesa_get_format_bytes(image->TexFormat->MesaFormat); size = image->Width * image->Height * texel_size + TEXTURE_HW_PLUS; addr = sisAllocFB( smesa, size, &t->image[level].handle ); -- cgit v1.2.3 From ddffe4546a81216cde4376ee49cbaa021f4d04bb Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 20:40:35 -0600 Subject: drivers: use more mesa format functions --- src/mesa/drivers/dri/intel/intel_fbo.c | 15 +++++++++------ src/mesa/drivers/dri/intel/intel_tex_image.c | 5 ++--- src/mesa/drivers/dri/r300/r300_tex.c | 7 +++++-- src/mesa/drivers/dri/r300/r300_texstate.c | 2 +- src/mesa/drivers/dri/r600/r600_tex.c | 6 ++++-- src/mesa/drivers/dri/radeon/radeon_fbo.c | 19 +++++++++++-------- 6 files changed, 32 insertions(+), 22 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 8dfb24290d..0a3d0654d7 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -466,6 +466,7 @@ intel_update_wrapper(GLcontext *ctx, struct intel_renderbuffer *irb, struct gl_texture_image *texImage) { irb->texformat = texImage->TexFormat; + gl_format texFormat; if (texImage->TexFormat == &_mesa_texformat_argb8888) { irb->Base._ActualFormat = GL_RGBA8; @@ -509,15 +510,17 @@ intel_update_wrapper(GLcontext *ctx, struct intel_renderbuffer *irb, return GL_FALSE; } + texFormat = texImage->TexFormat->MesaFormat; + irb->Base.InternalFormat = irb->Base._ActualFormat; irb->Base.Width = texImage->Width; irb->Base.Height = texImage->Height; - irb->Base.RedBits = texImage->TexFormat->RedBits; - irb->Base.GreenBits = texImage->TexFormat->GreenBits; - irb->Base.BlueBits = texImage->TexFormat->BlueBits; - irb->Base.AlphaBits = texImage->TexFormat->AlphaBits; - irb->Base.DepthBits = texImage->TexFormat->DepthBits; - irb->Base.StencilBits = texImage->TexFormat->StencilBits; + irb->Base.RedBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_RED_SIZE); + irb->Base.GreenBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_GREEN_SIZE); + irb->Base.BlueBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_BLUE_SIZE); + irb->Base.AlphaBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_ALPHA_SIZE); + irb->Base.DepthBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_DEPTH_SIZE_ARB); + irb->Base.StencilBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_STENCIL_SIZE_EXT); irb->Base.Delete = intel_delete_renderbuffer; irb->Base.AllocStorage = intel_nop_alloc_storage; diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index 3bafbba371..a9f031a3cb 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -404,19 +404,18 @@ intelTexImage(GLcontext * ctx, } else if (intelImage->base.Border == 0) { int comp_byte = 0; GLuint texelBytes = _mesa_get_format_bytes(intelImage->base.TexFormat->MesaFormat); - + GLenum baseFormat = _mesa_get_format_base_format(intelImage->base.TexFormat->MesaFormat); if (intelImage->base.IsCompressed) { comp_byte = intel_compressed_num_bytes(intelImage->base.TexFormat->MesaFormat); } - /* Didn't fit in the object miptree, but it's suitable for inclusion in * a miptree, so create one just for our level and store it in the image. * It'll get moved into the object miptree at validate time. */ intelImage->mt = intel_miptree_create(intel, target, - intelImage->base.TexFormat->BaseFormat, + baseFormat, internalFormat, level, level, width, height, depth, diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c index 433e5a87d4..10daeca9e6 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.c +++ b/src/mesa/drivers/dri/r300/r300_tex.c @@ -196,6 +196,7 @@ static void r300TexParameter(GLcontext * ctx, GLenum target, GLenum pname, const GLfloat * params) { radeonTexObj* t = radeon_tex_obj(texObj); + GLenum texBaseFormat; if (RADEON_DEBUG & (RADEON_STATE | RADEON_TEXTURE)) { fprintf(stderr, "%s( %s )\n", __FUNCTION__, @@ -238,8 +239,10 @@ static void r300TexParameter(GLcontext * ctx, GLenum target, case GL_DEPTH_TEXTURE_MODE: if (!texObj->Image[0][texObj->BaseLevel]) return; - if (texObj->Image[0][texObj->BaseLevel]->TexFormat->BaseFormat - == GL_DEPTH_COMPONENT) { + texBaseFormat = texObj->Image[0][texObj->BaseLevel]->_BaseFormat; + + if (texBaseFormat == GL_DEPTH_COMPONENT || + texBaseFormat == GL_DEPTH_STENCIL) { r300SetDepthTexMode(texObj); break; } else { diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index f030451b28..cc40e0d1dc 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -209,7 +209,7 @@ static void setup_hardware_state(r300ContextPtr rmesa, radeonTexObj *t) if (!t->image_override && VALID_FORMAT(firstImage->TexFormat->MesaFormat)) { - if (firstImage->TexFormat->BaseFormat == GL_DEPTH_COMPONENT) { + if (firstImage->_BaseFormat == GL_DEPTH_COMPONENT) { r300SetDepthTexMode(&t->base); } else { t->pp_txformat = tx_table[firstImage->TexFormat->MesaFormat].format; diff --git a/src/mesa/drivers/dri/r600/r600_tex.c b/src/mesa/drivers/dri/r600/r600_tex.c index d105b90cd1..47081c968e 100644 --- a/src/mesa/drivers/dri/r600/r600_tex.c +++ b/src/mesa/drivers/dri/r600/r600_tex.c @@ -286,6 +286,7 @@ static void r600TexParameter(GLcontext * ctx, GLenum target, GLenum pname, const GLfloat * params) { radeonTexObj* t = radeon_tex_obj(texObj); + GLenum baseFormat; radeon_print(RADEON_STATE | RADEON_TEXTURE, RADEON_VERBOSE, "%s( %s )\n", __FUNCTION__, @@ -327,8 +328,9 @@ static void r600TexParameter(GLcontext * ctx, GLenum target, case GL_DEPTH_TEXTURE_MODE: if (!texObj->Image[0][texObj->BaseLevel]) return; - if (texObj->Image[0][texObj->BaseLevel]->TexFormat->BaseFormat - == GL_DEPTH_COMPONENT) { + baseFormat = texObj->Image[0][texObj->BaseLevel]->_BaseFormat; + if (baseFormat == GL_DEPTH_COMPONENT || + baseFormat == GL_DEPTH_STENCIL) { r600SetDepthTexMode(texObj); break; } else { diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index 7ac53ec0ca..f19170b612 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -387,6 +387,8 @@ radeon_update_wrapper(GLcontext *ctx, struct radeon_renderbuffer *rrb, struct gl_texture_image *texImage) { int retry = 0; + gl_format texFormat; + restart: if (texImage->TexFormat == &_mesa_texformat_argb8888) { rrb->cpp = 4; @@ -438,24 +440,25 @@ restart: return GL_FALSE; } texImage->TexFormat = radeonChooseTextureFormat(ctx, texImage->InternalFormat, 0, - texImage->TexFormat->DataType, + _mesa_get_format_datatype(texImage->TexFormat->MesaFormat), 1); retry++; goto restart; } + texFormat = texImage->TexFormat->MesaFormat; + rrb->pitch = texImage->Width * rrb->cpp; rrb->base.InternalFormat = rrb->base._ActualFormat; rrb->base.Width = texImage->Width; rrb->base.Height = texImage->Height; - rrb->base.RedBits = texImage->TexFormat->RedBits; - rrb->base.GreenBits = texImage->TexFormat->GreenBits; - rrb->base.BlueBits = texImage->TexFormat->BlueBits; - rrb->base.AlphaBits = texImage->TexFormat->AlphaBits; - rrb->base.DepthBits = texImage->TexFormat->DepthBits; - rrb->base.StencilBits = texImage->TexFormat->StencilBits; - + rrb->Base.RedBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_RED_SIZE); + rrb->Base.GreenBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_GREEN_SIZE); + rrb->Base.BlueBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_BLUE_SIZE); + rrb->Base.AlphaBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_ALPHA_SIZE); + rrb->Base.DepthBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_DEPTH_SIZE_ARB); + rrb->Base.StencilBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_STENCIL_SIZE_EXT); rrb->base.Delete = radeon_delete_renderbuffer; rrb->base.AllocStorage = radeon_nop_alloc_storage; -- cgit v1.2.3 From 5978cbdf7728df7952c9c04165ece23394a5fb95 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 20:40:53 -0600 Subject: mesa: code movement --- src/mesa/main/formats.c | 78 ++++++++++++++++++++++++------------------------- src/mesa/main/formats.h | 13 ++++----- 2 files changed, 45 insertions(+), 46 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index afa2398ed4..2ad5685883 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -594,6 +594,45 @@ _mesa_get_format_bytes(gl_format format) } +GLint +_mesa_get_format_bits(gl_format format, GLenum pname) +{ + const struct gl_format_info *info = _mesa_get_format_info(format); + + switch (pname) { + case GL_TEXTURE_RED_SIZE: + return info->RedBits; + case GL_TEXTURE_GREEN_SIZE: + return info->GreenBits; + case GL_TEXTURE_BLUE_SIZE: + return info->BlueBits; + case GL_TEXTURE_ALPHA_SIZE: + return info->AlphaBits; + case GL_TEXTURE_INTENSITY_SIZE: + return info->IntensityBits; + case GL_TEXTURE_LUMINANCE_SIZE: + return info->LuminanceBits; + case GL_TEXTURE_INDEX_SIZE_EXT: + return info->IndexBits; + case GL_TEXTURE_DEPTH_SIZE_ARB: + return info->DepthBits; + case GL_TEXTURE_STENCIL_SIZE_EXT: + return info->StencilBits; + default: + _mesa_problem(NULL, "bad pname in _mesa_get_format_bits()"); + return 0; + } +} + + +GLenum +_mesa_get_format_datatype(gl_format format) +{ + const struct gl_format_info *info = _mesa_get_format_info(format); + return info->DataType; +} + + GLenum _mesa_get_format_base_format(gl_format format) { @@ -785,42 +824,3 @@ _mesa_format_to_type_and_comps2(gl_format format, *datatype = GL_UNSIGNED_BYTE; } } - - -GLint -_mesa_get_format_bits(gl_format format, GLenum pname) -{ - const struct gl_format_info *info = _mesa_get_format_info(format); - - switch (pname) { - case GL_TEXTURE_RED_SIZE: - return info->RedBits; - case GL_TEXTURE_GREEN_SIZE: - return info->GreenBits; - case GL_TEXTURE_BLUE_SIZE: - return info->BlueBits; - case GL_TEXTURE_ALPHA_SIZE: - return info->AlphaBits; - case GL_TEXTURE_INTENSITY_SIZE: - return info->IntensityBits; - case GL_TEXTURE_LUMINANCE_SIZE: - return info->LuminanceBits; - case GL_TEXTURE_INDEX_SIZE_EXT: - return info->IndexBits; - case GL_TEXTURE_DEPTH_SIZE_ARB: - return info->DepthBits; - case GL_TEXTURE_STENCIL_SIZE_EXT: - return info->StencilBits; - default: - _mesa_problem(NULL, "bad pname in _mesa_get_format_bits()"); - return 0; - } -} - - -GLenum -_mesa_get_format_datatype(gl_format format) -{ - const struct gl_format_info *info = _mesa_get_format_info(format); - return info->DataType; -} diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index ad93fef2fc..dbde28e727 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -198,6 +198,12 @@ struct gl_format_info extern GLuint _mesa_get_format_bytes(gl_format format); +extern GLint +_mesa_get_format_bits(gl_format format, GLenum pname); + +extern GLenum +_mesa_get_format_datatype(gl_format format); + extern GLenum _mesa_get_format_base_format(gl_format format); @@ -208,13 +214,6 @@ extern void _mesa_format_to_type_and_comps2(gl_format format, GLenum *datatype, GLuint *comps); -extern GLint -_mesa_get_format_bits(gl_format format, GLenum pname); - -extern GLenum -_mesa_get_format_datatype(gl_format format); - - extern void _mesa_test_formats(void); -- cgit v1.2.3 From 5cf5d4be21bdac203dc244e9b773a852ddb1baf1 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 20:51:18 -0600 Subject: mesa: use more format helper functions --- src/mesa/main/fbobject.c | 14 +++++++++----- src/mesa/main/texgetimage.c | 30 ++++++++++++++++++------------ 2 files changed, 27 insertions(+), 17 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 13f49da5a7..04419da6e5 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -35,6 +35,7 @@ #include "buffers.h" #include "context.h" #include "fbobject.h" +#include "formats.h" #include "framebuffer.h" #include "hash.h" #include "macros.h" @@ -356,6 +357,7 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format, if (att->Type == GL_TEXTURE) { const struct gl_texture_object *texObj = att->Texture; struct gl_texture_image *texImage; + GLenum baseFormat; if (!texObj) { att_incomplete("no texobj"); @@ -382,26 +384,28 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format, return; } + baseFormat = _mesa_get_format_base_format(texImage->TexFormat->MesaFormat); + if (format == GL_COLOR) { - if (texImage->TexFormat->BaseFormat != GL_RGB && - texImage->TexFormat->BaseFormat != GL_RGBA) { + if (baseFormat != GL_RGB && + baseFormat != GL_RGBA) { att_incomplete("bad format"); att->Complete = GL_FALSE; return; } - if (texImage->TexFormat->TexelBytes == 0) { + if (_mesa_is_format_compressed(texImage->TexFormat->MesaFormat)) { att_incomplete("compressed internalformat"); att->Complete = GL_FALSE; return; } } else if (format == GL_DEPTH) { - if (texImage->TexFormat->BaseFormat == GL_DEPTH_COMPONENT) { + if (baseFormat == GL_DEPTH_COMPONENT) { /* OK */ } else if (ctx->Extensions.EXT_packed_depth_stencil && ctx->Extensions.ARB_depth_texture && - texImage->TexFormat->BaseFormat == GL_DEPTH_STENCIL_EXT) { + baseFormat == GL_DEPTH_STENCIL_EXT) { /* OK */ } else { diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index 14d6fc7659..2575d0d868 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -160,15 +160,16 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, if (format == GL_COLOR_INDEX) { GLuint indexRow[MAX_WIDTH]; GLint col; + GLuint indexBits = _mesa_get_format_bits(texImage->TexFormat->MesaFormat, GL_TEXTURE_INDEX_SIZE_EXT); /* Can't use FetchTexel here because that returns RGBA */ - if (texImage->TexFormat->IndexBits == 8) { + if (indexBits == 8) { const GLubyte *src = (const GLubyte *) texImage->Data; src += width * (img * texImage->Height + row); for (col = 0; col < width; col++) { indexRow[col] = src[col]; } } - else if (texImage->TexFormat->IndexBits == 16) { + else if (indexBits == 16) { const GLushort *src = (const GLushort *) texImage->Data; src += width * (img * texImage->Height + row); for (col = 0; col < width; col++) { @@ -257,6 +258,8 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, GLfloat rgba[MAX_WIDTH][4]; GLint col; GLbitfield transferOps = 0x0; + GLenum dataType = + _mesa_get_format_datatype(texImage->TexFormat->MesaFormat); /* clamp does not apply to GetTexImage (final conversion)? * Looks like we need clamp though when going from format @@ -265,8 +268,8 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, if (format == GL_LUMINANCE || format == GL_LUMINANCE_ALPHA) transferOps |= IMAGE_CLAMP_BIT; else if (!type_with_negative_values(type) && - (texImage->TexFormat->DataType == GL_FLOAT || - texImage->TexFormat->DataType == GL_SIGNED_NORMALIZED)) + (dataType == GL_FLOAT || + dataType == GL_SIGNED_NORMALIZED)) transferOps |= IMAGE_CLAMP_BIT; for (col = 0; col < width; col++) { @@ -372,6 +375,7 @@ getteximage_error_check(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_object *texObj; struct gl_texture_image *texImage; const GLuint maxLevels = _mesa_max_texture_levels(ctx, target); + GLenum baseFormat; if (maxLevels == 0) { _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(target=0x%x)", target); @@ -434,40 +438,42 @@ getteximage_error_check(GLcontext *ctx, GLenum target, GLint level, /* out of memory */ return GL_TRUE; } + + baseFormat = _mesa_get_format_base_format(texImage->TexFormat->MesaFormat); /* Make sure the requested image format is compatible with the * texture's format. Note that a color index texture can be converted * to RGBA so that combo is allowed. */ if (_mesa_is_color_format(format) - && !_mesa_is_color_format(texImage->TexFormat->BaseFormat) - && !_mesa_is_index_format(texImage->TexFormat->BaseFormat)) { + && !_mesa_is_color_format(baseFormat) + && !_mesa_is_index_format(baseFormat)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); return GL_TRUE; } else if (_mesa_is_index_format(format) - && !_mesa_is_index_format(texImage->TexFormat->BaseFormat)) { + && !_mesa_is_index_format(baseFormat)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); return GL_TRUE; } else if (_mesa_is_depth_format(format) - && !_mesa_is_depth_format(texImage->TexFormat->BaseFormat) - && !_mesa_is_depthstencil_format(texImage->TexFormat->BaseFormat)) { + && !_mesa_is_depth_format(baseFormat) + && !_mesa_is_depthstencil_format(baseFormat)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); return GL_TRUE; } else if (_mesa_is_ycbcr_format(format) - && !_mesa_is_ycbcr_format(texImage->TexFormat->BaseFormat)) { + && !_mesa_is_ycbcr_format(baseFormat)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); return GL_TRUE; } else if (_mesa_is_depthstencil_format(format) - && !_mesa_is_depthstencil_format(texImage->TexFormat->BaseFormat)) { + && !_mesa_is_depthstencil_format(baseFormat)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); return GL_TRUE; } else if (_mesa_is_dudv_format(format) - && !_mesa_is_dudv_format(texImage->TexFormat->BaseFormat)) { + && !_mesa_is_dudv_format(baseFormat)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetTexImage(format mismatch)"); return GL_TRUE; } -- cgit v1.2.3 From af0adb585223f6227f4c5c8564df8d7f6622d30f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 20:56:04 -0600 Subject: mesa: use more mesa format functions --- src/mesa/main/texparam.c | 48 +++++++++++++++++++++++++++++------------------- 1 file changed, 29 insertions(+), 19 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 1a88ad53b4..5f2c890ec8 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -727,6 +727,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, const struct gl_texture_image *img = NULL; GLboolean isProxy; GLint maxLevels; + gl_format texFormat; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -764,6 +765,8 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, goto out; } + texFormat = img->TexFormat->MesaFormat; + isProxy = _mesa_is_proxy_texture(target); switch (pname) { @@ -786,7 +789,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, case GL_TEXTURE_GREEN_SIZE: case GL_TEXTURE_BLUE_SIZE: if (img->_BaseFormat == GL_RGB || img->_BaseFormat == GL_RGBA) - *params = _mesa_get_format_bits(img->TexFormat->MesaFormat, pname); + *params = _mesa_get_format_bits(texFormat, pname); else *params = 0; break; @@ -794,7 +797,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, if (img->_BaseFormat == GL_ALPHA || img->_BaseFormat == GL_LUMINANCE_ALPHA || img->_BaseFormat == GL_RGBA) - *params = _mesa_get_format_bits(img->TexFormat->MesaFormat, pname); + *params = _mesa_get_format_bits(texFormat, pname); else *params = 0; break; @@ -802,11 +805,11 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, if (img->_BaseFormat != GL_INTENSITY) *params = 0; else { - *params = _mesa_get_format_bits(img->TexFormat->MesaFormat, pname); + *params = _mesa_get_format_bits(texFormat, pname); if (*params == 0) { /* intensity probably stored as rgb texture */ - *params = MIN2(_mesa_get_format_bits(img->TexFormat->MesaFormat, GL_TEXTURE_RED_SIZE), - _mesa_get_format_bits(img->TexFormat->MesaFormat, GL_TEXTURE_GREEN_SIZE)); + *params = MIN2(_mesa_get_format_bits(texFormat, GL_TEXTURE_RED_SIZE), + _mesa_get_format_bits(texFormat, GL_TEXTURE_GREEN_SIZE)); } } break; @@ -815,23 +818,23 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, img->_BaseFormat != GL_LUMINANCE_ALPHA) *params = 0; else { - *params = _mesa_get_format_bits(img->TexFormat->MesaFormat, pname); + *params = _mesa_get_format_bits(texFormat, pname); if (img->TexFormat->LuminanceBits == 0) { /* luminance probably stored as rgb texture */ - *params = MIN2(_mesa_get_format_bits(img->TexFormat->MesaFormat, GL_TEXTURE_RED_SIZE), - _mesa_get_format_bits(img->TexFormat->MesaFormat, GL_TEXTURE_GREEN_SIZE)); + *params = MIN2(_mesa_get_format_bits(texFormat, GL_TEXTURE_RED_SIZE), + _mesa_get_format_bits(texFormat, GL_TEXTURE_GREEN_SIZE)); } } break; case GL_TEXTURE_INDEX_SIZE_EXT: if (img->_BaseFormat == GL_COLOR_INDEX) - *params = _mesa_get_format_bits(img->TexFormat->MesaFormat, pname); + *params = _mesa_get_format_bits(texFormat, pname); else *params = 0; break; case GL_TEXTURE_DEPTH_SIZE_ARB: if (ctx->Extensions.ARB_depth_texture) - *params = _mesa_get_format_bits(img->TexFormat->MesaFormat, pname); + *params = _mesa_get_format_bits(texFormat, pname); else _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexLevelParameter[if]v(pname)"); @@ -839,7 +842,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, case GL_TEXTURE_STENCIL_SIZE_EXT: if (ctx->Extensions.EXT_packed_depth_stencil || ctx->Extensions.ARB_framebuffer_object) { - *params = _mesa_get_format_bits(img->TexFormat->MesaFormat, pname); + *params = _mesa_get_format_bits(texFormat, pname); } else { _mesa_error(ctx, GL_INVALID_ENUM, @@ -855,7 +858,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, */ *params = _mesa_compressed_texture_size(ctx, img->Width, img->Height, img->Depth, - img->TexFormat->MesaFormat); + texFormat); } else { _mesa_error(ctx, GL_INVALID_OPERATION, @@ -869,7 +872,8 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, /* GL_ARB_texture_float */ case GL_TEXTURE_RED_TYPE_ARB: if (ctx->Extensions.ARB_texture_float) { - *params = img->TexFormat->RedBits ? img->TexFormat->DataType : GL_NONE; + *params = _mesa_get_format_bits(texFormat, GL_TEXTURE_RED_SIZE) ? + _mesa_get_format_datatype(texFormat) : GL_NONE; } else { _mesa_error(ctx, GL_INVALID_ENUM, @@ -878,7 +882,8 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, break; case GL_TEXTURE_GREEN_TYPE_ARB: if (ctx->Extensions.ARB_texture_float) { - *params = img->TexFormat->GreenBits ? img->TexFormat->DataType : GL_NONE; + *params = _mesa_get_format_bits(texFormat, GL_TEXTURE_GREEN_SIZE) ? + _mesa_get_format_datatype(texFormat) : GL_NONE; } else { _mesa_error(ctx, GL_INVALID_ENUM, @@ -887,7 +892,8 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, break; case GL_TEXTURE_BLUE_TYPE_ARB: if (ctx->Extensions.ARB_texture_float) { - *params = img->TexFormat->BlueBits ? img->TexFormat->DataType : GL_NONE; + *params = _mesa_get_format_bits(texFormat, GL_TEXTURE_BLUE_SIZE) ? + _mesa_get_format_datatype(texFormat) : GL_NONE; } else { _mesa_error(ctx, GL_INVALID_ENUM, @@ -896,7 +902,8 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, break; case GL_TEXTURE_ALPHA_TYPE_ARB: if (ctx->Extensions.ARB_texture_float) { - *params = img->TexFormat->AlphaBits ? img->TexFormat->DataType : GL_NONE; + *params = _mesa_get_format_bits(texFormat, GL_TEXTURE_ALPHA_SIZE) ? + _mesa_get_format_datatype(texFormat) : GL_NONE; } else { _mesa_error(ctx, GL_INVALID_ENUM, @@ -905,7 +912,8 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, break; case GL_TEXTURE_LUMINANCE_TYPE_ARB: if (ctx->Extensions.ARB_texture_float) { - *params = img->TexFormat->LuminanceBits ? img->TexFormat->DataType : GL_NONE; + *params = _mesa_get_format_bits(texFormat, GL_TEXTURE_LUMINANCE_SIZE) ? + _mesa_get_format_datatype(texFormat) : GL_NONE; } else { _mesa_error(ctx, GL_INVALID_ENUM, @@ -914,7 +922,8 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, break; case GL_TEXTURE_INTENSITY_TYPE_ARB: if (ctx->Extensions.ARB_texture_float) { - *params = img->TexFormat->IntensityBits ? img->TexFormat->DataType : GL_NONE; + *params = _mesa_get_format_bits(texFormat, GL_TEXTURE_INTENSITY_SIZE) ? + _mesa_get_format_datatype(texFormat) : GL_NONE; } else { _mesa_error(ctx, GL_INVALID_ENUM, @@ -923,7 +932,8 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, break; case GL_TEXTURE_DEPTH_TYPE_ARB: if (ctx->Extensions.ARB_texture_float) { - *params = img->TexFormat->DepthBits ? img->TexFormat->DataType : GL_NONE; + *params = _mesa_get_format_bits(texFormat, GL_TEXTURE_DEPTH_SIZE) ? + _mesa_get_format_datatype(texFormat) : GL_NONE; } else { _mesa_error(ctx, GL_INVALID_ENUM, -- cgit v1.2.3 From a2b663fe38a6e42786092412402aacf8f6d071f8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 20:58:05 -0600 Subject: mesa: use more mesa format functions --- src/mesa/main/texrender.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c index 50e09c5d15..11073f76bf 100644 --- a/src/mesa/main/texrender.c +++ b/src/mesa/main/texrender.c @@ -462,6 +462,7 @@ update_wrapper(GLcontext *ctx, const struct gl_renderbuffer_attachment *att) { struct texture_renderbuffer *trb = (struct texture_renderbuffer *) att->Renderbuffer; + gl_format texFormat; (void) ctx; ASSERT(trb); @@ -484,6 +485,8 @@ update_wrapper(GLcontext *ctx, const struct gl_renderbuffer_attachment *att) trb->Zoffset = att->Zoffset; } + texFormat = trb->TexImage->TexFormat->MesaFormat; + trb->Base.Width = trb->TexImage->Width; trb->Base.Height = trb->TexImage->Height; trb->Base.InternalFormat = trb->TexImage->InternalFormat; @@ -513,12 +516,12 @@ update_wrapper(GLcontext *ctx, const struct gl_renderbuffer_attachment *att) #endif trb->Base.Data = trb->TexImage->Data; - trb->Base.RedBits = trb->TexImage->TexFormat->RedBits; - trb->Base.GreenBits = trb->TexImage->TexFormat->GreenBits; - trb->Base.BlueBits = trb->TexImage->TexFormat->BlueBits; - trb->Base.AlphaBits = trb->TexImage->TexFormat->AlphaBits; - trb->Base.DepthBits = trb->TexImage->TexFormat->DepthBits; - trb->Base.StencilBits = trb->TexImage->TexFormat->StencilBits; + trb->Base.RedBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_RED_SIZE); + trb->Base.GreenBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_GREEN_SIZE); + trb->Base.BlueBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_BLUE_SIZE); + trb->Base.AlphaBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_ALPHA_SIZE); + trb->Base.DepthBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_DEPTH_SIZE_ARB); + trb->Base.StencilBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_STENCIL_SIZE_EXT); } -- cgit v1.2.3 From 5767a677a0129015dcc568b6f5d2d323fae8a63f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 20:59:28 -0600 Subject: mesa: fix GL_TEXTURE_LUMINANCE_SIZE query --- src/mesa/main/texparam.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 5f2c890ec8..d38d5a4c23 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -819,7 +819,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, *params = 0; else { *params = _mesa_get_format_bits(texFormat, pname); - if (img->TexFormat->LuminanceBits == 0) { + if (*params == 0) { /* luminance probably stored as rgb texture */ *params = MIN2(_mesa_get_format_bits(texFormat, GL_TEXTURE_RED_SIZE), _mesa_get_format_bits(texFormat, GL_TEXTURE_GREEN_SIZE)); -- cgit v1.2.3 From e987ea9d2181acec2fc70538ffbb92d7ab15d918 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 21:07:57 -0600 Subject: mesa: use more mesa format functions --- src/mesa/main/texstore.c | 44 +++++++++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 19 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 33edf8a56a..6ebc9d6cc3 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -3352,10 +3352,12 @@ fetch_texel_float_to_chan(const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texelOut) { GLfloat temp[4]; + GLenum baseFormat = _mesa_get_format_base_format(texImage->TexFormat->MesaFormat); + ASSERT(texImage->FetchTexelf); texImage->FetchTexelf(texImage, i, j, k, temp); - if (texImage->TexFormat->BaseFormat == GL_DEPTH_COMPONENT || - texImage->TexFormat->BaseFormat == GL_DEPTH_STENCIL_EXT) { + if (baseFormat == GL_DEPTH_COMPONENT || + baseFormat == GL_DEPTH_STENCIL_EXT) { /* just one channel */ UNCLAMPED_FLOAT_TO_CHAN(texelOut[0], temp[0]); } @@ -3377,10 +3379,12 @@ fetch_texel_chan_to_float(const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texelOut) { GLchan temp[4]; + GLenum baseFormat = _mesa_get_format_base_format(texImage->TexFormat->MesaFormat); + ASSERT(texImage->FetchTexelc); texImage->FetchTexelc(texImage, i, j, k, temp); - if (texImage->TexFormat->BaseFormat == GL_DEPTH_COMPONENT || - texImage->TexFormat->BaseFormat == GL_DEPTH_STENCIL_EXT) { + if (baseFormat == GL_DEPTH_COMPONENT || + baseFormat == GL_DEPTH_STENCIL_EXT) { /* just one channel */ texelOut[0] = CHAN_TO_FLOAT(temp[0]); } @@ -3423,9 +3427,10 @@ _mesa_set_fetch_functions(struct gl_texture_image *texImage, GLuint dims) static void compute_texture_size(GLcontext *ctx, struct gl_texture_image *texImage) { - if (texImage->TexFormat->TexelBytes == 0) { - /* must be a compressed format */ - texImage->IsCompressed = GL_TRUE; + texImage->IsCompressed = + _mesa_is_format_compressed(texImage->TexFormat->MesaFormat); + + if (texImage->IsCompressed) { texImage->CompressedSize = ctx->Driver.CompressedTextureSize(ctx, texImage->Width, texImage->Height, texImage->Depth, @@ -3433,7 +3438,6 @@ compute_texture_size(GLcontext *ctx, struct gl_texture_image *texImage) } else { /* non-compressed format */ - texImage->IsCompressed = GL_FALSE; texImage->CompressedSize = 0; } } @@ -3471,7 +3475,7 @@ _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level, if (texImage->IsCompressed) sizeInBytes = texImage->CompressedSize; else - sizeInBytes = texImage->Width * texImage->TexFormat->TexelBytes; + sizeInBytes = texImage->Width * _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); texImage->Data = _mesa_alloc_texmemory(sizeInBytes); if (!texImage->Data) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D"); @@ -3540,7 +3544,7 @@ _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level, _mesa_set_fetch_functions(texImage, 2); compute_texture_size(ctx, texImage); - texelBytes = texImage->TexFormat->TexelBytes; + texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); /* allocate memory */ if (texImage->IsCompressed) @@ -3574,7 +3578,7 @@ _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level, = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, width); } else { - dstRowStride = texImage->RowStride * texImage->TexFormat->TexelBytes; + dstRowStride = texImage->RowStride * texelBytes; } success = storeImage(ctx, 2, texImage->_BaseFormat, @@ -3619,7 +3623,7 @@ _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level, _mesa_set_fetch_functions(texImage, 3); compute_texture_size(ctx, texImage); - texelBytes = texImage->TexFormat->TexelBytes; + texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); /* allocate memory */ if (texImage->IsCompressed) @@ -3653,7 +3657,7 @@ _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level, = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, width); } else { - dstRowStride = texImage->RowStride * texImage->TexFormat->TexelBytes; + dstRowStride = texImage->RowStride * texelBytes; } success = storeImage(ctx, 3, texImage->_BaseFormat, @@ -3751,7 +3755,8 @@ _mesa_store_texsubimage2d(GLcontext *ctx, GLenum target, GLint level, texImage->Width); } else { - dstRowStride = texImage->RowStride * texImage->TexFormat->TexelBytes; + dstRowStride = texImage->RowStride * + _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); } success = storeImage(ctx, 2, texImage->_BaseFormat, @@ -3804,7 +3809,8 @@ _mesa_store_texsubimage3d(GLcontext *ctx, GLenum target, GLint level, texImage->Width); } else { - dstRowStride = texImage->RowStride * texImage->TexFormat->TexelBytes; + dstRowStride = texImage->RowStride * + _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); } success = storeImage(ctx, 3, texImage->_BaseFormat, @@ -3964,7 +3970,7 @@ _mesa_store_compressed_texsubimage2d(GLcontext *ctx, GLenum target, GLint i, rows; GLubyte *dest; const GLubyte *src; - const GLuint mesaFormat = texImage->TexFormat->MesaFormat; + const gl_format texFormat = texImage->TexFormat->MesaFormat; (void) format; @@ -3981,12 +3987,12 @@ _mesa_store_compressed_texsubimage2d(GLcontext *ctx, GLenum target, if (!data) return; - srcRowStride = _mesa_compressed_row_stride(mesaFormat, width); + srcRowStride = _mesa_compressed_row_stride(texFormat, width); src = (const GLubyte *) data; - destRowStride = _mesa_compressed_row_stride(mesaFormat, texImage->Width); + destRowStride = _mesa_compressed_row_stride(texFormat, texImage->Width); dest = _mesa_compressed_image_address(xoffset, yoffset, 0, - texImage->TexFormat->MesaFormat, + texFormat, texImage->Width, (GLubyte *) texImage->Data); -- cgit v1.2.3 From 4fc344790d0fefa3c38c63cadc4ee6a52633b006 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 21:13:46 -0600 Subject: mesa: update comments --- src/mesa/main/texcompress_fxt1.c | 4 ++-- src/mesa/main/texcompress_s3tc.c | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c index 1a103ff14e..c401f82be0 100644 --- a/src/mesa/main/texcompress_fxt1.c +++ b/src/mesa/main/texcompress_fxt1.c @@ -63,7 +63,7 @@ _mesa_init_texture_fxt1( GLcontext *ctx ) /** - * Called via TexFormat->StoreImage to store an RGB_FXT1 texture. + * Store user's image in rgb_fxt1 format. */ GLboolean _mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS) @@ -120,7 +120,7 @@ _mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS) /** - * Called via TexFormat->StoreImage to store an RGBA_FXT1 texture. + * Store user's image in rgba_fxt1 format. */ GLboolean _mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS) diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c index 86492d05fb..2294fdca73 100644 --- a/src/mesa/main/texcompress_s3tc.c +++ b/src/mesa/main/texcompress_s3tc.c @@ -154,7 +154,7 @@ _mesa_init_texture_s3tc( GLcontext *ctx ) } /** - * Called via TexFormat->StoreImage to store an RGB_DXT1 texture. + * Store user's image in rgb_dxt1 format. */ GLboolean _mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS) @@ -217,7 +217,7 @@ _mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS) /** - * Called via TexFormat->StoreImage to store an RGBA_DXT1 texture. + * Store user's image in rgba_dxt1 format. */ GLboolean _mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS) @@ -279,7 +279,7 @@ _mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS) /** - * Called via TexFormat->StoreImage to store an RGBA_DXT3 texture. + * Store user's image in rgba_dxt3 format. */ GLboolean _mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS) @@ -340,7 +340,7 @@ _mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS) /** - * Called via TexFormat->StoreImage to store an RGBA_DXT5 texture. + * Store user's image in rgba_dxt5 format. */ GLboolean _mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS) -- cgit v1.2.3 From ef089604a9cdcb4efa0850de393e04aa8d002fae Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 21:14:12 -0600 Subject: mesa: use texture format functions --- src/mesa/state_tracker/st_atom_sampler.c | 2 +- src/mesa/state_tracker/st_cb_texture.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_atom_sampler.c b/src/mesa/state_tracker/st_atom_sampler.c index 50ce82811c..6611956ae8 100644 --- a/src/mesa/state_tracker/st_atom_sampler.c +++ b/src/mesa/state_tracker/st_atom_sampler.c @@ -209,7 +209,7 @@ update_samplers(struct st_context *st) } xlate_border_color(texobj->BorderColor, - teximg ? teximg->TexFormat->BaseFormat : GL_RGBA, + teximg ? teximg->_BaseFormat : GL_RGBA, sampler->border_color); sampler->max_anisotropy = texobj->MaxAnisotropy; diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 62ebdd8056..8bbffc3ff6 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -563,7 +563,7 @@ st_TexImage(GLcontext * ctx, _mesa_set_fetch_functions(texImage, dims); - if (texImage->TexFormat->TexelBytes == 0) { + if (_mesa_is_format_compressed(texImage->TexFormat->MesaFormat)) { /* must be a compressed format */ texelBytes = 0; texImage->IsCompressed = GL_TRUE; @@ -573,7 +573,7 @@ st_TexImage(GLcontext * ctx, texImage->TexFormat->MesaFormat); } else { - texelBytes = texImage->TexFormat->TexelBytes; + texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); /* Minimum pitch of 32 bytes */ if (postConvWidth * texelBytes < 32) { @@ -1838,7 +1838,7 @@ st_finalize_texture(GLcontext *ctx, cpp = compressed_num_bytes(firstImage->base.TexFormat->MesaFormat); } else { - cpp = firstImage->base.TexFormat->TexelBytes; + cpp = _mesa_get_format_bytes(firstImage->base.TexFormat->MesaFormat); } /* If we already have a gallium texture, check that it matches the texture -- cgit v1.2.3 From 749e50442a2a4e6a15434dfed47a9b87df353fa6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 21:14:43 -0600 Subject: mesa: fix render buffer _BaseFormat assignment --- src/mesa/main/texrender.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c index 11073f76bf..54e5668abc 100644 --- a/src/mesa/main/texrender.c +++ b/src/mesa/main/texrender.c @@ -507,13 +507,7 @@ update_wrapper(GLcontext *ctx, const struct gl_renderbuffer_attachment *att) trb->Base._ActualFormat = trb->TexImage->InternalFormat; trb->Base.DataType = CHAN_TYPE; } - trb->Base._BaseFormat = trb->TexImage->TexFormat->BaseFormat; -#if 0 - /* fix/avoid this assertion someday */ - ASSERT(trb->Base._BaseFormat == GL_RGB || - trb->Base._BaseFormat == GL_RGBA || - trb->Base._BaseFormat == GL_DEPTH_COMPONENT); -#endif + trb->Base._BaseFormat = trb->TexImage->_BaseFormat; trb->Base.Data = trb->TexImage->Data; trb->Base.RedBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_RED_SIZE); -- cgit v1.2.3 From bd00a7fa4bb4bb71cd2eaf7ebb6749a709b5fdb9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 21:22:57 -0600 Subject: mesa: sort texstore_funcs[] array, remove search loop --- src/mesa/main/texstore.c | 73 ++++++++++++++++++++++++++++-------------------- 1 file changed, 42 insertions(+), 31 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 6ebc9d6cc3..d47f71d0e2 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -3180,32 +3180,7 @@ static struct { } texstore_funcs[MESA_FORMAT_COUNT] = { - { MESA_FORMAT_RGBA, _mesa_texstore_rgba }, - { MESA_FORMAT_RGB, _mesa_texstore_rgba }, - { MESA_FORMAT_ALPHA, _mesa_texstore_rgba }, - { MESA_FORMAT_LUMINANCE, _mesa_texstore_rgba }, - { MESA_FORMAT_LUMINANCE_ALPHA, _mesa_texstore_rgba }, - { MESA_FORMAT_INTENSITY, _mesa_texstore_rgba }, - { MESA_FORMAT_SRGB8, _mesa_texstore_srgb8 }, - { MESA_FORMAT_SRGBA8, _mesa_texstore_srgba8 }, - { MESA_FORMAT_SARGB8, _mesa_texstore_sargb8 }, - { MESA_FORMAT_SL8, _mesa_texstore_sl8 }, - { MESA_FORMAT_SLA8, _mesa_texstore_sla8 }, - { MESA_FORMAT_RGBA_FLOAT32, _mesa_texstore_rgba_float32 }, - { MESA_FORMAT_RGBA_FLOAT16, _mesa_texstore_rgba_float16 }, - { MESA_FORMAT_RGB_FLOAT32, _mesa_texstore_rgba_float32 }, - { MESA_FORMAT_RGB_FLOAT16, _mesa_texstore_rgba_float16 }, - { MESA_FORMAT_ALPHA_FLOAT32, _mesa_texstore_rgba_float32 }, - { MESA_FORMAT_ALPHA_FLOAT16, _mesa_texstore_rgba_float16 }, - { MESA_FORMAT_LUMINANCE_FLOAT32, _mesa_texstore_rgba_float32 }, - { MESA_FORMAT_LUMINANCE_FLOAT16, _mesa_texstore_rgba_float16 }, - { MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32, _mesa_texstore_rgba_float32 }, - { MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16, _mesa_texstore_rgba_float16 }, - { MESA_FORMAT_INTENSITY_FLOAT32, _mesa_texstore_rgba_float32 }, - { MESA_FORMAT_INTENSITY_FLOAT16, _mesa_texstore_rgba_float16 }, - { MESA_FORMAT_DUDV8, _mesa_texstore_dudv8 }, - { MESA_FORMAT_SIGNED_RGBA8888, _mesa_texstore_signed_rgba8888 }, - { MESA_FORMAT_SIGNED_RGBA8888_REV, _mesa_texstore_signed_rgba8888 }, + { MESA_FORMAT_NONE, NULL }, { MESA_FORMAT_RGBA8888, _mesa_texstore_rgba8888 }, { MESA_FORMAT_RGBA8888_REV, _mesa_texstore_rgba8888 }, { MESA_FORMAT_ARGB8888, _mesa_texstore_argb8888 }, @@ -3229,13 +3204,47 @@ texstore_funcs[MESA_FORMAT_COUNT] = { MESA_FORMAT_CI8, _mesa_texstore_ci8 }, { MESA_FORMAT_YCBCR, _mesa_texstore_ycbcr }, { MESA_FORMAT_YCBCR_REV, _mesa_texstore_ycbcr }, - { MESA_FORMAT_RGB_FXT1, _mesa_texstore_rgb_fxt1 }, - { MESA_FORMAT_RGBA_FXT1, _mesa_texstore_rgba_fxt1 }, { MESA_FORMAT_Z24_S8, _mesa_texstore_z24_s8 }, { MESA_FORMAT_S8_Z24, _mesa_texstore_s8_z24 }, { MESA_FORMAT_Z16, _mesa_texstore_z16 }, { MESA_FORMAT_Z32, _mesa_texstore_z32 }, { MESA_FORMAT_S8, NULL/*_mesa_texstore_s8*/ }, + { MESA_FORMAT_SRGB8, _mesa_texstore_srgb8 }, + { MESA_FORMAT_SRGBA8, _mesa_texstore_srgba8 }, + { MESA_FORMAT_SARGB8, _mesa_texstore_sargb8 }, + { MESA_FORMAT_SL8, _mesa_texstore_sl8 }, + { MESA_FORMAT_SLA8, _mesa_texstore_sla8 }, + { MESA_FORMAT_SRGB_DXT1, _mesa_texstore_rgb_dxt1 }, + { MESA_FORMAT_SRGBA_DXT1, _mesa_texstore_rgba_dxt1 }, + { MESA_FORMAT_SRGBA_DXT3, _mesa_texstore_rgba_dxt3 }, + { MESA_FORMAT_SRGBA_DXT5, _mesa_texstore_rgba_dxt5 }, + { MESA_FORMAT_RGB_FXT1, _mesa_texstore_rgb_fxt1 }, + { MESA_FORMAT_RGBA_FXT1, _mesa_texstore_rgba_fxt1 }, + { MESA_FORMAT_RGB_DXT1, _mesa_texstore_rgb_dxt1 }, + { MESA_FORMAT_RGBA_DXT1, _mesa_texstore_rgba_dxt1 }, + { MESA_FORMAT_RGBA_DXT3, _mesa_texstore_rgba_dxt3 }, + { MESA_FORMAT_RGBA_DXT5, _mesa_texstore_rgba_dxt5 }, + { MESA_FORMAT_RGBA, _mesa_texstore_rgba }, + { MESA_FORMAT_RGB, _mesa_texstore_rgba }, + { MESA_FORMAT_ALPHA, _mesa_texstore_rgba }, + { MESA_FORMAT_LUMINANCE, _mesa_texstore_rgba }, + { MESA_FORMAT_LUMINANCE_ALPHA, _mesa_texstore_rgba }, + { MESA_FORMAT_INTENSITY, _mesa_texstore_rgba }, + { MESA_FORMAT_RGBA_FLOAT32, _mesa_texstore_rgba_float32 }, + { MESA_FORMAT_RGBA_FLOAT16, _mesa_texstore_rgba_float16 }, + { MESA_FORMAT_RGB_FLOAT32, _mesa_texstore_rgba_float32 }, + { MESA_FORMAT_RGB_FLOAT16, _mesa_texstore_rgba_float16 }, + { MESA_FORMAT_ALPHA_FLOAT32, _mesa_texstore_rgba_float32 }, + { MESA_FORMAT_ALPHA_FLOAT16, _mesa_texstore_rgba_float16 }, + { MESA_FORMAT_LUMINANCE_FLOAT32, _mesa_texstore_rgba_float32 }, + { MESA_FORMAT_LUMINANCE_FLOAT16, _mesa_texstore_rgba_float16 }, + { MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32, _mesa_texstore_rgba_float32 }, + { MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16, _mesa_texstore_rgba_float16 }, + { MESA_FORMAT_INTENSITY_FLOAT32, _mesa_texstore_rgba_float32 }, + { MESA_FORMAT_INTENSITY_FLOAT16, _mesa_texstore_rgba_float16 }, + { MESA_FORMAT_DUDV8, _mesa_texstore_dudv8 }, + { MESA_FORMAT_SIGNED_RGBA8888, _mesa_texstore_signed_rgba8888 }, + { MESA_FORMAT_SIGNED_RGBA8888_REV, _mesa_texstore_signed_rgba8888 }, }; @@ -3246,11 +3255,13 @@ StoreTexImageFunc _mesa_get_texstore_func(gl_format format) { GLuint i; +#ifdef DEBUG for (i = 0; i < MESA_FORMAT_COUNT; i++) { - if (texstore_funcs[i].Name == format) - return texstore_funcs[i].Store; + ASSERT(texstore_funcs[i].Name == i); } - return NULL; +#endif + ASSERT(texstore_funcs[format].Name == format); + return texstore_funcs[format].Store; } -- cgit v1.2.3 From 729ff875f4c951798d2372940608201a6b195ca6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 27 Sep 2009 21:32:12 -0600 Subject: mesa: change _mesa_format_to_type_and_comps() format parameter type --- src/mesa/main/mipmap.c | 10 +++++----- src/mesa/main/texformat.c | 7 +++---- src/mesa/main/texformat.h | 2 +- src/mesa/state_tracker/st_gen_mipmap.c | 2 +- 4 files changed, 10 insertions(+), 11 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index faa6c47cb7..0950d8abea 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -1495,7 +1495,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, struct gl_texture_object *texObj) { const struct gl_texture_image *srcImage; - const struct gl_texture_format *convertFormat; + gl_format convertFormat; const GLubyte *srcData = NULL; GLubyte *dstData = NULL; GLint level, maxLevels; @@ -1521,11 +1521,11 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, texObj->Target == GL_TEXTURE_CUBE_MAP_ARB); if (srcImage->_BaseFormat == GL_RGB) { - convertFormat = &_mesa_texformat_rgb; + convertFormat = MESA_FORMAT_RGB; components = 3; } else if (srcImage->_BaseFormat == GL_RGBA) { - convertFormat = &_mesa_texformat_rgba; + convertFormat = MESA_FORMAT_RGBA; components = 4; } else { @@ -1561,7 +1561,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, } else { /* uncompressed */ - convertFormat = srcImage->TexFormat; + convertFormat = srcImage->TexFormat->MesaFormat; } _mesa_format_to_type_and_comps(convertFormat, &datatype, &comps); @@ -1664,7 +1664,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, if (dstImage->IsCompressed) { GLubyte *temp; /* compress image from dstData into dstImage->Data */ - const GLenum srcFormat = convertFormat->BaseFormat; + const GLenum srcFormat = _mesa_get_format_base_format(convertFormat); GLint dstRowStride = _mesa_compressed_row_stride(dstImage->TexFormat->MesaFormat, dstWidth); const StoreTexImageFunc storeImage = diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index dae98bcc6f..60b2065a6c 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -1351,14 +1351,13 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, /** - * Return datatype and number of components per texel for the - * given gl_texture_format. + * Return datatype and number of components per texel for the given gl_format. */ void -_mesa_format_to_type_and_comps(const struct gl_texture_format *format, +_mesa_format_to_type_and_comps(gl_format format, GLenum *datatype, GLuint *comps) { - switch (format->MesaFormat) { + switch (format) { case MESA_FORMAT_RGBA8888: case MESA_FORMAT_RGBA8888_REV: case MESA_FORMAT_ARGB8888: diff --git a/src/mesa/main/texformat.h b/src/mesa/main/texformat.h index 39d5ec640a..638eadff97 100644 --- a/src/mesa/main/texformat.h +++ b/src/mesa/main/texformat.h @@ -151,7 +151,7 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, extern void -_mesa_format_to_type_and_comps(const struct gl_texture_format *format, +_mesa_format_to_type_and_comps(gl_format format, GLenum *datatype, GLuint *comps); extern FetchTexelFuncF diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c index 58f6933652..63a6956a7a 100644 --- a/src/mesa/state_tracker/st_gen_mipmap.c +++ b/src/mesa/state_tracker/st_gen_mipmap.c @@ -115,7 +115,7 @@ fallback_generate_mipmap(GLcontext *ctx, GLenum target, assert(target != GL_TEXTURE_3D); /* not done yet */ - _mesa_format_to_type_and_comps(texObj->Image[face][baseLevel]->TexFormat, + _mesa_format_to_type_and_comps(texObj->Image[face][baseLevel]->TexFormat->MesaFormat, &datatype, &comps); for (dstLevel = baseLevel + 1; dstLevel <= lastLevel; dstLevel++) { -- cgit v1.2.3 From eb82373abb08171d7fcb15b5f4f229fc9ca9aa91 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 28 Sep 2009 09:22:33 -0600 Subject: mesa: use _mesa_get_current_tex_unit() helper --- src/mesa/main/enable.c | 4 ++-- src/mesa/main/fbobject.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 8e6b01f73b..4383aed669 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -37,6 +37,7 @@ #include "mtypes.h" #include "enums.h" #include "api_arrayelt.h" +#include "texstate.h" @@ -228,8 +229,7 @@ get_texcoord_unit(GLcontext *ctx) static GLboolean enable_texture(GLcontext *ctx, GLboolean state, GLbitfield texBit) { - const GLuint curr = ctx->Texture.CurrentUnit; - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[curr]; + struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); const GLbitfield newenabled = state ? (texUnit->Enabled | texBit) : (texUnit->Enabled & ~texBit); diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 13f49da5a7..680fd22ba8 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -44,6 +44,7 @@ #include "teximage.h" #include "texobj.h" #include "texstore.h" +#include "texstate.h" /** Set this to 1 to help debug FBO incompleteness problems */ @@ -1955,7 +1956,7 @@ _mesa_GenerateMipmapEXT(GLenum target) return; } - texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + texUnit = _mesa_get_current_tex_unit(ctx); texObj = _mesa_select_tex_object(ctx, texUnit, target); _mesa_lock_texture(ctx, texObj); -- cgit v1.2.3 From e3a6f57ad6c0e7bda5d45eb146194ed39f45abdd Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 28 Sep 2009 09:28:50 -0600 Subject: st/mesa: fix/simplify st_texture_object::lastLevel calculation Don't compute the st_texture_object::lastLevel field based on the texture filters. Use the _MaxLevel value that core Mesa computes for us. When called from the GenerateMipmap path, we'll use the lastLevel field as-is. --- src/mesa/state_tracker/st_cb_texture.c | 62 +++++----------------------------- 1 file changed, 9 insertions(+), 53 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index cfa33d48e1..085da3eab4 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -1708,53 +1708,6 @@ st_CopyTexSubImage3D(GLcontext * ctx, GLenum target, GLint level, } -/** - * Compute which mipmap levels that really need to be sent to the hardware. - * This depends on the base image size, GL_TEXTURE_MIN_LOD, - * GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL, and GL_TEXTURE_MAX_LEVEL. - */ -static void -calculate_first_last_level(struct st_texture_object *stObj) -{ - struct gl_texture_object *tObj = &stObj->base; - - /* These must be signed values. MinLod and MaxLod can be negative numbers, - * and having firstLevel and lastLevel as signed prevents the need for - * extra sign checks. - */ - GLint firstLevel; - GLint lastLevel; - - /* Yes, this looks overly complicated, but it's all needed. - */ - switch (tObj->Target) { - case GL_TEXTURE_1D: - case GL_TEXTURE_2D: - case GL_TEXTURE_3D: - case GL_TEXTURE_CUBE_MAP: - if (tObj->MinFilter == GL_NEAREST || tObj->MinFilter == GL_LINEAR) { - /* GL_NEAREST and GL_LINEAR only care about GL_TEXTURE_BASE_LEVEL. - */ - firstLevel = lastLevel = tObj->BaseLevel; - } - else { - firstLevel = 0; - lastLevel = MIN2(tObj->MaxLevel, - (int) tObj->Image[0][tObj->BaseLevel]->WidthLog2); - } - break; - case GL_TEXTURE_RECTANGLE_NV: - case GL_TEXTURE_4D_SGIS: - firstLevel = lastLevel = 0; - break; - default: - return; - } - - stObj->lastLevel = lastLevel; -} - - static void copy_image_data_to_texture(struct st_context *st, struct st_texture_object *stObj, @@ -1818,13 +1771,16 @@ st_finalize_texture(GLcontext *ctx, *needFlush = GL_FALSE; - /* We know/require this is true by now: - */ - assert(stObj->base._Complete); + if (stObj->base._Complete) { + /* The texture is complete and we know exactly how many mipmap levels + * are present/needed. This is conditional because we may be called + * from the st_generate_mipmap() function when the texture object is + * incomplete. In that case, we'll have set stObj->lastLevel before + * we get here. + */ + stObj->lastLevel = stObj->base._MaxLevel - stObj->base.BaseLevel; + } - /* What levels must the texture include at a minimum? - */ - calculate_first_last_level(stObj); firstImage = st_texture_image(stObj->base.Image[0][stObj->base.BaseLevel]); /* If both firstImage and stObj point to a texture which can contain -- cgit v1.2.3 From c7fddaf6122da489f4430f6bc2211bcb4740f416 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 25 Sep 2009 17:24:27 -0600 Subject: st/mesa: fix st_generate_mipmap() issues The main issue is we didn't always have a gallium texture object with enough space to store the to-be-generated mipmap levels. When that's the case, allocate a new gallium texture and use st_texure_finalize() to copy images from the old texture to the new one. We also had the baseLevel parameter to st_render_mipmap() wrong. --- src/mesa/state_tracker/st_gen_mipmap.c | 82 +++++++++++++++++++++++++++++++++- 1 file changed, 80 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c index 58f6933652..f75b2348b8 100644 --- a/src/mesa/state_tracker/st_gen_mipmap.c +++ b/src/mesa/state_tracker/st_gen_mipmap.c @@ -27,6 +27,7 @@ #include "main/imports.h" +#include "main/macros.h" #include "main/mipmap.h" #include "main/teximage.h" #include "main/texformat.h" @@ -161,6 +162,43 @@ fallback_generate_mipmap(GLcontext *ctx, GLenum target, } +/** + * Compute the expected number of mipmap levels in the texture given + * the width/height/depth of the base image and the GL_TEXTURE_BASE_LEVEL/ + * GL_TEXTURE_MAX_LEVEL settings. This will tell us how many mipmap + * level should be generated. + */ +static GLuint +compute_num_levels(GLcontext *ctx, + struct gl_texture_object *texObj, + GLenum target) +{ + if (target == GL_TEXTURE_RECTANGLE_ARB) { + return 1; + } + else { + const GLuint maxLevels = texObj->MaxLevel - texObj->BaseLevel + 1; + const struct gl_texture_image *baseImage = + _mesa_get_tex_image(ctx, texObj, target, texObj->BaseLevel); + GLuint size, numLevels; + + size = MAX2(baseImage->Width2, baseImage->Height2); + size = MAX2(size, baseImage->Depth2); + + numLevels = 0; + + while (size > 0) { + numLevels++; + size >>= 1; + } + + numLevels = MIN2(numLevels, maxLevels); + + return numLevels; + } +} + + void st_generate_mipmap(GLcontext *ctx, GLenum target, struct gl_texture_object *texObj) @@ -174,9 +212,49 @@ st_generate_mipmap(GLcontext *ctx, GLenum target, if (!pt) return; - lastLevel = pt->last_level; + /* find expected last mipmap level */ + lastLevel = compute_num_levels(ctx, texObj, target) - 1; + + if (pt->last_level < lastLevel) { + /* The current gallium texture doesn't have space for all the + * mipmap levels we need to generate. So allocate a new texture. + */ + struct st_texture_object *stObj = st_texture_object(texObj); + struct pipe_texture *oldTex = stObj->pt; + GLboolean needFlush; + + /* create new texture with space for more levels */ + stObj->pt = st_texture_create(st, + oldTex->target, + oldTex->format, + lastLevel, + oldTex->width[0], + oldTex->height[0], + oldTex->depth[0], + oldTex->tex_usage); + + /* The texture isn't in a "complete" state yet so set the expected + * lastLevel here, since it won't get done in st_finalize_texture(). + */ + stObj->lastLevel = lastLevel; + + /* This will copy the old texture's base image into the new texture + * which we just allocated. + */ + st_finalize_texture(ctx, st->pipe, texObj, &needFlush); + + /* release the old tex (will likely be freed too) */ + pipe_texture_reference(&oldTex, NULL); + + pt = stObj->pt; + } + + assert(lastLevel <= pt->last_level); - if (!st_render_mipmap(st, target, pt, baseLevel, lastLevel)) { + /* Recall that the Mesa BaseLevel image is stored in the gallium + * texture's level[0] position. So pass baseLevel=0 here. + */ + if (!st_render_mipmap(st, target, pt, 0, lastLevel)) { fallback_generate_mipmap(ctx, target, texObj); } -- cgit v1.2.3 From 05bad193f56d48384097e37e47fae3fdda85f144 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 28 Sep 2009 10:03:58 -0600 Subject: st/mesa: check gl_texture_object::GenerateMipmap field when allocating texmem In guess_and_alloc_texture() use the gl_texture_object::GenerateMipmap field as another hint as to whether to allocate space for a whole mipmap. --- src/mesa/state_tracker/st_cb_texture.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index c0fba8641b..771a0e2bbd 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -328,10 +328,13 @@ guess_and_alloc_texture(struct st_context *st, stObj->base.MinFilter == GL_LINEAR || stImage->base._BaseFormat == GL_DEPTH_COMPONENT || stImage->base._BaseFormat == GL_DEPTH_STENCIL_EXT) && + !stObj->base.GenerateMipmap && stImage->level == firstLevel) { + /* only alloc space for a single mipmap level */ lastLevel = firstLevel; } else { + /* alloc space for a full mipmap */ GLuint l2width = util_logbase2(width); GLuint l2height = util_logbase2(height); GLuint l2depth = util_logbase2(depth); -- cgit v1.2.3 From f0dc37870577378b51c1f8f223932a24909c5db1 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 28 Sep 2009 11:22:54 -0700 Subject: Prep for 7.6 release --- src/mesa/main/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index d4d3dd1a94..0ccdbf94a1 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.h @@ -32,7 +32,7 @@ #define MESA_MAJOR 7 #define MESA_MINOR 6 #define MESA_PATCH 0 -#define MESA_VERSION_STRING "7.6-devel" +#define MESA_VERSION_STRING "7.6" /* To make version comparison easy */ #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -- cgit v1.2.3 From 8b23755ce978247a92c00e390de2e459c0a9d5ad Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 21 Sep 2009 17:13:31 -0700 Subject: intel: Remove some dead metaops code. --- src/mesa/drivers/dri/i965/brw_context.h | 4 --- src/mesa/drivers/dri/i965/brw_tex.c | 32 ------------------------ src/mesa/drivers/dri/i965/brw_vtbl.c | 2 -- src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 13 ++-------- src/mesa/drivers/dri/intel/intel_context.h | 3 --- src/mesa/drivers/dri/intel/intel_pixel.c | 14 ----------- src/mesa/drivers/dri/intel/intel_pixel.h | 2 -- 7 files changed, 2 insertions(+), 68 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index a5209ac41b..fa3e32c7ff 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -705,10 +705,6 @@ void brw_debug_batch(struct intel_context *intel); /*====================================================================== * brw_tex.c */ -void brwUpdateTextureState( struct intel_context *intel ); -void brw_FrameBufferTexInit( struct brw_context *brw, - struct intel_region *region ); -void brw_FrameBufferTexDestroy( struct brw_context *brw ); void brw_validate_textures( struct brw_context *brw ); diff --git a/src/mesa/drivers/dri/i965/brw_tex.c b/src/mesa/drivers/dri/i965/brw_tex.c index 71bff166dd..e911b105b2 100644 --- a/src/mesa/drivers/dri/i965/brw_tex.c +++ b/src/mesa/drivers/dri/i965/brw_tex.c @@ -39,38 +39,6 @@ #include "intel_tex.h" #include "brw_context.h" - -void brw_FrameBufferTexInit( struct brw_context *brw, - struct intel_region *region ) -{ - struct intel_context *intel = &brw->intel; - GLcontext *ctx = &intel->ctx; - struct gl_texture_object *obj; - struct gl_texture_image *img; - - intel->frame_buffer_texobj = obj = - ctx->Driver.NewTextureObject( ctx, (GLuint) -1, GL_TEXTURE_2D ); - - obj->MinFilter = GL_NEAREST; - obj->MagFilter = GL_NEAREST; - - img = ctx->Driver.NewTextureImage( ctx ); - - _mesa_init_teximage_fields( ctx, GL_TEXTURE_2D, img, - region->pitch, region->height, 1, 0, - region->cpp == 4 ? GL_RGBA : GL_RGB ); - - _mesa_set_tex_image( obj, GL_TEXTURE_2D, 0, img ); -} - -void brw_FrameBufferTexDestroy( struct brw_context *brw ) -{ - if (brw->intel.frame_buffer_texobj != NULL) - brw->intel.ctx.Driver.DeleteTexture( &brw->intel.ctx, - brw->intel.frame_buffer_texobj ); - brw->intel.frame_buffer_texobj = NULL; -} - /** * Finalizes all textures, completing any rendering that needs to be done * to prepare them. diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c index ac11790151..124fde25fe 100644 --- a/src/mesa/drivers/dri/i965/brw_vtbl.c +++ b/src/mesa/drivers/dri/i965/brw_vtbl.c @@ -69,8 +69,6 @@ static void brw_destroy_context( struct intel_context *intel ) _mesa_free(brw->wm.compile_data); - brw_FrameBufferTexDestroy( brw ); - for (i = 0; i < brw->state.nr_color_regions; i++) intel_region_release(&brw->state.color_regions[i]); brw->state.nr_color_regions = 0; diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index 51539ac1e7..4f651170c6 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -724,17 +724,8 @@ static void prepare_wm_surfaces(struct brw_context *brw ) /* _NEW_TEXTURE, BRW_NEW_TEXDATA */ if (texUnit->_ReallyEnabled) { - if (texUnit->_Current == intel->frame_buffer_texobj) { - /* render to texture */ - dri_bo_unreference(brw->wm.surf_bo[surf]); - brw->wm.surf_bo[surf] = brw->wm.surf_bo[0]; - dri_bo_reference(brw->wm.surf_bo[surf]); - brw->wm.nr_surfaces = surf + 1; - } else { - /* regular texture */ - brw_update_texture_surface(ctx, i); - brw->wm.nr_surfaces = surf + 1; - } + brw_update_texture_surface(ctx, i); + brw->wm.nr_surfaces = surf + 1; } else { dri_bo_unreference(brw->wm.surf_bo[surf]); brw->wm.surf_bo[surf] = NULL; diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index 03e7cf39d6..c743ab1c24 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -254,9 +254,6 @@ struct intel_context intel_line_func draw_line; intel_tri_func draw_tri; - /* These refer to the current drawing buffer: - */ - struct gl_texture_object *frame_buffer_texobj; /** * Set to true if a single constant cliprect should be used in the * batchbuffer. Otherwise, cliprects must be calculated at batchbuffer diff --git a/src/mesa/drivers/dri/intel/intel_pixel.c b/src/mesa/drivers/dri/intel/intel_pixel.c index a300141655..993e427a99 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel.c +++ b/src/mesa/drivers/dri/intel/intel_pixel.c @@ -129,20 +129,6 @@ intel_check_blit_fragment_ops(GLcontext * ctx, GLboolean src_alpha_is_one) return GL_TRUE; } - -GLboolean -intel_check_meta_tex_fragment_ops(GLcontext * ctx) -{ - if (ctx->NewState) - _mesa_update_state(ctx); - - /* Some of _ImageTransferState (scale, bias) could be done with - * fragment programs on i915. - */ - return !(ctx->_ImageTransferState || ctx->Fog.Enabled || /* not done yet */ - ctx->Texture._EnabledUnits || ctx->FragmentProgram._Enabled); -} - /* The intel_region struct doesn't really do enough to capture the * format of the pixels in the region. For now this code assumes that * the region is a display surface and hence is either ARGB8888 or diff --git a/src/mesa/drivers/dri/intel/intel_pixel.h b/src/mesa/drivers/dri/intel/intel_pixel.h index 96a6dd17b2..743b6497c5 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel.h +++ b/src/mesa/drivers/dri/intel/intel_pixel.h @@ -34,8 +34,6 @@ void intelInitPixelFuncs(struct dd_function_table *functions); GLboolean intel_check_blit_fragment_ops(GLcontext * ctx, GLboolean src_alpha_is_one); -GLboolean intel_check_meta_tex_fragment_ops(GLcontext * ctx); - GLboolean intel_check_blit_format(struct intel_region *region, GLenum format, GLenum type); -- cgit v1.2.3 From e885cb48a0b9292b3df9204f1c2783bf1fe29a28 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 28 Sep 2009 11:42:31 -0700 Subject: intel: Drop my generatemipmap code in favor of the new shared code. --- src/mesa/drivers/common/driverfuncs.c | 2 +- src/mesa/drivers/dri/i915/Makefile | 1 - src/mesa/drivers/dri/i915/intel_generatemipmap.c | 1 - src/mesa/drivers/dri/i965/Makefile | 1 - src/mesa/drivers/dri/i965/intel_generatemipmap.c | 1 - src/mesa/drivers/dri/intel/intel_generatemipmap.c | 300 ---------------------- src/mesa/drivers/dri/intel/intel_tex.c | 1 - src/mesa/drivers/dri/intel/intel_tex.h | 3 - 8 files changed, 1 insertion(+), 309 deletions(-) delete mode 120000 src/mesa/drivers/dri/i915/intel_generatemipmap.c delete mode 120000 src/mesa/drivers/dri/i965/intel_generatemipmap.c delete mode 100644 src/mesa/drivers/dri/intel/intel_generatemipmap.c (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index f09106b77c..0f8447cb70 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -106,7 +106,7 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->CopyTexSubImage1D = _mesa_meta_CopyTexSubImage1D; driver->CopyTexSubImage2D = _mesa_meta_CopyTexSubImage2D; driver->CopyTexSubImage3D = _mesa_meta_CopyTexSubImage3D; - driver->GenerateMipmap = _mesa_generate_mipmap; + driver->GenerateMipmap = _mesa_meta_GenerateMipmap; driver->TestProxyTexImage = _mesa_test_proxy_teximage; driver->CompressedTexImage1D = _mesa_store_compressed_teximage1d; driver->CompressedTexImage2D = _mesa_store_compressed_teximage2d; diff --git a/src/mesa/drivers/dri/i915/Makefile b/src/mesa/drivers/dri/i915/Makefile index 9d049dea8f..393312e732 100644 --- a/src/mesa/drivers/dri/i915/Makefile +++ b/src/mesa/drivers/dri/i915/Makefile @@ -19,7 +19,6 @@ DRIVER_SOURCES = \ intel_batchbuffer.c \ intel_clear.c \ intel_extensions.c \ - intel_generatemipmap.c \ intel_mipmap_tree.c \ intel_tex_layout.c \ intel_tex_image.c \ diff --git a/src/mesa/drivers/dri/i915/intel_generatemipmap.c b/src/mesa/drivers/dri/i915/intel_generatemipmap.c deleted file mode 120000 index 4c6b37ada0..0000000000 --- a/src/mesa/drivers/dri/i915/intel_generatemipmap.c +++ /dev/null @@ -1 +0,0 @@ -../intel/intel_generatemipmap.c \ No newline at end of file diff --git a/src/mesa/drivers/dri/i965/Makefile b/src/mesa/drivers/dri/i965/Makefile index 6e9a9a29a3..57dcc91586 100644 --- a/src/mesa/drivers/dri/i965/Makefile +++ b/src/mesa/drivers/dri/i965/Makefile @@ -14,7 +14,6 @@ DRIVER_SOURCES = \ intel_decode.c \ intel_extensions.c \ intel_fbo.c \ - intel_generatemipmap.c \ intel_mipmap_tree.c \ intel_regions.c \ intel_screen.c \ diff --git a/src/mesa/drivers/dri/i965/intel_generatemipmap.c b/src/mesa/drivers/dri/i965/intel_generatemipmap.c deleted file mode 120000 index 4c6b37ada0..0000000000 --- a/src/mesa/drivers/dri/i965/intel_generatemipmap.c +++ /dev/null @@ -1 +0,0 @@ -../intel/intel_generatemipmap.c \ No newline at end of file diff --git a/src/mesa/drivers/dri/intel/intel_generatemipmap.c b/src/mesa/drivers/dri/intel/intel_generatemipmap.c deleted file mode 100644 index 5958b36c97..0000000000 --- a/src/mesa/drivers/dri/intel/intel_generatemipmap.c +++ /dev/null @@ -1,300 +0,0 @@ -/* - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. - * Copyright © 2009 Intel Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN 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. - * - * Authors: - * Eric Anholt - * - */ - -#include "main/glheader.h" -#include "main/enums.h" -#include "main/image.h" -#include "main/mtypes.h" -#include "main/macros.h" -#include "main/bufferobj.h" -#include "main/teximage.h" -#include "main/texenv.h" -#include "main/texobj.h" -#include "main/texstate.h" -#include "main/texparam.h" -#include "main/varray.h" -#include "main/attrib.h" -#include "main/enable.h" -#include "main/buffers.h" -#include "main/fbobject.h" -#include "main/framebuffer.h" -#include "main/renderbuffer.h" -#include "main/depth.h" -#include "main/hash.h" -#include "main/mipmap.h" -#include "main/blend.h" -#include "glapi/dispatch.h" -#include "swrast/swrast.h" - -#include "intel_screen.h" -#include "intel_context.h" -#include "intel_batchbuffer.h" -#include "intel_pixel.h" -#include "intel_tex.h" -#include "intel_mipmap_tree.h" - -static const char *intel_fp_tex2d = - "!!ARBfp1.0\n" - "TEX result.color, fragment.texcoord[0], texture[0], 2D;\n" - "END\n"; - -static GLboolean -intel_generate_mipmap_level(GLcontext *ctx, GLuint tex_name, - int level, int width, int height) -{ - struct intel_context *intel = intel_context(ctx); - GLfloat vertices[4][2]; - GLint status; - - /* Set to source from the previous level */ - _mesa_TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_BASE_LEVEL, level - 1); - _mesa_TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_LEVEL, level - 1); - - /* Set to draw into the current level */ - _mesa_FramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, - GL_COLOR_ATTACHMENT0_EXT, - GL_TEXTURE_2D, - tex_name, - level); - /* Choose to render to the color attachment. */ - _mesa_DrawBuffer(GL_COLOR_ATTACHMENT0_EXT); - - status = _mesa_CheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT); - if (status != GL_FRAMEBUFFER_COMPLETE_EXT) - return GL_FALSE; - - meta_set_passthrough_transform(&intel->meta); - - /* XXX: Doing it right would involve setting up the transformation to do - * 0-1 mapping or something, and not changing the vertex data. - */ - vertices[0][0] = 0; - vertices[0][1] = 0; - vertices[1][0] = width; - vertices[1][1] = 0; - vertices[2][0] = width; - vertices[2][1] = height; - vertices[3][0] = 0; - vertices[3][1] = height; - - _mesa_VertexPointer(2, GL_FLOAT, 2 * sizeof(GLfloat), &vertices); - _mesa_Enable(GL_VERTEX_ARRAY); - meta_set_default_texrect(&intel->meta); - - _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4); - - meta_restore_texcoords(&intel->meta); - meta_restore_transform(&intel->meta); - - return GL_TRUE; -} - -static GLboolean -intel_generate_mipmap_2d(GLcontext *ctx, - GLenum target, - struct gl_texture_object *texObj) -{ - struct intel_context *intel = intel_context(ctx); - GLint old_active_texture; - int level, max_levels, start_level, end_level; - GLuint fb_name; - GLboolean success = GL_FALSE; - struct gl_framebuffer *saved_fbo = NULL; - struct gl_buffer_object *saved_array_buffer = NULL; - struct gl_buffer_object *saved_element_buffer = NULL; - - _mesa_PushAttrib(GL_ENABLE_BIT | GL_TEXTURE_BIT | - GL_CURRENT_BIT | GL_COLOR_BUFFER_BIT | - GL_DEPTH_BUFFER_BIT); - _mesa_PushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT); - old_active_texture = ctx->Texture.CurrentUnit; - _mesa_reference_framebuffer(&saved_fbo, ctx->DrawBuffer); - - /* use default array/index buffers */ - _mesa_reference_buffer_object(ctx, &saved_array_buffer, - ctx->Array.ArrayBufferObj); - _mesa_reference_buffer_object(ctx, &ctx->Array.ArrayBufferObj, - ctx->Shared->NullBufferObj); - _mesa_reference_buffer_object(ctx, &saved_element_buffer, - ctx->Array.ElementArrayBufferObj); - _mesa_reference_buffer_object(ctx, &ctx->Array.ElementArrayBufferObj, - ctx->Shared->NullBufferObj); - - _mesa_Disable(GL_POLYGON_STIPPLE); - _mesa_Disable(GL_DEPTH_TEST); - _mesa_Disable(GL_STENCIL_TEST); - _mesa_ColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE); - _mesa_DepthMask(GL_FALSE); - - /* Bind the given texture to GL_TEXTURE_2D with linear filtering for our - * minification. - */ - _mesa_ActiveTextureARB(GL_TEXTURE0_ARB); - _mesa_Enable(GL_TEXTURE_2D); - _mesa_BindTexture(GL_TEXTURE_2D, texObj->Name); - _mesa_TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, - GL_LINEAR_MIPMAP_NEAREST); - _mesa_TexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - - /* Bind the new renderbuffer to the color attachment point. */ - _mesa_GenFramebuffersEXT(1, &fb_name); - _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, fb_name); - - meta_set_fragment_program(&intel->meta, &intel->meta.tex2d_fp, - intel_fp_tex2d); - meta_set_passthrough_vertex_program(&intel->meta); - - max_levels = _mesa_max_texture_levels(ctx, texObj->Target); - start_level = texObj->BaseLevel; - end_level = texObj->MaxLevel; - - /* Loop generating level+1 from level. */ - for (level = start_level; level < end_level && level < max_levels - 1; level++) { - const struct gl_texture_image *srcImage; - int width, height; - - srcImage = _mesa_select_tex_image(ctx, texObj, target, level); - if (srcImage->Border != 0) - goto fail; - - width = srcImage->Width / 2; - if (width < 1) - width = 1; - height = srcImage->Height / 2; - if (height < 1) - height = 1; - - if (width == srcImage->Width && - height == srcImage->Height) { - /* Neither _mesa_max_texture_levels nor texObj->MaxLevel are the - * maximum texture level for the object, so break out when we've gone - * over the edge. - */ - break; - } - - /* Make sure that there's space allocated for the target level. - * We could skip this if there's already space allocated and save some - * time. - */ - _mesa_TexImage2D(GL_TEXTURE_2D, level + 1, srcImage->InternalFormat, - width, height, 0, - GL_RGBA, GL_UNSIGNED_INT, NULL); - - if (!intel_generate_mipmap_level(ctx, texObj->Name, level + 1, - width, height)) - goto fail; - } - - success = GL_TRUE; - -fail: - meta_restore_fragment_program(&intel->meta); - meta_restore_vertex_program(&intel->meta); - - /* restore array/index buffers */ - _mesa_reference_buffer_object(ctx, &ctx->Array.ArrayBufferObj, - saved_array_buffer); - _mesa_reference_buffer_object(ctx, &saved_array_buffer, NULL); - _mesa_reference_buffer_object(ctx, &ctx->Array.ElementArrayBufferObj, - saved_element_buffer); - _mesa_reference_buffer_object(ctx, &saved_element_buffer, NULL); - - - _mesa_DeleteFramebuffersEXT(1, &fb_name); - _mesa_ActiveTextureARB(GL_TEXTURE0_ARB + old_active_texture); - if (saved_fbo) - _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, saved_fbo->Name); - _mesa_reference_framebuffer(&saved_fbo, NULL); - _mesa_PopClientAttrib(); - _mesa_PopAttrib(); - - return success; -} - - -/** - * Generate new mipmap data from BASE+1 to BASE+p (the minimally-sized mipmap - * level). - * - * The texture object's miptree must be mapped. - * - * This function should also include an accelerated path. - */ -void -intel_generate_mipmap(GLcontext *ctx, GLenum target, - struct gl_texture_object *texObj) -{ - struct intel_context *intel = intel_context(ctx); - struct intel_texture_object *intelObj = intel_texture_object(texObj); - GLuint nr_faces = (intelObj->base.Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1; - int face, i; - - /* HW path */ - if (target == GL_TEXTURE_2D && - ctx->Extensions.EXT_framebuffer_object && - ctx->Extensions.ARB_fragment_program && - ctx->Extensions.ARB_vertex_program) { - GLboolean success; - - /* We'll be accessing this texture using GL entrypoints, which should - * be resilient against other access to this texture. - */ - _mesa_unlock_texture(ctx, texObj); - success = intel_generate_mipmap_2d(ctx, target, texObj); - _mesa_lock_texture(ctx, texObj); - - if (success) - return; - } - - /* SW path */ - intel_tex_map_level_images(intel, intelObj, texObj->BaseLevel); - _mesa_generate_mipmap(ctx, target, texObj); - intel_tex_unmap_level_images(intel, intelObj, texObj->BaseLevel); - - /* Update the level information in our private data in the new images, since - * it didn't get set as part of a normal TexImage path. - */ - for (face = 0; face < nr_faces; face++) { - for (i = texObj->BaseLevel + 1; i < texObj->MaxLevel; i++) { - struct intel_texture_image *intelImage; - - intelImage = intel_texture_image(texObj->Image[face][i]); - if (intelImage == NULL) - break; - - intelImage->level = i; - intelImage->face = face; - /* Unreference the miptree to signal that the new Data is a bare - * pointer from mesa. - */ - intel_miptree_release(intel, &intelImage->mt); - } - } -} diff --git a/src/mesa/drivers/dri/intel/intel_tex.c b/src/mesa/drivers/dri/intel/intel_tex.c index df63f29a42..f5d877edc3 100644 --- a/src/mesa/drivers/dri/intel/intel_tex.c +++ b/src/mesa/drivers/dri/intel/intel_tex.c @@ -162,7 +162,6 @@ void intelInitTextureFuncs(struct dd_function_table *functions) { functions->ChooseTextureFormat = intelChooseTextureFormat; - functions->GenerateMipmap = intel_generate_mipmap; functions->NewTextureObject = intelNewTextureObject; functions->NewTextureImage = intelNewTextureImage; diff --git a/src/mesa/drivers/dri/intel/intel_tex.h b/src/mesa/drivers/dri/intel/intel_tex.h index 471aa2a240..57ed0b1aab 100644 --- a/src/mesa/drivers/dri/intel/intel_tex.h +++ b/src/mesa/drivers/dri/intel/intel_tex.h @@ -71,7 +71,4 @@ void intel_tex_unmap_images(struct intel_context *intel, int intel_compressed_num_bytes(GLuint mesaFormat); -void intel_generate_mipmap(GLcontext *ctx, GLenum target, - struct gl_texture_object *texObj); - #endif -- cgit v1.2.3 From d492e7b017178c03b4979cf4ff266162d83c4f37 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 28 Sep 2009 14:03:40 -0700 Subject: meta: Fix invalid PBO access from DrawPixels when trying to just alloc. This whole reuse of buffers (TexSubImage instead of TexImage, SubData instead of Data) is bad for hardware drivers, but it's even worse when we accidentally try to access the 2x2 PBO to fill the new 16x16 texture we're creating, producing GL errors. Fixes piglit pbo-drawpixels. Bug #14163. --- src/mesa/drivers/common/meta.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index b445323aab..a152087a3a 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -974,7 +974,8 @@ setup_copypix_texture(struct temp_texture *tex, * Setup/load texture for glDrawPixels. */ static void -setup_drawpix_texture(struct temp_texture *tex, +setup_drawpix_texture(GLcontext *ctx, + struct temp_texture *tex, GLboolean newTex, GLenum texIntFormat, GLsizei width, GLsizei height, @@ -995,9 +996,17 @@ setup_drawpix_texture(struct temp_texture *tex, tex->Width, tex->Height, 0, format, type, pixels); } else { + struct gl_buffer_object *save_unpack_obj = NULL; + + _mesa_reference_buffer_object(ctx, &save_unpack_obj, + ctx->Unpack.BufferObj); + _mesa_BindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, 0); /* create empty texture */ _mesa_TexImage2D(tex->Target, 0, tex->IntFormat, tex->Width, tex->Height, 0, format, type, NULL); + if (save_unpack_obj != NULL) + _mesa_BindBufferARB(GL_PIXEL_UNPACK_BUFFER_ARB, + save_unpack_obj->Name); /* load image */ _mesa_TexSubImage2D(tex->Target, 0, 0, 0, width, height, format, type, pixels); @@ -1162,7 +1171,7 @@ _mesa_meta_BlitFramebuffer(GLcontext *ctx, _mesa_ReadPixels(srcX, srcY, srcW, srcH, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, tmp); - setup_drawpix_texture(tex, newTex, GL_DEPTH_COMPONENT, srcW, srcH, + setup_drawpix_texture(ctx, tex, newTex, GL_DEPTH_COMPONENT, srcW, srcH, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, tmp); _mesa_BindProgram(GL_FRAGMENT_PROGRAM_ARB, blit->DepthFP); @@ -1725,7 +1734,7 @@ _mesa_meta_DrawPixels(GLcontext *ctx, if (!drawpix->StencilFP) init_draw_stencil_pixels(ctx); - setup_drawpix_texture(tex, newTex, texIntFormat, width, height, + setup_drawpix_texture(ctx, tex, newTex, texIntFormat, width, height, GL_ALPHA, type, pixels); _mesa_ColorMask(GL_FALSE, GL_FALSE, GL_FALSE, GL_FALSE); @@ -1768,14 +1777,14 @@ _mesa_meta_DrawPixels(GLcontext *ctx, _mesa_ProgramLocalParameter4fvARB(GL_FRAGMENT_PROGRAM_ARB, 0, ctx->Current.RasterColor); - setup_drawpix_texture(tex, newTex, texIntFormat, width, height, + setup_drawpix_texture(ctx, tex, newTex, texIntFormat, width, height, format, type, pixels); _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4); } else { /* Drawing RGBA */ - setup_drawpix_texture(tex, newTex, texIntFormat, width, height, + setup_drawpix_texture(ctx, tex, newTex, texIntFormat, width, height, format, type, pixels); _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4); } @@ -1923,7 +1932,7 @@ _mesa_meta_Bitmap(GLcontext *ctx, _mesa_set_enable(ctx, GL_ALPHA_TEST, GL_TRUE); _mesa_AlphaFunc(GL_GREATER, 0.0); - setup_drawpix_texture(tex, newTex, texIntFormat, width, height, + setup_drawpix_texture(ctx, tex, newTex, texIntFormat, width, height, GL_ALPHA, GL_UNSIGNED_BYTE, bitmap8); _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4); -- cgit v1.2.3 From 660ca9c5a23240abca084089a626d4a94ef0799f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 28 Sep 2009 21:40:50 -0600 Subject: mesa: new _mesa_texstore() function --- src/mesa/main/texstore.c | 147 +++++++++++++++++++++++------------------------ src/mesa/main/texstore.h | 3 + 2 files changed, 76 insertions(+), 74 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index d47f71d0e2..880801464a 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -3265,6 +3265,28 @@ _mesa_get_texstore_func(gl_format format) } +/** + * Store user data into texture memory. + * Called via glTex[Sub]Image1/2/3D() + */ +GLboolean +_mesa_texstore(TEXSTORE_PARAMS) +{ + StoreTexImageFunc storeImage; + GLboolean success; + + storeImage = _mesa_get_texstore_func(dstFormat->MesaFormat); + + assert(storeImage); + + success = storeImage(ctx, dims, baseInternalFormat, + dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, + dstRowStride, dstImageOffsets, + srcWidth, srcHeight, srcDepth, + srcFormat, srcType, srcAddr, srcPacking); + return success; +} + /** * Check if an unpack PBO is active prior to fetching a texture image. @@ -3504,19 +3526,15 @@ _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level, else { const GLint dstRowStride = 0; GLboolean success; - const StoreTexImageFunc storeImage = - _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); - - ASSERT(storeImage); - - success = storeImage(ctx, 1, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, - texImage->ImageOffsets, - width, 1, 1, - format, type, pixels, packing); + + success = _mesa_texstore(ctx, 1, texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + 0, 0, 0, /* dstX/Y/Zoffset */ + dstRowStride, + texImage->ImageOffsets, + width, 1, 1, + format, type, pixels, packing); if (!success) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D"); } @@ -3579,10 +3597,6 @@ _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level, else { GLint dstRowStride; GLboolean success; - const StoreTexImageFunc storeImage = - _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); - - ASSERT(storeImage); if (texImage->IsCompressed) { dstRowStride @@ -3592,14 +3606,15 @@ _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level, dstRowStride = texImage->RowStride * texelBytes; } - success = storeImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, - texImage->ImageOffsets, - width, height, 1, - format, type, pixels, packing); + success = _mesa_texstore(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + 0, 0, 0, /* dstX/Y/Zoffset */ + dstRowStride, + texImage->ImageOffsets, + width, height, 1, + format, type, pixels, packing); + if (!success) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); } @@ -3658,10 +3673,6 @@ _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level, else { GLint dstRowStride; GLboolean success; - const StoreTexImageFunc storeImage = - _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); - - ASSERT(storeImage); if (texImage->IsCompressed) { dstRowStride @@ -3671,14 +3682,14 @@ _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level, dstRowStride = texImage->RowStride * texelBytes; } - success = storeImage(ctx, 3, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, - texImage->ImageOffsets, - width, height, depth, - format, type, pixels, packing); + success = _mesa_texstore(ctx, 3, texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + 0, 0, 0, /* dstX/Y/Zoffset */ + dstRowStride, + texImage->ImageOffsets, + width, height, depth, + format, type, pixels, packing); if (!success) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage3D"); } @@ -3711,19 +3722,15 @@ _mesa_store_texsubimage1d(GLcontext *ctx, GLenum target, GLint level, { const GLint dstRowStride = 0; GLboolean success; - const StoreTexImageFunc storeImage = - _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); - - ASSERT(storeImage); - - success = storeImage(ctx, 1, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - xoffset, 0, 0, /* offsets */ - dstRowStride, - texImage->ImageOffsets, - width, 1, 1, - format, type, pixels, packing); + + success = _mesa_texstore(ctx, 1, texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + xoffset, 0, 0, /* offsets */ + dstRowStride, + texImage->ImageOffsets, + width, 1, 1, + format, type, pixels, packing); if (!success) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage1D"); } @@ -3756,10 +3763,6 @@ _mesa_store_texsubimage2d(GLcontext *ctx, GLenum target, GLint level, { GLint dstRowStride = 0; GLboolean success; - const StoreTexImageFunc storeImage = - _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); - - ASSERT(storeImage); if (texImage->IsCompressed) { dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, @@ -3770,14 +3773,14 @@ _mesa_store_texsubimage2d(GLcontext *ctx, GLenum target, GLint level, _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); } - success = storeImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - xoffset, yoffset, 0, - dstRowStride, - texImage->ImageOffsets, - width, height, 1, - format, type, pixels, packing); + success = _mesa_texstore(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + xoffset, yoffset, 0, + dstRowStride, + texImage->ImageOffsets, + width, height, 1, + format, type, pixels, packing); if (!success) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage2D"); } @@ -3810,10 +3813,6 @@ _mesa_store_texsubimage3d(GLcontext *ctx, GLenum target, GLint level, { GLint dstRowStride; GLboolean success; - const StoreTexImageFunc storeImage = - _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); - - ASSERT(storeImage); if (texImage->IsCompressed) { dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, @@ -3824,14 +3823,14 @@ _mesa_store_texsubimage3d(GLcontext *ctx, GLenum target, GLint level, _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); } - success = storeImage(ctx, 3, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - xoffset, yoffset, zoffset, - dstRowStride, - texImage->ImageOffsets, - width, height, depth, - format, type, pixels, packing); + success = _mesa_texstore(ctx, 3, texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + xoffset, yoffset, zoffset, + dstRowStride, + texImage->ImageOffsets, + width, height, depth, + format, type, pixels, packing); if (!success) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage3D"); } diff --git a/src/mesa/main/texstore.h b/src/mesa/main/texstore.h index 771493cec6..8183c632df 100644 --- a/src/mesa/main/texstore.h +++ b/src/mesa/main/texstore.h @@ -194,6 +194,9 @@ _mesa_store_texsubimage3d(GLcontext *ctx, GLenum target, GLint level, extern StoreTexImageFunc _mesa_get_texstore_func(gl_format format); +extern GLboolean +_mesa_texstore(TEXSTORE_PARAMS); + extern void _mesa_store_compressed_teximage1d(GLcontext *ctx, GLenum target, GLint level, -- cgit v1.2.3 From 0b1f4dc0fa62c46030b39a0f7027dd1b0ef966fd Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 28 Sep 2009 21:41:11 -0600 Subject: drivers: use new _mesa_texstore() function --- src/mesa/drivers/dri/intel/intel_tex_image.c | 26 ++++---- src/mesa/drivers/dri/intel/intel_tex_subimage.c | 23 ++++--- src/mesa/drivers/dri/radeon/radeon_texture.c | 40 ++++++------ src/mesa/drivers/dri/tdfx/tdfx_tex.c | 83 +++++++++++-------------- src/mesa/drivers/dri/unichrome/via_tex.c | 21 +++---- 5 files changed, 87 insertions(+), 106 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index a9f031a3cb..0e13f600a6 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -518,9 +518,6 @@ intelTexImage(GLcontext * ctx, * conversion and copy: */ if (pixels) { - StoreTexImageFunc storeImage = - _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); - if (compressed) { if (intelImage->mt) { struct intel_region *dst = intelImage->mt->region; @@ -531,17 +528,20 @@ intelTexImage(GLcontext * ctx, pixels, srcRowStride, 0, 0); - } else + } + else { memcpy(texImage->Data, pixels, imageSize); - } else if (!storeImage(ctx, dims, - texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, - texImage->ImageOffsets, - width, height, depth, - format, type, pixels, unpack)) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage"); + } + } + else if (!_mesa_texstore(ctx, dims, + texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, 0, 0, 0, /* dstX/Y/Zoffset */ + dstRowStride, + texImage->ImageOffsets, + width, height, depth, + format, type, pixels, unpack)) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage"); } } diff --git a/src/mesa/drivers/dri/intel/intel_tex_subimage.c b/src/mesa/drivers/dri/intel/intel_tex_subimage.c index c8de38bc72..ad5c2271a1 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_subimage.c +++ b/src/mesa/drivers/dri/intel/intel_tex_subimage.c @@ -105,21 +105,20 @@ intelTexSubimage(GLcontext * ctx, xoffset, yoffset / 4, (width + 3) & ~3, (height + 3) / 4, pixels, (width + 3) & ~3, 0, 0); - } else + } + else { memcpy(texImage->Data, pixels, imageSize); + } } else { - StoreTexImageFunc storeImage = - _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); - - if (!storeImage(ctx, dims, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - xoffset, yoffset, zoffset, - dstRowStride, - texImage->ImageOffsets, - width, height, depth, - format, type, pixels, packing)) { + if (!_mesa_texstore(ctx, dims, texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + xoffset, yoffset, zoffset, + dstRowStride, + texImage->ImageOffsets, + width, height, depth, + format, type, pixels, packing)) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "intelTexSubImage"); } } diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 416ca1974b..3ff8cad93e 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -624,8 +624,6 @@ static void radeon_teximage( } else { GLuint dstRowStride; GLuint *dstImageOffsets; - StoreTexImageFunc storeImage = - _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); if (image->mt) { radeon_mipmap_level *lvl = &image->mt->levels[image->mtlevel]; @@ -648,15 +646,16 @@ static void radeon_teximage( dstImageOffsets = texImage->ImageOffsets; } - if (!storeImage(ctx, dims, - texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, - dstImageOffsets, - width, height, depth, - format, type, pixels, packing)) + if (!_mesa_texstore(ctx, dims, + texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, 0, 0, 0, /* dstX/Y/Zoffset */ + dstRowStride, + dstImageOffsets, + width, height, depth, + format, type, pixels, packing)) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage"); + } if (dims == 3) _mesa_free(dstImageOffsets); @@ -779,18 +778,17 @@ static void radeon_texsubimage(GLcontext* ctx, int dims, GLenum target, int leve copy_rows(img_start, dstRowStride, pixels, srcRowStride, rows, bytesPerRow); - } else { - StoreTexImageFunc storeImage = - _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); - - if (!storeImage(ctx, dims, texImage->_BaseFormat, - texImage->TexFormat, texImage->Data, - xoffset, yoffset, zoffset, - dstRowStride, - texImage->ImageOffsets, - width, height, depth, - format, type, pixels, packing)) + } + else { + if (!_mesa_texstore(ctx, dims, texImage->_BaseFormat, + texImage->TexFormat, texImage->Data, + xoffset, yoffset, zoffset, + dstRowStride, + texImage->ImageOffsets, + width, height, depth, + format, type, pixels, packing)) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage"); + } } } diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tex.c b/src/mesa/drivers/dri/tdfx/tdfx_tex.c index e87ee9eba2..84fe6984de 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_tex.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_tex.c @@ -138,18 +138,15 @@ _mesa_halve2x2_teximage2d ( GLcontext *ctx, } if (bpt) { - StoreTexImageFunc storeImage = - _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); - src = _s; dst = _d; - storeImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, dstImage, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstWidth * bpt, - &dstImageOffsets, - dstWidth, dstHeight, 1, - GL_BGRA, CHAN_TYPE, dst, &ctx->DefaultPacking); + _mesa_texstore(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, dstImage, + 0, 0, 0, /* dstX/Y/Zoffset */ + dstWidth * bpt, + &dstImageOffsets, + dstWidth, dstHeight, 1, + GL_BGRA, CHAN_TYPE, dst, &ctx->DefaultPacking); FREE(dst); FREE(src); } @@ -1231,21 +1228,19 @@ adjust2DRatio (GLcontext *ctx, if (!texImage->IsCompressed) { GLubyte *destAddr; - StoreTexImageFunc storeImage = - _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); tempImage = MALLOC(width * height * texelBytes); if (!tempImage) { return GL_FALSE; } - storeImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, tempImage, - 0, 0, 0, /* dstX/Y/Zoffset */ - width * texelBytes, /* dstRowStride */ - &dstImageOffsets, - width, height, 1, - format, type, pixels, packing); + _mesa_texstore(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, tempImage, + 0, 0, 0, /* dstX/Y/Zoffset */ + width * texelBytes, /* dstRowStride */ + &dstImageOffsets, + width, height, 1, + format, type, pixels, packing); /* now rescale */ /* compute address of dest subimage within the overal tex image */ @@ -1262,8 +1257,6 @@ adjust2DRatio (GLcontext *ctx, } else { const GLint rawBytes = 4; GLvoid *rawImage = MALLOC(width * height * rawBytes); - StoreTexImageFunc storeImage = - _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); if (!rawImage) { return GL_FALSE; @@ -1287,13 +1280,13 @@ adjust2DRatio (GLcontext *ctx, width, height, /* src */ newWidth, newHeight, /* dst */ rawImage /*src*/, tempImage /*dst*/ ); - storeImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, texImage->Data, - xoffset * mml->wScale, yoffset * mml->hScale, 0, /* dstX/Y/Zoffset */ - dstRowStride, - &dstImageOffsets, - newWidth, newHeight, 1, - GL_RGBA, CHAN_TYPE, tempImage, &ctx->DefaultPacking); + _mesa_texstore(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, texImage->Data, + xoffset * mml->wScale, yoffset * mml->hScale, 0, /* dstX/Y/Zoffset */ + dstRowStride, + &dstImageOffsets, + newWidth, newHeight, 1, + GL_RGBA, CHAN_TYPE, tempImage, &ctx->DefaultPacking); FREE(rawImage); } @@ -1446,16 +1439,13 @@ tdfxTexImage2D(GLcontext *ctx, GLenum target, GLint level, else { /* no rescaling needed */ /* unpack image, apply transfer ops and store in texImage->Data */ - StoreTexImageFunc storeImage = - _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); - - storeImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, texImage->Data, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, - texImage->ImageOffsets, - width, height, 1, - format, type, pixels, packing); + _mesa_texstore(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, texImage->Data, + 0, 0, 0, /* dstX/Y/Zoffset */ + dstRowStride, + texImage->ImageOffsets, + width, height, 1, + format, type, pixels, packing); } } @@ -1519,16 +1509,13 @@ tdfxTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, } else { /* no rescaling needed */ - StoreTexImageFunc storeImage = - _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); - - storeImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, texImage->Data, - xoffset, yoffset, 0, - dstRowStride, - texImage->ImageOffsets, - width, height, 1, - format, type, pixels, packing); + _mesa_texstore(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, texImage->Data, + xoffset, yoffset, 0, + dstRowStride, + texImage->ImageOffsets, + width, height, 1, + format, type, pixels, packing); } ti->reloadImages = GL_TRUE; /* signal the image needs to be reloaded */ diff --git a/src/mesa/drivers/dri/unichrome/via_tex.c b/src/mesa/drivers/dri/unichrome/via_tex.c index 02a0043bbe..f700994025 100644 --- a/src/mesa/drivers/dri/unichrome/via_tex.c +++ b/src/mesa/drivers/dri/unichrome/via_tex.c @@ -792,8 +792,6 @@ static void viaTexImage(GLcontext *ctx, else { GLint dstRowStride; GLboolean success; - StoreTexImageFunc storeImage = - _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); if (texImage->IsCompressed) { dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, width); @@ -801,16 +799,15 @@ static void viaTexImage(GLcontext *ctx, else { dstRowStride = postConvWidth * _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); } - ASSERT(storeImage); - success = storeImage(ctx, dims, - texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, - texImage->ImageOffsets, - width, height, 1, - format, type, pixels, packing); + success = _mesa_texstore(ctx, dims, + texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + 0, 0, 0, /* dstX/Y/Zoffset */ + dstRowStride, + texImage->ImageOffsets, + width, height, 1, + format, type, pixels, packing); if (!success) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage"); } -- cgit v1.2.3 From b436d729d1a2aacc13e274883b4dbdd104bdd1ad Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 28 Sep 2009 21:46:34 -0600 Subject: drivers: use _mesa_texstore --- src/mesa/drivers/dri/tdfx/tdfx_tex.c | 28 ++++++++++++++-------------- src/mesa/drivers/glide/fxddtex.c | 30 +++++++++++++++--------------- 2 files changed, 29 insertions(+), 29 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tex.c b/src/mesa/drivers/dri/tdfx/tdfx_tex.c index 84fe6984de..51d86aea37 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_tex.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_tex.c @@ -93,13 +93,13 @@ _mesa_halve2x2_teximage2d ( GLcontext *ctx, } _s = src = MALLOC(srcRowStride * srcHeight); _d = dst = MALLOC(dstWidth * bytesPerPixel * dstHeight); - _mesa_texstore_rgba8888(ctx, 2, GL_RGBA, - &_mesa_texformat_rgba8888_rev, src, - 0, 0, 0, /* dstX/Y/Zoffset */ - srcRowStride, /* dstRowStride */ - &dstImageOffsets, - srcWidth, srcHeight, 1, - texImage->_BaseFormat, _t, srcImage, &ctx->DefaultPacking); + _mesa_texstore(ctx, 2, GL_RGBA, + &_mesa_texformat_rgba8888_rev, src, + 0, 0, 0, /* dstX/Y/Zoffset */ + srcRowStride, /* dstRowStride */ + &dstImageOffsets, + srcWidth, srcHeight, 1, + texImage->_BaseFormat, _t, srcImage, &ctx->DefaultPacking); } if (srcHeight == 1) { @@ -1267,13 +1267,13 @@ adjust2DRatio (GLcontext *ctx, return GL_FALSE; } /* unpack image, apply transfer ops and store in rawImage */ - _mesa_texstore_rgba8888(ctx, 2, GL_RGBA, - &_mesa_texformat_rgba8888_rev, rawImage, - 0, 0, 0, /* dstX/Y/Zoffset */ - width * rawBytes, /* dstRowStride */ - &dstImageOffsets, - width, height, 1, - format, type, pixels, packing); + _mesa_texstore(ctx, 2, GL_RGBA, + &_mesa_texformat_rgba8888_rev, rawImage, + 0, 0, 0, /* dstX/Y/Zoffset */ + width * rawBytes, /* dstRowStride */ + &dstImageOffsets, + width, height, 1, + format, type, pixels, packing); _mesa_rescale_teximage2d(rawBytes, width, newWidth * rawBytes, /* dst stride */ diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c index 035c2ab92a..551ddb0fc7 100644 --- a/src/mesa/drivers/glide/fxddtex.c +++ b/src/mesa/drivers/glide/fxddtex.c @@ -91,14 +91,14 @@ _mesa_halve2x2_teximage2d ( GLcontext *ctx, } _s = src = MALLOC(srcRowStride * srcHeight); _d = dst = MALLOC(dstWidth * bytesPerPixel * dstHeight); - _mesa_texstore_rgba8888(ctx, 2, GL_RGBA, - &_mesa_texformat_rgba8888_rev, src, - 0, 0, 0, /* dstX/Y/Zoffset */ - srcRowStride, /* dstRowStride */ - 0, /* dstImageStride */ - srcWidth, srcHeight, 1, - texImage->_BaseFormat, _t, - srcImage, &ctx->DefaultPacking); + _mesa_texstore(ctx, 2, GL_RGBA, + &_mesa_texformat_rgba8888_rev, src, + 0, 0, 0, /* dstX/Y/Zoffset */ + srcRowStride, /* dstRowStride */ + 0, /* dstImageStride */ + srcWidth, srcHeight, 1, + texImage->_BaseFormat, _t, + srcImage, &ctx->DefaultPacking); } if (srcHeight == 1) { @@ -1281,13 +1281,13 @@ adjust2DRatio (GLcontext *ctx, return GL_FALSE; } /* unpack image, apply transfer ops and store in rawImage */ - _mesa_texstore_rgba8888(ctx, 2, GL_RGBA, - &_mesa_texformat_rgba8888_rev, rawImage, - 0, 0, 0, /* dstX/Y/Zoffset */ - width * rawBytes, /* dstRowStride */ - 0, /* dstImageStride */ - width, height, 1, - format, type, pixels, packing); + _mesa_texstore(ctx, 2, GL_RGBA, + &_mesa_texformat_rgba8888_rev, rawImage, + 0, 0, 0, /* dstX/Y/Zoffset */ + width * rawBytes, /* dstRowStride */ + 0, /* dstImageStride */ + width, height, 1, + format, type, pixels, packing); _mesa_rescale_teximage2d(rawBytes, width, newWidth * rawBytes, /* dst stride */ -- cgit v1.2.3 From cb0ef0cbf8116ebb8317b5711e1f119369bdf8f7 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 28 Sep 2009 21:49:10 -0600 Subject: glide: use _mesa_texstore() --- src/mesa/drivers/glide/fxddtex.c | 83 +++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 48 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c index 551ddb0fc7..354015af1d 100644 --- a/src/mesa/drivers/glide/fxddtex.c +++ b/src/mesa/drivers/glide/fxddtex.c @@ -137,18 +137,15 @@ _mesa_halve2x2_teximage2d ( GLcontext *ctx, } if (bpt) { - StoreTexImageFunc storeImage = - _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); - src = _s; dst = _d; - storeImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, dstImage, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstWidth * bpt, - 0, /* dstImageStride */ - dstWidth, dstHeight, 1, - GL_BGRA, CHAN_TYPE, dst, &ctx->DefaultPacking); + _mesa_texstore(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, dstImage, + 0, 0, 0, /* dstX/Y/Zoffset */ + dstWidth * bpt, + 0, /* dstImageStride */ + dstWidth, dstHeight, 1, + GL_BGRA, CHAN_TYPE, dst, &ctx->DefaultPacking); FREE(dst); FREE(src); } @@ -1239,21 +1236,19 @@ adjust2DRatio (GLcontext *ctx, if (!texImage->IsCompressed) { GLubyte *destAddr; - StoreTexImageFunc storeImage = - _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); tempImage = MALLOC(width * height * texelBytes); if (!tempImage) { return GL_FALSE; } - storeImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, tempImage, - 0, 0, 0, /* dstX/Y/Zoffset */ - width * texelBytes, /* dstRowStride */ - 0, /* dstImageStride */ - width, height, 1, - format, type, pixels, packing); + _mesa_texstore(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, tempImage, + 0, 0, 0, /* dstX/Y/Zoffset */ + width * texelBytes, /* dstRowStride */ + 0, /* dstImageStride */ + width, height, 1, + format, type, pixels, packing); /* now rescale */ /* compute address of dest subimage within the overal tex image */ @@ -1270,8 +1265,6 @@ adjust2DRatio (GLcontext *ctx, } else { const GLint rawBytes = 4; GLvoid *rawImage = MALLOC(width * height * rawBytes); - StoreTexImageFunc storeImage = - _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); if (!rawImage) { return GL_FALSE; @@ -1294,13 +1287,13 @@ adjust2DRatio (GLcontext *ctx, width, height, /* src */ newWidth, newHeight, /* dst */ rawImage /*src*/, tempImage /*dst*/ ); - storeImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, texImage->Data, - xoffset * mml->wScale, yoffset * mml->hScale, 0, /* dstX/Y/Zoffset */ - dstRowStride, - 0, /* dstImageStride */ - newWidth, newHeight, 1, - GL_RGBA, CHAN_TYPE, tempImage, &ctx->DefaultPacking); + _mesa_texstore(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, texImage->Data, + xoffset * mml->wScale, yoffset * mml->hScale, 0, /* dstX/Y/Zoffset */ + dstRowStride, + 0, /* dstImageStride */ + newWidth, newHeight, 1, + GL_RGBA, CHAN_TYPE, tempImage, &ctx->DefaultPacking); FREE(rawImage); } @@ -1441,16 +1434,13 @@ fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level, else { /* no rescaling needed */ /* unpack image, apply transfer ops and store in texImage->Data */ - StoreTexImageFunc storeImage = - _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); - - storeImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, texImage->Data, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, - 0, /* dstImageStride */ - width, height, 1, - format, type, pixels, packing); + _mesa_texstore(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, texImage->Data, + 0, 0, 0, /* dstX/Y/Zoffset */ + dstRowStride, + 0, /* dstImageStride */ + width, height, 1, + format, type, pixels, packing); } /* GL_SGIS_generate_mipmap */ @@ -1557,16 +1547,13 @@ fxDDTexSubImage2D(GLcontext * ctx, GLenum target, GLint level, } else { /* no rescaling needed */ - StoreTexImageFunc storeImage = - _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); - - storeImage(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, (GLubyte *) texImage->Data, - xoffset, yoffset, 0, /* dstX/Y/Zoffset */ - dstRowStride, - 0, /* dstImageStride */ - width, height, 1, - format, type, pixels, packing); + _mesa_texstore(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, (GLubyte *) texImage->Data, + xoffset, yoffset, 0, /* dstX/Y/Zoffset */ + dstRowStride, + 0, /* dstImageStride */ + width, height, 1, + format, type, pixels, packing); } /* GL_SGIS_generate_mipmap */ -- cgit v1.2.3 From 49263e08561e3380115f9e09056190f67fcb1890 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 28 Sep 2009 21:49:38 -0600 Subject: mesa: make individual texstore functions static --- src/mesa/main/texstore.c | 57 ++++++++++++++++++++++++------------------------ src/mesa/main/texstore.h | 43 ------------------------------------ 2 files changed, 28 insertions(+), 72 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 880801464a..e8c3e23b5b 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -1007,7 +1007,7 @@ memcpy_texture(GLcontext *ctx, * _mesa_texformat_intensity * */ -GLboolean +static GLboolean _mesa_texstore_rgba(TEXSTORE_PARAMS) { const GLint components = _mesa_components_in_format(baseInternalFormat); @@ -1158,7 +1158,7 @@ _mesa_texstore_rgba(TEXSTORE_PARAMS) /** * Store a 32-bit integer depth component texture image. */ -GLboolean +static GLboolean _mesa_texstore_z32(TEXSTORE_PARAMS) { const GLuint depthScale = 0xffffffff; @@ -1207,7 +1207,7 @@ _mesa_texstore_z32(TEXSTORE_PARAMS) /** * Store a 16-bit integer depth component texture image. */ -GLboolean +static GLboolean _mesa_texstore_z16(TEXSTORE_PARAMS) { const GLuint depthScale = 0xffff; @@ -1256,7 +1256,7 @@ _mesa_texstore_z16(TEXSTORE_PARAMS) /** * Store an rgb565 or rgb565_rev texture image. */ -GLboolean +static GLboolean _mesa_texstore_rgb565(TEXSTORE_PARAMS) { const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); @@ -1365,7 +1365,7 @@ _mesa_texstore_rgb565(TEXSTORE_PARAMS) /** * Store a texture in MESA_FORMAT_RGBA8888 or MESA_FORMAT_RGBA8888_REV. */ -GLboolean +static GLboolean _mesa_texstore_rgba8888(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); @@ -1490,7 +1490,7 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS) } -GLboolean +static GLboolean _mesa_texstore_argb8888(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); @@ -1683,7 +1683,7 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) } -GLboolean +static GLboolean _mesa_texstore_rgb888(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); @@ -1810,7 +1810,7 @@ _mesa_texstore_rgb888(TEXSTORE_PARAMS) } -GLboolean +static GLboolean _mesa_texstore_bgr888(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); @@ -1917,7 +1917,7 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS) return GL_TRUE; } -GLboolean +static GLboolean _mesa_texstore_rgba4444(TEXSTORE_PARAMS) { const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); @@ -1975,7 +1975,7 @@ _mesa_texstore_rgba4444(TEXSTORE_PARAMS) return GL_TRUE; } -GLboolean +static GLboolean _mesa_texstore_argb4444(TEXSTORE_PARAMS) { const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); @@ -2045,7 +2045,7 @@ _mesa_texstore_argb4444(TEXSTORE_PARAMS) return GL_TRUE; } -GLboolean +static GLboolean _mesa_texstore_rgba5551(TEXSTORE_PARAMS) { const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); @@ -2103,7 +2103,7 @@ _mesa_texstore_rgba5551(TEXSTORE_PARAMS) return GL_TRUE; } -GLboolean +static GLboolean _mesa_texstore_argb1555(TEXSTORE_PARAMS) { const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); @@ -2174,7 +2174,7 @@ _mesa_texstore_argb1555(TEXSTORE_PARAMS) } -GLboolean +static GLboolean _mesa_texstore_al88(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); @@ -2277,7 +2277,7 @@ _mesa_texstore_al88(TEXSTORE_PARAMS) } -GLboolean +static GLboolean _mesa_texstore_rgb332(TEXSTORE_PARAMS) { const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); @@ -2335,7 +2335,7 @@ _mesa_texstore_rgb332(TEXSTORE_PARAMS) /** * Texstore for _mesa_texformat_a8, _mesa_texformat_l8, _mesa_texformat_i8. */ -GLboolean +static GLboolean _mesa_texstore_a8(TEXSTORE_PARAMS) { const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); @@ -2420,7 +2420,7 @@ _mesa_texstore_a8(TEXSTORE_PARAMS) -GLboolean +static GLboolean _mesa_texstore_ci8(TEXSTORE_PARAMS) { const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); @@ -2467,7 +2467,7 @@ _mesa_texstore_ci8(TEXSTORE_PARAMS) /** * Texstore for _mesa_texformat_ycbcr or _mesa_texformat_ycbcr_rev. */ -GLboolean +static GLboolean _mesa_texstore_ycbcr(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); @@ -2513,7 +2513,7 @@ _mesa_texstore_ycbcr(TEXSTORE_PARAMS) return GL_TRUE; } -GLboolean +static GLboolean _mesa_texstore_dudv8(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); @@ -2607,7 +2607,7 @@ _mesa_texstore_dudv8(TEXSTORE_PARAMS) /** * Store a texture in MESA_FORMAT_SIGNED_RGBA8888 or MESA_FORMAT_SIGNED_RGBA8888_REV */ -GLboolean +static GLboolean _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); @@ -2728,7 +2728,7 @@ _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS) /** * Store a combined depth/stencil texture image. */ -GLboolean +static GLboolean _mesa_texstore_z24_s8(TEXSTORE_PARAMS) { const GLfloat depthScale = (GLfloat) 0xffffff; @@ -2829,7 +2829,7 @@ _mesa_texstore_z24_s8(TEXSTORE_PARAMS) /** * Store a combined depth/stencil texture image. */ -GLboolean +static GLboolean _mesa_texstore_s8_z24(TEXSTORE_PARAMS) { const GLuint depthScale = 0xffffff; @@ -2918,7 +2918,7 @@ _mesa_texstore_s8_z24(TEXSTORE_PARAMS) * _mesa_texformat_luminance_alpha_float32 * _mesa_texformat_intensity_float32 */ -GLboolean +static GLboolean _mesa_texstore_rgba_float32(TEXSTORE_PARAMS) { const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); @@ -2987,7 +2987,7 @@ _mesa_texstore_rgba_float32(TEXSTORE_PARAMS) /** * As above, but store 16-bit floats. */ -GLboolean +static GLboolean _mesa_texstore_rgba_float16(TEXSTORE_PARAMS) { const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); @@ -3056,7 +3056,7 @@ _mesa_texstore_rgba_float16(TEXSTORE_PARAMS) #if FEATURE_EXT_texture_sRGB -GLboolean +static GLboolean _mesa_texstore_srgb8(TEXSTORE_PARAMS) { const struct gl_texture_format *newDstFormat; @@ -3078,7 +3078,7 @@ _mesa_texstore_srgb8(TEXSTORE_PARAMS) } -GLboolean +static GLboolean _mesa_texstore_srgba8(TEXSTORE_PARAMS) { const struct gl_texture_format *newDstFormat; @@ -3088,7 +3088,6 @@ _mesa_texstore_srgba8(TEXSTORE_PARAMS) /* reuse normal rgba texstore code */ newDstFormat = &_mesa_texformat_rgba8888; - k = _mesa_texstore_rgba8888(ctx, dims, baseInternalFormat, newDstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, @@ -3100,7 +3099,7 @@ _mesa_texstore_srgba8(TEXSTORE_PARAMS) } -GLboolean +static GLboolean _mesa_texstore_sargb8(TEXSTORE_PARAMS) { const struct gl_texture_format *newDstFormat; @@ -3122,7 +3121,7 @@ _mesa_texstore_sargb8(TEXSTORE_PARAMS) } -GLboolean +static GLboolean _mesa_texstore_sl8(TEXSTORE_PARAMS) { const struct gl_texture_format *newDstFormat; @@ -3144,7 +3143,7 @@ _mesa_texstore_sl8(TEXSTORE_PARAMS) } -GLboolean +static GLboolean _mesa_texstore_sla8(TEXSTORE_PARAMS) { const struct gl_texture_format *newDstFormat; diff --git a/src/mesa/main/texstore.h b/src/mesa/main/texstore.h index 8183c632df..ad4773533e 100644 --- a/src/mesa/main/texstore.h +++ b/src/mesa/main/texstore.h @@ -75,49 +75,6 @@ typedef GLboolean (*StoreTexImageFunc)(TEXSTORE_PARAMS); - -extern GLboolean _mesa_texstore_rgba(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_color_index(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgba8888(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_argb8888(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgb888(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_bgr888(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgb565(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgb565_rev(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgba4444(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_argb4444(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_argb4444_rev(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgba5551(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_argb1555(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_argb1555_rev(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_al88(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_al88_rev(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgb332(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_a8(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_ci8(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_ycbcr(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_z24_s8(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_s8_z24(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_z16(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_z32(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgba_float32(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgba_float16(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS); -#if FEATURE_EXT_texture_sRGB -extern GLboolean _mesa_texstore_srgb8(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_srgba8(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_sargb8(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_sl8(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_sla8(TEXSTORE_PARAMS); -#endif -extern GLboolean _mesa_texstore_dudv8(TEXSTORE_PARAMS); -extern GLboolean _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS); - extern GLchan * _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims, GLenum logicalBaseFormat, -- cgit v1.2.3 From 6480210b89dc8ae0990c450d27870c7b7930f251 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 28 Sep 2009 21:52:23 -0600 Subject: st/mesa: use _mesa_texstore() --- src/mesa/state_tracker/st_cb_drawpixels.c | 24 ++++----- src/mesa/state_tracker/st_cb_texture.c | 83 ++++++++++++++----------------- 2 files changed, 47 insertions(+), 60 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index c56f987628..6da57e817b 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -392,8 +392,6 @@ make_texture(struct st_context *st, GLboolean success; GLubyte *dest; const GLbitfield imageTransferStateSave = ctx->_ImageTransferState; - const StoreTexImageFunc storeImage = - _mesa_get_texstore_func(mformat->MesaFormat); /* we'll do pixel transfer in a fragment shader */ ctx->_ImageTransferState = 0x0; @@ -410,17 +408,17 @@ make_texture(struct st_context *st, * Note that the image is actually going to be upside down in * the texture. We deal with that with texcoords. */ - success = storeImage(ctx, 2, /* dims */ - baseFormat, /* baseInternalFormat */ - mformat, /* gl_texture_format */ - dest, /* dest */ - 0, 0, 0, /* dstX/Y/Zoffset */ - transfer->stride, /* dstRowStride, bytes */ - &dstImageOffsets, /* dstImageOffsets */ - width, height, 1, /* size */ - format, type, /* src format/type */ - pixels, /* data source */ - unpack); + success = _mesa_texstore(ctx, 2, /* dims */ + baseFormat, /* baseInternalFormat */ + mformat, /* gl_texture_format */ + dest, /* dest */ + 0, 0, 0, /* dstX/Y/Zoffset */ + transfer->stride, /* dstRowStride, bytes */ + &dstImageOffsets, /* dstImageOffsets */ + width, height, 1, /* size */ + format, type, /* src format/type */ + pixels, /* data source */ + unpack); /* unmap */ screen->transfer_unmap(screen, transfer); diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 8bbffc3ff6..d96484c439 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -417,7 +417,6 @@ compress_with_blit(GLcontext * ctx, struct pipe_surface *dst_surface; struct pipe_transfer *tex_xfer; void *map; - StoreTexImageFunc storeImage; if (!stImage->pt) { /* XXX: Can this happen? Should we assert? */ @@ -464,18 +463,15 @@ compress_with_blit(GLcontext * ctx, 0, 0, width, height); /* x, y, w, h */ map = screen->transfer_map(screen, tex_xfer); - storeImage = _mesa_get_texstore_func(mesa_format->MesaFormat); - - - storeImage(ctx, 2, GL_RGBA, mesa_format, - map, /* dest ptr */ - 0, 0, 0, /* dest x/y/z offset */ - tex_xfer->stride, /* dest row stride (bytes) */ - dstImageOffsets, /* image offsets (for 3D only) */ - width, height, 1, /* size */ - format, type, /* source format/type */ - pixels, /* source data */ - unpack); /* source data packing */ + _mesa_texstore(ctx, 2, GL_RGBA, mesa_format, + map, /* dest ptr */ + 0, 0, 0, /* dest x/y/z offset */ + tex_xfer->stride, /* dest row stride (bytes) */ + dstImageOffsets, /* image offsets (for 3D only) */ + width, height, 1, /* size */ + format, type, /* source format/type */ + pixels, /* source data */ + unpack); /* source data packing */ screen->transfer_unmap(screen, tex_xfer); screen->tex_transfer_destroy(tex_xfer); @@ -737,19 +733,17 @@ st_TexImage(GLcontext * ctx, _mesa_image_image_stride(unpack, width, height, format, type); GLint i; const GLubyte *src = (const GLubyte *) pixels; - StoreTexImageFunc storeImage = - _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); for (i = 0; i < depth; i++) { - if (!storeImage(ctx, dims, - texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, - texImage->ImageOffsets, - width, height, 1, - format, type, src, unpack)) { + if (!_mesa_texstore(ctx, dims, + texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + 0, 0, 0, /* dstX/Y/Zoffset */ + dstRowStride, + texImage->ImageOffsets, + width, height, 1, + format, type, src, unpack)) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage"); } @@ -1056,9 +1050,6 @@ st_TexSubimage(GLcontext *ctx, GLint dims, GLenum target, GLint level, const GLubyte *src; /* init to silence warning only: */ enum pipe_transfer_usage transfer_usage = PIPE_TRANSFER_WRITE; - StoreTexImageFunc storeImage = - _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); - DBG("%s target %s level %d offset %d,%d %dx%d\n", __FUNCTION__, _mesa_lookup_enum_by_nr(target), @@ -1115,14 +1106,14 @@ st_TexSubimage(GLcontext *ctx, GLint dims, GLenum target, GLint level, dstRowStride = stImage->transfer->stride; for (i = 0; i < depth; i++) { - if (!storeImage(ctx, dims, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - 0, 0, 0, - dstRowStride, - texImage->ImageOffsets, - width, height, 1, - format, type, src, packing)) { + if (!_mesa_texstore(ctx, dims, texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + 0, 0, 0, + dstRowStride, + texImage->ImageOffsets, + width, height, 1, + format, type, src, packing)) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage"); } @@ -1361,8 +1352,6 @@ fallback_copy_texsubimage(GLcontext *ctx, GLenum target, GLint level, const GLint dstRowStride = stImage->transfer->stride; struct gl_texture_image *texImage = &stImage->base; struct gl_pixelstore_attrib unpack = ctx->DefaultPacking; - StoreTexImageFunc storeImage = - _mesa_get_texstore_func(texImage->TexFormat->MesaFormat); if (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP) { unpack.Invert = GL_TRUE; @@ -1380,16 +1369,16 @@ fallback_copy_texsubimage(GLcontext *ctx, GLenum target, GLint level, * is actually RGBA but the user created the texture as GL_RGB we * need to fill-in/override the alpha channel with 1.0. */ - storeImage(ctx, dims, - texImage->_BaseFormat, - texImage->TexFormat, - texDest, - 0, 0, 0, - dstRowStride, - texImage->ImageOffsets, - width, height, 1, - GL_RGBA, GL_FLOAT, tempSrc, /* src */ - &unpack); + _mesa_texstore(ctx, dims, + texImage->_BaseFormat, + texImage->TexFormat, + texDest, + 0, 0, 0, + dstRowStride, + texImage->ImageOffsets, + width, height, 1, + GL_RGBA, GL_FLOAT, tempSrc, /* src */ + &unpack); } else { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage"); -- cgit v1.2.3 From 0a306daf71588fc4ccfdc14450f8cd4ce00f9833 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 28 Sep 2009 21:52:43 -0600 Subject: mesa: use _mesa_texstore() --- src/mesa/main/mipmap.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 0950d8abea..c02c705228 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -1667,20 +1667,17 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, const GLenum srcFormat = _mesa_get_format_base_format(convertFormat); GLint dstRowStride = _mesa_compressed_row_stride(dstImage->TexFormat->MesaFormat, dstWidth); - const StoreTexImageFunc storeImage = - _mesa_get_texstore_func(dstImage->TexFormat->MesaFormat); - ASSERT(srcFormat == GL_RGB || srcFormat == GL_RGBA); - storeImage(ctx, 2, dstImage->_BaseFormat, - dstImage->TexFormat, - dstImage->Data, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, 0, /* strides */ - dstWidth, dstHeight, 1, /* size */ - srcFormat, CHAN_TYPE, - dstData, /* src data, actually */ - &ctx->DefaultPacking); + _mesa_texstore(ctx, 2, dstImage->_BaseFormat, + dstImage->TexFormat, + dstImage->Data, + 0, 0, 0, /* dstX/Y/Zoffset */ + dstRowStride, 0, /* strides */ + dstWidth, dstHeight, 1, /* size */ + srcFormat, CHAN_TYPE, + dstData, /* src data, actually */ + &ctx->DefaultPacking); /* swap src and dest pointers */ temp = (GLubyte *) srcData; -- cgit v1.2.3 From e2e7bd6c1f979179e6840cf0e8db72fc72751650 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 28 Sep 2009 21:55:47 -0600 Subject: mesa: move StoreTexImageFunc typedef to .c file --- src/mesa/main/texstore.c | 8 +++++++- src/mesa/main/texstore.h | 14 ++------------ 2 files changed, 9 insertions(+), 13 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index e8c3e23b5b..ca298bb237 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -76,6 +76,12 @@ enum { }; +/** + * Texture image storage function. + */ +typedef GLboolean (*StoreTexImageFunc)(TEXSTORE_PARAMS); + + /** * Return GL_TRUE if the given image format is one that be converted * to another format by swizzling. @@ -3250,7 +3256,7 @@ texstore_funcs[MESA_FORMAT_COUNT] = /** * Return the StoreTexImageFunc pointer to store an image in the given format. */ -StoreTexImageFunc +static StoreTexImageFunc _mesa_get_texstore_func(gl_format format) { GLuint i; diff --git a/src/mesa/main/texstore.h b/src/mesa/main/texstore.h index ad4773533e..4a217df103 100644 --- a/src/mesa/main/texstore.h +++ b/src/mesa/main/texstore.h @@ -68,11 +68,8 @@ const struct gl_pixelstore_attrib *srcPacking - -/** - * Texture image storage function. - */ -typedef GLboolean (*StoreTexImageFunc)(TEXSTORE_PARAMS); +extern GLboolean +_mesa_texstore(TEXSTORE_PARAMS); extern GLchan * @@ -148,13 +145,6 @@ _mesa_store_texsubimage3d(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_image *texImage); -extern StoreTexImageFunc -_mesa_get_texstore_func(gl_format format); - -extern GLboolean -_mesa_texstore(TEXSTORE_PARAMS); - - extern void _mesa_store_compressed_teximage1d(GLcontext *ctx, GLenum target, GLint level, GLint internalFormat, -- cgit v1.2.3 From a230ad2bc440e9d332482ea453e7ab7f4a5b8bd2 Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Tue, 29 Sep 2009 09:46:29 +0300 Subject: r600: clear position enable bit when when wpos is not used by FP Makes doom3 alot nicer.. --- src/mesa/drivers/dri/r600/r700_fragprog.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_fragprog.c b/src/mesa/drivers/dri/r600/r700_fragprog.c index 78ce3ae436..62a1ea1a22 100644 --- a/src/mesa/drivers/dri/r600/r700_fragprog.c +++ b/src/mesa/drivers/dri/r600/r700_fragprog.c @@ -341,6 +341,11 @@ GLboolean r700SetupFragmentProgram(GLcontext * ctx) SETbit(r700->SPI_PS_IN_CONTROL_0.u32All, POSITION_ENA_bit); SETbit(r700->SPI_INPUT_Z.u32All, PROVIDE_Z_TO_SPI_bit); } + else + { + CLEARbit(r700->SPI_PS_IN_CONTROL_0.u32All, POSITION_ENA_bit); + CLEARbit(r700->SPI_INPUT_Z.u32All, PROVIDE_Z_TO_SPI_bit); + } ui = (unNumOfReg < ui) ? ui : unNumOfReg; -- cgit v1.2.3 From 7c5f3c3d8a63b0feee154092153e958fa4f24abd Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Mon, 28 Sep 2009 10:42:35 +0300 Subject: r600: user correct alpha blend factor Signed-off-by: Dave Airlie --- src/mesa/drivers/dri/r600/r700_state.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index fbff109455..3ad6d74f53 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -493,10 +493,10 @@ static void r700SetBlendState(GLcontext * ctx) eqn, COLOR_COMB_FCN_shift, COLOR_COMB_FCN_mask); SETfield(blend_reg, - blend_factor(ctx->Color.BlendSrcRGB, GL_TRUE), + blend_factor(ctx->Color.BlendSrcA, GL_TRUE), ALPHA_SRCBLEND_shift, ALPHA_SRCBLEND_mask); SETfield(blend_reg, - blend_factor(ctx->Color.BlendDstRGB, GL_FALSE), + blend_factor(ctx->Color.BlendDstA, GL_FALSE), ALPHA_DESTBLEND_shift, ALPHA_DESTBLEND_mask); switch (ctx->Color.BlendEquationA) { -- cgit v1.2.3 From ac9c8b6359be770f1ed3e97100c497bd91338874 Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Mon, 28 Sep 2009 11:23:49 +0300 Subject: r600: use CB_TARGET_MASK instead of CB_SHADER_MASK for setting color mask makes blend functions work better Signed-off-by: Dave Airlie --- src/mesa/drivers/dri/r600/r700_state.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index 3ad6d74f53..7e8b48f91e 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -771,9 +771,9 @@ static void r700ColorMask(GLcontext * ctx, (b ? 4 : 0) | (a ? 8 : 0)); - if (mask != r700->CB_SHADER_MASK.u32All) { + if (mask != r700->CB_TARGET_MASK.u32All) { R600_STATECHANGE(context, cb); - SETfield(r700->CB_SHADER_MASK.u32All, mask, OUTPUT0_ENABLE_shift, OUTPUT0_ENABLE_mask); + SETfield(r700->CB_TARGET_MASK.u32All, mask, TARGET0_ENABLE_shift, TARGET0_ENABLE_mask); } } @@ -1780,7 +1780,7 @@ void r700InitState(GLcontext * ctx) //------------------- r700->CB_CLRCMP_MSK.u32All = 0xFFFFFFFF; /* screen/window/view */ - SETfield(r700->CB_TARGET_MASK.u32All, 0xF, (4 * id), TARGET0_ENABLE_mask); + SETfield(r700->CB_SHADER_MASK.u32All, 0xF, (4 * id), OUTPUT0_ENABLE_mask); context->radeon.hw.all_dirty = GL_TRUE; -- cgit v1.2.3 From 9b5541617fd16d4b1de474a766717edf72112d21 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 29 Sep 2009 09:32:37 -0600 Subject: mesa: work-around glXCopyContext() bug in _mesa_copy_texture_state() See bug 24217. --- src/mesa/main/texstate.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 861c5f37c4..8292d43eb6 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -99,16 +99,22 @@ _mesa_copy_texture_state( const GLcontext *src, GLcontext *dst ) dst->Texture.Unit[u].BumpTarget = src->Texture.Unit[u].BumpTarget; COPY_4V(dst->Texture.Unit[u].RotMatrix, src->Texture.Unit[u].RotMatrix); + /* + * XXX strictly speaking, we should compare texture names/ids and + * bind textures in the dest context according to id. For now, only + * copy bindings if the contexts share the same pool of textures to + * avoid refcounting bugs. + */ + if (dst->Shared == src->Shared) { + /* copy texture object bindings, not contents of texture objects */ + _mesa_lock_context_textures(dst); - /* copy texture object bindings, not contents of texture objects */ - _mesa_lock_context_textures(dst); - - for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) { - _mesa_reference_texobj(&dst->Texture.Unit[u].CurrentTex[tex], - src->Texture.Unit[u].CurrentTex[tex]); + for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) { + _mesa_reference_texobj(&dst->Texture.Unit[u].CurrentTex[tex], + src->Texture.Unit[u].CurrentTex[tex]); + } + _mesa_unlock_context_textures(dst); } - - _mesa_unlock_context_textures(dst); } } -- cgit v1.2.3 From 69a3043f4109463f35e87102e509e0a4599cd09a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 29 Sep 2009 09:36:06 -0600 Subject: mesa: bump version to 7.6.1 --- src/mesa/main/version.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index 0ccdbf94a1..f24e11cc51 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 7.6 + * Version: 7.6.1 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * Copyright (C) 2009 VMware, Inc. All Rights Reserved. @@ -31,8 +31,8 @@ /* Mesa version */ #define MESA_MAJOR 7 #define MESA_MINOR 6 -#define MESA_PATCH 0 -#define MESA_VERSION_STRING "7.6" +#define MESA_PATCH 1 +#define MESA_VERSION_STRING "7.6.1-devel" /* To make version comparison easy */ #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -- cgit v1.2.3 From c7aee65bb96df3f8e8421b5125dca84c028e9073 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 28 Sep 2009 15:26:12 -0600 Subject: mesa: added _mesa_nop_vertex/fragment_program() For debug/test purposes. --- src/mesa/shader/programopt.c | 91 ++++++++++++++++++++++++++++++++++++++++++++ src/mesa/shader/programopt.h | 7 ++++ 2 files changed, 98 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/shader/programopt.c b/src/mesa/shader/programopt.c index f70c75cec8..3b8529592d 100644 --- a/src/mesa/shader/programopt.c +++ b/src/mesa/shader/programopt.c @@ -573,3 +573,94 @@ _mesa_remove_output_reads(struct gl_program *prog, gl_register_file type) } } } + + +/** + * Make the given fragment program into a "no-op" shader. + * Actually, just copy the incoming fragment color (or texcoord) + * to the output color. + * This is for debug/test purposes. + */ +void +_mesa_nop_fragment_program(GLcontext *ctx, struct gl_fragment_program *prog) +{ + struct prog_instruction *inst; + GLuint inputAttr; + + inst = _mesa_alloc_instructions(2); + if (!inst) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "_mesa_nop_fragment_program"); + return; + } + + _mesa_init_instructions(inst, 2); + + inst[0].Opcode = OPCODE_MOV; + inst[0].DstReg.File = PROGRAM_OUTPUT; + inst[0].DstReg.Index = FRAG_RESULT_COLOR; + inst[0].SrcReg[0].File = PROGRAM_INPUT; + if (prog->Base.InputsRead & FRAG_BIT_COL0) + inputAttr = FRAG_ATTRIB_COL0; + else + inputAttr = FRAG_ATTRIB_TEX0; + inst[0].SrcReg[0].Index = inputAttr; + + inst[1].Opcode = OPCODE_END; + + _mesa_free_instructions(prog->Base.Instructions, + prog->Base.NumInstructions); + + prog->Base.Instructions = inst; + prog->Base.NumInstructions = 2; + prog->Base.InputsRead = 1 << inputAttr; + prog->Base.OutputsWritten = 1 << FRAG_RESULT_COLOR; +} + + +/** + * \sa _mesa_nop_fragment_program + * Replace the given vertex program with a "no-op" program that just + * transforms vertex position and emits color. + */ +void +_mesa_nop_vertex_program(GLcontext *ctx, struct gl_vertex_program *prog) +{ + struct prog_instruction *inst; + GLuint inputAttr; + + /* + * Start with a simple vertex program that emits color. + */ + inst = _mesa_alloc_instructions(2); + if (!inst) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "_mesa_nop_vertex_program"); + return; + } + + _mesa_init_instructions(inst, 2); + + inst[0].Opcode = OPCODE_MOV; + inst[0].DstReg.File = PROGRAM_OUTPUT; + inst[0].DstReg.Index = VERT_RESULT_COL0; + inst[0].SrcReg[0].File = PROGRAM_INPUT; + if (prog->Base.InputsRead & VERT_BIT_COLOR0) + inputAttr = VERT_ATTRIB_COLOR0; + else + inputAttr = VERT_ATTRIB_TEX0; + inst[0].SrcReg[0].Index = inputAttr; + + inst[1].Opcode = OPCODE_END; + + _mesa_free_instructions(prog->Base.Instructions, + prog->Base.NumInstructions); + + prog->Base.Instructions = inst; + prog->Base.NumInstructions = 2; + prog->Base.InputsRead = 1 << inputAttr; + prog->Base.OutputsWritten = 1 << VERT_RESULT_COL0; + + /* + * Now insert code to do standard modelview/projection transformation. + */ + _mesa_insert_mvp_code(ctx, prog); +} diff --git a/src/mesa/shader/programopt.h b/src/mesa/shader/programopt.h index 96acaf9566..21fac07849 100644 --- a/src/mesa/shader/programopt.h +++ b/src/mesa/shader/programopt.h @@ -42,4 +42,11 @@ _mesa_count_texture_instructions(struct gl_program *prog); extern void _mesa_remove_output_reads(struct gl_program *prog, gl_register_file type); +extern void +_mesa_nop_fragment_program(GLcontext *ctx, struct gl_fragment_program *prog); + +extern void +_mesa_nop_vertex_program(GLcontext *ctx, struct gl_vertex_program *prog); + + #endif /* PROGRAMOPT_H */ -- cgit v1.2.3 From cb0de06301cd086a02ca709917819119dc1a8fd9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 29 Sep 2009 10:22:32 -0600 Subject: mesa: added nopfrag/nopvert options for MESA_GLSL These options can be used to force vertex/fragment shaders to be no-op shaders (actually, simple pass-through shaders). For debug/test purposes. --- src/mesa/main/mtypes.h | 2 ++ src/mesa/shader/shader_api.c | 4 ++++ src/mesa/shader/slang/slang_compile.c | 10 ++++++++++ 3 files changed, 16 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index d7bf7689f3..d005064645 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2066,6 +2066,8 @@ struct gl_shader_program #define GLSL_OPT 0x4 /**< Force optimizations (override pragmas) */ #define GLSL_NO_OPT 0x8 /**< Force no optimizations (override pragmas) */ #define GLSL_UNIFORMS 0x10 /**< Print glUniform calls */ +#define GLSL_NOP_VERT 0x20 /**< Force no-op vertex shaders */ +#define GLSL_NOP_FRAG 0x40 /**< Force no-op fragment shaders */ /** diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 178b7d0dba..6b19b4c46b 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -380,6 +380,10 @@ get_shader_flags(void) flags |= GLSL_DUMP; if (_mesa_strstr(env, "log")) flags |= GLSL_LOG; + if (_mesa_strstr(env, "nopvert")) + flags |= GLSL_NOP_VERT; + if (_mesa_strstr(env, "nopfrag")) + flags |= GLSL_NOP_FRAG; if (_mesa_strstr(env, "nopt")) flags |= GLSL_NO_OPT; else if (_mesa_strstr(env, "opt")) diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index c1b97c7cb7..a270888443 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -2814,6 +2814,16 @@ _slang_compile(GLcontext *ctx, struct gl_shader *shader) (ctx->Shader.Flags & GLSL_NO_OPT) == 0) { _mesa_optimize_program(ctx, shader->Program); } + if ((ctx->Shader.Flags & GLSL_NOP_VERT) && + shader->Program->Target == GL_VERTEX_PROGRAM_ARB) { + _mesa_nop_vertex_program(ctx, + (struct gl_vertex_program *) shader->Program); + } + if ((ctx->Shader.Flags & GLSL_NOP_FRAG) && + shader->Program->Target == GL_FRAGMENT_PROGRAM_ARB) { + _mesa_nop_fragment_program(ctx, + (struct gl_fragment_program *) shader->Program); + } } if (ctx->Shader.Flags & GLSL_LOG) { -- cgit v1.2.3 From 86ee448047e4f7be722b69da5296ccafc2307145 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 29 Sep 2009 12:16:12 -0600 Subject: mesa/xlib: fix GLX_RENDER_TYPE query Return GLX_RGBA_TYPE or GLX_COLOR_INDEX_TYPE. --- src/mesa/drivers/x11/fakeglx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index 34e0b8bc8d..eb7c4f6417 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -2477,9 +2477,9 @@ Fake_glXQueryContext( Display *dpy, GLXContext ctx, int attribute, int *value ) break; case GLX_RENDER_TYPE: if (xmctx->xm_visual->mesa_visual.rgbMode) - *value = GLX_RGBA_BIT; + *value = GLX_RGBA_TYPE; else - *value = GLX_COLOR_INDEX_BIT; + *value = GLX_COLOR_INDEX_TYPE; break; case GLX_SCREEN: *value = 0; -- cgit v1.2.3 From 3c794e45b02c66ce3f52fe359f733e4d7d2ce315 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 29 Sep 2009 18:51:49 -0600 Subject: glsl: add support for CMP instruction --- src/mesa/shader/slang/slang_codegen.c | 1 + src/mesa/shader/slang/slang_emit.c | 1 + src/mesa/shader/slang/slang_ir.c | 1 + src/mesa/shader/slang/slang_ir.h | 1 + 4 files changed, 4 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 703af9f874..344dfdc680 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -422,6 +422,7 @@ static slang_asm_info AsmInfo[] = { { "vec4_lrp", IR_LRP, 1, 3 }, { "vec4_min", IR_MIN, 1, 2 }, { "vec4_max", IR_MAX, 1, 2 }, + { "vec4_cmp", IR_CMP, 1, 3 }, { "vec4_clamp", IR_CLAMP, 1, 3 }, { "vec4_seq", IR_SEQUAL, 1, 2 }, { "vec4_sne", IR_SNEQUAL, 1, 2 }, diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index 3f455e0640..3af301eacd 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -2287,6 +2287,7 @@ emit(slang_emit_info *emitInfo, slang_ir_node *n) case IR_POW: /* trinary operators */ case IR_LRP: + case IR_CMP: return emit_arith(emitInfo, n); case IR_EQUAL: diff --git a/src/mesa/shader/slang/slang_ir.c b/src/mesa/shader/slang/slang_ir.c index 1c7f7474e7..62603503dd 100644 --- a/src/mesa/shader/slang/slang_ir.c +++ b/src/mesa/shader/slang/slang_ir.c @@ -80,6 +80,7 @@ static const slang_ir_info IrInfo[] = { { IR_NOISE4, "IR_NOISE4", OPCODE_NOISE4, 1, 1 }, /* other */ + { IR_CMP, "IR_CMP", OPCODE_CMP, 4, 3 }, /* compare/select */ { IR_SEQ, "IR_SEQ", OPCODE_NOP, 0, 0 }, { IR_SCOPE, "IR_SCOPE", OPCODE_NOP, 0, 0 }, { IR_LABEL, "IR_LABEL", OPCODE_NOP, 0, 0 }, diff --git a/src/mesa/shader/slang/slang_ir.h b/src/mesa/shader/slang/slang_ir.h index e796693ed5..166b4e8043 100644 --- a/src/mesa/shader/slang/slang_ir.h +++ b/src/mesa/shader/slang/slang_ir.h @@ -91,6 +91,7 @@ typedef enum IR_CLAMP, IR_MIN, IR_MAX, + IR_CMP, /* = (op0 < 0) ? op1 : op2 */ IR_SEQUAL, /* Set if args are equal (vector) */ IR_SNEQUAL, /* Set if args are not equal (vector) */ IR_SGE, /* Set if greater or equal (vector) */ -- cgit v1.2.3 From 65765c9f2c5d3568608bde57db0bf44d6b724755 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 29 Sep 2009 18:57:13 -0600 Subject: glsl: rewrite sqrt(x) intrinsic to handle x=0 Since sqrt() is basically implemented in terms of RSQ/RCP we'll do a divide by zero if x=0 and wind up with unpredictable results. Now use CMP instruction to test for x<=0 and return zero in that case. --- .../shader/slang/library/slang_common_builtin.gc | 76 ++++++++++++---------- 1 file changed, 42 insertions(+), 34 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/slang/library/slang_common_builtin.gc b/src/mesa/shader/slang/library/slang_common_builtin.gc index 9764fc25b0..56de47ee8d 100644 --- a/src/mesa/shader/slang/library/slang_common_builtin.gc +++ b/src/mesa/shader/slang/library/slang_common_builtin.gc @@ -602,42 +602,50 @@ vec4 exp2(const vec4 a) float sqrt(const float x) { + const float nx = -x; float r; __asm float_rsq r, x; - __asm float_rcp __retVal, r; -} - -vec2 sqrt(const vec2 v) -{ - float r; - __asm float_rsq r, v.x; - __asm float_rcp __retVal.x, r; - __asm float_rsq r, v.y; - __asm float_rcp __retVal.y, r; -} - -vec3 sqrt(const vec3 v) -{ - float r; - __asm float_rsq r, v.x; - __asm float_rcp __retVal.x, r; - __asm float_rsq r, v.y; - __asm float_rcp __retVal.y, r; - __asm float_rsq r, v.z; - __asm float_rcp __retVal.z, r; -} - -vec4 sqrt(const vec4 v) -{ - float r; - __asm float_rsq r, v.x; - __asm float_rcp __retVal.x, r; - __asm float_rsq r, v.y; - __asm float_rcp __retVal.y, r; - __asm float_rsq r, v.z; - __asm float_rcp __retVal.z, r; - __asm float_rsq r, v.w; - __asm float_rcp __retVal.w, r; + __asm float_rcp r, r; + __asm vec4_cmp __retVal, nx, r, 0.0; +} + +vec2 sqrt(const vec2 x) +{ + const vec2 nx = -x, zero = vec2(0.0); + vec2 r; + __asm float_rsq r.x, x.x; + __asm float_rsq r.y, x.y; + __asm float_rcp r.x, r.x; + __asm float_rcp r.y, r.y; + __asm vec4_cmp __retVal, nx, r, zero; +} + +vec3 sqrt(const vec3 x) +{ + const vec3 nx = -x, zero = vec3(0.0); + vec3 r; + __asm float_rsq r.x, x.x; + __asm float_rsq r.y, x.y; + __asm float_rsq r.z, x.z; + __asm float_rcp r.x, r.x; + __asm float_rcp r.y, r.y; + __asm float_rcp r.z, r.z; + __asm vec4_cmp __retVal, nx, r, zero; +} + +vec4 sqrt(const vec4 x) +{ + const vec4 nx = -x, zero = vec4(0.0); + vec4 r; + __asm float_rsq r.x, x.x; + __asm float_rsq r.y, x.y; + __asm float_rsq r.z, x.z; + __asm float_rsq r.w, x.w; + __asm float_rcp r.x, r.x; + __asm float_rcp r.y, r.y; + __asm float_rcp r.z, r.z; + __asm float_rcp r.w, r.w; + __asm vec4_cmp __retVal, nx, r, zero; } -- cgit v1.2.3 From 322bc403bc7aacb58c39527f5f7a324e0c63c73d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 29 Sep 2009 18:59:37 -0600 Subject: glsl: regenerated file --- .../shader/slang/library/slang_common_builtin_gc.h | 106 +++++++++++---------- 1 file changed, 57 insertions(+), 49 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/slang/library/slang_common_builtin_gc.h b/src/mesa/shader/slang/library/slang_common_builtin_gc.h index 78a7b83ec1..3c3666e4ea 100644 --- a/src/mesa/shader/slang/library/slang_common_builtin_gc.h +++ b/src/mesa/shader/slang/library/slang_common_builtin_gc.h @@ -307,55 +307,63 @@ 0,0,18,97,0,59,121,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0, 59,122,0,0,18,97,0,59,122,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86, 97,108,0,59,119,0,0,18,97,0,59,119,0,0,0,0,1,90,95,0,0,9,0,0,115,113,114,116,0,1,1,0,0,9,0,120,0,0, -0,1,3,2,90,95,0,0,9,0,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,120,0,0,0,4, -102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,0,18,114,0,0,0,0,1,90,95,0,0, -10,0,0,115,113,114,116,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,114,0,0,0,4,102,108,111,97, -116,95,114,115,113,0,18,114,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95, -95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0, -0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59, -121,0,0,18,114,0,0,0,0,1,90,95,0,0,11,0,0,115,113,114,116,0,1,1,0,0,11,0,118,0,0,0,1,3,2,90,95,0,0, -9,0,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,120,0,0,0,4,102,108, -111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,4,102,108,111, -97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18, -95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114, -0,0,18,118,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59, -122,0,0,18,114,0,0,0,0,1,90,95,0,0,12,0,0,115,113,114,116,0,1,1,0,0,12,0,118,0,0,0,1,3,2,90,95,0,0, -9,0,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,120,0,0,0,4,102,108, -111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,4,102,108,111, -97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18, -95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114, -0,0,18,118,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59, -122,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,119,0,0,0,4,102, -108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,114,0,0,0,0,1,90,95, -0,0,9,0,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,9,0,120,0,0,0,1,4,102,108,111,97, -116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,120,0,0,0,0,1,90,95,0,0,10,0,0, -105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,10,0,118,0,0,0,1,4,102,108,111,97,116,95,114, -115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116, -95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,0,1,90,95,0,0, -11,0,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,11,0,118,0,0,0,1,4,102,108,111,97,116, -95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111, -97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,4,102, -108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59,122,0,0,0, -0,1,90,95,0,0,12,0,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,12,0,118,0,0,0,1,4,102, -108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0, -4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121, -0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0, -59,122,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18, -118,0,59,119,0,0,0,0,1,90,95,0,0,9,0,0,110,111,114,109,97,108,105,122,101,0,1,1,0,0,9,0,120,0,0,0, -1,9,18,95,95,114,101,116,86,97,108,0,17,49,0,48,0,0,20,0,0,1,90,95,0,0,10,0,0,110,111,114,109,97, -108,105,122,101,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,1,0,9,0,1,115,0,2,58,105,110,118,101,114,115, -101,115,113,114,116,0,0,58,100,111,116,0,0,18,118,0,0,18,118,0,0,0,0,0,0,0,4,118,101,99,52,95,109, -117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,18,115,0, -0,0,0,1,90,95,0,0,11,0,0,110,111,114,109,97,108,105,122,101,0,1,1,0,0,11,0,118,0,0,0,1,3,2,90,95,0, -0,9,0,1,116,109,112,0,0,0,4,118,101,99,51,95,100,111,116,0,18,116,109,112,0,0,18,118,0,0,18,118,0, -0,0,4,102,108,111,97,116,95,114,115,113,0,18,116,109,112,0,0,18,116,109,112,0,0,0,4,118,101,99,52, -95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0, -0,18,116,109,112,0,0,0,0,1,90,95,0,0,12,0,0,110,111,114,109,97,108,105,122,101,0,1,1,0,0,12,0,118, -0,0,0,1,3,2,90,95,0,0,9,0,1,116,109,112,0,0,0,4,118,101,99,52,95,100,111,116,0,18,116,109,112,0,0, -18,118,0,0,18,118,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,116,109,112,0,0,18,116,109,112,0, -0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120, -121,122,0,0,18,118,0,0,18,116,109,112,0,0,0,0,1,90,95,0,0,9,0,0,97,98,115,0,1,1,0,0,9,0,97,0,0,0,1, -4,118,101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,90,95,0,0,10,0,0, +0,1,3,2,90,95,1,0,9,0,1,110,120,0,2,18,120,0,54,0,0,3,2,90,95,0,0,9,0,1,114,0,0,0,4,102,108,111,97, +116,95,114,115,113,0,18,114,0,0,18,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,114,0,0,18, +114,0,0,0,4,118,101,99,52,95,99,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,110,120,0,0,18,114, +0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,10,0,0,115,113,114,116,0,1,1,0,0,10,0,120,0,0,0,1,3,2,90,95,1, +0,10,0,1,110,120,0,2,18,120,0,54,0,1,1,122,101,114,111,0,2,58,118,101,99,50,0,0,17,48,0,48,0,0,0,0, +0,0,3,2,90,95,0,0,10,0,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,59,120,0,0,18, +120,0,59,120,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,59,121,0,0,18,120,0,59,121,0,0,0, +4,102,108,111,97,116,95,114,99,112,0,18,114,0,59,120,0,0,18,114,0,59,120,0,0,0,4,102,108,111,97, +116,95,114,99,112,0,18,114,0,59,121,0,0,18,114,0,59,121,0,0,0,4,118,101,99,52,95,99,109,112,0,18, +95,95,114,101,116,86,97,108,0,0,18,110,120,0,0,18,114,0,0,18,122,101,114,111,0,0,0,0,1,90,95,0,0, +11,0,0,115,113,114,116,0,1,1,0,0,11,0,120,0,0,0,1,3,2,90,95,1,0,11,0,1,110,120,0,2,18,120,0,54,0,1, +1,122,101,114,111,0,2,58,118,101,99,51,0,0,17,48,0,48,0,0,0,0,0,0,3,2,90,95,0,0,11,0,1,114,0,0,0,4, +102,108,111,97,116,95,114,115,113,0,18,114,0,59,120,0,0,18,120,0,59,120,0,0,0,4,102,108,111,97,116, +95,114,115,113,0,18,114,0,59,121,0,0,18,120,0,59,121,0,0,0,4,102,108,111,97,116,95,114,115,113,0, +18,114,0,59,122,0,0,18,120,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,114,0,59,120,0,0, +18,114,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,114,0,59,121,0,0,18,114,0,59,121,0,0, +0,4,102,108,111,97,116,95,114,99,112,0,18,114,0,59,122,0,0,18,114,0,59,122,0,0,0,4,118,101,99,52, +95,99,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,110,120,0,0,18,114,0,0,18,122,101,114,111,0, +0,0,0,1,90,95,0,0,12,0,0,115,113,114,116,0,1,1,0,0,12,0,120,0,0,0,1,3,2,90,95,1,0,12,0,1,110,120,0, +2,18,120,0,54,0,1,1,122,101,114,111,0,2,58,118,101,99,52,0,0,17,48,0,48,0,0,0,0,0,0,3,2,90,95,0,0, +12,0,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,59,120,0,0,18,120,0,59,120,0,0,0,4, +102,108,111,97,116,95,114,115,113,0,18,114,0,59,121,0,0,18,120,0,59,121,0,0,0,4,102,108,111,97,116, +95,114,115,113,0,18,114,0,59,122,0,0,18,120,0,59,122,0,0,0,4,102,108,111,97,116,95,114,115,113,0, +18,114,0,59,119,0,0,18,120,0,59,119,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,114,0,59,120,0,0, +18,114,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,114,0,59,121,0,0,18,114,0,59,121,0,0, +0,4,102,108,111,97,116,95,114,99,112,0,18,114,0,59,122,0,0,18,114,0,59,122,0,0,0,4,102,108,111,97, +116,95,114,99,112,0,18,114,0,59,119,0,0,18,114,0,59,119,0,0,0,4,118,101,99,52,95,99,109,112,0,18, +95,95,114,101,116,86,97,108,0,0,18,110,120,0,0,18,114,0,0,18,122,101,114,111,0,0,0,0,1,90,95,0,0,9, +0,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,9,0,120,0,0,0,1,4,102,108,111,97,116,95, +114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,120,0,0,0,0,1,90,95,0,0,10,0,0,105, +110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,10,0,118,0,0,0,1,4,102,108,111,97,116,95,114,115, +113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95, +114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,0,1,90,95,0,0,11,0, +0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,11,0,118,0,0,0,1,4,102,108,111,97,116,95, +114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97, +116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,4,102,108, +111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59,122,0,0,0,0,1, +90,95,0,0,12,0,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,12,0,118,0,0,0,1,4,102,108, +111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4, +102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0, +0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59, +122,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,118, +0,59,119,0,0,0,0,1,90,95,0,0,9,0,0,110,111,114,109,97,108,105,122,101,0,1,1,0,0,9,0,120,0,0,0,1,9, +18,95,95,114,101,116,86,97,108,0,17,49,0,48,0,0,20,0,0,1,90,95,0,0,10,0,0,110,111,114,109,97,108, +105,122,101,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,1,0,9,0,1,115,0,2,58,105,110,118,101,114,115,101, +115,113,114,116,0,0,58,100,111,116,0,0,18,118,0,0,18,118,0,0,0,0,0,0,0,4,118,101,99,52,95,109,117, +108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,18,115,0,0,0, +0,1,90,95,0,0,11,0,0,110,111,114,109,97,108,105,122,101,0,1,1,0,0,11,0,118,0,0,0,1,3,2,90,95,0,0,9, +0,1,116,109,112,0,0,0,4,118,101,99,51,95,100,111,116,0,18,116,109,112,0,0,18,118,0,0,18,118,0,0,0, +4,102,108,111,97,116,95,114,115,113,0,18,116,109,112,0,0,18,116,109,112,0,0,0,4,118,101,99,52,95, +109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0, +18,116,109,112,0,0,0,0,1,90,95,0,0,12,0,0,110,111,114,109,97,108,105,122,101,0,1,1,0,0,12,0,118,0, +0,0,1,3,2,90,95,0,0,9,0,1,116,109,112,0,0,0,4,118,101,99,52,95,100,111,116,0,18,116,109,112,0,0,18, +118,0,0,18,118,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,116,109,112,0,0,18,116,109,112,0,0,0, +4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121, +122,0,0,18,118,0,0,18,116,109,112,0,0,0,0,1,90,95,0,0,9,0,0,97,98,115,0,1,1,0,0,9,0,97,0,0,0,1,4, +118,101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,90,95,0,0,10,0,0, 97,98,115,0,1,1,0,0,10,0,97,0,0,0,1,4,118,101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97,108, 0,59,120,121,0,0,18,97,0,0,0,0,1,90,95,0,0,11,0,0,97,98,115,0,1,1,0,0,11,0,97,0,0,0,1,4,118,101,99, 52,95,97,98,115,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,0,0,0,1,90,95,0,0,12, -- cgit v1.2.3 From a833ff0f53da6e365d917bb0081d909a809b6ec1 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Mon, 7 Sep 2009 17:51:42 +0800 Subject: mesa/main: Make FEATURE_accum follow feature conventions. As shown in mfeatures.h, this allows users of accum.h to work without knowing if the feature is available. --- src/mesa/main/accum.c | 16 +++++++++++++++- src/mesa/main/accum.h | 39 +++++++++++++++++++++++++++------------ src/mesa/main/api_exec.c | 9 +++------ src/mesa/main/context.c | 4 ---- 4 files changed, 45 insertions(+), 23 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/accum.c b/src/mesa/main/accum.c index 2345695f3c..032e13b96e 100644 --- a/src/mesa/main/accum.c +++ b/src/mesa/main/accum.c @@ -29,6 +29,10 @@ #include "macros.h" #include "state.h" #include "mtypes.h" +#include "glapi/dispatch.h" + + +#if FEATURE_accum void GLAPIENTRY @@ -51,7 +55,7 @@ _mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_Accum( GLenum op, GLfloat value ) { GET_CURRENT_CONTEXT(ctx); @@ -99,6 +103,16 @@ _mesa_Accum( GLenum op, GLfloat value ) } +void +_mesa_init_accum_dispatch(struct _glapi_table *disp) +{ + SET_Accum(disp, _mesa_Accum); + SET_ClearAccum(disp, _mesa_ClearAccum); +} + + +#endif /* FEATURE_accum */ + void _mesa_init_accum( GLcontext *ctx ) diff --git a/src/mesa/main/accum.h b/src/mesa/main/accum.h index ce92688a5b..63740f07ed 100644 --- a/src/mesa/main/accum.h +++ b/src/mesa/main/accum.h @@ -38,25 +38,40 @@ #define ACCUM_H -#include "mtypes.h" +#include "main/mtypes.h" -#if _HAVE_FULL_GL - -extern void GLAPIENTRY -_mesa_Accum( GLenum op, GLfloat value ); +#if FEATURE_accum +#define _MESA_INIT_ACCUM_FUNCTIONS(driver, impl) \ + do { \ + (driver)->Accum = impl ## Accum; \ + } while (0) extern void GLAPIENTRY _mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ); -extern void -_mesa_init_accum( GLcontext *ctx ); +extern void +_mesa_init_accum_dispatch(struct _glapi_table *disp); + +#else /* FEATURE_accum */ -#else +#define _MESA_INIT_ACCUM_FUNCTIONS(driver, impl) do { } while (0) -/** No-op */ -#define _mesa_init_accum( c ) ((void)0) +static INLINE void +_mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) +{ + /* this is used in _mesa_PopAttrib */ + ASSERT_NO_FEATURE(); +} -#endif +static INLINE void +_mesa_init_accum_dispatch(struct _glapi_table *disp) +{ +} + +#endif /* FEATURE_accum */ + +extern void +_mesa_init_accum( GLcontext *ctx ); -#endif +#endif /* ACCUM_H */ diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index 6317639075..9ffac7905a 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -30,9 +30,7 @@ #include "mfeatures.h" -#if FEATURE_accum #include "accum.h" -#endif #include "api_loopback.h" #include "api_exec.h" #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program @@ -193,10 +191,9 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_TexParameteri(exec, _mesa_TexParameteri); SET_Translatef(exec, _mesa_Translatef); SET_Viewport(exec, _mesa_Viewport); -#if FEATURE_accum - SET_Accum(exec, _mesa_Accum); - SET_ClearAccum(exec, _mesa_ClearAccum); -#endif + + _mesa_init_accum_dispatch(exec); + #if FEATURE_dlist SET_CallList(exec, _mesa_CallList); SET_CallLists(exec, _mesa_CallLists); diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 1907c799df..df194c3edb 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -79,9 +79,7 @@ #include "glheader.h" #include "mfeatures.h" #include "imports.h" -#if FEATURE_accum #include "accum.h" -#endif #include "api_exec.h" #include "arrayobj.h" #if FEATURE_attrib_stack @@ -676,9 +674,7 @@ init_attrib_groups(GLcontext *ctx) _mesa_init_extensions( ctx ); /* Attribute Groups */ -#if FEATURE_accum _mesa_init_accum( ctx ); -#endif #if FEATURE_attrib_stack _mesa_init_attrib( ctx ); #endif -- cgit v1.2.3 From 2b36db496d34c60a3f987fa88d52bf5684713240 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Mon, 7 Sep 2009 18:20:10 +0800 Subject: mesa/main: Make FEATURE_attrib_stack follow feature conventions. As shown in mfeatures.h, this allows users of attrib.h to work without knowing if the feature is available. --- src/mesa/main/api_exec.c | 11 +++-------- src/mesa/main/attrib.c | 17 +++++++++++++++++ src/mesa/main/attrib.h | 38 +++++++++++++++++++++++++++----------- src/mesa/main/context.c | 6 ------ 4 files changed, 47 insertions(+), 25 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index 9ffac7905a..b363d4340e 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -39,9 +39,7 @@ #if FEATURE_ATI_fragment_shader #include "shader/atifragshader.h" #endif -#if FEATURE_attrib_stack #include "attrib.h" -#endif #include "blend.h" #if FEATURE_ARB_vertex_buffer_object #include "bufferobj.h" @@ -283,12 +281,9 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_PolygonMode(exec, _mesa_PolygonMode); SET_PolygonOffset(exec, _mesa_PolygonOffset); SET_PolygonStipple(exec, _mesa_PolygonStipple); -#if FEATURE_attrib_stack - SET_PopAttrib(exec, _mesa_PopAttrib); - SET_PushAttrib(exec, _mesa_PushAttrib); - SET_PopClientAttrib(exec, _mesa_PopClientAttrib); - SET_PushClientAttrib(exec, _mesa_PushClientAttrib); -#endif + + _mesa_init_attrib_dispatch(exec); + #if FEATURE_drawpix SET_RasterPos2f(exec, _mesa_RasterPos2f); SET_RasterPos2fv(exec, _mesa_RasterPos2fv); diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index 0fb8fa3bba..246c5521b7 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -57,6 +57,7 @@ #include "varray.h" #include "viewport.h" #include "mtypes.h" +#include "glapi/dispatch.h" /** @@ -174,6 +175,9 @@ struct texture_state }; +#if FEATURE_attrib_stack + + /** * Allocate new attribute node of given type/kind. Attach payload data. * Insert it into the linked list named by 'head'. @@ -1464,6 +1468,19 @@ _mesa_PopClientAttrib(void) } +void +_mesa_init_attrib_dispatch(struct _glapi_table *disp) +{ + SET_PopAttrib(disp, _mesa_PopAttrib); + SET_PushAttrib(disp, _mesa_PushAttrib); + SET_PopClientAttrib(disp, _mesa_PopClientAttrib); + SET_PushClientAttrib(disp, _mesa_PushClientAttrib); +} + + +#endif /* FEATURE_attrib_stack */ + + /** * Free any attribute state data that might be attached to the context. */ diff --git a/src/mesa/main/attrib.h b/src/mesa/main/attrib.h index 2cf8fe6934..6b48a17663 100644 --- a/src/mesa/main/attrib.h +++ b/src/mesa/main/attrib.h @@ -26,10 +26,10 @@ #define ATTRIB_H -#include "mtypes.h" +#include "main/mtypes.h" -#if _HAVE_FULL_GL +#if FEATURE_attrib_stack extern void GLAPIENTRY _mesa_PushAttrib( GLbitfield mask ); @@ -43,18 +43,34 @@ _mesa_PushClientAttrib( GLbitfield mask ); extern void GLAPIENTRY _mesa_PopClientAttrib( void ); +extern void +_mesa_init_attrib_dispatch(struct _glapi_table *disp); + +#else /* FEATURE_attrib_stack */ + +static INLINE void +_mesa_PushClientAttrib( GLbitfield mask ) +{ + ASSERT_NO_FEATURE(); +} + +static INLINE void +_mesa_PopClientAttrib( void ) +{ + ASSERT_NO_FEATURE(); +} + +static INLINE void +_mesa_init_attrib_dispatch(struct _glapi_table *disp) +{ +} + +#endif /* FEATURE_attrib_stack */ + extern void _mesa_init_attrib( GLcontext *ctx ); extern void _mesa_free_attrib_data( GLcontext *ctx ); -#else - -/** No-op */ -#define _mesa_init_attrib( c ) ((void)0) -#define _mesa_free_attrib_data( c ) ((void)0) - -#endif - -#endif +#endif /* ATTRIB_H */ diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index df194c3edb..53a21ba4f5 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -82,9 +82,7 @@ #include "accum.h" #include "api_exec.h" #include "arrayobj.h" -#if FEATURE_attrib_stack #include "attrib.h" -#endif #include "blend.h" #include "buffers.h" #include "bufferobj.h" @@ -675,9 +673,7 @@ init_attrib_groups(GLcontext *ctx) /* Attribute Groups */ _mesa_init_accum( ctx ); -#if FEATURE_attrib_stack _mesa_init_attrib( ctx ); -#endif _mesa_init_buffer_objects( ctx ); _mesa_init_color( ctx ); _mesa_init_colortables( ctx ); @@ -997,9 +993,7 @@ _mesa_free_context_data( GLcontext *ctx ) _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._Current, NULL); _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._TexEnvProgram, NULL); -#if FEATURE_attrib_stack _mesa_free_attrib_data(ctx); -#endif _mesa_free_lighting_data( ctx ); #if FEATURE_evaluators _mesa_free_eval_data( ctx ); -- cgit v1.2.3 From cab7ea03688ec73dd71c0b969f2db30cabeb713c Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Mon, 7 Sep 2009 18:06:00 +0800 Subject: mesa/main: Make FEATURE_histogram follow feature conventions. As shown in mfeatures.h, this allows users of histogram.h to work without knowing if the feature is available. --- src/mesa/main/api_exec.c | 15 +-------------- src/mesa/main/context.c | 4 ---- src/mesa/main/histogram.c | 45 ++++++++++++++++++++++++++++++++++---------- src/mesa/main/histogram.h | 48 +++++++++++------------------------------------ 4 files changed, 47 insertions(+), 65 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index b363d4340e..6b529db5ec 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -76,9 +76,7 @@ #include "ffvertex_prog.h" #include "framebuffer.h" #include "hint.h" -#if FEATURE_histogram #include "histogram.h" -#endif #include "imports.h" #include "light.h" #include "lines.h" @@ -375,18 +373,7 @@ _mesa_init_exec_table(struct _glapi_table *exec) _mesa_init_colortable_dispatch(exec); _mesa_init_convolve_dispatch(exec); -#if FEATURE_histogram - SET_GetHistogram(exec, _mesa_GetHistogram); - SET_GetHistogramParameterfv(exec, _mesa_GetHistogramParameterfv); - SET_GetHistogramParameteriv(exec, _mesa_GetHistogramParameteriv); - SET_GetMinmax(exec, _mesa_GetMinmax); - SET_GetMinmaxParameterfv(exec, _mesa_GetMinmaxParameterfv); - SET_GetMinmaxParameteriv(exec, _mesa_GetMinmaxParameteriv); - SET_Histogram(exec, _mesa_Histogram); - SET_Minmax(exec, _mesa_Minmax); - SET_ResetHistogram(exec, _mesa_ResetHistogram); - SET_ResetMinmax(exec, _mesa_ResetMinmax); -#endif + _mesa_init_histogram_dispatch(exec); /* OpenGL 2.0 */ SET_StencilFuncSeparate(exec, _mesa_StencilFuncSeparate); diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 53a21ba4f5..a546e37b5f 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -106,9 +106,7 @@ #include "fog.h" #include "framebuffer.h" #include "get.h" -#if FEATURE_histogram #include "histogram.h" -#endif #include "hint.h" #include "hash.h" #include "light.h" @@ -693,9 +691,7 @@ init_attrib_groups(GLcontext *ctx) ctx->RenderMode = GL_RENDER; #endif _mesa_init_fog( ctx ); -#if FEATURE_histogram _mesa_init_histogram( ctx ); -#endif _mesa_init_hint( ctx ); _mesa_init_line( ctx ); _mesa_init_lighting( ctx ); diff --git a/src/mesa/main/histogram.c b/src/mesa/main/histogram.c index ceb0d5a6a8..87816d3132 100644 --- a/src/mesa/main/histogram.c +++ b/src/mesa/main/histogram.c @@ -29,8 +29,11 @@ #include "context.h" #include "image.h" #include "histogram.h" +#include "glapi/dispatch.h" +#if FEATURE_histogram + /* * XXX the packed pixel formats haven't been tested. @@ -614,7 +617,11 @@ base_histogram_format( GLenum format ) */ -void GLAPIENTRY +/* this is defined below */ +static void GLAPIENTRY _mesa_ResetMinmax(GLenum target); + + +static void GLAPIENTRY _mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values) { GET_CURRENT_CONTEXT(ctx); @@ -677,7 +684,7 @@ _mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvo } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values) { GET_CURRENT_CONTEXT(ctx); @@ -737,7 +744,7 @@ _mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, G } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params) { GET_CURRENT_CONTEXT(ctx); @@ -784,7 +791,7 @@ _mesa_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params) { GET_CURRENT_CONTEXT(ctx); @@ -831,7 +838,7 @@ _mesa_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params) { GET_CURRENT_CONTEXT(ctx); @@ -857,7 +864,7 @@ _mesa_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params) { GET_CURRENT_CONTEXT(ctx); @@ -883,7 +890,7 @@ _mesa_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_Histogram(GLenum target, GLsizei width, GLenum internalFormat, GLboolean sink) { GLuint i; @@ -966,7 +973,7 @@ _mesa_Histogram(GLenum target, GLsizei width, GLenum internalFormat, GLboolean s } -void GLAPIENTRY +static void GLAPIENTRY _mesa_Minmax(GLenum target, GLenum internalFormat, GLboolean sink) { GET_CURRENT_CONTEXT(ctx); @@ -994,7 +1001,7 @@ _mesa_Minmax(GLenum target, GLenum internalFormat, GLboolean sink) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_ResetHistogram(GLenum target) { GLuint i; @@ -1020,7 +1027,7 @@ _mesa_ResetHistogram(GLenum target) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_ResetMinmax(GLenum target) { GET_CURRENT_CONTEXT(ctx); @@ -1043,6 +1050,24 @@ _mesa_ResetMinmax(GLenum target) } +void +_mesa_init_histogram_dispatch(struct _glapi_table *disp) +{ + SET_GetHistogram(disp, _mesa_GetHistogram); + SET_GetHistogramParameterfv(disp, _mesa_GetHistogramParameterfv); + SET_GetHistogramParameteriv(disp, _mesa_GetHistogramParameteriv); + SET_GetMinmax(disp, _mesa_GetMinmax); + SET_GetMinmaxParameterfv(disp, _mesa_GetMinmaxParameterfv); + SET_GetMinmaxParameteriv(disp, _mesa_GetMinmaxParameteriv); + SET_Histogram(disp, _mesa_Histogram); + SET_Minmax(disp, _mesa_Minmax); + SET_ResetHistogram(disp, _mesa_ResetHistogram); + SET_ResetMinmax(disp, _mesa_ResetMinmax); +} + + +#endif /* FEATURE_histogram */ + /**********************************************************************/ /***** Initialization *****/ diff --git a/src/mesa/main/histogram.h b/src/mesa/main/histogram.h index 367e9b11ba..dbae1bbd06 100644 --- a/src/mesa/main/histogram.h +++ b/src/mesa/main/histogram.h @@ -36,48 +36,22 @@ #ifndef HISTOGRAM_H #define HISTOGRAM_H -#include "glheader.h" -#include "mtypes.h" +#include "main/mtypes.h" -#if _HAVE_FULL_GL +#if FEATURE_histogram -extern void GLAPIENTRY -_mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values); +extern void +_mesa_init_histogram_dispatch(struct _glapi_table *disp); -extern void GLAPIENTRY -_mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +#else /* FEATURE_histogram */ -extern void GLAPIENTRY -_mesa_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params); +static INLINE void +_mesa_init_histogram_dispatch(struct _glapi_table *disp) +{ +} -extern void GLAPIENTRY -_mesa_GetHistogramParameteriv(GLenum target, GLenum pname, GLint *params); - -extern void GLAPIENTRY -_mesa_GetMinmaxParameterfv(GLenum target, GLenum pname, GLfloat *params); - -extern void GLAPIENTRY -_mesa_GetMinmaxParameteriv(GLenum target, GLenum pname, GLint *params); - -extern void GLAPIENTRY -_mesa_Histogram(GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); - -extern void GLAPIENTRY -_mesa_Minmax(GLenum target, GLenum internalformat, GLboolean sink); - -extern void GLAPIENTRY -_mesa_ResetHistogram(GLenum target); - -extern void GLAPIENTRY -_mesa_ResetMinmax(GLenum target); +#endif /* FEATURE_histogram */ extern void _mesa_init_histogram( GLcontext * ctx ); -#else - -/** No-op */ -#define _mesa_init_histogram( c ) ((void) 0) - -#endif - -#endif +#endif /* HISTOGRAM_H */ -- cgit v1.2.3 From d25080074f2da1ebc47cdfb5c3491740a57ec03f Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Tue, 8 Sep 2009 10:05:36 +0800 Subject: mesa/main: New feature FEATURE_rastpos. It is separated from FEATURE_drawpix and made to follow the feature conventions. --- src/mesa/main/api_exec.c | 56 +--------------- src/mesa/main/context.c | 4 -- src/mesa/main/mfeatures.h | 2 +- src/mesa/main/rastpos.c | 162 +++++++++++++++++++++++++++++++-------------- src/mesa/main/rastpos.h | 163 +++++----------------------------------------- 5 files changed, 133 insertions(+), 254 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index 6b529db5ec..8de0691851 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -59,8 +59,8 @@ #endif #if FEATURE_drawpix #include "drawpix.h" -#include "rastpos.h" #endif +#include "rastpos.h" #include "enable.h" #if FEATURE_evaluators #include "eval.h" @@ -281,33 +281,8 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_PolygonStipple(exec, _mesa_PolygonStipple); _mesa_init_attrib_dispatch(exec); + _mesa_init_rastpos_dispatch(exec); -#if FEATURE_drawpix - SET_RasterPos2f(exec, _mesa_RasterPos2f); - SET_RasterPos2fv(exec, _mesa_RasterPos2fv); - SET_RasterPos2i(exec, _mesa_RasterPos2i); - SET_RasterPos2iv(exec, _mesa_RasterPos2iv); - SET_RasterPos2d(exec, _mesa_RasterPos2d); - SET_RasterPos2dv(exec, _mesa_RasterPos2dv); - SET_RasterPos2s(exec, _mesa_RasterPos2s); - SET_RasterPos2sv(exec, _mesa_RasterPos2sv); - SET_RasterPos3d(exec, _mesa_RasterPos3d); - SET_RasterPos3dv(exec, _mesa_RasterPos3dv); - SET_RasterPos3f(exec, _mesa_RasterPos3f); - SET_RasterPos3fv(exec, _mesa_RasterPos3fv); - SET_RasterPos3i(exec, _mesa_RasterPos3i); - SET_RasterPos3iv(exec, _mesa_RasterPos3iv); - SET_RasterPos3s(exec, _mesa_RasterPos3s); - SET_RasterPos3sv(exec, _mesa_RasterPos3sv); - SET_RasterPos4d(exec, _mesa_RasterPos4d); - SET_RasterPos4dv(exec, _mesa_RasterPos4dv); - SET_RasterPos4f(exec, _mesa_RasterPos4f); - SET_RasterPos4fv(exec, _mesa_RasterPos4fv); - SET_RasterPos4i(exec, _mesa_RasterPos4i); - SET_RasterPos4iv(exec, _mesa_RasterPos4iv); - SET_RasterPos4s(exec, _mesa_RasterPos4s); - SET_RasterPos4sv(exec, _mesa_RasterPos4sv); -#endif SET_ReadPixels(exec, _mesa_ReadPixels); SET_Rotated(exec, _mesa_Rotated); SET_Scaled(exec, _mesa_Scaled); @@ -485,32 +460,7 @@ _mesa_init_exec_table(struct _glapi_table *exec) #endif /* 197. GL_MESA_window_pos */ -#if FEATURE_drawpix - SET_WindowPos2dMESA(exec, _mesa_WindowPos2dMESA); - SET_WindowPos2dvMESA(exec, _mesa_WindowPos2dvMESA); - SET_WindowPos2fMESA(exec, _mesa_WindowPos2fMESA); - SET_WindowPos2fvMESA(exec, _mesa_WindowPos2fvMESA); - SET_WindowPos2iMESA(exec, _mesa_WindowPos2iMESA); - SET_WindowPos2ivMESA(exec, _mesa_WindowPos2ivMESA); - SET_WindowPos2sMESA(exec, _mesa_WindowPos2sMESA); - SET_WindowPos2svMESA(exec, _mesa_WindowPos2svMESA); - SET_WindowPos3dMESA(exec, _mesa_WindowPos3dMESA); - SET_WindowPos3dvMESA(exec, _mesa_WindowPos3dvMESA); - SET_WindowPos3fMESA(exec, _mesa_WindowPos3fMESA); - SET_WindowPos3fvMESA(exec, _mesa_WindowPos3fvMESA); - SET_WindowPos3iMESA(exec, _mesa_WindowPos3iMESA); - SET_WindowPos3ivMESA(exec, _mesa_WindowPos3ivMESA); - SET_WindowPos3sMESA(exec, _mesa_WindowPos3sMESA); - SET_WindowPos3svMESA(exec, _mesa_WindowPos3svMESA); - SET_WindowPos4dMESA(exec, _mesa_WindowPos4dMESA); - SET_WindowPos4dvMESA(exec, _mesa_WindowPos4dvMESA); - SET_WindowPos4fMESA(exec, _mesa_WindowPos4fMESA); - SET_WindowPos4fvMESA(exec, _mesa_WindowPos4fvMESA); - SET_WindowPos4iMESA(exec, _mesa_WindowPos4iMESA); - SET_WindowPos4ivMESA(exec, _mesa_WindowPos4ivMESA); - SET_WindowPos4sMESA(exec, _mesa_WindowPos4sMESA); - SET_WindowPos4svMESA(exec, _mesa_WindowPos4svMESA); -#endif + /* part of _mesa_init_rastpos_dispatch(exec); */ /* 200. GL_IBM_multimode_draw_arrays */ #if _HAVE_FULL_GL diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index a546e37b5f..cd8fe0df8f 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -124,9 +124,7 @@ #if FEATURE_ARB_sync #include "syncobj.h" #endif -#if FEATURE_drawpix #include "rastpos.h" -#endif #include "scissor.h" #include "shared.h" #include "simple_list.h" @@ -708,9 +706,7 @@ init_attrib_groups(GLcontext *ctx) #if FEATURE_ARB_sync _mesa_init_sync( ctx ); #endif -#if FEATURE_drawpix _mesa_init_rastpos( ctx ); -#endif _mesa_init_scissor( ctx ); _mesa_init_shader_state( ctx ); _mesa_init_stencil( ctx ); diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h index 6318934c6b..d3491b1d42 100644 --- a/src/mesa/main/mfeatures.h +++ b/src/mesa/main/mfeatures.h @@ -82,12 +82,12 @@ #define FEATURE_histogram _HAVE_FULL_GL #define FEATURE_pixel_transfer _HAVE_FULL_GL #define FEATURE_point_size_array 0 +#define FEATURE_rastpos _HAVE_FULL_GL #define FEATURE_texgen _HAVE_FULL_GL #define FEATURE_texture_fxt1 _HAVE_FULL_GL #define FEATURE_texture_s3tc _HAVE_FULL_GL #define FEATURE_userclip _HAVE_FULL_GL #define FEATURE_vertex_array_byte 0 -#define FEATURE_windowpos _HAVE_FULL_GL #define FEATURE_es2_glsl 0 #define FEATURE_ARB_occlusion_query _HAVE_FULL_GL diff --git a/src/mesa/main/rastpos.c b/src/mesa/main/rastpos.c index 9f309d6ab8..703b47ec74 100644 --- a/src/mesa/main/rastpos.c +++ b/src/mesa/main/rastpos.c @@ -34,6 +34,10 @@ #include "macros.h" #include "rastpos.h" #include "state.h" +#include "glapi/dispatch.h" + + +#if FEATURE_rastpos /** @@ -60,147 +64,147 @@ rasterpos(GLfloat x, GLfloat y, GLfloat z, GLfloat w) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2d(GLdouble x, GLdouble y) { rasterpos((GLfloat)x, (GLfloat)y, (GLfloat)0.0, (GLfloat)1.0); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2f(GLfloat x, GLfloat y) { rasterpos(x, y, 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2i(GLint x, GLint y) { rasterpos((GLfloat) x, (GLfloat) y, 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2s(GLshort x, GLshort y) { rasterpos(x, y, 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3d(GLdouble x, GLdouble y, GLdouble z) { rasterpos((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3f(GLfloat x, GLfloat y, GLfloat z) { rasterpos(x, y, z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3i(GLint x, GLint y, GLint z) { rasterpos((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3s(GLshort x, GLshort y, GLshort z) { rasterpos(x, y, z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w) { rasterpos((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) { rasterpos(x, y, z, w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4i(GLint x, GLint y, GLint z, GLint w) { rasterpos((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w) { rasterpos(x, y, z, w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2dv(const GLdouble *v) { rasterpos((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2fv(const GLfloat *v) { rasterpos(v[0], v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2iv(const GLint *v) { rasterpos((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos2sv(const GLshort *v) { rasterpos(v[0], v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3dv(const GLdouble *v) { rasterpos((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3fv(const GLfloat *v) { rasterpos(v[0], v[1], v[2], 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3iv(const GLint *v) { rasterpos((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos3sv(const GLshort *v) { rasterpos(v[0], v[1], v[2], 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4dv(const GLdouble *v) { rasterpos((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4fv(const GLfloat *v) { rasterpos(v[0], v[1], v[2], v[3]); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4iv(const GLint *v) { rasterpos((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_RasterPos4sv(const GLshort *v) { rasterpos(v[0], v[1], v[2], v[3]); @@ -211,7 +215,7 @@ _mesa_RasterPos4sv(const GLshort *v) /*** GL_ARB_window_pos / GL_MESA_window_pos ***/ /**********************************************************************/ -#if FEATURE_drawpix + /** * All glWindowPosMESA and glWindowPosARB commands call this function to * update the current raster position. @@ -290,153 +294,152 @@ window_pos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2dMESA(GLdouble x, GLdouble y) { window_pos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2fMESA(GLfloat x, GLfloat y) { window_pos4f(x, y, 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2iMESA(GLint x, GLint y) { window_pos4f((GLfloat) x, (GLfloat) y, 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2sMESA(GLshort x, GLshort y) { window_pos4f(x, y, 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z) { window_pos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z) { window_pos4f(x, y, z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3iMESA(GLint x, GLint y, GLint z) { window_pos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3sMESA(GLshort x, GLshort y, GLshort z) { window_pos4f(x, y, z, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w) { window_pos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4fMESA(GLfloat x, GLfloat y, GLfloat z, GLfloat w) { window_pos4f(x, y, z, w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4iMESA(GLint x, GLint y, GLint z, GLint w) { window_pos4f((GLfloat) x, (GLfloat) y, (GLfloat) z, (GLfloat) w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w) { window_pos4f(x, y, z, w); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2dvMESA(const GLdouble *v) { window_pos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2fvMESA(const GLfloat *v) { window_pos4f(v[0], v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2ivMESA(const GLint *v) { window_pos4f((GLfloat) v[0], (GLfloat) v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos2svMESA(const GLshort *v) { window_pos4f(v[0], v[1], 0.0F, 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3dvMESA(const GLdouble *v) { window_pos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3fvMESA(const GLfloat *v) { window_pos4f(v[0], v[1], v[2], 1.0); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3ivMESA(const GLint *v) { window_pos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos3svMESA(const GLshort *v) { window_pos4f(v[0], v[1], v[2], 1.0F); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4dvMESA(const GLdouble *v) { window_pos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4fvMESA(const GLfloat *v) { window_pos4f(v[0], v[1], v[2], v[3]); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4ivMESA(const GLint *v) { window_pos4f((GLfloat) v[0], (GLfloat) v[1], (GLfloat) v[2], (GLfloat) v[3]); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_WindowPos4svMESA(const GLshort *v) { window_pos4f(v[0], v[1], v[2], v[3]); } -#endif #if 0 @@ -477,6 +480,65 @@ void glWindowPos4fMESA( GLfloat x, GLfloat y, GLfloat z, GLfloat w ) #endif +void +_mesa_init_rastpos_dispatch(struct _glapi_table *disp) +{ + SET_RasterPos2f(disp, _mesa_RasterPos2f); + SET_RasterPos2fv(disp, _mesa_RasterPos2fv); + SET_RasterPos2i(disp, _mesa_RasterPos2i); + SET_RasterPos2iv(disp, _mesa_RasterPos2iv); + SET_RasterPos2d(disp, _mesa_RasterPos2d); + SET_RasterPos2dv(disp, _mesa_RasterPos2dv); + SET_RasterPos2s(disp, _mesa_RasterPos2s); + SET_RasterPos2sv(disp, _mesa_RasterPos2sv); + SET_RasterPos3d(disp, _mesa_RasterPos3d); + SET_RasterPos3dv(disp, _mesa_RasterPos3dv); + SET_RasterPos3f(disp, _mesa_RasterPos3f); + SET_RasterPos3fv(disp, _mesa_RasterPos3fv); + SET_RasterPos3i(disp, _mesa_RasterPos3i); + SET_RasterPos3iv(disp, _mesa_RasterPos3iv); + SET_RasterPos3s(disp, _mesa_RasterPos3s); + SET_RasterPos3sv(disp, _mesa_RasterPos3sv); + SET_RasterPos4d(disp, _mesa_RasterPos4d); + SET_RasterPos4dv(disp, _mesa_RasterPos4dv); + SET_RasterPos4f(disp, _mesa_RasterPos4f); + SET_RasterPos4fv(disp, _mesa_RasterPos4fv); + SET_RasterPos4i(disp, _mesa_RasterPos4i); + SET_RasterPos4iv(disp, _mesa_RasterPos4iv); + SET_RasterPos4s(disp, _mesa_RasterPos4s); + SET_RasterPos4sv(disp, _mesa_RasterPos4sv); + + /* 197. GL_MESA_window_pos */ + SET_WindowPos2dMESA(disp, _mesa_WindowPos2dMESA); + SET_WindowPos2dvMESA(disp, _mesa_WindowPos2dvMESA); + SET_WindowPos2fMESA(disp, _mesa_WindowPos2fMESA); + SET_WindowPos2fvMESA(disp, _mesa_WindowPos2fvMESA); + SET_WindowPos2iMESA(disp, _mesa_WindowPos2iMESA); + SET_WindowPos2ivMESA(disp, _mesa_WindowPos2ivMESA); + SET_WindowPos2sMESA(disp, _mesa_WindowPos2sMESA); + SET_WindowPos2svMESA(disp, _mesa_WindowPos2svMESA); + SET_WindowPos3dMESA(disp, _mesa_WindowPos3dMESA); + SET_WindowPos3dvMESA(disp, _mesa_WindowPos3dvMESA); + SET_WindowPos3fMESA(disp, _mesa_WindowPos3fMESA); + SET_WindowPos3fvMESA(disp, _mesa_WindowPos3fvMESA); + SET_WindowPos3iMESA(disp, _mesa_WindowPos3iMESA); + SET_WindowPos3ivMESA(disp, _mesa_WindowPos3ivMESA); + SET_WindowPos3sMESA(disp, _mesa_WindowPos3sMESA); + SET_WindowPos3svMESA(disp, _mesa_WindowPos3svMESA); + SET_WindowPos4dMESA(disp, _mesa_WindowPos4dMESA); + SET_WindowPos4dvMESA(disp, _mesa_WindowPos4dvMESA); + SET_WindowPos4fMESA(disp, _mesa_WindowPos4fMESA); + SET_WindowPos4fvMESA(disp, _mesa_WindowPos4fvMESA); + SET_WindowPos4iMESA(disp, _mesa_WindowPos4iMESA); + SET_WindowPos4ivMESA(disp, _mesa_WindowPos4ivMESA); + SET_WindowPos4sMESA(disp, _mesa_WindowPos4sMESA); + SET_WindowPos4svMESA(disp, _mesa_WindowPos4svMESA); +} + + +#endif /* FEATURE_rastpos */ + + /**********************************************************************/ /** \name Initialization */ /**********************************************************************/ diff --git a/src/mesa/main/rastpos.h b/src/mesa/main/rastpos.h index 363f86ad87..b2127225b6 100644 --- a/src/mesa/main/rastpos.h +++ b/src/mesa/main/rastpos.h @@ -32,162 +32,33 @@ #define RASTPOS_H -#include "glheader.h" +#include "main/mtypes.h" -extern void GLAPIENTRY -_mesa_RasterPos2d(GLdouble x, GLdouble y); +#if FEATURE_rastpos -extern void GLAPIENTRY -_mesa_RasterPos2f(GLfloat x, GLfloat y); +#define _MESA_INIT_RASTPOS_FUNCTIONS(driver, impl) \ + do { \ + (driver)->RasterPos = impl ## RasterPos; \ + } while (0) -extern void GLAPIENTRY -_mesa_RasterPos2i(GLint x, GLint y); +extern void +_mesa_init_rastpos_dispatch(struct _glapi_table *disp); -extern void GLAPIENTRY -_mesa_RasterPos2s(GLshort x, GLshort y); +#else /* FEATURE_rastpos */ -extern void GLAPIENTRY -_mesa_RasterPos3d(GLdouble x, GLdouble y, GLdouble z); +#define _MESA_INIT_RASTPOS_FUNCTIONS(driver, impl) do { } while (0) -extern void GLAPIENTRY -_mesa_RasterPos3f(GLfloat x, GLfloat y, GLfloat z); +static INLINE void +_mesa_init_rastpos_dispatch(struct _glapi_table *disp) +{ +} -extern void GLAPIENTRY -_mesa_RasterPos3i(GLint x, GLint y, GLint z); - -extern void GLAPIENTRY -_mesa_RasterPos3s(GLshort x, GLshort y, GLshort z); - -extern void GLAPIENTRY -_mesa_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w); - -extern void GLAPIENTRY -_mesa_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w); - -extern void GLAPIENTRY -_mesa_RasterPos4i(GLint x, GLint y, GLint z, GLint w); - -extern void GLAPIENTRY -_mesa_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w); - -extern void GLAPIENTRY -_mesa_RasterPos2dv(const GLdouble *v); - -extern void GLAPIENTRY -_mesa_RasterPos2fv(const GLfloat *v); - -extern void GLAPIENTRY -_mesa_RasterPos2iv(const GLint *v); - -extern void GLAPIENTRY -_mesa_RasterPos2sv(const GLshort *v); - -extern void GLAPIENTRY -_mesa_RasterPos3dv(const GLdouble *v); - -extern void GLAPIENTRY -_mesa_RasterPos3fv(const GLfloat *v); - -extern void GLAPIENTRY -_mesa_RasterPos3iv(const GLint *v); - -extern void GLAPIENTRY -_mesa_RasterPos3sv(const GLshort *v); - -extern void GLAPIENTRY -_mesa_RasterPos4dv(const GLdouble *v); - -extern void GLAPIENTRY -_mesa_RasterPos4fv(const GLfloat *v); - -extern void GLAPIENTRY -_mesa_RasterPos4iv(const GLint *v); - -extern void GLAPIENTRY -_mesa_RasterPos4sv(const GLshort *v); - - -/**********************************************************************/ -/** \name GL_MESA_window_pos */ -/**********************************************************************/ -/*@{*/ - -extern void GLAPIENTRY -_mesa_WindowPos2dMESA(GLdouble x, GLdouble y); - -extern void GLAPIENTRY -_mesa_WindowPos2fMESA(GLfloat x, GLfloat y); - -extern void GLAPIENTRY -_mesa_WindowPos2iMESA(GLint x, GLint y); - -extern void GLAPIENTRY -_mesa_WindowPos2sMESA(GLshort x, GLshort y); - -extern void GLAPIENTRY -_mesa_WindowPos3dMESA(GLdouble x, GLdouble y, GLdouble z); - -extern void GLAPIENTRY -_mesa_WindowPos3fMESA(GLfloat x, GLfloat y, GLfloat z); - -extern void GLAPIENTRY -_mesa_WindowPos3iMESA(GLint x, GLint y, GLint z); - -extern void GLAPIENTRY -_mesa_WindowPos3sMESA(GLshort x, GLshort y, GLshort z); - -extern void GLAPIENTRY -_mesa_WindowPos4dMESA(GLdouble x, GLdouble y, GLdouble z, GLdouble w); - -extern void GLAPIENTRY -_mesa_WindowPos4fMESA(GLfloat x, GLfloat y, GLfloat z, GLfloat w); - -extern void GLAPIENTRY -_mesa_WindowPos4iMESA(GLint x, GLint y, GLint z, GLint w); - -extern void GLAPIENTRY -_mesa_WindowPos4sMESA(GLshort x, GLshort y, GLshort z, GLshort w); - -extern void GLAPIENTRY -_mesa_WindowPos2dvMESA(const GLdouble *v); - -extern void GLAPIENTRY -_mesa_WindowPos2fvMESA(const GLfloat *v); - -extern void GLAPIENTRY -_mesa_WindowPos2ivMESA(const GLint *v); - -extern void GLAPIENTRY -_mesa_WindowPos2svMESA(const GLshort *v); - -extern void GLAPIENTRY -_mesa_WindowPos3dvMESA(const GLdouble *v); - -extern void GLAPIENTRY -_mesa_WindowPos3fvMESA(const GLfloat *v); - -extern void GLAPIENTRY -_mesa_WindowPos3ivMESA(const GLint *v); - -extern void GLAPIENTRY -_mesa_WindowPos3svMESA(const GLshort *v); - -extern void GLAPIENTRY -_mesa_WindowPos4dvMESA(const GLdouble *v); - -extern void GLAPIENTRY -_mesa_WindowPos4fvMESA(const GLfloat *v); - -extern void GLAPIENTRY -_mesa_WindowPos4ivMESA(const GLint *v); - -extern void GLAPIENTRY -_mesa_WindowPos4svMESA(const GLshort *v); +#endif /* FEATURE_rastpos */ extern void -_mesa_init_rastpos( GLcontext * ctx ); +_mesa_init_rastpos(GLcontext *ctx); /*@}*/ -#endif +#endif /* RASTPOS_H */ -- cgit v1.2.3 From 67a2a4e901367418a5c28e7b0963bf9c0c4762ba Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Tue, 8 Sep 2009 10:15:06 +0800 Subject: mesa/main: Make FEATURE_drawpix follow feature conventions. As shown in mfeatures.h, this allows users of drawpix.h to work without knowing if the feature is available. --- src/mesa/main/api_exec.c | 10 +++------- src/mesa/main/drawpix.c | 26 ++++++++++++++++++-------- src/mesa/main/drawpix.h | 35 +++++++++++++++++++++-------------- 3 files changed, 42 insertions(+), 29 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index 8de0691851..5ddbf49759 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -57,9 +57,7 @@ #if FEATURE_dlist #include "dlist.h" #endif -#if FEATURE_drawpix #include "drawpix.h" -#endif #include "rastpos.h" #include "enable.h" #if FEATURE_evaluators @@ -209,11 +207,9 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_DepthFunc(exec, _mesa_DepthFunc); SET_DepthMask(exec, _mesa_DepthMask); SET_DepthRange(exec, _mesa_DepthRange); -#if FEATURE_drawpix - SET_Bitmap(exec, _mesa_Bitmap); - SET_CopyPixels(exec, _mesa_CopyPixels); - SET_DrawPixels(exec, _mesa_DrawPixels); -#endif + + _mesa_init_drawpix_dispatch(exec); + #if FEATURE_feedback SET_InitNames(exec, _mesa_InitNames); SET_FeedbackBuffer(exec, _mesa_FeedbackBuffer); diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c index aef6585641..5d4b53af4c 100644 --- a/src/mesa/main/drawpix.c +++ b/src/mesa/main/drawpix.c @@ -33,8 +33,11 @@ #include "image.h" #include "readpix.h" #include "state.h" +#include "glapi/dispatch.h" +#if FEATURE_drawpix + /** * If a fragment program is enabled, check that it's valid. @@ -47,12 +50,10 @@ valid_fragment_program(GLcontext *ctx) } -#if _HAVE_FULL_GL - /* * Execute glDrawPixels */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_DrawPixels( GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) { @@ -140,7 +141,7 @@ end: } -void GLAPIENTRY +static void GLAPIENTRY _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height, GLenum type ) { @@ -225,11 +226,8 @@ end: _mesa_set_vp_override(ctx, GL_FALSE); } -#endif /* _HAVE_FULL_GL */ - - -void GLAPIENTRY +static void GLAPIENTRY _mesa_Bitmap( GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap ) @@ -309,3 +307,15 @@ _mesa_Bitmap( GLsizei width, GLsizei height, ctx->Current.RasterPos[0] += xmove; ctx->Current.RasterPos[1] += ymove; } + + +void +_mesa_init_drawpix_dispatch(struct _glapi_table *disp) +{ + SET_Bitmap(disp, _mesa_Bitmap); + SET_CopyPixels(disp, _mesa_CopyPixels); + SET_DrawPixels(disp, _mesa_DrawPixels); +} + + +#endif /* FEATURE_drawpix */ diff --git a/src/mesa/main/drawpix.h b/src/mesa/main/drawpix.h index 6177adad6d..8ffb1a6d88 100644 --- a/src/mesa/main/drawpix.h +++ b/src/mesa/main/drawpix.h @@ -22,28 +22,35 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ +#ifndef DRAWPIX_H +#define DRAWPIX_H -#ifndef DRAWPIXELS_H -#define DRAWPIXELS_H +#include "main/mtypes.h" -#include "main/glheader.h" +#if FEATURE_drawpix -extern void GLAPIENTRY -_mesa_DrawPixels( GLsizei width, GLsizei height, - GLenum format, GLenum type, const GLvoid *pixels ); +#define _MESA_INIT_DRAWPIX_FUNCTIONS(driver, impl) \ + do { \ + (driver)->DrawPixels = impl ## DrawPixels; \ + (driver)->CopyPixels = impl ## CopyPixels; \ + (driver)->Bitmap = impl ## Bitmap; \ + } while (0) +extern void +_mesa_init_drawpix_dispatch(struct _glapi_table *disp); -extern void GLAPIENTRY -_mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height, - GLenum type ); +#else /* FEATURE_drawpix */ +#define _MESA_INIT_DRAWPIX_FUNCTIONS(driver, impl) do { } while (0) -extern void GLAPIENTRY -_mesa_Bitmap( GLsizei width, GLsizei height, - GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, - const GLubyte *bitmap ); +static INLINE void +_mesa_init_drawpix_dispatch(struct _glapi_table *disp) +{ +} +#endif /* FEATURE_drawpix */ -#endif + +#endif /* DRAWPIX_H */ -- cgit v1.2.3 From 301a510092859d2e214d64f4ac2ebe03d591c64b Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Tue, 8 Sep 2009 10:52:01 +0800 Subject: mesa/main: Make FEATURE_feedback follow feature conventions. As shown in mfeatures.h, this allows users of feedback.h to work without knowing if the feature is available. --- src/mesa/main/api_exec.c | 13 +--------- src/mesa/main/context.c | 6 ----- src/mesa/main/feedback.c | 39 ++++++++++++++++++++---------- src/mesa/main/feedback.h | 62 ++++++++++++++++++++++++++++++++---------------- 4 files changed, 70 insertions(+), 50 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index 5ddbf49759..a2f0dfabda 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -64,9 +64,7 @@ #include "eval.h" #endif #include "get.h" -#if FEATURE_feedback #include "feedback.h" -#endif #include "fog.h" #if FEATURE_EXT_framebuffer_object #include "fbobject.h" @@ -209,17 +207,8 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_DepthRange(exec, _mesa_DepthRange); _mesa_init_drawpix_dispatch(exec); + _mesa_init_feedback_dispatch(exec); -#if FEATURE_feedback - SET_InitNames(exec, _mesa_InitNames); - SET_FeedbackBuffer(exec, _mesa_FeedbackBuffer); - SET_LoadName(exec, _mesa_LoadName); - SET_PassThrough(exec, _mesa_PassThrough); - SET_PopName(exec, _mesa_PopName); - SET_PushName(exec, _mesa_PushName); - SET_SelectBuffer(exec, _mesa_SelectBuffer); - SET_RenderMode(exec, _mesa_RenderMode); -#endif SET_FogCoordPointerEXT(exec, _mesa_FogCoordPointerEXT); SET_Fogf(exec, _mesa_Fogf); SET_Fogfv(exec, _mesa_Fogfv); diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index cd8fe0df8f..17e98ffa30 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -100,9 +100,7 @@ #include "enums.h" #include "extensions.h" #include "fbobject.h" -#if FEATURE_feedback #include "feedback.h" -#endif #include "fog.h" #include "framebuffer.h" #include "get.h" @@ -683,11 +681,7 @@ init_attrib_groups(GLcontext *ctx) _mesa_init_eval( ctx ); #endif _mesa_init_fbobjects( ctx ); -#if FEATURE_feedback _mesa_init_feedback( ctx ); -#else - ctx->RenderMode = GL_RENDER; -#endif _mesa_init_fog( ctx ); _mesa_init_histogram( ctx ); _mesa_init_hint( ctx ); diff --git a/src/mesa/main/feedback.c b/src/mesa/main/feedback.c index 818a804540..fcdbb75fc4 100644 --- a/src/mesa/main/feedback.c +++ b/src/mesa/main/feedback.c @@ -36,9 +36,10 @@ #include "feedback.h" #include "macros.h" #include "mtypes.h" +#include "glapi/dispatch.h" -#if _HAVE_FULL_GL +#if FEATURE_feedback #define FB_3D 0x01 @@ -49,7 +50,7 @@ -void GLAPIENTRY +static void GLAPIENTRY _mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ) { GET_CURRENT_CONTEXT(ctx); @@ -103,7 +104,7 @@ _mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_PassThrough( GLfloat token ) { GET_CURRENT_CONTEXT(ctx); @@ -153,9 +154,6 @@ _mesa_feedback_vertex(GLcontext *ctx, } -#endif /* _HAVE_FULL_GL */ - - /**********************************************************************/ /** \name Selection */ /*@{*/ @@ -173,7 +171,7 @@ _mesa_feedback_vertex(GLcontext *ctx, * Verifies we're not in selection mode, flushes the vertices and initialize * the fields in __GLcontextRec::Select with the given buffer. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_SelectBuffer( GLsizei size, GLuint *buffer ) { GET_CURRENT_CONTEXT(ctx); @@ -280,7 +278,7 @@ write_hit_record(GLcontext *ctx) * the hit record data in gl_selection. Marks new render mode in * __GLcontextRec::NewState. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_InitNames( void ) { GET_CURRENT_CONTEXT(ctx); @@ -311,7 +309,7 @@ _mesa_InitNames( void ) * * sa __GLcontextRec::Select. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_LoadName( GLuint name ) { GET_CURRENT_CONTEXT(ctx); @@ -350,7 +348,7 @@ _mesa_LoadName( GLuint name ) * * sa __GLcontextRec::Select. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_PushName( GLuint name ) { GET_CURRENT_CONTEXT(ctx); @@ -381,7 +379,7 @@ _mesa_PushName( GLuint name ) * * sa __GLcontextRec::Select. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_PopName( void ) { GET_CURRENT_CONTEXT(ctx); @@ -424,7 +422,7 @@ _mesa_PopName( void ) * __GLcontextRec::RenderMode and notifies the driver via the * dd_function_table::RenderMode callback. */ -GLint GLAPIENTRY +static GLint GLAPIENTRY _mesa_RenderMode( GLenum mode ) { GET_CURRENT_CONTEXT(ctx); @@ -507,6 +505,23 @@ _mesa_RenderMode( GLenum mode ) /*@}*/ +void +_mesa_init_feedback_dispatch(struct _glapi_table *disp) +{ + SET_InitNames(disp, _mesa_InitNames); + SET_FeedbackBuffer(disp, _mesa_FeedbackBuffer); + SET_LoadName(disp, _mesa_LoadName); + SET_PassThrough(disp, _mesa_PassThrough); + SET_PopName(disp, _mesa_PopName); + SET_PushName(disp, _mesa_PushName); + SET_SelectBuffer(disp, _mesa_SelectBuffer); + SET_RenderMode(disp, _mesa_RenderMode); +} + + +#endif /* FEATURE_feedback */ + + /**********************************************************************/ /** \name Initialization */ /*@{*/ diff --git a/src/mesa/main/feedback.h b/src/mesa/main/feedback.h index 72c2acd5ed..7a648f444f 100644 --- a/src/mesa/main/feedback.h +++ b/src/mesa/main/feedback.h @@ -27,11 +27,15 @@ #define FEEDBACK_H -#include "mtypes.h" +#include "main/mtypes.h" -extern void -_mesa_init_feedback( GLcontext *ctx ); +#if FEATURE_feedback + +#define _MESA_INIT_FEEDBACK_FUNCTIONS(driver, impl) \ + do { \ + (driver)->RenderMode = impl ## RenderMode; \ + } while (0) extern void _mesa_feedback_vertex( GLcontext *ctx, @@ -55,29 +59,47 @@ extern void _mesa_update_hitflag( GLcontext *ctx, GLfloat z ); -extern void GLAPIENTRY -_mesa_PassThrough( GLfloat token ); +extern void +_mesa_init_feedback_dispatch(struct _glapi_table *disp); + +#else /* FEATURE_feedback */ -extern void GLAPIENTRY -_mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ); +#define _MESA_INIT_FEEDBACK_FUNCTIONS(driver, impl) do { } while (0) -extern void GLAPIENTRY -_mesa_SelectBuffer( GLsizei size, GLuint *buffer ); +static INLINE void +_mesa_feedback_vertex( GLcontext *ctx, + const GLfloat win[4], + const GLfloat color[4], + GLfloat index, + const GLfloat texcoord[4] ) +{ + /* render mode is always GL_RENDER */ + ASSERT_NO_FEATURE(); +} -extern void GLAPIENTRY -_mesa_InitNames( void ); -extern void GLAPIENTRY -_mesa_LoadName( GLuint name ); +static INLINE void +_mesa_feedback_token( GLcontext *ctx, GLfloat token ) +{ + /* render mode is always GL_RENDER */ + ASSERT_NO_FEATURE(); +} -extern void GLAPIENTRY -_mesa_PushName( GLuint name ); +static INLINE void +_mesa_update_hitflag( GLcontext *ctx, GLfloat z ) +{ + /* render mode is always GL_RENDER */ + ASSERT_NO_FEATURE(); +} -extern void GLAPIENTRY -_mesa_PopName( void ); +static INLINE void +_mesa_init_feedback_dispatch(struct _glapi_table *disp) +{ +} -extern GLint GLAPIENTRY -_mesa_RenderMode( GLenum mode ); +#endif /* FEATURE_feedback */ +extern void +_mesa_init_feedback( GLcontext *ctx ); -#endif +#endif /* FEEDBACK_H */ -- cgit v1.2.3 From cc95de82e5939586771d478e662cb458bbc42c20 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Tue, 8 Sep 2009 11:01:19 +0800 Subject: mesa/main: Make FEATURE_texgen follow feature conventions. As shown in mfeatures.h, this allows users of texgen.h to work without knowing if the feature is available. --- src/mesa/main/api_exec.c | 14 +------------- src/mesa/main/texgen.c | 34 +++++++++++++++++++++++++++------- src/mesa/main/texgen.h | 43 ++++++++++++++++++++++++++----------------- 3 files changed, 54 insertions(+), 37 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index a2f0dfabda..b7b9aa0bf2 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -93,9 +93,7 @@ #include "texenv.h" #include "texgetimage.h" #include "teximage.h" -#if FEATURE_texgen #include "texgen.h" -#endif #include "texobj.h" #include "texparam.h" #include "texstate.h" @@ -275,17 +273,7 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_TexEnvf(exec, _mesa_TexEnvf); SET_TexEnviv(exec, _mesa_TexEnviv); -#if FEATURE_texgen - SET_GetTexGendv(exec, _mesa_GetTexGendv); - SET_GetTexGenfv(exec, _mesa_GetTexGenfv); - SET_GetTexGeniv(exec, _mesa_GetTexGeniv); - SET_TexGend(exec, _mesa_TexGend); - SET_TexGendv(exec, _mesa_TexGendv); - SET_TexGenf(exec, _mesa_TexGenf); - SET_TexGenfv(exec, _mesa_TexGenfv); - SET_TexGeni(exec, _mesa_TexGeni); - SET_TexGeniv(exec, _mesa_TexGeniv); -#endif + _mesa_init_texgen_dispatch(exec); SET_TexImage1D(exec, _mesa_TexImage1D); SET_TexParameterf(exec, _mesa_TexParameterf); diff --git a/src/mesa/main/texgen.c b/src/mesa/main/texgen.c index b3ecfc784e..733e129fcf 100644 --- a/src/mesa/main/texgen.c +++ b/src/mesa/main/texgen.c @@ -37,6 +37,10 @@ #include "main/texgen.h" #include "main/texstate.h" #include "math/m_matrix.h" +#include "glapi/dispatch.h" + + +#if FEATURE_texgen /** @@ -162,7 +166,7 @@ _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_TexGeniv(GLenum coord, GLenum pname, const GLint *params ) { GLfloat p[4]; @@ -179,7 +183,7 @@ _mesa_TexGeniv(GLenum coord, GLenum pname, const GLint *params ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_TexGend(GLenum coord, GLenum pname, GLdouble param ) { GLfloat p = (GLfloat) param; @@ -187,7 +191,7 @@ _mesa_TexGend(GLenum coord, GLenum pname, GLdouble param ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_TexGendv(GLenum coord, GLenum pname, const GLdouble *params ) { GLfloat p[4]; @@ -204,7 +208,7 @@ _mesa_TexGendv(GLenum coord, GLenum pname, const GLdouble *params ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param ) { _mesa_TexGenfv(coord, pname, ¶m); @@ -219,7 +223,7 @@ _mesa_TexGeni( GLenum coord, GLenum pname, GLint param ) -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ) { struct gl_texture_unit *texUnit; @@ -257,7 +261,7 @@ _mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ) -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ) { struct gl_texture_unit *texUnit; @@ -295,7 +299,7 @@ _mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ) -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ) { struct gl_texture_unit *texUnit; @@ -338,3 +342,19 @@ _mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ) } +void +_mesa_init_texgen_dispatch(struct _glapi_table *disp) +{ + SET_GetTexGendv(disp, _mesa_GetTexGendv); + SET_GetTexGenfv(disp, _mesa_GetTexGenfv); + SET_GetTexGeniv(disp, _mesa_GetTexGeniv); + SET_TexGend(disp, _mesa_TexGend); + SET_TexGendv(disp, _mesa_TexGendv); + SET_TexGenf(disp, _mesa_TexGenf); + SET_TexGenfv(disp, _mesa_TexGenfv); + SET_TexGeni(disp, _mesa_TexGeni); + SET_TexGeniv(disp, _mesa_TexGeniv); +} + + +#endif /* FEATURE_texgen */ diff --git a/src/mesa/main/texgen.h b/src/mesa/main/texgen.h index 073588efcd..f6924ef722 100644 --- a/src/mesa/main/texgen.h +++ b/src/mesa/main/texgen.h @@ -27,36 +27,45 @@ #define TEXGEN_H -#include "main/glheader.h" +#include "main/mtypes.h" -extern void GLAPIENTRY -_mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ); +#if FEATURE_texgen -extern void GLAPIENTRY -_mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ); +#define _MESA_INIT_TEXGEN_FUNCTIONS(driver, impl) \ + do { \ + (driver)->TexGen = impl ## TexGen; \ + } while (0) extern void GLAPIENTRY -_mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ); +_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ); extern void GLAPIENTRY -_mesa_TexGend( GLenum coord, GLenum pname, GLdouble param ); +_mesa_TexGeni( GLenum coord, GLenum pname, GLint param ); -extern void GLAPIENTRY -_mesa_TexGendv( GLenum coord, GLenum pname, const GLdouble *params ); +extern void +_mesa_init_texgen_dispatch(struct _glapi_table *disp); -extern void GLAPIENTRY -_mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param ); +#else /* FEATURE_texgen */ -extern void GLAPIENTRY -_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ); +#define _MESA_INIT_TEXGEN_FUNCTIONS(driver, impl) do { } while (0) -extern void GLAPIENTRY -_mesa_TexGeni( GLenum coord, GLenum pname, GLint param ); +static void +_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) +{ +} -extern void GLAPIENTRY -_mesa_TexGeniv( GLenum coord, GLenum pname, const GLint *params ); +static void INLINE +_mesa_TexGeni( GLenum coord, GLenum pname, GLint param ) +{ +} + +static INLINE void +_mesa_init_texgen_dispatch(struct _glapi_table *disp) +{ +} +#endif /* FEATURE_texgen */ #endif /* TEXGEN_H */ -- cgit v1.2.3 From 80630d1fed6cd32e75f5e97e2cd27509be21d093 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Tue, 8 Sep 2009 14:32:08 +0800 Subject: mesa/main: New feature FEATURE_arrayelt. This allows the removal of AEcontext. --- src/mesa/main/api_arrayelt.c | 18 +++++++++++++++-- src/mesa/main/api_arrayelt.h | 47 +++++++++++++++++++++++++++++++++++++++++--- src/mesa/main/api_noop.c | 3 ++- src/mesa/main/dlist.c | 3 ++- src/mesa/main/mfeatures.h | 3 ++- src/mesa/main/vtxfmt.c | 4 +++- src/mesa/vbo/vbo_exec_api.c | 3 ++- src/mesa/vbo/vbo_save_api.c | 3 ++- 8 files changed, 73 insertions(+), 11 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c index 2462a1b003..a058227110 100644 --- a/src/mesa/main/api_arrayelt.c +++ b/src/mesa/main/api_arrayelt.c @@ -71,6 +71,10 @@ typedef struct { */ #define TYPE_IDX(t) ( (t) == GL_DOUBLE ? 7 : (t) & 7 ) + +#if FEATURE_arrayelt + + static const int ColorFuncs[2][8] = { { _gloffset_Color3bv, @@ -1160,7 +1164,7 @@ static void _ae_update_state( GLcontext *ctx ) at->array = attribArray; /* Note: we can't grab the _glapi_Dispatch->VertexAttrib1fvNV * function pointer here (for float arrays) since the pointer may - * change from one execution of _ae_loopback_array_elt() to + * change from one execution of _ae_ArrayElement() to * the next. Doing so caused UT to break. */ if (ctx->VertexProgram._Enabled @@ -1254,7 +1258,7 @@ void _ae_unmap_vbos( GLcontext *ctx ) * for all enabled vertex arrays (for elt-th element). * Note: this may be called during display list construction. */ -void GLAPIENTRY _ae_loopback_array_elt( GLint elt ) +void GLAPIENTRY _ae_ArrayElement( GLint elt ) { GET_CURRENT_CONTEXT(ctx); const AEcontext *actx = AE_CONTEXT(ctx); @@ -1317,3 +1321,13 @@ void _ae_invalidate_state( GLcontext *ctx, GLuint new_state ) actx->NewState |= new_state; } } + + +void _mesa_install_arrayelt_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt) +{ + SET_ArrayElement(disp, vfmt->ArrayElement); +} + + +#endif /* FEATURE_arrayelt */ diff --git a/src/mesa/main/api_arrayelt.h b/src/mesa/main/api_arrayelt.h index e621724fb2..d18c0792c3 100644 --- a/src/mesa/main/api_arrayelt.h +++ b/src/mesa/main/api_arrayelt.h @@ -27,16 +27,57 @@ #ifndef API_ARRAYELT_H #define API_ARRAYELT_H -#include "mtypes.h" + +#include "main/mtypes.h" + +#if FEATURE_arrayelt + +#define _MESA_INIT_ARRAYELT_VTXFMT(vfmt, impl) \ + do { \ + (vfmt)->ArrayElement = impl ## ArrayElement; \ + } while (0) extern GLboolean _ae_create_context( GLcontext *ctx ); extern void _ae_destroy_context( GLcontext *ctx ); extern void _ae_invalidate_state( GLcontext *ctx, GLuint new_state ); -extern void GLAPIENTRY _ae_loopback_array_elt( GLint elt ); +extern void GLAPIENTRY _ae_ArrayElement( GLint elt ); /* May optionally be called before a batch of element calls: */ extern void _ae_map_vbos( GLcontext *ctx ); extern void _ae_unmap_vbos( GLcontext *ctx ); -#endif +extern void +_mesa_install_arrayelt_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt); + +#else /* FEATURE_arrayelt */ + +#define _MESA_INIT_ARRAYELT_VTXFMT(vfmt, impl) do { } while (0) + +static INLINE GLboolean +_ae_create_context( GLcontext *ctx ) +{ + return GL_TRUE; +} + +static INLINE void +_ae_destroy_context( GLcontext *ctx ) +{ +} + +static INLINE void +_ae_invalidate_state( GLcontext *ctx, GLuint new_state ) +{ +} + +static INLINE void +_mesa_install_arrayelt_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt) +{ +} + +#endif /* FEATURE_arrayelt */ + + +#endif /* API_ARRAYELT_H */ diff --git a/src/mesa/main/api_noop.c b/src/mesa/main/api_noop.c index 0b669e7e7f..162b685b02 100644 --- a/src/mesa/main/api_noop.c +++ b/src/mesa/main/api_noop.c @@ -992,7 +992,8 @@ _mesa_noop_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ) void _mesa_noop_vtxfmt_init( GLvertexformat *vfmt ) { - vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */ + _MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_); + vfmt->Begin = _mesa_noop_Begin; #if FEATURE_dlist vfmt->CallList = _mesa_CallList; diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 9c25de4187..e2b172595c 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -9291,7 +9291,8 @@ mesa_print_display_list(GLuint list) void _mesa_save_vtxfmt_init(GLvertexformat * vfmt) { - vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */ + _MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_); + vfmt->Begin = save_Begin; vfmt->CallList = _mesa_save_CallList; vfmt->CallLists = _mesa_save_CallLists; diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h index d3491b1d42..834b89e6e5 100644 --- a/src/mesa/main/mfeatures.h +++ b/src/mesa/main/mfeatures.h @@ -69,11 +69,12 @@ */ #define FEATURE_accum _HAVE_FULL_GL +#define FEATURE_arrayelt _HAVE_FULL_GL #define FEATURE_attrib_stack _HAVE_FULL_GL #define FEATURE_colortable _HAVE_FULL_GL #define FEATURE_convolve _HAVE_FULL_GL #define FEATURE_dispatch _HAVE_FULL_GL -#define FEATURE_dlist _HAVE_FULL_GL +#define FEATURE_dlist (_HAVE_FULL_GL && FEATURE_arrayelt) #define FEATURE_draw_read_buffer _HAVE_FULL_GL #define FEATURE_drawpix _HAVE_FULL_GL #define FEATURE_evaluators _HAVE_FULL_GL diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c index 91412f138a..de9479d6b0 100644 --- a/src/mesa/main/vtxfmt.c +++ b/src/mesa/main/vtxfmt.c @@ -27,6 +27,7 @@ */ #include "glheader.h" +#include "api_arrayelt.h" #include "api_loopback.h" #include "context.h" #include "imports.h" @@ -82,7 +83,8 @@ static void install_vtxfmt( struct _glapi_table *tab, const GLvertexformat *vfmt ) { - SET_ArrayElement(tab, vfmt->ArrayElement); + _mesa_install_arrayelt_vtxfmt(tab, vfmt); + SET_Color3f(tab, vfmt->Color3f); SET_Color3fv(tab, vfmt->Color3fv); SET_Color4f(tab, vfmt->Color4f); diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index 387d4ee3d4..238beee030 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -557,7 +557,8 @@ static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec ) { GLvertexformat *vfmt = &exec->vtxfmt; - vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */ + _MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_); + vfmt->Begin = vbo_exec_Begin; #if FEATURE_dlist vfmt->CallList = _mesa_CallList; diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c index 41cd21d04b..6e11344380 100644 --- a/src/mesa/vbo/vbo_save_api.c +++ b/src/mesa/vbo/vbo_save_api.c @@ -988,7 +988,8 @@ static void _save_vtxfmt_init( GLcontext *ctx ) struct vbo_save_context *save = &vbo_context(ctx)->save; GLvertexformat *vfmt = &save->vtxfmt; - vfmt->ArrayElement = _ae_loopback_array_elt; /* generic helper */ + _MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_); + vfmt->Begin = _save_Begin; vfmt->Color3f = _save_Color3f; vfmt->Color3fv = _save_Color3fv; -- cgit v1.2.3 From 42fac11d437d6bf2cb27f9487dedf7fb396616d4 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Tue, 8 Sep 2009 17:45:59 +0800 Subject: mesa/main: New feature FEATURE_queryobj. It merges FEATURE_ARB_occlusion_query and FEATURE_EXT_timer_query, and follows the feature conventions. --- src/mesa/main/api_exec.c | 18 +---------- src/mesa/main/context.c | 10 ++----- src/mesa/main/dlist.c | 8 ++--- src/mesa/main/extensions.c | 2 +- src/mesa/main/mfeatures.h | 3 +- src/mesa/main/queryobj.c | 48 ++++++++++++++++++------------ src/mesa/main/queryobj.h | 59 +++++++++++++++++++++++++------------ src/mesa/state_tracker/st_context.c | 2 +- src/mesa/swrast/s_span.c | 4 --- 9 files changed, 79 insertions(+), 75 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index b7b9aa0bf2..3fe10f1207 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -83,9 +83,7 @@ #include "pixelstore.h" #include "points.h" #include "polygon.h" -#if FEATURE_ARB_occlusion_query || FEATURE_EXT_timer_query #include "queryobj.h" -#endif #include "readpix.h" #include "scissor.h" #include "state.h" @@ -625,16 +623,7 @@ _mesa_init_exec_table(struct _glapi_table *exec) #endif /* ARB 29. GL_ARB_occlusion_query */ -#if FEATURE_ARB_occlusion_query - SET_GenQueriesARB(exec, _mesa_GenQueriesARB); - SET_DeleteQueriesARB(exec, _mesa_DeleteQueriesARB); - SET_IsQueryARB(exec, _mesa_IsQueryARB); - SET_BeginQueryARB(exec, _mesa_BeginQueryARB); - SET_EndQueryARB(exec, _mesa_EndQueryARB); - SET_GetQueryivARB(exec, _mesa_GetQueryivARB); - SET_GetQueryObjectivARB(exec, _mesa_GetQueryObjectivARB); - SET_GetQueryObjectuivARB(exec, _mesa_GetQueryObjectuivARB); -#endif + _mesa_init_queryobj_dispatch(exec); /* ARB 37. GL_ARB_draw_buffers */ #if FEATURE_draw_read_buffer @@ -744,11 +733,6 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_GenerateMipmapEXT(exec, _mesa_GenerateMipmapEXT); #endif -#if FEATURE_EXT_timer_query - SET_GetQueryObjecti64vEXT(exec, _mesa_GetQueryObjecti64vEXT); - SET_GetQueryObjectui64vEXT(exec, _mesa_GetQueryObjectui64vEXT); -#endif - #if FEATURE_EXT_framebuffer_blit SET_BlitFramebufferEXT(exec, _mesa_BlitFramebufferEXT); #endif diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 17e98ffa30..6994f98504 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -116,9 +116,7 @@ #include "pixelstore.h" #include "points.h" #include "polygon.h" -#if FEATURE_ARB_occlusion_query #include "queryobj.h" -#endif #if FEATURE_ARB_sync #include "syncobj.h" #endif @@ -694,9 +692,7 @@ init_attrib_groups(GLcontext *ctx) _mesa_init_point( ctx ); _mesa_init_polygon( ctx ); _mesa_init_program( ctx ); -#if FEATURE_ARB_occlusion_query - _mesa_init_query( ctx ); -#endif + _mesa_init_queryobj( ctx ); #if FEATURE_ARB_sync _mesa_init_sync( ctx ); #endif @@ -990,9 +986,7 @@ _mesa_free_context_data( GLcontext *ctx ) _mesa_free_colortables_data( ctx ); _mesa_free_program_data(ctx); _mesa_free_shader_state(ctx); -#if FEATURE_ARB_occlusion_query - _mesa_free_query_data(ctx); -#endif + _mesa_free_queryobj_data(ctx); #if FEATURE_ARB_sync _mesa_free_sync_data(ctx); #endif diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index e2b172595c..35f9a3cf03 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -4856,7 +4856,7 @@ save_ProgramStringARB(GLenum target, GLenum format, GLsizei len, #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */ -#if FEATURE_ARB_occlusion_query +#if FEATURE_queryobj static void GLAPIENTRY save_BeginQueryARB(GLenum target, GLuint id) @@ -4890,7 +4890,7 @@ save_EndQueryARB(GLenum target) } } -#endif /* FEATURE_ARB_occlusion_query */ +#endif /* FEATURE_queryobj */ static void GLAPIENTRY @@ -7155,7 +7155,7 @@ execute_list(GLcontext *ctx, GLuint list) n[6].f)); break; #endif -#if FEATURE_ARB_occlusion_query +#if FEATURE_queryobj case OPCODE_BEGIN_QUERY_ARB: CALL_BeginQueryARB(ctx->Exec, (n[1].e, n[2].ui)); break; @@ -8924,7 +8924,7 @@ _mesa_init_dlist_table(struct _glapi_table *table) SET_UnmapBufferARB(table, _mesa_UnmapBufferARB); #endif -#if FEATURE_ARB_occlusion_query +#if FEATURE_queryobj SET_BeginQueryARB(table, save_BeginQueryARB); SET_EndQueryARB(table, save_EndQueryARB); SET_GenQueriesARB(table, _mesa_GenQueriesARB); diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 2992abd075..54cf37c5f4 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -215,7 +215,7 @@ _mesa_enable_sw_extensions(GLcontext *ctx) ctx->Extensions.ARB_imaging = GL_TRUE; ctx->Extensions.ARB_map_buffer_range = GL_TRUE; ctx->Extensions.ARB_multitexture = GL_TRUE; -#if FEATURE_ARB_occlusion_query +#if FEATURE_queryobj ctx->Extensions.ARB_occlusion_query = GL_TRUE; #endif ctx->Extensions.ARB_point_sprite = GL_TRUE; diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h index 834b89e6e5..27799771a5 100644 --- a/src/mesa/main/mfeatures.h +++ b/src/mesa/main/mfeatures.h @@ -83,6 +83,7 @@ #define FEATURE_histogram _HAVE_FULL_GL #define FEATURE_pixel_transfer _HAVE_FULL_GL #define FEATURE_point_size_array 0 +#define FEATURE_queryobj _HAVE_FULL_GL #define FEATURE_rastpos _HAVE_FULL_GL #define FEATURE_texgen _HAVE_FULL_GL #define FEATURE_texture_fxt1 _HAVE_FULL_GL @@ -91,7 +92,6 @@ #define FEATURE_vertex_array_byte 0 #define FEATURE_es2_glsl 0 -#define FEATURE_ARB_occlusion_query _HAVE_FULL_GL #define FEATURE_ARB_fragment_program _HAVE_FULL_GL #define FEATURE_ARB_framebuffer_object _HAVE_FULL_GL #define FEATURE_ARB_map_buffer_range _HAVE_FULL_GL @@ -109,7 +109,6 @@ #define FEATURE_EXT_framebuffer_object _HAVE_FULL_GL #define FEATURE_EXT_pixel_buffer_object _HAVE_FULL_GL #define FEATURE_EXT_texture_sRGB _HAVE_FULL_GL -#define FEATURE_EXT_timer_query _HAVE_FULL_GL #define FEATURE_ATI_fragment_shader _HAVE_FULL_GL #define FEATURE_NV_fence _HAVE_FULL_GL #define FEATURE_NV_fragment_program _HAVE_FULL_GL diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c index a73c6e0508..f6eb4ee7e1 100644 --- a/src/mesa/main/queryobj.c +++ b/src/mesa/main/queryobj.c @@ -29,6 +29,10 @@ #include "imports.h" #include "queryobj.h" #include "mtypes.h" +#include "glapi/dispatch.h" + + +#if FEATURE_queryobj /** @@ -216,7 +220,7 @@ _mesa_IsQueryARB(GLuint id) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_BeginQueryARB(GLenum target, GLuint id) { struct gl_query_object *q; @@ -236,7 +240,6 @@ _mesa_BeginQueryARB(GLenum target, GLuint id) return; } break; -#if FEATURE_EXT_timer_query case GL_TIME_ELAPSED_EXT: if (!ctx->Extensions.EXT_timer_query) { _mesa_error(ctx, GL_INVALID_ENUM, "glBeginQueryARB(target)"); @@ -247,7 +250,6 @@ _mesa_BeginQueryARB(GLenum target, GLuint id) return; } break; -#endif default: _mesa_error(ctx, GL_INVALID_ENUM, "glBeginQueryARB(target)"); return; @@ -285,17 +287,15 @@ _mesa_BeginQueryARB(GLenum target, GLuint id) if (target == GL_SAMPLES_PASSED_ARB) { ctx->Query.CurrentOcclusionObject = q; } -#if FEATURE_EXT_timer_query else if (target == GL_TIME_ELAPSED_EXT) { ctx->Query.CurrentTimerObject = q; } -#endif ctx->Driver.BeginQuery(ctx, q); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_EndQueryARB(GLenum target) { struct gl_query_object *q; @@ -313,7 +313,6 @@ _mesa_EndQueryARB(GLenum target) q = ctx->Query.CurrentOcclusionObject; ctx->Query.CurrentOcclusionObject = NULL; break; -#if FEATURE_EXT_timer_query case GL_TIME_ELAPSED_EXT: if (!ctx->Extensions.EXT_timer_query) { _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)"); @@ -322,7 +321,6 @@ _mesa_EndQueryARB(GLenum target) q = ctx->Query.CurrentTimerObject; ctx->Query.CurrentTimerObject = NULL; break; -#endif default: _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)"); return; @@ -354,7 +352,6 @@ _mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params) } q = ctx->Query.CurrentOcclusionObject; break; -#if FEATURE_EXT_timer_query case GL_TIME_ELAPSED_EXT: if (!ctx->Extensions.EXT_timer_query) { _mesa_error(ctx, GL_INVALID_ENUM, "glEndQueryARB(target)"); @@ -362,7 +359,6 @@ _mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params) } q = ctx->Query.CurrentTimerObject; break; -#endif default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryivARB(target)"); return; @@ -462,12 +458,10 @@ _mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params) } -#if FEATURE_EXT_timer_query - /** * New with GL_EXT_timer_query */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params) { struct gl_query_object *q = NULL; @@ -504,7 +498,7 @@ _mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params) /** * New with GL_EXT_timer_query */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params) { struct gl_query_object *q = NULL; @@ -537,19 +531,35 @@ _mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params) } } -#endif /* FEATURE_EXT_timer_query */ + +void +_mesa_init_queryobj_dispatch(struct _glapi_table *disp) +{ + SET_GenQueriesARB(disp, _mesa_GenQueriesARB); + SET_DeleteQueriesARB(disp, _mesa_DeleteQueriesARB); + SET_IsQueryARB(disp, _mesa_IsQueryARB); + SET_BeginQueryARB(disp, _mesa_BeginQueryARB); + SET_EndQueryARB(disp, _mesa_EndQueryARB); + SET_GetQueryivARB(disp, _mesa_GetQueryivARB); + SET_GetQueryObjectivARB(disp, _mesa_GetQueryObjectivARB); + SET_GetQueryObjectuivARB(disp, _mesa_GetQueryObjectuivARB); + + SET_GetQueryObjecti64vEXT(disp, _mesa_GetQueryObjecti64vEXT); + SET_GetQueryObjectui64vEXT(disp, _mesa_GetQueryObjectui64vEXT); +} + + +#endif /* FEATURE_queryobj */ /** * Allocate/init the context state related to query objects. */ void -_mesa_init_query(GLcontext *ctx) +_mesa_init_queryobj(GLcontext *ctx) { -#if FEATURE_ARB_occlusion_query ctx->Query.QueryObjects = _mesa_NewHashTable(); ctx->Query.CurrentOcclusionObject = NULL; -#endif } @@ -569,7 +579,7 @@ delete_queryobj_cb(GLuint id, void *data, void *userData) * Free the context state related to query objects. */ void -_mesa_free_query_data(GLcontext *ctx) +_mesa_free_queryobj_data(GLcontext *ctx) { _mesa_HashDeleteAll(ctx->Query.QueryObjects, delete_queryobj_cb, ctx); _mesa_DeleteHashTable(ctx->Query.QueryObjects); diff --git a/src/mesa/main/queryobj.h b/src/mesa/main/queryobj.h index ee775ef959..6cf3c76d74 100644 --- a/src/mesa/main/queryobj.h +++ b/src/mesa/main/queryobj.h @@ -23,19 +23,24 @@ */ -#ifndef OCCLUDE_H -#define OCCLUDE_H +#ifndef QUERYOBJ_H +#define QUERYOBJ_H -extern void -_mesa_init_query(GLcontext *ctx); +#include "main/mtypes.h" -extern void -_mesa_free_query_data(GLcontext *ctx); -extern void -_mesa_init_query_object_functions(struct dd_function_table *driver); +#if FEATURE_queryobj +#define _MESA_INIT_QUERYOBJ_FUNCTIONS(driver, impl) \ + do { \ + (driver)->NewQueryObject = impl ## NewQueryObject; \ + (driver)->DeleteQuery = impl ## DeleteQuery; \ + (driver)->BeginQuery = impl ## BeginQuery; \ + (driver)->EndQuery = impl ## EndQuery; \ + (driver)->WaitQuery = impl ## WaitQuery; \ + (driver)->CheckQuery = impl ## CheckQuery; \ + } while (0) extern void GLAPIENTRY _mesa_GenQueriesARB(GLsizei n, GLuint *ids); @@ -46,12 +51,6 @@ _mesa_DeleteQueriesARB(GLsizei n, const GLuint *ids); extern GLboolean GLAPIENTRY _mesa_IsQueryARB(GLuint id); -extern void GLAPIENTRY -_mesa_BeginQueryARB(GLenum target, GLuint id); - -extern void GLAPIENTRY -_mesa_EndQueryARB(GLenum target); - extern void GLAPIENTRY _mesa_GetQueryivARB(GLenum target, GLenum pname, GLint *params); @@ -61,11 +60,33 @@ _mesa_GetQueryObjectivARB(GLuint id, GLenum pname, GLint *params); extern void GLAPIENTRY _mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params); -extern void GLAPIENTRY -_mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params); +extern void +_mesa_init_query_object_functions(struct dd_function_table *driver); -extern void GLAPIENTRY -_mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params); +extern void +_mesa_init_queryobj_dispatch(struct _glapi_table *disp); + +#else /* FEATURE_queryobj */ + +#define _MESA_INIT_QUERYOBJ_FUNCTIONS(driver, impl) do { } while (0) + +static INLINE void +_mesa_init_query_object_functions(struct dd_function_table *driver) +{ +} + +static INLINE void +_mesa_init_queryobj_dispatch(struct _glapi_table *disp) +{ +} + +#endif /* FEATURE_queryobj */ + +extern void +_mesa_init_queryobj(GLcontext *ctx); + +extern void +_mesa_free_queryobj_data(GLcontext *ctx); -#endif /* OCCLUDE_H */ +#endif /* QUERYOBJ_H */ diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 8514b6b375..96969c736c 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -332,7 +332,7 @@ void st_init_driver_functions(struct dd_function_table *functions) st_init_feedback_functions(functions); #endif st_init_program_functions(functions); -#if FEATURE_ARB_occlusion_query +#if FEATURE_queryobj st_init_query_functions(functions); #endif st_init_readpixels_functions(functions); diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index a45eac438e..704230d1d7 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -904,7 +904,6 @@ _swrast_write_index_span( GLcontext *ctx, SWspan *span) } } -#if FEATURE_ARB_occlusion_query if (ctx->Query.CurrentOcclusionObject) { /* update count of 'passed' fragments */ struct gl_query_object *q = ctx->Query.CurrentOcclusionObject; @@ -912,7 +911,6 @@ _swrast_write_index_span( GLcontext *ctx, SWspan *span) for (i = 0; i < span->end; i++) q->Result += span->array->mask[i]; } -#endif /* we have to wait until after occlusion to do this test */ if (ctx->Color.IndexMask == 0) { @@ -1376,7 +1374,6 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) } } -#if FEATURE_ARB_occlusion_query if (ctx->Query.CurrentOcclusionObject) { /* update count of 'passed' fragments */ struct gl_query_object *q = ctx->Query.CurrentOcclusionObject; @@ -1384,7 +1381,6 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) for (i = 0; i < span->end; i++) q->Result += span->array->mask[i]; } -#endif /* We had to wait until now to check for glColorMask(0,0,0,0) because of * the occlusion test. -- cgit v1.2.3 From aefa1f6ab1d9267b223b06ae205ab34c8e0d7c02 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Tue, 8 Sep 2009 10:25:22 +0800 Subject: mesa/main: Make FEATURE_evaluators follow feature conventions. As shown in mfeatures.h, this allows users of eval.h to work without knowing if the feature is available. --- src/mesa/main/api_exec.c | 18 ++-------- src/mesa/main/api_noop.c | 14 +++----- src/mesa/main/context.c | 6 ---- src/mesa/main/dlist.c | 19 ++++------ src/mesa/main/eval.c | 61 ++++++++++++++++++++++++++------ src/mesa/main/eval.h | 84 ++++++++++++++++++--------------------------- src/mesa/main/vtxfmt.c | 13 +++---- src/mesa/vbo/vbo_exec_api.c | 19 +++++----- src/mesa/vbo/vbo_save_api.c | 11 ++---- 9 files changed, 114 insertions(+), 131 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index 3fe10f1207..fc4de3c14c 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -60,9 +60,7 @@ #include "drawpix.h" #include "rastpos.h" #include "enable.h" -#if FEATURE_evaluators #include "eval.h" -#endif #include "get.h" #include "feedback.h" #include "fog.h" @@ -238,19 +236,9 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_Lighti(exec, _mesa_Lighti); SET_Lightiv(exec, _mesa_Lightiv); SET_LoadMatrixd(exec, _mesa_LoadMatrixd); -#if FEATURE_evaluators - SET_GetMapdv(exec, _mesa_GetMapdv); - SET_GetMapfv(exec, _mesa_GetMapfv); - SET_GetMapiv(exec, _mesa_GetMapiv); - SET_Map1d(exec, _mesa_Map1d); - SET_Map1f(exec, _mesa_Map1f); - SET_Map2d(exec, _mesa_Map2d); - SET_Map2f(exec, _mesa_Map2f); - SET_MapGrid1d(exec, _mesa_MapGrid1d); - SET_MapGrid1f(exec, _mesa_MapGrid1f); - SET_MapGrid2d(exec, _mesa_MapGrid2d); - SET_MapGrid2f(exec, _mesa_MapGrid2f); -#endif + + _mesa_init_eval_dispatch(exec); + SET_MultMatrixd(exec, _mesa_MultMatrixd); _mesa_init_pixel_dispatch(exec); diff --git a/src/mesa/main/api_noop.c b/src/mesa/main/api_noop.c index 162b685b02..23c52177d8 100644 --- a/src/mesa/main/api_noop.c +++ b/src/mesa/main/api_noop.c @@ -33,6 +33,7 @@ #if FEATURE_dlist #include "dlist.h" #endif +#include "eval.h" #include "glapi/dispatch.h" @@ -1005,14 +1006,9 @@ _mesa_noop_vtxfmt_init( GLvertexformat *vfmt ) vfmt->Color4fv = _mesa_noop_Color4fv; vfmt->EdgeFlag = _mesa_noop_EdgeFlag; vfmt->End = _mesa_noop_End; -#if FEATURE_evaluators - vfmt->EvalCoord1f = _mesa_noop_EvalCoord1f; - vfmt->EvalCoord1fv = _mesa_noop_EvalCoord1fv; - vfmt->EvalCoord2f = _mesa_noop_EvalCoord2f; - vfmt->EvalCoord2fv = _mesa_noop_EvalCoord2fv; - vfmt->EvalPoint1 = _mesa_noop_EvalPoint1; - vfmt->EvalPoint2 = _mesa_noop_EvalPoint2; -#endif + + _MESA_INIT_EVAL_VTXFMT(vfmt, _mesa_noop_); + vfmt->FogCoordfEXT = _mesa_noop_FogCoordfEXT; vfmt->FogCoordfvEXT = _mesa_noop_FogCoordfvEXT; vfmt->Indexf = _mesa_noop_Indexf; @@ -1070,6 +1066,4 @@ _mesa_noop_vtxfmt_init( GLvertexformat *vfmt ) vfmt->DrawElementsBaseVertex = _mesa_noop_DrawElementsBaseVertex; vfmt->DrawRangeElementsBaseVertex = _mesa_noop_DrawRangeElementsBaseVertex; vfmt->MultiDrawElementsBaseVertex = _mesa_noop_MultiDrawElementsBaseVertex; - vfmt->EvalMesh1 = _mesa_noop_EvalMesh1; - vfmt->EvalMesh2 = _mesa_noop_EvalMesh2; } diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 6994f98504..03ee7fb04d 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -94,9 +94,7 @@ #if FEATURE_dlist #include "dlist.h" #endif -#if FEATURE_evaluators #include "eval.h" -#endif #include "enums.h" #include "extensions.h" #include "fbobject.h" @@ -675,9 +673,7 @@ init_attrib_groups(GLcontext *ctx) #if FEATURE_dlist _mesa_init_display_list( ctx ); #endif -#if FEATURE_evaluators _mesa_init_eval( ctx ); -#endif _mesa_init_fbobjects( ctx ); _mesa_init_feedback( ctx ); _mesa_init_fog( ctx ); @@ -977,9 +973,7 @@ _mesa_free_context_data( GLcontext *ctx ) _mesa_free_attrib_data(ctx); _mesa_free_lighting_data( ctx ); -#if FEATURE_evaluators _mesa_free_eval_data( ctx ); -#endif _mesa_free_texture_data( ctx ); _mesa_free_matrix_data( ctx ); _mesa_free_viewport_data( ctx ); diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 35f9a3cf03..189743e5f5 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -1876,7 +1876,7 @@ save_Enable(GLenum cap) static void GLAPIENTRY -_mesa_save_EvalMesh1(GLenum mode, GLint i1, GLint i2) +save_EvalMesh1(GLenum mode, GLint i1, GLint i2) { GET_CURRENT_CONTEXT(ctx); Node *n; @@ -1894,7 +1894,7 @@ _mesa_save_EvalMesh1(GLenum mode, GLint i1, GLint i2) static void GLAPIENTRY -_mesa_save_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) +save_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) { GET_CURRENT_CONTEXT(ctx); Node *n; @@ -8451,8 +8451,8 @@ _mesa_init_dlist_table(struct _glapi_table *table) SET_DrawPixels(table, save_DrawPixels); SET_Enable(table, save_Enable); SET_EndList(table, _mesa_EndList); - SET_EvalMesh1(table, _mesa_save_EvalMesh1); - SET_EvalMesh2(table, _mesa_save_EvalMesh2); + SET_EvalMesh1(table, save_EvalMesh1); + SET_EvalMesh2(table, save_EvalMesh2); SET_Finish(table, exec_Finish); SET_Flush(table, exec_Flush); SET_Fogf(table, save_Fogf); @@ -9302,12 +9302,9 @@ _mesa_save_vtxfmt_init(GLvertexformat * vfmt) vfmt->Color4fv = save_Color4fv; vfmt->EdgeFlag = save_EdgeFlag; vfmt->End = save_End; - vfmt->EvalCoord1f = save_EvalCoord1f; - vfmt->EvalCoord1fv = save_EvalCoord1fv; - vfmt->EvalCoord2f = save_EvalCoord2f; - vfmt->EvalCoord2fv = save_EvalCoord2fv; - vfmt->EvalPoint1 = save_EvalPoint1; - vfmt->EvalPoint2 = save_EvalPoint2; + + _MESA_INIT_EVAL_VTXFMT(vfmt, save_); + vfmt->FogCoordfEXT = save_FogCoordfEXT; vfmt->FogCoordfvEXT = save_FogCoordfvEXT; vfmt->Indexf = save_Indexf; @@ -9356,8 +9353,6 @@ _mesa_save_vtxfmt_init(GLvertexformat * vfmt) vfmt->VertexAttrib4fARB = save_VertexAttrib4fARB; vfmt->VertexAttrib4fvARB = save_VertexAttrib4fvARB; - vfmt->EvalMesh1 = _mesa_save_EvalMesh1; - vfmt->EvalMesh2 = _mesa_save_EvalMesh2; vfmt->Rectf = save_Rectf; /* The driver is required to implement these as diff --git a/src/mesa/main/eval.c b/src/mesa/main/eval.c index 3f89f9c1ea..95d6e23187 100644 --- a/src/mesa/main/eval.c +++ b/src/mesa/main/eval.c @@ -44,6 +44,10 @@ #include "eval.h" #include "macros.h" #include "mtypes.h" +#include "glapi/dispatch.h" + + +#if FEATURE_evaluators /* @@ -417,7 +421,7 @@ map1(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, -void GLAPIENTRY +static void GLAPIENTRY _mesa_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points ) { @@ -425,7 +429,7 @@ _mesa_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride, } -void GLAPIENTRY +static void GLAPIENTRY _mesa_Map1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points ) { @@ -516,7 +520,7 @@ map2( GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, } -void GLAPIENTRY +static void GLAPIENTRY _mesa_Map2f( GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, @@ -527,7 +531,7 @@ _mesa_Map2f( GLenum target, } -void GLAPIENTRY +static void GLAPIENTRY _mesa_Map2d( GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, @@ -539,7 +543,7 @@ _mesa_Map2d( GLenum target, -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetMapdv( GLenum target, GLenum query, GLdouble *v ) { GET_CURRENT_CONTEXT(ctx); @@ -604,7 +608,7 @@ _mesa_GetMapdv( GLenum target, GLenum query, GLdouble *v ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v ) { GET_CURRENT_CONTEXT(ctx); @@ -669,7 +673,7 @@ _mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_GetMapiv( GLenum target, GLenum query, GLint *v ) { GET_CURRENT_CONTEXT(ctx); @@ -735,7 +739,7 @@ _mesa_GetMapiv( GLenum target, GLenum query, GLint *v ) -void GLAPIENTRY +static void GLAPIENTRY _mesa_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 ) { GET_CURRENT_CONTEXT(ctx); @@ -753,14 +757,14 @@ _mesa_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 ) } -void GLAPIENTRY +static void GLAPIENTRY _mesa_MapGrid1d( GLint un, GLdouble u1, GLdouble u2 ) { _mesa_MapGrid1f( un, (GLfloat) u1, (GLfloat) u2 ); } -void GLAPIENTRY +static void GLAPIENTRY _mesa_MapGrid2f( GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2 ) { @@ -788,7 +792,7 @@ _mesa_MapGrid2f( GLint un, GLfloat u1, GLfloat u2, } -void GLAPIENTRY +static void GLAPIENTRY _mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2 ) { @@ -797,6 +801,41 @@ _mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2, } +void +_mesa_install_eval_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt) +{ + SET_EvalCoord1f(disp, vfmt->EvalCoord1f); + SET_EvalCoord1fv(disp, vfmt->EvalCoord1fv); + SET_EvalCoord2f(disp, vfmt->EvalCoord2f); + SET_EvalCoord2fv(disp, vfmt->EvalCoord2fv); + SET_EvalPoint1(disp, vfmt->EvalPoint1); + SET_EvalPoint2(disp, vfmt->EvalPoint2); + + SET_EvalMesh1(disp, vfmt->EvalMesh1); + SET_EvalMesh2(disp, vfmt->EvalMesh2); +} + + +void +_mesa_init_eval_dispatch(struct _glapi_table *disp) +{ + SET_GetMapdv(disp, _mesa_GetMapdv); + SET_GetMapfv(disp, _mesa_GetMapfv); + SET_GetMapiv(disp, _mesa_GetMapiv); + SET_Map1d(disp, _mesa_Map1d); + SET_Map1f(disp, _mesa_Map1f); + SET_Map2d(disp, _mesa_Map2d); + SET_Map2f(disp, _mesa_Map2f); + SET_MapGrid1d(disp, _mesa_MapGrid1d); + SET_MapGrid1f(disp, _mesa_MapGrid1f); + SET_MapGrid2d(disp, _mesa_MapGrid2d); + SET_MapGrid2f(disp, _mesa_MapGrid2f); +} + + +#endif /* FEATURE_evaluators */ + /**********************************************************************/ /***** Initialization *****/ diff --git a/src/mesa/main/eval.h b/src/mesa/main/eval.h index b3ff0a96f8..ffd1bab76d 100644 --- a/src/mesa/main/eval.h +++ b/src/mesa/main/eval.h @@ -37,13 +37,22 @@ #define EVAL_H -#include "mtypes.h" +#include "main/mtypes.h" -#if _HAVE_FULL_GL -extern void _mesa_init_eval( GLcontext *ctx ); -extern void _mesa_free_eval_data( GLcontext *ctx ); +#if FEATURE_evaluators +#define _MESA_INIT_EVAL_VTXFMT(vfmt, impl) \ + do { \ + (vfmt)->EvalCoord1f = impl ## EvalCoord1f; \ + (vfmt)->EvalCoord1fv = impl ## EvalCoord1fv; \ + (vfmt)->EvalCoord2f = impl ## EvalCoord2f; \ + (vfmt)->EvalCoord2fv = impl ## EvalCoord2fv; \ + (vfmt)->EvalPoint1 = impl ## EvalPoint1; \ + (vfmt)->EvalPoint2 = impl ## EvalPoint2; \ + (vfmt)->EvalMesh1 = impl ## EvalMesh1; \ + (vfmt)->EvalMesh2 = impl ## EvalMesh2; \ + } while (0) extern GLuint _mesa_evaluator_components( GLenum target ); @@ -70,59 +79,32 @@ extern GLfloat *_mesa_copy_map_points2d(GLenum target, GLint vstride, GLint vorder, const GLdouble *points ); +extern void +_mesa_install_eval_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt); +extern void +_mesa_init_eval_dispatch(struct _glapi_table *disp); -extern void GLAPIENTRY -_mesa_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride, - GLint order, const GLfloat *points ); - -extern void GLAPIENTRY -_mesa_Map2f( GLenum target, - GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, - GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, - const GLfloat *points ); - -extern void GLAPIENTRY -_mesa_Map1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride, - GLint order, const GLdouble *points ); - -extern void GLAPIENTRY -_mesa_Map2d( GLenum target, - GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, - GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, - const GLdouble *points ); - -extern void GLAPIENTRY -_mesa_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 ); +#else /* FEATURE_evaluators */ -extern void GLAPIENTRY -_mesa_MapGrid1d( GLint un, GLdouble u1, GLdouble u2 ); +#define _MESA_INIT_EVAL_VTXFMT(vfmt, impl) do { } while (0) -extern void GLAPIENTRY -_mesa_MapGrid2f( GLint un, GLfloat u1, GLfloat u2, - GLint vn, GLfloat v1, GLfloat v2 ); +static INLINE void +_mesa_install_eval_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt) +{ +} -extern void GLAPIENTRY -_mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2, - GLint vn, GLdouble v1, GLdouble v2 ); +static INLINE void +_mesa_init_eval_dispatch(struct _glapi_table *disp) +{ +} -extern void GLAPIENTRY -_mesa_GetMapdv( GLenum target, GLenum query, GLdouble *v ); +#endif /* FEATURE_evaluators */ -extern void GLAPIENTRY -_mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v ); - -extern void GLAPIENTRY -_mesa_GetMapiv( GLenum target, GLenum query, GLint *v ); - -#else - -/** No-op */ -#define _mesa_init_eval( c ) ((void)0) - -/** No-op */ -#define _mesa_free_eval_data( c ) ((void)0) +extern void _mesa_init_eval( GLcontext *ctx ); +extern void _mesa_free_eval_data( GLcontext *ctx ); -#endif -#endif +#endif /* EVAL_H */ diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c index de9479d6b0..c35e4dabe3 100644 --- a/src/mesa/main/vtxfmt.c +++ b/src/mesa/main/vtxfmt.c @@ -34,6 +34,7 @@ #include "mtypes.h" #include "state.h" #include "vtxfmt.h" +#include "eval.h" /* The neutral vertex format. This wraps all tnl module functions, @@ -90,12 +91,9 @@ install_vtxfmt( struct _glapi_table *tab, const GLvertexformat *vfmt ) SET_Color4f(tab, vfmt->Color4f); SET_Color4fv(tab, vfmt->Color4fv); SET_EdgeFlag(tab, vfmt->EdgeFlag); - SET_EvalCoord1f(tab, vfmt->EvalCoord1f); - SET_EvalCoord1fv(tab, vfmt->EvalCoord1fv); - SET_EvalCoord2f(tab, vfmt->EvalCoord2f); - SET_EvalCoord2fv(tab, vfmt->EvalCoord2fv); - SET_EvalPoint1(tab, vfmt->EvalPoint1); - SET_EvalPoint2(tab, vfmt->EvalPoint2); + + _mesa_install_eval_vtxfmt(tab, vfmt); + SET_FogCoordfEXT(tab, vfmt->FogCoordfEXT); SET_FogCoordfvEXT(tab, vfmt->FogCoordfvEXT); SET_Indexf(tab, vfmt->Indexf); @@ -139,9 +137,6 @@ install_vtxfmt( struct _glapi_table *tab, const GLvertexformat *vfmt ) SET_DrawElementsBaseVertex(tab, vfmt->DrawElementsBaseVertex); SET_DrawRangeElementsBaseVertex(tab, vfmt->DrawRangeElementsBaseVertex); SET_MultiDrawElementsBaseVertex(tab, vfmt->MultiDrawElementsBaseVertex); - SET_EvalMesh1(tab, vfmt->EvalMesh1); - SET_EvalMesh2(tab, vfmt->EvalMesh2); - ASSERT(tab->EvalMesh2); /* GL_NV_vertex_program */ SET_VertexAttrib1fNV(tab, vfmt->VertexAttrib1fNV); diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index 238beee030..cfe8be77e5 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -38,6 +38,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #if FEATURE_dlist #include "main/dlist.h" #endif +#include "main/eval.h" #include "main/state.h" #include "main/light.h" #include "main/api_arrayelt.h" @@ -392,6 +393,7 @@ do { \ +#if FEATURE_evaluators /* Eval */ static void GLAPIENTRY vbo_exec_EvalCoord1f( GLfloat u ) @@ -485,6 +487,12 @@ static void GLAPIENTRY vbo_exec_EvalPoint2( GLint i, GLint j ) vbo_exec_EvalCoord2f( u, v ); } +/* use noop eval mesh */ +#define vbo_exec_EvalMesh1 _mesa_noop_EvalMesh1 +#define vbo_exec_EvalMesh2 _mesa_noop_EvalMesh2 + +#endif /* FEATURE_evaluators */ + /* Build a list of primitives on the fly. Keep * ctx->Driver.CurrentExecPrimitive uptodate as well. @@ -565,17 +573,10 @@ static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec ) vfmt->CallLists = _mesa_CallLists; #endif vfmt->End = vbo_exec_End; - vfmt->EvalCoord1f = vbo_exec_EvalCoord1f; - vfmt->EvalCoord1fv = vbo_exec_EvalCoord1fv; - vfmt->EvalCoord2f = vbo_exec_EvalCoord2f; - vfmt->EvalCoord2fv = vbo_exec_EvalCoord2fv; - vfmt->EvalPoint1 = vbo_exec_EvalPoint1; - vfmt->EvalPoint2 = vbo_exec_EvalPoint2; - vfmt->Rectf = _mesa_noop_Rectf; - vfmt->EvalMesh1 = _mesa_noop_EvalMesh1; - vfmt->EvalMesh2 = _mesa_noop_EvalMesh2; + _MESA_INIT_EVAL_VTXFMT(vfmt, vbo_exec_); + vfmt->Rectf = _mesa_noop_Rectf; /* from attrib_tmp.h: */ diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c index 6e11344380..611460dc7b 100644 --- a/src/mesa/vbo/vbo_save_api.c +++ b/src/mesa/vbo/vbo_save_api.c @@ -72,6 +72,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/context.h" #include "main/dlist.h" #include "main/enums.h" +#include "main/eval.h" #include "main/macros.h" #include "main/api_noop.h" #include "main/api_validate.h" @@ -1050,18 +1051,12 @@ static void _save_vtxfmt_init( GLcontext *ctx ) */ vfmt->CallList = _save_CallList; /* inside begin/end */ vfmt->CallLists = _save_CallLists; /* inside begin/end */ - vfmt->EvalCoord1f = _save_EvalCoord1f; - vfmt->EvalCoord1fv = _save_EvalCoord1fv; - vfmt->EvalCoord2f = _save_EvalCoord2f; - vfmt->EvalCoord2fv = _save_EvalCoord2fv; - vfmt->EvalPoint1 = _save_EvalPoint1; - vfmt->EvalPoint2 = _save_EvalPoint2; + + _MESA_INIT_EVAL_VTXFMT(vfmt, _save_); /* These are all errors as we at least know we are in some sort of * begin/end pair: */ - vfmt->EvalMesh1 = _save_EvalMesh1; - vfmt->EvalMesh2 = _save_EvalMesh2; vfmt->Begin = _save_Begin; vfmt->Rectf = _save_Rectf; vfmt->DrawArrays = _save_DrawArrays; -- cgit v1.2.3 From a73ba2d31b87e974f6846a8aaced704634f6f657 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Wed, 9 Sep 2009 15:00:08 +0800 Subject: mesa/main: Make FEATURE_dlist follow feature conventions. As shown in mfeatures.h, this allows users of dlist.h to work without knowing if the feature is available. --- src/mesa/main/api_exec.c | 13 +------ src/mesa/main/api_noop.c | 9 ++--- src/mesa/main/context.c | 8 ++--- src/mesa/main/dlist.c | 64 ++++++++++++++++++++++++++--------- src/mesa/main/dlist.h | 82 ++++++++++++++++++++++++++------------------- src/mesa/main/shared.c | 4 --- src/mesa/main/vtxfmt.c | 6 ++-- src/mesa/vbo/vbo_exec_api.c | 7 +--- src/mesa/vbo/vbo_save_api.c | 3 +- 9 files changed, 110 insertions(+), 86 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index fc4de3c14c..1559984f43 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -54,9 +54,7 @@ #include "context.h" #include "convolve.h" #include "depth.h" -#if FEATURE_dlist #include "dlist.h" -#endif #include "drawpix.h" #include "rastpos.h" #include "enable.h" @@ -179,17 +177,8 @@ _mesa_init_exec_table(struct _glapi_table *exec) SET_Viewport(exec, _mesa_Viewport); _mesa_init_accum_dispatch(exec); + _mesa_init_dlist_dispatch(exec); -#if FEATURE_dlist - SET_CallList(exec, _mesa_CallList); - SET_CallLists(exec, _mesa_CallLists); - SET_DeleteLists(exec, _mesa_DeleteLists); - SET_EndList(exec, _mesa_EndList); - SET_GenLists(exec, _mesa_GenLists); - SET_IsList(exec, _mesa_IsList); - SET_ListBase(exec, _mesa_ListBase); - SET_NewList(exec, _mesa_NewList); -#endif SET_ClearDepth(exec, _mesa_ClearDepth); SET_ClearIndex(exec, _mesa_ClearIndex); SET_ClipPlane(exec, _mesa_ClipPlane); diff --git a/src/mesa/main/api_noop.c b/src/mesa/main/api_noop.c index 23c52177d8..06c287fd19 100644 --- a/src/mesa/main/api_noop.c +++ b/src/mesa/main/api_noop.c @@ -30,9 +30,7 @@ #include "context.h" #include "light.h" #include "macros.h" -#if FEATURE_dlist #include "dlist.h" -#endif #include "eval.h" #include "glapi/dispatch.h" @@ -996,10 +994,9 @@ _mesa_noop_vtxfmt_init( GLvertexformat *vfmt ) _MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_); vfmt->Begin = _mesa_noop_Begin; -#if FEATURE_dlist - vfmt->CallList = _mesa_CallList; - vfmt->CallLists = _mesa_CallLists; -#endif + + _MESA_INIT_DLIST_VTXFMT(vfmt, _mesa_); + vfmt->Color3f = _mesa_noop_Color3f; vfmt->Color3fv = _mesa_noop_Color3fv; vfmt->Color4f = _mesa_noop_Color4f; diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 03ee7fb04d..11b1d24453 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -91,9 +91,7 @@ #include "cpuinfo.h" #include "debug.h" #include "depth.h" -#if FEATURE_dlist #include "dlist.h" -#endif #include "eval.h" #include "enums.h" #include "extensions.h" @@ -670,9 +668,7 @@ init_attrib_groups(GLcontext *ctx) _mesa_init_current( ctx ); _mesa_init_depth( ctx ); _mesa_init_debug( ctx ); -#if FEATURE_dlist _mesa_init_display_list( ctx ); -#endif _mesa_init_eval( ctx ); _mesa_init_fbobjects( ctx ); _mesa_init_feedback( ctx ); @@ -869,10 +865,12 @@ _mesa_initialize_context(GLcontext *ctx, _mesa_init_exec_table(ctx->Exec); #endif ctx->CurrentDispatch = ctx->Exec; + #if FEATURE_dlist - _mesa_init_dlist_table(ctx->Save); + _mesa_init_save_table(ctx->Save); _mesa_install_save_vtxfmt( ctx, &ctx->ListState.ListVtxfmt ); #endif + /* Neutral tnl module stuff */ _mesa_init_exec_vtxfmt( ctx ); ctx->TnlModule.Current = NULL; diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 189743e5f5..6354ed7474 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -73,6 +73,7 @@ #include "texstate.h" #include "mtypes.h" #include "varray.h" +#include "vtxfmt.h" #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program #include "shader/arbprogram.h" #include "shader/program.h" @@ -438,6 +439,10 @@ typedef union gl_dlist_node Node; */ static GLuint InstSize[OPCODE_END_OF_LIST + 1]; + +#if FEATURE_dlist + + void mesa_print_display_list(GLuint list); @@ -1047,8 +1052,8 @@ static void invalidate_saved_current_state( GLcontext *ctx ) ctx->Driver.CurrentSavePrimitive = PRIM_UNKNOWN; } -void GLAPIENTRY -_mesa_save_CallList(GLuint list) +static void GLAPIENTRY +save_CallList(GLuint list) { GET_CURRENT_CONTEXT(ctx); Node *n; @@ -1070,8 +1075,8 @@ _mesa_save_CallList(GLuint list) } -void GLAPIENTRY -_mesa_save_CallLists(GLsizei num, GLenum type, const GLvoid * lists) +static void GLAPIENTRY +save_CallLists(GLsizei num, GLenum type, const GLvoid * lists) { GET_CURRENT_CONTEXT(ctx); GLint i; @@ -7426,7 +7431,7 @@ execute_list(GLcontext *ctx, GLuint list) /** * Test if a display list number is valid. */ -GLboolean GLAPIENTRY +static GLboolean GLAPIENTRY _mesa_IsList(GLuint list) { GET_CURRENT_CONTEXT(ctx); @@ -7439,7 +7444,7 @@ _mesa_IsList(GLuint list) /** * Delete a sequence of consecutive display lists. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_DeleteLists(GLuint list, GLsizei range) { GET_CURRENT_CONTEXT(ctx); @@ -7461,7 +7466,7 @@ _mesa_DeleteLists(GLuint list, GLsizei range) * Return a display list number, n, such that lists n through n+range-1 * are free. */ -GLuint GLAPIENTRY +static GLuint GLAPIENTRY _mesa_GenLists(GLsizei range) { GET_CURRENT_CONTEXT(ctx); @@ -7501,7 +7506,7 @@ _mesa_GenLists(GLsizei range) /** * Begin a new display list. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_NewList(GLuint name, GLenum mode) { GET_CURRENT_CONTEXT(ctx); @@ -7551,7 +7556,7 @@ _mesa_NewList(GLuint name, GLenum mode) /** * End definition of current display list. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_EndList(void) { GET_CURRENT_CONTEXT(ctx); @@ -7685,7 +7690,7 @@ _mesa_CallLists(GLsizei n, GLenum type, const GLvoid * lists) /** * Set the offset added to list numbers in glCallLists. */ -void GLAPIENTRY +static void GLAPIENTRY _mesa_ListBase(GLuint base) { GET_CURRENT_CONTEXT(ctx); @@ -8420,7 +8425,7 @@ exec_MultiModeDrawElementsIBM(const GLenum * mode, * struct. */ void -_mesa_init_dlist_table(struct _glapi_table *table) +_mesa_init_save_table(struct _glapi_table *table) { _mesa_loopback_init_api_table(table); @@ -8429,8 +8434,8 @@ _mesa_init_dlist_table(struct _glapi_table *table) SET_AlphaFunc(table, save_AlphaFunc); SET_Bitmap(table, save_Bitmap); SET_BlendFunc(table, save_BlendFunc); - SET_CallList(table, _mesa_save_CallList); - SET_CallLists(table, _mesa_save_CallLists); + SET_CallList(table, save_CallList); + SET_CallLists(table, save_CallLists); SET_Clear(table, save_Clear); SET_ClearAccum(table, save_ClearAccum); SET_ClearColor(table, save_ClearColor); @@ -9294,8 +9299,9 @@ _mesa_save_vtxfmt_init(GLvertexformat * vfmt) _MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_); vfmt->Begin = save_Begin; - vfmt->CallList = _mesa_save_CallList; - vfmt->CallLists = _mesa_save_CallLists; + + _MESA_INIT_DLIST_VTXFMT(vfmt, save_); + vfmt->Color3f = save_Color3f; vfmt->Color3fv = save_Color3fv; vfmt->Color4f = save_Color4f; @@ -9373,6 +9379,32 @@ _mesa_save_vtxfmt_init(GLvertexformat * vfmt) } +void +_mesa_install_dlist_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt) +{ + SET_CallList(disp, vfmt->CallList); + SET_CallLists(disp, vfmt->CallLists); +} + + +void _mesa_init_dlist_dispatch(struct _glapi_table *disp) +{ + SET_CallList(disp, _mesa_CallList); + SET_CallLists(disp, _mesa_CallLists); + + SET_DeleteLists(disp, _mesa_DeleteLists); + SET_EndList(disp, _mesa_EndList); + SET_GenLists(disp, _mesa_GenLists); + SET_IsList(disp, _mesa_IsList); + SET_ListBase(disp, _mesa_ListBase); + SET_NewList(disp, _mesa_NewList); +} + + +#endif /* FEATURE_dlist */ + + /** * Initialize display list state for given context. */ @@ -9397,5 +9429,7 @@ _mesa_init_display_list(GLcontext *ctx) /* Display List group */ ctx->List.ListBase = 0; +#if FEATURE_dlist _mesa_save_vtxfmt_init(&ctx->ListState.ListVtxfmt); +#endif } diff --git a/src/mesa/main/dlist.h b/src/mesa/main/dlist.h index ab7ec2c8db..af36991d5e 100644 --- a/src/mesa/main/dlist.h +++ b/src/mesa/main/dlist.h @@ -33,41 +33,34 @@ #define DLIST_H -#include "mtypes.h" +#include "main/mtypes.h" -#if _HAVE_FULL_GL +#if FEATURE_dlist -extern void -_mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist); +#define _MESA_INIT_DLIST_FUNCTIONS(driver, impl) \ + do { \ + (driver)->NewList = impl ## NewList; \ + (driver)->EndList = impl ## EndList; \ + (driver)->BeginCallList = impl ## BeginCallList; \ + (driver)->EndCallList = impl ## EndCallList; \ + (driver)->SaveFlushVertices = impl ## SaveFlushVertices; \ + (driver)->NotifySaveBegin = impl ## NotifyBegin; \ + } while (0) + +#define _MESA_INIT_DLIST_VTXFMT(vfmt, impl) \ + do { \ + (vfmt)->CallList = impl ## CallList; \ + (vfmt)->CallLists = impl ## CallLists; \ + } while (0) extern void GLAPIENTRY _mesa_CallList( GLuint list ); extern void GLAPIENTRY _mesa_CallLists( GLsizei n, GLenum type, const GLvoid *lists ); -extern void GLAPIENTRY _mesa_DeleteLists( GLuint list, GLsizei range ); - -extern void GLAPIENTRY _mesa_EndList( void ); - -extern GLuint GLAPIENTRY _mesa_GenLists( GLsizei range ); - -extern GLboolean GLAPIENTRY _mesa_IsList( GLuint list ); - -extern void GLAPIENTRY _mesa_ListBase( GLuint base ); - -extern void GLAPIENTRY _mesa_NewList( GLuint list, GLenum mode ); - -extern void GLAPIENTRY _mesa_save_CallLists( GLsizei n, GLenum type, const GLvoid *lists ); - -extern void GLAPIENTRY _mesa_save_CallList( GLuint list ); - - - -extern void _mesa_init_dlist_table( struct _glapi_table *table ); extern void _mesa_compile_error( GLcontext *ctx, GLenum error, const char *s ); - extern void *_mesa_alloc_instruction(GLcontext *ctx, GLuint opcode, GLuint sz); extern GLint _mesa_alloc_opcode( GLcontext *ctx, GLuint sz, @@ -75,22 +68,43 @@ extern GLint _mesa_alloc_opcode( GLcontext *ctx, GLuint sz, void (*destroy)( GLcontext *, void * ), void (*print)( GLcontext *, void * ) ); -extern void _mesa_init_display_list( GLcontext * ctx ); +extern void _mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist); extern void _mesa_save_vtxfmt_init( GLvertexformat *vfmt ); +extern void _mesa_init_save_table( struct _glapi_table *table ); + +extern void _mesa_install_dlist_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt); + +extern void _mesa_init_dlist_dispatch(struct _glapi_table *disp); -#else +#else /* FEATURE_dlist */ -/** No-op */ -#define _mesa_init_dlist_table(t,ts) ((void)0) +#define _MESA_INIT_DLIST_FUNCTIONS(driver, impl) do { } while (0) +#define _MESA_INIT_DLIST_VTXFMT(vfmt, impl) do { } while (0) -/** No-op */ -#define _mesa_init_display_list(c) ((void)0) +static INLINE void +_mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist) +{ + /* there should be no list to delete */ + ASSERT_NO_FEATURE(); +} -/** No-op */ -#define _mesa_save_vtxfmt_init(v) ((void)0) +static INLINE void +_mesa_install_dlist_vtxfmt(struct _glapi_table *disp, + const GLvertexformat *vfmt) +{ +} + +static INLINE void +_mesa_init_dlist_dispatch(struct _glapi_table *disp) +{ +} + +#endif /* FEATURE_dlist */ + +extern void _mesa_init_display_list( GLcontext * ctx ); -#endif -#endif +#endif /* DLIST_H */ diff --git a/src/mesa/main/shared.c b/src/mesa/main/shared.c index 643ad3354e..4d01e8abc6 100644 --- a/src/mesa/main/shared.c +++ b/src/mesa/main/shared.c @@ -37,9 +37,7 @@ #include "shared.h" #include "shader/program.h" #include "shader/shader_api.h" -#if FEATURE_dlist #include "dlist.h" -#endif #if FEATURE_ATI_fragment_shader #include "shader/atifragshader.h" #endif @@ -143,11 +141,9 @@ _mesa_alloc_shared_state(GLcontext *ctx) static void delete_displaylist_cb(GLuint id, void *data, void *userData) { -#if FEATURE_dlist struct gl_display_list *list = (struct gl_display_list *) data; GLcontext *ctx = (GLcontext *) userData; _mesa_delete_list(ctx, list); -#endif } diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c index c35e4dabe3..8336ff34d2 100644 --- a/src/mesa/main/vtxfmt.c +++ b/src/mesa/main/vtxfmt.c @@ -35,6 +35,7 @@ #include "state.h" #include "vtxfmt.h" #include "eval.h" +#include "dlist.h" /* The neutral vertex format. This wraps all tnl module functions, @@ -125,8 +126,9 @@ install_vtxfmt( struct _glapi_table *tab, const GLvertexformat *vfmt ) SET_Vertex3fv(tab, vfmt->Vertex3fv); SET_Vertex4f(tab, vfmt->Vertex4f); SET_Vertex4fv(tab, vfmt->Vertex4fv); - SET_CallList(tab, vfmt->CallList); - SET_CallLists(tab, vfmt->CallLists); + + _mesa_install_dlist_vtxfmt(tab, vfmt); + SET_Begin(tab, vfmt->Begin); SET_End(tab, vfmt->End); SET_Rectf(tab, vfmt->Rectf); diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index cfe8be77e5..3eb85789fa 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -35,9 +35,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/context.h" #include "main/macros.h" #include "main/vtxfmt.h" -#if FEATURE_dlist #include "main/dlist.h" -#endif #include "main/eval.h" #include "main/state.h" #include "main/light.h" @@ -568,12 +566,9 @@ static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec ) _MESA_INIT_ARRAYELT_VTXFMT(vfmt, _ae_); vfmt->Begin = vbo_exec_Begin; -#if FEATURE_dlist - vfmt->CallList = _mesa_CallList; - vfmt->CallLists = _mesa_CallLists; -#endif vfmt->End = vbo_exec_End; + _MESA_INIT_DLIST_VTXFMT(vfmt, _mesa_); _MESA_INIT_EVAL_VTXFMT(vfmt, vbo_exec_); vfmt->Rectf = _mesa_noop_Rectf; diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c index 611460dc7b..4da248e2b8 100644 --- a/src/mesa/vbo/vbo_save_api.c +++ b/src/mesa/vbo/vbo_save_api.c @@ -1049,8 +1049,7 @@ static void _save_vtxfmt_init( GLcontext *ctx ) /* This will all require us to fallback to saving the list as opcodes: */ - vfmt->CallList = _save_CallList; /* inside begin/end */ - vfmt->CallLists = _save_CallLists; /* inside begin/end */ + _MESA_INIT_DLIST_VTXFMT(vfmt, _save_); /* inside begin/end */ _MESA_INIT_EVAL_VTXFMT(vfmt, _save_); -- cgit v1.2.3 From cef97267d696d37f4dccb22951499ca25d5d87ad Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Sat, 12 Sep 2009 18:59:13 +0800 Subject: mesa/main: New feature FEATURE_beginend. This feature corresponds to the Begin/End paradigm. Disabling this feature also eliminates the use of GLvertexformat completely. --- src/mesa/main/api_loopback.c | 7 ++++ src/mesa/main/api_loopback.h | 16 ++++++-- src/mesa/main/api_noop.c | 6 +++ src/mesa/main/api_noop.h | 9 +++-- src/mesa/main/mfeatures.h | 4 +- src/mesa/main/vtxfmt.c | 6 +++ src/mesa/main/vtxfmt.h | 28 ++++++++++++- src/mesa/vbo/vbo_exec.h | 18 +++++++++ src/mesa/vbo/vbo_exec_api.c | 94 +++++++++++++++++++++++++++++++++++++++++++- src/mesa/vbo/vbo_exec_draw.c | 6 +++ 10 files changed, 184 insertions(+), 10 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/api_loopback.c b/src/mesa/main/api_loopback.c index 0e3f5ff957..3d466ac44a 100644 --- a/src/mesa/main/api_loopback.c +++ b/src/mesa/main/api_loopback.c @@ -77,6 +77,10 @@ #define FOGCOORDF(x) CALL_FogCoordfEXT(GET_DISPATCH(), (x)) #define SECONDARYCOLORF(a,b,c) CALL_SecondaryColor3fEXT(GET_DISPATCH(), (a,b,c)) + +#if FEATURE_beginend + + static void GLAPIENTRY loopback_Color3b_f( GLbyte red, GLbyte green, GLbyte blue ) { @@ -1655,3 +1659,6 @@ _mesa_loopback_init_api_table( struct _glapi_table *dest ) SET_VertexAttrib4NusvARB(dest, loopback_VertexAttrib4NusvARB); SET_VertexAttrib4NuivARB(dest, loopback_VertexAttrib4NuivARB); } + + +#endif /* FEATURE_beginend */ diff --git a/src/mesa/main/api_loopback.h b/src/mesa/main/api_loopback.h index 6f85bbc1d9..3140eb515e 100644 --- a/src/mesa/main/api_loopback.h +++ b/src/mesa/main/api_loopback.h @@ -27,11 +27,19 @@ #ifndef API_LOOPBACK_H #define API_LOOPBACK_H -#include "glheader.h" +#include "main/mtypes.h" - -struct _glapi_table; +#if FEATURE_beginend extern void _mesa_loopback_init_api_table( struct _glapi_table *dest ); -#endif +#else /* FEATURE_beginend */ + +static INLINE void +_mesa_loopback_init_api_table( struct _glapi_table *dest ) +{ +} + +#endif /* FEATURE_beginend */ + +#endif /* API_LOOPBACK_H */ diff --git a/src/mesa/main/api_noop.c b/src/mesa/main/api_noop.c index 06c287fd19..f72f957300 100644 --- a/src/mesa/main/api_noop.c +++ b/src/mesa/main/api_noop.c @@ -43,6 +43,9 @@ */ +#if FEATURE_beginend + + static void GLAPIENTRY _mesa_noop_EdgeFlag( GLboolean b ) { GET_CURRENT_CONTEXT(ctx); @@ -1064,3 +1067,6 @@ _mesa_noop_vtxfmt_init( GLvertexformat *vfmt ) vfmt->DrawRangeElementsBaseVertex = _mesa_noop_DrawRangeElementsBaseVertex; vfmt->MultiDrawElementsBaseVertex = _mesa_noop_MultiDrawElementsBaseVertex; } + + +#endif /* FEATURE_beginend */ diff --git a/src/mesa/main/api_noop.h b/src/mesa/main/api_noop.h index 1150984d64..e7fd49bafb 100644 --- a/src/mesa/main/api_noop.h +++ b/src/mesa/main/api_noop.h @@ -25,8 +25,9 @@ #ifndef _API_NOOP_H #define _API_NOOP_H -#include "mtypes.h" -#include "context.h" +#include "main/mtypes.h" + +#if FEATURE_beginend extern void GLAPIENTRY _mesa_noop_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); @@ -54,4 +55,6 @@ _mesa_noop_MultiDrawElementsBaseVertex(GLenum mode, const GLsizei *count, extern void _mesa_noop_vtxfmt_init(GLvertexformat *vfmt); -#endif +#endif /* FEATURE_beginend */ + +#endif /* _API_NOOP_H */ diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h index 27799771a5..c2fb8404b1 100644 --- a/src/mesa/main/mfeatures.h +++ b/src/mesa/main/mfeatures.h @@ -71,10 +71,12 @@ #define FEATURE_accum _HAVE_FULL_GL #define FEATURE_arrayelt _HAVE_FULL_GL #define FEATURE_attrib_stack _HAVE_FULL_GL +/* this disables vtxfmt, api_loopback, and api_noop completely */ +#define FEATURE_beginend _HAVE_FULL_GL #define FEATURE_colortable _HAVE_FULL_GL #define FEATURE_convolve _HAVE_FULL_GL #define FEATURE_dispatch _HAVE_FULL_GL -#define FEATURE_dlist (_HAVE_FULL_GL && FEATURE_arrayelt) +#define FEATURE_dlist (_HAVE_FULL_GL && FEATURE_arrayelt && FEATURE_beginend) #define FEATURE_draw_read_buffer _HAVE_FULL_GL #define FEATURE_drawpix _HAVE_FULL_GL #define FEATURE_evaluators _HAVE_FULL_GL diff --git a/src/mesa/main/vtxfmt.c b/src/mesa/main/vtxfmt.c index 8336ff34d2..c9eea8ab83 100644 --- a/src/mesa/main/vtxfmt.c +++ b/src/mesa/main/vtxfmt.c @@ -38,6 +38,9 @@ #include "dlist.h" +#if FEATURE_beginend + + /* The neutral vertex format. This wraps all tnl module functions, * verifying that the currently-installed module is valid and then * installing the function pointers in a lazy fashion. It records the @@ -195,3 +198,6 @@ void _mesa_restore_exec_vtxfmt( GLcontext *ctx ) tnl->SwapCount = 0; } + + +#endif /* FEATURE_beginend */ diff --git a/src/mesa/main/vtxfmt.h b/src/mesa/main/vtxfmt.h index 76f108e023..fb6c23abe9 100644 --- a/src/mesa/main/vtxfmt.h +++ b/src/mesa/main/vtxfmt.h @@ -33,6 +33,8 @@ #ifndef _VTXFMT_H_ #define _VTXFMT_H_ +#if FEATURE_beginend + extern void _mesa_init_exec_vtxfmt( GLcontext *ctx ); extern void _mesa_install_exec_vtxfmt( GLcontext *ctx, const GLvertexformat *vfmt ); @@ -40,4 +42,28 @@ extern void _mesa_install_save_vtxfmt( GLcontext *ctx, const GLvertexformat *vfm extern void _mesa_restore_exec_vtxfmt( GLcontext *ctx ); -#endif +#else /* FEATURE_beginend */ + +static INLINE void +_mesa_init_exec_vtxfmt( GLcontext *ctx ) +{ +} + +static INLINE void +_mesa_install_exec_vtxfmt( GLcontext *ctx, const GLvertexformat *vfmt ) +{ +} + +static INLINE void +_mesa_install_save_vtxfmt( GLcontext *ctx, const GLvertexformat *vfmt ) +{ +} + +static INLINE void +_mesa_restore_exec_vtxfmt( GLcontext *ctx ) +{ +} + +#endif /* FEATURE_beginend */ + +#endif /* _VTXFMT_H_ */ diff --git a/src/mesa/vbo/vbo_exec.h b/src/mesa/vbo/vbo_exec.h index e0f44892cf..516be0995b 100644 --- a/src/mesa/vbo/vbo_exec.h +++ b/src/mesa/vbo/vbo_exec.h @@ -161,8 +161,26 @@ void vbo_exec_array_destroy( struct vbo_exec_context *exec ); void vbo_exec_vtx_init( struct vbo_exec_context *exec ); void vbo_exec_vtx_destroy( struct vbo_exec_context *exec ); + +#if FEATURE_beginend + void vbo_exec_vtx_flush( struct vbo_exec_context *exec, GLboolean unmap ); void vbo_exec_vtx_map( struct vbo_exec_context *exec ); + +#else /* FEATURE_beginend */ + +static INLINE void +vbo_exec_vtx_flush( struct vbo_exec_context *exec, GLboolean unmap ) +{ +} + +static INLINE void +vbo_exec_vtx_map( struct vbo_exec_context *exec ) +{ +} + +#endif /* FEATURE_beginend */ + void vbo_exec_vtx_wrap( struct vbo_exec_context *exec ); void vbo_exec_eval_update( struct vbo_exec_context *exec ); diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index 3eb85789fa..bfa6d76886 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -348,7 +348,7 @@ static void vbo_exec_fixup_vertex( GLcontext *ctx, } - +#if FEATURE_beginend /* */ @@ -635,6 +635,98 @@ static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec ) } +#else /* FEATURE_beginend */ + + +#define ATTR( A, N, V0, V1, V2, V3 ) \ +do { \ + struct vbo_exec_context *exec = &vbo_context(ctx)->exec; \ + \ + /* FLUSH_UPDATE_CURRENT needs to be set manually */ \ + exec->ctx->Driver.NeedFlush |= FLUSH_UPDATE_CURRENT; \ + \ + if (exec->vtx.active_sz[A] != N) \ + vbo_exec_fixup_vertex(ctx, A, N); \ + \ + { \ + GLfloat *dest = exec->vtx.attrptr[A]; \ + if (N>0) dest[0] = V0; \ + if (N>1) dest[1] = V1; \ + if (N>2) dest[2] = V2; \ + if (N>3) dest[3] = V3; \ + } \ +} while (0) + +#define ERROR() _mesa_error( ctx, GL_INVALID_ENUM, __FUNCTION__ ) +#define TAG(x) vbo_##x + +#include "vbo_attrib_tmp.h" + +static void vbo_exec_vtxfmt_init( struct vbo_exec_context *exec ) +{ + /* silence warnings */ + (void) vbo_Color3f; + (void) vbo_Color3fv; + (void) vbo_Color4f; + (void) vbo_Color4fv; + (void) vbo_FogCoordfEXT; + (void) vbo_FogCoordfvEXT; + (void) vbo_MultiTexCoord1f; + (void) vbo_MultiTexCoord1fv; + (void) vbo_MultiTexCoord2f; + (void) vbo_MultiTexCoord2fv; + (void) vbo_MultiTexCoord3f; + (void) vbo_MultiTexCoord3fv; + (void) vbo_MultiTexCoord4f; + (void) vbo_MultiTexCoord4fv; + (void) vbo_Normal3f; + (void) vbo_Normal3fv; + (void) vbo_SecondaryColor3fEXT; + (void) vbo_SecondaryColor3fvEXT; + (void) vbo_TexCoord1f; + (void) vbo_TexCoord1fv; + (void) vbo_TexCoord2f; + (void) vbo_TexCoord2fv; + (void) vbo_TexCoord3f; + (void) vbo_TexCoord3fv; + (void) vbo_TexCoord4f; + (void) vbo_TexCoord4fv; + (void) vbo_Vertex2f; + (void) vbo_Vertex2fv; + (void) vbo_Vertex3f; + (void) vbo_Vertex3fv; + (void) vbo_Vertex4f; + (void) vbo_Vertex4fv; + + (void) vbo_VertexAttrib1fARB; + (void) vbo_VertexAttrib1fvARB; + (void) vbo_VertexAttrib2fARB; + (void) vbo_VertexAttrib2fvARB; + (void) vbo_VertexAttrib3fARB; + (void) vbo_VertexAttrib3fvARB; + (void) vbo_VertexAttrib4fARB; + (void) vbo_VertexAttrib4fvARB; + + (void) vbo_VertexAttrib1fNV; + (void) vbo_VertexAttrib1fvNV; + (void) vbo_VertexAttrib2fNV; + (void) vbo_VertexAttrib2fvNV; + (void) vbo_VertexAttrib3fNV; + (void) vbo_VertexAttrib3fvNV; + (void) vbo_VertexAttrib4fNV; + (void) vbo_VertexAttrib4fvNV; + + (void) vbo_Materialfv; + + (void) vbo_EdgeFlag; + (void) vbo_Indexf; + (void) vbo_Indexfv; +} + + +#endif /* FEATURE_beginend */ + + /** * Tell the VBO module to use a real OpenGL vertex buffer object to * store accumulated immediate-mode vertex data. diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c index 0c258c535e..ee148df4a1 100644 --- a/src/mesa/vbo/vbo_exec_draw.c +++ b/src/mesa/vbo/vbo_exec_draw.c @@ -35,6 +35,9 @@ #include "vbo_context.h" +#if FEATURE_beginend + + static void vbo_exec_debug_verts( struct vbo_exec_context *exec ) { @@ -411,3 +414,6 @@ vbo_exec_vtx_flush( struct vbo_exec_context *exec, GLboolean unmap ) exec->vtx.prim_count = 0; exec->vtx.vert_count = 0; } + + +#endif /* FEATURE_beginend */ -- cgit v1.2.3 From 49fbdd18ed738feaf73b7faba4d3577cd9cc3e59 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 12 Feb 2009 03:54:58 -0800 Subject: i965: Fix massive memory allocation for streaming texture usage. Once we've freed a miptree, we won't see any more state cache requests that would hit the things that pointed at it until we've let the miptree get released back into the BO cache to be reused. By leaving those surface state and binding table pointers that pointed at it around, we would end up with up to (500 * texture size) in memory uselessly consumed by the state cache. Bug #20057 Bug #23530 --- src/mesa/drivers/dri/i965/brw_state.h | 1 + src/mesa/drivers/dri/i965/brw_state_cache.c | 49 ++++++++++++++++++++++++++ src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 16 +++++++++ 3 files changed, 66 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h index 5335eac895..d639656b9d 100644 --- a/src/mesa/drivers/dri/i965/brw_state.h +++ b/src/mesa/drivers/dri/i965/brw_state.h @@ -151,6 +151,7 @@ void brw_state_cache_check_size( struct brw_context *brw ); void brw_init_caches( struct brw_context *brw ); void brw_destroy_caches( struct brw_context *brw ); +void brw_state_cache_bo_delete(struct brw_cache *cache, dri_bo *bo); /*********************************************************************** * brw_state_batch.c diff --git a/src/mesa/drivers/dri/i965/brw_state_cache.c b/src/mesa/drivers/dri/i965/brw_state_cache.c index e40d7a0416..f8e46aacf7 100644 --- a/src/mesa/drivers/dri/i965/brw_state_cache.c +++ b/src/mesa/drivers/dri/i965/brw_state_cache.c @@ -517,6 +517,55 @@ brw_clear_cache(struct brw_context *brw, struct brw_cache *cache) brw->state.dirty.cache |= ~0; } +/* Clear all entries from the cache that point to the given bo. + * + * This lets us release memory for reuse earlier for known-dead buffers, + * at the cost of walking the entire hash table. + */ +void +brw_state_cache_bo_delete(struct brw_cache *cache, dri_bo *bo) +{ + struct brw_cache_item **prev; + GLuint i; + + if (INTEL_DEBUG & DEBUG_STATE) + _mesa_printf("%s\n", __FUNCTION__); + + for (i = 0; i < cache->size; i++) { + for (prev = &cache->items[i]; *prev;) { + struct brw_cache_item *c = *prev; + int j; + + for (j = 0; j < c->nr_reloc_bufs; j++) { + if (c->reloc_bufs[j] == bo) + break; + } + + if (j != c->nr_reloc_bufs) { + + *prev = c->next; + + for (j = 0; j < c->nr_reloc_bufs; j++) + dri_bo_unreference(c->reloc_bufs[j]); + dri_bo_unreference(c->bo); + free((void *)c->key); + free(c); + cache->n_items--; + + /* Delete up the tree. Notably we're trying to get from + * a request to delete the surface, to deleting the surface state + * object, to deleting the binding table. We're slack and restart + * the deletion process when we do this because the other delete + * may kill our *prev. + */ + brw_state_cache_bo_delete(cache, c->bo); + prev = &cache->items[i]; + } else { + prev = &(*prev)->next; + } + } + } +} void brw_state_cache_check_size(struct brw_context *brw) diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c index c985da5aa2..4f5101a312 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@ -29,6 +29,9 @@ #include "intel_mipmap_tree.h" #include "intel_regions.h" #include "intel_chipset.h" +#ifndef I915 +#include "brw_state.h" +#endif #include "main/enums.h" #define FILE_DEBUG_FLAG DEBUG_MIPTREE @@ -269,6 +272,19 @@ intel_miptree_release(struct intel_context *intel, DBG("%s deleting %p\n", __FUNCTION__, *mt); +#ifndef I915 + /* Free up cached binding tables holding a reference on our buffer, to + * avoid excessive memory consumption. + * + * This isn't as aggressive as we could be, as we'd like to do + * it from any time we free the last ref on a region. But intel_region.c + * is context-agnostic. Perhaps our constant state cache should be, as + * well. + */ + brw_state_cache_bo_delete(&brw_context(&intel->ctx)->surface_cache, + (*mt)->region->buffer); +#endif + intel_region_release(&((*mt)->region)); for (i = 0; i < MAX_TEXTURE_LEVELS; i++) -- cgit v1.2.3 From 1f7c914ad0beea8a29c1a171c7cd1a12f2efe0fa Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 30 Sep 2009 20:28:45 -0600 Subject: mesa: replace gl_texture_format with gl_format Now gl_texture_image::TexFormat is a simple MESA_FORMAT_x enum. ctx->Driver.ChooseTexture format also returns a MESA_FORMAT_x. gl_texture_format will go away next. --- src/mesa/drivers/common/meta.c | 2 +- src/mesa/drivers/dri/common/texmem.c | 44 ++-- src/mesa/drivers/dri/common/texmem.h | 21 +- src/mesa/drivers/dri/i810/i810tex.c | 18 +- src/mesa/drivers/dri/i810/i810texmem.c | 2 +- src/mesa/drivers/dri/i810/i810texstate.c | 2 +- src/mesa/drivers/dri/i915/i830_texstate.c | 2 +- src/mesa/drivers/dri/i915/i830_vtbl.c | 4 +- src/mesa/drivers/dri/i915/i915_texstate.c | 6 +- src/mesa/drivers/dri/i915/i915_vtbl.c | 4 +- src/mesa/drivers/dri/i965/brw_wm.c | 2 +- src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 7 +- src/mesa/drivers/dri/intel/intel_blit.c | 4 +- src/mesa/drivers/dri/intel/intel_fbo.c | 47 ++-- src/mesa/drivers/dri/intel/intel_fbo.h | 3 +- src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 2 +- src/mesa/drivers/dri/intel/intel_span.c | 2 +- src/mesa/drivers/dri/intel/intel_tex.h | 7 +- src/mesa/drivers/dri/intel/intel_tex_format.c | 72 ++--- src/mesa/drivers/dri/intel/intel_tex_image.c | 24 +- src/mesa/drivers/dri/intel/intel_tex_subimage.c | 4 +- src/mesa/drivers/dri/intel/intel_tex_validate.c | 4 +- src/mesa/drivers/dri/mach64/mach64_tex.c | 34 +-- src/mesa/drivers/dri/mach64/mach64_texmem.c | 4 +- src/mesa/drivers/dri/mach64/mach64_texstate.c | 4 +- src/mesa/drivers/dri/mga/mga_texstate.c | 8 +- src/mesa/drivers/dri/mga/mgatex.c | 46 ++-- src/mesa/drivers/dri/mga/mgatexmem.c | 2 +- src/mesa/drivers/dri/r128/r128_tex.c | 8 +- src/mesa/drivers/dri/r128/r128_texmem.c | 4 +- src/mesa/drivers/dri/r128/r128_texstate.c | 4 +- src/mesa/drivers/dri/r200/r200_texstate.c | 8 +- src/mesa/drivers/dri/r300/r300_texstate.c | 8 +- src/mesa/drivers/dri/r600/r600_texstate.c | 4 +- src/mesa/drivers/dri/radeon/radeon_fbo.c | 31 +-- src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c | 10 +- src/mesa/drivers/dri/radeon/radeon_texstate.c | 8 +- src/mesa/drivers/dri/radeon/radeon_texture.c | 104 ++++---- src/mesa/drivers/dri/radeon/radeon_texture.h | 22 +- src/mesa/drivers/dri/savage/savagetex.c | 127 +++++---- src/mesa/drivers/dri/sis/sis_tex.c | 57 ++-- src/mesa/drivers/dri/tdfx/tdfx_tex.c | 81 +++--- src/mesa/drivers/dri/unichrome/via_tex.c | 68 ++--- src/mesa/drivers/glide/fxddtex.c | 48 ++-- src/mesa/drivers/x11/xm_dd.c | 6 +- src/mesa/main/dd.h | 4 +- src/mesa/main/debug.c | 2 +- src/mesa/main/fbobject.c | 4 +- src/mesa/main/mipmap.c | 8 +- src/mesa/main/mtypes.h | 2 +- src/mesa/main/texcompress_fxt1.c | 12 +- src/mesa/main/texcompress_s3tc.c | 24 +- src/mesa/main/texformat.c | 147 ++++++----- src/mesa/main/texformat.h | 6 +- src/mesa/main/texformat_tmp.h | 4 +- src/mesa/main/texgetimage.c | 14 +- src/mesa/main/teximage.c | 14 +- src/mesa/main/texparam.c | 2 +- src/mesa/main/texrender.c | 10 +- src/mesa/main/texstore.c | 322 +++++++++++------------ src/mesa/main/texstore.h | 2 +- src/mesa/state_tracker/st_cb_drawpixels.c | 4 +- src/mesa/state_tracker/st_cb_texture.c | 30 +-- src/mesa/state_tracker/st_format.c | 62 ++--- src/mesa/state_tracker/st_format.h | 3 +- src/mesa/state_tracker/st_gen_mipmap.c | 2 +- src/mesa/state_tracker/st_texture.c | 2 +- src/mesa/swrast/s_texfilter.c | 28 +- src/mesa/swrast/s_triangle.c | 4 +- 69 files changed, 869 insertions(+), 822 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 94cfdfe533..6b35dbb5ad 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -2407,7 +2407,7 @@ copy_tex_sub_image(GLcontext *ctx, GLuint dims, GLenum target, GLint level, texObj = _mesa_select_tex_object(ctx, texUnit, target); texImage = _mesa_select_tex_image(ctx, texObj, target, level); - format = _mesa_get_format_base_format(texImage->TexFormat->MesaFormat); + format = _mesa_get_format_base_format(texImage->TexFormat); type = get_temp_image_type(ctx, format); bpp = _mesa_bytes_per_pixel(format, type); if (bpp <= 0) { diff --git a/src/mesa/drivers/dri/common/texmem.c b/src/mesa/drivers/dri/common/texmem.c index b64618a03c..c9c3324ed9 100644 --- a/src/mesa/drivers/dri/common/texmem.c +++ b/src/mesa/drivers/dri/common/texmem.c @@ -1306,16 +1306,16 @@ driCalculateTextureFirstLastLevel( driTextureObject * t ) * little-endian Mesa formats. */ /*@{*/ -const struct gl_texture_format *_dri_texformat_rgba8888 = NULL; -const struct gl_texture_format *_dri_texformat_argb8888 = NULL; -const struct gl_texture_format *_dri_texformat_rgb565 = NULL; -const struct gl_texture_format *_dri_texformat_argb4444 = NULL; -const struct gl_texture_format *_dri_texformat_argb1555 = NULL; -const struct gl_texture_format *_dri_texformat_al88 = NULL; -const struct gl_texture_format *_dri_texformat_a8 = &_mesa_texformat_a8; -const struct gl_texture_format *_dri_texformat_ci8 = &_mesa_texformat_ci8; -const struct gl_texture_format *_dri_texformat_i8 = &_mesa_texformat_i8; -const struct gl_texture_format *_dri_texformat_l8 = &_mesa_texformat_l8; +gl_format _dri_texformat_rgba8888 = MESA_FORMAT_NONE; +gl_format _dri_texformat_argb8888 = MESA_FORMAT_NONE; +gl_format _dri_texformat_rgb565 = MESA_FORMAT_NONE; +gl_format _dri_texformat_argb4444 = MESA_FORMAT_NONE; +gl_format _dri_texformat_argb1555 = MESA_FORMAT_NONE; +gl_format _dri_texformat_al88 = MESA_FORMAT_NONE; +gl_format _dri_texformat_a8 = MESA_FORMAT_NONE; +gl_format _dri_texformat_ci8 = MESA_FORMAT_NONE; +gl_format _dri_texformat_i8 = MESA_FORMAT_NONE; +gl_format _dri_texformat_l8 = MESA_FORMAT_NONE; /*@}*/ @@ -1329,19 +1329,19 @@ driInitTextureFormats(void) const GLubyte littleEndian = *((const GLubyte *) &ui); if (littleEndian) { - _dri_texformat_rgba8888 = &_mesa_texformat_rgba8888; - _dri_texformat_argb8888 = &_mesa_texformat_argb8888; - _dri_texformat_rgb565 = &_mesa_texformat_rgb565; - _dri_texformat_argb4444 = &_mesa_texformat_argb4444; - _dri_texformat_argb1555 = &_mesa_texformat_argb1555; - _dri_texformat_al88 = &_mesa_texformat_al88; + _dri_texformat_rgba8888 = MESA_FORMAT_RGBA8888; + _dri_texformat_argb8888 = MESA_FORMAT_ARGB8888; + _dri_texformat_rgb565 = MESA_FORMAT_RGB565; + _dri_texformat_argb4444 = MESA_FORMAT_ARGB4444; + _dri_texformat_argb1555 = MESA_FORMAT_ARGB1555; + _dri_texformat_al88 = MESA_FORMAT_AL88; } else { - _dri_texformat_rgba8888 = &_mesa_texformat_rgba8888_rev; - _dri_texformat_argb8888 = &_mesa_texformat_argb8888_rev; - _dri_texformat_rgb565 = &_mesa_texformat_rgb565_rev; - _dri_texformat_argb4444 = &_mesa_texformat_argb4444_rev; - _dri_texformat_argb1555 = &_mesa_texformat_argb1555_rev; - _dri_texformat_al88 = &_mesa_texformat_al88_rev; + _dri_texformat_rgba8888 = MESA_FORMAT_RGBA8888_REV; + _dri_texformat_argb8888 = MESA_FORMAT_ARGB8888_REV; + _dri_texformat_rgb565 = MESA_FORMAT_RGB565_REV; + _dri_texformat_argb4444 = MESA_FORMAT_ARGB4444_REV; + _dri_texformat_argb1555 = MESA_FORMAT_ARGB1555_REV; + _dri_texformat_al88 = MESA_FORMAT_AL88_REV; } } diff --git a/src/mesa/drivers/dri/common/texmem.h b/src/mesa/drivers/dri/common/texmem.h index 9c065da8b4..725ba2e119 100644 --- a/src/mesa/drivers/dri/common/texmem.h +++ b/src/mesa/drivers/dri/common/texmem.h @@ -39,6 +39,7 @@ #define DRI_TEXMEM_H #include "main/mtypes.h" +#include "main/formats.h" #include "main/mm.h" #include "xf86drm.h" @@ -317,16 +318,16 @@ GLboolean driValidateTextureHeaps( driTexHeap * const * texture_heaps, extern void driCalculateTextureFirstLastLevel( driTextureObject * t ); -extern const struct gl_texture_format *_dri_texformat_rgba8888; -extern const struct gl_texture_format *_dri_texformat_argb8888; -extern const struct gl_texture_format *_dri_texformat_rgb565; -extern const struct gl_texture_format *_dri_texformat_argb4444; -extern const struct gl_texture_format *_dri_texformat_argb1555; -extern const struct gl_texture_format *_dri_texformat_al88; -extern const struct gl_texture_format *_dri_texformat_a8; -extern const struct gl_texture_format *_dri_texformat_ci8; -extern const struct gl_texture_format *_dri_texformat_i8; -extern const struct gl_texture_format *_dri_texformat_l8; +extern gl_format _dri_texformat_rgba8888; +extern gl_format _dri_texformat_argb8888; +extern gl_format _dri_texformat_rgb565; +extern gl_format _dri_texformat_argb4444; +extern gl_format _dri_texformat_argb1555; +extern gl_format _dri_texformat_al88; +extern gl_format _dri_texformat_a8; +extern gl_format _dri_texformat_ci8; +extern gl_format _dri_texformat_i8; +extern gl_format _dri_texformat_l8; extern void driInitTextureFormats( void ); diff --git a/src/mesa/drivers/dri/i810/i810tex.c b/src/mesa/drivers/dri/i810/i810tex.c index cd6e1a8e6e..8166393eb1 100644 --- a/src/mesa/drivers/dri/i810/i810tex.c +++ b/src/mesa/drivers/dri/i810/i810tex.c @@ -440,7 +440,7 @@ static void i810DeleteTexture( GLcontext *ctx, struct gl_texture_object *tObj ) * The i810 only supports 5 texture modes that are useful to Mesa. That * makes this routine pretty simple. */ -static const struct gl_texture_format * +static gl_format i810ChooseTextureFormat( GLcontext *ctx, GLint internalFormat, GLenum format, GLenum type ) { @@ -458,9 +458,9 @@ i810ChooseTextureFormat( GLcontext *ctx, GLint internalFormat, if ( ((format == GL_BGRA) && (type == GL_UNSIGNED_SHORT_1_5_5_5_REV)) || ((format == GL_RGBA) && (type == GL_UNSIGNED_SHORT_5_5_5_1)) || (internalFormat == GL_RGB5_A1) ) { - return &_mesa_texformat_argb1555; + return MESA_FORMAT_ARGB1555; } - return &_mesa_texformat_argb4444; + return MESA_FORMAT_ARGB4444; case 3: case GL_RGB: @@ -472,7 +472,7 @@ i810ChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_RGB10: case GL_RGB12: case GL_RGB16: - return &_mesa_texformat_rgb565; + return MESA_FORMAT_RGB565; case GL_ALPHA: case GL_ALPHA4: @@ -502,21 +502,21 @@ i810ChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_INTENSITY12: case GL_INTENSITY16: case GL_COMPRESSED_INTENSITY: - return &_mesa_texformat_al88; + return MESA_FORMAT_AL88; case GL_YCBCR_MESA: if (type == GL_UNSIGNED_SHORT_8_8_MESA || type == GL_UNSIGNED_BYTE) - return &_mesa_texformat_ycbcr; + return MESA_FORMAT_YCBCR; else - return &_mesa_texformat_ycbcr_rev; + return MESA_FORMAT_YCBCR_REV; default: fprintf(stderr, "unexpected texture format in %s\n", __FUNCTION__); - return NULL; + return MESA_FORMAT_NONE; } - return NULL; /* never get here */ + return MESA_FORMAT_NONE; /* never get here */ } /** diff --git a/src/mesa/drivers/dri/i810/i810texmem.c b/src/mesa/drivers/dri/i810/i810texmem.c index 8cbe38f5fc..c2a5d95fc7 100644 --- a/src/mesa/drivers/dri/i810/i810texmem.c +++ b/src/mesa/drivers/dri/i810/i810texmem.c @@ -97,7 +97,7 @@ static void i810UploadTexLevel( i810ContextPtr imesa, if (!image || !image->Data) return; - texelBytes = _mesa_get_format_bytes(image->TexFormat->MesaFormat); + texelBytes = _mesa_get_format_bytes(image->TexFormat); if (image->Width * texelBytes == t->Pitch) { GLubyte *dst = (GLubyte *)(t->BufAddr + t->image[hwlevel].offset); diff --git a/src/mesa/drivers/dri/i810/i810texstate.c b/src/mesa/drivers/dri/i810/i810texstate.c index 0e09f54c41..b873ddbecb 100644 --- a/src/mesa/drivers/dri/i810/i810texstate.c +++ b/src/mesa/drivers/dri/i810/i810texstate.c @@ -53,7 +53,7 @@ static void i810SetTexImages( i810ContextPtr imesa, /* fprintf(stderr, "%s\n", __FUNCTION__); */ t->texelBytes = 2; - switch (baseImage->TexFormat->MesaFormat) { + switch (baseImage->TexFormat) { case MESA_FORMAT_ARGB1555: textureFormat = MI1_FMT_16BPP | MI1_PF_16BPP_ARGB1555; break; diff --git a/src/mesa/drivers/dri/i915/i830_texstate.c b/src/mesa/drivers/dri/i915/i830_texstate.c index 6f998fa6f7..837ae57074 100644 --- a/src/mesa/drivers/dri/i915/i830_texstate.c +++ b/src/mesa/drivers/dri/i915/i830_texstate.c @@ -166,7 +166,7 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) 0, intelObj-> firstLevel); - format = translate_texture_format(firstImage->TexFormat->MesaFormat, + format = translate_texture_format(firstImage->TexFormat, firstImage->InternalFormat); pitch = intelObj->mt->pitch * intelObj->mt->cpp; } diff --git a/src/mesa/drivers/dri/i915/i830_vtbl.c b/src/mesa/drivers/dri/i915/i830_vtbl.c index 983f6724c9..d53900b329 100644 --- a/src/mesa/drivers/dri/i915/i830_vtbl.c +++ b/src/mesa/drivers/dri/i915/i830_vtbl.c @@ -646,7 +646,7 @@ i830_state_draw_region(struct intel_context *intel, DSTORG_VERT_BIAS(0x8) | DEPTH_IS_Z); /* .5 */ if (irb != NULL) { - switch (irb->texformat->MesaFormat) { + switch (irb->texformat) { case MESA_FORMAT_ARGB8888: value |= DV_PF_8888; break; @@ -661,7 +661,7 @@ i830_state_draw_region(struct intel_context *intel, break; default: _mesa_problem(ctx, "Bad renderbuffer format: %d\n", - irb->texformat->MesaFormat); + irb->texformat); } } diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index 32d4b30cf9..d6f6cfdb49 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -177,7 +177,7 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) 0, intelObj-> firstLevel); - format = translate_texture_format(firstImage->TexFormat->MesaFormat, + format = translate_texture_format(firstImage->TexFormat, firstImage->InternalFormat, tObj->DepthMode); pitch = intelObj->mt->pitch * intelObj->mt->cpp; @@ -263,8 +263,8 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) /* YUV conversion: */ - if (firstImage->TexFormat->MesaFormat == MESA_FORMAT_YCBCR || - firstImage->TexFormat->MesaFormat == MESA_FORMAT_YCBCR_REV) + if (firstImage->TexFormat == MESA_FORMAT_YCBCR || + firstImage->TexFormat == MESA_FORMAT_YCBCR_REV) state[I915_TEXREG_SS2] |= SS2_COLORSPACE_CONVERSION; /* Shadow: diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c b/src/mesa/drivers/dri/i915/i915_vtbl.c index 9a723d3cd7..1c3da63da9 100644 --- a/src/mesa/drivers/dri/i915/i915_vtbl.c +++ b/src/mesa/drivers/dri/i915/i915_vtbl.c @@ -589,7 +589,7 @@ i915_state_draw_region(struct intel_context *intel, DSTORG_VERT_BIAS(0x8) | /* .5 */ LOD_PRECLAMP_OGL | TEX_DEFAULT_COLOR_OGL); if (irb != NULL) { - switch (irb->texformat->MesaFormat) { + switch (irb->texformat) { case MESA_FORMAT_ARGB8888: value |= DV_PF_8888; break; @@ -604,7 +604,7 @@ i915_state_draw_region(struct intel_context *intel, break; default: _mesa_problem(ctx, "Bad renderbuffer format: %d\n", - irb->texformat->MesaFormat); + irb->texformat); } } diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index 2292de94c4..46df778bee 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -288,7 +288,7 @@ static void brw_wm_populate_key( struct brw_context *brw, const struct gl_texture_image *img = t->Image[0][t->BaseLevel]; if (img->InternalFormat == GL_YCBCR_MESA) { key->yuvtex_mask |= 1 << i; - if (img->TexFormat->MesaFormat == MESA_FORMAT_YCBCR) + if (img->TexFormat == MESA_FORMAT_YCBCR) key->yuvtex_swap_mask |= 1 << i; } diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index 51539ac1e7..855fe7593d 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -287,7 +287,7 @@ brw_update_texture_surface( GLcontext *ctx, GLuint unit ) key.bo = NULL; key.offset = intelObj->textureOffset; } else { - key.format = firstImage->TexFormat->MesaFormat; + key.format = firstImage->TexFormat; key.internal_format = firstImage->InternalFormat; key.pitch = intelObj->mt->pitch; key.depth = firstImage->Depth; @@ -527,7 +527,7 @@ brw_update_renderbuffer_surface(struct brw_context *brw, region_bo = region->buffer; key.surface_type = BRW_SURFACE_2D; - switch (irb->texformat->MesaFormat) { + switch (irb->texformat) { case MESA_FORMAT_ARGB8888: key.surface_format = BRW_SURFACEFORMAT_B8G8R8A8_UNORM; break; @@ -541,8 +541,7 @@ brw_update_renderbuffer_surface(struct brw_context *brw, key.surface_format = BRW_SURFACEFORMAT_B4G4R4A4_UNORM; break; default: - _mesa_problem(ctx, "Bad renderbuffer format: %d\n", - irb->texformat->MesaFormat); + _mesa_problem(ctx, "Bad renderbuffer format: %d\n", irb->texformat); } key.tiling = region->tiling; if (brw->intel.intelScreen->driScrnPriv->dri2.enabled) { diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c index 43141c509c..799b22cc90 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.c +++ b/src/mesa/drivers/dri/intel/intel_blit.c @@ -496,7 +496,7 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask) CLAMPED_FLOAT_TO_UBYTE(clear[2], color[2]); CLAMPED_FLOAT_TO_UBYTE(clear[3], color[3]); - switch (irb->texformat->MesaFormat) { + switch (irb->texformat) { case MESA_FORMAT_ARGB8888: clearVal = intel->ClearColor8888; break; @@ -513,7 +513,7 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask) break; default: _mesa_problem(ctx, "Unexpected renderbuffer format: %d\n", - irb->texformat->MesaFormat); + irb->texformat); clearVal = 0; } } diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 0a3d0654d7..1be381b9ea 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -120,7 +120,7 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, rb->RedBits = 5; rb->GreenBits = 6; rb->BlueBits = 5; - irb->texformat = &_mesa_texformat_rgb565; + irb->texformat = MESA_FORMAT_RGB565; cpp = 2; break; case GL_RGB: @@ -134,7 +134,7 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, rb->GreenBits = 8; rb->BlueBits = 8; rb->AlphaBits = 0; - irb->texformat = &_mesa_texformat_argb8888; /* XXX: Need xrgb8888 */ + irb->texformat = MESA_FORMAT_ARGB8888; /* XXX: Need xrgb8888 */ cpp = 4; break; case GL_RGBA: @@ -151,7 +151,7 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, rb->GreenBits = 8; rb->BlueBits = 8; rb->AlphaBits = 8; - irb->texformat = &_mesa_texformat_argb8888; + irb->texformat = MESA_FORMAT_ARGB8888; cpp = 4; break; case GL_STENCIL_INDEX: @@ -164,14 +164,14 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, rb->DataType = GL_UNSIGNED_INT_24_8_EXT; rb->StencilBits = 8; cpp = 4; - irb->texformat = &_mesa_texformat_s8_z24; + irb->texformat = MESA_FORMAT_S8_Z24; break; case GL_DEPTH_COMPONENT16: rb->_ActualFormat = GL_DEPTH_COMPONENT16; rb->DataType = GL_UNSIGNED_SHORT; rb->DepthBits = 16; cpp = 2; - irb->texformat = &_mesa_texformat_z16; + irb->texformat = MESA_FORMAT_Z16; break; case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT24: @@ -180,7 +180,7 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, rb->DataType = GL_UNSIGNED_INT_24_8_EXT; rb->DepthBits = 24; cpp = 4; - irb->texformat = &_mesa_texformat_s8_z24; + irb->texformat = MESA_FORMAT_S8_Z24; break; case GL_DEPTH_STENCIL_EXT: case GL_DEPTH24_STENCIL8_EXT: @@ -189,7 +189,7 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, rb->DepthBits = 24; rb->StencilBits = 8; cpp = 4; - irb->texformat = &_mesa_texformat_s8_z24; + irb->texformat = MESA_FORMAT_S8_Z24; break; default: _mesa_problem(ctx, @@ -331,7 +331,7 @@ intel_create_renderbuffer(GLenum intFormat) irb->Base.GreenBits = 6; irb->Base.BlueBits = 5; irb->Base.DataType = GL_UNSIGNED_BYTE; - irb->texformat = &_mesa_texformat_rgb565; + irb->texformat = MESA_FORMAT_RGB565; break; case GL_RGB8: irb->Base._ActualFormat = GL_RGB8; @@ -341,7 +341,7 @@ intel_create_renderbuffer(GLenum intFormat) irb->Base.BlueBits = 8; irb->Base.AlphaBits = 0; irb->Base.DataType = GL_UNSIGNED_BYTE; - irb->texformat = &_mesa_texformat_argb8888; /* XXX: Need xrgb8888 */ + irb->texformat = MESA_FORMAT_ARGB8888; /* XXX: NEED XRGB8888 */ break; case GL_RGBA8: irb->Base._ActualFormat = GL_RGBA8; @@ -351,28 +351,28 @@ intel_create_renderbuffer(GLenum intFormat) irb->Base.BlueBits = 8; irb->Base.AlphaBits = 8; irb->Base.DataType = GL_UNSIGNED_BYTE; - irb->texformat = &_mesa_texformat_argb8888; + irb->texformat = MESA_FORMAT_ARGB8888; break; case GL_STENCIL_INDEX8_EXT: irb->Base._ActualFormat = GL_STENCIL_INDEX8_EXT; irb->Base._BaseFormat = GL_STENCIL_INDEX; irb->Base.StencilBits = 8; irb->Base.DataType = GL_UNSIGNED_BYTE; - irb->texformat = &_mesa_texformat_s8_z24; + irb->texformat = MESA_FORMAT_S8_Z24; break; case GL_DEPTH_COMPONENT16: irb->Base._ActualFormat = GL_DEPTH_COMPONENT16; irb->Base._BaseFormat = GL_DEPTH_COMPONENT; irb->Base.DepthBits = 16; irb->Base.DataType = GL_UNSIGNED_SHORT; - irb->texformat = &_mesa_texformat_z16; + irb->texformat = MESA_FORMAT_Z16; break; case GL_DEPTH_COMPONENT24: irb->Base._ActualFormat = GL_DEPTH24_STENCIL8_EXT; irb->Base._BaseFormat = GL_DEPTH_COMPONENT; irb->Base.DepthBits = 24; irb->Base.DataType = GL_UNSIGNED_INT; - irb->texformat = &_mesa_texformat_s8_z24; + irb->texformat = MESA_FORMAT_S8_Z24; break; case GL_DEPTH24_STENCIL8_EXT: irb->Base._ActualFormat = GL_DEPTH24_STENCIL8_EXT; @@ -380,7 +380,7 @@ intel_create_renderbuffer(GLenum intFormat) irb->Base.DepthBits = 24; irb->Base.StencilBits = 8; irb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT; - irb->texformat = &_mesa_texformat_s8_z24; + irb->texformat = MESA_FORMAT_S8_Z24; break; default: _mesa_problem(NULL, @@ -468,49 +468,48 @@ intel_update_wrapper(GLcontext *ctx, struct intel_renderbuffer *irb, irb->texformat = texImage->TexFormat; gl_format texFormat; - if (texImage->TexFormat == &_mesa_texformat_argb8888) { + if (texImage->TexFormat == MESA_FORMAT_ARGB8888) { irb->Base._ActualFormat = GL_RGBA8; irb->Base._BaseFormat = GL_RGBA; irb->Base.DataType = GL_UNSIGNED_BYTE; DBG("Render to RGBA8 texture OK\n"); } - else if (texImage->TexFormat == &_mesa_texformat_rgb565) { + else if (texImage->TexFormat == MESA_FORMAT_RGB565) { irb->Base._ActualFormat = GL_RGB5; irb->Base._BaseFormat = GL_RGB; irb->Base.DataType = GL_UNSIGNED_BYTE; DBG("Render to RGB5 texture OK\n"); } - else if (texImage->TexFormat == &_mesa_texformat_argb1555) { + else if (texImage->TexFormat == MESA_FORMAT_ARGB1555) { irb->Base._ActualFormat = GL_RGB5_A1; irb->Base._BaseFormat = GL_RGBA; irb->Base.DataType = GL_UNSIGNED_BYTE; DBG("Render to ARGB1555 texture OK\n"); } - else if (texImage->TexFormat == &_mesa_texformat_argb4444) { + else if (texImage->TexFormat == MESA_FORMAT_ARGB4444) { irb->Base._ActualFormat = GL_RGBA4; irb->Base._BaseFormat = GL_RGBA; irb->Base.DataType = GL_UNSIGNED_BYTE; DBG("Render to ARGB4444 texture OK\n"); } - else if (texImage->TexFormat == &_mesa_texformat_z16) { + else if (texImage->TexFormat == MESA_FORMAT_Z16) { irb->Base._ActualFormat = GL_DEPTH_COMPONENT16; irb->Base._BaseFormat = GL_DEPTH_COMPONENT; irb->Base.DataType = GL_UNSIGNED_SHORT; DBG("Render to DEPTH16 texture OK\n"); } - else if (texImage->TexFormat == &_mesa_texformat_s8_z24) { + else if (texImage->TexFormat == MESA_FORMAT_S8_Z24) { irb->Base._ActualFormat = GL_DEPTH24_STENCIL8_EXT; irb->Base._BaseFormat = GL_DEPTH_STENCIL_EXT; irb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT; DBG("Render to DEPTH_STENCIL texture OK\n"); } else { - DBG("Render to texture BAD FORMAT %d\n", - texImage->TexFormat->MesaFormat); + DBG("Render to texture BAD FORMAT %d\n", texImage->TexFormat); return GL_FALSE; } - texFormat = texImage->TexFormat->MesaFormat; + texFormat = texImage->TexFormat; irb->Base.InternalFormat = irb->Base._ActualFormat; irb->Base.Width = texImage->Width; @@ -690,7 +689,7 @@ intel_validate_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb) continue; } - switch (irb->texformat->MesaFormat) { + switch (irb->texformat) { case MESA_FORMAT_ARGB8888: case MESA_FORMAT_RGB565: case MESA_FORMAT_ARGB1555: diff --git a/src/mesa/drivers/dri/intel/intel_fbo.h b/src/mesa/drivers/dri/intel/intel_fbo.h index f0665af482..e0584e3494 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.h +++ b/src/mesa/drivers/dri/intel/intel_fbo.h @@ -28,6 +28,7 @@ #ifndef INTEL_FBO_H #define INTEL_FBO_H +#include "main/formats.h" #include "intel_screen.h" struct intel_context; @@ -61,7 +62,7 @@ struct intel_renderbuffer struct gl_renderbuffer Base; struct intel_region *region; - const struct gl_texture_format *texformat; + gl_format texformat; GLuint vbl_pending; /**< vblank sequence number of pending flip */ diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c index 188333c75f..6bb7481ae4 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@ -307,7 +307,7 @@ intel_miptree_match_image(struct intel_mipmap_tree *mt, if (!image->IsCompressed && !mt->compressed && - _mesa_get_format_bytes(image->TexFormat->MesaFormat) != mt->cpp) + _mesa_get_format_bytes(image->TexFormat) != mt->cpp) return GL_FALSE; /* Test image dimensions against the base level image adjusted for diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index 28eabbc005..f754ce0cd1 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -578,7 +578,7 @@ intel_set_span_functions(struct intel_context *intel, else tiling = I915_TILING_NONE; - switch (irb->texformat->MesaFormat) { + switch (irb->texformat) { case MESA_FORMAT_RGB565: switch (tiling) { case I915_TILING_NONE: diff --git a/src/mesa/drivers/dri/intel/intel_tex.h b/src/mesa/drivers/dri/intel/intel_tex.h index 471aa2a240..f67e1db9e3 100644 --- a/src/mesa/drivers/dri/intel/intel_tex.h +++ b/src/mesa/drivers/dri/intel/intel_tex.h @@ -29,6 +29,7 @@ #define INTELTEX_INC #include "main/mtypes.h" +#include "main/formats.h" #include "intel_context.h" #include "texmem.h" @@ -41,10 +42,8 @@ void intelInitTextureSubImageFuncs(struct dd_function_table *functions); void intelInitTextureCopyImageFuncs(struct dd_function_table *functions); -const struct gl_texture_format *intelChooseTextureFormat(GLcontext * ctx, - GLint internalFormat, - GLenum format, - GLenum type); +gl_format intelChooseTextureFormat(GLcontext *ctx, GLint internalFormat, + GLenum format, GLenum type); void intelSetTexOffset(__DRIcontext *pDRICtx, GLint texname, unsigned long long offset, GLint depth, GLuint pitch); diff --git a/src/mesa/drivers/dri/intel/intel_tex_format.c b/src/mesa/drivers/dri/intel/intel_tex_format.c index 3322a71130..22c010bbd7 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_format.c +++ b/src/mesa/drivers/dri/intel/intel_tex_format.c @@ -16,7 +16,7 @@ * these if we take the step of simply swizzling the colors * immediately after sampling... */ -const struct gl_texture_format * +gl_format intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat, GLenum format, GLenum type) { @@ -34,48 +34,48 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat, case GL_COMPRESSED_RGBA: if (format == GL_BGRA) { if (type == GL_UNSIGNED_BYTE || type == GL_UNSIGNED_INT_8_8_8_8_REV) { - return &_mesa_texformat_argb8888; + return MESA_FORMAT_ARGB8888; } else if (type == GL_UNSIGNED_SHORT_4_4_4_4_REV) { - return &_mesa_texformat_argb4444; + return MESA_FORMAT_ARGB4444; } else if (type == GL_UNSIGNED_SHORT_1_5_5_5_REV) { - return &_mesa_texformat_argb1555; + return MESA_FORMAT_ARGB1555; } } - return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444; + return do32bpt ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_ARGB4444; case 3: case GL_RGB: case GL_COMPRESSED_RGB: if (format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5) { - return &_mesa_texformat_rgb565; + return MESA_FORMAT_RGB565; } - return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_rgb565; + return do32bpt ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_RGB565; case GL_RGBA8: case GL_RGB10_A2: case GL_RGBA12: case GL_RGBA16: - return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444; + return do32bpt ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_ARGB4444; case GL_RGBA4: case GL_RGBA2: - return &_mesa_texformat_argb4444; + return MESA_FORMAT_ARGB4444; case GL_RGB5_A1: - return &_mesa_texformat_argb1555; + return MESA_FORMAT_ARGB1555; case GL_RGB8: case GL_RGB10: case GL_RGB12: case GL_RGB16: - return &_mesa_texformat_argb8888; + return MESA_FORMAT_ARGB8888; case GL_RGB5: case GL_RGB4: case GL_R3_G3_B2: - return &_mesa_texformat_rgb565; + return MESA_FORMAT_RGB565; case GL_ALPHA: case GL_ALPHA4: @@ -83,7 +83,7 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat, case GL_ALPHA12: case GL_ALPHA16: case GL_COMPRESSED_ALPHA: - return &_mesa_texformat_a8; + return MESA_FORMAT_A8; case 1: case GL_LUMINANCE: @@ -92,7 +92,7 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat, case GL_LUMINANCE12: case GL_LUMINANCE16: case GL_COMPRESSED_LUMINANCE: - return &_mesa_texformat_l8; + return MESA_FORMAT_L8; case 2: case GL_LUMINANCE_ALPHA: @@ -103,7 +103,7 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat, case GL_LUMINANCE12_ALPHA12: case GL_LUMINANCE16_ALPHA16: case GL_COMPRESSED_LUMINANCE_ALPHA: - return &_mesa_texformat_al88; + return MESA_FORMAT_AL88; case GL_INTENSITY: case GL_INTENSITY4: @@ -111,41 +111,41 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat, case GL_INTENSITY12: case GL_INTENSITY16: case GL_COMPRESSED_INTENSITY: - return &_mesa_texformat_i8; + return MESA_FORMAT_I8; case GL_YCBCR_MESA: if (type == GL_UNSIGNED_SHORT_8_8_MESA || type == GL_UNSIGNED_BYTE) - return &_mesa_texformat_ycbcr; + return MESA_FORMAT_YCBCR; else - return &_mesa_texformat_ycbcr_rev; + return MESA_FORMAT_YCBCR_REV; case GL_COMPRESSED_RGB_FXT1_3DFX: - return &_mesa_texformat_rgb_fxt1; + return MESA_FORMAT_RGB_FXT1; case GL_COMPRESSED_RGBA_FXT1_3DFX: - return &_mesa_texformat_rgba_fxt1; + return MESA_FORMAT_RGBA_FXT1; case GL_RGB_S3TC: case GL_RGB4_S3TC: case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: - return &_mesa_texformat_rgb_dxt1; + return MESA_FORMAT_RGB_DXT1; case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: - return &_mesa_texformat_rgba_dxt1; + return MESA_FORMAT_RGBA_DXT1; case GL_RGBA_S3TC: case GL_RGBA4_S3TC: case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: - return &_mesa_texformat_rgba_dxt3; + return MESA_FORMAT_RGBA_DXT3; case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: - return &_mesa_texformat_rgba_dxt5; + return MESA_FORMAT_RGBA_DXT5; case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT16: case GL_DEPTH_COMPONENT24: case GL_DEPTH_COMPONENT32: #if 0 - return &_mesa_texformat_z16; + return MESA_FORMAT_Z16; #else /* fall-through. * 16bpp depth texture can't be paired with a stencil buffer so @@ -154,7 +154,7 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat, #endif case GL_DEPTH_STENCIL_EXT: case GL_DEPTH24_STENCIL8_EXT: - return &_mesa_texformat_s8_z24; + return MESA_FORMAT_S8_Z24; #ifndef I915 case GL_SRGB_EXT: @@ -165,41 +165,41 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat, case GL_COMPRESSED_SRGB_ALPHA_EXT: case GL_COMPRESSED_SLUMINANCE_EXT: case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT: - return &_mesa_texformat_sargb8; + return MESA_FORMAT_SARGB8; case GL_SLUMINANCE_EXT: case GL_SLUMINANCE8_EXT: if (IS_G4X(intel->intelScreen->deviceID)) - return &_mesa_texformat_sl8; + return MESA_FORMAT_SL8; else - return &_mesa_texformat_sargb8; + return MESA_FORMAT_SARGB8; case GL_SLUMINANCE_ALPHA_EXT: case GL_SLUMINANCE8_ALPHA8_EXT: if (IS_G4X(intel->intelScreen->deviceID)) - return &_mesa_texformat_sla8; + return MESA_FORMAT_SLA8; else - return &_mesa_texformat_sargb8; + return MESA_FORMAT_SARGB8; case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: - return &_mesa_texformat_srgb_dxt1; + return MESA_FORMAT_SRGB_DXT1; /* i915 could also do this */ case GL_DUDV_ATI: case GL_DU8DV8_ATI: - return &_mesa_texformat_dudv8; + return MESA_FORMAT_DUDV8; case GL_RGBA_SNORM: case GL_RGBA8_SNORM: - return &_mesa_texformat_signed_rgba8888_rev; + return MESA_FORMAT_SIGNED_RGBA8888_REV; #endif default: fprintf(stderr, "unexpected texture format %s in %s\n", _mesa_lookup_enum_by_nr(internalFormat), __FUNCTION__); - return NULL; + return MESA_FORMAT_NONE; } - return NULL; /* never get here */ + return MESA_FORMAT_NONE; /* never get here */ } int intel_compressed_num_bytes(GLuint mesaFormat) diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index 0e13f600a6..bbbeac8f7f 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -126,9 +126,9 @@ guess_and_alloc_mipmap_tree(struct intel_context *intel, assert(!intelObj->mt); if (intelImage->base.IsCompressed) - comp_byte = intel_compressed_num_bytes(intelImage->base.TexFormat->MesaFormat); + comp_byte = intel_compressed_num_bytes(intelImage->base.TexFormat); - texelBytes = _mesa_get_format_bytes(intelImage->base.TexFormat->MesaFormat); + texelBytes = _mesa_get_format_bytes(intelImage->base.TexFormat); intelObj->mt = intel_miptree_create(intel, intelObj->base.Target, @@ -171,7 +171,7 @@ target_to_face(GLenum target) static GLboolean check_pbo_format(GLint internalFormat, GLenum format, GLenum type, - const struct gl_texture_format *mesa_format) + gl_format mesa_format) { switch (internalFormat) { case 4: @@ -179,12 +179,12 @@ check_pbo_format(GLint internalFormat, return (format == GL_BGRA && (type == GL_UNSIGNED_BYTE || type == GL_UNSIGNED_INT_8_8_8_8_REV) && - mesa_format == &_mesa_texformat_argb8888); + mesa_format == MESA_FORMAT_ARGB8888); case 3: case GL_RGB: return (format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5 && - mesa_format == &_mesa_texformat_rgb565); + mesa_format == MESA_FORMAT_RGB565); case GL_YCBCR_MESA: return (type == GL_UNSIGNED_SHORT_8_8_MESA || type == GL_UNSIGNED_BYTE); default: @@ -337,15 +337,15 @@ intelTexImage(GLcontext * ctx, _mesa_set_fetch_functions(texImage, dims); - if (_mesa_is_format_compressed(texImage->TexFormat->MesaFormat)) { + if (_mesa_is_format_compressed(texImage->TexFormat)) { texelBytes = 0; texImage->IsCompressed = GL_TRUE; texImage->CompressedSize = ctx->Driver.CompressedTextureSize(ctx, texImage->Width, texImage->Height, texImage->Depth, - texImage->TexFormat->MesaFormat); + texImage->TexFormat); } else { - texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); + texelBytes = _mesa_get_format_bytes(texImage->TexFormat); /* Minimum pitch of 32 bytes */ if (postConvWidth * texelBytes < 32) { @@ -403,11 +403,11 @@ intelTexImage(GLcontext * ctx, assert(intelImage->mt); } else if (intelImage->base.Border == 0) { int comp_byte = 0; - GLuint texelBytes = _mesa_get_format_bytes(intelImage->base.TexFormat->MesaFormat); - GLenum baseFormat = _mesa_get_format_base_format(intelImage->base.TexFormat->MesaFormat); + GLuint texelBytes = _mesa_get_format_bytes(intelImage->base.TexFormat); + GLenum baseFormat = _mesa_get_format_base_format(intelImage->base.TexFormat); if (intelImage->base.IsCompressed) { comp_byte = - intel_compressed_num_bytes(intelImage->base.TexFormat->MesaFormat); + intel_compressed_num_bytes(intelImage->base.TexFormat); } /* Didn't fit in the object miptree, but it's suitable for inclusion in @@ -497,7 +497,7 @@ intelTexImage(GLcontext * ctx, if (texImage->IsCompressed) { sizeInBytes = texImage->CompressedSize; dstRowStride = - _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, width); + _mesa_compressed_row_stride(texImage->TexFormat, width); assert(dims != 3); } else { diff --git a/src/mesa/drivers/dri/intel/intel_tex_subimage.c b/src/mesa/drivers/dri/intel/intel_tex_subimage.c index ad5c2271a1..bba1b53009 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_subimage.c +++ b/src/mesa/drivers/dri/intel/intel_tex_subimage.c @@ -87,11 +87,11 @@ intelTexSubimage(GLcontext * ctx, else { if (texImage->IsCompressed) { dstRowStride = - _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, width); + _mesa_compressed_row_stride(texImage->TexFormat, width); assert(dims != 3); } else { - dstRowStride = texImage->RowStride * _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); + dstRowStride = texImage->RowStride * _mesa_get_format_bytes(texImage->TexFormat); } } diff --git a/src/mesa/drivers/dri/intel/intel_tex_validate.c b/src/mesa/drivers/dri/intel/intel_tex_validate.c index 0393d7915a..0296c92523 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_validate.c +++ b/src/mesa/drivers/dri/intel/intel_tex_validate.c @@ -166,11 +166,11 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit) } if (firstImage->base.IsCompressed) { - comp_byte = intel_compressed_num_bytes(firstImage->base.TexFormat->MesaFormat); + comp_byte = intel_compressed_num_bytes(firstImage->base.TexFormat); cpp = comp_byte; } else - cpp = _mesa_get_format_bytes(firstImage->base.TexFormat->MesaFormat); + cpp = _mesa_get_format_bytes(firstImage->base.TexFormat); /* Check tree can hold all active levels. Check tree matches * target, imageFormat, etc. diff --git a/src/mesa/drivers/dri/mach64/mach64_tex.c b/src/mesa/drivers/dri/mach64/mach64_tex.c index 225d23179e..02433e5dd8 100644 --- a/src/mesa/drivers/dri/mach64/mach64_tex.c +++ b/src/mesa/drivers/dri/mach64/mach64_tex.c @@ -138,7 +138,7 @@ mach64AllocTexObj( struct gl_texture_object *texObj ) /* Called by the _mesa_store_teximage[123]d() functions. */ -static const struct gl_texture_format * +static gl_format mach64ChooseTextureFormat( GLcontext *ctx, GLint internalFormat, GLenum format, GLenum type ) { @@ -167,15 +167,15 @@ mach64ChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_RGBA2: case GL_COMPRESSED_RGBA: if (mmesa->mach64Screen->cpp == 4) - return &_mesa_texformat_argb8888; + return MESA_FORMAT_ARGB8888; else - return &_mesa_texformat_argb4444; + return MESA_FORMAT_ARGB4444; case GL_RGB5_A1: if (mmesa->mach64Screen->cpp == 4) - return &_mesa_texformat_argb8888; + return MESA_FORMAT_ARGB8888; else - return &_mesa_texformat_argb1555; + return MESA_FORMAT_ARGB1555; case GL_RGBA8: case GL_RGB10_A2: @@ -183,9 +183,9 @@ mach64ChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_RGBA16: case GL_RGBA4: if (mmesa->mach64Screen->cpp == 4) - return &_mesa_texformat_argb8888; + return MESA_FORMAT_ARGB8888; else - return &_mesa_texformat_argb4444; + return MESA_FORMAT_ARGB4444; case 3: case GL_RGB: @@ -198,9 +198,9 @@ mach64ChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_RGB16: case GL_COMPRESSED_RGB: if (mmesa->mach64Screen->cpp == 4) - return &_mesa_texformat_argb8888; + return MESA_FORMAT_ARGB8888; else - return &_mesa_texformat_rgb565; + return MESA_FORMAT_RGB565; case 1: case GL_LUMINANCE: @@ -210,9 +210,9 @@ mach64ChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_LUMINANCE16: case GL_COMPRESSED_LUMINANCE: if (mmesa->mach64Screen->cpp == 4) - return &_mesa_texformat_argb8888; /* inefficient but accurate */ + return MESA_FORMAT_ARGB8888; /* inefficient but accurate */ else - return &_mesa_texformat_argb1555; + return MESA_FORMAT_ARGB1555; case GL_INTENSITY4: case GL_INTENSITY: @@ -221,9 +221,9 @@ mach64ChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_INTENSITY16: case GL_COMPRESSED_INTENSITY: if (mmesa->mach64Screen->cpp == 4) - return &_mesa_texformat_argb8888; /* inefficient but accurate */ + return MESA_FORMAT_ARGB8888; /* inefficient but accurate */ else - return &_mesa_texformat_argb4444; + return MESA_FORMAT_ARGB4444; case GL_COLOR_INDEX: case GL_COLOR_INDEX1_EXT: @@ -232,18 +232,18 @@ mach64ChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_COLOR_INDEX8_EXT: case GL_COLOR_INDEX12_EXT: case GL_COLOR_INDEX16_EXT: - return &_mesa_texformat_ci8; + return MESA_FORMAT_CI8; case GL_YCBCR_MESA: if (type == GL_UNSIGNED_SHORT_8_8_APPLE || type == GL_UNSIGNED_BYTE) - return &_mesa_texformat_ycbcr; + return MESA_FORMAT_YCBCR; else - return &_mesa_texformat_ycbcr_rev; + return MESA_FORMAT_YCBCR_REV; default: _mesa_problem( ctx, "unexpected format in %s", __FUNCTION__ ); - return NULL; + return MESA_FORMAT_NONE; } } diff --git a/src/mesa/drivers/dri/mach64/mach64_texmem.c b/src/mesa/drivers/dri/mach64/mach64_texmem.c index 843b231051..e83aeae3e1 100644 --- a/src/mesa/drivers/dri/mach64/mach64_texmem.c +++ b/src/mesa/drivers/dri/mach64/mach64_texmem.c @@ -86,7 +86,7 @@ static void mach64UploadAGPSubImage( mach64ContextPtr mmesa, if ( !image ) return; - texelBytes = _mesa_get_format_bytes(image->TexFormat->MesaFormat); + texelBytes = _mesa_get_format_bytes(image->TexFormat); switch ( texelBytes ) { case 1: texelsPerDword = 4; break; @@ -153,7 +153,7 @@ static void mach64UploadLocalSubImage( mach64ContextPtr mmesa, if ( !image ) return; - texelBytes = _mesa_get_format_bytes(image->TexFormat->MesaFormat); + texelBytes = _mesa_get_format_bytes(image->TexFormat); switch ( texelBytes ) { case 1: texelsPerDword = 4; break; diff --git a/src/mesa/drivers/dri/mach64/mach64_texstate.c b/src/mesa/drivers/dri/mach64/mach64_texstate.c index ff03b0c40a..c333355324 100644 --- a/src/mesa/drivers/dri/mach64/mach64_texstate.c +++ b/src/mesa/drivers/dri/mach64/mach64_texstate.c @@ -55,7 +55,7 @@ static void mach64SetTexImages( mach64ContextPtr mmesa, if ( MACH64_DEBUG & DEBUG_VERBOSE_API ) fprintf( stderr, "%s( %p )\n", __FUNCTION__, tObj ); - switch (baseImage->TexFormat->MesaFormat) { + switch (baseImage->TexFormat) { case MESA_FORMAT_ARGB8888: t->textureFormat = MACH64_DATATYPE_ARGB8888; break; @@ -89,7 +89,7 @@ static void mach64SetTexImages( mach64ContextPtr mmesa, totalSize = ( baseImage->Height * baseImage->Width * - _mesa_get_format_bytes(baseImage->TexFormat->MesaFormat) ); + _mesa_get_format_bytes(baseImage->TexFormat) ); totalSize = (totalSize + 31) & ~31; diff --git a/src/mesa/drivers/dri/mga/mga_texstate.c b/src/mesa/drivers/dri/mga/mga_texstate.c index 8f78ab9bd4..d52f0fac75 100644 --- a/src/mesa/drivers/dri/mga/mga_texstate.c +++ b/src/mesa/drivers/dri/mga/mga_texstate.c @@ -94,14 +94,14 @@ mgaSetTexImages( mgaContextPtr mmesa, return; } #else - if ( (baseImage->TexFormat->MesaFormat >= TMC_nr_tformat) - || (TMC_tformat[ baseImage->TexFormat->MesaFormat ] == 0) ) + if ( (baseImage->TexFormat >= TMC_nr_tformat) + || (TMC_tformat[ baseImage->TexFormat ] == 0) ) { _mesa_problem(NULL, "unexpected texture format in %s", __FUNCTION__); return; } - txformat = TMC_tformat[ baseImage->TexFormat->MesaFormat ]; + txformat = TMC_tformat[ baseImage->TexFormat ]; #endif /* MGA_USE_TABLE_FOR_FORMAT */ @@ -131,7 +131,7 @@ mgaSetTexImages( mgaContextPtr mmesa, break; size = texImage->Width * texImage->Height * - _mesa_get_format_bytes(baseImage->TexFormat->MesaFormat); + _mesa_get_format_bytes(baseImage->TexFormat); t->offsets[i] = totalSize; t->base.dirty_images[0] |= (1<TexFormat->MesaFormat); + texelBytes = _mesa_get_format_bytes(texImage->TexFormat); length = texImage->Width * texImage->Height * texelBytes; if ( t->base.heap->heapId == MGA_CARD_HEAP ) { unsigned tex_offset = 0; diff --git a/src/mesa/drivers/dri/r128/r128_tex.c b/src/mesa/drivers/dri/r128/r128_tex.c index 0920270d7b..6acda445f7 100644 --- a/src/mesa/drivers/dri/r128/r128_tex.c +++ b/src/mesa/drivers/dri/r128/r128_tex.c @@ -178,7 +178,7 @@ static r128TexObjPtr r128AllocTexObj( struct gl_texture_object *texObj ) /* Called by the _mesa_store_teximage[123]d() functions. */ -static const struct gl_texture_format * +static gl_format r128ChooseTextureFormat( GLcontext *ctx, GLint internalFormat, GLenum format, GLenum type ) { @@ -282,13 +282,13 @@ r128ChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_YCBCR_MESA: if (type == GL_UNSIGNED_SHORT_8_8_APPLE || type == GL_UNSIGNED_BYTE) - return &_mesa_texformat_ycbcr; + return MESA_FORMAT_YCBCR; else - return &_mesa_texformat_ycbcr_rev; + return MESA_FORMAT_YCBCR_REV; default: _mesa_problem( ctx, "unexpected format in %s", __FUNCTION__ ); - return NULL; + return MESA_FORMAT_NONE; } } diff --git a/src/mesa/drivers/dri/r128/r128_texmem.c b/src/mesa/drivers/dri/r128/r128_texmem.c index c369e14bd5..84f8563b89 100644 --- a/src/mesa/drivers/dri/r128/r128_texmem.c +++ b/src/mesa/drivers/dri/r128/r128_texmem.c @@ -95,7 +95,7 @@ static void uploadSubImage( r128ContextPtr rmesa, r128TexObjPtr t, if ( !image ) return; - switch ( _mesa_get_format_bytes(image->TexFormat->MesaFormat) ) { + switch ( _mesa_get_format_bytes(image->TexFormat) ) { case 1: texelsPerDword = 4; break; case 2: texelsPerDword = 2; break; case 4: texelsPerDword = 1; break; @@ -216,7 +216,7 @@ static void uploadSubImage( r128ContextPtr rmesa, r128TexObjPtr t, /* Copy the next chunck of the texture image into the blit buffer */ { const GLuint texelBytes = - _mesa_get_format_bytes(image->TexFormat->MesaFormat); + _mesa_get_format_bytes(image->TexFormat); const GLubyte *src = (const GLubyte *) image->Data + (y * image->Width + x) * texelBytes; const GLuint bytes = width * height * texelBytes; diff --git a/src/mesa/drivers/dri/r128/r128_texstate.c b/src/mesa/drivers/dri/r128/r128_texstate.c index 9f4f9aea2d..2e71c25861 100644 --- a/src/mesa/drivers/dri/r128/r128_texstate.c +++ b/src/mesa/drivers/dri/r128/r128_texstate.c @@ -61,7 +61,7 @@ static void r128SetTexImages( r128ContextPtr rmesa, if ( R128_DEBUG & DEBUG_VERBOSE_API ) fprintf( stderr, "%s( %p )\n", __FUNCTION__, (void *) tObj ); - switch (baseImage->TexFormat->MesaFormat) { + switch (baseImage->TexFormat) { case MESA_FORMAT_ARGB8888: case MESA_FORMAT_ARGB8888_REV: t->textureFormat = R128_DATATYPE_ARGB8888; @@ -123,7 +123,7 @@ static void r128SetTexImages( r128ContextPtr rmesa, totalSize += (tObj->Image[0][i]->Height * tObj->Image[0][i]->Width * - _mesa_get_format_bytes(tObj->Image[0][i]->TexFormat->MesaFormat)); + _mesa_get_format_bytes(tObj->Image[0][i]->TexFormat)); /* Offsets must be 32-byte aligned for host data blits and tiling */ totalSize = (totalSize + 31) & ~31; diff --git a/src/mesa/drivers/dri/r200/r200_texstate.c b/src/mesa/drivers/dri/r200/r200_texstate.c index 03f0613e7a..daca318684 100644 --- a/src/mesa/drivers/dri/r200/r200_texstate.c +++ b/src/mesa/drivers/dri/r200/r200_texstate.c @@ -1437,11 +1437,11 @@ static void setup_hardware_state(r200ContextPtr rmesa, radeonTexObj *t) log2Width = firstImage->WidthLog2; log2Height = firstImage->HeightLog2; log2Depth = firstImage->DepthLog2; - texelBytes = _mesa_get_format_bytes(firstImage->TexFormat->MesaFormat); + texelBytes = _mesa_get_format_bytes(firstImage->TexFormat); if (!t->image_override) { - if (VALID_FORMAT(firstImage->TexFormat->MesaFormat)) { + if (VALID_FORMAT(firstImage->TexFormat)) { const struct tx_table *table = _mesa_little_endian() ? tx_table_le : tx_table_be; @@ -1449,8 +1449,8 @@ static void setup_hardware_state(r200ContextPtr rmesa, radeonTexObj *t) R200_TXFORMAT_ALPHA_IN_MAP); t->pp_txfilter &= ~R200_YUV_TO_RGB; - t->pp_txformat |= table[ firstImage->TexFormat->MesaFormat ].format; - t->pp_txfilter |= table[ firstImage->TexFormat->MesaFormat ].filter; + t->pp_txformat |= table[ firstImage->TexFormat ].format; + t->pp_txfilter |= table[ firstImage->TexFormat ].filter; } else { _mesa_problem(NULL, "unexpected texture format in %s", __FUNCTION__); diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index cc40e0d1dc..cb826248f3 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -156,7 +156,7 @@ void r300SetDepthTexMode(struct gl_texture_object *tObj) t = radeon_tex_obj(tObj); - switch (tObj->Image[0][tObj->BaseLevel]->TexFormat->MesaFormat) { + switch (tObj->Image[0][tObj->BaseLevel]->TexFormat) { case MESA_FORMAT_Z16: format = formats[0]; break; @@ -208,14 +208,14 @@ static void setup_hardware_state(r300ContextPtr rmesa, radeonTexObj *t) firstImage = t->base.Image[0][firstlevel]; if (!t->image_override - && VALID_FORMAT(firstImage->TexFormat->MesaFormat)) { + && VALID_FORMAT(firstImage->TexFormat)) { if (firstImage->_BaseFormat == GL_DEPTH_COMPONENT) { r300SetDepthTexMode(&t->base); } else { - t->pp_txformat = tx_table[firstImage->TexFormat->MesaFormat].format; + t->pp_txformat = tx_table[firstImage->TexFormat].format; } - t->pp_txfilter |= tx_table[firstImage->TexFormat->MesaFormat].filter; + t->pp_txfilter |= tx_table[firstImage->TexFormat].filter; } else if (!t->image_override) { _mesa_problem(NULL, "unexpected texture format in %s", __FUNCTION__); diff --git a/src/mesa/drivers/dri/r600/r600_texstate.c b/src/mesa/drivers/dri/r600/r600_texstate.c index 7d7e77d355..55b455edc0 100644 --- a/src/mesa/drivers/dri/r600/r600_texstate.c +++ b/src/mesa/drivers/dri/r600/r600_texstate.c @@ -591,7 +591,7 @@ void r600SetDepthTexMode(struct gl_texture_object *tObj) t = radeon_tex_obj(tObj); - r600GetTexFormat(tObj, tObj->Image[0][tObj->BaseLevel]->TexFormat->MesaFormat); + r600GetTexFormat(tObj, tObj->Image[0][tObj->BaseLevel]->TexFormat); } @@ -616,7 +616,7 @@ static void setup_hardware_state(context_t *rmesa, struct gl_texture_object *tex firstImage = t->base.Image[0][firstlevel]; if (!t->image_override) { - if (!r600GetTexFormat(texObj, firstImage->TexFormat->MesaFormat)) { + if (!r600GetTexFormat(texObj, firstImage->TexFormat)) { radeon_error("unexpected texture format in %s\n", __FUNCTION__); return; diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index f19170b612..90ea2ec335 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -390,42 +390,42 @@ radeon_update_wrapper(GLcontext *ctx, struct radeon_renderbuffer *rrb, gl_format texFormat; restart: - if (texImage->TexFormat == &_mesa_texformat_argb8888) { + if (texImage->TexFormat == MESA_FORMAT_ARGB8888) { rrb->cpp = 4; rrb->base._ActualFormat = GL_RGBA8; rrb->base._BaseFormat = GL_RGBA; rrb->base.DataType = GL_UNSIGNED_BYTE; DBG("Render to RGBA8 texture OK\n"); } - else if (texImage->TexFormat == &_mesa_texformat_rgb565) { + else if (texImage->TexFormat == MESA_FORMAT_RGB565) { rrb->cpp = 2; rrb->base._ActualFormat = GL_RGB5; rrb->base._BaseFormat = GL_RGB; rrb->base.DataType = GL_UNSIGNED_BYTE; DBG("Render to RGB5 texture OK\n"); } - else if (texImage->TexFormat == &_mesa_texformat_argb1555) { + else if (texImage->TexFormat == MESA_FORMAT_ARGB1555) { rrb->cpp = 2; rrb->base._ActualFormat = GL_RGB5_A1; rrb->base._BaseFormat = GL_RGBA; rrb->base.DataType = GL_UNSIGNED_BYTE; DBG("Render to ARGB1555 texture OK\n"); } - else if (texImage->TexFormat == &_mesa_texformat_argb4444) { + else if (texImage->TexFormat == MESA_FORMAT_ARGB4444) { rrb->cpp = 2; rrb->base._ActualFormat = GL_RGBA4; rrb->base._BaseFormat = GL_RGBA; rrb->base.DataType = GL_UNSIGNED_BYTE; DBG("Render to ARGB1555 texture OK\n"); } - else if (texImage->TexFormat == &_mesa_texformat_z16) { + else if (texImage->TexFormat == MESA_FORMAT_Z16) { rrb->cpp = 2; rrb->base._ActualFormat = GL_DEPTH_COMPONENT16; rrb->base._BaseFormat = GL_DEPTH_COMPONENT; rrb->base.DataType = GL_UNSIGNED_SHORT; DBG("Render to DEPTH16 texture OK\n"); } - else if (texImage->TexFormat == &_mesa_texformat_s8_z24) { + else if (texImage->TexFormat == MESA_FORMAT_S8_Z24) { rrb->cpp = 4; rrb->base._ActualFormat = GL_DEPTH24_STENCIL8_EXT; rrb->base._BaseFormat = GL_DEPTH_STENCIL_EXT; @@ -436,29 +436,30 @@ restart: /* try redoing the FBO */ if (retry == 1) { DBG("Render to texture BAD FORMAT %d\n", - texImage->TexFormat->MesaFormat); + texImage->TexFormat); return GL_FALSE; } texImage->TexFormat = radeonChooseTextureFormat(ctx, texImage->InternalFormat, 0, - _mesa_get_format_datatype(texImage->TexFormat->MesaFormat), + _mesa_get_format_datatype(texImage->TexFormat), 1); retry++; goto restart; } - texFormat = texImage->TexFormat->MesaFormat; + texFormat = texImage->TexFormat; rrb->pitch = texImage->Width * rrb->cpp; rrb->base.InternalFormat = rrb->base._ActualFormat; rrb->base.Width = texImage->Width; rrb->base.Height = texImage->Height; - rrb->Base.RedBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_RED_SIZE); - rrb->Base.GreenBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_GREEN_SIZE); - rrb->Base.BlueBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_BLUE_SIZE); - rrb->Base.AlphaBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_ALPHA_SIZE); - rrb->Base.DepthBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_DEPTH_SIZE_ARB); - rrb->Base.StencilBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_STENCIL_SIZE_EXT); + rrb->base.RedBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_RED_SIZE); + rrb->base.GreenBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_GREEN_SIZE); + rrb->base.BlueBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_BLUE_SIZE); + rrb->base.AlphaBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_ALPHA_SIZE); + rrb->base.DepthBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_DEPTH_SIZE_ARB); + rrb->base.StencilBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_STENCIL_SIZE_EXT); + rrb->base.Delete = radeon_delete_renderbuffer; rrb->base.AllocStorage = radeon_nop_alloc_storage; diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c index 851474f871..b602bfb4b0 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c @@ -325,7 +325,7 @@ GLboolean radeon_miptree_matches_image(radeon_mipmap_tree *mt, if (!texImage->IsCompressed && !mt->compressed && - _mesa_get_format_bytes(texImage->TexFormat->MesaFormat) != mt->bpp) + _mesa_get_format_bytes(texImage->TexFormat) != mt->bpp) return GL_FALSE; lvl = &mt->levels[level - mt->firstLevel]; @@ -354,8 +354,8 @@ GLboolean radeon_miptree_matches_texture(radeon_mipmap_tree *mt, struct gl_textu numfaces = 6; firstImage = texObj->Image[0][firstLevel]; - compressed = firstImage->IsCompressed ? firstImage->TexFormat->MesaFormat : 0; - texelBytes = _mesa_get_format_bytes(firstImage->TexFormat->MesaFormat); + compressed = firstImage->IsCompressed ? firstImage->TexFormat : 0; + texelBytes = _mesa_get_format_bytes(firstImage->TexFormat); return (mt->firstLevel == firstLevel && mt->lastLevel == lastLevel && @@ -374,7 +374,7 @@ GLboolean radeon_miptree_matches_texture(radeon_mipmap_tree *mt, struct gl_textu void radeon_try_alloc_miptree(radeonContextPtr rmesa, radeonTexObj *t, radeon_texture_image *image, GLuint face, GLuint level) { - GLuint compressed = image->base.IsCompressed ? image->base.TexFormat->MesaFormat : 0; + GLuint compressed = image->base.IsCompressed ? image->base.TexFormat : 0; GLuint numfaces = 1; GLuint firstLevel, lastLevel; GLuint texelBytes; @@ -388,7 +388,7 @@ void radeon_try_alloc_miptree(radeonContextPtr rmesa, radeonTexObj *t, if (level != firstLevel || face >= numfaces) return; - texelBytes = _mesa_get_format_bytes(image->base.TexFormat->MesaFormat); + texelBytes = _mesa_get_format_bytes(image->base.TexFormat); t->mt = radeon_miptree_create(rmesa, t, t->base.Target, image->base.InternalFormat, diff --git a/src/mesa/drivers/dri/radeon/radeon_texstate.c b/src/mesa/drivers/dri/radeon/radeon_texstate.c index a00497a8f9..1064602504 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texstate.c +++ b/src/mesa/drivers/dri/radeon/radeon_texstate.c @@ -1031,18 +1031,18 @@ static GLboolean setup_hardware_state(r100ContextPtr rmesa, radeonTexObj *t, int log2Width = firstImage->WidthLog2; log2Height = firstImage->HeightLog2; log2Depth = firstImage->DepthLog2; - texelBytes = _mesa_get_format_bytes(firstImage->TexFormat->MesaFormat); + texelBytes = _mesa_get_format_bytes(firstImage->TexFormat); if (!t->image_override) { - if (VALID_FORMAT(firstImage->TexFormat->MesaFormat)) { + if (VALID_FORMAT(firstImage->TexFormat)) { const struct tx_table *table = tx_table; t->pp_txformat &= ~(RADEON_TXFORMAT_FORMAT_MASK | RADEON_TXFORMAT_ALPHA_IN_MAP); t->pp_txfilter &= ~RADEON_YUV_TO_RGB; - t->pp_txformat |= table[ firstImage->TexFormat->MesaFormat ].format; - t->pp_txfilter |= table[ firstImage->TexFormat->MesaFormat ].filter; + t->pp_txformat |= table[ firstImage->TexFormat ].format; + t->pp_txfilter |= table[ firstImage->TexFormat ].filter; } else { _mesa_problem(NULL, "unexpected texture format in %s", __FUNCTION__); diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 3ff8cad93e..0378b3c9fc 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -256,9 +256,9 @@ void radeonGenerateMipmap(GLcontext* ctx, GLenum target, struct gl_texture_objec /* try to find a format which will only need a memcopy */ -static const struct gl_texture_format *radeonChoose8888TexFormat(radeonContextPtr rmesa, - GLenum srcFormat, - GLenum srcType, GLboolean fbo) +static gl_format radeonChoose8888TexFormat(radeonContextPtr rmesa, + GLenum srcFormat, + GLenum srcType, GLboolean fbo) { const GLuint ui = 1; const GLubyte littleEndian = *((const GLubyte *)&ui); @@ -271,37 +271,37 @@ static const struct gl_texture_format *radeonChoose8888TexFormat(radeonContextPt (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && !littleEndian) || (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) || (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE && littleEndian)) { - return &_mesa_texformat_rgba8888; + return MESA_FORMAT_RGBA8888; } else if ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) || (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && littleEndian) || (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_INT_8_8_8_8) || (srcFormat == GL_ABGR_EXT && srcType == GL_UNSIGNED_BYTE && !littleEndian)) { - return &_mesa_texformat_rgba8888_rev; + return MESA_FORMAT_RGBA8888_REV; } else if (IS_R200_CLASS(rmesa->radeonScreen)) { return _dri_texformat_argb8888; } else if (srcFormat == GL_BGRA && ((srcType == GL_UNSIGNED_BYTE && !littleEndian) || srcType == GL_UNSIGNED_INT_8_8_8_8)) { - return &_mesa_texformat_argb8888_rev; + return MESA_FORMAT_ARGB8888_REV; } else if (srcFormat == GL_BGRA && ((srcType == GL_UNSIGNED_BYTE && littleEndian) || srcType == GL_UNSIGNED_INT_8_8_8_8_REV)) { - return &_mesa_texformat_argb8888; + return MESA_FORMAT_ARGB8888; } else return _dri_texformat_argb8888; } -const struct gl_texture_format *radeonChooseTextureFormat_mesa(GLcontext * ctx, - GLint internalFormat, - GLenum format, - GLenum type) +gl_format radeonChooseTextureFormat_mesa(GLcontext * ctx, + GLint internalFormat, + GLenum format, + GLenum type) { return radeonChooseTextureFormat(ctx, internalFormat, format, type, 0); } -const struct gl_texture_format *radeonChooseTextureFormat(GLcontext * ctx, - GLint internalFormat, - GLenum format, - GLenum type, GLboolean fbo) +gl_format radeonChooseTextureFormat(GLcontext * ctx, + GLint internalFormat, + GLenum format, + GLenum type, GLboolean fbo) { radeonContextPtr rmesa = RADEON_CONTEXT(ctx); const GLboolean do32bpt = @@ -425,50 +425,50 @@ const struct gl_texture_format *radeonChooseTextureFormat(GLcontext * ctx, case GL_YCBCR_MESA: if (type == GL_UNSIGNED_SHORT_8_8_APPLE || type == GL_UNSIGNED_BYTE) - return &_mesa_texformat_ycbcr; + return MESA_FORMAT_YCBCR; else - return &_mesa_texformat_ycbcr_rev; + return MESA_FORMAT_YCBCR_REV; case GL_RGB_S3TC: case GL_RGB4_S3TC: case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: - return &_mesa_texformat_rgb_dxt1; + return MESA_FORMAT_RGB_DXT1; case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: - return &_mesa_texformat_rgba_dxt1; + return MESA_FORMAT_RGBA_DXT1; case GL_RGBA_S3TC: case GL_RGBA4_S3TC: case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: - return &_mesa_texformat_rgba_dxt3; + return MESA_FORMAT_RGBA_DXT3; case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: - return &_mesa_texformat_rgba_dxt5; + return MESA_FORMAT_RGBA_DXT5; case GL_ALPHA16F_ARB: - return &_mesa_texformat_alpha_float16; + return MESA_FORMAT_ALPHA_FLOAT16; case GL_ALPHA32F_ARB: - return &_mesa_texformat_alpha_float32; + return MESA_FORMAT_ALPHA_FLOAT32; case GL_LUMINANCE16F_ARB: - return &_mesa_texformat_luminance_float16; + return MESA_FORMAT_LUMINANCE_FLOAT16; case GL_LUMINANCE32F_ARB: - return &_mesa_texformat_luminance_float32; + return MESA_FORMAT_LUMINANCE_FLOAT32; case GL_LUMINANCE_ALPHA16F_ARB: - return &_mesa_texformat_luminance_alpha_float16; + return MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16; case GL_LUMINANCE_ALPHA32F_ARB: - return &_mesa_texformat_luminance_alpha_float32; + return MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32; case GL_INTENSITY16F_ARB: - return &_mesa_texformat_intensity_float16; + return MESA_FORMAT_INTENSITY_FLOAT16; case GL_INTENSITY32F_ARB: - return &_mesa_texformat_intensity_float32; + return MESA_FORMAT_INTENSITY_FLOAT32; case GL_RGB16F_ARB: - return &_mesa_texformat_rgba_float16; + return MESA_FORMAT_RGBA_FLOAT16; case GL_RGB32F_ARB: - return &_mesa_texformat_rgba_float32; + return MESA_FORMAT_RGBA_FLOAT32; case GL_RGBA16F_ARB: - return &_mesa_texformat_rgba_float16; + return MESA_FORMAT_RGBA_FLOAT16; case GL_RGBA32F_ARB: - return &_mesa_texformat_rgba_float32; + return MESA_FORMAT_RGBA_FLOAT32; case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT16: @@ -476,7 +476,7 @@ const struct gl_texture_format *radeonChooseTextureFormat(GLcontext * ctx, case GL_DEPTH_COMPONENT32: case GL_DEPTH_STENCIL_EXT: case GL_DEPTH24_STENCIL8_EXT: - return &_mesa_texformat_s8_z24; + return MESA_FORMAT_S8_Z24; /* EXT_texture_sRGB */ case GL_SRGB: @@ -485,26 +485,26 @@ const struct gl_texture_format *radeonChooseTextureFormat(GLcontext * ctx, case GL_SRGB8_ALPHA8: case GL_COMPRESSED_SRGB: case GL_COMPRESSED_SRGB_ALPHA: - return &_mesa_texformat_srgba8; + return MESA_FORMAT_SRGBA8; case GL_SLUMINANCE: case GL_SLUMINANCE8: case GL_COMPRESSED_SLUMINANCE: - return &_mesa_texformat_sl8; + return MESA_FORMAT_SL8; case GL_SLUMINANCE_ALPHA: case GL_SLUMINANCE8_ALPHA8: case GL_COMPRESSED_SLUMINANCE_ALPHA: - return &_mesa_texformat_sla8; + return MESA_FORMAT_SLA8; default: _mesa_problem(ctx, "unexpected internalFormat 0x%x in %s", (int)internalFormat, __func__); - return NULL; + return MESA_FORMAT_NONE; } - return NULL; /* never get here */ + return MESA_FORMAT_NONE; /* never get here */ } /** @@ -544,18 +544,18 @@ static void radeon_teximage( texImage->TexFormat = radeonChooseTextureFormat(ctx, internalFormat, format, type, 0); _mesa_set_fetch_functions(texImage, dims); - if (_mesa_is_format_compressed(texImage->TexFormat->MesaFormat)) { + if (_mesa_is_format_compressed(texImage->TexFormat)) { texelBytes = 0; texImage->IsCompressed = GL_TRUE; texImage->CompressedSize = ctx->Driver.CompressedTextureSize(ctx, texImage->Width, texImage->Height, texImage->Depth, - texImage->TexFormat->MesaFormat); + texImage->TexFormat); } else { texImage->IsCompressed = GL_FALSE; texImage->CompressedSize = 0; - texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); + texelBytes = _mesa_get_format_bytes(texImage->TexFormat); /* Minimum pitch of 32 bytes */ if (postConvWidth * texelBytes < 32) { postConvWidth = 32 / texelBytes; @@ -593,7 +593,7 @@ static void radeon_teximage( if (texImage->IsCompressed) { size = texImage->CompressedSize; } else { - size = texImage->Width * texImage->Height * texImage->Depth * _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); + size = texImage->Width * texImage->Height * texImage->Depth * _mesa_get_format_bytes(texImage->TexFormat); } texImage->Data = _mesa_alloc_texmemory(size); } @@ -613,7 +613,7 @@ static void radeon_teximage( if (compressed) { if (image->mt) { uint32_t srcRowStride, bytesPerRow, rows; - srcRowStride = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, width); + srcRowStride = _mesa_compressed_row_stride(texImage->TexFormat, width); bytesPerRow = srcRowStride; rows = (height + 3) / 4; copy_rows(texImage->Data, image->mt->levels[level].rowstride, @@ -629,7 +629,7 @@ static void radeon_teximage( radeon_mipmap_level *lvl = &image->mt->levels[image->mtlevel]; dstRowStride = lvl->rowstride; } else { - dstRowStride = texImage->Width * _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); + dstRowStride = texImage->Width * _mesa_get_format_bytes(texImage->TexFormat); } if (dims == 3) { @@ -640,7 +640,7 @@ static void radeon_teximage( _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage"); for (i = 0; i < depth; ++i) { - dstImageOffsets[i] = dstRowStride/_mesa_get_format_bytes(texImage->TexFormat->MesaFormat) * height * i; + dstImageOffsets[i] = dstRowStride/_mesa_get_format_bytes(texImage->TexFormat) * height * i; } } else { dstImageOffsets = texImage->ImageOffsets; @@ -756,23 +756,23 @@ static void radeon_texsubimage(GLcontext* ctx, int dims, GLenum target, int leve radeon_mipmap_level *lvl = &image->mt->levels[image->mtlevel]; dstRowStride = lvl->rowstride; } else { - dstRowStride = texImage->RowStride * _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); + dstRowStride = texImage->RowStride * _mesa_get_format_bytes(texImage->TexFormat); } if (compressed) { uint32_t srcRowStride, bytesPerRow, rows; GLubyte *img_start; if (!image->mt) { - dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, texImage->Width); + dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat, texImage->Width); img_start = _mesa_compressed_image_address(xoffset, yoffset, 0, - texImage->TexFormat->MesaFormat, + texImage->TexFormat, texImage->Width, texImage->Data); } else { uint32_t blocks_x = dstRowStride / (image->mt->bpp * 4); img_start = texImage->Data + image->mt->bpp * 4 * (blocks_x * (yoffset / 4) + xoffset / 4); } - srcRowStride = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, width); + srcRowStride = _mesa_compressed_row_stride(texImage->TexFormat, width); bytesPerRow = srcRowStride; rows = (height + 3) / 4; @@ -895,10 +895,10 @@ static void migrate_image_to_miptree(radeon_mipmap_tree *mt, radeon_texture_imag /* need to confirm this value is correct */ if (mt->compressed) { height = (image->base.Height + 3) / 4; - srcrowstride = _mesa_compressed_row_stride(image->base.TexFormat->MesaFormat, image->base.Width); + srcrowstride = _mesa_compressed_row_stride(image->base.TexFormat, image->base.Width); } else { height = image->base.Height * image->base.Depth; - srcrowstride = image->base.Width * _mesa_get_format_bytes(image->base.TexFormat->MesaFormat); + srcrowstride = image->base.Width * _mesa_get_format_bytes(image->base.TexFormat); } // if (mt->tilebits) diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.h b/src/mesa/drivers/dri/radeon/radeon_texture.h index 888a55ba91..8995546d77 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.h +++ b/src/mesa/drivers/dri/radeon/radeon_texture.h @@ -30,6 +30,10 @@ #ifndef RADEON_TEXTURE_H #define RADEON_TEXTURE_H + +#include "main/formats.h" + + struct gl_texture_image *radeonNewTextureImage(GLcontext *ctx); void radeonFreeTexImageData(GLcontext *ctx, struct gl_texture_image *timage); @@ -40,14 +44,16 @@ void radeonUnmapTexture(GLcontext *ctx, struct gl_texture_object *texObj); void radeonGenerateMipmap(GLcontext* ctx, GLenum target, struct gl_texture_object *texObj); int radeon_validate_texture_miptree(GLcontext * ctx, struct gl_texture_object *texObj); GLuint radeon_face_for_target(GLenum target); -const struct gl_texture_format *radeonChooseTextureFormat_mesa(GLcontext * ctx, - GLint internalFormat, - GLenum format, - GLenum type); -const struct gl_texture_format *radeonChooseTextureFormat(GLcontext * ctx, - GLint internalFormat, - GLenum format, - GLenum type, GLboolean fbo); + +gl_format radeonChooseTextureFormat_mesa(GLcontext * ctx, + GLint internalFormat, + GLenum format, + GLenum type); + +gl_format radeonChooseTextureFormat(GLcontext * ctx, + GLint internalFormat, + GLenum format, + GLenum type, GLboolean fbo); void radeonTexImage1D(GLcontext * ctx, GLenum target, GLint level, GLint internalFormat, diff --git a/src/mesa/drivers/dri/savage/savagetex.c b/src/mesa/drivers/dri/savage/savagetex.c index fe239e1b05..796da4fc0d 100644 --- a/src/mesa/drivers/dri/savage/savagetex.c +++ b/src/mesa/drivers/dri/savage/savagetex.c @@ -527,6 +527,11 @@ savageAllocTexObj( struct gl_texture_object *texObj ) * components to white. This way we get the correct result. */ +#if 0 +/* Using MESA_FORMAT_RGBA8888 to store alpha-only textures should + * work but is space inefficient. + */ + static GLboolean _savage_texstore_a1114444(TEXSTORE_PARAMS); @@ -590,10 +595,11 @@ _savage_texstore_a1114444(TEXSTORE_PARAMS) return GL_FALSE; _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { + GLuint texelBytes = _mesa_get_format_bytes(dstFormat); GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLushort *dstUI = (GLushort *) dstRow; for (col = 0; col < srcWidth; col++) { @@ -629,10 +635,11 @@ _savage_texstore_a1118888(TEXSTORE_PARAMS) return GL_FALSE; _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); for (img = 0; img < srcDepth; img++) { + GLuint texelBytes = _mesa_get_format_bytes(dstFormat); GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * dstFormat->TexelBytes + + dstImageOffsets[dstZoffset + img] * texelBytes + dstYoffset * dstRowStride - + dstXoffset * dstFormat->TexelBytes; + + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLuint *dstUI = (GLuint *) dstRow; for (col = 0; col < srcWidth; col++) { @@ -647,10 +654,11 @@ _savage_texstore_a1118888(TEXSTORE_PARAMS) return GL_TRUE; } +#endif /* Called by the _mesa_store_teximage[123]d() functions. */ -static const struct gl_texture_format * +static gl_format savageChooseTextureFormat( GLcontext *ctx, GLint internalFormat, GLenum format, GLenum type ) { @@ -669,15 +677,15 @@ savageChooseTextureFormat( GLcontext *ctx, GLint internalFormat, switch ( type ) { case GL_UNSIGNED_INT_10_10_10_2: case GL_UNSIGNED_INT_2_10_10_10_REV: - return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb1555; + return do32bpt ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_ARGB1555; case GL_UNSIGNED_SHORT_4_4_4_4: case GL_UNSIGNED_SHORT_4_4_4_4_REV: - return &_mesa_texformat_argb4444; + return MESA_FORMAT_ARGB4444; case GL_UNSIGNED_SHORT_5_5_5_1: case GL_UNSIGNED_SHORT_1_5_5_5_REV: - return &_mesa_texformat_argb1555; + return MESA_FORMAT_ARGB1555; default: - return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444; + return do32bpt ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_ARGB4444; } case 3: @@ -686,129 +694,152 @@ savageChooseTextureFormat( GLcontext *ctx, GLint internalFormat, switch ( type ) { case GL_UNSIGNED_SHORT_4_4_4_4: case GL_UNSIGNED_SHORT_4_4_4_4_REV: - return &_mesa_texformat_argb4444; + return MESA_FORMAT_ARGB4444; case GL_UNSIGNED_SHORT_5_5_5_1: case GL_UNSIGNED_SHORT_1_5_5_5_REV: - return &_mesa_texformat_argb1555; + return MESA_FORMAT_ARGB1555; case GL_UNSIGNED_SHORT_5_6_5: case GL_UNSIGNED_SHORT_5_6_5_REV: - return &_mesa_texformat_rgb565; + return MESA_FORMAT_RGB565; default: - return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_rgb565; + return do32bpt ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_RGB565; } case GL_RGBA8: case GL_RGBA12: case GL_RGBA16: return !force16bpt ? - &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444; + MESA_FORMAT_ARGB8888 : MESA_FORMAT_ARGB4444; case GL_RGB10_A2: return !force16bpt ? - &_mesa_texformat_argb8888 : &_mesa_texformat_argb1555; + MESA_FORMAT_ARGB8888 : MESA_FORMAT_ARGB1555; case GL_RGBA4: case GL_RGBA2: - return &_mesa_texformat_argb4444; + return MESA_FORMAT_ARGB4444; case GL_RGB5_A1: - return &_mesa_texformat_argb1555; + return MESA_FORMAT_ARGB1555; case GL_RGB8: case GL_RGB10: case GL_RGB12: case GL_RGB16: - return !force16bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_rgb565; + return !force16bpt ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_RGB565; case GL_RGB5: case GL_RGB4: case GL_R3_G3_B2: - return &_mesa_texformat_rgb565; + return MESA_FORMAT_RGB565; case GL_ALPHA: case GL_COMPRESSED_ALPHA: - return isSavage4 ? &_mesa_texformat_a8 : ( +#if 0 + return isSavage4 ? MESA_FORMAT_a8 : ( do32bpt ? &_savage_texformat_a1118888 : &_savage_texformat_a1114444); +#else + if (isSavage4) + return MESA_FORMAT_A8; + else if (do32bpt) + return MESA_FORMAT_ARGB8888; + else + return MESA_FORMAT_ARGB4444; +#endif case GL_ALPHA4: - return isSavage4 ? &_mesa_texformat_a8 : &_savage_texformat_a1114444; +#if 0 + return isSavage4 ? MESA_FORMAT_a8 : &_savage_texformat_a1114444; +#else + if (isSavage4) + return MESA_FORMAT_A8; + else + return MESA_FORMAT_ARGB4444; +#endif case GL_ALPHA8: case GL_ALPHA12: case GL_ALPHA16: - return isSavage4 ? &_mesa_texformat_a8 : ( +#if 0 + return isSavage4 ? MESA_FORMAT_a8 : ( !force16bpt ? &_savage_texformat_a1118888 : &_savage_texformat_a1114444); - +#else + if (isSavage4) + return MESA_FORMAT_A8; + else if (force16bpt) + return MESA_FORMAT_ARGB4444; + else + return MESA_FORMAT_ARGB8888; +#endif case 1: case GL_LUMINANCE: case GL_COMPRESSED_LUMINANCE: /* no alpha, but use argb1555 in 16bit case to get pure grey values */ - return isSavage4 ? &_mesa_texformat_l8 : ( - do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb1555); + return isSavage4 ? MESA_FORMAT_L8 : ( + do32bpt ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_ARGB1555); case GL_LUMINANCE4: - return isSavage4 ? &_mesa_texformat_l8 : &_mesa_texformat_argb1555; + return isSavage4 ? MESA_FORMAT_L8 : MESA_FORMAT_ARGB1555; case GL_LUMINANCE8: case GL_LUMINANCE12: case GL_LUMINANCE16: - return isSavage4 ? &_mesa_texformat_l8 : ( - !force16bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb1555); + return isSavage4 ? MESA_FORMAT_L8 : ( + !force16bpt ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_ARGB1555); case 2: case GL_LUMINANCE_ALPHA: case GL_COMPRESSED_LUMINANCE_ALPHA: /* Savage4 has a al44 texture format. But it's not supported by Mesa. */ - return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444; + return do32bpt ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_ARGB4444; case GL_LUMINANCE4_ALPHA4: case GL_LUMINANCE6_ALPHA2: - return &_mesa_texformat_argb4444; + return MESA_FORMAT_ARGB4444; case GL_LUMINANCE8_ALPHA8: case GL_LUMINANCE12_ALPHA4: case GL_LUMINANCE12_ALPHA12: case GL_LUMINANCE16_ALPHA16: - return !force16bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444; + return !force16bpt ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_ARGB4444; #if 0 /* TFT_I8 produces garbage on ProSavageDDR and subsequent texture * disable keeps rendering garbage. Disabled for now. */ case GL_INTENSITY: case GL_COMPRESSED_INTENSITY: - return isSavage4 ? &_mesa_texformat_i8 : ( - do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444); + return isSavage4 ? MESA_FORMAT_i8 : ( + do32bpt ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_ARGB4444); case GL_INTENSITY4: - return isSavage4 ? &_mesa_texformat_i8 : &_mesa_texformat_argb4444; + return isSavage4 ? MESA_FORMAT_i8 : MESA_FORMAT_ARGB4444; case GL_INTENSITY8: case GL_INTENSITY12: case GL_INTENSITY16: - return isSavage4 ? &_mesa_texformat_i8 : ( - !force16bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444); + return isSavage4 ? MESA_FORMAT_i8 : ( + !force16bpt ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_ARGB4444); #else case GL_INTENSITY: case GL_COMPRESSED_INTENSITY: - return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444; + return do32bpt ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_ARGB4444; case GL_INTENSITY4: - return &_mesa_texformat_argb4444; + return MESA_FORMAT_ARGB4444; case GL_INTENSITY8: case GL_INTENSITY12: case GL_INTENSITY16: - return !force16bpt ? &_mesa_texformat_argb8888 : - &_mesa_texformat_argb4444; + return !force16bpt ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_ARGB4444; #endif case GL_RGB_S3TC: case GL_RGB4_S3TC: case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: - return &_mesa_texformat_rgb_dxt1; + return MESA_FORMAT_RGB_DXT1; case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: - return &_mesa_texformat_rgba_dxt1; + return MESA_FORMAT_RGBA_DXT1; case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: - return &_mesa_texformat_rgba_dxt3; + return MESA_FORMAT_RGBA_DXT3; case GL_RGBA_S3TC: case GL_RGBA4_S3TC: if (!isSavage4) /* Not the best choice but Savage3D/MX/IX don't support DXT3 or DXT5. */ - return &_mesa_texformat_rgba_dxt1; + return MESA_FORMAT_RGBA_DXT1; /* fall through */ case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: - return &_mesa_texformat_rgba_dxt5; + return MESA_FORMAT_RGBA_DXT5; /* case GL_COLOR_INDEX: @@ -822,7 +853,7 @@ savageChooseTextureFormat( GLcontext *ctx, GLint internalFormat, */ default: _mesa_problem(ctx, "unexpected texture format in %s", __FUNCTION__); - return NULL; + return MESA_FORMAT_NONE; } } @@ -837,7 +868,7 @@ static void savageSetTexImages( savageContextPtr imesa, assert(t); assert(image); - switch (image->TexFormat->MesaFormat) { + switch (image->TexFormat) { case MESA_FORMAT_ARGB8888: textureFormat = TFT_ARGB8888; t->texelBytes = tileIndex = 4; @@ -2083,6 +2114,7 @@ void savageDDInitTextureFuncs( struct dd_function_table *functions ) /* Texel fetching with our custom texture formats works just like * the standard argb formats. */ +#if 0 _savage_texformat_a1114444.FetchTexel1D = _mesa_texformat_argb4444.FetchTexel1D; _savage_texformat_a1114444.FetchTexel2D = _mesa_texformat_argb4444.FetchTexel2D; _savage_texformat_a1114444.FetchTexel3D = _mesa_texformat_argb4444.FetchTexel3D; @@ -2096,4 +2128,5 @@ void savageDDInitTextureFuncs( struct dd_function_table *functions ) _savage_texformat_a1118888.FetchTexel1Df= _mesa_texformat_argb8888.FetchTexel1Df; _savage_texformat_a1118888.FetchTexel2Df= _mesa_texformat_argb8888.FetchTexel2Df; _savage_texformat_a1118888.FetchTexel3Df= _mesa_texformat_argb8888.FetchTexel3Df; +#endif } diff --git a/src/mesa/drivers/dri/sis/sis_tex.c b/src/mesa/drivers/dri/sis/sis_tex.c index 38a309d41f..5dc05146b1 100644 --- a/src/mesa/drivers/dri/sis/sis_tex.c +++ b/src/mesa/drivers/dri/sis/sis_tex.c @@ -65,7 +65,7 @@ sisAllocTexImage( sisContextPtr smesa, sisTexObjPtr t, int level, if (t->format == 0) { t->format = image->_BaseFormat; - switch (image->TexFormat->MesaFormat) + switch (image->TexFormat) { case MESA_FORMAT_ARGB8888: t->hwformat = TEXEL_ARGB_8888_32; @@ -101,13 +101,12 @@ sisAllocTexImage( sisContextPtr smesa, sisTexObjPtr t, int level, t->hwformat = TEXEL_VUY422; break; default: - sis_fatal_error("Bad texture format 0x%x.\n", - image->TexFormat->MesaFormat); + sis_fatal_error("Bad texture format 0x%x.\n", image->TexFormat); } } assert(t->format == image->_BaseFormat); - texel_size = _mesa_get_format_bytes(image->TexFormat->MesaFormat); + texel_size = _mesa_get_format_bytes(image->TexFormat); size = image->Width * image->Height * texel_size + TEXTURE_HW_PLUS; addr = sisAllocFB( smesa, size, &t->image[level].handle ); @@ -230,7 +229,7 @@ static GLboolean sisIsTextureResident( GLcontext * ctx, return (texObj->DriverData != NULL); } -static const struct gl_texture_format * +static gl_format sisChooseTextureFormat( GLcontext *ctx, GLint internalFormat, GLenum format, GLenum type ) { @@ -248,15 +247,15 @@ sisChooseTextureFormat( GLcontext *ctx, GLint internalFormat, switch ( type ) { case GL_UNSIGNED_INT_10_10_10_2: case GL_UNSIGNED_INT_2_10_10_10_REV: - return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb1555; + return do32bpt ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_ARGB1555; case GL_UNSIGNED_SHORT_4_4_4_4: case GL_UNSIGNED_SHORT_4_4_4_4_REV: - return &_mesa_texformat_argb4444; + return MESA_FORMAT_ARGB4444; case GL_UNSIGNED_SHORT_5_5_5_1: case GL_UNSIGNED_SHORT_1_5_5_5_REV: - return &_mesa_texformat_argb1555; + return MESA_FORMAT_ARGB1555; default: - return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444; + return do32bpt ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_ARGB4444; } case 3: @@ -265,46 +264,46 @@ sisChooseTextureFormat( GLcontext *ctx, GLint internalFormat, switch ( type ) { case GL_UNSIGNED_SHORT_4_4_4_4: case GL_UNSIGNED_SHORT_4_4_4_4_REV: - return &_mesa_texformat_argb4444; + return MESA_FORMAT_ARGB4444; case GL_UNSIGNED_SHORT_5_5_5_1: case GL_UNSIGNED_SHORT_1_5_5_5_REV: - return &_mesa_texformat_argb1555; + return MESA_FORMAT_ARGB1555; case GL_UNSIGNED_SHORT_5_6_5: case GL_UNSIGNED_SHORT_5_6_5_REV: - return &_mesa_texformat_rgb565; + return MESA_FORMAT_RGB565; default: - return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_rgb565; + return do32bpt ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_RGB565; } case GL_RGBA8: case GL_RGBA12: case GL_RGBA16: return !force16bpt ? - &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444; + MESA_FORMAT_ARGB8888 : MESA_FORMAT_ARGB4444; case GL_RGB10_A2: return !force16bpt ? - &_mesa_texformat_argb8888 : &_mesa_texformat_argb1555; + MESA_FORMAT_ARGB8888 : MESA_FORMAT_ARGB1555; case GL_RGBA4: case GL_RGBA2: - return &_mesa_texformat_argb4444; + return MESA_FORMAT_ARGB4444; case GL_RGB5_A1: - return &_mesa_texformat_argb1555; + return MESA_FORMAT_ARGB1555; case GL_RGB8: case GL_RGB10: case GL_RGB12: case GL_RGB16: - return !force16bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_rgb565; + return !force16bpt ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_RGB565; case GL_RGB5: case GL_RGB4: - return &_mesa_texformat_rgb565; + return MESA_FORMAT_RGB565; case GL_R3_G3_B2: - return &_mesa_texformat_rgb332; + return MESA_FORMAT_RGB332; case GL_ALPHA: case GL_ALPHA4: /* FIXME: This could use its own texstore */ @@ -312,7 +311,7 @@ sisChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_ALPHA12: case GL_ALPHA16: case GL_COMPRESSED_ALPHA: - return &_mesa_texformat_a8; + return MESA_FORMAT_A8; case 1: case GL_LUMINANCE: @@ -321,7 +320,7 @@ sisChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_LUMINANCE12: case GL_LUMINANCE16: case GL_COMPRESSED_LUMINANCE: - return &_mesa_texformat_l8; + return MESA_FORMAT_L8; case 2: case GL_LUMINANCE_ALPHA: @@ -332,7 +331,7 @@ sisChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_LUMINANCE12_ALPHA12: case GL_LUMINANCE16_ALPHA16: case GL_COMPRESSED_LUMINANCE_ALPHA: - return &_mesa_texformat_al88; + return MESA_FORMAT_AL88; case GL_INTENSITY: case GL_INTENSITY4: @@ -340,19 +339,19 @@ sisChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_INTENSITY12: case GL_INTENSITY16: case GL_COMPRESSED_INTENSITY: - return &_mesa_texformat_i8; + return MESA_FORMAT_I8; case GL_YCBCR_MESA: if (type == GL_UNSIGNED_SHORT_8_8_APPLE || type == GL_UNSIGNED_BYTE) - return &_mesa_texformat_ycbcr; + return MESA_FORMAT_YCBCR; else - return &_mesa_texformat_ycbcr_rev; + return MESA_FORMAT_YCBCR_REV; default: _mesa_problem(ctx, "unexpected format in sisDDChooseTextureFormat: %d", internalFormat); - return NULL; + return MESA_FORMAT_NONE; } } @@ -425,7 +424,7 @@ static void sisTexSubImage1D( GLcontext *ctx, /* Upload the texture */ WaitEngIdle(smesa); - texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); + texelBytes = _mesa_get_format_bytes(texImage->TexFormat); copySize = width * texelBytes; src = (char *)texImage->Data + xoffset * texelBytes; @@ -513,7 +512,7 @@ static void sisTexSubImage2D( GLcontext *ctx, /* Upload the texture */ WaitEngIdle(smesa); - texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); + texelBytes = _mesa_get_format_bytes(texImage->TexFormat); copySize = width * texelBytes; src = (char *)texImage->Data + (xoffset + yoffset * texImage->Width) * diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tex.c b/src/mesa/drivers/dri/tdfx/tdfx_tex.c index 51d86aea37..427d315a01 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_tex.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_tex.c @@ -72,13 +72,13 @@ _mesa_halve2x2_teximage2d ( GLcontext *ctx, GLubyte *_d = NULL; GLenum _t = 0; - if (texImage->TexFormat->MesaFormat == MESA_FORMAT_RGB565) { + if (texImage->TexFormat == MESA_FORMAT_RGB565) { _t = GL_UNSIGNED_SHORT_5_6_5_REV; bpt = bytesPerPixel; - } else if (texImage->TexFormat->MesaFormat == MESA_FORMAT_ARGB4444) { + } else if (texImage->TexFormat == MESA_FORMAT_ARGB4444) { _t = GL_UNSIGNED_SHORT_4_4_4_4_REV; bpt = bytesPerPixel; - } else if (texImage->TexFormat->MesaFormat == MESA_FORMAT_ARGB1555) { + } else if (texImage->TexFormat == MESA_FORMAT_ARGB1555) { _t = GL_UNSIGNED_SHORT_1_5_5_5_REV; bpt = bytesPerPixel; } @@ -94,7 +94,7 @@ _mesa_halve2x2_teximage2d ( GLcontext *ctx, _s = src = MALLOC(srcRowStride * srcHeight); _d = dst = MALLOC(dstWidth * bytesPerPixel * dstHeight); _mesa_texstore(ctx, 2, GL_RGBA, - &_mesa_texformat_rgba8888_rev, src, + MESA_FORMAT_RGBA8888_REV, src, 0, 0, 0, /* dstX/Y/Zoffset */ srcRowStride, /* dstRowStride */ &dstImageOffsets, @@ -190,6 +190,7 @@ tdfxGenerateMipmap(GLcontext *ctx, GLenum target, const tdfxMipMapLevel *mml; texImage = _mesa_get_tex_image(ctx, texObj, target, level); + texelBytes = _mesa_get_format_bytes(texImage->TexFormat); assert(!texImage->IsCompressed); mml = TDFX_TEXIMAGE_DATA(texImage); @@ -760,7 +761,7 @@ fxTexusError(const char *string, FxBool fatal) #endif -static const struct gl_texture_format * +static gl_format tdfxChooseTextureFormat( GLcontext *ctx, GLint internalFormat, GLenum srcFormat, GLenum srcType ) { @@ -774,7 +775,7 @@ tdfxChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_ALPHA12: case GL_ALPHA16: case GL_COMPRESSED_ALPHA: - return &_mesa_texformat_a8; + return MESA_FORMAT_A8; case 1: case GL_LUMINANCE: case GL_LUMINANCE4: @@ -782,7 +783,7 @@ tdfxChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_LUMINANCE12: case GL_LUMINANCE16: case GL_COMPRESSED_LUMINANCE: - return &_mesa_texformat_l8; + return MESA_FORMAT_L8; case 2: case GL_LUMINANCE_ALPHA: case GL_LUMINANCE4_ALPHA4: @@ -792,48 +793,47 @@ tdfxChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_LUMINANCE12_ALPHA12: case GL_LUMINANCE16_ALPHA16: case GL_COMPRESSED_LUMINANCE_ALPHA: - return &_mesa_texformat_al88; + return MESA_FORMAT_AL88; case GL_INTENSITY: case GL_INTENSITY4: case GL_INTENSITY8: case GL_INTENSITY12: case GL_INTENSITY16: case GL_COMPRESSED_INTENSITY: - return &_mesa_texformat_i8; + return MESA_FORMAT_I8; case GL_R3_G3_B2: case GL_RGB4: case GL_RGB5: - return &_mesa_texformat_rgb565; + return MESA_FORMAT_RGB565; case GL_COMPRESSED_RGB: /* intentional fall-through */ case 3: case GL_RGB: if ( srcFormat == GL_RGB && srcType == GL_UNSIGNED_SHORT_5_6_5 ) { - return &_mesa_texformat_rgb565; + return MESA_FORMAT_RGB565; } /* intentional fall through */ case GL_RGB8: case GL_RGB10: case GL_RGB12: case GL_RGB16: - return (allow32bpt) ? &_mesa_texformat_argb8888 - : &_mesa_texformat_rgb565; + return (allow32bpt) ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_RGB565; case GL_RGBA2: case GL_RGBA4: - return &_mesa_texformat_argb4444; + return MESA_FORMAT_ARGB4444; case GL_COMPRESSED_RGBA: /* intentional fall-through */ case 4: case GL_RGBA: if ( srcFormat == GL_BGRA ) { if ( srcType == GL_UNSIGNED_INT_8_8_8_8_REV ) { - return &_mesa_texformat_argb8888; + return MESA_FORMAT_ARGB8888; } else if ( srcType == GL_UNSIGNED_SHORT_4_4_4_4_REV ) { - return &_mesa_texformat_argb4444; + return MESA_FORMAT_ARGB4444; } else if ( srcType == GL_UNSIGNED_SHORT_1_5_5_5_REV ) { - return &_mesa_texformat_argb1555; + return MESA_FORMAT_ARGB1555; } } /* intentional fall through */ @@ -841,10 +841,9 @@ tdfxChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_RGB10_A2: case GL_RGBA12: case GL_RGBA16: - return allow32bpt ? &_mesa_texformat_argb8888 - : &_mesa_texformat_argb4444; + return allow32bpt ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_ARGB4444; case GL_RGB5_A1: - return &_mesa_texformat_argb1555; + return MESA_FORMAT_ARGB1555; case GL_COLOR_INDEX: case GL_COLOR_INDEX1_EXT: case GL_COLOR_INDEX2_EXT: @@ -852,29 +851,29 @@ tdfxChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_COLOR_INDEX8_EXT: case GL_COLOR_INDEX12_EXT: case GL_COLOR_INDEX16_EXT: - return &_mesa_texformat_ci8; + return MESA_FORMAT_CI8; /* GL_EXT_texture_compression_s3tc */ /* GL_S3_s3tc */ case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: case GL_RGB_S3TC: case GL_RGB4_S3TC: - return &_mesa_texformat_rgb_dxt1; + return MESA_FORMAT_RGB_DXT1; case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: - return &_mesa_texformat_rgba_dxt1; + return MESA_FORMAT_RGBA_DXT1; case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: case GL_RGBA_S3TC: case GL_RGBA4_S3TC: - return &_mesa_texformat_rgba_dxt3; + return MESA_FORMAT_RGBA_DXT3; case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: - return &_mesa_texformat_rgba_dxt5; + return MESA_FORMAT_RGBA_DXT5; /* GL_3DFX_texture_compression_FXT1 */ case GL_COMPRESSED_RGB_FXT1_3DFX: - return &_mesa_texformat_rgb_fxt1; + return MESA_FORMAT_RGB_FXT1; case GL_COMPRESSED_RGBA_FXT1_3DFX: - return &_mesa_texformat_rgba_fxt1; + return MESA_FORMAT_RGBA_FXT1; default: _mesa_problem(ctx, "unexpected format in tdfxChooseTextureFormat"); - return NULL; + return MESA_FORMAT_NONE; } } @@ -1126,7 +1125,9 @@ fetch_rgb_dxt1(const struct gl_texture_image *texImage, i = i * mml->wScale; j = j * mml->hScale; + /* XXX Get fetch func from _mesa_get_texel_fetch_func() _mesa_texformat_rgb_dxt1.FetchTexel2D(texImage, i, j, k, rgba); + */ } @@ -1139,7 +1140,9 @@ fetch_rgba_dxt1(const struct gl_texture_image *texImage, i = i * mml->wScale; j = j * mml->hScale; + /* XXX Get fetch func from _mesa_get_texel_fetch_func() _mesa_texformat_rgba_dxt1.FetchTexel2D(texImage, i, j, k, rgba); + */ } @@ -1152,7 +1155,9 @@ fetch_rgba_dxt3(const struct gl_texture_image *texImage, i = i * mml->wScale; j = j * mml->hScale; + /* XXX Get fetch func from _mesa_get_texel_fetch_func() _mesa_texformat_rgba_dxt3.FetchTexel2D(texImage, i, j, k, rgba); + */ } @@ -1165,7 +1170,9 @@ fetch_rgba_dxt5(const struct gl_texture_image *texImage, i = i * mml->wScale; j = j * mml->hScale; + /* XXX Get fetch func from _mesa_get_texel_fetch_func() _mesa_texformat_rgba_dxt5.FetchTexel2D(texImage, i, j, k, rgba); + */ } @@ -1268,7 +1275,7 @@ adjust2DRatio (GLcontext *ctx, } /* unpack image, apply transfer ops and store in rawImage */ _mesa_texstore(ctx, 2, GL_RGBA, - &_mesa_texformat_rgba8888_rev, rawImage, + MESA_FORMAT_RGBA8888_REV, rawImage, 0, 0, 0, /* dstX/Y/Zoffset */ width * rawBytes, /* dstRowStride */ &dstImageOffsets, @@ -1396,11 +1403,11 @@ tdfxTexImage2D(GLcontext *ctx, GLenum target, GLint level, texImage->TexFormat = (*ctx->Driver.ChooseTextureFormat)(ctx, internalFormat, format, type); assert(texImage->TexFormat); - mesaFormat = texImage->TexFormat->MesaFormat; + mesaFormat = texImage->TexFormat; mml->glideFormat = fxGlideFormat(mesaFormat); ti->info.format = mml->glideFormat; texImage->FetchTexelc = fxFetchFunction(mesaFormat); - texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); + texelBytes = _mesa_get_format_bytes(texImage->TexFormat); if (texImage->IsCompressed) { texImage->CompressedSize = _mesa_compressed_texture_size(ctx, @@ -1408,7 +1415,7 @@ tdfxTexImage2D(GLcontext *ctx, GLenum target, GLint level, mml->height, 1, mesaFormat); - dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, mml->width); + dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat, mml->width); texImage->Data = _mesa_alloc_texmemory(texImage->CompressedSize); } else { dstRowStride = mml->width * texelBytes; @@ -1484,9 +1491,9 @@ tdfxTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, assert(texImage->Data); /* must have an existing texture image! */ assert(texImage->_BaseFormat); - texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); + texelBytes = _mesa_get_format_bytes(texImage->TexFormat); if (texImage->IsCompressed) { - dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, mml->width); + dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat, mml->width); } else { dstRowStride = mml->width * texelBytes; } @@ -1626,7 +1633,7 @@ tdfxCompressedTexImage2D (GLcontext *ctx, GLenum target, /* Determine the appropriate Glide texel format, * given the user's internal texture format hint. */ - mesaFormat = texImage->TexFormat->MesaFormat; + mesaFormat = texImage->TexFormat; mml->glideFormat = fxGlideFormat(mesaFormat); ti->info.format = mml->glideFormat; texImage->FetchTexelc = fxFetchFunction(mesaFormat); @@ -1661,7 +1668,7 @@ tdfxCompressedTexImage2D (GLcontext *ctx, GLenum target, * we replicate the data over the padded area. * For now, we take 2) + 3) but texelfetchers will be wrong! */ - const GLuint mesaFormat = texImage->TexFormat->MesaFormat; + const GLuint mesaFormat = texImage->TexFormat; GLuint srcRowStride = _mesa_compressed_row_stride(mesaFormat, width); GLuint destRowStride = _mesa_compressed_row_stride(mesaFormat, @@ -1698,7 +1705,7 @@ tdfxCompressedTexSubImage2D( GLcontext *ctx, GLenum target, GLint destRowStride, srcRowStride; GLint i, rows; GLubyte *dest; - const GLuint mesaFormat = texImage->TexFormat->MesaFormat; + const GLuint mesaFormat = texImage->TexFormat; if (TDFX_DEBUG & DEBUG_VERBOSE_DRI) { fprintf(stderr, "tdfxCompressedTexSubImage2D: id=%d\n", texObj->Name); diff --git a/src/mesa/drivers/dri/unichrome/via_tex.c b/src/mesa/drivers/dri/unichrome/via_tex.c index f700994025..b6be06d1ee 100644 --- a/src/mesa/drivers/dri/unichrome/via_tex.c +++ b/src/mesa/drivers/dri/unichrome/via_tex.c @@ -49,7 +49,7 @@ #include "via_ioctl.h" #include "via_3d_reg.h" -static const struct gl_texture_format * +static gl_format viaChooseTexFormat( GLcontext *ctx, GLint internalFormat, GLenum format, GLenum type ) { @@ -66,56 +66,56 @@ viaChooseTexFormat( GLcontext *ctx, GLint internalFormat, if ( format == GL_BGRA ) { if ( type == GL_UNSIGNED_INT_8_8_8_8_REV || type == GL_UNSIGNED_BYTE ) { - return &_mesa_texformat_argb8888; + return MESA_FORMAT_ARGB8888; } else if ( type == GL_UNSIGNED_SHORT_4_4_4_4_REV ) { - return &_mesa_texformat_argb4444; + return MESA_FORMAT_ARGB4444; } else if ( type == GL_UNSIGNED_SHORT_1_5_5_5_REV ) { - return &_mesa_texformat_argb1555; + return MESA_FORMAT_ARGB1555; } } else if ( type == GL_UNSIGNED_BYTE || type == GL_UNSIGNED_INT_8_8_8_8_REV || type == GL_UNSIGNED_INT_8_8_8_8 ) { - return &_mesa_texformat_argb8888; + return MESA_FORMAT_ARGB8888; } - return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444; + return do32bpt ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_ARGB4444; case 3: case GL_RGB: case GL_COMPRESSED_RGB: if ( format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5 ) { - return &_mesa_texformat_rgb565; + return MESA_FORMAT_RGB565; } else if ( type == GL_UNSIGNED_BYTE ) { - return &_mesa_texformat_argb8888; + return MESA_FORMAT_ARGB8888; } - return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_rgb565; + return do32bpt ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_RGB565; case GL_RGBA8: case GL_RGB10_A2: case GL_RGBA12: case GL_RGBA16: - return &_mesa_texformat_argb8888; + return MESA_FORMAT_ARGB8888; case GL_RGBA4: case GL_RGBA2: - return &_mesa_texformat_argb4444; + return MESA_FORMAT_ARGB4444; case GL_RGB5_A1: - return &_mesa_texformat_argb1555; + return MESA_FORMAT_ARGB1555; case GL_RGB8: case GL_RGB10: case GL_RGB12: case GL_RGB16: - return &_mesa_texformat_argb8888; + return MESA_FORMAT_ARGB8888; case GL_RGB5: case GL_RGB4: case GL_R3_G3_B2: - return &_mesa_texformat_rgb565; + return MESA_FORMAT_RGB565; case GL_ALPHA: case GL_ALPHA4: @@ -123,7 +123,7 @@ viaChooseTexFormat( GLcontext *ctx, GLint internalFormat, case GL_ALPHA12: case GL_ALPHA16: case GL_COMPRESSED_ALPHA: - return &_mesa_texformat_a8; + return MESA_FORMAT_A8; case 1: case GL_LUMINANCE: @@ -132,7 +132,7 @@ viaChooseTexFormat( GLcontext *ctx, GLint internalFormat, case GL_LUMINANCE12: case GL_LUMINANCE16: case GL_COMPRESSED_LUMINANCE: - return &_mesa_texformat_l8; + return MESA_FORMAT_L8; case 2: case GL_LUMINANCE_ALPHA: @@ -143,7 +143,7 @@ viaChooseTexFormat( GLcontext *ctx, GLint internalFormat, case GL_LUMINANCE12_ALPHA12: case GL_LUMINANCE16_ALPHA16: case GL_COMPRESSED_LUMINANCE_ALPHA: - return &_mesa_texformat_al88; + return MESA_FORMAT_AL88; case GL_INTENSITY: case GL_INTENSITY4: @@ -151,35 +151,35 @@ viaChooseTexFormat( GLcontext *ctx, GLint internalFormat, case GL_INTENSITY12: case GL_INTENSITY16: case GL_COMPRESSED_INTENSITY: - return &_mesa_texformat_i8; + return MESA_FORMAT_I8; case GL_YCBCR_MESA: if (type == GL_UNSIGNED_SHORT_8_8_MESA || type == GL_UNSIGNED_BYTE) - return &_mesa_texformat_ycbcr; + return MESA_FORMAT_YCBCR; else - return &_mesa_texformat_ycbcr_rev; + return MESA_FORMAT_YCBCR_REV; case GL_COMPRESSED_RGB_FXT1_3DFX: - return &_mesa_texformat_rgb_fxt1; + return MESA_FORMAT_RGB_FXT1; case GL_COMPRESSED_RGBA_FXT1_3DFX: - return &_mesa_texformat_rgba_fxt1; + return MESA_FORMAT_RGBA_FXT1; case GL_RGB_S3TC: case GL_RGB4_S3TC: case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: - return &_mesa_texformat_rgb_dxt1; + return MESA_FORMAT_RGB_DXT1; case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: - return &_mesa_texformat_rgba_dxt1; + return MESA_FORMAT_RGBA_DXT1; case GL_RGBA_S3TC: case GL_RGBA4_S3TC: case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: - return &_mesa_texformat_rgba_dxt3; + return MESA_FORMAT_RGBA_DXT3; case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: - return &_mesa_texformat_rgba_dxt5; + return MESA_FORMAT_RGBA_DXT5; case GL_COLOR_INDEX: case GL_COLOR_INDEX1_EXT: @@ -188,16 +188,16 @@ viaChooseTexFormat( GLcontext *ctx, GLint internalFormat, case GL_COLOR_INDEX8_EXT: case GL_COLOR_INDEX12_EXT: case GL_COLOR_INDEX16_EXT: - return &_mesa_texformat_ci8; + return MESA_FORMAT_CI8; default: fprintf(stderr, "unexpected texture format %s in %s\n", _mesa_lookup_enum_by_nr(internalFormat), __FUNCTION__); - return NULL; + return MESA_FORMAT_NONE; } - return NULL; /* never get here */ + return MESA_FORMAT_NONE; /* never get here */ } static int logbase2(int n) @@ -458,7 +458,7 @@ static GLboolean viaSetTexImages(GLcontext *ctx, GLuint widthExp = 0; GLuint heightExp = 0; - switch (baseImage->image.TexFormat->MesaFormat) { + switch (baseImage->image.TexFormat) { case MESA_FORMAT_ARGB8888: texFormat = HC_HTXnFM_ARGB8888; break; @@ -692,7 +692,7 @@ static void viaTexImage(GLcontext *ctx, _mesa_set_fetch_functions(texImage, dims); - texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); + texelBytes = _mesa_get_format_bytes(texImage->TexFormat); if (texelBytes == 0) { /* compressed format */ @@ -700,7 +700,7 @@ static void viaTexImage(GLcontext *ctx, texImage->CompressedSize = ctx->Driver.CompressedTextureSize(ctx, texImage->Width, texImage->Height, texImage->Depth, - texImage->TexFormat->MesaFormat); + texImage->TexFormat); } /* Minimum pitch of 32 bytes */ @@ -794,10 +794,10 @@ static void viaTexImage(GLcontext *ctx, GLboolean success; if (texImage->IsCompressed) { - dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, width); + dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat, width); } else { - dstRowStride = postConvWidth * _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); + dstRowStride = postConvWidth * _mesa_get_format_bytes(texImage->TexFormat); } success = _mesa_texstore(ctx, dims, texImage->_BaseFormat, diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c index 354015af1d..a64b6a5553 100644 --- a/src/mesa/drivers/glide/fxddtex.c +++ b/src/mesa/drivers/glide/fxddtex.c @@ -1016,7 +1016,7 @@ PrintTexture(int w, int h, int c, const GLubyte * data) #endif -const struct gl_texture_format * +gl_format fxDDChooseTextureFormat( GLcontext *ctx, GLint internalFormat, GLenum srcFormat, GLenum srcType ) { @@ -1033,31 +1033,31 @@ fxDDChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case 3: case GL_RGB: if ( srcFormat == GL_RGB && srcType == GL_UNSIGNED_SHORT_5_6_5 ) { - return &_mesa_texformat_rgb565; + return MESA_FORMAT_RGB565; } /* intentional fall through */ case GL_RGB8: case GL_RGB10: case GL_RGB12: case GL_RGB16: - return (allow32bpt) ? &_mesa_texformat_argb8888 - : &_mesa_texformat_rgb565; + return (allow32bpt) ? MESA_FORMAT_ARGB8888 + : MESA_FORMAT_RGB565; case GL_RGBA2: case GL_RGBA4: - return &_mesa_texformat_argb4444; + return MESA_FORMAT_ARGB4444; case GL_COMPRESSED_RGBA: /* intentional fall through */ case 4: case GL_RGBA: if ( srcFormat == GL_BGRA ) { if ( srcType == GL_UNSIGNED_INT_8_8_8_8_REV ) { - return &_mesa_texformat_argb8888; + return MESA_FORMAT_ARGB8888; } else if ( srcType == GL_UNSIGNED_SHORT_4_4_4_4_REV ) { - return &_mesa_texformat_argb4444; + return MESA_FORMAT_ARGB4444; } else if ( srcType == GL_UNSIGNED_SHORT_1_5_5_5_REV ) { - return &_mesa_texformat_argb1555; + return MESA_FORMAT_ARGB1555; } } /* intentional fall through */ @@ -1065,15 +1065,15 @@ fxDDChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_RGB10_A2: case GL_RGBA12: case GL_RGBA16: - return (allow32bpt) ? &_mesa_texformat_argb8888 - : &_mesa_texformat_argb4444; + return (allow32bpt) ? MESA_FORMAT_ARGB8888 + : MESA_FORMAT_ARGB4444; case GL_INTENSITY: case GL_INTENSITY4: case GL_INTENSITY8: case GL_INTENSITY12: case GL_INTENSITY16: case GL_COMPRESSED_INTENSITY: - return &_mesa_texformat_i8; + return MESA_FORMAT_I8; case 1: case GL_LUMINANCE: case GL_LUMINANCE4: @@ -1081,14 +1081,14 @@ fxDDChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_LUMINANCE12: case GL_LUMINANCE16: case GL_COMPRESSED_LUMINANCE: - return &_mesa_texformat_l8; + return MESA_FORMAT_L8; case GL_ALPHA: case GL_ALPHA4: case GL_ALPHA8: case GL_ALPHA12: case GL_ALPHA16: case GL_COMPRESSED_ALPHA: - return &_mesa_texformat_a8; + return MESA_FORMAT_A8; case GL_COLOR_INDEX: case GL_COLOR_INDEX1_EXT: case GL_COLOR_INDEX2_EXT: @@ -1096,7 +1096,7 @@ fxDDChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_COLOR_INDEX8_EXT: case GL_COLOR_INDEX12_EXT: case GL_COLOR_INDEX16_EXT: - return &_mesa_texformat_ci8; + return MESA_FORMAT_CI8; case 2: case GL_LUMINANCE_ALPHA: case GL_LUMINANCE4_ALPHA4: @@ -1106,35 +1106,35 @@ fxDDChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_LUMINANCE12_ALPHA12: case GL_LUMINANCE16_ALPHA16: case GL_COMPRESSED_LUMINANCE_ALPHA: - return &_mesa_texformat_al88; + return MESA_FORMAT_AL88; case GL_R3_G3_B2: case GL_RGB4: case GL_RGB5: - return &_mesa_texformat_rgb565; + return MESA_FORMAT_RGB565; case GL_RGB5_A1: - return &_mesa_texformat_argb1555; + return MESA_FORMAT_ARGB1555; /* GL_EXT_texture_compression_s3tc */ /* GL_S3_s3tc */ case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: case GL_RGB_S3TC: case GL_RGB4_S3TC: - return &_mesa_texformat_rgb_dxt1; + return MESA_FORMAT_RGB_DXT1; case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: - return &_mesa_texformat_rgba_dxt1; + return MESA_FORMAT_RGBA_DXT1; case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: case GL_RGBA_S3TC: case GL_RGBA4_S3TC: - return &_mesa_texformat_rgba_dxt3; + return MESA_FORMAT_RGBA_DXT3; case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: - return &_mesa_texformat_rgba_dxt5; + return MESA_FORMAT_RGBA_DXT5; /* GL_3DFX_texture_compression_FXT1 */ case GL_COMPRESSED_RGB_FXT1_3DFX: - return &_mesa_texformat_rgb_fxt1; + return MESA_FORMAT_RGB_FXT1; case GL_COMPRESSED_RGBA_FXT1_3DFX: - return &_mesa_texformat_rgba_fxt1; + return MESA_FORMAT_RGBA_FXT1; default: _mesa_problem(NULL, "unexpected format in fxDDChooseTextureFormat"); - return NULL; + return MESA_FORMAT_NONE; } } diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c index e2d4aa9b2d..5b00b5b82c 100644 --- a/src/mesa/drivers/x11/xm_dd.c +++ b/src/mesa/drivers/x11/xm_dd.c @@ -1019,15 +1019,15 @@ test_proxy_teximage(GLcontext *ctx, GLenum target, GLint level, /** * In SW, we don't really compress GL_COMPRESSED_RGB[A] textures! */ -static const struct gl_texture_format * +static gl_format choose_tex_format( GLcontext *ctx, GLint internalFormat, GLenum format, GLenum type ) { switch (internalFormat) { case GL_COMPRESSED_RGB_ARB: - return &_mesa_texformat_rgb; + return MESA_FORMAT_RGB; case GL_COMPRESSED_RGBA_ARB: - return &_mesa_texformat_rgba; + return MESA_FORMAT_RGBA; default: return _mesa_choose_tex_format(ctx, internalFormat, format, type); } diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index ce5e158626..9131f20f52 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -184,8 +184,8 @@ struct dd_function_table { * functions. The driver should examine \p internalFormat and return a * pointer to an appropriate gl_texture_format. */ - const struct gl_texture_format *(*ChooseTextureFormat)( GLcontext *ctx, - GLint internalFormat, GLenum srcFormat, GLenum srcType ); + GLuint (*ChooseTextureFormat)( GLcontext *ctx, GLint internalFormat, + GLenum srcFormat, GLenum srcType ); /** * Called by glTexImage1D(). diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 8492c8561d..391180a7c6 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -315,7 +315,7 @@ dump_texture_cb(GLuint id, void *data, void *userData) if (texImg) { _mesa_printf(" Image %u: %d x %d x %d, format %u at %p\n", i, texImg->Width, texImg->Height, texImg->Depth, - texImg->TexFormat->MesaFormat, texImg->Data); + texImg->TexFormat, texImg->Data); if (DumpImages && !written) { GLuint face = 0; write_texture_image(texObj, face, i); diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 04419da6e5..6610725de8 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -384,7 +384,7 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format, return; } - baseFormat = _mesa_get_format_base_format(texImage->TexFormat->MesaFormat); + baseFormat = _mesa_get_format_base_format(texImage->TexFormat); if (format == GL_COLOR) { if (baseFormat != GL_RGB && @@ -393,7 +393,7 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format, att->Complete = GL_FALSE; return; } - if (_mesa_is_format_compressed(texImage->TexFormat->MesaFormat)) { + if (_mesa_is_format_compressed(texImage->TexFormat)) { att_incomplete("compressed internalformat"); att->Complete = GL_FALSE; return; diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index c02c705228..7e99a5d3de 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -1561,7 +1561,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, } else { /* uncompressed */ - convertFormat = srcImage->TexFormat->MesaFormat; + convertFormat = srcImage->TexFormat; } _mesa_format_to_type_and_comps(convertFormat, &datatype, &comps); @@ -1620,7 +1620,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, = ctx->Driver.CompressedTextureSize(ctx, dstImage->Width, dstImage->Height, dstImage->Depth, - dstImage->TexFormat->MesaFormat); + dstImage->TexFormat); ASSERT(dstImage->CompressedSize > 0); } @@ -1642,7 +1642,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, ASSERT(dstData); } else { - bytesPerTexel = _mesa_get_format_bytes(dstImage->TexFormat->MesaFormat); + bytesPerTexel = _mesa_get_format_bytes(dstImage->TexFormat); ASSERT(dstWidth * dstHeight * dstDepth * bytesPerTexel > 0); dstImage->Data = _mesa_alloc_texmemory(dstWidth * dstHeight * dstDepth * bytesPerTexel); @@ -1666,7 +1666,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, /* compress image from dstData into dstImage->Data */ const GLenum srcFormat = _mesa_get_format_base_format(convertFormat); GLint dstRowStride - = _mesa_compressed_row_stride(dstImage->TexFormat->MesaFormat, dstWidth); + = _mesa_compressed_row_stride(dstImage->TexFormat, dstWidth); ASSERT(srcFormat == GL_RGB || srcFormat == GL_RGBA); _mesa_texstore(ctx, 2, dstImage->_BaseFormat, diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index d448e3e158..56d5e9fafd 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1200,7 +1200,7 @@ struct gl_texture_image GLboolean IsClientData; /**< Data owned by client? */ GLboolean _IsPowerOfTwo; /**< Are all dimensions powers of two? */ - const struct gl_texture_format *TexFormat; + GLuint TexFormat; /**< XXX Really gl_format */ struct gl_texture_object *TexObject; /**< Pointer back to parent object */ diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c index c401f82be0..54e24fd297 100644 --- a/src/mesa/main/texcompress_fxt1.c +++ b/src/mesa/main/texcompress_fxt1.c @@ -74,7 +74,7 @@ _mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS) const GLint texWidth = dstRowStride * 8 / 16; /* a bit of a hack */ const GLchan *tempImage = NULL; - ASSERT(dstFormat == &_mesa_texformat_rgb_fxt1); + ASSERT(dstFormat == MESA_FORMAT_RGB_FXT1); ASSERT(dstXoffset % 8 == 0); ASSERT(dstYoffset % 4 == 0); ASSERT(dstZoffset == 0); @@ -88,7 +88,7 @@ _mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS) /* convert image to RGB/GLchan */ tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + _mesa_get_format_base_format(dstFormat), srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -106,7 +106,7 @@ _mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS) } dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0, - dstFormat->MesaFormat, + dstFormat, texWidth, (GLubyte *) dstAddr); fxt1_encode(srcWidth, srcHeight, 3, pixels, srcRowStride, @@ -131,7 +131,7 @@ _mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS) GLint texWidth = dstRowStride * 8 / 16; /* a bit of a hack */ const GLchan *tempImage = NULL; - ASSERT(dstFormat == &_mesa_texformat_rgba_fxt1); + ASSERT(dstFormat == MESA_FORMAT_RGBA_FXT1); ASSERT(dstXoffset % 8 == 0); ASSERT(dstYoffset % 4 == 0); ASSERT(dstZoffset == 0); @@ -145,7 +145,7 @@ _mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS) /* convert image to RGBA/GLchan */ tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + _mesa_get_format_base_format(dstFormat), srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -163,7 +163,7 @@ _mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS) } dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0, - dstFormat->MesaFormat, + dstFormat, texWidth, (GLubyte *) dstAddr); fxt1_encode(srcWidth, srcHeight, 4, pixels, srcRowStride, diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c index 2294fdca73..69e43af0fd 100644 --- a/src/mesa/main/texcompress_s3tc.c +++ b/src/mesa/main/texcompress_s3tc.c @@ -165,7 +165,7 @@ _mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS) const GLint texWidth = dstRowStride * 4 / 8; /* a bit of a hack */ const GLchan *tempImage = NULL; - ASSERT(dstFormat == &_mesa_texformat_rgb_dxt1); + ASSERT(dstFormat == MESA_FORMAT_RGB_DXT1); ASSERT(dstXoffset % 4 == 0); ASSERT(dstYoffset % 4 == 0); ASSERT(dstZoffset % 4 == 0); @@ -179,7 +179,7 @@ _mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS) /* convert image to RGB/GLchan */ tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + _mesa_get_format_base_format(dstFormat), srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -197,7 +197,7 @@ _mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS) } dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0, - dstFormat->MesaFormat, + dstFormat, texWidth, (GLubyte *) dstAddr); if (ext_tx_compress_dxtn) { @@ -228,7 +228,7 @@ _mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS) const GLint texWidth = dstRowStride * 4 / 8; /* a bit of a hack */ const GLchan *tempImage = NULL; - ASSERT(dstFormat == &_mesa_texformat_rgba_dxt1); + ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT1); ASSERT(dstXoffset % 4 == 0); ASSERT(dstYoffset % 4 == 0); ASSERT(dstZoffset % 4 == 0); @@ -242,7 +242,7 @@ _mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS) /* convert image to RGBA/GLchan */ tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + _mesa_get_format_base_format(dstFormat), srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -260,7 +260,7 @@ _mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS) } dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0, - dstFormat->MesaFormat, + dstFormat, texWidth, (GLubyte *) dstAddr); if (ext_tx_compress_dxtn) { (*ext_tx_compress_dxtn)(4, srcWidth, srcHeight, pixels, @@ -290,7 +290,7 @@ _mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS) const GLint texWidth = dstRowStride * 4 / 16; /* a bit of a hack */ const GLchan *tempImage = NULL; - ASSERT(dstFormat == &_mesa_texformat_rgba_dxt3); + ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT3); ASSERT(dstXoffset % 4 == 0); ASSERT(dstYoffset % 4 == 0); ASSERT(dstZoffset % 4 == 0); @@ -304,7 +304,7 @@ _mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS) /* convert image to RGBA/GLchan */ tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + _mesa_get_format_base_format(dstFormat), srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -321,7 +321,7 @@ _mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS) } dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0, - dstFormat->MesaFormat, + dstFormat, texWidth, (GLubyte *) dstAddr); if (ext_tx_compress_dxtn) { (*ext_tx_compress_dxtn)(4, srcWidth, srcHeight, pixels, @@ -351,7 +351,7 @@ _mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS) const GLint texWidth = dstRowStride * 4 / 16; /* a bit of a hack */ const GLchan *tempImage = NULL; - ASSERT(dstFormat == &_mesa_texformat_rgba_dxt5); + ASSERT(dstFormat == MESA_FORMAT_RGBA_DXT5); ASSERT(dstXoffset % 4 == 0); ASSERT(dstYoffset % 4 == 0); ASSERT(dstZoffset % 4 == 0); @@ -365,7 +365,7 @@ _mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS) /* convert image to RGBA/GLchan */ tempImage = _mesa_make_temp_chan_image(ctx, dims, baseInternalFormat, - dstFormat->BaseFormat, + _mesa_get_format_base_format(dstFormat), srcWidth, srcHeight, srcDepth, srcFormat, srcType, srcAddr, srcPacking); @@ -382,7 +382,7 @@ _mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS) } dst = _mesa_compressed_image_address(dstXoffset, dstYoffset, 0, - dstFormat->MesaFormat, + dstFormat, texWidth, (GLubyte *) dstAddr); if (ext_tx_compress_dxtn) { (*ext_tx_compress_dxtn)(4, srcWidth, srcHeight, pixels, diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index 60b2065a6c..019193f134 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -130,7 +130,7 @@ static void store_null_texel(struct gl_texture_image *texImage, /***************************************************************/ /** \name Default GLchan-based formats */ /*@{*/ - +#if 0 const struct gl_texture_format _mesa_texformat_rgba = { MESA_FORMAT_RGBA, /* MesaFormat */ GL_RGBA, /* BaseFormat */ @@ -1016,6 +1016,7 @@ const struct gl_texture_format _mesa_null_texformat = { 0, /* StencilBits */ 0, /* TexelBytes */ }; +#endif /*@}*/ @@ -1035,7 +1036,7 @@ const struct gl_texture_format _mesa_null_texformat = { * This is called via dd_function_table::ChooseTextureFormat. Hardware drivers * will typically override this function with a specialized version. */ -const struct gl_texture_format * +gl_format _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, GLenum format, GLenum type ) { @@ -1049,15 +1050,15 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, case GL_RGB10_A2: case GL_RGBA12: case GL_RGBA16: - return &_mesa_texformat_rgba; + return MESA_FORMAT_RGBA; case GL_RGBA8: - return &_mesa_texformat_rgba8888; + return MESA_FORMAT_RGBA8888; case GL_RGB5_A1: - return &_mesa_texformat_argb1555; + return MESA_FORMAT_ARGB1555; case GL_RGBA2: - return &_mesa_texformat_argb4444_rev; /* just to test another format*/ + return MESA_FORMAT_ARGB4444_REV; /* just to test another format*/ case GL_RGBA4: - return &_mesa_texformat_argb4444; + return MESA_FORMAT_ARGB4444; /* RGB formats */ case 3: @@ -1065,24 +1066,24 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, case GL_RGB10: case GL_RGB12: case GL_RGB16: - return &_mesa_texformat_rgb; + return MESA_FORMAT_RGB; case GL_RGB8: - return &_mesa_texformat_rgb888; + return MESA_FORMAT_RGB888; case GL_R3_G3_B2: - return &_mesa_texformat_rgb332; + return MESA_FORMAT_RGB332; case GL_RGB4: - return &_mesa_texformat_rgb565_rev; /* just to test another format */ + return MESA_FORMAT_RGB565_REV; /* just to test another format */ case GL_RGB5: - return &_mesa_texformat_rgb565; + return MESA_FORMAT_RGB565; /* Alpha formats */ case GL_ALPHA: case GL_ALPHA4: case GL_ALPHA12: case GL_ALPHA16: - return &_mesa_texformat_alpha; + return MESA_FORMAT_ALPHA; case GL_ALPHA8: - return &_mesa_texformat_a8; + return MESA_FORMAT_A8; /* Luminance formats */ case 1: @@ -1090,9 +1091,9 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, case GL_LUMINANCE4: case GL_LUMINANCE12: case GL_LUMINANCE16: - return &_mesa_texformat_luminance; + return MESA_FORMAT_LUMINANCE; case GL_LUMINANCE8: - return &_mesa_texformat_l8; + return MESA_FORMAT_L8; /* Luminance/Alpha formats */ case 2: @@ -1102,17 +1103,17 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, case GL_LUMINANCE12_ALPHA4: case GL_LUMINANCE12_ALPHA12: case GL_LUMINANCE16_ALPHA16: - return &_mesa_texformat_luminance_alpha; + return MESA_FORMAT_LUMINANCE_ALPHA; case GL_LUMINANCE8_ALPHA8: - return &_mesa_texformat_al88; + return MESA_FORMAT_AL88; case GL_INTENSITY: case GL_INTENSITY4: case GL_INTENSITY12: case GL_INTENSITY16: - return &_mesa_texformat_intensity; + return MESA_FORMAT_INTENSITY; case GL_INTENSITY8: - return &_mesa_texformat_i8; + return MESA_FORMAT_I8; case GL_COLOR_INDEX: case GL_COLOR_INDEX1_EXT: @@ -1121,7 +1122,7 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, case GL_COLOR_INDEX12_EXT: case GL_COLOR_INDEX16_EXT: case GL_COLOR_INDEX8_EXT: - return &_mesa_texformat_ci8; + return MESA_FORMAT_CI8; default: ; /* fallthrough */ @@ -1132,9 +1133,9 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT24: case GL_DEPTH_COMPONENT32: - return &_mesa_texformat_z32; + return MESA_FORMAT_Z32; case GL_DEPTH_COMPONENT16: - return &_mesa_texformat_z16; + return MESA_FORMAT_Z16; default: ; /* fallthrough */ } @@ -1142,35 +1143,35 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, switch (internalFormat) { case GL_COMPRESSED_ALPHA_ARB: - return &_mesa_texformat_alpha; + return MESA_FORMAT_ALPHA; case GL_COMPRESSED_LUMINANCE_ARB: - return &_mesa_texformat_luminance; + return MESA_FORMAT_LUMINANCE; case GL_COMPRESSED_LUMINANCE_ALPHA_ARB: - return &_mesa_texformat_luminance_alpha; + return MESA_FORMAT_LUMINANCE_ALPHA; case GL_COMPRESSED_INTENSITY_ARB: - return &_mesa_texformat_intensity; + return MESA_FORMAT_INTENSITY; case GL_COMPRESSED_RGB_ARB: #if FEATURE_texture_fxt1 if (ctx->Extensions.TDFX_texture_compression_FXT1) - return &_mesa_texformat_rgb_fxt1; + return MESA_FORMAT_RGB_FXT1; #endif #if FEATURE_texture_s3tc if (ctx->Extensions.EXT_texture_compression_s3tc || ctx->Extensions.S3_s3tc) - return &_mesa_texformat_rgb_dxt1; + return MESA_FORMAT_RGB_DXT1; #endif - return &_mesa_texformat_rgb; + return MESA_FORMAT_RGB; case GL_COMPRESSED_RGBA_ARB: #if FEATURE_texture_fxt1 if (ctx->Extensions.TDFX_texture_compression_FXT1) - return &_mesa_texformat_rgba_fxt1; + return MESA_FORMAT_RGBA_FXT1; #endif #if FEATURE_texture_s3tc if (ctx->Extensions.EXT_texture_compression_s3tc || ctx->Extensions.S3_s3tc) - return &_mesa_texformat_rgba_dxt3; /* Not rgba_dxt1, see spec */ + return MESA_FORMAT_RGBA_DXT3; /* Not rgba_dxt1, see spec */ #endif - return &_mesa_texformat_rgba; + return MESA_FORMAT_RGBA; default: ; /* fallthrough */ } @@ -1178,9 +1179,9 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, if (ctx->Extensions.MESA_ycbcr_texture) { if (internalFormat == GL_YCBCR_MESA) { if (type == GL_UNSIGNED_SHORT_8_8_MESA) - return &_mesa_texformat_ycbcr; + return MESA_FORMAT_YCBCR; else - return &_mesa_texformat_ycbcr_rev; + return MESA_FORMAT_YCBCR_REV; } } @@ -1188,9 +1189,9 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, if (ctx->Extensions.TDFX_texture_compression_FXT1) { switch (internalFormat) { case GL_COMPRESSED_RGB_FXT1_3DFX: - return &_mesa_texformat_rgb_fxt1; + return MESA_FORMAT_RGB_FXT1; case GL_COMPRESSED_RGBA_FXT1_3DFX: - return &_mesa_texformat_rgba_fxt1; + return MESA_FORMAT_RGBA_FXT1; default: ; /* fallthrough */ } @@ -1201,13 +1202,13 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, if (ctx->Extensions.EXT_texture_compression_s3tc) { switch (internalFormat) { case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: - return &_mesa_texformat_rgb_dxt1; + return MESA_FORMAT_RGB_DXT1; case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: - return &_mesa_texformat_rgba_dxt1; + return MESA_FORMAT_RGBA_DXT1; case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: - return &_mesa_texformat_rgba_dxt3; + return MESA_FORMAT_RGBA_DXT3; case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: - return &_mesa_texformat_rgba_dxt5; + return MESA_FORMAT_RGBA_DXT5; default: ; /* fallthrough */ } @@ -1217,10 +1218,10 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, switch (internalFormat) { case GL_RGB_S3TC: case GL_RGB4_S3TC: - return &_mesa_texformat_rgb_dxt1; + return MESA_FORMAT_RGB_DXT1; case GL_RGBA_S3TC: case GL_RGBA4_S3TC: - return &_mesa_texformat_rgba_dxt3; + return MESA_FORMAT_RGBA_DXT3; default: ; /* fallthrough */ } @@ -1230,29 +1231,29 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, if (ctx->Extensions.ARB_texture_float) { switch (internalFormat) { case GL_ALPHA16F_ARB: - return &_mesa_texformat_alpha_float16; + return MESA_FORMAT_ALPHA_FLOAT16; case GL_ALPHA32F_ARB: - return &_mesa_texformat_alpha_float32; + return MESA_FORMAT_ALPHA_FLOAT32; case GL_LUMINANCE16F_ARB: - return &_mesa_texformat_luminance_float16; + return MESA_FORMAT_LUMINANCE_FLOAT16; case GL_LUMINANCE32F_ARB: - return &_mesa_texformat_luminance_float32; + return MESA_FORMAT_LUMINANCE_FLOAT32; case GL_LUMINANCE_ALPHA16F_ARB: - return &_mesa_texformat_luminance_alpha_float16; + return MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16; case GL_LUMINANCE_ALPHA32F_ARB: - return &_mesa_texformat_luminance_alpha_float32; + return MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32; case GL_INTENSITY16F_ARB: - return &_mesa_texformat_intensity_float16; + return MESA_FORMAT_INTENSITY_FLOAT16; case GL_INTENSITY32F_ARB: - return &_mesa_texformat_intensity_float32; + return MESA_FORMAT_INTENSITY_FLOAT32; case GL_RGB16F_ARB: - return &_mesa_texformat_rgb_float16; + return MESA_FORMAT_RGB_FLOAT16; case GL_RGB32F_ARB: - return &_mesa_texformat_rgb_float32; + return MESA_FORMAT_RGB_FLOAT32; case GL_RGBA16F_ARB: - return &_mesa_texformat_rgba_float16; + return MESA_FORMAT_RGBA_FLOAT16; case GL_RGBA32F_ARB: - return &_mesa_texformat_rgba_float32; + return MESA_FORMAT_RGBA_FLOAT32; default: ; /* fallthrough */ } @@ -1262,7 +1263,7 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, switch (internalFormat) { case GL_DEPTH_STENCIL_EXT: case GL_DEPTH24_STENCIL8_EXT: - return &_mesa_texformat_z24_s8; + return MESA_FORMAT_Z24_S8; default: ; /* fallthrough */ } @@ -1272,7 +1273,7 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, switch (internalFormat) { case GL_DUDV_ATI: case GL_DU8DV8_ATI: - return &_mesa_texformat_dudv8; + return MESA_FORMAT_DUDV8; default: ; /* fallthrough */ } @@ -1282,7 +1283,7 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, switch (internalFormat) { case GL_RGBA_SNORM: case GL_RGBA8_SNORM: - return &_mesa_texformat_signed_rgba8888; + return MESA_FORMAT_SIGNED_RGBA8888; default: ; /* fallthrough */ } @@ -1294,48 +1295,48 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, switch (internalFormat) { case GL_SRGB_EXT: case GL_SRGB8_EXT: - return &_mesa_texformat_srgb8; + return MESA_FORMAT_SRGB8; case GL_SRGB_ALPHA_EXT: case GL_SRGB8_ALPHA8_EXT: - return &_mesa_texformat_srgba8; + return MESA_FORMAT_SRGBA8; case GL_SLUMINANCE_EXT: case GL_SLUMINANCE8_EXT: - return &_mesa_texformat_sl8; + return MESA_FORMAT_SL8; case GL_SLUMINANCE_ALPHA_EXT: case GL_SLUMINANCE8_ALPHA8_EXT: - return &_mesa_texformat_sla8; + return MESA_FORMAT_SLA8; case GL_COMPRESSED_SLUMINANCE_EXT: - return &_mesa_texformat_sl8; + return MESA_FORMAT_SL8; case GL_COMPRESSED_SLUMINANCE_ALPHA_EXT: - return &_mesa_texformat_sla8; + return MESA_FORMAT_SLA8; case GL_COMPRESSED_SRGB_EXT: #if FEATURE_texture_s3tc if (ctx->Extensions.EXT_texture_compression_s3tc) - return &_mesa_texformat_srgb_dxt1; + return MESA_FORMAT_SRGB_DXT1; #endif - return &_mesa_texformat_srgb8; + return MESA_FORMAT_SRGB8; case GL_COMPRESSED_SRGB_ALPHA_EXT: #if FEATURE_texture_s3tc if (ctx->Extensions.EXT_texture_compression_s3tc) - return &_mesa_texformat_srgba_dxt3; /* Not srgba_dxt1, see spec */ + return MESA_FORMAT_SRGBA_DXT3; /* Not srgba_dxt1, see spec */ #endif - return &_mesa_texformat_srgba8; + return MESA_FORMAT_SRGBA8; #if FEATURE_texture_s3tc case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: if (ctx->Extensions.EXT_texture_compression_s3tc) - return &_mesa_texformat_srgb_dxt1; + return MESA_FORMAT_SRGB_DXT1; break; case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: if (ctx->Extensions.EXT_texture_compression_s3tc) - return &_mesa_texformat_srgba_dxt1; + return MESA_FORMAT_SRGBA_DXT1; break; case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: if (ctx->Extensions.EXT_texture_compression_s3tc) - return &_mesa_texformat_srgba_dxt3; + return MESA_FORMAT_SRGBA_DXT3; break; case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: if (ctx->Extensions.EXT_texture_compression_s3tc) - return &_mesa_texformat_srgba_dxt5; + return MESA_FORMAT_SRGBA_DXT5; break; #endif default: @@ -1345,7 +1346,7 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, #endif /* FEATURE_EXT_texture_sRGB */ _mesa_problem(ctx, "unexpected format in _mesa_choose_tex_format()"); - return NULL; + return MESA_FORMAT_NONE; } diff --git a/src/mesa/main/texformat.h b/src/mesa/main/texformat.h index 638eadff97..9095726ac2 100644 --- a/src/mesa/main/texformat.h +++ b/src/mesa/main/texformat.h @@ -39,7 +39,7 @@ #include "mtypes.h" #include "formats.h" - +#if 0 /** GLchan-valued formats */ /*@{*/ extern const struct gl_texture_format _mesa_texformat_rgba; @@ -143,9 +143,9 @@ extern const struct gl_texture_format _mesa_texformat_rgba_dxt5; /*@{*/ extern const struct gl_texture_format _mesa_null_texformat; /*@}*/ +#endif - -extern const struct gl_texture_format * +extern gl_format _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, GLenum format, GLenum type ); diff --git a/src/mesa/main/texformat_tmp.h b/src/mesa/main/texformat_tmp.h index eb160deff9..cb8386bbc8 100644 --- a/src/mesa/main/texformat_tmp.h +++ b/src/mesa/main/texformat_tmp.h @@ -1424,7 +1424,7 @@ static void FETCH(f_z24_s8)( const struct gl_texture_image *texImage, const GLuint *src = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); const GLfloat scale = 1.0F / (GLfloat) 0xffffff; texel[0] = ((*src) >> 8) * scale; - ASSERT(texImage->TexFormat->MesaFormat == MESA_FORMAT_Z24_S8); + ASSERT(texImage->TexFormat == MESA_FORMAT_Z24_S8); ASSERT(texel[0] >= 0.0F); ASSERT(texel[0] <= 1.0F); } @@ -1451,7 +1451,7 @@ static void FETCH(f_s8_z24)( const struct gl_texture_image *texImage, const GLuint *src = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); const GLfloat scale = 1.0F / (GLfloat) 0xffffff; texel[0] = ((*src) & 0x00ffffff) * scale; - ASSERT(texImage->TexFormat->MesaFormat == MESA_FORMAT_S8_Z24); + ASSERT(texImage->TexFormat == MESA_FORMAT_S8_Z24); ASSERT(texel[0] >= 0.0F); ASSERT(texel[0] <= 1.0F); } diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index 2575d0d868..e9e408d8c5 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -49,7 +49,7 @@ static GLboolean is_srgb_teximage(const struct gl_texture_image *texImage) { - switch (texImage->TexFormat->MesaFormat) { + switch (texImage->TexFormat) { case MESA_FORMAT_SRGB8: case MESA_FORMAT_SRGBA8: case MESA_FORMAT_SARGB8: @@ -160,7 +160,7 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, if (format == GL_COLOR_INDEX) { GLuint indexRow[MAX_WIDTH]; GLint col; - GLuint indexBits = _mesa_get_format_bits(texImage->TexFormat->MesaFormat, GL_TEXTURE_INDEX_SIZE_EXT); + GLuint indexBits = _mesa_get_format_bits(texImage->TexFormat, GL_TEXTURE_INDEX_SIZE_EXT); /* Can't use FetchTexel here because that returns RGBA */ if (indexBits == 8) { const GLubyte *src = (const GLubyte *) texImage->Data; @@ -210,9 +210,9 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, (const GLushort *) texImage->Data + row * rowstride, width * sizeof(GLushort)); /* check for byte swapping */ - if ((texImage->TexFormat->MesaFormat == MESA_FORMAT_YCBCR + if ((texImage->TexFormat == MESA_FORMAT_YCBCR && type == GL_UNSIGNED_SHORT_8_8_REV_MESA) || - (texImage->TexFormat->MesaFormat == MESA_FORMAT_YCBCR_REV + (texImage->TexFormat == MESA_FORMAT_YCBCR_REV && type == GL_UNSIGNED_SHORT_8_8_MESA)) { if (!ctx->Pack.SwapBytes) _mesa_swap2((GLushort *) dest, width); @@ -259,7 +259,7 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, GLint col; GLbitfield transferOps = 0x0; GLenum dataType = - _mesa_get_format_datatype(texImage->TexFormat->MesaFormat); + _mesa_get_format_datatype(texImage->TexFormat); /* clamp does not apply to GetTexImage (final conversion)? * Looks like we need clamp though when going from format @@ -350,7 +350,7 @@ _mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level, /* don't use texImage->CompressedSize since that may be padded out */ size = _mesa_compressed_texture_size(ctx, texImage->Width, texImage->Height, texImage->Depth, - texImage->TexFormat->MesaFormat); + texImage->TexFormat); /* just memcpy, no pixelstore or pixel transfer */ _mesa_memcpy(img, texImage->Data, size); @@ -439,7 +439,7 @@ getteximage_error_check(GLcontext *ctx, GLenum target, GLint level, return GL_TRUE; } - baseFormat = _mesa_get_format_base_format(texImage->TexFormat->MesaFormat); + baseFormat = _mesa_get_format_base_format(texImage->TexFormat); /* Make sure the requested image format is compatible with the * texture's format. Note that a color index texture can be converted diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 465da6b046..c4e5ce2682 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -900,7 +900,7 @@ clear_teximage_fields(struct gl_texture_image *img) img->HeightLog2 = 0; img->DepthLog2 = 0; img->Data = NULL; - img->TexFormat = &_mesa_null_texformat; + img->TexFormat = MESA_FORMAT_NONE; img->FetchTexelc = NULL; img->FetchTexelf = NULL; img->IsCompressed = 0; @@ -2232,8 +2232,8 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat, _mesa_init_teximage_fields(ctx, target, texImage, postConvWidth, 1, 1, border, internalFormat); - texImage->TexFormat = (*ctx->Driver.ChooseTextureFormat)(ctx, - internalFormat, format, type); + texImage->TexFormat = + ctx->Driver.ChooseTextureFormat(ctx, internalFormat, format, type); } } else { @@ -2352,8 +2352,8 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, _mesa_init_teximage_fields(ctx, target, texImage, postConvWidth, postConvHeight, 1, border, internalFormat); - texImage->TexFormat = (*ctx->Driver.ChooseTextureFormat)(ctx, - internalFormat, format, type); + texImage->TexFormat = + ctx->Driver.ChooseTextureFormat(ctx, internalFormat, format, type); } } else { @@ -2456,8 +2456,8 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat, /* no error, set the tex image parameters */ _mesa_init_teximage_fields(ctx, target, texImage, width, height, depth, border, internalFormat); - texImage->TexFormat = (*ctx->Driver.ChooseTextureFormat)(ctx, - internalFormat, format, type); + texImage->TexFormat = + ctx->Driver.ChooseTextureFormat(ctx, internalFormat, format, type); } } else { diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index d38d5a4c23..a9df1dac15 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -765,7 +765,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, goto out; } - texFormat = img->TexFormat->MesaFormat; + texFormat = img->TexFormat; isProxy = _mesa_is_proxy_texture(target); diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c index 54e5668abc..81bb1d40ff 100644 --- a/src/mesa/main/texrender.c +++ b/src/mesa/main/texrender.c @@ -470,7 +470,7 @@ update_wrapper(GLcontext *ctx, const struct gl_renderbuffer_attachment *att) trb->TexImage = att->Texture->Image[att->CubeMapFace][att->TextureLevel]; ASSERT(trb->TexImage); - trb->Store = _mesa_get_texel_store_func(trb->TexImage->TexFormat->MesaFormat); + trb->Store = _mesa_get_texel_store_func(trb->TexImage->TexFormat); if (!trb->Store) { /* we'll never draw into some textures (compressed formats) */ trb->Store = store_nop; @@ -485,21 +485,21 @@ update_wrapper(GLcontext *ctx, const struct gl_renderbuffer_attachment *att) trb->Zoffset = att->Zoffset; } - texFormat = trb->TexImage->TexFormat->MesaFormat; + texFormat = trb->TexImage->TexFormat; trb->Base.Width = trb->TexImage->Width; trb->Base.Height = trb->TexImage->Height; trb->Base.InternalFormat = trb->TexImage->InternalFormat; /* XXX may need more special cases here */ - if (trb->TexImage->TexFormat->MesaFormat == MESA_FORMAT_Z24_S8) { + if (trb->TexImage->TexFormat == MESA_FORMAT_Z24_S8) { trb->Base._ActualFormat = GL_DEPTH24_STENCIL8_EXT; trb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT; } - else if (trb->TexImage->TexFormat->MesaFormat == MESA_FORMAT_Z16) { + else if (trb->TexImage->TexFormat == MESA_FORMAT_Z16) { trb->Base._ActualFormat = GL_DEPTH_COMPONENT; trb->Base.DataType = GL_UNSIGNED_SHORT; } - else if (trb->TexImage->TexFormat->MesaFormat == MESA_FORMAT_Z32) { + else if (trb->TexImage->TexFormat == MESA_FORMAT_Z32) { trb->Base._ActualFormat = GL_DEPTH_COMPONENT; trb->Base.DataType = GL_UNSIGNED_INT; } diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index ca298bb237..02e3df89cf 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -932,7 +932,7 @@ _mesa_swizzle_ubyte_image(GLcontext *ctx, static void memcpy_texture(GLcontext *ctx, GLuint dimensions, - const struct gl_texture_format *dstFormat, + gl_format dstFormat, GLvoid *dstAddr, GLint dstXoffset, GLint dstYoffset, GLint dstZoffset, GLint dstRowStride, @@ -948,7 +948,7 @@ memcpy_texture(GLcontext *ctx, srcWidth, srcHeight, srcFormat, srcType); const GLubyte *srcImage = (const GLubyte *) _mesa_image_address(dimensions, srcPacking, srcAddr, srcWidth, srcHeight, srcFormat, srcType, 0, 0, 0); - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); const GLint bytesPerRow = srcWidth * texelBytes; #if 0 @@ -1017,15 +1017,15 @@ static GLboolean _mesa_texstore_rgba(TEXSTORE_PARAMS) { const GLint components = _mesa_components_in_format(baseInternalFormat); - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); - const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); - - ASSERT(dstFormat == &_mesa_texformat_rgba || - dstFormat == &_mesa_texformat_rgb || - dstFormat == &_mesa_texformat_alpha || - dstFormat == &_mesa_texformat_luminance || - dstFormat == &_mesa_texformat_luminance_alpha || - dstFormat == &_mesa_texformat_intensity); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); + + ASSERT(dstFormat == MESA_FORMAT_RGBA || + dstFormat == MESA_FORMAT_RGB || + dstFormat == MESA_FORMAT_ALPHA || + dstFormat == MESA_FORMAT_LUMINANCE || + dstFormat == MESA_FORMAT_LUMINANCE_ALPHA || + dstFormat == MESA_FORMAT_INTENSITY); ASSERT(baseInternalFormat == GL_RGBA || baseInternalFormat == GL_RGB || baseInternalFormat == GL_ALPHA || @@ -1048,7 +1048,7 @@ _mesa_texstore_rgba(TEXSTORE_PARAMS) } else if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_rgb && + dstFormat == MESA_FORMAT_RGB && srcFormat == GL_RGBA && srcType == CHAN_TYPE) { /* extract RGB from RGBA */ @@ -1089,27 +1089,27 @@ _mesa_texstore_rgba(TEXSTORE_PARAMS) /* dstmap - how to swizzle from RGBA to dst format: */ - if (dstFormat == &_mesa_texformat_rgba) { + if (dstFormat == MESA_FORMAT_RGBA) { dstmap = mappings[IDX_RGBA].from_rgba; components = 4; } - else if (dstFormat == &_mesa_texformat_rgb) { + else if (dstFormat == MESA_FORMAT_RGB) { dstmap = mappings[IDX_RGB].from_rgba; components = 3; } - else if (dstFormat == &_mesa_texformat_alpha) { + else if (dstFormat == MESA_FORMAT_ALPHA) { dstmap = mappings[IDX_ALPHA].from_rgba; components = 1; } - else if (dstFormat == &_mesa_texformat_luminance) { + else if (dstFormat == MESA_FORMAT_LUMINANCE) { dstmap = mappings[IDX_LUMINANCE].from_rgba; components = 1; } - else if (dstFormat == &_mesa_texformat_luminance_alpha) { + else if (dstFormat == MESA_FORMAT_LUMINANCE_ALPHA) { dstmap = mappings[IDX_LUMINANCE_ALPHA].from_rgba; components = 2; } - else if (dstFormat == &_mesa_texformat_intensity) { + else if (dstFormat == MESA_FORMAT_INTENSITY) { dstmap = mappings[IDX_INTENSITY].from_rgba; components = 1; } @@ -1168,9 +1168,9 @@ static GLboolean _mesa_texstore_z32(TEXSTORE_PARAMS) { const GLuint depthScale = 0xffffffff; - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); (void) dims; - ASSERT(dstFormat == &_mesa_texformat_z32); + ASSERT(dstFormat == MESA_FORMAT_Z32); ASSERT(texelBytes == sizeof(GLuint)); if (ctx->Pixel.DepthScale == 1.0f && @@ -1217,9 +1217,9 @@ static GLboolean _mesa_texstore_z16(TEXSTORE_PARAMS) { const GLuint depthScale = 0xffff; - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); (void) dims; - ASSERT(dstFormat == &_mesa_texformat_z16); + ASSERT(dstFormat == MESA_FORMAT_Z16); ASSERT(texelBytes == sizeof(GLushort)); if (ctx->Pixel.DepthScale == 1.0f && @@ -1265,16 +1265,16 @@ _mesa_texstore_z16(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_rgb565(TEXSTORE_PARAMS) { - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); - const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == &_mesa_texformat_rgb565 || - dstFormat == &_mesa_texformat_rgb565_rev); + ASSERT(dstFormat == MESA_FORMAT_RGB565 || + dstFormat == MESA_FORMAT_RGB565_REV); ASSERT(texelBytes == 2); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_rgb565 && + dstFormat == MESA_FORMAT_RGB565 && baseInternalFormat == GL_RGB && srcFormat == GL_RGB && srcType == GL_UNSIGNED_SHORT_5_6_5) { @@ -1306,7 +1306,7 @@ _mesa_texstore_rgb565(TEXSTORE_PARAMS) const GLubyte *srcUB = (const GLubyte *) src; GLushort *dstUS = (GLushort *) dst; /* check for byteswapped format */ - if (dstFormat == &_mesa_texformat_rgb565) { + if (dstFormat == MESA_FORMAT_RGB565) { for (col = 0; col < srcWidth; col++) { dstUS[col] = PACK_COLOR_565( srcUB[0], srcUB[1], srcUB[2] ); srcUB += 3; @@ -1343,7 +1343,7 @@ _mesa_texstore_rgb565(TEXSTORE_PARAMS) for (row = 0; row < srcHeight; row++) { GLushort *dstUS = (GLushort *) dstRow; /* check for byteswapped format */ - if (dstFormat == &_mesa_texformat_rgb565) { + if (dstFormat == MESA_FORMAT_RGB565) { for (col = 0; col < srcWidth; col++) { dstUS[col] = PACK_COLOR_565( CHAN_TO_UBYTE(src[RCOMP]), CHAN_TO_UBYTE(src[GCOMP]), @@ -1375,16 +1375,16 @@ static GLboolean _mesa_texstore_rgba8888(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); - const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == &_mesa_texformat_rgba8888 || - dstFormat == &_mesa_texformat_rgba8888_rev); + ASSERT(dstFormat == MESA_FORMAT_RGBA8888 || + dstFormat == MESA_FORMAT_RGBA8888_REV); ASSERT(texelBytes == 4); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_rgba8888 && + dstFormat == MESA_FORMAT_RGBA8888 && baseInternalFormat == GL_RGBA && ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8) || (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && !littleEndian) || @@ -1400,7 +1400,7 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS) } else if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_rgba8888_rev && + dstFormat == MESA_FORMAT_RGBA8888_REV && baseInternalFormat == GL_RGBA && ((srcFormat == GL_RGBA && srcType == GL_UNSIGNED_INT_8_8_8_8_REV) || (srcFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE && littleEndian) || @@ -1425,8 +1425,8 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS) /* dstmap - how to swizzle from RGBA to dst format: */ - if ((littleEndian && dstFormat == &_mesa_texformat_rgba8888) || - (!littleEndian && dstFormat == &_mesa_texformat_rgba8888_rev)) { + if ((littleEndian && dstFormat == MESA_FORMAT_RGBA8888) || + (!littleEndian && dstFormat == MESA_FORMAT_RGBA8888_REV)) { dstmap[3] = 0; dstmap[2] = 1; dstmap[1] = 2; @@ -1469,7 +1469,7 @@ _mesa_texstore_rgba8888(TEXSTORE_PARAMS) + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLuint *dstUI = (GLuint *) dstRow; - if (dstFormat == &_mesa_texformat_rgba8888) { + if (dstFormat == MESA_FORMAT_RGBA8888) { for (col = 0; col < srcWidth; col++) { dstUI[col] = PACK_COLOR_8888( CHAN_TO_UBYTE(src[RCOMP]), CHAN_TO_UBYTE(src[GCOMP]), @@ -1500,16 +1500,16 @@ static GLboolean _mesa_texstore_argb8888(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); - const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == &_mesa_texformat_argb8888 || - dstFormat == &_mesa_texformat_argb8888_rev); + ASSERT(dstFormat == MESA_FORMAT_ARGB8888 || + dstFormat == MESA_FORMAT_ARGB8888_REV); ASSERT(texelBytes == 4); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_argb8888 && + dstFormat == MESA_FORMAT_ARGB8888 && baseInternalFormat == GL_RGBA && srcFormat == GL_BGRA && ((srcType == GL_UNSIGNED_BYTE && littleEndian) || @@ -1524,7 +1524,7 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) } else if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_argb8888_rev && + dstFormat == MESA_FORMAT_ARGB8888_REV && baseInternalFormat == GL_RGBA && srcFormat == GL_BGRA && ((srcType == GL_UNSIGNED_BYTE && !littleEndian) || @@ -1539,7 +1539,7 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) } else if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_argb8888 && + dstFormat == MESA_FORMAT_ARGB8888 && srcFormat == GL_RGB && (baseInternalFormat == GL_RGBA || baseInternalFormat == GL_RGB) && @@ -1569,7 +1569,7 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) } else if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_argb8888 && + dstFormat == MESA_FORMAT_ARGB8888 && srcFormat == GL_RGBA && baseInternalFormat == GL_RGBA && srcType == GL_UNSIGNED_BYTE) { @@ -1614,16 +1614,16 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) /* dstmap - how to swizzle from RGBA to dst format: */ - if ((littleEndian && dstFormat == &_mesa_texformat_argb8888) || - (!littleEndian && dstFormat == &_mesa_texformat_argb8888_rev)) { + if ((littleEndian && dstFormat == MESA_FORMAT_ARGB8888) || + (!littleEndian && dstFormat == MESA_FORMAT_ARGB8888_REV)) { dstmap[3] = 3; /* alpha */ dstmap[2] = 0; /* red */ dstmap[1] = 1; /* green */ dstmap[0] = 2; /* blue */ } else { - assert((littleEndian && dstFormat == &_mesa_texformat_argb8888_rev) || - (!littleEndian && dstFormat == &_mesa_texformat_argb8888)); + assert((littleEndian && dstFormat == MESA_FORMAT_ARGB8888_REV) || + (!littleEndian && dstFormat == MESA_FORMAT_ARGB8888)); dstmap[3] = 2; dstmap[2] = 1; dstmap[1] = 0; @@ -1662,7 +1662,7 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLuint *dstUI = (GLuint *) dstRow; - if (dstFormat == &_mesa_texformat_argb8888) { + if (dstFormat == MESA_FORMAT_ARGB8888) { for (col = 0; col < srcWidth; col++) { dstUI[col] = PACK_COLOR_8888( CHAN_TO_UBYTE(src[ACOMP]), CHAN_TO_UBYTE(src[RCOMP]), @@ -1693,10 +1693,10 @@ static GLboolean _mesa_texstore_rgb888(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); - const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == &_mesa_texformat_rgb888); + ASSERT(dstFormat == MESA_FORMAT_RGB888); ASSERT(texelBytes == 3); if (!ctx->_ImageTransferState && @@ -1820,10 +1820,10 @@ static GLboolean _mesa_texstore_bgr888(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); - const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == &_mesa_texformat_bgr888); + ASSERT(dstFormat == MESA_FORMAT_BGR888); ASSERT(texelBytes == 3); if (!ctx->_ImageTransferState && @@ -1926,15 +1926,15 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_rgba4444(TEXSTORE_PARAMS) { - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); - const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == &_mesa_texformat_rgba4444); + ASSERT(dstFormat == MESA_FORMAT_RGBA4444); ASSERT(texelBytes == 2); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_rgba4444 && + dstFormat == MESA_FORMAT_RGBA4444 && baseInternalFormat == GL_RGBA && srcFormat == GL_RGBA && srcType == GL_UNSIGNED_SHORT_4_4_4_4){ @@ -1984,16 +1984,16 @@ _mesa_texstore_rgba4444(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_argb4444(TEXSTORE_PARAMS) { - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); - const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == &_mesa_texformat_argb4444 || - dstFormat == &_mesa_texformat_argb4444_rev); + ASSERT(dstFormat == MESA_FORMAT_ARGB4444 || + dstFormat == MESA_FORMAT_ARGB4444_REV); ASSERT(texelBytes == 2); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_argb4444 && + dstFormat == MESA_FORMAT_ARGB4444 && baseInternalFormat == GL_RGBA && srcFormat == GL_BGRA && srcType == GL_UNSIGNED_SHORT_4_4_4_4_REV) { @@ -2025,7 +2025,7 @@ _mesa_texstore_argb4444(TEXSTORE_PARAMS) + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLushort *dstUS = (GLushort *) dstRow; - if (dstFormat == &_mesa_texformat_argb4444) { + if (dstFormat == MESA_FORMAT_ARGB4444) { for (col = 0; col < srcWidth; col++) { dstUS[col] = PACK_COLOR_4444( CHAN_TO_UBYTE(src[ACOMP]), CHAN_TO_UBYTE(src[RCOMP]), @@ -2054,15 +2054,15 @@ _mesa_texstore_argb4444(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_rgba5551(TEXSTORE_PARAMS) { - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); - const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == &_mesa_texformat_rgba5551); + ASSERT(dstFormat == MESA_FORMAT_RGBA5551); ASSERT(texelBytes == 2); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_rgba5551 && + dstFormat == MESA_FORMAT_RGBA5551 && baseInternalFormat == GL_RGBA && srcFormat == GL_RGBA && srcType == GL_UNSIGNED_SHORT_5_5_5_1) { @@ -2112,16 +2112,16 @@ _mesa_texstore_rgba5551(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_argb1555(TEXSTORE_PARAMS) { - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); - const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == &_mesa_texformat_argb1555 || - dstFormat == &_mesa_texformat_argb1555_rev); + ASSERT(dstFormat == MESA_FORMAT_ARGB1555 || + dstFormat == MESA_FORMAT_ARGB1555_REV); ASSERT(texelBytes == 2); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_argb1555 && + dstFormat == MESA_FORMAT_ARGB1555 && baseInternalFormat == GL_RGBA && srcFormat == GL_BGRA && srcType == GL_UNSIGNED_SHORT_1_5_5_5_REV) { @@ -2153,7 +2153,7 @@ _mesa_texstore_argb1555(TEXSTORE_PARAMS) + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLushort *dstUS = (GLushort *) dstRow; - if (dstFormat == &_mesa_texformat_argb1555) { + if (dstFormat == MESA_FORMAT_ARGB1555) { for (col = 0; col < srcWidth; col++) { dstUS[col] = PACK_COLOR_1555( CHAN_TO_UBYTE(src[ACOMP]), CHAN_TO_UBYTE(src[RCOMP]), @@ -2184,16 +2184,16 @@ static GLboolean _mesa_texstore_al88(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); - const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == &_mesa_texformat_al88 || - dstFormat == &_mesa_texformat_al88_rev); + ASSERT(dstFormat == MESA_FORMAT_AL88 || + dstFormat == MESA_FORMAT_AL88_REV); ASSERT(texelBytes == 2); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_al88 && + dstFormat == MESA_FORMAT_AL88 && baseInternalFormat == GL_LUMINANCE_ALPHA && srcFormat == GL_LUMINANCE_ALPHA && srcType == GL_UNSIGNED_BYTE && @@ -2216,8 +2216,8 @@ _mesa_texstore_al88(TEXSTORE_PARAMS) /* dstmap - how to swizzle from RGBA to dst format: */ - if ((littleEndian && dstFormat == &_mesa_texformat_al88) || - (!littleEndian && dstFormat == &_mesa_texformat_al88_rev)) { + if ((littleEndian && dstFormat == MESA_FORMAT_AL88) || + (!littleEndian && dstFormat == MESA_FORMAT_AL88_REV)) { dstmap[0] = 0; dstmap[1] = 3; } @@ -2258,7 +2258,7 @@ _mesa_texstore_al88(TEXSTORE_PARAMS) + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLushort *dstUS = (GLushort *) dstRow; - if (dstFormat == &_mesa_texformat_al88) { + if (dstFormat == MESA_FORMAT_AL88) { for (col = 0; col < srcWidth; col++) { /* src[0] is luminance, src[1] is alpha */ dstUS[col] = PACK_COLOR_88( CHAN_TO_UBYTE(src[1]), @@ -2286,10 +2286,10 @@ _mesa_texstore_al88(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_rgb332(TEXSTORE_PARAMS) { - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); - const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == &_mesa_texformat_rgb332); + ASSERT(dstFormat == MESA_FORMAT_RGB332); ASSERT(texelBytes == 1); if (!ctx->_ImageTransferState && @@ -2344,12 +2344,12 @@ _mesa_texstore_rgb332(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_a8(TEXSTORE_PARAMS) { - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); - const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == &_mesa_texformat_a8 || - dstFormat == &_mesa_texformat_l8 || - dstFormat == &_mesa_texformat_i8); + ASSERT(dstFormat == MESA_FORMAT_A8 || + dstFormat == MESA_FORMAT_L8 || + dstFormat == MESA_FORMAT_I8); ASSERT(texelBytes == 1); if (!ctx->_ImageTransferState && @@ -2373,7 +2373,7 @@ _mesa_texstore_a8(TEXSTORE_PARAMS) /* dstmap - how to swizzle from RGBA to dst format: */ - if (dstFormat == &_mesa_texformat_a8) { + if (dstFormat == MESA_FORMAT_A8) { dstmap[0] = 3; } else { @@ -2429,10 +2429,10 @@ _mesa_texstore_a8(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_ci8(TEXSTORE_PARAMS) { - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); (void) dims; (void) baseInternalFormat; - ASSERT(dstFormat == &_mesa_texformat_ci8); + ASSERT(dstFormat == MESA_FORMAT_CI8); ASSERT(texelBytes == 1); ASSERT(baseInternalFormat == GL_COLOR_INDEX); @@ -2471,18 +2471,18 @@ _mesa_texstore_ci8(TEXSTORE_PARAMS) /** - * Texstore for _mesa_texformat_ycbcr or _mesa_texformat_ycbcr_rev. + * Texstore for _mesa_texformat_ycbcr or _mesa_texformat_ycbcr_REV. */ static GLboolean _mesa_texstore_ycbcr(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); (void) ctx; (void) dims; (void) baseInternalFormat; - ASSERT((dstFormat == &_mesa_texformat_ycbcr) || - (dstFormat == &_mesa_texformat_ycbcr_rev)); + ASSERT((dstFormat == MESA_FORMAT_YCBCR) || + (dstFormat == MESA_FORMAT_YCBCR_REV)); ASSERT(texelBytes == 2); ASSERT(ctx->Extensions.MESA_ycbcr_texture); ASSERT(srcFormat == GL_YCBCR_MESA); @@ -2502,7 +2502,7 @@ _mesa_texstore_ycbcr(TEXSTORE_PARAMS) /* XXX the logic here _might_ be wrong */ if (srcPacking->SwapBytes ^ (srcType == GL_UNSIGNED_SHORT_8_8_REV_MESA) ^ - (dstFormat == &_mesa_texformat_ycbcr_rev) ^ + (dstFormat == MESA_FORMAT_YCBCR_REV) ^ !littleEndian) { GLint img, row; for (img = 0; img < srcDepth; img++) { @@ -2523,9 +2523,9 @@ static GLboolean _mesa_texstore_dudv8(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); - ASSERT(dstFormat == &_mesa_texformat_dudv8); + ASSERT(dstFormat == MESA_FORMAT_DUDV8); ASSERT(texelBytes == 2); ASSERT(ctx->Extensions.ATI_envmap_bumpmap); ASSERT((srcFormat == GL_DU8DV8_ATI) || @@ -2617,16 +2617,16 @@ static GLboolean _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); - const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == &_mesa_texformat_signed_rgba8888 || - dstFormat == &_mesa_texformat_signed_rgba8888_rev); + ASSERT(dstFormat == MESA_FORMAT_SIGNED_RGBA8888 || + dstFormat == MESA_FORMAT_SIGNED_RGBA8888_REV); ASSERT(texelBytes == 4); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_signed_rgba8888 && + dstFormat == MESA_FORMAT_SIGNED_RGBA8888 && baseInternalFormat == GL_RGBA && ((srcFormat == GL_RGBA && srcType == GL_BYTE && !littleEndian) || (srcFormat == GL_ABGR_EXT && srcType == GL_BYTE && littleEndian))) { @@ -2640,7 +2640,7 @@ _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS) } else if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == &_mesa_texformat_signed_rgba8888_rev && + dstFormat == MESA_FORMAT_SIGNED_RGBA8888_REV && baseInternalFormat == GL_RGBA && ((srcFormat == GL_RGBA && srcType == GL_BYTE && littleEndian) || (srcFormat == GL_ABGR_EXT && srcType == GL_BYTE && !littleEndian))) { @@ -2661,8 +2661,8 @@ _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS) /* dstmap - how to swizzle from RGBA to dst format: */ - if ((littleEndian && dstFormat == &_mesa_texformat_signed_rgba8888) || - (!littleEndian && dstFormat == &_mesa_texformat_signed_rgba8888_rev)) { + if ((littleEndian && dstFormat == MESA_FORMAT_SIGNED_RGBA8888) || + (!littleEndian && dstFormat == MESA_FORMAT_SIGNED_RGBA8888_REV)) { dstmap[3] = 0; dstmap[2] = 1; dstmap[1] = 2; @@ -2705,7 +2705,7 @@ _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS) + dstXoffset * texelBytes; for (row = 0; row < srcHeight; row++) { GLuint *dstUI = (GLuint *) dstRow; - if (dstFormat == &_mesa_texformat_signed_rgba8888) { + if (dstFormat == MESA_FORMAT_SIGNED_RGBA8888) { for (col = 0; col < srcWidth; col++) { dstUI[col] = PACK_COLOR_8888( FLOAT_TO_BYTE_TEX(srcRow[RCOMP]), FLOAT_TO_BYTE_TEX(srcRow[GCOMP]), @@ -2743,7 +2743,7 @@ _mesa_texstore_z24_s8(TEXSTORE_PARAMS) / sizeof(GLuint); GLint img, row; - ASSERT(dstFormat == &_mesa_texformat_z24_s8); + ASSERT(dstFormat == MESA_FORMAT_Z24_S8); ASSERT(srcFormat == GL_DEPTH_STENCIL_EXT || srcFormat == GL_DEPTH_COMPONENT); ASSERT(srcFormat != GL_DEPTH_STENCIL_EXT || srcType == GL_UNSIGNED_INT_24_8_EXT); @@ -2844,7 +2844,7 @@ _mesa_texstore_s8_z24(TEXSTORE_PARAMS) / sizeof(GLuint); GLint img, row; - ASSERT(dstFormat == &_mesa_texformat_s8_z24); + ASSERT(dstFormat == MESA_FORMAT_S8_Z24); ASSERT(srcFormat == GL_DEPTH_STENCIL_EXT || srcFormat == GL_DEPTH_COMPONENT); ASSERT(srcFormat != GL_DEPTH_STENCIL_EXT || srcType == GL_UNSIGNED_INT_24_8_EXT); @@ -2927,16 +2927,16 @@ _mesa_texstore_s8_z24(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_rgba_float32(TEXSTORE_PARAMS) { - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); - const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); const GLint components = _mesa_components_in_format(baseFormat); - ASSERT(dstFormat == &_mesa_texformat_rgba_float32 || - dstFormat == &_mesa_texformat_rgb_float32 || - dstFormat == &_mesa_texformat_alpha_float32 || - dstFormat == &_mesa_texformat_luminance_float32 || - dstFormat == &_mesa_texformat_luminance_alpha_float32 || - dstFormat == &_mesa_texformat_intensity_float32); + ASSERT(dstFormat == MESA_FORMAT_RGBA_FLOAT32 || + dstFormat == MESA_FORMAT_RGB_FLOAT32 || + dstFormat == MESA_FORMAT_ALPHA_FLOAT32 || + dstFormat == MESA_FORMAT_LUMINANCE_FLOAT32 || + dstFormat == MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32 || + dstFormat == MESA_FORMAT_INTENSITY_FLOAT32); ASSERT(baseInternalFormat == GL_RGBA || baseInternalFormat == GL_RGB || baseInternalFormat == GL_ALPHA || @@ -2996,16 +2996,16 @@ _mesa_texstore_rgba_float32(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_rgba_float16(TEXSTORE_PARAMS) { - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat->MesaFormat); - const GLenum baseFormat = _mesa_get_format_base_format(dstFormat->MesaFormat); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); const GLint components = _mesa_components_in_format(baseFormat); - ASSERT(dstFormat == &_mesa_texformat_rgba_float16 || - dstFormat == &_mesa_texformat_rgb_float16 || - dstFormat == &_mesa_texformat_alpha_float16 || - dstFormat == &_mesa_texformat_luminance_float16 || - dstFormat == &_mesa_texformat_luminance_alpha_float16 || - dstFormat == &_mesa_texformat_intensity_float16); + ASSERT(dstFormat == MESA_FORMAT_RGBA_FLOAT16 || + dstFormat == MESA_FORMAT_RGB_FLOAT16 || + dstFormat == MESA_FORMAT_ALPHA_FLOAT16 || + dstFormat == MESA_FORMAT_LUMINANCE_FLOAT16 || + dstFormat == MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16 || + dstFormat == MESA_FORMAT_INTENSITY_FLOAT16); ASSERT(baseInternalFormat == GL_RGBA || baseInternalFormat == GL_RGB || baseInternalFormat == GL_ALPHA || @@ -3065,13 +3065,13 @@ _mesa_texstore_rgba_float16(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_srgb8(TEXSTORE_PARAMS) { - const struct gl_texture_format *newDstFormat; + gl_format newDstFormat; GLboolean k; - ASSERT(dstFormat == &_mesa_texformat_srgb8); + ASSERT(dstFormat == MESA_FORMAT_SRGB8); /* reuse normal rgb texstore code */ - newDstFormat = &_mesa_texformat_rgb888; + newDstFormat = MESA_FORMAT_RGB888; k = _mesa_texstore_rgb888(ctx, dims, baseInternalFormat, newDstFormat, dstAddr, @@ -3087,13 +3087,13 @@ _mesa_texstore_srgb8(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_srgba8(TEXSTORE_PARAMS) { - const struct gl_texture_format *newDstFormat; + gl_format newDstFormat; GLboolean k; - ASSERT(dstFormat == &_mesa_texformat_srgba8); + ASSERT(dstFormat == MESA_FORMAT_SRGBA8); /* reuse normal rgba texstore code */ - newDstFormat = &_mesa_texformat_rgba8888; + newDstFormat = MESA_FORMAT_RGBA8888; k = _mesa_texstore_rgba8888(ctx, dims, baseInternalFormat, newDstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, @@ -3108,13 +3108,13 @@ _mesa_texstore_srgba8(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_sargb8(TEXSTORE_PARAMS) { - const struct gl_texture_format *newDstFormat; + gl_format newDstFormat; GLboolean k; - ASSERT(dstFormat == &_mesa_texformat_sargb8); + ASSERT(dstFormat == MESA_FORMAT_SARGB8); /* reuse normal rgba texstore code */ - newDstFormat = &_mesa_texformat_argb8888; + newDstFormat = MESA_FORMAT_ARGB8888; k = _mesa_texstore_argb8888(ctx, dims, baseInternalFormat, newDstFormat, dstAddr, @@ -3130,12 +3130,12 @@ _mesa_texstore_sargb8(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_sl8(TEXSTORE_PARAMS) { - const struct gl_texture_format *newDstFormat; + gl_format newDstFormat; GLboolean k; - ASSERT(dstFormat == &_mesa_texformat_sl8); + ASSERT(dstFormat == MESA_FORMAT_SL8); - newDstFormat = &_mesa_texformat_l8; + newDstFormat = MESA_FORMAT_L8; /* _mesa_textore_a8 handles luminance8 too */ k = _mesa_texstore_a8(ctx, dims, baseInternalFormat, @@ -3152,13 +3152,13 @@ _mesa_texstore_sl8(TEXSTORE_PARAMS) static GLboolean _mesa_texstore_sla8(TEXSTORE_PARAMS) { - const struct gl_texture_format *newDstFormat; + gl_format newDstFormat; GLboolean k; - ASSERT(dstFormat == &_mesa_texformat_sla8); + ASSERT(dstFormat == MESA_FORMAT_SLA8); /* reuse normal luminance/alpha texstore code */ - newDstFormat = &_mesa_texformat_al88; + newDstFormat = MESA_FORMAT_AL88; k = _mesa_texstore_al88(ctx, dims, baseInternalFormat, newDstFormat, dstAddr, @@ -3280,7 +3280,7 @@ _mesa_texstore(TEXSTORE_PARAMS) StoreTexImageFunc storeImage; GLboolean success; - storeImage = _mesa_get_texstore_func(dstFormat->MesaFormat); + storeImage = _mesa_get_texstore_func(dstFormat); assert(storeImage); @@ -3390,7 +3390,7 @@ fetch_texel_float_to_chan(const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLchan *texelOut) { GLfloat temp[4]; - GLenum baseFormat = _mesa_get_format_base_format(texImage->TexFormat->MesaFormat); + GLenum baseFormat = _mesa_get_format_base_format(texImage->TexFormat); ASSERT(texImage->FetchTexelf); texImage->FetchTexelf(texImage, i, j, k, temp); @@ -3417,7 +3417,7 @@ fetch_texel_chan_to_float(const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texelOut) { GLchan temp[4]; - GLenum baseFormat = _mesa_get_format_base_format(texImage->TexFormat->MesaFormat); + GLenum baseFormat = _mesa_get_format_base_format(texImage->TexFormat); ASSERT(texImage->FetchTexelc); texImage->FetchTexelc(texImage, i, j, k, temp); @@ -3446,7 +3446,7 @@ _mesa_set_fetch_functions(struct gl_texture_image *texImage, GLuint dims) ASSERT(texImage->TexFormat); texImage->FetchTexelf = - _mesa_get_texel_fetch_func(texImage->TexFormat->MesaFormat, dims); + _mesa_get_texel_fetch_func(texImage->TexFormat, dims); /* now check if we need to use a float/chan adaptor */ if (!texImage->FetchTexelc) { @@ -3466,13 +3466,13 @@ static void compute_texture_size(GLcontext *ctx, struct gl_texture_image *texImage) { texImage->IsCompressed = - _mesa_is_format_compressed(texImage->TexFormat->MesaFormat); + _mesa_is_format_compressed(texImage->TexFormat); if (texImage->IsCompressed) { texImage->CompressedSize = ctx->Driver.CompressedTextureSize(ctx, texImage->Width, texImage->Height, texImage->Depth, - texImage->TexFormat->MesaFormat); + texImage->TexFormat); } else { /* non-compressed format */ @@ -3513,7 +3513,7 @@ _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level, if (texImage->IsCompressed) sizeInBytes = texImage->CompressedSize; else - sizeInBytes = texImage->Width * _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); + sizeInBytes = texImage->Width * _mesa_get_format_bytes(texImage->TexFormat); texImage->Data = _mesa_alloc_texmemory(sizeInBytes); if (!texImage->Data) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D"); @@ -3578,7 +3578,7 @@ _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level, _mesa_set_fetch_functions(texImage, 2); compute_texture_size(ctx, texImage); - texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); + texelBytes = _mesa_get_format_bytes(texImage->TexFormat); /* allocate memory */ if (texImage->IsCompressed) @@ -3605,7 +3605,7 @@ _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level, if (texImage->IsCompressed) { dstRowStride - = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, width); + = _mesa_compressed_row_stride(texImage->TexFormat, width); } else { dstRowStride = texImage->RowStride * texelBytes; @@ -3654,7 +3654,7 @@ _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level, _mesa_set_fetch_functions(texImage, 3); compute_texture_size(ctx, texImage); - texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); + texelBytes = _mesa_get_format_bytes(texImage->TexFormat); /* allocate memory */ if (texImage->IsCompressed) @@ -3681,7 +3681,7 @@ _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level, if (texImage->IsCompressed) { dstRowStride - = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, width); + = _mesa_compressed_row_stride(texImage->TexFormat, width); } else { dstRowStride = texImage->RowStride * texelBytes; @@ -3770,12 +3770,12 @@ _mesa_store_texsubimage2d(GLcontext *ctx, GLenum target, GLint level, GLboolean success; if (texImage->IsCompressed) { - dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, + dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat, texImage->Width); } else { dstRowStride = texImage->RowStride * - _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); + _mesa_get_format_bytes(texImage->TexFormat); } success = _mesa_texstore(ctx, 2, texImage->_BaseFormat, @@ -3820,12 +3820,12 @@ _mesa_store_texsubimage3d(GLcontext *ctx, GLenum target, GLint level, GLboolean success; if (texImage->IsCompressed) { - dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, + dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat, texImage->Width); } else { dstRowStride = texImage->RowStride * - _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); + _mesa_get_format_bytes(texImage->TexFormat); } success = _mesa_texstore(ctx, 3, texImage->_BaseFormat, @@ -3985,7 +3985,7 @@ _mesa_store_compressed_texsubimage2d(GLcontext *ctx, GLenum target, GLint i, rows; GLubyte *dest; const GLubyte *src; - const gl_format texFormat = texImage->TexFormat->MesaFormat; + const gl_format texFormat = texImage->TexFormat; (void) format; diff --git a/src/mesa/main/texstore.h b/src/mesa/main/texstore.h index 4a217df103..2db076dfff 100644 --- a/src/mesa/main/texstore.h +++ b/src/mesa/main/texstore.h @@ -58,7 +58,7 @@ #define TEXSTORE_PARAMS \ GLcontext *ctx, GLuint dims, \ GLenum baseInternalFormat, \ - const struct gl_texture_format *dstFormat, \ + gl_format dstFormat, \ GLvoid *dstAddr, \ GLint dstXoffset, GLint dstYoffset, GLint dstZoffset, \ GLint dstRowStride, const GLuint *dstImageOffsets, \ diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 6da57e817b..081c09c1fb 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -338,7 +338,7 @@ make_texture(struct st_context *st, GLcontext *ctx = st->ctx; struct pipe_context *pipe = st->pipe; struct pipe_screen *screen = pipe->screen; - const struct gl_texture_format *mformat; + gl_format mformat; struct pipe_texture *pt; enum pipe_format pipeFormat; GLuint cpp; @@ -350,7 +350,7 @@ make_texture(struct st_context *st, mformat = st_ChooseTextureFormat(ctx, baseFormat, format, type); assert(mformat); - pipeFormat = st_mesa_format_to_pipe_format(mformat->MesaFormat); + pipeFormat = st_mesa_format_to_pipe_format(mformat); assert(pipeFormat); cpp = st_sizeof_format(pipeFormat); diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index d96484c439..716fbc8b29 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -95,9 +95,9 @@ gl_target_to_pipe(GLenum target) * format. */ static GLuint -compressed_num_bytes(GLuint mesaFormat) +compressed_num_bytes(gl_format format) { - switch(mesaFormat) { + switch (format) { #if FEATURE_texture_fxt1 case MESA_FORMAT_RGB_FXT1: case MESA_FORMAT_RGBA_FXT1: @@ -117,9 +117,9 @@ compressed_num_bytes(GLuint mesaFormat) static GLboolean -is_compressed_mesa_format(const struct gl_texture_format *format) +is_compressed_mesa_format(gl_format format) { - switch (format->MesaFormat) { + switch (format) { case MESA_FORMAT_RGB_DXT1: case MESA_FORMAT_RGBA_DXT1: case MESA_FORMAT_RGBA_DXT3: @@ -338,7 +338,7 @@ guess_and_alloc_texture(struct st_context *st, lastLevel = firstLevel + MAX2(MAX2(l2width, l2height), l2depth); } - fmt = st_mesa_format_to_pipe_format(stImage->base.TexFormat->MesaFormat); + fmt = st_mesa_format_to_pipe_format(stImage->base.TexFormat); usage = default_usage(fmt); @@ -411,7 +411,7 @@ compress_with_blit(GLcontext * ctx, const GLuint dstImageOffsets[1] = {0}; struct st_texture_image *stImage = st_texture_image(texImage); struct pipe_screen *screen = ctx->st->pipe->screen; - const struct gl_texture_format *mesa_format; + gl_format mesa_format; struct pipe_texture templ; struct pipe_texture *src_tex; struct pipe_surface *dst_surface; @@ -443,7 +443,7 @@ compress_with_blit(GLcontext * ctx, */ memset(&templ, 0, sizeof(templ)); templ.target = PIPE_TEXTURE_2D; - templ.format = st_mesa_format_to_pipe_format(mesa_format->MesaFormat); + templ.format = st_mesa_format_to_pipe_format(mesa_format); pf_get_block(templ.format, &templ.block); templ.width[0] = width; templ.height[0] = height; @@ -559,17 +559,17 @@ st_TexImage(GLcontext * ctx, _mesa_set_fetch_functions(texImage, dims); - if (_mesa_is_format_compressed(texImage->TexFormat->MesaFormat)) { + if (_mesa_is_format_compressed(texImage->TexFormat)) { /* must be a compressed format */ texelBytes = 0; texImage->IsCompressed = GL_TRUE; texImage->CompressedSize = ctx->Driver.CompressedTextureSize(ctx, texImage->Width, texImage->Height, texImage->Depth, - texImage->TexFormat->MesaFormat); + texImage->TexFormat); } else { - texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); + texelBytes = _mesa_get_format_bytes(texImage->TexFormat); /* Minimum pitch of 32 bytes */ if (postConvWidth * texelBytes < 32) { @@ -699,7 +699,7 @@ st_TexImage(GLcontext * ctx, if (texImage->IsCompressed) { sizeInBytes = texImage->CompressedSize; dstRowStride = - _mesa_compressed_row_stride(texImage->TexFormat->MesaFormat, width); + _mesa_compressed_row_stride(texImage->TexFormat, width); assert(dims != 3); } else { @@ -1824,10 +1824,10 @@ st_finalize_texture(GLcontext *ctx, /* FIXME: determine format block instead of cpp */ if (firstImage->base.IsCompressed) { - cpp = compressed_num_bytes(firstImage->base.TexFormat->MesaFormat); + cpp = compressed_num_bytes(firstImage->base.TexFormat); } else { - cpp = _mesa_get_format_bytes(firstImage->base.TexFormat->MesaFormat); + cpp = _mesa_get_format_bytes(firstImage->base.TexFormat); } /* If we already have a gallium texture, check that it matches the texture @@ -1835,7 +1835,7 @@ st_finalize_texture(GLcontext *ctx, */ if (stObj->pt) { const enum pipe_format fmt = - st_mesa_format_to_pipe_format(firstImage->base.TexFormat->MesaFormat); + st_mesa_format_to_pipe_format(firstImage->base.TexFormat); if (stObj->pt->target != gl_target_to_pipe(stObj->base.Target) || stObj->pt->format != fmt || stObj->pt->last_level < stObj->lastLevel || @@ -1854,7 +1854,7 @@ st_finalize_texture(GLcontext *ctx, */ if (!stObj->pt) { const enum pipe_format fmt = - st_mesa_format_to_pipe_format(firstImage->base.TexFormat->MesaFormat); + st_mesa_format_to_pipe_format(firstImage->base.TexFormat); GLuint usage = default_usage(fmt); stObj->pt = st_texture_create(ctx->st, diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index dcb90a3107..6f76e2d8c0 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -629,74 +629,74 @@ st_choose_renderbuffer_format(struct pipe_context *pipe, GLenum internalFormat) } -static const struct gl_texture_format * +static gl_format translate_gallium_format_to_mesa_format(enum pipe_format format) { switch (format) { case PIPE_FORMAT_A8R8G8B8_UNORM: - return &_mesa_texformat_argb8888; + return MESA_FORMAT_ARGB8888; case PIPE_FORMAT_A1R5G5B5_UNORM: - return &_mesa_texformat_argb1555; + return MESA_FORMAT_ARGB1555; case PIPE_FORMAT_A4R4G4B4_UNORM: - return &_mesa_texformat_argb4444; + return MESA_FORMAT_ARGB4444; case PIPE_FORMAT_R5G6B5_UNORM: - return &_mesa_texformat_rgb565; + return MESA_FORMAT_RGB565; case PIPE_FORMAT_A8L8_UNORM: - return &_mesa_texformat_al88; + return MESA_FORMAT_AL88; case PIPE_FORMAT_A8_UNORM: - return &_mesa_texformat_a8; + return MESA_FORMAT_A8; case PIPE_FORMAT_L8_UNORM: - return &_mesa_texformat_l8; + return MESA_FORMAT_L8; case PIPE_FORMAT_I8_UNORM: - return &_mesa_texformat_i8; + return MESA_FORMAT_I8; case PIPE_FORMAT_Z16_UNORM: - return &_mesa_texformat_z16; + return MESA_FORMAT_Z16; case PIPE_FORMAT_Z32_UNORM: - return &_mesa_texformat_z32; + return MESA_FORMAT_Z32; case PIPE_FORMAT_Z24S8_UNORM: - return &_mesa_texformat_z24_s8; + return MESA_FORMAT_Z24_S8; case PIPE_FORMAT_S8Z24_UNORM: - return &_mesa_texformat_s8_z24; + return MESA_FORMAT_S8_Z24; case PIPE_FORMAT_YCBCR: - return &_mesa_texformat_ycbcr; + return MESA_FORMAT_YCBCR; case PIPE_FORMAT_YCBCR_REV: - return &_mesa_texformat_ycbcr_rev; + return MESA_FORMAT_YCBCR_REV; #if FEATURE_texture_s3tc case PIPE_FORMAT_DXT1_RGB: - return &_mesa_texformat_rgb_dxt1; + return MESA_FORMAT_RGB_DXT1; case PIPE_FORMAT_DXT1_RGBA: - return &_mesa_texformat_rgba_dxt1; + return MESA_FORMAT_RGBA_DXT1; case PIPE_FORMAT_DXT3_RGBA: - return &_mesa_texformat_rgba_dxt3; + return MESA_FORMAT_RGBA_DXT3; case PIPE_FORMAT_DXT5_RGBA: - return &_mesa_texformat_rgba_dxt5; + return MESA_FORMAT_RGBA_DXT5; #if FEATURE_EXT_texture_sRGB case PIPE_FORMAT_DXT1_SRGB: - return &_mesa_texformat_srgb_dxt1; + return MESA_FORMAT_SRGB_DXT1; case PIPE_FORMAT_DXT1_SRGBA: - return &_mesa_texformat_srgba_dxt1; + return MESA_FORMAT_SRGBA_DXT1; case PIPE_FORMAT_DXT3_SRGBA: - return &_mesa_texformat_srgba_dxt3; + return MESA_FORMAT_SRGBA_DXT3; case PIPE_FORMAT_DXT5_SRGBA: - return &_mesa_texformat_srgba_dxt5; + return MESA_FORMAT_SRGBA_DXT5; #endif #endif #if FEATURE_EXT_texture_sRGB case PIPE_FORMAT_A8L8_SRGB: - return &_mesa_texformat_sla8; + return MESA_FORMAT_SLA8; case PIPE_FORMAT_L8_SRGB: - return &_mesa_texformat_sl8; + return MESA_FORMAT_SL8; case PIPE_FORMAT_R8G8B8_SRGB: - return &_mesa_texformat_srgb8; + return MESA_FORMAT_SRGB8; case PIPE_FORMAT_R8G8B8A8_SRGB: - return &_mesa_texformat_srgba8; + return MESA_FORMAT_SRGBA8; case PIPE_FORMAT_A8R8G8B8_SRGB: - return &_mesa_texformat_sargb8; + return MESA_FORMAT_SARGB8; #endif /* XXX add additional cases */ default: assert(0); - return NULL; + return MESA_FORMAT_NONE; } } @@ -704,7 +704,7 @@ translate_gallium_format_to_mesa_format(enum pipe_format format) /** * Called via ctx->Driver.chooseTextureFormat(). */ -const struct gl_texture_format * +gl_format st_ChooseTextureFormat(GLcontext *ctx, GLint internalFormat, GLenum format, GLenum type) { @@ -716,7 +716,7 @@ st_ChooseTextureFormat(GLcontext *ctx, GLint internalFormat, pFormat = st_choose_format(ctx->st->pipe, internalFormat, PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_SAMPLER); if (pFormat == PIPE_FORMAT_NONE) - return NULL; + return MESA_FORMAT_NONE; return translate_gallium_format_to_mesa_format(pFormat); } diff --git a/src/mesa/state_tracker/st_format.h b/src/mesa/state_tracker/st_format.h index 9d9e02fe9b..1a8c6ea98f 100644 --- a/src/mesa/state_tracker/st_format.h +++ b/src/mesa/state_tracker/st_format.h @@ -29,6 +29,7 @@ #ifndef ST_FORMAT_H #define ST_FORMAT_H +#include "main/formats.h" struct pipe_format_info { @@ -71,7 +72,7 @@ extern enum pipe_format st_choose_renderbuffer_format(struct pipe_context *pipe, GLenum internalFormat); -extern const struct gl_texture_format * +extern gl_format st_ChooseTextureFormat(GLcontext * ctx, GLint internalFormat, GLenum format, GLenum type); diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c index 63a6956a7a..58f6933652 100644 --- a/src/mesa/state_tracker/st_gen_mipmap.c +++ b/src/mesa/state_tracker/st_gen_mipmap.c @@ -115,7 +115,7 @@ fallback_generate_mipmap(GLcontext *ctx, GLenum target, assert(target != GL_TEXTURE_3D); /* not done yet */ - _mesa_format_to_type_and_comps(texObj->Image[face][baseLevel]->TexFormat->MesaFormat, + _mesa_format_to_type_and_comps(texObj->Image[face][baseLevel]->TexFormat, &datatype, &comps); for (dstLevel = baseLevel + 1; dstLevel <= lastLevel; dstLevel++) { diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c index bbc2830e69..1790e1b28d 100644 --- a/src/mesa/state_tracker/st_texture.c +++ b/src/mesa/state_tracker/st_texture.c @@ -128,7 +128,7 @@ st_texture_match_image(const struct pipe_texture *pt, /* Check if this image's format matches the established texture's format. */ - if (st_mesa_format_to_pipe_format(image->TexFormat->MesaFormat) != pt->format) + if (st_mesa_format_to_pipe_format(image->TexFormat) != pt->format) return GL_FALSE; /* Test if this image's size matches what's expected in the diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index 004d4e05ae..11c8f9256a 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -745,7 +745,7 @@ get_border_color(const struct gl_texture_object *tObj, const struct gl_texture_image *img, GLfloat rgba[4]) { - switch (img->TexFormat->BaseFormat) { + switch (img->_BaseFormat) { case GL_RGB: rgba[0] = tObj->BorderColor[0]; rgba[1] = tObj->BorderColor[1]; @@ -1152,7 +1152,7 @@ sample_2d_linear_repeat(GLcontext *ctx, ASSERT(tObj->WrapS == GL_REPEAT); ASSERT(tObj->WrapT == GL_REPEAT); ASSERT(img->Border == 0); - ASSERT(img->TexFormat->BaseFormat != GL_COLOR_INDEX); + ASSERT(img->_BaseFormat != GL_COLOR_INDEX); ASSERT(img->_IsPowerOfTwo); linear_repeat_texel_location(width, texcoord[0], &i0, &i1, &wi); @@ -1343,7 +1343,7 @@ opt_sample_rgb_2d(GLcontext *ctx, ASSERT(tObj->WrapS==GL_REPEAT); ASSERT(tObj->WrapT==GL_REPEAT); ASSERT(img->Border==0); - ASSERT(img->TexFormat->MesaFormat==MESA_FORMAT_RGB); + ASSERT(img->TexFormat == MESA_FORMAT_RGB); ASSERT(img->_IsPowerOfTwo); for (k=0; kWrapS==GL_REPEAT); ASSERT(tObj->WrapT==GL_REPEAT); ASSERT(img->Border==0); - ASSERT(img->TexFormat->MesaFormat==MESA_FORMAT_RGBA); + ASSERT(img->TexFormat == MESA_FORMAT_RGBA); ASSERT(img->_IsPowerOfTwo); for (i = 0; i < n; i++) { @@ -1414,7 +1414,7 @@ sample_lambda_2d(GLcontext *ctx, const GLboolean repeatNoBorderPOT = (tObj->WrapS == GL_REPEAT) && (tObj->WrapT == GL_REPEAT) && (tImg->Border == 0 && (tImg->Width == tImg->RowStride)) - && (tImg->TexFormat->BaseFormat != GL_COLOR_INDEX) + && (tImg->_BaseFormat != GL_COLOR_INDEX) && tImg->_IsPowerOfTwo; ASSERT(lambda != NULL); @@ -1427,7 +1427,7 @@ sample_lambda_2d(GLcontext *ctx, switch (tObj->MinFilter) { case GL_NEAREST: if (repeatNoBorderPOT) { - switch (tImg->TexFormat->MesaFormat) { + switch (tImg->TexFormat) { case MESA_FORMAT_RGB: opt_sample_rgb_2d(ctx, tObj, m, texcoords + minStart, NULL, rgba + minStart); @@ -1484,7 +1484,7 @@ sample_lambda_2d(GLcontext *ctx, switch (tObj->MagFilter) { case GL_NEAREST: if (repeatNoBorderPOT) { - switch (tImg->TexFormat->MesaFormat) { + switch (tImg->TexFormat) { case MESA_FORMAT_RGB: opt_sample_rgb_2d(ctx, tObj, m, texcoords + magStart, NULL, rgba + magStart); @@ -2152,7 +2152,7 @@ sample_nearest_rect(GLcontext *ctx, ASSERT(tObj->WrapT == GL_CLAMP || tObj->WrapT == GL_CLAMP_TO_EDGE || tObj->WrapT == GL_CLAMP_TO_BORDER); - ASSERT(img->TexFormat->BaseFormat != GL_COLOR_INDEX); + ASSERT(img->_BaseFormat != GL_COLOR_INDEX); for (i = 0; i < n; i++) { GLint row, col; @@ -2186,7 +2186,7 @@ sample_linear_rect(GLcontext *ctx, ASSERT(tObj->WrapT == GL_CLAMP || tObj->WrapT == GL_CLAMP_TO_EDGE || tObj->WrapT == GL_CLAMP_TO_BORDER); - ASSERT(img->TexFormat->BaseFormat != GL_COLOR_INDEX); + ASSERT(img->_BaseFormat != GL_COLOR_INDEX); for (i = 0; i < n; i++) { GLint i0, j0, i1, j1; @@ -2973,8 +2973,8 @@ sample_depth_texture( GLcontext *ctx, (void) lambda; - ASSERT(img->TexFormat->BaseFormat == GL_DEPTH_COMPONENT || - img->TexFormat->BaseFormat == GL_DEPTH_STENCIL_EXT); + ASSERT(img->_BaseFormat == GL_DEPTH_COMPONENT || + img->_BaseFormat == GL_DEPTH_STENCIL_EXT); ASSERT(tObj->Target == GL_TEXTURE_1D || tObj->Target == GL_TEXTURE_2D || @@ -3154,7 +3154,7 @@ _swrast_choose_texture_sample_func( GLcontext *ctx, } else { const GLboolean needLambda = (GLboolean) (t->MinFilter != t->MagFilter); - const GLenum format = t->Image[0][t->BaseLevel]->TexFormat->BaseFormat; + const GLenum format = t->Image[0][t->BaseLevel]->_BaseFormat; switch (t->Target) { case GL_TEXTURE_1D: @@ -3189,14 +3189,14 @@ _swrast_choose_texture_sample_func( GLcontext *ctx, t->WrapT == GL_REPEAT && img->_IsPowerOfTwo && img->Border == 0 && - img->TexFormat->MesaFormat == MESA_FORMAT_RGB) { + img->TexFormat == MESA_FORMAT_RGB) { return &opt_sample_rgb_2d; } else if (t->WrapS == GL_REPEAT && t->WrapT == GL_REPEAT && img->_IsPowerOfTwo && img->Border == 0 && - img->TexFormat->MesaFormat == MESA_FORMAT_RGBA) { + img->TexFormat == MESA_FORMAT_RGBA) { return &opt_sample_rgba_2d; } else { diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index 1ab0e19f92..7b59763f11 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -1055,11 +1055,11 @@ _swrast_choose_triangle( GLcontext *ctx ) const struct gl_texture_object *texObj2D; const struct gl_texture_image *texImg; GLenum minFilter, magFilter, envMode; - GLint format; + gl_format format; texObj2D = ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; texImg = texObj2D ? texObj2D->Image[0][texObj2D->BaseLevel] : NULL; - format = texImg ? texImg->TexFormat->MesaFormat : -1; + format = texImg ? texImg->TexFormat : -1; minFilter = texObj2D ? texObj2D->MinFilter : (GLenum) 0; magFilter = texObj2D ? texObj2D->MagFilter : (GLenum) 0; envMode = ctx->Texture.Unit[0].EnvMode; -- cgit v1.2.3 From bdc761b0f9c8856193de6e8617c566851d010783 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 30 Sep 2009 20:35:32 -0600 Subject: mesa: remove gl_texture_format --- src/mesa/main/mtypes.h | 34 -- src/mesa/main/texcompress_fxt1.c | 33 -- src/mesa/main/texcompress_s3tc.c | 129 ------ src/mesa/main/texformat.c | 908 --------------------------------------- src/mesa/main/texformat.h | 105 ----- 5 files changed, 1209 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 56d5e9fafd..1599a6f13f 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1136,40 +1136,6 @@ typedef void (*StoreTexelFunc)(struct gl_texture_image *texImage, const void *texel); -/** - * Texture format record - */ -struct gl_texture_format -{ - GLint MesaFormat; /**< One of the MESA_FORMAT_* values */ - - GLenum BaseFormat; /**< Either GL_RGB, GL_RGBA, GL_ALPHA, - * GL_LUMINANCE, GL_LUMINANCE_ALPHA, - * GL_INTENSITY, GL_COLOR_INDEX or - * GL_DEPTH_COMPONENT. - */ - GLenum DataType; /**< GL_FLOAT or GL_UNSIGNED_NORMALIZED_ARB */ - - /** - * Bits per texel component. These are just rough approximations - * for compressed texture formats. - */ - /*@{*/ - GLubyte RedBits; - GLubyte GreenBits; - GLubyte BlueBits; - GLubyte AlphaBits; - GLubyte LuminanceBits; - GLubyte IntensityBits; - GLubyte IndexBits; - GLubyte DepthBits; - GLubyte StencilBits; /**< GL_EXT_packed_depth_stencil */ - /*@}*/ - - GLuint TexelBytes; /**< Bytes per texel, 0 if compressed format */ -}; - - /** * Texture image state. Describes the dimensions of a texture image, * the texel format and pointers to Texel Fetch functions. diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c index 54e24fd297..7a30806b60 100644 --- a/src/mesa/main/texcompress_fxt1.c +++ b/src/mesa/main/texcompress_fxt1.c @@ -226,39 +226,6 @@ _mesa_fetch_texel_2d_f_rgb_fxt1( const struct gl_texture_image *texImage, -const struct gl_texture_format _mesa_texformat_rgb_fxt1 = { - MESA_FORMAT_RGB_FXT1, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /*approx*/ /* RedBits */ - 4, /*approx*/ /* GreenBits */ - 4, /*approx*/ /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 0 /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_rgba_fxt1 = { - MESA_FORMAT_RGBA_FXT1, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /*approx*/ /* RedBits */ - 4, /*approx*/ /* GreenBits */ - 4, /*approx*/ /* BlueBits */ - 1, /*approx*/ /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 0 /* TexelBytes */ -}; - - /***************************************************************************\ * FXT1 encoder * diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c index 69e43af0fd..2f7168c622 100644 --- a/src/mesa/main/texcompress_s3tc.c +++ b/src/mesa/main/texcompress_s3tc.c @@ -567,132 +567,3 @@ _mesa_fetch_texel_2d_f_srgba_dxt5(const struct gl_texture_image *texImage, } #endif -const struct gl_texture_format _mesa_texformat_rgb_dxt1 = { - MESA_FORMAT_RGB_DXT1, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /*approx*/ /* RedBits */ - 4, /*approx*/ /* GreenBits */ - 4, /*approx*/ /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 0, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_rgba_dxt1 = { - MESA_FORMAT_RGBA_DXT1, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /*approx*/ /* RedBits */ - 4, /*approx*/ /* GreenBits */ - 4, /*approx*/ /* BlueBits */ - 1, /*approx*/ /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 0, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_rgba_dxt3 = { - MESA_FORMAT_RGBA_DXT3, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /*approx*/ /* RedBits */ - 4, /*approx*/ /* GreenBits */ - 4, /*approx*/ /* BlueBits */ - 4, /*approx*/ /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 0, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_rgba_dxt5 = { - MESA_FORMAT_RGBA_DXT5, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4,/*approx*/ /* RedBits */ - 4,/*approx*/ /* GreenBits */ - 4,/*approx*/ /* BlueBits */ - 4,/*approx*/ /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 0, /* TexelBytes */ -}; - -#if FEATURE_EXT_texture_sRGB -const struct gl_texture_format _mesa_texformat_srgb_dxt1 = { - MESA_FORMAT_SRGB_DXT1, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /*approx*/ /* RedBits */ - 4, /*approx*/ /* GreenBits */ - 4, /*approx*/ /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 0, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_srgba_dxt1 = { - MESA_FORMAT_SRGBA_DXT1, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /*approx*/ /* RedBits */ - 4, /*approx*/ /* GreenBits */ - 4, /*approx*/ /* BlueBits */ - 1, /*approx*/ /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 0, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_srgba_dxt3 = { - MESA_FORMAT_SRGBA_DXT3, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /*approx*/ /* RedBits */ - 4, /*approx*/ /* GreenBits */ - 4, /*approx*/ /* BlueBits */ - 4, /*approx*/ /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 0, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_srgba_dxt5 = { - MESA_FORMAT_SRGBA_DXT5, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4,/*approx*/ /* RedBits */ - 4,/*approx*/ /* GreenBits */ - 4,/*approx*/ /* BlueBits */ - 4,/*approx*/ /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 0, /* TexelBytes */ -}; -#endif diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index 019193f134..9290210b3f 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -113,914 +113,6 @@ static void store_null_texel(struct gl_texture_image *texImage, } -/** - * Notes about the predefined gl_texture_formats: - * - * 1. There are 1D, 2D and 3D functions for fetching texels from texture - * images, returning both GLchan values and GLfloat values. (six - * functions in total) - * You don't have to provide both the GLchan and GLfloat functions; - * just one or the other is OK. Mesa will use an "adaptor" to convert - * between GLchan/GLfloat when needed. - * Since the adaptors have small performance penalty, we provide both - * GLchan and GLfloat functions for some common formats like RGB, RGBA. - */ - - -/***************************************************************/ -/** \name Default GLchan-based formats */ -/*@{*/ -#if 0 -const struct gl_texture_format _mesa_texformat_rgba = { - MESA_FORMAT_RGBA, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - CHAN_BITS, /* RedBits */ - CHAN_BITS, /* GreenBits */ - CHAN_BITS, /* BlueBits */ - CHAN_BITS, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 4 * sizeof(GLchan), /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_rgb = { - MESA_FORMAT_RGB, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - CHAN_BITS, /* RedBits */ - CHAN_BITS, /* GreenBits */ - CHAN_BITS, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 3 * sizeof(GLchan), /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_alpha = { - MESA_FORMAT_ALPHA, /* MesaFormat */ - GL_ALPHA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - CHAN_BITS, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - sizeof(GLchan), /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_luminance = { - MESA_FORMAT_LUMINANCE, /* MesaFormat */ - GL_LUMINANCE, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - CHAN_BITS, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - sizeof(GLchan), /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_luminance_alpha = { - MESA_FORMAT_LUMINANCE_ALPHA, /* MesaFormat */ - GL_LUMINANCE_ALPHA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - CHAN_BITS, /* AlphaBits */ - CHAN_BITS, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2 * sizeof(GLchan), /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_intensity = { - MESA_FORMAT_INTENSITY, /* MesaFormat */ - GL_INTENSITY, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - CHAN_BITS, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - sizeof(GLchan), /* TexelBytes */ -}; - - -#if FEATURE_EXT_texture_sRGB - -const struct gl_texture_format _mesa_texformat_srgb8 = { - MESA_FORMAT_SRGB8, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 3, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_srgba8 = { - MESA_FORMAT_SRGBA8, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 8, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 4, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_sargb8 = { - MESA_FORMAT_SARGB8, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 8, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 4, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_sl8 = { - MESA_FORMAT_SL8, /* MesaFormat */ - GL_LUMINANCE, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 8, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1, /* TexelBytes */ -}; - -/* Note: this format name looks like a misnomer, make it sal8? */ -const struct gl_texture_format _mesa_texformat_sla8 = { - MESA_FORMAT_SLA8, /* MesaFormat */ - GL_LUMINANCE_ALPHA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 8, /* AlphaBits */ - 8, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ -}; - -#endif /* FEATURE_EXT_texture_sRGB */ - -const struct gl_texture_format _mesa_texformat_rgba_float32 = { - MESA_FORMAT_RGBA_FLOAT32, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 8 * sizeof(GLfloat), /* RedBits */ - 8 * sizeof(GLfloat), /* GreenBits */ - 8 * sizeof(GLfloat), /* BlueBits */ - 8 * sizeof(GLfloat), /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 4 * sizeof(GLfloat), /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_rgba_float16 = { - MESA_FORMAT_RGBA_FLOAT16, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 8 * sizeof(GLhalfARB), /* RedBits */ - 8 * sizeof(GLhalfARB), /* GreenBits */ - 8 * sizeof(GLhalfARB), /* BlueBits */ - 8 * sizeof(GLhalfARB), /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 4 * sizeof(GLhalfARB), /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_rgb_float32 = { - MESA_FORMAT_RGB_FLOAT32, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 8 * sizeof(GLfloat), /* RedBits */ - 8 * sizeof(GLfloat), /* GreenBits */ - 8 * sizeof(GLfloat), /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 3 * sizeof(GLfloat), /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_rgb_float16 = { - MESA_FORMAT_RGB_FLOAT16, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 8 * sizeof(GLhalfARB), /* RedBits */ - 8 * sizeof(GLhalfARB), /* GreenBits */ - 8 * sizeof(GLhalfARB), /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 3 * sizeof(GLhalfARB), /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_alpha_float32 = { - MESA_FORMAT_ALPHA_FLOAT32, /* MesaFormat */ - GL_ALPHA, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 8 * sizeof(GLfloat), /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1 * sizeof(GLfloat), /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_alpha_float16 = { - MESA_FORMAT_ALPHA_FLOAT16, /* MesaFormat */ - GL_ALPHA, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 8 * sizeof(GLhalfARB), /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1 * sizeof(GLhalfARB), /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_luminance_float32 = { - MESA_FORMAT_LUMINANCE_FLOAT32, /* MesaFormat */ - GL_LUMINANCE, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 8 * sizeof(GLfloat), /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1 * sizeof(GLfloat), /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_luminance_float16 = { - MESA_FORMAT_LUMINANCE_FLOAT16, /* MesaFormat */ - GL_LUMINANCE, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 8 * sizeof(GLhalfARB), /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1 * sizeof(GLhalfARB), /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_luminance_alpha_float32 = { - MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32, /* MesaFormat */ - GL_LUMINANCE_ALPHA, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 8 * sizeof(GLfloat), /* AlphaBits */ - 8 * sizeof(GLfloat), /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2 * sizeof(GLfloat), /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_luminance_alpha_float16 = { - MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16, /* MesaFormat */ - GL_LUMINANCE_ALPHA, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 8 * sizeof(GLhalfARB), /* AlphaBits */ - 8 * sizeof(GLhalfARB), /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2 * sizeof(GLhalfARB), /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_intensity_float32 = { - MESA_FORMAT_INTENSITY_FLOAT32, /* MesaFormat */ - GL_INTENSITY, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 8 * sizeof(GLfloat), /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1 * sizeof(GLfloat), /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_intensity_float16 = { - MESA_FORMAT_INTENSITY_FLOAT16, /* MesaFormat */ - GL_INTENSITY, /* BaseFormat */ - GL_FLOAT, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 8 * sizeof(GLhalfARB), /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1 * sizeof(GLhalfARB), /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_dudv8 = { - MESA_FORMAT_DUDV8, /* MesaFormat */ - GL_DUDV_ATI, /* BaseFormat */ - GL_SIGNED_NORMALIZED, /* DataType */ - /* maybe should add dudvBits field, but spec seems to be - lacking the ability to query with GetTexLevelParameter anyway */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_signed_rgba8888 = { - MESA_FORMAT_SIGNED_RGBA8888, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_SIGNED_NORMALIZED, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 8, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 4, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_signed_rgba8888_rev = { - MESA_FORMAT_SIGNED_RGBA8888_REV, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_SIGNED_NORMALIZED, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 8, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 4, /* TexelBytes */ -}; - -/*@}*/ - - -/***************************************************************/ -/** \name Hardware formats */ -/*@{*/ - -const struct gl_texture_format _mesa_texformat_rgba8888 = { - MESA_FORMAT_RGBA8888, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 8, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 4, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_rgba8888_rev = { - MESA_FORMAT_RGBA8888_REV, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 8, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 4, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_argb8888 = { - MESA_FORMAT_ARGB8888, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 8, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 4, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_argb8888_rev = { - MESA_FORMAT_ARGB8888_REV, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 8, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 4, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_rgb888 = { - MESA_FORMAT_RGB888, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 3, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_bgr888 = { - MESA_FORMAT_BGR888, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 8, /* RedBits */ - 8, /* GreenBits */ - 8, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 3, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_rgb565 = { - MESA_FORMAT_RGB565, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 5, /* RedBits */ - 6, /* GreenBits */ - 5, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_rgb565_rev = { - MESA_FORMAT_RGB565_REV, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 5, /* RedBits */ - 6, /* GreenBits */ - 5, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_rgba4444 = { - MESA_FORMAT_RGBA4444, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /* RedBits */ - 4, /* GreenBits */ - 4, /* BlueBits */ - 4, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_argb4444 = { - MESA_FORMAT_ARGB4444, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /* RedBits */ - 4, /* GreenBits */ - 4, /* BlueBits */ - 4, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_argb4444_rev = { - MESA_FORMAT_ARGB4444_REV, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 4, /* RedBits */ - 4, /* GreenBits */ - 4, /* BlueBits */ - 4, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_rgba5551 = { - MESA_FORMAT_RGBA5551, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 5, /* RedBits */ - 5, /* GreenBits */ - 5, /* BlueBits */ - 1, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_argb1555 = { - MESA_FORMAT_ARGB1555, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 5, /* RedBits */ - 5, /* GreenBits */ - 5, /* BlueBits */ - 1, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_argb1555_rev = { - MESA_FORMAT_ARGB1555_REV, /* MesaFormat */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 5, /* RedBits */ - 5, /* GreenBits */ - 5, /* BlueBits */ - 1, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_al88 = { - MESA_FORMAT_AL88, /* MesaFormat */ - GL_LUMINANCE_ALPHA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 8, /* AlphaBits */ - 8, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_al88_rev = { - MESA_FORMAT_AL88_REV, /* MesaFormat */ - GL_LUMINANCE_ALPHA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 8, /* AlphaBits */ - 8, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_rgb332 = { - MESA_FORMAT_RGB332, /* MesaFormat */ - GL_RGB, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 3, /* RedBits */ - 3, /* GreenBits */ - 2, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_a8 = { - MESA_FORMAT_A8, /* MesaFormat */ - GL_ALPHA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 8, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_l8 = { - MESA_FORMAT_L8, /* MesaFormat */ - GL_LUMINANCE, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 8, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_i8 = { - MESA_FORMAT_I8, /* MesaFormat */ - GL_INTENSITY, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 8, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_ci8 = { - MESA_FORMAT_CI8, /* MesaFormat */ - GL_COLOR_INDEX, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 8, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 1, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_ycbcr = { - MESA_FORMAT_YCBCR, /* MesaFormat */ - GL_YCBCR_MESA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_ycbcr_rev = { - MESA_FORMAT_YCBCR_REV, /* MesaFormat */ - GL_YCBCR_MESA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 2, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_z24_s8 = { - MESA_FORMAT_Z24_S8, /* MesaFormat */ - GL_DEPTH_STENCIL_EXT, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 24, /* DepthBits */ - 8, /* StencilBits */ - 4, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_s8_z24 = { - MESA_FORMAT_S8_Z24, /* MesaFormat */ - GL_DEPTH_STENCIL_EXT, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 24, /* DepthBits */ - 8, /* StencilBits */ - 4, /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_z16 = { - MESA_FORMAT_Z16, /* MesaFormat */ - GL_DEPTH_COMPONENT, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - sizeof(GLushort) * 8, /* DepthBits */ - 0, /* StencilBits */ - sizeof(GLushort), /* TexelBytes */ -}; - -const struct gl_texture_format _mesa_texformat_z32 = { - MESA_FORMAT_Z32, /* MesaFormat */ - GL_DEPTH_COMPONENT, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED_ARB, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - sizeof(GLuint) * 8, /* DepthBits */ - 0, /* StencilBits */ - sizeof(GLuint), /* TexelBytes */ -}; - -/*@}*/ - - -/***************************************************************/ -/** \name Null format (useful for proxy textures) */ -/*@{*/ - -const struct gl_texture_format _mesa_null_texformat = { - -1, /* MesaFormat */ - 0, /* BaseFormat */ - GL_NONE, /* DataType */ - 0, /* RedBits */ - 0, /* GreenBits */ - 0, /* BlueBits */ - 0, /* AlphaBits */ - 0, /* LuminanceBits */ - 0, /* IntensityBits */ - 0, /* IndexBits */ - 0, /* DepthBits */ - 0, /* StencilBits */ - 0, /* TexelBytes */ -}; -#endif - -/*@}*/ - - /** * Choose an appropriate texture format given the format, type and * internalFormat parameters passed to glTexImage(). diff --git a/src/mesa/main/texformat.h b/src/mesa/main/texformat.h index 9095726ac2..ed6a3a3851 100644 --- a/src/mesa/main/texformat.h +++ b/src/mesa/main/texformat.h @@ -39,111 +39,6 @@ #include "mtypes.h" #include "formats.h" -#if 0 -/** GLchan-valued formats */ -/*@{*/ -extern const struct gl_texture_format _mesa_texformat_rgba; -extern const struct gl_texture_format _mesa_texformat_rgb; -extern const struct gl_texture_format _mesa_texformat_alpha; -extern const struct gl_texture_format _mesa_texformat_luminance; -extern const struct gl_texture_format _mesa_texformat_luminance_alpha; -extern const struct gl_texture_format _mesa_texformat_intensity; -/*@}*/ - -#if FEATURE_EXT_texture_sRGB -/** sRGB (nonlinear) formats */ -/*@{*/ -extern const struct gl_texture_format _mesa_texformat_srgb8; -extern const struct gl_texture_format _mesa_texformat_srgba8; -extern const struct gl_texture_format _mesa_texformat_sargb8; -extern const struct gl_texture_format _mesa_texformat_sl8; -extern const struct gl_texture_format _mesa_texformat_sla8; -#if FEATURE_texture_s3tc -extern const struct gl_texture_format _mesa_texformat_srgb_dxt1; -extern const struct gl_texture_format _mesa_texformat_srgba_dxt1; -extern const struct gl_texture_format _mesa_texformat_srgba_dxt3; -extern const struct gl_texture_format _mesa_texformat_srgba_dxt5; -#endif -/*@}*/ -#endif - -/** Floating point texture formats */ -/*@{*/ -extern const struct gl_texture_format _mesa_texformat_rgba_float32; -extern const struct gl_texture_format _mesa_texformat_rgba_float16; -extern const struct gl_texture_format _mesa_texformat_rgb_float32; -extern const struct gl_texture_format _mesa_texformat_rgb_float16; -extern const struct gl_texture_format _mesa_texformat_alpha_float32; -extern const struct gl_texture_format _mesa_texformat_alpha_float16; -extern const struct gl_texture_format _mesa_texformat_luminance_float32; -extern const struct gl_texture_format _mesa_texformat_luminance_float16; -extern const struct gl_texture_format _mesa_texformat_luminance_alpha_float32; -extern const struct gl_texture_format _mesa_texformat_luminance_alpha_float16; -extern const struct gl_texture_format _mesa_texformat_intensity_float32; -extern const struct gl_texture_format _mesa_texformat_intensity_float16; -/*@}*/ - -/** Signed fixed point texture formats */ -/*@{*/ -extern const struct gl_texture_format _mesa_texformat_dudv8; -extern const struct gl_texture_format _mesa_texformat_signed_rgba8888; -extern const struct gl_texture_format _mesa_texformat_signed_rgba8888_rev; -/*@}*/ - -/** \name Assorted hardware-friendly formats */ -/*@{*/ -extern const struct gl_texture_format _mesa_texformat_rgba8888; -extern const struct gl_texture_format _mesa_texformat_rgba8888_rev; -extern const struct gl_texture_format _mesa_texformat_argb8888; -extern const struct gl_texture_format _mesa_texformat_argb8888_rev; -extern const struct gl_texture_format _mesa_texformat_rgb888; -extern const struct gl_texture_format _mesa_texformat_bgr888; -extern const struct gl_texture_format _mesa_texformat_rgb565; -extern const struct gl_texture_format _mesa_texformat_rgb565_rev; -extern const struct gl_texture_format _mesa_texformat_rgba4444; -extern const struct gl_texture_format _mesa_texformat_argb4444; -extern const struct gl_texture_format _mesa_texformat_argb4444_rev; -extern const struct gl_texture_format _mesa_texformat_argb1555; -extern const struct gl_texture_format _mesa_texformat_argb1555_rev; -extern const struct gl_texture_format _mesa_texformat_rgba5551; -extern const struct gl_texture_format _mesa_texformat_al88; -extern const struct gl_texture_format _mesa_texformat_al88_rev; -extern const struct gl_texture_format _mesa_texformat_rgb332; -extern const struct gl_texture_format _mesa_texformat_a8; -extern const struct gl_texture_format _mesa_texformat_l8; -extern const struct gl_texture_format _mesa_texformat_i8; -extern const struct gl_texture_format _mesa_texformat_ci8; -extern const struct gl_texture_format _mesa_texformat_z24_s8; -extern const struct gl_texture_format _mesa_texformat_s8_z24; -extern const struct gl_texture_format _mesa_texformat_z16; -extern const struct gl_texture_format _mesa_texformat_z32; -/*@}*/ - -/** \name YCbCr formats */ -/*@{*/ -extern const struct gl_texture_format _mesa_texformat_ycbcr; -extern const struct gl_texture_format _mesa_texformat_ycbcr_rev; -/*@}*/ - -/** \name Compressed formats */ -/*@{*/ -#if FEATURE_texture_fxt1 -extern const struct gl_texture_format _mesa_texformat_rgb_fxt1; -extern const struct gl_texture_format _mesa_texformat_rgba_fxt1; -#endif -#if FEATURE_texture_s3tc -extern const struct gl_texture_format _mesa_texformat_rgb_dxt1; -extern const struct gl_texture_format _mesa_texformat_rgba_dxt1; -extern const struct gl_texture_format _mesa_texformat_rgba_dxt3; -extern const struct gl_texture_format _mesa_texformat_rgba_dxt5; -#endif -/*@}*/ - -/** \name The null format */ -/*@{*/ -extern const struct gl_texture_format _mesa_null_texformat; -/*@}*/ -#endif extern gl_format _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, -- cgit v1.2.3 From 884d1abb2ac1a2ce872a5b09fd4228159defcf26 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 30 Sep 2009 20:36:25 -0600 Subject: st/mesa: update comment --- src/mesa/state_tracker/st_cb_drawpixels.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 081c09c1fb..3751c8717f 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -410,7 +410,7 @@ make_texture(struct st_context *st, */ success = _mesa_texstore(ctx, 2, /* dims */ baseFormat, /* baseInternalFormat */ - mformat, /* gl_texture_format */ + mformat, /* gl_format */ dest, /* dest */ 0, 0, 0, /* dstX/Y/Zoffset */ transfer->stride, /* dstRowStride, bytes */ -- cgit v1.2.3 From 74ae14a2bde4f87a554c3d96e6f4a9a02591308d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 30 Sep 2009 20:47:54 -0600 Subject: mesa: move texel fetch/store into new texfetch.[ch] files --- src/mesa/SConscript | 1 + src/mesa/main/texfetch.c | 616 ++++++++++++++++++++++++++++++++++++++++++++++ src/mesa/main/texfetch.h | 41 +++ src/mesa/main/texformat.c | 584 +------------------------------------------ src/mesa/main/texformat.h | 22 +- src/mesa/main/texrender.c | 2 +- src/mesa/main/texstore.c | 1 + src/mesa/sources.mak | 1 + 8 files changed, 668 insertions(+), 600 deletions(-) create mode 100644 src/mesa/main/texfetch.c create mode 100644 src/mesa/main/texfetch.h (limited to 'src/mesa') diff --git a/src/mesa/SConscript b/src/mesa/SConscript index 6dfbd26d94..8066da729b 100644 --- a/src/mesa/SConscript +++ b/src/mesa/SConscript @@ -91,6 +91,7 @@ if env['platform'] != 'winddk': 'main/texcompress_fxt1.c', 'main/texenv.c', 'main/texenvprogram.c', + 'main/texfetch.c', 'main/texformat.c', 'main/texgen.c', 'main/texgetimage.c', diff --git a/src/mesa/main/texfetch.c b/src/mesa/main/texfetch.c new file mode 100644 index 0000000000..20ee2527f5 --- /dev/null +++ b/src/mesa/main/texfetch.c @@ -0,0 +1,616 @@ +/* + * Mesa 3-D graphics library + * Version: 7.7 + * + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (c) 2009 VMware, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * 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 texfetch.c + * + * Texel fetch/store functions + * + * \author Gareth Hughes + */ + + +#include "colormac.h" +#include "context.h" +#include "texcompress.h" +#include "texcompress_fxt1.h" +#include "texcompress_s3tc.h" +#include "texfetch.h" + + +#if FEATURE_EXT_texture_sRGB + +/** + * Convert an 8-bit sRGB value from non-linear space to a + * linear RGB value in [0, 1]. + * Implemented with a 256-entry lookup table. + */ +static INLINE GLfloat +nonlinear_to_linear(GLubyte cs8) +{ + static GLfloat table[256]; + static GLboolean tableReady = GL_FALSE; + if (!tableReady) { + /* compute lookup table now */ + GLuint i; + for (i = 0; i < 256; i++) { + const GLfloat cs = UBYTE_TO_FLOAT(i); + if (cs <= 0.04045) { + table[i] = cs / 12.92f; + } + else { + table[i] = (GLfloat) _mesa_pow((cs + 0.055) / 1.055, 2.4); + } + } + tableReady = GL_TRUE; + } + return table[cs8]; +} + + +#endif /* FEATURE_EXT_texture_sRGB */ + + +/* Texel fetch routines for all supported formats + */ +#define DIM 1 +#include "texformat_tmp.h" + +#define DIM 2 +#include "texformat_tmp.h" + +#define DIM 3 +#include "texformat_tmp.h" + +/** + * Null texel fetch function. + * + * Have to have this so the FetchTexel function pointer is never NULL. + */ +static void fetch_null_texelf( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + (void) texImage; (void) i; (void) j; (void) k; + texel[RCOMP] = 0.0; + texel[GCOMP] = 0.0; + texel[BCOMP] = 0.0; + texel[ACOMP] = 0.0; + _mesa_warning(NULL, "fetch_null_texelf() called!"); +} + +static void store_null_texel(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + (void) texImage; + (void) i; + (void) j; + (void) k; + (void) texel; + /* no-op */ +} + + + +/** + * Table to map MESA_FORMAT_ to texel fetch/store funcs. + * XXX this is somewhat temporary. + */ +static struct { + GLuint Name; + FetchTexelFuncF Fetch1D; + FetchTexelFuncF Fetch2D; + FetchTexelFuncF Fetch3D; + StoreTexelFunc StoreTexel; +} +texfetch_funcs[MESA_FORMAT_COUNT] = +{ + { + MESA_FORMAT_RGBA, + fetch_texel_1d_f_rgba, + fetch_texel_2d_f_rgba, + fetch_texel_3d_f_rgba, + store_texel_rgba + }, + { + MESA_FORMAT_RGB, + fetch_texel_1d_f_rgb, + fetch_texel_2d_f_rgb, + fetch_texel_3d_f_rgb, + store_texel_rgb + }, + { + MESA_FORMAT_ALPHA, + fetch_texel_1d_f_alpha, + fetch_texel_2d_f_alpha, + fetch_texel_3d_f_alpha, + store_texel_alpha + }, + { + MESA_FORMAT_LUMINANCE, + fetch_texel_1d_f_luminance, + fetch_texel_2d_f_luminance, + fetch_texel_3d_f_luminance, + store_texel_luminance + }, + { + MESA_FORMAT_LUMINANCE_ALPHA, + fetch_texel_1d_f_luminance_alpha, + fetch_texel_2d_f_luminance_alpha, + fetch_texel_3d_f_luminance_alpha, + store_texel_luminance_alpha + }, + { + MESA_FORMAT_INTENSITY, + fetch_texel_1d_f_intensity, + fetch_texel_2d_f_intensity, + fetch_texel_3d_f_intensity, + store_texel_intensity + }, + { + MESA_FORMAT_SRGB8, + fetch_texel_1d_srgb8, + fetch_texel_2d_srgb8, + fetch_texel_3d_srgb8, + store_texel_srgb8 + }, + { + MESA_FORMAT_SRGBA8, + fetch_texel_1d_srgba8, + fetch_texel_2d_srgba8, + fetch_texel_3d_srgba8, + store_texel_srgba8 + }, + { + MESA_FORMAT_SARGB8, + fetch_texel_1d_sargb8, + fetch_texel_2d_sargb8, + fetch_texel_3d_sargb8, + store_texel_sargb8 + }, + { + MESA_FORMAT_SL8, + fetch_texel_1d_sl8, + fetch_texel_2d_sl8, + fetch_texel_3d_sl8, + store_texel_sl8 + }, + { + MESA_FORMAT_SLA8, + fetch_texel_1d_sla8, + fetch_texel_2d_sla8, + fetch_texel_3d_sla8, + store_texel_sla8 + }, + { + MESA_FORMAT_RGB_FXT1, + NULL, + _mesa_fetch_texel_2d_f_rgb_fxt1, + NULL, + NULL + }, + { + MESA_FORMAT_RGBA_FXT1, + NULL, + _mesa_fetch_texel_2d_f_rgba_fxt1, + NULL, + NULL + }, + { + MESA_FORMAT_RGB_DXT1, + NULL, + _mesa_fetch_texel_2d_f_rgb_dxt1, + NULL, + NULL + }, + { + MESA_FORMAT_RGBA_DXT1, + NULL, + _mesa_fetch_texel_2d_f_rgba_dxt1, + NULL, + NULL + }, + { + MESA_FORMAT_RGBA_DXT3, + NULL, + _mesa_fetch_texel_2d_f_rgba_dxt3, + NULL, + NULL + }, + { + MESA_FORMAT_RGBA_DXT5, + NULL, + _mesa_fetch_texel_2d_f_rgba_dxt5, + NULL, + NULL + }, + { + MESA_FORMAT_SRGB_DXT1, + NULL, + _mesa_fetch_texel_2d_f_srgb_dxt1, + NULL, + NULL + }, + { + MESA_FORMAT_SRGBA_DXT1, + NULL, + _mesa_fetch_texel_2d_f_srgba_dxt1, + NULL, + NULL + }, + { + MESA_FORMAT_SRGBA_DXT3, + NULL, + _mesa_fetch_texel_2d_f_srgba_dxt3, + NULL, + NULL + }, + { + MESA_FORMAT_SRGBA_DXT5, + NULL, + _mesa_fetch_texel_2d_f_srgba_dxt5, + NULL, + NULL + }, + { + MESA_FORMAT_RGBA_FLOAT32, + fetch_texel_1d_f_rgba_f32, + fetch_texel_2d_f_rgba_f32, + fetch_texel_3d_f_rgba_f32, + store_texel_rgba_f32 + }, + { + MESA_FORMAT_RGBA_FLOAT16, + fetch_texel_1d_f_rgba_f16, + fetch_texel_2d_f_rgba_f16, + fetch_texel_3d_f_rgba_f16, + store_texel_rgba_f16 + }, + { + MESA_FORMAT_RGB_FLOAT32, + fetch_texel_1d_f_rgb_f32, + fetch_texel_2d_f_rgb_f32, + fetch_texel_3d_f_rgb_f32, + store_texel_rgb_f32 + }, + { + MESA_FORMAT_RGB_FLOAT16, + fetch_texel_1d_f_rgb_f16, + fetch_texel_2d_f_rgb_f16, + fetch_texel_3d_f_rgb_f16, + store_texel_rgb_f16 + }, + { + MESA_FORMAT_ALPHA_FLOAT32, + fetch_texel_1d_f_alpha_f32, + fetch_texel_2d_f_alpha_f32, + fetch_texel_3d_f_alpha_f32, + store_texel_alpha_f32 + }, + { + MESA_FORMAT_ALPHA_FLOAT16, + fetch_texel_1d_f_alpha_f16, + fetch_texel_2d_f_alpha_f16, + fetch_texel_3d_f_alpha_f16, + store_texel_alpha_f16 + }, + { + MESA_FORMAT_LUMINANCE_FLOAT32, + fetch_texel_1d_f_luminance_f32, + fetch_texel_2d_f_luminance_f32, + fetch_texel_3d_f_luminance_f32, + store_texel_luminance_f32 + }, + { + MESA_FORMAT_LUMINANCE_FLOAT16, + fetch_texel_1d_f_luminance_f16, + fetch_texel_2d_f_luminance_f16, + fetch_texel_3d_f_luminance_f16, + store_texel_luminance_f16 + }, + { + MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32, + fetch_texel_1d_f_luminance_alpha_f32, + fetch_texel_2d_f_luminance_alpha_f32, + fetch_texel_3d_f_luminance_alpha_f32, + store_texel_luminance_alpha_f32 + }, + { + MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16, + fetch_texel_1d_f_luminance_alpha_f16, + fetch_texel_2d_f_luminance_alpha_f16, + fetch_texel_3d_f_luminance_alpha_f16, + store_texel_luminance_alpha_f16 + }, + { + MESA_FORMAT_INTENSITY_FLOAT32, + fetch_texel_1d_f_intensity_f32, + fetch_texel_2d_f_intensity_f32, + fetch_texel_3d_f_intensity_f32, + store_texel_intensity_f32 + }, + { + MESA_FORMAT_INTENSITY_FLOAT16, + fetch_texel_1d_f_intensity_f16, + fetch_texel_2d_f_intensity_f16, + fetch_texel_3d_f_intensity_f16, + store_texel_intensity_f16 + }, + { + MESA_FORMAT_DUDV8, + fetch_texel_1d_dudv8, + fetch_texel_2d_dudv8, + fetch_texel_3d_dudv8, + NULL + }, + { + MESA_FORMAT_SIGNED_RGBA8888, + fetch_texel_1d_signed_rgba8888, + fetch_texel_2d_signed_rgba8888, + fetch_texel_3d_signed_rgba8888, + store_texel_signed_rgba8888 + }, + { + MESA_FORMAT_SIGNED_RGBA8888_REV, + fetch_texel_1d_signed_rgba8888_rev, + fetch_texel_2d_signed_rgba8888_rev, + fetch_texel_3d_signed_rgba8888_rev, + store_texel_signed_rgba8888_rev + }, + { + MESA_FORMAT_RGBA8888, + fetch_texel_1d_f_rgba8888, + fetch_texel_2d_f_rgba8888, + fetch_texel_3d_f_rgba8888, + store_texel_rgba8888 + }, + { + MESA_FORMAT_RGBA8888_REV, + fetch_texel_1d_f_rgba8888_rev, + fetch_texel_2d_f_rgba8888_rev, + fetch_texel_3d_f_rgba8888_rev, + store_texel_rgba8888_rev + }, + { + MESA_FORMAT_ARGB8888, + fetch_texel_1d_f_argb8888, + fetch_texel_2d_f_argb8888, + fetch_texel_3d_f_argb8888, + store_texel_argb8888 + }, + { + MESA_FORMAT_ARGB8888_REV, + fetch_texel_1d_f_argb8888_rev, + fetch_texel_2d_f_argb8888_rev, + fetch_texel_3d_f_argb8888_rev, + store_texel_argb8888_rev + }, + { + MESA_FORMAT_RGB888, + fetch_texel_1d_f_rgb888, + fetch_texel_2d_f_rgb888, + fetch_texel_3d_f_rgb888, + store_texel_rgb888 + }, + { + MESA_FORMAT_BGR888, + fetch_texel_1d_f_bgr888, + fetch_texel_2d_f_bgr888, + fetch_texel_3d_f_bgr888, + store_texel_bgr888 + }, + { + MESA_FORMAT_RGB565, + fetch_texel_1d_f_rgb565, + fetch_texel_2d_f_rgb565, + fetch_texel_3d_f_rgb565, + store_texel_rgb565 + }, + { + MESA_FORMAT_RGB565_REV, + fetch_texel_1d_f_rgb565_rev, + fetch_texel_2d_f_rgb565_rev, + fetch_texel_3d_f_rgb565_rev, + store_texel_rgb565_rev + }, + { + MESA_FORMAT_RGBA4444, + fetch_texel_1d_f_rgba4444, + fetch_texel_2d_f_rgba4444, + fetch_texel_3d_f_rgba4444, + store_texel_rgba4444 + }, + { + MESA_FORMAT_ARGB4444, + fetch_texel_1d_f_argb4444, + fetch_texel_2d_f_argb4444, + fetch_texel_3d_f_argb4444, + store_texel_argb4444 + }, + { + MESA_FORMAT_ARGB4444_REV, + fetch_texel_1d_f_argb4444_rev, + fetch_texel_2d_f_argb4444_rev, + fetch_texel_3d_f_argb4444_rev, + store_texel_argb4444_rev + }, + { + MESA_FORMAT_RGBA5551, + fetch_texel_1d_f_rgba5551, + fetch_texel_2d_f_rgba5551, + fetch_texel_3d_f_rgba5551, + store_texel_rgba5551 + }, + { + MESA_FORMAT_ARGB1555, + fetch_texel_1d_f_argb1555, + fetch_texel_2d_f_argb1555, + fetch_texel_3d_f_argb1555, + store_texel_argb1555 + }, + { + MESA_FORMAT_ARGB1555_REV, + fetch_texel_1d_f_argb1555_rev, + fetch_texel_2d_f_argb1555_rev, + fetch_texel_3d_f_argb1555_rev, + store_texel_argb1555_rev + }, + { + MESA_FORMAT_AL88, + fetch_texel_1d_f_al88, + fetch_texel_2d_f_al88, + fetch_texel_3d_f_al88, + store_texel_al88 + }, + { + MESA_FORMAT_AL88_REV, + fetch_texel_1d_f_al88_rev, + fetch_texel_2d_f_al88_rev, + fetch_texel_3d_f_al88_rev, + store_texel_al88_rev + }, + { + MESA_FORMAT_RGB332, + fetch_texel_1d_f_rgb332, + fetch_texel_2d_f_rgb332, + fetch_texel_3d_f_rgb332, + store_texel_rgb332 + }, + { + MESA_FORMAT_A8, + fetch_texel_1d_f_a8, + fetch_texel_2d_f_a8, + fetch_texel_3d_f_a8, + store_texel_a8 + }, + { + MESA_FORMAT_L8, + fetch_texel_1d_f_l8, + fetch_texel_2d_f_l8, + fetch_texel_3d_f_l8, + store_texel_l8 + }, + { + MESA_FORMAT_I8, + fetch_texel_1d_f_i8, + fetch_texel_2d_f_i8, + fetch_texel_3d_f_i8, + store_texel_i8 + }, + { + MESA_FORMAT_CI8, + fetch_texel_1d_f_ci8, + fetch_texel_2d_f_ci8, + fetch_texel_3d_f_ci8, + store_texel_ci8 + }, + { + MESA_FORMAT_YCBCR, + fetch_texel_1d_f_ycbcr, + fetch_texel_2d_f_ycbcr, + fetch_texel_3d_f_ycbcr, + store_texel_ycbcr + }, + { + MESA_FORMAT_YCBCR_REV, + fetch_texel_1d_f_ycbcr_rev, + fetch_texel_2d_f_ycbcr_rev, + fetch_texel_3d_f_ycbcr_rev, + store_texel_ycbcr_rev + }, + { + MESA_FORMAT_Z24_S8, + fetch_texel_1d_f_z24_s8, + fetch_texel_2d_f_z24_s8, + fetch_texel_3d_f_z24_s8, + store_texel_z24_s8 + }, + { + MESA_FORMAT_S8_Z24, + fetch_texel_1d_f_s8_z24, + fetch_texel_2d_f_s8_z24, + fetch_texel_3d_f_s8_z24, + store_texel_s8_z24 + }, + { + MESA_FORMAT_Z16, + fetch_texel_1d_f_z16, + fetch_texel_2d_f_z16, + fetch_texel_3d_f_z16, + store_texel_z16 + }, + { + MESA_FORMAT_Z32, + fetch_texel_1d_f_z32, + fetch_texel_2d_f_z32, + fetch_texel_3d_f_z32, + store_texel_z32 + } +}; + + +FetchTexelFuncF +_mesa_get_texel_fetch_func(gl_format format, GLuint dims) +{ + FetchTexelFuncF f; + GLuint i; + /* XXX replace loop with direct table lookup */ + for (i = 0; i < MESA_FORMAT_COUNT; i++) { + if (texfetch_funcs[i].Name == format) { + switch (dims) { + case 1: + f = texfetch_funcs[i].Fetch1D; + break; + case 2: + f = texfetch_funcs[i].Fetch2D; + break; + case 3: + f = texfetch_funcs[i].Fetch3D; + break; + } + if (!f) + f = fetch_null_texelf; + return f; + } + } + return NULL; +} + + +StoreTexelFunc +_mesa_get_texel_store_func(gl_format format) +{ + GLuint i; + /* XXX replace loop with direct table lookup */ + for (i = 0; i < MESA_FORMAT_COUNT; i++) { + if (texfetch_funcs[i].Name == format) { + if (texfetch_funcs[i].StoreTexel) + return texfetch_funcs[i].StoreTexel; + else + return store_null_texel; + } + } + return NULL; +} diff --git a/src/mesa/main/texfetch.h b/src/mesa/main/texfetch.h new file mode 100644 index 0000000000..a397b04600 --- /dev/null +++ b/src/mesa/main/texfetch.h @@ -0,0 +1,41 @@ +/* + * Mesa 3-D graphics library + * Version: 7.7 + * + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (c) 2009 VMware, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * 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. + */ + + +#ifndef TEXFETCH_H +#define TEXFETCH_H + +#include "mtypes.h" +#include "formats.h" + + +extern FetchTexelFuncF +_mesa_get_texel_fetch_func(gl_format format, GLuint dims); + +extern StoreTexelFunc +_mesa_get_texel_store_func(gl_format format); + + +#endif diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index 9290210b3f..bee7f583cf 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -1,9 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 7.7 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. - * Copyright (c) 2008 VMware, Inc. + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (c) 2008-2009 VMware, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -29,88 +29,15 @@ * Texture formats. * * \author Gareth Hughes + * \author Brian Paul */ -#include "colormac.h" #include "context.h" #include "texcompress.h" #include "texcompress_fxt1.h" #include "texcompress_s3tc.h" #include "texformat.h" -#include "texstore.h" - - -#if FEATURE_EXT_texture_sRGB - -/** - * Convert an 8-bit sRGB value from non-linear space to a - * linear RGB value in [0, 1]. - * Implemented with a 256-entry lookup table. - */ -static INLINE GLfloat -nonlinear_to_linear(GLubyte cs8) -{ - static GLfloat table[256]; - static GLboolean tableReady = GL_FALSE; - if (!tableReady) { - /* compute lookup table now */ - GLuint i; - for (i = 0; i < 256; i++) { - const GLfloat cs = UBYTE_TO_FLOAT(i); - if (cs <= 0.04045) { - table[i] = cs / 12.92f; - } - else { - table[i] = (GLfloat) _mesa_pow((cs + 0.055) / 1.055, 2.4); - } - } - tableReady = GL_TRUE; - } - return table[cs8]; -} - - -#endif /* FEATURE_EXT_texture_sRGB */ - - -/* Texel fetch routines for all supported formats - */ -#define DIM 1 -#include "texformat_tmp.h" - -#define DIM 2 -#include "texformat_tmp.h" - -#define DIM 3 -#include "texformat_tmp.h" - -/** - * Null texel fetch function. - * - * Have to have this so the FetchTexel function pointer is never NULL. - */ -static void fetch_null_texelf( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - (void) texImage; (void) i; (void) j; (void) k; - texel[RCOMP] = 0.0; - texel[GCOMP] = 0.0; - texel[BCOMP] = 0.0; - texel[ACOMP] = 0.0; - _mesa_warning(NULL, "fetch_null_texelf() called!"); -} - -static void store_null_texel(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - (void) texImage; - (void) i; - (void) j; - (void) k; - (void) texel; - /* no-op */ -} /** @@ -639,506 +566,3 @@ _mesa_format_to_type_and_comps(gl_format format, *comps = 1; } } - - - -/** - * Table to map MESA_FORMAT_ to texel fetch/store funcs. - * XXX this is somewhat temporary. - */ -static struct { - GLuint Name; - FetchTexelFuncF Fetch1D; - FetchTexelFuncF Fetch2D; - FetchTexelFuncF Fetch3D; - StoreTexelFunc StoreTexel; -} -texfetch_funcs[MESA_FORMAT_COUNT] = -{ - { - MESA_FORMAT_RGBA, - fetch_texel_1d_f_rgba, - fetch_texel_2d_f_rgba, - fetch_texel_3d_f_rgba, - store_texel_rgba - }, - { - MESA_FORMAT_RGB, - fetch_texel_1d_f_rgb, - fetch_texel_2d_f_rgb, - fetch_texel_3d_f_rgb, - store_texel_rgb - }, - { - MESA_FORMAT_ALPHA, - fetch_texel_1d_f_alpha, - fetch_texel_2d_f_alpha, - fetch_texel_3d_f_alpha, - store_texel_alpha - }, - { - MESA_FORMAT_LUMINANCE, - fetch_texel_1d_f_luminance, - fetch_texel_2d_f_luminance, - fetch_texel_3d_f_luminance, - store_texel_luminance - }, - { - MESA_FORMAT_LUMINANCE_ALPHA, - fetch_texel_1d_f_luminance_alpha, - fetch_texel_2d_f_luminance_alpha, - fetch_texel_3d_f_luminance_alpha, - store_texel_luminance_alpha - }, - { - MESA_FORMAT_INTENSITY, - fetch_texel_1d_f_intensity, - fetch_texel_2d_f_intensity, - fetch_texel_3d_f_intensity, - store_texel_intensity - }, - { - MESA_FORMAT_SRGB8, - fetch_texel_1d_srgb8, - fetch_texel_2d_srgb8, - fetch_texel_3d_srgb8, - store_texel_srgb8 - }, - { - MESA_FORMAT_SRGBA8, - fetch_texel_1d_srgba8, - fetch_texel_2d_srgba8, - fetch_texel_3d_srgba8, - store_texel_srgba8 - }, - { - MESA_FORMAT_SARGB8, - fetch_texel_1d_sargb8, - fetch_texel_2d_sargb8, - fetch_texel_3d_sargb8, - store_texel_sargb8 - }, - { - MESA_FORMAT_SL8, - fetch_texel_1d_sl8, - fetch_texel_2d_sl8, - fetch_texel_3d_sl8, - store_texel_sl8 - }, - { - MESA_FORMAT_SLA8, - fetch_texel_1d_sla8, - fetch_texel_2d_sla8, - fetch_texel_3d_sla8, - store_texel_sla8 - }, - { - MESA_FORMAT_RGB_FXT1, - NULL, - _mesa_fetch_texel_2d_f_rgb_fxt1, - NULL, - NULL - }, - { - MESA_FORMAT_RGBA_FXT1, - NULL, - _mesa_fetch_texel_2d_f_rgba_fxt1, - NULL, - NULL - }, - { - MESA_FORMAT_RGB_DXT1, - NULL, - _mesa_fetch_texel_2d_f_rgb_dxt1, - NULL, - NULL - }, - { - MESA_FORMAT_RGBA_DXT1, - NULL, - _mesa_fetch_texel_2d_f_rgba_dxt1, - NULL, - NULL - }, - { - MESA_FORMAT_RGBA_DXT3, - NULL, - _mesa_fetch_texel_2d_f_rgba_dxt3, - NULL, - NULL - }, - { - MESA_FORMAT_RGBA_DXT5, - NULL, - _mesa_fetch_texel_2d_f_rgba_dxt5, - NULL, - NULL - }, - { - MESA_FORMAT_SRGB_DXT1, - NULL, - _mesa_fetch_texel_2d_f_srgb_dxt1, - NULL, - NULL - }, - { - MESA_FORMAT_SRGBA_DXT1, - NULL, - _mesa_fetch_texel_2d_f_srgba_dxt1, - NULL, - NULL - }, - { - MESA_FORMAT_SRGBA_DXT3, - NULL, - _mesa_fetch_texel_2d_f_srgba_dxt3, - NULL, - NULL - }, - { - MESA_FORMAT_SRGBA_DXT5, - NULL, - _mesa_fetch_texel_2d_f_srgba_dxt5, - NULL, - NULL - }, - { - MESA_FORMAT_RGBA_FLOAT32, - fetch_texel_1d_f_rgba_f32, - fetch_texel_2d_f_rgba_f32, - fetch_texel_3d_f_rgba_f32, - store_texel_rgba_f32 - }, - { - MESA_FORMAT_RGBA_FLOAT16, - fetch_texel_1d_f_rgba_f16, - fetch_texel_2d_f_rgba_f16, - fetch_texel_3d_f_rgba_f16, - store_texel_rgba_f16 - }, - { - MESA_FORMAT_RGB_FLOAT32, - fetch_texel_1d_f_rgb_f32, - fetch_texel_2d_f_rgb_f32, - fetch_texel_3d_f_rgb_f32, - store_texel_rgb_f32 - }, - { - MESA_FORMAT_RGB_FLOAT16, - fetch_texel_1d_f_rgb_f16, - fetch_texel_2d_f_rgb_f16, - fetch_texel_3d_f_rgb_f16, - store_texel_rgb_f16 - }, - { - MESA_FORMAT_ALPHA_FLOAT32, - fetch_texel_1d_f_alpha_f32, - fetch_texel_2d_f_alpha_f32, - fetch_texel_3d_f_alpha_f32, - store_texel_alpha_f32 - }, - { - MESA_FORMAT_ALPHA_FLOAT16, - fetch_texel_1d_f_alpha_f16, - fetch_texel_2d_f_alpha_f16, - fetch_texel_3d_f_alpha_f16, - store_texel_alpha_f16 - }, - { - MESA_FORMAT_LUMINANCE_FLOAT32, - fetch_texel_1d_f_luminance_f32, - fetch_texel_2d_f_luminance_f32, - fetch_texel_3d_f_luminance_f32, - store_texel_luminance_f32 - }, - { - MESA_FORMAT_LUMINANCE_FLOAT16, - fetch_texel_1d_f_luminance_f16, - fetch_texel_2d_f_luminance_f16, - fetch_texel_3d_f_luminance_f16, - store_texel_luminance_f16 - }, - { - MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32, - fetch_texel_1d_f_luminance_alpha_f32, - fetch_texel_2d_f_luminance_alpha_f32, - fetch_texel_3d_f_luminance_alpha_f32, - store_texel_luminance_alpha_f32 - }, - { - MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16, - fetch_texel_1d_f_luminance_alpha_f16, - fetch_texel_2d_f_luminance_alpha_f16, - fetch_texel_3d_f_luminance_alpha_f16, - store_texel_luminance_alpha_f16 - }, - { - MESA_FORMAT_INTENSITY_FLOAT32, - fetch_texel_1d_f_intensity_f32, - fetch_texel_2d_f_intensity_f32, - fetch_texel_3d_f_intensity_f32, - store_texel_intensity_f32 - }, - { - MESA_FORMAT_INTENSITY_FLOAT16, - fetch_texel_1d_f_intensity_f16, - fetch_texel_2d_f_intensity_f16, - fetch_texel_3d_f_intensity_f16, - store_texel_intensity_f16 - }, - { - MESA_FORMAT_DUDV8, - fetch_texel_1d_dudv8, - fetch_texel_2d_dudv8, - fetch_texel_3d_dudv8, - NULL - }, - { - MESA_FORMAT_SIGNED_RGBA8888, - fetch_texel_1d_signed_rgba8888, - fetch_texel_2d_signed_rgba8888, - fetch_texel_3d_signed_rgba8888, - store_texel_signed_rgba8888 - }, - { - MESA_FORMAT_SIGNED_RGBA8888_REV, - fetch_texel_1d_signed_rgba8888_rev, - fetch_texel_2d_signed_rgba8888_rev, - fetch_texel_3d_signed_rgba8888_rev, - store_texel_signed_rgba8888_rev - }, - { - MESA_FORMAT_RGBA8888, - fetch_texel_1d_f_rgba8888, - fetch_texel_2d_f_rgba8888, - fetch_texel_3d_f_rgba8888, - store_texel_rgba8888 - }, - { - MESA_FORMAT_RGBA8888_REV, - fetch_texel_1d_f_rgba8888_rev, - fetch_texel_2d_f_rgba8888_rev, - fetch_texel_3d_f_rgba8888_rev, - store_texel_rgba8888_rev - }, - { - MESA_FORMAT_ARGB8888, - fetch_texel_1d_f_argb8888, - fetch_texel_2d_f_argb8888, - fetch_texel_3d_f_argb8888, - store_texel_argb8888 - }, - { - MESA_FORMAT_ARGB8888_REV, - fetch_texel_1d_f_argb8888_rev, - fetch_texel_2d_f_argb8888_rev, - fetch_texel_3d_f_argb8888_rev, - store_texel_argb8888_rev - }, - { - MESA_FORMAT_RGB888, - fetch_texel_1d_f_rgb888, - fetch_texel_2d_f_rgb888, - fetch_texel_3d_f_rgb888, - store_texel_rgb888 - }, - { - MESA_FORMAT_BGR888, - fetch_texel_1d_f_bgr888, - fetch_texel_2d_f_bgr888, - fetch_texel_3d_f_bgr888, - store_texel_bgr888 - }, - { - MESA_FORMAT_RGB565, - fetch_texel_1d_f_rgb565, - fetch_texel_2d_f_rgb565, - fetch_texel_3d_f_rgb565, - store_texel_rgb565 - }, - { - MESA_FORMAT_RGB565_REV, - fetch_texel_1d_f_rgb565_rev, - fetch_texel_2d_f_rgb565_rev, - fetch_texel_3d_f_rgb565_rev, - store_texel_rgb565_rev - }, - { - MESA_FORMAT_RGBA4444, - fetch_texel_1d_f_rgba4444, - fetch_texel_2d_f_rgba4444, - fetch_texel_3d_f_rgba4444, - store_texel_rgba4444 - }, - { - MESA_FORMAT_ARGB4444, - fetch_texel_1d_f_argb4444, - fetch_texel_2d_f_argb4444, - fetch_texel_3d_f_argb4444, - store_texel_argb4444 - }, - { - MESA_FORMAT_ARGB4444_REV, - fetch_texel_1d_f_argb4444_rev, - fetch_texel_2d_f_argb4444_rev, - fetch_texel_3d_f_argb4444_rev, - store_texel_argb4444_rev - }, - { - MESA_FORMAT_RGBA5551, - fetch_texel_1d_f_rgba5551, - fetch_texel_2d_f_rgba5551, - fetch_texel_3d_f_rgba5551, - store_texel_rgba5551 - }, - { - MESA_FORMAT_ARGB1555, - fetch_texel_1d_f_argb1555, - fetch_texel_2d_f_argb1555, - fetch_texel_3d_f_argb1555, - store_texel_argb1555 - }, - { - MESA_FORMAT_ARGB1555_REV, - fetch_texel_1d_f_argb1555_rev, - fetch_texel_2d_f_argb1555_rev, - fetch_texel_3d_f_argb1555_rev, - store_texel_argb1555_rev - }, - { - MESA_FORMAT_AL88, - fetch_texel_1d_f_al88, - fetch_texel_2d_f_al88, - fetch_texel_3d_f_al88, - store_texel_al88 - }, - { - MESA_FORMAT_AL88_REV, - fetch_texel_1d_f_al88_rev, - fetch_texel_2d_f_al88_rev, - fetch_texel_3d_f_al88_rev, - store_texel_al88_rev - }, - { - MESA_FORMAT_RGB332, - fetch_texel_1d_f_rgb332, - fetch_texel_2d_f_rgb332, - fetch_texel_3d_f_rgb332, - store_texel_rgb332 - }, - { - MESA_FORMAT_A8, - fetch_texel_1d_f_a8, - fetch_texel_2d_f_a8, - fetch_texel_3d_f_a8, - store_texel_a8 - }, - { - MESA_FORMAT_L8, - fetch_texel_1d_f_l8, - fetch_texel_2d_f_l8, - fetch_texel_3d_f_l8, - store_texel_l8 - }, - { - MESA_FORMAT_I8, - fetch_texel_1d_f_i8, - fetch_texel_2d_f_i8, - fetch_texel_3d_f_i8, - store_texel_i8 - }, - { - MESA_FORMAT_CI8, - fetch_texel_1d_f_ci8, - fetch_texel_2d_f_ci8, - fetch_texel_3d_f_ci8, - store_texel_ci8 - }, - { - MESA_FORMAT_YCBCR, - fetch_texel_1d_f_ycbcr, - fetch_texel_2d_f_ycbcr, - fetch_texel_3d_f_ycbcr, - store_texel_ycbcr - }, - { - MESA_FORMAT_YCBCR_REV, - fetch_texel_1d_f_ycbcr_rev, - fetch_texel_2d_f_ycbcr_rev, - fetch_texel_3d_f_ycbcr_rev, - store_texel_ycbcr_rev - }, - { - MESA_FORMAT_Z24_S8, - fetch_texel_1d_f_z24_s8, - fetch_texel_2d_f_z24_s8, - fetch_texel_3d_f_z24_s8, - store_texel_z24_s8 - }, - { - MESA_FORMAT_S8_Z24, - fetch_texel_1d_f_s8_z24, - fetch_texel_2d_f_s8_z24, - fetch_texel_3d_f_s8_z24, - store_texel_s8_z24 - }, - { - MESA_FORMAT_Z16, - fetch_texel_1d_f_z16, - fetch_texel_2d_f_z16, - fetch_texel_3d_f_z16, - store_texel_z16 - }, - { - MESA_FORMAT_Z32, - fetch_texel_1d_f_z32, - fetch_texel_2d_f_z32, - fetch_texel_3d_f_z32, - store_texel_z32 - } -}; - - -FetchTexelFuncF -_mesa_get_texel_fetch_func(GLuint format, GLuint dims) -{ - FetchTexelFuncF f; - GLuint i; - /* XXX replace loop with direct table lookup */ - for (i = 0; i < MESA_FORMAT_COUNT; i++) { - if (texfetch_funcs[i].Name == format) { - switch (dims) { - case 1: - f = texfetch_funcs[i].Fetch1D; - break; - case 2: - f = texfetch_funcs[i].Fetch2D; - break; - case 3: - f = texfetch_funcs[i].Fetch3D; - break; - } - if (!f) - f = fetch_null_texelf; - return f; - } - } - return NULL; -} - - -StoreTexelFunc -_mesa_get_texel_store_func(GLuint format) -{ - GLuint i; - /* XXX replace loop with direct table lookup */ - for (i = 0; i < MESA_FORMAT_COUNT; i++) { - if (texfetch_funcs[i].Name == format) { - if (texfetch_funcs[i].StoreTexel) - return texfetch_funcs[i].StoreTexel; - else - return store_null_texel; - } - } - return NULL; -} diff --git a/src/mesa/main/texformat.h b/src/mesa/main/texformat.h index ed6a3a3851..0711b67da1 100644 --- a/src/mesa/main/texformat.h +++ b/src/mesa/main/texformat.h @@ -1,9 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 6.5.1 + * Version: 7.75 * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. - * Copyright (c) 2008 VMware, Inc. + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (c) 2008-2009 VMware, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -23,15 +23,6 @@ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -/** - * \file texformat.h - * Texture formats definitions. - * - * \author Gareth Hughes - */ - - #ifndef TEXFORMAT_H #define TEXFORMAT_H @@ -49,11 +40,4 @@ extern void _mesa_format_to_type_and_comps(gl_format format, GLenum *datatype, GLuint *comps); -extern FetchTexelFuncF -_mesa_get_texel_fetch_func(GLuint format, GLuint dims); - -extern StoreTexelFunc -_mesa_get_texel_store_func(GLuint format); - - #endif diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c index 81bb1d40ff..f47478421a 100644 --- a/src/mesa/main/texrender.c +++ b/src/mesa/main/texrender.c @@ -1,7 +1,7 @@ #include "context.h" #include "fbobject.h" -#include "texformat.h" +#include "texfetch.h" #include "texrender.h" #include "renderbuffer.h" diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 02e3df89cf..d5bc16dee4 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -64,6 +64,7 @@ #include "texcompress.h" #include "texcompress_fxt1.h" #include "texcompress_s3tc.h" +#include "texfetch.h" #include "texformat.h" #include "teximage.h" #include "texstore.h" diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak index dab3e56038..8959ff5356 100644 --- a/src/mesa/sources.mak +++ b/src/mesa/sources.mak @@ -68,6 +68,7 @@ MAIN_SOURCES = \ main/texcompress_fxt1.c \ main/texenv.c \ main/texenvprogram.c \ + main/texfetch.c \ main/texformat.c \ main/texgen.c \ main/texgetimage.c \ -- cgit v1.2.3 From 3fa7dbf368bb060220e9f78e666b00d6827166a6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 30 Sep 2009 21:00:16 -0600 Subject: mesa: remove GLchan-based formats; use hw 8-bit/channel formats instead Removed: MESA_FORMAT_RGBA, RGB, ALPHA, LUMINANCE, LUMINANCE_ALPHA, INTENSITY. --- src/mesa/drivers/x11/xm_dd.c | 4 +- src/mesa/main/formats.c | 48 ------------- src/mesa/main/formats.h | 13 +--- src/mesa/main/mipmap.c | 4 +- src/mesa/main/texfetch.c | 42 ----------- src/mesa/main/texformat.c | 37 ++-------- src/mesa/main/texformat_tmp.h | 146 ------------------------------------- src/mesa/main/texstore.c | 164 ------------------------------------------ src/mesa/swrast/s_texfilter.c | 36 +++++----- src/mesa/swrast/s_triangle.c | 12 ++-- 10 files changed, 35 insertions(+), 471 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c index 5b00b5b82c..d757e50b5a 100644 --- a/src/mesa/drivers/x11/xm_dd.c +++ b/src/mesa/drivers/x11/xm_dd.c @@ -1025,9 +1025,9 @@ choose_tex_format( GLcontext *ctx, GLint internalFormat, { switch (internalFormat) { case GL_COMPRESSED_RGB_ARB: - return MESA_FORMAT_RGB; + return MESA_FORMAT_RGB888; case GL_COMPRESSED_RGBA_ARB: - return MESA_FORMAT_RGBA; + return MESA_FORMAT_RGBA8888; default: return _mesa_choose_tex_format(ctx, internalFormat, format, type); } diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index 2ad5685883..f915b1da91 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -401,54 +401,6 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, #endif - { - MESA_FORMAT_RGBA, - GL_RGBA, - GL_UNSIGNED_NORMALIZED, - CHAN_BITS, CHAN_BITS, CHAN_BITS, CHAN_BITS, - 0, 0, 0, 0, 0, - 1, 1, 4 * CHAN_BITS / 8 - }, - { - MESA_FORMAT_RGB, - GL_RGB, - GL_UNSIGNED_NORMALIZED, - CHAN_BITS, CHAN_BITS, CHAN_BITS, 0, - 0, 0, 0, 0, 0, - 1, 1, 3 * CHAN_BITS / 8 - }, - { - MESA_FORMAT_ALPHA, - GL_ALPHA, - GL_UNSIGNED_NORMALIZED, - 0, 0, 0, CHAN_BITS, - 0, 0, 0, 0, 0, - 1, 1, 1 * CHAN_BITS / 8 - }, - { - MESA_FORMAT_LUMINANCE, - GL_LUMINANCE, - GL_UNSIGNED_NORMALIZED, - 0, 0, 0, 0, - CHAN_BITS, 0, 0, 0, 0, - 1, 1, 1 * CHAN_BITS / 8 - }, - { - MESA_FORMAT_LUMINANCE_ALPHA, - GL_LUMINANCE_ALPHA, - GL_UNSIGNED_NORMALIZED, - 0, 0, 0, CHAN_BITS, - CHAN_BITS, 0, 0, 0, 0, - 1, 1, 2 * CHAN_BITS / 8 - }, - { - MESA_FORMAT_INTENSITY, - GL_INTENSITY, - GL_UNSIGNED_NORMALIZED, - 0, 0, 0, 0, - 0, CHAN_BITS, 0, 0, 0, - 1, 1, 1 * CHAN_BITS / 8 - }, { MESA_FORMAT_RGBA_FLOAT32, GL_RGBA, diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index dbde28e727..9235828a0f 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -43,6 +43,7 @@ typedef enum { MESA_FORMAT_NONE = 0, + /** * \name Basic hardware formats */ @@ -114,18 +115,6 @@ typedef enum #endif /*@}*/ - /** - * \name Generic GLchan-based formats. (XXX obsolete!) - */ - /*@{*/ - MESA_FORMAT_RGBA, - MESA_FORMAT_RGB, - MESA_FORMAT_ALPHA, - MESA_FORMAT_LUMINANCE, - MESA_FORMAT_LUMINANCE_ALPHA, - MESA_FORMAT_INTENSITY, - /*@}*/ - /** * \name Floating point texture formats. */ diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 7e99a5d3de..ccd153303d 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -1521,11 +1521,11 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, texObj->Target == GL_TEXTURE_CUBE_MAP_ARB); if (srcImage->_BaseFormat == GL_RGB) { - convertFormat = MESA_FORMAT_RGB; + convertFormat = MESA_FORMAT_RGB888; components = 3; } else if (srcImage->_BaseFormat == GL_RGBA) { - convertFormat = MESA_FORMAT_RGBA; + convertFormat = MESA_FORMAT_RGBA8888; components = 4; } else { diff --git a/src/mesa/main/texfetch.c b/src/mesa/main/texfetch.c index 20ee2527f5..8149166560 100644 --- a/src/mesa/main/texfetch.c +++ b/src/mesa/main/texfetch.c @@ -127,48 +127,6 @@ static struct { } texfetch_funcs[MESA_FORMAT_COUNT] = { - { - MESA_FORMAT_RGBA, - fetch_texel_1d_f_rgba, - fetch_texel_2d_f_rgba, - fetch_texel_3d_f_rgba, - store_texel_rgba - }, - { - MESA_FORMAT_RGB, - fetch_texel_1d_f_rgb, - fetch_texel_2d_f_rgb, - fetch_texel_3d_f_rgb, - store_texel_rgb - }, - { - MESA_FORMAT_ALPHA, - fetch_texel_1d_f_alpha, - fetch_texel_2d_f_alpha, - fetch_texel_3d_f_alpha, - store_texel_alpha - }, - { - MESA_FORMAT_LUMINANCE, - fetch_texel_1d_f_luminance, - fetch_texel_2d_f_luminance, - fetch_texel_3d_f_luminance, - store_texel_luminance - }, - { - MESA_FORMAT_LUMINANCE_ALPHA, - fetch_texel_1d_f_luminance_alpha, - fetch_texel_2d_f_luminance_alpha, - fetch_texel_3d_f_luminance_alpha, - store_texel_luminance_alpha - }, - { - MESA_FORMAT_INTENSITY, - fetch_texel_1d_f_intensity, - fetch_texel_2d_f_intensity, - fetch_texel_3d_f_intensity, - store_texel_intensity - }, { MESA_FORMAT_SRGB8, fetch_texel_1d_srgb8, diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index bee7f583cf..b1ae324050 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -69,7 +69,6 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, case GL_RGB10_A2: case GL_RGBA12: case GL_RGBA16: - return MESA_FORMAT_RGBA; case GL_RGBA8: return MESA_FORMAT_RGBA8888; case GL_RGB5_A1: @@ -85,7 +84,6 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, case GL_RGB10: case GL_RGB12: case GL_RGB16: - return MESA_FORMAT_RGB; case GL_RGB8: return MESA_FORMAT_RGB888; case GL_R3_G3_B2: @@ -100,7 +98,6 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, case GL_ALPHA4: case GL_ALPHA12: case GL_ALPHA16: - return MESA_FORMAT_ALPHA; case GL_ALPHA8: return MESA_FORMAT_A8; @@ -110,7 +107,6 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, case GL_LUMINANCE4: case GL_LUMINANCE12: case GL_LUMINANCE16: - return MESA_FORMAT_LUMINANCE; case GL_LUMINANCE8: return MESA_FORMAT_L8; @@ -122,7 +118,6 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, case GL_LUMINANCE12_ALPHA4: case GL_LUMINANCE12_ALPHA12: case GL_LUMINANCE16_ALPHA16: - return MESA_FORMAT_LUMINANCE_ALPHA; case GL_LUMINANCE8_ALPHA8: return MESA_FORMAT_AL88; @@ -130,7 +125,6 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, case GL_INTENSITY4: case GL_INTENSITY12: case GL_INTENSITY16: - return MESA_FORMAT_INTENSITY; case GL_INTENSITY8: return MESA_FORMAT_I8; @@ -162,13 +156,13 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, switch (internalFormat) { case GL_COMPRESSED_ALPHA_ARB: - return MESA_FORMAT_ALPHA; + return MESA_FORMAT_A8; case GL_COMPRESSED_LUMINANCE_ARB: - return MESA_FORMAT_LUMINANCE; + return MESA_FORMAT_L8; case GL_COMPRESSED_LUMINANCE_ALPHA_ARB: - return MESA_FORMAT_LUMINANCE_ALPHA; + return MESA_FORMAT_AL88; case GL_COMPRESSED_INTENSITY_ARB: - return MESA_FORMAT_INTENSITY; + return MESA_FORMAT_I8; case GL_COMPRESSED_RGB_ARB: #if FEATURE_texture_fxt1 if (ctx->Extensions.TDFX_texture_compression_FXT1) @@ -179,7 +173,7 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, ctx->Extensions.S3_s3tc) return MESA_FORMAT_RGB_DXT1; #endif - return MESA_FORMAT_RGB; + return MESA_FORMAT_RGB888; case GL_COMPRESSED_RGBA_ARB: #if FEATURE_texture_fxt1 if (ctx->Extensions.TDFX_texture_compression_FXT1) @@ -190,7 +184,7 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, ctx->Extensions.S3_s3tc) return MESA_FORMAT_RGBA_DXT3; /* Not rgba_dxt1, see spec */ #endif - return MESA_FORMAT_RGBA; + return MESA_FORMAT_RGBA8888; default: ; /* fallthrough */ } @@ -504,25 +498,6 @@ _mesa_format_to_type_and_comps(gl_format format, return; #endif - case MESA_FORMAT_RGBA: - *datatype = CHAN_TYPE; - *comps = 4; - return; - case MESA_FORMAT_RGB: - *datatype = CHAN_TYPE; - *comps = 3; - return; - case MESA_FORMAT_LUMINANCE_ALPHA: - *datatype = CHAN_TYPE; - *comps = 2; - return; - case MESA_FORMAT_ALPHA: - case MESA_FORMAT_LUMINANCE: - case MESA_FORMAT_INTENSITY: - *datatype = CHAN_TYPE; - *comps = 1; - return; - case MESA_FORMAT_RGBA_FLOAT32: *datatype = GL_FLOAT; *comps = 4; diff --git a/src/mesa/main/texformat_tmp.h b/src/mesa/main/texformat_tmp.h index cb8386bbc8..939c4d0776 100644 --- a/src/mesa/main/texformat_tmp.h +++ b/src/mesa/main/texformat_tmp.h @@ -70,152 +70,6 @@ #endif -/* MESA_FORMAT_RGBA **********************************************************/ - -/* Fetch texel from 1D, 2D or 3D RGBA texture, returning 4 GLfloats */ -static void FETCH(f_rgba)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLchan *src = TEXEL_ADDR(GLchan, texImage, i, j, k, 4); - texel[RCOMP] = CHAN_TO_FLOAT(src[0]); - texel[GCOMP] = CHAN_TO_FLOAT(src[1]); - texel[BCOMP] = CHAN_TO_FLOAT(src[2]); - texel[ACOMP] = CHAN_TO_FLOAT(src[3]); -} - -#if DIM == 3 -/* Store a GLchan RGBA texel */ -static void store_texel_rgba(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLchan *rgba = (const GLchan *) texel; - GLchan *dst = TEXEL_ADDR(GLchan, texImage, i, j, k, 4); - dst[0] = rgba[RCOMP]; - dst[1] = rgba[GCOMP]; - dst[2] = rgba[BCOMP]; - dst[3] = rgba[ACOMP]; -} -#endif - -/* MESA_FORMAT_RGB ***********************************************************/ - -/* Fetch texel from 1D, 2D or 3D RGB texture, returning 4 GLfloats */ -static void FETCH(f_rgb)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLchan *src = TEXEL_ADDR(GLchan, texImage, i, j, k, 3); - texel[RCOMP] = CHAN_TO_FLOAT(src[0]); - texel[GCOMP] = CHAN_TO_FLOAT(src[1]); - texel[BCOMP] = CHAN_TO_FLOAT(src[2]); - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_rgb(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLchan *rgba = (const GLchan *) texel; - GLchan *dst = TEXEL_ADDR(GLchan, texImage, i, j, k, 3); - dst[0] = rgba[RCOMP]; - dst[1] = rgba[GCOMP]; - dst[2] = rgba[BCOMP]; -} -#endif - -/* MESA_FORMAT_ALPHA *********************************************************/ - -/* Fetch texel from 1D, 2D or 3D ALPHA texture, returning 4 GLchans */ -static void FETCH(f_alpha)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLchan *src = TEXEL_ADDR(GLchan, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = 0.0F; - texel[ACOMP] = CHAN_TO_FLOAT(src[0]); -} - -#if DIM == 3 -static void store_texel_alpha(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLchan *rgba = (const GLchan *) texel; - GLchan *dst = TEXEL_ADDR(GLchan, texImage, i, j, k, 1); - dst[0] = rgba[ACOMP]; -} -#endif - -/* MESA_FORMAT_LUMINANCE *****************************************************/ - -/* Fetch texel from 1D, 2D or 3D LUMIN texture, returning 4 GLchans */ -static void FETCH(f_luminance)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLchan *src = TEXEL_ADDR(GLchan, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = CHAN_TO_FLOAT(src[0]); - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_luminance(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLchan *rgba = (const GLchan *) texel; - GLchan *dst = TEXEL_ADDR(GLchan, texImage, i, j, k, 1); - dst[0] = rgba[RCOMP]; -} -#endif - -/* MESA_FORMAT_LUMINANCE_ALPHA ***********************************************/ - -/* Fetch texel from 1D, 2D or 3D L_A texture, returning 4 GLchans */ -static void FETCH(f_luminance_alpha)(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel) -{ - const GLchan *src = TEXEL_ADDR(GLchan, texImage, i, j, k, 2); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = CHAN_TO_FLOAT(src[0]); - texel[ACOMP] = CHAN_TO_FLOAT(src[1]); -} - -#if DIM == 3 -static void store_texel_luminance_alpha(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLchan *rgba = (const GLchan *) texel; - GLchan *dst = TEXEL_ADDR(GLchan, texImage, i, j, k, 2); - dst[0] = rgba[RCOMP]; - dst[1] = rgba[ACOMP]; -} -#endif - -/* MESA_FORMAT_INTENSITY *****************************************************/ - -/* Fetch texel from 1D, 2D or 3D INT. texture, returning 4 GLchans */ -static void FETCH(f_intensity)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLchan *src = TEXEL_ADDR(GLchan, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = - texel[ACOMP] = CHAN_TO_FLOAT(src[0]); -} - -#if DIM == 3 -static void store_texel_intensity(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLchan *rgba = (const GLchan *) texel; - GLchan *dst = TEXEL_ADDR(GLchan, texImage, i, j, k, 1); - dst[0] = rgba[RCOMP]; -} -#endif - - /* MESA_FORMAT_Z32 ***********************************************************/ /* Fetch depth texel from 1D, 2D or 3D 32-bit depth texture, diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index d5bc16dee4..56d6c63906 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -1004,164 +1004,6 @@ memcpy_texture(GLcontext *ctx, -/** - * Store an image in any of the formats: - * _mesa_texformat_rgba - * _mesa_texformat_rgb - * _mesa_texformat_alpha - * _mesa_texformat_luminance - * _mesa_texformat_luminance_alpha - * _mesa_texformat_intensity - * - */ -static GLboolean -_mesa_texstore_rgba(TEXSTORE_PARAMS) -{ - const GLint components = _mesa_components_in_format(baseInternalFormat); - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); - const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - - ASSERT(dstFormat == MESA_FORMAT_RGBA || - dstFormat == MESA_FORMAT_RGB || - dstFormat == MESA_FORMAT_ALPHA || - dstFormat == MESA_FORMAT_LUMINANCE || - dstFormat == MESA_FORMAT_LUMINANCE_ALPHA || - dstFormat == MESA_FORMAT_INTENSITY); - ASSERT(baseInternalFormat == GL_RGBA || - baseInternalFormat == GL_RGB || - baseInternalFormat == GL_ALPHA || - baseInternalFormat == GL_LUMINANCE || - baseInternalFormat == GL_LUMINANCE_ALPHA || - baseInternalFormat == GL_INTENSITY); - ASSERT(texelBytes == components * sizeof(GLchan)); - - if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - baseInternalFormat == srcFormat && - srcType == CHAN_TYPE) { - /* simple memcpy path */ - memcpy_texture(ctx, dims, - dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, - dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - } - else if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - dstFormat == MESA_FORMAT_RGB && - srcFormat == GL_RGBA && - srcType == CHAN_TYPE) { - /* extract RGB from RGBA */ - GLint img, row, col; - for (img = 0; img < srcDepth; img++) { - GLchan *dstImage = (GLchan *) - ((GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * texelBytes - + dstYoffset * dstRowStride - + dstXoffset * texelBytes); - - const GLint srcRowStride = _mesa_image_row_stride(srcPacking, - srcWidth, srcFormat, srcType); - GLchan *srcRow = (GLchan *) _mesa_image_address(dims, srcPacking, - srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, 0, 0); - GLchan *dstRow = dstImage; - for (row = 0; row < srcHeight; row++) { - for (col = 0; col < srcWidth; col++) { - dstRow[col * 3 + RCOMP] = srcRow[col * 4 + RCOMP]; - dstRow[col * 3 + GCOMP] = srcRow[col * 4 + GCOMP]; - dstRow[col * 3 + BCOMP] = srcRow[col * 4 + BCOMP]; - } - dstRow += dstRowStride / sizeof(GLchan); - srcRow = (GLchan *) ((GLubyte *) srcRow + srcRowStride); - } - } - } - else if (!ctx->_ImageTransferState && - CHAN_TYPE == GL_UNSIGNED_BYTE && - (srcType == GL_UNSIGNED_BYTE || - srcType == GL_UNSIGNED_INT_8_8_8_8 || - srcType == GL_UNSIGNED_INT_8_8_8_8_REV) && - can_swizzle(baseInternalFormat) && - can_swizzle(srcFormat)) { - - const GLubyte *dstmap; - GLuint components; - - /* dstmap - how to swizzle from RGBA to dst format: - */ - if (dstFormat == MESA_FORMAT_RGBA) { - dstmap = mappings[IDX_RGBA].from_rgba; - components = 4; - } - else if (dstFormat == MESA_FORMAT_RGB) { - dstmap = mappings[IDX_RGB].from_rgba; - components = 3; - } - else if (dstFormat == MESA_FORMAT_ALPHA) { - dstmap = mappings[IDX_ALPHA].from_rgba; - components = 1; - } - else if (dstFormat == MESA_FORMAT_LUMINANCE) { - dstmap = mappings[IDX_LUMINANCE].from_rgba; - components = 1; - } - else if (dstFormat == MESA_FORMAT_LUMINANCE_ALPHA) { - dstmap = mappings[IDX_LUMINANCE_ALPHA].from_rgba; - components = 2; - } - else if (dstFormat == MESA_FORMAT_INTENSITY) { - dstmap = mappings[IDX_INTENSITY].from_rgba; - components = 1; - } - else { - _mesa_problem(ctx, "Unexpected dstFormat in _mesa_texstore_rgba"); - return GL_FALSE; - } - - _mesa_swizzle_ubyte_image(ctx, dims, - srcFormat, - srcType, - baseInternalFormat, - dstmap, components, - dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcAddr, - srcPacking); - } - else { - /* general path */ - const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, - baseInternalFormat, - baseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, srcAddr, - srcPacking); - const GLchan *src = tempImage; - GLint bytesPerRow; - GLint img, row; - if (!tempImage) - return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); - bytesPerRow = srcWidth * components * sizeof(GLchan); - for (img = 0; img < srcDepth; img++) { - GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * texelBytes - + dstYoffset * dstRowStride - + dstXoffset * texelBytes; - for (row = 0; row < srcHeight; row++) { - _mesa_memcpy(dstRow, src, bytesPerRow); - dstRow += dstRowStride; - src += srcWidth * components; - } - } - - _mesa_free((void *) tempImage); - } - return GL_TRUE; -} - - /** * Store a 32-bit integer depth component texture image. */ @@ -3230,12 +3072,6 @@ texstore_funcs[MESA_FORMAT_COUNT] = { MESA_FORMAT_RGBA_DXT1, _mesa_texstore_rgba_dxt1 }, { MESA_FORMAT_RGBA_DXT3, _mesa_texstore_rgba_dxt3 }, { MESA_FORMAT_RGBA_DXT5, _mesa_texstore_rgba_dxt5 }, - { MESA_FORMAT_RGBA, _mesa_texstore_rgba }, - { MESA_FORMAT_RGB, _mesa_texstore_rgba }, - { MESA_FORMAT_ALPHA, _mesa_texstore_rgba }, - { MESA_FORMAT_LUMINANCE, _mesa_texstore_rgba }, - { MESA_FORMAT_LUMINANCE_ALPHA, _mesa_texstore_rgba }, - { MESA_FORMAT_INTENSITY, _mesa_texstore_rgba }, { MESA_FORMAT_RGBA_FLOAT32, _mesa_texstore_rgba_float32 }, { MESA_FORMAT_RGBA_FLOAT16, _mesa_texstore_rgba_float16 }, { MESA_FORMAT_RGB_FLOAT32, _mesa_texstore_rgba_float32 }, diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index 11c8f9256a..6cba8ed34b 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -1343,17 +1343,17 @@ opt_sample_rgb_2d(GLcontext *ctx, ASSERT(tObj->WrapS==GL_REPEAT); ASSERT(tObj->WrapT==GL_REPEAT); ASSERT(img->Border==0); - ASSERT(img->TexFormat == MESA_FORMAT_RGB); + ASSERT(img->TexFormat == MESA_FORMAT_RGB888); ASSERT(img->_IsPowerOfTwo); for (k=0; kData) + 3*pos; - rgba[k][RCOMP] = CHAN_TO_FLOAT(texel[0]); - rgba[k][GCOMP] = CHAN_TO_FLOAT(texel[1]); - rgba[k][BCOMP] = CHAN_TO_FLOAT(texel[2]); + GLubyte *texel = ((GLubyte *) img->Data) + 3*pos; + rgba[k][RCOMP] = UBYTE_TO_FLOAT(texel[0]); + rgba[k][GCOMP] = UBYTE_TO_FLOAT(texel[1]); + rgba[k][BCOMP] = UBYTE_TO_FLOAT(texel[2]); } } @@ -1384,18 +1384,18 @@ opt_sample_rgba_2d(GLcontext *ctx, ASSERT(tObj->WrapS==GL_REPEAT); ASSERT(tObj->WrapT==GL_REPEAT); ASSERT(img->Border==0); - ASSERT(img->TexFormat == MESA_FORMAT_RGBA); + ASSERT(img->TexFormat == MESA_FORMAT_RGBA8888); ASSERT(img->_IsPowerOfTwo); for (i = 0; i < n; i++) { const GLint col = IFLOOR(texcoords[i][0] * width) & colMask; const GLint row = IFLOOR(texcoords[i][1] * height) & rowMask; const GLint pos = (row << shift) | col; - const GLchan *texel = ((GLchan *) img->Data) + (pos << 2); /* pos*4 */ - rgba[i][RCOMP] = CHAN_TO_FLOAT(texel[0]); - rgba[i][GCOMP] = CHAN_TO_FLOAT(texel[1]); - rgba[i][BCOMP] = CHAN_TO_FLOAT(texel[2]); - rgba[i][ACOMP] = CHAN_TO_FLOAT(texel[3]); + const GLubyte *texel = ((GLubyte *) img->Data) + (pos << 2); /* pos*4 */ + rgba[i][RCOMP] = UBYTE_TO_FLOAT(texel[0]); + rgba[i][GCOMP] = UBYTE_TO_FLOAT(texel[1]); + rgba[i][BCOMP] = UBYTE_TO_FLOAT(texel[2]); + rgba[i][ACOMP] = UBYTE_TO_FLOAT(texel[3]); } } @@ -1428,11 +1428,11 @@ sample_lambda_2d(GLcontext *ctx, case GL_NEAREST: if (repeatNoBorderPOT) { switch (tImg->TexFormat) { - case MESA_FORMAT_RGB: + case MESA_FORMAT_RGB888: opt_sample_rgb_2d(ctx, tObj, m, texcoords + minStart, NULL, rgba + minStart); break; - case MESA_FORMAT_RGBA: + case MESA_FORMAT_RGBA8888: opt_sample_rgba_2d(ctx, tObj, m, texcoords + minStart, NULL, rgba + minStart); break; @@ -1485,11 +1485,11 @@ sample_lambda_2d(GLcontext *ctx, case GL_NEAREST: if (repeatNoBorderPOT) { switch (tImg->TexFormat) { - case MESA_FORMAT_RGB: + case MESA_FORMAT_RGB888: opt_sample_rgb_2d(ctx, tObj, m, texcoords + magStart, NULL, rgba + magStart); break; - case MESA_FORMAT_RGBA: + case MESA_FORMAT_RGBA8888: opt_sample_rgba_2d(ctx, tObj, m, texcoords + magStart, NULL, rgba + magStart); break; @@ -3137,7 +3137,7 @@ null_sample_func( GLcontext *ctx, rgba[i][RCOMP] = 0; rgba[i][GCOMP] = 0; rgba[i][BCOMP] = 0; - rgba[i][ACOMP] = CHAN_MAX; + rgba[i][ACOMP] = 1.0; } } @@ -3189,14 +3189,14 @@ _swrast_choose_texture_sample_func( GLcontext *ctx, t->WrapT == GL_REPEAT && img->_IsPowerOfTwo && img->Border == 0 && - img->TexFormat == MESA_FORMAT_RGB) { + img->TexFormat == MESA_FORMAT_RGB888) { return &opt_sample_rgb_2d; } else if (t->WrapS == GL_REPEAT && t->WrapT == GL_REPEAT && img->_IsPowerOfTwo && img->Border == 0 && - img->TexFormat == MESA_FORMAT_RGBA) { + img->TexFormat == MESA_FORMAT_RGBA8888) { return &opt_sample_rgba_2d; } else { diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index 7b59763f11..6a61bec245 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -140,7 +140,7 @@ _swrast_culltriangle( GLcontext *ctx, const GLfloat twidth = (GLfloat) obj->Image[0][b]->Width; \ const GLfloat theight = (GLfloat) obj->Image[0][b]->Height; \ const GLint twidth_log2 = obj->Image[0][b]->WidthLog2; \ - const GLchan *texture = (const GLchan *) obj->Image[0][b]->Data; \ + const GLubyte *texture = (const GLubyte *) obj->Image[0][b]->Data; \ const GLint smask = obj->Image[0][b]->Width - 1; \ const GLint tmask = obj->Image[0][b]->Height - 1; \ if (!rb || !texture) { \ @@ -149,7 +149,7 @@ _swrast_culltriangle( GLcontext *ctx, #define RENDER_SPAN( span ) \ GLuint i; \ - GLchan rgb[MAX_WIDTH][3]; \ + GLubyte rgb[MAX_WIDTH][3]; \ span.intTex[0] -= FIXED_HALF; /* off-by-one error? */ \ span.intTex[1] -= FIXED_HALF; \ for (i = 0; i < span.end; i++) { \ @@ -192,7 +192,7 @@ _swrast_culltriangle( GLcontext *ctx, const GLfloat twidth = (GLfloat) obj->Image[0][b]->Width; \ const GLfloat theight = (GLfloat) obj->Image[0][b]->Height; \ const GLint twidth_log2 = obj->Image[0][b]->WidthLog2; \ - const GLchan *texture = (const GLchan *) obj->Image[0][b]->Data; \ + const GLubyte *texture = (const GLubyte *) obj->Image[0][b]->Data; \ const GLint smask = obj->Image[0][b]->Width - 1; \ const GLint tmask = obj->Image[0][b]->Height - 1; \ if (!rb || !texture) { \ @@ -201,7 +201,7 @@ _swrast_culltriangle( GLcontext *ctx, #define RENDER_SPAN( span ) \ GLuint i; \ - GLchan rgb[MAX_WIDTH][3]; \ + GLubyte rgb[MAX_WIDTH][3]; \ span.intTex[0] -= FIXED_HALF; /* off-by-one error? */ \ span.intTex[1] -= FIXED_HALF; \ for (i = 0; i < span.end; i++) { \ @@ -1075,7 +1075,7 @@ _swrast_choose_triangle( GLcontext *ctx ) && texImg->_IsPowerOfTwo && texImg->Border == 0 && texImg->Width == texImg->RowStride - && (format == MESA_FORMAT_RGB || format == MESA_FORMAT_RGBA) + && (format == MESA_FORMAT_RGB888 || format == MESA_FORMAT_RGBA8888) && minFilter == magFilter && ctx->Light.Model.ColorControl == GL_SINGLE_COLOR && !swrast->_FogEnabled @@ -1083,7 +1083,7 @@ _swrast_choose_triangle( GLcontext *ctx ) && ctx->Texture.Unit[0].EnvMode != GL_COMBINE4_NV) { if (ctx->Hint.PerspectiveCorrection==GL_FASTEST) { if (minFilter == GL_NEAREST - && format == MESA_FORMAT_RGB + && format == MESA_FORMAT_RGB888 && (envMode == GL_REPLACE || envMode == GL_DECAL) && ((swrast->_RasterMask == (DEPTH_BIT | TEXTURE_BIT) && ctx->Depth.Func == GL_LESS -- cgit v1.2.3 From 60843e3ee59b00cee4ec1048823d1dd24756d849 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 30 Sep 2009 21:04:14 -0600 Subject: mesa: remove MESA_FORMAT_RGBA4444 Not used by any hardware driver. ARGB4444 and ARGB4444_REV remain. --- src/mesa/main/formats.c | 8 ------ src/mesa/main/formats.h | 1 - src/mesa/main/texfetch.c | 7 ------ src/mesa/main/texformat_tmp.h | 24 ------------------ src/mesa/main/texstore.c | 58 ------------------------------------------- 5 files changed, 98 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index f915b1da91..dec3daee7c 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -109,14 +109,6 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ 1, 1, 2 /* BlockWidth/Height,Bytes */ }, - { - MESA_FORMAT_RGBA4444, /* Name */ - GL_RGBA, /* BaseFormat */ - GL_UNSIGNED_NORMALIZED, /* DataType */ - 4, 4, 4, 4, /* Red/Green/Blue/AlphaBits */ - 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ - 1, 1, 2 /* BlockWidth/Height,Bytes */ - }, { MESA_FORMAT_ARGB4444, /* Name */ GL_RGBA, /* BaseFormat */ diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index 9235828a0f..99a6534ff1 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -58,7 +58,6 @@ typedef enum MESA_FORMAT_BGR888, /* BBBB BBBB GGGG GGGG RRRR RRRR */ MESA_FORMAT_RGB565, /* RRRR RGGG GGGB BBBB */ MESA_FORMAT_RGB565_REV, /* GGGB BBBB RRRR RGGG */ - MESA_FORMAT_RGBA4444, /* RRRR GGGG BBBB AAAA */ MESA_FORMAT_ARGB4444, /* AAAA RRRR GGGG BBBB */ MESA_FORMAT_ARGB4444_REV, /* GGGG BBBB AAAA RRRR */ MESA_FORMAT_RGBA5551, /* RRRR RGGG GGBB BBBA */ diff --git a/src/mesa/main/texfetch.c b/src/mesa/main/texfetch.c index 8149166560..3cc424fdc8 100644 --- a/src/mesa/main/texfetch.c +++ b/src/mesa/main/texfetch.c @@ -393,13 +393,6 @@ texfetch_funcs[MESA_FORMAT_COUNT] = fetch_texel_3d_f_rgb565_rev, store_texel_rgb565_rev }, - { - MESA_FORMAT_RGBA4444, - fetch_texel_1d_f_rgba4444, - fetch_texel_2d_f_rgba4444, - fetch_texel_3d_f_rgba4444, - store_texel_rgba4444 - }, { MESA_FORMAT_ARGB4444, fetch_texel_1d_f_argb4444, diff --git a/src/mesa/main/texformat_tmp.h b/src/mesa/main/texformat_tmp.h index 939c4d0776..199849d6ac 100644 --- a/src/mesa/main/texformat_tmp.h +++ b/src/mesa/main/texformat_tmp.h @@ -641,30 +641,6 @@ static void store_texel_rgb565_rev(struct gl_texture_image *texImage, } #endif -/* MESA_FORMAT_RGBA4444 ******************************************************/ - -/* Fetch texel from 1D, 2D or 3D argb444 texture, return 4 GLchans */ -static void FETCH(f_rgba4444)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - const GLushort s = *src; - texel[RCOMP] = ((s >> 12) & 0xf) * (1.0F / 15.0F); - texel[GCOMP] = ((s >> 8) & 0xf) * (1.0F / 15.0F); - texel[BCOMP] = ((s >> 4) & 0xf) * (1.0F / 15.0F); - texel[ACOMP] = ((s ) & 0xf) * (1.0F / 15.0F); -} - -#if DIM == 3 -static void store_texel_rgba4444(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_4444(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); -} -#endif - /* MESA_FORMAT_ARGB4444 ******************************************************/ diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 56d6c63906..48bee88e0f 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -1766,63 +1766,6 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS) return GL_TRUE; } -static GLboolean -_mesa_texstore_rgba4444(TEXSTORE_PARAMS) -{ - const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); - const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - - ASSERT(dstFormat == MESA_FORMAT_RGBA4444); - ASSERT(texelBytes == 2); - - if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - dstFormat == MESA_FORMAT_RGBA4444 && - baseInternalFormat == GL_RGBA && - srcFormat == GL_RGBA && - srcType == GL_UNSIGNED_SHORT_4_4_4_4){ - /* simple memcpy path */ - memcpy_texture(ctx, dims, - dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, - dstRowStride, - dstImageOffsets, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - } - else { - /* general path */ - const GLchan *tempImage = _mesa_make_temp_chan_image(ctx, dims, - baseInternalFormat, - baseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, srcAddr, - srcPacking); - const GLchan *src = tempImage; - GLint img, row, col; - if (!tempImage) - return GL_FALSE; - _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); - for (img = 0; img < srcDepth; img++) { - GLubyte *dstRow = (GLubyte *) dstAddr - + dstImageOffsets[dstZoffset + img] * texelBytes - + dstYoffset * dstRowStride - + dstXoffset * texelBytes; - for (row = 0; row < srcHeight; row++) { - GLushort *dstUS = (GLushort *) dstRow; - for (col = 0; col < srcWidth; col++) { - dstUS[col] = PACK_COLOR_4444( CHAN_TO_UBYTE(src[RCOMP]), - CHAN_TO_UBYTE(src[GCOMP]), - CHAN_TO_UBYTE(src[BCOMP]), - CHAN_TO_UBYTE(src[ACOMP]) ); - src += 4; - } - dstRow += dstRowStride; - } - } - _mesa_free((void *) tempImage); - } - return GL_TRUE; -} static GLboolean _mesa_texstore_argb4444(TEXSTORE_PARAMS) @@ -3037,7 +2980,6 @@ texstore_funcs[MESA_FORMAT_COUNT] = { MESA_FORMAT_BGR888, _mesa_texstore_bgr888 }, { MESA_FORMAT_RGB565, _mesa_texstore_rgb565 }, { MESA_FORMAT_RGB565_REV, _mesa_texstore_rgb565 }, - { MESA_FORMAT_RGBA4444, _mesa_texstore_rgba4444 }, { MESA_FORMAT_ARGB4444, _mesa_texstore_argb4444 }, { MESA_FORMAT_ARGB4444_REV, _mesa_texstore_argb4444 }, { MESA_FORMAT_RGBA5551, _mesa_texstore_rgba5551 }, -- cgit v1.2.3 From 3d6a20e5b6c7567ed64fceed7744cf39eea34400 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 30 Sep 2009 21:08:06 -0600 Subject: mesa: rename texformat_tmp.h to texfetch_tmp.h --- src/mesa/main/texfetch.c | 6 +- src/mesa/main/texfetch_tmp.h | 1302 ++++++++++++++++++++++++++++++++++++++++ src/mesa/main/texformat_tmp.h | 1304 ----------------------------------------- 3 files changed, 1305 insertions(+), 1307 deletions(-) create mode 100644 src/mesa/main/texfetch_tmp.h delete mode 100644 src/mesa/main/texformat_tmp.h (limited to 'src/mesa') diff --git a/src/mesa/main/texfetch.c b/src/mesa/main/texfetch.c index 3cc424fdc8..62a8b53409 100644 --- a/src/mesa/main/texfetch.c +++ b/src/mesa/main/texfetch.c @@ -77,13 +77,13 @@ nonlinear_to_linear(GLubyte cs8) /* Texel fetch routines for all supported formats */ #define DIM 1 -#include "texformat_tmp.h" +#include "texfetch_tmp.h" #define DIM 2 -#include "texformat_tmp.h" +#include "texfetch_tmp.h" #define DIM 3 -#include "texformat_tmp.h" +#include "texfetch_tmp.h" /** * Null texel fetch function. diff --git a/src/mesa/main/texfetch_tmp.h b/src/mesa/main/texfetch_tmp.h new file mode 100644 index 0000000000..3ac932b979 --- /dev/null +++ b/src/mesa/main/texfetch_tmp.h @@ -0,0 +1,1302 @@ +/* + * Mesa 3-D graphics library + * Version: 7.7 + * + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (c) 2008-2009 VMware, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * 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 texfetch_tmp.h + * Texel fetch functions template. + * + * This template file is used by texfetch.c to generate texel fetch functions + * for 1-D, 2-D and 3-D texture images. + * + * It should be expanded by defining \p DIM as the number texture dimensions + * (1, 2 or 3). According to the value of \p DIM a series of macros is defined + * for the texel lookup in the gl_texture_image::Data. + * + * \author Gareth Hughes + * \author Brian Paul + */ + + +#if DIM == 1 + +#define TEXEL_ADDR( type, image, i, j, k, size ) \ + ((void) (j), (void) (k), ((type *)(image)->Data + (i) * (size))) + +#define FETCH(x) fetch_texel_1d_##x + +#elif DIM == 2 + +#define TEXEL_ADDR( type, image, i, j, k, size ) \ + ((void) (k), \ + ((type *)(image)->Data + ((image)->RowStride * (j) + (i)) * (size))) + +#define FETCH(x) fetch_texel_2d_##x + +#elif DIM == 3 + +#define TEXEL_ADDR( type, image, i, j, k, size ) \ + ((type *)(image)->Data + ((image)->ImageOffsets[k] \ + + (image)->RowStride * (j) + (i)) * (size)) + +#define FETCH(x) fetch_texel_3d_##x + +#else +#error illegal number of texture dimensions +#endif + + +/* MESA_FORMAT_Z32 ***********************************************************/ + +/* Fetch depth texel from 1D, 2D or 3D 32-bit depth texture, + * returning 1 GLfloat. + * Note: no GLchan version of this function. + */ +static void FETCH(f_z32)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint *src = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[0] = src[0] * (1.0F / 0xffffffff); +} + +#if DIM == 3 +static void store_texel_z32(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLuint *depth = (const GLuint *) texel; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + dst[0] = *depth; +} +#endif + + +/* MESA_FORMAT_Z16 ***********************************************************/ + +/* Fetch depth texel from 1D, 2D or 3D 16-bit depth texture, + * returning 1 GLfloat. + * Note: no GLchan version of this function. + */ +static void FETCH(f_z16)(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + texel[0] = src[0] * (1.0F / 65535.0F); +} + +#if DIM == 3 +static void store_texel_z16(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLushort *depth = (const GLushort *) texel; + GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + dst[0] = *depth; +} +#endif + + +/* MESA_FORMAT_RGBA_F32 ******************************************************/ + +/* Fetch texel from 1D, 2D or 3D RGBA_FLOAT32 texture, returning 4 GLfloats. + */ +static void FETCH(f_rgba_f32)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 4); + texel[RCOMP] = src[0]; + texel[GCOMP] = src[1]; + texel[BCOMP] = src[2]; + texel[ACOMP] = src[3]; +} + +#if DIM == 3 +static void store_texel_rgba_f32(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *depth = (const GLfloat *) texel; + GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); + dst[0] = depth[RCOMP]; + dst[1] = depth[GCOMP]; + dst[2] = depth[BCOMP]; + dst[3] = depth[ACOMP]; +} +#endif + + +/* MESA_FORMAT_RGBA_F16 ******************************************************/ + +/* Fetch texel from 1D, 2D or 3D RGBA_FLOAT16 texture, + * returning 4 GLfloats. + */ +static void FETCH(f_rgba_f16)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 4); + texel[RCOMP] = _mesa_half_to_float(src[0]); + texel[GCOMP] = _mesa_half_to_float(src[1]); + texel[BCOMP] = _mesa_half_to_float(src[2]); + texel[ACOMP] = _mesa_half_to_float(src[3]); +} + +#if DIM == 3 +static void store_texel_rgba_f16(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *depth = (const GLfloat *) texel; + GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); + dst[0] = _mesa_float_to_half(*depth); +} +#endif + +/* MESA_FORMAT_RGB_F32 *******************************************************/ + +/* Fetch texel from 1D, 2D or 3D RGB_FLOAT32 texture, + * returning 4 GLfloats. + */ +static void FETCH(f_rgb_f32)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 3); + texel[RCOMP] = src[0]; + texel[GCOMP] = src[1]; + texel[BCOMP] = src[2]; + texel[ACOMP] = 1.0F; +} + +#if DIM == 3 +static void store_texel_rgb_f32(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *depth = (const GLfloat *) texel; + GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); + dst[0] = *depth; +} +#endif + + +/* MESA_FORMAT_RGB_F16 *******************************************************/ + +/* Fetch texel from 1D, 2D or 3D RGB_FLOAT16 texture, + * returning 4 GLfloats. + */ +static void FETCH(f_rgb_f16)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 3); + texel[RCOMP] = _mesa_half_to_float(src[0]); + texel[GCOMP] = _mesa_half_to_float(src[1]); + texel[BCOMP] = _mesa_half_to_float(src[2]); + texel[ACOMP] = 1.0F; +} + +#if DIM == 3 +static void store_texel_rgb_f16(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *depth = (const GLfloat *) texel; + GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); + dst[0] = _mesa_float_to_half(*depth); +} +#endif + + +/* MESA_FORMAT_ALPHA_F32 *****************************************************/ + +/* Fetch texel from 1D, 2D or 3D ALPHA_FLOAT32 texture, + * returning 4 GLfloats. + */ +static void FETCH(f_alpha_f32)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = 0.0F; + texel[ACOMP] = src[0]; +} + +#if DIM == 3 +static void store_texel_alpha_f32(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *rgba = (const GLfloat *) texel; + GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); + dst[0] = rgba[ACOMP]; +} +#endif + + +/* MESA_FORMAT_ALPHA_F32 *****************************************************/ + +/* Fetch texel from 1D, 2D or 3D ALPHA_FLOAT16 texture, + * returning 4 GLfloats. + */ +static void FETCH(f_alpha_f16)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = 0.0F; + texel[ACOMP] = _mesa_half_to_float(src[0]); +} + +#if DIM == 3 +static void store_texel_alpha_f16(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *rgba = (const GLfloat *) texel; + GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); + dst[0] = _mesa_float_to_half(rgba[ACOMP]); +} +#endif + + +/* MESA_FORMAT_LUMINANCE_F32 *************************************************/ + +/* Fetch texel from 1D, 2D or 3D LUMINANCE_FLOAT32 texture, + * returning 4 GLfloats. + */ +static void FETCH(f_luminance_f32)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = src[0]; + texel[ACOMP] = 1.0F; +} + +#if DIM == 3 +static void store_texel_luminance_f32(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *rgba = (const GLfloat *) texel; + GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); + dst[0] = rgba[RCOMP]; +} +#endif + + +/* MESA_FORMAT_LUMINANCE_F16 *************************************************/ + +/* Fetch texel from 1D, 2D or 3D LUMINANCE_FLOAT16 texture, + * returning 4 GLfloats. + */ +static void FETCH(f_luminance_f16)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = _mesa_half_to_float(src[0]); + texel[ACOMP] = 1.0F; +} + +#if DIM == 3 +static void store_texel_luminance_f16(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *rgba = (const GLfloat *) texel; + GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); + dst[0] = _mesa_float_to_half(rgba[RCOMP]); +} +#endif + + +/* MESA_FORMAT_LUMINANCE_ALPHA_F32 *******************************************/ + +/* Fetch texel from 1D, 2D or 3D LUMINANCE_ALPHA_FLOAT32 texture, + * returning 4 GLfloats. + */ +static void FETCH(f_luminance_alpha_f32)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 2); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = src[0]; + texel[ACOMP] = src[1]; +} + +#if DIM == 3 +static void store_texel_luminance_alpha_f32(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *rgba = (const GLfloat *) texel; + GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 2); + dst[0] = rgba[RCOMP]; + dst[1] = rgba[ACOMP]; +} +#endif + + +/* MESA_FORMAT_LUMINANCE_ALPHA_F16 *******************************************/ + +/* Fetch texel from 1D, 2D or 3D LUMINANCE_ALPHA_FLOAT16 texture, + * returning 4 GLfloats. + */ +static void FETCH(f_luminance_alpha_f16)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 2); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = _mesa_half_to_float(src[0]); + texel[ACOMP] = _mesa_half_to_float(src[1]); +} + +#if DIM == 3 +static void store_texel_luminance_alpha_f16(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *rgba = (const GLfloat *) texel; + GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 2); + dst[0] = _mesa_float_to_half(rgba[RCOMP]); + dst[1] = _mesa_float_to_half(rgba[ACOMP]); +} +#endif + + +/* MESA_FORMAT_INTENSITY_F32 *************************************************/ + +/* Fetch texel from 1D, 2D or 3D INTENSITY_FLOAT32 texture, + * returning 4 GLfloats. + */ +static void FETCH(f_intensity_f32)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = + texel[ACOMP] = src[0]; +} + +#if DIM == 3 +static void store_texel_intensity_f32(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *rgba = (const GLfloat *) texel; + GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); + dst[0] = rgba[RCOMP]; +} +#endif + + +/* MESA_FORMAT_INTENSITY_F16 *************************************************/ + +/* Fetch texel from 1D, 2D or 3D INTENSITY_FLOAT16 texture, + * returning 4 GLfloats. + */ +static void FETCH(f_intensity_f16)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = + texel[ACOMP] = _mesa_half_to_float(src[0]); +} + +#if DIM == 3 +static void store_texel_intensity_f16(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLfloat *rgba = (const GLfloat *) texel; + GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); + dst[0] = _mesa_float_to_half(rgba[RCOMP]); +} +#endif + + + + +/* + * Begin Hardware formats + */ + +/* MESA_FORMAT_RGBA8888 ******************************************************/ + +/* Fetch texel from 1D, 2D or 3D rgba8888 texture, return 4 GLfloats */ +static void FETCH(f_rgba8888)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 24) ); + texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff ); + texel[BCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff ); + texel[ACOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); +} + + + +#if DIM == 3 +static void store_texel_rgba8888(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + *dst = PACK_COLOR_8888(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); +} +#endif + + +/* MESA_FORMAT_RGBA888_REV ***************************************************/ + +/* Fetch texel from 1D, 2D or 3D abgr8888 texture, return 4 GLchans */ +static void FETCH(f_rgba8888_rev)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[RCOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); + texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff ); + texel[BCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff ); + texel[ACOMP] = UBYTE_TO_FLOAT( (s >> 24) ); +} + +#if DIM == 3 +static void store_texel_rgba8888_rev(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + *dst = PACK_COLOR_8888_REV(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); +} +#endif + + +/* MESA_FORMAT_ARGB8888 ******************************************************/ + +/* Fetch texel from 1D, 2D or 3D argb8888 texture, return 4 GLchans */ +static void FETCH(f_argb8888)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff ); + texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff ); + texel[BCOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); + texel[ACOMP] = UBYTE_TO_FLOAT( (s >> 24) ); +} + +#if DIM == 3 +static void store_texel_argb8888(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + *dst = PACK_COLOR_8888(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); +} +#endif + + +/* MESA_FORMAT_ARGB8888_REV **************************************************/ + +/* Fetch texel from 1D, 2D or 3D argb8888_rev texture, return 4 GLfloats */ +static void FETCH(f_argb8888_rev)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff ); + texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff ); + texel[BCOMP] = UBYTE_TO_FLOAT( (s >> 24) ); + texel[ACOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); +} + +#if DIM == 3 +static void store_texel_argb8888_rev(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + *dst = PACK_COLOR_8888(rgba[BCOMP], rgba[GCOMP], rgba[RCOMP], rgba[ACOMP]); +} +#endif + + +/* MESA_FORMAT_RGB888 ********************************************************/ + +/* Fetch texel from 1D, 2D or 3D rgb888 texture, return 4 GLchans */ +static void FETCH(f_rgb888)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); + texel[RCOMP] = UBYTE_TO_FLOAT( src[2] ); + texel[GCOMP] = UBYTE_TO_FLOAT( src[1] ); + texel[BCOMP] = UBYTE_TO_FLOAT( src[0] ); + texel[ACOMP] = 1.0F; +} + +#if DIM == 3 +static void store_texel_rgb888(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); + dst[0] = rgba[BCOMP]; + dst[1] = rgba[GCOMP]; + dst[2] = rgba[RCOMP]; +} +#endif + + +/* MESA_FORMAT_BGR888 ********************************************************/ + +/* Fetch texel from 1D, 2D or 3D bgr888 texture, return 4 GLchans */ +static void FETCH(f_bgr888)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); + texel[RCOMP] = UBYTE_TO_FLOAT( src[0] ); + texel[GCOMP] = UBYTE_TO_FLOAT( src[1] ); + texel[BCOMP] = UBYTE_TO_FLOAT( src[2] ); + texel[ACOMP] = 1.0F; +} + +#if DIM == 3 +static void store_texel_bgr888(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); + dst[0] = rgba[RCOMP]; + dst[1] = rgba[GCOMP]; + dst[2] = rgba[BCOMP]; +} +#endif + + +/* use color expansion like (g << 2) | (g >> 4) (does somewhat random rounding) + instead of slow (g << 2) * 255 / 252 (always rounds down) */ + +/* MESA_FORMAT_RGB565 ********************************************************/ + +/* Fetch texel from 1D, 2D or 3D rgb565 texture, return 4 GLchans */ +static void FETCH(f_rgb565)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + const GLushort s = *src; + texel[RCOMP] = ((s >> 11) & 0x1f) * (1.0F / 31.0F); + texel[GCOMP] = ((s >> 5 ) & 0x3f) * (1.0F / 63.0F); + texel[BCOMP] = ((s ) & 0x1f) * (1.0F / 31.0F); + texel[ACOMP] = 1.0F; +} + +#if DIM == 3 +static void store_texel_rgb565(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + *dst = PACK_COLOR_565(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); +} +#endif + + +/* MESA_FORMAT_RGB565_REV ****************************************************/ + +/* Fetch texel from 1D, 2D or 3D rgb565_rev texture, return 4 GLchans */ +static void FETCH(f_rgb565_rev)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + const GLushort s = (*src >> 8) | (*src << 8); /* byte swap */ + texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 8) & 0xf8) | ((s >> 13) & 0x7) ); + texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 3) & 0xfc) | ((s >> 9) & 0x3) ); + texel[BCOMP] = UBYTE_TO_FLOAT( ((s << 3) & 0xf8) | ((s >> 2) & 0x7) ); + texel[ACOMP] = 1.0F; +} + +#if DIM == 3 +static void store_texel_rgb565_rev(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + *dst = PACK_COLOR_565(rgba[BCOMP], rgba[GCOMP], rgba[RCOMP]); +} +#endif + + +/* MESA_FORMAT_ARGB4444 ******************************************************/ + +/* Fetch texel from 1D, 2D or 3D argb444 texture, return 4 GLchans */ +static void FETCH(f_argb4444)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + const GLushort s = *src; + texel[RCOMP] = ((s >> 8) & 0xf) * (1.0F / 15.0F); + texel[GCOMP] = ((s >> 4) & 0xf) * (1.0F / 15.0F); + texel[BCOMP] = ((s ) & 0xf) * (1.0F / 15.0F); + texel[ACOMP] = ((s >> 12) & 0xf) * (1.0F / 15.0F); +} + +#if DIM == 3 +static void store_texel_argb4444(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + *dst = PACK_COLOR_4444(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); +} +#endif + + +/* MESA_FORMAT_ARGB4444_REV **************************************************/ + +/* Fetch texel from 1D, 2D or 3D argb4444_rev texture, return 4 GLchans */ +static void FETCH(f_argb4444_rev)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLushort s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + texel[RCOMP] = ((s ) & 0xf) * (1.0F / 15.0F); + texel[GCOMP] = ((s >> 12) & 0xf) * (1.0F / 15.0F); + texel[BCOMP] = ((s >> 8) & 0xf) * (1.0F / 15.0F); + texel[ACOMP] = ((s >> 4) & 0xf) * (1.0F / 15.0F); +} + +#if DIM == 3 +static void store_texel_argb4444_rev(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + *dst = PACK_COLOR_4444(rgba[ACOMP], rgba[BCOMP], rgba[GCOMP], rgba[RCOMP]); +} +#endif + +/* MESA_FORMAT_RGBA5551 ******************************************************/ + +/* Fetch texel from 1D, 2D or 3D argb1555 texture, return 4 GLchans */ +static void FETCH(f_rgba5551)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + const GLushort s = *src; + texel[RCOMP] = ((s >> 11) & 0x1f) * (1.0F / 31.0F); + texel[GCOMP] = ((s >> 6) & 0x1f) * (1.0F / 31.0F); + texel[BCOMP] = ((s >> 1) & 0x1f) * (1.0F / 31.0F); + texel[ACOMP] = ((s ) & 0x01) * 1.0F; +} + +#if DIM == 3 +static void store_texel_rgba5551(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + *dst = PACK_COLOR_5551(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); +} +#endif + +/* MESA_FORMAT_ARGB1555 ******************************************************/ + +/* Fetch texel from 1D, 2D or 3D argb1555 texture, return 4 GLchans */ +static void FETCH(f_argb1555)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + const GLushort s = *src; + texel[RCOMP] = ((s >> 10) & 0x1f) * (1.0F / 31.0F); + texel[GCOMP] = ((s >> 5) & 0x1f) * (1.0F / 31.0F); + texel[BCOMP] = ((s >> 0) & 0x1f) * (1.0F / 31.0F); + texel[ACOMP] = ((s >> 15) & 0x01) * 1.0F; +} + +#if DIM == 3 +static void store_texel_argb1555(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + *dst = PACK_COLOR_1555(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); +} +#endif + + +/* MESA_FORMAT_ARGB1555_REV **************************************************/ + +/* Fetch texel from 1D, 2D or 3D argb1555_rev texture, return 4 GLchans */ +static void FETCH(f_argb1555_rev)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + const GLushort s = (*src << 8) | (*src >> 8); /* byteswap */ + texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 7) & 0xf8) | ((s >> 12) & 0x7) ); + texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 2) & 0xf8) | ((s >> 7) & 0x7) ); + texel[BCOMP] = UBYTE_TO_FLOAT( ((s << 3) & 0xf8) | ((s >> 2) & 0x7) ); + texel[ACOMP] = UBYTE_TO_FLOAT( ((s >> 15) & 0x01) * 255 ); +} + +#if DIM == 3 +static void store_texel_argb1555_rev(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + *dst = PACK_COLOR_1555_REV(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); +} +#endif + + +/* MESA_FORMAT_AL88 **********************************************************/ + +/* Fetch texel from 1D, 2D or 3D al88 texture, return 4 GLchans */ +static void FETCH(f_al88)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLushort s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = UBYTE_TO_FLOAT( s & 0xff ); + texel[ACOMP] = UBYTE_TO_FLOAT( s >> 8 ); +} + +#if DIM == 3 +static void store_texel_al88(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + *dst = PACK_COLOR_88(rgba[ACOMP], rgba[RCOMP]); +} +#endif + + +/* MESA_FORMAT_AL88_REV ******************************************************/ + +/* Fetch texel from 1D, 2D or 3D al88_rev texture, return 4 GLchans */ +static void FETCH(f_al88_rev)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLushort s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = UBYTE_TO_FLOAT( s >> 8 ); + texel[ACOMP] = UBYTE_TO_FLOAT( s & 0xff ); +} + +#if DIM == 3 +static void store_texel_al88_rev(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + *dst = PACK_COLOR_88(rgba[RCOMP], rgba[ACOMP]); +} +#endif + + +/* MESA_FORMAT_RGB332 ********************************************************/ + +/* Fetch texel from 1D, 2D or 3D rgb332 texture, return 4 GLchans */ +static void FETCH(f_rgb332)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); + const GLubyte s = *src; + texel[RCOMP] = ((s >> 5) & 0x7) * (1.0F / 7.0F); + texel[GCOMP] = ((s >> 2) & 0x7) * (1.0F / 7.0F); + texel[BCOMP] = ((s ) & 0x3) * (1.0F / 3.0F); + texel[ACOMP] = 1.0F; +} + +#if DIM == 3 +static void store_texel_rgb332(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); + *dst = PACK_COLOR_332(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); +} +#endif + + +/* MESA_FORMAT_A8 ************************************************************/ + +/* Fetch texel from 1D, 2D or 3D a8 texture, return 4 GLchans */ +static void FETCH(f_a8)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = 0.0F; + texel[ACOMP] = UBYTE_TO_FLOAT( src[0] ); +} + +#if DIM == 3 +static void store_texel_a8(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); + *dst = rgba[ACOMP]; +} +#endif + + +/* MESA_FORMAT_L8 ************************************************************/ + +/* Fetch texel from 1D, 2D or 3D l8 texture, return 4 GLchans */ +static void FETCH(f_l8)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = UBYTE_TO_FLOAT( src[0] ); + texel[ACOMP] = 1.0F; +} + +#if DIM == 3 +static void store_texel_l8(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); + *dst = rgba[RCOMP]; +} +#endif + + +/* MESA_FORMAT_I8 ************************************************************/ + +/* Fetch texel from 1D, 2D or 3D i8 texture, return 4 GLchans */ +static void FETCH(f_i8)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = + texel[ACOMP] = UBYTE_TO_FLOAT( src[0] ); +} + +#if DIM == 3 +static void store_texel_i8(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); + *dst = rgba[RCOMP]; +} +#endif + + +/* MESA_FORMAT_CI8 ***********************************************************/ + +/* Fetch CI texel from 1D, 2D or 3D ci8 texture, lookup the index in a + * color table, and return 4 GLchans. + */ +static void FETCH(f_ci8)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); + const struct gl_color_table *palette; + GLuint index; + GET_CURRENT_CONTEXT(ctx); + + if (ctx->Texture.SharedPalette) { + palette = &ctx->Texture.Palette; + } + else { + palette = &texImage->TexObject->Palette; + } + if (palette->Size == 0) + return; /* undefined results */ + + /* Mask the index against size of palette to avoid going out of bounds */ + index = (*src) & (palette->Size - 1); + + { + const GLfloat *table = palette->TableF; + switch (palette->_BaseFormat) { + case GL_ALPHA: + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = 0.0F; + texel[ACOMP] = table[index]; + break; + case GL_LUMINANCE: + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = table[index]; + texel[ACOMP] = 1.0F; + break; + case GL_INTENSITY: + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = + texel[ACOMP] = table[index]; + break; + case GL_LUMINANCE_ALPHA: + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = table[index * 2 + 0]; + texel[ACOMP] = table[index * 2 + 1]; + break; + case GL_RGB: + texel[RCOMP] = table[index * 3 + 0]; + texel[GCOMP] = table[index * 3 + 1]; + texel[BCOMP] = table[index * 3 + 2]; + texel[ACOMP] = 1.0F; + break; + case GL_RGBA: + texel[RCOMP] = table[index * 4 + 0]; + texel[GCOMP] = table[index * 4 + 1]; + texel[BCOMP] = table[index * 4 + 2]; + texel[ACOMP] = table[index * 4 + 3]; + break; + default: + _mesa_problem(ctx, "Bad palette format in fetch_texel_ci8"); + return; + } + } +} + +#if DIM == 3 +static void store_texel_ci8(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *index = (const GLubyte *) texel; + GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); + *dst = *index; +} +#endif + + +#if FEATURE_EXT_texture_sRGB + +/* Fetch texel from 1D, 2D or 3D srgb8 texture, return 4 GLfloats */ +/* Note: component order is same as for MESA_FORMAT_RGB888 */ +static void FETCH(srgb8)(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); + texel[RCOMP] = nonlinear_to_linear(src[2]); + texel[GCOMP] = nonlinear_to_linear(src[1]); + texel[BCOMP] = nonlinear_to_linear(src[0]); + texel[ACOMP] = 1.0F; +} + +#if DIM == 3 +static void store_texel_srgb8(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); + dst[0] = rgba[BCOMP]; /* no conversion */ + dst[1] = rgba[GCOMP]; + dst[2] = rgba[RCOMP]; +} +#endif + +/* Fetch texel from 1D, 2D or 3D srgba8 texture, return 4 GLfloats */ +static void FETCH(srgba8)(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[RCOMP] = nonlinear_to_linear( (s >> 24) ); + texel[GCOMP] = nonlinear_to_linear( (s >> 16) & 0xff ); + texel[BCOMP] = nonlinear_to_linear( (s >> 8) & 0xff ); + texel[ACOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); /* linear! */ +} + +#if DIM == 3 +static void store_texel_srgba8(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + *dst = PACK_COLOR_8888(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); +} +#endif + +/* Fetch texel from 1D, 2D or 3D sargb8 texture, return 4 GLfloats */ +static void FETCH(sargb8)(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[RCOMP] = nonlinear_to_linear( (s >> 16) & 0xff ); + texel[GCOMP] = nonlinear_to_linear( (s >> 8) & 0xff ); + texel[BCOMP] = nonlinear_to_linear( (s ) & 0xff ); + texel[ACOMP] = UBYTE_TO_FLOAT( (s >> 24) ); /* linear! */ +} + +#if DIM == 3 +static void store_texel_sargb8(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + *dst = PACK_COLOR_8888(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); +} +#endif + +/* Fetch texel from 1D, 2D or 3D sl8 texture, return 4 GLfloats */ +static void FETCH(sl8)(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = nonlinear_to_linear(src[0]); + texel[ACOMP] = 1.0F; +} + +#if DIM == 3 +static void store_texel_sl8(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); + dst[0] = rgba[RCOMP]; +} +#endif + +/* Fetch texel from 1D, 2D or 3D sla8 texture, return 4 GLfloats */ +static void FETCH(sla8)(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 2); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = nonlinear_to_linear(src[0]); + texel[ACOMP] = UBYTE_TO_FLOAT(src[1]); /* linear */ +} + +#if DIM == 3 +static void store_texel_sla8(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 2); + dst[0] = rgba[RCOMP]; + dst[1] = rgba[ACOMP]; +} +#endif + +#endif /* FEATURE_EXT_texture_sRGB */ + + +/* MESA_FORMAT_DUDV8 ********************************************************/ + +/* this format by definition produces 0,0,0,1 as rgba values, + however we'll return the dudv values as rg and fix up elsewhere */ +static void FETCH(dudv8)(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLbyte *src = TEXEL_ADDR(GLbyte, texImage, i, j, k, 2); + texel[RCOMP] = BYTE_TO_FLOAT(src[0]); + texel[GCOMP] = BYTE_TO_FLOAT(src[1]); + texel[BCOMP] = 0; + texel[ACOMP] = 0; +} + +/* MESA_FORMAT_SIGNED_RGBA8888 ***********************************************/ + +static void FETCH(signed_rgba8888)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[RCOMP] = BYTE_TO_FLOAT_TEX( (s >> 24) ); + texel[GCOMP] = BYTE_TO_FLOAT_TEX( (s >> 16) & 0xff ); + texel[BCOMP] = BYTE_TO_FLOAT_TEX( (s >> 8) & 0xff ); + texel[ACOMP] = BYTE_TO_FLOAT_TEX( (s ) & 0xff ); +} + +#if DIM == 3 +static void store_texel_signed_rgba8888(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLbyte *rgba = (const GLbyte *) texel; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + *dst = PACK_COLOR_8888(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); +} +#endif + +static void FETCH(signed_rgba8888_rev)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[RCOMP] = BYTE_TO_FLOAT_TEX( (s ) & 0xff ); + texel[GCOMP] = BYTE_TO_FLOAT_TEX( (s >> 8) & 0xff ); + texel[BCOMP] = BYTE_TO_FLOAT_TEX( (s >> 16) & 0xff ); + texel[ACOMP] = BYTE_TO_FLOAT_TEX( (s >> 24) ); +} + +#if DIM == 3 +static void store_texel_signed_rgba8888_rev(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + *dst = PACK_COLOR_8888_REV(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); +} +#endif + + + +/* MESA_FORMAT_YCBCR *********************************************************/ + +/* Fetch texel from 1D, 2D or 3D ycbcr texture, return 4 GLfloats. + * We convert YCbCr to RGB here. + */ +static void FETCH(f_ycbcr)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLushort *src0 = TEXEL_ADDR(GLushort, texImage, (i & ~1), j, k, 1); /* even */ + const GLushort *src1 = src0 + 1; /* odd */ + const GLubyte y0 = (*src0 >> 8) & 0xff; /* luminance */ + const GLubyte cb = *src0 & 0xff; /* chroma U */ + const GLubyte y1 = (*src1 >> 8) & 0xff; /* luminance */ + const GLubyte cr = *src1 & 0xff; /* chroma V */ + const GLubyte y = (i & 1) ? y1 : y0; /* choose even/odd luminance */ + GLfloat r = 1.164F * (y - 16) + 1.596F * (cr - 128); + GLfloat g = 1.164F * (y - 16) - 0.813F * (cr - 128) - 0.391F * (cb - 128); + GLfloat b = 1.164F * (y - 16) + 2.018F * (cb - 128); + r *= (1.0F / 255.0F); + g *= (1.0F / 255.0F); + b *= (1.0F / 255.0F); + texel[RCOMP] = CLAMP(r, 0.0F, 1.0F); + texel[GCOMP] = CLAMP(g, 0.0F, 1.0F); + texel[BCOMP] = CLAMP(b, 0.0F, 1.0F); + texel[ACOMP] = 1.0F; +} + +#if DIM == 3 +static void store_texel_ycbcr(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + (void) texImage; + (void) i; + (void) j; + (void) k; + (void) texel; + /* XXX to do */ +} +#endif + + +/* MESA_FORMAT_YCBCR_REV *****************************************************/ + +/* Fetch texel from 1D, 2D or 3D ycbcr_rev texture, return 4 GLfloats. + * We convert YCbCr to RGB here. + */ +static void FETCH(f_ycbcr_rev)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLushort *src0 = TEXEL_ADDR(GLushort, texImage, (i & ~1), j, k, 1); /* even */ + const GLushort *src1 = src0 + 1; /* odd */ + const GLubyte y0 = *src0 & 0xff; /* luminance */ + const GLubyte cr = (*src0 >> 8) & 0xff; /* chroma V */ + const GLubyte y1 = *src1 & 0xff; /* luminance */ + const GLubyte cb = (*src1 >> 8) & 0xff; /* chroma U */ + const GLubyte y = (i & 1) ? y1 : y0; /* choose even/odd luminance */ + GLfloat r = 1.164F * (y - 16) + 1.596F * (cr - 128); + GLfloat g = 1.164F * (y - 16) - 0.813F * (cr - 128) - 0.391F * (cb - 128); + GLfloat b = 1.164F * (y - 16) + 2.018F * (cb - 128); + r *= (1.0F / 255.0F); + g *= (1.0F / 255.0F); + b *= (1.0F / 255.0F); + texel[RCOMP] = CLAMP(r, 0.0F, 1.0F); + texel[GCOMP] = CLAMP(g, 0.0F, 1.0F); + texel[BCOMP] = CLAMP(b, 0.0F, 1.0F); + texel[ACOMP] = 1.0F; +} + +#if DIM == 3 +static void store_texel_ycbcr_rev(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + (void) texImage; + (void) i; + (void) j; + (void) k; + (void) texel; + /* XXX to do */ +} +#endif + + +/* MESA_TEXFORMAT_Z24_S8 ***************************************************/ + +static void FETCH(f_z24_s8)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + /* only return Z, not stencil data */ + const GLuint *src = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + const GLfloat scale = 1.0F / (GLfloat) 0xffffff; + texel[0] = ((*src) >> 8) * scale; + ASSERT(texImage->TexFormat == MESA_FORMAT_Z24_S8); + ASSERT(texel[0] >= 0.0F); + ASSERT(texel[0] <= 1.0F); +} + +#if DIM == 3 +static void store_texel_z24_s8(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + /* only store Z, not stencil */ + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + GLfloat depth = *((GLfloat *) texel); + GLuint zi = ((GLuint) (depth * 0xffffff)) << 8; + *dst = zi | (*dst & 0xff); +} +#endif + + +/* MESA_TEXFORMAT_S8_Z24 ***************************************************/ + +static void FETCH(f_s8_z24)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + /* only return Z, not stencil data */ + const GLuint *src = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + const GLfloat scale = 1.0F / (GLfloat) 0xffffff; + texel[0] = ((*src) & 0x00ffffff) * scale; + ASSERT(texImage->TexFormat == MESA_FORMAT_S8_Z24); + ASSERT(texel[0] >= 0.0F); + ASSERT(texel[0] <= 1.0F); +} + +#if DIM == 3 +static void store_texel_s8_z24(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + /* only store Z, not stencil */ + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + GLfloat depth = *((GLfloat *) texel); + GLuint zi = (GLuint) (depth * 0xffffff); + *dst = zi | (*dst & 0xff000000); +} +#endif + + +#undef TEXEL_ADDR +#undef DIM +#undef FETCH diff --git a/src/mesa/main/texformat_tmp.h b/src/mesa/main/texformat_tmp.h deleted file mode 100644 index 199849d6ac..0000000000 --- a/src/mesa/main/texformat_tmp.h +++ /dev/null @@ -1,1304 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.5.1 - * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. - * Copyright (c) 2008 VMware, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * 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 texformat_tmp.h - * Texel fetch functions template. - * - * This template file is used by texformat.c to generate texel fetch functions - * for 1-D, 2-D and 3-D texture images. - * - * It should be expanded by defining \p DIM as the number texture dimensions - * (1, 2 or 3). According to the value of \p DIM a series of macros is defined - * for the texel lookup in the gl_texture_image::Data. - * - * \sa texformat.c and FetchTexel. - * - * \author Gareth Hughes - * \author Brian Paul - */ - - -#if DIM == 1 - -#define TEXEL_ADDR( type, image, i, j, k, size ) \ - ((void) (j), (void) (k), ((type *)(image)->Data + (i) * (size))) - -#define FETCH(x) fetch_texel_1d_##x - -#elif DIM == 2 - -#define TEXEL_ADDR( type, image, i, j, k, size ) \ - ((void) (k), \ - ((type *)(image)->Data + ((image)->RowStride * (j) + (i)) * (size))) - -#define FETCH(x) fetch_texel_2d_##x - -#elif DIM == 3 - -#define TEXEL_ADDR( type, image, i, j, k, size ) \ - ((type *)(image)->Data + ((image)->ImageOffsets[k] \ - + (image)->RowStride * (j) + (i)) * (size)) - -#define FETCH(x) fetch_texel_3d_##x - -#else -#error illegal number of texture dimensions -#endif - - -/* MESA_FORMAT_Z32 ***********************************************************/ - -/* Fetch depth texel from 1D, 2D or 3D 32-bit depth texture, - * returning 1 GLfloat. - * Note: no GLchan version of this function. - */ -static void FETCH(f_z32)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLuint *src = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - texel[0] = src[0] * (1.0F / 0xffffffff); -} - -#if DIM == 3 -static void store_texel_z32(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLuint *depth = (const GLuint *) texel; - GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - dst[0] = *depth; -} -#endif - - -/* MESA_FORMAT_Z16 ***********************************************************/ - -/* Fetch depth texel from 1D, 2D or 3D 16-bit depth texture, - * returning 1 GLfloat. - * Note: no GLchan version of this function. - */ -static void FETCH(f_z16)(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - texel[0] = src[0] * (1.0F / 65535.0F); -} - -#if DIM == 3 -static void store_texel_z16(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLushort *depth = (const GLushort *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - dst[0] = *depth; -} -#endif - - -/* MESA_FORMAT_RGBA_F32 ******************************************************/ - -/* Fetch texel from 1D, 2D or 3D RGBA_FLOAT32 texture, returning 4 GLfloats. - */ -static void FETCH(f_rgba_f32)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 4); - texel[RCOMP] = src[0]; - texel[GCOMP] = src[1]; - texel[BCOMP] = src[2]; - texel[ACOMP] = src[3]; -} - -#if DIM == 3 -static void store_texel_rgba_f32(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *depth = (const GLfloat *) texel; - GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); - dst[0] = depth[RCOMP]; - dst[1] = depth[GCOMP]; - dst[2] = depth[BCOMP]; - dst[3] = depth[ACOMP]; -} -#endif - - -/* MESA_FORMAT_RGBA_F16 ******************************************************/ - -/* Fetch texel from 1D, 2D or 3D RGBA_FLOAT16 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_rgba_f16)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 4); - texel[RCOMP] = _mesa_half_to_float(src[0]); - texel[GCOMP] = _mesa_half_to_float(src[1]); - texel[BCOMP] = _mesa_half_to_float(src[2]); - texel[ACOMP] = _mesa_half_to_float(src[3]); -} - -#if DIM == 3 -static void store_texel_rgba_f16(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *depth = (const GLfloat *) texel; - GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); - dst[0] = _mesa_float_to_half(*depth); -} -#endif - -/* MESA_FORMAT_RGB_F32 *******************************************************/ - -/* Fetch texel from 1D, 2D or 3D RGB_FLOAT32 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_rgb_f32)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 3); - texel[RCOMP] = src[0]; - texel[GCOMP] = src[1]; - texel[BCOMP] = src[2]; - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_rgb_f32(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *depth = (const GLfloat *) texel; - GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); - dst[0] = *depth; -} -#endif - - -/* MESA_FORMAT_RGB_F16 *******************************************************/ - -/* Fetch texel from 1D, 2D or 3D RGB_FLOAT16 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_rgb_f16)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 3); - texel[RCOMP] = _mesa_half_to_float(src[0]); - texel[GCOMP] = _mesa_half_to_float(src[1]); - texel[BCOMP] = _mesa_half_to_float(src[2]); - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_rgb_f16(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *depth = (const GLfloat *) texel; - GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); - dst[0] = _mesa_float_to_half(*depth); -} -#endif - - -/* MESA_FORMAT_ALPHA_F32 *****************************************************/ - -/* Fetch texel from 1D, 2D or 3D ALPHA_FLOAT32 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_alpha_f32)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = 0.0F; - texel[ACOMP] = src[0]; -} - -#if DIM == 3 -static void store_texel_alpha_f32(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *rgba = (const GLfloat *) texel; - GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); - dst[0] = rgba[ACOMP]; -} -#endif - - -/* MESA_FORMAT_ALPHA_F32 *****************************************************/ - -/* Fetch texel from 1D, 2D or 3D ALPHA_FLOAT16 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_alpha_f16)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = 0.0F; - texel[ACOMP] = _mesa_half_to_float(src[0]); -} - -#if DIM == 3 -static void store_texel_alpha_f16(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *rgba = (const GLfloat *) texel; - GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); - dst[0] = _mesa_float_to_half(rgba[ACOMP]); -} -#endif - - -/* MESA_FORMAT_LUMINANCE_F32 *************************************************/ - -/* Fetch texel from 1D, 2D or 3D LUMINANCE_FLOAT32 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_luminance_f32)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = src[0]; - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_luminance_f32(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *rgba = (const GLfloat *) texel; - GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); - dst[0] = rgba[RCOMP]; -} -#endif - - -/* MESA_FORMAT_LUMINANCE_F16 *************************************************/ - -/* Fetch texel from 1D, 2D or 3D LUMINANCE_FLOAT16 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_luminance_f16)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = _mesa_half_to_float(src[0]); - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_luminance_f16(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *rgba = (const GLfloat *) texel; - GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); - dst[0] = _mesa_float_to_half(rgba[RCOMP]); -} -#endif - - -/* MESA_FORMAT_LUMINANCE_ALPHA_F32 *******************************************/ - -/* Fetch texel from 1D, 2D or 3D LUMINANCE_ALPHA_FLOAT32 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_luminance_alpha_f32)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 2); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = src[0]; - texel[ACOMP] = src[1]; -} - -#if DIM == 3 -static void store_texel_luminance_alpha_f32(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *rgba = (const GLfloat *) texel; - GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 2); - dst[0] = rgba[RCOMP]; - dst[1] = rgba[ACOMP]; -} -#endif - - -/* MESA_FORMAT_LUMINANCE_ALPHA_F16 *******************************************/ - -/* Fetch texel from 1D, 2D or 3D LUMINANCE_ALPHA_FLOAT16 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_luminance_alpha_f16)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 2); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = _mesa_half_to_float(src[0]); - texel[ACOMP] = _mesa_half_to_float(src[1]); -} - -#if DIM == 3 -static void store_texel_luminance_alpha_f16(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *rgba = (const GLfloat *) texel; - GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 2); - dst[0] = _mesa_float_to_half(rgba[RCOMP]); - dst[1] = _mesa_float_to_half(rgba[ACOMP]); -} -#endif - - -/* MESA_FORMAT_INTENSITY_F32 *************************************************/ - -/* Fetch texel from 1D, 2D or 3D INTENSITY_FLOAT32 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_intensity_f32)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLfloat *src = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = - texel[ACOMP] = src[0]; -} - -#if DIM == 3 -static void store_texel_intensity_f32(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *rgba = (const GLfloat *) texel; - GLfloat *dst = TEXEL_ADDR(GLfloat, texImage, i, j, k, 1); - dst[0] = rgba[RCOMP]; -} -#endif - - -/* MESA_FORMAT_INTENSITY_F16 *************************************************/ - -/* Fetch texel from 1D, 2D or 3D INTENSITY_FLOAT16 texture, - * returning 4 GLfloats. - */ -static void FETCH(f_intensity_f16)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLhalfARB *src = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = - texel[ACOMP] = _mesa_half_to_float(src[0]); -} - -#if DIM == 3 -static void store_texel_intensity_f16(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLfloat *rgba = (const GLfloat *) texel; - GLhalfARB *dst = TEXEL_ADDR(GLhalfARB, texImage, i, j, k, 1); - dst[0] = _mesa_float_to_half(rgba[RCOMP]); -} -#endif - - - - -/* - * Begin Hardware formats - */ - -/* MESA_FORMAT_RGBA8888 ******************************************************/ - -/* Fetch texel from 1D, 2D or 3D rgba8888 texture, return 4 GLfloats */ -static void FETCH(f_rgba8888)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 24) ); - texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff ); - texel[BCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff ); - texel[ACOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); -} - - - -#if DIM == 3 -static void store_texel_rgba8888(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - *dst = PACK_COLOR_8888(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); -} -#endif - - -/* MESA_FORMAT_RGBA888_REV ***************************************************/ - -/* Fetch texel from 1D, 2D or 3D abgr8888 texture, return 4 GLchans */ -static void FETCH(f_rgba8888_rev)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - texel[RCOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); - texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff ); - texel[BCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff ); - texel[ACOMP] = UBYTE_TO_FLOAT( (s >> 24) ); -} - -#if DIM == 3 -static void store_texel_rgba8888_rev(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - *dst = PACK_COLOR_8888_REV(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); -} -#endif - - -/* MESA_FORMAT_ARGB8888 ******************************************************/ - -/* Fetch texel from 1D, 2D or 3D argb8888 texture, return 4 GLchans */ -static void FETCH(f_argb8888)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff ); - texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff ); - texel[BCOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); - texel[ACOMP] = UBYTE_TO_FLOAT( (s >> 24) ); -} - -#if DIM == 3 -static void store_texel_argb8888(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - *dst = PACK_COLOR_8888(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); -} -#endif - - -/* MESA_FORMAT_ARGB8888_REV **************************************************/ - -/* Fetch texel from 1D, 2D or 3D argb8888_rev texture, return 4 GLfloats */ -static void FETCH(f_argb8888_rev)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff ); - texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff ); - texel[BCOMP] = UBYTE_TO_FLOAT( (s >> 24) ); - texel[ACOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); -} - -#if DIM == 3 -static void store_texel_argb8888_rev(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - *dst = PACK_COLOR_8888(rgba[BCOMP], rgba[GCOMP], rgba[RCOMP], rgba[ACOMP]); -} -#endif - - -/* MESA_FORMAT_RGB888 ********************************************************/ - -/* Fetch texel from 1D, 2D or 3D rgb888 texture, return 4 GLchans */ -static void FETCH(f_rgb888)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); - texel[RCOMP] = UBYTE_TO_FLOAT( src[2] ); - texel[GCOMP] = UBYTE_TO_FLOAT( src[1] ); - texel[BCOMP] = UBYTE_TO_FLOAT( src[0] ); - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_rgb888(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); - dst[0] = rgba[BCOMP]; - dst[1] = rgba[GCOMP]; - dst[2] = rgba[RCOMP]; -} -#endif - - -/* MESA_FORMAT_BGR888 ********************************************************/ - -/* Fetch texel from 1D, 2D or 3D bgr888 texture, return 4 GLchans */ -static void FETCH(f_bgr888)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); - texel[RCOMP] = UBYTE_TO_FLOAT( src[0] ); - texel[GCOMP] = UBYTE_TO_FLOAT( src[1] ); - texel[BCOMP] = UBYTE_TO_FLOAT( src[2] ); - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_bgr888(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); - dst[0] = rgba[RCOMP]; - dst[1] = rgba[GCOMP]; - dst[2] = rgba[BCOMP]; -} -#endif - - -/* use color expansion like (g << 2) | (g >> 4) (does somewhat random rounding) - instead of slow (g << 2) * 255 / 252 (always rounds down) */ - -/* MESA_FORMAT_RGB565 ********************************************************/ - -/* Fetch texel from 1D, 2D or 3D rgb565 texture, return 4 GLchans */ -static void FETCH(f_rgb565)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - const GLushort s = *src; - texel[RCOMP] = ((s >> 11) & 0x1f) * (1.0F / 31.0F); - texel[GCOMP] = ((s >> 5 ) & 0x3f) * (1.0F / 63.0F); - texel[BCOMP] = ((s ) & 0x1f) * (1.0F / 31.0F); - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_rgb565(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_565(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); -} -#endif - - -/* MESA_FORMAT_RGB565_REV ****************************************************/ - -/* Fetch texel from 1D, 2D or 3D rgb565_rev texture, return 4 GLchans */ -static void FETCH(f_rgb565_rev)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - const GLushort s = (*src >> 8) | (*src << 8); /* byte swap */ - texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 8) & 0xf8) | ((s >> 13) & 0x7) ); - texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 3) & 0xfc) | ((s >> 9) & 0x3) ); - texel[BCOMP] = UBYTE_TO_FLOAT( ((s << 3) & 0xf8) | ((s >> 2) & 0x7) ); - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_rgb565_rev(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_565(rgba[BCOMP], rgba[GCOMP], rgba[RCOMP]); -} -#endif - - -/* MESA_FORMAT_ARGB4444 ******************************************************/ - -/* Fetch texel from 1D, 2D or 3D argb444 texture, return 4 GLchans */ -static void FETCH(f_argb4444)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - const GLushort s = *src; - texel[RCOMP] = ((s >> 8) & 0xf) * (1.0F / 15.0F); - texel[GCOMP] = ((s >> 4) & 0xf) * (1.0F / 15.0F); - texel[BCOMP] = ((s ) & 0xf) * (1.0F / 15.0F); - texel[ACOMP] = ((s >> 12) & 0xf) * (1.0F / 15.0F); -} - -#if DIM == 3 -static void store_texel_argb4444(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_4444(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); -} -#endif - - -/* MESA_FORMAT_ARGB4444_REV **************************************************/ - -/* Fetch texel from 1D, 2D or 3D argb4444_rev texture, return 4 GLchans */ -static void FETCH(f_argb4444_rev)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - texel[RCOMP] = ((s ) & 0xf) * (1.0F / 15.0F); - texel[GCOMP] = ((s >> 12) & 0xf) * (1.0F / 15.0F); - texel[BCOMP] = ((s >> 8) & 0xf) * (1.0F / 15.0F); - texel[ACOMP] = ((s >> 4) & 0xf) * (1.0F / 15.0F); -} - -#if DIM == 3 -static void store_texel_argb4444_rev(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_4444(rgba[ACOMP], rgba[BCOMP], rgba[GCOMP], rgba[RCOMP]); -} -#endif - -/* MESA_FORMAT_RGBA5551 ******************************************************/ - -/* Fetch texel from 1D, 2D or 3D argb1555 texture, return 4 GLchans */ -static void FETCH(f_rgba5551)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - const GLushort s = *src; - texel[RCOMP] = ((s >> 11) & 0x1f) * (1.0F / 31.0F); - texel[GCOMP] = ((s >> 6) & 0x1f) * (1.0F / 31.0F); - texel[BCOMP] = ((s >> 1) & 0x1f) * (1.0F / 31.0F); - texel[ACOMP] = ((s ) & 0x01) * 1.0F; -} - -#if DIM == 3 -static void store_texel_rgba5551(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_5551(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); -} -#endif - -/* MESA_FORMAT_ARGB1555 ******************************************************/ - -/* Fetch texel from 1D, 2D or 3D argb1555 texture, return 4 GLchans */ -static void FETCH(f_argb1555)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - const GLushort s = *src; - texel[RCOMP] = ((s >> 10) & 0x1f) * (1.0F / 31.0F); - texel[GCOMP] = ((s >> 5) & 0x1f) * (1.0F / 31.0F); - texel[BCOMP] = ((s >> 0) & 0x1f) * (1.0F / 31.0F); - texel[ACOMP] = ((s >> 15) & 0x01) * 1.0F; -} - -#if DIM == 3 -static void store_texel_argb1555(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_1555(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); -} -#endif - - -/* MESA_FORMAT_ARGB1555_REV **************************************************/ - -/* Fetch texel from 1D, 2D or 3D argb1555_rev texture, return 4 GLchans */ -static void FETCH(f_argb1555_rev)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - const GLushort s = (*src << 8) | (*src >> 8); /* byteswap */ - texel[RCOMP] = UBYTE_TO_FLOAT( ((s >> 7) & 0xf8) | ((s >> 12) & 0x7) ); - texel[GCOMP] = UBYTE_TO_FLOAT( ((s >> 2) & 0xf8) | ((s >> 7) & 0x7) ); - texel[BCOMP] = UBYTE_TO_FLOAT( ((s << 3) & 0xf8) | ((s >> 2) & 0x7) ); - texel[ACOMP] = UBYTE_TO_FLOAT( ((s >> 15) & 0x01) * 255 ); -} - -#if DIM == 3 -static void store_texel_argb1555_rev(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_1555_REV(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); -} -#endif - - -/* MESA_FORMAT_AL88 **********************************************************/ - -/* Fetch texel from 1D, 2D or 3D al88 texture, return 4 GLchans */ -static void FETCH(f_al88)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = UBYTE_TO_FLOAT( s & 0xff ); - texel[ACOMP] = UBYTE_TO_FLOAT( s >> 8 ); -} - -#if DIM == 3 -static void store_texel_al88(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_88(rgba[ACOMP], rgba[RCOMP]); -} -#endif - - -/* MESA_FORMAT_AL88_REV ******************************************************/ - -/* Fetch texel from 1D, 2D or 3D al88_rev texture, return 4 GLchans */ -static void FETCH(f_al88_rev)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = UBYTE_TO_FLOAT( s >> 8 ); - texel[ACOMP] = UBYTE_TO_FLOAT( s & 0xff ); -} - -#if DIM == 3 -static void store_texel_al88_rev(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLushort *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); - *dst = PACK_COLOR_88(rgba[RCOMP], rgba[ACOMP]); -} -#endif - - -/* MESA_FORMAT_RGB332 ********************************************************/ - -/* Fetch texel from 1D, 2D or 3D rgb332 texture, return 4 GLchans */ -static void FETCH(f_rgb332)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - const GLubyte s = *src; - texel[RCOMP] = ((s >> 5) & 0x7) * (1.0F / 7.0F); - texel[GCOMP] = ((s >> 2) & 0x7) * (1.0F / 7.0F); - texel[BCOMP] = ((s ) & 0x3) * (1.0F / 3.0F); - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_rgb332(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - *dst = PACK_COLOR_332(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); -} -#endif - - -/* MESA_FORMAT_A8 ************************************************************/ - -/* Fetch texel from 1D, 2D or 3D a8 texture, return 4 GLchans */ -static void FETCH(f_a8)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = 0.0F; - texel[ACOMP] = UBYTE_TO_FLOAT( src[0] ); -} - -#if DIM == 3 -static void store_texel_a8(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - *dst = rgba[ACOMP]; -} -#endif - - -/* MESA_FORMAT_L8 ************************************************************/ - -/* Fetch texel from 1D, 2D or 3D l8 texture, return 4 GLchans */ -static void FETCH(f_l8)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = UBYTE_TO_FLOAT( src[0] ); - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_l8(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - *dst = rgba[RCOMP]; -} -#endif - - -/* MESA_FORMAT_I8 ************************************************************/ - -/* Fetch texel from 1D, 2D or 3D i8 texture, return 4 GLchans */ -static void FETCH(f_i8)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = - texel[ACOMP] = UBYTE_TO_FLOAT( src[0] ); -} - -#if DIM == 3 -static void store_texel_i8(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - *dst = rgba[RCOMP]; -} -#endif - - -/* MESA_FORMAT_CI8 ***********************************************************/ - -/* Fetch CI texel from 1D, 2D or 3D ci8 texture, lookup the index in a - * color table, and return 4 GLchans. - */ -static void FETCH(f_ci8)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - const struct gl_color_table *palette; - GLuint index; - GET_CURRENT_CONTEXT(ctx); - - if (ctx->Texture.SharedPalette) { - palette = &ctx->Texture.Palette; - } - else { - palette = &texImage->TexObject->Palette; - } - if (palette->Size == 0) - return; /* undefined results */ - - /* Mask the index against size of palette to avoid going out of bounds */ - index = (*src) & (palette->Size - 1); - - { - const GLfloat *table = palette->TableF; - switch (palette->_BaseFormat) { - case GL_ALPHA: - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = 0.0F; - texel[ACOMP] = table[index]; - break; - case GL_LUMINANCE: - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = table[index]; - texel[ACOMP] = 1.0F; - break; - case GL_INTENSITY: - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = - texel[ACOMP] = table[index]; - break; - case GL_LUMINANCE_ALPHA: - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = table[index * 2 + 0]; - texel[ACOMP] = table[index * 2 + 1]; - break; - case GL_RGB: - texel[RCOMP] = table[index * 3 + 0]; - texel[GCOMP] = table[index * 3 + 1]; - texel[BCOMP] = table[index * 3 + 2]; - texel[ACOMP] = 1.0F; - break; - case GL_RGBA: - texel[RCOMP] = table[index * 4 + 0]; - texel[GCOMP] = table[index * 4 + 1]; - texel[BCOMP] = table[index * 4 + 2]; - texel[ACOMP] = table[index * 4 + 3]; - break; - default: - _mesa_problem(ctx, "Bad palette format in fetch_texel_ci8"); - return; - } - } -} - -#if DIM == 3 -static void store_texel_ci8(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *index = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - *dst = *index; -} -#endif - - -#if FEATURE_EXT_texture_sRGB - -/* Fetch texel from 1D, 2D or 3D srgb8 texture, return 4 GLfloats */ -/* Note: component order is same as for MESA_FORMAT_RGB888 */ -static void FETCH(srgb8)(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); - texel[RCOMP] = nonlinear_to_linear(src[2]); - texel[GCOMP] = nonlinear_to_linear(src[1]); - texel[BCOMP] = nonlinear_to_linear(src[0]); - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_srgb8(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 3); - dst[0] = rgba[BCOMP]; /* no conversion */ - dst[1] = rgba[GCOMP]; - dst[2] = rgba[RCOMP]; -} -#endif - -/* Fetch texel from 1D, 2D or 3D srgba8 texture, return 4 GLfloats */ -static void FETCH(srgba8)(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - texel[RCOMP] = nonlinear_to_linear( (s >> 24) ); - texel[GCOMP] = nonlinear_to_linear( (s >> 16) & 0xff ); - texel[BCOMP] = nonlinear_to_linear( (s >> 8) & 0xff ); - texel[ACOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); /* linear! */ -} - -#if DIM == 3 -static void store_texel_srgba8(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - *dst = PACK_COLOR_8888(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); -} -#endif - -/* Fetch texel from 1D, 2D or 3D sargb8 texture, return 4 GLfloats */ -static void FETCH(sargb8)(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - texel[RCOMP] = nonlinear_to_linear( (s >> 16) & 0xff ); - texel[GCOMP] = nonlinear_to_linear( (s >> 8) & 0xff ); - texel[BCOMP] = nonlinear_to_linear( (s ) & 0xff ); - texel[ACOMP] = UBYTE_TO_FLOAT( (s >> 24) ); /* linear! */ -} - -#if DIM == 3 -static void store_texel_sargb8(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - *dst = PACK_COLOR_8888(rgba[ACOMP], rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); -} -#endif - -/* Fetch texel from 1D, 2D or 3D sl8 texture, return 4 GLfloats */ -static void FETCH(sl8)(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = nonlinear_to_linear(src[0]); - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_sl8(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 1); - dst[0] = rgba[RCOMP]; -} -#endif - -/* Fetch texel from 1D, 2D or 3D sla8 texture, return 4 GLfloats */ -static void FETCH(sla8)(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLubyte *src = TEXEL_ADDR(GLubyte, texImage, i, j, k, 2); - texel[RCOMP] = - texel[GCOMP] = - texel[BCOMP] = nonlinear_to_linear(src[0]); - texel[ACOMP] = UBYTE_TO_FLOAT(src[1]); /* linear */ -} - -#if DIM == 3 -static void store_texel_sla8(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLubyte *dst = TEXEL_ADDR(GLubyte, texImage, i, j, k, 2); - dst[0] = rgba[RCOMP]; - dst[1] = rgba[ACOMP]; -} -#endif - -#endif /* FEATURE_EXT_texture_sRGB */ - - -/* MESA_FORMAT_DUDV8 ********************************************************/ - -/* this format by definition produces 0,0,0,1 as rgba values, - however we'll return the dudv values as rg and fix up elsewhere */ -static void FETCH(dudv8)(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLbyte *src = TEXEL_ADDR(GLbyte, texImage, i, j, k, 2); - texel[RCOMP] = BYTE_TO_FLOAT(src[0]); - texel[GCOMP] = BYTE_TO_FLOAT(src[1]); - texel[BCOMP] = 0; - texel[ACOMP] = 0; -} - -/* MESA_FORMAT_SIGNED_RGBA8888 ***********************************************/ - -static void FETCH(signed_rgba8888)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - texel[RCOMP] = BYTE_TO_FLOAT_TEX( (s >> 24) ); - texel[GCOMP] = BYTE_TO_FLOAT_TEX( (s >> 16) & 0xff ); - texel[BCOMP] = BYTE_TO_FLOAT_TEX( (s >> 8) & 0xff ); - texel[ACOMP] = BYTE_TO_FLOAT_TEX( (s ) & 0xff ); -} - -#if DIM == 3 -static void store_texel_signed_rgba8888(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLbyte *rgba = (const GLbyte *) texel; - GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - *dst = PACK_COLOR_8888(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); -} -#endif - -static void FETCH(signed_rgba8888_rev)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - texel[RCOMP] = BYTE_TO_FLOAT_TEX( (s ) & 0xff ); - texel[GCOMP] = BYTE_TO_FLOAT_TEX( (s >> 8) & 0xff ); - texel[BCOMP] = BYTE_TO_FLOAT_TEX( (s >> 16) & 0xff ); - texel[ACOMP] = BYTE_TO_FLOAT_TEX( (s >> 24) ); -} - -#if DIM == 3 -static void store_texel_signed_rgba8888_rev(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - const GLubyte *rgba = (const GLubyte *) texel; - GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - *dst = PACK_COLOR_8888_REV(rgba[RCOMP], rgba[GCOMP], rgba[BCOMP], rgba[ACOMP]); -} -#endif - - - -/* MESA_FORMAT_YCBCR *********************************************************/ - -/* Fetch texel from 1D, 2D or 3D ycbcr texture, return 4 GLfloats. - * We convert YCbCr to RGB here. - */ -static void FETCH(f_ycbcr)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src0 = TEXEL_ADDR(GLushort, texImage, (i & ~1), j, k, 1); /* even */ - const GLushort *src1 = src0 + 1; /* odd */ - const GLubyte y0 = (*src0 >> 8) & 0xff; /* luminance */ - const GLubyte cb = *src0 & 0xff; /* chroma U */ - const GLubyte y1 = (*src1 >> 8) & 0xff; /* luminance */ - const GLubyte cr = *src1 & 0xff; /* chroma V */ - const GLubyte y = (i & 1) ? y1 : y0; /* choose even/odd luminance */ - GLfloat r = 1.164F * (y - 16) + 1.596F * (cr - 128); - GLfloat g = 1.164F * (y - 16) - 0.813F * (cr - 128) - 0.391F * (cb - 128); - GLfloat b = 1.164F * (y - 16) + 2.018F * (cb - 128); - r *= (1.0F / 255.0F); - g *= (1.0F / 255.0F); - b *= (1.0F / 255.0F); - texel[RCOMP] = CLAMP(r, 0.0F, 1.0F); - texel[GCOMP] = CLAMP(g, 0.0F, 1.0F); - texel[BCOMP] = CLAMP(b, 0.0F, 1.0F); - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_ycbcr(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - (void) texImage; - (void) i; - (void) j; - (void) k; - (void) texel; - /* XXX to do */ -} -#endif - - -/* MESA_FORMAT_YCBCR_REV *****************************************************/ - -/* Fetch texel from 1D, 2D or 3D ycbcr_rev texture, return 4 GLfloats. - * We convert YCbCr to RGB here. - */ -static void FETCH(f_ycbcr_rev)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLushort *src0 = TEXEL_ADDR(GLushort, texImage, (i & ~1), j, k, 1); /* even */ - const GLushort *src1 = src0 + 1; /* odd */ - const GLubyte y0 = *src0 & 0xff; /* luminance */ - const GLubyte cr = (*src0 >> 8) & 0xff; /* chroma V */ - const GLubyte y1 = *src1 & 0xff; /* luminance */ - const GLubyte cb = (*src1 >> 8) & 0xff; /* chroma U */ - const GLubyte y = (i & 1) ? y1 : y0; /* choose even/odd luminance */ - GLfloat r = 1.164F * (y - 16) + 1.596F * (cr - 128); - GLfloat g = 1.164F * (y - 16) - 0.813F * (cr - 128) - 0.391F * (cb - 128); - GLfloat b = 1.164F * (y - 16) + 2.018F * (cb - 128); - r *= (1.0F / 255.0F); - g *= (1.0F / 255.0F); - b *= (1.0F / 255.0F); - texel[RCOMP] = CLAMP(r, 0.0F, 1.0F); - texel[GCOMP] = CLAMP(g, 0.0F, 1.0F); - texel[BCOMP] = CLAMP(b, 0.0F, 1.0F); - texel[ACOMP] = 1.0F; -} - -#if DIM == 3 -static void store_texel_ycbcr_rev(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - (void) texImage; - (void) i; - (void) j; - (void) k; - (void) texel; - /* XXX to do */ -} -#endif - - -/* MESA_TEXFORMAT_Z24_S8 ***************************************************/ - -static void FETCH(f_z24_s8)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - /* only return Z, not stencil data */ - const GLuint *src = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - const GLfloat scale = 1.0F / (GLfloat) 0xffffff; - texel[0] = ((*src) >> 8) * scale; - ASSERT(texImage->TexFormat == MESA_FORMAT_Z24_S8); - ASSERT(texel[0] >= 0.0F); - ASSERT(texel[0] <= 1.0F); -} - -#if DIM == 3 -static void store_texel_z24_s8(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - /* only store Z, not stencil */ - GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - GLfloat depth = *((GLfloat *) texel); - GLuint zi = ((GLuint) (depth * 0xffffff)) << 8; - *dst = zi | (*dst & 0xff); -} -#endif - - -/* MESA_TEXFORMAT_S8_Z24 ***************************************************/ - -static void FETCH(f_s8_z24)( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - /* only return Z, not stencil data */ - const GLuint *src = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - const GLfloat scale = 1.0F / (GLfloat) 0xffffff; - texel[0] = ((*src) & 0x00ffffff) * scale; - ASSERT(texImage->TexFormat == MESA_FORMAT_S8_Z24); - ASSERT(texel[0] >= 0.0F); - ASSERT(texel[0] <= 1.0F); -} - -#if DIM == 3 -static void store_texel_s8_z24(struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, const void *texel) -{ - /* only store Z, not stencil */ - GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - GLfloat depth = *((GLfloat *) texel); - GLuint zi = (GLuint) (depth * 0xffffff); - *dst = zi | (*dst & 0xff000000); -} -#endif - - -#undef TEXEL_ADDR -#undef DIM -#undef FETCH -- cgit v1.2.3 From 8c36ca707ca8879d6f888de7733ffb6b04ddc48a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 30 Sep 2009 22:50:05 -0600 Subject: swrast: fix some texformat regressions Need to be careful with component ordering for MESA_FORMAT_RGB888 and MESA_FORMAT_RGBA8888. --- src/mesa/swrast/s_texfilter.c | 12 +++---- src/mesa/swrast/s_triangle.c | 78 ++++++++++++++++++++++++------------------- 2 files changed, 49 insertions(+), 41 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index 6cba8ed34b..db03c6aa39 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -1351,9 +1351,9 @@ opt_sample_rgb_2d(GLcontext *ctx, GLint j = IFLOOR(texcoords[k][1] * height) & rowMask; GLint pos = (j << shift) | i; GLubyte *texel = ((GLubyte *) img->Data) + 3*pos; - rgba[k][RCOMP] = UBYTE_TO_FLOAT(texel[0]); + rgba[k][RCOMP] = UBYTE_TO_FLOAT(texel[2]); rgba[k][GCOMP] = UBYTE_TO_FLOAT(texel[1]); - rgba[k][BCOMP] = UBYTE_TO_FLOAT(texel[2]); + rgba[k][BCOMP] = UBYTE_TO_FLOAT(texel[0]); } } @@ -1392,10 +1392,10 @@ opt_sample_rgba_2d(GLcontext *ctx, const GLint row = IFLOOR(texcoords[i][1] * height) & rowMask; const GLint pos = (row << shift) | col; const GLubyte *texel = ((GLubyte *) img->Data) + (pos << 2); /* pos*4 */ - rgba[i][RCOMP] = UBYTE_TO_FLOAT(texel[0]); - rgba[i][GCOMP] = UBYTE_TO_FLOAT(texel[1]); - rgba[i][BCOMP] = UBYTE_TO_FLOAT(texel[2]); - rgba[i][ACOMP] = UBYTE_TO_FLOAT(texel[3]); + rgba[i][RCOMP] = UBYTE_TO_FLOAT(texel[3]); + rgba[i][GCOMP] = UBYTE_TO_FLOAT(texel[2]); + rgba[i][BCOMP] = UBYTE_TO_FLOAT(texel[1]); + rgba[i][ACOMP] = UBYTE_TO_FLOAT(texel[0]); } } diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index 6a61bec245..f28f2c9307 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -276,25 +276,29 @@ affine_span(GLcontext *ctx, SWspan *span, * unused variables (for instance tf,sf,ti,si in case of GL_NEAREST). */ -#define NEAREST_RGB \ - sample[RCOMP] = tex00[RCOMP]; \ - sample[GCOMP] = tex00[GCOMP]; \ - sample[BCOMP] = tex00[BCOMP]; \ - sample[ACOMP] = CHAN_MAX +#define NEAREST_RGB \ + sample[RCOMP] = tex00[2]; \ + sample[GCOMP] = tex00[1]; \ + sample[BCOMP] = tex00[0]; \ + sample[ACOMP] = CHAN_MAX; #define LINEAR_RGB \ - sample[RCOMP] = ilerp_2d(sf, tf, tex00[0], tex01[0], tex10[0], tex11[0]);\ + sample[RCOMP] = ilerp_2d(sf, tf, tex00[2], tex01[2], tex10[2], tex11[2]);\ sample[GCOMP] = ilerp_2d(sf, tf, tex00[1], tex01[1], tex10[1], tex11[1]);\ - sample[BCOMP] = ilerp_2d(sf, tf, tex00[2], tex01[2], tex10[2], tex11[2]);\ + sample[BCOMP] = ilerp_2d(sf, tf, tex00[0], tex01[0], tex10[0], tex11[0]);\ sample[ACOMP] = CHAN_MAX; -#define NEAREST_RGBA COPY_CHAN4(sample, tex00) +#define NEAREST_RGBA \ + sample[RCOMP] = tex00[3]; \ + sample[GCOMP] = tex00[2]; \ + sample[BCOMP] = tex00[1]; \ + sample[ACOMP] = tex00[0]; #define LINEAR_RGBA \ - sample[RCOMP] = ilerp_2d(sf, tf, tex00[0], tex01[0], tex10[0], tex11[0]);\ - sample[GCOMP] = ilerp_2d(sf, tf, tex00[1], tex01[1], tex10[1], tex11[1]);\ - sample[BCOMP] = ilerp_2d(sf, tf, tex00[2], tex01[2], tex10[2], tex11[2]);\ - sample[ACOMP] = ilerp_2d(sf, tf, tex00[3], tex01[3], tex10[3], tex11[3]) + sample[RCOMP] = ilerp_2d(sf, tf, tex00[3], tex01[3], tex10[3], tex11[3]);\ + sample[GCOMP] = ilerp_2d(sf, tf, tex00[2], tex01[2], tex10[2], tex11[2]);\ + sample[BCOMP] = ilerp_2d(sf, tf, tex00[1], tex01[1], tex10[1], tex11[1]);\ + sample[ACOMP] = ilerp_2d(sf, tf, tex00[0], tex01[0], tex10[0], tex11[0]) #define MODULATE \ dest[RCOMP] = span->red * (sample[RCOMP] + 1u) >> (FIXED_SHIFT + 8); \ @@ -345,7 +349,11 @@ affine_span(GLcontext *ctx, SWspan *span, dest[2] = sample[2]; \ dest[3] = FixedToInt(span->alpha); -#define NEAREST_RGBA_REPLACE COPY_CHAN4(dest, tex00) +#define NEAREST_RGBA_REPLACE \ + dest[RCOMP] = tex00[3]; \ + dest[GCOMP] = tex00[2]; \ + dest[BCOMP] = tex00[1]; \ + dest[ACOMP] = tex00[0] #define SPAN_NEAREST(DO_TEX, COMPS) \ for (i = 0; i < span->end; i++) { \ @@ -406,7 +414,7 @@ affine_span(GLcontext *ctx, SWspan *span, switch (info->filter) { case GL_NEAREST: switch (info->format) { - case GL_RGB: + case MESA_FORMAT_RGB888: switch (info->envmode) { case GL_MODULATE: SPAN_NEAREST(NEAREST_RGB;MODULATE,3); @@ -426,7 +434,7 @@ affine_span(GLcontext *ctx, SWspan *span, return; } break; - case GL_RGBA: + case MESA_FORMAT_RGBA8888: switch(info->envmode) { case GL_MODULATE: SPAN_NEAREST(NEAREST_RGBA;MODULATE,4); @@ -455,7 +463,7 @@ affine_span(GLcontext *ctx, SWspan *span, span->intTex[0] -= FIXED_HALF; span->intTex[1] -= FIXED_HALF; switch (info->format) { - case GL_RGB: + case MESA_FORMAT_RGB888: switch (info->envmode) { case GL_MODULATE: SPAN_LINEAR(LINEAR_RGB;MODULATE,3); @@ -475,7 +483,7 @@ affine_span(GLcontext *ctx, SWspan *span, return; } break; - case GL_RGBA: + case MESA_FORMAT_RGBA8888: switch (info->envmode) { case GL_MODULATE: SPAN_LINEAR(LINEAR_RGBA;MODULATE,4); @@ -537,7 +545,7 @@ affine_span(GLcontext *ctx, SWspan *span, info.twidth_log2 = obj->Image[0][b]->WidthLog2; \ info.smask = obj->Image[0][b]->Width - 1; \ info.tmask = obj->Image[0][b]->Height - 1; \ - info.format = obj->Image[0][b]->_BaseFormat; \ + info.format = obj->Image[0][b]->TexFormat; \ info.filter = obj->MinFilter; \ info.envmode = unit->EnvMode; \ span.arrayMask |= SPAN_RGBA; \ @@ -555,18 +563,18 @@ affine_span(GLcontext *ctx, SWspan *span, } \ \ switch (info.format) { \ - case GL_ALPHA: \ - case GL_LUMINANCE: \ - case GL_INTENSITY: \ + case MESA_FORMAT_A8: \ + case MESA_FORMAT_L8: \ + case MESA_FORMAT_I8: \ info.tbytesline = obj->Image[0][b]->Width; \ break; \ - case GL_LUMINANCE_ALPHA: \ + case MESA_FORMAT_AL88: \ info.tbytesline = obj->Image[0][b]->Width * 2; \ break; \ - case GL_RGB: \ + case MESA_FORMAT_RGB888: \ info.tbytesline = obj->Image[0][b]->Width * 3; \ break; \ - case GL_RGBA: \ + case MESA_FORMAT_RGBA8888: \ info.tbytesline = obj->Image[0][b]->Width * 4; \ break; \ default: \ @@ -680,7 +688,7 @@ fast_persp_span(GLcontext *ctx, SWspan *span, switch (info->filter) { case GL_NEAREST: switch (info->format) { - case GL_RGB: + case MESA_FORMAT_RGB888: switch (info->envmode) { case GL_MODULATE: SPAN_NEAREST(NEAREST_RGB;MODULATE,3); @@ -700,7 +708,7 @@ fast_persp_span(GLcontext *ctx, SWspan *span, return; } break; - case GL_RGBA: + case MESA_FORMAT_RGBA8888: switch(info->envmode) { case GL_MODULATE: SPAN_NEAREST(NEAREST_RGBA;MODULATE,4); @@ -727,7 +735,7 @@ fast_persp_span(GLcontext *ctx, SWspan *span, case GL_LINEAR: switch (info->format) { - case GL_RGB: + case MESA_FORMAT_RGB888: switch (info->envmode) { case GL_MODULATE: SPAN_LINEAR(LINEAR_RGB;MODULATE,3); @@ -747,7 +755,7 @@ fast_persp_span(GLcontext *ctx, SWspan *span, return; } break; - case GL_RGBA: + case MESA_FORMAT_RGBA8888: switch (info->envmode) { case GL_MODULATE: SPAN_LINEAR(LINEAR_RGBA;MODULATE,4); @@ -806,7 +814,7 @@ fast_persp_span(GLcontext *ctx, SWspan *span, info.twidth_log2 = obj->Image[0][b]->WidthLog2; \ info.smask = obj->Image[0][b]->Width - 1; \ info.tmask = obj->Image[0][b]->Height - 1; \ - info.format = obj->Image[0][b]->_BaseFormat; \ + info.format = obj->Image[0][b]->TexFormat; \ info.filter = obj->MinFilter; \ info.envmode = unit->EnvMode; \ \ @@ -823,18 +831,18 @@ fast_persp_span(GLcontext *ctx, SWspan *span, } \ \ switch (info.format) { \ - case GL_ALPHA: \ - case GL_LUMINANCE: \ - case GL_INTENSITY: \ + case MESA_FORMAT_A8: \ + case MESA_FORMAT_L8: \ + case MESA_FORMAT_I8: \ info.tbytesline = obj->Image[0][b]->Width; \ break; \ - case GL_LUMINANCE_ALPHA: \ + case MESA_FORMAT_AL88: \ info.tbytesline = obj->Image[0][b]->Width * 2; \ break; \ - case GL_RGB: \ + case MESA_FORMAT_RGB888: \ info.tbytesline = obj->Image[0][b]->Width * 3; \ break; \ - case GL_RGBA: \ + case MESA_FORMAT_RGBA8888: \ info.tbytesline = obj->Image[0][b]->Width * 4; \ break; \ default: \ -- cgit v1.2.3 From ae2daacbac7242938cffe0e2409071e030e00863 Mon Sep 17 00:00:00 2001 From: Cooper Yuan Date: Thu, 1 Oct 2009 17:54:27 +0800 Subject: st/mesa: fix non-mipmap lastLevel calculation. reviewed by Brian Paul. --- src/mesa/state_tracker/st_cb_texture.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 771a0e2bbd..9a634bb930 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -1766,7 +1766,11 @@ st_finalize_texture(GLcontext *ctx, * incomplete. In that case, we'll have set stObj->lastLevel before * we get here. */ - stObj->lastLevel = stObj->base._MaxLevel - stObj->base.BaseLevel; + if (stObj->base.MinFilter == GL_LINEAR || + stObj->base.MinFilter == GL_NEAREST) + stObj->lastLevel = stObj->base.BaseLevel; + else + stObj->lastLevel = stObj->base._MaxLevel - stObj->base.BaseLevel; } firstImage = st_texture_image(stObj->base.Image[0][stObj->base.BaseLevel]); -- cgit v1.2.3 From 4456006ba626890172289111403e469f49106e18 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Thu, 1 Oct 2009 14:34:23 +0100 Subject: gallium: remove depth.occlusion_count flag This was redundant as drivers can just keep track of whether they are inside a begin/end query pair. We want to add more query types later and also support nested queries, none of which map well onto a flag like this. No driver appeared to be using the flag. --- src/mesa/state_tracker/st_atom_depth.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_atom_depth.c b/src/mesa/state_tracker/st_atom_depth.c index 0aa128f947..88b80a07fc 100644 --- a/src/mesa/state_tracker/st_atom_depth.c +++ b/src/mesa/state_tracker/st_atom_depth.c @@ -104,10 +104,6 @@ update_depth_stencil_alpha(struct st_context *st) dsa->depth.func = st_compare_func_to_pipe(ctx->Depth.Func); } - if (ctx->Query.CurrentOcclusionObject && - ctx->Query.CurrentOcclusionObject->Active) - dsa->depth.occlusion_count = 1; - if (ctx->Stencil.Enabled && ctx->DrawBuffer->Visual.stencilBits > 0) { dsa->stencil[0].enabled = 1; dsa->stencil[0].func = st_compare_func_to_pipe(ctx->Stencil.Function[0]); -- cgit v1.2.3 From f8d8f4527884d018a51daf8cc6281b52ce083b9e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 30 Sep 2009 09:30:27 -0600 Subject: mesa: better debug message --- src/mesa/main/texobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 678845ece0..f8ce811eb2 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -491,7 +491,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, t->Image[face][baseLevel]->Width2 != w || t->Image[face][baseLevel]->Height2 != h) { t->_Complete = GL_FALSE; - incomplete(t, "Non-quare cubemap image"); + incomplete(t, "Cube face missing or mismatched size"); return; } } -- cgit v1.2.3 From 18883cdf2334511005973155fc517eb678dc0043 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 1 Oct 2009 13:33:20 -0600 Subject: mesa: Return -FLT_MAX instead of 0 for LG2(0). lim x->0 log(x) = -inf so -FLT_MAX is a better approximation than 0 for LG2(0). --- src/mesa/shader/prog_execute.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/prog_execute.c b/src/mesa/shader/prog_execute.c index 69b81e724a..192d39aed1 100644 --- a/src/mesa/shader/prog_execute.c +++ b/src/mesa/shader/prog_execute.c @@ -939,7 +939,7 @@ _mesa_execute_program(GLcontext * ctx, /* The fast LOG2 macro doesn't meet the precision requirements. */ if (a[0] == 0.0F) { - val = 0.0F; + val = -FLT_MAX; } else { val = log(a[0]) * 1.442695F; -- cgit v1.2.3 From 495628bc5c3879ee759f9a1bc7e2abc720df75a9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 1 Oct 2009 13:34:49 -0600 Subject: st/mesa: fix non-mipmap lastLevel calculation. reviewed by Brian Paul. (cherry picked from master, commit ae2daacbac7242938cffe0e2409071e030e00863) --- src/mesa/state_tracker/st_cb_texture.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index b13e3774c8..50675b5896 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -1775,7 +1775,11 @@ st_finalize_texture(GLcontext *ctx, * incomplete. In that case, we'll have set stObj->lastLevel before * we get here. */ - stObj->lastLevel = stObj->base._MaxLevel - stObj->base.BaseLevel; + if (stObj->base.MinFilter == GL_LINEAR || + stObj->base.MinFilter == GL_NEAREST) + stObj->lastLevel = stObj->base.BaseLevel; + else + stObj->lastLevel = stObj->base._MaxLevel - stObj->base.BaseLevel; } firstImage = st_texture_image(stObj->base.Image[0][stObj->base.BaseLevel]); -- cgit v1.2.3 From b154497bef386e5ed0d9a2f6e25a4141759c6846 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 1 Oct 2009 14:49:04 -0600 Subject: st/mesa: silence hidden parameter warning --- src/mesa/state_tracker/st_cb_drawpixels.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index a9cafbf8cd..c655690603 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -598,15 +598,15 @@ draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z, /* viewport state: viewport matching window dims */ { - const float width = (float) ctx->DrawBuffer->Width; - const float height = (float) ctx->DrawBuffer->Height; + const float w = (float) ctx->DrawBuffer->Width; + const float h = (float) ctx->DrawBuffer->Height; struct pipe_viewport_state vp; - vp.scale[0] = 0.5f * width; - vp.scale[1] = -0.5f * height; + vp.scale[0] = 0.5f * w; + vp.scale[1] = -0.5f * h; vp.scale[2] = 1.0f; vp.scale[3] = 1.0f; - vp.translate[0] = 0.5f * width; - vp.translate[1] = 0.5f * height; + vp.translate[0] = 0.5f * w; + vp.translate[1] = 0.5f * h; vp.translate[2] = 0.0f; vp.translate[3] = 0.0f; cso_set_viewport(cso, &vp); -- cgit v1.2.3 From b3e41e0d5e03b040768547293e05e6540d3c8e4d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 1 Oct 2009 14:49:34 -0600 Subject: st/mesa: check for null before asserts, fix possible mem leak --- src/mesa/state_tracker/st_cb_fbo.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index fe0a121493..e8399ded7b 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -165,12 +165,12 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb, strb->texture, 0, 0, 0, surface_usage ); - - assert(strb->surface->texture); - assert(strb->surface->format); - assert(strb->surface->width == width); - assert(strb->surface->height == height); - + if (strb->surface) { + assert(strb->surface->texture); + assert(strb->surface->format); + assert(strb->surface->width == width); + assert(strb->surface->height == height); + } return strb->surface != NULL; } @@ -298,6 +298,7 @@ st_new_renderbuffer_fb(enum pipe_format format, int samples, boolean sw) default: _mesa_problem(NULL, "Unexpected format in st_new_renderbuffer_fb"); + _mesa_free(strb); return NULL; } -- cgit v1.2.3 From 9b27a0d063402e709ebc588aa3d927d461b96755 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 1 Oct 2009 14:50:45 -0600 Subject: glsl: fix mem leak --- src/mesa/shader/slang/slang_link.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index 8f2b40d5df..71038d2d94 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -670,6 +670,7 @@ get_main_shader(GLcontext *ctx, !shader->Main || shader->UnresolvedRefs) { link_error(shProg, "Unresolved symbols"); + _mesa_free_shader(ctx, shader); return NULL; } } -- cgit v1.2.3 From 7b568614a28cb0b0fec375e79aebf51a6f210b44 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 1 Oct 2009 14:51:26 -0600 Subject: mesa: fix potential uninitialized memory reads --- src/mesa/main/dlist.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index b53c1733fb..41a5b61406 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -1956,6 +1956,9 @@ save_Fogiv(GLenum pname, const GLint *params) case GL_FOG_END: case GL_FOG_INDEX: p[0] = (GLfloat) *params; + p[1] = 0.0f; + p[2] = 0.0f; + p[3] = 0.0f; break; case GL_FOG_COLOR: p[0] = INT_TO_FLOAT(params[0]); @@ -2244,6 +2247,9 @@ save_LightModeliv(GLenum pname, const GLint *params) case GL_LIGHT_MODEL_TWO_SIDE: case GL_LIGHT_MODEL_COLOR_CONTROL: fparam[0] = (GLfloat) params[0]; + fparam[1] = 0.0F; + fparam[2] = 0.0F; + fparam[3] = 0.0F; break; default: /* Error will be caught later in gl_LightModelfv */ -- cgit v1.2.3 From 63064cf7c3437e3ebb7ab36524f21472af7e47e9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 1 Oct 2009 14:51:43 -0600 Subject: mesa: add missing return when out of memory --- src/mesa/main/context.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index f6d4ac4595..ac6540f4a0 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -898,6 +898,7 @@ _mesa_initialize_context(GLcontext *ctx, _mesa_free_shared_state(ctx, ctx->Shared); if (ctx->Exec) _mesa_free(ctx->Exec); + return GL_FALSE; } #if FEATURE_dispatch _mesa_init_exec_table(ctx->Exec); -- cgit v1.2.3 From 05749542384abc4d4776bfe2a386b6396002e0df Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 1 Oct 2009 14:52:28 -0600 Subject: mesa: fix mem leaks --- src/mesa/shader/prog_optimize.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/shader/prog_optimize.c b/src/mesa/shader/prog_optimize.c index be903106a0..9d937488e3 100644 --- a/src/mesa/shader/prog_optimize.c +++ b/src/mesa/shader/prog_optimize.c @@ -217,6 +217,7 @@ _mesa_remove_dead_code(struct gl_program *prog) if (inst->SrcReg[j].RelAddr) { if (dbg) _mesa_printf("abort remove dead code (indirect temp)\n"); + _mesa_free(removeInst); return; } @@ -232,6 +233,7 @@ _mesa_remove_dead_code(struct gl_program *prog) if (inst->DstReg.RelAddr) { if (dbg) _mesa_printf("abort remove dead code (indirect temp)\n"); + _mesa_free(removeInst); return; } @@ -422,6 +424,8 @@ _mesa_remove_extra_moves(struct gl_program *prog) /* now remove the instructions which aren't needed */ rem = remove_instructions(prog, removeInst); + _mesa_free(removeInst); + if (dbg) { _mesa_printf("Optimize: End remove extra moves. %u instructions removed\n", rem); /*_mesa_print_program(prog);*/ -- cgit v1.2.3 From 167ffa9e035befd12143db909af424e5de8f64e4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 1 Oct 2009 14:55:13 -0600 Subject: mesa: fix memory leak when generating mipmaps for compressed textures --- src/mesa/main/mipmap.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 3dca09d9f2..4d3e62572d 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -1510,7 +1510,9 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, /* Find convertFormat - the format that do_row() will process */ if (srcImage->IsCompressed) { - /* setup for compressed textures */ + /* setup for compressed textures - need to allocate temporary + * image buffers to hold uncompressed images. + */ GLuint row; GLint components, size; GLchan *dst; @@ -1587,11 +1589,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, &dstWidth, &dstHeight, &dstDepth); if (!nextLevel) { /* all done */ - if (srcImage->IsCompressed) { - _mesa_free((void *) srcData); - _mesa_free(dstData); - } - return; + break; } /* get dest gl_texture_image */ @@ -1682,6 +1680,12 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, } } /* loop over mipmap levels */ + + if (srcImage->IsCompressed) { + /* free uncompressed image buffers */ + _mesa_free((void *) srcData); + _mesa_free(dstData); + } } -- cgit v1.2.3 From 994d1db079b4947e6f10ab22a4b366a676382345 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 30 Jul 2009 12:32:40 -0700 Subject: i915: Let i915_program_error take a format string, and don't use _mesa_problem. It's misleading to report things like the program having too many native instructions as a Mesa implementation error, when the program may just be too big for the hardware. --- src/mesa/drivers/dri/i915/i915_fragprog.c | 17 ++++++++++------- src/mesa/drivers/dri/i915/i915_program.c | 17 +++++++++++++---- src/mesa/drivers/dri/i915/i915_program.h | 2 +- 3 files changed, 24 insertions(+), 12 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c index 2db10c60e9..beed8ef197 100644 --- a/src/mesa/drivers/dri/i915/i915_fragprog.c +++ b/src/mesa/drivers/dri/i915/i915_fragprog.c @@ -89,7 +89,8 @@ src_vector(struct i915_fragment_program *p, */ case PROGRAM_TEMPORARY: if (source->Index >= I915_MAX_TEMPORARY) { - i915_program_error(p, "Exceeded max temporary reg"); + i915_program_error(p, "Exceeded max temporary reg: %d/%d", + source->Index, I915_MAX_TEMPORARY); return 0; } src = UREG(REG_TYPE_R, source->Index); @@ -124,7 +125,7 @@ src_vector(struct i915_fragment_program *p, break; default: - i915_program_error(p, "Bad source->Index"); + i915_program_error(p, "Bad source->Index: %d", source->Index); return 0; } break; @@ -153,7 +154,7 @@ src_vector(struct i915_fragment_program *p, break; default: - i915_program_error(p, "Bad source->File"); + i915_program_error(p, "Bad source->File: %d", source->File); return 0; } @@ -186,13 +187,14 @@ get_result_vector(struct i915_fragment_program *p, p->depth_written = 1; return UREG(REG_TYPE_OD, 0); default: - i915_program_error(p, "Bad inst->DstReg.Index"); + i915_program_error(p, "Bad inst->DstReg.Index: %d", + inst->DstReg.Index); return 0; } case PROGRAM_TEMPORARY: return UREG(REG_TYPE_R, inst->DstReg.Index); default: - i915_program_error(p, "Bad inst->DstReg.File"); + i915_program_error(p, "Bad inst->DstReg.File: %d", inst->DstReg.File); return 0; } } @@ -231,7 +233,7 @@ translate_tex_src_target(struct i915_fragment_program *p, GLubyte bit) case TEXTURE_CUBE_INDEX: return D0_SAMPLE_TYPE_CUBE; default: - i915_program_error(p, "TexSrcBit"); + i915_program_error(p, "TexSrcBit: %d", bit); return 0; } } @@ -870,7 +872,8 @@ upload_program(struct i915_fragment_program *p) return; default: - i915_program_error(p, "bad opcode"); + i915_program_error(p, "bad opcode: %s", + _mesa_opcode_string(inst->Opcode)); return; } diff --git a/src/mesa/drivers/dri/i915/i915_program.c b/src/mesa/drivers/dri/i915/i915_program.c index e87700f8e0..85a1b0cf5d 100644 --- a/src/mesa/drivers/dri/i915/i915_program.c +++ b/src/mesa/drivers/dri/i915/i915_program.c @@ -424,12 +424,21 @@ i915_emit_param4fv(struct i915_fragment_program * p, const GLfloat * values) return 0; } - - +/* Warning the user about program errors seems to be quite valuable, from + * our bug reports. It unfortunately means piglit reporting errors + * when we fall back to software due to an unsupportable program, though. + */ void -i915_program_error(struct i915_fragment_program *p, const char *msg) +i915_program_error(struct i915_fragment_program *p, const char *fmt, ...) { - _mesa_problem(NULL, "i915_program_error: %s", msg); + va_list args; + + fprintf(stderr, "i915_program_error: "); + va_start(args, fmt); + vfprintf(stderr, fmt, args); + va_end(args); + + fprintf(stderr, "\n"); p->error = 1; } diff --git a/src/mesa/drivers/dri/i915/i915_program.h b/src/mesa/drivers/dri/i915/i915_program.h index 14a3f08801..1074d24f9e 100644 --- a/src/mesa/drivers/dri/i915/i915_program.h +++ b/src/mesa/drivers/dri/i915/i915_program.h @@ -145,7 +145,7 @@ extern GLuint i915_emit_param4fv(struct i915_fragment_program *p, const GLfloat * values); extern void i915_program_error(struct i915_fragment_program *p, - const char *msg); + const char *fmt, ...); extern void i915_init_program(struct i915_context *i915, struct i915_fragment_program *p); -- cgit v1.2.3 From 4ff816751f74b0645c198372937eec589c458a60 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 29 Jul 2009 22:39:15 -0700 Subject: i915: Bail when the fragment program has too many total instructions. Previously, we'd go trashing the heap. --- src/mesa/drivers/dri/i915/i915_program.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i915_program.c b/src/mesa/drivers/dri/i915/i915_program.c index 85a1b0cf5d..6ccc9eea3e 100644 --- a/src/mesa/drivers/dri/i915/i915_program.c +++ b/src/mesa/drivers/dri/i915/i915_program.c @@ -186,6 +186,11 @@ i915_emit_arith(struct i915_fragment_program * p, p->utemp_flag = old_utemp_flag; /* restore */ } + if (p->csr >= p->program + I915_PROGRAM_SIZE) { + i915_program_error(p, "Program contains too many instructions"); + return UREG_BAD; + } + *(p->csr++) = (op | A0_DEST(dest) | mask | saturate | A0_SRC0(src0)); *(p->csr++) = (A1_SRC0(src0) | A1_SRC1(src1)); *(p->csr++) = (A2_SRC1(src1) | A2_SRC2(src2)); @@ -270,6 +275,11 @@ GLuint i915_emit_texld( struct i915_fragment_program *p, p->register_phases[GET_UREG_NR(coord)] == p->nr_tex_indirect) p->nr_tex_indirect++; + if (p->csr >= p->program + I915_PROGRAM_SIZE) { + i915_program_error(p, "Program contains too many instructions"); + return UREG_BAD; + } + *(p->csr++) = (op | T0_DEST( dest ) | T0_SAMPLER( sampler )); -- cgit v1.2.3 From d6fbf87575a59e24c5d47b8b6b8700ee4583709b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 29 Jul 2009 22:46:14 -0700 Subject: Revert "i915: don't validate PS program when falling back to software" This reverts commit e7044d552c6d16389447880b8744a51de1cf0199. It prevented the driver from ever recovering from a software fallback due to a program error. The original bug it claimed to fix doesn't appear to exist post-revert. --- src/mesa/drivers/dri/i915/i915_vtbl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c b/src/mesa/drivers/dri/i915/i915_vtbl.c index 9a723d3cd7..9e2523932f 100644 --- a/src/mesa/drivers/dri/i915/i915_vtbl.c +++ b/src/mesa/drivers/dri/i915/i915_vtbl.c @@ -54,8 +54,7 @@ i915_render_prevalidate(struct intel_context *intel) { struct i915_context *i915 = i915_context(&intel->ctx); - if (!intel->Fallback) - i915ValidateFragmentProgram(i915); + i915ValidateFragmentProgram(i915); } static void -- cgit v1.2.3 From 61b512c47c9888f3ff117faf3aceccfb52d59c3a Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 29 Jul 2009 23:37:04 -0700 Subject: i915: Update and translate the fragment program along with state updates. Previously, we were doing it in the midst of the pipeline run, which gave an opportunity to enable/disable fallbacks, which is certainly the wrong time to be doing so. This manifested itself in a NULL dereference for PutRow after transitioning out of a fallback during a run_pipeline in glean glsl1. --- src/mesa/drivers/dri/i915/i915_context.c | 3 +++ src/mesa/drivers/dri/i915/i915_fragprog.c | 32 +++++++++++++++++++++---------- src/mesa/drivers/dri/i915/i915_program.c | 2 -- src/mesa/drivers/dri/i915/i915_program.h | 3 +-- 4 files changed, 26 insertions(+), 14 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c index 3ab7d682ee..b342503772 100644 --- a/src/mesa/drivers/dri/i915/i915_context.c +++ b/src/mesa/drivers/dri/i915/i915_context.c @@ -40,6 +40,7 @@ #include "utils.h" #include "i915_reg.h" +#include "i915_program.h" #include "intel_regions.h" #include "intel_batchbuffer.h" @@ -80,6 +81,8 @@ i915InvalidateState(GLcontext * ctx, GLuint new_state) i915_update_stencil(ctx); if (new_state & (_NEW_LIGHT)) i915_update_provoking_vertex(ctx); + if (new_state & (_NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS)) + i915_update_program(ctx); } diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c index beed8ef197..929a6eb835 100644 --- a/src/mesa/drivers/dri/i915/i915_fragprog.c +++ b/src/mesa/drivers/dri/i915/i915_fragprog.c @@ -1058,6 +1058,28 @@ i915ProgramStringNotify(GLcontext * ctx, _tnl_program_string(ctx, target, prog); } +void +i915_update_program(GLcontext *ctx) +{ + struct intel_context *intel = intel_context(ctx); + struct i915_context *i915 = i915_context(&intel->ctx); + struct i915_fragment_program *fp = + (struct i915_fragment_program *) ctx->FragmentProgram._Current; + + if (i915->current_program != fp) { + if (i915->current_program) { + i915->current_program->on_hardware = 0; + i915->current_program->params_uptodate = 0; + } + + i915->current_program = fp; + } + + if (!fp->translated) + translate_program(fp); + + FALLBACK(&i915->intel, I915_FALLBACK_PROGRAM, fp->error); +} void i915ValidateFragmentProgram(struct i915_context *i915) @@ -1075,16 +1097,6 @@ i915ValidateFragmentProgram(struct i915_context *i915) GLuint s2 = S2_TEXCOORD_NONE; int i, offset = 0; - if (i915->current_program != p) { - if (i915->current_program) { - i915->current_program->on_hardware = 0; - i915->current_program->params_uptodate = 0; - } - - i915->current_program = p; - } - - /* Important: */ VB->AttribPtr[VERT_ATTRIB_POS] = VB->NdcPtr; diff --git a/src/mesa/drivers/dri/i915/i915_program.c b/src/mesa/drivers/dri/i915/i915_program.c index 6ccc9eea3e..fd3019b234 100644 --- a/src/mesa/drivers/dri/i915/i915_program.c +++ b/src/mesa/drivers/dri/i915/i915_program.c @@ -530,8 +530,6 @@ i915_upload_program(struct i915_context *i915, GLuint program_size = p->csr - p->program; GLuint decl_size = p->decl - p->declarations; - FALLBACK(&i915->intel, I915_FALLBACK_PROGRAM, p->error); - /* Could just go straight to the batchbuffer from here: */ if (i915->state.ProgramSize != (program_size + decl_size) || diff --git a/src/mesa/drivers/dri/i915/i915_program.h b/src/mesa/drivers/dri/i915/i915_program.h index 1074d24f9e..0d17d04865 100644 --- a/src/mesa/drivers/dri/i915/i915_program.h +++ b/src/mesa/drivers/dri/i915/i915_program.h @@ -155,7 +155,6 @@ extern void i915_upload_program(struct i915_context *i915, extern void i915_fini_program(struct i915_fragment_program *p); - - +extern void i915_update_program(GLcontext *ctx); #endif -- cgit v1.2.3 From 96a3c69d48bb7c021181e061d010cca08198ae4c Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 30 Jul 2009 00:03:21 -0700 Subject: i915: Increase maximum program size to the hardware limits. This fixes potential heap trashing if the program of choice exceeds limits, and fixes the native instructions limit being lower than what can be used by valid programs. --- src/mesa/drivers/dri/i915/i915_context.h | 15 ++++++++++----- src/mesa/drivers/dri/i915/i915_program.c | 8 ++++++-- 2 files changed, 16 insertions(+), 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i915_context.h b/src/mesa/drivers/dri/i915/i915_context.h index 8de4a9d0d3..082d614442 100644 --- a/src/mesa/drivers/dri/i915/i915_context.h +++ b/src/mesa/drivers/dri/i915/i915_context.h @@ -121,10 +121,14 @@ enum { #define I915_MAX_CONSTANT 32 #define I915_CONSTANT_SIZE (2+(4*I915_MAX_CONSTANT)) +#define I915_MAX_INSN (I915_MAX_DECL_INSN + \ + I915_MAX_TEX_INSN + \ + I915_MAX_ALU_INSN) -#define I915_PROGRAM_SIZE 192 - -#define I915_MAX_INSN (I915_MAX_TEX_INSN+I915_MAX_ALU_INSN) +/* Maximum size of the program packet, which matches the limits on + * decl, tex, and ALU instructions. + */ +#define I915_PROGRAM_SIZE (I915_MAX_INSN * 3 + 1) /* Hardware version of a parsed fragment program. "Derived" from the * mesa fragment_program struct. @@ -154,8 +158,9 @@ struct i915_fragment_program */ GLcontext *ctx; - GLuint declarations[I915_PROGRAM_SIZE]; - GLuint program[I915_PROGRAM_SIZE]; + /* declarations contains the packet header. */ + GLuint declarations[I915_MAX_DECL_INSN * 3 + 1]; + GLuint program[(I915_MAX_TEX_INSN + I915_MAX_ALU_INSN) * 3]; GLfloat constant[I915_MAX_CONSTANT][4]; GLuint constant_flags[I915_MAX_CONSTANT]; diff --git a/src/mesa/drivers/dri/i915/i915_program.c b/src/mesa/drivers/dri/i915/i915_program.c index fd3019b234..e7908bd48f 100644 --- a/src/mesa/drivers/dri/i915/i915_program.c +++ b/src/mesa/drivers/dri/i915/i915_program.c @@ -130,6 +130,7 @@ i915_emit_decl(struct i915_fragment_program *p, *(p->decl++) = (D0_DCL | D0_DEST(reg) | d0_flags); *(p->decl++) = D1_MBZ; *(p->decl++) = D2_MBZ; + assert(p->decl <= p->declarations + ARRAY_SIZE(p->declarations)); p->nr_decl_insn++; return reg; @@ -186,7 +187,7 @@ i915_emit_arith(struct i915_fragment_program * p, p->utemp_flag = old_utemp_flag; /* restore */ } - if (p->csr >= p->program + I915_PROGRAM_SIZE) { + if (p->csr >= p->program + ARRAY_SIZE(p->program)) { i915_program_error(p, "Program contains too many instructions"); return UREG_BAD; } @@ -275,7 +276,7 @@ GLuint i915_emit_texld( struct i915_fragment_program *p, p->register_phases[GET_UREG_NR(coord)] == p->nr_tex_indirect) p->nr_tex_indirect++; - if (p->csr >= p->program + I915_PROGRAM_SIZE) { + if (p->csr >= p->program + ARRAY_SIZE(p->program)) { i915_program_error(p, "Program contains too many instructions"); return UREG_BAD; } @@ -530,6 +531,9 @@ i915_upload_program(struct i915_context *i915, GLuint program_size = p->csr - p->program; GLuint decl_size = p->decl - p->declarations; + if (p->error) + return; + /* Could just go straight to the batchbuffer from here: */ if (i915->state.ProgramSize != (program_size + decl_size) || -- cgit v1.2.3 From 7d4b7460b0e565d0574c00d1d40c426cfebc290d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 29 Jul 2009 12:15:14 -0700 Subject: i915: Enable ARB_vertex_shader for both i915 and i830. Since the TNL is all done in software anyway, it should be the same to the user who's probably using ARB_vertex_program otherwise, but gives them a nicer programming environment. --- src/mesa/drivers/dri/i915/intel_tris.c | 2 ++ src/mesa/drivers/dri/intel/intel_extensions.c | 8 +++--- src/mesa/drivers/dri/intel/intel_span.c | 37 +++++++++++++++++++++++++++ src/mesa/drivers/dri/intel/intel_span.h | 2 ++ 4 files changed, 45 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/intel_tris.c b/src/mesa/drivers/dri/i915/intel_tris.c index a905455342..0641e6df9d 100644 --- a/src/mesa/drivers/dri/i915/intel_tris.c +++ b/src/mesa/drivers/dri/i915/intel_tris.c @@ -1076,7 +1076,9 @@ intelRunPipeline(GLcontext * ctx) intel->NewGLState = 0; } + intel_map_vertex_shader_textures(ctx); _tnl_run_pipeline(ctx); + intel_unmap_vertex_shader_textures(ctx); _mesa_unlock_context_textures(ctx); } diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index 5431cf90a1..f10eda7cc7 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -80,6 +80,9 @@ static const struct dri_extension card_extensions[] = { { "GL_ARB_multitexture", NULL }, { "GL_ARB_point_parameters", GL_ARB_point_parameters_functions }, { "GL_ARB_point_sprite", NULL }, + { "GL_ARB_shader_objects", GL_ARB_shader_objects_functions }, + { "GL_ARB_shading_language_100", GL_VERSION_2_0_functions }, + { "GL_ARB_shading_language_120", GL_VERSION_2_1_functions }, { "GL_ARB_sync", GL_ARB_sync_functions }, { "GL_ARB_texture_border_clamp", NULL }, { "GL_ARB_texture_cube_map", NULL }, @@ -91,6 +94,7 @@ static const struct dri_extension card_extensions[] = { { "GL_ARB_texture_rectangle", NULL }, { "GL_ARB_vertex_array_object", GL_ARB_vertex_array_object_functions}, { "GL_ARB_vertex_program", GL_ARB_vertex_program_functions }, + { "GL_ARB_vertex_shader", GL_ARB_vertex_shader_functions }, { "GL_ARB_window_pos", GL_ARB_window_pos_functions }, { "GL_EXT_blend_color", GL_EXT_blend_color_functions }, { "GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions }, @@ -150,13 +154,9 @@ static const struct dri_extension brw_extensions[] = { { "GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions }, { "GL_ARB_point_sprite", NULL }, { "GL_ARB_seamless_cube_map", NULL }, - { "GL_ARB_shader_objects", GL_ARB_shader_objects_functions }, - { "GL_ARB_shading_language_100", GL_VERSION_2_0_functions }, - { "GL_ARB_shading_language_120", GL_VERSION_2_1_functions }, { "GL_ARB_shadow", NULL }, { "GL_MESA_texture_signed_rgba", NULL }, { "GL_ARB_texture_non_power_of_two", NULL }, - { "GL_ARB_vertex_shader", GL_ARB_vertex_shader_functions }, { "GL_EXT_shadow_funcs", NULL }, { "GL_EXT_stencil_two_side", GL_EXT_stencil_two_side_functions }, { "GL_EXT_texture_sRGB", NULL }, diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index 28eabbc005..dcfcad1d95 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -558,6 +558,43 @@ intelInitSpanFuncs(GLcontext * ctx) swdd->SpanRenderFinish = intelSpanRenderFinish; } +void +intel_map_vertex_shader_textures(GLcontext *ctx) +{ + struct intel_context *intel = intel_context(ctx); + int i; + + if (ctx->VertexProgram._Current == NULL) + return; + + for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) { + if (ctx->Texture.Unit[i]._ReallyEnabled && + ctx->VertexProgram._Current->Base.TexturesUsed[i] != 0) { + struct gl_texture_object *texObj = ctx->Texture.Unit[i]._Current; + + intel_tex_map_images(intel, intel_texture_object(texObj)); + } + } +} + +void +intel_unmap_vertex_shader_textures(GLcontext *ctx) +{ + struct intel_context *intel = intel_context(ctx); + int i; + + if (ctx->VertexProgram._Current == NULL) + return; + + for (i = 0; i < ctx->Const.MaxTextureImageUnits; i++) { + if (ctx->Texture.Unit[i]._ReallyEnabled && + ctx->VertexProgram._Current->Base.TexturesUsed[i] != 0) { + struct gl_texture_object *texObj = ctx->Texture.Unit[i]._Current; + + intel_tex_unmap_images(intel, intel_texture_object(texObj)); + } + } +} /** * Plug in appropriate span read/write functions for the given renderbuffer. diff --git a/src/mesa/drivers/dri/intel/intel_span.h b/src/mesa/drivers/dri/intel/intel_span.h index acbeb4abe1..bffe109aa5 100644 --- a/src/mesa/drivers/dri/intel/intel_span.h +++ b/src/mesa/drivers/dri/intel/intel_span.h @@ -36,5 +36,7 @@ void intel_renderbuffer_map(struct intel_context *intel, struct gl_renderbuffer *rb); void intel_renderbuffer_unmap(struct intel_context *intel, struct gl_renderbuffer *rb); +void intel_map_vertex_shader_textures(GLcontext *ctx); +void intel_unmap_vertex_shader_textures(GLcontext *ctx); #endif -- cgit v1.2.3 From f9f31b25740887373806cb489e5480dc9b261805 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 1 Oct 2009 14:00:28 -0700 Subject: i915: Add support for varying inputs. --- src/mesa/drivers/dri/i915/i915_context.c | 2 +- src/mesa/drivers/dri/i915/i915_fragprog.c | 23 ++++++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c index b342503772..7d4c7cfbab 100644 --- a/src/mesa/drivers/dri/i915/i915_context.c +++ b/src/mesa/drivers/dri/i915/i915_context.c @@ -142,7 +142,7 @@ i915CreateContext(const __GLcontextModes * mesaVis, ctx->Const.MaxTextureUnits = I915_TEX_UNITS; ctx->Const.MaxTextureImageUnits = I915_TEX_UNITS; ctx->Const.MaxTextureCoordUnits = I915_TEX_UNITS; - + ctx->Const.MaxVarying = I915_TEX_UNITS; /* Advertise the full hardware capabilities. The new memory * manager should cope much better with overload situations: diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c index 929a6eb835..66db7e1645 100644 --- a/src/mesa/drivers/dri/i915/i915_fragprog.c +++ b/src/mesa/drivers/dri/i915/i915_fragprog.c @@ -122,6 +122,19 @@ src_vector(struct i915_fragment_program *p, src = i915_emit_decl(p, REG_TYPE_T, T_TEX0 + (source->Index - FRAG_ATTRIB_TEX0), D0_CHANNEL_ALL); + break; + + case FRAG_ATTRIB_VAR0: + case FRAG_ATTRIB_VAR0 + 1: + case FRAG_ATTRIB_VAR0 + 2: + case FRAG_ATTRIB_VAR0 + 3: + case FRAG_ATTRIB_VAR0 + 4: + case FRAG_ATTRIB_VAR0 + 5: + case FRAG_ATTRIB_VAR0 + 6: + case FRAG_ATTRIB_VAR0 + 7: + src = i915_emit_decl(p, REG_TYPE_T, + T_TEX0 + (source->Index - FRAG_ATTRIB_VAR0), + D0_CHANNEL_ALL); break; default: @@ -909,7 +922,7 @@ check_wpos(struct i915_fragment_program *p) p->wpos_tex = -1; for (i = 0; i < p->ctx->Const.MaxTextureCoordUnits; i++) { - if (inputs & FRAG_BIT_TEX(i)) + if (inputs & (FRAG_BIT_TEX(i) | FRAG_BIT_VAR(i))) continue; else if (inputs & FRAG_BIT_WPOS) { p->wpos_tex = i; @@ -1140,6 +1153,14 @@ i915ValidateFragmentProgram(struct i915_context *i915) EMIT_ATTR(_TNL_ATTRIB_TEX0 + i, EMIT_SZ(sz), 0, sz * 4); } + else if (inputsRead & FRAG_BIT_VAR(i)) { + int sz = VB->AttribPtr[_TNL_ATTRIB_GENERIC0 + i]->size; + + s2 &= ~S2_TEXCOORD_FMT(i, S2_TEXCOORD_FMT0_MASK); + s2 |= S2_TEXCOORD_FMT(i, SZ_TO_HW(sz)); + + EMIT_ATTR(_TNL_ATTRIB_GENERIC0 + i, EMIT_SZ(sz), 0, sz * 4); + } else if (i == p->wpos_tex) { /* If WPOS is required, duplicate the XYZ position data in an -- cgit v1.2.3 From 67f4d626d39f2c340fa1632d3e4344c547301508 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 29 Jul 2009 20:44:39 -0700 Subject: i915: Add support or fallbacks for GLSL fragment shader opcodes. --- src/mesa/drivers/dri/i915/i915_fragprog.c | 162 +++++++++++++++++++++++++++++- 1 file changed, 158 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c index 66db7e1645..d5659e762f 100644 --- a/src/mesa/drivers/dri/i915/i915_fragprog.c +++ b/src/mesa/drivers/dri/i915/i915_fragprog.c @@ -366,7 +366,7 @@ upload_program(struct i915_fragment_program *p) while (1) { GLuint src0, src1, src2, flags; - GLuint tmp = 0, consts0 = 0, consts1 = 0; + GLuint tmp = 0, dst, consts0 = 0, consts1 = 0; switch (inst->Opcode) { case OPCODE_ABS: @@ -518,6 +518,10 @@ upload_program(struct i915_fragment_program *p) EMIT_1ARG_ARITH(A0_FLR); break; + case OPCODE_TRUNC: + EMIT_1ARG_ARITH(A0_TRC); + break; + case OPCODE_FRC: EMIT_1ARG_ARITH(A0_FRC); break; @@ -531,6 +535,22 @@ upload_program(struct i915_fragment_program *p) 0, src0, T0_TEXKILL); break; + case OPCODE_KIL_NV: + if (inst->DstReg.CondMask == COND_TR) { + tmp = i915_get_utemp(p); + + i915_emit_texld(p, get_live_regs(p, inst), + tmp, A0_DEST_CHANNEL_ALL, + 0, /* use a dummy dest reg */ + swizzle(tmp, ONE, ONE, ONE, ONE), /* always */ + T0_TEXKILL); + } else { + p->error = 1; + i915_program_error(p, "Unsupported KIL_NV condition code: %d", + inst->DstReg.CondMask); + } + break; + case OPCODE_LG2: src0 = src_vector(p, &inst->SrcReg[0], program); @@ -630,6 +650,20 @@ upload_program(struct i915_fragment_program *p) EMIT_2ARG_ARITH(A0_MUL); break; + case OPCODE_NOISE1: + case OPCODE_NOISE2: + case OPCODE_NOISE3: + case OPCODE_NOISE4: + /* Don't implement noise because we just don't have the instructions + * to spare. We aren't the first vendor to do so. + */ + i915_program_error(p, "Stubbed-out noise functions"); + i915_emit_arith(p, + A0_MOV, + get_result_vector(p, inst), + get_result_flags(inst), 0, + swizzle(src0, ZERO, ZERO, ZERO, ZERO), 0, 0); + case OPCODE_POW: src0 = src_vector(p, &inst->SrcReg[0], program); src1 = src_vector(p, &inst->SrcReg[1], program); @@ -736,9 +770,38 @@ upload_program(struct i915_fragment_program *p) } break; - case OPCODE_SGE: - EMIT_2ARG_ARITH(A0_SGE); - break; + case OPCODE_SEQ: + tmp = i915_get_utemp(p); + flags = get_result_flags(inst); + dst = get_result_vector(p, inst); + + /* dst = src1 >= src2 */ + i915_emit_arith(p, + A0_SGE, + dst, + flags, 0, + src_vector(p, &inst->SrcReg[0], program), + src_vector(p, &inst->SrcReg[1], program), + 0); + /* tmp = src1 <= src2 */ + i915_emit_arith(p, + A0_SGE, + tmp, + flags, 0, + negate(src_vector(p, &inst->SrcReg[0], program), + 1, 1, 1, 1), + negate(src_vector(p, &inst->SrcReg[1], program), + 1, 1, 1, 1), + 0); + /* dst = tmp && dst */ + i915_emit_arith(p, + A0_MUL, + dst, + flags, 0, + dst, + tmp, + 0); + break; case OPCODE_SIN: src0 = src_vector(p, &inst->SrcReg[0], program); @@ -824,10 +887,71 @@ upload_program(struct i915_fragment_program *p) break; + case OPCODE_SGE: + EMIT_2ARG_ARITH(A0_SGE); + break; + + case OPCODE_SGT: + i915_emit_arith(p, + A0_SLT, + get_result_vector( p, inst ), + get_result_flags( inst ), 0, + negate(src_vector( p, &inst->SrcReg[0], program), + 1, 1, 1, 1), + negate(src_vector( p, &inst->SrcReg[1], program), + 1, 1, 1, 1), + 0); + break; + + case OPCODE_SLE: + i915_emit_arith(p, + A0_SGE, + get_result_vector( p, inst ), + get_result_flags( inst ), 0, + negate(src_vector( p, &inst->SrcReg[0], program), + 1, 1, 1, 1), + negate(src_vector( p, &inst->SrcReg[1], program), + 1, 1, 1, 1), + 0); + break; + case OPCODE_SLT: EMIT_2ARG_ARITH(A0_SLT); break; + case OPCODE_SNE: + tmp = i915_get_utemp(p); + flags = get_result_flags(inst); + dst = get_result_vector(p, inst); + + /* dst = src1 < src2 */ + i915_emit_arith(p, + A0_SLT, + dst, + flags, 0, + src_vector(p, &inst->SrcReg[0], program), + src_vector(p, &inst->SrcReg[1], program), + 0); + /* tmp = src1 > src2 */ + i915_emit_arith(p, + A0_SLT, + tmp, + flags, 0, + negate(src_vector(p, &inst->SrcReg[0], program), + 1, 1, 1, 1), + negate(src_vector(p, &inst->SrcReg[1], program), + 1, 1, 1, 1), + 0); + /* dst = tmp || dst */ + i915_emit_arith(p, + A0_ADD, + dst, + flags | A0_DEST_SATURATE, 0, + dst, + tmp, + 0); + break; + case OPCODE_SUB: src0 = src_vector(p, &inst->SrcReg[0], program); src1 = src_vector(p, &inst->SrcReg[1], program); @@ -884,6 +1008,36 @@ upload_program(struct i915_fragment_program *p) case OPCODE_END: return; + case OPCODE_BGNLOOP: + case OPCODE_BGNSUB: + case OPCODE_BRA: + case OPCODE_BRK: + case OPCODE_CAL: + case OPCODE_CONT: + case OPCODE_DDX: + case OPCODE_DDY: + case OPCODE_ELSE: + case OPCODE_ENDIF: + case OPCODE_ENDLOOP: + case OPCODE_ENDSUB: + case OPCODE_IF: + case OPCODE_RET: + p->error = 1; + i915_program_error(p, "Unsupported opcode: %s", + _mesa_opcode_string(inst->Opcode)); + return; + + case OPCODE_EXP: + case OPCODE_LOG: + /* These opcodes are claimed as GLSL, NV_vp, and ARB_vp in + * prog_instruction.h, but apparently GLSL doesn't ever emit them. + * Instead, it translates to EX2 or LG2. + */ + case OPCODE_TXD: + case OPCODE_TXL: + /* These opcodes are claimed by GLSL in prog_instruction.h, but + * only NV_vp/fp appears to emit them. + */ default: i915_program_error(p, "bad opcode: %s", _mesa_opcode_string(inst->Opcode)); -- cgit v1.2.3 From 862a2a55b35d1dec9224b025a6e7a0cf8593a6a7 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 29 Jul 2009 13:00:09 -0700 Subject: i915: Add optional support for ARB_fragment_shader under a driconf option. Other vendors have enabled ARB_fragment_shader as part of OpenGL 2.0 enablement even on hardware like the 915 with no dynamic branching or dFdx/dFdy support. But for now we'll leave it disabled because we don't do any flattening of ifs or loops, which is rather restrictive. This support is not complete, and may be unstable depending on your shaders. It passes 10/15 of the piglit glsl tests, but hangs on glean glsl1. --- src/mesa/drivers/dri/i915/i915_fragprog.c | 1 + src/mesa/drivers/dri/intel/intel_context.h | 1 - src/mesa/drivers/dri/intel/intel_extensions.c | 10 +++++++++- src/mesa/drivers/dri/intel/intel_screen.c | 6 +++++- 4 files changed, 15 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c index d5659e762f..d9c61446f5 100644 --- a/src/mesa/drivers/dri/i915/i915_fragprog.c +++ b/src/mesa/drivers/dri/i915/i915_fragprog.c @@ -160,6 +160,7 @@ src_vector(struct i915_fragment_program *p, case PROGRAM_CONSTANT: case PROGRAM_STATE_VAR: case PROGRAM_NAMED_PARAM: + case PROGRAM_UNIFORM: src = i915_emit_param4fv(p, program->Base.Parameters->ParameterValues[source-> diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index c743ab1c24..b104096912 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -293,7 +293,6 @@ struct intel_context GLboolean use_texture_tiling; GLboolean use_early_z; - drm_clip_rect_t fboRect; /**< cliprect for FBO rendering */ int perf_boxes; diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index f10eda7cc7..6831cbbfc8 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -182,6 +182,10 @@ static const struct dri_extension ttm_extensions[] = { { NULL, NULL } }; +static const struct dri_extension fragment_shader_extensions[] = { + { "GL_ARB_fragment_shader", NULL }, + { NULL, NULL } +}; /** * Initializes potential list of extensions if ctx == NULL, or actually enables @@ -205,6 +209,10 @@ intelInitExtensions(GLcontext *ctx, GLboolean enable_imaging) driInitExtensions(ctx, brw_extensions, GL_FALSE); if (intel == NULL || IS_915(intel->intelScreen->deviceID) - || IS_945(intel->intelScreen->deviceID)) + || IS_945(intel->intelScreen->deviceID)) { driInitExtensions(ctx, i915_extensions, GL_FALSE); + + if (intel == NULL || driQueryOptionb(&intel->optionCache, "fragment_shader")) + driInitExtensions(ctx, fragment_shader_extensions, GL_FALSE); + } } diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index 1b8c56e68d..2478e63637 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -79,6 +79,10 @@ PUBLIC const char __driConfigOptions[] = DRI_CONF_DESC(en, "Enable early Z in classic mode (unstable, 945-only).") DRI_CONF_OPT_END + DRI_CONF_OPT_BEGIN(fragment_shader, bool, false) + DRI_CONF_DESC(en, "Enable limited ARB_fragment_shader support on 915/945.") + DRI_CONF_OPT_END + DRI_CONF_SECTION_END DRI_CONF_SECTION_QUALITY DRI_CONF_FORCE_S3TC_ENABLE(false) @@ -91,7 +95,7 @@ PUBLIC const char __driConfigOptions[] = DRI_CONF_SECTION_END DRI_CONF_END; -const GLuint __driNConfigOptions = 10; +const GLuint __driNConfigOptions = 11; #ifdef USE_NEW_INTERFACE static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; -- cgit v1.2.3 From 81aa5d717bd0098608e9cc292b316293800c7e11 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 29 Jul 2009 13:07:49 -0700 Subject: i915: Add stub ARB_occlusion_query support under a driconf debug option. This is useful for enabling our GLSL testcases using the 2.0 entrypoints even though we don't have full GL 2.0. --- src/mesa/drivers/dri/intel/intel_extensions.c | 5 +++++ src/mesa/drivers/dri/intel/intel_screen.c | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index 6831cbbfc8..2eb08a8f05 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -171,6 +171,7 @@ static const struct dri_extension brw_extensions[] = { static const struct dri_extension arb_oq_extensions[] = { + { "GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions }, { NULL, NULL } }; @@ -214,5 +215,9 @@ intelInitExtensions(GLcontext *ctx, GLboolean enable_imaging) if (intel == NULL || driQueryOptionb(&intel->optionCache, "fragment_shader")) driInitExtensions(ctx, fragment_shader_extensions, GL_FALSE); + + if (intel == NULL || driQueryOptionb(&intel->optionCache, + "stub_occlusion_query")) + driInitExtensions(ctx, arb_oq_extensions, GL_FALSE); } } diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index 2478e63637..24f7fbc992 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -92,10 +92,14 @@ PUBLIC const char __driConfigOptions[] = DRI_CONF_NO_RAST(false) DRI_CONF_ALWAYS_FLUSH_BATCH(false) DRI_CONF_ALWAYS_FLUSH_CACHE(false) + + DRI_CONF_OPT_BEGIN(stub_occlusion_query, bool, false) + DRI_CONF_DESC(en, "Enable stub ARB_occlusion_query support on 915/945.") + DRI_CONF_OPT_END DRI_CONF_SECTION_END DRI_CONF_END; -const GLuint __driNConfigOptions = 11; +const GLuint __driNConfigOptions = 12; #ifdef USE_NEW_INTERFACE static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; -- cgit v1.2.3 From 1c7ec97ec47f294dcfc0c6a87ee26bb3565f95d4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 1 Oct 2009 15:59:13 -0600 Subject: mesa: added _mesa_format_image_size() --- src/mesa/main/formats.c | 27 +++++++++++++++++++++++++++ src/mesa/main/formats.h | 4 ++++ 2 files changed, 31 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index dec3daee7c..82843a3291 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -593,6 +593,33 @@ _mesa_is_format_compressed(gl_format format) } +/** + * Return number of bytes needed to store an image of the given size + * in the given format. + */ +GLuint +_mesa_format_image_size(gl_format format, GLsizei width, + GLsizei height, GLsizei depth) +{ + const struct gl_format_info *info = _mesa_get_format_info(format); + if (info->BlockWidth > 1 || info->BlockHeight > 1) { + /* compressed format */ + const GLuint bw = info->BlockWidth, bh = info->BlockHeight; + const GLuint wblocks = (width + bw - 1) / bw; + const GLuint hblocks = (height + bh - 1) / bh; + const GLuint sz = wblocks * hblocks * info->BytesPerBlock; + return sz; + } + else { + /* non-compressed */ + const GLuint sz = width * height * depth * info->BytesPerBlock; + return sz; + } +} + + + + /** * Do sanity checking of the format info table. */ diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index 99a6534ff1..b91682809f 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -202,6 +202,10 @@ extern void _mesa_format_to_type_and_comps2(gl_format format, GLenum *datatype, GLuint *comps); +extern GLuint +_mesa_format_image_size(gl_format format, GLsizei width, + GLsizei height, GLsizei depth); + extern void _mesa_test_formats(void); -- cgit v1.2.3 From 040fd7ed44c21a1faaa6475888e9365e8f0de42b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 1 Oct 2009 16:27:23 -0600 Subject: mesa: added _mesa_format_row_stride() --- src/mesa/main/formats.c | 22 +++++++++++++++++++++- src/mesa/main/formats.h | 4 ++++ 2 files changed, 25 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index 82843a3291..ebe59f8960 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -602,12 +602,13 @@ _mesa_format_image_size(gl_format format, GLsizei width, GLsizei height, GLsizei depth) { const struct gl_format_info *info = _mesa_get_format_info(format); + /* Strictly speaking, a conditional isn't needed here */ if (info->BlockWidth > 1 || info->BlockHeight > 1) { /* compressed format */ const GLuint bw = info->BlockWidth, bh = info->BlockHeight; const GLuint wblocks = (width + bw - 1) / bw; const GLuint hblocks = (height + bh - 1) / bh; - const GLuint sz = wblocks * hblocks * info->BytesPerBlock; + const GLuint sz = wblocks * hblocks * info->BytesPerBlock; return sz; } else { @@ -619,6 +620,25 @@ _mesa_format_image_size(gl_format format, GLsizei width, +GLint +_mesa_format_row_stride(gl_format format, GLsizei width) +{ + const struct gl_format_info *info = _mesa_get_format_info(format); + /* Strictly speaking, a conditional isn't needed here */ + if (info->BlockWidth > 1 || info->BlockHeight > 1) { + /* compressed format */ + const GLuint bw = info->BlockWidth; + const GLuint wblocks = (width + bw - 1) / bw; + const GLint stride = wblocks * info->BytesPerBlock; + return stride; + } + else { + const GLint stride = width * info->BytesPerBlock; + return stride; + } +} + + /** * Do sanity checking of the format info table. diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index b91682809f..316ff1a8ec 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -206,6 +206,10 @@ extern GLuint _mesa_format_image_size(gl_format format, GLsizei width, GLsizei height, GLsizei depth); +extern GLint +_mesa_format_row_stride(gl_format format, GLsizei width); + + extern void _mesa_test_formats(void); -- cgit v1.2.3 From b6bdafdf2cf1110b4a5ca7cf9e1c3dcb124b800f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 1 Oct 2009 16:29:44 -0600 Subject: mesa: remove gl_texture_image::IsCompressed field Use _mesa_is_format_compressed() instead. --- src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 6 +- src/mesa/drivers/dri/intel/intel_tex_image.c | 7 +- src/mesa/drivers/dri/intel/intel_tex_subimage.c | 2 +- src/mesa/drivers/dri/intel/intel_tex_validate.c | 4 +- src/mesa/drivers/dri/r200/r200_texstate.c | 2 +- src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c | 9 +- src/mesa/drivers/dri/radeon/radeon_texstate.c | 4 +- src/mesa/drivers/dri/radeon/radeon_texture.c | 4 +- src/mesa/drivers/dri/tdfx/tdfx_tex.c | 13 +- src/mesa/drivers/dri/unichrome/via_tex.c | 5 +- src/mesa/drivers/glide/fxddtex.c | 19 +-- src/mesa/main/mipmap.c | 11 +- src/mesa/main/mtypes.h | 1 - src/mesa/main/texgetimage.c | 2 +- src/mesa/main/teximage.c | 6 +- src/mesa/main/texparam.c | 4 +- src/mesa/main/texstore.c | 207 ++++++++++------------- src/mesa/state_tracker/st_cb_texture.c | 5 +- 18 files changed, 140 insertions(+), 171 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c index 6bb7481ae4..a11869e7e8 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@ -293,6 +293,8 @@ intel_miptree_match_image(struct intel_mipmap_tree *mt, struct gl_texture_image *image, GLuint face, GLuint level) { + GLboolean isCompressed = _mesa_is_format_compressed(image->TexFormat); + /* Images with borders are never pulled into mipmap trees. */ if (image->Border || @@ -302,10 +304,10 @@ intel_miptree_match_image(struct intel_mipmap_tree *mt, return GL_FALSE; if (image->InternalFormat != mt->internal_format || - image->IsCompressed != mt->compressed) + isCompressed != mt->compressed) return GL_FALSE; - if (!image->IsCompressed && + if (!isCompressed && !mt->compressed && _mesa_get_format_bytes(image->TexFormat) != mt->cpp) return GL_FALSE; diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index bbbeac8f7f..29cca45148 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -125,7 +125,7 @@ guess_and_alloc_mipmap_tree(struct intel_context *intel, } assert(!intelObj->mt); - if (intelImage->base.IsCompressed) + if (_mesa_is_format_compressed(intelImage->base.TexFormat)) comp_byte = intel_compressed_num_bytes(intelImage->base.TexFormat); texelBytes = _mesa_get_format_bytes(intelImage->base.TexFormat); @@ -339,7 +339,6 @@ intelTexImage(GLcontext * ctx, if (_mesa_is_format_compressed(texImage->TexFormat)) { texelBytes = 0; - texImage->IsCompressed = GL_TRUE; texImage->CompressedSize = ctx->Driver.CompressedTextureSize(ctx, texImage->Width, texImage->Height, texImage->Depth, @@ -405,7 +404,7 @@ intelTexImage(GLcontext * ctx, int comp_byte = 0; GLuint texelBytes = _mesa_get_format_bytes(intelImage->base.TexFormat); GLenum baseFormat = _mesa_get_format_base_format(intelImage->base.TexFormat); - if (intelImage->base.IsCompressed) { + if (_mesa_is_format_compressed(intelImage->base.TexFormat)) { comp_byte = intel_compressed_num_bytes(intelImage->base.TexFormat); } @@ -494,7 +493,7 @@ intelTexImage(GLcontext * ctx, } else { /* Allocate regular memory and store the image there temporarily. */ - if (texImage->IsCompressed) { + if (_mesa_is_format_compressed(texImage->TexFormat)) { sizeInBytes = texImage->CompressedSize; dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat, width); diff --git a/src/mesa/drivers/dri/intel/intel_tex_subimage.c b/src/mesa/drivers/dri/intel/intel_tex_subimage.c index bba1b53009..cc329dae58 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_subimage.c +++ b/src/mesa/drivers/dri/intel/intel_tex_subimage.c @@ -85,7 +85,7 @@ intelTexSubimage(GLcontext * ctx, &dstRowStride, texImage->ImageOffsets); else { - if (texImage->IsCompressed) { + if (_mesa_is_format_compressed(texImage->TexFormat)) { dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat, width); assert(dims != 3); diff --git a/src/mesa/drivers/dri/intel/intel_tex_validate.c b/src/mesa/drivers/dri/intel/intel_tex_validate.c index 0296c92523..d5b562f5e5 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_validate.c +++ b/src/mesa/drivers/dri/intel/intel_tex_validate.c @@ -165,7 +165,7 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit) intel_miptree_reference(&intelObj->mt, firstImage->mt); } - if (firstImage->base.IsCompressed) { + if (_mesa_is_format_compressed(firstImage->base.TexFormat)) { comp_byte = intel_compressed_num_bytes(firstImage->base.TexFormat); cpp = comp_byte; } @@ -190,7 +190,7 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit) intelObj->mt->height0 != firstImage->base.Height || intelObj->mt->depth0 != firstImage->base.Depth || intelObj->mt->cpp != cpp || - intelObj->mt->compressed != firstImage->base.IsCompressed)) { + intelObj->mt->compressed != _mesa_is_format_compressed(firstImage->base.TexFormat))) { intel_miptree_release(intel, &intelObj->mt); } diff --git a/src/mesa/drivers/dri/r200/r200_texstate.c b/src/mesa/drivers/dri/r200/r200_texstate.c index daca318684..1a6fa9f548 100644 --- a/src/mesa/drivers/dri/r200/r200_texstate.c +++ b/src/mesa/drivers/dri/r200/r200_texstate.c @@ -1504,7 +1504,7 @@ static void setup_hardware_state(r200ContextPtr rmesa, radeonTexObj *t) | ((firstImage->Height - 1) << R200_PP_TX_HEIGHTMASK_SHIFT)); if ( !t->image_override ) { - if (firstImage->IsCompressed) + if (_mesa_is_format_compressed(firstImage->TexFormat)) t->pp_txpitch = (firstImage->Width + 63) & ~(63); else t->pp_txpitch = ((firstImage->Width * texelBytes) + 63) & ~(63); diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c index b602bfb4b0..5429525587 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c @@ -314,16 +314,17 @@ static void calculate_first_last_level(struct gl_texture_object *tObj, GLboolean radeon_miptree_matches_image(radeon_mipmap_tree *mt, struct gl_texture_image *texImage, GLuint face, GLuint level) { + GLboolean isCompressed = _mesa_is_format_compressed(texImage->TexFormat); radeon_mipmap_level *lvl; if (face >= mt->faces || level < mt->firstLevel || level > mt->lastLevel) return GL_FALSE; if (texImage->InternalFormat != mt->internal_format || - texImage->IsCompressed != mt->compressed) + isCompressed != mt->compressed) return GL_FALSE; - if (!texImage->IsCompressed && + if (!isCompressed && !mt->compressed && _mesa_get_format_bytes(texImage->TexFormat) != mt->bpp) return GL_FALSE; @@ -354,7 +355,7 @@ GLboolean radeon_miptree_matches_texture(radeon_mipmap_tree *mt, struct gl_textu numfaces = 6; firstImage = texObj->Image[0][firstLevel]; - compressed = firstImage->IsCompressed ? firstImage->TexFormat : 0; + compressed = _mesa_is_format_compressed(firstImage->TexFormat) ? firstImage->TexFormat : 0; texelBytes = _mesa_get_format_bytes(firstImage->TexFormat); return (mt->firstLevel == firstLevel && @@ -374,7 +375,7 @@ GLboolean radeon_miptree_matches_texture(radeon_mipmap_tree *mt, struct gl_textu void radeon_try_alloc_miptree(radeonContextPtr rmesa, radeonTexObj *t, radeon_texture_image *image, GLuint face, GLuint level) { - GLuint compressed = image->base.IsCompressed ? image->base.TexFormat : 0; + GLuint compressed = _mesa_is_format_compressed(image->base.TexFormat) ? image->base.TexFormat : 0; GLuint numfaces = 1; GLuint firstLevel, lastLevel; GLuint texelBytes; diff --git a/src/mesa/drivers/dri/radeon/radeon_texstate.c b/src/mesa/drivers/dri/radeon/radeon_texstate.c index 1064602504..5d22a11859 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texstate.c +++ b/src/mesa/drivers/dri/radeon/radeon_texstate.c @@ -81,8 +81,10 @@ struct tx_table { GLuint format, filter; }; +/* XXX verify this table against MESA_FORMAT_x values */ static const struct tx_table tx_table[] = { + 0, /* MESA_FORMAT_NONE */ _ALPHA(RGBA8888), _ALPHA_REV(RGBA8888), _ALPHA(ARGB8888), @@ -1083,7 +1085,7 @@ static GLboolean setup_hardware_state(r100ContextPtr rmesa, radeonTexObj *t, int | ((firstImage->Height - 1) << RADEON_TEX_VSIZE_SHIFT)); if ( !t->image_override ) { - if (firstImage->IsCompressed) + if (_mesa_is_format_compressed(firstImage->TexFormat)) t->pp_txpitch = (firstImage->Width + 63) & ~(63); else t->pp_txpitch = ((firstImage->Width * texelBytes) + 63) & ~(63); diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 0378b3c9fc..442116a2dd 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -546,13 +546,11 @@ static void radeon_teximage( if (_mesa_is_format_compressed(texImage->TexFormat)) { texelBytes = 0; - texImage->IsCompressed = GL_TRUE; texImage->CompressedSize = ctx->Driver.CompressedTextureSize(ctx, texImage->Width, texImage->Height, texImage->Depth, texImage->TexFormat); } else { - texImage->IsCompressed = GL_FALSE; texImage->CompressedSize = 0; texelBytes = _mesa_get_format_bytes(texImage->TexFormat); @@ -590,7 +588,7 @@ static void radeon_teximage( dstRowStride = lvl->rowstride; } else { int size; - if (texImage->IsCompressed) { + if (_mesa_is_format_compressed(texImage->TexFormat)) { size = texImage->CompressedSize; } else { size = texImage->Width * texImage->Height * texImage->Depth * _mesa_get_format_bytes(texImage->TexFormat); diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tex.c b/src/mesa/drivers/dri/tdfx/tdfx_tex.c index 427d315a01..8b68137eed 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_tex.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_tex.c @@ -191,7 +191,6 @@ tdfxGenerateMipmap(GLcontext *ctx, GLenum target, texImage = _mesa_get_tex_image(ctx, texObj, target, level); texelBytes = _mesa_get_format_bytes(texImage->TexFormat); - assert(!texImage->IsCompressed); mml = TDFX_TEXIMAGE_DATA(texImage); @@ -1233,7 +1232,7 @@ adjust2DRatio (GLcontext *ctx, GLvoid *tempImage; GLuint dstImageOffsets = 0; - if (!texImage->IsCompressed) { + if (!_mesa_is_format_compressed(texImage->TexFormat)) { GLubyte *destAddr; tempImage = MALLOC(width * height * texelBytes); @@ -1366,7 +1365,7 @@ tdfxTexImage2D(GLcontext *ctx, GLenum target, GLint level, * be correct, since it would mess with "compressedSize". * Ditto for GL_RGBA[4]_S3TC, which is always mapped to DXT3. */ - if (texImage->IsCompressed) { + if (_mesa_is_format_compressed(texImage->TexFormat)) { switch (internalFormat) { case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: case GL_RGB_S3TC: @@ -1393,7 +1392,7 @@ tdfxTexImage2D(GLcontext *ctx, GLenum target, GLint level, } if (texNapalm) { texImage->InternalFormat = internalFormat = texNapalm; - texImage->IsCompressed = GL_TRUE; + _mesa_is_format_compressed(texImage->TexFormat) = GL_TRUE; } } #endif @@ -1409,7 +1408,7 @@ tdfxTexImage2D(GLcontext *ctx, GLenum target, GLint level, texImage->FetchTexelc = fxFetchFunction(mesaFormat); texelBytes = _mesa_get_format_bytes(texImage->TexFormat); - if (texImage->IsCompressed) { + if (_mesa_is_format_compressed(texImage->TexFormat)) { texImage->CompressedSize = _mesa_compressed_texture_size(ctx, mml->width, mml->height, @@ -1492,7 +1491,7 @@ tdfxTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, assert(texImage->_BaseFormat); texelBytes = _mesa_get_format_bytes(texImage->TexFormat); - if (texImage->IsCompressed) { + if (_mesa_is_format_compressed(texImage->TexFormat)) { dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat, mml->width); } else { dstRowStride = mml->width * texelBytes; @@ -1594,8 +1593,6 @@ tdfxCompressedTexImage2D (GLcontext *ctx, GLenum target, return; } - assert(texImage->IsCompressed); - ti = TDFX_TEXTURE_DATA(texObj); if (!ti) { texObj->DriverData = fxAllocTexObjData(fxMesa); diff --git a/src/mesa/drivers/dri/unichrome/via_tex.c b/src/mesa/drivers/dri/unichrome/via_tex.c index b6be06d1ee..a4cf5466fd 100644 --- a/src/mesa/drivers/dri/unichrome/via_tex.c +++ b/src/mesa/drivers/dri/unichrome/via_tex.c @@ -696,7 +696,6 @@ static void viaTexImage(GLcontext *ctx, if (texelBytes == 0) { /* compressed format */ - texImage->IsCompressed = GL_TRUE; texImage->CompressedSize = ctx->Driver.CompressedTextureSize(ctx, texImage->Width, texImage->Height, texImage->Depth, @@ -713,7 +712,7 @@ static void viaTexImage(GLcontext *ctx, viaImage->pitchLog2 = logbase2(postConvWidth * texelBytes); /* allocate memory */ - if (texImage->IsCompressed) + if (_mesa_is_format_compressed(texImage->TexFormat)) sizeInBytes = texImage->CompressedSize; else sizeInBytes = postConvWidth * postConvHeight * texelBytes; @@ -793,7 +792,7 @@ static void viaTexImage(GLcontext *ctx, GLint dstRowStride; GLboolean success; - if (texImage->IsCompressed) { + if (_mesa_is_format_compressed(texImage->TexFormat)) { dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat, width); } else { diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c index a64b6a5553..a820cb818e 100644 --- a/src/mesa/drivers/glide/fxddtex.c +++ b/src/mesa/drivers/glide/fxddtex.c @@ -1234,7 +1234,7 @@ adjust2DRatio (GLcontext *ctx, const GLint newHeight = height * mml->hScale; GLvoid *tempImage; - if (!texImage->IsCompressed) { + if (!_mesa_is_format_compressed(texImage->TexFormat)) { GLubyte *destAddr; tempImage = MALLOC(width * height * texelBytes); @@ -1353,7 +1353,7 @@ fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level, #if FX_COMPRESS_S3TC_AS_FXT1_HACK /* [koolsmoky] substitute FXT1 for DXTn and Legacy S3TC */ - if (!ctx->Mesa_DXTn && texImage->IsCompressed) { + if (!ctx->Mesa_DXTn && _mesa_is_format_compressed(texImage->TexFormat)) { switch (internalFormat) { case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: case GL_RGB_S3TC: @@ -1380,7 +1380,6 @@ fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level, } if (texNapalm) { texImage->InternalFormat = internalFormat = texNapalm; - texImage->IsCompressed = GL_TRUE; } } #endif @@ -1397,7 +1396,7 @@ fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level, /* allocate mipmap buffer */ assert(!texImage->Data); - if (texImage->IsCompressed) { + if (_mesa_is_format_compressed(texImage->TexFormat)) { texImage->CompressedSize = _mesa_compressed_texture_size(ctx, mml->width, mml->height, @@ -1451,7 +1450,7 @@ fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level, const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; const GLint maxLevels = _mesa_max_texture_levels(ctx, texObj->Target); - assert(!texImage->IsCompressed); + assert(!_mesa_is_format_compressed(texImage->TexFormat)); while (level < texObj->MaxLevel && level < maxLevels - 1) { mipWidth = width / 2; @@ -1523,7 +1522,7 @@ fxDDTexSubImage2D(GLcontext * ctx, GLenum target, GLint level, assert(texImage->_BaseFormat); texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); - if (texImage->IsCompressed) { + if (_mesa_is_format_compressed(texImage->TexFormat)) { dstRowStride = _mesa_compressed_row_stride(texImage->InternalFormat, mml->width); } else { dstRowStride = mml->width * texelBytes; @@ -1564,7 +1563,7 @@ fxDDTexSubImage2D(GLcontext * ctx, GLenum target, GLint level, const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; const GLint maxLevels = _mesa_max_texture_levels(ctx, texObj->Target); - assert(!texImage->IsCompressed); + assert(!_mesa_is_format_compressed(texImage->TexFormat)); width = texImage->Width; height = texImage->Height; @@ -1620,7 +1619,7 @@ fxDDCompressedTexImage2D (GLcontext *ctx, GLenum target, width, height); } - assert(texImage->IsCompressed); + assert(_mesa_is_format_compressed(texImage->TexFormat)); if (!fxIsTexSupported(target, internalFormat, texImage)) { _mesa_problem(NULL, "fx Driver: unsupported texture in fxDDCompressedTexImg()\n"); @@ -1712,7 +1711,7 @@ fxDDCompressedTexImage2D (GLcontext *ctx, GLenum target, /* GL_SGIS_generate_mipmap */ if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - assert(!texImage->IsCompressed); + assert(!_mesa_is_format_compressed(texImage->TexFormat)); } fxTexInvalidate(ctx, texObj); @@ -1777,7 +1776,7 @@ fxDDCompressedTexSubImage2D( GLcontext *ctx, GLenum target, /* GL_SGIS_generate_mipmap */ if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - assert(!texImage->IsCompressed); + assert(!_mesa_is_format_compressed(texImage->TexFormat)); } if (ti->validated && ti->isInTM) diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index ccd153303d..f6d6ce33c8 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -1511,7 +1511,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, ASSERT(maxLevels > 0); /* bad target */ /* Find convertFormat - the format that do_row() will process */ - if (srcImage->IsCompressed) { + if (_mesa_is_format_compressed(srcImage->TexFormat)) { /* setup for compressed textures */ GLuint row; GLint components, size; @@ -1589,7 +1589,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, &dstWidth, &dstHeight, &dstDepth); if (!nextLevel) { /* all done */ - if (srcImage->IsCompressed) { + if (_mesa_is_format_compressed(srcImage->TexFormat)) { _mesa_free((void *) srcData); _mesa_free(dstData); } @@ -1614,8 +1614,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, dstImage->TexFormat = srcImage->TexFormat; dstImage->FetchTexelc = srcImage->FetchTexelc; dstImage->FetchTexelf = srcImage->FetchTexelf; - dstImage->IsCompressed = srcImage->IsCompressed; - if (dstImage->IsCompressed) { + if (_mesa_is_format_compressed(dstImage->TexFormat)) { dstImage->CompressedSize = ctx->Driver.CompressedTextureSize(ctx, dstImage->Width, dstImage->Height, @@ -1631,7 +1630,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, /* Alloc new teximage data buffer. * Setup src and dest data pointers. */ - if (dstImage->IsCompressed) { + if (_mesa_is_format_compressed(dstImage->TexFormat)) { dstImage->Data = _mesa_alloc_texmemory(dstImage->CompressedSize); if (!dstImage->Data) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps"); @@ -1661,7 +1660,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, dstData, dstImage->RowStride); - if (dstImage->IsCompressed) { + if (_mesa_is_format_compressed(dstImage->TexFormat)) { GLubyte *temp; /* compress image from dstData into dstImage->Data */ const GLenum srcFormat = _mesa_get_format_base_format(convertFormat); diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 1599a6f13f..f084edb840 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1173,7 +1173,6 @@ struct gl_texture_image FetchTexelFuncC FetchTexelc; /**< GLchan texel fetch function pointer */ FetchTexelFuncF FetchTexelf; /**< Float texel fetch function pointer */ - GLboolean IsCompressed; /**< GL_ARB_texture_compression */ GLuint CompressedSize; /**< GL_ARB_texture_compression */ GLuint RowStride; /**< Padded width in units of texels */ diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index e9e408d8c5..3e3951b1c4 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -567,7 +567,7 @@ _mesa_GetCompressedTexImageARB(GLenum target, GLint level, GLvoid *img) { texImage = _mesa_select_tex_image(ctx, texObj, target, level); if (texImage) { - if (texImage->IsCompressed) { + if (_mesa_is_format_compressed(texImage->TexFormat)) { /* this typically calls _mesa_get_compressed_teximage() */ ctx->Driver.GetCompressedTexImage(ctx, target, level, img, texObj, texImage); diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index c4e5ce2682..86f46b9551 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -903,7 +903,6 @@ clear_teximage_fields(struct gl_texture_image *img) img->TexFormat = MESA_FORMAT_NONE; img->FetchTexelc = NULL; img->FetchTexelf = NULL; - img->IsCompressed = 0; img->CompressedSize = 0; } @@ -967,7 +966,6 @@ _mesa_init_teximage_fields(GLcontext *ctx, GLenum target, img->MaxLog2 = MAX2(img->WidthLog2, img->HeightLog2); - img->IsCompressed = GL_FALSE; img->CompressedSize = 0; if ((width == 1 || _mesa_is_pow_two(img->Width2)) && @@ -1589,7 +1587,7 @@ subtexture_error_check2( GLcontext *ctx, GLuint dimensions, } #endif - if (destTex->IsCompressed) { + if (_mesa_is_format_compressed(destTex->TexFormat)) { if (!target_can_be_compressed(ctx, target)) { _mesa_error(ctx, GL_INVALID_ENUM, "glTexSubImage%D(target)", dimensions); @@ -1951,7 +1949,7 @@ copytexsubimage_error_check2( GLcontext *ctx, GLuint dimensions, } } - if (teximage->IsCompressed) { + if (_mesa_is_format_compressed(teximage->TexFormat)) { if (!target_can_be_compressed(ctx, target)) { _mesa_error(ctx, GL_INVALID_ENUM, "glCopyTexSubImage%d(target)", dimensions); diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index a9df1dac15..a6b611dffb 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -852,7 +852,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, /* GL_ARB_texture_compression */ case GL_TEXTURE_COMPRESSED_IMAGE_SIZE: - if (img->IsCompressed && !isProxy) { + if (_mesa_is_format_compressed(img->TexFormat) && !isProxy) { /* Don't use ctx->Driver.CompressedTextureSize() since that * may returned a padded hardware size. */ @@ -866,7 +866,7 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, } break; case GL_TEXTURE_COMPRESSED: - *params = (GLint) img->IsCompressed; + *params = (GLint) _mesa_is_format_compressed(img->TexFormat); break; /* GL_ARB_texture_float */ diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 48bee88e0f..3e87e47cb1 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -3244,10 +3244,7 @@ _mesa_set_fetch_functions(struct gl_texture_image *texImage, GLuint dims) static void compute_texture_size(GLcontext *ctx, struct gl_texture_image *texImage) { - texImage->IsCompressed = - _mesa_is_format_compressed(texImage->TexFormat); - - if (texImage->IsCompressed) { + if (_mesa_is_format_compressed(texImage->TexFormat)) { texImage->CompressedSize = ctx->Driver.CompressedTextureSize(ctx, texImage->Width, texImage->Height, texImage->Depth, @@ -3260,6 +3257,41 @@ compute_texture_size(GLcontext *ctx, struct gl_texture_image *texImage) } +/** Return texture size in bytes */ +static GLuint +texture_size(const struct gl_texture_image *texImage) +{ + GLuint sz; + + if (_mesa_is_format_compressed(texImage->TexFormat)) + sz = texImage->CompressedSize; + else + sz = texImage->Width * texImage->Height * texImage->Depth * + _mesa_get_format_bytes(texImage->TexFormat); + + return sz; +} + + +/** Return row stride in bytes */ +static GLuint +texture_row_stride(const struct gl_texture_image *texImage) +{ + GLuint stride; + + if (_mesa_is_format_compressed(texImage->TexFormat)) { + stride = _mesa_compressed_row_stride(texImage->TexFormat, + texImage->Width); + } + else { + GLuint texelBytes = _mesa_get_format_bytes(texImage->TexFormat); + stride = texImage->RowStride * texelBytes; + } + + return stride; +} + + /** * This is the software fallback for Driver.TexImage1D() @@ -3289,10 +3321,8 @@ _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level, compute_texture_size(ctx, texImage); /* allocate memory */ - if (texImage->IsCompressed) - sizeInBytes = texImage->CompressedSize; - else - sizeInBytes = texImage->Width * _mesa_get_format_bytes(texImage->TexFormat); + sizeInBytes = texture_size(texImage); + texImage->Data = _mesa_alloc_texmemory(sizeInBytes); if (!texImage->Data) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D"); @@ -3309,16 +3339,14 @@ _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level, } else { const GLint dstRowStride = 0; - GLboolean success; - - success = _mesa_texstore(ctx, 1, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, - texImage->ImageOffsets, - width, 1, 1, - format, type, pixels, packing); + GLboolean success = _mesa_texstore(ctx, 1, texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + 0, 0, 0, /* dstX/Y/Zoffset */ + dstRowStride, + texImage->ImageOffsets, + width, 1, 1, + format, type, pixels, packing); if (!success) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D"); } @@ -3360,10 +3388,7 @@ _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level, texelBytes = _mesa_get_format_bytes(texImage->TexFormat); /* allocate memory */ - if (texImage->IsCompressed) - sizeInBytes = texImage->CompressedSize; - else - sizeInBytes = texImage->Width * texImage->Height * texelBytes; + sizeInBytes = texture_size(texImage); texImage->Data = _mesa_alloc_texmemory(sizeInBytes); if (!texImage->Data) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); @@ -3379,26 +3404,15 @@ _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level, return; } else { - GLint dstRowStride; - GLboolean success; - - if (texImage->IsCompressed) { - dstRowStride - = _mesa_compressed_row_stride(texImage->TexFormat, width); - } - else { - dstRowStride = texImage->RowStride * texelBytes; - } - - success = _mesa_texstore(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, - texImage->ImageOffsets, - width, height, 1, - format, type, pixels, packing); - + GLint dstRowStride = texture_row_stride(texImage); + GLboolean success = _mesa_texstore(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + 0, 0, 0, /* dstX/Y/Zoffset */ + dstRowStride, + texImage->ImageOffsets, + width, height, 1, + format, type, pixels, packing); if (!success) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage2D"); } @@ -3436,10 +3450,7 @@ _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level, texelBytes = _mesa_get_format_bytes(texImage->TexFormat); /* allocate memory */ - if (texImage->IsCompressed) - sizeInBytes = texImage->CompressedSize; - else - sizeInBytes = width * height * depth * texelBytes; + sizeInBytes = texture_size(texImage); texImage->Data = _mesa_alloc_texmemory(sizeInBytes); if (!texImage->Data) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage3D"); @@ -3455,25 +3466,15 @@ _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level, return; } else { - GLint dstRowStride; - GLboolean success; - - if (texImage->IsCompressed) { - dstRowStride - = _mesa_compressed_row_stride(texImage->TexFormat, width); - } - else { - dstRowStride = texImage->RowStride * texelBytes; - } - - success = _mesa_texstore(ctx, 3, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, - texImage->ImageOffsets, - width, height, depth, - format, type, pixels, packing); + GLint dstRowStride = texture_row_stride(texImage); + GLboolean success = _mesa_texstore(ctx, 3, texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + 0, 0, 0, /* dstX/Y/Zoffset */ + dstRowStride, + texImage->ImageOffsets, + width, height, depth, + format, type, pixels, packing); if (!success) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage3D"); } @@ -3505,16 +3506,14 @@ _mesa_store_texsubimage1d(GLcontext *ctx, GLenum target, GLint level, { const GLint dstRowStride = 0; - GLboolean success; - - success = _mesa_texstore(ctx, 1, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - xoffset, 0, 0, /* offsets */ - dstRowStride, - texImage->ImageOffsets, - width, 1, 1, - format, type, pixels, packing); + GLboolean success = _mesa_texstore(ctx, 1, texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + xoffset, 0, 0, /* offsets */ + dstRowStride, + texImage->ImageOffsets, + width, 1, 1, + format, type, pixels, packing); if (!success) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage1D"); } @@ -3545,26 +3544,15 @@ _mesa_store_texsubimage2d(GLcontext *ctx, GLenum target, GLint level, return; { - GLint dstRowStride = 0; - GLboolean success; - - if (texImage->IsCompressed) { - dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat, - texImage->Width); - } - else { - dstRowStride = texImage->RowStride * - _mesa_get_format_bytes(texImage->TexFormat); - } - - success = _mesa_texstore(ctx, 2, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - xoffset, yoffset, 0, - dstRowStride, - texImage->ImageOffsets, - width, height, 1, - format, type, pixels, packing); + GLint dstRowStride = texture_row_stride(texImage); + GLboolean success = _mesa_texstore(ctx, 2, texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + xoffset, yoffset, 0, + dstRowStride, + texImage->ImageOffsets, + width, height, 1, + format, type, pixels, packing); if (!success) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage2D"); } @@ -3595,26 +3583,15 @@ _mesa_store_texsubimage3d(GLcontext *ctx, GLenum target, GLint level, return; { - GLint dstRowStride; - GLboolean success; - - if (texImage->IsCompressed) { - dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat, - texImage->Width); - } - else { - dstRowStride = texImage->RowStride * - _mesa_get_format_bytes(texImage->TexFormat); - } - - success = _mesa_texstore(ctx, 3, texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, - xoffset, yoffset, zoffset, - dstRowStride, - texImage->ImageOffsets, - width, height, depth, - format, type, pixels, packing); + GLint dstRowStride = texture_row_stride(texImage); + GLboolean success = _mesa_texstore(ctx, 3, texImage->_BaseFormat, + texImage->TexFormat, + texImage->Data, + xoffset, yoffset, zoffset, + dstRowStride, + texImage->ImageOffsets, + width, height, depth, + format, type, pixels, packing); if (!success) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage3D"); } diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 716fbc8b29..b457a8dc6e 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -562,7 +562,6 @@ st_TexImage(GLcontext * ctx, if (_mesa_is_format_compressed(texImage->TexFormat)) { /* must be a compressed format */ texelBytes = 0; - texImage->IsCompressed = GL_TRUE; texImage->CompressedSize = ctx->Driver.CompressedTextureSize(ctx, texImage->Width, texImage->Height, texImage->Depth, @@ -696,7 +695,7 @@ st_TexImage(GLcontext * ctx, } else { /* Allocate regular memory and store the image there temporarily. */ - if (texImage->IsCompressed) { + if (_mesa_is_format_compressed(texImage->TexFormat)) { sizeInBytes = texImage->CompressedSize; dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat, width); @@ -1823,7 +1822,7 @@ st_finalize_texture(GLcontext *ctx, } /* FIXME: determine format block instead of cpp */ - if (firstImage->base.IsCompressed) { + if (_mesa_is_format_compressed(firstImage->base.TexFormat)) { cpp = compressed_num_bytes(firstImage->base.TexFormat); } else { -- cgit v1.2.3 From 354d66e2f58bb19efcd9a0f8b2398d3f1dc4248d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 1 Oct 2009 16:30:47 -0600 Subject: mesa: simplify _mesa_compressed_texture_size() --- src/mesa/main/texcompress.c | 69 ++++++--------------------------------------- 1 file changed, 9 insertions(+), 60 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c index c1b8c7675a..a2b1218d0c 100644 --- a/src/mesa/main/texcompress.c +++ b/src/mesa/main/texcompress.c @@ -34,6 +34,7 @@ #include "imports.h" #include "colormac.h" #include "context.h" +#include "formats.h" #include "image.h" #include "mipmap.h" #include "texcompress.h" @@ -116,9 +117,10 @@ _mesa_get_compressed_formats(GLcontext *ctx, GLint *formats, GLboolean all) /** * Return number of bytes needed to store a texture of the given size - * using the specified compressed format. + * using the specified (compressed?) format. * This is called via the ctx->Driver.CompressedTextureSize function, - * unless a device driver overrides it. + * unless a device driver overrides it. A driver might override this + * if it needs to use an unusual or padded texture memory layout. * * \param width texture width in texels. * \param height texture height in texels. @@ -132,62 +134,7 @@ _mesa_compressed_texture_size( GLcontext *ctx, GLsizei width, GLsizei height, GLsizei depth, GLuint mesaFormat ) { - GLuint size; - - ASSERT(depth == 1); - (void) depth; - (void) size; - - switch (mesaFormat) { -#if FEATURE_texture_fxt1 - case MESA_FORMAT_RGB_FXT1: - case MESA_FORMAT_RGBA_FXT1: - /* round up width to next multiple of 8, height to next multiple of 4 */ - width = (width + 7) & ~7; - height = (height + 3) & ~3; - /* 16 bytes per 8x4 tile of RGB[A] texels */ - size = width * height / 2; - /* Textures smaller than 8x4 will effectively be made into 8x4 and - * take 16 bytes. - */ - return size; -#endif -#if FEATURE_texture_s3tc - case MESA_FORMAT_RGB_DXT1: - case MESA_FORMAT_RGBA_DXT1: -#if FEATURE_EXT_texture_sRGB - case MESA_FORMAT_SRGB_DXT1: - case MESA_FORMAT_SRGBA_DXT1: -#endif - /* round up width, height to next multiple of 4 */ - width = (width + 3) & ~3; - height = (height + 3) & ~3; - /* 8 bytes per 4x4 tile of RGB[A] texels */ - size = width * height / 2; - /* Textures smaller than 4x4 will effectively be made into 4x4 and - * take 8 bytes. - */ - return size; - case MESA_FORMAT_RGBA_DXT3: - case MESA_FORMAT_RGBA_DXT5: -#if FEATURE_EXT_texture_sRGB - case MESA_FORMAT_SRGBA_DXT3: - case MESA_FORMAT_SRGBA_DXT5: -#endif - /* round up width, height to next multiple of 4 */ - width = (width + 3) & ~3; - height = (height + 3) & ~3; - /* 16 bytes per 4x4 tile of RGBA texels */ - size = width * height; /* simple! */ - /* Textures smaller than 4x4 will effectively be made into 4x4 and - * take 16 bytes. - */ - return size; -#endif - default: - _mesa_problem(ctx, "bad mesaFormat in _mesa_compressed_texture_size"); - return 0; - } + return _mesa_format_image_size(mesaFormat, width, height, depth); } @@ -205,7 +152,7 @@ _mesa_compressed_texture_size_glenum(GLcontext *ctx, GLsizei width, GLsizei height, GLsizei depth, GLenum glformat) { - GLuint mesaFormat; + gl_format mesaFormat; switch (glformat) { #if FEATURE_texture_fxt1 @@ -252,7 +199,7 @@ _mesa_compressed_texture_size_glenum(GLcontext *ctx, return 0; } - return _mesa_compressed_texture_size(ctx, width, height, depth, mesaFormat); + return _mesa_format_image_size(mesaFormat, width, height, depth); } @@ -298,6 +245,8 @@ _mesa_compressed_row_stride(GLuint mesaFormat, GLsizei width) return 0; } + assert(stride == _mesa_format_row_stride(mesaFormat, width)); + return stride; } -- cgit v1.2.3 From 4208a8c02615841702619eb5891c0a61f96a5a00 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 1 Oct 2009 16:41:24 -0600 Subject: savage: s/Xfree/_mesa_free/ --- src/mesa/drivers/dri/savage/savage_xmesa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c index 931ceff0a8..06179edae3 100644 --- a/src/mesa/drivers/dri/savage/savage_xmesa.c +++ b/src/mesa/drivers/dri/savage/savage_xmesa.c @@ -436,7 +436,7 @@ savageCreateContext( const __GLcontextModes *mesaVis, if (ctx->Const.MaxTextureLevels <= 6) { /*spec requires at least 64x64*/ __driUtilMessage("Not enough texture memory. " "Falling back to indirect rendering."); - Xfree(imesa); + _mesa_free(imesa); return GL_FALSE; } -- cgit v1.2.3 From 073d55f5849c6338a6381e8bc51c074524b5687b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 1 Oct 2009 16:41:47 -0600 Subject: radeon: fix tx_table[] entry XXX need to still verify that the table entries are in correct order. --- src/mesa/drivers/dri/radeon/radeon_texstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_texstate.c b/src/mesa/drivers/dri/radeon/radeon_texstate.c index 5d22a11859..cb17f48bf3 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texstate.c +++ b/src/mesa/drivers/dri/radeon/radeon_texstate.c @@ -84,7 +84,7 @@ struct tx_table { /* XXX verify this table against MESA_FORMAT_x values */ static const struct tx_table tx_table[] = { - 0, /* MESA_FORMAT_NONE */ + _INVALID(NONE), /* MESA_FORMAT_NONE */ _ALPHA(RGBA8888), _ALPHA_REV(RGBA8888), _ALPHA(ARGB8888), -- cgit v1.2.3 From 4ca9ba254462b9be55b78df1d50519e10b2f4d73 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 1 Oct 2009 16:42:37 -0600 Subject: mesa: move mesa_set_fetch_functions() --- src/mesa/drivers/dri/intel/intel_tex_image.c | 1 + src/mesa/drivers/dri/radeon/radeon_texture.c | 1 + src/mesa/drivers/dri/unichrome/via_tex.c | 1 + src/mesa/main/texfetch.c | 81 ++++++++++++++++++++++++++++ src/mesa/main/texfetch.h | 2 + src/mesa/main/texstore.c | 81 ---------------------------- src/mesa/main/texstore.h | 4 -- src/mesa/state_tracker/st_cb_texture.c | 1 + src/mesa/state_tracker/st_texture.c | 3 +- 9 files changed, 89 insertions(+), 86 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index 29cca45148..9e13ba6871 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -7,6 +7,7 @@ #include "main/convolve.h" #include "main/context.h" #include "main/texcompress.h" +#include "main/texfetch.h" #include "main/texformat.h" #include "main/texstore.h" #include "main/texgetimage.h" diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 442116a2dd..ce393ffeb6 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -34,6 +34,7 @@ #include "main/convolve.h" #include "main/mipmap.h" #include "main/texcompress.h" +#include "main/texfetch.h" #include "main/texformat.h" #include "main/texstore.h" #include "main/teximage.h" diff --git a/src/mesa/drivers/dri/unichrome/via_tex.c b/src/mesa/drivers/dri/unichrome/via_tex.c index a4cf5466fd..13458aba1c 100644 --- a/src/mesa/drivers/dri/unichrome/via_tex.c +++ b/src/mesa/drivers/dri/unichrome/via_tex.c @@ -37,6 +37,7 @@ #include "main/mipmap.h" #include "main/simple_list.h" #include "main/texcompress.h" +#include "main/texfetch.h" #include "main/texformat.h" #include "main/texobj.h" #include "main/texstore.h" diff --git a/src/mesa/main/texfetch.c b/src/mesa/main/texfetch.c index 62a8b53409..3428f705be 100644 --- a/src/mesa/main/texfetch.c +++ b/src/mesa/main/texfetch.c @@ -565,3 +565,84 @@ _mesa_get_texel_store_func(gl_format format) } return NULL; } + + + +/** + * Adaptor for fetching a GLchan texel from a float-valued texture. + */ +static void +fetch_texel_float_to_chan(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLchan *texelOut) +{ + GLfloat temp[4]; + GLenum baseFormat = _mesa_get_format_base_format(texImage->TexFormat); + + ASSERT(texImage->FetchTexelf); + texImage->FetchTexelf(texImage, i, j, k, temp); + if (baseFormat == GL_DEPTH_COMPONENT || + baseFormat == GL_DEPTH_STENCIL_EXT) { + /* just one channel */ + UNCLAMPED_FLOAT_TO_CHAN(texelOut[0], temp[0]); + } + else { + /* four channels */ + UNCLAMPED_FLOAT_TO_CHAN(texelOut[0], temp[0]); + UNCLAMPED_FLOAT_TO_CHAN(texelOut[1], temp[1]); + UNCLAMPED_FLOAT_TO_CHAN(texelOut[2], temp[2]); + UNCLAMPED_FLOAT_TO_CHAN(texelOut[3], temp[3]); + } +} + + +/** + * Adaptor for fetching a float texel from a GLchan-valued texture. + */ +static void +fetch_texel_chan_to_float(const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texelOut) +{ + GLchan temp[4]; + GLenum baseFormat = _mesa_get_format_base_format(texImage->TexFormat); + + ASSERT(texImage->FetchTexelc); + texImage->FetchTexelc(texImage, i, j, k, temp); + if (baseFormat == GL_DEPTH_COMPONENT || + baseFormat == GL_DEPTH_STENCIL_EXT) { + /* just one channel */ + texelOut[0] = CHAN_TO_FLOAT(temp[0]); + } + else { + /* four channels */ + texelOut[0] = CHAN_TO_FLOAT(temp[0]); + texelOut[1] = CHAN_TO_FLOAT(temp[1]); + texelOut[2] = CHAN_TO_FLOAT(temp[2]); + texelOut[3] = CHAN_TO_FLOAT(temp[3]); + } +} + + +/** + * Initialize the texture image's FetchTexelc and FetchTexelf methods. + */ +void +_mesa_set_fetch_functions(struct gl_texture_image *texImage, GLuint dims) +{ + ASSERT(dims == 1 || dims == 2 || dims == 3); + ASSERT(texImage->TexFormat); + + texImage->FetchTexelf = + _mesa_get_texel_fetch_func(texImage->TexFormat, dims); + + /* now check if we need to use a float/chan adaptor */ + if (!texImage->FetchTexelc) { + texImage->FetchTexelc = fetch_texel_float_to_chan; + } + else if (!texImage->FetchTexelf) { + texImage->FetchTexelf = fetch_texel_chan_to_float; + } + + + ASSERT(texImage->FetchTexelc); + ASSERT(texImage->FetchTexelf); +} diff --git a/src/mesa/main/texfetch.h b/src/mesa/main/texfetch.h index a397b04600..a9be530a06 100644 --- a/src/mesa/main/texfetch.h +++ b/src/mesa/main/texfetch.h @@ -37,5 +37,7 @@ _mesa_get_texel_fetch_func(gl_format format, GLuint dims); extern StoreTexelFunc _mesa_get_texel_store_func(gl_format format); +extern void +_mesa_set_fetch_functions(struct gl_texture_image *texImage, GLuint dims); #endif diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 3e87e47cb1..07421b6657 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -3160,87 +3160,6 @@ _mesa_unmap_teximage_pbo(GLcontext *ctx, } - -/** - * Adaptor for fetching a GLchan texel from a float-valued texture. - */ -static void -fetch_texel_float_to_chan(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texelOut) -{ - GLfloat temp[4]; - GLenum baseFormat = _mesa_get_format_base_format(texImage->TexFormat); - - ASSERT(texImage->FetchTexelf); - texImage->FetchTexelf(texImage, i, j, k, temp); - if (baseFormat == GL_DEPTH_COMPONENT || - baseFormat == GL_DEPTH_STENCIL_EXT) { - /* just one channel */ - UNCLAMPED_FLOAT_TO_CHAN(texelOut[0], temp[0]); - } - else { - /* four channels */ - UNCLAMPED_FLOAT_TO_CHAN(texelOut[0], temp[0]); - UNCLAMPED_FLOAT_TO_CHAN(texelOut[1], temp[1]); - UNCLAMPED_FLOAT_TO_CHAN(texelOut[2], temp[2]); - UNCLAMPED_FLOAT_TO_CHAN(texelOut[3], temp[3]); - } -} - - -/** - * Adaptor for fetching a float texel from a GLchan-valued texture. - */ -static void -fetch_texel_chan_to_float(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texelOut) -{ - GLchan temp[4]; - GLenum baseFormat = _mesa_get_format_base_format(texImage->TexFormat); - - ASSERT(texImage->FetchTexelc); - texImage->FetchTexelc(texImage, i, j, k, temp); - if (baseFormat == GL_DEPTH_COMPONENT || - baseFormat == GL_DEPTH_STENCIL_EXT) { - /* just one channel */ - texelOut[0] = CHAN_TO_FLOAT(temp[0]); - } - else { - /* four channels */ - texelOut[0] = CHAN_TO_FLOAT(temp[0]); - texelOut[1] = CHAN_TO_FLOAT(temp[1]); - texelOut[2] = CHAN_TO_FLOAT(temp[2]); - texelOut[3] = CHAN_TO_FLOAT(temp[3]); - } -} - - -/** - * Initialize the texture image's FetchTexelc and FetchTexelf methods. - */ -void -_mesa_set_fetch_functions(struct gl_texture_image *texImage, GLuint dims) -{ - ASSERT(dims == 1 || dims == 2 || dims == 3); - ASSERT(texImage->TexFormat); - - texImage->FetchTexelf = - _mesa_get_texel_fetch_func(texImage->TexFormat, dims); - - /* now check if we need to use a float/chan adaptor */ - if (!texImage->FetchTexelc) { - texImage->FetchTexelc = fetch_texel_float_to_chan; - } - else if (!texImage->FetchTexelf) { - texImage->FetchTexelf = fetch_texel_chan_to_float; - } - - - ASSERT(texImage->FetchTexelc); - ASSERT(texImage->FetchTexelf); -} - - static void compute_texture_size(GLcontext *ctx, struct gl_texture_image *texImage) { diff --git a/src/mesa/main/texstore.h b/src/mesa/main/texstore.h index 2db076dfff..3211086dd6 100644 --- a/src/mesa/main/texstore.h +++ b/src/mesa/main/texstore.h @@ -82,10 +82,6 @@ _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims, const struct gl_pixelstore_attrib *srcPacking); -extern void -_mesa_set_fetch_functions(struct gl_texture_image *texImage, GLuint dims); - - extern void _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level, GLint internalFormat, diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index b457a8dc6e..2574eeb996 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -37,6 +37,7 @@ #include "main/mipmap.h" #include "main/pixel.h" #include "main/texcompress.h" +#include "main/texfetch.h" #include "main/texformat.h" #include "main/texgetimage.h" #include "main/teximage.h" diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c index 1790e1b28d..4a883f9f0a 100644 --- a/src/mesa/state_tracker/st_texture.c +++ b/src/mesa/state_tracker/st_texture.c @@ -32,8 +32,9 @@ #include "st_cb_fbo.h" #include "st_inlines.h" #include "main/enums.h" -#include "main/texobj.h" +#include "main/texfetch.h" #include "main/teximage.h" +#include "main/texobj.h" #include "main/texstore.h" #undef Elements /* fix re-defined macro warning */ -- cgit v1.2.3 From 8c92a531fb7e0d2de2a06610b2dff98eeb19c985 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 1 Oct 2009 19:01:02 -0600 Subject: mesa: reformatting --- src/mesa/main/texgetimage.c | 12 ++++++------ src/mesa/main/texstore.c | 43 +++++++++++++++++++++---------------------- 2 files changed, 27 insertions(+), 28 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index 3e3951b1c4..341ce6103f 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -322,10 +322,15 @@ _mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level, { GLuint size; + /* don't use texImage->CompressedSize since that may be padded out */ + size = _mesa_compressed_texture_size(ctx, texImage->Width, texImage->Height, + texImage->Depth, + texImage->TexFormat); + if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { /* pack texture image into a PBO */ GLubyte *buf; - if ((const GLubyte *) img + texImage->CompressedSize > + if ((const GLubyte *) img + size > (const GLubyte *) ctx->Pack.BufferObj->Size) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGetCompressedTexImage(invalid PBO access)"); @@ -347,11 +352,6 @@ _mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level, return; } - /* don't use texImage->CompressedSize since that may be padded out */ - size = _mesa_compressed_texture_size(ctx, texImage->Width, texImage->Height, - texImage->Depth, - texImage->TexFormat); - /* just memcpy, no pixelstore or pixel transfer */ _mesa_memcpy(img, texImage->Data, size); diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 07421b6657..0fa8c44817 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -440,8 +440,8 @@ make_temp_float_image(GLcontext *ctx, GLuint dims, else { /* no convolution */ const GLint components = _mesa_components_in_format(logicalBaseFormat); - const GLint srcStride = _mesa_image_row_stride(srcPacking, - srcWidth, srcFormat, srcType); + const GLint srcStride = + _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType); GLfloat *dst; GLint img, row; @@ -601,14 +601,13 @@ _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims, dst = tempImage; for (img = 0; img < srcDepth; img++) { - const GLint srcStride = _mesa_image_row_stride(srcPacking, - srcWidth, srcFormat, - srcType); - const GLubyte *src - = (const GLubyte *) _mesa_image_address(dims, srcPacking, srcAddr, - srcWidth, srcHeight, - srcFormat, srcType, - img, 0, 0); + const GLint srcStride = + _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType); + const GLubyte *src = + (const GLubyte *) _mesa_image_address(dims, srcPacking, srcAddr, + srcWidth, srcHeight, + srcFormat, srcType, + img, 0, 0); for (row = 0; row < srcHeight; row++) { _mesa_unpack_color_span_chan(ctx, srcWidth, logicalBaseFormat, dst, srcFormat, srcType, src, srcPacking, @@ -1136,8 +1135,8 @@ _mesa_texstore_rgb565(TEXSTORE_PARAMS) srcType == GL_UNSIGNED_BYTE && dims == 2) { /* do optimized tex store */ - const GLint srcRowStride = _mesa_image_row_stride(srcPacking, srcWidth, - srcFormat, srcType); + const GLint srcRowStride = + _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType); const GLubyte *src = (const GLubyte *) _mesa_image_address(dims, srcPacking, srcAddr, srcWidth, srcHeight, srcFormat, srcType, 0, 0, 0); @@ -1389,8 +1388,8 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) srcType == GL_UNSIGNED_BYTE) { int img, row, col; for (img = 0; img < srcDepth; img++) { - const GLint srcRowStride = _mesa_image_row_stride(srcPacking, - srcWidth, srcFormat, srcType); + const GLint srcRowStride = + _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType); GLubyte *srcRow = (GLubyte *) _mesa_image_address(dims, srcPacking, srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, 0, 0); GLubyte *dstRow = (GLubyte *) dstAddr @@ -1425,8 +1424,8 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) * Strangely the same isn't required for the RGB path, above. */ for (img = 0; img < srcDepth; img++) { - const GLint srcRowStride = _mesa_image_row_stride(srcPacking, - srcWidth, srcFormat, srcType); + const GLint srcRowStride = + _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType); GLubyte *srcRow = (GLubyte *) _mesa_image_address(dims, srcPacking, srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, 0, 0); GLubyte *dstRow = (GLubyte *) dstAddr @@ -1563,8 +1562,8 @@ _mesa_texstore_rgb888(TEXSTORE_PARAMS) /* extract RGB from RGBA */ GLint img, row, col; for (img = 0; img < srcDepth; img++) { - const GLint srcRowStride = _mesa_image_row_stride(srcPacking, - srcWidth, srcFormat, srcType); + const GLint srcRowStride = + _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType); GLubyte *srcRow = (GLubyte *) _mesa_image_address(dims, srcPacking, srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, 0, 0); GLubyte *dstRow = (GLubyte *) dstAddr @@ -1690,8 +1689,8 @@ _mesa_texstore_bgr888(TEXSTORE_PARAMS) /* extract BGR from RGBA */ int img, row, col; for (img = 0; img < srcDepth; img++) { - const GLint srcRowStride = _mesa_image_row_stride(srcPacking, - srcWidth, srcFormat, srcType); + const GLint srcRowStride = + _mesa_image_row_stride(srcPacking, srcWidth, srcFormat, srcType); GLubyte *srcRow = (GLubyte *) _mesa_image_address(dims, srcPacking, srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, 0, 0); GLubyte *dstRow = (GLubyte *) dstAddr @@ -2358,8 +2357,8 @@ _mesa_texstore_dudv8(TEXSTORE_PARAMS) else { /* general path - note this is defined for 2d textures only */ const GLint components = _mesa_components_in_format(baseInternalFormat); - const GLint srcStride = _mesa_image_row_stride(srcPacking, - srcWidth, srcFormat, srcType); + const GLint srcStride = _mesa_image_row_stride(srcPacking, srcWidth, + srcFormat, srcType); GLbyte *tempImage, *dst, *src; GLint row; -- cgit v1.2.3 From 32aa40eee46fd0b15f3873069f2440ea2dd75408 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 1 Oct 2009 21:13:25 -0600 Subject: mesa: removed gl_texture_image::CompressedSize field Just call ctx->Driver.CompressedTextureSize() when we need to get the compressed image size. --- src/mesa/drivers/dri/intel/intel_tex_image.c | 13 +++++---- src/mesa/drivers/dri/radeon/radeon_texture.c | 13 ++++----- src/mesa/drivers/dri/tdfx/tdfx_tex.c | 29 +++++++++---------- src/mesa/drivers/dri/unichrome/via_tex.c | 5 ++-- src/mesa/main/dd.h | 2 +- src/mesa/main/mipmap.c | 23 ++++++++------- src/mesa/main/mtypes.h | 2 -- src/mesa/main/teximage.c | 3 -- src/mesa/main/texstore.c | 42 ++++------------------------ src/mesa/state_tracker/st_cb_texture.c | 10 +++---- 10 files changed, 53 insertions(+), 89 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index 9e13ba6871..dd436becab 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -340,11 +340,8 @@ intelTexImage(GLcontext * ctx, if (_mesa_is_format_compressed(texImage->TexFormat)) { texelBytes = 0; - texImage->CompressedSize = - ctx->Driver.CompressedTextureSize(ctx, texImage->Width, - texImage->Height, texImage->Depth, - texImage->TexFormat); - } else { + } + else { texelBytes = _mesa_get_format_bytes(texImage->TexFormat); /* Minimum pitch of 32 bytes */ @@ -495,7 +492,11 @@ intelTexImage(GLcontext * ctx, else { /* Allocate regular memory and store the image there temporarily. */ if (_mesa_is_format_compressed(texImage->TexFormat)) { - sizeInBytes = texImage->CompressedSize; + sizeInBytes = ctx->Driver.CompressedTextureSize(ctx, + texImage->Width, + texImage->Height, + texImage->Depth, + texImage->TexFormat); dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat, width); assert(dims != 3); diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index ce393ffeb6..2c28011057 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -547,13 +547,7 @@ static void radeon_teximage( if (_mesa_is_format_compressed(texImage->TexFormat)) { texelBytes = 0; - texImage->CompressedSize = - ctx->Driver.CompressedTextureSize(ctx, texImage->Width, - texImage->Height, texImage->Depth, - texImage->TexFormat); } else { - texImage->CompressedSize = 0; - texelBytes = _mesa_get_format_bytes(texImage->TexFormat); /* Minimum pitch of 32 bytes */ if (postConvWidth * texelBytes < 32) { @@ -590,7 +584,12 @@ static void radeon_teximage( } else { int size; if (_mesa_is_format_compressed(texImage->TexFormat)) { - size = texImage->CompressedSize; + size = ctx->Driver.CompressedTextureSize(ctx, + texImage->Width, + texImage->Height, + texImage->Depth, + texImage->TexFormat); + } else { size = texImage->Width * texImage->Height * texImage->Depth * _mesa_get_format_bytes(texImage->TexFormat); } diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tex.c b/src/mesa/drivers/dri/tdfx/tdfx_tex.c index 8b68137eed..5e9421aa2a 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_tex.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_tex.c @@ -1409,13 +1409,13 @@ tdfxTexImage2D(GLcontext *ctx, GLenum target, GLint level, texelBytes = _mesa_get_format_bytes(texImage->TexFormat); if (_mesa_is_format_compressed(texImage->TexFormat)) { - texImage->CompressedSize = _mesa_compressed_texture_size(ctx, - mml->width, - mml->height, - 1, - mesaFormat); + GLuint compressedSize = ctx->Driver.CompressedTextureSize(ctx, + mml->width, + mml->height, + 1, + mesaFormat); dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat, mml->width); - texImage->Data = _mesa_alloc_texmemory(texImage->CompressedSize); + texImage->Data = _mesa_alloc_texmemory(compressedSize); } else { dstRowStride = mml->width * texelBytes; texImage->Data = _mesa_alloc_texmemory(mml->width * mml->height * texelBytes); @@ -1580,7 +1580,8 @@ tdfxCompressedTexImage2D (GLcontext *ctx, GLenum target, tdfxContextPtr fxMesa = TDFX_CONTEXT(ctx); tdfxTexInfo *ti; tdfxMipMapLevel *mml; - GLuint mesaFormat; + gl_format mesaFormat; + GLuint compressedSize; if (TDFX_DEBUG & DEBUG_VERBOSE_DRI) { fprintf(stderr, "tdfxCompressedTexImage2D: id=%d int 0x%x %dx%d\n", @@ -1637,12 +1638,12 @@ tdfxCompressedTexImage2D (GLcontext *ctx, GLenum target, /* allocate new storage for texture image, if needed */ if (!texImage->Data) { - texImage->CompressedSize = _mesa_compressed_texture_size(ctx, - mml->width, - mml->height, - 1, - mesaFormat); - texImage->Data = _mesa_alloc_texmemory(texImage->CompressedSize); + compressedSize = ctx->Driver.CompressedTextureSize(ctx, + mml->width, + mml->height, + 1, + mesaFormat); + texImage->Data = _mesa_alloc_texmemory(compressedSize); if (!texImage->Data) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D"); return; @@ -1677,7 +1678,7 @@ tdfxCompressedTexImage2D (GLcontext *ctx, GLenum target, texImage->Data); ti->padded = GL_TRUE; } else { - MEMCPY(texImage->Data, data, texImage->CompressedSize); + MEMCPY(texImage->Data, data, compressedSize); } RevalidateTexture(ctx, texObj); diff --git a/src/mesa/drivers/dri/unichrome/via_tex.c b/src/mesa/drivers/dri/unichrome/via_tex.c index 13458aba1c..a99aa9debc 100644 --- a/src/mesa/drivers/dri/unichrome/via_tex.c +++ b/src/mesa/drivers/dri/unichrome/via_tex.c @@ -674,6 +674,7 @@ static void viaTexImage(GLcontext *ctx, struct via_texture_object *viaObj = (struct via_texture_object *)texObj; struct via_texture_image *viaImage = (struct via_texture_image *)texImage; int heaps[3], nheaps, i; + GLuint compressedSize; if (!is_empty_list(&vmesa->freed_tex_buffers)) { viaCheckBreadcrumb(vmesa, 0); @@ -697,7 +698,7 @@ static void viaTexImage(GLcontext *ctx, if (texelBytes == 0) { /* compressed format */ - texImage->CompressedSize = + compressedSize = ctx->Driver.CompressedTextureSize(ctx, texImage->Width, texImage->Height, texImage->Depth, texImage->TexFormat); @@ -714,7 +715,7 @@ static void viaTexImage(GLcontext *ctx, /* allocate memory */ if (_mesa_is_format_compressed(texImage->TexFormat)) - sizeInBytes = texImage->CompressedSize; + sizeInBytes = compressedSize; else sizeInBytes = postConvWidth * postConvHeight * texelBytes; diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 9131f20f52..64bf9cba19 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -481,7 +481,7 @@ struct dd_function_table { */ GLuint (*CompressedTextureSize)( GLcontext *ctx, GLsizei width, GLsizei height, GLsizei depth, - GLenum format ); + GLuint mesaFormat ); /*@}*/ /** diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index f6d6ce33c8..e24e7285c3 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -1614,24 +1614,19 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, dstImage->TexFormat = srcImage->TexFormat; dstImage->FetchTexelc = srcImage->FetchTexelc; dstImage->FetchTexelf = srcImage->FetchTexelf; + + /* Alloc new teximage data buffer. + * Setup src and dest data pointers. + */ if (_mesa_is_format_compressed(dstImage->TexFormat)) { - dstImage->CompressedSize + GLuint dstCompressedSize = ctx->Driver.CompressedTextureSize(ctx, dstImage->Width, dstImage->Height, dstImage->Depth, dstImage->TexFormat); - ASSERT(dstImage->CompressedSize > 0); - } - - ASSERT(dstImage->TexFormat); - ASSERT(dstImage->FetchTexelc); - ASSERT(dstImage->FetchTexelf); + ASSERT(dstCompressedSize > 0); - /* Alloc new teximage data buffer. - * Setup src and dest data pointers. - */ - if (_mesa_is_format_compressed(dstImage->TexFormat)) { - dstImage->Data = _mesa_alloc_texmemory(dstImage->CompressedSize); + dstImage->Data = _mesa_alloc_texmemory(dstCompressedSize); if (!dstImage->Data) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "generating mipmaps"); return; @@ -1653,6 +1648,10 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, dstData = (GLubyte *) dstImage->Data; } + ASSERT(dstImage->TexFormat); + ASSERT(dstImage->FetchTexelc); + ASSERT(dstImage->FetchTexelf); + _mesa_generate_mipmap_level(target, datatype, comps, border, srcWidth, srcHeight, srcDepth, srcData, srcImage->RowStride, diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index f084edb840..8e6e0d09be 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1173,8 +1173,6 @@ struct gl_texture_image FetchTexelFuncC FetchTexelc; /**< GLchan texel fetch function pointer */ FetchTexelFuncF FetchTexelf; /**< Float texel fetch function pointer */ - GLuint CompressedSize; /**< GL_ARB_texture_compression */ - GLuint RowStride; /**< Padded width in units of texels */ GLuint *ImageOffsets; /**< if 3D texture: array [Depth] of offsets to each 2D slice in 'Data', in texels */ diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 86f46b9551..438a316b9c 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -903,7 +903,6 @@ clear_teximage_fields(struct gl_texture_image *img) img->TexFormat = MESA_FORMAT_NONE; img->FetchTexelc = NULL; img->FetchTexelf = NULL; - img->CompressedSize = 0; } @@ -966,8 +965,6 @@ _mesa_init_teximage_fields(GLcontext *ctx, GLenum target, img->MaxLog2 = MAX2(img->WidthLog2, img->HeightLog2); - img->CompressedSize = 0; - if ((width == 1 || _mesa_is_pow_two(img->Width2)) && (height == 1 || _mesa_is_pow_two(img->Height2)) && (depth == 1 || _mesa_is_pow_two(img->Depth2))) diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 0fa8c44817..133b0370c8 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -3159,34 +3159,12 @@ _mesa_unmap_teximage_pbo(GLcontext *ctx, } -static void -compute_texture_size(GLcontext *ctx, struct gl_texture_image *texImage) -{ - if (_mesa_is_format_compressed(texImage->TexFormat)) { - texImage->CompressedSize = - ctx->Driver.CompressedTextureSize(ctx, texImage->Width, - texImage->Height, texImage->Depth, - texImage->TexFormat); - } - else { - /* non-compressed format */ - texImage->CompressedSize = 0; - } -} - - /** Return texture size in bytes */ static GLuint texture_size(const struct gl_texture_image *texImage) { - GLuint sz; - - if (_mesa_is_format_compressed(texImage->TexFormat)) - sz = texImage->CompressedSize; - else - sz = texImage->Width * texImage->Height * texImage->Depth * - _mesa_get_format_bytes(texImage->TexFormat); - + GLuint sz = _mesa_format_image_size(texImage->TexFormat, texImage->Width, + texImage->Height, texImage->Depth); return sz; } @@ -3228,7 +3206,7 @@ _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_object *texObj, struct gl_texture_image *texImage) { - GLint sizeInBytes; + GLuint sizeInBytes; (void) border; texImage->TexFormat @@ -3236,11 +3214,9 @@ _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level, ASSERT(texImage->TexFormat); _mesa_set_fetch_functions(texImage, 1); - compute_texture_size(ctx, texImage); /* allocate memory */ sizeInBytes = texture_size(texImage); - texImage->Data = _mesa_alloc_texmemory(sizeInBytes); if (!texImage->Data) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage1D"); @@ -3293,7 +3269,7 @@ _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_object *texObj, struct gl_texture_image *texImage) { - GLint texelBytes, sizeInBytes; + GLuint sizeInBytes; (void) border; texImage->TexFormat @@ -3301,9 +3277,6 @@ _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level, ASSERT(texImage->TexFormat); _mesa_set_fetch_functions(texImage, 2); - compute_texture_size(ctx, texImage); - - texelBytes = _mesa_get_format_bytes(texImage->TexFormat); /* allocate memory */ sizeInBytes = texture_size(texImage); @@ -3355,7 +3328,7 @@ _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_object *texObj, struct gl_texture_image *texImage) { - GLint texelBytes, sizeInBytes; + GLuint sizeInBytes; (void) border; texImage->TexFormat @@ -3363,9 +3336,6 @@ _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level, ASSERT(texImage->TexFormat); _mesa_set_fetch_functions(texImage, 3); - compute_texture_size(ctx, texImage); - - texelBytes = _mesa_get_format_bytes(texImage->TexFormat); /* allocate memory */ sizeInBytes = texture_size(texImage); @@ -3570,7 +3540,6 @@ _mesa_store_compressed_teximage2d(GLcontext *ctx, GLenum target, GLint level, ASSERT(texImage->TexFormat); _mesa_set_fetch_functions(texImage, 2); - compute_texture_size(ctx, texImage); /* allocate storage */ texImage->Data = _mesa_alloc_texmemory(imageSize); @@ -3586,7 +3555,6 @@ _mesa_store_compressed_teximage2d(GLcontext *ctx, GLenum target, GLint level, return; /* copy the data */ - ASSERT(texImage->CompressedSize == (GLuint) imageSize); MEMCPY(texImage->Data, data, imageSize); _mesa_unmap_teximage_pbo(ctx, &ctx->Unpack); diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 2574eeb996..dc3ab61425 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -563,10 +563,6 @@ st_TexImage(GLcontext * ctx, if (_mesa_is_format_compressed(texImage->TexFormat)) { /* must be a compressed format */ texelBytes = 0; - texImage->CompressedSize = - ctx->Driver.CompressedTextureSize(ctx, texImage->Width, - texImage->Height, texImage->Depth, - texImage->TexFormat); } else { texelBytes = _mesa_get_format_bytes(texImage->TexFormat); @@ -697,7 +693,11 @@ st_TexImage(GLcontext * ctx, else { /* Allocate regular memory and store the image there temporarily. */ if (_mesa_is_format_compressed(texImage->TexFormat)) { - sizeInBytes = texImage->CompressedSize; + sizeInBytes = ctx->Driver.CompressedTextureSize(ctx, + texImage->Width, + texImage->Height, + texImage->Depth, + texImage->TexFormat); dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat, width); assert(dims != 3); -- cgit v1.2.3 From 584b0879ac2ec2420ea6866e47eb90e1a980e758 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 2 Oct 2009 07:51:15 -0600 Subject: xlib: use bitwise-and to test GLX_RGBA_BIT in choose_visual() The parameter is a bitmask. --- src/mesa/drivers/x11/fakeglx.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index eb7c4f6417..6449dc88b0 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -1197,10 +1197,10 @@ choose_visual( Display *dpy, int screen, const int *list, GLboolean fbConfig ) if (!fbConfig) return NULL; parselist++; - if (*parselist == GLX_RGBA_BIT) { + if (*parselist & GLX_RGBA_BIT) { rgb_flag = GL_TRUE; } - else if (*parselist == GLX_COLOR_INDEX_BIT) { + else if (*parselist & GLX_COLOR_INDEX_BIT) { rgb_flag = GL_FALSE; } else if (*parselist == 0) { -- cgit v1.2.3 From f1cab802b8e78906413f219ad354f5d5500b4d3f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 2 Oct 2009 08:54:55 -0600 Subject: mesa: added _mesa_meta_check_generate_mipmap_fallback() --- src/mesa/drivers/common/meta.c | 27 ++++++++++++++++++++++++--- src/mesa/drivers/common/meta.h | 4 ++++ 2 files changed, 28 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index a152087a3a..20d47dc38b 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -1948,6 +1948,29 @@ _mesa_meta_Bitmap(GLcontext *ctx, } +/** + * Check if the call to _mesa_meta_GenerateMipmap() will require a + * software fallback. The fallback path will require that the texture + * images are mapped. + */ +GLboolean +_mesa_meta_check_generate_mipmap_fallback(GLcontext *ctx, GLenum target, + struct gl_texture_object *texObj) +{ + struct gl_texture_image *baseImage = + _mesa_select_tex_image(ctx, texObj, target, texObj->BaseLevel); + + /* check for fallbacks */ + if (!ctx->Extensions.EXT_framebuffer_object || + target == GL_TEXTURE_3D || + !baseImage || + baseImage->IsCompressed) { + return GL_TRUE; + } + return GL_FALSE; +} + + /** * Called via ctx->Driver.GenerateMipmap() * Note: texture borders and 3D texture support not yet complete. @@ -1976,9 +1999,7 @@ _mesa_meta_GenerateMipmap(GLcontext *ctx, GLenum target, GLuint dstLevel; GLuint border = 0; - /* check for fallbacks */ - if (!ctx->Extensions.EXT_framebuffer_object || - target == GL_TEXTURE_3D) { + if (_mesa_meta_check_generate_mipmap_fallback(ctx, target, texObj)) { _mesa_generate_mipmap(ctx, target, texObj); return; } diff --git a/src/mesa/drivers/common/meta.h b/src/mesa/drivers/common/meta.h index 7f659528dc..6225b94189 100644 --- a/src/mesa/drivers/common/meta.h +++ b/src/mesa/drivers/common/meta.h @@ -60,6 +60,10 @@ _mesa_meta_Bitmap(GLcontext *ctx, const struct gl_pixelstore_attrib *unpack, const GLubyte *bitmap); +extern GLboolean +_mesa_meta_check_generate_mipmap_fallback(GLcontext *ctx, GLenum target, + struct gl_texture_object *texObj); + extern void _mesa_meta_GenerateMipmap(GLcontext *ctx, GLenum target, struct gl_texture_object *texObj); -- cgit v1.2.3 From 7d4b348c67dbc2eff1d7dd0c043a76bc0eae57ab Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 2 Oct 2009 08:55:25 -0600 Subject: intel: wrap _mesa_meta_GenerateMipmap() Need to check if we'll take the software path so which requires mapping the src texture image. Fixes crash in piglit gen-compressed-teximage, bug 24219. However, the test still does not pass (it may never have). --- src/mesa/drivers/dri/intel/intel_tex.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex.c b/src/mesa/drivers/dri/intel/intel_tex.c index f5d877edc3..3cbc379dbd 100644 --- a/src/mesa/drivers/dri/intel/intel_tex.c +++ b/src/mesa/drivers/dri/intel/intel_tex.c @@ -2,6 +2,7 @@ #include "main/texobj.h" #include "main/teximage.h" #include "main/mipmap.h" +#include "drivers/common/meta.h" #include "intel_context.h" #include "intel_mipmap_tree.h" #include "intel_tex.h" @@ -158,10 +159,36 @@ timed_memcpy(void *dest, const void *src, size_t n) } #endif /* DO_DEBUG */ + +/** + * Called via ctx->Driver.GenerateMipmap() + * This is basically a wrapper for _mesa_meta_GenerateMipmap() which checks + * if we'll be using software mipmap generation. In that case, we need to + * map/unmap the base level texture image. + */ +static void +intelGenerateMipmap(GLcontext *ctx, GLenum target, + struct gl_texture_object *texObj) +{ + if (_mesa_meta_check_generate_mipmap_fallback(ctx, target, texObj)) { + /* sw path: need to map texture images */ + struct intel_context *intel = intel_context(ctx); + struct intel_texture_object *intelObj = intel_texture_object(texObj); + intel_tex_map_level_images(intel, intelObj, texObj->BaseLevel); + _mesa_generate_mipmap(ctx, target, texObj); + intel_tex_unmap_level_images(intel, intelObj, texObj->BaseLevel); + } + else { + _mesa_meta_GenerateMipmap(ctx, target, texObj); + } +} + + void intelInitTextureFuncs(struct dd_function_table *functions) { functions->ChooseTextureFormat = intelChooseTextureFormat; + functions->GenerateMipmap = intelGenerateMipmap; functions->NewTextureObject = intelNewTextureObject; functions->NewTextureImage = intelNewTextureImage; -- cgit v1.2.3 From e1bddd159f364fa04ddec22f568fbfeb775d3b47 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 2 Oct 2009 09:55:07 -0600 Subject: mesa: fix incorrect default texture binding in unbind_texobj_from_texunits() If we deleted a currently bound texture, we were always reverting the texture binding to the default 1D texture rather than the proper default texture. --- src/mesa/main/texobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index d09c439250..da55ac8697 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -863,7 +863,7 @@ unbind_texobj_from_texunits(GLcontext *ctx, struct gl_texture_object *texObj) for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) { if (texObj == unit->CurrentTex[tex]) { _mesa_reference_texobj(&unit->CurrentTex[tex], - ctx->Shared->DefaultTex[TEXTURE_1D_INDEX]); + ctx->Shared->DefaultTex[tex]); ASSERT(unit->CurrentTex[tex]); break; } -- cgit v1.2.3 From 47e41b024e325f69ed514e551a6824afa58f1db6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Fri, 2 Oct 2009 18:13:26 +0200 Subject: gallium: Preparations for adding more PIPE_TRANSFER_* usage flags. Always test for PIPE_TRANSFER_READ/WRITE using the bit-wise and operator, and add a pipe_transfer_buffer_flags() helper for getting the buffer usage flags corresponding to them. --- src/mesa/state_tracker/st_cb_accum.c | 2 +- src/mesa/state_tracker/st_texture.c | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_accum.c b/src/mesa/state_tracker/st_cb_accum.c index 95181578f6..3d1d0f71d5 100644 --- a/src/mesa/state_tracker/st_cb_accum.c +++ b/src/mesa/state_tracker/st_cb_accum.c @@ -241,7 +241,7 @@ accum_return(GLcontext *ctx, GLfloat value, xpos, ypos, width, height); - if (usage != PIPE_TRANSFER_WRITE) + if (usage & PIPE_TRANSFER_READ) pipe_get_tile_rgba(color_trans, 0, 0, width, height, buf); switch (acc_strb->format) { diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c index bbc2830e69..ba8d1e8cc1 100644 --- a/src/mesa/state_tracker/st_texture.c +++ b/src/mesa/state_tracker/st_texture.c @@ -577,7 +577,6 @@ st_teximage_flush_before_map(struct st_context *st, pipe->is_texture_referenced(pipe, pt, face, level); if (referenced && ((referenced & PIPE_REFERENCED_FOR_WRITE) || - usage == PIPE_TRANSFER_WRITE || - usage == PIPE_TRANSFER_READ_WRITE)) + (usage & PIPE_TRANSFER_WRITE))) st_flush(st, PIPE_FLUSH_RENDER_CACHE, NULL); } -- cgit v1.2.3 From 918199fb0f5d84121e0ac5821168cd0e886b22e9 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Fri, 2 Oct 2009 15:36:47 +0100 Subject: mesa/st: don't reuse vertex buffers for bitmap, clear quads Currently using max_slots > 1 will cause synchronous rendering if the driver flushes its command buffers between one bitmap and the next. Need to improve buffer_write to allow NO_WAIT (as well as no_flush) updates to buffers where we know there is no conflict with previous data. --- src/mesa/state_tracker/st_cb_bitmap.c | 13 ++++++++++++- src/mesa/state_tracker/st_cb_clear.c | 13 ++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index 902fb38d1a..a22fa68299 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -330,7 +330,18 @@ setup_bitmap_vertex_data(struct st_context *st, const GLfloat clip_y0 = (GLfloat)(y0 / fb_height * 2.0 - 1.0); const GLfloat clip_x1 = (GLfloat)(x1 / fb_width * 2.0 - 1.0); const GLfloat clip_y1 = (GLfloat)(y1 / fb_height * 2.0 - 1.0); - const GLuint max_slots = 4096 / sizeof(st->bitmap.vertices); + + /* XXX: Need to improve buffer_write to allow NO_WAIT (as well as + * no_flush) updates to buffers where we know there is no conflict + * with previous data. Currently using max_slots > 1 will cause + * synchronous rendering if the driver flushes its command buffers + * between one bitmap and the next. Our flush hook below isn't + * sufficient to catch this as the driver doesn't tell us when it + * flushes its own command buffers. Until this gets fixed, pay the + * price of allocating a new buffer for each bitmap cache-flush to + * avoid synchronous rendering. + */ + const GLuint max_slots = 1; /* 4096 / sizeof(st->bitmap.vertices); */ GLuint i; if (st->bitmap.vbuf_slot >= max_slots) { diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c index 8a8c99f7e1..36510720a4 100644 --- a/src/mesa/state_tracker/st_cb_clear.c +++ b/src/mesa/state_tracker/st_cb_clear.c @@ -116,7 +116,18 @@ draw_quad(GLcontext *ctx, { struct st_context *st = ctx->st; struct pipe_context *pipe = st->pipe; - const GLuint max_slots = 1024 / sizeof(st->clear.vertices); + + /* XXX: Need to improve buffer_write to allow NO_WAIT (as well as + * no_flush) updates to buffers where we know there is no conflict + * with previous data. Currently using max_slots > 1 will cause + * synchronous rendering if the driver flushes its command buffers + * between one bitmap and the next. Our flush hook below isn't + * sufficient to catch this as the driver doesn't tell us when it + * flushes its own command buffers. Until this gets fixed, pay the + * price of allocating a new buffer for each bitmap cache-flush to + * avoid synchronous rendering. + */ + const GLuint max_slots = 1; /* 1024 / sizeof(st->clear.vertices); */ GLuint i; if (st->clear.vbuf_slot >= max_slots) { -- cgit v1.2.3 From 3f623cfffee8db83ba8e0302fc5e3d1f40d1b0b5 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Fri, 2 Oct 2009 14:25:52 -0400 Subject: r600: remove support for host-based ibs no longer used now that the hw supports this natively. Also, clean up some formatting. --- src/mesa/drivers/dri/r600/r600_context.h | 26 ++-- src/mesa/drivers/dri/r600/r700_render.c | 204 +++++++++++-------------------- 2 files changed, 80 insertions(+), 150 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r600_context.h b/src/mesa/drivers/dri/r600/r600_context.h index a296ea23fa..7f68820fda 100644 --- a/src/mesa/drivers/dri/r600/r600_context.h +++ b/src/mesa/drivers/dri/r600/r600_context.h @@ -126,32 +126,30 @@ struct r600_hw_state { struct radeon_state_atom tx_brdr_clr; }; -typedef struct StreamDesc +typedef struct StreamDesc { GLint size; //number of data element GLenum type; //data element type GLsizei stride; - struct radeon_bo *bo; - GLint bo_offset; + struct radeon_bo *bo; + GLint bo_offset; - GLuint dwords; + GLuint dwords; GLuint dst_loc; GLuint _signed; GLboolean normalize; - GLboolean is_named_bo; - GLubyte element; + GLboolean is_named_bo; + GLubyte element; } StreamDesc; -typedef struct r700_index_buffer +typedef struct r700_index_buffer { - struct radeon_bo *bo; - int bo_offset; + struct radeon_bo *bo; + int bo_offset; - GLboolean is_32bit; - GLuint count; - - GLboolean bHostIb; + GLboolean is_32bit; + GLuint count; } r700_index_buffer; /** @@ -172,7 +170,7 @@ struct r600_context { GLvector4f dummy_attrib[_TNL_ATTRIB_MAX]; GLvector4f *temp_attrib[_TNL_ATTRIB_MAX]; - GLint nNumActiveAos; + GLint nNumActiveAos; StreamDesc stream_desc[VERT_ATTRIB_MAX]; struct r700_index_buffer ind_buf; }; diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c index 4949bf013d..0aef0b7ea1 100644 --- a/src/mesa/drivers/dri/r600/r700_render.c +++ b/src/mesa/drivers/dri/r600/r700_render.c @@ -251,19 +251,19 @@ static int r700NumVerts(int num_verts, int prim) static void r700RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim) { - context_t *context = R700_CONTEXT(ctx); - BATCH_LOCALS(&context->radeon); - int type, i, total_emit; - int num_indices; - uint32_t vgt_draw_initiator = 0; - uint32_t vgt_index_type = 0; - uint32_t vgt_primitive_type = 0; - uint32_t vgt_num_indices = 0; - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *vb = &tnl->vb; - + context_t *context = R700_CONTEXT(ctx); + BATCH_LOCALS(&context->radeon); + int type, i, total_emit; + int num_indices; + uint32_t vgt_draw_initiator = 0; + uint32_t vgt_index_type = 0; + uint32_t vgt_primitive_type = 0; + uint32_t vgt_num_indices = 0; + TNLcontext *tnl = TNL_CONTEXT(ctx); + struct vertex_buffer *vb = &tnl->vb; GLboolean bUseDrawIndex; - if( (NULL != context->ind_buf.bo) && (GL_TRUE != context->ind_buf.bHostIb) ) + + if(NULL != context->ind_buf.bo) { bUseDrawIndex = GL_TRUE; } @@ -272,35 +272,35 @@ static void r700RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim bUseDrawIndex = GL_FALSE; } - type = r700PrimitiveType(prim); - num_indices = r700NumVerts(end - start, prim); + type = r700PrimitiveType(prim); + num_indices = r700NumVerts(end - start, prim); - radeon_print(RADEON_RENDER, RADEON_TRACE, - "%s type %x num_indices %d\n", - __func__, type, num_indices); + radeon_print(RADEON_RENDER, RADEON_TRACE, + "%s type %x num_indices %d\n", + __func__, type, num_indices); - if (type < 0 || num_indices <= 0) - return; + if (type < 0 || num_indices <= 0) + return; if(GL_TRUE == bUseDrawIndex) { total_emit = 3 /* VGT_PRIMITIVE_TYPE */ - + 2 /* VGT_INDEX_TYPE */ - + 2 /* NUM_INSTANCES */ - + 5+2; /* DRAW_INDEX */ + + 2 /* VGT_INDEX_TYPE */ + + 2 /* NUM_INSTANCES */ + + 5 + 2; /* DRAW_INDEX */ } else { total_emit = 3 /* VGT_PRIMITIVE_TYPE */ - + 2 /* VGT_INDEX_TYPE */ - + 2 /* NUM_INSTANCES */ - + num_indices + 3; /* DRAW_INDEX_IMMD */ + + 2 /* VGT_INDEX_TYPE */ + + 2 /* NUM_INSTANCES */ + + num_indices + 3; /* DRAW_INDEX_IMMD */ } BEGIN_BATCH_NO_AUTOSTATE(total_emit); - // prim + // prim SETfield(vgt_primitive_type, type, - VGT_PRIMITIVE_TYPE__PRIM_TYPE_shift, VGT_PRIMITIVE_TYPE__PRIM_TYPE_mask); + VGT_PRIMITIVE_TYPE__PRIM_TYPE_shift, VGT_PRIMITIVE_TYPE__PRIM_TYPE_mask); R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_CONFIG_REG, 1)); R600_OUT_BATCH(mmVGT_PRIMITIVE_TYPE - ASIC_CONFIG_BASE_INDEX); R600_OUT_BATCH(vgt_primitive_type); @@ -319,11 +319,11 @@ static void r700RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim R600_OUT_BATCH(CP_PACKET3(R600_IT_INDEX_TYPE, 0)); R600_OUT_BATCH(vgt_index_type); - // num instances - R600_OUT_BATCH(CP_PACKET3(R600_IT_NUM_INSTANCES, 0)); - R600_OUT_BATCH(1); + // num instances + R600_OUT_BATCH(CP_PACKET3(R600_IT_NUM_INSTANCES, 0)); + R600_OUT_BATCH(1); - // draw packet + // draw packet vgt_num_indices = num_indices; if(GL_TRUE == bUseDrawIndex) @@ -354,44 +354,17 @@ static void r700RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim R600_OUT_BATCH(CP_PACKET3(R600_IT_DRAW_INDEX_IMMD, (num_indices + 1))); R600_OUT_BATCH(vgt_num_indices); R600_OUT_BATCH(vgt_draw_initiator); - } - if(NULL == context->ind_buf.bo) - { - for (i = start; i < (start + num_indices); i++) { + for (i = start; i < (start + num_indices); i++) + { if(vb->Elts) { R600_OUT_BATCH(vb->Elts[i]); } else + { R600_OUT_BATCH(i); - } - } - else - { - if(GL_TRUE == context->ind_buf.bHostIb) - { - if(GL_TRUE != context->ind_buf.is_32bit) - { - GLushort * pIndex = (GLushort*)ADD_POINTERS(context->ind_buf.bo->ptr, context->ind_buf.bo_offset); - pIndex += start; - for (i = 0; i < num_indices; i++) - { - R600_OUT_BATCH(*pIndex); - pIndex++; - } - } - else - { - GLuint * pIndex = (GLuint*)ADD_POINTERS(context->ind_buf.bo->ptr, context->ind_buf.bo_offset); - pIndex += start; - - for (i = 0; i < num_indices; i++) - { - R600_OUT_BATCH(*pIndex); - pIndex++; - } - } + } } } @@ -826,30 +799,21 @@ static void r700FreeData(GLcontext *ctx) * called during context destroy */ context_t *context = R700_CONTEXT(ctx); - + int i; - for (i = 0; i < context->nNumActiveAos; i++) + for (i = 0; i < context->nNumActiveAos; i++) { - if (!context->stream_desc[i].is_named_bo) + if (!context->stream_desc[i].is_named_bo) { radeon_bo_unref(context->stream_desc[i].bo); } context->radeon.tcl.aos[i].bo = NULL; } - - if (context->ind_buf.bo != NULL) + + if (context->ind_buf.bo != NULL) { - if(context->ind_buf.bHostIb != GL_TRUE) - { radeon_bo_unref(context->ind_buf.bo); - } - else - { - FREE(context->ind_buf.bo->ptr); - FREE(context->ind_buf.bo); - context->ind_buf.bo = NULL; - } } } @@ -861,7 +825,7 @@ static void r700FixupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer int i; GLboolean mapped_named_bo = GL_FALSE; - if (mesa_ind_buf->obj->Name && !mesa_ind_buf->obj->Pointer) + if (mesa_ind_buf->obj->Name && !mesa_ind_buf->obj->Pointer) { ctx->Driver.MapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER, GL_READ_ONLY_ARB, mesa_ind_buf->obj); mapped_named_bo = GL_TRUE; @@ -869,66 +833,46 @@ static void r700FixupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer } src_ptr = ADD_POINTERS(mesa_ind_buf->obj->Pointer, mesa_ind_buf->ptr); - if (mesa_ind_buf->type == GL_UNSIGNED_BYTE) + if (mesa_ind_buf->type == GL_UNSIGNED_BYTE) { GLuint size = sizeof(GLushort) * ((mesa_ind_buf->count + 1) & ~1); GLubyte *in = (GLubyte *)src_ptr; - if(context->ind_buf.bHostIb != GL_TRUE) - { - radeonAllocDmaRegion(&context->radeon, &context->ind_buf.bo, - &context->ind_buf.bo_offset, size, 4); + radeonAllocDmaRegion(&context->radeon, &context->ind_buf.bo, + &context->ind_buf.bo_offset, size, 4); - assert(context->ind_buf.bo->ptr != NULL); - out = (GLuint *)ADD_POINTERS(context->ind_buf.bo->ptr, context->ind_buf.bo_offset); - } - else - { - context->ind_buf.bo = MALLOC_STRUCT(radeon_bo); - context->ind_buf.bo->ptr = ALIGN_MALLOC(size, 4); - context->ind_buf.bo_offset = 0; - out = (GLuint *)context->ind_buf.bo->ptr; - } + assert(context->ind_buf.bo->ptr != NULL); + out = (GLuint *)ADD_POINTERS(context->ind_buf.bo->ptr, context->ind_buf.bo_offset); - for (i = 0; i + 1 < mesa_ind_buf->count; i += 2) + for (i = 0; i + 1 < mesa_ind_buf->count; i += 2) { *out++ = in[i] | in[i + 1] << 16; } - if (i < mesa_ind_buf->count) + if (i < mesa_ind_buf->count) { *out++ = in[i]; } #if MESA_BIG_ENDIAN - } - else + } + else { /* if (mesa_ind_buf->type == GL_UNSIGNED_SHORT) */ GLushort *in = (GLushort *)src_ptr; GLuint size = sizeof(GLushort) * ((mesa_ind_buf->count + 1) & ~1); - if(context->ind_buf.bHostIb != GL_TRUE) - { - radeonAllocDmaRegion(&context->radeon, &context->ind_buf.bo, - &context->ind_buf.bo_offset, size, 4); + radeonAllocDmaRegion(&context->radeon, &context->ind_buf.bo, + &context->ind_buf.bo_offset, size, 4); - assert(context->ind_buf.bo->ptr != NULL); - out = (GLuint *)ADD_POINTERS(context->ind_buf.bo->ptr, context->ind_buf.bo_offset); - } - else - { - context->ind_buf.bo = MALLOC_STRUCT(radeon_bo); - context->ind_buf.bo->ptr = ALIGN_MALLOC(size, 4); - context->ind_buf.bo_offset = 0; - out = (GLuint *)context->ind_buf.bo->ptr; - } + assert(context->ind_buf.bo->ptr != NULL); + out = (GLuint *)ADD_POINTERS(context->ind_buf.bo->ptr, context->ind_buf.bo_offset); - for (i = 0; i + 1 < mesa_ind_buf->count; i += 2) + for (i = 0; i + 1 < mesa_ind_buf->count; i += 2) { *out++ = in[i] | in[i + 1] << 16; } - if (i < mesa_ind_buf->count) + if (i < mesa_ind_buf->count) { *out++ = in[i]; } @@ -938,7 +882,7 @@ static void r700FixupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer context->ind_buf.is_32bit = GL_FALSE; context->ind_buf.count = mesa_ind_buf->count; - if (mapped_named_bo) + if (mapped_named_bo) { ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER, mesa_ind_buf->obj); } @@ -953,20 +897,18 @@ static void r700SetupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer return; } - context->ind_buf.bHostIb = GL_FALSE; - #if MESA_BIG_ENDIAN - if (mesa_ind_buf->type == GL_UNSIGNED_INT) + if (mesa_ind_buf->type == GL_UNSIGNED_INT) { #else - if (mesa_ind_buf->type != GL_UNSIGNED_BYTE) + if (mesa_ind_buf->type != GL_UNSIGNED_BYTE) { #endif const GLvoid *src_ptr; GLvoid *dst_ptr; GLboolean mapped_named_bo = GL_FALSE; - if (mesa_ind_buf->obj->Name && !mesa_ind_buf->obj->Pointer) + if (mesa_ind_buf->obj->Name && !mesa_ind_buf->obj->Pointer) { ctx->Driver.MapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER, GL_READ_ONLY_ARB, mesa_ind_buf->obj); assert(mesa_ind_buf->obj->Pointer != NULL); @@ -977,32 +919,22 @@ static void r700SetupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer const GLuint size = mesa_ind_buf->count * getTypeSize(mesa_ind_buf->type); - if(context->ind_buf.bHostIb != GL_TRUE) - { - radeonAllocDmaRegion(&context->radeon, &context->ind_buf.bo, - &context->ind_buf.bo_offset, size, 4); - assert(context->ind_buf.bo->ptr != NULL); - dst_ptr = ADD_POINTERS(context->ind_buf.bo->ptr, context->ind_buf.bo_offset); - } - else - { - context->ind_buf.bo = MALLOC_STRUCT(radeon_bo); - context->ind_buf.bo->ptr = ALIGN_MALLOC(size, 4); - context->ind_buf.bo_offset = 0; - dst_ptr = context->ind_buf.bo->ptr; - } + radeonAllocDmaRegion(&context->radeon, &context->ind_buf.bo, + &context->ind_buf.bo_offset, size, 4); + assert(context->ind_buf.bo->ptr != NULL); + dst_ptr = ADD_POINTERS(context->ind_buf.bo->ptr, context->ind_buf.bo_offset); _mesa_memcpy(dst_ptr, src_ptr, size); context->ind_buf.is_32bit = (mesa_ind_buf->type == GL_UNSIGNED_INT); context->ind_buf.count = mesa_ind_buf->count; - if (mapped_named_bo) + if (mapped_named_bo) { ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER, mesa_ind_buf->obj); } - } - else + } + else { r700FixupIndexBuffer(ctx, mesa_ind_buf); } @@ -1145,7 +1077,7 @@ static void r700DrawPrims(GLcontext *ctx, void r700InitDraw(GLcontext *ctx) { struct vbo_context *vbo = vbo_context(ctx); - + /* to be enabled */ vbo->draw_prims = r700DrawPrims; } -- cgit v1.2.3 From 3d78a86cd777aecce544d14b85177a71e9c142ce Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 1 Oct 2009 18:07:57 -0700 Subject: intel: Remove an unexplained flush from intelClearWithBlit. --- src/mesa/drivers/dri/intel/intel_blit.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c index 43141c509c..9e114db6c7 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.c +++ b/src/mesa/drivers/dri/intel/intel_blit.c @@ -371,8 +371,6 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask) skipBuffers = BUFFER_BIT_STENCIL; } - /* XXX Move this flush/lock into the following conditional? */ - intelFlush(&intel->ctx); LOCK_HARDWARE(intel); intel_get_cliprects(intel, &cliprects, &num_cliprects, &x_off, &y_off); -- cgit v1.2.3 From f019577f0c2ff83e20bd198a467ddb03579ddae3 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 1 Oct 2009 16:53:12 -0700 Subject: Revert "Flush driver, not just tnl module." This reverts commit df058298e1570eea8712f9bb051f674fab2eaf24. It didn't explain why it was required, doesnt appear to be required, and is a significant performance penalty for cairo-gl firefox. Conflicts: src/mesa/main/fbobject.c --- src/mesa/main/fbobject.c | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 680fd22ba8..a73a7659ad 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -718,12 +718,6 @@ _mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer) } FLUSH_CURRENT(ctx, _NEW_BUFFERS); - /* The above doesn't fully flush the drivers in the way that a - * glFlush does, but that is required here: - */ - if (ctx->Driver.Flush) - ctx->Driver.Flush(ctx); - if (renderbuffer) { newRb = _mesa_lookup_renderbuffer(ctx, renderbuffer); @@ -1294,11 +1288,6 @@ _mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers) ASSERT_OUTSIDE_BEGIN_END(ctx); FLUSH_CURRENT(ctx, _NEW_BUFFERS); - /* The above doesn't fully flush the drivers in the way that a - * glFlush does, but that is required here: - */ - if (ctx->Driver.Flush) - ctx->Driver.Flush(ctx); for (i = 0; i < n; i++) { if (framebuffers[i] > 0) { @@ -1532,11 +1521,6 @@ framebuffer_texture(GLcontext *ctx, const char *caller, GLenum target, } FLUSH_CURRENT(ctx, _NEW_BUFFERS); - /* The above doesn't fully flush the drivers in the way that a - * glFlush does, but that is required here: - */ - if (ctx->Driver.Flush) - ctx->Driver.Flush(ctx); _glthread_LOCK_MUTEX(fb->Mutex); if (texObj) { @@ -1713,11 +1697,6 @@ _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment, FLUSH_CURRENT(ctx, _NEW_BUFFERS); - /* The above doesn't fully flush the drivers in the way that a - * glFlush does, but that is required here: - */ - if (ctx->Driver.Flush) - ctx->Driver.Flush(ctx); assert(ctx->Driver.FramebufferRenderbuffer); ctx->Driver.FramebufferRenderbuffer(ctx, fb, attachment, rb); @@ -1794,11 +1773,6 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, } FLUSH_CURRENT(ctx, _NEW_BUFFERS); - /* The above doesn't fully flush the drivers in the way that a - * glFlush does, but that is required here: - */ - if (ctx->Driver.Flush) - ctx->Driver.Flush(ctx); switch (pname) { case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT: -- cgit v1.2.3 From 6d0fc3cfde3dd730de17e925c5594a8b317ba200 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 1 Oct 2009 17:59:05 -0700 Subject: mesa: Remove another unexplained Flush call, this time from BindFramebuffer. Combined with the previous fix, it takes cairo-gl firefox-talos-gfx time from 120 seconds to 90 seconds on my GM45. --- src/mesa/main/fbobject.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index a73a7659ad..6e767bb24d 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1207,9 +1207,6 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) } FLUSH_CURRENT(ctx, _NEW_BUFFERS); - if (ctx->Driver.Flush) { - ctx->Driver.Flush(ctx); - } if (framebuffer) { /* Binding a user-created framebuffer object */ -- cgit v1.2.3 From 4182b58169c1c37833c590d00d0a6a52b2b55326 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 2 Oct 2009 10:53:56 -0700 Subject: i965: Use a little stack space to avoid a malloc in wm_get_binding_table. --- src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index 4f651170c6..9c28a22a29 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -660,7 +660,7 @@ brw_wm_get_binding_table(struct brw_context *brw) if (bind_bo == NULL) { GLuint data_size = brw->wm.nr_surfaces * sizeof(GLuint); - uint32_t *data = malloc(data_size); + uint32_t data[BRW_WM_MAX_SURF]; int i; for (i = 0; i < brw->wm.nr_surfaces; i++) @@ -685,8 +685,6 @@ brw_wm_get_binding_table(struct brw_context *brw) brw->wm.surf_bo[i]); } } - - free(data); } return bind_bo; -- cgit v1.2.3 From be16acaafa2f28bb7d4551ed93d2e290c928006c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 2 Oct 2009 13:59:41 -0600 Subject: mesa: optimized _mesa_meta_BlitFramebuffer() for src=texture case If the src renderbuffer is actually a texture, we can directly use that texture as the src and avoid a copy. --- src/mesa/drivers/common/meta.c | 130 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 20d47dc38b..12e0bdde88 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -1053,6 +1053,124 @@ init_blit_depth_pixels(GLcontext *ctx) } +/** + * Try to do a glBiltFramebuffer using no-copy texturing. + * We can do this when the src renderbuffer is actually a texture. + * But if the src buffer == dst buffer we cannot do this. + * + * \return new buffer mask indicating the buffers left to blit using the + * normal path. + */ +static GLbitfield +blitframebuffer_texture(GLcontext *ctx, + GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, + GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, + GLbitfield mask, GLenum filter) +{ + if (mask & GL_COLOR_BUFFER_BIT) { + const struct gl_framebuffer *drawFb = ctx->DrawBuffer; + const struct gl_framebuffer *readFb = ctx->ReadBuffer; + const struct gl_renderbuffer_attachment *drawAtt = + &drawFb->Attachment[drawFb->_ColorDrawBufferIndexes[0]]; + const struct gl_renderbuffer_attachment *readAtt = + &readFb->Attachment[readFb->_ColorReadBufferIndex]; + + if (readAtt && readAtt->Texture) { + const struct gl_texture_object *texObj = readAtt->Texture; + const GLenum minFilterSave = texObj->MinFilter; + const GLenum magFilterSave = texObj->MagFilter; + const GLenum target = texObj->Target; + + if (drawAtt->Texture == readAtt->Texture) { + /* Can't use same texture as both the source and dest. We need + * to handle overlapping blits and besides, some hw may not + * support this. + */ + return mask; + } + + if (target != GL_TEXTURE_2D && target != GL_TEXTURE_RECTANGLE_ARB) { + /* Can't handle other texture types at this time */ + return mask; + } + + /* + printf("Blit from texture!\n"); + printf(" srcAtt %p dstAtt %p\n", readAtt, drawAtt); + printf(" srcTex %p dstText %p\n", texObj, drawAtt->Texture); + */ + + /* Prepare src texture state */ + _mesa_BindTexture(target, texObj->Name); + _mesa_TexParameteri(target, GL_TEXTURE_MIN_FILTER, filter); + _mesa_TexParameteri(target, GL_TEXTURE_MAG_FILTER, filter); + _mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); + /*_mesa_set_enable(ctx, GL_TEXTURE_RECTANGLE, GL_FALSE);*/ + _mesa_set_enable(ctx, target, GL_TRUE); + + /* Prepare vertex data (the VBO was previously created and bound) */ + { + struct vertex { + GLfloat x, y, s, t; + }; + struct vertex verts[4]; + GLfloat s0, t0, s1, t1; + + if (target == GL_TEXTURE_2D) { + const struct gl_texture_image *texImage + = _mesa_select_tex_image(ctx, texObj, target, + readAtt->TextureLevel); + s0 = srcX0 / (float) texImage->Width; + s1 = srcX1 / (float) texImage->Width; + t0 = srcY0 / (float) texImage->Height; + t1 = srcY1 / (float) texImage->Height; + } + else { + assert(target == GL_TEXTURE_RECTANGLE_ARB); + s0 = srcX0; + s1 = srcX1; + t0 = srcY0; + t1 = srcY1; + } + + verts[0].x = (GLfloat) dstX0; + verts[0].y = (GLfloat) dstY0; + verts[1].x = (GLfloat) dstX1; + verts[1].y = (GLfloat) dstY0; + verts[2].x = (GLfloat) dstX1; + verts[2].y = (GLfloat) dstY1; + verts[3].x = (GLfloat) dstX0; + verts[3].y = (GLfloat) dstY1; + + verts[0].s = s0; + verts[0].t = t0; + verts[1].s = s1; + verts[1].t = t0; + verts[2].s = s1; + verts[2].t = t1; + verts[3].s = s0; + verts[3].t = t1; + + _mesa_BufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, sizeof(verts), verts); + } + + _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4); + + /* Restore texture's filter state, the texture binding will + * be restored by _mesa_meta_end(). + */ + _mesa_TexParameteri(target, GL_TEXTURE_MIN_FILTER, minFilterSave); + _mesa_TexParameteri(target, GL_TEXTURE_MAG_FILTER, magFilterSave); + + /* Done with color buffer */ + mask &= ~GL_COLOR_BUFFER_BIT; + } + } + + return mask; +} + + /** * Meta implementation of ctx->Driver.BlitFramebuffer() in terms * of texture mapping and polygon rendering. @@ -1124,6 +1242,18 @@ _mesa_meta_BlitFramebuffer(GLcontext *ctx, _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, blit->VBO); } + /* Try faster, direct texture approach first */ + mask = blitframebuffer_texture(ctx, srcX0, srcY0, srcX1, srcY1, + dstX0, dstY0, dstX1, dstY1, mask, filter); + if (mask == 0x0) { + _mesa_meta_end(ctx); + return; + } + + /* Continue with "normal" approach which involves copying the src rect + * into a temporary texture and is "blitted" by drawing a textured quad. + */ + newTex = alloc_texture(tex, srcW, srcH, GL_RGBA); /* vertex positions/texcoords (after texture allocation!) */ -- cgit v1.2.3 From bbe384c86afeaf5995cddd286a76e1fd789e18f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= Date: Sat, 3 Oct 2009 01:26:38 +0200 Subject: r300: Workaround problem on R500 with very large fragment programs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The non-KMS interface is to blame here. In theory, a proper fix could be produced that works for the KMS interface only, but it require cleaning a lot of mess. Easier to just do it right in r300g. Signed-off-by: Nicolai Hähnle --- src/mesa/drivers/dri/r300/r300_context.c | 20 +++++++++++++++----- src/mesa/drivers/dri/r300/r300_fragprog_common.c | 13 +++++++++++++ 2 files changed, 28 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 2ea1b826de..9df3897e65 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -374,11 +374,21 @@ static void r300InitConstValues(GLcontext *ctx, radeonScreenPtr screen) if (screen->chip_family >= CHIP_FAMILY_RV515) { ctx->Const.FragmentProgram.MaxNativeTemps = R500_PFS_NUM_TEMP_REGS; ctx->Const.FragmentProgram.MaxNativeAttribs = 11; /* copy i915... */ - ctx->Const.FragmentProgram.MaxNativeParameters = R500_PFS_NUM_CONST_REGS; - ctx->Const.FragmentProgram.MaxNativeAluInstructions = R500_PFS_MAX_INST; - ctx->Const.FragmentProgram.MaxNativeTexInstructions = R500_PFS_MAX_INST; - ctx->Const.FragmentProgram.MaxNativeInstructions = R500_PFS_MAX_INST; - ctx->Const.FragmentProgram.MaxNativeTexIndirections = R500_PFS_MAX_INST; + + /* The hardware limits are higher than this, + * but the non-KMS DRM interface artificially limits us + * to this many instructions. + * + * We could of course work around it in the KMS path, + * but it would be a mess, so it seems wiser + * to leave it as is. Going forward, the Gallium driver + * will not be subject to these limitations. + */ + ctx->Const.FragmentProgram.MaxNativeParameters = 255; + ctx->Const.FragmentProgram.MaxNativeAluInstructions = 255; + ctx->Const.FragmentProgram.MaxNativeTexInstructions = 255; + ctx->Const.FragmentProgram.MaxNativeInstructions = 255; + ctx->Const.FragmentProgram.MaxNativeTexIndirections = 255; ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; } else { ctx->Const.FragmentProgram.MaxNativeTemps = R300_PFS_NUM_TEMP_REGS; diff --git a/src/mesa/drivers/dri/r300/r300_fragprog_common.c b/src/mesa/drivers/dri/r300/r300_fragprog_common.c index 0bdc90b4a8..70c9252894 100644 --- a/src/mesa/drivers/dri/r300/r300_fragprog_common.c +++ b/src/mesa/drivers/dri/r300/r300_fragprog_common.c @@ -239,6 +239,19 @@ static void translate_fragment_program(GLcontext *ctx, struct r300_fragment_prog rewriteFog(&compiler, fp); r3xx_compile_fragment_program(&compiler); + + if (compiler.is_r500) { + /* We need to support the non-KMS DRM interface, which + * artificially limits the number of instructions and + * constants which are available to us. + * + * See also the comment in r300_context.c where we + * set the MAX_NATIVE_xxx values. + */ + if (fp->code.code.r500.inst_end >= 255 || fp->code.constants.Count > 255) + rc_error(&compiler.Base, "Program is too big (upgrade to r300g to avoid this limitation).\n"); + } + fp->error = compiler.Base.Error; fp->InputsRead = compiler.Base.Program.InputsRead; -- cgit v1.2.3 From 4a6759b7789dc703a8ee9f1cf08af22c6e8101fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Sat, 3 Oct 2009 18:01:57 +0200 Subject: meta: Make sure texImage->TexFormat is valid for CopyTex(Sub)Image. --- src/mesa/drivers/common/meta.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 12e0bdde88..e1732241b3 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -55,6 +55,7 @@ #include "main/stencil.h" #include "main/texobj.h" #include "main/texenv.h" +#include "main/texformat.h" #include "main/teximage.h" #include "main/texparam.h" #include "main/texstate.h" @@ -2471,6 +2472,12 @@ copy_tex_image(GLcontext *ctx, GLuint dims, GLenum target, GLint level, return; } + if (texImage->TexFormat == &_mesa_null_texformat) + texImage->TexFormat = ctx->Driver.ChooseTextureFormat(ctx, + internalFormat, + format, + type); + _mesa_unlock_texture(ctx, texObj); /* need to unlock first */ /* -- cgit v1.2.3 From f741c1eed4559329a89fbf8da569889bbcdace26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Sat, 3 Oct 2009 18:01:58 +0200 Subject: swrast: Move up state validation in _swrast_ReadPixels. This ensures the driver won't map the wrong set of textures. --- src/mesa/swrast/s_readpix.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c index 48b9408d24..a1aeb2e01f 100644 --- a/src/mesa/swrast/s_readpix.c +++ b/src/mesa/swrast/s_readpix.c @@ -555,15 +555,15 @@ _swrast_ReadPixels( GLcontext *ctx, SWcontext *swrast = SWRAST_CONTEXT(ctx); struct gl_pixelstore_attrib clippedPacking = *packing; + if (ctx->NewState) + _mesa_update_state(ctx); + /* Need to do swrast_render_start() before clipping or anything else * since this is where a driver may grab the hw lock and get an updated * window size. */ swrast_render_start(ctx); - if (ctx->NewState) - _mesa_update_state(ctx); - if (swrast->NewState) _swrast_validate_derived( ctx ); -- cgit v1.2.3 From b330cebe01c5574e203fa6b9d49fee4c01e1adb6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Sat, 3 Oct 2009 18:01:58 +0200 Subject: radeon: Cope better with texture images with no miptrees. Fixes crash with compiz magnifier plugin. --- src/mesa/drivers/dri/radeon/radeon_texture.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 049284ef8c..7b7392b217 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -101,7 +101,12 @@ void radeonFreeTexImageData(GLcontext *ctx, struct gl_texture_image *timage) /* Set Data pointer and additional data for mapped texture image */ static void teximage_set_map_data(radeon_texture_image *image) { - radeon_mipmap_level *lvl = &image->mt->levels[image->mtlevel]; + radeon_mipmap_level *lvl; + + if (!image->mt) + return; + + lvl = &image->mt->levels[image->mtlevel]; image->base.Data = image->mt->bo->ptr + lvl->faces[image->mtface].offset; image->base.RowStride = lvl->rowstride / image->mt->bpp; @@ -969,7 +974,7 @@ int radeon_validate_texture_miptree(GLcontext * ctx, struct gl_texture_object *t radeon_texture_image *image = get_radeon_texture_image(texObj->Image[face][level]); if (RADEON_DEBUG & RADEON_TEXTURE) fprintf(stderr, " face %i, level %i... %p vs %p ", face, level, t->mt, image->mt); - if (t->mt == image->mt) { + if (t->mt == image->mt || (!image->mt && !image->base.Data)) { if (RADEON_DEBUG & RADEON_TEXTURE) fprintf(stderr, "OK\n"); -- cgit v1.2.3 From 7d2699aedc084d9cb9c2bd2f8bdb5f038271ac1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= Date: Sat, 3 Oct 2009 16:18:57 +0200 Subject: prog_parameter: Document the fact that Size may be > 4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicolai Hähnle --- src/mesa/shader/prog_parameter.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/prog_parameter.h b/src/mesa/shader/prog_parameter.h index d1fcf47e61..699cb0c735 100644 --- a/src/mesa/shader/prog_parameter.h +++ b/src/mesa/shader/prog_parameter.h @@ -56,7 +56,13 @@ struct gl_program_parameter const char *Name; /**< Null-terminated string */ gl_register_file Type; /**< PROGRAM_NAMED_PARAM, CONSTANT or STATE_VAR */ GLenum DataType; /**< GL_FLOAT, GL_FLOAT_VEC2, etc */ - GLuint Size; /**< Number of components (1..4) */ + /** + * Number of components (1..4), or more. + * If the number of components is greater than 4, + * this parameter is part of a larger uniform like a GLSL matrix or array. + * The next program parameter's Size will be Size-4 of this parameter. + */ + GLuint Size; GLboolean Used; /**< Helper flag for GLSL uniform tracking */ GLboolean Initialized; /**< Has the ParameterValue[] been set? */ GLbitfield Flags; /**< Bitmask of PROG_PARAM_*_BIT */ -- cgit v1.2.3 From b7cf887ca74561469c144f1d12227e1bcf277e7e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= Date: Sat, 3 Oct 2009 21:28:59 +0200 Subject: r300/compiler: Introduce control flow instructions and refactor dataflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Note that control flow instruction support isn't actually fully functional yet. Signed-off-by: Nicolai Hähnle --- src/mesa/drivers/dri/r300/compiler/Makefile | 3 +- src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c | 15 +- src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c | 18 +- .../drivers/dri/r300/compiler/radeon_dataflow.c | 74 ----- .../drivers/dri/r300/compiler/radeon_dataflow.h | 69 +--- .../dri/r300/compiler/radeon_dataflow_annotate.c | 365 --------------------- .../dri/r300/compiler/radeon_dataflow_deadcode.c | 253 ++++++++++++++ .../dri/r300/compiler/radeon_dataflow_dealias.c | 150 --------- .../dri/r300/compiler/radeon_dataflow_swizzles.c | 24 -- .../drivers/dri/r300/compiler/radeon_opcodes.c | 78 +++++ .../drivers/dri/r300/compiler/radeon_opcodes.h | 20 ++ .../drivers/dri/r300/compiler/radeon_program.c | 19 +- .../drivers/dri/r300/compiler/radeon_program.h | 71 ++-- .../dri/r300/compiler/radeon_program_print.c | 48 +-- 14 files changed, 431 insertions(+), 776 deletions(-) delete mode 100644 src/mesa/drivers/dri/r300/compiler/radeon_dataflow_annotate.c create mode 100644 src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c delete mode 100644 src/mesa/drivers/dri/r300/compiler/radeon_dataflow_dealias.c (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/Makefile b/src/mesa/drivers/dri/r300/compiler/Makefile index 53fb7caa95..0d8dcb9f87 100644 --- a/src/mesa/drivers/dri/r300/compiler/Makefile +++ b/src/mesa/drivers/dri/r300/compiler/Makefile @@ -14,8 +14,7 @@ C_SOURCES = \ radeon_program_alu.c \ radeon_program_pair.c \ radeon_dataflow.c \ - radeon_dataflow_annotate.c \ - radeon_dataflow_dealias.c \ + radeon_dataflow_deadcode.c \ radeon_dataflow_swizzles.c \ r3xx_fragprog.c \ r300_fragprog.c \ diff --git a/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c b/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c index bf9bea685a..590201a9ba 100644 --- a/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c @@ -24,6 +24,7 @@ #include +#include "radeon_dataflow.h" #include "radeon_program_alu.h" #include "r300_fragprog.h" #include "r300_fragprog_swizzle.h" @@ -107,17 +108,23 @@ void r3xx_compile_fragment_program(struct r300_fragment_program_compiler* c) if (c->Base.Debug) { fprintf(stderr, "Fragment Program: After native rewrite:\n"); - rc_print_program(&c->Base.Program, 0); + rc_print_program(&c->Base.Program); + fflush(stderr); + } + + rc_dataflow_deadcode(&c->Base, &dataflow_outputs_mark_use, c); + + if (c->Base.Debug) { + fprintf(stderr, "Fragment Program: After deadcode:\n"); + rc_print_program(&c->Base.Program); fflush(stderr); } - rc_dataflow_annotate(&c->Base, &dataflow_outputs_mark_use, c); - rc_dataflow_dealias(&c->Base); rc_dataflow_swizzles(&c->Base); if (c->Base.Debug) { fprintf(stderr, "Compiler: after dataflow passes:\n"); - rc_print_program(&c->Base.Program, 0); + rc_print_program(&c->Base.Program); fflush(stderr); } diff --git a/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c b/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c index ac72f8cbb6..e1e735568d 100644 --- a/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c @@ -588,7 +588,7 @@ void r3xx_compile_vertex_program(struct r300_vertex_program_compiler* compiler) if (compiler->Base.Debug) { fprintf(stderr, "Vertex program after native rewrite:\n"); - rc_print_program(&compiler->Base.Program, 0); + rc_print_program(&compiler->Base.Program); fflush(stderr); } @@ -605,21 +605,25 @@ void r3xx_compile_vertex_program(struct r300_vertex_program_compiler* compiler) if (compiler->Base.Debug) { fprintf(stderr, "Vertex program after source conflict resolve:\n"); - rc_print_program(&compiler->Base.Program, 0); + rc_print_program(&compiler->Base.Program); + fflush(stderr); + } + + rc_dataflow_deadcode(&compiler->Base, &dataflow_outputs_mark_used, compiler); + + if (compiler->Base.Debug) { + fprintf(stderr, "Vertex program after deadcode:\n"); + rc_print_program(&compiler->Base.Program); fflush(stderr); } - rc_dataflow_annotate(&compiler->Base, &dataflow_outputs_mark_used, compiler); - rc_dataflow_dealias(&compiler->Base); rc_dataflow_swizzles(&compiler->Base); - /* This invalidates dataflow annotations and should be replaced - * by a future generic register allocation pass. */ allocate_temporary_registers(compiler); if (compiler->Base.Debug) { fprintf(stderr, "Vertex program after dataflow:\n"); - rc_print_program(&compiler->Base.Program, 0); + rc_print_program(&compiler->Base.Program); fflush(stderr); } diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c index af6777a7bd..a171d8ab54 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c @@ -30,77 +30,3 @@ #include "radeon_compiler.h" -static void add_ref_to_vector(struct rc_dataflow_ref * ref, struct rc_dataflow_vector * vector) -{ - ref->Vector = vector; - ref->Prev = &vector->Refs; - ref->Next = vector->Refs.Next; - ref->Prev->Next = ref; - ref->Next->Prev = ref; -} - -struct rc_dataflow_ref * rc_dataflow_create_ref(struct radeon_compiler * c, - struct rc_dataflow_vector * vector, struct rc_instruction * inst) -{ - struct rc_dataflow_ref * ref = memory_pool_malloc(&c->Pool, sizeof(struct rc_dataflow_ref)); - ref->ReadInstruction = inst; - ref->UseMask = 0; - - add_ref_to_vector(ref, vector); - - return ref; -} - -struct rc_dataflow_vector * rc_dataflow_create_vector(struct radeon_compiler * c, - rc_register_file file, unsigned int index, struct rc_instruction * inst) -{ - struct rc_dataflow_vector * vec = memory_pool_malloc(&c->Pool, sizeof(struct rc_dataflow_vector)); - - memset(vec, 0, sizeof(struct rc_dataflow_vector)); - vec->File = file; - vec->Index = index; - vec->WriteInstruction = inst; - - vec->Refs.Next = vec->Refs.Prev = &vec->Refs; - - return vec; -} - -void rc_dataflow_remove_ref(struct rc_dataflow_ref * ref) -{ - ref->Prev->Next = ref->Next; - ref->Next->Prev = ref->Prev; -} - -void rc_dataflow_remove_instruction(struct rc_instruction * inst) -{ - for(unsigned int i = 0; i < 3; ++i) { - if (inst->Dataflow.SrcReg[i]) { - rc_dataflow_remove_ref(inst->Dataflow.SrcReg[i]); - inst->Dataflow.SrcReg[i] = 0; - } - if (inst->Dataflow.SrcRegAddress[i]) { - rc_dataflow_remove_ref(inst->Dataflow.SrcRegAddress[i]); - inst->Dataflow.SrcRegAddress[i] = 0; - } - } - - if (inst->Dataflow.DstReg) { - while(inst->Dataflow.DstReg->Refs.Next != &inst->Dataflow.DstReg->Refs) { - struct rc_dataflow_ref * ref = inst->Dataflow.DstReg->Refs.Next; - rc_dataflow_remove_ref(ref); - if (inst->Dataflow.DstRegPrev) - add_ref_to_vector(ref, inst->Dataflow.DstRegPrev->Vector); - } - - inst->Dataflow.DstReg->WriteInstruction = 0; - inst->Dataflow.DstReg = 0; - } - - if (inst->Dataflow.DstRegPrev) { - rc_dataflow_remove_ref(inst->Dataflow.DstRegPrev); - inst->Dataflow.DstRegPrev = 0; - } - - inst->Dataflow.DstRegAliased = 0; -} diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.h b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.h index c9856affe8..76c323d057 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.h @@ -34,79 +34,14 @@ struct radeon_compiler; struct rc_instruction; struct rc_swizzle_caps; -struct rc_dataflow_vector; - -struct rc_dataflow_ref { - struct rc_dataflow_vector * Vector; - - /** - * Linked list of references to the above-mentioned vector. - * The linked list is \em not sorted. - */ - /*@{*/ - struct rc_dataflow_ref * Prev; - struct rc_dataflow_ref * Next; - /*@}*/ - - unsigned int UseMask:4; - struct rc_instruction * ReadInstruction; -}; - -struct rc_dataflow_vector { - rc_register_file File:3; - unsigned int Index:RC_REGISTER_INDEX_BITS; - - /** For private use in compiler passes. MUST BE RESET TO 0 by the end of each pass. - * The annotate pass uses this bit to track whether a vector is in the - * update stack. - */ - unsigned int PassBit:1; - /** Which of the components have been written with useful values */ - unsigned int ValidMask:4; - /** Which of the components are used downstream */ - unsigned int UseMask:4; - /** The instruction that produced this vector */ - struct rc_instruction * WriteInstruction; - - /** Linked list of references to this vector */ - struct rc_dataflow_ref Refs; -}; - -struct rc_instruction_dataflow { - struct rc_dataflow_ref * SrcReg[3]; - struct rc_dataflow_ref * SrcRegAddress[3]; - - /** Reference the components of the destination register - * that are carried over without being overwritten */ - struct rc_dataflow_ref * DstRegPrev; - /** Indicates whether the destination register was in use - * before this instruction */ - unsigned int DstRegAliased:1; - struct rc_dataflow_vector * DstReg; -}; - -/** - * General functions for manipulating the dataflow structures. - */ -/*@{*/ -struct rc_dataflow_ref * rc_dataflow_create_ref(struct radeon_compiler * c, - struct rc_dataflow_vector * vector, struct rc_instruction * inst); -struct rc_dataflow_vector * rc_dataflow_create_vector(struct radeon_compiler * c, - rc_register_file file, unsigned int index, struct rc_instruction * inst); -void rc_dataflow_remove_ref(struct rc_dataflow_ref * ref); - -void rc_dataflow_remove_instruction(struct rc_instruction * inst); -/*@}*/ - /** - * Compiler passes based on dataflow structures. + * Compiler passes based on dataflow analysis. */ /*@{*/ typedef void (*rc_dataflow_mark_outputs_fn)(void * userdata, void * data, void (*mark_fn)(void * data, unsigned int index, unsigned int mask)); -void rc_dataflow_annotate(struct radeon_compiler * c, rc_dataflow_mark_outputs_fn dce, void * userdata); -void rc_dataflow_dealias(struct radeon_compiler * c); +void rc_dataflow_deadcode(struct radeon_compiler * c, rc_dataflow_mark_outputs_fn dce, void * userdata); void rc_dataflow_swizzles(struct radeon_compiler * c); /*@}*/ diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_annotate.c b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_annotate.c deleted file mode 100644 index 41d175a22f..0000000000 --- a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_annotate.c +++ /dev/null @@ -1,365 +0,0 @@ -/* - * Copyright (C) 2009 Nicolai Haehnle. - * - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 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. - * - */ - -#include "radeon_dataflow.h" - -#include "radeon_compiler.h" - - -struct dataflow_state { - struct radeon_compiler * C; - unsigned int DCE:1; - unsigned int UpdateRunning:1; - - struct rc_dataflow_vector * Input[RC_REGISTER_MAX_INDEX]; - struct rc_dataflow_vector * Output[RC_REGISTER_MAX_INDEX]; - struct rc_dataflow_vector * Temporary[RC_REGISTER_MAX_INDEX]; - struct rc_dataflow_vector * Address; - - struct rc_dataflow_vector ** UpdateStack; - unsigned int UpdateStackSize; - unsigned int UpdateStackReserved; -}; - -static void mark_vector_use(struct dataflow_state * s, struct rc_dataflow_vector * vector, unsigned int mask); - -static struct rc_dataflow_vector * get_register_contents(struct dataflow_state * s, - rc_register_file file, unsigned int index) -{ - if (file == RC_FILE_INPUT || file == RC_FILE_OUTPUT || file == RC_FILE_TEMPORARY) { - if (index >= RC_REGISTER_MAX_INDEX) - return 0; /* cannot happen, but be defensive */ - - if (file == RC_FILE_TEMPORARY) - return s->Temporary[index]; - if (file == RC_FILE_INPUT) - return s->Input[index]; - if (file == RC_FILE_OUTPUT) - return s->Output[index]; - } - - if (file == RC_FILE_ADDRESS) - return s->Address; - - return 0; /* can happen, constant register file */ -} - -static void mark_ref_use(struct dataflow_state * s, struct rc_dataflow_ref * ref, unsigned int mask) -{ - if (!(mask & ~ref->UseMask)) - return; - - ref->UseMask |= mask; - mark_vector_use(s, ref->Vector, ref->UseMask); -} - -static void mark_source_use(struct dataflow_state * s, struct rc_instruction * inst, - unsigned int src, unsigned int srcmask) -{ - unsigned int refmask = 0; - - for(unsigned int i = 0; i < 4; ++i) { - if (GET_BIT(srcmask, i)) - refmask |= 1 << GET_SWZ(inst->I.SrcReg[src].Swizzle, i); - } - - /* get rid of spurious bits from ZERO, ONE, etc. swizzles */ - refmask &= RC_MASK_XYZW; - - if (!refmask) - return; /* can happen if the swizzle contains constant components */ - - if (inst->Dataflow.SrcReg[src]) - mark_ref_use(s, inst->Dataflow.SrcReg[src], refmask); - - if (inst->Dataflow.SrcRegAddress[src]) - mark_ref_use(s, inst->Dataflow.SrcRegAddress[src], RC_MASK_X); -} - -static void compute_sources_for_writemask( - struct rc_instruction * inst, - unsigned int writemask, - unsigned int *srcmasks) -{ - const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); - - srcmasks[0] = 0; - srcmasks[1] = 0; - srcmasks[2] = 0; - - if (inst->I.Opcode == RC_OPCODE_KIL) - srcmasks[0] |= RC_MASK_XYZW; - - if (!writemask) - return; - - if (opcode->IsComponentwise) { - for(unsigned int src = 0; src < opcode->NumSrcRegs; ++src) - srcmasks[src] |= writemask; - } else if (opcode->IsStandardScalar) { - for(unsigned int src = 0; src < opcode->NumSrcRegs; ++src) - srcmasks[src] |= RC_MASK_X; - } else { - switch(inst->I.Opcode) { - case RC_OPCODE_ARL: - srcmasks[0] |= RC_MASK_X; - break; - case RC_OPCODE_DP3: - srcmasks[0] |= RC_MASK_XYZ; - srcmasks[1] |= RC_MASK_XYZ; - break; - case RC_OPCODE_DP4: - srcmasks[0] |= RC_MASK_XYZW; - srcmasks[1] |= RC_MASK_XYZW; - break; - case RC_OPCODE_TEX: - case RC_OPCODE_TXB: - case RC_OPCODE_TXP: - srcmasks[0] |= RC_MASK_XYZW; - break; - case RC_OPCODE_DST: - srcmasks[0] |= 0x6; - srcmasks[1] |= 0xa; - break; - case RC_OPCODE_EXP: - case RC_OPCODE_LOG: - srcmasks[0] |= RC_MASK_XY; - break; - case RC_OPCODE_LIT: - srcmasks[0] |= 0xb; - break; - default: - break; - } - } -} - -static void mark_instruction_source_use(struct dataflow_state * s, - struct rc_instruction * inst, unsigned int writemask) -{ - unsigned int srcmasks[3]; - - compute_sources_for_writemask(inst, writemask, srcmasks); - - for(unsigned int src = 0; src < 3; ++src) - mark_source_use(s, inst, src, srcmasks[src]); -} - -static void run_update(struct dataflow_state * s) -{ - s->UpdateRunning = 1; - - while(s->UpdateStackSize) { - struct rc_dataflow_vector * vector = s->UpdateStack[--s->UpdateStackSize]; - vector->PassBit = 0; - - if (vector->WriteInstruction) { - struct rc_instruction * inst = vector->WriteInstruction; - - if (inst->Dataflow.DstRegPrev) { - unsigned int carryover = vector->UseMask & ~inst->I.DstReg.WriteMask; - - if (carryover) - mark_ref_use(s, inst->Dataflow.DstRegPrev, carryover); - } - - mark_instruction_source_use( - s, vector->WriteInstruction, - vector->UseMask & inst->I.DstReg.WriteMask); - } - } - - s->UpdateRunning = 0; -} - -static void mark_vector_use(struct dataflow_state * s, struct rc_dataflow_vector * vector, unsigned int mask) -{ - if (!(mask & ~vector->UseMask)) - return; /* no new used bits */ - - vector->UseMask |= mask; - if (vector->PassBit) - return; - - if (s->UpdateStackSize >= s->UpdateStackReserved) { - unsigned int new_reserve = 2 * s->UpdateStackReserved; - struct rc_dataflow_vector ** new_stack; - - if (!new_reserve) - new_reserve = 16; - - new_stack = memory_pool_malloc(&s->C->Pool, new_reserve * sizeof(struct rc_dataflow_vector *)); - memcpy(new_stack, s->UpdateStack, s->UpdateStackSize * sizeof(struct rc_dataflow_vector *)); - - s->UpdateStack = new_stack; - s->UpdateStackReserved = new_reserve; - } - - s->UpdateStack[s->UpdateStackSize++] = vector; - vector->PassBit = 1; - - if (!s->UpdateRunning) - run_update(s); -} - -static void annotate_instruction(struct dataflow_state * s, struct rc_instruction * inst) -{ - const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); - unsigned int src; - - for(src = 0; src < opcode->NumSrcRegs; ++src) { - struct rc_dataflow_vector * vector = get_register_contents(s, inst->I.SrcReg[src].File, inst->I.SrcReg[src].Index); - if (vector) { - inst->Dataflow.SrcReg[src] = rc_dataflow_create_ref(s->C, vector, inst); - } - if (inst->I.SrcReg[src].RelAddr) { - struct rc_dataflow_vector * addr = get_register_contents(s, RC_FILE_ADDRESS, 0); - if (addr) - inst->Dataflow.SrcRegAddress[src] = rc_dataflow_create_ref(s->C, addr, inst); - } - } - - mark_instruction_source_use(s, inst, 0); /* for KIL */ - - if (opcode->HasDstReg) { - struct rc_dataflow_vector * oldvec = get_register_contents(s, inst->I.DstReg.File, inst->I.DstReg.Index); - struct rc_dataflow_vector * newvec = rc_dataflow_create_vector(s->C, inst->I.DstReg.File, inst->I.DstReg.Index, inst); - - newvec->ValidMask = inst->I.DstReg.WriteMask; - - if (oldvec) { - unsigned int carryover = oldvec->ValidMask & ~inst->I.DstReg.WriteMask; - - if (oldvec->ValidMask) - inst->Dataflow.DstRegAliased = 1; - - if (carryover) { - inst->Dataflow.DstRegPrev = rc_dataflow_create_ref(s->C, oldvec, inst); - newvec->ValidMask |= carryover; - - if (!s->DCE) - mark_ref_use(s, inst->Dataflow.DstRegPrev, carryover); - } - } - - inst->Dataflow.DstReg = newvec; - - if (newvec->File == RC_FILE_TEMPORARY) - s->Temporary[newvec->Index] = newvec; - else if (newvec->File == RC_FILE_OUTPUT) - s->Output[newvec->Index] = newvec; - else - s->Address = newvec; - - if (!s->DCE) - mark_vector_use(s, newvec, inst->I.DstReg.WriteMask); - } -} - -static void init_inputs(struct dataflow_state * s) -{ - unsigned int index; - - for(index = 0; index < 32; ++index) { - if (s->C->Program.InputsRead & (1 << index)) { - s->Input[index] = rc_dataflow_create_vector(s->C, RC_FILE_INPUT, index, 0); - s->Input[index]->ValidMask = RC_MASK_XYZW; - } - } -} - -static void mark_output_use(void * data, unsigned int index, unsigned int mask) -{ - struct dataflow_state * s = data; - struct rc_dataflow_vector * vec = s->Output[index]; - - if (vec) - mark_vector_use(s, vec, mask); -} - -void rc_dataflow_annotate(struct radeon_compiler * c, rc_dataflow_mark_outputs_fn dce, void * userdata) -{ - struct dataflow_state s; - struct rc_instruction * inst; - - memset(&s, 0, sizeof(s)); - s.C = c; - s.DCE = dce ? 1 : 0; - - init_inputs(&s); - - for(inst = c->Program.Instructions.Next; inst != &c->Program.Instructions; inst = inst->Next) { - annotate_instruction(&s, inst); - } - - if (s.DCE) { - dce(userdata, &s, &mark_output_use); - - for(inst = c->Program.Instructions.Next; inst != &c->Program.Instructions; inst = inst->Next) { - const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); - - if (opcode->HasDstReg) { - unsigned int redundant_writes = inst->I.DstReg.WriteMask & ~inst->Dataflow.DstReg->UseMask; - - inst->I.DstReg.WriteMask &= ~redundant_writes; - - if (!inst->I.DstReg.WriteMask) { - struct rc_instruction * todelete = inst; - inst = inst->Prev; - rc_remove_instruction(todelete); - continue; - } - } - - unsigned int srcmasks[3]; - compute_sources_for_writemask(inst, inst->I.DstReg.WriteMask, srcmasks); - - for(unsigned int src = 0; src < 3; ++src) { - for(unsigned int chan = 0; chan < 4; ++chan) { - if (!GET_BIT(srcmasks[src], chan)) - SET_SWZ(inst->I.SrcReg[src].Swizzle, chan, RC_SWIZZLE_UNUSED); - } - - if (inst->Dataflow.SrcReg[src]) { - if (!inst->Dataflow.SrcReg[src]->UseMask) { - rc_dataflow_remove_ref(inst->Dataflow.SrcReg[src]); - inst->Dataflow.SrcReg[src] = 0; - } - } - - if (inst->Dataflow.SrcRegAddress[src]) { - if (!inst->Dataflow.SrcRegAddress[src]->UseMask) { - rc_dataflow_remove_ref(inst->Dataflow.SrcRegAddress[src]); - inst->Dataflow.SrcRegAddress[src] = 0; - } - } - } - } - - rc_calculate_inputs_outputs(c); - } -} diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c new file mode 100644 index 0000000000..95af6fd411 --- /dev/null +++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c @@ -0,0 +1,253 @@ +/* + * Copyright (C) 2009 Nicolai Haehnle. + * + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 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. + * + */ + +#include "radeon_dataflow.h" + +#include "radeon_compiler.h" + + +struct updatemask_state { + unsigned char Output[RC_REGISTER_MAX_INDEX]; + unsigned char Temporary[RC_REGISTER_MAX_INDEX]; + unsigned char Address; +}; + +struct instruction_state { + unsigned char WriteMask; + unsigned char SrcReg[3]; +}; + +struct branchinfo { + unsigned int HaveElse:1; + + struct updatemask_state StoreEndif; + struct updatemask_state StoreElse; +}; + +struct deadcode_state { + struct radeon_compiler * C; + struct instruction_state * Instructions; + + struct updatemask_state R; + + struct branchinfo * BranchStack; + unsigned int BranchStackSize; + unsigned int BranchStackReserved; +}; + + +static void or_updatemasks( + struct updatemask_state * dst, + struct updatemask_state * a, + struct updatemask_state * b) +{ + for(unsigned int i = 0; i < RC_REGISTER_MAX_INDEX; ++i) { + dst->Output[i] = a->Output[i] | b->Output[i]; + dst->Temporary[i] = a->Temporary[i] | b->Temporary[i]; + } + + dst->Address = a->Address | b->Address; +} + +static void push_branch(struct deadcode_state * s) +{ + if (s->BranchStackSize >= s->BranchStackReserved) { + unsigned int new_reserve = 2 * s->BranchStackReserved; + struct branchinfo * new_stack; + + if (!new_reserve) + new_reserve = 4; + + new_stack = memory_pool_malloc(&s->C->Pool, new_reserve * sizeof(struct branchinfo)); + memcpy(new_stack, s->BranchStack, s->BranchStackSize * sizeof(struct branchinfo)); + + s->BranchStack = new_stack; + s->BranchStackReserved = new_reserve; + } + + struct branchinfo * branch = &s->BranchStack[s->BranchStackSize++]; + branch->HaveElse = 0; + memcpy(&branch->StoreEndif, &s->R, sizeof(s->R)); +} + +static unsigned char * get_used_ptr(struct deadcode_state *s, rc_register_file file, unsigned int index) +{ + if (file == RC_FILE_OUTPUT || file == RC_FILE_TEMPORARY) { + if (index >= RC_REGISTER_MAX_INDEX) { + rc_error(s->C, "%s: index %i is out of bounds for file %i\n", __FUNCTION__, index, file); + return 0; + } + + if (file == RC_FILE_OUTPUT) + return &s->R.Output[index]; + else + return &s->R.Temporary[index]; + } else if (file == RC_FILE_ADDRESS) { + return &s->R.Address; + } + + return 0; +} + +static void mark_used(struct deadcode_state * s, rc_register_file file, unsigned int index, unsigned int mask) +{ + unsigned char * pused = get_used_ptr(s, file, index); + if (pused) + *pused |= mask; +} + +static void update_instruction(struct deadcode_state * s, struct rc_instruction * inst) +{ + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); + struct instruction_state * insts = &s->Instructions[inst->IP]; + unsigned int usedmask = 0; + + if (opcode->HasDstReg) { + unsigned char * pused = get_used_ptr(s, inst->I.DstReg.File, inst->I.DstReg.Index); + if (pused) { + usedmask = *pused & inst->I.DstReg.WriteMask; + *pused &= ~usedmask; + } + } + + insts->WriteMask |= usedmask; + + unsigned int srcmasks[3]; + rc_compute_sources_for_writemask(opcode, usedmask, srcmasks); + + for(unsigned int src = 0; src < opcode->NumSrcRegs; ++src) { + unsigned int refmask = 0; + unsigned int newsrcmask = srcmasks[src] & ~insts->SrcReg[src]; + insts->SrcReg[src] |= newsrcmask; + + for(unsigned int chan = 0; chan < 4; ++chan) { + if (GET_BIT(newsrcmask, chan)) + refmask |= 1 << GET_SWZ(inst->I.SrcReg[src].Swizzle, chan); + } + + /* get rid of spurious bits from ZERO, ONE, etc. swizzles */ + refmask &= RC_MASK_XYZW; + + if (!refmask) + continue; + + mark_used(s, inst->I.SrcReg[src].File, inst->I.SrcReg[src].Index, refmask); + + if (inst->I.SrcReg[src].RelAddr) + mark_used(s, RC_FILE_ADDRESS, 0, RC_MASK_X); + } +} + +static void mark_output_use(void * data, unsigned int index, unsigned int mask) +{ + struct deadcode_state * s = data; + + mark_used(s, RC_FILE_OUTPUT, index, mask); +} + +void rc_dataflow_deadcode(struct radeon_compiler * c, rc_dataflow_mark_outputs_fn dce, void * userdata) +{ + struct deadcode_state s; + unsigned int nr_instructions; + + memset(&s, 0, sizeof(s)); + s.C = c; + + nr_instructions = rc_recompute_ips(c); + s.Instructions = memory_pool_malloc(&c->Pool, sizeof(struct instruction_state)*nr_instructions); + memset(s.Instructions, 0, sizeof(struct instruction_state)*nr_instructions); + + dce(userdata, &s, &mark_output_use); + + for(struct rc_instruction * inst = c->Program.Instructions.Prev; + inst != &c->Program.Instructions; + inst = inst->Prev) { + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); + + if (opcode->IsControlFlow) { + if (opcode->Opcode == RC_OPCODE_ENDIF) { + push_branch(&s); + } else { + if (s.BranchStackSize) { + struct branchinfo * branch = &s.BranchStack[s.BranchStackSize-1]; + + if (opcode->Opcode == RC_OPCODE_IF) { + or_updatemasks(&s.R, + &s.R, + branch->HaveElse ? &branch->StoreElse : &branch->StoreEndif); + + s.BranchStackSize--; + } else if (opcode->Opcode == RC_OPCODE_ELSE) { + if (branch->HaveElse) { + rc_error(c, "%s: Multiple ELSE for one IF/ENDIF\n", __FUNCTION__); + } else { + memcpy(&branch->StoreElse, &s.R, sizeof(s.R)); + memcpy(&s.R, &branch->StoreEndif, sizeof(s.R)); + branch->HaveElse = 1; + } + } else { + rc_error(c, "%s: Unhandled control flow instruction %s\n", __FUNCTION__, opcode->Name); + } + } else { + rc_error(c, "%s: Unexpected control flow instruction\n", __FUNCTION__); + } + } + } + + update_instruction(&s, inst); + } + + unsigned int ip = 0; + for(struct rc_instruction * inst = c->Program.Instructions.Next; + inst != &c->Program.Instructions; + inst = inst->Next, ++ip) { + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); + + if (opcode->HasDstReg) { + if (s.Instructions[ip].WriteMask) { + inst->I.DstReg.WriteMask = s.Instructions[ip].WriteMask; + } else { + struct rc_instruction * todelete = inst; + inst = inst->Prev; + rc_remove_instruction(todelete); + continue; + } + } + + unsigned int srcmasks[3]; + rc_compute_sources_for_writemask(opcode, s.Instructions[ip].WriteMask, srcmasks); + + for(unsigned int src = 0; src < 3; ++src) { + for(unsigned int chan = 0; chan < 4; ++chan) { + if (!GET_BIT(srcmasks[src], chan)) + SET_SWZ(inst->I.SrcReg[src].Swizzle, chan, RC_SWIZZLE_UNUSED); + } + } + } + + rc_calculate_inputs_outputs(c); +} diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_dealias.c b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_dealias.c deleted file mode 100644 index 4596636970..0000000000 --- a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_dealias.c +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (C) 2009 Nicolai Haehnle. - * - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sublicense, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial - * portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. - * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE - * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 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. - * - */ - -#include "radeon_dataflow.h" - -#include "radeon_compiler.h" - - -#define DEALIAS_LIST_SIZE 128 - -struct dealias_state { - struct radeon_compiler * C; - - unsigned int OldIndex:RC_REGISTER_INDEX_BITS; - unsigned int NewIndex:RC_REGISTER_INDEX_BITS; - unsigned int DealiasFail:1; - - struct rc_dataflow_vector * List[DEALIAS_LIST_SIZE]; - unsigned int Length; -}; - -static void push_dealias_vector(struct dealias_state * s, struct rc_dataflow_vector * vec) -{ - if (s->Length >= DEALIAS_LIST_SIZE) { - rc_debug(s->C, "%s: list size exceeded\n", __FUNCTION__); - s->DealiasFail = 1; - return; - } - - if (rc_assert(s->C, vec->File == RC_FILE_TEMPORARY && vec->Index == s->OldIndex)) - return; - - s->List[s->Length++] = vec; -} - -static void run_dealias(struct dealias_state * s) -{ - unsigned int i; - - for(i = 0; i < s->Length && !s->DealiasFail; ++i) { - struct rc_dataflow_vector * vec = s->List[i]; - struct rc_dataflow_ref * ref; - - for(ref = vec->Refs.Next; ref != &vec->Refs; ref = ref->Next) { - if (ref->ReadInstruction->Dataflow.DstRegPrev == ref) - push_dealias_vector(s, ref->ReadInstruction->Dataflow.DstReg); - } - } - - if (s->DealiasFail) - return; - - for(i = 0; i < s->Length; ++i) { - struct rc_dataflow_vector * vec = s->List[i]; - struct rc_dataflow_ref * ref; - - vec->Index = s->NewIndex; - vec->WriteInstruction->I.DstReg.Index = s->NewIndex; - - for(ref = vec->Refs.Next; ref != &vec->Refs; ref = ref->Next) { - struct rc_instruction * inst = ref->ReadInstruction; - unsigned int i; - - for(i = 0; i < 3; ++i) { - if (inst->Dataflow.SrcReg[i] == ref) { - if (rc_assert(s->C, inst->I.SrcReg[i].File == RC_FILE_TEMPORARY && - inst->I.SrcReg[i].Index == s->OldIndex)) - return; - - inst->I.SrcReg[i].Index = s->NewIndex; - } - } - } - } -} - -/** - * Breaks register aliasing to reduce multiple assignments to a single register. - * - * This affects sequences like: - * MUL r0, ...; - * MAD r0, r1, r2, r0; - * In this example, a new register will be used for the destination of the - * second MAD. - * - * The purpose of this dealiasing is to make the resulting code more SSA-like - * and therefore make it easier to move instructions around. - * This is of crucial importance for R300 fragment programs, where de-aliasing - * can help to reduce texture indirections, but other targets can benefit from - * it as well. - * - * \note When compiling GLSL, there may be some benefit gained from breaking - * up vectors whose components are unrelated. This is not done yet and should - * be investigated at some point (of course, a matching pass to re-merge - * components would be required). - */ -void rc_dataflow_dealias(struct radeon_compiler * c) -{ - struct dealias_state s; - - memset(&s, 0, sizeof(s)); - s.C = c; - - struct rc_instruction * inst; - for(inst = c->Program.Instructions.Prev; inst != &c->Program.Instructions; inst = inst->Prev) { - if (!inst->Dataflow.DstRegAliased || inst->Dataflow.DstReg->File != RC_FILE_TEMPORARY) - continue; - - if (inst->Dataflow.DstReg->UseMask & ~inst->I.DstReg.WriteMask) - continue; - - s.OldIndex = inst->I.DstReg.Index; - s.NewIndex = rc_find_free_temporary(c); - s.DealiasFail = 0; - s.Length = 0; - - inst->Dataflow.DstRegAliased = 0; - if (inst->Dataflow.DstRegPrev) { - rc_dataflow_remove_ref(inst->Dataflow.DstRegPrev); - inst->Dataflow.DstRegPrev = 0; - } - - push_dealias_vector(&s, inst->Dataflow.DstReg); - run_dealias(&s); - } -} diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_swizzles.c b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_swizzles.c index 1aa91eff7c..fcef218b59 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_swizzles.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_swizzles.c @@ -37,8 +37,6 @@ static void rewrite_source(struct radeon_compiler * c, struct rc_swizzle_split split; unsigned int tempreg = rc_find_free_temporary(c); unsigned int usemask; - struct rc_dataflow_ref * oldref = inst->Dataflow.SrcReg[src]; - struct rc_dataflow_vector * vector = 0; usemask = 0; for(unsigned int chan = 0; chan < 4; ++chan) { @@ -75,30 +73,8 @@ static void rewrite_source(struct radeon_compiler * c, else if (masked_negate == split.Phase[phase]) mov->I.SrcReg[0].Negate = RC_MASK_XYZW; - if (oldref) { - mov->Dataflow.SrcReg[0] = rc_dataflow_create_ref(c, oldref->Vector, mov); - mov->Dataflow.SrcReg[0]->UseMask = phase_refmask; - } - - mov->Dataflow.DstReg = rc_dataflow_create_vector(c, RC_FILE_TEMPORARY, tempreg, mov); - mov->Dataflow.DstReg->ValidMask = split.Phase[phase]; - - if (vector) { - mov->Dataflow.DstRegPrev = rc_dataflow_create_ref(c, vector, mov); - mov->Dataflow.DstRegPrev->UseMask = vector->ValidMask; - mov->Dataflow.DstReg->ValidMask |= vector->ValidMask; - mov->Dataflow.DstRegAliased = 1; - } - - mov->Dataflow.DstReg->UseMask = mov->Dataflow.DstReg->ValidMask; - vector = mov->Dataflow.DstReg; } - if (oldref) - rc_dataflow_remove_ref(oldref); - inst->Dataflow.SrcReg[src] = rc_dataflow_create_ref(c, vector, inst); - inst->Dataflow.SrcReg[src]->UseMask = usemask; - inst->I.SrcReg[src].File = RC_FILE_TEMPORARY; inst->I.SrcReg[src].Index = tempreg; inst->I.SrcReg[src].Swizzle = 0; diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c index b7200990c2..e097a62b55 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c @@ -27,6 +27,8 @@ #include "radeon_opcodes.h" +#include "radeon_program_constants.h" + struct rc_opcode_info rc_opcodes[MAX_RC_OPCODE] = { { .Opcode = RC_OPCODE_NOP, @@ -339,9 +341,85 @@ struct rc_opcode_info rc_opcodes[MAX_RC_OPCODE] = { .NumSrcRegs = 1, .HasDstReg = 1 }, + { + .Opcode = RC_OPCODE_IF, + .Name = "IF", + .IsControlFlow = 1, + .NumSrcRegs = 1 + }, + { + .Opcode = RC_OPCODE_ELSE, + .Name = "ELSE", + .IsControlFlow = 1, + .NumSrcRegs = 0 + }, + { + .Opcode = RC_OPCODE_ENDIF, + .Name = "ENDIF", + .IsControlFlow = 1, + .NumSrcRegs = 0 + }, { .Opcode = RC_OPCODE_REPL_ALPHA, .Name = "REPL_ALPHA", .HasDstReg = 1 } }; + +void rc_compute_sources_for_writemask( + const struct rc_opcode_info * opcode, + unsigned int writemask, + unsigned int *srcmasks) +{ + srcmasks[0] = 0; + srcmasks[1] = 0; + srcmasks[2] = 0; + + if (opcode->Opcode == RC_OPCODE_KIL) + srcmasks[0] |= RC_MASK_XYZW; + else if (opcode->Opcode == RC_OPCODE_IF) + srcmasks[0] |= RC_MASK_X; + + if (!writemask) + return; + + if (opcode->IsComponentwise) { + for(unsigned int src = 0; src < opcode->NumSrcRegs; ++src) + srcmasks[src] |= writemask; + } else if (opcode->IsStandardScalar) { + for(unsigned int src = 0; src < opcode->NumSrcRegs; ++src) + srcmasks[src] |= RC_MASK_X; + } else { + switch(opcode->Opcode) { + case RC_OPCODE_ARL: + srcmasks[0] |= RC_MASK_X; + break; + case RC_OPCODE_DP3: + srcmasks[0] |= RC_MASK_XYZ; + srcmasks[1] |= RC_MASK_XYZ; + break; + case RC_OPCODE_DP4: + srcmasks[0] |= RC_MASK_XYZW; + srcmasks[1] |= RC_MASK_XYZW; + break; + case RC_OPCODE_TEX: + case RC_OPCODE_TXB: + case RC_OPCODE_TXP: + srcmasks[0] |= RC_MASK_XYZW; + break; + case RC_OPCODE_DST: + srcmasks[0] |= 0x6; + srcmasks[1] |= 0xa; + break; + case RC_OPCODE_EXP: + case RC_OPCODE_LOG: + srcmasks[0] |= RC_MASK_XY; + break; + case RC_OPCODE_LIT: + srcmasks[0] |= 0xb; + break; + default: + break; + } + } +} diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h index 8e30bef1e3..f8ba5255ca 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h @@ -166,6 +166,18 @@ typedef enum { RC_OPCODE_TXL, RC_OPCODE_TXP, + /** branch instruction: + * If src0.x != 0.0, continue with the next instruction; + * otherwise, jump to matching RC_OPCODE_ELSE or RC_OPCODE_ENDIF. + */ + RC_OPCODE_IF, + + /** branch instruction: jump to matching RC_OPCODE_ENDIF */ + RC_OPCODE_ELSE, + + /** branch instruction: has no effect */ + RC_OPCODE_ENDIF, + /** special instruction, used in R300-R500 fragment program pair instructions * indicates that the result of the alpha operation shall be replicated * across all other channels */ @@ -188,6 +200,9 @@ struct rc_opcode_info { unsigned int NumSrcRegs:2; unsigned int HasDstReg:1; + /** true if this instruction affects control flow */ + unsigned int IsControlFlow:1; + /** true if this is a vector instruction that operates on components in parallel * without any cross-component interaction */ unsigned int IsComponentwise:1; @@ -207,4 +222,9 @@ static inline const struct rc_opcode_info * rc_get_opcode_info(rc_opcode opcode) return &rc_opcodes[opcode]; } +void rc_compute_sources_for_writemask( + const struct rc_opcode_info * opcode, + unsigned int writemask, + unsigned int *srcmasks); + #endif /* RADEON_OPCODES_H */ diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program.c b/src/mesa/drivers/dri/r300/compiler/radeon_program.c index b97c48084b..a1ee7c0cab 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program.c @@ -154,7 +154,24 @@ struct rc_instruction *rc_insert_new_instruction(struct radeon_compiler * c, str void rc_remove_instruction(struct rc_instruction * inst) { - rc_dataflow_remove_instruction(inst); inst->Prev->Next = inst->Next; inst->Next->Prev = inst->Prev; } + +/** + * Return the number of instructions in the program. + */ +unsigned int rc_recompute_ips(struct radeon_compiler * c) +{ + unsigned int ip = 0; + + for(struct rc_instruction * inst = c->Program.Instructions.Next; + inst != &c->Program.Instructions; + inst = inst->Next) { + inst->IP = ip++; + } + + c->Program.Instructions.IP = 0xcafedead; + + return ip; +} diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program.h b/src/mesa/drivers/dri/r300/compiler/radeon_program.h index d38c9a420c..efa2b0dfe3 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program.h @@ -34,7 +34,6 @@ #include "radeon_opcodes.h" #include "radeon_code.h" #include "radeon_program_constants.h" -#include "radeon_dataflow.h" struct radeon_compiler; @@ -73,33 +72,33 @@ struct rc_dst_register { * instruction types may be valid. */ struct rc_sub_instruction { - struct rc_src_register SrcReg[3]; - struct rc_dst_register DstReg; - - /** - * Opcode of this instruction, according to \ref rc_opcode enums. - */ - rc_opcode Opcode:8; - - /** - * Saturate each value of the result to the range [0,1] or [-1,1], - * according to \ref rc_saturate_mode enums. - */ - rc_saturate_mode SaturateMode:2; - - /** - * \name Extra fields for TEX, TXB, TXD, TXL, TXP instructions. - */ - /*@{*/ - /** Source texture unit. */ - unsigned int TexSrcUnit:5; - - /** Source texture target, one of the \ref rc_texture_target enums */ - rc_texture_target TexSrcTarget:3; - - /** True if tex instruction should do shadow comparison */ - unsigned int TexShadow:1; - /*@}*/ + struct rc_src_register SrcReg[3]; + struct rc_dst_register DstReg; + + /** + * Opcode of this instruction, according to \ref rc_opcode enums. + */ + rc_opcode Opcode:8; + + /** + * Saturate each value of the result to the range [0,1] or [-1,1], + * according to \ref rc_saturate_mode enums. + */ + rc_saturate_mode SaturateMode:2; + + /** + * \name Extra fields for TEX, TXB, TXD, TXL, TXP instructions. + */ + /*@{*/ + /** Source texture unit. */ + unsigned int TexSrcUnit:5; + + /** Source texture target, one of the \ref rc_texture_target enums */ + rc_texture_target TexSrcTarget:3; + + /** True if tex instruction should do shadow comparison */ + unsigned int TexShadow:1; + /*@}*/ }; struct rc_instruction { @@ -109,13 +108,11 @@ struct rc_instruction { struct rc_sub_instruction I; /** - * Dataflow annotations. - * - * These are not supplied by the caller of the compiler, - * but filled in during compilation stages that make use of - * dataflow analysis. + * Warning: IPs are not stable. If you want to use them, + * you need to recompute them at the beginning of each pass + * using \ref rc_recompute_ips */ - struct rc_instruction_dataflow Dataflow; + unsigned int IP; }; struct rc_program { @@ -210,10 +207,8 @@ struct rc_instruction *rc_alloc_instruction(struct radeon_compiler * c); struct rc_instruction *rc_insert_new_instruction(struct radeon_compiler * c, struct rc_instruction * after); void rc_remove_instruction(struct rc_instruction * inst); -enum { - RC_PRINT_DATAFLOW = 0x1 -}; +unsigned int rc_recompute_ips(struct radeon_compiler * c); -void rc_print_program(const struct rc_program *prog, unsigned int flags); +void rc_print_program(const struct rc_program *prog); #endif diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_print.c b/src/mesa/drivers/dri/r300/compiler/radeon_program_print.c index 38060ea3ad..0485286451 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program_print.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_print.c @@ -24,11 +24,6 @@ #include -static void print_comment(FILE * f) -{ - fprintf(f, " # "); -} - static const char * textarget_to_string(rc_texture_target target) { switch(target) { @@ -121,19 +116,7 @@ static void rc_print_src_register(FILE * f, struct rc_src_register src) fprintf(f, "|"); } -static void rc_print_ref(FILE * f, struct rc_dataflow_ref * ref) -{ - fprintf(f, "ref(%p", ref->Vector); - - if (ref->UseMask != RC_MASK_XYZW) { - fprintf(f, "."); - rc_print_mask(f, ref->UseMask); - } - - fprintf(f, ")"); -} - -static void rc_print_instruction(FILE * f, unsigned int flags, struct rc_instruction * inst) +static void rc_print_instruction(FILE * f, struct rc_instruction * inst) { const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); unsigned int reg; @@ -169,45 +152,22 @@ static void rc_print_instruction(FILE * f, unsigned int flags, struct rc_instruc } fprintf(f, ";\n"); - - if (flags & RC_PRINT_DATAFLOW) { - print_comment(f); - - fprintf(f, "Dst = %p", inst->Dataflow.DstReg); - if (inst->Dataflow.DstRegAliased) - fprintf(f, " aliased"); - if (inst->Dataflow.DstRegPrev) { - fprintf(f, " from "); - rc_print_ref(f, inst->Dataflow.DstRegPrev); - } - - for(reg = 0; reg < opcode->NumSrcRegs; ++reg) { - fprintf(f, ", "); - if (inst->Dataflow.SrcReg[reg]) - rc_print_ref(f, inst->Dataflow.SrcReg[reg]); - else - fprintf(f, ""); - } - - fprintf(f, "\n"); - } } /** * Print program to stderr, default options. */ -void rc_print_program(const struct rc_program *prog, unsigned int flags) +void rc_print_program(const struct rc_program *prog) { unsigned int linenum = 0; struct rc_instruction *inst; - fprintf(stderr, "# Radeon Compiler Program%s\n", - flags & RC_PRINT_DATAFLOW ? " (with dataflow annotations)" : ""); + fprintf(stderr, "# Radeon Compiler Program\n"); for(inst = prog->Instructions.Next; inst != &prog->Instructions; inst = inst->Next) { fprintf(stderr, "%3d: ", linenum); - rc_print_instruction(stderr, flags, inst); + rc_print_instruction(stderr, inst); linenum++; } -- cgit v1.2.3 From 470ec8d42e1941c0ad773084693323f96a83e64d Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 2 Oct 2009 19:46:03 +0100 Subject: intel: Assert that relocation offsets are within the target This should catch the common programming error where we attempt to emit a relocation to beyond the end of the target buffer. Signed-off-by: Chris Wilson --- src/mesa/drivers/dri/intel/intel_batchbuffer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.h b/src/mesa/drivers/dri/intel/intel_batchbuffer.h index 51579df09e..9a619fbd5c 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.h +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.h @@ -157,7 +157,7 @@ intel_batchbuffer_require_space(struct intel_batchbuffer *batch, #define OUT_BATCH(d) intel_batchbuffer_emit_dword(intel->batch, d) #define OUT_RELOC(buf, read_domains, write_domain, delta) do { \ - assert((delta) >= 0); \ + assert((unsigned) (delta) <= buf->size); \ intel_batchbuffer_emit_reloc(intel->batch, buf, \ read_domains, write_domain, delta); \ } while (0) -- cgit v1.2.3 From f194d2737b059cf6b99caa18f8ec2d46a55ada88 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 3 Oct 2009 23:08:39 +0100 Subject: intel: Suppress a compiler warning for an pointer->int cast MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit intel_pixel_read.c: In function ‘do_blit_readpixels’: intel_pixel_read.c:221: warning: cast from pointer to integer of different size Cast via an intermediate (GLintptr) instead and hope the result fits within GLuint... [It should as we simply do not support textures *that* large!] Signed-off-by: Chris Wilson --- src/mesa/drivers/dri/intel/intel_pixel_read.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_pixel_read.c b/src/mesa/drivers/dri/intel/intel_pixel_read.c index bc67f6242a..44a8695286 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_read.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_read.c @@ -216,9 +216,8 @@ do_blit_readpixels(GLcontext * ctx, rowLength = -rowLength; } - /* XXX 64-bit cast? */ - dst_offset = (GLuint) _mesa_image_address(2, pack, pixels, width, height, - format, type, 0, 0, 0); + dst_offset = (GLintptr) _mesa_image_address(2, pack, pixels, width, height, + format, type, 0, 0, 0); /* Although the blits go on the command buffer, need to do this and -- cgit v1.2.3 From e6b137dcce58ca074458b184304573613917553f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= Date: Sun, 4 Oct 2009 11:13:09 +0200 Subject: r300/compiler: Introduce aluresult register for branch operation support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicolai Hähnle --- src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c | 3 +- src/mesa/drivers/dri/r300/compiler/r500_fragprog.c | 28 +++++++++ src/mesa/drivers/dri/r300/compiler/r500_fragprog.h | 5 ++ .../dri/r300/compiler/radeon_dataflow_deadcode.c | 66 ++++++++++++++++++---- .../drivers/dri/r300/compiler/radeon_program.h | 8 +++ .../dri/r300/compiler/radeon_program_constants.h | 21 ++++++- .../dri/r300/compiler/radeon_program_print.c | 38 ++++++++++++- 7 files changed, 154 insertions(+), 15 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c b/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c index 590201a9ba..614c2e3d24 100644 --- a/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c @@ -88,11 +88,12 @@ void r3xx_compile_fragment_program(struct r300_fragment_program_compiler* c) if (c->is_r500) { struct radeon_program_transformation transformations[] = { { &r500_transform_TEX, c }, + { &r500_transform_IF, 0 }, { &radeonTransformALU, 0 }, { &radeonTransformDeriv, 0 }, { &radeonTransformTrigScale, 0 } }; - radeonLocalTransform(&c->Base, 4, transformations); + radeonLocalTransform(&c->Base, 5, transformations); c->Base.SwizzleCaps = &r500_swizzle_caps; } else { diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c b/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c index 971465e359..39f2445bd4 100644 --- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c @@ -169,6 +169,34 @@ int r500_transform_TEX( return 1; } +/** + * Rewrite IF instructions to use the ALU result special register. + */ +int r500_transform_IF( + struct radeon_compiler * c, + struct rc_instruction * inst, + void* data) +{ + if (inst->I.Opcode != RC_OPCODE_IF) + return 0; + + struct rc_instruction * inst_mov = rc_insert_new_instruction(c, inst->Prev); + inst_mov->I.Opcode = RC_OPCODE_MOV; + inst_mov->I.DstReg.WriteMask = 0; + inst_mov->I.WriteALUResult = RC_ALURESULT_W; + inst_mov->I.ALUResultCompare = RC_COMPARE_FUNC_NOTEQUAL; + inst_mov->I.SrcReg[0] = inst->I.SrcReg[0]; + inst_mov->I.SrcReg[0].Swizzle = combine_swizzles4(inst_mov->I.SrcReg[0].Swizzle, + RC_SWIZZLE_UNUSED, RC_SWIZZLE_UNUSED, RC_SWIZZLE_UNUSED, RC_SWIZZLE_X); + + inst->I.SrcReg[0].File = RC_FILE_SPECIAL; + inst->I.SrcReg[0].Index = RC_SPECIAL_ALU_RESULT; + inst->I.SrcReg[0].Swizzle = RC_SWIZZLE_XYZW; + inst->I.SrcReg[0].Negate = 0; + + return 1; +} + static int r500_swizzle_is_native(rc_opcode opcode, struct rc_src_register reg) { unsigned int relevant; diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog.h b/src/mesa/drivers/dri/r300/compiler/r500_fragprog.h index 92ac75d5fd..0918cdf518 100644 --- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog.h +++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog.h @@ -47,4 +47,9 @@ extern int r500_transform_TEX( struct rc_instruction * inst, void* data); +extern int r500_transform_IF( + struct radeon_compiler * c, + struct rc_instruction * inst, + void* data); + #endif diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c index 95af6fd411..2ae3c56689 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c @@ -34,10 +34,12 @@ struct updatemask_state { unsigned char Output[RC_REGISTER_MAX_INDEX]; unsigned char Temporary[RC_REGISTER_MAX_INDEX]; unsigned char Address; + unsigned char Special[RC_NUM_SPECIAL_REGISTERS]; }; struct instruction_state { - unsigned char WriteMask; + unsigned char WriteMask:4; + unsigned char WriteALUResult:1; unsigned char SrcReg[3]; }; @@ -70,6 +72,9 @@ static void or_updatemasks( dst->Temporary[i] = a->Temporary[i] | b->Temporary[i]; } + for(unsigned int i = 0; i < RC_NUM_SPECIAL_REGISTERS; ++i) + dst->Special[i] = a->Special[i] | b->Special[i]; + dst->Address = a->Address | b->Address; } @@ -108,6 +113,13 @@ static unsigned char * get_used_ptr(struct deadcode_state *s, rc_register_file f return &s->R.Temporary[index]; } else if (file == RC_FILE_ADDRESS) { return &s->R.Address; + } else if (file == RC_FILE_SPECIAL) { + if (index >= RC_NUM_SPECIAL_REGISTERS) { + rc_error(s->C, "%s: special file index %i out of bounds\n", __FUNCTION__, index); + return 0; + } + + return &s->R.Special[index]; } return 0; @@ -136,6 +148,19 @@ static void update_instruction(struct deadcode_state * s, struct rc_instruction insts->WriteMask |= usedmask; + if (inst->I.WriteALUResult) { + unsigned char * pused = get_used_ptr(s, RC_FILE_SPECIAL, RC_SPECIAL_ALU_RESULT); + if (pused && *pused) { + if (inst->I.WriteALUResult == RC_ALURESULT_X) + usedmask |= RC_MASK_X; + else if (inst->I.WriteALUResult == RC_ALURESULT_W) + usedmask |= RC_MASK_W; + + *pused = 0; + insts->WriteALUResult = 1; + } + } + unsigned int srcmasks[3]; rc_compute_sources_for_writemask(opcode, usedmask, srcmasks); @@ -225,21 +250,38 @@ void rc_dataflow_deadcode(struct radeon_compiler * c, rc_dataflow_mark_outputs_f for(struct rc_instruction * inst = c->Program.Instructions.Next; inst != &c->Program.Instructions; inst = inst->Next, ++ip) { - const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode);\ + int dead = 1; + + if (!opcode->HasDstReg) { + dead = 0; + } else { + inst->I.DstReg.WriteMask = s.Instructions[ip].WriteMask; + if (s.Instructions[ip].WriteMask) + dead = 0; + + if (s.Instructions[ip].WriteALUResult) + dead = 0; + else + inst->I.WriteALUResult = RC_ALURESULT_NONE; + } - if (opcode->HasDstReg) { - if (s.Instructions[ip].WriteMask) { - inst->I.DstReg.WriteMask = s.Instructions[ip].WriteMask; - } else { - struct rc_instruction * todelete = inst; - inst = inst->Prev; - rc_remove_instruction(todelete); - continue; - } + if (dead) { + struct rc_instruction * todelete = inst; + inst = inst->Prev; + rc_remove_instruction(todelete); + continue; } unsigned int srcmasks[3]; - rc_compute_sources_for_writemask(opcode, s.Instructions[ip].WriteMask, srcmasks); + unsigned int usemask = s.Instructions[ip].WriteMask; + + if (inst->I.WriteALUResult == RC_ALURESULT_X) + usemask |= RC_MASK_X; + else if (inst->I.WriteALUResult == RC_ALURESULT_W) + usemask |= RC_MASK_W; + + rc_compute_sources_for_writemask(opcode, usemask, srcmasks); for(unsigned int src = 0; src < 3; ++src) { for(unsigned int chan = 0; chan < 4; ++chan) { diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program.h b/src/mesa/drivers/dri/r300/compiler/radeon_program.h index efa2b0dfe3..071b0a0ca9 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program.h @@ -86,6 +86,14 @@ struct rc_sub_instruction { */ rc_saturate_mode SaturateMode:2; + /** + * Writing to the special register RC_SPECIAL_ALU_RESULT + */ + /*@{*/ + rc_write_aluresult WriteALUResult:2; + rc_compare_func ALUResultCompare:3; + /*@}*/ + /** * \name Extra fields for TEX, TXB, TXD, TXL, TXP instructions. */ diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_constants.h b/src/mesa/drivers/dri/r300/compiler/radeon_program_constants.h index 69994f9880..7c0d6720b1 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program_constants.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_constants.h @@ -74,9 +74,22 @@ typedef enum { /** * Indicates a constant from the \ref rc_constant_list . */ - RC_FILE_CONSTANT + RC_FILE_CONSTANT, + + /** + * Indicates a special register, see RC_SPECIAL_xxx. + */ + RC_FILE_SPECIAL } rc_register_file; +enum { + /** R500 fragment program ALU result "register" */ + RC_SPECIAL_ALU_RESULT = 0, + + /** Must be last */ + RC_NUM_SPECIAL_REGISTERS +}; + #define RC_REGISTER_INDEX_BITS 10 #define RC_REGISTER_MAX_INDEX (1 << RC_REGISTER_INDEX_BITS) @@ -125,4 +138,10 @@ typedef enum { #define RC_MASK_XYZW (RC_MASK_X|RC_MASK_Y|RC_MASK_Z|RC_MASK_W) /*@}*/ +typedef enum { + RC_ALURESULT_NONE = 0, + RC_ALURESULT_X, + RC_ALURESULT_W +} rc_write_aluresult; + #endif /* RADEON_PROGRAM_CONSTANTS_H */ diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_print.c b/src/mesa/drivers/dri/r300/compiler/radeon_program_print.c index 0485286451..6645d7cacb 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program_print.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_print.c @@ -38,10 +38,36 @@ static const char * textarget_to_string(rc_texture_target target) } } +static void rc_print_comparefunc(FILE * f, const char * lhs, rc_compare_func func, const char * rhs) +{ + if (func == RC_COMPARE_FUNC_NEVER) { + fprintf(f, "false"); + } else if (func == RC_COMPARE_FUNC_ALWAYS) { + fprintf(f, "true"); + } else { + const char * op; + switch(func) { + case RC_COMPARE_FUNC_LESS: op = "<"; break; + case RC_COMPARE_FUNC_EQUAL: op = "=="; break; + case RC_COMPARE_FUNC_LEQUAL: op = "<="; break; + case RC_COMPARE_FUNC_GREATER: op = ">"; break; + case RC_COMPARE_FUNC_NOTEQUAL: op = "!="; break; + case RC_COMPARE_FUNC_GEQUAL: op = ">="; break; + default: op = "???"; break; + } + fprintf(f, "%s %s %s", lhs, op, rhs); + } +} + static void rc_print_register(FILE * f, rc_register_file file, int index, unsigned int reladdr) { if (file == RC_FILE_NONE) { fprintf(f, "none"); + } else if (file == RC_FILE_SPECIAL) { + switch(index) { + case RC_SPECIAL_ALU_RESULT: fprintf(f, "aluresult"); break; + default: fprintf(f, "special[%i]", index); break; + } } else { const char * filename; switch(file) { @@ -151,7 +177,17 @@ static void rc_print_instruction(FILE * f, struct rc_instruction * inst) inst->I.TexSrcUnit); } - fprintf(f, ";\n"); + fprintf(f, ";"); + + if (inst->I.WriteALUResult) { + fprintf(f, " [aluresult = ("); + rc_print_comparefunc(f, + (inst->I.WriteALUResult == RC_ALURESULT_X) ? "x" : "w", + inst->I.ALUResultCompare, "0"); + fprintf(f, ")]"); + } + + fprintf(f, "\n"); } /** -- cgit v1.2.3 From 995135479d5662d1b1970c0f233c3c3d944d8b4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= Date: Sun, 4 Oct 2009 11:25:48 +0200 Subject: r300/compiler: Refactor to allow different instruction types MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicolai Hähnle --- src/mesa/drivers/dri/r300/compiler/r300_fragprog.c | 144 ++++++++-------- src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c | 2 +- src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c | 90 +++++----- src/mesa/drivers/dri/r300/compiler/r500_fragprog.c | 144 ++++++++-------- .../drivers/dri/r300/compiler/radeon_compiler.c | 136 +++++++-------- .../dri/r300/compiler/radeon_dataflow_deadcode.c | 32 ++-- .../dri/r300/compiler/radeon_dataflow_swizzles.c | 40 ++--- .../drivers/dri/r300/compiler/radeon_program.c | 12 +- .../drivers/dri/r300/compiler/radeon_program.h | 10 +- .../drivers/dri/r300/compiler/radeon_program_alu.c | 186 ++++++++++----------- .../dri/r300/compiler/radeon_program_pair.c | 2 +- .../dri/r300/compiler/radeon_program_pair.h | 2 - .../dri/r300/compiler/radeon_program_print.c | 20 +-- src/mesa/drivers/dri/r300/r300_vertprog.c | 22 +-- src/mesa/drivers/dri/r300/radeon_mesa_to_rc.c | 18 +- 15 files changed, 433 insertions(+), 427 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/r300_fragprog.c b/src/mesa/drivers/dri/r300/compiler/r300_fragprog.c index 94f8fdfea3..aa69b0fc72 100644 --- a/src/mesa/drivers/dri/r300/compiler/r300_fragprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r300_fragprog.c @@ -55,75 +55,75 @@ int r300_transform_TEX( struct r300_fragment_program_compiler *compiler = (struct r300_fragment_program_compiler*)data; - if (inst->I.Opcode != RC_OPCODE_TEX && - inst->I.Opcode != RC_OPCODE_TXB && - inst->I.Opcode != RC_OPCODE_TXP && - inst->I.Opcode != RC_OPCODE_KIL) + if (inst->U.I.Opcode != RC_OPCODE_TEX && + inst->U.I.Opcode != RC_OPCODE_TXB && + inst->U.I.Opcode != RC_OPCODE_TXP && + inst->U.I.Opcode != RC_OPCODE_KIL) return 0; /* ARB_shadow & EXT_shadow_funcs */ - if (inst->I.Opcode != RC_OPCODE_KIL && - c->Program.ShadowSamplers & (1 << inst->I.TexSrcUnit)) { - rc_compare_func comparefunc = compiler->state.unit[inst->I.TexSrcUnit].texture_compare_func; + if (inst->U.I.Opcode != RC_OPCODE_KIL && + c->Program.ShadowSamplers & (1 << inst->U.I.TexSrcUnit)) { + rc_compare_func comparefunc = compiler->state.unit[inst->U.I.TexSrcUnit].texture_compare_func; if (comparefunc == RC_COMPARE_FUNC_NEVER || comparefunc == RC_COMPARE_FUNC_ALWAYS) { - inst->I.Opcode = RC_OPCODE_MOV; + inst->U.I.Opcode = RC_OPCODE_MOV; if (comparefunc == RC_COMPARE_FUNC_ALWAYS) { - inst->I.SrcReg[0].File = RC_FILE_NONE; - inst->I.SrcReg[0].Swizzle = RC_SWIZZLE_1111; + inst->U.I.SrcReg[0].File = RC_FILE_NONE; + inst->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_1111; } else { - inst->I.SrcReg[0] = shadow_ambient(c, inst->I.TexSrcUnit); + inst->U.I.SrcReg[0] = shadow_ambient(c, inst->U.I.TexSrcUnit); } return 1; } else { - rc_compare_func comparefunc = compiler->state.unit[inst->I.TexSrcUnit].texture_compare_func; - unsigned int depthmode = compiler->state.unit[inst->I.TexSrcUnit].depth_texture_mode; + rc_compare_func comparefunc = compiler->state.unit[inst->U.I.TexSrcUnit].texture_compare_func; + unsigned int depthmode = compiler->state.unit[inst->U.I.TexSrcUnit].depth_texture_mode; struct rc_instruction * inst_rcp = rc_insert_new_instruction(c, inst); struct rc_instruction * inst_mad = rc_insert_new_instruction(c, inst_rcp); struct rc_instruction * inst_cmp = rc_insert_new_instruction(c, inst_mad); int pass, fail; - inst_rcp->I.Opcode = RC_OPCODE_RCP; - inst_rcp->I.DstReg.File = RC_FILE_TEMPORARY; - inst_rcp->I.DstReg.Index = rc_find_free_temporary(c); - inst_rcp->I.DstReg.WriteMask = RC_MASK_W; - inst_rcp->I.SrcReg[0] = inst->I.SrcReg[0]; - inst_rcp->I.SrcReg[0].Swizzle = RC_SWIZZLE_WWWW; - - inst_cmp->I.DstReg = inst->I.DstReg; - inst->I.DstReg.File = RC_FILE_TEMPORARY; - inst->I.DstReg.Index = rc_find_free_temporary(c); - inst->I.DstReg.WriteMask = RC_MASK_XYZW; - - inst_mad->I.Opcode = RC_OPCODE_MAD; - inst_mad->I.DstReg.File = RC_FILE_TEMPORARY; - inst_mad->I.DstReg.Index = rc_find_free_temporary(c); - inst_mad->I.SrcReg[0] = inst->I.SrcReg[0]; - inst_mad->I.SrcReg[0].Swizzle = RC_SWIZZLE_ZZZZ; - inst_mad->I.SrcReg[1].File = RC_FILE_TEMPORARY; - inst_mad->I.SrcReg[1].Index = inst_rcp->I.DstReg.Index; - inst_mad->I.SrcReg[1].Swizzle = RC_SWIZZLE_WWWW; - inst_mad->I.SrcReg[2].File = RC_FILE_TEMPORARY; - inst_mad->I.SrcReg[2].Index = inst->I.DstReg.Index; + inst_rcp->U.I.Opcode = RC_OPCODE_RCP; + inst_rcp->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_rcp->U.I.DstReg.Index = rc_find_free_temporary(c); + inst_rcp->U.I.DstReg.WriteMask = RC_MASK_W; + inst_rcp->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; + inst_rcp->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_WWWW; + + inst_cmp->U.I.DstReg = inst->U.I.DstReg; + inst->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst->U.I.DstReg.Index = rc_find_free_temporary(c); + inst->U.I.DstReg.WriteMask = RC_MASK_XYZW; + + inst_mad->U.I.Opcode = RC_OPCODE_MAD; + inst_mad->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_mad->U.I.DstReg.Index = rc_find_free_temporary(c); + inst_mad->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; + inst_mad->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_ZZZZ; + inst_mad->U.I.SrcReg[1].File = RC_FILE_TEMPORARY; + inst_mad->U.I.SrcReg[1].Index = inst_rcp->U.I.DstReg.Index; + inst_mad->U.I.SrcReg[1].Swizzle = RC_SWIZZLE_WWWW; + inst_mad->U.I.SrcReg[2].File = RC_FILE_TEMPORARY; + inst_mad->U.I.SrcReg[2].Index = inst->U.I.DstReg.Index; if (depthmode == 0) /* GL_LUMINANCE */ - inst_mad->I.SrcReg[2].Swizzle = RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_Z); + inst_mad->U.I.SrcReg[2].Swizzle = RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_Z); else if (depthmode == 2) /* GL_ALPHA */ - inst_mad->I.SrcReg[2].Swizzle = RC_SWIZZLE_WWWW; + inst_mad->U.I.SrcReg[2].Swizzle = RC_SWIZZLE_WWWW; /* Recall that SrcReg[0] is tex, SrcReg[2] is r and: * r < tex <=> -tex+r < 0 * r >= tex <=> not (-tex+r < 0 */ if (comparefunc == RC_COMPARE_FUNC_LESS || comparefunc == RC_COMPARE_FUNC_GEQUAL) - inst_mad->I.SrcReg[2].Negate = inst_mad->I.SrcReg[2].Negate ^ RC_MASK_XYZW; + inst_mad->U.I.SrcReg[2].Negate = inst_mad->U.I.SrcReg[2].Negate ^ RC_MASK_XYZW; else - inst_mad->I.SrcReg[0].Negate = inst_mad->I.SrcReg[0].Negate ^ RC_MASK_XYZW; + inst_mad->U.I.SrcReg[0].Negate = inst_mad->U.I.SrcReg[0].Negate ^ RC_MASK_XYZW; - inst_cmp->I.Opcode = RC_OPCODE_CMP; + inst_cmp->U.I.Opcode = RC_OPCODE_CMP; /* DstReg has been filled out above */ - inst_cmp->I.SrcReg[0].File = RC_FILE_TEMPORARY; - inst_cmp->I.SrcReg[0].Index = inst_mad->I.DstReg.Index; + inst_cmp->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; + inst_cmp->U.I.SrcReg[0].Index = inst_mad->U.I.DstReg.Index; if (comparefunc == RC_COMPARE_FUNC_LESS || comparefunc == RC_COMPARE_FUNC_GREATER) { pass = 1; @@ -133,9 +133,9 @@ int r300_transform_TEX( fail = 1; } - inst_cmp->I.SrcReg[pass].File = RC_FILE_NONE; - inst_cmp->I.SrcReg[pass].Swizzle = RC_SWIZZLE_1111; - inst_cmp->I.SrcReg[fail] = shadow_ambient(c, inst->I.TexSrcUnit); + inst_cmp->U.I.SrcReg[pass].File = RC_FILE_NONE; + inst_cmp->U.I.SrcReg[pass].Swizzle = RC_SWIZZLE_1111; + inst_cmp->U.I.SrcReg[fail] = shadow_ambient(c, inst->U.I.TexSrcUnit); } } @@ -143,49 +143,49 @@ int r300_transform_TEX( * instead of [0..Width]x[0..Height]. * Add a scaling instruction. */ - if (inst->I.Opcode != RC_OPCODE_KIL && inst->I.TexSrcTarget == RC_TEXTURE_RECT) { + if (inst->U.I.Opcode != RC_OPCODE_KIL && inst->U.I.TexSrcTarget == RC_TEXTURE_RECT) { struct rc_instruction * inst_mul = rc_insert_new_instruction(c, inst->Prev); - inst_mul->I.Opcode = RC_OPCODE_MUL; - inst_mul->I.DstReg.File = RC_FILE_TEMPORARY; - inst_mul->I.DstReg.Index = rc_find_free_temporary(c); - inst_mul->I.SrcReg[0] = inst->I.SrcReg[0]; - inst_mul->I.SrcReg[1].File = RC_FILE_CONSTANT; - inst_mul->I.SrcReg[1].Index = rc_constants_add_state(&c->Program.Constants, RC_STATE_R300_TEXRECT_FACTOR, inst->I.TexSrcUnit); + inst_mul->U.I.Opcode = RC_OPCODE_MUL; + inst_mul->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_mul->U.I.DstReg.Index = rc_find_free_temporary(c); + inst_mul->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; + inst_mul->U.I.SrcReg[1].File = RC_FILE_CONSTANT; + inst_mul->U.I.SrcReg[1].Index = rc_constants_add_state(&c->Program.Constants, RC_STATE_R300_TEXRECT_FACTOR, inst->U.I.TexSrcUnit); - reset_srcreg(&inst->I.SrcReg[0]); - inst->I.SrcReg[0].File = RC_FILE_TEMPORARY; - inst->I.SrcReg[0].Index = inst_mul->I.DstReg.Index; + reset_srcreg(&inst->U.I.SrcReg[0]); + inst->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; + inst->U.I.SrcReg[0].Index = inst_mul->U.I.DstReg.Index; } /* Cannot write texture to output registers or with masks */ - if (inst->I.Opcode != RC_OPCODE_KIL && - (inst->I.DstReg.File != RC_FILE_TEMPORARY || inst->I.DstReg.WriteMask != RC_MASK_XYZW)) { + if (inst->U.I.Opcode != RC_OPCODE_KIL && + (inst->U.I.DstReg.File != RC_FILE_TEMPORARY || inst->U.I.DstReg.WriteMask != RC_MASK_XYZW)) { struct rc_instruction * inst_mov = rc_insert_new_instruction(c, inst); - inst_mov->I.Opcode = RC_OPCODE_MOV; - inst_mov->I.DstReg = inst->I.DstReg; - inst_mov->I.SrcReg[0].File = RC_FILE_TEMPORARY; - inst_mov->I.SrcReg[0].Index = rc_find_free_temporary(c); + inst_mov->U.I.Opcode = RC_OPCODE_MOV; + inst_mov->U.I.DstReg = inst->U.I.DstReg; + inst_mov->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; + inst_mov->U.I.SrcReg[0].Index = rc_find_free_temporary(c); - inst->I.DstReg.File = RC_FILE_TEMPORARY; - inst->I.DstReg.Index = inst_mov->I.SrcReg[0].Index; - inst->I.DstReg.WriteMask = RC_MASK_XYZW; + inst->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst->U.I.DstReg.Index = inst_mov->U.I.SrcReg[0].Index; + inst->U.I.DstReg.WriteMask = RC_MASK_XYZW; } /* Cannot read texture coordinate from constants file */ - if (inst->I.SrcReg[0].File != RC_FILE_TEMPORARY && inst->I.SrcReg[0].File != RC_FILE_INPUT) { + if (inst->U.I.SrcReg[0].File != RC_FILE_TEMPORARY && inst->U.I.SrcReg[0].File != RC_FILE_INPUT) { struct rc_instruction * inst_mov = rc_insert_new_instruction(c, inst->Prev); - inst_mov->I.Opcode = RC_OPCODE_MOV; - inst_mov->I.DstReg.File = RC_FILE_TEMPORARY; - inst_mov->I.DstReg.Index = rc_find_free_temporary(c); - inst_mov->I.SrcReg[0] = inst->I.SrcReg[0]; + inst_mov->U.I.Opcode = RC_OPCODE_MOV; + inst_mov->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_mov->U.I.DstReg.Index = rc_find_free_temporary(c); + inst_mov->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; - reset_srcreg(&inst->I.SrcReg[0]); - inst->I.SrcReg[0].File = RC_FILE_TEMPORARY; - inst->I.SrcReg[0].Index = inst_mov->I.DstReg.Index; + reset_srcreg(&inst->U.I.SrcReg[0]); + inst->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; + inst->U.I.SrcReg[0].Index = inst_mov->U.I.DstReg.Index; } return 1; diff --git a/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c b/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c index 614c2e3d24..746e4495fe 100644 --- a/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c @@ -44,7 +44,7 @@ static void rewrite_depth_out(struct r300_fragment_program_compiler * c) struct rc_instruction *rci; for (rci = c->Base.Program.Instructions.Next; rci != &c->Base.Program.Instructions; rci = rci->Next) { - struct rc_sub_instruction * inst = &rci->I; + struct rc_sub_instruction * inst = &rci->U.I; if (inst->DstReg.File != RC_FILE_OUTPUT || inst->DstReg.Index != c->OutputDepth) continue; diff --git a/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c b/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c index e1e735568d..1b2cb8dde7 100644 --- a/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog.c @@ -341,7 +341,7 @@ static void translate_vertex_program(struct r300_vertex_program_compiler * compi compiler->SetHwInputOutput(compiler); for(rci = compiler->Base.Program.Instructions.Next; rci != &compiler->Base.Program.Instructions; rci = rci->Next) { - struct rc_sub_instruction *vpi = &rci->I; + struct rc_sub_instruction *vpi = &rci->U.I; unsigned int *inst = compiler->code->body.d + compiler->code->length; /* Skip instructions writing to non-existing destination */ @@ -405,19 +405,19 @@ static void allocate_temporary_registers(struct r300_vertex_program_compiler * c /* Pass 1: Count original temporaries and allocate structures */ for(inst = compiler->Base.Program.Instructions.Next; inst != &compiler->Base.Program.Instructions; inst = inst->Next) { - const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); for (i = 0; i < opcode->NumSrcRegs; ++i) { - if (inst->I.SrcReg[i].File == RC_FILE_TEMPORARY) { - if (inst->I.SrcReg[i].Index >= num_orig_temps) - num_orig_temps = inst->I.SrcReg[i].Index + 1; + if (inst->U.I.SrcReg[i].File == RC_FILE_TEMPORARY) { + if (inst->U.I.SrcReg[i].Index >= num_orig_temps) + num_orig_temps = inst->U.I.SrcReg[i].Index + 1; } } if (opcode->HasDstReg) { - if (inst->I.DstReg.File == RC_FILE_TEMPORARY) { - if (inst->I.DstReg.Index >= num_orig_temps) - num_orig_temps = inst->I.DstReg.Index + 1; + if (inst->U.I.DstReg.File == RC_FILE_TEMPORARY) { + if (inst->U.I.DstReg.Index >= num_orig_temps) + num_orig_temps = inst->U.I.DstReg.Index + 1; } } } @@ -428,22 +428,22 @@ static void allocate_temporary_registers(struct r300_vertex_program_compiler * c /* Pass 2: Determine original temporary lifetimes */ for(inst = compiler->Base.Program.Instructions.Next; inst != &compiler->Base.Program.Instructions; inst = inst->Next) { - const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); for (i = 0; i < opcode->NumSrcRegs; ++i) { - if (inst->I.SrcReg[i].File == RC_FILE_TEMPORARY) - ta[inst->I.SrcReg[i].Index].LastRead = inst; + if (inst->U.I.SrcReg[i].File == RC_FILE_TEMPORARY) + ta[inst->U.I.SrcReg[i].Index].LastRead = inst; } } /* Pass 3: Register allocation */ for(inst = compiler->Base.Program.Instructions.Next; inst != &compiler->Base.Program.Instructions; inst = inst->Next) { - const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); for (i = 0; i < opcode->NumSrcRegs; ++i) { - if (inst->I.SrcReg[i].File == RC_FILE_TEMPORARY) { - unsigned int orig = inst->I.SrcReg[i].Index; - inst->I.SrcReg[i].Index = ta[orig].HwTemp; + if (inst->U.I.SrcReg[i].File == RC_FILE_TEMPORARY) { + unsigned int orig = inst->U.I.SrcReg[i].Index; + inst->U.I.SrcReg[i].Index = ta[orig].HwTemp; if (ta[orig].Allocated && inst == ta[orig].LastRead) hwtemps[ta[orig].HwTemp] = 0; @@ -451,8 +451,8 @@ static void allocate_temporary_registers(struct r300_vertex_program_compiler * c } if (opcode->HasDstReg) { - if (inst->I.DstReg.File == RC_FILE_TEMPORARY) { - unsigned int orig = inst->I.DstReg.Index; + if (inst->U.I.DstReg.File == RC_FILE_TEMPORARY) { + unsigned int orig = inst->U.I.DstReg.Index; if (!ta[orig].Allocated) { for(j = 0; j < VSF_MAX_FRAGMENT_TEMPS; ++j) { @@ -471,7 +471,7 @@ static void allocate_temporary_registers(struct r300_vertex_program_compiler * c } } - inst->I.DstReg.Index = ta[orig].HwTemp; + inst->U.I.DstReg.Index = ta[orig].HwTemp; } } } @@ -487,36 +487,36 @@ static int transform_source_conflicts( struct rc_instruction* inst, void* unused) { - const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); if (opcode->NumSrcRegs == 3) { - if (t_src_conflict(inst->I.SrcReg[1], inst->I.SrcReg[2]) - || t_src_conflict(inst->I.SrcReg[0], inst->I.SrcReg[2])) { + if (t_src_conflict(inst->U.I.SrcReg[1], inst->U.I.SrcReg[2]) + || t_src_conflict(inst->U.I.SrcReg[0], inst->U.I.SrcReg[2])) { int tmpreg = rc_find_free_temporary(c); struct rc_instruction * inst_mov = rc_insert_new_instruction(c, inst->Prev); - inst_mov->I.Opcode = RC_OPCODE_MOV; - inst_mov->I.DstReg.File = RC_FILE_TEMPORARY; - inst_mov->I.DstReg.Index = tmpreg; - inst_mov->I.SrcReg[0] = inst->I.SrcReg[2]; - - reset_srcreg(&inst->I.SrcReg[2]); - inst->I.SrcReg[2].File = RC_FILE_TEMPORARY; - inst->I.SrcReg[2].Index = tmpreg; + inst_mov->U.I.Opcode = RC_OPCODE_MOV; + inst_mov->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_mov->U.I.DstReg.Index = tmpreg; + inst_mov->U.I.SrcReg[0] = inst->U.I.SrcReg[2]; + + reset_srcreg(&inst->U.I.SrcReg[2]); + inst->U.I.SrcReg[2].File = RC_FILE_TEMPORARY; + inst->U.I.SrcReg[2].Index = tmpreg; } } if (opcode->NumSrcRegs >= 2) { - if (t_src_conflict(inst->I.SrcReg[1], inst->I.SrcReg[0])) { + if (t_src_conflict(inst->U.I.SrcReg[1], inst->U.I.SrcReg[0])) { int tmpreg = rc_find_free_temporary(c); struct rc_instruction * inst_mov = rc_insert_new_instruction(c, inst->Prev); - inst_mov->I.Opcode = RC_OPCODE_MOV; - inst_mov->I.DstReg.File = RC_FILE_TEMPORARY; - inst_mov->I.DstReg.Index = tmpreg; - inst_mov->I.SrcReg[0] = inst->I.SrcReg[1]; - - reset_srcreg(&inst->I.SrcReg[1]); - inst->I.SrcReg[1].File = RC_FILE_TEMPORARY; - inst->I.SrcReg[1].Index = tmpreg; + inst_mov->U.I.Opcode = RC_OPCODE_MOV; + inst_mov->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_mov->U.I.DstReg.Index = tmpreg; + inst_mov->U.I.SrcReg[0] = inst->U.I.SrcReg[1]; + + reset_srcreg(&inst->U.I.SrcReg[1]); + inst->U.I.SrcReg[1].File = RC_FILE_TEMPORARY; + inst->U.I.SrcReg[1].Index = tmpreg; } } @@ -531,15 +531,15 @@ static void addArtificialOutputs(struct r300_vertex_program_compiler * compiler) if ((compiler->RequiredOutputs & (1 << i)) && !(compiler->Base.Program.OutputsWritten & (1 << i))) { struct rc_instruction * inst = rc_insert_new_instruction(&compiler->Base, compiler->Base.Program.Instructions.Prev); - inst->I.Opcode = RC_OPCODE_MOV; + inst->U.I.Opcode = RC_OPCODE_MOV; - inst->I.DstReg.File = RC_FILE_OUTPUT; - inst->I.DstReg.Index = i; - inst->I.DstReg.WriteMask = RC_MASK_XYZW; + inst->U.I.DstReg.File = RC_FILE_OUTPUT; + inst->U.I.DstReg.Index = i; + inst->U.I.DstReg.WriteMask = RC_MASK_XYZW; - inst->I.SrcReg[0].File = RC_FILE_CONSTANT; - inst->I.SrcReg[0].Index = 0; - inst->I.SrcReg[0].Swizzle = RC_SWIZZLE_XYZW; + inst->U.I.SrcReg[0].File = RC_FILE_CONSTANT; + inst->U.I.SrcReg[0].Index = 0; + inst->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_XYZW; compiler->Base.Program.OutputsWritten |= 1 << i; } diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c b/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c index 39f2445bd4..d87acecdab 100644 --- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog.c @@ -54,75 +54,75 @@ int r500_transform_TEX( struct r300_fragment_program_compiler *compiler = (struct r300_fragment_program_compiler*)data; - if (inst->I.Opcode != RC_OPCODE_TEX && - inst->I.Opcode != RC_OPCODE_TXB && - inst->I.Opcode != RC_OPCODE_TXP && - inst->I.Opcode != RC_OPCODE_KIL) + if (inst->U.I.Opcode != RC_OPCODE_TEX && + inst->U.I.Opcode != RC_OPCODE_TXB && + inst->U.I.Opcode != RC_OPCODE_TXP && + inst->U.I.Opcode != RC_OPCODE_KIL) return 0; /* ARB_shadow & EXT_shadow_funcs */ - if (inst->I.Opcode != RC_OPCODE_KIL && - c->Program.ShadowSamplers & (1 << inst->I.TexSrcUnit)) { - rc_compare_func comparefunc = compiler->state.unit[inst->I.TexSrcUnit].texture_compare_func; + if (inst->U.I.Opcode != RC_OPCODE_KIL && + c->Program.ShadowSamplers & (1 << inst->U.I.TexSrcUnit)) { + rc_compare_func comparefunc = compiler->state.unit[inst->U.I.TexSrcUnit].texture_compare_func; if (comparefunc == RC_COMPARE_FUNC_NEVER || comparefunc == RC_COMPARE_FUNC_ALWAYS) { - inst->I.Opcode = RC_OPCODE_MOV; + inst->U.I.Opcode = RC_OPCODE_MOV; if (comparefunc == RC_COMPARE_FUNC_ALWAYS) { - inst->I.SrcReg[0].File = RC_FILE_NONE; - inst->I.SrcReg[0].Swizzle = RC_SWIZZLE_1111; + inst->U.I.SrcReg[0].File = RC_FILE_NONE; + inst->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_1111; } else { - inst->I.SrcReg[0] = shadow_ambient(c, inst->I.TexSrcUnit); + inst->U.I.SrcReg[0] = shadow_ambient(c, inst->U.I.TexSrcUnit); } return 1; } else { - rc_compare_func comparefunc = compiler->state.unit[inst->I.TexSrcUnit].texture_compare_func; - unsigned int depthmode = compiler->state.unit[inst->I.TexSrcUnit].depth_texture_mode; + rc_compare_func comparefunc = compiler->state.unit[inst->U.I.TexSrcUnit].texture_compare_func; + unsigned int depthmode = compiler->state.unit[inst->U.I.TexSrcUnit].depth_texture_mode; struct rc_instruction * inst_rcp = rc_insert_new_instruction(c, inst); struct rc_instruction * inst_mad = rc_insert_new_instruction(c, inst_rcp); struct rc_instruction * inst_cmp = rc_insert_new_instruction(c, inst_mad); int pass, fail; - inst_rcp->I.Opcode = RC_OPCODE_RCP; - inst_rcp->I.DstReg.File = RC_FILE_TEMPORARY; - inst_rcp->I.DstReg.Index = rc_find_free_temporary(c); - inst_rcp->I.DstReg.WriteMask = RC_MASK_W; - inst_rcp->I.SrcReg[0] = inst->I.SrcReg[0]; - inst_rcp->I.SrcReg[0].Swizzle = RC_SWIZZLE_WWWW; - - inst_cmp->I.DstReg = inst->I.DstReg; - inst->I.DstReg.File = RC_FILE_TEMPORARY; - inst->I.DstReg.Index = rc_find_free_temporary(c); - inst->I.DstReg.WriteMask = RC_MASK_XYZW; - - inst_mad->I.Opcode = RC_OPCODE_MAD; - inst_mad->I.DstReg.File = RC_FILE_TEMPORARY; - inst_mad->I.DstReg.Index = rc_find_free_temporary(c); - inst_mad->I.SrcReg[0] = inst->I.SrcReg[0]; - inst_mad->I.SrcReg[0].Swizzle = RC_SWIZZLE_ZZZZ; - inst_mad->I.SrcReg[1].File = RC_FILE_TEMPORARY; - inst_mad->I.SrcReg[1].Index = inst_rcp->I.DstReg.Index; - inst_mad->I.SrcReg[1].Swizzle = RC_SWIZZLE_WWWW; - inst_mad->I.SrcReg[2].File = RC_FILE_TEMPORARY; - inst_mad->I.SrcReg[2].Index = inst->I.DstReg.Index; + inst_rcp->U.I.Opcode = RC_OPCODE_RCP; + inst_rcp->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_rcp->U.I.DstReg.Index = rc_find_free_temporary(c); + inst_rcp->U.I.DstReg.WriteMask = RC_MASK_W; + inst_rcp->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; + inst_rcp->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_WWWW; + + inst_cmp->U.I.DstReg = inst->U.I.DstReg; + inst->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst->U.I.DstReg.Index = rc_find_free_temporary(c); + inst->U.I.DstReg.WriteMask = RC_MASK_XYZW; + + inst_mad->U.I.Opcode = RC_OPCODE_MAD; + inst_mad->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_mad->U.I.DstReg.Index = rc_find_free_temporary(c); + inst_mad->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; + inst_mad->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_ZZZZ; + inst_mad->U.I.SrcReg[1].File = RC_FILE_TEMPORARY; + inst_mad->U.I.SrcReg[1].Index = inst_rcp->U.I.DstReg.Index; + inst_mad->U.I.SrcReg[1].Swizzle = RC_SWIZZLE_WWWW; + inst_mad->U.I.SrcReg[2].File = RC_FILE_TEMPORARY; + inst_mad->U.I.SrcReg[2].Index = inst->U.I.DstReg.Index; if (depthmode == 0) /* GL_LUMINANCE */ - inst_mad->I.SrcReg[2].Swizzle = RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_Z); + inst_mad->U.I.SrcReg[2].Swizzle = RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_Z); else if (depthmode == 2) /* GL_ALPHA */ - inst_mad->I.SrcReg[2].Swizzle = RC_SWIZZLE_WWWW; + inst_mad->U.I.SrcReg[2].Swizzle = RC_SWIZZLE_WWWW; /* Recall that SrcReg[0] is tex, SrcReg[2] is r and: * r < tex <=> -tex+r < 0 * r >= tex <=> not (-tex+r < 0 */ if (comparefunc == RC_COMPARE_FUNC_LESS || comparefunc == RC_COMPARE_FUNC_GEQUAL) - inst_mad->I.SrcReg[2].Negate = inst_mad->I.SrcReg[2].Negate ^ RC_MASK_XYZW; + inst_mad->U.I.SrcReg[2].Negate = inst_mad->U.I.SrcReg[2].Negate ^ RC_MASK_XYZW; else - inst_mad->I.SrcReg[0].Negate = inst_mad->I.SrcReg[0].Negate ^ RC_MASK_XYZW; + inst_mad->U.I.SrcReg[0].Negate = inst_mad->U.I.SrcReg[0].Negate ^ RC_MASK_XYZW; - inst_cmp->I.Opcode = RC_OPCODE_CMP; + inst_cmp->U.I.Opcode = RC_OPCODE_CMP; /* DstReg has been filled out above */ - inst_cmp->I.SrcReg[0].File = RC_FILE_TEMPORARY; - inst_cmp->I.SrcReg[0].Index = inst_mad->I.DstReg.Index; + inst_cmp->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; + inst_cmp->U.I.SrcReg[0].Index = inst_mad->U.I.DstReg.Index; if (comparefunc == RC_COMPARE_FUNC_LESS || comparefunc == RC_COMPARE_FUNC_GREATER) { pass = 1; @@ -132,38 +132,38 @@ int r500_transform_TEX( fail = 1; } - inst_cmp->I.SrcReg[pass].File = RC_FILE_NONE; - inst_cmp->I.SrcReg[pass].Swizzle = RC_SWIZZLE_1111; - inst_cmp->I.SrcReg[fail] = shadow_ambient(c, inst->I.TexSrcUnit); + inst_cmp->U.I.SrcReg[pass].File = RC_FILE_NONE; + inst_cmp->U.I.SrcReg[pass].Swizzle = RC_SWIZZLE_1111; + inst_cmp->U.I.SrcReg[fail] = shadow_ambient(c, inst->U.I.TexSrcUnit); } } /* Cannot write texture to output registers */ - if (inst->I.Opcode != RC_OPCODE_KIL && inst->I.DstReg.File != RC_FILE_TEMPORARY) { + if (inst->U.I.Opcode != RC_OPCODE_KIL && inst->U.I.DstReg.File != RC_FILE_TEMPORARY) { struct rc_instruction * inst_mov = rc_insert_new_instruction(c, inst); - inst_mov->I.Opcode = RC_OPCODE_MOV; - inst_mov->I.DstReg = inst->I.DstReg; - inst_mov->I.SrcReg[0].File = RC_FILE_TEMPORARY; - inst_mov->I.SrcReg[0].Index = rc_find_free_temporary(c); + inst_mov->U.I.Opcode = RC_OPCODE_MOV; + inst_mov->U.I.DstReg = inst->U.I.DstReg; + inst_mov->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; + inst_mov->U.I.SrcReg[0].Index = rc_find_free_temporary(c); - inst->I.DstReg.File = RC_FILE_TEMPORARY; - inst->I.DstReg.Index = inst_mov->I.SrcReg[0].Index; - inst->I.DstReg.WriteMask = RC_MASK_XYZW; + inst->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst->U.I.DstReg.Index = inst_mov->U.I.SrcReg[0].Index; + inst->U.I.DstReg.WriteMask = RC_MASK_XYZW; } /* Cannot read texture coordinate from constants file */ - if (inst->I.SrcReg[0].File != RC_FILE_TEMPORARY && inst->I.SrcReg[0].File != RC_FILE_INPUT) { + if (inst->U.I.SrcReg[0].File != RC_FILE_TEMPORARY && inst->U.I.SrcReg[0].File != RC_FILE_INPUT) { struct rc_instruction * inst_mov = rc_insert_new_instruction(c, inst->Prev); - inst_mov->I.Opcode = RC_OPCODE_MOV; - inst_mov->I.DstReg.File = RC_FILE_TEMPORARY; - inst_mov->I.DstReg.Index = rc_find_free_temporary(c); - inst_mov->I.SrcReg[0] = inst->I.SrcReg[0]; + inst_mov->U.I.Opcode = RC_OPCODE_MOV; + inst_mov->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_mov->U.I.DstReg.Index = rc_find_free_temporary(c); + inst_mov->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; - reset_srcreg(&inst->I.SrcReg[0]); - inst->I.SrcReg[0].File = RC_FILE_TEMPORARY; - inst->I.SrcReg[0].Index = inst_mov->I.DstReg.Index; + reset_srcreg(&inst->U.I.SrcReg[0]); + inst->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; + inst->U.I.SrcReg[0].Index = inst_mov->U.I.DstReg.Index; } return 1; @@ -177,22 +177,22 @@ int r500_transform_IF( struct rc_instruction * inst, void* data) { - if (inst->I.Opcode != RC_OPCODE_IF) + if (inst->U.I.Opcode != RC_OPCODE_IF) return 0; struct rc_instruction * inst_mov = rc_insert_new_instruction(c, inst->Prev); - inst_mov->I.Opcode = RC_OPCODE_MOV; - inst_mov->I.DstReg.WriteMask = 0; - inst_mov->I.WriteALUResult = RC_ALURESULT_W; - inst_mov->I.ALUResultCompare = RC_COMPARE_FUNC_NOTEQUAL; - inst_mov->I.SrcReg[0] = inst->I.SrcReg[0]; - inst_mov->I.SrcReg[0].Swizzle = combine_swizzles4(inst_mov->I.SrcReg[0].Swizzle, + inst_mov->U.I.Opcode = RC_OPCODE_MOV; + inst_mov->U.I.DstReg.WriteMask = 0; + inst_mov->U.I.WriteALUResult = RC_ALURESULT_W; + inst_mov->U.I.ALUResultCompare = RC_COMPARE_FUNC_NOTEQUAL; + inst_mov->U.I.SrcReg[0] = inst->U.I.SrcReg[0]; + inst_mov->U.I.SrcReg[0].Swizzle = combine_swizzles4(inst_mov->U.I.SrcReg[0].Swizzle, RC_SWIZZLE_UNUSED, RC_SWIZZLE_UNUSED, RC_SWIZZLE_UNUSED, RC_SWIZZLE_X); - inst->I.SrcReg[0].File = RC_FILE_SPECIAL; - inst->I.SrcReg[0].Index = RC_SPECIAL_ALU_RESULT; - inst->I.SrcReg[0].Swizzle = RC_SWIZZLE_XYZW; - inst->I.SrcReg[0].Negate = 0; + inst->U.I.SrcReg[0].File = RC_FILE_SPECIAL; + inst->U.I.SrcReg[0].Index = RC_SPECIAL_ALU_RESULT; + inst->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_XYZW; + inst->U.I.SrcReg[0].Negate = 0; return 1; } diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.c b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.c index d0b78ec1c8..c0e7a7f7a0 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_compiler.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_compiler.c @@ -36,7 +36,7 @@ void rc_init(struct radeon_compiler * c) memory_pool_init(&c->Pool); c->Program.Instructions.Prev = &c->Program.Instructions; c->Program.Instructions.Next = &c->Program.Instructions; - c->Program.Instructions.I.Opcode = RC_OPCODE_ILLEGAL_OPCODE; + c->Program.Instructions.U.I.Opcode = RC_OPCODE_ILLEGAL_OPCODE; } void rc_destroy(struct radeon_compiler * c) @@ -113,17 +113,17 @@ void rc_calculate_inputs_outputs(struct radeon_compiler * c) for(inst = c->Program.Instructions.Next; inst != &c->Program.Instructions; inst = inst->Next) { - const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); int i; for (i = 0; i < opcode->NumSrcRegs; ++i) { - if (inst->I.SrcReg[i].File == RC_FILE_INPUT) - c->Program.InputsRead |= 1 << inst->I.SrcReg[i].Index; + if (inst->U.I.SrcReg[i].File == RC_FILE_INPUT) + c->Program.InputsRead |= 1 << inst->U.I.SrcReg[i].Index; } if (opcode->HasDstReg) { - if (inst->I.DstReg.File == RC_FILE_OUTPUT) - c->Program.OutputsWritten |= 1 << inst->I.DstReg.Index; + if (inst->U.I.DstReg.File == RC_FILE_OUTPUT) + c->Program.OutputsWritten |= 1 << inst->U.I.DstReg.Index; } } } @@ -139,17 +139,17 @@ void rc_move_input(struct radeon_compiler * c, unsigned input, struct rc_src_reg c->Program.InputsRead &= ~(1 << input); for(inst = c->Program.Instructions.Next; inst != &c->Program.Instructions; inst = inst->Next) { - const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); unsigned i; for(i = 0; i < opcode->NumSrcRegs; ++i) { - if (inst->I.SrcReg[i].File == RC_FILE_INPUT && inst->I.SrcReg[i].Index == input) { - inst->I.SrcReg[i].File = new_input.File; - inst->I.SrcReg[i].Index = new_input.Index; - inst->I.SrcReg[i].Swizzle = combine_swizzles(new_input.Swizzle, inst->I.SrcReg[i].Swizzle); - if (!inst->I.SrcReg[i].Abs) { - inst->I.SrcReg[i].Negate ^= new_input.Negate; - inst->I.SrcReg[i].Abs = new_input.Abs; + if (inst->U.I.SrcReg[i].File == RC_FILE_INPUT && inst->U.I.SrcReg[i].Index == input) { + inst->U.I.SrcReg[i].File = new_input.File; + inst->U.I.SrcReg[i].Index = new_input.Index; + inst->U.I.SrcReg[i].Swizzle = combine_swizzles(new_input.Swizzle, inst->U.I.SrcReg[i].Swizzle); + if (!inst->U.I.SrcReg[i].Abs) { + inst->U.I.SrcReg[i].Negate ^= new_input.Negate; + inst->U.I.SrcReg[i].Abs = new_input.Abs; } c->Program.InputsRead |= 1 << new_input.Index; @@ -171,12 +171,12 @@ void rc_move_output(struct radeon_compiler * c, unsigned output, unsigned new_ou c->Program.OutputsWritten &= ~(1 << output); for(inst = c->Program.Instructions.Next; inst != &c->Program.Instructions; inst = inst->Next) { - const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); if (opcode->HasDstReg) { - if (inst->I.DstReg.File == RC_FILE_OUTPUT && inst->I.DstReg.Index == output) { - inst->I.DstReg.Index = new_output; - inst->I.DstReg.WriteMask &= writemask; + if (inst->U.I.DstReg.File == RC_FILE_OUTPUT && inst->U.I.DstReg.Index == output) { + inst->U.I.DstReg.Index = new_output; + inst->U.I.DstReg.WriteMask &= writemask; c->Program.OutputsWritten |= 1 << new_output; } @@ -194,33 +194,33 @@ void rc_copy_output(struct radeon_compiler * c, unsigned output, unsigned dup_ou struct rc_instruction * inst; for(inst = c->Program.Instructions.Next; inst != &c->Program.Instructions; inst = inst->Next) { - const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); if (opcode->HasDstReg) { - if (inst->I.DstReg.File == RC_FILE_OUTPUT && inst->I.DstReg.Index == output) { - inst->I.DstReg.File = RC_FILE_TEMPORARY; - inst->I.DstReg.Index = tempreg; + if (inst->U.I.DstReg.File == RC_FILE_OUTPUT && inst->U.I.DstReg.Index == output) { + inst->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst->U.I.DstReg.Index = tempreg; } } } inst = rc_insert_new_instruction(c, c->Program.Instructions.Prev); - inst->I.Opcode = RC_OPCODE_MOV; - inst->I.DstReg.File = RC_FILE_OUTPUT; - inst->I.DstReg.Index = output; + inst->U.I.Opcode = RC_OPCODE_MOV; + inst->U.I.DstReg.File = RC_FILE_OUTPUT; + inst->U.I.DstReg.Index = output; - inst->I.SrcReg[0].File = RC_FILE_TEMPORARY; - inst->I.SrcReg[0].Index = tempreg; - inst->I.SrcReg[0].Swizzle = RC_SWIZZLE_XYZW; + inst->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; + inst->U.I.SrcReg[0].Index = tempreg; + inst->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_XYZW; inst = rc_insert_new_instruction(c, c->Program.Instructions.Prev); - inst->I.Opcode = RC_OPCODE_MOV; - inst->I.DstReg.File = RC_FILE_OUTPUT; - inst->I.DstReg.Index = dup_output; + inst->U.I.Opcode = RC_OPCODE_MOV; + inst->U.I.DstReg.File = RC_FILE_OUTPUT; + inst->U.I.DstReg.Index = dup_output; - inst->I.SrcReg[0].File = RC_FILE_TEMPORARY; - inst->I.SrcReg[0].Index = tempreg; - inst->I.SrcReg[0].Swizzle = RC_SWIZZLE_XYZW; + inst->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; + inst->U.I.SrcReg[0].Index = tempreg; + inst->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_XYZW; c->Program.OutputsWritten |= 1 << dup_output; } @@ -238,60 +238,60 @@ void rc_transform_fragment_wpos(struct radeon_compiler * c, unsigned wpos, unsig /* perspective divide */ struct rc_instruction * inst_rcp = rc_insert_new_instruction(c, &c->Program.Instructions); - inst_rcp->I.Opcode = RC_OPCODE_RCP; + inst_rcp->U.I.Opcode = RC_OPCODE_RCP; - inst_rcp->I.DstReg.File = RC_FILE_TEMPORARY; - inst_rcp->I.DstReg.Index = tempregi; - inst_rcp->I.DstReg.WriteMask = RC_MASK_W; + inst_rcp->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_rcp->U.I.DstReg.Index = tempregi; + inst_rcp->U.I.DstReg.WriteMask = RC_MASK_W; - inst_rcp->I.SrcReg[0].File = RC_FILE_INPUT; - inst_rcp->I.SrcReg[0].Index = new_input; - inst_rcp->I.SrcReg[0].Swizzle = RC_SWIZZLE_WWWW; + inst_rcp->U.I.SrcReg[0].File = RC_FILE_INPUT; + inst_rcp->U.I.SrcReg[0].Index = new_input; + inst_rcp->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_WWWW; struct rc_instruction * inst_mul = rc_insert_new_instruction(c, inst_rcp); - inst_mul->I.Opcode = RC_OPCODE_MUL; + inst_mul->U.I.Opcode = RC_OPCODE_MUL; - inst_mul->I.DstReg.File = RC_FILE_TEMPORARY; - inst_mul->I.DstReg.Index = tempregi; - inst_mul->I.DstReg.WriteMask = RC_MASK_XYZ; + inst_mul->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_mul->U.I.DstReg.Index = tempregi; + inst_mul->U.I.DstReg.WriteMask = RC_MASK_XYZ; - inst_mul->I.SrcReg[0].File = RC_FILE_INPUT; - inst_mul->I.SrcReg[0].Index = new_input; + inst_mul->U.I.SrcReg[0].File = RC_FILE_INPUT; + inst_mul->U.I.SrcReg[0].Index = new_input; - inst_mul->I.SrcReg[1].File = RC_FILE_TEMPORARY; - inst_mul->I.SrcReg[1].Index = tempregi; - inst_mul->I.SrcReg[1].Swizzle = RC_SWIZZLE_WWWW; + inst_mul->U.I.SrcReg[1].File = RC_FILE_TEMPORARY; + inst_mul->U.I.SrcReg[1].Index = tempregi; + inst_mul->U.I.SrcReg[1].Swizzle = RC_SWIZZLE_WWWW; /* viewport transformation */ struct rc_instruction * inst_mad = rc_insert_new_instruction(c, inst_mul); - inst_mad->I.Opcode = RC_OPCODE_MAD; + inst_mad->U.I.Opcode = RC_OPCODE_MAD; - inst_mad->I.DstReg.File = RC_FILE_TEMPORARY; - inst_mad->I.DstReg.Index = tempregi; - inst_mad->I.DstReg.WriteMask = RC_MASK_XYZ; + inst_mad->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst_mad->U.I.DstReg.Index = tempregi; + inst_mad->U.I.DstReg.WriteMask = RC_MASK_XYZ; - inst_mad->I.SrcReg[0].File = RC_FILE_TEMPORARY; - inst_mad->I.SrcReg[0].Index = tempregi; - inst_mad->I.SrcReg[0].Swizzle = RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_ZERO); + inst_mad->U.I.SrcReg[0].File = RC_FILE_TEMPORARY; + inst_mad->U.I.SrcReg[0].Index = tempregi; + inst_mad->U.I.SrcReg[0].Swizzle = RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_ZERO); - inst_mad->I.SrcReg[1].File = RC_FILE_CONSTANT; - inst_mad->I.SrcReg[1].Index = rc_constants_add_state(&c->Program.Constants, RC_STATE_R300_WINDOW_DIMENSION, 0); - inst_mad->I.SrcReg[1].Swizzle = RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_ZERO); + inst_mad->U.I.SrcReg[1].File = RC_FILE_CONSTANT; + inst_mad->U.I.SrcReg[1].Index = rc_constants_add_state(&c->Program.Constants, RC_STATE_R300_WINDOW_DIMENSION, 0); + inst_mad->U.I.SrcReg[1].Swizzle = RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_ZERO); - inst_mad->I.SrcReg[2].File = RC_FILE_CONSTANT; - inst_mad->I.SrcReg[2].Index = inst_mad->I.SrcReg[1].Index; - inst_mad->I.SrcReg[2].Swizzle = RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_ZERO); + inst_mad->U.I.SrcReg[2].File = RC_FILE_CONSTANT; + inst_mad->U.I.SrcReg[2].Index = inst_mad->U.I.SrcReg[1].Index; + inst_mad->U.I.SrcReg[2].Swizzle = RC_MAKE_SWIZZLE(RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_ZERO); struct rc_instruction * inst; for (inst = inst_mad->Next; inst != &c->Program.Instructions; inst = inst->Next) { - const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); unsigned i; for(i = 0; i < opcode->NumSrcRegs; i++) { - if (inst->I.SrcReg[i].File == RC_FILE_INPUT && - inst->I.SrcReg[i].Index == wpos) { - inst->I.SrcReg[i].File = RC_FILE_TEMPORARY; - inst->I.SrcReg[i].Index = tempregi; + if (inst->U.I.SrcReg[i].File == RC_FILE_INPUT && + inst->U.I.SrcReg[i].Index == wpos) { + inst->U.I.SrcReg[i].File = RC_FILE_TEMPORARY; + inst->U.I.SrcReg[i].Index = tempregi; } } } diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c index 2ae3c56689..f30b1ff067 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c @@ -134,26 +134,26 @@ static void mark_used(struct deadcode_state * s, rc_register_file file, unsigned static void update_instruction(struct deadcode_state * s, struct rc_instruction * inst) { - const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); struct instruction_state * insts = &s->Instructions[inst->IP]; unsigned int usedmask = 0; if (opcode->HasDstReg) { - unsigned char * pused = get_used_ptr(s, inst->I.DstReg.File, inst->I.DstReg.Index); + unsigned char * pused = get_used_ptr(s, inst->U.I.DstReg.File, inst->U.I.DstReg.Index); if (pused) { - usedmask = *pused & inst->I.DstReg.WriteMask; + usedmask = *pused & inst->U.I.DstReg.WriteMask; *pused &= ~usedmask; } } insts->WriteMask |= usedmask; - if (inst->I.WriteALUResult) { + if (inst->U.I.WriteALUResult) { unsigned char * pused = get_used_ptr(s, RC_FILE_SPECIAL, RC_SPECIAL_ALU_RESULT); if (pused && *pused) { - if (inst->I.WriteALUResult == RC_ALURESULT_X) + if (inst->U.I.WriteALUResult == RC_ALURESULT_X) usedmask |= RC_MASK_X; - else if (inst->I.WriteALUResult == RC_ALURESULT_W) + else if (inst->U.I.WriteALUResult == RC_ALURESULT_W) usedmask |= RC_MASK_W; *pused = 0; @@ -171,7 +171,7 @@ static void update_instruction(struct deadcode_state * s, struct rc_instruction for(unsigned int chan = 0; chan < 4; ++chan) { if (GET_BIT(newsrcmask, chan)) - refmask |= 1 << GET_SWZ(inst->I.SrcReg[src].Swizzle, chan); + refmask |= 1 << GET_SWZ(inst->U.I.SrcReg[src].Swizzle, chan); } /* get rid of spurious bits from ZERO, ONE, etc. swizzles */ @@ -180,9 +180,9 @@ static void update_instruction(struct deadcode_state * s, struct rc_instruction if (!refmask) continue; - mark_used(s, inst->I.SrcReg[src].File, inst->I.SrcReg[src].Index, refmask); + mark_used(s, inst->U.I.SrcReg[src].File, inst->U.I.SrcReg[src].Index, refmask); - if (inst->I.SrcReg[src].RelAddr) + if (inst->U.I.SrcReg[src].RelAddr) mark_used(s, RC_FILE_ADDRESS, 0, RC_MASK_X); } } @@ -211,7 +211,7 @@ void rc_dataflow_deadcode(struct radeon_compiler * c, rc_dataflow_mark_outputs_f for(struct rc_instruction * inst = c->Program.Instructions.Prev; inst != &c->Program.Instructions; inst = inst->Prev) { - const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); if (opcode->IsControlFlow) { if (opcode->Opcode == RC_OPCODE_ENDIF) { @@ -250,20 +250,20 @@ void rc_dataflow_deadcode(struct radeon_compiler * c, rc_dataflow_mark_outputs_f for(struct rc_instruction * inst = c->Program.Instructions.Next; inst != &c->Program.Instructions; inst = inst->Next, ++ip) { - const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode);\ + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode);\ int dead = 1; if (!opcode->HasDstReg) { dead = 0; } else { - inst->I.DstReg.WriteMask = s.Instructions[ip].WriteMask; + inst->U.I.DstReg.WriteMask = s.Instructions[ip].WriteMask; if (s.Instructions[ip].WriteMask) dead = 0; if (s.Instructions[ip].WriteALUResult) dead = 0; else - inst->I.WriteALUResult = RC_ALURESULT_NONE; + inst->U.I.WriteALUResult = RC_ALURESULT_NONE; } if (dead) { @@ -276,9 +276,9 @@ void rc_dataflow_deadcode(struct radeon_compiler * c, rc_dataflow_mark_outputs_f unsigned int srcmasks[3]; unsigned int usemask = s.Instructions[ip].WriteMask; - if (inst->I.WriteALUResult == RC_ALURESULT_X) + if (inst->U.I.WriteALUResult == RC_ALURESULT_X) usemask |= RC_MASK_X; - else if (inst->I.WriteALUResult == RC_ALURESULT_W) + else if (inst->U.I.WriteALUResult == RC_ALURESULT_W) usemask |= RC_MASK_W; rc_compute_sources_for_writemask(opcode, usemask, srcmasks); @@ -286,7 +286,7 @@ void rc_dataflow_deadcode(struct radeon_compiler * c, rc_dataflow_mark_outputs_f for(unsigned int src = 0; src < 3; ++src) { for(unsigned int chan = 0; chan < 4; ++chan) { if (!GET_BIT(srcmasks[src], chan)) - SET_SWZ(inst->I.SrcReg[src].Swizzle, chan, RC_SWIZZLE_UNUSED); + SET_SWZ(inst->U.I.SrcReg[src].Swizzle, chan, RC_SWIZZLE_UNUSED); } } } diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_swizzles.c b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_swizzles.c index fcef218b59..33acbd30f4 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_swizzles.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_swizzles.c @@ -40,48 +40,48 @@ static void rewrite_source(struct radeon_compiler * c, usemask = 0; for(unsigned int chan = 0; chan < 4; ++chan) { - if (GET_SWZ(inst->I.SrcReg[src].Swizzle, chan) != RC_SWIZZLE_UNUSED) + if (GET_SWZ(inst->U.I.SrcReg[src].Swizzle, chan) != RC_SWIZZLE_UNUSED) usemask |= 1 << chan; } - c->SwizzleCaps->Split(inst->I.SrcReg[src], usemask, &split); + c->SwizzleCaps->Split(inst->U.I.SrcReg[src], usemask, &split); for(unsigned int phase = 0; phase < split.NumPhases; ++phase) { struct rc_instruction * mov = rc_insert_new_instruction(c, inst->Prev); unsigned int phase_refmask; unsigned int masked_negate; - mov->I.Opcode = RC_OPCODE_MOV; - mov->I.DstReg.File = RC_FILE_TEMPORARY; - mov->I.DstReg.Index = tempreg; - mov->I.DstReg.WriteMask = split.Phase[phase]; - mov->I.SrcReg[0] = inst->I.SrcReg[src]; + mov->U.I.Opcode = RC_OPCODE_MOV; + mov->U.I.DstReg.File = RC_FILE_TEMPORARY; + mov->U.I.DstReg.Index = tempreg; + mov->U.I.DstReg.WriteMask = split.Phase[phase]; + mov->U.I.SrcReg[0] = inst->U.I.SrcReg[src]; phase_refmask = 0; for(unsigned int chan = 0; chan < 4; ++chan) { if (!GET_BIT(split.Phase[phase], chan)) - SET_SWZ(mov->I.SrcReg[0].Swizzle, chan, RC_SWIZZLE_UNUSED); + SET_SWZ(mov->U.I.SrcReg[0].Swizzle, chan, RC_SWIZZLE_UNUSED); else - phase_refmask |= 1 << GET_SWZ(mov->I.SrcReg[0].Swizzle, chan); + phase_refmask |= 1 << GET_SWZ(mov->U.I.SrcReg[0].Swizzle, chan); } phase_refmask &= RC_MASK_XYZW; - masked_negate = split.Phase[phase] & mov->I.SrcReg[0].Negate; + masked_negate = split.Phase[phase] & mov->U.I.SrcReg[0].Negate; if (masked_negate == 0) - mov->I.SrcReg[0].Negate = 0; + mov->U.I.SrcReg[0].Negate = 0; else if (masked_negate == split.Phase[phase]) - mov->I.SrcReg[0].Negate = RC_MASK_XYZW; + mov->U.I.SrcReg[0].Negate = RC_MASK_XYZW; } - inst->I.SrcReg[src].File = RC_FILE_TEMPORARY; - inst->I.SrcReg[src].Index = tempreg; - inst->I.SrcReg[src].Swizzle = 0; - inst->I.SrcReg[src].Negate = RC_MASK_NONE; - inst->I.SrcReg[src].Abs = 0; + inst->U.I.SrcReg[src].File = RC_FILE_TEMPORARY; + inst->U.I.SrcReg[src].Index = tempreg; + inst->U.I.SrcReg[src].Swizzle = 0; + inst->U.I.SrcReg[src].Negate = RC_MASK_NONE; + inst->U.I.SrcReg[src].Abs = 0; for(unsigned int chan = 0; chan < 4; ++chan) { - SET_SWZ(inst->I.SrcReg[src].Swizzle, chan, + SET_SWZ(inst->U.I.SrcReg[src].Swizzle, chan, GET_BIT(usemask, chan) ? chan : RC_SWIZZLE_UNUSED); } } @@ -91,11 +91,11 @@ void rc_dataflow_swizzles(struct radeon_compiler * c) struct rc_instruction * inst; for(inst = c->Program.Instructions.Next; inst != &c->Program.Instructions; inst = inst->Next) { - const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); unsigned int src; for(src = 0; src < opcode->NumSrcRegs; ++src) { - if (!c->SwizzleCaps->IsNative(inst->I.Opcode, inst->I.SrcReg[src])) + if (!c->SwizzleCaps->IsNative(inst->U.I.Opcode, inst->U.I.SrcReg[src])) rewrite_source(c, inst, src); } } diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program.c b/src/mesa/drivers/dri/r300/compiler/radeon_program.c index a1ee7c0cab..68a093b8c0 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program.c @@ -98,7 +98,7 @@ unsigned int rc_find_free_temporary(struct radeon_compiler * c) memset(used, 0, sizeof(used)); for (struct rc_instruction * rcinst = c->Program.Instructions.Next; rcinst != &c->Program.Instructions; rcinst = rcinst->Next) { - const struct rc_sub_instruction *inst = &rcinst->I; + const struct rc_sub_instruction *inst = &rcinst->U.I; const struct rc_opcode_info *opcode = rc_get_opcode_info(inst->Opcode); unsigned int k; @@ -129,11 +129,11 @@ struct rc_instruction *rc_alloc_instruction(struct radeon_compiler * c) memset(inst, 0, sizeof(struct rc_instruction)); - inst->I.Opcode = RC_OPCODE_ILLEGAL_OPCODE; - inst->I.DstReg.WriteMask = RC_MASK_XYZW; - inst->I.SrcReg[0].Swizzle = RC_SWIZZLE_XYZW; - inst->I.SrcReg[1].Swizzle = RC_SWIZZLE_XYZW; - inst->I.SrcReg[2].Swizzle = RC_SWIZZLE_XYZW; + inst->U.I.Opcode = RC_OPCODE_ILLEGAL_OPCODE; + inst->U.I.DstReg.WriteMask = RC_MASK_XYZW; + inst->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_XYZW; + inst->U.I.SrcReg[1].Swizzle = RC_SWIZZLE_XYZW; + inst->U.I.SrcReg[2].Swizzle = RC_SWIZZLE_XYZW; return inst; } diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program.h b/src/mesa/drivers/dri/r300/compiler/radeon_program.h index 071b0a0ca9..067cb545fd 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program.h @@ -109,11 +109,19 @@ struct rc_sub_instruction { /*@}*/ }; +typedef enum { + RC_INSTRUCTION_NORMAL = 0, + RC_INSTRUCTION_PAIR +} rc_instruction_type; + struct rc_instruction { struct rc_instruction * Prev; struct rc_instruction * Next; - struct rc_sub_instruction I; + rc_instruction_type Type; + union { + struct rc_sub_instruction I; + } U; /** * Warning: IPs are not stable. If you want to use them, diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c b/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c index e25bc4ec87..425b929668 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c @@ -45,10 +45,10 @@ static struct rc_instruction *emit1( { struct rc_instruction *fpi = rc_insert_new_instruction(c, after); - fpi->I.Opcode = Opcode; - fpi->I.SaturateMode = Saturate; - fpi->I.DstReg = DstReg; - fpi->I.SrcReg[0] = SrcReg; + fpi->U.I.Opcode = Opcode; + fpi->U.I.SaturateMode = Saturate; + fpi->U.I.DstReg = DstReg; + fpi->U.I.SrcReg[0] = SrcReg; return fpi; } @@ -59,11 +59,11 @@ static struct rc_instruction *emit2( { struct rc_instruction *fpi = rc_insert_new_instruction(c, after); - fpi->I.Opcode = Opcode; - fpi->I.SaturateMode = Saturate; - fpi->I.DstReg = DstReg; - fpi->I.SrcReg[0] = SrcReg0; - fpi->I.SrcReg[1] = SrcReg1; + fpi->U.I.Opcode = Opcode; + fpi->U.I.SaturateMode = Saturate; + fpi->U.I.DstReg = DstReg; + fpi->U.I.SrcReg[0] = SrcReg0; + fpi->U.I.SrcReg[1] = SrcReg1; return fpi; } @@ -75,12 +75,12 @@ static struct rc_instruction *emit3( { struct rc_instruction *fpi = rc_insert_new_instruction(c, after); - fpi->I.Opcode = Opcode; - fpi->I.SaturateMode = Saturate; - fpi->I.DstReg = DstReg; - fpi->I.SrcReg[0] = SrcReg0; - fpi->I.SrcReg[1] = SrcReg1; - fpi->I.SrcReg[2] = SrcReg2; + fpi->U.I.Opcode = Opcode; + fpi->U.I.SaturateMode = Saturate; + fpi->U.I.DstReg = DstReg; + fpi->U.I.SrcReg[0] = SrcReg0; + fpi->U.I.SrcReg[1] = SrcReg1; + fpi->U.I.SrcReg[2] = SrcReg2; return fpi; } @@ -168,36 +168,36 @@ static struct rc_src_register scalar(struct rc_src_register reg) static void transform_ABS(struct radeon_compiler* c, struct rc_instruction* inst) { - struct rc_src_register src = inst->I.SrcReg[0]; + struct rc_src_register src = inst->U.I.SrcReg[0]; src.Abs = 1; src.Negate = RC_MASK_NONE; - emit1(c, inst->Prev, RC_OPCODE_MOV, inst->I.SaturateMode, inst->I.DstReg, src); + emit1(c, inst->Prev, RC_OPCODE_MOV, inst->U.I.SaturateMode, inst->U.I.DstReg, src); rc_remove_instruction(inst); } static void transform_DP3(struct radeon_compiler* c, struct rc_instruction* inst) { - struct rc_src_register src0 = inst->I.SrcReg[0]; - struct rc_src_register src1 = inst->I.SrcReg[1]; + struct rc_src_register src0 = inst->U.I.SrcReg[0]; + struct rc_src_register src1 = inst->U.I.SrcReg[1]; src0.Negate &= ~RC_MASK_W; src0.Swizzle &= ~(7 << (3 * 3)); src0.Swizzle |= RC_SWIZZLE_ZERO << (3 * 3); src1.Negate &= ~RC_MASK_W; src1.Swizzle &= ~(7 << (3 * 3)); src1.Swizzle |= RC_SWIZZLE_ZERO << (3 * 3); - emit2(c, inst->Prev, RC_OPCODE_DP4, inst->I.SaturateMode, inst->I.DstReg, src0, src1); + emit2(c, inst->Prev, RC_OPCODE_DP4, inst->U.I.SaturateMode, inst->U.I.DstReg, src0, src1); rc_remove_instruction(inst); } static void transform_DPH(struct radeon_compiler* c, struct rc_instruction* inst) { - struct rc_src_register src0 = inst->I.SrcReg[0]; + struct rc_src_register src0 = inst->U.I.SrcReg[0]; src0.Negate &= ~RC_MASK_W; src0.Swizzle &= ~(7 << (3 * 3)); src0.Swizzle |= RC_SWIZZLE_ONE << (3 * 3); - emit2(c, inst->Prev, RC_OPCODE_DP4, inst->I.SaturateMode, inst->I.DstReg, src0, inst->I.SrcReg[1]); + emit2(c, inst->Prev, RC_OPCODE_DP4, inst->U.I.SaturateMode, inst->U.I.DstReg, src0, inst->U.I.SrcReg[1]); rc_remove_instruction(inst); } @@ -208,9 +208,9 @@ static void transform_DPH(struct radeon_compiler* c, static void transform_DST(struct radeon_compiler* c, struct rc_instruction* inst) { - emit2(c, inst->Prev, RC_OPCODE_MUL, inst->I.SaturateMode, inst->I.DstReg, - swizzle(inst->I.SrcReg[0], RC_SWIZZLE_ONE, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_ONE), - swizzle(inst->I.SrcReg[1], RC_SWIZZLE_ONE, RC_SWIZZLE_Y, RC_SWIZZLE_ONE, RC_SWIZZLE_W)); + emit2(c, inst->Prev, RC_OPCODE_MUL, inst->U.I.SaturateMode, inst->U.I.DstReg, + swizzle(inst->U.I.SrcReg[0], RC_SWIZZLE_ONE, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_ONE), + swizzle(inst->U.I.SrcReg[1], RC_SWIZZLE_ONE, RC_SWIZZLE_Y, RC_SWIZZLE_ONE, RC_SWIZZLE_W)); rc_remove_instruction(inst); } @@ -218,9 +218,9 @@ static void transform_FLR(struct radeon_compiler* c, struct rc_instruction* inst) { int tempreg = rc_find_free_temporary(c); - emit1(c, inst->Prev, RC_OPCODE_FRC, 0, dstreg(RC_FILE_TEMPORARY, tempreg), inst->I.SrcReg[0]); - emit2(c, inst->Prev, RC_OPCODE_ADD, inst->I.SaturateMode, inst->I.DstReg, - inst->I.SrcReg[0], negate(srcreg(RC_FILE_TEMPORARY, tempreg))); + emit1(c, inst->Prev, RC_OPCODE_FRC, 0, dstreg(RC_FILE_TEMPORARY, tempreg), inst->U.I.SrcReg[0]); + emit2(c, inst->Prev, RC_OPCODE_ADD, inst->U.I.SaturateMode, inst->U.I.DstReg, + inst->U.I.SrcReg[0], negate(srcreg(RC_FILE_TEMPORARY, tempreg))); rc_remove_instruction(inst); } @@ -252,19 +252,19 @@ static void transform_LIT(struct radeon_compiler* c, constant = rc_constants_add_immediate_scalar(&c->Program.Constants, -127.999999, &constant_swizzle); - if (inst->I.DstReg.WriteMask != RC_MASK_XYZW || inst->I.DstReg.File != RC_FILE_TEMPORARY) { + if (inst->U.I.DstReg.WriteMask != RC_MASK_XYZW || inst->U.I.DstReg.File != RC_FILE_TEMPORARY) { struct rc_instruction * inst_mov; inst_mov = emit1(c, inst, - RC_OPCODE_MOV, 0, inst->I.DstReg, + RC_OPCODE_MOV, 0, inst->U.I.DstReg, srcreg(RC_FILE_TEMPORARY, rc_find_free_temporary(c))); - inst->I.DstReg.File = RC_FILE_TEMPORARY; - inst->I.DstReg.Index = inst_mov->I.SrcReg[0].Index; - inst->I.DstReg.WriteMask = RC_MASK_XYZW; + inst->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst->U.I.DstReg.Index = inst_mov->U.I.SrcReg[0].Index; + inst->U.I.DstReg.WriteMask = RC_MASK_XYZW; } - temp = inst->I.DstReg.Index; + temp = inst->U.I.DstReg.Index; srctemp = srcreg(RC_FILE_TEMPORARY, temp); // tmp.x = max(0.0, Src.x); @@ -272,7 +272,7 @@ static void transform_LIT(struct radeon_compiler* c, // tmp.w = clamp(Src.z, -128+eps, 128-eps); emit2(c, inst->Prev, RC_OPCODE_MAX, 0, dstregtmpmask(temp, RC_MASK_XYW), - inst->I.SrcReg[0], + inst->U.I.SrcReg[0], swizzle(srcreg(RC_FILE_CONSTANT, constant), RC_SWIZZLE_ZERO, RC_SWIZZLE_ZERO, RC_SWIZZLE_ZERO, constant_swizzle&3)); emit2(c, inst->Prev, RC_OPCODE_MIN, 0, @@ -293,14 +293,14 @@ static void transform_LIT(struct radeon_compiler* c, swizzle(srctemp, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W)); // tmp.z = (tmp.x > 0) ? tmp.w : 0.0 - emit3(c, inst->Prev, RC_OPCODE_CMP, inst->I.SaturateMode, + emit3(c, inst->Prev, RC_OPCODE_CMP, inst->U.I.SaturateMode, dstregtmpmask(temp, RC_MASK_Z), negate(swizzle(srctemp, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X)), swizzle(srctemp, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W), builtin_zero); // tmp.x, tmp.y, tmp.w = 1.0, tmp.x, 1.0 - emit1(c, inst->Prev, RC_OPCODE_MOV, inst->I.SaturateMode, + emit1(c, inst->Prev, RC_OPCODE_MOV, inst->U.I.SaturateMode, dstregtmpmask(temp, RC_MASK_XYW), swizzle(srctemp, RC_SWIZZLE_ONE, RC_SWIZZLE_X, RC_SWIZZLE_ONE, RC_SWIZZLE_ONE)); @@ -314,10 +314,10 @@ static void transform_LRP(struct radeon_compiler* c, emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dstreg(RC_FILE_TEMPORARY, tempreg), - inst->I.SrcReg[1], negate(inst->I.SrcReg[2])); - emit3(c, inst->Prev, RC_OPCODE_MAD, inst->I.SaturateMode, - inst->I.DstReg, - inst->I.SrcReg[0], srcreg(RC_FILE_TEMPORARY, tempreg), inst->I.SrcReg[2]); + inst->U.I.SrcReg[1], negate(inst->U.I.SrcReg[2])); + emit3(c, inst->Prev, RC_OPCODE_MAD, inst->U.I.SaturateMode, + inst->U.I.DstReg, + inst->U.I.SrcReg[0], srcreg(RC_FILE_TEMPORARY, tempreg), inst->U.I.SrcReg[2]); rc_remove_instruction(inst); } @@ -331,9 +331,9 @@ static void transform_POW(struct radeon_compiler* c, tempdst.WriteMask = RC_MASK_W; tempsrc.Swizzle = RC_SWIZZLE_WWWW; - emit1(c, inst->Prev, RC_OPCODE_LG2, 0, tempdst, scalar(inst->I.SrcReg[0])); - emit2(c, inst->Prev, RC_OPCODE_MUL, 0, tempdst, tempsrc, scalar(inst->I.SrcReg[1])); - emit1(c, inst->Prev, RC_OPCODE_EX2, inst->I.SaturateMode, inst->I.DstReg, tempsrc); + emit1(c, inst->Prev, RC_OPCODE_LG2, 0, tempdst, scalar(inst->U.I.SrcReg[0])); + emit2(c, inst->Prev, RC_OPCODE_MUL, 0, tempdst, tempsrc, scalar(inst->U.I.SrcReg[1])); + emit1(c, inst->Prev, RC_OPCODE_EX2, inst->U.I.SaturateMode, inst->U.I.DstReg, tempsrc); rc_remove_instruction(inst); } @@ -341,7 +341,7 @@ static void transform_POW(struct radeon_compiler* c, static void transform_RSQ(struct radeon_compiler* c, struct rc_instruction* inst) { - inst->I.SrcReg[0] = absolute(inst->I.SrcReg[0]); + inst->U.I.SrcReg[0] = absolute(inst->U.I.SrcReg[0]); } static void transform_SGE(struct radeon_compiler* c, @@ -349,8 +349,8 @@ static void transform_SGE(struct radeon_compiler* c, { int tempreg = rc_find_free_temporary(c); - emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dstreg(RC_FILE_TEMPORARY, tempreg), inst->I.SrcReg[0], negate(inst->I.SrcReg[1])); - emit3(c, inst->Prev, RC_OPCODE_CMP, inst->I.SaturateMode, inst->I.DstReg, + emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dstreg(RC_FILE_TEMPORARY, tempreg), inst->U.I.SrcReg[0], negate(inst->U.I.SrcReg[1])); + emit3(c, inst->Prev, RC_OPCODE_CMP, inst->U.I.SaturateMode, inst->U.I.DstReg, srcreg(RC_FILE_TEMPORARY, tempreg), builtin_zero, builtin_one); rc_remove_instruction(inst); @@ -361,8 +361,8 @@ static void transform_SLT(struct radeon_compiler* c, { int tempreg = rc_find_free_temporary(c); - emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dstreg(RC_FILE_TEMPORARY, tempreg), inst->I.SrcReg[0], negate(inst->I.SrcReg[1])); - emit3(c, inst->Prev, RC_OPCODE_CMP, inst->I.SaturateMode, inst->I.DstReg, + emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dstreg(RC_FILE_TEMPORARY, tempreg), inst->U.I.SrcReg[0], negate(inst->U.I.SrcReg[1])); + emit3(c, inst->Prev, RC_OPCODE_CMP, inst->U.I.SaturateMode, inst->U.I.DstReg, srcreg(RC_FILE_TEMPORARY, tempreg), builtin_one, builtin_zero); rc_remove_instruction(inst); @@ -371,14 +371,14 @@ static void transform_SLT(struct radeon_compiler* c, static void transform_SUB(struct radeon_compiler* c, struct rc_instruction* inst) { - inst->I.Opcode = RC_OPCODE_ADD; - inst->I.SrcReg[1] = negate(inst->I.SrcReg[1]); + inst->U.I.Opcode = RC_OPCODE_ADD; + inst->U.I.SrcReg[1] = negate(inst->U.I.SrcReg[1]); } static void transform_SWZ(struct radeon_compiler* c, struct rc_instruction* inst) { - inst->I.Opcode = RC_OPCODE_MOV; + inst->U.I.Opcode = RC_OPCODE_MOV; } static void transform_XPD(struct radeon_compiler* c, @@ -387,11 +387,11 @@ static void transform_XPD(struct radeon_compiler* c, int tempreg = rc_find_free_temporary(c); emit2(c, inst->Prev, RC_OPCODE_MUL, 0, dstreg(RC_FILE_TEMPORARY, tempreg), - swizzle(inst->I.SrcReg[0], RC_SWIZZLE_Z, RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_W), - swizzle(inst->I.SrcReg[1], RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_X, RC_SWIZZLE_W)); - emit3(c, inst->Prev, RC_OPCODE_MAD, inst->I.SaturateMode, inst->I.DstReg, - swizzle(inst->I.SrcReg[0], RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_X, RC_SWIZZLE_W), - swizzle(inst->I.SrcReg[1], RC_SWIZZLE_Z, RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_W), + swizzle(inst->U.I.SrcReg[0], RC_SWIZZLE_Z, RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_W), + swizzle(inst->U.I.SrcReg[1], RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_X, RC_SWIZZLE_W)); + emit3(c, inst->Prev, RC_OPCODE_MAD, inst->U.I.SaturateMode, inst->U.I.DstReg, + swizzle(inst->U.I.SrcReg[0], RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_X, RC_SWIZZLE_W), + swizzle(inst->U.I.SrcReg[1], RC_SWIZZLE_Z, RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_W), negate(srcreg(RC_FILE_TEMPORARY, tempreg))); rc_remove_instruction(inst); @@ -417,7 +417,7 @@ int radeonTransformALU( struct rc_instruction* inst, void* unused) { - switch(inst->I.Opcode) { + switch(inst->U.I.Opcode) { case RC_OPCODE_ABS: transform_ABS(c, inst); return 1; case RC_OPCODE_DPH: transform_DPH(c, inst); return 1; case RC_OPCODE_DST: transform_DST(c, inst); return 1; @@ -441,9 +441,9 @@ static void transform_r300_vertex_ABS(struct radeon_compiler* c, struct rc_instruction* inst) { /* Note: r500 can take absolute values, but r300 cannot. */ - inst->I.Opcode = RC_OPCODE_MAX; - inst->I.SrcReg[1] = inst->I.SrcReg[0]; - inst->I.SrcReg[1].Negate ^= RC_MASK_XYZW; + inst->U.I.Opcode = RC_OPCODE_MAX; + inst->U.I.SrcReg[1] = inst->U.I.SrcReg[0]; + inst->U.I.SrcReg[1].Negate ^= RC_MASK_XYZW; } /** @@ -455,7 +455,7 @@ int r300_transform_vertex_alu( struct rc_instruction* inst, void* unused) { - switch(inst->I.Opcode) { + switch(inst->U.I.Opcode) { case RC_OPCODE_ABS: transform_r300_vertex_ABS(c, inst); return 1; case RC_OPCODE_DP3: transform_DP3(c, inst); return 1; case RC_OPCODE_DPH: transform_DPH(c, inst); return 1; @@ -531,9 +531,9 @@ int radeonTransformTrigSimple(struct radeon_compiler* c, struct rc_instruction* inst, void* unused) { - if (inst->I.Opcode != RC_OPCODE_COS && - inst->I.Opcode != RC_OPCODE_SIN && - inst->I.Opcode != RC_OPCODE_SCS) + if (inst->U.I.Opcode != RC_OPCODE_COS && + inst->U.I.Opcode != RC_OPCODE_SIN && + inst->U.I.Opcode != RC_OPCODE_SCS) return 0; unsigned int constants[2]; @@ -541,12 +541,12 @@ int radeonTransformTrigSimple(struct radeon_compiler* c, sincos_constants(c, constants); - if (inst->I.Opcode == RC_OPCODE_COS) { + if (inst->U.I.Opcode == RC_OPCODE_COS) { // MAD tmp.x, src, 1/(2*PI), 0.75 // FRC tmp.x, tmp.x // MAD tmp.z, tmp.x, 2*PI, -PI emit3(c, inst->Prev, RC_OPCODE_MAD, 0, dstregtmpmask(tempreg, RC_MASK_W), - swizzle(inst->I.SrcReg[0], RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X), + swizzle(inst->U.I.SrcReg[0], RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X), swizzle(srcreg(RC_FILE_CONSTANT, constants[1]), RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z), swizzle(srcreg(RC_FILE_CONSTANT, constants[1]), RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X)); emit1(c, inst->Prev, RC_OPCODE_FRC, 0, dstregtmpmask(tempreg, RC_MASK_W), @@ -556,12 +556,12 @@ int radeonTransformTrigSimple(struct radeon_compiler* c, swizzle(srcreg(RC_FILE_CONSTANT, constants[1]), RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W), negate(swizzle(srcreg(RC_FILE_CONSTANT, constants[0]), RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z))); - sin_approx(c, inst, inst->I.DstReg, + sin_approx(c, inst, inst->U.I.DstReg, swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W), constants); - } else if (inst->I.Opcode == RC_OPCODE_SIN) { + } else if (inst->U.I.Opcode == RC_OPCODE_SIN) { emit3(c, inst->Prev, RC_OPCODE_MAD, 0, dstregtmpmask(tempreg, RC_MASK_W), - swizzle(inst->I.SrcReg[0], RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X), + swizzle(inst->U.I.SrcReg[0], RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X), swizzle(srcreg(RC_FILE_CONSTANT, constants[1]), RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z), swizzle(srcreg(RC_FILE_CONSTANT, constants[1]), RC_SWIZZLE_Y, RC_SWIZZLE_Y, RC_SWIZZLE_Y, RC_SWIZZLE_Y)); emit1(c, inst->Prev, RC_OPCODE_FRC, 0, dstregtmpmask(tempreg, RC_MASK_W), @@ -571,12 +571,12 @@ int radeonTransformTrigSimple(struct radeon_compiler* c, swizzle(srcreg(RC_FILE_CONSTANT, constants[1]), RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W), negate(swizzle(srcreg(RC_FILE_CONSTANT, constants[0]), RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z))); - sin_approx(c, inst, inst->I.DstReg, + sin_approx(c, inst, inst->U.I.DstReg, swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W), constants); } else { emit3(c, inst->Prev, RC_OPCODE_MAD, 0, dstregtmpmask(tempreg, RC_MASK_XY), - swizzle(inst->I.SrcReg[0], RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X), + swizzle(inst->U.I.SrcReg[0], RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X), swizzle(srcreg(RC_FILE_CONSTANT, constants[1]), RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z), swizzle(srcreg(RC_FILE_CONSTANT, constants[1]), RC_SWIZZLE_X, RC_SWIZZLE_Y, RC_SWIZZLE_Z, RC_SWIZZLE_W)); emit1(c, inst->Prev, RC_OPCODE_FRC, 0, dstregtmpmask(tempreg, RC_MASK_XY), @@ -586,14 +586,14 @@ int radeonTransformTrigSimple(struct radeon_compiler* c, swizzle(srcreg(RC_FILE_CONSTANT, constants[1]), RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W), negate(swizzle(srcreg(RC_FILE_CONSTANT, constants[0]), RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z, RC_SWIZZLE_Z))); - struct rc_dst_register dst = inst->I.DstReg; + struct rc_dst_register dst = inst->U.I.DstReg; - dst.WriteMask = inst->I.DstReg.WriteMask & RC_MASK_X; + dst.WriteMask = inst->U.I.DstReg.WriteMask & RC_MASK_X; sin_approx(c, inst, dst, swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X), constants); - dst.WriteMask = inst->I.DstReg.WriteMask & RC_MASK_Y; + dst.WriteMask = inst->U.I.DstReg.WriteMask & RC_MASK_Y; sin_approx(c, inst, dst, swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_Y, RC_SWIZZLE_Y, RC_SWIZZLE_Y, RC_SWIZZLE_Y), constants); @@ -617,9 +617,9 @@ int radeonTransformTrigScale(struct radeon_compiler* c, struct rc_instruction* inst, void* unused) { - if (inst->I.Opcode != RC_OPCODE_COS && - inst->I.Opcode != RC_OPCODE_SIN && - inst->I.Opcode != RC_OPCODE_SCS) + if (inst->U.I.Opcode != RC_OPCODE_COS && + inst->U.I.Opcode != RC_OPCODE_SIN && + inst->U.I.Opcode != RC_OPCODE_SCS) return 0; static const float RCP_2PI = 0.15915494309189535; @@ -631,28 +631,28 @@ int radeonTransformTrigScale(struct radeon_compiler* c, constant = rc_constants_add_immediate_scalar(&c->Program.Constants, RCP_2PI, &constant_swizzle); emit2(c, inst->Prev, RC_OPCODE_MUL, 0, dstregtmpmask(temp, RC_MASK_W), - swizzle(inst->I.SrcReg[0], RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X), + swizzle(inst->U.I.SrcReg[0], RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X), srcregswz(RC_FILE_CONSTANT, constant, constant_swizzle)); emit1(c, inst->Prev, RC_OPCODE_FRC, 0, dstregtmpmask(temp, RC_MASK_W), srcreg(RC_FILE_TEMPORARY, temp)); - if (inst->I.Opcode == RC_OPCODE_COS) { - emit1(c, inst->Prev, RC_OPCODE_COS, inst->I.SaturateMode, inst->I.DstReg, + if (inst->U.I.Opcode == RC_OPCODE_COS) { + emit1(c, inst->Prev, RC_OPCODE_COS, inst->U.I.SaturateMode, inst->U.I.DstReg, srcregswz(RC_FILE_TEMPORARY, temp, RC_SWIZZLE_WWWW)); - } else if (inst->I.Opcode == RC_OPCODE_SIN) { - emit1(c, inst->Prev, RC_OPCODE_SIN, inst->I.SaturateMode, - inst->I.DstReg, srcregswz(RC_FILE_TEMPORARY, temp, RC_SWIZZLE_WWWW)); - } else if (inst->I.Opcode == RC_OPCODE_SCS) { - struct rc_dst_register moddst = inst->I.DstReg; + } else if (inst->U.I.Opcode == RC_OPCODE_SIN) { + emit1(c, inst->Prev, RC_OPCODE_SIN, inst->U.I.SaturateMode, + inst->U.I.DstReg, srcregswz(RC_FILE_TEMPORARY, temp, RC_SWIZZLE_WWWW)); + } else if (inst->U.I.Opcode == RC_OPCODE_SCS) { + struct rc_dst_register moddst = inst->U.I.DstReg; - if (inst->I.DstReg.WriteMask & RC_MASK_X) { + if (inst->U.I.DstReg.WriteMask & RC_MASK_X) { moddst.WriteMask = RC_MASK_X; - emit1(c, inst->Prev, RC_OPCODE_COS, inst->I.SaturateMode, moddst, + emit1(c, inst->Prev, RC_OPCODE_COS, inst->U.I.SaturateMode, moddst, srcregswz(RC_FILE_TEMPORARY, temp, RC_SWIZZLE_WWWW)); } - if (inst->I.DstReg.WriteMask & RC_MASK_Y) { + if (inst->U.I.DstReg.WriteMask & RC_MASK_Y) { moddst.WriteMask = RC_MASK_Y; - emit1(c, inst->Prev, RC_OPCODE_SIN, inst->I.SaturateMode, moddst, + emit1(c, inst->Prev, RC_OPCODE_SIN, inst->U.I.SaturateMode, moddst, srcregswz(RC_FILE_TEMPORARY, temp, RC_SWIZZLE_WWWW)); } } @@ -674,11 +674,11 @@ int radeonTransformDeriv(struct radeon_compiler* c, struct rc_instruction* inst, void* unused) { - if (inst->I.Opcode != RC_OPCODE_DDX && inst->I.Opcode != RC_OPCODE_DDY) + if (inst->U.I.Opcode != RC_OPCODE_DDX && inst->U.I.Opcode != RC_OPCODE_DDY) return 0; - inst->I.SrcReg[1].Swizzle = RC_MAKE_SWIZZLE(RC_SWIZZLE_ONE, RC_SWIZZLE_ONE, RC_SWIZZLE_ONE, RC_SWIZZLE_ONE); - inst->I.SrcReg[1].Negate = RC_MASK_XYZW; + inst->U.I.SrcReg[1].Swizzle = RC_MAKE_SWIZZLE(RC_SWIZZLE_ONE, RC_SWIZZLE_ONE, RC_SWIZZLE_ONE, RC_SWIZZLE_ONE); + inst->U.I.SrcReg[1].Negate = RC_MASK_XYZW; return 1; } diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.c b/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.c index 6cda208600..0d8d8e0b3b 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.c @@ -341,7 +341,7 @@ static void scan_instructions(struct pair_state *s) struct pair_state_instruction *pairinst = memory_pool_malloc(&s->Compiler->Base.Pool, sizeof(*pairinst)); memset(pairinst, 0, sizeof(struct pair_state_instruction)); - pairinst->Instruction = source->I; + pairinst->Instruction = source->U.I; pairinst->IP = ip; final_rewrite(s, &pairinst->Instruction); classify_instruction(s, pairinst); diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.h b/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.h index da2bcc5d89..440069d558 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.h @@ -28,8 +28,6 @@ #ifndef __RADEON_PROGRAM_PAIR_H_ #define __RADEON_PROGRAM_PAIR_H_ -#include "radeon_program.h" - struct r300_fragment_program_compiler; diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_print.c b/src/mesa/drivers/dri/r300/compiler/radeon_program_print.c index 6645d7cacb..fe90a5900e 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program_print.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_print.c @@ -144,12 +144,12 @@ static void rc_print_src_register(FILE * f, struct rc_src_register src) static void rc_print_instruction(FILE * f, struct rc_instruction * inst) { - const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->I.Opcode); + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); unsigned int reg; fprintf(f, "%s", opcode->Name); - switch(inst->I.SaturateMode) { + switch(inst->U.I.SaturateMode) { case RC_SATURATE_NONE: break; case RC_SATURATE_ZERO_ONE: fprintf(f, "_SAT"); break; case RC_SATURATE_MINUS_PLUS_ONE: fprintf(f, "_SAT2"); break; @@ -158,7 +158,7 @@ static void rc_print_instruction(FILE * f, struct rc_instruction * inst) if (opcode->HasDstReg) { fprintf(f, " "); - rc_print_dst_register(f, inst->I.DstReg); + rc_print_dst_register(f, inst->U.I.DstReg); if (opcode->NumSrcRegs) fprintf(f, ","); } @@ -167,23 +167,23 @@ static void rc_print_instruction(FILE * f, struct rc_instruction * inst) if (reg > 0) fprintf(f, ","); fprintf(f, " "); - rc_print_src_register(f, inst->I.SrcReg[reg]); + rc_print_src_register(f, inst->U.I.SrcReg[reg]); } if (opcode->HasTexture) { fprintf(f, ", %s%s[%u]", - textarget_to_string(inst->I.TexSrcTarget), - inst->I.TexShadow ? "SHADOW" : "", - inst->I.TexSrcUnit); + textarget_to_string(inst->U.I.TexSrcTarget), + inst->U.I.TexShadow ? "SHADOW" : "", + inst->U.I.TexSrcUnit); } fprintf(f, ";"); - if (inst->I.WriteALUResult) { + if (inst->U.I.WriteALUResult) { fprintf(f, " [aluresult = ("); rc_print_comparefunc(f, - (inst->I.WriteALUResult == RC_ALURESULT_X) ? "x" : "w", - inst->I.ALUResultCompare, "0"); + (inst->U.I.WriteALUResult == RC_ALURESULT_X) ? "x" : "w", + inst->U.I.ALUResultCompare, "0"); fprintf(f, ")]"); } diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index fb8d6bceda..43629d643b 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -217,20 +217,20 @@ static void initialize_NV_registers(struct radeon_compiler * compiler) for(reg = 0; reg < 12; ++reg) { inst = rc_insert_new_instruction(compiler, &compiler->Program.Instructions); - inst->I.Opcode = RC_OPCODE_MOV; - inst->I.DstReg.File = RC_FILE_TEMPORARY; - inst->I.DstReg.Index = reg; - inst->I.SrcReg[0].File = RC_FILE_NONE; - inst->I.SrcReg[0].Swizzle = RC_SWIZZLE_0000; + inst->U.I.Opcode = RC_OPCODE_MOV; + inst->U.I.DstReg.File = RC_FILE_TEMPORARY; + inst->U.I.DstReg.Index = reg; + inst->U.I.SrcReg[0].File = RC_FILE_NONE; + inst->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_0000; } inst = rc_insert_new_instruction(compiler, &compiler->Program.Instructions); - inst->I.Opcode = RC_OPCODE_ARL; - inst->I.DstReg.File = RC_FILE_ADDRESS; - inst->I.DstReg.Index = 0; - inst->I.DstReg.WriteMask = WRITEMASK_X; - inst->I.SrcReg[0].File = RC_FILE_NONE; - inst->I.SrcReg[0].Swizzle = RC_SWIZZLE_0000; + inst->U.I.Opcode = RC_OPCODE_ARL; + inst->U.I.DstReg.File = RC_FILE_ADDRESS; + inst->U.I.DstReg.Index = 0; + inst->U.I.DstReg.WriteMask = WRITEMASK_X; + inst->U.I.SrcReg[0].File = RC_FILE_NONE; + inst->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_0000; } static struct r300_vertex_program *build_program(GLcontext *ctx, diff --git a/src/mesa/drivers/dri/r300/radeon_mesa_to_rc.c b/src/mesa/drivers/dri/r300/radeon_mesa_to_rc.c index fb9bb9ce91..9f9dec840b 100644 --- a/src/mesa/drivers/dri/r300/radeon_mesa_to_rc.c +++ b/src/mesa/drivers/dri/r300/radeon_mesa_to_rc.c @@ -152,25 +152,25 @@ static void translate_instruction(struct radeon_compiler * c, const struct rc_opcode_info * opcode; unsigned int i; - dest->I.Opcode = translate_opcode(src->Opcode); - if (dest->I.Opcode == RC_OPCODE_ILLEGAL_OPCODE) { + dest->U.I.Opcode = translate_opcode(src->Opcode); + if (dest->U.I.Opcode == RC_OPCODE_ILLEGAL_OPCODE) { rc_error(c, "Unsupported opcode %i\n", src->Opcode); return; } - dest->I.SaturateMode = translate_saturate(src->SaturateMode); + dest->U.I.SaturateMode = translate_saturate(src->SaturateMode); - opcode = rc_get_opcode_info(dest->I.Opcode); + opcode = rc_get_opcode_info(dest->U.I.Opcode); for(i = 0; i < opcode->NumSrcRegs; ++i) - translate_srcreg(&dest->I.SrcReg[i], &src->SrcReg[i]); + translate_srcreg(&dest->U.I.SrcReg[i], &src->SrcReg[i]); if (opcode->HasDstReg) - translate_dstreg(&dest->I.DstReg, &src->DstReg); + translate_dstreg(&dest->U.I.DstReg, &src->DstReg); if (opcode->HasTexture) { - dest->I.TexSrcUnit = src->TexSrcUnit; - dest->I.TexSrcTarget = translate_tex_target(src->TexSrcTarget); - dest->I.TexShadow = src->TexShadow; + dest->U.I.TexSrcUnit = src->TexSrcUnit; + dest->U.I.TexSrcTarget = translate_tex_target(src->TexSrcTarget); + dest->U.I.TexShadow = src->TexShadow; } } -- cgit v1.2.3 From a30560e6f0fc8e3056f48a140c9c6b582f5e2e77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= Date: Sun, 4 Oct 2009 16:49:53 +0200 Subject: r300/compiler: Refactor the radeon_pair code to support control flow instructions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicolai Hähnle --- src/mesa/drivers/dri/r300/compiler/Makefile | 3 + .../drivers/dri/r300/compiler/r300_fragprog_emit.c | 77 +- src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c | 38 + .../drivers/dri/r300/compiler/r500_fragprog_emit.c | 67 +- .../drivers/dri/r300/compiler/radeon_dataflow.c | 132 ++- .../drivers/dri/r300/compiler/radeon_dataflow.h | 11 + .../drivers/dri/r300/compiler/radeon_opcodes.c | 4 + .../drivers/dri/r300/compiler/radeon_opcodes.h | 5 + .../dri/r300/compiler/radeon_pair_regalloc.c | 349 ++++++++ .../dri/r300/compiler/radeon_pair_schedule.c | 479 +++++++++++ .../dri/r300/compiler/radeon_pair_translate.c | 253 ++++++ .../drivers/dri/r300/compiler/radeon_program.c | 12 +- .../drivers/dri/r300/compiler/radeon_program.h | 3 + .../dri/r300/compiler/radeon_program_pair.c | 889 +-------------------- .../dri/r300/compiler/radeon_program_pair.h | 97 +-- .../dri/r300/compiler/radeon_program_print.c | 114 ++- 16 files changed, 1524 insertions(+), 1009 deletions(-) create mode 100644 src/mesa/drivers/dri/r300/compiler/radeon_pair_regalloc.c create mode 100644 src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c create mode 100644 src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/Makefile b/src/mesa/drivers/dri/r300/compiler/Makefile index 0d8dcb9f87..d83888d90a 100644 --- a/src/mesa/drivers/dri/r300/compiler/Makefile +++ b/src/mesa/drivers/dri/r300/compiler/Makefile @@ -13,6 +13,9 @@ C_SOURCES = \ radeon_opcodes.c \ radeon_program_alu.c \ radeon_program_pair.c \ + radeon_pair_translate.c \ + radeon_pair_schedule.c \ + radeon_pair_regalloc.c \ radeon_dataflow.c \ radeon_dataflow_deadcode.c \ radeon_dataflow_swizzles.c \ diff --git a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c index 2dad3dba4a..375838d98e 100644 --- a/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c +++ b/src/mesa/drivers/dri/r300/compiler/r300_fragprog_emit.c @@ -56,7 +56,6 @@ struct r300_emit_state { }; #define PROG_CODE \ - struct r300_emit_state * emit = (struct r300_emit_state*)data; \ struct r300_fragment_program_compiler *c = emit->compiler; \ struct r300_fragment_program_code *code = &c->code->code.r300 @@ -75,6 +74,18 @@ static void use_temporary(struct r300_fragment_program_code *code, unsigned int code->pixsize = index; } +static unsigned int use_source(struct r300_fragment_program_code* code, struct radeon_pair_instruction_source src) +{ + if (src.File == RC_FILE_CONSTANT) { + return src.Index | (1 << 5); + } else if (src.File == RC_FILE_TEMPORARY) { + use_temporary(code, src.Index); + return src.Index; + } + + return 0; +} + static unsigned int translate_rgb_opcode(struct r300_fragment_program_compiler * c, rc_opcode opcode) { @@ -120,7 +131,7 @@ static unsigned int translate_alpha_opcode(struct r300_fragment_program_compiler /** * Emit one paired ALU instruction. */ -static int emit_alu(void* data, struct radeon_pair_instruction* inst) +static int emit_alu(struct r300_emit_state * emit, struct rc_pair_instruction* inst) { PROG_CODE; @@ -136,14 +147,10 @@ static int emit_alu(void* data, struct radeon_pair_instruction* inst) code->alu.inst[ip].alpha_inst = translate_alpha_opcode(c, inst->Alpha.Opcode); for(j = 0; j < 3; ++j) { - unsigned int src = inst->RGB.Src[j].Index | (inst->RGB.Src[j].Constant << 5); - if (!inst->RGB.Src[j].Constant) - use_temporary(code, inst->RGB.Src[j].Index); + unsigned int src = use_source(code, inst->RGB.Src[j]); code->alu.inst[ip].rgb_addr |= src << (6*j); - src = inst->Alpha.Src[j].Index | (inst->Alpha.Src[j].Constant << 5); - if (!inst->Alpha.Src[j].Constant) - use_temporary(code, inst->Alpha.Src[j].Index); + src = use_source(code, inst->Alpha.Src[j]); code->alu.inst[ip].alpha_addr |= src << (6*j); unsigned int arg = r300FPTranslateRGBSwizzle(inst->RGB.Arg[j].Source, inst->RGB.Arg[j].Swizzle); @@ -203,7 +210,7 @@ static int finish_node(struct r300_emit_state * emit) if (code->alu.length == emit->node_first_alu) { /* Generate a single NOP for this node */ - struct radeon_pair_instruction inst; + struct rc_pair_instruction inst; memset(&inst, 0, sizeof(inst)); if (!emit_alu(emit, &inst)) return 0; @@ -248,7 +255,7 @@ static int finish_node(struct r300_emit_state * emit) * Begin a block of texture instructions. * Create the necessary indirection. */ -static int begin_tex(void* data) +static int begin_tex(struct r300_emit_state * emit) { PROG_CODE; @@ -273,7 +280,7 @@ static int begin_tex(void* data) } -static int emit_tex(void* data, struct radeon_pair_texture_instruction* inst) +static int emit_tex(struct r300_emit_state * emit, struct rc_instruction * inst) { PROG_CODE; @@ -282,31 +289,31 @@ static int emit_tex(void* data, struct radeon_pair_texture_instruction* inst) return 0; } - unsigned int unit = inst->TexSrcUnit; - unsigned int dest = inst->DestIndex; + unsigned int unit = inst->U.I.TexSrcUnit; + unsigned int dest = inst->U.I.DstReg.Index; unsigned int opcode; - switch(inst->Opcode) { - case RADEON_OPCODE_KIL: opcode = R300_TEX_OP_KIL; break; - case RADEON_OPCODE_TEX: opcode = R300_TEX_OP_LD; break; - case RADEON_OPCODE_TXB: opcode = R300_TEX_OP_TXB; break; - case RADEON_OPCODE_TXP: opcode = R300_TEX_OP_TXP; break; + switch(inst->U.I.Opcode) { + case RC_OPCODE_KIL: opcode = R300_TEX_OP_KIL; break; + case RC_OPCODE_TEX: opcode = R300_TEX_OP_LD; break; + case RC_OPCODE_TXB: opcode = R300_TEX_OP_TXB; break; + case RC_OPCODE_TXP: opcode = R300_TEX_OP_TXP; break; default: - error("Unknown texture opcode %i", inst->Opcode); + error("Unknown texture opcode %i", inst->U.I.Opcode); return 0; } - if (inst->Opcode == RADEON_OPCODE_KIL) { + if (inst->U.I.Opcode == RC_OPCODE_KIL) { unit = 0; dest = 0; } else { use_temporary(code, dest); } - use_temporary(code, inst->SrcIndex); + use_temporary(code, inst->U.I.SrcReg[0].Index); code->tex.inst[code->tex.length++] = - (inst->SrcIndex << R300_SRC_ADDR_SHIFT) | + (inst->U.I.SrcReg[0].Index << R300_SRC_ADDR_SHIFT) | (dest << R300_DST_ADDR_SHIFT) | (unit << R300_TEX_ID_SHIFT) | (opcode << R300_TEX_INST_SHIFT); @@ -314,13 +321,6 @@ static int emit_tex(void* data, struct radeon_pair_texture_instruction* inst) } -static const struct radeon_pair_handler pair_handler = { - .EmitPaired = &emit_alu, - .EmitTex = &emit_tex, - .BeginTexBlock = &begin_tex, - .MaxHwTemps = R300_PFS_NUM_TEMP_REGS -}; - /** * Final compilation step: Turn the intermediate radeon_program into * machine-readable instructions. @@ -335,7 +335,24 @@ void r300BuildFragmentProgramHwCode(struct r300_fragment_program_compiler *compi memset(code, 0, sizeof(struct r300_fragment_program_code)); - radeonPairProgram(compiler, &pair_handler, &emit); + for(struct rc_instruction * inst = compiler->Base.Program.Instructions.Next; + inst != &compiler->Base.Program.Instructions && !compiler->Base.Error; + inst = inst->Next) { + if (inst->Type == RC_INSTRUCTION_NORMAL) { + if (inst->U.I.Opcode == RC_OPCODE_BEGIN_TEX) { + begin_tex(&emit); + continue; + } + + emit_tex(&emit, inst); + } else { + emit_alu(&emit, &inst->U.P); + } + } + + if (code->pixsize >= R300_PFS_NUM_TEMP_REGS) + rc_error(&compiler->Base, "Too many hardware temporaries used.\n"); + if (compiler->Base.Error) return; diff --git a/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c b/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c index 746e4495fe..5581f25352 100644 --- a/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c +++ b/src/mesa/drivers/dri/r300/compiler/r3xx_fragprog.c @@ -114,6 +114,8 @@ void r3xx_compile_fragment_program(struct r300_fragment_program_compiler* c) } rc_dataflow_deadcode(&c->Base, &dataflow_outputs_mark_use, c); + if (c->Base.Error) + return; if (c->Base.Debug) { fprintf(stderr, "Fragment Program: After deadcode:\n"); @@ -122,6 +124,8 @@ void r3xx_compile_fragment_program(struct r300_fragment_program_compiler* c) } rc_dataflow_swizzles(&c->Base); + if (c->Base.Error) + return; if (c->Base.Debug) { fprintf(stderr, "Compiler: after dataflow passes:\n"); @@ -129,6 +133,40 @@ void r3xx_compile_fragment_program(struct r300_fragment_program_compiler* c) fflush(stderr); } + rc_pair_translate(c); + if (c->Base.Error) + return; + + if (c->Base.Debug) { + fprintf(stderr, "Compiler: after pair translate:\n"); + rc_print_program(&c->Base.Program); + fflush(stderr); + } + + rc_pair_schedule(c); + if (c->Base.Error) + return; + + if (c->Base.Debug) { + fprintf(stderr, "Compiler: after pair scheduling:\n"); + rc_print_program(&c->Base.Program); + fflush(stderr); + } + + if (c->is_r500) + rc_pair_regalloc(c, 128); + else + rc_pair_regalloc(c, R300_PFS_NUM_TEMP_REGS); + + if (c->Base.Error) + return; + + if (c->Base.Debug) { + fprintf(stderr, "Compiler: after pair register allocation:\n"); + rc_print_program(&c->Base.Program); + fflush(stderr); + } + if (c->is_r500) { r500BuildFragmentProgramHwCode(c); } else { diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c index 2f0c0d5283..8f618d88ad 100644 --- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c +++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c @@ -37,10 +37,6 @@ * * \author Corbin Simpson * - * \todo Depth write, WPOS/FOGC inputs - * - * \todo FogOption - * */ #include "r500_fragprog.h" @@ -51,7 +47,6 @@ #define PROG_CODE \ - struct r300_fragment_program_compiler *c = (struct r300_fragment_program_compiler*)data; \ struct r500_fragment_program_code *code = &c->code->code.r500 #define error(fmt, args...) do { \ @@ -114,7 +109,7 @@ static unsigned int fix_hw_swizzle(unsigned int swz) return swz; } -static unsigned int translate_arg_rgb(struct radeon_pair_instruction *inst, int arg) +static unsigned int translate_arg_rgb(struct rc_pair_instruction *inst, int arg) { unsigned int t = inst->RGB.Arg[arg].Source; int comp; @@ -127,7 +122,7 @@ static unsigned int translate_arg_rgb(struct radeon_pair_instruction *inst, int return t; } -static unsigned int translate_arg_alpha(struct radeon_pair_instruction *inst, int i) +static unsigned int translate_arg_alpha(struct rc_pair_instruction *inst, int i) { unsigned int t = inst->Alpha.Arg[i].Source; t |= fix_hw_swizzle(inst->Alpha.Arg[i].Swizzle) << 2; @@ -144,16 +139,21 @@ static void use_temporary(struct r500_fragment_program_code* code, unsigned int static unsigned int use_source(struct r500_fragment_program_code* code, struct radeon_pair_instruction_source src) { - if (!src.Constant) + if (src.File == RC_FILE_CONSTANT) { + return src.Index | 0x100; + } else if (src.File == RC_FILE_TEMPORARY) { use_temporary(code, src.Index); - return src.Index | src.Constant << 8; + return src.Index; + } + + return 0; } /** * Emit a paired ALU instruction. */ -static int emit_paired(void *data, struct radeon_pair_instruction *inst) +static int emit_paired(struct r300_fragment_program_compiler *c, struct rc_pair_instruction *inst) { PROG_CODE; @@ -221,7 +221,7 @@ static unsigned int translate_strq_swizzle(unsigned int swizzle) /** * Emit a single TEX instruction */ -static int emit_tex(void *data, struct radeon_pair_texture_instruction *inst) +static int emit_tex(struct r300_fragment_program_compiler *c, struct rc_sub_instruction *inst) { PROG_CODE; @@ -233,46 +233,44 @@ static int emit_tex(void *data, struct radeon_pair_texture_instruction *inst) int ip = ++code->inst_end; code->inst[ip].inst0 = R500_INST_TYPE_TEX - | (inst->WriteMask << 11) + | (inst->DstReg.WriteMask << 11) | R500_INST_TEX_SEM_WAIT; code->inst[ip].inst1 = R500_TEX_ID(inst->TexSrcUnit) | R500_TEX_SEM_ACQUIRE | R500_TEX_IGNORE_UNCOVERED; if (inst->TexSrcTarget == RC_TEXTURE_RECT) - code->inst[ip].inst1 |= R500_TEX_UNSCALED; + code->inst[ip].inst1 |= R500_TEX_UNSCALED; switch (inst->Opcode) { - case RADEON_OPCODE_KIL: + case RC_OPCODE_KIL: code->inst[ip].inst1 |= R500_TEX_INST_TEXKILL; break; - case RADEON_OPCODE_TEX: + case RC_OPCODE_TEX: code->inst[ip].inst1 |= R500_TEX_INST_LD; break; - case RADEON_OPCODE_TXB: + case RC_OPCODE_TXB: code->inst[ip].inst1 |= R500_TEX_INST_LODBIAS; break; - case RADEON_OPCODE_TXP: + case RC_OPCODE_TXP: code->inst[ip].inst1 |= R500_TEX_INST_PROJ; break; default: error("emit_tex can't handle opcode %x\n", inst->Opcode); } - code->inst[ip].inst2 = R500_TEX_SRC_ADDR(inst->SrcIndex) - | (translate_strq_swizzle(inst->SrcSwizzle) << 8) - | R500_TEX_DST_ADDR(inst->DestIndex) + use_temporary(code, inst->SrcReg[0].Index); + if (inst->Opcode != RC_OPCODE_KIL) + use_temporary(code, inst->DstReg.Index); + + code->inst[ip].inst2 = R500_TEX_SRC_ADDR(inst->SrcReg[0].Index) + | (translate_strq_swizzle(inst->SrcReg[0].Swizzle) << 8) + | R500_TEX_DST_ADDR(inst->DstReg.Index) | R500_TEX_DST_R_SWIZ_R | R500_TEX_DST_G_SWIZ_G | R500_TEX_DST_B_SWIZ_B | R500_TEX_DST_A_SWIZ_A; return 1; } -static const struct radeon_pair_handler pair_handler = { - .EmitPaired = emit_paired, - .EmitTex = emit_tex, - .MaxHwTemps = 128 -}; - void r500BuildFragmentProgramHwCode(struct r300_fragment_program_compiler *compiler) { struct r500_fragment_program_code *code = &compiler->code->code.r500; @@ -281,7 +279,22 @@ void r500BuildFragmentProgramHwCode(struct r300_fragment_program_compiler *compi code->max_temp_idx = 1; code->inst_end = -1; - radeonPairProgram(compiler, &pair_handler, compiler); + for(struct rc_instruction * inst = compiler->Base.Program.Instructions.Next; + inst != &compiler->Base.Program.Instructions && !compiler->Base.Error; + inst = inst->Next) { + if (inst->Type == RC_INSTRUCTION_NORMAL) { + if (inst->U.I.Opcode == RC_OPCODE_BEGIN_TEX) + continue; + + emit_tex(compiler, &inst->U.I); + } else { + emit_paired(compiler, &inst->U.P); + } + } + + if (code->max_temp_idx >= 128) + rc_error(&compiler->Base, "Too many hardware temporaries used"); + if (compiler->Base.Error) return; diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c index a171d8ab54..58dcb20d29 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c @@ -27,6 +27,136 @@ #include "radeon_dataflow.h" -#include "radeon_compiler.h" +#include "radeon_program.h" +static void reads_normal(struct rc_instruction * fullinst, rc_read_write_fn cb, void * userdata) +{ + struct rc_sub_instruction * inst = &fullinst->U.I; + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->Opcode); + + for(unsigned int src = 0; src < opcode->NumSrcRegs; ++src) { + unsigned int refmask = 0; + + if (inst->SrcReg[src].File == RC_FILE_NONE) + return; + + for(unsigned int chan = 0; chan < 4; ++chan) + refmask |= 1 << GET_SWZ(inst->SrcReg[src].Swizzle, chan); + + refmask &= ~RC_MASK_XYZW; + + for(unsigned int chan = 0; chan < 4; ++chan) { + if (GET_BIT(refmask, chan)) { + cb(userdata, fullinst, inst->SrcReg[src].File, inst->SrcReg[src].Index, chan); + } + } + + if (refmask && inst->SrcReg[src].RelAddr) + cb(userdata, fullinst, RC_FILE_ADDRESS, 0, RC_MASK_X); + } +} + +static void reads_pair(struct rc_instruction * fullinst, rc_read_write_fn cb, void * userdata) +{ + struct rc_pair_instruction * inst = &fullinst->U.P; + unsigned int refmasks[3] = { 0, 0, 0 }; + + if (inst->RGB.Opcode != RC_OPCODE_NOP) { + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->RGB.Opcode); + + for(unsigned int arg = 0; arg < opcode->NumSrcRegs; ++arg) { + for(unsigned int chan = 0; chan < 3; ++chan) { + unsigned int swz = GET_SWZ(inst->RGB.Arg[arg].Swizzle, chan); + if (swz < 4) + refmasks[inst->RGB.Arg[arg].Source] |= 1 << swz; + } + } + } + + if (inst->Alpha.Opcode != RC_OPCODE_NOP) { + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->Alpha.Opcode); + + for(unsigned int arg = 0; arg < opcode->NumSrcRegs; ++arg) { + if (inst->Alpha.Arg[arg].Swizzle < 4) + refmasks[inst->Alpha.Arg[arg].Source] |= 1 << inst->Alpha.Arg[arg].Swizzle; + } + } + + for(unsigned int src = 0; src < 3; ++src) { + if (inst->RGB.Src[src].Used) { + for(unsigned int chan = 0; chan < 3; ++chan) { + if (GET_BIT(refmasks[src], chan)) + cb(userdata, fullinst, inst->RGB.Src[src].File, inst->RGB.Src[src].Index, chan); + } + } + + if (inst->Alpha.Src[src].Used) { + if (GET_BIT(refmasks[src], 3)) + cb(userdata, fullinst, inst->Alpha.Src[src].File, inst->Alpha.Src[src].Index, 3); + } + } +} + +/** + * Calls a callback function for all sourced register channels. + * + * This is conservative, i.e. channels may be called multiple times, + * and the writemask of the instruction is not taken into account. + */ +void rc_for_all_reads(struct rc_instruction * inst, rc_read_write_fn cb, void * userdata) +{ + if (inst->Type == RC_INSTRUCTION_NORMAL) { + reads_normal(inst, cb, userdata); + } else { + reads_pair(inst, cb, userdata); + } +} + + + +static void writes_normal(struct rc_instruction * fullinst, rc_read_write_fn cb, void * userdata) +{ + struct rc_sub_instruction * inst = &fullinst->U.I; + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->Opcode); + + if (opcode->HasDstReg) { + for(unsigned int chan = 0; chan < 4; ++chan) { + if (GET_BIT(inst->DstReg.WriteMask, chan)) + cb(userdata, fullinst, inst->DstReg.File, inst->DstReg.Index, chan); + } + } + + if (inst->WriteALUResult) + cb(userdata, fullinst, RC_FILE_SPECIAL, RC_SPECIAL_ALU_RESULT, 0); +} + +static void writes_pair(struct rc_instruction * fullinst, rc_read_write_fn cb, void * userdata) +{ + struct rc_pair_instruction * inst = &fullinst->U.P; + + for(unsigned int chan = 0; chan < 3; ++chan) { + if (GET_BIT(inst->RGB.WriteMask, chan)) + cb(userdata, fullinst, RC_FILE_TEMPORARY, inst->RGB.DestIndex, chan); + } + + if (inst->Alpha.WriteMask) + cb(userdata, fullinst, RC_FILE_TEMPORARY, inst->Alpha.DestIndex, 3); + + if (inst->WriteALUResult) + cb(userdata, fullinst, RC_FILE_SPECIAL, RC_SPECIAL_ALU_RESULT, 0); +} + +/** + * Calls a callback function for all written register channels. + * + * \warning Does not report output registers for paired instructions! + */ +void rc_for_all_writes(struct rc_instruction * inst, rc_read_write_fn cb, void * userdata) +{ + if (inst->Type == RC_INSTRUCTION_NORMAL) { + writes_normal(inst, cb, userdata); + } else { + writes_pair(inst, cb, userdata); + } +} diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.h b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.h index 76c323d057..5aa4cb64f3 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.h @@ -35,6 +35,17 @@ struct rc_instruction; struct rc_swizzle_caps; +/** + * Help analyze the register accesses of instructions. + */ +/*@{*/ +typedef void (*rc_read_write_fn)(void * userdata, struct rc_instruction * inst, + rc_register_file file, unsigned int index, unsigned int chan); +void rc_for_all_reads(struct rc_instruction * inst, rc_read_write_fn cb, void * userdata); +void rc_for_all_writes(struct rc_instruction * inst, rc_read_write_fn cb, void * userdata); +/*@}*/ + + /** * Compiler passes based on dataflow analysis. */ diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c index e097a62b55..a5072b5e1e 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c @@ -363,6 +363,10 @@ struct rc_opcode_info rc_opcodes[MAX_RC_OPCODE] = { .Opcode = RC_OPCODE_REPL_ALPHA, .Name = "REPL_ALPHA", .HasDstReg = 1 + }, + { + .Opcode = RC_OPCODE_BEGIN_TEX, + .Name = "BEGIN_TEX" } }; diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h index f8ba5255ca..c9c5b9f80f 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h @@ -183,6 +183,11 @@ typedef enum { * across all other channels */ RC_OPCODE_REPL_ALPHA, + /** special instruction, used in R300-R500 fragment programs + * to indicate the start of a block of texture instructions that + * can run simultaneously. */ + RC_OPCODE_BEGIN_TEX, + MAX_RC_OPCODE } rc_opcode; diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_pair_regalloc.c b/src/mesa/drivers/dri/r300/compiler/radeon_pair_regalloc.c new file mode 100644 index 0000000000..e39ac2f510 --- /dev/null +++ b/src/mesa/drivers/dri/r300/compiler/radeon_pair_regalloc.c @@ -0,0 +1,349 @@ +/* + * Copyright (C) 2009 Nicolai Haehnle. + * + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 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. + * + */ + +#include "radeon_program_pair.h" + +#include + +#include "radeon_compiler.h" +#include "radeon_dataflow.h" + + +#define VERBOSE 0 + +#define DBG(...) do { if (VERBOSE) fprintf(stderr, __VA_ARGS__); } while(0) + + +struct live_intervals { + int Start; + int End; + struct live_intervals * Next; +}; + +struct register_info { + struct live_intervals Live; + + unsigned int Used:1; + unsigned int Allocated:1; + rc_register_file File:3; + unsigned int Index:RC_REGISTER_INDEX_BITS; +}; + +struct hardware_register { + struct live_intervals * Used; +}; + +struct regalloc_state { + struct radeon_compiler * C; + + struct register_info Input[RC_REGISTER_MAX_INDEX]; + struct register_info Temporary[RC_REGISTER_MAX_INDEX]; + + struct hardware_register * HwTemporary; + unsigned int NumHwTemporaries; +}; + +static void print_live_intervals(struct live_intervals * src) +{ + if (!src) { + DBG("(null)"); + return; + } + + while(src) { + DBG("(%i,%i)", src->Start, src->End); + src = src->Next; + } +} + +static void add_live_intervals(struct regalloc_state * s, + struct live_intervals ** dst, struct live_intervals * src) +{ + struct live_intervals ** dst_backup = dst; + + if (VERBOSE) { + DBG("add_live_intervals: "); + print_live_intervals(*dst); + DBG(" to "); + print_live_intervals(src); + DBG("\n"); + } + + while(src) { + if (*dst && (*dst)->End < src->Start) { + dst = &(*dst)->Next; + } else if (!*dst || (*dst)->Start > src->End) { + struct live_intervals * li = memory_pool_malloc(&s->C->Pool, sizeof(*li)); + li->Start = src->Start; + li->End = src->End; + li->Next = *dst; + *dst = li; + src = src->Next; + } else { + if (src->End > (*dst)->End) + (*dst)->End = src->End; + if (src->Start < (*dst)->Start) + (*dst)->Start = src->Start; + src = src->Next; + } + } + + if (VERBOSE) { + DBG(" result: "); + print_live_intervals(*dst_backup); + DBG("\n"); + } +} + +static int overlap_live_intervals(struct live_intervals * dst, struct live_intervals * src) +{ + if (VERBOSE) { + DBG("overlap_live_intervals: "); + print_live_intervals(dst); + DBG(" to "); + print_live_intervals(src); + DBG("\n"); + } + + while(src && dst) { + if (dst->End <= src->Start) { + dst = dst->Next; + } else if (dst->End <= src->End) { + DBG(" overlap\n"); + return 1; + } else if (dst->Start < src->End) { + DBG(" overlap\n"); + return 1; + } else { + src = src->Next; + } + } + + DBG(" no overlap\n"); + + return 0; +} + +static int try_add_live_intervals(struct regalloc_state * s, + struct live_intervals ** dst, struct live_intervals * src) +{ + if (overlap_live_intervals(*dst, src)) + return 0; + + add_live_intervals(s, dst, src); + return 1; +} + +static void scan_callback(void * data, struct rc_instruction * inst, + rc_register_file file, unsigned int index, unsigned int chan) +{ + struct regalloc_state * s = data; + struct register_info * reg; + + if (file == RC_FILE_TEMPORARY) + reg = &s->Temporary[index]; + else if (file == RC_FILE_INPUT) + reg = &s->Input[index]; + else + return; + + if (!reg->Used) { + reg->Used = 1; + if (file == RC_FILE_INPUT) + reg->Live.Start = -1; + else + reg->Live.Start = inst->IP; + } else { + if (inst->IP > reg->Live.End) + reg->Live.End = inst->IP; + } +} + +static void compute_live_intervals(struct regalloc_state * s) +{ + rc_recompute_ips(s->C); + + for(struct rc_instruction * inst = s->C->Program.Instructions.Next; + inst != &s->C->Program.Instructions; + inst = inst->Next) { + rc_for_all_reads(inst, scan_callback, s); + rc_for_all_writes(inst, scan_callback, s); + } +} + +static void rewrite_register(struct regalloc_state * s, + rc_register_file * file, unsigned int * index) +{ + const struct register_info * reg; + + if (*file == RC_FILE_TEMPORARY) + reg = &s->Temporary[*index]; + else if (*file == RC_FILE_INPUT) + reg = &s->Input[*index]; + else + return; + + if (reg->Allocated) { + *file = reg->File; + *index = reg->Index; + } +} + +static void rewrite_normal_instruction(struct regalloc_state * s, struct rc_sub_instruction * inst) +{ + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->Opcode); + + if (opcode->HasDstReg) { + rc_register_file file = inst->DstReg.File; + unsigned int index = inst->DstReg.Index; + + rewrite_register(s, &file, &index); + + inst->DstReg.File = file; + inst->DstReg.Index = index; + } + + for(unsigned int src = 0; src < opcode->NumSrcRegs; ++src) { + rc_register_file file = inst->SrcReg[src].File; + unsigned int index = inst->SrcReg[src].Index; + + rewrite_register(s, &file, &index); + + inst->SrcReg[src].File = file; + inst->SrcReg[src].Index = index; + } +} + +static void rewrite_pair_instruction(struct regalloc_state * s, struct rc_pair_instruction * inst) +{ + if (inst->RGB.WriteMask) { + rc_register_file file = RC_FILE_TEMPORARY; + unsigned int index = inst->RGB.DestIndex; + + rewrite_register(s, &file, &index); + + inst->RGB.DestIndex = index; + } + + if (inst->Alpha.WriteMask) { + rc_register_file file = RC_FILE_TEMPORARY; + unsigned int index = inst->Alpha.DestIndex; + + rewrite_register(s, &file, &index); + + inst->Alpha.DestIndex = index; + } + + for(unsigned int src = 0; src < 3; ++src) { + if (inst->RGB.Src[src].Used) { + rc_register_file file = inst->RGB.Src[src].File; + unsigned int index = inst->RGB.Src[src].Index; + + rewrite_register(s, &file, &index); + + inst->RGB.Src[src].File = file; + inst->RGB.Src[src].Index = index; + } + + if (inst->Alpha.Src[src].Used) { + rc_register_file file = inst->Alpha.Src[src].File; + unsigned int index = inst->Alpha.Src[src].Index; + + rewrite_register(s, &file, &index); + + inst->Alpha.Src[src].File = file; + inst->Alpha.Src[src].Index = index; + } + } +} + +static void do_regalloc(struct regalloc_state * s) +{ + /* Simple and stupid greedy register allocation */ + for(unsigned int index = 0; index < RC_REGISTER_MAX_INDEX; ++index) { + struct register_info * reg = &s->Temporary[index]; + + if (!reg->Used) + continue; + + for(unsigned int hwreg = 0; hwreg < s->NumHwTemporaries; ++hwreg) { + if (try_add_live_intervals(s, &s->HwTemporary[hwreg].Used, ®->Live)) { + reg->Allocated = 1; + reg->File = RC_FILE_TEMPORARY; + reg->Index = hwreg; + goto success; + } + } + + rc_error(s->C, "Ran out of hardware temporaries\n"); + return; + + success:; + } + + /* Rewrite all instructions based on the translation table we built */ + for(struct rc_instruction * inst = s->C->Program.Instructions.Next; + inst != &s->C->Program.Instructions; + inst = inst->Next) { + if (inst->Type == RC_INSTRUCTION_NORMAL) + rewrite_normal_instruction(s, &inst->U.I); + else + rewrite_pair_instruction(s, &inst->U.P); + } +} + +static void alloc_input(void * data, unsigned int input, unsigned int hwreg) +{ + struct regalloc_state * s = data; + + if (!s->Input[input].Used) + return; + + add_live_intervals(s, &s->HwTemporary[hwreg].Used, &s->Input[input].Live); + + s->Input[input].Allocated = 1; + s->Input[input].File = RC_FILE_TEMPORARY; + s->Input[input].Index = hwreg; + +} + +void rc_pair_regalloc(struct r300_fragment_program_compiler *c, unsigned maxtemps) +{ + struct regalloc_state s; + + memset(&s, 0, sizeof(s)); + s.C = &c->Base; + s.NumHwTemporaries = maxtemps; + s.HwTemporary = memory_pool_malloc(&s.C->Pool, maxtemps*sizeof(struct hardware_register)); + memset(s.HwTemporary, 0, maxtemps*sizeof(struct hardware_register)); + + compute_live_intervals(&s); + + c->AllocateHwInputs(c, &alloc_input, &s); + + do_regalloc(&s); +} diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c b/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c new file mode 100644 index 0000000000..8a4b5ac8a9 --- /dev/null +++ b/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c @@ -0,0 +1,479 @@ +/* + * Copyright (C) 2009 Nicolai Haehnle. + * + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 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. + * + */ + +#include "radeon_program_pair.h" + +#include + +#include "radeon_compiler.h" +#include "radeon_dataflow.h" + + +#define VERBOSE 0 + +#define DBG(...) do { if (VERBOSE) fprintf(stderr, __VA_ARGS__); } while(0) + +struct schedule_instruction { + struct rc_instruction * Instruction; + + /** Next instruction in the linked list of ready instructions. */ + struct schedule_instruction *NextReady; + + /** Values that this instruction reads and writes */ + struct reg_value * WriteValues[4]; + struct reg_value * ReadValues[12]; + unsigned int NumWriteValues:3; + unsigned int NumReadValues:4; + + /** + * Number of (read and write) dependencies that must be resolved before + * this instruction can be scheduled. + */ + unsigned int NumDependencies:5; +}; + + +/** + * Used to keep track of which instructions read a value. + */ +struct reg_value_reader { + struct schedule_instruction *Reader; + struct reg_value_reader *Next; +}; + +/** + * Used to keep track which values are stored in each component of a + * RC_FILE_TEMPORARY. + */ +struct reg_value { + struct schedule_instruction * Writer; + + /** + * Unordered linked list of instructions that read from this value. + * When this value becomes available, we increase all readers' + * dependency count. + */ + struct reg_value_reader *Readers; + + /** + * Number of readers of this value. This is decremented each time + * a reader of the value is committed. + * When the reader cound reaches zero, the dependency count + * of the instruction writing \ref Next is decremented. + */ + unsigned int NumReaders; + + struct reg_value *Next; /**< Pointer to the next value to be written to the same register */ +}; + +struct register_state { + struct reg_value * Values[4]; +}; + +struct schedule_state { + struct radeon_compiler * C; + struct schedule_instruction * Current; + + struct register_state Temporary[RC_REGISTER_MAX_INDEX]; + + /** + * Linked lists of instructions that can be scheduled right now, + * based on which ALU/TEX resources they require. + */ + /*@{*/ + struct schedule_instruction *ReadyFullALU; + struct schedule_instruction *ReadyRGB; + struct schedule_instruction *ReadyAlpha; + struct schedule_instruction *ReadyTEX; + /*@}*/ +}; + +static struct reg_value ** get_reg_valuep(struct schedule_state * s, + rc_register_file file, unsigned int index, unsigned int chan) +{ + if (file != RC_FILE_TEMPORARY) + return 0; + + if (index >= RC_REGISTER_MAX_INDEX) { + rc_error(s->C, "%s: index %i out of bounds\n", __FUNCTION__, index); + return 0; + } + + return &s->Temporary[index].Values[chan]; +} + +static struct reg_value * get_reg_value(struct schedule_state * s, + rc_register_file file, unsigned int index, unsigned int chan) +{ + struct reg_value ** pv = get_reg_valuep(s, file, index, chan); + if (!pv) + return 0; + return *pv; +} + +static void add_inst_to_list(struct schedule_instruction ** list, struct schedule_instruction * inst) +{ + inst->NextReady = *list; + *list = inst; +} + +static void instruction_ready(struct schedule_state * s, struct schedule_instruction * sinst) +{ + DBG("%i is now ready\n", sinst->Instruction->IP); + + if (sinst->Instruction->Type == RC_INSTRUCTION_NORMAL) + add_inst_to_list(&s->ReadyTEX, sinst); + else if (sinst->Instruction->U.P.Alpha.Opcode == RC_OPCODE_NOP) + add_inst_to_list(&s->ReadyRGB, sinst); + else if (sinst->Instruction->U.P.RGB.Opcode == RC_OPCODE_NOP) + add_inst_to_list(&s->ReadyAlpha, sinst); + else + add_inst_to_list(&s->ReadyFullALU, sinst); +} + +static void decrease_dependencies(struct schedule_state * s, struct schedule_instruction * sinst) +{ + assert(sinst->NumDependencies > 0); + sinst->NumDependencies--; + if (!sinst->NumDependencies) + instruction_ready(s, sinst); +} + +static void commit_instruction(struct schedule_state * s, struct schedule_instruction * sinst) +{ + DBG("%i: commit\n", sinst->Instruction->IP); + + for(unsigned int i = 0; i < sinst->NumReadValues; ++i) { + struct reg_value * v = sinst->ReadValues[i]; + assert(v->NumReaders > 0); + v->NumReaders--; + if (!v->NumReaders) { + if (v->Next) + decrease_dependencies(s, v->Next->Writer); + } + } + + for(unsigned int i = 0; i < sinst->NumWriteValues; ++i) { + struct reg_value * v = sinst->WriteValues[i]; + for(struct reg_value_reader * r = v->Readers; r; r = r->Next) { + decrease_dependencies(s, r->Reader); + } + } +} + +/** + * Emit all ready texture instructions in a single block. + * + * Emit as a single block to (hopefully) sample many textures in parallel, + * and to avoid hardware indirections on R300. + */ +static void emit_all_tex(struct schedule_state * s, struct rc_instruction * before) +{ + struct schedule_instruction *readytex; + + assert(s->ReadyTEX); + + /* Don't let the ready list change under us! */ + readytex = s->ReadyTEX; + s->ReadyTEX = 0; + + /* Node marker for R300 */ + struct rc_instruction * inst_begin = rc_insert_new_instruction(s->C, before->Prev); + inst_begin->U.I.Opcode = RC_OPCODE_BEGIN_TEX; + + /* Link texture instructions back in */ + while(readytex) { + struct schedule_instruction * tex = readytex; + readytex = readytex->NextReady; + + rc_insert_instruction(before->Prev, tex->Instruction); + commit_instruction(s, tex); + } +} + + +static int destructive_merge_instructions( + struct rc_pair_instruction * rgb, + struct rc_pair_instruction * alpha) +{ + assert(rgb->Alpha.Opcode == RC_OPCODE_NOP); + assert(alpha->RGB.Opcode == RC_OPCODE_NOP); + + /* Copy alpha args into rgb */ + const struct rc_opcode_info * opcode = rc_get_opcode_info(alpha->Alpha.Opcode); + + for(unsigned int arg = 0; arg < opcode->NumSrcRegs; ++arg) { + unsigned int srcrgb = 0; + unsigned int srcalpha = 0; + unsigned int oldsrc = alpha->Alpha.Arg[arg].Source; + rc_register_file file = 0; + unsigned int index = 0; + + if (alpha->Alpha.Arg[arg].Swizzle < 3) { + srcrgb = 1; + file = alpha->RGB.Src[oldsrc].File; + index = alpha->RGB.Src[oldsrc].Index; + } else if (alpha->Alpha.Arg[arg].Swizzle < 4) { + srcalpha = 1; + file = alpha->Alpha.Src[oldsrc].File; + index = alpha->Alpha.Src[oldsrc].Index; + } + + int source = rc_pair_alloc_source(rgb, srcrgb, srcalpha, file, index); + if (source < 0) + return 0; + + rgb->Alpha.Arg[arg].Source = source; + rgb->Alpha.Arg[arg].Swizzle = alpha->Alpha.Arg[arg].Swizzle; + rgb->Alpha.Arg[arg].Abs = alpha->Alpha.Arg[arg].Abs; + rgb->Alpha.Arg[arg].Negate = alpha->Alpha.Arg[arg].Negate; + } + + /* Copy alpha opcode into rgb */ + rgb->Alpha.Opcode = alpha->Alpha.Opcode; + rgb->Alpha.DestIndex = alpha->Alpha.DestIndex; + rgb->Alpha.WriteMask = alpha->Alpha.WriteMask; + rgb->Alpha.OutputWriteMask = alpha->Alpha.OutputWriteMask; + rgb->Alpha.DepthWriteMask = alpha->Alpha.DepthWriteMask; + rgb->Alpha.Saturate = alpha->Alpha.Saturate; + + /* Merge ALU result writing */ + if (alpha->WriteALUResult) { + if (rgb->WriteALUResult) + return 0; + + rgb->WriteALUResult = alpha->WriteALUResult; + rgb->ALUResultCompare = alpha->ALUResultCompare; + } + + return 1; +} + +/** + * Try to merge the given instructions into the rgb instructions. + * + * Return true on success; on failure, return false, and keep + * the instructions untouched. + */ +static int merge_instructions(struct rc_pair_instruction * rgb, struct rc_pair_instruction * alpha) +{ + struct rc_pair_instruction backup; + + memcpy(&backup, rgb, sizeof(struct rc_pair_instruction)); + + if (destructive_merge_instructions(rgb, alpha)) + return 1; + + memcpy(rgb, &backup, sizeof(struct rc_pair_instruction)); + return 0; +} + + +/** + * Find a good ALU instruction or pair of ALU instruction and emit it. + * + * Prefer emitting full ALU instructions, so that when we reach a point + * where no full ALU instruction can be emitted, we have more candidates + * for RGB/Alpha pairing. + */ +static void emit_one_alu(struct schedule_state *s, struct rc_instruction * before) +{ + struct schedule_instruction * sinst; + + if (s->ReadyFullALU || !(s->ReadyRGB && s->ReadyAlpha)) { + if (s->ReadyFullALU) { + sinst = s->ReadyFullALU; + s->ReadyFullALU = s->ReadyFullALU->NextReady; + } else if (s->ReadyRGB) { + sinst = s->ReadyRGB; + s->ReadyRGB = s->ReadyRGB->NextReady; + } else { + sinst = s->ReadyAlpha; + s->ReadyAlpha = s->ReadyAlpha->NextReady; + } + + rc_insert_instruction(before->Prev, sinst->Instruction); + commit_instruction(s, sinst); + } else { + struct schedule_instruction **prgb; + struct schedule_instruction **palpha; + + /* Some pairings might fail because they require too + * many source slots; try all possible pairings if necessary */ + for(prgb = &s->ReadyRGB; *prgb; prgb = &(*prgb)->NextReady) { + for(palpha = &s->ReadyAlpha; *palpha; palpha = &(*palpha)->NextReady) { + struct schedule_instruction * psirgb = *prgb; + struct schedule_instruction * psialpha = *palpha; + + if (!merge_instructions(&psirgb->Instruction->U.P, &psialpha->Instruction->U.P)) + continue; + + *prgb = (*prgb)->NextReady; + *palpha = (*palpha)->NextReady; + rc_insert_instruction(before->Prev, psirgb->Instruction); + commit_instruction(s, psirgb); + commit_instruction(s, psialpha); + goto success; + } + } + + /* No success in pairing; just take the first RGB instruction */ + sinst = s->ReadyRGB; + s->ReadyRGB = s->ReadyRGB->NextReady; + + rc_insert_instruction(before->Prev, sinst->Instruction); + commit_instruction(s, sinst); + success: ; + } +} + +static void scan_read(void * data, struct rc_instruction * inst, + rc_register_file file, unsigned int index, unsigned int chan) +{ + struct schedule_state * s = data; + struct reg_value * v = get_reg_value(s, file, index, chan); + + if (!v) + return; + + DBG("%i: read %i[%i] chan %i\n", s->Current->Instruction->IP, file, index, chan); + + struct reg_value_reader * reader = memory_pool_malloc(&s->C->Pool, sizeof(*reader)); + reader->Reader = s->Current; + reader->Next = v->Readers; + v->Readers = reader; + v->NumReaders++; + + s->Current->NumDependencies++; + + if (s->Current->NumReadValues >= 12) { + rc_error(s->C, "%s: NumReadValues overflow\n", __FUNCTION__); + } else { + s->Current->ReadValues[s->Current->NumReadValues++] = v; + } +} + +static void scan_write(void * data, struct rc_instruction * inst, + rc_register_file file, unsigned int index, unsigned int chan) +{ + struct schedule_state * s = data; + struct reg_value ** pv = get_reg_valuep(s, file, index, chan); + + if (!pv) + return; + + DBG("%i: write %i[%i] chan %i\n", s->Current->Instruction->IP, file, index, chan); + + struct reg_value * newv = memory_pool_malloc(&s->C->Pool, sizeof(*newv)); + memset(newv, 0, sizeof(*newv)); + + newv->Writer = s->Current; + + if (*pv) { + (*pv)->Next = newv; + s->Current->NumDependencies++; + } + + *pv = newv; + + if (s->Current->NumWriteValues >= 4) { + rc_error(s->C, "%s: NumWriteValues overflow\n", __FUNCTION__); + } else { + s->Current->WriteValues[s->Current->NumWriteValues++] = newv; + } +} + +static void schedule_block(struct r300_fragment_program_compiler * c, + struct rc_instruction * begin, struct rc_instruction * end) +{ + struct schedule_state s; + + memset(&s, 0, sizeof(s)); + s.C = &c->Base; + + /* Scan instructions for data dependencies */ + unsigned int ip = 0; + for(struct rc_instruction * inst = begin; inst != end; inst = inst->Next) { + s.Current = memory_pool_malloc(&c->Base.Pool, sizeof(*s.Current)); + memset(s.Current, 0, sizeof(struct schedule_instruction)); + + s.Current->Instruction = inst; + inst->IP = ip++; + + DBG("%i: Scanning\n", inst->IP); + + rc_for_all_reads(inst, &scan_read, &s); + rc_for_all_writes(inst, &scan_write, &s); + + DBG("%i: Has %i dependencies\n", inst->IP, s.Current->NumDependencies); + + if (!s.Current->NumDependencies) + instruction_ready(&s, s.Current); + } + + /* Temporarily unlink all instructions */ + begin->Prev->Next = end; + end->Prev = begin->Prev; + + /* Schedule instructions back */ + while(!s.C->Error && + (s.ReadyTEX || s.ReadyRGB || s.ReadyAlpha || s.ReadyFullALU)) { + if (s.ReadyTEX) + emit_all_tex(&s, end); + + while(!s.C->Error && (s.ReadyFullALU || s.ReadyRGB || s.ReadyAlpha)) + emit_one_alu(&s, end); + } +} + +static int is_controlflow(struct rc_instruction * inst) +{ + if (inst->Type == RC_INSTRUCTION_NORMAL) { + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); + return opcode->IsControlFlow; + } + return 0; +} + +void rc_pair_schedule(struct r300_fragment_program_compiler *c) +{ + struct rc_instruction * inst = c->Base.Program.Instructions.Next; + while(inst != &c->Base.Program.Instructions) { + if (is_controlflow(inst)) { + inst = inst->Next; + continue; + } + + struct rc_instruction * first = inst; + + while(inst != &c->Base.Program.Instructions && !is_controlflow(inst)) + inst = inst->Next; + + DBG("Schedule one block\n"); + schedule_block(c, first, inst); + } +} diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c b/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c new file mode 100644 index 0000000000..c31891a62f --- /dev/null +++ b/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c @@ -0,0 +1,253 @@ +/* + * Copyright (C) 2009 Nicolai Haehnle. + * + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 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. + * + */ + +#include "radeon_program_pair.h" + +#include "radeon_compiler.h" + + +/** + * Finally rewrite ADD, MOV, MUL as the appropriate native instruction + * and reverse the order of arguments for CMP. + */ +static void final_rewrite(struct rc_sub_instruction *inst) +{ + struct rc_src_register tmp; + + switch(inst->Opcode) { + case RC_OPCODE_ADD: + inst->SrcReg[2] = inst->SrcReg[1]; + inst->SrcReg[1].File = RC_FILE_NONE; + inst->SrcReg[1].Swizzle = RC_SWIZZLE_1111; + inst->SrcReg[1].Negate = RC_MASK_NONE; + inst->Opcode = RC_OPCODE_MAD; + break; + case RC_OPCODE_CMP: + tmp = inst->SrcReg[2]; + inst->SrcReg[2] = inst->SrcReg[0]; + inst->SrcReg[0] = tmp; + break; + case RC_OPCODE_MOV: + /* AMD say we should use CMP. + * However, when we transform + * KIL -r0; + * into + * CMP tmp, -r0, -r0, 0; + * KIL tmp; + * we get incorrect behaviour on R500 when r0 == 0.0. + * It appears that the R500 KIL hardware treats -0.0 as less + * than zero. + */ + inst->SrcReg[1].File = RC_FILE_NONE; + inst->SrcReg[1].Swizzle = RC_SWIZZLE_1111; + inst->SrcReg[2].File = RC_FILE_NONE; + inst->SrcReg[2].Swizzle = RC_SWIZZLE_0000; + inst->Opcode = RC_OPCODE_MAD; + break; + case RC_OPCODE_MUL: + inst->SrcReg[2].File = RC_FILE_NONE; + inst->SrcReg[2].Swizzle = RC_SWIZZLE_0000; + inst->Opcode = RC_OPCODE_MAD; + break; + default: + /* nothing to do */ + break; + } +} + + +/** + * Classify an instruction according to which ALUs etc. it needs + */ +static void classify_instruction(struct rc_sub_instruction * inst, + int * needrgb, int * needalpha, int * istranscendent) +{ + *needrgb = (inst->DstReg.WriteMask & RC_MASK_XYZ) ? 1 : 0; + *needalpha = (inst->DstReg.WriteMask & RC_MASK_W) ? 1 : 0; + *istranscendent = 0; + + if (inst->WriteALUResult == RC_ALURESULT_X) + *needrgb = 1; + else if (inst->WriteALUResult == RC_ALURESULT_W) + *needalpha = 1; + + switch(inst->Opcode) { + case RC_OPCODE_ADD: + case RC_OPCODE_CMP: + case RC_OPCODE_DDX: + case RC_OPCODE_DDY: + case RC_OPCODE_FRC: + case RC_OPCODE_MAD: + case RC_OPCODE_MAX: + case RC_OPCODE_MIN: + case RC_OPCODE_MOV: + case RC_OPCODE_MUL: + break; + case RC_OPCODE_COS: + case RC_OPCODE_EX2: + case RC_OPCODE_LG2: + case RC_OPCODE_RCP: + case RC_OPCODE_RSQ: + case RC_OPCODE_SIN: + *istranscendent = 1; + *needalpha = 1; + break; + case RC_OPCODE_DP4: + *needalpha = 1; + /* fall through */ + case RC_OPCODE_DP3: + *needrgb = 1; + break; + default: + break; + } +} + + +/** + * Fill the given ALU instruction's opcodes and source operands into the given pair, + * if possible. + */ +static void set_pair_instruction(struct r300_fragment_program_compiler *c, + struct rc_pair_instruction * pair, + struct rc_sub_instruction * inst) +{ + memset(pair, 0, sizeof(struct rc_pair_instruction)); + + int needrgb, needalpha, istranscendent; + classify_instruction(inst, &needrgb, &needalpha, &istranscendent); + + if (needrgb) { + if (istranscendent) + pair->RGB.Opcode = RC_OPCODE_REPL_ALPHA; + else + pair->RGB.Opcode = inst->Opcode; + if (inst->SaturateMode == RC_SATURATE_ZERO_ONE) + pair->RGB.Saturate = 1; + } + if (needalpha) { + pair->Alpha.Opcode = inst->Opcode; + if (inst->SaturateMode == RC_SATURATE_ZERO_ONE) + pair->Alpha.Saturate = 1; + } + + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->Opcode); + int nargs = opcode->NumSrcRegs; + int i; + + /* Special case for DDX/DDY (MDH/MDV). */ + if (inst->Opcode == RC_OPCODE_DDX || inst->Opcode == RC_OPCODE_DDY) { + nargs++; + } + + for(i = 0; i < opcode->NumSrcRegs; ++i) { + int source; + if (needrgb && !istranscendent) { + unsigned int srcrgb = 0; + unsigned int srcalpha = 0; + int j; + for(j = 0; j < 3; ++j) { + unsigned int swz = GET_SWZ(inst->SrcReg[i].Swizzle, j); + if (swz < 3) + srcrgb = 1; + else if (swz < 4) + srcalpha = 1; + } + source = rc_pair_alloc_source(pair, srcrgb, srcalpha, + inst->SrcReg[i].File, inst->SrcReg[i].Index); + pair->RGB.Arg[i].Source = source; + pair->RGB.Arg[i].Swizzle = inst->SrcReg[i].Swizzle & 0x1ff; + pair->RGB.Arg[i].Abs = inst->SrcReg[i].Abs; + pair->RGB.Arg[i].Negate = !!(inst->SrcReg[i].Negate & (RC_MASK_X | RC_MASK_Y | RC_MASK_Z)); + } + if (needalpha) { + unsigned int srcrgb = 0; + unsigned int srcalpha = 0; + unsigned int swz = GET_SWZ(inst->SrcReg[i].Swizzle, istranscendent ? 0 : 3); + if (swz < 3) + srcrgb = 1; + else if (swz < 4) + srcalpha = 1; + source = rc_pair_alloc_source(pair, srcrgb, srcalpha, + inst->SrcReg[i].File, inst->SrcReg[i].Index); + pair->Alpha.Arg[i].Source = source; + pair->Alpha.Arg[i].Swizzle = swz; + pair->Alpha.Arg[i].Abs = inst->SrcReg[i].Abs; + pair->Alpha.Arg[i].Negate = !!(inst->SrcReg[i].Negate & RC_MASK_W); + } + } + + /* Destination handling */ + if (inst->DstReg.File == RC_FILE_OUTPUT) { + if (inst->DstReg.Index == c->OutputColor) { + pair->RGB.OutputWriteMask |= inst->DstReg.WriteMask & RC_MASK_XYZ; + pair->Alpha.OutputWriteMask |= GET_BIT(inst->DstReg.WriteMask, 3); + } else if (inst->DstReg.Index == c->OutputDepth) { + pair->Alpha.DepthWriteMask |= GET_BIT(inst->DstReg.WriteMask, 3); + } + } else { + if (needrgb) { + pair->RGB.DestIndex = inst->DstReg.Index; + pair->RGB.WriteMask |= inst->DstReg.WriteMask & RC_MASK_XYZ; + } + if (needalpha) { + pair->Alpha.DestIndex = inst->DstReg.Index; + pair->Alpha.WriteMask |= GET_BIT(inst->DstReg.WriteMask, 3); + } + } + + if (inst->WriteALUResult) { + pair->WriteALUResult = inst->WriteALUResult; + pair->ALUResultCompare = inst->ALUResultCompare; + } +} + + +/** + * Translate all ALU instructions into corresponding pair instructions, + * performing no other changes. + */ +void rc_pair_translate(struct r300_fragment_program_compiler *c) +{ + for(struct rc_instruction * inst = c->Base.Program.Instructions.Next; + inst != &c->Base.Program.Instructions; + inst = inst->Next) { + if (inst->Type != RC_INSTRUCTION_NORMAL) + continue; + + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); + + if (opcode->HasTexture || opcode->IsControlFlow || opcode->Opcode == RC_OPCODE_KIL) + continue; + + struct rc_sub_instruction copy = inst->U.I; + + final_rewrite(©); + inst->Type = RC_INSTRUCTION_PAIR; + set_pair_instruction(c, &inst->U.P, ©); + } +} diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program.c b/src/mesa/drivers/dri/r300/compiler/radeon_program.c index 68a093b8c0..0dbc5380bb 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program.c @@ -138,16 +138,20 @@ struct rc_instruction *rc_alloc_instruction(struct radeon_compiler * c) return inst; } - -struct rc_instruction *rc_insert_new_instruction(struct radeon_compiler * c, struct rc_instruction * after) +void rc_insert_instruction(struct rc_instruction * after, struct rc_instruction * inst) { - struct rc_instruction * inst = rc_alloc_instruction(c); - inst->Prev = after; inst->Next = after->Next; inst->Prev->Next = inst; inst->Next->Prev = inst; +} + +struct rc_instruction *rc_insert_new_instruction(struct radeon_compiler * c, struct rc_instruction * after) +{ + struct rc_instruction * inst = rc_alloc_instruction(c); + + rc_insert_instruction(after, inst); return inst; } diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program.h b/src/mesa/drivers/dri/r300/compiler/radeon_program.h index 067cb545fd..33db3ea0ff 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program.h @@ -34,6 +34,7 @@ #include "radeon_opcodes.h" #include "radeon_code.h" #include "radeon_program_constants.h" +#include "radeon_program_pair.h" struct radeon_compiler; @@ -121,6 +122,7 @@ struct rc_instruction { rc_instruction_type Type; union { struct rc_sub_instruction I; + struct rc_pair_instruction P; } U; /** @@ -221,6 +223,7 @@ unsigned int rc_find_free_temporary(struct radeon_compiler * c); struct rc_instruction *rc_alloc_instruction(struct radeon_compiler * c); struct rc_instruction *rc_insert_new_instruction(struct radeon_compiler * c, struct rc_instruction * after); +void rc_insert_instruction(struct rc_instruction * after, struct rc_instruction * inst); void rc_remove_instruction(struct rc_instruction * inst); unsigned int rc_recompute_ips(struct radeon_compiler * c); diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.c b/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.c index 0d8d8e0b3b..ee839596aa 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2008 Nicolai Haehnle. + * Copyright (C) 2008-2009 Nicolai Haehnle. * * All Rights Reserved. * @@ -25,581 +25,29 @@ * */ -/** - * @file - * - * Perform temporary register allocation and attempt to pair off instructions - * in RGB and Alpha pairs. Also attempts to optimize the TEX instruction - * vs. ALU instruction scheduling. - */ - #include "radeon_program_pair.h" -#include - -#include "memory_pool.h" -#include "radeon_compiler.h" - -#define error(fmt, args...) do { \ - rc_error(&s->Compiler->Base, "%s::%s(): " fmt "\n", \ - __FILE__, __FUNCTION__, ##args); \ -} while(0) - -struct pair_state_instruction { - struct rc_sub_instruction Instruction; - unsigned int IP; /**< Position of this instruction in original program */ - - unsigned int IsTex:1; /**< Is a texture instruction */ - unsigned int NeedRGB:1; /**< Needs the RGB ALU */ - unsigned int NeedAlpha:1; /**< Needs the Alpha ALU */ - unsigned int IsTranscendent:1; /**< Is a special transcendent instruction */ - - /** - * Number of (read and write) dependencies that must be resolved before - * this instruction can be scheduled. - */ - unsigned int NumDependencies:5; - - /** - * Next instruction in the linked list of ready instructions. - */ - struct pair_state_instruction *NextReady; - - /** - * Values that this instruction writes - */ - struct reg_value *Values[4]; -}; - - -/** - * Used to keep track of which instructions read a value. - */ -struct reg_value_reader { - struct pair_state_instruction *Reader; - struct reg_value_reader *Next; -}; - -/** - * Used to keep track which values are stored in each component of a - * RC_FILE_TEMPORARY. - */ -struct reg_value { - struct pair_state_instruction *Writer; - struct reg_value *Next; /**< Pointer to the next value to be written to the same RC_FILE_TEMPORARY component */ - - /** - * Unordered linked list of instructions that read from this value. - */ - struct reg_value_reader *Readers; - - /** - * Number of readers of this value. This is calculated during @ref scan_instructions - * and continually decremented during code emission. - * When this count reaches zero, the instruction that writes the @ref Next value - * can be scheduled. - */ - unsigned int NumReaders; -}; - -/** - * Used to translate a RC_FILE_INPUT or RC_FILE_TEMPORARY Mesa register - * to the proper hardware temporary. - */ -struct pair_register_translation { - unsigned int Allocated:1; - unsigned int HwIndex:8; - unsigned int RefCount:23; /**< # of times this occurs in an unscheduled instruction SrcReg or DstReg */ - - /** - * Notes the value that is currently contained in each component - * (only used for RC_FILE_TEMPORARY registers). - */ - struct reg_value *Value[4]; -}; - -struct pair_state { - struct r300_fragment_program_compiler * Compiler; - const struct radeon_pair_handler *Handler; - unsigned int Verbose; - void *UserData; - - /** - * Translate Mesa registers to hardware registers - */ - struct pair_register_translation Inputs[RC_REGISTER_MAX_INDEX]; - struct pair_register_translation Temps[RC_REGISTER_MAX_INDEX]; - - struct { - unsigned int RefCount; /**< # of times this occurs in an unscheduled SrcReg or DstReg */ - } HwTemps[128]; - - /** - * Linked list of instructions that can be scheduled right now, - * based on which ALU/TEX resources they require. - */ - struct pair_state_instruction *ReadyFullALU; - struct pair_state_instruction *ReadyRGB; - struct pair_state_instruction *ReadyAlpha; - struct pair_state_instruction *ReadyTEX; -}; - - -static struct pair_register_translation *get_register(struct pair_state *s, rc_register_file file, unsigned int index) -{ - switch(file) { - case RC_FILE_TEMPORARY: return &s->Temps[index]; - case RC_FILE_INPUT: return &s->Inputs[index]; - default: return 0; - } -} - -static void alloc_hw_reg(struct pair_state *s, rc_register_file file, unsigned int index, unsigned int hwindex) -{ - struct pair_register_translation *t = get_register(s, file, index); - assert(!s->HwTemps[hwindex].RefCount); - assert(!t->Allocated); - s->HwTemps[hwindex].RefCount = t->RefCount; - t->Allocated = 1; - t->HwIndex = hwindex; -} - -static unsigned int get_hw_reg(struct pair_state *s, rc_register_file file, unsigned int index) -{ - unsigned int hwindex; - - struct pair_register_translation *t = get_register(s, file, index); - if (!t) { - error("get_hw_reg: %i[%i]\n", file, index); - return 0; - } - - if (t->Allocated) - return t->HwIndex; - - for(hwindex = 0; hwindex < s->Handler->MaxHwTemps; ++hwindex) - if (!s->HwTemps[hwindex].RefCount) - break; - - if (hwindex >= s->Handler->MaxHwTemps) { - error("Ran out of hardware temporaries"); - return 0; - } - - alloc_hw_reg(s, file, index, hwindex); - return hwindex; -} - - -static void deref_hw_reg(struct pair_state *s, unsigned int hwindex) -{ - if (!s->HwTemps[hwindex].RefCount) { - error("Hwindex %i refcount error", hwindex); - return; - } - - s->HwTemps[hwindex].RefCount--; -} - -static void add_pairinst_to_list(struct pair_state_instruction **list, struct pair_state_instruction *pairinst) -{ - pairinst->NextReady = *list; - *list = pairinst; -} - -/** - * The given instruction has become ready. Link it into the ready - * instructions. - */ -static void instruction_ready(struct pair_state *s, struct pair_state_instruction *pairinst) -{ - if (s->Verbose) - fprintf(stderr, "instruction_ready(%i)\n", pairinst->IP); - - if (pairinst->IsTex) - add_pairinst_to_list(&s->ReadyTEX, pairinst); - else if (!pairinst->NeedAlpha) - add_pairinst_to_list(&s->ReadyRGB, pairinst); - else if (!pairinst->NeedRGB) - add_pairinst_to_list(&s->ReadyAlpha, pairinst); - else - add_pairinst_to_list(&s->ReadyFullALU, pairinst); -} - - -/** - * Finally rewrite ADD, MOV, MUL as the appropriate native instruction - * and reverse the order of arguments for CMP. - */ -static void final_rewrite(struct pair_state *s, struct rc_sub_instruction *inst) -{ - struct rc_src_register tmp; - - switch(inst->Opcode) { - case RC_OPCODE_ADD: - inst->SrcReg[2] = inst->SrcReg[1]; - inst->SrcReg[1].File = RC_FILE_NONE; - inst->SrcReg[1].Swizzle = RC_SWIZZLE_1111; - inst->SrcReg[1].Negate = RC_MASK_NONE; - inst->Opcode = RC_OPCODE_MAD; - break; - case RC_OPCODE_CMP: - tmp = inst->SrcReg[2]; - inst->SrcReg[2] = inst->SrcReg[0]; - inst->SrcReg[0] = tmp; - break; - case RC_OPCODE_MOV: - /* AMD say we should use CMP. - * However, when we transform - * KIL -r0; - * into - * CMP tmp, -r0, -r0, 0; - * KIL tmp; - * we get incorrect behaviour on R500 when r0 == 0.0. - * It appears that the R500 KIL hardware treats -0.0 as less - * than zero. - */ - inst->SrcReg[1].File = RC_FILE_NONE; - inst->SrcReg[1].Swizzle = RC_SWIZZLE_1111; - inst->SrcReg[2].File = RC_FILE_NONE; - inst->SrcReg[2].Swizzle = RC_SWIZZLE_0000; - inst->Opcode = RC_OPCODE_MAD; - break; - case RC_OPCODE_MUL: - inst->SrcReg[2].File = RC_FILE_NONE; - inst->SrcReg[2].Swizzle = RC_SWIZZLE_0000; - inst->Opcode = RC_OPCODE_MAD; - break; - default: - /* nothing to do */ - break; - } -} - - -/** - * Classify an instruction according to which ALUs etc. it needs - */ -static void classify_instruction(struct pair_state *s, - struct pair_state_instruction *psi) -{ - psi->NeedRGB = (psi->Instruction.DstReg.WriteMask & RC_MASK_XYZ) ? 1 : 0; - psi->NeedAlpha = (psi->Instruction.DstReg.WriteMask & RC_MASK_W) ? 1 : 0; - - switch(psi->Instruction.Opcode) { - case RC_OPCODE_ADD: - case RC_OPCODE_CMP: - case RC_OPCODE_DDX: - case RC_OPCODE_DDY: - case RC_OPCODE_FRC: - case RC_OPCODE_MAD: - case RC_OPCODE_MAX: - case RC_OPCODE_MIN: - case RC_OPCODE_MOV: - case RC_OPCODE_MUL: - break; - case RC_OPCODE_COS: - case RC_OPCODE_EX2: - case RC_OPCODE_LG2: - case RC_OPCODE_RCP: - case RC_OPCODE_RSQ: - case RC_OPCODE_SIN: - psi->IsTranscendent = 1; - psi->NeedAlpha = 1; - break; - case RC_OPCODE_DP4: - psi->NeedAlpha = 1; - /* fall through */ - case RC_OPCODE_DP3: - psi->NeedRGB = 1; - break; - case RC_OPCODE_KIL: - case RC_OPCODE_TEX: - case RC_OPCODE_TXB: - case RC_OPCODE_TXP: - psi->IsTex = 1; - break; - default: - error("Unknown opcode %d\n", psi->Instruction.Opcode); - break; - } -} - - -/** - * Count which (input, temporary) register is read and written how often, - * and scan the instruction stream to find dependencies. - */ -static void scan_instructions(struct pair_state *s) -{ - struct rc_instruction *source; - unsigned int ip; - - for(source = s->Compiler->Base.Program.Instructions.Next, ip = 0; - source != &s->Compiler->Base.Program.Instructions; - source = source->Next, ++ip) { - struct pair_state_instruction *pairinst = memory_pool_malloc(&s->Compiler->Base.Pool, sizeof(*pairinst)); - memset(pairinst, 0, sizeof(struct pair_state_instruction)); - - pairinst->Instruction = source->U.I; - pairinst->IP = ip; - final_rewrite(s, &pairinst->Instruction); - classify_instruction(s, pairinst); - - const struct rc_opcode_info * opcode = rc_get_opcode_info(pairinst->Instruction.Opcode); - int j; - for(j = 0; j < opcode->NumSrcRegs; j++) { - struct pair_register_translation *t = - get_register(s, pairinst->Instruction.SrcReg[j].File, pairinst->Instruction.SrcReg[j].Index); - if (!t) - continue; - - t->RefCount++; - - if (pairinst->Instruction.SrcReg[j].File == RC_FILE_TEMPORARY) { - int i; - for(i = 0; i < 4; ++i) { - unsigned int swz = GET_SWZ(pairinst->Instruction.SrcReg[j].Swizzle, i); - if (swz >= 4) - continue; /* constant or NIL swizzle */ - if (!t->Value[swz]) - continue; /* this is an undefined read */ - - /* Do not add a dependency if this instruction - * also rewrites the value. The code below adds - * a dependency for the DstReg, which is a superset - * of the SrcReg dependency. */ - if (pairinst->Instruction.DstReg.File == RC_FILE_TEMPORARY && - pairinst->Instruction.DstReg.Index == pairinst->Instruction.SrcReg[j].Index && - GET_BIT(pairinst->Instruction.DstReg.WriteMask, swz)) - continue; - - struct reg_value_reader* r = memory_pool_malloc(&s->Compiler->Base.Pool, sizeof(*r)); - pairinst->NumDependencies++; - t->Value[swz]->NumReaders++; - r->Reader = pairinst; - r->Next = t->Value[swz]->Readers; - t->Value[swz]->Readers = r; - } - } - } - - if (opcode->HasDstReg) { - struct pair_register_translation *t = - get_register(s, pairinst->Instruction.DstReg.File, pairinst->Instruction.DstReg.Index); - if (t) { - t->RefCount++; - - if (pairinst->Instruction.DstReg.File == RC_FILE_TEMPORARY) { - int j; - for(j = 0; j < 4; ++j) { - if (!GET_BIT(pairinst->Instruction.DstReg.WriteMask, j)) - continue; - - struct reg_value* v = memory_pool_malloc(&s->Compiler->Base.Pool, sizeof(*v)); - memset(v, 0, sizeof(struct reg_value)); - v->Writer = pairinst; - if (t->Value[j]) { - pairinst->NumDependencies++; - t->Value[j]->Next = v; - } - t->Value[j] = v; - pairinst->Values[j] = v; - } - } - } - } - - if (s->Verbose) - fprintf(stderr, "scan(%i): NumDeps = %i\n", ip, pairinst->NumDependencies); - - if (!pairinst->NumDependencies) - instruction_ready(s, pairinst); - } - - /* Clear the RC_FILE_TEMPORARY state */ - int i, j; - for(i = 0; i < RC_REGISTER_MAX_INDEX; ++i) { - for(j = 0; j < 4; ++j) - s->Temps[i].Value[j] = 0; - } -} - - -static void decrement_dependencies(struct pair_state *s, struct pair_state_instruction *pairinst) -{ - assert(pairinst->NumDependencies > 0); - if (!--pairinst->NumDependencies) - instruction_ready(s, pairinst); -} /** - * Update the dependency tracking state based on what the instruction - * at the given IP does. + * Return the source slot where we installed the given register access, + * or -1 if no slot was free anymore. */ -static void commit_instruction(struct pair_state *s, struct pair_state_instruction *pairinst) -{ - struct rc_sub_instruction *inst = &pairinst->Instruction; - - if (s->Verbose) - fprintf(stderr, "commit_instruction(%i)\n", pairinst->IP); - - if (inst->DstReg.File == RC_FILE_TEMPORARY) { - struct pair_register_translation *t = &s->Temps[inst->DstReg.Index]; - deref_hw_reg(s, t->HwIndex); - - int i; - for(i = 0; i < 4; ++i) { - if (!GET_BIT(inst->DstReg.WriteMask, i)) - continue; - - t->Value[i] = pairinst->Values[i]; - if (t->Value[i]->NumReaders) { - struct reg_value_reader *r; - for(r = pairinst->Values[i]->Readers; r; r = r->Next) - decrement_dependencies(s, r->Reader); - } else if (t->Value[i]->Next) { - /* This happens when the only reader writes - * the register at the same time */ - decrement_dependencies(s, t->Value[i]->Next->Writer); - } - } - } - - const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->Opcode); - int i; - for(i = 0; i < opcode->NumSrcRegs; i++) { - struct pair_register_translation *t = get_register(s, inst->SrcReg[i].File, inst->SrcReg[i].Index); - if (!t) - continue; - - deref_hw_reg(s, get_hw_reg(s, inst->SrcReg[i].File, inst->SrcReg[i].Index)); - - if (inst->SrcReg[i].File != RC_FILE_TEMPORARY) - continue; - - int j; - for(j = 0; j < 4; ++j) { - unsigned int swz = GET_SWZ(inst->SrcReg[i].Swizzle, j); - if (swz >= 4) - continue; - if (!t->Value[swz]) - continue; - - /* Do not free a dependency if this instruction - * also rewrites the value. See scan_instructions. */ - if (inst->DstReg.File == RC_FILE_TEMPORARY && - inst->DstReg.Index == inst->SrcReg[i].Index && - GET_BIT(inst->DstReg.WriteMask, swz)) - continue; - - if (!--t->Value[swz]->NumReaders) { - if (t->Value[swz]->Next) - decrement_dependencies(s, t->Value[swz]->Next->Writer); - } - } - } -} - - -/** - * Emit all ready texture instructions in a single block. - * - * Emit as a single block to (hopefully) sample many textures in parallel, - * and to avoid hardware indirections on R300. - * - * In R500, we don't really know when the result of a texture instruction - * arrives. So allocate all destinations first, to make sure they do not - * arrive early and overwrite a texture coordinate we're going to use later - * in the block. - */ -static void emit_all_tex(struct pair_state *s) -{ - struct pair_state_instruction *readytex; - struct pair_state_instruction *pairinst; - - assert(s->ReadyTEX); - - // Don't let the ready list change under us! - readytex = s->ReadyTEX; - s->ReadyTEX = 0; - - // Allocate destination hardware registers in one block to avoid conflicts. - for(pairinst = readytex; pairinst; pairinst = pairinst->NextReady) { - struct rc_sub_instruction *inst = &pairinst->Instruction; - if (inst->Opcode != RC_OPCODE_KIL) - get_hw_reg(s, inst->DstReg.File, inst->DstReg.Index); - } - - if (s->Compiler->Base.Debug) - fprintf(stderr, " BEGIN_TEX\n"); - - if (s->Handler->BeginTexBlock) - s->Compiler->Base.Error = s->Compiler->Base.Error || !s->Handler->BeginTexBlock(s->UserData); - - for(pairinst = readytex; pairinst; pairinst = pairinst->NextReady) { - struct rc_sub_instruction *inst = &pairinst->Instruction; - commit_instruction(s, pairinst); - - if (inst->Opcode != RC_OPCODE_KIL) - inst->DstReg.Index = get_hw_reg(s, inst->DstReg.File, inst->DstReg.Index); - inst->SrcReg[0].Index = get_hw_reg(s, inst->SrcReg[0].File, inst->SrcReg[0].Index); - - if (s->Compiler->Base.Debug) { - /* Should print the TEX instruction here */ - } - - struct radeon_pair_texture_instruction rpti; - - switch(inst->Opcode) { - case RC_OPCODE_TEX: rpti.Opcode = RADEON_OPCODE_TEX; break; - case RC_OPCODE_TXB: rpti.Opcode = RADEON_OPCODE_TXB; break; - case RC_OPCODE_TXP: rpti.Opcode = RADEON_OPCODE_TXP; break; - default: - case RC_OPCODE_KIL: rpti.Opcode = RADEON_OPCODE_KIL; break; - } - - rpti.DestIndex = inst->DstReg.Index; - rpti.WriteMask = inst->DstReg.WriteMask; - rpti.TexSrcUnit = inst->TexSrcUnit; - rpti.TexSrcTarget = inst->TexSrcTarget; - rpti.SrcIndex = inst->SrcReg[0].Index; - rpti.SrcSwizzle = inst->SrcReg[0].Swizzle; - - s->Compiler->Base.Error = s->Compiler->Base.Error || !s->Handler->EmitTex(s->UserData, &rpti); - } - - if (s->Compiler->Base.Debug) - fprintf(stderr, " END_TEX\n"); -} - - -static int alloc_pair_source(struct pair_state *s, struct radeon_pair_instruction *pair, - struct rc_src_register src, unsigned int rgb, unsigned int alpha) +int rc_pair_alloc_source(struct rc_pair_instruction *pair, + unsigned int rgb, unsigned int alpha, + rc_register_file file, unsigned int index) { int candidate = -1; int candidate_quality = -1; int i; - if (!rgb && !alpha) + if ((!rgb && !alpha) || file == RC_FILE_NONE) return 0; - unsigned int constant; - unsigned int index; - - if (src.File == RC_FILE_TEMPORARY || src.File == RC_FILE_INPUT) { - constant = 0; - index = get_hw_reg(s, src.File, src.Index); - } else { - constant = 1; - index = src.Index; - } - for(i = 0; i < 3; ++i) { int q = 0; if (rgb) { if (pair->RGB.Src[i].Used) { - if (pair->RGB.Src[i].Constant != constant || + if (pair->RGB.Src[i].File != file || pair->RGB.Src[i].Index != index) continue; q++; @@ -607,7 +55,7 @@ static int alloc_pair_source(struct pair_state *s, struct radeon_pair_instructio } if (alpha) { if (pair->Alpha.Src[i].Used) { - if (pair->Alpha.Src[i].Constant != constant || + if (pair->Alpha.Src[i].File != file || pair->Alpha.Src[i].Index != index) continue; q++; @@ -622,330 +70,15 @@ static int alloc_pair_source(struct pair_state *s, struct radeon_pair_instructio if (candidate >= 0) { if (rgb) { pair->RGB.Src[candidate].Used = 1; - pair->RGB.Src[candidate].Constant = constant; + pair->RGB.Src[candidate].File = file; pair->RGB.Src[candidate].Index = index; } if (alpha) { pair->Alpha.Src[candidate].Used = 1; - pair->Alpha.Src[candidate].Constant = constant; + pair->Alpha.Src[candidate].File = file; pair->Alpha.Src[candidate].Index = index; } } return candidate; } - -/** - * Fill the given ALU instruction's opcodes and source operands into the given pair, - * if possible. - */ -static int fill_instruction_into_pair( - struct pair_state *s, - struct radeon_pair_instruction *pair, - struct pair_state_instruction *pairinst) -{ - struct rc_sub_instruction *inst = &pairinst->Instruction; - - assert(!pairinst->NeedRGB || pair->RGB.Opcode == RC_OPCODE_NOP); - assert(!pairinst->NeedAlpha || pair->Alpha.Opcode == RC_OPCODE_NOP); - - if (pairinst->NeedRGB) { - if (pairinst->IsTranscendent) - pair->RGB.Opcode = RC_OPCODE_REPL_ALPHA; - else - pair->RGB.Opcode = inst->Opcode; - if (inst->SaturateMode == RC_SATURATE_ZERO_ONE) - pair->RGB.Saturate = 1; - } - if (pairinst->NeedAlpha) { - pair->Alpha.Opcode = inst->Opcode; - if (inst->SaturateMode == RC_SATURATE_ZERO_ONE) - pair->Alpha.Saturate = 1; - } - - const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->Opcode); - int nargs = opcode->NumSrcRegs; - int i; - - /* Special case for DDX/DDY (MDH/MDV). */ - if (inst->Opcode == RC_OPCODE_DDX || inst->Opcode == RC_OPCODE_DDY) { - if (pair->RGB.Src[0].Used || pair->Alpha.Src[0].Used) - return 0; - else - nargs++; - } - - for(i = 0; i < nargs; ++i) { - int source; - if (pairinst->NeedRGB && !pairinst->IsTranscendent) { - unsigned int srcrgb = 0; - unsigned int srcalpha = 0; - int j; - for(j = 0; j < 3; ++j) { - unsigned int swz = GET_SWZ(inst->SrcReg[i].Swizzle, j); - if (swz < 3) - srcrgb = 1; - else if (swz < 4) - srcalpha = 1; - } - source = alloc_pair_source(s, pair, inst->SrcReg[i], srcrgb, srcalpha); - if (source < 0) - return 0; - pair->RGB.Arg[i].Source = source; - pair->RGB.Arg[i].Swizzle = inst->SrcReg[i].Swizzle & 0x1ff; - pair->RGB.Arg[i].Abs = inst->SrcReg[i].Abs; - pair->RGB.Arg[i].Negate = !!(inst->SrcReg[i].Negate & (RC_MASK_X | RC_MASK_Y | RC_MASK_Z)); - } - if (pairinst->NeedAlpha) { - unsigned int srcrgb = 0; - unsigned int srcalpha = 0; - unsigned int swz = GET_SWZ(inst->SrcReg[i].Swizzle, pairinst->IsTranscendent ? 0 : 3); - if (swz < 3) - srcrgb = 1; - else if (swz < 4) - srcalpha = 1; - source = alloc_pair_source(s, pair, inst->SrcReg[i], srcrgb, srcalpha); - if (source < 0) - return 0; - pair->Alpha.Arg[i].Source = source; - pair->Alpha.Arg[i].Swizzle = swz; - pair->Alpha.Arg[i].Abs = inst->SrcReg[i].Abs; - pair->Alpha.Arg[i].Negate = !!(inst->SrcReg[i].Negate & RC_MASK_W); - } - } - - return 1; -} - - -/** - * Fill in the destination register information. - * - * This is split from filling in source registers because we want - * to avoid allocating hardware temporaries for destinations until - * we are absolutely certain that we're going to emit a certain - * instruction pairing. - */ -static void fill_dest_into_pair( - struct pair_state *s, - struct radeon_pair_instruction *pair, - struct pair_state_instruction *pairinst) -{ - struct rc_sub_instruction *inst = &pairinst->Instruction; - - if (inst->DstReg.File == RC_FILE_OUTPUT) { - if (inst->DstReg.Index == s->Compiler->OutputColor) { - pair->RGB.OutputWriteMask |= inst->DstReg.WriteMask & RC_MASK_XYZ; - pair->Alpha.OutputWriteMask |= GET_BIT(inst->DstReg.WriteMask, 3); - } else if (inst->DstReg.Index == s->Compiler->OutputDepth) { - pair->Alpha.DepthWriteMask |= GET_BIT(inst->DstReg.WriteMask, 3); - } - } else { - unsigned int hwindex = get_hw_reg(s, inst->DstReg.File, inst->DstReg.Index); - if (pairinst->NeedRGB) { - pair->RGB.DestIndex = hwindex; - pair->RGB.WriteMask |= inst->DstReg.WriteMask & RC_MASK_XYZ; - } - if (pairinst->NeedAlpha) { - pair->Alpha.DestIndex = hwindex; - pair->Alpha.WriteMask |= GET_BIT(inst->DstReg.WriteMask, 3); - } - } -} - - -/** - * Find a good ALU instruction or pair of ALU instruction and emit it. - * - * Prefer emitting full ALU instructions, so that when we reach a point - * where no full ALU instruction can be emitted, we have more candidates - * for RGB/Alpha pairing. - */ -static void emit_alu(struct pair_state *s) -{ - struct radeon_pair_instruction pair; - struct pair_state_instruction *psi; - - if (s->ReadyFullALU || !(s->ReadyRGB && s->ReadyAlpha)) { - if (s->ReadyFullALU) { - psi = s->ReadyFullALU; - s->ReadyFullALU = s->ReadyFullALU->NextReady; - } else if (s->ReadyRGB) { - psi = s->ReadyRGB; - s->ReadyRGB = s->ReadyRGB->NextReady; - } else { - psi = s->ReadyAlpha; - s->ReadyAlpha = s->ReadyAlpha->NextReady; - } - - memset(&pair, 0, sizeof(pair)); - fill_instruction_into_pair(s, &pair, psi); - fill_dest_into_pair(s, &pair, psi); - commit_instruction(s, psi); - } else { - struct pair_state_instruction **prgb; - struct pair_state_instruction **palpha; - - /* Some pairings might fail because they require too - * many source slots; try all possible pairings if necessary */ - for(prgb = &s->ReadyRGB; *prgb; prgb = &(*prgb)->NextReady) { - for(palpha = &s->ReadyAlpha; *palpha; palpha = &(*palpha)->NextReady) { - struct pair_state_instruction * psirgb = *prgb; - struct pair_state_instruction * psialpha = *palpha; - memset(&pair, 0, sizeof(pair)); - fill_instruction_into_pair(s, &pair, psirgb); - if (!fill_instruction_into_pair(s, &pair, psialpha)) - continue; - *prgb = (*prgb)->NextReady; - *palpha = (*palpha)->NextReady; - fill_dest_into_pair(s, &pair, psirgb); - fill_dest_into_pair(s, &pair, psialpha); - commit_instruction(s, psirgb); - commit_instruction(s, psialpha); - goto success; - } - } - - /* No success in pairing; just take the first RGB instruction */ - psi = s->ReadyRGB; - s->ReadyRGB = s->ReadyRGB->NextReady; - - memset(&pair, 0, sizeof(pair)); - fill_instruction_into_pair(s, &pair, psi); - fill_dest_into_pair(s, &pair, psi); - commit_instruction(s, psi); - success: ; - } - - if (s->Compiler->Base.Debug) - radeonPrintPairInstruction(&pair); - - s->Compiler->Base.Error = s->Compiler->Base.Error || !s->Handler->EmitPaired(s->UserData, &pair); -} - -/* Callback function for assigning input registers to hardware registers */ -static void alloc_helper(void * data, unsigned input, unsigned hwreg) -{ - struct pair_state * s = data; - alloc_hw_reg(s, RC_FILE_INPUT, input, hwreg); -} - -void radeonPairProgram( - struct r300_fragment_program_compiler * compiler, - const struct radeon_pair_handler* handler, void *userdata) -{ - struct pair_state s; - - memset(&s, 0, sizeof(s)); - s.Compiler = compiler; - s.Handler = handler; - s.UserData = userdata; - s.Verbose = 0 && s.Compiler->Base.Debug; - - if (s.Compiler->Base.Debug) - fprintf(stderr, "Emit paired program\n"); - - scan_instructions(&s); - s.Compiler->AllocateHwInputs(s.Compiler, &alloc_helper, &s); - - while(!s.Compiler->Base.Error && - (s.ReadyTEX || s.ReadyRGB || s.ReadyAlpha || s.ReadyFullALU)) { - if (s.ReadyTEX) - emit_all_tex(&s); - - while(s.ReadyFullALU || s.ReadyRGB || s.ReadyAlpha) - emit_alu(&s); - } - - if (s.Compiler->Base.Debug) - fprintf(stderr, " END\n"); -} - - -static void print_pair_src(int i, struct radeon_pair_instruction_source* src) -{ - fprintf(stderr, " Src%i = %s[%i]", i, src->Constant ? "CNST" : "TEMP", src->Index); -} - -static const char* opcode_string(rc_opcode opcode) -{ - return rc_get_opcode_info(opcode)->Name; -} - -static int num_pairinst_args(rc_opcode opcode) -{ - return rc_get_opcode_info(opcode)->NumSrcRegs; -} - -static char swizzle_char(rc_swizzle swz) -{ - switch(swz) { - case RC_SWIZZLE_X: return 'x'; - case RC_SWIZZLE_Y: return 'y'; - case RC_SWIZZLE_Z: return 'z'; - case RC_SWIZZLE_W: return 'w'; - case RC_SWIZZLE_ZERO: return '0'; - case RC_SWIZZLE_ONE: return '1'; - case RC_SWIZZLE_HALF: return 'H'; - case RC_SWIZZLE_UNUSED: return '_'; - default: return '?'; - } -} - -void radeonPrintPairInstruction(struct radeon_pair_instruction *inst) -{ - int nargs; - int i; - - fprintf(stderr, " RGB: "); - for(i = 0; i < 3; ++i) { - if (inst->RGB.Src[i].Used) - print_pair_src(i, inst->RGB.Src + i); - } - fprintf(stderr, "\n"); - fprintf(stderr, " Alpha:"); - for(i = 0; i < 3; ++i) { - if (inst->Alpha.Src[i].Used) - print_pair_src(i, inst->Alpha.Src + i); - } - fprintf(stderr, "\n"); - - fprintf(stderr, " %s%s", opcode_string(inst->RGB.Opcode), inst->RGB.Saturate ? "_SAT" : ""); - if (inst->RGB.WriteMask) - fprintf(stderr, " TEMP[%i].%s%s%s", inst->RGB.DestIndex, - (inst->RGB.WriteMask & 1) ? "x" : "", - (inst->RGB.WriteMask & 2) ? "y" : "", - (inst->RGB.WriteMask & 4) ? "z" : ""); - if (inst->RGB.OutputWriteMask) - fprintf(stderr, " COLOR.%s%s%s", - (inst->RGB.OutputWriteMask & 1) ? "x" : "", - (inst->RGB.OutputWriteMask & 2) ? "y" : "", - (inst->RGB.OutputWriteMask & 4) ? "z" : ""); - nargs = num_pairinst_args(inst->RGB.Opcode); - for(i = 0; i < nargs; ++i) { - const char* abs = inst->RGB.Arg[i].Abs ? "|" : ""; - const char* neg = inst->RGB.Arg[i].Negate ? "-" : ""; - fprintf(stderr, ", %s%sSrc%i.%c%c%c%s", neg, abs, inst->RGB.Arg[i].Source, - swizzle_char(GET_SWZ(inst->RGB.Arg[i].Swizzle, 0)), - swizzle_char(GET_SWZ(inst->RGB.Arg[i].Swizzle, 1)), - swizzle_char(GET_SWZ(inst->RGB.Arg[i].Swizzle, 2)), - abs); - } - fprintf(stderr, "\n"); - - fprintf(stderr, " %s%s", opcode_string(inst->Alpha.Opcode), inst->Alpha.Saturate ? "_SAT" : ""); - if (inst->Alpha.WriteMask) - fprintf(stderr, " TEMP[%i].w", inst->Alpha.DestIndex); - if (inst->Alpha.OutputWriteMask) - fprintf(stderr, " COLOR.w"); - if (inst->Alpha.DepthWriteMask) - fprintf(stderr, " DEPTH.w"); - nargs = num_pairinst_args(inst->Alpha.Opcode); - for(i = 0; i < nargs; ++i) { - const char* abs = inst->Alpha.Arg[i].Abs ? "|" : ""; - const char* neg = inst->Alpha.Arg[i].Negate ? "-" : ""; - fprintf(stderr, ", %s%sSrc%i.%c%s", neg, abs, inst->Alpha.Arg[i].Source, - swizzle_char(inst->Alpha.Arg[i].Swizzle), abs); - } - fprintf(stderr, "\n"); -} diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.h b/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.h index 440069d558..1600598428 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_pair.h @@ -28,22 +28,37 @@ #ifndef __RADEON_PROGRAM_PAIR_H_ #define __RADEON_PROGRAM_PAIR_H_ +#include "radeon_code.h" +#include "radeon_opcodes.h" +#include "radeon_program_constants.h" + struct r300_fragment_program_compiler; /** - * Represents a paired instruction, as found in R300 and R500 + * \file + * Represents a paired ALU instruction, as found in R300 and R500 * fragment programs. + * + * Note that this representation is taking some liberties as far + * as register files are concerned, to allow separate register + * allocation. + * + * Also note that there are some subtleties in that the semantics + * of certain opcodes are implicitly changed in this representation; + * see \ref rc_pair_translate */ + + struct radeon_pair_instruction_source { - unsigned int Index:8; - unsigned int Constant:1; unsigned int Used:1; + rc_register_file File:3; + unsigned int Index:RC_REGISTER_INDEX_BITS; }; struct radeon_pair_instruction_rgb { - unsigned int Opcode:8; - unsigned int DestIndex:8; + rc_opcode Opcode:8; + unsigned int DestIndex:RC_REGISTER_INDEX_BITS; unsigned int WriteMask:3; unsigned int OutputWriteMask:3; unsigned int Saturate:1; @@ -59,8 +74,8 @@ struct radeon_pair_instruction_rgb { }; struct radeon_pair_instruction_alpha { - unsigned int Opcode:8; - unsigned int DestIndex:8; + rc_opcode Opcode:8; + unsigned int DestIndex:RC_REGISTER_INDEX_BITS; unsigned int WriteMask:1; unsigned int OutputWriteMask:1; unsigned int DepthWriteMask:1; @@ -76,66 +91,34 @@ struct radeon_pair_instruction_alpha { } Arg[3]; }; -struct radeon_pair_instruction { +struct rc_pair_instruction { struct radeon_pair_instruction_rgb RGB; struct radeon_pair_instruction_alpha Alpha; -}; - -enum { - RADEON_OPCODE_TEX = 0, - RADEON_OPCODE_TXB, - RADEON_OPCODE_TXP, - RADEON_OPCODE_KIL + rc_write_aluresult WriteALUResult:2; + rc_compare_func ALUResultCompare:3; }; -struct radeon_pair_texture_instruction { - unsigned int Opcode:2; /**< one of RADEON_OPCODE_xxx */ - - unsigned int DestIndex:8; - unsigned int WriteMask:4; - unsigned int TexSrcUnit:5; - unsigned int TexSrcTarget:3; - - unsigned int SrcIndex:8; - unsigned int SrcSwizzle:12; -}; +/** + * General helper functions for dealing with the paired instruction format. + */ +/*@{*/ +int rc_pair_alloc_source(struct rc_pair_instruction *pair, + unsigned int rgb, unsigned int alpha, + rc_register_file file, unsigned int index); +/*@}*/ /** - * + * Compiler passes that operate with the paired format. */ -struct radeon_pair_handler { - /** - * Write a paired instruction to the hardware. - * - * @return 0 on error. - */ - int (*EmitPaired)(void*, struct radeon_pair_instruction*); - - /** - * Write a texture instruction to the hardware. - * Register indices have already been rewritten to the allocated - * hardware register numbers. - * - * @return 0 on error. - */ - int (*EmitTex)(void*, struct radeon_pair_texture_instruction*); - - /** - * Called before a block of contiguous, independent texture - * instructions is emitted. - */ - int (*BeginTexBlock)(void*); - - unsigned MaxHwTemps; -}; - -void radeonPairProgram( - struct r300_fragment_program_compiler * compiler, - const struct radeon_pair_handler*, void *userdata); +/*@{*/ +struct radeon_pair_handler; -void radeonPrintPairInstruction(struct radeon_pair_instruction *inst); +void rc_pair_translate(struct r300_fragment_program_compiler *c); +void rc_pair_schedule(struct r300_fragment_program_compiler *c); +void rc_pair_regalloc(struct r300_fragment_program_compiler *c, unsigned maxtemps); +/*@}*/ #endif /* __RADEON_PROGRAM_PAIR_H_ */ diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_print.c b/src/mesa/drivers/dri/r300/compiler/radeon_program_print.c index fe90a5900e..d863b82d53 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program_print.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_print.c @@ -99,6 +99,21 @@ static void rc_print_dst_register(FILE * f, struct rc_dst_register dst) } } +static char rc_swizzle_char(unsigned int swz) +{ + switch(swz) { + case RC_SWIZZLE_X: return 'x'; + case RC_SWIZZLE_Y: return 'y'; + case RC_SWIZZLE_Z: return 'z'; + case RC_SWIZZLE_W: return 'w'; + case RC_SWIZZLE_ZERO: return '0'; + case RC_SWIZZLE_ONE: return '1'; + case RC_SWIZZLE_HALF: return 'H'; + case RC_SWIZZLE_UNUSED: return '_'; + } + return '?'; +} + static void rc_print_swizzle(FILE * f, unsigned int swizzle, unsigned int negate) { unsigned int comp; @@ -106,16 +121,7 @@ static void rc_print_swizzle(FILE * f, unsigned int swizzle, unsigned int negate rc_swizzle swz = GET_SWZ(swizzle, comp); if (GET_BIT(negate, comp)) fprintf(f, "-"); - switch(swz) { - case RC_SWIZZLE_X: fprintf(f, "x"); break; - case RC_SWIZZLE_Y: fprintf(f, "y"); break; - case RC_SWIZZLE_Z: fprintf(f, "z"); break; - case RC_SWIZZLE_W: fprintf(f, "w"); break; - case RC_SWIZZLE_ZERO: fprintf(f, "0"); break; - case RC_SWIZZLE_ONE: fprintf(f, "1"); break; - case RC_SWIZZLE_HALF: fprintf(f, "H"); break; - case RC_SWIZZLE_UNUSED: fprintf(f, "_"); break; - } + fprintf(f, "%c", rc_swizzle_char(swz)); } } @@ -142,7 +148,7 @@ static void rc_print_src_register(FILE * f, struct rc_src_register src) fprintf(f, "|"); } -static void rc_print_instruction(FILE * f, struct rc_instruction * inst) +static void rc_print_normal_instruction(FILE * f, struct rc_instruction * inst) { const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); unsigned int reg; @@ -190,6 +196,87 @@ static void rc_print_instruction(FILE * f, struct rc_instruction * inst) fprintf(f, "\n"); } +static void rc_print_pair_instruction(FILE * f, struct rc_instruction * fullinst) +{ + struct rc_pair_instruction * inst = &fullinst->U.P; + int printedsrc = 0; + + for(unsigned int src = 0; src < 3; ++src) { + if (inst->RGB.Src[src].Used) { + if (printedsrc) + fprintf(f, ", "); + fprintf(f, "src%i.xyz = ", src); + rc_print_register(f, inst->RGB.Src[src].File, inst->RGB.Src[src].Index, 0); + printedsrc = 1; + } + if (inst->Alpha.Src[src].Used) { + if (printedsrc) + fprintf(f, ", "); + fprintf(f, "src%i.w = ", src); + rc_print_register(f, inst->Alpha.Src[src].File, inst->Alpha.Src[src].Index, 0); + printedsrc = 1; + } + } + fprintf(f, "\n"); + + if (inst->RGB.Opcode != RC_OPCODE_NOP) { + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->RGB.Opcode); + + fprintf(f, " %s%s", opcode->Name, inst->RGB.Saturate ? "_SAT" : ""); + if (inst->RGB.WriteMask) + fprintf(f, " temp[%i].%s%s%s", inst->RGB.DestIndex, + (inst->RGB.WriteMask & 1) ? "x" : "", + (inst->RGB.WriteMask & 2) ? "y" : "", + (inst->RGB.WriteMask & 4) ? "z" : ""); + if (inst->RGB.OutputWriteMask) + fprintf(f, " color.%s%s%s", + (inst->RGB.OutputWriteMask & 1) ? "x" : "", + (inst->RGB.OutputWriteMask & 2) ? "y" : "", + (inst->RGB.OutputWriteMask & 4) ? "z" : ""); + if (inst->WriteALUResult == RC_ALURESULT_X) + fprintf(f, " aluresult"); + + for(unsigned int arg = 0; arg < opcode->NumSrcRegs; ++arg) { + const char* abs = inst->RGB.Arg[arg].Abs ? "|" : ""; + const char* neg = inst->RGB.Arg[arg].Negate ? "-" : ""; + fprintf(f, ", %s%ssrc%i.%c%c%c%s", neg, abs, inst->RGB.Arg[arg].Source, + rc_swizzle_char(GET_SWZ(inst->RGB.Arg[arg].Swizzle, 0)), + rc_swizzle_char(GET_SWZ(inst->RGB.Arg[arg].Swizzle, 1)), + rc_swizzle_char(GET_SWZ(inst->RGB.Arg[arg].Swizzle, 2)), + abs); + } + fprintf(f, "\n"); + } + + if (inst->Alpha.Opcode != RC_OPCODE_NOP) { + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->Alpha.Opcode); + + fprintf(f, " %s%s", opcode->Name, inst->Alpha.Saturate ? "_SAT" : ""); + if (inst->Alpha.WriteMask) + fprintf(f, " temp[%i].w", inst->Alpha.DestIndex); + if (inst->Alpha.OutputWriteMask) + fprintf(f, " color.w"); + if (inst->Alpha.DepthWriteMask) + fprintf(f, " depth.w"); + if (inst->WriteALUResult == RC_ALURESULT_W) + fprintf(f, " aluresult"); + + for(unsigned int arg = 0; arg < opcode->NumSrcRegs; ++arg) { + const char* abs = inst->Alpha.Arg[arg].Abs ? "|" : ""; + const char* neg = inst->Alpha.Arg[arg].Negate ? "-" : ""; + fprintf(f, ", %s%ssrc%i.%c%s", neg, abs, inst->Alpha.Arg[arg].Source, + rc_swizzle_char(inst->Alpha.Arg[arg].Swizzle), abs); + } + fprintf(f, "\n"); + } + + if (inst->WriteALUResult) { + fprintf(f, " [aluresult = ("); + rc_print_comparefunc(f, "result", inst->ALUResultCompare, "0"); + fprintf(f, ")]\n"); + } +} + /** * Print program to stderr, default options. */ @@ -203,7 +290,10 @@ void rc_print_program(const struct rc_program *prog) for(inst = prog->Instructions.Next; inst != &prog->Instructions; inst = inst->Next) { fprintf(stderr, "%3d: ", linenum); - rc_print_instruction(stderr, inst); + if (inst->Type == RC_INSTRUCTION_PAIR) + rc_print_pair_instruction(stderr, inst); + else + rc_print_normal_instruction(stderr, inst); linenum++; } -- cgit v1.2.3 From 12e89e0e511d996db8e6eb11253dad4cdfab2083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= Date: Sun, 4 Oct 2009 17:53:08 +0200 Subject: r300/compiler: Emit flow control instructions and ALU result writes on R500 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicolai Hähnle --- .../drivers/dri/r300/compiler/r500_fragprog_emit.c | 180 ++++++++++++++++++++- src/mesa/drivers/dri/r300/compiler/radeon_code.h | 2 + .../dri/r300/compiler/radeon_dataflow_deadcode.c | 2 +- .../drivers/dri/r300/compiler/radeon_opcodes.c | 6 +- .../drivers/dri/r300/compiler/radeon_opcodes.h | 2 +- .../dri/r300/compiler/radeon_pair_schedule.c | 2 +- .../dri/r300/compiler/radeon_pair_translate.c | 2 +- src/mesa/drivers/dri/r300/r300_reg.h | 2 + 8 files changed, 183 insertions(+), 15 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c index 8f618d88ad..b1b14394b6 100644 --- a/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c +++ b/src/mesa/drivers/dri/r300/compiler/r500_fragprog_emit.c @@ -55,6 +55,23 @@ } while(0) +struct branch_info { + int If; + int Else; + int Endif; +}; + +struct emit_state { + struct radeon_compiler * C; + struct r500_fragment_program_code * Code; + + struct branch_info * Branches; + unsigned int CurrentBranchDepth; + unsigned int BranchesReserved; + + unsigned int MaxBranchDepth; +}; + static unsigned int translate_rgb_op(struct r300_fragment_program_compiler *c, rc_opcode opcode) { switch(opcode) { @@ -131,6 +148,19 @@ static unsigned int translate_arg_alpha(struct rc_pair_instruction *inst, int i) return t; } +static uint32_t translate_alu_result_op(struct r300_fragment_program_compiler * c, rc_compare_func func) +{ + switch(func) { + case RC_COMPARE_FUNC_EQUAL: return R500_INST_ALU_RESULT_OP_EQ; + case RC_COMPARE_FUNC_LESS: return R500_INST_ALU_RESULT_OP_LT; + case RC_COMPARE_FUNC_GEQUAL: return R500_INST_ALU_RESULT_OP_GE; + case RC_COMPARE_FUNC_NOTEQUAL: return R500_INST_ALU_RESULT_OP_NE; + default: + rc_error(&c->Base, "%s: unsupported compare func %i\n", __FUNCTION__, func); + return 0; + } +} + static void use_temporary(struct r500_fragment_program_code* code, unsigned int index) { if (index > code->max_temp_idx) @@ -153,13 +183,13 @@ static unsigned int use_source(struct r500_fragment_program_code* code, struct r /** * Emit a paired ALU instruction. */ -static int emit_paired(struct r300_fragment_program_compiler *c, struct rc_pair_instruction *inst) +static void emit_paired(struct r300_fragment_program_compiler *c, struct rc_pair_instruction *inst) { PROG_CODE; if (code->inst_end >= 511) { error("emit_alu: Too many instructions"); - return 0; + return; } int ip = ++code->inst_end; @@ -167,10 +197,15 @@ static int emit_paired(struct r300_fragment_program_compiler *c, struct rc_pair_ code->inst[ip].inst5 = translate_rgb_op(c, inst->RGB.Opcode); code->inst[ip].inst4 = translate_alpha_op(c, inst->Alpha.Opcode); - if (inst->RGB.OutputWriteMask || inst->Alpha.OutputWriteMask || inst->Alpha.DepthWriteMask) + if (inst->RGB.OutputWriteMask || inst->Alpha.OutputWriteMask || inst->Alpha.DepthWriteMask) { code->inst[ip].inst0 = R500_INST_TYPE_OUT; - else + if (inst->WriteALUResult) { + error("%s: cannot write output and ALU result at the same time"); + return; + } + } else { code->inst[ip].inst0 = R500_INST_TYPE_ALU; + } code->inst[ip].inst0 |= R500_INST_TEX_SEM_WAIT; code->inst[ip].inst0 |= (inst->RGB.WriteMask << 11) | (inst->Alpha.WriteMask << 14); @@ -206,7 +241,16 @@ static int emit_paired(struct r300_fragment_program_compiler *c, struct rc_pair_ code->inst[ip].inst4 |= translate_arg_alpha(inst, 1) << R500_ALPHA_SEL_B_SHIFT; code->inst[ip].inst5 |= translate_arg_alpha(inst, 2) << R500_ALU_RGBA_ALPHA_SEL_C_SHIFT; - return 1; + if (inst->WriteALUResult) { + code->inst[ip].inst3 |= R500_ALU_RGB_WMASK; + + if (inst->WriteALUResult == RC_ALURESULT_X) + code->inst[ip].inst0 |= R500_INST_ALU_RESULT_SEL_RED; + else + code->inst[ip].inst0 |= R500_INST_ALU_RESULT_SEL_ALPHA; + + code->inst[ip].inst0 |= translate_alu_result_op(c, inst->ALUResultCompare); + } } static unsigned int translate_strq_swizzle(unsigned int swizzle) @@ -271,10 +315,118 @@ static int emit_tex(struct r300_fragment_program_compiler *c, struct rc_sub_inst return 1; } +static void grow_branches(struct emit_state * s) +{ + unsigned int newreserved = s->BranchesReserved * 2; + struct branch_info * newbranches; + + if (!newreserved) + newreserved = 4; + + newbranches = memory_pool_malloc(&s->C->Pool, newreserved*sizeof(struct branch_info)); + memcpy(newbranches, s->Branches, s->CurrentBranchDepth*sizeof(struct branch_info)); + + s->Branches = newbranches; + s->BranchesReserved = newreserved; +} + +static void emit_flowcontrol(struct emit_state * s, struct rc_instruction * inst) +{ + if (s->Code->inst_end >= 511) { + rc_error(s->C, "emit_tex: Too many instructions"); + return; + } + + unsigned int newip = ++s->Code->inst_end; + + s->Code->inst[newip].inst0 = R500_INST_TYPE_FC | R500_INST_ALU_WAIT; + + if (inst->U.I.Opcode == RC_OPCODE_IF) { + if (s->CurrentBranchDepth >= 32) { + rc_error(s->C, "Branch depth exceeds hardware limit"); + return; + } + + if (s->CurrentBranchDepth >= s->BranchesReserved) + grow_branches(s); + + struct branch_info * branch = &s->Branches[s->CurrentBranchDepth++]; + branch->If = newip; + branch->Else = -1; + branch->Endif = -1; + + if (s->CurrentBranchDepth > s->MaxBranchDepth) + s->MaxBranchDepth = s->CurrentBranchDepth; + + /* actual instruction is filled in at ENDIF time */ + } else if (inst->U.I.Opcode == RC_OPCODE_ELSE) { + if (!s->CurrentBranchDepth) { + rc_error(s->C, "%s: got ELSE outside a branch", __FUNCTION__); + return; + } + + struct branch_info * branch = &s->Branches[s->CurrentBranchDepth - 1]; + branch->Else = newip; + + /* actual instruction is filled in at ENDIF time */ + } else if (inst->U.I.Opcode == RC_OPCODE_ENDIF) { + if (!s->CurrentBranchDepth) { + rc_error(s->C, "%s: got ELSE outside a branch", __FUNCTION__); + return; + } + + struct branch_info * branch = &s->Branches[s->CurrentBranchDepth - 1]; + branch->Endif = newip; + + s->Code->inst[branch->If].inst2 = R500_FC_OP_JUMP + | R500_FC_A_OP_NONE /* no address stack */ + | R500_FC_JUMP_FUNC(0x0f) /* jump if ALU result is false */ + | R500_FC_B_OP0_INCR /* increment branch counter if stay */ + ; + + if (branch->Else >= 0) { + /* increment branch counter also if jump */ + s->Code->inst[branch->If].inst2 |= R500_FC_B_OP1_INCR; + s->Code->inst[branch->If].inst3 = R500_FC_JUMP_ADDR(branch->Else + 1); + + s->Code->inst[branch->Else].inst2 = R500_FC_OP_JUMP + | R500_FC_A_OP_NONE /* no address stack */ + | R500_FC_B_ELSE /* all active pixels want to jump */ + | R500_FC_B_OP0_NONE /* no counter op if stay */ + | R500_FC_B_OP1_DECR /* decrement branch counter if jump */ + | R500_FC_B_POP_CNT(1) + ; + s->Code->inst[branch->Else].inst3 = R500_FC_JUMP_ADDR(branch->Endif + 1); + } else { + /* don't touch branch counter on jump */ + s->Code->inst[branch->If].inst2 |= R500_FC_B_OP1_NONE; + s->Code->inst[branch->If].inst3 = R500_FC_JUMP_ADDR(branch->Endif + 1); + } + + s->Code->inst[branch->Endif].inst2 = R500_FC_OP_JUMP + | R500_FC_A_OP_NONE /* no address stack */ + | R500_FC_JUMP_ANY /* docs says set this, but I don't understand why */ + | R500_FC_B_OP0_DECR /* decrement branch counter if stay */ + | R500_FC_B_OP1_NONE /* no branch counter if stay */ + | R500_FC_B_POP_CNT(1) + ; + s->Code->inst[branch->Endif].inst3 = R500_FC_JUMP_ADDR(branch->Endif + 1); + + s->CurrentBranchDepth--; + } else { + rc_error(s->C, "%s: unknown opcode %i\n", __FUNCTION__, inst->U.I.Opcode); + } +} + void r500BuildFragmentProgramHwCode(struct r300_fragment_program_compiler *compiler) { + struct emit_state s; struct r500_fragment_program_code *code = &compiler->code->code.r500; + memset(&s, 0, sizeof(s)); + s.C = &compiler->Base; + s.Code = code; + memset(code, 0, sizeof(*code)); code->max_temp_idx = 1; code->inst_end = -1; @@ -283,10 +435,15 @@ void r500BuildFragmentProgramHwCode(struct r300_fragment_program_compiler *compi inst != &compiler->Base.Program.Instructions && !compiler->Base.Error; inst = inst->Next) { if (inst->Type == RC_INSTRUCTION_NORMAL) { - if (inst->U.I.Opcode == RC_OPCODE_BEGIN_TEX) - continue; + const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); - emit_tex(compiler, &inst->U.I); + if (opcode->IsFlowControl) { + emit_flowcontrol(&s, inst); + } else if (inst->U.I.Opcode == RC_OPCODE_BEGIN_TEX) { + continue; + } else { + emit_tex(compiler, &inst->U.I); + } } else { emit_paired(compiler, &inst->U.P); } @@ -309,4 +466,11 @@ void r500BuildFragmentProgramHwCode(struct r300_fragment_program_compiler *compi int ip = ++code->inst_end; code->inst[ip].inst0 = R500_INST_TYPE_OUT | R500_INST_TEX_SEM_WAIT; } + + if (s.MaxBranchDepth >= 4) { + if (code->max_temp_idx < 1) + code->max_temp_idx = 1; + + code->us_fc_ctrl |= R500_FC_FULL_FC_EN; + } } diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_code.h b/src/mesa/drivers/dri/r300/compiler/radeon_code.h index 75069e841e..902b7cfa53 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_code.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_code.h @@ -182,6 +182,8 @@ struct r500_fragment_program_code { int inst_end; /* Number of instructions - 1; also, last instruction to be executed */ int max_temp_idx; + + uint32_t us_fc_ctrl; }; struct rX00_fragment_program_code { diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c index f30b1ff067..e0c66c4aeb 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow_deadcode.c @@ -213,7 +213,7 @@ void rc_dataflow_deadcode(struct radeon_compiler * c, rc_dataflow_mark_outputs_f inst = inst->Prev) { const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); - if (opcode->IsControlFlow) { + if (opcode->IsFlowControl) { if (opcode->Opcode == RC_OPCODE_ENDIF) { push_branch(&s); } else { diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c index a5072b5e1e..c1c0181fac 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.c @@ -344,19 +344,19 @@ struct rc_opcode_info rc_opcodes[MAX_RC_OPCODE] = { { .Opcode = RC_OPCODE_IF, .Name = "IF", - .IsControlFlow = 1, + .IsFlowControl = 1, .NumSrcRegs = 1 }, { .Opcode = RC_OPCODE_ELSE, .Name = "ELSE", - .IsControlFlow = 1, + .IsFlowControl = 1, .NumSrcRegs = 0 }, { .Opcode = RC_OPCODE_ENDIF, .Name = "ENDIF", - .IsControlFlow = 1, + .IsFlowControl = 1, .NumSrcRegs = 0 }, { diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h index c9c5b9f80f..a3c5b86954 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_opcodes.h @@ -206,7 +206,7 @@ struct rc_opcode_info { unsigned int HasDstReg:1; /** true if this instruction affects control flow */ - unsigned int IsControlFlow:1; + unsigned int IsFlowControl:1; /** true if this is a vector instruction that operates on components in parallel * without any cross-component interaction */ diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c b/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c index 8a4b5ac8a9..ea01bb7881 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c @@ -454,7 +454,7 @@ static int is_controlflow(struct rc_instruction * inst) { if (inst->Type == RC_INSTRUCTION_NORMAL) { const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); - return opcode->IsControlFlow; + return opcode->IsFlowControl; } return 0; } diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c b/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c index c31891a62f..7211768272 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_pair_translate.c @@ -241,7 +241,7 @@ void rc_pair_translate(struct r300_fragment_program_compiler *c) const struct rc_opcode_info * opcode = rc_get_opcode_info(inst->U.I.Opcode); - if (opcode->HasTexture || opcode->IsControlFlow || opcode->Opcode == RC_OPCODE_KIL) + if (opcode->HasTexture || opcode->IsFlowControl || opcode->Opcode == RC_OPCODE_KIL) continue; struct rc_sub_instruction copy = inst->U.I; diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h index b9ccd098dc..623da60333 100644 --- a/src/mesa/drivers/dri/r300/r300_reg.h +++ b/src/mesa/drivers/dri/r300/r300_reg.h @@ -3002,6 +3002,8 @@ enum { # define R500_INST_RGB_CLAMP (1 << 19) # define R500_INST_ALPHA_CLAMP (1 << 20) # define R500_INST_ALU_RESULT_SEL (1 << 21) +# define R500_INST_ALU_RESULT_SEL_RED (0 << 21) +# define R500_INST_ALU_RESULT_SEL_ALPHA (1 << 21) # define R500_INST_ALPHA_PRED_INV (1 << 22) # define R500_INST_ALU_RESULT_OP_EQ (0 << 23) # define R500_INST_ALU_RESULT_OP_LT (1 << 23) -- cgit v1.2.3 From a6b300ac98427eece73c312e6fc73f4127c6ab65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= Date: Sun, 4 Oct 2009 18:26:15 +0200 Subject: r300/compiler Add support for more of the Sxx set instructions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicolai Hähnle --- .../drivers/dri/r300/compiler/radeon_program_alu.c | 62 +++++++++++++++++++++- 1 file changed, 61 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c b/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c index 425b929668..0326d25233 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c @@ -344,6 +344,25 @@ static void transform_RSQ(struct radeon_compiler* c, inst->U.I.SrcReg[0] = absolute(inst->U.I.SrcReg[0]); } +static void transform_SEQ(struct radeon_compiler* c, + struct rc_instruction* inst) +{ + int tempreg = rc_find_free_temporary(c); + + emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dstreg(RC_FILE_TEMPORARY, tempreg), inst->U.I.SrcReg[0], negate(inst->U.I.SrcReg[1])); + emit3(c, inst->Prev, RC_OPCODE_CMP, inst->U.I.SaturateMode, inst->U.I.DstReg, + negate(absolute(srcreg(RC_FILE_TEMPORARY, tempreg))), builtin_zero, builtin_one); + + rc_remove_instruction(inst); +} + +static void transform_SFL(struct radeon_compiler* c, + struct rc_instruction* inst) +{ + emit1(c, inst->Prev, RC_OPCODE_MOV, inst->U.I.SaturateMode, inst->U.I.DstReg, builtin_zero); + rc_remove_instruction(inst); +} + static void transform_SGE(struct radeon_compiler* c, struct rc_instruction* inst) { @@ -356,6 +375,30 @@ static void transform_SGE(struct radeon_compiler* c, rc_remove_instruction(inst); } +static void transform_SGT(struct radeon_compiler* c, + struct rc_instruction* inst) +{ + int tempreg = rc_find_free_temporary(c); + + emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dstreg(RC_FILE_TEMPORARY, tempreg), negate(inst->U.I.SrcReg[0]), inst->U.I.SrcReg[1]); + emit3(c, inst->Prev, RC_OPCODE_CMP, inst->U.I.SaturateMode, inst->U.I.DstReg, + srcreg(RC_FILE_TEMPORARY, tempreg), builtin_one, builtin_zero); + + rc_remove_instruction(inst); +} + +static void transform_SLE(struct radeon_compiler* c, + struct rc_instruction* inst) +{ + int tempreg = rc_find_free_temporary(c); + + emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dstreg(RC_FILE_TEMPORARY, tempreg), negate(inst->U.I.SrcReg[0]), inst->U.I.SrcReg[1]); + emit3(c, inst->Prev, RC_OPCODE_CMP, inst->U.I.SaturateMode, inst->U.I.DstReg, + srcreg(RC_FILE_TEMPORARY, tempreg), builtin_zero, builtin_one); + + rc_remove_instruction(inst); +} + static void transform_SLT(struct radeon_compiler* c, struct rc_instruction* inst) { @@ -368,6 +411,18 @@ static void transform_SLT(struct radeon_compiler* c, rc_remove_instruction(inst); } +static void transform_SNE(struct radeon_compiler* c, + struct rc_instruction* inst) +{ + int tempreg = rc_find_free_temporary(c); + + emit2(c, inst->Prev, RC_OPCODE_ADD, 0, dstreg(RC_FILE_TEMPORARY, tempreg), inst->U.I.SrcReg[0], negate(inst->U.I.SrcReg[1])); + emit3(c, inst->Prev, RC_OPCODE_CMP, inst->U.I.SaturateMode, inst->U.I.DstReg, + negate(absolute(srcreg(RC_FILE_TEMPORARY, tempreg))), builtin_one, builtin_zero); + + rc_remove_instruction(inst); +} + static void transform_SUB(struct radeon_compiler* c, struct rc_instruction* inst) { @@ -403,7 +458,7 @@ static void transform_XPD(struct radeon_compiler* c, * no userData necessary. * * Eliminates the following ALU instructions: - * ABS, DPH, DST, FLR, LIT, LRP, POW, SGE, SLT, SUB, SWZ, XPD + * ABS, DPH, DST, FLR, LIT, LRP, POW, SEQ, SFL, SGE, SGT, SLE, SLT, SNE, SUB, SWZ, XPD * using: * MOV, ADD, MUL, MAD, FRC, DP3, LG2, EX2, CMP * @@ -426,8 +481,13 @@ int radeonTransformALU( case RC_OPCODE_LRP: transform_LRP(c, inst); return 1; case RC_OPCODE_POW: transform_POW(c, inst); return 1; case RC_OPCODE_RSQ: transform_RSQ(c, inst); return 1; + case RC_OPCODE_SEQ: transform_SEQ(c, inst); return 1; + case RC_OPCODE_SFL: transform_SFL(c, inst); return 1; case RC_OPCODE_SGE: transform_SGE(c, inst); return 1; + case RC_OPCODE_SGT: transform_SGT(c, inst); return 1; + case RC_OPCODE_SLE: transform_SLE(c, inst); return 1; case RC_OPCODE_SLT: transform_SLT(c, inst); return 1; + case RC_OPCODE_SNE: transform_SNE(c, inst); return 1; case RC_OPCODE_SUB: transform_SUB(c, inst); return 1; case RC_OPCODE_SWZ: transform_SWZ(c, inst); return 1; case RC_OPCODE_XPD: transform_XPD(c, inst); return 1; -- cgit v1.2.3 From 3856c3cc46813ad96ae6f02dec19460193d986ac Mon Sep 17 00:00:00 2001 From: Frederic Crozat Date: Sun, 4 Oct 2009 17:46:40 -0400 Subject: r200: remove subpixel offset from viewport Fixes bug fdo 20340 for r200. --- src/mesa/drivers/dri/r200/r200_state.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c index 76852e315c..d28e96d9d9 100644 --- a/src/mesa/drivers/dri/r200/r200_state.c +++ b/src/mesa/drivers/dri/r200/r200_state.c @@ -1578,13 +1578,6 @@ static void r200ClearStencil( GLcontext *ctx, GLint s ) * Window position and viewport transformation */ -/* - * To correctly position primitives: - */ -#define SUBPIXEL_X 0.125 -#define SUBPIXEL_Y 0.125 - - /** * Called when window size or position changes or viewport or depth range * state is changed. We update the hardware viewport state here. @@ -1609,9 +1602,9 @@ void r200UpdateWindow( GLcontext *ctx ) } float_ui32_type sx = { v[MAT_SX] }; - float_ui32_type tx = { v[MAT_TX] + xoffset + SUBPIXEL_X }; + float_ui32_type tx = { v[MAT_TX] + xoffset }; float_ui32_type sy = { v[MAT_SY] * y_scale }; - float_ui32_type ty = { (v[MAT_TY] * y_scale) + y_bias + SUBPIXEL_Y }; + float_ui32_type ty = { (v[MAT_TY] * y_scale) + y_bias }; float_ui32_type sz = { v[MAT_SZ] * depthScale }; float_ui32_type tz = { v[MAT_TZ] * depthScale }; @@ -1680,8 +1673,8 @@ void r200UpdateViewportOffset( GLcontext *ctx ) float_ui32_type tx; float_ui32_type ty; - tx.f = v[MAT_TX] + xoffset + SUBPIXEL_X; - ty.f = (- v[MAT_TY]) + yoffset + SUBPIXEL_Y; + tx.f = v[MAT_TX] + xoffset; + ty.f = (- v[MAT_TY]) + yoffset; if ( rmesa->hw.vpt.cmd[VPT_SE_VPORT_XOFFSET] != tx.ui32 || rmesa->hw.vpt.cmd[VPT_SE_VPORT_YOFFSET] != ty.ui32 ) -- cgit v1.2.3 From 7aeaca33c331f70d507fc83583b13b8d9fc3e847 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Mon, 5 Oct 2009 14:42:45 +1000 Subject: mesa: fix return value when clipping {Read,Draw}Pixels height <= 0 Signed-off-by: Ben Skeggs --- src/mesa/main/image.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index baecbab0a3..139e56a96b 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -5511,7 +5511,7 @@ _mesa_clip_drawpixels(const GLcontext *ctx, } if (*height <= 0) - return GL_TRUE; + return GL_FALSE; return GL_TRUE; } @@ -5564,7 +5564,7 @@ _mesa_clip_readpixels(const GLcontext *ctx, *height -= (*srcY + *height - buffer->Height); if (*height <= 0) - return GL_TRUE; + return GL_FALSE; return GL_TRUE; } -- cgit v1.2.3 From 43750f1575e366e2a92b71bffceee90d7f1a2b3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Mon, 5 Oct 2009 12:31:51 +0200 Subject: Use _mesa_select_tex_image() rather than hardcoding face 0. Fixes crash loading a map in sauerbraten with hwmipmap 1 in ~/.sauerbraten/config.cfg. --- src/mesa/main/mipmap.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 4d3e62572d..c3928fa513 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -1501,8 +1501,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, GLuint comps; ASSERT(texObj); - /* XXX choose cube map face here??? */ - srcImage = texObj->Image[0][texObj->BaseLevel]; + srcImage = _mesa_select_tex_image(ctx, texObj, target, texObj->BaseLevel); ASSERT(srcImage); maxLevels = _mesa_max_texture_levels(ctx, texObj->Target); -- cgit v1.2.3 From 0b032eabc77d0e28fc0746cbd8ffb94859fd130d Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Mon, 5 Oct 2009 12:53:40 +0300 Subject: r600: update vertex program selection for draw path --- src/mesa/drivers/dri/r600/r700_vertprog.c | 40 +++++++++++++++++++++++++++---- 1 file changed, 35 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.c b/src/mesa/drivers/dri/r600/r700_vertprog.c index e7a209be9d..d12c39c9f7 100644 --- a/src/mesa/drivers/dri/r600/r700_vertprog.c +++ b/src/mesa/drivers/dri/r600/r700_vertprog.c @@ -319,8 +319,10 @@ struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, _mesa_insert_mvp_code(ctx, vp->mesa_program); } - for(i=0; imesa_program->Base.InputsRead & unBit) /* ctx->Array.ArrayObj->xxxxxxx */ { @@ -328,7 +330,17 @@ struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, vp->aos_desc[i].stride = vb->AttribPtr[i]->size * sizeof(GL_FLOAT);/* when emit array, data is packed. vb->AttribPtr[i]->stride;*/ vp->aos_desc[i].type = GL_FLOAT; } + } } + else + { + for(i=0; inNumActiveAos; i++) + { + vp->aos_desc[i].size = context->stream_desc[i].size; + vp->aos_desc[i].stride = context->stream_desc[i].stride; + vp->aos_desc[i].type = context->stream_desc[i].type; + } + } if (context->radeon.radeonScreen->chip_family < CHIP_FAMILY_RV770) { @@ -388,17 +400,35 @@ void r700SelectVertexShader(GLcontext *ctx, GLint nVersion) for (vp = vpc->progs; vp; vp = vp->next) { + if (vp->uiVersion != nVersion ) + continue; match = GL_TRUE; - for(i=0; iaos_desc[i].size != vb->AttribPtr[i]->size) - match = GL_FALSE; - break; + if (vp->aos_desc[i].size != vb->AttribPtr[i]->size) + { + match = GL_FALSE; + break; + } } + } } + else + { + for(i=0; inNumActiveAos; i++) + { + if (vp->aos_desc[i].size != context->stream_desc[i].size) + { + match = GL_FALSE; + break; + } + } + } if (match) { context->selected_vp = vp; -- cgit v1.2.3 From b02ef740b90029bc40629e5b81270a8cf77101d3 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Mon, 5 Oct 2009 15:50:11 +0100 Subject: mesa/st: add ST_DEBUG environment variable At last it's possible to turn on tgsi dumps and other debugging in the state tracker without modifying sources... --- src/mesa/state_tracker/st_atom_constbuf.c | 3 ++- src/mesa/state_tracker/st_cb_accum.c | 11 ++++++++++ src/mesa/state_tracker/st_cb_drawpixels.c | 4 ++++ src/mesa/state_tracker/st_cb_readpixels.c | 4 ++++ src/mesa/state_tracker/st_cb_texture.c | 13 +++++++++++ src/mesa/state_tracker/st_context.c | 4 ++++ src/mesa/state_tracker/st_debug.c | 28 ++++++++++++++++++++++++ src/mesa/state_tracker/st_debug.h | 36 +++++++++++++++++++++++++++++++ src/mesa/state_tracker/st_gen_mipmap.c | 4 ++++ src/mesa/state_tracker/st_program.c | 20 +++++++++++------ 10 files changed, 119 insertions(+), 8 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_atom_constbuf.c b/src/mesa/state_tracker/st_atom_constbuf.c index 5d4d8eee02..77153889b6 100644 --- a/src/mesa/state_tracker/st_atom_constbuf.c +++ b/src/mesa/state_tracker/st_atom_constbuf.c @@ -39,6 +39,7 @@ #include "pipe/p_defines.h" #include "pipe/p_inlines.h" +#include "st_debug.h" #include "st_context.h" #include "st_atom.h" #include "st_atom_constbuf.h" @@ -75,7 +76,7 @@ void st_upload_constants( struct st_context *st, PIPE_BUFFER_USAGE_CONSTANT, paramBytes ); - if (0) { + if (ST_DEBUG & DEBUG_CONSTANTS) { debug_printf("%s(shader=%d, numParams=%d, stateFlags=0x%x)\n", __FUNCTION__, shader_type, params->NumParameters, params->StateFlags); diff --git a/src/mesa/state_tracker/st_cb_accum.c b/src/mesa/state_tracker/st_cb_accum.c index 3d1d0f71d5..a6b9765452 100644 --- a/src/mesa/state_tracker/st_cb_accum.c +++ b/src/mesa/state_tracker/st_cb_accum.c @@ -34,6 +34,7 @@ #include "main/image.h" #include "main/macros.h" +#include "st_debug.h" #include "st_context.h" #include "st_cb_accum.h" #include "st_cb_fbo.h" @@ -136,6 +137,9 @@ accum_accum(struct st_context *st, GLfloat value, GLubyte *data = acc_strb->data; GLfloat *buf; + if (ST_DEBUG & DEBUG_FALLBACK) + debug_printf("%s: fallback processing\n", __FUNCTION__); + color_trans = st_cond_flush_get_tex_transfer(st, color_strb->texture, 0, 0, 0, PIPE_TRANSFER_READ, xpos, ypos, @@ -181,6 +185,10 @@ accum_load(struct st_context *st, GLfloat value, GLubyte *data = acc_strb->data; GLfloat *buf; + + if (ST_DEBUG & DEBUG_FALLBACK) + debug_printf("%s: fallback processing\n", __FUNCTION__); + color_trans = st_cond_flush_get_tex_transfer(st, color_strb->texture, 0, 0, 0, PIPE_TRANSFER_READ, xpos, ypos, @@ -228,6 +236,9 @@ accum_return(GLcontext *ctx, GLfloat value, const GLubyte *data = acc_strb->data; GLfloat *buf; + if (ST_DEBUG & DEBUG_FALLBACK) + debug_printf("%s: fallback processing\n", __FUNCTION__); + buf = (GLfloat *) _mesa_malloc(width * height * 4 * sizeof(GLfloat)); if (!colormask[0] || !colormask[1] || !colormask[2] || !colormask[3]) diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 99f3ba678b..91fc9f98f7 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -40,6 +40,7 @@ #include "shader/prog_parameter.h" #include "shader/prog_print.h" +#include "st_debug.h" #include "st_context.h" #include "st_atom.h" #include "st_atom_constbuf.h" @@ -1090,6 +1091,9 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, struct pipe_transfer *ptTex; enum pipe_transfer_usage transfer_usage; + if (ST_DEBUG & DEBUG_FALLBACK) + debug_printf("%s: fallback processing\n", __FUNCTION__); + if (type == GL_DEPTH && pf_is_depth_and_stencil(pt->format)) transfer_usage = PIPE_TRANSFER_READ_WRITE; else diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c index 75424aa2e7..772bb3bb69 100644 --- a/src/mesa/state_tracker/st_cb_readpixels.c +++ b/src/mesa/state_tracker/st_cb_readpixels.c @@ -43,6 +43,7 @@ #include "pipe/p_inlines.h" #include "util/u_tile.h" +#include "st_debug.h" #include "st_context.h" #include "st_cb_bitmap.h" #include "st_cb_readpixels.h" @@ -416,6 +417,9 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, yStep = 1; } + if (ST_DEBUG & DEBUG_FALLBACK) + debug_printf("%s: fallback processing\n", __FUNCTION__); + /* * Copy pixels from pipe_transfer to user memory */ diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 9a634bb930..b943787106 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -43,6 +43,7 @@ #include "main/texobj.h" #include "main/texstore.h" +#include "state_tracker/st_debug.h" #include "state_tracker/st_context.h" #include "state_tracker/st_cb_fbo.h" #include "state_tracker/st_cb_texture.h" @@ -903,6 +904,9 @@ decompress_with_blit(GLcontext * ctx, GLenum target, GLint level, GLvoid *dest = _mesa_image_address2d(&ctx->Pack, pixels, width, height, format, type, row, 0); + if (ST_DEBUG & DEBUG_FALLBACK) + debug_printf("%s: fallback format translation\n", __FUNCTION__); + /* get float[4] rgba row from surface */ pipe_get_tile_rgba(tex_xfer, 0, row, width, 1, rgba); @@ -1294,6 +1298,9 @@ fallback_copy_texsubimage(GLcontext *ctx, GLenum target, GLint level, struct pipe_transfer *src_trans; GLvoid *texDest; enum pipe_transfer_usage transfer_usage; + + if (ST_DEBUG & DEBUG_FALLBACK) + debug_printf("%s: fallback processing\n", __FUNCTION__); assert(width <= MAX_WIDTH); @@ -1419,6 +1426,12 @@ compatible_src_dst_formats(const struct gl_renderbuffer *src, return TGSI_WRITEMASK_XYZ; /* A ==> 1.0 */ } else { + if (ST_DEBUG & DEBUG_FALLBACK) + debug_printf("%s failed for src %s, dst %s\n", + __FUNCTION__, + _mesa_lookup_enum_by_nr(srcFormat), + _mesa_lookup_enum_by_nr(dstLogicalFormat)); + /* Otherwise fail. */ return 0; diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 96969c736c..f0eddafd33 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -36,6 +36,7 @@ #include "shader/shader_api.h" #include "glapi/glapi.h" #include "st_public.h" +#include "st_debug.h" #include "st_context.h" #include "st_cb_accum.h" #include "st_cb_bitmap.h" @@ -113,6 +114,9 @@ st_create_context_priv( GLcontext *ctx, struct pipe_context *pipe ) st->ctx = ctx; st->pipe = pipe; + /* XXX: this is one-off, per-screen init: */ + st_debug_init(); + /* state tracker needs the VBO module */ _vbo_CreateContext(ctx); diff --git a/src/mesa/state_tracker/st_debug.c b/src/mesa/state_tracker/st_debug.c index c7d26ce33c..3009cde9d5 100644 --- a/src/mesa/state_tracker/st_debug.c +++ b/src/mesa/state_tracker/st_debug.c @@ -41,6 +41,32 @@ +#ifdef DEBUG +int ST_DEBUG = 0; + +static const struct debug_named_value st_debug_flags[] = { + { "mesa", DEBUG_MESA }, + { "tgsi", DEBUG_TGSI }, + { "pipe", DEBUG_PIPE }, + { "tex", DEBUG_TEX }, + { "fallback", DEBUG_FALLBACK }, + { "screen", DEBUG_SCREEN }, + { "query", DEBUG_QUERY }, + {NULL, 0} +}; +#endif + + +void +st_debug_init(void) +{ +#ifdef DEBUG + ST_DEBUG = debug_get_flags_option("ST_DEBUG", st_debug_flags, 0 ); +#endif +} + + + /** * Print current state. May be called from inside gdb to see currently * bound vertex/fragment shaders and associated constants. @@ -68,3 +94,5 @@ st_print_current(void) if (st->fp->Base.Base.Parameters) _mesa_print_parameter_list(st->fp->Base.Base.Parameters); } + + diff --git a/src/mesa/state_tracker/st_debug.h b/src/mesa/state_tracker/st_debug.h index 49d752e1b2..4a060d7759 100644 --- a/src/mesa/state_tracker/st_debug.h +++ b/src/mesa/state_tracker/st_debug.h @@ -29,8 +29,44 @@ #ifndef ST_DEBUG_H #define ST_DEBUG_H +#include "pipe/p_compiler.h" +#include "util/u_debug.h" + extern void st_print_current(void); +#define DEBUG_MESA 0x1 +#define DEBUG_TGSI 0x2 +#define DEBUG_CONSTANTS 0x4 +#define DEBUG_PIPE 0x8 +#define DEBUG_TEX 0x10 +#define DEBUG_FALLBACK 0x20 +#define DEBUG_QUERY 0x40 +#define DEBUG_SCREEN 0x80 + +#ifdef DEBUG +extern int ST_DEBUG; +#define DBSTR(x) x +#else +#define ST_DEBUG 0 +#define DBSTR(x) "" +#endif + +void st_debug_init( void ); + +static INLINE void +ST_DBG( unsigned flag, const char *fmt, ... ) +{ + if (ST_DEBUG & flag) + { + va_list args; + + va_start( args, fmt ); + debug_vprintf( fmt, args ); + va_end( args ); + } +} + + #endif /* ST_DEBUG_H */ diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c index f75b2348b8..16ca2771b0 100644 --- a/src/mesa/state_tracker/st_gen_mipmap.c +++ b/src/mesa/state_tracker/st_gen_mipmap.c @@ -42,6 +42,7 @@ #include "cso_cache/cso_cache.h" #include "cso_cache/cso_context.h" +#include "st_debug.h" #include "st_context.h" #include "st_draw.h" #include "st_gen_mipmap.h" @@ -113,6 +114,9 @@ fallback_generate_mipmap(GLcontext *ctx, GLenum target, uint dstLevel; GLenum datatype; GLuint comps; + + if (ST_DEBUG & DEBUG_FALLBACK) + debug_printf("%s: fallback processing\n", __FUNCTION__); assert(target != GL_TEXTURE_3D); /* not done yet */ diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 927f60cc7e..a9be80ce8f 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -42,6 +42,7 @@ #include "draw/draw_context.h" #include "tgsi/tgsi_dump.h" +#include "st_debug.h" #include "st_context.h" #include "st_atom.h" #include "st_program.h" @@ -49,9 +50,6 @@ #include "cso_cache/cso_context.h" -#define TGSI_DEBUG 0 - - /** * Translate a Mesa vertex shader into a TGSI shader. * \param outputMapping to map vertex program output registers (VERT_RESULT_x) @@ -346,11 +344,15 @@ st_translate_vertex_program(struct st_context *st, stvp->num_inputs = vs_num_inputs; stvp->driver_shader = pipe->create_vs_state(pipe, &stvp->state); - if (0) + if ((ST_DEBUG & DEBUG_TGSI) && (ST_DEBUG & DEBUG_MESA)) { _mesa_print_program(&stvp->Base.Base); + debug_printf("\n"); + } - if (TGSI_DEBUG) + if (ST_DEBUG & DEBUG_TGSI) { tgsi_dump( stvp->state.tokens, 0 ); + debug_printf("\n"); + } } @@ -526,11 +528,15 @@ st_translate_fragment_program(struct st_context *st, stfp->driver_shader = pipe->create_fs_state(pipe, &stfp->state); - if (0) + if ((ST_DEBUG & DEBUG_TGSI) && (ST_DEBUG & DEBUG_MESA)) { _mesa_print_program(&stfp->Base.Base); + debug_printf("\n"); + } - if (TGSI_DEBUG) + if (ST_DEBUG & DEBUG_TGSI) { tgsi_dump( stfp->state.tokens, 0/*TGSI_DUMP_VERBOSE*/ ); + debug_printf("\n"); + } } -- cgit v1.2.3 From 75e0a376cd32b127f3168c0af12992b5c8576e92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Fonseca?= Date: Mon, 5 Oct 2009 11:05:34 +0100 Subject: mesa: Copy textures' base format into wrapper renderbuffer. Otherwise st_copy_texsubimage will fallback to software blit due to inconsistent base formats. --- src/mesa/state_tracker/st_cb_fbo.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index fe0a121493..a049520901 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -383,6 +383,7 @@ st_render_texture(GLcontext *ctx, rb->Width = texImage->Width2; rb->Height = texImage->Height2; + rb->_BaseFormat = texImage->_BaseFormat; /*printf("***** render to texture level %d: %d x %d\n", att->TextureLevel, rb->Width, rb->Height);*/ /*printf("***** pipe texture %d x %d\n", pt->width[0], pt->height[0]);*/ -- cgit v1.2.3 From a8768bbc9de1441384cecc147d51c9ee6431b924 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 5 Oct 2009 11:10:31 -0600 Subject: mesa: fix return value when clipping {Read,Draw}Pixels height <= 0 Signed-off-by: Ben Skeggs (cherry picked from master, commit 7aeaca33c331f70d507fc83583b13b8d9fc3e847) --- src/mesa/main/image.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c index baecbab0a3..139e56a96b 100644 --- a/src/mesa/main/image.c +++ b/src/mesa/main/image.c @@ -5511,7 +5511,7 @@ _mesa_clip_drawpixels(const GLcontext *ctx, } if (*height <= 0) - return GL_TRUE; + return GL_FALSE; return GL_TRUE; } @@ -5564,7 +5564,7 @@ _mesa_clip_readpixels(const GLcontext *ctx, *height -= (*srcY + *height - buffer->Height); if (*height <= 0) - return GL_TRUE; + return GL_FALSE; return GL_TRUE; } -- cgit v1.2.3 From 1f39d59a2996e2acf6893a8dd1a0293bd8790cc2 Mon Sep 17 00:00:00 2001 From: Joakim Sindholt Date: Mon, 5 Oct 2009 19:25:04 +0200 Subject: r300g: fix scons build So I didn't touch r300compiler, but r300g now compiles after having declarations and code untangled. As nha so gently points out, we shouldn't have to do this just to comply with MSVC compilers. --- src/mesa/drivers/dri/r300/compiler/SConscript | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100755 src/mesa/drivers/dri/r300/compiler/SConscript (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/SConscript b/src/mesa/drivers/dri/r300/compiler/SConscript new file mode 100755 index 0000000000..48fd65fb71 --- /dev/null +++ b/src/mesa/drivers/dri/r300/compiler/SConscript @@ -0,0 +1,30 @@ +Import('*') + +env = env.Clone() +env.Append(CPPPATH = '#/include') +env.Append(CPPPATH = '#/src/mesa') + +# temporary fix +env['CFLAGS'] = str(env['CFLAGS']).replace('-Werror=declaration-after-statement', '') + +r300compiler = env.ConvenienceLibrary( + target = 'r300compiler', + source = [ + 'radeon_code.c', + 'radeon_compiler.c', + 'radeon_nqssadce.c', + 'radeon_program.c', + 'radeon_program_alu.c', + 'radeon_program_pair.c', + 'r3xx_fragprog.c', + 'r300_fragprog.c', + 'r300_fragprog_swizzle.c', + 'r300_fragprog_emit.c', + 'r500_fragprog.c', + 'r500_fragprog_emit.c', + 'r3xx_vertprog.c', + 'r3xx_vertprog_dump.c', + 'memory_pool.c', + ]) + +Return('r300compiler') -- cgit v1.2.3 From 3b29dcbb5e1f0641cdfab22b5e578d933e9dbf35 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 5 Oct 2009 14:07:29 -0600 Subject: intel: remove a buffer equality test in _mesa_make_current() Before, if we called glXMakeCurrent() to change a context's window binding while an FBO was bound, we weren't updating the intel->driDrawable and intel->driReadDrawable fields. This could cause us to dereference a null pointer elsewhere. --- src/mesa/drivers/dri/intel/intel_context.c | 60 ++++++++++++++---------------- 1 file changed, 27 insertions(+), 33 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index fce42e9c2d..c49f06e44a 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -993,41 +993,35 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv, _mesa_make_current(&intel->ctx, &intel_fb->Base, readFb); - /* The drawbuffer won't always be updated by _mesa_make_current: - */ - if (intel->ctx.DrawBuffer == &intel_fb->Base) { - - if (intel->driReadDrawable != driReadPriv) - intel->driReadDrawable = driReadPriv; - - if (intel->driDrawable != driDrawPriv) { - if (driDrawPriv->swap_interval == (unsigned)-1) { - int i; - - driDrawPriv->vblFlags = (intel->intelScreen->irq_active != 0) - ? driGetDefaultVBlankFlags(&intel->optionCache) - : VBLANK_FLAG_NO_IRQ; - - /* Prevent error printf if one crtc is disabled, this will - * be properly calculated in intelWindowMoved() next. - */ - driDrawPriv->vblFlags = intelFixupVblank(intel, driDrawPriv); - - (*psp->systemTime->getUST) (&intel_fb->swap_ust); - driDrawableInitVBlank(driDrawPriv); - intel_fb->vbl_waited = driDrawPriv->vblSeq; - - for (i = 0; i < 2; i++) { - if (intel_fb->color_rb[i]) - intel_fb->color_rb[i]->vbl_pending = driDrawPriv->vblSeq; - } - } - intel->driDrawable = driDrawPriv; - intelWindowMoved(intel); - } + intel->driReadDrawable = driReadPriv; + + if (intel->driDrawable != driDrawPriv) { + if (driDrawPriv->swap_interval == (unsigned)-1) { + int i; + + driDrawPriv->vblFlags = (intel->intelScreen->irq_active != 0) + ? driGetDefaultVBlankFlags(&intel->optionCache) + : VBLANK_FLAG_NO_IRQ; - intel_draw_buffer(&intel->ctx, &intel_fb->Base); + /* Prevent error printf if one crtc is disabled, this will + * be properly calculated in intelWindowMoved() next. + */ + driDrawPriv->vblFlags = intelFixupVblank(intel, driDrawPriv); + + (*psp->systemTime->getUST) (&intel_fb->swap_ust); + driDrawableInitVBlank(driDrawPriv); + intel_fb->vbl_waited = driDrawPriv->vblSeq; + + for (i = 0; i < 2; i++) { + if (intel_fb->color_rb[i]) + intel_fb->color_rb[i]->vbl_pending = driDrawPriv->vblSeq; + } + } + intel->driDrawable = driDrawPriv; + intelWindowMoved(intel); } + + intel_draw_buffer(&intel->ctx, &intel_fb->Base); } else { _mesa_make_current(NULL, NULL, NULL); -- cgit v1.2.3 From 3b7ec94c0db4140f72682f70262baf77be683816 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 5 Oct 2009 14:25:36 -0600 Subject: intel: use driReadDrawable, not driDrawable in do_blit_readpixels() --- src/mesa/drivers/dri/intel/intel_pixel_read.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_pixel_read.c b/src/mesa/drivers/dri/intel/intel_pixel_read.c index 8713463ace..e036736323 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_read.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_read.c @@ -236,14 +236,14 @@ do_blit_readpixels(GLcontext * ctx, intelFlush(&intel->ctx); LOCK_HARDWARE(intel); - if (intel->driDrawable->numClipRects) { + if (intel->driReadDrawable->numClipRects) { GLboolean all = (width * height * src->cpp == dst->Base.Size && x == 0 && dst_offset == 0); dri_bo *dst_buffer = intel_bufferobj_buffer(intel, dst, all ? INTEL_WRITE_FULL : INTEL_WRITE_PART); - __DRIdrawablePrivate *dPriv = intel->driDrawable; + __DRIdrawablePrivate *dPriv = intel->driReadDrawable; int nbox = dPriv->numClipRects; drm_clip_rect_t *box = dPriv->pClipRects; drm_clip_rect_t rect; -- cgit v1.2.3 From 79892e7976fbb91ae426f5868d5f453e977c1f17 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 5 Oct 2009 14:26:16 -0600 Subject: intel: use driReadDrawable in do_copy_texsubimage() --- src/mesa/drivers/dri/intel/intel_tex_copy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c index 74f7f58bbe..b241c11625 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_copy.c +++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c @@ -135,7 +135,7 @@ do_copy_texsubimage(struct intel_context *intel, if (ctx->ReadBuffer->Name == 0) { /* reading from a window, adjust x, y */ - __DRIdrawablePrivate *dPriv = intel->driDrawable; + const __DRIdrawablePrivate *dPriv = intel->driReadDrawable; y = dPriv->y + (dPriv->h - (y + height)); x += dPriv->x; -- cgit v1.2.3 From bbbf55fa8419549debbba9ac6dc011b2c18ef24c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 5 Oct 2009 16:52:26 -0600 Subject: mesa: make _mesa_get_texel_fetch_func() static --- src/mesa/main/texfetch.c | 2 +- src/mesa/main/texfetch.h | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texfetch.c b/src/mesa/main/texfetch.c index 3428f705be..6b7db584f8 100644 --- a/src/mesa/main/texfetch.c +++ b/src/mesa/main/texfetch.c @@ -522,7 +522,7 @@ texfetch_funcs[MESA_FORMAT_COUNT] = }; -FetchTexelFuncF +static FetchTexelFuncF _mesa_get_texel_fetch_func(gl_format format, GLuint dims) { FetchTexelFuncF f; diff --git a/src/mesa/main/texfetch.h b/src/mesa/main/texfetch.h index a9be530a06..ef13bf27fe 100644 --- a/src/mesa/main/texfetch.h +++ b/src/mesa/main/texfetch.h @@ -31,9 +31,6 @@ #include "formats.h" -extern FetchTexelFuncF -_mesa_get_texel_fetch_func(gl_format format, GLuint dims); - extern StoreTexelFunc _mesa_get_texel_store_func(gl_format format); -- cgit v1.2.3 From 1a2bb37264b4448d33f2948fe1702c9dc936395d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 5 Oct 2009 17:12:36 -0600 Subject: mesa: lift _mesa_set_fetch_functions() calls out of drivers Call it from in the main Mesa glTexImage functions. --- src/mesa/drivers/dri/intel/intel_tex_image.c | 4 ---- src/mesa/drivers/dri/radeon/radeon_texture.c | 3 --- src/mesa/drivers/dri/unichrome/via_tex.c | 3 --- src/mesa/main/texfetch.c | 12 ++++++------ src/mesa/main/teximage.c | 20 ++++++++++++++++++++ src/mesa/main/texstore.c | 9 --------- 6 files changed, 26 insertions(+), 25 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index dd436becab..f32ff0dd05 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -7,7 +7,6 @@ #include "main/convolve.h" #include "main/context.h" #include "main/texcompress.h" -#include "main/texfetch.h" #include "main/texformat.h" #include "main/texstore.h" #include "main/texgetimage.h" @@ -336,8 +335,6 @@ intelTexImage(GLcontext * ctx, texImage->TexFormat = intelChooseTextureFormat(ctx, internalFormat, format, type); - _mesa_set_fetch_functions(texImage, dims); - if (_mesa_is_format_compressed(texImage->TexFormat)) { texelBytes = 0; } @@ -794,7 +791,6 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, intelImage->level = level; texImage->TexFormat = intelChooseTextureFormat(&intel->ctx, internalFormat, type, format); - _mesa_set_fetch_functions(texImage, 2); texImage->RowStride = rb->region->pitch; intel_miptree_reference(&intelImage->mt, intelObj->mt); diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 2c28011057..17e42e72ee 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -34,7 +34,6 @@ #include "main/convolve.h" #include "main/mipmap.h" #include "main/texcompress.h" -#include "main/texfetch.h" #include "main/texformat.h" #include "main/texstore.h" #include "main/teximage.h" @@ -140,7 +139,6 @@ static void map_override(GLcontext *ctx, radeonTexObj *t) radeon_bo_map(t->bo, GL_FALSE); img->base.Data = t->bo->ptr; - _mesa_set_fetch_functions(&img->base, 2); } static void unmap_override(GLcontext *ctx, radeonTexObj *t) @@ -543,7 +541,6 @@ static void radeon_teximage( /* Choose and fill in the texture format for this image */ texImage->TexFormat = radeonChooseTextureFormat(ctx, internalFormat, format, type, 0); - _mesa_set_fetch_functions(texImage, dims); if (_mesa_is_format_compressed(texImage->TexFormat)) { texelBytes = 0; diff --git a/src/mesa/drivers/dri/unichrome/via_tex.c b/src/mesa/drivers/dri/unichrome/via_tex.c index a99aa9debc..fa7542c5cb 100644 --- a/src/mesa/drivers/dri/unichrome/via_tex.c +++ b/src/mesa/drivers/dri/unichrome/via_tex.c @@ -37,7 +37,6 @@ #include "main/mipmap.h" #include "main/simple_list.h" #include "main/texcompress.h" -#include "main/texfetch.h" #include "main/texformat.h" #include "main/texobj.h" #include "main/texstore.h" @@ -692,8 +691,6 @@ static void viaTexImage(GLcontext *ctx, assert(texImage->TexFormat); - _mesa_set_fetch_functions(texImage, dims); - texelBytes = _mesa_get_format_bytes(texImage->TexFormat); if (texelBytes == 0) { diff --git a/src/mesa/main/texfetch.c b/src/mesa/main/texfetch.c index 6b7db584f8..851659e9c5 100644 --- a/src/mesa/main/texfetch.c +++ b/src/mesa/main/texfetch.c @@ -595,6 +595,7 @@ fetch_texel_float_to_chan(const struct gl_texture_image *texImage, } +#if 0 /** * Adaptor for fetching a float texel from a GLchan-valued texture. */ @@ -620,6 +621,7 @@ fetch_texel_chan_to_float(const struct gl_texture_image *texImage, texelOut[3] = CHAN_TO_FLOAT(temp[3]); } } +#endif /** @@ -631,17 +633,15 @@ _mesa_set_fetch_functions(struct gl_texture_image *texImage, GLuint dims) ASSERT(dims == 1 || dims == 2 || dims == 3); ASSERT(texImage->TexFormat); - texImage->FetchTexelf = - _mesa_get_texel_fetch_func(texImage->TexFormat, dims); + if (!texImage->FetchTexelf) { + texImage->FetchTexelf = + _mesa_get_texel_fetch_func(texImage->TexFormat, dims); + } /* now check if we need to use a float/chan adaptor */ if (!texImage->FetchTexelc) { texImage->FetchTexelc = fetch_texel_float_to_chan; } - else if (!texImage->FetchTexelf) { - texImage->FetchTexelf = fetch_texel_chan_to_float; - } - ASSERT(texImage->FetchTexelc); ASSERT(texImage->FetchTexelf); diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 438a316b9c..457380b8fa 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -43,6 +43,7 @@ #include "macros.h" #include "state.h" #include "texcompress.h" +#include "texfetch.h" #include "texformat.h" #include "teximage.h" #include "texstate.h" @@ -997,6 +998,9 @@ _mesa_init_teximage_fields(GLcontext *ctx, GLenum target, img->HeightScale = (GLfloat) img->Height; img->DepthScale = (GLfloat) img->Depth; } + + img->FetchTexelc = NULL; + img->FetchTexelf = NULL; } @@ -2200,6 +2204,8 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat, ASSERT(texImage->TexFormat); + _mesa_set_fetch_functions(texImage, 1); + check_gen_mipmap(ctx, target, texObj, level); update_fbo_texture(ctx, texObj, face, level); @@ -2314,6 +2320,8 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, ASSERT(texImage->TexFormat); + _mesa_set_fetch_functions(texImage, 2); + check_gen_mipmap(ctx, target, texObj, level); update_fbo_texture(ctx, texObj, face, level); @@ -2424,6 +2432,8 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat, ASSERT(texImage->TexFormat); + _mesa_set_fetch_functions(texImage, 3); + check_gen_mipmap(ctx, target, texObj, level); update_fbo_texture(ctx, texObj, face, level); @@ -2732,6 +2742,8 @@ _mesa_CopyTexImage1D( GLenum target, GLint level, ASSERT(texImage->TexFormat); + _mesa_set_fetch_functions(texImage, 1); + check_gen_mipmap(ctx, target, texObj, level); update_fbo_texture(ctx, texObj, face, level); @@ -2807,6 +2819,8 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat, ASSERT(texImage->TexFormat); + _mesa_set_fetch_functions(texImage, 2); + check_gen_mipmap(ctx, target, texObj, level); update_fbo_texture(ctx, texObj, face, level); @@ -3259,6 +3273,8 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level, imageSize, data, texObj, texImage); + _mesa_set_fetch_functions(texImage, 1); + check_gen_mipmap(ctx, target, texObj, level); /* state update */ @@ -3363,6 +3379,8 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level, border, imageSize, data, texObj, texImage); + _mesa_set_fetch_functions(texImage, 2); + check_gen_mipmap(ctx, target, texObj, level); /* state update */ @@ -3467,6 +3485,8 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level, border, imageSize, data, texObj, texImage); + _mesa_set_fetch_functions(texImage, 3); + check_gen_mipmap(ctx, target, texObj, level); /* state update */ diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 133b0370c8..52502b7033 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -64,7 +64,6 @@ #include "texcompress.h" #include "texcompress_fxt1.h" #include "texcompress_s3tc.h" -#include "texfetch.h" #include "texformat.h" #include "teximage.h" #include "texstore.h" @@ -3213,8 +3212,6 @@ _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level, = ctx->Driver.ChooseTextureFormat(ctx, internalFormat, format, type); ASSERT(texImage->TexFormat); - _mesa_set_fetch_functions(texImage, 1); - /* allocate memory */ sizeInBytes = texture_size(texImage); texImage->Data = _mesa_alloc_texmemory(sizeInBytes); @@ -3276,8 +3273,6 @@ _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level, = ctx->Driver.ChooseTextureFormat(ctx, internalFormat, format, type); ASSERT(texImage->TexFormat); - _mesa_set_fetch_functions(texImage, 2); - /* allocate memory */ sizeInBytes = texture_size(texImage); texImage->Data = _mesa_alloc_texmemory(sizeInBytes); @@ -3335,8 +3330,6 @@ _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level, = ctx->Driver.ChooseTextureFormat(ctx, internalFormat, format, type); ASSERT(texImage->TexFormat); - _mesa_set_fetch_functions(texImage, 3); - /* allocate memory */ sizeInBytes = texture_size(texImage); texImage->Data = _mesa_alloc_texmemory(sizeInBytes); @@ -3539,8 +3532,6 @@ _mesa_store_compressed_teximage2d(GLcontext *ctx, GLenum target, GLint level, = ctx->Driver.ChooseTextureFormat(ctx, internalFormat, 0, 0); ASSERT(texImage->TexFormat); - _mesa_set_fetch_functions(texImage, 2); - /* allocate storage */ texImage->Data = _mesa_alloc_texmemory(imageSize); if (!texImage->Data) { -- cgit v1.2.3 From 41bee4cff54c6a4c3ee193c80164a4b81863774b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 5 Oct 2009 17:27:50 -0600 Subject: mesa: add parenthesis --- src/mesa/main/colormac.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/colormac.h b/src/mesa/main/colormac.h index 815624ee50..7ae781ae23 100644 --- a/src/mesa/main/colormac.h +++ b/src/mesa/main/colormac.h @@ -140,9 +140,9 @@ */ #define UNCLAMPED_FLOAT_TO_RGB_CHAN(dst, f) \ do { \ - UNCLAMPED_FLOAT_TO_CHAN(dst[0], f[0]); \ - UNCLAMPED_FLOAT_TO_CHAN(dst[1], f[1]); \ - UNCLAMPED_FLOAT_TO_CHAN(dst[2], f[2]); \ + UNCLAMPED_FLOAT_TO_CHAN((dst)[0], (f)[0]); \ + UNCLAMPED_FLOAT_TO_CHAN((dst)[1], (f)[1]); \ + UNCLAMPED_FLOAT_TO_CHAN((dst)[2], (f)[2]); \ } while (0) @@ -156,10 +156,10 @@ do { \ */ #define UNCLAMPED_FLOAT_TO_RGBA_CHAN(dst, f) \ do { \ - UNCLAMPED_FLOAT_TO_CHAN(dst[0], f[0]); \ - UNCLAMPED_FLOAT_TO_CHAN(dst[1], f[1]); \ - UNCLAMPED_FLOAT_TO_CHAN(dst[2], f[2]); \ - UNCLAMPED_FLOAT_TO_CHAN(dst[3], f[3]); \ + UNCLAMPED_FLOAT_TO_CHAN((dst)[0], (f)[0]); \ + UNCLAMPED_FLOAT_TO_CHAN((dst)[1], (f)[1]); \ + UNCLAMPED_FLOAT_TO_CHAN((dst)[2], (f)[2]); \ + UNCLAMPED_FLOAT_TO_CHAN((dst)[3], (f)[3]); \ } while (0) -- cgit v1.2.3 From 6ec3db6cab95c1025d4afa0e7951246b5aa51b48 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 5 Oct 2009 17:28:39 -0600 Subject: mesa: use FetchTexelf() instead of FetchTexelc() --- src/mesa/main/texrender.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c index f47478421a..c8b532acbb 100644 --- a/src/mesa/main/texrender.c +++ b/src/mesa/main/texrender.c @@ -1,5 +1,6 @@ #include "context.h" +#include "colormac.h" #include "fbobject.h" #include "texfetch.h" #include "texrender.h" @@ -46,7 +47,9 @@ texture_get_row(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, if (rb->DataType == CHAN_TYPE) { GLchan *rgbaOut = (GLchan *) values; for (i = 0; i < count; i++) { - trb->TexImage->FetchTexelc(trb->TexImage, x + i, y, z, rgbaOut + 4 * i); + GLfloat rgba[4]; + trb->TexImage->FetchTexelf(trb->TexImage, x + i, y, z, rgba); + UNCLAMPED_FLOAT_TO_RGBA_CHAN(rgbaOut + 4 * i, rgba); } } else if (rb->DataType == GL_UNSIGNED_SHORT) { @@ -100,8 +103,10 @@ texture_get_values(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, if (rb->DataType == CHAN_TYPE) { GLchan *rgbaOut = (GLchan *) values; for (i = 0; i < count; i++) { - trb->TexImage->FetchTexelc(trb->TexImage, x[i], y[i] + trb->Yoffset, - z, rgbaOut + 4 * i); + GLfloat rgba[4]; + trb->TexImage->FetchTexelf(trb->TexImage, x[i], y[i] + trb->Yoffset, + z, rgba); + UNCLAMPED_FLOAT_TO_RGBA_CHAN(rgbaOut + 4 * i, rgba); } } else if (rb->DataType == GL_UNSIGNED_SHORT) { -- cgit v1.2.3 From 7e7f38a67d82191076b95f6faa0d419df68610da Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 5 Oct 2009 17:48:22 -0600 Subject: mesa: remove feature tests --- src/mesa/main/formats.c | 12 ------------ src/mesa/main/formats.h | 8 -------- src/mesa/main/texfetch.c | 4 ---- src/mesa/main/texfetch_tmp.h | 4 ---- 4 files changed, 28 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index ebe59f8960..c98e90d1c3 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -261,8 +261,6 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 0, 0, 0, 0, 8, /* Lum/Int/Index/Depth/StencilBits */ 1, 1, 1 /* BlockWidth/Height,Bytes */ }, - -#if FEATURE_EXT_texture_sRGB { MESA_FORMAT_SRGB8, GL_RGB, @@ -303,7 +301,6 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 8, 0, 0, 0, 0, 1, 1, 2 }, -#if FEATURE_texture_s3tc { MESA_FORMAT_SRGB_DXT1, /* Name */ GL_RGB, /* BaseFormat */ @@ -336,10 +333,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 0, 0, 0, 0, 0, 4, 4, 16 /* 16 bytes per 4x4 block */ }, -#endif -#endif -#if FEATURE_texture_fxt1 { MESA_FORMAT_RGB_FXT1, GL_RGB, @@ -356,9 +350,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 0, 0, 0, 0, 0, 8, 4, 16 /* 16 bytes per 8x4 block */ }, -#endif -#if FEATURE_texture_s3tc { MESA_FORMAT_RGB_DXT1, /* Name */ GL_RGB, /* BaseFormat */ @@ -391,8 +383,6 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 0, 0, 0, 0, 0, 4, 4, 16 /* 16 bytes per 4x4 block */ }, -#endif - { MESA_FORMAT_RGBA_FLOAT32, GL_RGBA, @@ -489,7 +479,6 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 0, 16, 0, 0, 0, 1, 1, 2 }, - { MESA_FORMAT_DUDV8, GL_DUDV_ATI, @@ -498,7 +487,6 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 0, 0, 0, 0, 0, 1, 1, 2 }, - { MESA_FORMAT_SIGNED_RGBA8888, GL_RGBA, diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index 316ff1a8ec..7a2a948991 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -79,7 +79,6 @@ typedef enum MESA_FORMAT_S8, /* SSSS SSSS */ /*@}*/ -#if FEATURE_EXT_texture_sRGB /** * \name 8-bit/channel sRGB formats */ @@ -89,29 +88,22 @@ typedef enum MESA_FORMAT_SARGB8, MESA_FORMAT_SL8, MESA_FORMAT_SLA8, -#if FEATURE_texture_s3tc MESA_FORMAT_SRGB_DXT1, MESA_FORMAT_SRGBA_DXT1, MESA_FORMAT_SRGBA_DXT3, MESA_FORMAT_SRGBA_DXT5, -#endif /*@}*/ -#endif /** * \name Compressed texture formats. */ /*@{*/ -#if FEATURE_texture_fxt1 MESA_FORMAT_RGB_FXT1, MESA_FORMAT_RGBA_FXT1, -#endif -#if FEATURE_texture_s3tc MESA_FORMAT_RGB_DXT1, MESA_FORMAT_RGBA_DXT1, MESA_FORMAT_RGBA_DXT3, MESA_FORMAT_RGBA_DXT5, -#endif /*@}*/ /** diff --git a/src/mesa/main/texfetch.c b/src/mesa/main/texfetch.c index 851659e9c5..fbb3170ff5 100644 --- a/src/mesa/main/texfetch.c +++ b/src/mesa/main/texfetch.c @@ -41,8 +41,6 @@ #include "texfetch.h" -#if FEATURE_EXT_texture_sRGB - /** * Convert an 8-bit sRGB value from non-linear space to a * linear RGB value in [0, 1]. @@ -71,8 +69,6 @@ nonlinear_to_linear(GLubyte cs8) } -#endif /* FEATURE_EXT_texture_sRGB */ - /* Texel fetch routines for all supported formats */ diff --git a/src/mesa/main/texfetch_tmp.h b/src/mesa/main/texfetch_tmp.h index 3ac932b979..43030c2985 100644 --- a/src/mesa/main/texfetch_tmp.h +++ b/src/mesa/main/texfetch_tmp.h @@ -989,8 +989,6 @@ static void store_texel_ci8(struct gl_texture_image *texImage, #endif -#if FEATURE_EXT_texture_sRGB - /* Fetch texel from 1D, 2D or 3D srgb8 texture, return 4 GLfloats */ /* Note: component order is same as for MESA_FORMAT_RGB888 */ static void FETCH(srgb8)(const struct gl_texture_image *texImage, @@ -1100,8 +1098,6 @@ static void store_texel_sla8(struct gl_texture_image *texImage, } #endif -#endif /* FEATURE_EXT_texture_sRGB */ - /* MESA_FORMAT_DUDV8 ********************************************************/ -- cgit v1.2.3 From be0765cd6ec47cf068775197f312a1123e044566 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 5 Oct 2009 17:50:33 -0600 Subject: mesa: move gl_format_info struct to formats.c This is a private datatype. --- src/mesa/main/formats.c | 37 +++++++++++++++++++++++++++++++++++++ src/mesa/main/formats.h | 38 -------------------------------------- 2 files changed, 37 insertions(+), 38 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index c98e90d1c3..e38c51772d 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -30,6 +30,43 @@ #include "texstore.h" +/** + * Information about texture formats. + */ +struct gl_format_info +{ + gl_format Name; + + /** + * Base format is one of GL_RGB, GL_RGBA, GL_ALPHA, GL_LUMINANCE, + * GL_LUMINANCE_ALPHA, GL_INTENSITY, GL_COLOR_INDEX, GL_DEPTH_COMPONENT. + */ + GLenum BaseFormat; + + /** + * Logical data type: one of GL_UNSIGNED_NORMALIZED, GL_SIGNED_NORMALED, + * GL_UNSIGNED_INT, GL_SIGNED_INT, GL_FLOAT. + */ + GLenum DataType; + + GLubyte RedBits; + GLubyte GreenBits; + GLubyte BlueBits; + GLubyte AlphaBits; + GLubyte LuminanceBits; + GLubyte IntensityBits; + GLubyte IndexBits; + GLubyte DepthBits; + GLubyte StencilBits; + + /** + * To describe compressed formats. If not compressed, Width=Height=1. + */ + GLubyte BlockWidth, BlockHeight; + GLubyte BytesPerBlock; +}; + + /** * Info about each format. * These must be in the same order as the MESA_FORMAT_* enums so that diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index 7a2a948991..723e237a57 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -137,44 +137,6 @@ typedef enum } gl_format; -/** - * Information about texture formats. - */ -struct gl_format_info -{ - gl_format Name; - - /** - * Base format is one of GL_RGB, GL_RGBA, GL_ALPHA, GL_LUMINANCE, - * GL_LUMINANCE_ALPHA, GL_INTENSITY, GL_COLOR_INDEX, GL_DEPTH_COMPONENT. - */ - GLenum BaseFormat; - - /** - * Logical data type: one of GL_UNSIGNED_NORMALIZED, GL_SIGNED_NORMALED, - * GL_UNSIGNED_INT, GL_SIGNED_INT, GL_FLOAT. - */ - GLenum DataType; - - GLubyte RedBits; - GLubyte GreenBits; - GLubyte BlueBits; - GLubyte AlphaBits; - GLubyte LuminanceBits; - GLubyte IntensityBits; - GLubyte IndexBits; - GLubyte DepthBits; - GLubyte StencilBits; - - /** - * To describe compressed formats. If not compressed, Width=Height=1. - */ - GLubyte BlockWidth, BlockHeight; - GLubyte BytesPerBlock; -}; - - - extern GLuint _mesa_get_format_bytes(gl_format format); -- cgit v1.2.3 From 019bc97bd900a84f5f999afdb42928e92d33814b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 5 Oct 2009 17:54:20 -0600 Subject: mesa: move _mesa_format_to_type_and_comps() to formats.c --- src/mesa/main/formats.c | 257 +++++++++++++++++++++++++++++----------------- src/mesa/main/formats.h | 7 +- src/mesa/main/mipmap.c | 1 - src/mesa/main/texformat.c | 179 -------------------------------- src/mesa/main/texformat.h | 4 - 5 files changed, 168 insertions(+), 280 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index e38c51772d..d3c8b1213b 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -734,109 +734,182 @@ _mesa_test_formats(void) } + /** - * XXX possible replacement for _mesa_format_to_type_and_comps() - * Used for mipmap generation. + * Return datatype and number of components per texel for the given gl_format. + * Only used for mipmap generation code. */ void -_mesa_format_to_type_and_comps2(gl_format format, - GLenum *datatype, GLuint *comps) +_mesa_format_to_type_and_comps(gl_format format, + GLenum *datatype, GLuint *comps) { - const struct gl_format_info *info = _mesa_get_format_info(format); - - /* We use a bunch of heuristics here. If this gets too ugly we could - * just encode the info the in the gl_format_info structures. - */ - if (info->BaseFormat == GL_RGB || - info->BaseFormat == GL_RGBA || - info->BaseFormat == GL_ALPHA) { - *comps = ((info->RedBits > 0) + - (info->GreenBits > 0) + - (info->BlueBits > 0) + - (info->AlphaBits > 0)); - - if (info->DataType== GL_FLOAT) { - if (info->RedBits == 32) - *datatype = GL_FLOAT; - else - *datatype = GL_HALF_FLOAT; - } - else if (info->GreenBits == 3) { - *datatype = GL_UNSIGNED_BYTE_3_3_2; - } - else if (info->GreenBits == 4) { - *datatype = GL_UNSIGNED_SHORT_4_4_4_4; - } - else if (info->GreenBits == 6) { - *datatype = GL_UNSIGNED_SHORT_5_6_5; - } - else if (info->GreenBits == 5) { - *datatype = GL_UNSIGNED_SHORT_1_5_5_5_REV; - } - else if (info->RedBits == 8) { - *datatype = GL_UNSIGNED_BYTE; - } - else { - ASSERT(info->RedBits == 16); - *datatype = GL_UNSIGNED_SHORT; - } - } - else if (info->BaseFormat == GL_LUMINANCE || - info->BaseFormat == GL_LUMINANCE_ALPHA) { - *comps = ((info->LuminanceBits > 0) + - (info->AlphaBits > 0)); - if (info->LuminanceBits == 8) { - *datatype = GL_UNSIGNED_BYTE; - } - else if (info->LuminanceBits == 16) { - *datatype = GL_UNSIGNED_SHORT; - } - else { - *datatype = GL_FLOAT; - } - } - else if (info->BaseFormat == GL_INTENSITY) { - *comps = 1; - if (info->IntensityBits == 8) { - *datatype = GL_UNSIGNED_BYTE; - } - else if (info->IntensityBits == 16) { - *datatype = GL_UNSIGNED_SHORT; - } - else { - *datatype = GL_FLOAT; - } - } - else if (info->BaseFormat == GL_COLOR_INDEX) { - *comps = 1; + switch (format) { + case MESA_FORMAT_RGBA8888: + case MESA_FORMAT_RGBA8888_REV: + case MESA_FORMAT_ARGB8888: + case MESA_FORMAT_ARGB8888_REV: + *datatype = GL_UNSIGNED_BYTE; + *comps = 4; + return; + case MESA_FORMAT_RGB888: + case MESA_FORMAT_BGR888: + *datatype = GL_UNSIGNED_BYTE; + *comps = 3; + return; + case MESA_FORMAT_RGB565: + case MESA_FORMAT_RGB565_REV: + *datatype = GL_UNSIGNED_SHORT_5_6_5; + *comps = 3; + return; + + case MESA_FORMAT_ARGB4444: + case MESA_FORMAT_ARGB4444_REV: + *datatype = GL_UNSIGNED_SHORT_4_4_4_4; + *comps = 4; + return; + + case MESA_FORMAT_ARGB1555: + case MESA_FORMAT_ARGB1555_REV: + *datatype = GL_UNSIGNED_SHORT_1_5_5_5_REV; + *comps = 4; + return; + + case MESA_FORMAT_AL88: + case MESA_FORMAT_AL88_REV: + *datatype = GL_UNSIGNED_BYTE; + *comps = 2; + return; + case MESA_FORMAT_RGB332: + *datatype = GL_UNSIGNED_BYTE_3_3_2; + *comps = 3; + return; + + case MESA_FORMAT_A8: + case MESA_FORMAT_L8: + case MESA_FORMAT_I8: + case MESA_FORMAT_CI8: *datatype = GL_UNSIGNED_BYTE; - } - else if (info->BaseFormat == GL_DEPTH_COMPONENT) { - *comps = 1; - if (info->DepthBits == 16) { - *datatype = GL_UNSIGNED_SHORT; - } - else { - ASSERT(info->DepthBits == 32); - *datatype = GL_UNSIGNED_INT; - } - } - else if (info->BaseFormat == GL_DEPTH_STENCIL) { *comps = 1; - *datatype = GL_UNSIGNED_INT; - } - else if (info->BaseFormat == GL_YCBCR_MESA) { + return; + + case MESA_FORMAT_YCBCR: + case MESA_FORMAT_YCBCR_REV: + *datatype = GL_UNSIGNED_SHORT; *comps = 2; + return; + + case MESA_FORMAT_Z24_S8: + *datatype = GL_UNSIGNED_INT; + *comps = 1; /* XXX OK? */ + return; + + case MESA_FORMAT_S8_Z24: + *datatype = GL_UNSIGNED_INT; + *comps = 1; /* XXX OK? */ + return; + + case MESA_FORMAT_Z16: *datatype = GL_UNSIGNED_SHORT; - } - else if (info->BaseFormat == GL_DUDV_ATI) { + *comps = 1; + return; + + case MESA_FORMAT_Z32: + *datatype = GL_UNSIGNED_INT; + *comps = 1; + return; + + case MESA_FORMAT_DUDV8: + *datatype = GL_BYTE; *comps = 2; + return; + + case MESA_FORMAT_SIGNED_RGBA8888: + case MESA_FORMAT_SIGNED_RGBA8888_REV: *datatype = GL_BYTE; - } - else { - /* any other formats? */ - ASSERT(0); + *comps = 4; + return; + +#if FEATURE_EXT_texture_sRGB + case MESA_FORMAT_SRGB8: + *datatype = GL_UNSIGNED_BYTE; + *comps = 3; + return; + case MESA_FORMAT_SRGBA8: + case MESA_FORMAT_SARGB8: + *datatype = GL_UNSIGNED_BYTE; + *comps = 4; + return; + case MESA_FORMAT_SL8: + *datatype = GL_UNSIGNED_BYTE; *comps = 1; + return; + case MESA_FORMAT_SLA8: + *datatype = GL_UNSIGNED_BYTE; + *comps = 2; + return; +#endif + +#if FEATURE_texture_fxt1 + case MESA_FORMAT_RGB_FXT1: + case MESA_FORMAT_RGBA_FXT1: +#endif +#if FEATURE_texture_s3tc + case MESA_FORMAT_RGB_DXT1: + case MESA_FORMAT_RGBA_DXT1: + case MESA_FORMAT_RGBA_DXT3: + case MESA_FORMAT_RGBA_DXT5: +#if FEATURE_EXT_texture_sRGB + case MESA_FORMAT_SRGB_DXT1: + case MESA_FORMAT_SRGBA_DXT1: + case MESA_FORMAT_SRGBA_DXT3: + case MESA_FORMAT_SRGBA_DXT5: +#endif + /* XXX generate error instead? */ *datatype = GL_UNSIGNED_BYTE; + *comps = 0; + return; +#endif + + case MESA_FORMAT_RGBA_FLOAT32: + *datatype = GL_FLOAT; + *comps = 4; + return; + case MESA_FORMAT_RGBA_FLOAT16: + *datatype = GL_HALF_FLOAT_ARB; + *comps = 4; + return; + case MESA_FORMAT_RGB_FLOAT32: + *datatype = GL_FLOAT; + *comps = 3; + return; + case MESA_FORMAT_RGB_FLOAT16: + *datatype = GL_HALF_FLOAT_ARB; + *comps = 3; + return; + case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32: + *datatype = GL_FLOAT; + *comps = 2; + return; + case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16: + *datatype = GL_HALF_FLOAT_ARB; + *comps = 2; + return; + case MESA_FORMAT_ALPHA_FLOAT32: + case MESA_FORMAT_LUMINANCE_FLOAT32: + case MESA_FORMAT_INTENSITY_FLOAT32: + *datatype = GL_FLOAT; + *comps = 1; + return; + case MESA_FORMAT_ALPHA_FLOAT16: + case MESA_FORMAT_LUMINANCE_FLOAT16: + case MESA_FORMAT_INTENSITY_FLOAT16: + *datatype = GL_HALF_FLOAT_ARB; + *comps = 1; + return; + + default: + _mesa_problem(NULL, "bad format in _mesa_format_to_type_and_comps"); + *datatype = 0; + *comps = 1; } } diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index 723e237a57..6aebb85f2b 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -152,10 +152,6 @@ _mesa_get_format_base_format(gl_format format); extern GLboolean _mesa_is_format_compressed(gl_format format); -extern void -_mesa_format_to_type_and_comps2(gl_format format, - GLenum *datatype, GLuint *comps); - extern GLuint _mesa_format_image_size(gl_format format, GLsizei width, GLsizei height, GLsizei depth); @@ -163,6 +159,9 @@ _mesa_format_image_size(gl_format format, GLsizei width, extern GLint _mesa_format_row_stride(gl_format format, GLsizei width); +extern void +_mesa_format_to_type_and_comps(gl_format format, + GLenum *datatype, GLuint *comps); extern void _mesa_test_formats(void); diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index e24e7285c3..694d593330 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -31,7 +31,6 @@ #include "formats.h" #include "mipmap.h" #include "texcompress.h" -#include "texformat.h" #include "teximage.h" #include "texstore.h" #include "image.h" diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index b1ae324050..038dc0bb50 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -362,182 +362,3 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, return MESA_FORMAT_NONE; } - - -/** - * Return datatype and number of components per texel for the given gl_format. - */ -void -_mesa_format_to_type_and_comps(gl_format format, - GLenum *datatype, GLuint *comps) -{ - switch (format) { - case MESA_FORMAT_RGBA8888: - case MESA_FORMAT_RGBA8888_REV: - case MESA_FORMAT_ARGB8888: - case MESA_FORMAT_ARGB8888_REV: - *datatype = CHAN_TYPE; - *comps = 4; - return; - case MESA_FORMAT_RGB888: - case MESA_FORMAT_BGR888: - *datatype = GL_UNSIGNED_BYTE; - *comps = 3; - return; - case MESA_FORMAT_RGB565: - case MESA_FORMAT_RGB565_REV: - *datatype = GL_UNSIGNED_SHORT_5_6_5; - *comps = 3; - return; - - case MESA_FORMAT_ARGB4444: - case MESA_FORMAT_ARGB4444_REV: - *datatype = GL_UNSIGNED_SHORT_4_4_4_4; - *comps = 4; - return; - - case MESA_FORMAT_ARGB1555: - case MESA_FORMAT_ARGB1555_REV: - *datatype = GL_UNSIGNED_SHORT_1_5_5_5_REV; - *comps = 4; - return; - - case MESA_FORMAT_AL88: - case MESA_FORMAT_AL88_REV: - *datatype = GL_UNSIGNED_BYTE; - *comps = 2; - return; - case MESA_FORMAT_RGB332: - *datatype = GL_UNSIGNED_BYTE_3_3_2; - *comps = 3; - return; - - case MESA_FORMAT_A8: - case MESA_FORMAT_L8: - case MESA_FORMAT_I8: - case MESA_FORMAT_CI8: - *datatype = GL_UNSIGNED_BYTE; - *comps = 1; - return; - - case MESA_FORMAT_YCBCR: - case MESA_FORMAT_YCBCR_REV: - *datatype = GL_UNSIGNED_SHORT; - *comps = 2; - return; - - case MESA_FORMAT_Z24_S8: - *datatype = GL_UNSIGNED_INT; - *comps = 1; /* XXX OK? */ - return; - - case MESA_FORMAT_S8_Z24: - *datatype = GL_UNSIGNED_INT; - *comps = 1; /* XXX OK? */ - return; - - case MESA_FORMAT_Z16: - *datatype = GL_UNSIGNED_SHORT; - *comps = 1; - return; - - case MESA_FORMAT_Z32: - *datatype = GL_UNSIGNED_INT; - *comps = 1; - return; - - case MESA_FORMAT_DUDV8: - *datatype = GL_BYTE; - *comps = 2; - return; - - case MESA_FORMAT_SIGNED_RGBA8888: - case MESA_FORMAT_SIGNED_RGBA8888_REV: - *datatype = GL_BYTE; - *comps = 4; - return; - -#if FEATURE_EXT_texture_sRGB - case MESA_FORMAT_SRGB8: - *datatype = GL_UNSIGNED_BYTE; - *comps = 3; - return; - case MESA_FORMAT_SRGBA8: - case MESA_FORMAT_SARGB8: - *datatype = GL_UNSIGNED_BYTE; - *comps = 4; - return; - case MESA_FORMAT_SL8: - *datatype = GL_UNSIGNED_BYTE; - *comps = 1; - return; - case MESA_FORMAT_SLA8: - *datatype = GL_UNSIGNED_BYTE; - *comps = 2; - return; -#endif - -#if FEATURE_texture_fxt1 - case MESA_FORMAT_RGB_FXT1: - case MESA_FORMAT_RGBA_FXT1: -#endif -#if FEATURE_texture_s3tc - case MESA_FORMAT_RGB_DXT1: - case MESA_FORMAT_RGBA_DXT1: - case MESA_FORMAT_RGBA_DXT3: - case MESA_FORMAT_RGBA_DXT5: -#if FEATURE_EXT_texture_sRGB - case MESA_FORMAT_SRGB_DXT1: - case MESA_FORMAT_SRGBA_DXT1: - case MESA_FORMAT_SRGBA_DXT3: - case MESA_FORMAT_SRGBA_DXT5: -#endif - /* XXX generate error instead? */ - *datatype = GL_UNSIGNED_BYTE; - *comps = 0; - return; -#endif - - case MESA_FORMAT_RGBA_FLOAT32: - *datatype = GL_FLOAT; - *comps = 4; - return; - case MESA_FORMAT_RGBA_FLOAT16: - *datatype = GL_HALF_FLOAT_ARB; - *comps = 4; - return; - case MESA_FORMAT_RGB_FLOAT32: - *datatype = GL_FLOAT; - *comps = 3; - return; - case MESA_FORMAT_RGB_FLOAT16: - *datatype = GL_HALF_FLOAT_ARB; - *comps = 3; - return; - case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32: - *datatype = GL_FLOAT; - *comps = 2; - return; - case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16: - *datatype = GL_HALF_FLOAT_ARB; - *comps = 2; - return; - case MESA_FORMAT_ALPHA_FLOAT32: - case MESA_FORMAT_LUMINANCE_FLOAT32: - case MESA_FORMAT_INTENSITY_FLOAT32: - *datatype = GL_FLOAT; - *comps = 1; - return; - case MESA_FORMAT_ALPHA_FLOAT16: - case MESA_FORMAT_LUMINANCE_FLOAT16: - case MESA_FORMAT_INTENSITY_FLOAT16: - *datatype = GL_HALF_FLOAT_ARB; - *comps = 1; - return; - - default: - _mesa_problem(NULL, "bad format in _mesa_format_to_type_and_comps"); - *datatype = 0; - *comps = 1; - } -} diff --git a/src/mesa/main/texformat.h b/src/mesa/main/texformat.h index 0711b67da1..bda5fd6d8c 100644 --- a/src/mesa/main/texformat.h +++ b/src/mesa/main/texformat.h @@ -36,8 +36,4 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, GLenum format, GLenum type ); -extern void -_mesa_format_to_type_and_comps(gl_format format, - GLenum *datatype, GLuint *comps); - #endif -- cgit v1.2.3 From 90cd968300b8490f6efd75ef751fd3b6554f16d3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 5 Oct 2009 17:56:31 -0600 Subject: mesa: don't include texformat.h --- src/mesa/main/debug.c | 1 - src/mesa/main/texcompress.c | 1 - src/mesa/main/texcompress_fxt1.c | 1 - src/mesa/main/texcompress_s3tc.c | 1 - src/mesa/main/texgetimage.c | 2 +- src/mesa/main/teximage.c | 1 - src/mesa/main/texstore.c | 1 - 7 files changed, 1 insertion(+), 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 391180a7c6..e55c2f02c9 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -35,7 +35,6 @@ #include "readpix.h" #include "texgetimage.h" #include "texobj.h" -#include "texformat.h" /** diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c index a2b1218d0c..5713b2c00d 100644 --- a/src/mesa/main/texcompress.c +++ b/src/mesa/main/texcompress.c @@ -38,7 +38,6 @@ #include "image.h" #include "mipmap.h" #include "texcompress.h" -#include "texformat.h" #include "texstore.h" diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c index 7a30806b60..ef42fb92b7 100644 --- a/src/mesa/main/texcompress_fxt1.c +++ b/src/mesa/main/texcompress_fxt1.c @@ -38,7 +38,6 @@ #include "mipmap.h" #include "texcompress.h" #include "texcompress_fxt1.h" -#include "texformat.h" #include "texstore.h" diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c index 2f7168c622..9fc73fec51 100644 --- a/src/mesa/main/texcompress_s3tc.c +++ b/src/mesa/main/texcompress_s3tc.c @@ -42,7 +42,6 @@ #include "image.h" #include "texcompress.h" #include "texcompress_s3tc.h" -#include "texformat.h" #include "texstore.h" #ifdef __MINGW32__ diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index 341ce6103f..d5cd4b2b9d 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -32,9 +32,9 @@ #include "glheader.h" #include "bufferobj.h" #include "context.h" +#include "formats.h" #include "image.h" #include "texcompress.h" -#include "texformat.h" #include "texgetimage.h" #include "teximage.h" #include "texstate.h" diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 457380b8fa..52d2886d0a 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -44,7 +44,6 @@ #include "state.h" #include "texcompress.h" #include "texfetch.h" -#include "texformat.h" #include "teximage.h" #include "texstate.h" #include "texstore.h" diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 52502b7033..83e349d010 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -64,7 +64,6 @@ #include "texcompress.h" #include "texcompress_fxt1.h" #include "texcompress_s3tc.h" -#include "texformat.h" #include "teximage.h" #include "texstore.h" #include "enums.h" -- cgit v1.2.3 From 3e34a2a2b97e7c93955deedb7c12b73bccd6662d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 5 Oct 2009 18:11:35 -0600 Subject: drivers: don't include texformat.h And remove other unneeded #includes while we're at it. --- src/mesa/drivers/dri/gamma/gamma_tex.c | 13 +++++-------- src/mesa/drivers/dri/i810/i810tex.c | 1 - src/mesa/drivers/dri/i810/i810texmem.c | 1 - src/mesa/drivers/dri/i810/i810texstate.c | 1 - src/mesa/drivers/dri/i915/i830_texblend.c | 1 - src/mesa/drivers/dri/i915/i830_texstate.c | 1 - src/mesa/drivers/dri/i915/i830_vtbl.c | 1 - src/mesa/drivers/dri/i915/i915_texstate.c | 1 - src/mesa/drivers/dri/i915/i915_vtbl.c | 1 - src/mesa/drivers/dri/i965/brw_vs_surface_state.c | 1 - src/mesa/drivers/dri/i965/brw_wm.c | 1 - src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 1 - src/mesa/drivers/dri/intel/intel_blit.c | 1 - src/mesa/drivers/dri/intel/intel_fbo.c | 1 - src/mesa/drivers/dri/intel/intel_span.c | 1 - src/mesa/drivers/dri/intel/intel_tex_format.c | 1 - src/mesa/drivers/dri/intel/intel_tex_image.c | 1 - src/mesa/drivers/dri/mach64/mach64_tex.c | 1 - src/mesa/drivers/dri/mach64/mach64_texmem.c | 11 +++++------ src/mesa/drivers/dri/mach64/mach64_texstate.c | 1 - src/mesa/drivers/dri/mga/mga_texstate.c | 15 ++++++--------- src/mesa/drivers/dri/mga/mgatex.c | 13 ++++++------- src/mesa/drivers/dri/r128/r128_tex.c | 1 - src/mesa/drivers/dri/r128/r128_texmem.c | 1 - src/mesa/drivers/dri/r128/r128_texstate.c | 1 - src/mesa/drivers/dri/r200/r200_tex.c | 1 - src/mesa/drivers/dri/r200/r200_texstate.c | 1 - src/mesa/drivers/dri/r300/r300_state.c | 1 - src/mesa/drivers/dri/r300/r300_tex.c | 1 - src/mesa/drivers/dri/r300/r300_texstate.c | 1 - src/mesa/drivers/dri/r600/r600_tex.c | 1 - src/mesa/drivers/dri/r600/r600_texstate.c | 1 - src/mesa/drivers/dri/r600/r700_state.c | 1 - src/mesa/drivers/dri/radeon/radeon_fbo.c | 1 - src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c | 1 - src/mesa/drivers/dri/radeon/radeon_tex.c | 1 - src/mesa/drivers/dri/radeon/radeon_texstate.c | 1 - src/mesa/drivers/dri/radeon/radeon_texture.c | 1 - src/mesa/drivers/dri/s3v/s3v_tex.c | 4 ---- src/mesa/drivers/dri/savage/savage_xmesa.c | 2 +- src/mesa/drivers/dri/savage/savagetex.c | 23 +++++++++-------------- src/mesa/drivers/dri/sis/sis_tex.c | 8 +++----- src/mesa/drivers/dri/sis/sis_texstate.c | 1 - src/mesa/drivers/dri/tdfx/tdfx_state.c | 1 - src/mesa/drivers/dri/tdfx/tdfx_tex.c | 1 - src/mesa/drivers/dri/unichrome/via_tex.c | 3 +-- 46 files changed, 36 insertions(+), 93 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/gamma/gamma_tex.c b/src/mesa/drivers/dri/gamma/gamma_tex.c index 97797d4788..0dad250e4d 100644 --- a/src/mesa/drivers/dri/gamma/gamma_tex.c +++ b/src/mesa/drivers/dri/gamma/gamma_tex.c @@ -1,21 +1,18 @@ -#include -#include - #include "main/glheader.h" #include "main/mtypes.h" +#include "main/colormac.h" #include "main/imports.h" #include "main/simple_list.h" #include "main/enums.h" +#include "main/mm.h" #include "main/texstore.h" -#include "teximage.h" -#include "main/texformat.h" -#include "texobj.h" +#include "main/teximage.h" +#include "main/texobj.h" + #include "swrast/swrast.h" -#include "main/mm.h" #include "gammacontext.h" -#include "colormac.h" /* diff --git a/src/mesa/drivers/dri/i810/i810tex.c b/src/mesa/drivers/dri/i810/i810tex.c index 8166393eb1..2f6978f5aa 100644 --- a/src/mesa/drivers/dri/i810/i810tex.c +++ b/src/mesa/drivers/dri/i810/i810tex.c @@ -28,7 +28,6 @@ #include "main/simple_list.h" #include "main/enums.h" #include "main/texstore.h" -#include "main/texformat.h" #include "main/teximage.h" #include "main/texobj.h" #include "main/colormac.h" diff --git a/src/mesa/drivers/dri/i810/i810texmem.c b/src/mesa/drivers/dri/i810/i810texmem.c index c2a5d95fc7..d93afbf9ef 100644 --- a/src/mesa/drivers/dri/i810/i810texmem.c +++ b/src/mesa/drivers/dri/i810/i810texmem.c @@ -30,7 +30,6 @@ #include "main/enums.h" #include "main/colormac.h" #include "main/mm.h" -#include "main/texformat.h" #include "i810screen.h" #include "i810_dri.h" diff --git a/src/mesa/drivers/dri/i810/i810texstate.c b/src/mesa/drivers/dri/i810/i810texstate.c index b873ddbecb..bff28c11c8 100644 --- a/src/mesa/drivers/dri/i810/i810texstate.c +++ b/src/mesa/drivers/dri/i810/i810texstate.c @@ -25,7 +25,6 @@ #include "main/glheader.h" #include "main/macros.h" #include "main/mtypes.h" -#include "main/texformat.h" #include "main/simple_list.h" #include "main/enums.h" #include "main/mm.h" diff --git a/src/mesa/drivers/dri/i915/i830_texblend.c b/src/mesa/drivers/dri/i915/i830_texblend.c index 09f7f37e76..3f64be8c96 100644 --- a/src/mesa/drivers/dri/i915/i830_texblend.c +++ b/src/mesa/drivers/dri/i915/i830_texblend.c @@ -30,7 +30,6 @@ #include "main/mtypes.h" #include "main/simple_list.h" #include "main/enums.h" -#include "main/texformat.h" #include "main/texstore.h" #include "main/mm.h" diff --git a/src/mesa/drivers/dri/i915/i830_texstate.c b/src/mesa/drivers/dri/i915/i830_texstate.c index 837ae57074..98fb853c68 100644 --- a/src/mesa/drivers/dri/i915/i830_texstate.c +++ b/src/mesa/drivers/dri/i915/i830_texstate.c @@ -27,7 +27,6 @@ #include "main/mtypes.h" #include "main/enums.h" -#include "main/texformat.h" #include "intel_mipmap_tree.h" #include "intel_tex.h" diff --git a/src/mesa/drivers/dri/i915/i830_vtbl.c b/src/mesa/drivers/dri/i915/i830_vtbl.c index d53900b329..22f8bc7f19 100644 --- a/src/mesa/drivers/dri/i915/i830_vtbl.c +++ b/src/mesa/drivers/dri/i915/i830_vtbl.c @@ -26,7 +26,6 @@ **************************************************************************/ #include "glapi/glapi.h" -#include "main/texformat.h" #include "i830_context.h" #include "i830_reg.h" diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index d6f6cfdb49..03ed8a6311 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -27,7 +27,6 @@ #include "main/mtypes.h" #include "main/enums.h" -#include "main/texformat.h" #include "intel_mipmap_tree.h" #include "intel_tex.h" diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c b/src/mesa/drivers/dri/i915/i915_vtbl.c index 1c3da63da9..a4b00b06e7 100644 --- a/src/mesa/drivers/dri/i915/i915_vtbl.c +++ b/src/mesa/drivers/dri/i915/i915_vtbl.c @@ -32,7 +32,6 @@ #include "main/imports.h" #include "main/macros.h" #include "main/colormac.h" -#include "main/texformat.h" #include "tnl/t_context.h" #include "tnl/t_vertex.h" diff --git a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c index 89f47522a1..4fa3269bed 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c @@ -30,7 +30,6 @@ */ #include "main/mtypes.h" -#include "main/texformat.h" #include "main/texstore.h" #include "shader/prog_parameter.h" diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index 46df778bee..5a2ac1a651 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -29,7 +29,6 @@ * Keith Whitwell */ -#include "main/texformat.h" #include "brw_context.h" #include "brw_util.h" #include "brw_wm.h" diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index 855fe7593d..ea559d2ac7 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -31,7 +31,6 @@ #include "main/mtypes.h" -#include "main/texformat.h" #include "main/texstore.h" #include "shader/prog_parameter.h" diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c index 799b22cc90..0158bd309f 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.c +++ b/src/mesa/drivers/dri/intel/intel_blit.c @@ -29,7 +29,6 @@ #include "main/mtypes.h" #include "main/context.h" #include "main/enums.h" -#include "main/texformat.h" #include "main/colormac.h" #include "intel_blit.h" diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 1be381b9ea..3b4b90f2dc 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -33,7 +33,6 @@ #include "main/framebuffer.h" #include "main/renderbuffer.h" #include "main/context.h" -#include "main/texformat.h" #include "main/texrender.h" #include "drivers/common/meta.h" diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index f754ce0cd1..5bbcce6fe4 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -29,7 +29,6 @@ #include "main/macros.h" #include "main/mtypes.h" #include "main/colormac.h" -#include "main/texformat.h" #include "intel_buffers.h" #include "intel_fbo.h" diff --git a/src/mesa/drivers/dri/intel/intel_tex_format.c b/src/mesa/drivers/dri/intel/intel_tex_format.c index 22c010bbd7..eca0f6d572 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_format.c +++ b/src/mesa/drivers/dri/intel/intel_tex_format.c @@ -1,7 +1,6 @@ #include "intel_context.h" #include "intel_tex.h" #include "intel_chipset.h" -#include "main/texformat.h" #include "main/enums.h" diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index f32ff0dd05..b159010b8e 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -7,7 +7,6 @@ #include "main/convolve.h" #include "main/context.h" #include "main/texcompress.h" -#include "main/texformat.h" #include "main/texstore.h" #include "main/texgetimage.h" #include "main/texobj.h" diff --git a/src/mesa/drivers/dri/mach64/mach64_tex.c b/src/mesa/drivers/dri/mach64/mach64_tex.c index 02433e5dd8..cce0e4d3ff 100644 --- a/src/mesa/drivers/dri/mach64/mach64_tex.c +++ b/src/mesa/drivers/dri/mach64/mach64_tex.c @@ -41,7 +41,6 @@ #include "main/simple_list.h" #include "main/enums.h" #include "main/texstore.h" -#include "main/texformat.h" #include "main/teximage.h" #include "main/texobj.h" #include "main/imports.h" diff --git a/src/mesa/drivers/dri/mach64/mach64_texmem.c b/src/mesa/drivers/dri/mach64/mach64_texmem.c index e83aeae3e1..b97e9eec25 100644 --- a/src/mesa/drivers/dri/mach64/mach64_texmem.c +++ b/src/mesa/drivers/dri/mach64/mach64_texmem.c @@ -31,6 +31,11 @@ * Jose Fonseca */ +#include "main/context.h" +#include "main/macros.h" +#include "main/simple_list.h" +#include "main/imports.h" + #include "mach64_context.h" #include "mach64_state.h" #include "mach64_ioctl.h" @@ -38,12 +43,6 @@ #include "mach64_tris.h" #include "mach64_tex.h" -#include "main/context.h" -#include "main/macros.h" -#include "main/simple_list.h" -#include "main/texformat.h" -#include "main/imports.h" - /* Destroy hardware state associated with texture `t'. */ diff --git a/src/mesa/drivers/dri/mach64/mach64_texstate.c b/src/mesa/drivers/dri/mach64/mach64_texstate.c index c333355324..df0a09a5c1 100644 --- a/src/mesa/drivers/dri/mach64/mach64_texstate.c +++ b/src/mesa/drivers/dri/mach64/mach64_texstate.c @@ -33,7 +33,6 @@ #include "main/imports.h" #include "main/context.h" #include "main/macros.h" -#include "main/texformat.h" #include "mach64_context.h" #include "mach64_ioctl.h" diff --git a/src/mesa/drivers/dri/mga/mga_texstate.c b/src/mesa/drivers/dri/mga/mga_texstate.c index d52f0fac75..54eda62a96 100644 --- a/src/mesa/drivers/dri/mga/mga_texstate.c +++ b/src/mesa/drivers/dri/mga/mga_texstate.c @@ -27,22 +27,19 @@ * Keith Whitwell */ -#include +#include "main/context.h" +#include "main/enums.h" +#include "main/macros.h" #include "main/mm.h" +#include "main/imports.h" +#include "main/simple_list.h" + #include "mgacontext.h" #include "mgatex.h" #include "mgaregs.h" #include "mgatris.h" #include "mgaioctl.h" -#include "main/context.h" -#include "main/enums.h" -#include "main/macros.h" -#include "main/imports.h" - -#include "main/simple_list.h" -#include "main/texformat.h" - #define MGA_USE_TABLE_FOR_FORMAT #ifdef MGA_USE_TABLE_FOR_FORMAT #define TMC_nr_tformat (MESA_FORMAT_YCBCR_REV + 1) diff --git a/src/mesa/drivers/dri/mga/mgatex.c b/src/mesa/drivers/dri/mga/mgatex.c index 71a8400e3b..9163371b33 100644 --- a/src/mesa/drivers/dri/mga/mgatex.c +++ b/src/mesa/drivers/dri/mga/mgatex.c @@ -27,23 +27,22 @@ #include "main/glheader.h" #include "main/mm.h" -#include "mgacontext.h" -#include "mgatex.h" -#include "mgaregs.h" -#include "mgatris.h" -#include "mgaioctl.h" - #include "main/colormac.h" #include "main/context.h" #include "main/enums.h" #include "main/simple_list.h" #include "main/imports.h" #include "main/macros.h" -#include "main/texformat.h" #include "main/texstore.h" #include "main/teximage.h" #include "main/texobj.h" +#include "mgacontext.h" +#include "mgatex.h" +#include "mgaregs.h" +#include "mgatris.h" +#include "mgaioctl.h" + #include "swrast/swrast.h" #include "xmlpool.h" diff --git a/src/mesa/drivers/dri/r128/r128_tex.c b/src/mesa/drivers/dri/r128/r128_tex.c index 6acda445f7..0a1207fb89 100644 --- a/src/mesa/drivers/dri/r128/r128_tex.c +++ b/src/mesa/drivers/dri/r128/r128_tex.c @@ -44,7 +44,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/simple_list.h" #include "main/enums.h" #include "main/texstore.h" -#include "main/texformat.h" #include "main/teximage.h" #include "main/texobj.h" #include "main/imports.h" diff --git a/src/mesa/drivers/dri/r128/r128_texmem.c b/src/mesa/drivers/dri/r128/r128_texmem.c index 84f8563b89..4ddcb86bcd 100644 --- a/src/mesa/drivers/dri/r128/r128_texmem.c +++ b/src/mesa/drivers/dri/r128/r128_texmem.c @@ -41,7 +41,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/context.h" #include "main/macros.h" #include "main/simple_list.h" -#include "main/texformat.h" #include "main/imports.h" #define TEX_0 1 diff --git a/src/mesa/drivers/dri/r128/r128_texstate.c b/src/mesa/drivers/dri/r128/r128_texstate.c index 2e71c25861..cb2b5f9536 100644 --- a/src/mesa/drivers/dri/r128/r128_texstate.c +++ b/src/mesa/drivers/dri/r128/r128_texstate.c @@ -36,7 +36,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/imports.h" #include "main/context.h" #include "main/macros.h" -#include "main/texformat.h" #include "r128_context.h" #include "r128_state.h" diff --git a/src/mesa/drivers/dri/r200/r200_tex.c b/src/mesa/drivers/dri/r200/r200_tex.c index 36d9e37d87..5a21a8b9c5 100644 --- a/src/mesa/drivers/dri/r200/r200_tex.c +++ b/src/mesa/drivers/dri/r200/r200_tex.c @@ -38,7 +38,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/enums.h" #include "main/image.h" #include "main/simple_list.h" -#include "main/texformat.h" #include "main/texstore.h" #include "main/teximage.h" #include "main/texobj.h" diff --git a/src/mesa/drivers/dri/r200/r200_texstate.c b/src/mesa/drivers/dri/r200/r200_texstate.c index 1a6fa9f548..20ec6fffaf 100644 --- a/src/mesa/drivers/dri/r200/r200_texstate.c +++ b/src/mesa/drivers/dri/r200/r200_texstate.c @@ -36,7 +36,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/imports.h" #include "main/context.h" #include "main/macros.h" -#include "main/texformat.h" #include "main/teximage.h" #include "main/texobj.h" #include "main/enums.h" diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 3060f49aaf..ac20c08e20 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -45,7 +45,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/framebuffer.h" #include "main/simple_list.h" #include "main/api_arrayelt.h" -#include "main/texformat.h" #include "swrast/swrast.h" #include "swrast_setup/swrast_setup.h" diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c index 10daeca9e6..27b78a912f 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.c +++ b/src/mesa/drivers/dri/r300/r300_tex.c @@ -40,7 +40,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/image.h" #include "main/mipmap.h" #include "main/simple_list.h" -#include "main/texformat.h" #include "main/texstore.h" #include "main/teximage.h" #include "main/texobj.h" diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index cb826248f3..1e9bd3e849 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -39,7 +39,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/imports.h" #include "main/context.h" #include "main/macros.h" -#include "main/texformat.h" #include "main/teximage.h" #include "main/texobj.h" #include "main/enums.h" diff --git a/src/mesa/drivers/dri/r600/r600_tex.c b/src/mesa/drivers/dri/r600/r600_tex.c index 47081c968e..20965bb3c8 100644 --- a/src/mesa/drivers/dri/r600/r600_tex.c +++ b/src/mesa/drivers/dri/r600/r600_tex.c @@ -40,7 +40,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/image.h" #include "main/mipmap.h" #include "main/simple_list.h" -#include "main/texformat.h" #include "main/texstore.h" #include "main/teximage.h" #include "main/texobj.h" diff --git a/src/mesa/drivers/dri/r600/r600_texstate.c b/src/mesa/drivers/dri/r600/r600_texstate.c index 55b455edc0..35186ef970 100644 --- a/src/mesa/drivers/dri/r600/r600_texstate.c +++ b/src/mesa/drivers/dri/r600/r600_texstate.c @@ -39,7 +39,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/imports.h" #include "main/context.h" #include "main/macros.h" -#include "main/texformat.h" #include "main/teximage.h" #include "main/texobj.h" #include "main/enums.h" diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index fbff109455..65f83b8315 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -46,7 +46,6 @@ #include "shader/prog_parameter.h" #include "shader/prog_statevars.h" #include "vbo/vbo.h" -#include "main/texformat.h" #include "r600_context.h" diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index 90ea2ec335..3f4f382d6c 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -33,7 +33,6 @@ #include "main/framebuffer.h" #include "main/renderbuffer.h" #include "main/context.h" -#include "main/texformat.h" #include "main/texrender.h" #include "drivers/common/meta.h" diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c index 5429525587..86f596deb9 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c @@ -32,7 +32,6 @@ #include "main/simple_list.h" #include "main/texcompress.h" -#include "main/texformat.h" static GLuint radeon_compressed_texture_size(GLcontext *ctx, GLsizei width, GLsizei height, GLsizei depth, diff --git a/src/mesa/drivers/dri/radeon/radeon_tex.c b/src/mesa/drivers/dri/radeon/radeon_tex.c index 99865fff27..60981aada2 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tex.c +++ b/src/mesa/drivers/dri/radeon/radeon_tex.c @@ -38,7 +38,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/enums.h" #include "main/image.h" #include "main/simple_list.h" -#include "main/texformat.h" #include "main/texstore.h" #include "main/teximage.h" #include "main/texobj.h" diff --git a/src/mesa/drivers/dri/radeon/radeon_texstate.c b/src/mesa/drivers/dri/radeon/radeon_texstate.c index cb17f48bf3..c7786381ae 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texstate.c +++ b/src/mesa/drivers/dri/radeon/radeon_texstate.c @@ -38,7 +38,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/colormac.h" #include "main/context.h" #include "main/macros.h" -#include "main/texformat.h" #include "main/teximage.h" #include "main/texobj.h" #include "main/enums.h" diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 17e42e72ee..8e9276c5ae 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -34,7 +34,6 @@ #include "main/convolve.h" #include "main/mipmap.h" #include "main/texcompress.h" -#include "main/texformat.h" #include "main/texstore.h" #include "main/teximage.h" #include "main/texobj.h" diff --git a/src/mesa/drivers/dri/s3v/s3v_tex.c b/src/mesa/drivers/dri/s3v/s3v_tex.c index ec1182f34f..517f5e5ca7 100644 --- a/src/mesa/drivers/dri/s3v/s3v_tex.c +++ b/src/mesa/drivers/dri/s3v/s3v_tex.c @@ -2,16 +2,12 @@ * Author: Max Lingua */ -#include -#include - #include "main/glheader.h" #include "main/mtypes.h" #include "main/simple_list.h" #include "main/enums.h" #include "main/mm.h" #include "main/texstore.h" -#include "main/texformat.h" #include "main/teximage.h" #include "swrast/swrast.h" diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c index 06179edae3..048fbe452c 100644 --- a/src/mesa/drivers/dri/savage/savage_xmesa.c +++ b/src/mesa/drivers/dri/savage/savage_xmesa.c @@ -574,7 +574,7 @@ savageDestroyContext(__DRIcontextPrivate *driContextPriv) _mesa_destroy_context(imesa->glCtx); /* no longer use vertex_dma_buf*/ - Xfree(imesa); + _mesa_free(imesa); } } diff --git a/src/mesa/drivers/dri/savage/savagetex.c b/src/mesa/drivers/dri/savage/savagetex.c index 796da4fc0d..6c97bb6c70 100644 --- a/src/mesa/drivers/dri/savage/savagetex.c +++ b/src/mesa/drivers/dri/savage/savagetex.c @@ -23,29 +23,24 @@ */ -#include -#include - -#include - +#include "main/context.h" #include "main/mm.h" -#include "savagecontext.h" -#include "savagetex.h" -#include "savagetris.h" -#include "savageioctl.h" -#include "main/simple_list.h" -#include "main/enums.h" -#include "savage_bci.h" - #include "main/macros.h" -#include "main/texformat.h" #include "main/texstore.h" #include "main/texobj.h" #include "main/convolve.h" #include "main/colormac.h" +#include "main/simple_list.h" +#include "main/enums.h" #include "swrast/swrast.h" +#include "savagecontext.h" +#include "savagetex.h" +#include "savagetris.h" +#include "savageioctl.h" +#include "savage_bci.h" + #include "xmlpool.h" #define TILE_INDEX_DXT1 0 diff --git a/src/mesa/drivers/dri/sis/sis_tex.c b/src/mesa/drivers/dri/sis/sis_tex.c index 5dc05146b1..951c470dad 100644 --- a/src/mesa/drivers/dri/sis/sis_tex.c +++ b/src/mesa/drivers/dri/sis/sis_tex.c @@ -28,17 +28,15 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * Eric Anholt */ -#include "sis_context.h" -#include "sis_alloc.h" -#include "sis_tex.h" - #include "swrast/swrast.h" #include "main/imports.h" -#include "main/texformat.h" #include "main/texstore.h" #include "main/teximage.h" #include "main/texobj.h" +#include "sis_context.h" +#include "sis_alloc.h" +#include "sis_tex.h" #include "xmlpool.h" #define ALIGN(value, align) (GLubyte *)((long)(value + align - 1) & ~(align - 1)) diff --git a/src/mesa/drivers/dri/sis/sis_texstate.c b/src/mesa/drivers/dri/sis/sis_texstate.c index 46417ce414..a507173b21 100644 --- a/src/mesa/drivers/dri/sis/sis_texstate.c +++ b/src/mesa/drivers/dri/sis/sis_texstate.c @@ -36,7 +36,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/colormac.h" #include "main/context.h" #include "main/macros.h" -#include "main/texformat.h" #include "sis_context.h" #include "sis_state.h" diff --git a/src/mesa/drivers/dri/tdfx/tdfx_state.c b/src/mesa/drivers/dri/tdfx/tdfx_state.c index 591df8a905..cf2712720f 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_state.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_state.c @@ -40,7 +40,6 @@ #include "main/mtypes.h" #include "main/colormac.h" -#include "main/texformat.h" #include "main/texstore.h" #include "main/teximage.h" diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tex.c b/src/mesa/drivers/dri/tdfx/tdfx_tex.c index 5e9421aa2a..0cd9051613 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_tex.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_tex.c @@ -42,7 +42,6 @@ #include "main/image.h" #include "main/mipmap.h" #include "main/texcompress.h" -#include "main/texformat.h" #include "main/teximage.h" #include "main/texstore.h" #include "main/texobj.h" diff --git a/src/mesa/drivers/dri/unichrome/via_tex.c b/src/mesa/drivers/dri/unichrome/via_tex.c index fa7542c5cb..a72dcd6be2 100644 --- a/src/mesa/drivers/dri/unichrome/via_tex.c +++ b/src/mesa/drivers/dri/unichrome/via_tex.c @@ -35,13 +35,12 @@ #include "main/convolve.h" #include "main/context.h" #include "main/mipmap.h" +#include "main/mm.h" #include "main/simple_list.h" #include "main/texcompress.h" -#include "main/texformat.h" #include "main/texobj.h" #include "main/texstore.h" -#include "main/mm.h" #include "via_context.h" #include "via_fb.h" #include "via_tex.h" -- cgit v1.2.3 From ec58dac86d3068b47c5a4e0187ef56985dcbf75c Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Mon, 5 Oct 2009 09:38:52 +0300 Subject: r600: r700PredictRenderSize can flush, so move index buffer setup after it --- src/mesa/drivers/dri/r600/r700_render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c index 0aef0b7ea1..4f39d9f1bd 100644 --- a/src/mesa/drivers/dri/r600/r700_render.c +++ b/src/mesa/drivers/dri/r600/r700_render.c @@ -960,7 +960,6 @@ static GLboolean r700TryDrawPrims(GLcontext *ctx, _tnl_UpdateFixedFunctionProgram(ctx); r700SetVertexFormat(ctx, arrays, max_index + 1); - r700SetupIndexBuffer(ctx, ib); /* shaders need to be updated before buffers are validated */ r700UpdateShaders2(ctx); if (!r600ValidateBuffers(ctx)) @@ -981,6 +980,7 @@ static GLboolean r700TryDrawPrims(GLcontext *ctx, GLuint emit_end = r700PredictRenderSize(ctx, nr_prims) + context->radeon.cmdbuf.cs->cdw; + r700SetupIndexBuffer(ctx, ib); r700SetupStreams2(ctx, arrays, max_index + 1); radeonEmitState(radeon); -- cgit v1.2.3 From 9e42f0ebc7e538e0bff7c8c8539532ff2fc3c475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= Date: Tue, 6 Oct 2009 20:07:38 +0200 Subject: r300/compiler: Fix regression in pair scheduling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicolai Hähnle --- .../dri/r300/compiler/radeon_pair_schedule.c | 28 +++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c b/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c index ea01bb7881..df67aafe02 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_pair_schedule.c @@ -179,8 +179,19 @@ static void commit_instruction(struct schedule_state * s, struct schedule_instru for(unsigned int i = 0; i < sinst->NumWriteValues; ++i) { struct reg_value * v = sinst->WriteValues[i]; - for(struct reg_value_reader * r = v->Readers; r; r = r->Next) { - decrease_dependencies(s, r->Reader); + if (v->NumReaders) { + for(struct reg_value_reader * r = v->Readers; r; r = r->Next) { + decrease_dependencies(s, r->Reader); + } + } else { + /* This happens in instruction sequences of the type + * OP r.x, ...; + * OP r.x, r.x, ...; + * See also the subtlety in how instructions that both + * read and write the same register are scanned. + */ + if (v->Next) + decrease_dependencies(s, v->Next->Writer); } } } @@ -360,6 +371,13 @@ static void scan_read(void * data, struct rc_instruction * inst, if (!v) return; + if (v->Writer == s->Current) { + /* The instruction reads and writes to a register component. + * In this case, we only want to increment dependencies by one. + */ + return; + } + DBG("%i: read %i[%i] chan %i\n", s->Current->Instruction->IP, file, index, chan); struct reg_value_reader * reader = memory_pool_malloc(&s->C->Pool, sizeof(*reader)); @@ -426,8 +444,12 @@ static void schedule_block(struct r300_fragment_program_compiler * c, DBG("%i: Scanning\n", inst->IP); - rc_for_all_reads(inst, &scan_read, &s); + /* The order of things here is subtle and maybe slightly + * counter-intuitive, to account for the case where an + * instruction writes to the same register as it reads + * from. */ rc_for_all_writes(inst, &scan_write, &s); + rc_for_all_reads(inst, &scan_read, &s); DBG("%i: Has %i dependencies\n", inst->IP, s.Current->NumDependencies); -- cgit v1.2.3 From a09bd685daa9f2eebf7c7b428dc0da4595dd6459 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= Date: Tue, 6 Oct 2009 20:24:46 +0200 Subject: r300/compiler: Fix a really stupid logic inversion in the generic dataflow code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicolai Hähnle --- src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c index 58dcb20d29..cce9166e64 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_dataflow.c @@ -44,7 +44,7 @@ static void reads_normal(struct rc_instruction * fullinst, rc_read_write_fn cb, for(unsigned int chan = 0; chan < 4; ++chan) refmask |= 1 << GET_SWZ(inst->SrcReg[src].Swizzle, chan); - refmask &= ~RC_MASK_XYZW; + refmask &= RC_MASK_XYZW; for(unsigned int chan = 0; chan < 4; ++chan) { if (GET_BIT(refmask, chan)) { -- cgit v1.2.3 From bcfba138cc7ffbf8163b29dc4a89520369a00f96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= Date: Tue, 6 Oct 2009 21:13:27 +0200 Subject: r300/compiler: Fix yet another regression in register allocation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicolai Hähnle --- src/mesa/drivers/dri/r300/compiler/radeon_pair_regalloc.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_pair_regalloc.c b/src/mesa/drivers/dri/r300/compiler/radeon_pair_regalloc.c index e39ac2f510..828d0c8e28 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_pair_regalloc.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_pair_regalloc.c @@ -177,6 +177,7 @@ static void scan_callback(void * data, struct rc_instruction * inst, reg->Live.Start = -1; else reg->Live.Start = inst->IP; + reg->Live.End = inst->IP; } else { if (inst->IP > reg->Live.End) reg->Live.End = inst->IP; -- cgit v1.2.3 From 57abb76e1095d14f54ea8b8d0d2220e209b8656f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= Date: Tue, 6 Oct 2009 21:24:44 +0200 Subject: r300/compiler: Fix R300 vertex program dumps MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The source register field has 8 bits. Signed-off-by: Nicolai Hähnle --- src/mesa/drivers/dri/r300/compiler/r3xx_vertprog_dump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog_dump.c b/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog_dump.c index 980ef3eaea..66f9b0529f 100644 --- a/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog_dump.c +++ b/src/mesa/drivers/dri/r300/compiler/r3xx_vertprog_dump.c @@ -146,7 +146,7 @@ static void r300_vs_op_dump(uint32_t op) static void r300_vs_src_dump(uint32_t src) { fprintf(stderr, " reg: %d%s swiz: %s%s/%s%s/%s%s/%s%s\n", - (src >> 5) & 0x7f, r300_vs_src_debug[src & 0x3], + (src >> 5) & 0xff, r300_vs_src_debug[src & 0x3], src & (1 << 25) ? "-" : " ", r300_vs_swiz_debug[(src >> 13) & 0x7], src & (1 << 26) ? "-" : " ", -- cgit v1.2.3 From edfd2f7c4f942ed0c1aa1238ab0684ee7dd889a2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 6 Oct 2009 18:54:13 -0600 Subject: mesa: accept more pnames in _mesa_get_format_bits() --- src/mesa/main/formats.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index d3c8b1213b..9bc0509368 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -569,23 +569,42 @@ _mesa_get_format_bits(gl_format format, GLenum pname) const struct gl_format_info *info = _mesa_get_format_info(format); switch (pname) { + case GL_RED_BITS: case GL_TEXTURE_RED_SIZE: + case GL_RENDERBUFFER_RED_SIZE_EXT: + case GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE: return info->RedBits; + case GL_GREEN_BITS: case GL_TEXTURE_GREEN_SIZE: + case GL_RENDERBUFFER_GREEN_SIZE_EXT: + case GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: return info->GreenBits; + case GL_BLUE_BITS: case GL_TEXTURE_BLUE_SIZE: + case GL_RENDERBUFFER_BLUE_SIZE_EXT: + case GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: return info->BlueBits; + case GL_ALPHA_BITS: case GL_TEXTURE_ALPHA_SIZE: + case GL_RENDERBUFFER_ALPHA_SIZE_EXT: + case GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: return info->AlphaBits; case GL_TEXTURE_INTENSITY_SIZE: return info->IntensityBits; case GL_TEXTURE_LUMINANCE_SIZE: return info->LuminanceBits; + case GL_INDEX_BITS: case GL_TEXTURE_INDEX_SIZE_EXT: return info->IndexBits; + case GL_DEPTH_BITS: case GL_TEXTURE_DEPTH_SIZE_ARB: + case GL_RENDERBUFFER_DEPTH_SIZE_EXT: + case GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: return info->DepthBits; + case GL_STENCIL_BITS: case GL_TEXTURE_STENCIL_SIZE_EXT: + case GL_RENDERBUFFER_STENCIL_SIZE_EXT: + case GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: return info->StencilBits; default: _mesa_problem(NULL, "bad pname in _mesa_get_format_bits()"); -- cgit v1.2.3 From f7b5e616e07b5caa27e91bb5733a8a849d5963f6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 6 Oct 2009 18:56:29 -0600 Subject: mesa: added _mesa_get_format_color_encoding() --- src/mesa/main/formats.c | 25 +++++++++++++++++++++++++ src/mesa/main/formats.h | 3 +++ 2 files changed, 28 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index 9bc0509368..d1d8491391 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -637,6 +637,31 @@ _mesa_is_format_compressed(gl_format format) } +/** + * Return color encoding for given format. + * \return GL_LINEAR or GL_SRGB + */ +GLenum +_mesa_get_format_color_encoding(gl_format format) +{ + /* XXX this info should be encoded in gl_format_info */ + switch (format) { + case MESA_FORMAT_SRGB8: + case MESA_FORMAT_SRGBA8: + case MESA_FORMAT_SARGB8: + case MESA_FORMAT_SL8: + case MESA_FORMAT_SLA8: + case MESA_FORMAT_SRGB_DXT1: + case MESA_FORMAT_SRGBA_DXT1: + case MESA_FORMAT_SRGBA_DXT3: + case MESA_FORMAT_SRGBA_DXT5: + return GL_SRGB; + default: + return GL_LINEAR; + } +} + + /** * Return number of bytes needed to store an image of the given size * in the given format. diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index 6aebb85f2b..fcedbe9be2 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -152,6 +152,9 @@ _mesa_get_format_base_format(gl_format format); extern GLboolean _mesa_is_format_compressed(gl_format format); +extern GLenum +_mesa_get_format_color_encoding(gl_format format); + extern GLuint _mesa_format_image_size(gl_format format, GLsizei width, GLsizei height, GLsizei depth); -- cgit v1.2.3 From c13b9a141d77845517bf7cab20cff6115c31e67d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 6 Oct 2009 19:00:09 -0600 Subject: mesa: added MESA_FORMAT_SIGNED_RGBA_16 for accum buffers --- src/mesa/main/formats.c | 9 ++++++++- src/mesa/main/formats.h | 1 + src/mesa/main/texfetch.c | 7 +++++++ src/mesa/main/texstore.c | 1 + 4 files changed, 17 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index d1d8491391..a1a8ea8835 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -540,7 +540,14 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 0, 0, 0, 0, 0, 1, 1, 4 }, - + { + MESA_FORMAT_SIGNED_RGBA_16, + GL_RGBA, + GL_SIGNED_NORMALIZED, + 16, 16, 16, 16, + 0, 0, 0, 0, 0, + 1, 1, 8 + } }; diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index fcedbe9be2..9da6d5d979 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -131,6 +131,7 @@ typedef enum MESA_FORMAT_DUDV8, MESA_FORMAT_SIGNED_RGBA8888, MESA_FORMAT_SIGNED_RGBA8888_REV, + MESA_FORMAT_SIGNED_RGBA_16, /*@}*/ MESA_FORMAT_COUNT, diff --git a/src/mesa/main/texfetch.c b/src/mesa/main/texfetch.c index fbb3170ff5..63b2eacf55 100644 --- a/src/mesa/main/texfetch.c +++ b/src/mesa/main/texfetch.c @@ -333,6 +333,13 @@ texfetch_funcs[MESA_FORMAT_COUNT] = fetch_texel_3d_signed_rgba8888_rev, store_texel_signed_rgba8888_rev }, + { + MESA_FORMAT_SIGNED_RGBA_16, + NULL, /* XXX to do */ + NULL, + NULL, + NULL + }, { MESA_FORMAT_RGBA8888, fetch_texel_1d_f_rgba8888, diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 83e349d010..7754644da9 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -3026,6 +3026,7 @@ texstore_funcs[MESA_FORMAT_COUNT] = { MESA_FORMAT_DUDV8, _mesa_texstore_dudv8 }, { MESA_FORMAT_SIGNED_RGBA8888, _mesa_texstore_signed_rgba8888 }, { MESA_FORMAT_SIGNED_RGBA8888_REV, _mesa_texstore_signed_rgba8888 }, + { MESA_FORMAT_SIGNED_RGBA_16, NULL }, }; -- cgit v1.2.3 From c5b725489243e6a94ca5e31306cdfa93619bd200 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 6 Oct 2009 19:01:43 -0600 Subject: mesa: added case for MESA_FORMAT_SIGNED_RGBA_16 --- src/mesa/main/formats.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index a1a8ea8835..483f993a75 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -879,6 +879,10 @@ _mesa_format_to_type_and_comps(gl_format format, *datatype = GL_BYTE; *comps = 4; return; + case MESA_FORMAT_SIGNED_RGBA_16: + *datatype = GL_SHORT; + *comps = 4; + return; #if FEATURE_EXT_texture_sRGB case MESA_FORMAT_SRGB8: -- cgit v1.2.3 From 74d61d03b54d72217d463c248468cdcd09320efc Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 6 Oct 2009 22:30:01 -0600 Subject: mesa: added MESA_FORMAT_XRGB8888 --- src/mesa/main/formats.c | 9 +++++++++ src/mesa/main/formats.h | 1 + src/mesa/main/texfetch.c | 7 +++++++ src/mesa/main/texfetch_tmp.h | 24 ++++++++++++++++++++++++ src/mesa/main/texstore.c | 23 +++++++++++++++++++---- 5 files changed, 60 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index 483f993a75..2924ab69cc 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -114,6 +114,14 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ 1, 1, 4 /* BlockWidth/Height,Bytes */ }, + { + MESA_FORMAT_XRGB8888, /* Name */ + GL_RGB, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, { MESA_FORMAT_RGB888, /* Name */ GL_RGB, /* BaseFormat */ @@ -799,6 +807,7 @@ _mesa_format_to_type_and_comps(gl_format format, case MESA_FORMAT_RGBA8888_REV: case MESA_FORMAT_ARGB8888: case MESA_FORMAT_ARGB8888_REV: + case MESA_FORMAT_XRGB8888: *datatype = GL_UNSIGNED_BYTE; *comps = 4; return; diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index 9da6d5d979..30915bfe4b 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -54,6 +54,7 @@ typedef enum MESA_FORMAT_RGBA8888_REV, /* AAAA AAAA BBBB BBBB GGGG GGGG RRRR RRRR */ MESA_FORMAT_ARGB8888, /* AAAA AAAA RRRR RRRR GGGG GGGG BBBB BBBB */ MESA_FORMAT_ARGB8888_REV, /* BBBB BBBB GGGG GGGG RRRR RRRR AAAA AAAA */ + MESA_FORMAT_XRGB8888, /* xxxx xxxx RRRR RRRR GGGG GGGG BBBB BBBB */ MESA_FORMAT_RGB888, /* RRRR RRRR GGGG GGGG BBBB BBBB */ MESA_FORMAT_BGR888, /* BBBB BBBB GGGG GGGG RRRR RRRR */ MESA_FORMAT_RGB565, /* RRRR RGGG GGGB BBBB */ diff --git a/src/mesa/main/texfetch.c b/src/mesa/main/texfetch.c index 63b2eacf55..c50219521b 100644 --- a/src/mesa/main/texfetch.c +++ b/src/mesa/main/texfetch.c @@ -368,6 +368,13 @@ texfetch_funcs[MESA_FORMAT_COUNT] = fetch_texel_3d_f_argb8888_rev, store_texel_argb8888_rev }, + { + MESA_FORMAT_XRGB8888, + fetch_texel_1d_f_xrgb8888, + fetch_texel_2d_f_xrgb8888, + fetch_texel_3d_f_xrgb8888, + store_texel_xrgb8888 + }, { MESA_FORMAT_RGB888, fetch_texel_1d_f_rgb888, diff --git a/src/mesa/main/texfetch_tmp.h b/src/mesa/main/texfetch_tmp.h index 43030c2985..27434946ec 100644 --- a/src/mesa/main/texfetch_tmp.h +++ b/src/mesa/main/texfetch_tmp.h @@ -535,6 +535,30 @@ static void store_texel_argb8888_rev(struct gl_texture_image *texImage, #endif +/* MESA_FORMAT_XRGB8888 ******************************************************/ + +/* Fetch texel from 1D, 2D or 3D xrgb8888 texture, return 4 GLchans */ +static void FETCH(f_xrgb8888)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff ); + texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff ); + texel[BCOMP] = UBYTE_TO_FLOAT( (s ) & 0xff ); + texel[ACOMP] = 1.0f; +} + +#if DIM == 3 +static void store_texel_xrgb8888(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + *dst = PACK_COLOR_8888(0xff, rgba[RCOMP], rgba[GCOMP], rgba[BCOMP]); +} +#endif + + /* MESA_FORMAT_RGB888 ********************************************************/ /* Fetch texel from 1D, 2D or 3D rgb888 texture, return 4 GLchans */ diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 7754644da9..604f6c462a 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -1344,12 +1344,14 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); ASSERT(dstFormat == MESA_FORMAT_ARGB8888 || - dstFormat == MESA_FORMAT_ARGB8888_REV); + dstFormat == MESA_FORMAT_ARGB8888_REV || + dstFormat == MESA_FORMAT_XRGB8888); ASSERT(texelBytes == 4); if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == MESA_FORMAT_ARGB8888 && + (dstFormat == MESA_FORMAT_ARGB8888 || + dstFormat == MESA_FORMAT_XRGB8888) && baseInternalFormat == GL_RGBA && srcFormat == GL_BGRA && ((srcType == GL_UNSIGNED_BYTE && littleEndian) || @@ -1379,7 +1381,8 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) } else if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == MESA_FORMAT_ARGB8888 && + (dstFormat == MESA_FORMAT_ARGB8888 || + dstFormat == MESA_FORMAT_XRGB8888) && srcFormat == GL_RGB && (baseInternalFormat == GL_RGBA || baseInternalFormat == GL_RGB) && @@ -1455,6 +1458,7 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) /* dstmap - how to swizzle from RGBA to dst format: */ if ((littleEndian && dstFormat == MESA_FORMAT_ARGB8888) || + (littleEndian && dstFormat == MESA_FORMAT_XRGB8888) || (!littleEndian && dstFormat == MESA_FORMAT_ARGB8888_REV)) { dstmap[3] = 3; /* alpha */ dstmap[2] = 0; /* red */ @@ -1463,7 +1467,8 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) } else { assert((littleEndian && dstFormat == MESA_FORMAT_ARGB8888_REV) || - (!littleEndian && dstFormat == MESA_FORMAT_ARGB8888)); + (!littleEndian && dstFormat == MESA_FORMAT_ARGB8888) || + (!littleEndian && dstFormat == MESA_FORMAT_XRGB8888)); dstmap[3] = 2; dstmap[2] = 1; dstmap[1] = 0; @@ -1511,6 +1516,15 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) src += 4; } } + else if (dstFormat == MESA_FORMAT_XRGB8888) { + for (col = 0; col < srcWidth; col++) { + dstUI[col] = PACK_COLOR_8888( 0xff, + CHAN_TO_UBYTE(src[RCOMP]), + CHAN_TO_UBYTE(src[GCOMP]), + CHAN_TO_UBYTE(src[BCOMP]) ); + src += 4; + } + } else { for (col = 0; col < srcWidth; col++) { dstUI[col] = PACK_COLOR_8888_REV( CHAN_TO_UBYTE(src[ACOMP]), @@ -2973,6 +2987,7 @@ texstore_funcs[MESA_FORMAT_COUNT] = { MESA_FORMAT_RGBA8888_REV, _mesa_texstore_rgba8888 }, { MESA_FORMAT_ARGB8888, _mesa_texstore_argb8888 }, { MESA_FORMAT_ARGB8888_REV, _mesa_texstore_argb8888 }, + { MESA_FORMAT_XRGB8888, _mesa_texstore_argb8888 }, { MESA_FORMAT_RGB888, _mesa_texstore_rgb888 }, { MESA_FORMAT_BGR888, _mesa_texstore_bgr888 }, { MESA_FORMAT_RGB565, _mesa_texstore_rgb565 }, -- cgit v1.2.3 From e3fff3daf031a997a1d4316e1a0e5c831573221d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 7 Oct 2009 07:45:15 -0600 Subject: mesa/xlib: return 0 for errorBase, eventBase in glXQueryExtension() A little better than leaving the values undefined, I think. See bug 24321. --- src/mesa/drivers/x11/fakeglx.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index 6449dc88b0..2bda9db87c 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -1637,12 +1637,14 @@ Fake_glXCopyContext( Display *dpy, GLXContext src, GLXContext dst, static Bool -Fake_glXQueryExtension( Display *dpy, int *errorb, int *event ) +Fake_glXQueryExtension( Display *dpy, int *errorBase, int *eventBase ) { /* Mesa's GLX isn't really an X extension but we try to act like one. */ (void) dpy; - (void) errorb; - (void) event; + if (errorBase) + *errorBase = 0; + if (eventBase) + *eventBase = 0; return True; } -- cgit v1.2.3 From 14f21c785087f86d291243400e59ebfc8721c4f6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 6 Oct 2009 19:05:23 -0600 Subject: swrast: add missing returns --- src/mesa/swrast/s_depth.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c index 26e23f02d5..a9d678d180 100644 --- a/src/mesa/swrast/s_depth.c +++ b/src/mesa/swrast/s_depth.c @@ -1211,6 +1211,7 @@ _swrast_read_depth_span_float( GLcontext *ctx, struct gl_renderbuffer *rb, if (!rb) { /* really only doing this to prevent FP exceptions later */ _mesa_bzero(depth, n * sizeof(GLfloat)); + return; } ASSERT(rb->_BaseFormat == GL_DEPTH_COMPONENT); @@ -1274,6 +1275,7 @@ _swrast_read_depth_span_uint( GLcontext *ctx, struct gl_renderbuffer *rb, if (!rb) { /* really only doing this to prevent FP exceptions later */ _mesa_bzero(depth, n * sizeof(GLfloat)); + return; } ASSERT(rb->_BaseFormat == GL_DEPTH_COMPONENT); -- cgit v1.2.3 From edbaa717b49f679572805d535ed7c77518257781 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 7 Oct 2009 08:07:53 -0600 Subject: swrast: s/GLfloat/GLuint/ in bzero() --- src/mesa/swrast/s_depth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c index a9d678d180..7086cae0c8 100644 --- a/src/mesa/swrast/s_depth.c +++ b/src/mesa/swrast/s_depth.c @@ -1274,7 +1274,7 @@ _swrast_read_depth_span_uint( GLcontext *ctx, struct gl_renderbuffer *rb, { if (!rb) { /* really only doing this to prevent FP exceptions later */ - _mesa_bzero(depth, n * sizeof(GLfloat)); + _mesa_bzero(depth, n * sizeof(GLuint)); return; } -- cgit v1.2.3 From c3eef6021a06d728aa4c8b882264f554f2d4b801 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 7 Oct 2009 09:40:22 -0600 Subject: mesa/xlib: fix glXQueryDrawable() bugs, see bug 24320 --- src/mesa/drivers/x11/fakeglx.c | 37 +++++++++++++++++++++++++------------ src/mesa/drivers/x11/xmesaP.h | 3 +++ 2 files changed, 28 insertions(+), 12 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index 2bda9db87c..525db3b7cb 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -2351,32 +2351,42 @@ Fake_glXCreatePbuffer( Display *dpy, GLXFBConfig config, break; case GLX_PRESERVED_CONTENTS: attrib++; - preserveContents = *attrib; /* ignored */ + preserveContents = *attrib; break; case GLX_LARGEST_PBUFFER: attrib++; - useLargest = *attrib; /* ignored */ + useLargest = *attrib; break; default: return 0; } } - /* not used at this time */ - (void) useLargest; - (void) preserveContents; - if (width == 0 || height == 0) return 0; + if (width > MAX_WIDTH || height > MAX_HEIGHT) { + /* If allocation would have failed and GLX_LARGEST_PBUFFER is set, + * allocate the largest possible buffer. + */ + if (useLargest) { + width = MAX_WIDTH; + height = MAX_HEIGHT; + } + } + xmbuf = XMesaCreatePBuffer( xmvis, 0, width, height); /* A GLXPbuffer handle must be an X Drawable because that's what * glXMakeCurrent takes. */ - if (xmbuf) + if (xmbuf) { + xmbuf->largestPbuffer = useLargest; + xmbuf->preservedContents = preserveContents; return (GLXPbuffer) xmbuf->frontxrb->pixmap; - else + } + else { return 0; + } } @@ -2398,6 +2408,9 @@ Fake_glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute, if (!xmbuf) return; + /* make sure buffer's dimensions are up to date */ + xmesa_check_and_update_buffer_size(NULL, xmbuf); + switch (attribute) { case GLX_WIDTH: *value = xmbuf->mesa_buffer.Width; @@ -2406,10 +2419,10 @@ Fake_glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute, *value = xmbuf->mesa_buffer.Height; break; case GLX_PRESERVED_CONTENTS: - *value = True; + *value = xmbuf->preservedContents; break; case GLX_LARGEST_PBUFFER: - *value = xmbuf->mesa_buffer.Width * xmbuf->mesa_buffer.Height; + *value = xmbuf->largestPbuffer; break; case GLX_FBCONFIG_ID: *value = xmbuf->xm_visual->visinfo->visualid; @@ -2766,10 +2779,10 @@ Fake_glXQueryGLXPbufferSGIX(Display *dpy, GLXPbufferSGIX pbuf, int attribute, un switch (attribute) { case GLX_PRESERVED_CONTENTS_SGIX: - *value = True; + *value = xmbuf->preservedContents; break; case GLX_LARGEST_PBUFFER_SGIX: - *value = xmbuf->mesa_buffer.Width * xmbuf->mesa_buffer.Height; + *value = xmbuf->largestPbuffer; break; case GLX_WIDTH_SGIX: *value = xmbuf->mesa_buffer.Width; diff --git a/src/mesa/drivers/x11/xmesaP.h b/src/mesa/drivers/x11/xmesaP.h index 25db55862e..3ffd7661e3 100644 --- a/src/mesa/drivers/x11/xmesaP.h +++ b/src/mesa/drivers/x11/xmesaP.h @@ -212,6 +212,9 @@ struct xmesa_buffer { XMesaDisplay *display; BufferType type; /* window, pixmap, pbuffer or glxwindow */ + GLboolean largestPbuffer; /**< for pbuffers */ + GLboolean preservedContents; /**< for pbuffers */ + struct xmesa_renderbuffer *frontxrb; /* front color renderbuffer */ struct xmesa_renderbuffer *backxrb; /* back color renderbuffer */ -- cgit v1.2.3 From 2ef1aae1633db98fc52f440ca33b8f2a6f153d45 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 7 Oct 2009 09:58:03 -0600 Subject: st/mesa: pass pipe_screen, not pipe_context to st_choose_format() functions These don't depend on context state, but use a screen pointer. --- src/mesa/state_tracker/st_atom_pixeltransfer.c | 3 ++- src/mesa/state_tracker/st_cb_drawpixels.c | 5 +++-- src/mesa/state_tracker/st_cb_fbo.c | 2 +- src/mesa/state_tracker/st_format.c | 12 ++++++------ src/mesa/state_tracker/st_format.h | 5 +++-- 5 files changed, 15 insertions(+), 12 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_atom_pixeltransfer.c b/src/mesa/state_tracker/st_atom_pixeltransfer.c index eff3666ca8..babfcc87b4 100644 --- a/src/mesa/state_tracker/st_atom_pixeltransfer.c +++ b/src/mesa/state_tracker/st_atom_pixeltransfer.c @@ -122,7 +122,8 @@ create_color_map_texture(GLcontext *ctx) const uint texSize = 256; /* simple, and usually perfect */ /* find an RGBA texture format */ - format = st_choose_format(pipe, GL_RGBA, PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_SAMPLER); + format = st_choose_format(pipe->screen, GL_RGBA, + PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_SAMPLER); /* create texture for color map/table */ pt = st_texture_create(ctx->st, PIPE_TEXTURE_2D, format, 0, diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 4a64472fa1..5c3413f905 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -1015,13 +1015,14 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, else { /* srcFormat can't be used as a texture format */ if (type == GL_DEPTH) { - texFormat = st_choose_format(pipe, GL_DEPTH_COMPONENT, PIPE_TEXTURE_2D, + texFormat = st_choose_format(screen, GL_DEPTH_COMPONENT, + PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_DEPTH_STENCIL); assert(texFormat != PIPE_FORMAT_NONE); /* XXX no depth texture formats??? */ } else { /* default color format */ - texFormat = st_choose_format(pipe, GL_RGBA, PIPE_TEXTURE_2D, + texFormat = st_choose_format(screen, GL_RGBA, PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_SAMPLER); assert(texFormat != PIPE_FORMAT_NONE); } diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 57a2a3db5b..864f5d3ca3 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -93,7 +93,7 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb, if (strb->format != PIPE_FORMAT_NONE) format = strb->format; else - format = st_choose_renderbuffer_format(pipe, internalFormat); + format = st_choose_renderbuffer_format(pipe->screen, internalFormat); /* init renderbuffer fields */ strb->Base.Width = width; diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index dcb90a3107..3e0db37414 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -392,10 +392,9 @@ default_depth_format(struct pipe_screen *screen, * or PIPE_TEXTURE_USAGE_SAMPLER */ enum pipe_format -st_choose_format(struct pipe_context *pipe, GLenum internalFormat, +st_choose_format(struct pipe_screen *screen, GLenum internalFormat, enum pipe_texture_target target, unsigned tex_usage) { - struct pipe_screen *screen = pipe->screen; unsigned geom_flags = 0; switch (internalFormat) { @@ -618,14 +617,15 @@ is_depth_or_stencil_format(GLenum internalFormat) * Called by FBO code to choose a PIPE_FORMAT_ for drawing surfaces. */ enum pipe_format -st_choose_renderbuffer_format(struct pipe_context *pipe, GLenum internalFormat) +st_choose_renderbuffer_format(struct pipe_screen *screen, + GLenum internalFormat) { uint usage; if (is_depth_or_stencil_format(internalFormat)) usage = PIPE_TEXTURE_USAGE_DEPTH_STENCIL; else usage = PIPE_TEXTURE_USAGE_RENDER_TARGET; - return st_choose_format(pipe, internalFormat, PIPE_TEXTURE_2D, usage); + return st_choose_format(screen, internalFormat, PIPE_TEXTURE_2D, usage); } @@ -713,8 +713,8 @@ st_ChooseTextureFormat(GLcontext *ctx, GLint internalFormat, (void) format; (void) type; - pFormat = st_choose_format(ctx->st->pipe, internalFormat, PIPE_TEXTURE_2D, - PIPE_TEXTURE_USAGE_SAMPLER); + pFormat = st_choose_format(ctx->st->pipe->screen, internalFormat, + PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_SAMPLER); if (pFormat == PIPE_FORMAT_NONE) return NULL; diff --git a/src/mesa/state_tracker/st_format.h b/src/mesa/state_tracker/st_format.h index 9d9e02fe9b..e4a788c89b 100644 --- a/src/mesa/state_tracker/st_format.h +++ b/src/mesa/state_tracker/st_format.h @@ -64,11 +64,12 @@ st_mesa_format_to_pipe_format(GLuint mesaFormat); extern enum pipe_format -st_choose_format(struct pipe_context *pipe, GLenum internalFormat, +st_choose_format(struct pipe_screen *screen, GLenum internalFormat, enum pipe_texture_target target, unsigned tex_usage); extern enum pipe_format -st_choose_renderbuffer_format(struct pipe_context *pipe, GLenum internalFormat); +st_choose_renderbuffer_format(struct pipe_screen *screen, + GLenum internalFormat); extern const struct gl_texture_format * -- cgit v1.2.3 From c0de2ed5055b951ff523c3b25eecfc82d1f307ef Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 7 Oct 2009 17:48:45 +0100 Subject: mesa/st: add missing mesa constant file name There are many different names for constants in mesa, we were missing one since the ureg rewrite. --- src/mesa/state_tracker/st_mesa_to_tgsi.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c index b0a1b529f1..70d7c4fee2 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -151,7 +151,7 @@ dst_register( struct st_translate *t, return t->address[index]; default: - assert( 0 ); + debug_assert( 0 ); return ureg_dst_undef(); } } @@ -173,8 +173,9 @@ src_register( struct st_translate *t, case PROGRAM_STATE_VAR: case PROGRAM_NAMED_PARAM: + case PROGRAM_ENV_PARAM: case PROGRAM_UNIFORM: - case PROGRAM_CONSTANT: + case PROGRAM_CONSTANT: /* ie, immediate */ return t->constants[index]; case PROGRAM_INPUT: @@ -187,7 +188,7 @@ src_register( struct st_translate *t, return ureg_src(t->address[index]); default: - assert( 0 ); + debug_assert( 0 ); return ureg_src_undef(); } } @@ -216,7 +217,7 @@ translate_texture_target( GLuint textarget, case TEXTURE_CUBE_INDEX: return TGSI_TEXTURE_CUBE; case TEXTURE_RECT_INDEX: return TGSI_TEXTURE_RECT; default: - assert( 0 ); + debug_assert( 0 ); return TGSI_TEXTURE_1D; } } @@ -386,7 +387,7 @@ static void emit_swz( struct st_translate *t, swizzle_4v( imm, add_swizzle ) ); } else { - assert(0); + debug_assert(0); } #undef IMM_ZERO @@ -539,7 +540,7 @@ translate_opcode( unsigned op ) case OPCODE_END: return TGSI_OPCODE_END; default: - assert( 0 ); + debug_assert( 0 ); return TGSI_OPCODE_NOP; } } @@ -578,7 +579,7 @@ compile_instruction( case OPCODE_ELSE: case OPCODE_ENDLOOP: case OPCODE_IF: - assert(num_dst == 0); + debug_assert(num_dst == 0); ureg_label_insn( ureg, translate_opcode( inst->Opcode ), src, num_src, @@ -761,7 +762,7 @@ st_translate_mesa_program( outputSemanticIndex[i] ); break; default: - assert(0); + debug_assert(0); return 0; } } @@ -781,7 +782,7 @@ st_translate_mesa_program( /* Declare address register. */ if (program->NumAddressRegs > 0) { - assert( program->NumAddressRegs == 1 ); + debug_assert( program->NumAddressRegs == 1 ); t->address[0] = ureg_DECL_address( ureg ); } @@ -864,7 +865,7 @@ out: if (!tokens) { debug_printf("%s: failed to translate Mesa program:\n", __FUNCTION__); _mesa_print_program(program); - assert(0); + debug_assert(0); } return tokens; -- cgit v1.2.3 From ae351599f144b9e0cb1691870dd4c305fbaab97c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= Date: Sat, 3 Oct 2009 16:18:57 +0200 Subject: prog_parameter: Document the fact that Size may be > 4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicolai Hähnle --- src/mesa/shader/prog_parameter.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/prog_parameter.h b/src/mesa/shader/prog_parameter.h index d1fcf47e61..699cb0c735 100644 --- a/src/mesa/shader/prog_parameter.h +++ b/src/mesa/shader/prog_parameter.h @@ -56,7 +56,13 @@ struct gl_program_parameter const char *Name; /**< Null-terminated string */ gl_register_file Type; /**< PROGRAM_NAMED_PARAM, CONSTANT or STATE_VAR */ GLenum DataType; /**< GL_FLOAT, GL_FLOAT_VEC2, etc */ - GLuint Size; /**< Number of components (1..4) */ + /** + * Number of components (1..4), or more. + * If the number of components is greater than 4, + * this parameter is part of a larger uniform like a GLSL matrix or array. + * The next program parameter's Size will be Size-4 of this parameter. + */ + GLuint Size; GLboolean Used; /**< Helper flag for GLSL uniform tracking */ GLboolean Initialized; /**< Has the ParameterValue[] been set? */ GLbitfield Flags; /**< Bitmask of PROG_PARAM_*_BIT */ -- cgit v1.2.3 From 9fde81bb20bbfd2f8da80749cb84d890843a7bc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolai=20H=C3=A4hnle?= Date: Sat, 3 Oct 2009 16:30:16 +0200 Subject: shader_api: Fix bounds checking of glUniform and glUniformMatrix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nicolai Hähnle Reviewed-by: Ian Romanick --- src/mesa/shader/shader_api.c | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 178b7d0dba..b282d7af60 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -1702,8 +1702,8 @@ set_program_uniform(GLcontext *ctx, struct gl_program *program, /* we'll ignore extra data below */ } else { - /* non-array: count must be one */ - if (count != 1) { + /* non-array: count must be at most one; count == 0 is handled by the loop below */ + if (count > 1) { _mesa_error(ctx, GL_INVALID_OPERATION, "glUniform(uniform is not an array)"); return; @@ -1880,20 +1880,27 @@ set_program_uniform_matrix(GLcontext *ctx, struct gl_program *program, GLboolean transpose, const GLfloat *values) { GLuint mat, row, col; - GLuint dst = index + offset, src = 0; + GLuint src = 0; + const struct gl_program_parameter * param = &program->Parameters->Parameters[index]; + const GLint slots = (param->Size + 3) / 4; + const GLint typeSize = sizeof_glsl_type(param->DataType); GLint nr, nc; /* check that the number of rows, columns is correct */ - get_matrix_dims(program->Parameters->Parameters[index].DataType, &nr, &nc); + get_matrix_dims(param->DataType, &nr, &nc); if (rows != nr || cols != nc) { _mesa_error(ctx, GL_INVALID_OPERATION, "glUniformMatrix(matrix size mismatch)"); return; } - if (index + offset > program->Parameters->Size) { - /* out of bounds! */ - return; + if (param->Size <= typeSize) { + /* non-array: count must be at most one; count == 0 is handled by the loop below */ + if (count > 1) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glUniformMatrix(uniform is not an array)"); + return; + } } /* @@ -1907,7 +1914,12 @@ set_program_uniform_matrix(GLcontext *ctx, struct gl_program *program, /* each matrix: */ for (col = 0; col < cols; col++) { - GLfloat *v = program->Parameters->ParameterValues[dst]; + GLfloat *v; + if (offset >= slots) { + /* Ignore writes beyond the end of (the used part of) an array */ + return; + } + v = program->Parameters->ParameterValues[index + offset]; for (row = 0; row < rows; row++) { if (transpose) { v[row] = values[src + row * cols + col]; @@ -1916,7 +1928,8 @@ set_program_uniform_matrix(GLcontext *ctx, struct gl_program *program, v[row] = values[src + col * rows + row]; } } - dst++; + + offset++; } src += rows * cols; /* next matrix */ -- cgit v1.2.3 From cf6209b274c83f3018c9f0855de769285325b98f Mon Sep 17 00:00:00 2001 From: Joakim Sindholt Date: Wed, 7 Oct 2009 21:02:18 +0200 Subject: r300compiler: fix scons build again --- src/mesa/drivers/dri/r300/compiler/SConscript | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/SConscript b/src/mesa/drivers/dri/r300/compiler/SConscript index 48fd65fb71..46075a8aee 100755 --- a/src/mesa/drivers/dri/r300/compiler/SConscript +++ b/src/mesa/drivers/dri/r300/compiler/SConscript @@ -12,10 +12,17 @@ r300compiler = env.ConvenienceLibrary( source = [ 'radeon_code.c', 'radeon_compiler.c', - 'radeon_nqssadce.c', 'radeon_program.c', + 'radeon_program_print.c', + 'radeon_opcodes.c', 'radeon_program_alu.c', 'radeon_program_pair.c', + 'radeon_pair_translate.c', + 'radeon_pair_schedule.c', + 'radeon_pair_regalloc.c', + 'radeon_dataflow.c', + 'radeon_dataflow_deadcode.c', + 'radeon_dataflow_swizzles.c', 'r3xx_fragprog.c', 'r300_fragprog.c', 'r300_fragprog_swizzle.c', -- cgit v1.2.3 From 7dd2c0afd68a90bb6b1f5f030c8d60bf6a562071 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 7 Oct 2009 14:07:49 -0600 Subject: mesa: don't need to free textures, VBOs, etc. in _mesa_meta_free() They're freed by the normal context deallocation code. Fixes Blender crash, bug 24185. --- src/mesa/drivers/common/meta.c | 32 ++++---------------------------- 1 file changed, 4 insertions(+), 28 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 2741a41bf3..b6c6ef70fd 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -238,34 +238,10 @@ _mesa_meta_init(GLcontext *ctx) void _mesa_meta_free(GLcontext *ctx) { - struct gl_meta_state *meta = ctx->Meta; - - if (_mesa_get_current_context()) { - /* if there's no current context, these textures, buffers, etc should - * still get freed by _mesa_free_context_data(). - */ - - _mesa_DeleteTextures(1, &meta->TempTex.TexObj); - - /* glBlitFramebuffer */ - _mesa_DeleteBuffersARB(1, & meta->Blit.VBO); - _mesa_DeleteVertexArraysAPPLE(1, &meta->Blit.ArrayObj); - _mesa_DeletePrograms(1, &meta->Blit.DepthFP); - - /* glClear */ - _mesa_DeleteBuffersARB(1, & meta->Clear.VBO); - _mesa_DeleteVertexArraysAPPLE(1, &meta->Clear.ArrayObj); - - /* glCopyPixels */ - _mesa_DeleteBuffersARB(1, & meta->CopyPix.VBO); - _mesa_DeleteVertexArraysAPPLE(1, &meta->CopyPix.ArrayObj); - - /* glDrawPixels */ - _mesa_DeleteVertexArraysAPPLE(1, &meta->DrawPix.ArrayObj); - _mesa_DeletePrograms(1, &meta->DrawPix.DepthFP); - _mesa_DeletePrograms(1, &meta->DrawPix.StencilFP); - } - + /* Note: Any textures, VBOs, etc, that we allocate should get + * freed by the normal context destruction code. But this would be + * the place to free other meta data someday. + */ _mesa_free(ctx->Meta); ctx->Meta = NULL; } -- cgit v1.2.3 From 9f002e4aaa2d7ea085cd0a3c66ff0fa533905382 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 7 Oct 2009 14:42:14 -0600 Subject: mesa/xlib: call XQueryExtension() in glXQueryExtension() See bug 24321. --- src/mesa/drivers/x11/fakeglx.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/x11/fakeglx.c b/src/mesa/drivers/x11/fakeglx.c index 525db3b7cb..5c0084f37a 100644 --- a/src/mesa/drivers/x11/fakeglx.c +++ b/src/mesa/drivers/x11/fakeglx.c @@ -1639,13 +1639,15 @@ Fake_glXCopyContext( Display *dpy, GLXContext src, GLXContext dst, static Bool Fake_glXQueryExtension( Display *dpy, int *errorBase, int *eventBase ) { + int op, ev, err; /* Mesa's GLX isn't really an X extension but we try to act like one. */ - (void) dpy; + if (!XQueryExtension(dpy, GLX_EXTENSION_NAME, &op, &ev, &err)) + ev = err = 0; if (errorBase) - *errorBase = 0; + *errorBase = err; if (eventBase) - *eventBase = 0; - return True; + *eventBase = ev; + return True; /* we're faking GLX so always return success */ } -- cgit v1.2.3 From 6e1697bee72a95f7d605e42ce60e2cb4a545106f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 7 Oct 2009 16:03:04 -0600 Subject: mesa: rename display list functions _mesa_alloc_instruction() sounded like it was related to vertex/fragment program instructions, but it wasn't. --- src/mesa/main/dlist.c | 14 +++++++------- src/mesa/main/dlist.h | 10 +++++----- src/mesa/vbo/vbo_save_api.c | 12 ++++++------ 3 files changed, 18 insertions(+), 18 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 95c1b9015b..b886bd039f 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -796,7 +796,7 @@ unpack_image(GLcontext *ctx, GLuint dimensions, * opcode). */ void * -_mesa_alloc_instruction(GLcontext *ctx, GLuint opcode, GLuint bytes) +_mesa_dlist_alloc(GLcontext *ctx, GLuint opcode, GLuint bytes) { const GLuint numNodes = 1 + (bytes + sizeof(Node) - 1) / sizeof(Node); Node *n; @@ -847,11 +847,11 @@ _mesa_alloc_instruction(GLcontext *ctx, GLuint opcode, GLuint bytes) * \return the new opcode number or -1 if error */ GLint -_mesa_alloc_opcode(GLcontext *ctx, - GLuint size, - void (*execute) (GLcontext *, void *), - void (*destroy) (GLcontext *, void *), - void (*print) (GLcontext *, void *)) +_mesa_dlist_alloc_opcode(GLcontext *ctx, + GLuint size, + void (*execute) (GLcontext *, void *), + void (*destroy) (GLcontext *, void *), + void (*print) (GLcontext *, void *)) { if (ctx->ListExt.NumOpcodes < MAX_DLIST_EXT_OPCODES) { const GLuint i = ctx->ListExt.NumOpcodes++; @@ -875,7 +875,7 @@ _mesa_alloc_opcode(GLcontext *ctx, * usable data area. */ #define ALLOC_INSTRUCTION(CTX, OPCODE, NPARAMS) \ - ((Node *)_mesa_alloc_instruction(CTX, OPCODE, (NPARAMS)*sizeof(Node)) - 1) + ((Node *)_mesa_dlist_alloc(CTX, OPCODE, (NPARAMS)*sizeof(Node)) - 1) diff --git a/src/mesa/main/dlist.h b/src/mesa/main/dlist.h index af36991d5e..589cbc5992 100644 --- a/src/mesa/main/dlist.h +++ b/src/mesa/main/dlist.h @@ -61,12 +61,12 @@ extern void GLAPIENTRY _mesa_CallLists( GLsizei n, GLenum type, const GLvoid *li extern void _mesa_compile_error( GLcontext *ctx, GLenum error, const char *s ); -extern void *_mesa_alloc_instruction(GLcontext *ctx, GLuint opcode, GLuint sz); +extern void *_mesa_dlist_alloc(GLcontext *ctx, GLuint opcode, GLuint sz); -extern GLint _mesa_alloc_opcode( GLcontext *ctx, GLuint sz, - void (*execute)( GLcontext *, void * ), - void (*destroy)( GLcontext *, void * ), - void (*print)( GLcontext *, void * ) ); +extern GLint _mesa_dlist_alloc_opcode( GLcontext *ctx, GLuint sz, + void (*execute)( GLcontext *, void * ), + void (*destroy)( GLcontext *, void * ), + void (*print)( GLcontext *, void * ) ); extern void _mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist); diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c index 4da248e2b8..3f86c68b24 100644 --- a/src/mesa/vbo/vbo_save_api.c +++ b/src/mesa/vbo/vbo_save_api.c @@ -270,7 +270,7 @@ static void _save_compile_vertex_list( GLcontext *ctx ) * being compiled. */ node = (struct vbo_save_vertex_list *) - _mesa_alloc_instruction(ctx, save->opcode_vertex_list, sizeof(*node)); + _mesa_dlist_alloc(ctx, save->opcode_vertex_list, sizeof(*node)); if (!node) return; @@ -1233,11 +1233,11 @@ void vbo_save_api_init( struct vbo_save_context *save ) GLuint i; save->opcode_vertex_list = - _mesa_alloc_opcode( ctx, - sizeof(struct vbo_save_vertex_list), - vbo_save_playback_vertex_list, - vbo_destroy_vertex_list, - vbo_print_vertex_list ); + _mesa_dlist_alloc_opcode( ctx, + sizeof(struct vbo_save_vertex_list), + vbo_save_playback_vertex_list, + vbo_destroy_vertex_list, + vbo_print_vertex_list ); ctx->Driver.NotifySaveBegin = vbo_save_NotifyBegin; -- cgit v1.2.3 From 77be195cf691bc7ba249f350e13c7ac06a78e9de Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 7 Oct 2009 16:12:26 -0600 Subject: main: replace ALLOC_INSTRUCTION macro with regular function --- src/mesa/main/dlist.c | 401 +++++++++++++++++++++++++------------------------- 1 file changed, 202 insertions(+), 199 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index b886bd039f..f76323dff5 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -869,13 +869,16 @@ _mesa_dlist_alloc_opcode(GLcontext *ctx, /** * Allocate display list instruction. Returns Node ptr to where the opcode - * is stored. - * - nParams is the number of function parameters - * - return value a pointer to sizeof(Node) before the actual - * usable data area. + * is stored. The first function parameter would go in node[1]. + * \param opcode one of OPCODE_x + * \param nparams number of function parameters */ -#define ALLOC_INSTRUCTION(CTX, OPCODE, NPARAMS) \ - ((Node *)_mesa_dlist_alloc(CTX, OPCODE, (NPARAMS)*sizeof(Node)) - 1) +static INLINE Node * +alloc_instruction(GLcontext *ctx, OpCode opcode, GLuint nparams) +{ + return (Node *) + _mesa_dlist_alloc(ctx, opcode, nparams * sizeof(Node)) - 1; +} @@ -888,7 +891,7 @@ save_Accum(GLenum op, GLfloat value) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ACCUM, 2); + n = alloc_instruction(ctx, OPCODE_ACCUM, 2); if (n) { n[1].e = op; n[2].f = value; @@ -905,7 +908,7 @@ save_AlphaFunc(GLenum func, GLclampf ref) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ALPHA_FUNC, 2); + n = alloc_instruction(ctx, OPCODE_ALPHA_FUNC, 2); if (n) { n[1].e = func; n[2].f = (GLfloat) ref; @@ -922,7 +925,7 @@ save_BindTexture(GLenum target, GLuint texture) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BIND_TEXTURE, 2); + n = alloc_instruction(ctx, OPCODE_BIND_TEXTURE, 2); if (n) { n[1].e = target; n[2].ui = texture; @@ -941,7 +944,7 @@ save_Bitmap(GLsizei width, GLsizei height, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BITMAP, 7); + n = alloc_instruction(ctx, OPCODE_BITMAP, 7); if (n) { n[1].i = (GLint) width; n[2].i = (GLint) height; @@ -964,7 +967,7 @@ save_BlendEquation(GLenum mode) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BLEND_EQUATION, 1); + n = alloc_instruction(ctx, OPCODE_BLEND_EQUATION, 1); if (n) { n[1].e = mode; } @@ -980,7 +983,7 @@ save_BlendEquationSeparateEXT(GLenum modeRGB, GLenum modeA) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BLEND_EQUATION_SEPARATE, 2); + n = alloc_instruction(ctx, OPCODE_BLEND_EQUATION_SEPARATE, 2); if (n) { n[1].e = modeRGB; n[2].e = modeA; @@ -998,7 +1001,7 @@ save_BlendFuncSeparateEXT(GLenum sfactorRGB, GLenum dfactorRGB, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BLEND_FUNC_SEPARATE, 4); + n = alloc_instruction(ctx, OPCODE_BLEND_FUNC_SEPARATE, 4); if (n) { n[1].e = sfactorRGB; n[2].e = dfactorRGB; @@ -1025,7 +1028,7 @@ save_BlendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BLEND_COLOR, 4); + n = alloc_instruction(ctx, OPCODE_BLEND_COLOR, 4); if (n) { n[1].f = red; n[2].f = green; @@ -1059,7 +1062,7 @@ save_CallList(GLuint list) Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CALL_LIST, 1); + n = alloc_instruction(ctx, OPCODE_CALL_LIST, 1); if (n) { n[1].ui = list; } @@ -1103,7 +1106,7 @@ save_CallLists(GLsizei num, GLenum type, const GLvoid * lists) for (i = 0; i < num; i++) { GLint list = translate_id(i, type, lists); - Node *n = ALLOC_INSTRUCTION(ctx, OPCODE_CALL_LIST_OFFSET, 2); + Node *n = alloc_instruction(ctx, OPCODE_CALL_LIST_OFFSET, 2); if (n) { n[1].i = list; n[2].b = typeErrorFlag; @@ -1127,7 +1130,7 @@ save_Clear(GLbitfield mask) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CLEAR, 1); + n = alloc_instruction(ctx, OPCODE_CLEAR, 1); if (n) { n[1].bf = mask; } @@ -1143,7 +1146,7 @@ save_ClearAccum(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CLEAR_ACCUM, 4); + n = alloc_instruction(ctx, OPCODE_CLEAR_ACCUM, 4); if (n) { n[1].f = red; n[2].f = green; @@ -1162,7 +1165,7 @@ save_ClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CLEAR_COLOR, 4); + n = alloc_instruction(ctx, OPCODE_CLEAR_COLOR, 4); if (n) { n[1].f = red; n[2].f = green; @@ -1181,7 +1184,7 @@ save_ClearDepth(GLclampd depth) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CLEAR_DEPTH, 1); + n = alloc_instruction(ctx, OPCODE_CLEAR_DEPTH, 1); if (n) { n[1].f = (GLfloat) depth; } @@ -1197,7 +1200,7 @@ save_ClearIndex(GLfloat c) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CLEAR_INDEX, 1); + n = alloc_instruction(ctx, OPCODE_CLEAR_INDEX, 1); if (n) { n[1].f = c; } @@ -1213,7 +1216,7 @@ save_ClearStencil(GLint s) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CLEAR_STENCIL, 1); + n = alloc_instruction(ctx, OPCODE_CLEAR_STENCIL, 1); if (n) { n[1].i = s; } @@ -1229,7 +1232,7 @@ save_ClipPlane(GLenum plane, const GLdouble * equ) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CLIP_PLANE, 5); + n = alloc_instruction(ctx, OPCODE_CLIP_PLANE, 5); if (n) { n[1].e = plane; n[2].f = (GLfloat) equ[0]; @@ -1251,7 +1254,7 @@ save_ColorMask(GLboolean red, GLboolean green, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_MASK, 4); + n = alloc_instruction(ctx, OPCODE_COLOR_MASK, 4); if (n) { n[1].b = red; n[2].b = green; @@ -1271,7 +1274,7 @@ save_ColorMaterial(GLenum face, GLenum mode) Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_MATERIAL, 2); + n = alloc_instruction(ctx, OPCODE_COLOR_MATERIAL, 2); if (n) { n[1].e = face; n[2].e = mode; @@ -1296,7 +1299,7 @@ save_ColorTable(GLenum target, GLenum internalFormat, else { Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_TABLE, 6); + n = alloc_instruction(ctx, OPCODE_COLOR_TABLE, 6); if (n) { n[1].e = target; n[2].e = internalFormat; @@ -1324,7 +1327,7 @@ save_ColorTableParameterfv(GLenum target, GLenum pname, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_TABLE_PARAMETER_FV, 6); + n = alloc_instruction(ctx, OPCODE_COLOR_TABLE_PARAMETER_FV, 6); if (n) { n[1].e = target; n[2].e = pname; @@ -1353,7 +1356,7 @@ save_ColorTableParameteriv(GLenum target, GLenum pname, const GLint *params) ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_TABLE_PARAMETER_IV, 6); + n = alloc_instruction(ctx, OPCODE_COLOR_TABLE_PARAMETER_IV, 6); if (n) { n[1].e = target; n[2].e = pname; @@ -1382,7 +1385,7 @@ save_ColorSubTable(GLenum target, GLsizei start, GLsizei count, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COLOR_SUB_TABLE, 6); + n = alloc_instruction(ctx, OPCODE_COLOR_SUB_TABLE, 6); if (n) { n[1].e = target; n[2].i = start; @@ -1407,7 +1410,7 @@ save_CopyColorSubTable(GLenum target, GLsizei start, Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_COLOR_SUB_TABLE, 5); + n = alloc_instruction(ctx, OPCODE_COPY_COLOR_SUB_TABLE, 5); if (n) { n[1].e = target; n[2].i = start; @@ -1429,7 +1432,7 @@ save_CopyColorTable(GLenum target, GLenum internalformat, Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_COLOR_TABLE, 5); + n = alloc_instruction(ctx, OPCODE_COPY_COLOR_TABLE, 5); if (n) { n[1].e = target; n[2].e = internalformat; @@ -1452,7 +1455,7 @@ save_ConvolutionFilter1D(GLenum target, GLenum internalFormat, GLsizei width, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_FILTER_1D, 6); + n = alloc_instruction(ctx, OPCODE_CONVOLUTION_FILTER_1D, 6); if (n) { n[1].e = target; n[2].e = internalFormat; @@ -1479,7 +1482,7 @@ save_ConvolutionFilter2D(GLenum target, GLenum internalFormat, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_FILTER_2D, 7); + n = alloc_instruction(ctx, OPCODE_CONVOLUTION_FILTER_2D, 7); if (n) { n[1].e = target; n[2].e = internalFormat; @@ -1504,7 +1507,7 @@ save_ConvolutionParameteri(GLenum target, GLenum pname, GLint param) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_PARAMETER_I, 3); + n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_I, 3); if (n) { n[1].e = target; n[2].e = pname; @@ -1522,7 +1525,7 @@ save_ConvolutionParameteriv(GLenum target, GLenum pname, const GLint *params) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_PARAMETER_IV, 6); + n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_IV, 6); if (n) { n[1].e = target; n[2].e = pname; @@ -1550,7 +1553,7 @@ save_ConvolutionParameterf(GLenum target, GLenum pname, GLfloat param) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_PARAMETER_F, 3); + n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_F, 3); if (n) { n[1].e = target; n[2].e = pname; @@ -1569,7 +1572,7 @@ save_ConvolutionParameterfv(GLenum target, GLenum pname, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CONVOLUTION_PARAMETER_FV, 6); + n = alloc_instruction(ctx, OPCODE_CONVOLUTION_PARAMETER_FV, 6); if (n) { n[1].e = target; n[2].e = pname; @@ -1597,7 +1600,7 @@ save_CopyPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum type) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_PIXELS, 5); + n = alloc_instruction(ctx, OPCODE_COPY_PIXELS, 5); if (n) { n[1].i = x; n[2].i = y; @@ -1619,7 +1622,7 @@ save_CopyTexImage1D(GLenum target, GLint level, GLenum internalformat, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_TEX_IMAGE1D, 7); + n = alloc_instruction(ctx, OPCODE_COPY_TEX_IMAGE1D, 7); if (n) { n[1].e = target; n[2].i = level; @@ -1645,7 +1648,7 @@ save_CopyTexImage2D(GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_TEX_IMAGE2D, 8); + n = alloc_instruction(ctx, OPCODE_COPY_TEX_IMAGE2D, 8); if (n) { n[1].e = target; n[2].i = level; @@ -1671,7 +1674,7 @@ save_CopyTexSubImage1D(GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_TEX_SUB_IMAGE1D, 6); + n = alloc_instruction(ctx, OPCODE_COPY_TEX_SUB_IMAGE1D, 6); if (n) { n[1].e = target; n[2].i = level; @@ -1695,7 +1698,7 @@ save_CopyTexSubImage2D(GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_TEX_SUB_IMAGE2D, 8); + n = alloc_instruction(ctx, OPCODE_COPY_TEX_SUB_IMAGE2D, 8); if (n) { n[1].e = target; n[2].i = level; @@ -1721,7 +1724,7 @@ save_CopyTexSubImage3D(GLenum target, GLint level, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COPY_TEX_SUB_IMAGE3D, 9); + n = alloc_instruction(ctx, OPCODE_COPY_TEX_SUB_IMAGE3D, 9); if (n) { n[1].e = target; n[2].i = level; @@ -1747,7 +1750,7 @@ save_CullFace(GLenum mode) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_CULL_FACE, 1); + n = alloc_instruction(ctx, OPCODE_CULL_FACE, 1); if (n) { n[1].e = mode; } @@ -1763,7 +1766,7 @@ save_DepthFunc(GLenum func) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_DEPTH_FUNC, 1); + n = alloc_instruction(ctx, OPCODE_DEPTH_FUNC, 1); if (n) { n[1].e = func; } @@ -1779,7 +1782,7 @@ save_DepthMask(GLboolean mask) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_DEPTH_MASK, 1); + n = alloc_instruction(ctx, OPCODE_DEPTH_MASK, 1); if (n) { n[1].b = mask; } @@ -1795,7 +1798,7 @@ save_DepthRange(GLclampd nearval, GLclampd farval) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_DEPTH_RANGE, 2); + n = alloc_instruction(ctx, OPCODE_DEPTH_RANGE, 2); if (n) { n[1].f = (GLfloat) nearval; n[2].f = (GLfloat) farval; @@ -1812,7 +1815,7 @@ save_Disable(GLenum cap) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_DISABLE, 1); + n = alloc_instruction(ctx, OPCODE_DISABLE, 1); if (n) { n[1].e = cap; } @@ -1828,7 +1831,7 @@ save_DrawBuffer(GLenum mode) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_DRAW_BUFFER, 1); + n = alloc_instruction(ctx, OPCODE_DRAW_BUFFER, 1); if (n) { n[1].e = mode; } @@ -1847,7 +1850,7 @@ save_DrawPixels(GLsizei width, GLsizei height, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_DRAW_PIXELS, 5); + n = alloc_instruction(ctx, OPCODE_DRAW_PIXELS, 5); if (n) { n[1].i = width; n[2].i = height; @@ -1869,7 +1872,7 @@ save_Enable(GLenum cap) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ENABLE, 1); + n = alloc_instruction(ctx, OPCODE_ENABLE, 1); if (n) { n[1].e = cap; } @@ -1886,7 +1889,7 @@ save_EvalMesh1(GLenum mode, GLint i1, GLint i2) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_EVALMESH1, 3); + n = alloc_instruction(ctx, OPCODE_EVALMESH1, 3); if (n) { n[1].e = mode; n[2].i = i1; @@ -1904,7 +1907,7 @@ save_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_EVALMESH2, 5); + n = alloc_instruction(ctx, OPCODE_EVALMESH2, 5); if (n) { n[1].e = mode; n[2].i = i1; @@ -1926,7 +1929,7 @@ save_Fogfv(GLenum pname, const GLfloat *params) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_FOG, 5); + n = alloc_instruction(ctx, OPCODE_FOG, 5); if (n) { n[1].e = pname; n[2].f = params[0]; @@ -1995,7 +1998,7 @@ save_FrontFace(GLenum mode) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_FRONT_FACE, 1); + n = alloc_instruction(ctx, OPCODE_FRONT_FACE, 1); if (n) { n[1].e = mode; } @@ -2012,7 +2015,7 @@ save_Frustum(GLdouble left, GLdouble right, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_FRUSTUM, 6); + n = alloc_instruction(ctx, OPCODE_FRUSTUM, 6); if (n) { n[1].f = (GLfloat) left; n[2].f = (GLfloat) right; @@ -2033,7 +2036,7 @@ save_Hint(GLenum target, GLenum mode) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_HINT, 2); + n = alloc_instruction(ctx, OPCODE_HINT, 2); if (n) { n[1].e = target; n[2].e = mode; @@ -2052,7 +2055,7 @@ save_Histogram(GLenum target, GLsizei width, GLenum internalFormat, Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_HISTOGRAM, 4); + n = alloc_instruction(ctx, OPCODE_HISTOGRAM, 4); if (n) { n[1].e = target; n[2].i = width; @@ -2071,7 +2074,7 @@ save_IndexMask(GLuint mask) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_INDEX_MASK, 1); + n = alloc_instruction(ctx, OPCODE_INDEX_MASK, 1); if (n) { n[1].ui = mask; } @@ -2086,7 +2089,7 @@ save_InitNames(void) { GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - (void) ALLOC_INSTRUCTION(ctx, OPCODE_INIT_NAMES, 0); + (void) alloc_instruction(ctx, OPCODE_INIT_NAMES, 0); if (ctx->ExecuteFlag) { CALL_InitNames(ctx->Exec, ()); } @@ -2099,7 +2102,7 @@ save_Lightfv(GLenum light, GLenum pname, const GLfloat *params) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_LIGHT, 6); + n = alloc_instruction(ctx, OPCODE_LIGHT, 6); if (n) { GLint i, nParams; n[1].e = light; @@ -2213,7 +2216,7 @@ save_LightModelfv(GLenum pname, const GLfloat *params) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_LIGHT_MODEL, 5); + n = alloc_instruction(ctx, OPCODE_LIGHT_MODEL, 5); if (n) { n[1].e = pname; n[2].f = params[0]; @@ -2280,7 +2283,7 @@ save_LineStipple(GLint factor, GLushort pattern) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_LINE_STIPPLE, 2); + n = alloc_instruction(ctx, OPCODE_LINE_STIPPLE, 2); if (n) { n[1].i = factor; n[2].us = pattern; @@ -2297,7 +2300,7 @@ save_LineWidth(GLfloat width) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_LINE_WIDTH, 1); + n = alloc_instruction(ctx, OPCODE_LINE_WIDTH, 1); if (n) { n[1].f = width; } @@ -2313,7 +2316,7 @@ save_ListBase(GLuint base) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_LIST_BASE, 1); + n = alloc_instruction(ctx, OPCODE_LIST_BASE, 1); if (n) { n[1].ui = base; } @@ -2328,7 +2331,7 @@ save_LoadIdentity(void) { GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - (void) ALLOC_INSTRUCTION(ctx, OPCODE_LOAD_IDENTITY, 0); + (void) alloc_instruction(ctx, OPCODE_LOAD_IDENTITY, 0); if (ctx->ExecuteFlag) { CALL_LoadIdentity(ctx->Exec, ()); } @@ -2341,7 +2344,7 @@ save_LoadMatrixf(const GLfloat * m) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_LOAD_MATRIX, 16); + n = alloc_instruction(ctx, OPCODE_LOAD_MATRIX, 16); if (n) { GLuint i; for (i = 0; i < 16; i++) { @@ -2372,7 +2375,7 @@ save_LoadName(GLuint name) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_LOAD_NAME, 1); + n = alloc_instruction(ctx, OPCODE_LOAD_NAME, 1); if (n) { n[1].ui = name; } @@ -2388,7 +2391,7 @@ save_LogicOp(GLenum opcode) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_LOGIC_OP, 1); + n = alloc_instruction(ctx, OPCODE_LOGIC_OP, 1); if (n) { n[1].e = opcode; } @@ -2405,7 +2408,7 @@ save_Map1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MAP1, 6); + n = alloc_instruction(ctx, OPCODE_MAP1, 6); if (n) { GLfloat *pnts = _mesa_copy_map_points1d(target, stride, order, points); n[1].e = target; @@ -2427,7 +2430,7 @@ save_Map1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MAP1, 6); + n = alloc_instruction(ctx, OPCODE_MAP1, 6); if (n) { GLfloat *pnts = _mesa_copy_map_points1f(target, stride, order, points); n[1].e = target; @@ -2452,7 +2455,7 @@ save_Map2d(GLenum target, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MAP2, 10); + n = alloc_instruction(ctx, OPCODE_MAP2, 10); if (n) { GLfloat *pnts = _mesa_copy_map_points2d(target, ustride, uorder, vstride, vorder, points); @@ -2485,7 +2488,7 @@ save_Map2f(GLenum target, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MAP2, 10); + n = alloc_instruction(ctx, OPCODE_MAP2, 10); if (n) { GLfloat *pnts = _mesa_copy_map_points2f(target, ustride, uorder, vstride, vorder, points); @@ -2514,7 +2517,7 @@ save_MapGrid1f(GLint un, GLfloat u1, GLfloat u2) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MAPGRID1, 3); + n = alloc_instruction(ctx, OPCODE_MAPGRID1, 3); if (n) { n[1].i = un; n[2].f = u1; @@ -2540,7 +2543,7 @@ save_MapGrid2f(GLint un, GLfloat u1, GLfloat u2, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MAPGRID2, 6); + n = alloc_instruction(ctx, OPCODE_MAPGRID2, 6); if (n) { n[1].i = un; n[2].f = u1; @@ -2571,7 +2574,7 @@ save_MatrixMode(GLenum mode) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MATRIX_MODE, 1); + n = alloc_instruction(ctx, OPCODE_MATRIX_MODE, 1); if (n) { n[1].e = mode; } @@ -2588,7 +2591,7 @@ save_Minmax(GLenum target, GLenum internalFormat, GLboolean sink) Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MIN_MAX, 3); + n = alloc_instruction(ctx, OPCODE_MIN_MAX, 3); if (n) { n[1].e = target; n[2].e = internalFormat; @@ -2606,7 +2609,7 @@ save_MultMatrixf(const GLfloat * m) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MULT_MATRIX, 16); + n = alloc_instruction(ctx, OPCODE_MULT_MATRIX, 16); if (n) { GLuint i; for (i = 0; i < 16; i++) { @@ -2650,7 +2653,7 @@ save_Ortho(GLdouble left, GLdouble right, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ORTHO, 6); + n = alloc_instruction(ctx, OPCODE_ORTHO, 6); if (n) { n[1].f = (GLfloat) left; n[2].f = (GLfloat) right; @@ -2671,7 +2674,7 @@ save_PixelMapfv(GLenum map, GLint mapsize, const GLfloat *values) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PIXEL_MAP, 3); + n = alloc_instruction(ctx, OPCODE_PIXEL_MAP, 3); if (n) { n[1].e = map; n[2].i = mapsize; @@ -2728,7 +2731,7 @@ save_PixelTransferf(GLenum pname, GLfloat param) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PIXEL_TRANSFER, 2); + n = alloc_instruction(ctx, OPCODE_PIXEL_TRANSFER, 2); if (n) { n[1].e = pname; n[2].f = param; @@ -2752,7 +2755,7 @@ save_PixelZoom(GLfloat xfactor, GLfloat yfactor) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PIXEL_ZOOM, 2); + n = alloc_instruction(ctx, OPCODE_PIXEL_ZOOM, 2); if (n) { n[1].f = xfactor; n[2].f = yfactor; @@ -2769,7 +2772,7 @@ save_PointParameterfvEXT(GLenum pname, const GLfloat *params) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_POINT_PARAMETERS, 4); + n = alloc_instruction(ctx, OPCODE_POINT_PARAMETERS, 4); if (n) { n[1].e = pname; n[2].f = params[0]; @@ -2816,7 +2819,7 @@ save_PointSize(GLfloat size) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_POINT_SIZE, 1); + n = alloc_instruction(ctx, OPCODE_POINT_SIZE, 1); if (n) { n[1].f = size; } @@ -2832,7 +2835,7 @@ save_PolygonMode(GLenum face, GLenum mode) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_POLYGON_MODE, 2); + n = alloc_instruction(ctx, OPCODE_POLYGON_MODE, 2); if (n) { n[1].e = face; n[2].e = mode; @@ -2851,7 +2854,7 @@ save_PolygonStipple(const GLubyte * pattern) ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_POLYGON_STIPPLE, 1); + n = alloc_instruction(ctx, OPCODE_POLYGON_STIPPLE, 1); if (n) { n[1].data = unpack_image(ctx, 2, 32, 32, 1, GL_COLOR_INDEX, GL_BITMAP, pattern, &ctx->Unpack); @@ -2868,7 +2871,7 @@ save_PolygonOffset(GLfloat factor, GLfloat units) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_POLYGON_OFFSET, 2); + n = alloc_instruction(ctx, OPCODE_POLYGON_OFFSET, 2); if (n) { n[1].f = factor; n[2].f = units; @@ -2893,7 +2896,7 @@ save_PopAttrib(void) { GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - (void) ALLOC_INSTRUCTION(ctx, OPCODE_POP_ATTRIB, 0); + (void) alloc_instruction(ctx, OPCODE_POP_ATTRIB, 0); if (ctx->ExecuteFlag) { CALL_PopAttrib(ctx->Exec, ()); } @@ -2905,7 +2908,7 @@ save_PopMatrix(void) { GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - (void) ALLOC_INSTRUCTION(ctx, OPCODE_POP_MATRIX, 0); + (void) alloc_instruction(ctx, OPCODE_POP_MATRIX, 0); if (ctx->ExecuteFlag) { CALL_PopMatrix(ctx->Exec, ()); } @@ -2917,7 +2920,7 @@ save_PopName(void) { GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - (void) ALLOC_INSTRUCTION(ctx, OPCODE_POP_NAME, 0); + (void) alloc_instruction(ctx, OPCODE_POP_NAME, 0); if (ctx->ExecuteFlag) { CALL_PopName(ctx->Exec, ()); } @@ -2934,7 +2937,7 @@ save_PrioritizeTextures(GLsizei num, const GLuint * textures, for (i = 0; i < num; i++) { Node *n; - n = ALLOC_INSTRUCTION(ctx, OPCODE_PRIORITIZE_TEXTURE, 2); + n = alloc_instruction(ctx, OPCODE_PRIORITIZE_TEXTURE, 2); if (n) { n[1].ui = textures[i]; n[2].f = priorities[i]; @@ -2952,7 +2955,7 @@ save_PushAttrib(GLbitfield mask) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PUSH_ATTRIB, 1); + n = alloc_instruction(ctx, OPCODE_PUSH_ATTRIB, 1); if (n) { n[1].bf = mask; } @@ -2967,7 +2970,7 @@ save_PushMatrix(void) { GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - (void) ALLOC_INSTRUCTION(ctx, OPCODE_PUSH_MATRIX, 0); + (void) alloc_instruction(ctx, OPCODE_PUSH_MATRIX, 0); if (ctx->ExecuteFlag) { CALL_PushMatrix(ctx->Exec, ()); } @@ -2980,7 +2983,7 @@ save_PushName(GLuint name) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PUSH_NAME, 1); + n = alloc_instruction(ctx, OPCODE_PUSH_NAME, 1); if (n) { n[1].ui = name; } @@ -2996,7 +2999,7 @@ save_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_RASTER_POS, 4); + n = alloc_instruction(ctx, OPCODE_RASTER_POS, 4); if (n) { n[1].f = x; n[2].f = y; @@ -3155,7 +3158,7 @@ save_PassThrough(GLfloat token) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PASSTHROUGH, 1); + n = alloc_instruction(ctx, OPCODE_PASSTHROUGH, 1); if (n) { n[1].f = token; } @@ -3171,7 +3174,7 @@ save_ReadBuffer(GLenum mode) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_READ_BUFFER, 1); + n = alloc_instruction(ctx, OPCODE_READ_BUFFER, 1); if (n) { n[1].e = mode; } @@ -3187,7 +3190,7 @@ save_ResetHistogram(GLenum target) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_RESET_HISTOGRAM, 1); + n = alloc_instruction(ctx, OPCODE_RESET_HISTOGRAM, 1); if (n) { n[1].e = target; } @@ -3203,7 +3206,7 @@ save_ResetMinmax(GLenum target) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_RESET_MIN_MAX, 1); + n = alloc_instruction(ctx, OPCODE_RESET_MIN_MAX, 1); if (n) { n[1].e = target; } @@ -3219,7 +3222,7 @@ save_Rotatef(GLfloat angle, GLfloat x, GLfloat y, GLfloat z) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ROTATE, 4); + n = alloc_instruction(ctx, OPCODE_ROTATE, 4); if (n) { n[1].f = angle; n[2].f = x; @@ -3245,7 +3248,7 @@ save_Scalef(GLfloat x, GLfloat y, GLfloat z) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_SCALE, 3); + n = alloc_instruction(ctx, OPCODE_SCALE, 3); if (n) { n[1].f = x; n[2].f = y; @@ -3270,7 +3273,7 @@ save_Scissor(GLint x, GLint y, GLsizei width, GLsizei height) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_SCISSOR, 4); + n = alloc_instruction(ctx, OPCODE_SCISSOR, 4); if (n) { n[1].i = x; n[2].i = y; @@ -3304,7 +3307,7 @@ save_ShadeModel(GLenum mode) if (ctx->Driver.CurrentSavePrimitive == PRIM_OUTSIDE_BEGIN_END) ctx->ListState.Current.ShadeModel = mode; - n = ALLOC_INSTRUCTION(ctx, OPCODE_SHADE_MODEL, 1); + n = alloc_instruction(ctx, OPCODE_SHADE_MODEL, 1); if (n) { n[1].e = mode; } @@ -3317,7 +3320,7 @@ save_StencilFunc(GLenum func, GLint ref, GLuint mask) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_FUNC, 3); + n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC, 3); if (n) { n[1].e = func; n[2].i = ref; @@ -3335,7 +3338,7 @@ save_StencilMask(GLuint mask) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_MASK, 1); + n = alloc_instruction(ctx, OPCODE_STENCIL_MASK, 1); if (n) { n[1].ui = mask; } @@ -3351,7 +3354,7 @@ save_StencilOp(GLenum fail, GLenum zfail, GLenum zpass) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_OP, 3); + n = alloc_instruction(ctx, OPCODE_STENCIL_OP, 3); if (n) { n[1].e = fail; n[2].e = zfail; @@ -3369,7 +3372,7 @@ save_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4); + n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4); if (n) { n[1].e = face; n[2].e = func; @@ -3390,7 +3393,7 @@ save_StencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, GLint ref, Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); /* GL_FRONT */ - n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4); + n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4); if (n) { n[1].e = GL_FRONT; n[2].e = frontfunc; @@ -3398,7 +3401,7 @@ save_StencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, GLint ref, n[4].ui = mask; } /* GL_BACK */ - n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4); + n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4); if (n) { n[1].e = GL_BACK; n[2].e = backfunc; @@ -3418,7 +3421,7 @@ save_StencilMaskSeparate(GLenum face, GLuint mask) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_MASK_SEPARATE, 2); + n = alloc_instruction(ctx, OPCODE_STENCIL_MASK_SEPARATE, 2); if (n) { n[1].e = face; n[2].ui = mask; @@ -3435,7 +3438,7 @@ save_StencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_STENCIL_OP_SEPARATE, 4); + n = alloc_instruction(ctx, OPCODE_STENCIL_OP_SEPARATE, 4); if (n) { n[1].e = face; n[2].e = fail; @@ -3454,7 +3457,7 @@ save_TexEnvfv(GLenum target, GLenum pname, const GLfloat *params) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEXENV, 6); + n = alloc_instruction(ctx, OPCODE_TEXENV, 6); if (n) { n[1].e = target; n[2].e = pname; @@ -3519,7 +3522,7 @@ save_TexGenfv(GLenum coord, GLenum pname, const GLfloat *params) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEXGEN, 6); + n = alloc_instruction(ctx, OPCODE_TEXGEN, 6); if (n) { n[1].e = coord; n[2].e = pname; @@ -3594,7 +3597,7 @@ save_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEXPARAMETER, 6); + n = alloc_instruction(ctx, OPCODE_TEXPARAMETER, 6); if (n) { n[1].e = target; n[2].e = pname; @@ -3654,7 +3657,7 @@ save_TexImage1D(GLenum target, else { Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_IMAGE1D, 8); + n = alloc_instruction(ctx, OPCODE_TEX_IMAGE1D, 8); if (n) { n[1].e = target; n[2].i = level; @@ -3689,7 +3692,7 @@ save_TexImage2D(GLenum target, else { Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_IMAGE2D, 9); + n = alloc_instruction(ctx, OPCODE_TEX_IMAGE2D, 9); if (n) { n[1].e = target; n[2].i = level; @@ -3727,7 +3730,7 @@ save_TexImage3D(GLenum target, else { Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_IMAGE3D, 10); + n = alloc_instruction(ctx, OPCODE_TEX_IMAGE3D, 10); if (n) { n[1].e = target; n[2].i = level; @@ -3760,7 +3763,7 @@ save_TexSubImage1D(GLenum target, GLint level, GLint xoffset, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_SUB_IMAGE1D, 7); + n = alloc_instruction(ctx, OPCODE_TEX_SUB_IMAGE1D, 7); if (n) { n[1].e = target; n[2].i = level; @@ -3789,7 +3792,7 @@ save_TexSubImage2D(GLenum target, GLint level, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_SUB_IMAGE2D, 9); + n = alloc_instruction(ctx, OPCODE_TEX_SUB_IMAGE2D, 9); if (n) { n[1].e = target; n[2].i = level; @@ -3820,7 +3823,7 @@ save_TexSubImage3D(GLenum target, GLint level, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_SUB_IMAGE3D, 11); + n = alloc_instruction(ctx, OPCODE_TEX_SUB_IMAGE3D, 11); if (n) { n[1].e = target; n[2].i = level; @@ -3850,7 +3853,7 @@ save_Translatef(GLfloat x, GLfloat y, GLfloat z) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TRANSLATE, 3); + n = alloc_instruction(ctx, OPCODE_TRANSLATE, 3); if (n) { n[1].f = x; n[2].f = y; @@ -3876,7 +3879,7 @@ save_Viewport(GLint x, GLint y, GLsizei width, GLsizei height) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_VIEWPORT, 4); + n = alloc_instruction(ctx, OPCODE_VIEWPORT, 4); if (n) { n[1].i = x; n[2].i = y; @@ -3895,7 +3898,7 @@ save_WindowPos4fMESA(GLfloat x, GLfloat y, GLfloat z, GLfloat w) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_WINDOW_POS, 4); + n = alloc_instruction(ctx, OPCODE_WINDOW_POS, 4); if (n) { n[1].f = x; n[2].f = y; @@ -4056,7 +4059,7 @@ save_ActiveTextureARB(GLenum target) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ACTIVE_TEXTURE, 1); + n = alloc_instruction(ctx, OPCODE_ACTIVE_TEXTURE, 1); if (n) { n[1].e = target; } @@ -4129,7 +4132,7 @@ save_CompressedTexImage1DARB(GLenum target, GLint level, return; } MEMCPY(image, data, imageSize); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_IMAGE_1D, 7); + n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_1D, 7); if (n) { n[1].e = target; n[2].i = level; @@ -4175,7 +4178,7 @@ save_CompressedTexImage2DARB(GLenum target, GLint level, return; } MEMCPY(image, data, imageSize); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_IMAGE_2D, 8); + n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_2D, 8); if (n) { n[1].e = target; n[2].i = level; @@ -4222,7 +4225,7 @@ save_CompressedTexImage3DARB(GLenum target, GLint level, return; } MEMCPY(image, data, imageSize); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_IMAGE_3D, 9); + n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_IMAGE_3D, 9); if (n) { n[1].e = target; n[2].i = level; @@ -4265,7 +4268,7 @@ save_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, return; } MEMCPY(image, data, imageSize); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D, 7); + n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D, 7); if (n) { n[1].e = target; n[2].i = level; @@ -4305,7 +4308,7 @@ save_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, return; } MEMCPY(image, data, imageSize); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D, 9); + n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D, 9); if (n) { n[1].e = target; n[2].i = level; @@ -4347,7 +4350,7 @@ save_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, return; } MEMCPY(image, data, imageSize); - n = ALLOC_INSTRUCTION(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D, 11); + n = alloc_instruction(ctx, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D, 11); if (n) { n[1].e = target; n[2].i = level; @@ -4380,7 +4383,7 @@ save_SampleCoverageARB(GLclampf value, GLboolean invert) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_SAMPLE_COVERAGE, 2); + n = alloc_instruction(ctx, OPCODE_SAMPLE_COVERAGE, 2); if (n) { n[1].f = value; n[2].b = invert; @@ -4401,7 +4404,7 @@ save_BindProgramNV(GLenum target, GLuint id) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BIND_PROGRAM_NV, 2); + n = alloc_instruction(ctx, OPCODE_BIND_PROGRAM_NV, 2); if (n) { n[1].e = target; n[2].ui = id; @@ -4418,7 +4421,7 @@ save_ProgramEnvParameter4fARB(GLenum target, GLuint index, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6); + n = alloc_instruction(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6); if (n) { n[1].e = target; n[2].ui = index; @@ -4455,7 +4458,7 @@ save_ProgramEnvParameters4fvEXT(GLenum target, GLuint index, GLsizei count, const GLfloat * p = params; for (i = 0 ; i < count ; i++) { - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6); + n = alloc_instruction(ctx, OPCODE_PROGRAM_ENV_PARAMETER_ARB, 6); if (n) { n[1].e = target; n[2].ui = index; @@ -4503,7 +4506,7 @@ save_ExecuteProgramNV(GLenum target, GLuint id, const GLfloat *params) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_EXECUTE_PROGRAM_NV, 6); + n = alloc_instruction(ctx, OPCODE_EXECUTE_PROGRAM_NV, 6); if (n) { n[1].e = target; n[2].ui = id; @@ -4549,7 +4552,7 @@ save_LoadProgramNV(GLenum target, GLuint id, GLsizei len, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_LOAD_PROGRAM_NV, 4); + n = alloc_instruction(ctx, OPCODE_LOAD_PROGRAM_NV, 4); if (n) { GLubyte *programCopy = (GLubyte *) _mesa_malloc(len); if (!programCopy) { @@ -4576,7 +4579,7 @@ save_RequestResidentProgramsNV(GLsizei num, const GLuint * ids) ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TRACK_MATRIX_NV, 2); + n = alloc_instruction(ctx, OPCODE_TRACK_MATRIX_NV, 2); if (n) { GLuint *idCopy = (GLuint *) _mesa_malloc(num * sizeof(GLuint)); if (!idCopy) { @@ -4600,7 +4603,7 @@ save_TrackMatrixNV(GLenum target, GLuint address, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_TRACK_MATRIX_NV, 4); + n = alloc_instruction(ctx, OPCODE_TRACK_MATRIX_NV, 4); if (n) { n[1].e = target; n[2].ui = address; @@ -4625,7 +4628,7 @@ save_ProgramLocalParameter4fARB(GLenum target, GLuint index, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); + n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); if (n) { n[1].e = target; n[2].ui = index; @@ -4647,7 +4650,7 @@ save_ProgramLocalParameter4fvARB(GLenum target, GLuint index, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); + n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); if (n) { n[1].e = target; n[2].ui = index; @@ -4675,7 +4678,7 @@ save_ProgramLocalParameters4fvEXT(GLenum target, GLuint index, GLsizei count, const GLfloat * p = params; for (i = 0 ; i < count ; i++) { - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); + n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); if (n) { n[1].e = target; n[2].ui = index; @@ -4702,7 +4705,7 @@ save_ProgramLocalParameter4dARB(GLenum target, GLuint index, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); + n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); if (n) { n[1].e = target; n[2].ui = index; @@ -4724,7 +4727,7 @@ save_ProgramLocalParameter4dvARB(GLenum target, GLuint index, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); + n = alloc_instruction(ctx, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB, 6); if (n) { n[1].e = target; n[2].ui = index; @@ -4747,7 +4750,7 @@ save_ProgramNamedParameter4fNV(GLuint id, GLsizei len, const GLubyte * name, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_NAMED_PARAMETER_NV, 6); + n = alloc_instruction(ctx, OPCODE_PROGRAM_NAMED_PARAMETER_NV, 6); if (n) { GLubyte *nameCopy = (GLubyte *) _mesa_malloc(len); if (!nameCopy) { @@ -4806,7 +4809,7 @@ save_ActiveStencilFaceEXT(GLenum face) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ACTIVE_STENCIL_FACE_EXT, 1); + n = alloc_instruction(ctx, OPCODE_ACTIVE_STENCIL_FACE_EXT, 1); if (n) { n[1].e = face; } @@ -4823,7 +4826,7 @@ save_DepthBoundsEXT(GLclampd zmin, GLclampd zmax) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_DEPTH_BOUNDS_EXT, 2); + n = alloc_instruction(ctx, OPCODE_DEPTH_BOUNDS_EXT, 2); if (n) { n[1].f = (GLfloat) zmin; n[2].f = (GLfloat) zmax; @@ -4846,7 +4849,7 @@ save_ProgramStringARB(GLenum target, GLenum format, GLsizei len, ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROGRAM_STRING_ARB, 4); + n = alloc_instruction(ctx, OPCODE_PROGRAM_STRING_ARB, 4); if (n) { GLubyte *programCopy = (GLubyte *) _mesa_malloc(len); if (!programCopy) { @@ -4875,7 +4878,7 @@ save_BeginQueryARB(GLenum target, GLuint id) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BEGIN_QUERY_ARB, 2); + n = alloc_instruction(ctx, OPCODE_BEGIN_QUERY_ARB, 2); if (n) { n[1].e = target; n[2].ui = id; @@ -4892,7 +4895,7 @@ save_EndQueryARB(GLenum target) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_END_QUERY_ARB, 1); + n = alloc_instruction(ctx, OPCODE_END_QUERY_ARB, 1); if (n) { n[1].e = target; } @@ -4910,7 +4913,7 @@ save_DrawBuffersARB(GLsizei count, const GLenum * buffers) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_DRAW_BUFFERS_ARB, 1 + MAX_DRAW_BUFFERS); + n = alloc_instruction(ctx, OPCODE_DRAW_BUFFERS_ARB, 1 + MAX_DRAW_BUFFERS); if (n) { GLint i; n[1].i = count; @@ -4931,7 +4934,7 @@ save_TexBumpParameterfvATI(GLenum pname, const GLfloat *param) GET_CURRENT_CONTEXT(ctx); Node *n; - n = ALLOC_INSTRUCTION(ctx, OPCODE_TEX_BUMP_PARAMETER_ATI, 5); + n = alloc_instruction(ctx, OPCODE_TEX_BUMP_PARAMETER_ATI, 5); if (n) { n[1].ui = pname; n[2].f = param[0]; @@ -4962,7 +4965,7 @@ save_BindFragmentShaderATI(GLuint id) GET_CURRENT_CONTEXT(ctx); Node *n; - n = ALLOC_INSTRUCTION(ctx, OPCODE_BIND_FRAGMENT_SHADER_ATI, 1); + n = alloc_instruction(ctx, OPCODE_BIND_FRAGMENT_SHADER_ATI, 1); if (n) { n[1].ui = id; } @@ -4977,7 +4980,7 @@ save_SetFragmentShaderConstantATI(GLuint dst, const GLfloat *value) GET_CURRENT_CONTEXT(ctx); Node *n; - n = ALLOC_INSTRUCTION(ctx, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI, 5); + n = alloc_instruction(ctx, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI, 5); if (n) { n[1].ui = dst; n[2].f = value[0]; @@ -4997,7 +5000,7 @@ save_Attr1fNV(GLenum attr, GLfloat x) GET_CURRENT_CONTEXT(ctx); Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_1F_NV, 2); + n = alloc_instruction(ctx, OPCODE_ATTR_1F_NV, 2); if (n) { n[1].e = attr; n[2].f = x; @@ -5018,7 +5021,7 @@ save_Attr2fNV(GLenum attr, GLfloat x, GLfloat y) GET_CURRENT_CONTEXT(ctx); Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_2F_NV, 3); + n = alloc_instruction(ctx, OPCODE_ATTR_2F_NV, 3); if (n) { n[1].e = attr; n[2].f = x; @@ -5040,7 +5043,7 @@ save_Attr3fNV(GLenum attr, GLfloat x, GLfloat y, GLfloat z) GET_CURRENT_CONTEXT(ctx); Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_3F_NV, 4); + n = alloc_instruction(ctx, OPCODE_ATTR_3F_NV, 4); if (n) { n[1].e = attr; n[2].f = x; @@ -5063,7 +5066,7 @@ save_Attr4fNV(GLenum attr, GLfloat x, GLfloat y, GLfloat z, GLfloat w) GET_CURRENT_CONTEXT(ctx); Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_4F_NV, 5); + n = alloc_instruction(ctx, OPCODE_ATTR_4F_NV, 5); if (n) { n[1].e = attr; n[2].f = x; @@ -5088,7 +5091,7 @@ save_Attr1fARB(GLenum attr, GLfloat x) GET_CURRENT_CONTEXT(ctx); Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_1F_ARB, 2); + n = alloc_instruction(ctx, OPCODE_ATTR_1F_ARB, 2); if (n) { n[1].e = attr; n[2].f = x; @@ -5109,7 +5112,7 @@ save_Attr2fARB(GLenum attr, GLfloat x, GLfloat y) GET_CURRENT_CONTEXT(ctx); Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_2F_ARB, 3); + n = alloc_instruction(ctx, OPCODE_ATTR_2F_ARB, 3); if (n) { n[1].e = attr; n[2].f = x; @@ -5131,7 +5134,7 @@ save_Attr3fARB(GLenum attr, GLfloat x, GLfloat y, GLfloat z) GET_CURRENT_CONTEXT(ctx); Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_3F_ARB, 4); + n = alloc_instruction(ctx, OPCODE_ATTR_3F_ARB, 4); if (n) { n[1].e = attr; n[2].f = x; @@ -5154,7 +5157,7 @@ save_Attr4fARB(GLenum attr, GLfloat x, GLfloat y, GLfloat z, GLfloat w) GET_CURRENT_CONTEXT(ctx); Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_ATTR_4F_ARB, 5); + n = alloc_instruction(ctx, OPCODE_ATTR_4F_ARB, 5); if (n) { n[1].e = attr; n[2].f = x; @@ -5179,7 +5182,7 @@ save_EvalCoord1f(GLfloat x) GET_CURRENT_CONTEXT(ctx); Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_EVAL_C1, 1); + n = alloc_instruction(ctx, OPCODE_EVAL_C1, 1); if (n) { n[1].f = x; } @@ -5200,7 +5203,7 @@ save_EvalCoord2f(GLfloat x, GLfloat y) GET_CURRENT_CONTEXT(ctx); Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_EVAL_C2, 2); + n = alloc_instruction(ctx, OPCODE_EVAL_C2, 2); if (n) { n[1].f = x; n[2].f = y; @@ -5223,7 +5226,7 @@ save_EvalPoint1(GLint x) GET_CURRENT_CONTEXT(ctx); Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_EVAL_P1, 1); + n = alloc_instruction(ctx, OPCODE_EVAL_P1, 1); if (n) { n[1].i = x; } @@ -5238,7 +5241,7 @@ save_EvalPoint2(GLint x, GLint y) GET_CURRENT_CONTEXT(ctx); Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_EVAL_P2, 2); + n = alloc_instruction(ctx, OPCODE_EVAL_P2, 2); if (n) { n[1].i = x; n[2].i = y; @@ -5341,7 +5344,7 @@ save_Materialfv(GLenum face, GLenum pname, const GLfloat * param) SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_MATERIAL, 6); + n = alloc_instruction(ctx, OPCODE_MATERIAL, 6); if (n) { n[1].e = face; n[2].e = pname; @@ -5384,7 +5387,7 @@ save_Begin(GLenum mode) return; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BEGIN, 1); + n = alloc_instruction(ctx, OPCODE_BEGIN, 1); if (n) { n[1].e = mode; } @@ -5400,7 +5403,7 @@ save_End(void) { GET_CURRENT_CONTEXT(ctx); SAVE_FLUSH_VERTICES(ctx); - (void) ALLOC_INSTRUCTION(ctx, OPCODE_END, 0); + (void) alloc_instruction(ctx, OPCODE_END, 0); ctx->Driver.CurrentSavePrimitive = PRIM_OUTSIDE_BEGIN_END; if (ctx->ExecuteFlag) { CALL_End(ctx->Exec, ()); @@ -5413,7 +5416,7 @@ save_Rectf(GLfloat a, GLfloat b, GLfloat c, GLfloat d) GET_CURRENT_CONTEXT(ctx); Node *n; SAVE_FLUSH_VERTICES(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_RECTF, 4); + n = alloc_instruction(ctx, OPCODE_RECTF, 4); if (n) { n[1].f = a; n[2].f = b; @@ -5827,7 +5830,7 @@ save_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_BLIT_FRAMEBUFFER, 10); + n = alloc_instruction(ctx, OPCODE_BLIT_FRAMEBUFFER, 10); if (n) { n[1].i = srcX0; n[2].i = srcY0; @@ -5856,7 +5859,7 @@ save_ProvokingVertexEXT(GLenum mode) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_PROVOKING_VERTEX, 1); + n = alloc_instruction(ctx, OPCODE_PROVOKING_VERTEX, 1); if (n) { n[1].e = mode; } @@ -5874,7 +5877,7 @@ save_UseProgramObjectARB(GLhandleARB program) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_USE_PROGRAM, 1); + n = alloc_instruction(ctx, OPCODE_USE_PROGRAM, 1); if (n) { n[1].ui = program; } @@ -5890,7 +5893,7 @@ save_Uniform1fARB(GLint location, GLfloat x) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_1F, 2); + n = alloc_instruction(ctx, OPCODE_UNIFORM_1F, 2); if (n) { n[1].i = location; n[2].f = x; @@ -5907,7 +5910,7 @@ save_Uniform2fARB(GLint location, GLfloat x, GLfloat y) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_2F, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_2F, 3); if (n) { n[1].i = location; n[2].f = x; @@ -5925,7 +5928,7 @@ save_Uniform3fARB(GLint location, GLfloat x, GLfloat y, GLfloat z) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_3F, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_3F, 4); if (n) { n[1].i = location; n[2].f = x; @@ -5944,7 +5947,7 @@ save_Uniform4fARB(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_4F, 5); + n = alloc_instruction(ctx, OPCODE_UNIFORM_4F, 5); if (n) { n[1].i = location; n[2].f = x; @@ -5975,7 +5978,7 @@ save_Uniform1fvARB(GLint location, GLsizei count, const GLfloat *v) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_1FV, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_1FV, 3); if (n) { n[1].i = location; n[2].i = count; @@ -5992,7 +5995,7 @@ save_Uniform2fvARB(GLint location, GLsizei count, const GLfloat *v) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_2FV, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_2FV, 3); if (n) { n[1].i = location; n[2].i = count; @@ -6009,7 +6012,7 @@ save_Uniform3fvARB(GLint location, GLsizei count, const GLfloat *v) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_3FV, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_3FV, 3); if (n) { n[1].i = location; n[2].i = count; @@ -6026,7 +6029,7 @@ save_Uniform4fvARB(GLint location, GLsizei count, const GLfloat *v) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_4FV, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_4FV, 3); if (n) { n[1].i = location; n[2].i = count; @@ -6044,7 +6047,7 @@ save_Uniform1iARB(GLint location, GLint x) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_1I, 2); + n = alloc_instruction(ctx, OPCODE_UNIFORM_1I, 2); if (n) { n[1].i = location; n[2].i = x; @@ -6060,7 +6063,7 @@ save_Uniform2iARB(GLint location, GLint x, GLint y) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_2I, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_2I, 3); if (n) { n[1].i = location; n[2].i = x; @@ -6077,7 +6080,7 @@ save_Uniform3iARB(GLint location, GLint x, GLint y, GLint z) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_3I, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_3I, 4); if (n) { n[1].i = location; n[2].i = x; @@ -6095,7 +6098,7 @@ save_Uniform4iARB(GLint location, GLint x, GLint y, GLint z, GLint w) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_4I, 5); + n = alloc_instruction(ctx, OPCODE_UNIFORM_4I, 5); if (n) { n[1].i = location; n[2].i = x; @@ -6116,7 +6119,7 @@ save_Uniform1ivARB(GLint location, GLsizei count, const GLint *v) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_1IV, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_1IV, 3); if (n) { n[1].i = location; n[2].i = count; @@ -6133,7 +6136,7 @@ save_Uniform2ivARB(GLint location, GLsizei count, const GLint *v) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_2IV, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_2IV, 3); if (n) { n[1].i = location; n[2].i = count; @@ -6150,7 +6153,7 @@ save_Uniform3ivARB(GLint location, GLsizei count, const GLint *v) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_3IV, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_3IV, 3); if (n) { n[1].i = location; n[2].i = count; @@ -6167,7 +6170,7 @@ save_Uniform4ivARB(GLint location, GLsizei count, const GLint *v) GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_4IV, 3); + n = alloc_instruction(ctx, OPCODE_UNIFORM_4IV, 3); if (n) { n[1].i = location; n[2].i = count; @@ -6186,7 +6189,7 @@ save_UniformMatrix2fvARB(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX22, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX22, 4); if (n) { n[1].i = location; n[2].i = count; @@ -6205,7 +6208,7 @@ save_UniformMatrix3fvARB(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX33, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX33, 4); if (n) { n[1].i = location; n[2].i = count; @@ -6224,7 +6227,7 @@ save_UniformMatrix4fvARB(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX44, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX44, 4); if (n) { n[1].i = location; n[2].i = count; @@ -6244,7 +6247,7 @@ save_UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX23, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX23, 4); if (n) { n[1].i = location; n[2].i = count; @@ -6263,7 +6266,7 @@ save_UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX32, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX32, 4); if (n) { n[1].i = location; n[2].i = count; @@ -6283,7 +6286,7 @@ save_UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX24, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX24, 4); if (n) { n[1].i = location; n[2].i = count; @@ -6302,7 +6305,7 @@ save_UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX42, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX42, 4); if (n) { n[1].i = location; n[2].i = count; @@ -6322,7 +6325,7 @@ save_UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX34, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX34, 4); if (n) { n[1].i = location; n[2].i = count; @@ -6341,7 +6344,7 @@ save_UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, GET_CURRENT_CONTEXT(ctx); Node *n; ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = ALLOC_INSTRUCTION(ctx, OPCODE_UNIFORM_MATRIX43, 4); + n = alloc_instruction(ctx, OPCODE_UNIFORM_MATRIX43, 4); if (n) { n[1].i = location; n[2].i = count; @@ -6365,7 +6368,7 @@ static void save_error(GLcontext *ctx, GLenum error, const char *s) { Node *n; - n = ALLOC_INSTRUCTION(ctx, OPCODE_ERROR, 2); + n = alloc_instruction(ctx, OPCODE_ERROR, 2); if (n) { n[1].e = error; n[2].data = (void *) s; @@ -7583,7 +7586,7 @@ _mesa_EndList(void) */ ctx->Driver.EndList(ctx); - (void) ALLOC_INSTRUCTION(ctx, OPCODE_END_OF_LIST, 0); + (void) alloc_instruction(ctx, OPCODE_END_OF_LIST, 0); /* Destroy old list, if any */ destroy_list(ctx, ctx->ListState.CurrentList->Name); -- cgit v1.2.3 From fc995c72982b5f971741986fea7aa63bb5fcbd81 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 7 Oct 2009 16:21:34 -0600 Subject: mesa: clean-up display list mem allocation, fix NULL handling The -1 term in alloc_instruction() foiled later NULL pointer checks. --- src/mesa/main/dlist.c | 47 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 34 insertions(+), 13 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index f76323dff5..c1890bcbc9 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -789,14 +789,13 @@ unpack_image(GLcontext *ctx, GLuint dimensions, /** - * Allocate space for a display list instruction. + * Allocate space for a display list instruction (opcode + payload space). * \param opcode the instruction opcode (OPCODE_* value) - * \param bytes instruction size in bytes, not counting opcode. - * \return pointer to the usable data area (not including the internal - * opcode). + * \param bytes instruction payload size (not counting opcode) + * \return pointer to allocated memory (the opcode space) */ -void * -_mesa_dlist_alloc(GLcontext *ctx, GLuint opcode, GLuint bytes) +static Node * +dlist_alloc(GLcontext *ctx, OpCode opcode, GLuint bytes) { const GLuint numNodes = 1 + (bytes + sizeof(Node) - 1) / sizeof(Node); Node *n; @@ -830,9 +829,30 @@ _mesa_dlist_alloc(GLcontext *ctx, GLuint opcode, GLuint bytes) n = ctx->ListState.CurrentBlock + ctx->ListState.CurrentPos; ctx->ListState.CurrentPos += numNodes; - n[0].opcode = (OpCode) opcode; + n[0].opcode = opcode; - return (void *) (n + 1); /* return ptr to node following opcode */ + return n; +} + + + +/** + * Allocate space for a display list instruction. Used by callers outside + * this file for things like VBO vertex data. + * + * \param opcode the instruction opcode (OPCODE_* value) + * \param bytes instruction size in bytes, not counting opcode. + * \return pointer to the usable data area (not including the internal + * opcode). + */ +void * +_mesa_dlist_alloc(GLcontext *ctx, GLuint opcode, GLuint bytes) +{ + Node *n = dlist_alloc(ctx, (OpCode) opcode, bytes); + if (n) + return n + 1; /* return pointer to payload area, after opcode */ + else + return NULL; } @@ -866,18 +886,19 @@ _mesa_dlist_alloc_opcode(GLcontext *ctx, } - /** - * Allocate display list instruction. Returns Node ptr to where the opcode - * is stored. The first function parameter would go in node[1]. + * Allocate space for a display list instruction. The space is basically + * an array of Nodes where node[0] holds the opcode, node[1] is the first + * function parameter, node[2] is the second parameter, etc. + * * \param opcode one of OPCODE_x * \param nparams number of function parameters + * \return pointer to start of instruction space */ static INLINE Node * alloc_instruction(GLcontext *ctx, OpCode opcode, GLuint nparams) { - return (Node *) - _mesa_dlist_alloc(ctx, opcode, nparams * sizeof(Node)) - 1; + return dlist_alloc(ctx, opcode, nparams * sizeof(Node)); } -- cgit v1.2.3 From 15f05e97aac46ffcf8a7765b0072535718833622 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 7 Oct 2009 16:32:25 -0600 Subject: mesa: added _mesa_free_display_list_data() --- src/mesa/main/context.c | 1 + src/mesa/main/dlist.c | 7 +++++++ src/mesa/main/dlist.h | 2 ++ 3 files changed, 10 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index ae91bf5f38..4d222cb0eb 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -971,6 +971,7 @@ _mesa_free_context_data( GLcontext *ctx ) _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._TexEnvProgram, NULL); _mesa_free_attrib_data(ctx); + _mesa_free_display_list_data(ctx); _mesa_free_lighting_data( ctx ); _mesa_free_eval_data( ctx ); _mesa_free_texture_data( ctx ); diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index c1890bcbc9..cec7d873d4 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -9463,3 +9463,10 @@ _mesa_init_display_list(GLcontext *ctx) _mesa_save_vtxfmt_init(&ctx->ListState.ListVtxfmt); #endif } + + +void +_mesa_free_display_list_data(GLcontext *ctx) +{ + +} diff --git a/src/mesa/main/dlist.h b/src/mesa/main/dlist.h index 589cbc5992..f37a93a7f4 100644 --- a/src/mesa/main/dlist.h +++ b/src/mesa/main/dlist.h @@ -106,5 +106,7 @@ _mesa_init_dlist_dispatch(struct _glapi_table *disp) extern void _mesa_init_display_list( GLcontext * ctx ); +extern void _mesa_free_display_list_data(GLcontext *ctx); + #endif /* DLIST_H */ -- cgit v1.2.3 From 33e9ac20e3b399c6ec6ec2f586a9402b68590992 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 7 Oct 2009 16:41:18 -0600 Subject: mesa: move gl_list_instruction and gl_list_extensions to dlist.c --- src/mesa/main/dlist.c | 68 +++++++++++++++++++++++++++++++++++++------------- src/mesa/main/mtypes.h | 26 ++----------------- 2 files changed, 52 insertions(+), 42 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index cec7d873d4..69667942f0 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -1,8 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 7.1 + * Version: 7.7 * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (C) 2009 VMware, Inc. All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -91,6 +92,33 @@ #include "glapi/dispatch.h" + +/** + * Other parts of Mesa (such as the VBO module) can plug into the display + * list system. This structure describes new display list instructions. + */ +struct gl_list_instruction +{ + GLuint Size; + void (*Execute)( GLcontext *ctx, void *data ); + void (*Destroy)( GLcontext *ctx, void *data ); + void (*Print)( GLcontext *ctx, void *data ); +}; + + +#define MAX_DLIST_EXT_OPCODES 16 + +/** + * Used by device drivers to hook new commands into display lists. + */ +struct gl_list_extensions +{ + struct gl_list_instruction Opcode[MAX_DLIST_EXT_OPCODES]; + GLuint NumOpcodes; +}; + + + /** * Flush vertices. * @@ -496,9 +524,9 @@ _mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist) /* check for extension opcodes first */ GLint i = (GLint) n[0].opcode - (GLint) OPCODE_EXT_0; - if (i >= 0 && i < (GLint) ctx->ListExt.NumOpcodes) { - ctx->ListExt.Opcode[i].Destroy(ctx, &n[1]); - n += ctx->ListExt.Opcode[i].Size; + if (i >= 0 && i < (GLint) ctx->ListExt->NumOpcodes) { + ctx->ListExt->Opcode[i].Destroy(ctx, &n[1]); + n += ctx->ListExt->Opcode[i].Size; } else { switch (n[0].opcode) { @@ -873,13 +901,13 @@ _mesa_dlist_alloc_opcode(GLcontext *ctx, void (*destroy) (GLcontext *, void *), void (*print) (GLcontext *, void *)) { - if (ctx->ListExt.NumOpcodes < MAX_DLIST_EXT_OPCODES) { - const GLuint i = ctx->ListExt.NumOpcodes++; - ctx->ListExt.Opcode[i].Size = + if (ctx->ListExt->NumOpcodes < MAX_DLIST_EXT_OPCODES) { + const GLuint i = ctx->ListExt->NumOpcodes++; + ctx->ListExt->Opcode[i].Size = 1 + (size + sizeof(Node) - 1) / sizeof(Node); - ctx->ListExt.Opcode[i].Execute = execute; - ctx->ListExt.Opcode[i].Destroy = destroy; - ctx->ListExt.Opcode[i].Print = print; + ctx->ListExt->Opcode[i].Execute = execute; + ctx->ListExt->Opcode[i].Destroy = destroy; + ctx->ListExt->Opcode[i].Print = print; return i + OPCODE_EXT_0; } return -1; @@ -6468,10 +6496,10 @@ execute_list(GLcontext *ctx, GLuint list) OpCode opcode = n[0].opcode; int i = (int) n[0].opcode - (int) OPCODE_EXT_0; - if (i >= 0 && i < (GLint) ctx->ListExt.NumOpcodes) { + if (i >= 0 && i < (GLint) ctx->ListExt->NumOpcodes) { /* this is a driver-extended opcode */ - ctx->ListExt.Opcode[i].Execute(ctx, &n[1]); - n += ctx->ListExt.Opcode[i].Size; + ctx->ListExt->Opcode[i].Execute(ctx, &n[1]); + n += ctx->ListExt->Opcode[i].Size; } else { switch (opcode) { @@ -9068,10 +9096,10 @@ print_list(GLcontext *ctx, GLuint list) OpCode opcode = n[0].opcode; GLint i = (GLint) n[0].opcode - (GLint) OPCODE_EXT_0; - if (i >= 0 && i < (GLint) ctx->ListExt.NumOpcodes) { + if (i >= 0 && i < (GLint) ctx->ListExt->NumOpcodes) { /* this is a driver-extended opcode */ - ctx->ListExt.Opcode[i].Print(ctx, &n[1]); - n += ctx->ListExt.Opcode[i].Size; + ctx->ListExt->Opcode[i].Print(ctx, &n[1]); + n += ctx->ListExt->Opcode[i].Size; } else { switch (opcode) { @@ -9449,6 +9477,9 @@ _mesa_init_display_list(GLcontext *ctx) tableInitialized = GL_TRUE; } + /* extension info */ + ctx->ListExt = CALLOC_STRUCT(gl_list_extensions); + /* Display list */ ctx->ListState.CallDepth = 0; ctx->ExecuteFlag = GL_TRUE; @@ -9468,5 +9499,6 @@ _mesa_init_display_list(GLcontext *ctx) void _mesa_free_display_list_data(GLcontext *ctx) { - + free(ctx->ListExt); + ctx->ListExt = NULL; } diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index d005064645..a1184df281 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -84,6 +84,7 @@ /*@{*/ struct _mesa_HashTable; struct gl_attrib_node; +struct gl_list_extensions; struct gl_meta_state; struct gl_pixelstore_attrib; struct gl_program_cache; @@ -819,29 +820,6 @@ struct gl_list_attrib }; -/** - * Used by device drivers to hook new commands into display lists. - */ -struct gl_list_instruction -{ - GLuint Size; - void (*Execute)( GLcontext *ctx, void *data ); - void (*Destroy)( GLcontext *ctx, void *data ); - void (*Print)( GLcontext *ctx, void *data ); -}; - -#define MAX_DLIST_EXT_OPCODES 16 - -/** - * Used by device drivers to hook new commands into display lists. - */ -struct gl_list_extensions -{ - struct gl_list_instruction Opcode[MAX_DLIST_EXT_OPCODES]; - GLuint NumOpcodes; -}; - - /** * Multisample attribute group (GL_MULTISAMPLE_BIT). */ @@ -3061,7 +3039,7 @@ struct __GLcontextRec struct gl_shine_tab *_ShineTabList; /**< MRU list of inactive shine tables */ /**@}*/ - struct gl_list_extensions ListExt; /**< driver dlist extensions */ + struct gl_list_extensions *ListExt; /**< driver dlist extensions */ /** \name For debugging/development only */ /*@{*/ -- cgit v1.2.3 From f001cc09811214f0fa9083b799ad4232f8aee836 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 7 Oct 2009 16:51:26 -0600 Subject: mesa: clean up extended opcode code --- src/mesa/main/dlist.c | 71 ++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 53 insertions(+), 18 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 69667942f0..b692c335a7 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -505,6 +505,49 @@ lookup_list(GLcontext *ctx, GLuint list) } +/** Is the given opcode an extension code? */ +static INLINE GLboolean +is_ext_opcode(OpCode opcode) +{ + return (opcode >= OPCODE_EXT_0); +} + + +/** Destroy an extended opcode instruction */ +static GLint +ext_opcode_destroy(GLcontext *ctx, Node *node) +{ + const GLint i = node[0].opcode - OPCODE_EXT_0; + GLint step; + ctx->ListExt->Opcode[i].Destroy(ctx, &node[1]); + step = ctx->ListExt->Opcode[i].Size; + return step; +} + + +/** Execute an extended opcode instruction */ +static GLint +ext_opcode_execute(GLcontext *ctx, Node *node) +{ + const GLint i = node[0].opcode - OPCODE_EXT_0; + GLint step; + ctx->ListExt->Opcode[i].Execute(ctx, &node[1]); + step = ctx->ListExt->Opcode[i].Size; + return step; +} + + +/** Print an extended opcode instruction */ +static GLint +ext_opcode_print(GLcontext *ctx, Node *node) +{ + const GLint i = node[0].opcode - OPCODE_EXT_0; + GLint step; + ctx->ListExt->Opcode[i].Print(ctx, &node[1]); + step = ctx->ListExt->Opcode[i].Size; + return step; +} + /** * Delete the named display list, but don't remove from hash table. @@ -520,16 +563,14 @@ _mesa_delete_list(GLcontext *ctx, struct gl_display_list *dlist) done = block ? GL_FALSE : GL_TRUE; while (!done) { + const OpCode opcode = n[0].opcode; /* check for extension opcodes first */ - - GLint i = (GLint) n[0].opcode - (GLint) OPCODE_EXT_0; - if (i >= 0 && i < (GLint) ctx->ListExt->NumOpcodes) { - ctx->ListExt->Opcode[i].Destroy(ctx, &n[1]); - n += ctx->ListExt->Opcode[i].Size; + if (is_ext_opcode(opcode)) { + n += ext_opcode_destroy(ctx, n); } else { - switch (n[0].opcode) { + switch (opcode) { /* for some commands, we need to free malloc'd memory */ case OPCODE_MAP1: _mesa_free(n[6].data); @@ -6493,13 +6534,10 @@ execute_list(GLcontext *ctx, GLuint list) done = GL_FALSE; while (!done) { - OpCode opcode = n[0].opcode; - int i = (int) n[0].opcode - (int) OPCODE_EXT_0; + const OpCode opcode = n[0].opcode; - if (i >= 0 && i < (GLint) ctx->ListExt->NumOpcodes) { - /* this is a driver-extended opcode */ - ctx->ListExt->Opcode[i].Execute(ctx, &n[1]); - n += ctx->ListExt->Opcode[i].Size; + if (is_ext_opcode(opcode)) { + n += ext_opcode_execute(ctx, n); } else { switch (opcode) { @@ -9093,13 +9131,10 @@ print_list(GLcontext *ctx, GLuint list) done = n ? GL_FALSE : GL_TRUE; while (!done) { - OpCode opcode = n[0].opcode; - GLint i = (GLint) n[0].opcode - (GLint) OPCODE_EXT_0; + const OpCode opcode = n[0].opcode; - if (i >= 0 && i < (GLint) ctx->ListExt->NumOpcodes) { - /* this is a driver-extended opcode */ - ctx->ListExt->Opcode[i].Print(ctx, &n[1]); - n += ctx->ListExt->Opcode[i].Size; + if (is_ext_opcode(opcode)) { + n += ext_opcode_print(ctx, n); } else { switch (opcode) { -- cgit v1.2.3 From f49d53594c8ba501c39f9a43148ce02a0ec8bfc2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 8 Oct 2009 12:50:42 -0600 Subject: mesa: free display list state after freeing shared state Fixes bug 24402. --- src/mesa/main/context.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 4d222cb0eb..95ff3495ab 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -971,7 +971,6 @@ _mesa_free_context_data( GLcontext *ctx ) _mesa_reference_fragprog(ctx, &ctx->FragmentProgram._TexEnvProgram, NULL); _mesa_free_attrib_data(ctx); - _mesa_free_display_list_data(ctx); _mesa_free_lighting_data( ctx ); _mesa_free_eval_data( ctx ); _mesa_free_texture_data( ctx ); @@ -1012,6 +1011,9 @@ _mesa_free_context_data( GLcontext *ctx ) _mesa_free_shared_state( ctx, ctx->Shared ); } + /* needs to be after freeing shared state */ + _mesa_free_display_list_data(ctx); + if (ctx->Extensions.String) _mesa_free((void *) ctx->Extensions.String); -- cgit v1.2.3 From 193dddb04e26d4e6ccefef03ce7a620606d6de5f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 1 Oct 2009 17:53:12 -0700 Subject: intel: Use new drm_intel_bo_references() to avoid flushing. --- src/mesa/drivers/dri/intel/intel_buffer_objects.c | 13 +++++++------ src/mesa/drivers/dri/intel/intel_tex_image.c | 17 +++++++++++++---- 2 files changed, 20 insertions(+), 10 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c b/src/mesa/drivers/dri/intel/intel_buffer_objects.c index a0225936c8..ea9d5a6276 100644 --- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c +++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c @@ -209,7 +209,8 @@ intel_bufferobj_subdata(GLcontext * ctx, memcpy((char *)intel_obj->sys_buffer + offset, data, size); else { /* Flush any existing batchbuffer that might reference this data. */ - intelFlush(ctx); + if (drm_intel_bo_references(intel->batch->buf, intel_obj->buffer)) + intelFlush(ctx); dri_bo_subdata(intel_obj->buffer, offset, size, data); } @@ -257,10 +258,9 @@ intel_bufferobj_map(GLcontext * ctx, return obj->Pointer; } - /* Flush any existing batchbuffer that might have written to this - * buffer. - */ - intelFlush(ctx); + /* Flush any existing batchbuffer that might reference this data. */ + if (drm_intel_bo_references(intel->batch->buf, intel_obj->buffer)) + intelFlush(ctx); if (intel_obj->region) intel_bufferobj_cow(intel, intel_obj); @@ -330,7 +330,8 @@ intel_bufferobj_map_range(GLcontext * ctx, * the batchbuffer so that GEM knows about the buffer access for later * syncing. */ - if (!(access & GL_MAP_UNSYNCHRONIZED_BIT)) + if (!(access & GL_MAP_UNSYNCHRONIZED_BIT) && + drm_intel_bo_references(intel->batch->buf, intel_obj->buffer)) intelFlush(ctx); if (intel_obj->buffer == NULL) { diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index 66201b1f46..5c915178e7 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -201,6 +201,9 @@ try_pbo_upload(struct intel_context *intel, struct intel_buffer_object *pbo = intel_buffer_object(unpack->BufferObj); GLuint src_offset, src_stride; GLuint dst_offset, dst_stride; + dri_bo *dst_buffer = intel_region_buffer(intel, + intelImage->mt->region, + INTEL_WRITE_FULL); if (!_mesa_is_bufferobj(unpack->BufferObj) || intel->ctx._ImageTransferState || @@ -223,7 +226,8 @@ try_pbo_upload(struct intel_context *intel, dst_stride = intelImage->mt->pitch; - intelFlush(&intel->ctx); + if (drm_intel_bo_references(intel->batch->buf, dst_buffer)) + intelFlush(&intel->ctx); LOCK_HARDWARE(intel); { dri_bo *src_buffer = intel_bufferobj_buffer(intel, pbo, INTEL_READ); @@ -316,8 +320,6 @@ intelTexImage(GLcontext * ctx, DBG("%s target %s level %d %dx%dx%d border %d\n", __FUNCTION__, _mesa_lookup_enum_by_nr(target), level, width, height, depth, border); - intelFlush(ctx); - intelImage->face = target_to_face(target); intelImage->level = level; @@ -478,13 +480,20 @@ intelTexImage(GLcontext * ctx, LOCK_HARDWARE(intel); if (intelImage->mt) { - if (pixels != NULL) + if (pixels != NULL) { + /* Flush any queued rendering with the texture before mapping. */ + if (drm_intel_bo_references(intel->batch->buf, + intelImage->mt->region->buffer)) { + intelFlush(ctx); + } texImage->Data = intel_miptree_image_map(intel, intelImage->mt, intelImage->face, intelImage->level, &dstRowStride, intelImage->base.ImageOffsets); + } + texImage->RowStride = dstRowStride / intelImage->mt->cpp; } else { -- cgit v1.2.3 From 9b8d2e76c395d6e1fcd09a61cd319cdc2d70c466 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 1 Oct 2009 18:16:52 -0700 Subject: i965: Use bo_references for the state cache delete function. This appears to shave about 3% off the CPU usage in cairo-gl for firefox. --- src/mesa/drivers/dri/i965/brw_state_cache.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_state_cache.c b/src/mesa/drivers/dri/i965/brw_state_cache.c index f8e46aacf7..c262e1db8b 100644 --- a/src/mesa/drivers/dri/i965/brw_state_cache.c +++ b/src/mesa/drivers/dri/i965/brw_state_cache.c @@ -534,14 +534,9 @@ brw_state_cache_bo_delete(struct brw_cache *cache, dri_bo *bo) for (i = 0; i < cache->size; i++) { for (prev = &cache->items[i]; *prev;) { struct brw_cache_item *c = *prev; - int j; - - for (j = 0; j < c->nr_reloc_bufs; j++) { - if (c->reloc_bufs[j] == bo) - break; - } - if (j != c->nr_reloc_bufs) { + if (drm_intel_bo_references(c->bo, bo)) { + int j; *prev = c->next; @@ -551,17 +546,8 @@ brw_state_cache_bo_delete(struct brw_cache *cache, dri_bo *bo) free((void *)c->key); free(c); cache->n_items--; - - /* Delete up the tree. Notably we're trying to get from - * a request to delete the surface, to deleting the surface state - * object, to deleting the binding table. We're slack and restart - * the deletion process when we do this because the other delete - * may kill our *prev. - */ - brw_state_cache_bo_delete(cache, c->bo); - prev = &cache->items[i]; } else { - prev = &(*prev)->next; + prev = &c->next; } } } -- cgit v1.2.3 From 44c6c20b69839ea130a255496f5f692186b68793 Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Fri, 9 Oct 2009 10:46:12 +0300 Subject: r600: fixup KIL instruction a bit - KILLGT takes 2 arguments - arb KIL has no dst register - add TODO about clause ending but currently piglit fp-kil passes and does not hang the card --- src/mesa/drivers/dri/r600/r700_assembler.c | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 903b6968be..fefae22ba7 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -336,7 +336,8 @@ unsigned int r700GetNumOperands(r700_AssemblerBase* pAsm) switch (pAsm->D.dst.opcode) { - case SQ_OP2_INST_ADD: + case SQ_OP2_INST_ADD: + case SQ_OP2_INST_KILLGT: case SQ_OP2_INST_MUL: case SQ_OP2_INST_MAX: case SQ_OP2_INST_MIN: @@ -356,7 +357,6 @@ unsigned int r700GetNumOperands(r700_AssemblerBase* pAsm) case SQ_OP2_INST_MOV: case SQ_OP2_INST_FRACT: case SQ_OP2_INST_FLOOR: - case SQ_OP2_INST_KILLGT: case SQ_OP2_INST_EXP_IEEE: case SQ_OP2_INST_LOG_CLAMPED: case SQ_OP2_INST_LOG_IEEE: @@ -2744,15 +2744,15 @@ GLboolean assemble_FRC(r700_AssemblerBase *pAsm) GLboolean assemble_KIL(r700_AssemblerBase *pAsm) { + /* TODO: doc says KILL has to be last(end) ALU clause */ + checkop1(pAsm); pAsm->D.dst.opcode = SQ_OP2_INST_KILLGT; - - if ( GL_FALSE == assemble_dst(pAsm) ) - { - return GL_FALSE; - } + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = 0; pAsm->D.dst.writex = 0; pAsm->D.dst.writey = 0; pAsm->D.dst.writez = 0; @@ -2765,20 +2765,11 @@ GLboolean assemble_KIL(r700_AssemblerBase *pAsm) setswizzle_PVSSRC(&(pAsm->S[0].src), SQ_SEL_0); noneg_PVSSRC(&(pAsm->S[0].src)); - pAsm->S[1].src.rtype = SRC_REG_TEMPORARY; - - if(PROGRAM_TEMPORARY == pAsm->pILInst[pAsm->uiCurInst].DstReg.File) + if ( GL_FALSE == assemble_src(pAsm, 0, 1) ) { - pAsm->S[1].src.reg = pAsm->pILInst[pAsm->uiCurInst].DstReg.Index + pAsm->starting_temp_register_number; - } - else - { //PROGRAM_OUTPUT - pAsm->S[1].src.reg = pAsm->uiFP_OutputMap[pAsm->pILInst[pAsm->uiCurInst].DstReg.Index]; + return GL_FALSE; } - setaddrmode_PVSSRC(&(pAsm->S[1].src), ADDR_ABSOLUTE); - noswizzle_PVSSRC(&(pAsm->S[1].src)); - if ( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; -- cgit v1.2.3 From 45e76d2665b38ba3787548310efc59e969124c01 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 8 Oct 2009 20:27:27 -0600 Subject: mesa: remove a bunch of gl_renderbuffer fields _ActualFormat is replaced by Format (MESA_FORMAT_x). ColorEncoding, ComponentType, RedBits, GreenBits, BlueBits, etc. are all replaced by MESA_FORMAT_x queries. --- src/mesa/drivers/dri/common/drirenderbuffer.c | 23 +- src/mesa/drivers/dri/i915/i915_texstate.c | 2 +- src/mesa/drivers/dri/intel/intel_buffers.c | 2 +- src/mesa/drivers/dri/intel/intel_context.c | 14 +- src/mesa/drivers/dri/intel/intel_fbo.c | 105 ++----- src/mesa/drivers/dri/intel/intel_span.c | 21 +- src/mesa/drivers/dri/intel/intel_tex_format.c | 2 +- src/mesa/drivers/dri/r200/r200_state_init.c | 10 +- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 10 +- .../drivers/dri/radeon/radeon_common_context.c | 14 +- src/mesa/drivers/dri/radeon/radeon_fbo.c | 102 ++---- src/mesa/drivers/dri/radeon/radeon_span.c | 20 +- src/mesa/drivers/dri/radeon/radeon_state_init.c | 10 +- src/mesa/drivers/dri/sis/sis_dd.c | 9 +- src/mesa/drivers/dri/swrast/swrast.c | 23 +- src/mesa/drivers/dri/unichrome/via_context.c | 5 + src/mesa/drivers/osmesa/osmesa.c | 19 +- src/mesa/drivers/x11/xm_buffer.c | 8 +- src/mesa/drivers/x11/xm_dd.c | 4 +- src/mesa/main/depthstencil.c | 344 +++++++++++++++------ src/mesa/main/fbobject.c | 190 ++++++------ src/mesa/main/framebuffer.c | 70 +++-- src/mesa/main/mtypes.h | 12 +- src/mesa/main/rbadaptors.c | 18 +- src/mesa/main/renderbuffer.c | 243 ++++----------- src/mesa/main/texrender.c | 17 +- src/mesa/state_tracker/st_cb_clear.c | 13 +- src/mesa/state_tracker/st_cb_fbo.c | 14 +- src/mesa/state_tracker/st_cb_texture.c | 9 +- src/mesa/state_tracker/st_format.c | 103 ++++-- src/mesa/state_tracker/st_format.h | 7 +- src/mesa/swrast/s_clear.c | 8 +- src/mesa/swrast/s_depth.c | 13 +- src/mesa/swrast/s_triangle.c | 2 +- 34 files changed, 709 insertions(+), 757 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/common/drirenderbuffer.c b/src/mesa/drivers/dri/common/drirenderbuffer.c index 15af99136c..6fa1c6caa0 100644 --- a/src/mesa/drivers/dri/common/drirenderbuffer.c +++ b/src/mesa/drivers/dri/common/drirenderbuffer.c @@ -1,5 +1,6 @@ #include "main/mtypes.h" +#include "main/formats.h" #include "main/framebuffer.h" #include "main/renderbuffer.h" #include "main/imports.h" @@ -83,47 +84,37 @@ driNewRenderbuffer(GLenum format, GLvoid *addr, if (format == GL_RGBA || format == GL_RGB5 || format == GL_RGBA8) { /* Color */ - drb->Base._BaseFormat = GL_RGBA; drb->Base.DataType = GL_UNSIGNED_BYTE; if (format == GL_RGB5) { - drb->Base.RedBits = 5; - drb->Base.GreenBits = 6; - drb->Base.BlueBits = 5; + drb->Base.Format = MESA_FORMAT_RGB565; } else { - drb->Base.RedBits = - drb->Base.GreenBits = - drb->Base.BlueBits = - drb->Base.AlphaBits = 8; + drb->Base.Format = MESA_FORMAT_ARGB8888; } } else if (format == GL_DEPTH_COMPONENT16) { /* Depth */ - drb->Base._BaseFormat = GL_DEPTH_COMPONENT; /* we always Get/Put 32-bit Z values */ drb->Base.DataType = GL_UNSIGNED_INT; - drb->Base.DepthBits = 16; + drb->Base.Format = MESA_FORMAT_Z16; } else if (format == GL_DEPTH_COMPONENT24) { /* Depth */ - drb->Base._BaseFormat = GL_DEPTH_COMPONENT; /* we always Get/Put 32-bit Z values */ drb->Base.DataType = GL_UNSIGNED_INT; - drb->Base.DepthBits = 24; + drb->Base.Format = MESA_FORMAT_Z32; } else if (format == GL_DEPTH_COMPONENT32) { /* Depth */ - drb->Base._BaseFormat = GL_DEPTH_COMPONENT; /* we always Get/Put 32-bit Z values */ drb->Base.DataType = GL_UNSIGNED_INT; - drb->Base.DepthBits = 32; + drb->Base.Format = MESA_FORMAT_Z32; } else { /* Stencil */ ASSERT(format == GL_STENCIL_INDEX8_EXT); - drb->Base._BaseFormat = GL_STENCIL_INDEX; drb->Base.DataType = GL_UNSIGNED_BYTE; - drb->Base.StencilBits = 8; + drb->Base.Format = MESA_FORMAT_S8; } /* XXX if we were allocating a user-created renderbuffer, we'd have diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index 03ed8a6311..e441e287eb 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -80,7 +80,7 @@ translate_texture_format(GLuint mesa_format, GLuint internal_format, return (MAPSURF_COMPRESSED | MT_COMPRESS_DXT2_3); case MESA_FORMAT_RGBA_DXT5: return (MAPSURF_COMPRESSED | MT_COMPRESS_DXT4_5); - case MESA_FORMAT_S8_Z24: + case MESA_FORMAT_Z24_S8: return (MAPSURF_32BIT | MT_32BIT_xI824); default: fprintf(stderr, "%s: bad image format %x\n", __FUNCTION__, mesa_format); diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c index e7357e78c5..fce227e9d9 100644 --- a/src/mesa/drivers/dri/intel/intel_buffers.c +++ b/src/mesa/drivers/dri/intel/intel_buffers.c @@ -257,7 +257,7 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb) if (fb->_StencilBuffer && fb->_StencilBuffer->Wrapped) { irbStencil = intel_renderbuffer(fb->_StencilBuffer->Wrapped); if (irbStencil && irbStencil->region) { - ASSERT(irbStencil->Base._ActualFormat == GL_DEPTH24_STENCIL8_EXT); + ASSERT(irbStencil->Base.Format == MESA_FORMAT_Z24_S8); FALLBACK(intel, INTEL_FALLBACK_STENCIL_BUFFER, GL_FALSE); } else { diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index d49d95768d..6820393e00 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -189,19 +189,7 @@ intelGetString(GLcontext * ctx, GLenum name) static unsigned intel_bits_per_pixel(const struct intel_renderbuffer *rb) { - switch (rb->Base._ActualFormat) { - case GL_RGB5: - case GL_DEPTH_COMPONENT16: - return 16; - case GL_RGB8: - case GL_RGBA8: - case GL_DEPTH_COMPONENT24: - case GL_DEPTH24_STENCIL8_EXT: - case GL_STENCIL_INDEX8_EXT: - return 32; - default: - return 0; - } + return _mesa_get_format_bytes(rb->Base.Format) * 8; } void diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 3b4b90f2dc..292cccf7f2 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -114,11 +114,8 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_R3_G3_B2: case GL_RGB4: case GL_RGB5: - rb->_ActualFormat = GL_RGB5; + rb->Format = MESA_FORMAT_RGB565; rb->DataType = GL_UNSIGNED_BYTE; - rb->RedBits = 5; - rb->GreenBits = 6; - rb->BlueBits = 5; irb->texformat = MESA_FORMAT_RGB565; cpp = 2; break; @@ -127,12 +124,8 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_RGB10: case GL_RGB12: case GL_RGB16: - rb->_ActualFormat = GL_RGB8; + rb->Format = MESA_FORMAT_ARGB8888; rb->DataType = GL_UNSIGNED_BYTE; - rb->RedBits = 8; - rb->GreenBits = 8; - rb->BlueBits = 8; - rb->AlphaBits = 0; irb->texformat = MESA_FORMAT_ARGB8888; /* XXX: Need xrgb8888 */ cpp = 4; break; @@ -144,12 +137,8 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_RGB10_A2: case GL_RGBA12: case GL_RGBA16: - rb->_ActualFormat = GL_RGBA8; + rb->Format = MESA_FORMAT_ARGB8888; rb->DataType = GL_UNSIGNED_BYTE; - rb->RedBits = 8; - rb->GreenBits = 8; - rb->BlueBits = 8; - rb->AlphaBits = 8; irb->texformat = MESA_FORMAT_ARGB8888; cpp = 4; break; @@ -159,36 +148,31 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_STENCIL_INDEX8_EXT: case GL_STENCIL_INDEX16_EXT: /* alloc a depth+stencil buffer */ - rb->_ActualFormat = GL_DEPTH24_STENCIL8_EXT; + rb->Format = MESA_FORMAT_Z24_S8; rb->DataType = GL_UNSIGNED_INT_24_8_EXT; - rb->StencilBits = 8; cpp = 4; - irb->texformat = MESA_FORMAT_S8_Z24; + irb->texformat = MESA_FORMAT_Z24_S8; break; case GL_DEPTH_COMPONENT16: - rb->_ActualFormat = GL_DEPTH_COMPONENT16; + rb->Format = MESA_FORMAT_Z16; rb->DataType = GL_UNSIGNED_SHORT; - rb->DepthBits = 16; cpp = 2; irb->texformat = MESA_FORMAT_Z16; break; case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT24: case GL_DEPTH_COMPONENT32: - rb->_ActualFormat = GL_DEPTH24_STENCIL8_EXT; + rb->Format = MESA_FORMAT_Z24_S8; rb->DataType = GL_UNSIGNED_INT_24_8_EXT; - rb->DepthBits = 24; cpp = 4; - irb->texformat = MESA_FORMAT_S8_Z24; + irb->texformat = MESA_FORMAT_Z24_S8; break; case GL_DEPTH_STENCIL_EXT: case GL_DEPTH24_STENCIL8_EXT: - rb->_ActualFormat = GL_DEPTH24_STENCIL8_EXT; + rb->Format = MESA_FORMAT_Z24_S8; rb->DataType = GL_UNSIGNED_INT_24_8_EXT; - rb->DepthBits = 24; - rb->StencilBits = 8; cpp = 4; - irb->texformat = MESA_FORMAT_S8_Z24; + irb->texformat = MESA_FORMAT_Z24_S8; break; default: _mesa_problem(ctx, @@ -196,6 +180,8 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, return GL_FALSE; } + rb->_BaseFormat = _mesa_base_fbo_format(ctx, internalFormat); + intelFlush(ctx); /* free old region */ @@ -245,7 +231,7 @@ intel_alloc_window_storage(GLcontext * ctx, struct gl_renderbuffer *rb, ASSERT(rb->Name == 0); rb->Width = width; rb->Height = height; - rb->_ActualFormat = internalFormat; + rb->InternalFormat = internalFormat; return GL_TRUE; } @@ -324,62 +310,46 @@ intel_create_renderbuffer(GLenum intFormat) switch (intFormat) { case GL_RGB5: - irb->Base._ActualFormat = GL_RGB5; - irb->Base._BaseFormat = GL_RGBA; - irb->Base.RedBits = 5; - irb->Base.GreenBits = 6; - irb->Base.BlueBits = 5; + irb->Base.Format = MESA_FORMAT_RGB565; + irb->Base._BaseFormat = GL_RGB; irb->Base.DataType = GL_UNSIGNED_BYTE; irb->texformat = MESA_FORMAT_RGB565; break; case GL_RGB8: - irb->Base._ActualFormat = GL_RGB8; + irb->Base.Format = MESA_FORMAT_ARGB8888; /* XXX: NEED XRGB8888 */ irb->Base._BaseFormat = GL_RGB; - irb->Base.RedBits = 8; - irb->Base.GreenBits = 8; - irb->Base.BlueBits = 8; - irb->Base.AlphaBits = 0; irb->Base.DataType = GL_UNSIGNED_BYTE; irb->texformat = MESA_FORMAT_ARGB8888; /* XXX: NEED XRGB8888 */ break; case GL_RGBA8: - irb->Base._ActualFormat = GL_RGBA8; + irb->Base.Format = MESA_FORMAT_ARGB8888; irb->Base._BaseFormat = GL_RGBA; - irb->Base.RedBits = 8; - irb->Base.GreenBits = 8; - irb->Base.BlueBits = 8; - irb->Base.AlphaBits = 8; irb->Base.DataType = GL_UNSIGNED_BYTE; irb->texformat = MESA_FORMAT_ARGB8888; break; case GL_STENCIL_INDEX8_EXT: - irb->Base._ActualFormat = GL_STENCIL_INDEX8_EXT; + irb->Base.Format = MESA_FORMAT_Z24_S8; irb->Base._BaseFormat = GL_STENCIL_INDEX; - irb->Base.StencilBits = 8; irb->Base.DataType = GL_UNSIGNED_BYTE; - irb->texformat = MESA_FORMAT_S8_Z24; + irb->texformat = MESA_FORMAT_Z24_S8; break; case GL_DEPTH_COMPONENT16: - irb->Base._ActualFormat = GL_DEPTH_COMPONENT16; + irb->Base.Format = MESA_FORMAT_Z16; irb->Base._BaseFormat = GL_DEPTH_COMPONENT; - irb->Base.DepthBits = 16; irb->Base.DataType = GL_UNSIGNED_SHORT; irb->texformat = MESA_FORMAT_Z16; break; case GL_DEPTH_COMPONENT24: - irb->Base._ActualFormat = GL_DEPTH24_STENCIL8_EXT; + irb->Base.Format = MESA_FORMAT_Z24_S8; irb->Base._BaseFormat = GL_DEPTH_COMPONENT; - irb->Base.DepthBits = 24; irb->Base.DataType = GL_UNSIGNED_INT; - irb->texformat = MESA_FORMAT_S8_Z24; + irb->texformat = MESA_FORMAT_Z24_S8; break; case GL_DEPTH24_STENCIL8_EXT: - irb->Base._ActualFormat = GL_DEPTH24_STENCIL8_EXT; - irb->Base._BaseFormat = GL_DEPTH_STENCIL_EXT; - irb->Base.DepthBits = 24; - irb->Base.StencilBits = 8; + irb->Base.Format = MESA_FORMAT_Z24_S8; + irb->Base._BaseFormat = GL_DEPTH_STENCIL; irb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT; - irb->texformat = MESA_FORMAT_S8_Z24; + irb->texformat = MESA_FORMAT_Z24_S8; break; default: _mesa_problem(NULL, @@ -468,38 +438,26 @@ intel_update_wrapper(GLcontext *ctx, struct intel_renderbuffer *irb, gl_format texFormat; if (texImage->TexFormat == MESA_FORMAT_ARGB8888) { - irb->Base._ActualFormat = GL_RGBA8; - irb->Base._BaseFormat = GL_RGBA; irb->Base.DataType = GL_UNSIGNED_BYTE; DBG("Render to RGBA8 texture OK\n"); } else if (texImage->TexFormat == MESA_FORMAT_RGB565) { - irb->Base._ActualFormat = GL_RGB5; - irb->Base._BaseFormat = GL_RGB; irb->Base.DataType = GL_UNSIGNED_BYTE; DBG("Render to RGB5 texture OK\n"); } else if (texImage->TexFormat == MESA_FORMAT_ARGB1555) { - irb->Base._ActualFormat = GL_RGB5_A1; - irb->Base._BaseFormat = GL_RGBA; irb->Base.DataType = GL_UNSIGNED_BYTE; DBG("Render to ARGB1555 texture OK\n"); } else if (texImage->TexFormat == MESA_FORMAT_ARGB4444) { - irb->Base._ActualFormat = GL_RGBA4; - irb->Base._BaseFormat = GL_RGBA; irb->Base.DataType = GL_UNSIGNED_BYTE; DBG("Render to ARGB4444 texture OK\n"); } else if (texImage->TexFormat == MESA_FORMAT_Z16) { - irb->Base._ActualFormat = GL_DEPTH_COMPONENT16; - irb->Base._BaseFormat = GL_DEPTH_COMPONENT; irb->Base.DataType = GL_UNSIGNED_SHORT; DBG("Render to DEPTH16 texture OK\n"); } - else if (texImage->TexFormat == MESA_FORMAT_S8_Z24) { - irb->Base._ActualFormat = GL_DEPTH24_STENCIL8_EXT; - irb->Base._BaseFormat = GL_DEPTH_STENCIL_EXT; + else if (texImage->TexFormat == MESA_FORMAT_Z24_S8) { irb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT; DBG("Render to DEPTH_STENCIL texture OK\n"); } @@ -508,17 +466,14 @@ intel_update_wrapper(GLcontext *ctx, struct intel_renderbuffer *irb, return GL_FALSE; } + irb->Base.Format = texImage->TexFormat; + texFormat = texImage->TexFormat; - irb->Base.InternalFormat = irb->Base._ActualFormat; + irb->Base.InternalFormat = texImage->InternalFormat; + irb->Base._BaseFormat = _mesa_base_fbo_format(ctx, irb->Base.InternalFormat); irb->Base.Width = texImage->Width; irb->Base.Height = texImage->Height; - irb->Base.RedBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_RED_SIZE); - irb->Base.GreenBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_GREEN_SIZE); - irb->Base.BlueBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_BLUE_SIZE); - irb->Base.AlphaBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_ALPHA_SIZE); - irb->Base.DepthBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_DEPTH_SIZE_ARB); - irb->Base.StencilBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_STENCIL_SIZE_EXT); irb->Base.Delete = intel_delete_renderbuffer; irb->Base.AllocStorage = intel_nop_alloc_storage; diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index 5bbcce6fe4..540ebca15c 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -621,7 +621,7 @@ intel_set_span_functions(struct intel_context *intel, } break; case MESA_FORMAT_ARGB8888: - if (rb->AlphaBits == 0) { /* XXX: Need xRGB8888 Mesa format */ + if (0 /*rb->AlphaBits == 0*/) { /* XXX: Need xRGB8888 Mesa format */ /* 8888 RGBx */ switch (tiling) { case I915_TILING_NONE: @@ -665,26 +665,13 @@ intel_set_span_functions(struct intel_context *intel, break; } break; - case MESA_FORMAT_S8_Z24: + case MESA_FORMAT_Z24_S8: /* There are a few different ways SW asks us to access the S8Z24 data: * Z24 depth-only depth reads * S8Z24 depth reads * S8Z24 stencil reads. */ - if (rb->_ActualFormat == GL_DEPTH_COMPONENT24) { - switch (tiling) { - case I915_TILING_NONE: - default: - intelInitDepthPointers_z24(rb); - break; - case I915_TILING_X: - intel_XTile_InitDepthPointers_z24(rb); - break; - case I915_TILING_Y: - intel_YTile_InitDepthPointers_z24(rb); - break; - } - } else if (rb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT) { + if (rb->Format == MESA_FORMAT_Z24_S8) { switch (tiling) { case I915_TILING_NONE: default: @@ -697,7 +684,7 @@ intel_set_span_functions(struct intel_context *intel, intel_YTile_InitDepthPointers_z24_s8(rb); break; } - } else if (rb->_ActualFormat == GL_STENCIL_INDEX8_EXT) { + } else if (rb->Format == MESA_FORMAT_S8) { switch (tiling) { case I915_TILING_NONE: default: diff --git a/src/mesa/drivers/dri/intel/intel_tex_format.c b/src/mesa/drivers/dri/intel/intel_tex_format.c index eca0f6d572..a71590d3ef 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_format.c +++ b/src/mesa/drivers/dri/intel/intel_tex_format.c @@ -153,7 +153,7 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat, #endif case GL_DEPTH_STENCIL_EXT: case GL_DEPTH24_STENCIL8_EXT: - return MESA_FORMAT_S8_Z24; + return MESA_FORMAT_Z24_S8; #ifndef I915 case GL_SRGB_EXT: diff --git a/src/mesa/drivers/dri/r200/r200_state_init.c b/src/mesa/drivers/dri/r200/r200_state_init.c index 7697306d88..68bfeea701 100644 --- a/src/mesa/drivers/dri/r200/r200_state_init.c +++ b/src/mesa/drivers/dri/r200/r200_state_init.c @@ -529,16 +529,18 @@ static void ctx_emit_cs(GLcontext *ctx, struct radeon_state_atom *atom) atom->cmd[CTX_RB3D_CNTL] &= ~(0xf << 10); if (rrb->cpp == 4) atom->cmd[CTX_RB3D_CNTL] |= RADEON_COLOR_FORMAT_ARGB8888; - else switch (rrb->base._ActualFormat) { - case GL_RGB5: + else switch (rrb->base.Format) { + case MESA_FORMAT_RGB565: atom->cmd[CTX_RB3D_CNTL] |= RADEON_COLOR_FORMAT_RGB565; break; - case GL_RGBA4: + case MESA_FORMAT_ARGB4444: atom->cmd[CTX_RB3D_CNTL] |= RADEON_COLOR_FORMAT_ARGB4444; break; - case GL_RGB5_A1: + case MESA_FORMAT_ARGB1555: atom->cmd[CTX_RB3D_CNTL] |= RADEON_COLOR_FORMAT_ARGB1555; break; + default: + _mesa_problem(ctx, "Unexpected format in ctx_emit_cs"); } cbpitch = (rrb->pitch / rrb->cpp); diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index da5b7ba642..1e2a54f634 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -279,16 +279,18 @@ static void emit_cb_offset(GLcontext *ctx, struct radeon_state_atom * atom) cbpitch = (rrb->pitch / rrb->cpp); if (rrb->cpp == 4) cbpitch |= R300_COLOR_FORMAT_ARGB8888; - else switch (rrb->base._ActualFormat) { - case GL_RGB5: + else switch (rrb->base.Format) { + case MESA_FORMAT_RGB565: cbpitch |= R300_COLOR_FORMAT_RGB565; break; - case GL_RGBA4: + case MESA_FORMAT_ARGB4444: cbpitch |= R300_COLOR_FORMAT_ARGB4444; break; - case GL_RGB5_A1: + case MESA_FORMAT_ARGB1555: cbpitch |= R300_COLOR_FORMAT_ARGB1555; break; + default: + _mesa_problem(ctx, "unexpected format in emit_cb_offset()"); } if (rrb->bo->flags & RADEON_BO_FLAGS_MACRO_TILE) diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.c b/src/mesa/drivers/dri/radeon/radeon_common_context.c index 6b9b1e3c5e..fe99644907 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.c @@ -496,19 +496,7 @@ radeon_make_renderbuffer_current(radeonContextPtr radeon, static unsigned radeon_bits_per_pixel(const struct radeon_renderbuffer *rb) { - switch (rb->base._ActualFormat) { - case GL_RGB5: - case GL_DEPTH_COMPONENT16: - return 16; - case GL_RGB8: - case GL_RGBA8: - case GL_DEPTH_COMPONENT24: - case GL_DEPTH24_STENCIL8_EXT: - case GL_STENCIL_INDEX8_EXT: - return 32; - default: - return 0; - } + return _mesa_get_format_bytes(rb->base.Format) * 8; } void diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index 3f4f382d6c..796dd1b423 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -90,11 +90,8 @@ radeon_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_R3_G3_B2: case GL_RGB4: case GL_RGB5: - rb->_ActualFormat = GL_RGB5; + rb->Format = MESA_FORMAT_RGB565; rb->DataType = GL_UNSIGNED_BYTE; - rb->RedBits = 5; - rb->GreenBits = 6; - rb->BlueBits = 5; cpp = 2; break; case GL_RGB: @@ -102,12 +99,8 @@ radeon_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_RGB10: case GL_RGB12: case GL_RGB16: - rb->_ActualFormat = GL_RGB8; + rb->Format = MESA_FORMAT_ARGB8888; rb->DataType = GL_UNSIGNED_BYTE; - rb->RedBits = 8; - rb->GreenBits = 8; - rb->BlueBits = 8; - rb->AlphaBits = 0; cpp = 4; break; case GL_RGBA: @@ -118,12 +111,8 @@ radeon_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_RGB10_A2: case GL_RGBA12: case GL_RGBA16: - rb->_ActualFormat = GL_RGBA8; + rb->Format = MESA_FORMAT_ARGB8888; rb->DataType = GL_UNSIGNED_BYTE; - rb->RedBits = 8; - rb->GreenBits = 8; - rb->BlueBits = 8; - rb->AlphaBits = 8; cpp = 4; break; case GL_STENCIL_INDEX: @@ -132,31 +121,26 @@ radeon_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_STENCIL_INDEX8_EXT: case GL_STENCIL_INDEX16_EXT: /* alloc a depth+stencil buffer */ - rb->_ActualFormat = GL_DEPTH24_STENCIL8_EXT; + rb->Format = MESA_FORMAT_Z24_S8; rb->DataType = GL_UNSIGNED_INT_24_8_EXT; - rb->StencilBits = 8; cpp = 4; break; case GL_DEPTH_COMPONENT16: - rb->_ActualFormat = GL_DEPTH_COMPONENT16; + rb->Format = MESA_FORMAT_Z16; rb->DataType = GL_UNSIGNED_SHORT; - rb->DepthBits = 16; cpp = 2; break; case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT24: case GL_DEPTH_COMPONENT32: - rb->_ActualFormat = GL_DEPTH_COMPONENT24; + rb->Format = MESA_FORMAT_Z32; rb->DataType = GL_UNSIGNED_INT; - rb->DepthBits = 24; cpp = 4; break; case GL_DEPTH_STENCIL_EXT: case GL_DEPTH24_STENCIL8_EXT: - rb->_ActualFormat = GL_DEPTH24_STENCIL8_EXT; + rb->Format = MESA_FORMAT_Z24_S8; rb->DataType = GL_UNSIGNED_INT_24_8_EXT; - rb->DepthBits = 24; - rb->StencilBits = 8; cpp = 4; break; default: @@ -165,6 +149,8 @@ radeon_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, return GL_FALSE; } + rb->_BaseFormat = _mesa_base_fbo_format(ctx, internalFormat); + if (ctx->Driver.Flush) ctx->Driver.Flush(ctx); /* +r6/r7 */ @@ -212,7 +198,7 @@ radeon_alloc_window_storage(GLcontext * ctx, struct gl_renderbuffer *rb, ASSERT(rb->Name == 0); rb->Width = width; rb->Height = height; - rb->_ActualFormat = internalFormat; + rb->InternalFormat = internalFormat; return GL_TRUE; } @@ -269,55 +255,32 @@ radeon_create_renderbuffer(GLenum format, __DRIdrawablePrivate *driDrawPriv) /* XXX format junk */ switch (format) { case GL_RGB5: - rrb->base._ActualFormat = GL_RGB5; - rrb->base._BaseFormat = GL_RGBA; - rrb->base.RedBits = 5; - rrb->base.GreenBits = 6; - rrb->base.BlueBits = 5; rrb->base.DataType = GL_UNSIGNED_BYTE; + rrb->base._BaseFormat = GL_RGB; break; case GL_RGB8: - rrb->base._ActualFormat = GL_RGB8; - rrb->base._BaseFormat = GL_RGB; - rrb->base.RedBits = 8; - rrb->base.GreenBits = 8; - rrb->base.BlueBits = 8; - rrb->base.AlphaBits = 0; rrb->base.DataType = GL_UNSIGNED_BYTE; + rrb->base._BaseFormat = GL_RGB; break; case GL_RGBA8: - rrb->base._ActualFormat = GL_RGBA8; - rrb->base._BaseFormat = GL_RGBA; - rrb->base.RedBits = 8; - rrb->base.GreenBits = 8; - rrb->base.BlueBits = 8; - rrb->base.AlphaBits = 8; rrb->base.DataType = GL_UNSIGNED_BYTE; + rrb->base._BaseFormat = GL_RGBA; break; case GL_STENCIL_INDEX8_EXT: - rrb->base._ActualFormat = GL_STENCIL_INDEX8_EXT; - rrb->base._BaseFormat = GL_STENCIL_INDEX; - rrb->base.StencilBits = 8; rrb->base.DataType = GL_UNSIGNED_BYTE; + rrb->base._BaseFormat = GL_STENCIL_INDEX; break; case GL_DEPTH_COMPONENT16: - rrb->base._ActualFormat = GL_DEPTH_COMPONENT16; - rrb->base._BaseFormat = GL_DEPTH_COMPONENT; - rrb->base.DepthBits = 16; rrb->base.DataType = GL_UNSIGNED_SHORT; + rrb->base._BaseFormat = GL_DEPTH_COMPONENT; break; case GL_DEPTH_COMPONENT24: - rrb->base._ActualFormat = GL_DEPTH_COMPONENT24; - rrb->base._BaseFormat = GL_DEPTH_COMPONENT; - rrb->base.DepthBits = 24; rrb->base.DataType = GL_UNSIGNED_INT; + rrb->base._BaseFormat = GL_DEPTH_COMPONENT; break; case GL_DEPTH24_STENCIL8_EXT: - rrb->base._ActualFormat = GL_DEPTH24_STENCIL8_EXT; - rrb->base._BaseFormat = GL_DEPTH_STENCIL_EXT; - rrb->base.DepthBits = 24; - rrb->base.StencilBits = 8; rrb->base.DataType = GL_UNSIGNED_INT_24_8_EXT; + rrb->base._BaseFormat = GL_STENCIL_INDEX; break; default: fprintf(stderr, "%s: Unknown format 0x%04x\n", __FUNCTION__, format); @@ -390,44 +353,26 @@ radeon_update_wrapper(GLcontext *ctx, struct radeon_renderbuffer *rrb, restart: if (texImage->TexFormat == MESA_FORMAT_ARGB8888) { - rrb->cpp = 4; - rrb->base._ActualFormat = GL_RGBA8; - rrb->base._BaseFormat = GL_RGBA; rrb->base.DataType = GL_UNSIGNED_BYTE; DBG("Render to RGBA8 texture OK\n"); } else if (texImage->TexFormat == MESA_FORMAT_RGB565) { - rrb->cpp = 2; - rrb->base._ActualFormat = GL_RGB5; - rrb->base._BaseFormat = GL_RGB; rrb->base.DataType = GL_UNSIGNED_BYTE; DBG("Render to RGB5 texture OK\n"); } else if (texImage->TexFormat == MESA_FORMAT_ARGB1555) { - rrb->cpp = 2; - rrb->base._ActualFormat = GL_RGB5_A1; - rrb->base._BaseFormat = GL_RGBA; rrb->base.DataType = GL_UNSIGNED_BYTE; DBG("Render to ARGB1555 texture OK\n"); } else if (texImage->TexFormat == MESA_FORMAT_ARGB4444) { - rrb->cpp = 2; - rrb->base._ActualFormat = GL_RGBA4; - rrb->base._BaseFormat = GL_RGBA; rrb->base.DataType = GL_UNSIGNED_BYTE; DBG("Render to ARGB1555 texture OK\n"); } else if (texImage->TexFormat == MESA_FORMAT_Z16) { - rrb->cpp = 2; - rrb->base._ActualFormat = GL_DEPTH_COMPONENT16; - rrb->base._BaseFormat = GL_DEPTH_COMPONENT; rrb->base.DataType = GL_UNSIGNED_SHORT; DBG("Render to DEPTH16 texture OK\n"); } else if (texImage->TexFormat == MESA_FORMAT_S8_Z24) { - rrb->cpp = 4; - rrb->base._ActualFormat = GL_DEPTH24_STENCIL8_EXT; - rrb->base._BaseFormat = GL_DEPTH_STENCIL_EXT; rrb->base.DataType = GL_UNSIGNED_INT_24_8_EXT; DBG("Render to DEPTH_STENCIL texture OK\n"); } @@ -448,16 +393,15 @@ restart: texFormat = texImage->TexFormat; + rrb->base.Format = texFormat; + + rrb->cpp = _mesa_get_format_bytes(texFormat); rrb->pitch = texImage->Width * rrb->cpp; - rrb->base.InternalFormat = rrb->base._ActualFormat; + rrb->base.InternalFormat = texImage->InternalFormat; + rrb->base._BaseFormat = _mesa_base_fbo_format(ctx, rrb->base.InternalFormat); + rrb->base.Width = texImage->Width; rrb->base.Height = texImage->Height; - rrb->base.RedBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_RED_SIZE); - rrb->base.GreenBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_GREEN_SIZE); - rrb->base.BlueBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_BLUE_SIZE); - rrb->base.AlphaBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_ALPHA_SIZE); - rrb->base.DepthBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_DEPTH_SIZE_ARB); - rrb->base.StencilBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_STENCIL_SIZE_EXT); rrb->base.Delete = radeon_delete_renderbuffer; rrb->base.AllocStorage = radeon_nop_alloc_storage; diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c b/src/mesa/drivers/dri/radeon/radeon_span.c index 0c49c3713a..055f77a24b 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.c +++ b/src/mesa/drivers/dri/radeon/radeon_span.c @@ -864,25 +864,25 @@ void radeonInitSpanFuncs(GLcontext * ctx) */ static void radeonSetSpanFunctions(struct radeon_renderbuffer *rrb) { - if (rrb->base._ActualFormat == GL_RGB5) { + if (rrb->base.Format == MESA_FORMAT_RGB565) { radeonInitPointers_RGB565(&rrb->base); - } else if (rrb->base._ActualFormat == GL_RGB8) { + } else if (rrb->base.Format == MESA_FORMAT_RGBA8888) { /* XXX */ radeonInitPointers_xRGB8888(&rrb->base); - } else if (rrb->base._ActualFormat == GL_RGBA8) { + } else if (rrb->base.Format == MESA_FORMAT_RGBA8888) { radeonInitPointers_ARGB8888(&rrb->base); - } else if (rrb->base._ActualFormat == GL_RGBA4) { + } else if (rrb->base.Format == MESA_FORMAT_ARGB4444) { radeonInitPointers_ARGB4444(&rrb->base); - } else if (rrb->base._ActualFormat == GL_RGB5_A1) { + } else if (rrb->base.Format == MESA_FORMAT_ARGB1555) { radeonInitPointers_ARGB1555(&rrb->base); - } else if (rrb->base._ActualFormat == GL_DEPTH_COMPONENT16) { + } else if (rrb->base.Format == MESA_FORMAT_Z16) { radeonInitDepthPointers_z16(&rrb->base); - } else if (rrb->base._ActualFormat == GL_DEPTH_COMPONENT24) { + } else if (rrb->base.Format == GL_DEPTH_COMPONENT32) { /* XXX */ radeonInitDepthPointers_z24(&rrb->base); - } else if (rrb->base._ActualFormat == GL_DEPTH24_STENCIL8_EXT) { + } else if (rrb->base.Format == MESA_FORMAT_Z24_S8) { radeonInitDepthPointers_z24_s8(&rrb->base); - } else if (rrb->base._ActualFormat == GL_STENCIL_INDEX8_EXT) { + } else if (rrb->base.Format == MESA_FORMAT_S8) { radeonInitStencilPointers_z24_s8(&rrb->base); } else { - fprintf(stderr, "radeonSetSpanFunctions: bad actual format: 0x%04X\n", rrb->base._ActualFormat); + fprintf(stderr, "radeonSetSpanFunctions: bad actual format: 0x%04X\n", rrb->base.Format); } } diff --git a/src/mesa/drivers/dri/radeon/radeon_state_init.c b/src/mesa/drivers/dri/radeon/radeon_state_init.c index f3ad0dd17a..2d19220d8a 100644 --- a/src/mesa/drivers/dri/radeon/radeon_state_init.c +++ b/src/mesa/drivers/dri/radeon/radeon_state_init.c @@ -440,16 +440,18 @@ static void ctx_emit_cs(GLcontext *ctx, struct radeon_state_atom *atom) atom->cmd[CTX_RB3D_CNTL] &= ~(0xf << 10); if (rrb->cpp == 4) atom->cmd[CTX_RB3D_CNTL] |= RADEON_COLOR_FORMAT_ARGB8888; - else switch (rrb->base._ActualFormat) { - case GL_RGB5: + else switch (rrb->base.Format) { + case MESA_FORMAT_RGB565: atom->cmd[CTX_RB3D_CNTL] |= RADEON_COLOR_FORMAT_RGB565; break; - case GL_RGBA4: + case MESA_FORMAT_ARGB4444: atom->cmd[CTX_RB3D_CNTL] |= RADEON_COLOR_FORMAT_ARGB4444; break; - case GL_RGB5_A1: + case MESA_FORMAT_ARGB1555: atom->cmd[CTX_RB3D_CNTL] |= RADEON_COLOR_FORMAT_ARGB1555; break; + default: + _mesa_problem(ctx, "unexpected format in ctx_emit_cs()"); } cbpitch = (rrb->pitch / rrb->cpp); diff --git a/src/mesa/drivers/dri/sis/sis_dd.c b/src/mesa/drivers/dri/sis/sis_dd.c index bddc4a9285..217d77557f 100644 --- a/src/mesa/drivers/dri/sis/sis_dd.c +++ b/src/mesa/drivers/dri/sis/sis_dd.c @@ -41,6 +41,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "sis_tris.h" #include "swrast/swrast.h" +#include "main/formats.h" #include "main/framebuffer.h" #include "main/renderbuffer.h" @@ -142,25 +143,25 @@ sisInitRenderbuffer(struct gl_renderbuffer *rb, GLenum format) if (format == GL_RGBA) { /* Color */ - rb->_BaseFormat = GL_RGBA; + rb->Format = MESA_FORMAT_ARGB8888; rb->DataType = GL_UNSIGNED_BYTE; } else if (format == GL_DEPTH_COMPONENT16) { /* Depth */ - rb->_BaseFormat = GL_DEPTH_COMPONENT; /* we always Get/Put 32-bit Z values */ + rb->Format = MESA_FORMAT_Z16; rb->DataType = GL_UNSIGNED_INT; } else if (format == GL_DEPTH_COMPONENT24) { /* Depth */ - rb->_BaseFormat = GL_DEPTH_COMPONENT; /* we always Get/Put 32-bit Z values */ + rb->Format = MESA_FORMAT_Z32; rb->DataType = GL_UNSIGNED_INT; } else { /* Stencil */ ASSERT(format == GL_STENCIL_INDEX8_EXT); - rb->_BaseFormat = GL_STENCIL_INDEX; + rb->Format = MESA_FORMAT_S8; rb->DataType = GL_UNSIGNED_BYTE; } diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index f4947daa06..a8d1a95bbe 100644 --- a/src/mesa/drivers/dri/swrast/swrast.c +++ b/src/mesa/drivers/dri/swrast/swrast.c @@ -33,6 +33,7 @@ #include "main/context.h" #include "main/extensions.h" +#include "main/formats.h" #include "main/framebuffer.h" #include "main/imports.h" #include "main/renderbuffer.h" @@ -378,50 +379,38 @@ swrast_new_renderbuffer(const GLvisual *visual, GLboolean front) switch (pixel_format) { case PF_A8R8G8B8: + xrb->Base.Format = MESA_FORMAT_ARGB8888; xrb->Base.InternalFormat = GL_RGBA; xrb->Base._BaseFormat = GL_RGBA; xrb->Base.DataType = GL_UNSIGNED_BYTE; - xrb->Base.RedBits = 8 * sizeof(GLubyte); - xrb->Base.GreenBits = 8 * sizeof(GLubyte); - xrb->Base.BlueBits = 8 * sizeof(GLubyte); - xrb->Base.AlphaBits = 8 * sizeof(GLubyte); xrb->bpp = 32; break; case PF_X8R8G8B8: + xrb->Base.Format = MESA_FORMAT_ARGB8888; /* XXX */ xrb->Base.InternalFormat = GL_RGB; xrb->Base._BaseFormat = GL_RGB; xrb->Base.DataType = GL_UNSIGNED_BYTE; - xrb->Base.RedBits = 8 * sizeof(GLubyte); - xrb->Base.GreenBits = 8 * sizeof(GLubyte); - xrb->Base.BlueBits = 8 * sizeof(GLubyte); - xrb->Base.AlphaBits = 0; xrb->bpp = 32; break; case PF_R5G6B5: + xrb->Base.Format = MESA_FORMAT_RGB565; xrb->Base.InternalFormat = GL_RGB; xrb->Base._BaseFormat = GL_RGB; xrb->Base.DataType = GL_UNSIGNED_BYTE; - xrb->Base.RedBits = 5 * sizeof(GLubyte); - xrb->Base.GreenBits = 6 * sizeof(GLubyte); - xrb->Base.BlueBits = 5 * sizeof(GLubyte); - xrb->Base.AlphaBits = 0; xrb->bpp = 16; break; case PF_R3G3B2: + xrb->Base.Format = MESA_FORMAT_RGB332; xrb->Base.InternalFormat = GL_RGB; xrb->Base._BaseFormat = GL_RGB; xrb->Base.DataType = GL_UNSIGNED_BYTE; - xrb->Base.RedBits = 3 * sizeof(GLubyte); - xrb->Base.GreenBits = 3 * sizeof(GLubyte); - xrb->Base.BlueBits = 2 * sizeof(GLubyte); - xrb->Base.AlphaBits = 0; xrb->bpp = 8; break; case PF_CI8: + xrb->Base.Format = MESA_FORMAT_CI8; xrb->Base.InternalFormat = GL_COLOR_INDEX8_EXT; xrb->Base._BaseFormat = GL_COLOR_INDEX; xrb->Base.DataType = GL_UNSIGNED_BYTE; - xrb->Base.IndexBits = 8 * sizeof(GLubyte); xrb->bpp = 8; break; default: diff --git a/src/mesa/drivers/dri/unichrome/via_context.c b/src/mesa/drivers/dri/unichrome/via_context.c index 6eb19ac079..e7b6b030d1 100644 --- a/src/mesa/drivers/dri/unichrome/via_context.c +++ b/src/mesa/drivers/dri/unichrome/via_context.c @@ -32,6 +32,7 @@ #include "main/glheader.h" #include "main/context.h" +#include "main/formats.h" #include "main/matrix.h" #include "main/state.h" #include "main/simple_list.h" @@ -163,24 +164,28 @@ viaInitRenderbuffer(struct via_renderbuffer *vrb, GLenum format, if (format == GL_RGBA) { /* Color */ rb->_BaseFormat = GL_RGBA; + rb->Format = MESA_FORMAT_ARGB8888; rb->DataType = GL_UNSIGNED_BYTE; } else if (format == GL_DEPTH_COMPONENT16) { /* Depth */ rb->_BaseFormat = GL_DEPTH_COMPONENT; /* we always Get/Put 32-bit Z values */ + rb->Format = MESA_FORMAT_Z16; rb->DataType = GL_UNSIGNED_INT; } else if (format == GL_DEPTH_COMPONENT24) { /* Depth */ rb->_BaseFormat = GL_DEPTH_COMPONENT; /* we always Get/Put 32-bit Z values */ + rb->Format = MESA_FORMAT_Z32; rb->DataType = GL_UNSIGNED_INT; } else { /* Stencil */ ASSERT(format == GL_STENCIL_INDEX8_EXT); rb->_BaseFormat = GL_STENCIL_INDEX; + rb->Format = MESA_FORMAT_S8; rb->DataType = GL_UNSIGNED_BYTE; } diff --git a/src/mesa/drivers/osmesa/osmesa.c b/src/mesa/drivers/osmesa/osmesa.c index 692657a5df..bac8a9ef14 100644 --- a/src/mesa/drivers/osmesa/osmesa.c +++ b/src/mesa/drivers/osmesa/osmesa.c @@ -37,6 +37,7 @@ #include "GL/osmesa.h" #include "main/context.h" #include "main/extensions.h" +#include "main/formats.h" #include "main/framebuffer.h" #include "main/imports.h" #include "main/mtypes.h" @@ -840,11 +841,6 @@ osmesa_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, else bpc = 32; - rb->RedBits = - rb->GreenBits = - rb->BlueBits = - rb->AlphaBits = bpc; - /* Note: we can ignoring internalFormat for "window-system" renderbuffers */ (void) internalFormat; @@ -876,7 +872,6 @@ osmesa_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->PutValues = put_values_RGBA32; rb->PutMonoValues = put_mono_values_RGBA32; } - rb->RedBits = rb->GreenBits = rb->BlueBits = rb->AlphaBits = bpc; } else if (osmesa->format == OSMESA_BGRA) { if (rb->DataType == GL_UNSIGNED_BYTE) { @@ -906,7 +901,6 @@ osmesa_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->PutValues = put_values_BGRA32; rb->PutMonoValues = put_mono_values_BGRA32; } - rb->RedBits = rb->GreenBits = rb->BlueBits = rb->AlphaBits = bpc; } else if (osmesa->format == OSMESA_ARGB) { if (rb->DataType == GL_UNSIGNED_BYTE) { @@ -936,7 +930,6 @@ osmesa_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->PutValues = put_values_ARGB32; rb->PutMonoValues = put_mono_values_ARGB32; } - rb->RedBits = rb->GreenBits = rb->BlueBits = rb->AlphaBits = bpc; } else if (osmesa->format == OSMESA_RGB) { if (rb->DataType == GL_UNSIGNED_BYTE) { @@ -966,7 +959,6 @@ osmesa_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->PutValues = put_values_RGB32; rb->PutMonoValues = put_mono_values_RGB32; } - rb->RedBits = rb->GreenBits = rb->BlueBits = bpc; } else if (osmesa->format == OSMESA_BGR) { if (rb->DataType == GL_UNSIGNED_BYTE) { @@ -996,7 +988,6 @@ osmesa_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->PutValues = put_values_BGR32; rb->PutMonoValues = put_mono_values_BGR32; } - rb->RedBits = rb->GreenBits = rb->BlueBits = bpc; } else if (osmesa->format == OSMESA_RGB_565) { ASSERT(rb->DataType == GL_UNSIGNED_BYTE); @@ -1007,9 +998,6 @@ osmesa_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->PutMonoRow = put_mono_row_RGB_565; rb->PutValues = put_values_RGB_565; rb->PutMonoValues = put_mono_values_RGB_565; - rb->RedBits = 5; - rb->GreenBits = 6; - rb->BlueBits = 5; } else if (osmesa->format == OSMESA_COLOR_INDEX) { rb->GetRow = get_row_CI; @@ -1018,7 +1006,6 @@ osmesa_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->PutMonoRow = put_mono_row_CI; rb->PutValues = put_values_CI; rb->PutMonoValues = put_mono_values_CI; - rb->IndexBits = 8; } else { _mesa_problem(ctx, "bad pixel format in osmesa renderbuffer_storage"); @@ -1048,13 +1035,13 @@ new_osmesa_renderbuffer(GLcontext *ctx, GLenum format, GLenum type) if (format == OSMESA_COLOR_INDEX) { rb->InternalFormat = GL_COLOR_INDEX; - rb->_ActualFormat = GL_COLOR_INDEX8_EXT; + rb->Format = MESA_FORMAT_CI8; rb->_BaseFormat = GL_COLOR_INDEX; rb->DataType = GL_UNSIGNED_BYTE; } else { rb->InternalFormat = GL_RGBA; - rb->_ActualFormat = GL_RGBA; + rb->Format = MESA_FORMAT_RGBA8888; rb->_BaseFormat = GL_RGBA; rb->DataType = type; } diff --git a/src/mesa/drivers/x11/xm_buffer.c b/src/mesa/drivers/x11/xm_buffer.c index 821e2a8e08..bf38629289 100644 --- a/src/mesa/drivers/x11/xm_buffer.c +++ b/src/mesa/drivers/x11/xm_buffer.c @@ -32,6 +32,7 @@ #include "glxheader.h" #include "xmesaP.h" #include "main/imports.h" +#include "main/formats.h" #include "main/framebuffer.h" #include "main/renderbuffer.h" @@ -338,18 +339,15 @@ xmesa_new_renderbuffer(GLcontext *ctx, GLuint name, const GLvisual *visual, if (visual->rgbMode) { xrb->Base.InternalFormat = GL_RGBA; + xrb->Base.Format = MESA_FORMAT_RGBA8888; xrb->Base._BaseFormat = GL_RGBA; xrb->Base.DataType = GL_UNSIGNED_BYTE; - xrb->Base.RedBits = visual->redBits; - xrb->Base.GreenBits = visual->greenBits; - xrb->Base.BlueBits = visual->blueBits; - xrb->Base.AlphaBits = visual->alphaBits; } else { xrb->Base.InternalFormat = GL_COLOR_INDEX; + xrb->Base.Format = MESA_FORMAT_CI8; xrb->Base._BaseFormat = GL_COLOR_INDEX; xrb->Base.DataType = GL_UNSIGNED_INT; - xrb->Base.IndexBits = visual->indexBits; } /* only need to set Red/Green/EtcBits fields for user-created RBs */ } diff --git a/src/mesa/drivers/x11/xm_dd.c b/src/mesa/drivers/x11/xm_dd.c index d757e50b5a..a27d7045ab 100644 --- a/src/mesa/drivers/x11/xm_dd.c +++ b/src/mesa/drivers/x11/xm_dd.c @@ -448,7 +448,7 @@ can_do_DrawPixels_8R8G8B(GLcontext *ctx, GLenum format, GLenum type) struct xmesa_renderbuffer *xrb = xmesa_renderbuffer(rb->Wrapped); if (xrb && xrb->pixmap && /* drawing to pixmap or window */ - xrb->Base.AlphaBits == 0) { + _mesa_get_format_bits(xrb->Base.Format, GL_ALPHA_BITS) == 0) { return GL_TRUE; } } @@ -582,7 +582,7 @@ can_do_DrawPixels_5R6G5B(GLcontext *ctx, GLenum format, GLenum type) struct xmesa_renderbuffer *xrb = xmesa_renderbuffer(rb->Wrapped); if (xrb && xrb->pixmap && /* drawing to pixmap or window */ - xrb->Base.AlphaBits == 0) { + _mesa_get_format_bits(xrb->Base.Format, GL_ALPHA_BITS) == 0) { return GL_TRUE; } } diff --git a/src/mesa/main/depthstencil.c b/src/mesa/main/depthstencil.c index 7be2aacaf2..803dc6c75e 100644 --- a/src/mesa/main/depthstencil.c +++ b/src/mesa/main/depthstencil.c @@ -26,6 +26,7 @@ #include "imports.h" #include "context.h" #include "fbobject.h" +#include "formats.h" #include "mtypes.h" #include "depthstencil.h" #include "renderbuffer.h" @@ -40,8 +41,8 @@ * a combined Z+stencil buffer! That implies we need three different sets * of Get/Put functions. * - * We solve this by wrapping the Z24_S8 renderbuffer with depth and stencil - * adaptors, each with the right kind of depth/stencil Get/Put functions. + * We solve this by wrapping the Z24_S8 or S8_Z24 renderbuffer with depth and + * stencil adaptors, each with the right kind of depth/stencil Get/Put functions. */ @@ -62,8 +63,8 @@ nop_get_pointer(GLcontext *ctx, struct gl_renderbuffer *rb, GLint x, GLint y) static void delete_wrapper(struct gl_renderbuffer *rb) { - ASSERT(rb->_ActualFormat == GL_DEPTH_COMPONENT24 || - rb->_ActualFormat == GL_STENCIL_INDEX8_EXT); + ASSERT(rb->Format == MESA_FORMAT_Z24_S8 || + rb->Format == MESA_FORMAT_S8_Z24); _mesa_reference_renderbuffer(&rb->Wrapped, NULL); _mesa_free(rb); } @@ -82,7 +83,8 @@ alloc_wrapper_storage(GLcontext *ctx, struct gl_renderbuffer *rb, (void) internalFormat; - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); + ASSERT(dsrb->Format == MESA_FORMAT_Z24_S8 || + dsrb->Format == MESA_FORMAT_S8_Z24); retVal = dsrb->AllocStorage(ctx, dsrb, dsrb->InternalFormat, width, height); if (retVal) { @@ -108,14 +110,21 @@ get_row_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb, GLuint count, GLuint *dst = (GLuint *) values; const GLuint *src = (const GLuint *) dsrb->GetPointer(ctx, dsrb, x, y); ASSERT(z24rb->DataType == GL_UNSIGNED_INT); - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); if (!src) { dsrb->GetRow(ctx, dsrb, count, x, y, temp); src = temp; } - for (i = 0; i < count; i++) { - dst[i] = src[i] >> 8; + if (dsrb->Format == MESA_FORMAT_Z24_S8) { + for (i = 0; i < count; i++) { + dst[i] = src[i] >> 8; + } + } + else { + assert(dsrb->Format == MESA_FORMAT_S8_Z24); + for (i = 0; i < count; i++) { + dst[i] = src[i] & 0xffffff; + } } } @@ -127,13 +136,20 @@ get_values_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb, GLuint count, GLuint temp[MAX_WIDTH], i; GLuint *dst = (GLuint *) values; ASSERT(z24rb->DataType == GL_UNSIGNED_INT); - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); ASSERT(count <= MAX_WIDTH); /* don't bother trying direct access */ dsrb->GetValues(ctx, dsrb, count, x, y, temp); - for (i = 0; i < count; i++) { - dst[i] = temp[i] >> 8; + if (dsrb->Format == MESA_FORMAT_Z24_S8) { + for (i = 0; i < count; i++) { + dst[i] = temp[i] >> 8; + } + } + else { + assert(dsrb->Format == MESA_FORMAT_S8_Z24); + for (i = 0; i < count; i++) { + dst[i] = temp[i] & 0xffffff; + } } } @@ -145,14 +161,23 @@ put_row_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb, GLuint count, const GLuint *src = (const GLuint *) values; GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x, y); ASSERT(z24rb->DataType == GL_UNSIGNED_INT); - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); if (dst) { /* direct access */ GLuint i; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - dst[i] = (src[i] << 8) | (dst[i] & 0xff); + if (dsrb->Format == MESA_FORMAT_Z24_S8) { + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + dst[i] = (src[i] << 8) | (dst[i] & 0xff); + } + } + } + else { + assert(dsrb->Format == MESA_FORMAT_S8_Z24); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + dst[i] = (src[i] & 0xffffff) | (dst[i] & 0xff000000); + } } } } @@ -160,9 +185,19 @@ put_row_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb, GLuint count, /* get, modify, put */ GLuint temp[MAX_WIDTH], i; dsrb->GetRow(ctx, dsrb, count, x, y, temp); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = (src[i] << 8) | (temp[i] & 0xff); + if (dsrb->Format == MESA_FORMAT_Z24_S8) { + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + temp[i] = (src[i] << 8) | (temp[i] & 0xff); + } + } + } + else { + assert(dsrb->Format == MESA_FORMAT_S8_Z24); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + temp[i] = (src[i] & 0xffffff) | (temp[i] & 0xff000000); + } } } dsrb->PutRow(ctx, dsrb, count, x, y, temp, mask); @@ -174,17 +209,27 @@ put_mono_row_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb, GLuint count, GLint x, GLint y, const void *value, const GLubyte *mask) { struct gl_renderbuffer *dsrb = z24rb->Wrapped; - const GLuint shiftedVal = *((GLuint *) value) << 8; GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x, y); ASSERT(z24rb->DataType == GL_UNSIGNED_INT); - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); if (dst) { /* direct access */ GLuint i; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - dst[i] = shiftedVal | (dst[i] & 0xff); + if (dsrb->Format == MESA_FORMAT_Z24_S8) { + const GLuint shiftedVal = *((GLuint *) value) << 8; + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + dst[i] = shiftedVal | (dst[i] & 0xff); + } + } + } + else { + const GLuint shiftedVal = *((GLuint *) value); + assert(dsrb->Format == MESA_FORMAT_S8_Z24); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + dst[i] = shiftedVal | (dst[i] & 0xff000000); + } } } } @@ -192,9 +237,21 @@ put_mono_row_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb, GLuint count, /* get, modify, put */ GLuint temp[MAX_WIDTH], i; dsrb->GetRow(ctx, dsrb, count, x, y, temp); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = shiftedVal | (temp[i] & 0xff); + if (dsrb->Format == MESA_FORMAT_Z24_S8) { + const GLuint shiftedVal = *((GLuint *) value) << 8; + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + temp[i] = shiftedVal | (temp[i] & 0xff); + } + } + } + else { + const GLuint shiftedVal = *((GLuint *) value); + assert(dsrb->Format == MESA_FORMAT_S8_Z24); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + temp[i] = shiftedVal | (temp[i] & 0xff000000); + } } } dsrb->PutRow(ctx, dsrb, count, x, y, temp, mask); @@ -209,15 +266,25 @@ put_values_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb, GLuint count, struct gl_renderbuffer *dsrb = z24rb->Wrapped; const GLuint *src = (const GLuint *) values; ASSERT(z24rb->DataType == GL_UNSIGNED_INT); - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); if (dsrb->GetPointer(ctx, dsrb, 0, 0)) { /* direct access */ GLuint i; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x[i], y[i]); - *dst = (src[i] << 8) | (*dst & 0xff); + if (dsrb->Format == MESA_FORMAT_Z24_S8) { + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x[i], y[i]); + *dst = (src[i] << 8) | (*dst & 0xff); + } + } + } + else { + assert(dsrb->Format == MESA_FORMAT_S8_Z24); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x[i], y[i]); + *dst = (src[i] & 0xffffff) | (*dst & 0xff000000); + } } } } @@ -225,9 +292,19 @@ put_values_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb, GLuint count, /* get, modify, put */ GLuint temp[MAX_WIDTH], i; dsrb->GetValues(ctx, dsrb, count, x, y, temp); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = (src[i] << 8) | (temp[i] & 0xff); + if (dsrb->Format == MESA_FORMAT_Z24_S8) { + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + temp[i] = (src[i] << 8) | (temp[i] & 0xff); + } + } + } + else { + assert(dsrb->Format == MESA_FORMAT_S8_Z24); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + temp[i] = (src[i] & 0xffffff) | (temp[i] & 0xff000000); + } } } dsrb->PutValues(ctx, dsrb, count, x, y, temp, mask); @@ -241,12 +318,23 @@ put_mono_values_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb, { struct gl_renderbuffer *dsrb = z24rb->Wrapped; GLuint temp[MAX_WIDTH], i; - const GLuint shiftedVal = *((GLuint *) value) << 8; /* get, modify, put */ dsrb->GetValues(ctx, dsrb, count, x, y, temp); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = shiftedVal | (temp[i] & 0xff); + if (dsrb->Format == MESA_FORMAT_Z24_S8) { + const GLuint shiftedVal = *((GLuint *) value) << 8; + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + temp[i] = shiftedVal | (temp[i] & 0xff); + } + } + } + else { + assert(dsrb->Format == MESA_FORMAT_S8_Z24); + const GLuint shiftedVal = *((GLuint *) value); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + temp[i] = shiftedVal | (temp[i] & 0xff000000); + } } } dsrb->PutValues(ctx, dsrb, count, x, y, temp, mask); @@ -264,7 +352,8 @@ _mesa_new_z24_renderbuffer_wrapper(GLcontext *ctx, { struct gl_renderbuffer *z24rb; - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); + ASSERT(dsrb->Format == MESA_FORMAT_Z24_S8 || + dsrb->Format == MESA_FORMAT_S8_Z24); ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); z24rb = _mesa_new_renderbuffer(ctx, 0); @@ -277,10 +366,9 @@ _mesa_new_z24_renderbuffer_wrapper(GLcontext *ctx, z24rb->Width = dsrb->Width; z24rb->Height = dsrb->Height; z24rb->InternalFormat = GL_DEPTH_COMPONENT24; - z24rb->_ActualFormat = GL_DEPTH_COMPONENT24; + z24rb->Format = MESA_FORMAT_Z24_S8; z24rb->_BaseFormat = GL_DEPTH_COMPONENT; z24rb->DataType = GL_UNSIGNED_INT; - z24rb->DepthBits = 24; z24rb->Data = NULL; z24rb->Delete = delete_wrapper; z24rb->AllocStorage = alloc_wrapper_storage; @@ -310,14 +398,21 @@ get_row_s8(GLcontext *ctx, struct gl_renderbuffer *s8rb, GLuint count, GLubyte *dst = (GLubyte *) values; const GLuint *src = (const GLuint *) dsrb->GetPointer(ctx, dsrb, x, y); ASSERT(s8rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); if (!src) { dsrb->GetRow(ctx, dsrb, count, x, y, temp); src = temp; } - for (i = 0; i < count; i++) { - dst[i] = src[i] & 0xff; + if (dsrb->Format == MESA_FORMAT_Z24_S8) { + for (i = 0; i < count; i++) { + dst[i] = src[i] & 0xff; + } + } + else { + assert(dsrb->Format == MESA_FORMAT_S8_Z24); + for (i = 0; i < count; i++) { + dst[i] = src[i] >> 24; + } } } @@ -329,13 +424,20 @@ get_values_s8(GLcontext *ctx, struct gl_renderbuffer *s8rb, GLuint count, GLuint temp[MAX_WIDTH], i; GLubyte *dst = (GLubyte *) values; ASSERT(s8rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); ASSERT(count <= MAX_WIDTH); /* don't bother trying direct access */ dsrb->GetValues(ctx, dsrb, count, x, y, temp); - for (i = 0; i < count; i++) { - dst[i] = temp[i] & 0xff; + if (dsrb->Format == MESA_FORMAT_Z24_S8) { + for (i = 0; i < count; i++) { + dst[i] = temp[i] & 0xff; + } + } + else { + assert(dsrb->Format == MESA_FORMAT_S8_Z24); + for (i = 0; i < count; i++) { + dst[i] = temp[i] >> 24; + } } } @@ -347,14 +449,23 @@ put_row_s8(GLcontext *ctx, struct gl_renderbuffer *s8rb, GLuint count, const GLubyte *src = (const GLubyte *) values; GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x, y); ASSERT(s8rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); if (dst) { /* direct access */ GLuint i; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - dst[i] = (dst[i] & 0xffffff00) | src[i]; + if (dsrb->Format == MESA_FORMAT_Z24_S8) { + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + dst[i] = (dst[i] & 0xffffff00) | src[i]; + } + } + } + else { + assert(dsrb->Format == MESA_FORMAT_S8_Z24); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + dst[i] = (dst[i] & 0xffffff) | (src[i] << 24); + } } } } @@ -362,9 +473,19 @@ put_row_s8(GLcontext *ctx, struct gl_renderbuffer *s8rb, GLuint count, /* get, modify, put */ GLuint temp[MAX_WIDTH], i; dsrb->GetRow(ctx, dsrb, count, x, y, temp); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = (temp[i] & 0xffffff00) | src[i]; + if (dsrb->Format == MESA_FORMAT_Z24_S8) { + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + temp[i] = (temp[i] & 0xffffff00) | src[i]; + } + } + } + else { + assert(dsrb->Format == MESA_FORMAT_S8_Z24); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + temp[i] = (temp[i] & 0xffffff) | (src[i] << 24); + } } } dsrb->PutRow(ctx, dsrb, count, x, y, temp, mask); @@ -379,14 +500,23 @@ put_mono_row_s8(GLcontext *ctx, struct gl_renderbuffer *s8rb, GLuint count, const GLubyte val = *((GLubyte *) value); GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x, y); ASSERT(s8rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); if (dst) { /* direct access */ GLuint i; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - dst[i] = (dst[i] & 0xffffff00) | val; + if (dsrb->Format == MESA_FORMAT_Z24_S8) { + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + dst[i] = (dst[i] & 0xffffff00) | val; + } + } + } + else { + assert(dsrb->Format == MESA_FORMAT_S8_Z24); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + dst[i] = (dst[i] & 0xffffff) | (val << 24); + } } } } @@ -394,9 +524,19 @@ put_mono_row_s8(GLcontext *ctx, struct gl_renderbuffer *s8rb, GLuint count, /* get, modify, put */ GLuint temp[MAX_WIDTH], i; dsrb->GetRow(ctx, dsrb, count, x, y, temp); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = (temp[i] & 0xffffff00) | val; + if (dsrb->Format == MESA_FORMAT_Z24_S8) { + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + temp[i] = (temp[i] & 0xffffff00) | val; + } + } + } + else { + assert(dsrb->Format == MESA_FORMAT_S8_Z24); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + temp[i] = (temp[i] & 0xffffff) | (val << 24); + } } } dsrb->PutRow(ctx, dsrb, count, x, y, temp, mask); @@ -411,15 +551,25 @@ put_values_s8(GLcontext *ctx, struct gl_renderbuffer *s8rb, GLuint count, struct gl_renderbuffer *dsrb = s8rb->Wrapped; const GLubyte *src = (const GLubyte *) values; ASSERT(s8rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); if (dsrb->GetPointer(ctx, dsrb, 0, 0)) { /* direct access */ GLuint i; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x[i], y[i]); - *dst = (*dst & 0xffffff00) | src[i]; + if (dsrb->Format == MESA_FORMAT_Z24_S8) { + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x[i], y[i]); + *dst = (*dst & 0xffffff00) | src[i]; + } + } + } + else { + assert(dsrb->Format == MESA_FORMAT_S8_Z24); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x[i], y[i]); + *dst = (*dst & 0xffffff) | (src[i] << 24); + } } } } @@ -427,9 +577,19 @@ put_values_s8(GLcontext *ctx, struct gl_renderbuffer *s8rb, GLuint count, /* get, modify, put */ GLuint temp[MAX_WIDTH], i; dsrb->GetValues(ctx, dsrb, count, x, y, temp); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = (temp[i] & 0xffffff00) | src[i]; + if (dsrb->Format == MESA_FORMAT_Z24_S8) { + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + temp[i] = (temp[i] & 0xffffff00) | src[i]; + } + } + } + else { + assert(dsrb->Format == MESA_FORMAT_S8_Z24); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + temp[i] = (temp[i] & 0xffffff) | (src[i] << 24); + } } } dsrb->PutValues(ctx, dsrb, count, x, y, temp, mask); @@ -446,9 +606,19 @@ put_mono_values_s8(GLcontext *ctx, struct gl_renderbuffer *s8rb, GLuint count, const GLubyte val = *((GLubyte *) value); /* get, modify, put */ dsrb->GetValues(ctx, dsrb, count, x, y, temp); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = (temp[i] & 0xffffff) | val; + if (dsrb->Format == MESA_FORMAT_Z24_S8) { + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + temp[i] = (temp[i] & 0xffffff00) | val; + } + } + } + else { + assert(dsrb->Format == MESA_FORMAT_S8_Z24); + for (i = 0; i < count; i++) { + if (!mask || mask[i]) { + temp[i] = (temp[i] & 0xffffff) | (val << 24); + } } } dsrb->PutValues(ctx, dsrb, count, x, y, temp, mask); @@ -465,7 +635,8 @@ _mesa_new_s8_renderbuffer_wrapper(GLcontext *ctx, struct gl_renderbuffer *dsrb) { struct gl_renderbuffer *s8rb; - ASSERT(dsrb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); + ASSERT(dsrb->Format == MESA_FORMAT_Z24_S8 || + dsrb->Format == MESA_FORMAT_S8_Z24); ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); s8rb = _mesa_new_renderbuffer(ctx, 0); @@ -478,10 +649,9 @@ _mesa_new_s8_renderbuffer_wrapper(GLcontext *ctx, struct gl_renderbuffer *dsrb) s8rb->Width = dsrb->Width; s8rb->Height = dsrb->Height; s8rb->InternalFormat = GL_STENCIL_INDEX8_EXT; - s8rb->_ActualFormat = GL_STENCIL_INDEX8_EXT; + s8rb->Format = MESA_FORMAT_S8; s8rb->_BaseFormat = GL_STENCIL_INDEX; s8rb->DataType = GL_UNSIGNED_BYTE; - s8rb->StencilBits = 8; s8rb->Data = NULL; s8rb->Delete = delete_wrapper; s8rb->AllocStorage = alloc_wrapper_storage; @@ -528,10 +698,10 @@ _mesa_extract_stencil(GLcontext *ctx, ASSERT(dsRb); ASSERT(stencilRb); - ASSERT(dsRb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); + ASSERT(dsRb->Format == MESA_FORMAT_Z24_S8); ASSERT(dsRb->DataType == GL_UNSIGNED_INT_24_8_EXT); - ASSERT(stencilRb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT || - stencilRb->_ActualFormat == GL_STENCIL_INDEX8_EXT); + ASSERT(stencilRb->Format == MESA_FORMAT_Z24_S8 || + stencilRb->Format == MESA_FORMAT_S8); ASSERT(dsRb->Width == stencilRb->Width); ASSERT(dsRb->Height == stencilRb->Height); @@ -541,7 +711,7 @@ _mesa_extract_stencil(GLcontext *ctx, for (row = 0; row < height; row++) { GLuint depthStencil[MAX_WIDTH]; dsRb->GetRow(ctx, dsRb, width, 0, row, depthStencil); - if (stencilRb->_ActualFormat == GL_STENCIL_INDEX8_EXT) { + if (stencilRb->Format == MESA_FORMAT_S8) { /* 8bpp stencil */ GLubyte stencil[MAX_WIDTH]; GLuint i; @@ -553,7 +723,7 @@ _mesa_extract_stencil(GLcontext *ctx, else { /* 32bpp stencil */ /* the 24 depth bits will be ignored */ - ASSERT(stencilRb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); + ASSERT(stencilRb->Format == MESA_FORMAT_Z24_S8); ASSERT(stencilRb->DataType == GL_UNSIGNED_INT_24_8_EXT); stencilRb->PutRow(ctx, stencilRb, width, 0, row, depthStencil, NULL); } @@ -577,10 +747,10 @@ _mesa_insert_stencil(GLcontext *ctx, ASSERT(dsRb); ASSERT(stencilRb); - ASSERT(dsRb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); + ASSERT(dsRb->Format == MESA_FORMAT_Z24_S8); ASSERT(dsRb->DataType == GL_UNSIGNED_INT_24_8_EXT); - ASSERT(stencilRb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT || - stencilRb->_ActualFormat == GL_STENCIL_INDEX8_EXT); + ASSERT(stencilRb->Format == MESA_FORMAT_Z24_S8 || + stencilRb->Format == MESA_FORMAT_S8); ASSERT(dsRb->Width == stencilRb->Width); ASSERT(dsRb->Height == stencilRb->Height); @@ -593,7 +763,7 @@ _mesa_insert_stencil(GLcontext *ctx, dsRb->GetRow(ctx, dsRb, width, 0, row, depthStencil); - if (stencilRb->_ActualFormat == GL_STENCIL_INDEX8_EXT) { + if (stencilRb->Format == MESA_FORMAT_S8) { /* 8bpp stencil */ GLubyte stencil[MAX_WIDTH]; GLuint i; @@ -605,7 +775,7 @@ _mesa_insert_stencil(GLcontext *ctx, else { /* 32bpp stencil buffer */ GLuint stencil[MAX_WIDTH], i; - ASSERT(stencilRb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT); + ASSERT(stencilRb->Format == MESA_FORMAT_Z24_S8); ASSERT(stencilRb->DataType == GL_UNSIGNED_INT_24_8_EXT); stencilRb->GetRow(ctx, stencilRb, width, 0, row, stencil); for (i = 0; i < width; i++) { @@ -631,7 +801,7 @@ _mesa_promote_stencil(GLcontext *ctx, struct gl_renderbuffer *stencilRb) GLubyte *data; GLint i, j, k; - ASSERT(stencilRb->_ActualFormat == GL_STENCIL_INDEX8_EXT); + ASSERT(stencilRb->Format == MESA_FORMAT_S8); ASSERT(stencilRb->Data); data = (GLubyte *) stencilRb->Data; @@ -650,6 +820,4 @@ _mesa_promote_stencil(GLcontext *ctx, struct gl_renderbuffer *stencilRb) stencilRb->PutRow(ctx, stencilRb, width, 0, i, depthStencil, NULL); } _mesa_free(data); - - stencilRb->_BaseFormat = GL_DEPTH_STENCIL_EXT; } diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 6610725de8..c2b7458f57 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -48,7 +48,7 @@ /** Set this to 1 to help debug FBO incompleteness problems */ -#define DEBUG_FBO 0 +#define DEBUG_FBO 1 /** @@ -416,10 +416,9 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format, } else { ASSERT(format == GL_STENCIL); - ASSERT(att->Renderbuffer->StencilBits); if (ctx->Extensions.EXT_packed_depth_stencil && ctx->Extensions.ARB_depth_texture && - att->Renderbuffer->_BaseFormat == GL_DEPTH_STENCIL_EXT) { + baseFormat == GL_DEPTH_STENCIL_EXT) { /* OK */ } else { @@ -431,6 +430,9 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format, } } else if (att->Type == GL_RENDERBUFFER_EXT) { + const GLenum baseFormat = + _mesa_get_format_base_format(att->Renderbuffer->Format); + ASSERT(att->Renderbuffer); if (!att->Renderbuffer->InternalFormat || att->Renderbuffer->Width < 1 || @@ -440,24 +442,19 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format, return; } if (format == GL_COLOR) { - if (att->Renderbuffer->_BaseFormat != GL_RGB && - att->Renderbuffer->_BaseFormat != GL_RGBA) { + if (baseFormat != GL_RGB && + baseFormat != GL_RGBA) { att_incomplete("bad renderbuffer color format"); att->Complete = GL_FALSE; return; } - ASSERT(att->Renderbuffer->RedBits); - ASSERT(att->Renderbuffer->GreenBits); - ASSERT(att->Renderbuffer->BlueBits); } else if (format == GL_DEPTH) { - if (att->Renderbuffer->_BaseFormat == GL_DEPTH_COMPONENT) { - ASSERT(att->Renderbuffer->DepthBits); + if (baseFormat == GL_DEPTH_COMPONENT) { /* OK */ } else if (ctx->Extensions.EXT_packed_depth_stencil && - att->Renderbuffer->_BaseFormat == GL_DEPTH_STENCIL_EXT) { - ASSERT(att->Renderbuffer->DepthBits); + baseFormat == GL_DEPTH_STENCIL_EXT) { /* OK */ } else { @@ -468,13 +465,11 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format, } else { assert(format == GL_STENCIL); - if (att->Renderbuffer->_BaseFormat == GL_STENCIL_INDEX) { - ASSERT(att->Renderbuffer->StencilBits); + if (baseFormat == GL_STENCIL_INDEX) { /* OK */ } else if (ctx->Extensions.EXT_packed_depth_stencil && - att->Renderbuffer->_BaseFormat == GL_DEPTH_STENCIL_EXT) { - ASSERT(att->Renderbuffer->StencilBits); + baseFormat == GL_DEPTH_STENCIL_EXT) { /* OK */ } else { @@ -980,42 +975,27 @@ renderbuffer_storage(GLenum target, GLenum internalFormat, } /* These MUST get set by the AllocStorage func */ - rb->_ActualFormat = 0; - rb->RedBits = - rb->GreenBits = - rb->BlueBits = - rb->AlphaBits = - rb->IndexBits = - rb->DepthBits = - rb->StencilBits = 0; + rb->Format = MESA_FORMAT_NONE; rb->NumSamples = samples; /* Now allocate the storage */ ASSERT(rb->AllocStorage); if (rb->AllocStorage(ctx, rb, internalFormat, width, height)) { /* No error - check/set fields now */ - assert(rb->_ActualFormat); + assert(rb->Format != MESA_FORMAT_NONE); assert(rb->Width == (GLuint) width); assert(rb->Height == (GLuint) height); - assert(rb->RedBits || rb->GreenBits || rb->BlueBits || rb->AlphaBits || - rb->DepthBits || rb->StencilBits || rb->IndexBits); rb->InternalFormat = internalFormat; - rb->_BaseFormat = baseFormat; + rb->_BaseFormat = _mesa_base_fbo_format(ctx, internalFormat); + assert(rb->_BaseFormat != 0); } else { /* Probably ran out of memory - clear the fields */ rb->Width = 0; rb->Height = 0; + rb->Format = MESA_FORMAT_NONE; rb->InternalFormat = GL_NONE; - rb->_ActualFormat = GL_NONE; rb->_BaseFormat = GL_NONE; - rb->RedBits = - rb->GreenBits = - rb->BlueBits = - rb->AlphaBits = - rb->IndexBits = - rb->DepthBits = - rb->StencilBits = rb->NumSamples = 0; } @@ -1028,6 +1008,53 @@ renderbuffer_storage(GLenum target, GLenum internalFormat, } +/** + * Helper function for _mesa_GetRenderbufferParameterivEXT() and + * _mesa_GetFramebufferAttachmentParameterivEXT() + * We have to be careful to respect the base format. For example, if a + * renderbuffer/texture was created with internalFormat=GL_RGB but the + * driver actually chose a GL_RGBA format, when the user queries ALPHA_SIZE + * we need to return zero. + */ +static GLint +get_component_bits(GLenum pname, GLenum baseFormat, gl_format format) +{ + switch (pname) { + case GL_RENDERBUFFER_RED_SIZE_EXT: + case GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE: + case GL_RENDERBUFFER_GREEN_SIZE_EXT: + case GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: + case GL_RENDERBUFFER_BLUE_SIZE_EXT: + case GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: + if (baseFormat == GL_RGB || baseFormat == GL_RGBA) + return _mesa_get_format_bits(format, pname); + else + return 0; + case GL_RENDERBUFFER_ALPHA_SIZE_EXT: + case GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: + if (baseFormat == GL_RGBA || baseFormat == GL_ALPHA) + return _mesa_get_format_bits(format, pname); + else + return 0; + case GL_RENDERBUFFER_DEPTH_SIZE_EXT: + case GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: + if (baseFormat == GL_DEPTH_COMPONENT || baseFormat == GL_DEPTH_STENCIL) + return _mesa_get_format_bits(format, pname); + else + return 0; + case GL_RENDERBUFFER_STENCIL_SIZE_EXT: + case GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: + if (baseFormat == GL_STENCIL_INDEX || baseFormat == GL_DEPTH_STENCIL) + return _mesa_get_format_bits(format, pname); + else + return 0; + default: + return 0; + } +} + + + void GLAPIENTRY _mesa_RenderbufferStorageEXT(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height) @@ -1084,22 +1111,12 @@ _mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params) *params = rb->InternalFormat; return; case GL_RENDERBUFFER_RED_SIZE_EXT: - *params = rb->RedBits; - break; case GL_RENDERBUFFER_GREEN_SIZE_EXT: - *params = rb->GreenBits; - break; case GL_RENDERBUFFER_BLUE_SIZE_EXT: - *params = rb->BlueBits; - break; case GL_RENDERBUFFER_ALPHA_SIZE_EXT: - *params = rb->AlphaBits; - break; case GL_RENDERBUFFER_DEPTH_SIZE_EXT: - *params = rb->DepthBits; - break; case GL_RENDERBUFFER_STENCIL_SIZE_EXT: - *params = rb->StencilBits; + *params = get_component_bits(pname, rb->_BaseFormat, rb->Format); break; case GL_RENDERBUFFER_SAMPLES: if (ctx->Extensions.ARB_framebuffer_object) { @@ -1706,7 +1723,9 @@ _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment, if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) { /* make sure the renderbuffer is a depth/stencil format */ - if (rb->_BaseFormat != GL_DEPTH_STENCIL) { + const GLenum baseFormat = + _mesa_get_format_base_format(att->Renderbuffer->Format); + if (baseFormat != GL_DEPTH_STENCIL) { _mesa_error(ctx, GL_INVALID_OPERATION, "glFramebufferRenderbufferEXT(renderbuffer" " is not DEPTH_STENCIL format)"); @@ -1862,7 +1881,7 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, "glGetFramebufferAttachmentParameterivEXT(pname)"); } else { - *params = att->Renderbuffer->ColorEncoding; + *params = _mesa_get_format_color_encoding(att->Renderbuffer->Format); } return; case GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE: @@ -1872,61 +1891,44 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, return; } else { - *params = att->Renderbuffer->ComponentType; + gl_format format = att->Renderbuffer->Format; + if (format == MESA_FORMAT_CI8 || format == MESA_FORMAT_S8) { + /* special cases */ + *params = GL_INDEX; + } + else { + *params = _mesa_get_format_datatype(format); + } } return; case GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE: - if (!ctx->Extensions.ARB_framebuffer_object) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(pname)"); - } - else { - *params = att->Renderbuffer->RedBits; - } - return; case GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE: - if (!ctx->Extensions.ARB_framebuffer_object) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(pname)"); - } - else { - *params = att->Renderbuffer->GreenBits; - } - return; case GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE: - if (!ctx->Extensions.ARB_framebuffer_object) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(pname)"); - } - else { - *params = att->Renderbuffer->BlueBits; - } - return; case GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE: - if (!ctx->Extensions.ARB_framebuffer_object) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(pname)"); - } - else { - *params = att->Renderbuffer->AlphaBits; - } - return; case GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE: + case GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: if (!ctx->Extensions.ARB_framebuffer_object) { _mesa_error(ctx, GL_INVALID_ENUM, "glGetFramebufferAttachmentParameterivEXT(pname)"); } - else { - *params = att->Renderbuffer->DepthBits; + else if (att->Texture) { + const struct gl_texture_image *texImage = + _mesa_select_tex_image(ctx, att->Texture, att->Texture->Target, + att->TextureLevel); + if (texImage) { + *params = get_component_bits(pname, texImage->_BaseFormat, + texImage->TexFormat); + } + else { + *params = 0; + } } - return; - case GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE: - if (!ctx->Extensions.ARB_framebuffer_object) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glGetFramebufferAttachmentParameterivEXT(pname)"); + else if (att->Renderbuffer) { + *params = get_component_bits(pname, att->Renderbuffer->_BaseFormat, + att->Renderbuffer->Format); } else { - *params = att->Renderbuffer->StencilBits; + *params = 0; } return; default: @@ -2053,7 +2055,8 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, struct gl_renderbuffer *drawRb = drawFb->_StencilBuffer; if (!readRb || !drawRb || - readRb->StencilBits != drawRb->StencilBits) { + _mesa_get_format_bits(readRb->Format, GL_STENCIL_BITS) != + _mesa_get_format_bits(drawRb->Format, GL_STENCIL_BITS)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glBlitFramebufferEXT(stencil buffer size mismatch"); return; @@ -2065,7 +2068,8 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, struct gl_renderbuffer *drawRb = drawFb->_DepthBuffer; if (!readRb || !drawRb || - readRb->DepthBits != drawRb->DepthBits) { + _mesa_get_format_bits(readRb->Format, GL_DEPTH_BITS) != + _mesa_get_format_bits(drawRb->Format, GL_DEPTH_BITS)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glBlitFramebufferEXT(depth buffer size mismatch"); return; @@ -2093,7 +2097,7 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, /* color formats must match */ if (colorReadRb && colorDrawRb && - colorReadRb->_ActualFormat != colorDrawRb->_ActualFormat) { + colorReadRb->Format != colorDrawRb->Format) { _mesa_error(ctx, GL_INVALID_OPERATION, "glBlitFramebufferEXT(bad src/dst multisample pixel formats"); return; diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index dc79b8ca61..154dedacd5 100644 --- a/src/mesa/main/framebuffer.c +++ b/src/mesa/main/framebuffer.c @@ -35,6 +35,7 @@ #include "buffers.h" #include "context.h" #include "depthstencil.h" +#include "formats.h" #include "macros.h" #include "mtypes.h" #include "fbobject.h" @@ -281,7 +282,6 @@ _mesa_resize_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb, struct gl_renderbuffer *rb = att->Renderbuffer; /* only resize if size is changing */ if (rb->Width != width || rb->Height != height) { - /* could just as well pass rb->_ActualFormat here */ if (rb->AllocStorage(ctx, rb, rb->InternalFormat, width, height)) { ASSERT(rb->Width == width); ASSERT(rb->Height == height); @@ -523,19 +523,22 @@ _mesa_update_framebuffer_visual(struct gl_framebuffer *fb) for (i = 0; i < BUFFER_COUNT; i++) { if (fb->Attachment[i].Renderbuffer) { const struct gl_renderbuffer *rb = fb->Attachment[i].Renderbuffer; - if (rb->_BaseFormat == GL_RGBA || rb->_BaseFormat == GL_RGB) { - fb->Visual.redBits = rb->RedBits; - fb->Visual.greenBits = rb->GreenBits; - fb->Visual.blueBits = rb->BlueBits; - fb->Visual.alphaBits = rb->AlphaBits; + const GLenum baseFormat = _mesa_get_format_base_format(rb->Format); + const gl_format fmt = rb->Format; + + if (baseFormat == GL_RGBA || baseFormat == GL_RGB) { + fb->Visual.redBits = _mesa_get_format_bits(fmt, GL_RED_BITS); + fb->Visual.greenBits = _mesa_get_format_bits(fmt, GL_GREEN_BITS); + fb->Visual.blueBits = _mesa_get_format_bits(fmt, GL_BLUE_BITS); + fb->Visual.alphaBits = _mesa_get_format_bits(fmt, GL_ALPHA_BITS); fb->Visual.rgbBits = fb->Visual.redBits + fb->Visual.greenBits + fb->Visual.blueBits; fb->Visual.floatMode = GL_FALSE; fb->Visual.samples = rb->NumSamples; break; } - else if (rb->_BaseFormat == GL_COLOR_INDEX) { - fb->Visual.indexBits = rb->IndexBits; + else if (baseFormat == GL_COLOR_INDEX) { + fb->Visual.indexBits = _mesa_get_format_bits(fmt, GL_INDEX_BITS); fb->Visual.rgbMode = GL_FALSE; break; } @@ -543,27 +546,30 @@ _mesa_update_framebuffer_visual(struct gl_framebuffer *fb) } if (fb->Attachment[BUFFER_DEPTH].Renderbuffer) { + const struct gl_renderbuffer *rb = + fb->Attachment[BUFFER_DEPTH].Renderbuffer; + const gl_format fmt = rb->Format; fb->Visual.haveDepthBuffer = GL_TRUE; - fb->Visual.depthBits - = fb->Attachment[BUFFER_DEPTH].Renderbuffer->DepthBits; + fb->Visual.depthBits = _mesa_get_format_bits(fmt, GL_DEPTH_BITS); } if (fb->Attachment[BUFFER_STENCIL].Renderbuffer) { + const struct gl_renderbuffer *rb = + fb->Attachment[BUFFER_STENCIL].Renderbuffer; + const gl_format fmt = rb->Format; fb->Visual.haveStencilBuffer = GL_TRUE; - fb->Visual.stencilBits - = fb->Attachment[BUFFER_STENCIL].Renderbuffer->StencilBits; + fb->Visual.stencilBits = _mesa_get_format_bits(fmt, GL_STENCIL_BITS); } if (fb->Attachment[BUFFER_ACCUM].Renderbuffer) { + const struct gl_renderbuffer *rb = + fb->Attachment[BUFFER_ACCUM].Renderbuffer; + const gl_format fmt = rb->Format; fb->Visual.haveAccumBuffer = GL_TRUE; - fb->Visual.accumRedBits - = fb->Attachment[BUFFER_ACCUM].Renderbuffer->RedBits; - fb->Visual.accumGreenBits - = fb->Attachment[BUFFER_ACCUM].Renderbuffer->GreenBits; - fb->Visual.accumBlueBits - = fb->Attachment[BUFFER_ACCUM].Renderbuffer->BlueBits; - fb->Visual.accumAlphaBits - = fb->Attachment[BUFFER_ACCUM].Renderbuffer->AlphaBits; + fb->Visual.accumRedBits = _mesa_get_format_bits(fmt, GL_RED_BITS); + fb->Visual.accumGreenBits = _mesa_get_format_bits(fmt, GL_GREEN_BITS); + fb->Visual.accumBlueBits = _mesa_get_format_bits(fmt, GL_BLUE_BITS); + fb->Visual.accumAlphaBits = _mesa_get_format_bits(fmt, GL_ALPHA_BITS); } compute_depth_max(fb); @@ -592,11 +598,11 @@ _mesa_update_depth_buffer(GLcontext *ctx, depthRb = fb->Attachment[attIndex].Renderbuffer; - if (depthRb && depthRb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT) { + if (depthRb && depthRb->_BaseFormat == GL_DEPTH_STENCIL) { /* The attached depth buffer is a GL_DEPTH_STENCIL renderbuffer */ if (!fb->_DepthBuffer || fb->_DepthBuffer->Wrapped != depthRb - || fb->_DepthBuffer->_BaseFormat != GL_DEPTH_COMPONENT) { + || _mesa_get_format_base_format(fb->_DepthBuffer->Format) != GL_DEPTH_COMPONENT) { /* need to update wrapper */ struct gl_renderbuffer *wrapper = _mesa_new_z24_renderbuffer_wrapper(ctx, depthRb); @@ -633,11 +639,11 @@ _mesa_update_stencil_buffer(GLcontext *ctx, stencilRb = fb->Attachment[attIndex].Renderbuffer; - if (stencilRb && stencilRb->_ActualFormat == GL_DEPTH24_STENCIL8_EXT) { + if (stencilRb && stencilRb->_BaseFormat == GL_DEPTH_STENCIL) { /* The attached stencil buffer is a GL_DEPTH_STENCIL renderbuffer */ if (!fb->_StencilBuffer || fb->_StencilBuffer->Wrapped != stencilRb - || fb->_StencilBuffer->_BaseFormat != GL_STENCIL_INDEX) { + || _mesa_get_format_base_format(fb->_StencilBuffer->Format) != GL_STENCIL_INDEX) { /* need to update wrapper */ struct gl_renderbuffer *wrapper = _mesa_new_s8_renderbuffer_wrapper(ctx, stencilRb); @@ -854,30 +860,32 @@ _mesa_source_buffer_exists(GLcontext *ctx, GLenum format) if (ctx->ReadBuffer->_ColorReadBuffer == NULL) { return GL_FALSE; } - ASSERT(ctx->ReadBuffer->_ColorReadBuffer->RedBits > 0 || - ctx->ReadBuffer->_ColorReadBuffer->IndexBits > 0); + ASSERT(_mesa_get_format_bits(ctx->ReadBuffer->_ColorReadBuffer->Format, GL_RED_BITS) > 0 || + _mesa_get_format_bits(ctx->ReadBuffer->_ColorReadBuffer->Format, GL_INDEX_BITS) > 0); break; case GL_DEPTH: case GL_DEPTH_COMPONENT: if (!att[BUFFER_DEPTH].Renderbuffer) { return GL_FALSE; } - ASSERT(att[BUFFER_DEPTH].Renderbuffer->DepthBits > 0); + /*ASSERT(att[BUFFER_DEPTH].Renderbuffer->DepthBits > 0);*/ break; case GL_STENCIL: case GL_STENCIL_INDEX: if (!att[BUFFER_STENCIL].Renderbuffer) { return GL_FALSE; } - ASSERT(att[BUFFER_STENCIL].Renderbuffer->StencilBits > 0); + /*ASSERT(att[BUFFER_STENCIL].Renderbuffer->StencilBits > 0);*/ break; case GL_DEPTH_STENCIL_EXT: if (!att[BUFFER_DEPTH].Renderbuffer || !att[BUFFER_STENCIL].Renderbuffer) { return GL_FALSE; } + /* ASSERT(att[BUFFER_DEPTH].Renderbuffer->DepthBits > 0); ASSERT(att[BUFFER_STENCIL].Renderbuffer->StencilBits > 0); + */ break; default: _mesa_problem(ctx, @@ -932,22 +940,24 @@ _mesa_dest_buffer_exists(GLcontext *ctx, GLenum format) if (!att[BUFFER_DEPTH].Renderbuffer) { return GL_FALSE; } - ASSERT(att[BUFFER_DEPTH].Renderbuffer->DepthBits > 0); + /*ASSERT(att[BUFFER_DEPTH].Renderbuffer->DepthBits > 0);*/ break; case GL_STENCIL: case GL_STENCIL_INDEX: if (!att[BUFFER_STENCIL].Renderbuffer) { return GL_FALSE; } - ASSERT(att[BUFFER_STENCIL].Renderbuffer->StencilBits > 0); + /*ASSERT(att[BUFFER_STENCIL].Renderbuffer->StencilBits > 0);*/ break; case GL_DEPTH_STENCIL_EXT: if (!att[BUFFER_DEPTH].Renderbuffer || !att[BUFFER_STENCIL].Renderbuffer) { return GL_FALSE; } + /* ASSERT(att[BUFFER_DEPTH].Renderbuffer->DepthBits > 0); ASSERT(att[BUFFER_STENCIL].Renderbuffer->StencilBits > 0); + */ break; default: _mesa_problem(ctx, diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 8e6e0d09be..5bbb12ea70 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2089,19 +2089,9 @@ struct gl_renderbuffer GLint RefCount; GLuint Width, Height; GLenum InternalFormat; /**< The user-specified format */ - GLenum _ActualFormat; /**< The driver-chosen format */ GLenum _BaseFormat; /**< Either GL_RGB, GL_RGBA, GL_DEPTH_COMPONENT or GL_STENCIL_INDEX. */ - GLenum ColorEncoding; /**< GL_LINEAR or GL_SRGB */ - GLenum ComponentType; /**< GL_FLOAT, GL_INT, GL_UNSIGNED_INT, - GL_UNSIGNED_NORMALIZED or GL_INDEX */ - GLubyte RedBits; /**< Bits of red per pixel */ - GLubyte GreenBits; - GLubyte BlueBits; - GLubyte AlphaBits; - GLubyte IndexBits; - GLubyte DepthBits; - GLubyte StencilBits; + GLuint Format; /**< The actual format: MESA_FORMAT_x */ GLubyte NumSamples; GLenum DataType; /**< Type of values passed to the Get/Put functions */ diff --git a/src/mesa/main/rbadaptors.c b/src/mesa/main/rbadaptors.c index c1ac0606c8..1060c5796e 100644 --- a/src/mesa/main/rbadaptors.c +++ b/src/mesa/main/rbadaptors.c @@ -218,14 +218,10 @@ _mesa_new_renderbuffer_16wrap8(GLcontext *ctx, struct gl_renderbuffer *rb8) _glthread_UNLOCK_MUTEX(rb8->Mutex); rb16->InternalFormat = rb8->InternalFormat; - rb16->_ActualFormat = rb8->_ActualFormat; + rb16->Format = rb8->Format; /* XXX is this right? */ rb16->_BaseFormat = rb8->_BaseFormat; rb16->DataType = GL_UNSIGNED_SHORT; /* Note: passing through underlying bits/channel */ - rb16->RedBits = rb8->RedBits; - rb16->GreenBits = rb8->GreenBits; - rb16->BlueBits = rb8->BlueBits; - rb16->AlphaBits = rb8->AlphaBits; rb16->Wrapped = rb8; rb16->AllocStorage = AllocStorage_wrapper; @@ -385,14 +381,10 @@ _mesa_new_renderbuffer_32wrap8(GLcontext *ctx, struct gl_renderbuffer *rb8) _glthread_UNLOCK_MUTEX(rb8->Mutex); rb32->InternalFormat = rb8->InternalFormat; - rb32->_ActualFormat = rb8->_ActualFormat; + rb32->Format = rb8->Format; /* XXX is this right? */ rb32->_BaseFormat = rb8->_BaseFormat; rb32->DataType = GL_FLOAT; /* Note: passing through underlying bits/channel */ - rb32->RedBits = rb8->RedBits; - rb32->GreenBits = rb8->GreenBits; - rb32->BlueBits = rb8->BlueBits; - rb32->AlphaBits = rb8->AlphaBits; rb32->Wrapped = rb8; rb32->AllocStorage = AllocStorage_wrapper; @@ -552,14 +544,10 @@ _mesa_new_renderbuffer_32wrap16(GLcontext *ctx, struct gl_renderbuffer *rb16) _glthread_UNLOCK_MUTEX(rb16->Mutex); rb32->InternalFormat = rb16->InternalFormat; - rb32->_ActualFormat = rb16->_ActualFormat; + rb32->Format = rb16->Format; /* XXX is this right? */ rb32->_BaseFormat = rb16->_BaseFormat; rb32->DataType = GL_FLOAT; /* Note: passing through underlying bits/channel */ - rb32->RedBits = rb16->RedBits; - rb32->GreenBits = rb16->GreenBits; - rb32->BlueBits = rb16->BlueBits; - rb32->AlphaBits = rb16->AlphaBits; rb32->Wrapped = rb16; rb32->AllocStorage = AllocStorage_wrapper; diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c index 38be8266e0..409fd8634a 100644 --- a/src/mesa/main/renderbuffer.c +++ b/src/mesa/main/renderbuffer.c @@ -43,6 +43,8 @@ #include "glheader.h" #include "imports.h" #include "context.h" +#include "fbobject.h" +#include "formats.h" #include "mtypes.h" #include "fbobject.h" #include "renderbuffer.h" @@ -72,7 +74,7 @@ get_pointer_ubyte(GLcontext *ctx, struct gl_renderbuffer *rb, if (!rb->Data) return NULL; ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - /* Can't assert _ActualFormat since these funcs may be used for serveral + /* Can't assert rb->Format since these funcs may be used for serveral * different formats (GL_ALPHA8, GL_STENCIL_INDEX8, etc). */ return (GLubyte *) rb->Data + y * rb->Width + x; @@ -448,7 +450,7 @@ static void * get_pointer_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, GLint x, GLint y) { - ASSERT(rb->_ActualFormat == GL_RGB8); + ASSERT(rb->Format == MESA_FORMAT_RGB888); /* No direct access since this buffer is RGB but caller will be * treating it as if it were RGBA. */ @@ -463,7 +465,7 @@ get_row_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, const GLubyte *src = (const GLubyte *) rb->Data + 3 * (y * rb->Width + x); GLubyte *dst = (GLubyte *) values; GLuint i; - ASSERT(rb->_ActualFormat == GL_RGB8); + ASSERT(rb->Format == MESA_FORMAT_RGB888); ASSERT(rb->DataType == GL_UNSIGNED_BYTE); for (i = 0; i < count; i++) { dst[i * 4 + 0] = src[i * 3 + 0]; @@ -480,7 +482,7 @@ get_values_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, { GLubyte *dst = (GLubyte *) values; GLuint i; - ASSERT(rb->_ActualFormat == GL_RGB8); + ASSERT(rb->Format == MESA_FORMAT_RGB888); ASSERT(rb->DataType == GL_UNSIGNED_BYTE); for (i = 0; i < count; i++) { const GLubyte *src @@ -501,7 +503,7 @@ put_row_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, const GLubyte *src = (const GLubyte *) values; GLubyte *dst = (GLubyte *) rb->Data + 3 * (y * rb->Width + x); GLuint i; - ASSERT(rb->_ActualFormat == GL_RGB8); + ASSERT(rb->Format == MESA_FORMAT_RGB888); ASSERT(rb->DataType == GL_UNSIGNED_BYTE); for (i = 0; i < count; i++) { if (!mask || mask[i]) { @@ -521,7 +523,7 @@ put_row_rgb_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, const GLubyte *src = (const GLubyte *) values; GLubyte *dst = (GLubyte *) rb->Data + 3 * (y * rb->Width + x); GLuint i; - ASSERT(rb->_ActualFormat == GL_RGB8); + ASSERT(rb->Format == MESA_FORMAT_RGB888); ASSERT(rb->DataType == GL_UNSIGNED_BYTE); for (i = 0; i < count; i++) { if (!mask || mask[i]) { @@ -542,7 +544,7 @@ put_mono_row_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, const GLubyte val1 = ((const GLubyte *) value)[1]; const GLubyte val2 = ((const GLubyte *) value)[2]; GLubyte *dst = (GLubyte *) rb->Data + 3 * (y * rb->Width + x); - ASSERT(rb->_ActualFormat == GL_RGB8); + ASSERT(rb->Format == MESA_FORMAT_RGB888); ASSERT(rb->DataType == GL_UNSIGNED_BYTE); if (!mask && val0 == val1 && val1 == val2) { /* optimized case */ @@ -569,7 +571,7 @@ put_values_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, /* note: incoming values are RGB+A! */ const GLubyte *src = (const GLubyte *) values; GLuint i; - ASSERT(rb->_ActualFormat == GL_RGB8); + ASSERT(rb->Format == MESA_FORMAT_RGB888); ASSERT(rb->DataType == GL_UNSIGNED_BYTE); for (i = 0; i < count; i++) { if (!mask || mask[i]) { @@ -592,7 +594,7 @@ put_mono_values_ubyte3(GLcontext *ctx, struct gl_renderbuffer *rb, const GLubyte val1 = ((const GLubyte *) value)[1]; const GLubyte val2 = ((const GLubyte *) value)[2]; GLuint i; - ASSERT(rb->_ActualFormat == GL_RGB8); + ASSERT(rb->Format == MESA_FORMAT_RGB888); ASSERT(rb->DataType == GL_UNSIGNED_BYTE); for (i = 0; i < count; i++) { if (!mask || mask[i]) { @@ -617,7 +619,7 @@ get_pointer_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, if (!rb->Data) return NULL; ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(rb->_ActualFormat == GL_RGBA8); + ASSERT(rb->Format == MESA_FORMAT_RGBA8888); return (GLubyte *) rb->Data + 4 * (y * rb->Width + x); } @@ -628,7 +630,7 @@ get_row_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, { const GLubyte *src = (const GLubyte *) rb->Data + 4 * (y * rb->Width + x); ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(rb->_ActualFormat == GL_RGBA8); + ASSERT(rb->Format == MESA_FORMAT_RGBA8888); _mesa_memcpy(values, src, 4 * count * sizeof(GLubyte)); } @@ -641,7 +643,7 @@ get_values_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, GLuint *dst = (GLuint *) values; GLuint i; ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(rb->_ActualFormat == GL_RGBA8); + ASSERT(rb->Format == MESA_FORMAT_RGBA8888); for (i = 0; i < count; i++) { const GLuint *src = (GLuint *) rb->Data + (y[i] * rb->Width + x[i]); dst[i] = *src; @@ -657,7 +659,7 @@ put_row_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, const GLuint *src = (const GLuint *) values; GLuint *dst = (GLuint *) rb->Data + (y * rb->Width + x); ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(rb->_ActualFormat == GL_RGBA8); + ASSERT(rb->Format == MESA_FORMAT_RGBA8888); if (mask) { GLuint i; for (i = 0; i < count; i++) { @@ -681,7 +683,7 @@ put_row_rgb_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, GLubyte *dst = (GLubyte *) rb->Data + 4 * (y * rb->Width + x); GLuint i; ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(rb->_ActualFormat == GL_RGBA8); + ASSERT(rb->Format == MESA_FORMAT_RGBA8888); for (i = 0; i < count; i++) { if (!mask || mask[i]) { dst[i * 4 + 0] = src[i * 3 + 0]; @@ -701,7 +703,7 @@ put_mono_row_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, const GLuint val = *((const GLuint *) value); GLuint *dst = (GLuint *) rb->Data + (y * rb->Width + x); ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(rb->_ActualFormat == GL_RGBA8); + ASSERT(rb->Format == MESA_FORMAT_RGBA8888); if (!mask && val == 0) { /* common case */ _mesa_bzero(dst, count * 4 * sizeof(GLubyte)); @@ -735,7 +737,7 @@ put_values_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, GLuint count, const GLuint *src = (const GLuint *) values; GLuint i; ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(rb->_ActualFormat == GL_RGBA8); + ASSERT(rb->Format == MESA_FORMAT_RGBA8888); for (i = 0; i < count; i++) { if (!mask || mask[i]) { GLuint *dst = (GLuint *) rb->Data + (y[i] * rb->Width + x[i]); @@ -754,7 +756,7 @@ put_mono_values_ubyte4(GLcontext *ctx, struct gl_renderbuffer *rb, const GLuint val = *((const GLuint *) value); GLuint i; ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(rb->_ActualFormat == GL_RGBA8); + ASSERT(rb->Format == MESA_FORMAT_RGBA8888); for (i = 0; i < count; i++) { if (!mask || mask[i]) { GLuint *dst = (GLuint *) rb->Data + (y[i] * rb->Width + x[i]); @@ -947,15 +949,6 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, { GLuint pixelSize; - /* first clear these fields */ - rb->RedBits = - rb->GreenBits = - rb->BlueBits = - rb->AlphaBits = - rb->IndexBits = - rb->DepthBits = - rb->StencilBits = 0; - switch (internalFormat) { case GL_RGB: case GL_R3_G3_B2: @@ -965,8 +958,7 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, case GL_RGB10: case GL_RGB12: case GL_RGB16: - rb->_ActualFormat = GL_RGB8; - rb->_BaseFormat = GL_RGB; + rb->Format = MESA_FORMAT_RGB888; rb->DataType = GL_UNSIGNED_BYTE; rb->GetPointer = get_pointer_ubyte3; rb->GetRow = get_row_ubyte3; @@ -976,10 +968,6 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->PutMonoRow = put_mono_row_ubyte3; rb->PutValues = put_values_ubyte3; rb->PutMonoValues = put_mono_values_ubyte3; - rb->RedBits = 8 * sizeof(GLubyte); - rb->GreenBits = 8 * sizeof(GLubyte); - rb->BlueBits = 8 * sizeof(GLubyte); - rb->AlphaBits = 0; pixelSize = 3 * sizeof(GLubyte); break; case GL_RGBA: @@ -987,8 +975,11 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, case GL_RGBA4: case GL_RGB5_A1: case GL_RGBA8: - rb->_ActualFormat = GL_RGBA8; - rb->_BaseFormat = GL_RGBA; +#if 1 + case GL_RGB10_A2: + case GL_RGBA12: +#endif + rb->Format = MESA_FORMAT_RGBA8888; rb->DataType = GL_UNSIGNED_BYTE; rb->GetPointer = get_pointer_ubyte4; rb->GetRow = get_row_ubyte4; @@ -998,18 +989,12 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->PutMonoRow = put_mono_row_ubyte4; rb->PutValues = put_values_ubyte4; rb->PutMonoValues = put_mono_values_ubyte4; - rb->RedBits = 8 * sizeof(GLubyte); - rb->GreenBits = 8 * sizeof(GLubyte); - rb->BlueBits = 8 * sizeof(GLubyte); - rb->AlphaBits = 8 * sizeof(GLubyte); pixelSize = 4 * sizeof(GLubyte); break; - case GL_RGB10_A2: - case GL_RGBA12: case GL_RGBA16: - rb->_ActualFormat = GL_RGBA16; - rb->_BaseFormat = GL_RGBA; - rb->DataType = GL_UNSIGNED_SHORT; + /* for accum buffer */ + rb->Format = MESA_FORMAT_SIGNED_RGBA_16; + rb->DataType = GL_SHORT; rb->GetPointer = get_pointer_ushort4; rb->GetRow = get_row_ushort4; rb->GetValues = get_values_ushort4; @@ -1018,16 +1003,11 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->PutMonoRow = put_mono_row_ushort4; rb->PutValues = put_values_ushort4; rb->PutMonoValues = put_mono_values_ushort4; - rb->RedBits = 8 * sizeof(GLushort); - rb->GreenBits = 8 * sizeof(GLushort); - rb->BlueBits = 8 * sizeof(GLushort); - rb->AlphaBits = 8 * sizeof(GLushort); pixelSize = 4 * sizeof(GLushort); break; -#if 00 +#if 0 case GL_ALPHA8: - rb->_ActualFormat = GL_ALPHA8; - rb->_BaseFormat = GL_RGBA; /* Yes, not GL_ALPHA! */ + rb->Format = MESA_FORMAT_A8; rb->DataType = GL_UNSIGNED_BYTE; rb->GetPointer = get_pointer_alpha8; rb->GetRow = get_row_alpha8; @@ -1037,10 +1017,6 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->PutMonoRow = put_mono_row_alpha8; rb->PutValues = put_values_alpha8; rb->PutMonoValues = put_mono_values_alpha8; - rb->RedBits = 0; /*red*/ - rb->GreenBits = 0; /*green*/ - rb->BlueBits = 0; /*blue*/ - rb->AlphaBits = 8 * sizeof(GLubyte); pixelSize = sizeof(GLubyte); break; #endif @@ -1048,8 +1024,8 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, case GL_STENCIL_INDEX1_EXT: case GL_STENCIL_INDEX4_EXT: case GL_STENCIL_INDEX8_EXT: - rb->_ActualFormat = GL_STENCIL_INDEX8_EXT; - rb->_BaseFormat = GL_STENCIL_INDEX; + case GL_STENCIL_INDEX16_EXT: + rb->Format = MESA_FORMAT_S8; rb->DataType = GL_UNSIGNED_BYTE; rb->GetPointer = get_pointer_ubyte; rb->GetRow = get_row_ubyte; @@ -1059,28 +1035,11 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->PutMonoRow = put_mono_row_ubyte; rb->PutValues = put_values_ubyte; rb->PutMonoValues = put_mono_values_ubyte; - rb->StencilBits = 8 * sizeof(GLubyte); pixelSize = sizeof(GLubyte); break; - case GL_STENCIL_INDEX16_EXT: - rb->_ActualFormat = GL_STENCIL_INDEX16_EXT; - rb->_BaseFormat = GL_STENCIL_INDEX; - rb->DataType = GL_UNSIGNED_SHORT; - rb->GetPointer = get_pointer_ushort; - rb->GetRow = get_row_ushort; - rb->GetValues = get_values_ushort; - rb->PutRow = put_row_ushort; - rb->PutRowRGB = NULL; - rb->PutMonoRow = put_mono_row_ushort; - rb->PutValues = put_values_ushort; - rb->PutMonoValues = put_mono_values_ushort; - rb->StencilBits = 8 * sizeof(GLushort); - pixelSize = sizeof(GLushort); - break; case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT16: - rb->_ActualFormat = GL_DEPTH_COMPONENT16; - rb->_BaseFormat = GL_DEPTH_COMPONENT; + rb->Format = MESA_FORMAT_Z16; rb->DataType = GL_UNSIGNED_SHORT; rb->GetPointer = get_pointer_ushort; rb->GetRow = get_row_ushort; @@ -1090,12 +1049,10 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->PutMonoRow = put_mono_row_ushort; rb->PutValues = put_values_ushort; rb->PutMonoValues = put_mono_values_ushort; - rb->DepthBits = 8 * sizeof(GLushort); pixelSize = sizeof(GLushort); break; case GL_DEPTH_COMPONENT24: case GL_DEPTH_COMPONENT32: - rb->_BaseFormat = GL_DEPTH_COMPONENT; rb->DataType = GL_UNSIGNED_INT; rb->GetPointer = get_pointer_uint; rb->GetRow = get_row_uint; @@ -1105,20 +1062,12 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->PutMonoRow = put_mono_row_uint; rb->PutValues = put_values_uint; rb->PutMonoValues = put_mono_values_uint; - if (internalFormat == GL_DEPTH_COMPONENT24) { - rb->_ActualFormat = GL_DEPTH_COMPONENT24; - rb->DepthBits = 24; - } - else { - rb->_ActualFormat = GL_DEPTH_COMPONENT32; - rb->DepthBits = 32; - } + rb->Format = MESA_FORMAT_Z32; pixelSize = sizeof(GLuint); break; case GL_DEPTH_STENCIL_EXT: case GL_DEPTH24_STENCIL8_EXT: - rb->_ActualFormat = GL_DEPTH24_STENCIL8_EXT; - rb->_BaseFormat = GL_DEPTH_STENCIL_EXT; + rb->Format = MESA_FORMAT_Z24_S8; rb->DataType = GL_UNSIGNED_INT_24_8_EXT; rb->GetPointer = get_pointer_uint; rb->GetRow = get_row_uint; @@ -1128,13 +1077,12 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->PutMonoRow = put_mono_row_uint; rb->PutValues = put_values_uint; rb->PutMonoValues = put_mono_values_uint; - rb->DepthBits = 24; - rb->StencilBits = 8; pixelSize = sizeof(GLuint); break; case GL_COLOR_INDEX8_EXT: - rb->_ActualFormat = GL_COLOR_INDEX8_EXT; - rb->_BaseFormat = GL_COLOR_INDEX; + case GL_COLOR_INDEX16_EXT: + case COLOR_INDEX32: + rb->Format = MESA_FORMAT_CI8; rb->DataType = GL_UNSIGNED_BYTE; rb->GetPointer = get_pointer_ubyte; rb->GetRow = get_row_ubyte; @@ -1144,39 +1092,8 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->PutMonoRow = put_mono_row_ubyte; rb->PutValues = put_values_ubyte; rb->PutMonoValues = put_mono_values_ubyte; - rb->IndexBits = 8 * sizeof(GLubyte); pixelSize = sizeof(GLubyte); break; - case GL_COLOR_INDEX16_EXT: - rb->_ActualFormat = GL_COLOR_INDEX16_EXT; - rb->_BaseFormat = GL_COLOR_INDEX; - rb->DataType = GL_UNSIGNED_SHORT; - rb->GetPointer = get_pointer_ushort; - rb->GetRow = get_row_ushort; - rb->GetValues = get_values_ushort; - rb->PutRow = put_row_ushort; - rb->PutRowRGB = NULL; - rb->PutMonoRow = put_mono_row_ushort; - rb->PutValues = put_values_ushort; - rb->PutMonoValues = put_mono_values_ushort; - rb->IndexBits = 8 * sizeof(GLushort); - pixelSize = sizeof(GLushort); - break; - case COLOR_INDEX32: - rb->_ActualFormat = COLOR_INDEX32; - rb->_BaseFormat = GL_COLOR_INDEX; - rb->DataType = GL_UNSIGNED_INT; - rb->GetPointer = get_pointer_uint; - rb->GetRow = get_row_uint; - rb->GetValues = get_values_uint; - rb->PutRow = put_row_uint; - rb->PutRowRGB = NULL; - rb->PutMonoRow = put_mono_row_uint; - rb->PutValues = put_values_uint; - rb->PutMonoValues = put_mono_values_uint; - rb->IndexBits = 8 * sizeof(GLuint); - pixelSize = sizeof(GLuint); - break; default: _mesa_problem(ctx, "Bad internalFormat in _mesa_soft_renderbuffer_storage"); return GL_FALSE; @@ -1213,6 +1130,7 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, rb->Width = width; rb->Height = height; + rb->_BaseFormat = _mesa_base_fbo_format(ctx, rb->InternalFormat); return GL_TRUE; } @@ -1239,7 +1157,7 @@ alloc_storage_alpha8(GLcontext *ctx, struct gl_renderbuffer *arb, GLenum internalFormat, GLuint width, GLuint height) { ASSERT(arb != arb->Wrapped); - ASSERT(arb->_ActualFormat == GL_ALPHA8); + ASSERT(arb->Format == MESA_FORMAT_A8); /* first, pass the call to the wrapped RGB buffer */ if (!arb->Wrapped->AllocStorage(ctx, arb->Wrapped, internalFormat, @@ -1439,8 +1357,8 @@ put_mono_values_alpha8(GLcontext *ctx, struct gl_renderbuffer *arb, static void copy_buffer_alpha8(struct gl_renderbuffer* dst, struct gl_renderbuffer* src) { - ASSERT(dst->_ActualFormat == GL_ALPHA8); - ASSERT(src->_ActualFormat == GL_ALPHA8); + ASSERT(dst->Format == MESA_FORMAT_A8); + ASSERT(src->Format == MESA_FORMAT_A8); ASSERT(dst->Width == src->Width); ASSERT(dst->Height == src->Height); @@ -1486,16 +1404,7 @@ _mesa_init_renderbuffer(struct gl_renderbuffer *rb, GLuint name) rb->Width = 0; rb->Height = 0; rb->InternalFormat = GL_NONE; - rb->_ActualFormat = GL_NONE; - rb->_BaseFormat = GL_NONE; - - rb->ComponentType = GL_UNSIGNED_NORMALIZED; /* ARB_fbo */ - rb->ColorEncoding = GL_LINEAR; /* ARB_fbo */ - - rb->RedBits = rb->GreenBits = rb->BlueBits = rb->AlphaBits = 0; - rb->IndexBits = 0; - rb->DepthBits = 0; - rb->StencilBits = 0; + rb->Format = MESA_FORMAT_NONE; rb->DataType = GL_NONE; rb->Data = NULL; @@ -1612,18 +1521,15 @@ _mesa_add_color_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb, if (rgbBits <= 8) { if (alphaBits) - rb->_ActualFormat = GL_RGBA8; + rb->Format = MESA_FORMAT_RGBA8888; else - rb->_ActualFormat = GL_RGB8; + rb->Format = MESA_FORMAT_RGB888; } else { assert(rgbBits <= 16); - if (alphaBits) - rb->_ActualFormat = GL_RGBA16; - else - rb->_ActualFormat = GL_RGBA16; /* don't really have RGB16 yet */ + rb->Format = MESA_FORMAT_NONE; /*XXX RGBA16;*/ } - rb->InternalFormat = rb->_ActualFormat; + rb->InternalFormat = GL_RGBA; rb->AllocStorage = _mesa_soft_renderbuffer_storage; _mesa_add_renderbuffer(fb, b, rb); @@ -1677,15 +1583,9 @@ _mesa_add_color_index_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb, return GL_FALSE; } - if (indexBits <= 8) { - /* only support GLuint for now */ - /*rb->InternalFormat = GL_COLOR_INDEX8_EXT;*/ - rb->_ActualFormat = COLOR_INDEX32; - } - else { - rb->_ActualFormat = COLOR_INDEX32; - } - rb->InternalFormat = rb->_ActualFormat; + assert(indexBits <= 8); + rb->Format = MESA_FORMAT_CI8; + rb->InternalFormat = GL_COLOR_INDEX; rb->AllocStorage = _mesa_soft_renderbuffer_storage; _mesa_add_renderbuffer(fb, b, rb); @@ -1758,8 +1658,7 @@ _mesa_add_alpha_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb, * values. */ arb->InternalFormat = arb->Wrapped->InternalFormat; - arb->_ActualFormat = GL_ALPHA8; - arb->_BaseFormat = arb->Wrapped->_BaseFormat; + arb->Format = MESA_FORMAT_A8; arb->DataType = arb->Wrapped->DataType; arb->AllocStorage = alloc_storage_alpha8; arb->Delete = delete_renderbuffer_alpha8; @@ -1833,15 +1732,13 @@ _mesa_add_depth_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb, } if (depthBits <= 16) { - rb->_ActualFormat = GL_DEPTH_COMPONENT16; - } - else if (depthBits <= 24) { - rb->_ActualFormat = GL_DEPTH_COMPONENT24; + rb->Format = MESA_FORMAT_Z16; + rb->InternalFormat = GL_DEPTH_COMPONENT16; } else { - rb->_ActualFormat = GL_DEPTH_COMPONENT32; + rb->Format = MESA_FORMAT_Z32; + rb->InternalFormat = GL_DEPTH_COMPONENT32; } - rb->InternalFormat = rb->_ActualFormat; rb->AllocStorage = _mesa_soft_renderbuffer_storage; _mesa_add_renderbuffer(fb, BUFFER_DEPTH, rb); @@ -1878,14 +1775,9 @@ _mesa_add_stencil_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb, return GL_FALSE; } - if (stencilBits <= 8) { - rb->_ActualFormat = GL_STENCIL_INDEX8_EXT; - } - else { - /* not really supported (see s_stencil.c code) */ - rb->_ActualFormat = GL_STENCIL_INDEX16_EXT; - } - rb->InternalFormat = rb->_ActualFormat; + assert(stencilBits <= 8); + rb->Format = MESA_FORMAT_S8; + rb->InternalFormat = GL_STENCIL_INDEX8; rb->AllocStorage = _mesa_soft_renderbuffer_storage; _mesa_add_renderbuffer(fb, BUFFER_STENCIL, rb); @@ -1923,7 +1815,7 @@ _mesa_add_accum_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb, return GL_FALSE; } - rb->_ActualFormat = GL_RGBA16; + rb->Format = MESA_FORMAT_SIGNED_RGBA_16; rb->InternalFormat = GL_RGBA16; rb->AllocStorage = _mesa_soft_renderbuffer_storage; _mesa_add_renderbuffer(fb, BUFFER_ACCUM, rb); @@ -1967,13 +1859,9 @@ _mesa_add_aux_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb, return GL_FALSE; } - if (colorBits <= 8) { - rb->_ActualFormat = GL_RGBA8; - } - else { - rb->_ActualFormat = GL_RGBA16; - } - rb->InternalFormat = rb->_ActualFormat; + assert (colorBits <= 8); + rb->Format = MESA_FORMAT_RGBA8888; + rb->InternalFormat = GL_RGBA; rb->AllocStorage = _mesa_soft_renderbuffer_storage; _mesa_add_renderbuffer(fb, BUFFER_AUX0 + i, rb); @@ -2071,6 +1959,8 @@ void _mesa_add_renderbuffer(struct gl_framebuffer *fb, GLuint bufferName, struct gl_renderbuffer *rb) { + GLenum baseFormat; + assert(fb); assert(rb); assert(bufferName < BUFFER_COUNT); @@ -2095,7 +1985,8 @@ _mesa_add_renderbuffer(struct gl_framebuffer *fb, * and the device driver is expecting 8-bit values (GLubyte), we can * use a "renderbuffer adaptor/wrapper" to do the necessary conversions. */ - if (rb->_BaseFormat == GL_RGBA) { + baseFormat = _mesa_get_format_base_format(rb->Format); + if (baseFormat == GL_RGBA) { if (CHAN_BITS == 16 && rb->DataType == GL_UNSIGNED_BYTE) { GET_CURRENT_CONTEXT(ctx); rb = _mesa_new_renderbuffer_16wrap8(ctx, rb); @@ -2202,7 +2093,7 @@ _mesa_new_depthstencil_renderbuffer(GLcontext *ctx, GLuint name) /* init fields not covered by _mesa_new_renderbuffer() */ dsrb->InternalFormat = GL_DEPTH24_STENCIL8_EXT; - dsrb->_ActualFormat = GL_DEPTH24_STENCIL8_EXT; + dsrb->Format = MESA_FORMAT_Z24_S8; dsrb->AllocStorage = _mesa_soft_renderbuffer_storage; return dsrb; diff --git a/src/mesa/main/texrender.c b/src/mesa/main/texrender.c index c8b532acbb..e2432be6ca 100644 --- a/src/mesa/main/texrender.c +++ b/src/mesa/main/texrender.c @@ -497,30 +497,23 @@ update_wrapper(GLcontext *ctx, const struct gl_renderbuffer_attachment *att) trb->Base.InternalFormat = trb->TexImage->InternalFormat; /* XXX may need more special cases here */ if (trb->TexImage->TexFormat == MESA_FORMAT_Z24_S8) { - trb->Base._ActualFormat = GL_DEPTH24_STENCIL8_EXT; + trb->Base.Format = MESA_FORMAT_Z24_S8; trb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT; } else if (trb->TexImage->TexFormat == MESA_FORMAT_Z16) { - trb->Base._ActualFormat = GL_DEPTH_COMPONENT; + trb->Base.Format = MESA_FORMAT_Z16; trb->Base.DataType = GL_UNSIGNED_SHORT; } else if (trb->TexImage->TexFormat == MESA_FORMAT_Z32) { - trb->Base._ActualFormat = GL_DEPTH_COMPONENT; + trb->Base.Format = MESA_FORMAT_Z32; trb->Base.DataType = GL_UNSIGNED_INT; } else { - trb->Base._ActualFormat = trb->TexImage->InternalFormat; + trb->Base.Format = trb->TexImage->TexFormat; trb->Base.DataType = CHAN_TYPE; } - trb->Base._BaseFormat = trb->TexImage->_BaseFormat; trb->Base.Data = trb->TexImage->Data; - - trb->Base.RedBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_RED_SIZE); - trb->Base.GreenBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_GREEN_SIZE); - trb->Base.BlueBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_BLUE_SIZE); - trb->Base.AlphaBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_ALPHA_SIZE); - trb->Base.DepthBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_DEPTH_SIZE_ARB); - trb->Base.StencilBits = _mesa_get_format_bits(texFormat, GL_TEXTURE_STENCIL_SIZE_EXT); + trb->Base._BaseFormat = _mesa_base_fbo_format(ctx, trb->Base.InternalFormat); } diff --git a/src/mesa/state_tracker/st_cb_clear.c b/src/mesa/state_tracker/st_cb_clear.c index 8a8c99f7e1..f015b12368 100644 --- a/src/mesa/state_tracker/st_cb_clear.c +++ b/src/mesa/state_tracker/st_cb_clear.c @@ -34,6 +34,7 @@ */ #include "main/glheader.h" +#include "main/formats.h" #include "main/macros.h" #include "shader/prog_instruction.h" #include "st_context.h" @@ -300,10 +301,14 @@ check_clear_color_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb) static INLINE GLboolean check_clear_depth_stencil_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb) { - const GLuint stencilMax = (1 << rb->StencilBits) - 1; + const GLuint stencilMax = 0xff; GLboolean maskStencil = (ctx->Stencil.WriteMask[0] & stencilMax) != stencilMax; + assert(rb->Format == MESA_FORMAT_S8 || + rb->Format == MESA_FORMAT_Z24_S8 || + rb->Format == MESA_FORMAT_S8_Z24); + if (ctx->Scissor.Enabled && (ctx->Scissor.X != 0 || ctx->Scissor.Y != 0 || @@ -350,10 +355,14 @@ check_clear_stencil_with_quad(GLcontext *ctx, struct gl_renderbuffer *rb) { const struct st_renderbuffer *strb = st_renderbuffer(rb); const GLboolean isDS = pf_is_depth_and_stencil(strb->surface->format); - const GLuint stencilMax = (1 << rb->StencilBits) - 1; + const GLuint stencilMax = 0xff; const GLboolean maskStencil = (ctx->Stencil.WriteMask[0] & stencilMax) != stencilMax; + assert(rb->Format == MESA_FORMAT_S8 || + rb->Format == MESA_FORMAT_Z24_S8 || + rb->Format == MESA_FORMAT_S8_Z24); + if (maskStencil) return TRUE; diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index fe0a121493..7899d745aa 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -64,13 +64,7 @@ init_renderbuffer_bits(struct st_renderbuffer *strb, assert( 0 ); } - strb->Base._ActualFormat = info.base_format; - strb->Base.RedBits = info.red_bits; - strb->Base.GreenBits = info.green_bits; - strb->Base.BlueBits = info.blue_bits; - strb->Base.AlphaBits = info.alpha_bits; - strb->Base.DepthBits = info.depth_bits; - strb->Base.StencilBits = info.stencil_bits; + strb->Base.Format = info.mesa_format; strb->Base.DataType = st_format_datatype(pipeFormat); return info.size; @@ -270,30 +264,24 @@ st_new_renderbuffer_fb(enum pipe_format format, int samples, boolean sw) case PIPE_FORMAT_A4R4G4B4_UNORM: case PIPE_FORMAT_R5G6B5_UNORM: strb->Base.InternalFormat = GL_RGBA; - strb->Base._BaseFormat = GL_RGBA; break; case PIPE_FORMAT_Z16_UNORM: strb->Base.InternalFormat = GL_DEPTH_COMPONENT16; - strb->Base._BaseFormat = GL_DEPTH_COMPONENT; break; case PIPE_FORMAT_Z32_UNORM: strb->Base.InternalFormat = GL_DEPTH_COMPONENT32; - strb->Base._BaseFormat = GL_DEPTH_COMPONENT; break; case PIPE_FORMAT_S8Z24_UNORM: case PIPE_FORMAT_Z24S8_UNORM: case PIPE_FORMAT_X8Z24_UNORM: case PIPE_FORMAT_Z24X8_UNORM: strb->Base.InternalFormat = GL_DEPTH24_STENCIL8_EXT; - strb->Base._BaseFormat = GL_DEPTH_STENCIL_EXT; break; case PIPE_FORMAT_S8_UNORM: strb->Base.InternalFormat = GL_STENCIL_INDEX8_EXT; - strb->Base._BaseFormat = GL_STENCIL_INDEX; break; case PIPE_FORMAT_R16G16B16A16_SNORM: strb->Base.InternalFormat = GL_RGBA16; - strb->Base._BaseFormat = GL_RGBA; break; default: _mesa_problem(NULL, diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index dc3ab61425..01b8e5fd77 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -31,6 +31,7 @@ #include "main/convolve.h" #endif #include "main/enums.h" +#include "main/formats.h" #include "main/image.h" #include "main/imports.h" #include "main/macros.h" @@ -1397,8 +1398,8 @@ static unsigned compatible_src_dst_formats(const struct gl_renderbuffer *src, const struct gl_texture_image *dst) { - const GLenum srcFormat = src->_BaseFormat; - const GLenum dstLogicalFormat = dst->_BaseFormat; + const GLenum srcFormat = _mesa_get_format_base_format(src->Format); + const GLenum dstLogicalFormat = _mesa_get_format_base_format(dst->TexFormat); if (srcFormat == dstLogicalFormat) { /* This is the same as matching_base_formats, which should @@ -1524,7 +1525,9 @@ st_copy_texsubimage(GLcontext *ctx, * framebuffer's alpha values). We can't do that with the blit or * textured-quad paths. */ - matching_base_formats = (strb->Base._BaseFormat == texImage->_BaseFormat); + matching_base_formats = + (_mesa_get_format_base_format(strb->Base.Format) == + _mesa_get_format_base_format(texImage->TexFormat)); format_writemask = compatible_src_dst_formats(&strb->Base, texImage); if (ctx->_ImageTransferState == 0x0) { diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index 6f76e2d8c0..aa71b91ec8 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -99,10 +99,11 @@ st_get_format_info(enum pipe_format format, struct pipe_format_info *pinfo) if (format == PIPE_FORMAT_A1R5G5B5_UNORM || format == PIPE_FORMAT_R5G6B5_UNORM) { pinfo->datatype = GL_UNSIGNED_SHORT; } + else if (format == PIPE_FORMAT_S8Z24_UNORM) { + pinfo->datatype = GL_UNSIGNED_INT_24_8; + } else { - GLuint size; - - size = format_max_bits( info ); + const GLuint size = format_max_bits( info ); if (size == 8) { if (pf_type(info) == PIPE_FORMAT_TYPE_UNORM) pinfo->datatype = GL_UNSIGNED_BYTE; @@ -150,24 +151,10 @@ st_get_format_info(enum pipe_format format, struct pipe_format_info *pinfo) pinfo->red_bits = 0; } - /* Base format */ - if (pinfo->depth_bits) { - if (pinfo->stencil_bits) { - pinfo->base_format = GL_DEPTH_STENCIL_EXT; - } - else { - pinfo->base_format = GL_DEPTH_COMPONENT; - } - } - else if (pinfo->stencil_bits) { - pinfo->base_format = GL_STENCIL_INDEX; - } - else { - pinfo->base_format = GL_RGBA; - } + pinfo->mesa_format = st_pipe_format_to_mesa_format(format); } else if (pf_layout(format) == PIPE_FORMAT_LAYOUT_YCBCR) { - pinfo->base_format = GL_YCBCR_MESA; + pinfo->mesa_format = MESA_FORMAT_YCBCR; pinfo->datatype = GL_UNSIGNED_SHORT; pinfo->size = 2; /* two bytes per "texel" */ } @@ -224,7 +211,7 @@ st_format_datatype(enum pipe_format format) enum pipe_format -st_mesa_format_to_pipe_format(GLuint mesaFormat) +st_mesa_format_to_pipe_format(gl_format mesaFormat) { switch (mesaFormat) { /* fix this */ @@ -293,6 +280,82 @@ st_mesa_format_to_pipe_format(GLuint mesaFormat) } } + +gl_format +st_pipe_format_to_mesa_format(enum pipe_format pipeFormat) +{ + switch (pipeFormat) { + case PIPE_FORMAT_A8R8G8B8_UNORM: + return MESA_FORMAT_ARGB8888; + case PIPE_FORMAT_A1R5G5B5_UNORM: + return MESA_FORMAT_ARGB1555; + case PIPE_FORMAT_A4R4G4B4_UNORM: + return MESA_FORMAT_ARGB4444; + case PIPE_FORMAT_R5G6B5_UNORM: + return MESA_FORMAT_RGB565; + case PIPE_FORMAT_A8L8_UNORM: + return MESA_FORMAT_AL88; + case PIPE_FORMAT_A8_UNORM: + return MESA_FORMAT_A8; + case PIPE_FORMAT_L8_UNORM: + return MESA_FORMAT_L8; + case PIPE_FORMAT_I8_UNORM: + return MESA_FORMAT_I8; + case PIPE_FORMAT_Z16_UNORM: + return MESA_FORMAT_Z16; + case PIPE_FORMAT_Z32_UNORM: + return MESA_FORMAT_Z32; + case PIPE_FORMAT_Z24S8_UNORM: + return MESA_FORMAT_Z24_S8; + case PIPE_FORMAT_S8Z24_UNORM: + return MESA_FORMAT_S8_Z24; + case PIPE_FORMAT_S8_UNORM: + return MESA_FORMAT_S8; + + case PIPE_FORMAT_YCBCR: + return MESA_FORMAT_YCBCR; + case PIPE_FORMAT_R16G16B16A16_SNORM: + return MESA_FORMAT_SIGNED_RGBA_16; + +#if FEATURE_texture_s3tc + case PIPE_FORMAT_DXT1_RGB: + return MESA_FORMAT_RGB_DXT1; + case PIPE_FORMAT_DXT1_RGBA: + return MESA_FORMAT_RGBA_DXT1; + case PIPE_FORMAT_DXT3_RGBA: + return MESA_FORMAT_RGBA_DXT3; + case PIPE_FORMAT_DXT5_RGBA: + return MESA_FORMAT_RGBA_DXT5; +#if FEATURE_EXT_texture_sRGB + case PIPE_FORMAT_DXT1_SRGB: + return MESA_FORMAT_SRGB_DXT1; + case PIPE_FORMAT_DXT1_SRGBA: + return MESA_FORMAT_SRGBA_DXT1; + case PIPE_FORMAT_DXT3_SRGBA: + return MESA_FORMAT_SRGBA_DXT3; + case PIPE_FORMAT_DXT5_SRGBA: + return MESA_FORMAT_SRGBA_DXT5; +#endif +#endif +#if FEATURE_EXT_texture_sRGB + case PIPE_FORMAT_A8L8_SRGB: + return MESA_FORMAT_SLA8; + case PIPE_FORMAT_L8_SRGB: + return MESA_FORMAT_SL8; + case PIPE_FORMAT_R8G8B8_SRGB: + return MESA_FORMAT_SRGB8; + case PIPE_FORMAT_R8G8B8A8_SRGB: + return MESA_FORMAT_SRGBA8; + case PIPE_FORMAT_A8R8G8B8_SRGB: + return MESA_FORMAT_SARGB8; +#endif + default: + assert(0); + return 0; + } +} + + /** * Find an RGBA format supported by the context/winsys. */ diff --git a/src/mesa/state_tracker/st_format.h b/src/mesa/state_tracker/st_format.h index 1a8c6ea98f..97422bb199 100644 --- a/src/mesa/state_tracker/st_format.h +++ b/src/mesa/state_tracker/st_format.h @@ -34,7 +34,7 @@ struct pipe_format_info { enum pipe_format format; - GLenum base_format; + gl_format mesa_format; GLenum datatype; GLubyte red_bits; GLubyte green_bits; @@ -61,7 +61,10 @@ st_format_datatype(enum pipe_format format); extern enum pipe_format -st_mesa_format_to_pipe_format(GLuint mesaFormat); +st_mesa_format_to_pipe_format(gl_format mesaFormat); + +extern gl_format +st_pipe_format_to_mesa_format(enum pipe_format pipeFormat); extern enum pipe_format diff --git a/src/mesa/swrast/s_clear.c b/src/mesa/swrast/s_clear.c index 35080fd394..002718ded8 100644 --- a/src/mesa/swrast/s_clear.c +++ b/src/mesa/swrast/s_clear.c @@ -24,6 +24,7 @@ #include "main/glheader.h" #include "main/colormac.h" +#include "main/formats.h" #include "main/macros.h" #include "main/imports.h" #include "main/mtypes.h" @@ -211,9 +212,6 @@ clear_ci_buffer(GLcontext *ctx, struct gl_renderbuffer *rb) ASSERT(!ctx->Visual.rgbMode); - ASSERT((ctx->Color.IndexMask & ((1 << rb->IndexBits) - 1)) - == (GLuint) ((1 << rb->IndexBits) - 1)); - ASSERT(rb->PutMonoRow); /* setup clear value */ @@ -264,8 +262,8 @@ clear_color_buffers(GLcontext *ctx) } else { struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0]; - const GLuint indexBits = (1 << rb->IndexBits) - 1; - if ((ctx->Color.IndexMask & indexBits) == indexBits) { + const GLuint indexMask = (1 << _mesa_get_format_bits(rb->Format, GL_INDEX_BITS)) - 1; + if ((ctx->Color.IndexMask & indexMask) == indexMask) { masking = GL_FALSE; } else { diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c index 1a428fb1a2..8073a61197 100644 --- a/src/mesa/swrast/s_depth.c +++ b/src/mesa/swrast/s_depth.c @@ -25,6 +25,7 @@ #include "main/glheader.h" #include "main/context.h" +#include "main/formats.h" #include "main/macros.h" #include "main/imports.h" #include "main/fbobject.h" @@ -1298,11 +1299,15 @@ void _swrast_read_depth_span_uint( GLcontext *ctx, struct gl_renderbuffer *rb, GLint n, GLint x, GLint y, GLuint depth[] ) { + GLuint depthBits; + if (!rb) { /* really only doing this to prevent FP exceptions later */ _mesa_bzero(depth, n * sizeof(GLfloat)); } + depthBits = _mesa_get_format_bits(rb->Format, GL_DEPTH_BITS); + ASSERT(rb->_BaseFormat == GL_DEPTH_COMPONENT); if (y < 0 || y >= (GLint) rb->Height || @@ -1334,8 +1339,8 @@ _swrast_read_depth_span_uint( GLcontext *ctx, struct gl_renderbuffer *rb, if (rb->DataType == GL_UNSIGNED_INT) { rb->GetRow(ctx, rb, n, x, y, depth); - if (rb->DepthBits < 32) { - GLuint shift = 32 - rb->DepthBits; + if (depthBits < 32) { + GLuint shift = 32 - depthBits; GLint i; for (i = 0; i < n; i++) { GLuint z = depth[i]; @@ -1347,14 +1352,14 @@ _swrast_read_depth_span_uint( GLcontext *ctx, struct gl_renderbuffer *rb, GLushort temp[MAX_WIDTH]; GLint i; rb->GetRow(ctx, rb, n, x, y, temp); - if (rb->DepthBits == 16) { + if (depthBits == 16) { for (i = 0; i < n; i++) { GLuint z = temp[i]; depth[i] = (z << 16) | z; } } else { - GLuint shift = 16 - rb->DepthBits; + GLuint shift = 16 - depthBits; for (i = 0; i < n; i++) { GLuint z = temp[i]; depth[i] = (z << (shift + 16)) | (z << shift); /* XXX lsb bits? */ diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index f28f2c9307..005d7a4c82 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -891,7 +891,7 @@ fast_persp_span(GLcontext *ctx, SWspan *span, return; \ } #define RENDER_SPAN( span ) \ - if (rb->DepthBits <= 16) { \ + if (rb->Format == MESA_FORMAT_Z16) { \ GLuint i; \ const GLushort *zRow = (const GLushort *) \ rb->GetPointer(ctx, rb, span.x, span.y); \ -- cgit v1.2.3 From ce64e063a8b32d842a3b5dfe62178e9e4cd89f9c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 9 Oct 2009 13:22:00 -0600 Subject: mesa: fix incorrect assertion in _mesa_add_aux_renderbuffers() Fixes bug 24426. --- src/mesa/main/renderbuffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c index 38be8266e0..5bef7c84fb 100644 --- a/src/mesa/main/renderbuffer.c +++ b/src/mesa/main/renderbuffer.c @@ -1955,7 +1955,7 @@ _mesa_add_aux_renderbuffers(GLcontext *ctx, struct gl_framebuffer *fb, return GL_FALSE; } - assert(numBuffers < MAX_AUX_BUFFERS); + assert(numBuffers <= MAX_AUX_BUFFERS); for (i = 0; i < numBuffers; i++) { struct gl_renderbuffer *rb = _mesa_new_renderbuffer(ctx, 0); -- cgit v1.2.3 From 6164f1fe790def9f3ca4f1f555ef59bbaa82db90 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 9 Oct 2009 13:20:28 -0600 Subject: st/mesa: create aux buffers according to visual Fixes bug 24426 for gallium. --- src/mesa/state_tracker/st_framebuffer.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_framebuffer.c b/src/mesa/state_tracker/st_framebuffer.c index 5c0d335d62..a5d1ae3b03 100644 --- a/src/mesa/state_tracker/st_framebuffer.c +++ b/src/mesa/state_tracker/st_framebuffer.c @@ -52,6 +52,7 @@ st_create_framebuffer( const __GLcontextModes *visual, struct st_framebuffer *stfb = ST_CALLOC_STRUCT(st_framebuffer); if (stfb) { int samples = st_get_msaa(); + int i; if (visual->sampleBuffers) samples = visual->samples; @@ -119,6 +120,12 @@ st_create_framebuffer( const __GLcontextModes *visual, _mesa_add_renderbuffer(&stfb->Base, BUFFER_ACCUM, accumRb); } + for (i = 0; i < visual->numAuxBuffers; i++) { + struct gl_renderbuffer *aux + = st_new_renderbuffer_fb(colorFormat, 0, FALSE); + _mesa_add_renderbuffer(&stfb->Base, BUFFER_AUX0 + i, aux); + } + stfb->Base.Initialized = GL_TRUE; stfb->InitWidth = width; stfb->InitHeight = height; -- cgit v1.2.3 From 194ede4bf97547ce8a61587ede0b0a5054955783 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Fri, 9 Oct 2009 15:44:32 -0400 Subject: radeon: fix scissor regression fixes fdo bug 24248 --- src/mesa/drivers/dri/r600/r700_state.c | 10 +++++++--- src/mesa/drivers/dri/radeon/radeon_common.c | 9 ++++----- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index 124469b5a6..98f116d0a6 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -1269,11 +1269,15 @@ void r700SetScissor(context_t *context) //--------------- return; } if (context->radeon.state.scissor.enabled) { - /* r600 has exclusive scissors */ x1 = context->radeon.state.scissor.rect.x1; y1 = context->radeon.state.scissor.rect.y1; - x2 = context->radeon.state.scissor.rect.x2 + 1; - y2 = context->radeon.state.scissor.rect.y2 + 1; + x2 = context->radeon.state.scissor.rect.x2; + y2 = context->radeon.state.scissor.rect.y2; + /* r600 has exclusive BR scissors */ + if (context->radeon.radeonScreen->kernel_mm) { + x2++; + y2++; + } } else { if (context->radeon.radeonScreen->driScreen->dri2.enabled) { x1 = 0; diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c b/src/mesa/drivers/dri/radeon/radeon_common.c index 9817ff856b..8032cbcd69 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common.c +++ b/src/mesa/drivers/dri/radeon/radeon_common.c @@ -229,16 +229,15 @@ void radeonUpdateScissor( GLcontext *ctx ) } if (!rmesa->radeonScreen->kernel_mm) { /* Fix scissors for dri 1 */ - __DRIdrawablePrivate *dPriv = radeon_get_drawable(rmesa); x1 += dPriv->x; - x2 += dPriv->x; + x2 += dPriv->x + 1; min_x += dPriv->x; - max_x += dPriv->x; + max_x += dPriv->x + 1; y1 += dPriv->y; - y2 += dPriv->y; + y2 += dPriv->y + 1; min_y += dPriv->y; - max_y += dPriv->y; + max_y += dPriv->y + 1; } rmesa->state.scissor.rect.x1 = CLAMP(x1, min_x, max_x); -- cgit v1.2.3 From a82da7fa263c7fb6b902285994136890e6dc3278 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sun, 11 Oct 2009 11:04:09 -0700 Subject: i965: Fix the bounds emitted in the vertex buffer packets. It's the address of the last valid byte, not the address of the first invalid byte. This should also fix problems with rendering with the new sanity checks in the kernel. --- src/mesa/drivers/dri/i965/brw_draw_upload.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index 4aa17fa02d..5c33246749 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -539,12 +539,12 @@ static void brw_emit_vertices(struct brw_context *brw) if (input->stride) { OUT_RELOC(input->bo, I915_GEM_DOMAIN_VERTEX, 0, - input->offset + input->stride * input->count); + input->offset + input->stride * input->count - 1); } else { assert(input->count == 1); OUT_RELOC(input->bo, I915_GEM_DOMAIN_VERTEX, 0, - input->offset + input->element_size); + input->offset + input->element_size - 1); } } else OUT_BATCH(input->stride ? input->count : 0); -- cgit v1.2.3 From f3be27c0cf8a4c47230f31d9d66bde7340ffb204 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sun, 11 Oct 2009 11:16:03 -0700 Subject: i965: Fix the last valid address setting for the index buffer. Again, last valid address, not first invalid address. Fixes regression in 255e5be265133280293bbfd8b2f9b74b2dec50bb that the kernel now catches and caused piglit draw_elements_base_vertex to fail. --- src/mesa/drivers/dri/i965/brw_draw_upload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index 5c33246749..9d089e113e 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -726,7 +726,7 @@ static void brw_emit_index_buffer(struct brw_context *brw) brw->ib.offset); OUT_RELOC(brw->ib.bo, I915_GEM_DOMAIN_VERTEX, 0, - brw->ib.offset + brw->ib.size); + brw->ib.offset + brw->ib.size - 1); OUT_BATCH( 0 ); ADVANCE_BATCH(); } -- cgit v1.2.3 From 97dd35bd6f2e2654b96923fd06bf9761e7b2269d Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Mon, 12 Oct 2009 12:20:26 +0300 Subject: r600: DPH adds w comp of second operand, so set first one to 1 instead --- src/mesa/drivers/dri/r600/r700_assembler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index fefae22ba7..a1331fdfd2 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -2635,7 +2635,7 @@ GLboolean assemble_DOT(r700_AssemblerBase *pAsm) } else if(pAsm->pILInst[pAsm->uiCurInst].Opcode == OPCODE_DPH) { - onecomp_PVSSRC(&(pAsm->S[1].src), 3); + onecomp_PVSSRC(&(pAsm->S[0].src), 3); } if ( GL_FALSE == next_ins(pAsm) ) -- cgit v1.2.3 From da66d9e12d339c5c6df08ea0bd11a550c9c57b36 Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Mon, 12 Oct 2009 12:58:40 +0300 Subject: r600: LIT dst.y gets value from src.x seems I overlooked this when removing hardcoded swizzles for this one previously --- src/mesa/drivers/dri/r600/r700_assembler.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index a1331fdfd2..ed597c027b 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -3026,6 +3026,7 @@ GLboolean assemble_LIT(r700_AssemblerBase *pAsm) pAsm->S[0].src.rtype = srcType; pAsm->S[0].src.reg = srcReg; setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + swizzleagain_PVSSRC(&(pAsm->S[0].src), SQ_SEL_X, SQ_SEL_X, SQ_SEL_X, SQ_SEL_X); pAsm->S[1].src.rtype = SRC_REG_TEMPORARY; pAsm->S[1].src.reg = tmp; setaddrmode_PVSSRC(&(pAsm->S[1].src), ADDR_ABSOLUTE); -- cgit v1.2.3 From 7a32c0a19e77e2e735f8d5cbc5b3bb9fda9606e5 Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Mon, 12 Oct 2009 14:57:45 +0300 Subject: r600: implement ProgramStringNotify need this to properly test with piglit/glean vert/fragprog tests copied mostly from r300, many thanks to osiris, nha, airlied, others... --- src/mesa/drivers/dri/r600/r700_oglprog.c | 55 ++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 17 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_oglprog.c b/src/mesa/drivers/dri/r600/r700_oglprog.c index 5290ef31be..0d476fcd86 100644 --- a/src/mesa/drivers/dri/r600/r700_oglprog.c +++ b/src/mesa/drivers/dri/r600/r700_oglprog.c @@ -40,6 +40,24 @@ #include "r700_vertprog.h" +static void freeVertProgCache(GLcontext *ctx, struct r700_vertex_program_cont *cache) +{ + struct r700_vertex_program *tmp, *vp = cache->progs; + + while (vp) { + tmp = vp->next; + /* Release DMA region */ + r600DeleteShader(ctx, vp->shaderbo); + /* Clean up */ + Clean_Up_Assembler(&(vp->r700AsmCode)); + Clean_Up_Shader(&(vp->r700Shader)); + + _mesa_reference_vertprog(ctx, &vp->mesa_program, NULL); + _mesa_free(vp); + vp = tmp; + } +} + static struct gl_program *r700NewProgram(GLcontext * ctx, GLenum target, GLuint id) @@ -84,8 +102,7 @@ static struct gl_program *r700NewProgram(GLcontext * ctx, static void r700DeleteProgram(GLcontext * ctx, struct gl_program *prog) { - struct r700_vertex_program_cont * vpc; - struct r700_vertex_program *vp, *tmp; + struct r700_vertex_program_cont *vpc = (struct r700_vertex_program_cont *)prog; struct r700_fragment_program * fp; radeon_print(RADEON_SHADER, RADEON_VERBOSE, @@ -95,20 +112,7 @@ static void r700DeleteProgram(GLcontext * ctx, struct gl_program *prog) { case GL_VERTEX_STATE_PROGRAM_NV: case GL_VERTEX_PROGRAM_ARB: - vpc = (struct r700_vertex_program_cont*)prog; - vp = vpc->progs; - while (vp) { - tmp = vp->next; - /* Release DMA region */ - - r600DeleteShader(ctx, vp->shaderbo); - - /* Clean up */ - Clean_Up_Assembler(&(vp->r700AsmCode)); - Clean_Up_Shader(&(vp->r700Shader)); - _mesa_free(vp); - vp = tmp; - } + freeVertProgCache(ctx, vpc); break; case GL_FRAGMENT_PROGRAM_NV: case GL_FRAGMENT_PROGRAM_ARB: @@ -131,7 +135,24 @@ static void r700DeleteProgram(GLcontext * ctx, struct gl_program *prog) static void r700ProgramStringNotify(GLcontext * ctx, GLenum target, struct gl_program *prog) { - + struct r700_vertex_program_cont *vpc = (struct r700_vertex_program_cont *)prog; + struct r700_fragment_program * fp = (struct r700_fragment_program*)prog; + + switch (target) { + case GL_VERTEX_PROGRAM_ARB: + freeVertProgCache(ctx, vpc); + vpc->progs = NULL; + break; + case GL_FRAGMENT_PROGRAM_ARB: + r600DeleteShader(ctx, fp->shaderbo); + Clean_Up_Assembler(&(fp->r700AsmCode)); + Clean_Up_Shader(&(fp->r700Shader)); + fp->translated = GL_FALSE; + fp->loaded = GL_FALSE; + fp->shaderbo = NULL; + break; + } + } static GLboolean r700IsProgramNative(GLcontext * ctx, GLenum target, struct gl_program *prog) -- cgit v1.2.3 From 6c1cd4c55856dc7d36406de21a0fb5f567fcd36f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 9 Oct 2009 08:29:28 -0600 Subject: mesa: print program Id when printing --- src/mesa/shader/prog_print.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c index b71735aa80..a2bed07900 100644 --- a/src/mesa/shader/prog_print.c +++ b/src/mesa/shader/prog_print.c @@ -788,7 +788,7 @@ _mesa_fprint_program_opt(FILE *f, else if (mode == PROG_PRINT_NV) _mesa_fprintf(f, "!!VP1.0\n"); else - _mesa_fprintf(f, "# Vertex Program/Shader\n"); + _mesa_fprintf(f, "# Vertex Program/Shader %u\n", prog->Id); break; case GL_FRAGMENT_PROGRAM_ARB: case GL_FRAGMENT_PROGRAM_NV: @@ -797,7 +797,7 @@ _mesa_fprint_program_opt(FILE *f, else if (mode == PROG_PRINT_NV) _mesa_fprintf(f, "!!FP1.0\n"); else - _mesa_fprintf(f, "# Fragment Program/Shader\n"); + _mesa_fprintf(f, "# Fragment Program/Shader %u\n", prog->Id); break; } -- cgit v1.2.3 From 15d2ef602461ca75e7160af46a2b5040742a91c9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 12 Oct 2009 17:32:16 -0600 Subject: i965: remove unused var --- src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index 9c28a22a29..f7cc5153a8 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -693,7 +693,6 @@ brw_wm_get_binding_table(struct brw_context *brw) static void prepare_wm_surfaces(struct brw_context *brw ) { GLcontext *ctx = &brw->intel.ctx; - struct intel_context *intel = &brw->intel; GLuint i; int old_nr_surfaces; -- cgit v1.2.3 From e6594a22f298833eeb6881795b24d03d2fd8e898 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 12 Oct 2009 17:37:06 -0600 Subject: intel: pass zslice to intel_miptree_image_offset() This lets us get rid of intel_miptree_depth_offsets() and simplify all of the calling code. --- src/mesa/drivers/dri/i915/i830_texstate.c | 5 +-- src/mesa/drivers/dri/i915/i915_texstate.c | 5 +-- src/mesa/drivers/dri/intel/intel_fbo.c | 11 +---- src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 61 +++++++++++--------------- src/mesa/drivers/dri/intel/intel_mipmap_tree.h | 14 ++---- src/mesa/drivers/dri/intel/intel_tex_copy.c | 2 +- src/mesa/drivers/dri/intel/intel_tex_image.c | 7 +-- 7 files changed, 40 insertions(+), 65 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i830_texstate.c b/src/mesa/drivers/dri/i915/i830_texstate.c index 6f998fa6f7..f270a13781 100644 --- a/src/mesa/drivers/dri/i915/i830_texstate.c +++ b/src/mesa/drivers/dri/i915/i830_texstate.c @@ -162,9 +162,8 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) } else { dri_bo_reference(intelObj->mt->region->buffer); i830->state.tex_buffer[unit] = intelObj->mt->region->buffer; - i830->state.tex_offset[unit] = intel_miptree_image_offset(intelObj->mt, - 0, intelObj-> - firstLevel); + i830->state.tex_offset[unit] = + intel_miptree_image_offset(intelObj->mt, 0, intelObj->firstLevel, 0); format = translate_texture_format(firstImage->TexFormat->MesaFormat, firstImage->InternalFormat); diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index 32d4b30cf9..b2f82f5655 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -173,9 +173,8 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) } else { dri_bo_reference(intelObj->mt->region->buffer); i915->state.tex_buffer[unit] = intelObj->mt->region->buffer; - i915->state.tex_offset[unit] = intel_miptree_image_offset(intelObj->mt, - 0, intelObj-> - firstLevel); + i915->state.tex_offset[unit] = + intel_miptree_image_offset(intelObj->mt, 0, intelObj->firstLevel, 0); format = translate_texture_format(firstImage->TexFormat->MesaFormat, firstImage->InternalFormat, diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 8dfb24290d..2e61371805 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -618,15 +618,8 @@ intel_render_texture(GLcontext * ctx, } /* compute offset of the particular 2D image within the texture region */ - imageOffset = intel_miptree_image_offset(intel_image->mt, - att->CubeMapFace, - att->TextureLevel); - - if (att->Texture->Target == GL_TEXTURE_3D) { - const GLuint *offsets = intel_miptree_depth_offsets(intel_image->mt, - att->TextureLevel); - imageOffset += offsets[att->Zoffset]; - } + imageOffset = intel_miptree_image_offset(intel_image->mt, att->CubeMapFace, + att->TextureLevel, att->Zoffset); /* store that offset in the region */ intel_image->mt->region->draw_offset = imageOffset; diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c index 4f5101a312..d9d2edfe19 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@ -395,33 +395,26 @@ intel_miptree_set_image_offset(struct intel_mipmap_tree *mt, } -/* Although we use the image_offset[] array to store relative offsets - * to cube faces, Mesa doesn't know anything about this and expects - * each cube face to be treated as a separate image. - * - * These functions present that view to mesa: +/** + * Return offset to the start of a 2D slice of a texture (a mipmap level, + * cube face, 3D Z slice). + * \param mt the texture object/miptree + * \param face cube map face in [0,5] or zero for non-cube textures + * \param level mipmap level + * \param zslice Z slice of a 3D texture, or zero for non-3D textures */ -const GLuint * -intel_miptree_depth_offsets(struct intel_mipmap_tree *mt, GLuint level) -{ - static const GLuint zero = 0; - - if (mt->target != GL_TEXTURE_3D || mt->level[level].nr_images == 1) - return &zero; - else - return mt->level[level].image_offset; -} - - GLuint -intel_miptree_image_offset(struct intel_mipmap_tree *mt, - GLuint face, GLuint level) +intel_miptree_image_offset(const struct intel_mipmap_tree *mt, + GLuint face, GLuint level, GLuint zslice) { + GLuint offset = mt->level[level].level_offset; + if (mt->target == GL_TEXTURE_CUBE_MAP_ARB) - return (mt->level[level].level_offset + - mt->level[level].image_offset[face]); - else - return mt->level[level].level_offset; + offset += mt->level[level].image_offset[face]; + else if (mt->target == GL_TEXTURE_3D) + offset += mt->level[level].image_offset[zslice]; + + return offset; } @@ -459,7 +452,7 @@ intel_miptree_image_map(struct intel_context * intel, } return (intel_region_map(intel, mt->region) + - intel_miptree_image_offset(mt, face, level)); + intel_miptree_image_offset(mt, face, level, 0)); } void @@ -484,19 +477,18 @@ intel_miptree_image_data(struct intel_context *intel, GLuint src_image_pitch) { GLuint depth = dst->level[level].depth; - GLuint dst_offset = intel_miptree_image_offset(dst, face, level); - const GLuint *dst_depth_offset = intel_miptree_depth_offsets(dst, level); GLuint i; GLuint height = 0; DBG("%s: %d/%d\n", __FUNCTION__, face, level); for (i = 0; i < depth; i++) { + GLuint dst_offset = intel_miptree_image_offset(dst, face, level, i); height = dst->level[level].height; if(dst->compressed) height = (height + 3) / 4; intel_region_data(intel, dst->region, - dst_offset + dst_depth_offset[i], /* dst_offset */ + dst_offset, 0, 0, /* dstx, dsty */ src, src_row_pitch, @@ -519,10 +511,6 @@ intel_miptree_image_copy(struct intel_context *intel, GLuint width = src->level[level].width; GLuint height = src->level[level].height; GLuint depth = src->level[level].depth; - GLuint dst_offset = intel_miptree_image_offset(dst, face, level); - GLuint src_offset = intel_miptree_image_offset(src, face, level); - const GLuint *dst_depth_offset = intel_miptree_depth_offsets(dst, level); - const GLuint *src_depth_offset = intel_miptree_depth_offsets(src, level); GLuint i; GLboolean success; @@ -535,10 +523,13 @@ intel_miptree_image_copy(struct intel_context *intel, } for (i = 0; i < depth; i++) { + GLuint dst_offset = intel_miptree_image_offset(dst, face, level, i); + GLuint src_offset = intel_miptree_image_offset(src, face, level, i); + success = intel_region_copy(intel, - dst->region, dst_offset + dst_depth_offset[i], + dst->region, dst_offset, 0, 0, - src->region, src_offset + src_depth_offset[i], + src->region, src_offset, 0, 0, width, height, GL_COPY); if (!success) { GLubyte *src_ptr, *dst_ptr; @@ -546,11 +537,11 @@ intel_miptree_image_copy(struct intel_context *intel, src_ptr = intel_region_map(intel, src->region); dst_ptr = intel_region_map(intel, dst->region); - _mesa_copy_rect(dst_ptr + dst_offset + dst_depth_offset[i], + _mesa_copy_rect(dst_ptr + dst_offset, dst->cpp, dst->pitch, 0, 0, width, height, - src_ptr + src_offset + src_depth_offset[i], + src_ptr + src_offset, src->pitch, 0, 0); intel_region_unmap(intel, src->region); diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h index c890b2a0d0..c08f9cd8b6 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h @@ -177,17 +177,9 @@ void intel_miptree_image_unmap(struct intel_context *intel, struct intel_mipmap_tree *mt); -/* Return the linear offset of an image relative to the start of the - * tree: - */ -GLuint intel_miptree_image_offset(struct intel_mipmap_tree *mt, - GLuint face, GLuint level); - -/* Return pointers to each 2d slice within an image. Indexed by depth - * value. - */ -const GLuint *intel_miptree_depth_offsets(struct intel_mipmap_tree *mt, - GLuint level); +GLuint +intel_miptree_image_offset(const struct intel_mipmap_tree *mt, + GLuint face, GLuint level, GLuint zslice); void intel_miptree_set_level_info(struct intel_mipmap_tree *mt, diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c index f3e312420d..99cd818417 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_copy.c +++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c @@ -117,7 +117,7 @@ do_copy_texsubimage(struct intel_context *intel, INTEL_WRITE_PART); GLuint image_offset = intel_miptree_image_offset(intelImage->mt, intelImage->face, - intelImage->level); + intelImage->level, 0); const GLint orig_x = x; const GLint orig_y = y; GLshort src_pitch; diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index 5c915178e7..dcc613449f 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -222,7 +222,8 @@ try_pbo_upload(struct intel_context *intel, dst_offset = intel_miptree_image_offset(intelImage->mt, intelImage->face, - intelImage->level); + intelImage->level, + 0 /* zslice */); dst_stride = intelImage->mt->pitch; @@ -281,8 +282,8 @@ try_pbo_zcopy(struct intel_context *intel, dst_offset = intel_miptree_image_offset(intelImage->mt, intelImage->face, - intelImage->level); - + intelImage->level, + 0 /* zslice */); dst_stride = intelImage->mt->pitch; if (src_stride != dst_stride || dst_offset != 0 || src_offset != 0) { -- cgit v1.2.3 From c932e21fa848562325f666dce5db3b09bc61bffa Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 12 Oct 2009 17:40:33 -0600 Subject: intel: code clean-ups --- src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c index d9d2edfe19..cc23a8905a 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@ -476,16 +476,17 @@ intel_miptree_image_data(struct intel_context *intel, GLuint src_row_pitch, GLuint src_image_pitch) { - GLuint depth = dst->level[level].depth; + const GLuint depth = dst->level[level].depth; GLuint i; - GLuint height = 0; DBG("%s: %d/%d\n", __FUNCTION__, face, level); for (i = 0; i < depth; i++) { GLuint dst_offset = intel_miptree_image_offset(dst, face, level, i); - height = dst->level[level].height; - if(dst->compressed) + GLuint height = dst->level[level].height; + + if (dst->compressed) height = (height + 3) / 4; + intel_region_data(intel, dst->region, dst_offset, -- cgit v1.2.3 From b9c28979576a566055e44cb31f3e5c0cd82754e0 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 12 Oct 2009 17:41:14 -0600 Subject: intel: added INLINE keyword to minify() This is mainly just to silence some warnings. --- src/mesa/drivers/dri/intel/intel_tex_layout.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex_layout.h b/src/mesa/drivers/dri/intel/intel_tex_layout.h index c9de9b5678..a9ac9e7eb4 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_layout.h +++ b/src/mesa/drivers/dri/intel/intel_tex_layout.h @@ -33,7 +33,7 @@ #include "main/macros.h" -static GLuint minify( GLuint d ) +static INLINE GLuint minify( GLuint d ) { return MAX2(1, d>>1); } -- cgit v1.2.3 From 3732d0a77d2cbae50874f5a4ebdb3d8f06021a57 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 12 Oct 2009 17:41:47 -0600 Subject: intel: replace extern decl with #include --- src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c index cc23a8905a..26ebcf3907 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@ -28,6 +28,7 @@ #include "intel_context.h" #include "intel_mipmap_tree.h" #include "intel_regions.h" +#include "intel_tex_layout.h" #include "intel_chipset.h" #ifndef I915 #include "brw_state.h" @@ -500,7 +501,7 @@ intel_miptree_image_data(struct intel_context *intel, } } -extern void intel_get_texture_alignment_unit(GLenum, GLuint *, GLuint *); + /* Copy mipmap image between trees */ void -- cgit v1.2.3 From 47a7535f413d6467082de224f64eecc046227406 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 12 Oct 2009 18:08:42 -0600 Subject: intel: whitespace/formatting clean-up --- src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 28 +++++++++++++++++--------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c index 26ebcf3907..01e9d4add3 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@ -37,6 +37,7 @@ #define FILE_DEBUG_FLAG DEBUG_MIPTREE + static GLenum target_to_target(GLenum target) { @@ -53,6 +54,7 @@ target_to_target(GLenum target) } } + static struct intel_mipmap_tree * intel_miptree_create_internal(struct intel_context *intel, GLenum target, @@ -102,6 +104,7 @@ intel_miptree_create_internal(struct intel_context *intel, return mt; } + struct intel_mipmap_tree * intel_miptree_create(struct intel_context *intel, GLenum target, @@ -154,6 +157,7 @@ intel_miptree_create(struct intel_context *intel, return mt; } + struct intel_mipmap_tree * intel_miptree_create_for_region(struct intel_context *intel, GLenum target, @@ -191,7 +195,8 @@ intel_miptree_create_for_region(struct intel_context *intel, intel_region_reference(&mt->region, region); return mt; - } +} + /** * intel_miptree_pitch_align: @@ -205,7 +210,6 @@ intel_miptree_create_for_region(struct intel_context *intel, * Given @pitch, compute a larger value which accounts for * any necessary alignment required by the device */ - int intel_miptree_pitch_align (struct intel_context *intel, struct intel_mipmap_tree *mt, uint32_t tiling, @@ -251,6 +255,7 @@ int intel_miptree_pitch_align (struct intel_context *intel, return pitch; } + void intel_miptree_reference(struct intel_mipmap_tree **dst, struct intel_mipmap_tree *src) @@ -260,6 +265,7 @@ intel_miptree_reference(struct intel_mipmap_tree **dst, DBG("%s %p refcount now %d\n", __FUNCTION__, src, src->refcount); } + void intel_miptree_release(struct intel_context *intel, struct intel_mipmap_tree **mt) @@ -298,9 +304,8 @@ intel_miptree_release(struct intel_context *intel, } - - -/* Can the image be pulled into a unified mipmap tree. This mirrors +/** + * Can the image be pulled into a unified mipmap tree? This mirrors * the completeness test in a lot of ways. * * Not sure whether I want to pass gl_texture_image here. @@ -387,6 +392,7 @@ intel_miptree_set_image_offset_ex(struct intel_mipmap_tree *mt, __FUNCTION__, level, img, x, y, mt->level[level].image_offset[img]); } + void intel_miptree_set_image_offset(struct intel_mipmap_tree *mt, GLuint level, GLuint img, @@ -419,7 +425,6 @@ intel_miptree_image_offset(const struct intel_mipmap_tree *mt, } - /** * Map a teximage in a mipmap tree. * \param row_stride returns row stride in bytes @@ -456,6 +461,7 @@ intel_miptree_image_map(struct intel_context * intel, intel_miptree_image_offset(mt, face, level, 0)); } + void intel_miptree_image_unmap(struct intel_context *intel, struct intel_mipmap_tree *mt) @@ -465,8 +471,8 @@ intel_miptree_image_unmap(struct intel_context *intel, } - -/* Upload data for a particular image. +/** + * Upload data for a particular image. */ void intel_miptree_image_data(struct intel_context *intel, @@ -502,7 +508,8 @@ intel_miptree_image_data(struct intel_context *intel, } -/* Copy mipmap image between trees +/** + * Copy mipmap image between trees */ void intel_miptree_image_copy(struct intel_context *intel, @@ -519,7 +526,8 @@ intel_miptree_image_copy(struct intel_context *intel, if (dst->compressed) { GLuint align_w, align_h; - intel_get_texture_alignment_unit(dst->internal_format, &align_w, &align_h); + intel_get_texture_alignment_unit(dst->internal_format, + &align_w, &align_h); height = (height + 3) / 4; width = ALIGN(width, align_w); } -- cgit v1.2.3 From b5d6a8e88fb970bce596adc10a8b22f6758591f0 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 12 Oct 2009 18:09:32 -0600 Subject: mesa: minor clean up in check_begin_texture_render() --- src/mesa/main/fbobject.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 6e767bb24d..87061aeb0d 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1129,7 +1129,7 @@ check_begin_texture_render(GLcontext *ctx, struct gl_framebuffer *fb) struct gl_renderbuffer_attachment *att = fb->Attachment + i; struct gl_texture_object *texObj = att->Texture; if (texObj - && att->Texture->Image[att->CubeMapFace][att->TextureLevel]) { + && texObj->Image[att->CubeMapFace][att->TextureLevel]) { ctx->Driver.RenderTexture(ctx, fb, att); } } -- cgit v1.2.3 From 3f928b355275c0e76ead6febe471a552ece8b0a8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 12 Oct 2009 18:11:31 -0600 Subject: mesa: save/set/restore texture base/wrap state in blitframebuffer_texture() --- src/mesa/drivers/common/meta.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 02e771c8d8..9cba3a7600 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -1048,8 +1048,13 @@ blitframebuffer_texture(GLcontext *ctx, if (readAtt && readAtt->Texture) { const struct gl_texture_object *texObj = readAtt->Texture; + const GLuint srcLevel = readAtt->TextureLevel; const GLenum minFilterSave = texObj->MinFilter; const GLenum magFilterSave = texObj->MagFilter; + const GLint baseLevelSave = texObj->BaseLevel; + const GLint maxLevelSave = texObj->MaxLevel; + const GLenum wrapSSave = texObj->WrapS; + const GLenum wrapTSave = texObj->WrapT; const GLenum target = texObj->Target; if (drawAtt->Texture == readAtt->Texture) { @@ -1075,8 +1080,11 @@ blitframebuffer_texture(GLcontext *ctx, _mesa_BindTexture(target, texObj->Name); _mesa_TexParameteri(target, GL_TEXTURE_MIN_FILTER, filter); _mesa_TexParameteri(target, GL_TEXTURE_MAG_FILTER, filter); + _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, srcLevel); + _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, srcLevel); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); _mesa_TexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); - /*_mesa_set_enable(ctx, GL_TEXTURE_RECTANGLE, GL_FALSE);*/ _mesa_set_enable(ctx, target, GL_TRUE); /* Prepare vertex data (the VBO was previously created and bound) */ @@ -1089,8 +1097,7 @@ blitframebuffer_texture(GLcontext *ctx, if (target == GL_TEXTURE_2D) { const struct gl_texture_image *texImage - = _mesa_select_tex_image(ctx, texObj, target, - readAtt->TextureLevel); + = _mesa_select_tex_image(ctx, texObj, target, srcLevel); s0 = srcX0 / (float) texImage->Width; s1 = srcX1 / (float) texImage->Width; t0 = srcY0 / (float) texImage->Height; @@ -1127,11 +1134,15 @@ blitframebuffer_texture(GLcontext *ctx, _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4); - /* Restore texture's filter state, the texture binding will + /* Restore texture object state, the texture binding will * be restored by _mesa_meta_end(). */ _mesa_TexParameteri(target, GL_TEXTURE_MIN_FILTER, minFilterSave); _mesa_TexParameteri(target, GL_TEXTURE_MAG_FILTER, magFilterSave); + _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, baseLevelSave); + _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, maxLevelSave); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, wrapSSave); + _mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, wrapTSave); /* Done with color buffer */ mask &= ~GL_COLOR_BUFFER_BIT; -- cgit v1.2.3 From c8413351c33d5758da057b56a140c9ee622a5e4a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 13 Oct 2009 09:04:14 -0600 Subject: mesa: do RTT check in _mesa_meta_check_generate_mipmap_fallback() We need to check that we can actually render to the texture's format before doing mipmap generation. This may fix bug 24219. --- src/mesa/drivers/common/meta.c | 55 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 48 insertions(+), 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 9cba3a7600..bae2c01ac2 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -2064,21 +2064,64 @@ _mesa_meta_Bitmap(GLcontext *ctx, * Check if the call to _mesa_meta_GenerateMipmap() will require a * software fallback. The fallback path will require that the texture * images are mapped. + * \return GL_TRUE if a fallback is needed, GL_FALSE otherwise */ GLboolean _mesa_meta_check_generate_mipmap_fallback(GLcontext *ctx, GLenum target, struct gl_texture_object *texObj) { - struct gl_texture_image *baseImage = - _mesa_select_tex_image(ctx, texObj, target, texObj->BaseLevel); + const GLuint fboSave = ctx->DrawBuffer->Name; + struct gen_mipmap_state *mipmap = &ctx->Meta->Mipmap; + struct gl_texture_image *baseImage; + GLuint srcLevel; + GLenum status; /* check for fallbacks */ if (!ctx->Extensions.EXT_framebuffer_object || - target == GL_TEXTURE_3D || - !baseImage || - baseImage->IsCompressed) { + target == GL_TEXTURE_3D) { return GL_TRUE; } + + srcLevel = texObj->BaseLevel; + baseImage = _mesa_select_tex_image(ctx, texObj, target, srcLevel); + if (!baseImage || baseImage->IsCompressed) { + return GL_TRUE; + } + + /* + * Test that we can actually render in the texture's format. + */ + if (!mipmap->FBO) + _mesa_GenFramebuffersEXT(1, &mipmap->FBO); + _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, mipmap->FBO); + + if (target == GL_TEXTURE_1D) { + _mesa_FramebufferTexture1DEXT(GL_FRAMEBUFFER_EXT, + GL_COLOR_ATTACHMENT0_EXT, + target, texObj->Name, srcLevel); + } + else if (target == GL_TEXTURE_3D) { + GLint zoffset = 0; + _mesa_FramebufferTexture3DEXT(GL_FRAMEBUFFER_EXT, + GL_COLOR_ATTACHMENT0_EXT, + target, texObj->Name, srcLevel, zoffset); + } + else { + /* 2D / cube */ + _mesa_FramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, + GL_COLOR_ATTACHMENT0_EXT, + target, texObj->Name, srcLevel); + } + + status = _mesa_CheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT); + + _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, fboSave); + + if (status != GL_FRAMEBUFFER_COMPLETE_EXT) { + printf("Can't render\n"); + return GL_TRUE; + } + return GL_FALSE; } @@ -2152,10 +2195,8 @@ _mesa_meta_GenerateMipmap(GLcontext *ctx, GLenum target, } if (!mipmap->FBO) { - /* Bind the new renderbuffer to the color attachment point. */ _mesa_GenFramebuffersEXT(1, &mipmap->FBO); } - _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, mipmap->FBO); _mesa_TexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_LINEAR); -- cgit v1.2.3 From eefecf5d2a5bf9fc0f0f7919faf1747b0add8d6f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 13 Oct 2009 09:04:54 -0600 Subject: mesa: whitespace fixes --- src/mesa/drivers/common/meta.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index bae2c01ac2..21458a7c73 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -2113,7 +2113,7 @@ _mesa_meta_check_generate_mipmap_fallback(GLcontext *ctx, GLenum target, target, texObj->Name, srcLevel); } - status = _mesa_CheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT); + status = _mesa_CheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, fboSave); @@ -2399,7 +2399,7 @@ _mesa_meta_GenerateMipmap(GLcontext *ctx, GLenum target, _mesa_DrawBuffer(GL_COLOR_ATTACHMENT0_EXT); /* sanity check */ - status = _mesa_CheckFramebufferStatusEXT (GL_FRAMEBUFFER_EXT); + status = _mesa_CheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); if (status != GL_FRAMEBUFFER_COMPLETE_EXT) { abort(); break; -- cgit v1.2.3 From 83f4e72009e2ee03ec1175bd3e6e309e605c2bd1 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 13 Oct 2009 10:37:39 -0600 Subject: intel: fix broken sw generate mipmap path Need to restore code that fixed up the intel_texture_image state. --- src/mesa/drivers/dri/intel/intel_tex.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex.c b/src/mesa/drivers/dri/intel/intel_tex.c index 3cbc379dbd..215a534a5c 100644 --- a/src/mesa/drivers/dri/intel/intel_tex.c +++ b/src/mesa/drivers/dri/intel/intel_tex.c @@ -177,6 +177,28 @@ intelGenerateMipmap(GLcontext *ctx, GLenum target, intel_tex_map_level_images(intel, intelObj, texObj->BaseLevel); _mesa_generate_mipmap(ctx, target, texObj); intel_tex_unmap_level_images(intel, intelObj, texObj->BaseLevel); + + { + GLuint nr_faces = (texObj->Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1; + GLuint face, i; + /* Update the level information in our private data in the new images, + * since it didn't get set as part of a normal TexImage path. + */ + for (face = 0; face < nr_faces; face++) { + for (i = texObj->BaseLevel + 1; i < texObj->MaxLevel; i++) { + struct intel_texture_image *intelImage = + intel_texture_image(texObj->Image[face][i]); + if (!intelImage) + break; + intelImage->level = i; + intelImage->face = face; + /* Unreference the miptree to signal that the new Data is a + * bare pointer from mesa. + */ + intel_miptree_release(intel, &intelImage->mt); + } + } + } } else { _mesa_meta_GenerateMipmap(ctx, target, texObj); -- cgit v1.2.3 From f058b25881e08c9d89a33345e5c84e1357396932 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 8 Oct 2009 17:28:02 -0700 Subject: Store clipping distance for user clip planes as part of vertex processing Once the clipping distance is calculated and stored per vertex, the distances can be re-used when clipping is actually performed. This doesn't have any immediate benefit, but it paves the way for implementing gl_ClipDistance in vertex shaders and result.clip[] in vertex programs. This has not produces any oglconform regressions on my G31 system which uses software TNL. Signed-off-by: Ian Romanick Reviewed-by: Brian Paul --- src/mesa/tnl/t_context.h | 1 + src/mesa/tnl/t_vb_cliptmp.h | 103 +++++++++++++++++++++++++++++++++++++------- src/mesa/tnl/t_vb_program.c | 15 +++++++ src/mesa/tnl/t_vb_vertex.c | 31 +++++++++++-- 4 files changed, 132 insertions(+), 18 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h index 6137c2d2fe..ca4edcfcb9 100644 --- a/src/mesa/tnl/t_context.h +++ b/src/mesa/tnl/t_context.h @@ -207,6 +207,7 @@ struct vertex_buffer GLvector4f *EyePtr; /* _TNL_BIT_POS */ GLvector4f *ClipPtr; /* _TNL_BIT_POS */ GLvector4f *NdcPtr; /* _TNL_BIT_POS */ + GLfloat *ClipDistancePtr[MAX_CLIP_PLANES]; /* _TNL_BIT_POS */ GLubyte ClipOrMask; /* _TNL_BIT_POS */ GLubyte ClipAndMask; /* _TNL_BIT_POS */ GLubyte *ClipMask; /* _TNL_BIT_POS */ diff --git a/src/mesa/tnl/t_vb_cliptmp.h b/src/mesa/tnl/t_vb_cliptmp.h index 618b8b3130..0d2183a9e6 100644 --- a/src/mesa/tnl/t_vb_cliptmp.h +++ b/src/mesa/tnl/t_vb_cliptmp.h @@ -80,6 +80,58 @@ do { \ } while (0) +#define POLY_USERCLIP(PLANE) \ +do { \ + if (mask & CLIP_USER_BIT) { \ + GLuint idxPrev = inlist[0]; \ + GLfloat dpPrev = VB->ClipDistancePtr[PLANE][idxPrev]; \ + GLuint outcount = 0; \ + GLuint i; \ + \ + inlist[n] = inlist[0]; /* prevent rotation of vertices */ \ + for (i = 1; i <= n; i++) { \ + GLuint idx = inlist[i]; \ + GLfloat dp = VB->ClipDistancePtr[PLANE][idx]; \ + \ + if (!IS_NEGATIVE(dpPrev)) { \ + outlist[outcount++] = idxPrev; \ + } \ + \ + if (DIFFERENT_SIGNS(dp, dpPrev)) { \ + if (IS_NEGATIVE(dp)) { \ + /* Going out of bounds. Avoid division by zero as we \ + * know dp != dpPrev from DIFFERENT_SIGNS, above. \ + */ \ + GLfloat t = dp / (dp - dpPrev); \ + INTERP_4F( t, coord[newvert], coord[idx], coord[idxPrev]); \ + interp( ctx, t, newvert, idx, idxPrev, GL_TRUE ); \ + } else { \ + /* Coming back in. \ + */ \ + GLfloat t = dpPrev / (dpPrev - dp); \ + INTERP_4F( t, coord[newvert], coord[idxPrev], coord[idx]); \ + interp( ctx, t, newvert, idxPrev, idx, GL_FALSE ); \ + } \ + outlist[outcount++] = newvert++; \ + } \ + \ + idxPrev = idx; \ + dpPrev = dp; \ + } \ + \ + if (outcount < 3) \ + return; \ + \ + { \ + GLuint *tmp = inlist; \ + inlist = outlist; \ + outlist = tmp; \ + n = outcount; \ + } \ + } \ +} while (0) + + #define LINE_CLIP(PLANE_BIT, A, B, C, D ) \ do { \ if (mask & PLANE_BIT) { \ @@ -111,6 +163,37 @@ do { \ } while (0) +#define LINE_USERCLIP(PLANE) \ +do { \ + if (mask & CLIP_USER_BIT) { \ + const GLfloat dp0 = VB->ClipDistancePtr[PLANE][v0]; \ + const GLfloat dp1 = VB->ClipDistancePtr[PLANE][v1]; \ + const GLboolean neg_dp0 = IS_NEGATIVE(dp0); \ + const GLboolean neg_dp1 = IS_NEGATIVE(dp1); \ + \ + /* For regular clipping, we know from the clipmask that one \ + * (or both) of these must be negative (otherwise we wouldn't \ + * be here). \ + * For userclip, there is only a single bit for all active \ + * planes, so we can end up here when there is nothing to do, \ + * hence the second IS_NEGATIVE() test: \ + */ \ + if (neg_dp0 && neg_dp1) \ + return; /* both vertices outside clip plane: discard */ \ + \ + if (neg_dp1) { \ + GLfloat t = dp1 / (dp1 - dp0); \ + if (t > t1) t1 = t; \ + } else if (neg_dp0) { \ + GLfloat t = dp0 / (dp0 - dp1); \ + if (t > t0) t0 = t; \ + } \ + if (t0 + t1 >= 1.0) \ + return; /* discard */ \ + } \ +} while (0) + + /* Clip a line against the viewport and user clip planes. */ @@ -139,11 +222,7 @@ TAG(clip_line)( GLcontext *ctx, GLuint v0, GLuint v1, GLubyte mask ) if (mask & CLIP_USER_BIT) { for (p = 0; p < ctx->Const.MaxClipPlanes; p++) { if (ctx->Transform.ClipPlanesEnabled & (1 << p)) { - const GLfloat a = ctx->Transform._ClipUserPlane[p][0]; - const GLfloat b = ctx->Transform._ClipUserPlane[p][1]; - const GLfloat c = ctx->Transform._ClipUserPlane[p][2]; - const GLfloat d = ctx->Transform._ClipUserPlane[p][3]; - LINE_CLIP( CLIP_USER_BIT, a, b, c, d ); + LINE_USERCLIP(p); } } } @@ -228,11 +307,7 @@ TAG(clip_tri)( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLubyte mask ) if (mask & CLIP_USER_BIT) { for (p = 0; p < ctx->Const.MaxClipPlanes; p++) { if (ctx->Transform.ClipPlanesEnabled & (1 << p)) { - const GLfloat a = ctx->Transform._ClipUserPlane[p][0]; - const GLfloat b = ctx->Transform._ClipUserPlane[p][1]; - const GLfloat c = ctx->Transform._ClipUserPlane[p][2]; - const GLfloat d = ctx->Transform._ClipUserPlane[p][3]; - POLY_CLIP( CLIP_USER_BIT, a, b, c, d ); + POLY_USERCLIP(p); } } } @@ -291,11 +366,7 @@ TAG(clip_quad)( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3, if (mask & CLIP_USER_BIT) { for (p = 0; p < ctx->Const.MaxClipPlanes; p++) { if (ctx->Transform.ClipPlanesEnabled & (1 << p)) { - const GLfloat a = ctx->Transform._ClipUserPlane[p][0]; - const GLfloat b = ctx->Transform._ClipUserPlane[p][1]; - const GLfloat c = ctx->Transform._ClipUserPlane[p][2]; - const GLfloat d = ctx->Transform._ClipUserPlane[p][3]; - POLY_CLIP( CLIP_USER_BIT, a, b, c, d ); + POLY_USERCLIP(p); } } } @@ -317,4 +388,6 @@ TAG(clip_quad)( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3, #undef SIZE #undef TAG #undef POLY_CLIP +#undef POLY_USERCLIP #undef LINE_CLIP +#undef LINE_USERCLIP diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index c10a27614f..5fb83c2b01 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -66,6 +66,7 @@ struct vp_stage_data { GLvector4f results[VERT_RESULT_MAX]; GLvector4f ndcCoords; /**< normalized device coords */ + GLfloat *clipdistance[MAX_CLIP_PLANES]; GLubyte *clipmask; /**< clip flags */ GLubyte ormask, andmask; /**< for clipping */ }; @@ -77,6 +78,7 @@ struct vp_stage_data { static void userclip( GLcontext *ctx, GLvector4f *clip, + GLfloat *clipdistance[MAX_CLIP_PLANES], GLubyte *clipmask, GLubyte *clipormask, GLubyte *clipandmask ) @@ -105,6 +107,8 @@ userclip( GLcontext *ctx, clipmask[i] |= CLIP_USER_BIT; } + clipdistance[p][i] = dp; + STRIDE_F(coord, stride); } @@ -164,6 +168,7 @@ do_ndc_cliptest(GLcontext *ctx, struct vp_stage_data *store) ctx->VertexProgram.Current->IsPositionInvariant)) { userclip( ctx, VB->ClipPtr, + store->clipdistance, store->clipmask, &store->ormask, &store->andmask ); @@ -171,6 +176,9 @@ do_ndc_cliptest(GLcontext *ctx, struct vp_stage_data *store) if (store->andmask) { return GL_FALSE; } + + memcpy(VB->ClipDistancePtr, store->clipdistance, + sizeof(store->clipdistance)); } VB->ClipAndMask = store->andmask; @@ -514,6 +522,10 @@ init_vp(GLcontext *ctx, struct tnl_pipeline_stage *stage) _mesa_vector4f_alloc( &store->ndcCoords, 0, size, 32 ); store->clipmask = (GLubyte *) ALIGN_MALLOC(sizeof(GLubyte)*size, 32 ); + for (i = 0; i < MAX_CLIP_PLANES; i++) + store->clipdistance[i] = + (GLfloat *) ALIGN_MALLOC(sizeof(GLfloat) * size, 32); + return GL_TRUE; } @@ -537,6 +549,9 @@ dtr(struct tnl_pipeline_stage *stage) _mesa_vector4f_free( &store->ndcCoords ); ALIGN_FREE( store->clipmask ); + for (i = 0; i < MAX_CLIP_PLANES; i++) + ALIGN_FREE(store->clipdistance[i]); + FREE( store ); stage->privatePtr = NULL; } diff --git a/src/mesa/tnl/t_vb_vertex.c b/src/mesa/tnl/t_vb_vertex.c index 4734754ea4..2a61ff1177 100644 --- a/src/mesa/tnl/t_vb_vertex.c +++ b/src/mesa/tnl/t_vb_vertex.c @@ -44,6 +44,7 @@ struct vertex_stage_data { GLvector4f eye; GLvector4f clip; GLvector4f proj; + GLfloat *clipdistance[MAX_CLIP_PLANES]; GLubyte *clipmask; GLubyte ormask; GLubyte andmask; @@ -56,11 +57,12 @@ struct vertex_stage_data { /* This function implements cliptesting for user-defined clip planes. * The clipping of primitives to these planes is implemented in - * t_render_clip.h. + * t_vp_cliptmp.h. */ #define USER_CLIPTEST(NAME, SZ) \ static void NAME( GLcontext *ctx, \ GLvector4f *clip, \ + GLfloat *clipdistances[MAX_CLIP_PLANES], \ GLubyte *clipmask, \ GLubyte *clipormask, \ GLubyte *clipandmask ) \ @@ -88,6 +90,8 @@ static void NAME( GLcontext *ctx, \ clipmask[i] |= CLIP_USER_BIT; \ } \ \ + clipdistances[p][i] = dp; \ + \ STRIDE_F(coord, stride); \ } \ \ @@ -107,8 +111,9 @@ USER_CLIPTEST(userclip3, 3) USER_CLIPTEST(userclip4, 4) static void (*(usercliptab[5]))( GLcontext *, - GLvector4f *, GLubyte *, - GLubyte *, GLubyte * ) = + GLvector4f *, + GLfloat *[MAX_CLIP_PLANES], + GLubyte *, GLubyte *, GLubyte * ) = { NULL, NULL, @@ -214,12 +219,16 @@ static GLboolean run_vertex_stage( GLcontext *ctx, if (ctx->Transform.ClipPlanesEnabled) { usercliptab[VB->ClipPtr->size]( ctx, VB->ClipPtr, + store->clipdistance, store->clipmask, &store->ormask, &store->andmask ); if (store->andmask) return GL_FALSE; + + memcpy(VB->ClipDistancePtr, store->clipdistance, + sizeof(store->clipdistance)); } VB->ClipAndMask = store->andmask; @@ -236,6 +245,7 @@ static GLboolean init_vertex_stage( GLcontext *ctx, struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; struct vertex_stage_data *store; GLuint size = VB->Size; + unsigned i; stage->privatePtr = CALLOC(sizeof(*store)); store = VERTEX_STAGE_DATA(stage); @@ -247,8 +257,17 @@ static GLboolean init_vertex_stage( GLcontext *ctx, _mesa_vector4f_alloc( &store->proj, 0, size, 32 ); store->clipmask = (GLubyte *) ALIGN_MALLOC(sizeof(GLubyte)*size, 32 ); + for (i = 0; i < MAX_CLIP_PLANES; i++) + store->clipdistance[i] = + (GLfloat *) ALIGN_MALLOC(sizeof(GLfloat) * size, 32); if (!store->clipmask || + !store->clipdistance[0] || + !store->clipdistance[1] || + !store->clipdistance[2] || + !store->clipdistance[3] || + !store->clipdistance[4] || + !store->clipdistance[5] || !store->eye.data || !store->clip.data || !store->proj.data) @@ -262,10 +281,16 @@ static void dtr( struct tnl_pipeline_stage *stage ) struct vertex_stage_data *store = VERTEX_STAGE_DATA(stage); if (store) { + unsigned i; + _mesa_vector4f_free( &store->eye ); _mesa_vector4f_free( &store->clip ); _mesa_vector4f_free( &store->proj ); ALIGN_FREE( store->clipmask ); + + for (i = 0; i < MAX_CLIP_PLANES; i++) + ALIGN_FREE(store->clipdistance[i]); + FREE(store); stage->privatePtr = NULL; stage->run = init_vertex_stage; -- cgit v1.2.3 From dfefde38c7dfe70a3531cb85215e55eeb6407180 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 13 Oct 2009 16:18:06 -0600 Subject: mesa: don't print pointer in _mesa_fprint_parameter_list() --- src/mesa/shader/prog_print.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c index a2bed07900..ba4d39452f 100644 --- a/src/mesa/shader/prog_print.c +++ b/src/mesa/shader/prog_print.c @@ -906,7 +906,8 @@ _mesa_fprint_parameter_list(FILE *f, if (!list) return; - _mesa_fprintf(f, "param list %p\n", (void *) list); + if (0) + _mesa_fprintf(f, "param list %p\n", (void *) list); _mesa_fprintf(f, "dirty state flags: 0x%x\n", list->StateFlags); for (i = 0; i < list->NumParameters; i++){ struct gl_program_parameter *param = list->Parameters + i; -- cgit v1.2.3 From 435623b3f0b2d2db5b107ef177693ccafc591a29 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 13 Oct 2009 16:32:15 -0600 Subject: mesa: rework _mesa_read_shader() debug hook Look for shaders named "newshader_" to replace the incoming shader text. For debug purposes. --- src/mesa/main/shaders.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/shaders.c b/src/mesa/main/shaders.c index bc76b91291..96fd8695a5 100644 --- a/src/mesa/main/shaders.c +++ b/src/mesa/main/shaders.c @@ -388,7 +388,6 @@ _mesa_read_shader(const char *fname) int len; if (!f) { - _mesa_fprintf(stderr, "Unable to open shader file %s\n", fname); return NULL; } @@ -401,11 +400,6 @@ _mesa_read_shader(const char *fname) shader = _mesa_strdup(buffer); free(buffer); - if (0) { - _mesa_fprintf(stderr, "Read shader %s:\n", fname); - _mesa_fprintf(stderr, "%s\n", shader); - } - return shader; } @@ -475,19 +469,25 @@ _mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count, source[totalLength - 1] = '\0'; source[totalLength - 2] = '\0'; -#if 0 if (0) { + /* Compute the shader's source code checksum then try to open a file + * named newshader_. If it exists, use it in place of the + * original shader source code. For debugging. + */ + const GLuint checksum = _mesa_str_checksum(source); + char filename[100]; GLcharARB *newSource; - newSource = _mesa_read_shader("newshader.frag"); + sprintf(filename, "newshader_%d", checksum); + + newSource = _mesa_read_shader(filename); if (newSource) { + _mesa_fprintf(stderr, "Mesa: Replacing shader %u chksum=%d with %s\n", + shaderObj, checksum, filename); _mesa_free(source); source = newSource; } - } -#else - (void) _mesa_read_shader; -#endif + } ctx->Driver.ShaderSource(ctx, shaderObj, source); -- cgit v1.2.3 From 220f72a8d04728efbbc097d27be43590b0fe1ceb Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 13 Oct 2009 16:33:17 -0600 Subject: mesa: minor tweak to printf string --- src/mesa/shader/shader_api.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index ce19649323..6de97984e6 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -1526,7 +1526,7 @@ _mesa_use_program(GLcontext *ctx, GLuint program) /* debug code */ if (0) { GLuint i; - _mesa_printf("Use Shader %u\n", shProg->Name); + _mesa_printf("Use Shader Program %u\n", shProg->Name); for (i = 0; i < shProg->NumShaders; i++) { _mesa_printf(" shader %u, type 0x%x, checksum %u\n", shProg->Shaders[i]->Name, -- cgit v1.2.3 From 98eb7a14a44f8e5c3c2d2f1418d7d4e4ed0fe5e8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 14 Oct 2009 07:52:26 -0600 Subject: mesa: remove left-over debug printf --- src/mesa/drivers/common/meta.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 21458a7c73..ceb929f694 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -2118,7 +2118,6 @@ _mesa_meta_check_generate_mipmap_fallback(GLcontext *ctx, GLenum target, _mesa_BindFramebufferEXT(GL_FRAMEBUFFER_EXT, fboSave); if (status != GL_FRAMEBUFFER_COMPLETE_EXT) { - printf("Can't render\n"); return GL_TRUE; } -- cgit v1.2.3 From f22c427bd685f55e6f7e29dcd72cdb1aa42f04d9 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Wed, 14 Oct 2009 14:18:36 -0400 Subject: r600: enable EXT_vertex_array_bgra extensions --- src/mesa/drivers/dri/r600/r600_context.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index 969144ba12..ba0d450cbb 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -131,6 +131,7 @@ const struct dri_extension card_extensions[] = { {"GL_EXT_texture_lod_bias", NULL}, {"GL_EXT_texture_mirror_clamp", NULL}, {"GL_EXT_texture_rectangle", NULL}, + {"GL_EXT_vertex_array_bgra", NULL}, {"GL_EXT_texture_sRGB", NULL}, {"GL_ATI_separate_stencil", GL_ATI_separate_stencil_functions}, {"GL_ATI_texture_env_combine3", NULL}, -- cgit v1.2.3 From 0187e042b681663938a1a12e9ae03c6f0ab48af5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 14 Oct 2009 15:00:50 -0600 Subject: mesa: remove unused ctx->Driver.TextureMatrix() hook --- src/mesa/drivers/common/driverfuncs.c | 1 - src/mesa/main/dd.h | 1 - src/mesa/main/texstate.c | 7 ------- 3 files changed, 9 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index 0f8447cb70..5934907cf0 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -183,7 +183,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->TexGen = NULL; driver->TexEnv = NULL; driver->TexParameter = NULL; - driver->TextureMatrix = NULL; driver->Viewport = NULL; /* vertex arrays */ diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index ce5e158626..a9632ec954 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -717,7 +717,6 @@ struct dd_function_table { void (*TexParameter)(GLcontext *ctx, GLenum target, struct gl_texture_object *texObj, GLenum pname, const GLfloat *params); - void (*TextureMatrix)(GLcontext *ctx, GLuint unit, const GLmatrix *mat); /** Set the viewport */ void (*Viewport)(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h); /*@}*/ diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 43f26873e0..16492bd7bc 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -307,10 +307,6 @@ _mesa_ActiveTextureARB(GLenum texture) /* update current stack pointer */ ctx->CurrentStack = &ctx->TextureMatrixStack[texUnit]; } - - if (ctx->Driver.ActiveTexture) { - (*ctx->Driver.ActiveTexture)( ctx, (GLuint) texUnit ); - } } @@ -360,9 +356,6 @@ update_texture_matrices( GLcontext *ctx ) if (ctx->Texture.Unit[u]._ReallyEnabled && ctx->TextureMatrixStack[u].Top->type != MATRIX_IDENTITY) ctx->Texture._TexMatEnabled |= ENABLE_TEXMAT(u); - - if (ctx->Driver.TextureMatrix) - ctx->Driver.TextureMatrix( ctx, u, ctx->TextureMatrixStack[u].Top); } } } -- cgit v1.2.3 From 73fc0ca4c36f258c4d0d7707dd3313a685c211bf Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 14 Oct 2009 15:11:12 -0600 Subject: mesa: remove unused ctx->Driver.PrioritizeTextures() hook --- src/mesa/drivers/common/driverfuncs.c | 1 - src/mesa/drivers/dri/mach64/mach64_tex.c | 1 - src/mesa/main/dd.h | 6 ------ src/mesa/main/texobj.c | 2 -- 4 files changed, 10 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index 5934907cf0..4d21b033f7 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -125,7 +125,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->UnmapTexture = NULL; driver->TextureMemCpy = _mesa_memcpy; driver->IsTextureResident = NULL; - driver->PrioritizeTexture = NULL; driver->ActiveTexture = NULL; driver->UpdateTexturePalette = NULL; diff --git a/src/mesa/drivers/dri/mach64/mach64_tex.c b/src/mesa/drivers/dri/mach64/mach64_tex.c index 225d23179e..5a22c93bd2 100644 --- a/src/mesa/drivers/dri/mach64/mach64_tex.c +++ b/src/mesa/drivers/dri/mach64/mach64_tex.c @@ -567,7 +567,6 @@ void mach64InitTextureFuncs( struct dd_function_table *functions ) functions->UpdateTexturePalette = NULL; functions->ActiveTexture = NULL; - functions->PrioritizeTexture = NULL; driInitTextureFormats(); } diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index a9632ec954..25aaddea81 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -544,12 +544,6 @@ struct dd_function_table { GLboolean (*IsTextureResident)( GLcontext *ctx, struct gl_texture_object *t ); - /** - * Called by glPrioritizeTextures(). - */ - void (*PrioritizeTexture)( GLcontext *ctx, struct gl_texture_object *t, - GLclampf priority ); - /** * Called by glActiveTextureARB() to set current texture unit. */ diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 8fd5eaa266..31832184c0 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -1098,8 +1098,6 @@ _mesa_PrioritizeTextures( GLsizei n, const GLuint *texName, struct gl_texture_object *t = _mesa_lookup_texture(ctx, texName[i]); if (t) { t->Priority = CLAMP( priorities[i], 0.0F, 1.0F ); - if (ctx->Driver.PrioritizeTexture) - ctx->Driver.PrioritizeTexture( ctx, t, t->Priority ); } } } -- cgit v1.2.3 From d9099f8602eb6d15e9fc2e0b0987e7a58fb98b68 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 14 Oct 2009 15:46:25 -0600 Subject: mesa: rename VERBOSE_IMMEDIATE->VERBOSE_MATERIAL to reflect what it does --- src/mesa/main/debug.c | 2 +- src/mesa/main/light.c | 2 +- src/mesa/main/mtypes.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 8492c8561d..530170b526 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -167,7 +167,7 @@ static void add_debug_flags( const char *debug ) static const struct debug_option debug_opt[] = { { "varray", VERBOSE_VARRAY }, { "tex", VERBOSE_TEXTURE }, - { "imm", VERBOSE_IMMEDIATE }, + { "mat", VERBOSE_MATERIAL }, { "pipe", VERBOSE_PIPELINE }, { "driver", VERBOSE_DRIVER }, { "state", VERBOSE_STATE }, diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index 10c89f4368..1c8a081e9a 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -636,7 +636,7 @@ _mesa_update_material( GLcontext *ctx, GLuint bitmask ) struct gl_light *light, *list = &ctx->Light.EnabledList; GLfloat (*mat)[4] = ctx->Light.Material.Attrib; - if (MESA_VERBOSE&VERBOSE_IMMEDIATE) + if (MESA_VERBOSE & VERBOSE_MATERIAL) _mesa_debug(ctx, "_mesa_update_material, mask 0x%x\n", bitmask); if (!bitmask) diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index a1184df281..f0f21f633f 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -3099,7 +3099,7 @@ enum _verbose { VERBOSE_VARRAY = 0x0001, VERBOSE_TEXTURE = 0x0002, - VERBOSE_IMMEDIATE = 0x0004, + VERBOSE_MATERIAL = 0x0004, VERBOSE_PIPELINE = 0x0008, VERBOSE_DRIVER = 0x0010, VERBOSE_STATE = 0x0020, -- cgit v1.2.3 From ade1cc992410c8696fdfe0f84fb613fd0dc8099f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 14 Oct 2009 16:23:22 -0600 Subject: mesa: added MESA_VERBOSE option 'draw' to debug glDrawArrays/Elements, etc. --- src/mesa/main/debug.c | 3 ++- src/mesa/main/mtypes.h | 3 +++ src/mesa/vbo/vbo_exec_array.c | 29 +++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 530170b526..07ed51f5ab 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -174,7 +174,8 @@ static void add_debug_flags( const char *debug ) { "api", VERBOSE_API }, { "list", VERBOSE_DISPLAY_LIST }, { "lighting", VERBOSE_LIGHTING }, - { "disassem", VERBOSE_DISASSEM } + { "disassem", VERBOSE_DISASSEM }, + { "draw", VERBOSE_DRAW } }; GLuint i; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index f0f21f633f..5699db5d4a 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -3095,6 +3095,7 @@ extern int MESA_DEBUG_FLAGS; #endif +/** The MESA_VERBOSE var is a bitmask of these flags */ enum _verbose { VERBOSE_VARRAY = 0x0001, @@ -3109,9 +3110,11 @@ enum _verbose VERBOSE_PRIMS = 0x0400, VERBOSE_VERTS = 0x0800, VERBOSE_DISASSEM = 0x1000, + VERBOSE_DRAW = 0x2000 }; +/** The MESA_DEBUG_FLAGS var is a bitmask of these flags */ enum _debug { DEBUG_ALWAYS_FLUSH = 0x1 diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index 774cffc451..0e1737c210 100644 --- a/src/mesa/vbo/vbo_exec_array.c +++ b/src/mesa/vbo/vbo_exec_array.c @@ -33,6 +33,7 @@ #include "main/api_noop.h" #include "main/varray.h" #include "main/bufferobj.h" +#include "main/enums.h" #include "main/macros.h" #include "glapi/dispatch.h" @@ -482,6 +483,10 @@ vbo_exec_DrawArrays(GLenum mode, GLint start, GLsizei count) struct vbo_exec_context *exec = &vbo->exec; struct _mesa_prim prim[1]; + if (MESA_VERBOSE & VERBOSE_DRAW) + _mesa_debug(ctx, "glDrawArrays(%s, %d, %d)\n", + _mesa_lookup_enum_by_nr(mode), start, count); + if (!_mesa_validate_DrawArrays( ctx, mode, start, count )) return; @@ -675,6 +680,12 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, static GLuint warnCount = 0; GET_CURRENT_CONTEXT(ctx); + if (MESA_VERBOSE & VERBOSE_DRAW) + _mesa_debug(ctx, + "glDrawRangeElementsBaseVertex(%s, %u, %u, %d, %s, %p, %d)\n", + _mesa_lookup_enum_by_nr(mode), start, end, count, + _mesa_lookup_enum_by_nr(type), indices, basevertex); + if (!_mesa_validate_DrawRangeElements( ctx, mode, start, end, count, type, indices, basevertex )) return; @@ -761,6 +772,14 @@ vbo_exec_DrawRangeElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices) { + GET_CURRENT_CONTEXT(ctx); + + if (MESA_VERBOSE & VERBOSE_DRAW) + _mesa_debug(ctx, + "glDrawRangeElements(%s, %u, %u, %d, %s, %p)\n", + _mesa_lookup_enum_by_nr(mode), start, end, count, + _mesa_lookup_enum_by_nr(type), indices); + vbo_exec_DrawRangeElementsBaseVertex(mode, start, end, count, type, indices, 0); } @@ -772,6 +791,11 @@ vbo_exec_DrawElements(GLenum mode, GLsizei count, GLenum type, { GET_CURRENT_CONTEXT(ctx); + if (MESA_VERBOSE & VERBOSE_DRAW) + _mesa_debug(ctx, "glDrawElements(%s, %u, %s, %p)\n", + _mesa_lookup_enum_by_nr(mode), count, + _mesa_lookup_enum_by_nr(type), indices); + if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices, 0 )) return; @@ -785,6 +809,11 @@ vbo_exec_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type, { GET_CURRENT_CONTEXT(ctx); + if (MESA_VERBOSE & VERBOSE_DRAW) + _mesa_debug(ctx, "glDrawElementsBaseVertex(%s, %d, %s, %p, %d)\n", + _mesa_lookup_enum_by_nr(mode), count, + _mesa_lookup_enum_by_nr(type), indices, basevertex); + if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices, basevertex )) return; -- cgit v1.2.3 From f9784072fee016e14e0319c705420becb2490bf9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 14 Oct 2009 16:23:52 -0600 Subject: vbo: clean-ups, reformatting --- src/mesa/vbo/vbo_exec_array.c | 49 +++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 25 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index 0e1737c210..fd70b57b72 100644 --- a/src/mesa/vbo/vbo_exec_array.c +++ b/src/mesa/vbo/vbo_exec_array.c @@ -54,10 +54,9 @@ vbo_get_minmax_index(GLcontext *ctx, const void *indices; if (_mesa_is_bufferobj(ib->obj)) { - const GLvoid *map = ctx->Driver.MapBuffer(ctx, - GL_ELEMENT_ARRAY_BUFFER_ARB, - GL_READ_ONLY, - ib->obj); + const GLvoid *map = + ctx->Driver.MapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, + GL_READ_ONLY, ib->obj); indices = ADD_POINTERS(map, ib->ptr); } else { indices = ib->ptr; @@ -106,9 +105,7 @@ vbo_get_minmax_index(GLcontext *ctx, } if (_mesa_is_bufferobj(ib->obj)) { - ctx->Driver.UnmapBuffer(ctx, - GL_ELEMENT_ARRAY_BUFFER_ARB, - ib->obj); + ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, ib->obj); } } @@ -126,10 +123,9 @@ check_array_data(GLcontext *ctx, struct gl_client_array *array, if (_mesa_is_bufferobj(array->BufferObj)) { if (!array->BufferObj->Pointer) { /* need to map now */ - array->BufferObj->Pointer = ctx->Driver.MapBuffer(ctx, - GL_ARRAY_BUFFER_ARB, - GL_READ_ONLY, - array->BufferObj); + array->BufferObj->Pointer = + ctx->Driver.MapBuffer(ctx, GL_ARRAY_BUFFER_ARB, + GL_READ_ONLY, array->BufferObj); } data = ADD_POINTERS(data, array->BufferObj->Pointer); } @@ -170,9 +166,7 @@ unmap_array_buffer(GLcontext *ctx, struct gl_client_array *array) if (array->Enabled && _mesa_is_bufferobj(array->BufferObj) && _mesa_bufferobj_mapped(array->BufferObj)) { - ctx->Driver.UnmapBuffer(ctx, - GL_ARRAY_BUFFER_ARB, - array->BufferObj); + ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER_ARB, array->BufferObj); } } @@ -223,13 +217,13 @@ check_draw_elements_data(GLcontext *ctx, GLsizei count, GLenum elemType, check_array_data(ctx, &arrayObj->TexCoord[k], VERT_ATTRIB_TEX0 + k, j); } for (k = 0; k < Elements(arrayObj->VertexAttrib); k++) { - check_array_data(ctx, &arrayObj->VertexAttrib[k], VERT_ATTRIB_GENERIC0 + k, j); + check_array_data(ctx, &arrayObj->VertexAttrib[k], + VERT_ATTRIB_GENERIC0 + k, j); } } if (_mesa_is_bufferobj(ctx->Array.ElementArrayBufferObj)) { - ctx->Driver.UnmapBuffer(ctx, - GL_ELEMENT_ARRAY_BUFFER_ARB, + ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, ctx->Array.ElementArrayBufferObj); } @@ -460,7 +454,6 @@ bind_arrays(GLcontext *ctx) } else if (exec->array.program_mode != get_program_mode(ctx) || exec->array.enabled_flags != ctx->Array.ArrayObj->_Enabled) { - recalculate_input_bindings(ctx); } #else @@ -587,11 +580,11 @@ dump_element_buffer(GLcontext *ctx, GLenum type) ; } - ctx->Driver.UnmapBuffer(ctx, - GL_ELEMENT_ARRAY_BUFFER_ARB, + ctx->Driver.UnmapBuffer(ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, ctx->Array.ElementArrayBufferObj); } + /* Inner support for both _mesa_DrawElements and _mesa_DrawRangeElements */ static void vbo_validated_drawrangeelements(GLcontext *ctx, GLenum mode, @@ -766,11 +759,10 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, count, type, indices, basevertex); } + static void GLAPIENTRY -vbo_exec_DrawRangeElements(GLenum mode, - GLuint start, GLuint end, - GLsizei count, GLenum type, - const GLvoid *indices) +vbo_exec_DrawRangeElements(GLenum mode, GLuint start, GLuint end, + GLsizei count, GLenum type, const GLvoid *indices) { GET_CURRENT_CONTEXT(ctx); @@ -803,6 +795,7 @@ vbo_exec_DrawElements(GLenum mode, GLsizei count, GLenum type, count, type, indices, 0); } + static void GLAPIENTRY vbo_exec_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex) @@ -822,7 +815,8 @@ vbo_exec_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type, count, type, indices, basevertex); } -/* Inner support for both _mesa_DrawElements and _mesa_DrawRangeElements */ + +/** Inner support for both _mesa_DrawElements and _mesa_DrawRangeElements */ static void vbo_validated_multidrawelements(GLcontext *ctx, GLenum mode, const GLsizei *count, GLenum type, @@ -957,6 +951,7 @@ vbo_validated_multidrawelements(GLcontext *ctx, GLenum mode, _mesa_free(prim); } + static void GLAPIENTRY vbo_exec_MultiDrawElements(GLenum mode, const GLsizei *count, GLenum type, @@ -978,6 +973,7 @@ vbo_exec_MultiDrawElements(GLenum mode, NULL); } + static void GLAPIENTRY vbo_exec_MultiDrawElementsBaseVertex(GLenum mode, const GLsizei *count, GLenum type, @@ -1067,6 +1063,7 @@ _mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, vbo_exec_DrawRangeElements(mode, start, end, count, type, indices); } + void GLAPIENTRY _mesa_DrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, @@ -1076,6 +1073,7 @@ _mesa_DrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end, indices, basevertex); } + /* GL_EXT_multi_draw_arrays */ void GLAPIENTRY _mesa_MultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type, @@ -1084,6 +1082,7 @@ _mesa_MultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type, vbo_exec_MultiDrawElements(mode, count, type, indices, primcount); } + void GLAPIENTRY _mesa_MultiDrawElementsBaseVertex(GLenum mode, const GLsizei *count, GLenum type, -- cgit v1.2.3 From 2fd5cb713338e91999a036399a4bea4406687ca0 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 14 Oct 2009 16:24:35 -0600 Subject: mesa: added VERBOSE_SWAPBUFFERS --- src/mesa/main/context.c | 2 ++ src/mesa/main/debug.c | 3 ++- src/mesa/main/mtypes.h | 3 ++- 3 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 95ff3495ab..ea1ee22812 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -173,6 +173,8 @@ GLfloat _mesa_ubyte_to_float_color_tab[256]; void _mesa_notifySwapBuffers(__GLcontext *ctx) { + if (MESA_VERBOSE & VERBOSE_SWAPBUFFERS) + _mesa_debug(ctx, "SwapBuffers\n"); FLUSH_CURRENT( ctx, 0 ); if (ctx->Driver.Flush) { ctx->Driver.Flush(ctx); diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 07ed51f5ab..490cc9c26b 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -175,7 +175,8 @@ static void add_debug_flags( const char *debug ) { "list", VERBOSE_DISPLAY_LIST }, { "lighting", VERBOSE_LIGHTING }, { "disassem", VERBOSE_DISASSEM }, - { "draw", VERBOSE_DRAW } + { "draw", VERBOSE_DRAW }, + { "swap", VERBOSE_SWAPBUFFERS } }; GLuint i; diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 5699db5d4a..988bfe1e22 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -3110,7 +3110,8 @@ enum _verbose VERBOSE_PRIMS = 0x0400, VERBOSE_VERTS = 0x0800, VERBOSE_DISASSEM = 0x1000, - VERBOSE_DRAW = 0x2000 + VERBOSE_DRAW = 0x2000, + VERBOSE_SWAPBUFFERS = 0x4000 }; -- cgit v1.2.3 From c47b03ebebd4db30bf5ed17b44c0f8757306b197 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 14 Oct 2009 13:14:22 -0600 Subject: radeon: initialize renderbuffer Format field in radeon_create_renderbuffer() Plus, use MESA_FORMAT_S8_Z24 everywhere. --- src/mesa/drivers/dri/radeon/radeon_fbo.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index 796dd1b423..21007d85c3 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -121,7 +121,7 @@ radeon_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_STENCIL_INDEX8_EXT: case GL_STENCIL_INDEX16_EXT: /* alloc a depth+stencil buffer */ - rb->Format = MESA_FORMAT_Z24_S8; + rb->Format = MESA_FORMAT_S8_Z24; rb->DataType = GL_UNSIGNED_INT_24_8_EXT; cpp = 4; break; @@ -139,7 +139,7 @@ radeon_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, break; case GL_DEPTH_STENCIL_EXT: case GL_DEPTH24_STENCIL8_EXT: - rb->Format = MESA_FORMAT_Z24_S8; + rb->Format = MESA_FORMAT_S8_Z24; rb->DataType = GL_UNSIGNED_INT_24_8_EXT; cpp = 4; break; @@ -255,30 +255,37 @@ radeon_create_renderbuffer(GLenum format, __DRIdrawablePrivate *driDrawPriv) /* XXX format junk */ switch (format) { case GL_RGB5: + rrb->base.Format = MESA_FORMAT_RGB565; rrb->base.DataType = GL_UNSIGNED_BYTE; rrb->base._BaseFormat = GL_RGB; break; case GL_RGB8: + rrb->base.Format = MESA_FORMAT_ARGB8888; rrb->base.DataType = GL_UNSIGNED_BYTE; rrb->base._BaseFormat = GL_RGB; break; case GL_RGBA8: + rrb->base.Format = MESA_FORMAT_ARGB8888; rrb->base.DataType = GL_UNSIGNED_BYTE; rrb->base._BaseFormat = GL_RGBA; break; case GL_STENCIL_INDEX8_EXT: + rrb->base.Format = MESA_FORMAT_S8; rrb->base.DataType = GL_UNSIGNED_BYTE; rrb->base._BaseFormat = GL_STENCIL_INDEX; break; case GL_DEPTH_COMPONENT16: + rrb->base.Format = MESA_FORMAT_Z16; rrb->base.DataType = GL_UNSIGNED_SHORT; rrb->base._BaseFormat = GL_DEPTH_COMPONENT; break; case GL_DEPTH_COMPONENT24: + rrb->base.Format = MESA_FORMAT_Z32; rrb->base.DataType = GL_UNSIGNED_INT; rrb->base._BaseFormat = GL_DEPTH_COMPONENT; break; case GL_DEPTH24_STENCIL8_EXT: + rrb->base.Format = MESA_FORMAT_S8_Z24; rrb->base.DataType = GL_UNSIGNED_INT_24_8_EXT; rrb->base._BaseFormat = GL_STENCIL_INDEX; break; -- cgit v1.2.3 From 269f16cd96fdbee5d178130171b4ef40258f61cf Mon Sep 17 00:00:00 2001 From: Neil Roberts Date: Wed, 14 Oct 2009 23:25:04 +0100 Subject: mesa: Use _mesa_strtod in the lexer for assembly shaders See bug 24531. --- src/mesa/shader/program_lexer.l | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/program_lexer.l b/src/mesa/shader/program_lexer.l index d240217481..c2803ff707 100644 --- a/src/mesa/shader/program_lexer.l +++ b/src/mesa/shader/program_lexer.l @@ -22,6 +22,7 @@ * DEALINGS IN THE SOFTWARE. */ #include "main/glheader.h" +#include "main/imports.h" #include "prog_instruction.h" #include "prog_statevars.h" @@ -318,19 +319,19 @@ ARRAYSHADOW2D { return_token_or_IDENTIFIER(require_ARB_fp && require return INTEGER; } {num}?{frac}{exp}? { - yylval->real = strtod(yytext, NULL); + yylval->real = _mesa_strtod(yytext, NULL); return REAL; } {num}"."/[^.] { - yylval->real = strtod(yytext, NULL); + yylval->real = _mesa_strtod(yytext, NULL); return REAL; } {num}{exp} { - yylval->real = strtod(yytext, NULL); + yylval->real = _mesa_strtod(yytext, NULL); return REAL; } {num}"."{exp} { - yylval->real = strtod(yytext, NULL); + yylval->real = _mesa_strtod(yytext, NULL); return REAL; } -- cgit v1.2.3 From 6f8b4d9e3625c7de83247596fd6822227da04336 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 15 Oct 2009 08:59:13 -0600 Subject: mesa: regenerated lex.yy.c w/ _mesa_strtod() --- src/mesa/shader/lex.yy.c | 385 ++++++++++++++++++++++++----------------------- 1 file changed, 193 insertions(+), 192 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/lex.yy.c b/src/mesa/shader/lex.yy.c index 709426f3a6..fefef573ee 100644 --- a/src/mesa/shader/lex.yy.c +++ b/src/mesa/shader/lex.yy.c @@ -900,6 +900,7 @@ static yyconst flex_int16_t yy_chk[1023] = * DEALINGS IN THE SOFTWARE. */ #include "main/glheader.h" +#include "main/imports.h" #include "prog_instruction.h" #include "prog_statevars.h" @@ -1003,7 +1004,7 @@ swiz_from_char(char c) } while(0); #define YY_EXTRA_TYPE struct asm_parser_state * -#line 1007 "lex.yy.c" +#line 1008 "lex.yy.c" #define INITIAL 0 @@ -1244,10 +1245,10 @@ YY_DECL register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 136 "program_lexer.l" +#line 137 "program_lexer.l" -#line 1251 "lex.yy.c" +#line 1252 "lex.yy.c" yylval = yylval_param; @@ -1336,17 +1337,17 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 138 "program_lexer.l" +#line 139 "program_lexer.l" { return ARBvp_10; } YY_BREAK case 2: YY_RULE_SETUP -#line 139 "program_lexer.l" +#line 140 "program_lexer.l" { return ARBfp_10; } YY_BREAK case 3: YY_RULE_SETUP -#line 140 "program_lexer.l" +#line 141 "program_lexer.l" { yylval->integer = at_address; return_token_or_IDENTIFIER(require_ARB_vp, ADDRESS); @@ -1354,747 +1355,747 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 144 "program_lexer.l" +#line 145 "program_lexer.l" { return ALIAS; } YY_BREAK case 5: YY_RULE_SETUP -#line 145 "program_lexer.l" +#line 146 "program_lexer.l" { return ATTRIB; } YY_BREAK case 6: YY_RULE_SETUP -#line 146 "program_lexer.l" +#line 147 "program_lexer.l" { return END; } YY_BREAK case 7: YY_RULE_SETUP -#line 147 "program_lexer.l" +#line 148 "program_lexer.l" { return OPTION; } YY_BREAK case 8: YY_RULE_SETUP -#line 148 "program_lexer.l" +#line 149 "program_lexer.l" { return OUTPUT; } YY_BREAK case 9: YY_RULE_SETUP -#line 149 "program_lexer.l" +#line 150 "program_lexer.l" { return PARAM; } YY_BREAK case 10: YY_RULE_SETUP -#line 150 "program_lexer.l" +#line 151 "program_lexer.l" { yylval->integer = at_temp; return TEMP; } YY_BREAK case 11: YY_RULE_SETUP -#line 152 "program_lexer.l" +#line 153 "program_lexer.l" { return_opcode( 1, VECTOR_OP, ABS, OFF); } YY_BREAK case 12: YY_RULE_SETUP -#line 153 "program_lexer.l" +#line 154 "program_lexer.l" { return_opcode(require_ARB_fp, VECTOR_OP, ABS, ZERO_ONE); } YY_BREAK case 13: YY_RULE_SETUP -#line 154 "program_lexer.l" +#line 155 "program_lexer.l" { return_opcode( 1, BIN_OP, ADD, OFF); } YY_BREAK case 14: YY_RULE_SETUP -#line 155 "program_lexer.l" +#line 156 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, ADD, ZERO_ONE); } YY_BREAK case 15: YY_RULE_SETUP -#line 156 "program_lexer.l" +#line 157 "program_lexer.l" { return_opcode(require_ARB_vp, ARL, ARL, OFF); } YY_BREAK case 16: YY_RULE_SETUP -#line 158 "program_lexer.l" +#line 159 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, CMP, OFF); } YY_BREAK case 17: YY_RULE_SETUP -#line 159 "program_lexer.l" +#line 160 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, CMP, ZERO_ONE); } YY_BREAK case 18: YY_RULE_SETUP -#line 160 "program_lexer.l" +#line 161 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, COS, OFF); } YY_BREAK case 19: YY_RULE_SETUP -#line 161 "program_lexer.l" +#line 162 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, COS, ZERO_ONE); } YY_BREAK case 20: YY_RULE_SETUP -#line 163 "program_lexer.l" +#line 164 "program_lexer.l" { return_opcode( 1, BIN_OP, DP3, OFF); } YY_BREAK case 21: YY_RULE_SETUP -#line 164 "program_lexer.l" +#line 165 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, DP3, ZERO_ONE); } YY_BREAK case 22: YY_RULE_SETUP -#line 165 "program_lexer.l" +#line 166 "program_lexer.l" { return_opcode( 1, BIN_OP, DP4, OFF); } YY_BREAK case 23: YY_RULE_SETUP -#line 166 "program_lexer.l" +#line 167 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, DP4, ZERO_ONE); } YY_BREAK case 24: YY_RULE_SETUP -#line 167 "program_lexer.l" +#line 168 "program_lexer.l" { return_opcode( 1, BIN_OP, DPH, OFF); } YY_BREAK case 25: YY_RULE_SETUP -#line 168 "program_lexer.l" +#line 169 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, DPH, ZERO_ONE); } YY_BREAK case 26: YY_RULE_SETUP -#line 169 "program_lexer.l" +#line 170 "program_lexer.l" { return_opcode( 1, BIN_OP, DST, OFF); } YY_BREAK case 27: YY_RULE_SETUP -#line 170 "program_lexer.l" +#line 171 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, DST, ZERO_ONE); } YY_BREAK case 28: YY_RULE_SETUP -#line 172 "program_lexer.l" +#line 173 "program_lexer.l" { return_opcode( 1, SCALAR_OP, EX2, OFF); } YY_BREAK case 29: YY_RULE_SETUP -#line 173 "program_lexer.l" +#line 174 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, EX2, ZERO_ONE); } YY_BREAK case 30: YY_RULE_SETUP -#line 174 "program_lexer.l" +#line 175 "program_lexer.l" { return_opcode(require_ARB_vp, SCALAR_OP, EXP, OFF); } YY_BREAK case 31: YY_RULE_SETUP -#line 176 "program_lexer.l" +#line 177 "program_lexer.l" { return_opcode( 1, VECTOR_OP, FLR, OFF); } YY_BREAK case 32: YY_RULE_SETUP -#line 177 "program_lexer.l" +#line 178 "program_lexer.l" { return_opcode(require_ARB_fp, VECTOR_OP, FLR, ZERO_ONE); } YY_BREAK case 33: YY_RULE_SETUP -#line 178 "program_lexer.l" +#line 179 "program_lexer.l" { return_opcode( 1, VECTOR_OP, FRC, OFF); } YY_BREAK case 34: YY_RULE_SETUP -#line 179 "program_lexer.l" +#line 180 "program_lexer.l" { return_opcode(require_ARB_fp, VECTOR_OP, FRC, ZERO_ONE); } YY_BREAK case 35: YY_RULE_SETUP -#line 181 "program_lexer.l" +#line 182 "program_lexer.l" { return_opcode(require_ARB_fp, KIL, KIL, OFF); } YY_BREAK case 36: YY_RULE_SETUP -#line 183 "program_lexer.l" +#line 184 "program_lexer.l" { return_opcode( 1, VECTOR_OP, LIT, OFF); } YY_BREAK case 37: YY_RULE_SETUP -#line 184 "program_lexer.l" +#line 185 "program_lexer.l" { return_opcode(require_ARB_fp, VECTOR_OP, LIT, ZERO_ONE); } YY_BREAK case 38: YY_RULE_SETUP -#line 185 "program_lexer.l" +#line 186 "program_lexer.l" { return_opcode( 1, SCALAR_OP, LG2, OFF); } YY_BREAK case 39: YY_RULE_SETUP -#line 186 "program_lexer.l" +#line 187 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, LG2, ZERO_ONE); } YY_BREAK case 40: YY_RULE_SETUP -#line 187 "program_lexer.l" +#line 188 "program_lexer.l" { return_opcode(require_ARB_vp, SCALAR_OP, LOG, OFF); } YY_BREAK case 41: YY_RULE_SETUP -#line 188 "program_lexer.l" +#line 189 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, LRP, OFF); } YY_BREAK case 42: YY_RULE_SETUP -#line 189 "program_lexer.l" +#line 190 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, LRP, ZERO_ONE); } YY_BREAK case 43: YY_RULE_SETUP -#line 191 "program_lexer.l" +#line 192 "program_lexer.l" { return_opcode( 1, TRI_OP, MAD, OFF); } YY_BREAK case 44: YY_RULE_SETUP -#line 192 "program_lexer.l" +#line 193 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, MAD, ZERO_ONE); } YY_BREAK case 45: YY_RULE_SETUP -#line 193 "program_lexer.l" +#line 194 "program_lexer.l" { return_opcode( 1, BIN_OP, MAX, OFF); } YY_BREAK case 46: YY_RULE_SETUP -#line 194 "program_lexer.l" +#line 195 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, MAX, ZERO_ONE); } YY_BREAK case 47: YY_RULE_SETUP -#line 195 "program_lexer.l" +#line 196 "program_lexer.l" { return_opcode( 1, BIN_OP, MIN, OFF); } YY_BREAK case 48: YY_RULE_SETUP -#line 196 "program_lexer.l" +#line 197 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, MIN, ZERO_ONE); } YY_BREAK case 49: YY_RULE_SETUP -#line 197 "program_lexer.l" +#line 198 "program_lexer.l" { return_opcode( 1, VECTOR_OP, MOV, OFF); } YY_BREAK case 50: YY_RULE_SETUP -#line 198 "program_lexer.l" +#line 199 "program_lexer.l" { return_opcode(require_ARB_fp, VECTOR_OP, MOV, ZERO_ONE); } YY_BREAK case 51: YY_RULE_SETUP -#line 199 "program_lexer.l" +#line 200 "program_lexer.l" { return_opcode( 1, BIN_OP, MUL, OFF); } YY_BREAK case 52: YY_RULE_SETUP -#line 200 "program_lexer.l" +#line 201 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, MUL, ZERO_ONE); } YY_BREAK case 53: YY_RULE_SETUP -#line 202 "program_lexer.l" +#line 203 "program_lexer.l" { return_opcode( 1, BINSC_OP, POW, OFF); } YY_BREAK case 54: YY_RULE_SETUP -#line 203 "program_lexer.l" +#line 204 "program_lexer.l" { return_opcode(require_ARB_fp, BINSC_OP, POW, ZERO_ONE); } YY_BREAK case 55: YY_RULE_SETUP -#line 205 "program_lexer.l" +#line 206 "program_lexer.l" { return_opcode( 1, SCALAR_OP, RCP, OFF); } YY_BREAK case 56: YY_RULE_SETUP -#line 206 "program_lexer.l" +#line 207 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, RCP, ZERO_ONE); } YY_BREAK case 57: YY_RULE_SETUP -#line 207 "program_lexer.l" +#line 208 "program_lexer.l" { return_opcode( 1, SCALAR_OP, RSQ, OFF); } YY_BREAK case 58: YY_RULE_SETUP -#line 208 "program_lexer.l" +#line 209 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, RSQ, ZERO_ONE); } YY_BREAK case 59: YY_RULE_SETUP -#line 210 "program_lexer.l" +#line 211 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, SCS, OFF); } YY_BREAK case 60: YY_RULE_SETUP -#line 211 "program_lexer.l" +#line 212 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, SCS, ZERO_ONE); } YY_BREAK case 61: YY_RULE_SETUP -#line 212 "program_lexer.l" +#line 213 "program_lexer.l" { return_opcode( 1, BIN_OP, SGE, OFF); } YY_BREAK case 62: YY_RULE_SETUP -#line 213 "program_lexer.l" +#line 214 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, SGE, ZERO_ONE); } YY_BREAK case 63: YY_RULE_SETUP -#line 214 "program_lexer.l" +#line 215 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, SIN, OFF); } YY_BREAK case 64: YY_RULE_SETUP -#line 215 "program_lexer.l" +#line 216 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, SIN, ZERO_ONE); } YY_BREAK case 65: YY_RULE_SETUP -#line 216 "program_lexer.l" +#line 217 "program_lexer.l" { return_opcode( 1, BIN_OP, SLT, OFF); } YY_BREAK case 66: YY_RULE_SETUP -#line 217 "program_lexer.l" +#line 218 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, SLT, ZERO_ONE); } YY_BREAK case 67: YY_RULE_SETUP -#line 218 "program_lexer.l" +#line 219 "program_lexer.l" { return_opcode( 1, BIN_OP, SUB, OFF); } YY_BREAK case 68: YY_RULE_SETUP -#line 219 "program_lexer.l" +#line 220 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, SUB, ZERO_ONE); } YY_BREAK case 69: YY_RULE_SETUP -#line 220 "program_lexer.l" +#line 221 "program_lexer.l" { return_opcode( 1, SWZ, SWZ, OFF); } YY_BREAK case 70: YY_RULE_SETUP -#line 221 "program_lexer.l" +#line 222 "program_lexer.l" { return_opcode(require_ARB_fp, SWZ, SWZ, ZERO_ONE); } YY_BREAK case 71: YY_RULE_SETUP -#line 223 "program_lexer.l" +#line 224 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, OFF); } YY_BREAK case 72: YY_RULE_SETUP -#line 224 "program_lexer.l" +#line 225 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, ZERO_ONE); } YY_BREAK case 73: YY_RULE_SETUP -#line 225 "program_lexer.l" +#line 226 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, OFF); } YY_BREAK case 74: YY_RULE_SETUP -#line 226 "program_lexer.l" +#line 227 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, ZERO_ONE); } YY_BREAK case 75: YY_RULE_SETUP -#line 227 "program_lexer.l" +#line 228 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, OFF); } YY_BREAK case 76: YY_RULE_SETUP -#line 228 "program_lexer.l" +#line 229 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, ZERO_ONE); } YY_BREAK case 77: YY_RULE_SETUP -#line 230 "program_lexer.l" +#line 231 "program_lexer.l" { return_opcode( 1, BIN_OP, XPD, OFF); } YY_BREAK case 78: YY_RULE_SETUP -#line 231 "program_lexer.l" +#line 232 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, XPD, ZERO_ONE); } YY_BREAK case 79: YY_RULE_SETUP -#line 233 "program_lexer.l" +#line 234 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_vp, VERTEX); } YY_BREAK case 80: YY_RULE_SETUP -#line 234 "program_lexer.l" +#line 235 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, FRAGMENT); } YY_BREAK case 81: YY_RULE_SETUP -#line 235 "program_lexer.l" +#line 236 "program_lexer.l" { return PROGRAM; } YY_BREAK case 82: YY_RULE_SETUP -#line 236 "program_lexer.l" +#line 237 "program_lexer.l" { return STATE; } YY_BREAK case 83: YY_RULE_SETUP -#line 237 "program_lexer.l" +#line 238 "program_lexer.l" { return RESULT; } YY_BREAK case 84: YY_RULE_SETUP -#line 239 "program_lexer.l" +#line 240 "program_lexer.l" { return AMBIENT; } YY_BREAK case 85: YY_RULE_SETUP -#line 240 "program_lexer.l" +#line 241 "program_lexer.l" { return ATTENUATION; } YY_BREAK case 86: YY_RULE_SETUP -#line 241 "program_lexer.l" +#line 242 "program_lexer.l" { return BACK; } YY_BREAK case 87: YY_RULE_SETUP -#line 242 "program_lexer.l" +#line 243 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, CLIP); } YY_BREAK case 88: YY_RULE_SETUP -#line 243 "program_lexer.l" +#line 244 "program_lexer.l" { return COLOR; } YY_BREAK case 89: YY_RULE_SETUP -#line 244 "program_lexer.l" +#line 245 "program_lexer.l" { return_token_or_DOT(require_ARB_fp, DEPTH); } YY_BREAK case 90: YY_RULE_SETUP -#line 245 "program_lexer.l" +#line 246 "program_lexer.l" { return DIFFUSE; } YY_BREAK case 91: YY_RULE_SETUP -#line 246 "program_lexer.l" +#line 247 "program_lexer.l" { return DIRECTION; } YY_BREAK case 92: YY_RULE_SETUP -#line 247 "program_lexer.l" +#line 248 "program_lexer.l" { return EMISSION; } YY_BREAK case 93: YY_RULE_SETUP -#line 248 "program_lexer.l" +#line 249 "program_lexer.l" { return ENV; } YY_BREAK case 94: YY_RULE_SETUP -#line 249 "program_lexer.l" +#line 250 "program_lexer.l" { return EYE; } YY_BREAK case 95: YY_RULE_SETUP -#line 250 "program_lexer.l" +#line 251 "program_lexer.l" { return FOGCOORD; } YY_BREAK case 96: YY_RULE_SETUP -#line 251 "program_lexer.l" +#line 252 "program_lexer.l" { return FOG; } YY_BREAK case 97: YY_RULE_SETUP -#line 252 "program_lexer.l" +#line 253 "program_lexer.l" { return FRONT; } YY_BREAK case 98: YY_RULE_SETUP -#line 253 "program_lexer.l" +#line 254 "program_lexer.l" { return HALF; } YY_BREAK case 99: YY_RULE_SETUP -#line 254 "program_lexer.l" +#line 255 "program_lexer.l" { return INVERSE; } YY_BREAK case 100: YY_RULE_SETUP -#line 255 "program_lexer.l" +#line 256 "program_lexer.l" { return INVTRANS; } YY_BREAK case 101: YY_RULE_SETUP -#line 256 "program_lexer.l" +#line 257 "program_lexer.l" { return LIGHT; } YY_BREAK case 102: YY_RULE_SETUP -#line 257 "program_lexer.l" +#line 258 "program_lexer.l" { return LIGHTMODEL; } YY_BREAK case 103: YY_RULE_SETUP -#line 258 "program_lexer.l" +#line 259 "program_lexer.l" { return LIGHTPROD; } YY_BREAK case 104: YY_RULE_SETUP -#line 259 "program_lexer.l" +#line 260 "program_lexer.l" { return LOCAL; } YY_BREAK case 105: YY_RULE_SETUP -#line 260 "program_lexer.l" +#line 261 "program_lexer.l" { return MATERIAL; } YY_BREAK case 106: YY_RULE_SETUP -#line 261 "program_lexer.l" +#line 262 "program_lexer.l" { return MAT_PROGRAM; } YY_BREAK case 107: YY_RULE_SETUP -#line 262 "program_lexer.l" +#line 263 "program_lexer.l" { return MATRIX; } YY_BREAK case 108: YY_RULE_SETUP -#line 263 "program_lexer.l" +#line 264 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, MATRIXINDEX); } YY_BREAK case 109: YY_RULE_SETUP -#line 264 "program_lexer.l" +#line 265 "program_lexer.l" { return MODELVIEW; } YY_BREAK case 110: YY_RULE_SETUP -#line 265 "program_lexer.l" +#line 266 "program_lexer.l" { return MVP; } YY_BREAK case 111: YY_RULE_SETUP -#line 266 "program_lexer.l" +#line 267 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, NORMAL); } YY_BREAK case 112: YY_RULE_SETUP -#line 267 "program_lexer.l" +#line 268 "program_lexer.l" { return OBJECT; } YY_BREAK case 113: YY_RULE_SETUP -#line 268 "program_lexer.l" +#line 269 "program_lexer.l" { return PALETTE; } YY_BREAK case 114: YY_RULE_SETUP -#line 269 "program_lexer.l" +#line 270 "program_lexer.l" { return PARAMS; } YY_BREAK case 115: YY_RULE_SETUP -#line 270 "program_lexer.l" +#line 271 "program_lexer.l" { return PLANE; } YY_BREAK case 116: YY_RULE_SETUP -#line 271 "program_lexer.l" +#line 272 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, POINT_TOK); } YY_BREAK case 117: YY_RULE_SETUP -#line 272 "program_lexer.l" +#line 273 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, POINTSIZE); } YY_BREAK case 118: YY_RULE_SETUP -#line 273 "program_lexer.l" +#line 274 "program_lexer.l" { return POSITION; } YY_BREAK case 119: YY_RULE_SETUP -#line 274 "program_lexer.l" +#line 275 "program_lexer.l" { return PRIMARY; } YY_BREAK case 120: YY_RULE_SETUP -#line 275 "program_lexer.l" +#line 276 "program_lexer.l" { return PROJECTION; } YY_BREAK case 121: YY_RULE_SETUP -#line 276 "program_lexer.l" +#line 277 "program_lexer.l" { return_token_or_DOT(require_ARB_fp, RANGE); } YY_BREAK case 122: YY_RULE_SETUP -#line 277 "program_lexer.l" +#line 278 "program_lexer.l" { return ROW; } YY_BREAK case 123: YY_RULE_SETUP -#line 278 "program_lexer.l" +#line 279 "program_lexer.l" { return SCENECOLOR; } YY_BREAK case 124: YY_RULE_SETUP -#line 279 "program_lexer.l" +#line 280 "program_lexer.l" { return SECONDARY; } YY_BREAK case 125: YY_RULE_SETUP -#line 280 "program_lexer.l" +#line 281 "program_lexer.l" { return SHININESS; } YY_BREAK case 126: YY_RULE_SETUP -#line 281 "program_lexer.l" +#line 282 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, SIZE_TOK); } YY_BREAK case 127: YY_RULE_SETUP -#line 282 "program_lexer.l" +#line 283 "program_lexer.l" { return SPECULAR; } YY_BREAK case 128: YY_RULE_SETUP -#line 283 "program_lexer.l" +#line 284 "program_lexer.l" { return SPOT; } YY_BREAK case 129: YY_RULE_SETUP -#line 284 "program_lexer.l" +#line 285 "program_lexer.l" { return TEXCOORD; } YY_BREAK case 130: YY_RULE_SETUP -#line 285 "program_lexer.l" +#line 286 "program_lexer.l" { return_token_or_DOT(require_ARB_fp, TEXENV); } YY_BREAK case 131: YY_RULE_SETUP -#line 286 "program_lexer.l" +#line 287 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN); } YY_BREAK case 132: YY_RULE_SETUP -#line 287 "program_lexer.l" +#line 288 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN_Q); } YY_BREAK case 133: YY_RULE_SETUP -#line 288 "program_lexer.l" +#line 289 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN_S); } YY_BREAK case 134: YY_RULE_SETUP -#line 289 "program_lexer.l" +#line 290 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN_T); } YY_BREAK case 135: YY_RULE_SETUP -#line 290 "program_lexer.l" +#line 291 "program_lexer.l" { return TEXTURE; } YY_BREAK case 136: YY_RULE_SETUP -#line 291 "program_lexer.l" +#line 292 "program_lexer.l" { return TRANSPOSE; } YY_BREAK case 137: YY_RULE_SETUP -#line 292 "program_lexer.l" +#line 293 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, VTXATTRIB); } YY_BREAK case 138: YY_RULE_SETUP -#line 293 "program_lexer.l" +#line 294 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, WEIGHT); } YY_BREAK case 139: YY_RULE_SETUP -#line 295 "program_lexer.l" +#line 296 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEXTURE_UNIT); } YY_BREAK case 140: YY_RULE_SETUP -#line 296 "program_lexer.l" +#line 297 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_1D); } YY_BREAK case 141: YY_RULE_SETUP -#line 297 "program_lexer.l" +#line 298 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_2D); } YY_BREAK case 142: YY_RULE_SETUP -#line 298 "program_lexer.l" +#line 299 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_3D); } YY_BREAK case 143: YY_RULE_SETUP -#line 299 "program_lexer.l" +#line 300 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_CUBE); } YY_BREAK case 144: YY_RULE_SETUP -#line 300 "program_lexer.l" +#line 301 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_rect, TEX_RECT); } YY_BREAK case 145: YY_RULE_SETUP -#line 301 "program_lexer.l" +#line 302 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW1D); } YY_BREAK case 146: YY_RULE_SETUP -#line 302 "program_lexer.l" +#line 303 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW2D); } YY_BREAK case 147: YY_RULE_SETUP -#line 303 "program_lexer.l" +#line 304 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_rect, TEX_SHADOWRECT); } YY_BREAK case 148: YY_RULE_SETUP -#line 304 "program_lexer.l" +#line 305 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY1D); } YY_BREAK case 149: YY_RULE_SETUP -#line 305 "program_lexer.l" +#line 306 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY2D); } YY_BREAK case 150: YY_RULE_SETUP -#line 306 "program_lexer.l" +#line 307 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW1D); } YY_BREAK case 151: YY_RULE_SETUP -#line 307 "program_lexer.l" +#line 308 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW2D); } YY_BREAK case 152: YY_RULE_SETUP -#line 309 "program_lexer.l" +#line 310 "program_lexer.l" { yylval->string = strdup(yytext); return IDENTIFIER; @@ -2102,12 +2103,12 @@ YY_RULE_SETUP YY_BREAK case 153: YY_RULE_SETUP -#line 314 "program_lexer.l" +#line 315 "program_lexer.l" { return DOT_DOT; } YY_BREAK case 154: YY_RULE_SETUP -#line 316 "program_lexer.l" +#line 317 "program_lexer.l" { yylval->integer = strtol(yytext, NULL, 10); return INTEGER; @@ -2115,9 +2116,9 @@ YY_RULE_SETUP YY_BREAK case 155: YY_RULE_SETUP -#line 320 "program_lexer.l" +#line 321 "program_lexer.l" { - yylval->real = strtod(yytext, NULL); + yylval->real = _mesa_strtod(yytext, NULL); return REAL; } YY_BREAK @@ -2127,31 +2128,31 @@ case 156: yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 324 "program_lexer.l" +#line 325 "program_lexer.l" { - yylval->real = strtod(yytext, NULL); + yylval->real = _mesa_strtod(yytext, NULL); return REAL; } YY_BREAK case 157: YY_RULE_SETUP -#line 328 "program_lexer.l" +#line 329 "program_lexer.l" { - yylval->real = strtod(yytext, NULL); + yylval->real = _mesa_strtod(yytext, NULL); return REAL; } YY_BREAK case 158: YY_RULE_SETUP -#line 332 "program_lexer.l" +#line 333 "program_lexer.l" { - yylval->real = strtod(yytext, NULL); + yylval->real = _mesa_strtod(yytext, NULL); return REAL; } YY_BREAK case 159: YY_RULE_SETUP -#line 337 "program_lexer.l" +#line 338 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; @@ -2160,7 +2161,7 @@ YY_RULE_SETUP YY_BREAK case 160: YY_RULE_SETUP -#line 343 "program_lexer.l" +#line 344 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@ -2170,7 +2171,7 @@ YY_RULE_SETUP YY_BREAK case 161: YY_RULE_SETUP -#line 349 "program_lexer.l" +#line 350 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; @@ -2179,7 +2180,7 @@ YY_RULE_SETUP YY_BREAK case 162: YY_RULE_SETUP -#line 354 "program_lexer.l" +#line 355 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; @@ -2188,7 +2189,7 @@ YY_RULE_SETUP YY_BREAK case 163: YY_RULE_SETUP -#line 360 "program_lexer.l" +#line 361 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@ -2198,7 +2199,7 @@ YY_RULE_SETUP YY_BREAK case 164: YY_RULE_SETUP -#line 366 "program_lexer.l" +#line 367 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@ -2208,7 +2209,7 @@ YY_RULE_SETUP YY_BREAK case 165: YY_RULE_SETUP -#line 372 "program_lexer.l" +#line 373 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; @@ -2217,7 +2218,7 @@ YY_RULE_SETUP YY_BREAK case 166: YY_RULE_SETUP -#line 378 "program_lexer.l" +#line 379 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@ -2227,7 +2228,7 @@ YY_RULE_SETUP YY_BREAK case 167: YY_RULE_SETUP -#line 385 "program_lexer.l" +#line 386 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@ -2239,7 +2240,7 @@ YY_RULE_SETUP YY_BREAK case 168: YY_RULE_SETUP -#line 394 "program_lexer.l" +#line 395 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; @@ -2248,7 +2249,7 @@ YY_RULE_SETUP YY_BREAK case 169: YY_RULE_SETUP -#line 400 "program_lexer.l" +#line 401 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@ -2258,7 +2259,7 @@ YY_RULE_SETUP YY_BREAK case 170: YY_RULE_SETUP -#line 406 "program_lexer.l" +#line 407 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; @@ -2267,7 +2268,7 @@ YY_RULE_SETUP YY_BREAK case 171: YY_RULE_SETUP -#line 411 "program_lexer.l" +#line 412 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; @@ -2276,7 +2277,7 @@ YY_RULE_SETUP YY_BREAK case 172: YY_RULE_SETUP -#line 417 "program_lexer.l" +#line 418 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@ -2286,7 +2287,7 @@ YY_RULE_SETUP YY_BREAK case 173: YY_RULE_SETUP -#line 423 "program_lexer.l" +#line 424 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@ -2296,7 +2297,7 @@ YY_RULE_SETUP YY_BREAK case 174: YY_RULE_SETUP -#line 429 "program_lexer.l" +#line 430 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; @@ -2305,7 +2306,7 @@ YY_RULE_SETUP YY_BREAK case 175: YY_RULE_SETUP -#line 435 "program_lexer.l" +#line 436 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@ -2315,7 +2316,7 @@ YY_RULE_SETUP YY_BREAK case 176: YY_RULE_SETUP -#line 443 "program_lexer.l" +#line 444 "program_lexer.l" { if (require_ARB_vp) { return TEXGEN_R; @@ -2329,7 +2330,7 @@ YY_RULE_SETUP YY_BREAK case 177: YY_RULE_SETUP -#line 454 "program_lexer.l" +#line 455 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@ -2341,13 +2342,13 @@ YY_RULE_SETUP YY_BREAK case 178: YY_RULE_SETUP -#line 463 "program_lexer.l" +#line 464 "program_lexer.l" { return DOT; } YY_BREAK case 179: /* rule 179 can match eol */ YY_RULE_SETUP -#line 465 "program_lexer.l" +#line 466 "program_lexer.l" { yylloc->first_line++; yylloc->first_column = 1; @@ -2358,7 +2359,7 @@ YY_RULE_SETUP YY_BREAK case 180: YY_RULE_SETUP -#line 472 "program_lexer.l" +#line 473 "program_lexer.l" /* eat whitespace */ ; YY_BREAK case 181: @@ -2366,20 +2367,20 @@ case 181: yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 473 "program_lexer.l" +#line 474 "program_lexer.l" /* eat comments */ ; YY_BREAK case 182: YY_RULE_SETUP -#line 474 "program_lexer.l" +#line 475 "program_lexer.l" { return yytext[0]; } YY_BREAK case 183: YY_RULE_SETUP -#line 475 "program_lexer.l" +#line 476 "program_lexer.l" ECHO; YY_BREAK -#line 2383 "lex.yy.c" +#line 2384 "lex.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -3554,7 +3555,7 @@ void yyfree (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 475 "program_lexer.l" +#line 476 "program_lexer.l" -- cgit v1.2.3 From f7285bdffcd8cca1c7d3066d38907a5987e844ea Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Tue, 29 Sep 2009 09:46:29 +0300 Subject: r600: clear position enable bit when when wpos is not used by FP Makes doom3 alot nicer.. --- src/mesa/drivers/dri/r600/r700_fragprog.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_fragprog.c b/src/mesa/drivers/dri/r600/r700_fragprog.c index 78ce3ae436..62a1ea1a22 100644 --- a/src/mesa/drivers/dri/r600/r700_fragprog.c +++ b/src/mesa/drivers/dri/r600/r700_fragprog.c @@ -341,6 +341,11 @@ GLboolean r700SetupFragmentProgram(GLcontext * ctx) SETbit(r700->SPI_PS_IN_CONTROL_0.u32All, POSITION_ENA_bit); SETbit(r700->SPI_INPUT_Z.u32All, PROVIDE_Z_TO_SPI_bit); } + else + { + CLEARbit(r700->SPI_PS_IN_CONTROL_0.u32All, POSITION_ENA_bit); + CLEARbit(r700->SPI_INPUT_Z.u32All, PROVIDE_Z_TO_SPI_bit); + } ui = (unNumOfReg < ui) ? ui : unNumOfReg; -- cgit v1.2.3 From 5101215a64a69a212241eadba7f097cef33a0b5c Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Mon, 28 Sep 2009 10:42:35 +0300 Subject: r600: user correct alpha blend factor Signed-off-by: Dave Airlie --- src/mesa/drivers/dri/r600/r700_state.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index 98f116d0a6..0d1f906d84 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -467,10 +467,10 @@ static void r700SetBlendState(GLcontext * ctx) eqn, COLOR_COMB_FCN_shift, COLOR_COMB_FCN_mask); SETfield(blend_reg, - blend_factor(ctx->Color.BlendSrcRGB, GL_TRUE), + blend_factor(ctx->Color.BlendSrcA, GL_TRUE), ALPHA_SRCBLEND_shift, ALPHA_SRCBLEND_mask); SETfield(blend_reg, - blend_factor(ctx->Color.BlendDstRGB, GL_FALSE), + blend_factor(ctx->Color.BlendDstA, GL_FALSE), ALPHA_DESTBLEND_shift, ALPHA_DESTBLEND_mask); switch (ctx->Color.BlendEquationA) { -- cgit v1.2.3 From bf68e54a4d69bdd9a01656919d3cd752c96157b3 Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Mon, 28 Sep 2009 11:23:49 +0300 Subject: r600: use CB_TARGET_MASK instead of CB_SHADER_MASK for setting color mask makes blend functions work better Signed-off-by: Dave Airlie --- src/mesa/drivers/dri/r600/r700_state.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index 0d1f906d84..244a016e07 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -745,9 +745,9 @@ static void r700ColorMask(GLcontext * ctx, (b ? 4 : 0) | (a ? 8 : 0)); - if (mask != r700->CB_SHADER_MASK.u32All) { + if (mask != r700->CB_TARGET_MASK.u32All) { R600_STATECHANGE(context, cb); - SETfield(r700->CB_SHADER_MASK.u32All, mask, OUTPUT0_ENABLE_shift, OUTPUT0_ENABLE_mask); + SETfield(r700->CB_TARGET_MASK.u32All, mask, TARGET0_ENABLE_shift, TARGET0_ENABLE_mask); } } @@ -1758,7 +1758,7 @@ void r700InitState(GLcontext * ctx) //------------------- r700->CB_CLRCMP_MSK.u32All = 0xFFFFFFFF; /* screen/window/view */ - SETfield(r700->CB_TARGET_MASK.u32All, 0xF, (4 * id), TARGET0_ENABLE_mask); + SETfield(r700->CB_SHADER_MASK.u32All, 0xF, (4 * id), OUTPUT0_ENABLE_mask); context->radeon.hw.all_dirty = GL_TRUE; -- cgit v1.2.3 From 95851d8cb232cbd1312d2b8de471ba2aeb276911 Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Fri, 9 Oct 2009 10:46:12 +0300 Subject: r600: fixup KIL instruction a bit - KILLGT takes 2 arguments - arb KIL has no dst register - add TODO about clause ending but currently piglit fp-kil passes and does not hang the card --- src/mesa/drivers/dri/r600/r700_assembler.c | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 00eda544d4..e79c256c6b 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -336,7 +336,8 @@ unsigned int r700GetNumOperands(r700_AssemblerBase* pAsm) switch (pAsm->D.dst.opcode) { - case SQ_OP2_INST_ADD: + case SQ_OP2_INST_ADD: + case SQ_OP2_INST_KILLGT: case SQ_OP2_INST_MUL: case SQ_OP2_INST_MAX: case SQ_OP2_INST_MIN: @@ -356,7 +357,6 @@ unsigned int r700GetNumOperands(r700_AssemblerBase* pAsm) case SQ_OP2_INST_MOV: case SQ_OP2_INST_FRACT: case SQ_OP2_INST_FLOOR: - case SQ_OP2_INST_KILLGT: case SQ_OP2_INST_EXP_IEEE: case SQ_OP2_INST_LOG_CLAMPED: case SQ_OP2_INST_LOG_IEEE: @@ -2617,15 +2617,15 @@ GLboolean assemble_FRC(r700_AssemblerBase *pAsm) GLboolean assemble_KIL(r700_AssemblerBase *pAsm) { + /* TODO: doc says KILL has to be last(end) ALU clause */ + checkop1(pAsm); pAsm->D.dst.opcode = SQ_OP2_INST_KILLGT; - - if ( GL_FALSE == assemble_dst(pAsm) ) - { - return GL_FALSE; - } + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = 0; pAsm->D.dst.writex = 0; pAsm->D.dst.writey = 0; pAsm->D.dst.writez = 0; @@ -2638,20 +2638,11 @@ GLboolean assemble_KIL(r700_AssemblerBase *pAsm) setswizzle_PVSSRC(&(pAsm->S[0].src), SQ_SEL_0); noneg_PVSSRC(&(pAsm->S[0].src)); - pAsm->S[1].src.rtype = SRC_REG_TEMPORARY; - - if(PROGRAM_TEMPORARY == pAsm->pILInst[pAsm->uiCurInst].DstReg.File) + if ( GL_FALSE == assemble_src(pAsm, 0, 1) ) { - pAsm->S[1].src.reg = pAsm->pILInst[pAsm->uiCurInst].DstReg.Index + pAsm->starting_temp_register_number; - } - else - { //PROGRAM_OUTPUT - pAsm->S[1].src.reg = pAsm->uiFP_OutputMap[pAsm->pILInst[pAsm->uiCurInst].DstReg.Index]; + return GL_FALSE; } - setaddrmode_PVSSRC(&(pAsm->S[1].src), ADDR_ABSOLUTE); - noswizzle_PVSSRC(&(pAsm->S[1].src)); - if ( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; -- cgit v1.2.3 From 74c31e5d05f7ed342fb143cb6f637b54e8961973 Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Mon, 12 Oct 2009 12:20:26 +0300 Subject: r600: DPH adds w comp of second operand, so set first one to 1 instead --- src/mesa/drivers/dri/r600/r700_assembler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index e79c256c6b..1837712883 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -2508,7 +2508,7 @@ GLboolean assemble_DOT(r700_AssemblerBase *pAsm) } else if(pAsm->pILInst[pAsm->uiCurInst].Opcode == OPCODE_DPH) { - onecomp_PVSSRC(&(pAsm->S[1].src), 3); + onecomp_PVSSRC(&(pAsm->S[0].src), 3); } if ( GL_FALSE == next_ins(pAsm) ) -- cgit v1.2.3 From 606becc7f3513354548f587d84db731046616401 Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Mon, 12 Oct 2009 12:58:40 +0300 Subject: r600: LIT dst.y gets value from src.x seems I overlooked this when removing hardcoded swizzles for this one previously --- src/mesa/drivers/dri/r600/r700_assembler.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 1837712883..25b27cd829 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -2899,6 +2899,7 @@ GLboolean assemble_LIT(r700_AssemblerBase *pAsm) pAsm->S[0].src.rtype = srcType; pAsm->S[0].src.reg = srcReg; setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + swizzleagain_PVSSRC(&(pAsm->S[0].src), SQ_SEL_X, SQ_SEL_X, SQ_SEL_X, SQ_SEL_X); pAsm->S[1].src.rtype = SRC_REG_TEMPORARY; pAsm->S[1].src.reg = tmp; setaddrmode_PVSSRC(&(pAsm->S[1].src), ADDR_ABSOLUTE); -- cgit v1.2.3 From a3fec141017a39916d07000a3aa00eef3c9ac8a7 Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Mon, 12 Oct 2009 14:57:45 +0300 Subject: r600: implement ProgramStringNotify need this to properly test with piglit/glean vert/fragprog tests copied mostly from r300, many thanks to osiris, nha, airlied, others... --- src/mesa/drivers/dri/r600/r700_oglprog.c | 55 ++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 17 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_oglprog.c b/src/mesa/drivers/dri/r600/r700_oglprog.c index 5290ef31be..0d476fcd86 100644 --- a/src/mesa/drivers/dri/r600/r700_oglprog.c +++ b/src/mesa/drivers/dri/r600/r700_oglprog.c @@ -40,6 +40,24 @@ #include "r700_vertprog.h" +static void freeVertProgCache(GLcontext *ctx, struct r700_vertex_program_cont *cache) +{ + struct r700_vertex_program *tmp, *vp = cache->progs; + + while (vp) { + tmp = vp->next; + /* Release DMA region */ + r600DeleteShader(ctx, vp->shaderbo); + /* Clean up */ + Clean_Up_Assembler(&(vp->r700AsmCode)); + Clean_Up_Shader(&(vp->r700Shader)); + + _mesa_reference_vertprog(ctx, &vp->mesa_program, NULL); + _mesa_free(vp); + vp = tmp; + } +} + static struct gl_program *r700NewProgram(GLcontext * ctx, GLenum target, GLuint id) @@ -84,8 +102,7 @@ static struct gl_program *r700NewProgram(GLcontext * ctx, static void r700DeleteProgram(GLcontext * ctx, struct gl_program *prog) { - struct r700_vertex_program_cont * vpc; - struct r700_vertex_program *vp, *tmp; + struct r700_vertex_program_cont *vpc = (struct r700_vertex_program_cont *)prog; struct r700_fragment_program * fp; radeon_print(RADEON_SHADER, RADEON_VERBOSE, @@ -95,20 +112,7 @@ static void r700DeleteProgram(GLcontext * ctx, struct gl_program *prog) { case GL_VERTEX_STATE_PROGRAM_NV: case GL_VERTEX_PROGRAM_ARB: - vpc = (struct r700_vertex_program_cont*)prog; - vp = vpc->progs; - while (vp) { - tmp = vp->next; - /* Release DMA region */ - - r600DeleteShader(ctx, vp->shaderbo); - - /* Clean up */ - Clean_Up_Assembler(&(vp->r700AsmCode)); - Clean_Up_Shader(&(vp->r700Shader)); - _mesa_free(vp); - vp = tmp; - } + freeVertProgCache(ctx, vpc); break; case GL_FRAGMENT_PROGRAM_NV: case GL_FRAGMENT_PROGRAM_ARB: @@ -131,7 +135,24 @@ static void r700DeleteProgram(GLcontext * ctx, struct gl_program *prog) static void r700ProgramStringNotify(GLcontext * ctx, GLenum target, struct gl_program *prog) { - + struct r700_vertex_program_cont *vpc = (struct r700_vertex_program_cont *)prog; + struct r700_fragment_program * fp = (struct r700_fragment_program*)prog; + + switch (target) { + case GL_VERTEX_PROGRAM_ARB: + freeVertProgCache(ctx, vpc); + vpc->progs = NULL; + break; + case GL_FRAGMENT_PROGRAM_ARB: + r600DeleteShader(ctx, fp->shaderbo); + Clean_Up_Assembler(&(fp->r700AsmCode)); + Clean_Up_Shader(&(fp->r700Shader)); + fp->translated = GL_FALSE; + fp->loaded = GL_FALSE; + fp->shaderbo = NULL; + break; + } + } static GLboolean r700IsProgramNative(GLcontext * ctx, GLenum target, struct gl_program *prog) -- cgit v1.2.3 From 22a0029a68cf6a17e5d799c7d8eb8a699ccdeabb Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Thu, 15 Oct 2009 11:24:49 -0400 Subject: r600: fix tfp1 bo size Setting the wrong bo size resulting in an incomplete read cache flush when reading the texture. This fixes the compiz text corruption. [agd5f: take hw pitch alignment into account] --- src/mesa/drivers/dri/r600/r600_texstate.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r600_texstate.c b/src/mesa/drivers/dri/r600/r600_texstate.c index bcb8d7c73d..61ff7e8158 100644 --- a/src/mesa/drivers/dri/r600/r600_texstate.c +++ b/src/mesa/drivers/dri/r600/r600_texstate.c @@ -721,7 +721,9 @@ void r600SetTexOffset(__DRIcontext * pDRICtx, GLint texname, struct gl_texture_object *tObj = _mesa_lookup_texture(rmesa->radeon.glCtx, texname); radeonTexObjPtr t = radeon_tex_obj(tObj); - uint32_t pitch_val, size; + int firstlevel = t->mt ? t->mt->firstLevel : 0; + const struct gl_texture_image *firstImage; + uint32_t pitch_val, size, row_align; if (!tObj) return; @@ -731,7 +733,9 @@ void r600SetTexOffset(__DRIcontext * pDRICtx, GLint texname, if (!offset) return; - size = pitch;//h * w * (depth / 8); + firstImage = t->base.Image[0][firstlevel]; + row_align = rmesa->radeon.texture_row_align - 1; + size = ((firstImage->Width * (depth / 8) + row_align) & ~row_align) * firstImage->Height; if (t->bo) { radeon_bo_unref(t->bo); t->bo = NULL; -- cgit v1.2.3 From e5d6450c2c85cc7d645cb0736194f41e5393802d Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Wed, 14 Oct 2009 13:58:56 -0500 Subject: radeon: return EINVAL for 0 length buffers. Signed-off-by: Robert Noland --- src/mesa/drivers/dri/radeon/radeon_bo_legacy.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c b/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c index 3e7547d2f9..ce60a2f7ea 100644 --- a/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c +++ b/src/mesa/drivers/dri/radeon/radeon_bo_legacy.c @@ -710,6 +710,10 @@ int radeon_bo_legacy_validate(struct radeon_bo *bo, bo, bo->size, bo_legacy->map_count); return -EINVAL; } + if(bo->size == 0) { + fprintf(stderr, "bo(%p) has size 0.\n", bo); + return -EINVAL; + } if (bo_legacy->static_bo || bo_legacy->validated) { *soffset = bo_legacy->offset; *eoffset = bo_legacy->offset + bo->size; -- cgit v1.2.3 From a176b1c5d8b14601ec7e6ca9599c55fcc4797a7d Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Wed, 14 Oct 2009 14:02:12 -0500 Subject: r600: cleanup in r600_cs_process_relocs(). Signed-off-by: Robert Noland --- src/mesa/drivers/dri/r600/r600_cmdbuf.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r600_cmdbuf.c b/src/mesa/drivers/dri/r600/r600_cmdbuf.c index 3cfe03a45f..d27a3245a3 100644 --- a/src/mesa/drivers/dri/r600/r600_cmdbuf.c +++ b/src/mesa/drivers/dri/r600/r600_cmdbuf.c @@ -254,7 +254,7 @@ static int r600_cs_process_relocs(struct radeon_cs *cs, relocs = (struct r600_cs_reloc_legacy *)cs->relocs; restart: for (i = 0; i < cs->crelocs; i++) { - uint32_t soffset, eoffset, asicoffset; + uint32_t soffset, eoffset; r = radeon_bo_legacy_validate(relocs[i].base.bo, &soffset, &eoffset); @@ -262,24 +262,12 @@ restart: goto restart; } if (r) { - fprintf(stderr, "validated %p [0x%08X, 0x%08X]\n", + fprintf(stderr, "invalid bo(%p) [0x%08X, 0x%08X]\n", relocs[i].base.bo, soffset, eoffset); return r; } - asicoffset = soffset; for (j = 0; j < relocs[i].cindices; j++) { - if (asicoffset >= eoffset) { - /* radeon_bo_debug(relocs[i].base.bo, 12); */ - fprintf(stderr, "validated %p [0x%08X, 0x%08X]\n", - relocs[i].base.bo, soffset, eoffset); - fprintf(stderr, "above end: %p 0x%08X 0x%08X\n", - relocs[i].base.bo, - cs->packets[relocs[i].indices[j]], - eoffset); - exit(0); - return -EINVAL; - } /* pkt3 nop header in ib chunk */ cs->packets[relocs[i].reloc_indices[j]] = 0xC0001000; /* reloc index in ib chunk */ @@ -287,7 +275,7 @@ restart: } /* asic offset in reloc chunk */ /* see alex drm r600_nomm_relocate */ - reloc_chunk[offset_dw] = asicoffset; + reloc_chunk[offset_dw] = soffset; reloc_chunk[offset_dw + 3] = 0; offset_dw += 4; -- cgit v1.2.3 From 16c6a3b71e6be04b6bb3d08fcb658194c5251fc7 Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Wed, 14 Oct 2009 14:04:24 -0500 Subject: r600: FRAG_ATTRIB_WPOS and FRAG_ATTRIB_FOGC appear to be supported. Report unsupported attributes while I'm here. Signed-off-by: Robert Noland --- src/mesa/drivers/dri/r600/r700_assembler.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 25b27cd829..a683008746 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -1180,8 +1180,10 @@ GLboolean tex_src(r700_AssemblerBase *pAsm) case PROGRAM_INPUT: switch (pILInst->SrcReg[0].Index) { + case FRAG_ATTRIB_WPOS: case FRAG_ATTRIB_COL0: case FRAG_ATTRIB_COL1: + case FRAG_ATTRIB_FOGC: case FRAG_ATTRIB_TEX0: case FRAG_ATTRIB_TEX1: case FRAG_ATTRIB_TEX2: @@ -1194,7 +1196,16 @@ GLboolean tex_src(r700_AssemblerBase *pAsm) pAsm->S[0].src.reg = pAsm->uiFP_AttributeMap[pILInst->SrcReg[0].Index]; pAsm->S[0].src.rtype = SRC_REG_INPUT; - break; + break; + case FRAG_ATTRIB_FACE: + fprintf(stderr, "FRAG_ATTRIB_FACE unsupported\n"); + break; + case FRAG_ATTRIB_PNTC: + fprintf(stderr, "FRAG_ATTRIB_PNTC unsupported\n"); + break; + case FRAG_ATTRIB_VAR0: + fprintf(stderr, "FRAG_ATTRIB_VAR0 unsupported\n"); + break; } break; } -- cgit v1.2.3 From 3f30b0709b5a71915df336194f9f805e4c306cef Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Wed, 14 Oct 2009 16:20:07 -0400 Subject: Use the right pitch when rendering to a texture We need to get the pitch from the texture level we are rendering to, rather than just using the base texel width. --- src/mesa/drivers/dri/radeon/radeon_fbo.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index d83b166742..2012cbcf83 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -445,7 +445,6 @@ restart: goto restart; } - rrb->pitch = texImage->Width * rrb->cpp; rrb->base.InternalFormat = rrb->base._ActualFormat; rrb->base.Width = texImage->Width; rrb->base.Height = texImage->Height; @@ -555,8 +554,10 @@ radeon_render_texture(GLcontext * ctx, imageOffset += offsets[att->Zoffset]; } - /* store that offset in the region */ + /* store that offset in the region, along with the correct pitch for + * the image we are rendering to */ rrb->draw_offset = imageOffset; + rrb->pitch = radeon_image->mt->levels[att->TextureLevel].rowstride; /* update drawing region, etc */ radeon_draw_buffer(ctx, fb); -- cgit v1.2.3 From 9bf2aa33298db5af9128ad8f625321be47ab65c3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 15 Oct 2009 14:49:53 -0600 Subject: dri/common: fix broken _dri_texformat_* initializations --- src/mesa/drivers/dri/common/texmem.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/common/texmem.c b/src/mesa/drivers/dri/common/texmem.c index c9c3324ed9..e8880d9ae8 100644 --- a/src/mesa/drivers/dri/common/texmem.c +++ b/src/mesa/drivers/dri/common/texmem.c @@ -1312,10 +1312,10 @@ gl_format _dri_texformat_rgb565 = MESA_FORMAT_NONE; gl_format _dri_texformat_argb4444 = MESA_FORMAT_NONE; gl_format _dri_texformat_argb1555 = MESA_FORMAT_NONE; gl_format _dri_texformat_al88 = MESA_FORMAT_NONE; -gl_format _dri_texformat_a8 = MESA_FORMAT_NONE; -gl_format _dri_texformat_ci8 = MESA_FORMAT_NONE; -gl_format _dri_texformat_i8 = MESA_FORMAT_NONE; -gl_format _dri_texformat_l8 = MESA_FORMAT_NONE; +gl_format _dri_texformat_a8 = MESA_FORMAT_A8; +gl_format _dri_texformat_ci8 = MESA_FORMAT_CI8; +gl_format _dri_texformat_i8 = MESA_FORMAT_I8; +gl_format _dri_texformat_l8 = MESA_FORMAT_L8; /*@}*/ -- cgit v1.2.3 From a37c9ac8eee8c0d5b49f198f490828a794dc93c4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 15 Oct 2009 14:54:32 -0600 Subject: dri/common: use _mesa_little_endian() and update comments --- src/mesa/drivers/dri/common/texmem.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/common/texmem.c b/src/mesa/drivers/dri/common/texmem.c index e8880d9ae8..798c09f09f 100644 --- a/src/mesa/drivers/dri/common/texmem.c +++ b/src/mesa/drivers/dri/common/texmem.c @@ -1302,8 +1302,8 @@ driCalculateTextureFirstLastLevel( driTextureObject * t ) /** - * \name DRI texture formats. Pointers initialized to either the big- or - * little-endian Mesa formats. + * \name DRI texture formats. These vars are initialized to either the + * big- or little-endian Mesa formats. */ /*@{*/ gl_format _dri_texformat_rgba8888 = MESA_FORMAT_NONE; @@ -1320,15 +1320,13 @@ gl_format _dri_texformat_l8 = MESA_FORMAT_L8; /** - * Initialize little endian target, host byte order independent texture formats + * Initialize _dri_texformat_* vars according to whether we're on + * a big or little endian system. */ void driInitTextureFormats(void) { - const GLuint ui = 1; - const GLubyte littleEndian = *((const GLubyte *) &ui); - - if (littleEndian) { + if (_mesa_little_endian()) { _dri_texformat_rgba8888 = MESA_FORMAT_RGBA8888; _dri_texformat_argb8888 = MESA_FORMAT_ARGB8888; _dri_texformat_rgb565 = MESA_FORMAT_RGB565; -- cgit v1.2.3 From fa3046431a0da5990043fd4856602b0ba57ff9af Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 15 Oct 2009 14:57:45 -0600 Subject: dri/common: updated #includes --- src/mesa/drivers/dri/common/texmem.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/common/texmem.c b/src/mesa/drivers/dri/common/texmem.c index 798c09f09f..895139b55b 100644 --- a/src/mesa/drivers/dri/common/texmem.c +++ b/src/mesa/drivers/dri/common/texmem.c @@ -42,14 +42,10 @@ * application. */ -#include "texmem.h" -#include "main/simple_list.h" #include "main/imports.h" #include "main/macros.h" -#include "main/texformat.h" - -#include - +#include "main/simple_list.h" +#include "texmem.h" static unsigned dummy_swap_counter; -- cgit v1.2.3 From 89b31c9619449d5c9b8ebe4e245c2a926e3583e6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 14 Oct 2009 14:19:03 -0600 Subject: mesa: use C locale for _mesa_strtod() _mesa_strtod() is used for shader/program parsing where the decimal point character is always '.' Use strtod_l() with a "C" locale to ensure correct string->double conversion when the actual locale uses another character such as ',' for the decimal point. Fixes bug 24531. --- src/mesa/main/imports.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 6ffaddcde9..87cb5ce0fb 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -48,6 +48,10 @@ #include "context.h" #include "version.h" +#ifdef _GNU_SOURCE +#include +#endif + #define MAXSTRING 4000 /* for vsnprintf() */ @@ -908,7 +912,15 @@ _mesa_atoi(const char *s) double _mesa_strtod( const char *s, char **end ) { +#ifdef _GNU_SOURCE + static locale_t loc = NULL; + if (!loc) { + loc = newlocale(LC_CTYPE_MASK, "C", NULL); + } + return strtod_l(s, end, loc); +#else return strtod(s, end); +#endif } /** Compute simple checksum/hash for a string */ -- cgit v1.2.3 From 3594b53c0173ac810106f667604bf94b5cfc4a1e Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Fri, 16 Oct 2009 20:21:17 +0200 Subject: r300: fix vertex program parameters limits --- src/mesa/drivers/dri/r300/r300_vertprog.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_vertprog.c b/src/mesa/drivers/dri/r300/r300_vertprog.c index 2f7b67c143..ed8b788108 100644 --- a/src/mesa/drivers/dri/r300/r300_vertprog.c +++ b/src/mesa/drivers/dri/r300/r300_vertprog.c @@ -62,12 +62,6 @@ static int r300VertexProgUpdateParams(GLcontext * ctx, struct r300_vertex_progra } } - if (vp->code.constants.Count * 4 > VSF_MAX_FRAGMENT_LENGTH) { - /* Should have checked this earlier... */ - fprintf(stderr, "%s:Params exhausted\n", __FUNCTION__); - _mesa_exit(-1); - } - for(i = 0; i < vp->code.constants.Count; ++i) { const float * src = 0; const struct rc_constant * constant = &vp->code.constants.Constants[i]; @@ -281,6 +275,11 @@ static struct r300_vertex_program *build_program(GLcontext *ctx, } r3xx_compile_vertex_program(&compiler); + + if (vp->code.constants.Count > ctx->Const.VertexProgram.MaxParameters) { + rc_error(&compiler.Base, "Program exceeds constant buffer size limit\n"); + } + vp->error = compiler.Base.Error; vp->Base->Base.InputsRead = vp->code.InputsRead; @@ -334,7 +333,6 @@ struct r300_vertex_program * r300SelectAndTranslateVertexShader(GLcontext *ctx) #define bump_vpu_count(ptr, new_count) do { \ drm_r300_cmd_header_t* _p=((drm_r300_cmd_header_t*)(ptr)); \ int _nc=(new_count)/4; \ - assert(_nc < 256); \ if(_nc>_p->vpu.count)_p->vpu.count=_nc; \ } while(0) -- cgit v1.2.3 From 2ee7fd8d584abf051c552f455aeb588e2936b0ea Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 15 Oct 2009 15:25:52 -0600 Subject: mesa: added MESA_GLSL=useprog debug flag This logs glUseProgram() calls to stderr. --- src/mesa/main/mtypes.h | 1 + src/mesa/shader/shader_api.c | 27 +++++++++++++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 988bfe1e22..b77dcdb730 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2046,6 +2046,7 @@ struct gl_shader_program #define GLSL_UNIFORMS 0x10 /**< Print glUniform calls */ #define GLSL_NOP_VERT 0x20 /**< Force no-op vertex shaders */ #define GLSL_NOP_FRAG 0x40 /**< Force no-op fragment shaders */ +#define GLSL_USE_PROG 0x80 /**< Log glUseProgram calls */ /** diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 6de97984e6..f473bd1173 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -390,6 +390,8 @@ get_shader_flags(void) flags |= GLSL_OPT; if (_mesa_strstr(env, "uniform")) flags |= GLSL_UNIFORMS; + if (_mesa_strstr(env, "useprog")) + flags |= GLSL_USE_PROG; } return flags; @@ -1524,19 +1526,32 @@ _mesa_use_program(GLcontext *ctx, GLuint program) } /* debug code */ - if (0) { + if (ctx->Shader.Flags & GLSL_USE_PROG) { GLuint i; - _mesa_printf("Use Shader Program %u\n", shProg->Name); + _mesa_printf("Mesa: glUseProgram(%u)\n", shProg->Name); for (i = 0; i < shProg->NumShaders; i++) { - _mesa_printf(" shader %u, type 0x%x, checksum %u\n", + const char *s; + switch (shProg->Shaders[i]->Type) { + case GL_VERTEX_SHADER: + s = "vertex"; + break; + case GL_FRAGMENT_SHADER: + s = "fragment"; + break; + case GL_GEOMETRY_SHADER: + s = "geometry"; + break; + default: + s = ""; + } + _mesa_printf(" %s shader %u, checksum %u\n", s, shProg->Shaders[i]->Name, - shProg->Shaders[i]->Type, shProg->Shaders[i]->SourceChecksum); } if (shProg->VertexProgram) - printf(" vert prog %u\n", shProg->VertexProgram->Base.Id); + _mesa_printf(" vert prog %u\n", shProg->VertexProgram->Base.Id); if (shProg->FragmentProgram) - printf(" frag prog %u\n", shProg->FragmentProgram->Base.Id); + _mesa_printf(" frag prog %u\n", shProg->FragmentProgram->Base.Id); } } else { -- cgit v1.2.3 From f0503726bf8113919e4b00fbca504d7cbdcd0151 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 16 Oct 2009 08:12:47 -0600 Subject: mesa: move a comma --- src/mesa/main/mtypes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index b77dcdb730..ea3b552b9d 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -208,7 +208,7 @@ typedef enum VERT_RESULT_BFC0 = 13, VERT_RESULT_BFC1 = 14, VERT_RESULT_EDGE = 15, - VERT_RESULT_VAR0 = 16 /**< shader varying */, + VERT_RESULT_VAR0 = 16, /**< shader varying */ VERT_RESULT_MAX = (VERT_RESULT_VAR0 + MAX_VARYING) } gl_vert_result; -- cgit v1.2.3 From d9fd207133ba2ff8cd0bbcab6963c70d71628b1b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 16 Oct 2009 09:21:45 -0600 Subject: mesa: added SUBDIRS support in dri/Makefile.template --- src/mesa/drivers/dri/Makefile.template | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/Makefile.template b/src/mesa/drivers/dri/Makefile.template index 18dbeba24a..defead6c6b 100644 --- a/src/mesa/drivers/dri/Makefile.template +++ b/src/mesa/drivers/dri/Makefile.template @@ -60,7 +60,7 @@ SHARED_INCLUDES = \ ##### TARGETS ##### -default: symlinks depend $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME) +default: symlinks subdirs depend $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME) $(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(PIPE_DRIVERS) $(WINOBJ) Makefile $(TOP)/src/mesa/drivers/dri/Makefile.template @@ -72,6 +72,18 @@ $(TOP)/$(LIB_DIR)/$(LIBNAME): $(LIBNAME) $(INSTALL) $(LIBNAME) $(TOP)/$(LIB_DIR) +# If the Makefile defined SUBDIRS, run make in each +.PHONY: subdirs +subdirs: + @if test -n "$(SUBDIRS)" ; then \ + for dir in $(SUBDIRS) ; do \ + if [ -d $$dir ] ; then \ + (cd $$dir && $(MAKE)) || exit 1; \ + fi \ + done \ + fi + + depend: $(C_SOURCES) $(ASM_SOURCES) $(SYMLINKS) @ echo "running $(MKDEP)" @ rm -f depend -- cgit v1.2.3 From db2046580f3b5be0e9fe30337f3bf412c4556ed9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 16 Oct 2009 09:25:05 -0600 Subject: mesa: use EXTRA_MODULES and SUBDIRS to build r300 compiler This is a bit cleaner and avoids rebuilding the r300_dri.so library all the time. --- src/mesa/drivers/dri/Makefile.template | 6 ++++-- src/mesa/drivers/dri/r300/Makefile | 10 ++++------ 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/Makefile.template b/src/mesa/drivers/dri/Makefile.template index defead6c6b..d2731aebae 100644 --- a/src/mesa/drivers/dri/Makefile.template +++ b/src/mesa/drivers/dri/Makefile.template @@ -63,9 +63,11 @@ SHARED_INCLUDES = \ default: symlinks subdirs depend $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME) -$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(PIPE_DRIVERS) $(WINOBJ) Makefile $(TOP)/src/mesa/drivers/dri/Makefile.template +$(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(EXTRA_MODULES) $(WINOBJ) Makefile \ + $(TOP)/src/mesa/drivers/dri/Makefile.template $(MKLIB) -o $@ -noprefix -linker '$(CC)' -ldflags '$(LDFLAGS)' \ - $(OBJECTS) $(PIPE_DRIVERS) $(MESA_MODULES) $(WINOBJ) $(DRI_LIB_DEPS) + $(OBJECTS) $(MESA_MODULES) $(EXTRA_MODULES) $(WINOBJ) \ + $(DRI_LIB_DEPS) $(TOP)/$(LIB_DIR)/$(LIBNAME): $(LIBNAME) diff --git a/src/mesa/drivers/dri/r300/Makefile b/src/mesa/drivers/dri/r300/Makefile index c64f940623..0e5b29b685 100644 --- a/src/mesa/drivers/dri/r300/Makefile +++ b/src/mesa/drivers/dri/r300/Makefile @@ -69,7 +69,10 @@ DRIVER_DEFINES = -DRADEON_R300 DRI_LIB_DEPS += $(RADEON_LDFLAGS) -PIPE_DRIVERS = compiler/libr300compiler.a +SUBDIRS = compiler + +EXTRA_MODULES = compiler/libr300compiler.a + ##### TARGETS ##### @@ -77,8 +80,3 @@ include ../Makefile.template symlinks: -# Mark the archive phony so that we always check for recompilation -.PHONY : compiler/libr300compiler.a - -compiler/libr300compiler.a: - cd compiler && $(MAKE) -- cgit v1.2.3 From f094b86bb5ab93aedc03df5cf5bdf51ab9d37045 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 16 Oct 2009 09:33:11 -0600 Subject: mesa: lift default symlinks target into Makefile.template Driver Makefiles can still add symlink dependencies/rules if needed. --- src/mesa/drivers/dri/Makefile.template | 4 ++++ src/mesa/drivers/dri/fb/Makefile | 2 -- src/mesa/drivers/dri/ffb/Makefile | 1 - src/mesa/drivers/dri/gamma/Makefile | 1 - src/mesa/drivers/dri/i810/Makefile | 1 - src/mesa/drivers/dri/i915/Makefile | 1 - src/mesa/drivers/dri/i965/Makefile | 1 - src/mesa/drivers/dri/mach64/Makefile | 1 - src/mesa/drivers/dri/mga/Makefile | 1 - src/mesa/drivers/dri/r128/Makefile | 1 - src/mesa/drivers/dri/r200/Makefile | 1 - src/mesa/drivers/dri/r300/Makefile | 2 -- src/mesa/drivers/dri/r600/Makefile | 1 - src/mesa/drivers/dri/radeon/Makefile | 1 - src/mesa/drivers/dri/s3v/Makefile | 1 - src/mesa/drivers/dri/savage/Makefile | 1 - src/mesa/drivers/dri/sis/Makefile | 1 - src/mesa/drivers/dri/swrast/Makefile | 1 - src/mesa/drivers/dri/tdfx/Makefile | 2 -- src/mesa/drivers/dri/trident/Makefile | 1 - src/mesa/drivers/dri/unichrome/Makefile | 1 - 21 files changed, 4 insertions(+), 23 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/Makefile.template b/src/mesa/drivers/dri/Makefile.template index d2731aebae..1ce9315530 100644 --- a/src/mesa/drivers/dri/Makefile.template +++ b/src/mesa/drivers/dri/Makefile.template @@ -86,6 +86,10 @@ subdirs: fi +.PHONY: symlinks +symlinks: + + depend: $(C_SOURCES) $(ASM_SOURCES) $(SYMLINKS) @ echo "running $(MKDEP)" @ rm -f depend diff --git a/src/mesa/drivers/dri/fb/Makefile b/src/mesa/drivers/dri/fb/Makefile index 309f50b95f..cf9b3a8556 100644 --- a/src/mesa/drivers/dri/fb/Makefile +++ b/src/mesa/drivers/dri/fb/Makefile @@ -25,5 +25,3 @@ ASM_SOURCES = include ../Makefile.template -symlinks: - diff --git a/src/mesa/drivers/dri/ffb/Makefile b/src/mesa/drivers/dri/ffb/Makefile index cb73238c03..e9da8f9066 100644 --- a/src/mesa/drivers/dri/ffb/Makefile +++ b/src/mesa/drivers/dri/ffb/Makefile @@ -33,4 +33,3 @@ ASM_SOURCES = include ../Makefile.template -symlinks: diff --git a/src/mesa/drivers/dri/gamma/Makefile b/src/mesa/drivers/dri/gamma/Makefile index 250d3ac089..09df1578fc 100644 --- a/src/mesa/drivers/dri/gamma/Makefile +++ b/src/mesa/drivers/dri/gamma/Makefile @@ -32,4 +32,3 @@ ASM_SOURCES = include ../Makefile.template -symlinks: diff --git a/src/mesa/drivers/dri/i810/Makefile b/src/mesa/drivers/dri/i810/Makefile index a7825b49b4..3874faee51 100644 --- a/src/mesa/drivers/dri/i810/Makefile +++ b/src/mesa/drivers/dri/i810/Makefile @@ -29,4 +29,3 @@ ASM_SOURCES = include ../Makefile.template -symlinks: diff --git a/src/mesa/drivers/dri/i915/Makefile b/src/mesa/drivers/dri/i915/Makefile index 393312e732..37f15aa767 100644 --- a/src/mesa/drivers/dri/i915/Makefile +++ b/src/mesa/drivers/dri/i915/Makefile @@ -72,4 +72,3 @@ intel_decode.o: ../intel/intel_decode.c intel_tex_layout.o: ../intel/intel_tex_layout.c -symlinks: diff --git a/src/mesa/drivers/dri/i965/Makefile b/src/mesa/drivers/dri/i965/Makefile index 57dcc91586..7a55333e89 100644 --- a/src/mesa/drivers/dri/i965/Makefile +++ b/src/mesa/drivers/dri/i965/Makefile @@ -100,6 +100,5 @@ DRI_LIB_DEPS += -ldrm_intel include ../Makefile.template -symlinks: intel_decode.o: ../intel/intel_decode.c intel_tex_layout.o: ../intel/intel_tex_layout.c diff --git a/src/mesa/drivers/dri/mach64/Makefile b/src/mesa/drivers/dri/mach64/Makefile index 7246d51f5d..a8f463e9fd 100644 --- a/src/mesa/drivers/dri/mach64/Makefile +++ b/src/mesa/drivers/dri/mach64/Makefile @@ -30,4 +30,3 @@ ASM_SOURCES = include ../Makefile.template -symlinks: diff --git a/src/mesa/drivers/dri/mga/Makefile b/src/mesa/drivers/dri/mga/Makefile index a871064c62..0cc329fb22 100644 --- a/src/mesa/drivers/dri/mga/Makefile +++ b/src/mesa/drivers/dri/mga/Makefile @@ -31,4 +31,3 @@ ASM_SOURCES = include ../Makefile.template -symlinks: diff --git a/src/mesa/drivers/dri/r128/Makefile b/src/mesa/drivers/dri/r128/Makefile index 796dfbc516..52c5a38a70 100644 --- a/src/mesa/drivers/dri/r128/Makefile +++ b/src/mesa/drivers/dri/r128/Makefile @@ -29,4 +29,3 @@ ASM_SOURCES = include ../Makefile.template -symlinks: diff --git a/src/mesa/drivers/dri/r200/Makefile b/src/mesa/drivers/dri/r200/Makefile index fbce70c37b..776f1e3f3f 100644 --- a/src/mesa/drivers/dri/r200/Makefile +++ b/src/mesa/drivers/dri/r200/Makefile @@ -66,4 +66,3 @@ include ../Makefile.template #INCLUDES += -I../radeon/server -symlinks: diff --git a/src/mesa/drivers/dri/r300/Makefile b/src/mesa/drivers/dri/r300/Makefile index 0e5b29b685..cb0f715fa0 100644 --- a/src/mesa/drivers/dri/r300/Makefile +++ b/src/mesa/drivers/dri/r300/Makefile @@ -78,5 +78,3 @@ EXTRA_MODULES = compiler/libr300compiler.a include ../Makefile.template -symlinks: - diff --git a/src/mesa/drivers/dri/r600/Makefile b/src/mesa/drivers/dri/r600/Makefile index 7d5a7b1ab6..9b7c42042e 100644 --- a/src/mesa/drivers/dri/r600/Makefile +++ b/src/mesa/drivers/dri/r600/Makefile @@ -76,4 +76,3 @@ DRI_LIB_DEPS += $(RADEON_LDFLAGS) include ../Makefile.template -symlinks: diff --git a/src/mesa/drivers/dri/radeon/Makefile b/src/mesa/drivers/dri/radeon/Makefile index b1efc72872..ae2e695bfc 100644 --- a/src/mesa/drivers/dri/radeon/Makefile +++ b/src/mesa/drivers/dri/radeon/Makefile @@ -55,4 +55,3 @@ X86_SOURCES = include ../Makefile.template -symlinks: diff --git a/src/mesa/drivers/dri/s3v/Makefile b/src/mesa/drivers/dri/s3v/Makefile index 9bd7973154..da7e6cdc20 100644 --- a/src/mesa/drivers/dri/s3v/Makefile +++ b/src/mesa/drivers/dri/s3v/Makefile @@ -33,4 +33,3 @@ ASM_SOURCES = include ../Makefile.template -symlinks: diff --git a/src/mesa/drivers/dri/savage/Makefile b/src/mesa/drivers/dri/savage/Makefile index 018482f66b..2e5c40802c 100644 --- a/src/mesa/drivers/dri/savage/Makefile +++ b/src/mesa/drivers/dri/savage/Makefile @@ -27,4 +27,3 @@ ASM_SOURCES = include ../Makefile.template -symlinks: diff --git a/src/mesa/drivers/dri/sis/Makefile b/src/mesa/drivers/dri/sis/Makefile index d2354e6776..ad009fc239 100644 --- a/src/mesa/drivers/dri/sis/Makefile +++ b/src/mesa/drivers/dri/sis/Makefile @@ -34,4 +34,3 @@ ASM_SOURCES = include ../Makefile.template -symlinks: diff --git a/src/mesa/drivers/dri/swrast/Makefile b/src/mesa/drivers/dri/swrast/Makefile index 5f3a4f2191..771169c1ff 100644 --- a/src/mesa/drivers/dri/swrast/Makefile +++ b/src/mesa/drivers/dri/swrast/Makefile @@ -21,4 +21,3 @@ SWRAST_COMMON_SOURCES = \ include ../Makefile.template -symlinks: diff --git a/src/mesa/drivers/dri/tdfx/Makefile b/src/mesa/drivers/dri/tdfx/Makefile index 092c580fea..b9f25db4fe 100644 --- a/src/mesa/drivers/dri/tdfx/Makefile +++ b/src/mesa/drivers/dri/tdfx/Makefile @@ -32,6 +32,4 @@ ASM_SOURCES = include ../Makefile.template -symlinks: - diff --git a/src/mesa/drivers/dri/trident/Makefile b/src/mesa/drivers/dri/trident/Makefile index 9ee24c504c..bd9b7f35a2 100644 --- a/src/mesa/drivers/dri/trident/Makefile +++ b/src/mesa/drivers/dri/trident/Makefile @@ -23,4 +23,3 @@ ASM_SOURCES = include ../Makefile.template -symlinks: diff --git a/src/mesa/drivers/dri/unichrome/Makefile b/src/mesa/drivers/dri/unichrome/Makefile index 5fe00c1bd1..344d34fce3 100644 --- a/src/mesa/drivers/dri/unichrome/Makefile +++ b/src/mesa/drivers/dri/unichrome/Makefile @@ -29,4 +29,3 @@ ASM_SOURCES = include ../Makefile.template -symlinks: -- cgit v1.2.3 From a335d334d45701a42c283257fa44f2f7148e186d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 16 Oct 2009 09:42:30 -0600 Subject: mesa: fix/update some comments --- src/mesa/main/mtypes.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index ea3b552b9d..052fbaaaea 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 7.5 + * Version: 7.7 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * Copyright (C) 2009 VMware, Inc. All Rights Reserved. @@ -1917,10 +1917,10 @@ struct ati_fragment_shader struct atifs_instruction *Instructions[2]; struct atifs_setupinst *SetupInst[2]; GLfloat Constants[8][4]; - GLbitfield LocalConstDef; /** Indicates which constants have been set */ + GLbitfield LocalConstDef; /**< Indicates which constants have been set */ GLubyte numArithInstr[2]; GLubyte regsAssigned[2]; - GLubyte NumPasses; /** 1 or 2 */ + GLubyte NumPasses; /**< 1 or 2 */ GLubyte cur_pass; GLubyte last_optype; GLboolean interpinp1; @@ -1934,7 +1934,7 @@ struct ati_fragment_shader struct gl_ati_fragment_shader_state { GLboolean Enabled; - GLboolean _Enabled; /** enabled and valid shader? */ + GLboolean _Enabled; /**< enabled and valid shader? */ GLboolean Compiling; GLfloat GlobalConstants[8][4]; struct ati_fragment_shader *Current; -- cgit v1.2.3 From 60a39b6799c72430851d92f93758e2f25487a0f4 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 17 Oct 2009 08:25:48 +0100 Subject: intel: Disallow relocations to the byte beyond the end of the buffer --- src/mesa/drivers/dri/intel/intel_batchbuffer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.h b/src/mesa/drivers/dri/intel/intel_batchbuffer.h index 9a619fbd5c..d4899aab7f 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.h +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.h @@ -157,7 +157,7 @@ intel_batchbuffer_require_space(struct intel_batchbuffer *batch, #define OUT_BATCH(d) intel_batchbuffer_emit_dword(intel->batch, d) #define OUT_RELOC(buf, read_domains, write_domain, delta) do { \ - assert((unsigned) (delta) <= buf->size); \ + assert((unsigned) (delta) < buf->size); \ intel_batchbuffer_emit_reloc(intel->batch, buf, \ read_domains, write_domain, delta); \ } while (0) -- cgit v1.2.3 From bb567357bc1366df7115e0daa68c2470e3bf6ba6 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sat, 17 Oct 2009 21:32:56 -0700 Subject: gallium: Permit surface_copy and surface_fill to be NULL. Uf. Lots of files touched. Would people with working vega, xorg, dri1, etc. please make sure you are not broken, and fix yourself up if you are. There were only two or three places where the code did not have painful fallbacks, so I would advise st maintainers to find less painful workarounds, or consider overhauling util_surface_copy and util_surface_fill. Per ymanton, darktama, and Dr_Jakob's suggestions, clear has been left as-is. I will not add PIPE_CAP_BLITTER unless it is deemed necessary. --- src/mesa/state_tracker/st_atom_framebuffer.c | 16 ++++++++++++---- src/mesa/state_tracker/st_cb_drawpixels.c | 19 ++++++++++++++----- src/mesa/state_tracker/st_cb_fbo.c | 16 ++++++++++++---- src/mesa/state_tracker/st_cb_texture.c | 3 ++- 4 files changed, 40 insertions(+), 14 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_atom_framebuffer.c b/src/mesa/state_tracker/st_atom_framebuffer.c index 5209a6a0c9..e18c0f6e0a 100644 --- a/src/mesa/state_tracker/st_atom_framebuffer.c +++ b/src/mesa/state_tracker/st_atom_framebuffer.c @@ -39,6 +39,7 @@ #include "pipe/p_context.h" #include "pipe/p_inlines.h" #include "cso_cache/cso_context.h" +#include "util/u_rect.h" @@ -162,10 +163,17 @@ update_framebuffer_state( struct st_context *st ) (void) st_get_framebuffer_surface(stfb, ST_SURFACE_FRONT_LEFT, &surf_front); (void) st_get_framebuffer_surface(stfb, ST_SURFACE_BACK_LEFT, &surf_back); - st->pipe->surface_copy(st->pipe, - surf_front, 0, 0, /* dest */ - surf_back, 0, 0, /* src */ - fb->Width, fb->Height); + if (st->pipe->surface_copy) { + st->pipe->surface_copy(st->pipe, + surf_front, 0, 0, /* dest */ + surf_back, 0, 0, /* src */ + fb->Width, fb->Height); + } else { + util_surface_copy(st->pipe, FALSE, + surf_front, 0, 0, + surf_back, 0, 0, + fb->Width, fb->Height); + } } /* we're assuming we'll really draw to the front buffer */ st->frontbuffer_status = FRONT_STATUS_DIRTY; diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 5c3413f905..be44577117 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -62,6 +62,7 @@ #include "util/u_tile.h" #include "util/u_draw_quad.h" #include "util/u_math.h" +#include "util/u_rect.h" #include "shader/prog_instruction.h" #include "cso_cache/cso_context.h" @@ -1075,11 +1076,19 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, PIPE_BUFFER_USAGE_GPU_READ); struct pipe_surface *psTex = screen->get_tex_surface(screen, pt, 0, 0, 0, PIPE_BUFFER_USAGE_GPU_WRITE ); - pipe->surface_copy(pipe, - psTex, /* dest */ - 0, 0, /* destx/y */ - psRead, - srcx, srcy, width, height); + if (pipe->surface_copy) { + pipe->surface_copy(pipe, + psTex, /* dest */ + 0, 0, /* destx/y */ + psRead, + srcx, srcy, width, height); + } else { + util_surface_copy(pipe, FALSE, + psTex, + 0, 0, + psRead, + srcx, srcy, width, height); + } pipe_surface_reference(&psRead, NULL); pipe_surface_reference(&psTex, NULL); } diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 864f5d3ca3..73aa65955b 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -49,6 +49,7 @@ #include "st_public.h" #include "st_texture.h" +#include "util/u_rect.h" /** @@ -538,10 +539,17 @@ copy_back_to_front(struct st_context *st, (void) st_get_framebuffer_surface(stfb, backIndex, &surf_back); if (surf_front && surf_back) { - st->pipe->surface_copy(st->pipe, - surf_front, 0, 0, /* dest */ - surf_back, 0, 0, /* src */ - fb->Width, fb->Height); + if (st->pipe->surface_copy) { + st->pipe->surface_copy(st->pipe, + surf_front, 0, 0, /* dest */ + surf_back, 0, 0, /* src */ + fb->Width, fb->Height); + } else { + util_surface_copy(st->pipe, FALSE, + surf_front, 0, 0, + surf_back, 0, 0, + fb->Width, fb->Height); + } } } diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index b943787106..a1953342b4 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -1546,7 +1546,8 @@ st_copy_texsubimage(GLcontext *ctx, if (ctx->_ImageTransferState == 0x0) { - if (matching_base_formats && + if (pipe->surface_copy && + matching_base_formats && src_format == dest_format && !do_flip) { -- cgit v1.2.3 From 8123180ea649540fb7319bc79ad77dca0d5d68cd Mon Sep 17 00:00:00 2001 From: Robert Noland Date: Mon, 19 Oct 2009 09:47:39 -0500 Subject: r600: Fix size calculation for 24 bit depth size was being calculated based on 3 bytes per pixel with 24 bit depth instead of 4 bytes. This caused corruption in the bottom 25% of objects. This finishes fixing the menu/text corruption in compiz/kde4. Signed-off-by: Robert Noland --- src/mesa/drivers/dri/r600/r600_texstate.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r600_texstate.c b/src/mesa/drivers/dri/r600/r600_texstate.c index 61ff7e8158..a30703e41b 100644 --- a/src/mesa/drivers/dri/r600/r600_texstate.c +++ b/src/mesa/drivers/dri/r600/r600_texstate.c @@ -723,7 +723,7 @@ void r600SetTexOffset(__DRIcontext * pDRICtx, GLint texname, radeonTexObjPtr t = radeon_tex_obj(tObj); int firstlevel = t->mt ? t->mt->firstLevel : 0; const struct gl_texture_image *firstImage; - uint32_t pitch_val, size, row_align; + uint32_t pitch_val, size, row_align, bpp; if (!tObj) return; @@ -733,9 +733,13 @@ void r600SetTexOffset(__DRIcontext * pDRICtx, GLint texname, if (!offset) return; + bpp = depth / 8; + if (bpp == 3) + bpp = 4; + firstImage = t->base.Image[0][firstlevel]; row_align = rmesa->radeon.texture_row_align - 1; - size = ((firstImage->Width * (depth / 8) + row_align) & ~row_align) * firstImage->Height; + size = ((firstImage->Width * bpp + row_align) & ~row_align) * firstImage->Height; if (t->bo) { radeon_bo_unref(t->bo); t->bo = NULL; -- cgit v1.2.3 From 16e21191e26084848c7e6e3ffd9e15ef670855c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mathias=20Fr=C3=B6hlich?= Date: Mon, 19 Oct 2009 11:47:21 -0400 Subject: r300: fix texture size handling with size > 2048 The in kernel texture check fails because of both bit11 flags being set on 16x16 textures. It tuns out that these bits are still set and not cleared in the pp_txpitch field of the texture. The attached patch at least helps for this case on my machine. It clears the bit 11 from the pitch field if the texture is smaller and masks out that hight bits on the conventional width and height field. Fixes bug 24584 --- src/mesa/drivers/dri/r300/r300_texstate.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index f030451b28..65cabccdc1 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -225,10 +225,10 @@ static void setup_hardware_state(r300ContextPtr rmesa, radeonTexObj *t) if (t->image_override && t->bo) return; - t->pp_txsize = (((firstImage->Width - 1) << R300_TX_WIDTHMASK_SHIFT) - | ((firstImage->Height - 1) << R300_TX_HEIGHTMASK_SHIFT) - | ((firstImage->DepthLog2) << R300_TX_DEPTHMASK_SHIFT) - | ((t->mt->lastLevel - t->mt->firstLevel) << R300_TX_MAX_MIP_LEVEL_SHIFT)); + t->pp_txsize = (((R300_TX_WIDTHMASK_MASK & ((firstImage->Width - 1) << R300_TX_WIDTHMASK_SHIFT))) + | ((R300_TX_HEIGHTMASK_MASK & ((firstImage->Height - 1) << R300_TX_HEIGHTMASK_SHIFT))) + | ((R300_TX_DEPTHMASK_MASK & ((firstImage->DepthLog2) << R300_TX_DEPTHMASK_SHIFT))) + | ((R300_TX_MAX_MIP_LEVEL_MASK & ((t->mt->lastLevel - t->mt->firstLevel) << R300_TX_MAX_MIP_LEVEL_SHIFT)))); t->tile_bits = 0; @@ -248,8 +248,12 @@ static void setup_hardware_state(r300ContextPtr rmesa, radeonTexObj *t) if (rmesa->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) { if (firstImage->Width > 2048) t->pp_txpitch |= R500_TXWIDTH_BIT11; + else + t->pp_txpitch &= ~R500_TXWIDTH_BIT11; if (firstImage->Height > 2048) t->pp_txpitch |= R500_TXHEIGHT_BIT11; + else + t->pp_txpitch &= ~R500_TXHEIGHT_BIT11; } } @@ -479,16 +483,20 @@ void r300SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo break; } pitch_val--; - t->pp_txsize = ((rb->base.Width - 1) << R300_TX_WIDTHMASK_SHIFT) | - ((rb->base.Height - 1) << R300_TX_HEIGHTMASK_SHIFT); + t->pp_txsize = (((R300_TX_WIDTHMASK_MASK & ((rb->base.Width - 1) << R300_TX_WIDTHMASK_SHIFT))) + | ((R300_TX_HEIGHTMASK_MASK & ((rb->base.Height - 1) << R300_TX_HEIGHTMASK_SHIFT)))); t->pp_txsize |= R300_TX_SIZE_TXPITCH_EN; t->pp_txpitch |= pitch_val; if (rmesa->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) { if (rb->base.Width > 2048) t->pp_txpitch |= R500_TXWIDTH_BIT11; + else + t->pp_txpitch &= ~R500_TXWIDTH_BIT11; if (rb->base.Height > 2048) t->pp_txpitch |= R500_TXHEIGHT_BIT11; + else + t->pp_txpitch &= ~R500_TXHEIGHT_BIT11; } t->validated = GL_TRUE; _mesa_unlock_texture(radeon->glCtx, texObj); -- cgit v1.2.3 From ca940a73a72c68c461344d27f9d1fac31cd73819 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 20 Oct 2009 10:43:46 -0600 Subject: mesa: Fix Mac OS build. strtod_l needs the xlocale.h header on Mac OS. It's possible other non-Linux OSes would need this header too. --- src/mesa/main/imports.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 87cb5ce0fb..30fa55997e 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -50,6 +50,9 @@ #ifdef _GNU_SOURCE #include +#ifdef __APPLE__ +#include +#endif #endif -- cgit v1.2.3 From cbd20e18a0f82a653513d165694ed7bbb336e765 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 19 Oct 2009 17:54:42 -0700 Subject: meta: Fix the BufferSubData in meta clear to be BufferData. Fixes a 3.4% +/- 1.3% performance regression in my GL demo (n=3). The other meta code could probably also use the same treatment. --- src/mesa/drivers/common/meta.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index ceb929f694..b38f22e130 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -1346,8 +1346,6 @@ _mesa_meta_Clear(GLcontext *ctx, GLbitfield buffers) /* create vertex array buffer */ _mesa_GenBuffersARB(1, &clear->VBO); _mesa_BindBufferARB(GL_ARRAY_BUFFER_ARB, clear->VBO); - _mesa_BufferDataARB(GL_ARRAY_BUFFER_ARB, sizeof(verts), - NULL, GL_DYNAMIC_DRAW_ARB); /* setup vertex arrays */ _mesa_VertexPointer(3, GL_FLOAT, sizeof(struct vertex), OFFSET(x)); @@ -1423,7 +1421,8 @@ _mesa_meta_Clear(GLcontext *ctx, GLbitfield buffers) } /* upload new vertex data */ - _mesa_BufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, sizeof(verts), verts); + _mesa_BufferDataARB(GL_ARRAY_BUFFER_ARB, sizeof(verts), verts, + GL_DYNAMIC_DRAW_ARB); } /* draw quad */ -- cgit v1.2.3 From d56125a298106d81e10674f1c4b3b43b51a5139d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 20 Oct 2009 14:51:53 -0700 Subject: intel: Fix flipped condition in ARB_sync GetSYnciv(GL_SYNC_STATUS). Bug #24435 --- src/mesa/drivers/dri/intel/intel_syncobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_syncobj.c b/src/mesa/drivers/dri/intel/intel_syncobj.c index 1286fe929b..0d7889d3c2 100644 --- a/src/mesa/drivers/dri/intel/intel_syncobj.c +++ b/src/mesa/drivers/dri/intel/intel_syncobj.c @@ -114,7 +114,7 @@ static void intel_check_sync(GLcontext *ctx, struct gl_sync_object *s) { struct intel_sync_object *sync = (struct intel_sync_object *)s; - if (sync->bo && drm_intel_bo_busy(sync->bo)) { + if (sync->bo && !drm_intel_bo_busy(sync->bo)) { drm_intel_bo_unreference(sync->bo); sync->bo = NULL; s->StatusFlag = 1; -- cgit v1.2.3 From 2cc5a0e6bb8fe2aa0733d70fec65df934b1093f6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 20 Oct 2009 16:13:08 -0600 Subject: mesa: added _mesa_dump_renderbuffers() debug code --- src/mesa/main/debug.c | 76 +++++++++++++++++++++++++++++++++++++++++++++++++-- src/mesa/main/debug.h | 3 ++ 2 files changed, 77 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 490cc9c26b..8b1707bab3 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -27,6 +27,7 @@ #include "attrib.h" #include "colormac.h" #include "context.h" +#include "enums.h" #include "hash.h" #include "imports.h" #include "debug.h" @@ -264,10 +265,13 @@ write_ppm(const char *filename, const GLubyte *buffer, int width, int height, /** - * Write level[0] image to a ppm file. + * Write a texture image to a ppm file. + * \param face cube face in [0,5] + * \param level mipmap level */ static void -write_texture_image(struct gl_texture_object *texObj, GLuint face, GLuint level) +write_texture_image(struct gl_texture_object *texObj, + GLuint face, GLuint level) { struct gl_texture_image *img = texObj->Image[face][level]; if (img) { @@ -299,6 +303,45 @@ write_texture_image(struct gl_texture_object *texObj, GLuint face, GLuint level) } +/** + * Write renderbuffer image to a ppm file. + */ +static void +write_renderbuffer_image(const struct gl_renderbuffer *rb) +{ + GET_CURRENT_CONTEXT(ctx); + GLubyte *buffer; + char s[100]; + GLenum format, type; + + if (rb->_BaseFormat == GL_RGB || + rb->_BaseFormat == GL_RGBA) { + format = GL_RGBA; + type = GL_UNSIGNED_BYTE; + } + else if (rb->_BaseFormat == GL_DEPTH_STENCIL) { + format = GL_DEPTH_STENCIL; + type = GL_UNSIGNED_INT_24_8; + } + else { + return; + } + + buffer = (GLubyte *) _mesa_malloc(rb->Width * rb->Height * 4); + + ctx->Driver.ReadPixels(ctx, 0, 0, rb->Width, rb->Height, + format, type, &ctx->DefaultPacking, buffer); + + /* make filename */ + _mesa_sprintf(s, "/tmp/renderbuffer%u.ppm", rb->Name); + + _mesa_printf(" Writing renderbuffer image to %s\n", s); + write_ppm(s, buffer, rb->Width, rb->Height, 4, 0, 1, 2, GL_TRUE); + + _mesa_free(buffer); +} + + static GLboolean DumpImages; @@ -341,6 +384,35 @@ _mesa_dump_textures(GLboolean dumpImages) } +static void +dump_renderbuffer_cb(GLuint id, void *data, void *userData) +{ + const struct gl_renderbuffer *rb = (const struct gl_renderbuffer *) data; + (void) userData; + + _mesa_printf("Renderbuffer %u: %u x %u IntFormat = %s\n", + rb->Name, rb->Width, rb->Height, + _mesa_lookup_enum_by_nr(rb->InternalFormat)); + if (DumpImages) { + write_renderbuffer_image(rb); + } +} + + +/** + * Print basic info about all renderbuffers to stdout. + * If dumpImages is true, write PPM of level[0] image to a file. + */ +void +_mesa_dump_renderbuffers(GLboolean dumpImages) +{ + GET_CURRENT_CONTEXT(ctx); + DumpImages = dumpImages; + _mesa_HashWalk(ctx->Shared->RenderBuffers, dump_renderbuffer_cb, ctx); +} + + + void _mesa_dump_color_buffer(const char *filename) { diff --git a/src/mesa/main/debug.h b/src/mesa/main/debug.h index bb384c4324..2a7de9c6b6 100644 --- a/src/mesa/main/debug.h +++ b/src/mesa/main/debug.h @@ -60,6 +60,9 @@ extern void _mesa_init_debug( GLcontext *ctx ); extern void _mesa_dump_textures(GLboolean dumpImages); +extern void +_mesa_dump_renderbuffers(GLboolean dumpImages); + extern void _mesa_dump_color_buffer(const char *filename); -- cgit v1.2.3 From e4c700dbbf2a802f32bf62256c801105998c3729 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 21 Oct 2009 19:55:44 -0600 Subject: mesa: added MESA_FORMAT_X8_Z24 format 24-bit Z in 32-bit pixel. We could probably use the MESA_FORMAT_S8_Z24 format but this there's a few places where we explicitly don't want stencil. This format may go away at some point in the future. --- src/mesa/main/formats.c | 13 +++++++++++++ src/mesa/main/formats.h | 1 + src/mesa/main/texfetch.c | 7 +++++++ src/mesa/main/texstore.c | 36 ++++++++++++++++++++++++++++++++++++ 4 files changed, 57 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index 2924ab69cc..45ac39a818 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -290,6 +290,14 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 0, 0, 0, 16, 0, /* Lum/Int/Index/Depth/StencilBits */ 1, 1, 2 /* BlockWidth/Height,Bytes */ }, + { + MESA_FORMAT_X8_Z24, /* Name */ + GL_DEPTH_COMPONENT, /* BaseFormat */ + GL_UNSIGNED_INT, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 24, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, { MESA_FORMAT_Z32, /* Name */ GL_DEPTH_COMPONENT, /* BaseFormat */ @@ -873,6 +881,11 @@ _mesa_format_to_type_and_comps(gl_format format, *comps = 1; return; + case MESA_FORMAT_X8_Z24: + *datatype = GL_UNSIGNED_INT; + *comps = 1; + return; + case MESA_FORMAT_Z32: *datatype = GL_UNSIGNED_INT; *comps = 1; diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index 30915bfe4b..f8b4a6cdf4 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -76,6 +76,7 @@ typedef enum MESA_FORMAT_Z24_S8, /* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ SSSS SSSS */ MESA_FORMAT_S8_Z24, /* SSSS SSSS ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */ MESA_FORMAT_Z16, /* ZZZZ ZZZZ ZZZZ ZZZZ */ + MESA_FORMAT_X8_Z24, /* xxxx xxxx ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */ MESA_FORMAT_Z32, /* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */ MESA_FORMAT_S8, /* SSSS SSSS */ /*@}*/ diff --git a/src/mesa/main/texfetch.c b/src/mesa/main/texfetch.c index c50219521b..e6e28aef19 100644 --- a/src/mesa/main/texfetch.c +++ b/src/mesa/main/texfetch.c @@ -522,6 +522,13 @@ texfetch_funcs[MESA_FORMAT_COUNT] = fetch_texel_3d_f_z16, store_texel_z16 }, + { + MESA_FORMAT_X8_Z24, + fetch_texel_1d_f_s8_z24, + fetch_texel_2d_f_s8_z24, + fetch_texel_3d_f_s8_z24, + store_texel_s8_z24 + }, { MESA_FORMAT_Z32, fetch_texel_1d_f_z32, diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 604f6c462a..d0d4250352 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -1048,6 +1048,41 @@ _mesa_texstore_z32(TEXSTORE_PARAMS) return GL_TRUE; } + +/** + * Store a 24-bit integer depth component texture image. + */ +static GLboolean +_mesa_texstore_x8_z24(TEXSTORE_PARAMS) +{ + const GLuint depthScale = 0xffffff; + const GLuint texelBytes = 4; + + (void) dims; + ASSERT(dstFormat == MESA_FORMAT_X8_Z24); + + { + /* general path */ + GLint img, row; + for (img = 0; img < srcDepth; img++) { + GLubyte *dstRow = (GLubyte *) dstAddr + + dstImageOffsets[dstZoffset + img] * texelBytes + + dstYoffset * dstRowStride + + dstXoffset * texelBytes; + for (row = 0; row < srcHeight; row++) { + const GLvoid *src = _mesa_image_address(dims, srcPacking, + srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, row, 0); + _mesa_unpack_depth_span(ctx, srcWidth, + GL_UNSIGNED_INT, (GLuint *) dstRow, + depthScale, srcType, src, srcPacking); + dstRow += dstRowStride; + } + } + } + return GL_TRUE; +} + + #define STRIDE_3D 0 /** @@ -3009,6 +3044,7 @@ texstore_funcs[MESA_FORMAT_COUNT] = { MESA_FORMAT_Z24_S8, _mesa_texstore_z24_s8 }, { MESA_FORMAT_S8_Z24, _mesa_texstore_s8_z24 }, { MESA_FORMAT_Z16, _mesa_texstore_z16 }, + { MESA_FORMAT_X8_Z24, _mesa_texstore_x8_z24 }, { MESA_FORMAT_Z32, _mesa_texstore_z32 }, { MESA_FORMAT_S8, NULL/*_mesa_texstore_s8*/ }, { MESA_FORMAT_SRGB8, _mesa_texstore_srgb8 }, -- cgit v1.2.3 From 832f29770d91c7d98c9b8438922247fff8f0f8bd Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 21 Oct 2009 19:56:18 -0600 Subject: mesa: use MESA_FORMAT_X8_Z24 format --- src/mesa/main/depthstencil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/depthstencil.c b/src/mesa/main/depthstencil.c index 803dc6c75e..6fefdac1e3 100644 --- a/src/mesa/main/depthstencil.c +++ b/src/mesa/main/depthstencil.c @@ -366,7 +366,7 @@ _mesa_new_z24_renderbuffer_wrapper(GLcontext *ctx, z24rb->Width = dsrb->Width; z24rb->Height = dsrb->Height; z24rb->InternalFormat = GL_DEPTH_COMPONENT24; - z24rb->Format = MESA_FORMAT_Z24_S8; + z24rb->Format = MESA_FORMAT_X8_Z24; z24rb->_BaseFormat = GL_DEPTH_COMPONENT; z24rb->DataType = GL_UNSIGNED_INT; z24rb->Data = NULL; -- cgit v1.2.3 From c55b355fd460453a459e073ac4119c69e06e7531 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 21 Oct 2009 19:58:00 -0600 Subject: mesa: use MESA_FORMAT_X8_Z24 --- src/mesa/main/renderbuffer.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c index 409fd8634a..0e21656385 100644 --- a/src/mesa/main/renderbuffer.c +++ b/src/mesa/main/renderbuffer.c @@ -1052,6 +1052,18 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, pixelSize = sizeof(GLushort); break; case GL_DEPTH_COMPONENT24: + rb->DataType = GL_UNSIGNED_INT; + rb->GetPointer = get_pointer_uint; + rb->GetRow = get_row_uint; + rb->GetValues = get_values_uint; + rb->PutRow = put_row_uint; + rb->PutRowRGB = NULL; + rb->PutMonoRow = put_mono_row_uint; + rb->PutValues = put_values_uint; + rb->PutMonoValues = put_mono_values_uint; + rb->Format = MESA_FORMAT_X8_Z24; + pixelSize = sizeof(GLuint); + break; case GL_DEPTH_COMPONENT32: rb->DataType = GL_UNSIGNED_INT; rb->GetPointer = get_pointer_uint; @@ -1735,6 +1747,10 @@ _mesa_add_depth_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb, rb->Format = MESA_FORMAT_Z16; rb->InternalFormat = GL_DEPTH_COMPONENT16; } + else if (depthBits <= 24) { + rb->Format = MESA_FORMAT_X8_Z24; + rb->InternalFormat = GL_DEPTH_COMPONENT24; + } else { rb->Format = MESA_FORMAT_Z32; rb->InternalFormat = GL_DEPTH_COMPONENT32; -- cgit v1.2.3 From 4bd70b5cff13039a4b0e0c554156fec06e3c3906 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 21 Oct 2009 20:00:43 -0600 Subject: i965: change parameter type to gl_format --- src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index ea559d2ac7..5d8bb7a14b 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -69,7 +69,8 @@ static GLuint translate_tex_target( GLenum target ) } -static GLuint translate_tex_format( GLuint mesa_format, GLenum internal_format, +static GLuint translate_tex_format( gl_format mesa_format, + GLenum internal_format, GLenum depth_mode ) { switch( mesa_format ) { -- cgit v1.2.3 From 68d94a608a6d46156a567b8f0e011ac58054975e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 21 Oct 2009 20:02:33 -0600 Subject: intel: use MESA_FORMAT_S8_Z24 format and avoid z24s8/s8z24 conversions --- src/mesa/drivers/dri/intel/intel_buffers.c | 2 +- src/mesa/drivers/dri/intel/intel_fbo.c | 26 +++++++++++++------------- src/mesa/drivers/dri/intel/intel_span.c | 20 ++++---------------- src/mesa/drivers/dri/intel/intel_tex_format.c | 2 +- 4 files changed, 19 insertions(+), 31 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c index fce227e9d9..6661cc77d2 100644 --- a/src/mesa/drivers/dri/intel/intel_buffers.c +++ b/src/mesa/drivers/dri/intel/intel_buffers.c @@ -257,7 +257,7 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb) if (fb->_StencilBuffer && fb->_StencilBuffer->Wrapped) { irbStencil = intel_renderbuffer(fb->_StencilBuffer->Wrapped); if (irbStencil && irbStencil->region) { - ASSERT(irbStencil->Base.Format == MESA_FORMAT_Z24_S8); + ASSERT(irbStencil->Base.Format == MESA_FORMAT_S8_Z24); FALLBACK(intel, INTEL_FALLBACK_STENCIL_BUFFER, GL_FALSE); } else { diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 292cccf7f2..2d73f6e2a3 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -148,10 +148,10 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_STENCIL_INDEX8_EXT: case GL_STENCIL_INDEX16_EXT: /* alloc a depth+stencil buffer */ - rb->Format = MESA_FORMAT_Z24_S8; + rb->Format = MESA_FORMAT_S8_Z24; rb->DataType = GL_UNSIGNED_INT_24_8_EXT; cpp = 4; - irb->texformat = MESA_FORMAT_Z24_S8; + irb->texformat = MESA_FORMAT_S8_Z24; break; case GL_DEPTH_COMPONENT16: rb->Format = MESA_FORMAT_Z16; @@ -162,17 +162,17 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT24: case GL_DEPTH_COMPONENT32: - rb->Format = MESA_FORMAT_Z24_S8; + rb->Format = MESA_FORMAT_S8_Z24; rb->DataType = GL_UNSIGNED_INT_24_8_EXT; cpp = 4; - irb->texformat = MESA_FORMAT_Z24_S8; + irb->texformat = MESA_FORMAT_S8_Z24; break; case GL_DEPTH_STENCIL_EXT: case GL_DEPTH24_STENCIL8_EXT: - rb->Format = MESA_FORMAT_Z24_S8; + rb->Format = MESA_FORMAT_S8_Z24; rb->DataType = GL_UNSIGNED_INT_24_8_EXT; cpp = 4; - irb->texformat = MESA_FORMAT_Z24_S8; + irb->texformat = MESA_FORMAT_S8_Z24; break; default: _mesa_problem(ctx, @@ -328,10 +328,10 @@ intel_create_renderbuffer(GLenum intFormat) irb->texformat = MESA_FORMAT_ARGB8888; break; case GL_STENCIL_INDEX8_EXT: - irb->Base.Format = MESA_FORMAT_Z24_S8; + irb->Base.Format = MESA_FORMAT_S8_Z24; irb->Base._BaseFormat = GL_STENCIL_INDEX; irb->Base.DataType = GL_UNSIGNED_BYTE; - irb->texformat = MESA_FORMAT_Z24_S8; + irb->texformat = MESA_FORMAT_S8_Z24; break; case GL_DEPTH_COMPONENT16: irb->Base.Format = MESA_FORMAT_Z16; @@ -340,16 +340,16 @@ intel_create_renderbuffer(GLenum intFormat) irb->texformat = MESA_FORMAT_Z16; break; case GL_DEPTH_COMPONENT24: - irb->Base.Format = MESA_FORMAT_Z24_S8; + irb->Base.Format = MESA_FORMAT_S8_Z24; irb->Base._BaseFormat = GL_DEPTH_COMPONENT; irb->Base.DataType = GL_UNSIGNED_INT; - irb->texformat = MESA_FORMAT_Z24_S8; + irb->texformat = MESA_FORMAT_S8_Z24; break; case GL_DEPTH24_STENCIL8_EXT: - irb->Base.Format = MESA_FORMAT_Z24_S8; + irb->Base.Format = MESA_FORMAT_S8_Z24; irb->Base._BaseFormat = GL_DEPTH_STENCIL; irb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT; - irb->texformat = MESA_FORMAT_Z24_S8; + irb->texformat = MESA_FORMAT_S8_Z24; break; default: _mesa_problem(NULL, @@ -457,7 +457,7 @@ intel_update_wrapper(GLcontext *ctx, struct intel_renderbuffer *irb, irb->Base.DataType = GL_UNSIGNED_SHORT; DBG("Render to DEPTH16 texture OK\n"); } - else if (texImage->TexFormat == MESA_FORMAT_Z24_S8) { + else if (texImage->TexFormat == MESA_FORMAT_S8_Z24) { irb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT; DBG("Render to DEPTH_STENCIL texture OK\n"); } diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index 540ebca15c..81692e93a9 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -131,18 +131,6 @@ pwrite_8(struct intel_renderbuffer *irb, uint32_t offset, uint8_t val) dri_bo_subdata(irb->region->buffer, offset, 1, &val); } -static uint32_t -z24s8_to_s8z24(uint32_t val) -{ - return (val << 24) | (val >> 8); -} - -static uint32_t -s8z24_to_z24s8(uint32_t val) -{ - return (val >> 24) | (val << 8); -} - static uint32_t no_tile_swizzle(struct intel_renderbuffer *irb, int x, int y) { @@ -374,8 +362,8 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb, /* z24s8 depthbuffer functions. */ #define INTEL_VALUE_TYPE GLuint -#define INTEL_WRITE_DEPTH(offset, d) pwrite_32(irb, offset, z24s8_to_s8z24(d)) -#define INTEL_READ_DEPTH(offset) s8z24_to_z24s8(pread_32(irb, offset)) +#define INTEL_WRITE_DEPTH(offset, d) pwrite_32(irb, offset, d) +#define INTEL_READ_DEPTH(offset) pread_32(irb, offset) #define INTEL_TAG(name) name##_z24_s8 #include "intel_depthtmp.h" @@ -665,13 +653,13 @@ intel_set_span_functions(struct intel_context *intel, break; } break; - case MESA_FORMAT_Z24_S8: + case MESA_FORMAT_S8_Z24: /* There are a few different ways SW asks us to access the S8Z24 data: * Z24 depth-only depth reads * S8Z24 depth reads * S8Z24 stencil reads. */ - if (rb->Format == MESA_FORMAT_Z24_S8) { + if (rb->Format == MESA_FORMAT_S8_Z24) { switch (tiling) { case I915_TILING_NONE: default: diff --git a/src/mesa/drivers/dri/intel/intel_tex_format.c b/src/mesa/drivers/dri/intel/intel_tex_format.c index a71590d3ef..eca0f6d572 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_format.c +++ b/src/mesa/drivers/dri/intel/intel_tex_format.c @@ -153,7 +153,7 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat, #endif case GL_DEPTH_STENCIL_EXT: case GL_DEPTH24_STENCIL8_EXT: - return MESA_FORMAT_Z24_S8; + return MESA_FORMAT_S8_Z24; #ifndef I915 case GL_SRGB_EXT: -- cgit v1.2.3 From c18b022d0d1dc07c37c0bd981d4fc6fac27e5a45 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 21 Oct 2009 21:12:23 -0600 Subject: radeon: replace MESA_FORMAT_Z24_S8 with MESA_FORMAT_S8_Z24 Core Mesa deals with MESA_FORMAT_S8_Z24 everywhere it should so we shouldn't have to use MESA_FORMAT_Z24_S8 anymore. --- src/mesa/drivers/dri/r300/r300_texstate.c | 2 +- src/mesa/drivers/dri/r600/r600_texstate.c | 6 +++--- src/mesa/drivers/dri/radeon/radeon_span.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index 1e9bd3e849..63f0154cd3 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -159,7 +159,7 @@ void r300SetDepthTexMode(struct gl_texture_object *tObj) case MESA_FORMAT_Z16: format = formats[0]; break; - case MESA_FORMAT_Z24_S8: + case MESA_FORMAT_S8_Z24: format = formats[1]; break; case MESA_FORMAT_Z32: diff --git a/src/mesa/drivers/dri/r600/r600_texstate.c b/src/mesa/drivers/dri/r600/r600_texstate.c index 35186ef970..63d88f83d6 100644 --- a/src/mesa/drivers/dri/r600/r600_texstate.c +++ b/src/mesa/drivers/dri/r600/r600_texstate.c @@ -77,7 +77,7 @@ void r600UpdateTextureState(GLcontext * ctx) } } -static GLboolean r600GetTexFormat(struct gl_texture_object *tObj, GLuint mesa_format) +static GLboolean r600GetTexFormat(struct gl_texture_object *tObj, gl_format mesa_format) { radeonTexObj *t = radeon_tex_obj(tObj); @@ -479,14 +479,14 @@ static GLboolean r600GetTexFormat(struct gl_texture_object *tObj, GLuint mesa_fo SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask); break; case MESA_FORMAT_Z16: - case MESA_FORMAT_Z24_S8: + case MESA_FORMAT_S8_Z24: case MESA_FORMAT_Z32: switch (mesa_format) { case MESA_FORMAT_Z16: SETfield(t->SQ_TEX_RESOURCE1, FMT_16, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask); break; - case MESA_FORMAT_Z24_S8: + case MESA_FORMAT_S8_Z24: SETfield(t->SQ_TEX_RESOURCE1, FMT_24_8, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask); break; diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c b/src/mesa/drivers/dri/radeon/radeon_span.c index 055f77a24b..4b47e756c7 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.c +++ b/src/mesa/drivers/dri/radeon/radeon_span.c @@ -878,11 +878,11 @@ static void radeonSetSpanFunctions(struct radeon_renderbuffer *rrb) radeonInitDepthPointers_z16(&rrb->base); } else if (rrb->base.Format == GL_DEPTH_COMPONENT32) { /* XXX */ radeonInitDepthPointers_z24(&rrb->base); - } else if (rrb->base.Format == MESA_FORMAT_Z24_S8) { + } else if (rrb->base.Format == MESA_FORMAT_S8_Z24) { radeonInitDepthPointers_z24_s8(&rrb->base); } else if (rrb->base.Format == MESA_FORMAT_S8) { radeonInitStencilPointers_z24_s8(&rrb->base); } else { - fprintf(stderr, "radeonSetSpanFunctions: bad actual format: 0x%04X\n", rrb->base.Format); + fprintf(stderr, "radeonSetSpanFunctions: bad format: 0x%04X\n", rrb->base.Format); } } -- cgit v1.2.3 From 6e1ddd34c6b6f9773ef87198503f5f61f9a6c23a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 21 Oct 2009 21:20:05 -0600 Subject: radeon: get rid of z24s8 <-> s8z24 conversions in span code Can just use s8z24 everywhere. Note: the WRITE_DEPTH macro for R600 may need to be fixed. --- src/mesa/drivers/dri/radeon/radeon_span.c | 34 ++++++++----------------------- 1 file changed, 8 insertions(+), 26 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c b/src/mesa/drivers/dri/radeon/radeon_span.c index 4b47e756c7..9cdcde1eb0 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.c +++ b/src/mesa/drivers/dri/radeon/radeon_span.c @@ -334,22 +334,6 @@ static GLubyte *radeon_ptr_2byte_8x2(const struct radeon_renderbuffer * rrb, #endif -#ifndef RADEON_R300 -#ifndef RADEON_R600 -static uint32_t -z24s8_to_s8z24(uint32_t val) -{ - return (val << 24) | (val >> 8); -} - -static uint32_t -s8z24_to_z24s8(uint32_t val) -{ - return (val >> 24) | (val << 8); -} -#endif -#endif - /* * Note that all information needed to access pixels in a renderbuffer * should be obtained through the gl_renderbuffer parameter, not per-context @@ -631,15 +615,13 @@ do { \ #define WRITE_DEPTH( _x, _y, d ) \ do { \ GLuint *_ptr = (GLuint*)r200_depth_4byte( rrb, _x + x_off, _y + y_off ); \ - GLuint tmp = z24s8_to_s8z24(d); \ - *_ptr = tmp; \ + *_ptr = d; \ } while (0) #else #define WRITE_DEPTH( _x, _y, d ) \ do { \ GLuint *_ptr = (GLuint*)radeon_ptr_4byte( rrb, _x + x_off, _y + y_off ); \ - GLuint tmp = z24s8_to_s8z24(d); \ - *_ptr = tmp; \ + *_ptr = d; \ } while (0) #endif @@ -657,15 +639,15 @@ do { \ #elif defined(RADEON_R200) #define READ_DEPTH( d, _x, _y ) \ do { \ - d = s8z24_to_z24s8(*(GLuint*)(r200_depth_4byte(rrb, _x + x_off, _y + y_off))); \ + d = *(GLuint*)(r200_depth_4byte(rrb, _x + x_off, _y + y_off)); \ }while(0) #else #define READ_DEPTH( d, _x, _y ) do { \ - d = s8z24_to_z24s8(*(GLuint*)(radeon_ptr_4byte(rrb, _x + x_off, _y + y_off ))); \ + d = *(GLuint*)(radeon_ptr_4byte(rrb, _x + x_off, _y + y_off )); \ } while (0) #endif -#define TAG(x) radeon##x##_z24_s8 +#define TAG(x) radeon##x##_s8_z24 #include "depthtmp.h" /* ================================================================ @@ -742,7 +724,7 @@ do { \ } while (0) #endif -#define TAG(x) radeon##x##_z24_s8 +#define TAG(x) radeon##x##_s8_z24 #include "stenciltmp.h" @@ -879,9 +861,9 @@ static void radeonSetSpanFunctions(struct radeon_renderbuffer *rrb) } else if (rrb->base.Format == GL_DEPTH_COMPONENT32) { /* XXX */ radeonInitDepthPointers_z24(&rrb->base); } else if (rrb->base.Format == MESA_FORMAT_S8_Z24) { - radeonInitDepthPointers_z24_s8(&rrb->base); + radeonInitDepthPointers_s8_z24(&rrb->base); } else if (rrb->base.Format == MESA_FORMAT_S8) { - radeonInitStencilPointers_z24_s8(&rrb->base); + radeonInitStencilPointers_s8_z24(&rrb->base); } else { fprintf(stderr, "radeonSetSpanFunctions: bad format: 0x%04X\n", rrb->base.Format); } -- cgit v1.2.3 From 3c685608664900562919136fbc33ac16060a27c3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 21 Oct 2009 21:47:58 -0600 Subject: i915: replace MESA_FORMAT_Z24_S8 with MESA_FORMAT_S8_Z24 And change parameter type. --- src/mesa/drivers/dri/i915/i915_texstate.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index e441e287eb..d6bfe5fc7f 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -36,7 +36,7 @@ static GLuint -translate_texture_format(GLuint mesa_format, GLuint internal_format, +translate_texture_format(gl_format mesa_format, GLuint internal_format, GLenum DepthMode) { switch (mesa_format) { @@ -80,7 +80,7 @@ translate_texture_format(GLuint mesa_format, GLuint internal_format, return (MAPSURF_COMPRESSED | MT_COMPRESS_DXT2_3); case MESA_FORMAT_RGBA_DXT5: return (MAPSURF_COMPRESSED | MT_COMPRESS_DXT4_5); - case MESA_FORMAT_Z24_S8: + case MESA_FORMAT_S8_Z24: return (MAPSURF_32BIT | MT_32BIT_xI824); default: fprintf(stderr, "%s: bad image format %x\n", __FUNCTION__, mesa_format); -- cgit v1.2.3 From b86302283b48654682e0580c53ece01bf095fa95 Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Tue, 20 Oct 2009 11:45:39 +0300 Subject: r600: add beginnings of ARL instruction --- src/mesa/drivers/dri/r600/r700_assembler.c | 35 +++++++++++++++++++++++++++--- src/mesa/drivers/dri/r600/r700_assembler.h | 1 + 2 files changed, 33 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index a683008746..d0eb9949a6 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -355,6 +355,7 @@ unsigned int r700GetNumOperands(r700_AssemblerBase* pAsm) return 2; case SQ_OP2_INST_MOV: + case SQ_OP2_INST_MOVA_FLOOR: case SQ_OP2_INST_FRACT: case SQ_OP2_INST_FLOOR: case SQ_OP2_INST_EXP_IEEE: @@ -2064,7 +2065,7 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) } //other bits - alu_instruction_ptr->m_Word0.f.index_mode = SQ_INDEX_LOOP; + alu_instruction_ptr->m_Word0.f.index_mode = SQ_INDEX_AR_X; if( (is_single_scalar_operation == GL_TRUE) || (GL_TRUE == bSplitInst) ) @@ -2398,6 +2399,35 @@ GLboolean assemble_ADD(r700_AssemblerBase *pAsm) return GL_TRUE; } +GLboolean assemble_ARL(r700_AssemblerBase *pAsm) +{ /* TODO: ar values dont' persist between clauses */ + if( GL_FALSE == checkop1(pAsm) ) + { + return GL_FALSE; + } + + pAsm->D.dst.opcode = SQ_OP2_INST_MOVA_FLOOR; + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = 0; + pAsm->D.dst.writex = 0; + pAsm->D.dst.writey = 0; + pAsm->D.dst.writez = 0; + pAsm->D.dst.writew = 0; + + if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + { + return GL_FALSE; + } + + if( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } + + return GL_TRUE; +} + GLboolean assemble_BAD(char *opcode_str) { radeon_error("Not yet implemented instruction (%s)\n", opcode_str); @@ -3812,8 +3842,7 @@ GLboolean AssembleInstr(GLuint uiNumberInsts, break; case OPCODE_ARL: - radeon_error("Not yet implemented instruction OPCODE_ARL \n"); - //if ( GL_FALSE == assemble_BAD("ARL") ) + if ( GL_FALSE == assemble_ARL(pR700AsmCode) ) return GL_FALSE; break; case OPCODE_ARR: diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index 73bb8bac55..d639592702 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -461,6 +461,7 @@ GLboolean next_ins(r700_AssemblerBase *pAsm); GLboolean assemble_math_function(r700_AssemblerBase* pAsm, BITS opcode); GLboolean assemble_ABS(r700_AssemblerBase *pAsm); GLboolean assemble_ADD(r700_AssemblerBase *pAsm); +GLboolean assemble_ARL(r700_AssemblerBase *pAsm); GLboolean assemble_BAD(char *opcode_str); GLboolean assemble_CMP(r700_AssemblerBase *pAsm); GLboolean assemble_COS(r700_AssemblerBase *pAsm); -- cgit v1.2.3 From a88c9296cb079ff42ef901113d0fe772228e6feb Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Wed, 21 Oct 2009 12:23:27 +0300 Subject: r600: need to export something from PS Also avoids empty shader for "END" - seems to be somewhat valid fp Maybe this can be done differently in the future (fake FRAG_RESULT_COLOR already in Map_Fragment_Program() or is there a way to program the chip to not hang in case of no exports. --- src/mesa/drivers/dri/r600/r700_assembler.c | 11 ++++++++++- src/mesa/drivers/dri/r600/r700_fragprog.c | 10 +++++++++- 2 files changed, 19 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index d0eb9949a6..6ff08e1cfb 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -4187,6 +4187,7 @@ GLboolean Process_Fragment_Exports(r700_AssemblerBase *pR700AsmCode, GLbitfield OutputsWritten) { unsigned int unBit; + GLuint export_count = 0; if(pR700AsmCode->depth_export_register_number >= 0) { @@ -4208,6 +4209,7 @@ GLboolean Process_Fragment_Exports(r700_AssemblerBase *pR700AsmCode, { return GL_FALSE; } + export_count++; } unBit = 1 << FRAG_RESULT_DEPTH; if(OutputsWritten & unBit) @@ -4221,8 +4223,15 @@ GLboolean Process_Fragment_Exports(r700_AssemblerBase *pR700AsmCode, { return GL_FALSE; } + export_count++; } - + /* Need to export something, otherwise we'll hang + * results are undefined anyway */ + if(export_count == 0) + { + Process_Export(pR700AsmCode, SQ_EXPORT_PIXEL, 0, 1, 0, GL_FALSE); + } + if(pR700AsmCode->cf_last_export_ptr != NULL) { pR700AsmCode->cf_last_export_ptr->m_Word1.f.cf_inst = SQ_CF_INST_EXPORT_DONE; diff --git a/src/mesa/drivers/dri/r600/r700_fragprog.c b/src/mesa/drivers/dri/r600/r700_fragprog.c index 62a1ea1a22..3736bce11c 100644 --- a/src/mesa/drivers/dri/r600/r700_fragprog.c +++ b/src/mesa/drivers/dri/r600/r700_fragprog.c @@ -251,7 +251,15 @@ GLboolean r700TranslateFragmentShader(struct r700_fragment_program *fp, number_of_colors_exported--; } - fp->r700Shader.exportMode = number_of_colors_exported << 1 | z_enabled; + /* illegal to set this to 0 */ + if(number_of_colors_exported || z_enabled) + { + fp->r700Shader.exportMode = number_of_colors_exported << 1 | z_enabled; + } + else + { + fp->r700Shader.exportMode = (1 << 1); + } fp->translated = GL_TRUE; -- cgit v1.2.3 From 869e20bcb7db9c6540eb6b538104303df738d302 Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Wed, 21 Oct 2009 19:04:21 +0300 Subject: r600: set barrier for tex inst if dst is used earlier, might overwrite it otherwise --- src/mesa/drivers/dri/r600/r700_fragprog.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_fragprog.c b/src/mesa/drivers/dri/r600/r700_fragprog.c index 3736bce11c..0f549ead9c 100644 --- a/src/mesa/drivers/dri/r600/r700_fragprog.c +++ b/src/mesa/drivers/dri/r600/r700_fragprog.c @@ -135,15 +135,19 @@ GLboolean Find_Instruction_Dependencies_fp(struct r700_fragment_program *fp, { GLuint i, j; GLint * puiTEMPwrites; + GLint * puiTEMPreads; struct prog_instruction * pILInst; InstDeps *pInstDeps; struct prog_instruction * texcoord_DepInst; GLint nDepInstID; puiTEMPwrites = (GLint*) MALLOC(sizeof(GLuint)*mesa_fp->Base.NumTemporaries); + puiTEMPreads = (GLint*) MALLOC(sizeof(GLuint)*mesa_fp->Base.NumTemporaries); + for(i=0; iBase.NumTemporaries; i++) { puiTEMPwrites[i] = -1; + puiTEMPreads[i] = -1; } pInstDeps = (InstDeps*)MALLOC(sizeof(InstDeps)*mesa_fp->Base.NumInstructions); @@ -167,6 +171,11 @@ GLboolean Find_Instruction_Dependencies_fp(struct r700_fragment_program *fp, { //Set dep. pInstDeps[i].nSrcDeps[j] = puiTEMPwrites[pILInst->SrcReg[j].Index]; + //Set first read + if(puiTEMPreads[pILInst->SrcReg[j].Index] < 0 ) + { + puiTEMPreads[pILInst->SrcReg[j].Index] = i; + } } else { @@ -177,8 +186,6 @@ GLboolean Find_Instruction_Dependencies_fp(struct r700_fragment_program *fp, fp->r700AsmCode.pInstDeps = pInstDeps; - FREE(puiTEMPwrites); - //Find dep for tex inst for(i=0; iBase.NumInstructions; i++) { @@ -203,9 +210,25 @@ GLboolean Find_Instruction_Dependencies_fp(struct r700_fragment_program *fp, { //... other deps? } } + // make sure that we dont overwrite src used earlier + nDepInstID = puiTEMPreads[pILInst->DstReg.Index]; + if(nDepInstID < i) + { + pInstDeps[i].nDstDep = puiTEMPreads[pILInst->DstReg.Index]; + texcoord_DepInst = &(mesa_fp->Base.Instructions[nDepInstID]); + if(GL_TRUE == IsAlu(texcoord_DepInst->Opcode) ) + { + pInstDeps[nDepInstID].nDstDep = i; + } + + } + } } + FREE(puiTEMPwrites); + FREE(puiTEMPreads); + return GL_TRUE; } -- cgit v1.2.3 From eb1b8ed1484f0cc792c5237114b54d5fa53164cc Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Oct 2009 12:26:17 -0600 Subject: radeon: fix some renderbuffer format bugs --- src/mesa/drivers/dri/radeon/radeon_fbo.c | 8 ++++---- src/mesa/drivers/dri/radeon/radeon_span.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index 21007d85c3..096ded23fb 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -280,14 +280,14 @@ radeon_create_renderbuffer(GLenum format, __DRIdrawablePrivate *driDrawPriv) rrb->base._BaseFormat = GL_DEPTH_COMPONENT; break; case GL_DEPTH_COMPONENT24: - rrb->base.Format = MESA_FORMAT_Z32; - rrb->base.DataType = GL_UNSIGNED_INT; - rrb->base._BaseFormat = GL_DEPTH_COMPONENT; + rrb->base.Format = MESA_FORMAT_S8_Z24; + rrb->base.DataType = GL_UNSIGNED_INT_24_8_EXT; + rrb->base._BaseFormat = GL_DEPTH_STENCIL; break; case GL_DEPTH24_STENCIL8_EXT: rrb->base.Format = MESA_FORMAT_S8_Z24; rrb->base.DataType = GL_UNSIGNED_INT_24_8_EXT; - rrb->base._BaseFormat = GL_STENCIL_INDEX; + rrb->base._BaseFormat = GL_DEPTH_STENCIL; break; default: fprintf(stderr, "%s: Unknown format 0x%04x\n", __FUNCTION__, format); diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c b/src/mesa/drivers/dri/radeon/radeon_span.c index 9cdcde1eb0..2add8c3eb7 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.c +++ b/src/mesa/drivers/dri/radeon/radeon_span.c @@ -848,9 +848,9 @@ static void radeonSetSpanFunctions(struct radeon_renderbuffer *rrb) { if (rrb->base.Format == MESA_FORMAT_RGB565) { radeonInitPointers_RGB565(&rrb->base); - } else if (rrb->base.Format == MESA_FORMAT_RGBA8888) { /* XXX */ + } else if (rrb->base.Format == MESA_FORMAT_XRGB8888) { radeonInitPointers_xRGB8888(&rrb->base); - } else if (rrb->base.Format == MESA_FORMAT_RGBA8888) { + } else if (rrb->base.Format == MESA_FORMAT_ARGB8888) { radeonInitPointers_ARGB8888(&rrb->base); } else if (rrb->base.Format == MESA_FORMAT_ARGB4444) { radeonInitPointers_ARGB4444(&rrb->base); @@ -858,7 +858,7 @@ static void radeonSetSpanFunctions(struct radeon_renderbuffer *rrb) radeonInitPointers_ARGB1555(&rrb->base); } else if (rrb->base.Format == MESA_FORMAT_Z16) { radeonInitDepthPointers_z16(&rrb->base); - } else if (rrb->base.Format == GL_DEPTH_COMPONENT32) { /* XXX */ + } else if (rrb->base.Format == MESA_FORMAT_X8_Z24) { radeonInitDepthPointers_z24(&rrb->base); } else if (rrb->base.Format == MESA_FORMAT_S8_Z24) { radeonInitDepthPointers_s8_z24(&rrb->base); -- cgit v1.2.3 From dd36006a4eb1cb08dc49af3075c215e6eea46e75 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Thu, 22 Oct 2009 14:48:45 -0400 Subject: r600: fix depth span macros for format changes --- src/mesa/drivers/dri/radeon/radeon_span.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c b/src/mesa/drivers/dri/radeon/radeon_span.c index 2add8c3eb7..2bc7d31254 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.c +++ b/src/mesa/drivers/dri/radeon/radeon_span.c @@ -603,12 +603,12 @@ do { \ GLuint *_ptr = (GLuint*)r600_ptr_depth( rrb, _x + x_off, _y + y_off ); \ GLuint tmp = *_ptr; \ tmp &= 0xff000000; \ - tmp |= (((d) >> 8) & 0x00ffffff); \ + tmp |= ((d) & 0x00ffffff); \ *_ptr = tmp; \ _ptr = (GLuint*)r600_ptr_stencil(rrb, _x + x_off, _y + y_off); \ tmp = *_ptr; \ tmp &= 0xffffff00; \ - tmp |= (d) & 0xff; \ + tmp |= ((d) >> 24) & 0xff; \ *_ptr = tmp; \ } while (0) #elif defined(RADEON_R200) @@ -633,8 +633,8 @@ do { \ #elif defined(RADEON_R600) #define READ_DEPTH( d, _x, _y ) \ do { \ - d = ((*(GLuint*)(r600_ptr_depth(rrb, _x + x_off, _y + y_off))) << 8) & 0xffffff00; \ - d |= (*(GLuint*)(r600_ptr_stencil(rrb, _x + x_off, _y + y_off))) & 0x000000ff; \ + d = (*(GLuint*)(r600_ptr_depth(rrb, _x + x_off, _y + y_off))) & 0x00ffffff; \ + d |= ((*(GLuint*)(r600_ptr_stencil(rrb, _x + x_off, _y + y_off))) << 24) & 0xff000000; \ }while(0) #elif defined(RADEON_R200) #define READ_DEPTH( d, _x, _y ) \ -- cgit v1.2.3 From 8e4657a9d4cbb899d388068cff0f8c267071fa50 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Thu, 22 Oct 2009 12:29:30 -0700 Subject: Nuke s3v. As per FDO #17889. --- src/mesa/drivers/dri/common/drirenderbuffer.h | 2 +- src/mesa/drivers/dri/s3v/Makefile | 35 - src/mesa/drivers/dri/s3v/s3v_common.h | 83 --- src/mesa/drivers/dri/s3v/s3v_context.c | 260 ------- src/mesa/drivers/dri/s3v/s3v_context.h | 443 ------------ src/mesa/drivers/dri/s3v/s3v_dd.c | 90 --- src/mesa/drivers/dri/s3v/s3v_dri.h | 143 ---- src/mesa/drivers/dri/s3v/s3v_inithw.c | 79 --- src/mesa/drivers/dri/s3v/s3v_lock.c | 62 -- src/mesa/drivers/dri/s3v/s3v_lock.h | 99 --- src/mesa/drivers/dri/s3v/s3v_macros.h | 230 ------- src/mesa/drivers/dri/s3v/s3v_regs.h | 367 ---------- src/mesa/drivers/dri/s3v/s3v_render.c | 203 ------ src/mesa/drivers/dri/s3v/s3v_screen.c | 99 --- src/mesa/drivers/dri/s3v/s3v_screen.h | 39 -- src/mesa/drivers/dri/s3v/s3v_span.c | 219 ------ src/mesa/drivers/dri/s3v/s3v_state.c | 888 ------------------------ src/mesa/drivers/dri/s3v/s3v_tex.c | 548 --------------- src/mesa/drivers/dri/s3v/s3v_tex.h | 28 - src/mesa/drivers/dri/s3v/s3v_texmem.c | 582 ---------------- src/mesa/drivers/dri/s3v/s3v_texstate.c | 300 -------- src/mesa/drivers/dri/s3v/s3v_tris.c | 850 ----------------------- src/mesa/drivers/dri/s3v/s3v_tris.h | 11 - src/mesa/drivers/dri/s3v/s3v_tritmp.h | 958 -------------------------- src/mesa/drivers/dri/s3v/s3v_vb.c | 339 --------- src/mesa/drivers/dri/s3v/s3v_vb.h | 39 -- src/mesa/drivers/dri/s3v/s3v_xmesa.c | 341 --------- src/mesa/drivers/dri/s3v/s3virgetri.h | 383 ---------- 28 files changed, 1 insertion(+), 7719 deletions(-) delete mode 100644 src/mesa/drivers/dri/s3v/Makefile delete mode 100644 src/mesa/drivers/dri/s3v/s3v_common.h delete mode 100644 src/mesa/drivers/dri/s3v/s3v_context.c delete mode 100644 src/mesa/drivers/dri/s3v/s3v_context.h delete mode 100644 src/mesa/drivers/dri/s3v/s3v_dd.c delete mode 100644 src/mesa/drivers/dri/s3v/s3v_dri.h delete mode 100644 src/mesa/drivers/dri/s3v/s3v_inithw.c delete mode 100644 src/mesa/drivers/dri/s3v/s3v_lock.c delete mode 100644 src/mesa/drivers/dri/s3v/s3v_lock.h delete mode 100644 src/mesa/drivers/dri/s3v/s3v_macros.h delete mode 100644 src/mesa/drivers/dri/s3v/s3v_regs.h delete mode 100644 src/mesa/drivers/dri/s3v/s3v_render.c delete mode 100644 src/mesa/drivers/dri/s3v/s3v_screen.c delete mode 100644 src/mesa/drivers/dri/s3v/s3v_screen.h delete mode 100644 src/mesa/drivers/dri/s3v/s3v_span.c delete mode 100644 src/mesa/drivers/dri/s3v/s3v_state.c delete mode 100644 src/mesa/drivers/dri/s3v/s3v_tex.c delete mode 100644 src/mesa/drivers/dri/s3v/s3v_tex.h delete mode 100644 src/mesa/drivers/dri/s3v/s3v_texmem.c delete mode 100644 src/mesa/drivers/dri/s3v/s3v_texstate.c delete mode 100644 src/mesa/drivers/dri/s3v/s3v_tris.c delete mode 100644 src/mesa/drivers/dri/s3v/s3v_tris.h delete mode 100644 src/mesa/drivers/dri/s3v/s3v_tritmp.h delete mode 100644 src/mesa/drivers/dri/s3v/s3v_vb.c delete mode 100644 src/mesa/drivers/dri/s3v/s3v_vb.h delete mode 100644 src/mesa/drivers/dri/s3v/s3v_xmesa.c delete mode 100644 src/mesa/drivers/dri/s3v/s3virgetri.h (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/common/drirenderbuffer.h b/src/mesa/drivers/dri/common/drirenderbuffer.h index cf55286b30..5ae28cb53a 100644 --- a/src/mesa/drivers/dri/common/drirenderbuffer.h +++ b/src/mesa/drivers/dri/common/drirenderbuffer.h @@ -56,7 +56,7 @@ typedef struct { * A handy flag to know if this is the back color buffer. * * \note - * This is currently only used by s3v and tdfx. + * This is currently only used by tdfx. */ GLboolean backBuffer; } driRenderbuffer; diff --git a/src/mesa/drivers/dri/s3v/Makefile b/src/mesa/drivers/dri/s3v/Makefile deleted file mode 100644 index da7e6cdc20..0000000000 --- a/src/mesa/drivers/dri/s3v/Makefile +++ /dev/null @@ -1,35 +0,0 @@ -# src/mesa/drivers/dri/s3v/Makefile - -TOP = ../../../../.. -include $(TOP)/configs/current - -LIBNAME = s3v_dri.so - -# Doesn't exist yet. -#MINIGLX_SOURCES = server/savage_dri.c - -DRIVER_SOURCES = \ - s3v_context.c \ - s3v_dd.c \ - s3v_inithw.c \ - s3v_lock.c \ - s3v_render.c \ - s3v_screen.c \ - s3v_span.c \ - s3v_state.c \ - s3v_tex.c \ - s3v_texmem.c \ - s3v_texstate.c \ - s3v_tris.c \ - s3v_vb.c \ - s3v_xmesa.c - -C_SOURCES = \ - $(COMMON_SOURCES) \ - $(DRIVER_SOURCES) - -ASM_SOURCES = - - -include ../Makefile.template - diff --git a/src/mesa/drivers/dri/s3v/s3v_common.h b/src/mesa/drivers/dri/s3v/s3v_common.h deleted file mode 100644 index b66cdf1df0..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_common.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Author: Max Lingua - */ - -/* WARNING: If you change any of these defines, make sure to change - * the kernel include file as well (s3v_drm.h) - */ - -#ifndef _XF86DRI_S3V_H_ -#define _XF86DRI_S3V_H_ - -#ifndef _S3V_DEFINES_ -#define _S3V_DEFINES_ -#define S3V_USE_BATCH 1 - -/* #define S3V_BUF_4K 1 */ - -#ifdef S3V_BUF_4K -#define S3V_DMA_BUF_ORDER 12 -#define S3V_DMA_BUF_NR 256 -#else -#define S3V_DMA_BUF_ORDER 16 /* -much- better */ -#define S3V_DMA_BUF_NR 16 -#endif -/* on s3virge you can only choose between * - * 4k (2^12) and 64k (2^16) dma bufs */ -#define S3V_DMA_BUF_SZ (1< - */ - -#include "s3v_context.h" - -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "vbo/vbo.h" - -#include "tnl/tnl.h" -#include "tnl/t_pipeline.h" - -#include "main/context.h" -#include "main/simple_list.h" -#include "main/matrix.h" -#include "main/extensions.h" -#if defined(USE_X86_ASM) -#include "x86/common_x86_asm.h" -#endif -#include "main/simple_list.h" -#include "main/mm.h" - -#include "drivers/common/driverfuncs.h" -#include "s3v_vb.h" -#include "s3v_tris.h" - -#if 0 -extern const struct tnl_pipeline_stage _s3v_render_stage; - -static const struct tnl_pipeline_stage *s3v_pipeline[] = { - &_tnl_vertex_transform_stage, - &_tnl_normal_transform_stage, - &_tnl_lighting_stage, - &_tnl_fog_coordinate_stage, - &_tnl_texgen_stage, - &_tnl_texture_transform_stage, - /* REMOVE: point attenuation stage */ -#if 1 - &_s3v_render_stage, /* ADD: unclipped rastersetup-to-dma */ -#endif - &_tnl_render_stage, - 0, -}; -#endif - -GLboolean s3vCreateContext(const __GLcontextModes *glVisual, - __DRIcontextPrivate *driContextPriv, - void *sharedContextPrivate) -{ - GLcontext *ctx, *shareCtx; - __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv; - s3vContextPtr vmesa; - s3vScreenPtr s3vScrn; - S3VSAREAPtr saPriv=(S3VSAREAPtr)(((char*)sPriv->pSAREA) + - sizeof(drm_sarea_t)); - struct dd_function_table functions; - - DEBUG_WHERE(("*** s3vCreateContext ***\n")); - - vmesa = (s3vContextPtr) CALLOC( sizeof(*vmesa) ); - if ( !vmesa ) return GL_FALSE; - - /* Allocate the Mesa context */ - if (sharedContextPrivate) - shareCtx = ((s3vContextPtr) sharedContextPrivate)->glCtx; - else - shareCtx = NULL; - - _mesa_init_driver_functions(&functions); - - vmesa->glCtx = _mesa_create_context(glVisual, shareCtx, &functions, - (void *)vmesa); - if (!vmesa->glCtx) { - FREE(vmesa); - return GL_FALSE; - } - - vmesa->driContext = driContextPriv; - vmesa->driScreen = sPriv; - vmesa->driDrawable = NULL; /* Set by XMesaMakeCurrent */ - - vmesa->hHWContext = driContextPriv->hHWContext; - vmesa->driHwLock = (drmLock *)&sPriv->pSAREA->lock; - vmesa->driFd = sPriv->fd; - vmesa->sarea = saPriv; - - s3vScrn = vmesa->s3vScreen = (s3vScreenPtr)(sPriv->private); - - ctx = vmesa->glCtx; - - ctx->Const.MaxTextureLevels = 11; /* it is (11-1) -> 1024 * 1024 FIXME */ - - ctx->Const.MaxTextureUnits = 1; /* FIXME: or 2 ? */ - - /* No wide points. - */ - ctx->Const.MinPointSize = 1.0; - ctx->Const.MinPointSizeAA = 1.0; - ctx->Const.MaxPointSize = 1.0; - ctx->Const.MaxPointSizeAA = 1.0; - - /* No wide lines. - */ - ctx->Const.MinLineWidth = 1.0; - ctx->Const.MinLineWidthAA = 1.0; - ctx->Const.MaxLineWidth = 1.0; - ctx->Const.MaxLineWidthAA = 1.0; - ctx->Const.LineWidthGranularity = 1.0; - - ctx->Const.MaxDrawBuffers = 1; - - vmesa->texHeap = mmInit( 0, vmesa->s3vScreen->textureSize ); - DEBUG(("vmesa->s3vScreen->textureSize = 0x%x\n", - vmesa->s3vScreen->textureSize)); - - /* NOTE */ - /* mmInit(offset, size); */ - - /* allocates a structure like this: - - struct mem_block_t { - struct mem_block_t *next; - struct mem_block_t *heap; - int ofs,size; - int align; - int free:1; - int reserved:1; - }; - - */ - - make_empty_list(&vmesa->TexObjList); - make_empty_list(&vmesa->SwappedOut); - - vmesa->CurrentTexObj[0] = 0; - vmesa->CurrentTexObj[1] = 0; /* FIXME */ - - vmesa->RenderIndex = ~0; - - /* Initialize the software rasterizer and helper modules. - */ - _swrast_CreateContext( ctx ); - _vbo_CreateContext( ctx ); - _tnl_CreateContext( ctx ); - _swsetup_CreateContext( ctx ); - - /* Install the customized pipeline: - */ -#if 0 - _tnl_destroy_pipeline( ctx ); - _tnl_install_pipeline( ctx, s3v_pipeline ); -#endif - /* Configure swrast to match hardware characteristics: - */ -#if 0 - _swrast_allow_pixel_fog( ctx, GL_FALSE ); - _swrast_allow_vertex_fog( ctx, GL_TRUE ); -#endif - vmesa->_3d_mode = 0; - - /* 3D lines / gouraud tris */ - vmesa->CMD = ( AUTO_EXEC_ON | HW_CLIP_ON | DEST_COL_1555 - | FOG_OFF | ALPHA_OFF | Z_OFF | Z_UPDATE_OFF - | Z_LESS | TEX_WRAP_ON | TEX_MODULATE | LINEAR - | TEX_COL_ARGB1555 | CMD_3D ); - - vmesa->_alpha[0] = vmesa->_alpha[1] = ALPHA_OFF; - vmesa->alpha_cmd = vmesa->_alpha[0]; - vmesa->_tri[0] = DO_GOURAUD_TRI; - vmesa->_tri[1] = DO_TEX_LIT_TRI; - vmesa->prim_cmd = vmesa->_tri[0]; - - /* printf("first vmesa->CMD = 0x%x\n", vmesa->CMD); */ - - vmesa->TexOffset = vmesa->s3vScreen->texOffset; - - s3vInitVB( ctx ); - s3vInitExtensions( ctx ); - s3vInitDriverFuncs( ctx ); - s3vInitStateFuncs( ctx ); - s3vInitSpanFuncs( ctx ); - s3vInitTextureFuncs( ctx ); - s3vInitTriFuncs( ctx ); - s3vInitState( vmesa ); - - driContextPriv->driverPrivate = (void *)vmesa; - - /* HACK */ - vmesa->bufSize = S3V_DMA_BUF_SZ; - - DEBUG(("vmesa->bufSize = %i\n", vmesa->bufSize)); - DEBUG(("vmesa->bufCount = %i\n", vmesa->bufCount)); - - - /* dma init */ - DEBUG_BUFS(("GET_FIRST_DMA\n")); - - vmesa->_bufNum = 0; - - GET_FIRST_DMA(vmesa->driFd, vmesa->hHWContext, - 1, &(vmesa->bufIndex[0]), &(vmesa->bufSize), - &vmesa->_buf[0], &vmesa->bufCount, s3vScrn); - - GET_FIRST_DMA(vmesa->driFd, vmesa->hHWContext, - 1, &(vmesa->bufIndex[1]), &(vmesa->bufSize), - &vmesa->_buf[1], &vmesa->bufCount, s3vScrn); - - vmesa->buf = vmesa->_buf[vmesa->_bufNum]; - -/* - vmesa->CMD = (AUTO_EXEC_ON | HW_CLIP_ON | DEST_COL_1555 - | FOG_OFF | ALPHA_OFF | Z_OFF | Z_UPDATE_OFF - | DO_GOURAUD_TRI | CMD_3D); - - vmesa->TexOffset = vmesa->s3vScreen->texOffset; -*/ - -/* ... but we should support only 15 bit in virge (out of 8/15/24)... */ - - DEBUG(("glVisual->depthBits = %i\n", glVisual->depthBits)); - - switch (glVisual->depthBits) { - case 8: - break; - - case 15: - case 16: - vmesa->depth_scale = 1.0f / 0xffff; - break; - case 24: - vmesa->depth_scale = 1.0f / 0xffffff; - break; - default: - break; - } - - vmesa->cull_zero = 0.0f; - - vmesa->DepthSize = glVisual->depthBits; - vmesa->Flags = S3V_FRONT_BUFFER; - vmesa->Flags |= (glVisual->doubleBufferMode ? S3V_BACK_BUFFER : 0); - vmesa->Flags |= (vmesa->DepthSize > 0 ? S3V_DEPTH_BUFFER : 0); - - vmesa->EnabledFlags = S3V_FRONT_BUFFER; - vmesa->EnabledFlags |= (glVisual->doubleBufferMode ? S3V_BACK_BUFFER : 0); - - - if (vmesa->Flags & S3V_BACK_BUFFER) { - vmesa->readOffset = vmesa->drawOffset = vmesa->s3vScreen->backOffset; - } else { - vmesa->readOffset = vmesa->drawOffset = 0; - } - - s3vInitHW( vmesa ); - - driContextPriv->driverPrivate = (void *)vmesa; - - return GL_TRUE; -} diff --git a/src/mesa/drivers/dri/s3v/s3v_context.h b/src/mesa/drivers/dri/s3v/s3v_context.h deleted file mode 100644 index 671ba90d78..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_context.h +++ /dev/null @@ -1,443 +0,0 @@ -/* - * Author: Max Lingua - */ - -#ifndef _S3V_CONTEXT_H_ -#define _S3V_CONTEXT_H_ - -#include "dri_util.h" - -#include "s3v_dri.h" -#include "s3v_regs.h" -#include "s3v_macros.h" -#include "s3v_screen.h" -#include "main/colormac.h" -#include "main/macros.h" -#include "main/mtypes.h" -#include "drm.h" -#include "main/mm.h" -#include "drirenderbuffer.h" - -/* Flags for context */ -#define S3V_FRONT_BUFFER 0x00000001 -#define S3V_BACK_BUFFER 0x00000002 -#define S3V_DEPTH_BUFFER 0x00000004 - - /* FIXME: check */ -#define S3V_MAX_TEXTURE_SIZE 2048 - -/* These are the minimum requirements and should probably be increased */ -#define MAX_MODELVIEW_STACK 16 -#define MAX_PROJECTION_STACK 2 -#define MAX_TEXTURE_STACK 2 - -extern void s3vDDUpdateHWState(GLcontext *ctx); -extern s3vScreenPtr s3vCreateScreen(__DRIscreenPrivate *sPriv); -extern void s3vDestroyScreen(__DRIscreenPrivate *sPriv); -extern GLboolean s3vCreateContext(const __GLcontextModes *glVisual, - __DRIcontextPrivate *driContextPriv, - void *sharedContextPrivate); - -#define S3V_UPLOAD_ALL 0xffffffff -/* #define S3V_UPLOAD_CLIPRECTS 0x00000002 */ -#define S3V_UPLOAD_ALPHA 0x00000004 -#define S3V_UPLOAD_BLEND 0x00000008 -#define S3V_UPLOAD_DEPTH 0x00000010 -#define S3V_UPLOAD_VIEWPORT 0x00000020 -#define S3V_UPLOAD_SHADE 0x00000040 -#define S3V_UPLOAD_CLIP 0x00000080 -#define S3V_UPLOAD_MASKS 0x00000100 -#define S3V_UPLOAD_WINDOW 0x00000200 /* defunct */ -#define S3V_UPLOAD_GEOMETRY 0x00000400 -#define S3V_UPLOAD_POLYGON 0x00000800 -#define S3V_UPLOAD_DITHER 0x00001000 -#define S3V_UPLOAD_LOGICOP 0x00002000 -#define S3V_UPLOAD_FOG 0x00004000 -#define S3V_UPLOAD_LIGHT 0x00008000 -#define S3V_UPLOAD_CONTEXT 0x00010000 -#define S3V_UPLOAD_TEX0 0x00020000 -#define S3V_UPLOAD_STIPPLE 0x00040000 -#define S3V_UPLOAD_TRANSFORM 0x00080000 -#define S3V_UPLOAD_LINEMODE 0x00100000 -#define S3V_UPLOAD_POINTMODE 0x00200000 -#define S3V_UPLOAD_TRIMODE 0x00400000 - -#define S3V_NEW_CLIP 0x00000001 -#define S3V_NEW_WINDOW 0x00000002 -#define S3V_NEW_CONTEXT 0x00000004 -#define S3V_NEW_TEXTURE 0x00000008 /* defunct */ -#define S3V_NEW_ALPHA 0x00000010 -#define S3V_NEW_DEPTH 0x00000020 -#define S3V_NEW_MASKS 0x00000040 -#define S3V_NEW_POLYGON 0x00000080 -#define S3V_NEW_CULL 0x00000100 -#define S3V_NEW_LOGICOP 0x00000200 -#define S3V_NEW_FOG 0x00000400 -#define S3V_NEW_LIGHT 0x00000800 -#define S3V_NEW_STIPPLE 0x00001000 -#define S3V_NEW_ALL 0xffffffff - -#define S3V_FALLBACK_TRI 0x00000001 -#define S3V_FALLBACK_TEXTURE 0x00000002 - -struct s3v_context; -typedef struct s3v_context s3vContextRec; -typedef struct s3v_context *s3vContextPtr; -typedef struct s3v_texture_object_t *s3vTextureObjectPtr; - -#define VALID_S3V_TEXTURE_OBJECT(tobj) (tobj) - -#define S3V_TEX_MAXLEVELS 12 - -/* For shared texture space managment, these texture objects may also - * be used as proxies for regions of texture memory containing other - * client's textures. Such proxy textures (not to be confused with GL - * proxy textures) are subject to the same LRU aging we use for our - * own private textures, and thus we have a mechanism where we can - * fairly decide between kicking out our own textures and those of - * other clients. - * - * Non-local texture objects have a valid MemBlock to describe the - * region managed by the other client, and can be identified by - * 't->globj == 0' - */ -struct s3v_texture_object_t { - struct s3v_texture_object_t *next, *prev; - - GLuint age; - struct gl_texture_object *globj; - - int Pitch; - int Height; - int WidthLog2; - int texelBytes; - int totalSize; - int bound; - - struct mem_block *MemBlock; - GLuint BufAddr; - - GLuint min_level; - GLuint max_level; - GLuint dirty_images; - - GLint firstLevel, lastLevel; /* upload tObj->Image[first .. lastLevel] */ - - struct { - const struct gl_texture_image *image; - int offset; /* into BufAddr */ - int height; - int internalFormat; - } image[S3V_TEX_MAXLEVELS]; - - GLuint TextureCMD; - - GLuint TextureColorMode; - GLuint TextureFilterMode; - GLuint TextureBorderColor; - GLuint TextureWrap; - GLuint TextureMipSize; - - GLuint TextureBaseAddr[S3V_TEX_MAXLEVELS]; - GLuint TextureFormat; - GLuint TextureReadMode; -}; - -#define S3V_NO_PALETTE 0x0 -#define S3V_USE_PALETTE 0x1 -#define S3V_UPDATE_PALETTE 0x2 -#define S3V_FALLBACK_PALETTE 0x4 - -void s3vUpdateTextureState( GLcontext *ctx ); - -void s3vDestroyTexObj( s3vContextPtr vmesa, s3vTextureObjectPtr t); -void s3vUploadTexImages( s3vContextPtr vmesa, s3vTextureObjectPtr t ); - -void s3vResetGlobalLRU( s3vContextPtr vmesa ); -void s3vTexturesGone( s3vContextPtr vmesa, - GLuint start, GLuint end, - GLuint in_use ); - -void s3vEmitHwState( s3vContextPtr vmesa ); -void s3vGetLock( s3vContextPtr vmesa, GLuint flags ); -void s3vInitExtensions( GLcontext *ctx ); -void s3vInitDriverFuncs( GLcontext *ctx ); -void s3vSetSpanFunctions(driRenderbuffer *rb, const GLvisual *vis); -void s3vInitState( s3vContextPtr vmesa ); -void s3vInitHW( s3vContextPtr vmesa ); -void s3vInitStateFuncs( GLcontext *ctx ); -void s3vInitTextureFuncs( GLcontext *ctx ); -void s3vInitTriFuncs( GLcontext *ctx ); - -void s3vUpdateWindow( GLcontext *ctx ); -void s3vUpdateViewportOffset( GLcontext *ctx ); - -void s3vPrintLocalLRU( s3vContextPtr vmesa ); -void s3vPrintGlobalLRU( s3vContextPtr vmesa ); - -extern void s3vFallback( s3vContextPtr vmesa, GLuint bit, GLboolean mode ); -#define FALLBACK( imesa, bit, mode ) s3vFallback( imesa, bit, mode ) - -/* Use the templated vertex formats. Only one of these is used in s3v. - */ -#define TAG(x) s3v##x -#include "tnl_dd/t_dd_vertex.h" -#undef TAG - -typedef void (*s3v_quad_func)( s3vContextPtr, - const s3vVertex *, - const s3vVertex *, - const s3vVertex *, - const s3vVertex * ); -typedef void (*s3v_tri_func)( s3vContextPtr, - const s3vVertex *, - const s3vVertex *, - const s3vVertex * ); -typedef void (*s3v_line_func)( s3vContextPtr, - const s3vVertex *, - const s3vVertex * ); -typedef void (*s3v_point_func)( s3vContextPtr, - const s3vVertex * ); - - -/* static void s3v_lines_emit(GLcontext *ctx, GLuint start, GLuint end); */ -typedef void (*emit_func)( GLcontext *, GLuint, GLuint); - -struct s3v_context { - GLcontext *glCtx; /* Mesa context */ - - __DRIcontextPrivate *driContext; - __DRIscreenPrivate *driScreen; - __DRIdrawablePrivate *driDrawable; - - GLuint new_gl_state; - GLuint new_state; - GLuint dirty; - - S3VSAREAPtr sarea; - - /* Temporaries for translating away float colors - */ - struct gl_client_array UbyteColor; - struct gl_client_array UbyteSecondaryColor; - - /* Mirrors of some DRI state - */ - - drm_context_t hHWContext; - drmLock *driHwLock; - int driFd; - - GLuint numClipRects; /* Cliprects for the draw buffer */ - drm_clip_rect_t *pClipRects; - - GLuint* buf; /* FIXME */ - GLuint* _buf[2]; - int _bufNum; - int bufIndex[2]; - int bufSize; - int bufCount; - - s3vScreenPtr s3vScreen; /* Screen private DRI data */ - - int drawOffset; - int readOffset; - - s3v_point_func draw_point; - s3v_line_func draw_line; - s3v_tri_func draw_tri; - s3v_quad_func draw_quad; - - GLuint Fallback; - GLuint RenderIndex; - GLuint SetupNewInputs; - GLuint SetupIndex; - - GLuint vertex_format; - GLuint vertex_size; - GLuint vertex_stride_shift; - char *verts; - - GLfloat hw_viewport[16]; - GLuint hw_primitive; - GLenum render_primitive; - - GLfloat depth_scale; - - s3vTextureObjectPtr CurrentTexObj[2]; - struct s3v_texture_object_t TexObjList; - struct s3v_texture_object_t SwappedOut; - GLenum TexEnvImageFmt[2]; - - struct mem_block *texHeap; - - int lastSwap; - int texAge; - int ctxAge; - int dirtyAge; - int lastStamp; - - /* max was here: don't touch */ - - unsigned int S3V_REG[S3V_REGS_NUM]; - - GLuint texMode; - GLuint alphaMode; - GLuint lightMode; - - GLuint SrcBase; - GLuint DestBase; - GLuint DestBlit; - GLuint ScissorLR; - GLuint ScissorTB; - GLuint ScissorWH; /* SubScissorWH */ /* RectWH */ - GLuint FrontStride; - GLuint BackStride; - GLuint SrcStride; - GLuint DestStride; - GLuint SrcXY; - GLuint DestXY; - - GLuint ClearColor; - GLuint Color; - GLuint DitherMode; - GLuint ClearDepth; - - GLuint TextureBorderColor; - GLuint TexOffset; - GLuint TexStride; - - GLuint CMD; - GLuint prim_cmd; - GLuint _tri[2]; /* 0 = gouraud; 1 = tex (lit or unlit) */ - GLuint alpha_cmd; /* actual alpha cmd */ - GLuint _alpha[2]; - GLuint _alpha_tex; /* tex alpha type */ - /* (3d_mode) 0 = 3d line/gourad tri; 1 = 3d tex tri */ - GLuint _3d_mode; - - GLfloat backface_sign; - GLfloat cull_zero; - - int restore_primitive; - -/* *** 2check *** */ - - GLuint FogMode; - GLuint AreaStippleMode; - GLuint LBReadFormat; - GLuint LBWriteFormat; - GLuint LineMode; - GLuint PointMode; - GLuint TriangleMode; - GLuint AntialiasMode; - GLfloat ViewportScaleX; - GLfloat ViewportScaleY; - GLfloat ViewportScaleZ; - GLfloat ViewportOffsetX; - GLfloat ViewportOffsetY; - GLfloat ViewportOffsetZ; - int MatrixMode; - int DepthMode; - int TransformMode; - int LBReadMode; - int FBReadMode; - int FBWindowBase; - int LBWindowBase; - int ColorDDAMode; - int GeometryMode; - int AlphaTestMode; - int AlphaBlendMode; - int AB_FBReadMode; - int AB_FBReadMode_Save; - int DeltaMode; - int ColorMaterialMode; - int FBHardwareWriteMask; - int MaterialMode; - int NormalizeMode; - int LightingMode; - int Light0Mode; - int Light1Mode; - int Light2Mode; - int Light3Mode; - int Light4Mode; - int Light5Mode; - int Light6Mode; - int Light7Mode; - int Light8Mode; - int Light9Mode; - int Light10Mode; - int Light11Mode; - int Light12Mode; - int Light13Mode; - int Light14Mode; - int Light15Mode; - int LogicalOpMode; - int ScissorMode; - int ScissorMaxXY; - int ScissorMinXY; - int Window; /* GID part probably should be in draw priv */ - int WindowOrigin; - int x, y, w, h; /* Probably should be in drawable priv */ - int FrameCount; /* Probably should be in drawable priv */ - int NotClipped; /* Probably should be in drawable priv */ - int WindowChanged; /* Probably should be in drawabl... */ - int Flags; - int EnabledFlags; - int DepthSize; - int Begin; - GLenum ErrorValue; - int Texture1DEnabled; - int Texture2DEnabled; - - float ModelView[16]; - float Proj[16]; - float ModelViewProj[16]; - float Texture[16]; - - float ModelViewStack[(MAX_MODELVIEW_STACK-1)*16]; - int ModelViewCount; - float ProjStack[(MAX_PROJECTION_STACK-1)*16]; - int ProjCount; - float TextureStack[(MAX_TEXTURE_STACK-1)*16]; - int TextureCount; -}; - -#define S3VIRGEPACKCOLOR555( r, g, b, a ) \ - ((((r) & 0xf8) << 7) | (((g) & 0xf8) << 2) | (((b) & 0xf8) >> 3) | \ - ((a) ? 0x8000 : 0)) - -#define S3VIRGEPACKCOLOR565( r, g, b ) \ - ((((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | (((b) & 0xf8) >> 3)) - -#define S3VIRGEPACKCOLOR888( r, g, b ) \ - (((r) << 16) | ((g) << 8) | (b)) - -#define S3VIRGEPACKCOLOR8888( r, g, b, a ) \ - (((a) << 24) | ((r) << 16) | ((g) << 8) | (b)) - -#define S3VIRGEPACKCOLOR4444( r, g, b, a ) \ - ((((a) & 0xf0) << 8) | (((r) & 0xf0) << 4) | ((g) & 0xf0) | ((b) >> 4)) - -static INLINE GLuint s3vPackColor( GLuint cpp, - GLubyte r, GLubyte g, - GLubyte b, GLubyte a ) -{ - unsigned int ret; - DEBUG(("cpp = %i, r=0x%x, g=0x%x, b=0x%x, a=0x%x\n", cpp, r, g, b, a)); - - switch ( cpp ) { - case 2: - ret = S3VIRGEPACKCOLOR555( r, g, b, a ); - DEBUG(("ret = 0x%x\n", ret)); - return ret; - case 4: - return PACK_COLOR_8888( a, r, g, b ); - default: - return 0; - } -} - -#define S3V_CONTEXT(ctx) ((s3vContextPtr)(ctx->DriverCtx)) - -#endif /* _S3V_CONTEXT_H_ */ diff --git a/src/mesa/drivers/dri/s3v/s3v_dd.c b/src/mesa/drivers/dri/s3v/s3v_dd.c deleted file mode 100644 index e340116f5e..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_dd.c +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Author: Max Lingua - */ - -#include "s3v_context.h" -#include "s3v_vb.h" -#include "s3v_lock.h" -#if defined(USE_X86_ASM) -#include "x86/common_x86_asm.h" -#endif - -#include "main/context.h" -#include "main/framebuffer.h" -#include "swrast/swrast.h" - -#define S3V_DATE "20020207" - - -/* Return the width and height of the current color buffer. - */ -static void s3vDDGetBufferSize( GLframebuffer *buffer, - GLuint *width, GLuint *height ) -{ - GET_CURRENT_CONTEXT(ctx); - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - -/* S3VHW_LOCK( vmesa ); */ - *width = vmesa->driDrawable->w; - *height = vmesa->driDrawable->h; -/* S3VHW_UNLOCK( vmesa ); */ -} - - -/* Return various strings for glGetString(). - */ -static const GLubyte *s3vDDGetString( GLcontext *ctx, GLenum name ) -{ - static char buffer[128]; - - switch ( name ) { - case GL_VENDOR: - return (GLubyte *)"Max Lingua (ladybug)"; - - case GL_RENDERER: - sprintf( buffer, "Mesa DRI S3 Virge " S3V_DATE ); - - /* Append any CPU-specific information. - */ -#ifdef USE_X86_ASM - if ( _mesa_x86_cpu_features ) { - strncat( buffer, " x86", 4 ); - -} -#ifdef USE_MMX_ASM - if ( cpu_has_mmx ) { - strncat( buffer, "/MMX", 4 ); - } -#endif -#ifdef USE_3DNOW_ASM - if ( cpu_has_3dnow ) { - strncat( buffer, "/3DNow!", 7 ); - } -#endif -#ifdef USE_SSE_ASM - if ( cpu_has_xmm ) { - strncat( buffer, "/SSE", 4 ); - } -#endif -#endif - return (GLubyte *)buffer; - - default: - return NULL; - } -} - -/* Enable the extensions supported by this driver. - */ -void s3vInitExtensions( GLcontext *ctx ) -{ - /* None... */ -} - -/* Initialize the driver's misc functions. - */ -void s3vInitDriverFuncs( GLcontext *ctx ) -{ - ctx->Driver.GetBufferSize = s3vDDGetBufferSize; - ctx->Driver.GetString = s3vDDGetString; -} diff --git a/src/mesa/drivers/dri/s3v/s3v_dri.h b/src/mesa/drivers/dri/s3v/s3v_dri.h deleted file mode 100644 index 339c579f7f..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_dri.h +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Author: Max Lingua - */ - -#ifndef _S3V_DRI -#define _S3V_DRI - -#include "s3v_common.h" - -#define S3V_MAX_DRAWABLES (S3V_DMA_BUF_NR/2) /* 32 */ /* 256 */ /* FIXME */ - -typedef struct -{ - int deviceID; - int width; - int height; - int mem; - int cpp; - int bitsPerPixel; - - int fbOffset; - int fbStride; - - int logTextureGranularity; - int textureOffset; - - drm_handle_t regs; - drmSize regsSize; - - unsigned int sarea_priv_offset; -/* - drmAddress regsMap; - - drmSize textureSize; - drm_handle_t textures; -*/ - -#if 0 - drm_handle_t agp_buffers; - drmSize agp_buf_size; -#endif - -/* - drmBufMapPtr drmBufs; - int irq; - unsigned int sarea_priv_offset; -*/ - -/* FIXME: cleanup ! */ - - drmSize registerSize; /* == S3V_MMIO_REGSIZE */ - drm_handle_t registerHandle; - - drmSize pciSize; - drm_handle_t pciMemHandle; - - drmSize frontSize; /* == videoRambytes */ -/* drm_handle_t frontHandle; */ - unsigned long frontOffset; /* == fbOffset */ - int frontPitch; -/* unsigned char *front; */ - - unsigned int bufferSize; /* size of depth/back buffer */ - - drmSize backSize; -/* drm_handle_t backHandle; */ - unsigned long backOffset; - int backPitch; -/* unsigned char *back; */ - - drmSize depthSize; -/* drm_handle_t depthHandle; */ - unsigned long depthOffset; - int depthPitch; -/* unsigned char *depth; */ - - drmSize texSize; -/* drm_handle_t texHandle; */ - unsigned long texOffset; - int texPitch; -/* unsigned char *tex; */ - - drmSize dmaBufSize; /* Size of buffers (in bytes) */ - drm_handle_t dmaBufHandle; /* Handle from drmAddMap */ - unsigned long dmaBufOffset; /* Offset/Start */ - int dmaBufPitch; /* Pitch */ - unsigned char *dmaBuf; /* Map */ - int bufNumBufs; /* Number of buffers */ - drmBufMapPtr buffers; /* Buffer map */ - -} S3VDRIRec, *S3VDRIPtr; - -/* WARNING: Do not change the SAREA structure without changing the kernel - * as well */ - -typedef struct { - unsigned char next, prev; /* indices to form a circular LRU */ - unsigned char in_use; /* owned by a client, or free? */ - int age; /* tracked by clients to update local LRU's */ -} S3VTexRegionRec, *S3VTexRegionPtr; - -typedef struct { - unsigned int nbox; - drm_clip_rect_t boxes[S3V_NR_SAREA_CLIPRECTS]; - - /* Maintain an LRU of contiguous regions of texture space. If - * you think you own a region of texture memory, and it has an - * age different to the one you set, then you are mistaken and - * it has been stolen by another client. If global texAge - * hasn't changed, there is no need to walk the list. - * - * These regions can be used as a proxy for the fine-grained - * texture information of other clients - by maintaining them - * in the same lru which is used to age their own textures, - * clients have an approximate lru for the whole of global - * texture space, and can make informed decisions as to which - * areas to kick out. There is no need to choose whether to - * kick out your own texture or someone else's - simply eject - * them all in LRU order. - */ - S3VTexRegionRec texList[S3V_NR_TEX_REGIONS+1]; /* Last elt is sentinal */ - - int texAge; /* last time texture was uploaded */ - - int last_enqueue; /* last time a buffer was enqueued */ - int last_dispatch; /* age of the most recently dispatched buffer */ - int last_quiescent; /* */ - - int ctxOwner; /* last context to upload state */ -} S3VSAREARec, *S3VSAREAPtr; - -typedef struct { - /* Nothing here yet */ - int dummy; -} S3VConfigPrivRec, *S3VConfigPrivPtr; - -typedef struct { - /* Nothing here yet */ - int dummy; -} S3VDRIContextRec, *S3VDRIContextPtr; - - -#endif diff --git a/src/mesa/drivers/dri/s3v/s3v_inithw.c b/src/mesa/drivers/dri/s3v/s3v_inithw.c deleted file mode 100644 index bdc9effb79..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_inithw.c +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Author: Max Lingua - */ - -#include - -#include "s3v_context.h" - -void s3vInitHW( s3vContextPtr vmesa ) -{ - int i; - static short _reset = 1; - - DEBUG(("vmesa->driDrawable = %p\n", vmesa->driDrawable)); - DEBUG(("stride = %i\n", - vmesa->driScreen->fbWidth*vmesa->s3vScreen->cpp)); - DEBUG(("frontOffset = 0x%x\n", vmesa->s3vScreen->frontOffset)); - DEBUG(("backOffset = 0x%x\n", vmesa->s3vScreen->backOffset)); - DEBUG(("depthOffset = 0x%x\n", vmesa->s3vScreen->depthOffset)); - DEBUG(("textureOffset = 0x%x\n", vmesa->s3vScreen->texOffset)); - -/* if (_reset) { */ -/* ioctl(vmesa->driFd, 0x4a); */ - ioctl(vmesa->driFd, 0x41); /* reset */ - _reset = 0; -/* ioctl(vmesa->driFd, 0x4c); */ -/* } */ - - /* FIXME */ - switch (vmesa->s3vScreen->cpp) { - case 2: - break; - case 4: - break; - } - - /* FIXME for stencil, gid, etc */ - switch (vmesa->DepthSize) { - case 15: - case 16: - break; - case 24: - break; - case 32: - break; - } - - vmesa->FogMode = 1; - vmesa->ClearDepth = 0xffff; - vmesa->x = 0; - vmesa->y = 0; - vmesa->w = 0; - vmesa->h = 0; - vmesa->FrameCount = 0; - vmesa->MatrixMode = GL_MODELVIEW; - vmesa->ModelViewCount = 0; - vmesa->ProjCount = 0; - vmesa->TextureCount = 0; - - - /* FIXME: do we need the following? */ - - for (i = 0; i < 16; i++) - if (i % 5 == 0) - vmesa->ModelView[i] = - vmesa->Proj[i] = - vmesa->ModelViewProj[i] = - vmesa->Texture[i] = 1.0; - else - vmesa->ModelView[i] = - vmesa->Proj[i] = - vmesa->ModelViewProj[i] = - vmesa->Texture[i] = 0.0; - - vmesa->LBWindowBase = vmesa->driScreen->fbWidth * - (vmesa->driScreen->fbHeight - 1); - vmesa->FBWindowBase = vmesa->driScreen->fbWidth * - (vmesa->driScreen->fbHeight - 1); -} diff --git a/src/mesa/drivers/dri/s3v/s3v_lock.c b/src/mesa/drivers/dri/s3v/s3v_lock.c deleted file mode 100644 index 52bb87ecec..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_lock.c +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Author: Max Lingua - */ - -#include "s3v_context.h" - -#if DEBUG_LOCKING -char *prevLockFile = NULL; -int prevLockLine = 0; -#endif - - -/* Update the hardware state. This is called if another context has - * grabbed the hardware lock, which includes the X server. This - * function also updates the driver's window state after the X server - * moves, resizes or restacks a window -- the change will be reflected - * in the drawable position and clip rects. Since the X server grabs - * the hardware lock when it changes the window state, this routine will - * automatically be called after such a change. - */ -void s3vGetLock( s3vContextPtr vmesa, GLuint flags ) -{ - __DRIdrawablePrivate *dPriv = vmesa->driDrawable; -/* __DRIscreenPrivate *sPriv = vmesa->driScreen; */ - - printf("s3vGetLock <- ***\n"); - - drmGetLock( vmesa->driFd, vmesa->hHWContext, flags ); - - /* The window might have moved, so we might need to get new clip - * rects. - * - * NOTE: This releases and regrabs the hw lock to allow the X server - * to respond to the DRI protocol request for new drawable info. - * Since the hardware state depends on having the latest drawable - * clip rects, all state checking must be done _after_ this call. - */ - /* DRI_VALIDATE_DRAWABLE_INFO( vmesa->display, sPriv, dPriv ); */ - - if ( vmesa->lastStamp != dPriv->lastStamp ) { - vmesa->lastStamp = dPriv->lastStamp; - vmesa->new_state |= S3V_NEW_WINDOW | S3V_NEW_CLIP; - } - - vmesa->numClipRects = dPriv->numClipRects; - vmesa->pClipRects = dPriv->pClipRects; - -#if 0 - vmesa->dirty = ~0; - - if ( sarea->ctxOwner != vmesa->hHWContext ) { - sarea->ctxOwner = vmesa->hHWContext; - vmesa->dirty = S3V_UPLOAD_ALL; - } - - for ( i = 0 ; i < vmesa->lastTexHeap ; i++ ) { - if ( sarea->texAge[i] != vmesa->lastTexAge[i] ) { - s3vAgeTextures( vmesa, i ); - } - } -#endif -} diff --git a/src/mesa/drivers/dri/s3v/s3v_lock.h b/src/mesa/drivers/dri/s3v/s3v_lock.h deleted file mode 100644 index c39d24a38a..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_lock.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Author: Max Lingua - */ - -#ifndef __S3V_LOCK_H__ -#define __S3V_LOCK_H__ - -#include - -extern void s3vGetLock( s3vContextPtr vmesa, GLuint flags ); - -/* Turn DEBUG_LOCKING on to find locking conflicts. - */ -#define DEBUG_LOCKING 0 - -#if DEBUG_LOCKING -extern char *prevLockFile; -extern int prevLockLine; - -#define DEBUG_LOCK() \ - do { \ - prevLockFile = (__FILE__); \ - prevLockLine = (__LINE__); \ - } while (0) - -#define DEBUG_RESET() \ - do { \ - prevLockFile = 0; \ - prevLockLine = 0; \ - } while (0) - -#define DEBUG_CHECK_LOCK() \ - do { \ - if ( prevLockFile ) { \ - fprintf( stderr, \ - "LOCK SET!\n\tPrevious %s:%d\n\tCurrent: %s:%d\n", \ - prevLockFile, prevLockLine, __FILE__, __LINE__ ); \ - exit(1); \ - } \ - } while (0) - -#else - -#define DEBUG_LOCK() -#define DEBUG_RESET() -#define DEBUG_CHECK_LOCK() - -#endif - -/* - * !!! We may want to separate locks from locks with validation. This - * could be used to improve performance for those things commands that - * do not do any drawing !!! - */ - -/* Lock the hardware and validate our state. - */ -#define LOCK_HARDWARE( vmesa ) \ - do { \ - char __ret = 0; \ - DEBUG_CHECK_LOCK(); \ - DRM_CAS( vmesa->driHwLock, vmesa->hHWContext, \ - (DRM_LOCK_HELD | vmesa->hHWContext), __ret ); \ - if ( __ret ) \ - s3vGetLock( vmesa, 0 ); \ - DEBUG_LOCK(); \ - } while (0) - -/* Unlock the hardware. - */ -#define UNLOCK_HARDWARE( vmesa ) \ - do { \ - DRM_UNLOCK( vmesa->driFd, \ - vmesa->driHwLock, \ - vmesa->hHWContext ); \ - DEBUG_RESET(); \ - } while (0) - -#define S3VHW_LOCK( vmesa ) \ - DRM_UNLOCK(vmesa->driFd, vmesa->driHwLock, vmesa->hHWContext); \ - DRM_SPINLOCK(&vmesa->driScreen->pSAREA->drawable_lock, \ - vmesa->driScreen->drawLockID); \ - /* VALIDATE_DRAWABLE_INFO_NO_LOCK(vmesa); */ - -#define S3VHW_UNLOCK( vmesa ) \ - DRM_SPINUNLOCK(&vmesa->driScreen->pSAREA->drawable_lock, \ - vmesa->driScreen->drawLockID); \ - /* VALIDATE_DRAWABLE_INFO_NO_LOCK_POST(vmesa); */ - -#define S3V_SIMPLE_LOCK( vmesa ) \ - ioctl(vmesa->driFd, 0x4a) - -#define S3V_SIMPLE_FLUSH_LOCK( vmesa ) \ - ioctl(vmesa->driFd, 0x4b) - -#define S3V_SIMPLE_UNLOCK( vmesa ) \ - ioctl(vmesa->driFd, 0x4c) - -#endif /* __S3V_LOCK_H__ */ diff --git a/src/mesa/drivers/dri/s3v/s3v_macros.h b/src/mesa/drivers/dri/s3v/s3v_macros.h deleted file mode 100644 index 7e9b4529df..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_macros.h +++ /dev/null @@ -1,230 +0,0 @@ -/* - * Author: Max Lingua - */ - -#ifndef _S3V_MACROS_H_ -#define _S3V_MACROS_H_ - -/**************/ -/* DRI macros */ -/**************/ - -#define GENERIC_DEBUG 0 -#define FLOW_DEBUG 0 -#define DMABUFS_DEBUG 0 - -/* Note: The argument to DEBUG*() _must_ be enclosed in parenthesis */ - -#if (GENERIC_DEBUG || FLOW_DEBUG || DMABUFS_DEBUG) -#include -#endif - -#undef DEBUG -#if GENERIC_DEBUG -#define DEBUG(str) printf str -#else -#define DEBUG(str) -#endif - -#if FLOW_DEBUG -#define DEBUG_WHERE(str) printf str -#else -#define DEBUG_WHERE(str) -#endif - -#if DMABUFS_DEBUG -#define DEBUG_BUFS(str) printf str -#else -#define DEBUG_BUFS(str) -#endif - - -#if 0 -#define S3V_DMA_SEND_FLAGS DRM_DMA_PRIORITY -#define S3V_DMA_SEND_FLAGS DRM_DMA_BLOCK -#else -#define S3V_DMA_SEND_FLAGS 0 -#endif - -#if 0 -#define S3V_DMA_GET_FLAGS \ - (DRM_DMA_SMALLER_OK | DRM_DMA_LARGER_OK | DRM_DMA_WAIT) -#else -#define S3V_DMA_GET_FLAGS DRM_DMA_WAIT -#endif - - -#define DMAOUT_CHECK(reg,len) \ -do { \ - DEBUG(("DMAOUT_CHECK: reg = 0x%x\n", S3V_##reg##_REG)); \ - DEBUG_BUFS(("DMAOUT_CHECK (was): ")); \ - DEBUG_BUFS(("vmesa->bufCount=%i of vmesa->bufSize=%i\n", \ - vmesa->bufCount, vmesa->bufSize)); \ - /* FIXME: > or >= */ \ - if (vmesa->bufCount+(len+1) >= vmesa->bufSize) \ - DMAFLUSH(); \ -\ - vmesa->bufCount += (len+1); \ - DEBUG_BUFS(("DMAOUT_CHECK (is): vmesa->bufCount=%i len=%i, reg=%x\n", \ - vmesa->bufCount, len, S3V_##reg##_REG)); \ - DMAOUT( ((len & 0xffff) | ((S3V_##reg##_REG & 0xfffc) << 14)) ); \ -} while (0) - -#define DMAOUT(val) \ -do { \ - *(vmesa->buf++)=val; \ - DEBUG_BUFS(("DMAOUT: val=0x%x\n", (unsigned int)val)); \ -} while(0) - -#define DMAFINISH() \ -do { \ - /* NOTE: it does nothing - it just prints some summary infos */ \ - DEBUG(("DMAFINISH: vmesa->bufCount=%i\n", vmesa->bufCount)); \ - DEBUG(("buf: index=%i; addr=%p\n", vmesa->bufIndex[vmesa->_bufNum], \ - vmesa->s3vScreen->bufs->list[vmesa->bufIndex[vmesa->_bufNum]].address)); \ -} while(0) - -#define DMAFLUSH() \ -do { \ - if (vmesa->bufCount) { \ - SEND_DMA(vmesa->driFd, vmesa->hHWContext, 1, \ - &vmesa->bufIndex[vmesa->_bufNum], &vmesa->bufCount); \ -/* - GET_DMA(vmesa->driFd, vmesa->hHWContext, 1, \ - &vmesa->bufIndex, &vmesa->bufSize); \ -*/ \ - vmesa->_bufNum = !(vmesa->_bufNum); \ - vmesa->buf = vmesa->_buf[vmesa->_bufNum]; \ -/* - vmesa->buf = \ - vmesa->s3vScreen->bufs->list[vmesa->bufIndex].address; \ -*/ \ - vmesa->bufCount = 0; \ - } \ -} while (0) - -#define CMDCHANGE() \ -do { \ - DMAOUT_CHECK(3DTRI_CMDSET, 1); /* FIXME: TRI/LINE */ \ - DMAOUT(vmesa->CMD); \ - DMAFINISH(); \ -} while (0) - -#ifdef DONT_SEND_DMA -#define GET_DMA(fd, hHWCtx, n, idx, size) -#define SEND_DMA(fd, hHWCtx,n, idx, cnt) -#else -#define GET_DMA(fd, hHWCtx, n, idx, size) \ -do { \ - drmDMAReq dma; \ - int retcode, i; \ -\ - DEBUG(("GET_DMA: ")); \ - DEBUG(("req_count=%i; req_list[#0]=%i; req_size[#0]=%i\n", \ - n, (idx)[n-1], (size)[n-1])); \ -\ - dma.context = (hHWCtx); \ - dma.send_count = 0; \ - dma.send_list = NULL; \ - dma.send_sizes = NULL; \ - dma.flags = S3V_DMA_GET_FLAGS; \ - dma.request_count = (n); \ - dma.request_size = S3V_DMA_BUF_SZ; \ - dma.request_list = (idx); \ - dma.request_sizes = (size); \ -\ - do { \ - if ((retcode = drmDMA((fd), &dma))) { \ - DEBUG_BUFS(("drmDMA (get) returned %d\n", retcode)); \ - } \ -} while (!(dma).granted_count); \ -\ - for (i = 0; i < (n); i++) { \ - DEBUG(("Got buffer %i (index #%i)\n", (idx)[i], i)); \ - DEBUG(("of %i bytes (%i words) size\n", \ - (size)[i], (size)[i] >>2)); \ - /* Convert from bytes to words */ \ - (size)[i] >>= 2; \ - } \ -} while (0) - -#define SEND_DMA(fd, hHWCtx, n, idx, cnt) \ -do { \ - drmDMAReq dma; \ - int retcode, i; \ -\ - DEBUG(("SEND_DMA: ")); \ - DEBUG(("send_count=%i; send_list[#0]=%i; send_sizes[#0]=%i\n", \ - n, (idx)[n-1], (cnt)[n-1])); \ -\ - for (i = 0; i < (n); i++) { \ - /* Convert from words to bytes */ \ - (cnt)[i] <<= 2; \ - } \ -\ - dma.context = (hHWCtx); \ - dma.send_count = (n); \ - dma.send_list = (idx); \ - dma.send_sizes = (cnt); \ - dma.flags = S3V_DMA_SEND_FLAGS; \ - dma.request_count = 0; \ - dma.request_size = 0; \ - dma.request_list = NULL; \ - dma.request_sizes = NULL; \ -\ - if ((retcode = drmDMA((fd), &dma))) { \ - DEBUG_BUFS(("drmDMA (send) returned %d\n", retcode)); \ - } \ -\ - for (i = 0; i < (n); i++) { \ - DEBUG(("Sent buffer %i (index #%i)\n", (idx)[i], i)); \ - DEBUG(("of %i bytes (%i words) size\n", \ - (cnt)[i], (cnt)[i] >>2)); \ - (cnt)[i] = 0; \ - } \ -} while (0) -#endif /* DONT_SEND_DMA */ - -#define GET_FIRST_DMA(fd, hHWCtx, n, idx, size, buf, cnt, vPriv) \ -do { \ - int i; \ - DEBUG_BUFS(("GET_FIRST_DMA\n")); \ - DEBUG_BUFS(("n=%i idx=%i size=%i\n", n, *idx, *size)); \ - DEBUG_BUFS(("going to GET_DMA\n")); \ - GET_DMA(fd, hHWCtx, n, idx, size); \ - DEBUG_BUFS(("coming from GET_DMA\n")); \ - DEBUG_BUFS(("n=%i idx=%i size=%i\n", n, (idx)[0], (size)[0])); \ - for (i = 0; i < (n); i++) { \ - DEBUG_BUFS(("buf #%i @%p\n", \ - i, (vPriv)->bufs->list[(idx)[i]].address)); \ - (buf)[i] = (vPriv)->bufs->list[(idx)[i]].address; \ - (cnt)[i] = 0; \ - } \ - DEBUG(("GOING HOME\n")); \ -} while (0) - -/**************************/ -/* generic, global macros */ -/**************************/ - -#define CALC_LOG2(l2,s) \ -do { \ - int __s = s; \ - l2 = 0; \ - while (__s > 1) { ++l2; __s >>= 1; } \ -} while (0) - -#define PrimType_Null 0x00000000 -#define PrimType_Points 0x10000000 -#define PrimType_Lines 0x20000000 -#define PrimType_LineLoop 0x30000000 -#define PrimType_LineStrip 0x40000000 -#define PrimType_Triangles 0x50000000 -#define PrimType_TriangleStrip 0x60000000 -#define PrimType_TriangleFan 0x70000000 -#define PrimType_Quads 0x80000000 -#define PrimType_QuadStrip 0x90000000 -#define PrimType_Polygon 0xa0000000 -#define PrimType_Mask 0xf0000000 - -#endif /* _S3V_MACROS_H_ */ diff --git a/src/mesa/drivers/dri/s3v/s3v_regs.h b/src/mesa/drivers/dri/s3v/s3v_regs.h deleted file mode 100644 index 26a7c54af5..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_regs.h +++ /dev/null @@ -1,367 +0,0 @@ -/* - * Author: Max Lingua - */ - -#ifndef _S3V_REG_H -#define _S3V_REG_H - -#define S3V_REGS_NUM 256 - -/************ - * DMA REGS * - ************/ - -#define S3V_DMA_ID 0 -#define S3V_DMA_REG 0x8590 -#define S3V_DMA_WRITEP_ID 1 -#define S3V_DMA_WRITEP_REG 0x8594 -#define S3V_DMA_READP_ID 2 -#define S3V_DMA_READP_REG 0x8598 -#define S3V_DMA_ENABLE_ID 3 -#define S3V_DMA_ENABLE_REG 0x859C -#define S3V_DMA_UPDATE_ID 4 -#define S3V_DMA_UPDATE_REG 0x10000 - -/*************** - * STATUS REGS * - ***************/ - -#define S3V_STAT_ID 10 -#define S3V_STAT_REG 0x8504 -#define S3V_STAT_VSYNC_ID 11 -#define S3V_STAT_VSYNC_REG 0x8505 -#define S3V_STAT_3D_DONE_ID 12 -#define S3V_STAT_3D_DONE_REG 0x8506 -#define S3V_STAT_FIFO_OVER_ID 13 -#define S3V_STAT_FIFO_OVER_REG 0x8508 -#define S3V_STAT_FIFO_EMPTY_ID 14 -#define S3V_STAT_FIFO_EMPTY_REG 0x850C -#define S3V_STAT_HDMA_DONE_ID 15 -#define S3V_STAT_HDMA_DONE_REG 0x8514 -#define S3V_STAT_CDMA_DONE_ID 16 -#define S3V_STAT_CDMA_DONE_REG 0x8524 -#define S3V_STAT_3D_FIFO_EMPTY_ID 17 -#define S3V_STAT_3D_FIFO_EMPTY_REG 0x8544 -#define S3V_STAT_LPB_ID 18 -#define S3V_STAT_LPB_REG 0x8584 -#define S3V_STAT_3D_BUSY_ID 19 -#define S3V_STAT_3D_BUSY_REG 0x8704 - -/*********** - * 2D REGS * - ***********/ - -#define S3V_BITBLT_ID 30 -#define S3V_BITBLT_REG 0xA400 -#define S3V_BITBLT_SRC_BASE_ID 31 -#define S3V_BITBLT_SRC_BASE_REG 0xA4D4 -#define S3V_BITBLT_DEST_BASE_ID 32 -#define S3V_BITBLT_DEST_BASE_REG 0xA4D8 -#define S3V_BITBLT_CLIP_L_R_ID 33 -#define S3V_BITBLT_CLIP_L_R_REG 0xA4DC -#define S3V_BITBLT_CLIP_T_B_ID 34 -#define S3V_BITBLT_CLIP_T_B_REG 0xA4E0 -#define S3V_BITBLT_DEST_SRC_STRIDE_ID 35 -#define S3V_BITBLT_DEST_SRC_STRIDE_REG 0xA4E4 -#define S3V_BITBLT_MONO_PAT0_ID 36 -#define S3V_BITBLT_MONO_PAT0_REG 0xA4E8 -#define S3V_BITBLT_MONO_PAT1_ID 37 -#define S3V_BITBLT_MONO_PAT1_REG 0xA4EC -#define S3V_BITBLT_PAT_BG_COLOR_ID 38 -#define S3V_BITBLT_PAT_BG_COLOR_REG 0xA4F0 -#define S3V_BITBLT_PAT_FG_COLOR_ID 39 -#define S3V_BITBLT_PAT_FG_COLOR_REG 0xA4F4 -#define S3V_BITBLT_CMDSET_ID 40 -#define S3V_BITBLT_CMDSET_REG 0xA500 -#define S3V_BITBLT_WIDTH_HEIGHT_ID 41 -#define S3V_BITBLT_WIDTH_HEIGHT_REG 0xA504 -#define S3V_BITBLT_SRC_X_Y_ID 42 -#define S3V_BITBLT_SRC_X_Y_REG 0xA508 -#define S3V_BITBLT_DEST_X_Y_ID 43 -#define S3V_BITBLT_DEST_X_Y_REG 0xA50C -#define S3V_2DLINE_ID 44 -#define S3V_2DLINE_REG 0xA800 -#define S3V_2DPOLY_ID 45 -#define S3V_2DPOLY_REG 0xAC00 - -/*************** - * 3DLINE REGS * - ***************/ -/* base regs */ -#define S3V_3DLINE_ID 50 -#define S3V_3DLINE_REG 0xB000 -#define S3V_3DLINE_Z_BASE_ID 51 -#define S3V_3DLINE_Z_BASE_REG 0xB0D4 -#define S3V_3DLINE_SRC_BASE_ID 52 /* it is the same reg */ -#define S3V_3DLINE_SRC_BASE_REG 0xB0D4 -#define S3V_3DLINE_DEST_BASE_ID 53 -#define S3V_3DLINE_DEST_BASE_REG 0xB0D8 -#define S3V_3DLINE_CLIP_L_R_ID 54 -#define S3V_3DLINE_CLIP_L_R_REG 0xB0DC -#define S3V_3DLINE_CLIP_T_B_ID 55 -#define S3V_3DLINE_CLIP_T_B_REG 0xB0E0 -#define S3V_3DLINE_DEST_SRC_STRIDE_ID 56 -#define S3V_3DLINE_DEST_SRC_STRIDE_REG 0xB0E4 -#define S3V_3DLINE_Z_STRIDE_ID 57 -#define S3V_3DLINE_Z_STRIDE_REG 0xB0E8 -#define S3V_3DLINE_TEX_BASE_ID 58 -#define S3V_3DLINE_TEX_BASE_REG 0xB0EC -#define S3V_3DLINE_TEX_B_COLOR_ID 59 -#define S3V_3DLINE_TEX_B_COLOR_REG 0xB0F0 -#define S3V_3DLINE_FOG_COLOR_ID 60 -#define S3V_3DLINE_FOG_COLOR_REG 0xB0F4 -#define S3V_3DLINE_COLOR0_ID 61 -#define S3V_3DLINE_COLOR0_REG 0xB0F8 -#define S3V_3DLINE_COLOR1_ID 62 -#define S3V_3DLINE_COLOR1_REG 0xB0FC -#define S3V_3DLINE_CMDSET_ID 63 -#define S3V_3DLINE_CMDSET_REG 0xB100 /* special */ -/* tex regs */ -/* FIXME: shouldn't it be a 1D tex for lines? */ -#define S3V_3DLINE_BASEV_ID 64 -#define S3V_3DLINE_BASEV_REG 0xB104 -#define S3V_3DLINE_BASEU_ID 65 -#define S3V_3DLINE_BASEU_REG 0xB108 -#define S3V_3DLINE_WXD_ID 66 -#define S3V_3DLINE_WXD_REG 0xB10C -#define S3V_3DLINE_WYD_ID 67 -#define S3V_3DLINE_WYD_REG 0xB110 -#define S3V_3DLINE_WSTART_ID 68 -#define S3V_3DLINE_WSTART_REG 0xB114 -#define S3V_3DLINE_DXD_ID 69 -#define S3V_3DLINE_DXD_REG 0xB118 -#define S3V_3DLINE_VXD_ID 70 -#define S3V_3DLINE_VXD_REG 0xB11C -#define S3V_3DLINE_UXD_ID 71 -#define S3V_3DLINE_UXD_REG 0xB120 -#define S3V_3DLINE_DYD_ID 72 -#define S3V_3DLINE_DYD_REG 0xB124 -#define S3V_3DLINE_VYD_ID 73 -#define S3V_3DLINE_VYD_REG 0xB128 -#define S3V_3DLINE_UYD_ID 74 -#define S3V_3DLINE_UYD_REG 0xB12C -#define S3V_3DLINE_DSTART_ID 75 -#define S3V_3DLINE_DSTART_REG 0xB130 -#define S3V_3DLINE_VSTART_ID 76 -#define S3V_3DLINE_VSTART_REG 0xB134 -#define S3V_3DLINE_USTART_ID 77 -#define S3V_3DLINE_USTART_REG 0xB138 -/* gourad regs */ -#define S3V_3DLINE_GBD_ID 78 -#define S3V_3DLINE_GBD_REG 0xB144 -#define S3V_3DLINE_ARD_ID 79 -#define S3V_3DLINE_ARD_REG 0xB148 -#define S3V_3DLINE_GS_BS_ID 80 -#define S3V_3DLINE_GS_BS_REG 0xB14C -#define S3V_3DLINE_AS_RS_ID 81 -#define S3V_3DLINE_AS_RS_REG 0xB150 -/* vertex regs */ -#define S3V_3DLINE_DZ_ID 82 -#define S3V_3DLINE_DZ_REG 0xB158 -#define S3V_3DLINE_ZSTART_ID 83 -#define S3V_3DLINE_ZSTART_REG 0xB15C -#define S3V_3DLINE_XEND0_END1_ID 84 -#define S3V_3DLINE_XEND0_END1_REG 0xB16C -#define S3V_3DLINE_DX_ID 85 -#define S3V_3DLINE_DX_REG 0xB170 -#define S3V_3DLINE_XSTART_ID 86 -#define S3V_3DLINE_XSTART_REG 0xB174 -#define S3V_3DLINE_YSTART_ID 87 -#define S3V_3DLINE_YSTART_REG 0xB178 -#define S3V_3DLINE_YCNT_ID 88 -#define S3V_3DLINE_YCNT_REG 0xB17C - -/************** - * 3DTRI REGS * - **************/ -/* base regs */ -#define S3V_3DTRI_ID 100 -#define S3V_3DTRI_REG 0xB400 -#define S3V_3DTRI_Z_BASE_ID 101 -#define S3V_3DTRI_Z_BASE_REG 0xB4D4 -#define S3V_3DTRI_SRC_BASE_ID 102 /* it is the same reg */ -#define S3V_3DTRI_SRC_BASE_REG 0xB4D4 -#define S3V_3DTRI_DEST_BASE_ID 103 -#define S3V_3DTRI_DEST_BASE_REG 0xB4D8 -#define S3V_3DTRI_CLIP_L_R_ID 104 -#define S3V_3DTRI_CLIP_L_R_REG 0xB4DC -#define S3V_3DTRI_CLIP_T_B_ID 105 -#define S3V_3DTRI_CLIP_T_B_REG 0xB4E0 -#define S3V_3DTRI_DEST_SRC_STRIDE_ID 106 -#define S3V_3DTRI_DEST_SRC_STRIDE_REG 0xB4E4 -#define S3V_3DTRI_Z_STRIDE_ID 107 -#define S3V_3DTRI_Z_STRIDE_REG 0xB4E8 -#define S3V_3DTRI_TEX_BASE_ID 108 -#define S3V_3DTRI_TEX_BASE_REG 0xB4EC -#define S3V_3DTRI_TEX_B_COLOR_ID 109 -#define S3V_3DTRI_TEX_B_COLOR_REG 0xB4F0 -#define S3V_3DTRI_FOG_COLOR_ID 110 -#define S3V_3DTRI_FOG_COLOR_REG 0xB4F4 -#define S3V_3DTRI_COLOR0_ID 111 -#define S3V_3DTRI_COLOR0_REG 0xB4F8 -#define S3V_3DTRI_COLOR1_ID 112 -#define S3V_3DTRI_COLOR1_REG 0xB4FC -#define S3V_3DTRI_CMDSET_ID 113 /* special */ -#define S3V_3DTRI_CMDSET_REG 0xB500 -/* tex regs */ -#define S3V_3DTRI_BASEV_ID 114 -#define S3V_3DTRI_BASEV_REG 0xB504 -#define S3V_3DTRI_BASEU_ID 115 -#define S3V_3DTRI_BASEU_REG 0xB508 -#define S3V_3DTRI_WXD_ID 116 -#define S3V_3DTRI_WXD_REG 0xB50C -#define S3V_3DTRI_WYD_ID 117 -#define S3V_3DTRI_WYD_REG 0xB510 -#define S3V_3DTRI_WSTART_ID 118 -#define S3V_3DTRI_WSTART_REG 0xB514 -#define S3V_3DTRI_DXD_ID 119 -#define S3V_3DTRI_DXD_REG 0xB518 -#define S3V_3DTRI_VXD_ID 120 -#define S3V_3DTRI_VXD_REG 0xB51C -#define S3V_3DTRI_UXD_ID 121 -#define S3V_3DTRI_UXD_REG 0xB520 -#define S3V_3DTRI_DYD_ID 122 -#define S3V_3DTRI_DYD_REG 0xB524 -#define S3V_3DTRI_VYD_ID 123 -#define S3V_3DTRI_VYD_REG 0xB528 -#define S3V_3DTRI_UYD_ID 124 -#define S3V_3DTRI_UYD_REG 0xB52C -#define S3V_3DTRI_DSTART_ID 125 -#define S3V_3DTRI_DSTART_REG 0xB530 -#define S3V_3DTRI_VSTART_ID 126 -#define S3V_3DTRI_VSTART_REG 0xB534 -#define S3V_3DTRI_USTART_ID 127 -#define S3V_3DTRI_USTART_REG 0xB538 -/* gourad regs */ -#define S3V_3DTRI_GBX_ID 128 -#define S3V_3DTRI_GBX_REG 0xB53C -#define S3V_3DTRI_ARX_ID 129 -#define S3V_3DTRI_ARX_REG 0xB540 -#define S3V_3DTRI_GBY_ID 130 -#define S3V_3DTRI_GBY_REG 0xB544 -#define S3V_3DTRI_ARY_ID 131 -#define S3V_3DTRI_ARY_REG 0xB548 -#define S3V_3DTRI_GS_BS_ID 132 -#define S3V_3DTRI_GS_BS_REG 0xB54C -#define S3V_3DTRI_AS_RS_ID 133 -#define S3V_3DTRI_AS_RS_REG 0xB550 -/* vertex regs */ -#define S3V_3DTRI_ZXD_ID 134 -#define S3V_3DTRI_ZXD_REG 0xB554 -#define S3V_3DTRI_ZYD_ID 135 -#define S3V_3DTRI_ZYD_REG 0xB558 -#define S3V_3DTRI_ZSTART_ID 136 -#define S3V_3DTRI_ZSTART_REG 0xB55C -#define S3V_3DTRI_TXDELTA12_ID 137 -#define S3V_3DTRI_TXDELTA12_REG 0xB560 -#define S3V_3DTRI_TXEND12_ID 138 -#define S3V_3DTRI_TXEND12_REG 0xB564 -#define S3V_3DTRI_TXDELTA01_ID 139 -#define S3V_3DTRI_TXDELTA01_REG 0xB568 -#define S3V_3DTRI_TXEND01_ID 140 -#define S3V_3DTRI_TXEND01_REG 0xB56C -#define S3V_3DTRI_TXDELTA02_ID 141 -#define S3V_3DTRI_TXDELTA02_REG 0xB570 -#define S3V_3DTRI_TXSTART02_ID 142 -#define S3V_3DTRI_TXSTART02_REG 0xB574 -#define S3V_3DTRI_TYS_ID 143 -#define S3V_3DTRI_TYS_REG 0xB578 -#define S3V_3DTRI_TY01_Y12_ID 144 -#define S3V_3DTRI_TY01_Y12_REG 0xB57C - -/* COMMANDS (to 0xB100 [lines] or 0xB500 [tris]) */ - -/* Auto execute */ -#define AUTO_EXEC_MASK 0x00000001 -#define AUTO_EXEC_OFF (0x0) -#define AUTO_EXEC_ON (0x1) -/* HW clipping */ -#define HW_CLIP_MASK 0x00000002 -#define HW_CLIP_OFF (0x0 << 1) -#define HW_CLIP_ON (0x1 << 1) -/* Destination color */ -#define DEST_COL_MASK 0x0000001c -#define DEST_COL_PAL (0x0 << 2) /* 8 bpp - palettized */ -#define DEST_COL_1555 (0x1 << 2) /* 16 bpp - ZRGB */ -#define DEST_COL_888 (0x2 << 2) /* 24 bpp - RGB */ -/* Texture color */ -#define TEX_COL_MASK 0x000000e0 -#define TEX_COL_ARGB8888 (0x0 << 5) /* 32 bpp - ARGB */ -#define TEX_COL_ARGB4444 (0x1 << 5) /* 16 bpp - ARGB */ -#define TEX_COL_ARGB1555 (0x2 << 5) /* 16 bpp - ARGB */ -#define TEX_COL_ALPHA4 (0x3 << 5) /* 8 bpp - ALPHA4 */ -#define TEX_COL_BLEND4_LOW (0x4 << 5) /* 4 bpp - BLEND4 low nibble */ -#define TEX_COL_BLEND4_HIGH (0x5 << 5) /* 4 bpp - BLEND4 high nibble */ -#define TEX_COL_PAL (0x6 << 5) /* 8 bpp - palettized */ -#define TEX_COL_YUV (0x7 << 5) /* 16 bpp - YUV */ -/* Mipmap level */ -#define MIP_MASK 0x00000f00 -#define MIPMAP_LEVEL(s) (s << 8) /* 8 -> 11 bits */ -/* Texture filtering */ -#define TEX_FILTER_MASK 0x00007000 -#define MIP_NEAREST (0x0 << 12) -#define LINEAR_MIP_NEAREST (0x1 << 12) -#define MIP_LINEAR (0x2 << 12) -#define LINEAR_MIP_LINEAR (0x3 << 12) -#define NEAREST (0x4 << 12) -#define FAST_BILINEAR (0x5 << 12) -#define LINEAR (0x6 << 12) -/* Texture blending */ -#define TEX_BLEND_MAKS 0x00018000 -#define TEX_REFLECT (0x0 << 15) -#define TEX_MODULATE (0x1 << 15) -#define TEX_DECAL (0x2 << 15) -/* Fog */ -#define FOG_MASK 0x00020000 -#define FOG_OFF (0x0 << 17) -#define FOG_ON (0x1 << 17) -/* Alpha blending */ -#define ALPHA_BLEND_MASK 0x000c0000 -#define ALPHA_OFF (0x0 << 18) | (0x0 << 19) -#define ALPHA_TEX (0x2 << 18) -#define ALPHA_SRC (0x3 << 18) -/* Depth compare mode */ -#define Z_MODE_MASK 0x00700000 -#define Z_NEVER (0x0 << 20) -#define Z_GREATER (0x1 << 20) -#define Z_EQUAL (0x2 << 20) -#define Z_GEQUAL (0x3 << 20) -#define Z_LESS (0x4 << 20) -#define Z_NOTEQUAL (0x5 << 20) -#define Z_LEQUAL (0x6 << 20) -#define Z_ALWAYS (0x7 << 20) -/* Depth update */ -#define Z_UPDATE_MASK 0x00800000 -#define Z_UPDATE_OFF (0x0 << 23) /* disable z update */ -#define Z_UPDATE_ON (0x1 << 23) -/* Depth buffering mode */ -#define Z_BUFFER_MASK 0x03000000 -#define Z_BUFFER (0x0 << 24) | (0x0 << 25) -#define Z_MUX_BUF (0x1 << 24) | (0x0 << 25) -#define Z_MUX_DRAW (0x2 << 24) -#define Z_OFF (0x3 << 24) /* no z buffering */ -/* Texture wrapping */ -#define TEX_WRAP_MASK 0x04000000 -#define TEX_WRAP_OFF (0x0 << 26) -#define TEX_WRAP_ON (0x1 << 26) -/* 3d command */ -#define DO_MASK 0x78000000 -#define DO_GOURAUD_TRI (0x0 << 27) -#define DO_TEX_LIT_TRI_OLD (0x1 << 27) -#define DO_TEX_UNLIT_TRI_OLD (0x2 << 27) -#define DO_TEX_LIT_TRI (0x5 << 27) -#define DO_TEX_UNLIT_TRI (0x6 << 27) -#define DO_3D_LINE (0x8 << 27) -#define DO_NOP (0xf << 27) /* turn on autoexec */ -/* status */ -#define CMD_MASK 0x80000000 -#define CMD_2D (0x0 << 31) /* execute a 2d cmd */ -#define CMD_3D (0x1 << 31) /* execute a 3d cmd */ - -/* global masks */ -#define TEX_MASK ( TEX_COL_MASK | TEX_WRAP_MASK | MIP_MASK \ - | TEX_FILTER_MASK | TEX_BLEND_MAKS \ - | TEX_WRAP_MASK ) -#define Z_MASK ( Z_MODE_MASK | Z_UPDATE_MASK | Z_BUFFER_MASK ) - -#endif /* _S3V_REG_H */ diff --git a/src/mesa/drivers/dri/s3v/s3v_render.c b/src/mesa/drivers/dri/s3v/s3v_render.c deleted file mode 100644 index 5023f3c464..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_render.c +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Author: Max Lingua - */ - -#include "main/glheader.h" -#include "main/context.h" -#include "main/macros.h" -#include "main/mtypes.h" - -#include "tnl/t_context.h" - -#include "s3v_context.h" -#include "s3v_tris.h" -#include "s3v_vb.h" - - -#define HAVE_POINTS 0 -#define HAVE_LINES 0 -#define HAVE_LINE_STRIPS 0 -#define HAVE_TRIANGLES 0 -#define HAVE_TRI_STRIPS 0 -#define HAVE_TRI_STRIP_1 0 -#define HAVE_TRI_FANS 0 -#define HAVE_QUADS 0 -#define HAVE_QUAD_STRIPS 0 -#define HAVE_POLYGONS 0 - -#define HAVE_ELTS 0 - -#if 0 -static void VERT_FALLBACK( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint flags ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); -/* s3vContextPtr vmesa = S3V_CONTEXT(ctx); */ - int _flags; - - DEBUG(("VERT_FALLBACK: flags & PRIM_MODE_MASK = %i\n", - flags & PRIM_MODE_MASK)); - DEBUG(("VERT_FALLBACK: flags=%i PRIM_MODE_MASK=%i\n", - flags, PRIM_MODE_MASK)); -#if 0 - tnl->Driver.Render.PrimitiveNotify( ctx, flags & PRIM_MODE_MASK ); -#endif - tnl->Driver.Render.BuildVertices( ctx, start, count, ~0 ); - - _flags = flags & PRIM_MODE_MASK; - - tnl->Driver.Render.PrimTabVerts[_flags]( ctx, start, count, flags ); - S3V_CONTEXT(ctx)->SetupNewInputs = VERT_BIT_POS; -} -#endif - -static const GLuint hw_prim[GL_POLYGON+1] = { - PrimType_Points, - PrimType_Lines, - PrimType_LineLoop, - PrimType_LineStrip, - PrimType_Triangles, - PrimType_TriangleStrip, - PrimType_TriangleFan, - PrimType_Quads, - PrimType_QuadStrip, - PrimType_Polygon -}; - -static INLINE void s3vStartPrimitive( s3vContextPtr vmesa, GLenum prim ) -{ - __DRIdrawablePrivate *dPriv = vmesa->driDrawable; - - int _hw_prim = hw_prim[prim]; - - DEBUG(("s3vStartPrimitive (new #%i) ", prim)); - - if (_hw_prim != vmesa->restore_primitive) { - - if (prim == 4) { /* TRI */ - DEBUG(("switching to tri\n")); - vmesa->prim_cmd = vmesa->_tri[vmesa->_3d_mode]; - vmesa->alpha_cmd = vmesa->_alpha[vmesa->_3d_mode]; - DMAOUT_CHECK(3DTRI_Z_BASE, 12); - } else if (prim == 1) { /* LINE */ - DEBUG(("switching to line\n")); - vmesa->prim_cmd = DO_3D_LINE; - vmesa->alpha_cmd = vmesa->_alpha[0]; - DMAOUT_CHECK(3DLINE_Z_BASE, 12); - } else { - DEBUG(("Never mind the bollocks!\n")); - } - - DMAOUT(vmesa->s3vScreen->depthOffset & 0x003FFFF8); - DMAOUT(vmesa->DestBase); - /* DMAOUT(vmesa->ScissorLR); */ - /* DMAOUT(vmesa->ScissorTB); */ - DMAOUT( (0 << 16) | (dPriv->w-1) ); - DMAOUT( (0 << 16) | (dPriv->h-1) ); - DMAOUT( (vmesa->SrcStride << 16) | vmesa->TexStride ); - DMAOUT(vmesa->SrcStride); - DMAOUT(vmesa->TexOffset); - DMAOUT(vmesa->TextureBorderColor); - DMAOUT(0); /* FOG */ - DMAOUT(0); - DMAOUT(0); - DMAOUT(vmesa->CMD | vmesa->prim_cmd | vmesa->alpha_cmd); - DMAFINISH(); - } - - vmesa->restore_primitive = _hw_prim; -} - -static INLINE void s3vEndPrimitive( s3vContextPtr vmesa ) -{ -/* GLcontext *ctx = vmesa->glCtx; */ - DEBUG(("s3vEndPrimitive\n")); -} - -#define LOCAL_VARS s3vContextPtr vmesa = S3V_CONTEXT(ctx) -#define INIT( prim ) s3vStartPrimitive( vmesa, prim ) -#define FINISH s3vEndPrimitive( vmesa ) -#define NEW_PRIMITIVE() (void) vmesa -#define NEW_BUFFER() (void) vmesa -#define FIRE_VERTICES() (void) vmesa -#define GET_CURRENT_VB_MAX_VERTS() \ - (vmesa->bufSize - vmesa->bufCount) / 2 -#define GET_SUBSEQUENT_VB_MAX_VERTS() \ - S3V_DMA_BUF_SZ / 2 -/* XXX */ -#define ALLOC_VERTS(nr) NULL -#define EMIT_VERTS(ctx, start, count, buf) NULL -#define FLUSH() s3vEndPrimitive( vmesa ) - -#define TAG(x) s3v_##x - -#include "tnl_dd/t_dd_dmatmp.h" - -/**********************************************************************/ -/* Render pipeline stage */ -/**********************************************************************/ - - -static GLboolean s3v_run_render( GLcontext *ctx, - struct tnl_pipeline_stage *stage ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *VB = &tnl->vb; - GLuint i; - tnl_render_func *tab; - - DEBUG(("s3v_run_render\n")); - - /* FIXME: hw clip */ - if (VB->ClipOrMask || vmesa->RenderIndex != 0) { - DEBUG(("*** CLIPPED in render ***\n")); -#if 1 - return GL_TRUE; /* don't handle clipping here */ -#endif - } - - - /* We don't do elts */ - if (VB->Elts) - return GL_TRUE; - - tab = TAG(render_tab_verts); - - tnl->Driver.Render.Start( ctx ); - - for (i = 0 ; i < VB->PrimitiveCount ; i++ ) - { - GLuint prim = _tnl_translate_prim(&VB->Primitive[i]); - GLuint start = VB->Primitive[i].start; - GLuint length = VB->Primitive[i].count; - - DEBUG(("s3v_run_render (loop=%i) (lenght=%i)\n", i, length)); - - if (length) { - tnl->Driver.Render.BuildVertices( ctx, start, - start+length, ~0 /*stage->inputs*/); /* XXX */ - tnl->Driver.Render.PrimTabVerts[prim & PRIM_MODE_MASK] - ( ctx, start, start + length, prim ); - vmesa->SetupNewInputs = VERT_BIT_POS; - } - } - - tnl->Driver.Render.Finish( ctx ); - - return GL_FALSE; /* finished the pipe */ -} - - - -const struct tnl_pipeline_stage _s3v_render_stage = -{ - "s3v render", - NULL, - NULL, - NULL, - NULL, - s3v_run_render /* run */ -}; diff --git a/src/mesa/drivers/dri/s3v/s3v_screen.c b/src/mesa/drivers/dri/s3v/s3v_screen.c deleted file mode 100644 index f1810597e6..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_screen.c +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Author: Max Lingua - */ - -#include "s3v_context.h" -#include "s3v_vb.h" -#include "s3v_dri.h" - -s3vScreenPtr s3vCreateScreen( __DRIscreenPrivate *sPriv ) -{ - s3vScreenPtr s3vScreen; - S3VDRIPtr vDRIPriv = (S3VDRIPtr)sPriv->pDevPriv; - -/* int i; */ - - DEBUG(("s3vCreateScreen\n")); - DEBUG(("sPriv->pDevPriv at %p\n", sPriv->pDevPriv)); - DEBUG(("size = %i\n", sizeof(*vDRIPriv))); - - if (sPriv->devPrivSize != sizeof(S3VDRIRec)) { - fprintf(stderr,"\nERROR! sizeof(S3VDRIRec) does not match passed size from device driver\n"); - return GL_FALSE; - } - - /* Allocate the private area */ - s3vScreen = (s3vScreenPtr) CALLOC( sizeof(*s3vScreen) ); - if ( !s3vScreen ) return NULL; - - s3vScreen->regionCount = 4; /* Magic number. Can we fix this? */ - - s3vScreen->regions = _mesa_malloc(s3vScreen->regionCount * - sizeof(s3vRegion)); - DEBUG(("sPriv->fd = %i\nvDRIPriv->dmaBufHandle = %x\n", - sPriv->fd, vDRIPriv->dmaBufHandle)); - - DEBUG(("vDRIPriv->dmaBufSize=%i\nvDRIPriv->dmaBuf=%p\n", - vDRIPriv->dmaBufSize, vDRIPriv->dmaBuf)); - - - /* Get the list of dma buffers */ - s3vScreen->bufs = drmMapBufs(sPriv->fd); - - if (!s3vScreen->bufs) { - DEBUG(("Helter/skelter with drmMapBufs\n")); - return GL_FALSE; - } - - s3vScreen->textureSize = vDRIPriv->texSize; - s3vScreen->logTextureGranularity = vDRIPriv->logTextureGranularity; - s3vScreen->cpp = vDRIPriv->cpp; - s3vScreen->frontOffset = vDRIPriv->frontOffset; - s3vScreen->frontPitch = vDRIPriv->frontPitch; - s3vScreen->backOffset = vDRIPriv->backOffset; - s3vScreen->backPitch = vDRIPriv->frontPitch; /* FIXME: check */ - s3vScreen->depthOffset = vDRIPriv->depthOffset; - s3vScreen->depthPitch = vDRIPriv->frontPitch; - s3vScreen->texOffset = vDRIPriv->texOffset; - - s3vScreen->driScreen = sPriv; - - DEBUG(("vDRIPriv->width =%i; vDRIPriv->deviceID =%x\n", vDRIPriv->width, - vDRIPriv->deviceID)); - DEBUG(("vDRIPriv->mem =%i\n", vDRIPriv->mem)); - DEBUG(("vDRIPriv->fbOffset =%i\n", vDRIPriv->fbOffset)); - DEBUG((" ps3vDRI->fbStride =%i\n", vDRIPriv->fbStride)); - DEBUG(("s3vScreen->cpp = %i\n", s3vScreen->cpp)); - DEBUG(("s3vScreen->backOffset = %x\n", s3vScreen->backOffset)); - DEBUG(("s3vScreen->depthOffset = %x\n", s3vScreen->depthOffset)); - DEBUG(("s3vScreen->texOffset = %x\n", s3vScreen->texOffset)); - DEBUG(("I will return from s3vCreateScreen now\n")); - - DEBUG(("s3vScreen->bufs = 0x%x\n", s3vScreen->bufs)); - return s3vScreen; -} - -/* Destroy the device specific screen private data struct. - */ -void s3vDestroyScreen( __DRIscreenPrivate *sPriv ) -{ - s3vScreenPtr s3vScreen = (s3vScreenPtr)sPriv->private; - - DEBUG(("s3vDestroyScreen\n")); - - /* First, unmap the dma buffers */ -/* - drmUnmapBufs( s3vScreen->bufs ); -*/ - /* Next, unmap all the regions */ -/* while (s3vScreen->regionCount > 0) { - - (void)drmUnmap(s3vScreen->regions[s3vScreen->regionCount].map, - s3vScreen->regions[s3vScreen->regionCount].size); - s3vScreen->regionCount--; - - } - FREE(s3vScreen->regions); */ - if (s3vScreen) - FREE(s3vScreen); -} diff --git a/src/mesa/drivers/dri/s3v/s3v_screen.h b/src/mesa/drivers/dri/s3v/s3v_screen.h deleted file mode 100644 index c49bc8587d..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_screen.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Author: Max Lingua - */ - -#include "main/mtypes.h" - -typedef struct _s3vRegion { - drm_handle_t handle; - drmSize size; - drmAddress map; -} s3vRegion, *s3vRegionPtr; - -typedef struct { - - int regionCount; /* Count of register regions */ - s3vRegion *regions; /* Vector of mapped region info */ - - drmBufMapPtr bufs; /* Map of DMA buffers */ - - __DRIscreenPrivate *driScreen; /* Back pointer to DRI screen */ - - int cpp; - int frontPitch; - int frontOffset; - - int backPitch; - int backOffset; - int backX; - int backY; - - int depthOffset; - int depthPitch; - - int texOffset; - int textureOffset; - int textureSize; - int logTextureGranularity; -} s3vScreenRec, *s3vScreenPtr; - diff --git a/src/mesa/drivers/dri/s3v/s3v_span.c b/src/mesa/drivers/dri/s3v/s3v_span.c deleted file mode 100644 index f9f7c0d1ee..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_span.c +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Author: Max Lingua - */ - -#include "s3v_context.h" -#include "s3v_lock.h" - -#include "swrast/swrast.h" - -#define _SPANLOCK 1 -#define DBG 0 - -#define LOCAL_VARS \ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); \ - __DRIscreenPrivate *sPriv = vmesa->driScreen; \ - __DRIdrawablePrivate *dPriv = vmesa->driDrawable; \ - driRenderbuffer *drb = (driRenderbuffer *) rb; \ - GLuint cpp = drb->cpp; \ - GLuint pitch = ( (drb->backBuffer) ? \ - ((dPriv->w+31)&~31) * cpp \ - : sPriv->fbWidth * cpp); \ - GLuint height = dPriv->h; \ - char *buf = (char *)(sPriv->pFB + drb->offset \ - + (drb->backBuffer ? 0 : dPriv->x * cpp + dPriv->y * pitch));\ - GLuint p; \ - (void) p - -/* FIXME! Depth/Stencil read/writes don't work ! */ -#define LOCAL_DEPTH_VARS \ - __DRIdrawablePrivate *dPriv = vmesa->driDrawable; \ - __DRIscreenPrivate *sPriv = vmesa->driScreen; \ - driRenderbuffer *drb = (driRenderbuffer *) rb; \ - GLuint pitch = drb->pitch; \ - GLuint height = dPriv->h; \ - char *buf = (char *)(sPriv->pFB + drb->offset); \ - (void) pitch - -#define LOCAL_STENCIL_VARS LOCAL_DEPTH_VARS - -#define Y_FLIP( _y ) (height - _y - 1) - -#if _SPANLOCK /* OK, we lock */ - -#define HW_LOCK() \ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); \ - (void) vmesa; \ - DMAFLUSH(); \ - S3V_SIMPLE_FLUSH_LOCK(vmesa); -#define HW_UNLOCK() S3V_SIMPLE_UNLOCK(vmesa); - -#else /* plz, don't lock */ - -#define HW_LOCK() \ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); \ - (void) vmesa; \ - DMAFLUSH(); -#define HW_UNLOCK() - -#endif - - -/* ================================================================ - * Color buffer - */ - -/* 16 bit, RGB565 color spanline and pixel functions - */ -#define INIT_MONO_PIXEL(p, color) \ - p = S3VIRGEPACKCOLOR555( color[0], color[1], color[2], color[3] ) - -#define WRITE_RGBA( _x, _y, r, g, b, a ) \ -do { \ - *(GLushort *)(buf + _x*2 + _y*pitch) = ((((int)r & 0xf8) << 7) | \ - (((int)g & 0xf8) << 2) | \ - (((int)b & 0xf8) >> 3)); \ - DEBUG(("buf=0x%x drawOffset=0x%x dPriv->x=%i drb->cpp=%i dPriv->y=%i pitch=%i\n", \ - sPriv->pFB, vmesa->drawOffset, dPriv->x, drb->cpp, dPriv->y, pitch)); \ - DEBUG(("dPriv->w = %i\n", dPriv->w)); \ -} while(0) - -#define WRITE_PIXEL( _x, _y, p ) \ - *(GLushort *)(buf + _x*2 + _y*pitch) = p - -#define READ_RGBA( rgba, _x, _y ) \ - do { \ - GLushort p = *(GLushort *)(buf + _x*2 + _y*pitch); \ - rgba[0] = (p >> 7) & 0xf8; \ - rgba[1] = (p >> 2) & 0xf8; \ - rgba[2] = (p << 3) & 0xf8; \ - rgba[3] = 0xff; /* - if ( rgba[0] & 0x08 ) rgba[0] |= 0x07; \ - if ( rgba[1] & 0x04 ) rgba[1] |= 0x03; \ - if ( rgba[2] & 0x08 ) rgba[2] |= 0x07; */ \ - } while (0) - -#define TAG(x) s3v##x##_RGB555 -#include "spantmp.h" - - -/* 32 bit, ARGB8888 color spanline and pixel functions - */ - -#undef INIT_MONO_PIXEL -#define INIT_MONO_PIXEL(p, color) \ - p = PACK_COLOR_8888( color[3], color[0], color[1], color[2] ) - -#define WRITE_RGBA( _x, _y, r, g, b, a ) \ - *(GLuint *)(buf + _x*4 + _y*pitch) = ((b << 0) | \ - (g << 8) | \ - (r << 16) | \ - (a << 24) ) - -#define WRITE_PIXEL( _x, _y, p ) \ - *(GLuint *)(buf + _x*4 + _y*pitch) = p - -#define READ_RGBA( rgba, _x, _y ) \ -do { \ - GLuint p = *(GLuint *)(buf + _x*4 + _y*pitch); \ - rgba[0] = (p >> 16) & 0xff; \ - rgba[1] = (p >> 8) & 0xff; \ - rgba[2] = (p >> 0) & 0xff; \ - rgba[3] = (p >> 24) & 0xff; \ -} while (0) - -#define TAG(x) s3v##x##_ARGB8888 -#include "spantmp.h" - - -/* 16 bit depthbuffer functions. - */ -#define VALUE_TYPE GLushort - -#define WRITE_DEPTH( _x, _y, d ) \ - *(GLushort *)(buf + _x*2 + _y*dPriv->w*2) = d - -#define READ_DEPTH( d, _x, _y ) \ - d = *(GLushort *)(buf + _x*2 + _y*dPriv->w*2); - -#define TAG(x) s3v##x##_z16 -#include "depthtmp.h" - - - - -/* 32 bit depthbuffer functions. - */ -#if 0 -#define VALUE_TYPE GLuint - -#define WRITE_DEPTH( _x, _y, d ) \ - *(GLuint *)(buf + _x*4 + _y*pitch) = d; - -#define READ_DEPTH( d, _x, _y ) \ - d = *(GLuint *)(buf + _x*4 + _y*pitch); - -#define TAG(x) s3v##x##_32 -#include "depthtmp.h" -#endif - - -/* 24/8 bit interleaved depth/stencil functions - */ -#if 0 -#define VALUE_TYPE GLuint - -#define WRITE_DEPTH( _x, _y, d ) { \ - GLuint tmp = *(GLuint *)(buf + _x*4 + _y*pitch); \ - tmp &= 0xff; \ - tmp |= (d) & 0xffffff00; \ - *(GLuint *)(buf + _x*4 + _y*pitch) = tmp; \ -} - -#define READ_DEPTH( d, _x, _y ) \ - d = *(GLuint *)(buf + _x*4 + _y*pitch) & ~0xff - - -#define TAG(x) s3v##x##_24_8 -#include "depthtmp.h" - -#define WRITE_STENCIL( _x, _y, d ) { \ - GLuint tmp = *(GLuint *)(buf + _x*4 + _y*pitch); \ - tmp &= 0xffffff00; \ - tmp |= d & 0xff; \ - *(GLuint *)(buf + _x*4 + _y*pitch) = tmp; \ -} - -#define READ_STENCIL( d, _x, _y ) \ - d = *(GLuint *)(buf + _x*4 + _y*pitch) & 0xff - -#define TAG(x) s3v##x##_24_8 -#include "stenciltmp.h" - -#endif - - -/** - * Plug in the Get/Put routines for the given driRenderbuffer. - */ -void -s3vSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis) -{ - if (drb->Base.InternalFormat == GL_RGBA) { - if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) { - s3vInitPointers_RGB555(&drb->Base); - } - else { - s3vInitPointers_ARGB8888(&drb->Base); - } - } - else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) { - s3vInitDepthPointers_z16(&drb->Base); - } - else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) { - /* not done yet */ - } - else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) { - /* not done yet */ - } -} diff --git a/src/mesa/drivers/dri/s3v/s3v_state.c b/src/mesa/drivers/dri/s3v/s3v_state.c deleted file mode 100644 index 561f42c705..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_state.c +++ /dev/null @@ -1,888 +0,0 @@ -/* - * Author: Max Lingua - */ - -#include "s3v_context.h" -#include "s3v_macros.h" -#include "s3v_dri.h" -#include "main/macros.h" -#include "main/colormac.h" -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "vbo/vbo.h" -#include "tnl/tnl.h" - -/* #define DEBUG(str) printf str */ -#define ENABLELIGHTING 0 - - -/* ============================================================= - * Alpha blending - */ - -static void s3vUpdateAlphaMode( GLcontext *ctx ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - uint32_t cmd = vmesa->CMD; - cmd &= ~ALPHA_BLEND_MASK; - - if ( ctx->Color.BlendEnabled ) { - DEBUG(("ctx->Color.AlphaEnabled = 1")); - vmesa->_alpha[0] = ALPHA_SRC; - vmesa->_alpha[1] = vmesa->_alpha_tex; /* FIXME: not all tex modes - support alpha */ - } else { - DEBUG(("ctx->Color.AlphaEnabled = 0")); - vmesa->_alpha[0] = vmesa->_alpha[1] = ALPHA_OFF; - } -#if 1 - if ((cmd & DO_MASK) & DO_3D_LINE) { /* we are drawing 3d lines */ - /* which don't support tex */ - cmd |= vmesa->_alpha[0]; - } else { - cmd |= vmesa->_alpha[vmesa->_3d_mode]; - } - - vmesa->CMD = cmd; /* FIXME: enough? */ -#else - vmesa->restore_primitive = -1; -#endif - -} - -static void s3vDDAlphaFunc( GLcontext *ctx, GLenum func, GLfloat ref ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - - DEBUG(("s3vDDAlphaFunc\n")); - - vmesa->new_state |= S3V_NEW_ALPHA; -} - -static void s3vDDBlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - - DEBUG(("s3vDDBlendFunc\n")); - - vmesa->new_state |= S3V_NEW_ALPHA; -} - -/* ================================================================ - * Buffer clear - */ - -static void s3vDDClear( GLcontext *ctx, GLbitfield mask ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - unsigned int _stride; - GLint cx = ctx->DrawBuffer->_Xmin; - GLint cy = ctx->DrawBuffer->_Ymin; - GLint cw = ctx->DrawBuffer->_Xmax - cx; - GLint ch = ctx->DrawBuffer->_Ymax - cy; - - /* XXX FIX ME: the cx,cy,cw,ch vars are currently ignored! */ - - vmesa->restore_primitive = -1; - - /* Update and emit any new state. We need to do this here to catch - * changes to the masks. - * FIXME: Just update the masks? - */ - - if ( vmesa->new_state ) - s3vDDUpdateHWState( ctx ); - -/* s3vUpdateMasks( ctx ); */ -/* s3vUpdateClipping( ctx ); */ -/* s3vEmitHwState( vmesa ); */ - - -#if 1 /* soft (0)/hw (1)*/ - - DEBUG(("*** s3vDDClear ***\n")); - - DMAOUT_CHECK(BITBLT_SRC_BASE, 15); - DMAOUT(vmesa->SrcBase); - DMAOUT(vmesa->DestBlit); - DMAOUT( vmesa->ScissorLR ); - DMAOUT( vmesa->ScissorTB ); - DMAOUT( (vmesa->SrcStride << 16) | vmesa->SrcStride ); /* FIXME: unify */ - DMAOUT( (~(0)) ); /* masks */ - DMAOUT( (~(0)) ); - DMAOUT(0); - DMAOUT(vmesa->ClearColor); - DMAOUT(0); - DMAOUT(0); - /* FIXME */ - DMAOUT(0x16000122 | 0x5 | (0xF0 << 17)); /* black magic to me */ - DMAOUT(vmesa->ScissorWH); - DMAOUT(vmesa->SrcXY); - DMAOUT(vmesa->DestXY); - DMAFINISH(); - - if (mask & BUFFER_BIT_DEPTH) { /* depth */ - DEBUG(("BUFFER_BIT_DEPTH\n")); - - _stride = ((cw+31)&~31) * 2; /* XXX cw or Buffer->Width??? */ - - DMAOUT_CHECK(BITBLT_SRC_BASE, 15); - DMAOUT(0); - DMAOUT(vmesa->s3vScreen->depthOffset); - DMAOUT( (0 << 16) | cw ); - DMAOUT( (0 << 16) | ch ); - DMAOUT( (vmesa->SrcStride << 16) | vmesa->DestStride ); - DMAOUT( (~(0)) ); /* masks */ - DMAOUT( (~(0)) ); - DMAOUT(0); - DMAOUT(vmesa->ClearDepth); /* 0x7FFF */ - /* FIXME */ - DMAOUT(0); - DMAOUT(0); - DMAOUT(0x16000122 | 0x5 | (0xF0 << 17)); - DMAOUT( ((cw-1) << 16) | (ch-1) ); - DMAOUT(0); - DMAOUT( (0 << 16) | 0 ); - DMAFINISH(); - - DEBUG(("vmesa->ClearDepth = 0x%x\n", vmesa->ClearDepth)); - mask &= ~BUFFER_BIT_DEPTH; - } - - if (!vmesa->NotClipped) { - DEBUG(("vmesa->NotClipped\n")); /* yes */ - } - - if (!(vmesa->EnabledFlags & S3V_BACK_BUFFER)) { - DEBUG(("!S3V_BACK_BUFFER -> flush\n")); - DMAFLUSH(); - } -/* - if ( mask ) - DEBUG(("still masked ;3(\n")); */ /* yes */ -#else - _swrast_Clear( ctx, mask ); -#endif -} - -/* ============================================================= - * Depth testing - */ - -static void s3vUpdateZMode( GLcontext *ctx ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - uint32_t cmd = vmesa->CMD; - - DEBUG(("Depth.Test = %i\n", ctx->Depth.Test)); - DEBUG(("CMD was = 0x%x ", cmd)); - -/* printf("depth --- CMD was = 0x%x \n", cmd); */ - - cmd &= ~Z_MASK; /* 0xfc0fffff; */ - /* Z_BUFFER */ /* 000 mode */ /* Z_UPDATE_OFF */ - - if (!ctx->Depth.Test) - cmd |= Z_OFF; - - if ( ctx->Depth.Mask ) - cmd |= Z_UPDATE_ON; - - switch ( ctx->Depth.Func ) { - case GL_NEVER: - cmd |= Z_NEVER; - break; - case GL_ALWAYS: - cmd |= Z_ALWAYS; - break; - case GL_LESS: - cmd |= Z_LESS; - break; - case GL_LEQUAL: - cmd |= Z_LEQUAL; - break; - case GL_EQUAL: - cmd |= Z_EQUAL; - break; - case GL_GEQUAL: - cmd |= Z_GEQUAL; - break; - case GL_GREATER: - cmd |= Z_GREATER; - break; - case GL_NOTEQUAL: - cmd |= Z_NOTEQUAL; - break; - } - - DEBUG(("CMD is 0x%x\n", cmd)); - - vmesa->dirty |= S3V_UPLOAD_DEPTH; - vmesa->CMD = cmd; -} - -static void s3vDDDepthFunc( GLcontext *ctx, GLenum func ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - -/* FLUSH_BATCH( vmesa ); */ - DEBUG(("s3vDDDepthFunc\n")); - vmesa->new_state |= S3V_NEW_DEPTH; -} - -static void s3vDDDepthMask( GLcontext *ctx, GLboolean flag ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - - /* FLUSH_BATCH( vmesa ); */ - DEBUG(("s3vDDDepthMask\n")); - vmesa->new_state |= S3V_NEW_DEPTH; -} - -static void s3vDDClearDepth( GLcontext *ctx, GLclampd d ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - - switch ( vmesa->DepthSize ) { - case 15: - case 16: - vmesa->ClearDepth = d * 0x0000ffff; /* 65536 */ - DEBUG(("GLclampd d = %f\n", d)); - DEBUG(("ctx->Depth.Clear = %f\n", ctx->Depth.Clear)); - DEBUG(("(They should be the same)\n")); - break; - case 24: - vmesa->ClearDepth = d * 0x00ffffff; - break; - case 32: - vmesa->ClearDepth = d * 0xffffffff; - break; - } -} - -static void s3vDDFinish( GLcontext *ctx ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - DMAFLUSH(); -} - -static void s3vDDFlush( GLcontext *ctx ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - DMAFLUSH(); -} - -/* ============================================================= - * Fog - */ - -static void s3vUpdateFogAttrib( GLcontext *ctx ) -{ -/* s3vContextPtr vmesa = S3V_CONTEXT(ctx); */ - - if (ctx->Fog.Enabled) { - } else { - } - - switch (ctx->Fog.Mode) { - case GL_LINEAR: - break; - case GL_EXP: - break; - case GL_EXP2: - break; - } -} - -static void s3vDDFogfv( GLcontext *ctx, GLenum pname, const GLfloat *param ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - vmesa->new_state |= S3V_NEW_FOG; -} - -/* ============================================================= - * Lines - */ -static void s3vDDLineWidth( GLcontext *ctx, GLfloat width ) -{ - /* FIXME: on virge you only have one size of 3d lines * - * if we wanted more, we should start using tris instead * - * but virge has problem with some tris when all of the * - * vertices stay on a line */ -} - -/* ============================================================= - * Points - */ -static void s3vDDPointSize( GLcontext *ctx, GLfloat size ) -{ - /* FIXME: we use 3d line to fake points. So same limitations - * as above apply */ -} - -/* ============================================================= - * Polygon - */ - -static void s3vUpdatePolygon( GLcontext *ctx ) -{ - /* FIXME: I don't think we could do much here */ - - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - vmesa->dirty |= S3V_UPLOAD_POLYGON; -} - -/* ============================================================= - * Clipping - */ - -static void s3vUpdateClipping( GLcontext *ctx ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - __DRIdrawablePrivate *dPriv = vmesa->driDrawable; - - int x0,y0,x1,y1; - - DEBUG((">>> s3vUpdateClipping <<<\n")); -/* - if ( vmesa->driDrawable ) { - DEBUG(("s3vUpdateClipping\n")); -*/ - if (vmesa->EnabledFlags & S3V_BACK_BUFFER) { - DEBUG(("S3V_BACK_BUFFER\n")); - - x0 = 0; - y0 = 0; - x1 = dPriv->w - 1; - y1 = dPriv->h - 1; - - vmesa->SrcBase = 0; - vmesa->DestBase = vmesa->s3vScreen->backOffset; - vmesa->DestBlit = vmesa->DestBase; - vmesa->ScissorLR = ( (0 << 16) | (dPriv->w-1) ); - vmesa->ScissorTB = ( (0 << 16) | (dPriv->h-1) ); -/* - vmesa->ScissorLR = ( (x0 << 16) | x1 ); - vmesa->ScissorTB = ( (y0 << 16) | y1 ); -*/ - vmesa->SrcStride = ( ((dPriv->w+31)&~31) * vmesa->s3vScreen->cpp ); - vmesa->DestStride = vmesa->driScreen->fbWidth*vmesa->s3vScreen->cpp; - vmesa->ScissorWH = ( (dPriv->w << 16) | dPriv->h ); - vmesa->SrcXY = 0; -/* vmesa->DestXY = ( (dPriv->x << 16) | dPriv->y ); */ - vmesa->DestXY = ( (0 << 16) | 0 ); - } else { - DEBUG(("S3V_FRONT_BUFFER\n")); - - x0 = dPriv->x; - y0 = dPriv->y; - x1 = x0 + dPriv->w - 1; - y1 = y0 + dPriv->h - 1; - - vmesa->SrcBase = 0; - vmesa->DestBase = 0; - vmesa->ScissorLR = ( (x0 << 16) | x1 ); - vmesa->ScissorTB = ( (y0 << 16) | y1 ); - vmesa->DestStride = vmesa->driScreen->fbWidth*vmesa->s3vScreen->cpp; - vmesa->SrcStride = vmesa->DestStride; - vmesa->DestBase = (y0 * vmesa->DestStride) - + x0*vmesa->s3vScreen->cpp; - vmesa->DestBlit = 0; - vmesa->ScissorWH = ( (x1 << 16) | y1 ); - vmesa->SrcXY = 0; - vmesa->DestXY = ( (0 << 16) | 0 ); -/* vmesa->DestXY = ( (dPriv->x << 16) | dPriv->y ); */ - } - - DEBUG(("x0=%i y0=%i x1=%i y1=%i\n", x0, y0, x1, y1)); - DEBUG(("stride=%i rectWH=0x%x\n\n", vmesa->DestStride, vmesa->ScissorWH)); - - /* FIXME: how could we use the following info? */ - /* if (ctx->Scissor.Enabled) {} */ - - vmesa->dirty |= S3V_UPLOAD_CLIP; -/* } */ -} - -static void s3vDDScissor( GLcontext *ctx, - GLint x, GLint y, GLsizei w, GLsizei h ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - - DEBUG((">>> s3vDDScissor <<<")); - /* FLUSH_BATCH( vmesa ); */ - vmesa->new_state |= S3V_NEW_CLIP; -} - -/* ============================================================= - * Culling - */ - -static void s3vUpdateCull( GLcontext *ctx ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - GLfloat backface_sign = 1; - - DEBUG(("s3vUpdateCull\n")); - /* FIXME: GL_FRONT_AND_BACK */ - - switch ( ctx->Polygon.CullFaceMode ) { - case GL_BACK: - if (ctx->Polygon.FrontFace == GL_CCW) - backface_sign = -1; - break; - - case GL_FRONT: - if (ctx->Polygon.FrontFace != GL_CCW) - backface_sign = -1; - break; - - default: - break; - } - - vmesa->backface_sign = backface_sign; - vmesa->dirty |= S3V_UPLOAD_GEOMETRY; -} - - -static void s3vDDCullFace( GLcontext *ctx, GLenum mode ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - /* FLUSH_BATCH( vmesa ); */ - vmesa->new_state |= S3V_NEW_CULL; -} - -static void s3vDDFrontFace( GLcontext *ctx, GLenum mode ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - /* FLUSH_BATCH( vmesa ); */ - vmesa->new_state |= S3V_NEW_CULL; -} - -/* ============================================================= - * Masks - */ - -static void s3vUpdateMasks( GLcontext *ctx ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - - GLuint mask = s3vPackColor( vmesa->s3vScreen->cpp, - ctx->Color.ColorMask[RCOMP], - ctx->Color.ColorMask[GCOMP], - ctx->Color.ColorMask[BCOMP], - ctx->Color.ColorMask[ACOMP] ); - - if (vmesa->s3vScreen->cpp == 2) mask |= mask << 16; - - /* FIXME: can we do something in virge? */ -} -/* -static void s3vDDColorMask( GLcontext *ctx, GLboolean r, GLboolean g, - GLboolean b, GLboolean a) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - - FLUSH_BATCH( vmesa ); - vmesa->new_state |= S3V_NEW_MASKS; -} -*/ -/* ============================================================= - * Rendering attributes - */ - -/* ============================================================= - * Miscellaneous - */ - -static void s3vDDClearColor( GLcontext *ctx, const GLfloat color[4]) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - - DEBUG(("*** s3vDDClearColor\n")); - - vmesa->ClearColor = s3vPackColor( 2, /* vmesa->s3vScreen->cpp, */ - color[0], color[1], color[2], color[3] ); - -#if 0 - if (vmesa->s3vScreen->cpp == 2) vmesa->ClearColor |= vmesa->ClearColor<<16; -#endif -} - -static void s3vDDSetDrawBuffer( GLcontext *ctx, GLenum mode ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - int found = GL_TRUE; - - DEBUG(("*** s3vDDSetDrawBuffer ***\n")); - - /* FLUSH_BATCH( vmesa ); */ - - switch ( mode ) { - case GL_FRONT_LEFT: - vmesa->drawOffset = vmesa->s3vScreen->frontOffset; - break; - case GL_BACK_LEFT: - vmesa->drawOffset = vmesa->s3vScreen->backOffset; - /* vmesa->driScreen->fbHeight * - * vmesa->driScreen->fbWidth * - * vmesa->s3vScreen->cpp; */ - break; - default: - found = GL_FALSE; - break; - } - - DEBUG(("vmesa->drawOffset = 0x%x\n", vmesa->drawOffset)); -/* return GL_TRUE; */ -} - -/* ============================================================= - * Window position and viewport transformation - */ - -void s3vUpdateWindow( GLcontext *ctx ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - __DRIdrawablePrivate *dPriv = vmesa->driDrawable; - GLfloat xoffset = (GLfloat)dPriv->x; - GLfloat yoffset = - vmesa->driScreen->fbHeight - (GLfloat)dPriv->y - dPriv->h; - const GLfloat *v = ctx->Viewport._WindowMap.m; - - GLfloat sx = v[MAT_SX]; - GLfloat tx = v[MAT_TX] + xoffset; - GLfloat sy = v[MAT_SY]; - GLfloat ty = v[MAT_TY] + yoffset; - GLfloat sz = v[MAT_SZ] * vmesa->depth_scale; - GLfloat tz = v[MAT_TZ] * vmesa->depth_scale; - - vmesa->dirty |= S3V_UPLOAD_VIEWPORT; - - vmesa->ViewportScaleX = sx; - vmesa->ViewportScaleY = sy; - vmesa->ViewportScaleZ = sz; - vmesa->ViewportOffsetX = tx; - vmesa->ViewportOffsetY = ty; - vmesa->ViewportOffsetZ = tz; -} - - -/* -static void s3vDDViewport( GLcontext *ctx, GLint x, GLint y, - GLsizei width, GLsizei height ) -{ - s3vUpdateWindow( ctx ); -} - -static void s3vDDDepthRange( GLcontext *ctx, GLclampd nearval, - GLclampd farval ) -{ - s3vUpdateWindow( ctx ); -} -*/ -void s3vUpdateViewportOffset( GLcontext *ctx ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - __DRIdrawablePrivate *dPriv = vmesa->driDrawable; - GLfloat xoffset = (GLfloat)dPriv->x; - GLfloat yoffset = - vmesa->driScreen->fbHeight - (GLfloat)dPriv->y - dPriv->h; - const GLfloat *v = ctx->Viewport._WindowMap.m; - - GLfloat tx = v[MAT_TX] + xoffset; - GLfloat ty = v[MAT_TY] + yoffset; - - DEBUG(("*** s3vUpdateViewportOffset ***\n")); - - if ( vmesa->ViewportOffsetX != tx || - vmesa->ViewportOffsetY != ty ) - { - vmesa->ViewportOffsetX = tx; - vmesa->ViewportOffsetY = ty; - - vmesa->new_state |= S3V_NEW_WINDOW; - } - -/* vmesa->new_state |= S3V_NEW_CLIP; */ -} - -/* ============================================================= - * State enable/disable - */ - -static void s3vDDEnable( GLcontext *ctx, GLenum cap, GLboolean state ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - - switch ( cap ) { - case GL_ALPHA_TEST: - case GL_BLEND: - vmesa->new_state |= S3V_NEW_ALPHA; - DEBUG(("s3vDDEnable: GL_BLEND\n")); - break; - - case GL_CULL_FACE: - vmesa->new_state |= S3V_NEW_CULL; - DEBUG(("s3vDDEnable: GL_CULL_FACE\n")); - break; - - case GL_DEPTH_TEST: - vmesa->new_state |= S3V_NEW_DEPTH; - DEBUG(("s3vDDEnable: GL_DEPTH\n")); - break; -#if 0 - case GL_FOG: - vmesa->new_state |= S3V_NEW_FOG; - break; -#endif - - case GL_SCISSOR_TEST: - vmesa->new_state |= S3V_NEW_CLIP; - break; - - case GL_TEXTURE_2D: - DEBUG(("*** GL_TEXTURE_2D: %i\n", state)); - vmesa->_3d_mode = state; - vmesa->restore_primitive = -1; - break; - - default: - return; - } -} - -/* ============================================================= - * State initialization, management - */ - - -/* - * Load the current context's state into the hardware. - * - * NOTE: Be VERY careful about ensuring the context state is marked for - * upload, the only place it shouldn't be uploaded is when the setup - * state has changed in ReducedPrimitiveChange as this comes right after - * a state update. - * - * Blits of any type should always upload the context and masks after - * they are done. - */ -void s3vEmitHwState( s3vContextPtr vmesa ) -{ - if (!vmesa->driDrawable) return; - if (!vmesa->dirty) return; - - DEBUG(("**********************\n")); - DEBUG(("*** s3vEmitHwState ***\n")); - DEBUG(("**********************\n")); - - if (vmesa->dirty & S3V_UPLOAD_VIEWPORT) { - vmesa->dirty &= ~S3V_UPLOAD_VIEWPORT; - DEBUG(("S3V_UPLOAD_VIEWPORT\n")); - } - - if ( (vmesa->dirty & S3V_UPLOAD_POINTMODE) || - (vmesa->dirty & S3V_UPLOAD_LINEMODE) || - (vmesa->dirty & S3V_UPLOAD_TRIMODE) ) { - - } - - if (vmesa->dirty & S3V_UPLOAD_POINTMODE) { - vmesa->dirty &= ~S3V_UPLOAD_POINTMODE; - } - - if (vmesa->dirty & S3V_UPLOAD_LINEMODE) { - vmesa->dirty &= ~S3V_UPLOAD_LINEMODE; - } - - if (vmesa->dirty & S3V_UPLOAD_TRIMODE) { - vmesa->dirty &= ~S3V_UPLOAD_TRIMODE; - } - - if (vmesa->dirty & S3V_UPLOAD_FOG) { - GLchan c[3], col; - UNCLAMPED_FLOAT_TO_RGB_CHAN( c, vmesa->glCtx->Fog.Color ); - DEBUG(("uploading ** FOG **\n")); - col = s3vPackColor(2, c[0], c[1], c[2], 0); - vmesa->dirty &= ~S3V_UPLOAD_FOG; - } - - if (vmesa->dirty & S3V_UPLOAD_DITHER) { - vmesa->dirty &= ~S3V_UPLOAD_DITHER; - } - - if (vmesa->dirty & S3V_UPLOAD_LOGICOP) { - vmesa->dirty &= ~S3V_UPLOAD_LOGICOP; - } - - if (vmesa->dirty & S3V_UPLOAD_CLIP) { - vmesa->dirty &= ~S3V_UPLOAD_CLIP; - DEBUG(("S3V_UPLOAD_CLIP\n")); - DEBUG(("vmesa->ScissorLR: %i\n", vmesa->ScissorLR)); - DEBUG(("vmesa->ScissorTB: %i\n", vmesa->ScissorTB)); - } - - if (vmesa->dirty & S3V_UPLOAD_MASKS) { - vmesa->dirty &= ~S3V_UPLOAD_MASKS; - DEBUG(("S3V_UPLOAD_BLEND\n")); - } - - if (vmesa->dirty & S3V_UPLOAD_ALPHA) { - vmesa->dirty &= ~S3V_UPLOAD_ALPHA; - DEBUG(("S3V_UPLOAD_ALPHA\n")); - } - - if (vmesa->dirty & S3V_UPLOAD_SHADE) { - vmesa->dirty &= ~S3V_UPLOAD_SHADE; - } - - if (vmesa->dirty & S3V_UPLOAD_POLYGON) { - vmesa->dirty &= ~S3V_UPLOAD_POLYGON; - } - - if (vmesa->dirty & S3V_UPLOAD_DEPTH) { - vmesa->dirty &= ~S3V_UPLOAD_DEPTH; - DEBUG(("S3V_UPLOAD_DEPTH: DepthMode = 0x%x08\n", vmesa->DepthMode)); - } - - if (vmesa->dirty & S3V_UPLOAD_GEOMETRY) { - vmesa->dirty &= ~S3V_UPLOAD_GEOMETRY; - } - - if (vmesa->dirty & S3V_UPLOAD_TRANSFORM) { - vmesa->dirty &= ~S3V_UPLOAD_TRANSFORM; - } - - if (vmesa->dirty & S3V_UPLOAD_TEX0) { - s3vTextureObjectPtr curTex = vmesa->CurrentTexObj[0]; - vmesa->dirty &= ~S3V_UPLOAD_TEX0; - DEBUG(("S3V_UPLOAD_TEX0\n")); - if (curTex) { - DEBUG(("S3V_UPLOAD_TEX0: curTex\n")); - } else { - DEBUG(("S3V_UPLOAD_TEX0: !curTex\n")); - } - } -} - -void s3vDDUpdateHWState( GLcontext *ctx ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - - int new_state = vmesa->new_state; - - /* s3vUpdateClipping( ctx ); */ - - if ( new_state ) - { - - vmesa->new_state = 0; - - /* Update the various parts of the context's state. - */ - if ( new_state & S3V_NEW_ALPHA ) - s3vUpdateAlphaMode( ctx ); - - if ( new_state & S3V_NEW_DEPTH ) - s3vUpdateZMode( ctx ); - - if ( new_state & S3V_NEW_FOG ) - s3vUpdateFogAttrib( ctx ); - - if ( new_state & S3V_NEW_CLIP ) - { - DEBUG(("---> going to s3vUpdateClipping\n")); - s3vUpdateClipping( ctx ); - } - - if ( new_state & S3V_NEW_POLYGON ) - s3vUpdatePolygon( ctx ); - - if ( new_state & S3V_NEW_CULL ) - s3vUpdateCull( ctx ); - - if ( new_state & S3V_NEW_MASKS ) - s3vUpdateMasks( ctx ); - - if ( new_state & S3V_NEW_WINDOW ) - s3vUpdateWindow( ctx ); -/* - if ( new_state & S3_NEW_TEXTURE ) - s3vUpdateTextureState( ctx ); -*/ - CMDCHANGE(); - } - - /* HACK ! */ - s3vEmitHwState( vmesa ); -} - - -static void s3vDDUpdateState( GLcontext *ctx, GLuint new_state ) -{ - _swrast_InvalidateState( ctx, new_state ); - _swsetup_InvalidateState( ctx, new_state ); - _vbo_InvalidateState( ctx, new_state ); - _tnl_InvalidateState( ctx, new_state ); - S3V_CONTEXT(ctx)->new_gl_state |= new_state; -} - - -/* Initialize the context's hardware state. - */ -void s3vInitState( s3vContextPtr vmesa ) -{ - vmesa->new_state = 0; -} - -/* Initialize the driver's state functions. - */ -void s3vInitStateFuncs( GLcontext *ctx ) -{ - ctx->Driver.UpdateState = s3vDDUpdateState; - - ctx->Driver.Clear = s3vDDClear; - ctx->Driver.ClearIndex = NULL; - ctx->Driver.ClearColor = s3vDDClearColor; - ctx->Driver.DrawBuffer = s3vDDSetDrawBuffer; - ctx->Driver.ReadBuffer = NULL; /* XXX */ - - ctx->Driver.IndexMask = NULL; - ctx->Driver.ColorMask = NULL; /* s3vDDColorMask; */ /* FIXME */ - - ctx->Driver.AlphaFunc = s3vDDAlphaFunc; /* FIXME */ -#if 0 - ctx->Driver.BlendEquation = NULL; /* s3vDDBlendEquation; */ - ctx->Driver.BlendFunc = s3vDDBlendFunc; /* FIXME */ -#endif - ctx->Driver.BlendFuncSeparate = NULL; /* s3vDDBlendFuncSeparate; */ - ctx->Driver.ClearDepth = s3vDDClearDepth; - ctx->Driver.CullFace = s3vDDCullFace; - ctx->Driver.FrontFace = s3vDDFrontFace; - ctx->Driver.DepthFunc = s3vDDDepthFunc; /* FIXME */ - ctx->Driver.DepthMask = s3vDDDepthMask; /* FIXME */ - ctx->Driver.DepthRange = NULL; /* s3vDDDepthRange; */ - ctx->Driver.Enable = s3vDDEnable; /* FIXME */ - ctx->Driver.Finish = s3vDDFinish; - ctx->Driver.Flush = s3vDDFlush; -#if 1 - ctx->Driver.Fogfv = NULL; /* s3vDDFogfv; */ -#endif - ctx->Driver.Hint = NULL; - ctx->Driver.LineWidth = NULL; /* s3vDDLineWidth; */ - ctx->Driver.LineStipple = NULL; /* s3vDDLineStipple; */ -#if ENABLELIGHTING - ctx->Driver.Lightfv = NULL; /* s3vDDLightfv; */ - - ctx->Driver.LightModelfv = NULL; /* s3vDDLightModelfv; */ -#endif - ctx->Driver.LogicOpcode = NULL; /* s3vDDLogicalOpcode; */ - ctx->Driver.PointSize = NULL; /* s3vDDPointSize; */ - ctx->Driver.PolygonMode = NULL; /* s3vDDPolygonMode; */ - ctx->Driver.PolygonStipple = NULL; /* s3vDDPolygonStipple; */ - ctx->Driver.Scissor = s3vDDScissor; /* ScissorLR / ScissorTB */ - ctx->Driver.ShadeModel = NULL; /* s3vDDShadeModel; */ - ctx->Driver.Viewport = NULL; /* s3vDDViewport; */ -} diff --git a/src/mesa/drivers/dri/s3v/s3v_tex.c b/src/mesa/drivers/dri/s3v/s3v_tex.c deleted file mode 100644 index ec1182f34f..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_tex.c +++ /dev/null @@ -1,548 +0,0 @@ -/* - * Author: Max Lingua - */ - -#include -#include - -#include "main/glheader.h" -#include "main/mtypes.h" -#include "main/simple_list.h" -#include "main/enums.h" -#include "main/mm.h" -#include "main/texstore.h" -#include "main/texformat.h" -#include "main/teximage.h" -#include "swrast/swrast.h" - -#include "s3v_context.h" -#include "s3v_tex.h" - - -extern void s3vSwapOutTexObj(s3vContextPtr vmesa, s3vTextureObjectPtr t); -extern void s3vDestroyTexObj(s3vContextPtr vmesa, s3vTextureObjectPtr t); - -/* -static GLuint s3vComputeLodBias(GLfloat bias) -{ -#if TEX_DEBUG_ON - DEBUG_TEX(("*** s3vComputeLodBias ***\n")); -#endif - return bias; -} -*/ - -static void s3vSetTexWrapping(s3vContextPtr vmesa, - s3vTextureObjectPtr t, - GLenum wraps, GLenum wrapt) -{ - GLuint t0 = t->TextureCMD; - GLuint cmd = vmesa->CMD; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vSetTexWrapping: #%i ***\n", ++times)); -#endif - - - t0 &= ~TEX_WRAP_MASK; - cmd &= ~TEX_WRAP_MASK; - - if ((wraps != GL_CLAMP) || (wrapt != GL_CLAMP)) { - DEBUG(("TEX_WRAP_ON\n")); - t0 |= TEX_WRAP_ON; - cmd |= TEX_WRAP_ON; - } - - cmd |= TEX_WRAP_ON; /* FIXME: broken if off */ - t->TextureCMD = t0; - vmesa->CMD = cmd; -} - - -static void s3vSetTexFilter(s3vContextPtr vmesa, - s3vTextureObjectPtr t, - GLenum minf, GLenum magf) -{ - GLuint t0 = t->TextureCMD; - GLuint cmd = vmesa->CMD; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vSetTexFilter: #%i ***\n", ++times)); -#endif - - t0 &= ~TEX_FILTER_MASK; - cmd &= ~TEX_FILTER_MASK; - - switch (minf) { - case GL_NEAREST: - DEBUG(("GL_NEAREST\n")); - t0 |= NEAREST; - cmd |= NEAREST; - break; - case GL_LINEAR: - DEBUG(("GL_LINEAR\n")); - t0 |= LINEAR; - cmd |= LINEAR; - break; - case GL_NEAREST_MIPMAP_NEAREST: - DEBUG(("GL_MIPMAP_NEAREST\n")); - t0 |= MIP_NEAREST; - cmd |= MIP_NEAREST; - break; - case GL_LINEAR_MIPMAP_NEAREST: - DEBUG(("GL_LINEAR_MIPMAP_NEAREST\n")); - t0 |= LINEAR_MIP_NEAREST; - cmd |= LINEAR_MIP_NEAREST; - break; - case GL_NEAREST_MIPMAP_LINEAR: - DEBUG(("GL_NEAREST_MIPMAP_LINEAR\n")); - t0 |= MIP_LINEAR; - cmd |= MIP_LINEAR; - break; - case GL_LINEAR_MIPMAP_LINEAR: - DEBUG(("GL_LINEAR_MIPMAP_LINEAR\n")); - t0 |= LINEAR_MIP_LINEAR; - cmd |= LINEAR_MIP_LINEAR; - break; - default: - break; - } - /* FIXME: bilinear? */ - -#if 0 - switch (magf) { - case GL_NEAREST: - break; - case GL_LINEAR: - break; - default: - break; - } -#endif - - t->TextureCMD = t0; - - DEBUG(("CMD was = 0x%x\n", vmesa->CMD)); - DEBUG(("CMD is = 0x%x\n", cmd)); - - vmesa->CMD = cmd; - /* CMDCHANGE(); */ -} - - -static void s3vSetTexBorderColor(s3vContextPtr vmesa, - s3vTextureObjectPtr t, - const GLfloat color[4]) -{ - GLubyte c[4]; - CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]); - CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]); - CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]); - CLAMPED_FLOAT_TO_UBYTE(c[3], color[3]); - -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vSetTexBorderColor: #%i ***\n", ++times)); -#endif - - /*FIXME: it should depend on tex col format */ - /* switch(t0 ... t->TextureColorMode) */ - - /* case TEX_COL_ARGB1555: */ - t->TextureBorderColor = S3VIRGEPACKCOLOR555(c[0], c[1], c[2], c[3]); - - DEBUG(("TextureBorderColor = 0x%x\n", t->TextureBorderColor)); - - vmesa->TextureBorderColor = t->TextureBorderColor; -} - -static void s3vTexParameter( GLcontext *ctx, GLenum target, - struct gl_texture_object *tObj, - GLenum pname, const GLfloat *params ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - s3vTextureObjectPtr t = (s3vTextureObjectPtr) tObj->DriverData; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vTexParameter: #%i ***\n", ++times)); -#endif - - if (!t) return; - - /* Can't do the update now as we don't know whether to flush - * vertices or not. Setting vmesa->new_state means that - * s3vUpdateTextureState() will be called before any triangles are - * rendered. If a statechange has occurred, it will be detected at - * that point, and buffered vertices flushed. - */ - switch (pname) { - case GL_TEXTURE_MIN_FILTER: - case GL_TEXTURE_MAG_FILTER: - s3vSetTexFilter( vmesa, t, tObj->MinFilter, tObj->MagFilter ); - break; - - case GL_TEXTURE_WRAP_S: - case GL_TEXTURE_WRAP_T: - s3vSetTexWrapping( vmesa, t, tObj->WrapS, tObj->WrapT ); - break; - - case GL_TEXTURE_BORDER_COLOR: - s3vSetTexBorderColor( vmesa, t, tObj->BorderColor ); - break; - - case GL_TEXTURE_BASE_LEVEL: - case GL_TEXTURE_MAX_LEVEL: - case GL_TEXTURE_MIN_LOD: - case GL_TEXTURE_MAX_LOD: - /* This isn't the most efficient solution but there doesn't appear to - * be a nice alternative for Virge. Since there's no LOD clamping, - * we just have to rely on loading the right subset of mipmap levels - * to simulate a clamped LOD. - */ - s3vSwapOutTexObj( vmesa, t ); - break; - - default: - return; - } - - if (t == vmesa->CurrentTexObj[0]) - vmesa->dirty |= S3V_UPLOAD_TEX0; - -#if 0 - if (t == vmesa->CurrentTexObj[1]) { - vmesa->dirty |= S3V_UPLOAD_TEX1; - } -#endif -} - - -static void s3vTexEnv( GLcontext *ctx, GLenum target, - GLenum pname, const GLfloat *param ) -{ - s3vContextPtr vmesa = S3V_CONTEXT( ctx ); - GLuint unit = ctx->Texture.CurrentUnit; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vTexEnv: #%i ***\n", ++times)); -#endif - - /* Only one env color. Need a fallback if env colors are different - * and texture setup references env color in both units. - */ - switch (pname) { - case GL_TEXTURE_ENV_COLOR: { - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - GLfloat *fc = texUnit->EnvColor; - GLuint r, g, b, a, col; - CLAMPED_FLOAT_TO_UBYTE(r, fc[0]); - CLAMPED_FLOAT_TO_UBYTE(g, fc[1]); - CLAMPED_FLOAT_TO_UBYTE(b, fc[2]); - CLAMPED_FLOAT_TO_UBYTE(a, fc[3]); - - col = ((a << 24) | - (r << 16) | - (g << 8) | - (b << 0)); - - break; - } - case GL_TEXTURE_ENV_MODE: - vmesa->TexEnvImageFmt[unit] = 0; /* force recalc of env state */ - break; - case GL_TEXTURE_LOD_BIAS_EXT: { -/* - struct gl_texture_object *tObj = - ctx->Texture.Unit[unit]._Current; - - s3vTextureObjectPtr t = (s3vTextureObjectPtr) tObj->DriverData; -*/ - break; - } - default: - break; - } -} - -static void s3vTexImage1D( GLcontext *ctx, GLenum target, GLint level, - GLint internalFormat, - GLint width, GLint border, - GLenum format, GLenum type, - const GLvoid *pixels, - const struct gl_pixelstore_attrib *pack, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ) -{ - s3vContextPtr vmesa = S3V_CONTEXT( ctx ); - s3vTextureObjectPtr t = (s3vTextureObjectPtr) texObj->DriverData; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vTexImage1D: #%i ***\n", ++times)); -#endif - -#if 1 - if (t) { -#if _TEXFLUSH - DMAFLUSH(); -#endif - s3vSwapOutTexObj( vmesa, t ); -/* - s3vDestroyTexObj( vmesa, t ); - texObj->DriverData = 0; -*/ - } -#endif - _mesa_store_teximage1d( ctx, target, level, internalFormat, - width, border, format, type, - pixels, pack, texObj, texImage ); -} - -static void s3vTexSubImage1D( GLcontext *ctx, - GLenum target, - GLint level, - GLint xoffset, - GLsizei width, - GLenum format, GLenum type, - const GLvoid *pixels, - const struct gl_pixelstore_attrib *pack, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ) -{ - s3vContextPtr vmesa = S3V_CONTEXT( ctx ); - s3vTextureObjectPtr t = (s3vTextureObjectPtr) texObj->DriverData; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vTexSubImage1D: #%i ***\n", ++times)); -#endif - -#if 1 - if (t) { -#if _TEXFLUSH - DMAFLUSH(); -#endif - s3vSwapOutTexObj( vmesa, t ); -/* - s3vDestroyTexObj( vmesa, t ); - texObj->DriverData = 0; -*/ - } -#endif - _mesa_store_texsubimage1d(ctx, target, level, xoffset, width, - format, type, pixels, pack, texObj, - texImage); -} - -static void s3vTexImage2D( GLcontext *ctx, GLenum target, GLint level, - GLint internalFormat, - GLint width, GLint height, GLint border, - GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ) -{ - s3vContextPtr vmesa = S3V_CONTEXT( ctx ); - s3vTextureObjectPtr t = (s3vTextureObjectPtr) texObj->DriverData; - -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vTexImage2D: #%i ***\n", ++times)); -#endif - -#if 1 - if (t) { -#if _TEXFLUSH - DMAFLUSH(); -#endif - s3vSwapOutTexObj( vmesa, t ); -/* - s3vDestroyTexObj( vmesa, t ); - texObj->DriverData = 0; -*/ - } -#endif - _mesa_store_teximage2d( ctx, target, level, internalFormat, - width, height, border, format, type, - pixels, packing, texObj, texImage ); -} - -static void s3vTexSubImage2D( GLcontext *ctx, - GLenum target, - GLint level, - GLint xoffset, GLint yoffset, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ) -{ - s3vContextPtr vmesa = S3V_CONTEXT( ctx ); - s3vTextureObjectPtr t = (s3vTextureObjectPtr) texObj->DriverData; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vTexSubImage2D: #%i ***\n", ++times)); -#endif - -#if 1 - if (t) { -#if _TEXFLUSH - DMAFLUSH(); -#endif - s3vSwapOutTexObj( vmesa, t ); -/* - s3vDestroyTexObj( vmesa, t ); - texObj->DriverData = 0; -*/ - } -#endif - _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width, - height, format, type, pixels, packing, texObj, - texImage); -} - - -static void s3vBindTexture( GLcontext *ctx, GLenum target, - struct gl_texture_object *tObj ) -{ - s3vContextPtr vmesa = S3V_CONTEXT( ctx ); - s3vTextureObjectPtr t = (s3vTextureObjectPtr) tObj->DriverData; - GLuint cmd = vmesa->CMD; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vBindTexture: #%i ***\n", ++times)); -#endif - - if (!t) { -/* - GLfloat bias = ctx->Texture.Unit[ctx->Texture.CurrentUnit].LodBias; -*/ - t = CALLOC_STRUCT(s3v_texture_object_t); - - /* Initialize non-image-dependent parts of the state: - */ - t->globj = tObj; -#if 0 - if (target == GL_TEXTURE_2D) { - } else - if (target == GL_TEXTURE_1D) { - } - -#if X_BYTE_ORDER == X_LITTLE_ENDIAN - t->TextureFormat = (TF_LittleEndian | -#else - t->TextureFormat = (TF_BigEndian | -#endif -#endif - t->dirty_images = ~0; - - tObj->DriverData = t; - make_empty_list( t ); -#if 0 - s3vSetTexWrapping( vmesa, t, tObj->WrapS, tObj->WrapT ); - s3vSetTexFilter( vmesa, t, tObj->MinFilter, tObj->MagFilter ); - s3vSetTexBorderColor( vmesa, t, tObj->BorderColor ); -#endif - } - - cmd = vmesa->CMD & ~MIP_MASK; - vmesa->dirty |= S3V_UPLOAD_TEX0; - vmesa->TexOffset = t->TextureBaseAddr[tObj->BaseLevel]; - vmesa->TexStride = t->Pitch; - cmd |= MIPMAP_LEVEL(t->WidthLog2); - vmesa->CMD = cmd; - vmesa->restore_primitive = -1; -#if 0 - printf("t->TextureBaseAddr[0] = 0x%x\n", t->TextureBaseAddr[0]); - printf("t->TextureBaseAddr[1] = 0x%x\n", t->TextureBaseAddr[1]); - printf("t->TextureBaseAddr[2] = 0x%x\n", t->TextureBaseAddr[2]); -#endif -} - - -static void s3vDeleteTexture( GLcontext *ctx, struct gl_texture_object *tObj ) -{ - s3vTextureObjectPtr t = (s3vTextureObjectPtr)tObj->DriverData; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vDeleteTexture: #%i ***\n", ++times)); -#endif - - if (t) { - s3vContextPtr vmesa = S3V_CONTEXT( ctx ); - -#if _TEXFLUSH - if (vmesa) { - DMAFLUSH(); - } -#endif - - s3vDestroyTexObj( vmesa, t ); - tObj->DriverData = 0; - - } -} - -static GLboolean s3vIsTextureResident( GLcontext *ctx, - struct gl_texture_object *tObj ) -{ - s3vTextureObjectPtr t = (s3vTextureObjectPtr)tObj->DriverData; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vIsTextureResident: #%i ***\n", ++times)); -#endif - - return (t && t->MemBlock); -} - -static void s3vInitTextureObjects( GLcontext *ctx ) -{ - /* s3vContextPtr vmesa = S3V_CONTEXT(ctx); */ - struct gl_texture_object *texObj; - GLuint tmp = ctx->Texture.CurrentUnit; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vInitTextureObjects: #%i ***\n", ++times)); -#endif - -#if 1 - ctx->Texture.CurrentUnit = 0; - - texObj = ctx->Texture.Unit[0].CurrentTex[TEXTURE_1D_INDEX]; - s3vBindTexture( ctx, GL_TEXTURE_1D, texObj ); - - texObj = ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; - s3vBindTexture( ctx, GL_TEXTURE_2D, texObj ); -#endif - -#if 0 - ctx->Texture.CurrentUnit = 1; - - texObj = ctx->Texture.Unit[1].CurrentTex[TEXTURE_1D_INDEX]; - s3vBindTexture( ctx, GL_TEXTURE_1D, texObj ); - - texObj = ctx->Texture.Unit[1].CurrentTex[TEXTURE_2D_INDEX]; - s3vBindTexture( ctx, GL_TEXTURE_2D, texObj ); -#endif - - ctx->Texture.CurrentUnit = tmp; -} - - -void s3vInitTextureFuncs( GLcontext *ctx ) -{ -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vInitTextureFuncs: #%i ***\n", ++times)); -#endif - - ctx->Driver.TexEnv = s3vTexEnv; - ctx->Driver.TexImage2D = s3vTexImage2D; - ctx->Driver.TexSubImage2D = s3vTexSubImage2D; - ctx->Driver.BindTexture = s3vBindTexture; - ctx->Driver.DeleteTexture = s3vDeleteTexture; - ctx->Driver.TexParameter = s3vTexParameter; - ctx->Driver.UpdateTexturePalette = 0; - ctx->Driver.IsTextureResident = s3vIsTextureResident; - - s3vInitTextureObjects( ctx ); -} diff --git a/src/mesa/drivers/dri/s3v/s3v_tex.h b/src/mesa/drivers/dri/s3v/s3v_tex.h deleted file mode 100644 index a823fe2453..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_tex.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Author: Max Lingua - */ - -#ifndef _S3V_TEX_H -#define _S3V_TEX_H - -#define TEX_DEBUG_ON 0 - -extern void s3vUpdateTexLRU( s3vContextPtr vmesa, s3vTextureObjectPtr t ); - -#if TEX_DEBUG_ON -#define DEBUG_TEX(str) printf str -#else -#define DEBUG_TEX(str) /* str */ -#endif - -#define _TEXFLUSH 1 /* flush before uploading */ -#define _TEXLOCK 1 /* lock before writing new texures to card mem */ - /* if you turn it on you will gain stability and image - quality, but you will loose performance (~10%) */ -#define _TEXFALLBACK 0 /* fallback to software for -big- textures (slow) */ - /* turning this off, you will lose some tex (e.g. mountains - on tuxracer) but you will increase average playability */ - -#define _TEXALIGN 0x00000007 - -#endif diff --git a/src/mesa/drivers/dri/s3v/s3v_texmem.c b/src/mesa/drivers/dri/s3v/s3v_texmem.c deleted file mode 100644 index 705d105f55..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_texmem.c +++ /dev/null @@ -1,582 +0,0 @@ -/* - * Author: Max Lingua - */ - -#include -#include - -#include "main/glheader.h" -#include "main/macros.h" -#include "main/mtypes.h" -#include "main/simple_list.h" -#include "main/enums.h" - -#include "main/mm.h" -#include "s3v_context.h" -#include "s3v_lock.h" -#include "s3v_tex.h" - -void s3vSwapOutTexObj(s3vContextPtr vmesa, s3vTextureObjectPtr t); -void s3vUpdateTexLRU( s3vContextPtr vmesa, s3vTextureObjectPtr t ); - - -void s3vDestroyTexObj(s3vContextPtr vmesa, s3vTextureObjectPtr t) -{ -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vDestroyTexObj: #%i ***\n", ++times)); -#endif - - if (!t) return; - -/* FIXME: useful? */ -#if _TEXFLUSH - if (vmesa) - DMAFLUSH(); -#endif - - /* This is sad - need to sync *in case* we upload a texture - * to this newly free memory... - */ - if (t->MemBlock) { - mmFreeMem(t->MemBlock); - t->MemBlock = 0; - - if (vmesa && t->age > vmesa->dirtyAge) - vmesa->dirtyAge = t->age; - } - - if (t->globj) - t->globj->DriverData = NULL; - - if (vmesa) { - if (vmesa->CurrentTexObj[0] == t) { - vmesa->CurrentTexObj[0] = 0; - vmesa->dirty &= ~S3V_UPLOAD_TEX0; - } - -#if 0 - if (vmesa->CurrentTexObj[1] == t) { - vmesa->CurrentTexObj[1] = 0; - vmesa->dirty &= ~S3V_UPLOAD_TEX1; - } -#endif - } - - remove_from_list(t); - FREE(t); -} - - -void s3vSwapOutTexObj(s3vContextPtr vmesa, s3vTextureObjectPtr t) -{ -/* int i; */ -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vSwapOutTexObj: #%i ***\n", ++times)); -#endif - - if (t->MemBlock) { - - mmFreeMem(t->MemBlock); - t->MemBlock = 0; - - if (t->age > vmesa->dirtyAge) - vmesa->dirtyAge = t->age; - - t->dirty_images = ~0; - move_to_tail(&(vmesa->SwappedOut), t); - } -} - - -/* Upload an image from mesa's internal copy. - */ - -static void s3vUploadTexLevel( s3vContextPtr vmesa, s3vTextureObjectPtr t, - int level ) -{ - __DRIscreenPrivate *sPriv = vmesa->driScreen; - const struct gl_texture_image *image = t->image[level].image; - int i,j; - int l2d; - /* int offset = 0; */ - int words; - GLuint* dest; -#if TEX_DEBUG_ON - static unsigned int times=0; -#endif - if ( !image ) return; - if (image->Data == 0) return; - - DEBUG_TEX(("*** s3vUploadTexLevel: #%i ***\n", ++times)); - DEBUG_TEX(("level = %i\n", level)); - - l2d = 5; /* 32bits per texel == 1<<5 */ -/* - if (level == 0) - ; -*/ - DEBUG_TEX(("t->image[%i].offset = 0x%x\n", - level, t->image[level].offset)); - - t->TextureBaseAddr[level] = (GLuint)(t->BufAddr + t->image[level].offset - + _TEXALIGN) & (GLuint)(~_TEXALIGN); - dest = (GLuint*)(sPriv->pFB + t->TextureBaseAddr[level]); - - DEBUG_TEX(("sPriv->pFB = 0x%x\n", sPriv->pFB)); - DEBUG_TEX(("dest = 0x%x\n", dest)); - DEBUG_TEX(("dest - sPriv->pFB = 0x%x\n", ((int)dest - (int)sPriv->pFB))); - - /* NOTE: we implicitly suppose t->texelBytes == 2 */ - - words = (image->Width * image->Height) >> 1; - - DEBUG_TEX(("\n\n")); - - switch (t->image[level].internalFormat) { - case GL_RGB: - case 3: - { - GLubyte *src = (GLubyte *)image->Data; - - DEBUG_TEX(("GL_RGB:\n")); -/* - if (level == 0) - ; -*/ - /* The UGLY way, and SLOW : use DMA FIXME ! */ - - for (i = 0; i < words; i++) { - unsigned int data; - /* data = PACK_COLOR_565(src[0],src[1],src[2]); */ - data = S3VIRGEPACKCOLOR555(src[0],src[1],src[2],255) - |(S3VIRGEPACKCOLOR555(src[3],src[4],src[5],255)<<16); - - *dest++ = data; - /* src += 3; */ - src +=6; - } - } - break; - - case GL_RGBA: - case 4: - { - GLubyte *src = (GLubyte *)image->Data; - - DEBUG_TEX(("GL_RGBA:\n")); -/* - if (level == 0) - ; -*/ - for (i = 0; i < words; i++) { - unsigned int data; - - /* data = PACK_COLOR_8888(src[0],src[1],src[2],src[3]); */ - data = S3VIRGEPACKCOLOR4444(src[0], src[1],src[2], src[3]) - | (S3VIRGEPACKCOLOR4444(src[4], src[5], src[6], src[7]) << 16); - - *dest++ = data; - /* src += 4; */ - src += 8; - } - } - break; - - case GL_LUMINANCE: - { - GLubyte *src = (GLubyte *)image->Data; - - DEBUG_TEX(("GL_LUMINANCE:\n")); -/* - if (level == 0) - ; -*/ - for (i = 0; i < words; i++) { - unsigned int data; - - /* data = PACK_COLOR_888(src[0],src[0],src[0]); */ - data = S3VIRGEPACKCOLOR4444(src[0],src[0],src[0],src[0]) - | (S3VIRGEPACKCOLOR4444(src[1],src[1],src[1],src[1]) << 16); - - *dest++ = data; - /* src ++; */ - src +=2; - } - } - break; - - case GL_INTENSITY: - { - GLubyte *src = (GLubyte *)image->Data; - - DEBUG_TEX(("GL_INTENSITY:\n")); -/* - if (level == 0) - ; -*/ - for (i = 0; i < words; i++) { - unsigned int data; - - /* data = PACK_COLOR_8888(src[0],src[0],src[0],src[0]); */ - data = S3VIRGEPACKCOLOR4444(src[0],src[0],src[0],src[0]) - | (S3VIRGEPACKCOLOR4444(src[1],src[1],src[1],src[1]) << 16); - - *dest++ = data; - /* src ++; */ - src += 2; - } - } - break; - - case GL_LUMINANCE_ALPHA: - { - GLubyte *src = (GLubyte *)image->Data; - - DEBUG_TEX(("GL_LUMINANCE_ALPHA:\n")); -/* - if (level == 0) - ; -*/ - for (i = 0; i < words; i++) { - unsigned int data; - - /* data = PACK_COLOR_8888(src[0],src[0],src[0],src[1]); */ - data = S3VIRGEPACKCOLOR4444(src[0],src[0],src[0],src[1]) - | (S3VIRGEPACKCOLOR4444(src[2],src[2],src[2],src[3]) << 16); - - *dest++ = data; - /* src += 2; */ - src += 4; - } - } - break; - - case GL_ALPHA: - { - GLubyte *src = (GLubyte *)image->Data; - - DEBUG_TEX(("GL_ALPHA:\n")); -/* - if (level == 0) - ; -*/ - for (i = 0; i < words; i++) { - unsigned int data; - - /* data = PACK_COLOR_8888(255,255,255,src[0]); */ - data = S3VIRGEPACKCOLOR4444(255,255,255,src[0]) - | (S3VIRGEPACKCOLOR4444(255,255,255,src[1]) << 16); - - *dest++ = data; - /* src += 1; */ - src += 2; - } - } - break; - - /* TODO: Translate color indices *now*: - */ - case GL_COLOR_INDEX: - { - - GLubyte *dst = (GLubyte *)(t->BufAddr + t->image[level].offset); - GLubyte *src = (GLubyte *)image->Data; - - DEBUG_TEX(("GL_COLOR_INDEX:\n")); - - for (j = 0 ; j < image->Height ; j++, dst += t->Pitch) { - for (i = 0 ; i < image->Width ; i++) { - dst[i] = src[0]; - src += 1; - } - } - } - break; - - default: - fprintf(stderr, "Not supported texture format %s\n", - _mesa_lookup_enum_by_nr(image->_BaseFormat)); - } - - DEBUG_TEX(("words = %i\n\n", words)); -} - -void s3vPrintLocalLRU( s3vContextPtr vmesa ) -{ - s3vTextureObjectPtr t; - int sz = 1 << (vmesa->s3vScreen->logTextureGranularity); - -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vPrintLocalLRU: #%i ***\n", ++times)); -#endif - - foreach( t, &vmesa->TexObjList ) { - if (!t->globj) - fprintf(stderr, "Placeholder %d at %x sz %x\n", - t->MemBlock->ofs / sz, - t->MemBlock->ofs, - t->MemBlock->size); - else - fprintf(stderr, "Texture at %x sz %x\n", - t->MemBlock->ofs, - t->MemBlock->size); - - } -} - -void s3vPrintGlobalLRU( s3vContextPtr vmesa ) -{ - int i, j; - S3VTexRegionPtr list = vmesa->sarea->texList; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vPrintGlobalLRU: #%i ***\n", ++times)); -#endif - - for (i = 0, j = S3V_NR_TEX_REGIONS ; i < S3V_NR_TEX_REGIONS ; i++) { - fprintf(stderr, "list[%d] age %d next %d prev %d\n", - j, list[j].age, list[j].next, list[j].prev); - j = list[j].next; - if (j == S3V_NR_TEX_REGIONS) break; - } - - if (j != S3V_NR_TEX_REGIONS) - fprintf(stderr, "Loop detected in global LRU\n"); -} - - -void s3vResetGlobalLRU( s3vContextPtr vmesa ) -{ - S3VTexRegionPtr list = vmesa->sarea->texList; - int sz = 1 << vmesa->s3vScreen->logTextureGranularity; - int i; - -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vResetGlobalLRU: #%i ***\n", ++times)); -#endif - - /* (Re)initialize the global circular LRU list. The last element - * in the array (S3V_NR_TEX_REGIONS) is the sentinal. Keeping it - * at the end of the array allows it to be addressed rationally - * when looking up objects at a particular location in texture - * memory. - */ - for (i = 0 ; (i+1) * sz <= vmesa->s3vScreen->textureSize ; i++) { - list[i].prev = i-1; - list[i].next = i+1; - list[i].age = 0; - } - - i--; - list[0].prev = S3V_NR_TEX_REGIONS; - list[i].prev = i-1; - list[i].next = S3V_NR_TEX_REGIONS; - list[S3V_NR_TEX_REGIONS].prev = i; - list[S3V_NR_TEX_REGIONS].next = 0; - vmesa->sarea->texAge = 0; -} - - -void s3vUpdateTexLRU( s3vContextPtr vmesa, s3vTextureObjectPtr t ) -{ -/* - int i; - int logsz = vmesa->s3vScreen->logTextureGranularity; - int start = t->MemBlock->ofs >> logsz; - int end = (t->MemBlock->ofs + t->MemBlock->size - 1) >> logsz; - S3VTexRegionPtr list = vmesa->sarea->texList; -*/ - -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vUpdateTexLRU: #%i ***\n", ++times)); -#endif - - vmesa->texAge = ++vmesa->sarea->texAge; - - /* Update our local LRU - */ - move_to_head( &(vmesa->TexObjList), t ); - - /* Update the global LRU - */ -#if 0 - for (i = start ; i <= end ; i++) { - - list[i].in_use = 1; - list[i].age = vmesa->texAge; - - /* remove_from_list(i) - */ - list[(unsigned)list[i].next].prev = list[i].prev; - list[(unsigned)list[i].prev].next = list[i].next; - - /* insert_at_head(list, i) - */ - list[i].prev = S3V_NR_TEX_REGIONS; - list[i].next = list[S3V_NR_TEX_REGIONS].next; - list[(unsigned)list[S3V_NR_TEX_REGIONS].next].prev = i; - list[S3V_NR_TEX_REGIONS].next = i; - } -#endif -} - - -/* Called for every shared texture region which has increased in age - * since we last held the lock. - * - * Figures out which of our textures have been ejected by other clients, - * and pushes a placeholder texture onto the LRU list to represent - * the other client's textures. - */ -void s3vTexturesGone( s3vContextPtr vmesa, - GLuint offset, - GLuint size, - GLuint in_use ) -{ - s3vTextureObjectPtr t, tmp; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vTexturesGone: #%i ***\n", ++times)); -#endif - - foreach_s ( t, tmp, &vmesa->TexObjList ) { - - if (t->MemBlock->ofs >= offset + size || - t->MemBlock->ofs + t->MemBlock->size <= offset) - continue; - - /* It overlaps - kick it off. Need to hold onto the currently bound - * objects, however. - */ - s3vSwapOutTexObj( vmesa, t ); - } - - if (in_use) { - t = (s3vTextureObjectPtr) calloc(1,sizeof(*t)); - if (!t) return; - - t->MemBlock = mmAllocMem( vmesa->texHeap, size, 0, offset); - insert_at_head( &vmesa->TexObjList, t ); - } - - /* Reload any lost textures referenced by current vertex buffer. - */ -#if 0 - if (vmesa->vertex_buffer) { - int i, j; - - fprintf(stderr, "\n\nreload tex\n"); - - for (i = 0 ; i < vmesa->statenr ; i++) { - for (j = 0 ; j < 2 ; j++) { - s3vTextureObjectPtr t = vmesa->state_tex[j][i]; - if (t) { - if (t->MemBlock == 0) - s3vUploadTexImages( vmesa, t ); - } - } - } - - /* Hard to do this with the lock held: - */ - /* S3V_FIREVERTICES( vmesa ); */ - } -#endif -} - - -/* This is called with the lock held. May have to eject our own and/or - * other client's texture objects to make room for the upload. - */ -void s3vUploadTexImages( s3vContextPtr vmesa, s3vTextureObjectPtr t ) -{ - int i; - int ofs; - int numLevels; -#if TEX_DEBUG_ON - static unsigned int times=0; - static unsigned int try=0; - - DEBUG_TEX(("*** s3vUploadTexImages: #%i ***\n", ++times)); - DEBUG_TEX(("vmesa->texHeap = 0x%x; t->totalSize = %i\n", - (unsigned int)vmesa->texHeap, t->totalSize)); -#endif - - /* Do we need to eject LRU texture objects? - */ - if (!t->MemBlock) { - - while (1) - { - /* int try = 0; */ - DEBUG_TEX(("trying to alloc mem for tex (try %i)\n", ++try)); - - t->MemBlock = mmAllocMem( vmesa->texHeap, t->totalSize, 12, 0 ); - - if (t->MemBlock) - break; - - if (vmesa->TexObjList.prev == vmesa->CurrentTexObj[0]) { -/* || vmesa->TexObjList.prev == vmesa->CurrentTexObj[1]) { - fprintf(stderr, "Hit bound texture in upload\n"); - s3vPrintLocalLRU( vmesa ); */ - return; - } - - if (vmesa->TexObjList.prev == &(vmesa->TexObjList)) { -/* fprintf(stderr, "Failed to upload texture, sz %d\n", - t->totalSize); - mmDumpMemInfo( vmesa->texHeap ); */ - return; - } - - DEBUG_TEX(("swapping out: %p\n", vmesa->TexObjList.prev)); - s3vSwapOutTexObj( vmesa, vmesa->TexObjList.prev ); - } - - ofs = t->MemBlock->ofs; - - t->BufAddr = vmesa->s3vScreen->texOffset + ofs; - - DEBUG_TEX(("ofs = 0x%x\n", ofs)); - DEBUG_TEX(("t->BufAddr = 0x%x\n", t->BufAddr)); - -/* FIXME: check if we need it */ -#if 0 - if (t == vmesa->CurrentTexObj[0]) { - vmesa->dirty |= S3V_UPLOAD_TEX0; - vmesa->restore_primitive = -1; - } -#endif - -#if 0 - if (t == vmesa->CurrentTexObj[1]) - vmesa->dirty |= S3V_UPLOAD_TEX1; -#endif - - s3vUpdateTexLRU( vmesa, t ); - } - -#if 0 - if (vmesa->dirtyAge >= GET_DISPATCH_AGE(vmesa)) - s3vWaitAgeLocked( vmesa, vmesa->dirtyAge ); -#endif - -#if _TEXLOCK - S3V_SIMPLE_FLUSH_LOCK(vmesa); -#endif - numLevels = t->lastLevel - t->firstLevel + 1; - for (i = 0 ; i < numLevels ; i++) - if (t->dirty_images & (1<dirty_images = 0; -#if _TEXLOCK - S3V_SIMPLE_UNLOCK(vmesa); -#endif -} diff --git a/src/mesa/drivers/dri/s3v/s3v_texstate.c b/src/mesa/drivers/dri/s3v/s3v_texstate.c deleted file mode 100644 index 455bae6301..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_texstate.c +++ /dev/null @@ -1,300 +0,0 @@ -/* - * Author: Max Lingua - */ - -#include -#include - -#include "main/glheader.h" -#include "main/macros.h" -#include "main/mtypes.h" -#include "main/simple_list.h" -#include "main/enums.h" - -#include "main/mm.h" -#include "s3v_context.h" -#include "s3v_tex.h" - - -static void s3vSetTexImages( s3vContextPtr vmesa, - struct gl_texture_object *tObj ) -{ - GLuint height, width, pitch, i, /*textureFormat,*/ log_pitch; - s3vTextureObjectPtr t = (s3vTextureObjectPtr) tObj->DriverData; - const struct gl_texture_image *baseImage = tObj->Image[0][tObj->BaseLevel]; - GLint firstLevel, lastLevel, numLevels; - GLint log2Width, log2Height; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vSetTexImages: #%i ***\n", ++times)); -#endif - - t->texelBytes = 2; /* FIXME: always 2 ? */ - - /* Compute which mipmap levels we really want to send to the hardware. - * This depends on the base image size, GL_TEXTURE_MIN_LOD, - * GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL, and GL_TEXTURE_MAX_LEVEL. - * Yes, this looks overly complicated, but it's all needed. - */ - if (tObj->MinFilter == GL_LINEAR || tObj->MinFilter == GL_NEAREST) { - firstLevel = lastLevel = tObj->BaseLevel; - } - else { - firstLevel = tObj->BaseLevel + (GLint) (tObj->MinLod + 0.5); - firstLevel = MAX2(firstLevel, tObj->BaseLevel); - lastLevel = tObj->BaseLevel + (GLint) (tObj->MaxLod + 0.5); - lastLevel = MAX2(lastLevel, tObj->BaseLevel); - lastLevel = MIN2(lastLevel, tObj->BaseLevel + baseImage->MaxLog2); - lastLevel = MIN2(lastLevel, tObj->MaxLevel); - lastLevel = MAX2(firstLevel, lastLevel); /* need at least one level */ - } - - /* save these values */ - t->firstLevel = firstLevel; - t->lastLevel = lastLevel; - - numLevels = lastLevel - firstLevel + 1; - - log2Width = tObj->Image[0][firstLevel]->WidthLog2; - log2Height = tObj->Image[0][firstLevel]->HeightLog2; - - - /* Figure out the amount of memory required to hold all the mipmap - * levels. Choose the smallest pitch to accomodate the largest - * mipmap: - */ - width = tObj->Image[0][firstLevel]->Width * t->texelBytes; - for (pitch = 32, log_pitch=2 ; pitch < width ; pitch *= 2 ) - log_pitch++; - - /* All images must be loaded at this pitch. Count the number of - * lines required: - */ - for ( height = i = 0 ; i < numLevels ; i++ ) { - t->image[i].image = tObj->Image[0][firstLevel + i]; - t->image[i].offset = height * pitch; - t->image[i].internalFormat = baseImage->_BaseFormat; - height += t->image[i].image->Height; - t->TextureBaseAddr[i] = (t->BufAddr + t->image[i].offset + - _TEXALIGN) & (GLuint)(~_TEXALIGN); - } - - t->Pitch = pitch; - t->WidthLog2 = log2Width; - t->totalSize = height*pitch; - t->max_level = i-1; - vmesa->dirty |= S3V_UPLOAD_TEX0 /* | S3V_UPLOAD_TEX1*/; - vmesa->restore_primitive = -1; - DEBUG(("<><>pitch = TexStride = %i\n", pitch)); - DEBUG(("log2Width = %i\n", log2Width)); - - s3vUploadTexImages( vmesa, t ); -} - -static void s3vUpdateTexEnv( GLcontext *ctx, GLuint unit ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - const struct gl_texture_object *tObj = texUnit->_Current; - const GLuint format = tObj->Image[0][tObj->BaseLevel]->_BaseFormat; -/* - s3vTextureObjectPtr t = (s3vTextureObjectPtr)tObj->DriverData; - GLuint tc; -*/ - GLuint alpha = 0; - GLuint cmd = vmesa->CMD; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vUpdateTexEnv: %i ***\n", ++times)); -#endif - - cmd &= ~TEX_COL_MASK; - cmd &= ~TEX_BLEND_MAKS; -/* cmd &= ~ALPHA_BLEND_MASK; */ - - DEBUG(("format = ")); - - switch (format) { - case GL_RGB: - DEBUG_TEX(("GL_RGB\n")); - cmd |= TEX_COL_ARGB1555; - break; - case GL_LUMINANCE: - DEBUG_TEX(("GL_LUMINANCE\n")); - cmd |= TEX_COL_ARGB4444; - alpha = 1; /* FIXME: check */ - break; - case GL_ALPHA: - DEBUG_TEX(("GL_ALPHA\n")); - cmd |= TEX_COL_ARGB4444; - alpha = 1; - break; - case GL_LUMINANCE_ALPHA: - DEBUG_TEX(("GL_LUMINANCE_ALPHA\n")); - cmd |= TEX_COL_ARGB4444; - alpha = 1; - break; - case GL_INTENSITY: - DEBUG_TEX(("GL_INTENSITY\n")); - cmd |= TEX_COL_ARGB4444; - alpha = 1; - break; - case GL_RGBA: - DEBUG_TEX(("GL_RGBA\n")); - cmd |= TEX_COL_ARGB4444; - alpha = 1; - break; - case GL_COLOR_INDEX: - DEBUG_TEX(("GL_COLOR_INDEX\n")); - cmd |= TEX_COL_PAL; - break; - } - - DEBUG_TEX(("EnvMode = ")); - - switch (texUnit->EnvMode) { - case GL_REPLACE: - DEBUG_TEX(("GL_REPLACE\n")); - cmd |= TEX_REFLECT; /* FIXME */ - vmesa->_tri[1] = DO_TEX_UNLIT_TRI; /* FIXME: white tri hack */ - vmesa->_alpha_tex = ALPHA_TEX /* * alpha */; - break; - case GL_MODULATE: - DEBUG_TEX(("GL_MODULATE\n")); - cmd |= TEX_MODULATE; - vmesa->_tri[1] = DO_TEX_LIT_TRI; -#if 0 - if (alpha) - vmesa->_alpha_tex = ALPHA_TEX /* * alpha */; - else - vmesa->_alpha_tex = ALPHA_SRC /* * alpha */; -#else - vmesa->_alpha_tex = ALPHA_TEX ; -#endif - break; - case GL_ADD: - DEBUG_TEX(("DEBUG_TEX\n")); - /* do nothing ???*/ - break; - case GL_DECAL: - DEBUG_TEX(("GL_DECAL\n")); - cmd |= TEX_DECAL; - vmesa->_tri[1] = DO_TEX_LIT_TRI; - vmesa->_alpha_tex = ALPHA_OFF; - break; - case GL_BLEND: - DEBUG_TEX(("GL_BLEND\n")); - cmd |= TEX_DECAL; - vmesa->_tri[1] = DO_TEX_LIT_TRI; - vmesa->_alpha_tex = ALPHA_OFF; /* FIXME: sure? */ - break; - default: - fprintf(stderr, "unknown tex env mode"); - return; - } - - DEBUG_TEX(("\n\n vmesa->CMD was 0x%x\n", vmesa->CMD)); - DEBUG_TEX(( " vmesa->CMD is 0x%x\n\n", cmd )); - - vmesa->_alpha[1] = vmesa->_alpha_tex; - vmesa->CMD = cmd; /* | MIPMAP_LEVEL(8); */ - vmesa->restore_primitive = -1; -} - -static void s3vUpdateTexUnit( GLcontext *ctx, GLuint unit ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - GLuint cmd = vmesa->CMD; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vUpdateTexUnit: %i ***\n", ++times)); - DEBUG_TEX(("and vmesa->CMD was 0x%x\n", vmesa->CMD)); -#endif - - if (texUnit->_ReallyEnabled == TEXTURE_2D_BIT) - { - struct gl_texture_object *tObj = texUnit->_Current; - s3vTextureObjectPtr t = (s3vTextureObjectPtr)tObj->DriverData; - - /* Upload teximages (not pipelined) - */ - if (t->dirty_images) { -#if _TEXFLUSH - DMAFLUSH(); -#endif - s3vSetTexImages( vmesa, tObj ); - if (!t->MemBlock) { -#if _TEXFALLBACK - FALLBACK( vmesa, S3V_FALLBACK_TEXTURE, GL_TRUE ); -#endif - return; - } - } - - /* Update state if this is a different texture object to last - * time. - */ -#if 1 - if (vmesa->CurrentTexObj[unit] != t) { - vmesa->dirty |= S3V_UPLOAD_TEX0 /* << unit */; - vmesa->CurrentTexObj[unit] = t; - s3vUpdateTexLRU( vmesa, t ); /* done too often */ - } -#endif - - /* Update texture environment if texture object image format or - * texture environment state has changed. - */ - if (tObj->Image[0][tObj->BaseLevel]->_BaseFormat != - vmesa->TexEnvImageFmt[unit]) { - vmesa->TexEnvImageFmt[unit] = tObj->Image[0][tObj->BaseLevel]->_BaseFormat; - s3vUpdateTexEnv( ctx, unit ); - } -#if 1 - cmd = vmesa->CMD & ~MIP_MASK; - vmesa->dirty |= S3V_UPLOAD_TEX0 /* << unit */; - vmesa->CurrentTexObj[unit] = t; - vmesa->TexOffset = t->TextureBaseAddr[tObj->BaseLevel]; - vmesa->TexStride = t->Pitch; - cmd |= MIPMAP_LEVEL(t->WidthLog2); - - DEBUG_TEX(("\n\n>> vmesa->CMD was 0x%x\n", vmesa->CMD)); - DEBUG_TEX(( ">> vmesa->CMD is 0x%x\n\n", cmd )); - DEBUG_TEX(("t->WidthLog2 = %i\n", t->WidthLog2)); - DEBUG_TEX(("MIPMAP_LEVEL(t->WidthLog2) = 0x%x\n", MIPMAP_LEVEL(t->WidthLog2))); - - vmesa->CMD = cmd; - vmesa->restore_primitive = -1; -#endif - } - else if (texUnit->_ReallyEnabled) { /* _ReallyEnabled but != TEXTURE0_2D */ -#if _TEXFALLBACK - FALLBACK( vmesa, S3V_FALLBACK_TEXTURE, GL_TRUE ); -#endif - } - else /*if (vmesa->CurrentTexObj[unit])*/ { /* !_ReallyEnabled */ - vmesa->CurrentTexObj[unit] = 0; - vmesa->TexEnvImageFmt[unit] = 0; - vmesa->dirty &= ~(S3V_UPLOAD_TEX0< - */ - -#include -#include - -#include - -#include "s3v_context.h" -#include "s3v_vb.h" -#include "s3v_tris.h" - -#include "main/glheader.h" -#include "main/mtypes.h" -#include "main/macros.h" -#include "main/colormac.h" - -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "tnl/tnl.h" -#include "tnl/t_context.h" -#include "tnl/t_pipeline.h" - - -/*********************************************************************** - * Build hardware rasterization functions * - ***********************************************************************/ - -#define DO_TRI 1 -#define HAVE_RGBA 1 -#define HAVE_SPEC 0 -#define HAVE_BACK_COLORS 0 -#define HAVE_HW_FLATSHADE 1 -#define VERTEX s3vVertex -#define TAB rast_tab - -#define VERT_SET_RGBA( v, c ) \ -do { \ - UNCLAMPED_FLOAT_TO_RGBA_CHAN( v->ub4[4], c); \ -/* *(v->ub4[4]) = c; \ */ \ -} while (0) -#define VERT_COPY_RGBA( v0, v1 ) v0->ui[4] = v1->ui[4] -/* -#define VERT_COPY_RGBA1( v0, v1 ) v0->ui[4] = v1->ui[4] -*/ -#define VERT_SAVE_RGBA( idx ) color[idx] = v[idx]->ui[4] -#define VERT_RESTORE_RGBA( idx ) v[idx]->ui[4] = color[idx] - -#define S3V_OFFSET_BIT 0x01 -#define S3V_TWOSIDE_BIT 0x02 -#define S3V_UNFILLED_BIT 0x04 -#define S3V_FALLBACK_BIT 0x08 -#define S3V_MAX_TRIFUNC 0x10 - - -static struct { - tnl_points_func points; - tnl_line_func line; - tnl_triangle_func triangle; - tnl_quad_func quad; -} rast_tab[S3V_MAX_TRIFUNC]; - -#define S3V_RAST_CULL_BIT 0x01 -#define S3V_RAST_FLAT_BIT 0x02 -#define S3V_RAST_TEX_BIT 0x04 - -static s3v_point_func s3v_point_tab[0x8]; -static s3v_line_func s3v_line_tab[0x8]; -static s3v_tri_func s3v_tri_tab[0x8]; -static s3v_quad_func s3v_quad_tab[0x8]; - -#define IND (0) -#define TAG(x) x -#include "s3v_tritmp.h" - -#define IND (S3V_RAST_CULL_BIT) -#define TAG(x) x##_cull -#include "s3v_tritmp.h" - -#define IND (S3V_RAST_FLAT_BIT) -#define TAG(x) x##_flat -#include "s3v_tritmp.h" - -#define IND (S3V_RAST_CULL_BIT|S3V_RAST_FLAT_BIT) -#define TAG(x) x##_cull_flat -#include "s3v_tritmp.h" - -#define IND (S3V_RAST_TEX_BIT) -#define TAG(x) x##_tex -#include "s3v_tritmp.h" - -#define IND (S3V_RAST_CULL_BIT|S3V_RAST_TEX_BIT) -#define TAG(x) x##_cull_tex -#include "s3v_tritmp.h" - -#define IND (S3V_RAST_FLAT_BIT|S3V_RAST_TEX_BIT) -#define TAG(x) x##_flat_tex -#include "s3v_tritmp.h" - -#define IND (S3V_RAST_CULL_BIT|S3V_RAST_FLAT_BIT|S3V_RAST_TEX_BIT) -#define TAG(x) x##_cull_flat_tex -#include "s3v_tritmp.h" - -static void init_rast_tab( void ) -{ - DEBUG(("*** init_rast_tab ***\n")); - - s3v_init(); - s3v_init_cull(); - s3v_init_flat(); - s3v_init_cull_flat(); - s3v_init_tex(); - s3v_init_cull_tex(); - s3v_init_flat_tex(); - s3v_init_cull_flat_tex(); -} - -/*********************************************************************** - * Rasterization fallback helpers * - ***********************************************************************/ - - -/* This code is hit only when a mix of accelerated and unaccelerated - * primitives are being drawn, and only for the unaccelerated - * primitives. - */ - -#if 0 -static void -s3v_fallback_quad( s3vContextPtr vmesa, - const s3vVertex *v0, - const s3vVertex *v1, - const s3vVertex *v2, - const s3vVertex *v3 ) -{ - GLcontext *ctx = vmesa->glCtx; - SWvertex v[4]; - s3v_translate_vertex( ctx, v0, &v[0] ); - s3v_translate_vertex( ctx, v1, &v[1] ); - s3v_translate_vertex( ctx, v2, &v[2] ); - s3v_translate_vertex( ctx, v3, &v[3] ); - DEBUG(("s3v_fallback_quad\n")); -/* _swrast_Quad( ctx, &v[0], &v[1], &v[2], &v[3] ); */ -} - -static void -s3v_fallback_tri( s3vContextPtr vmesa, - const s3vVertex *v0, - const s3vVertex *v1, - const s3vVertex *v2 ) -{ - GLcontext *ctx = vmesa->glCtx; - SWvertex v[3]; - s3v_translate_vertex( ctx, v0, &v[0] ); - s3v_translate_vertex( ctx, v1, &v[1] ); - s3v_translate_vertex( ctx, v2, &v[2] ); - DEBUG(("s3v_fallback_tri\n")); -/* _swrast_Triangle( ctx, &v[0], &v[1], &v[2] ); */ -} - -static void -s3v_fallback_line( s3vContextPtr vmesa, - const s3vVertex *v0, - const s3vVertex *v1 ) -{ - GLcontext *ctx = vmesa->glCtx; - SWvertex v[2]; - s3v_translate_vertex( ctx, v0, &v[0] ); - s3v_translate_vertex( ctx, v1, &v[1] ); - DEBUG(("s3v_fallback_line\n")); - _swrast_Line( ctx, &v[0], &v[1] ); -} - -/* -static void -s3v_fallback_point( s3vContextPtr vmesa, - const s3vVertex *v0 ) -{ - GLcontext *ctx = vmesa->glCtx; - SWvertex v[1]; - s3v_translate_vertex( ctx, v0, &v[0] ); - _swrast_Point( ctx, &v[0] ); -} -*/ -#endif - -/*********************************************************************** - * Choose rasterization functions * - ***********************************************************************/ - -#define _S3V_NEW_RASTER_STATE (_NEW_FOG | \ - _NEW_TEXTURE | \ - _DD_NEW_TRI_SMOOTH | \ - _DD_NEW_LINE_SMOOTH | \ - _DD_NEW_POINT_SMOOTH | \ - _DD_NEW_TRI_STIPPLE | \ - _DD_NEW_LINE_STIPPLE) - -#define LINE_FALLBACK (0) -#define TRI_FALLBACK (0) - -static void s3v_nodraw_triangle(GLcontext *ctx, s3vVertex *v0, - s3vVertex *v1, s3vVertex *v2) -{ - (void) (ctx && v0 && v1 && v2); -} - -static void s3v_nodraw_quad(GLcontext *ctx, - s3vVertex *v0, s3vVertex *v1, - s3vVertex *v2, s3vVertex *v3) -{ - (void) (ctx && v0 && v1 && v2 && v3); -} - -void s3vChooseRasterState(GLcontext *ctx); - -void s3vChooseRasterState(GLcontext *ctx) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - GLuint flags = ctx->_TriangleCaps; - GLuint ind = 0; - - DEBUG(("*** s3vChooseRasterState ***\n")); - - if (ctx->Polygon.CullFlag) { - if (ctx->Polygon.CullFaceMode == GL_FRONT_AND_BACK) { - vmesa->draw_tri = (s3v_tri_func)s3v_nodraw_triangle; - vmesa->draw_quad = (s3v_quad_func)s3v_nodraw_quad; - return; - } - ind |= S3V_RAST_CULL_BIT; - /* s3v_update_cullsign(ctx); */ - } /* else vmesa->backface_sign = 0; */ - - if ( flags & DD_FLATSHADE ) - ind |= S3V_RAST_FLAT_BIT; - - if ( ctx->Texture.Unit[0]._ReallyEnabled ) { - ind |= S3V_RAST_TEX_BIT; - } - - DEBUG(("ind = %i\n", ind)); - - vmesa->draw_line = s3v_line_tab[ind]; - vmesa->draw_tri = s3v_tri_tab[ind]; - vmesa->draw_quad = s3v_quad_tab[ind]; - vmesa->draw_point = s3v_point_tab[ind]; - -#if 0 - /* Hook in fallbacks for specific primitives. CURRENTLY DISABLED - */ - - if (flags & LINE_FALLBACK) - vmesa->draw_line = s3v_fallback_line; - - if (flags & TRI_FALLBACK) { - DEBUG(("TRI_FALLBACK\n")); - vmesa->draw_tri = s3v_fallback_tri; - vmesa->draw_quad = s3v_fallback_quad; - } -#endif -} - - - - -/*********************************************************************** - * Macros for t_dd_tritmp.h to draw basic primitives * - ***********************************************************************/ - -#define TRI( v0, v1, v2 ) \ -do { \ - /* - if (DO_FALLBACK) \ - vmesa->draw_tri( vmesa, v0, v1, v2 ); \ - else */ \ - DEBUG(("TRI: max was here\n")); /* \ - s3v_draw_tex_triangle( vmesa, v0, v1, v2 ); */ \ - vmesa->draw_tri( vmesa, v0, v1, v2 ); \ -} while (0) - -#define QUAD( v0, v1, v2, v3 ) \ -do { \ - DEBUG(("QUAD: max was here\n")); \ - vmesa->draw_quad( vmesa, v0, v1, v2, v3 ); \ -} while (0) - -#define LINE( v0, v1 ) \ -do { \ - DEBUG(("LINE: max was here\n")); \ - vmesa->draw_line( vmesa, v0, v1 ); \ -} while (0) - -#define POINT( v0 ) \ -do { \ - vmesa->draw_point( vmesa, v0 ); \ -} while (0) - - -/*********************************************************************** - * Build render functions from dd templates * - ***********************************************************************/ - -/* -#define S3V_OFFSET_BIT 0x01 -#define S3V_TWOSIDE_BIT 0x02 -#define S3V_UNFILLED_BIT 0x04 -#define S3V_FALLBACK_BIT 0x08 -#define S3V_MAX_TRIFUNC 0x10 - - -static struct { - points_func points; - line_func line; - triangle_func triangle; - quad_func quad; -} rast_tab[S3V_MAX_TRIFUNC]; -*/ - -#define DO_FALLBACK (IND & S3V_FALLBACK_BIT) -#define DO_OFFSET (IND & S3V_OFFSET_BIT) -#define DO_UNFILLED (IND & S3V_UNFILLED_BIT) -#define DO_TWOSIDE (IND & S3V_TWOSIDE_BIT) -#define DO_FLAT 0 -#define DO_TRI 1 -#define DO_QUAD 1 -#define DO_LINE 1 -#define DO_POINTS 1 -#define DO_FULL_QUAD 1 - -#define HAVE_RGBA 1 -#define HAVE_SPEC 0 -#define HAVE_BACK_COLORS 0 -#define HAVE_HW_FLATSHADE 1 -#define VERTEX s3vVertex -#define TAB rast_tab - -#define DEPTH_SCALE 1.0 -#define UNFILLED_TRI unfilled_tri -#define UNFILLED_QUAD unfilled_quad -#define VERT_X(_v) _v->v.x -#define VERT_Y(_v) _v->v.y -#define VERT_Z(_v) _v->v.z -#define AREA_IS_CCW( a ) (a > 0) -#define GET_VERTEX(e) (vmesa->verts + (e<vertex_stride_shift)) - -#if 0 -#define VERT_SET_RGBA( v, c ) \ -do { \ -/* UNCLAMPED_FLOAT_TO_RGBA_CHAN( v->ub4[4], c) */ \ -} while (0) - -#define VERT_COPY_RGBA( v0, v1 ) v0->ui[4] = v1->ui[4] -/* -#define VERT_COPY_RGBA1( v0, v1 ) v0->ui[4] = v1->ui[4] -*/ -#define VERT_SAVE_RGBA( idx ) color[idx] = v[idx]->ui[4] -#define VERT_RESTORE_RGBA( idx ) v[idx]->ui[4] = color[idx] -#endif - -#define LOCAL_VARS(n) \ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); \ - GLuint color[n]; \ - (void) color; - - -/*********************************************************************** - * Helpers for rendering unfilled primitives * - ***********************************************************************/ - -static const GLuint hw_prim[GL_POLYGON+1] = { - PrimType_Points, - PrimType_Lines, - PrimType_Lines, - PrimType_Lines, - PrimType_Triangles, - PrimType_Triangles, - PrimType_Triangles, - PrimType_Triangles, - PrimType_Triangles, - PrimType_Triangles -}; - -static void s3vResetLineStipple( GLcontext *ctx ); -static void s3vRasterPrimitive( GLcontext *ctx, GLuint hwprim ); -static void s3vRenderPrimitive( GLcontext *ctx, GLenum prim ); -/* -extern static void s3v_lines_emit(GLcontext *ctx, GLuint start, GLuint end); -extern static void s3v_tris_emit(GLcontext *ctx, GLuint start, GLuint end); -*/ -#define RASTERIZE(x) if (vmesa->hw_primitive != hw_prim[x]) \ - s3vRasterPrimitive( ctx, hw_prim[x] ) -#define RENDER_PRIMITIVE vmesa->render_primitive -#define TAG(x) x -#define IND S3V_FALLBACK_BIT -#include "tnl_dd/t_dd_unfilled.h" -#undef IND - -/*********************************************************************** - * Generate GL render functions * - ***********************************************************************/ - -#define IND (0) -#define TAG(x) x -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (S3V_OFFSET_BIT) -#define TAG(x) x##_offset -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (S3V_TWOSIDE_BIT) -#define TAG(x) x##_twoside -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (S3V_TWOSIDE_BIT|S3V_OFFSET_BIT) -#define TAG(x) x##_twoside_offset -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (S3V_UNFILLED_BIT) -#define TAG(x) x##_unfilled -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (S3V_OFFSET_BIT|S3V_UNFILLED_BIT) -#define TAG(x) x##_offset_unfilled -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (S3V_TWOSIDE_BIT|S3V_UNFILLED_BIT) -#define TAG(x) x##_twoside_unfilled -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (S3V_TWOSIDE_BIT|S3V_OFFSET_BIT|S3V_UNFILLED_BIT) -#define TAG(x) x##_twoside_offset_unfilled -#include "tnl_dd/t_dd_tritmp.h" - - -static void init_render_tab( void ) -{ - DEBUG(("*** init_render_tab ***\n")); - - init(); - init_offset(); - init_twoside(); - init_twoside_offset(); - init_unfilled(); - init_offset_unfilled(); - init_twoside_unfilled(); - init_twoside_offset_unfilled(); -} - - -/**********************************************************************/ -/* Render unclipped begin/end objects */ -/**********************************************************************/ - -#define VERT(x) (s3vVertex *)(s3vverts + (x << shift)) - -#define RENDER_POINTS( start, count ) \ - DEBUG(("RENDER_POINTS...(ok)\n")); \ - for ( ; start < count ; start++) \ - vmesa->draw_line( vmesa, VERT(start), VERT(start) ) - /* vmesa->draw_point( vmesa, VERT(start) ) */ - -#define RENDER_LINE( v0, v1 ) \ - /* DEBUG(("RENDER_LINE...(ok)\n")); \ */ \ - vmesa->draw_line( vmesa, VERT(v0), VERT(v1) ); \ - DEBUG(("RENDER_LINE...(ok)\n")) - -#define RENDER_TRI( v0, v1, v2 ) \ - DEBUG(("RENDER_TRI...(ok)\n")); \ - vmesa->draw_tri( vmesa, VERT(v0), VERT(v1), VERT(v2) ) - -#define RENDER_QUAD( v0, v1, v2, v3 ) \ - DEBUG(("RENDER_QUAD...(ok)\n")); \ - /* s3v_draw_quad( vmesa, VERT(v0), VERT(v1), VERT(v2),VERT(v3) ) */\ - /* s3v_draw_triangle( vmesa, VERT(v0), VERT(v1), VERT(v2) ); \ - s3v_draw_triangle( vmesa, VERT(v0), VERT(v2), VERT(v3) ) */ \ - vmesa->draw_quad( vmesa, VERT(v0), VERT(v1), VERT(v2), VERT(v3) ) - -#define INIT(x) s3vRenderPrimitive( ctx, x ); -#undef LOCAL_VARS -#define LOCAL_VARS \ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); \ - const GLuint shift = vmesa->vertex_stride_shift; \ - const char *s3vverts = (char *)vmesa->verts; \ - const GLboolean stipple = ctx->Line.StippleFlag; \ - (void) stipple; -#define RESET_STIPPLE if ( stipple ) s3vResetLineStipple( ctx ); -#define RESET_OCCLUSION -#define PRESERVE_VB_DEFS -#define ELT(x) (x) -#define TAG(x) s3v_##x##_verts -#include "tnl_dd/t_dd_rendertmp.h" - - -/**********************************************************************/ -/* Render clipped primitives */ -/**********************************************************************/ - -static void s3vRenderClippedPoly( GLcontext *ctx, const GLuint *elts, - GLuint n ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint prim = vmesa->render_primitive; - - DEBUG(("I AM in: s3vRenderClippedPoly\n")); - - /* Render the new vertices as an unclipped polygon. - */ - if (1) - { - GLuint *tmp = VB->Elts; - VB->Elts = (GLuint *)elts; - tnl->Driver.Render.PrimTabElts[GL_POLYGON] - ( ctx, 0, n, PRIM_BEGIN|PRIM_END ); - - VB->Elts = tmp; - } - - /* Restore the render primitive - */ -#if 1 - if (prim != GL_POLYGON) { - DEBUG(("and prim != GL_POLYGON\n")); - tnl->Driver.Render.PrimitiveNotify( ctx, prim ); - } - -#endif -} - -static void s3vRenderClippedLine( GLcontext *ctx, GLuint ii, GLuint jj ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - /*tnl->Driver.LineFunc = s3v_line_tab[2];*/ /* _swsetup_Line; */ - - DEBUG(("I AM in: s3vRenderClippedLine\n")); - tnl->Driver.Render.Line( ctx, ii, jj ); -} - - -/**********************************************************************/ -/* Choose render functions */ -/**********************************************************************/ - - - -#define _S3V_NEW_RENDERSTATE (_DD_NEW_TRI_UNFILLED | \ - _DD_NEW_TRI_LIGHT_TWOSIDE | \ - _DD_NEW_TRI_OFFSET) - -#define ANY_RASTER_FLAGS (DD_TRI_LIGHT_TWOSIDE|DD_TRI_OFFSET|DD_TRI_UNFILLED) - -static void s3vChooseRenderState(GLcontext *ctx) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint flags = ctx->_TriangleCaps; - GLuint index = 0; - - DEBUG(("s3vChooseRenderState\n")); - - if (flags & ANY_RASTER_FLAGS) { - if (flags & DD_TRI_LIGHT_TWOSIDE) index |= S3V_TWOSIDE_BIT; - if (flags & DD_TRI_OFFSET) index |= S3V_OFFSET_BIT; - if (flags & DD_TRI_UNFILLED) index |= S3V_UNFILLED_BIT; - } - - DEBUG(("vmesa->RenderIndex = %i\n", vmesa->RenderIndex)); - DEBUG(("index = %i\n", index)); - - if (vmesa->RenderIndex != index) { - vmesa->RenderIndex = index; - - tnl->Driver.Render.Points = rast_tab[index].points; - tnl->Driver.Render.Line = rast_tab[index].line; - tnl->Driver.Render.Triangle = rast_tab[index].triangle; - tnl->Driver.Render.Quad = rast_tab[index].quad; - - if (vmesa->RenderIndex == 0) - tnl->Driver.Render.PrimTabVerts = s3v_render_tab_verts; - else - tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts; - tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts; - tnl->Driver.Render.ClippedLine = s3vRenderClippedLine; - tnl->Driver.Render.ClippedPolygon = s3vRenderClippedPoly; - } -} - - -/**********************************************************************/ -/* High level hooks for t_vb_render.c */ -/**********************************************************************/ - - - -/* Determine the rasterized primitive when not drawing unfilled - * polygons. - * - * Used only for the default render stage which always decomposes - * primitives to trianges/lines/points. For the accelerated stage, - * which renders strips as strips, the equivalent calculations are - * performed in s3v_render.c. - */ - -static void s3vRasterPrimitive( GLcontext *ctx, GLuint hwprim ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); -/* __DRIdrawablePrivate *dPriv = vmesa->driDrawable; */ - GLuint cmd = vmesa->CMD; - - unsigned int _hw_prim = hwprim; - - DEBUG(("s3vRasterPrimitive: hwprim = 0x%x ", _hw_prim)); - -/* printf("* vmesa->CMD = 0x%x\n", vmesa->CMD); */ - - if (vmesa->hw_primitive != _hw_prim) - { - DEBUG(("(new one) ***\n")); - cmd &= ~DO_MASK; - cmd &= ~ALPHA_BLEND_MASK; - vmesa->hw_primitive = _hw_prim; - - if (_hw_prim == PrimType_Triangles) { - /* TRI */ - DEBUG(("->switching to tri\n")); - cmd |= (vmesa->_tri[vmesa->_3d_mode] | vmesa->_alpha[vmesa->_3d_mode]); - } else if (_hw_prim == PrimType_Lines - || _hw_prim == PrimType_Points) { - /* LINE */ - DEBUG(("->switching to line\n")); - cmd |= (DO_3D_LINE | vmesa->_alpha[0]); - } else { - /* ugh? */ - DEBUG(("->switching to your sis'ass\n")); - } - - DEBUG(("\n")); - - vmesa->restore_primitive = _hw_prim; - /* 0xacc16827: good value -> lightened newave!!! */ - vmesa->CMD = cmd; - CMDCHANGE(); - } -} - -static void s3vRenderPrimitive( GLcontext *ctx, GLenum prim ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - __DRIdrawablePrivate *dPriv = vmesa->driDrawable; - GLuint cmd = vmesa->CMD; - - unsigned int _hw_prim = hw_prim[prim]; - - vmesa->render_primitive = prim; - vmesa->hw_primitive = _hw_prim; - - DEBUG(("s3vRenderPrimitive #%i ", prim)); - DEBUG(("_hw_prim = 0x%x\n", _hw_prim)); - -/* printf(" vmesa->CMD = 0x%x\n", vmesa->CMD); */ - - if (_hw_prim != vmesa->restore_primitive) { - DEBUG(("_hw_prim != vmesa->restore_primitive (was 0x%x)\n", - vmesa->restore_primitive)); -#if 1 - cmd &= ~DO_MASK; - cmd &= ~ALPHA_BLEND_MASK; -/* - printf(" cmd = 0x%x\n", cmd); - printf(" vmesa->_3d_mode=%i; vmesa->_tri[vmesa->_3d_mode]=0x%x\n", - vmesa->_3d_mode, vmesa->_tri[vmesa->_3d_mode]); - printf("vmesa->alpha[0] = 0x%x; vmesa->alpha[1] = 0x%x\n", - vmesa->_alpha[0], vmesa->_alpha[1]); -*/ - if (_hw_prim == PrimType_Triangles) { /* TRI */ - DEBUG(("->switching to tri\n")); - cmd |= (vmesa->_tri[vmesa->_3d_mode] | vmesa->_alpha[vmesa->_3d_mode]); - DEBUG(("vmesa->TexStride = %i\n", vmesa->TexStride)); - DEBUG(("vmesa->TexOffset = %i\n", vmesa->TexOffset)); - DMAOUT_CHECK(3DTRI_Z_BASE, 12); - } else { /* LINE */ - DEBUG(("->switching to line\n")); - cmd |= (DO_3D_LINE | vmesa->_alpha[0]); - DMAOUT_CHECK(3DLINE_Z_BASE, 12); - } - - DMAOUT(vmesa->s3vScreen->depthOffset & 0x003FFFF8); - DMAOUT(vmesa->DestBase); - /* DMAOUT(vmesa->ScissorLR); */ - /* DMAOUT(vmesa->ScissorTB); */ - - /* NOTE: we need to restore all these values since we - * are coming back from a vmesa->restore_primitive */ - DMAOUT( (0 << 16) | (dPriv->w-1) ); - DMAOUT( (0 << 16) | (dPriv->h-1) ); - DMAOUT( (vmesa->SrcStride << 16) | vmesa->TexStride ); - DMAOUT(vmesa->SrcStride); - DMAOUT(vmesa->TexOffset); - DMAOUT(vmesa->TextureBorderColor); - DMAOUT(0); /* FOG */ - DMAOUT(0); - DMAOUT(0); - DMAOUT(cmd); - /* 0xacc16827: good value -> lightened newave!!! */ - DMAFINISH(); - - vmesa->CMD = cmd; -#endif - } - - DEBUG(("\n")); - - vmesa->restore_primitive = _hw_prim; -} - -static void s3vRunPipeline( GLcontext *ctx ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - - DEBUG(("*** s3vRunPipeline ***\n")); - - if ( vmesa->new_state ) - s3vDDUpdateHWState( ctx ); - - if (vmesa->new_gl_state) { - - if (vmesa->new_gl_state & _NEW_TEXTURE) { - s3vUpdateTextureState( ctx ); - } - - if (!vmesa->Fallback) { - if (vmesa->new_gl_state & _S3V_NEW_VERTEX) - s3vChooseVertexState( ctx ); - - if (vmesa->new_gl_state & _S3V_NEW_RASTER_STATE) - s3vChooseRasterState( ctx ); - - if (vmesa->new_gl_state & _S3V_NEW_RENDERSTATE) - s3vChooseRenderState( ctx ); - } - - vmesa->new_gl_state = 0; - - } - - _tnl_run_pipeline( ctx ); -} - -static void s3vRenderStart( GLcontext *ctx ) -{ - /* Check for projective texturing. Make sure all texcoord - * pointers point to something. (fix in mesa?) - */ - - DEBUG(("s3vRenderStart\n")); - /* s3vCheckTexSizes( ctx ); */ -} - -static void s3vRenderFinish( GLcontext *ctx ) -{ - if (0) - _swrast_flush( ctx ); /* never needed */ -} - -static void s3vResetLineStipple( GLcontext *ctx ) -{ -/* s3vContextPtr vmesa = S3V_CONTEXT(ctx); */ - - /* Reset the hardware stipple counter. - */ -/* - CHECK_DMA_BUFFER(vmesa, 1); - WRITE(vmesa->buf, UpdateLineStippleCounters, 0); -*/ -} - - -/**********************************************************************/ -/* Transition to/from hardware rasterization. */ -/**********************************************************************/ - - -void s3vFallback( s3vContextPtr vmesa, GLuint bit, GLboolean mode ) -{ - GLcontext *ctx = vmesa->glCtx; - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint oldfallback = vmesa->Fallback; - - DEBUG(("*** s3vFallback: ")); - - if (mode) { - vmesa->Fallback |= bit; - if (oldfallback == 0) { - DEBUG(("oldfallback == 0 ***\n")); - _swsetup_Wakeup( ctx ); - _tnl_need_projected_coords( ctx, GL_TRUE ); - vmesa->RenderIndex = ~0; - } - } - else { - DEBUG(("***\n")); - vmesa->Fallback &= ~bit; - if (oldfallback == bit) { - _swrast_flush( ctx ); - tnl->Driver.Render.Start = s3vRenderStart; - tnl->Driver.Render.PrimitiveNotify = s3vRenderPrimitive; - tnl->Driver.Render.Finish = s3vRenderFinish; - tnl->Driver.Render.BuildVertices = s3vBuildVertices; - tnl->Driver.Render.ResetLineStipple = s3vResetLineStipple; - vmesa->new_gl_state |= (_S3V_NEW_RENDERSTATE| - _S3V_NEW_RASTER_STATE| - _S3V_NEW_VERTEX); - } - } -} - - -/**********************************************************************/ -/* Initialization. */ -/**********************************************************************/ - - -void s3vInitTriFuncs( GLcontext *ctx ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - TNLcontext *tnl = TNL_CONTEXT(ctx); - static int firsttime = 1; - - if (firsttime) { - init_rast_tab(); - init_render_tab(); - firsttime = 0; - } - - vmesa->RenderIndex = ~0; - - tnl->Driver.RunPipeline = s3vRunPipeline; - tnl->Driver.Render.Start = s3vRenderStart; - tnl->Driver.Render.Finish = s3vRenderFinish; - tnl->Driver.Render.PrimitiveNotify = s3vRenderPrimitive; - tnl->Driver.Render.ResetLineStipple = s3vResetLineStipple; -/* - tnl->Driver.RenderInterp = _swsetup_RenderInterp; - tnl->Driver.RenderCopyPV = _swsetup_RenderCopyPV; -*/ - tnl->Driver.Render.BuildVertices = s3vBuildVertices; -} diff --git a/src/mesa/drivers/dri/s3v/s3v_tris.h b/src/mesa/drivers/dri/s3v/s3v_tris.h deleted file mode 100644 index 0010a7fe0a..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_tris.h +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Author: Max Lingua - */ - -#ifndef _S3V_TRIS_H -#define _S3V_TRIS_H - -extern void s3vDDTrifuncInit(void); -extern void s3vDDChooseTriRenderState(GLcontext *); - -#endif /* !(_S3V_TRIS_H) */ diff --git a/src/mesa/drivers/dri/s3v/s3v_tritmp.h b/src/mesa/drivers/dri/s3v/s3v_tritmp.h deleted file mode 100644 index 2321bd414f..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_tritmp.h +++ /dev/null @@ -1,958 +0,0 @@ -/* - * Author: Max Lingua - */ - -/**** MACROS start ****/ - -/* point/line macros */ - -#define LINE_VERT_VARS \ - SWvertex v[3]; \ - s3vVertex* vvv[2]; \ - int x[3], y[3], z[3]; \ - int idx[3]; \ - int dx01, dy01; \ - int delt02; \ - int deltzy, zstart; \ - int start02, end01; \ - int ystart, y01y12; \ - int i, tmp, tmp2, tmp3; \ - GLfloat ydiff, fy[3] -#define LINE_VERT_VARS_VOIDS \ - (void) v; (void) vvv; (void) x; (void) y; (void) z; (void) idx; \ - (void) dx01; (void) dy01; (void) delt02; (void) deltzy; \ - (void) zstart; (void) start02; (void) ystart; (void) y01y12; \ - (void) i; (void) tmp; (void) tmp2; (void) tmp3; (void) ydiff; (void) fy - -#define LINE_FLAT_VARS \ - int arstart, gbstart; \ - int deltarx, deltgbx, deltary, deltgby; \ - GLubyte *(col)[3] -#define LINE_FLAT_VARS_VOIDS \ - (void) arstart; (void) gbstart; (void) deltarx; (void) deltgbx; \ - (void) deltary; (void) deltgby; (void) col - -#define LINE_GOURAUD_VARS \ - int arstart, gbstart; \ - int deltary, deltgby; \ - int ctmp, ctmp2, ctmp3, ctmp4; \ - GLubyte *(col)[3] -#define LINE_GOURAUD_VARS_VOIDS \ - (void) arstart; (void) gbstart; (void) deltary; (void) deltgby; \ - (void) ctmp; (void) ctmp2; (void) ctmp3; (void) ctmp4; (void) col - -#define SORT_LINE_VERT() \ -do { \ - if(v[0].attrib[FRAG_ATTRIB_WPOS][1] <= v[1].attrib[FRAG_ATTRIB_WPOS][1]) { \ -\ - idx[0] = 0; \ - idx[1] = 1; \ -\ - } else if (v[0].attrib[FRAG_ATTRIB_WPOS][1] > v[1].attrib[FRAG_ATTRIB_WPOS][1]) { \ -\ - idx[0] = 1; \ - idx[1] = 0; \ -\ - } \ -} while(0) - -#define SET_LINE_VERT() \ -do { \ - x[0] = (v[idx[0]].attrib[FRAG_ATTRIB_WPOS][0] * 1024.0f * 1024.0f); /* 0x100000 */ \ - y[0] = fy[0] = dPriv->h - v[idx[0]].attrib[FRAG_ATTRIB_WPOS][1]; \ - z[0] = (v[idx[0]].attrib[FRAG_ATTRIB_WPOS][2]) * 1024.0f * 32.0f; /* 0x8000; */ \ -\ - x[1] = (v[idx[1]].attrib[FRAG_ATTRIB_WPOS][0] * 1024.0f * 1024.0f); /* 0x100000 */ \ - y[1] = dPriv->h - v[idx[1]].attrib[FRAG_ATTRIB_WPOS][1]; \ - z[1] = (v[idx[1]].attrib[FRAG_ATTRIB_WPOS][2]) * 1024.0f * 32.0f; /* 0x8000 */ \ -} while(0) - -#define SET_LINE_XY() \ -do { \ - tmp = v[idx[0]].attrib[FRAG_ATTRIB_WPOS][0]; \ - tmp2 = v[idx[1]].attrib[FRAG_ATTRIB_WPOS][0]; \ -\ - dx01 = x[0] - x[1]; \ - dy01 = y[0] - y[1]; \ -\ - ydiff = fy[0] - (float)y[0]; \ - ystart = y[0]; \ - y01y12 = dy01 + 1; \ -} while (0) - -#define SET_LINE_DIR() \ -do { \ - if (tmp2 > tmp) { \ - y01y12 |= 0x80000000; \ - tmp3 = tmp2-tmp; \ - } else { \ - tmp3 = tmp-tmp2; \ - } \ -\ - end01 = ((tmp << 16) | tmp2); \ -\ - if (dy01) \ - delt02 = -(dx01/dy01); \ - else \ - delt02 = 0; \ -\ - if (dy01 > tmp3) { /* Y MAJ */ \ - /* NOTE: tmp3 always >=0 */ \ - start02 = x[0]; \ - } else if (delt02 >= 0){ /* X MAJ - positive delta */ \ - start02 = x[0] + delt02/2; \ - dy01 = tmp3; /* could be 0 */ \ - } else { /* X MAJ - negative delta */ \ - start02 = x[0] + delt02/2 + ((1 << 20) - 1); \ - dy01 = tmp3; /* could be 0 */ \ - } \ -} while(0) - -#define SET_LINE_Z() \ -do { \ - zstart = z[0]; \ -\ - if (dy01) { \ - deltzy = (z[1] - z[0])/dy01; \ - } else { \ - deltzy = 0; /* dy01 = tmp3 = 0 (it's a point)*/ \ - } \ -} while (0) - -#define SET_LINE_FLAT_COL() \ -do { \ - col[0] = &(v[idx[0]].color[0]); \ - deltarx = deltary = deltgbx = deltgby = 0; \ - gbstart = (((col[0][1]) << 23) | ((col[0][2]) << 7)); \ - arstart = (((col[0][3]) << 23) | ((col[0][0]) << 7)); \ -} while(0) - -#define SET_LINE_GOURAUD_COL() \ -do { \ - col[0] = &(v[idx[0]].color[0]); \ - col[1] = &(v[idx[1]].color[0]); \ -\ - vvv[0] = _v0; \ - vvv[1] = _v1; \ -\ - for (i=0; i<2; i++) { \ - /* FIXME: swapped ! */ \ - col[i][0] = vvv[!idx[i]]->v.color.red; \ - col[i][1] = vvv[!idx[i]]->v.color.green; \ - col[i][2] = vvv[!idx[i]]->v.color.blue; \ - col[i][3] = vvv[!idx[i]]->v.color.alpha; \ - } \ -\ - if (dy01) { \ -\ - ctmp = ((col[0][1] - col[1][1]) << 7) / dy01; \ - ctmp2 = ((col[0][2] - col[1][2]) << 7) / dy01; \ - deltgby = ((ctmp << 16) & 0xFFFF0000) | (ctmp2 & 0xFFFF); \ -\ - ctmp3 = ((col[0][3] - col[1][3]) << 7) / dy01; \ - ctmp4 = ((col[0][0] - col[1][0]) << 7) / dy01; \ - deltary = ((ctmp3 << 16) & 0xFFFF0000) | (ctmp4 & 0xFFFF); \ - } else { \ - ctmp = ((col[1][1] - col[0][1]) << 7); \ - ctmp2 = ((col[1][2] - col[0][2]) << 7); \ - deltgby = ((ctmp << 16) & 0xFFFF0000) | (ctmp2 & 0xFFFF); \ -\ - ctmp3 = ((col[1][3] - col[0][3]) << 7); \ - ctmp4 = ((col[1][0] - col[0][0]) << 7); \ - deltary = ((ctmp3 << 16) & 0xFFFF0000) | (ctmp4 & 0xFFFF); \ - deltgby = deltary = 0; \ - } \ -\ - idx[0] = 1; /* FIXME: swapped */ \ -\ - gbstart = \ - (((int)((ydiff * ctmp) + (col[idx[0]][1] << 7)) << 16) & 0x7FFF0000) \ - | ((int)((ydiff * ctmp2) + (col[idx[0]][2] << 7)) & 0x7FFF); \ - arstart = \ - (((int)((ydiff * ctmp3) + (col[idx[0]][3] << 7)) << 16) & 0x7FFF0000) \ - | ((int)((ydiff * ctmp4) + (col[idx[0]][0] << 7)) & 0x7FFF); \ -} while(0) - -#define SEND_LINE_COL() \ -do { \ - DMAOUT(deltgby); \ - DMAOUT(deltary); \ - DMAOUT(gbstart); \ - DMAOUT(arstart); \ -} while (0) - -#define SEND_LINE_VERT() \ -do { \ - DMAOUT(deltzy); \ - DMAOUT(zstart); \ - DMAOUT(0); \ - DMAOUT(0); \ - DMAOUT(0); \ - DMAOUT(end01); \ - DMAOUT(delt02); \ - DMAOUT(start02); \ - DMAOUT(ystart); \ - DMAOUT(y01y12); \ -} while (0) - - -/* tri macros (mostly stolen from utah-glx...) */ - -#define VERT_VARS \ - SWvertex v[3]; \ - int x[3], y[3], z[3]; \ - int idx[3]; \ - int dx01, dy01; \ - int dx02, dy02; \ - int dx12, dy12; \ - int delt01, delt02, delt12; \ - int deltzx, deltzy, zstart; \ - int start02, end01, end12; \ - int ystart, y01y12; \ - int i, tmp, lr; \ - GLfloat ydiff, fy[3] -#define VERT_VARS_VOIDS \ - (void) v; (void) x; (void) y; (void) z; (void) idx; (void) dx01; \ - (void) dy01; (void) dx02; (void) dy02; (void) dx12; (void) dy12; \ - (void) delt01; (void) delt02; (void) delt12; (void) deltzx; \ - (void) deltzy; (void) zstart; (void) start02; (void) end01; \ - (void) end12; (void) ystart; (void) y01y12; (void) i; (void) tmp; \ - (void) lr; (void) ydiff; (void) fy - -#define GOURAUD_VARS \ - int arstart, gbstart; \ - int deltarx, deltgbx, deltary, deltgby; \ - int ctmp, ctmp2, ctmp3, ctmp4; \ - GLubyte *(col)[3] -#define GOURAUD_VARS_VOIDS \ - (void) arstart; (void) gbstart; (void) deltarx; (void) deltgbx; \ - (void) deltary; (void) deltgby; (void) ctmp; (void) ctmp2; \ - (void) ctmp3; (void) ctmp4; (void) col - -#define FLAT_VARS \ - int arstart, gbstart; \ - int deltarx, deltgbx, deltary, deltgby; \ - GLubyte *(col)[3] -#define FLAT_VARS_VOIDS \ - (void) arstart; (void) gbstart; (void) deltarx; (void) deltgbx; \ - (void) deltary; (void) deltgby; (void) col - -#define TEX_VARS \ - int u0, u1, u2; \ - GLfloat ru0, ru1, ru2; \ - int v0, v1, v2; \ - GLfloat rv0, rv1, rv2; \ - GLfloat w0, w1, w2; \ - GLfloat rw0, rw1, rw2; \ - int baseu, basev; \ - int d0, d1, d2; \ - int deltdx, deltvx, deltux, deltdy, deltvy, deltuy; \ - int deltwx, deltwy; \ - int rbaseu, rbasev; \ - int dstart, ustart, wstart, vstart; \ - static int stmp = 0; \ - s3vTextureObjectPtr t -#define TEX_VARS_VOIDS \ - (void) u0; (void) u1; (void) u2; (void) ru0; (void) ru1; (void) ru2; \ - (void) v0; (void) v1; (void) v2; (void) rv0; (void) rv1; (void) rv2; \ - (void) w0; (void) w1; (void) w2; (void) rw0; (void) rw1; (void) rw2; \ - (void) baseu; (void) basev; (void) d0; (void) d1; (void) d2; \ - (void) deltdx; (void) deltvx; (void) deltux; (void) deltdy; \ - (void) deltuy; (void) deltwx; (void) deltwy; (void) rbaseu; \ - (void) rbasev; (void) dstart; (void) ustart; (void) wstart; \ - (void) vstart; (void) stmp; (void) t - -#define SORT_VERT() \ -do { \ - for (i=0; i<3; i++) \ - fy[i] = v[i].attrib[FRAG_ATTRIB_WPOS][1]; \ -\ - if (fy[1] > fy[0]) { /* (fy[1] > fy[0]) */ \ -\ - if (fy[2] > fy[0]) { \ - idx[0] = 0; \ - if (fy[1] > fy[2]) { \ - idx[1] = 2; \ - idx[2] = 1; \ - } else { \ - idx[1] = 1; \ - idx[2] = 2; \ - } \ - } else { \ - idx[0] = 2; \ - idx[1] = 0; \ - idx[2] = 1; \ - } \ - } else { /* (fy[1] < y[0]) */ \ - if (fy[2] > fy[0]) { \ - idx[0] = 1; \ - idx[1] = 0; \ - idx[2] = 2; \ - } else { \ - idx[2] = 0; \ - if (fy[2] > fy[1]) { \ - idx[0] = 1; \ - idx[1] = 2; \ - } else { \ - idx[0] = 2; \ - idx[1] = 1; \ - } \ - } \ - } \ -} while(0) - -#define SET_VERT() \ -do { \ - for (i=0; i<3; i++) \ - { \ - x[i] = ((v[idx[i]].attrib[FRAG_ATTRIB_WPOS][0]) * /* 0x100000*/ 1024.0 * 1024.0); \ - y[i] = fy[i] = (dPriv->h - v[idx[i]].attrib[FRAG_ATTRIB_WPOS][1]); \ - z[i] = ((v[idx[i]].attrib[FRAG_ATTRIB_WPOS][2]) * /* 0x8000 */ 1024.0 * 32.0); \ - } \ -\ - ydiff = fy[0] - (float)y[0]; \ -\ - ystart = y[0]; \ -\ - dx12 = x[2] - x[1]; \ - dy12 = y[1] - y[2]; \ - dx01 = x[1] - x[0]; \ - dy01 = y[0] - y[1]; \ - dx02 = x[2] - x[0]; \ - dy02 = y[0] - y[2]; \ -\ - delt01 = delt02 = delt12 = 0; \ -} while (0) - - -#define SET_XY() \ -do { \ - if (dy01) delt01 = dx01 / dy01; \ - if (dy12) delt12 = dx12 / dy12; \ - delt02 = dx02 / dy02; \ -\ - start02 = x[0] + (ydiff * delt02); \ - end01 = x[0] + (ydiff * delt01); \ - end12 = x[1] + ((fy[1] - (GLfloat)y[1]) * delt12); \ -} while (0) - -#define SET_DIR() \ -do { \ - tmp = x[1] - (dy01 * delt02 + x[0]); \ - if (tmp > 0) { \ - lr = 0x80000000; \ - } else { \ - tmp *= -1; \ - lr = 0; \ - } \ - tmp >>= 20; \ -\ - y01y12 = ((((y[0] - y[1]) & 0x7FF) << 16) \ - | ((y[1] - y[2]) & 0x7FF) | lr); \ -} while (0) - -#define SET_Z() \ -do { \ - deltzy = (z[2] - z[0]) / dy02; \ - if (tmp) { \ - deltzx = (z[1] - (dy01 * deltzy + z[0])) / tmp; \ - } else { \ - deltzx = 0; \ - } \ - zstart = (deltzy * ydiff) + z[0]; \ -} while (0) - -#define SET_FLAT_COL() \ -do { \ - col[0] = &(v[0].color[0]); \ - deltarx = deltary = deltgbx = deltgby = 0; \ - gbstart = (((col[0][1]) << 23) | ((col[0][2]) << 7)); \ - arstart = (((col[0][3]) << 23) | ((col[0][0]) << 7)); \ -} while(0) - -#define SET_GOURAUD_COL() \ -do { \ - col[0] = &(v[idx[0]].color[0]); \ - col[1] = &(v[idx[1]].color[0]); \ - col[2] = &(v[idx[2]].color[0]); \ -\ - ctmp = ((col[2][3] - col[0][3]) << 7) / dy02; \ - ctmp2 = ((col[2][0] - col[0][0]) << 7) / dy02; \ - deltary = ((ctmp << 16) & 0xFFFF0000) | (ctmp2 & 0xFFFF); \ - ctmp3 = ((col[2][1] - col[0][1]) << 7) / dy02; \ - ctmp4 = ((col[2][2] - col[0][2]) << 7) / dy02; \ - deltgby = ((ctmp3 << 16) & 0xFFFF0000) | (ctmp4 & 0xFFFF); \ - gbstart = \ - (((int)((ydiff * ctmp3) + (col[0][1] << 7)) << 16) & 0x7FFF0000) \ - | ((int)((ydiff * ctmp4) + (col[0][2] << 7)) & 0x7FFF); \ - arstart = \ - (((int)((ydiff * ctmp) + (col[0][3] << 7)) << 16) & 0x7FFF0000) \ - | ((int)((ydiff * ctmp2) + (col[0][0] << 7)) & 0x7FFF); \ - if (tmp) { \ - int ax, rx, gx, bx; \ - ax = ((col[1][3] << 7) - (dy01 * ctmp + (col[0][3] << 7))) / tmp; \ - rx = ((col[1][0] << 7) - (dy01 * ctmp2 + (col[0][0] << 7))) / tmp; \ - gx = ((col[1][1] << 7) - (dy01 * ctmp3 + (col[0][1] << 7))) / tmp; \ - bx = ((col[1][2] << 7) - (dy01 * ctmp4 + (col[0][2] << 7))) / tmp; \ - deltarx = ((ax << 16) & 0xFFFF0000) | (rx & 0xFFFF); \ - deltgbx = ((gx << 16) & 0xFFFF0000) | (bx & 0xFFFF); \ - } else { \ - deltgbx = deltarx = 0; \ - } \ -} while (0) - -#define SET_TEX_VERT() \ -do { \ - t = ((s3vTextureObjectPtr) \ - ctx->Texture.Unit[0]._Current->DriverData); \ - deltwx = deltwy = wstart = deltdx = deltdy = dstart = 0; \ -\ - u0 = (v[idx[0]].attrib[FRAG_ATTRIB_TEX0][0] \ - * (GLfloat)(t->image[0].image->Width) * 256.0); \ - u1 = (v[idx[1]].attrib[FRAG_ATTRIB_TEX0][0] \ - * (GLfloat)(t->globj->Image[0][0]->Width) * 256.0); \ - u2 = (v[idx[2]].attrib[FRAG_ATTRIB_TEX0][0] \ - * (GLfloat)(t->globj->Image[0][0]->Width) * 256.0); \ - v0 = (v[idx[0]].attrib[FRAG_ATTRIB_TEX0][1] \ - * (GLfloat)(t->globj->Image[0][0]->Height) * 256.0); \ - v1 = (v[idx[1]].attrib[FRAG_ATTRIB_TEX0][1] \ - * (GLfloat)(t->globj->Image[0][0]->Height) * 256.0); \ - v2 = (v[idx[2]].attrib[FRAG_ATTRIB_TEX0][1] \ - * (GLfloat)(t->globj->Image[0][0]->Height) * 256.0); \ -\ - w0 = (v[idx[0]].attrib[FRAG_ATTRIB_WPOS][3]); \ - w1 = (v[idx[1]].attrib[FRAG_ATTRIB_WPOS][3]); \ - w2 = (v[idx[2]].attrib[FRAG_ATTRIB_WPOS][3]); \ -} while (0) - -#define SET_BASEUV() \ -do { \ - if (u0 < u1) { \ - if (u0 < u2) { \ - baseu = u0; \ - } else { \ - baseu = u2; \ - } \ - } else { \ - if (u1 < u2) { \ - baseu = u1; \ - } else { \ - baseu = u2; \ - } \ - } \ -\ - if (v0 < v1) { \ - if (v0 < v2) { \ - basev = v0; \ - } else { \ - basev = v2; \ - } \ - } else { \ - if (v1 < v2) { \ - basev = v1; \ - } else { \ - basev = v2; \ - } \ - } \ -} while (0) - - -#define SET_RW() \ -do { \ - /* GLfloat minW; \ -\ - if (w0 < w1) { \ - if (w0 < w2) { \ - minW = w0; \ - } else { \ - minW = w2; \ - } \ - } else { \ - if (w1 < w2) { \ - minW = w1; \ - } else { \ - minW = w2; \ - } \ - } */ \ -\ - rw0 = (512.0 * w0); \ - rw1 = (512.0 * w1); \ - rw2 = (512.0 * w2); \ -} while (0) - -#define SET_D() \ -do { \ - GLfloat sxy, suv; \ - int lev; \ -\ - suv = (v[idx[0]].attrib[FRAG_ATTRIB_TEX0][0] - \ - v[idx[2]].attrib[FRAG_ATTRIB_TEX0][0]) * \ - (v[idx[1]].attrib[FRAG_ATTRIB_TEX0][1] - \ - v[idx[2]].attrib[FRAG_ATTRIB_TEX0][1]) - \ - (v[idx[1]].attrib[FRAG_ATTRIB_TEX0][0] - \ - v[idx[2]].attrib[FRAG_ATTRIB_TEX0][0]) * \ - (v[idx[0]].attrib[FRAG_ATTRIB_TEX0][1] - \ - v[idx[2]].attrib[FRAG_ATTRIB_TEX0][2]); \ -\ - sxy = (v[idx[0]].attrib[FRAG_ATTRIB_TEX0][0] - \ - v[idx[2]].attrib[FRAG_ATTRIB_TEX0][0]) * \ - (v[idx[1]].attrib[FRAG_ATTRIB_TEX0][1] - \ - v[idx[2]].attrib[FRAG_ATTRIB_TEX0][1]) - \ - (v[idx[1]].attrib[FRAG_ATTRIB_TEX0][0] - \ - v[idx[2]].attrib[FRAG_ATTRIB_TEX0][0]) * \ - (v[idx[0]].attrib[FRAG_ATTRIB_TEX0][1] - \ - v[idx[2]].attrib[FRAG_ATTRIB_TEX0][2]); \ -\ - if (sxy < 0) sxy *= -1.0; \ - if (suv < 0) suv *= -1.0; \ -\ - lev = *(int*)&suv - *(int *)&sxy; \ - if (lev < 0) \ - lev = 0; \ - else \ - lev >>=23; \ - dstart = (lev << 27); \ -} while (0) - -#define SET_UVWD() \ -do { \ - SET_BASEUV(); \ - SET_RW(); \ - SET_D(); \ - ru0 = (((u0 - baseu) * rw0)); \ - ru1 = (((u1 - baseu) * rw1)); \ - ru2 = (((u2 - baseu) * rw2)); \ - rv0 = (((v0 - basev) * rw0)); \ - rv1 = (((v1 - basev) * rw1)); \ - rv2 = (((v2 - basev) * rw2)); \ -\ - while (baseu < 0) { baseu += (t->globj->Image[0][0]->Width << 8); } \ - while (basev < 0) { basev += (t->globj->Image[0][0]->Height << 8); } \ -\ - if (!(baseu & 0xFF)) \ - { baseu = (baseu >> 8); } \ - else \ - { baseu = (baseu >> 8) + 1; } \ -\ - if ((basev & 0x80) || !(basev & 0xFF)) \ - { basev = (basev >> 8); } \ - else \ - { basev = (basev >> 8) - 1; } \ -\ - rbaseu = (baseu) << (16 - t->globj->Image[0][0]->WidthLog2); \ - rbasev = (basev) << (16 - t->globj->Image[0][0]->WidthLog2); \ - deltuy = (((ru2 - ru0) / dy02)); \ - deltvy = (((rv2 - rv0) / dy02)); \ - rw0 *= (1024.0 * 512.0); \ - rw1 *= (1024.0 * 512.0); \ - rw2 *= (1024.0 * 512.0); \ - deltwy = ((rw2 - rw0) / dy02); \ - if (tmp) { \ - deltux = ((ru1 - (dy01 * deltuy + ru0)) / tmp); \ - deltvx = ((rv1 - (dy01 * deltvy + rv0)) / tmp); \ - deltwx = ((rw1 - (dy01 * deltwy + rw0)) / tmp); \ - } else { deltux = deltvx = deltwx = 0; } \ - ustart = (deltuy * ydiff) + (ru0); \ - vstart = (deltvy * ydiff) + (rv0); \ - wstart = (deltwy * ydiff) + (rw0); \ -} while (0) - -#define SEND_UVWD() \ -do { \ - DMAOUT((rbasev & 0xFFFF)); \ - DMAOUT((0xa0000000 | (rbaseu & 0xFFFF))); \ - DMAOUT(deltwx); \ - DMAOUT(deltwy); \ - DMAOUT(wstart); \ - DMAOUT(deltdx); \ - DMAOUT(deltvx); \ - DMAOUT(deltux); \ - DMAOUT(deltdy); \ - DMAOUT(deltvy); \ - DMAOUT(deltuy); \ - DMAOUT(dstart); \ - DMAOUT(vstart); \ - DMAOUT(ustart); \ -} while (0) - -#define SEND_VERT() \ -do { \ - DMAOUT(deltzx); \ - DMAOUT(deltzy); \ - DMAOUT(zstart); \ - DMAOUT(delt12); \ - DMAOUT(end12); \ - DMAOUT(delt01); \ - DMAOUT(end01); \ - DMAOUT(delt02); \ - DMAOUT(start02); \ - DMAOUT(ystart); \ - DMAOUT(y01y12); \ -} while (0) - -#define SEND_COL() \ -do { \ - DMAOUT(deltgbx); \ - DMAOUT(deltarx); \ - DMAOUT(deltgby); \ - DMAOUT(deltary); \ - DMAOUT(gbstart); \ - DMAOUT(arstart); \ -} while (0) - -/**** MACROS end ****/ - - - - -static void TAG(s3v_point)( s3vContextPtr vmesa, - const s3vVertex *_v0 ) -{ -} - -static void TAG(s3v_line)( s3vContextPtr vmesa, - const s3vVertex *_v0, - const s3vVertex *_v1 ) -{ - GLcontext *ctx = vmesa->glCtx; - __DRIdrawablePrivate *dPriv = vmesa->driDrawable; - - LINE_VERT_VARS; -#if (IND & S3V_RAST_FLAT_BIT) - LINE_FLAT_VARS; -#else - LINE_GOURAUD_VARS; -#endif -#if (IND & S3V_RAST_CULL_BIT) - GLfloat cull; - (void) cull; -#endif - LINE_VERT_VARS_VOIDS; -#if (IND & S3V_RAST_FLAT_BIT) - LINE_FLAT_VARS_VOIDS; -#else - LINE_GOURAUD_VARS_VOIDS; -#endif - - DEBUG(("*** s3v_line: ")); -#if (IND & S3V_RAST_CULL_BIT) - DEBUG(("cull ")); -#endif -#if (IND & S3V_RAST_FLAT_BIT) - DEBUG(("flat ")); -#endif - - DEBUG(("***\n")); - -#if 0 - s3v_print_vertex(ctx, _v0); - s3v_print_vertex(ctx, _v1); -#endif - - s3v_translate_vertex( ctx, _v0, &v[0] ); - s3v_translate_vertex( ctx, _v1, &v[1] ); - -#if (IND & S3V_RAST_CULL_BIT) - /* FIXME: should we cull lines too? */ -#endif - (void)v; /* v[0]; v[1]; */ - - SORT_LINE_VERT(); - SET_LINE_VERT(); - - SET_LINE_XY(); - SET_LINE_DIR(); - SET_LINE_Z(); - -#if (IND & S3V_RAST_FLAT_BIT) - SET_LINE_FLAT_COL(); -#else - SET_LINE_GOURAUD_COL(); -#endif - - DMAOUT_CHECK(3DLINE_GBD, 15); - SEND_LINE_COL(); - DMAOUT(0); - SEND_LINE_VERT(); - DMAFINISH(); -} - -static void TAG(s3v_triangle)( s3vContextPtr vmesa, - const s3vVertex *_v0, - const s3vVertex *_v1, - const s3vVertex *_v2 ) -{ - GLcontext *ctx = vmesa->glCtx; - __DRIdrawablePrivate *dPriv = vmesa->driDrawable; - - VERT_VARS; -#if (IND & S3v_RAST_FLAT_BIT) - FLAT_VARS; -#else - GOURAUD_VARS; -#endif -#if (IND & S3V_RAST_TEX_BIT) - TEX_VARS; -#endif -#if (IND & S3V_RAST_CULL_BIT) - GLfloat cull; -#endif - VERT_VARS_VOIDS; -#if (IND & S3v_RAST_FLAT_BIT) - FLAT_VARS_VOIDS; -#else - GOURAUD_VARS_VOIDS; -#endif -#if (IND & S3V_RAST_TEX_BIT) - TEX_VARS_VOIDS; -#endif - - DEBUG(("*** s3v_triangle: ")); -#if (IND & S3V_RAST_CULL_BIT) - DEBUG(("cull ")); -#endif -#if (IND & S3V_RAST_FLAT_BIT) - DEBUG(("flat ")); -#endif -#if (IND & S3V_RAST_TEX_BIT) - DEBUG(("tex ")); -#endif - -DEBUG(("***\n")); - -#if 0 - s3v_print_vertex(ctx, _v0); - s3v_print_vertex(ctx, _v1); - s3v_print_vertex(ctx, _v2); -#endif - - s3v_translate_vertex( ctx, _v0, &v[0] ); - s3v_translate_vertex( ctx, _v1, &v[1] ); - s3v_translate_vertex( ctx, _v2, &v[2] ); - -#if (IND & S3V_RAST_CULL_BIT) - cull = vmesa->backface_sign * - ((v[1].attrib[FRAG_ATTRIB_WPOS][0] - v[0].attrib[FRAG_ATTRIB_WPOS][0]) * (v[0].attrib[FRAG_ATTRIB_WPOS][1] - v[2].attrib[FRAG_ATTRIB_WPOS][1]) + - (v[1].attrib[FRAG_ATTRIB_WPOS][1] - v[0].attrib[FRAG_ATTRIB_WPOS][1]) * (v[2].attrib[FRAG_ATTRIB_WPOS][0] - v[0].attrib[FRAG_ATTRIB_WPOS][0])); - - if (cull < vmesa->cull_zero /* -0.02f */) return; -#endif - - (void)v; /* v[0]; v[1]; v[2]; */ - - SORT_VERT(); - SET_VERT(); - - if (dy02 == 0) return; - - SET_XY(); - SET_DIR(); - SET_Z(); - -#if (IND & S3V_RAST_TEX_BIT) - SET_TEX_VERT(); - SET_UVWD(); -#endif - -#if (IND & S3V_RAST_FLAT_BIT) - SET_FLAT_COL(); -#else - SET_GOURAUD_COL(); -#endif - -#if (IND & S3V_RAST_TEX_BIT) - DMAOUT_CHECK(3DTRI_BASEV, 31); - SEND_UVWD(); - SEND_COL(); - SEND_VERT(); - DMAFINISH(); -#else - DMAOUT_CHECK(3DTRI_GBX, 17); - SEND_COL(); - SEND_VERT(); - DMAFINISH(); -#endif -} - -static void TAG(s3v_quad)( s3vContextPtr vmesa, - const s3vVertex *_v0, - const s3vVertex *_v1, - const s3vVertex *_v2, - const s3vVertex *_v3 ) -{ - GLcontext *ctx = vmesa->glCtx; - __DRIdrawablePrivate *dPriv = vmesa->driDrawable; - - SWvertex temp_v[4]; - VERT_VARS; -#if (IND & S3v_RAST_FLAT_BIT) - FLAT_VARS; -#else - GOURAUD_VARS; -#endif -#if (IND & S3V_RAST_TEX_BIT) - TEX_VARS; -#endif -#if (IND & S3V_RAST_CULL_BIT) - GLfloat cull; -#endif - VERT_VARS_VOIDS; -#if (IND & S3v_RAST_FLAT_BIT) - FLAT_VARS_VOIDS; -#else - GOURAUD_VARS_VOIDS; -#endif -#if (IND & S3V_RAST_TEX_BIT) - TEX_VARS_VOIDS; -#endif - - DEBUG(("*** s3v_quad: ")); -#if (IND & S3V_RAST_CULL_BIT) - DEBUG(("cull ")); - /* printf(""); */ /* speed trick */ -#endif -#if (IND & S3V_RAST_FLAT_BIT) - DEBUG(("flat ")); -#endif -#if (IND & S3V_RAST_TEX_BIT) - DEBUG(("tex ")); -#endif - - DEBUG(("***\n")); - -#if 0 - s3v_print_vertex(ctx, _v0); - s3v_print_vertex(ctx, _v1); - s3v_print_vertex(ctx, _v2); - s3v_print_vertex(ctx, _v3); -#endif - s3v_translate_vertex( ctx, _v0, &temp_v[0] ); - s3v_translate_vertex( ctx, _v1, &temp_v[1] ); - s3v_translate_vertex( ctx, _v2, &temp_v[2] ); - s3v_translate_vertex( ctx, _v3, &temp_v[3] ); - - /* FIRST TRI (0,1,2) */ - - /* ROMEO */ - /* printf(""); */ /* speed trick (a) [turn on if (a) is return]*/ - - v[0] = temp_v[0]; - v[1] = temp_v[1]; - v[2] = temp_v[2]; - -#if (IND & S3V_RAST_CULL_BIT) - cull = vmesa->backface_sign * - ((v[1].attrib[FRAG_ATTRIB_WPOS][0] - v[0].attrib[FRAG_ATTRIB_WPOS][0]) * (v[0].attrib[FRAG_ATTRIB_WPOS][1] - v[2].attrib[FRAG_ATTRIB_WPOS][1]) + - (v[1].attrib[FRAG_ATTRIB_WPOS][1] - v[0].attrib[FRAG_ATTRIB_WPOS][1]) * (v[2].attrib[FRAG_ATTRIB_WPOS][0] - v[0].attrib[FRAG_ATTRIB_WPOS][0])); - - if (cull < vmesa->cull_zero /* -0.02f */) goto second; /* return; */ /* (a) */ -#endif - -#if 0 - v[0] = temp_v[0]; - v[1] = temp_v[1]; - v[2] = temp_v[2]; -#else - (void) v; -#endif - SORT_VERT(); - SET_VERT(); - - if (dy02 == 0) goto second; - - SET_XY(); - SET_DIR(); - SET_Z(); - -#if (IND & S3V_RAST_TEX_BIT) - SET_TEX_VERT(); - SET_UVWD(); -#endif - -#if (IND & S3V_RAST_FLAT_BIT) - SET_FLAT_COL(); -#else - SET_GOURAUD_COL(); -#endif - -#if (IND & S3V_RAST_TEX_BIT) - DMAOUT_CHECK(3DTRI_BASEV, 31); - SEND_UVWD(); - SEND_COL(); - SEND_VERT(); - DMAFINISH(); -#else - DMAOUT_CHECK(3DTRI_GBX, 17); - SEND_COL(); - SEND_VERT(); - DMAFINISH(); -#endif - - /* SECOND TRI (0,2,3) */ - -second: - v[0] = temp_v[0]; - v[1] = temp_v[2]; - v[2] = temp_v[3]; - -#if (IND & S3V_RAST_CULL_BIT) - cull = vmesa->backface_sign * - ((v[1].attrib[FRAG_ATTRIB_WPOS][0] - v[0].attrib[FRAG_ATTRIB_WPOS][0]) * (v[0].attrib[FRAG_ATTRIB_WPOS][1] - v[2].attrib[FRAG_ATTRIB_WPOS][1]) + - (v[1].attrib[FRAG_ATTRIB_WPOS][1] - v[0].attrib[FRAG_ATTRIB_WPOS][1]) * (v[2].attrib[FRAG_ATTRIB_WPOS][0] - v[0].attrib[FRAG_ATTRIB_WPOS][0])); - - if (cull < /* -0.02f */ vmesa->cull_zero) return; -#endif - -/* second: */ - - /* ROMEO */ - /* printf(""); */ /* speed trick */ - - v[0] = temp_v[0]; - v[1] = temp_v[2]; - v[2] = temp_v[3]; - - SORT_VERT(); - SET_VERT(); - - if (dy02 == 0) return; - - SET_XY(); - SET_DIR(); - SET_Z(); - -#if (IND & S3V_RAST_TEX_BIT) - SET_TEX_VERT(); - SET_UVWD(); -#endif - -#if (IND & S3V_RAST_FLAT_BIT) - SET_FLAT_COL(); -#else - SET_GOURAUD_COL(); -#endif - -#if (IND & S3V_RAST_TEX_BIT) - DMAOUT_CHECK(3DTRI_BASEV, 31); - SEND_UVWD(); - SEND_COL(); - SEND_VERT(); - DMAFINISH(); -#else - DMAOUT_CHECK(3DTRI_GBX, 17); - SEND_COL(); - SEND_VERT(); - DMAFINISH(); -#endif -} - -static void TAG(s3v_init)(void) -{ - s3v_point_tab[IND] = TAG(s3v_point); - s3v_line_tab[IND] = TAG(s3v_line); - s3v_tri_tab[IND] = TAG(s3v_triangle); - s3v_quad_tab[IND] = TAG(s3v_quad); -} - -#undef IND -#undef TAG diff --git a/src/mesa/drivers/dri/s3v/s3v_vb.c b/src/mesa/drivers/dri/s3v/s3v_vb.c deleted file mode 100644 index 00e375c6c4..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_vb.c +++ /dev/null @@ -1,339 +0,0 @@ -/* - * Author: Max Lingua - */ - -#include "main/glheader.h" -#include "main/mtypes.h" -#include "main/macros.h" -#include "main/colormac.h" - -#include "swrast_setup/swrast_setup.h" -#include "tnl/t_context.h" -#include "tnl/tnl.h" - -#include "s3v_context.h" -#include "s3v_vb.h" -#include "s3v_tris.h" - -#define S3V_XYZW_BIT 0x1 -#define S3V_RGBA_BIT 0x2 -#define S3V_TEX0_BIT 0x4 -#define S3V_PTEX_BIT 0x8 -#define S3V_FOG_BIT 0x10 -#define S3V_MAX_SETUP 0x20 - -static struct { - void (*emit)( GLcontext *, GLuint, GLuint, void *, GLuint ); - tnl_interp_func interp; - tnl_copy_pv_func copy_pv; - GLboolean (*check_tex_sizes)( GLcontext *ctx ); - GLuint vertex_size; - GLuint vertex_stride_shift; - GLuint vertex_format; -} setup_tab[S3V_MAX_SETUP]; - - -/* Only one vertex format, atm, so no need to give them names: - */ -#define TINY_VERTEX_FORMAT 1 -#define NOTEX_VERTEX_FORMAT 0 -#define TEX0_VERTEX_FORMAT 0 -#define TEX1_VERTEX_FORMAT 0 -#define PROJ_TEX1_VERTEX_FORMAT 0 -#define TEX2_VERTEX_FORMAT 0 -#define TEX3_VERTEX_FORMAT 0 -#define PROJ_TEX3_VERTEX_FORMAT 0 - -#define DO_XYZW (IND & S3V_XYZW_BIT) -#define DO_RGBA (IND & S3V_RGBA_BIT) -#define DO_SPEC 0 -#define DO_FOG (IND & S3V_FOG_BIT) -#define DO_TEX0 (IND & S3V_TEX0_BIT) -#define DO_TEX1 0 -#define DO_TEX2 0 -#define DO_TEX3 0 -#define DO_PTEX (IND & S3V_PTEX_BIT) - -#define VERTEX s3vVertex -#define LOCALVARS /* s3vContextPtr vmesa = S3V_CONTEXT(ctx); */ -#define GET_VIEWPORT_MAT() 0 /* vmesa->hw_viewport */ -#define GET_TEXSOURCE(n) n -#define GET_VERTEX_FORMAT() 0 -#define GET_VERTEX_SIZE() S3V_CONTEXT(ctx)->vertex_size * sizeof(GLuint) -#define GET_VERTEX_STORE() S3V_CONTEXT(ctx)->verts -#define GET_VERTEX_STRIDE_SHIFT() S3V_CONTEXT(ctx)->vertex_stride_shift -#define INVALIDATE_STORED_VERTICES() -#define GET_UBYTE_COLOR_STORE() &S3V_CONTEXT(ctx)->UbyteColor -#define GET_UBYTE_SPEC_COLOR_STORE() &S3V_CONTEXT(ctx)->UbyteSecondaryColor - -#define HAVE_HW_VIEWPORT 1 /* FIXME */ -#define HAVE_HW_DIVIDE 1 -#define HAVE_RGBA_COLOR 0 /* we're BGRA */ -#define HAVE_TINY_VERTICES 1 -#define HAVE_NOTEX_VERTICES 0 -#define HAVE_TEX0_VERTICES 0 -#define HAVE_TEX1_VERTICES 0 -#define HAVE_TEX2_VERTICES 0 -#define HAVE_TEX3_VERTICES 0 -#define HAVE_PTEX_VERTICES 1 - -/* -#define SUBPIXEL_X -.5 -#define SUBPIXEL_Y -.5 -#define UNVIEWPORT_VARS GLfloat h = S3V_CONTEXT(ctx)->driDrawable->h -#define UNVIEWPORT_X(x) x - SUBPIXEL_X -#define UNVIEWPORT_Y(y) - y + h + SUBPIXEL_Y -#define UNVIEWPORT_Z(z) z / vmesa->depth_scale -*/ - -#define PTEX_FALLBACK() /* never needed */ - -#define IMPORT_QUALIFIER -#define IMPORT_FLOAT_COLORS s3v_import_float_colors -#define IMPORT_FLOAT_SPEC_COLORS s3v_import_float_spec_colors - -#define INTERP_VERTEX setup_tab[S3V_CONTEXT(ctx)->SetupIndex].interp -#define COPY_PV_VERTEX setup_tab[S3V_CONTEXT(ctx)->SetupIndex].copy_pv - - - -/*********************************************************************** - * Generate pv-copying and translation functions * - ***********************************************************************/ - -#define TAG(x) s3v_##x -#include "tnl_dd/t_dd_vb.c" - -/*********************************************************************** - * Generate vertex emit and interp functions * - ***********************************************************************/ - - -#define IND (S3V_XYZW_BIT|S3V_RGBA_BIT) -#define TAG(x) x##_wg -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (S3V_XYZW_BIT|S3V_RGBA_BIT|S3V_TEX0_BIT) -#define TAG(x) x##_wgt0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (S3V_XYZW_BIT|S3V_RGBA_BIT|S3V_TEX0_BIT|S3V_PTEX_BIT) -#define TAG(x) x##_wgpt0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (S3V_TEX0_BIT) -#define TAG(x) x##_t0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (S3V_RGBA_BIT) -#define TAG(x) x##_g -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (S3V_RGBA_BIT|S3V_TEX0_BIT) -#define TAG(x) x##_gt0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (S3V_XYZW_BIT|S3V_RGBA_BIT|S3V_FOG_BIT) -#define TAG(x) x##_wgf -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (S3V_XYZW_BIT|S3V_RGBA_BIT|S3V_FOG_BIT|S3V_TEX0_BIT) -#define TAG(x) x##_wgft0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (S3V_XYZW_BIT|S3V_RGBA_BIT|S3V_FOG_BIT|S3V_TEX0_BIT|S3V_PTEX_BIT) -#define TAG(x) x##_wgfpt0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (S3V_FOG_BIT) -#define TAG(x) x##_f -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (S3V_RGBA_BIT | S3V_FOG_BIT) -#define TAG(x) x##_gf -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (S3V_RGBA_BIT | S3V_FOG_BIT | S3V_TEX0_BIT) -#define TAG(x) x##_gft0 -#include "tnl_dd/t_dd_vbtmp.h" - -static void init_setup_tab( void ) -{ - init_wg(); /* pos + col */ - init_wgt0(); /* pos + col + tex0 */ - init_wgpt0(); /* pos + col + p-tex0 (?) */ - init_t0(); /* tex0 */ - init_g(); /* col */ - init_gt0(); /* col + tex */ - init_wgf(); - init_wgft0(); - init_wgfpt0(); - init_f(); - init_gf(); - init_gft0(); -} - - -#if 0 -void s3vPrintSetupFlags(char *msg, GLuint flags ) -{ - fprintf(stderr, "%s(%x): %s%s%s%s%s%s\n", - msg, - (int)flags, - (flags & S3V_XYZW_BIT) ? " xyzw," : "", - (flags & S3V_RGBA_BIT) ? " rgba," : "", - (flags & S3V_SPEC_BIT) ? " spec," : "", - (flags & S3V_FOG_BIT) ? " fog," : "", - (flags & S3V_TEX0_BIT) ? " tex-0," : "", - (flags & S3V_TEX1_BIT) ? " tex-1," : ""); -} -#endif - - -void s3vCheckTexSizes( GLcontext *ctx ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - s3vContextPtr vmesa = S3V_CONTEXT( ctx ); - - if (!setup_tab[vmesa->SetupIndex].check_tex_sizes(ctx)) { - - vmesa->SetupIndex |= (S3V_PTEX_BIT|S3V_RGBA_BIT); - - if (1 || !(ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) { - tnl->Driver.Render.Interp = setup_tab[vmesa->SetupIndex].interp; - tnl->Driver.Render.CopyPV = setup_tab[vmesa->SetupIndex].copy_pv; - } - } -} - -void s3vBuildVertices( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint newinputs ) -{ - s3vContextPtr vmesa = S3V_CONTEXT( ctx ); - GLubyte *v = ((GLubyte *)vmesa->verts + - (start<vertex_stride_shift)); - GLuint stride = 1<vertex_stride_shift; - - DEBUG(("*** s3vBuildVertices ***\n")); - DEBUG(("vmesa->SetupNewInputs = 0x%x\n", vmesa->SetupNewInputs)); - DEBUG(("vmesa->SetupIndex = 0x%x\n", vmesa->SetupIndex)); - -#if 1 - setup_tab[vmesa->SetupIndex].emit( ctx, start, count, v, stride ); -#else - newinputs |= vmesa->SetupNewInputs; - vmesa->SetupNewInputs = 0; - - DEBUG(("newinputs is 0x%x\n", newinputs)); - - if (!newinputs) { - DEBUG(("!newinputs\n")); - return; - } - - if (newinputs & VERT_CLIP) { - setup_tab[vmesa->SetupIndex].emit( ctx, start, count, v, stride ); - DEBUG(("newinputs & VERT_CLIP\n")); - return; - } /* else { */ -/* GLuint ind = 0; */ - - if (newinputs & VERT_RGBA) { - DEBUG(("newinputs & VERT_RGBA\n")); - ind |= S3V_RGBA_BIT; - } - - if (newinputs & VERT_TEX0) { - DEBUG(("newinputs & VERT_TEX0\n")); - ind |= S3V_TEX0_BIT; - } - - if (newinputs & VERT_FOG_COORD) - ind |= S3V_FOG_BIT; - - if (vmesa->SetupIndex & S3V_PTEX_BIT) - ind = ~0; - - ind &= vmesa->SetupIndex; - - DEBUG(("vmesa->SetupIndex = 0x%x\n", vmesa->SetupIndex)); - DEBUG(("ind = 0x%x\n", ind)); - DEBUG(("ind & vmesa->SetupIndex = 0x%x\n", (ind & vmesa->SetupIndex))); - - if (ind) { - setup_tab[ind].emit( ctx, start, count, v, stride ); - } -#endif -} - -void s3vChooseVertexState( GLcontext *ctx ) -{ - s3vContextPtr vmesa = S3V_CONTEXT( ctx ); - TNLcontext *tnl = TNL_CONTEXT(ctx); - - GLuint ind = S3V_XYZW_BIT | S3V_RGBA_BIT; - - /* FIXME: will segv in tnl_dd/t_dd_vbtmp.h (line 196) on some demos */ -/* - if (ctx->Fog.Enabled) - ind |= S3V_FOG_BIT; -*/ - - - if (ctx->Texture.Unit[0]._ReallyEnabled) { - _tnl_need_projected_coords( ctx, GL_FALSE ); - ind |= S3V_TEX0_BIT; - } else { - _tnl_need_projected_coords( ctx, GL_TRUE ); - } - - vmesa->SetupIndex = ind; - - if (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED)) { - tnl->Driver.Render.Interp = s3v_interp_extras; - tnl->Driver.Render.CopyPV = s3v_copy_pv_extras; - } else { - tnl->Driver.Render.Interp = setup_tab[ind].interp; - tnl->Driver.Render.CopyPV = setup_tab[ind].copy_pv; - } -} - - -void s3vInitVB( GLcontext *ctx ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - GLuint size = TNL_CONTEXT(ctx)->vb.Size; - - vmesa->verts = (char *)ALIGN_MALLOC(size * 4 * 16, 32); - - { - static int firsttime = 1; - if (firsttime) { - init_setup_tab(); - firsttime = 0; - vmesa->vertex_stride_shift = 6 /* 4 */; /* FIXME - only one vertex setup */ - } - } -} - - -void s3vFreeVB( GLcontext *ctx ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - if (vmesa->verts) { - ALIGN_FREE(vmesa->verts); - vmesa->verts = 0; - } - - if (vmesa->UbyteSecondaryColor.Ptr) { - ALIGN_FREE((void *)vmesa->UbyteSecondaryColor.Ptr); - vmesa->UbyteSecondaryColor.Ptr = 0; - } - - if (vmesa->UbyteColor.Ptr) { - ALIGN_FREE((void *)vmesa->UbyteColor.Ptr); - vmesa->UbyteColor.Ptr = 0; - } -} diff --git a/src/mesa/drivers/dri/s3v/s3v_vb.h b/src/mesa/drivers/dri/s3v/s3v_vb.h deleted file mode 100644 index 0fd5437380..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_vb.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Author: Max Lingua - */ - -#ifndef S3VVB_INC -#define S3VVB_INC - -#include "main/mtypes.h" -#include "swrast/swrast.h" - -#define _S3V_NEW_VERTEX (_NEW_TEXTURE | \ - _DD_NEW_TRI_UNFILLED | \ - _DD_NEW_TRI_LIGHT_TWOSIDE) - - -extern void s3vChooseVertexState( GLcontext *ctx ); -extern void s3vCheckTexSizes( GLcontext *ctx ); -extern void s3vBuildVertices( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint newinputs ); - - -extern void s3v_import_float_colors( GLcontext *ctx ); -extern void s3v_import_float_spec_colors( GLcontext *ctx ); - -extern void s3v_translate_vertex( GLcontext *ctx, - const s3vVertex *src, - SWvertex *dst ); - -extern void s3vInitVB( GLcontext *ctx ); -extern void s3vFreeVB( GLcontext *ctx ); - -extern void s3v_print_vertex( GLcontext *ctx, const s3vVertex *v ); -#if 0 -extern void s3vPrintSetupFlags(char *msg, GLuint flags ); -#endif - -#endif diff --git a/src/mesa/drivers/dri/s3v/s3v_xmesa.c b/src/mesa/drivers/dri/s3v/s3v_xmesa.c deleted file mode 100644 index 85f1481769..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_xmesa.c +++ /dev/null @@ -1,341 +0,0 @@ -/* - * Author: Max Lingua - */ - -#include "s3v_context.h" -#include "s3v_vb.h" -#include "s3v_dri.h" -#include "main/context.h" -#include "main/matrix.h" -#include "main/framebuffer.h" -#include "main/renderbuffer.h" -#include "main/viewport.h" - -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "tnl/tnl.h" -#include "vbo/vbo.h" - -/* #define DEBUG(str) printf str */ - -static const __DRIconfig ** -s3vInitScreen(__DRIscreen *sPriv) -{ - sPriv->private = (void *) s3vCreateScreen( sPriv ); - - if (!sPriv->private) { - s3vDestroyScreen( sPriv ); - return GL_FALSE; - } - - return NULL; -} - -static void -s3vDestroyContext(__DRIcontextPrivate *driContextPriv) -{ - s3vContextPtr vmesa = (s3vContextPtr)driContextPriv->driverPrivate; - - if (vmesa) { - _swsetup_DestroyContext( vmesa->glCtx ); - _tnl_DestroyContext( vmesa->glCtx ); - _vbo_DestroyContext( vmesa->glCtx ); - _swrast_DestroyContext( vmesa->glCtx ); - - s3vFreeVB( vmesa->glCtx ); - - /* free the Mesa context */ - vmesa->glCtx->DriverCtx = NULL; - _mesa_destroy_context(vmesa->glCtx); - - _mesa_free(vmesa); - driContextPriv->driverPrivate = NULL; - } -} - - -static GLboolean -s3vCreateBuffer( __DRIscreenPrivate *driScrnPriv, - __DRIdrawablePrivate *driDrawPriv, - const __GLcontextModes *mesaVis, - GLboolean isPixmap ) -{ - s3vScreenPtr screen = (s3vScreenPtr) driScrnPriv->private; - - if (isPixmap) { - return GL_FALSE; /* not implemented */ - } - else { - struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis); - - { - driRenderbuffer *frontRb - = driNewRenderbuffer(GL_RGBA, NULL, screen->cpp, - screen->frontOffset, screen->frontPitch, - driDrawPriv); - s3vSetSpanFunctions(frontRb, mesaVis); - _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base); - } - - if (mesaVis->doubleBufferMode) { - driRenderbuffer *backRb - = driNewRenderbuffer(GL_RGBA, NULL, screen->cpp, - screen->backOffset, screen->backPitch, - driDrawPriv); - s3vSetSpanFunctions(backRb, mesaVis); - _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base); - backRb->backBuffer = GL_TRUE; - } - - if (mesaVis->depthBits == 16) { - driRenderbuffer *depthRb - = driNewRenderbuffer(GL_DEPTH_COMPONENT16, NULL, screen->cpp, - screen->depthOffset, screen->depthPitch, - driDrawPriv); - s3vSetSpanFunctions(depthRb, mesaVis); - _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); - } - else if (mesaVis->depthBits == 24) { - driRenderbuffer *depthRb - = driNewRenderbuffer(GL_DEPTH_COMPONENT24, NULL, screen->cpp, - screen->depthOffset, screen->depthPitch, - driDrawPriv); - s3vSetSpanFunctions(depthRb, mesaVis); - _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); - } - - /* no h/w stencil yet? - if (mesaVis->stencilBits > 0) { - driRenderbuffer *stencilRb - = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, NULL, - screen->cpp, screen->depthOffset, - screen->depthPitch, driDrawPriv); - s3vSetSpanFunctions(stencilRb, mesaVis); - _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base); - } - */ - - _mesa_add_soft_renderbuffers(fb, - GL_FALSE, /* color */ - GL_FALSE, /* depth */ - mesaVis->stencilBits > 0, - mesaVis->accumRedBits > 0, - GL_FALSE, /* alpha */ - GL_FALSE /* aux */); - driDrawPriv->driverPrivate = (void *) fb; - - return (driDrawPriv->driverPrivate != NULL); - } -} - - -static void -s3vDestroyBuffer(__DRIdrawablePrivate *driDrawPriv) -{ - _mesa_reference_framebuffer((GLframebuffer **)(&(driDrawPriv->driverPrivate)), NULL); -} - -static void -s3vSwapBuffers(__DRIdrawablePrivate *drawablePrivate) -{ - __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate; - __DRIscreenPrivate *sPriv; - GLcontext *ctx; - s3vContextPtr vmesa; - s3vScreenPtr s3vscrn; - - vmesa = (s3vContextPtr) dPriv->driContextPriv->driverPrivate; - sPriv = vmesa->driScreen; - s3vscrn = vmesa->s3vScreen; - ctx = vmesa->glCtx; - - DEBUG(("*** s3vSwapBuffers ***\n")); - -/* DMAFLUSH(); */ - - _mesa_notifySwapBuffers( ctx ); - - vmesa = (s3vContextPtr) dPriv->driContextPriv->driverPrivate; -/* driScrnPriv = vmesa->driScreen; */ - -/* if (vmesa->EnabledFlags & S3V_BACK_BUFFER) */ - -/* _mesa_notifySwapBuffers( ctx ); */ -#if 1 -{ - int x0, y0, x1, y1; -/* - int nRect = dPriv->numClipRects; - XF86DRIClipRectPtr pRect = dPriv->pClipRects; - - __DRIscreenPrivate *driScrnPriv = vmesa->driScreen; -*/ - -/* - DEBUG(("s3vSwapBuffers: S3V_BACK_BUFFER = 1 - nClip = %i\n", nRect)); -*/ -/* vmesa->drawOffset=vmesa->s3vScreen->backOffset; */ - - x0 = dPriv->x; - y0 = dPriv->y; - - x1 = x0 + dPriv->w - 1; - y1 = y0 + dPriv->h - 1; - - DMAOUT_CHECK(BITBLT_SRC_BASE, 15); - DMAOUT(vmesa->s3vScreen->backOffset); - DMAOUT(0); /* 0xc0000000 */ - DMAOUT( ((x0 << 16) | x1) ); - DMAOUT( ((y0 << 16) | y1) ); - DMAOUT( (vmesa->DestStride << 16) | vmesa->SrcStride ); - DMAOUT( (~(0)) ); - DMAOUT( (~(0)) ); - DMAOUT(0); - DMAOUT(0); - /* FIXME */ - DMAOUT(0); - DMAOUT(0); - DMAOUT( (0x01 | /* Autoexecute */ - 0x02 | /* clip */ - 0x04 | /* 16 bit */ - 0x20 | /* draw */ - 0x400 | /* word alignment (bit 10=1) */ - (0x2 << 11) | /* offset = 1 byte */ - (0xCC << 17) | /* rop #204 */ - (0x3 << 25)) ); /* l-r, t-b */ - DMAOUT(vmesa->ScissorWH); - DMAOUT( /* 0 */ vmesa->SrcXY ); - DMAOUT( (dPriv->x << 16) | dPriv->y ); - DMAFINISH(); - - DMAFLUSH(); - - vmesa->restore_primitive = -1; - -} -#endif -} - -static GLboolean -s3vMakeCurrent(__DRIcontextPrivate *driContextPriv, - __DRIdrawablePrivate *driDrawPriv, - __DRIdrawablePrivate *driReadPriv) -{ - int x1,x2,y1,y2; - int cx, cy, cw, ch; - unsigned int src_stride, dest_stride; - int cl; - - s3vContextPtr vmesa; - __DRIdrawablePrivate *dPriv = driDrawPriv; - vmesa = (s3vContextPtr) dPriv->driContextPriv->driverPrivate; - - DEBUG(("s3vMakeCurrent\n")); - - DEBUG(("dPriv->x=%i y=%i w=%i h=%i\n", dPriv->x, dPriv->y, - dPriv->w, dPriv->h)); - - if (driContextPriv) { - GET_CURRENT_CONTEXT(ctx); - s3vContextPtr oldVirgeCtx = ctx ? S3V_CONTEXT(ctx) : NULL; - s3vContextPtr newVirgeCtx = (s3vContextPtr) driContextPriv->driverPrivate; - - if ( newVirgeCtx != oldVirgeCtx ) { - - newVirgeCtx->dirty = ~0; - cl = 1; - DEBUG(("newVirgeCtx != oldVirgeCtx\n")); -/* s3vUpdateClipping(newVirgeCtx->glCtx ); */ - } - - if (newVirgeCtx->driDrawable != driDrawPriv) { - newVirgeCtx->driDrawable = driDrawPriv; - DEBUG(("driDrawable != driDrawPriv\n")); - s3vUpdateWindow ( newVirgeCtx->glCtx ); - s3vUpdateViewportOffset( newVirgeCtx->glCtx ); -/* s3vUpdateClipping(newVirgeCtx->glCtx ); */ - } -/* - s3vUpdateWindow ( newVirgeCtx->glCtx ); - s3vUpdateViewportOffset( newVirgeCtx->glCtx ); -*/ - -/* - _mesa_make_current( newVirgeCtx->glCtx, - (GLframebuffer *) driDrawPriv->driverPrivate, - (GLframebuffer *) driReadPriv->driverPrivate ); - - _mesa_set_viewport(newVirgeCtx->glCtx, 0, 0, - newVirgeCtx->driDrawable->w, - newVirgeCtx->driDrawable->h); -*/ - -#if 0 - newVirgeCtx->Window &= ~W_GIDMask; - newVirgeCtx->Window |= (driDrawPriv->index << 5); - CHECK_DMA_BUFFER(newVirgeCtx,1); - WRITE(newVirgeCtx->buf, S3VWindow, newVirgeCtx->Window); -#endif - - newVirgeCtx->new_state |= S3V_NEW_WINDOW; /* FIXME */ - - _mesa_make_current( newVirgeCtx->glCtx, - (GLframebuffer *) driDrawPriv->driverPrivate, - (GLframebuffer *) driReadPriv->driverPrivate ); - - if (!newVirgeCtx->glCtx->Viewport.Width) { - _mesa_set_viewport(newVirgeCtx->glCtx, 0, 0, - driDrawPriv->w, driDrawPriv->h); - -/* s3vUpdateClipping(newVirgeCtx->glCtx ); */ - } - -/* - if (cl) { - s3vUpdateClipping(newVirgeCtx->glCtx ); - cl =0; - } -*/ - - newVirgeCtx->new_state |= S3V_NEW_CLIP; - - if (1) { - cx = dPriv->x; - cw = dPriv->w; - cy = dPriv->y; - ch = dPriv->h; - } - - x1 = y1 = 0; - x2 = cw-1; - y2 = ch-1; - - /* src_stride = vmesa->s3vScreen->w * vmesa->s3vScreen->cpp; - dest_stride = ((x2+31)&~31) * vmesa->s3vScreen->cpp; */ - src_stride = vmesa->driScreen->fbWidth * 2; - dest_stride = ((x2+31)&~31) * 2; - } else { - _mesa_make_current( NULL, NULL, NULL ); - } - - return GL_TRUE; -} - - -static GLboolean -s3vUnbindContext( __DRIcontextPrivate *driContextPriv ) -{ - return GL_TRUE; -} - -const struct __DriverAPIRec driDriverAPI = { - .InitScreen = s3vInitScreen, - .DestroyScreen = s3vDestroyScreen, - .CreateContext = s3vCreateContext, - .DestroyContext = s3vDestroyContext, - .CreateBuffer = s3vCreateBuffer, - .DestroyBuffer = s3vDestroyBuffer, - .SwapBuffers = s3vSwapBuffers, - .MakeCurrent = s3vMakeCurrent, - .UnbindContext = s3vUnbindContext, -}; diff --git a/src/mesa/drivers/dri/s3v/s3virgetri.h b/src/mesa/drivers/dri/s3v/s3virgetri.h deleted file mode 100644 index 5519cfd741..0000000000 --- a/src/mesa/drivers/dri/s3v/s3virgetri.h +++ /dev/null @@ -1,383 +0,0 @@ -/* - * Author: Max Lingua - */ - -#define LOCAL_VARS \ - int vert0, vert1, vert2; \ - GLfloat y0, y1, y2, ydiff; \ - int iy0, iy1, iy2; \ - int x0, x1, x2, z0, z1, z2; \ - int dy01, dy02, dy12, dx01, dx02, dx12; \ - int delt02, delt01, delt12, end01, end12, start02; \ - int zstart, arstart, gbstart; \ - int deltzy, deltzx, deltarx, deltgbx, deltary, deltgby; \ - GLubyte (*colours)[4]; \ - GLubyte (*scolours)[4]; \ - static int tp = 0; \ - int tmp, lr - -#define LOCAL_TEX_VARS \ - int u0, u1, u2; \ - GLfloat ru0, ru1, ru2; \ - int v0, v1, v2; \ - GLfloat rv0, rv1, rv2; \ - GLfloat w0, w1, w2; \ - GLfloat rw0, rw1, rw2; \ - int baseu, basev; \ - int d0, d1, d2; \ - int deltdx, deltvx, deltux, deltdy, deltvy, deltuy; \ - int deltwx, deltwy; \ - int rbaseu, rbasev; \ - int dstart, ustart, wstart, vstart; \ - static int stmp = 0; \ - s3virgeTextureObject_t *t - -#define CULL_BACKFACE() \ - do { \ - GLfloat *w0 = VB->Win.data[e0]; \ - GLfloat *w1 = VB->Win.data[e1]; \ - GLfloat *w2 = VB->Win.data[e2]; \ - float cull; \ - cull = ctx->backface_sign * ((w1[0] - w0[0]) * (w0[1] - w2[1]) + \ - (w1[1] - w0[1]) * (w2[0] - w0[0])); \ - if (cull < 0) \ - return; \ - } while (0) - -#define SORT_VERTICES() \ - do { \ - y0 = VB->Win.data[e0][1]; \ - y1 = VB->Win.data[e1][1]; \ - y2 = VB->Win.data[e2][1]; \ - if (y1 > y0) { \ - if (y2 > y0) { \ - vert0 = e0; \ - if (y1 > y2) { vert2 = e1; vert1 = e2; } else { vert2 = e2; vert1 = e1; } \ - } else { vert0 = e2; vert1 = e0; vert2 = e1; } \ - } else { \ - if (y2 > y0) { vert0 = e1; vert1 = e0; vert2 = e2; } else { \ - vert2 = e0; \ - if (y2 > y1) { vert0 = e1; vert1 = e2; } else { vert0 = e2; vert1 = e1; } \ - } \ - } \ - } while (0) - -#define SET_VARIABLES() \ - do { \ - iy0 = y0 = ((s3virgeDB->height - (VB->Win.data[vert0][1]))); \ - iy1 = y1 = ((s3virgeDB->height - (VB->Win.data[vert1][1]))); \ - iy2 = y2 = ((s3virgeDB->height - (VB->Win.data[vert2][1]))); \ - if (iy0 == iy2) { return; } \ - ydiff = y0 - (float)iy0; \ - x0 = ((VB->Win.data[vert0][0]) * 1024.0 * 1024.0); \ - x1 = ((VB->Win.data[vert1][0]) * 1024.0 * 1024.0); \ - x2 = ((VB->Win.data[vert2][0]) * 1024.0 * 1024.0); \ - z0 = (VB->Win.data[vert0][2] * 1024.0 * 32.0); \ - z1 = (VB->Win.data[vert1][2] * 1024.0 * 32.0); \ - z2 = (VB->Win.data[vert2][2] * 1024.0 * 32.0); \ - dx12 = x2 - x1; \ - dy12 = iy1 - iy2; \ - dx01 = x1 - x0; \ - dy01 = iy0 - iy1; \ - dx02 = x2 - x0; \ - dy02 = iy0 - iy2; \ - delt12 = delt02 = delt01 = 0; \ - } while (0) - -#define SET_TEX_VARIABLES() \ - do { \ - t = ((s3virgeTextureObject_t *)ctx->Texture.Unit[0].Current->DriverData); \ - deltwx = deltwy = wstart = deltdx = deltdy = dstart = 0; \ - u0 = (VB->TexCoordPtr[0]->data[vert0][0] * (GLfloat)(t->tObj->Image[0]->Width) * 256.0); \ - u1 = (VB->TexCoordPtr[0]->data[vert1][0] * (GLfloat)(t->tObj->Image[0]->Width) * 256.0); \ - u2 = (VB->TexCoordPtr[0]->data[vert2][0] * (GLfloat)(t->tObj->Image[0]->Width) * 256.0); \ - v0 = (VB->TexCoordPtr[0]->data[vert0][1] * (GLfloat)(t->tObj->Image[0]->Height) * 256.0); \ - v1 = (VB->TexCoordPtr[0]->data[vert1][1] * (GLfloat)(t->tObj->Image[0]->Height) * 256.0); \ - v2 = (VB->TexCoordPtr[0]->data[vert2][1] * (GLfloat)(t->tObj->Image[0]->Height) * 256.0); \ - w0 = (VB->Win.data[vert0][3]); \ - w1 = (VB->Win.data[vert1][3]); \ - w2 = (VB->Win.data[vert2][3]); \ - } while (0) - -#define FLATSHADE_COLORS() \ - do { \ - GLubyte *col = &(colours[pv][0]); \ - deltarx = deltary = deltgbx = deltgby = 0; \ - gbstart = (((col[1]) << 23) | ((col[2]) << 7)); \ - arstart = (((col[3]) << 23) | ((col[0]) << 7)); \ - } while (0) - -#define GOURAUD_COLORS() \ - do { \ - int ctmp, ctmp2, ctmp3, ctmp4; \ - GLubyte *col0, *col1, *col2; \ - col0 = &(colours[vert0][0]); \ - col1 = &(colours[vert1][0]); \ - col2 = &(colours[vert2][0]); \ - ctmp = ((col2[3] - col0[3]) << 7) / dy02; \ - ctmp2 = ((col2[0] - col0[0]) << 7) / dy02; \ - deltary = ((ctmp << 16) & 0xFFFF0000) | (ctmp2 & 0xFFFF); \ - ctmp3 = ((col2[1] - col0[1]) << 7) / dy02; \ - ctmp4 = ((col2[2] - col0[2]) << 7) / dy02; \ - deltgby = ((ctmp3 << 16) & 0xFFFF0000) | (ctmp4 & 0xFFFF); \ - gbstart = (((int)((ydiff * ctmp3) + (col0[1] << 7)) << 16) & 0x7FFF0000) | \ - ((int)((ydiff * ctmp4) + (col0[2] << 7)) & 0x7FFF); \ - arstart = (((int)((ydiff * ctmp) + (col0[3] << 7)) << 16) & 0x7FFF0000) | \ - ((int)((ydiff * ctmp2) + (col0[0] << 7)) & 0x7FFF); \ - if (tmp) { \ - int ax, rx, gx, bx; \ - ax = ((col1[3] << 7) - (dy01 * ctmp + (col0[3] << 7))) / tmp; \ - rx = ((col1[0] << 7) - (dy01 * ctmp2 + (col0[0] << 7))) / tmp; \ - gx = ((col1[1] << 7) - (dy01 * ctmp3 + (col0[1] << 7))) / tmp; \ - bx = ((col1[2] << 7) - (dy01 * ctmp4 + (col0[2] << 7))) / tmp; \ - deltarx = ((ax << 16) & 0xFFFF0000) | (rx & 0xFFFF); \ - deltgbx = ((gx << 16) & 0xFFFF0000) | (bx & 0xFFFF); \ - } else { \ - deltgbx = deltarx = 0; \ - } \ - } while (0) - -#define SET_XY() \ - do { \ - delt02 = dx02 / dy02; \ - if (dy12) delt12 = dx12 / dy12; \ - if (dy01) delt01 = dx01 / dy01; \ - start02 = (ydiff * delt02) + x0; \ - end01 = (ydiff * delt01) + x0; \ - end12 = ((y1 - (GLfloat)iy1) * delt12) + x1; \ - } while (0) - -#define SET_DIR() \ - do { \ - tmp = x1 - (dy01 * delt02 + x0); \ - if (tmp > 0) { \ - lr = 0x80000000; \ - } else { \ - tmp *= -1; \ - lr = 0; \ - } \ - tmp >>= 20; \ - } while (0) - -#define SET_Z() \ - do { \ - deltzy = (z2 - z0) / dy02; \ - if (tmp) { \ - deltzx = (z1 - (dy01 * deltzy + z0)) / tmp; \ - } else { deltzx = 0; } \ - zstart = (deltzy * ydiff) + z0; \ - } while (0) - -#define SET_BASEUV() \ - do { \ - if (u0 < u1) { \ - if (u0 < u2) { \ - baseu = u0; \ - } else { \ - baseu = u2; \ - } \ - } else { \ - if (u1 < u2) { \ - baseu = u1; \ - } else { \ - baseu = u2; \ - } \ - } \ - if (v0 < v1) { \ - if (v0 < v2) { \ - basev = v0; \ - } else { \ - basev = v2; \ - } \ - } else { \ - if (v1 < v2) { \ - basev = v1; \ - } else { \ - basev = v2; \ - } \ - } \ - } while (0) - -#define SET_RW() \ - do { \ - /* GLfloat minW; \ - if (w0 < w1) { \ - if (w0 < w2) { \ - minW = w0; \ - } else { \ - minW = w2; \ - } \ - } else { \ - if (w1 < w2) { \ - minW = w1; \ - } else { \ - minW = w2; \ - } \ - } */ \ - rw0 = (512.0 * w0); \ - rw1 = (512.0 * w1); \ - rw2 = (512.0 * w2); \ - } while (0) - - -#define SET_D() \ - do { \ - GLfloat sxy, suv; \ - int lev; \ - suv = (VB->TexCoordPtr[0]->data[vert0][0] - \ - VB->TexCoordPtr[0]->data[vert2][0]) * \ - (VB->TexCoordPtr[0]->data[vert1][1] - \ - VB->TexCoordPtr[0]->data[vert2][1]) - \ - (VB->TexCoordPtr[0]->data[vert1][0] - \ - VB->TexCoordPtr[0]->data[vert2][0]) * \ - (VB->TexCoordPtr[0]->data[vert0][1] - \ - VB->TexCoordPtr[0]->data[vert2][2]); \ - sxy = (VB->Win.data[vert0][0] - \ - VB->Win.data[vert2][0]) * \ - (VB->Win.data[vert1][1] - \ - VB->Win.data[vert2][1]) - \ - (VB->Win.data[vert1][0] - \ - VB->Win.data[vert2][0]) * \ - (VB->Win.data[vert0][1] - \ - VB->Win.data[vert2][2]); \ - if (sxy < 0) sxy *= -1.0; \ - if (suv < 0) suv *= -1.0; \ - lev = *(int*)&suv - *(int *)&sxy; \ - if (lev < 0) \ - lev = 0; \ - else \ - lev >>=23; \ - dstart = (lev << 27); \ - } while (0) - - - -#define SET_UVWD() \ - do { \ - SET_BASEUV(); \ - SET_RW(); \ - SET_D(); \ - ru0 = (((u0 - baseu) * rw0)); \ - ru1 = (((u1 - baseu) * rw1)); \ - ru2 = (((u2 - baseu) * rw2)); \ - rv0 = (((v0 - basev) * rw0)); \ - rv1 = (((v1 - basev) * rw1)); \ - rv2 = (((v2 - basev) * rw2)); \ - while (baseu < 0) { baseu += (t->tObj->Image[0]->Width << 8); } \ - while (basev < 0) { basev += (t->tObj->Image[0]->Height << 8); } \ - if (!(baseu & 0xFF)) { baseu = (baseu >> 8); } else { baseu = (baseu >> 8) + 1; } \ - if ((basev & 0x80) || !(basev & 0xFF)) { basev = (basev >> 8); } else { basev = (basev >> 8) - 1; } \ - rbaseu = (baseu) << (16 - t->widthLog2); \ - rbasev = (basev) << (16 - t->widthLog2); \ - deltuy = (((ru2 - ru0) / dy02)); \ - deltvy = (((rv2 - rv0) / dy02)); \ - rw0 *= (1024.0 * 512.0); \ - rw1 *= (1024.0 * 512.0); \ - rw2 *= (1024.0 * 512.0); \ - deltwy = ((rw2 - rw0) / dy02); \ - if (tmp) { \ - deltux = ((ru1 - (dy01 * deltuy + ru0)) / tmp); \ - deltvx = ((rv1 - (dy01 * deltvy + rv0)) / tmp); \ - deltwx = ((rw1 - (dy01 * deltwy + rw0)) / tmp); \ - } else { deltux = deltvx = deltwx = 0; } \ - ustart = (deltuy * ydiff) + (ru0); \ - vstart = (deltvy * ydiff) + (rv0); \ - wstart = (deltwy * ydiff) + (rw0); \ - } while (0) - - -#define SEND_COLORS() \ - do { \ - WAITFIFOEMPTY(6); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_GBX), deltgbx); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_ARX), deltarx); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_GBY), deltgby); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_ARY), deltary); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_GS_BS), gbstart); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_AS_RS), arstart); \ - } while (0) - -#define SEND_VERTICES() \ - do { \ - WAITFIFOEMPTY(6); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_ZSTART), zstart); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_ZXD), deltzx); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_ZYD), deltzy); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_TXDELTA12), delt12); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_TXEND12), end12); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_TXDELTA01), delt01); \ - WAITFIFOEMPTY(5); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_TXEND01), end01); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_TXDELTA02), delt02); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_TXSTART02), start02); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_TYS), iy0); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_TY01_Y12), \ - ((((iy0 - iy1) & 0x7FF) << 16) | \ - ((iy1 - iy2) & 0x7FF) | lr)); \ - } while (0) - -#define SEND_UVWD() \ - do { \ - WAITFIFOEMPTY(7); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_BASEV), (rbasev & 0xFFFF)); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_BASEU), (0xa0000000 | (rbaseu & 0xFFFF))); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_WXD), deltwx); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_WYD), deltwy); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_WSTART), wstart); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_DXD), deltdx); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_VXD), deltvx); \ - WAITFIFOEMPTY(7); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_UXD), deltux); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_DYD), deltdy); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_VYD), deltvy); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_UYD), deltuy); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_DSTART), dstart); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_VSTART), vstart); \ - OUTREG( (S3VIRGE_3DTRI_REG | S3VIRGE_3DTRI_USTART), ustart); \ - } while (0) - -#define DMA_SEND_UVWD() \ - do { \ - DMAOUT((rbasev & 0xFFFF)); \ - DMAOUT((0xa0000000 | (rbaseu & 0xFFFF))); \ - DMAOUT(deltwx); \ - DMAOUT(deltwy); \ - DMAOUT(wstart); \ - DMAOUT(deltdx); \ - DMAOUT(deltvx); \ - DMAOUT(deltux); \ - DMAOUT(deltdy); \ - DMAOUT(deltvy); \ - DMAOUT(deltuy); \ - DMAOUT(dstart); \ - DMAOUT(vstart); \ - DMAOUT(ustart); \ - } while (0) - - -#define DMA_SEND_COLORS() \ - do { \ - DMAOUT(deltgbx); \ - DMAOUT(deltarx); \ - DMAOUT(deltgby); \ - DMAOUT(deltary); \ - DMAOUT(gbstart); \ - DMAOUT(arstart); \ - } while (0) - -#define DMA_SEND_VERTICES() \ - do { \ - DMAOUT(deltzx); \ - DMAOUT(deltzy); \ - DMAOUT(zstart); \ - DMAOUT(delt12); \ - DMAOUT(end12); \ - DMAOUT(delt01); \ - DMAOUT(end01); \ - DMAOUT(delt02); \ - DMAOUT(start02); \ - DMAOUT(iy0); \ - DMAOUT(((((iy0 - iy1) & 0x7FF) << 16) | \ - ((iy1 - iy2) & 0x7FF) | lr)); \ - } while (0) - -- cgit v1.2.3 From fd7ee2bcb74edf8c4412a244c33fd4749509b912 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Thu, 22 Oct 2009 12:57:13 -0700 Subject: Kill off trident. Hm. I could have said "chew trident and spit it out," or perhaps "spear trident," instead. Dohoho. --- src/mesa/drivers/dri/trident/Makefile | 25 - src/mesa/drivers/dri/trident/trident_context.c | 465 ---------- src/mesa/drivers/dri/trident/trident_context.h | 242 ----- src/mesa/drivers/dri/trident/trident_dd.c | 110 --- src/mesa/drivers/dri/trident/trident_dri.h | 28 - src/mesa/drivers/dri/trident/trident_lock.h | 11 - src/mesa/drivers/dri/trident/trident_state.c | 548 ------------ src/mesa/drivers/dri/trident/trident_tris.c | 1125 ------------------------ src/mesa/drivers/dri/trident/trident_vb.c | 434 --------- 9 files changed, 2988 deletions(-) delete mode 100644 src/mesa/drivers/dri/trident/Makefile delete mode 100644 src/mesa/drivers/dri/trident/trident_context.c delete mode 100644 src/mesa/drivers/dri/trident/trident_context.h delete mode 100644 src/mesa/drivers/dri/trident/trident_dd.c delete mode 100644 src/mesa/drivers/dri/trident/trident_dri.h delete mode 100644 src/mesa/drivers/dri/trident/trident_lock.h delete mode 100644 src/mesa/drivers/dri/trident/trident_state.c delete mode 100644 src/mesa/drivers/dri/trident/trident_tris.c delete mode 100644 src/mesa/drivers/dri/trident/trident_vb.c (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/trident/Makefile b/src/mesa/drivers/dri/trident/Makefile deleted file mode 100644 index bd9b7f35a2..0000000000 --- a/src/mesa/drivers/dri/trident/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -# src/mesa/drivers/dri/trident/Makefile - -TOP = ../../../../.. -include $(TOP)/configs/current - -LIBNAME = trident_dri.so - -# Not yet -# MINIGLX_SOURCES = server/trident_dri.c - -DRIVER_SOURCES = \ - trident_context.c \ - trident_state.c \ - trident_vb.c \ - trident_dd.c \ - trident_tris.c - -C_SOURCES = \ - $(COMMON_SOURCES) \ - $(DRIVER_SOURCES) - -ASM_SOURCES = - -include ../Makefile.template - diff --git a/src/mesa/drivers/dri/trident/trident_context.c b/src/mesa/drivers/dri/trident/trident_context.c deleted file mode 100644 index b5126b07ea..0000000000 --- a/src/mesa/drivers/dri/trident/trident_context.c +++ /dev/null @@ -1,465 +0,0 @@ -/* - * Copyright 2002 by Alan Hourihane, Sychdyn, North Wales, UK. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Alan Hourihane not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Alan Hourihane makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: Alan Hourihane, - * - * Trident CyberBladeXP driver. - * - */ -#include "trident_dri.h" -#include "trident_context.h" -#include "trident_lock.h" - -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "vbo/vbo.h" - -#include "tnl/tnl.h" -#include "tnl/t_pipeline.h" - -#include "main/context.h" -#include "main/simple_list.h" -#include "main/matrix.h" -#include "main/extensions.h" -#include "main/framebuffer.h" -#include "main/renderbuffer.h" -#include "main/viewport.h" -#if defined(USE_X86_ASM) -#include "x86/common_x86_asm.h" -#endif -#include "main/simple_list.h" -#include "main/mm.h" -#include "drirenderbuffer.h" - -#include "drivers/common/driverfuncs.h" -#include "dri_util.h" -#include "utils.h" - -static const struct tnl_pipeline_stage *trident_pipeline[] = { - &_tnl_vertex_transform_stage, - &_tnl_normal_transform_stage, - &_tnl_lighting_stage, - &_tnl_texgen_stage, - &_tnl_texture_transform_stage, - &_tnl_render_stage, - 0, -}; - - -static GLboolean -tridentCreateContext( const __GLcontextModes *glVisual, - __DRIcontextPrivate *driContextPriv, - void *sharedContextPrivate) -{ - GLcontext *ctx, *shareCtx; - __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv; - tridentContextPtr tmesa; - tridentScreenPtr tridentscrn; - struct dd_function_table functions; -#if 0 - drm_trident_sarea_t *saPriv=(drm_trident_sarea_t *)(((char*)sPriv->pSAREA)+ - sizeof(XF86DRISAREARec)); -#endif - - tmesa = (tridentContextPtr) CALLOC( sizeof(*tmesa) ); - if ( !tmesa ) return GL_FALSE; - - /* Allocate the Mesa context */ - if (sharedContextPrivate) - shareCtx = ((tridentContextPtr) sharedContextPrivate)->glCtx; - else - shareCtx = NULL; - - _mesa_init_driver_functions(&functions); - - tmesa->glCtx = - _mesa_create_context(glVisual, shareCtx, &functions, (void *)tmesa); - - if (!tmesa->glCtx) { - FREE(tmesa); - return GL_FALSE; - } - - tmesa->driContext = driContextPriv; - tmesa->driScreen = sPriv; - tmesa->driDrawable = NULL; /* Set by XMesaMakeCurrent */ - - tmesa->hHWContext = driContextPriv->hHWContext; - tmesa->driHwLock = (drmLock *)&sPriv->pSAREA->lock; - tmesa->driFd = sPriv->fd; -#if 0 - tmesa->sarea = saPriv; -#endif - - tridentscrn = tmesa->tridentScreen = (tridentScreenPtr)(sPriv->private); - - ctx = tmesa->glCtx; - - ctx->Const.MaxTextureLevels = 13; /* 4K by 4K? Is that right? */ - ctx->Const.MaxTextureUnits = 1; /* Permedia 3 */ - - ctx->Const.MinLineWidth = 0.0; - ctx->Const.MaxLineWidth = 255.0; - - ctx->Const.MinLineWidthAA = 0.0; - ctx->Const.MaxLineWidthAA = 65536.0; - - ctx->Const.MinPointSize = 0.0; - ctx->Const.MaxPointSize = 255.0; - - ctx->Const.MinPointSizeAA = 0.5; /* 4x4 quality mode */ - ctx->Const.MaxPointSizeAA = 16.0; - ctx->Const.PointSizeGranularity = 0.25; - - ctx->Const.MaxDrawBuffers = 1; - -#if 0 - tmesa->texHeap = mmInit( 0, tmesa->tridentScreen->textureSize ); - - make_empty_list(&tmesa->TexObjList); - make_empty_list(&tmesa->SwappedOut); - - tmesa->CurrentTexObj[0] = 0; - tmesa->CurrentTexObj[1] = 0; /* Permedia 3, second texture */ - - tmesa->RenderIndex = ~0; -#endif - - /* Initialize the software rasterizer and helper modules. - */ - _swrast_CreateContext( ctx ); - _vbo_CreateContext( ctx ); - _tnl_CreateContext( ctx ); - _swsetup_CreateContext( ctx ); - - /* Install the customized pipeline: - */ - _tnl_destroy_pipeline( ctx ); - _tnl_install_pipeline( ctx, trident_pipeline ); - - /* Configure swrast to match hardware characteristics: - */ - _swrast_allow_pixel_fog( ctx, GL_FALSE ); - _swrast_allow_vertex_fog( ctx, GL_TRUE ); - - tridentInitVB( ctx ); - tridentDDInitExtensions( ctx ); - tridentDDInitDriverFuncs( ctx ); - tridentDDInitStateFuncs( ctx ); -#if 0 - tridentDDInitSpanFuncs( ctx ); - tridentDDInitTextureFuncs( ctx ); -#endif - tridentDDInitTriFuncs( ctx ); - tridentDDInitState( tmesa ); - - driContextPriv->driverPrivate = (void *)tmesa; - - UNLOCK_HARDWARE(tmesa); - - return GL_TRUE; -} - -static void -tridentDestroyContext(__DRIcontextPrivate *driContextPriv) -{ - tridentContextPtr tmesa = (tridentContextPtr)driContextPriv->driverPrivate; - - if (tmesa) { - _swsetup_DestroyContext( tmesa->glCtx ); - _tnl_DestroyContext( tmesa->glCtx ); - _vbo_DestroyContext( tmesa->glCtx ); - _swrast_DestroyContext( tmesa->glCtx ); - - /* free the Mesa context */ - tmesa->glCtx->DriverCtx = NULL; - _mesa_destroy_context(tmesa->glCtx); - - _mesa_free(tmesa); - driContextPriv->driverPrivate = NULL; - } -} - - -static GLboolean -tridentCreateBuffer( __DRIscreenPrivate *driScrnPriv, - __DRIdrawablePrivate *driDrawPriv, - const __GLcontextModes *mesaVis, - GLboolean isPixmap ) -{ - tridentScreenPtr screen = (tridentScreenPtr) driScrnPriv->private; - - if (isPixmap) { - return GL_FALSE; /* not implemented */ - } - else { - struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis); - - { - driRenderbuffer *frontRb - = driNewRenderbuffer(GL_RGBA, NULL, screen->cpp, - screen->frontOffset, screen->frontPitch, - driDrawPriv); - /* - tridentSetSpanFunctions(frontRb, mesaVis); - */ - _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base); - } - - if (mesaVis->doubleBufferMode) { - driRenderbuffer *backRb - = driNewRenderbuffer(GL_RGBA, NULL, screen->cpp, - screen->backOffset, screen->backPitch, - driDrawPriv); - /* - tridentSetSpanFunctions(backRb, mesaVis); - */ - _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base); - } - - if (mesaVis->depthBits == 16) { - driRenderbuffer *depthRb - = driNewRenderbuffer(GL_DEPTH_COMPONENT16, NULL, screen->cpp, - screen->depthOffset, screen->depthPitch, - driDrawPriv); - /* - tridentSetSpanFunctions(depthRb, mesaVis); - */ - _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); - } - else if (mesaVis->depthBits == 24) { - driRenderbuffer *depthRb - = driNewRenderbuffer(GL_DEPTH_COMPONENT24, NULL, screen->cpp, - screen->depthOffset, screen->depthPitch, - driDrawPriv); - /* - tridentSetSpanFunctions(depthRb, mesaVis); - */ - _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); - } - - /* no h/w stencil? - if (mesaVis->stencilBits > 0 && !swStencil) { - driRenderbuffer *stencilRb - = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT); - tridentSetSpanFunctions(stencilRb, mesaVis); - _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base); - } - */ - - _mesa_add_soft_renderbuffers(fb, - GL_FALSE, /* color */ - GL_FALSE, /* depth */ - mesaVis->stencilBits > 0, - mesaVis->accumRedBits > 0, - GL_FALSE, /* alpha */ - GL_FALSE /* aux */); - driDrawPriv->driverPrivate = (void *) fb; - - return (driDrawPriv->driverPrivate != NULL); - } -} - - -static void -tridentDestroyBuffer(__DRIdrawablePrivate *driDrawPriv) -{ - _mesa_reference_framebuffer((GLframebuffer **)(&(driDrawPriv->driverPrivate)), NULL); -} - -static void -tridentSwapBuffers(__DRIdrawablePrivate *drawablePrivate) -{ - __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate; - - if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) { - tridentContextPtr tmesa; - GLcontext *ctx; - tmesa = (tridentContextPtr) dPriv->driContextPriv->driverPrivate; - ctx = tmesa->glCtx; - if (ctx->Visual.doubleBufferMode) { - _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */ - tridentCopyBuffer( dPriv ); - } - } - else { - /* XXX this shouldn't be an error but we can't handle it for now */ - _mesa_problem(NULL, "tridentSwapBuffers: drawable has no context!\n"); - } -} - -static GLboolean -tridentMakeCurrent(__DRIcontextPrivate *driContextPriv, - __DRIdrawablePrivate *driDrawPriv, - __DRIdrawablePrivate *driReadPriv) -{ - if (driContextPriv) { - GET_CURRENT_CONTEXT(ctx); - tridentContextPtr oldCtx = ctx ? TRIDENT_CONTEXT(ctx) : NULL; - tridentContextPtr newCtx = (tridentContextPtr) driContextPriv->driverPrivate; - - if ( newCtx != oldCtx ) { - newCtx->dirty = ~0; - } - - if (newCtx->driDrawable != driDrawPriv) { - newCtx->driDrawable = driDrawPriv; -#if 0 - tridentUpdateWindow ( newCtx->glCtx ); - tridentUpdateViewportOffset( newCtx->glCtx ); -#endif - } - - newCtx->drawOffset = newCtx->tridentScreen->backOffset; - newCtx->drawPitch = newCtx->tridentScreen->backPitch; - - _mesa_make_current( newCtx->glCtx, - (GLframebuffer *) driDrawPriv->driverPrivate, - (GLframebuffer *) driReadPriv->driverPrivate ); - - if (!newCtx->glCtx->Viewport.Width) { - _mesa_set_viewport(newCtx->glCtx, 0, 0, - driDrawPriv->w, driDrawPriv->h); - } - } else { - _mesa_make_current( NULL, NULL, NULL ); - } - return GL_TRUE; -} - - -static GLboolean -tridentUnbindContext( __DRIcontextPrivate *driContextPriv ) -{ - return GL_TRUE; -} - - -static tridentScreenPtr -tridentCreateScreen( __DRIscreenPrivate *sPriv ) -{ - TRIDENTDRIPtr tDRIPriv = (TRIDENTDRIPtr)sPriv->pDevPriv; - tridentScreenPtr tridentScreen; - - if (sPriv->devPrivSize != sizeof(TRIDENTDRIRec)) { - fprintf(stderr,"\nERROR! sizeof(TRIDENTDRIRec) does not match passed size from device driver\n"); - return GL_FALSE; - } - - /* Allocate the private area */ - tridentScreen = (tridentScreenPtr) CALLOC( sizeof(*tridentScreen) ); - if ( !tridentScreen ) return NULL; - - tridentScreen->driScreen = sPriv; - - tridentScreen->frontOffset = tDRIPriv->frontOffset; - tridentScreen->backOffset = tDRIPriv->backOffset; - tridentScreen->depthOffset = tDRIPriv->depthOffset; - tridentScreen->frontPitch = tDRIPriv->frontPitch; - tridentScreen->backPitch = tDRIPriv->backPitch; - tridentScreen->depthPitch = tDRIPriv->depthPitch; - tridentScreen->width = tDRIPriv->width; - tridentScreen->height = tDRIPriv->height; - -printf("%d %d\n",tridentScreen->width,tridentScreen->height); -printf("%d %d\n",tridentScreen->frontPitch,tridentScreen->backPitch); -printf("offset 0x%x 0x%x\n",tridentScreen->backOffset,tridentScreen->depthOffset); - - tridentScreen->mmio.handle = tDRIPriv->regs; - tridentScreen->mmio.size = 0x20000; - - if (drmMap(sPriv->fd, - tridentScreen->mmio.handle, tridentScreen->mmio.size, - (drmAddressPtr)&tridentScreen->mmio.map)) { - FREE(tridentScreen); - return GL_FALSE; - } -printf("MAPPED at %p\n", tridentScreen->mmio.map); - - return tridentScreen; -} - -/* Destroy the device specific screen private data struct. - */ -static void -tridentDestroyScreen( __DRIscreenPrivate *sPriv ) -{ - tridentScreenPtr tridentScreen = (tridentScreenPtr)sPriv->private; - - FREE(tridentScreen); -} - -static GLboolean -tridentInitDriver(__DRIscreenPrivate *sPriv) -{ - sPriv->private = (void *) tridentCreateScreen( sPriv ); - - if (!sPriv->private) { - tridentDestroyScreen( sPriv ); - return GL_FALSE; - } - - return GL_TRUE; -} - -/** - * This is the driver specific part of the createNewScreen entry point. - * - * \todo maybe fold this into intelInitDriver - * - * \return the __GLcontextModes supported by this driver - */ -const __DRIconfig **tridentInitScreen(__DRIscreenPrivate *psp) -{ - static const __DRIversion ddx_expected = { 4, 0, 0 }; - static const __DRIversion dri_expected = { 3, 1, 0 }; - static const __DRIversion drm_expected = { 1, 0, 0 }; - - if ( ! driCheckDriDdxDrmVersions2( "Trident", - &psp->dri_version, & dri_expected, - &psp->ddx_version, & ddx_expected, - &psp->drm_version, & drm_expected ) ) - return NULL; - - if (!tridentInitDriver(psp)) - return NULL; - - /* Wait... what? This driver doesn't report any modes... */ -#if 0 - TRIDENTDRIPtr dri_priv = (TRIDENTDRIPtr) psp->pDevPriv; - *driver_modes = tridentFillInModes( dri_priv->bytesPerPixel * 8, - GL_TRUE ); -#endif - - return NULL; -} - -const struct __DriverAPIRec driDriverAPI = { - tridentInitScreen, - tridentDestroyScreen, - tridentCreateContext, - tridentDestroyContext, - tridentCreateBuffer, - tridentDestroyBuffer, - tridentSwapBuffers, - tridentMakeCurrent, - tridentUnbindContext, -}; diff --git a/src/mesa/drivers/dri/trident/trident_context.h b/src/mesa/drivers/dri/trident/trident_context.h deleted file mode 100644 index fbbb4a96e7..0000000000 --- a/src/mesa/drivers/dri/trident/trident_context.h +++ /dev/null @@ -1,242 +0,0 @@ -/* - * Copyright 2002 by Alan Hourihane, Sychdyn, North Wales, UK. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Alan Hourihane not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Alan Hourihane makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: Alan Hourihane, - * - * Trident CyberBladeXP driver. - * - */ -#ifndef _TRIDENT_CONTEXT_H_ -#define _TRIDENT_CONTEXT_H_ - -#include "dri_util.h" -#include "main/macros.h" -#include "main/mtypes.h" -#include "drm.h" -#include "main/mm.h" - -#define SUBPIXEL_X (0.0F) -#define SUBPIXEL_Y (0.125F) - -#define _TRIDENT_NEW_VERTEX (_NEW_TEXTURE | \ - _DD_NEW_TRI_UNFILLED | \ - _DD_NEW_TRI_LIGHT_TWOSIDE) - -#define TRIDENT_FALLBACK_TEXTURE 0x01 -#define TRIDENT_FALLBACK_DRAW_BUFFER 0x02 - -#define TRIDENT_NEW_CLIP 0x01 - -#define TRIDENT_UPLOAD_COMMAND_D 0x00000001 -#define TRIDENT_UPLOAD_CONTEXT 0x04000000 -#define TRIDENT_UPLOAD_CLIPRECTS 0x80000000 - -#define TAG(x) trident##x -#include "tnl_dd/t_dd_vertex.h" -#undef TAG - -/* these require that base be dword-aligned */ -static INLINE void MMIO_OUT32(unsigned char *base, unsigned int offset, - unsigned int val) -{ - unsigned int *addr = (unsigned int *)(base + offset); - *addr = val; -} - -static INLINE unsigned int MMIO_IN32(unsigned char *base, unsigned int offset) -{ - unsigned int *addr = (unsigned int *)(base + offset); - return *addr; -} - -#define MMIO_OUT8(base, offset, val) *((base) + (offset)) = (val) -#define MMIO_IN8(base, offset) *((base) + (offset)) - -struct trident_context; -typedef struct trident_context tridentContextRec; -typedef struct trident_context *tridentContextPtr; - -typedef void (*trident_quad_func)( tridentContextPtr, - const tridentVertex *, - const tridentVertex *, - const tridentVertex *, - const tridentVertex * ); -typedef void (*trident_tri_func)( tridentContextPtr, - const tridentVertex *, - const tridentVertex *, - const tridentVertex * ); -typedef void (*trident_line_func)( tridentContextPtr, - const tridentVertex *, - const tridentVertex * ); -typedef void (*trident_point_func)( tridentContextPtr, - const tridentVertex * ); - -typedef struct { - drm_handle_t handle; /* Handle to the DRM region */ - drmSize size; /* Size of the DRM region */ - unsigned char *map; /* Mapping of the DRM region */ -} tridentRegionRec, *tridentRegionPtr; - -typedef struct { - __DRIscreenPrivate *driScreen; /* Back pointer to DRI screen */ - - drmBufMapPtr buffers; - - unsigned int frontOffset; - unsigned int frontPitch; - unsigned int backOffset; - unsigned int backPitch; - unsigned int depthOffset; - unsigned int depthPitch; - unsigned int width; - unsigned int height; - unsigned int cpp; - -#if 0 - unsigned int sarea_priv_offset; -#endif - - tridentRegionRec mmio; -} tridentScreenRec, *tridentScreenPtr; - -/** - * tridentRenderbuffer, derived from Mesa's gl_renderbuffer - */ -typedef struct { - struct gl_renderbuffer Base; - /* XXX per-window info should go here */ - int foo, bar; -} tridentRenderbuffer; - - -struct trident_context { - GLcontext *glCtx; /* Mesa context */ - - __DRIcontextPrivate *driContext; - __DRIscreenPrivate *driScreen; - __DRIdrawablePrivate *driDrawable; - - GLuint new_gl_state; - GLuint new_state; - GLuint dirty; - -#if 0 - drm_trident_sarea_t *sarea; -#endif - - /* Temporaries for translating away float colors: - */ - struct gl_client_array UbyteColor; - struct gl_client_array UbyteSecondaryColor; - - /* Mirrors of some DRI state - */ - int lastStamp; /* mirror driDrawable->lastStamp */ - - drm_context_t hHWContext; - drmLock *driHwLock; - int driFd; - - tridentScreenPtr tridentScreen; /* Screen private DRI data */ - - /* Visual, drawable, cliprect and scissor information - */ - GLenum DrawBuffer; - GLint drawOffset, drawPitch; - GLint drawX, drawY; /* origin of drawable in draw buffer */ - GLint readOffset, readPitch; - - GLuint numClipRects; /* Cliprects for the draw buffer */ - drm_clip_rect_t *pClipRects; - - GLint scissor; - drm_clip_rect_t ScissorRect; /* Current software scissor */ - - GLuint Fallback; - GLuint RenderIndex; - GLuint SetupNewInputs; - GLuint SetupIndex; - GLfloat hw_viewport[16]; - GLfloat depth_scale; - GLuint vertex_format; - GLuint vertex_size; - GLuint vertex_stride_shift; - GLubyte *verts; - - GLint tmu_source[2]; - - GLuint hw_primitive; - GLenum render_primitive; - - trident_point_func draw_point; - trident_line_func draw_line; - trident_tri_func draw_tri; - trident_quad_func draw_quad; - -#if 0 - gammaTextureObjectPtr CurrentTexObj[2]; - struct gamma_texture_object_t TexObjList; - struct gamma_texture_object_t SwappedOut; - GLenum TexEnvImageFmt[2]; - - struct mem_block *texHeap; - - int lastSwap; - int texAge; - int ctxAge; - int dirtyAge; - int lastStamp; -#endif - - /* Chip state */ - - int commandD; - - /* Context State */ - - int ClearColor; -}; - -void tridentDDInitExtensions( GLcontext *ctx ); -void tridentDDInitDriverFuncs( GLcontext *ctx ); -void tridentDDInitSpanFuncs( GLcontext *ctx ); -void tridentDDInitState( tridentContextPtr tmesa ); -void tridentInitHW( tridentContextPtr tmesa ); -void tridentDDInitStateFuncs( GLcontext *ctx ); -void tridentDDInitTextureFuncs( GLcontext *ctx ); -void tridentDDInitTriFuncs( GLcontext *ctx ); - -extern void tridentBuildVertices( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint newinputs ); -extern void tridentInitVB( GLcontext *ctx ); -extern void tridentCopyBuffer( const __DRIdrawablePrivate *dPriv ); -extern void tridentFallback( tridentContextPtr tmesa, GLuint bit, - GLboolean mode ); -extern void tridentCheckTexSizes( GLcontext *ctx ); -extern void tridentChooseVertexState( GLcontext *ctx ); -extern void tridentDDUpdateHWState( GLcontext *ctx ); -extern void tridentUploadHwStateLocked( tridentContextPtr tmesa ); - -#define TRIDENT_CONTEXT(ctx) ((tridentContextPtr)(ctx->DriverCtx)) - -#endif /* _TRIDENT_CONTEXT_H_ */ diff --git a/src/mesa/drivers/dri/trident/trident_dd.c b/src/mesa/drivers/dri/trident/trident_dd.c deleted file mode 100644 index faa40c36a2..0000000000 --- a/src/mesa/drivers/dri/trident/trident_dd.c +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright 2002 by Alan Hourihane, Sychdyn, North Wales, UK. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Alan Hourihane not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Alan Hourihane makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: Alan Hourihane, - * - * Trident CyberBladeXP driver. - * - */ -#include "trident_context.h" -#include "trident_lock.h" -#if defined(USE_X86_ASM) -#include "x86/common_x86_asm.h" -#endif - -#include "swrast/swrast.h" -#include "main/context.h" -#include "main/framebuffer.h" - -#define TRIDENT_DATE "20041223" - -/* Return the width and height of the current color buffer. - */ -static void tridentDDGetBufferSize( GLframebuffer *framebuffer, - GLuint *width, GLuint *height ) -{ - GET_CURRENT_CONTEXT(ctx); - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - - LOCK_HARDWARE(tmesa); - *width = tmesa->driDrawable->w; - *height = tmesa->driDrawable->h; - UNLOCK_HARDWARE(tmesa); -} - - -/* Return various strings for glGetString(). - */ -static const GLubyte *tridentDDGetString( GLcontext *ctx, GLenum name ) -{ - static char buffer[128]; - - switch ( name ) { - case GL_VENDOR: - return (GLubyte *)"Alan Hourihane"; - - case GL_RENDERER: - sprintf( buffer, "Mesa DRI Trident " TRIDENT_DATE ); - - /* Append any CPU-specific information. - */ -#ifdef USE_X86_ASM - if ( _mesa_x86_cpu_features ) { - strncat( buffer, " x86", 4 ); - } -#ifdef USE_MMX_ASM - if ( cpu_has_mmx ) { - strncat( buffer, "/MMX", 4 ); - } -#endif -#ifdef USE_3DNOW_ASM - if ( cpu_has_3dnow ) { - strncat( buffer, "/3DNow!", 7 ); - } -#endif -#ifdef USE_SSE_ASM - if ( cpu_has_xmm ) { - strncat( buffer, "/SSE", 4 ); - } -#endif -#endif - return (GLubyte *)buffer; - - default: - return NULL; - } -} - -/* Enable the extensions supported by this driver. - */ -void tridentDDInitExtensions( GLcontext *ctx ) -{ - /* None... */ -} - -/* Initialize the driver's misc functions. - */ -void tridentDDInitDriverFuncs( GLcontext *ctx ) -{ - ctx->Driver.GetBufferSize = tridentDDGetBufferSize; - ctx->Driver.GetString = tridentDDGetString; - ctx->Driver.Error = NULL; -} diff --git a/src/mesa/drivers/dri/trident/trident_dri.h b/src/mesa/drivers/dri/trident/trident_dri.h deleted file mode 100644 index c1ce3c4682..0000000000 --- a/src/mesa/drivers/dri/trident/trident_dri.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef _TRIDENT_DRI_ -#define _TRIDENT_DRI_ - -#include "xf86drm.h" - -typedef struct { - drm_handle_t regs; - drmSize regsSize; - drmAddress regsMap; - int deviceID; - int width; - int height; - int mem; - int frontOffset; - int frontPitch; - int backOffset; - int backPitch; - int depthOffset; - int depthPitch; - int cpp; -#if 0 - int textureOffset; - int textureSize; -#endif - unsigned int sarea_priv_offset; -} TRIDENTDRIRec, *TRIDENTDRIPtr; - -#endif diff --git a/src/mesa/drivers/dri/trident/trident_lock.h b/src/mesa/drivers/dri/trident/trident_lock.h deleted file mode 100644 index ee0819f5ca..0000000000 --- a/src/mesa/drivers/dri/trident/trident_lock.h +++ /dev/null @@ -1,11 +0,0 @@ -/* XXX tridentGetLock doesn't exist... */ - -#define LOCK_HARDWARE(tmesa) \ - do { \ - char __ret = 0; \ - DRM_CAS(tmesa->driHwLock, tmesa->hHWContext, \ - DRM_LOCK_HELD | tmesa->hHWContext, __ret); \ - } while (0) - -#define UNLOCK_HARDWARE(tmesa) \ - DRM_UNLOCK(tmesa->driFd, tmesa->driHwLock, tmesa->hHWContext) diff --git a/src/mesa/drivers/dri/trident/trident_state.c b/src/mesa/drivers/dri/trident/trident_state.c deleted file mode 100644 index e68d3a73c6..0000000000 --- a/src/mesa/drivers/dri/trident/trident_state.c +++ /dev/null @@ -1,548 +0,0 @@ -/* - * Copyright 2002 by Alan Hourihane, Sychdyn, North Wales, UK. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Alan Hourihane not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Alan Hourihane makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: Alan Hourihane, - * - * Trident CyberBladeXP driver. - * - */ -#include "trident_context.h" -#include "trident_lock.h" -#include "vbo/vbo.h" -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "tnl/tnl.h" -#include "main/framebuffer.h" - -#define TRIDENTPACKCOLOR332(r, g, b) \ - (((r) & 0xe0) | (((g) & 0xe0) >> 3) | (((b) & 0xc0) >> 6)) - -#define TRIDENTPACKCOLOR1555(r, g, b, a) \ - ((((r) & 0xf8) << 7) | (((g) & 0xf8) << 2) | (((b) & 0xf8) >> 3) | \ - ((a) ? 0x8000 : 0)) - -#define TRIDENTPACKCOLOR565(r, g, b) \ - ((((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | (((b) & 0xf8) >> 3)) - -#define TRIDENTPACKCOLOR888(r, g, b) \ - (((r) << 16) | ((g) << 8) | (b)) - -#define TRIDENTPACKCOLOR8888(r, g, b, a) \ - (((a) << 24) | ((r) << 16) | ((g) << 8) | (b)) - -#define TRIDENTPACKCOLOR4444(r, g, b, a) \ - ((((a) & 0xf0) << 8) | (((r) & 0xf0) << 4) | ((g) & 0xf0) | ((b) >> 4)) - -static INLINE GLuint tridentPackColor( GLuint cpp, - GLubyte r, GLubyte g, - GLubyte b, GLubyte a ) -{ - switch ( cpp ) { - case 2: - return TRIDENTPACKCOLOR565( r, g, b ); - case 4: - return TRIDENTPACKCOLOR8888( r, g, b, a ); - default: - return 0; - } -} - -void tridentUploadHwStateLocked( tridentContextPtr tmesa ) -{ - unsigned char *MMIO = tmesa->tridentScreen->mmio.map; -#if 0 - ATISAREAPrivPtr sarea = tmesa->sarea; - trident_context_regs_t *regs = &(sarea->ContextState); -#endif - - if ( tmesa->dirty & TRIDENT_UPLOAD_COMMAND_D ) { - MMIO_OUT32(MMIO, 0x00281C, tmesa->commandD ); - tmesa->dirty &= ~TRIDENT_UPLOAD_COMMAND_D; - } - - if ( tmesa->dirty & TRIDENT_UPLOAD_CLIPRECTS ) { - /* XXX FIX ME ! */ - MMIO_OUT32(MMIO, 0x002C80 , 0x20008000 | tmesa->tridentScreen->height ); - MMIO_OUT32(MMIO, 0x002C84 , 0x20000000 | tmesa->tridentScreen->width ); - tmesa->dirty &= ~TRIDENT_UPLOAD_CLIPRECTS; - } - - tmesa->dirty = 0; -} - -/* Copy the back color buffer to the front color buffer. - */ -void tridentCopyBuffer( const __DRIdrawablePrivate *dPriv ) -{ - unsigned char *MMIO; - tridentContextPtr tmesa; - GLint nbox, i; - int busy; - drm_clip_rect_t *pbox; - - assert(dPriv); - assert(dPriv->driContextPriv); - assert(dPriv->driContextPriv->driverPrivate); - - tmesa = (tridentContextPtr) dPriv->driContextPriv->driverPrivate; - MMIO = tmesa->tridentScreen->mmio.map; - - LOCK_HARDWARE( tmesa ); - - /* use front buffer cliprects */ - nbox = dPriv->numClipRects; - pbox = dPriv->pClipRects; - - for ( i = 0 ; i < nbox ; i++ ) { -#if 0 - GLint nr = MIN2( i + MACH64_NR_SAREA_CLIPRECTS , nbox ); - drm_clip_rect_t *b = tmesa->sarea->boxes; - GLint n = 0; - - for ( ; i < nr ; i++ ) { - *b++ = pbox[i]; - n++; - } - tmesa->sarea->nbox = n; -#endif - - MMIO_OUT32(MMIO, 0x2150, tmesa->tridentScreen->frontPitch << 20 | tmesa->tridentScreen->frontOffset>>4); - MMIO_OUT32(MMIO, 0x2154, tmesa->tridentScreen->backPitch << 20 | tmesa->tridentScreen->backOffset>>4); - MMIO_OUT8(MMIO, 0x2127, 0xCC); /* Copy Rop */ - MMIO_OUT32(MMIO, 0x2128, 0x4); /* scr2scr */ - MMIO_OUT32(MMIO, 0x2138, (pbox->x1 << 16) | pbox->y1); - MMIO_OUT32(MMIO, 0x213C, (pbox->x1 << 16) | pbox->y1); - MMIO_OUT32(MMIO, 0x2140, (pbox->x2 - pbox->x1) << 16 | (pbox->y2 - pbox->y1) ); - MMIO_OUT8(MMIO, 0x2124, 0x01); /* BLT */ -#define GE_BUSY 0x80 - for (;;) { - busy = MMIO_IN8(MMIO, 0x2120); - if ( !(busy & GE_BUSY) ) - break; - } - } - - UNLOCK_HARDWARE( tmesa ); - -#if 0 - tmesa->dirty |= (MACH64_UPLOAD_CONTEXT | - MACH64_UPLOAD_MISC | - MACH64_UPLOAD_CLIPRECTS); -#endif -} - - -static void tridentDDClear( GLcontext *ctx, GLbitfield mask ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - unsigned char *MMIO = tmesa->tridentScreen->mmio.map; - int busy; - GLuint flags = 0; - GLint i; - GLint cx, cy, cw, ch; - -#define DRM_TRIDENT_FRONT 0x01 -#define DRM_TRIDENT_BACK 0x02 -#define DRM_TRIDENT_DEPTH 0x04 - - if ( tmesa->new_state ) - tridentDDUpdateHWState( ctx ); - - if ( mask & BUFFER_BIT_FRONT_LEFT ) { - flags |= DRM_TRIDENT_FRONT; - mask &= ~BUFFER_BIT_FRONT_LEFT; - } - - if ( mask & BUFFER_BIT_BACK_LEFT ) { - flags |= DRM_TRIDENT_BACK; - mask &= ~BUFFER_BIT_BACK_LEFT; - } - - if ( ( mask & BUFFER_BIT_DEPTH ) && ctx->Depth.Mask ) { - flags |= DRM_TRIDENT_DEPTH; - mask &= ~BUFFER_BIT_DEPTH; - } - - LOCK_HARDWARE(tmesa); - - /* get region after locking: */ - cx = ctx->DrawBuffer->_Xmin; - cy = ctx->DrawBuffer->_Ymin; - cw = ctx->DrawBuffer->_Xmax - cx; - ch = ctx->DrawBuffer->_Ymax - cy; - - if ( flags ) { - - cx += tmesa->drawX; - cy += tmesa->drawY; - - /* HACK!!! - */ - if ( tmesa->dirty & ~TRIDENT_UPLOAD_CLIPRECTS ) { - tridentUploadHwStateLocked( tmesa ); - } - - for ( i = 0 ; i < tmesa->numClipRects ; i++ ) { -#if 0 - int nr = MIN2( i + TRIDENT_NR_SAREA_CLIPRECTS, tmesa->numClipRects ); - drm_clip_rect_t *box = tmesa->pClipRects; - drm_clip_rect_t *b = tmesa->sarea->boxes; - GLint n = 0; - - if ( !all ) { - for ( ; i < nr ; i++ ) { - GLint x = box[i].x1; - GLint y = box[i].y1; - GLint w = box[i].x2 - x; - GLint h = box[i].y2 - y; - - if ( x < cx ) w -= cx - x, x = cx; - if ( y < cy ) h -= cy - y, y = cy; - if ( x + w > cx + cw ) w = cx + cw - x; - if ( y + h > cy + ch ) h = cy + ch - y; - if ( w <= 0 ) continue; - if ( h <= 0 ) continue; - - b->x1 = x; - b->y1 = y; - b->x2 = x + w; - b->y2 = y + h; - b++; - n++; - } - } else { - for ( ; i < nr ; i++ ) { - *b++ = box[i]; - n++; - } - } - - tmesa->sarea->nbox = n; -#endif - -if (flags & DRM_TRIDENT_BACK) { - MMIO_OUT32(MMIO, 0x2150, tmesa->tridentScreen->backPitch << 20 | tmesa->tridentScreen->backOffset>>4); - MMIO_OUT8(MMIO, 0x2127, 0xF0); /* Pat Rop */ - MMIO_OUT32(MMIO, 0x2158, tmesa->ClearColor); - MMIO_OUT32(MMIO, 0x2128, 0x4000); /* solidfill */ - MMIO_OUT32(MMIO, 0x2138, cx << 16 | cy); - MMIO_OUT32(MMIO, 0x2140, cw << 16 | ch); - MMIO_OUT8(MMIO, 0x2124, 0x01); /* BLT */ -#define GE_BUSY 0x80 - for (;;) { - busy = MMIO_IN8(MMIO, 0x2120); - if ( !(busy & GE_BUSY) ) - break; - } -} -if (flags & DRM_TRIDENT_DEPTH) { - MMIO_OUT32(MMIO, 0x2150, tmesa->tridentScreen->depthPitch << 20 | tmesa->tridentScreen->depthOffset>>4); - MMIO_OUT8(MMIO, 0x2127, 0xF0); /* Pat Rop */ - MMIO_OUT32(MMIO, 0x2158, tmesa->ClearColor); - MMIO_OUT32(MMIO, 0x2128, 0x4000); /* solidfill */ - MMIO_OUT32(MMIO, 0x2138, cx << 16 | cy); - MMIO_OUT32(MMIO, 0x2140, cw << 16 | ch); - MMIO_OUT8(MMIO, 0x2124, 0x01); /* BLT */ -#define GE_BUSY 0x80 - for (;;) { - busy = MMIO_IN8(MMIO, 0x2120); - if ( !(busy & GE_BUSY) ) - break; - } -} - MMIO_OUT32(MMIO, 0x2150, tmesa->tridentScreen->frontPitch << 20 | tmesa->tridentScreen->frontOffset>>4); -if (flags & DRM_TRIDENT_FRONT) { - MMIO_OUT8(MMIO, 0x2127, 0xF0); /* Pat Rop */ - MMIO_OUT32(MMIO, 0x2158, tmesa->ClearColor); - MMIO_OUT32(MMIO, 0x2128, 0x4000); /* solidfill */ - MMIO_OUT32(MMIO, 0x2138, cx << 16 | cy); - MMIO_OUT32(MMIO, 0x2140, cw << 16 | ch); - MMIO_OUT8(MMIO, 0x2124, 0x01); /* BLT */ -#define GE_BUSY 0x80 - for (;;) { - busy = MMIO_IN8(MMIO, 0x2120); - if ( !(busy & GE_BUSY) ) - break; - } -} - - } - -#if 0 - tmesa->dirty |= (TRIDENT_UPLOAD_CONTEXT | - TRIDENT_UPLOAD_MISC | - TRIDENT_UPLOAD_CLIPRECTS); -#endif - } - - UNLOCK_HARDWARE(tmesa); - - if ( mask ) - _swrast_Clear( ctx, mask ); -} - -static void tridentDDShadeModel( GLcontext *ctx, GLenum mode ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - GLuint s = tmesa->commandD; - -#define TRIDENT_FLAT_SHADE 0x000000E0 -#define TRIDENT_FLAT_SHADE_VERTEX_C 0x00000060 -#define TRIDENT_FLAT_SHADE_GOURAUD 0x00000080 - - s &= ~TRIDENT_FLAT_SHADE; - - switch ( mode ) { - case GL_FLAT: - s |= TRIDENT_FLAT_SHADE_VERTEX_C; - break; - case GL_SMOOTH: - s |= TRIDENT_FLAT_SHADE_GOURAUD; - break; - default: - return; - } - - if ( tmesa->commandD != s ) { - tmesa->commandD = s; - - tmesa->dirty |= TRIDENT_UPLOAD_COMMAND_D; - } -} - -static void -tridentCalcViewport( GLcontext *ctx ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - const GLfloat *v = ctx->Viewport._WindowMap.m; - GLfloat *m = tmesa->hw_viewport; - - /* See also trident_translate_vertex. - */ - m[MAT_SX] = v[MAT_SX]; - m[MAT_TX] = v[MAT_TX] + tmesa->drawX + SUBPIXEL_X; - m[MAT_SY] = - v[MAT_SY]; - m[MAT_TY] = - v[MAT_TY] + tmesa->driDrawable->h + tmesa->drawY + SUBPIXEL_Y; -#if 0 - m[MAT_SZ] = v[MAT_SZ] * tmesa->depth_scale; - m[MAT_TZ] = v[MAT_TZ] * tmesa->depth_scale; -#else - m[MAT_SZ] = v[MAT_SZ]; - m[MAT_TZ] = v[MAT_TZ]; -#endif - - tmesa->SetupNewInputs = ~0; -} - -static void tridentDDViewport( GLcontext *ctx, - GLint x, GLint y, - GLsizei width, GLsizei height ) -{ - tridentCalcViewport( ctx ); -} - -static void tridentDDDepthRange( GLcontext *ctx, - GLclampd nearval, GLclampd farval ) -{ - tridentCalcViewport( ctx ); -} - -static void -tridentSetCliprects( tridentContextPtr tmesa, GLenum mode ) -{ - __DRIdrawablePrivate *dPriv = tmesa->driDrawable; - - switch ( mode ) { - case GL_FRONT_LEFT: - if (dPriv->numClipRects == 0) { - static drm_clip_rect_t zeroareacliprect = {0,0,0,0}; - tmesa->numClipRects = 1; - tmesa->pClipRects = &zeroareacliprect; - } else { - tmesa->numClipRects = dPriv->numClipRects; - tmesa->pClipRects = (drm_clip_rect_t *)dPriv->pClipRects; - } - tmesa->drawX = dPriv->x; - tmesa->drawY = dPriv->y; - break; - case GL_BACK_LEFT: - if ( dPriv->numBackClipRects == 0 ) { - if (dPriv->numClipRects == 0) { - static drm_clip_rect_t zeroareacliprect = {0,0,0,0}; - tmesa->numClipRects = 1; - tmesa->pClipRects = &zeroareacliprect; - } else { - tmesa->numClipRects = dPriv->numClipRects; - tmesa->pClipRects = (drm_clip_rect_t *)dPriv->pClipRects; - tmesa->drawX = dPriv->x; - tmesa->drawY = dPriv->y; - } - } - else { - tmesa->numClipRects = dPriv->numBackClipRects; - tmesa->pClipRects = (drm_clip_rect_t *)dPriv->pBackClipRects; - tmesa->drawX = dPriv->backX; - tmesa->drawY = dPriv->backY; - } - break; - default: - return; - } - -#if 0 - tmesa->dirty |= TRIDENT_UPLOAD_CLIPRECTS; -#endif -} - -#if 0 -static GLboolean tridentDDSetDrawBuffer( GLcontext *ctx, GLenum mode ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - int found = GL_TRUE; - - if ( tmesa->DrawBuffer != mode ) { - tmesa->DrawBuffer = mode; - - switch ( mode ) { - case GL_FRONT_LEFT: - tridentFallback( tmesa, TRIDENT_FALLBACK_DRAW_BUFFER, GL_FALSE ); - tmesa->drawOffset = tmesa->tridentScreen->frontOffset; - tmesa->drawPitch = tmesa->tridentScreen->frontPitch; - tridentSetCliprects( tmesa, GL_FRONT_LEFT ); - break; - case GL_BACK_LEFT: - tridentFallback( tmesa, TRIDENT_FALLBACK_DRAW_BUFFER, GL_FALSE ); - tmesa->drawOffset = tmesa->tridentScreen->backOffset; - tmesa->drawPitch = tmesa->tridentScreen->backPitch; - tridentSetCliprects( tmesa, GL_BACK_LEFT ); - break; - default: - tridentFallback( tmesa, TRIDENT_FALLBACK_DRAW_BUFFER, GL_TRUE ); - found = GL_FALSE; - break; - } - -#if 0 - tmesa->setup.dst_off_pitch = (((tmesa->drawPitch/8) << 22) | - (tmesa->drawOffset >> 3)); - - tmesa->dirty |= MACH64_UPLOAD_DST_OFF_PITCH | MACH64_UPLOAD_CONTEXT; -#endif - - } - - return found; -} - -static void tridentDDClearColor( GLcontext *ctx, - const GLchan color[4] ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - - tmesa->ClearColor = tridentPackColor( tmesa->tridentScreen->cpp, - color[0], color[1], - color[2], color[3] ); -} -#endif - -static void -tridentDDUpdateState( GLcontext *ctx, GLuint new_state ) -{ - _swrast_InvalidateState( ctx, new_state ); - _swsetup_InvalidateState( ctx, new_state ); - _vbo_InvalidateState( ctx, new_state ); - _tnl_InvalidateState( ctx, new_state ); - TRIDENT_CONTEXT(ctx)->new_gl_state |= new_state; -} - - -/* Initialize the context's hardware state. - */ -void tridentDDInitState( tridentContextPtr tmesa ) -{ - tmesa->new_state = 0; - - switch ( tmesa->glCtx->Visual.depthBits ) { - case 16: - tmesa->depth_scale = 1.0 / (GLfloat)0xffff; - break; - case 24: - tmesa->depth_scale = 1.0 / (GLfloat)0xffffff; - break; - } -} - -void tridentDDUpdateHWState( GLcontext *ctx ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - int new_state = tmesa->new_state; - - if ( new_state ) - { - tmesa->new_state = 0; - -#if 0 - /* Update the various parts of the context's state. - */ - if ( new_state & GAMMA_NEW_ALPHA ) - tridentUpdateAlphaMode( ctx ); - - if ( new_state & GAMMA_NEW_DEPTH ) - tridentUpdateZMode( ctx ); - - if ( new_state & GAMMA_NEW_FOG ) - gammaUpdateFogAttrib( ctx ); - - if ( new_state & GAMMA_NEW_CLIP ) - gammaUpdateClipping( ctx ); - - if ( new_state & GAMMA_NEW_POLYGON ) - gammaUpdatePolygon( ctx ); - - if ( new_state & GAMMA_NEW_CULL ) - gammaUpdateCull( ctx ); - - if ( new_state & GAMMA_NEW_MASKS ) - gammaUpdateMasks( ctx ); - - if ( new_state & GAMMA_NEW_STIPPLE ) - gammaUpdateStipple( ctx ); -#endif - } - - /* HACK ! */ - -#if 0 - gammaEmitHwState( tmesa ); -#endif -} - -/* Initialize the driver's state functions. - */ -void tridentDDInitStateFuncs( GLcontext *ctx ) -{ - ctx->Driver.UpdateState = tridentDDUpdateState; - - ctx->Driver.Clear = tridentDDClear; - ctx->Driver.DepthRange = tridentDDDepthRange; - ctx->Driver.ShadeModel = tridentDDShadeModel; - ctx->Driver.Viewport = tridentDDViewport; -} diff --git a/src/mesa/drivers/dri/trident/trident_tris.c b/src/mesa/drivers/dri/trident/trident_tris.c deleted file mode 100644 index ee85ab482c..0000000000 --- a/src/mesa/drivers/dri/trident/trident_tris.c +++ /dev/null @@ -1,1125 +0,0 @@ -/* - * Copyright 2002 by Alan Hourihane, Sychdyn, North Wales, UK. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Alan Hourihane not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Alan Hourihane makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: Alan Hourihane, - * - * Trident CyberBladeXP driver. - * - */ - -#include "trident_context.h" -#include "trident_lock.h" -#include "tnl/tnl.h" -#include "tnl/t_context.h" -#include "tnl/t_pipeline.h" -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" - -static int first = 1; - -typedef struct reg { - int addr; - int data; -} RegData; - -RegData initRegData[]={ - {0x2804, 0x19980824}, - {0x2F70, 0x46455858}, - {0x2F74, 0x41584998}, - {0x2F00, 0x00000000}, - {0x2F04, 0x80000800}, - {0x2F08, 0x00550200}, - {0x2F40, 0x00000001}, - {0x2F40, 0x00000001}, - {0x2F44, 0x00830097}, - {0x2F48, 0x0087009F}, - {0x2F4C, 0x00BF0003}, - {0x2F50, 0xF00B6C1B}, - {0x2C04, 0x00000000}, - {0x2D00, 0x00000080}, - {0x2D00, 0x00000000}, - {0x2DD4, 0x00100000}, - {0x2DD4, 0x00100010}, - {0x2DD8, 0x00100000}, - {0x2DD8, 0x00100010}, - {0x2C88, 0xFFFFFFFF}, - {0x2C94 , 0xFFFFFFFF}, - {0x281C, 0x00008000}, - {0x2C80, 0x00000000}, - {0x2C80, 0x00000000}, - {0x2C80 , 0x00008000}, - {0x2C00 , 0x00000000}, - {0x2C04 , 0x00000000}, - {0x2C08 , 0x00000000}, - {0x2C0C , 0x00000000}, - {0x2C10 , 0x00000000}, - {0x2C14 , 0x00000000}, - {0x2C18 , 0x00000000}, - {0x2C1C , 0x00000000}, - {0x2C20 , 0x00000000}, - {0x2C24 , 0x00000000}, - {0x2C2C , 0x00000000}, - {0x2C30 , 0x00000000}, - {0x2C34 , 0x00000000}, - {0x2C38 , 0x00000000}, - {0x2C3C , 0x00000000}, - {0x2C40 , 0x00000000}, - {0x2C44 , 0x00000000}, - {0x2C48 , 0x00000000}, - {0x2C4C , 0x00000000}, - {0x2C50 , 0x00000000}, - {0x2C54 , 0x00000000}, - {0x2C58 , 0x00000000}, - {0x2C5C , 0x00000000}, - {0x2C60 , 0x00000000}, - {0x2C64 , 0x00000000}, - {0x2C68 , 0x00000000}, - {0x2C6C , 0x00000000}, - {0x2C70 , 0x00000000}, - {0x2C74 , 0x00000000}, - {0x2C78 , 0x00000000}, - {0x2C7C , 0x00000000}, - {0x2C80 , 0x00008000}, - {0x2C84 , 0x00000000}, - {0x2C88 , 0xFFFFFFFF}, - {0x2C8C , 0x00000000}, - {0x2C90 , 0x00000000}, - {0x2C94 , 0xFFFFFFFF}, - {0x2C98 , 0x00000000}, - {0x2C9C , 0x00000000}, - {0x2CA0 , 0x00000000}, - {0x2CA4 , 0x00000000}, - {0x2CA8 , 0x00000000}, - {0x2CAC , 0x00000000}, - {0x2CB0 , 0x00000000}, - {0x2CB4 , 0x00000000}, - {0x2CB8 , 0x00000000}, - {0x2CBC , 0x00000000}, - {0x2CC0 , 0x00000000}, - {0x2CC4 , 0x00000000}, - {0x2CC8 , 0x00000000}, - {0x2CCC , 0x00000000}, - {0x2CD0 , 0x00000000}, - {0x2CD4 , 0x00000000}, - {0x2CD8 , 0x00000000}, - {0x2CDC , 0x00000000}, - {0x2CE0 , 0x00000000}, - {0x2CE4 , 0x00000000}, - {0x2CE8 , 0x00000000}, - {0x2CEC , 0x00000000}, - {0x2CF0 , 0x00000000}, - {0x2CF4 , 0x00000000}, - {0x2CF8 , 0x00000000}, - {0x2CFC , 0x00000000}, - {0x2D00 , 0x00000000}, - {0x2D04 , 0x00000000}, - {0x2D08 , 0x00000000}, - {0x2D0C , 0x00000000}, - {0x2D10 , 0x00000000}, - {0x2D14 , 0x00000000}, - {0x2D18 , 0x00000000}, - {0x2D1C , 0x00000000}, - {0x2D20 , 0x00000000}, - {0x2D24 , 0x00000000}, - {0x2D28 , 0x00000000}, - {0x2D2C , 0x00000000}, - {0x2D30 , 0x00000000}, - {0x2D34 , 0x00000000}, - {0x2D38 , 0x00000000}, - {0x2D3C , 0x00000000}, - {0x2D40 , 0x00000000}, - {0x2D44 , 0x00000000}, - {0x2D48 , 0x00000000}, - {0x2D4C , 0x00000000}, - {0x2D50 , 0x00000000}, - {0x2D54 , 0x00000000}, - {0x2D58 , 0x00000000}, - {0x2D5C , 0x00000000}, - {0x2D60 , 0x00000000}, - {0x2D64 , 0x00000000}, - {0x2D68 , 0x00000000}, - {0x2D6C , 0x00000000}, - {0x2D70 , 0x00000000}, - {0x2D74 , 0x00000000}, - {0x2D78 , 0x00000000}, - {0x2D7C , 0x00000000}, - {0x2D80 , 0x00000000}, - {0x2D84 , 0x00000000}, - {0x2D88 , 0x00000000}, - {0x2D8C , 0x00000000}, - {0x2D90 , 0x00000000}, - {0x2D94 , 0x00000000}, - {0x2D98 , 0x00000000}, - {0x2D9C , 0x00000000}, - {0x2DA0 , 0x00000000}, - {0x2DA4 , 0x00000000}, - {0x2DA8 , 0x00000000}, - {0x2DAC , 0x00000000}, - {0x2DB0 , 0x00000000}, - {0x2DB4 , 0x00000000}, - {0x2DB8 , 0x00000000}, - {0x2DBC , 0x00000000}, - {0x2DC0 , 0x00000000}, - {0x2DC4 , 0x00000000}, - {0x2DC8 , 0x00000000}, - {0x2DCC , 0x00000000}, - {0x2DD0 , 0x00000000}, - {0x2DD4 , 0x00100010}, - {0x2DD8 , 0x00100010}, - {0x2DDC , 0x00000000}, - {0x2DE0 , 0x00000000}, - {0x2DE4 , 0x00000000}, - {0x2DE8 , 0x00000000}, - {0x2DEC , 0x00000000}, - {0x2DF0 , 0x00000000}, - {0x2DF4 , 0x00000000}, - {0x2DF8 , 0x00000000}, - {0x2DFC , 0x00000000}, - {0x2E00 , 0x00000000}, - {0x2E04 , 0x00000000}, - {0x2E08 , 0x00000000}, - {0x2E0C , 0x00000000}, - {0x2E10 , 0x00000000}, - {0x2E14 , 0x00000000}, - {0x2E18 , 0x00000000}, - {0x2E1C , 0x00000000}, - {0x2E20 , 0x00000000}, - {0x2E24 , 0x00000000}, - {0x2E28 , 0x00000000}, - {0x2E2C , 0x00000000}, - {0x2E30 , 0x00000000}, - {0x2E34 , 0x00000000}, - {0x2E38 , 0x00000000}, - {0x2E3C , 0x00000000}, - {0x2E40 , 0x00000000}, - {0x2E44 , 0x00000000}, - {0x2E48 , 0x00000000}, - {0x2E4C , 0x00000000}, - {0x2E50 , 0x00000000}, - {0x2E54 , 0x00000000}, - {0x2E58 , 0x00000000}, - {0x2E5C , 0x00000000}, - {0x2E60 , 0x00000000}, - {0x2E64 , 0x00000000}, - {0x2E68 , 0x00000000}, - {0x2E6C , 0x00000000}, - {0x2E70 , 0x00000000}, - {0x2E74 , 0x00000000}, - {0x2E78 , 0x00000000}, - {0x2E7C , 0x00000000}, - {0x2E80 , 0x00000000}, - {0x2E84 , 0x00000000}, - {0x2E88 , 0x00000000}, - {0x2E8C , 0x00000000}, - {0x2E90 , 0x00000000}, - {0x2E94 , 0x00000000}, - {0x2E98 , 0x00000000}, - {0x2E9C , 0x00000000}, - {0x2EA0 , 0x00000000}, - {0x2EA4 , 0x00000000}, - {0x2EA8 , 0x00000000}, - {0x2EAC , 0x00000000}, - {0x2EB0 , 0x00000000}, - {0x2EB4 , 0x00000000}, - {0x2EB8 , 0x00000000}, - {0x2EBC , 0x00000000}, - {0x2EC0 , 0x00000000}, - {0x2EC4 , 0x00000000}, - {0x2EC8 , 0x00000000}, - {0x2ECC , 0x00000000}, - {0x2ED0 , 0x00000000}, - {0x2ED4 , 0x00000000}, - {0x2ED8 , 0x00000000}, - {0x2EDC , 0x00000000}, - {0x2EE0 , 0x00000000}, - {0x2EE4 ,0x00000000}, - {0x2EE8 ,0x00000000}, - {0x2EEC , 0x00000000}, - {0x2EF0 , 0x00000000}, - {0x2EF4 , 0x00000000}, - {0x2EF8 , 0x00000000}, - {0x2EFC , 0x00000000}, - /*{0x2F60 , 0x00000000},*/ -}; - -int initRegDataNum=sizeof(initRegData)/sizeof(RegData); - -typedef union { - unsigned int i; - float f; -} dmaBufRec, *dmaBuf; - -void Init3D( tridentContextPtr tmesa ) -{ - unsigned char *MMIO = tmesa->tridentScreen->mmio.map; - int i; - - for(i=0;itridentScreen->mmio.map; - dmaBufRec clr; - -printf("DRAW TRI\n"); - Init3D(tmesa); - -printf("ENGINE STATUS 0x%x\n",MMIO_IN32(MMIO, 0x2800)); - MMIO_OUT32(MMIO, 0x002800, 0x00000000 ); -#if 0 - MMIO_OUT32(MMIO, 0x002368 , MMIO_IN32(MMIO,0x002368)|1 ); -#endif - - MMIO_OUT32(MMIO, 0x002C00 , 0x00000014 ); -#if 0 - MMIO_OUT32(MMIO, 0x002C04 , 0x0A8004C0 ); -#else - MMIO_OUT32(MMIO, 0x002C04 , 0x0A8000C0 ); -#endif - -#if 0 - MMIO_OUT32(MMIO, 0x002C08 , 0x00000000 ); - MMIO_OUT32(MMIO, 0x002C0C , 0xFFCCCCCC ); - MMIO_OUT32(MMIO, 0x002C10 , 0x3F800000 ); - MMIO_OUT32(MMIO, 0x002C14 , 0x3D0D3DCB ); - MMIO_OUT32(MMIO, 0x002C2C , 0x70000000 ); - MMIO_OUT32(MMIO, 0x002C24 , 0x00202C00 ); - MMIO_OUT32(MMIO, 0x002C28 , 0xE0002500 ); - MMIO_OUT32(MMIO, 0x002C30 , 0x00000000 ); - MMIO_OUT32(MMIO, 0x002C34 , 0xE0000000 ); - MMIO_OUT32(MMIO, 0x002C38 , 0x00000000 ); -#endif - - MMIO_OUT32(MMIO, 0x002C50 , 0x00000000 ); - MMIO_OUT32(MMIO, 0x002C54 , 0x0C320C80 ); - MMIO_OUT32(MMIO, 0x002C50 , 0x00000000 ); - MMIO_OUT32(MMIO, 0x002C54 , 0x0C320C80 ); - MMIO_OUT32(MMIO, 0x002C80 , 0x20008258 ); - MMIO_OUT32(MMIO, 0x002C84 , 0x20000320 ); - MMIO_OUT32(MMIO, 0x002C94 , 0xFFFFFFFF ); - -#if 0 - MMIO_OUT32(MMIO, 0x002D00 , 0x00009009 ); - MMIO_OUT32(MMIO, 0x002D38 , 0x00000000 ); - MMIO_OUT32(MMIO, 0x002D94 , 0x20002000 ); - MMIO_OUT32(MMIO, 0x002D50 , 0xf0000000 ); - MMIO_OUT32(MMIO, 0x002D80 , 0x24002000 ); - MMIO_OUT32(MMIO, 0x002D98 , 0x81000000 ); - MMIO_OUT32(MMIO, 0x002DB0 , 0x81000000 ); - MMIO_OUT32(MMIO, 0x002DC8 , 0x808000FF ); - MMIO_OUT32(MMIO, 0x002DD4 , 0x02000200 ); - MMIO_OUT32(MMIO, 0x002DD8 , 0x02000200 ); - MMIO_OUT32(MMIO, 0x002D30 , 0x02092400 ); - MMIO_OUT32(MMIO, 0x002D04 , 0x00102120 ); - MMIO_OUT32(MMIO, 0x002D08 , 0xFFFFFFFF ); - MMIO_OUT32(MMIO, 0x002D0C , 0xF00010D0 ); - MMIO_OUT32(MMIO, 0x002D10 , 0xC0000400 ); -#endif - - MMIO_OUT32(MMIO, 0x002814, 0x00000000 ); -#if 0 - MMIO_OUT32(MMIO, 0x002818 , 0x00036C20 ); -#else - MMIO_OUT32(MMIO, 0x002818 , 0x00036020 ); -#endif - MMIO_OUT32(MMIO, 0x00281C , 0x00098081 ); - -printf("first TRI\n"); - clr.f = 5.0; - MMIO_OUT32(MMIO, 0x002820 , clr.i ); - clr.f = 595.0; - MMIO_OUT32(MMIO, 0x002824 , clr.i ); - clr.f = 1.0; - MMIO_OUT32(MMIO, 0x002828 , clr.i ); - MMIO_OUT32(MMIO, 0x00282C , 0x00FF00 ); -#if 0 - clr.f = 0.0; - MMIO_OUT32(MMIO, 0x002830 , clr.i ); - clr.f = 1.0; - MMIO_OUT32(MMIO, 0x002834 , clr.i ); -#endif - - clr.f = 5.0; - MMIO_OUT32(MMIO, 0x002820 , clr.i ); - clr.f = 5.0; - MMIO_OUT32(MMIO, 0x002824 , clr.i ); - clr.f = 1.0; - MMIO_OUT32(MMIO, 0x002828 , clr.i ); - MMIO_OUT32(MMIO, 0x00282C , 0xFF0000 ); -#if 0 - clr.f = 0.0; - MMIO_OUT32(MMIO, 0x002830 , clr.i ); - clr.f = 0.0; - MMIO_OUT32(MMIO, 0x002834 , clr.i ); -#endif - - clr.f = 395.0; -printf("0x%x\n",clr.i); - MMIO_OUT32(MMIO, 0x002820 , clr.i ); - clr.f = 5.0; - MMIO_OUT32(MMIO, 0x002824 , clr.i ); - clr.f = 1.0; - MMIO_OUT32(MMIO, 0x002828 , clr.i ); - MMIO_OUT32(MMIO, 0x00282C , 0xFF ); -#if 0 - clr.f = 1.0; - MMIO_OUT32(MMIO, 0x002830 , clr.i ); - clr.f = 0.0; - MMIO_OUT32(MMIO, 0x002834 , clr.i ); -#endif - -printf("sec TRI\n"); - MMIO_OUT32(MMIO, 0x00281C , 0x00093980 ); - clr.f = 395.0; - MMIO_OUT32(MMIO, 0x002820 , clr.i ); - clr.f = 595.0; - MMIO_OUT32(MMIO, 0x002824 , clr.i ); - clr.f = 1.0; - MMIO_OUT32(MMIO, 0x002828 , clr.i ); - MMIO_OUT32(MMIO, 0x00282C , 0x00FF00 ); -#if 0 - clr.f = 1.0; - MMIO_OUT32(MMIO, 0x002830 , clr.i ); - clr.f = 1.0; - MMIO_OUT32(MMIO, 0x002834 , clr.i ); -#endif - -#if 0 - MMIO_OUT32(MMIO, 0x002368 , MMIO_IN32(MMIO,0x002368)&0xfffffffe ); -#endif - -printf("fin TRI\n"); - - return 0; -} - -static INLINE void trident_draw_point(tridentContextPtr tmesa, - const tridentVertex *v0 ) -{ - unsigned char *MMIO = tmesa->tridentScreen->mmio.map; - (void) MMIO; -} - -static INLINE void trident_draw_line( tridentContextPtr tmesa, - const tridentVertex *v0, - const tridentVertex *v1 ) -{ - unsigned char *MMIO = tmesa->tridentScreen->mmio.map; - (void) MMIO; -} - -static INLINE void trident_draw_triangle( tridentContextPtr tmesa, - const tridentVertex *v0, - const tridentVertex *v1, - const tridentVertex *v2 ) -{ -} - -static INLINE void trident_draw_quad( tridentContextPtr tmesa, - const tridentVertex *v0, - const tridentVertex *v1, - const tridentVertex *v2, - const tridentVertex *v3 ) -{ - GLuint vertsize = tmesa->vertex_size; - GLint coloridx = (vertsize > 4) ? 4 : 3; - unsigned char *MMIO = tmesa->tridentScreen->mmio.map; - int clr; - float *ftmp = (float *)(&clr); - - if (tmesa->dirty) - tridentUploadHwStateLocked( tmesa ); -#if 0 - DrawTriangle(tmesa); - exit(0); -#else -#if 1 - if (first) { - Init3D(tmesa); -#if 0 - DrawTriangle(tmesa); -#endif - first = 0; - } -#endif - - LOCK_HARDWARE( tmesa ); - - MMIO_OUT32(MMIO, 0x002C00 , 0x00000010 ); - MMIO_OUT32(MMIO, 0x002C04 , 0x029C00C0 ); - - /* Z buffer */ - MMIO_OUT32(MMIO, 0x002C24 , 0x00100000 /*| (tmesa->tridentScreen->depthOffset)*/ ); - MMIO_OUT32(MMIO, 0x002C28 , 0xE0000000 | (tmesa->tridentScreen->depthPitch * 4) ); - - /* front buffer */ - MMIO_OUT32(MMIO, 0x002C50 , 0x00000000 | (tmesa->drawOffset) ); - MMIO_OUT32(MMIO, 0x002C54 , 0x0C320000 | (tmesa->drawPitch * 4) ); - - /* clipper */ - MMIO_OUT32(MMIO, 0x002C80 , 0x20008000 | tmesa->tridentScreen->height ); - MMIO_OUT32(MMIO, 0x002C84 , 0x20000000 | tmesa->tridentScreen->width ); - - /* writemask */ - MMIO_OUT32(MMIO, 0x002C94 , 0xFFFFFFFF ); - -if (vertsize == 4) { - MMIO_OUT32(MMIO, 0x002818 , 0x0003A020 ); - MMIO_OUT32(MMIO, 0x00281C , 0x00098021 ); - - *ftmp = v0->v.x; - MMIO_OUT32(MMIO, 0x002820 , clr ); - *ftmp = v0->v.y; - MMIO_OUT32(MMIO, 0x002824 , clr ); - *ftmp = v0->v.z; - MMIO_OUT32(MMIO, 0x002828 , clr ); -#if 0 - *ftmp = v0->v.w; - MMIO_OUT32(MMIO, 0x00282C , clr ); -#endif - MMIO_OUT32(MMIO, 0x00282C , v0->ui[coloridx] ); - - *ftmp = v1->v.x; - MMIO_OUT32(MMIO, 0x002820 , clr ); - *ftmp = v1->v.y; - MMIO_OUT32(MMIO, 0x002824 , clr ); - *ftmp = v1->v.z; - MMIO_OUT32(MMIO, 0x002828 , clr ); -#if 0 - *ftmp = v1->v.w; - MMIO_OUT32(MMIO, 0x00282C , clr ); -#endif - MMIO_OUT32(MMIO, 0x00282C , v1->ui[coloridx] ); - - *ftmp = v2->v.x; - MMIO_OUT32(MMIO, 0x002820 , clr ); - *ftmp = v2->v.y; - MMIO_OUT32(MMIO, 0x002824 , clr ); - *ftmp = v2->v.z; - MMIO_OUT32(MMIO, 0x002828 , clr ); -#if 0 - *ftmp = v2->v.w; - MMIO_OUT32(MMIO, 0x00282C , clr ); -#endif - MMIO_OUT32(MMIO, 0x00282C , v2->ui[coloridx] ); - - MMIO_OUT32(MMIO, 0x00281C , 0x00093020 ); - *ftmp = v3->v.x; - MMIO_OUT32(MMIO, 0x002820 , clr ); - *ftmp = v3->v.y; - MMIO_OUT32(MMIO, 0x002824 , clr ); - *ftmp = v3->v.z; - MMIO_OUT32(MMIO, 0x002828 , clr ); -#if 0 - *ftmp = v3->v.w; - MMIO_OUT32(MMIO, 0x00282C , clr ); -#endif - MMIO_OUT32(MMIO, 0x00282C , v3->ui[coloridx] ); - -} -#endif - - UNLOCK_HARDWARE( tmesa ); -} -/*********************************************************************** - * Rasterization fallback helpers * - ***********************************************************************/ - - -/* This code is hit only when a mix of accelerated and unaccelerated - * primitives are being drawn, and only for the unaccelerated - * primitives. - */ -#if 0 -static void -trident_fallback_quad( tridentContextPtr tmesa, - const tridentVertex *v0, - const tridentVertex *v1, - const tridentVertex *v2, - const tridentVertex *v3 ) -{ - GLcontext *ctx = tmesa->glCtx; - SWvertex v[4]; - trident_translate_vertex( ctx, v0, &v[0] ); - trident_translate_vertex( ctx, v1, &v[1] ); - trident_translate_vertex( ctx, v2, &v[2] ); - trident_translate_vertex( ctx, v3, &v[3] ); - _swrast_Quad( ctx, &v[0], &v[1], &v[2], &v[3] ); -} -#endif - -/* XXX hack to get the prototype defined in time... */ -void trident_translate_vertex(GLcontext *ctx, const tridentVertex *src, - SWvertex *dst); - -static void -trident_fallback_tri( tridentContextPtr tmesa, - const tridentVertex *v0, - const tridentVertex *v1, - const tridentVertex *v2 ) -{ - GLcontext *ctx = tmesa->glCtx; - SWvertex v[3]; - trident_translate_vertex( ctx, v0, &v[0] ); - trident_translate_vertex( ctx, v1, &v[1] ); - trident_translate_vertex( ctx, v2, &v[2] ); - _swrast_Triangle( ctx, &v[0], &v[1], &v[2] ); -} - -static void -trident_fallback_line( tridentContextPtr tmesa, - const tridentVertex *v0, - const tridentVertex *v1 ) -{ - GLcontext *ctx = tmesa->glCtx; - SWvertex v[2]; - trident_translate_vertex( ctx, v0, &v[0] ); - trident_translate_vertex( ctx, v1, &v[1] ); - _swrast_Line( ctx, &v[0], &v[1] ); -} - - -static void -trident_fallback_point( tridentContextPtr tmesa, - const tridentVertex *v0 ) -{ - GLcontext *ctx = tmesa->glCtx; - SWvertex v[1]; - trident_translate_vertex( ctx, v0, &v[0] ); - _swrast_Point( ctx, &v[0] ); -} - -/*********************************************************************** - * Macros for t_dd_tritmp.h to draw basic primitives * - ***********************************************************************/ - -#define TRI( a, b, c ) \ -do { \ - if (DO_FALLBACK) \ - tmesa->draw_tri( tmesa, a, b, c ); \ - else \ - trident_draw_triangle( tmesa, a, b, c ); \ -} while (0) - -#define QUAD( a, b, c, d ) \ -do { \ - if (DO_FALLBACK) { \ - tmesa->draw_tri( tmesa, a, b, d ); \ - tmesa->draw_tri( tmesa, b, c, d ); \ - } else \ - trident_draw_quad( tmesa, a, b, c, d ); \ -} while (0) - -#define LINE( v0, v1 ) \ -do { \ - if (DO_FALLBACK) \ - tmesa->draw_line( tmesa, v0, v1 ); \ - else \ - trident_draw_line( tmesa, v0, v1 ); \ -} while (0) - -#define POINT( v0 ) \ -do { \ - if (DO_FALLBACK) \ - tmesa->draw_point( tmesa, v0 ); \ - else \ - trident_draw_point( tmesa, v0 ); \ -} while (0) - -/*********************************************************************** - * Build render functions from dd templates * - ***********************************************************************/ - -#define TRIDENT_OFFSET_BIT 0x01 -#define TRIDENT_TWOSIDE_BIT 0x02 -#define TRIDENT_UNFILLED_BIT 0x04 -#define TRIDENT_FALLBACK_BIT 0x08 -#define TRIDENT_MAX_TRIFUNC 0x10 - - -static struct { - tnl_points_func points; - tnl_line_func line; - tnl_triangle_func triangle; - tnl_quad_func quad; -} rast_tab[TRIDENT_MAX_TRIFUNC]; - - -#define DO_FALLBACK (IND & TRIDENT_FALLBACK_BIT) -#define DO_OFFSET (IND & TRIDENT_OFFSET_BIT) -#define DO_UNFILLED (IND & TRIDENT_UNFILLED_BIT) -#define DO_TWOSIDE (IND & TRIDENT_TWOSIDE_BIT) -#define DO_FLAT 0 -#define DO_TRI 1 -#define DO_QUAD 1 -#define DO_LINE 1 -#define DO_POINTS 1 -#define DO_FULL_QUAD 1 - -#define HAVE_RGBA 1 -#define HAVE_SPEC 1 -#define HAVE_BACK_COLORS 0 -#define HAVE_HW_FLATSHADE 1 -#define VERTEX tridentVertex -#define TAB rast_tab - -#define DEPTH_SCALE 1.0 -#define UNFILLED_TRI unfilled_tri -#define UNFILLED_QUAD unfilled_quad -#define VERT_X(_v) _v->v.x -#define VERT_Y(_v) _v->v.y -#define VERT_Z(_v) _v->v.z -#define AREA_IS_CCW( a ) (a > 0) -#define GET_VERTEX(e) (tmesa->verts + (e<vertex_stride_shift)) - -#define TRIDENT_COLOR( dst, src ) \ -do { \ - dst[0] = src[2]; \ - dst[1] = src[1]; \ - dst[2] = src[0]; \ - dst[3] = src[3]; \ -} while (0) - -#define TRIDENT_SPEC( dst, src ) \ -do { \ - dst[0] = src[2]; \ - dst[1] = src[1]; \ - dst[2] = src[0]; \ -} while (0) - -#define VERT_SET_RGBA( v, c ) TRIDENT_COLOR( v->ub4[coloroffset], c ) -#define VERT_COPY_RGBA( v0, v1 ) v0->ui[coloroffset] = v1->ui[coloroffset] -#define VERT_SAVE_RGBA( idx ) color[idx] = v[idx]->ui[coloroffset] -#define VERT_RESTORE_RGBA( idx ) v[idx]->ui[coloroffset] = color[idx] - -#define VERT_SET_SPEC( v, c ) if (havespec) TRIDENT_SPEC( v->ub4[5], c ) -#define VERT_COPY_SPEC( v0, v1 ) if (havespec) COPY_3V(v0->ub4[5], v1->ub4[5]) -#define VERT_SAVE_SPEC( idx ) if (havespec) spec[idx] = v[idx]->ui[5] -#define VERT_RESTORE_SPEC( idx ) if (havespec) v[idx]->ui[5] = spec[idx] - -#define LOCAL_VARS(n) \ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); \ - GLuint color[n], spec[n]; \ - GLuint coloroffset = (tmesa->vertex_size == 4 ? 3 : 4); \ - GLboolean havespec = (tmesa->vertex_size == 4 ? 0 : 1); \ - (void) color; (void) spec; (void) coloroffset; (void) havespec; -/*********************************************************************** - * Helpers for rendering unfilled primitives * - ***********************************************************************/ -#if 0 -static const GLuint hw_prim[GL_POLYGON+1] = { - B_PrimType_Points, - B_PrimType_Lines, - B_PrimType_Lines, - B_PrimType_Lines, - B_PrimType_Triangles, - B_PrimType_Triangles, - B_PrimType_Triangles, - B_PrimType_Triangles, - B_PrimType_Triangles, - B_PrimType_Triangles -}; -#endif - -static void tridentResetLineStipple( GLcontext *ctx ); -#if 0 -static void tridentRasterPrimitive( GLcontext *ctx, GLuint hwprim ); -#endif -static void tridentRenderPrimitive( GLcontext *ctx, GLenum prim ); - -#define RASTERIZE(x) /*if (tmesa->hw_primitive != hw_prim[x]) \ - tridentRasterPrimitive( ctx, hw_prim[x] ) */ -#define RENDER_PRIMITIVE tmesa->render_primitive -#define TAG(x) x -#define IND TRIDENT_FALLBACK_BIT -#include "tnl_dd/t_dd_unfilled.h" -#undef IND - -/*********************************************************************** - * Generate GL render functions * - ***********************************************************************/ - -#define IND (0) -#define TAG(x) x -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (TRIDENT_OFFSET_BIT) -#define TAG(x) x##_offset -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (TRIDENT_TWOSIDE_BIT) -#define TAG(x) x##_twoside -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (TRIDENT_TWOSIDE_BIT|TRIDENT_OFFSET_BIT) -#define TAG(x) x##_twoside_offset -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (TRIDENT_UNFILLED_BIT) -#define TAG(x) x##_unfilled -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (TRIDENT_OFFSET_BIT|TRIDENT_UNFILLED_BIT) -#define TAG(x) x##_offset_unfilled -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (TRIDENT_TWOSIDE_BIT|TRIDENT_UNFILLED_BIT) -#define TAG(x) x##_twoside_unfilled -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (TRIDENT_TWOSIDE_BIT|TRIDENT_OFFSET_BIT|TRIDENT_UNFILLED_BIT) -#define TAG(x) x##_twoside_offset_unfilled -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (TRIDENT_FALLBACK_BIT) -#define TAG(x) x##_fallback -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (TRIDENT_OFFSET_BIT|TRIDENT_FALLBACK_BIT) -#define TAG(x) x##_offset_fallback -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (TRIDENT_TWOSIDE_BIT|TRIDENT_FALLBACK_BIT) -#define TAG(x) x##_twoside_fallback -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (TRIDENT_TWOSIDE_BIT|TRIDENT_OFFSET_BIT|TRIDENT_FALLBACK_BIT) -#define TAG(x) x##_twoside_offset_fallback -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (TRIDENT_UNFILLED_BIT|TRIDENT_FALLBACK_BIT) -#define TAG(x) x##_unfilled_fallback -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (TRIDENT_OFFSET_BIT|TRIDENT_UNFILLED_BIT|TRIDENT_FALLBACK_BIT) -#define TAG(x) x##_offset_unfilled_fallback -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (TRIDENT_TWOSIDE_BIT|TRIDENT_UNFILLED_BIT|TRIDENT_FALLBACK_BIT) -#define TAG(x) x##_twoside_unfilled_fallback -#include "tnl_dd/t_dd_tritmp.h" - -#define IND (TRIDENT_TWOSIDE_BIT|TRIDENT_OFFSET_BIT|TRIDENT_UNFILLED_BIT|TRIDENT_FALLBACK_BIT) -#define TAG(x) x##_twoside_offset_unfilled_fallback -#include "tnl_dd/t_dd_tritmp.h" - -static void init_rast_tab( void ) -{ - init(); - init_offset(); - init_twoside(); - init_twoside_offset(); - init_unfilled(); - init_offset_unfilled(); - init_twoside_unfilled(); - init_twoside_offset_unfilled(); - init_fallback(); - init_offset_fallback(); - init_twoside_fallback(); - init_twoside_offset_fallback(); - init_unfilled_fallback(); - init_offset_unfilled_fallback(); - init_twoside_unfilled_fallback(); - init_twoside_offset_unfilled_fallback(); -} - - -/**********************************************************************/ -/* Render unclipped begin/end objects */ -/**********************************************************************/ - -#define VERT(x) (tridentVertex *)(tridentverts + (x << shift)) -#define RENDER_POINTS( start, count ) \ - for ( ; start < count ; start++) \ - trident_draw_point( tmesa, VERT(start) ) -#define RENDER_LINE( v0, v1 ) \ - trident_draw_line( tmesa, VERT(v0), VERT(v1) ) -#define RENDER_TRI( v0, v1, v2 ) \ - trident_draw_triangle( tmesa, VERT(v0), VERT(v1), VERT(v2) ) -#define RENDER_QUAD( v0, v1, v2, v3 ) \ - trident_draw_quad( tmesa, VERT(v0), VERT(v1), VERT(v2), VERT(v3) ) -#define INIT(x) tridentRenderPrimitive( ctx, x ); -#undef LOCAL_VARS -#define LOCAL_VARS \ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); \ - const GLuint shift = tmesa->vertex_stride_shift; \ - const char *tridentverts = (char *)tmesa->verts; \ - const GLboolean stipple = ctx->Line.StippleFlag; \ - const GLuint * const elt = TNL_CONTEXT(ctx)->vb.Elts; \ - (void) elt; -#define RESET_STIPPLE if ( stipple ) tridentResetLineStipple( ctx ); -#define RESET_OCCLUSION -#define PRESERVE_VB_DEFS -#define ELT(x) (x) -#define TAG(x) trident_##x##_verts -#include "tnl/t_vb_rendertmp.h" -#undef ELT -#undef TAG -#define TAG(x) trident_##x##_elts -#define ELT(x) elt[x] -#include "tnl/t_vb_rendertmp.h" - -/**********************************************************************/ -/* Render clipped primitives */ -/**********************************************************************/ - -static void tridentRenderClippedPoly( GLcontext *ctx, const GLuint *elts, - GLuint n ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint prim = tmesa->render_primitive; - - /* Render the new vertices as an unclipped polygon. - */ - { - GLuint *tmp = VB->Elts; - VB->Elts = (GLuint *)elts; - tnl->Driver.Render.PrimTabElts[GL_POLYGON]( ctx, 0, n, PRIM_BEGIN|PRIM_END ); - VB->Elts = tmp; - } - - /* Restore the render primitive - */ - if (prim != GL_POLYGON) - tnl->Driver.Render.PrimitiveNotify( ctx, prim ); -} - -static void tridentRenderClippedLine( GLcontext *ctx, GLuint ii, GLuint jj ) -{ - TNLcontext *tnl = TNL_CONTEXT(ctx); - tnl->Driver.Render.Line( ctx, ii, jj ); -} - - -/**********************************************************************/ -/* Choose render functions */ -/**********************************************************************/ - -#define _TRIDENT_NEW_RENDER_STATE (_DD_NEW_LINE_STIPPLE | \ - _DD_NEW_LINE_SMOOTH | \ - _DD_NEW_POINT_SMOOTH | \ - _DD_NEW_TRI_SMOOTH | \ - _DD_NEW_TRI_UNFILLED | \ - _DD_NEW_TRI_LIGHT_TWOSIDE | \ - _DD_NEW_TRI_OFFSET) \ - - -#define POINT_FALLBACK (DD_POINT_SMOOTH) -#define LINE_FALLBACK (DD_LINE_STIPPLE|DD_LINE_SMOOTH) -#define TRI_FALLBACK (DD_TRI_SMOOTH) -#define ANY_FALLBACK_FLAGS (POINT_FALLBACK|LINE_FALLBACK|TRI_FALLBACK) -#define ANY_RASTER_FLAGS (DD_TRI_LIGHT_TWOSIDE|DD_TRI_OFFSET|DD_TRI_UNFILLED) - - -static void tridentChooseRenderState(GLcontext *ctx) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint flags = ctx->_TriangleCaps; - GLuint index = 0; - - if (flags & (ANY_RASTER_FLAGS|ANY_FALLBACK_FLAGS)) { - tmesa->draw_point = trident_draw_point; - tmesa->draw_line = trident_draw_line; - tmesa->draw_tri = trident_draw_triangle; - - if (flags & ANY_RASTER_FLAGS) { - if (flags & DD_TRI_LIGHT_TWOSIDE) index |= TRIDENT_TWOSIDE_BIT; - if (flags & DD_TRI_OFFSET) index |= TRIDENT_OFFSET_BIT; - if (flags & DD_TRI_UNFILLED) index |= TRIDENT_UNFILLED_BIT; - } - - /* Hook in fallbacks for specific primitives. - */ - if (flags & (POINT_FALLBACK|LINE_FALLBACK|TRI_FALLBACK)) { - if (flags & POINT_FALLBACK) tmesa->draw_point = trident_fallback_point; - if (flags & LINE_FALLBACK) tmesa->draw_line = trident_fallback_line; - if (flags & TRI_FALLBACK) tmesa->draw_tri = trident_fallback_tri; - index |= TRIDENT_FALLBACK_BIT; - } - } - - if (tmesa->RenderIndex != index) { - tmesa->RenderIndex = index; - - tnl->Driver.Render.Points = rast_tab[index].points; - tnl->Driver.Render.Line = rast_tab[index].line; - tnl->Driver.Render.Triangle = rast_tab[index].triangle; - tnl->Driver.Render.Quad = rast_tab[index].quad; - - if (tmesa->RenderIndex == 0) { - tnl->Driver.Render.PrimTabVerts = trident_render_tab_verts; - tnl->Driver.Render.PrimTabElts = trident_render_tab_elts; - } else { - tnl->Driver.Render.PrimTabVerts = _tnl_render_tab_verts; - tnl->Driver.Render.PrimTabElts = _tnl_render_tab_elts; - } - tnl->Driver.Render.ClippedLine = tridentRenderClippedLine; - tnl->Driver.Render.ClippedPolygon = tridentRenderClippedPoly; - } -} - - -/**********************************************************************/ -/* High level hooks for t_vb_render.c */ -/**********************************************************************/ - - - -/* Determine the rasterized primitive when not drawing unfilled - * polygons. - * - * Used only for the default render stage which always decomposes - * primitives to trianges/lines/points. For the accelerated stage, - * which renders strips as strips, the equivalent calculations are - * performed in tridentrender.c. - */ -#if 0 -static void tridentRasterPrimitive( GLcontext *ctx, GLuint hwprim ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - if (tmesa->hw_primitive != hwprim) - tmesa->hw_primitive = hwprim; -} -#endif - -static void tridentRenderPrimitive( GLcontext *ctx, GLenum prim ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - tmesa->render_primitive = prim; -} - -static void tridentRunPipeline( GLcontext *ctx ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - - if ( tmesa->new_state ) - tridentDDUpdateHWState( ctx ); - - if (tmesa->new_gl_state) { -#if 0 - if (tmesa->new_gl_state & _NEW_TEXTURE) - tridentUpdateTextureState( ctx ); -#endif - - if (!tmesa->Fallback) { - if (tmesa->new_gl_state & _TRIDENT_NEW_VERTEX) - tridentChooseVertexState( ctx ); - - if (tmesa->new_gl_state & _TRIDENT_NEW_RENDER_STATE) - tridentChooseRenderState( ctx ); - } - - tmesa->new_gl_state = 0; - } - - _tnl_run_pipeline( ctx ); -} - -static void tridentRenderStart( GLcontext *ctx ) -{ - /* Check for projective texturing. Make sure all texcoord - * pointers point to something. (fix in mesa?) - */ - tridentCheckTexSizes( ctx ); -} - -static void tridentRenderFinish( GLcontext *ctx ) -{ - if (0) - _swrast_flush( ctx ); /* never needed */ -} - -static void tridentResetLineStipple( GLcontext *ctx ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - (void) tmesa; - - /* Reset the hardware stipple counter. - */ -} - - -/**********************************************************************/ -/* Transition to/from hardware rasterization. */ -/**********************************************************************/ - - -void tridentFallback( tridentContextPtr tmesa, GLuint bit, GLboolean mode ) -{ - GLcontext *ctx = tmesa->glCtx; - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint oldfallback = tmesa->Fallback; - - _tnl_need_projected_coords( ctx, GL_FALSE ); - - if (mode) { - tmesa->Fallback |= bit; - if (oldfallback == 0) { - _swsetup_Wakeup( ctx ); - tmesa->RenderIndex = ~0; - } - } - else { - tmesa->Fallback &= ~bit; - if (oldfallback == bit) { - _swrast_flush( ctx ); - tnl->Driver.Render.Start = tridentRenderStart; - tnl->Driver.Render.PrimitiveNotify = tridentRenderPrimitive; - tnl->Driver.Render.Finish = tridentRenderFinish; - tnl->Driver.Render.BuildVertices = tridentBuildVertices; - tnl->Driver.Render.ResetLineStipple = tridentResetLineStipple; - tmesa->new_gl_state |= (_TRIDENT_NEW_RENDER_STATE| - _TRIDENT_NEW_VERTEX); - } - } -} - - -/**********************************************************************/ -/* Initialization. */ -/**********************************************************************/ - - -void tridentDDInitTriFuncs( GLcontext *ctx ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - TNLcontext *tnl = TNL_CONTEXT(ctx); - static int firsttime = 1; - - if (firsttime) { - init_rast_tab(); - firsttime = 0; - } - - tmesa->RenderIndex = ~0; - - tnl->Driver.RunPipeline = tridentRunPipeline; - tnl->Driver.Render.Start = tridentRenderStart; - tnl->Driver.Render.Finish = tridentRenderFinish; - tnl->Driver.Render.PrimitiveNotify = tridentRenderPrimitive; - tnl->Driver.Render.ResetLineStipple = tridentResetLineStipple; - tnl->Driver.Render.BuildVertices = tridentBuildVertices; -} diff --git a/src/mesa/drivers/dri/trident/trident_vb.c b/src/mesa/drivers/dri/trident/trident_vb.c deleted file mode 100644 index 055a914595..0000000000 --- a/src/mesa/drivers/dri/trident/trident_vb.c +++ /dev/null @@ -1,434 +0,0 @@ -/* - * Copyright 2002 by Alan Hourihane, Sychdyn, North Wales, UK. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Alan Hourihane not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Alan Hourihane makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: Alan Hourihane, - * - * Trident CyberBladeXP driver. - * - */ -#include "main/glheader.h" -#include "main/mtypes.h" -#include "main/macros.h" -#include "main/colormac.h" - -#include "swrast_setup/swrast_setup.h" -#include "swrast/swrast.h" -#include "tnl/t_context.h" -#include "tnl/tnl.h" - -#include "trident_context.h" - -#define TRIDENT_TEX1_BIT 0x1 -#define TRIDENT_TEX0_BIT 0x2 -#define TRIDENT_RGBA_BIT 0x4 -#define TRIDENT_SPEC_BIT 0x8 -#define TRIDENT_FOG_BIT 0x10 -#define TRIDENT_XYZW_BIT 0x20 -#define TRIDENT_PTEX_BIT 0x40 -#define TRIDENT_MAX_SETUP 0x80 - -static struct { - void (*emit)( GLcontext *, GLuint, GLuint, void *, GLuint ); - tnl_interp_func interp; - tnl_copy_pv_func copy_pv; - GLboolean (*check_tex_sizes)( GLcontext *ctx ); - GLuint vertex_size; - GLuint vertex_stride_shift; - GLuint vertex_format; -} setup_tab[TRIDENT_MAX_SETUP]; - -#define TINY_VERTEX_FORMAT 1 -#define NOTEX_VERTEX_FORMAT 2 -#define TEX0_VERTEX_FORMAT 3 -#define TEX1_VERTEX_FORMAT 4 -#define PROJ_TEX1_VERTEX_FORMAT 5 -#define TEX2_VERTEX_FORMAT 6 -#define TEX3_VERTEX_FORMAT 7 -#define PROJ_TEX3_VERTEX_FORMAT 8 - -#define DO_XYZW (IND & TRIDENT_XYZW_BIT) -#define DO_RGBA (IND & TRIDENT_RGBA_BIT) -#define DO_SPEC (IND & TRIDENT_SPEC_BIT) -#define DO_FOG (IND & TRIDENT_FOG_BIT) -#define DO_TEX0 (IND & TRIDENT_TEX0_BIT) -#define DO_TEX1 (IND & TRIDENT_TEX1_BIT) -#define DO_TEX2 0 -#define DO_TEX3 0 -#define DO_PTEX (IND & TRIDENT_PTEX_BIT) - -#define VERTEX tridentVertex -#define VERTEX_COLOR trident_color_t -#define LOCALVARS tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); -#define GET_VIEWPORT_MAT() tmesa->hw_viewport -#define GET_TEXSOURCE(n) tmesa->tmu_source[n] -#define GET_VERTEX_FORMAT() tmesa->vertex_format -#define GET_VERTEX_SIZE() tmesa->vertex_size -#define GET_VERTEX_STORE() tmesa->verts -#define GET_VERTEX_STRIDE_SHIFT() tmesa->vertex_stride_shift -#define GET_UBYTE_COLOR_STORE() &tmesa->UbyteColor -#define GET_UBYTE_SPEC_COLOR_STORE() &tmesa->UbyteSecondaryColor - -#define HAVE_HW_VIEWPORT 0 -#define HAVE_HW_DIVIDE 0 -#define HAVE_RGBA_COLOR 0 -#define HAVE_TINY_VERTICES 1 -#define HAVE_NOTEX_VERTICES 1 -#define HAVE_TEX0_VERTICES 1 -#define HAVE_TEX1_VERTICES 1 -#define HAVE_TEX2_VERTICES 0 -#define HAVE_TEX3_VERTICES 0 -#define HAVE_PTEX_VERTICES 0 - -#define UNVIEWPORT_VARS \ - const GLfloat dx = - tmesa->drawX - SUBPIXEL_X; \ - const GLfloat dy = (tmesa->driDrawable->h + \ - tmesa->drawY + SUBPIXEL_Y); \ - const GLfloat sz = 1.0 / tmesa->depth_scale - -#define UNVIEWPORT_X(x) x + dx; -#define UNVIEWPORT_Y(y) - y + dy; -#define UNVIEWPORT_Z(z) z * sz; - -#define PTEX_FALLBACK() tridentFallback(TRIDENT_CONTEXT(ctx), TRIDENT_FALLBACK_TEXTURE, 1) - -#define IMPORT_FLOAT_COLORS trident_import_float_colors -#define IMPORT_FLOAT_SPEC_COLORS trident_import_float_spec_colors - -#define INTERP_VERTEX setup_tab[tmesa->SetupIndex].interp -#define COPY_PV_VERTEX setup_tab[tmesa->SetupIndex].copy_pv - -/*********************************************************************** - * Generate pv-copying and translation functions * - ***********************************************************************/ - -#define TAG(x) trident_##x -#include "tnl_dd/t_dd_vb.c" - -/*********************************************************************** - * Generate vertex emit and interp functions * - ***********************************************************************/ - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT) -#define TAG(x) x##_wg -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_SPEC_BIT) -#define TAG(x) x##_wgs -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_TEX0_BIT) -#define TAG(x) x##_wgt0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_TEX0_BIT|TRIDENT_TEX1_BIT) -#define TAG(x) x##_wgt0t1 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_TEX0_BIT|TRIDENT_PTEX_BIT) -#define TAG(x) x##_wgpt0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_SPEC_BIT|TRIDENT_TEX0_BIT) -#define TAG(x) x##_wgst0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_SPEC_BIT|TRIDENT_TEX0_BIT|TRIDENT_TEX1_BIT) -#define TAG(x) x##_wgst0t1 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_SPEC_BIT|TRIDENT_TEX0_BIT|TRIDENT_PTEX_BIT) -#define TAG(x) x##_wgspt0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT) -#define TAG(x) x##_wgf -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_SPEC_BIT) -#define TAG(x) x##_wgfs -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_TEX0_BIT) -#define TAG(x) x##_wgft0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_TEX0_BIT|TRIDENT_TEX1_BIT) -#define TAG(x) x##_wgft0t1 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_TEX0_BIT|TRIDENT_PTEX_BIT) -#define TAG(x) x##_wgfpt0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_SPEC_BIT|TRIDENT_TEX0_BIT) -#define TAG(x) x##_wgfst0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_SPEC_BIT|TRIDENT_TEX0_BIT|TRIDENT_TEX1_BIT) -#define TAG(x) x##_wgfst0t1 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_SPEC_BIT|TRIDENT_TEX0_BIT|TRIDENT_PTEX_BIT) -#define TAG(x) x##_wgfspt0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_TEX0_BIT) -#define TAG(x) x##_t0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_TEX0_BIT|TRIDENT_TEX1_BIT) -#define TAG(x) x##_t0t1 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_FOG_BIT) -#define TAG(x) x##_f -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_FOG_BIT|TRIDENT_TEX0_BIT) -#define TAG(x) x##_ft0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_FOG_BIT|TRIDENT_TEX0_BIT|TRIDENT_TEX1_BIT) -#define TAG(x) x##_ft0t1 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_RGBA_BIT) -#define TAG(x) x##_g -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_RGBA_BIT|TRIDENT_SPEC_BIT) -#define TAG(x) x##_gs -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_RGBA_BIT|TRIDENT_TEX0_BIT) -#define TAG(x) x##_gt0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_RGBA_BIT|TRIDENT_TEX0_BIT|TRIDENT_TEX1_BIT) -#define TAG(x) x##_gt0t1 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_RGBA_BIT|TRIDENT_SPEC_BIT|TRIDENT_TEX0_BIT) -#define TAG(x) x##_gst0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_RGBA_BIT|TRIDENT_SPEC_BIT|TRIDENT_TEX0_BIT|TRIDENT_TEX1_BIT) -#define TAG(x) x##_gst0t1 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT) -#define TAG(x) x##_gf -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_SPEC_BIT) -#define TAG(x) x##_gfs -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_TEX0_BIT) -#define TAG(x) x##_gft0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_TEX0_BIT|TRIDENT_TEX1_BIT) -#define TAG(x) x##_gft0t1 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_SPEC_BIT|TRIDENT_TEX0_BIT) -#define TAG(x) x##_gfst0 -#include "tnl_dd/t_dd_vbtmp.h" - -#define IND (TRIDENT_RGBA_BIT|TRIDENT_FOG_BIT|TRIDENT_SPEC_BIT|TRIDENT_TEX0_BIT|TRIDENT_TEX1_BIT) -#define TAG(x) x##_gfst0t1 -#include "tnl_dd/t_dd_vbtmp.h" - -static void init_setup_tab( void ) -{ - init_wg(); - init_wgs(); - init_wgt0(); - init_wgt0t1(); - init_wgpt0(); - init_wgst0(); - init_wgst0t1(); - init_wgspt0(); - init_wgf(); - init_wgfs(); - init_wgft0(); - init_wgft0t1(); - init_wgfpt0(); - init_wgfst0(); - init_wgfst0t1(); - init_wgfspt0(); - init_t0(); - init_t0t1(); - init_f(); - init_ft0(); - init_ft0t1(); - init_g(); - init_gs(); - init_gt0(); - init_gt0t1(); - init_gst0(); - init_gst0t1(); - init_gf(); - init_gfs(); - init_gft0(); - init_gft0t1(); - init_gfst0(); - init_gfst0t1(); -} - -void tridentBuildVertices( GLcontext *ctx, - GLuint start, - GLuint count, - GLuint newinputs ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT( ctx ); - GLubyte *v = ((GLubyte *)tmesa->verts + (start<vertex_stride_shift)); - GLuint stride = 1<vertex_stride_shift; - - newinputs |= tmesa->SetupNewInputs; - tmesa->SetupNewInputs = 0; - - if (!newinputs) - return; - - if (newinputs & VERT_BIT_POS) { - setup_tab[tmesa->SetupIndex].emit( ctx, start, count, v, stride ); - } else { - GLuint ind = 0; - - if (newinputs & VERT_BIT_COLOR0) - ind |= TRIDENT_RGBA_BIT; - - if (newinputs & VERT_BIT_COLOR1) - ind |= TRIDENT_SPEC_BIT; - - if (newinputs & VERT_BIT_TEX0) - ind |= TRIDENT_TEX0_BIT; - - if (newinputs & VERT_BIT_TEX1) - ind |= TRIDENT_TEX1_BIT; - - if (newinputs & VERT_BIT_FOG) - ind |= TRIDENT_FOG_BIT; - - if (tmesa->SetupIndex & TRIDENT_PTEX_BIT) - ind = ~0; - - ind &= tmesa->SetupIndex; - - if (ind) { - setup_tab[ind].emit( ctx, start, count, v, stride ); - } - } -} - -void tridentCheckTexSizes( GLcontext *ctx ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT( ctx ); - - if (!setup_tab[tmesa->SetupIndex].check_tex_sizes(ctx)) { - TNLcontext *tnl = TNL_CONTEXT(ctx); - - /* Invalidate stored verts - */ - tmesa->SetupNewInputs = ~0; - tmesa->SetupIndex |= TRIDENT_PTEX_BIT; - - if (!tmesa->Fallback && - !(ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED))) { - tnl->Driver.Render.Interp = setup_tab[tmesa->SetupIndex].interp; - tnl->Driver.Render.CopyPV = setup_tab[tmesa->SetupIndex].copy_pv; - } - } -} - -void tridentChooseVertexState( GLcontext *ctx ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT( ctx ); - TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint ind = TRIDENT_XYZW_BIT|TRIDENT_RGBA_BIT; - - if (ctx->_TriangleCaps & DD_SEPARATE_SPECULAR) - ind |= TRIDENT_SPEC_BIT; - - if (ctx->Fog.Enabled) - ind |= TRIDENT_FOG_BIT; - - if (ctx->Texture.Unit[0]._ReallyEnabled) { - ind |= TRIDENT_TEX0_BIT; - if (ctx->Texture.Unit[1]._ReallyEnabled) { - ind |= TRIDENT_TEX1_BIT; - } - } - - tmesa->SetupIndex = ind; - - if (ctx->_TriangleCaps & (DD_TRI_LIGHT_TWOSIDE|DD_TRI_UNFILLED)) { - tnl->Driver.Render.Interp = trident_interp_extras; - tnl->Driver.Render.CopyPV = trident_copy_pv_extras; - } else { - tnl->Driver.Render.Interp = setup_tab[ind].interp; - tnl->Driver.Render.CopyPV = setup_tab[ind].copy_pv; - } - - if (setup_tab[ind].vertex_format != tmesa->vertex_format) { - tmesa->vertex_format = setup_tab[ind].vertex_format; - tmesa->vertex_size = setup_tab[ind].vertex_size; - tmesa->vertex_stride_shift = setup_tab[ind].vertex_stride_shift; - } -} - -void tridentInitVB( GLcontext *ctx ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - GLuint size = TNL_CONTEXT(ctx)->vb.Size; - - tmesa->verts = (GLubyte *)ALIGN_MALLOC( size * 16 * 4, 32 ); - - { - static int firsttime = 1; - if (firsttime) { - init_setup_tab(); - firsttime = 0; - } - } -} - -void tridentFreeVB( GLcontext *ctx ) -{ - tridentContextPtr tmesa = TRIDENT_CONTEXT(ctx); - - if (tmesa->verts) { - ALIGN_FREE(tmesa->verts); - tmesa->verts = 0; - } - - if (tmesa->UbyteSecondaryColor.Ptr) { - ALIGN_FREE((void *)tmesa->UbyteSecondaryColor.Ptr); - tmesa->UbyteSecondaryColor.Ptr = 0; - } - - if (tmesa->UbyteColor.Ptr) { - ALIGN_FREE((void *)tmesa->UbyteColor.Ptr); - tmesa->UbyteColor.Ptr = 0; - } -} -- cgit v1.2.3 From 2f7abf5c042a1bcf97d77d6dad4a17bda37e0567 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Oct 2009 16:26:54 -0600 Subject: i965: remove unused BRW_FALLBACK_TEXTURE bit The value was probably wrong too. It was the same as INTEL_FALLBACK_DRAW_BUFFER. --- src/mesa/drivers/dri/i965/brw_context.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index a5209ac41b..b7d6c7ce7e 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -115,7 +115,7 @@ * Handles blending and (presumably) depth and stencil testing. */ -#define BRW_FALLBACK_TEXTURE 0x1 + #define BRW_MAX_CURBE (32*16) struct brw_context; -- cgit v1.2.3 From f9bbbe5803a72eceb8ed6ddc73bb48c8bcdc0179 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Oct 2009 16:32:08 -0600 Subject: i965: remove unused brw_context::tmp_fallback field --- src/mesa/drivers/dri/i965/brw_context.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index b7d6c7ce7e..da0e091bfd 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -454,7 +454,6 @@ struct brw_context GLuint primitive; GLboolean emit_state_always; - GLboolean tmp_fallback; GLboolean no_batch_wrap; struct { -- cgit v1.2.3 From ea659f891740fab1943eca219ffbdd5ed3d1906c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Oct 2009 16:33:36 -0600 Subject: intel: Fallback field is a bitmask, use GLbitfield --- src/mesa/drivers/dri/i915/intel_tris.c | 8 ++++++-- src/mesa/drivers/dri/intel/intel_context.c | 2 +- src/mesa/drivers/dri/intel/intel_context.h | 9 +++++++-- 3 files changed, 14 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/intel_tris.c b/src/mesa/drivers/dri/i915/intel_tris.c index a905455342..bc6b29281a 100644 --- a/src/mesa/drivers/dri/i915/intel_tris.c +++ b/src/mesa/drivers/dri/i915/intel_tris.c @@ -1194,12 +1194,16 @@ getFallbackString(GLuint bit) +/** + * Enable/disable a fallback flag. + * \param bit one of INTEL_FALLBACK_x flags. + */ void -intelFallback(struct intel_context *intel, GLuint bit, GLboolean mode) +intelFallback(struct intel_context *intel, GLbitfield bit, GLboolean mode) { GLcontext *ctx = &intel->ctx; TNLcontext *tnl = TNL_CONTEXT(ctx); - GLuint oldfallback = intel->Fallback; + const GLbitfield oldfallback = intel->Fallback; if (mode) { intel->Fallback |= bit; diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index c49f06e44a..d24af46f59 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -839,7 +839,7 @@ intelDestroyContext(__DRIcontextPrivate * driContextPriv) _vbo_DestroyContext(&intel->ctx); _swrast_DestroyContext(&intel->ctx); - intel->Fallback = 0; /* don't call _swrast_Flush later */ + intel->Fallback = 0x0; /* don't call _swrast_Flush later */ intel_batchbuffer_free(intel->batch); intel->batch = NULL; diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index 03e7cf39d6..a9db8f6a2b 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -61,6 +61,10 @@ typedef void (*intel_line_func) (struct intel_context *, intelVertex *, intelVertex *); typedef void (*intel_point_func) (struct intel_context *, intelVertex *); +/** + * Bits for intel->Fallback field + */ +/*@{*/ #define INTEL_FALLBACK_DRAW_BUFFER 0x1 #define INTEL_FALLBACK_READ_BUFFER 0x2 #define INTEL_FALLBACK_DEPTH_BUFFER 0x4 @@ -68,8 +72,9 @@ typedef void (*intel_point_func) (struct intel_context *, intelVertex *); #define INTEL_FALLBACK_USER 0x10 #define INTEL_FALLBACK_RENDERMODE 0x20 #define INTEL_FALLBACK_TEXTURE 0x40 +/*@}*/ -extern void intelFallback(struct intel_context *intel, GLuint bit, +extern void intelFallback(struct intel_context *intel, GLbitfield bit, GLboolean mode); #define FALLBACK( intel, bit, mode ) intelFallback( intel, bit, mode ) @@ -171,7 +176,7 @@ struct intel_context struct dri_metaops meta; GLint refcount; - GLuint Fallback; + GLbitfield Fallback; /**< mask of INTEL_FALLBACK_x bits */ GLuint NewGLState; dri_bufmgr *bufmgr; -- cgit v1.2.3 From c24466c34e7aeb8aeda2455f6a688b99c44b10e2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Oct 2009 16:45:03 -0600 Subject: intel: define INTEL_FALLBACK_DRIVER for drivers --- src/mesa/drivers/dri/intel/intel_context.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index a9db8f6a2b..d3acf6e4b3 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -72,6 +72,7 @@ typedef void (*intel_point_func) (struct intel_context *, intelVertex *); #define INTEL_FALLBACK_USER 0x10 #define INTEL_FALLBACK_RENDERMODE 0x20 #define INTEL_FALLBACK_TEXTURE 0x40 +#define INTEL_FALLBACK_DRIVER 0x1000 /**< first for drivers */ /*@}*/ extern void intelFallback(struct intel_context *intel, GLbitfield bit, -- cgit v1.2.3 From 8810b8f67135185d1044746bb861fe2ff997626c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Oct 2009 16:45:50 -0600 Subject: i965: fix hacked Fallback usage in brw_prepare_vertices() Setting intel->Fallback = 1 clobbered any fallback state that was already set. Not sure where this hack originated (the git history is a little convoluted). Define and use a new BRW_FALLBACK_DRAW bit instead. This shouldn't break anything and could potentially fix some bugs (but no specific ones are known). --- src/mesa/drivers/dri/i965/brw_context.h | 2 ++ src/mesa/drivers/dri/i965/brw_draw_upload.c | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index da0e091bfd..b1e7ec8465 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -116,6 +116,8 @@ */ +#define BRW_FALLBACK_DRAW (INTEL_FALLBACK_DRIVER << 0) + #define BRW_MAX_CURBE (32*16) struct brw_context; diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index 9d089e113e..4f8ceb37bd 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -375,9 +375,10 @@ static void brw_prepare_vertices(struct brw_context *brw) * isn't an issue at this point. */ if (brw->vb.nr_enabled >= BRW_VEP_MAX) { - intel->Fallback = 1; + FALLBACK(intel, BRW_FALLBACK_DRAW, GL_TRUE); return; } + FALLBACK(intel, BRW_FALLBACK_DRAW, GL_FALSE); for (i = 0; i < brw->vb.nr_enabled; i++) { struct brw_vertex_element *input = brw->vb.enabled[i]; @@ -427,9 +428,10 @@ static void brw_prepare_vertices(struct brw_context *brw) /* Position array not properly enabled: */ if (input->glarray->StrideB == 0) { - intel->Fallback = 1; + FALLBACK(intel, BRW_FALLBACK_DRAW, GL_TRUE); return; } + FALLBACK(intel, BRW_FALLBACK_DRAW, GL_FALSE); interleave = input->glarray->StrideB; ptr = input->glarray->Ptr; -- cgit v1.2.3 From 4837e01bcd3d011a38d75cc9f1eff629c3de6fd6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Oct 2009 18:16:10 -0600 Subject: mesa: code refactoring- new _mesa_finish(), _mesa_flush() --- src/mesa/main/context.c | 37 +++++++++++++++++++++++++++++-------- src/mesa/main/context.h | 8 ++++++++ 2 files changed, 37 insertions(+), 8 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index ac6540f4a0..e844a7432d 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1543,6 +1543,33 @@ _mesa_record_error(GLcontext *ctx, GLenum error) } +/** + * Flush commands and wait for completion. + */ +void +_mesa_finish(GLcontext *ctx) +{ + FLUSH_CURRENT( ctx, 0 ); + if (ctx->Driver.Finish) { + ctx->Driver.Finish(ctx); + } +} + + +/** + * Flush commands. + */ +void +_mesa_flush(GLcontext *ctx) +{ + FLUSH_CURRENT( ctx, 0 ); + if (ctx->Driver.Flush) { + ctx->Driver.Flush(ctx); + } +} + + + /** * Execute glFinish(). * @@ -1554,10 +1581,7 @@ _mesa_Finish(void) { GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - FLUSH_CURRENT( ctx, 0 ); - if (ctx->Driver.Finish) { - ctx->Driver.Finish(ctx); - } + _mesa_finish(ctx); } @@ -1572,10 +1596,7 @@ _mesa_Flush(void) { GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - FLUSH_CURRENT( ctx, 0 ); - if (ctx->Driver.Flush) { - ctx->Driver.Flush(ctx); - } + _mesa_flush(ctx); } diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h index 5587695fa0..c3be1063f8 100644 --- a/src/mesa/main/context.h +++ b/src/mesa/main/context.h @@ -170,6 +170,14 @@ _mesa_valid_to_render(GLcontext *ctx, const char *where); extern void _mesa_record_error( GLcontext *ctx, GLenum error ); + +extern void +_mesa_finish(GLcontext *ctx); + +extern void +_mesa_flush(GLcontext *ctx); + + extern void GLAPIENTRY _mesa_Finish( void ); -- cgit v1.2.3 From 55058652b886b95bfc24109a9edb04d274c01c1a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Oct 2009 18:32:48 -0600 Subject: intel: flush old context before binding new context Per the GLX spec, when changing rendering contexts, the old context should first be flushed. --- src/mesa/drivers/dri/intel/intel_context.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index d24af46f59..ddb0550f77 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -944,10 +944,23 @@ intelMakeCurrent(__DRIcontextPrivate * driContextPriv, __DRIdrawablePrivate * driReadPriv) { __DRIscreenPrivate *psp = driDrawPriv->driScreenPriv; + struct intel_context *intel; + GET_CURRENT_CONTEXT(curCtx); + + if (driContextPriv) + intel = (struct intel_context *) driContextPriv->driverPrivate; + else + intel = NULL; + + /* According to the glXMakeCurrent() man page: "Pending commands to + * the previous context, if any, are flushed before it is released." + * But only flush if we're actually changing contexts. + */ + if (intel_context(curCtx) && intel_context(curCtx) != intel) { + _mesa_flush(curCtx); + } if (driContextPriv) { - struct intel_context *intel = - (struct intel_context *) driContextPriv->driverPrivate; struct intel_framebuffer *intel_fb = (struct intel_framebuffer *) driDrawPriv->driverPrivate; GLframebuffer *readFb = (GLframebuffer *) driReadPriv->driverPrivate; -- cgit v1.2.3 From 488e67bab267dd687dbe83e52974ad4519906fcc Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Oct 2009 09:37:22 -0600 Subject: mesa: added _mesa_dump_texture() --- src/mesa/main/debug.c | 28 +++++++++++++++++++++++++--- src/mesa/main/debug.h | 3 +++ 2 files changed, 28 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 8b1707bab3..0e35617575 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -346,12 +346,10 @@ static GLboolean DumpImages; static void -dump_texture_cb(GLuint id, void *data, void *userData) +dump_texture(struct gl_texture_object *texObj) { - struct gl_texture_object *texObj = (struct gl_texture_object *) data; int i; GLboolean written = GL_FALSE; - (void) userData; _mesa_printf("Texture %u\n", texObj->Name); _mesa_printf(" Target 0x%x\n", texObj->Target); @@ -371,6 +369,30 @@ dump_texture_cb(GLuint id, void *data, void *userData) } +/** + * Dump a single texture. + */ +void +_mesa_dump_texture(GLuint texture, GLboolean dumpImages) +{ + GET_CURRENT_CONTEXT(ctx); + struct gl_texture_object *texObj = _mesa_lookup_texture(ctx, texture); + if (texObj) { + DumpImages = dumpImages; + dump_texture(texObj); + } +} + + +static void +dump_texture_cb(GLuint id, void *data, void *userData) +{ + struct gl_texture_object *texObj = (struct gl_texture_object *) data; + (void) userData; + dump_texture(texObj); +} + + /** * Print basic info about all texture objext to stdout. * If dumpImages is true, write PPM of level[0] image to a file. diff --git a/src/mesa/main/debug.h b/src/mesa/main/debug.h index 2a7de9c6b6..f66f774a45 100644 --- a/src/mesa/main/debug.h +++ b/src/mesa/main/debug.h @@ -57,6 +57,9 @@ extern void _mesa_init_debug( GLcontext *ctx ); #endif +extern void +_mesa_dump_texture(GLuint texture, GLboolean dumpImages); + extern void _mesa_dump_textures(GLboolean dumpImages); -- cgit v1.2.3 From fdce832437537f8e89f7ea57d15e73a481bd240e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Oct 2009 09:37:56 -0600 Subject: mesa: fix up vbo comments --- src/mesa/vbo/vbo_exec_api.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index bfa6d76886..f88df5aac7 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -57,7 +57,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. static void reset_attrfv( struct vbo_exec_context *exec ); -/* Close off the last primitive, execute the buffer, restart the +/** + * Close off the last primitive, execute the buffer, restart the * primitive. */ static void vbo_exec_wrap_buffers( struct vbo_exec_context *exec ) @@ -106,7 +107,8 @@ static void vbo_exec_wrap_buffers( struct vbo_exec_context *exec ) } -/* Deal with buffer wrapping where provoked by the vertex buffer +/** + * Deal with buffer wrapping where provoked by the vertex buffer * filling up, as opposed to upgrade_vertex(). */ void vbo_exec_vtx_wrap( struct vbo_exec_context *exec ) @@ -135,7 +137,7 @@ void vbo_exec_vtx_wrap( struct vbo_exec_context *exec ) } -/* +/** * Copy the active vertex's values to the ctx->Current fields. */ static void vbo_exec_copy_to_current( struct vbo_exec_context *exec ) @@ -208,7 +210,8 @@ static void vbo_exec_copy_from_current( struct vbo_exec_context *exec ) } -/* Flush existing data, set new attrib size, replay copied vertices. +/** + * Flush existing data, set new attrib size, replay copied vertices. */ static void vbo_exec_wrap_upgrade_vertex( struct vbo_exec_context *exec, GLuint attr, @@ -392,8 +395,7 @@ do { \ #if FEATURE_evaluators -/* Eval - */ + static void GLAPIENTRY vbo_exec_EvalCoord1f( GLfloat u ) { GET_CURRENT_CONTEXT( ctx ); @@ -492,8 +494,8 @@ static void GLAPIENTRY vbo_exec_EvalPoint2( GLint i, GLint j ) #endif /* FEATURE_evaluators */ -/* Build a list of primitives on the fly. Keep - * ctx->Driver.CurrentExecPrimitive uptodate as well. +/** + * Called via glBegin. */ static void GLAPIENTRY vbo_exec_Begin( GLenum mode ) { @@ -537,6 +539,10 @@ static void GLAPIENTRY vbo_exec_Begin( GLenum mode ) } + +/** + * Called via glEnd. + */ static void GLAPIENTRY vbo_exec_End( void ) { GET_CURRENT_CONTEXT( ctx ); -- cgit v1.2.3 From cf0e25d4c89b62f37ff8d1f11c50efcab6557c7f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Oct 2009 19:20:38 -0600 Subject: radeon: simplify radeon_create_renderbuffer() --- src/mesa/drivers/dri/radeon/radeon_common.h | 2 +- src/mesa/drivers/dri/radeon/radeon_fbo.c | 35 +++++++++++++---------------- src/mesa/drivers/dri/radeon/radeon_screen.c | 19 +++++++++------- 3 files changed, 27 insertions(+), 29 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_common.h b/src/mesa/drivers/dri/radeon/radeon_common.h index f3201911ac..def0cc17a9 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common.h +++ b/src/mesa/drivers/dri/radeon/radeon_common.h @@ -43,7 +43,7 @@ void radeon_renderbuffer_set_bo(struct radeon_renderbuffer *rb, struct radeon_bo *bo); struct radeon_renderbuffer * -radeon_create_renderbuffer(GLenum format, __DRIdrawablePrivate *driDrawPriv); +radeon_create_renderbuffer(gl_format format, __DRIdrawablePrivate *driDrawPriv); static inline struct radeon_renderbuffer *radeon_renderbuffer(struct gl_renderbuffer *rb) { struct radeon_renderbuffer *rrb = (struct radeon_renderbuffer *)rb; diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index 096ded23fb..40846828c5 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -240,8 +240,13 @@ radeon_nop_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb, return GL_FALSE; } + +/** + * Create a renderbuffer for a window's color, depth and/or stencil buffer. + * Not used for user-created renderbuffers. + */ struct radeon_renderbuffer * -radeon_create_renderbuffer(GLenum format, __DRIdrawablePrivate *driDrawPriv) +radeon_create_renderbuffer(gl_format format, __DRIdrawablePrivate *driDrawPriv) { struct radeon_renderbuffer *rrb; @@ -252,40 +257,30 @@ radeon_create_renderbuffer(GLenum format, __DRIdrawablePrivate *driDrawPriv) _mesa_init_renderbuffer(&rrb->base, 0); rrb->base.ClassID = RADEON_RB_CLASS; - /* XXX format junk */ + rrb->base.Format = format; + switch (format) { - case GL_RGB5: - rrb->base.Format = MESA_FORMAT_RGB565; + case MESA_FORMAT_RGB565: rrb->base.DataType = GL_UNSIGNED_BYTE; rrb->base._BaseFormat = GL_RGB; break; - case GL_RGB8: - rrb->base.Format = MESA_FORMAT_ARGB8888; + case MESA_FORMAT_XRGB8888: rrb->base.DataType = GL_UNSIGNED_BYTE; rrb->base._BaseFormat = GL_RGB; break; - case GL_RGBA8: - rrb->base.Format = MESA_FORMAT_ARGB8888; + case MESA_FORMAT_ARGB8888: rrb->base.DataType = GL_UNSIGNED_BYTE; rrb->base._BaseFormat = GL_RGBA; break; - case GL_STENCIL_INDEX8_EXT: - rrb->base.Format = MESA_FORMAT_S8; + case MESA_FORMAT_S8: rrb->base.DataType = GL_UNSIGNED_BYTE; rrb->base._BaseFormat = GL_STENCIL_INDEX; break; - case GL_DEPTH_COMPONENT16: - rrb->base.Format = MESA_FORMAT_Z16; + case MESA_FORMAT_Z16: rrb->base.DataType = GL_UNSIGNED_SHORT; rrb->base._BaseFormat = GL_DEPTH_COMPONENT; break; - case GL_DEPTH_COMPONENT24: - rrb->base.Format = MESA_FORMAT_S8_Z24; - rrb->base.DataType = GL_UNSIGNED_INT_24_8_EXT; - rrb->base._BaseFormat = GL_DEPTH_STENCIL; - break; - case GL_DEPTH24_STENCIL8_EXT: - rrb->base.Format = MESA_FORMAT_S8_Z24; + case MESA_FORMAT_S8_Z24: rrb->base.DataType = GL_UNSIGNED_INT_24_8_EXT; rrb->base._BaseFormat = GL_DEPTH_STENCIL; break; @@ -296,7 +291,7 @@ radeon_create_renderbuffer(GLenum format, __DRIdrawablePrivate *driDrawPriv) } rrb->dPriv = driDrawPriv; - rrb->base.InternalFormat = format; + rrb->base.InternalFormat = _mesa_get_format_base_format(format); rrb->base.Delete = radeon_delete_renderbuffer; rrb->base.AllocStorage = radeon_alloc_window_storage; diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 573eb6c9c1..4a2313f99e 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -1480,7 +1480,7 @@ radeonCreateBuffer( __DRIscreenPrivate *driScrnPriv, const GLboolean swAccum = mesaVis->accumRedBits > 0; const GLboolean swStencil = mesaVis->stencilBits > 0 && mesaVis->depthBits != 24; - GLenum rgbFormat; + gl_format rgbFormat; struct radeon_framebuffer *rfb; if (isPixmap) @@ -1493,11 +1493,11 @@ radeonCreateBuffer( __DRIscreenPrivate *driScrnPriv, _mesa_initialize_framebuffer(&rfb->base, mesaVis); if (mesaVis->redBits == 5) - rgbFormat = GL_RGB5; + rgbFormat = MESA_FORMAT_RGB565; else if (mesaVis->alphaBits == 0) - rgbFormat = GL_RGB8; + rgbFormat = MESA_FORMAT_XRGB8888; else - rgbFormat = GL_RGBA8; + rgbFormat = MESA_FORMAT_ARGB8888; /* front color renderbuffer */ rfb->color_rb[0] = radeon_create_renderbuffer(rgbFormat, driDrawPriv); @@ -1513,19 +1513,22 @@ radeonCreateBuffer( __DRIscreenPrivate *driScrnPriv, if (mesaVis->depthBits == 24) { if (mesaVis->stencilBits == 8) { - struct radeon_renderbuffer *depthStencilRb = radeon_create_renderbuffer(GL_DEPTH24_STENCIL8_EXT, driDrawPriv); + struct radeon_renderbuffer *depthStencilRb = + radeon_create_renderbuffer(MESA_FORMAT_S8_Z24, driDrawPriv); _mesa_add_renderbuffer(&rfb->base, BUFFER_DEPTH, &depthStencilRb->base); _mesa_add_renderbuffer(&rfb->base, BUFFER_STENCIL, &depthStencilRb->base); depthStencilRb->has_surface = screen->depthHasSurface; } else { /* depth renderbuffer */ - struct radeon_renderbuffer *depth = radeon_create_renderbuffer(GL_DEPTH_COMPONENT24, driDrawPriv); + struct radeon_renderbuffer *depth = + radeon_create_renderbuffer(MESA_FORMAT_X8_Z24, driDrawPriv); _mesa_add_renderbuffer(&rfb->base, BUFFER_DEPTH, &depth->base); depth->has_surface = screen->depthHasSurface; } } else if (mesaVis->depthBits == 16) { - /* just 16-bit depth buffer, no hw stencil */ - struct radeon_renderbuffer *depth = radeon_create_renderbuffer(GL_DEPTH_COMPONENT16, driDrawPriv); + /* just 16-bit depth buffer, no hw stencil */ + struct radeon_renderbuffer *depth = + radeon_create_renderbuffer(MESA_FORMAT_Z16, driDrawPriv); _mesa_add_renderbuffer(&rfb->base, BUFFER_DEPTH, &depth->base); depth->has_surface = screen->depthHasSurface; } -- cgit v1.2.3 From 1160acbfea986a821761d18f5f14d5d2cb0dea8c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 22 Oct 2009 19:49:21 -0600 Subject: dri/drivers: update driNewRenderbuffer() to take a gl_format Now pass a specific MESA_FORMAT_x token to indicate the renderbuffer's format. This is better than passing a GLenum and having to guess the specific format. I'm unable to test all the drivers, but any issues should be easy to fix. --- src/mesa/drivers/dri/common/drirenderbuffer.c | 61 +++++++++++++------------- src/mesa/drivers/dri/common/drirenderbuffer.h | 3 +- src/mesa/drivers/dri/fb/fb_dri.c | 4 +- src/mesa/drivers/dri/fb/fb_egl.c | 4 +- src/mesa/drivers/dri/ffb/ffb_xmesa.c | 8 ++-- src/mesa/drivers/dri/i810/i810screen.c | 6 +-- src/mesa/drivers/dri/mach64/mach64_screen.c | 8 ++-- src/mesa/drivers/dri/mach64/mach64_span.c | 14 +++--- src/mesa/drivers/dri/mga/mga_xmesa.c | 14 +++--- src/mesa/drivers/dri/mga/mgaspan.c | 20 ++++----- src/mesa/drivers/dri/r128/r128_screen.c | 10 ++--- src/mesa/drivers/dri/r128/r128_span.c | 18 ++++---- src/mesa/drivers/dri/s3v/s3v_xmesa.c | 10 ++--- src/mesa/drivers/dri/savage/savage_xmesa.c | 10 ++--- src/mesa/drivers/dri/savage/savagespan.c | 18 ++++---- src/mesa/drivers/dri/sis/sis_span.c | 20 ++++----- src/mesa/drivers/dri/tdfx/tdfx_screen.c | 10 ++--- src/mesa/drivers/dri/trident/trident_context.c | 10 ++--- src/mesa/drivers/dri/unichrome/via_screen.c | 12 ++--- src/mesa/drivers/dri/unichrome/via_span.c | 21 +++++---- 20 files changed, 136 insertions(+), 145 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/common/drirenderbuffer.c b/src/mesa/drivers/dri/common/drirenderbuffer.c index 6fa1c6caa0..4e7e92c82b 100644 --- a/src/mesa/drivers/dri/common/drirenderbuffer.c +++ b/src/mesa/drivers/dri/common/drirenderbuffer.c @@ -54,7 +54,7 @@ driDeleteRenderbuffer(struct gl_renderbuffer *rb) * \param pitch pixels per row */ driRenderbuffer * -driNewRenderbuffer(GLenum format, GLvoid *addr, +driNewRenderbuffer(gl_format format, GLvoid *addr, GLint cpp, GLint offset, GLint pitch, __DRIdrawablePrivate *dPriv) { @@ -80,46 +80,47 @@ driNewRenderbuffer(GLenum format, GLvoid *addr, /* Make sure we're using a null-valued GetPointer routine */ assert(drb->Base.GetPointer(NULL, &drb->Base, 0, 0) == NULL); - drb->Base.InternalFormat = format; - - if (format == GL_RGBA || format == GL_RGB5 || format == GL_RGBA8) { - /* Color */ - drb->Base.DataType = GL_UNSIGNED_BYTE; - if (format == GL_RGB5) { - drb->Base.Format = MESA_FORMAT_RGB565; + switch (format) { + case MESA_FORMAT_ARGB8888: + if (cpp == 2) { + /* override format */ + format = MESA_FORMAT_RGB565; } - else { - drb->Base.Format = MESA_FORMAT_ARGB8888; - } - } - else if (format == GL_DEPTH_COMPONENT16) { - /* Depth */ - /* we always Get/Put 32-bit Z values */ - drb->Base.DataType = GL_UNSIGNED_INT; - drb->Base.Format = MESA_FORMAT_Z16; - } - else if (format == GL_DEPTH_COMPONENT24) { + drb->Base.DataType = GL_UNSIGNED_BYTE; + break; + case MESA_FORMAT_Z16: /* Depth */ /* we always Get/Put 32-bit Z values */ drb->Base.DataType = GL_UNSIGNED_INT; - drb->Base.Format = MESA_FORMAT_Z32; - } - else if (format == GL_DEPTH_COMPONENT32) { + assert(cpp == 2); + break; + case MESA_FORMAT_Z32: /* Depth */ /* we always Get/Put 32-bit Z values */ drb->Base.DataType = GL_UNSIGNED_INT; - drb->Base.Format = MESA_FORMAT_Z32; - } - else { + assert(cpp == 4); + break; + case MESA_FORMAT_Z24_S8: + drb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT; + assert(cpp == 4); + break; + case MESA_FORMAT_S8_Z24: + drb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT; + assert(cpp == 4); + break; + case MESA_FORMAT_S8: /* Stencil */ - ASSERT(format == GL_STENCIL_INDEX8_EXT); drb->Base.DataType = GL_UNSIGNED_BYTE; - drb->Base.Format = MESA_FORMAT_S8; + break; + default: + _mesa_problem(NULL, "Bad format 0x%x in driNewRenderbuffer", format); + return NULL; } - /* XXX if we were allocating a user-created renderbuffer, we'd have - * to fill in the Red/Green/Blue/.../Bits values too. - */ + drb->Base.Format = format; + + drb->Base.InternalFormat = + drb->Base._BaseFormat = _mesa_get_format_base_format(format); drb->Base.AllocStorage = driRenderbufferStorage; drb->Base.Delete = driDeleteRenderbuffer; diff --git a/src/mesa/drivers/dri/common/drirenderbuffer.h b/src/mesa/drivers/dri/common/drirenderbuffer.h index cf55286b30..9712c0017b 100644 --- a/src/mesa/drivers/dri/common/drirenderbuffer.h +++ b/src/mesa/drivers/dri/common/drirenderbuffer.h @@ -11,6 +11,7 @@ #define DRIRENDERBUFFER_H #include "main/mtypes.h" +#include "main/formats.h" #include "dri_util.h" @@ -63,7 +64,7 @@ typedef struct { extern driRenderbuffer * -driNewRenderbuffer(GLenum format, GLvoid *addr, +driNewRenderbuffer(gl_format format, GLvoid *addr, GLint cpp, GLint offset, GLint pitch, __DRIdrawablePrivate *dPriv); diff --git a/src/mesa/drivers/dri/fb/fb_dri.c b/src/mesa/drivers/dri/fb/fb_dri.c index 571b8922d5..fd869b2fe7 100644 --- a/src/mesa/drivers/dri/fb/fb_dri.c +++ b/src/mesa/drivers/dri/fb/fb_dri.c @@ -437,7 +437,7 @@ fbCreateBuffer( __DRIscreenPrivate *driScrnPriv, /* XXX double-check these parameters (bpp vs cpp, etc) */ { - driRenderbuffer *drb = driNewRenderbuffer(GL_RGBA, + driRenderbuffer *drb = driNewRenderbuffer(MESA_FORMAT_ARGB8888, driScrnPriv->pFB, driScrnPriv->fbBPP / 8, driScrnPriv->fbOrigin, @@ -451,7 +451,7 @@ fbCreateBuffer( __DRIscreenPrivate *driScrnPriv, /* XXX what are the correct origin/stride values? */ GLvoid *backBuf = _mesa_malloc(driScrnPriv->fbStride * driScrnPriv->fbHeight); - driRenderbuffer *drb = driNewRenderbuffer(GL_RGBA, + driRenderbuffer *drb = driNewRenderbuffer(MESA_FORMAT_ARGB8888, backBuf, driScrnPriv->fbBPP /8, driScrnPriv->fbOrigin, diff --git a/src/mesa/drivers/dri/fb/fb_egl.c b/src/mesa/drivers/dri/fb/fb_egl.c index 4e41860d8c..eb7adf8224 100644 --- a/src/mesa/drivers/dri/fb/fb_egl.c +++ b/src/mesa/drivers/dri/fb/fb_egl.c @@ -692,7 +692,7 @@ fbCreateScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLConfig cfg, /* front color renderbuffer */ { - driRenderbuffer *drb = driNewRenderbuffer(GL_RGBA, display->pFB, + driRenderbuffer *drb = driNewRenderbuffer(MESA_FORMAT_ARGB8888, display->pFB, bytesPerPixel, origin, stride, NULL); fbSetSpanFunctions(drb, &vis); @@ -703,7 +703,7 @@ fbCreateScreenSurfaceMESA(_EGLDriver *drv, EGLDisplay dpy, EGLConfig cfg, /* back color renderbuffer */ if (vis.doubleBufferMode) { GLubyte *backBuf = _mesa_malloc(stride * height); - driRenderbuffer *drb = driNewRenderbuffer(GL_RGBA, backBuf, + driRenderbuffer *drb = driNewRenderbuffer(MESA_FORMAT_ARGB8888, backBuf, bytesPerPixel, origin, stride, NULL); fbSetSpanFunctions(drb, &vis); diff --git a/src/mesa/drivers/dri/ffb/ffb_xmesa.c b/src/mesa/drivers/dri/ffb/ffb_xmesa.c index 3b9f5c6759..09cc26d09e 100644 --- a/src/mesa/drivers/dri/ffb/ffb_xmesa.c +++ b/src/mesa/drivers/dri/ffb/ffb_xmesa.c @@ -347,7 +347,7 @@ ffbCreateBuffer(__DRIscreenPrivate *driScrnPriv, { driRenderbuffer *frontRb - = driNewRenderbuffer(GL_RGBA, NULL, bpp, offset, bogusPitch, + = driNewRenderbuffer(MESA_FORMAT_ARGB8888, NULL, bpp, offset, bogusPitch, driDrawPriv); ffbSetSpanFunctions(frontRb, mesaVis); _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base); @@ -355,7 +355,7 @@ ffbCreateBuffer(__DRIscreenPrivate *driScrnPriv, if (mesaVis->doubleBufferMode) { driRenderbuffer *backRb - = driNewRenderbuffer(GL_RGBA, NULL, bpp, offset, bogusPitch, + = driNewRenderbuffer(MESA_FORMAT_ARGB8888, NULL, bpp, offset, bogusPitch, driDrawPriv); ffbSetSpanFunctions(backRb, mesaVis); _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base); @@ -363,7 +363,7 @@ ffbCreateBuffer(__DRIscreenPrivate *driScrnPriv, if (mesaVis->depthBits == 16) { driRenderbuffer *depthRb - = driNewRenderbuffer(GL_DEPTH_COMPONENT16, NULL, bpp, offset, + = driNewRenderbuffer(MESA_FORMAT_Z16, NULL, bpp, offset, bogusPitch, driDrawPriv); ffbSetDepthFunctions(depthRb, mesaVis); _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); @@ -371,7 +371,7 @@ ffbCreateBuffer(__DRIscreenPrivate *driScrnPriv, if (mesaVis->stencilBits > 0 && !swStencil) { driRenderbuffer *stencilRb - = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, NULL, bpp, offset, + = driNewRenderbuffer(MESA_FORMAT_S8, NULL, bpp, offset, bogusPitch, driDrawPriv); ffbSetStencilFunctions(stencilRb, mesaVis); _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base); diff --git a/src/mesa/drivers/dri/i810/i810screen.c b/src/mesa/drivers/dri/i810/i810screen.c index 6e49f3466c..b0256abbfb 100644 --- a/src/mesa/drivers/dri/i810/i810screen.c +++ b/src/mesa/drivers/dri/i810/i810screen.c @@ -293,7 +293,7 @@ i810CreateBuffer( __DRIscreenPrivate *driScrnPriv, { driRenderbuffer *frontRb - = driNewRenderbuffer(GL_RGBA, + = driNewRenderbuffer(MESA_FORMAT_ARGB8888, driScrnPriv->pFB, screen->cpp, /*screen->frontOffset*/0, screen->backPitch, @@ -304,7 +304,7 @@ i810CreateBuffer( __DRIscreenPrivate *driScrnPriv, if (mesaVis->doubleBufferMode) { driRenderbuffer *backRb - = driNewRenderbuffer(GL_RGBA, + = driNewRenderbuffer(MESA_FORMAT_ARGB8888, screen->back.map, screen->cpp, screen->backOffset, screen->backPitch, @@ -315,7 +315,7 @@ i810CreateBuffer( __DRIscreenPrivate *driScrnPriv, if (mesaVis->depthBits == 16) { driRenderbuffer *depthRb - = driNewRenderbuffer(GL_DEPTH_COMPONENT16, + = driNewRenderbuffer(MESA_FORMAT_Z16, screen->depth.map, screen->cpp, screen->depthOffset, screen->backPitch, diff --git a/src/mesa/drivers/dri/mach64/mach64_screen.c b/src/mesa/drivers/dri/mach64/mach64_screen.c index 6440027ca4..a7222ec960 100644 --- a/src/mesa/drivers/dri/mach64/mach64_screen.c +++ b/src/mesa/drivers/dri/mach64/mach64_screen.c @@ -316,7 +316,7 @@ mach64CreateBuffer( __DRIscreenPrivate *driScrnPriv, { driRenderbuffer *frontRb - = driNewRenderbuffer(GL_RGBA, + = driNewRenderbuffer(MESA_FORMAT_ARGB8888, NULL, screen->cpp, screen->frontOffset, screen->frontPitch, @@ -327,7 +327,7 @@ mach64CreateBuffer( __DRIscreenPrivate *driScrnPriv, if (mesaVis->doubleBufferMode) { driRenderbuffer *backRb - = driNewRenderbuffer(GL_RGBA, + = driNewRenderbuffer(MESA_FORMAT_ARGB8888, NULL, screen->cpp, screen->backOffset, screen->backPitch, @@ -338,7 +338,7 @@ mach64CreateBuffer( __DRIscreenPrivate *driScrnPriv, if (mesaVis->depthBits == 16) { driRenderbuffer *depthRb - = driNewRenderbuffer(GL_DEPTH_COMPONENT16, + = driNewRenderbuffer(MESA_FORMAT_Z16, NULL, screen->cpp, screen->depthOffset, screen->depthPitch, driDrawPriv); @@ -348,7 +348,7 @@ mach64CreateBuffer( __DRIscreenPrivate *driScrnPriv, else if (mesaVis->depthBits == 24) { /* XXX I don't think 24-bit Z is supported - so this isn't used */ driRenderbuffer *depthRb - = driNewRenderbuffer(GL_DEPTH_COMPONENT24, + = driNewRenderbuffer(MESA_FORMAT_Z24_S8, NULL, screen->cpp, screen->depthOffset, screen->depthPitch, diff --git a/src/mesa/drivers/dri/mach64/mach64_span.c b/src/mesa/drivers/dri/mach64/mach64_span.c index 91d46ce32e..500319e0e3 100644 --- a/src/mesa/drivers/dri/mach64/mach64_span.c +++ b/src/mesa/drivers/dri/mach64/mach64_span.c @@ -157,15 +157,13 @@ void mach64DDInitSpanFuncs( GLcontext *ctx ) void mach64SetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis) { - if (drb->Base.InternalFormat == GL_RGBA) { - if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) { - mach64InitPointers_RGB565(&drb->Base); - } - else { - mach64InitPointers_ARGB8888(&drb->Base); - } + if (drb->Base.Format == MESA_FORMAT_RGB565) { + mach64InitPointers_RGB565(&drb->Base); } - else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) { + else if (drb->Base.Format == MESA_FORMAT_ARGB8888) { + mach64InitPointers_ARGB8888(&drb->Base); + } + else if (drb->Base.Format == MESA_FORMAT_Z16) { mach64InitDepthPointers_z16(&drb->Base); } } diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c index 0dc76fea50..4ca71ca505 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.c +++ b/src/mesa/drivers/dri/mga/mga_xmesa.c @@ -723,7 +723,7 @@ mgaCreateBuffer( __DRIscreenPrivate *driScrnPriv, { driRenderbuffer *frontRb - = driNewRenderbuffer(GL_RGBA, + = driNewRenderbuffer(MESA_FORMAT_ARGB8888, NULL, screen->cpp, screen->frontOffset, screen->frontPitch, @@ -734,7 +734,7 @@ mgaCreateBuffer( __DRIscreenPrivate *driScrnPriv, if (mesaVis->doubleBufferMode) { driRenderbuffer *backRb - = driNewRenderbuffer(GL_RGBA, + = driNewRenderbuffer(MESA_FORMAT_ARGB8888, NULL, screen->cpp, screen->backOffset, screen->backPitch, @@ -745,7 +745,7 @@ mgaCreateBuffer( __DRIscreenPrivate *driScrnPriv, if (mesaVis->depthBits == 16) { driRenderbuffer *depthRb - = driNewRenderbuffer(GL_DEPTH_COMPONENT16, + = driNewRenderbuffer(MESA_FORMAT_Z16, NULL, screen->cpp, screen->depthOffset, screen->depthPitch, @@ -757,7 +757,7 @@ mgaCreateBuffer( __DRIscreenPrivate *driScrnPriv, /* XXX is this right? */ if (mesaVis->stencilBits) { driRenderbuffer *depthRb - = driNewRenderbuffer(GL_DEPTH_COMPONENT24, + = driNewRenderbuffer(MESA_FORMAT_Z24_S8, NULL, screen->cpp, screen->depthOffset, screen->depthPitch, @@ -767,7 +767,7 @@ mgaCreateBuffer( __DRIscreenPrivate *driScrnPriv, } else { driRenderbuffer *depthRb - = driNewRenderbuffer(GL_DEPTH_COMPONENT32, + = driNewRenderbuffer(MESA_FORMAT_Z32, NULL, screen->cpp, screen->depthOffset, screen->depthPitch, @@ -778,7 +778,7 @@ mgaCreateBuffer( __DRIscreenPrivate *driScrnPriv, } else if (mesaVis->depthBits == 32) { driRenderbuffer *depthRb - = driNewRenderbuffer(GL_DEPTH_COMPONENT32, + = driNewRenderbuffer(MESA_FORMAT_Z32, NULL, screen->cpp, screen->depthOffset, screen->depthPitch, @@ -789,7 +789,7 @@ mgaCreateBuffer( __DRIscreenPrivate *driScrnPriv, if (mesaVis->stencilBits > 0 && !swStencil) { driRenderbuffer *stencilRb - = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, + = driNewRenderbuffer(MESA_FORMAT_S8, NULL, screen->cpp, screen->depthOffset, screen->depthPitch, diff --git a/src/mesa/drivers/dri/mga/mgaspan.c b/src/mesa/drivers/dri/mga/mgaspan.c index 5b6d323ca9..2ff1cac8e2 100644 --- a/src/mesa/drivers/dri/mga/mgaspan.c +++ b/src/mesa/drivers/dri/mga/mgaspan.c @@ -206,24 +206,22 @@ void mgaDDInitSpanFuncs( GLcontext *ctx ) void mgaSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis) { - if (drb->Base.InternalFormat == GL_RGBA) { - if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) { - mgaInitPointers_565(&drb->Base); - } - else { - mgaInitPointers_8888(&drb->Base); - } + if (drb->Base.Format == MESA_FORMAT_RGB565) { + mgaInitPointers_565(&drb->Base); } - else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) { + else if (drb->Base.Format == MESA_FORMAT_ARGB8888) { + mgaInitPointers_8888(&drb->Base); + } + else if (drb->Base.Format == MESA_FORMAT_Z16) { mgaInitDepthPointers_z16(&drb->Base); } - else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) { + else if (drb->Base.Format == MESA_FORMAT_Z24_S8) { mgaInitDepthPointers_z24_s8(&drb->Base); } - else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT32) { + else if (drb->Base.Format == MESA_FORMAT_Z32) { mgaInitDepthPointers_z32(&drb->Base); } - else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) { + else if (drb->Base.Format == MESA_FORMAT_S8) { mgaInitStencilPointers_z24_s8(&drb->Base); } } diff --git a/src/mesa/drivers/dri/r128/r128_screen.c b/src/mesa/drivers/dri/r128/r128_screen.c index f5bcc2f290..652dad51f2 100644 --- a/src/mesa/drivers/dri/r128/r128_screen.c +++ b/src/mesa/drivers/dri/r128/r128_screen.c @@ -284,7 +284,7 @@ r128CreateBuffer( __DRIscreenPrivate *driScrnPriv, { driRenderbuffer *frontRb - = driNewRenderbuffer(GL_RGBA, + = driNewRenderbuffer(MESA_FORMAT_ARGB8888, NULL, screen->cpp, screen->frontOffset, screen->frontPitch, @@ -295,7 +295,7 @@ r128CreateBuffer( __DRIscreenPrivate *driScrnPriv, if (mesaVis->doubleBufferMode) { driRenderbuffer *backRb - = driNewRenderbuffer(GL_RGBA, + = driNewRenderbuffer(MESA_FORMAT_ARGB8888, NULL, screen->cpp, screen->backOffset, screen->backPitch, @@ -306,7 +306,7 @@ r128CreateBuffer( __DRIscreenPrivate *driScrnPriv, if (mesaVis->depthBits == 16) { driRenderbuffer *depthRb - = driNewRenderbuffer(GL_DEPTH_COMPONENT16, + = driNewRenderbuffer(MESA_FORMAT_Z16, NULL, screen->cpp, screen->depthOffset, screen->depthPitch, @@ -316,7 +316,7 @@ r128CreateBuffer( __DRIscreenPrivate *driScrnPriv, } else if (mesaVis->depthBits == 24) { driRenderbuffer *depthRb - = driNewRenderbuffer(GL_DEPTH_COMPONENT24, + = driNewRenderbuffer(MESA_FORMAT_S8_Z24, NULL, screen->cpp, screen->depthOffset, screen->depthPitch, @@ -327,7 +327,7 @@ r128CreateBuffer( __DRIscreenPrivate *driScrnPriv, if (mesaVis->stencilBits > 0 && !swStencil) { driRenderbuffer *stencilRb - = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, + = driNewRenderbuffer(MESA_FORMAT_S8, NULL, screen->cpp, screen->depthOffset, screen->depthPitch, diff --git a/src/mesa/drivers/dri/r128/r128_span.c b/src/mesa/drivers/dri/r128/r128_span.c index dd177e0def..d238cc3c94 100644 --- a/src/mesa/drivers/dri/r128/r128_span.c +++ b/src/mesa/drivers/dri/r128/r128_span.c @@ -433,21 +433,19 @@ void r128DDInitSpanFuncs( GLcontext *ctx ) void r128SetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis) { - if (drb->Base.InternalFormat == GL_RGBA) { - if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) { - r128InitPointers_RGB565(&drb->Base); - } - else { - r128InitPointers_ARGB8888(&drb->Base); - } + if (drb->Base.Format == MESA_FORMAT_RGB565) { + r128InitPointers_RGB565(&drb->Base); } - else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) { + else if (drb->Base.Format == MESA_FORMAT_ARGB8888) { + r128InitPointers_ARGB8888(&drb->Base); + } + else if (drb->Base.Format == MESA_FORMAT_Z16) { r128InitDepthPointers_z16(&drb->Base); } - else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) { + else if (drb->Base.Format == MESA_FORMAT_S8_Z24) { r128InitDepthPointers_z24_s8(&drb->Base); } - else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) { + else if (drb->Base.Format == MESA_FORMAT_S8) { radeonInitStencilPointers_z24_s8(&drb->Base); } } diff --git a/src/mesa/drivers/dri/s3v/s3v_xmesa.c b/src/mesa/drivers/dri/s3v/s3v_xmesa.c index 85f1481769..f1e123d676 100644 --- a/src/mesa/drivers/dri/s3v/s3v_xmesa.c +++ b/src/mesa/drivers/dri/s3v/s3v_xmesa.c @@ -70,7 +70,7 @@ s3vCreateBuffer( __DRIscreenPrivate *driScrnPriv, { driRenderbuffer *frontRb - = driNewRenderbuffer(GL_RGBA, NULL, screen->cpp, + = driNewRenderbuffer(MESA_FORMAT_ARGB8888, NULL, screen->cpp, screen->frontOffset, screen->frontPitch, driDrawPriv); s3vSetSpanFunctions(frontRb, mesaVis); @@ -79,7 +79,7 @@ s3vCreateBuffer( __DRIscreenPrivate *driScrnPriv, if (mesaVis->doubleBufferMode) { driRenderbuffer *backRb - = driNewRenderbuffer(GL_RGBA, NULL, screen->cpp, + = driNewRenderbuffer(MESA_FORMAT_ARGB8888, NULL, screen->cpp, screen->backOffset, screen->backPitch, driDrawPriv); s3vSetSpanFunctions(backRb, mesaVis); @@ -89,7 +89,7 @@ s3vCreateBuffer( __DRIscreenPrivate *driScrnPriv, if (mesaVis->depthBits == 16) { driRenderbuffer *depthRb - = driNewRenderbuffer(GL_DEPTH_COMPONENT16, NULL, screen->cpp, + = driNewRenderbuffer(MESA_FORMAT_Z16, NULL, screen->cpp, screen->depthOffset, screen->depthPitch, driDrawPriv); s3vSetSpanFunctions(depthRb, mesaVis); @@ -97,7 +97,7 @@ s3vCreateBuffer( __DRIscreenPrivate *driScrnPriv, } else if (mesaVis->depthBits == 24) { driRenderbuffer *depthRb - = driNewRenderbuffer(GL_DEPTH_COMPONENT24, NULL, screen->cpp, + = driNewRenderbuffer(MESA_FORMAT_Z24_S8, NULL, screen->cpp, screen->depthOffset, screen->depthPitch, driDrawPriv); s3vSetSpanFunctions(depthRb, mesaVis); @@ -107,7 +107,7 @@ s3vCreateBuffer( __DRIscreenPrivate *driScrnPriv, /* no h/w stencil yet? if (mesaVis->stencilBits > 0) { driRenderbuffer *stencilRb - = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, NULL, + = driNewRenderbuffer(MESA_FORMAT_S8, NULL, screen->cpp, screen->depthOffset, screen->depthPitch, driDrawPriv); s3vSetSpanFunctions(stencilRb, mesaVis); diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c index 048fbe452c..9eea728319 100644 --- a/src/mesa/drivers/dri/savage/savage_xmesa.c +++ b/src/mesa/drivers/dri/savage/savage_xmesa.c @@ -602,7 +602,7 @@ savageCreateBuffer( __DRIscreenPrivate *driScrnPriv, { driRenderbuffer *frontRb - = driNewRenderbuffer(GL_RGBA, + = driNewRenderbuffer(MESA_FORMAT_ARGB8888, (GLubyte *) screen->aperture.map + 0x01000000 * TARGET_FRONT, screen->cpp, @@ -615,7 +615,7 @@ savageCreateBuffer( __DRIscreenPrivate *driScrnPriv, if (mesaVis->doubleBufferMode) { driRenderbuffer *backRb - = driNewRenderbuffer(GL_RGBA, + = driNewRenderbuffer(MESA_FORMAT_ARGB8888, (GLubyte *) screen->aperture.map + 0x01000000 * TARGET_BACK, screen->cpp, @@ -628,7 +628,7 @@ savageCreateBuffer( __DRIscreenPrivate *driScrnPriv, if (mesaVis->depthBits == 16) { driRenderbuffer *depthRb - = driNewRenderbuffer(GL_DEPTH_COMPONENT16, + = driNewRenderbuffer(MESA_FORMAT_Z16, (GLubyte *) screen->aperture.map + 0x01000000 * TARGET_DEPTH, screen->zpp, @@ -639,7 +639,7 @@ savageCreateBuffer( __DRIscreenPrivate *driScrnPriv, } else if (mesaVis->depthBits == 24) { driRenderbuffer *depthRb - = driNewRenderbuffer(GL_DEPTH_COMPONENT24, + = driNewRenderbuffer(MESA_FORMAT_S8_Z24, (GLubyte *) screen->aperture.map + 0x01000000 * TARGET_DEPTH, screen->zpp, @@ -651,7 +651,7 @@ savageCreateBuffer( __DRIscreenPrivate *driScrnPriv, if (mesaVis->stencilBits > 0 && !swStencil) { driRenderbuffer *stencilRb - = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, + = driNewRenderbuffer(MESA_FORMAT_S8, (GLubyte *) screen->aperture.map + 0x01000000 * TARGET_DEPTH, screen->zpp, diff --git a/src/mesa/drivers/dri/savage/savagespan.c b/src/mesa/drivers/dri/savage/savagespan.c index 9615e34013..3bb6fbcc63 100644 --- a/src/mesa/drivers/dri/savage/savagespan.c +++ b/src/mesa/drivers/dri/savage/savagespan.c @@ -255,15 +255,13 @@ void savageSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis, GLboolean float_depth) { - if (drb->Base.InternalFormat == GL_RGBA) { - if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) { - savageInitPointers_565(&drb->Base); - } - else { - savageInitPointers_8888(&drb->Base); - } + if (drb->Base.Format == MESA_FORMAT_RGB565) { + savageInitPointers_565(&drb->Base); + } + else if (drb->Base.Format == MESA_FORMAT_ARGB8888) { + savageInitPointers_8888(&drb->Base); } - else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT16) { + else if (drb->Base.Format == MESA_FORMAT_Z16) { if (float_depth) { savageInitDepthPointers_z16f(&drb->Base); } @@ -271,7 +269,7 @@ savageSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis, savageInitDepthPointers_z16(&drb->Base); } } - else if (drb->Base.InternalFormat == GL_DEPTH_COMPONENT24) { + else if (drb->Base.Format == MESA_FORMAT_S8_Z24) { if (float_depth) { savageInitDepthPointers_s8_z24f(&drb->Base); } @@ -279,7 +277,7 @@ savageSetSpanFunctions(driRenderbuffer *drb, const GLvisual *vis, savageInitDepthPointers_s8_z24(&drb->Base); } } - else if (drb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) { + else if (drb->Base.Format == MESA_FORMAT_S8) { savageInitStencilPointers_s8_z24(&drb->Base); } } diff --git a/src/mesa/drivers/dri/sis/sis_span.c b/src/mesa/drivers/dri/sis/sis_span.c index 9e9a509755..cfbb51007d 100644 --- a/src/mesa/drivers/dri/sis/sis_span.c +++ b/src/mesa/drivers/dri/sis/sis_span.c @@ -176,24 +176,22 @@ sisDDInitSpanFuncs( GLcontext *ctx ) void sisSetSpanFunctions(struct sis_renderbuffer *srb, const GLvisual *vis) { - if (srb->Base.InternalFormat == GL_RGBA) { - if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) { - sisInitPointers_RGB565( &srb->Base ); - } - else { - sisInitPointers_ARGB8888( &srb->Base ); - } + if (srb->Base.Format == MESA_FORMAT_RGB565) { + sisInitPointers_RGB565( &srb->Base ); } - else if (srb->Base.InternalFormat == GL_DEPTH_COMPONENT16) { + else if (srb->Base.Format == MESA_FORMAT_ARGB8888) { + sisInitPointers_ARGB8888( &srb->Base ); + } + else if (srb->Base.Format == MESA_FORMAT_Z16) { sisInitDepthPointers_z16(&srb->Base); } - else if (srb->Base.InternalFormat == GL_DEPTH_COMPONENT24) { + else if (srb->Base.Format == MESA_FORMAT_S8_Z24) { sisInitDepthPointers_z24_s8(&srb->Base); } - else if (srb->Base.InternalFormat == GL_DEPTH_COMPONENT32) { + else if (srb->Base.Format == MESA_FORMAT_Z32) { sisInitDepthPointers_z32(&srb->Base); } - else if (srb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) { + else if (srb->Base.Format == MESA_FORMAT_S8) { sisInitStencilPointers_z24_s8(&srb->Base); } } diff --git a/src/mesa/drivers/dri/tdfx/tdfx_screen.c b/src/mesa/drivers/dri/tdfx/tdfx_screen.c index 58bd48b294..c29694679d 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_screen.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_screen.c @@ -173,7 +173,7 @@ tdfxCreateBuffer( __DRIscreenPrivate *driScrnPriv, { driRenderbuffer *frontRb - = driNewRenderbuffer(GL_RGBA, NULL, screen->cpp, + = driNewRenderbuffer(MESA_FORMAT_ARGB8888, NULL, screen->cpp, screen->fbOffset, screen->width, driDrawPriv); tdfxSetSpanFunctions(frontRb, mesaVis); _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base); @@ -181,7 +181,7 @@ tdfxCreateBuffer( __DRIscreenPrivate *driScrnPriv, if (mesaVis->doubleBufferMode) { driRenderbuffer *backRb - = driNewRenderbuffer(GL_RGBA, NULL, screen->cpp, + = driNewRenderbuffer(MESA_FORMAT_ARGB8888, NULL, screen->cpp, screen->backOffset, screen->width, driDrawPriv); tdfxSetSpanFunctions(backRb, mesaVis); @@ -191,7 +191,7 @@ tdfxCreateBuffer( __DRIscreenPrivate *driScrnPriv, if (mesaVis->depthBits == 16) { driRenderbuffer *depthRb - = driNewRenderbuffer(GL_DEPTH_COMPONENT16, NULL, screen->cpp, + = driNewRenderbuffer(MESA_FORMAT_Z16, NULL, screen->cpp, screen->depthOffset, screen->width, driDrawPriv); tdfxSetSpanFunctions(depthRb, mesaVis); @@ -199,7 +199,7 @@ tdfxCreateBuffer( __DRIscreenPrivate *driScrnPriv, } else if (mesaVis->depthBits == 24) { driRenderbuffer *depthRb - = driNewRenderbuffer(GL_DEPTH_COMPONENT24, NULL, screen->cpp, + = driNewRenderbuffer(MESA_FORMAT_Z24_S8, NULL, screen->cpp, screen->depthOffset, screen->width, driDrawPriv); tdfxSetSpanFunctions(depthRb, mesaVis); @@ -208,7 +208,7 @@ tdfxCreateBuffer( __DRIscreenPrivate *driScrnPriv, if (mesaVis->stencilBits > 0) { driRenderbuffer *stencilRb - = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, NULL, screen->cpp, + = driNewRenderbuffer(MESA_FORMAT_S8, NULL, screen->cpp, screen->depthOffset, screen->width, driDrawPriv); tdfxSetSpanFunctions(stencilRb, mesaVis); diff --git a/src/mesa/drivers/dri/trident/trident_context.c b/src/mesa/drivers/dri/trident/trident_context.c index b5126b07ea..b693a95ece 100644 --- a/src/mesa/drivers/dri/trident/trident_context.c +++ b/src/mesa/drivers/dri/trident/trident_context.c @@ -215,7 +215,7 @@ tridentCreateBuffer( __DRIscreenPrivate *driScrnPriv, { driRenderbuffer *frontRb - = driNewRenderbuffer(GL_RGBA, NULL, screen->cpp, + = driNewRenderbuffer(MESA_FORMAT_ARGB8888, NULL, screen->cpp, screen->frontOffset, screen->frontPitch, driDrawPriv); /* @@ -226,7 +226,7 @@ tridentCreateBuffer( __DRIscreenPrivate *driScrnPriv, if (mesaVis->doubleBufferMode) { driRenderbuffer *backRb - = driNewRenderbuffer(GL_RGBA, NULL, screen->cpp, + = driNewRenderbuffer(MESA_FORMAT_ARGB8888, NULL, screen->cpp, screen->backOffset, screen->backPitch, driDrawPriv); /* @@ -237,7 +237,7 @@ tridentCreateBuffer( __DRIscreenPrivate *driScrnPriv, if (mesaVis->depthBits == 16) { driRenderbuffer *depthRb - = driNewRenderbuffer(GL_DEPTH_COMPONENT16, NULL, screen->cpp, + = driNewRenderbuffer(MESA_FORMAT_Z16, NULL, screen->cpp, screen->depthOffset, screen->depthPitch, driDrawPriv); /* @@ -247,7 +247,7 @@ tridentCreateBuffer( __DRIscreenPrivate *driScrnPriv, } else if (mesaVis->depthBits == 24) { driRenderbuffer *depthRb - = driNewRenderbuffer(GL_DEPTH_COMPONENT24, NULL, screen->cpp, + = driNewRenderbuffer(MESA_FORMAT_Z24_S8, NULL, screen->cpp, screen->depthOffset, screen->depthPitch, driDrawPriv); /* @@ -259,7 +259,7 @@ tridentCreateBuffer( __DRIscreenPrivate *driScrnPriv, /* no h/w stencil? if (mesaVis->stencilBits > 0 && !swStencil) { driRenderbuffer *stencilRb - = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT); + = driNewRenderbuffer(MESA_FORMAT_S8); tridentSetSpanFunctions(stencilRb, mesaVis); _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base); } diff --git a/src/mesa/drivers/dri/unichrome/via_screen.c b/src/mesa/drivers/dri/unichrome/via_screen.c index 3dbb570571..5b5477d8e0 100644 --- a/src/mesa/drivers/dri/unichrome/via_screen.c +++ b/src/mesa/drivers/dri/unichrome/via_screen.c @@ -248,7 +248,7 @@ viaCreateBuffer(__DRIscreenPrivate *driScrnPriv, /* XXX check/fix the offset/pitch parameters! */ { driRenderbuffer *frontRb - = driNewRenderbuffer(GL_RGBA, NULL, + = driNewRenderbuffer(MESA_FORMAT_ARGB8888, NULL, screen->bytesPerPixel, 0, screen->width, driDrawPriv); viaSetSpanFunctions(frontRb, mesaVis); @@ -257,7 +257,7 @@ viaCreateBuffer(__DRIscreenPrivate *driScrnPriv, if (mesaVis->doubleBufferMode) { driRenderbuffer *backRb - = driNewRenderbuffer(GL_RGBA, NULL, + = driNewRenderbuffer(MESA_FORMAT_ARGB8888, NULL, screen->bytesPerPixel, 0, screen->width, driDrawPriv); viaSetSpanFunctions(backRb, mesaVis); @@ -266,7 +266,7 @@ viaCreateBuffer(__DRIscreenPrivate *driScrnPriv, if (mesaVis->depthBits == 16) { driRenderbuffer *depthRb - = driNewRenderbuffer(GL_DEPTH_COMPONENT16, NULL, + = driNewRenderbuffer(MESA_FORMAT_Z16, NULL, screen->bytesPerPixel, 0, screen->width, driDrawPriv); viaSetSpanFunctions(depthRb, mesaVis); @@ -274,7 +274,7 @@ viaCreateBuffer(__DRIscreenPrivate *driScrnPriv, } else if (mesaVis->depthBits == 24) { driRenderbuffer *depthRb - = driNewRenderbuffer(GL_DEPTH_COMPONENT24, NULL, + = driNewRenderbuffer(MESA_FORMAT_Z24_S8, NULL, screen->bytesPerPixel, 0, screen->width, driDrawPriv); viaSetSpanFunctions(depthRb, mesaVis); @@ -282,7 +282,7 @@ viaCreateBuffer(__DRIscreenPrivate *driScrnPriv, } else if (mesaVis->depthBits == 32) { driRenderbuffer *depthRb - = driNewRenderbuffer(GL_DEPTH_COMPONENT32, NULL, + = driNewRenderbuffer(MESA_FORMAT_Z32, NULL, screen->bytesPerPixel, 0, screen->width, driDrawPriv); viaSetSpanFunctions(depthRb, mesaVis); @@ -291,7 +291,7 @@ viaCreateBuffer(__DRIscreenPrivate *driScrnPriv, if (mesaVis->stencilBits > 0 && !swStencil) { driRenderbuffer *stencilRb - = driNewRenderbuffer(GL_STENCIL_INDEX8_EXT, NULL, + = driNewRenderbuffer(MESA_FORMAT_S8, NULL, screen->bytesPerPixel, 0, screen->width, driDrawPriv); viaSetSpanFunctions(stencilRb, mesaVis); diff --git a/src/mesa/drivers/dri/unichrome/via_span.c b/src/mesa/drivers/dri/unichrome/via_span.c index b908f0fb23..e847164cd0 100644 --- a/src/mesa/drivers/dri/unichrome/via_span.c +++ b/src/mesa/drivers/dri/unichrome/via_span.c @@ -23,6 +23,7 @@ */ #include "main/glheader.h" +#include "main/formats.h" #include "main/macros.h" #include "main/mtypes.h" #include "main/colormac.h" @@ -177,24 +178,22 @@ void viaInitSpanFuncs(GLcontext *ctx) void viaSetSpanFunctions(struct via_renderbuffer *vrb, const GLvisual *vis) { - if (vrb->Base.InternalFormat == GL_RGBA) { - if (vis->redBits == 5 && vis->greenBits == 6 && vis->blueBits == 5) { - viaInitPointers_565(&vrb->Base); - } - else { - viaInitPointers_8888(&vrb->Base); - } + if (vrb->Base.Format == MESA_FORMAT_RGB565) { + viaInitPointers_565(&vrb->Base); } - else if (vrb->Base.InternalFormat == GL_DEPTH_COMPONENT16) { + else if (vrb->Base.Format == MESA_FORMAT_ARGB8888) { + viaInitPointers_8888(&vrb->Base); + } + else if (vrb->Base.Format == MESA_FORMAT_Z16) { viaInitDepthPointers_z16(&vrb->Base); } - else if (vrb->Base.InternalFormat == GL_DEPTH_COMPONENT24) { + else if (vrb->Base.Format == MESA_FORMAT_Z24_S8) { viaInitDepthPointers_z24_s8(&vrb->Base); } - else if (vrb->Base.InternalFormat == GL_DEPTH_COMPONENT32) { + else if (vrb->Base.Format == MESA_FORMAT_Z32) { viaInitDepthPointers_z32(&vrb->Base); } - else if (vrb->Base.InternalFormat == GL_STENCIL_INDEX8_EXT) { + else if (vrb->Base.Format == MESA_FORMAT_S8) { viaInitStencilPointers_z24_s8(&vrb->Base); } } -- cgit v1.2.3 From dd245016657c599ecf24c4abe999319f9c870c47 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 20 Oct 2009 10:58:14 -0700 Subject: ARB prog parser: Fix parameter array size comparison Array indexes are invalid when >= the maximum, but array sizes are only in valid when > the maximum. This prevented programs from declaring a single maximum size array. See the piglit vp-max-array test. --- src/mesa/shader/program_parse.tab.c | 2 +- src/mesa/shader/program_parse.y | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 9f2d4de90f..c255e912ed 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -3109,7 +3109,7 @@ yyreduce: /* Line 1455 of yacc.c */ #line 1041 "program_parse.y" { - if (((yyvsp[(1) - (1)].integer) < 1) || ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxParameters)) { + if (((yyvsp[(1) - (1)].integer) < 1) || ((unsigned) (yyvsp[(1) - (1)].integer) > state->limits->MaxParameters)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid parameter array size"); YYERROR; } else { diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 06c1915fbe..ae9e15ae5a 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -1039,7 +1039,7 @@ optArraySize: } | INTEGER { - if (($1 < 1) || ((unsigned) $1 >= state->limits->MaxParameters)) { + if (($1 < 1) || ((unsigned) $1 > state->limits->MaxParameters)) { yyerror(& @1, state, "invalid parameter array size"); YYERROR; } else { -- cgit v1.2.3 From 286611d99060c38c4cc12f18fde5448213e2a44b Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 22 Oct 2009 19:21:21 -0700 Subject: Revert "Store clipping distance for user clip planes as part of vertex processing" This reverts commit f058b25881e08c9d89a33345e5c84e1357396932. This change is completely wrong in so many ways. When clip distances are generated as part of vertex processing, they must be interpolated to perform clipping. Geometric clipping goes right out the window. --- src/mesa/tnl/t_context.h | 1 - src/mesa/tnl/t_vb_cliptmp.h | 103 +++++++------------------------------------- src/mesa/tnl/t_vb_program.c | 15 ------- src/mesa/tnl/t_vb_vertex.c | 31 ++----------- 4 files changed, 18 insertions(+), 132 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h index ca4edcfcb9..6137c2d2fe 100644 --- a/src/mesa/tnl/t_context.h +++ b/src/mesa/tnl/t_context.h @@ -207,7 +207,6 @@ struct vertex_buffer GLvector4f *EyePtr; /* _TNL_BIT_POS */ GLvector4f *ClipPtr; /* _TNL_BIT_POS */ GLvector4f *NdcPtr; /* _TNL_BIT_POS */ - GLfloat *ClipDistancePtr[MAX_CLIP_PLANES]; /* _TNL_BIT_POS */ GLubyte ClipOrMask; /* _TNL_BIT_POS */ GLubyte ClipAndMask; /* _TNL_BIT_POS */ GLubyte *ClipMask; /* _TNL_BIT_POS */ diff --git a/src/mesa/tnl/t_vb_cliptmp.h b/src/mesa/tnl/t_vb_cliptmp.h index 0d2183a9e6..618b8b3130 100644 --- a/src/mesa/tnl/t_vb_cliptmp.h +++ b/src/mesa/tnl/t_vb_cliptmp.h @@ -80,58 +80,6 @@ do { \ } while (0) -#define POLY_USERCLIP(PLANE) \ -do { \ - if (mask & CLIP_USER_BIT) { \ - GLuint idxPrev = inlist[0]; \ - GLfloat dpPrev = VB->ClipDistancePtr[PLANE][idxPrev]; \ - GLuint outcount = 0; \ - GLuint i; \ - \ - inlist[n] = inlist[0]; /* prevent rotation of vertices */ \ - for (i = 1; i <= n; i++) { \ - GLuint idx = inlist[i]; \ - GLfloat dp = VB->ClipDistancePtr[PLANE][idx]; \ - \ - if (!IS_NEGATIVE(dpPrev)) { \ - outlist[outcount++] = idxPrev; \ - } \ - \ - if (DIFFERENT_SIGNS(dp, dpPrev)) { \ - if (IS_NEGATIVE(dp)) { \ - /* Going out of bounds. Avoid division by zero as we \ - * know dp != dpPrev from DIFFERENT_SIGNS, above. \ - */ \ - GLfloat t = dp / (dp - dpPrev); \ - INTERP_4F( t, coord[newvert], coord[idx], coord[idxPrev]); \ - interp( ctx, t, newvert, idx, idxPrev, GL_TRUE ); \ - } else { \ - /* Coming back in. \ - */ \ - GLfloat t = dpPrev / (dpPrev - dp); \ - INTERP_4F( t, coord[newvert], coord[idxPrev], coord[idx]); \ - interp( ctx, t, newvert, idxPrev, idx, GL_FALSE ); \ - } \ - outlist[outcount++] = newvert++; \ - } \ - \ - idxPrev = idx; \ - dpPrev = dp; \ - } \ - \ - if (outcount < 3) \ - return; \ - \ - { \ - GLuint *tmp = inlist; \ - inlist = outlist; \ - outlist = tmp; \ - n = outcount; \ - } \ - } \ -} while (0) - - #define LINE_CLIP(PLANE_BIT, A, B, C, D ) \ do { \ if (mask & PLANE_BIT) { \ @@ -163,37 +111,6 @@ do { \ } while (0) -#define LINE_USERCLIP(PLANE) \ -do { \ - if (mask & CLIP_USER_BIT) { \ - const GLfloat dp0 = VB->ClipDistancePtr[PLANE][v0]; \ - const GLfloat dp1 = VB->ClipDistancePtr[PLANE][v1]; \ - const GLboolean neg_dp0 = IS_NEGATIVE(dp0); \ - const GLboolean neg_dp1 = IS_NEGATIVE(dp1); \ - \ - /* For regular clipping, we know from the clipmask that one \ - * (or both) of these must be negative (otherwise we wouldn't \ - * be here). \ - * For userclip, there is only a single bit for all active \ - * planes, so we can end up here when there is nothing to do, \ - * hence the second IS_NEGATIVE() test: \ - */ \ - if (neg_dp0 && neg_dp1) \ - return; /* both vertices outside clip plane: discard */ \ - \ - if (neg_dp1) { \ - GLfloat t = dp1 / (dp1 - dp0); \ - if (t > t1) t1 = t; \ - } else if (neg_dp0) { \ - GLfloat t = dp0 / (dp0 - dp1); \ - if (t > t0) t0 = t; \ - } \ - if (t0 + t1 >= 1.0) \ - return; /* discard */ \ - } \ -} while (0) - - /* Clip a line against the viewport and user clip planes. */ @@ -222,7 +139,11 @@ TAG(clip_line)( GLcontext *ctx, GLuint v0, GLuint v1, GLubyte mask ) if (mask & CLIP_USER_BIT) { for (p = 0; p < ctx->Const.MaxClipPlanes; p++) { if (ctx->Transform.ClipPlanesEnabled & (1 << p)) { - LINE_USERCLIP(p); + const GLfloat a = ctx->Transform._ClipUserPlane[p][0]; + const GLfloat b = ctx->Transform._ClipUserPlane[p][1]; + const GLfloat c = ctx->Transform._ClipUserPlane[p][2]; + const GLfloat d = ctx->Transform._ClipUserPlane[p][3]; + LINE_CLIP( CLIP_USER_BIT, a, b, c, d ); } } } @@ -307,7 +228,11 @@ TAG(clip_tri)( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLubyte mask ) if (mask & CLIP_USER_BIT) { for (p = 0; p < ctx->Const.MaxClipPlanes; p++) { if (ctx->Transform.ClipPlanesEnabled & (1 << p)) { - POLY_USERCLIP(p); + const GLfloat a = ctx->Transform._ClipUserPlane[p][0]; + const GLfloat b = ctx->Transform._ClipUserPlane[p][1]; + const GLfloat c = ctx->Transform._ClipUserPlane[p][2]; + const GLfloat d = ctx->Transform._ClipUserPlane[p][3]; + POLY_CLIP( CLIP_USER_BIT, a, b, c, d ); } } } @@ -366,7 +291,11 @@ TAG(clip_quad)( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3, if (mask & CLIP_USER_BIT) { for (p = 0; p < ctx->Const.MaxClipPlanes; p++) { if (ctx->Transform.ClipPlanesEnabled & (1 << p)) { - POLY_USERCLIP(p); + const GLfloat a = ctx->Transform._ClipUserPlane[p][0]; + const GLfloat b = ctx->Transform._ClipUserPlane[p][1]; + const GLfloat c = ctx->Transform._ClipUserPlane[p][2]; + const GLfloat d = ctx->Transform._ClipUserPlane[p][3]; + POLY_CLIP( CLIP_USER_BIT, a, b, c, d ); } } } @@ -388,6 +317,4 @@ TAG(clip_quad)( GLcontext *ctx, GLuint v0, GLuint v1, GLuint v2, GLuint v3, #undef SIZE #undef TAG #undef POLY_CLIP -#undef POLY_USERCLIP #undef LINE_CLIP -#undef LINE_USERCLIP diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index 5fb83c2b01..c10a27614f 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -66,7 +66,6 @@ struct vp_stage_data { GLvector4f results[VERT_RESULT_MAX]; GLvector4f ndcCoords; /**< normalized device coords */ - GLfloat *clipdistance[MAX_CLIP_PLANES]; GLubyte *clipmask; /**< clip flags */ GLubyte ormask, andmask; /**< for clipping */ }; @@ -78,7 +77,6 @@ struct vp_stage_data { static void userclip( GLcontext *ctx, GLvector4f *clip, - GLfloat *clipdistance[MAX_CLIP_PLANES], GLubyte *clipmask, GLubyte *clipormask, GLubyte *clipandmask ) @@ -107,8 +105,6 @@ userclip( GLcontext *ctx, clipmask[i] |= CLIP_USER_BIT; } - clipdistance[p][i] = dp; - STRIDE_F(coord, stride); } @@ -168,7 +164,6 @@ do_ndc_cliptest(GLcontext *ctx, struct vp_stage_data *store) ctx->VertexProgram.Current->IsPositionInvariant)) { userclip( ctx, VB->ClipPtr, - store->clipdistance, store->clipmask, &store->ormask, &store->andmask ); @@ -176,9 +171,6 @@ do_ndc_cliptest(GLcontext *ctx, struct vp_stage_data *store) if (store->andmask) { return GL_FALSE; } - - memcpy(VB->ClipDistancePtr, store->clipdistance, - sizeof(store->clipdistance)); } VB->ClipAndMask = store->andmask; @@ -522,10 +514,6 @@ init_vp(GLcontext *ctx, struct tnl_pipeline_stage *stage) _mesa_vector4f_alloc( &store->ndcCoords, 0, size, 32 ); store->clipmask = (GLubyte *) ALIGN_MALLOC(sizeof(GLubyte)*size, 32 ); - for (i = 0; i < MAX_CLIP_PLANES; i++) - store->clipdistance[i] = - (GLfloat *) ALIGN_MALLOC(sizeof(GLfloat) * size, 32); - return GL_TRUE; } @@ -549,9 +537,6 @@ dtr(struct tnl_pipeline_stage *stage) _mesa_vector4f_free( &store->ndcCoords ); ALIGN_FREE( store->clipmask ); - for (i = 0; i < MAX_CLIP_PLANES; i++) - ALIGN_FREE(store->clipdistance[i]); - FREE( store ); stage->privatePtr = NULL; } diff --git a/src/mesa/tnl/t_vb_vertex.c b/src/mesa/tnl/t_vb_vertex.c index 2a61ff1177..4734754ea4 100644 --- a/src/mesa/tnl/t_vb_vertex.c +++ b/src/mesa/tnl/t_vb_vertex.c @@ -44,7 +44,6 @@ struct vertex_stage_data { GLvector4f eye; GLvector4f clip; GLvector4f proj; - GLfloat *clipdistance[MAX_CLIP_PLANES]; GLubyte *clipmask; GLubyte ormask; GLubyte andmask; @@ -57,12 +56,11 @@ struct vertex_stage_data { /* This function implements cliptesting for user-defined clip planes. * The clipping of primitives to these planes is implemented in - * t_vp_cliptmp.h. + * t_render_clip.h. */ #define USER_CLIPTEST(NAME, SZ) \ static void NAME( GLcontext *ctx, \ GLvector4f *clip, \ - GLfloat *clipdistances[MAX_CLIP_PLANES], \ GLubyte *clipmask, \ GLubyte *clipormask, \ GLubyte *clipandmask ) \ @@ -90,8 +88,6 @@ static void NAME( GLcontext *ctx, \ clipmask[i] |= CLIP_USER_BIT; \ } \ \ - clipdistances[p][i] = dp; \ - \ STRIDE_F(coord, stride); \ } \ \ @@ -111,9 +107,8 @@ USER_CLIPTEST(userclip3, 3) USER_CLIPTEST(userclip4, 4) static void (*(usercliptab[5]))( GLcontext *, - GLvector4f *, - GLfloat *[MAX_CLIP_PLANES], - GLubyte *, GLubyte *, GLubyte * ) = + GLvector4f *, GLubyte *, + GLubyte *, GLubyte * ) = { NULL, NULL, @@ -219,16 +214,12 @@ static GLboolean run_vertex_stage( GLcontext *ctx, if (ctx->Transform.ClipPlanesEnabled) { usercliptab[VB->ClipPtr->size]( ctx, VB->ClipPtr, - store->clipdistance, store->clipmask, &store->ormask, &store->andmask ); if (store->andmask) return GL_FALSE; - - memcpy(VB->ClipDistancePtr, store->clipdistance, - sizeof(store->clipdistance)); } VB->ClipAndMask = store->andmask; @@ -245,7 +236,6 @@ static GLboolean init_vertex_stage( GLcontext *ctx, struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; struct vertex_stage_data *store; GLuint size = VB->Size; - unsigned i; stage->privatePtr = CALLOC(sizeof(*store)); store = VERTEX_STAGE_DATA(stage); @@ -257,17 +247,8 @@ static GLboolean init_vertex_stage( GLcontext *ctx, _mesa_vector4f_alloc( &store->proj, 0, size, 32 ); store->clipmask = (GLubyte *) ALIGN_MALLOC(sizeof(GLubyte)*size, 32 ); - for (i = 0; i < MAX_CLIP_PLANES; i++) - store->clipdistance[i] = - (GLfloat *) ALIGN_MALLOC(sizeof(GLfloat) * size, 32); if (!store->clipmask || - !store->clipdistance[0] || - !store->clipdistance[1] || - !store->clipdistance[2] || - !store->clipdistance[3] || - !store->clipdistance[4] || - !store->clipdistance[5] || !store->eye.data || !store->clip.data || !store->proj.data) @@ -281,16 +262,10 @@ static void dtr( struct tnl_pipeline_stage *stage ) struct vertex_stage_data *store = VERTEX_STAGE_DATA(stage); if (store) { - unsigned i; - _mesa_vector4f_free( &store->eye ); _mesa_vector4f_free( &store->clip ); _mesa_vector4f_free( &store->proj ); ALIGN_FREE( store->clipmask ); - - for (i = 0; i < MAX_CLIP_PLANES; i++) - ALIGN_FREE(store->clipdistance[i]); - FREE(store); stage->privatePtr = NULL; stage->run = init_vertex_stage; -- cgit v1.2.3 From 95328c7cf91322813de846a72f157aefff9417a6 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Thu, 22 Oct 2009 17:18:01 -0400 Subject: r600: clean up context creation Make it more consistent with other radeon drivers. --- src/mesa/drivers/dri/r600/r600_context.c | 202 +++++++++++++++---------------- 1 file changed, 100 insertions(+), 102 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index ba0d450cbb..9776a868ff 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -213,6 +213,96 @@ static void r600_init_vtbl(radeonContextPtr radeon) radeon->vtbl.fallback = r600_fallback; } +static void r600InitConstValues(GLcontext *ctx, radeonScreenPtr screen) +{ + context_t *r600 = R700_CONTEXT(ctx); + + ctx->Const.MaxTextureImageUnits = + driQueryOptioni(&r600->radeon.optionCache, "texture_image_units"); + ctx->Const.MaxTextureCoordUnits = + driQueryOptioni(&r600->radeon.optionCache, "texture_coord_units"); + ctx->Const.MaxTextureUnits = + MIN2(ctx->Const.MaxTextureImageUnits, + ctx->Const.MaxTextureCoordUnits); + ctx->Const.MaxTextureMaxAnisotropy = 16.0; + ctx->Const.MaxTextureLodBias = 16.0; + + ctx->Const.MaxTextureLevels = 13; /* hw support 14 */ + ctx->Const.MaxTextureRectSize = 4096; /* hw support 8192 */ + + ctx->Const.MinPointSize = 0x0001 / 8.0; + ctx->Const.MinPointSizeAA = 0x0001 / 8.0; + ctx->Const.MaxPointSize = 0xffff / 8.0; + ctx->Const.MaxPointSizeAA = 0xffff / 8.0; + + ctx->Const.MinLineWidth = 0x0001 / 8.0; + ctx->Const.MinLineWidthAA = 0x0001 / 8.0; + ctx->Const.MaxLineWidth = 0xffff / 8.0; + ctx->Const.MaxLineWidthAA = 0xffff / 8.0; + + ctx->Const.MaxDrawBuffers = 1; /* hw supports 8 */ + + /* 256 for reg-based consts, inline consts also supported */ + ctx->Const.VertexProgram.MaxInstructions = 8192; /* in theory no limit */ + ctx->Const.VertexProgram.MaxNativeInstructions = 8192; + ctx->Const.VertexProgram.MaxNativeAttribs = 160; + ctx->Const.VertexProgram.MaxTemps = 128; + ctx->Const.VertexProgram.MaxNativeTemps = 128; + ctx->Const.VertexProgram.MaxNativeParameters = 256; + ctx->Const.VertexProgram.MaxNativeAddressRegs = 1; /* ??? */ + + ctx->Const.FragmentProgram.MaxNativeTemps = 128; + ctx->Const.FragmentProgram.MaxNativeAttribs = 32; + ctx->Const.FragmentProgram.MaxNativeParameters = 256; + ctx->Const.FragmentProgram.MaxNativeAluInstructions = 8192; + /* 8 per clause on r6xx, 16 on rv670/r7xx */ + if ((screen->chip_family == CHIP_FAMILY_RV670) || + (screen->chip_family >= CHIP_FAMILY_RV770)) + ctx->Const.FragmentProgram.MaxNativeTexInstructions = 16; + else + ctx->Const.FragmentProgram.MaxNativeTexInstructions = 8; + ctx->Const.FragmentProgram.MaxNativeInstructions = 8192; + ctx->Const.FragmentProgram.MaxNativeTexIndirections = 8; /* ??? */ + ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; /* and these are?? */ +} + +static void r600ParseOptions(context_t *r600, radeonScreenPtr screen) +{ + /* Parse configuration files. + * Do this here so that initialMaxAnisotropy is set before we create + * the default textures. + */ + driParseConfigFiles(&r600->radeon.optionCache, &screen->optionCache, + screen->driScreen->myNum, "r600"); + + r600->radeon.initialMaxAnisotropy = driQueryOptionf(&r600->radeon.optionCache, + "def_max_anisotropy"); + +} + +static void r600InitGLExtensions(GLcontext *ctx) +{ + context_t *r600 = R700_CONTEXT(ctx); + + driInitExtensions(ctx, card_extensions, GL_TRUE); + if (r600->radeon.radeonScreen->kernel_mm) + driInitExtensions(ctx, mm_extensions, GL_FALSE); + + if (driQueryOptionb + (&r600->radeon.optionCache, "disable_stencil_two_side")) + _mesa_disable_extension(ctx, "GL_EXT_stencil_two_side"); + + if (r600->radeon.glCtx->Mesa_DXTn + && !driQueryOptionb(&r600->radeon.optionCache, "disable_s3tc")) { + _mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc"); + _mesa_enable_extension(ctx, "GL_S3_s3tc"); + } else + if (driQueryOptionb(&r600->radeon.optionCache, "force_s3tc_enable")) + { + _mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc"); + } +} + /* Create the device specific rendering context. */ GLboolean r600CreateContext(const __GLcontextModes * glVisual, @@ -236,19 +326,10 @@ GLboolean r600CreateContext(const __GLcontextModes * glVisual, return GL_FALSE; } - if (!(screen->chip_flags & RADEON_CHIPSET_TCL)) - hw_tcl_on = future_hw_tcl_on = 0; + r600ParseOptions(r600, screen); + r600->radeon.radeonScreen = screen; r600_init_vtbl(&r600->radeon); - /* Parse configuration files. - * Do this here so that initialMaxAnisotropy is set before we create - * the default textures. - */ - driParseConfigFiles(&r600->radeon.optionCache, &screen->optionCache, - screen->driScreen->myNum, "r600"); - - r600->radeon.initialMaxAnisotropy = driQueryOptionf(&r600->radeon.optionCache, - "def_max_anisotropy"); /* Init default driver functions then plug in our R600-specific functions * (the texture functions are especially important) @@ -259,7 +340,7 @@ GLboolean r600CreateContext(const __GLcontextModes * glVisual, r600InitTextureFuncs(&functions); r700InitShaderFuncs(&functions); r700InitIoctlFuncs(&functions); - radeonInitBufferObjectFuncs(&functions); + radeonInitBufferObjectFuncs(&functions); if (!radeonInitContext(&r600->radeon, &functions, glVisual, driContextPriv, @@ -269,44 +350,14 @@ GLboolean r600CreateContext(const __GLcontextModes * glVisual, return GL_FALSE; } - /* Init r600 context data */ - /* Set the maximum texture size small enough that we can guarentee that - * all texture units can bind a maximal texture and have them both in - * texturable memory at once. - */ - ctx = r600->radeon.glCtx; - ctx->Const.MaxTextureImageUnits = - driQueryOptioni(&r600->radeon.optionCache, "texture_image_units"); - ctx->Const.MaxTextureCoordUnits = - driQueryOptioni(&r600->radeon.optionCache, "texture_coord_units"); - ctx->Const.MaxTextureUnits = - MIN2(ctx->Const.MaxTextureImageUnits, - ctx->Const.MaxTextureCoordUnits); - ctx->Const.MaxTextureMaxAnisotropy = 16.0; - ctx->Const.MaxTextureLodBias = 16.0; - - ctx->Const.MaxTextureLevels = 13; /* hw support 14 */ - ctx->Const.MaxTextureRectSize = 4096; /* hw support 8192 */ - - ctx->Const.MinPointSize = 0x0001 / 8.0; - ctx->Const.MinPointSizeAA = 0x0001 / 8.0; - ctx->Const.MaxPointSize = 0xffff / 8.0; - ctx->Const.MaxPointSizeAA = 0xffff / 8.0; - - ctx->Const.MinLineWidth = 0x0001 / 8.0; - ctx->Const.MinLineWidthAA = 0x0001 / 8.0; - ctx->Const.MaxLineWidth = 0xffff / 8.0; - ctx->Const.MaxLineWidthAA = 0xffff / 8.0; + ctx->VertexProgram._MaintainTnlProgram = GL_TRUE; + ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE; - /* Needs further modifications */ -#if 0 - ctx->Const.MaxArrayLockSize = - ( /*512 */ RADEON_BUFFER_SIZE * 16 * 1024) / (4 * 4); -#endif + r600InitConstValues(ctx, screen); - ctx->Const.MaxDrawBuffers = 1; + _mesa_set_mvp_with_dp4( ctx, GL_TRUE ); /* Initialize the software rasterizer and helper modules. */ @@ -315,16 +366,12 @@ GLboolean r600CreateContext(const __GLcontextModes * glVisual, _tnl_CreateContext(ctx); _swsetup_CreateContext(ctx); _swsetup_Wakeup(ctx); - _ae_create_context(ctx); /* Install the customized pipeline: */ _tnl_destroy_pipeline(ctx); _tnl_install_pipeline(ctx, r700_pipeline); - - /* Try and keep materials and vertices separate: - */ -/* _tnl_isolate_materials(ctx, GL_TRUE); */ + TNL_CONTEXT(ctx)->Driver.RunPipeline = r600RunPipeline; /* Configure swrast and TNL to match hardware characteristics: */ @@ -333,65 +380,16 @@ GLboolean r600CreateContext(const __GLcontextModes * glVisual, _tnl_allow_pixel_fog(ctx, GL_FALSE); _tnl_allow_vertex_fog(ctx, GL_TRUE); - /* 256 for reg-based consts, inline consts also supported */ - ctx->Const.VertexProgram.MaxInstructions = 8192; /* in theory no limit */ - ctx->Const.VertexProgram.MaxNativeInstructions = 8192; - ctx->Const.VertexProgram.MaxNativeAttribs = 160; - ctx->Const.VertexProgram.MaxTemps = 128; - ctx->Const.VertexProgram.MaxNativeTemps = 128; - ctx->Const.VertexProgram.MaxNativeParameters = 256; - ctx->Const.VertexProgram.MaxNativeAddressRegs = 1; /* ??? */ - - ctx->Const.FragmentProgram.MaxNativeTemps = 128; - ctx->Const.FragmentProgram.MaxNativeAttribs = 32; - ctx->Const.FragmentProgram.MaxNativeParameters = 256; - ctx->Const.FragmentProgram.MaxNativeAluInstructions = 8192; - /* 8 per clause on r6xx, 16 on rv670/r7xx */ - if ((screen->chip_family == CHIP_FAMILY_RV670) || - (screen->chip_family >= CHIP_FAMILY_RV770)) - ctx->Const.FragmentProgram.MaxNativeTexInstructions = 16; - else - ctx->Const.FragmentProgram.MaxNativeTexInstructions = 8; - ctx->Const.FragmentProgram.MaxNativeInstructions = 8192; - ctx->Const.FragmentProgram.MaxNativeTexIndirections = 8; /* ??? */ - ctx->Const.FragmentProgram.MaxNativeAddressRegs = 0; /* and these are?? */ - ctx->VertexProgram._MaintainTnlProgram = GL_TRUE; - ctx->FragmentProgram._MaintainTexEnvProgram = GL_TRUE; - radeon_init_debug(); - driInitExtensions(ctx, card_extensions, GL_TRUE); - if (r600->radeon.radeonScreen->kernel_mm) - driInitExtensions(ctx, mm_extensions, GL_FALSE); - - if (driQueryOptionb - (&r600->radeon.optionCache, "disable_stencil_two_side")) - _mesa_disable_extension(ctx, "GL_EXT_stencil_two_side"); - - if (r600->radeon.glCtx->Mesa_DXTn - && !driQueryOptionb(&r600->radeon.optionCache, "disable_s3tc")) { - _mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc"); - _mesa_enable_extension(ctx, "GL_S3_s3tc"); - } else - if (driQueryOptionb(&r600->radeon.optionCache, "force_s3tc_enable")) - { - _mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc"); - } - - r700InitDraw(ctx); + r700InitDraw(ctx); radeon_fbo_init(&r600->radeon); radeonInitSpanFuncs( ctx ); - r600InitCmdBuf(r600); - r700InitState(r600->radeon.glCtx); - TNL_CONTEXT(ctx)->Driver.RunPipeline = r600RunPipeline; - - if (driQueryOptionb(&r600->radeon.optionCache, "no_rast")) { - radeon_warning("disabling 3D acceleration\n"); - } + r600InitGLExtensions(ctx); return GL_TRUE; } -- cgit v1.2.3 From 614e8f220332d5876c787ea07300c6c8508219d5 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Thu, 22 Oct 2009 17:41:31 -0400 Subject: r600: remove old tnl pipeline --- src/mesa/drivers/dri/r600/r600_context.c | 33 +++--- src/mesa/drivers/dri/r600/r700_render.c | 193 +++---------------------------- 2 files changed, 34 insertions(+), 192 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index 9776a868ff..e6791b46f0 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -94,8 +94,6 @@ int hw_tcl_on = 1; #include "extension_helper.h" -extern const struct tnl_pipeline_stage *r700_pipeline[]; - const struct dri_extension card_extensions[] = { /* *INDENT-OFF* */ {"GL_ARB_depth_texture", NULL}, @@ -160,17 +158,20 @@ const struct dri_extension gl_20_extension[] = { {"GL_VERSION_2_0", GL_VERSION_2_0_functions }, }; - -static void r600RunPipeline(GLcontext * ctx) -{ - _mesa_lock_context_textures(ctx); - - if (ctx->NewState) - _mesa_update_state_locked(ctx); - - _tnl_run_pipeline(ctx); - _mesa_unlock_context_textures(ctx); -} +static const struct tnl_pipeline_stage *r600_pipeline[] = { + /* Catch any t&l fallbacks + */ + &_tnl_vertex_transform_stage, + &_tnl_normal_transform_stage, + &_tnl_lighting_stage, + &_tnl_fog_coordinate_stage, + &_tnl_texgen_stage, + &_tnl_texture_transform_stage, + &_tnl_point_attenuation_stage, + &_tnl_vertex_program_stage, + &_tnl_render_stage, + 0, +}; static void r600_get_lock(radeonContextPtr rmesa) { @@ -181,7 +182,7 @@ static void r600_get_lock(radeonContextPtr rmesa) if (!rmesa->radeonScreen->kernel_mm) radeon_bo_legacy_texture_age(rmesa->radeonScreen->bom); } -} +} static void r600_vtbl_emit_cs_header(struct radeon_cs *cs, radeonContextPtr rmesa) { @@ -370,8 +371,8 @@ GLboolean r600CreateContext(const __GLcontextModes * glVisual, /* Install the customized pipeline: */ _tnl_destroy_pipeline(ctx); - _tnl_install_pipeline(ctx, r700_pipeline); - TNL_CONTEXT(ctx)->Driver.RunPipeline = r600RunPipeline; + _tnl_install_pipeline(ctx, r600_pipeline); + TNL_CONTEXT(ctx)->Driver.RunPipeline = _tnl_run_pipeline; /* Configure swrast and TNL to match hardware characteristics: */ diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c index 4f39d9f1bd..71f95a19c0 100644 --- a/src/mesa/drivers/dri/r600/r700_render.c +++ b/src/mesa/drivers/dri/r600/r700_render.c @@ -409,139 +409,6 @@ static GLuint r700PredictRenderSize(GLcontext* ctx, GLuint nr_prims) return dwords; } -static GLboolean r700RunRender(GLcontext * ctx, - struct tnl_pipeline_stage *stage) -{ - context_t *context = R700_CONTEXT(ctx); - radeonContextPtr radeon = &context->radeon; - unsigned int i, id = 0; - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *vb = &tnl->vb; - struct radeon_renderbuffer *rrb; - - radeon_print(RADEON_RENDER, RADEON_NORMAL, "%s: cs begin at %d\n", - __func__, context->radeon.cmdbuf.cs->cdw); - - /* always emit CB base to prevent - * lock ups on some chips. - */ - R600_STATECHANGE(context, cb_target); - /* mark vtx as dirty since it changes per-draw */ - R600_STATECHANGE(context, vtx); - - r700SetScissor(context); - r700SetupVertexProgram(ctx); - r700SetupFragmentProgram(ctx); - r600UpdateTextureState(ctx); - - GLuint emit_end = r700PredictRenderSize(ctx, 0) - + context->radeon.cmdbuf.cs->cdw; - r700SetupStreams(ctx); - - radeonEmitState(radeon); - - radeon_debug_add_indent(); - /* richard test code */ - for (i = 0; i < vb->PrimitiveCount; i++) { - GLuint prim = _tnl_translate_prim(&vb->Primitive[i]); - GLuint start = vb->Primitive[i].start; - GLuint end = vb->Primitive[i].start + vb->Primitive[i].count; - r700RunRenderPrimitive(ctx, start, end, prim); - } - radeon_debug_remove_indent(); - - /* Flush render op cached for last several quads. */ - r700WaitForIdleClean(context); - - rrb = radeon_get_colorbuffer(&context->radeon); - if (rrb && rrb->bo) - r700SyncSurf(context, rrb->bo, 0, RADEON_GEM_DOMAIN_VRAM, - CB_ACTION_ENA_bit | (1 << (id + 6))); - - rrb = radeon_get_depthbuffer(&context->radeon); - if (rrb && rrb->bo) - r700SyncSurf(context, rrb->bo, 0, RADEON_GEM_DOMAIN_VRAM, - DB_ACTION_ENA_bit | DB_DEST_BASE_ENA_bit); - - radeonReleaseArrays(ctx, ~0); - - radeon_print(RADEON_RENDER, RADEON_TRACE, "%s: cs end at %d\n", - __func__, context->radeon.cmdbuf.cs->cdw); - - if ( emit_end < context->radeon.cmdbuf.cs->cdw ) - WARN_ONCE("Rendering was %d commands larger than predicted size." - " We might overflow command buffer.\n", context->radeon.cmdbuf.cs->cdw - emit_end); - - return GL_FALSE; -} - -static GLboolean r700RunNonTCLRender(GLcontext * ctx, - struct tnl_pipeline_stage *stage) /* -------------------- */ -{ - GLboolean bRet = GL_TRUE; - - return bRet; -} - -static GLboolean r700RunTCLRender(GLcontext * ctx, /*----------------------*/ - struct tnl_pipeline_stage *stage) -{ - GLboolean bRet = GL_FALSE; - - /* TODO : sw fallback */ - - /* Need shader bo's setup before bo check */ - r700UpdateShaders(ctx); - /** - - * Ensure all enabled and complete textures are uploaded along with any buffers being used. - */ - if(!r600ValidateBuffers(ctx)) - { - return GL_TRUE; - } - - bRet = r700RunRender(ctx, stage); - - return bRet; - //GL_FALSE will stop to do other pipe stage in _tnl_run_pipeline - //The render here DOES finish the whole pipe, so GL_FALSE should be returned for success. -} - -const struct tnl_pipeline_stage _r700_render_stage = { - "r700 Hardware Rasterization", - NULL, - NULL, - NULL, - NULL, - r700RunNonTCLRender -}; - -const struct tnl_pipeline_stage _r700_tcl_stage = { - "r700 Hardware Transform, Clipping and Lighting", - NULL, - NULL, - NULL, - NULL, - r700RunTCLRender -}; - -const struct tnl_pipeline_stage *r700_pipeline[] = -{ - &_r700_tcl_stage, - &_tnl_vertex_transform_stage, - &_tnl_normal_transform_stage, - &_tnl_lighting_stage, - &_tnl_fog_coordinate_stage, - &_tnl_texgen_stage, - &_tnl_texture_transform_stage, - &_tnl_vertex_program_stage, - - &_r700_render_stage, - &_tnl_render_stage, - 0, -}; - #define CONVERT( TYPE, MACRO ) do { \ GLuint i, j, sz; \ sz = input->Size; \ @@ -941,12 +808,12 @@ static void r700SetupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer } static GLboolean r700TryDrawPrims(GLcontext *ctx, - const struct gl_client_array *arrays[], - const struct _mesa_prim *prim, - GLuint nr_prims, - const struct _mesa_index_buffer *ib, - GLuint min_index, - GLuint max_index ) + const struct gl_client_array *arrays[], + const struct _mesa_prim *prim, + GLuint nr_prims, + const struct _mesa_index_buffer *ib, + GLuint min_index, + GLuint max_index ) { context_t *context = R700_CONTEXT(ctx); radeonContextPtr radeon = &context->radeon; @@ -954,9 +821,7 @@ static GLboolean r700TryDrawPrims(GLcontext *ctx, struct radeon_renderbuffer *rrb; if (ctx->NewState) - { _mesa_update_state( ctx ); - } _tnl_UpdateFixedFunctionProgram(ctx); r700SetVertexFormat(ctx, arrays, max_index + 1); @@ -1019,18 +884,18 @@ static GLboolean r700TryDrawPrims(GLcontext *ctx, return GL_TRUE; } -static void r700DrawPrimsRe(GLcontext *ctx, - const struct gl_client_array *arrays[], - const struct _mesa_prim *prim, - GLuint nr_prims, - const struct _mesa_index_buffer *ib, - GLboolean index_bounds_valid, - GLuint min_index, - GLuint max_index) +static void r700DrawPrims(GLcontext *ctx, + const struct gl_client_array *arrays[], + const struct _mesa_prim *prim, + GLuint nr_prims, + const struct _mesa_index_buffer *ib, + GLboolean index_bounds_valid, + GLuint min_index, + GLuint max_index) { - GLboolean retval = GL_FALSE; + GLboolean retval = GL_FALSE; - /* This check should get folded into just the places that + /* This check should get folded into just the places that * min/max index are really needed. */ if (!index_bounds_valid) { @@ -1038,7 +903,7 @@ static void r700DrawPrimsRe(GLcontext *ctx, } if (min_index) { - vbo_rebase_prims( ctx, arrays, prim, nr_prims, ib, min_index, max_index, r700DrawPrimsRe ); + vbo_rebase_prims( ctx, arrays, prim, nr_prims, ib, min_index, max_index, r700DrawPrims ); return; } @@ -1050,30 +915,6 @@ static void r700DrawPrimsRe(GLcontext *ctx, _tnl_draw_prims(ctx, arrays, prim, nr_prims, ib, min_index, max_index); } -static void r700DrawPrims(GLcontext *ctx, - const struct gl_client_array *arrays[], - const struct _mesa_prim *prim, - GLuint nr_prims, - const struct _mesa_index_buffer *ib, - GLboolean index_bounds_valid, - GLuint min_index, - GLuint max_index) -{ - context_t *context = R700_CONTEXT(ctx); - - /* For non indexed drawing, using tnl pipe. */ - if(!ib) - { - context->ind_buf.bo = NULL; - - _tnl_vbo_draw_prims(ctx, arrays, prim, nr_prims, ib, - index_bounds_valid, min_index, max_index); - return; - } - - r700DrawPrimsRe(ctx, arrays, prim, nr_prims, ib, index_bounds_valid, min_index, max_index); -} - void r700InitDraw(GLcontext *ctx) { struct vbo_context *vbo = vbo_context(ctx); -- cgit v1.2.3 From fc38a3cfe84e4e79af43f29d236748120789a286 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Fri, 23 Oct 2009 00:40:41 -0400 Subject: r600: fix render size prediction --- src/mesa/drivers/dri/r600/r700_chip.c | 4 ++-- src/mesa/drivers/dri/r600/r700_render.c | 35 +++++++++++++++---------------- src/mesa/drivers/dri/r600/r700_vertprog.c | 1 + 3 files changed, 20 insertions(+), 20 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index 3b7f6fffe0..3ebc53d94f 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -210,8 +210,8 @@ static void r700SetupVTXConstants(GLcontext * ctx, extern int getTypeSize(GLenum type); static void r700SetupVTXConstants2(GLcontext * ctx, - void * pAos, - StreamDesc * pStreamDesc) + void * pAos, + StreamDesc * pStreamDesc) { context_t *context = R700_CONTEXT(ctx); struct radeon_aos * paos = (struct radeon_aos *)pAos; diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c index 71f95a19c0..c2e7680eae 100644 --- a/src/mesa/drivers/dri/r600/r700_render.c +++ b/src/mesa/drivers/dri/r600/r700_render.c @@ -375,38 +375,38 @@ static void r700RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim /* start 3d, idle, cb/db flush */ #define PRE_EMIT_STATE_BUFSZ 10 + 5 + 14 -static GLuint r700PredictRenderSize(GLcontext* ctx, GLuint nr_prims) +static GLuint r700PredictRenderSize(GLcontext* ctx, + const struct _mesa_prim *prim, + const struct _mesa_index_buffer *ib, + GLuint nr_prims) { context_t *context = R700_CONTEXT(ctx); - struct r700_vertex_program *vp = context->selected_vp; GLboolean flushed; GLuint dwords, i; GLuint state_size; - /* pre calculate aos count so state prediction works */ - context->radeon.tcl.aos_count = _mesa_bitcount(vp->mesa_program->Base.InputsRead); dwords = PRE_EMIT_STATE_BUFSZ; - if (nr_prims) + if (ib) dwords += nr_prims * 14; else { - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *vb = &tnl->vb; - - for (i = 0; i < vb->PrimitiveCount; i++) - dwords += vb->Primitive[i].count + 10; + for (i = 0; i < nr_prims; ++i) + { + dwords += prim[i].count + 10; + } } + state_size = radeonCountStateEmitSize(&context->radeon); flushed = rcommonEnsureCmdBufSpace(&context->radeon, - dwords + state_size, __FUNCTION__); - + dwords + state_size, + __FUNCTION__); if (flushed) - dwords += radeonCountStateEmitSize(&context->radeon); + dwords += radeonCountStateEmitSize(&context->radeon); else - dwords += state_size; + dwords += state_size; - radeon_print(RADEON_RENDER, RADEON_VERBOSE, - "%s: total prediction size is %d.\n", __FUNCTION__, dwords); + radeon_print(RADEON_RENDER, RADEON_VERBOSE, "%s: total prediction size is %d.\n", __FUNCTION__, dwords); return dwords; + } #define CONVERT( TYPE, MACRO ) do { \ @@ -653,7 +653,6 @@ static void r700SetupStreams2(GLcontext *ctx, const struct gl_client_array *inpu } } - context->radeon.tcl.aos_count = context->nNumActiveAos; ret = radeon_cs_space_check_with_bo(context->radeon.cmdbuf.cs, first_elem(&context->radeon.dma.reserved)->bo, RADEON_GEM_DOMAIN_GTT, 0); @@ -842,7 +841,7 @@ static GLboolean r700TryDrawPrims(GLcontext *ctx, r700SetupFragmentProgram(ctx); r600UpdateTextureState(ctx); - GLuint emit_end = r700PredictRenderSize(ctx, nr_prims) + GLuint emit_end = r700PredictRenderSize(ctx, prim, ib, nr_prims) + context->radeon.cmdbuf.cs->cdw; r700SetupIndexBuffer(ctx, ib); diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.c b/src/mesa/drivers/dri/r600/r700_vertprog.c index d12c39c9f7..65c2c3f811 100644 --- a/src/mesa/drivers/dri/r600/r700_vertprog.c +++ b/src/mesa/drivers/dri/r600/r700_vertprog.c @@ -580,6 +580,7 @@ void r700SetVertexFormat(GLcontext *ctx, const struct gl_client_array *arrays[], unBit >>= 1; ++unLoc; } + context->radeon.tcl.aos_count = context->nNumActiveAos; } void * r700GetActiveVpShaderBo(GLcontext * ctx) -- cgit v1.2.3 From 45eb9d2f6dced7654291cabb4b8dd02a695db694 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Fri, 23 Oct 2009 01:00:23 -0400 Subject: r600: remove remains of old tnl pipeline --- src/mesa/drivers/dri/r600/r600_context.h | 30 -------- src/mesa/drivers/dri/r600/r700_chip.c | 121 ++---------------------------- src/mesa/drivers/dri/r600/r700_render.c | 6 +- src/mesa/drivers/dri/r600/r700_shader.h | 1 + src/mesa/drivers/dri/r600/r700_state.c | 40 +--------- src/mesa/drivers/dri/r600/r700_vertprog.c | 103 ++++++------------------- src/mesa/drivers/dri/r600/r700_vertprog.h | 8 +- 7 files changed, 41 insertions(+), 268 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r600_context.h b/src/mesa/drivers/dri/r600/r600_context.h index 7f68820fda..394fd757d4 100644 --- a/src/mesa/drivers/dri/r600/r600_context.h +++ b/src/mesa/drivers/dri/r600/r600_context.h @@ -58,29 +58,6 @@ typedef struct r600_context context_t; #include "main/mm.h" -/************ DMA BUFFERS **************/ - -/* The blit width for texture uploads - */ -#define R600_BLIT_WIDTH_BYTES 1024 -#define R600_MAX_TEXTURE_UNITS 8 - -struct r600_texture_state { - int tc_count; /* number of incoming texture coordinates from VAP */ -}; - -/* Perhaps more if we store programs in vmem? */ -/* drm_r600_cmd_header_t->vpu->count is unsigned char */ -#define VSF_MAX_FRAGMENT_LENGTH (255*4) - -/* Can be tested with colormat currently. */ -#define VSF_MAX_FRAGMENT_TEMPS (14) - -#define STATE_R600_WINDOW_DIMENSION (STATE_INTERNAL_DRIVER+0) -#define STATE_R600_TEXRECT_FACTOR (STATE_INTERNAL_DRIVER+1) - -extern int hw_tcl_on; - #define COLOR_IS_RGBA #define TAG(x) r600##x #include "tnl_dd/t_dd_vertex.h" @@ -167,9 +144,6 @@ struct r600_context { /* Vertex buffers */ - GLvector4f dummy_attrib[_TNL_ATTRIB_MAX]; - GLvector4f *temp_attrib[_TNL_ATTRIB_MAX]; - GLint nNumActiveAos; StreamDesc stream_desc[VERT_ATTRIB_MAX]; struct r700_index_buffer ind_buf; @@ -203,7 +177,6 @@ extern GLboolean r700SyncSurf(context_t *context, uint32_t write_domain, uint32_t sync_type); -extern void r700SetupStreams(GLcontext * ctx); extern void r700Start3D(context_t *context); extern void r600InitAtoms(context_t *context); extern void r700InitDraw(GLcontext *ctx); @@ -213,7 +186,4 @@ extern void r700InitDraw(GLcontext *ctx); #define RADEON_D_PLAYBACK_RAW 2 #define RADEON_D_T 3 -#define r600PackFloat32 radeonPackFloat32 -#define r600PackFloat24 radeonPackFloat24 - #endif /* __R600_CONTEXT_H__ */ diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index 3ebc53d94f..75b97c56cd 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -141,77 +141,10 @@ static void r700SendTexBorderColorState(GLcontext *ctx, struct radeon_state_atom } } +extern int getTypeSize(GLenum type); static void r700SetupVTXConstants(GLcontext * ctx, - unsigned int nStreamID, void * pAos, - unsigned int size, /* number of elements in vector */ - unsigned int stride, - unsigned int count) /* number of vectors in stream */ -{ - context_t *context = R700_CONTEXT(ctx); - struct radeon_aos * paos = (struct radeon_aos *)pAos; - BATCH_LOCALS(&context->radeon); - radeon_print(RADEON_STATE, RADEON_VERBOSE, "%s\n", __func__); - - unsigned int uSQ_VTX_CONSTANT_WORD0_0; - unsigned int uSQ_VTX_CONSTANT_WORD1_0; - unsigned int uSQ_VTX_CONSTANT_WORD2_0 = 0; - unsigned int uSQ_VTX_CONSTANT_WORD3_0 = 0; - unsigned int uSQ_VTX_CONSTANT_WORD6_0 = 0; - - if (!paos->bo) - return; - - if ((context->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV610) || - (context->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV620) || - (context->radeon.radeonScreen->chip_family == CHIP_FAMILY_RS780) || - (context->radeon.radeonScreen->chip_family == CHIP_FAMILY_RS880) || - (context->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV710)) - r700SyncSurf(context, paos->bo, RADEON_GEM_DOMAIN_GTT, 0, TC_ACTION_ENA_bit); - else - r700SyncSurf(context, paos->bo, RADEON_GEM_DOMAIN_GTT, 0, VC_ACTION_ENA_bit); - - uSQ_VTX_CONSTANT_WORD0_0 = paos->offset; - uSQ_VTX_CONSTANT_WORD1_0 = count * (size * 4) - 1; - - SETfield(uSQ_VTX_CONSTANT_WORD2_0, 0, BASE_ADDRESS_HI_shift, BASE_ADDRESS_HI_mask); /* TODO */ - SETfield(uSQ_VTX_CONSTANT_WORD2_0, stride, SQ_VTX_CONSTANT_WORD2_0__STRIDE_shift, - SQ_VTX_CONSTANT_WORD2_0__STRIDE_mask); - SETfield(uSQ_VTX_CONSTANT_WORD2_0, GetSurfaceFormat(GL_FLOAT, size, NULL), - SQ_VTX_CONSTANT_WORD2_0__DATA_FORMAT_shift, - SQ_VTX_CONSTANT_WORD2_0__DATA_FORMAT_mask); /* TODO : trace back api for initial data type, not only GL_FLOAT */ - SETfield(uSQ_VTX_CONSTANT_WORD2_0, SQ_NUM_FORMAT_SCALED, - SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_shift, SQ_VTX_CONSTANT_WORD2_0__NUM_FORMAT_ALL_mask); - SETbit(uSQ_VTX_CONSTANT_WORD2_0, SQ_VTX_CONSTANT_WORD2_0__FORMAT_COMP_ALL_bit); - - SETfield(uSQ_VTX_CONSTANT_WORD3_0, 1, MEM_REQUEST_SIZE_shift, MEM_REQUEST_SIZE_mask); - SETfield(uSQ_VTX_CONSTANT_WORD6_0, SQ_TEX_VTX_VALID_BUFFER, - SQ_TEX_RESOURCE_WORD6_0__TYPE_shift, SQ_TEX_RESOURCE_WORD6_0__TYPE_mask); - - BEGIN_BATCH_NO_AUTOSTATE(9 + 2); - - R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_RESOURCE, 7)); - R600_OUT_BATCH((nStreamID + SQ_FETCH_RESOURCE_VS_OFFSET) * FETCH_RESOURCE_STRIDE); - R600_OUT_BATCH(uSQ_VTX_CONSTANT_WORD0_0); - R600_OUT_BATCH(uSQ_VTX_CONSTANT_WORD1_0); - R600_OUT_BATCH(uSQ_VTX_CONSTANT_WORD2_0); - R600_OUT_BATCH(uSQ_VTX_CONSTANT_WORD3_0); - R600_OUT_BATCH(0); - R600_OUT_BATCH(0); - R600_OUT_BATCH(uSQ_VTX_CONSTANT_WORD6_0); - R600_OUT_BATCH_RELOC(uSQ_VTX_CONSTANT_WORD0_0, - paos->bo, - uSQ_VTX_CONSTANT_WORD0_0, - RADEON_GEM_DOMAIN_GTT, 0, 0); - END_BATCH(); - COMMIT_BATCH(); - -} - -extern int getTypeSize(GLenum type); -static void r700SetupVTXConstants2(GLcontext * ctx, - void * pAos, - StreamDesc * pStreamDesc) + StreamDesc * pStreamDesc) { context_t *context = R700_CONTEXT(ctx); struct radeon_aos * paos = (struct radeon_aos *)pAos; @@ -295,31 +228,6 @@ static void r700SetupVTXConstants2(GLcontext * ctx, } -void r700SetupStreams(GLcontext *ctx) -{ - context_t *context = R700_CONTEXT(ctx); - struct r700_vertex_program *vp = context->selected_vp; - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *vb = &tnl->vb; - unsigned int i, j = 0; - radeon_print(RADEON_STATE, RADEON_VERBOSE, "%s\n", __func__); - - R600_STATECHANGE(context, vtx); - - for(i=0; imesa_program->Base.InputsRead & (1 << i)) { - rcommon_emit_vector(ctx, - &context->radeon.tcl.aos[j], - vb->AttribPtr[i]->data, - vb->AttribPtr[i]->size, - vb->AttribPtr[i]->stride, - vb->Count); - j++; - } - } - context->radeon.tcl.aos_count = j; -} - static void r700SendVTXState(GLcontext *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); @@ -343,25 +251,12 @@ static void r700SendVTXState(GLcontext *ctx, struct radeon_state_atom *atom) COMMIT_BATCH(); for(i=0; imesa_program->Base.InputsRead & (1 << i)) - { - if(1 == context->selected_vp->uiVersion) - { - /* currently aos are packed */ - r700SetupVTXConstants(ctx, - i, - (void*)(&context->radeon.tcl.aos[j]), - (unsigned int)context->radeon.tcl.aos[j].components, - (unsigned int)context->radeon.tcl.aos[j].stride * 4, - (unsigned int)context->radeon.tcl.aos[j].count); - } - else - { /* context->selected_vp->uiVersion == 2 : aos not always packed */ - r700SetupVTXConstants2(ctx, - (void*)(&context->radeon.tcl.aos[j]), - &(context->stream_desc[j])); - } - j++; + if(vp->mesa_program->Base.InputsRead & (1 << i)) + { + r700SetupVTXConstants(ctx, + (void*)(&context->radeon.tcl.aos[j]), + &(context->stream_desc[j])); + j++; } } } diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c index c2e7680eae..3e1ce9fb72 100644 --- a/src/mesa/drivers/dri/r600/r700_render.c +++ b/src/mesa/drivers/dri/r600/r700_render.c @@ -550,7 +550,7 @@ static void r700AlignDataToDword(GLcontext *ctx, attr->stride = dst_stride; } -static void r700SetupStreams2(GLcontext *ctx, const struct gl_client_array *input[], int count) +static void r700SetupStreams(GLcontext *ctx, const struct gl_client_array *input[], int count) { context_t *context = R700_CONTEXT(ctx); GLuint stride; @@ -825,7 +825,7 @@ static GLboolean r700TryDrawPrims(GLcontext *ctx, _tnl_UpdateFixedFunctionProgram(ctx); r700SetVertexFormat(ctx, arrays, max_index + 1); /* shaders need to be updated before buffers are validated */ - r700UpdateShaders2(ctx); + r700UpdateShaders(ctx); if (!r600ValidateBuffers(ctx)) return GL_FALSE; @@ -845,7 +845,7 @@ static GLboolean r700TryDrawPrims(GLcontext *ctx, + context->radeon.cmdbuf.cs->cdw; r700SetupIndexBuffer(ctx, ib); - r700SetupStreams2(ctx, arrays, max_index + 1); + r700SetupStreams(ctx, arrays, max_index + 1); radeonEmitState(radeon); diff --git a/src/mesa/drivers/dri/r600/r700_shader.h b/src/mesa/drivers/dri/r600/r700_shader.h index 997cb05aaf..c6a058617e 100644 --- a/src/mesa/drivers/dri/r600/r700_shader.h +++ b/src/mesa/drivers/dri/r600/r700_shader.h @@ -128,6 +128,7 @@ typedef struct R700_Shader //Internal void AddInstToList(TypedShaderList * plstCFInstructions, R700ShaderInstruction * pInst); +void TakeInstOutFromList(TypedShaderList * plstCFInstructions, R700ShaderInstruction * pInst); void ResolveLinks(R700_Shader *pShader); void Assemble(R700_Shader *pShader); diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index 3d3c8b958f..9a6a68a68c 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -61,12 +61,9 @@ static void r700UpdatePolygonMode(GLcontext * ctx); static void r700SetPolygonOffsetState(GLcontext * ctx, GLboolean state); static void r700SetStencilState(GLcontext * ctx, GLboolean state); -void r700UpdateShaders (GLcontext * ctx) //---------------------------------- +void r700UpdateShaders(GLcontext * ctx) { context_t *context = R700_CONTEXT(ctx); - GLvector4f dummy_attrib[_TNL_ATTRIB_MAX]; - GLvector4f *temp_attrib[_TNL_ATTRIB_MAX]; - int i; /* should only happenen once, just after context is created */ /* TODO: shouldn't we fallback to sw here? */ @@ -77,40 +74,7 @@ void r700UpdateShaders (GLcontext * ctx) //---------------------------------- r700SelectFragmentShader(ctx); - if (context->radeon.NewGLState) { - for (i = _TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) { - /* mat states from state var not array for sw */ - dummy_attrib[i].stride = 0; - temp_attrib[i] = TNL_CONTEXT(ctx)->vb.AttribPtr[i]; - TNL_CONTEXT(ctx)->vb.AttribPtr[i] = &(dummy_attrib[i]); - } - - _tnl_UpdateFixedFunctionProgram(ctx); - - for (i = _TNL_FIRST_MAT; i <= _TNL_LAST_MAT; i++) { - TNL_CONTEXT(ctx)->vb.AttribPtr[i] = temp_attrib[i]; - } - } - - r700SelectVertexShader(ctx, 1); - r700UpdateStateParameters(ctx, _NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS); - context->radeon.NewGLState = 0; -} - -void r700UpdateShaders2(GLcontext * ctx) -{ - context_t *context = R700_CONTEXT(ctx); - - /* should only happenen once, just after context is created */ - /* TODO: shouldn't we fallback to sw here? */ - if (!ctx->FragmentProgram._Current) { - _mesa_fprintf(stderr, "No ctx->FragmentProgram._Current!!\n"); - return; - } - - r700SelectFragmentShader(ctx); - - r700SelectVertexShader(ctx, 2); + r700SelectVertexShader(ctx); r700UpdateStateParameters(ctx, _NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS); context->radeon.NewGLState = 0; } diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.c b/src/mesa/drivers/dri/r600/r700_vertprog.c index 65c2c3f811..c84b0ac059 100644 --- a/src/mesa/drivers/dri/r600/r700_vertprog.c +++ b/src/mesa/drivers/dri/r600/r700_vertprog.c @@ -203,22 +203,11 @@ void Map_Vertex_Program(GLcontext *ctx, pAsm->number_used_registers += num_inputs; // Create VFETCH instructions for inputs - if(1 == vp->uiVersion) - { - if (GL_TRUE != Process_Vertex_Program_Vfetch_Instructions(vp, mesa_vp) ) - { - radeon_error("Calling Process_Vertex_Program_Vfetch_Instructions return error. \n"); - return; - } - } - else - { - if (GL_TRUE != Process_Vertex_Program_Vfetch_Instructions2(ctx, vp, mesa_vp) ) - { - radeon_error("Calling Process_Vertex_Program_Vfetch_Instructions2 return error. \n"); - return; - } - } + if (GL_TRUE != Process_Vertex_Program_Vfetch_Instructions2(ctx, vp, mesa_vp) ) + { + radeon_error("Calling Process_Vertex_Program_Vfetch_Instructions2 return error. \n"); + return; + } // Map Outputs pAsm->number_of_exports = Map_Vertex_Output(pAsm, mesa_vp, pAsm->number_used_registers); @@ -228,7 +217,7 @@ void Map_Vertex_Program(GLcontext *ctx, pAsm->number_used_registers += pAsm->number_of_exports; pAsm->pucOutMask = (unsigned char*) MALLOC(pAsm->number_of_exports); - + for(ui=0; uinumber_of_exports; ui++) { pAsm->pucOutMask[ui] = 0x0; @@ -245,7 +234,7 @@ void Map_Vertex_Program(GLcontext *ctx, { /* fix func t_vp uses NumTemporaries */ pAsm->number_used_registers += mesa_vp->Base.NumTemporaries; } - + pAsm->uFirstHelpReg = pAsm->number_used_registers; } @@ -300,18 +289,13 @@ GLboolean Find_Instruction_Dependencies_vp(struct r700_vertex_program *vp, } struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, - struct gl_vertex_program *mesa_vp, - GLint nVer) + struct gl_vertex_program *mesa_vp) { context_t *context = R700_CONTEXT(ctx); struct r700_vertex_program *vp; - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *vb = &tnl->vb; - unsigned int unBit; unsigned int i; vp = _mesa_calloc(sizeof(*vp)); - vp->uiVersion = nVer; vp->mesa_program = (struct gl_vertex_program *)_mesa_clone_program(ctx, &mesa_vp->Base); if (mesa_vp->IsPositionInvariant) @@ -319,29 +303,13 @@ struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, _mesa_insert_mvp_code(ctx, vp->mesa_program); } - if( 1 == nVer ) + for(i=0; inNumActiveAos; i++) { - for(i=0; imesa_program->Base.InputsRead & unBit) /* ctx->Array.ArrayObj->xxxxxxx */ - { - vp->aos_desc[i].size = vb->AttribPtr[i]->size; - vp->aos_desc[i].stride = vb->AttribPtr[i]->size * sizeof(GL_FLOAT);/* when emit array, data is packed. vb->AttribPtr[i]->stride;*/ - vp->aos_desc[i].type = GL_FLOAT; - } - } + vp->aos_desc[i].size = context->stream_desc[i].size; + vp->aos_desc[i].stride = context->stream_desc[i].stride; + vp->aos_desc[i].type = context->stream_desc[i].type; } - else - { - for(i=0; inNumActiveAos; i++) - { - vp->aos_desc[i].size = context->stream_desc[i].size; - vp->aos_desc[i].stride = context->stream_desc[i].stride; - vp->aos_desc[i].type = context->stream_desc[i].type; - } - } - + if (context->radeon.radeonScreen->chip_family < CHIP_FAMILY_RV770) { vp->r700AsmCode.bR6xx = 1; @@ -354,14 +322,14 @@ struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, if(GL_FALSE == Find_Instruction_Dependencies_vp(vp, vp->mesa_program)) { return NULL; - } + } if(GL_FALSE == AssembleInstr(vp->mesa_program->Base.NumInstructions, - &(vp->mesa_program->Base.Instructions[0]), + &(vp->mesa_program->Base.Instructions[0]), &(vp->r700AsmCode)) ) { return NULL; - } + } if(GL_FALSE == Process_Vertex_Exports(&(vp->r700AsmCode), vp->mesa_program->Base.OutputsWritten) ) { @@ -378,14 +346,11 @@ struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, return vp; } -void r700SelectVertexShader(GLcontext *ctx, GLint nVersion) +void r700SelectVertexShader(GLcontext *ctx) { context_t *context = R700_CONTEXT(ctx); struct r700_vertex_program_cont *vpc; struct r700_vertex_program *vp; - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *vb = &tnl->vb; - unsigned int unBit; unsigned int i; GLboolean match; GLbitfield InputsRead; @@ -396,47 +361,27 @@ void r700SelectVertexShader(GLcontext *ctx, GLint nVersion) if (vpc->mesa_program.IsPositionInvariant) { InputsRead |= VERT_BIT_POS; - } - + } + for (vp = vpc->progs; vp; vp = vp->next) { - if (vp->uiVersion != nVersion ) - continue; - match = GL_TRUE; - if ( 1 == nVersion ) + match = GL_TRUE; + for(i=0; inNumActiveAos; i++) { - for(i=0; iaos_desc[i].size != context->stream_desc[i].size) { - if (vp->aos_desc[i].size != vb->AttribPtr[i]->size) - { match = GL_FALSE; break; - } } - } } - else - { - for(i=0; inNumActiveAos; i++) - { - if (vp->aos_desc[i].size != context->stream_desc[i].size) - { - match = GL_FALSE; - break; - } - } - } - if (match) + if (match) { context->selected_vp = vp; return; } } - vp = r700TranslateVertexShader(ctx, &(vpc->mesa_program), nVersion); + vp = r700TranslateVertexShader(ctx, &(vpc->mesa_program)); if(!vp) { radeon_error("Failed to translate vertex shader. \n"); diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.h b/src/mesa/drivers/dri/r600/r700_vertprog.h index f9a3e395ee..00824c29d3 100644 --- a/src/mesa/drivers/dri/r600/r700_vertprog.h +++ b/src/mesa/drivers/dri/r600/r700_vertprog.h @@ -52,8 +52,7 @@ struct r700_vertex_program GLboolean translated; GLboolean loaded; - GLint uiVersion; - + void * shaderbo; ArrayDesc aos_desc[VERT_ATTRIB_MAX]; @@ -87,11 +86,10 @@ GLboolean Find_Instruction_Dependencies_vp(struct r700_vertex_program *vp, struct gl_vertex_program *mesa_vp); struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, - struct gl_vertex_program *mesa_vp, - GLint nVer); + struct gl_vertex_program *mesa_vp); /* Interface */ -extern void r700SelectVertexShader(GLcontext *ctx, GLint nVersion); +extern void r700SelectVertexShader(GLcontext *ctx); extern void r700SetVertexFormat(GLcontext *ctx, const struct gl_client_array *arrays[], int count); extern GLboolean r700SetupVertexProgram(GLcontext * ctx); -- cgit v1.2.3 From 4e1d51786e0657c7430d731ac464f2a73e32eddf Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Fri, 23 Oct 2009 13:49:04 +0100 Subject: gallium: remove noise opcodes Provide a dummy implementation in the GL state tracker (move 0.5 to the destination regs). At some point, a motivated person could add a better implementation of noise. Currently not even the nvidia binary drivers do anything more than this. In any case, the place to do this is in the GL state tracker, not the poor driver. --- src/mesa/state_tracker/st_mesa_to_tgsi.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c index 70d7c4fee2..1b9d35d353 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -481,14 +481,6 @@ translate_opcode( unsigned op ) return TGSI_OPCODE_MOV; case OPCODE_MUL: return TGSI_OPCODE_MUL; - case OPCODE_NOISE1: - return TGSI_OPCODE_NOISE1; - case OPCODE_NOISE2: - return TGSI_OPCODE_NOISE2; - case OPCODE_NOISE3: - return TGSI_OPCODE_NOISE3; - case OPCODE_NOISE4: - return TGSI_OPCODE_NOISE4; case OPCODE_NOP: return TGSI_OPCODE_NOP; case OPCODE_NRM3: @@ -616,6 +608,21 @@ compile_instruction( src, num_src ); break; + case OPCODE_NOISE1: + case OPCODE_NOISE2: + case OPCODE_NOISE3: + case OPCODE_NOISE4: + /* At some point, a motivated person could add a better + * implementation of noise. Currently not even the nvidia + * binary drivers do anything more than this. In any case, the + * place to do this is in the GL state tracker, not the poor + * driver. + */ + ureg_MOV( ureg, dst[0], ureg_imm1f(ureg, 0.5) ); + break; + + + default: ureg_insn( ureg, translate_opcode( inst->Opcode ), -- cgit v1.2.3 From b9cb74c7f826dfd320f5e5b54aa933898f7ddd3d Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Fri, 23 Oct 2009 14:31:24 +0100 Subject: gallium: remove the swizzling parts of ExtSwizzle These haven't been used by the mesa state tracker since the conversion to tgsi_ureg, and it seems that none of the other state trackers are using it either. This helps simplify one of the biggest suprises when starting off with TGSI shaders. --- src/mesa/state_tracker/st_mesa_to_tgsi.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c index 1b9d35d353..3d6c215819 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -515,8 +515,6 @@ translate_opcode( unsigned op ) return TGSI_OPCODE_SSG; case OPCODE_SUB: return TGSI_OPCODE_SUB; - case OPCODE_SWZ: - return TGSI_OPCODE_SWZ; case OPCODE_TEX: return TGSI_OPCODE_TEX; case OPCODE_TXB: -- cgit v1.2.3 From 738b394769bb95036635f7a00a1ef08890c5be63 Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Fri, 23 Oct 2009 14:25:09 +0300 Subject: r600: for position invariant programs reading vert_pos is not always known at this point --- src/mesa/drivers/dri/r600/r700_vertprog.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.c b/src/mesa/drivers/dri/r600/r700_vertprog.c index c84b0ac059..ffc6068bd8 100644 --- a/src/mesa/drivers/dri/r600/r700_vertprog.c +++ b/src/mesa/drivers/dri/r600/r700_vertprog.c @@ -515,6 +515,11 @@ void r700SetVertexFormat(GLcontext *ctx, const struct gl_client_array *arrays[], unsigned int unBit = mesa_vp->Base.InputsRead; context->nNumActiveAos = 0; + if (mesa_vp->IsPositionInvariant) + { + unBit |= VERT_BIT_POS; + } + while(unBit) { if(unBit & 1) -- cgit v1.2.3 From d4d4733e6c312f2a8e9977b06fc554904407c456 Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Fri, 23 Oct 2009 16:44:31 +0300 Subject: r600: remove duplicate stride setting Stride is set already in r700SetVertexFormat and there it works correctly for 0 also --- src/mesa/drivers/dri/r600/r700_render.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c index 3e1ce9fb72..9cf984f966 100644 --- a/src/mesa/drivers/dri/r600/r700_render.c +++ b/src/mesa/drivers/dri/r600/r700_render.c @@ -618,19 +618,15 @@ static void r700SetupStreams(GLcontext *ctx, const struct gl_client_array *input { case 1: radeonEmitVec4(dst, input[i]->Ptr, input[i]->StrideB, local_count); - context->stream_desc[index].stride = 4; break; case 2: radeonEmitVec8(dst, input[i]->Ptr, input[i]->StrideB, local_count); - context->stream_desc[index].stride = 8; break; case 3: radeonEmitVec12(dst, input[i]->Ptr, input[i]->StrideB, local_count); - context->stream_desc[index].stride = 12; break; case 4: radeonEmitVec16(dst, input[i]->Ptr, input[i]->StrideB, local_count); - context->stream_desc[index].stride = 16; break; default: assert(0); -- cgit v1.2.3 From d7d3fb925b6993740d0126d0d7e678c27f5f1850 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Thu, 8 Oct 2009 10:33:32 +0800 Subject: mesa/main: Add support for remap table. This commit only adds the source files. It is supposed to replace the remap table in DRI drivers. Signed-off-by: Chia-I Wu --- src/mesa/glapi/Makefile | 4 + src/mesa/glapi/remap_helper.py | 219 ++ src/mesa/main/mfeatures.h | 6 + src/mesa/main/remap.c | 216 ++ src/mesa/main/remap.h | 87 + src/mesa/main/remap_helper.h | 5884 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 6416 insertions(+) create mode 100644 src/mesa/glapi/remap_helper.py create mode 100644 src/mesa/main/remap.c create mode 100644 src/mesa/main/remap.h create mode 100644 src/mesa/main/remap_helper.h (limited to 'src/mesa') diff --git a/src/mesa/glapi/Makefile b/src/mesa/glapi/Makefile index 22f65b74c2..08c376a4b0 100644 --- a/src/mesa/glapi/Makefile +++ b/src/mesa/glapi/Makefile @@ -9,6 +9,7 @@ include $(TOP)/configs/current OUTPUTS = glprocs.h glapitemp.h glapioffsets.h glapitable.h dispatch.h \ ../main/enums.c \ + ../main/remap_helper.h \ ../x86/glapi_x86.S \ ../x86-64/glapi_x86-64.S \ ../sparc/glapi_sparc.S \ @@ -92,6 +93,9 @@ dispatch.h $(GLX_DIR)/dispatch.h: gl_table.py $(COMMON) ../main/enums.c: gl_enums.py $(COMMON) $(PYTHON2) $(PYTHON_FLAGS) $< > $@ +../main/remap_helper.h: remap_helper.py $(COMMON) + $(PYTHON2) $(PYTHON_FLAGS) $< > $@ + ../x86/glapi_x86.S: gl_x86_asm.py $(COMMON) $(PYTHON2) $(PYTHON_FLAGS) $< > $@ diff --git a/src/mesa/glapi/remap_helper.py b/src/mesa/glapi/remap_helper.py new file mode 100644 index 0000000000..7e68a908e3 --- /dev/null +++ b/src/mesa/glapi/remap_helper.py @@ -0,0 +1,219 @@ +#!/usr/bin/env python + +# Copyright (C) 2009 Chia-I Wu +# All Rights Reserved. +# +# This is based on extension_helper.py by Ian Romanick. +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# on the rights to use, copy, modify, merge, publish, distribute, sub +# license, and/or sell copies of the Software, and to permit persons to whom +# the Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice (including the next +# paragraph) shall be included in all copies or substantial portions of the +# Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +# IBM AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN 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. + +import gl_XML +import license +import sys, getopt, string + +def get_function_spec(func): + sig = "" + # derive parameter signature + for p in func.parameterIterator(): + if p.is_padding: + continue + # FIXME: This is a *really* ugly hack. :( + tn = p.type_expr.get_base_type_node() + if p.is_pointer(): + sig += 'p' + elif tn.integer: + sig += 'i' + elif tn.size == 4: + sig += 'f' + else: + sig += 'd' + + spec = [sig] + for ent in func.entry_points: + spec.append("gl" + ent) + + # spec is terminated by an empty string + spec.append('') + + return spec + +class PrintGlRemap(gl_XML.gl_print_base): + def __init__(self): + gl_XML.gl_print_base.__init__(self) + + self.name = "remap_helper.py (from Mesa)" + self.license = license.bsd_license_template % ("Copyright (C) 2009 Chia-I Wu ", "Chia-I Wu") + return + + + def printRealHeader(self): + print '#include "glapi/dispatch.h"' + print '#include "glapi/glapioffsets.h"' + print '' + return + + + def printBody(self, api): + print 'struct gl_function_remap {' + print ' GLint func_index;' + print ' GLint dispatch_offset; /* for sanity check */' + print '};' + print '' + + pool_indices = {} + + print '/* this is internal to remap.c */' + print '#ifdef need_MESA_remap_table' + print '' + print 'static const char _mesa_function_pool[] =' + + # output string pool + index = 0; + for f in api.functionIterateAll(): + pool_indices[f] = index + + spec = get_function_spec(f) + + # a function has either assigned offset, fixed offset, + # or no offset + if f.assign_offset: + comments = "will be remapped" + elif f.offset > 0: + comments = "offset %d" % f.offset + else: + comments = "dynamic" + + print ' /* _mesa_function_pool[%d]: %s (%s) */' \ + % (index, f.name, comments) + for line in spec: + print ' "%s\\0"' % line + index += len(line) + 1 + print ' ;' + print '' + + print '/* these functions need to be remapped */' + print 'static const struct {' + print ' GLint pool_index;' + print ' GLint remap_index;' + print '} MESA_remap_table_functions[] = {' + # output all functions that need to be remapped + # iterate by offsets so that they are sorted by remap indices + for f in api.functionIterateByOffset(): + if not f.assign_offset: + continue + print ' { %5d, %s_remap_index },' \ + % (pool_indices[f], f.name) + print ' { -1, -1 }' + print '};' + print '' + + abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ] + extension_functions = {} + + # collect non-ABI functions + for f in api.functionIterateAll(): + for n in f.entry_points: + category, num = api.get_category_for_name(n) + if category not in abi: + c = gl_XML.real_category_name(category) + if not extension_functions.has_key(c): + extension_functions[c] = [] + extension_functions[c].append(f) + extensions = extension_functions.keys() + extensions.sort() + + # output ABI functions that have alternative names (with ext suffix) + print '/* these functions are in the ABI, but have alternative names */' + print 'static const struct gl_function_remap MESA_alt_functions[] = {' + for ext in extensions: + funcs = [] + for f in extension_functions[ext]: + # test if the function is in the ABI + if not f.assign_offset and f.offset >= 0: + funcs.append(f) + if not funcs: + continue + print ' /* from %s */' % ext + for f in funcs: + print ' { %5d, _gloffset_%s },' \ + % (pool_indices[f], f.name) + print ' { -1, -1 }' + print '};' + print '' + + print '#endif /* need_MESA_remap_table */' + print '' + + # output remap helpers for DRI drivers + + for ext in extensions: + funcs = [] + remapped = [] + for f in extension_functions[ext]: + if f.assign_offset: + # these are handled above + remapped.append(f) + else: + # these functions are either in the + # abi, or have offset -1 + funcs.append(f) + + print '#if defined(need_%s)' % (ext) + if remapped: + print '/* functions defined in MESA_remap_table_functions are excluded */' + + # output extension functions that need to be mapped + print 'static const struct gl_function_remap %s_functions[] = {' % (ext) + for f in funcs: + if f.offset >= 0: + print ' { %5d, _gloffset_%s },' \ + % (pool_indices[f], f.name) + else: + print ' { %5d, -1 }, /* %s */' % \ + (pool_indices[f], f.name) + print ' { -1, -1 }' + print '};' + + print '#endif' + print '' + + return + + +def show_usage(): + print "Usage: %s [-f input_file_name]" % sys.argv[0] + sys.exit(1) + +if __name__ == '__main__': + file_name = "gl_API.xml" + + try: + (args, trail) = getopt.getopt(sys.argv[1:], "f:") + except Exception,e: + show_usage() + + for (arg,val) in args: + if arg == "-f": + file_name = val + + api = gl_XML.parse_GL_API( file_name ) + + printer = PrintGlRemap() + printer.Print( api ) diff --git a/src/mesa/main/mfeatures.h b/src/mesa/main/mfeatures.h index c2fb8404b1..4e68bc15d8 100644 --- a/src/mesa/main/mfeatures.h +++ b/src/mesa/main/mfeatures.h @@ -68,6 +68,12 @@ * enabled or not. */ +#ifdef IN_DRI_DRIVER +#define FEATURE_remap_table 1 +#else +#define FEATURE_remap_table 0 +#endif + #define FEATURE_accum _HAVE_FULL_GL #define FEATURE_arrayelt _HAVE_FULL_GL #define FEATURE_attrib_stack _HAVE_FULL_GL diff --git a/src/mesa/main/remap.c b/src/mesa/main/remap.c new file mode 100644 index 0000000000..0385ae8d7d --- /dev/null +++ b/src/mesa/main/remap.c @@ -0,0 +1,216 @@ +/* + * Mesa 3-D graphics library + * Version: 7.7 + * + * Copyright (C) 2009 Chia-I Wu + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * 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 remap.c + * Remap table management. + * + * Entries in the dispatch table are either static or dynamic. The + * dispatch table is shared by mesa core and glapi. When they are + * built separately, it is possible that a static entry in mesa core + * is dynamic, or assigned a different static offset, in glapi. The + * remap table is in charge of mapping a static entry in mesa core to + * a dynamic entry, or the corresponding static entry, in glapi. + */ + +#include "remap.h" +#include "imports.h" + +#include "glapi/dispatch.h" + + +#if FEATURE_remap_table + + +#define need_MESA_remap_table +#include "remap_helper.h" + +#define ARRAY_SIZE(a) (sizeof (a) / sizeof ((a)[0])) +#define MAX_ENTRY_POINTS 16 + + +/* this is global for quick access */ +int driDispatchRemapTable[driDispatchRemapTable_size]; + + +/** + * Return the spec string associated with the given function index. + * The index is available from including remap_helper.h. + * + * \param func_index an opaque function index. + * + * \return the spec string associated with the function index, or NULL. + */ +const char * +_mesa_get_function_spec(GLint func_index) +{ + if (func_index < ARRAY_SIZE(_mesa_function_pool)) + return _mesa_function_pool + func_index; + else + return NULL; +} + + +/** + * Map a function by its spec. The function will be added to glapi, + * and the dispatch offset will be returned. + * + * \param spec a '\0'-separated string array specifying a function. + * It begins with the parameter signature of the function, + * followed by the names of the entry points. An empty entry + * point name terminates the array. + * + * \return the offset of the (re-)mapped function in the dispatch + * table, or -1. + */ +GLint +_mesa_map_function_spec(const char *spec) +{ + const char *signature; + const char *names[MAX_ENTRY_POINTS + 1]; + GLint num_names = 0; + + if (!spec) + return -1; + + signature = spec; + spec += strlen(spec) + 1; + + /* spec is terminated by an empty string */ + while (*spec) { + names[num_names] = spec; + num_names++; + if (num_names >= MAX_ENTRY_POINTS) + break; + spec += strlen(spec) + 1; + } + if (!num_names) + return -1; + + names[num_names] = NULL; + + /* add the entry points to the dispatch table */ + return _glapi_add_dispatch(names, signature); +} + + +/** + * Map an array of functions. This is a convenient function for + * use with arrays available from including remap_helper.h. + * + * Note that the dispatch offsets of the functions are not returned. + * If they are needed, _mesa_map_function_spec() should be used. + * + * \param func_array an array of function remaps. + */ +void +_mesa_map_function_array(const struct gl_function_remap *func_array) +{ + GLint i; + + if (!func_array) + return; + + for (i = 0; func_array[i].func_index != -1; i++) { + const char *spec; + GLint offset; + + spec = _mesa_get_function_spec(func_array[i].func_index); + if (!spec) { + _mesa_problem(NULL, "invalid function index %d", + func_array[i].func_index); + continue; + } + + offset = _mesa_map_function_spec(spec); + /* error checks */ + if (offset < 0) { + const char *name = spec + strlen(spec) + 1; + _mesa_warning(NULL, "failed to remap %s", name); + } + else if (func_array[i].dispatch_offset >= 0 && + offset != func_array[i].dispatch_offset) { + const char *name = spec + strlen(spec) + 1; + _mesa_problem(NULL, "%s should be mapped to %d, not %d", + name, func_array[i].dispatch_offset, offset); + } + } +} + + +/** + * Map the functions which are already static. + * + * When a extension function are incorporated into the ABI, the + * extension suffix is usually stripped. Mapping such functions + * makes sure the alternative names are available. + * + * Note that functions mapped by _mesa_init_remap_table() are + * excluded. + */ +void +_mesa_map_static_functions(void) +{ + /* Remap static functions which have alternative names and are in the ABI. + * This is to be on the safe side. glapi should have defined those names. + */ + _mesa_map_function_array(MESA_alt_functions); +} + + +/** + * Initialize the remap table. This is called in one_time_init(). + * The remap table needs to be initialized before calling the + * CALL/GET/SET macros defined in glapi/dispatch.h. + */ +void +_mesa_init_remap_table(void) +{ + static GLboolean initialized = GL_FALSE; + GLint i; + + if (initialized) + return; + initialized = GL_TRUE; + + /* initialize the remap table */ + for (i = 0; i < ARRAY_SIZE(driDispatchRemapTable); i++) { + GLint offset; + const char *spec; + + /* sanity check */ + ASSERT(i == MESA_remap_table_functions[i].remap_index); + spec = _mesa_function_pool + MESA_remap_table_functions[i].pool_index; + + offset = _mesa_map_function_spec(spec); + /* store the dispatch offset in the remap table */ + driDispatchRemapTable[i] = offset; + if (offset < 0) + _mesa_warning(NULL, "failed to remap index %d", i); + } +} + + +#endif /* FEATURE_remap_table */ diff --git a/src/mesa/main/remap.h b/src/mesa/main/remap.h new file mode 100644 index 0000000000..7fb56e3600 --- /dev/null +++ b/src/mesa/main/remap.h @@ -0,0 +1,87 @@ +/* + * Mesa 3-D graphics library + * Version: 7.7 + * + * Copyright (C) 2009 Chia-I Wu + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * 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. + */ + + +#ifndef REMAP_H +#define REMAP_H + + +#include "main/mtypes.h" + +struct gl_function_remap; + + +#if FEATURE_remap_table + +extern int +driDispatchRemapTable[]; + +extern const char * +_mesa_get_function_spec(GLint func_index); + +extern GLint +_mesa_map_function_spec(const char *spec); + +extern void +_mesa_map_function_array(const struct gl_function_remap *func_array); + +extern void +_mesa_map_static_functions(void); + +extern void +_mesa_init_remap_table(void); + +#else /* FEATURE_remap_table */ + +static INLINE const char * +_mesa_get_function_spec(GLint func_index) +{ + return NULL; +} + +static INLINE GLint +_mesa_map_function_spec(const char *spec) +{ + return -1; +} + +static INLINE void +_mesa_map_function_array(const struct gl_function_remap *func_array) +{ +} + +static INLINE void +_mesa_map_static_functions(void) +{ +} + +static INLINE void +_mesa_init_remap_table(void) +{ +} + +#endif /* FEATURE_remap_table */ + + +#endif /* REMAP_H */ diff --git a/src/mesa/main/remap_helper.h b/src/mesa/main/remap_helper.h new file mode 100644 index 0000000000..89192d37e5 --- /dev/null +++ b/src/mesa/main/remap_helper.h @@ -0,0 +1,5884 @@ +/* DO NOT EDIT - This file generated automatically by remap_helper.py (from Mesa) script */ + +/* + * Copyright (C) 2009 Chia-I Wu + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * Chia-I Wu, + * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN 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. + */ + +#include "glapi/dispatch.h" +#include "glapi/glapioffsets.h" + +struct gl_function_remap { + GLint func_index; + GLint dispatch_offset; /* for sanity check */ +}; + +/* this is internal to remap.c */ +#ifdef need_MESA_remap_table + +static const char _mesa_function_pool[] = + /* _mesa_function_pool[0]: MapGrid1d (offset 224) */ + "idd\0" + "glMapGrid1d\0" + "\0" + /* _mesa_function_pool[17]: UniformMatrix3fvARB (will be remapped) */ + "iiip\0" + "glUniformMatrix3fv\0" + "glUniformMatrix3fvARB\0" + "\0" + /* _mesa_function_pool[64]: MapGrid1f (offset 225) */ + "iff\0" + "glMapGrid1f\0" + "\0" + /* _mesa_function_pool[81]: RasterPos4i (offset 82) */ + "iiii\0" + "glRasterPos4i\0" + "\0" + /* _mesa_function_pool[101]: RasterPos4d (offset 78) */ + "dddd\0" + "glRasterPos4d\0" + "\0" + /* _mesa_function_pool[121]: NewList (dynamic) */ + "ii\0" + "glNewList\0" + "\0" + /* _mesa_function_pool[135]: RasterPos4f (offset 80) */ + "ffff\0" + "glRasterPos4f\0" + "\0" + /* _mesa_function_pool[155]: LoadIdentity (offset 290) */ + "\0" + "glLoadIdentity\0" + "\0" + /* _mesa_function_pool[172]: SampleCoverageARB (will be remapped) */ + "fi\0" + "glSampleCoverage\0" + "glSampleCoverageARB\0" + "\0" + /* _mesa_function_pool[213]: ConvolutionFilter1D (offset 348) */ + "iiiiip\0" + "glConvolutionFilter1D\0" + "glConvolutionFilter1DEXT\0" + "\0" + /* _mesa_function_pool[268]: BeginQueryARB (will be remapped) */ + "ii\0" + "glBeginQuery\0" + "glBeginQueryARB\0" + "\0" + /* _mesa_function_pool[301]: RasterPos3dv (offset 71) */ + "p\0" + "glRasterPos3dv\0" + "\0" + /* _mesa_function_pool[319]: PointParameteriNV (will be remapped) */ + "ii\0" + "glPointParameteri\0" + "glPointParameteriNV\0" + "\0" + /* _mesa_function_pool[361]: GetProgramiv (will be remapped) */ + "iip\0" + "glGetProgramiv\0" + "\0" + /* _mesa_function_pool[381]: MultiTexCoord3sARB (offset 398) */ + "iiii\0" + "glMultiTexCoord3s\0" + "glMultiTexCoord3sARB\0" + "\0" + /* _mesa_function_pool[426]: SecondaryColor3iEXT (will be remapped) */ + "iii\0" + "glSecondaryColor3i\0" + "glSecondaryColor3iEXT\0" + "\0" + /* _mesa_function_pool[472]: WindowPos3fMESA (will be remapped) */ + "fff\0" + "glWindowPos3f\0" + "glWindowPos3fARB\0" + "glWindowPos3fMESA\0" + "\0" + /* _mesa_function_pool[526]: TexCoord1iv (offset 99) */ + "p\0" + "glTexCoord1iv\0" + "\0" + /* _mesa_function_pool[543]: TexCoord4sv (offset 125) */ + "p\0" + "glTexCoord4sv\0" + "\0" + /* _mesa_function_pool[560]: RasterPos4s (offset 84) */ + "iiii\0" + "glRasterPos4s\0" + "\0" + /* _mesa_function_pool[580]: PixelTexGenParameterfvSGIS (will be remapped) */ + "ip\0" + "glPixelTexGenParameterfvSGIS\0" + "\0" + /* _mesa_function_pool[613]: ActiveTextureARB (offset 374) */ + "i\0" + "glActiveTexture\0" + "glActiveTextureARB\0" + "\0" + /* _mesa_function_pool[651]: BlitFramebufferEXT (will be remapped) */ + "iiiiiiiiii\0" + "glBlitFramebuffer\0" + "glBlitFramebufferEXT\0" + "\0" + /* _mesa_function_pool[702]: TexCoord1f (offset 96) */ + "f\0" + "glTexCoord1f\0" + "\0" + /* _mesa_function_pool[718]: TexCoord1d (offset 94) */ + "d\0" + "glTexCoord1d\0" + "\0" + /* _mesa_function_pool[734]: VertexAttrib4ubvNV (will be remapped) */ + "ip\0" + "glVertexAttrib4ubvNV\0" + "\0" + /* _mesa_function_pool[759]: TexCoord1i (offset 98) */ + "i\0" + "glTexCoord1i\0" + "\0" + /* _mesa_function_pool[775]: GetProgramNamedParameterdvNV (will be remapped) */ + "iipp\0" + "glGetProgramNamedParameterdvNV\0" + "\0" + /* _mesa_function_pool[812]: Histogram (offset 367) */ + "iiii\0" + "glHistogram\0" + "glHistogramEXT\0" + "\0" + /* _mesa_function_pool[845]: TexCoord1s (offset 100) */ + "i\0" + "glTexCoord1s\0" + "\0" + /* _mesa_function_pool[861]: GetMapfv (offset 267) */ + "iip\0" + "glGetMapfv\0" + "\0" + /* _mesa_function_pool[877]: EvalCoord1f (offset 230) */ + "f\0" + "glEvalCoord1f\0" + "\0" + /* _mesa_function_pool[894]: TexImage4DSGIS (dynamic) */ + "iiiiiiiiiip\0" + "glTexImage4DSGIS\0" + "\0" + /* _mesa_function_pool[924]: PolygonStipple (offset 175) */ + "p\0" + "glPolygonStipple\0" + "\0" + /* _mesa_function_pool[944]: WindowPos2dvMESA (will be remapped) */ + "p\0" + "glWindowPos2dv\0" + "glWindowPos2dvARB\0" + "glWindowPos2dvMESA\0" + "\0" + /* _mesa_function_pool[999]: ReplacementCodeuiColor3fVertex3fvSUN (dynamic) */ + "ppp\0" + "glReplacementCodeuiColor3fVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[1043]: BlendEquationSeparateEXT (will be remapped) */ + "ii\0" + "glBlendEquationSeparate\0" + "glBlendEquationSeparateEXT\0" + "glBlendEquationSeparateATI\0" + "\0" + /* _mesa_function_pool[1125]: ListParameterfSGIX (dynamic) */ + "iif\0" + "glListParameterfSGIX\0" + "\0" + /* _mesa_function_pool[1151]: SecondaryColor3bEXT (will be remapped) */ + "iii\0" + "glSecondaryColor3b\0" + "glSecondaryColor3bEXT\0" + "\0" + /* _mesa_function_pool[1197]: TexCoord4fColor4fNormal3fVertex4fvSUN (dynamic) */ + "pppp\0" + "glTexCoord4fColor4fNormal3fVertex4fvSUN\0" + "\0" + /* _mesa_function_pool[1243]: GetPixelMapfv (offset 271) */ + "ip\0" + "glGetPixelMapfv\0" + "\0" + /* _mesa_function_pool[1263]: Color3uiv (offset 22) */ + "p\0" + "glColor3uiv\0" + "\0" + /* _mesa_function_pool[1278]: IsEnabled (offset 286) */ + "i\0" + "glIsEnabled\0" + "\0" + /* _mesa_function_pool[1293]: VertexAttrib4svNV (will be remapped) */ + "ip\0" + "glVertexAttrib4svNV\0" + "\0" + /* _mesa_function_pool[1317]: EvalCoord2fv (offset 235) */ + "p\0" + "glEvalCoord2fv\0" + "\0" + /* _mesa_function_pool[1335]: GetBufferSubDataARB (will be remapped) */ + "iiip\0" + "glGetBufferSubData\0" + "glGetBufferSubDataARB\0" + "\0" + /* _mesa_function_pool[1382]: BufferSubDataARB (will be remapped) */ + "iiip\0" + "glBufferSubData\0" + "glBufferSubDataARB\0" + "\0" + /* _mesa_function_pool[1423]: TexCoord2fColor4ubVertex3fvSUN (dynamic) */ + "ppp\0" + "glTexCoord2fColor4ubVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[1461]: AttachShader (will be remapped) */ + "ii\0" + "glAttachShader\0" + "\0" + /* _mesa_function_pool[1480]: VertexAttrib2fARB (will be remapped) */ + "iff\0" + "glVertexAttrib2f\0" + "glVertexAttrib2fARB\0" + "\0" + /* _mesa_function_pool[1522]: GetDebugLogLengthMESA (dynamic) */ + "iii\0" + "glGetDebugLogLengthMESA\0" + "\0" + /* _mesa_function_pool[1551]: GetMapiv (offset 268) */ + "iip\0" + "glGetMapiv\0" + "\0" + /* _mesa_function_pool[1567]: VertexAttrib3fARB (will be remapped) */ + "ifff\0" + "glVertexAttrib3f\0" + "glVertexAttrib3fARB\0" + "\0" + /* _mesa_function_pool[1610]: Indexubv (offset 316) */ + "p\0" + "glIndexubv\0" + "\0" + /* _mesa_function_pool[1624]: GetQueryivARB (will be remapped) */ + "iip\0" + "glGetQueryiv\0" + "glGetQueryivARB\0" + "\0" + /* _mesa_function_pool[1658]: TexImage3D (offset 371) */ + "iiiiiiiiip\0" + "glTexImage3D\0" + "glTexImage3DEXT\0" + "\0" + /* _mesa_function_pool[1699]: ReplacementCodeuiVertex3fvSUN (dynamic) */ + "pp\0" + "glReplacementCodeuiVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[1735]: EdgeFlagPointer (offset 312) */ + "ip\0" + "glEdgeFlagPointer\0" + "\0" + /* _mesa_function_pool[1757]: Color3ubv (offset 20) */ + "p\0" + "glColor3ubv\0" + "\0" + /* _mesa_function_pool[1772]: GetQueryObjectivARB (will be remapped) */ + "iip\0" + "glGetQueryObjectiv\0" + "glGetQueryObjectivARB\0" + "\0" + /* _mesa_function_pool[1818]: Vertex3dv (offset 135) */ + "p\0" + "glVertex3dv\0" + "\0" + /* _mesa_function_pool[1833]: ReplacementCodeuiTexCoord2fVertex3fvSUN (dynamic) */ + "ppp\0" + "glReplacementCodeuiTexCoord2fVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[1880]: CompressedTexSubImage2DARB (will be remapped) */ + "iiiiiiiip\0" + "glCompressedTexSubImage2D\0" + "glCompressedTexSubImage2DARB\0" + "\0" + /* _mesa_function_pool[1946]: CombinerOutputNV (will be remapped) */ + "iiiiiiiiii\0" + "glCombinerOutputNV\0" + "\0" + /* _mesa_function_pool[1977]: VertexAttribs3fvNV (will be remapped) */ + "iip\0" + "glVertexAttribs3fvNV\0" + "\0" + /* _mesa_function_pool[2003]: Uniform2fARB (will be remapped) */ + "iff\0" + "glUniform2f\0" + "glUniform2fARB\0" + "\0" + /* _mesa_function_pool[2035]: LightModeliv (offset 166) */ + "ip\0" + "glLightModeliv\0" + "\0" + /* _mesa_function_pool[2054]: VertexAttrib1svARB (will be remapped) */ + "ip\0" + "glVertexAttrib1sv\0" + "glVertexAttrib1svARB\0" + "\0" + /* _mesa_function_pool[2097]: VertexAttribs1dvNV (will be remapped) */ + "iip\0" + "glVertexAttribs1dvNV\0" + "\0" + /* _mesa_function_pool[2123]: Uniform2ivARB (will be remapped) */ + "iip\0" + "glUniform2iv\0" + "glUniform2ivARB\0" + "\0" + /* _mesa_function_pool[2157]: GetImageTransformParameterfvHP (dynamic) */ + "iip\0" + "glGetImageTransformParameterfvHP\0" + "\0" + /* _mesa_function_pool[2195]: Normal3bv (offset 53) */ + "p\0" + "glNormal3bv\0" + "\0" + /* _mesa_function_pool[2210]: TexGeniv (offset 193) */ + "iip\0" + "glTexGeniv\0" + "\0" + /* _mesa_function_pool[2226]: WeightubvARB (dynamic) */ + "ip\0" + "glWeightubvARB\0" + "\0" + /* _mesa_function_pool[2245]: VertexAttrib1fvNV (will be remapped) */ + "ip\0" + "glVertexAttrib1fvNV\0" + "\0" + /* _mesa_function_pool[2269]: Vertex3iv (offset 139) */ + "p\0" + "glVertex3iv\0" + "\0" + /* _mesa_function_pool[2284]: CopyConvolutionFilter1D (offset 354) */ + "iiiii\0" + "glCopyConvolutionFilter1D\0" + "glCopyConvolutionFilter1DEXT\0" + "\0" + /* _mesa_function_pool[2346]: ReplacementCodeuiNormal3fVertex3fSUN (dynamic) */ + "iffffff\0" + "glReplacementCodeuiNormal3fVertex3fSUN\0" + "\0" + /* _mesa_function_pool[2394]: DeleteSync (will be remapped) */ + "i\0" + "glDeleteSync\0" + "\0" + /* _mesa_function_pool[2410]: FragmentMaterialfvSGIX (dynamic) */ + "iip\0" + "glFragmentMaterialfvSGIX\0" + "\0" + /* _mesa_function_pool[2440]: BlendColor (offset 336) */ + "ffff\0" + "glBlendColor\0" + "glBlendColorEXT\0" + "\0" + /* _mesa_function_pool[2475]: UniformMatrix4fvARB (will be remapped) */ + "iiip\0" + "glUniformMatrix4fv\0" + "glUniformMatrix4fvARB\0" + "\0" + /* _mesa_function_pool[2522]: DeleteVertexArraysAPPLE (will be remapped) */ + "ip\0" + "glDeleteVertexArrays\0" + "glDeleteVertexArraysAPPLE\0" + "\0" + /* _mesa_function_pool[2573]: ReadInstrumentsSGIX (dynamic) */ + "i\0" + "glReadInstrumentsSGIX\0" + "\0" + /* _mesa_function_pool[2598]: CallLists (offset 3) */ + "iip\0" + "glCallLists\0" + "\0" + /* _mesa_function_pool[2615]: UniformMatrix2x4fv (will be remapped) */ + "iiip\0" + "glUniformMatrix2x4fv\0" + "\0" + /* _mesa_function_pool[2642]: Color4ubVertex3fvSUN (dynamic) */ + "pp\0" + "glColor4ubVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[2669]: Normal3iv (offset 59) */ + "p\0" + "glNormal3iv\0" + "\0" + /* _mesa_function_pool[2684]: PassThrough (offset 199) */ + "f\0" + "glPassThrough\0" + "\0" + /* _mesa_function_pool[2701]: FramebufferTextureLayerEXT (will be remapped) */ + "iiiii\0" + "glFramebufferTextureLayer\0" + "glFramebufferTextureLayerEXT\0" + "\0" + /* _mesa_function_pool[2763]: GetListParameterfvSGIX (dynamic) */ + "iip\0" + "glGetListParameterfvSGIX\0" + "\0" + /* _mesa_function_pool[2793]: Viewport (offset 305) */ + "iiii\0" + "glViewport\0" + "\0" + /* _mesa_function_pool[2810]: VertexAttrib4NusvARB (will be remapped) */ + "ip\0" + "glVertexAttrib4Nusv\0" + "glVertexAttrib4NusvARB\0" + "\0" + /* _mesa_function_pool[2857]: WindowPos4svMESA (will be remapped) */ + "p\0" + "glWindowPos4svMESA\0" + "\0" + /* _mesa_function_pool[2879]: CreateProgramObjectARB (will be remapped) */ + "\0" + "glCreateProgramObjectARB\0" + "\0" + /* _mesa_function_pool[2906]: FragmentLightModelivSGIX (dynamic) */ + "ip\0" + "glFragmentLightModelivSGIX\0" + "\0" + /* _mesa_function_pool[2937]: UniformMatrix4x3fv (will be remapped) */ + "iiip\0" + "glUniformMatrix4x3fv\0" + "\0" + /* _mesa_function_pool[2964]: PrioritizeTextures (offset 331) */ + "ipp\0" + "glPrioritizeTextures\0" + "glPrioritizeTexturesEXT\0" + "\0" + /* _mesa_function_pool[3014]: AsyncMarkerSGIX (dynamic) */ + "i\0" + "glAsyncMarkerSGIX\0" + "\0" + /* _mesa_function_pool[3035]: GlobalAlphaFactorubSUN (dynamic) */ + "i\0" + "glGlobalAlphaFactorubSUN\0" + "\0" + /* _mesa_function_pool[3063]: ClearDebugLogMESA (dynamic) */ + "iii\0" + "glClearDebugLogMESA\0" + "\0" + /* _mesa_function_pool[3088]: ResetHistogram (offset 369) */ + "i\0" + "glResetHistogram\0" + "glResetHistogramEXT\0" + "\0" + /* _mesa_function_pool[3128]: GetProgramNamedParameterfvNV (will be remapped) */ + "iipp\0" + "glGetProgramNamedParameterfvNV\0" + "\0" + /* _mesa_function_pool[3165]: PointParameterfEXT (will be remapped) */ + "if\0" + "glPointParameterf\0" + "glPointParameterfARB\0" + "glPointParameterfEXT\0" + "glPointParameterfSGIS\0" + "\0" + /* _mesa_function_pool[3251]: LoadIdentityDeformationMapSGIX (dynamic) */ + "i\0" + "glLoadIdentityDeformationMapSGIX\0" + "\0" + /* _mesa_function_pool[3287]: GenFencesNV (will be remapped) */ + "ip\0" + "glGenFencesNV\0" + "\0" + /* _mesa_function_pool[3305]: ImageTransformParameterfHP (dynamic) */ + "iif\0" + "glImageTransformParameterfHP\0" + "\0" + /* _mesa_function_pool[3339]: MatrixIndexusvARB (dynamic) */ + "ip\0" + "glMatrixIndexusvARB\0" + "\0" + /* _mesa_function_pool[3363]: DrawElementsBaseVertex (will be remapped) */ + "iiipi\0" + "glDrawElementsBaseVertex\0" + "\0" + /* _mesa_function_pool[3395]: DisableVertexAttribArrayARB (will be remapped) */ + "i\0" + "glDisableVertexAttribArray\0" + "glDisableVertexAttribArrayARB\0" + "\0" + /* _mesa_function_pool[3455]: TexCoord2sv (offset 109) */ + "p\0" + "glTexCoord2sv\0" + "\0" + /* _mesa_function_pool[3472]: Vertex4dv (offset 143) */ + "p\0" + "glVertex4dv\0" + "\0" + /* _mesa_function_pool[3487]: StencilMaskSeparate (will be remapped) */ + "ii\0" + "glStencilMaskSeparate\0" + "\0" + /* _mesa_function_pool[3513]: ProgramLocalParameter4dARB (will be remapped) */ + "iidddd\0" + "glProgramLocalParameter4dARB\0" + "\0" + /* _mesa_function_pool[3550]: CompressedTexImage3DARB (will be remapped) */ + "iiiiiiiip\0" + "glCompressedTexImage3D\0" + "glCompressedTexImage3DARB\0" + "\0" + /* _mesa_function_pool[3610]: Color3sv (offset 18) */ + "p\0" + "glColor3sv\0" + "\0" + /* _mesa_function_pool[3624]: GetConvolutionParameteriv (offset 358) */ + "iip\0" + "glGetConvolutionParameteriv\0" + "glGetConvolutionParameterivEXT\0" + "\0" + /* _mesa_function_pool[3688]: VertexAttrib1fARB (will be remapped) */ + "if\0" + "glVertexAttrib1f\0" + "glVertexAttrib1fARB\0" + "\0" + /* _mesa_function_pool[3729]: Vertex2dv (offset 127) */ + "p\0" + "glVertex2dv\0" + "\0" + /* _mesa_function_pool[3744]: TestFenceNV (will be remapped) */ + "i\0" + "glTestFenceNV\0" + "\0" + /* _mesa_function_pool[3761]: MultiTexCoord1fvARB (offset 379) */ + "ip\0" + "glMultiTexCoord1fv\0" + "glMultiTexCoord1fvARB\0" + "\0" + /* _mesa_function_pool[3806]: TexCoord3iv (offset 115) */ + "p\0" + "glTexCoord3iv\0" + "\0" + /* _mesa_function_pool[3823]: ColorFragmentOp2ATI (will be remapped) */ + "iiiiiiiiii\0" + "glColorFragmentOp2ATI\0" + "\0" + /* _mesa_function_pool[3857]: SecondaryColorPointerListIBM (dynamic) */ + "iiipi\0" + "glSecondaryColorPointerListIBM\0" + "\0" + /* _mesa_function_pool[3895]: GetPixelTexGenParameterivSGIS (will be remapped) */ + "ip\0" + "glGetPixelTexGenParameterivSGIS\0" + "\0" + /* _mesa_function_pool[3931]: Color3fv (offset 14) */ + "p\0" + "glColor3fv\0" + "\0" + /* _mesa_function_pool[3945]: VertexAttrib4fNV (will be remapped) */ + "iffff\0" + "glVertexAttrib4fNV\0" + "\0" + /* _mesa_function_pool[3971]: ReplacementCodeubSUN (dynamic) */ + "i\0" + "glReplacementCodeubSUN\0" + "\0" + /* _mesa_function_pool[3997]: FinishAsyncSGIX (dynamic) */ + "p\0" + "glFinishAsyncSGIX\0" + "\0" + /* _mesa_function_pool[4018]: GetDebugLogMESA (dynamic) */ + "iiiipp\0" + "glGetDebugLogMESA\0" + "\0" + /* _mesa_function_pool[4044]: FogCoorddEXT (will be remapped) */ + "d\0" + "glFogCoordd\0" + "glFogCoorddEXT\0" + "\0" + /* _mesa_function_pool[4074]: Color4ubVertex3fSUN (dynamic) */ + "iiiifff\0" + "glColor4ubVertex3fSUN\0" + "\0" + /* _mesa_function_pool[4105]: FogCoordfEXT (will be remapped) */ + "f\0" + "glFogCoordf\0" + "glFogCoordfEXT\0" + "\0" + /* _mesa_function_pool[4135]: PointSize (offset 173) */ + "f\0" + "glPointSize\0" + "\0" + /* _mesa_function_pool[4150]: TexCoord2fVertex3fSUN (dynamic) */ + "fffff\0" + "glTexCoord2fVertex3fSUN\0" + "\0" + /* _mesa_function_pool[4181]: PopName (offset 200) */ + "\0" + "glPopName\0" + "\0" + /* _mesa_function_pool[4193]: GlobalAlphaFactoriSUN (dynamic) */ + "i\0" + "glGlobalAlphaFactoriSUN\0" + "\0" + /* _mesa_function_pool[4220]: VertexAttrib2dNV (will be remapped) */ + "idd\0" + "glVertexAttrib2dNV\0" + "\0" + /* _mesa_function_pool[4244]: GetProgramInfoLog (will be remapped) */ + "iipp\0" + "glGetProgramInfoLog\0" + "\0" + /* _mesa_function_pool[4270]: VertexAttrib4NbvARB (will be remapped) */ + "ip\0" + "glVertexAttrib4Nbv\0" + "glVertexAttrib4NbvARB\0" + "\0" + /* _mesa_function_pool[4315]: GetActiveAttribARB (will be remapped) */ + "iiipppp\0" + "glGetActiveAttrib\0" + "glGetActiveAttribARB\0" + "\0" + /* _mesa_function_pool[4363]: Vertex4sv (offset 149) */ + "p\0" + "glVertex4sv\0" + "\0" + /* _mesa_function_pool[4378]: VertexAttrib4ubNV (will be remapped) */ + "iiiii\0" + "glVertexAttrib4ubNV\0" + "\0" + /* _mesa_function_pool[4405]: TextureRangeAPPLE (will be remapped) */ + "iip\0" + "glTextureRangeAPPLE\0" + "\0" + /* _mesa_function_pool[4430]: GetTexEnvfv (offset 276) */ + "iip\0" + "glGetTexEnvfv\0" + "\0" + /* _mesa_function_pool[4449]: TexCoord2fColor4fNormal3fVertex3fSUN (dynamic) */ + "ffffffffffff\0" + "glTexCoord2fColor4fNormal3fVertex3fSUN\0" + "\0" + /* _mesa_function_pool[4502]: Indexub (offset 315) */ + "i\0" + "glIndexub\0" + "\0" + /* _mesa_function_pool[4515]: TexEnvi (offset 186) */ + "iii\0" + "glTexEnvi\0" + "\0" + /* _mesa_function_pool[4530]: GetClipPlane (offset 259) */ + "ip\0" + "glGetClipPlane\0" + "\0" + /* _mesa_function_pool[4549]: CombinerParameterfvNV (will be remapped) */ + "ip\0" + "glCombinerParameterfvNV\0" + "\0" + /* _mesa_function_pool[4577]: VertexAttribs3dvNV (will be remapped) */ + "iip\0" + "glVertexAttribs3dvNV\0" + "\0" + /* _mesa_function_pool[4603]: VertexAttribs4fvNV (will be remapped) */ + "iip\0" + "glVertexAttribs4fvNV\0" + "\0" + /* _mesa_function_pool[4629]: VertexArrayRangeNV (will be remapped) */ + "ip\0" + "glVertexArrayRangeNV\0" + "\0" + /* _mesa_function_pool[4654]: FragmentLightiSGIX (dynamic) */ + "iii\0" + "glFragmentLightiSGIX\0" + "\0" + /* _mesa_function_pool[4680]: PolygonOffsetEXT (will be remapped) */ + "ff\0" + "glPolygonOffsetEXT\0" + "\0" + /* _mesa_function_pool[4703]: PollAsyncSGIX (dynamic) */ + "p\0" + "glPollAsyncSGIX\0" + "\0" + /* _mesa_function_pool[4722]: DeleteFragmentShaderATI (will be remapped) */ + "i\0" + "glDeleteFragmentShaderATI\0" + "\0" + /* _mesa_function_pool[4751]: Scaled (offset 301) */ + "ddd\0" + "glScaled\0" + "\0" + /* _mesa_function_pool[4765]: Scalef (offset 302) */ + "fff\0" + "glScalef\0" + "\0" + /* _mesa_function_pool[4779]: TexCoord2fNormal3fVertex3fvSUN (dynamic) */ + "ppp\0" + "glTexCoord2fNormal3fVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[4817]: MultTransposeMatrixdARB (will be remapped) */ + "p\0" + "glMultTransposeMatrixd\0" + "glMultTransposeMatrixdARB\0" + "\0" + /* _mesa_function_pool[4869]: AlphaFunc (offset 240) */ + "if\0" + "glAlphaFunc\0" + "\0" + /* _mesa_function_pool[4885]: WindowPos2svMESA (will be remapped) */ + "p\0" + "glWindowPos2sv\0" + "glWindowPos2svARB\0" + "glWindowPos2svMESA\0" + "\0" + /* _mesa_function_pool[4940]: EdgeFlag (offset 41) */ + "i\0" + "glEdgeFlag\0" + "\0" + /* _mesa_function_pool[4954]: TexCoord2iv (offset 107) */ + "p\0" + "glTexCoord2iv\0" + "\0" + /* _mesa_function_pool[4971]: CompressedTexImage1DARB (will be remapped) */ + "iiiiiip\0" + "glCompressedTexImage1D\0" + "glCompressedTexImage1DARB\0" + "\0" + /* _mesa_function_pool[5029]: Rotated (offset 299) */ + "dddd\0" + "glRotated\0" + "\0" + /* _mesa_function_pool[5045]: VertexAttrib2sNV (will be remapped) */ + "iii\0" + "glVertexAttrib2sNV\0" + "\0" + /* _mesa_function_pool[5069]: ReadPixels (offset 256) */ + "iiiiiip\0" + "glReadPixels\0" + "\0" + /* _mesa_function_pool[5091]: EdgeFlagv (offset 42) */ + "p\0" + "glEdgeFlagv\0" + "\0" + /* _mesa_function_pool[5106]: NormalPointerListIBM (dynamic) */ + "iipi\0" + "glNormalPointerListIBM\0" + "\0" + /* _mesa_function_pool[5135]: IndexPointerEXT (will be remapped) */ + "iiip\0" + "glIndexPointerEXT\0" + "\0" + /* _mesa_function_pool[5159]: Color4iv (offset 32) */ + "p\0" + "glColor4iv\0" + "\0" + /* _mesa_function_pool[5173]: TexParameterf (offset 178) */ + "iif\0" + "glTexParameterf\0" + "\0" + /* _mesa_function_pool[5194]: TexParameteri (offset 180) */ + "iii\0" + "glTexParameteri\0" + "\0" + /* _mesa_function_pool[5215]: NormalPointerEXT (will be remapped) */ + "iiip\0" + "glNormalPointerEXT\0" + "\0" + /* _mesa_function_pool[5240]: MultiTexCoord3dARB (offset 392) */ + "iddd\0" + "glMultiTexCoord3d\0" + "glMultiTexCoord3dARB\0" + "\0" + /* _mesa_function_pool[5285]: MultiTexCoord2iARB (offset 388) */ + "iii\0" + "glMultiTexCoord2i\0" + "glMultiTexCoord2iARB\0" + "\0" + /* _mesa_function_pool[5329]: DrawPixels (offset 257) */ + "iiiip\0" + "glDrawPixels\0" + "\0" + /* _mesa_function_pool[5349]: ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (dynamic) */ + "iffffffff\0" + "glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN\0" + "\0" + /* _mesa_function_pool[5409]: MultiTexCoord2svARB (offset 391) */ + "ip\0" + "glMultiTexCoord2sv\0" + "glMultiTexCoord2svARB\0" + "\0" + /* _mesa_function_pool[5454]: ReplacementCodeubvSUN (dynamic) */ + "p\0" + "glReplacementCodeubvSUN\0" + "\0" + /* _mesa_function_pool[5481]: Uniform3iARB (will be remapped) */ + "iiii\0" + "glUniform3i\0" + "glUniform3iARB\0" + "\0" + /* _mesa_function_pool[5514]: GetFragmentMaterialfvSGIX (dynamic) */ + "iip\0" + "glGetFragmentMaterialfvSGIX\0" + "\0" + /* _mesa_function_pool[5547]: GetShaderInfoLog (will be remapped) */ + "iipp\0" + "glGetShaderInfoLog\0" + "\0" + /* _mesa_function_pool[5572]: WeightivARB (dynamic) */ + "ip\0" + "glWeightivARB\0" + "\0" + /* _mesa_function_pool[5590]: PollInstrumentsSGIX (dynamic) */ + "p\0" + "glPollInstrumentsSGIX\0" + "\0" + /* _mesa_function_pool[5615]: GlobalAlphaFactordSUN (dynamic) */ + "d\0" + "glGlobalAlphaFactordSUN\0" + "\0" + /* _mesa_function_pool[5642]: GetFinalCombinerInputParameterfvNV (will be remapped) */ + "iip\0" + "glGetFinalCombinerInputParameterfvNV\0" + "\0" + /* _mesa_function_pool[5684]: GenerateMipmapEXT (will be remapped) */ + "i\0" + "glGenerateMipmap\0" + "glGenerateMipmapEXT\0" + "\0" + /* _mesa_function_pool[5724]: GenLists (offset 5) */ + "i\0" + "glGenLists\0" + "\0" + /* _mesa_function_pool[5738]: SetFragmentShaderConstantATI (will be remapped) */ + "ip\0" + "glSetFragmentShaderConstantATI\0" + "\0" + /* _mesa_function_pool[5773]: GetMapAttribParameterivNV (dynamic) */ + "iiip\0" + "glGetMapAttribParameterivNV\0" + "\0" + /* _mesa_function_pool[5807]: CreateShaderObjectARB (will be remapped) */ + "i\0" + "glCreateShaderObjectARB\0" + "\0" + /* _mesa_function_pool[5834]: GetSharpenTexFuncSGIS (dynamic) */ + "ip\0" + "glGetSharpenTexFuncSGIS\0" + "\0" + /* _mesa_function_pool[5862]: BufferDataARB (will be remapped) */ + "iipi\0" + "glBufferData\0" + "glBufferDataARB\0" + "\0" + /* _mesa_function_pool[5897]: FlushVertexArrayRangeNV (will be remapped) */ + "\0" + "glFlushVertexArrayRangeNV\0" + "\0" + /* _mesa_function_pool[5925]: MapGrid2d (offset 226) */ + "iddidd\0" + "glMapGrid2d\0" + "\0" + /* _mesa_function_pool[5945]: MapGrid2f (offset 227) */ + "iffiff\0" + "glMapGrid2f\0" + "\0" + /* _mesa_function_pool[5965]: SampleMapATI (will be remapped) */ + "iii\0" + "glSampleMapATI\0" + "\0" + /* _mesa_function_pool[5985]: VertexPointerEXT (will be remapped) */ + "iiiip\0" + "glVertexPointerEXT\0" + "\0" + /* _mesa_function_pool[6011]: GetTexFilterFuncSGIS (dynamic) */ + "iip\0" + "glGetTexFilterFuncSGIS\0" + "\0" + /* _mesa_function_pool[6039]: Scissor (offset 176) */ + "iiii\0" + "glScissor\0" + "\0" + /* _mesa_function_pool[6055]: Fogf (offset 153) */ + "if\0" + "glFogf\0" + "\0" + /* _mesa_function_pool[6066]: GetCombinerOutputParameterfvNV (will be remapped) */ + "iiip\0" + "glGetCombinerOutputParameterfvNV\0" + "\0" + /* _mesa_function_pool[6105]: TexSubImage1D (offset 332) */ + "iiiiiip\0" + "glTexSubImage1D\0" + "glTexSubImage1DEXT\0" + "\0" + /* _mesa_function_pool[6149]: VertexAttrib1sARB (will be remapped) */ + "ii\0" + "glVertexAttrib1s\0" + "glVertexAttrib1sARB\0" + "\0" + /* _mesa_function_pool[6190]: FenceSync (will be remapped) */ + "ii\0" + "glFenceSync\0" + "\0" + /* _mesa_function_pool[6206]: Color4usv (offset 40) */ + "p\0" + "glColor4usv\0" + "\0" + /* _mesa_function_pool[6221]: Fogi (offset 155) */ + "ii\0" + "glFogi\0" + "\0" + /* _mesa_function_pool[6232]: DepthRange (offset 288) */ + "dd\0" + "glDepthRange\0" + "\0" + /* _mesa_function_pool[6249]: RasterPos3iv (offset 75) */ + "p\0" + "glRasterPos3iv\0" + "\0" + /* _mesa_function_pool[6267]: FinalCombinerInputNV (will be remapped) */ + "iiii\0" + "glFinalCombinerInputNV\0" + "\0" + /* _mesa_function_pool[6296]: TexCoord2i (offset 106) */ + "ii\0" + "glTexCoord2i\0" + "\0" + /* _mesa_function_pool[6313]: PixelMapfv (offset 251) */ + "iip\0" + "glPixelMapfv\0" + "\0" + /* _mesa_function_pool[6331]: Color4ui (offset 37) */ + "iiii\0" + "glColor4ui\0" + "\0" + /* _mesa_function_pool[6348]: RasterPos3s (offset 76) */ + "iii\0" + "glRasterPos3s\0" + "\0" + /* _mesa_function_pool[6367]: Color3usv (offset 24) */ + "p\0" + "glColor3usv\0" + "\0" + /* _mesa_function_pool[6382]: FlushRasterSGIX (dynamic) */ + "\0" + "glFlushRasterSGIX\0" + "\0" + /* _mesa_function_pool[6402]: TexCoord2f (offset 104) */ + "ff\0" + "glTexCoord2f\0" + "\0" + /* _mesa_function_pool[6419]: ReplacementCodeuiTexCoord2fVertex3fSUN (dynamic) */ + "ifffff\0" + "glReplacementCodeuiTexCoord2fVertex3fSUN\0" + "\0" + /* _mesa_function_pool[6468]: TexCoord2d (offset 102) */ + "dd\0" + "glTexCoord2d\0" + "\0" + /* _mesa_function_pool[6485]: RasterPos3d (offset 70) */ + "ddd\0" + "glRasterPos3d\0" + "\0" + /* _mesa_function_pool[6504]: RasterPos3f (offset 72) */ + "fff\0" + "glRasterPos3f\0" + "\0" + /* _mesa_function_pool[6523]: Uniform1fARB (will be remapped) */ + "if\0" + "glUniform1f\0" + "glUniform1fARB\0" + "\0" + /* _mesa_function_pool[6554]: AreTexturesResident (offset 322) */ + "ipp\0" + "glAreTexturesResident\0" + "glAreTexturesResidentEXT\0" + "\0" + /* _mesa_function_pool[6606]: TexCoord2s (offset 108) */ + "ii\0" + "glTexCoord2s\0" + "\0" + /* _mesa_function_pool[6623]: StencilOpSeparate (will be remapped) */ + "iiii\0" + "glStencilOpSeparate\0" + "glStencilOpSeparateATI\0" + "\0" + /* _mesa_function_pool[6672]: ColorTableParameteriv (offset 341) */ + "iip\0" + "glColorTableParameteriv\0" + "glColorTableParameterivSGI\0" + "\0" + /* _mesa_function_pool[6728]: FogCoordPointerListIBM (dynamic) */ + "iipi\0" + "glFogCoordPointerListIBM\0" + "\0" + /* _mesa_function_pool[6759]: WindowPos3dMESA (will be remapped) */ + "ddd\0" + "glWindowPos3d\0" + "glWindowPos3dARB\0" + "glWindowPos3dMESA\0" + "\0" + /* _mesa_function_pool[6813]: Color4us (offset 39) */ + "iiii\0" + "glColor4us\0" + "\0" + /* _mesa_function_pool[6830]: PointParameterfvEXT (will be remapped) */ + "ip\0" + "glPointParameterfv\0" + "glPointParameterfvARB\0" + "glPointParameterfvEXT\0" + "glPointParameterfvSGIS\0" + "\0" + /* _mesa_function_pool[6920]: Color3bv (offset 10) */ + "p\0" + "glColor3bv\0" + "\0" + /* _mesa_function_pool[6934]: WindowPos2fvMESA (will be remapped) */ + "p\0" + "glWindowPos2fv\0" + "glWindowPos2fvARB\0" + "glWindowPos2fvMESA\0" + "\0" + /* _mesa_function_pool[6989]: SecondaryColor3bvEXT (will be remapped) */ + "p\0" + "glSecondaryColor3bv\0" + "glSecondaryColor3bvEXT\0" + "\0" + /* _mesa_function_pool[7035]: VertexPointerListIBM (dynamic) */ + "iiipi\0" + "glVertexPointerListIBM\0" + "\0" + /* _mesa_function_pool[7065]: GetProgramLocalParameterfvARB (will be remapped) */ + "iip\0" + "glGetProgramLocalParameterfvARB\0" + "\0" + /* _mesa_function_pool[7102]: FragmentMaterialfSGIX (dynamic) */ + "iif\0" + "glFragmentMaterialfSGIX\0" + "\0" + /* _mesa_function_pool[7131]: TexCoord2fNormal3fVertex3fSUN (dynamic) */ + "ffffffff\0" + "glTexCoord2fNormal3fVertex3fSUN\0" + "\0" + /* _mesa_function_pool[7173]: RenderbufferStorageEXT (will be remapped) */ + "iiii\0" + "glRenderbufferStorage\0" + "glRenderbufferStorageEXT\0" + "\0" + /* _mesa_function_pool[7226]: IsFenceNV (will be remapped) */ + "i\0" + "glIsFenceNV\0" + "\0" + /* _mesa_function_pool[7241]: AttachObjectARB (will be remapped) */ + "ii\0" + "glAttachObjectARB\0" + "\0" + /* _mesa_function_pool[7263]: GetFragmentLightivSGIX (dynamic) */ + "iip\0" + "glGetFragmentLightivSGIX\0" + "\0" + /* _mesa_function_pool[7293]: UniformMatrix2fvARB (will be remapped) */ + "iiip\0" + "glUniformMatrix2fv\0" + "glUniformMatrix2fvARB\0" + "\0" + /* _mesa_function_pool[7340]: MultiTexCoord2fARB (offset 386) */ + "iff\0" + "glMultiTexCoord2f\0" + "glMultiTexCoord2fARB\0" + "\0" + /* _mesa_function_pool[7384]: ColorTable (offset 339) */ + "iiiiip\0" + "glColorTable\0" + "glColorTableSGI\0" + "glColorTableEXT\0" + "\0" + /* _mesa_function_pool[7437]: IndexPointer (offset 314) */ + "iip\0" + "glIndexPointer\0" + "\0" + /* _mesa_function_pool[7457]: Accum (offset 213) */ + "if\0" + "glAccum\0" + "\0" + /* _mesa_function_pool[7469]: GetTexImage (offset 281) */ + "iiiip\0" + "glGetTexImage\0" + "\0" + /* _mesa_function_pool[7490]: MapControlPointsNV (dynamic) */ + "iiiiiiiip\0" + "glMapControlPointsNV\0" + "\0" + /* _mesa_function_pool[7522]: ConvolutionFilter2D (offset 349) */ + "iiiiiip\0" + "glConvolutionFilter2D\0" + "glConvolutionFilter2DEXT\0" + "\0" + /* _mesa_function_pool[7578]: Finish (offset 216) */ + "\0" + "glFinish\0" + "\0" + /* _mesa_function_pool[7589]: MapParameterfvNV (dynamic) */ + "iip\0" + "glMapParameterfvNV\0" + "\0" + /* _mesa_function_pool[7613]: ClearStencil (offset 207) */ + "i\0" + "glClearStencil\0" + "\0" + /* _mesa_function_pool[7631]: VertexAttrib3dvARB (will be remapped) */ + "ip\0" + "glVertexAttrib3dv\0" + "glVertexAttrib3dvARB\0" + "\0" + /* _mesa_function_pool[7674]: HintPGI (dynamic) */ + "ii\0" + "glHintPGI\0" + "\0" + /* _mesa_function_pool[7688]: ConvolutionParameteriv (offset 353) */ + "iip\0" + "glConvolutionParameteriv\0" + "glConvolutionParameterivEXT\0" + "\0" + /* _mesa_function_pool[7746]: Color4s (offset 33) */ + "iiii\0" + "glColor4s\0" + "\0" + /* _mesa_function_pool[7762]: InterleavedArrays (offset 317) */ + "iip\0" + "glInterleavedArrays\0" + "\0" + /* _mesa_function_pool[7787]: RasterPos2fv (offset 65) */ + "p\0" + "glRasterPos2fv\0" + "\0" + /* _mesa_function_pool[7805]: TexCoord1fv (offset 97) */ + "p\0" + "glTexCoord1fv\0" + "\0" + /* _mesa_function_pool[7822]: Vertex2d (offset 126) */ + "dd\0" + "glVertex2d\0" + "\0" + /* _mesa_function_pool[7837]: CullParameterdvEXT (will be remapped) */ + "ip\0" + "glCullParameterdvEXT\0" + "\0" + /* _mesa_function_pool[7862]: ProgramNamedParameter4fNV (will be remapped) */ + "iipffff\0" + "glProgramNamedParameter4fNV\0" + "\0" + /* _mesa_function_pool[7899]: Color3fVertex3fSUN (dynamic) */ + "ffffff\0" + "glColor3fVertex3fSUN\0" + "\0" + /* _mesa_function_pool[7928]: ProgramEnvParameter4fvARB (will be remapped) */ + "iip\0" + "glProgramEnvParameter4fvARB\0" + "glProgramParameter4fvNV\0" + "\0" + /* _mesa_function_pool[7985]: Color4i (offset 31) */ + "iiii\0" + "glColor4i\0" + "\0" + /* _mesa_function_pool[8001]: Color4f (offset 29) */ + "ffff\0" + "glColor4f\0" + "\0" + /* _mesa_function_pool[8017]: RasterPos4fv (offset 81) */ + "p\0" + "glRasterPos4fv\0" + "\0" + /* _mesa_function_pool[8035]: Color4d (offset 27) */ + "dddd\0" + "glColor4d\0" + "\0" + /* _mesa_function_pool[8051]: ClearIndex (offset 205) */ + "f\0" + "glClearIndex\0" + "\0" + /* _mesa_function_pool[8067]: Color4b (offset 25) */ + "iiii\0" + "glColor4b\0" + "\0" + /* _mesa_function_pool[8083]: LoadMatrixd (offset 292) */ + "p\0" + "glLoadMatrixd\0" + "\0" + /* _mesa_function_pool[8100]: FragmentLightModeliSGIX (dynamic) */ + "ii\0" + "glFragmentLightModeliSGIX\0" + "\0" + /* _mesa_function_pool[8130]: RasterPos2dv (offset 63) */ + "p\0" + "glRasterPos2dv\0" + "\0" + /* _mesa_function_pool[8148]: ConvolutionParameterfv (offset 351) */ + "iip\0" + "glConvolutionParameterfv\0" + "glConvolutionParameterfvEXT\0" + "\0" + /* _mesa_function_pool[8206]: TbufferMask3DFX (dynamic) */ + "i\0" + "glTbufferMask3DFX\0" + "\0" + /* _mesa_function_pool[8227]: GetTexGendv (offset 278) */ + "iip\0" + "glGetTexGendv\0" + "\0" + /* _mesa_function_pool[8246]: LoadProgramNV (will be remapped) */ + "iiip\0" + "glLoadProgramNV\0" + "\0" + /* _mesa_function_pool[8268]: WaitSync (will be remapped) */ + "iii\0" + "glWaitSync\0" + "\0" + /* _mesa_function_pool[8284]: EndList (offset 1) */ + "\0" + "glEndList\0" + "\0" + /* _mesa_function_pool[8296]: VertexAttrib4fvNV (will be remapped) */ + "ip\0" + "glVertexAttrib4fvNV\0" + "\0" + /* _mesa_function_pool[8320]: GetAttachedObjectsARB (will be remapped) */ + "iipp\0" + "glGetAttachedObjectsARB\0" + "\0" + /* _mesa_function_pool[8350]: Uniform3fvARB (will be remapped) */ + "iip\0" + "glUniform3fv\0" + "glUniform3fvARB\0" + "\0" + /* _mesa_function_pool[8384]: EvalCoord1fv (offset 231) */ + "p\0" + "glEvalCoord1fv\0" + "\0" + /* _mesa_function_pool[8402]: DrawRangeElements (offset 338) */ + "iiiiip\0" + "glDrawRangeElements\0" + "glDrawRangeElementsEXT\0" + "\0" + /* _mesa_function_pool[8453]: EvalMesh2 (offset 238) */ + "iiiii\0" + "glEvalMesh2\0" + "\0" + /* _mesa_function_pool[8472]: Vertex4fv (offset 145) */ + "p\0" + "glVertex4fv\0" + "\0" + /* _mesa_function_pool[8487]: SpriteParameterfvSGIX (dynamic) */ + "ip\0" + "glSpriteParameterfvSGIX\0" + "\0" + /* _mesa_function_pool[8515]: CheckFramebufferStatusEXT (will be remapped) */ + "i\0" + "glCheckFramebufferStatus\0" + "glCheckFramebufferStatusEXT\0" + "\0" + /* _mesa_function_pool[8571]: GlobalAlphaFactoruiSUN (dynamic) */ + "i\0" + "glGlobalAlphaFactoruiSUN\0" + "\0" + /* _mesa_function_pool[8599]: GetHandleARB (will be remapped) */ + "i\0" + "glGetHandleARB\0" + "\0" + /* _mesa_function_pool[8617]: GetVertexAttribivARB (will be remapped) */ + "iip\0" + "glGetVertexAttribiv\0" + "glGetVertexAttribivARB\0" + "\0" + /* _mesa_function_pool[8665]: GetCombinerInputParameterfvNV (will be remapped) */ + "iiiip\0" + "glGetCombinerInputParameterfvNV\0" + "\0" + /* _mesa_function_pool[8704]: CreateProgram (will be remapped) */ + "\0" + "glCreateProgram\0" + "\0" + /* _mesa_function_pool[8722]: LoadTransposeMatrixdARB (will be remapped) */ + "p\0" + "glLoadTransposeMatrixd\0" + "glLoadTransposeMatrixdARB\0" + "\0" + /* _mesa_function_pool[8774]: GetMinmax (offset 364) */ + "iiiip\0" + "glGetMinmax\0" + "glGetMinmaxEXT\0" + "\0" + /* _mesa_function_pool[8808]: StencilFuncSeparate (will be remapped) */ + "iiii\0" + "glStencilFuncSeparate\0" + "\0" + /* _mesa_function_pool[8836]: SecondaryColor3sEXT (will be remapped) */ + "iii\0" + "glSecondaryColor3s\0" + "glSecondaryColor3sEXT\0" + "\0" + /* _mesa_function_pool[8882]: Color3fVertex3fvSUN (dynamic) */ + "pp\0" + "glColor3fVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[8908]: Normal3fv (offset 57) */ + "p\0" + "glNormal3fv\0" + "\0" + /* _mesa_function_pool[8923]: GlobalAlphaFactorbSUN (dynamic) */ + "i\0" + "glGlobalAlphaFactorbSUN\0" + "\0" + /* _mesa_function_pool[8950]: Color3us (offset 23) */ + "iii\0" + "glColor3us\0" + "\0" + /* _mesa_function_pool[8966]: ImageTransformParameterfvHP (dynamic) */ + "iip\0" + "glImageTransformParameterfvHP\0" + "\0" + /* _mesa_function_pool[9001]: VertexAttrib4ivARB (will be remapped) */ + "ip\0" + "glVertexAttrib4iv\0" + "glVertexAttrib4ivARB\0" + "\0" + /* _mesa_function_pool[9044]: End (offset 43) */ + "\0" + "glEnd\0" + "\0" + /* _mesa_function_pool[9052]: VertexAttrib3fNV (will be remapped) */ + "ifff\0" + "glVertexAttrib3fNV\0" + "\0" + /* _mesa_function_pool[9077]: VertexAttribs2dvNV (will be remapped) */ + "iip\0" + "glVertexAttribs2dvNV\0" + "\0" + /* _mesa_function_pool[9103]: GetQueryObjectui64vEXT (will be remapped) */ + "iip\0" + "glGetQueryObjectui64vEXT\0" + "\0" + /* _mesa_function_pool[9133]: MultiTexCoord3fvARB (offset 395) */ + "ip\0" + "glMultiTexCoord3fv\0" + "glMultiTexCoord3fvARB\0" + "\0" + /* _mesa_function_pool[9178]: SecondaryColor3dEXT (will be remapped) */ + "ddd\0" + "glSecondaryColor3d\0" + "glSecondaryColor3dEXT\0" + "\0" + /* _mesa_function_pool[9224]: Color3ub (offset 19) */ + "iii\0" + "glColor3ub\0" + "\0" + /* _mesa_function_pool[9240]: GetProgramParameterfvNV (will be remapped) */ + "iiip\0" + "glGetProgramParameterfvNV\0" + "\0" + /* _mesa_function_pool[9272]: TangentPointerEXT (dynamic) */ + "iip\0" + "glTangentPointerEXT\0" + "\0" + /* _mesa_function_pool[9297]: Color4fNormal3fVertex3fvSUN (dynamic) */ + "ppp\0" + "glColor4fNormal3fVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[9332]: GetInstrumentsSGIX (dynamic) */ + "\0" + "glGetInstrumentsSGIX\0" + "\0" + /* _mesa_function_pool[9355]: Color3ui (offset 21) */ + "iii\0" + "glColor3ui\0" + "\0" + /* _mesa_function_pool[9371]: EvalMapsNV (dynamic) */ + "ii\0" + "glEvalMapsNV\0" + "\0" + /* _mesa_function_pool[9388]: TexSubImage2D (offset 333) */ + "iiiiiiiip\0" + "glTexSubImage2D\0" + "glTexSubImage2DEXT\0" + "\0" + /* _mesa_function_pool[9434]: FragmentLightivSGIX (dynamic) */ + "iip\0" + "glFragmentLightivSGIX\0" + "\0" + /* _mesa_function_pool[9461]: GetTexParameterPointervAPPLE (will be remapped) */ + "iip\0" + "glGetTexParameterPointervAPPLE\0" + "\0" + /* _mesa_function_pool[9497]: TexGenfv (offset 191) */ + "iip\0" + "glTexGenfv\0" + "\0" + /* _mesa_function_pool[9513]: PixelTransformParameterfvEXT (dynamic) */ + "iip\0" + "glPixelTransformParameterfvEXT\0" + "\0" + /* _mesa_function_pool[9549]: VertexAttrib4bvARB (will be remapped) */ + "ip\0" + "glVertexAttrib4bv\0" + "glVertexAttrib4bvARB\0" + "\0" + /* _mesa_function_pool[9592]: AlphaFragmentOp2ATI (will be remapped) */ + "iiiiiiiii\0" + "glAlphaFragmentOp2ATI\0" + "\0" + /* _mesa_function_pool[9625]: MultiTexCoord4sARB (offset 406) */ + "iiiii\0" + "glMultiTexCoord4s\0" + "glMultiTexCoord4sARB\0" + "\0" + /* _mesa_function_pool[9671]: GetFragmentMaterialivSGIX (dynamic) */ + "iip\0" + "glGetFragmentMaterialivSGIX\0" + "\0" + /* _mesa_function_pool[9704]: WindowPos4dMESA (will be remapped) */ + "dddd\0" + "glWindowPos4dMESA\0" + "\0" + /* _mesa_function_pool[9728]: WeightPointerARB (dynamic) */ + "iiip\0" + "glWeightPointerARB\0" + "\0" + /* _mesa_function_pool[9753]: WindowPos2dMESA (will be remapped) */ + "dd\0" + "glWindowPos2d\0" + "glWindowPos2dARB\0" + "glWindowPos2dMESA\0" + "\0" + /* _mesa_function_pool[9806]: FramebufferTexture3DEXT (will be remapped) */ + "iiiiii\0" + "glFramebufferTexture3D\0" + "glFramebufferTexture3DEXT\0" + "\0" + /* _mesa_function_pool[9863]: BlendEquation (offset 337) */ + "i\0" + "glBlendEquation\0" + "glBlendEquationEXT\0" + "\0" + /* _mesa_function_pool[9901]: VertexAttrib3dNV (will be remapped) */ + "iddd\0" + "glVertexAttrib3dNV\0" + "\0" + /* _mesa_function_pool[9926]: VertexAttrib3dARB (will be remapped) */ + "iddd\0" + "glVertexAttrib3d\0" + "glVertexAttrib3dARB\0" + "\0" + /* _mesa_function_pool[9969]: ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (dynamic) */ + "ppppp\0" + "glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[10033]: VertexAttrib4fARB (will be remapped) */ + "iffff\0" + "glVertexAttrib4f\0" + "glVertexAttrib4fARB\0" + "\0" + /* _mesa_function_pool[10077]: GetError (offset 261) */ + "\0" + "glGetError\0" + "\0" + /* _mesa_function_pool[10090]: IndexFuncEXT (dynamic) */ + "if\0" + "glIndexFuncEXT\0" + "\0" + /* _mesa_function_pool[10109]: TexCoord3dv (offset 111) */ + "p\0" + "glTexCoord3dv\0" + "\0" + /* _mesa_function_pool[10126]: Indexdv (offset 45) */ + "p\0" + "glIndexdv\0" + "\0" + /* _mesa_function_pool[10139]: FramebufferTexture2DEXT (will be remapped) */ + "iiiii\0" + "glFramebufferTexture2D\0" + "glFramebufferTexture2DEXT\0" + "\0" + /* _mesa_function_pool[10195]: Normal3s (offset 60) */ + "iii\0" + "glNormal3s\0" + "\0" + /* _mesa_function_pool[10211]: PushName (offset 201) */ + "i\0" + "glPushName\0" + "\0" + /* _mesa_function_pool[10225]: MultiTexCoord2dvARB (offset 385) */ + "ip\0" + "glMultiTexCoord2dv\0" + "glMultiTexCoord2dvARB\0" + "\0" + /* _mesa_function_pool[10270]: CullParameterfvEXT (will be remapped) */ + "ip\0" + "glCullParameterfvEXT\0" + "\0" + /* _mesa_function_pool[10295]: Normal3i (offset 58) */ + "iii\0" + "glNormal3i\0" + "\0" + /* _mesa_function_pool[10311]: ProgramNamedParameter4fvNV (will be remapped) */ + "iipp\0" + "glProgramNamedParameter4fvNV\0" + "\0" + /* _mesa_function_pool[10346]: SecondaryColorPointerEXT (will be remapped) */ + "iiip\0" + "glSecondaryColorPointer\0" + "glSecondaryColorPointerEXT\0" + "\0" + /* _mesa_function_pool[10403]: VertexAttrib4fvARB (will be remapped) */ + "ip\0" + "glVertexAttrib4fv\0" + "glVertexAttrib4fvARB\0" + "\0" + /* _mesa_function_pool[10446]: ColorPointerListIBM (dynamic) */ + "iiipi\0" + "glColorPointerListIBM\0" + "\0" + /* _mesa_function_pool[10475]: GetActiveUniformARB (will be remapped) */ + "iiipppp\0" + "glGetActiveUniform\0" + "glGetActiveUniformARB\0" + "\0" + /* _mesa_function_pool[10525]: ImageTransformParameteriHP (dynamic) */ + "iii\0" + "glImageTransformParameteriHP\0" + "\0" + /* _mesa_function_pool[10559]: Normal3b (offset 52) */ + "iii\0" + "glNormal3b\0" + "\0" + /* _mesa_function_pool[10575]: Normal3d (offset 54) */ + "ddd\0" + "glNormal3d\0" + "\0" + /* _mesa_function_pool[10591]: Normal3f (offset 56) */ + "fff\0" + "glNormal3f\0" + "\0" + /* _mesa_function_pool[10607]: MultiTexCoord1svARB (offset 383) */ + "ip\0" + "glMultiTexCoord1sv\0" + "glMultiTexCoord1svARB\0" + "\0" + /* _mesa_function_pool[10652]: Indexi (offset 48) */ + "i\0" + "glIndexi\0" + "\0" + /* _mesa_function_pool[10664]: EndQueryARB (will be remapped) */ + "i\0" + "glEndQuery\0" + "glEndQueryARB\0" + "\0" + /* _mesa_function_pool[10692]: DeleteFencesNV (will be remapped) */ + "ip\0" + "glDeleteFencesNV\0" + "\0" + /* _mesa_function_pool[10713]: DepthMask (offset 211) */ + "i\0" + "glDepthMask\0" + "\0" + /* _mesa_function_pool[10728]: IsShader (will be remapped) */ + "i\0" + "glIsShader\0" + "\0" + /* _mesa_function_pool[10742]: Indexf (offset 46) */ + "f\0" + "glIndexf\0" + "\0" + /* _mesa_function_pool[10754]: GetImageTransformParameterivHP (dynamic) */ + "iip\0" + "glGetImageTransformParameterivHP\0" + "\0" + /* _mesa_function_pool[10792]: Indexd (offset 44) */ + "d\0" + "glIndexd\0" + "\0" + /* _mesa_function_pool[10804]: GetMaterialiv (offset 270) */ + "iip\0" + "glGetMaterialiv\0" + "\0" + /* _mesa_function_pool[10825]: StencilOp (offset 244) */ + "iii\0" + "glStencilOp\0" + "\0" + /* _mesa_function_pool[10842]: WindowPos4ivMESA (will be remapped) */ + "p\0" + "glWindowPos4ivMESA\0" + "\0" + /* _mesa_function_pool[10864]: MultiTexCoord3svARB (offset 399) */ + "ip\0" + "glMultiTexCoord3sv\0" + "glMultiTexCoord3svARB\0" + "\0" + /* _mesa_function_pool[10909]: TexEnvfv (offset 185) */ + "iip\0" + "glTexEnvfv\0" + "\0" + /* _mesa_function_pool[10925]: MultiTexCoord4iARB (offset 404) */ + "iiiii\0" + "glMultiTexCoord4i\0" + "glMultiTexCoord4iARB\0" + "\0" + /* _mesa_function_pool[10971]: Indexs (offset 50) */ + "i\0" + "glIndexs\0" + "\0" + /* _mesa_function_pool[10983]: Binormal3ivEXT (dynamic) */ + "p\0" + "glBinormal3ivEXT\0" + "\0" + /* _mesa_function_pool[11003]: ResizeBuffersMESA (will be remapped) */ + "\0" + "glResizeBuffersMESA\0" + "\0" + /* _mesa_function_pool[11025]: GetUniformivARB (will be remapped) */ + "iip\0" + "glGetUniformiv\0" + "glGetUniformivARB\0" + "\0" + /* _mesa_function_pool[11063]: PixelTexGenParameteriSGIS (will be remapped) */ + "ii\0" + "glPixelTexGenParameteriSGIS\0" + "\0" + /* _mesa_function_pool[11095]: VertexPointervINTEL (dynamic) */ + "iip\0" + "glVertexPointervINTEL\0" + "\0" + /* _mesa_function_pool[11122]: Vertex2i (offset 130) */ + "ii\0" + "glVertex2i\0" + "\0" + /* _mesa_function_pool[11137]: LoadMatrixf (offset 291) */ + "p\0" + "glLoadMatrixf\0" + "\0" + /* _mesa_function_pool[11154]: Vertex2f (offset 128) */ + "ff\0" + "glVertex2f\0" + "\0" + /* _mesa_function_pool[11169]: ReplacementCodeuiColor4fNormal3fVertex3fvSUN (dynamic) */ + "pppp\0" + "glReplacementCodeuiColor4fNormal3fVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[11222]: Color4bv (offset 26) */ + "p\0" + "glColor4bv\0" + "\0" + /* _mesa_function_pool[11236]: VertexPointer (offset 321) */ + "iiip\0" + "glVertexPointer\0" + "\0" + /* _mesa_function_pool[11258]: SecondaryColor3uiEXT (will be remapped) */ + "iii\0" + "glSecondaryColor3ui\0" + "glSecondaryColor3uiEXT\0" + "\0" + /* _mesa_function_pool[11306]: StartInstrumentsSGIX (dynamic) */ + "\0" + "glStartInstrumentsSGIX\0" + "\0" + /* _mesa_function_pool[11331]: SecondaryColor3usvEXT (will be remapped) */ + "p\0" + "glSecondaryColor3usv\0" + "glSecondaryColor3usvEXT\0" + "\0" + /* _mesa_function_pool[11379]: VertexAttrib2fvNV (will be remapped) */ + "ip\0" + "glVertexAttrib2fvNV\0" + "\0" + /* _mesa_function_pool[11403]: ProgramLocalParameter4dvARB (will be remapped) */ + "iip\0" + "glProgramLocalParameter4dvARB\0" + "\0" + /* _mesa_function_pool[11438]: DeleteLists (offset 4) */ + "ii\0" + "glDeleteLists\0" + "\0" + /* _mesa_function_pool[11456]: LogicOp (offset 242) */ + "i\0" + "glLogicOp\0" + "\0" + /* _mesa_function_pool[11469]: MatrixIndexuivARB (dynamic) */ + "ip\0" + "glMatrixIndexuivARB\0" + "\0" + /* _mesa_function_pool[11493]: Vertex2s (offset 132) */ + "ii\0" + "glVertex2s\0" + "\0" + /* _mesa_function_pool[11508]: RenderbufferStorageMultisample (will be remapped) */ + "iiiii\0" + "glRenderbufferStorageMultisample\0" + "\0" + /* _mesa_function_pool[11548]: TexCoord4fv (offset 121) */ + "p\0" + "glTexCoord4fv\0" + "\0" + /* _mesa_function_pool[11565]: Tangent3sEXT (dynamic) */ + "iii\0" + "glTangent3sEXT\0" + "\0" + /* _mesa_function_pool[11585]: GlobalAlphaFactorfSUN (dynamic) */ + "f\0" + "glGlobalAlphaFactorfSUN\0" + "\0" + /* _mesa_function_pool[11612]: MultiTexCoord3iARB (offset 396) */ + "iiii\0" + "glMultiTexCoord3i\0" + "glMultiTexCoord3iARB\0" + "\0" + /* _mesa_function_pool[11657]: IsProgram (will be remapped) */ + "i\0" + "glIsProgram\0" + "\0" + /* _mesa_function_pool[11672]: TexCoordPointerListIBM (dynamic) */ + "iiipi\0" + "glTexCoordPointerListIBM\0" + "\0" + /* _mesa_function_pool[11704]: GlobalAlphaFactorusSUN (dynamic) */ + "i\0" + "glGlobalAlphaFactorusSUN\0" + "\0" + /* _mesa_function_pool[11732]: VertexAttrib2dvNV (will be remapped) */ + "ip\0" + "glVertexAttrib2dvNV\0" + "\0" + /* _mesa_function_pool[11756]: FramebufferRenderbufferEXT (will be remapped) */ + "iiii\0" + "glFramebufferRenderbuffer\0" + "glFramebufferRenderbufferEXT\0" + "\0" + /* _mesa_function_pool[11817]: VertexAttrib1dvNV (will be remapped) */ + "ip\0" + "glVertexAttrib1dvNV\0" + "\0" + /* _mesa_function_pool[11841]: GenTextures (offset 328) */ + "ip\0" + "glGenTextures\0" + "glGenTexturesEXT\0" + "\0" + /* _mesa_function_pool[11876]: SetFenceNV (will be remapped) */ + "ii\0" + "glSetFenceNV\0" + "\0" + /* _mesa_function_pool[11893]: FramebufferTexture1DEXT (will be remapped) */ + "iiiii\0" + "glFramebufferTexture1D\0" + "glFramebufferTexture1DEXT\0" + "\0" + /* _mesa_function_pool[11949]: GetCombinerOutputParameterivNV (will be remapped) */ + "iiip\0" + "glGetCombinerOutputParameterivNV\0" + "\0" + /* _mesa_function_pool[11988]: MultiModeDrawArraysIBM (will be remapped) */ + "pppii\0" + "glMultiModeDrawArraysIBM\0" + "\0" + /* _mesa_function_pool[12020]: PixelTexGenParameterivSGIS (will be remapped) */ + "ip\0" + "glPixelTexGenParameterivSGIS\0" + "\0" + /* _mesa_function_pool[12053]: TextureNormalEXT (dynamic) */ + "i\0" + "glTextureNormalEXT\0" + "\0" + /* _mesa_function_pool[12075]: IndexPointerListIBM (dynamic) */ + "iipi\0" + "glIndexPointerListIBM\0" + "\0" + /* _mesa_function_pool[12103]: WeightfvARB (dynamic) */ + "ip\0" + "glWeightfvARB\0" + "\0" + /* _mesa_function_pool[12121]: RasterPos2sv (offset 69) */ + "p\0" + "glRasterPos2sv\0" + "\0" + /* _mesa_function_pool[12139]: Color4ubv (offset 36) */ + "p\0" + "glColor4ubv\0" + "\0" + /* _mesa_function_pool[12154]: DrawBuffer (offset 202) */ + "i\0" + "glDrawBuffer\0" + "\0" + /* _mesa_function_pool[12170]: TexCoord2fv (offset 105) */ + "p\0" + "glTexCoord2fv\0" + "\0" + /* _mesa_function_pool[12187]: WindowPos4fMESA (will be remapped) */ + "ffff\0" + "glWindowPos4fMESA\0" + "\0" + /* _mesa_function_pool[12211]: TexCoord1sv (offset 101) */ + "p\0" + "glTexCoord1sv\0" + "\0" + /* _mesa_function_pool[12228]: WindowPos3dvMESA (will be remapped) */ + "p\0" + "glWindowPos3dv\0" + "glWindowPos3dvARB\0" + "glWindowPos3dvMESA\0" + "\0" + /* _mesa_function_pool[12283]: DepthFunc (offset 245) */ + "i\0" + "glDepthFunc\0" + "\0" + /* _mesa_function_pool[12298]: PixelMapusv (offset 253) */ + "iip\0" + "glPixelMapusv\0" + "\0" + /* _mesa_function_pool[12317]: GetQueryObjecti64vEXT (will be remapped) */ + "iip\0" + "glGetQueryObjecti64vEXT\0" + "\0" + /* _mesa_function_pool[12346]: MultiTexCoord1dARB (offset 376) */ + "id\0" + "glMultiTexCoord1d\0" + "glMultiTexCoord1dARB\0" + "\0" + /* _mesa_function_pool[12389]: PointParameterivNV (will be remapped) */ + "ip\0" + "glPointParameteriv\0" + "glPointParameterivNV\0" + "\0" + /* _mesa_function_pool[12433]: BlendFunc (offset 241) */ + "ii\0" + "glBlendFunc\0" + "\0" + /* _mesa_function_pool[12449]: Uniform2fvARB (will be remapped) */ + "iip\0" + "glUniform2fv\0" + "glUniform2fvARB\0" + "\0" + /* _mesa_function_pool[12483]: BufferParameteriAPPLE (will be remapped) */ + "iii\0" + "glBufferParameteriAPPLE\0" + "\0" + /* _mesa_function_pool[12512]: MultiTexCoord3dvARB (offset 393) */ + "ip\0" + "glMultiTexCoord3dv\0" + "glMultiTexCoord3dvARB\0" + "\0" + /* _mesa_function_pool[12557]: ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (dynamic) */ + "pppp\0" + "glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[12613]: DeleteObjectARB (will be remapped) */ + "i\0" + "glDeleteObjectARB\0" + "\0" + /* _mesa_function_pool[12634]: MatrixIndexPointerARB (dynamic) */ + "iiip\0" + "glMatrixIndexPointerARB\0" + "\0" + /* _mesa_function_pool[12664]: ProgramNamedParameter4dvNV (will be remapped) */ + "iipp\0" + "glProgramNamedParameter4dvNV\0" + "\0" + /* _mesa_function_pool[12699]: Tangent3fvEXT (dynamic) */ + "p\0" + "glTangent3fvEXT\0" + "\0" + /* _mesa_function_pool[12718]: Flush (offset 217) */ + "\0" + "glFlush\0" + "\0" + /* _mesa_function_pool[12728]: Color4uiv (offset 38) */ + "p\0" + "glColor4uiv\0" + "\0" + /* _mesa_function_pool[12743]: GenVertexArrays (will be remapped) */ + "ip\0" + "glGenVertexArrays\0" + "\0" + /* _mesa_function_pool[12765]: RasterPos3sv (offset 77) */ + "p\0" + "glRasterPos3sv\0" + "\0" + /* _mesa_function_pool[12783]: BindFramebufferEXT (will be remapped) */ + "ii\0" + "glBindFramebuffer\0" + "glBindFramebufferEXT\0" + "\0" + /* _mesa_function_pool[12826]: ReferencePlaneSGIX (dynamic) */ + "p\0" + "glReferencePlaneSGIX\0" + "\0" + /* _mesa_function_pool[12850]: PushAttrib (offset 219) */ + "i\0" + "glPushAttrib\0" + "\0" + /* _mesa_function_pool[12866]: RasterPos2i (offset 66) */ + "ii\0" + "glRasterPos2i\0" + "\0" + /* _mesa_function_pool[12884]: ValidateProgramARB (will be remapped) */ + "i\0" + "glValidateProgram\0" + "glValidateProgramARB\0" + "\0" + /* _mesa_function_pool[12926]: TexParameteriv (offset 181) */ + "iip\0" + "glTexParameteriv\0" + "\0" + /* _mesa_function_pool[12948]: UnlockArraysEXT (will be remapped) */ + "\0" + "glUnlockArraysEXT\0" + "\0" + /* _mesa_function_pool[12968]: TexCoord2fColor3fVertex3fSUN (dynamic) */ + "ffffffff\0" + "glTexCoord2fColor3fVertex3fSUN\0" + "\0" + /* _mesa_function_pool[13009]: WindowPos3fvMESA (will be remapped) */ + "p\0" + "glWindowPos3fv\0" + "glWindowPos3fvARB\0" + "glWindowPos3fvMESA\0" + "\0" + /* _mesa_function_pool[13064]: RasterPos2f (offset 64) */ + "ff\0" + "glRasterPos2f\0" + "\0" + /* _mesa_function_pool[13082]: VertexAttrib1svNV (will be remapped) */ + "ip\0" + "glVertexAttrib1svNV\0" + "\0" + /* _mesa_function_pool[13106]: RasterPos2d (offset 62) */ + "dd\0" + "glRasterPos2d\0" + "\0" + /* _mesa_function_pool[13124]: RasterPos3fv (offset 73) */ + "p\0" + "glRasterPos3fv\0" + "\0" + /* _mesa_function_pool[13142]: CopyTexSubImage3D (offset 373) */ + "iiiiiiiii\0" + "glCopyTexSubImage3D\0" + "glCopyTexSubImage3DEXT\0" + "\0" + /* _mesa_function_pool[13196]: VertexAttrib2dARB (will be remapped) */ + "idd\0" + "glVertexAttrib2d\0" + "glVertexAttrib2dARB\0" + "\0" + /* _mesa_function_pool[13238]: Color4ub (offset 35) */ + "iiii\0" + "glColor4ub\0" + "\0" + /* _mesa_function_pool[13255]: GetInteger64v (will be remapped) */ + "ip\0" + "glGetInteger64v\0" + "\0" + /* _mesa_function_pool[13275]: TextureColorMaskSGIS (dynamic) */ + "iiii\0" + "glTextureColorMaskSGIS\0" + "\0" + /* _mesa_function_pool[13304]: RasterPos2s (offset 68) */ + "ii\0" + "glRasterPos2s\0" + "\0" + /* _mesa_function_pool[13322]: GetColorTable (offset 343) */ + "iiip\0" + "glGetColorTable\0" + "glGetColorTableSGI\0" + "glGetColorTableEXT\0" + "\0" + /* _mesa_function_pool[13382]: SelectBuffer (offset 195) */ + "ip\0" + "glSelectBuffer\0" + "\0" + /* _mesa_function_pool[13401]: Indexiv (offset 49) */ + "p\0" + "glIndexiv\0" + "\0" + /* _mesa_function_pool[13414]: TexCoord3i (offset 114) */ + "iii\0" + "glTexCoord3i\0" + "\0" + /* _mesa_function_pool[13432]: CopyColorTable (offset 342) */ + "iiiii\0" + "glCopyColorTable\0" + "glCopyColorTableSGI\0" + "\0" + /* _mesa_function_pool[13476]: GetHistogramParameterfv (offset 362) */ + "iip\0" + "glGetHistogramParameterfv\0" + "glGetHistogramParameterfvEXT\0" + "\0" + /* _mesa_function_pool[13536]: Frustum (offset 289) */ + "dddddd\0" + "glFrustum\0" + "\0" + /* _mesa_function_pool[13554]: GetString (offset 275) */ + "i\0" + "glGetString\0" + "\0" + /* _mesa_function_pool[13569]: ColorPointervINTEL (dynamic) */ + "iip\0" + "glColorPointervINTEL\0" + "\0" + /* _mesa_function_pool[13595]: TexEnvf (offset 184) */ + "iif\0" + "glTexEnvf\0" + "\0" + /* _mesa_function_pool[13610]: TexCoord3d (offset 110) */ + "ddd\0" + "glTexCoord3d\0" + "\0" + /* _mesa_function_pool[13628]: AlphaFragmentOp1ATI (will be remapped) */ + "iiiiii\0" + "glAlphaFragmentOp1ATI\0" + "\0" + /* _mesa_function_pool[13658]: TexCoord3f (offset 112) */ + "fff\0" + "glTexCoord3f\0" + "\0" + /* _mesa_function_pool[13676]: MultiTexCoord3ivARB (offset 397) */ + "ip\0" + "glMultiTexCoord3iv\0" + "glMultiTexCoord3ivARB\0" + "\0" + /* _mesa_function_pool[13721]: MultiTexCoord2sARB (offset 390) */ + "iii\0" + "glMultiTexCoord2s\0" + "glMultiTexCoord2sARB\0" + "\0" + /* _mesa_function_pool[13765]: VertexAttrib1dvARB (will be remapped) */ + "ip\0" + "glVertexAttrib1dv\0" + "glVertexAttrib1dvARB\0" + "\0" + /* _mesa_function_pool[13808]: DeleteTextures (offset 327) */ + "ip\0" + "glDeleteTextures\0" + "glDeleteTexturesEXT\0" + "\0" + /* _mesa_function_pool[13849]: TexCoordPointerEXT (will be remapped) */ + "iiiip\0" + "glTexCoordPointerEXT\0" + "\0" + /* _mesa_function_pool[13877]: TexSubImage4DSGIS (dynamic) */ + "iiiiiiiiiiiip\0" + "glTexSubImage4DSGIS\0" + "\0" + /* _mesa_function_pool[13912]: TexCoord3s (offset 116) */ + "iii\0" + "glTexCoord3s\0" + "\0" + /* _mesa_function_pool[13930]: GetTexLevelParameteriv (offset 285) */ + "iiip\0" + "glGetTexLevelParameteriv\0" + "\0" + /* _mesa_function_pool[13961]: CombinerStageParameterfvNV (dynamic) */ + "iip\0" + "glCombinerStageParameterfvNV\0" + "\0" + /* _mesa_function_pool[13995]: StopInstrumentsSGIX (dynamic) */ + "i\0" + "glStopInstrumentsSGIX\0" + "\0" + /* _mesa_function_pool[14020]: TexCoord4fColor4fNormal3fVertex4fSUN (dynamic) */ + "fffffffffffffff\0" + "glTexCoord4fColor4fNormal3fVertex4fSUN\0" + "\0" + /* _mesa_function_pool[14076]: ClearAccum (offset 204) */ + "ffff\0" + "glClearAccum\0" + "\0" + /* _mesa_function_pool[14095]: DeformSGIX (dynamic) */ + "i\0" + "glDeformSGIX\0" + "\0" + /* _mesa_function_pool[14111]: GetVertexAttribfvARB (will be remapped) */ + "iip\0" + "glGetVertexAttribfv\0" + "glGetVertexAttribfvARB\0" + "\0" + /* _mesa_function_pool[14159]: SecondaryColor3ivEXT (will be remapped) */ + "p\0" + "glSecondaryColor3iv\0" + "glSecondaryColor3ivEXT\0" + "\0" + /* _mesa_function_pool[14205]: TexCoord4iv (offset 123) */ + "p\0" + "glTexCoord4iv\0" + "\0" + /* _mesa_function_pool[14222]: UniformMatrix4x2fv (will be remapped) */ + "iiip\0" + "glUniformMatrix4x2fv\0" + "\0" + /* _mesa_function_pool[14249]: GetDetailTexFuncSGIS (dynamic) */ + "ip\0" + "glGetDetailTexFuncSGIS\0" + "\0" + /* _mesa_function_pool[14276]: GetCombinerStageParameterfvNV (dynamic) */ + "iip\0" + "glGetCombinerStageParameterfvNV\0" + "\0" + /* _mesa_function_pool[14313]: PolygonOffset (offset 319) */ + "ff\0" + "glPolygonOffset\0" + "\0" + /* _mesa_function_pool[14333]: BindVertexArray (will be remapped) */ + "i\0" + "glBindVertexArray\0" + "\0" + /* _mesa_function_pool[14354]: Color4ubVertex2fvSUN (dynamic) */ + "pp\0" + "glColor4ubVertex2fvSUN\0" + "\0" + /* _mesa_function_pool[14381]: Rectd (offset 86) */ + "dddd\0" + "glRectd\0" + "\0" + /* _mesa_function_pool[14395]: TexFilterFuncSGIS (dynamic) */ + "iiip\0" + "glTexFilterFuncSGIS\0" + "\0" + /* _mesa_function_pool[14421]: SampleMaskSGIS (will be remapped) */ + "fi\0" + "glSampleMaskSGIS\0" + "glSampleMaskEXT\0" + "\0" + /* _mesa_function_pool[14458]: GetAttribLocationARB (will be remapped) */ + "ip\0" + "glGetAttribLocation\0" + "glGetAttribLocationARB\0" + "\0" + /* _mesa_function_pool[14505]: RasterPos3i (offset 74) */ + "iii\0" + "glRasterPos3i\0" + "\0" + /* _mesa_function_pool[14524]: VertexAttrib4ubvARB (will be remapped) */ + "ip\0" + "glVertexAttrib4ubv\0" + "glVertexAttrib4ubvARB\0" + "\0" + /* _mesa_function_pool[14569]: DetailTexFuncSGIS (dynamic) */ + "iip\0" + "glDetailTexFuncSGIS\0" + "\0" + /* _mesa_function_pool[14594]: Normal3fVertex3fSUN (dynamic) */ + "ffffff\0" + "glNormal3fVertex3fSUN\0" + "\0" + /* _mesa_function_pool[14624]: CopyTexImage2D (offset 324) */ + "iiiiiiii\0" + "glCopyTexImage2D\0" + "glCopyTexImage2DEXT\0" + "\0" + /* _mesa_function_pool[14671]: GetBufferPointervARB (will be remapped) */ + "iip\0" + "glGetBufferPointerv\0" + "glGetBufferPointervARB\0" + "\0" + /* _mesa_function_pool[14719]: ProgramEnvParameter4fARB (will be remapped) */ + "iiffff\0" + "glProgramEnvParameter4fARB\0" + "glProgramParameter4fNV\0" + "\0" + /* _mesa_function_pool[14777]: Uniform3ivARB (will be remapped) */ + "iip\0" + "glUniform3iv\0" + "glUniform3ivARB\0" + "\0" + /* _mesa_function_pool[14811]: Lightfv (offset 160) */ + "iip\0" + "glLightfv\0" + "\0" + /* _mesa_function_pool[14826]: ClearDepth (offset 208) */ + "d\0" + "glClearDepth\0" + "\0" + /* _mesa_function_pool[14842]: GetFenceivNV (will be remapped) */ + "iip\0" + "glGetFenceivNV\0" + "\0" + /* _mesa_function_pool[14862]: WindowPos4dvMESA (will be remapped) */ + "p\0" + "glWindowPos4dvMESA\0" + "\0" + /* _mesa_function_pool[14884]: ColorSubTable (offset 346) */ + "iiiiip\0" + "glColorSubTable\0" + "glColorSubTableEXT\0" + "\0" + /* _mesa_function_pool[14927]: Color4fv (offset 30) */ + "p\0" + "glColor4fv\0" + "\0" + /* _mesa_function_pool[14941]: MultiTexCoord4ivARB (offset 405) */ + "ip\0" + "glMultiTexCoord4iv\0" + "glMultiTexCoord4ivARB\0" + "\0" + /* _mesa_function_pool[14986]: ProgramLocalParameters4fvEXT (will be remapped) */ + "iiip\0" + "glProgramLocalParameters4fvEXT\0" + "\0" + /* _mesa_function_pool[15023]: ColorPointer (offset 308) */ + "iiip\0" + "glColorPointer\0" + "\0" + /* _mesa_function_pool[15044]: Rects (offset 92) */ + "iiii\0" + "glRects\0" + "\0" + /* _mesa_function_pool[15058]: GetMapAttribParameterfvNV (dynamic) */ + "iiip\0" + "glGetMapAttribParameterfvNV\0" + "\0" + /* _mesa_function_pool[15092]: Lightiv (offset 162) */ + "iip\0" + "glLightiv\0" + "\0" + /* _mesa_function_pool[15107]: VertexAttrib4sARB (will be remapped) */ + "iiiii\0" + "glVertexAttrib4s\0" + "glVertexAttrib4sARB\0" + "\0" + /* _mesa_function_pool[15151]: GetQueryObjectuivARB (will be remapped) */ + "iip\0" + "glGetQueryObjectuiv\0" + "glGetQueryObjectuivARB\0" + "\0" + /* _mesa_function_pool[15199]: GetTexParameteriv (offset 283) */ + "iip\0" + "glGetTexParameteriv\0" + "\0" + /* _mesa_function_pool[15224]: MapParameterivNV (dynamic) */ + "iip\0" + "glMapParameterivNV\0" + "\0" + /* _mesa_function_pool[15248]: GenRenderbuffersEXT (will be remapped) */ + "ip\0" + "glGenRenderbuffers\0" + "glGenRenderbuffersEXT\0" + "\0" + /* _mesa_function_pool[15293]: VertexAttrib2dvARB (will be remapped) */ + "ip\0" + "glVertexAttrib2dv\0" + "glVertexAttrib2dvARB\0" + "\0" + /* _mesa_function_pool[15336]: EdgeFlagPointerEXT (will be remapped) */ + "iip\0" + "glEdgeFlagPointerEXT\0" + "\0" + /* _mesa_function_pool[15362]: VertexAttribs2svNV (will be remapped) */ + "iip\0" + "glVertexAttribs2svNV\0" + "\0" + /* _mesa_function_pool[15388]: WeightbvARB (dynamic) */ + "ip\0" + "glWeightbvARB\0" + "\0" + /* _mesa_function_pool[15406]: VertexAttrib2fvARB (will be remapped) */ + "ip\0" + "glVertexAttrib2fv\0" + "glVertexAttrib2fvARB\0" + "\0" + /* _mesa_function_pool[15449]: GetBufferParameterivARB (will be remapped) */ + "iip\0" + "glGetBufferParameteriv\0" + "glGetBufferParameterivARB\0" + "\0" + /* _mesa_function_pool[15503]: Rectdv (offset 87) */ + "pp\0" + "glRectdv\0" + "\0" + /* _mesa_function_pool[15516]: ListParameteriSGIX (dynamic) */ + "iii\0" + "glListParameteriSGIX\0" + "\0" + /* _mesa_function_pool[15542]: ReplacementCodeuiColor4fNormal3fVertex3fSUN (dynamic) */ + "iffffffffff\0" + "glReplacementCodeuiColor4fNormal3fVertex3fSUN\0" + "\0" + /* _mesa_function_pool[15601]: InstrumentsBufferSGIX (dynamic) */ + "ip\0" + "glInstrumentsBufferSGIX\0" + "\0" + /* _mesa_function_pool[15629]: VertexAttrib4NivARB (will be remapped) */ + "ip\0" + "glVertexAttrib4Niv\0" + "glVertexAttrib4NivARB\0" + "\0" + /* _mesa_function_pool[15674]: GetAttachedShaders (will be remapped) */ + "iipp\0" + "glGetAttachedShaders\0" + "\0" + /* _mesa_function_pool[15701]: GenVertexArraysAPPLE (will be remapped) */ + "ip\0" + "glGenVertexArraysAPPLE\0" + "\0" + /* _mesa_function_pool[15728]: Materialiv (offset 172) */ + "iip\0" + "glMaterialiv\0" + "\0" + /* _mesa_function_pool[15746]: PushClientAttrib (offset 335) */ + "i\0" + "glPushClientAttrib\0" + "\0" + /* _mesa_function_pool[15768]: ProgramEnvParameters4fvEXT (will be remapped) */ + "iiip\0" + "glProgramEnvParameters4fvEXT\0" + "\0" + /* _mesa_function_pool[15803]: TexCoord2fColor4fNormal3fVertex3fvSUN (dynamic) */ + "pppp\0" + "glTexCoord2fColor4fNormal3fVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[15849]: WindowPos2iMESA (will be remapped) */ + "ii\0" + "glWindowPos2i\0" + "glWindowPos2iARB\0" + "glWindowPos2iMESA\0" + "\0" + /* _mesa_function_pool[15902]: SecondaryColor3fvEXT (will be remapped) */ + "p\0" + "glSecondaryColor3fv\0" + "glSecondaryColor3fvEXT\0" + "\0" + /* _mesa_function_pool[15948]: PolygonMode (offset 174) */ + "ii\0" + "glPolygonMode\0" + "\0" + /* _mesa_function_pool[15966]: CompressedTexSubImage1DARB (will be remapped) */ + "iiiiiip\0" + "glCompressedTexSubImage1D\0" + "glCompressedTexSubImage1DARB\0" + "\0" + /* _mesa_function_pool[16030]: GetVertexAttribivNV (will be remapped) */ + "iip\0" + "glGetVertexAttribivNV\0" + "\0" + /* _mesa_function_pool[16057]: GetProgramStringARB (will be remapped) */ + "iip\0" + "glGetProgramStringARB\0" + "\0" + /* _mesa_function_pool[16084]: TexBumpParameterfvATI (will be remapped) */ + "ip\0" + "glTexBumpParameterfvATI\0" + "\0" + /* _mesa_function_pool[16112]: CompileShaderARB (will be remapped) */ + "i\0" + "glCompileShader\0" + "glCompileShaderARB\0" + "\0" + /* _mesa_function_pool[16150]: DeleteShader (will be remapped) */ + "i\0" + "glDeleteShader\0" + "\0" + /* _mesa_function_pool[16168]: DisableClientState (offset 309) */ + "i\0" + "glDisableClientState\0" + "\0" + /* _mesa_function_pool[16192]: TexGeni (offset 192) */ + "iii\0" + "glTexGeni\0" + "\0" + /* _mesa_function_pool[16207]: TexGenf (offset 190) */ + "iif\0" + "glTexGenf\0" + "\0" + /* _mesa_function_pool[16222]: Uniform3fARB (will be remapped) */ + "ifff\0" + "glUniform3f\0" + "glUniform3fARB\0" + "\0" + /* _mesa_function_pool[16255]: TexGend (offset 188) */ + "iid\0" + "glTexGend\0" + "\0" + /* _mesa_function_pool[16270]: ListParameterfvSGIX (dynamic) */ + "iip\0" + "glListParameterfvSGIX\0" + "\0" + /* _mesa_function_pool[16297]: GetPolygonStipple (offset 274) */ + "p\0" + "glGetPolygonStipple\0" + "\0" + /* _mesa_function_pool[16320]: Tangent3dvEXT (dynamic) */ + "p\0" + "glTangent3dvEXT\0" + "\0" + /* _mesa_function_pool[16339]: GetVertexAttribfvNV (will be remapped) */ + "iip\0" + "glGetVertexAttribfvNV\0" + "\0" + /* _mesa_function_pool[16366]: WindowPos3sMESA (will be remapped) */ + "iii\0" + "glWindowPos3s\0" + "glWindowPos3sARB\0" + "glWindowPos3sMESA\0" + "\0" + /* _mesa_function_pool[16420]: VertexAttrib2svNV (will be remapped) */ + "ip\0" + "glVertexAttrib2svNV\0" + "\0" + /* _mesa_function_pool[16444]: VertexAttribs1fvNV (will be remapped) */ + "iip\0" + "glVertexAttribs1fvNV\0" + "\0" + /* _mesa_function_pool[16470]: TexCoord2fVertex3fvSUN (dynamic) */ + "pp\0" + "glTexCoord2fVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[16499]: WindowPos4sMESA (will be remapped) */ + "iiii\0" + "glWindowPos4sMESA\0" + "\0" + /* _mesa_function_pool[16523]: VertexAttrib4NuivARB (will be remapped) */ + "ip\0" + "glVertexAttrib4Nuiv\0" + "glVertexAttrib4NuivARB\0" + "\0" + /* _mesa_function_pool[16570]: ClientActiveTextureARB (offset 375) */ + "i\0" + "glClientActiveTexture\0" + "glClientActiveTextureARB\0" + "\0" + /* _mesa_function_pool[16620]: PixelTexGenSGIX (will be remapped) */ + "i\0" + "glPixelTexGenSGIX\0" + "\0" + /* _mesa_function_pool[16641]: ReplacementCodeusvSUN (dynamic) */ + "p\0" + "glReplacementCodeusvSUN\0" + "\0" + /* _mesa_function_pool[16668]: Uniform4fARB (will be remapped) */ + "iffff\0" + "glUniform4f\0" + "glUniform4fARB\0" + "\0" + /* _mesa_function_pool[16702]: Color4sv (offset 34) */ + "p\0" + "glColor4sv\0" + "\0" + /* _mesa_function_pool[16716]: FlushMappedBufferRange (will be remapped) */ + "iii\0" + "glFlushMappedBufferRange\0" + "\0" + /* _mesa_function_pool[16746]: IsProgramNV (will be remapped) */ + "i\0" + "glIsProgramARB\0" + "glIsProgramNV\0" + "\0" + /* _mesa_function_pool[16778]: FlushMappedBufferRangeAPPLE (will be remapped) */ + "iii\0" + "glFlushMappedBufferRangeAPPLE\0" + "\0" + /* _mesa_function_pool[16813]: PixelZoom (offset 246) */ + "ff\0" + "glPixelZoom\0" + "\0" + /* _mesa_function_pool[16829]: ReplacementCodePointerSUN (dynamic) */ + "iip\0" + "glReplacementCodePointerSUN\0" + "\0" + /* _mesa_function_pool[16862]: ProgramEnvParameter4dARB (will be remapped) */ + "iidddd\0" + "glProgramEnvParameter4dARB\0" + "glProgramParameter4dNV\0" + "\0" + /* _mesa_function_pool[16920]: ColorTableParameterfv (offset 340) */ + "iip\0" + "glColorTableParameterfv\0" + "glColorTableParameterfvSGI\0" + "\0" + /* _mesa_function_pool[16976]: FragmentLightModelfSGIX (dynamic) */ + "if\0" + "glFragmentLightModelfSGIX\0" + "\0" + /* _mesa_function_pool[17006]: Binormal3bvEXT (dynamic) */ + "p\0" + "glBinormal3bvEXT\0" + "\0" + /* _mesa_function_pool[17026]: PixelMapuiv (offset 252) */ + "iip\0" + "glPixelMapuiv\0" + "\0" + /* _mesa_function_pool[17045]: Color3dv (offset 12) */ + "p\0" + "glColor3dv\0" + "\0" + /* _mesa_function_pool[17059]: IsTexture (offset 330) */ + "i\0" + "glIsTexture\0" + "glIsTextureEXT\0" + "\0" + /* _mesa_function_pool[17089]: VertexWeightfvEXT (dynamic) */ + "p\0" + "glVertexWeightfvEXT\0" + "\0" + /* _mesa_function_pool[17112]: VertexAttrib1dARB (will be remapped) */ + "id\0" + "glVertexAttrib1d\0" + "glVertexAttrib1dARB\0" + "\0" + /* _mesa_function_pool[17153]: ImageTransformParameterivHP (dynamic) */ + "iip\0" + "glImageTransformParameterivHP\0" + "\0" + /* _mesa_function_pool[17188]: TexCoord4i (offset 122) */ + "iiii\0" + "glTexCoord4i\0" + "\0" + /* _mesa_function_pool[17207]: DeleteQueriesARB (will be remapped) */ + "ip\0" + "glDeleteQueries\0" + "glDeleteQueriesARB\0" + "\0" + /* _mesa_function_pool[17246]: Color4ubVertex2fSUN (dynamic) */ + "iiiiff\0" + "glColor4ubVertex2fSUN\0" + "\0" + /* _mesa_function_pool[17276]: FragmentColorMaterialSGIX (dynamic) */ + "ii\0" + "glFragmentColorMaterialSGIX\0" + "\0" + /* _mesa_function_pool[17308]: CurrentPaletteMatrixARB (dynamic) */ + "i\0" + "glCurrentPaletteMatrixARB\0" + "\0" + /* _mesa_function_pool[17337]: GetMapdv (offset 266) */ + "iip\0" + "glGetMapdv\0" + "\0" + /* _mesa_function_pool[17353]: SamplePatternSGIS (will be remapped) */ + "i\0" + "glSamplePatternSGIS\0" + "glSamplePatternEXT\0" + "\0" + /* _mesa_function_pool[17395]: PixelStoref (offset 249) */ + "if\0" + "glPixelStoref\0" + "\0" + /* _mesa_function_pool[17413]: IsQueryARB (will be remapped) */ + "i\0" + "glIsQuery\0" + "glIsQueryARB\0" + "\0" + /* _mesa_function_pool[17439]: ReplacementCodeuiColor4ubVertex3fSUN (dynamic) */ + "iiiiifff\0" + "glReplacementCodeuiColor4ubVertex3fSUN\0" + "\0" + /* _mesa_function_pool[17488]: PixelStorei (offset 250) */ + "ii\0" + "glPixelStorei\0" + "\0" + /* _mesa_function_pool[17506]: VertexAttrib4usvARB (will be remapped) */ + "ip\0" + "glVertexAttrib4usv\0" + "glVertexAttrib4usvARB\0" + "\0" + /* _mesa_function_pool[17551]: LinkProgramARB (will be remapped) */ + "i\0" + "glLinkProgram\0" + "glLinkProgramARB\0" + "\0" + /* _mesa_function_pool[17585]: VertexAttrib2fNV (will be remapped) */ + "iff\0" + "glVertexAttrib2fNV\0" + "\0" + /* _mesa_function_pool[17609]: ShaderSourceARB (will be remapped) */ + "iipp\0" + "glShaderSource\0" + "glShaderSourceARB\0" + "\0" + /* _mesa_function_pool[17648]: FragmentMaterialiSGIX (dynamic) */ + "iii\0" + "glFragmentMaterialiSGIX\0" + "\0" + /* _mesa_function_pool[17677]: EvalCoord2dv (offset 233) */ + "p\0" + "glEvalCoord2dv\0" + "\0" + /* _mesa_function_pool[17695]: VertexAttrib3svARB (will be remapped) */ + "ip\0" + "glVertexAttrib3sv\0" + "glVertexAttrib3svARB\0" + "\0" + /* _mesa_function_pool[17738]: ColorMaterial (offset 151) */ + "ii\0" + "glColorMaterial\0" + "\0" + /* _mesa_function_pool[17758]: CompressedTexSubImage3DARB (will be remapped) */ + "iiiiiiiiiip\0" + "glCompressedTexSubImage3D\0" + "glCompressedTexSubImage3DARB\0" + "\0" + /* _mesa_function_pool[17826]: WindowPos2ivMESA (will be remapped) */ + "p\0" + "glWindowPos2iv\0" + "glWindowPos2ivARB\0" + "glWindowPos2ivMESA\0" + "\0" + /* _mesa_function_pool[17881]: IsFramebufferEXT (will be remapped) */ + "i\0" + "glIsFramebuffer\0" + "glIsFramebufferEXT\0" + "\0" + /* _mesa_function_pool[17919]: Uniform4ivARB (will be remapped) */ + "iip\0" + "glUniform4iv\0" + "glUniform4ivARB\0" + "\0" + /* _mesa_function_pool[17953]: GetVertexAttribdvARB (will be remapped) */ + "iip\0" + "glGetVertexAttribdv\0" + "glGetVertexAttribdvARB\0" + "\0" + /* _mesa_function_pool[18001]: TexBumpParameterivATI (will be remapped) */ + "ip\0" + "glTexBumpParameterivATI\0" + "\0" + /* _mesa_function_pool[18029]: GetSeparableFilter (offset 359) */ + "iiippp\0" + "glGetSeparableFilter\0" + "glGetSeparableFilterEXT\0" + "\0" + /* _mesa_function_pool[18082]: Binormal3dEXT (dynamic) */ + "ddd\0" + "glBinormal3dEXT\0" + "\0" + /* _mesa_function_pool[18103]: SpriteParameteriSGIX (dynamic) */ + "ii\0" + "glSpriteParameteriSGIX\0" + "\0" + /* _mesa_function_pool[18130]: RequestResidentProgramsNV (will be remapped) */ + "ip\0" + "glRequestResidentProgramsNV\0" + "\0" + /* _mesa_function_pool[18162]: TagSampleBufferSGIX (dynamic) */ + "\0" + "glTagSampleBufferSGIX\0" + "\0" + /* _mesa_function_pool[18186]: ReplacementCodeusSUN (dynamic) */ + "i\0" + "glReplacementCodeusSUN\0" + "\0" + /* _mesa_function_pool[18212]: FeedbackBuffer (offset 194) */ + "iip\0" + "glFeedbackBuffer\0" + "\0" + /* _mesa_function_pool[18234]: RasterPos2iv (offset 67) */ + "p\0" + "glRasterPos2iv\0" + "\0" + /* _mesa_function_pool[18252]: TexImage1D (offset 182) */ + "iiiiiiip\0" + "glTexImage1D\0" + "\0" + /* _mesa_function_pool[18275]: ListParameterivSGIX (dynamic) */ + "iip\0" + "glListParameterivSGIX\0" + "\0" + /* _mesa_function_pool[18302]: MultiDrawElementsEXT (will be remapped) */ + "ipipi\0" + "glMultiDrawElements\0" + "glMultiDrawElementsEXT\0" + "\0" + /* _mesa_function_pool[18352]: Color3s (offset 17) */ + "iii\0" + "glColor3s\0" + "\0" + /* _mesa_function_pool[18367]: Uniform1ivARB (will be remapped) */ + "iip\0" + "glUniform1iv\0" + "glUniform1ivARB\0" + "\0" + /* _mesa_function_pool[18401]: WindowPos2sMESA (will be remapped) */ + "ii\0" + "glWindowPos2s\0" + "glWindowPos2sARB\0" + "glWindowPos2sMESA\0" + "\0" + /* _mesa_function_pool[18454]: WeightusvARB (dynamic) */ + "ip\0" + "glWeightusvARB\0" + "\0" + /* _mesa_function_pool[18473]: TexCoordPointer (offset 320) */ + "iiip\0" + "glTexCoordPointer\0" + "\0" + /* _mesa_function_pool[18497]: FogCoordPointerEXT (will be remapped) */ + "iip\0" + "glFogCoordPointer\0" + "glFogCoordPointerEXT\0" + "\0" + /* _mesa_function_pool[18541]: IndexMaterialEXT (dynamic) */ + "ii\0" + "glIndexMaterialEXT\0" + "\0" + /* _mesa_function_pool[18564]: Color3i (offset 15) */ + "iii\0" + "glColor3i\0" + "\0" + /* _mesa_function_pool[18579]: FrontFace (offset 157) */ + "i\0" + "glFrontFace\0" + "\0" + /* _mesa_function_pool[18594]: EvalCoord2d (offset 232) */ + "dd\0" + "glEvalCoord2d\0" + "\0" + /* _mesa_function_pool[18612]: SecondaryColor3ubvEXT (will be remapped) */ + "p\0" + "glSecondaryColor3ubv\0" + "glSecondaryColor3ubvEXT\0" + "\0" + /* _mesa_function_pool[18660]: EvalCoord2f (offset 234) */ + "ff\0" + "glEvalCoord2f\0" + "\0" + /* _mesa_function_pool[18678]: VertexAttrib4dvARB (will be remapped) */ + "ip\0" + "glVertexAttrib4dv\0" + "glVertexAttrib4dvARB\0" + "\0" + /* _mesa_function_pool[18721]: BindAttribLocationARB (will be remapped) */ + "iip\0" + "glBindAttribLocation\0" + "glBindAttribLocationARB\0" + "\0" + /* _mesa_function_pool[18771]: Color3b (offset 9) */ + "iii\0" + "glColor3b\0" + "\0" + /* _mesa_function_pool[18786]: MultiTexCoord2dARB (offset 384) */ + "idd\0" + "glMultiTexCoord2d\0" + "glMultiTexCoord2dARB\0" + "\0" + /* _mesa_function_pool[18830]: ExecuteProgramNV (will be remapped) */ + "iip\0" + "glExecuteProgramNV\0" + "\0" + /* _mesa_function_pool[18854]: Color3f (offset 13) */ + "fff\0" + "glColor3f\0" + "\0" + /* _mesa_function_pool[18869]: LightEnviSGIX (dynamic) */ + "ii\0" + "glLightEnviSGIX\0" + "\0" + /* _mesa_function_pool[18889]: Color3d (offset 11) */ + "ddd\0" + "glColor3d\0" + "\0" + /* _mesa_function_pool[18904]: Normal3dv (offset 55) */ + "p\0" + "glNormal3dv\0" + "\0" + /* _mesa_function_pool[18919]: Lightf (offset 159) */ + "iif\0" + "glLightf\0" + "\0" + /* _mesa_function_pool[18933]: ReplacementCodeuiSUN (dynamic) */ + "i\0" + "glReplacementCodeuiSUN\0" + "\0" + /* _mesa_function_pool[18959]: MatrixMode (offset 293) */ + "i\0" + "glMatrixMode\0" + "\0" + /* _mesa_function_pool[18975]: GetPixelMapusv (offset 273) */ + "ip\0" + "glGetPixelMapusv\0" + "\0" + /* _mesa_function_pool[18996]: Lighti (offset 161) */ + "iii\0" + "glLighti\0" + "\0" + /* _mesa_function_pool[19010]: VertexAttribPointerNV (will be remapped) */ + "iiiip\0" + "glVertexAttribPointerNV\0" + "\0" + /* _mesa_function_pool[19041]: GetFramebufferAttachmentParameterivEXT (will be remapped) */ + "iiip\0" + "glGetFramebufferAttachmentParameteriv\0" + "glGetFramebufferAttachmentParameterivEXT\0" + "\0" + /* _mesa_function_pool[19126]: PixelTransformParameterfEXT (dynamic) */ + "iif\0" + "glPixelTransformParameterfEXT\0" + "\0" + /* _mesa_function_pool[19161]: MultiTexCoord4dvARB (offset 401) */ + "ip\0" + "glMultiTexCoord4dv\0" + "glMultiTexCoord4dvARB\0" + "\0" + /* _mesa_function_pool[19206]: PixelTransformParameteriEXT (dynamic) */ + "iii\0" + "glPixelTransformParameteriEXT\0" + "\0" + /* _mesa_function_pool[19241]: GetDoublev (offset 260) */ + "ip\0" + "glGetDoublev\0" + "\0" + /* _mesa_function_pool[19258]: MultMatrixd (offset 295) */ + "p\0" + "glMultMatrixd\0" + "\0" + /* _mesa_function_pool[19275]: MultMatrixf (offset 294) */ + "p\0" + "glMultMatrixf\0" + "\0" + /* _mesa_function_pool[19292]: TexCoord2fColor4ubVertex3fSUN (dynamic) */ + "ffiiiifff\0" + "glTexCoord2fColor4ubVertex3fSUN\0" + "\0" + /* _mesa_function_pool[19335]: Uniform1iARB (will be remapped) */ + "ii\0" + "glUniform1i\0" + "glUniform1iARB\0" + "\0" + /* _mesa_function_pool[19366]: VertexAttribPointerARB (will be remapped) */ + "iiiiip\0" + "glVertexAttribPointer\0" + "glVertexAttribPointerARB\0" + "\0" + /* _mesa_function_pool[19421]: SharpenTexFuncSGIS (dynamic) */ + "iip\0" + "glSharpenTexFuncSGIS\0" + "\0" + /* _mesa_function_pool[19447]: MultiTexCoord4fvARB (offset 403) */ + "ip\0" + "glMultiTexCoord4fv\0" + "glMultiTexCoord4fvARB\0" + "\0" + /* _mesa_function_pool[19492]: UniformMatrix2x3fv (will be remapped) */ + "iiip\0" + "glUniformMatrix2x3fv\0" + "\0" + /* _mesa_function_pool[19519]: TrackMatrixNV (will be remapped) */ + "iiii\0" + "glTrackMatrixNV\0" + "\0" + /* _mesa_function_pool[19541]: CombinerParameteriNV (will be remapped) */ + "ii\0" + "glCombinerParameteriNV\0" + "\0" + /* _mesa_function_pool[19568]: DeleteAsyncMarkersSGIX (dynamic) */ + "ii\0" + "glDeleteAsyncMarkersSGIX\0" + "\0" + /* _mesa_function_pool[19597]: IsAsyncMarkerSGIX (dynamic) */ + "i\0" + "glIsAsyncMarkerSGIX\0" + "\0" + /* _mesa_function_pool[19620]: FrameZoomSGIX (dynamic) */ + "i\0" + "glFrameZoomSGIX\0" + "\0" + /* _mesa_function_pool[19639]: Normal3fVertex3fvSUN (dynamic) */ + "pp\0" + "glNormal3fVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[19666]: RasterPos4sv (offset 85) */ + "p\0" + "glRasterPos4sv\0" + "\0" + /* _mesa_function_pool[19684]: VertexAttrib4NsvARB (will be remapped) */ + "ip\0" + "glVertexAttrib4Nsv\0" + "glVertexAttrib4NsvARB\0" + "\0" + /* _mesa_function_pool[19729]: VertexAttrib3fvARB (will be remapped) */ + "ip\0" + "glVertexAttrib3fv\0" + "glVertexAttrib3fvARB\0" + "\0" + /* _mesa_function_pool[19772]: ClearColor (offset 206) */ + "ffff\0" + "glClearColor\0" + "\0" + /* _mesa_function_pool[19791]: GetSynciv (will be remapped) */ + "iiipp\0" + "glGetSynciv\0" + "\0" + /* _mesa_function_pool[19810]: DeleteFramebuffersEXT (will be remapped) */ + "ip\0" + "glDeleteFramebuffers\0" + "glDeleteFramebuffersEXT\0" + "\0" + /* _mesa_function_pool[19859]: GlobalAlphaFactorsSUN (dynamic) */ + "i\0" + "glGlobalAlphaFactorsSUN\0" + "\0" + /* _mesa_function_pool[19886]: TexEnviv (offset 187) */ + "iip\0" + "glTexEnviv\0" + "\0" + /* _mesa_function_pool[19902]: TexSubImage3D (offset 372) */ + "iiiiiiiiiip\0" + "glTexSubImage3D\0" + "glTexSubImage3DEXT\0" + "\0" + /* _mesa_function_pool[19950]: Tangent3fEXT (dynamic) */ + "fff\0" + "glTangent3fEXT\0" + "\0" + /* _mesa_function_pool[19970]: SecondaryColor3uivEXT (will be remapped) */ + "p\0" + "glSecondaryColor3uiv\0" + "glSecondaryColor3uivEXT\0" + "\0" + /* _mesa_function_pool[20018]: MatrixIndexubvARB (dynamic) */ + "ip\0" + "glMatrixIndexubvARB\0" + "\0" + /* _mesa_function_pool[20042]: Color4fNormal3fVertex3fSUN (dynamic) */ + "ffffffffff\0" + "glColor4fNormal3fVertex3fSUN\0" + "\0" + /* _mesa_function_pool[20083]: PixelTexGenParameterfSGIS (will be remapped) */ + "if\0" + "glPixelTexGenParameterfSGIS\0" + "\0" + /* _mesa_function_pool[20115]: CreateShader (will be remapped) */ + "i\0" + "glCreateShader\0" + "\0" + /* _mesa_function_pool[20133]: GetColorTableParameterfv (offset 344) */ + "iip\0" + "glGetColorTableParameterfv\0" + "glGetColorTableParameterfvSGI\0" + "glGetColorTableParameterfvEXT\0" + "\0" + /* _mesa_function_pool[20225]: FragmentLightModelfvSGIX (dynamic) */ + "ip\0" + "glFragmentLightModelfvSGIX\0" + "\0" + /* _mesa_function_pool[20256]: Bitmap (offset 8) */ + "iiffffp\0" + "glBitmap\0" + "\0" + /* _mesa_function_pool[20274]: MultiTexCoord3fARB (offset 394) */ + "ifff\0" + "glMultiTexCoord3f\0" + "glMultiTexCoord3fARB\0" + "\0" + /* _mesa_function_pool[20319]: GetTexLevelParameterfv (offset 284) */ + "iiip\0" + "glGetTexLevelParameterfv\0" + "\0" + /* _mesa_function_pool[20350]: GetPixelTexGenParameterfvSGIS (will be remapped) */ + "ip\0" + "glGetPixelTexGenParameterfvSGIS\0" + "\0" + /* _mesa_function_pool[20386]: GenFramebuffersEXT (will be remapped) */ + "ip\0" + "glGenFramebuffers\0" + "glGenFramebuffersEXT\0" + "\0" + /* _mesa_function_pool[20429]: GetProgramParameterdvNV (will be remapped) */ + "iiip\0" + "glGetProgramParameterdvNV\0" + "\0" + /* _mesa_function_pool[20461]: Vertex2sv (offset 133) */ + "p\0" + "glVertex2sv\0" + "\0" + /* _mesa_function_pool[20476]: GetIntegerv (offset 263) */ + "ip\0" + "glGetIntegerv\0" + "\0" + /* _mesa_function_pool[20494]: IsVertexArrayAPPLE (will be remapped) */ + "i\0" + "glIsVertexArray\0" + "glIsVertexArrayAPPLE\0" + "\0" + /* _mesa_function_pool[20534]: FragmentLightfvSGIX (dynamic) */ + "iip\0" + "glFragmentLightfvSGIX\0" + "\0" + /* _mesa_function_pool[20561]: DetachShader (will be remapped) */ + "ii\0" + "glDetachShader\0" + "\0" + /* _mesa_function_pool[20580]: VertexAttrib4NubARB (will be remapped) */ + "iiiii\0" + "glVertexAttrib4Nub\0" + "glVertexAttrib4NubARB\0" + "\0" + /* _mesa_function_pool[20628]: GetProgramEnvParameterfvARB (will be remapped) */ + "iip\0" + "glGetProgramEnvParameterfvARB\0" + "\0" + /* _mesa_function_pool[20663]: GetTrackMatrixivNV (will be remapped) */ + "iiip\0" + "glGetTrackMatrixivNV\0" + "\0" + /* _mesa_function_pool[20690]: VertexAttrib3svNV (will be remapped) */ + "ip\0" + "glVertexAttrib3svNV\0" + "\0" + /* _mesa_function_pool[20714]: Uniform4fvARB (will be remapped) */ + "iip\0" + "glUniform4fv\0" + "glUniform4fvARB\0" + "\0" + /* _mesa_function_pool[20748]: MultTransposeMatrixfARB (will be remapped) */ + "p\0" + "glMultTransposeMatrixf\0" + "glMultTransposeMatrixfARB\0" + "\0" + /* _mesa_function_pool[20800]: GetTexEnviv (offset 277) */ + "iip\0" + "glGetTexEnviv\0" + "\0" + /* _mesa_function_pool[20819]: ColorFragmentOp1ATI (will be remapped) */ + "iiiiiii\0" + "glColorFragmentOp1ATI\0" + "\0" + /* _mesa_function_pool[20850]: GetUniformfvARB (will be remapped) */ + "iip\0" + "glGetUniformfv\0" + "glGetUniformfvARB\0" + "\0" + /* _mesa_function_pool[20888]: PopClientAttrib (offset 334) */ + "\0" + "glPopClientAttrib\0" + "\0" + /* _mesa_function_pool[20908]: ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (dynamic) */ + "iffffffffffff\0" + "glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN\0" + "\0" + /* _mesa_function_pool[20979]: DetachObjectARB (will be remapped) */ + "ii\0" + "glDetachObjectARB\0" + "\0" + /* _mesa_function_pool[21001]: VertexBlendARB (dynamic) */ + "i\0" + "glVertexBlendARB\0" + "\0" + /* _mesa_function_pool[21021]: WindowPos3iMESA (will be remapped) */ + "iii\0" + "glWindowPos3i\0" + "glWindowPos3iARB\0" + "glWindowPos3iMESA\0" + "\0" + /* _mesa_function_pool[21075]: SeparableFilter2D (offset 360) */ + "iiiiiipp\0" + "glSeparableFilter2D\0" + "glSeparableFilter2DEXT\0" + "\0" + /* _mesa_function_pool[21128]: ReplacementCodeuiColor4ubVertex3fvSUN (dynamic) */ + "ppp\0" + "glReplacementCodeuiColor4ubVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[21173]: Map1d (offset 220) */ + "iddiip\0" + "glMap1d\0" + "\0" + /* _mesa_function_pool[21189]: Map1f (offset 221) */ + "iffiip\0" + "glMap1f\0" + "\0" + /* _mesa_function_pool[21205]: CompressedTexImage2DARB (will be remapped) */ + "iiiiiiip\0" + "glCompressedTexImage2D\0" + "glCompressedTexImage2DARB\0" + "\0" + /* _mesa_function_pool[21264]: ArrayElement (offset 306) */ + "i\0" + "glArrayElement\0" + "glArrayElementEXT\0" + "\0" + /* _mesa_function_pool[21300]: TexImage2D (offset 183) */ + "iiiiiiiip\0" + "glTexImage2D\0" + "\0" + /* _mesa_function_pool[21324]: DepthBoundsEXT (will be remapped) */ + "dd\0" + "glDepthBoundsEXT\0" + "\0" + /* _mesa_function_pool[21345]: ProgramParameters4fvNV (will be remapped) */ + "iiip\0" + "glProgramParameters4fvNV\0" + "\0" + /* _mesa_function_pool[21376]: DeformationMap3fSGIX (dynamic) */ + "iffiiffiiffiip\0" + "glDeformationMap3fSGIX\0" + "\0" + /* _mesa_function_pool[21415]: GetProgramivNV (will be remapped) */ + "iip\0" + "glGetProgramivNV\0" + "\0" + /* _mesa_function_pool[21437]: GetMinmaxParameteriv (offset 366) */ + "iip\0" + "glGetMinmaxParameteriv\0" + "glGetMinmaxParameterivEXT\0" + "\0" + /* _mesa_function_pool[21491]: PixelTransferf (offset 247) */ + "if\0" + "glPixelTransferf\0" + "\0" + /* _mesa_function_pool[21512]: CopyTexImage1D (offset 323) */ + "iiiiiii\0" + "glCopyTexImage1D\0" + "glCopyTexImage1DEXT\0" + "\0" + /* _mesa_function_pool[21558]: PushMatrix (offset 298) */ + "\0" + "glPushMatrix\0" + "\0" + /* _mesa_function_pool[21573]: Fogiv (offset 156) */ + "ip\0" + "glFogiv\0" + "\0" + /* _mesa_function_pool[21585]: TexCoord1dv (offset 95) */ + "p\0" + "glTexCoord1dv\0" + "\0" + /* _mesa_function_pool[21602]: AlphaFragmentOp3ATI (will be remapped) */ + "iiiiiiiiiiii\0" + "glAlphaFragmentOp3ATI\0" + "\0" + /* _mesa_function_pool[21638]: PixelTransferi (offset 248) */ + "ii\0" + "glPixelTransferi\0" + "\0" + /* _mesa_function_pool[21659]: GetVertexAttribdvNV (will be remapped) */ + "iip\0" + "glGetVertexAttribdvNV\0" + "\0" + /* _mesa_function_pool[21686]: VertexAttrib3fvNV (will be remapped) */ + "ip\0" + "glVertexAttrib3fvNV\0" + "\0" + /* _mesa_function_pool[21710]: Rotatef (offset 300) */ + "ffff\0" + "glRotatef\0" + "\0" + /* _mesa_function_pool[21726]: GetFinalCombinerInputParameterivNV (will be remapped) */ + "iip\0" + "glGetFinalCombinerInputParameterivNV\0" + "\0" + /* _mesa_function_pool[21768]: Vertex3i (offset 138) */ + "iii\0" + "glVertex3i\0" + "\0" + /* _mesa_function_pool[21784]: Vertex3f (offset 136) */ + "fff\0" + "glVertex3f\0" + "\0" + /* _mesa_function_pool[21800]: Clear (offset 203) */ + "i\0" + "glClear\0" + "\0" + /* _mesa_function_pool[21811]: Vertex3d (offset 134) */ + "ddd\0" + "glVertex3d\0" + "\0" + /* _mesa_function_pool[21827]: GetMapParameterivNV (dynamic) */ + "iip\0" + "glGetMapParameterivNV\0" + "\0" + /* _mesa_function_pool[21854]: Uniform4iARB (will be remapped) */ + "iiiii\0" + "glUniform4i\0" + "glUniform4iARB\0" + "\0" + /* _mesa_function_pool[21888]: ReadBuffer (offset 254) */ + "i\0" + "glReadBuffer\0" + "\0" + /* _mesa_function_pool[21904]: ConvolutionParameteri (offset 352) */ + "iii\0" + "glConvolutionParameteri\0" + "glConvolutionParameteriEXT\0" + "\0" + /* _mesa_function_pool[21960]: Ortho (offset 296) */ + "dddddd\0" + "glOrtho\0" + "\0" + /* _mesa_function_pool[21976]: Binormal3sEXT (dynamic) */ + "iii\0" + "glBinormal3sEXT\0" + "\0" + /* _mesa_function_pool[21997]: ListBase (offset 6) */ + "i\0" + "glListBase\0" + "\0" + /* _mesa_function_pool[22011]: Vertex3s (offset 140) */ + "iii\0" + "glVertex3s\0" + "\0" + /* _mesa_function_pool[22027]: ConvolutionParameterf (offset 350) */ + "iif\0" + "glConvolutionParameterf\0" + "glConvolutionParameterfEXT\0" + "\0" + /* _mesa_function_pool[22083]: GetColorTableParameteriv (offset 345) */ + "iip\0" + "glGetColorTableParameteriv\0" + "glGetColorTableParameterivSGI\0" + "glGetColorTableParameterivEXT\0" + "\0" + /* _mesa_function_pool[22175]: ProgramEnvParameter4dvARB (will be remapped) */ + "iip\0" + "glProgramEnvParameter4dvARB\0" + "glProgramParameter4dvNV\0" + "\0" + /* _mesa_function_pool[22232]: ShadeModel (offset 177) */ + "i\0" + "glShadeModel\0" + "\0" + /* _mesa_function_pool[22248]: VertexAttribs2fvNV (will be remapped) */ + "iip\0" + "glVertexAttribs2fvNV\0" + "\0" + /* _mesa_function_pool[22274]: Rectiv (offset 91) */ + "pp\0" + "glRectiv\0" + "\0" + /* _mesa_function_pool[22287]: UseProgramObjectARB (will be remapped) */ + "i\0" + "glUseProgram\0" + "glUseProgramObjectARB\0" + "\0" + /* _mesa_function_pool[22325]: GetMapParameterfvNV (dynamic) */ + "iip\0" + "glGetMapParameterfvNV\0" + "\0" + /* _mesa_function_pool[22352]: PassTexCoordATI (will be remapped) */ + "iii\0" + "glPassTexCoordATI\0" + "\0" + /* _mesa_function_pool[22375]: DeleteProgram (will be remapped) */ + "i\0" + "glDeleteProgram\0" + "\0" + /* _mesa_function_pool[22394]: Tangent3ivEXT (dynamic) */ + "p\0" + "glTangent3ivEXT\0" + "\0" + /* _mesa_function_pool[22413]: Tangent3dEXT (dynamic) */ + "ddd\0" + "glTangent3dEXT\0" + "\0" + /* _mesa_function_pool[22433]: SecondaryColor3dvEXT (will be remapped) */ + "p\0" + "glSecondaryColor3dv\0" + "glSecondaryColor3dvEXT\0" + "\0" + /* _mesa_function_pool[22479]: Vertex2fv (offset 129) */ + "p\0" + "glVertex2fv\0" + "\0" + /* _mesa_function_pool[22494]: MultiDrawArraysEXT (will be remapped) */ + "ippi\0" + "glMultiDrawArrays\0" + "glMultiDrawArraysEXT\0" + "\0" + /* _mesa_function_pool[22539]: BindRenderbufferEXT (will be remapped) */ + "ii\0" + "glBindRenderbuffer\0" + "glBindRenderbufferEXT\0" + "\0" + /* _mesa_function_pool[22584]: MultiTexCoord4dARB (offset 400) */ + "idddd\0" + "glMultiTexCoord4d\0" + "glMultiTexCoord4dARB\0" + "\0" + /* _mesa_function_pool[22630]: Vertex3sv (offset 141) */ + "p\0" + "glVertex3sv\0" + "\0" + /* _mesa_function_pool[22645]: SecondaryColor3usEXT (will be remapped) */ + "iii\0" + "glSecondaryColor3us\0" + "glSecondaryColor3usEXT\0" + "\0" + /* _mesa_function_pool[22693]: ProgramLocalParameter4fvARB (will be remapped) */ + "iip\0" + "glProgramLocalParameter4fvARB\0" + "\0" + /* _mesa_function_pool[22728]: DeleteProgramsNV (will be remapped) */ + "ip\0" + "glDeleteProgramsARB\0" + "glDeleteProgramsNV\0" + "\0" + /* _mesa_function_pool[22771]: EvalMesh1 (offset 236) */ + "iii\0" + "glEvalMesh1\0" + "\0" + /* _mesa_function_pool[22788]: MultiTexCoord1sARB (offset 382) */ + "ii\0" + "glMultiTexCoord1s\0" + "glMultiTexCoord1sARB\0" + "\0" + /* _mesa_function_pool[22831]: ReplacementCodeuiColor3fVertex3fSUN (dynamic) */ + "iffffff\0" + "glReplacementCodeuiColor3fVertex3fSUN\0" + "\0" + /* _mesa_function_pool[22878]: GetVertexAttribPointervNV (will be remapped) */ + "iip\0" + "glGetVertexAttribPointerv\0" + "glGetVertexAttribPointervARB\0" + "glGetVertexAttribPointervNV\0" + "\0" + /* _mesa_function_pool[22966]: MultiTexCoord1dvARB (offset 377) */ + "ip\0" + "glMultiTexCoord1dv\0" + "glMultiTexCoord1dvARB\0" + "\0" + /* _mesa_function_pool[23011]: Uniform2iARB (will be remapped) */ + "iii\0" + "glUniform2i\0" + "glUniform2iARB\0" + "\0" + /* _mesa_function_pool[23043]: Vertex2iv (offset 131) */ + "p\0" + "glVertex2iv\0" + "\0" + /* _mesa_function_pool[23058]: GetProgramStringNV (will be remapped) */ + "iip\0" + "glGetProgramStringNV\0" + "\0" + /* _mesa_function_pool[23084]: ColorPointerEXT (will be remapped) */ + "iiiip\0" + "glColorPointerEXT\0" + "\0" + /* _mesa_function_pool[23109]: LineWidth (offset 168) */ + "f\0" + "glLineWidth\0" + "\0" + /* _mesa_function_pool[23124]: MapBufferARB (will be remapped) */ + "ii\0" + "glMapBuffer\0" + "glMapBufferARB\0" + "\0" + /* _mesa_function_pool[23155]: MultiDrawElementsBaseVertex (will be remapped) */ + "ipipip\0" + "glMultiDrawElementsBaseVertex\0" + "\0" + /* _mesa_function_pool[23193]: Binormal3svEXT (dynamic) */ + "p\0" + "glBinormal3svEXT\0" + "\0" + /* _mesa_function_pool[23213]: ApplyTextureEXT (dynamic) */ + "i\0" + "glApplyTextureEXT\0" + "\0" + /* _mesa_function_pool[23234]: TexGendv (offset 189) */ + "iip\0" + "glTexGendv\0" + "\0" + /* _mesa_function_pool[23250]: TextureMaterialEXT (dynamic) */ + "ii\0" + "glTextureMaterialEXT\0" + "\0" + /* _mesa_function_pool[23275]: TextureLightEXT (dynamic) */ + "i\0" + "glTextureLightEXT\0" + "\0" + /* _mesa_function_pool[23296]: ResetMinmax (offset 370) */ + "i\0" + "glResetMinmax\0" + "glResetMinmaxEXT\0" + "\0" + /* _mesa_function_pool[23330]: SpriteParameterfSGIX (dynamic) */ + "if\0" + "glSpriteParameterfSGIX\0" + "\0" + /* _mesa_function_pool[23357]: EnableClientState (offset 313) */ + "i\0" + "glEnableClientState\0" + "\0" + /* _mesa_function_pool[23380]: VertexAttrib4sNV (will be remapped) */ + "iiiii\0" + "glVertexAttrib4sNV\0" + "\0" + /* _mesa_function_pool[23406]: GetConvolutionParameterfv (offset 357) */ + "iip\0" + "glGetConvolutionParameterfv\0" + "glGetConvolutionParameterfvEXT\0" + "\0" + /* _mesa_function_pool[23470]: VertexAttribs4dvNV (will be remapped) */ + "iip\0" + "glVertexAttribs4dvNV\0" + "\0" + /* _mesa_function_pool[23496]: VertexAttrib4dARB (will be remapped) */ + "idddd\0" + "glVertexAttrib4d\0" + "glVertexAttrib4dARB\0" + "\0" + /* _mesa_function_pool[23540]: GetTexBumpParameterfvATI (will be remapped) */ + "ip\0" + "glGetTexBumpParameterfvATI\0" + "\0" + /* _mesa_function_pool[23571]: ProgramNamedParameter4dNV (will be remapped) */ + "iipdddd\0" + "glProgramNamedParameter4dNV\0" + "\0" + /* _mesa_function_pool[23608]: GetMaterialfv (offset 269) */ + "iip\0" + "glGetMaterialfv\0" + "\0" + /* _mesa_function_pool[23629]: VertexWeightfEXT (dynamic) */ + "f\0" + "glVertexWeightfEXT\0" + "\0" + /* _mesa_function_pool[23651]: Binormal3fEXT (dynamic) */ + "fff\0" + "glBinormal3fEXT\0" + "\0" + /* _mesa_function_pool[23672]: CallList (offset 2) */ + "i\0" + "glCallList\0" + "\0" + /* _mesa_function_pool[23686]: Materialfv (offset 170) */ + "iip\0" + "glMaterialfv\0" + "\0" + /* _mesa_function_pool[23704]: TexCoord3fv (offset 113) */ + "p\0" + "glTexCoord3fv\0" + "\0" + /* _mesa_function_pool[23721]: FogCoordfvEXT (will be remapped) */ + "p\0" + "glFogCoordfv\0" + "glFogCoordfvEXT\0" + "\0" + /* _mesa_function_pool[23753]: MultiTexCoord1ivARB (offset 381) */ + "ip\0" + "glMultiTexCoord1iv\0" + "glMultiTexCoord1ivARB\0" + "\0" + /* _mesa_function_pool[23798]: SecondaryColor3ubEXT (will be remapped) */ + "iii\0" + "glSecondaryColor3ub\0" + "glSecondaryColor3ubEXT\0" + "\0" + /* _mesa_function_pool[23846]: MultiTexCoord2ivARB (offset 389) */ + "ip\0" + "glMultiTexCoord2iv\0" + "glMultiTexCoord2ivARB\0" + "\0" + /* _mesa_function_pool[23891]: FogFuncSGIS (dynamic) */ + "ip\0" + "glFogFuncSGIS\0" + "\0" + /* _mesa_function_pool[23909]: CopyTexSubImage2D (offset 326) */ + "iiiiiiii\0" + "glCopyTexSubImage2D\0" + "glCopyTexSubImage2DEXT\0" + "\0" + /* _mesa_function_pool[23962]: GetObjectParameterivARB (will be remapped) */ + "iip\0" + "glGetObjectParameterivARB\0" + "\0" + /* _mesa_function_pool[23993]: Color3iv (offset 16) */ + "p\0" + "glColor3iv\0" + "\0" + /* _mesa_function_pool[24007]: TexCoord4fVertex4fSUN (dynamic) */ + "ffffffff\0" + "glTexCoord4fVertex4fSUN\0" + "\0" + /* _mesa_function_pool[24041]: DrawElements (offset 311) */ + "iiip\0" + "glDrawElements\0" + "\0" + /* _mesa_function_pool[24062]: BindVertexArrayAPPLE (will be remapped) */ + "i\0" + "glBindVertexArrayAPPLE\0" + "\0" + /* _mesa_function_pool[24088]: GetProgramLocalParameterdvARB (will be remapped) */ + "iip\0" + "glGetProgramLocalParameterdvARB\0" + "\0" + /* _mesa_function_pool[24125]: GetHistogramParameteriv (offset 363) */ + "iip\0" + "glGetHistogramParameteriv\0" + "glGetHistogramParameterivEXT\0" + "\0" + /* _mesa_function_pool[24185]: MultiTexCoord1iARB (offset 380) */ + "ii\0" + "glMultiTexCoord1i\0" + "glMultiTexCoord1iARB\0" + "\0" + /* _mesa_function_pool[24228]: GetConvolutionFilter (offset 356) */ + "iiip\0" + "glGetConvolutionFilter\0" + "glGetConvolutionFilterEXT\0" + "\0" + /* _mesa_function_pool[24283]: GetProgramivARB (will be remapped) */ + "iip\0" + "glGetProgramivARB\0" + "\0" + /* _mesa_function_pool[24306]: BlendFuncSeparateEXT (will be remapped) */ + "iiii\0" + "glBlendFuncSeparate\0" + "glBlendFuncSeparateEXT\0" + "glBlendFuncSeparateINGR\0" + "\0" + /* _mesa_function_pool[24379]: MapBufferRange (will be remapped) */ + "iiii\0" + "glMapBufferRange\0" + "\0" + /* _mesa_function_pool[24402]: ProgramParameters4dvNV (will be remapped) */ + "iiip\0" + "glProgramParameters4dvNV\0" + "\0" + /* _mesa_function_pool[24433]: TexCoord2fColor3fVertex3fvSUN (dynamic) */ + "ppp\0" + "glTexCoord2fColor3fVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[24470]: EvalPoint2 (offset 239) */ + "ii\0" + "glEvalPoint2\0" + "\0" + /* _mesa_function_pool[24487]: EvalPoint1 (offset 237) */ + "i\0" + "glEvalPoint1\0" + "\0" + /* _mesa_function_pool[24503]: Binormal3dvEXT (dynamic) */ + "p\0" + "glBinormal3dvEXT\0" + "\0" + /* _mesa_function_pool[24523]: PopMatrix (offset 297) */ + "\0" + "glPopMatrix\0" + "\0" + /* _mesa_function_pool[24537]: FinishFenceNV (will be remapped) */ + "i\0" + "glFinishFenceNV\0" + "\0" + /* _mesa_function_pool[24556]: GetFogFuncSGIS (dynamic) */ + "p\0" + "glGetFogFuncSGIS\0" + "\0" + /* _mesa_function_pool[24576]: GetUniformLocationARB (will be remapped) */ + "ip\0" + "glGetUniformLocation\0" + "glGetUniformLocationARB\0" + "\0" + /* _mesa_function_pool[24625]: SecondaryColor3fEXT (will be remapped) */ + "fff\0" + "glSecondaryColor3f\0" + "glSecondaryColor3fEXT\0" + "\0" + /* _mesa_function_pool[24671]: GetTexGeniv (offset 280) */ + "iip\0" + "glGetTexGeniv\0" + "\0" + /* _mesa_function_pool[24690]: CombinerInputNV (will be remapped) */ + "iiiiii\0" + "glCombinerInputNV\0" + "\0" + /* _mesa_function_pool[24716]: VertexAttrib3sARB (will be remapped) */ + "iiii\0" + "glVertexAttrib3s\0" + "glVertexAttrib3sARB\0" + "\0" + /* _mesa_function_pool[24759]: ReplacementCodeuiNormal3fVertex3fvSUN (dynamic) */ + "ppp\0" + "glReplacementCodeuiNormal3fVertex3fvSUN\0" + "\0" + /* _mesa_function_pool[24804]: Map2d (offset 222) */ + "iddiiddiip\0" + "glMap2d\0" + "\0" + /* _mesa_function_pool[24824]: Map2f (offset 223) */ + "iffiiffiip\0" + "glMap2f\0" + "\0" + /* _mesa_function_pool[24844]: ProgramStringARB (will be remapped) */ + "iiip\0" + "glProgramStringARB\0" + "\0" + /* _mesa_function_pool[24869]: Vertex4s (offset 148) */ + "iiii\0" + "glVertex4s\0" + "\0" + /* _mesa_function_pool[24886]: TexCoord4fVertex4fvSUN (dynamic) */ + "pp\0" + "glTexCoord4fVertex4fvSUN\0" + "\0" + /* _mesa_function_pool[24915]: VertexAttrib3sNV (will be remapped) */ + "iiii\0" + "glVertexAttrib3sNV\0" + "\0" + /* _mesa_function_pool[24940]: VertexAttrib1fNV (will be remapped) */ + "if\0" + "glVertexAttrib1fNV\0" + "\0" + /* _mesa_function_pool[24963]: Vertex4f (offset 144) */ + "ffff\0" + "glVertex4f\0" + "\0" + /* _mesa_function_pool[24980]: EvalCoord1d (offset 228) */ + "d\0" + "glEvalCoord1d\0" + "\0" + /* _mesa_function_pool[24997]: Vertex4d (offset 142) */ + "dddd\0" + "glVertex4d\0" + "\0" + /* _mesa_function_pool[25014]: RasterPos4dv (offset 79) */ + "p\0" + "glRasterPos4dv\0" + "\0" + /* _mesa_function_pool[25032]: FragmentLightfSGIX (dynamic) */ + "iif\0" + "glFragmentLightfSGIX\0" + "\0" + /* _mesa_function_pool[25058]: GetCompressedTexImageARB (will be remapped) */ + "iip\0" + "glGetCompressedTexImage\0" + "glGetCompressedTexImageARB\0" + "\0" + /* _mesa_function_pool[25114]: GetTexGenfv (offset 279) */ + "iip\0" + "glGetTexGenfv\0" + "\0" + /* _mesa_function_pool[25133]: Vertex4i (offset 146) */ + "iiii\0" + "glVertex4i\0" + "\0" + /* _mesa_function_pool[25150]: VertexWeightPointerEXT (dynamic) */ + "iiip\0" + "glVertexWeightPointerEXT\0" + "\0" + /* _mesa_function_pool[25181]: GetHistogram (offset 361) */ + "iiiip\0" + "glGetHistogram\0" + "glGetHistogramEXT\0" + "\0" + /* _mesa_function_pool[25221]: ActiveStencilFaceEXT (will be remapped) */ + "i\0" + "glActiveStencilFaceEXT\0" + "\0" + /* _mesa_function_pool[25247]: StencilFuncSeparateATI (will be remapped) */ + "iiii\0" + "glStencilFuncSeparateATI\0" + "\0" + /* _mesa_function_pool[25278]: Materialf (offset 169) */ + "iif\0" + "glMaterialf\0" + "\0" + /* _mesa_function_pool[25295]: GetShaderSourceARB (will be remapped) */ + "iipp\0" + "glGetShaderSource\0" + "glGetShaderSourceARB\0" + "\0" + /* _mesa_function_pool[25340]: IglooInterfaceSGIX (dynamic) */ + "ip\0" + "glIglooInterfaceSGIX\0" + "\0" + /* _mesa_function_pool[25365]: Materiali (offset 171) */ + "iii\0" + "glMateriali\0" + "\0" + /* _mesa_function_pool[25382]: VertexAttrib4dNV (will be remapped) */ + "idddd\0" + "glVertexAttrib4dNV\0" + "\0" + /* _mesa_function_pool[25408]: MultiModeDrawElementsIBM (will be remapped) */ + "ppipii\0" + "glMultiModeDrawElementsIBM\0" + "\0" + /* _mesa_function_pool[25443]: Indexsv (offset 51) */ + "p\0" + "glIndexsv\0" + "\0" + /* _mesa_function_pool[25456]: MultiTexCoord4svARB (offset 407) */ + "ip\0" + "glMultiTexCoord4sv\0" + "glMultiTexCoord4svARB\0" + "\0" + /* _mesa_function_pool[25501]: LightModelfv (offset 164) */ + "ip\0" + "glLightModelfv\0" + "\0" + /* _mesa_function_pool[25520]: TexCoord2dv (offset 103) */ + "p\0" + "glTexCoord2dv\0" + "\0" + /* _mesa_function_pool[25537]: GenQueriesARB (will be remapped) */ + "ip\0" + "glGenQueries\0" + "glGenQueriesARB\0" + "\0" + /* _mesa_function_pool[25570]: EvalCoord1dv (offset 229) */ + "p\0" + "glEvalCoord1dv\0" + "\0" + /* _mesa_function_pool[25588]: ReplacementCodeuiVertex3fSUN (dynamic) */ + "ifff\0" + "glReplacementCodeuiVertex3fSUN\0" + "\0" + /* _mesa_function_pool[25625]: Translated (offset 303) */ + "ddd\0" + "glTranslated\0" + "\0" + /* _mesa_function_pool[25643]: Translatef (offset 304) */ + "fff\0" + "glTranslatef\0" + "\0" + /* _mesa_function_pool[25661]: StencilMask (offset 209) */ + "i\0" + "glStencilMask\0" + "\0" + /* _mesa_function_pool[25678]: Tangent3iEXT (dynamic) */ + "iii\0" + "glTangent3iEXT\0" + "\0" + /* _mesa_function_pool[25698]: GetLightiv (offset 265) */ + "iip\0" + "glGetLightiv\0" + "\0" + /* _mesa_function_pool[25716]: DrawMeshArraysSUN (dynamic) */ + "iiii\0" + "glDrawMeshArraysSUN\0" + "\0" + /* _mesa_function_pool[25742]: IsList (offset 287) */ + "i\0" + "glIsList\0" + "\0" + /* _mesa_function_pool[25754]: IsSync (will be remapped) */ + "i\0" + "glIsSync\0" + "\0" + /* _mesa_function_pool[25766]: RenderMode (offset 196) */ + "i\0" + "glRenderMode\0" + "\0" + /* _mesa_function_pool[25782]: GetMapControlPointsNV (dynamic) */ + "iiiiiip\0" + "glGetMapControlPointsNV\0" + "\0" + /* _mesa_function_pool[25815]: DrawBuffersARB (will be remapped) */ + "ip\0" + "glDrawBuffers\0" + "glDrawBuffersARB\0" + "glDrawBuffersATI\0" + "\0" + /* _mesa_function_pool[25867]: ProgramLocalParameter4fARB (will be remapped) */ + "iiffff\0" + "glProgramLocalParameter4fARB\0" + "\0" + /* _mesa_function_pool[25904]: SpriteParameterivSGIX (dynamic) */ + "ip\0" + "glSpriteParameterivSGIX\0" + "\0" + /* _mesa_function_pool[25932]: ProvokingVertexEXT (will be remapped) */ + "i\0" + "glProvokingVertexEXT\0" + "glProvokingVertex\0" + "\0" + /* _mesa_function_pool[25974]: MultiTexCoord1fARB (offset 378) */ + "if\0" + "glMultiTexCoord1f\0" + "glMultiTexCoord1fARB\0" + "\0" + /* _mesa_function_pool[26017]: LoadName (offset 198) */ + "i\0" + "glLoadName\0" + "\0" + /* _mesa_function_pool[26031]: VertexAttribs4ubvNV (will be remapped) */ + "iip\0" + "glVertexAttribs4ubvNV\0" + "\0" + /* _mesa_function_pool[26058]: WeightsvARB (dynamic) */ + "ip\0" + "glWeightsvARB\0" + "\0" + /* _mesa_function_pool[26076]: Uniform1fvARB (will be remapped) */ + "iip\0" + "glUniform1fv\0" + "glUniform1fvARB\0" + "\0" + /* _mesa_function_pool[26110]: CopyTexSubImage1D (offset 325) */ + "iiiiii\0" + "glCopyTexSubImage1D\0" + "glCopyTexSubImage1DEXT\0" + "\0" + /* _mesa_function_pool[26161]: CullFace (offset 152) */ + "i\0" + "glCullFace\0" + "\0" + /* _mesa_function_pool[26175]: BindTexture (offset 307) */ + "ii\0" + "glBindTexture\0" + "glBindTextureEXT\0" + "\0" + /* _mesa_function_pool[26210]: BeginFragmentShaderATI (will be remapped) */ + "\0" + "glBeginFragmentShaderATI\0" + "\0" + /* _mesa_function_pool[26237]: MultiTexCoord4fARB (offset 402) */ + "iffff\0" + "glMultiTexCoord4f\0" + "glMultiTexCoord4fARB\0" + "\0" + /* _mesa_function_pool[26283]: VertexAttribs3svNV (will be remapped) */ + "iip\0" + "glVertexAttribs3svNV\0" + "\0" + /* _mesa_function_pool[26309]: StencilFunc (offset 243) */ + "iii\0" + "glStencilFunc\0" + "\0" + /* _mesa_function_pool[26328]: CopyPixels (offset 255) */ + "iiiii\0" + "glCopyPixels\0" + "\0" + /* _mesa_function_pool[26348]: Rectsv (offset 93) */ + "pp\0" + "glRectsv\0" + "\0" + /* _mesa_function_pool[26361]: ReplacementCodeuivSUN (dynamic) */ + "p\0" + "glReplacementCodeuivSUN\0" + "\0" + /* _mesa_function_pool[26388]: EnableVertexAttribArrayARB (will be remapped) */ + "i\0" + "glEnableVertexAttribArray\0" + "glEnableVertexAttribArrayARB\0" + "\0" + /* _mesa_function_pool[26446]: NormalPointervINTEL (dynamic) */ + "ip\0" + "glNormalPointervINTEL\0" + "\0" + /* _mesa_function_pool[26472]: CopyConvolutionFilter2D (offset 355) */ + "iiiiii\0" + "glCopyConvolutionFilter2D\0" + "glCopyConvolutionFilter2DEXT\0" + "\0" + /* _mesa_function_pool[26535]: WindowPos3ivMESA (will be remapped) */ + "p\0" + "glWindowPos3iv\0" + "glWindowPos3ivARB\0" + "glWindowPos3ivMESA\0" + "\0" + /* _mesa_function_pool[26590]: CopyBufferSubData (will be remapped) */ + "iiiii\0" + "glCopyBufferSubData\0" + "\0" + /* _mesa_function_pool[26617]: NormalPointer (offset 318) */ + "iip\0" + "glNormalPointer\0" + "\0" + /* _mesa_function_pool[26638]: TexParameterfv (offset 179) */ + "iip\0" + "glTexParameterfv\0" + "\0" + /* _mesa_function_pool[26660]: IsBufferARB (will be remapped) */ + "i\0" + "glIsBuffer\0" + "glIsBufferARB\0" + "\0" + /* _mesa_function_pool[26688]: WindowPos4iMESA (will be remapped) */ + "iiii\0" + "glWindowPos4iMESA\0" + "\0" + /* _mesa_function_pool[26712]: VertexAttrib4uivARB (will be remapped) */ + "ip\0" + "glVertexAttrib4uiv\0" + "glVertexAttrib4uivARB\0" + "\0" + /* _mesa_function_pool[26757]: Tangent3bvEXT (dynamic) */ + "p\0" + "glTangent3bvEXT\0" + "\0" + /* _mesa_function_pool[26776]: UniformMatrix3x4fv (will be remapped) */ + "iiip\0" + "glUniformMatrix3x4fv\0" + "\0" + /* _mesa_function_pool[26803]: ClipPlane (offset 150) */ + "ip\0" + "glClipPlane\0" + "\0" + /* _mesa_function_pool[26819]: Recti (offset 90) */ + "iiii\0" + "glRecti\0" + "\0" + /* _mesa_function_pool[26833]: DrawRangeElementsBaseVertex (will be remapped) */ + "iiiiipi\0" + "glDrawRangeElementsBaseVertex\0" + "\0" + /* _mesa_function_pool[26872]: TexCoordPointervINTEL (dynamic) */ + "iip\0" + "glTexCoordPointervINTEL\0" + "\0" + /* _mesa_function_pool[26901]: DeleteBuffersARB (will be remapped) */ + "ip\0" + "glDeleteBuffers\0" + "glDeleteBuffersARB\0" + "\0" + /* _mesa_function_pool[26940]: WindowPos4fvMESA (will be remapped) */ + "p\0" + "glWindowPos4fvMESA\0" + "\0" + /* _mesa_function_pool[26962]: GetPixelMapuiv (offset 272) */ + "ip\0" + "glGetPixelMapuiv\0" + "\0" + /* _mesa_function_pool[26983]: Rectf (offset 88) */ + "ffff\0" + "glRectf\0" + "\0" + /* _mesa_function_pool[26997]: VertexAttrib1sNV (will be remapped) */ + "ii\0" + "glVertexAttrib1sNV\0" + "\0" + /* _mesa_function_pool[27020]: Indexfv (offset 47) */ + "p\0" + "glIndexfv\0" + "\0" + /* _mesa_function_pool[27033]: SecondaryColor3svEXT (will be remapped) */ + "p\0" + "glSecondaryColor3sv\0" + "glSecondaryColor3svEXT\0" + "\0" + /* _mesa_function_pool[27079]: LoadTransposeMatrixfARB (will be remapped) */ + "p\0" + "glLoadTransposeMatrixf\0" + "glLoadTransposeMatrixfARB\0" + "\0" + /* _mesa_function_pool[27131]: GetPointerv (offset 329) */ + "ip\0" + "glGetPointerv\0" + "glGetPointervEXT\0" + "\0" + /* _mesa_function_pool[27166]: Tangent3bEXT (dynamic) */ + "iii\0" + "glTangent3bEXT\0" + "\0" + /* _mesa_function_pool[27186]: CombinerParameterfNV (will be remapped) */ + "if\0" + "glCombinerParameterfNV\0" + "\0" + /* _mesa_function_pool[27213]: IndexMask (offset 212) */ + "i\0" + "glIndexMask\0" + "\0" + /* _mesa_function_pool[27228]: BindProgramNV (will be remapped) */ + "ii\0" + "glBindProgramARB\0" + "glBindProgramNV\0" + "\0" + /* _mesa_function_pool[27265]: VertexAttrib4svARB (will be remapped) */ + "ip\0" + "glVertexAttrib4sv\0" + "glVertexAttrib4svARB\0" + "\0" + /* _mesa_function_pool[27308]: GetFloatv (offset 262) */ + "ip\0" + "glGetFloatv\0" + "\0" + /* _mesa_function_pool[27324]: CreateDebugObjectMESA (dynamic) */ + "\0" + "glCreateDebugObjectMESA\0" + "\0" + /* _mesa_function_pool[27350]: GetShaderiv (will be remapped) */ + "iip\0" + "glGetShaderiv\0" + "\0" + /* _mesa_function_pool[27369]: ClientWaitSync (will be remapped) */ + "iii\0" + "glClientWaitSync\0" + "\0" + /* _mesa_function_pool[27391]: TexCoord4s (offset 124) */ + "iiii\0" + "glTexCoord4s\0" + "\0" + /* _mesa_function_pool[27410]: TexCoord3sv (offset 117) */ + "p\0" + "glTexCoord3sv\0" + "\0" + /* _mesa_function_pool[27427]: BindFragmentShaderATI (will be remapped) */ + "i\0" + "glBindFragmentShaderATI\0" + "\0" + /* _mesa_function_pool[27454]: PopAttrib (offset 218) */ + "\0" + "glPopAttrib\0" + "\0" + /* _mesa_function_pool[27468]: Fogfv (offset 154) */ + "ip\0" + "glFogfv\0" + "\0" + /* _mesa_function_pool[27480]: UnmapBufferARB (will be remapped) */ + "i\0" + "glUnmapBuffer\0" + "glUnmapBufferARB\0" + "\0" + /* _mesa_function_pool[27514]: InitNames (offset 197) */ + "\0" + "glInitNames\0" + "\0" + /* _mesa_function_pool[27528]: Normal3sv (offset 61) */ + "p\0" + "glNormal3sv\0" + "\0" + /* _mesa_function_pool[27543]: Minmax (offset 368) */ + "iii\0" + "glMinmax\0" + "glMinmaxEXT\0" + "\0" + /* _mesa_function_pool[27569]: TexCoord4d (offset 118) */ + "dddd\0" + "glTexCoord4d\0" + "\0" + /* _mesa_function_pool[27588]: DeformationMap3dSGIX (dynamic) */ + "iddiiddiiddiip\0" + "glDeformationMap3dSGIX\0" + "\0" + /* _mesa_function_pool[27627]: TexCoord4f (offset 120) */ + "ffff\0" + "glTexCoord4f\0" + "\0" + /* _mesa_function_pool[27646]: FogCoorddvEXT (will be remapped) */ + "p\0" + "glFogCoorddv\0" + "glFogCoorddvEXT\0" + "\0" + /* _mesa_function_pool[27678]: FinishTextureSUNX (dynamic) */ + "\0" + "glFinishTextureSUNX\0" + "\0" + /* _mesa_function_pool[27700]: GetFragmentLightfvSGIX (dynamic) */ + "iip\0" + "glGetFragmentLightfvSGIX\0" + "\0" + /* _mesa_function_pool[27730]: Binormal3fvEXT (dynamic) */ + "p\0" + "glBinormal3fvEXT\0" + "\0" + /* _mesa_function_pool[27750]: GetBooleanv (offset 258) */ + "ip\0" + "glGetBooleanv\0" + "\0" + /* _mesa_function_pool[27768]: ColorFragmentOp3ATI (will be remapped) */ + "iiiiiiiiiiiii\0" + "glColorFragmentOp3ATI\0" + "\0" + /* _mesa_function_pool[27805]: Hint (offset 158) */ + "ii\0" + "glHint\0" + "\0" + /* _mesa_function_pool[27816]: Color4dv (offset 28) */ + "p\0" + "glColor4dv\0" + "\0" + /* _mesa_function_pool[27830]: VertexAttrib2svARB (will be remapped) */ + "ip\0" + "glVertexAttrib2sv\0" + "glVertexAttrib2svARB\0" + "\0" + /* _mesa_function_pool[27873]: AreProgramsResidentNV (will be remapped) */ + "ipp\0" + "glAreProgramsResidentNV\0" + "\0" + /* _mesa_function_pool[27902]: WindowPos3svMESA (will be remapped) */ + "p\0" + "glWindowPos3sv\0" + "glWindowPos3svARB\0" + "glWindowPos3svMESA\0" + "\0" + /* _mesa_function_pool[27957]: CopyColorSubTable (offset 347) */ + "iiiii\0" + "glCopyColorSubTable\0" + "glCopyColorSubTableEXT\0" + "\0" + /* _mesa_function_pool[28007]: WeightdvARB (dynamic) */ + "ip\0" + "glWeightdvARB\0" + "\0" + /* _mesa_function_pool[28025]: DeleteRenderbuffersEXT (will be remapped) */ + "ip\0" + "glDeleteRenderbuffers\0" + "glDeleteRenderbuffersEXT\0" + "\0" + /* _mesa_function_pool[28076]: VertexAttrib4NubvARB (will be remapped) */ + "ip\0" + "glVertexAttrib4Nubv\0" + "glVertexAttrib4NubvARB\0" + "\0" + /* _mesa_function_pool[28123]: VertexAttrib3dvNV (will be remapped) */ + "ip\0" + "glVertexAttrib3dvNV\0" + "\0" + /* _mesa_function_pool[28147]: GetObjectParameterfvARB (will be remapped) */ + "iip\0" + "glGetObjectParameterfvARB\0" + "\0" + /* _mesa_function_pool[28178]: Vertex4iv (offset 147) */ + "p\0" + "glVertex4iv\0" + "\0" + /* _mesa_function_pool[28193]: GetProgramEnvParameterdvARB (will be remapped) */ + "iip\0" + "glGetProgramEnvParameterdvARB\0" + "\0" + /* _mesa_function_pool[28228]: TexCoord4dv (offset 119) */ + "p\0" + "glTexCoord4dv\0" + "\0" + /* _mesa_function_pool[28245]: LockArraysEXT (will be remapped) */ + "ii\0" + "glLockArraysEXT\0" + "\0" + /* _mesa_function_pool[28265]: Begin (offset 7) */ + "i\0" + "glBegin\0" + "\0" + /* _mesa_function_pool[28276]: LightModeli (offset 165) */ + "ii\0" + "glLightModeli\0" + "\0" + /* _mesa_function_pool[28294]: Rectfv (offset 89) */ + "pp\0" + "glRectfv\0" + "\0" + /* _mesa_function_pool[28307]: LightModelf (offset 163) */ + "if\0" + "glLightModelf\0" + "\0" + /* _mesa_function_pool[28325]: GetTexParameterfv (offset 282) */ + "iip\0" + "glGetTexParameterfv\0" + "\0" + /* _mesa_function_pool[28350]: GetLightfv (offset 264) */ + "iip\0" + "glGetLightfv\0" + "\0" + /* _mesa_function_pool[28368]: PixelTransformParameterivEXT (dynamic) */ + "iip\0" + "glPixelTransformParameterivEXT\0" + "\0" + /* _mesa_function_pool[28404]: BinormalPointerEXT (dynamic) */ + "iip\0" + "glBinormalPointerEXT\0" + "\0" + /* _mesa_function_pool[28430]: VertexAttrib1dNV (will be remapped) */ + "id\0" + "glVertexAttrib1dNV\0" + "\0" + /* _mesa_function_pool[28453]: GetCombinerInputParameterivNV (will be remapped) */ + "iiiip\0" + "glGetCombinerInputParameterivNV\0" + "\0" + /* _mesa_function_pool[28492]: Disable (offset 214) */ + "i\0" + "glDisable\0" + "\0" + /* _mesa_function_pool[28505]: MultiTexCoord2fvARB (offset 387) */ + "ip\0" + "glMultiTexCoord2fv\0" + "glMultiTexCoord2fvARB\0" + "\0" + /* _mesa_function_pool[28550]: GetRenderbufferParameterivEXT (will be remapped) */ + "iip\0" + "glGetRenderbufferParameteriv\0" + "glGetRenderbufferParameterivEXT\0" + "\0" + /* _mesa_function_pool[28616]: CombinerParameterivNV (will be remapped) */ + "ip\0" + "glCombinerParameterivNV\0" + "\0" + /* _mesa_function_pool[28644]: GenFragmentShadersATI (will be remapped) */ + "i\0" + "glGenFragmentShadersATI\0" + "\0" + /* _mesa_function_pool[28671]: DrawArrays (offset 310) */ + "iii\0" + "glDrawArrays\0" + "glDrawArraysEXT\0" + "\0" + /* _mesa_function_pool[28705]: WeightuivARB (dynamic) */ + "ip\0" + "glWeightuivARB\0" + "\0" + /* _mesa_function_pool[28724]: VertexAttrib2sARB (will be remapped) */ + "iii\0" + "glVertexAttrib2s\0" + "glVertexAttrib2sARB\0" + "\0" + /* _mesa_function_pool[28766]: ColorMask (offset 210) */ + "iiii\0" + "glColorMask\0" + "\0" + /* _mesa_function_pool[28784]: GenAsyncMarkersSGIX (dynamic) */ + "i\0" + "glGenAsyncMarkersSGIX\0" + "\0" + /* _mesa_function_pool[28809]: Tangent3svEXT (dynamic) */ + "p\0" + "glTangent3svEXT\0" + "\0" + /* _mesa_function_pool[28828]: GetListParameterivSGIX (dynamic) */ + "iip\0" + "glGetListParameterivSGIX\0" + "\0" + /* _mesa_function_pool[28858]: BindBufferARB (will be remapped) */ + "ii\0" + "glBindBuffer\0" + "glBindBufferARB\0" + "\0" + /* _mesa_function_pool[28891]: GetInfoLogARB (will be remapped) */ + "iipp\0" + "glGetInfoLogARB\0" + "\0" + /* _mesa_function_pool[28913]: RasterPos4iv (offset 83) */ + "p\0" + "glRasterPos4iv\0" + "\0" + /* _mesa_function_pool[28931]: Enable (offset 215) */ + "i\0" + "glEnable\0" + "\0" + /* _mesa_function_pool[28943]: LineStipple (offset 167) */ + "ii\0" + "glLineStipple\0" + "\0" + /* _mesa_function_pool[28961]: VertexAttribs4svNV (will be remapped) */ + "iip\0" + "glVertexAttribs4svNV\0" + "\0" + /* _mesa_function_pool[28987]: EdgeFlagPointerListIBM (dynamic) */ + "ipi\0" + "glEdgeFlagPointerListIBM\0" + "\0" + /* _mesa_function_pool[29017]: UniformMatrix3x2fv (will be remapped) */ + "iiip\0" + "glUniformMatrix3x2fv\0" + "\0" + /* _mesa_function_pool[29044]: GetMinmaxParameterfv (offset 365) */ + "iip\0" + "glGetMinmaxParameterfv\0" + "glGetMinmaxParameterfvEXT\0" + "\0" + /* _mesa_function_pool[29098]: VertexAttrib1fvARB (will be remapped) */ + "ip\0" + "glVertexAttrib1fv\0" + "glVertexAttrib1fvARB\0" + "\0" + /* _mesa_function_pool[29141]: GenBuffersARB (will be remapped) */ + "ip\0" + "glGenBuffers\0" + "glGenBuffersARB\0" + "\0" + /* _mesa_function_pool[29174]: VertexAttribs1svNV (will be remapped) */ + "iip\0" + "glVertexAttribs1svNV\0" + "\0" + /* _mesa_function_pool[29200]: Vertex3fv (offset 137) */ + "p\0" + "glVertex3fv\0" + "\0" + /* _mesa_function_pool[29215]: GetTexBumpParameterivATI (will be remapped) */ + "ip\0" + "glGetTexBumpParameterivATI\0" + "\0" + /* _mesa_function_pool[29246]: Binormal3bEXT (dynamic) */ + "iii\0" + "glBinormal3bEXT\0" + "\0" + /* _mesa_function_pool[29267]: FragmentMaterialivSGIX (dynamic) */ + "iip\0" + "glFragmentMaterialivSGIX\0" + "\0" + /* _mesa_function_pool[29297]: IsRenderbufferEXT (will be remapped) */ + "i\0" + "glIsRenderbuffer\0" + "glIsRenderbufferEXT\0" + "\0" + /* _mesa_function_pool[29337]: GenProgramsNV (will be remapped) */ + "ip\0" + "glGenProgramsARB\0" + "glGenProgramsNV\0" + "\0" + /* _mesa_function_pool[29374]: VertexAttrib4dvNV (will be remapped) */ + "ip\0" + "glVertexAttrib4dvNV\0" + "\0" + /* _mesa_function_pool[29398]: EndFragmentShaderATI (will be remapped) */ + "\0" + "glEndFragmentShaderATI\0" + "\0" + /* _mesa_function_pool[29423]: Binormal3iEXT (dynamic) */ + "iii\0" + "glBinormal3iEXT\0" + "\0" + /* _mesa_function_pool[29444]: WindowPos2fMESA (will be remapped) */ + "ff\0" + "glWindowPos2f\0" + "glWindowPos2fARB\0" + "glWindowPos2fMESA\0" + "\0" + ; + +/* these functions need to be remapped */ +static const struct { + GLint pool_index; + GLint remap_index; +} MESA_remap_table_functions[] = { + { 1461, AttachShader_remap_index }, + { 8704, CreateProgram_remap_index }, + { 20115, CreateShader_remap_index }, + { 22375, DeleteProgram_remap_index }, + { 16150, DeleteShader_remap_index }, + { 20561, DetachShader_remap_index }, + { 15674, GetAttachedShaders_remap_index }, + { 4244, GetProgramInfoLog_remap_index }, + { 361, GetProgramiv_remap_index }, + { 5547, GetShaderInfoLog_remap_index }, + { 27350, GetShaderiv_remap_index }, + { 11657, IsProgram_remap_index }, + { 10728, IsShader_remap_index }, + { 8808, StencilFuncSeparate_remap_index }, + { 3487, StencilMaskSeparate_remap_index }, + { 6623, StencilOpSeparate_remap_index }, + { 19492, UniformMatrix2x3fv_remap_index }, + { 2615, UniformMatrix2x4fv_remap_index }, + { 29017, UniformMatrix3x2fv_remap_index }, + { 26776, UniformMatrix3x4fv_remap_index }, + { 14222, UniformMatrix4x2fv_remap_index }, + { 2937, UniformMatrix4x3fv_remap_index }, + { 8722, LoadTransposeMatrixdARB_remap_index }, + { 27079, LoadTransposeMatrixfARB_remap_index }, + { 4817, MultTransposeMatrixdARB_remap_index }, + { 20748, MultTransposeMatrixfARB_remap_index }, + { 172, SampleCoverageARB_remap_index }, + { 4971, CompressedTexImage1DARB_remap_index }, + { 21205, CompressedTexImage2DARB_remap_index }, + { 3550, CompressedTexImage3DARB_remap_index }, + { 15966, CompressedTexSubImage1DARB_remap_index }, + { 1880, CompressedTexSubImage2DARB_remap_index }, + { 17758, CompressedTexSubImage3DARB_remap_index }, + { 25058, GetCompressedTexImageARB_remap_index }, + { 3395, DisableVertexAttribArrayARB_remap_index }, + { 26388, EnableVertexAttribArrayARB_remap_index }, + { 28193, GetProgramEnvParameterdvARB_remap_index }, + { 20628, GetProgramEnvParameterfvARB_remap_index }, + { 24088, GetProgramLocalParameterdvARB_remap_index }, + { 7065, GetProgramLocalParameterfvARB_remap_index }, + { 16057, GetProgramStringARB_remap_index }, + { 24283, GetProgramivARB_remap_index }, + { 17953, GetVertexAttribdvARB_remap_index }, + { 14111, GetVertexAttribfvARB_remap_index }, + { 8617, GetVertexAttribivARB_remap_index }, + { 16862, ProgramEnvParameter4dARB_remap_index }, + { 22175, ProgramEnvParameter4dvARB_remap_index }, + { 14719, ProgramEnvParameter4fARB_remap_index }, + { 7928, ProgramEnvParameter4fvARB_remap_index }, + { 3513, ProgramLocalParameter4dARB_remap_index }, + { 11403, ProgramLocalParameter4dvARB_remap_index }, + { 25867, ProgramLocalParameter4fARB_remap_index }, + { 22693, ProgramLocalParameter4fvARB_remap_index }, + { 24844, ProgramStringARB_remap_index }, + { 17112, VertexAttrib1dARB_remap_index }, + { 13765, VertexAttrib1dvARB_remap_index }, + { 3688, VertexAttrib1fARB_remap_index }, + { 29098, VertexAttrib1fvARB_remap_index }, + { 6149, VertexAttrib1sARB_remap_index }, + { 2054, VertexAttrib1svARB_remap_index }, + { 13196, VertexAttrib2dARB_remap_index }, + { 15293, VertexAttrib2dvARB_remap_index }, + { 1480, VertexAttrib2fARB_remap_index }, + { 15406, VertexAttrib2fvARB_remap_index }, + { 28724, VertexAttrib2sARB_remap_index }, + { 27830, VertexAttrib2svARB_remap_index }, + { 9926, VertexAttrib3dARB_remap_index }, + { 7631, VertexAttrib3dvARB_remap_index }, + { 1567, VertexAttrib3fARB_remap_index }, + { 19729, VertexAttrib3fvARB_remap_index }, + { 24716, VertexAttrib3sARB_remap_index }, + { 17695, VertexAttrib3svARB_remap_index }, + { 4270, VertexAttrib4NbvARB_remap_index }, + { 15629, VertexAttrib4NivARB_remap_index }, + { 19684, VertexAttrib4NsvARB_remap_index }, + { 20580, VertexAttrib4NubARB_remap_index }, + { 28076, VertexAttrib4NubvARB_remap_index }, + { 16523, VertexAttrib4NuivARB_remap_index }, + { 2810, VertexAttrib4NusvARB_remap_index }, + { 9549, VertexAttrib4bvARB_remap_index }, + { 23496, VertexAttrib4dARB_remap_index }, + { 18678, VertexAttrib4dvARB_remap_index }, + { 10033, VertexAttrib4fARB_remap_index }, + { 10403, VertexAttrib4fvARB_remap_index }, + { 9001, VertexAttrib4ivARB_remap_index }, + { 15107, VertexAttrib4sARB_remap_index }, + { 27265, VertexAttrib4svARB_remap_index }, + { 14524, VertexAttrib4ubvARB_remap_index }, + { 26712, VertexAttrib4uivARB_remap_index }, + { 17506, VertexAttrib4usvARB_remap_index }, + { 19366, VertexAttribPointerARB_remap_index }, + { 28858, BindBufferARB_remap_index }, + { 5862, BufferDataARB_remap_index }, + { 1382, BufferSubDataARB_remap_index }, + { 26901, DeleteBuffersARB_remap_index }, + { 29141, GenBuffersARB_remap_index }, + { 15449, GetBufferParameterivARB_remap_index }, + { 14671, GetBufferPointervARB_remap_index }, + { 1335, GetBufferSubDataARB_remap_index }, + { 26660, IsBufferARB_remap_index }, + { 23124, MapBufferARB_remap_index }, + { 27480, UnmapBufferARB_remap_index }, + { 268, BeginQueryARB_remap_index }, + { 17207, DeleteQueriesARB_remap_index }, + { 10664, EndQueryARB_remap_index }, + { 25537, GenQueriesARB_remap_index }, + { 1772, GetQueryObjectivARB_remap_index }, + { 15151, GetQueryObjectuivARB_remap_index }, + { 1624, GetQueryivARB_remap_index }, + { 17413, IsQueryARB_remap_index }, + { 7241, AttachObjectARB_remap_index }, + { 16112, CompileShaderARB_remap_index }, + { 2879, CreateProgramObjectARB_remap_index }, + { 5807, CreateShaderObjectARB_remap_index }, + { 12613, DeleteObjectARB_remap_index }, + { 20979, DetachObjectARB_remap_index }, + { 10475, GetActiveUniformARB_remap_index }, + { 8320, GetAttachedObjectsARB_remap_index }, + { 8599, GetHandleARB_remap_index }, + { 28891, GetInfoLogARB_remap_index }, + { 28147, GetObjectParameterfvARB_remap_index }, + { 23962, GetObjectParameterivARB_remap_index }, + { 25295, GetShaderSourceARB_remap_index }, + { 24576, GetUniformLocationARB_remap_index }, + { 20850, GetUniformfvARB_remap_index }, + { 11025, GetUniformivARB_remap_index }, + { 17551, LinkProgramARB_remap_index }, + { 17609, ShaderSourceARB_remap_index }, + { 6523, Uniform1fARB_remap_index }, + { 26076, Uniform1fvARB_remap_index }, + { 19335, Uniform1iARB_remap_index }, + { 18367, Uniform1ivARB_remap_index }, + { 2003, Uniform2fARB_remap_index }, + { 12449, Uniform2fvARB_remap_index }, + { 23011, Uniform2iARB_remap_index }, + { 2123, Uniform2ivARB_remap_index }, + { 16222, Uniform3fARB_remap_index }, + { 8350, Uniform3fvARB_remap_index }, + { 5481, Uniform3iARB_remap_index }, + { 14777, Uniform3ivARB_remap_index }, + { 16668, Uniform4fARB_remap_index }, + { 20714, Uniform4fvARB_remap_index }, + { 21854, Uniform4iARB_remap_index }, + { 17919, Uniform4ivARB_remap_index }, + { 7293, UniformMatrix2fvARB_remap_index }, + { 17, UniformMatrix3fvARB_remap_index }, + { 2475, UniformMatrix4fvARB_remap_index }, + { 22287, UseProgramObjectARB_remap_index }, + { 12884, ValidateProgramARB_remap_index }, + { 18721, BindAttribLocationARB_remap_index }, + { 4315, GetActiveAttribARB_remap_index }, + { 14458, GetAttribLocationARB_remap_index }, + { 25815, DrawBuffersARB_remap_index }, + { 11508, RenderbufferStorageMultisample_remap_index }, + { 16716, FlushMappedBufferRange_remap_index }, + { 24379, MapBufferRange_remap_index }, + { 14333, BindVertexArray_remap_index }, + { 12743, GenVertexArrays_remap_index }, + { 26590, CopyBufferSubData_remap_index }, + { 27369, ClientWaitSync_remap_index }, + { 2394, DeleteSync_remap_index }, + { 6190, FenceSync_remap_index }, + { 13255, GetInteger64v_remap_index }, + { 19791, GetSynciv_remap_index }, + { 25754, IsSync_remap_index }, + { 8268, WaitSync_remap_index }, + { 3363, DrawElementsBaseVertex_remap_index }, + { 26833, DrawRangeElementsBaseVertex_remap_index }, + { 23155, MultiDrawElementsBaseVertex_remap_index }, + { 4680, PolygonOffsetEXT_remap_index }, + { 20350, GetPixelTexGenParameterfvSGIS_remap_index }, + { 3895, GetPixelTexGenParameterivSGIS_remap_index }, + { 20083, PixelTexGenParameterfSGIS_remap_index }, + { 580, PixelTexGenParameterfvSGIS_remap_index }, + { 11063, PixelTexGenParameteriSGIS_remap_index }, + { 12020, PixelTexGenParameterivSGIS_remap_index }, + { 14421, SampleMaskSGIS_remap_index }, + { 17353, SamplePatternSGIS_remap_index }, + { 23084, ColorPointerEXT_remap_index }, + { 15336, EdgeFlagPointerEXT_remap_index }, + { 5135, IndexPointerEXT_remap_index }, + { 5215, NormalPointerEXT_remap_index }, + { 13849, TexCoordPointerEXT_remap_index }, + { 5985, VertexPointerEXT_remap_index }, + { 3165, PointParameterfEXT_remap_index }, + { 6830, PointParameterfvEXT_remap_index }, + { 28245, LockArraysEXT_remap_index }, + { 12948, UnlockArraysEXT_remap_index }, + { 7837, CullParameterdvEXT_remap_index }, + { 10270, CullParameterfvEXT_remap_index }, + { 1151, SecondaryColor3bEXT_remap_index }, + { 6989, SecondaryColor3bvEXT_remap_index }, + { 9178, SecondaryColor3dEXT_remap_index }, + { 22433, SecondaryColor3dvEXT_remap_index }, + { 24625, SecondaryColor3fEXT_remap_index }, + { 15902, SecondaryColor3fvEXT_remap_index }, + { 426, SecondaryColor3iEXT_remap_index }, + { 14159, SecondaryColor3ivEXT_remap_index }, + { 8836, SecondaryColor3sEXT_remap_index }, + { 27033, SecondaryColor3svEXT_remap_index }, + { 23798, SecondaryColor3ubEXT_remap_index }, + { 18612, SecondaryColor3ubvEXT_remap_index }, + { 11258, SecondaryColor3uiEXT_remap_index }, + { 19970, SecondaryColor3uivEXT_remap_index }, + { 22645, SecondaryColor3usEXT_remap_index }, + { 11331, SecondaryColor3usvEXT_remap_index }, + { 10346, SecondaryColorPointerEXT_remap_index }, + { 22494, MultiDrawArraysEXT_remap_index }, + { 18302, MultiDrawElementsEXT_remap_index }, + { 18497, FogCoordPointerEXT_remap_index }, + { 4044, FogCoorddEXT_remap_index }, + { 27646, FogCoorddvEXT_remap_index }, + { 4105, FogCoordfEXT_remap_index }, + { 23721, FogCoordfvEXT_remap_index }, + { 16620, PixelTexGenSGIX_remap_index }, + { 24306, BlendFuncSeparateEXT_remap_index }, + { 5897, FlushVertexArrayRangeNV_remap_index }, + { 4629, VertexArrayRangeNV_remap_index }, + { 24690, CombinerInputNV_remap_index }, + { 1946, CombinerOutputNV_remap_index }, + { 27186, CombinerParameterfNV_remap_index }, + { 4549, CombinerParameterfvNV_remap_index }, + { 19541, CombinerParameteriNV_remap_index }, + { 28616, CombinerParameterivNV_remap_index }, + { 6267, FinalCombinerInputNV_remap_index }, + { 8665, GetCombinerInputParameterfvNV_remap_index }, + { 28453, GetCombinerInputParameterivNV_remap_index }, + { 6066, GetCombinerOutputParameterfvNV_remap_index }, + { 11949, GetCombinerOutputParameterivNV_remap_index }, + { 5642, GetFinalCombinerInputParameterfvNV_remap_index }, + { 21726, GetFinalCombinerInputParameterivNV_remap_index }, + { 11003, ResizeBuffersMESA_remap_index }, + { 9753, WindowPos2dMESA_remap_index }, + { 944, WindowPos2dvMESA_remap_index }, + { 29444, WindowPos2fMESA_remap_index }, + { 6934, WindowPos2fvMESA_remap_index }, + { 15849, WindowPos2iMESA_remap_index }, + { 17826, WindowPos2ivMESA_remap_index }, + { 18401, WindowPos2sMESA_remap_index }, + { 4885, WindowPos2svMESA_remap_index }, + { 6759, WindowPos3dMESA_remap_index }, + { 12228, WindowPos3dvMESA_remap_index }, + { 472, WindowPos3fMESA_remap_index }, + { 13009, WindowPos3fvMESA_remap_index }, + { 21021, WindowPos3iMESA_remap_index }, + { 26535, WindowPos3ivMESA_remap_index }, + { 16366, WindowPos3sMESA_remap_index }, + { 27902, WindowPos3svMESA_remap_index }, + { 9704, WindowPos4dMESA_remap_index }, + { 14862, WindowPos4dvMESA_remap_index }, + { 12187, WindowPos4fMESA_remap_index }, + { 26940, WindowPos4fvMESA_remap_index }, + { 26688, WindowPos4iMESA_remap_index }, + { 10842, WindowPos4ivMESA_remap_index }, + { 16499, WindowPos4sMESA_remap_index }, + { 2857, WindowPos4svMESA_remap_index }, + { 11988, MultiModeDrawArraysIBM_remap_index }, + { 25408, MultiModeDrawElementsIBM_remap_index }, + { 10692, DeleteFencesNV_remap_index }, + { 24537, FinishFenceNV_remap_index }, + { 3287, GenFencesNV_remap_index }, + { 14842, GetFenceivNV_remap_index }, + { 7226, IsFenceNV_remap_index }, + { 11876, SetFenceNV_remap_index }, + { 3744, TestFenceNV_remap_index }, + { 27873, AreProgramsResidentNV_remap_index }, + { 27228, BindProgramNV_remap_index }, + { 22728, DeleteProgramsNV_remap_index }, + { 18830, ExecuteProgramNV_remap_index }, + { 29337, GenProgramsNV_remap_index }, + { 20429, GetProgramParameterdvNV_remap_index }, + { 9240, GetProgramParameterfvNV_remap_index }, + { 23058, GetProgramStringNV_remap_index }, + { 21415, GetProgramivNV_remap_index }, + { 20663, GetTrackMatrixivNV_remap_index }, + { 22878, GetVertexAttribPointervNV_remap_index }, + { 21659, GetVertexAttribdvNV_remap_index }, + { 16339, GetVertexAttribfvNV_remap_index }, + { 16030, GetVertexAttribivNV_remap_index }, + { 16746, IsProgramNV_remap_index }, + { 8246, LoadProgramNV_remap_index }, + { 24402, ProgramParameters4dvNV_remap_index }, + { 21345, ProgramParameters4fvNV_remap_index }, + { 18130, RequestResidentProgramsNV_remap_index }, + { 19519, TrackMatrixNV_remap_index }, + { 28430, VertexAttrib1dNV_remap_index }, + { 11817, VertexAttrib1dvNV_remap_index }, + { 24940, VertexAttrib1fNV_remap_index }, + { 2245, VertexAttrib1fvNV_remap_index }, + { 26997, VertexAttrib1sNV_remap_index }, + { 13082, VertexAttrib1svNV_remap_index }, + { 4220, VertexAttrib2dNV_remap_index }, + { 11732, VertexAttrib2dvNV_remap_index }, + { 17585, VertexAttrib2fNV_remap_index }, + { 11379, VertexAttrib2fvNV_remap_index }, + { 5045, VertexAttrib2sNV_remap_index }, + { 16420, VertexAttrib2svNV_remap_index }, + { 9901, VertexAttrib3dNV_remap_index }, + { 28123, VertexAttrib3dvNV_remap_index }, + { 9052, VertexAttrib3fNV_remap_index }, + { 21686, VertexAttrib3fvNV_remap_index }, + { 24915, VertexAttrib3sNV_remap_index }, + { 20690, VertexAttrib3svNV_remap_index }, + { 25382, VertexAttrib4dNV_remap_index }, + { 29374, VertexAttrib4dvNV_remap_index }, + { 3945, VertexAttrib4fNV_remap_index }, + { 8296, VertexAttrib4fvNV_remap_index }, + { 23380, VertexAttrib4sNV_remap_index }, + { 1293, VertexAttrib4svNV_remap_index }, + { 4378, VertexAttrib4ubNV_remap_index }, + { 734, VertexAttrib4ubvNV_remap_index }, + { 19010, VertexAttribPointerNV_remap_index }, + { 2097, VertexAttribs1dvNV_remap_index }, + { 16444, VertexAttribs1fvNV_remap_index }, + { 29174, VertexAttribs1svNV_remap_index }, + { 9077, VertexAttribs2dvNV_remap_index }, + { 22248, VertexAttribs2fvNV_remap_index }, + { 15362, VertexAttribs2svNV_remap_index }, + { 4577, VertexAttribs3dvNV_remap_index }, + { 1977, VertexAttribs3fvNV_remap_index }, + { 26283, VertexAttribs3svNV_remap_index }, + { 23470, VertexAttribs4dvNV_remap_index }, + { 4603, VertexAttribs4fvNV_remap_index }, + { 28961, VertexAttribs4svNV_remap_index }, + { 26031, VertexAttribs4ubvNV_remap_index }, + { 23540, GetTexBumpParameterfvATI_remap_index }, + { 29215, GetTexBumpParameterivATI_remap_index }, + { 16084, TexBumpParameterfvATI_remap_index }, + { 18001, TexBumpParameterivATI_remap_index }, + { 13628, AlphaFragmentOp1ATI_remap_index }, + { 9592, AlphaFragmentOp2ATI_remap_index }, + { 21602, AlphaFragmentOp3ATI_remap_index }, + { 26210, BeginFragmentShaderATI_remap_index }, + { 27427, BindFragmentShaderATI_remap_index }, + { 20819, ColorFragmentOp1ATI_remap_index }, + { 3823, ColorFragmentOp2ATI_remap_index }, + { 27768, ColorFragmentOp3ATI_remap_index }, + { 4722, DeleteFragmentShaderATI_remap_index }, + { 29398, EndFragmentShaderATI_remap_index }, + { 28644, GenFragmentShadersATI_remap_index }, + { 22352, PassTexCoordATI_remap_index }, + { 5965, SampleMapATI_remap_index }, + { 5738, SetFragmentShaderConstantATI_remap_index }, + { 319, PointParameteriNV_remap_index }, + { 12389, PointParameterivNV_remap_index }, + { 25221, ActiveStencilFaceEXT_remap_index }, + { 24062, BindVertexArrayAPPLE_remap_index }, + { 2522, DeleteVertexArraysAPPLE_remap_index }, + { 15701, GenVertexArraysAPPLE_remap_index }, + { 20494, IsVertexArrayAPPLE_remap_index }, + { 775, GetProgramNamedParameterdvNV_remap_index }, + { 3128, GetProgramNamedParameterfvNV_remap_index }, + { 23571, ProgramNamedParameter4dNV_remap_index }, + { 12664, ProgramNamedParameter4dvNV_remap_index }, + { 7862, ProgramNamedParameter4fNV_remap_index }, + { 10311, ProgramNamedParameter4fvNV_remap_index }, + { 21324, DepthBoundsEXT_remap_index }, + { 1043, BlendEquationSeparateEXT_remap_index }, + { 12783, BindFramebufferEXT_remap_index }, + { 22539, BindRenderbufferEXT_remap_index }, + { 8515, CheckFramebufferStatusEXT_remap_index }, + { 19810, DeleteFramebuffersEXT_remap_index }, + { 28025, DeleteRenderbuffersEXT_remap_index }, + { 11756, FramebufferRenderbufferEXT_remap_index }, + { 11893, FramebufferTexture1DEXT_remap_index }, + { 10139, FramebufferTexture2DEXT_remap_index }, + { 9806, FramebufferTexture3DEXT_remap_index }, + { 20386, GenFramebuffersEXT_remap_index }, + { 15248, GenRenderbuffersEXT_remap_index }, + { 5684, GenerateMipmapEXT_remap_index }, + { 19041, GetFramebufferAttachmentParameterivEXT_remap_index }, + { 28550, GetRenderbufferParameterivEXT_remap_index }, + { 17881, IsFramebufferEXT_remap_index }, + { 29297, IsRenderbufferEXT_remap_index }, + { 7173, RenderbufferStorageEXT_remap_index }, + { 651, BlitFramebufferEXT_remap_index }, + { 12483, BufferParameteriAPPLE_remap_index }, + { 16778, FlushMappedBufferRangeAPPLE_remap_index }, + { 2701, FramebufferTextureLayerEXT_remap_index }, + { 25932, ProvokingVertexEXT_remap_index }, + { 9461, GetTexParameterPointervAPPLE_remap_index }, + { 4405, TextureRangeAPPLE_remap_index }, + { 25247, StencilFuncSeparateATI_remap_index }, + { 15768, ProgramEnvParameters4fvEXT_remap_index }, + { 14986, ProgramLocalParameters4fvEXT_remap_index }, + { 12317, GetQueryObjecti64vEXT_remap_index }, + { 9103, GetQueryObjectui64vEXT_remap_index }, + { -1, -1 } +}; + +/* these functions are in the ABI, but have alternative names */ +static const struct gl_function_remap MESA_alt_functions[] = { + /* from GL_EXT_blend_color */ + { 2440, _gloffset_BlendColor }, + /* from GL_EXT_blend_minmax */ + { 9863, _gloffset_BlendEquation }, + /* from GL_EXT_color_subtable */ + { 14884, _gloffset_ColorSubTable }, + { 27957, _gloffset_CopyColorSubTable }, + /* from GL_EXT_convolution */ + { 213, _gloffset_ConvolutionFilter1D }, + { 2284, _gloffset_CopyConvolutionFilter1D }, + { 3624, _gloffset_GetConvolutionParameteriv }, + { 7522, _gloffset_ConvolutionFilter2D }, + { 7688, _gloffset_ConvolutionParameteriv }, + { 8148, _gloffset_ConvolutionParameterfv }, + { 18029, _gloffset_GetSeparableFilter }, + { 21075, _gloffset_SeparableFilter2D }, + { 21904, _gloffset_ConvolutionParameteri }, + { 22027, _gloffset_ConvolutionParameterf }, + { 23406, _gloffset_GetConvolutionParameterfv }, + { 24228, _gloffset_GetConvolutionFilter }, + { 26472, _gloffset_CopyConvolutionFilter2D }, + /* from GL_EXT_copy_texture */ + { 13142, _gloffset_CopyTexSubImage3D }, + { 14624, _gloffset_CopyTexImage2D }, + { 21512, _gloffset_CopyTexImage1D }, + { 23909, _gloffset_CopyTexSubImage2D }, + { 26110, _gloffset_CopyTexSubImage1D }, + /* from GL_EXT_draw_range_elements */ + { 8402, _gloffset_DrawRangeElements }, + /* from GL_EXT_histogram */ + { 812, _gloffset_Histogram }, + { 3088, _gloffset_ResetHistogram }, + { 8774, _gloffset_GetMinmax }, + { 13476, _gloffset_GetHistogramParameterfv }, + { 21437, _gloffset_GetMinmaxParameteriv }, + { 23296, _gloffset_ResetMinmax }, + { 24125, _gloffset_GetHistogramParameteriv }, + { 25181, _gloffset_GetHistogram }, + { 27543, _gloffset_Minmax }, + { 29044, _gloffset_GetMinmaxParameterfv }, + /* from GL_EXT_paletted_texture */ + { 7384, _gloffset_ColorTable }, + { 13322, _gloffset_GetColorTable }, + { 20133, _gloffset_GetColorTableParameterfv }, + { 22083, _gloffset_GetColorTableParameteriv }, + /* from GL_EXT_subtexture */ + { 6105, _gloffset_TexSubImage1D }, + { 9388, _gloffset_TexSubImage2D }, + /* from GL_EXT_texture3D */ + { 1658, _gloffset_TexImage3D }, + { 19902, _gloffset_TexSubImage3D }, + /* from GL_EXT_texture_object */ + { 2964, _gloffset_PrioritizeTextures }, + { 6554, _gloffset_AreTexturesResident }, + { 11841, _gloffset_GenTextures }, + { 13808, _gloffset_DeleteTextures }, + { 17059, _gloffset_IsTexture }, + { 26175, _gloffset_BindTexture }, + /* from GL_EXT_vertex_array */ + { 21264, _gloffset_ArrayElement }, + { 27131, _gloffset_GetPointerv }, + { 28671, _gloffset_DrawArrays }, + /* from GL_SGI_color_table */ + { 6672, _gloffset_ColorTableParameteriv }, + { 7384, _gloffset_ColorTable }, + { 13322, _gloffset_GetColorTable }, + { 13432, _gloffset_CopyColorTable }, + { 16920, _gloffset_ColorTableParameterfv }, + { 20133, _gloffset_GetColorTableParameterfv }, + { 22083, _gloffset_GetColorTableParameteriv }, + /* from GL_VERSION_1_3 */ + { 381, _gloffset_MultiTexCoord3sARB }, + { 613, _gloffset_ActiveTextureARB }, + { 3761, _gloffset_MultiTexCoord1fvARB }, + { 5240, _gloffset_MultiTexCoord3dARB }, + { 5285, _gloffset_MultiTexCoord2iARB }, + { 5409, _gloffset_MultiTexCoord2svARB }, + { 7340, _gloffset_MultiTexCoord2fARB }, + { 9133, _gloffset_MultiTexCoord3fvARB }, + { 9625, _gloffset_MultiTexCoord4sARB }, + { 10225, _gloffset_MultiTexCoord2dvARB }, + { 10607, _gloffset_MultiTexCoord1svARB }, + { 10864, _gloffset_MultiTexCoord3svARB }, + { 10925, _gloffset_MultiTexCoord4iARB }, + { 11612, _gloffset_MultiTexCoord3iARB }, + { 12346, _gloffset_MultiTexCoord1dARB }, + { 12512, _gloffset_MultiTexCoord3dvARB }, + { 13676, _gloffset_MultiTexCoord3ivARB }, + { 13721, _gloffset_MultiTexCoord2sARB }, + { 14941, _gloffset_MultiTexCoord4ivARB }, + { 16570, _gloffset_ClientActiveTextureARB }, + { 18786, _gloffset_MultiTexCoord2dARB }, + { 19161, _gloffset_MultiTexCoord4dvARB }, + { 19447, _gloffset_MultiTexCoord4fvARB }, + { 20274, _gloffset_MultiTexCoord3fARB }, + { 22584, _gloffset_MultiTexCoord4dARB }, + { 22788, _gloffset_MultiTexCoord1sARB }, + { 22966, _gloffset_MultiTexCoord1dvARB }, + { 23753, _gloffset_MultiTexCoord1ivARB }, + { 23846, _gloffset_MultiTexCoord2ivARB }, + { 24185, _gloffset_MultiTexCoord1iARB }, + { 25456, _gloffset_MultiTexCoord4svARB }, + { 25974, _gloffset_MultiTexCoord1fARB }, + { 26237, _gloffset_MultiTexCoord4fARB }, + { 28505, _gloffset_MultiTexCoord2fvARB }, + { -1, -1 } +}; + +#endif /* need_MESA_remap_table */ + +#if defined(need_GL_3DFX_tbuffer) +static const struct gl_function_remap GL_3DFX_tbuffer_functions[] = { + { 8206, -1 }, /* TbufferMask3DFX */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_APPLE_flush_buffer_range) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_APPLE_flush_buffer_range_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_APPLE_texture_range) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_APPLE_texture_range_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_APPLE_vertex_array_object) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_APPLE_vertex_array_object_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_ARB_copy_buffer) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_ARB_copy_buffer_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_ARB_draw_buffers) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_ARB_draw_buffers_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_ARB_draw_elements_base_vertex) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_ARB_draw_elements_base_vertex_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_ARB_framebuffer_object) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_ARB_framebuffer_object_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_ARB_map_buffer_range) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_ARB_map_buffer_range_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_ARB_matrix_palette) +static const struct gl_function_remap GL_ARB_matrix_palette_functions[] = { + { 3339, -1 }, /* MatrixIndexusvARB */ + { 11469, -1 }, /* MatrixIndexuivARB */ + { 12634, -1 }, /* MatrixIndexPointerARB */ + { 17308, -1 }, /* CurrentPaletteMatrixARB */ + { 20018, -1 }, /* MatrixIndexubvARB */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_ARB_multisample) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_ARB_multisample_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_ARB_occlusion_query) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_ARB_occlusion_query_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_ARB_point_parameters) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_ARB_point_parameters_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_ARB_provoking_vertex) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_ARB_provoking_vertex_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_ARB_shader_objects) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_ARB_shader_objects_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_ARB_sync) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_ARB_sync_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_ARB_texture_compression) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_ARB_texture_compression_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_ARB_transpose_matrix) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_ARB_transpose_matrix_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_ARB_vertex_array_object) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_ARB_vertex_array_object_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_ARB_vertex_blend) +static const struct gl_function_remap GL_ARB_vertex_blend_functions[] = { + { 2226, -1 }, /* WeightubvARB */ + { 5572, -1 }, /* WeightivARB */ + { 9728, -1 }, /* WeightPointerARB */ + { 12103, -1 }, /* WeightfvARB */ + { 15388, -1 }, /* WeightbvARB */ + { 18454, -1 }, /* WeightusvARB */ + { 21001, -1 }, /* VertexBlendARB */ + { 26058, -1 }, /* WeightsvARB */ + { 28007, -1 }, /* WeightdvARB */ + { 28705, -1 }, /* WeightuivARB */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_ARB_vertex_buffer_object) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_ARB_vertex_buffer_object_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_ARB_vertex_program) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_ARB_vertex_program_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_ARB_vertex_shader) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_ARB_vertex_shader_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_ARB_window_pos) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_ARB_window_pos_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_ATI_blend_equation_separate) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_ATI_blend_equation_separate_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_ATI_draw_buffers) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_ATI_draw_buffers_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_ATI_envmap_bumpmap) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_ATI_envmap_bumpmap_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_ATI_fragment_shader) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_ATI_fragment_shader_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_ATI_separate_stencil) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_ATI_separate_stencil_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_blend_color) +static const struct gl_function_remap GL_EXT_blend_color_functions[] = { + { 2440, _gloffset_BlendColor }, + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_blend_equation_separate) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_EXT_blend_equation_separate_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_blend_func_separate) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_EXT_blend_func_separate_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_blend_minmax) +static const struct gl_function_remap GL_EXT_blend_minmax_functions[] = { + { 9863, _gloffset_BlendEquation }, + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_color_subtable) +static const struct gl_function_remap GL_EXT_color_subtable_functions[] = { + { 14884, _gloffset_ColorSubTable }, + { 27957, _gloffset_CopyColorSubTable }, + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_compiled_vertex_array) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_EXT_compiled_vertex_array_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_convolution) +static const struct gl_function_remap GL_EXT_convolution_functions[] = { + { 213, _gloffset_ConvolutionFilter1D }, + { 2284, _gloffset_CopyConvolutionFilter1D }, + { 3624, _gloffset_GetConvolutionParameteriv }, + { 7522, _gloffset_ConvolutionFilter2D }, + { 7688, _gloffset_ConvolutionParameteriv }, + { 8148, _gloffset_ConvolutionParameterfv }, + { 18029, _gloffset_GetSeparableFilter }, + { 21075, _gloffset_SeparableFilter2D }, + { 21904, _gloffset_ConvolutionParameteri }, + { 22027, _gloffset_ConvolutionParameterf }, + { 23406, _gloffset_GetConvolutionParameterfv }, + { 24228, _gloffset_GetConvolutionFilter }, + { 26472, _gloffset_CopyConvolutionFilter2D }, + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_coordinate_frame) +static const struct gl_function_remap GL_EXT_coordinate_frame_functions[] = { + { 9272, -1 }, /* TangentPointerEXT */ + { 10983, -1 }, /* Binormal3ivEXT */ + { 11565, -1 }, /* Tangent3sEXT */ + { 12699, -1 }, /* Tangent3fvEXT */ + { 16320, -1 }, /* Tangent3dvEXT */ + { 17006, -1 }, /* Binormal3bvEXT */ + { 18082, -1 }, /* Binormal3dEXT */ + { 19950, -1 }, /* Tangent3fEXT */ + { 21976, -1 }, /* Binormal3sEXT */ + { 22394, -1 }, /* Tangent3ivEXT */ + { 22413, -1 }, /* Tangent3dEXT */ + { 23193, -1 }, /* Binormal3svEXT */ + { 23651, -1 }, /* Binormal3fEXT */ + { 24503, -1 }, /* Binormal3dvEXT */ + { 25678, -1 }, /* Tangent3iEXT */ + { 26757, -1 }, /* Tangent3bvEXT */ + { 27166, -1 }, /* Tangent3bEXT */ + { 27730, -1 }, /* Binormal3fvEXT */ + { 28404, -1 }, /* BinormalPointerEXT */ + { 28809, -1 }, /* Tangent3svEXT */ + { 29246, -1 }, /* Binormal3bEXT */ + { 29423, -1 }, /* Binormal3iEXT */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_copy_texture) +static const struct gl_function_remap GL_EXT_copy_texture_functions[] = { + { 13142, _gloffset_CopyTexSubImage3D }, + { 14624, _gloffset_CopyTexImage2D }, + { 21512, _gloffset_CopyTexImage1D }, + { 23909, _gloffset_CopyTexSubImage2D }, + { 26110, _gloffset_CopyTexSubImage1D }, + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_cull_vertex) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_EXT_cull_vertex_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_depth_bounds_test) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_EXT_depth_bounds_test_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_draw_range_elements) +static const struct gl_function_remap GL_EXT_draw_range_elements_functions[] = { + { 8402, _gloffset_DrawRangeElements }, + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_fog_coord) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_EXT_fog_coord_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_framebuffer_blit) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_EXT_framebuffer_blit_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_framebuffer_object) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_EXT_framebuffer_object_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_gpu_program_parameters) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_EXT_gpu_program_parameters_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_histogram) +static const struct gl_function_remap GL_EXT_histogram_functions[] = { + { 812, _gloffset_Histogram }, + { 3088, _gloffset_ResetHistogram }, + { 8774, _gloffset_GetMinmax }, + { 13476, _gloffset_GetHistogramParameterfv }, + { 21437, _gloffset_GetMinmaxParameteriv }, + { 23296, _gloffset_ResetMinmax }, + { 24125, _gloffset_GetHistogramParameteriv }, + { 25181, _gloffset_GetHistogram }, + { 27543, _gloffset_Minmax }, + { 29044, _gloffset_GetMinmaxParameterfv }, + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_index_func) +static const struct gl_function_remap GL_EXT_index_func_functions[] = { + { 10090, -1 }, /* IndexFuncEXT */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_index_material) +static const struct gl_function_remap GL_EXT_index_material_functions[] = { + { 18541, -1 }, /* IndexMaterialEXT */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_light_texture) +static const struct gl_function_remap GL_EXT_light_texture_functions[] = { + { 23213, -1 }, /* ApplyTextureEXT */ + { 23250, -1 }, /* TextureMaterialEXT */ + { 23275, -1 }, /* TextureLightEXT */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_multi_draw_arrays) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_EXT_multi_draw_arrays_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_multisample) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_EXT_multisample_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_paletted_texture) +static const struct gl_function_remap GL_EXT_paletted_texture_functions[] = { + { 7384, _gloffset_ColorTable }, + { 13322, _gloffset_GetColorTable }, + { 20133, _gloffset_GetColorTableParameterfv }, + { 22083, _gloffset_GetColorTableParameteriv }, + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_pixel_transform) +static const struct gl_function_remap GL_EXT_pixel_transform_functions[] = { + { 9513, -1 }, /* PixelTransformParameterfvEXT */ + { 19126, -1 }, /* PixelTransformParameterfEXT */ + { 19206, -1 }, /* PixelTransformParameteriEXT */ + { 28368, -1 }, /* PixelTransformParameterivEXT */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_point_parameters) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_EXT_point_parameters_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_polygon_offset) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_EXT_polygon_offset_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_provoking_vertex) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_EXT_provoking_vertex_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_secondary_color) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_EXT_secondary_color_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_stencil_two_side) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_EXT_stencil_two_side_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_subtexture) +static const struct gl_function_remap GL_EXT_subtexture_functions[] = { + { 6105, _gloffset_TexSubImage1D }, + { 9388, _gloffset_TexSubImage2D }, + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_texture3D) +static const struct gl_function_remap GL_EXT_texture3D_functions[] = { + { 1658, _gloffset_TexImage3D }, + { 19902, _gloffset_TexSubImage3D }, + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_texture_array) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_EXT_texture_array_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_texture_object) +static const struct gl_function_remap GL_EXT_texture_object_functions[] = { + { 2964, _gloffset_PrioritizeTextures }, + { 6554, _gloffset_AreTexturesResident }, + { 11841, _gloffset_GenTextures }, + { 13808, _gloffset_DeleteTextures }, + { 17059, _gloffset_IsTexture }, + { 26175, _gloffset_BindTexture }, + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_texture_perturb_normal) +static const struct gl_function_remap GL_EXT_texture_perturb_normal_functions[] = { + { 12053, -1 }, /* TextureNormalEXT */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_timer_query) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_EXT_timer_query_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_vertex_array) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_EXT_vertex_array_functions[] = { + { 21264, _gloffset_ArrayElement }, + { 27131, _gloffset_GetPointerv }, + { 28671, _gloffset_DrawArrays }, + { -1, -1 } +}; +#endif + +#if defined(need_GL_EXT_vertex_weighting) +static const struct gl_function_remap GL_EXT_vertex_weighting_functions[] = { + { 17089, -1 }, /* VertexWeightfvEXT */ + { 23629, -1 }, /* VertexWeightfEXT */ + { 25150, -1 }, /* VertexWeightPointerEXT */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_HP_image_transform) +static const struct gl_function_remap GL_HP_image_transform_functions[] = { + { 2157, -1 }, /* GetImageTransformParameterfvHP */ + { 3305, -1 }, /* ImageTransformParameterfHP */ + { 8966, -1 }, /* ImageTransformParameterfvHP */ + { 10525, -1 }, /* ImageTransformParameteriHP */ + { 10754, -1 }, /* GetImageTransformParameterivHP */ + { 17153, -1 }, /* ImageTransformParameterivHP */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_IBM_multimode_draw_arrays) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_IBM_multimode_draw_arrays_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_IBM_vertex_array_lists) +static const struct gl_function_remap GL_IBM_vertex_array_lists_functions[] = { + { 3857, -1 }, /* SecondaryColorPointerListIBM */ + { 5106, -1 }, /* NormalPointerListIBM */ + { 6728, -1 }, /* FogCoordPointerListIBM */ + { 7035, -1 }, /* VertexPointerListIBM */ + { 10446, -1 }, /* ColorPointerListIBM */ + { 11672, -1 }, /* TexCoordPointerListIBM */ + { 12075, -1 }, /* IndexPointerListIBM */ + { 28987, -1 }, /* EdgeFlagPointerListIBM */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_INGR_blend_func_separate) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_INGR_blend_func_separate_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_INTEL_parallel_arrays) +static const struct gl_function_remap GL_INTEL_parallel_arrays_functions[] = { + { 11095, -1 }, /* VertexPointervINTEL */ + { 13569, -1 }, /* ColorPointervINTEL */ + { 26446, -1 }, /* NormalPointervINTEL */ + { 26872, -1 }, /* TexCoordPointervINTEL */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_MESA_resize_buffers) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_MESA_resize_buffers_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_MESA_shader_debug) +static const struct gl_function_remap GL_MESA_shader_debug_functions[] = { + { 1522, -1 }, /* GetDebugLogLengthMESA */ + { 3063, -1 }, /* ClearDebugLogMESA */ + { 4018, -1 }, /* GetDebugLogMESA */ + { 27324, -1 }, /* CreateDebugObjectMESA */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_MESA_window_pos) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_MESA_window_pos_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_NV_evaluators) +static const struct gl_function_remap GL_NV_evaluators_functions[] = { + { 5773, -1 }, /* GetMapAttribParameterivNV */ + { 7490, -1 }, /* MapControlPointsNV */ + { 7589, -1 }, /* MapParameterfvNV */ + { 9371, -1 }, /* EvalMapsNV */ + { 15058, -1 }, /* GetMapAttribParameterfvNV */ + { 15224, -1 }, /* MapParameterivNV */ + { 21827, -1 }, /* GetMapParameterivNV */ + { 22325, -1 }, /* GetMapParameterfvNV */ + { 25782, -1 }, /* GetMapControlPointsNV */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_NV_fence) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_NV_fence_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_NV_fragment_program) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_NV_fragment_program_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_NV_point_sprite) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_NV_point_sprite_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_NV_register_combiners) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_NV_register_combiners_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_NV_register_combiners2) +static const struct gl_function_remap GL_NV_register_combiners2_functions[] = { + { 13961, -1 }, /* CombinerStageParameterfvNV */ + { 14276, -1 }, /* GetCombinerStageParameterfvNV */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_NV_vertex_array_range) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_NV_vertex_array_range_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_NV_vertex_program) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_NV_vertex_program_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_PGI_misc_hints) +static const struct gl_function_remap GL_PGI_misc_hints_functions[] = { + { 7674, -1 }, /* HintPGI */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIS_detail_texture) +static const struct gl_function_remap GL_SGIS_detail_texture_functions[] = { + { 14249, -1 }, /* GetDetailTexFuncSGIS */ + { 14569, -1 }, /* DetailTexFuncSGIS */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIS_fog_function) +static const struct gl_function_remap GL_SGIS_fog_function_functions[] = { + { 23891, -1 }, /* FogFuncSGIS */ + { 24556, -1 }, /* GetFogFuncSGIS */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIS_multisample) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_SGIS_multisample_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIS_pixel_texture) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_SGIS_pixel_texture_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIS_point_parameters) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_SGIS_point_parameters_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIS_sharpen_texture) +static const struct gl_function_remap GL_SGIS_sharpen_texture_functions[] = { + { 5834, -1 }, /* GetSharpenTexFuncSGIS */ + { 19421, -1 }, /* SharpenTexFuncSGIS */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIS_texture4D) +static const struct gl_function_remap GL_SGIS_texture4D_functions[] = { + { 894, -1 }, /* TexImage4DSGIS */ + { 13877, -1 }, /* TexSubImage4DSGIS */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIS_texture_color_mask) +static const struct gl_function_remap GL_SGIS_texture_color_mask_functions[] = { + { 13275, -1 }, /* TextureColorMaskSGIS */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIS_texture_filter4) +static const struct gl_function_remap GL_SGIS_texture_filter4_functions[] = { + { 6011, -1 }, /* GetTexFilterFuncSGIS */ + { 14395, -1 }, /* TexFilterFuncSGIS */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIX_async) +static const struct gl_function_remap GL_SGIX_async_functions[] = { + { 3014, -1 }, /* AsyncMarkerSGIX */ + { 3997, -1 }, /* FinishAsyncSGIX */ + { 4703, -1 }, /* PollAsyncSGIX */ + { 19568, -1 }, /* DeleteAsyncMarkersSGIX */ + { 19597, -1 }, /* IsAsyncMarkerSGIX */ + { 28784, -1 }, /* GenAsyncMarkersSGIX */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIX_flush_raster) +static const struct gl_function_remap GL_SGIX_flush_raster_functions[] = { + { 6382, -1 }, /* FlushRasterSGIX */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIX_fragment_lighting) +static const struct gl_function_remap GL_SGIX_fragment_lighting_functions[] = { + { 2410, -1 }, /* FragmentMaterialfvSGIX */ + { 2906, -1 }, /* FragmentLightModelivSGIX */ + { 4654, -1 }, /* FragmentLightiSGIX */ + { 5514, -1 }, /* GetFragmentMaterialfvSGIX */ + { 7102, -1 }, /* FragmentMaterialfSGIX */ + { 7263, -1 }, /* GetFragmentLightivSGIX */ + { 8100, -1 }, /* FragmentLightModeliSGIX */ + { 9434, -1 }, /* FragmentLightivSGIX */ + { 9671, -1 }, /* GetFragmentMaterialivSGIX */ + { 16976, -1 }, /* FragmentLightModelfSGIX */ + { 17276, -1 }, /* FragmentColorMaterialSGIX */ + { 17648, -1 }, /* FragmentMaterialiSGIX */ + { 18869, -1 }, /* LightEnviSGIX */ + { 20225, -1 }, /* FragmentLightModelfvSGIX */ + { 20534, -1 }, /* FragmentLightfvSGIX */ + { 25032, -1 }, /* FragmentLightfSGIX */ + { 27700, -1 }, /* GetFragmentLightfvSGIX */ + { 29267, -1 }, /* FragmentMaterialivSGIX */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIX_framezoom) +static const struct gl_function_remap GL_SGIX_framezoom_functions[] = { + { 19620, -1 }, /* FrameZoomSGIX */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIX_igloo_interface) +static const struct gl_function_remap GL_SGIX_igloo_interface_functions[] = { + { 25340, -1 }, /* IglooInterfaceSGIX */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIX_instruments) +static const struct gl_function_remap GL_SGIX_instruments_functions[] = { + { 2573, -1 }, /* ReadInstrumentsSGIX */ + { 5590, -1 }, /* PollInstrumentsSGIX */ + { 9332, -1 }, /* GetInstrumentsSGIX */ + { 11306, -1 }, /* StartInstrumentsSGIX */ + { 13995, -1 }, /* StopInstrumentsSGIX */ + { 15601, -1 }, /* InstrumentsBufferSGIX */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIX_list_priority) +static const struct gl_function_remap GL_SGIX_list_priority_functions[] = { + { 1125, -1 }, /* ListParameterfSGIX */ + { 2763, -1 }, /* GetListParameterfvSGIX */ + { 15516, -1 }, /* ListParameteriSGIX */ + { 16270, -1 }, /* ListParameterfvSGIX */ + { 18275, -1 }, /* ListParameterivSGIX */ + { 28828, -1 }, /* GetListParameterivSGIX */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIX_pixel_texture) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_SGIX_pixel_texture_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIX_polynomial_ffd) +static const struct gl_function_remap GL_SGIX_polynomial_ffd_functions[] = { + { 3251, -1 }, /* LoadIdentityDeformationMapSGIX */ + { 14095, -1 }, /* DeformSGIX */ + { 21376, -1 }, /* DeformationMap3fSGIX */ + { 27588, -1 }, /* DeformationMap3dSGIX */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIX_reference_plane) +static const struct gl_function_remap GL_SGIX_reference_plane_functions[] = { + { 12826, -1 }, /* ReferencePlaneSGIX */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIX_sprite) +static const struct gl_function_remap GL_SGIX_sprite_functions[] = { + { 8487, -1 }, /* SpriteParameterfvSGIX */ + { 18103, -1 }, /* SpriteParameteriSGIX */ + { 23330, -1 }, /* SpriteParameterfSGIX */ + { 25904, -1 }, /* SpriteParameterivSGIX */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGIX_tag_sample_buffer) +static const struct gl_function_remap GL_SGIX_tag_sample_buffer_functions[] = { + { 18162, -1 }, /* TagSampleBufferSGIX */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SGI_color_table) +static const struct gl_function_remap GL_SGI_color_table_functions[] = { + { 6672, _gloffset_ColorTableParameteriv }, + { 7384, _gloffset_ColorTable }, + { 13322, _gloffset_GetColorTable }, + { 13432, _gloffset_CopyColorTable }, + { 16920, _gloffset_ColorTableParameterfv }, + { 20133, _gloffset_GetColorTableParameterfv }, + { 22083, _gloffset_GetColorTableParameteriv }, + { -1, -1 } +}; +#endif + +#if defined(need_GL_SUNX_constant_data) +static const struct gl_function_remap GL_SUNX_constant_data_functions[] = { + { 27678, -1 }, /* FinishTextureSUNX */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SUN_global_alpha) +static const struct gl_function_remap GL_SUN_global_alpha_functions[] = { + { 3035, -1 }, /* GlobalAlphaFactorubSUN */ + { 4193, -1 }, /* GlobalAlphaFactoriSUN */ + { 5615, -1 }, /* GlobalAlphaFactordSUN */ + { 8571, -1 }, /* GlobalAlphaFactoruiSUN */ + { 8923, -1 }, /* GlobalAlphaFactorbSUN */ + { 11585, -1 }, /* GlobalAlphaFactorfSUN */ + { 11704, -1 }, /* GlobalAlphaFactorusSUN */ + { 19859, -1 }, /* GlobalAlphaFactorsSUN */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SUN_mesh_array) +static const struct gl_function_remap GL_SUN_mesh_array_functions[] = { + { 25716, -1 }, /* DrawMeshArraysSUN */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SUN_triangle_list) +static const struct gl_function_remap GL_SUN_triangle_list_functions[] = { + { 3971, -1 }, /* ReplacementCodeubSUN */ + { 5454, -1 }, /* ReplacementCodeubvSUN */ + { 16641, -1 }, /* ReplacementCodeusvSUN */ + { 16829, -1 }, /* ReplacementCodePointerSUN */ + { 18186, -1 }, /* ReplacementCodeusSUN */ + { 18933, -1 }, /* ReplacementCodeuiSUN */ + { 26361, -1 }, /* ReplacementCodeuivSUN */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_SUN_vertex) +static const struct gl_function_remap GL_SUN_vertex_functions[] = { + { 999, -1 }, /* ReplacementCodeuiColor3fVertex3fvSUN */ + { 1197, -1 }, /* TexCoord4fColor4fNormal3fVertex4fvSUN */ + { 1423, -1 }, /* TexCoord2fColor4ubVertex3fvSUN */ + { 1699, -1 }, /* ReplacementCodeuiVertex3fvSUN */ + { 1833, -1 }, /* ReplacementCodeuiTexCoord2fVertex3fvSUN */ + { 2346, -1 }, /* ReplacementCodeuiNormal3fVertex3fSUN */ + { 2642, -1 }, /* Color4ubVertex3fvSUN */ + { 4074, -1 }, /* Color4ubVertex3fSUN */ + { 4150, -1 }, /* TexCoord2fVertex3fSUN */ + { 4449, -1 }, /* TexCoord2fColor4fNormal3fVertex3fSUN */ + { 4779, -1 }, /* TexCoord2fNormal3fVertex3fvSUN */ + { 5349, -1 }, /* ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN */ + { 6419, -1 }, /* ReplacementCodeuiTexCoord2fVertex3fSUN */ + { 7131, -1 }, /* TexCoord2fNormal3fVertex3fSUN */ + { 7899, -1 }, /* Color3fVertex3fSUN */ + { 8882, -1 }, /* Color3fVertex3fvSUN */ + { 9297, -1 }, /* Color4fNormal3fVertex3fvSUN */ + { 9969, -1 }, /* ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN */ + { 11169, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fvSUN */ + { 12557, -1 }, /* ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN */ + { 12968, -1 }, /* TexCoord2fColor3fVertex3fSUN */ + { 14020, -1 }, /* TexCoord4fColor4fNormal3fVertex4fSUN */ + { 14354, -1 }, /* Color4ubVertex2fvSUN */ + { 14594, -1 }, /* Normal3fVertex3fSUN */ + { 15542, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fSUN */ + { 15803, -1 }, /* TexCoord2fColor4fNormal3fVertex3fvSUN */ + { 16470, -1 }, /* TexCoord2fVertex3fvSUN */ + { 17246, -1 }, /* Color4ubVertex2fSUN */ + { 17439, -1 }, /* ReplacementCodeuiColor4ubVertex3fSUN */ + { 19292, -1 }, /* TexCoord2fColor4ubVertex3fSUN */ + { 19639, -1 }, /* Normal3fVertex3fvSUN */ + { 20042, -1 }, /* Color4fNormal3fVertex3fSUN */ + { 20908, -1 }, /* ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN */ + { 21128, -1 }, /* ReplacementCodeuiColor4ubVertex3fvSUN */ + { 22831, -1 }, /* ReplacementCodeuiColor3fVertex3fSUN */ + { 24007, -1 }, /* TexCoord4fVertex4fSUN */ + { 24433, -1 }, /* TexCoord2fColor3fVertex3fvSUN */ + { 24759, -1 }, /* ReplacementCodeuiNormal3fVertex3fvSUN */ + { 24886, -1 }, /* TexCoord4fVertex4fvSUN */ + { 25588, -1 }, /* ReplacementCodeuiVertex3fSUN */ + { -1, -1 } +}; +#endif + +#if defined(need_GL_VERSION_1_3) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_VERSION_1_3_functions[] = { + { 381, _gloffset_MultiTexCoord3sARB }, + { 613, _gloffset_ActiveTextureARB }, + { 3761, _gloffset_MultiTexCoord1fvARB }, + { 5240, _gloffset_MultiTexCoord3dARB }, + { 5285, _gloffset_MultiTexCoord2iARB }, + { 5409, _gloffset_MultiTexCoord2svARB }, + { 7340, _gloffset_MultiTexCoord2fARB }, + { 9133, _gloffset_MultiTexCoord3fvARB }, + { 9625, _gloffset_MultiTexCoord4sARB }, + { 10225, _gloffset_MultiTexCoord2dvARB }, + { 10607, _gloffset_MultiTexCoord1svARB }, + { 10864, _gloffset_MultiTexCoord3svARB }, + { 10925, _gloffset_MultiTexCoord4iARB }, + { 11612, _gloffset_MultiTexCoord3iARB }, + { 12346, _gloffset_MultiTexCoord1dARB }, + { 12512, _gloffset_MultiTexCoord3dvARB }, + { 13676, _gloffset_MultiTexCoord3ivARB }, + { 13721, _gloffset_MultiTexCoord2sARB }, + { 14941, _gloffset_MultiTexCoord4ivARB }, + { 16570, _gloffset_ClientActiveTextureARB }, + { 18786, _gloffset_MultiTexCoord2dARB }, + { 19161, _gloffset_MultiTexCoord4dvARB }, + { 19447, _gloffset_MultiTexCoord4fvARB }, + { 20274, _gloffset_MultiTexCoord3fARB }, + { 22584, _gloffset_MultiTexCoord4dARB }, + { 22788, _gloffset_MultiTexCoord1sARB }, + { 22966, _gloffset_MultiTexCoord1dvARB }, + { 23753, _gloffset_MultiTexCoord1ivARB }, + { 23846, _gloffset_MultiTexCoord2ivARB }, + { 24185, _gloffset_MultiTexCoord1iARB }, + { 25456, _gloffset_MultiTexCoord4svARB }, + { 25974, _gloffset_MultiTexCoord1fARB }, + { 26237, _gloffset_MultiTexCoord4fARB }, + { 28505, _gloffset_MultiTexCoord2fvARB }, + { -1, -1 } +}; +#endif + +#if defined(need_GL_VERSION_1_4) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_VERSION_1_4_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_VERSION_1_5) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_VERSION_1_5_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_VERSION_2_0) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_VERSION_2_0_functions[] = { + { -1, -1 } +}; +#endif + +#if defined(need_GL_VERSION_2_1) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_VERSION_2_1_functions[] = { + { -1, -1 } +}; +#endif + -- cgit v1.2.3 From 17ef1f6074d6107c167f1956a5c60993904c0b72 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Thu, 8 Oct 2009 10:33:57 +0800 Subject: mesa: Enable remap table in core. This enables the remap table in core. driInitExtensions is adapted to use the remap table. All uses of extension_helper.h are replaced by remap_helper.h. The chicken-egg problem of the DRI drivers is also solved. It is now also possible to pass NULL extensions to driInitExtensions. It will cause driInitExtensions to map all known functions. This functionality is used by software drivers and EGL_i915. Signed-off-by: Chia-I Wu --- src/mesa/drivers/dri/common/utils.c | 94 ++++++--------------------- src/mesa/drivers/dri/common/utils.h | 32 +-------- src/mesa/drivers/dri/i810/i810context.c | 2 +- src/mesa/drivers/dri/i810/i810screen.c | 4 -- src/mesa/drivers/dri/intel/intel_extensions.c | 3 +- src/mesa/drivers/dri/intel/intel_screen.c | 24 ------- src/mesa/drivers/dri/mach64/mach64_context.c | 2 +- src/mesa/drivers/dri/mach64/mach64_screen.c | 14 ---- src/mesa/drivers/dri/mga/mga_xmesa.c | 18 +---- src/mesa/drivers/dri/r128/r128_context.c | 4 +- src/mesa/drivers/dri/r128/r128_screen.c | 14 ---- src/mesa/drivers/dri/r200/r200_context.c | 16 ++--- src/mesa/drivers/dri/r300/r300_context.c | 8 +-- src/mesa/drivers/dri/r600/r600_context.c | 8 +-- src/mesa/drivers/dri/radeon/radeon_context.c | 6 +- src/mesa/drivers/dri/radeon/radeon_screen.c | 54 --------------- src/mesa/drivers/dri/savage/savage_xmesa.c | 14 +--- src/mesa/drivers/dri/sis/sis_context.c | 6 +- src/mesa/drivers/dri/sis/sis_screen.c | 12 ---- src/mesa/drivers/dri/swrast/swrast.c | 74 +-------------------- src/mesa/drivers/dri/tdfx/tdfx_context.c | 6 +- src/mesa/drivers/dri/tdfx/tdfx_screen.c | 16 ----- src/mesa/drivers/dri/unichrome/via_context.c | 4 +- src/mesa/drivers/dri/unichrome/via_screen.c | 14 ---- src/mesa/drivers/x11/xm_api.c | 73 --------------------- src/mesa/main/context.c | 3 + src/mesa/sources.mak | 1 + 27 files changed, 61 insertions(+), 465 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/common/utils.c b/src/mesa/drivers/dri/common/utils.c index 66f277c10b..b272eb74ea 100644 --- a/src/mesa/drivers/dri/common/utils.c +++ b/src/mesa/drivers/dri/common/utils.c @@ -38,9 +38,6 @@ #include "utils.h" -int driDispatchRemapTable[ driDispatchRemapTable_size ]; - - unsigned driParseDebugString( const char * debug, const struct dri_debug_control * control ) @@ -142,7 +139,7 @@ driGetRendererString( char * buffer, const char * hardware_name, #define need_GL_EXT_blend_func_separate #define need_GL_NV_vertex_program -#include "extension_helper.h" +#include "main/remap_helper.h" static const struct dri_extension all_mesa_extensions[] = { { "GL_ARB_draw_buffers", GL_ARB_draw_buffers_functions }, @@ -165,8 +162,12 @@ static const struct dri_extension all_mesa_extensions[] = { /** - * Enable extensions supported by the driver. + * Enable and map extensions supported by the driver. * + * When ctx is NULL, extensions are not enabled, but their functions + * are still mapped. When extensions_to_enable is NULL, all static + * functions known to mesa core are mapped. + * * \bug * ARB_imaging isn't handled properly. In Mesa, enabling ARB_imaging also * enables all the sub-extensions that are folded into it. This means that @@ -181,18 +182,23 @@ void driInitExtensions( GLcontext * ctx, unsigned i; if ( first_time ) { - for ( i = 0 ; i < driDispatchRemapTable_size ; i++ ) { - driDispatchRemapTable[i] = -1; - } - first_time = 0; - driInitExtensions( ctx, all_mesa_extensions, GL_FALSE ); + driInitExtensions( NULL, all_mesa_extensions, GL_FALSE ); } if ( (ctx != NULL) && enable_imaging ) { _mesa_enable_imaging_extensions( ctx ); } + /* The caller is too lazy to list any extension */ + if ( extensions_to_enable == NULL ) { + /* Map the static functions. Together with those mapped by remap + * table, this should cover everything mesa core knows. + */ + _mesa_map_static_functions(); + return; + } + for ( i = 0 ; extensions_to_enable[i].name != NULL ; i++ ) { driInitSingleExtension( ctx, & extensions_to_enable[i] ); } @@ -202,80 +208,18 @@ void driInitExtensions( GLcontext * ctx, /** - * Enable and add dispatch functions for a single extension + * Enable and map functions for a single extension * * \param ctx Context where extension is to be enabled. * \param ext Extension that is to be enabled. * - * \sa driInitExtensions, _mesa_enable_extension, _glapi_add_entrypoint - * - * \todo - * Determine if it would be better to use \c strlen instead of the hardcoded - * for-loops. + * \sa driInitExtensions, _mesa_enable_extension, _mesa_map_function_array */ void driInitSingleExtension( GLcontext * ctx, const struct dri_extension * ext ) { - unsigned i; - - if ( ext->functions != NULL ) { - for ( i = 0 ; ext->functions[i].strings != NULL ; i++ ) { - const char * functions[16]; - const char * parameter_signature; - const char * str = ext->functions[i].strings; - unsigned j; - unsigned offset; - - - /* Separate the parameter signature from the rest of the string. - * If the parameter signature is empty (i.e., the string starts - * with a NUL character), then the function has a void parameter - * list. - */ - parameter_signature = str; - while ( str[0] != '\0' ) { - str++; - } - str++; - - - /* Divide the string into the substrings that name each - * entry-point for the function. - */ - for ( j = 0 ; j < 16 ; j++ ) { - if ( str[0] == '\0' ) { - functions[j] = NULL; - break; - } - - functions[j] = str; - - while ( str[0] != '\0' ) { - str++; - } - str++; - } - - - /* Add each entry-point to the dispatch table. - */ - offset = _glapi_add_dispatch( functions, parameter_signature ); - if (offset == -1) { -#if 0 /* this causes noise with egl */ - fprintf(stderr, "DISPATCH ERROR! _glapi_add_dispatch failed " - "to add %s!\n", functions[0]); -#endif - } - else if (ext->functions[i].remap_index != -1) { - driDispatchRemapTable[ ext->functions[i].remap_index ] = - offset; - } - else if (ext->functions[i].offset != offset) { - fprintf(stderr, "DISPATCH ERROR! %s -> %u != %u\n", - functions[0], offset, ext->functions[i].offset); - } - } + _mesa_map_function_array(ext->functions); } if ( ctx != NULL ) { diff --git a/src/mesa/drivers/dri/common/utils.h b/src/mesa/drivers/dri/common/utils.h index 9e9e5bc224..2aa6de66c1 100644 --- a/src/mesa/drivers/dri/common/utils.h +++ b/src/mesa/drivers/dri/common/utils.h @@ -31,6 +31,7 @@ #include #include #include "main/context.h" +#include "main/remap.h" typedef struct __DRIutilversionRec2 __DRIutilversion2; @@ -39,35 +40,6 @@ struct dri_debug_control { unsigned flag; }; -/** - * Description of the entry-points and parameters for an OpenGL function. - */ -struct dri_extension_function { - /** - * \brief - * Packed string describing the parameter signature and the entry-point - * names. - * - * The parameter signature and the names of the entry-points for this - * function are packed into a single string. The substrings are - * separated by NUL characters. The whole string is terminated by - * two consecutive NUL characters. - */ - const char * strings; - - - /** - * Location in the remap table where the dispatch offset should be - * stored. - */ - int remap_index; - - /** - * Offset of the function in the dispatch table. - */ - int offset; -}; - /** * Description of the API for an extension to OpenGL. */ @@ -83,7 +55,7 @@ struct dri_extension { * is terminated by a structure with a \c NULL * \c dri_extension_function::strings pointer. */ - const struct dri_extension_function * functions; + const struct gl_function_remap * functions; }; /** diff --git a/src/mesa/drivers/dri/i810/i810context.c b/src/mesa/drivers/dri/i810/i810context.c index 6785655686..7311b2e765 100644 --- a/src/mesa/drivers/dri/i810/i810context.c +++ b/src/mesa/drivers/dri/i810/i810context.c @@ -116,7 +116,7 @@ static void i810BufferSize(GLframebuffer *buffer, GLuint *width, GLuint *height) /* Extension strings exported by the i810 driver. */ -const struct dri_extension card_extensions[] = +static const struct dri_extension card_extensions[] = { { "GL_ARB_multitexture", NULL }, { "GL_ARB_texture_env_add", NULL }, diff --git a/src/mesa/drivers/dri/i810/i810screen.c b/src/mesa/drivers/dri/i810/i810screen.c index 6e49f3466c..a9ee61132e 100644 --- a/src/mesa/drivers/dri/i810/i810screen.c +++ b/src/mesa/drivers/dri/i810/i810screen.c @@ -53,8 +53,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "GL/internal/dri_interface.h" -extern const struct dri_extension card_extensions[]; - static const __DRIconfig ** i810FillInModes( __DRIscreenPrivate *psp, unsigned pixel_bits, unsigned depth_bits, @@ -166,8 +164,6 @@ i810InitScreen(__DRIscreen *sPriv) return NULL; } - driInitExtensions( NULL, card_extensions, GL_TRUE ); - if (sPriv->devPrivSize != sizeof(I810DRIRec)) { fprintf(stderr,"\nERROR! sizeof(I810DRIRec) does not match passed size from device driver\n"); return GL_FALSE; diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index 2eb08a8f05..b6754c9fcb 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -28,6 +28,7 @@ #include "intel_chipset.h" #include "intel_context.h" #include "intel_extensions.h" +#include "utils.h" #define need_GL_ARB_copy_buffer @@ -63,7 +64,7 @@ #define need_GL_VERSION_2_0 #define need_GL_VERSION_2_1 -#include "extension_helper.h" +#include "main/remap_helper.h" /** diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index 24f7fbc992..41342ddcae 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -696,18 +696,6 @@ static const __DRIconfig **intelInitScreen(__DRIscreenPrivate *psp) return NULL; } - /* Calling driInitExtensions here, with a NULL context pointer, - * does not actually enable the extensions. It just makes sure - * that all the dispatch offsets for all the extensions that - * *might* be enables are known. This is needed because the - * dispatch offsets need to be known when _mesa_context_create is - * called, but we can't enable the extensions until we have a - * context pointer. - * - * Hello chicken. Hello egg. How are you two today? - */ - intelInitExtensions(NULL, GL_TRUE); - if (!intelInitDriver(psp)) return NULL; @@ -760,18 +748,6 @@ __DRIconfig **intelInitScreen2(__DRIscreenPrivate *psp) int color; __DRIconfig **configs = NULL; - /* Calling driInitExtensions here, with a NULL context pointer, - * does not actually enable the extensions. It just makes sure - * that all the dispatch offsets for all the extensions that - * *might* be enables are known. This is needed because the - * dispatch offsets need to be known when _mesa_context_create is - * called, but we can't enable the extensions until we have a - * context pointer. - * - * Hello chicken. Hello egg. How are you two today? - */ - intelInitExtensions(NULL, GL_TRUE); - /* Allocate the private area */ intelScreen = (intelScreenPrivate *) CALLOC(sizeof(intelScreenPrivate)); if (!intelScreen) { diff --git a/src/mesa/drivers/dri/mach64/mach64_context.c b/src/mesa/drivers/dri/mach64/mach64_context.c index 9c7f513c6f..2bca293b3c 100644 --- a/src/mesa/drivers/dri/mach64/mach64_context.c +++ b/src/mesa/drivers/dri/mach64/mach64_context.c @@ -76,7 +76,7 @@ static const struct dri_debug_control debug_control[] = { NULL, 0 } }; -const struct dri_extension card_extensions[] = +static const struct dri_extension card_extensions[] = { { "GL_ARB_multitexture", NULL }, { "GL_EXT_texture_edge_clamp", NULL }, diff --git a/src/mesa/drivers/dri/mach64/mach64_screen.c b/src/mesa/drivers/dri/mach64/mach64_screen.c index 6440027ca4..43aac899f7 100644 --- a/src/mesa/drivers/dri/mach64/mach64_screen.c +++ b/src/mesa/drivers/dri/mach64/mach64_screen.c @@ -67,8 +67,6 @@ static const GLuint __driNConfigOptions = 3; static const GLuint __driNConfigOptions = 2; #endif -extern const struct dri_extension card_extensions[]; - static const __DRIconfig ** mach64FillInModes( __DRIscreenPrivate *psp, unsigned pixel_bits, unsigned depth_bits, @@ -436,18 +434,6 @@ mach64InitScreen(__DRIscreenPrivate *psp) return NULL; } - /* Calling driInitExtensions here, with a NULL context pointer, - * does not actually enable the extensions. It just makes sure - * that all the dispatch offsets for all the extensions that - * *might* be enables are known. This is needed because the - * dispatch offsets need to be known when _mesa_context_create is - * called, but we can't enable the extensions until we have a - * context pointer. - * - * Hello chicken. Hello egg. How are you two today? - */ - driInitExtensions( NULL, card_extensions, GL_FALSE ); - if (!mach64InitDriver(psp)) return NULL; diff --git a/src/mesa/drivers/dri/mga/mga_xmesa.c b/src/mesa/drivers/dri/mga/mga_xmesa.c index 0dc76fea50..03fd9b6fc1 100644 --- a/src/mesa/drivers/dri/mga/mga_xmesa.c +++ b/src/mesa/drivers/dri/mga/mga_xmesa.c @@ -78,7 +78,7 @@ #endif #define need_GL_APPLE_vertex_array_object #define need_GL_NV_vertex_program -#include "extension_helper.h" +#include "main/remap_helper.h" /* MGA configuration */ @@ -945,22 +945,6 @@ static const __DRIconfig **mgaInitScreen(__DRIscreen *psp) return NULL; - /* Calling driInitExtensions here, with a NULL context pointer, - * does not actually enable the extensions. It just makes sure - * that all the dispatch offsets for all the extensions that - * *might* be enables are known. This is needed because the - * dispatch offsets need to be known when _mesa_context_create is - * called, but we can't enable the extensions until we have a - * context pointer. - * - * Hello chicken. Hello egg. How are you two today? - */ - - driInitExtensions( NULL, card_extensions, GL_FALSE ); - driInitExtensions( NULL, g400_extensions, GL_FALSE ); - driInitExtensions(NULL, ARB_vp_extensions, GL_FALSE); - driInitExtensions( NULL, NV_vp_extensions, GL_FALSE ); - if (!mgaInitDriver(psp)) return NULL; diff --git a/src/mesa/drivers/dri/r128/r128_context.c b/src/mesa/drivers/dri/r128/r128_context.c index f511a67bad..0b250876c5 100644 --- a/src/mesa/drivers/dri/r128/r128_context.c +++ b/src/mesa/drivers/dri/r128/r128_context.c @@ -68,9 +68,9 @@ int R128_DEBUG = 0; #define need_GL_EXT_blend_minmax #define need_GL_EXT_fog_coord #define need_GL_EXT_secondary_color -#include "extension_helper.h" +#include "main/remap_helper.h" -const struct dri_extension card_extensions[] = +static const struct dri_extension card_extensions[] = { { "GL_ARB_multitexture", NULL }, { "GL_ARB_texture_env_add", NULL }, diff --git a/src/mesa/drivers/dri/r128/r128_screen.c b/src/mesa/drivers/dri/r128/r128_screen.c index f5bcc2f290..a68b019776 100644 --- a/src/mesa/drivers/dri/r128/r128_screen.c +++ b/src/mesa/drivers/dri/r128/r128_screen.c @@ -74,8 +74,6 @@ static const GLuint __driNConfigOptions = 4; static const GLuint __driNConfigOptions = 3; #endif -extern const struct dri_extension card_extensions[]; - #if 1 /* Including xf86PciInfo.h introduces a bunch of errors... */ @@ -493,18 +491,6 @@ r128InitScreen(__DRIscreenPrivate *psp) &psp->drm_version, & drm_expected ) ) return NULL; - /* Calling driInitExtensions here, with a NULL context pointer, - * does not actually enable the extensions. It just makes sure - * that all the dispatch offsets for all the extensions that - * *might* be enables are known. This is needed because the - * dispatch offsets need to be known when _mesa_context_create is - * called, but we can't enable the extensions until we have a - * context pointer. - * - * Hello chicken. Hello egg. How are you two today? - */ - driInitExtensions( NULL, card_extensions, GL_FALSE ); - if (!r128InitDriver(psp)) return NULL; diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index 3ddb5bf7d6..e3ae839235 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -75,7 +75,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define need_GL_NV_vertex_program #define need_GL_ARB_point_parameters #define need_GL_EXT_framebuffer_object -#include "extension_helper.h" +#include "main/remap_helper.h" #define DRIVER_DATE "20060602" @@ -115,7 +115,7 @@ static const GLubyte *r200GetString( GLcontext *ctx, GLenum name ) /* Extension strings exported by the R200 driver. */ -const struct dri_extension card_extensions[] = +static const struct dri_extension card_extensions[] = { { "GL_ARB_multitexture", NULL }, { "GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions}, @@ -146,31 +146,31 @@ const struct dri_extension card_extensions[] = { NULL, NULL } }; -const struct dri_extension blend_extensions[] = { +static const struct dri_extension blend_extensions[] = { { "GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions }, { "GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions }, { NULL, NULL } }; -const struct dri_extension ARB_vp_extension[] = { +static const struct dri_extension ARB_vp_extension[] = { { "GL_ARB_vertex_program", GL_ARB_vertex_program_functions } }; -const struct dri_extension NV_vp_extension[] = { +static const struct dri_extension NV_vp_extension[] = { { "GL_NV_vertex_program", GL_NV_vertex_program_functions } }; -const struct dri_extension ATI_fs_extension[] = { +static const struct dri_extension ATI_fs_extension[] = { { "GL_ATI_fragment_shader", GL_ATI_fragment_shader_functions } }; -const struct dri_extension point_extensions[] = { +static const struct dri_extension point_extensions[] = { { "GL_ARB_point_sprite", NULL }, { "GL_ARB_point_parameters", GL_ARB_point_parameters_functions }, { NULL, NULL } }; -const struct dri_extension mm_extensions[] = { +static const struct dri_extension mm_extensions[] = { { "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions }, { NULL, NULL } }; diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 2c2b16aa98..6f66e970e4 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -90,10 +90,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define need_GL_ATI_separate_stencil #define need_GL_NV_vertex_program -#include "extension_helper.h" +#include "main/remap_helper.h" -const struct dri_extension card_extensions[] = { +static const struct dri_extension card_extensions[] = { /* *INDENT-OFF* */ {"GL_ARB_depth_texture", NULL}, {"GL_ARB_fragment_program", NULL}, @@ -145,7 +145,7 @@ const struct dri_extension card_extensions[] = { }; -const struct dri_extension mm_extensions[] = { +static const struct dri_extension mm_extensions[] = { { "GL_EXT_framebuffer_blit", GL_EXT_framebuffer_blit_functions }, { "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions }, { NULL, NULL } @@ -155,7 +155,7 @@ const struct dri_extension mm_extensions[] = { * The GL 2.0 functions are needed to make display lists work with * functions added by GL_ATI_separate_stencil. */ -const struct dri_extension gl_20_extension[] = { +static const struct dri_extension gl_20_extension[] = { {"GL_VERSION_2_0", GL_VERSION_2_0_functions }, }; diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index e6791b46f0..c1bf76deb8 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -92,9 +92,9 @@ int hw_tcl_on = 1; #define need_GL_ATI_separate_stencil #define need_GL_NV_vertex_program -#include "extension_helper.h" +#include "main/remap_helper.h" -const struct dri_extension card_extensions[] = { +static const struct dri_extension card_extensions[] = { /* *INDENT-OFF* */ {"GL_ARB_depth_texture", NULL}, {"GL_ARB_fragment_program", NULL}, @@ -145,7 +145,7 @@ const struct dri_extension card_extensions[] = { }; -const struct dri_extension mm_extensions[] = { +static const struct dri_extension mm_extensions[] = { { "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions }, { NULL, NULL } }; @@ -154,7 +154,7 @@ const struct dri_extension mm_extensions[] = { * The GL 2.0 functions are needed to make display lists work with * functions added by GL_ATI_separate_stencil. */ -const struct dri_extension gl_20_extension[] = { +static const struct dri_extension gl_20_extension[] = { {"GL_VERSION_2_0", GL_VERSION_2_0_functions }, }; diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index 8f4485aee7..5e700be4a5 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -69,7 +69,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define need_GL_EXT_fog_coord #define need_GL_EXT_secondary_color #define need_GL_EXT_framebuffer_object -#include "extension_helper.h" +#include "main/remap_helper.h" #define DRIVER_DATE "20061018" @@ -79,7 +79,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. /* Extension strings exported by the R100 driver. */ -const struct dri_extension card_extensions[] = +static const struct dri_extension card_extensions[] = { { "GL_ARB_multitexture", NULL }, { "GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions}, @@ -109,7 +109,7 @@ const struct dri_extension card_extensions[] = { NULL, NULL } }; -const struct dri_extension mm_extensions[] = { +static const struct dri_extension mm_extensions[] = { { "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions }, { NULL, NULL } }; diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 573eb6c9c1..2fb2d37cf1 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -141,12 +141,6 @@ DRI_CONF_BEGIN DRI_CONF_END; static const GLuint __driNConfigOptions = 17; -extern const struct dri_extension blend_extensions[]; -extern const struct dri_extension ARB_vp_extension[]; -extern const struct dri_extension NV_vp_extension[]; -extern const struct dri_extension ATI_fs_extension[]; -extern const struct dri_extension point_extensions[]; - #elif defined(RADEON_R300) || defined(RADEON_R600) #define DRI_CONF_FP_OPTIMIZATION_SPEED 0 @@ -218,13 +212,8 @@ DRI_CONF_BEGIN DRI_CONF_END; static const GLuint __driNConfigOptions = 17; -extern const struct dri_extension gl_20_extension[]; - #endif -extern const struct dri_extension card_extensions[]; -extern const struct dri_extension mm_extensions[]; - static int getSwapInfo( __DRIdrawablePrivate *dPriv, __DRIswapInfo * sInfo ); static int @@ -1619,27 +1608,6 @@ radeonInitScreen(__DRIscreenPrivate *psp) return NULL; } - /* Calling driInitExtensions here, with a NULL context pointer, - * does not actually enable the extensions. It just makes sure - * that all the dispatch offsets for all the extensions that - * *might* be enables are known. This is needed because the - * dispatch offsets need to be known when _mesa_context_create - * is called, but we can't enable the extensions until we have a - * context pointer. - * - * Hello chicken. Hello egg. How are you two today? - */ - driInitExtensions( NULL, card_extensions, GL_FALSE ); -#if defined(RADEON_R200) - driInitExtensions( NULL, blend_extensions, GL_FALSE ); - driInitSingleExtension( NULL, ARB_vp_extension ); - driInitSingleExtension( NULL, NV_vp_extension ); - driInitSingleExtension( NULL, ATI_fs_extension ); - driInitExtensions( NULL, point_extensions, GL_FALSE ); -#elif (defined(RADEON_R300) || defined(RADEON_R600)) - driInitSingleExtension( NULL, gl_20_extension ); -#endif - if (!radeonInitDriver(psp)) return NULL; @@ -1672,28 +1640,6 @@ __DRIconfig **radeonInitScreen2(__DRIscreenPrivate *psp) int color; __DRIconfig **configs = NULL; - /* Calling driInitExtensions here, with a NULL context pointer, - * does not actually enable the extensions. It just makes sure - * that all the dispatch offsets for all the extensions that - * *might* be enables are known. This is needed because the - * dispatch offsets need to be known when _mesa_context_create - * is called, but we can't enable the extensions until we have a - * context pointer. - * - * Hello chicken. Hello egg. How are you two today? - */ - driInitExtensions( NULL, card_extensions, GL_FALSE ); - driInitExtensions( NULL, mm_extensions, GL_FALSE ); -#if defined(RADEON_R200) - driInitExtensions( NULL, blend_extensions, GL_FALSE ); - driInitSingleExtension( NULL, ARB_vp_extension ); - driInitSingleExtension( NULL, NV_vp_extension ); - driInitSingleExtension( NULL, ATI_fs_extension ); - driInitExtensions( NULL, point_extensions, GL_FALSE ); -#elif (defined(RADEON_R300) || defined(RADEON_R600)) - driInitSingleExtension( NULL, gl_20_extension ); -#endif - if (!radeonInitDriver(psp)) { return NULL; } diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c index 931ceff0a8..0fccf50a03 100644 --- a/src/mesa/drivers/dri/savage/savage_xmesa.c +++ b/src/mesa/drivers/dri/savage/savage_xmesa.c @@ -59,7 +59,7 @@ #include "texmem.h" #define need_GL_EXT_secondary_color -#include "extension_helper.h" +#include "main/remap_helper.h" #include "xmlpool.h" @@ -980,18 +980,6 @@ savageInitScreen(__DRIscreenPrivate *psp) &psp->drm_version, & drm_expected ) ) return NULL; - /* Calling driInitExtensions here, with a NULL context pointer, - * does not actually enable the extensions. It just makes sure - * that all the dispatch offsets for all the extensions that - * *might* be enables are known. This is needed because the - * dispatch offsets need to be known when _mesa_context_create is - * called, but we can't enable the extensions until we have a - * context pointer. - * - * Hello chicken. Hello egg. How are you two today? - */ - driInitExtensions( NULL, card_extensions, GL_FALSE ); - if (!savageInitDriver(psp)) return NULL; diff --git a/src/mesa/drivers/dri/sis/sis_context.c b/src/mesa/drivers/dri/sis/sis_context.c index a070fe3d79..f501e7ad2e 100644 --- a/src/mesa/drivers/dri/sis/sis_context.c +++ b/src/mesa/drivers/dri/sis/sis_context.c @@ -59,7 +59,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #define need_GL_EXT_fog_coord #define need_GL_EXT_secondary_color -#include "extension_helper.h" +#include "main/remap_helper.h" #ifndef SIS_DEBUG int SIS_DEBUG = 0; @@ -69,7 +69,7 @@ int GlobalCurrentHwcx = -1; int GlobalHwcxCountBase = 1; int GlobalCmdQueueLen = 0; -struct dri_extension card_extensions[] = +static struct dri_extension card_extensions[] = { { "GL_ARB_multitexture", NULL }, { "GL_ARB_texture_border_clamp", NULL }, @@ -83,7 +83,7 @@ struct dri_extension card_extensions[] = { NULL, NULL } }; -struct dri_extension card_extensions_6326[] = +static struct dri_extension card_extensions_6326[] = { /*{ "GL_ARB_texture_border_clamp", NULL },*/ /*{ "GL_ARB_texture_mirrored_repeat", NULL },*/ diff --git a/src/mesa/drivers/dri/sis/sis_screen.c b/src/mesa/drivers/dri/sis/sis_screen.c index b5f04ae28d..fec9158236 100644 --- a/src/mesa/drivers/dri/sis/sis_screen.c +++ b/src/mesa/drivers/dri/sis/sis_screen.c @@ -298,18 +298,6 @@ sisInitScreen(__DRIscreenPrivate *psp) &psp->drm_version, &drm_expected)) return NULL; - /* Calling driInitExtensions here, with a NULL context pointer, - * does not actually enable the extensions. It just makes sure - * that all the dispatch offsets for all the extensions that - * *might* be enables are known. This is needed because the - * dispatch offsets need to be known when _mesa_context_create is - * called, but we can't enable the extensions until we have a - * context pointer. - * - * Hello chicken. Hello egg. How are you two today? - */ - driInitExtensions( NULL, card_extensions, GL_FALSE ); - psp->private = sisCreateScreen(psp); if (!psp->private) { diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c index f4947daa06..df5221b135 100644 --- a/src/mesa/drivers/dri/swrast/swrast.c +++ b/src/mesa/drivers/dri/swrast/swrast.c @@ -49,78 +49,6 @@ #include "swrast_priv.h" -#define need_GL_VERSION_1_3 -#define need_GL_VERSION_1_4 -#define need_GL_VERSION_1_5 -#define need_GL_VERSION_2_0 -#define need_GL_VERSION_2_1 - -/* sw extensions for imaging */ -#define need_GL_EXT_blend_color -#define need_GL_EXT_blend_minmax -#define need_GL_EXT_convolution -#define need_GL_EXT_histogram -#define need_GL_SGI_color_table - -/* sw extensions not associated with some GL version */ -#define need_GL_ARB_draw_elements_base_vertex -#define need_GL_ARB_shader_objects -#define need_GL_ARB_vertex_array_object -#define need_GL_ARB_vertex_program -#define need_GL_ARB_sync -#define need_GL_APPLE_vertex_array_object -#define need_GL_ATI_fragment_shader -#define need_GL_ATI_separate_stencil -#define need_GL_EXT_depth_bounds_test -#define need_GL_EXT_framebuffer_object -#define need_GL_EXT_framebuffer_blit -#define need_GL_EXT_gpu_program_parameters -#define need_GL_EXT_paletted_texture -#define need_GL_EXT_stencil_two_side -#define need_GL_MESA_resize_buffers -#define need_GL_NV_vertex_program -#define need_GL_NV_fragment_program - -#include "extension_helper.h" - -const struct dri_extension card_extensions[] = -{ - { "GL_VERSION_1_3", GL_VERSION_1_3_functions }, - { "GL_VERSION_1_4", GL_VERSION_1_4_functions }, - { "GL_VERSION_1_5", GL_VERSION_1_5_functions }, - { "GL_VERSION_2_0", GL_VERSION_2_0_functions }, - { "GL_VERSION_2_1", GL_VERSION_2_1_functions }, - - { "GL_EXT_blend_color", GL_EXT_blend_color_functions }, - { "GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions }, - { "GL_EXT_convolution", GL_EXT_convolution_functions }, - { "GL_EXT_histogram", GL_EXT_histogram_functions }, - { "GL_SGI_color_table", GL_SGI_color_table_functions }, - - { "GL_ARB_depth_clamp", NULL }, - { "GL_ARB_draw_elements_base_vertex", GL_ARB_draw_elements_base_vertex_functions }, - { "GL_ARB_shader_objects", GL_ARB_shader_objects_functions }, - { "GL_ARB_vertex_array_object", GL_ARB_vertex_array_object_functions }, - { "GL_ARB_vertex_program", GL_ARB_vertex_program_functions }, - { "GL_ARB_sync", GL_ARB_sync_functions }, - { "GL_APPLE_vertex_array_object", GL_APPLE_vertex_array_object_functions }, - { "GL_ATI_fragment_shader", GL_ATI_fragment_shader_functions }, - { "GL_ATI_separate_stencil", GL_ATI_separate_stencil_functions }, - { "GL_EXT_depth_bounds_test", GL_EXT_depth_bounds_test_functions }, - { "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions }, - { "GL_EXT_framebuffer_blit", GL_EXT_framebuffer_blit_functions }, - { "GL_EXT_gpu_program_parameters", GL_EXT_gpu_program_parameters_functions }, - { "GL_EXT_paletted_texture", GL_EXT_paletted_texture_functions }, - { "GL_EXT_stencil_two_side", GL_EXT_stencil_two_side_functions }, - { "GL_MESA_resize_buffers", GL_MESA_resize_buffers_functions }, - { "GL_NV_depth_clamp", NULL }, - { "GL_NV_vertex_program", GL_NV_vertex_program_functions }, - { "GL_NV_fragment_program", GL_NV_fragment_program_functions }, - { "GL_NV_fragment_program_option", NULL }, - { NULL, NULL } -}; - - /** * Screen and config-related functions */ @@ -244,7 +172,7 @@ driCreateNewScreen(int scrn, const __DRIextension **extensions, *driver_configs = (const __DRIconfig **) driConcatConfigs(configs24, configs32); - driInitExtensions( NULL, card_extensions, GL_FALSE ); + driInitExtensions( NULL, NULL, GL_FALSE ); return psp; } diff --git a/src/mesa/drivers/dri/tdfx/tdfx_context.c b/src/mesa/drivers/dri/tdfx/tdfx_context.c index 68b5027561..e742d414a5 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_context.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_context.c @@ -68,13 +68,13 @@ #define need_GL_EXT_paletted_texture /* #define need_GL_EXT_secondary_color */ /* #define need_GL_NV_vertex_program */ -#include "extension_helper.h" +#include "main/remap_helper.h" /** * Common extension strings exported by all cards */ -const struct dri_extension card_extensions[] = +static const struct dri_extension card_extensions[] = { { "GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions }, { "GL_ARB_texture_mirrored_repeat", NULL }, @@ -107,7 +107,7 @@ const struct dri_extension card_extensions[] = /** * Extension strings exported only by Naplam (e.g., Voodoo4 & Voodoo5) cards. */ -const struct dri_extension napalm_extensions[] = +static const struct dri_extension napalm_extensions[] = { { "GL_ARB_texture_env_combine", NULL }, { "GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions }, diff --git a/src/mesa/drivers/dri/tdfx/tdfx_screen.c b/src/mesa/drivers/dri/tdfx/tdfx_screen.c index 58bd48b294..d8a4b401c0 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_screen.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_screen.c @@ -69,9 +69,6 @@ static const __DRIextension *tdfxExtensions[] = { static const GLuint __driNConfigOptions = 1; -extern const struct dri_extension card_extensions[]; -extern const struct dri_extension napalm_extensions[]; - static GLboolean tdfxCreateScreen( __DRIscreenPrivate *sPriv ) { @@ -418,19 +415,6 @@ tdfxInitScreen(__DRIscreen *psp) &psp->drm_version, & drm_expected ) ) return NULL; - /* Calling driInitExtensions here, with a NULL context pointer, - * does not actually enable the extensions. It just makes sure - * that all the dispatch offsets for all the extensions that - * *might* be enables are known. This is needed because the - * dispatch offsets need to be known when _mesa_context_create is - * called, but we can't enable the extensions until we have a - * context pointer. - * - * Hello chicken. Hello egg. How are you two today? - */ - driInitExtensions( NULL, card_extensions, GL_FALSE ); - driInitExtensions( NULL, napalm_extensions, GL_FALSE ); - if (!tdfxInitDriver(psp)) return NULL; diff --git a/src/mesa/drivers/dri/unichrome/via_context.c b/src/mesa/drivers/dri/unichrome/via_context.c index 6eb19ac079..5be1cf32c2 100644 --- a/src/mesa/drivers/dri/unichrome/via_context.c +++ b/src/mesa/drivers/dri/unichrome/via_context.c @@ -65,7 +65,7 @@ #define need_GL_ARB_point_parameters #define need_GL_EXT_fog_coord #define need_GL_EXT_secondary_color -#include "extension_helper.h" +#include "main/remap_helper.h" #define DRIVER_DATE "20060710" @@ -362,7 +362,7 @@ void viaReAllocateBuffers(GLcontext *ctx, GLframebuffer *drawbuffer, /* Extension strings exported by the Unichrome driver. */ -const struct dri_extension card_extensions[] = +static const struct dri_extension card_extensions[] = { { "GL_ARB_multitexture", NULL }, { "GL_ARB_point_parameters", GL_ARB_point_parameters_functions }, diff --git a/src/mesa/drivers/dri/unichrome/via_screen.c b/src/mesa/drivers/dri/unichrome/via_screen.c index 3dbb570571..7cfc60a015 100644 --- a/src/mesa/drivers/dri/unichrome/via_screen.c +++ b/src/mesa/drivers/dri/unichrome/via_screen.c @@ -62,8 +62,6 @@ DRI_CONF_BEGIN DRI_CONF_END; static const GLuint __driNConfigOptions = 3; -extern const struct dri_extension card_extensions[]; - static drmBufMapPtr via_create_empty_buffers(void) { drmBufMapPtr retval; @@ -393,18 +391,6 @@ viaInitScreen(__DRIscreenPrivate *psp) &psp->drm_version, & drm_expected) ) return NULL; - /* Calling driInitExtensions here, with a NULL context pointer, - * does not actually enable the extensions. It just makes sure - * that all the dispatch offsets for all the extensions that - * *might* be enables are known. This is needed because the - * dispatch offsets need to be known when _mesa_context_create is - * called, but we can't enable the extensions until we have a - * context pointer. - * - * Hello chicken. Hello egg. How are you two today? - */ - driInitExtensions( NULL, card_extensions, GL_FALSE ); - if (!viaInitDriver(psp)) return NULL; diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index 79b058634c..bf767bcedd 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -1303,71 +1303,6 @@ xmesa_convert_from_x_visual_type( int visualType ) /**********************************************************************/ -#ifdef IN_DRI_DRIVER -#define need_GL_VERSION_1_3 -#define need_GL_VERSION_1_4 -#define need_GL_VERSION_1_5 -#define need_GL_VERSION_2_0 - -/* sw extensions for imaging */ -#define need_GL_EXT_blend_color -#define need_GL_EXT_blend_minmax -#define need_GL_EXT_convolution -#define need_GL_EXT_histogram -#define need_GL_SGI_color_table - -/* sw extensions not associated with some GL version */ -#define need_GL_ARB_draw_elements_base_vertex -#define need_GL_ARB_shader_objects -#define need_GL_ARB_sync -#define need_GL_ARB_vertex_program -#define need_GL_APPLE_vertex_array_object -#define need_GL_ATI_fragment_shader -#define need_GL_EXT_depth_bounds_test -#define need_GL_EXT_framebuffer_object -#define need_GL_EXT_framebuffer_blit -#define need_GL_EXT_gpu_program_parameters -#define need_GL_EXT_paletted_texture -#define need_GL_MESA_resize_buffers -#define need_GL_NV_vertex_program -#define need_GL_NV_fragment_program - -#include "extension_helper.h" -#include "utils.h" - -const struct dri_extension card_extensions[] = -{ - { "GL_VERSION_1_3", GL_VERSION_1_3_functions }, - { "GL_VERSION_1_4", GL_VERSION_1_4_functions }, - { "GL_VERSION_1_5", GL_VERSION_1_5_functions }, - { "GL_VERSION_2_0", GL_VERSION_2_0_functions }, - - { "GL_EXT_blend_color", GL_EXT_blend_color_functions }, - { "GL_EXT_blend_minmax", GL_EXT_blend_minmax_functions }, - { "GL_EXT_convolution", GL_EXT_convolution_functions }, - { "GL_EXT_histogram", GL_EXT_histogram_functions }, - { "GL_SGI_color_table", GL_SGI_color_table_functions }, - - { "GL_ARB_depth_clamp", NULL }, - { "GL_ARB_draw_elements_base_vertex", GL_ARB_draw_elements_base_vertex_functions }, - { "GL_ARB_shader_objects", GL_ARB_shader_objects_functions }, - { "GL_ARB_sync", GL_ARB_sync_functions }, - { "GL_ARB_vertex_program", GL_ARB_vertex_program_functions }, - { "GL_APPLE_vertex_array_object", GL_APPLE_vertex_array_object_functions }, - { "GL_ATI_fragment_shader", GL_ATI_fragment_shader_functions }, - { "GL_EXT_depth_bounds_test", GL_EXT_depth_bounds_test_functions }, - { "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions }, - { "GL_EXT_framebuffer_blit", GL_EXT_framebuffer_blit_functions }, - { "GL_EXT_gpu_program_parameters", GL_EXT_gpu_program_parameters_functions }, - { "GL_EXT_paletted_texture", GL_EXT_paletted_texture_functions }, - { "GL_MESA_resize_buffers", GL_MESA_resize_buffers_functions }, - { "GL_NV_depth_clamp", NULL }, - { "GL_NV_vertex_program", GL_NV_vertex_program_functions }, - { "GL_NV_fragment_program", GL_NV_fragment_program_functions }, - { NULL, NULL } -}; -#endif - /* * Create a new X/Mesa visual. * Input: display - X11 display @@ -1413,14 +1348,6 @@ XMesaVisual XMesaCreateVisual( XMesaDisplay *display, XMesaVisual v; GLint red_bits, green_bits, blue_bits, alpha_bits; -#ifdef IN_DRI_DRIVER - /* driInitExtensions() should be called once per screen to setup extension - * indices. There is no need to call it when the context is created since - * XMesa enables mesa sw extensions on its own. - */ - driInitExtensions( NULL, card_extensions, GL_FALSE ); -#endif - #ifndef XFree86Server /* For debugging only */ if (_mesa_getenv("MESA_XSYNC")) { diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 490b8f0f33..ea820d77b3 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -117,6 +117,7 @@ #include "syncobj.h" #endif #include "rastpos.h" +#include "remap.h" #include "scissor.h" #include "shared.h" #include "simple_list.h" @@ -407,6 +408,8 @@ one_time_init( GLcontext *ctx ) _mesa_get_cpu_features(); + _mesa_init_remap_table(); + _mesa_init_sqrt_table(); for (i = 0; i < 256; i++) { diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak index 7107538cee..0838014e93 100644 --- a/src/mesa/sources.mak +++ b/src/mesa/sources.mak @@ -55,6 +55,7 @@ MAIN_SOURCES = \ main/rastpos.c \ main/rbadaptors.c \ main/readpix.c \ + main/remap.c \ main/renderbuffer.c \ main/scissor.c \ main/shaders.c \ -- cgit v1.2.3 From 3d16088ff0b369c877e2aae87ddc7322d70ecc7d Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Thu, 8 Oct 2009 11:52:11 +0800 Subject: mesa/dri: Remove extension_helper.h. Signed-off-by: Chia-I Wu --- src/mesa/drivers/dri/common/extension_helper.h | 6647 ------------------------ src/mesa/glapi/Makefile | 5 - 2 files changed, 6652 deletions(-) delete mode 100644 src/mesa/drivers/dri/common/extension_helper.h (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/common/extension_helper.h b/src/mesa/drivers/dri/common/extension_helper.h deleted file mode 100644 index 5e86324eec..0000000000 --- a/src/mesa/drivers/dri/common/extension_helper.h +++ /dev/null @@ -1,6647 +0,0 @@ -/* DO NOT EDIT - This file generated automatically by extension_helper.py (from Mesa) script */ - -/* - * (C) Copyright IBM Corporation 2005 - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sub license, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * IBM, - * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, - * WHETHER IN 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. - */ - -#include "utils.h" -#include "glapi/dispatch.h" - -#ifndef NULL -# define NULL 0 -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char UniformMatrix3fvARB_names[] = - "iiip\0" /* Parameter signature */ - "glUniformMatrix3fv\0" - "glUniformMatrix3fvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_multisample) -static const char SampleCoverageARB_names[] = - "fi\0" /* Parameter signature */ - "glSampleCoverage\0" - "glSampleCoverageARB\0" - ""; -#endif - -#if defined(need_GL_EXT_convolution) -static const char ConvolutionFilter1D_names[] = - "iiiiip\0" /* Parameter signature */ - "glConvolutionFilter1D\0" - "glConvolutionFilter1DEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_occlusion_query) -static const char BeginQueryARB_names[] = - "ii\0" /* Parameter signature */ - "glBeginQuery\0" - "glBeginQueryARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_NV_point_sprite) -static const char PointParameteriNV_names[] = - "ii\0" /* Parameter signature */ - "glPointParameteri\0" - "glPointParameteriNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) -static const char GetProgramiv_names[] = - "iip\0" /* Parameter signature */ - "glGetProgramiv\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord3sARB_names[] = - "iiii\0" /* Parameter signature */ - "glMultiTexCoord3s\0" - "glMultiTexCoord3sARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3iEXT_names[] = - "iii\0" /* Parameter signature */ - "glSecondaryColor3i\0" - "glSecondaryColor3iEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos3fMESA_names[] = - "fff\0" /* Parameter signature */ - "glWindowPos3f\0" - "glWindowPos3fARB\0" - "glWindowPos3fMESA\0" - ""; -#endif - -#if defined(need_GL_SGIS_pixel_texture) -static const char PixelTexGenParameterfvSGIS_names[] = - "ip\0" /* Parameter signature */ - "glPixelTexGenParameterfvSGIS\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char ActiveTextureARB_names[] = - "i\0" /* Parameter signature */ - "glActiveTexture\0" - "glActiveTextureARB\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_blit) -static const char BlitFramebufferEXT_names[] = - "iiiiiiiiii\0" /* Parameter signature */ - "glBlitFramebuffer\0" - "glBlitFramebufferEXT\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib4ubvNV_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4ubvNV\0" - ""; -#endif - -#if defined(need_GL_NV_fragment_program) -static const char GetProgramNamedParameterdvNV_names[] = - "iipp\0" /* Parameter signature */ - "glGetProgramNamedParameterdvNV\0" - ""; -#endif - -#if defined(need_GL_EXT_histogram) -static const char Histogram_names[] = - "iiii\0" /* Parameter signature */ - "glHistogram\0" - "glHistogramEXT\0" - ""; -#endif - -#if defined(need_GL_SGIS_texture4D) -static const char TexImage4DSGIS_names[] = - "iiiiiiiiiip\0" /* Parameter signature */ - "glTexImage4DSGIS\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos2dvMESA_names[] = - "p\0" /* Parameter signature */ - "glWindowPos2dv\0" - "glWindowPos2dvARB\0" - "glWindowPos2dvMESA\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiColor3fVertex3fvSUN_names[] = - "ppp\0" /* Parameter signature */ - "glReplacementCodeuiColor3fVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_EXT_blend_equation_separate) || defined(need_GL_ATI_blend_equation_separate) -static const char BlendEquationSeparateEXT_names[] = - "ii\0" /* Parameter signature */ - "glBlendEquationSeparate\0" - "glBlendEquationSeparateEXT\0" - "glBlendEquationSeparateATI\0" - ""; -#endif - -#if defined(need_GL_SGIX_list_priority) -static const char ListParameterfSGIX_names[] = - "iif\0" /* Parameter signature */ - "glListParameterfSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3bEXT_names[] = - "iii\0" /* Parameter signature */ - "glSecondaryColor3b\0" - "glSecondaryColor3bEXT\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char TexCoord4fColor4fNormal3fVertex4fvSUN_names[] = - "pppp\0" /* Parameter signature */ - "glTexCoord4fColor4fNormal3fVertex4fvSUN\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib4svNV_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4svNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) -static const char GetBufferSubDataARB_names[] = - "iiip\0" /* Parameter signature */ - "glGetBufferSubData\0" - "glGetBufferSubDataARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) -static const char BufferSubDataARB_names[] = - "iiip\0" /* Parameter signature */ - "glBufferSubData\0" - "glBufferSubDataARB\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char TexCoord2fColor4ubVertex3fvSUN_names[] = - "ppp\0" /* Parameter signature */ - "glTexCoord2fColor4ubVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) -static const char AttachShader_names[] = - "ii\0" /* Parameter signature */ - "glAttachShader\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib2fARB_names[] = - "iff\0" /* Parameter signature */ - "glVertexAttrib2f\0" - "glVertexAttrib2fARB\0" - ""; -#endif - -#if defined(need_GL_MESA_shader_debug) -static const char GetDebugLogLengthMESA_names[] = - "iii\0" /* Parameter signature */ - "glGetDebugLogLengthMESA\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib3fARB_names[] = - "ifff\0" /* Parameter signature */ - "glVertexAttrib3f\0" - "glVertexAttrib3fARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_occlusion_query) -static const char GetQueryivARB_names[] = - "iip\0" /* Parameter signature */ - "glGetQueryiv\0" - "glGetQueryivARB\0" - ""; -#endif - -#if defined(need_GL_EXT_texture3D) -static const char TexImage3D_names[] = - "iiiiiiiiip\0" /* Parameter signature */ - "glTexImage3D\0" - "glTexImage3DEXT\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiVertex3fvSUN_names[] = - "pp\0" /* Parameter signature */ - "glReplacementCodeuiVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_occlusion_query) -static const char GetQueryObjectivARB_names[] = - "iip\0" /* Parameter signature */ - "glGetQueryObjectiv\0" - "glGetQueryObjectivARB\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiTexCoord2fVertex3fvSUN_names[] = - "ppp\0" /* Parameter signature */ - "glReplacementCodeuiTexCoord2fVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_texture_compression) -static const char CompressedTexSubImage2DARB_names[] = - "iiiiiiiip\0" /* Parameter signature */ - "glCompressedTexSubImage2D\0" - "glCompressedTexSubImage2DARB\0" - ""; -#endif - -#if defined(need_GL_NV_register_combiners) -static const char CombinerOutputNV_names[] = - "iiiiiiiiii\0" /* Parameter signature */ - "glCombinerOutputNV\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttribs3fvNV_names[] = - "iip\0" /* Parameter signature */ - "glVertexAttribs3fvNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform2fARB_names[] = - "iff\0" /* Parameter signature */ - "glUniform2f\0" - "glUniform2fARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib1svARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib1sv\0" - "glVertexAttrib1svARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttribs1dvNV_names[] = - "iip\0" /* Parameter signature */ - "glVertexAttribs1dvNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform2ivARB_names[] = - "iip\0" /* Parameter signature */ - "glUniform2iv\0" - "glUniform2ivARB\0" - ""; -#endif - -#if defined(need_GL_HP_image_transform) -static const char GetImageTransformParameterfvHP_names[] = - "iip\0" /* Parameter signature */ - "glGetImageTransformParameterfvHP\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_blend) -static const char WeightubvARB_names[] = - "ip\0" /* Parameter signature */ - "glWeightubvARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib1fvNV_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib1fvNV\0" - ""; -#endif - -#if defined(need_GL_EXT_convolution) -static const char CopyConvolutionFilter1D_names[] = - "iiiii\0" /* Parameter signature */ - "glCopyConvolutionFilter1D\0" - "glCopyConvolutionFilter1DEXT\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiNormal3fVertex3fSUN_names[] = - "iffffff\0" /* Parameter signature */ - "glReplacementCodeuiNormal3fVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_ARB_sync) -static const char DeleteSync_names[] = - "i\0" /* Parameter signature */ - "glDeleteSync\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char FragmentMaterialfvSGIX_names[] = - "iip\0" /* Parameter signature */ - "glFragmentMaterialfvSGIX\0" - ""; -#endif - -#if defined(need_GL_EXT_blend_color) -static const char BlendColor_names[] = - "ffff\0" /* Parameter signature */ - "glBlendColor\0" - "glBlendColorEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char UniformMatrix4fvARB_names[] = - "iiip\0" /* Parameter signature */ - "glUniformMatrix4fv\0" - "glUniformMatrix4fvARB\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_array_object) || defined(need_GL_APPLE_vertex_array_object) -static const char DeleteVertexArraysAPPLE_names[] = - "ip\0" /* Parameter signature */ - "glDeleteVertexArrays\0" - "glDeleteVertexArraysAPPLE\0" - ""; -#endif - -#if defined(need_GL_SGIX_instruments) -static const char ReadInstrumentsSGIX_names[] = - "i\0" /* Parameter signature */ - "glReadInstrumentsSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_1) -static const char UniformMatrix2x4fv_names[] = - "iiip\0" /* Parameter signature */ - "glUniformMatrix2x4fv\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char Color4ubVertex3fvSUN_names[] = - "pp\0" /* Parameter signature */ - "glColor4ubVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_texture_array) -static const char FramebufferTextureLayerEXT_names[] = - "iiiii\0" /* Parameter signature */ - "glFramebufferTextureLayer\0" - "glFramebufferTextureLayerEXT\0" - ""; -#endif - -#if defined(need_GL_SGIX_list_priority) -static const char GetListParameterfvSGIX_names[] = - "iip\0" /* Parameter signature */ - "glGetListParameterfvSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4NusvARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4Nusv\0" - "glVertexAttrib4NusvARB\0" - ""; -#endif - -#if defined(need_GL_MESA_window_pos) -static const char WindowPos4svMESA_names[] = - "p\0" /* Parameter signature */ - "glWindowPos4svMESA\0" - ""; -#endif - -#if defined(need_GL_ARB_shader_objects) -static const char CreateProgramObjectARB_names[] = - "\0" /* Parameter signature */ - "glCreateProgramObjectARB\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char FragmentLightModelivSGIX_names[] = - "ip\0" /* Parameter signature */ - "glFragmentLightModelivSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_1) -static const char UniformMatrix4x3fv_names[] = - "iiip\0" /* Parameter signature */ - "glUniformMatrix4x3fv\0" - ""; -#endif - -#if defined(need_GL_EXT_texture_object) -static const char PrioritizeTextures_names[] = - "ipp\0" /* Parameter signature */ - "glPrioritizeTextures\0" - "glPrioritizeTexturesEXT\0" - ""; -#endif - -#if defined(need_GL_SGIX_async) -static const char AsyncMarkerSGIX_names[] = - "i\0" /* Parameter signature */ - "glAsyncMarkerSGIX\0" - ""; -#endif - -#if defined(need_GL_SUN_global_alpha) -static const char GlobalAlphaFactorubSUN_names[] = - "i\0" /* Parameter signature */ - "glGlobalAlphaFactorubSUN\0" - ""; -#endif - -#if defined(need_GL_MESA_shader_debug) -static const char ClearDebugLogMESA_names[] = - "iii\0" /* Parameter signature */ - "glClearDebugLogMESA\0" - ""; -#endif - -#if defined(need_GL_EXT_histogram) -static const char ResetHistogram_names[] = - "i\0" /* Parameter signature */ - "glResetHistogram\0" - "glResetHistogramEXT\0" - ""; -#endif - -#if defined(need_GL_NV_fragment_program) -static const char GetProgramNamedParameterfvNV_names[] = - "iipp\0" /* Parameter signature */ - "glGetProgramNamedParameterfvNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_point_parameters) || defined(need_GL_EXT_point_parameters) || defined(need_GL_SGIS_point_parameters) -static const char PointParameterfEXT_names[] = - "if\0" /* Parameter signature */ - "glPointParameterf\0" - "glPointParameterfARB\0" - "glPointParameterfEXT\0" - "glPointParameterfSGIS\0" - ""; -#endif - -#if defined(need_GL_SGIX_polynomial_ffd) -static const char LoadIdentityDeformationMapSGIX_names[] = - "i\0" /* Parameter signature */ - "glLoadIdentityDeformationMapSGIX\0" - ""; -#endif - -#if defined(need_GL_NV_fence) -static const char GenFencesNV_names[] = - "ip\0" /* Parameter signature */ - "glGenFencesNV\0" - ""; -#endif - -#if defined(need_GL_HP_image_transform) -static const char ImageTransformParameterfHP_names[] = - "iif\0" /* Parameter signature */ - "glImageTransformParameterfHP\0" - ""; -#endif - -#if defined(need_GL_ARB_matrix_palette) -static const char MatrixIndexusvARB_names[] = - "ip\0" /* Parameter signature */ - "glMatrixIndexusvARB\0" - ""; -#endif - -#if defined(need_GL_ARB_draw_elements_base_vertex) -static const char DrawElementsBaseVertex_names[] = - "iiipi\0" /* Parameter signature */ - "glDrawElementsBaseVertex\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char DisableVertexAttribArrayARB_names[] = - "i\0" /* Parameter signature */ - "glDisableVertexAttribArray\0" - "glDisableVertexAttribArrayARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) -static const char StencilMaskSeparate_names[] = - "ii\0" /* Parameter signature */ - "glStencilMaskSeparate\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) -static const char ProgramLocalParameter4dARB_names[] = - "iidddd\0" /* Parameter signature */ - "glProgramLocalParameter4dARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_texture_compression) -static const char CompressedTexImage3DARB_names[] = - "iiiiiiiip\0" /* Parameter signature */ - "glCompressedTexImage3D\0" - "glCompressedTexImage3DARB\0" - ""; -#endif - -#if defined(need_GL_EXT_convolution) -static const char GetConvolutionParameteriv_names[] = - "iip\0" /* Parameter signature */ - "glGetConvolutionParameteriv\0" - "glGetConvolutionParameterivEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib1fARB_names[] = - "if\0" /* Parameter signature */ - "glVertexAttrib1f\0" - "glVertexAttrib1fARB\0" - ""; -#endif - -#if defined(need_GL_NV_fence) -static const char TestFenceNV_names[] = - "i\0" /* Parameter signature */ - "glTestFenceNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord1fvARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord1fv\0" - "glMultiTexCoord1fvARB\0" - ""; -#endif - -#if defined(need_GL_ATI_fragment_shader) -static const char ColorFragmentOp2ATI_names[] = - "iiiiiiiiii\0" /* Parameter signature */ - "glColorFragmentOp2ATI\0" - ""; -#endif - -#if defined(need_GL_IBM_vertex_array_lists) -static const char SecondaryColorPointerListIBM_names[] = - "iiipi\0" /* Parameter signature */ - "glSecondaryColorPointerListIBM\0" - ""; -#endif - -#if defined(need_GL_SGIS_pixel_texture) -static const char GetPixelTexGenParameterivSGIS_names[] = - "ip\0" /* Parameter signature */ - "glGetPixelTexGenParameterivSGIS\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib4fNV_names[] = - "iffff\0" /* Parameter signature */ - "glVertexAttrib4fNV\0" - ""; -#endif - -#if defined(need_GL_SUN_triangle_list) -static const char ReplacementCodeubSUN_names[] = - "i\0" /* Parameter signature */ - "glReplacementCodeubSUN\0" - ""; -#endif - -#if defined(need_GL_SGIX_async) -static const char FinishAsyncSGIX_names[] = - "p\0" /* Parameter signature */ - "glFinishAsyncSGIX\0" - ""; -#endif - -#if defined(need_GL_MESA_shader_debug) -static const char GetDebugLogMESA_names[] = - "iiiipp\0" /* Parameter signature */ - "glGetDebugLogMESA\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_fog_coord) -static const char FogCoorddEXT_names[] = - "d\0" /* Parameter signature */ - "glFogCoordd\0" - "glFogCoorddEXT\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char Color4ubVertex3fSUN_names[] = - "iiiifff\0" /* Parameter signature */ - "glColor4ubVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_fog_coord) -static const char FogCoordfEXT_names[] = - "f\0" /* Parameter signature */ - "glFogCoordf\0" - "glFogCoordfEXT\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char TexCoord2fVertex3fSUN_names[] = - "fffff\0" /* Parameter signature */ - "glTexCoord2fVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_SUN_global_alpha) -static const char GlobalAlphaFactoriSUN_names[] = - "i\0" /* Parameter signature */ - "glGlobalAlphaFactoriSUN\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib2dNV_names[] = - "idd\0" /* Parameter signature */ - "glVertexAttrib2dNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) -static const char GetProgramInfoLog_names[] = - "iipp\0" /* Parameter signature */ - "glGetProgramInfoLog\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4NbvARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4Nbv\0" - "glVertexAttrib4NbvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_shader) -static const char GetActiveAttribARB_names[] = - "iiipppp\0" /* Parameter signature */ - "glGetActiveAttrib\0" - "glGetActiveAttribARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib4ubNV_names[] = - "iiiii\0" /* Parameter signature */ - "glVertexAttrib4ubNV\0" - ""; -#endif - -#if defined(need_GL_APPLE_texture_range) -static const char TextureRangeAPPLE_names[] = - "iip\0" /* Parameter signature */ - "glTextureRangeAPPLE\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char TexCoord2fColor4fNormal3fVertex3fSUN_names[] = - "ffffffffffff\0" /* Parameter signature */ - "glTexCoord2fColor4fNormal3fVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_NV_register_combiners) -static const char CombinerParameterfvNV_names[] = - "ip\0" /* Parameter signature */ - "glCombinerParameterfvNV\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttribs3dvNV_names[] = - "iip\0" /* Parameter signature */ - "glVertexAttribs3dvNV\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttribs4fvNV_names[] = - "iip\0" /* Parameter signature */ - "glVertexAttribs4fvNV\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_array_range) -static const char VertexArrayRangeNV_names[] = - "ip\0" /* Parameter signature */ - "glVertexArrayRangeNV\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char FragmentLightiSGIX_names[] = - "iii\0" /* Parameter signature */ - "glFragmentLightiSGIX\0" - ""; -#endif - -#if defined(need_GL_EXT_polygon_offset) -static const char PolygonOffsetEXT_names[] = - "ff\0" /* Parameter signature */ - "glPolygonOffsetEXT\0" - ""; -#endif - -#if defined(need_GL_SGIX_async) -static const char PollAsyncSGIX_names[] = - "p\0" /* Parameter signature */ - "glPollAsyncSGIX\0" - ""; -#endif - -#if defined(need_GL_ATI_fragment_shader) -static const char DeleteFragmentShaderATI_names[] = - "i\0" /* Parameter signature */ - "glDeleteFragmentShaderATI\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char TexCoord2fNormal3fVertex3fvSUN_names[] = - "ppp\0" /* Parameter signature */ - "glTexCoord2fNormal3fVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_transpose_matrix) -static const char MultTransposeMatrixdARB_names[] = - "p\0" /* Parameter signature */ - "glMultTransposeMatrixd\0" - "glMultTransposeMatrixdARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos2svMESA_names[] = - "p\0" /* Parameter signature */ - "glWindowPos2sv\0" - "glWindowPos2svARB\0" - "glWindowPos2svMESA\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_texture_compression) -static const char CompressedTexImage1DARB_names[] = - "iiiiiip\0" /* Parameter signature */ - "glCompressedTexImage1D\0" - "glCompressedTexImage1DARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib2sNV_names[] = - "iii\0" /* Parameter signature */ - "glVertexAttrib2sNV\0" - ""; -#endif - -#if defined(need_GL_IBM_vertex_array_lists) -static const char NormalPointerListIBM_names[] = - "iipi\0" /* Parameter signature */ - "glNormalPointerListIBM\0" - ""; -#endif - -#if defined(need_GL_EXT_vertex_array) -static const char IndexPointerEXT_names[] = - "iiip\0" /* Parameter signature */ - "glIndexPointerEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_vertex_array) -static const char NormalPointerEXT_names[] = - "iiip\0" /* Parameter signature */ - "glNormalPointerEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord3dARB_names[] = - "iddd\0" /* Parameter signature */ - "glMultiTexCoord3d\0" - "glMultiTexCoord3dARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord2iARB_names[] = - "iii\0" /* Parameter signature */ - "glMultiTexCoord2i\0" - "glMultiTexCoord2iARB\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN_names[] = - "iffffffff\0" /* Parameter signature */ - "glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord2svARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord2sv\0" - "glMultiTexCoord2svARB\0" - ""; -#endif - -#if defined(need_GL_SUN_triangle_list) -static const char ReplacementCodeubvSUN_names[] = - "p\0" /* Parameter signature */ - "glReplacementCodeubvSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform3iARB_names[] = - "iiii\0" /* Parameter signature */ - "glUniform3i\0" - "glUniform3iARB\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char GetFragmentMaterialfvSGIX_names[] = - "iip\0" /* Parameter signature */ - "glGetFragmentMaterialfvSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) -static const char GetShaderInfoLog_names[] = - "iipp\0" /* Parameter signature */ - "glGetShaderInfoLog\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_blend) -static const char WeightivARB_names[] = - "ip\0" /* Parameter signature */ - "glWeightivARB\0" - ""; -#endif - -#if defined(need_GL_SGIX_instruments) -static const char PollInstrumentsSGIX_names[] = - "p\0" /* Parameter signature */ - "glPollInstrumentsSGIX\0" - ""; -#endif - -#if defined(need_GL_SUN_global_alpha) -static const char GlobalAlphaFactordSUN_names[] = - "d\0" /* Parameter signature */ - "glGlobalAlphaFactordSUN\0" - ""; -#endif - -#if defined(need_GL_NV_register_combiners) -static const char GetFinalCombinerInputParameterfvNV_names[] = - "iip\0" /* Parameter signature */ - "glGetFinalCombinerInputParameterfvNV\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char GenerateMipmapEXT_names[] = - "i\0" /* Parameter signature */ - "glGenerateMipmap\0" - "glGenerateMipmapEXT\0" - ""; -#endif - -#if defined(need_GL_ATI_fragment_shader) -static const char SetFragmentShaderConstantATI_names[] = - "ip\0" /* Parameter signature */ - "glSetFragmentShaderConstantATI\0" - ""; -#endif - -#if defined(need_GL_NV_evaluators) -static const char GetMapAttribParameterivNV_names[] = - "iiip\0" /* Parameter signature */ - "glGetMapAttribParameterivNV\0" - ""; -#endif - -#if defined(need_GL_ARB_shader_objects) -static const char CreateShaderObjectARB_names[] = - "i\0" /* Parameter signature */ - "glCreateShaderObjectARB\0" - ""; -#endif - -#if defined(need_GL_SGIS_sharpen_texture) -static const char GetSharpenTexFuncSGIS_names[] = - "ip\0" /* Parameter signature */ - "glGetSharpenTexFuncSGIS\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) -static const char BufferDataARB_names[] = - "iipi\0" /* Parameter signature */ - "glBufferData\0" - "glBufferDataARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_array_range) -static const char FlushVertexArrayRangeNV_names[] = - "\0" /* Parameter signature */ - "glFlushVertexArrayRangeNV\0" - ""; -#endif - -#if defined(need_GL_ATI_fragment_shader) -static const char SampleMapATI_names[] = - "iii\0" /* Parameter signature */ - "glSampleMapATI\0" - ""; -#endif - -#if defined(need_GL_EXT_vertex_array) -static const char VertexPointerEXT_names[] = - "iiiip\0" /* Parameter signature */ - "glVertexPointerEXT\0" - ""; -#endif - -#if defined(need_GL_SGIS_texture_filter4) -static const char GetTexFilterFuncSGIS_names[] = - "iip\0" /* Parameter signature */ - "glGetTexFilterFuncSGIS\0" - ""; -#endif - -#if defined(need_GL_NV_register_combiners) -static const char GetCombinerOutputParameterfvNV_names[] = - "iiip\0" /* Parameter signature */ - "glGetCombinerOutputParameterfvNV\0" - ""; -#endif - -#if defined(need_GL_EXT_subtexture) -static const char TexSubImage1D_names[] = - "iiiiiip\0" /* Parameter signature */ - "glTexSubImage1D\0" - "glTexSubImage1DEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib1sARB_names[] = - "ii\0" /* Parameter signature */ - "glVertexAttrib1s\0" - "glVertexAttrib1sARB\0" - ""; -#endif - -#if defined(need_GL_ARB_sync) -static const char FenceSync_names[] = - "ii\0" /* Parameter signature */ - "glFenceSync\0" - ""; -#endif - -#if defined(need_GL_NV_register_combiners) -static const char FinalCombinerInputNV_names[] = - "iiii\0" /* Parameter signature */ - "glFinalCombinerInputNV\0" - ""; -#endif - -#if defined(need_GL_SGIX_flush_raster) -static const char FlushRasterSGIX_names[] = - "\0" /* Parameter signature */ - "glFlushRasterSGIX\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiTexCoord2fVertex3fSUN_names[] = - "ifffff\0" /* Parameter signature */ - "glReplacementCodeuiTexCoord2fVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform1fARB_names[] = - "if\0" /* Parameter signature */ - "glUniform1f\0" - "glUniform1fARB\0" - ""; -#endif - -#if defined(need_GL_EXT_texture_object) -static const char AreTexturesResident_names[] = - "ipp\0" /* Parameter signature */ - "glAreTexturesResident\0" - "glAreTexturesResidentEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ATI_separate_stencil) -static const char StencilOpSeparate_names[] = - "iiii\0" /* Parameter signature */ - "glStencilOpSeparate\0" - "glStencilOpSeparateATI\0" - ""; -#endif - -#if defined(need_GL_SGI_color_table) -static const char ColorTableParameteriv_names[] = - "iip\0" /* Parameter signature */ - "glColorTableParameteriv\0" - "glColorTableParameterivSGI\0" - ""; -#endif - -#if defined(need_GL_IBM_vertex_array_lists) -static const char FogCoordPointerListIBM_names[] = - "iipi\0" /* Parameter signature */ - "glFogCoordPointerListIBM\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos3dMESA_names[] = - "ddd\0" /* Parameter signature */ - "glWindowPos3d\0" - "glWindowPos3dARB\0" - "glWindowPos3dMESA\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_point_parameters) || defined(need_GL_EXT_point_parameters) || defined(need_GL_SGIS_point_parameters) -static const char PointParameterfvEXT_names[] = - "ip\0" /* Parameter signature */ - "glPointParameterfv\0" - "glPointParameterfvARB\0" - "glPointParameterfvEXT\0" - "glPointParameterfvSGIS\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos2fvMESA_names[] = - "p\0" /* Parameter signature */ - "glWindowPos2fv\0" - "glWindowPos2fvARB\0" - "glWindowPos2fvMESA\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3bvEXT_names[] = - "p\0" /* Parameter signature */ - "glSecondaryColor3bv\0" - "glSecondaryColor3bvEXT\0" - ""; -#endif - -#if defined(need_GL_IBM_vertex_array_lists) -static const char VertexPointerListIBM_names[] = - "iiipi\0" /* Parameter signature */ - "glVertexPointerListIBM\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) -static const char GetProgramLocalParameterfvARB_names[] = - "iip\0" /* Parameter signature */ - "glGetProgramLocalParameterfvARB\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char FragmentMaterialfSGIX_names[] = - "iif\0" /* Parameter signature */ - "glFragmentMaterialfSGIX\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char TexCoord2fNormal3fVertex3fSUN_names[] = - "ffffffff\0" /* Parameter signature */ - "glTexCoord2fNormal3fVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char RenderbufferStorageEXT_names[] = - "iiii\0" /* Parameter signature */ - "glRenderbufferStorage\0" - "glRenderbufferStorageEXT\0" - ""; -#endif - -#if defined(need_GL_NV_fence) -static const char IsFenceNV_names[] = - "i\0" /* Parameter signature */ - "glIsFenceNV\0" - ""; -#endif - -#if defined(need_GL_ARB_shader_objects) -static const char AttachObjectARB_names[] = - "ii\0" /* Parameter signature */ - "glAttachObjectARB\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char GetFragmentLightivSGIX_names[] = - "iip\0" /* Parameter signature */ - "glGetFragmentLightivSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char UniformMatrix2fvARB_names[] = - "iiip\0" /* Parameter signature */ - "glUniformMatrix2fv\0" - "glUniformMatrix2fvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord2fARB_names[] = - "iff\0" /* Parameter signature */ - "glMultiTexCoord2f\0" - "glMultiTexCoord2fARB\0" - ""; -#endif - -#if defined(need_GL_SGI_color_table) || defined(need_GL_EXT_paletted_texture) -static const char ColorTable_names[] = - "iiiiip\0" /* Parameter signature */ - "glColorTable\0" - "glColorTableSGI\0" - "glColorTableEXT\0" - ""; -#endif - -#if defined(need_GL_NV_evaluators) -static const char MapControlPointsNV_names[] = - "iiiiiiiip\0" /* Parameter signature */ - "glMapControlPointsNV\0" - ""; -#endif - -#if defined(need_GL_EXT_convolution) -static const char ConvolutionFilter2D_names[] = - "iiiiiip\0" /* Parameter signature */ - "glConvolutionFilter2D\0" - "glConvolutionFilter2DEXT\0" - ""; -#endif - -#if defined(need_GL_NV_evaluators) -static const char MapParameterfvNV_names[] = - "iip\0" /* Parameter signature */ - "glMapParameterfvNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib3dvARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib3dv\0" - "glVertexAttrib3dvARB\0" - ""; -#endif - -#if defined(need_GL_PGI_misc_hints) -static const char HintPGI_names[] = - "ii\0" /* Parameter signature */ - "glHintPGI\0" - ""; -#endif - -#if defined(need_GL_EXT_convolution) -static const char ConvolutionParameteriv_names[] = - "iip\0" /* Parameter signature */ - "glConvolutionParameteriv\0" - "glConvolutionParameterivEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_cull_vertex) -static const char CullParameterdvEXT_names[] = - "ip\0" /* Parameter signature */ - "glCullParameterdvEXT\0" - ""; -#endif - -#if defined(need_GL_NV_fragment_program) -static const char ProgramNamedParameter4fNV_names[] = - "iipffff\0" /* Parameter signature */ - "glProgramNamedParameter4fNV\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char Color3fVertex3fSUN_names[] = - "ffffff\0" /* Parameter signature */ - "glColor3fVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) || defined(need_GL_NV_vertex_program) -static const char ProgramEnvParameter4fvARB_names[] = - "iip\0" /* Parameter signature */ - "glProgramEnvParameter4fvARB\0" - "glProgramParameter4fvNV\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char FragmentLightModeliSGIX_names[] = - "ii\0" /* Parameter signature */ - "glFragmentLightModeliSGIX\0" - ""; -#endif - -#if defined(need_GL_EXT_convolution) -static const char ConvolutionParameterfv_names[] = - "iip\0" /* Parameter signature */ - "glConvolutionParameterfv\0" - "glConvolutionParameterfvEXT\0" - ""; -#endif - -#if defined(need_GL_3DFX_tbuffer) -static const char TbufferMask3DFX_names[] = - "i\0" /* Parameter signature */ - "glTbufferMask3DFX\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char LoadProgramNV_names[] = - "iiip\0" /* Parameter signature */ - "glLoadProgramNV\0" - ""; -#endif - -#if defined(need_GL_ARB_sync) -static const char WaitSync_names[] = - "iii\0" /* Parameter signature */ - "glWaitSync\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib4fvNV_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4fvNV\0" - ""; -#endif - -#if defined(need_GL_ARB_shader_objects) -static const char GetAttachedObjectsARB_names[] = - "iipp\0" /* Parameter signature */ - "glGetAttachedObjectsARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform3fvARB_names[] = - "iip\0" /* Parameter signature */ - "glUniform3fv\0" - "glUniform3fvARB\0" - ""; -#endif - -#if defined(need_GL_EXT_draw_range_elements) -static const char DrawRangeElements_names[] = - "iiiiip\0" /* Parameter signature */ - "glDrawRangeElements\0" - "glDrawRangeElementsEXT\0" - ""; -#endif - -#if defined(need_GL_SGIX_sprite) -static const char SpriteParameterfvSGIX_names[] = - "ip\0" /* Parameter signature */ - "glSpriteParameterfvSGIX\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char CheckFramebufferStatusEXT_names[] = - "i\0" /* Parameter signature */ - "glCheckFramebufferStatus\0" - "glCheckFramebufferStatusEXT\0" - ""; -#endif - -#if defined(need_GL_SUN_global_alpha) -static const char GlobalAlphaFactoruiSUN_names[] = - "i\0" /* Parameter signature */ - "glGlobalAlphaFactoruiSUN\0" - ""; -#endif - -#if defined(need_GL_ARB_shader_objects) -static const char GetHandleARB_names[] = - "i\0" /* Parameter signature */ - "glGetHandleARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char GetVertexAttribivARB_names[] = - "iip\0" /* Parameter signature */ - "glGetVertexAttribiv\0" - "glGetVertexAttribivARB\0" - ""; -#endif - -#if defined(need_GL_NV_register_combiners) -static const char GetCombinerInputParameterfvNV_names[] = - "iiiip\0" /* Parameter signature */ - "glGetCombinerInputParameterfvNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) -static const char CreateProgram_names[] = - "\0" /* Parameter signature */ - "glCreateProgram\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_transpose_matrix) -static const char LoadTransposeMatrixdARB_names[] = - "p\0" /* Parameter signature */ - "glLoadTransposeMatrixd\0" - "glLoadTransposeMatrixdARB\0" - ""; -#endif - -#if defined(need_GL_EXT_histogram) -static const char GetMinmax_names[] = - "iiiip\0" /* Parameter signature */ - "glGetMinmax\0" - "glGetMinmaxEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) -static const char StencilFuncSeparate_names[] = - "iiii\0" /* Parameter signature */ - "glStencilFuncSeparate\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3sEXT_names[] = - "iii\0" /* Parameter signature */ - "glSecondaryColor3s\0" - "glSecondaryColor3sEXT\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char Color3fVertex3fvSUN_names[] = - "pp\0" /* Parameter signature */ - "glColor3fVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_SUN_global_alpha) -static const char GlobalAlphaFactorbSUN_names[] = - "i\0" /* Parameter signature */ - "glGlobalAlphaFactorbSUN\0" - ""; -#endif - -#if defined(need_GL_HP_image_transform) -static const char ImageTransformParameterfvHP_names[] = - "iip\0" /* Parameter signature */ - "glImageTransformParameterfvHP\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4ivARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4iv\0" - "glVertexAttrib4ivARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib3fNV_names[] = - "ifff\0" /* Parameter signature */ - "glVertexAttrib3fNV\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttribs2dvNV_names[] = - "iip\0" /* Parameter signature */ - "glVertexAttribs2dvNV\0" - ""; -#endif - -#if defined(need_GL_EXT_timer_query) -static const char GetQueryObjectui64vEXT_names[] = - "iip\0" /* Parameter signature */ - "glGetQueryObjectui64vEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord3fvARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord3fv\0" - "glMultiTexCoord3fvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3dEXT_names[] = - "ddd\0" /* Parameter signature */ - "glSecondaryColor3d\0" - "glSecondaryColor3dEXT\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char GetProgramParameterfvNV_names[] = - "iiip\0" /* Parameter signature */ - "glGetProgramParameterfvNV\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char TangentPointerEXT_names[] = - "iip\0" /* Parameter signature */ - "glTangentPointerEXT\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char Color4fNormal3fVertex3fvSUN_names[] = - "ppp\0" /* Parameter signature */ - "glColor4fNormal3fVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_SGIX_instruments) -static const char GetInstrumentsSGIX_names[] = - "\0" /* Parameter signature */ - "glGetInstrumentsSGIX\0" - ""; -#endif - -#if defined(need_GL_NV_evaluators) -static const char EvalMapsNV_names[] = - "ii\0" /* Parameter signature */ - "glEvalMapsNV\0" - ""; -#endif - -#if defined(need_GL_EXT_subtexture) -static const char TexSubImage2D_names[] = - "iiiiiiiip\0" /* Parameter signature */ - "glTexSubImage2D\0" - "glTexSubImage2DEXT\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char FragmentLightivSGIX_names[] = - "iip\0" /* Parameter signature */ - "glFragmentLightivSGIX\0" - ""; -#endif - -#if defined(need_GL_APPLE_texture_range) -static const char GetTexParameterPointervAPPLE_names[] = - "iip\0" /* Parameter signature */ - "glGetTexParameterPointervAPPLE\0" - ""; -#endif - -#if defined(need_GL_EXT_pixel_transform) -static const char PixelTransformParameterfvEXT_names[] = - "iip\0" /* Parameter signature */ - "glPixelTransformParameterfvEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4bvARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4bv\0" - "glVertexAttrib4bvARB\0" - ""; -#endif - -#if defined(need_GL_ATI_fragment_shader) -static const char AlphaFragmentOp2ATI_names[] = - "iiiiiiiii\0" /* Parameter signature */ - "glAlphaFragmentOp2ATI\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord4sARB_names[] = - "iiiii\0" /* Parameter signature */ - "glMultiTexCoord4s\0" - "glMultiTexCoord4sARB\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char GetFragmentMaterialivSGIX_names[] = - "iip\0" /* Parameter signature */ - "glGetFragmentMaterialivSGIX\0" - ""; -#endif - -#if defined(need_GL_MESA_window_pos) -static const char WindowPos4dMESA_names[] = - "dddd\0" /* Parameter signature */ - "glWindowPos4dMESA\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_blend) -static const char WeightPointerARB_names[] = - "iiip\0" /* Parameter signature */ - "glWeightPointerARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos2dMESA_names[] = - "dd\0" /* Parameter signature */ - "glWindowPos2d\0" - "glWindowPos2dARB\0" - "glWindowPos2dMESA\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char FramebufferTexture3DEXT_names[] = - "iiiiii\0" /* Parameter signature */ - "glFramebufferTexture3D\0" - "glFramebufferTexture3DEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_blend_minmax) -static const char BlendEquation_names[] = - "i\0" /* Parameter signature */ - "glBlendEquation\0" - "glBlendEquationEXT\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib3dNV_names[] = - "iddd\0" /* Parameter signature */ - "glVertexAttrib3dNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib3dARB_names[] = - "iddd\0" /* Parameter signature */ - "glVertexAttrib3d\0" - "glVertexAttrib3dARB\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN_names[] = - "ppppp\0" /* Parameter signature */ - "glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4fARB_names[] = - "iffff\0" /* Parameter signature */ - "glVertexAttrib4f\0" - "glVertexAttrib4fARB\0" - ""; -#endif - -#if defined(need_GL_EXT_index_func) -static const char IndexFuncEXT_names[] = - "if\0" /* Parameter signature */ - "glIndexFuncEXT\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char FramebufferTexture2DEXT_names[] = - "iiiii\0" /* Parameter signature */ - "glFramebufferTexture2D\0" - "glFramebufferTexture2DEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord2dvARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord2dv\0" - "glMultiTexCoord2dvARB\0" - ""; -#endif - -#if defined(need_GL_EXT_cull_vertex) -static const char CullParameterfvEXT_names[] = - "ip\0" /* Parameter signature */ - "glCullParameterfvEXT\0" - ""; -#endif - -#if defined(need_GL_NV_fragment_program) -static const char ProgramNamedParameter4fvNV_names[] = - "iipp\0" /* Parameter signature */ - "glProgramNamedParameter4fvNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColorPointerEXT_names[] = - "iiip\0" /* Parameter signature */ - "glSecondaryColorPointer\0" - "glSecondaryColorPointerEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4fvARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4fv\0" - "glVertexAttrib4fvARB\0" - ""; -#endif - -#if defined(need_GL_IBM_vertex_array_lists) -static const char ColorPointerListIBM_names[] = - "iiipi\0" /* Parameter signature */ - "glColorPointerListIBM\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char GetActiveUniformARB_names[] = - "iiipppp\0" /* Parameter signature */ - "glGetActiveUniform\0" - "glGetActiveUniformARB\0" - ""; -#endif - -#if defined(need_GL_HP_image_transform) -static const char ImageTransformParameteriHP_names[] = - "iii\0" /* Parameter signature */ - "glImageTransformParameteriHP\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord1svARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord1sv\0" - "glMultiTexCoord1svARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_occlusion_query) -static const char EndQueryARB_names[] = - "i\0" /* Parameter signature */ - "glEndQuery\0" - "glEndQueryARB\0" - ""; -#endif - -#if defined(need_GL_NV_fence) -static const char DeleteFencesNV_names[] = - "ip\0" /* Parameter signature */ - "glDeleteFencesNV\0" - ""; -#endif - -#if defined(need_GL_SGIX_polynomial_ffd) -static const char DeformationMap3dSGIX_names[] = - "iddiiddiiddiip\0" /* Parameter signature */ - "glDeformationMap3dSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) -static const char IsShader_names[] = - "i\0" /* Parameter signature */ - "glIsShader\0" - ""; -#endif - -#if defined(need_GL_HP_image_transform) -static const char GetImageTransformParameterivHP_names[] = - "iip\0" /* Parameter signature */ - "glGetImageTransformParameterivHP\0" - ""; -#endif - -#if defined(need_GL_MESA_window_pos) -static const char WindowPos4ivMESA_names[] = - "p\0" /* Parameter signature */ - "glWindowPos4ivMESA\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord3svARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord3sv\0" - "glMultiTexCoord3svARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord4iARB_names[] = - "iiiii\0" /* Parameter signature */ - "glMultiTexCoord4i\0" - "glMultiTexCoord4iARB\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Binormal3ivEXT_names[] = - "p\0" /* Parameter signature */ - "glBinormal3ivEXT\0" - ""; -#endif - -#if defined(need_GL_MESA_resize_buffers) -static const char ResizeBuffersMESA_names[] = - "\0" /* Parameter signature */ - "glResizeBuffersMESA\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char GetUniformivARB_names[] = - "iip\0" /* Parameter signature */ - "glGetUniformiv\0" - "glGetUniformivARB\0" - ""; -#endif - -#if defined(need_GL_SGIS_pixel_texture) -static const char PixelTexGenParameteriSGIS_names[] = - "ii\0" /* Parameter signature */ - "glPixelTexGenParameteriSGIS\0" - ""; -#endif - -#if defined(need_GL_INTEL_parallel_arrays) -static const char VertexPointervINTEL_names[] = - "iip\0" /* Parameter signature */ - "glVertexPointervINTEL\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiColor4fNormal3fVertex3fvSUN_names[] = - "pppp\0" /* Parameter signature */ - "glReplacementCodeuiColor4fNormal3fVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3uiEXT_names[] = - "iii\0" /* Parameter signature */ - "glSecondaryColor3ui\0" - "glSecondaryColor3uiEXT\0" - ""; -#endif - -#if defined(need_GL_SGIX_instruments) -static const char StartInstrumentsSGIX_names[] = - "\0" /* Parameter signature */ - "glStartInstrumentsSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3usvEXT_names[] = - "p\0" /* Parameter signature */ - "glSecondaryColor3usv\0" - "glSecondaryColor3usvEXT\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib2fvNV_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib2fvNV\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) -static const char ProgramLocalParameter4dvARB_names[] = - "iip\0" /* Parameter signature */ - "glProgramLocalParameter4dvARB\0" - ""; -#endif - -#if defined(need_GL_ARB_matrix_palette) -static const char MatrixIndexuivARB_names[] = - "ip\0" /* Parameter signature */ - "glMatrixIndexuivARB\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) -static const char RenderbufferStorageMultisample_names[] = - "iiiii\0" /* Parameter signature */ - "glRenderbufferStorageMultisample\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Tangent3sEXT_names[] = - "iii\0" /* Parameter signature */ - "glTangent3sEXT\0" - ""; -#endif - -#if defined(need_GL_SUN_global_alpha) -static const char GlobalAlphaFactorfSUN_names[] = - "f\0" /* Parameter signature */ - "glGlobalAlphaFactorfSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord3iARB_names[] = - "iiii\0" /* Parameter signature */ - "glMultiTexCoord3i\0" - "glMultiTexCoord3iARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) -static const char IsProgram_names[] = - "i\0" /* Parameter signature */ - "glIsProgram\0" - ""; -#endif - -#if defined(need_GL_IBM_vertex_array_lists) -static const char TexCoordPointerListIBM_names[] = - "iiipi\0" /* Parameter signature */ - "glTexCoordPointerListIBM\0" - ""; -#endif - -#if defined(need_GL_SUN_global_alpha) -static const char GlobalAlphaFactorusSUN_names[] = - "i\0" /* Parameter signature */ - "glGlobalAlphaFactorusSUN\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib2dvNV_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib2dvNV\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char FramebufferRenderbufferEXT_names[] = - "iiii\0" /* Parameter signature */ - "glFramebufferRenderbuffer\0" - "glFramebufferRenderbufferEXT\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib1dvNV_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib1dvNV\0" - ""; -#endif - -#if defined(need_GL_EXT_texture_object) -static const char GenTextures_names[] = - "ip\0" /* Parameter signature */ - "glGenTextures\0" - "glGenTexturesEXT\0" - ""; -#endif - -#if defined(need_GL_NV_fence) -static const char SetFenceNV_names[] = - "ii\0" /* Parameter signature */ - "glSetFenceNV\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char FramebufferTexture1DEXT_names[] = - "iiiii\0" /* Parameter signature */ - "glFramebufferTexture1D\0" - "glFramebufferTexture1DEXT\0" - ""; -#endif - -#if defined(need_GL_NV_register_combiners) -static const char GetCombinerOutputParameterivNV_names[] = - "iiip\0" /* Parameter signature */ - "glGetCombinerOutputParameterivNV\0" - ""; -#endif - -#if defined(need_GL_SGIS_pixel_texture) -static const char PixelTexGenParameterivSGIS_names[] = - "ip\0" /* Parameter signature */ - "glPixelTexGenParameterivSGIS\0" - ""; -#endif - -#if defined(need_GL_EXT_texture_perturb_normal) -static const char TextureNormalEXT_names[] = - "i\0" /* Parameter signature */ - "glTextureNormalEXT\0" - ""; -#endif - -#if defined(need_GL_IBM_vertex_array_lists) -static const char IndexPointerListIBM_names[] = - "iipi\0" /* Parameter signature */ - "glIndexPointerListIBM\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_blend) -static const char WeightfvARB_names[] = - "ip\0" /* Parameter signature */ - "glWeightfvARB\0" - ""; -#endif - -#if defined(need_GL_MESA_window_pos) -static const char WindowPos4fMESA_names[] = - "ffff\0" /* Parameter signature */ - "glWindowPos4fMESA\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos3dvMESA_names[] = - "p\0" /* Parameter signature */ - "glWindowPos3dv\0" - "glWindowPos3dvARB\0" - "glWindowPos3dvMESA\0" - ""; -#endif - -#if defined(need_GL_EXT_timer_query) -static const char GetQueryObjecti64vEXT_names[] = - "iip\0" /* Parameter signature */ - "glGetQueryObjecti64vEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord1dARB_names[] = - "id\0" /* Parameter signature */ - "glMultiTexCoord1d\0" - "glMultiTexCoord1dARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_NV_point_sprite) -static const char PointParameterivNV_names[] = - "ip\0" /* Parameter signature */ - "glPointParameteriv\0" - "glPointParameterivNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform2fvARB_names[] = - "iip\0" /* Parameter signature */ - "glUniform2fv\0" - "glUniform2fvARB\0" - ""; -#endif - -#if defined(need_GL_APPLE_flush_buffer_range) -static const char BufferParameteriAPPLE_names[] = - "iii\0" /* Parameter signature */ - "glBufferParameteriAPPLE\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord3dvARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord3dv\0" - "glMultiTexCoord3dvARB\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN_names[] = - "pppp\0" /* Parameter signature */ - "glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_ARB_shader_objects) -static const char DeleteObjectARB_names[] = - "i\0" /* Parameter signature */ - "glDeleteObjectARB\0" - ""; -#endif - -#if defined(need_GL_ARB_matrix_palette) -static const char MatrixIndexPointerARB_names[] = - "iiip\0" /* Parameter signature */ - "glMatrixIndexPointerARB\0" - ""; -#endif - -#if defined(need_GL_NV_fragment_program) -static const char ProgramNamedParameter4dvNV_names[] = - "iipp\0" /* Parameter signature */ - "glProgramNamedParameter4dvNV\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Tangent3fvEXT_names[] = - "p\0" /* Parameter signature */ - "glTangent3fvEXT\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_array_object) -static const char GenVertexArrays_names[] = - "ip\0" /* Parameter signature */ - "glGenVertexArrays\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char BindFramebufferEXT_names[] = - "ii\0" /* Parameter signature */ - "glBindFramebuffer\0" - "glBindFramebufferEXT\0" - ""; -#endif - -#if defined(need_GL_SGIX_reference_plane) -static const char ReferencePlaneSGIX_names[] = - "p\0" /* Parameter signature */ - "glReferencePlaneSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char ValidateProgramARB_names[] = - "i\0" /* Parameter signature */ - "glValidateProgram\0" - "glValidateProgramARB\0" - ""; -#endif - -#if defined(need_GL_EXT_compiled_vertex_array) -static const char UnlockArraysEXT_names[] = - "\0" /* Parameter signature */ - "glUnlockArraysEXT\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char TexCoord2fColor3fVertex3fSUN_names[] = - "ffffffff\0" /* Parameter signature */ - "glTexCoord2fColor3fVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos3fvMESA_names[] = - "p\0" /* Parameter signature */ - "glWindowPos3fv\0" - "glWindowPos3fvARB\0" - "glWindowPos3fvMESA\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib1svNV_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib1svNV\0" - ""; -#endif - -#if defined(need_GL_EXT_copy_texture) -static const char CopyTexSubImage3D_names[] = - "iiiiiiiii\0" /* Parameter signature */ - "glCopyTexSubImage3D\0" - "glCopyTexSubImage3DEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib2dARB_names[] = - "idd\0" /* Parameter signature */ - "glVertexAttrib2d\0" - "glVertexAttrib2dARB\0" - ""; -#endif - -#if defined(need_GL_ARB_sync) -static const char GetInteger64v_names[] = - "ip\0" /* Parameter signature */ - "glGetInteger64v\0" - ""; -#endif - -#if defined(need_GL_SGIS_texture_color_mask) -static const char TextureColorMaskSGIS_names[] = - "iiii\0" /* Parameter signature */ - "glTextureColorMaskSGIS\0" - ""; -#endif - -#if defined(need_GL_SGI_color_table) || defined(need_GL_EXT_paletted_texture) -static const char GetColorTable_names[] = - "iiip\0" /* Parameter signature */ - "glGetColorTable\0" - "glGetColorTableSGI\0" - "glGetColorTableEXT\0" - ""; -#endif - -#if defined(need_GL_SGI_color_table) -static const char CopyColorTable_names[] = - "iiiii\0" /* Parameter signature */ - "glCopyColorTable\0" - "glCopyColorTableSGI\0" - ""; -#endif - -#if defined(need_GL_EXT_histogram) -static const char GetHistogramParameterfv_names[] = - "iip\0" /* Parameter signature */ - "glGetHistogramParameterfv\0" - "glGetHistogramParameterfvEXT\0" - ""; -#endif - -#if defined(need_GL_INTEL_parallel_arrays) -static const char ColorPointervINTEL_names[] = - "iip\0" /* Parameter signature */ - "glColorPointervINTEL\0" - ""; -#endif - -#if defined(need_GL_ATI_fragment_shader) -static const char AlphaFragmentOp1ATI_names[] = - "iiiiii\0" /* Parameter signature */ - "glAlphaFragmentOp1ATI\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord3ivARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord3iv\0" - "glMultiTexCoord3ivARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord2sARB_names[] = - "iii\0" /* Parameter signature */ - "glMultiTexCoord2s\0" - "glMultiTexCoord2sARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib1dvARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib1dv\0" - "glVertexAttrib1dvARB\0" - ""; -#endif - -#if defined(need_GL_EXT_texture_object) -static const char DeleteTextures_names[] = - "ip\0" /* Parameter signature */ - "glDeleteTextures\0" - "glDeleteTexturesEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_vertex_array) -static const char TexCoordPointerEXT_names[] = - "iiiip\0" /* Parameter signature */ - "glTexCoordPointerEXT\0" - ""; -#endif - -#if defined(need_GL_SGIS_texture4D) -static const char TexSubImage4DSGIS_names[] = - "iiiiiiiiiiiip\0" /* Parameter signature */ - "glTexSubImage4DSGIS\0" - ""; -#endif - -#if defined(need_GL_NV_register_combiners2) -static const char CombinerStageParameterfvNV_names[] = - "iip\0" /* Parameter signature */ - "glCombinerStageParameterfvNV\0" - ""; -#endif - -#if defined(need_GL_SGIX_instruments) -static const char StopInstrumentsSGIX_names[] = - "i\0" /* Parameter signature */ - "glStopInstrumentsSGIX\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char TexCoord4fColor4fNormal3fVertex4fSUN_names[] = - "fffffffffffffff\0" /* Parameter signature */ - "glTexCoord4fColor4fNormal3fVertex4fSUN\0" - ""; -#endif - -#if defined(need_GL_SGIX_polynomial_ffd) -static const char DeformSGIX_names[] = - "i\0" /* Parameter signature */ - "glDeformSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char GetVertexAttribfvARB_names[] = - "iip\0" /* Parameter signature */ - "glGetVertexAttribfv\0" - "glGetVertexAttribfvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3ivEXT_names[] = - "p\0" /* Parameter signature */ - "glSecondaryColor3iv\0" - "glSecondaryColor3ivEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_1) -static const char UniformMatrix4x2fv_names[] = - "iiip\0" /* Parameter signature */ - "glUniformMatrix4x2fv\0" - ""; -#endif - -#if defined(need_GL_SGIS_detail_texture) -static const char GetDetailTexFuncSGIS_names[] = - "ip\0" /* Parameter signature */ - "glGetDetailTexFuncSGIS\0" - ""; -#endif - -#if defined(need_GL_NV_register_combiners2) -static const char GetCombinerStageParameterfvNV_names[] = - "iip\0" /* Parameter signature */ - "glGetCombinerStageParameterfvNV\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_array_object) -static const char BindVertexArray_names[] = - "i\0" /* Parameter signature */ - "glBindVertexArray\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char Color4ubVertex2fvSUN_names[] = - "pp\0" /* Parameter signature */ - "glColor4ubVertex2fvSUN\0" - ""; -#endif - -#if defined(need_GL_SGIS_texture_filter4) -static const char TexFilterFuncSGIS_names[] = - "iiip\0" /* Parameter signature */ - "glTexFilterFuncSGIS\0" - ""; -#endif - -#if defined(need_GL_SGIS_multisample) || defined(need_GL_EXT_multisample) -static const char SampleMaskSGIS_names[] = - "fi\0" /* Parameter signature */ - "glSampleMaskSGIS\0" - "glSampleMaskEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_shader) -static const char GetAttribLocationARB_names[] = - "ip\0" /* Parameter signature */ - "glGetAttribLocation\0" - "glGetAttribLocationARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4ubvARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4ubv\0" - "glVertexAttrib4ubvARB\0" - ""; -#endif - -#if defined(need_GL_SGIS_detail_texture) -static const char DetailTexFuncSGIS_names[] = - "iip\0" /* Parameter signature */ - "glDetailTexFuncSGIS\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char Normal3fVertex3fSUN_names[] = - "ffffff\0" /* Parameter signature */ - "glNormal3fVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_EXT_copy_texture) -static const char CopyTexImage2D_names[] = - "iiiiiiii\0" /* Parameter signature */ - "glCopyTexImage2D\0" - "glCopyTexImage2DEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) -static const char GetBufferPointervARB_names[] = - "iip\0" /* Parameter signature */ - "glGetBufferPointerv\0" - "glGetBufferPointervARB\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) || defined(need_GL_NV_vertex_program) -static const char ProgramEnvParameter4fARB_names[] = - "iiffff\0" /* Parameter signature */ - "glProgramEnvParameter4fARB\0" - "glProgramParameter4fNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform3ivARB_names[] = - "iip\0" /* Parameter signature */ - "glUniform3iv\0" - "glUniform3ivARB\0" - ""; -#endif - -#if defined(need_GL_NV_fence) -static const char GetFenceivNV_names[] = - "iip\0" /* Parameter signature */ - "glGetFenceivNV\0" - ""; -#endif - -#if defined(need_GL_MESA_window_pos) -static const char WindowPos4dvMESA_names[] = - "p\0" /* Parameter signature */ - "glWindowPos4dvMESA\0" - ""; -#endif - -#if defined(need_GL_EXT_color_subtable) -static const char ColorSubTable_names[] = - "iiiiip\0" /* Parameter signature */ - "glColorSubTable\0" - "glColorSubTableEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord4ivARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord4iv\0" - "glMultiTexCoord4ivARB\0" - ""; -#endif - -#if defined(need_GL_EXT_gpu_program_parameters) -static const char ProgramLocalParameters4fvEXT_names[] = - "iiip\0" /* Parameter signature */ - "glProgramLocalParameters4fvEXT\0" - ""; -#endif - -#if defined(need_GL_NV_evaluators) -static const char GetMapAttribParameterfvNV_names[] = - "iiip\0" /* Parameter signature */ - "glGetMapAttribParameterfvNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4sARB_names[] = - "iiiii\0" /* Parameter signature */ - "glVertexAttrib4s\0" - "glVertexAttrib4sARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_occlusion_query) -static const char GetQueryObjectuivARB_names[] = - "iip\0" /* Parameter signature */ - "glGetQueryObjectuiv\0" - "glGetQueryObjectuivARB\0" - ""; -#endif - -#if defined(need_GL_NV_evaluators) -static const char MapParameterivNV_names[] = - "iip\0" /* Parameter signature */ - "glMapParameterivNV\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char GenRenderbuffersEXT_names[] = - "ip\0" /* Parameter signature */ - "glGenRenderbuffers\0" - "glGenRenderbuffersEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib2dvARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib2dv\0" - "glVertexAttrib2dvARB\0" - ""; -#endif - -#if defined(need_GL_EXT_vertex_array) -static const char EdgeFlagPointerEXT_names[] = - "iip\0" /* Parameter signature */ - "glEdgeFlagPointerEXT\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttribs2svNV_names[] = - "iip\0" /* Parameter signature */ - "glVertexAttribs2svNV\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_blend) -static const char WeightbvARB_names[] = - "ip\0" /* Parameter signature */ - "glWeightbvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib2fvARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib2fv\0" - "glVertexAttrib2fvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) -static const char GetBufferParameterivARB_names[] = - "iip\0" /* Parameter signature */ - "glGetBufferParameteriv\0" - "glGetBufferParameterivARB\0" - ""; -#endif - -#if defined(need_GL_SGIX_list_priority) -static const char ListParameteriSGIX_names[] = - "iii\0" /* Parameter signature */ - "glListParameteriSGIX\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiColor4fNormal3fVertex3fSUN_names[] = - "iffffffffff\0" /* Parameter signature */ - "glReplacementCodeuiColor4fNormal3fVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_SGIX_instruments) -static const char InstrumentsBufferSGIX_names[] = - "ip\0" /* Parameter signature */ - "glInstrumentsBufferSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4NivARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4Niv\0" - "glVertexAttrib4NivARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) -static const char GetAttachedShaders_names[] = - "iipp\0" /* Parameter signature */ - "glGetAttachedShaders\0" - ""; -#endif - -#if defined(need_GL_APPLE_vertex_array_object) -static const char GenVertexArraysAPPLE_names[] = - "ip\0" /* Parameter signature */ - "glGenVertexArraysAPPLE\0" - ""; -#endif - -#if defined(need_GL_EXT_gpu_program_parameters) -static const char ProgramEnvParameters4fvEXT_names[] = - "iiip\0" /* Parameter signature */ - "glProgramEnvParameters4fvEXT\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char TexCoord2fColor4fNormal3fVertex3fvSUN_names[] = - "pppp\0" /* Parameter signature */ - "glTexCoord2fColor4fNormal3fVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos2iMESA_names[] = - "ii\0" /* Parameter signature */ - "glWindowPos2i\0" - "glWindowPos2iARB\0" - "glWindowPos2iMESA\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3fvEXT_names[] = - "p\0" /* Parameter signature */ - "glSecondaryColor3fv\0" - "glSecondaryColor3fvEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_texture_compression) -static const char CompressedTexSubImage1DARB_names[] = - "iiiiiip\0" /* Parameter signature */ - "glCompressedTexSubImage1D\0" - "glCompressedTexSubImage1DARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char GetVertexAttribivNV_names[] = - "iip\0" /* Parameter signature */ - "glGetVertexAttribivNV\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) -static const char GetProgramStringARB_names[] = - "iip\0" /* Parameter signature */ - "glGetProgramStringARB\0" - ""; -#endif - -#if defined(need_GL_ATI_envmap_bumpmap) -static const char TexBumpParameterfvATI_names[] = - "ip\0" /* Parameter signature */ - "glTexBumpParameterfvATI\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char CompileShaderARB_names[] = - "i\0" /* Parameter signature */ - "glCompileShader\0" - "glCompileShaderARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) -static const char DeleteShader_names[] = - "i\0" /* Parameter signature */ - "glDeleteShader\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform3fARB_names[] = - "ifff\0" /* Parameter signature */ - "glUniform3f\0" - "glUniform3fARB\0" - ""; -#endif - -#if defined(need_GL_SGIX_list_priority) -static const char ListParameterfvSGIX_names[] = - "iip\0" /* Parameter signature */ - "glListParameterfvSGIX\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Tangent3dvEXT_names[] = - "p\0" /* Parameter signature */ - "glTangent3dvEXT\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char GetVertexAttribfvNV_names[] = - "iip\0" /* Parameter signature */ - "glGetVertexAttribfvNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos3sMESA_names[] = - "iii\0" /* Parameter signature */ - "glWindowPos3s\0" - "glWindowPos3sARB\0" - "glWindowPos3sMESA\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib2svNV_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib2svNV\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttribs1fvNV_names[] = - "iip\0" /* Parameter signature */ - "glVertexAttribs1fvNV\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char TexCoord2fVertex3fvSUN_names[] = - "pp\0" /* Parameter signature */ - "glTexCoord2fVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_MESA_window_pos) -static const char WindowPos4sMESA_names[] = - "iiii\0" /* Parameter signature */ - "glWindowPos4sMESA\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4NuivARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4Nuiv\0" - "glVertexAttrib4NuivARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char ClientActiveTextureARB_names[] = - "i\0" /* Parameter signature */ - "glClientActiveTexture\0" - "glClientActiveTextureARB\0" - ""; -#endif - -#if defined(need_GL_SGIX_pixel_texture) -static const char PixelTexGenSGIX_names[] = - "i\0" /* Parameter signature */ - "glPixelTexGenSGIX\0" - ""; -#endif - -#if defined(need_GL_SUN_triangle_list) -static const char ReplacementCodeusvSUN_names[] = - "p\0" /* Parameter signature */ - "glReplacementCodeusvSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform4fARB_names[] = - "iffff\0" /* Parameter signature */ - "glUniform4f\0" - "glUniform4fARB\0" - ""; -#endif - -#if defined(need_GL_ARB_map_buffer_range) -static const char FlushMappedBufferRange_names[] = - "iii\0" /* Parameter signature */ - "glFlushMappedBufferRange\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) || defined(need_GL_NV_vertex_program) -static const char IsProgramNV_names[] = - "i\0" /* Parameter signature */ - "glIsProgramARB\0" - "glIsProgramNV\0" - ""; -#endif - -#if defined(need_GL_APPLE_flush_buffer_range) -static const char FlushMappedBufferRangeAPPLE_names[] = - "iii\0" /* Parameter signature */ - "glFlushMappedBufferRangeAPPLE\0" - ""; -#endif - -#if defined(need_GL_SUN_triangle_list) -static const char ReplacementCodePointerSUN_names[] = - "iip\0" /* Parameter signature */ - "glReplacementCodePointerSUN\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) || defined(need_GL_NV_vertex_program) -static const char ProgramEnvParameter4dARB_names[] = - "iidddd\0" /* Parameter signature */ - "glProgramEnvParameter4dARB\0" - "glProgramParameter4dNV\0" - ""; -#endif - -#if defined(need_GL_SGI_color_table) -static const char ColorTableParameterfv_names[] = - "iip\0" /* Parameter signature */ - "glColorTableParameterfv\0" - "glColorTableParameterfvSGI\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char FragmentLightModelfSGIX_names[] = - "if\0" /* Parameter signature */ - "glFragmentLightModelfSGIX\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Binormal3bvEXT_names[] = - "p\0" /* Parameter signature */ - "glBinormal3bvEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_texture_object) -static const char IsTexture_names[] = - "i\0" /* Parameter signature */ - "glIsTexture\0" - "glIsTextureEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_vertex_weighting) -static const char VertexWeightfvEXT_names[] = - "p\0" /* Parameter signature */ - "glVertexWeightfvEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib1dARB_names[] = - "id\0" /* Parameter signature */ - "glVertexAttrib1d\0" - "glVertexAttrib1dARB\0" - ""; -#endif - -#if defined(need_GL_HP_image_transform) -static const char ImageTransformParameterivHP_names[] = - "iip\0" /* Parameter signature */ - "glImageTransformParameterivHP\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_occlusion_query) -static const char DeleteQueriesARB_names[] = - "ip\0" /* Parameter signature */ - "glDeleteQueries\0" - "glDeleteQueriesARB\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char Color4ubVertex2fSUN_names[] = - "iiiiff\0" /* Parameter signature */ - "glColor4ubVertex2fSUN\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char FragmentColorMaterialSGIX_names[] = - "ii\0" /* Parameter signature */ - "glFragmentColorMaterialSGIX\0" - ""; -#endif - -#if defined(need_GL_ARB_matrix_palette) -static const char CurrentPaletteMatrixARB_names[] = - "i\0" /* Parameter signature */ - "glCurrentPaletteMatrixARB\0" - ""; -#endif - -#if defined(need_GL_SGIS_multisample) || defined(need_GL_EXT_multisample) -static const char SamplePatternSGIS_names[] = - "i\0" /* Parameter signature */ - "glSamplePatternSGIS\0" - "glSamplePatternEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_occlusion_query) -static const char IsQueryARB_names[] = - "i\0" /* Parameter signature */ - "glIsQuery\0" - "glIsQueryARB\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiColor4ubVertex3fSUN_names[] = - "iiiiifff\0" /* Parameter signature */ - "glReplacementCodeuiColor4ubVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4usvARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4usv\0" - "glVertexAttrib4usvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char LinkProgramARB_names[] = - "i\0" /* Parameter signature */ - "glLinkProgram\0" - "glLinkProgramARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib2fNV_names[] = - "iff\0" /* Parameter signature */ - "glVertexAttrib2fNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char ShaderSourceARB_names[] = - "iipp\0" /* Parameter signature */ - "glShaderSource\0" - "glShaderSourceARB\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char FragmentMaterialiSGIX_names[] = - "iii\0" /* Parameter signature */ - "glFragmentMaterialiSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib3svARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib3sv\0" - "glVertexAttrib3svARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_texture_compression) -static const char CompressedTexSubImage3DARB_names[] = - "iiiiiiiiiip\0" /* Parameter signature */ - "glCompressedTexSubImage3D\0" - "glCompressedTexSubImage3DARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos2ivMESA_names[] = - "p\0" /* Parameter signature */ - "glWindowPos2iv\0" - "glWindowPos2ivARB\0" - "glWindowPos2ivMESA\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char IsFramebufferEXT_names[] = - "i\0" /* Parameter signature */ - "glIsFramebuffer\0" - "glIsFramebufferEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform4ivARB_names[] = - "iip\0" /* Parameter signature */ - "glUniform4iv\0" - "glUniform4ivARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char GetVertexAttribdvARB_names[] = - "iip\0" /* Parameter signature */ - "glGetVertexAttribdv\0" - "glGetVertexAttribdvARB\0" - ""; -#endif - -#if defined(need_GL_ATI_envmap_bumpmap) -static const char TexBumpParameterivATI_names[] = - "ip\0" /* Parameter signature */ - "glTexBumpParameterivATI\0" - ""; -#endif - -#if defined(need_GL_EXT_convolution) -static const char GetSeparableFilter_names[] = - "iiippp\0" /* Parameter signature */ - "glGetSeparableFilter\0" - "glGetSeparableFilterEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Binormal3dEXT_names[] = - "ddd\0" /* Parameter signature */ - "glBinormal3dEXT\0" - ""; -#endif - -#if defined(need_GL_SGIX_sprite) -static const char SpriteParameteriSGIX_names[] = - "ii\0" /* Parameter signature */ - "glSpriteParameteriSGIX\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char RequestResidentProgramsNV_names[] = - "ip\0" /* Parameter signature */ - "glRequestResidentProgramsNV\0" - ""; -#endif - -#if defined(need_GL_SGIX_tag_sample_buffer) -static const char TagSampleBufferSGIX_names[] = - "\0" /* Parameter signature */ - "glTagSampleBufferSGIX\0" - ""; -#endif - -#if defined(need_GL_SUN_triangle_list) -static const char ReplacementCodeusSUN_names[] = - "i\0" /* Parameter signature */ - "glReplacementCodeusSUN\0" - ""; -#endif - -#if defined(need_GL_SGIX_list_priority) -static const char ListParameterivSGIX_names[] = - "iip\0" /* Parameter signature */ - "glListParameterivSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_multi_draw_arrays) -static const char MultiDrawElementsEXT_names[] = - "ipipi\0" /* Parameter signature */ - "glMultiDrawElements\0" - "glMultiDrawElementsEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform1ivARB_names[] = - "iip\0" /* Parameter signature */ - "glUniform1iv\0" - "glUniform1ivARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos2sMESA_names[] = - "ii\0" /* Parameter signature */ - "glWindowPos2s\0" - "glWindowPos2sARB\0" - "glWindowPos2sMESA\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_blend) -static const char WeightusvARB_names[] = - "ip\0" /* Parameter signature */ - "glWeightusvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_fog_coord) -static const char FogCoordPointerEXT_names[] = - "iip\0" /* Parameter signature */ - "glFogCoordPointer\0" - "glFogCoordPointerEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_index_material) -static const char IndexMaterialEXT_names[] = - "ii\0" /* Parameter signature */ - "glIndexMaterialEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3ubvEXT_names[] = - "p\0" /* Parameter signature */ - "glSecondaryColor3ubv\0" - "glSecondaryColor3ubvEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4dvARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4dv\0" - "glVertexAttrib4dvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_shader) -static const char BindAttribLocationARB_names[] = - "iip\0" /* Parameter signature */ - "glBindAttribLocation\0" - "glBindAttribLocationARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord2dARB_names[] = - "idd\0" /* Parameter signature */ - "glMultiTexCoord2d\0" - "glMultiTexCoord2dARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char ExecuteProgramNV_names[] = - "iip\0" /* Parameter signature */ - "glExecuteProgramNV\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char LightEnviSGIX_names[] = - "ii\0" /* Parameter signature */ - "glLightEnviSGIX\0" - ""; -#endif - -#if defined(need_GL_SUN_triangle_list) -static const char ReplacementCodeuiSUN_names[] = - "i\0" /* Parameter signature */ - "glReplacementCodeuiSUN\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttribPointerNV_names[] = - "iiiip\0" /* Parameter signature */ - "glVertexAttribPointerNV\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char GetFramebufferAttachmentParameterivEXT_names[] = - "iiip\0" /* Parameter signature */ - "glGetFramebufferAttachmentParameteriv\0" - "glGetFramebufferAttachmentParameterivEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_pixel_transform) -static const char PixelTransformParameterfEXT_names[] = - "iif\0" /* Parameter signature */ - "glPixelTransformParameterfEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord4dvARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord4dv\0" - "glMultiTexCoord4dvARB\0" - ""; -#endif - -#if defined(need_GL_EXT_pixel_transform) -static const char PixelTransformParameteriEXT_names[] = - "iii\0" /* Parameter signature */ - "glPixelTransformParameteriEXT\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char TexCoord2fColor4ubVertex3fSUN_names[] = - "ffiiiifff\0" /* Parameter signature */ - "glTexCoord2fColor4ubVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform1iARB_names[] = - "ii\0" /* Parameter signature */ - "glUniform1i\0" - "glUniform1iARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttribPointerARB_names[] = - "iiiiip\0" /* Parameter signature */ - "glVertexAttribPointer\0" - "glVertexAttribPointerARB\0" - ""; -#endif - -#if defined(need_GL_SGIS_sharpen_texture) -static const char SharpenTexFuncSGIS_names[] = - "iip\0" /* Parameter signature */ - "glSharpenTexFuncSGIS\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord4fvARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord4fv\0" - "glMultiTexCoord4fvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_1) -static const char UniformMatrix2x3fv_names[] = - "iiip\0" /* Parameter signature */ - "glUniformMatrix2x3fv\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char TrackMatrixNV_names[] = - "iiii\0" /* Parameter signature */ - "glTrackMatrixNV\0" - ""; -#endif - -#if defined(need_GL_NV_register_combiners) -static const char CombinerParameteriNV_names[] = - "ii\0" /* Parameter signature */ - "glCombinerParameteriNV\0" - ""; -#endif - -#if defined(need_GL_SGIX_async) -static const char DeleteAsyncMarkersSGIX_names[] = - "ii\0" /* Parameter signature */ - "glDeleteAsyncMarkersSGIX\0" - ""; -#endif - -#if defined(need_GL_SGIX_async) -static const char IsAsyncMarkerSGIX_names[] = - "i\0" /* Parameter signature */ - "glIsAsyncMarkerSGIX\0" - ""; -#endif - -#if defined(need_GL_SGIX_framezoom) -static const char FrameZoomSGIX_names[] = - "i\0" /* Parameter signature */ - "glFrameZoomSGIX\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char Normal3fVertex3fvSUN_names[] = - "pp\0" /* Parameter signature */ - "glNormal3fVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4NsvARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4Nsv\0" - "glVertexAttrib4NsvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib3fvARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib3fv\0" - "glVertexAttrib3fvARB\0" - ""; -#endif - -#if defined(need_GL_ARB_sync) -static const char GetSynciv_names[] = - "iiipp\0" /* Parameter signature */ - "glGetSynciv\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char DeleteFramebuffersEXT_names[] = - "ip\0" /* Parameter signature */ - "glDeleteFramebuffers\0" - "glDeleteFramebuffersEXT\0" - ""; -#endif - -#if defined(need_GL_SUN_global_alpha) -static const char GlobalAlphaFactorsSUN_names[] = - "i\0" /* Parameter signature */ - "glGlobalAlphaFactorsSUN\0" - ""; -#endif - -#if defined(need_GL_EXT_texture3D) -static const char TexSubImage3D_names[] = - "iiiiiiiiiip\0" /* Parameter signature */ - "glTexSubImage3D\0" - "glTexSubImage3DEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Tangent3fEXT_names[] = - "fff\0" /* Parameter signature */ - "glTangent3fEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3uivEXT_names[] = - "p\0" /* Parameter signature */ - "glSecondaryColor3uiv\0" - "glSecondaryColor3uivEXT\0" - ""; -#endif - -#if defined(need_GL_ARB_matrix_palette) -static const char MatrixIndexubvARB_names[] = - "ip\0" /* Parameter signature */ - "glMatrixIndexubvARB\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char Color4fNormal3fVertex3fSUN_names[] = - "ffffffffff\0" /* Parameter signature */ - "glColor4fNormal3fVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_SGIS_pixel_texture) -static const char PixelTexGenParameterfSGIS_names[] = - "if\0" /* Parameter signature */ - "glPixelTexGenParameterfSGIS\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) -static const char CreateShader_names[] = - "i\0" /* Parameter signature */ - "glCreateShader\0" - ""; -#endif - -#if defined(need_GL_SGI_color_table) || defined(need_GL_EXT_paletted_texture) -static const char GetColorTableParameterfv_names[] = - "iip\0" /* Parameter signature */ - "glGetColorTableParameterfv\0" - "glGetColorTableParameterfvSGI\0" - "glGetColorTableParameterfvEXT\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char FragmentLightModelfvSGIX_names[] = - "ip\0" /* Parameter signature */ - "glFragmentLightModelfvSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord3fARB_names[] = - "ifff\0" /* Parameter signature */ - "glMultiTexCoord3f\0" - "glMultiTexCoord3fARB\0" - ""; -#endif - -#if defined(need_GL_SGIS_pixel_texture) -static const char GetPixelTexGenParameterfvSGIS_names[] = - "ip\0" /* Parameter signature */ - "glGetPixelTexGenParameterfvSGIS\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char GenFramebuffersEXT_names[] = - "ip\0" /* Parameter signature */ - "glGenFramebuffers\0" - "glGenFramebuffersEXT\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char GetProgramParameterdvNV_names[] = - "iiip\0" /* Parameter signature */ - "glGetProgramParameterdvNV\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_array_object) || defined(need_GL_APPLE_vertex_array_object) -static const char IsVertexArrayAPPLE_names[] = - "i\0" /* Parameter signature */ - "glIsVertexArray\0" - "glIsVertexArrayAPPLE\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char FragmentLightfvSGIX_names[] = - "iip\0" /* Parameter signature */ - "glFragmentLightfvSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) -static const char DetachShader_names[] = - "ii\0" /* Parameter signature */ - "glDetachShader\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4NubARB_names[] = - "iiiii\0" /* Parameter signature */ - "glVertexAttrib4Nub\0" - "glVertexAttrib4NubARB\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) -static const char GetProgramEnvParameterfvARB_names[] = - "iip\0" /* Parameter signature */ - "glGetProgramEnvParameterfvARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char GetTrackMatrixivNV_names[] = - "iiip\0" /* Parameter signature */ - "glGetTrackMatrixivNV\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib3svNV_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib3svNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform4fvARB_names[] = - "iip\0" /* Parameter signature */ - "glUniform4fv\0" - "glUniform4fvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_transpose_matrix) -static const char MultTransposeMatrixfARB_names[] = - "p\0" /* Parameter signature */ - "glMultTransposeMatrixf\0" - "glMultTransposeMatrixfARB\0" - ""; -#endif - -#if defined(need_GL_ATI_fragment_shader) -static const char ColorFragmentOp1ATI_names[] = - "iiiiiii\0" /* Parameter signature */ - "glColorFragmentOp1ATI\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char GetUniformfvARB_names[] = - "iip\0" /* Parameter signature */ - "glGetUniformfv\0" - "glGetUniformfvARB\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN_names[] = - "iffffffffffff\0" /* Parameter signature */ - "glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_ARB_shader_objects) -static const char DetachObjectARB_names[] = - "ii\0" /* Parameter signature */ - "glDetachObjectARB\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_blend) -static const char VertexBlendARB_names[] = - "i\0" /* Parameter signature */ - "glVertexBlendARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos3iMESA_names[] = - "iii\0" /* Parameter signature */ - "glWindowPos3i\0" - "glWindowPos3iARB\0" - "glWindowPos3iMESA\0" - ""; -#endif - -#if defined(need_GL_EXT_convolution) -static const char SeparableFilter2D_names[] = - "iiiiiipp\0" /* Parameter signature */ - "glSeparableFilter2D\0" - "glSeparableFilter2DEXT\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiColor4ubVertex3fvSUN_names[] = - "ppp\0" /* Parameter signature */ - "glReplacementCodeuiColor4ubVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_texture_compression) -static const char CompressedTexImage2DARB_names[] = - "iiiiiiip\0" /* Parameter signature */ - "glCompressedTexImage2D\0" - "glCompressedTexImage2DARB\0" - ""; -#endif - -#if defined(need_GL_EXT_vertex_array) -static const char ArrayElement_names[] = - "i\0" /* Parameter signature */ - "glArrayElement\0" - "glArrayElementEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_depth_bounds_test) -static const char DepthBoundsEXT_names[] = - "dd\0" /* Parameter signature */ - "glDepthBoundsEXT\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char ProgramParameters4fvNV_names[] = - "iiip\0" /* Parameter signature */ - "glProgramParameters4fvNV\0" - ""; -#endif - -#if defined(need_GL_SGIX_polynomial_ffd) -static const char DeformationMap3fSGIX_names[] = - "iffiiffiiffiip\0" /* Parameter signature */ - "glDeformationMap3fSGIX\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char GetProgramivNV_names[] = - "iip\0" /* Parameter signature */ - "glGetProgramivNV\0" - ""; -#endif - -#if defined(need_GL_EXT_histogram) -static const char GetMinmaxParameteriv_names[] = - "iip\0" /* Parameter signature */ - "glGetMinmaxParameteriv\0" - "glGetMinmaxParameterivEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_copy_texture) -static const char CopyTexImage1D_names[] = - "iiiiiii\0" /* Parameter signature */ - "glCopyTexImage1D\0" - "glCopyTexImage1DEXT\0" - ""; -#endif - -#if defined(need_GL_ATI_fragment_shader) -static const char AlphaFragmentOp3ATI_names[] = - "iiiiiiiiiiii\0" /* Parameter signature */ - "glAlphaFragmentOp3ATI\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char GetVertexAttribdvNV_names[] = - "iip\0" /* Parameter signature */ - "glGetVertexAttribdvNV\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib3fvNV_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib3fvNV\0" - ""; -#endif - -#if defined(need_GL_NV_register_combiners) -static const char GetFinalCombinerInputParameterivNV_names[] = - "iip\0" /* Parameter signature */ - "glGetFinalCombinerInputParameterivNV\0" - ""; -#endif - -#if defined(need_GL_NV_evaluators) -static const char GetMapParameterivNV_names[] = - "iip\0" /* Parameter signature */ - "glGetMapParameterivNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform4iARB_names[] = - "iiiii\0" /* Parameter signature */ - "glUniform4i\0" - "glUniform4iARB\0" - ""; -#endif - -#if defined(need_GL_EXT_convolution) -static const char ConvolutionParameteri_names[] = - "iii\0" /* Parameter signature */ - "glConvolutionParameteri\0" - "glConvolutionParameteriEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Binormal3sEXT_names[] = - "iii\0" /* Parameter signature */ - "glBinormal3sEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_convolution) -static const char ConvolutionParameterf_names[] = - "iif\0" /* Parameter signature */ - "glConvolutionParameterf\0" - "glConvolutionParameterfEXT\0" - ""; -#endif - -#if defined(need_GL_SGI_color_table) || defined(need_GL_EXT_paletted_texture) -static const char GetColorTableParameteriv_names[] = - "iip\0" /* Parameter signature */ - "glGetColorTableParameteriv\0" - "glGetColorTableParameterivSGI\0" - "glGetColorTableParameterivEXT\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) || defined(need_GL_NV_vertex_program) -static const char ProgramEnvParameter4dvARB_names[] = - "iip\0" /* Parameter signature */ - "glProgramEnvParameter4dvARB\0" - "glProgramParameter4dvNV\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttribs2fvNV_names[] = - "iip\0" /* Parameter signature */ - "glVertexAttribs2fvNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char UseProgramObjectARB_names[] = - "i\0" /* Parameter signature */ - "glUseProgram\0" - "glUseProgramObjectARB\0" - ""; -#endif - -#if defined(need_GL_NV_evaluators) -static const char GetMapParameterfvNV_names[] = - "iip\0" /* Parameter signature */ - "glGetMapParameterfvNV\0" - ""; -#endif - -#if defined(need_GL_ATI_fragment_shader) -static const char PassTexCoordATI_names[] = - "iii\0" /* Parameter signature */ - "glPassTexCoordATI\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) -static const char DeleteProgram_names[] = - "i\0" /* Parameter signature */ - "glDeleteProgram\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Tangent3ivEXT_names[] = - "p\0" /* Parameter signature */ - "glTangent3ivEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Tangent3dEXT_names[] = - "ddd\0" /* Parameter signature */ - "glTangent3dEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3dvEXT_names[] = - "p\0" /* Parameter signature */ - "glSecondaryColor3dv\0" - "glSecondaryColor3dvEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_multi_draw_arrays) -static const char MultiDrawArraysEXT_names[] = - "ippi\0" /* Parameter signature */ - "glMultiDrawArrays\0" - "glMultiDrawArraysEXT\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char BindRenderbufferEXT_names[] = - "ii\0" /* Parameter signature */ - "glBindRenderbuffer\0" - "glBindRenderbufferEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord4dARB_names[] = - "idddd\0" /* Parameter signature */ - "glMultiTexCoord4d\0" - "glMultiTexCoord4dARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3usEXT_names[] = - "iii\0" /* Parameter signature */ - "glSecondaryColor3us\0" - "glSecondaryColor3usEXT\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) -static const char ProgramLocalParameter4fvARB_names[] = - "iip\0" /* Parameter signature */ - "glProgramLocalParameter4fvARB\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) || defined(need_GL_NV_vertex_program) -static const char DeleteProgramsNV_names[] = - "ip\0" /* Parameter signature */ - "glDeleteProgramsARB\0" - "glDeleteProgramsNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord1sARB_names[] = - "ii\0" /* Parameter signature */ - "glMultiTexCoord1s\0" - "glMultiTexCoord1sARB\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiColor3fVertex3fSUN_names[] = - "iffffff\0" /* Parameter signature */ - "glReplacementCodeuiColor3fVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) || defined(need_GL_NV_vertex_program) -static const char GetVertexAttribPointervNV_names[] = - "iip\0" /* Parameter signature */ - "glGetVertexAttribPointerv\0" - "glGetVertexAttribPointervARB\0" - "glGetVertexAttribPointervNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord1dvARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord1dv\0" - "glMultiTexCoord1dvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform2iARB_names[] = - "iii\0" /* Parameter signature */ - "glUniform2i\0" - "glUniform2iARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char GetProgramStringNV_names[] = - "iip\0" /* Parameter signature */ - "glGetProgramStringNV\0" - ""; -#endif - -#if defined(need_GL_EXT_vertex_array) -static const char ColorPointerEXT_names[] = - "iiiip\0" /* Parameter signature */ - "glColorPointerEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) -static const char MapBufferARB_names[] = - "ii\0" /* Parameter signature */ - "glMapBuffer\0" - "glMapBufferARB\0" - ""; -#endif - -#if defined(need_GL_ARB_draw_elements_base_vertex) -static const char MultiDrawElementsBaseVertex_names[] = - "ipipip\0" /* Parameter signature */ - "glMultiDrawElementsBaseVertex\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Binormal3svEXT_names[] = - "p\0" /* Parameter signature */ - "glBinormal3svEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_light_texture) -static const char ApplyTextureEXT_names[] = - "i\0" /* Parameter signature */ - "glApplyTextureEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_light_texture) -static const char TextureMaterialEXT_names[] = - "ii\0" /* Parameter signature */ - "glTextureMaterialEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_light_texture) -static const char TextureLightEXT_names[] = - "i\0" /* Parameter signature */ - "glTextureLightEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_histogram) -static const char ResetMinmax_names[] = - "i\0" /* Parameter signature */ - "glResetMinmax\0" - "glResetMinmaxEXT\0" - ""; -#endif - -#if defined(need_GL_SGIX_sprite) -static const char SpriteParameterfSGIX_names[] = - "if\0" /* Parameter signature */ - "glSpriteParameterfSGIX\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib4sNV_names[] = - "iiiii\0" /* Parameter signature */ - "glVertexAttrib4sNV\0" - ""; -#endif - -#if defined(need_GL_EXT_convolution) -static const char GetConvolutionParameterfv_names[] = - "iip\0" /* Parameter signature */ - "glGetConvolutionParameterfv\0" - "glGetConvolutionParameterfvEXT\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttribs4dvNV_names[] = - "iip\0" /* Parameter signature */ - "glVertexAttribs4dvNV\0" - ""; -#endif - -#if defined(need_GL_IBM_multimode_draw_arrays) -static const char MultiModeDrawArraysIBM_names[] = - "pppii\0" /* Parameter signature */ - "glMultiModeDrawArraysIBM\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4dARB_names[] = - "idddd\0" /* Parameter signature */ - "glVertexAttrib4d\0" - "glVertexAttrib4dARB\0" - ""; -#endif - -#if defined(need_GL_ATI_envmap_bumpmap) -static const char GetTexBumpParameterfvATI_names[] = - "ip\0" /* Parameter signature */ - "glGetTexBumpParameterfvATI\0" - ""; -#endif - -#if defined(need_GL_NV_fragment_program) -static const char ProgramNamedParameter4dNV_names[] = - "iipdddd\0" /* Parameter signature */ - "glProgramNamedParameter4dNV\0" - ""; -#endif - -#if defined(need_GL_EXT_vertex_weighting) -static const char VertexWeightfEXT_names[] = - "f\0" /* Parameter signature */ - "glVertexWeightfEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Binormal3fEXT_names[] = - "fff\0" /* Parameter signature */ - "glBinormal3fEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_fog_coord) -static const char FogCoordfvEXT_names[] = - "p\0" /* Parameter signature */ - "glFogCoordfv\0" - "glFogCoordfvEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord1ivARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord1iv\0" - "glMultiTexCoord1ivARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3ubEXT_names[] = - "iii\0" /* Parameter signature */ - "glSecondaryColor3ub\0" - "glSecondaryColor3ubEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord2ivARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord2iv\0" - "glMultiTexCoord2ivARB\0" - ""; -#endif - -#if defined(need_GL_SGIS_fog_function) -static const char FogFuncSGIS_names[] = - "ip\0" /* Parameter signature */ - "glFogFuncSGIS\0" - ""; -#endif - -#if defined(need_GL_EXT_copy_texture) -static const char CopyTexSubImage2D_names[] = - "iiiiiiii\0" /* Parameter signature */ - "glCopyTexSubImage2D\0" - "glCopyTexSubImage2DEXT\0" - ""; -#endif - -#if defined(need_GL_ARB_shader_objects) -static const char GetObjectParameterivARB_names[] = - "iip\0" /* Parameter signature */ - "glGetObjectParameterivARB\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char TexCoord4fVertex4fSUN_names[] = - "ffffffff\0" /* Parameter signature */ - "glTexCoord4fVertex4fSUN\0" - ""; -#endif - -#if defined(need_GL_APPLE_vertex_array_object) -static const char BindVertexArrayAPPLE_names[] = - "i\0" /* Parameter signature */ - "glBindVertexArrayAPPLE\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) -static const char GetProgramLocalParameterdvARB_names[] = - "iip\0" /* Parameter signature */ - "glGetProgramLocalParameterdvARB\0" - ""; -#endif - -#if defined(need_GL_EXT_histogram) -static const char GetHistogramParameteriv_names[] = - "iip\0" /* Parameter signature */ - "glGetHistogramParameteriv\0" - "glGetHistogramParameterivEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord1iARB_names[] = - "ii\0" /* Parameter signature */ - "glMultiTexCoord1i\0" - "glMultiTexCoord1iARB\0" - ""; -#endif - -#if defined(need_GL_EXT_convolution) -static const char GetConvolutionFilter_names[] = - "iiip\0" /* Parameter signature */ - "glGetConvolutionFilter\0" - "glGetConvolutionFilterEXT\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) -static const char GetProgramivARB_names[] = - "iip\0" /* Parameter signature */ - "glGetProgramivARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_blend_func_separate) || defined(need_GL_INGR_blend_func_separate) -static const char BlendFuncSeparateEXT_names[] = - "iiii\0" /* Parameter signature */ - "glBlendFuncSeparate\0" - "glBlendFuncSeparateEXT\0" - "glBlendFuncSeparateINGR\0" - ""; -#endif - -#if defined(need_GL_ARB_map_buffer_range) -static const char MapBufferRange_names[] = - "iiii\0" /* Parameter signature */ - "glMapBufferRange\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char ProgramParameters4dvNV_names[] = - "iiip\0" /* Parameter signature */ - "glProgramParameters4dvNV\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char TexCoord2fColor3fVertex3fvSUN_names[] = - "ppp\0" /* Parameter signature */ - "glTexCoord2fColor3fVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Binormal3dvEXT_names[] = - "p\0" /* Parameter signature */ - "glBinormal3dvEXT\0" - ""; -#endif - -#if defined(need_GL_NV_fence) -static const char FinishFenceNV_names[] = - "i\0" /* Parameter signature */ - "glFinishFenceNV\0" - ""; -#endif - -#if defined(need_GL_SGIS_fog_function) -static const char GetFogFuncSGIS_names[] = - "p\0" /* Parameter signature */ - "glGetFogFuncSGIS\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char GetUniformLocationARB_names[] = - "ip\0" /* Parameter signature */ - "glGetUniformLocation\0" - "glGetUniformLocationARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3fEXT_names[] = - "fff\0" /* Parameter signature */ - "glSecondaryColor3f\0" - "glSecondaryColor3fEXT\0" - ""; -#endif - -#if defined(need_GL_NV_register_combiners) -static const char CombinerInputNV_names[] = - "iiiiii\0" /* Parameter signature */ - "glCombinerInputNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib3sARB_names[] = - "iiii\0" /* Parameter signature */ - "glVertexAttrib3s\0" - "glVertexAttrib3sARB\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiNormal3fVertex3fvSUN_names[] = - "ppp\0" /* Parameter signature */ - "glReplacementCodeuiNormal3fVertex3fvSUN\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) -static const char ProgramStringARB_names[] = - "iiip\0" /* Parameter signature */ - "glProgramStringARB\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char TexCoord4fVertex4fvSUN_names[] = - "pp\0" /* Parameter signature */ - "glTexCoord4fVertex4fvSUN\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib3sNV_names[] = - "iiii\0" /* Parameter signature */ - "glVertexAttrib3sNV\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib1fNV_names[] = - "if\0" /* Parameter signature */ - "glVertexAttrib1fNV\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char FragmentLightfSGIX_names[] = - "iif\0" /* Parameter signature */ - "glFragmentLightfSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_texture_compression) -static const char GetCompressedTexImageARB_names[] = - "iip\0" /* Parameter signature */ - "glGetCompressedTexImage\0" - "glGetCompressedTexImageARB\0" - ""; -#endif - -#if defined(need_GL_EXT_vertex_weighting) -static const char VertexWeightPointerEXT_names[] = - "iiip\0" /* Parameter signature */ - "glVertexWeightPointerEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_histogram) -static const char GetHistogram_names[] = - "iiiip\0" /* Parameter signature */ - "glGetHistogram\0" - "glGetHistogramEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_stencil_two_side) -static const char ActiveStencilFaceEXT_names[] = - "i\0" /* Parameter signature */ - "glActiveStencilFaceEXT\0" - ""; -#endif - -#if defined(need_GL_ATI_separate_stencil) -static const char StencilFuncSeparateATI_names[] = - "iiii\0" /* Parameter signature */ - "glStencilFuncSeparateATI\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char GetShaderSourceARB_names[] = - "iipp\0" /* Parameter signature */ - "glGetShaderSource\0" - "glGetShaderSourceARB\0" - ""; -#endif - -#if defined(need_GL_SGIX_igloo_interface) -static const char IglooInterfaceSGIX_names[] = - "ip\0" /* Parameter signature */ - "glIglooInterfaceSGIX\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib4dNV_names[] = - "idddd\0" /* Parameter signature */ - "glVertexAttrib4dNV\0" - ""; -#endif - -#if defined(need_GL_IBM_multimode_draw_arrays) -static const char MultiModeDrawElementsIBM_names[] = - "ppipii\0" /* Parameter signature */ - "glMultiModeDrawElementsIBM\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord4svARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord4sv\0" - "glMultiTexCoord4svARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_occlusion_query) -static const char GenQueriesARB_names[] = - "ip\0" /* Parameter signature */ - "glGenQueries\0" - "glGenQueriesARB\0" - ""; -#endif - -#if defined(need_GL_SUN_vertex) -static const char ReplacementCodeuiVertex3fSUN_names[] = - "ifff\0" /* Parameter signature */ - "glReplacementCodeuiVertex3fSUN\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Tangent3iEXT_names[] = - "iii\0" /* Parameter signature */ - "glTangent3iEXT\0" - ""; -#endif - -#if defined(need_GL_SUN_mesh_array) -static const char DrawMeshArraysSUN_names[] = - "iiii\0" /* Parameter signature */ - "glDrawMeshArraysSUN\0" - ""; -#endif - -#if defined(need_GL_ARB_sync) -static const char IsSync_names[] = - "i\0" /* Parameter signature */ - "glIsSync\0" - ""; -#endif - -#if defined(need_GL_NV_evaluators) -static const char GetMapControlPointsNV_names[] = - "iiiiiip\0" /* Parameter signature */ - "glGetMapControlPointsNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_draw_buffers) || defined(need_GL_ATI_draw_buffers) -static const char DrawBuffersARB_names[] = - "ip\0" /* Parameter signature */ - "glDrawBuffers\0" - "glDrawBuffersARB\0" - "glDrawBuffersATI\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) -static const char ProgramLocalParameter4fARB_names[] = - "iiffff\0" /* Parameter signature */ - "glProgramLocalParameter4fARB\0" - ""; -#endif - -#if defined(need_GL_SGIX_sprite) -static const char SpriteParameterivSGIX_names[] = - "ip\0" /* Parameter signature */ - "glSpriteParameterivSGIX\0" - ""; -#endif - -#if defined(need_GL_EXT_provoking_vertex) || defined(need_GL_ARB_provoking_vertex) -static const char ProvokingVertexEXT_names[] = - "i\0" /* Parameter signature */ - "glProvokingVertexEXT\0" - "glProvokingVertex\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord1fARB_names[] = - "if\0" /* Parameter signature */ - "glMultiTexCoord1f\0" - "glMultiTexCoord1fARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttribs4ubvNV_names[] = - "iip\0" /* Parameter signature */ - "glVertexAttribs4ubvNV\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_blend) -static const char WeightsvARB_names[] = - "ip\0" /* Parameter signature */ - "glWeightsvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_shader_objects) -static const char Uniform1fvARB_names[] = - "iip\0" /* Parameter signature */ - "glUniform1fv\0" - "glUniform1fvARB\0" - ""; -#endif - -#if defined(need_GL_EXT_copy_texture) -static const char CopyTexSubImage1D_names[] = - "iiiiii\0" /* Parameter signature */ - "glCopyTexSubImage1D\0" - "glCopyTexSubImage1DEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_texture_object) -static const char BindTexture_names[] = - "ii\0" /* Parameter signature */ - "glBindTexture\0" - "glBindTextureEXT\0" - ""; -#endif - -#if defined(need_GL_ATI_fragment_shader) -static const char BeginFragmentShaderATI_names[] = - "\0" /* Parameter signature */ - "glBeginFragmentShaderATI\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord4fARB_names[] = - "iffff\0" /* Parameter signature */ - "glMultiTexCoord4f\0" - "glMultiTexCoord4fARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttribs3svNV_names[] = - "iip\0" /* Parameter signature */ - "glVertexAttribs3svNV\0" - ""; -#endif - -#if defined(need_GL_SUN_triangle_list) -static const char ReplacementCodeuivSUN_names[] = - "p\0" /* Parameter signature */ - "glReplacementCodeuivSUN\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char EnableVertexAttribArrayARB_names[] = - "i\0" /* Parameter signature */ - "glEnableVertexAttribArray\0" - "glEnableVertexAttribArrayARB\0" - ""; -#endif - -#if defined(need_GL_INTEL_parallel_arrays) -static const char NormalPointervINTEL_names[] = - "ip\0" /* Parameter signature */ - "glNormalPointervINTEL\0" - ""; -#endif - -#if defined(need_GL_EXT_convolution) -static const char CopyConvolutionFilter2D_names[] = - "iiiiii\0" /* Parameter signature */ - "glCopyConvolutionFilter2D\0" - "glCopyConvolutionFilter2DEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos3ivMESA_names[] = - "p\0" /* Parameter signature */ - "glWindowPos3iv\0" - "glWindowPos3ivARB\0" - "glWindowPos3ivMESA\0" - ""; -#endif - -#if defined(need_GL_ARB_copy_buffer) -static const char CopyBufferSubData_names[] = - "iiiii\0" /* Parameter signature */ - "glCopyBufferSubData\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) -static const char IsBufferARB_names[] = - "i\0" /* Parameter signature */ - "glIsBuffer\0" - "glIsBufferARB\0" - ""; -#endif - -#if defined(need_GL_MESA_window_pos) -static const char WindowPos4iMESA_names[] = - "iiii\0" /* Parameter signature */ - "glWindowPos4iMESA\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4uivARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4uiv\0" - "glVertexAttrib4uivARB\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Tangent3bvEXT_names[] = - "p\0" /* Parameter signature */ - "glTangent3bvEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_1) -static const char UniformMatrix3x4fv_names[] = - "iiip\0" /* Parameter signature */ - "glUniformMatrix3x4fv\0" - ""; -#endif - -#if defined(need_GL_ARB_draw_elements_base_vertex) -static const char DrawRangeElementsBaseVertex_names[] = - "iiiiipi\0" /* Parameter signature */ - "glDrawRangeElementsBaseVertex\0" - ""; -#endif - -#if defined(need_GL_INTEL_parallel_arrays) -static const char TexCoordPointervINTEL_names[] = - "iip\0" /* Parameter signature */ - "glTexCoordPointervINTEL\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) -static const char DeleteBuffersARB_names[] = - "ip\0" /* Parameter signature */ - "glDeleteBuffers\0" - "glDeleteBuffersARB\0" - ""; -#endif - -#if defined(need_GL_MESA_window_pos) -static const char WindowPos4fvMESA_names[] = - "p\0" /* Parameter signature */ - "glWindowPos4fvMESA\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib1sNV_names[] = - "ii\0" /* Parameter signature */ - "glVertexAttrib1sNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_secondary_color) -static const char SecondaryColor3svEXT_names[] = - "p\0" /* Parameter signature */ - "glSecondaryColor3sv\0" - "glSecondaryColor3svEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) || defined(need_GL_ARB_transpose_matrix) -static const char LoadTransposeMatrixfARB_names[] = - "p\0" /* Parameter signature */ - "glLoadTransposeMatrixf\0" - "glLoadTransposeMatrixfARB\0" - ""; -#endif - -#if defined(need_GL_EXT_vertex_array) -static const char GetPointerv_names[] = - "ip\0" /* Parameter signature */ - "glGetPointerv\0" - "glGetPointervEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Tangent3bEXT_names[] = - "iii\0" /* Parameter signature */ - "glTangent3bEXT\0" - ""; -#endif - -#if defined(need_GL_NV_register_combiners) -static const char CombinerParameterfNV_names[] = - "if\0" /* Parameter signature */ - "glCombinerParameterfNV\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) || defined(need_GL_NV_vertex_program) -static const char BindProgramNV_names[] = - "ii\0" /* Parameter signature */ - "glBindProgramARB\0" - "glBindProgramNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4svARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4sv\0" - "glVertexAttrib4svARB\0" - ""; -#endif - -#if defined(need_GL_MESA_shader_debug) -static const char CreateDebugObjectMESA_names[] = - "\0" /* Parameter signature */ - "glCreateDebugObjectMESA\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) -static const char GetShaderiv_names[] = - "iip\0" /* Parameter signature */ - "glGetShaderiv\0" - ""; -#endif - -#if defined(need_GL_ARB_sync) -static const char ClientWaitSync_names[] = - "iii\0" /* Parameter signature */ - "glClientWaitSync\0" - ""; -#endif - -#if defined(need_GL_ATI_fragment_shader) -static const char BindFragmentShaderATI_names[] = - "i\0" /* Parameter signature */ - "glBindFragmentShaderATI\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) -static const char UnmapBufferARB_names[] = - "i\0" /* Parameter signature */ - "glUnmapBuffer\0" - "glUnmapBufferARB\0" - ""; -#endif - -#if defined(need_GL_EXT_histogram) -static const char Minmax_names[] = - "iii\0" /* Parameter signature */ - "glMinmax\0" - "glMinmaxEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_EXT_fog_coord) -static const char FogCoorddvEXT_names[] = - "p\0" /* Parameter signature */ - "glFogCoorddv\0" - "glFogCoorddvEXT\0" - ""; -#endif - -#if defined(need_GL_SUNX_constant_data) -static const char FinishTextureSUNX_names[] = - "\0" /* Parameter signature */ - "glFinishTextureSUNX\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char GetFragmentLightfvSGIX_names[] = - "iip\0" /* Parameter signature */ - "glGetFragmentLightfvSGIX\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Binormal3fvEXT_names[] = - "p\0" /* Parameter signature */ - "glBinormal3fvEXT\0" - ""; -#endif - -#if defined(need_GL_ATI_fragment_shader) -static const char ColorFragmentOp3ATI_names[] = - "iiiiiiiiiiiii\0" /* Parameter signature */ - "glColorFragmentOp3ATI\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib2svARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib2sv\0" - "glVertexAttrib2svARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char AreProgramsResidentNV_names[] = - "ipp\0" /* Parameter signature */ - "glAreProgramsResidentNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos3svMESA_names[] = - "p\0" /* Parameter signature */ - "glWindowPos3sv\0" - "glWindowPos3svARB\0" - "glWindowPos3svMESA\0" - ""; -#endif - -#if defined(need_GL_EXT_color_subtable) -static const char CopyColorSubTable_names[] = - "iiiii\0" /* Parameter signature */ - "glCopyColorSubTable\0" - "glCopyColorSubTableEXT\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_blend) -static const char WeightdvARB_names[] = - "ip\0" /* Parameter signature */ - "glWeightdvARB\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char DeleteRenderbuffersEXT_names[] = - "ip\0" /* Parameter signature */ - "glDeleteRenderbuffers\0" - "glDeleteRenderbuffersEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib4NubvARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4Nubv\0" - "glVertexAttrib4NubvARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib3dvNV_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib3dvNV\0" - ""; -#endif - -#if defined(need_GL_ARB_shader_objects) -static const char GetObjectParameterfvARB_names[] = - "iip\0" /* Parameter signature */ - "glGetObjectParameterfvARB\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) -static const char GetProgramEnvParameterdvARB_names[] = - "iip\0" /* Parameter signature */ - "glGetProgramEnvParameterdvARB\0" - ""; -#endif - -#if defined(need_GL_EXT_compiled_vertex_array) -static const char LockArraysEXT_names[] = - "ii\0" /* Parameter signature */ - "glLockArraysEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_pixel_transform) -static const char PixelTransformParameterivEXT_names[] = - "iip\0" /* Parameter signature */ - "glPixelTransformParameterivEXT\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char BinormalPointerEXT_names[] = - "iip\0" /* Parameter signature */ - "glBinormalPointerEXT\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib1dNV_names[] = - "id\0" /* Parameter signature */ - "glVertexAttrib1dNV\0" - ""; -#endif - -#if defined(need_GL_NV_register_combiners) -static const char GetCombinerInputParameterivNV_names[] = - "iiiip\0" /* Parameter signature */ - "glGetCombinerInputParameterivNV\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_3) -static const char MultiTexCoord2fvARB_names[] = - "ip\0" /* Parameter signature */ - "glMultiTexCoord2fv\0" - "glMultiTexCoord2fvARB\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char GetRenderbufferParameterivEXT_names[] = - "iip\0" /* Parameter signature */ - "glGetRenderbufferParameteriv\0" - "glGetRenderbufferParameterivEXT\0" - ""; -#endif - -#if defined(need_GL_NV_register_combiners) -static const char CombinerParameterivNV_names[] = - "ip\0" /* Parameter signature */ - "glCombinerParameterivNV\0" - ""; -#endif - -#if defined(need_GL_ATI_fragment_shader) -static const char GenFragmentShadersATI_names[] = - "i\0" /* Parameter signature */ - "glGenFragmentShadersATI\0" - ""; -#endif - -#if defined(need_GL_EXT_vertex_array) -static const char DrawArrays_names[] = - "iii\0" /* Parameter signature */ - "glDrawArrays\0" - "glDrawArraysEXT\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_blend) -static const char WeightuivARB_names[] = - "ip\0" /* Parameter signature */ - "glWeightuivARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib2sARB_names[] = - "iii\0" /* Parameter signature */ - "glVertexAttrib2s\0" - "glVertexAttrib2sARB\0" - ""; -#endif - -#if defined(need_GL_SGIX_async) -static const char GenAsyncMarkersSGIX_names[] = - "i\0" /* Parameter signature */ - "glGenAsyncMarkersSGIX\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Tangent3svEXT_names[] = - "p\0" /* Parameter signature */ - "glTangent3svEXT\0" - ""; -#endif - -#if defined(need_GL_SGIX_list_priority) -static const char GetListParameterivSGIX_names[] = - "iip\0" /* Parameter signature */ - "glGetListParameterivSGIX\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) -static const char BindBufferARB_names[] = - "ii\0" /* Parameter signature */ - "glBindBuffer\0" - "glBindBufferARB\0" - ""; -#endif - -#if defined(need_GL_ARB_shader_objects) -static const char GetInfoLogARB_names[] = - "iipp\0" /* Parameter signature */ - "glGetInfoLogARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttribs4svNV_names[] = - "iip\0" /* Parameter signature */ - "glVertexAttribs4svNV\0" - ""; -#endif - -#if defined(need_GL_IBM_vertex_array_lists) -static const char EdgeFlagPointerListIBM_names[] = - "ipi\0" /* Parameter signature */ - "glEdgeFlagPointerListIBM\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_1) -static const char UniformMatrix3x2fv_names[] = - "iiip\0" /* Parameter signature */ - "glUniformMatrix3x2fv\0" - ""; -#endif - -#if defined(need_GL_EXT_histogram) -static const char GetMinmaxParameterfv_names[] = - "iip\0" /* Parameter signature */ - "glGetMinmaxParameterfv\0" - "glGetMinmaxParameterfvEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_2_0) || defined(need_GL_ARB_vertex_program) -static const char VertexAttrib1fvARB_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib1fv\0" - "glVertexAttrib1fvARB\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_5) || defined(need_GL_ARB_vertex_buffer_object) -static const char GenBuffersARB_names[] = - "ip\0" /* Parameter signature */ - "glGenBuffers\0" - "glGenBuffersARB\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttribs1svNV_names[] = - "iip\0" /* Parameter signature */ - "glVertexAttribs1svNV\0" - ""; -#endif - -#if defined(need_GL_ATI_envmap_bumpmap) -static const char GetTexBumpParameterivATI_names[] = - "ip\0" /* Parameter signature */ - "glGetTexBumpParameterivATI\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Binormal3bEXT_names[] = - "iii\0" /* Parameter signature */ - "glBinormal3bEXT\0" - ""; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const char FragmentMaterialivSGIX_names[] = - "iip\0" /* Parameter signature */ - "glFragmentMaterialivSGIX\0" - ""; -#endif - -#if defined(need_GL_ARB_framebuffer_object) || defined(need_GL_EXT_framebuffer_object) -static const char IsRenderbufferEXT_names[] = - "i\0" /* Parameter signature */ - "glIsRenderbuffer\0" - "glIsRenderbufferEXT\0" - ""; -#endif - -#if defined(need_GL_ARB_vertex_program) || defined(need_GL_NV_vertex_program) -static const char GenProgramsNV_names[] = - "ip\0" /* Parameter signature */ - "glGenProgramsARB\0" - "glGenProgramsNV\0" - ""; -#endif - -#if defined(need_GL_NV_vertex_program) -static const char VertexAttrib4dvNV_names[] = - "ip\0" /* Parameter signature */ - "glVertexAttrib4dvNV\0" - ""; -#endif - -#if defined(need_GL_ATI_fragment_shader) -static const char EndFragmentShaderATI_names[] = - "\0" /* Parameter signature */ - "glEndFragmentShaderATI\0" - ""; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const char Binormal3iEXT_names[] = - "iii\0" /* Parameter signature */ - "glBinormal3iEXT\0" - ""; -#endif - -#if defined(need_GL_VERSION_1_4) || defined(need_GL_ARB_window_pos) || defined(need_GL_MESA_window_pos) -static const char WindowPos2fMESA_names[] = - "ff\0" /* Parameter signature */ - "glWindowPos2f\0" - "glWindowPos2fARB\0" - "glWindowPos2fMESA\0" - ""; -#endif - -#if defined(need_GL_3DFX_tbuffer) -static const struct dri_extension_function GL_3DFX_tbuffer_functions[] = { - { TbufferMask3DFX_names, TbufferMask3DFX_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_APPLE_flush_buffer_range) -static const struct dri_extension_function GL_APPLE_flush_buffer_range_functions[] = { - { BufferParameteriAPPLE_names, BufferParameteriAPPLE_remap_index, -1 }, - { FlushMappedBufferRangeAPPLE_names, FlushMappedBufferRangeAPPLE_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_APPLE_texture_range) -static const struct dri_extension_function GL_APPLE_texture_range_functions[] = { - { TextureRangeAPPLE_names, TextureRangeAPPLE_remap_index, -1 }, - { GetTexParameterPointervAPPLE_names, GetTexParameterPointervAPPLE_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_APPLE_vertex_array_object) -static const struct dri_extension_function GL_APPLE_vertex_array_object_functions[] = { - { DeleteVertexArraysAPPLE_names, DeleteVertexArraysAPPLE_remap_index, -1 }, - { GenVertexArraysAPPLE_names, GenVertexArraysAPPLE_remap_index, -1 }, - { IsVertexArrayAPPLE_names, IsVertexArrayAPPLE_remap_index, -1 }, - { BindVertexArrayAPPLE_names, BindVertexArrayAPPLE_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_copy_buffer) -static const struct dri_extension_function GL_ARB_copy_buffer_functions[] = { - { CopyBufferSubData_names, CopyBufferSubData_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_draw_buffers) -static const struct dri_extension_function GL_ARB_draw_buffers_functions[] = { - { DrawBuffersARB_names, DrawBuffersARB_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_draw_elements_base_vertex) -static const struct dri_extension_function GL_ARB_draw_elements_base_vertex_functions[] = { - { DrawElementsBaseVertex_names, DrawElementsBaseVertex_remap_index, -1 }, - { MultiDrawElementsBaseVertex_names, MultiDrawElementsBaseVertex_remap_index, -1 }, - { DrawRangeElementsBaseVertex_names, DrawRangeElementsBaseVertex_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_framebuffer_object) -static const struct dri_extension_function GL_ARB_framebuffer_object_functions[] = { - { BlitFramebufferEXT_names, BlitFramebufferEXT_remap_index, -1 }, - { FramebufferTextureLayerEXT_names, FramebufferTextureLayerEXT_remap_index, -1 }, - { GenerateMipmapEXT_names, GenerateMipmapEXT_remap_index, -1 }, - { RenderbufferStorageEXT_names, RenderbufferStorageEXT_remap_index, -1 }, - { CheckFramebufferStatusEXT_names, CheckFramebufferStatusEXT_remap_index, -1 }, - { FramebufferTexture3DEXT_names, FramebufferTexture3DEXT_remap_index, -1 }, - { FramebufferTexture2DEXT_names, FramebufferTexture2DEXT_remap_index, -1 }, - { RenderbufferStorageMultisample_names, RenderbufferStorageMultisample_remap_index, -1 }, - { FramebufferRenderbufferEXT_names, FramebufferRenderbufferEXT_remap_index, -1 }, - { FramebufferTexture1DEXT_names, FramebufferTexture1DEXT_remap_index, -1 }, - { BindFramebufferEXT_names, BindFramebufferEXT_remap_index, -1 }, - { GenRenderbuffersEXT_names, GenRenderbuffersEXT_remap_index, -1 }, - { IsFramebufferEXT_names, IsFramebufferEXT_remap_index, -1 }, - { GetFramebufferAttachmentParameterivEXT_names, GetFramebufferAttachmentParameterivEXT_remap_index, -1 }, - { DeleteFramebuffersEXT_names, DeleteFramebuffersEXT_remap_index, -1 }, - { GenFramebuffersEXT_names, GenFramebuffersEXT_remap_index, -1 }, - { BindRenderbufferEXT_names, BindRenderbufferEXT_remap_index, -1 }, - { DeleteRenderbuffersEXT_names, DeleteRenderbuffersEXT_remap_index, -1 }, - { GetRenderbufferParameterivEXT_names, GetRenderbufferParameterivEXT_remap_index, -1 }, - { IsRenderbufferEXT_names, IsRenderbufferEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_map_buffer_range) -static const struct dri_extension_function GL_ARB_map_buffer_range_functions[] = { - { FlushMappedBufferRange_names, FlushMappedBufferRange_remap_index, -1 }, - { MapBufferRange_names, MapBufferRange_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_matrix_palette) -static const struct dri_extension_function GL_ARB_matrix_palette_functions[] = { - { MatrixIndexusvARB_names, MatrixIndexusvARB_remap_index, -1 }, - { MatrixIndexuivARB_names, MatrixIndexuivARB_remap_index, -1 }, - { MatrixIndexPointerARB_names, MatrixIndexPointerARB_remap_index, -1 }, - { CurrentPaletteMatrixARB_names, CurrentPaletteMatrixARB_remap_index, -1 }, - { MatrixIndexubvARB_names, MatrixIndexubvARB_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_multisample) -static const struct dri_extension_function GL_ARB_multisample_functions[] = { - { SampleCoverageARB_names, SampleCoverageARB_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_occlusion_query) -static const struct dri_extension_function GL_ARB_occlusion_query_functions[] = { - { BeginQueryARB_names, BeginQueryARB_remap_index, -1 }, - { GetQueryivARB_names, GetQueryivARB_remap_index, -1 }, - { GetQueryObjectivARB_names, GetQueryObjectivARB_remap_index, -1 }, - { EndQueryARB_names, EndQueryARB_remap_index, -1 }, - { GetQueryObjectuivARB_names, GetQueryObjectuivARB_remap_index, -1 }, - { DeleteQueriesARB_names, DeleteQueriesARB_remap_index, -1 }, - { IsQueryARB_names, IsQueryARB_remap_index, -1 }, - { GenQueriesARB_names, GenQueriesARB_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_point_parameters) -static const struct dri_extension_function GL_ARB_point_parameters_functions[] = { - { PointParameterfEXT_names, PointParameterfEXT_remap_index, -1 }, - { PointParameterfvEXT_names, PointParameterfvEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_provoking_vertex) -static const struct dri_extension_function GL_ARB_provoking_vertex_functions[] = { - { ProvokingVertexEXT_names, ProvokingVertexEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_shader_objects) -static const struct dri_extension_function GL_ARB_shader_objects_functions[] = { - { UniformMatrix3fvARB_names, UniformMatrix3fvARB_remap_index, -1 }, - { Uniform2fARB_names, Uniform2fARB_remap_index, -1 }, - { Uniform2ivARB_names, Uniform2ivARB_remap_index, -1 }, - { UniformMatrix4fvARB_names, UniformMatrix4fvARB_remap_index, -1 }, - { CreateProgramObjectARB_names, CreateProgramObjectARB_remap_index, -1 }, - { Uniform3iARB_names, Uniform3iARB_remap_index, -1 }, - { CreateShaderObjectARB_names, CreateShaderObjectARB_remap_index, -1 }, - { Uniform1fARB_names, Uniform1fARB_remap_index, -1 }, - { AttachObjectARB_names, AttachObjectARB_remap_index, -1 }, - { UniformMatrix2fvARB_names, UniformMatrix2fvARB_remap_index, -1 }, - { GetAttachedObjectsARB_names, GetAttachedObjectsARB_remap_index, -1 }, - { Uniform3fvARB_names, Uniform3fvARB_remap_index, -1 }, - { GetHandleARB_names, GetHandleARB_remap_index, -1 }, - { GetActiveUniformARB_names, GetActiveUniformARB_remap_index, -1 }, - { GetUniformivARB_names, GetUniformivARB_remap_index, -1 }, - { Uniform2fvARB_names, Uniform2fvARB_remap_index, -1 }, - { DeleteObjectARB_names, DeleteObjectARB_remap_index, -1 }, - { ValidateProgramARB_names, ValidateProgramARB_remap_index, -1 }, - { Uniform3ivARB_names, Uniform3ivARB_remap_index, -1 }, - { CompileShaderARB_names, CompileShaderARB_remap_index, -1 }, - { Uniform3fARB_names, Uniform3fARB_remap_index, -1 }, - { Uniform4fARB_names, Uniform4fARB_remap_index, -1 }, - { LinkProgramARB_names, LinkProgramARB_remap_index, -1 }, - { ShaderSourceARB_names, ShaderSourceARB_remap_index, -1 }, - { Uniform4ivARB_names, Uniform4ivARB_remap_index, -1 }, - { Uniform1ivARB_names, Uniform1ivARB_remap_index, -1 }, - { Uniform1iARB_names, Uniform1iARB_remap_index, -1 }, - { Uniform4fvARB_names, Uniform4fvARB_remap_index, -1 }, - { GetUniformfvARB_names, GetUniformfvARB_remap_index, -1 }, - { DetachObjectARB_names, DetachObjectARB_remap_index, -1 }, - { Uniform4iARB_names, Uniform4iARB_remap_index, -1 }, - { UseProgramObjectARB_names, UseProgramObjectARB_remap_index, -1 }, - { Uniform2iARB_names, Uniform2iARB_remap_index, -1 }, - { GetObjectParameterivARB_names, GetObjectParameterivARB_remap_index, -1 }, - { GetUniformLocationARB_names, GetUniformLocationARB_remap_index, -1 }, - { GetShaderSourceARB_names, GetShaderSourceARB_remap_index, -1 }, - { Uniform1fvARB_names, Uniform1fvARB_remap_index, -1 }, - { GetObjectParameterfvARB_names, GetObjectParameterfvARB_remap_index, -1 }, - { GetInfoLogARB_names, GetInfoLogARB_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_sync) -static const struct dri_extension_function GL_ARB_sync_functions[] = { - { DeleteSync_names, DeleteSync_remap_index, -1 }, - { FenceSync_names, FenceSync_remap_index, -1 }, - { WaitSync_names, WaitSync_remap_index, -1 }, - { GetInteger64v_names, GetInteger64v_remap_index, -1 }, - { GetSynciv_names, GetSynciv_remap_index, -1 }, - { IsSync_names, IsSync_remap_index, -1 }, - { ClientWaitSync_names, ClientWaitSync_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_texture_compression) -static const struct dri_extension_function GL_ARB_texture_compression_functions[] = { - { CompressedTexSubImage2DARB_names, CompressedTexSubImage2DARB_remap_index, -1 }, - { CompressedTexImage3DARB_names, CompressedTexImage3DARB_remap_index, -1 }, - { CompressedTexImage1DARB_names, CompressedTexImage1DARB_remap_index, -1 }, - { CompressedTexSubImage1DARB_names, CompressedTexSubImage1DARB_remap_index, -1 }, - { CompressedTexSubImage3DARB_names, CompressedTexSubImage3DARB_remap_index, -1 }, - { CompressedTexImage2DARB_names, CompressedTexImage2DARB_remap_index, -1 }, - { GetCompressedTexImageARB_names, GetCompressedTexImageARB_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_transpose_matrix) -static const struct dri_extension_function GL_ARB_transpose_matrix_functions[] = { - { MultTransposeMatrixdARB_names, MultTransposeMatrixdARB_remap_index, -1 }, - { LoadTransposeMatrixdARB_names, LoadTransposeMatrixdARB_remap_index, -1 }, - { MultTransposeMatrixfARB_names, MultTransposeMatrixfARB_remap_index, -1 }, - { LoadTransposeMatrixfARB_names, LoadTransposeMatrixfARB_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_vertex_array_object) -static const struct dri_extension_function GL_ARB_vertex_array_object_functions[] = { - { DeleteVertexArraysAPPLE_names, DeleteVertexArraysAPPLE_remap_index, -1 }, - { GenVertexArrays_names, GenVertexArrays_remap_index, -1 }, - { BindVertexArray_names, BindVertexArray_remap_index, -1 }, - { IsVertexArrayAPPLE_names, IsVertexArrayAPPLE_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_vertex_blend) -static const struct dri_extension_function GL_ARB_vertex_blend_functions[] = { - { WeightubvARB_names, WeightubvARB_remap_index, -1 }, - { WeightivARB_names, WeightivARB_remap_index, -1 }, - { WeightPointerARB_names, WeightPointerARB_remap_index, -1 }, - { WeightfvARB_names, WeightfvARB_remap_index, -1 }, - { WeightbvARB_names, WeightbvARB_remap_index, -1 }, - { WeightusvARB_names, WeightusvARB_remap_index, -1 }, - { VertexBlendARB_names, VertexBlendARB_remap_index, -1 }, - { WeightsvARB_names, WeightsvARB_remap_index, -1 }, - { WeightdvARB_names, WeightdvARB_remap_index, -1 }, - { WeightuivARB_names, WeightuivARB_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_vertex_buffer_object) -static const struct dri_extension_function GL_ARB_vertex_buffer_object_functions[] = { - { GetBufferSubDataARB_names, GetBufferSubDataARB_remap_index, -1 }, - { BufferSubDataARB_names, BufferSubDataARB_remap_index, -1 }, - { BufferDataARB_names, BufferDataARB_remap_index, -1 }, - { GetBufferPointervARB_names, GetBufferPointervARB_remap_index, -1 }, - { GetBufferParameterivARB_names, GetBufferParameterivARB_remap_index, -1 }, - { MapBufferARB_names, MapBufferARB_remap_index, -1 }, - { IsBufferARB_names, IsBufferARB_remap_index, -1 }, - { DeleteBuffersARB_names, DeleteBuffersARB_remap_index, -1 }, - { UnmapBufferARB_names, UnmapBufferARB_remap_index, -1 }, - { BindBufferARB_names, BindBufferARB_remap_index, -1 }, - { GenBuffersARB_names, GenBuffersARB_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_vertex_program) -static const struct dri_extension_function GL_ARB_vertex_program_functions[] = { - { VertexAttrib2fARB_names, VertexAttrib2fARB_remap_index, -1 }, - { VertexAttrib3fARB_names, VertexAttrib3fARB_remap_index, -1 }, - { VertexAttrib1svARB_names, VertexAttrib1svARB_remap_index, -1 }, - { VertexAttrib4NusvARB_names, VertexAttrib4NusvARB_remap_index, -1 }, - { DisableVertexAttribArrayARB_names, DisableVertexAttribArrayARB_remap_index, -1 }, - { ProgramLocalParameter4dARB_names, ProgramLocalParameter4dARB_remap_index, -1 }, - { VertexAttrib1fARB_names, VertexAttrib1fARB_remap_index, -1 }, - { VertexAttrib4NbvARB_names, VertexAttrib4NbvARB_remap_index, -1 }, - { VertexAttrib1sARB_names, VertexAttrib1sARB_remap_index, -1 }, - { GetProgramLocalParameterfvARB_names, GetProgramLocalParameterfvARB_remap_index, -1 }, - { VertexAttrib3dvARB_names, VertexAttrib3dvARB_remap_index, -1 }, - { ProgramEnvParameter4fvARB_names, ProgramEnvParameter4fvARB_remap_index, -1 }, - { GetVertexAttribivARB_names, GetVertexAttribivARB_remap_index, -1 }, - { VertexAttrib4ivARB_names, VertexAttrib4ivARB_remap_index, -1 }, - { VertexAttrib4bvARB_names, VertexAttrib4bvARB_remap_index, -1 }, - { VertexAttrib3dARB_names, VertexAttrib3dARB_remap_index, -1 }, - { VertexAttrib4fARB_names, VertexAttrib4fARB_remap_index, -1 }, - { VertexAttrib4fvARB_names, VertexAttrib4fvARB_remap_index, -1 }, - { ProgramLocalParameter4dvARB_names, ProgramLocalParameter4dvARB_remap_index, -1 }, - { VertexAttrib2dARB_names, VertexAttrib2dARB_remap_index, -1 }, - { VertexAttrib1dvARB_names, VertexAttrib1dvARB_remap_index, -1 }, - { GetVertexAttribfvARB_names, GetVertexAttribfvARB_remap_index, -1 }, - { VertexAttrib4ubvARB_names, VertexAttrib4ubvARB_remap_index, -1 }, - { ProgramEnvParameter4fARB_names, ProgramEnvParameter4fARB_remap_index, -1 }, - { VertexAttrib4sARB_names, VertexAttrib4sARB_remap_index, -1 }, - { VertexAttrib2dvARB_names, VertexAttrib2dvARB_remap_index, -1 }, - { VertexAttrib2fvARB_names, VertexAttrib2fvARB_remap_index, -1 }, - { VertexAttrib4NivARB_names, VertexAttrib4NivARB_remap_index, -1 }, - { GetProgramStringARB_names, GetProgramStringARB_remap_index, -1 }, - { VertexAttrib4NuivARB_names, VertexAttrib4NuivARB_remap_index, -1 }, - { IsProgramNV_names, IsProgramNV_remap_index, -1 }, - { ProgramEnvParameter4dARB_names, ProgramEnvParameter4dARB_remap_index, -1 }, - { VertexAttrib1dARB_names, VertexAttrib1dARB_remap_index, -1 }, - { VertexAttrib4usvARB_names, VertexAttrib4usvARB_remap_index, -1 }, - { VertexAttrib3svARB_names, VertexAttrib3svARB_remap_index, -1 }, - { GetVertexAttribdvARB_names, GetVertexAttribdvARB_remap_index, -1 }, - { VertexAttrib4dvARB_names, VertexAttrib4dvARB_remap_index, -1 }, - { VertexAttribPointerARB_names, VertexAttribPointerARB_remap_index, -1 }, - { VertexAttrib4NsvARB_names, VertexAttrib4NsvARB_remap_index, -1 }, - { VertexAttrib3fvARB_names, VertexAttrib3fvARB_remap_index, -1 }, - { VertexAttrib4NubARB_names, VertexAttrib4NubARB_remap_index, -1 }, - { GetProgramEnvParameterfvARB_names, GetProgramEnvParameterfvARB_remap_index, -1 }, - { ProgramEnvParameter4dvARB_names, ProgramEnvParameter4dvARB_remap_index, -1 }, - { ProgramLocalParameter4fvARB_names, ProgramLocalParameter4fvARB_remap_index, -1 }, - { DeleteProgramsNV_names, DeleteProgramsNV_remap_index, -1 }, - { GetVertexAttribPointervNV_names, GetVertexAttribPointervNV_remap_index, -1 }, - { VertexAttrib4dARB_names, VertexAttrib4dARB_remap_index, -1 }, - { GetProgramLocalParameterdvARB_names, GetProgramLocalParameterdvARB_remap_index, -1 }, - { GetProgramivARB_names, GetProgramivARB_remap_index, -1 }, - { VertexAttrib3sARB_names, VertexAttrib3sARB_remap_index, -1 }, - { ProgramStringARB_names, ProgramStringARB_remap_index, -1 }, - { ProgramLocalParameter4fARB_names, ProgramLocalParameter4fARB_remap_index, -1 }, - { EnableVertexAttribArrayARB_names, EnableVertexAttribArrayARB_remap_index, -1 }, - { VertexAttrib4uivARB_names, VertexAttrib4uivARB_remap_index, -1 }, - { BindProgramNV_names, BindProgramNV_remap_index, -1 }, - { VertexAttrib4svARB_names, VertexAttrib4svARB_remap_index, -1 }, - { VertexAttrib2svARB_names, VertexAttrib2svARB_remap_index, -1 }, - { VertexAttrib4NubvARB_names, VertexAttrib4NubvARB_remap_index, -1 }, - { GetProgramEnvParameterdvARB_names, GetProgramEnvParameterdvARB_remap_index, -1 }, - { VertexAttrib2sARB_names, VertexAttrib2sARB_remap_index, -1 }, - { VertexAttrib1fvARB_names, VertexAttrib1fvARB_remap_index, -1 }, - { GenProgramsNV_names, GenProgramsNV_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_vertex_shader) -static const struct dri_extension_function GL_ARB_vertex_shader_functions[] = { - { GetActiveAttribARB_names, GetActiveAttribARB_remap_index, -1 }, - { GetAttribLocationARB_names, GetAttribLocationARB_remap_index, -1 }, - { BindAttribLocationARB_names, BindAttribLocationARB_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ARB_window_pos) -static const struct dri_extension_function GL_ARB_window_pos_functions[] = { - { WindowPos3fMESA_names, WindowPos3fMESA_remap_index, -1 }, - { WindowPos2dvMESA_names, WindowPos2dvMESA_remap_index, -1 }, - { WindowPos2svMESA_names, WindowPos2svMESA_remap_index, -1 }, - { WindowPos3dMESA_names, WindowPos3dMESA_remap_index, -1 }, - { WindowPos2fvMESA_names, WindowPos2fvMESA_remap_index, -1 }, - { WindowPos2dMESA_names, WindowPos2dMESA_remap_index, -1 }, - { WindowPos3dvMESA_names, WindowPos3dvMESA_remap_index, -1 }, - { WindowPos3fvMESA_names, WindowPos3fvMESA_remap_index, -1 }, - { WindowPos2iMESA_names, WindowPos2iMESA_remap_index, -1 }, - { WindowPos3sMESA_names, WindowPos3sMESA_remap_index, -1 }, - { WindowPos2ivMESA_names, WindowPos2ivMESA_remap_index, -1 }, - { WindowPos2sMESA_names, WindowPos2sMESA_remap_index, -1 }, - { WindowPos3iMESA_names, WindowPos3iMESA_remap_index, -1 }, - { WindowPos3ivMESA_names, WindowPos3ivMESA_remap_index, -1 }, - { WindowPos3svMESA_names, WindowPos3svMESA_remap_index, -1 }, - { WindowPos2fMESA_names, WindowPos2fMESA_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ATI_blend_equation_separate) -static const struct dri_extension_function GL_ATI_blend_equation_separate_functions[] = { - { BlendEquationSeparateEXT_names, BlendEquationSeparateEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ATI_draw_buffers) -static const struct dri_extension_function GL_ATI_draw_buffers_functions[] = { - { DrawBuffersARB_names, DrawBuffersARB_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ATI_envmap_bumpmap) -static const struct dri_extension_function GL_ATI_envmap_bumpmap_functions[] = { - { TexBumpParameterfvATI_names, TexBumpParameterfvATI_remap_index, -1 }, - { TexBumpParameterivATI_names, TexBumpParameterivATI_remap_index, -1 }, - { GetTexBumpParameterfvATI_names, GetTexBumpParameterfvATI_remap_index, -1 }, - { GetTexBumpParameterivATI_names, GetTexBumpParameterivATI_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ATI_fragment_shader) -static const struct dri_extension_function GL_ATI_fragment_shader_functions[] = { - { ColorFragmentOp2ATI_names, ColorFragmentOp2ATI_remap_index, -1 }, - { DeleteFragmentShaderATI_names, DeleteFragmentShaderATI_remap_index, -1 }, - { SetFragmentShaderConstantATI_names, SetFragmentShaderConstantATI_remap_index, -1 }, - { SampleMapATI_names, SampleMapATI_remap_index, -1 }, - { AlphaFragmentOp2ATI_names, AlphaFragmentOp2ATI_remap_index, -1 }, - { AlphaFragmentOp1ATI_names, AlphaFragmentOp1ATI_remap_index, -1 }, - { ColorFragmentOp1ATI_names, ColorFragmentOp1ATI_remap_index, -1 }, - { AlphaFragmentOp3ATI_names, AlphaFragmentOp3ATI_remap_index, -1 }, - { PassTexCoordATI_names, PassTexCoordATI_remap_index, -1 }, - { BeginFragmentShaderATI_names, BeginFragmentShaderATI_remap_index, -1 }, - { BindFragmentShaderATI_names, BindFragmentShaderATI_remap_index, -1 }, - { ColorFragmentOp3ATI_names, ColorFragmentOp3ATI_remap_index, -1 }, - { GenFragmentShadersATI_names, GenFragmentShadersATI_remap_index, -1 }, - { EndFragmentShaderATI_names, EndFragmentShaderATI_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_ATI_separate_stencil) -static const struct dri_extension_function GL_ATI_separate_stencil_functions[] = { - { StencilOpSeparate_names, StencilOpSeparate_remap_index, -1 }, - { StencilFuncSeparateATI_names, StencilFuncSeparateATI_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_blend_color) -static const struct dri_extension_function GL_EXT_blend_color_functions[] = { - { BlendColor_names, -1, 336 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_blend_equation_separate) -static const struct dri_extension_function GL_EXT_blend_equation_separate_functions[] = { - { BlendEquationSeparateEXT_names, BlendEquationSeparateEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_blend_func_separate) -static const struct dri_extension_function GL_EXT_blend_func_separate_functions[] = { - { BlendFuncSeparateEXT_names, BlendFuncSeparateEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_blend_minmax) -static const struct dri_extension_function GL_EXT_blend_minmax_functions[] = { - { BlendEquation_names, -1, 337 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_color_subtable) -static const struct dri_extension_function GL_EXT_color_subtable_functions[] = { - { ColorSubTable_names, -1, 346 }, - { CopyColorSubTable_names, -1, 347 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_compiled_vertex_array) -static const struct dri_extension_function GL_EXT_compiled_vertex_array_functions[] = { - { UnlockArraysEXT_names, UnlockArraysEXT_remap_index, -1 }, - { LockArraysEXT_names, LockArraysEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_convolution) -static const struct dri_extension_function GL_EXT_convolution_functions[] = { - { ConvolutionFilter1D_names, -1, 348 }, - { CopyConvolutionFilter1D_names, -1, 354 }, - { GetConvolutionParameteriv_names, -1, 358 }, - { ConvolutionFilter2D_names, -1, 349 }, - { ConvolutionParameteriv_names, -1, 353 }, - { ConvolutionParameterfv_names, -1, 351 }, - { GetSeparableFilter_names, -1, 359 }, - { SeparableFilter2D_names, -1, 360 }, - { ConvolutionParameteri_names, -1, 352 }, - { ConvolutionParameterf_names, -1, 350 }, - { GetConvolutionParameterfv_names, -1, 357 }, - { GetConvolutionFilter_names, -1, 356 }, - { CopyConvolutionFilter2D_names, -1, 355 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_coordinate_frame) -static const struct dri_extension_function GL_EXT_coordinate_frame_functions[] = { - { TangentPointerEXT_names, TangentPointerEXT_remap_index, -1 }, - { Binormal3ivEXT_names, Binormal3ivEXT_remap_index, -1 }, - { Tangent3sEXT_names, Tangent3sEXT_remap_index, -1 }, - { Tangent3fvEXT_names, Tangent3fvEXT_remap_index, -1 }, - { Tangent3dvEXT_names, Tangent3dvEXT_remap_index, -1 }, - { Binormal3bvEXT_names, Binormal3bvEXT_remap_index, -1 }, - { Binormal3dEXT_names, Binormal3dEXT_remap_index, -1 }, - { Tangent3fEXT_names, Tangent3fEXT_remap_index, -1 }, - { Binormal3sEXT_names, Binormal3sEXT_remap_index, -1 }, - { Tangent3ivEXT_names, Tangent3ivEXT_remap_index, -1 }, - { Tangent3dEXT_names, Tangent3dEXT_remap_index, -1 }, - { Binormal3svEXT_names, Binormal3svEXT_remap_index, -1 }, - { Binormal3fEXT_names, Binormal3fEXT_remap_index, -1 }, - { Binormal3dvEXT_names, Binormal3dvEXT_remap_index, -1 }, - { Tangent3iEXT_names, Tangent3iEXT_remap_index, -1 }, - { Tangent3bvEXT_names, Tangent3bvEXT_remap_index, -1 }, - { Tangent3bEXT_names, Tangent3bEXT_remap_index, -1 }, - { Binormal3fvEXT_names, Binormal3fvEXT_remap_index, -1 }, - { BinormalPointerEXT_names, BinormalPointerEXT_remap_index, -1 }, - { Tangent3svEXT_names, Tangent3svEXT_remap_index, -1 }, - { Binormal3bEXT_names, Binormal3bEXT_remap_index, -1 }, - { Binormal3iEXT_names, Binormal3iEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_copy_texture) -static const struct dri_extension_function GL_EXT_copy_texture_functions[] = { - { CopyTexSubImage3D_names, -1, 373 }, - { CopyTexImage2D_names, -1, 324 }, - { CopyTexImage1D_names, -1, 323 }, - { CopyTexSubImage2D_names, -1, 326 }, - { CopyTexSubImage1D_names, -1, 325 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_cull_vertex) -static const struct dri_extension_function GL_EXT_cull_vertex_functions[] = { - { CullParameterdvEXT_names, CullParameterdvEXT_remap_index, -1 }, - { CullParameterfvEXT_names, CullParameterfvEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_depth_bounds_test) -static const struct dri_extension_function GL_EXT_depth_bounds_test_functions[] = { - { DepthBoundsEXT_names, DepthBoundsEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_draw_range_elements) -static const struct dri_extension_function GL_EXT_draw_range_elements_functions[] = { - { DrawRangeElements_names, -1, 338 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_fog_coord) -static const struct dri_extension_function GL_EXT_fog_coord_functions[] = { - { FogCoorddEXT_names, FogCoorddEXT_remap_index, -1 }, - { FogCoordfEXT_names, FogCoordfEXT_remap_index, -1 }, - { FogCoordPointerEXT_names, FogCoordPointerEXT_remap_index, -1 }, - { FogCoordfvEXT_names, FogCoordfvEXT_remap_index, -1 }, - { FogCoorddvEXT_names, FogCoorddvEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_framebuffer_blit) -static const struct dri_extension_function GL_EXT_framebuffer_blit_functions[] = { - { BlitFramebufferEXT_names, BlitFramebufferEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_framebuffer_object) -static const struct dri_extension_function GL_EXT_framebuffer_object_functions[] = { - { GenerateMipmapEXT_names, GenerateMipmapEXT_remap_index, -1 }, - { RenderbufferStorageEXT_names, RenderbufferStorageEXT_remap_index, -1 }, - { CheckFramebufferStatusEXT_names, CheckFramebufferStatusEXT_remap_index, -1 }, - { FramebufferTexture3DEXT_names, FramebufferTexture3DEXT_remap_index, -1 }, - { FramebufferTexture2DEXT_names, FramebufferTexture2DEXT_remap_index, -1 }, - { FramebufferRenderbufferEXT_names, FramebufferRenderbufferEXT_remap_index, -1 }, - { FramebufferTexture1DEXT_names, FramebufferTexture1DEXT_remap_index, -1 }, - { BindFramebufferEXT_names, BindFramebufferEXT_remap_index, -1 }, - { GenRenderbuffersEXT_names, GenRenderbuffersEXT_remap_index, -1 }, - { IsFramebufferEXT_names, IsFramebufferEXT_remap_index, -1 }, - { GetFramebufferAttachmentParameterivEXT_names, GetFramebufferAttachmentParameterivEXT_remap_index, -1 }, - { DeleteFramebuffersEXT_names, DeleteFramebuffersEXT_remap_index, -1 }, - { GenFramebuffersEXT_names, GenFramebuffersEXT_remap_index, -1 }, - { BindRenderbufferEXT_names, BindRenderbufferEXT_remap_index, -1 }, - { DeleteRenderbuffersEXT_names, DeleteRenderbuffersEXT_remap_index, -1 }, - { GetRenderbufferParameterivEXT_names, GetRenderbufferParameterivEXT_remap_index, -1 }, - { IsRenderbufferEXT_names, IsRenderbufferEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_gpu_program_parameters) -static const struct dri_extension_function GL_EXT_gpu_program_parameters_functions[] = { - { ProgramLocalParameters4fvEXT_names, ProgramLocalParameters4fvEXT_remap_index, -1 }, - { ProgramEnvParameters4fvEXT_names, ProgramEnvParameters4fvEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_histogram) -static const struct dri_extension_function GL_EXT_histogram_functions[] = { - { Histogram_names, -1, 367 }, - { ResetHistogram_names, -1, 369 }, - { GetMinmax_names, -1, 364 }, - { GetHistogramParameterfv_names, -1, 362 }, - { GetMinmaxParameteriv_names, -1, 366 }, - { ResetMinmax_names, -1, 370 }, - { GetHistogramParameteriv_names, -1, 363 }, - { GetHistogram_names, -1, 361 }, - { Minmax_names, -1, 368 }, - { GetMinmaxParameterfv_names, -1, 365 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_index_func) -static const struct dri_extension_function GL_EXT_index_func_functions[] = { - { IndexFuncEXT_names, IndexFuncEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_index_material) -static const struct dri_extension_function GL_EXT_index_material_functions[] = { - { IndexMaterialEXT_names, IndexMaterialEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_light_texture) -static const struct dri_extension_function GL_EXT_light_texture_functions[] = { - { ApplyTextureEXT_names, ApplyTextureEXT_remap_index, -1 }, - { TextureMaterialEXT_names, TextureMaterialEXT_remap_index, -1 }, - { TextureLightEXT_names, TextureLightEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_multi_draw_arrays) -static const struct dri_extension_function GL_EXT_multi_draw_arrays_functions[] = { - { MultiDrawElementsEXT_names, MultiDrawElementsEXT_remap_index, -1 }, - { MultiDrawArraysEXT_names, MultiDrawArraysEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_multisample) -static const struct dri_extension_function GL_EXT_multisample_functions[] = { - { SampleMaskSGIS_names, SampleMaskSGIS_remap_index, -1 }, - { SamplePatternSGIS_names, SamplePatternSGIS_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_paletted_texture) -static const struct dri_extension_function GL_EXT_paletted_texture_functions[] = { - { ColorTable_names, -1, 339 }, - { GetColorTable_names, -1, 343 }, - { GetColorTableParameterfv_names, -1, 344 }, - { GetColorTableParameteriv_names, -1, 345 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_pixel_transform) -static const struct dri_extension_function GL_EXT_pixel_transform_functions[] = { - { PixelTransformParameterfvEXT_names, PixelTransformParameterfvEXT_remap_index, -1 }, - { PixelTransformParameterfEXT_names, PixelTransformParameterfEXT_remap_index, -1 }, - { PixelTransformParameteriEXT_names, PixelTransformParameteriEXT_remap_index, -1 }, - { PixelTransformParameterivEXT_names, PixelTransformParameterivEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_point_parameters) -static const struct dri_extension_function GL_EXT_point_parameters_functions[] = { - { PointParameterfEXT_names, PointParameterfEXT_remap_index, -1 }, - { PointParameterfvEXT_names, PointParameterfvEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_polygon_offset) -static const struct dri_extension_function GL_EXT_polygon_offset_functions[] = { - { PolygonOffsetEXT_names, PolygonOffsetEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_provoking_vertex) -static const struct dri_extension_function GL_EXT_provoking_vertex_functions[] = { - { ProvokingVertexEXT_names, ProvokingVertexEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_secondary_color) -static const struct dri_extension_function GL_EXT_secondary_color_functions[] = { - { SecondaryColor3iEXT_names, SecondaryColor3iEXT_remap_index, -1 }, - { SecondaryColor3bEXT_names, SecondaryColor3bEXT_remap_index, -1 }, - { SecondaryColor3bvEXT_names, SecondaryColor3bvEXT_remap_index, -1 }, - { SecondaryColor3sEXT_names, SecondaryColor3sEXT_remap_index, -1 }, - { SecondaryColor3dEXT_names, SecondaryColor3dEXT_remap_index, -1 }, - { SecondaryColorPointerEXT_names, SecondaryColorPointerEXT_remap_index, -1 }, - { SecondaryColor3uiEXT_names, SecondaryColor3uiEXT_remap_index, -1 }, - { SecondaryColor3usvEXT_names, SecondaryColor3usvEXT_remap_index, -1 }, - { SecondaryColor3ivEXT_names, SecondaryColor3ivEXT_remap_index, -1 }, - { SecondaryColor3fvEXT_names, SecondaryColor3fvEXT_remap_index, -1 }, - { SecondaryColor3ubvEXT_names, SecondaryColor3ubvEXT_remap_index, -1 }, - { SecondaryColor3uivEXT_names, SecondaryColor3uivEXT_remap_index, -1 }, - { SecondaryColor3dvEXT_names, SecondaryColor3dvEXT_remap_index, -1 }, - { SecondaryColor3usEXT_names, SecondaryColor3usEXT_remap_index, -1 }, - { SecondaryColor3ubEXT_names, SecondaryColor3ubEXT_remap_index, -1 }, - { SecondaryColor3fEXT_names, SecondaryColor3fEXT_remap_index, -1 }, - { SecondaryColor3svEXT_names, SecondaryColor3svEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_stencil_two_side) -static const struct dri_extension_function GL_EXT_stencil_two_side_functions[] = { - { ActiveStencilFaceEXT_names, ActiveStencilFaceEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_subtexture) -static const struct dri_extension_function GL_EXT_subtexture_functions[] = { - { TexSubImage1D_names, -1, 332 }, - { TexSubImage2D_names, -1, 333 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_texture3D) -static const struct dri_extension_function GL_EXT_texture3D_functions[] = { - { TexImage3D_names, -1, 371 }, - { TexSubImage3D_names, -1, 372 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_texture_array) -static const struct dri_extension_function GL_EXT_texture_array_functions[] = { - { FramebufferTextureLayerEXT_names, FramebufferTextureLayerEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_texture_object) -static const struct dri_extension_function GL_EXT_texture_object_functions[] = { - { PrioritizeTextures_names, -1, 331 }, - { AreTexturesResident_names, -1, 322 }, - { GenTextures_names, -1, 328 }, - { DeleteTextures_names, -1, 327 }, - { IsTexture_names, -1, 330 }, - { BindTexture_names, -1, 307 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_texture_perturb_normal) -static const struct dri_extension_function GL_EXT_texture_perturb_normal_functions[] = { - { TextureNormalEXT_names, TextureNormalEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_timer_query) -static const struct dri_extension_function GL_EXT_timer_query_functions[] = { - { GetQueryObjectui64vEXT_names, GetQueryObjectui64vEXT_remap_index, -1 }, - { GetQueryObjecti64vEXT_names, GetQueryObjecti64vEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_vertex_array) -static const struct dri_extension_function GL_EXT_vertex_array_functions[] = { - { IndexPointerEXT_names, IndexPointerEXT_remap_index, -1 }, - { NormalPointerEXT_names, NormalPointerEXT_remap_index, -1 }, - { VertexPointerEXT_names, VertexPointerEXT_remap_index, -1 }, - { TexCoordPointerEXT_names, TexCoordPointerEXT_remap_index, -1 }, - { EdgeFlagPointerEXT_names, EdgeFlagPointerEXT_remap_index, -1 }, - { ArrayElement_names, -1, 306 }, - { ColorPointerEXT_names, ColorPointerEXT_remap_index, -1 }, - { GetPointerv_names, -1, 329 }, - { DrawArrays_names, -1, 310 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_EXT_vertex_weighting) -static const struct dri_extension_function GL_EXT_vertex_weighting_functions[] = { - { VertexWeightfvEXT_names, VertexWeightfvEXT_remap_index, -1 }, - { VertexWeightfEXT_names, VertexWeightfEXT_remap_index, -1 }, - { VertexWeightPointerEXT_names, VertexWeightPointerEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_HP_image_transform) -static const struct dri_extension_function GL_HP_image_transform_functions[] = { - { GetImageTransformParameterfvHP_names, GetImageTransformParameterfvHP_remap_index, -1 }, - { ImageTransformParameterfHP_names, ImageTransformParameterfHP_remap_index, -1 }, - { ImageTransformParameterfvHP_names, ImageTransformParameterfvHP_remap_index, -1 }, - { ImageTransformParameteriHP_names, ImageTransformParameteriHP_remap_index, -1 }, - { GetImageTransformParameterivHP_names, GetImageTransformParameterivHP_remap_index, -1 }, - { ImageTransformParameterivHP_names, ImageTransformParameterivHP_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_IBM_multimode_draw_arrays) -static const struct dri_extension_function GL_IBM_multimode_draw_arrays_functions[] = { - { MultiModeDrawArraysIBM_names, MultiModeDrawArraysIBM_remap_index, -1 }, - { MultiModeDrawElementsIBM_names, MultiModeDrawElementsIBM_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_IBM_vertex_array_lists) -static const struct dri_extension_function GL_IBM_vertex_array_lists_functions[] = { - { SecondaryColorPointerListIBM_names, SecondaryColorPointerListIBM_remap_index, -1 }, - { NormalPointerListIBM_names, NormalPointerListIBM_remap_index, -1 }, - { FogCoordPointerListIBM_names, FogCoordPointerListIBM_remap_index, -1 }, - { VertexPointerListIBM_names, VertexPointerListIBM_remap_index, -1 }, - { ColorPointerListIBM_names, ColorPointerListIBM_remap_index, -1 }, - { TexCoordPointerListIBM_names, TexCoordPointerListIBM_remap_index, -1 }, - { IndexPointerListIBM_names, IndexPointerListIBM_remap_index, -1 }, - { EdgeFlagPointerListIBM_names, EdgeFlagPointerListIBM_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_INGR_blend_func_separate) -static const struct dri_extension_function GL_INGR_blend_func_separate_functions[] = { - { BlendFuncSeparateEXT_names, BlendFuncSeparateEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_INTEL_parallel_arrays) -static const struct dri_extension_function GL_INTEL_parallel_arrays_functions[] = { - { VertexPointervINTEL_names, VertexPointervINTEL_remap_index, -1 }, - { ColorPointervINTEL_names, ColorPointervINTEL_remap_index, -1 }, - { NormalPointervINTEL_names, NormalPointervINTEL_remap_index, -1 }, - { TexCoordPointervINTEL_names, TexCoordPointervINTEL_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_MESA_resize_buffers) -static const struct dri_extension_function GL_MESA_resize_buffers_functions[] = { - { ResizeBuffersMESA_names, ResizeBuffersMESA_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_MESA_shader_debug) -static const struct dri_extension_function GL_MESA_shader_debug_functions[] = { - { GetDebugLogLengthMESA_names, GetDebugLogLengthMESA_remap_index, -1 }, - { ClearDebugLogMESA_names, ClearDebugLogMESA_remap_index, -1 }, - { GetDebugLogMESA_names, GetDebugLogMESA_remap_index, -1 }, - { CreateDebugObjectMESA_names, CreateDebugObjectMESA_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_MESA_window_pos) -static const struct dri_extension_function GL_MESA_window_pos_functions[] = { - { WindowPos3fMESA_names, WindowPos3fMESA_remap_index, -1 }, - { WindowPos2dvMESA_names, WindowPos2dvMESA_remap_index, -1 }, - { WindowPos4svMESA_names, WindowPos4svMESA_remap_index, -1 }, - { WindowPos2svMESA_names, WindowPos2svMESA_remap_index, -1 }, - { WindowPos3dMESA_names, WindowPos3dMESA_remap_index, -1 }, - { WindowPos2fvMESA_names, WindowPos2fvMESA_remap_index, -1 }, - { WindowPos4dMESA_names, WindowPos4dMESA_remap_index, -1 }, - { WindowPos2dMESA_names, WindowPos2dMESA_remap_index, -1 }, - { WindowPos4ivMESA_names, WindowPos4ivMESA_remap_index, -1 }, - { WindowPos4fMESA_names, WindowPos4fMESA_remap_index, -1 }, - { WindowPos3dvMESA_names, WindowPos3dvMESA_remap_index, -1 }, - { WindowPos3fvMESA_names, WindowPos3fvMESA_remap_index, -1 }, - { WindowPos4dvMESA_names, WindowPos4dvMESA_remap_index, -1 }, - { WindowPos2iMESA_names, WindowPos2iMESA_remap_index, -1 }, - { WindowPos3sMESA_names, WindowPos3sMESA_remap_index, -1 }, - { WindowPos4sMESA_names, WindowPos4sMESA_remap_index, -1 }, - { WindowPos2ivMESA_names, WindowPos2ivMESA_remap_index, -1 }, - { WindowPos2sMESA_names, WindowPos2sMESA_remap_index, -1 }, - { WindowPos3iMESA_names, WindowPos3iMESA_remap_index, -1 }, - { WindowPos3ivMESA_names, WindowPos3ivMESA_remap_index, -1 }, - { WindowPos4iMESA_names, WindowPos4iMESA_remap_index, -1 }, - { WindowPos4fvMESA_names, WindowPos4fvMESA_remap_index, -1 }, - { WindowPos3svMESA_names, WindowPos3svMESA_remap_index, -1 }, - { WindowPos2fMESA_names, WindowPos2fMESA_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_NV_evaluators) -static const struct dri_extension_function GL_NV_evaluators_functions[] = { - { GetMapAttribParameterivNV_names, GetMapAttribParameterivNV_remap_index, -1 }, - { MapControlPointsNV_names, MapControlPointsNV_remap_index, -1 }, - { MapParameterfvNV_names, MapParameterfvNV_remap_index, -1 }, - { EvalMapsNV_names, EvalMapsNV_remap_index, -1 }, - { GetMapAttribParameterfvNV_names, GetMapAttribParameterfvNV_remap_index, -1 }, - { MapParameterivNV_names, MapParameterivNV_remap_index, -1 }, - { GetMapParameterivNV_names, GetMapParameterivNV_remap_index, -1 }, - { GetMapParameterfvNV_names, GetMapParameterfvNV_remap_index, -1 }, - { GetMapControlPointsNV_names, GetMapControlPointsNV_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_NV_fence) -static const struct dri_extension_function GL_NV_fence_functions[] = { - { GenFencesNV_names, GenFencesNV_remap_index, -1 }, - { TestFenceNV_names, TestFenceNV_remap_index, -1 }, - { IsFenceNV_names, IsFenceNV_remap_index, -1 }, - { DeleteFencesNV_names, DeleteFencesNV_remap_index, -1 }, - { SetFenceNV_names, SetFenceNV_remap_index, -1 }, - { GetFenceivNV_names, GetFenceivNV_remap_index, -1 }, - { FinishFenceNV_names, FinishFenceNV_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_NV_fragment_program) -static const struct dri_extension_function GL_NV_fragment_program_functions[] = { - { GetProgramNamedParameterdvNV_names, GetProgramNamedParameterdvNV_remap_index, -1 }, - { GetProgramNamedParameterfvNV_names, GetProgramNamedParameterfvNV_remap_index, -1 }, - { ProgramNamedParameter4fNV_names, ProgramNamedParameter4fNV_remap_index, -1 }, - { ProgramNamedParameter4fvNV_names, ProgramNamedParameter4fvNV_remap_index, -1 }, - { ProgramNamedParameter4dvNV_names, ProgramNamedParameter4dvNV_remap_index, -1 }, - { ProgramNamedParameter4dNV_names, ProgramNamedParameter4dNV_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_NV_point_sprite) -static const struct dri_extension_function GL_NV_point_sprite_functions[] = { - { PointParameteriNV_names, PointParameteriNV_remap_index, -1 }, - { PointParameterivNV_names, PointParameterivNV_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_NV_register_combiners) -static const struct dri_extension_function GL_NV_register_combiners_functions[] = { - { CombinerOutputNV_names, CombinerOutputNV_remap_index, -1 }, - { CombinerParameterfvNV_names, CombinerParameterfvNV_remap_index, -1 }, - { GetFinalCombinerInputParameterfvNV_names, GetFinalCombinerInputParameterfvNV_remap_index, -1 }, - { GetCombinerOutputParameterfvNV_names, GetCombinerOutputParameterfvNV_remap_index, -1 }, - { FinalCombinerInputNV_names, FinalCombinerInputNV_remap_index, -1 }, - { GetCombinerInputParameterfvNV_names, GetCombinerInputParameterfvNV_remap_index, -1 }, - { GetCombinerOutputParameterivNV_names, GetCombinerOutputParameterivNV_remap_index, -1 }, - { CombinerParameteriNV_names, CombinerParameteriNV_remap_index, -1 }, - { GetFinalCombinerInputParameterivNV_names, GetFinalCombinerInputParameterivNV_remap_index, -1 }, - { CombinerInputNV_names, CombinerInputNV_remap_index, -1 }, - { CombinerParameterfNV_names, CombinerParameterfNV_remap_index, -1 }, - { GetCombinerInputParameterivNV_names, GetCombinerInputParameterivNV_remap_index, -1 }, - { CombinerParameterivNV_names, CombinerParameterivNV_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_NV_register_combiners2) -static const struct dri_extension_function GL_NV_register_combiners2_functions[] = { - { CombinerStageParameterfvNV_names, CombinerStageParameterfvNV_remap_index, -1 }, - { GetCombinerStageParameterfvNV_names, GetCombinerStageParameterfvNV_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_NV_vertex_array_range) -static const struct dri_extension_function GL_NV_vertex_array_range_functions[] = { - { VertexArrayRangeNV_names, VertexArrayRangeNV_remap_index, -1 }, - { FlushVertexArrayRangeNV_names, FlushVertexArrayRangeNV_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_NV_vertex_program) -static const struct dri_extension_function GL_NV_vertex_program_functions[] = { - { VertexAttrib4ubvNV_names, VertexAttrib4ubvNV_remap_index, -1 }, - { VertexAttrib4svNV_names, VertexAttrib4svNV_remap_index, -1 }, - { VertexAttribs3fvNV_names, VertexAttribs3fvNV_remap_index, -1 }, - { VertexAttribs1dvNV_names, VertexAttribs1dvNV_remap_index, -1 }, - { VertexAttrib1fvNV_names, VertexAttrib1fvNV_remap_index, -1 }, - { VertexAttrib4fNV_names, VertexAttrib4fNV_remap_index, -1 }, - { VertexAttrib2dNV_names, VertexAttrib2dNV_remap_index, -1 }, - { VertexAttrib4ubNV_names, VertexAttrib4ubNV_remap_index, -1 }, - { VertexAttribs3dvNV_names, VertexAttribs3dvNV_remap_index, -1 }, - { VertexAttribs4fvNV_names, VertexAttribs4fvNV_remap_index, -1 }, - { VertexAttrib2sNV_names, VertexAttrib2sNV_remap_index, -1 }, - { ProgramEnvParameter4fvARB_names, ProgramEnvParameter4fvARB_remap_index, -1 }, - { LoadProgramNV_names, LoadProgramNV_remap_index, -1 }, - { VertexAttrib4fvNV_names, VertexAttrib4fvNV_remap_index, -1 }, - { VertexAttrib3fNV_names, VertexAttrib3fNV_remap_index, -1 }, - { VertexAttribs2dvNV_names, VertexAttribs2dvNV_remap_index, -1 }, - { GetProgramParameterfvNV_names, GetProgramParameterfvNV_remap_index, -1 }, - { VertexAttrib3dNV_names, VertexAttrib3dNV_remap_index, -1 }, - { VertexAttrib2fvNV_names, VertexAttrib2fvNV_remap_index, -1 }, - { VertexAttrib2dvNV_names, VertexAttrib2dvNV_remap_index, -1 }, - { VertexAttrib1dvNV_names, VertexAttrib1dvNV_remap_index, -1 }, - { VertexAttrib1svNV_names, VertexAttrib1svNV_remap_index, -1 }, - { ProgramEnvParameter4fARB_names, ProgramEnvParameter4fARB_remap_index, -1 }, - { VertexAttribs2svNV_names, VertexAttribs2svNV_remap_index, -1 }, - { GetVertexAttribivNV_names, GetVertexAttribivNV_remap_index, -1 }, - { GetVertexAttribfvNV_names, GetVertexAttribfvNV_remap_index, -1 }, - { VertexAttrib2svNV_names, VertexAttrib2svNV_remap_index, -1 }, - { VertexAttribs1fvNV_names, VertexAttribs1fvNV_remap_index, -1 }, - { IsProgramNV_names, IsProgramNV_remap_index, -1 }, - { ProgramEnvParameter4dARB_names, ProgramEnvParameter4dARB_remap_index, -1 }, - { VertexAttrib2fNV_names, VertexAttrib2fNV_remap_index, -1 }, - { RequestResidentProgramsNV_names, RequestResidentProgramsNV_remap_index, -1 }, - { ExecuteProgramNV_names, ExecuteProgramNV_remap_index, -1 }, - { VertexAttribPointerNV_names, VertexAttribPointerNV_remap_index, -1 }, - { TrackMatrixNV_names, TrackMatrixNV_remap_index, -1 }, - { GetProgramParameterdvNV_names, GetProgramParameterdvNV_remap_index, -1 }, - { GetTrackMatrixivNV_names, GetTrackMatrixivNV_remap_index, -1 }, - { VertexAttrib3svNV_names, VertexAttrib3svNV_remap_index, -1 }, - { ProgramParameters4fvNV_names, ProgramParameters4fvNV_remap_index, -1 }, - { GetProgramivNV_names, GetProgramivNV_remap_index, -1 }, - { GetVertexAttribdvNV_names, GetVertexAttribdvNV_remap_index, -1 }, - { VertexAttrib3fvNV_names, VertexAttrib3fvNV_remap_index, -1 }, - { ProgramEnvParameter4dvARB_names, ProgramEnvParameter4dvARB_remap_index, -1 }, - { VertexAttribs2fvNV_names, VertexAttribs2fvNV_remap_index, -1 }, - { DeleteProgramsNV_names, DeleteProgramsNV_remap_index, -1 }, - { GetVertexAttribPointervNV_names, GetVertexAttribPointervNV_remap_index, -1 }, - { GetProgramStringNV_names, GetProgramStringNV_remap_index, -1 }, - { VertexAttrib4sNV_names, VertexAttrib4sNV_remap_index, -1 }, - { VertexAttribs4dvNV_names, VertexAttribs4dvNV_remap_index, -1 }, - { ProgramParameters4dvNV_names, ProgramParameters4dvNV_remap_index, -1 }, - { VertexAttrib3sNV_names, VertexAttrib3sNV_remap_index, -1 }, - { VertexAttrib1fNV_names, VertexAttrib1fNV_remap_index, -1 }, - { VertexAttrib4dNV_names, VertexAttrib4dNV_remap_index, -1 }, - { VertexAttribs4ubvNV_names, VertexAttribs4ubvNV_remap_index, -1 }, - { VertexAttribs3svNV_names, VertexAttribs3svNV_remap_index, -1 }, - { VertexAttrib1sNV_names, VertexAttrib1sNV_remap_index, -1 }, - { BindProgramNV_names, BindProgramNV_remap_index, -1 }, - { AreProgramsResidentNV_names, AreProgramsResidentNV_remap_index, -1 }, - { VertexAttrib3dvNV_names, VertexAttrib3dvNV_remap_index, -1 }, - { VertexAttrib1dNV_names, VertexAttrib1dNV_remap_index, -1 }, - { VertexAttribs4svNV_names, VertexAttribs4svNV_remap_index, -1 }, - { VertexAttribs1svNV_names, VertexAttribs1svNV_remap_index, -1 }, - { GenProgramsNV_names, GenProgramsNV_remap_index, -1 }, - { VertexAttrib4dvNV_names, VertexAttrib4dvNV_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_PGI_misc_hints) -static const struct dri_extension_function GL_PGI_misc_hints_functions[] = { - { HintPGI_names, HintPGI_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIS_detail_texture) -static const struct dri_extension_function GL_SGIS_detail_texture_functions[] = { - { GetDetailTexFuncSGIS_names, GetDetailTexFuncSGIS_remap_index, -1 }, - { DetailTexFuncSGIS_names, DetailTexFuncSGIS_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIS_fog_function) -static const struct dri_extension_function GL_SGIS_fog_function_functions[] = { - { FogFuncSGIS_names, FogFuncSGIS_remap_index, -1 }, - { GetFogFuncSGIS_names, GetFogFuncSGIS_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIS_multisample) -static const struct dri_extension_function GL_SGIS_multisample_functions[] = { - { SampleMaskSGIS_names, SampleMaskSGIS_remap_index, -1 }, - { SamplePatternSGIS_names, SamplePatternSGIS_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIS_pixel_texture) -static const struct dri_extension_function GL_SGIS_pixel_texture_functions[] = { - { PixelTexGenParameterfvSGIS_names, PixelTexGenParameterfvSGIS_remap_index, -1 }, - { GetPixelTexGenParameterivSGIS_names, GetPixelTexGenParameterivSGIS_remap_index, -1 }, - { PixelTexGenParameteriSGIS_names, PixelTexGenParameteriSGIS_remap_index, -1 }, - { PixelTexGenParameterivSGIS_names, PixelTexGenParameterivSGIS_remap_index, -1 }, - { PixelTexGenParameterfSGIS_names, PixelTexGenParameterfSGIS_remap_index, -1 }, - { GetPixelTexGenParameterfvSGIS_names, GetPixelTexGenParameterfvSGIS_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIS_point_parameters) -static const struct dri_extension_function GL_SGIS_point_parameters_functions[] = { - { PointParameterfEXT_names, PointParameterfEXT_remap_index, -1 }, - { PointParameterfvEXT_names, PointParameterfvEXT_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIS_sharpen_texture) -static const struct dri_extension_function GL_SGIS_sharpen_texture_functions[] = { - { GetSharpenTexFuncSGIS_names, GetSharpenTexFuncSGIS_remap_index, -1 }, - { SharpenTexFuncSGIS_names, SharpenTexFuncSGIS_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIS_texture4D) -static const struct dri_extension_function GL_SGIS_texture4D_functions[] = { - { TexImage4DSGIS_names, TexImage4DSGIS_remap_index, -1 }, - { TexSubImage4DSGIS_names, TexSubImage4DSGIS_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIS_texture_color_mask) -static const struct dri_extension_function GL_SGIS_texture_color_mask_functions[] = { - { TextureColorMaskSGIS_names, TextureColorMaskSGIS_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIS_texture_filter4) -static const struct dri_extension_function GL_SGIS_texture_filter4_functions[] = { - { GetTexFilterFuncSGIS_names, GetTexFilterFuncSGIS_remap_index, -1 }, - { TexFilterFuncSGIS_names, TexFilterFuncSGIS_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIX_async) -static const struct dri_extension_function GL_SGIX_async_functions[] = { - { AsyncMarkerSGIX_names, AsyncMarkerSGIX_remap_index, -1 }, - { FinishAsyncSGIX_names, FinishAsyncSGIX_remap_index, -1 }, - { PollAsyncSGIX_names, PollAsyncSGIX_remap_index, -1 }, - { DeleteAsyncMarkersSGIX_names, DeleteAsyncMarkersSGIX_remap_index, -1 }, - { IsAsyncMarkerSGIX_names, IsAsyncMarkerSGIX_remap_index, -1 }, - { GenAsyncMarkersSGIX_names, GenAsyncMarkersSGIX_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIX_flush_raster) -static const struct dri_extension_function GL_SGIX_flush_raster_functions[] = { - { FlushRasterSGIX_names, FlushRasterSGIX_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIX_fragment_lighting) -static const struct dri_extension_function GL_SGIX_fragment_lighting_functions[] = { - { FragmentMaterialfvSGIX_names, FragmentMaterialfvSGIX_remap_index, -1 }, - { FragmentLightModelivSGIX_names, FragmentLightModelivSGIX_remap_index, -1 }, - { FragmentLightiSGIX_names, FragmentLightiSGIX_remap_index, -1 }, - { GetFragmentMaterialfvSGIX_names, GetFragmentMaterialfvSGIX_remap_index, -1 }, - { FragmentMaterialfSGIX_names, FragmentMaterialfSGIX_remap_index, -1 }, - { GetFragmentLightivSGIX_names, GetFragmentLightivSGIX_remap_index, -1 }, - { FragmentLightModeliSGIX_names, FragmentLightModeliSGIX_remap_index, -1 }, - { FragmentLightivSGIX_names, FragmentLightivSGIX_remap_index, -1 }, - { GetFragmentMaterialivSGIX_names, GetFragmentMaterialivSGIX_remap_index, -1 }, - { FragmentLightModelfSGIX_names, FragmentLightModelfSGIX_remap_index, -1 }, - { FragmentColorMaterialSGIX_names, FragmentColorMaterialSGIX_remap_index, -1 }, - { FragmentMaterialiSGIX_names, FragmentMaterialiSGIX_remap_index, -1 }, - { LightEnviSGIX_names, LightEnviSGIX_remap_index, -1 }, - { FragmentLightModelfvSGIX_names, FragmentLightModelfvSGIX_remap_index, -1 }, - { FragmentLightfvSGIX_names, FragmentLightfvSGIX_remap_index, -1 }, - { FragmentLightfSGIX_names, FragmentLightfSGIX_remap_index, -1 }, - { GetFragmentLightfvSGIX_names, GetFragmentLightfvSGIX_remap_index, -1 }, - { FragmentMaterialivSGIX_names, FragmentMaterialivSGIX_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIX_framezoom) -static const struct dri_extension_function GL_SGIX_framezoom_functions[] = { - { FrameZoomSGIX_names, FrameZoomSGIX_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIX_igloo_interface) -static const struct dri_extension_function GL_SGIX_igloo_interface_functions[] = { - { IglooInterfaceSGIX_names, IglooInterfaceSGIX_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIX_instruments) -static const struct dri_extension_function GL_SGIX_instruments_functions[] = { - { ReadInstrumentsSGIX_names, ReadInstrumentsSGIX_remap_index, -1 }, - { PollInstrumentsSGIX_names, PollInstrumentsSGIX_remap_index, -1 }, - { GetInstrumentsSGIX_names, GetInstrumentsSGIX_remap_index, -1 }, - { StartInstrumentsSGIX_names, StartInstrumentsSGIX_remap_index, -1 }, - { StopInstrumentsSGIX_names, StopInstrumentsSGIX_remap_index, -1 }, - { InstrumentsBufferSGIX_names, InstrumentsBufferSGIX_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIX_list_priority) -static const struct dri_extension_function GL_SGIX_list_priority_functions[] = { - { ListParameterfSGIX_names, ListParameterfSGIX_remap_index, -1 }, - { GetListParameterfvSGIX_names, GetListParameterfvSGIX_remap_index, -1 }, - { ListParameteriSGIX_names, ListParameteriSGIX_remap_index, -1 }, - { ListParameterfvSGIX_names, ListParameterfvSGIX_remap_index, -1 }, - { ListParameterivSGIX_names, ListParameterivSGIX_remap_index, -1 }, - { GetListParameterivSGIX_names, GetListParameterivSGIX_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIX_pixel_texture) -static const struct dri_extension_function GL_SGIX_pixel_texture_functions[] = { - { PixelTexGenSGIX_names, PixelTexGenSGIX_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIX_polynomial_ffd) -static const struct dri_extension_function GL_SGIX_polynomial_ffd_functions[] = { - { LoadIdentityDeformationMapSGIX_names, LoadIdentityDeformationMapSGIX_remap_index, -1 }, - { DeformationMap3dSGIX_names, DeformationMap3dSGIX_remap_index, -1 }, - { DeformSGIX_names, DeformSGIX_remap_index, -1 }, - { DeformationMap3fSGIX_names, DeformationMap3fSGIX_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIX_reference_plane) -static const struct dri_extension_function GL_SGIX_reference_plane_functions[] = { - { ReferencePlaneSGIX_names, ReferencePlaneSGIX_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIX_sprite) -static const struct dri_extension_function GL_SGIX_sprite_functions[] = { - { SpriteParameterfvSGIX_names, SpriteParameterfvSGIX_remap_index, -1 }, - { SpriteParameteriSGIX_names, SpriteParameteriSGIX_remap_index, -1 }, - { SpriteParameterfSGIX_names, SpriteParameterfSGIX_remap_index, -1 }, - { SpriteParameterivSGIX_names, SpriteParameterivSGIX_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGIX_tag_sample_buffer) -static const struct dri_extension_function GL_SGIX_tag_sample_buffer_functions[] = { - { TagSampleBufferSGIX_names, TagSampleBufferSGIX_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SGI_color_table) -static const struct dri_extension_function GL_SGI_color_table_functions[] = { - { ColorTableParameteriv_names, -1, 341 }, - { ColorTable_names, -1, 339 }, - { GetColorTable_names, -1, 343 }, - { CopyColorTable_names, -1, 342 }, - { ColorTableParameterfv_names, -1, 340 }, - { GetColorTableParameterfv_names, -1, 344 }, - { GetColorTableParameteriv_names, -1, 345 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SUNX_constant_data) -static const struct dri_extension_function GL_SUNX_constant_data_functions[] = { - { FinishTextureSUNX_names, FinishTextureSUNX_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SUN_global_alpha) -static const struct dri_extension_function GL_SUN_global_alpha_functions[] = { - { GlobalAlphaFactorubSUN_names, GlobalAlphaFactorubSUN_remap_index, -1 }, - { GlobalAlphaFactoriSUN_names, GlobalAlphaFactoriSUN_remap_index, -1 }, - { GlobalAlphaFactordSUN_names, GlobalAlphaFactordSUN_remap_index, -1 }, - { GlobalAlphaFactoruiSUN_names, GlobalAlphaFactoruiSUN_remap_index, -1 }, - { GlobalAlphaFactorbSUN_names, GlobalAlphaFactorbSUN_remap_index, -1 }, - { GlobalAlphaFactorfSUN_names, GlobalAlphaFactorfSUN_remap_index, -1 }, - { GlobalAlphaFactorusSUN_names, GlobalAlphaFactorusSUN_remap_index, -1 }, - { GlobalAlphaFactorsSUN_names, GlobalAlphaFactorsSUN_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SUN_mesh_array) -static const struct dri_extension_function GL_SUN_mesh_array_functions[] = { - { DrawMeshArraysSUN_names, DrawMeshArraysSUN_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SUN_triangle_list) -static const struct dri_extension_function GL_SUN_triangle_list_functions[] = { - { ReplacementCodeubSUN_names, ReplacementCodeubSUN_remap_index, -1 }, - { ReplacementCodeubvSUN_names, ReplacementCodeubvSUN_remap_index, -1 }, - { ReplacementCodeusvSUN_names, ReplacementCodeusvSUN_remap_index, -1 }, - { ReplacementCodePointerSUN_names, ReplacementCodePointerSUN_remap_index, -1 }, - { ReplacementCodeusSUN_names, ReplacementCodeusSUN_remap_index, -1 }, - { ReplacementCodeuiSUN_names, ReplacementCodeuiSUN_remap_index, -1 }, - { ReplacementCodeuivSUN_names, ReplacementCodeuivSUN_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_SUN_vertex) -static const struct dri_extension_function GL_SUN_vertex_functions[] = { - { ReplacementCodeuiColor3fVertex3fvSUN_names, ReplacementCodeuiColor3fVertex3fvSUN_remap_index, -1 }, - { TexCoord4fColor4fNormal3fVertex4fvSUN_names, TexCoord4fColor4fNormal3fVertex4fvSUN_remap_index, -1 }, - { TexCoord2fColor4ubVertex3fvSUN_names, TexCoord2fColor4ubVertex3fvSUN_remap_index, -1 }, - { ReplacementCodeuiVertex3fvSUN_names, ReplacementCodeuiVertex3fvSUN_remap_index, -1 }, - { ReplacementCodeuiTexCoord2fVertex3fvSUN_names, ReplacementCodeuiTexCoord2fVertex3fvSUN_remap_index, -1 }, - { ReplacementCodeuiNormal3fVertex3fSUN_names, ReplacementCodeuiNormal3fVertex3fSUN_remap_index, -1 }, - { Color4ubVertex3fvSUN_names, Color4ubVertex3fvSUN_remap_index, -1 }, - { Color4ubVertex3fSUN_names, Color4ubVertex3fSUN_remap_index, -1 }, - { TexCoord2fVertex3fSUN_names, TexCoord2fVertex3fSUN_remap_index, -1 }, - { TexCoord2fColor4fNormal3fVertex3fSUN_names, TexCoord2fColor4fNormal3fVertex3fSUN_remap_index, -1 }, - { TexCoord2fNormal3fVertex3fvSUN_names, TexCoord2fNormal3fVertex3fvSUN_remap_index, -1 }, - { ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN_names, ReplacementCodeuiTexCoord2fNormal3fVertex3fSUN_remap_index, -1 }, - { ReplacementCodeuiTexCoord2fVertex3fSUN_names, ReplacementCodeuiTexCoord2fVertex3fSUN_remap_index, -1 }, - { TexCoord2fNormal3fVertex3fSUN_names, TexCoord2fNormal3fVertex3fSUN_remap_index, -1 }, - { Color3fVertex3fSUN_names, Color3fVertex3fSUN_remap_index, -1 }, - { Color3fVertex3fvSUN_names, Color3fVertex3fvSUN_remap_index, -1 }, - { Color4fNormal3fVertex3fvSUN_names, Color4fNormal3fVertex3fvSUN_remap_index, -1 }, - { ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN_names, ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN_remap_index, -1 }, - { ReplacementCodeuiColor4fNormal3fVertex3fvSUN_names, ReplacementCodeuiColor4fNormal3fVertex3fvSUN_remap_index, -1 }, - { ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN_names, ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN_remap_index, -1 }, - { TexCoord2fColor3fVertex3fSUN_names, TexCoord2fColor3fVertex3fSUN_remap_index, -1 }, - { TexCoord4fColor4fNormal3fVertex4fSUN_names, TexCoord4fColor4fNormal3fVertex4fSUN_remap_index, -1 }, - { Color4ubVertex2fvSUN_names, Color4ubVertex2fvSUN_remap_index, -1 }, - { Normal3fVertex3fSUN_names, Normal3fVertex3fSUN_remap_index, -1 }, - { ReplacementCodeuiColor4fNormal3fVertex3fSUN_names, ReplacementCodeuiColor4fNormal3fVertex3fSUN_remap_index, -1 }, - { TexCoord2fColor4fNormal3fVertex3fvSUN_names, TexCoord2fColor4fNormal3fVertex3fvSUN_remap_index, -1 }, - { TexCoord2fVertex3fvSUN_names, TexCoord2fVertex3fvSUN_remap_index, -1 }, - { Color4ubVertex2fSUN_names, Color4ubVertex2fSUN_remap_index, -1 }, - { ReplacementCodeuiColor4ubVertex3fSUN_names, ReplacementCodeuiColor4ubVertex3fSUN_remap_index, -1 }, - { TexCoord2fColor4ubVertex3fSUN_names, TexCoord2fColor4ubVertex3fSUN_remap_index, -1 }, - { Normal3fVertex3fvSUN_names, Normal3fVertex3fvSUN_remap_index, -1 }, - { Color4fNormal3fVertex3fSUN_names, Color4fNormal3fVertex3fSUN_remap_index, -1 }, - { ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN_names, ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN_remap_index, -1 }, - { ReplacementCodeuiColor4ubVertex3fvSUN_names, ReplacementCodeuiColor4ubVertex3fvSUN_remap_index, -1 }, - { ReplacementCodeuiColor3fVertex3fSUN_names, ReplacementCodeuiColor3fVertex3fSUN_remap_index, -1 }, - { TexCoord4fVertex4fSUN_names, TexCoord4fVertex4fSUN_remap_index, -1 }, - { TexCoord2fColor3fVertex3fvSUN_names, TexCoord2fColor3fVertex3fvSUN_remap_index, -1 }, - { ReplacementCodeuiNormal3fVertex3fvSUN_names, ReplacementCodeuiNormal3fVertex3fvSUN_remap_index, -1 }, - { TexCoord4fVertex4fvSUN_names, TexCoord4fVertex4fvSUN_remap_index, -1 }, - { ReplacementCodeuiVertex3fSUN_names, ReplacementCodeuiVertex3fSUN_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_VERSION_1_3) -static const struct dri_extension_function GL_VERSION_1_3_functions[] = { - { SampleCoverageARB_names, SampleCoverageARB_remap_index, -1 }, - { MultiTexCoord3sARB_names, -1, 398 }, - { ActiveTextureARB_names, -1, 374 }, - { CompressedTexSubImage2DARB_names, CompressedTexSubImage2DARB_remap_index, -1 }, - { CompressedTexImage3DARB_names, CompressedTexImage3DARB_remap_index, -1 }, - { MultiTexCoord1fvARB_names, -1, 379 }, - { MultTransposeMatrixdARB_names, MultTransposeMatrixdARB_remap_index, -1 }, - { CompressedTexImage1DARB_names, CompressedTexImage1DARB_remap_index, -1 }, - { MultiTexCoord3dARB_names, -1, 392 }, - { MultiTexCoord2iARB_names, -1, 388 }, - { MultiTexCoord2svARB_names, -1, 391 }, - { MultiTexCoord2fARB_names, -1, 386 }, - { LoadTransposeMatrixdARB_names, LoadTransposeMatrixdARB_remap_index, -1 }, - { MultiTexCoord3fvARB_names, -1, 395 }, - { MultiTexCoord4sARB_names, -1, 406 }, - { MultiTexCoord2dvARB_names, -1, 385 }, - { MultiTexCoord1svARB_names, -1, 383 }, - { MultiTexCoord3svARB_names, -1, 399 }, - { MultiTexCoord4iARB_names, -1, 404 }, - { MultiTexCoord3iARB_names, -1, 396 }, - { MultiTexCoord1dARB_names, -1, 376 }, - { MultiTexCoord3dvARB_names, -1, 393 }, - { MultiTexCoord3ivARB_names, -1, 397 }, - { MultiTexCoord2sARB_names, -1, 390 }, - { MultiTexCoord4ivARB_names, -1, 405 }, - { CompressedTexSubImage1DARB_names, CompressedTexSubImage1DARB_remap_index, -1 }, - { ClientActiveTextureARB_names, -1, 375 }, - { CompressedTexSubImage3DARB_names, CompressedTexSubImage3DARB_remap_index, -1 }, - { MultiTexCoord2dARB_names, -1, 384 }, - { MultiTexCoord4dvARB_names, -1, 401 }, - { MultiTexCoord4fvARB_names, -1, 403 }, - { MultiTexCoord3fARB_names, -1, 394 }, - { MultTransposeMatrixfARB_names, MultTransposeMatrixfARB_remap_index, -1 }, - { CompressedTexImage2DARB_names, CompressedTexImage2DARB_remap_index, -1 }, - { MultiTexCoord4dARB_names, -1, 400 }, - { MultiTexCoord1sARB_names, -1, 382 }, - { MultiTexCoord1dvARB_names, -1, 377 }, - { MultiTexCoord1ivARB_names, -1, 381 }, - { MultiTexCoord2ivARB_names, -1, 389 }, - { MultiTexCoord1iARB_names, -1, 380 }, - { GetCompressedTexImageARB_names, GetCompressedTexImageARB_remap_index, -1 }, - { MultiTexCoord4svARB_names, -1, 407 }, - { MultiTexCoord1fARB_names, -1, 378 }, - { MultiTexCoord4fARB_names, -1, 402 }, - { LoadTransposeMatrixfARB_names, LoadTransposeMatrixfARB_remap_index, -1 }, - { MultiTexCoord2fvARB_names, -1, 387 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_VERSION_1_4) -static const struct dri_extension_function GL_VERSION_1_4_functions[] = { - { PointParameteriNV_names, PointParameteriNV_remap_index, -1 }, - { SecondaryColor3iEXT_names, SecondaryColor3iEXT_remap_index, -1 }, - { WindowPos3fMESA_names, WindowPos3fMESA_remap_index, -1 }, - { WindowPos2dvMESA_names, WindowPos2dvMESA_remap_index, -1 }, - { SecondaryColor3bEXT_names, SecondaryColor3bEXT_remap_index, -1 }, - { PointParameterfEXT_names, PointParameterfEXT_remap_index, -1 }, - { FogCoorddEXT_names, FogCoorddEXT_remap_index, -1 }, - { FogCoordfEXT_names, FogCoordfEXT_remap_index, -1 }, - { WindowPos2svMESA_names, WindowPos2svMESA_remap_index, -1 }, - { WindowPos3dMESA_names, WindowPos3dMESA_remap_index, -1 }, - { PointParameterfvEXT_names, PointParameterfvEXT_remap_index, -1 }, - { WindowPos2fvMESA_names, WindowPos2fvMESA_remap_index, -1 }, - { SecondaryColor3bvEXT_names, SecondaryColor3bvEXT_remap_index, -1 }, - { SecondaryColor3sEXT_names, SecondaryColor3sEXT_remap_index, -1 }, - { SecondaryColor3dEXT_names, SecondaryColor3dEXT_remap_index, -1 }, - { WindowPos2dMESA_names, WindowPos2dMESA_remap_index, -1 }, - { SecondaryColorPointerEXT_names, SecondaryColorPointerEXT_remap_index, -1 }, - { SecondaryColor3uiEXT_names, SecondaryColor3uiEXT_remap_index, -1 }, - { SecondaryColor3usvEXT_names, SecondaryColor3usvEXT_remap_index, -1 }, - { WindowPos3dvMESA_names, WindowPos3dvMESA_remap_index, -1 }, - { PointParameterivNV_names, PointParameterivNV_remap_index, -1 }, - { WindowPos3fvMESA_names, WindowPos3fvMESA_remap_index, -1 }, - { SecondaryColor3ivEXT_names, SecondaryColor3ivEXT_remap_index, -1 }, - { WindowPos2iMESA_names, WindowPos2iMESA_remap_index, -1 }, - { SecondaryColor3fvEXT_names, SecondaryColor3fvEXT_remap_index, -1 }, - { WindowPos3sMESA_names, WindowPos3sMESA_remap_index, -1 }, - { WindowPos2ivMESA_names, WindowPos2ivMESA_remap_index, -1 }, - { MultiDrawElementsEXT_names, MultiDrawElementsEXT_remap_index, -1 }, - { WindowPos2sMESA_names, WindowPos2sMESA_remap_index, -1 }, - { FogCoordPointerEXT_names, FogCoordPointerEXT_remap_index, -1 }, - { SecondaryColor3ubvEXT_names, SecondaryColor3ubvEXT_remap_index, -1 }, - { SecondaryColor3uivEXT_names, SecondaryColor3uivEXT_remap_index, -1 }, - { WindowPos3iMESA_names, WindowPos3iMESA_remap_index, -1 }, - { SecondaryColor3dvEXT_names, SecondaryColor3dvEXT_remap_index, -1 }, - { MultiDrawArraysEXT_names, MultiDrawArraysEXT_remap_index, -1 }, - { SecondaryColor3usEXT_names, SecondaryColor3usEXT_remap_index, -1 }, - { FogCoordfvEXT_names, FogCoordfvEXT_remap_index, -1 }, - { SecondaryColor3ubEXT_names, SecondaryColor3ubEXT_remap_index, -1 }, - { BlendFuncSeparateEXT_names, BlendFuncSeparateEXT_remap_index, -1 }, - { SecondaryColor3fEXT_names, SecondaryColor3fEXT_remap_index, -1 }, - { WindowPos3ivMESA_names, WindowPos3ivMESA_remap_index, -1 }, - { SecondaryColor3svEXT_names, SecondaryColor3svEXT_remap_index, -1 }, - { FogCoorddvEXT_names, FogCoorddvEXT_remap_index, -1 }, - { WindowPos3svMESA_names, WindowPos3svMESA_remap_index, -1 }, - { WindowPos2fMESA_names, WindowPos2fMESA_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_VERSION_1_5) -static const struct dri_extension_function GL_VERSION_1_5_functions[] = { - { BeginQueryARB_names, BeginQueryARB_remap_index, -1 }, - { GetBufferSubDataARB_names, GetBufferSubDataARB_remap_index, -1 }, - { BufferSubDataARB_names, BufferSubDataARB_remap_index, -1 }, - { GetQueryivARB_names, GetQueryivARB_remap_index, -1 }, - { GetQueryObjectivARB_names, GetQueryObjectivARB_remap_index, -1 }, - { BufferDataARB_names, BufferDataARB_remap_index, -1 }, - { EndQueryARB_names, EndQueryARB_remap_index, -1 }, - { GetBufferPointervARB_names, GetBufferPointervARB_remap_index, -1 }, - { GetQueryObjectuivARB_names, GetQueryObjectuivARB_remap_index, -1 }, - { GetBufferParameterivARB_names, GetBufferParameterivARB_remap_index, -1 }, - { DeleteQueriesARB_names, DeleteQueriesARB_remap_index, -1 }, - { IsQueryARB_names, IsQueryARB_remap_index, -1 }, - { MapBufferARB_names, MapBufferARB_remap_index, -1 }, - { GenQueriesARB_names, GenQueriesARB_remap_index, -1 }, - { IsBufferARB_names, IsBufferARB_remap_index, -1 }, - { DeleteBuffersARB_names, DeleteBuffersARB_remap_index, -1 }, - { UnmapBufferARB_names, UnmapBufferARB_remap_index, -1 }, - { BindBufferARB_names, BindBufferARB_remap_index, -1 }, - { GenBuffersARB_names, GenBuffersARB_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_VERSION_2_0) -static const struct dri_extension_function GL_VERSION_2_0_functions[] = { - { UniformMatrix3fvARB_names, UniformMatrix3fvARB_remap_index, -1 }, - { GetProgramiv_names, GetProgramiv_remap_index, -1 }, - { BlendEquationSeparateEXT_names, BlendEquationSeparateEXT_remap_index, -1 }, - { AttachShader_names, AttachShader_remap_index, -1 }, - { VertexAttrib2fARB_names, VertexAttrib2fARB_remap_index, -1 }, - { VertexAttrib3fARB_names, VertexAttrib3fARB_remap_index, -1 }, - { Uniform2fARB_names, Uniform2fARB_remap_index, -1 }, - { VertexAttrib1svARB_names, VertexAttrib1svARB_remap_index, -1 }, - { Uniform2ivARB_names, Uniform2ivARB_remap_index, -1 }, - { UniformMatrix4fvARB_names, UniformMatrix4fvARB_remap_index, -1 }, - { VertexAttrib4NusvARB_names, VertexAttrib4NusvARB_remap_index, -1 }, - { DisableVertexAttribArrayARB_names, DisableVertexAttribArrayARB_remap_index, -1 }, - { StencilMaskSeparate_names, StencilMaskSeparate_remap_index, -1 }, - { VertexAttrib1fARB_names, VertexAttrib1fARB_remap_index, -1 }, - { GetProgramInfoLog_names, GetProgramInfoLog_remap_index, -1 }, - { VertexAttrib4NbvARB_names, VertexAttrib4NbvARB_remap_index, -1 }, - { GetActiveAttribARB_names, GetActiveAttribARB_remap_index, -1 }, - { Uniform3iARB_names, Uniform3iARB_remap_index, -1 }, - { GetShaderInfoLog_names, GetShaderInfoLog_remap_index, -1 }, - { VertexAttrib1sARB_names, VertexAttrib1sARB_remap_index, -1 }, - { Uniform1fARB_names, Uniform1fARB_remap_index, -1 }, - { StencilOpSeparate_names, StencilOpSeparate_remap_index, -1 }, - { UniformMatrix2fvARB_names, UniformMatrix2fvARB_remap_index, -1 }, - { VertexAttrib3dvARB_names, VertexAttrib3dvARB_remap_index, -1 }, - { Uniform3fvARB_names, Uniform3fvARB_remap_index, -1 }, - { GetVertexAttribivARB_names, GetVertexAttribivARB_remap_index, -1 }, - { CreateProgram_names, CreateProgram_remap_index, -1 }, - { StencilFuncSeparate_names, StencilFuncSeparate_remap_index, -1 }, - { VertexAttrib4ivARB_names, VertexAttrib4ivARB_remap_index, -1 }, - { VertexAttrib4bvARB_names, VertexAttrib4bvARB_remap_index, -1 }, - { VertexAttrib3dARB_names, VertexAttrib3dARB_remap_index, -1 }, - { VertexAttrib4fARB_names, VertexAttrib4fARB_remap_index, -1 }, - { VertexAttrib4fvARB_names, VertexAttrib4fvARB_remap_index, -1 }, - { GetActiveUniformARB_names, GetActiveUniformARB_remap_index, -1 }, - { IsShader_names, IsShader_remap_index, -1 }, - { GetUniformivARB_names, GetUniformivARB_remap_index, -1 }, - { IsProgram_names, IsProgram_remap_index, -1 }, - { Uniform2fvARB_names, Uniform2fvARB_remap_index, -1 }, - { ValidateProgramARB_names, ValidateProgramARB_remap_index, -1 }, - { VertexAttrib2dARB_names, VertexAttrib2dARB_remap_index, -1 }, - { VertexAttrib1dvARB_names, VertexAttrib1dvARB_remap_index, -1 }, - { GetVertexAttribfvARB_names, GetVertexAttribfvARB_remap_index, -1 }, - { GetAttribLocationARB_names, GetAttribLocationARB_remap_index, -1 }, - { VertexAttrib4ubvARB_names, VertexAttrib4ubvARB_remap_index, -1 }, - { Uniform3ivARB_names, Uniform3ivARB_remap_index, -1 }, - { VertexAttrib4sARB_names, VertexAttrib4sARB_remap_index, -1 }, - { VertexAttrib2dvARB_names, VertexAttrib2dvARB_remap_index, -1 }, - { VertexAttrib2fvARB_names, VertexAttrib2fvARB_remap_index, -1 }, - { VertexAttrib4NivARB_names, VertexAttrib4NivARB_remap_index, -1 }, - { GetAttachedShaders_names, GetAttachedShaders_remap_index, -1 }, - { CompileShaderARB_names, CompileShaderARB_remap_index, -1 }, - { DeleteShader_names, DeleteShader_remap_index, -1 }, - { Uniform3fARB_names, Uniform3fARB_remap_index, -1 }, - { VertexAttrib4NuivARB_names, VertexAttrib4NuivARB_remap_index, -1 }, - { Uniform4fARB_names, Uniform4fARB_remap_index, -1 }, - { VertexAttrib1dARB_names, VertexAttrib1dARB_remap_index, -1 }, - { VertexAttrib4usvARB_names, VertexAttrib4usvARB_remap_index, -1 }, - { LinkProgramARB_names, LinkProgramARB_remap_index, -1 }, - { ShaderSourceARB_names, ShaderSourceARB_remap_index, -1 }, - { VertexAttrib3svARB_names, VertexAttrib3svARB_remap_index, -1 }, - { Uniform4ivARB_names, Uniform4ivARB_remap_index, -1 }, - { GetVertexAttribdvARB_names, GetVertexAttribdvARB_remap_index, -1 }, - { Uniform1ivARB_names, Uniform1ivARB_remap_index, -1 }, - { VertexAttrib4dvARB_names, VertexAttrib4dvARB_remap_index, -1 }, - { BindAttribLocationARB_names, BindAttribLocationARB_remap_index, -1 }, - { Uniform1iARB_names, Uniform1iARB_remap_index, -1 }, - { VertexAttribPointerARB_names, VertexAttribPointerARB_remap_index, -1 }, - { VertexAttrib4NsvARB_names, VertexAttrib4NsvARB_remap_index, -1 }, - { VertexAttrib3fvARB_names, VertexAttrib3fvARB_remap_index, -1 }, - { CreateShader_names, CreateShader_remap_index, -1 }, - { DetachShader_names, DetachShader_remap_index, -1 }, - { VertexAttrib4NubARB_names, VertexAttrib4NubARB_remap_index, -1 }, - { Uniform4fvARB_names, Uniform4fvARB_remap_index, -1 }, - { GetUniformfvARB_names, GetUniformfvARB_remap_index, -1 }, - { Uniform4iARB_names, Uniform4iARB_remap_index, -1 }, - { UseProgramObjectARB_names, UseProgramObjectARB_remap_index, -1 }, - { DeleteProgram_names, DeleteProgram_remap_index, -1 }, - { GetVertexAttribPointervNV_names, GetVertexAttribPointervNV_remap_index, -1 }, - { Uniform2iARB_names, Uniform2iARB_remap_index, -1 }, - { VertexAttrib4dARB_names, VertexAttrib4dARB_remap_index, -1 }, - { GetUniformLocationARB_names, GetUniformLocationARB_remap_index, -1 }, - { VertexAttrib3sARB_names, VertexAttrib3sARB_remap_index, -1 }, - { GetShaderSourceARB_names, GetShaderSourceARB_remap_index, -1 }, - { DrawBuffersARB_names, DrawBuffersARB_remap_index, -1 }, - { Uniform1fvARB_names, Uniform1fvARB_remap_index, -1 }, - { EnableVertexAttribArrayARB_names, EnableVertexAttribArrayARB_remap_index, -1 }, - { VertexAttrib4uivARB_names, VertexAttrib4uivARB_remap_index, -1 }, - { VertexAttrib4svARB_names, VertexAttrib4svARB_remap_index, -1 }, - { GetShaderiv_names, GetShaderiv_remap_index, -1 }, - { VertexAttrib2svARB_names, VertexAttrib2svARB_remap_index, -1 }, - { VertexAttrib4NubvARB_names, VertexAttrib4NubvARB_remap_index, -1 }, - { VertexAttrib2sARB_names, VertexAttrib2sARB_remap_index, -1 }, - { VertexAttrib1fvARB_names, VertexAttrib1fvARB_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - -#if defined(need_GL_VERSION_2_1) -static const struct dri_extension_function GL_VERSION_2_1_functions[] = { - { UniformMatrix2x4fv_names, UniformMatrix2x4fv_remap_index, -1 }, - { UniformMatrix4x3fv_names, UniformMatrix4x3fv_remap_index, -1 }, - { UniformMatrix4x2fv_names, UniformMatrix4x2fv_remap_index, -1 }, - { UniformMatrix2x3fv_names, UniformMatrix2x3fv_remap_index, -1 }, - { UniformMatrix3x4fv_names, UniformMatrix3x4fv_remap_index, -1 }, - { UniformMatrix3x2fv_names, UniformMatrix3x2fv_remap_index, -1 }, - { NULL, 0, 0 } -}; -#endif - diff --git a/src/mesa/glapi/Makefile b/src/mesa/glapi/Makefile index 08c376a4b0..684fbfefc1 100644 --- a/src/mesa/glapi/Makefile +++ b/src/mesa/glapi/Makefile @@ -13,7 +13,6 @@ OUTPUTS = glprocs.h glapitemp.h glapioffsets.h glapitable.h dispatch.h \ ../x86/glapi_x86.S \ ../x86-64/glapi_x86-64.S \ ../sparc/glapi_sparc.S \ - ../drivers/dri/common/extension_helper.h \ ../../glx/x11/indirect.c \ ../../glx/x11/indirect.h \ ../../glx/x11/indirect_init.c \ @@ -105,10 +104,6 @@ dispatch.h $(GLX_DIR)/dispatch.h: gl_table.py $(COMMON) ../sparc/glapi_sparc.S: gl_SPARC_asm.py $(COMMON) $(PYTHON2) $(PYTHON_FLAGS) $< > $@ - -../drivers/dri/common/extension_helper.h: extension_helper.py $(COMMON) - $(PYTHON2) $(PYTHON_FLAGS) $< > $@ - ../../glx/x11/indirect.c: glX_proto_send.py $(COMMON_GLX) $(PYTHON2) $(PYTHON_FLAGS) $< -m proto | $(INDENT) $(INDENT_FLAGS) > $@ -- cgit v1.2.3 From 22884db174b9fb0736cec1c6a192f8b9a97500c1 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Fri, 16 Oct 2009 16:01:57 +0800 Subject: glapi: Move dispatch marcos to glapidispatch.h. dispatch.h is kept as a wrapper to glapidispatch.h. Signed-off-by: Chia-I Wu --- src/mesa/glapi/Makefile | 5 +- src/mesa/glapi/dispatch.h | 3982 +-------------------------------------- src/mesa/glapi/gl_table.py | 5 +- src/mesa/glapi/glapidispatch.h | 4005 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 4014 insertions(+), 3983 deletions(-) create mode 100644 src/mesa/glapi/glapidispatch.h (limited to 'src/mesa') diff --git a/src/mesa/glapi/Makefile b/src/mesa/glapi/Makefile index 684fbfefc1..fb6be1a3a9 100644 --- a/src/mesa/glapi/Makefile +++ b/src/mesa/glapi/Makefile @@ -7,7 +7,7 @@ TOP = ../../.. include $(TOP)/configs/current -OUTPUTS = glprocs.h glapitemp.h glapioffsets.h glapitable.h dispatch.h \ +OUTPUTS = glprocs.h glapitemp.h glapioffsets.h glapitable.h glapidispatch.h \ ../main/enums.c \ ../main/remap_helper.h \ ../x86/glapi_x86.S \ @@ -41,6 +41,7 @@ SERVER_OUTPUTS = \ $(GLX_DIR)/glapitemp.h \ $(GLX_DIR)/glapitable.h \ $(GLX_DIR)/glapioffsets.h \ + $(GLX_DIR)/glapidispatch.h \ $(GLX_DIR)/glprocs.h \ $(GLX_DIR)/dispatch.h \ $(SERVER_GLAPI_FILES) @@ -86,7 +87,7 @@ glapioffsets.h $(GLX_DIR)/glapioffsets.h: gl_offsets.py $(COMMON) glapitable.h $(GLX_DIR)/glapitable.h: gl_table.py $(COMMON) $(PYTHON2) $(PYTHON_FLAGS) $< > $@ -dispatch.h $(GLX_DIR)/dispatch.h: gl_table.py $(COMMON) +glapidispatch.h $(GLX_DIR)/glapidispatch.h: gl_table.py $(COMMON) $(PYTHON2) $(PYTHON_FLAGS) $< -m remap_table > $@ ../main/enums.c: gl_enums.py $(COMMON) diff --git a/src/mesa/glapi/dispatch.h b/src/mesa/glapi/dispatch.h index efbd56fa71..dafcf3e8f2 100644 --- a/src/mesa/glapi/dispatch.h +++ b/src/mesa/glapi/dispatch.h @@ -1,5 +1,3 @@ -/* DO NOT EDIT - This file generated automatically by gl_table.py (from Mesa) script */ - /* * (C) Copyright IBM Corporation 2005 * All Rights Reserved. @@ -25,3982 +23,10 @@ * SOFTWARE. */ -#if !defined( _DISPATCH_H_ ) -# define _DISPATCH_H_ - +#ifndef _DISPATCH_H +#define _DISPATCH_H #include "glapitable.h" -/** - * \file dispatch.h - * Macros for handling GL dispatch tables. - * - * For each known GL function, there are 3 macros in this file. The first - * macro is named CALL_FuncName and is used to call that GL function using - * the specified dispatch table. The other 2 macros, called GET_FuncName - * can SET_FuncName, are used to get and set the dispatch pointer for the - * named function in the specified dispatch table. - */ - -#define CALL_by_offset(disp, cast, offset, parameters) \ - (*(cast (GET_by_offset(disp, offset)))) parameters -#define GET_by_offset(disp, offset) \ - (offset >= 0) ? (((_glapi_proc *)(disp))[offset]) : NULL -#define SET_by_offset(disp, offset, fn) \ - do { \ - if ( (offset) < 0 ) { \ - /* fprintf( stderr, "[%s:%u] SET_by_offset(%p, %d, %s)!\n", */ \ - /* __func__, __LINE__, disp, offset, # fn); */ \ - /* abort(); */ \ - } \ - else { \ - ( (_glapi_proc *) (disp) )[offset] = (_glapi_proc) fn; \ - } \ - } while(0) - -#define CALL_NewList(disp, parameters) (*((disp)->NewList)) parameters -#define GET_NewList(disp) ((disp)->NewList) -#define SET_NewList(disp, fn) ((disp)->NewList = fn) -#define CALL_EndList(disp, parameters) (*((disp)->EndList)) parameters -#define GET_EndList(disp) ((disp)->EndList) -#define SET_EndList(disp, fn) ((disp)->EndList = fn) -#define CALL_CallList(disp, parameters) (*((disp)->CallList)) parameters -#define GET_CallList(disp) ((disp)->CallList) -#define SET_CallList(disp, fn) ((disp)->CallList = fn) -#define CALL_CallLists(disp, parameters) (*((disp)->CallLists)) parameters -#define GET_CallLists(disp) ((disp)->CallLists) -#define SET_CallLists(disp, fn) ((disp)->CallLists = fn) -#define CALL_DeleteLists(disp, parameters) (*((disp)->DeleteLists)) parameters -#define GET_DeleteLists(disp) ((disp)->DeleteLists) -#define SET_DeleteLists(disp, fn) ((disp)->DeleteLists = fn) -#define CALL_GenLists(disp, parameters) (*((disp)->GenLists)) parameters -#define GET_GenLists(disp) ((disp)->GenLists) -#define SET_GenLists(disp, fn) ((disp)->GenLists = fn) -#define CALL_ListBase(disp, parameters) (*((disp)->ListBase)) parameters -#define GET_ListBase(disp) ((disp)->ListBase) -#define SET_ListBase(disp, fn) ((disp)->ListBase = fn) -#define CALL_Begin(disp, parameters) (*((disp)->Begin)) parameters -#define GET_Begin(disp) ((disp)->Begin) -#define SET_Begin(disp, fn) ((disp)->Begin = fn) -#define CALL_Bitmap(disp, parameters) (*((disp)->Bitmap)) parameters -#define GET_Bitmap(disp) ((disp)->Bitmap) -#define SET_Bitmap(disp, fn) ((disp)->Bitmap = fn) -#define CALL_Color3b(disp, parameters) (*((disp)->Color3b)) parameters -#define GET_Color3b(disp) ((disp)->Color3b) -#define SET_Color3b(disp, fn) ((disp)->Color3b = fn) -#define CALL_Color3bv(disp, parameters) (*((disp)->Color3bv)) parameters -#define GET_Color3bv(disp) ((disp)->Color3bv) -#define SET_Color3bv(disp, fn) ((disp)->Color3bv = fn) -#define CALL_Color3d(disp, parameters) (*((disp)->Color3d)) parameters -#define GET_Color3d(disp) ((disp)->Color3d) -#define SET_Color3d(disp, fn) ((disp)->Color3d = fn) -#define CALL_Color3dv(disp, parameters) (*((disp)->Color3dv)) parameters -#define GET_Color3dv(disp) ((disp)->Color3dv) -#define SET_Color3dv(disp, fn) ((disp)->Color3dv = fn) -#define CALL_Color3f(disp, parameters) (*((disp)->Color3f)) parameters -#define GET_Color3f(disp) ((disp)->Color3f) -#define SET_Color3f(disp, fn) ((disp)->Color3f = fn) -#define CALL_Color3fv(disp, parameters) (*((disp)->Color3fv)) parameters -#define GET_Color3fv(disp) ((disp)->Color3fv) -#define SET_Color3fv(disp, fn) ((disp)->Color3fv = fn) -#define CALL_Color3i(disp, parameters) (*((disp)->Color3i)) parameters -#define GET_Color3i(disp) ((disp)->Color3i) -#define SET_Color3i(disp, fn) ((disp)->Color3i = fn) -#define CALL_Color3iv(disp, parameters) (*((disp)->Color3iv)) parameters -#define GET_Color3iv(disp) ((disp)->Color3iv) -#define SET_Color3iv(disp, fn) ((disp)->Color3iv = fn) -#define CALL_Color3s(disp, parameters) (*((disp)->Color3s)) parameters -#define GET_Color3s(disp) ((disp)->Color3s) -#define SET_Color3s(disp, fn) ((disp)->Color3s = fn) -#define CALL_Color3sv(disp, parameters) (*((disp)->Color3sv)) parameters -#define GET_Color3sv(disp) ((disp)->Color3sv) -#define SET_Color3sv(disp, fn) ((disp)->Color3sv = fn) -#define CALL_Color3ub(disp, parameters) (*((disp)->Color3ub)) parameters -#define GET_Color3ub(disp) ((disp)->Color3ub) -#define SET_Color3ub(disp, fn) ((disp)->Color3ub = fn) -#define CALL_Color3ubv(disp, parameters) (*((disp)->Color3ubv)) parameters -#define GET_Color3ubv(disp) ((disp)->Color3ubv) -#define SET_Color3ubv(disp, fn) ((disp)->Color3ubv = fn) -#define CALL_Color3ui(disp, parameters) (*((disp)->Color3ui)) parameters -#define GET_Color3ui(disp) ((disp)->Color3ui) -#define SET_Color3ui(disp, fn) ((disp)->Color3ui = fn) -#define CALL_Color3uiv(disp, parameters) (*((disp)->Color3uiv)) parameters -#define GET_Color3uiv(disp) ((disp)->Color3uiv) -#define SET_Color3uiv(disp, fn) ((disp)->Color3uiv = fn) -#define CALL_Color3us(disp, parameters) (*((disp)->Color3us)) parameters -#define GET_Color3us(disp) ((disp)->Color3us) -#define SET_Color3us(disp, fn) ((disp)->Color3us = fn) -#define CALL_Color3usv(disp, parameters) (*((disp)->Color3usv)) parameters -#define GET_Color3usv(disp) ((disp)->Color3usv) -#define SET_Color3usv(disp, fn) ((disp)->Color3usv = fn) -#define CALL_Color4b(disp, parameters) (*((disp)->Color4b)) parameters -#define GET_Color4b(disp) ((disp)->Color4b) -#define SET_Color4b(disp, fn) ((disp)->Color4b = fn) -#define CALL_Color4bv(disp, parameters) (*((disp)->Color4bv)) parameters -#define GET_Color4bv(disp) ((disp)->Color4bv) -#define SET_Color4bv(disp, fn) ((disp)->Color4bv = fn) -#define CALL_Color4d(disp, parameters) (*((disp)->Color4d)) parameters -#define GET_Color4d(disp) ((disp)->Color4d) -#define SET_Color4d(disp, fn) ((disp)->Color4d = fn) -#define CALL_Color4dv(disp, parameters) (*((disp)->Color4dv)) parameters -#define GET_Color4dv(disp) ((disp)->Color4dv) -#define SET_Color4dv(disp, fn) ((disp)->Color4dv = fn) -#define CALL_Color4f(disp, parameters) (*((disp)->Color4f)) parameters -#define GET_Color4f(disp) ((disp)->Color4f) -#define SET_Color4f(disp, fn) ((disp)->Color4f = fn) -#define CALL_Color4fv(disp, parameters) (*((disp)->Color4fv)) parameters -#define GET_Color4fv(disp) ((disp)->Color4fv) -#define SET_Color4fv(disp, fn) ((disp)->Color4fv = fn) -#define CALL_Color4i(disp, parameters) (*((disp)->Color4i)) parameters -#define GET_Color4i(disp) ((disp)->Color4i) -#define SET_Color4i(disp, fn) ((disp)->Color4i = fn) -#define CALL_Color4iv(disp, parameters) (*((disp)->Color4iv)) parameters -#define GET_Color4iv(disp) ((disp)->Color4iv) -#define SET_Color4iv(disp, fn) ((disp)->Color4iv = fn) -#define CALL_Color4s(disp, parameters) (*((disp)->Color4s)) parameters -#define GET_Color4s(disp) ((disp)->Color4s) -#define SET_Color4s(disp, fn) ((disp)->Color4s = fn) -#define CALL_Color4sv(disp, parameters) (*((disp)->Color4sv)) parameters -#define GET_Color4sv(disp) ((disp)->Color4sv) -#define SET_Color4sv(disp, fn) ((disp)->Color4sv = fn) -#define CALL_Color4ub(disp, parameters) (*((disp)->Color4ub)) parameters -#define GET_Color4ub(disp) ((disp)->Color4ub) -#define SET_Color4ub(disp, fn) ((disp)->Color4ub = fn) -#define CALL_Color4ubv(disp, parameters) (*((disp)->Color4ubv)) parameters -#define GET_Color4ubv(disp) ((disp)->Color4ubv) -#define SET_Color4ubv(disp, fn) ((disp)->Color4ubv = fn) -#define CALL_Color4ui(disp, parameters) (*((disp)->Color4ui)) parameters -#define GET_Color4ui(disp) ((disp)->Color4ui) -#define SET_Color4ui(disp, fn) ((disp)->Color4ui = fn) -#define CALL_Color4uiv(disp, parameters) (*((disp)->Color4uiv)) parameters -#define GET_Color4uiv(disp) ((disp)->Color4uiv) -#define SET_Color4uiv(disp, fn) ((disp)->Color4uiv = fn) -#define CALL_Color4us(disp, parameters) (*((disp)->Color4us)) parameters -#define GET_Color4us(disp) ((disp)->Color4us) -#define SET_Color4us(disp, fn) ((disp)->Color4us = fn) -#define CALL_Color4usv(disp, parameters) (*((disp)->Color4usv)) parameters -#define GET_Color4usv(disp) ((disp)->Color4usv) -#define SET_Color4usv(disp, fn) ((disp)->Color4usv = fn) -#define CALL_EdgeFlag(disp, parameters) (*((disp)->EdgeFlag)) parameters -#define GET_EdgeFlag(disp) ((disp)->EdgeFlag) -#define SET_EdgeFlag(disp, fn) ((disp)->EdgeFlag = fn) -#define CALL_EdgeFlagv(disp, parameters) (*((disp)->EdgeFlagv)) parameters -#define GET_EdgeFlagv(disp) ((disp)->EdgeFlagv) -#define SET_EdgeFlagv(disp, fn) ((disp)->EdgeFlagv = fn) -#define CALL_End(disp, parameters) (*((disp)->End)) parameters -#define GET_End(disp) ((disp)->End) -#define SET_End(disp, fn) ((disp)->End = fn) -#define CALL_Indexd(disp, parameters) (*((disp)->Indexd)) parameters -#define GET_Indexd(disp) ((disp)->Indexd) -#define SET_Indexd(disp, fn) ((disp)->Indexd = fn) -#define CALL_Indexdv(disp, parameters) (*((disp)->Indexdv)) parameters -#define GET_Indexdv(disp) ((disp)->Indexdv) -#define SET_Indexdv(disp, fn) ((disp)->Indexdv = fn) -#define CALL_Indexf(disp, parameters) (*((disp)->Indexf)) parameters -#define GET_Indexf(disp) ((disp)->Indexf) -#define SET_Indexf(disp, fn) ((disp)->Indexf = fn) -#define CALL_Indexfv(disp, parameters) (*((disp)->Indexfv)) parameters -#define GET_Indexfv(disp) ((disp)->Indexfv) -#define SET_Indexfv(disp, fn) ((disp)->Indexfv = fn) -#define CALL_Indexi(disp, parameters) (*((disp)->Indexi)) parameters -#define GET_Indexi(disp) ((disp)->Indexi) -#define SET_Indexi(disp, fn) ((disp)->Indexi = fn) -#define CALL_Indexiv(disp, parameters) (*((disp)->Indexiv)) parameters -#define GET_Indexiv(disp) ((disp)->Indexiv) -#define SET_Indexiv(disp, fn) ((disp)->Indexiv = fn) -#define CALL_Indexs(disp, parameters) (*((disp)->Indexs)) parameters -#define GET_Indexs(disp) ((disp)->Indexs) -#define SET_Indexs(disp, fn) ((disp)->Indexs = fn) -#define CALL_Indexsv(disp, parameters) (*((disp)->Indexsv)) parameters -#define GET_Indexsv(disp) ((disp)->Indexsv) -#define SET_Indexsv(disp, fn) ((disp)->Indexsv = fn) -#define CALL_Normal3b(disp, parameters) (*((disp)->Normal3b)) parameters -#define GET_Normal3b(disp) ((disp)->Normal3b) -#define SET_Normal3b(disp, fn) ((disp)->Normal3b = fn) -#define CALL_Normal3bv(disp, parameters) (*((disp)->Normal3bv)) parameters -#define GET_Normal3bv(disp) ((disp)->Normal3bv) -#define SET_Normal3bv(disp, fn) ((disp)->Normal3bv = fn) -#define CALL_Normal3d(disp, parameters) (*((disp)->Normal3d)) parameters -#define GET_Normal3d(disp) ((disp)->Normal3d) -#define SET_Normal3d(disp, fn) ((disp)->Normal3d = fn) -#define CALL_Normal3dv(disp, parameters) (*((disp)->Normal3dv)) parameters -#define GET_Normal3dv(disp) ((disp)->Normal3dv) -#define SET_Normal3dv(disp, fn) ((disp)->Normal3dv = fn) -#define CALL_Normal3f(disp, parameters) (*((disp)->Normal3f)) parameters -#define GET_Normal3f(disp) ((disp)->Normal3f) -#define SET_Normal3f(disp, fn) ((disp)->Normal3f = fn) -#define CALL_Normal3fv(disp, parameters) (*((disp)->Normal3fv)) parameters -#define GET_Normal3fv(disp) ((disp)->Normal3fv) -#define SET_Normal3fv(disp, fn) ((disp)->Normal3fv = fn) -#define CALL_Normal3i(disp, parameters) (*((disp)->Normal3i)) parameters -#define GET_Normal3i(disp) ((disp)->Normal3i) -#define SET_Normal3i(disp, fn) ((disp)->Normal3i = fn) -#define CALL_Normal3iv(disp, parameters) (*((disp)->Normal3iv)) parameters -#define GET_Normal3iv(disp) ((disp)->Normal3iv) -#define SET_Normal3iv(disp, fn) ((disp)->Normal3iv = fn) -#define CALL_Normal3s(disp, parameters) (*((disp)->Normal3s)) parameters -#define GET_Normal3s(disp) ((disp)->Normal3s) -#define SET_Normal3s(disp, fn) ((disp)->Normal3s = fn) -#define CALL_Normal3sv(disp, parameters) (*((disp)->Normal3sv)) parameters -#define GET_Normal3sv(disp) ((disp)->Normal3sv) -#define SET_Normal3sv(disp, fn) ((disp)->Normal3sv = fn) -#define CALL_RasterPos2d(disp, parameters) (*((disp)->RasterPos2d)) parameters -#define GET_RasterPos2d(disp) ((disp)->RasterPos2d) -#define SET_RasterPos2d(disp, fn) ((disp)->RasterPos2d = fn) -#define CALL_RasterPos2dv(disp, parameters) (*((disp)->RasterPos2dv)) parameters -#define GET_RasterPos2dv(disp) ((disp)->RasterPos2dv) -#define SET_RasterPos2dv(disp, fn) ((disp)->RasterPos2dv = fn) -#define CALL_RasterPos2f(disp, parameters) (*((disp)->RasterPos2f)) parameters -#define GET_RasterPos2f(disp) ((disp)->RasterPos2f) -#define SET_RasterPos2f(disp, fn) ((disp)->RasterPos2f = fn) -#define CALL_RasterPos2fv(disp, parameters) (*((disp)->RasterPos2fv)) parameters -#define GET_RasterPos2fv(disp) ((disp)->RasterPos2fv) -#define SET_RasterPos2fv(disp, fn) ((disp)->RasterPos2fv = fn) -#define CALL_RasterPos2i(disp, parameters) (*((disp)->RasterPos2i)) parameters -#define GET_RasterPos2i(disp) ((disp)->RasterPos2i) -#define SET_RasterPos2i(disp, fn) ((disp)->RasterPos2i = fn) -#define CALL_RasterPos2iv(disp, parameters) (*((disp)->RasterPos2iv)) parameters -#define GET_RasterPos2iv(disp) ((disp)->RasterPos2iv) -#define SET_RasterPos2iv(disp, fn) ((disp)->RasterPos2iv = fn) -#define CALL_RasterPos2s(disp, parameters) (*((disp)->RasterPos2s)) parameters -#define GET_RasterPos2s(disp) ((disp)->RasterPos2s) -#define SET_RasterPos2s(disp, fn) ((disp)->RasterPos2s = fn) -#define CALL_RasterPos2sv(disp, parameters) (*((disp)->RasterPos2sv)) parameters -#define GET_RasterPos2sv(disp) ((disp)->RasterPos2sv) -#define SET_RasterPos2sv(disp, fn) ((disp)->RasterPos2sv = fn) -#define CALL_RasterPos3d(disp, parameters) (*((disp)->RasterPos3d)) parameters -#define GET_RasterPos3d(disp) ((disp)->RasterPos3d) -#define SET_RasterPos3d(disp, fn) ((disp)->RasterPos3d = fn) -#define CALL_RasterPos3dv(disp, parameters) (*((disp)->RasterPos3dv)) parameters -#define GET_RasterPos3dv(disp) ((disp)->RasterPos3dv) -#define SET_RasterPos3dv(disp, fn) ((disp)->RasterPos3dv = fn) -#define CALL_RasterPos3f(disp, parameters) (*((disp)->RasterPos3f)) parameters -#define GET_RasterPos3f(disp) ((disp)->RasterPos3f) -#define SET_RasterPos3f(disp, fn) ((disp)->RasterPos3f = fn) -#define CALL_RasterPos3fv(disp, parameters) (*((disp)->RasterPos3fv)) parameters -#define GET_RasterPos3fv(disp) ((disp)->RasterPos3fv) -#define SET_RasterPos3fv(disp, fn) ((disp)->RasterPos3fv = fn) -#define CALL_RasterPos3i(disp, parameters) (*((disp)->RasterPos3i)) parameters -#define GET_RasterPos3i(disp) ((disp)->RasterPos3i) -#define SET_RasterPos3i(disp, fn) ((disp)->RasterPos3i = fn) -#define CALL_RasterPos3iv(disp, parameters) (*((disp)->RasterPos3iv)) parameters -#define GET_RasterPos3iv(disp) ((disp)->RasterPos3iv) -#define SET_RasterPos3iv(disp, fn) ((disp)->RasterPos3iv = fn) -#define CALL_RasterPos3s(disp, parameters) (*((disp)->RasterPos3s)) parameters -#define GET_RasterPos3s(disp) ((disp)->RasterPos3s) -#define SET_RasterPos3s(disp, fn) ((disp)->RasterPos3s = fn) -#define CALL_RasterPos3sv(disp, parameters) (*((disp)->RasterPos3sv)) parameters -#define GET_RasterPos3sv(disp) ((disp)->RasterPos3sv) -#define SET_RasterPos3sv(disp, fn) ((disp)->RasterPos3sv = fn) -#define CALL_RasterPos4d(disp, parameters) (*((disp)->RasterPos4d)) parameters -#define GET_RasterPos4d(disp) ((disp)->RasterPos4d) -#define SET_RasterPos4d(disp, fn) ((disp)->RasterPos4d = fn) -#define CALL_RasterPos4dv(disp, parameters) (*((disp)->RasterPos4dv)) parameters -#define GET_RasterPos4dv(disp) ((disp)->RasterPos4dv) -#define SET_RasterPos4dv(disp, fn) ((disp)->RasterPos4dv = fn) -#define CALL_RasterPos4f(disp, parameters) (*((disp)->RasterPos4f)) parameters -#define GET_RasterPos4f(disp) ((disp)->RasterPos4f) -#define SET_RasterPos4f(disp, fn) ((disp)->RasterPos4f = fn) -#define CALL_RasterPos4fv(disp, parameters) (*((disp)->RasterPos4fv)) parameters -#define GET_RasterPos4fv(disp) ((disp)->RasterPos4fv) -#define SET_RasterPos4fv(disp, fn) ((disp)->RasterPos4fv = fn) -#define CALL_RasterPos4i(disp, parameters) (*((disp)->RasterPos4i)) parameters -#define GET_RasterPos4i(disp) ((disp)->RasterPos4i) -#define SET_RasterPos4i(disp, fn) ((disp)->RasterPos4i = fn) -#define CALL_RasterPos4iv(disp, parameters) (*((disp)->RasterPos4iv)) parameters -#define GET_RasterPos4iv(disp) ((disp)->RasterPos4iv) -#define SET_RasterPos4iv(disp, fn) ((disp)->RasterPos4iv = fn) -#define CALL_RasterPos4s(disp, parameters) (*((disp)->RasterPos4s)) parameters -#define GET_RasterPos4s(disp) ((disp)->RasterPos4s) -#define SET_RasterPos4s(disp, fn) ((disp)->RasterPos4s = fn) -#define CALL_RasterPos4sv(disp, parameters) (*((disp)->RasterPos4sv)) parameters -#define GET_RasterPos4sv(disp) ((disp)->RasterPos4sv) -#define SET_RasterPos4sv(disp, fn) ((disp)->RasterPos4sv = fn) -#define CALL_Rectd(disp, parameters) (*((disp)->Rectd)) parameters -#define GET_Rectd(disp) ((disp)->Rectd) -#define SET_Rectd(disp, fn) ((disp)->Rectd = fn) -#define CALL_Rectdv(disp, parameters) (*((disp)->Rectdv)) parameters -#define GET_Rectdv(disp) ((disp)->Rectdv) -#define SET_Rectdv(disp, fn) ((disp)->Rectdv = fn) -#define CALL_Rectf(disp, parameters) (*((disp)->Rectf)) parameters -#define GET_Rectf(disp) ((disp)->Rectf) -#define SET_Rectf(disp, fn) ((disp)->Rectf = fn) -#define CALL_Rectfv(disp, parameters) (*((disp)->Rectfv)) parameters -#define GET_Rectfv(disp) ((disp)->Rectfv) -#define SET_Rectfv(disp, fn) ((disp)->Rectfv = fn) -#define CALL_Recti(disp, parameters) (*((disp)->Recti)) parameters -#define GET_Recti(disp) ((disp)->Recti) -#define SET_Recti(disp, fn) ((disp)->Recti = fn) -#define CALL_Rectiv(disp, parameters) (*((disp)->Rectiv)) parameters -#define GET_Rectiv(disp) ((disp)->Rectiv) -#define SET_Rectiv(disp, fn) ((disp)->Rectiv = fn) -#define CALL_Rects(disp, parameters) (*((disp)->Rects)) parameters -#define GET_Rects(disp) ((disp)->Rects) -#define SET_Rects(disp, fn) ((disp)->Rects = fn) -#define CALL_Rectsv(disp, parameters) (*((disp)->Rectsv)) parameters -#define GET_Rectsv(disp) ((disp)->Rectsv) -#define SET_Rectsv(disp, fn) ((disp)->Rectsv = fn) -#define CALL_TexCoord1d(disp, parameters) (*((disp)->TexCoord1d)) parameters -#define GET_TexCoord1d(disp) ((disp)->TexCoord1d) -#define SET_TexCoord1d(disp, fn) ((disp)->TexCoord1d = fn) -#define CALL_TexCoord1dv(disp, parameters) (*((disp)->TexCoord1dv)) parameters -#define GET_TexCoord1dv(disp) ((disp)->TexCoord1dv) -#define SET_TexCoord1dv(disp, fn) ((disp)->TexCoord1dv = fn) -#define CALL_TexCoord1f(disp, parameters) (*((disp)->TexCoord1f)) parameters -#define GET_TexCoord1f(disp) ((disp)->TexCoord1f) -#define SET_TexCoord1f(disp, fn) ((disp)->TexCoord1f = fn) -#define CALL_TexCoord1fv(disp, parameters) (*((disp)->TexCoord1fv)) parameters -#define GET_TexCoord1fv(disp) ((disp)->TexCoord1fv) -#define SET_TexCoord1fv(disp, fn) ((disp)->TexCoord1fv = fn) -#define CALL_TexCoord1i(disp, parameters) (*((disp)->TexCoord1i)) parameters -#define GET_TexCoord1i(disp) ((disp)->TexCoord1i) -#define SET_TexCoord1i(disp, fn) ((disp)->TexCoord1i = fn) -#define CALL_TexCoord1iv(disp, parameters) (*((disp)->TexCoord1iv)) parameters -#define GET_TexCoord1iv(disp) ((disp)->TexCoord1iv) -#define SET_TexCoord1iv(disp, fn) ((disp)->TexCoord1iv = fn) -#define CALL_TexCoord1s(disp, parameters) (*((disp)->TexCoord1s)) parameters -#define GET_TexCoord1s(disp) ((disp)->TexCoord1s) -#define SET_TexCoord1s(disp, fn) ((disp)->TexCoord1s = fn) -#define CALL_TexCoord1sv(disp, parameters) (*((disp)->TexCoord1sv)) parameters -#define GET_TexCoord1sv(disp) ((disp)->TexCoord1sv) -#define SET_TexCoord1sv(disp, fn) ((disp)->TexCoord1sv = fn) -#define CALL_TexCoord2d(disp, parameters) (*((disp)->TexCoord2d)) parameters -#define GET_TexCoord2d(disp) ((disp)->TexCoord2d) -#define SET_TexCoord2d(disp, fn) ((disp)->TexCoord2d = fn) -#define CALL_TexCoord2dv(disp, parameters) (*((disp)->TexCoord2dv)) parameters -#define GET_TexCoord2dv(disp) ((disp)->TexCoord2dv) -#define SET_TexCoord2dv(disp, fn) ((disp)->TexCoord2dv = fn) -#define CALL_TexCoord2f(disp, parameters) (*((disp)->TexCoord2f)) parameters -#define GET_TexCoord2f(disp) ((disp)->TexCoord2f) -#define SET_TexCoord2f(disp, fn) ((disp)->TexCoord2f = fn) -#define CALL_TexCoord2fv(disp, parameters) (*((disp)->TexCoord2fv)) parameters -#define GET_TexCoord2fv(disp) ((disp)->TexCoord2fv) -#define SET_TexCoord2fv(disp, fn) ((disp)->TexCoord2fv = fn) -#define CALL_TexCoord2i(disp, parameters) (*((disp)->TexCoord2i)) parameters -#define GET_TexCoord2i(disp) ((disp)->TexCoord2i) -#define SET_TexCoord2i(disp, fn) ((disp)->TexCoord2i = fn) -#define CALL_TexCoord2iv(disp, parameters) (*((disp)->TexCoord2iv)) parameters -#define GET_TexCoord2iv(disp) ((disp)->TexCoord2iv) -#define SET_TexCoord2iv(disp, fn) ((disp)->TexCoord2iv = fn) -#define CALL_TexCoord2s(disp, parameters) (*((disp)->TexCoord2s)) parameters -#define GET_TexCoord2s(disp) ((disp)->TexCoord2s) -#define SET_TexCoord2s(disp, fn) ((disp)->TexCoord2s = fn) -#define CALL_TexCoord2sv(disp, parameters) (*((disp)->TexCoord2sv)) parameters -#define GET_TexCoord2sv(disp) ((disp)->TexCoord2sv) -#define SET_TexCoord2sv(disp, fn) ((disp)->TexCoord2sv = fn) -#define CALL_TexCoord3d(disp, parameters) (*((disp)->TexCoord3d)) parameters -#define GET_TexCoord3d(disp) ((disp)->TexCoord3d) -#define SET_TexCoord3d(disp, fn) ((disp)->TexCoord3d = fn) -#define CALL_TexCoord3dv(disp, parameters) (*((disp)->TexCoord3dv)) parameters -#define GET_TexCoord3dv(disp) ((disp)->TexCoord3dv) -#define SET_TexCoord3dv(disp, fn) ((disp)->TexCoord3dv = fn) -#define CALL_TexCoord3f(disp, parameters) (*((disp)->TexCoord3f)) parameters -#define GET_TexCoord3f(disp) ((disp)->TexCoord3f) -#define SET_TexCoord3f(disp, fn) ((disp)->TexCoord3f = fn) -#define CALL_TexCoord3fv(disp, parameters) (*((disp)->TexCoord3fv)) parameters -#define GET_TexCoord3fv(disp) ((disp)->TexCoord3fv) -#define SET_TexCoord3fv(disp, fn) ((disp)->TexCoord3fv = fn) -#define CALL_TexCoord3i(disp, parameters) (*((disp)->TexCoord3i)) parameters -#define GET_TexCoord3i(disp) ((disp)->TexCoord3i) -#define SET_TexCoord3i(disp, fn) ((disp)->TexCoord3i = fn) -#define CALL_TexCoord3iv(disp, parameters) (*((disp)->TexCoord3iv)) parameters -#define GET_TexCoord3iv(disp) ((disp)->TexCoord3iv) -#define SET_TexCoord3iv(disp, fn) ((disp)->TexCoord3iv = fn) -#define CALL_TexCoord3s(disp, parameters) (*((disp)->TexCoord3s)) parameters -#define GET_TexCoord3s(disp) ((disp)->TexCoord3s) -#define SET_TexCoord3s(disp, fn) ((disp)->TexCoord3s = fn) -#define CALL_TexCoord3sv(disp, parameters) (*((disp)->TexCoord3sv)) parameters -#define GET_TexCoord3sv(disp) ((disp)->TexCoord3sv) -#define SET_TexCoord3sv(disp, fn) ((disp)->TexCoord3sv = fn) -#define CALL_TexCoord4d(disp, parameters) (*((disp)->TexCoord4d)) parameters -#define GET_TexCoord4d(disp) ((disp)->TexCoord4d) -#define SET_TexCoord4d(disp, fn) ((disp)->TexCoord4d = fn) -#define CALL_TexCoord4dv(disp, parameters) (*((disp)->TexCoord4dv)) parameters -#define GET_TexCoord4dv(disp) ((disp)->TexCoord4dv) -#define SET_TexCoord4dv(disp, fn) ((disp)->TexCoord4dv = fn) -#define CALL_TexCoord4f(disp, parameters) (*((disp)->TexCoord4f)) parameters -#define GET_TexCoord4f(disp) ((disp)->TexCoord4f) -#define SET_TexCoord4f(disp, fn) ((disp)->TexCoord4f = fn) -#define CALL_TexCoord4fv(disp, parameters) (*((disp)->TexCoord4fv)) parameters -#define GET_TexCoord4fv(disp) ((disp)->TexCoord4fv) -#define SET_TexCoord4fv(disp, fn) ((disp)->TexCoord4fv = fn) -#define CALL_TexCoord4i(disp, parameters) (*((disp)->TexCoord4i)) parameters -#define GET_TexCoord4i(disp) ((disp)->TexCoord4i) -#define SET_TexCoord4i(disp, fn) ((disp)->TexCoord4i = fn) -#define CALL_TexCoord4iv(disp, parameters) (*((disp)->TexCoord4iv)) parameters -#define GET_TexCoord4iv(disp) ((disp)->TexCoord4iv) -#define SET_TexCoord4iv(disp, fn) ((disp)->TexCoord4iv = fn) -#define CALL_TexCoord4s(disp, parameters) (*((disp)->TexCoord4s)) parameters -#define GET_TexCoord4s(disp) ((disp)->TexCoord4s) -#define SET_TexCoord4s(disp, fn) ((disp)->TexCoord4s = fn) -#define CALL_TexCoord4sv(disp, parameters) (*((disp)->TexCoord4sv)) parameters -#define GET_TexCoord4sv(disp) ((disp)->TexCoord4sv) -#define SET_TexCoord4sv(disp, fn) ((disp)->TexCoord4sv = fn) -#define CALL_Vertex2d(disp, parameters) (*((disp)->Vertex2d)) parameters -#define GET_Vertex2d(disp) ((disp)->Vertex2d) -#define SET_Vertex2d(disp, fn) ((disp)->Vertex2d = fn) -#define CALL_Vertex2dv(disp, parameters) (*((disp)->Vertex2dv)) parameters -#define GET_Vertex2dv(disp) ((disp)->Vertex2dv) -#define SET_Vertex2dv(disp, fn) ((disp)->Vertex2dv = fn) -#define CALL_Vertex2f(disp, parameters) (*((disp)->Vertex2f)) parameters -#define GET_Vertex2f(disp) ((disp)->Vertex2f) -#define SET_Vertex2f(disp, fn) ((disp)->Vertex2f = fn) -#define CALL_Vertex2fv(disp, parameters) (*((disp)->Vertex2fv)) parameters -#define GET_Vertex2fv(disp) ((disp)->Vertex2fv) -#define SET_Vertex2fv(disp, fn) ((disp)->Vertex2fv = fn) -#define CALL_Vertex2i(disp, parameters) (*((disp)->Vertex2i)) parameters -#define GET_Vertex2i(disp) ((disp)->Vertex2i) -#define SET_Vertex2i(disp, fn) ((disp)->Vertex2i = fn) -#define CALL_Vertex2iv(disp, parameters) (*((disp)->Vertex2iv)) parameters -#define GET_Vertex2iv(disp) ((disp)->Vertex2iv) -#define SET_Vertex2iv(disp, fn) ((disp)->Vertex2iv = fn) -#define CALL_Vertex2s(disp, parameters) (*((disp)->Vertex2s)) parameters -#define GET_Vertex2s(disp) ((disp)->Vertex2s) -#define SET_Vertex2s(disp, fn) ((disp)->Vertex2s = fn) -#define CALL_Vertex2sv(disp, parameters) (*((disp)->Vertex2sv)) parameters -#define GET_Vertex2sv(disp) ((disp)->Vertex2sv) -#define SET_Vertex2sv(disp, fn) ((disp)->Vertex2sv = fn) -#define CALL_Vertex3d(disp, parameters) (*((disp)->Vertex3d)) parameters -#define GET_Vertex3d(disp) ((disp)->Vertex3d) -#define SET_Vertex3d(disp, fn) ((disp)->Vertex3d = fn) -#define CALL_Vertex3dv(disp, parameters) (*((disp)->Vertex3dv)) parameters -#define GET_Vertex3dv(disp) ((disp)->Vertex3dv) -#define SET_Vertex3dv(disp, fn) ((disp)->Vertex3dv = fn) -#define CALL_Vertex3f(disp, parameters) (*((disp)->Vertex3f)) parameters -#define GET_Vertex3f(disp) ((disp)->Vertex3f) -#define SET_Vertex3f(disp, fn) ((disp)->Vertex3f = fn) -#define CALL_Vertex3fv(disp, parameters) (*((disp)->Vertex3fv)) parameters -#define GET_Vertex3fv(disp) ((disp)->Vertex3fv) -#define SET_Vertex3fv(disp, fn) ((disp)->Vertex3fv = fn) -#define CALL_Vertex3i(disp, parameters) (*((disp)->Vertex3i)) parameters -#define GET_Vertex3i(disp) ((disp)->Vertex3i) -#define SET_Vertex3i(disp, fn) ((disp)->Vertex3i = fn) -#define CALL_Vertex3iv(disp, parameters) (*((disp)->Vertex3iv)) parameters -#define GET_Vertex3iv(disp) ((disp)->Vertex3iv) -#define SET_Vertex3iv(disp, fn) ((disp)->Vertex3iv = fn) -#define CALL_Vertex3s(disp, parameters) (*((disp)->Vertex3s)) parameters -#define GET_Vertex3s(disp) ((disp)->Vertex3s) -#define SET_Vertex3s(disp, fn) ((disp)->Vertex3s = fn) -#define CALL_Vertex3sv(disp, parameters) (*((disp)->Vertex3sv)) parameters -#define GET_Vertex3sv(disp) ((disp)->Vertex3sv) -#define SET_Vertex3sv(disp, fn) ((disp)->Vertex3sv = fn) -#define CALL_Vertex4d(disp, parameters) (*((disp)->Vertex4d)) parameters -#define GET_Vertex4d(disp) ((disp)->Vertex4d) -#define SET_Vertex4d(disp, fn) ((disp)->Vertex4d = fn) -#define CALL_Vertex4dv(disp, parameters) (*((disp)->Vertex4dv)) parameters -#define GET_Vertex4dv(disp) ((disp)->Vertex4dv) -#define SET_Vertex4dv(disp, fn) ((disp)->Vertex4dv = fn) -#define CALL_Vertex4f(disp, parameters) (*((disp)->Vertex4f)) parameters -#define GET_Vertex4f(disp) ((disp)->Vertex4f) -#define SET_Vertex4f(disp, fn) ((disp)->Vertex4f = fn) -#define CALL_Vertex4fv(disp, parameters) (*((disp)->Vertex4fv)) parameters -#define GET_Vertex4fv(disp) ((disp)->Vertex4fv) -#define SET_Vertex4fv(disp, fn) ((disp)->Vertex4fv = fn) -#define CALL_Vertex4i(disp, parameters) (*((disp)->Vertex4i)) parameters -#define GET_Vertex4i(disp) ((disp)->Vertex4i) -#define SET_Vertex4i(disp, fn) ((disp)->Vertex4i = fn) -#define CALL_Vertex4iv(disp, parameters) (*((disp)->Vertex4iv)) parameters -#define GET_Vertex4iv(disp) ((disp)->Vertex4iv) -#define SET_Vertex4iv(disp, fn) ((disp)->Vertex4iv = fn) -#define CALL_Vertex4s(disp, parameters) (*((disp)->Vertex4s)) parameters -#define GET_Vertex4s(disp) ((disp)->Vertex4s) -#define SET_Vertex4s(disp, fn) ((disp)->Vertex4s = fn) -#define CALL_Vertex4sv(disp, parameters) (*((disp)->Vertex4sv)) parameters -#define GET_Vertex4sv(disp) ((disp)->Vertex4sv) -#define SET_Vertex4sv(disp, fn) ((disp)->Vertex4sv = fn) -#define CALL_ClipPlane(disp, parameters) (*((disp)->ClipPlane)) parameters -#define GET_ClipPlane(disp) ((disp)->ClipPlane) -#define SET_ClipPlane(disp, fn) ((disp)->ClipPlane = fn) -#define CALL_ColorMaterial(disp, parameters) (*((disp)->ColorMaterial)) parameters -#define GET_ColorMaterial(disp) ((disp)->ColorMaterial) -#define SET_ColorMaterial(disp, fn) ((disp)->ColorMaterial = fn) -#define CALL_CullFace(disp, parameters) (*((disp)->CullFace)) parameters -#define GET_CullFace(disp) ((disp)->CullFace) -#define SET_CullFace(disp, fn) ((disp)->CullFace = fn) -#define CALL_Fogf(disp, parameters) (*((disp)->Fogf)) parameters -#define GET_Fogf(disp) ((disp)->Fogf) -#define SET_Fogf(disp, fn) ((disp)->Fogf = fn) -#define CALL_Fogfv(disp, parameters) (*((disp)->Fogfv)) parameters -#define GET_Fogfv(disp) ((disp)->Fogfv) -#define SET_Fogfv(disp, fn) ((disp)->Fogfv = fn) -#define CALL_Fogi(disp, parameters) (*((disp)->Fogi)) parameters -#define GET_Fogi(disp) ((disp)->Fogi) -#define SET_Fogi(disp, fn) ((disp)->Fogi = fn) -#define CALL_Fogiv(disp, parameters) (*((disp)->Fogiv)) parameters -#define GET_Fogiv(disp) ((disp)->Fogiv) -#define SET_Fogiv(disp, fn) ((disp)->Fogiv = fn) -#define CALL_FrontFace(disp, parameters) (*((disp)->FrontFace)) parameters -#define GET_FrontFace(disp) ((disp)->FrontFace) -#define SET_FrontFace(disp, fn) ((disp)->FrontFace = fn) -#define CALL_Hint(disp, parameters) (*((disp)->Hint)) parameters -#define GET_Hint(disp) ((disp)->Hint) -#define SET_Hint(disp, fn) ((disp)->Hint = fn) -#define CALL_Lightf(disp, parameters) (*((disp)->Lightf)) parameters -#define GET_Lightf(disp) ((disp)->Lightf) -#define SET_Lightf(disp, fn) ((disp)->Lightf = fn) -#define CALL_Lightfv(disp, parameters) (*((disp)->Lightfv)) parameters -#define GET_Lightfv(disp) ((disp)->Lightfv) -#define SET_Lightfv(disp, fn) ((disp)->Lightfv = fn) -#define CALL_Lighti(disp, parameters) (*((disp)->Lighti)) parameters -#define GET_Lighti(disp) ((disp)->Lighti) -#define SET_Lighti(disp, fn) ((disp)->Lighti = fn) -#define CALL_Lightiv(disp, parameters) (*((disp)->Lightiv)) parameters -#define GET_Lightiv(disp) ((disp)->Lightiv) -#define SET_Lightiv(disp, fn) ((disp)->Lightiv = fn) -#define CALL_LightModelf(disp, parameters) (*((disp)->LightModelf)) parameters -#define GET_LightModelf(disp) ((disp)->LightModelf) -#define SET_LightModelf(disp, fn) ((disp)->LightModelf = fn) -#define CALL_LightModelfv(disp, parameters) (*((disp)->LightModelfv)) parameters -#define GET_LightModelfv(disp) ((disp)->LightModelfv) -#define SET_LightModelfv(disp, fn) ((disp)->LightModelfv = fn) -#define CALL_LightModeli(disp, parameters) (*((disp)->LightModeli)) parameters -#define GET_LightModeli(disp) ((disp)->LightModeli) -#define SET_LightModeli(disp, fn) ((disp)->LightModeli = fn) -#define CALL_LightModeliv(disp, parameters) (*((disp)->LightModeliv)) parameters -#define GET_LightModeliv(disp) ((disp)->LightModeliv) -#define SET_LightModeliv(disp, fn) ((disp)->LightModeliv = fn) -#define CALL_LineStipple(disp, parameters) (*((disp)->LineStipple)) parameters -#define GET_LineStipple(disp) ((disp)->LineStipple) -#define SET_LineStipple(disp, fn) ((disp)->LineStipple = fn) -#define CALL_LineWidth(disp, parameters) (*((disp)->LineWidth)) parameters -#define GET_LineWidth(disp) ((disp)->LineWidth) -#define SET_LineWidth(disp, fn) ((disp)->LineWidth = fn) -#define CALL_Materialf(disp, parameters) (*((disp)->Materialf)) parameters -#define GET_Materialf(disp) ((disp)->Materialf) -#define SET_Materialf(disp, fn) ((disp)->Materialf = fn) -#define CALL_Materialfv(disp, parameters) (*((disp)->Materialfv)) parameters -#define GET_Materialfv(disp) ((disp)->Materialfv) -#define SET_Materialfv(disp, fn) ((disp)->Materialfv = fn) -#define CALL_Materiali(disp, parameters) (*((disp)->Materiali)) parameters -#define GET_Materiali(disp) ((disp)->Materiali) -#define SET_Materiali(disp, fn) ((disp)->Materiali = fn) -#define CALL_Materialiv(disp, parameters) (*((disp)->Materialiv)) parameters -#define GET_Materialiv(disp) ((disp)->Materialiv) -#define SET_Materialiv(disp, fn) ((disp)->Materialiv = fn) -#define CALL_PointSize(disp, parameters) (*((disp)->PointSize)) parameters -#define GET_PointSize(disp) ((disp)->PointSize) -#define SET_PointSize(disp, fn) ((disp)->PointSize = fn) -#define CALL_PolygonMode(disp, parameters) (*((disp)->PolygonMode)) parameters -#define GET_PolygonMode(disp) ((disp)->PolygonMode) -#define SET_PolygonMode(disp, fn) ((disp)->PolygonMode = fn) -#define CALL_PolygonStipple(disp, parameters) (*((disp)->PolygonStipple)) parameters -#define GET_PolygonStipple(disp) ((disp)->PolygonStipple) -#define SET_PolygonStipple(disp, fn) ((disp)->PolygonStipple = fn) -#define CALL_Scissor(disp, parameters) (*((disp)->Scissor)) parameters -#define GET_Scissor(disp) ((disp)->Scissor) -#define SET_Scissor(disp, fn) ((disp)->Scissor = fn) -#define CALL_ShadeModel(disp, parameters) (*((disp)->ShadeModel)) parameters -#define GET_ShadeModel(disp) ((disp)->ShadeModel) -#define SET_ShadeModel(disp, fn) ((disp)->ShadeModel = fn) -#define CALL_TexParameterf(disp, parameters) (*((disp)->TexParameterf)) parameters -#define GET_TexParameterf(disp) ((disp)->TexParameterf) -#define SET_TexParameterf(disp, fn) ((disp)->TexParameterf = fn) -#define CALL_TexParameterfv(disp, parameters) (*((disp)->TexParameterfv)) parameters -#define GET_TexParameterfv(disp) ((disp)->TexParameterfv) -#define SET_TexParameterfv(disp, fn) ((disp)->TexParameterfv = fn) -#define CALL_TexParameteri(disp, parameters) (*((disp)->TexParameteri)) parameters -#define GET_TexParameteri(disp) ((disp)->TexParameteri) -#define SET_TexParameteri(disp, fn) ((disp)->TexParameteri = fn) -#define CALL_TexParameteriv(disp, parameters) (*((disp)->TexParameteriv)) parameters -#define GET_TexParameteriv(disp) ((disp)->TexParameteriv) -#define SET_TexParameteriv(disp, fn) ((disp)->TexParameteriv = fn) -#define CALL_TexImage1D(disp, parameters) (*((disp)->TexImage1D)) parameters -#define GET_TexImage1D(disp) ((disp)->TexImage1D) -#define SET_TexImage1D(disp, fn) ((disp)->TexImage1D = fn) -#define CALL_TexImage2D(disp, parameters) (*((disp)->TexImage2D)) parameters -#define GET_TexImage2D(disp) ((disp)->TexImage2D) -#define SET_TexImage2D(disp, fn) ((disp)->TexImage2D = fn) -#define CALL_TexEnvf(disp, parameters) (*((disp)->TexEnvf)) parameters -#define GET_TexEnvf(disp) ((disp)->TexEnvf) -#define SET_TexEnvf(disp, fn) ((disp)->TexEnvf = fn) -#define CALL_TexEnvfv(disp, parameters) (*((disp)->TexEnvfv)) parameters -#define GET_TexEnvfv(disp) ((disp)->TexEnvfv) -#define SET_TexEnvfv(disp, fn) ((disp)->TexEnvfv = fn) -#define CALL_TexEnvi(disp, parameters) (*((disp)->TexEnvi)) parameters -#define GET_TexEnvi(disp) ((disp)->TexEnvi) -#define SET_TexEnvi(disp, fn) ((disp)->TexEnvi = fn) -#define CALL_TexEnviv(disp, parameters) (*((disp)->TexEnviv)) parameters -#define GET_TexEnviv(disp) ((disp)->TexEnviv) -#define SET_TexEnviv(disp, fn) ((disp)->TexEnviv = fn) -#define CALL_TexGend(disp, parameters) (*((disp)->TexGend)) parameters -#define GET_TexGend(disp) ((disp)->TexGend) -#define SET_TexGend(disp, fn) ((disp)->TexGend = fn) -#define CALL_TexGendv(disp, parameters) (*((disp)->TexGendv)) parameters -#define GET_TexGendv(disp) ((disp)->TexGendv) -#define SET_TexGendv(disp, fn) ((disp)->TexGendv = fn) -#define CALL_TexGenf(disp, parameters) (*((disp)->TexGenf)) parameters -#define GET_TexGenf(disp) ((disp)->TexGenf) -#define SET_TexGenf(disp, fn) ((disp)->TexGenf = fn) -#define CALL_TexGenfv(disp, parameters) (*((disp)->TexGenfv)) parameters -#define GET_TexGenfv(disp) ((disp)->TexGenfv) -#define SET_TexGenfv(disp, fn) ((disp)->TexGenfv = fn) -#define CALL_TexGeni(disp, parameters) (*((disp)->TexGeni)) parameters -#define GET_TexGeni(disp) ((disp)->TexGeni) -#define SET_TexGeni(disp, fn) ((disp)->TexGeni = fn) -#define CALL_TexGeniv(disp, parameters) (*((disp)->TexGeniv)) parameters -#define GET_TexGeniv(disp) ((disp)->TexGeniv) -#define SET_TexGeniv(disp, fn) ((disp)->TexGeniv = fn) -#define CALL_FeedbackBuffer(disp, parameters) (*((disp)->FeedbackBuffer)) parameters -#define GET_FeedbackBuffer(disp) ((disp)->FeedbackBuffer) -#define SET_FeedbackBuffer(disp, fn) ((disp)->FeedbackBuffer = fn) -#define CALL_SelectBuffer(disp, parameters) (*((disp)->SelectBuffer)) parameters -#define GET_SelectBuffer(disp) ((disp)->SelectBuffer) -#define SET_SelectBuffer(disp, fn) ((disp)->SelectBuffer = fn) -#define CALL_RenderMode(disp, parameters) (*((disp)->RenderMode)) parameters -#define GET_RenderMode(disp) ((disp)->RenderMode) -#define SET_RenderMode(disp, fn) ((disp)->RenderMode = fn) -#define CALL_InitNames(disp, parameters) (*((disp)->InitNames)) parameters -#define GET_InitNames(disp) ((disp)->InitNames) -#define SET_InitNames(disp, fn) ((disp)->InitNames = fn) -#define CALL_LoadName(disp, parameters) (*((disp)->LoadName)) parameters -#define GET_LoadName(disp) ((disp)->LoadName) -#define SET_LoadName(disp, fn) ((disp)->LoadName = fn) -#define CALL_PassThrough(disp, parameters) (*((disp)->PassThrough)) parameters -#define GET_PassThrough(disp) ((disp)->PassThrough) -#define SET_PassThrough(disp, fn) ((disp)->PassThrough = fn) -#define CALL_PopName(disp, parameters) (*((disp)->PopName)) parameters -#define GET_PopName(disp) ((disp)->PopName) -#define SET_PopName(disp, fn) ((disp)->PopName = fn) -#define CALL_PushName(disp, parameters) (*((disp)->PushName)) parameters -#define GET_PushName(disp) ((disp)->PushName) -#define SET_PushName(disp, fn) ((disp)->PushName = fn) -#define CALL_DrawBuffer(disp, parameters) (*((disp)->DrawBuffer)) parameters -#define GET_DrawBuffer(disp) ((disp)->DrawBuffer) -#define SET_DrawBuffer(disp, fn) ((disp)->DrawBuffer = fn) -#define CALL_Clear(disp, parameters) (*((disp)->Clear)) parameters -#define GET_Clear(disp) ((disp)->Clear) -#define SET_Clear(disp, fn) ((disp)->Clear = fn) -#define CALL_ClearAccum(disp, parameters) (*((disp)->ClearAccum)) parameters -#define GET_ClearAccum(disp) ((disp)->ClearAccum) -#define SET_ClearAccum(disp, fn) ((disp)->ClearAccum = fn) -#define CALL_ClearIndex(disp, parameters) (*((disp)->ClearIndex)) parameters -#define GET_ClearIndex(disp) ((disp)->ClearIndex) -#define SET_ClearIndex(disp, fn) ((disp)->ClearIndex = fn) -#define CALL_ClearColor(disp, parameters) (*((disp)->ClearColor)) parameters -#define GET_ClearColor(disp) ((disp)->ClearColor) -#define SET_ClearColor(disp, fn) ((disp)->ClearColor = fn) -#define CALL_ClearStencil(disp, parameters) (*((disp)->ClearStencil)) parameters -#define GET_ClearStencil(disp) ((disp)->ClearStencil) -#define SET_ClearStencil(disp, fn) ((disp)->ClearStencil = fn) -#define CALL_ClearDepth(disp, parameters) (*((disp)->ClearDepth)) parameters -#define GET_ClearDepth(disp) ((disp)->ClearDepth) -#define SET_ClearDepth(disp, fn) ((disp)->ClearDepth = fn) -#define CALL_StencilMask(disp, parameters) (*((disp)->StencilMask)) parameters -#define GET_StencilMask(disp) ((disp)->StencilMask) -#define SET_StencilMask(disp, fn) ((disp)->StencilMask = fn) -#define CALL_ColorMask(disp, parameters) (*((disp)->ColorMask)) parameters -#define GET_ColorMask(disp) ((disp)->ColorMask) -#define SET_ColorMask(disp, fn) ((disp)->ColorMask = fn) -#define CALL_DepthMask(disp, parameters) (*((disp)->DepthMask)) parameters -#define GET_DepthMask(disp) ((disp)->DepthMask) -#define SET_DepthMask(disp, fn) ((disp)->DepthMask = fn) -#define CALL_IndexMask(disp, parameters) (*((disp)->IndexMask)) parameters -#define GET_IndexMask(disp) ((disp)->IndexMask) -#define SET_IndexMask(disp, fn) ((disp)->IndexMask = fn) -#define CALL_Accum(disp, parameters) (*((disp)->Accum)) parameters -#define GET_Accum(disp) ((disp)->Accum) -#define SET_Accum(disp, fn) ((disp)->Accum = fn) -#define CALL_Disable(disp, parameters) (*((disp)->Disable)) parameters -#define GET_Disable(disp) ((disp)->Disable) -#define SET_Disable(disp, fn) ((disp)->Disable = fn) -#define CALL_Enable(disp, parameters) (*((disp)->Enable)) parameters -#define GET_Enable(disp) ((disp)->Enable) -#define SET_Enable(disp, fn) ((disp)->Enable = fn) -#define CALL_Finish(disp, parameters) (*((disp)->Finish)) parameters -#define GET_Finish(disp) ((disp)->Finish) -#define SET_Finish(disp, fn) ((disp)->Finish = fn) -#define CALL_Flush(disp, parameters) (*((disp)->Flush)) parameters -#define GET_Flush(disp) ((disp)->Flush) -#define SET_Flush(disp, fn) ((disp)->Flush = fn) -#define CALL_PopAttrib(disp, parameters) (*((disp)->PopAttrib)) parameters -#define GET_PopAttrib(disp) ((disp)->PopAttrib) -#define SET_PopAttrib(disp, fn) ((disp)->PopAttrib = fn) -#define CALL_PushAttrib(disp, parameters) (*((disp)->PushAttrib)) parameters -#define GET_PushAttrib(disp) ((disp)->PushAttrib) -#define SET_PushAttrib(disp, fn) ((disp)->PushAttrib = fn) -#define CALL_Map1d(disp, parameters) (*((disp)->Map1d)) parameters -#define GET_Map1d(disp) ((disp)->Map1d) -#define SET_Map1d(disp, fn) ((disp)->Map1d = fn) -#define CALL_Map1f(disp, parameters) (*((disp)->Map1f)) parameters -#define GET_Map1f(disp) ((disp)->Map1f) -#define SET_Map1f(disp, fn) ((disp)->Map1f = fn) -#define CALL_Map2d(disp, parameters) (*((disp)->Map2d)) parameters -#define GET_Map2d(disp) ((disp)->Map2d) -#define SET_Map2d(disp, fn) ((disp)->Map2d = fn) -#define CALL_Map2f(disp, parameters) (*((disp)->Map2f)) parameters -#define GET_Map2f(disp) ((disp)->Map2f) -#define SET_Map2f(disp, fn) ((disp)->Map2f = fn) -#define CALL_MapGrid1d(disp, parameters) (*((disp)->MapGrid1d)) parameters -#define GET_MapGrid1d(disp) ((disp)->MapGrid1d) -#define SET_MapGrid1d(disp, fn) ((disp)->MapGrid1d = fn) -#define CALL_MapGrid1f(disp, parameters) (*((disp)->MapGrid1f)) parameters -#define GET_MapGrid1f(disp) ((disp)->MapGrid1f) -#define SET_MapGrid1f(disp, fn) ((disp)->MapGrid1f = fn) -#define CALL_MapGrid2d(disp, parameters) (*((disp)->MapGrid2d)) parameters -#define GET_MapGrid2d(disp) ((disp)->MapGrid2d) -#define SET_MapGrid2d(disp, fn) ((disp)->MapGrid2d = fn) -#define CALL_MapGrid2f(disp, parameters) (*((disp)->MapGrid2f)) parameters -#define GET_MapGrid2f(disp) ((disp)->MapGrid2f) -#define SET_MapGrid2f(disp, fn) ((disp)->MapGrid2f = fn) -#define CALL_EvalCoord1d(disp, parameters) (*((disp)->EvalCoord1d)) parameters -#define GET_EvalCoord1d(disp) ((disp)->EvalCoord1d) -#define SET_EvalCoord1d(disp, fn) ((disp)->EvalCoord1d = fn) -#define CALL_EvalCoord1dv(disp, parameters) (*((disp)->EvalCoord1dv)) parameters -#define GET_EvalCoord1dv(disp) ((disp)->EvalCoord1dv) -#define SET_EvalCoord1dv(disp, fn) ((disp)->EvalCoord1dv = fn) -#define CALL_EvalCoord1f(disp, parameters) (*((disp)->EvalCoord1f)) parameters -#define GET_EvalCoord1f(disp) ((disp)->EvalCoord1f) -#define SET_EvalCoord1f(disp, fn) ((disp)->EvalCoord1f = fn) -#define CALL_EvalCoord1fv(disp, parameters) (*((disp)->EvalCoord1fv)) parameters -#define GET_EvalCoord1fv(disp) ((disp)->EvalCoord1fv) -#define SET_EvalCoord1fv(disp, fn) ((disp)->EvalCoord1fv = fn) -#define CALL_EvalCoord2d(disp, parameters) (*((disp)->EvalCoord2d)) parameters -#define GET_EvalCoord2d(disp) ((disp)->EvalCoord2d) -#define SET_EvalCoord2d(disp, fn) ((disp)->EvalCoord2d = fn) -#define CALL_EvalCoord2dv(disp, parameters) (*((disp)->EvalCoord2dv)) parameters -#define GET_EvalCoord2dv(disp) ((disp)->EvalCoord2dv) -#define SET_EvalCoord2dv(disp, fn) ((disp)->EvalCoord2dv = fn) -#define CALL_EvalCoord2f(disp, parameters) (*((disp)->EvalCoord2f)) parameters -#define GET_EvalCoord2f(disp) ((disp)->EvalCoord2f) -#define SET_EvalCoord2f(disp, fn) ((disp)->EvalCoord2f = fn) -#define CALL_EvalCoord2fv(disp, parameters) (*((disp)->EvalCoord2fv)) parameters -#define GET_EvalCoord2fv(disp) ((disp)->EvalCoord2fv) -#define SET_EvalCoord2fv(disp, fn) ((disp)->EvalCoord2fv = fn) -#define CALL_EvalMesh1(disp, parameters) (*((disp)->EvalMesh1)) parameters -#define GET_EvalMesh1(disp) ((disp)->EvalMesh1) -#define SET_EvalMesh1(disp, fn) ((disp)->EvalMesh1 = fn) -#define CALL_EvalPoint1(disp, parameters) (*((disp)->EvalPoint1)) parameters -#define GET_EvalPoint1(disp) ((disp)->EvalPoint1) -#define SET_EvalPoint1(disp, fn) ((disp)->EvalPoint1 = fn) -#define CALL_EvalMesh2(disp, parameters) (*((disp)->EvalMesh2)) parameters -#define GET_EvalMesh2(disp) ((disp)->EvalMesh2) -#define SET_EvalMesh2(disp, fn) ((disp)->EvalMesh2 = fn) -#define CALL_EvalPoint2(disp, parameters) (*((disp)->EvalPoint2)) parameters -#define GET_EvalPoint2(disp) ((disp)->EvalPoint2) -#define SET_EvalPoint2(disp, fn) ((disp)->EvalPoint2 = fn) -#define CALL_AlphaFunc(disp, parameters) (*((disp)->AlphaFunc)) parameters -#define GET_AlphaFunc(disp) ((disp)->AlphaFunc) -#define SET_AlphaFunc(disp, fn) ((disp)->AlphaFunc = fn) -#define CALL_BlendFunc(disp, parameters) (*((disp)->BlendFunc)) parameters -#define GET_BlendFunc(disp) ((disp)->BlendFunc) -#define SET_BlendFunc(disp, fn) ((disp)->BlendFunc = fn) -#define CALL_LogicOp(disp, parameters) (*((disp)->LogicOp)) parameters -#define GET_LogicOp(disp) ((disp)->LogicOp) -#define SET_LogicOp(disp, fn) ((disp)->LogicOp = fn) -#define CALL_StencilFunc(disp, parameters) (*((disp)->StencilFunc)) parameters -#define GET_StencilFunc(disp) ((disp)->StencilFunc) -#define SET_StencilFunc(disp, fn) ((disp)->StencilFunc = fn) -#define CALL_StencilOp(disp, parameters) (*((disp)->StencilOp)) parameters -#define GET_StencilOp(disp) ((disp)->StencilOp) -#define SET_StencilOp(disp, fn) ((disp)->StencilOp = fn) -#define CALL_DepthFunc(disp, parameters) (*((disp)->DepthFunc)) parameters -#define GET_DepthFunc(disp) ((disp)->DepthFunc) -#define SET_DepthFunc(disp, fn) ((disp)->DepthFunc = fn) -#define CALL_PixelZoom(disp, parameters) (*((disp)->PixelZoom)) parameters -#define GET_PixelZoom(disp) ((disp)->PixelZoom) -#define SET_PixelZoom(disp, fn) ((disp)->PixelZoom = fn) -#define CALL_PixelTransferf(disp, parameters) (*((disp)->PixelTransferf)) parameters -#define GET_PixelTransferf(disp) ((disp)->PixelTransferf) -#define SET_PixelTransferf(disp, fn) ((disp)->PixelTransferf = fn) -#define CALL_PixelTransferi(disp, parameters) (*((disp)->PixelTransferi)) parameters -#define GET_PixelTransferi(disp) ((disp)->PixelTransferi) -#define SET_PixelTransferi(disp, fn) ((disp)->PixelTransferi = fn) -#define CALL_PixelStoref(disp, parameters) (*((disp)->PixelStoref)) parameters -#define GET_PixelStoref(disp) ((disp)->PixelStoref) -#define SET_PixelStoref(disp, fn) ((disp)->PixelStoref = fn) -#define CALL_PixelStorei(disp, parameters) (*((disp)->PixelStorei)) parameters -#define GET_PixelStorei(disp) ((disp)->PixelStorei) -#define SET_PixelStorei(disp, fn) ((disp)->PixelStorei = fn) -#define CALL_PixelMapfv(disp, parameters) (*((disp)->PixelMapfv)) parameters -#define GET_PixelMapfv(disp) ((disp)->PixelMapfv) -#define SET_PixelMapfv(disp, fn) ((disp)->PixelMapfv = fn) -#define CALL_PixelMapuiv(disp, parameters) (*((disp)->PixelMapuiv)) parameters -#define GET_PixelMapuiv(disp) ((disp)->PixelMapuiv) -#define SET_PixelMapuiv(disp, fn) ((disp)->PixelMapuiv = fn) -#define CALL_PixelMapusv(disp, parameters) (*((disp)->PixelMapusv)) parameters -#define GET_PixelMapusv(disp) ((disp)->PixelMapusv) -#define SET_PixelMapusv(disp, fn) ((disp)->PixelMapusv = fn) -#define CALL_ReadBuffer(disp, parameters) (*((disp)->ReadBuffer)) parameters -#define GET_ReadBuffer(disp) ((disp)->ReadBuffer) -#define SET_ReadBuffer(disp, fn) ((disp)->ReadBuffer = fn) -#define CALL_CopyPixels(disp, parameters) (*((disp)->CopyPixels)) parameters -#define GET_CopyPixels(disp) ((disp)->CopyPixels) -#define SET_CopyPixels(disp, fn) ((disp)->CopyPixels = fn) -#define CALL_ReadPixels(disp, parameters) (*((disp)->ReadPixels)) parameters -#define GET_ReadPixels(disp) ((disp)->ReadPixels) -#define SET_ReadPixels(disp, fn) ((disp)->ReadPixels = fn) -#define CALL_DrawPixels(disp, parameters) (*((disp)->DrawPixels)) parameters -#define GET_DrawPixels(disp) ((disp)->DrawPixels) -#define SET_DrawPixels(disp, fn) ((disp)->DrawPixels = fn) -#define CALL_GetBooleanv(disp, parameters) (*((disp)->GetBooleanv)) parameters -#define GET_GetBooleanv(disp) ((disp)->GetBooleanv) -#define SET_GetBooleanv(disp, fn) ((disp)->GetBooleanv = fn) -#define CALL_GetClipPlane(disp, parameters) (*((disp)->GetClipPlane)) parameters -#define GET_GetClipPlane(disp) ((disp)->GetClipPlane) -#define SET_GetClipPlane(disp, fn) ((disp)->GetClipPlane = fn) -#define CALL_GetDoublev(disp, parameters) (*((disp)->GetDoublev)) parameters -#define GET_GetDoublev(disp) ((disp)->GetDoublev) -#define SET_GetDoublev(disp, fn) ((disp)->GetDoublev = fn) -#define CALL_GetError(disp, parameters) (*((disp)->GetError)) parameters -#define GET_GetError(disp) ((disp)->GetError) -#define SET_GetError(disp, fn) ((disp)->GetError = fn) -#define CALL_GetFloatv(disp, parameters) (*((disp)->GetFloatv)) parameters -#define GET_GetFloatv(disp) ((disp)->GetFloatv) -#define SET_GetFloatv(disp, fn) ((disp)->GetFloatv = fn) -#define CALL_GetIntegerv(disp, parameters) (*((disp)->GetIntegerv)) parameters -#define GET_GetIntegerv(disp) ((disp)->GetIntegerv) -#define SET_GetIntegerv(disp, fn) ((disp)->GetIntegerv = fn) -#define CALL_GetLightfv(disp, parameters) (*((disp)->GetLightfv)) parameters -#define GET_GetLightfv(disp) ((disp)->GetLightfv) -#define SET_GetLightfv(disp, fn) ((disp)->GetLightfv = fn) -#define CALL_GetLightiv(disp, parameters) (*((disp)->GetLightiv)) parameters -#define GET_GetLightiv(disp) ((disp)->GetLightiv) -#define SET_GetLightiv(disp, fn) ((disp)->GetLightiv = fn) -#define CALL_GetMapdv(disp, parameters) (*((disp)->GetMapdv)) parameters -#define GET_GetMapdv(disp) ((disp)->GetMapdv) -#define SET_GetMapdv(disp, fn) ((disp)->GetMapdv = fn) -#define CALL_GetMapfv(disp, parameters) (*((disp)->GetMapfv)) parameters -#define GET_GetMapfv(disp) ((disp)->GetMapfv) -#define SET_GetMapfv(disp, fn) ((disp)->GetMapfv = fn) -#define CALL_GetMapiv(disp, parameters) (*((disp)->GetMapiv)) parameters -#define GET_GetMapiv(disp) ((disp)->GetMapiv) -#define SET_GetMapiv(disp, fn) ((disp)->GetMapiv = fn) -#define CALL_GetMaterialfv(disp, parameters) (*((disp)->GetMaterialfv)) parameters -#define GET_GetMaterialfv(disp) ((disp)->GetMaterialfv) -#define SET_GetMaterialfv(disp, fn) ((disp)->GetMaterialfv = fn) -#define CALL_GetMaterialiv(disp, parameters) (*((disp)->GetMaterialiv)) parameters -#define GET_GetMaterialiv(disp) ((disp)->GetMaterialiv) -#define SET_GetMaterialiv(disp, fn) ((disp)->GetMaterialiv = fn) -#define CALL_GetPixelMapfv(disp, parameters) (*((disp)->GetPixelMapfv)) parameters -#define GET_GetPixelMapfv(disp) ((disp)->GetPixelMapfv) -#define SET_GetPixelMapfv(disp, fn) ((disp)->GetPixelMapfv = fn) -#define CALL_GetPixelMapuiv(disp, parameters) (*((disp)->GetPixelMapuiv)) parameters -#define GET_GetPixelMapuiv(disp) ((disp)->GetPixelMapuiv) -#define SET_GetPixelMapuiv(disp, fn) ((disp)->GetPixelMapuiv = fn) -#define CALL_GetPixelMapusv(disp, parameters) (*((disp)->GetPixelMapusv)) parameters -#define GET_GetPixelMapusv(disp) ((disp)->GetPixelMapusv) -#define SET_GetPixelMapusv(disp, fn) ((disp)->GetPixelMapusv = fn) -#define CALL_GetPolygonStipple(disp, parameters) (*((disp)->GetPolygonStipple)) parameters -#define GET_GetPolygonStipple(disp) ((disp)->GetPolygonStipple) -#define SET_GetPolygonStipple(disp, fn) ((disp)->GetPolygonStipple = fn) -#define CALL_GetString(disp, parameters) (*((disp)->GetString)) parameters -#define GET_GetString(disp) ((disp)->GetString) -#define SET_GetString(disp, fn) ((disp)->GetString = fn) -#define CALL_GetTexEnvfv(disp, parameters) (*((disp)->GetTexEnvfv)) parameters -#define GET_GetTexEnvfv(disp) ((disp)->GetTexEnvfv) -#define SET_GetTexEnvfv(disp, fn) ((disp)->GetTexEnvfv = fn) -#define CALL_GetTexEnviv(disp, parameters) (*((disp)->GetTexEnviv)) parameters -#define GET_GetTexEnviv(disp) ((disp)->GetTexEnviv) -#define SET_GetTexEnviv(disp, fn) ((disp)->GetTexEnviv = fn) -#define CALL_GetTexGendv(disp, parameters) (*((disp)->GetTexGendv)) parameters -#define GET_GetTexGendv(disp) ((disp)->GetTexGendv) -#define SET_GetTexGendv(disp, fn) ((disp)->GetTexGendv = fn) -#define CALL_GetTexGenfv(disp, parameters) (*((disp)->GetTexGenfv)) parameters -#define GET_GetTexGenfv(disp) ((disp)->GetTexGenfv) -#define SET_GetTexGenfv(disp, fn) ((disp)->GetTexGenfv = fn) -#define CALL_GetTexGeniv(disp, parameters) (*((disp)->GetTexGeniv)) parameters -#define GET_GetTexGeniv(disp) ((disp)->GetTexGeniv) -#define SET_GetTexGeniv(disp, fn) ((disp)->GetTexGeniv = fn) -#define CALL_GetTexImage(disp, parameters) (*((disp)->GetTexImage)) parameters -#define GET_GetTexImage(disp) ((disp)->GetTexImage) -#define SET_GetTexImage(disp, fn) ((disp)->GetTexImage = fn) -#define CALL_GetTexParameterfv(disp, parameters) (*((disp)->GetTexParameterfv)) parameters -#define GET_GetTexParameterfv(disp) ((disp)->GetTexParameterfv) -#define SET_GetTexParameterfv(disp, fn) ((disp)->GetTexParameterfv = fn) -#define CALL_GetTexParameteriv(disp, parameters) (*((disp)->GetTexParameteriv)) parameters -#define GET_GetTexParameteriv(disp) ((disp)->GetTexParameteriv) -#define SET_GetTexParameteriv(disp, fn) ((disp)->GetTexParameteriv = fn) -#define CALL_GetTexLevelParameterfv(disp, parameters) (*((disp)->GetTexLevelParameterfv)) parameters -#define GET_GetTexLevelParameterfv(disp) ((disp)->GetTexLevelParameterfv) -#define SET_GetTexLevelParameterfv(disp, fn) ((disp)->GetTexLevelParameterfv = fn) -#define CALL_GetTexLevelParameteriv(disp, parameters) (*((disp)->GetTexLevelParameteriv)) parameters -#define GET_GetTexLevelParameteriv(disp) ((disp)->GetTexLevelParameteriv) -#define SET_GetTexLevelParameteriv(disp, fn) ((disp)->GetTexLevelParameteriv = fn) -#define CALL_IsEnabled(disp, parameters) (*((disp)->IsEnabled)) parameters -#define GET_IsEnabled(disp) ((disp)->IsEnabled) -#define SET_IsEnabled(disp, fn) ((disp)->IsEnabled = fn) -#define CALL_IsList(disp, parameters) (*((disp)->IsList)) parameters -#define GET_IsList(disp) ((disp)->IsList) -#define SET_IsList(disp, fn) ((disp)->IsList = fn) -#define CALL_DepthRange(disp, parameters) (*((disp)->DepthRange)) parameters -#define GET_DepthRange(disp) ((disp)->DepthRange) -#define SET_DepthRange(disp, fn) ((disp)->DepthRange = fn) -#define CALL_Frustum(disp, parameters) (*((disp)->Frustum)) parameters -#define GET_Frustum(disp) ((disp)->Frustum) -#define SET_Frustum(disp, fn) ((disp)->Frustum = fn) -#define CALL_LoadIdentity(disp, parameters) (*((disp)->LoadIdentity)) parameters -#define GET_LoadIdentity(disp) ((disp)->LoadIdentity) -#define SET_LoadIdentity(disp, fn) ((disp)->LoadIdentity = fn) -#define CALL_LoadMatrixf(disp, parameters) (*((disp)->LoadMatrixf)) parameters -#define GET_LoadMatrixf(disp) ((disp)->LoadMatrixf) -#define SET_LoadMatrixf(disp, fn) ((disp)->LoadMatrixf = fn) -#define CALL_LoadMatrixd(disp, parameters) (*((disp)->LoadMatrixd)) parameters -#define GET_LoadMatrixd(disp) ((disp)->LoadMatrixd) -#define SET_LoadMatrixd(disp, fn) ((disp)->LoadMatrixd = fn) -#define CALL_MatrixMode(disp, parameters) (*((disp)->MatrixMode)) parameters -#define GET_MatrixMode(disp) ((disp)->MatrixMode) -#define SET_MatrixMode(disp, fn) ((disp)->MatrixMode = fn) -#define CALL_MultMatrixf(disp, parameters) (*((disp)->MultMatrixf)) parameters -#define GET_MultMatrixf(disp) ((disp)->MultMatrixf) -#define SET_MultMatrixf(disp, fn) ((disp)->MultMatrixf = fn) -#define CALL_MultMatrixd(disp, parameters) (*((disp)->MultMatrixd)) parameters -#define GET_MultMatrixd(disp) ((disp)->MultMatrixd) -#define SET_MultMatrixd(disp, fn) ((disp)->MultMatrixd = fn) -#define CALL_Ortho(disp, parameters) (*((disp)->Ortho)) parameters -#define GET_Ortho(disp) ((disp)->Ortho) -#define SET_Ortho(disp, fn) ((disp)->Ortho = fn) -#define CALL_PopMatrix(disp, parameters) (*((disp)->PopMatrix)) parameters -#define GET_PopMatrix(disp) ((disp)->PopMatrix) -#define SET_PopMatrix(disp, fn) ((disp)->PopMatrix = fn) -#define CALL_PushMatrix(disp, parameters) (*((disp)->PushMatrix)) parameters -#define GET_PushMatrix(disp) ((disp)->PushMatrix) -#define SET_PushMatrix(disp, fn) ((disp)->PushMatrix = fn) -#define CALL_Rotated(disp, parameters) (*((disp)->Rotated)) parameters -#define GET_Rotated(disp) ((disp)->Rotated) -#define SET_Rotated(disp, fn) ((disp)->Rotated = fn) -#define CALL_Rotatef(disp, parameters) (*((disp)->Rotatef)) parameters -#define GET_Rotatef(disp) ((disp)->Rotatef) -#define SET_Rotatef(disp, fn) ((disp)->Rotatef = fn) -#define CALL_Scaled(disp, parameters) (*((disp)->Scaled)) parameters -#define GET_Scaled(disp) ((disp)->Scaled) -#define SET_Scaled(disp, fn) ((disp)->Scaled = fn) -#define CALL_Scalef(disp, parameters) (*((disp)->Scalef)) parameters -#define GET_Scalef(disp) ((disp)->Scalef) -#define SET_Scalef(disp, fn) ((disp)->Scalef = fn) -#define CALL_Translated(disp, parameters) (*((disp)->Translated)) parameters -#define GET_Translated(disp) ((disp)->Translated) -#define SET_Translated(disp, fn) ((disp)->Translated = fn) -#define CALL_Translatef(disp, parameters) (*((disp)->Translatef)) parameters -#define GET_Translatef(disp) ((disp)->Translatef) -#define SET_Translatef(disp, fn) ((disp)->Translatef = fn) -#define CALL_Viewport(disp, parameters) (*((disp)->Viewport)) parameters -#define GET_Viewport(disp) ((disp)->Viewport) -#define SET_Viewport(disp, fn) ((disp)->Viewport = fn) -#define CALL_ArrayElement(disp, parameters) (*((disp)->ArrayElement)) parameters -#define GET_ArrayElement(disp) ((disp)->ArrayElement) -#define SET_ArrayElement(disp, fn) ((disp)->ArrayElement = fn) -#define CALL_BindTexture(disp, parameters) (*((disp)->BindTexture)) parameters -#define GET_BindTexture(disp) ((disp)->BindTexture) -#define SET_BindTexture(disp, fn) ((disp)->BindTexture = fn) -#define CALL_ColorPointer(disp, parameters) (*((disp)->ColorPointer)) parameters -#define GET_ColorPointer(disp) ((disp)->ColorPointer) -#define SET_ColorPointer(disp, fn) ((disp)->ColorPointer = fn) -#define CALL_DisableClientState(disp, parameters) (*((disp)->DisableClientState)) parameters -#define GET_DisableClientState(disp) ((disp)->DisableClientState) -#define SET_DisableClientState(disp, fn) ((disp)->DisableClientState = fn) -#define CALL_DrawArrays(disp, parameters) (*((disp)->DrawArrays)) parameters -#define GET_DrawArrays(disp) ((disp)->DrawArrays) -#define SET_DrawArrays(disp, fn) ((disp)->DrawArrays = fn) -#define CALL_DrawElements(disp, parameters) (*((disp)->DrawElements)) parameters -#define GET_DrawElements(disp) ((disp)->DrawElements) -#define SET_DrawElements(disp, fn) ((disp)->DrawElements = fn) -#define CALL_EdgeFlagPointer(disp, parameters) (*((disp)->EdgeFlagPointer)) parameters -#define GET_EdgeFlagPointer(disp) ((disp)->EdgeFlagPointer) -#define SET_EdgeFlagPointer(disp, fn) ((disp)->EdgeFlagPointer = fn) -#define CALL_EnableClientState(disp, parameters) (*((disp)->EnableClientState)) parameters -#define GET_EnableClientState(disp) ((disp)->EnableClientState) -#define SET_EnableClientState(disp, fn) ((disp)->EnableClientState = fn) -#define CALL_IndexPointer(disp, parameters) (*((disp)->IndexPointer)) parameters -#define GET_IndexPointer(disp) ((disp)->IndexPointer) -#define SET_IndexPointer(disp, fn) ((disp)->IndexPointer = fn) -#define CALL_Indexub(disp, parameters) (*((disp)->Indexub)) parameters -#define GET_Indexub(disp) ((disp)->Indexub) -#define SET_Indexub(disp, fn) ((disp)->Indexub = fn) -#define CALL_Indexubv(disp, parameters) (*((disp)->Indexubv)) parameters -#define GET_Indexubv(disp) ((disp)->Indexubv) -#define SET_Indexubv(disp, fn) ((disp)->Indexubv = fn) -#define CALL_InterleavedArrays(disp, parameters) (*((disp)->InterleavedArrays)) parameters -#define GET_InterleavedArrays(disp) ((disp)->InterleavedArrays) -#define SET_InterleavedArrays(disp, fn) ((disp)->InterleavedArrays = fn) -#define CALL_NormalPointer(disp, parameters) (*((disp)->NormalPointer)) parameters -#define GET_NormalPointer(disp) ((disp)->NormalPointer) -#define SET_NormalPointer(disp, fn) ((disp)->NormalPointer = fn) -#define CALL_PolygonOffset(disp, parameters) (*((disp)->PolygonOffset)) parameters -#define GET_PolygonOffset(disp) ((disp)->PolygonOffset) -#define SET_PolygonOffset(disp, fn) ((disp)->PolygonOffset = fn) -#define CALL_TexCoordPointer(disp, parameters) (*((disp)->TexCoordPointer)) parameters -#define GET_TexCoordPointer(disp) ((disp)->TexCoordPointer) -#define SET_TexCoordPointer(disp, fn) ((disp)->TexCoordPointer = fn) -#define CALL_VertexPointer(disp, parameters) (*((disp)->VertexPointer)) parameters -#define GET_VertexPointer(disp) ((disp)->VertexPointer) -#define SET_VertexPointer(disp, fn) ((disp)->VertexPointer = fn) -#define CALL_AreTexturesResident(disp, parameters) (*((disp)->AreTexturesResident)) parameters -#define GET_AreTexturesResident(disp) ((disp)->AreTexturesResident) -#define SET_AreTexturesResident(disp, fn) ((disp)->AreTexturesResident = fn) -#define CALL_CopyTexImage1D(disp, parameters) (*((disp)->CopyTexImage1D)) parameters -#define GET_CopyTexImage1D(disp) ((disp)->CopyTexImage1D) -#define SET_CopyTexImage1D(disp, fn) ((disp)->CopyTexImage1D = fn) -#define CALL_CopyTexImage2D(disp, parameters) (*((disp)->CopyTexImage2D)) parameters -#define GET_CopyTexImage2D(disp) ((disp)->CopyTexImage2D) -#define SET_CopyTexImage2D(disp, fn) ((disp)->CopyTexImage2D = fn) -#define CALL_CopyTexSubImage1D(disp, parameters) (*((disp)->CopyTexSubImage1D)) parameters -#define GET_CopyTexSubImage1D(disp) ((disp)->CopyTexSubImage1D) -#define SET_CopyTexSubImage1D(disp, fn) ((disp)->CopyTexSubImage1D = fn) -#define CALL_CopyTexSubImage2D(disp, parameters) (*((disp)->CopyTexSubImage2D)) parameters -#define GET_CopyTexSubImage2D(disp) ((disp)->CopyTexSubImage2D) -#define SET_CopyTexSubImage2D(disp, fn) ((disp)->CopyTexSubImage2D = fn) -#define CALL_DeleteTextures(disp, parameters) (*((disp)->DeleteTextures)) parameters -#define GET_DeleteTextures(disp) ((disp)->DeleteTextures) -#define SET_DeleteTextures(disp, fn) ((disp)->DeleteTextures = fn) -#define CALL_GenTextures(disp, parameters) (*((disp)->GenTextures)) parameters -#define GET_GenTextures(disp) ((disp)->GenTextures) -#define SET_GenTextures(disp, fn) ((disp)->GenTextures = fn) -#define CALL_GetPointerv(disp, parameters) (*((disp)->GetPointerv)) parameters -#define GET_GetPointerv(disp) ((disp)->GetPointerv) -#define SET_GetPointerv(disp, fn) ((disp)->GetPointerv = fn) -#define CALL_IsTexture(disp, parameters) (*((disp)->IsTexture)) parameters -#define GET_IsTexture(disp) ((disp)->IsTexture) -#define SET_IsTexture(disp, fn) ((disp)->IsTexture = fn) -#define CALL_PrioritizeTextures(disp, parameters) (*((disp)->PrioritizeTextures)) parameters -#define GET_PrioritizeTextures(disp) ((disp)->PrioritizeTextures) -#define SET_PrioritizeTextures(disp, fn) ((disp)->PrioritizeTextures = fn) -#define CALL_TexSubImage1D(disp, parameters) (*((disp)->TexSubImage1D)) parameters -#define GET_TexSubImage1D(disp) ((disp)->TexSubImage1D) -#define SET_TexSubImage1D(disp, fn) ((disp)->TexSubImage1D = fn) -#define CALL_TexSubImage2D(disp, parameters) (*((disp)->TexSubImage2D)) parameters -#define GET_TexSubImage2D(disp) ((disp)->TexSubImage2D) -#define SET_TexSubImage2D(disp, fn) ((disp)->TexSubImage2D = fn) -#define CALL_PopClientAttrib(disp, parameters) (*((disp)->PopClientAttrib)) parameters -#define GET_PopClientAttrib(disp) ((disp)->PopClientAttrib) -#define SET_PopClientAttrib(disp, fn) ((disp)->PopClientAttrib = fn) -#define CALL_PushClientAttrib(disp, parameters) (*((disp)->PushClientAttrib)) parameters -#define GET_PushClientAttrib(disp) ((disp)->PushClientAttrib) -#define SET_PushClientAttrib(disp, fn) ((disp)->PushClientAttrib = fn) -#define CALL_BlendColor(disp, parameters) (*((disp)->BlendColor)) parameters -#define GET_BlendColor(disp) ((disp)->BlendColor) -#define SET_BlendColor(disp, fn) ((disp)->BlendColor = fn) -#define CALL_BlendEquation(disp, parameters) (*((disp)->BlendEquation)) parameters -#define GET_BlendEquation(disp) ((disp)->BlendEquation) -#define SET_BlendEquation(disp, fn) ((disp)->BlendEquation = fn) -#define CALL_DrawRangeElements(disp, parameters) (*((disp)->DrawRangeElements)) parameters -#define GET_DrawRangeElements(disp) ((disp)->DrawRangeElements) -#define SET_DrawRangeElements(disp, fn) ((disp)->DrawRangeElements = fn) -#define CALL_ColorTable(disp, parameters) (*((disp)->ColorTable)) parameters -#define GET_ColorTable(disp) ((disp)->ColorTable) -#define SET_ColorTable(disp, fn) ((disp)->ColorTable = fn) -#define CALL_ColorTableParameterfv(disp, parameters) (*((disp)->ColorTableParameterfv)) parameters -#define GET_ColorTableParameterfv(disp) ((disp)->ColorTableParameterfv) -#define SET_ColorTableParameterfv(disp, fn) ((disp)->ColorTableParameterfv = fn) -#define CALL_ColorTableParameteriv(disp, parameters) (*((disp)->ColorTableParameteriv)) parameters -#define GET_ColorTableParameteriv(disp) ((disp)->ColorTableParameteriv) -#define SET_ColorTableParameteriv(disp, fn) ((disp)->ColorTableParameteriv = fn) -#define CALL_CopyColorTable(disp, parameters) (*((disp)->CopyColorTable)) parameters -#define GET_CopyColorTable(disp) ((disp)->CopyColorTable) -#define SET_CopyColorTable(disp, fn) ((disp)->CopyColorTable = fn) -#define CALL_GetColorTable(disp, parameters) (*((disp)->GetColorTable)) parameters -#define GET_GetColorTable(disp) ((disp)->GetColorTable) -#define SET_GetColorTable(disp, fn) ((disp)->GetColorTable = fn) -#define CALL_GetColorTableParameterfv(disp, parameters) (*((disp)->GetColorTableParameterfv)) parameters -#define GET_GetColorTableParameterfv(disp) ((disp)->GetColorTableParameterfv) -#define SET_GetColorTableParameterfv(disp, fn) ((disp)->GetColorTableParameterfv = fn) -#define CALL_GetColorTableParameteriv(disp, parameters) (*((disp)->GetColorTableParameteriv)) parameters -#define GET_GetColorTableParameteriv(disp) ((disp)->GetColorTableParameteriv) -#define SET_GetColorTableParameteriv(disp, fn) ((disp)->GetColorTableParameteriv = fn) -#define CALL_ColorSubTable(disp, parameters) (*((disp)->ColorSubTable)) parameters -#define GET_ColorSubTable(disp) ((disp)->ColorSubTable) -#define SET_ColorSubTable(disp, fn) ((disp)->ColorSubTable = fn) -#define CALL_CopyColorSubTable(disp, parameters) (*((disp)->CopyColorSubTable)) parameters -#define GET_CopyColorSubTable(disp) ((disp)->CopyColorSubTable) -#define SET_CopyColorSubTable(disp, fn) ((disp)->CopyColorSubTable = fn) -#define CALL_ConvolutionFilter1D(disp, parameters) (*((disp)->ConvolutionFilter1D)) parameters -#define GET_ConvolutionFilter1D(disp) ((disp)->ConvolutionFilter1D) -#define SET_ConvolutionFilter1D(disp, fn) ((disp)->ConvolutionFilter1D = fn) -#define CALL_ConvolutionFilter2D(disp, parameters) (*((disp)->ConvolutionFilter2D)) parameters -#define GET_ConvolutionFilter2D(disp) ((disp)->ConvolutionFilter2D) -#define SET_ConvolutionFilter2D(disp, fn) ((disp)->ConvolutionFilter2D = fn) -#define CALL_ConvolutionParameterf(disp, parameters) (*((disp)->ConvolutionParameterf)) parameters -#define GET_ConvolutionParameterf(disp) ((disp)->ConvolutionParameterf) -#define SET_ConvolutionParameterf(disp, fn) ((disp)->ConvolutionParameterf = fn) -#define CALL_ConvolutionParameterfv(disp, parameters) (*((disp)->ConvolutionParameterfv)) parameters -#define GET_ConvolutionParameterfv(disp) ((disp)->ConvolutionParameterfv) -#define SET_ConvolutionParameterfv(disp, fn) ((disp)->ConvolutionParameterfv = fn) -#define CALL_ConvolutionParameteri(disp, parameters) (*((disp)->ConvolutionParameteri)) parameters -#define GET_ConvolutionParameteri(disp) ((disp)->ConvolutionParameteri) -#define SET_ConvolutionParameteri(disp, fn) ((disp)->ConvolutionParameteri = fn) -#define CALL_ConvolutionParameteriv(disp, parameters) (*((disp)->ConvolutionParameteriv)) parameters -#define GET_ConvolutionParameteriv(disp) ((disp)->ConvolutionParameteriv) -#define SET_ConvolutionParameteriv(disp, fn) ((disp)->ConvolutionParameteriv = fn) -#define CALL_CopyConvolutionFilter1D(disp, parameters) (*((disp)->CopyConvolutionFilter1D)) parameters -#define GET_CopyConvolutionFilter1D(disp) ((disp)->CopyConvolutionFilter1D) -#define SET_CopyConvolutionFilter1D(disp, fn) ((disp)->CopyConvolutionFilter1D = fn) -#define CALL_CopyConvolutionFilter2D(disp, parameters) (*((disp)->CopyConvolutionFilter2D)) parameters -#define GET_CopyConvolutionFilter2D(disp) ((disp)->CopyConvolutionFilter2D) -#define SET_CopyConvolutionFilter2D(disp, fn) ((disp)->CopyConvolutionFilter2D = fn) -#define CALL_GetConvolutionFilter(disp, parameters) (*((disp)->GetConvolutionFilter)) parameters -#define GET_GetConvolutionFilter(disp) ((disp)->GetConvolutionFilter) -#define SET_GetConvolutionFilter(disp, fn) ((disp)->GetConvolutionFilter = fn) -#define CALL_GetConvolutionParameterfv(disp, parameters) (*((disp)->GetConvolutionParameterfv)) parameters -#define GET_GetConvolutionParameterfv(disp) ((disp)->GetConvolutionParameterfv) -#define SET_GetConvolutionParameterfv(disp, fn) ((disp)->GetConvolutionParameterfv = fn) -#define CALL_GetConvolutionParameteriv(disp, parameters) (*((disp)->GetConvolutionParameteriv)) parameters -#define GET_GetConvolutionParameteriv(disp) ((disp)->GetConvolutionParameteriv) -#define SET_GetConvolutionParameteriv(disp, fn) ((disp)->GetConvolutionParameteriv = fn) -#define CALL_GetSeparableFilter(disp, parameters) (*((disp)->GetSeparableFilter)) parameters -#define GET_GetSeparableFilter(disp) ((disp)->GetSeparableFilter) -#define SET_GetSeparableFilter(disp, fn) ((disp)->GetSeparableFilter = fn) -#define CALL_SeparableFilter2D(disp, parameters) (*((disp)->SeparableFilter2D)) parameters -#define GET_SeparableFilter2D(disp) ((disp)->SeparableFilter2D) -#define SET_SeparableFilter2D(disp, fn) ((disp)->SeparableFilter2D = fn) -#define CALL_GetHistogram(disp, parameters) (*((disp)->GetHistogram)) parameters -#define GET_GetHistogram(disp) ((disp)->GetHistogram) -#define SET_GetHistogram(disp, fn) ((disp)->GetHistogram = fn) -#define CALL_GetHistogramParameterfv(disp, parameters) (*((disp)->GetHistogramParameterfv)) parameters -#define GET_GetHistogramParameterfv(disp) ((disp)->GetHistogramParameterfv) -#define SET_GetHistogramParameterfv(disp, fn) ((disp)->GetHistogramParameterfv = fn) -#define CALL_GetHistogramParameteriv(disp, parameters) (*((disp)->GetHistogramParameteriv)) parameters -#define GET_GetHistogramParameteriv(disp) ((disp)->GetHistogramParameteriv) -#define SET_GetHistogramParameteriv(disp, fn) ((disp)->GetHistogramParameteriv = fn) -#define CALL_GetMinmax(disp, parameters) (*((disp)->GetMinmax)) parameters -#define GET_GetMinmax(disp) ((disp)->GetMinmax) -#define SET_GetMinmax(disp, fn) ((disp)->GetMinmax = fn) -#define CALL_GetMinmaxParameterfv(disp, parameters) (*((disp)->GetMinmaxParameterfv)) parameters -#define GET_GetMinmaxParameterfv(disp) ((disp)->GetMinmaxParameterfv) -#define SET_GetMinmaxParameterfv(disp, fn) ((disp)->GetMinmaxParameterfv = fn) -#define CALL_GetMinmaxParameteriv(disp, parameters) (*((disp)->GetMinmaxParameteriv)) parameters -#define GET_GetMinmaxParameteriv(disp) ((disp)->GetMinmaxParameteriv) -#define SET_GetMinmaxParameteriv(disp, fn) ((disp)->GetMinmaxParameteriv = fn) -#define CALL_Histogram(disp, parameters) (*((disp)->Histogram)) parameters -#define GET_Histogram(disp) ((disp)->Histogram) -#define SET_Histogram(disp, fn) ((disp)->Histogram = fn) -#define CALL_Minmax(disp, parameters) (*((disp)->Minmax)) parameters -#define GET_Minmax(disp) ((disp)->Minmax) -#define SET_Minmax(disp, fn) ((disp)->Minmax = fn) -#define CALL_ResetHistogram(disp, parameters) (*((disp)->ResetHistogram)) parameters -#define GET_ResetHistogram(disp) ((disp)->ResetHistogram) -#define SET_ResetHistogram(disp, fn) ((disp)->ResetHistogram = fn) -#define CALL_ResetMinmax(disp, parameters) (*((disp)->ResetMinmax)) parameters -#define GET_ResetMinmax(disp) ((disp)->ResetMinmax) -#define SET_ResetMinmax(disp, fn) ((disp)->ResetMinmax = fn) -#define CALL_TexImage3D(disp, parameters) (*((disp)->TexImage3D)) parameters -#define GET_TexImage3D(disp) ((disp)->TexImage3D) -#define SET_TexImage3D(disp, fn) ((disp)->TexImage3D = fn) -#define CALL_TexSubImage3D(disp, parameters) (*((disp)->TexSubImage3D)) parameters -#define GET_TexSubImage3D(disp) ((disp)->TexSubImage3D) -#define SET_TexSubImage3D(disp, fn) ((disp)->TexSubImage3D = fn) -#define CALL_CopyTexSubImage3D(disp, parameters) (*((disp)->CopyTexSubImage3D)) parameters -#define GET_CopyTexSubImage3D(disp) ((disp)->CopyTexSubImage3D) -#define SET_CopyTexSubImage3D(disp, fn) ((disp)->CopyTexSubImage3D = fn) -#define CALL_ActiveTextureARB(disp, parameters) (*((disp)->ActiveTextureARB)) parameters -#define GET_ActiveTextureARB(disp) ((disp)->ActiveTextureARB) -#define SET_ActiveTextureARB(disp, fn) ((disp)->ActiveTextureARB = fn) -#define CALL_ClientActiveTextureARB(disp, parameters) (*((disp)->ClientActiveTextureARB)) parameters -#define GET_ClientActiveTextureARB(disp) ((disp)->ClientActiveTextureARB) -#define SET_ClientActiveTextureARB(disp, fn) ((disp)->ClientActiveTextureARB = fn) -#define CALL_MultiTexCoord1dARB(disp, parameters) (*((disp)->MultiTexCoord1dARB)) parameters -#define GET_MultiTexCoord1dARB(disp) ((disp)->MultiTexCoord1dARB) -#define SET_MultiTexCoord1dARB(disp, fn) ((disp)->MultiTexCoord1dARB = fn) -#define CALL_MultiTexCoord1dvARB(disp, parameters) (*((disp)->MultiTexCoord1dvARB)) parameters -#define GET_MultiTexCoord1dvARB(disp) ((disp)->MultiTexCoord1dvARB) -#define SET_MultiTexCoord1dvARB(disp, fn) ((disp)->MultiTexCoord1dvARB = fn) -#define CALL_MultiTexCoord1fARB(disp, parameters) (*((disp)->MultiTexCoord1fARB)) parameters -#define GET_MultiTexCoord1fARB(disp) ((disp)->MultiTexCoord1fARB) -#define SET_MultiTexCoord1fARB(disp, fn) ((disp)->MultiTexCoord1fARB = fn) -#define CALL_MultiTexCoord1fvARB(disp, parameters) (*((disp)->MultiTexCoord1fvARB)) parameters -#define GET_MultiTexCoord1fvARB(disp) ((disp)->MultiTexCoord1fvARB) -#define SET_MultiTexCoord1fvARB(disp, fn) ((disp)->MultiTexCoord1fvARB = fn) -#define CALL_MultiTexCoord1iARB(disp, parameters) (*((disp)->MultiTexCoord1iARB)) parameters -#define GET_MultiTexCoord1iARB(disp) ((disp)->MultiTexCoord1iARB) -#define SET_MultiTexCoord1iARB(disp, fn) ((disp)->MultiTexCoord1iARB = fn) -#define CALL_MultiTexCoord1ivARB(disp, parameters) (*((disp)->MultiTexCoord1ivARB)) parameters -#define GET_MultiTexCoord1ivARB(disp) ((disp)->MultiTexCoord1ivARB) -#define SET_MultiTexCoord1ivARB(disp, fn) ((disp)->MultiTexCoord1ivARB = fn) -#define CALL_MultiTexCoord1sARB(disp, parameters) (*((disp)->MultiTexCoord1sARB)) parameters -#define GET_MultiTexCoord1sARB(disp) ((disp)->MultiTexCoord1sARB) -#define SET_MultiTexCoord1sARB(disp, fn) ((disp)->MultiTexCoord1sARB = fn) -#define CALL_MultiTexCoord1svARB(disp, parameters) (*((disp)->MultiTexCoord1svARB)) parameters -#define GET_MultiTexCoord1svARB(disp) ((disp)->MultiTexCoord1svARB) -#define SET_MultiTexCoord1svARB(disp, fn) ((disp)->MultiTexCoord1svARB = fn) -#define CALL_MultiTexCoord2dARB(disp, parameters) (*((disp)->MultiTexCoord2dARB)) parameters -#define GET_MultiTexCoord2dARB(disp) ((disp)->MultiTexCoord2dARB) -#define SET_MultiTexCoord2dARB(disp, fn) ((disp)->MultiTexCoord2dARB = fn) -#define CALL_MultiTexCoord2dvARB(disp, parameters) (*((disp)->MultiTexCoord2dvARB)) parameters -#define GET_MultiTexCoord2dvARB(disp) ((disp)->MultiTexCoord2dvARB) -#define SET_MultiTexCoord2dvARB(disp, fn) ((disp)->MultiTexCoord2dvARB = fn) -#define CALL_MultiTexCoord2fARB(disp, parameters) (*((disp)->MultiTexCoord2fARB)) parameters -#define GET_MultiTexCoord2fARB(disp) ((disp)->MultiTexCoord2fARB) -#define SET_MultiTexCoord2fARB(disp, fn) ((disp)->MultiTexCoord2fARB = fn) -#define CALL_MultiTexCoord2fvARB(disp, parameters) (*((disp)->MultiTexCoord2fvARB)) parameters -#define GET_MultiTexCoord2fvARB(disp) ((disp)->MultiTexCoord2fvARB) -#define SET_MultiTexCoord2fvARB(disp, fn) ((disp)->MultiTexCoord2fvARB = fn) -#define CALL_MultiTexCoord2iARB(disp, parameters) (*((disp)->MultiTexCoord2iARB)) parameters -#define GET_MultiTexCoord2iARB(disp) ((disp)->MultiTexCoord2iARB) -#define SET_MultiTexCoord2iARB(disp, fn) ((disp)->MultiTexCoord2iARB = fn) -#define CALL_MultiTexCoord2ivARB(disp, parameters) (*((disp)->MultiTexCoord2ivARB)) parameters -#define GET_MultiTexCoord2ivARB(disp) ((disp)->MultiTexCoord2ivARB) -#define SET_MultiTexCoord2ivARB(disp, fn) ((disp)->MultiTexCoord2ivARB = fn) -#define CALL_MultiTexCoord2sARB(disp, parameters) (*((disp)->MultiTexCoord2sARB)) parameters -#define GET_MultiTexCoord2sARB(disp) ((disp)->MultiTexCoord2sARB) -#define SET_MultiTexCoord2sARB(disp, fn) ((disp)->MultiTexCoord2sARB = fn) -#define CALL_MultiTexCoord2svARB(disp, parameters) (*((disp)->MultiTexCoord2svARB)) parameters -#define GET_MultiTexCoord2svARB(disp) ((disp)->MultiTexCoord2svARB) -#define SET_MultiTexCoord2svARB(disp, fn) ((disp)->MultiTexCoord2svARB = fn) -#define CALL_MultiTexCoord3dARB(disp, parameters) (*((disp)->MultiTexCoord3dARB)) parameters -#define GET_MultiTexCoord3dARB(disp) ((disp)->MultiTexCoord3dARB) -#define SET_MultiTexCoord3dARB(disp, fn) ((disp)->MultiTexCoord3dARB = fn) -#define CALL_MultiTexCoord3dvARB(disp, parameters) (*((disp)->MultiTexCoord3dvARB)) parameters -#define GET_MultiTexCoord3dvARB(disp) ((disp)->MultiTexCoord3dvARB) -#define SET_MultiTexCoord3dvARB(disp, fn) ((disp)->MultiTexCoord3dvARB = fn) -#define CALL_MultiTexCoord3fARB(disp, parameters) (*((disp)->MultiTexCoord3fARB)) parameters -#define GET_MultiTexCoord3fARB(disp) ((disp)->MultiTexCoord3fARB) -#define SET_MultiTexCoord3fARB(disp, fn) ((disp)->MultiTexCoord3fARB = fn) -#define CALL_MultiTexCoord3fvARB(disp, parameters) (*((disp)->MultiTexCoord3fvARB)) parameters -#define GET_MultiTexCoord3fvARB(disp) ((disp)->MultiTexCoord3fvARB) -#define SET_MultiTexCoord3fvARB(disp, fn) ((disp)->MultiTexCoord3fvARB = fn) -#define CALL_MultiTexCoord3iARB(disp, parameters) (*((disp)->MultiTexCoord3iARB)) parameters -#define GET_MultiTexCoord3iARB(disp) ((disp)->MultiTexCoord3iARB) -#define SET_MultiTexCoord3iARB(disp, fn) ((disp)->MultiTexCoord3iARB = fn) -#define CALL_MultiTexCoord3ivARB(disp, parameters) (*((disp)->MultiTexCoord3ivARB)) parameters -#define GET_MultiTexCoord3ivARB(disp) ((disp)->MultiTexCoord3ivARB) -#define SET_MultiTexCoord3ivARB(disp, fn) ((disp)->MultiTexCoord3ivARB = fn) -#define CALL_MultiTexCoord3sARB(disp, parameters) (*((disp)->MultiTexCoord3sARB)) parameters -#define GET_MultiTexCoord3sARB(disp) ((disp)->MultiTexCoord3sARB) -#define SET_MultiTexCoord3sARB(disp, fn) ((disp)->MultiTexCoord3sARB = fn) -#define CALL_MultiTexCoord3svARB(disp, parameters) (*((disp)->MultiTexCoord3svARB)) parameters -#define GET_MultiTexCoord3svARB(disp) ((disp)->MultiTexCoord3svARB) -#define SET_MultiTexCoord3svARB(disp, fn) ((disp)->MultiTexCoord3svARB = fn) -#define CALL_MultiTexCoord4dARB(disp, parameters) (*((disp)->MultiTexCoord4dARB)) parameters -#define GET_MultiTexCoord4dARB(disp) ((disp)->MultiTexCoord4dARB) -#define SET_MultiTexCoord4dARB(disp, fn) ((disp)->MultiTexCoord4dARB = fn) -#define CALL_MultiTexCoord4dvARB(disp, parameters) (*((disp)->MultiTexCoord4dvARB)) parameters -#define GET_MultiTexCoord4dvARB(disp) ((disp)->MultiTexCoord4dvARB) -#define SET_MultiTexCoord4dvARB(disp, fn) ((disp)->MultiTexCoord4dvARB = fn) -#define CALL_MultiTexCoord4fARB(disp, parameters) (*((disp)->MultiTexCoord4fARB)) parameters -#define GET_MultiTexCoord4fARB(disp) ((disp)->MultiTexCoord4fARB) -#define SET_MultiTexCoord4fARB(disp, fn) ((disp)->MultiTexCoord4fARB = fn) -#define CALL_MultiTexCoord4fvARB(disp, parameters) (*((disp)->MultiTexCoord4fvARB)) parameters -#define GET_MultiTexCoord4fvARB(disp) ((disp)->MultiTexCoord4fvARB) -#define SET_MultiTexCoord4fvARB(disp, fn) ((disp)->MultiTexCoord4fvARB = fn) -#define CALL_MultiTexCoord4iARB(disp, parameters) (*((disp)->MultiTexCoord4iARB)) parameters -#define GET_MultiTexCoord4iARB(disp) ((disp)->MultiTexCoord4iARB) -#define SET_MultiTexCoord4iARB(disp, fn) ((disp)->MultiTexCoord4iARB = fn) -#define CALL_MultiTexCoord4ivARB(disp, parameters) (*((disp)->MultiTexCoord4ivARB)) parameters -#define GET_MultiTexCoord4ivARB(disp) ((disp)->MultiTexCoord4ivARB) -#define SET_MultiTexCoord4ivARB(disp, fn) ((disp)->MultiTexCoord4ivARB = fn) -#define CALL_MultiTexCoord4sARB(disp, parameters) (*((disp)->MultiTexCoord4sARB)) parameters -#define GET_MultiTexCoord4sARB(disp) ((disp)->MultiTexCoord4sARB) -#define SET_MultiTexCoord4sARB(disp, fn) ((disp)->MultiTexCoord4sARB = fn) -#define CALL_MultiTexCoord4svARB(disp, parameters) (*((disp)->MultiTexCoord4svARB)) parameters -#define GET_MultiTexCoord4svARB(disp) ((disp)->MultiTexCoord4svARB) -#define SET_MultiTexCoord4svARB(disp, fn) ((disp)->MultiTexCoord4svARB = fn) - -#if !defined(IN_DRI_DRIVER) - -#define CALL_AttachShader(disp, parameters) (*((disp)->AttachShader)) parameters -#define GET_AttachShader(disp) ((disp)->AttachShader) -#define SET_AttachShader(disp, fn) ((disp)->AttachShader = fn) -#define CALL_CreateProgram(disp, parameters) (*((disp)->CreateProgram)) parameters -#define GET_CreateProgram(disp) ((disp)->CreateProgram) -#define SET_CreateProgram(disp, fn) ((disp)->CreateProgram = fn) -#define CALL_CreateShader(disp, parameters) (*((disp)->CreateShader)) parameters -#define GET_CreateShader(disp) ((disp)->CreateShader) -#define SET_CreateShader(disp, fn) ((disp)->CreateShader = fn) -#define CALL_DeleteProgram(disp, parameters) (*((disp)->DeleteProgram)) parameters -#define GET_DeleteProgram(disp) ((disp)->DeleteProgram) -#define SET_DeleteProgram(disp, fn) ((disp)->DeleteProgram = fn) -#define CALL_DeleteShader(disp, parameters) (*((disp)->DeleteShader)) parameters -#define GET_DeleteShader(disp) ((disp)->DeleteShader) -#define SET_DeleteShader(disp, fn) ((disp)->DeleteShader = fn) -#define CALL_DetachShader(disp, parameters) (*((disp)->DetachShader)) parameters -#define GET_DetachShader(disp) ((disp)->DetachShader) -#define SET_DetachShader(disp, fn) ((disp)->DetachShader = fn) -#define CALL_GetAttachedShaders(disp, parameters) (*((disp)->GetAttachedShaders)) parameters -#define GET_GetAttachedShaders(disp) ((disp)->GetAttachedShaders) -#define SET_GetAttachedShaders(disp, fn) ((disp)->GetAttachedShaders = fn) -#define CALL_GetProgramInfoLog(disp, parameters) (*((disp)->GetProgramInfoLog)) parameters -#define GET_GetProgramInfoLog(disp) ((disp)->GetProgramInfoLog) -#define SET_GetProgramInfoLog(disp, fn) ((disp)->GetProgramInfoLog = fn) -#define CALL_GetProgramiv(disp, parameters) (*((disp)->GetProgramiv)) parameters -#define GET_GetProgramiv(disp) ((disp)->GetProgramiv) -#define SET_GetProgramiv(disp, fn) ((disp)->GetProgramiv = fn) -#define CALL_GetShaderInfoLog(disp, parameters) (*((disp)->GetShaderInfoLog)) parameters -#define GET_GetShaderInfoLog(disp) ((disp)->GetShaderInfoLog) -#define SET_GetShaderInfoLog(disp, fn) ((disp)->GetShaderInfoLog = fn) -#define CALL_GetShaderiv(disp, parameters) (*((disp)->GetShaderiv)) parameters -#define GET_GetShaderiv(disp) ((disp)->GetShaderiv) -#define SET_GetShaderiv(disp, fn) ((disp)->GetShaderiv = fn) -#define CALL_IsProgram(disp, parameters) (*((disp)->IsProgram)) parameters -#define GET_IsProgram(disp) ((disp)->IsProgram) -#define SET_IsProgram(disp, fn) ((disp)->IsProgram = fn) -#define CALL_IsShader(disp, parameters) (*((disp)->IsShader)) parameters -#define GET_IsShader(disp) ((disp)->IsShader) -#define SET_IsShader(disp, fn) ((disp)->IsShader = fn) -#define CALL_StencilFuncSeparate(disp, parameters) (*((disp)->StencilFuncSeparate)) parameters -#define GET_StencilFuncSeparate(disp) ((disp)->StencilFuncSeparate) -#define SET_StencilFuncSeparate(disp, fn) ((disp)->StencilFuncSeparate = fn) -#define CALL_StencilMaskSeparate(disp, parameters) (*((disp)->StencilMaskSeparate)) parameters -#define GET_StencilMaskSeparate(disp) ((disp)->StencilMaskSeparate) -#define SET_StencilMaskSeparate(disp, fn) ((disp)->StencilMaskSeparate = fn) -#define CALL_StencilOpSeparate(disp, parameters) (*((disp)->StencilOpSeparate)) parameters -#define GET_StencilOpSeparate(disp) ((disp)->StencilOpSeparate) -#define SET_StencilOpSeparate(disp, fn) ((disp)->StencilOpSeparate = fn) -#define CALL_UniformMatrix2x3fv(disp, parameters) (*((disp)->UniformMatrix2x3fv)) parameters -#define GET_UniformMatrix2x3fv(disp) ((disp)->UniformMatrix2x3fv) -#define SET_UniformMatrix2x3fv(disp, fn) ((disp)->UniformMatrix2x3fv = fn) -#define CALL_UniformMatrix2x4fv(disp, parameters) (*((disp)->UniformMatrix2x4fv)) parameters -#define GET_UniformMatrix2x4fv(disp) ((disp)->UniformMatrix2x4fv) -#define SET_UniformMatrix2x4fv(disp, fn) ((disp)->UniformMatrix2x4fv = fn) -#define CALL_UniformMatrix3x2fv(disp, parameters) (*((disp)->UniformMatrix3x2fv)) parameters -#define GET_UniformMatrix3x2fv(disp) ((disp)->UniformMatrix3x2fv) -#define SET_UniformMatrix3x2fv(disp, fn) ((disp)->UniformMatrix3x2fv = fn) -#define CALL_UniformMatrix3x4fv(disp, parameters) (*((disp)->UniformMatrix3x4fv)) parameters -#define GET_UniformMatrix3x4fv(disp) ((disp)->UniformMatrix3x4fv) -#define SET_UniformMatrix3x4fv(disp, fn) ((disp)->UniformMatrix3x4fv = fn) -#define CALL_UniformMatrix4x2fv(disp, parameters) (*((disp)->UniformMatrix4x2fv)) parameters -#define GET_UniformMatrix4x2fv(disp) ((disp)->UniformMatrix4x2fv) -#define SET_UniformMatrix4x2fv(disp, fn) ((disp)->UniformMatrix4x2fv = fn) -#define CALL_UniformMatrix4x3fv(disp, parameters) (*((disp)->UniformMatrix4x3fv)) parameters -#define GET_UniformMatrix4x3fv(disp) ((disp)->UniformMatrix4x3fv) -#define SET_UniformMatrix4x3fv(disp, fn) ((disp)->UniformMatrix4x3fv = fn) -#define CALL_LoadTransposeMatrixdARB(disp, parameters) (*((disp)->LoadTransposeMatrixdARB)) parameters -#define GET_LoadTransposeMatrixdARB(disp) ((disp)->LoadTransposeMatrixdARB) -#define SET_LoadTransposeMatrixdARB(disp, fn) ((disp)->LoadTransposeMatrixdARB = fn) -#define CALL_LoadTransposeMatrixfARB(disp, parameters) (*((disp)->LoadTransposeMatrixfARB)) parameters -#define GET_LoadTransposeMatrixfARB(disp) ((disp)->LoadTransposeMatrixfARB) -#define SET_LoadTransposeMatrixfARB(disp, fn) ((disp)->LoadTransposeMatrixfARB = fn) -#define CALL_MultTransposeMatrixdARB(disp, parameters) (*((disp)->MultTransposeMatrixdARB)) parameters -#define GET_MultTransposeMatrixdARB(disp) ((disp)->MultTransposeMatrixdARB) -#define SET_MultTransposeMatrixdARB(disp, fn) ((disp)->MultTransposeMatrixdARB = fn) -#define CALL_MultTransposeMatrixfARB(disp, parameters) (*((disp)->MultTransposeMatrixfARB)) parameters -#define GET_MultTransposeMatrixfARB(disp) ((disp)->MultTransposeMatrixfARB) -#define SET_MultTransposeMatrixfARB(disp, fn) ((disp)->MultTransposeMatrixfARB = fn) -#define CALL_SampleCoverageARB(disp, parameters) (*((disp)->SampleCoverageARB)) parameters -#define GET_SampleCoverageARB(disp) ((disp)->SampleCoverageARB) -#define SET_SampleCoverageARB(disp, fn) ((disp)->SampleCoverageARB = fn) -#define CALL_CompressedTexImage1DARB(disp, parameters) (*((disp)->CompressedTexImage1DARB)) parameters -#define GET_CompressedTexImage1DARB(disp) ((disp)->CompressedTexImage1DARB) -#define SET_CompressedTexImage1DARB(disp, fn) ((disp)->CompressedTexImage1DARB = fn) -#define CALL_CompressedTexImage2DARB(disp, parameters) (*((disp)->CompressedTexImage2DARB)) parameters -#define GET_CompressedTexImage2DARB(disp) ((disp)->CompressedTexImage2DARB) -#define SET_CompressedTexImage2DARB(disp, fn) ((disp)->CompressedTexImage2DARB = fn) -#define CALL_CompressedTexImage3DARB(disp, parameters) (*((disp)->CompressedTexImage3DARB)) parameters -#define GET_CompressedTexImage3DARB(disp) ((disp)->CompressedTexImage3DARB) -#define SET_CompressedTexImage3DARB(disp, fn) ((disp)->CompressedTexImage3DARB = fn) -#define CALL_CompressedTexSubImage1DARB(disp, parameters) (*((disp)->CompressedTexSubImage1DARB)) parameters -#define GET_CompressedTexSubImage1DARB(disp) ((disp)->CompressedTexSubImage1DARB) -#define SET_CompressedTexSubImage1DARB(disp, fn) ((disp)->CompressedTexSubImage1DARB = fn) -#define CALL_CompressedTexSubImage2DARB(disp, parameters) (*((disp)->CompressedTexSubImage2DARB)) parameters -#define GET_CompressedTexSubImage2DARB(disp) ((disp)->CompressedTexSubImage2DARB) -#define SET_CompressedTexSubImage2DARB(disp, fn) ((disp)->CompressedTexSubImage2DARB = fn) -#define CALL_CompressedTexSubImage3DARB(disp, parameters) (*((disp)->CompressedTexSubImage3DARB)) parameters -#define GET_CompressedTexSubImage3DARB(disp) ((disp)->CompressedTexSubImage3DARB) -#define SET_CompressedTexSubImage3DARB(disp, fn) ((disp)->CompressedTexSubImage3DARB = fn) -#define CALL_GetCompressedTexImageARB(disp, parameters) (*((disp)->GetCompressedTexImageARB)) parameters -#define GET_GetCompressedTexImageARB(disp) ((disp)->GetCompressedTexImageARB) -#define SET_GetCompressedTexImageARB(disp, fn) ((disp)->GetCompressedTexImageARB = fn) -#define CALL_DisableVertexAttribArrayARB(disp, parameters) (*((disp)->DisableVertexAttribArrayARB)) parameters -#define GET_DisableVertexAttribArrayARB(disp) ((disp)->DisableVertexAttribArrayARB) -#define SET_DisableVertexAttribArrayARB(disp, fn) ((disp)->DisableVertexAttribArrayARB = fn) -#define CALL_EnableVertexAttribArrayARB(disp, parameters) (*((disp)->EnableVertexAttribArrayARB)) parameters -#define GET_EnableVertexAttribArrayARB(disp) ((disp)->EnableVertexAttribArrayARB) -#define SET_EnableVertexAttribArrayARB(disp, fn) ((disp)->EnableVertexAttribArrayARB = fn) -#define CALL_GetProgramEnvParameterdvARB(disp, parameters) (*((disp)->GetProgramEnvParameterdvARB)) parameters -#define GET_GetProgramEnvParameterdvARB(disp) ((disp)->GetProgramEnvParameterdvARB) -#define SET_GetProgramEnvParameterdvARB(disp, fn) ((disp)->GetProgramEnvParameterdvARB = fn) -#define CALL_GetProgramEnvParameterfvARB(disp, parameters) (*((disp)->GetProgramEnvParameterfvARB)) parameters -#define GET_GetProgramEnvParameterfvARB(disp) ((disp)->GetProgramEnvParameterfvARB) -#define SET_GetProgramEnvParameterfvARB(disp, fn) ((disp)->GetProgramEnvParameterfvARB = fn) -#define CALL_GetProgramLocalParameterdvARB(disp, parameters) (*((disp)->GetProgramLocalParameterdvARB)) parameters -#define GET_GetProgramLocalParameterdvARB(disp) ((disp)->GetProgramLocalParameterdvARB) -#define SET_GetProgramLocalParameterdvARB(disp, fn) ((disp)->GetProgramLocalParameterdvARB = fn) -#define CALL_GetProgramLocalParameterfvARB(disp, parameters) (*((disp)->GetProgramLocalParameterfvARB)) parameters -#define GET_GetProgramLocalParameterfvARB(disp) ((disp)->GetProgramLocalParameterfvARB) -#define SET_GetProgramLocalParameterfvARB(disp, fn) ((disp)->GetProgramLocalParameterfvARB = fn) -#define CALL_GetProgramStringARB(disp, parameters) (*((disp)->GetProgramStringARB)) parameters -#define GET_GetProgramStringARB(disp) ((disp)->GetProgramStringARB) -#define SET_GetProgramStringARB(disp, fn) ((disp)->GetProgramStringARB = fn) -#define CALL_GetProgramivARB(disp, parameters) (*((disp)->GetProgramivARB)) parameters -#define GET_GetProgramivARB(disp) ((disp)->GetProgramivARB) -#define SET_GetProgramivARB(disp, fn) ((disp)->GetProgramivARB = fn) -#define CALL_GetVertexAttribdvARB(disp, parameters) (*((disp)->GetVertexAttribdvARB)) parameters -#define GET_GetVertexAttribdvARB(disp) ((disp)->GetVertexAttribdvARB) -#define SET_GetVertexAttribdvARB(disp, fn) ((disp)->GetVertexAttribdvARB = fn) -#define CALL_GetVertexAttribfvARB(disp, parameters) (*((disp)->GetVertexAttribfvARB)) parameters -#define GET_GetVertexAttribfvARB(disp) ((disp)->GetVertexAttribfvARB) -#define SET_GetVertexAttribfvARB(disp, fn) ((disp)->GetVertexAttribfvARB = fn) -#define CALL_GetVertexAttribivARB(disp, parameters) (*((disp)->GetVertexAttribivARB)) parameters -#define GET_GetVertexAttribivARB(disp) ((disp)->GetVertexAttribivARB) -#define SET_GetVertexAttribivARB(disp, fn) ((disp)->GetVertexAttribivARB = fn) -#define CALL_ProgramEnvParameter4dARB(disp, parameters) (*((disp)->ProgramEnvParameter4dARB)) parameters -#define GET_ProgramEnvParameter4dARB(disp) ((disp)->ProgramEnvParameter4dARB) -#define SET_ProgramEnvParameter4dARB(disp, fn) ((disp)->ProgramEnvParameter4dARB = fn) -#define CALL_ProgramEnvParameter4dvARB(disp, parameters) (*((disp)->ProgramEnvParameter4dvARB)) parameters -#define GET_ProgramEnvParameter4dvARB(disp) ((disp)->ProgramEnvParameter4dvARB) -#define SET_ProgramEnvParameter4dvARB(disp, fn) ((disp)->ProgramEnvParameter4dvARB = fn) -#define CALL_ProgramEnvParameter4fARB(disp, parameters) (*((disp)->ProgramEnvParameter4fARB)) parameters -#define GET_ProgramEnvParameter4fARB(disp) ((disp)->ProgramEnvParameter4fARB) -#define SET_ProgramEnvParameter4fARB(disp, fn) ((disp)->ProgramEnvParameter4fARB = fn) -#define CALL_ProgramEnvParameter4fvARB(disp, parameters) (*((disp)->ProgramEnvParameter4fvARB)) parameters -#define GET_ProgramEnvParameter4fvARB(disp) ((disp)->ProgramEnvParameter4fvARB) -#define SET_ProgramEnvParameter4fvARB(disp, fn) ((disp)->ProgramEnvParameter4fvARB = fn) -#define CALL_ProgramLocalParameter4dARB(disp, parameters) (*((disp)->ProgramLocalParameter4dARB)) parameters -#define GET_ProgramLocalParameter4dARB(disp) ((disp)->ProgramLocalParameter4dARB) -#define SET_ProgramLocalParameter4dARB(disp, fn) ((disp)->ProgramLocalParameter4dARB = fn) -#define CALL_ProgramLocalParameter4dvARB(disp, parameters) (*((disp)->ProgramLocalParameter4dvARB)) parameters -#define GET_ProgramLocalParameter4dvARB(disp) ((disp)->ProgramLocalParameter4dvARB) -#define SET_ProgramLocalParameter4dvARB(disp, fn) ((disp)->ProgramLocalParameter4dvARB = fn) -#define CALL_ProgramLocalParameter4fARB(disp, parameters) (*((disp)->ProgramLocalParameter4fARB)) parameters -#define GET_ProgramLocalParameter4fARB(disp) ((disp)->ProgramLocalParameter4fARB) -#define SET_ProgramLocalParameter4fARB(disp, fn) ((disp)->ProgramLocalParameter4fARB = fn) -#define CALL_ProgramLocalParameter4fvARB(disp, parameters) (*((disp)->ProgramLocalParameter4fvARB)) parameters -#define GET_ProgramLocalParameter4fvARB(disp) ((disp)->ProgramLocalParameter4fvARB) -#define SET_ProgramLocalParameter4fvARB(disp, fn) ((disp)->ProgramLocalParameter4fvARB = fn) -#define CALL_ProgramStringARB(disp, parameters) (*((disp)->ProgramStringARB)) parameters -#define GET_ProgramStringARB(disp) ((disp)->ProgramStringARB) -#define SET_ProgramStringARB(disp, fn) ((disp)->ProgramStringARB = fn) -#define CALL_VertexAttrib1dARB(disp, parameters) (*((disp)->VertexAttrib1dARB)) parameters -#define GET_VertexAttrib1dARB(disp) ((disp)->VertexAttrib1dARB) -#define SET_VertexAttrib1dARB(disp, fn) ((disp)->VertexAttrib1dARB = fn) -#define CALL_VertexAttrib1dvARB(disp, parameters) (*((disp)->VertexAttrib1dvARB)) parameters -#define GET_VertexAttrib1dvARB(disp) ((disp)->VertexAttrib1dvARB) -#define SET_VertexAttrib1dvARB(disp, fn) ((disp)->VertexAttrib1dvARB = fn) -#define CALL_VertexAttrib1fARB(disp, parameters) (*((disp)->VertexAttrib1fARB)) parameters -#define GET_VertexAttrib1fARB(disp) ((disp)->VertexAttrib1fARB) -#define SET_VertexAttrib1fARB(disp, fn) ((disp)->VertexAttrib1fARB = fn) -#define CALL_VertexAttrib1fvARB(disp, parameters) (*((disp)->VertexAttrib1fvARB)) parameters -#define GET_VertexAttrib1fvARB(disp) ((disp)->VertexAttrib1fvARB) -#define SET_VertexAttrib1fvARB(disp, fn) ((disp)->VertexAttrib1fvARB = fn) -#define CALL_VertexAttrib1sARB(disp, parameters) (*((disp)->VertexAttrib1sARB)) parameters -#define GET_VertexAttrib1sARB(disp) ((disp)->VertexAttrib1sARB) -#define SET_VertexAttrib1sARB(disp, fn) ((disp)->VertexAttrib1sARB = fn) -#define CALL_VertexAttrib1svARB(disp, parameters) (*((disp)->VertexAttrib1svARB)) parameters -#define GET_VertexAttrib1svARB(disp) ((disp)->VertexAttrib1svARB) -#define SET_VertexAttrib1svARB(disp, fn) ((disp)->VertexAttrib1svARB = fn) -#define CALL_VertexAttrib2dARB(disp, parameters) (*((disp)->VertexAttrib2dARB)) parameters -#define GET_VertexAttrib2dARB(disp) ((disp)->VertexAttrib2dARB) -#define SET_VertexAttrib2dARB(disp, fn) ((disp)->VertexAttrib2dARB = fn) -#define CALL_VertexAttrib2dvARB(disp, parameters) (*((disp)->VertexAttrib2dvARB)) parameters -#define GET_VertexAttrib2dvARB(disp) ((disp)->VertexAttrib2dvARB) -#define SET_VertexAttrib2dvARB(disp, fn) ((disp)->VertexAttrib2dvARB = fn) -#define CALL_VertexAttrib2fARB(disp, parameters) (*((disp)->VertexAttrib2fARB)) parameters -#define GET_VertexAttrib2fARB(disp) ((disp)->VertexAttrib2fARB) -#define SET_VertexAttrib2fARB(disp, fn) ((disp)->VertexAttrib2fARB = fn) -#define CALL_VertexAttrib2fvARB(disp, parameters) (*((disp)->VertexAttrib2fvARB)) parameters -#define GET_VertexAttrib2fvARB(disp) ((disp)->VertexAttrib2fvARB) -#define SET_VertexAttrib2fvARB(disp, fn) ((disp)->VertexAttrib2fvARB = fn) -#define CALL_VertexAttrib2sARB(disp, parameters) (*((disp)->VertexAttrib2sARB)) parameters -#define GET_VertexAttrib2sARB(disp) ((disp)->VertexAttrib2sARB) -#define SET_VertexAttrib2sARB(disp, fn) ((disp)->VertexAttrib2sARB = fn) -#define CALL_VertexAttrib2svARB(disp, parameters) (*((disp)->VertexAttrib2svARB)) parameters -#define GET_VertexAttrib2svARB(disp) ((disp)->VertexAttrib2svARB) -#define SET_VertexAttrib2svARB(disp, fn) ((disp)->VertexAttrib2svARB = fn) -#define CALL_VertexAttrib3dARB(disp, parameters) (*((disp)->VertexAttrib3dARB)) parameters -#define GET_VertexAttrib3dARB(disp) ((disp)->VertexAttrib3dARB) -#define SET_VertexAttrib3dARB(disp, fn) ((disp)->VertexAttrib3dARB = fn) -#define CALL_VertexAttrib3dvARB(disp, parameters) (*((disp)->VertexAttrib3dvARB)) parameters -#define GET_VertexAttrib3dvARB(disp) ((disp)->VertexAttrib3dvARB) -#define SET_VertexAttrib3dvARB(disp, fn) ((disp)->VertexAttrib3dvARB = fn) -#define CALL_VertexAttrib3fARB(disp, parameters) (*((disp)->VertexAttrib3fARB)) parameters -#define GET_VertexAttrib3fARB(disp) ((disp)->VertexAttrib3fARB) -#define SET_VertexAttrib3fARB(disp, fn) ((disp)->VertexAttrib3fARB = fn) -#define CALL_VertexAttrib3fvARB(disp, parameters) (*((disp)->VertexAttrib3fvARB)) parameters -#define GET_VertexAttrib3fvARB(disp) ((disp)->VertexAttrib3fvARB) -#define SET_VertexAttrib3fvARB(disp, fn) ((disp)->VertexAttrib3fvARB = fn) -#define CALL_VertexAttrib3sARB(disp, parameters) (*((disp)->VertexAttrib3sARB)) parameters -#define GET_VertexAttrib3sARB(disp) ((disp)->VertexAttrib3sARB) -#define SET_VertexAttrib3sARB(disp, fn) ((disp)->VertexAttrib3sARB = fn) -#define CALL_VertexAttrib3svARB(disp, parameters) (*((disp)->VertexAttrib3svARB)) parameters -#define GET_VertexAttrib3svARB(disp) ((disp)->VertexAttrib3svARB) -#define SET_VertexAttrib3svARB(disp, fn) ((disp)->VertexAttrib3svARB = fn) -#define CALL_VertexAttrib4NbvARB(disp, parameters) (*((disp)->VertexAttrib4NbvARB)) parameters -#define GET_VertexAttrib4NbvARB(disp) ((disp)->VertexAttrib4NbvARB) -#define SET_VertexAttrib4NbvARB(disp, fn) ((disp)->VertexAttrib4NbvARB = fn) -#define CALL_VertexAttrib4NivARB(disp, parameters) (*((disp)->VertexAttrib4NivARB)) parameters -#define GET_VertexAttrib4NivARB(disp) ((disp)->VertexAttrib4NivARB) -#define SET_VertexAttrib4NivARB(disp, fn) ((disp)->VertexAttrib4NivARB = fn) -#define CALL_VertexAttrib4NsvARB(disp, parameters) (*((disp)->VertexAttrib4NsvARB)) parameters -#define GET_VertexAttrib4NsvARB(disp) ((disp)->VertexAttrib4NsvARB) -#define SET_VertexAttrib4NsvARB(disp, fn) ((disp)->VertexAttrib4NsvARB = fn) -#define CALL_VertexAttrib4NubARB(disp, parameters) (*((disp)->VertexAttrib4NubARB)) parameters -#define GET_VertexAttrib4NubARB(disp) ((disp)->VertexAttrib4NubARB) -#define SET_VertexAttrib4NubARB(disp, fn) ((disp)->VertexAttrib4NubARB = fn) -#define CALL_VertexAttrib4NubvARB(disp, parameters) (*((disp)->VertexAttrib4NubvARB)) parameters -#define GET_VertexAttrib4NubvARB(disp) ((disp)->VertexAttrib4NubvARB) -#define SET_VertexAttrib4NubvARB(disp, fn) ((disp)->VertexAttrib4NubvARB = fn) -#define CALL_VertexAttrib4NuivARB(disp, parameters) (*((disp)->VertexAttrib4NuivARB)) parameters -#define GET_VertexAttrib4NuivARB(disp) ((disp)->VertexAttrib4NuivARB) -#define SET_VertexAttrib4NuivARB(disp, fn) ((disp)->VertexAttrib4NuivARB = fn) -#define CALL_VertexAttrib4NusvARB(disp, parameters) (*((disp)->VertexAttrib4NusvARB)) parameters -#define GET_VertexAttrib4NusvARB(disp) ((disp)->VertexAttrib4NusvARB) -#define SET_VertexAttrib4NusvARB(disp, fn) ((disp)->VertexAttrib4NusvARB = fn) -#define CALL_VertexAttrib4bvARB(disp, parameters) (*((disp)->VertexAttrib4bvARB)) parameters -#define GET_VertexAttrib4bvARB(disp) ((disp)->VertexAttrib4bvARB) -#define SET_VertexAttrib4bvARB(disp, fn) ((disp)->VertexAttrib4bvARB = fn) -#define CALL_VertexAttrib4dARB(disp, parameters) (*((disp)->VertexAttrib4dARB)) parameters -#define GET_VertexAttrib4dARB(disp) ((disp)->VertexAttrib4dARB) -#define SET_VertexAttrib4dARB(disp, fn) ((disp)->VertexAttrib4dARB = fn) -#define CALL_VertexAttrib4dvARB(disp, parameters) (*((disp)->VertexAttrib4dvARB)) parameters -#define GET_VertexAttrib4dvARB(disp) ((disp)->VertexAttrib4dvARB) -#define SET_VertexAttrib4dvARB(disp, fn) ((disp)->VertexAttrib4dvARB = fn) -#define CALL_VertexAttrib4fARB(disp, parameters) (*((disp)->VertexAttrib4fARB)) parameters -#define GET_VertexAttrib4fARB(disp) ((disp)->VertexAttrib4fARB) -#define SET_VertexAttrib4fARB(disp, fn) ((disp)->VertexAttrib4fARB = fn) -#define CALL_VertexAttrib4fvARB(disp, parameters) (*((disp)->VertexAttrib4fvARB)) parameters -#define GET_VertexAttrib4fvARB(disp) ((disp)->VertexAttrib4fvARB) -#define SET_VertexAttrib4fvARB(disp, fn) ((disp)->VertexAttrib4fvARB = fn) -#define CALL_VertexAttrib4ivARB(disp, parameters) (*((disp)->VertexAttrib4ivARB)) parameters -#define GET_VertexAttrib4ivARB(disp) ((disp)->VertexAttrib4ivARB) -#define SET_VertexAttrib4ivARB(disp, fn) ((disp)->VertexAttrib4ivARB = fn) -#define CALL_VertexAttrib4sARB(disp, parameters) (*((disp)->VertexAttrib4sARB)) parameters -#define GET_VertexAttrib4sARB(disp) ((disp)->VertexAttrib4sARB) -#define SET_VertexAttrib4sARB(disp, fn) ((disp)->VertexAttrib4sARB = fn) -#define CALL_VertexAttrib4svARB(disp, parameters) (*((disp)->VertexAttrib4svARB)) parameters -#define GET_VertexAttrib4svARB(disp) ((disp)->VertexAttrib4svARB) -#define SET_VertexAttrib4svARB(disp, fn) ((disp)->VertexAttrib4svARB = fn) -#define CALL_VertexAttrib4ubvARB(disp, parameters) (*((disp)->VertexAttrib4ubvARB)) parameters -#define GET_VertexAttrib4ubvARB(disp) ((disp)->VertexAttrib4ubvARB) -#define SET_VertexAttrib4ubvARB(disp, fn) ((disp)->VertexAttrib4ubvARB = fn) -#define CALL_VertexAttrib4uivARB(disp, parameters) (*((disp)->VertexAttrib4uivARB)) parameters -#define GET_VertexAttrib4uivARB(disp) ((disp)->VertexAttrib4uivARB) -#define SET_VertexAttrib4uivARB(disp, fn) ((disp)->VertexAttrib4uivARB = fn) -#define CALL_VertexAttrib4usvARB(disp, parameters) (*((disp)->VertexAttrib4usvARB)) parameters -#define GET_VertexAttrib4usvARB(disp) ((disp)->VertexAttrib4usvARB) -#define SET_VertexAttrib4usvARB(disp, fn) ((disp)->VertexAttrib4usvARB = fn) -#define CALL_VertexAttribPointerARB(disp, parameters) (*((disp)->VertexAttribPointerARB)) parameters -#define GET_VertexAttribPointerARB(disp) ((disp)->VertexAttribPointerARB) -#define SET_VertexAttribPointerARB(disp, fn) ((disp)->VertexAttribPointerARB = fn) -#define CALL_BindBufferARB(disp, parameters) (*((disp)->BindBufferARB)) parameters -#define GET_BindBufferARB(disp) ((disp)->BindBufferARB) -#define SET_BindBufferARB(disp, fn) ((disp)->BindBufferARB = fn) -#define CALL_BufferDataARB(disp, parameters) (*((disp)->BufferDataARB)) parameters -#define GET_BufferDataARB(disp) ((disp)->BufferDataARB) -#define SET_BufferDataARB(disp, fn) ((disp)->BufferDataARB = fn) -#define CALL_BufferSubDataARB(disp, parameters) (*((disp)->BufferSubDataARB)) parameters -#define GET_BufferSubDataARB(disp) ((disp)->BufferSubDataARB) -#define SET_BufferSubDataARB(disp, fn) ((disp)->BufferSubDataARB = fn) -#define CALL_DeleteBuffersARB(disp, parameters) (*((disp)->DeleteBuffersARB)) parameters -#define GET_DeleteBuffersARB(disp) ((disp)->DeleteBuffersARB) -#define SET_DeleteBuffersARB(disp, fn) ((disp)->DeleteBuffersARB = fn) -#define CALL_GenBuffersARB(disp, parameters) (*((disp)->GenBuffersARB)) parameters -#define GET_GenBuffersARB(disp) ((disp)->GenBuffersARB) -#define SET_GenBuffersARB(disp, fn) ((disp)->GenBuffersARB = fn) -#define CALL_GetBufferParameterivARB(disp, parameters) (*((disp)->GetBufferParameterivARB)) parameters -#define GET_GetBufferParameterivARB(disp) ((disp)->GetBufferParameterivARB) -#define SET_GetBufferParameterivARB(disp, fn) ((disp)->GetBufferParameterivARB = fn) -#define CALL_GetBufferPointervARB(disp, parameters) (*((disp)->GetBufferPointervARB)) parameters -#define GET_GetBufferPointervARB(disp) ((disp)->GetBufferPointervARB) -#define SET_GetBufferPointervARB(disp, fn) ((disp)->GetBufferPointervARB = fn) -#define CALL_GetBufferSubDataARB(disp, parameters) (*((disp)->GetBufferSubDataARB)) parameters -#define GET_GetBufferSubDataARB(disp) ((disp)->GetBufferSubDataARB) -#define SET_GetBufferSubDataARB(disp, fn) ((disp)->GetBufferSubDataARB = fn) -#define CALL_IsBufferARB(disp, parameters) (*((disp)->IsBufferARB)) parameters -#define GET_IsBufferARB(disp) ((disp)->IsBufferARB) -#define SET_IsBufferARB(disp, fn) ((disp)->IsBufferARB = fn) -#define CALL_MapBufferARB(disp, parameters) (*((disp)->MapBufferARB)) parameters -#define GET_MapBufferARB(disp) ((disp)->MapBufferARB) -#define SET_MapBufferARB(disp, fn) ((disp)->MapBufferARB = fn) -#define CALL_UnmapBufferARB(disp, parameters) (*((disp)->UnmapBufferARB)) parameters -#define GET_UnmapBufferARB(disp) ((disp)->UnmapBufferARB) -#define SET_UnmapBufferARB(disp, fn) ((disp)->UnmapBufferARB = fn) -#define CALL_BeginQueryARB(disp, parameters) (*((disp)->BeginQueryARB)) parameters -#define GET_BeginQueryARB(disp) ((disp)->BeginQueryARB) -#define SET_BeginQueryARB(disp, fn) ((disp)->BeginQueryARB = fn) -#define CALL_DeleteQueriesARB(disp, parameters) (*((disp)->DeleteQueriesARB)) parameters -#define GET_DeleteQueriesARB(disp) ((disp)->DeleteQueriesARB) -#define SET_DeleteQueriesARB(disp, fn) ((disp)->DeleteQueriesARB = fn) -#define CALL_EndQueryARB(disp, parameters) (*((disp)->EndQueryARB)) parameters -#define GET_EndQueryARB(disp) ((disp)->EndQueryARB) -#define SET_EndQueryARB(disp, fn) ((disp)->EndQueryARB = fn) -#define CALL_GenQueriesARB(disp, parameters) (*((disp)->GenQueriesARB)) parameters -#define GET_GenQueriesARB(disp) ((disp)->GenQueriesARB) -#define SET_GenQueriesARB(disp, fn) ((disp)->GenQueriesARB = fn) -#define CALL_GetQueryObjectivARB(disp, parameters) (*((disp)->GetQueryObjectivARB)) parameters -#define GET_GetQueryObjectivARB(disp) ((disp)->GetQueryObjectivARB) -#define SET_GetQueryObjectivARB(disp, fn) ((disp)->GetQueryObjectivARB = fn) -#define CALL_GetQueryObjectuivARB(disp, parameters) (*((disp)->GetQueryObjectuivARB)) parameters -#define GET_GetQueryObjectuivARB(disp) ((disp)->GetQueryObjectuivARB) -#define SET_GetQueryObjectuivARB(disp, fn) ((disp)->GetQueryObjectuivARB = fn) -#define CALL_GetQueryivARB(disp, parameters) (*((disp)->GetQueryivARB)) parameters -#define GET_GetQueryivARB(disp) ((disp)->GetQueryivARB) -#define SET_GetQueryivARB(disp, fn) ((disp)->GetQueryivARB = fn) -#define CALL_IsQueryARB(disp, parameters) (*((disp)->IsQueryARB)) parameters -#define GET_IsQueryARB(disp) ((disp)->IsQueryARB) -#define SET_IsQueryARB(disp, fn) ((disp)->IsQueryARB = fn) -#define CALL_AttachObjectARB(disp, parameters) (*((disp)->AttachObjectARB)) parameters -#define GET_AttachObjectARB(disp) ((disp)->AttachObjectARB) -#define SET_AttachObjectARB(disp, fn) ((disp)->AttachObjectARB = fn) -#define CALL_CompileShaderARB(disp, parameters) (*((disp)->CompileShaderARB)) parameters -#define GET_CompileShaderARB(disp) ((disp)->CompileShaderARB) -#define SET_CompileShaderARB(disp, fn) ((disp)->CompileShaderARB = fn) -#define CALL_CreateProgramObjectARB(disp, parameters) (*((disp)->CreateProgramObjectARB)) parameters -#define GET_CreateProgramObjectARB(disp) ((disp)->CreateProgramObjectARB) -#define SET_CreateProgramObjectARB(disp, fn) ((disp)->CreateProgramObjectARB = fn) -#define CALL_CreateShaderObjectARB(disp, parameters) (*((disp)->CreateShaderObjectARB)) parameters -#define GET_CreateShaderObjectARB(disp) ((disp)->CreateShaderObjectARB) -#define SET_CreateShaderObjectARB(disp, fn) ((disp)->CreateShaderObjectARB = fn) -#define CALL_DeleteObjectARB(disp, parameters) (*((disp)->DeleteObjectARB)) parameters -#define GET_DeleteObjectARB(disp) ((disp)->DeleteObjectARB) -#define SET_DeleteObjectARB(disp, fn) ((disp)->DeleteObjectARB = fn) -#define CALL_DetachObjectARB(disp, parameters) (*((disp)->DetachObjectARB)) parameters -#define GET_DetachObjectARB(disp) ((disp)->DetachObjectARB) -#define SET_DetachObjectARB(disp, fn) ((disp)->DetachObjectARB = fn) -#define CALL_GetActiveUniformARB(disp, parameters) (*((disp)->GetActiveUniformARB)) parameters -#define GET_GetActiveUniformARB(disp) ((disp)->GetActiveUniformARB) -#define SET_GetActiveUniformARB(disp, fn) ((disp)->GetActiveUniformARB = fn) -#define CALL_GetAttachedObjectsARB(disp, parameters) (*((disp)->GetAttachedObjectsARB)) parameters -#define GET_GetAttachedObjectsARB(disp) ((disp)->GetAttachedObjectsARB) -#define SET_GetAttachedObjectsARB(disp, fn) ((disp)->GetAttachedObjectsARB = fn) -#define CALL_GetHandleARB(disp, parameters) (*((disp)->GetHandleARB)) parameters -#define GET_GetHandleARB(disp) ((disp)->GetHandleARB) -#define SET_GetHandleARB(disp, fn) ((disp)->GetHandleARB = fn) -#define CALL_GetInfoLogARB(disp, parameters) (*((disp)->GetInfoLogARB)) parameters -#define GET_GetInfoLogARB(disp) ((disp)->GetInfoLogARB) -#define SET_GetInfoLogARB(disp, fn) ((disp)->GetInfoLogARB = fn) -#define CALL_GetObjectParameterfvARB(disp, parameters) (*((disp)->GetObjectParameterfvARB)) parameters -#define GET_GetObjectParameterfvARB(disp) ((disp)->GetObjectParameterfvARB) -#define SET_GetObjectParameterfvARB(disp, fn) ((disp)->GetObjectParameterfvARB = fn) -#define CALL_GetObjectParameterivARB(disp, parameters) (*((disp)->GetObjectParameterivARB)) parameters -#define GET_GetObjectParameterivARB(disp) ((disp)->GetObjectParameterivARB) -#define SET_GetObjectParameterivARB(disp, fn) ((disp)->GetObjectParameterivARB = fn) -#define CALL_GetShaderSourceARB(disp, parameters) (*((disp)->GetShaderSourceARB)) parameters -#define GET_GetShaderSourceARB(disp) ((disp)->GetShaderSourceARB) -#define SET_GetShaderSourceARB(disp, fn) ((disp)->GetShaderSourceARB = fn) -#define CALL_GetUniformLocationARB(disp, parameters) (*((disp)->GetUniformLocationARB)) parameters -#define GET_GetUniformLocationARB(disp) ((disp)->GetUniformLocationARB) -#define SET_GetUniformLocationARB(disp, fn) ((disp)->GetUniformLocationARB = fn) -#define CALL_GetUniformfvARB(disp, parameters) (*((disp)->GetUniformfvARB)) parameters -#define GET_GetUniformfvARB(disp) ((disp)->GetUniformfvARB) -#define SET_GetUniformfvARB(disp, fn) ((disp)->GetUniformfvARB = fn) -#define CALL_GetUniformivARB(disp, parameters) (*((disp)->GetUniformivARB)) parameters -#define GET_GetUniformivARB(disp) ((disp)->GetUniformivARB) -#define SET_GetUniformivARB(disp, fn) ((disp)->GetUniformivARB = fn) -#define CALL_LinkProgramARB(disp, parameters) (*((disp)->LinkProgramARB)) parameters -#define GET_LinkProgramARB(disp) ((disp)->LinkProgramARB) -#define SET_LinkProgramARB(disp, fn) ((disp)->LinkProgramARB = fn) -#define CALL_ShaderSourceARB(disp, parameters) (*((disp)->ShaderSourceARB)) parameters -#define GET_ShaderSourceARB(disp) ((disp)->ShaderSourceARB) -#define SET_ShaderSourceARB(disp, fn) ((disp)->ShaderSourceARB = fn) -#define CALL_Uniform1fARB(disp, parameters) (*((disp)->Uniform1fARB)) parameters -#define GET_Uniform1fARB(disp) ((disp)->Uniform1fARB) -#define SET_Uniform1fARB(disp, fn) ((disp)->Uniform1fARB = fn) -#define CALL_Uniform1fvARB(disp, parameters) (*((disp)->Uniform1fvARB)) parameters -#define GET_Uniform1fvARB(disp) ((disp)->Uniform1fvARB) -#define SET_Uniform1fvARB(disp, fn) ((disp)->Uniform1fvARB = fn) -#define CALL_Uniform1iARB(disp, parameters) (*((disp)->Uniform1iARB)) parameters -#define GET_Uniform1iARB(disp) ((disp)->Uniform1iARB) -#define SET_Uniform1iARB(disp, fn) ((disp)->Uniform1iARB = fn) -#define CALL_Uniform1ivARB(disp, parameters) (*((disp)->Uniform1ivARB)) parameters -#define GET_Uniform1ivARB(disp) ((disp)->Uniform1ivARB) -#define SET_Uniform1ivARB(disp, fn) ((disp)->Uniform1ivARB = fn) -#define CALL_Uniform2fARB(disp, parameters) (*((disp)->Uniform2fARB)) parameters -#define GET_Uniform2fARB(disp) ((disp)->Uniform2fARB) -#define SET_Uniform2fARB(disp, fn) ((disp)->Uniform2fARB = fn) -#define CALL_Uniform2fvARB(disp, parameters) (*((disp)->Uniform2fvARB)) parameters -#define GET_Uniform2fvARB(disp) ((disp)->Uniform2fvARB) -#define SET_Uniform2fvARB(disp, fn) ((disp)->Uniform2fvARB = fn) -#define CALL_Uniform2iARB(disp, parameters) (*((disp)->Uniform2iARB)) parameters -#define GET_Uniform2iARB(disp) ((disp)->Uniform2iARB) -#define SET_Uniform2iARB(disp, fn) ((disp)->Uniform2iARB = fn) -#define CALL_Uniform2ivARB(disp, parameters) (*((disp)->Uniform2ivARB)) parameters -#define GET_Uniform2ivARB(disp) ((disp)->Uniform2ivARB) -#define SET_Uniform2ivARB(disp, fn) ((disp)->Uniform2ivARB = fn) -#define CALL_Uniform3fARB(disp, parameters) (*((disp)->Uniform3fARB)) parameters -#define GET_Uniform3fARB(disp) ((disp)->Uniform3fARB) -#define SET_Uniform3fARB(disp, fn) ((disp)->Uniform3fARB = fn) -#define CALL_Uniform3fvARB(disp, parameters) (*((disp)->Uniform3fvARB)) parameters -#define GET_Uniform3fvARB(disp) ((disp)->Uniform3fvARB) -#define SET_Uniform3fvARB(disp, fn) ((disp)->Uniform3fvARB = fn) -#define CALL_Uniform3iARB(disp, parameters) (*((disp)->Uniform3iARB)) parameters -#define GET_Uniform3iARB(disp) ((disp)->Uniform3iARB) -#define SET_Uniform3iARB(disp, fn) ((disp)->Uniform3iARB = fn) -#define CALL_Uniform3ivARB(disp, parameters) (*((disp)->Uniform3ivARB)) parameters -#define GET_Uniform3ivARB(disp) ((disp)->Uniform3ivARB) -#define SET_Uniform3ivARB(disp, fn) ((disp)->Uniform3ivARB = fn) -#define CALL_Uniform4fARB(disp, parameters) (*((disp)->Uniform4fARB)) parameters -#define GET_Uniform4fARB(disp) ((disp)->Uniform4fARB) -#define SET_Uniform4fARB(disp, fn) ((disp)->Uniform4fARB = fn) -#define CALL_Uniform4fvARB(disp, parameters) (*((disp)->Uniform4fvARB)) parameters -#define GET_Uniform4fvARB(disp) ((disp)->Uniform4fvARB) -#define SET_Uniform4fvARB(disp, fn) ((disp)->Uniform4fvARB = fn) -#define CALL_Uniform4iARB(disp, parameters) (*((disp)->Uniform4iARB)) parameters -#define GET_Uniform4iARB(disp) ((disp)->Uniform4iARB) -#define SET_Uniform4iARB(disp, fn) ((disp)->Uniform4iARB = fn) -#define CALL_Uniform4ivARB(disp, parameters) (*((disp)->Uniform4ivARB)) parameters -#define GET_Uniform4ivARB(disp) ((disp)->Uniform4ivARB) -#define SET_Uniform4ivARB(disp, fn) ((disp)->Uniform4ivARB = fn) -#define CALL_UniformMatrix2fvARB(disp, parameters) (*((disp)->UniformMatrix2fvARB)) parameters -#define GET_UniformMatrix2fvARB(disp) ((disp)->UniformMatrix2fvARB) -#define SET_UniformMatrix2fvARB(disp, fn) ((disp)->UniformMatrix2fvARB = fn) -#define CALL_UniformMatrix3fvARB(disp, parameters) (*((disp)->UniformMatrix3fvARB)) parameters -#define GET_UniformMatrix3fvARB(disp) ((disp)->UniformMatrix3fvARB) -#define SET_UniformMatrix3fvARB(disp, fn) ((disp)->UniformMatrix3fvARB = fn) -#define CALL_UniformMatrix4fvARB(disp, parameters) (*((disp)->UniformMatrix4fvARB)) parameters -#define GET_UniformMatrix4fvARB(disp) ((disp)->UniformMatrix4fvARB) -#define SET_UniformMatrix4fvARB(disp, fn) ((disp)->UniformMatrix4fvARB = fn) -#define CALL_UseProgramObjectARB(disp, parameters) (*((disp)->UseProgramObjectARB)) parameters -#define GET_UseProgramObjectARB(disp) ((disp)->UseProgramObjectARB) -#define SET_UseProgramObjectARB(disp, fn) ((disp)->UseProgramObjectARB = fn) -#define CALL_ValidateProgramARB(disp, parameters) (*((disp)->ValidateProgramARB)) parameters -#define GET_ValidateProgramARB(disp) ((disp)->ValidateProgramARB) -#define SET_ValidateProgramARB(disp, fn) ((disp)->ValidateProgramARB = fn) -#define CALL_BindAttribLocationARB(disp, parameters) (*((disp)->BindAttribLocationARB)) parameters -#define GET_BindAttribLocationARB(disp) ((disp)->BindAttribLocationARB) -#define SET_BindAttribLocationARB(disp, fn) ((disp)->BindAttribLocationARB = fn) -#define CALL_GetActiveAttribARB(disp, parameters) (*((disp)->GetActiveAttribARB)) parameters -#define GET_GetActiveAttribARB(disp) ((disp)->GetActiveAttribARB) -#define SET_GetActiveAttribARB(disp, fn) ((disp)->GetActiveAttribARB = fn) -#define CALL_GetAttribLocationARB(disp, parameters) (*((disp)->GetAttribLocationARB)) parameters -#define GET_GetAttribLocationARB(disp) ((disp)->GetAttribLocationARB) -#define SET_GetAttribLocationARB(disp, fn) ((disp)->GetAttribLocationARB = fn) -#define CALL_DrawBuffersARB(disp, parameters) (*((disp)->DrawBuffersARB)) parameters -#define GET_DrawBuffersARB(disp) ((disp)->DrawBuffersARB) -#define SET_DrawBuffersARB(disp, fn) ((disp)->DrawBuffersARB = fn) -#define CALL_RenderbufferStorageMultisample(disp, parameters) (*((disp)->RenderbufferStorageMultisample)) parameters -#define GET_RenderbufferStorageMultisample(disp) ((disp)->RenderbufferStorageMultisample) -#define SET_RenderbufferStorageMultisample(disp, fn) ((disp)->RenderbufferStorageMultisample = fn) -#define CALL_FlushMappedBufferRange(disp, parameters) (*((disp)->FlushMappedBufferRange)) parameters -#define GET_FlushMappedBufferRange(disp) ((disp)->FlushMappedBufferRange) -#define SET_FlushMappedBufferRange(disp, fn) ((disp)->FlushMappedBufferRange = fn) -#define CALL_MapBufferRange(disp, parameters) (*((disp)->MapBufferRange)) parameters -#define GET_MapBufferRange(disp) ((disp)->MapBufferRange) -#define SET_MapBufferRange(disp, fn) ((disp)->MapBufferRange = fn) -#define CALL_BindVertexArray(disp, parameters) (*((disp)->BindVertexArray)) parameters -#define GET_BindVertexArray(disp) ((disp)->BindVertexArray) -#define SET_BindVertexArray(disp, fn) ((disp)->BindVertexArray = fn) -#define CALL_GenVertexArrays(disp, parameters) (*((disp)->GenVertexArrays)) parameters -#define GET_GenVertexArrays(disp) ((disp)->GenVertexArrays) -#define SET_GenVertexArrays(disp, fn) ((disp)->GenVertexArrays = fn) -#define CALL_CopyBufferSubData(disp, parameters) (*((disp)->CopyBufferSubData)) parameters -#define GET_CopyBufferSubData(disp) ((disp)->CopyBufferSubData) -#define SET_CopyBufferSubData(disp, fn) ((disp)->CopyBufferSubData = fn) -#define CALL_ClientWaitSync(disp, parameters) (*((disp)->ClientWaitSync)) parameters -#define GET_ClientWaitSync(disp) ((disp)->ClientWaitSync) -#define SET_ClientWaitSync(disp, fn) ((disp)->ClientWaitSync = fn) -#define CALL_DeleteSync(disp, parameters) (*((disp)->DeleteSync)) parameters -#define GET_DeleteSync(disp) ((disp)->DeleteSync) -#define SET_DeleteSync(disp, fn) ((disp)->DeleteSync = fn) -#define CALL_FenceSync(disp, parameters) (*((disp)->FenceSync)) parameters -#define GET_FenceSync(disp) ((disp)->FenceSync) -#define SET_FenceSync(disp, fn) ((disp)->FenceSync = fn) -#define CALL_GetInteger64v(disp, parameters) (*((disp)->GetInteger64v)) parameters -#define GET_GetInteger64v(disp) ((disp)->GetInteger64v) -#define SET_GetInteger64v(disp, fn) ((disp)->GetInteger64v = fn) -#define CALL_GetSynciv(disp, parameters) (*((disp)->GetSynciv)) parameters -#define GET_GetSynciv(disp) ((disp)->GetSynciv) -#define SET_GetSynciv(disp, fn) ((disp)->GetSynciv = fn) -#define CALL_IsSync(disp, parameters) (*((disp)->IsSync)) parameters -#define GET_IsSync(disp) ((disp)->IsSync) -#define SET_IsSync(disp, fn) ((disp)->IsSync = fn) -#define CALL_WaitSync(disp, parameters) (*((disp)->WaitSync)) parameters -#define GET_WaitSync(disp) ((disp)->WaitSync) -#define SET_WaitSync(disp, fn) ((disp)->WaitSync = fn) -#define CALL_DrawElementsBaseVertex(disp, parameters) (*((disp)->DrawElementsBaseVertex)) parameters -#define GET_DrawElementsBaseVertex(disp) ((disp)->DrawElementsBaseVertex) -#define SET_DrawElementsBaseVertex(disp, fn) ((disp)->DrawElementsBaseVertex = fn) -#define CALL_DrawRangeElementsBaseVertex(disp, parameters) (*((disp)->DrawRangeElementsBaseVertex)) parameters -#define GET_DrawRangeElementsBaseVertex(disp) ((disp)->DrawRangeElementsBaseVertex) -#define SET_DrawRangeElementsBaseVertex(disp, fn) ((disp)->DrawRangeElementsBaseVertex = fn) -#define CALL_MultiDrawElementsBaseVertex(disp, parameters) (*((disp)->MultiDrawElementsBaseVertex)) parameters -#define GET_MultiDrawElementsBaseVertex(disp) ((disp)->MultiDrawElementsBaseVertex) -#define SET_MultiDrawElementsBaseVertex(disp, fn) ((disp)->MultiDrawElementsBaseVertex = fn) -#define CALL_PolygonOffsetEXT(disp, parameters) (*((disp)->PolygonOffsetEXT)) parameters -#define GET_PolygonOffsetEXT(disp) ((disp)->PolygonOffsetEXT) -#define SET_PolygonOffsetEXT(disp, fn) ((disp)->PolygonOffsetEXT = fn) -#define CALL_GetPixelTexGenParameterfvSGIS(disp, parameters) (*((disp)->GetPixelTexGenParameterfvSGIS)) parameters -#define GET_GetPixelTexGenParameterfvSGIS(disp) ((disp)->GetPixelTexGenParameterfvSGIS) -#define SET_GetPixelTexGenParameterfvSGIS(disp, fn) ((disp)->GetPixelTexGenParameterfvSGIS = fn) -#define CALL_GetPixelTexGenParameterivSGIS(disp, parameters) (*((disp)->GetPixelTexGenParameterivSGIS)) parameters -#define GET_GetPixelTexGenParameterivSGIS(disp) ((disp)->GetPixelTexGenParameterivSGIS) -#define SET_GetPixelTexGenParameterivSGIS(disp, fn) ((disp)->GetPixelTexGenParameterivSGIS = fn) -#define CALL_PixelTexGenParameterfSGIS(disp, parameters) (*((disp)->PixelTexGenParameterfSGIS)) parameters -#define GET_PixelTexGenParameterfSGIS(disp) ((disp)->PixelTexGenParameterfSGIS) -#define SET_PixelTexGenParameterfSGIS(disp, fn) ((disp)->PixelTexGenParameterfSGIS = fn) -#define CALL_PixelTexGenParameterfvSGIS(disp, parameters) (*((disp)->PixelTexGenParameterfvSGIS)) parameters -#define GET_PixelTexGenParameterfvSGIS(disp) ((disp)->PixelTexGenParameterfvSGIS) -#define SET_PixelTexGenParameterfvSGIS(disp, fn) ((disp)->PixelTexGenParameterfvSGIS = fn) -#define CALL_PixelTexGenParameteriSGIS(disp, parameters) (*((disp)->PixelTexGenParameteriSGIS)) parameters -#define GET_PixelTexGenParameteriSGIS(disp) ((disp)->PixelTexGenParameteriSGIS) -#define SET_PixelTexGenParameteriSGIS(disp, fn) ((disp)->PixelTexGenParameteriSGIS = fn) -#define CALL_PixelTexGenParameterivSGIS(disp, parameters) (*((disp)->PixelTexGenParameterivSGIS)) parameters -#define GET_PixelTexGenParameterivSGIS(disp) ((disp)->PixelTexGenParameterivSGIS) -#define SET_PixelTexGenParameterivSGIS(disp, fn) ((disp)->PixelTexGenParameterivSGIS = fn) -#define CALL_SampleMaskSGIS(disp, parameters) (*((disp)->SampleMaskSGIS)) parameters -#define GET_SampleMaskSGIS(disp) ((disp)->SampleMaskSGIS) -#define SET_SampleMaskSGIS(disp, fn) ((disp)->SampleMaskSGIS = fn) -#define CALL_SamplePatternSGIS(disp, parameters) (*((disp)->SamplePatternSGIS)) parameters -#define GET_SamplePatternSGIS(disp) ((disp)->SamplePatternSGIS) -#define SET_SamplePatternSGIS(disp, fn) ((disp)->SamplePatternSGIS = fn) -#define CALL_ColorPointerEXT(disp, parameters) (*((disp)->ColorPointerEXT)) parameters -#define GET_ColorPointerEXT(disp) ((disp)->ColorPointerEXT) -#define SET_ColorPointerEXT(disp, fn) ((disp)->ColorPointerEXT = fn) -#define CALL_EdgeFlagPointerEXT(disp, parameters) (*((disp)->EdgeFlagPointerEXT)) parameters -#define GET_EdgeFlagPointerEXT(disp) ((disp)->EdgeFlagPointerEXT) -#define SET_EdgeFlagPointerEXT(disp, fn) ((disp)->EdgeFlagPointerEXT = fn) -#define CALL_IndexPointerEXT(disp, parameters) (*((disp)->IndexPointerEXT)) parameters -#define GET_IndexPointerEXT(disp) ((disp)->IndexPointerEXT) -#define SET_IndexPointerEXT(disp, fn) ((disp)->IndexPointerEXT = fn) -#define CALL_NormalPointerEXT(disp, parameters) (*((disp)->NormalPointerEXT)) parameters -#define GET_NormalPointerEXT(disp) ((disp)->NormalPointerEXT) -#define SET_NormalPointerEXT(disp, fn) ((disp)->NormalPointerEXT = fn) -#define CALL_TexCoordPointerEXT(disp, parameters) (*((disp)->TexCoordPointerEXT)) parameters -#define GET_TexCoordPointerEXT(disp) ((disp)->TexCoordPointerEXT) -#define SET_TexCoordPointerEXT(disp, fn) ((disp)->TexCoordPointerEXT = fn) -#define CALL_VertexPointerEXT(disp, parameters) (*((disp)->VertexPointerEXT)) parameters -#define GET_VertexPointerEXT(disp) ((disp)->VertexPointerEXT) -#define SET_VertexPointerEXT(disp, fn) ((disp)->VertexPointerEXT = fn) -#define CALL_PointParameterfEXT(disp, parameters) (*((disp)->PointParameterfEXT)) parameters -#define GET_PointParameterfEXT(disp) ((disp)->PointParameterfEXT) -#define SET_PointParameterfEXT(disp, fn) ((disp)->PointParameterfEXT = fn) -#define CALL_PointParameterfvEXT(disp, parameters) (*((disp)->PointParameterfvEXT)) parameters -#define GET_PointParameterfvEXT(disp) ((disp)->PointParameterfvEXT) -#define SET_PointParameterfvEXT(disp, fn) ((disp)->PointParameterfvEXT = fn) -#define CALL_LockArraysEXT(disp, parameters) (*((disp)->LockArraysEXT)) parameters -#define GET_LockArraysEXT(disp) ((disp)->LockArraysEXT) -#define SET_LockArraysEXT(disp, fn) ((disp)->LockArraysEXT = fn) -#define CALL_UnlockArraysEXT(disp, parameters) (*((disp)->UnlockArraysEXT)) parameters -#define GET_UnlockArraysEXT(disp) ((disp)->UnlockArraysEXT) -#define SET_UnlockArraysEXT(disp, fn) ((disp)->UnlockArraysEXT = fn) -#define CALL_CullParameterdvEXT(disp, parameters) (*((disp)->CullParameterdvEXT)) parameters -#define GET_CullParameterdvEXT(disp) ((disp)->CullParameterdvEXT) -#define SET_CullParameterdvEXT(disp, fn) ((disp)->CullParameterdvEXT = fn) -#define CALL_CullParameterfvEXT(disp, parameters) (*((disp)->CullParameterfvEXT)) parameters -#define GET_CullParameterfvEXT(disp) ((disp)->CullParameterfvEXT) -#define SET_CullParameterfvEXT(disp, fn) ((disp)->CullParameterfvEXT = fn) -#define CALL_SecondaryColor3bEXT(disp, parameters) (*((disp)->SecondaryColor3bEXT)) parameters -#define GET_SecondaryColor3bEXT(disp) ((disp)->SecondaryColor3bEXT) -#define SET_SecondaryColor3bEXT(disp, fn) ((disp)->SecondaryColor3bEXT = fn) -#define CALL_SecondaryColor3bvEXT(disp, parameters) (*((disp)->SecondaryColor3bvEXT)) parameters -#define GET_SecondaryColor3bvEXT(disp) ((disp)->SecondaryColor3bvEXT) -#define SET_SecondaryColor3bvEXT(disp, fn) ((disp)->SecondaryColor3bvEXT = fn) -#define CALL_SecondaryColor3dEXT(disp, parameters) (*((disp)->SecondaryColor3dEXT)) parameters -#define GET_SecondaryColor3dEXT(disp) ((disp)->SecondaryColor3dEXT) -#define SET_SecondaryColor3dEXT(disp, fn) ((disp)->SecondaryColor3dEXT = fn) -#define CALL_SecondaryColor3dvEXT(disp, parameters) (*((disp)->SecondaryColor3dvEXT)) parameters -#define GET_SecondaryColor3dvEXT(disp) ((disp)->SecondaryColor3dvEXT) -#define SET_SecondaryColor3dvEXT(disp, fn) ((disp)->SecondaryColor3dvEXT = fn) -#define CALL_SecondaryColor3fEXT(disp, parameters) (*((disp)->SecondaryColor3fEXT)) parameters -#define GET_SecondaryColor3fEXT(disp) ((disp)->SecondaryColor3fEXT) -#define SET_SecondaryColor3fEXT(disp, fn) ((disp)->SecondaryColor3fEXT = fn) -#define CALL_SecondaryColor3fvEXT(disp, parameters) (*((disp)->SecondaryColor3fvEXT)) parameters -#define GET_SecondaryColor3fvEXT(disp) ((disp)->SecondaryColor3fvEXT) -#define SET_SecondaryColor3fvEXT(disp, fn) ((disp)->SecondaryColor3fvEXT = fn) -#define CALL_SecondaryColor3iEXT(disp, parameters) (*((disp)->SecondaryColor3iEXT)) parameters -#define GET_SecondaryColor3iEXT(disp) ((disp)->SecondaryColor3iEXT) -#define SET_SecondaryColor3iEXT(disp, fn) ((disp)->SecondaryColor3iEXT = fn) -#define CALL_SecondaryColor3ivEXT(disp, parameters) (*((disp)->SecondaryColor3ivEXT)) parameters -#define GET_SecondaryColor3ivEXT(disp) ((disp)->SecondaryColor3ivEXT) -#define SET_SecondaryColor3ivEXT(disp, fn) ((disp)->SecondaryColor3ivEXT = fn) -#define CALL_SecondaryColor3sEXT(disp, parameters) (*((disp)->SecondaryColor3sEXT)) parameters -#define GET_SecondaryColor3sEXT(disp) ((disp)->SecondaryColor3sEXT) -#define SET_SecondaryColor3sEXT(disp, fn) ((disp)->SecondaryColor3sEXT = fn) -#define CALL_SecondaryColor3svEXT(disp, parameters) (*((disp)->SecondaryColor3svEXT)) parameters -#define GET_SecondaryColor3svEXT(disp) ((disp)->SecondaryColor3svEXT) -#define SET_SecondaryColor3svEXT(disp, fn) ((disp)->SecondaryColor3svEXT = fn) -#define CALL_SecondaryColor3ubEXT(disp, parameters) (*((disp)->SecondaryColor3ubEXT)) parameters -#define GET_SecondaryColor3ubEXT(disp) ((disp)->SecondaryColor3ubEXT) -#define SET_SecondaryColor3ubEXT(disp, fn) ((disp)->SecondaryColor3ubEXT = fn) -#define CALL_SecondaryColor3ubvEXT(disp, parameters) (*((disp)->SecondaryColor3ubvEXT)) parameters -#define GET_SecondaryColor3ubvEXT(disp) ((disp)->SecondaryColor3ubvEXT) -#define SET_SecondaryColor3ubvEXT(disp, fn) ((disp)->SecondaryColor3ubvEXT = fn) -#define CALL_SecondaryColor3uiEXT(disp, parameters) (*((disp)->SecondaryColor3uiEXT)) parameters -#define GET_SecondaryColor3uiEXT(disp) ((disp)->SecondaryColor3uiEXT) -#define SET_SecondaryColor3uiEXT(disp, fn) ((disp)->SecondaryColor3uiEXT = fn) -#define CALL_SecondaryColor3uivEXT(disp, parameters) (*((disp)->SecondaryColor3uivEXT)) parameters -#define GET_SecondaryColor3uivEXT(disp) ((disp)->SecondaryColor3uivEXT) -#define SET_SecondaryColor3uivEXT(disp, fn) ((disp)->SecondaryColor3uivEXT = fn) -#define CALL_SecondaryColor3usEXT(disp, parameters) (*((disp)->SecondaryColor3usEXT)) parameters -#define GET_SecondaryColor3usEXT(disp) ((disp)->SecondaryColor3usEXT) -#define SET_SecondaryColor3usEXT(disp, fn) ((disp)->SecondaryColor3usEXT = fn) -#define CALL_SecondaryColor3usvEXT(disp, parameters) (*((disp)->SecondaryColor3usvEXT)) parameters -#define GET_SecondaryColor3usvEXT(disp) ((disp)->SecondaryColor3usvEXT) -#define SET_SecondaryColor3usvEXT(disp, fn) ((disp)->SecondaryColor3usvEXT = fn) -#define CALL_SecondaryColorPointerEXT(disp, parameters) (*((disp)->SecondaryColorPointerEXT)) parameters -#define GET_SecondaryColorPointerEXT(disp) ((disp)->SecondaryColorPointerEXT) -#define SET_SecondaryColorPointerEXT(disp, fn) ((disp)->SecondaryColorPointerEXT = fn) -#define CALL_MultiDrawArraysEXT(disp, parameters) (*((disp)->MultiDrawArraysEXT)) parameters -#define GET_MultiDrawArraysEXT(disp) ((disp)->MultiDrawArraysEXT) -#define SET_MultiDrawArraysEXT(disp, fn) ((disp)->MultiDrawArraysEXT = fn) -#define CALL_MultiDrawElementsEXT(disp, parameters) (*((disp)->MultiDrawElementsEXT)) parameters -#define GET_MultiDrawElementsEXT(disp) ((disp)->MultiDrawElementsEXT) -#define SET_MultiDrawElementsEXT(disp, fn) ((disp)->MultiDrawElementsEXT = fn) -#define CALL_FogCoordPointerEXT(disp, parameters) (*((disp)->FogCoordPointerEXT)) parameters -#define GET_FogCoordPointerEXT(disp) ((disp)->FogCoordPointerEXT) -#define SET_FogCoordPointerEXT(disp, fn) ((disp)->FogCoordPointerEXT = fn) -#define CALL_FogCoorddEXT(disp, parameters) (*((disp)->FogCoorddEXT)) parameters -#define GET_FogCoorddEXT(disp) ((disp)->FogCoorddEXT) -#define SET_FogCoorddEXT(disp, fn) ((disp)->FogCoorddEXT = fn) -#define CALL_FogCoorddvEXT(disp, parameters) (*((disp)->FogCoorddvEXT)) parameters -#define GET_FogCoorddvEXT(disp) ((disp)->FogCoorddvEXT) -#define SET_FogCoorddvEXT(disp, fn) ((disp)->FogCoorddvEXT = fn) -#define CALL_FogCoordfEXT(disp, parameters) (*((disp)->FogCoordfEXT)) parameters -#define GET_FogCoordfEXT(disp) ((disp)->FogCoordfEXT) -#define SET_FogCoordfEXT(disp, fn) ((disp)->FogCoordfEXT = fn) -#define CALL_FogCoordfvEXT(disp, parameters) (*((disp)->FogCoordfvEXT)) parameters -#define GET_FogCoordfvEXT(disp) ((disp)->FogCoordfvEXT) -#define SET_FogCoordfvEXT(disp, fn) ((disp)->FogCoordfvEXT = fn) -#define CALL_PixelTexGenSGIX(disp, parameters) (*((disp)->PixelTexGenSGIX)) parameters -#define GET_PixelTexGenSGIX(disp) ((disp)->PixelTexGenSGIX) -#define SET_PixelTexGenSGIX(disp, fn) ((disp)->PixelTexGenSGIX = fn) -#define CALL_BlendFuncSeparateEXT(disp, parameters) (*((disp)->BlendFuncSeparateEXT)) parameters -#define GET_BlendFuncSeparateEXT(disp) ((disp)->BlendFuncSeparateEXT) -#define SET_BlendFuncSeparateEXT(disp, fn) ((disp)->BlendFuncSeparateEXT = fn) -#define CALL_FlushVertexArrayRangeNV(disp, parameters) (*((disp)->FlushVertexArrayRangeNV)) parameters -#define GET_FlushVertexArrayRangeNV(disp) ((disp)->FlushVertexArrayRangeNV) -#define SET_FlushVertexArrayRangeNV(disp, fn) ((disp)->FlushVertexArrayRangeNV = fn) -#define CALL_VertexArrayRangeNV(disp, parameters) (*((disp)->VertexArrayRangeNV)) parameters -#define GET_VertexArrayRangeNV(disp) ((disp)->VertexArrayRangeNV) -#define SET_VertexArrayRangeNV(disp, fn) ((disp)->VertexArrayRangeNV = fn) -#define CALL_CombinerInputNV(disp, parameters) (*((disp)->CombinerInputNV)) parameters -#define GET_CombinerInputNV(disp) ((disp)->CombinerInputNV) -#define SET_CombinerInputNV(disp, fn) ((disp)->CombinerInputNV = fn) -#define CALL_CombinerOutputNV(disp, parameters) (*((disp)->CombinerOutputNV)) parameters -#define GET_CombinerOutputNV(disp) ((disp)->CombinerOutputNV) -#define SET_CombinerOutputNV(disp, fn) ((disp)->CombinerOutputNV = fn) -#define CALL_CombinerParameterfNV(disp, parameters) (*((disp)->CombinerParameterfNV)) parameters -#define GET_CombinerParameterfNV(disp) ((disp)->CombinerParameterfNV) -#define SET_CombinerParameterfNV(disp, fn) ((disp)->CombinerParameterfNV = fn) -#define CALL_CombinerParameterfvNV(disp, parameters) (*((disp)->CombinerParameterfvNV)) parameters -#define GET_CombinerParameterfvNV(disp) ((disp)->CombinerParameterfvNV) -#define SET_CombinerParameterfvNV(disp, fn) ((disp)->CombinerParameterfvNV = fn) -#define CALL_CombinerParameteriNV(disp, parameters) (*((disp)->CombinerParameteriNV)) parameters -#define GET_CombinerParameteriNV(disp) ((disp)->CombinerParameteriNV) -#define SET_CombinerParameteriNV(disp, fn) ((disp)->CombinerParameteriNV = fn) -#define CALL_CombinerParameterivNV(disp, parameters) (*((disp)->CombinerParameterivNV)) parameters -#define GET_CombinerParameterivNV(disp) ((disp)->CombinerParameterivNV) -#define SET_CombinerParameterivNV(disp, fn) ((disp)->CombinerParameterivNV = fn) -#define CALL_FinalCombinerInputNV(disp, parameters) (*((disp)->FinalCombinerInputNV)) parameters -#define GET_FinalCombinerInputNV(disp) ((disp)->FinalCombinerInputNV) -#define SET_FinalCombinerInputNV(disp, fn) ((disp)->FinalCombinerInputNV = fn) -#define CALL_GetCombinerInputParameterfvNV(disp, parameters) (*((disp)->GetCombinerInputParameterfvNV)) parameters -#define GET_GetCombinerInputParameterfvNV(disp) ((disp)->GetCombinerInputParameterfvNV) -#define SET_GetCombinerInputParameterfvNV(disp, fn) ((disp)->GetCombinerInputParameterfvNV = fn) -#define CALL_GetCombinerInputParameterivNV(disp, parameters) (*((disp)->GetCombinerInputParameterivNV)) parameters -#define GET_GetCombinerInputParameterivNV(disp) ((disp)->GetCombinerInputParameterivNV) -#define SET_GetCombinerInputParameterivNV(disp, fn) ((disp)->GetCombinerInputParameterivNV = fn) -#define CALL_GetCombinerOutputParameterfvNV(disp, parameters) (*((disp)->GetCombinerOutputParameterfvNV)) parameters -#define GET_GetCombinerOutputParameterfvNV(disp) ((disp)->GetCombinerOutputParameterfvNV) -#define SET_GetCombinerOutputParameterfvNV(disp, fn) ((disp)->GetCombinerOutputParameterfvNV = fn) -#define CALL_GetCombinerOutputParameterivNV(disp, parameters) (*((disp)->GetCombinerOutputParameterivNV)) parameters -#define GET_GetCombinerOutputParameterivNV(disp) ((disp)->GetCombinerOutputParameterivNV) -#define SET_GetCombinerOutputParameterivNV(disp, fn) ((disp)->GetCombinerOutputParameterivNV = fn) -#define CALL_GetFinalCombinerInputParameterfvNV(disp, parameters) (*((disp)->GetFinalCombinerInputParameterfvNV)) parameters -#define GET_GetFinalCombinerInputParameterfvNV(disp) ((disp)->GetFinalCombinerInputParameterfvNV) -#define SET_GetFinalCombinerInputParameterfvNV(disp, fn) ((disp)->GetFinalCombinerInputParameterfvNV = fn) -#define CALL_GetFinalCombinerInputParameterivNV(disp, parameters) (*((disp)->GetFinalCombinerInputParameterivNV)) parameters -#define GET_GetFinalCombinerInputParameterivNV(disp) ((disp)->GetFinalCombinerInputParameterivNV) -#define SET_GetFinalCombinerInputParameterivNV(disp, fn) ((disp)->GetFinalCombinerInputParameterivNV = fn) -#define CALL_ResizeBuffersMESA(disp, parameters) (*((disp)->ResizeBuffersMESA)) parameters -#define GET_ResizeBuffersMESA(disp) ((disp)->ResizeBuffersMESA) -#define SET_ResizeBuffersMESA(disp, fn) ((disp)->ResizeBuffersMESA = fn) -#define CALL_WindowPos2dMESA(disp, parameters) (*((disp)->WindowPos2dMESA)) parameters -#define GET_WindowPos2dMESA(disp) ((disp)->WindowPos2dMESA) -#define SET_WindowPos2dMESA(disp, fn) ((disp)->WindowPos2dMESA = fn) -#define CALL_WindowPos2dvMESA(disp, parameters) (*((disp)->WindowPos2dvMESA)) parameters -#define GET_WindowPos2dvMESA(disp) ((disp)->WindowPos2dvMESA) -#define SET_WindowPos2dvMESA(disp, fn) ((disp)->WindowPos2dvMESA = fn) -#define CALL_WindowPos2fMESA(disp, parameters) (*((disp)->WindowPos2fMESA)) parameters -#define GET_WindowPos2fMESA(disp) ((disp)->WindowPos2fMESA) -#define SET_WindowPos2fMESA(disp, fn) ((disp)->WindowPos2fMESA = fn) -#define CALL_WindowPos2fvMESA(disp, parameters) (*((disp)->WindowPos2fvMESA)) parameters -#define GET_WindowPos2fvMESA(disp) ((disp)->WindowPos2fvMESA) -#define SET_WindowPos2fvMESA(disp, fn) ((disp)->WindowPos2fvMESA = fn) -#define CALL_WindowPos2iMESA(disp, parameters) (*((disp)->WindowPos2iMESA)) parameters -#define GET_WindowPos2iMESA(disp) ((disp)->WindowPos2iMESA) -#define SET_WindowPos2iMESA(disp, fn) ((disp)->WindowPos2iMESA = fn) -#define CALL_WindowPos2ivMESA(disp, parameters) (*((disp)->WindowPos2ivMESA)) parameters -#define GET_WindowPos2ivMESA(disp) ((disp)->WindowPos2ivMESA) -#define SET_WindowPos2ivMESA(disp, fn) ((disp)->WindowPos2ivMESA = fn) -#define CALL_WindowPos2sMESA(disp, parameters) (*((disp)->WindowPos2sMESA)) parameters -#define GET_WindowPos2sMESA(disp) ((disp)->WindowPos2sMESA) -#define SET_WindowPos2sMESA(disp, fn) ((disp)->WindowPos2sMESA = fn) -#define CALL_WindowPos2svMESA(disp, parameters) (*((disp)->WindowPos2svMESA)) parameters -#define GET_WindowPos2svMESA(disp) ((disp)->WindowPos2svMESA) -#define SET_WindowPos2svMESA(disp, fn) ((disp)->WindowPos2svMESA = fn) -#define CALL_WindowPos3dMESA(disp, parameters) (*((disp)->WindowPos3dMESA)) parameters -#define GET_WindowPos3dMESA(disp) ((disp)->WindowPos3dMESA) -#define SET_WindowPos3dMESA(disp, fn) ((disp)->WindowPos3dMESA = fn) -#define CALL_WindowPos3dvMESA(disp, parameters) (*((disp)->WindowPos3dvMESA)) parameters -#define GET_WindowPos3dvMESA(disp) ((disp)->WindowPos3dvMESA) -#define SET_WindowPos3dvMESA(disp, fn) ((disp)->WindowPos3dvMESA = fn) -#define CALL_WindowPos3fMESA(disp, parameters) (*((disp)->WindowPos3fMESA)) parameters -#define GET_WindowPos3fMESA(disp) ((disp)->WindowPos3fMESA) -#define SET_WindowPos3fMESA(disp, fn) ((disp)->WindowPos3fMESA = fn) -#define CALL_WindowPos3fvMESA(disp, parameters) (*((disp)->WindowPos3fvMESA)) parameters -#define GET_WindowPos3fvMESA(disp) ((disp)->WindowPos3fvMESA) -#define SET_WindowPos3fvMESA(disp, fn) ((disp)->WindowPos3fvMESA = fn) -#define CALL_WindowPos3iMESA(disp, parameters) (*((disp)->WindowPos3iMESA)) parameters -#define GET_WindowPos3iMESA(disp) ((disp)->WindowPos3iMESA) -#define SET_WindowPos3iMESA(disp, fn) ((disp)->WindowPos3iMESA = fn) -#define CALL_WindowPos3ivMESA(disp, parameters) (*((disp)->WindowPos3ivMESA)) parameters -#define GET_WindowPos3ivMESA(disp) ((disp)->WindowPos3ivMESA) -#define SET_WindowPos3ivMESA(disp, fn) ((disp)->WindowPos3ivMESA = fn) -#define CALL_WindowPos3sMESA(disp, parameters) (*((disp)->WindowPos3sMESA)) parameters -#define GET_WindowPos3sMESA(disp) ((disp)->WindowPos3sMESA) -#define SET_WindowPos3sMESA(disp, fn) ((disp)->WindowPos3sMESA = fn) -#define CALL_WindowPos3svMESA(disp, parameters) (*((disp)->WindowPos3svMESA)) parameters -#define GET_WindowPos3svMESA(disp) ((disp)->WindowPos3svMESA) -#define SET_WindowPos3svMESA(disp, fn) ((disp)->WindowPos3svMESA = fn) -#define CALL_WindowPos4dMESA(disp, parameters) (*((disp)->WindowPos4dMESA)) parameters -#define GET_WindowPos4dMESA(disp) ((disp)->WindowPos4dMESA) -#define SET_WindowPos4dMESA(disp, fn) ((disp)->WindowPos4dMESA = fn) -#define CALL_WindowPos4dvMESA(disp, parameters) (*((disp)->WindowPos4dvMESA)) parameters -#define GET_WindowPos4dvMESA(disp) ((disp)->WindowPos4dvMESA) -#define SET_WindowPos4dvMESA(disp, fn) ((disp)->WindowPos4dvMESA = fn) -#define CALL_WindowPos4fMESA(disp, parameters) (*((disp)->WindowPos4fMESA)) parameters -#define GET_WindowPos4fMESA(disp) ((disp)->WindowPos4fMESA) -#define SET_WindowPos4fMESA(disp, fn) ((disp)->WindowPos4fMESA = fn) -#define CALL_WindowPos4fvMESA(disp, parameters) (*((disp)->WindowPos4fvMESA)) parameters -#define GET_WindowPos4fvMESA(disp) ((disp)->WindowPos4fvMESA) -#define SET_WindowPos4fvMESA(disp, fn) ((disp)->WindowPos4fvMESA = fn) -#define CALL_WindowPos4iMESA(disp, parameters) (*((disp)->WindowPos4iMESA)) parameters -#define GET_WindowPos4iMESA(disp) ((disp)->WindowPos4iMESA) -#define SET_WindowPos4iMESA(disp, fn) ((disp)->WindowPos4iMESA = fn) -#define CALL_WindowPos4ivMESA(disp, parameters) (*((disp)->WindowPos4ivMESA)) parameters -#define GET_WindowPos4ivMESA(disp) ((disp)->WindowPos4ivMESA) -#define SET_WindowPos4ivMESA(disp, fn) ((disp)->WindowPos4ivMESA = fn) -#define CALL_WindowPos4sMESA(disp, parameters) (*((disp)->WindowPos4sMESA)) parameters -#define GET_WindowPos4sMESA(disp) ((disp)->WindowPos4sMESA) -#define SET_WindowPos4sMESA(disp, fn) ((disp)->WindowPos4sMESA = fn) -#define CALL_WindowPos4svMESA(disp, parameters) (*((disp)->WindowPos4svMESA)) parameters -#define GET_WindowPos4svMESA(disp) ((disp)->WindowPos4svMESA) -#define SET_WindowPos4svMESA(disp, fn) ((disp)->WindowPos4svMESA = fn) -#define CALL_MultiModeDrawArraysIBM(disp, parameters) (*((disp)->MultiModeDrawArraysIBM)) parameters -#define GET_MultiModeDrawArraysIBM(disp) ((disp)->MultiModeDrawArraysIBM) -#define SET_MultiModeDrawArraysIBM(disp, fn) ((disp)->MultiModeDrawArraysIBM = fn) -#define CALL_MultiModeDrawElementsIBM(disp, parameters) (*((disp)->MultiModeDrawElementsIBM)) parameters -#define GET_MultiModeDrawElementsIBM(disp) ((disp)->MultiModeDrawElementsIBM) -#define SET_MultiModeDrawElementsIBM(disp, fn) ((disp)->MultiModeDrawElementsIBM = fn) -#define CALL_DeleteFencesNV(disp, parameters) (*((disp)->DeleteFencesNV)) parameters -#define GET_DeleteFencesNV(disp) ((disp)->DeleteFencesNV) -#define SET_DeleteFencesNV(disp, fn) ((disp)->DeleteFencesNV = fn) -#define CALL_FinishFenceNV(disp, parameters) (*((disp)->FinishFenceNV)) parameters -#define GET_FinishFenceNV(disp) ((disp)->FinishFenceNV) -#define SET_FinishFenceNV(disp, fn) ((disp)->FinishFenceNV = fn) -#define CALL_GenFencesNV(disp, parameters) (*((disp)->GenFencesNV)) parameters -#define GET_GenFencesNV(disp) ((disp)->GenFencesNV) -#define SET_GenFencesNV(disp, fn) ((disp)->GenFencesNV = fn) -#define CALL_GetFenceivNV(disp, parameters) (*((disp)->GetFenceivNV)) parameters -#define GET_GetFenceivNV(disp) ((disp)->GetFenceivNV) -#define SET_GetFenceivNV(disp, fn) ((disp)->GetFenceivNV = fn) -#define CALL_IsFenceNV(disp, parameters) (*((disp)->IsFenceNV)) parameters -#define GET_IsFenceNV(disp) ((disp)->IsFenceNV) -#define SET_IsFenceNV(disp, fn) ((disp)->IsFenceNV = fn) -#define CALL_SetFenceNV(disp, parameters) (*((disp)->SetFenceNV)) parameters -#define GET_SetFenceNV(disp) ((disp)->SetFenceNV) -#define SET_SetFenceNV(disp, fn) ((disp)->SetFenceNV = fn) -#define CALL_TestFenceNV(disp, parameters) (*((disp)->TestFenceNV)) parameters -#define GET_TestFenceNV(disp) ((disp)->TestFenceNV) -#define SET_TestFenceNV(disp, fn) ((disp)->TestFenceNV = fn) -#define CALL_AreProgramsResidentNV(disp, parameters) (*((disp)->AreProgramsResidentNV)) parameters -#define GET_AreProgramsResidentNV(disp) ((disp)->AreProgramsResidentNV) -#define SET_AreProgramsResidentNV(disp, fn) ((disp)->AreProgramsResidentNV = fn) -#define CALL_BindProgramNV(disp, parameters) (*((disp)->BindProgramNV)) parameters -#define GET_BindProgramNV(disp) ((disp)->BindProgramNV) -#define SET_BindProgramNV(disp, fn) ((disp)->BindProgramNV = fn) -#define CALL_DeleteProgramsNV(disp, parameters) (*((disp)->DeleteProgramsNV)) parameters -#define GET_DeleteProgramsNV(disp) ((disp)->DeleteProgramsNV) -#define SET_DeleteProgramsNV(disp, fn) ((disp)->DeleteProgramsNV = fn) -#define CALL_ExecuteProgramNV(disp, parameters) (*((disp)->ExecuteProgramNV)) parameters -#define GET_ExecuteProgramNV(disp) ((disp)->ExecuteProgramNV) -#define SET_ExecuteProgramNV(disp, fn) ((disp)->ExecuteProgramNV = fn) -#define CALL_GenProgramsNV(disp, parameters) (*((disp)->GenProgramsNV)) parameters -#define GET_GenProgramsNV(disp) ((disp)->GenProgramsNV) -#define SET_GenProgramsNV(disp, fn) ((disp)->GenProgramsNV = fn) -#define CALL_GetProgramParameterdvNV(disp, parameters) (*((disp)->GetProgramParameterdvNV)) parameters -#define GET_GetProgramParameterdvNV(disp) ((disp)->GetProgramParameterdvNV) -#define SET_GetProgramParameterdvNV(disp, fn) ((disp)->GetProgramParameterdvNV = fn) -#define CALL_GetProgramParameterfvNV(disp, parameters) (*((disp)->GetProgramParameterfvNV)) parameters -#define GET_GetProgramParameterfvNV(disp) ((disp)->GetProgramParameterfvNV) -#define SET_GetProgramParameterfvNV(disp, fn) ((disp)->GetProgramParameterfvNV = fn) -#define CALL_GetProgramStringNV(disp, parameters) (*((disp)->GetProgramStringNV)) parameters -#define GET_GetProgramStringNV(disp) ((disp)->GetProgramStringNV) -#define SET_GetProgramStringNV(disp, fn) ((disp)->GetProgramStringNV = fn) -#define CALL_GetProgramivNV(disp, parameters) (*((disp)->GetProgramivNV)) parameters -#define GET_GetProgramivNV(disp) ((disp)->GetProgramivNV) -#define SET_GetProgramivNV(disp, fn) ((disp)->GetProgramivNV = fn) -#define CALL_GetTrackMatrixivNV(disp, parameters) (*((disp)->GetTrackMatrixivNV)) parameters -#define GET_GetTrackMatrixivNV(disp) ((disp)->GetTrackMatrixivNV) -#define SET_GetTrackMatrixivNV(disp, fn) ((disp)->GetTrackMatrixivNV = fn) -#define CALL_GetVertexAttribPointervNV(disp, parameters) (*((disp)->GetVertexAttribPointervNV)) parameters -#define GET_GetVertexAttribPointervNV(disp) ((disp)->GetVertexAttribPointervNV) -#define SET_GetVertexAttribPointervNV(disp, fn) ((disp)->GetVertexAttribPointervNV = fn) -#define CALL_GetVertexAttribdvNV(disp, parameters) (*((disp)->GetVertexAttribdvNV)) parameters -#define GET_GetVertexAttribdvNV(disp) ((disp)->GetVertexAttribdvNV) -#define SET_GetVertexAttribdvNV(disp, fn) ((disp)->GetVertexAttribdvNV = fn) -#define CALL_GetVertexAttribfvNV(disp, parameters) (*((disp)->GetVertexAttribfvNV)) parameters -#define GET_GetVertexAttribfvNV(disp) ((disp)->GetVertexAttribfvNV) -#define SET_GetVertexAttribfvNV(disp, fn) ((disp)->GetVertexAttribfvNV = fn) -#define CALL_GetVertexAttribivNV(disp, parameters) (*((disp)->GetVertexAttribivNV)) parameters -#define GET_GetVertexAttribivNV(disp) ((disp)->GetVertexAttribivNV) -#define SET_GetVertexAttribivNV(disp, fn) ((disp)->GetVertexAttribivNV = fn) -#define CALL_IsProgramNV(disp, parameters) (*((disp)->IsProgramNV)) parameters -#define GET_IsProgramNV(disp) ((disp)->IsProgramNV) -#define SET_IsProgramNV(disp, fn) ((disp)->IsProgramNV = fn) -#define CALL_LoadProgramNV(disp, parameters) (*((disp)->LoadProgramNV)) parameters -#define GET_LoadProgramNV(disp) ((disp)->LoadProgramNV) -#define SET_LoadProgramNV(disp, fn) ((disp)->LoadProgramNV = fn) -#define CALL_ProgramParameters4dvNV(disp, parameters) (*((disp)->ProgramParameters4dvNV)) parameters -#define GET_ProgramParameters4dvNV(disp) ((disp)->ProgramParameters4dvNV) -#define SET_ProgramParameters4dvNV(disp, fn) ((disp)->ProgramParameters4dvNV = fn) -#define CALL_ProgramParameters4fvNV(disp, parameters) (*((disp)->ProgramParameters4fvNV)) parameters -#define GET_ProgramParameters4fvNV(disp) ((disp)->ProgramParameters4fvNV) -#define SET_ProgramParameters4fvNV(disp, fn) ((disp)->ProgramParameters4fvNV = fn) -#define CALL_RequestResidentProgramsNV(disp, parameters) (*((disp)->RequestResidentProgramsNV)) parameters -#define GET_RequestResidentProgramsNV(disp) ((disp)->RequestResidentProgramsNV) -#define SET_RequestResidentProgramsNV(disp, fn) ((disp)->RequestResidentProgramsNV = fn) -#define CALL_TrackMatrixNV(disp, parameters) (*((disp)->TrackMatrixNV)) parameters -#define GET_TrackMatrixNV(disp) ((disp)->TrackMatrixNV) -#define SET_TrackMatrixNV(disp, fn) ((disp)->TrackMatrixNV = fn) -#define CALL_VertexAttrib1dNV(disp, parameters) (*((disp)->VertexAttrib1dNV)) parameters -#define GET_VertexAttrib1dNV(disp) ((disp)->VertexAttrib1dNV) -#define SET_VertexAttrib1dNV(disp, fn) ((disp)->VertexAttrib1dNV = fn) -#define CALL_VertexAttrib1dvNV(disp, parameters) (*((disp)->VertexAttrib1dvNV)) parameters -#define GET_VertexAttrib1dvNV(disp) ((disp)->VertexAttrib1dvNV) -#define SET_VertexAttrib1dvNV(disp, fn) ((disp)->VertexAttrib1dvNV = fn) -#define CALL_VertexAttrib1fNV(disp, parameters) (*((disp)->VertexAttrib1fNV)) parameters -#define GET_VertexAttrib1fNV(disp) ((disp)->VertexAttrib1fNV) -#define SET_VertexAttrib1fNV(disp, fn) ((disp)->VertexAttrib1fNV = fn) -#define CALL_VertexAttrib1fvNV(disp, parameters) (*((disp)->VertexAttrib1fvNV)) parameters -#define GET_VertexAttrib1fvNV(disp) ((disp)->VertexAttrib1fvNV) -#define SET_VertexAttrib1fvNV(disp, fn) ((disp)->VertexAttrib1fvNV = fn) -#define CALL_VertexAttrib1sNV(disp, parameters) (*((disp)->VertexAttrib1sNV)) parameters -#define GET_VertexAttrib1sNV(disp) ((disp)->VertexAttrib1sNV) -#define SET_VertexAttrib1sNV(disp, fn) ((disp)->VertexAttrib1sNV = fn) -#define CALL_VertexAttrib1svNV(disp, parameters) (*((disp)->VertexAttrib1svNV)) parameters -#define GET_VertexAttrib1svNV(disp) ((disp)->VertexAttrib1svNV) -#define SET_VertexAttrib1svNV(disp, fn) ((disp)->VertexAttrib1svNV = fn) -#define CALL_VertexAttrib2dNV(disp, parameters) (*((disp)->VertexAttrib2dNV)) parameters -#define GET_VertexAttrib2dNV(disp) ((disp)->VertexAttrib2dNV) -#define SET_VertexAttrib2dNV(disp, fn) ((disp)->VertexAttrib2dNV = fn) -#define CALL_VertexAttrib2dvNV(disp, parameters) (*((disp)->VertexAttrib2dvNV)) parameters -#define GET_VertexAttrib2dvNV(disp) ((disp)->VertexAttrib2dvNV) -#define SET_VertexAttrib2dvNV(disp, fn) ((disp)->VertexAttrib2dvNV = fn) -#define CALL_VertexAttrib2fNV(disp, parameters) (*((disp)->VertexAttrib2fNV)) parameters -#define GET_VertexAttrib2fNV(disp) ((disp)->VertexAttrib2fNV) -#define SET_VertexAttrib2fNV(disp, fn) ((disp)->VertexAttrib2fNV = fn) -#define CALL_VertexAttrib2fvNV(disp, parameters) (*((disp)->VertexAttrib2fvNV)) parameters -#define GET_VertexAttrib2fvNV(disp) ((disp)->VertexAttrib2fvNV) -#define SET_VertexAttrib2fvNV(disp, fn) ((disp)->VertexAttrib2fvNV = fn) -#define CALL_VertexAttrib2sNV(disp, parameters) (*((disp)->VertexAttrib2sNV)) parameters -#define GET_VertexAttrib2sNV(disp) ((disp)->VertexAttrib2sNV) -#define SET_VertexAttrib2sNV(disp, fn) ((disp)->VertexAttrib2sNV = fn) -#define CALL_VertexAttrib2svNV(disp, parameters) (*((disp)->VertexAttrib2svNV)) parameters -#define GET_VertexAttrib2svNV(disp) ((disp)->VertexAttrib2svNV) -#define SET_VertexAttrib2svNV(disp, fn) ((disp)->VertexAttrib2svNV = fn) -#define CALL_VertexAttrib3dNV(disp, parameters) (*((disp)->VertexAttrib3dNV)) parameters -#define GET_VertexAttrib3dNV(disp) ((disp)->VertexAttrib3dNV) -#define SET_VertexAttrib3dNV(disp, fn) ((disp)->VertexAttrib3dNV = fn) -#define CALL_VertexAttrib3dvNV(disp, parameters) (*((disp)->VertexAttrib3dvNV)) parameters -#define GET_VertexAttrib3dvNV(disp) ((disp)->VertexAttrib3dvNV) -#define SET_VertexAttrib3dvNV(disp, fn) ((disp)->VertexAttrib3dvNV = fn) -#define CALL_VertexAttrib3fNV(disp, parameters) (*((disp)->VertexAttrib3fNV)) parameters -#define GET_VertexAttrib3fNV(disp) ((disp)->VertexAttrib3fNV) -#define SET_VertexAttrib3fNV(disp, fn) ((disp)->VertexAttrib3fNV = fn) -#define CALL_VertexAttrib3fvNV(disp, parameters) (*((disp)->VertexAttrib3fvNV)) parameters -#define GET_VertexAttrib3fvNV(disp) ((disp)->VertexAttrib3fvNV) -#define SET_VertexAttrib3fvNV(disp, fn) ((disp)->VertexAttrib3fvNV = fn) -#define CALL_VertexAttrib3sNV(disp, parameters) (*((disp)->VertexAttrib3sNV)) parameters -#define GET_VertexAttrib3sNV(disp) ((disp)->VertexAttrib3sNV) -#define SET_VertexAttrib3sNV(disp, fn) ((disp)->VertexAttrib3sNV = fn) -#define CALL_VertexAttrib3svNV(disp, parameters) (*((disp)->VertexAttrib3svNV)) parameters -#define GET_VertexAttrib3svNV(disp) ((disp)->VertexAttrib3svNV) -#define SET_VertexAttrib3svNV(disp, fn) ((disp)->VertexAttrib3svNV = fn) -#define CALL_VertexAttrib4dNV(disp, parameters) (*((disp)->VertexAttrib4dNV)) parameters -#define GET_VertexAttrib4dNV(disp) ((disp)->VertexAttrib4dNV) -#define SET_VertexAttrib4dNV(disp, fn) ((disp)->VertexAttrib4dNV = fn) -#define CALL_VertexAttrib4dvNV(disp, parameters) (*((disp)->VertexAttrib4dvNV)) parameters -#define GET_VertexAttrib4dvNV(disp) ((disp)->VertexAttrib4dvNV) -#define SET_VertexAttrib4dvNV(disp, fn) ((disp)->VertexAttrib4dvNV = fn) -#define CALL_VertexAttrib4fNV(disp, parameters) (*((disp)->VertexAttrib4fNV)) parameters -#define GET_VertexAttrib4fNV(disp) ((disp)->VertexAttrib4fNV) -#define SET_VertexAttrib4fNV(disp, fn) ((disp)->VertexAttrib4fNV = fn) -#define CALL_VertexAttrib4fvNV(disp, parameters) (*((disp)->VertexAttrib4fvNV)) parameters -#define GET_VertexAttrib4fvNV(disp) ((disp)->VertexAttrib4fvNV) -#define SET_VertexAttrib4fvNV(disp, fn) ((disp)->VertexAttrib4fvNV = fn) -#define CALL_VertexAttrib4sNV(disp, parameters) (*((disp)->VertexAttrib4sNV)) parameters -#define GET_VertexAttrib4sNV(disp) ((disp)->VertexAttrib4sNV) -#define SET_VertexAttrib4sNV(disp, fn) ((disp)->VertexAttrib4sNV = fn) -#define CALL_VertexAttrib4svNV(disp, parameters) (*((disp)->VertexAttrib4svNV)) parameters -#define GET_VertexAttrib4svNV(disp) ((disp)->VertexAttrib4svNV) -#define SET_VertexAttrib4svNV(disp, fn) ((disp)->VertexAttrib4svNV = fn) -#define CALL_VertexAttrib4ubNV(disp, parameters) (*((disp)->VertexAttrib4ubNV)) parameters -#define GET_VertexAttrib4ubNV(disp) ((disp)->VertexAttrib4ubNV) -#define SET_VertexAttrib4ubNV(disp, fn) ((disp)->VertexAttrib4ubNV = fn) -#define CALL_VertexAttrib4ubvNV(disp, parameters) (*((disp)->VertexAttrib4ubvNV)) parameters -#define GET_VertexAttrib4ubvNV(disp) ((disp)->VertexAttrib4ubvNV) -#define SET_VertexAttrib4ubvNV(disp, fn) ((disp)->VertexAttrib4ubvNV = fn) -#define CALL_VertexAttribPointerNV(disp, parameters) (*((disp)->VertexAttribPointerNV)) parameters -#define GET_VertexAttribPointerNV(disp) ((disp)->VertexAttribPointerNV) -#define SET_VertexAttribPointerNV(disp, fn) ((disp)->VertexAttribPointerNV = fn) -#define CALL_VertexAttribs1dvNV(disp, parameters) (*((disp)->VertexAttribs1dvNV)) parameters -#define GET_VertexAttribs1dvNV(disp) ((disp)->VertexAttribs1dvNV) -#define SET_VertexAttribs1dvNV(disp, fn) ((disp)->VertexAttribs1dvNV = fn) -#define CALL_VertexAttribs1fvNV(disp, parameters) (*((disp)->VertexAttribs1fvNV)) parameters -#define GET_VertexAttribs1fvNV(disp) ((disp)->VertexAttribs1fvNV) -#define SET_VertexAttribs1fvNV(disp, fn) ((disp)->VertexAttribs1fvNV = fn) -#define CALL_VertexAttribs1svNV(disp, parameters) (*((disp)->VertexAttribs1svNV)) parameters -#define GET_VertexAttribs1svNV(disp) ((disp)->VertexAttribs1svNV) -#define SET_VertexAttribs1svNV(disp, fn) ((disp)->VertexAttribs1svNV = fn) -#define CALL_VertexAttribs2dvNV(disp, parameters) (*((disp)->VertexAttribs2dvNV)) parameters -#define GET_VertexAttribs2dvNV(disp) ((disp)->VertexAttribs2dvNV) -#define SET_VertexAttribs2dvNV(disp, fn) ((disp)->VertexAttribs2dvNV = fn) -#define CALL_VertexAttribs2fvNV(disp, parameters) (*((disp)->VertexAttribs2fvNV)) parameters -#define GET_VertexAttribs2fvNV(disp) ((disp)->VertexAttribs2fvNV) -#define SET_VertexAttribs2fvNV(disp, fn) ((disp)->VertexAttribs2fvNV = fn) -#define CALL_VertexAttribs2svNV(disp, parameters) (*((disp)->VertexAttribs2svNV)) parameters -#define GET_VertexAttribs2svNV(disp) ((disp)->VertexAttribs2svNV) -#define SET_VertexAttribs2svNV(disp, fn) ((disp)->VertexAttribs2svNV = fn) -#define CALL_VertexAttribs3dvNV(disp, parameters) (*((disp)->VertexAttribs3dvNV)) parameters -#define GET_VertexAttribs3dvNV(disp) ((disp)->VertexAttribs3dvNV) -#define SET_VertexAttribs3dvNV(disp, fn) ((disp)->VertexAttribs3dvNV = fn) -#define CALL_VertexAttribs3fvNV(disp, parameters) (*((disp)->VertexAttribs3fvNV)) parameters -#define GET_VertexAttribs3fvNV(disp) ((disp)->VertexAttribs3fvNV) -#define SET_VertexAttribs3fvNV(disp, fn) ((disp)->VertexAttribs3fvNV = fn) -#define CALL_VertexAttribs3svNV(disp, parameters) (*((disp)->VertexAttribs3svNV)) parameters -#define GET_VertexAttribs3svNV(disp) ((disp)->VertexAttribs3svNV) -#define SET_VertexAttribs3svNV(disp, fn) ((disp)->VertexAttribs3svNV = fn) -#define CALL_VertexAttribs4dvNV(disp, parameters) (*((disp)->VertexAttribs4dvNV)) parameters -#define GET_VertexAttribs4dvNV(disp) ((disp)->VertexAttribs4dvNV) -#define SET_VertexAttribs4dvNV(disp, fn) ((disp)->VertexAttribs4dvNV = fn) -#define CALL_VertexAttribs4fvNV(disp, parameters) (*((disp)->VertexAttribs4fvNV)) parameters -#define GET_VertexAttribs4fvNV(disp) ((disp)->VertexAttribs4fvNV) -#define SET_VertexAttribs4fvNV(disp, fn) ((disp)->VertexAttribs4fvNV = fn) -#define CALL_VertexAttribs4svNV(disp, parameters) (*((disp)->VertexAttribs4svNV)) parameters -#define GET_VertexAttribs4svNV(disp) ((disp)->VertexAttribs4svNV) -#define SET_VertexAttribs4svNV(disp, fn) ((disp)->VertexAttribs4svNV = fn) -#define CALL_VertexAttribs4ubvNV(disp, parameters) (*((disp)->VertexAttribs4ubvNV)) parameters -#define GET_VertexAttribs4ubvNV(disp) ((disp)->VertexAttribs4ubvNV) -#define SET_VertexAttribs4ubvNV(disp, fn) ((disp)->VertexAttribs4ubvNV = fn) -#define CALL_GetTexBumpParameterfvATI(disp, parameters) (*((disp)->GetTexBumpParameterfvATI)) parameters -#define GET_GetTexBumpParameterfvATI(disp) ((disp)->GetTexBumpParameterfvATI) -#define SET_GetTexBumpParameterfvATI(disp, fn) ((disp)->GetTexBumpParameterfvATI = fn) -#define CALL_GetTexBumpParameterivATI(disp, parameters) (*((disp)->GetTexBumpParameterivATI)) parameters -#define GET_GetTexBumpParameterivATI(disp) ((disp)->GetTexBumpParameterivATI) -#define SET_GetTexBumpParameterivATI(disp, fn) ((disp)->GetTexBumpParameterivATI = fn) -#define CALL_TexBumpParameterfvATI(disp, parameters) (*((disp)->TexBumpParameterfvATI)) parameters -#define GET_TexBumpParameterfvATI(disp) ((disp)->TexBumpParameterfvATI) -#define SET_TexBumpParameterfvATI(disp, fn) ((disp)->TexBumpParameterfvATI = fn) -#define CALL_TexBumpParameterivATI(disp, parameters) (*((disp)->TexBumpParameterivATI)) parameters -#define GET_TexBumpParameterivATI(disp) ((disp)->TexBumpParameterivATI) -#define SET_TexBumpParameterivATI(disp, fn) ((disp)->TexBumpParameterivATI = fn) -#define CALL_AlphaFragmentOp1ATI(disp, parameters) (*((disp)->AlphaFragmentOp1ATI)) parameters -#define GET_AlphaFragmentOp1ATI(disp) ((disp)->AlphaFragmentOp1ATI) -#define SET_AlphaFragmentOp1ATI(disp, fn) ((disp)->AlphaFragmentOp1ATI = fn) -#define CALL_AlphaFragmentOp2ATI(disp, parameters) (*((disp)->AlphaFragmentOp2ATI)) parameters -#define GET_AlphaFragmentOp2ATI(disp) ((disp)->AlphaFragmentOp2ATI) -#define SET_AlphaFragmentOp2ATI(disp, fn) ((disp)->AlphaFragmentOp2ATI = fn) -#define CALL_AlphaFragmentOp3ATI(disp, parameters) (*((disp)->AlphaFragmentOp3ATI)) parameters -#define GET_AlphaFragmentOp3ATI(disp) ((disp)->AlphaFragmentOp3ATI) -#define SET_AlphaFragmentOp3ATI(disp, fn) ((disp)->AlphaFragmentOp3ATI = fn) -#define CALL_BeginFragmentShaderATI(disp, parameters) (*((disp)->BeginFragmentShaderATI)) parameters -#define GET_BeginFragmentShaderATI(disp) ((disp)->BeginFragmentShaderATI) -#define SET_BeginFragmentShaderATI(disp, fn) ((disp)->BeginFragmentShaderATI = fn) -#define CALL_BindFragmentShaderATI(disp, parameters) (*((disp)->BindFragmentShaderATI)) parameters -#define GET_BindFragmentShaderATI(disp) ((disp)->BindFragmentShaderATI) -#define SET_BindFragmentShaderATI(disp, fn) ((disp)->BindFragmentShaderATI = fn) -#define CALL_ColorFragmentOp1ATI(disp, parameters) (*((disp)->ColorFragmentOp1ATI)) parameters -#define GET_ColorFragmentOp1ATI(disp) ((disp)->ColorFragmentOp1ATI) -#define SET_ColorFragmentOp1ATI(disp, fn) ((disp)->ColorFragmentOp1ATI = fn) -#define CALL_ColorFragmentOp2ATI(disp, parameters) (*((disp)->ColorFragmentOp2ATI)) parameters -#define GET_ColorFragmentOp2ATI(disp) ((disp)->ColorFragmentOp2ATI) -#define SET_ColorFragmentOp2ATI(disp, fn) ((disp)->ColorFragmentOp2ATI = fn) -#define CALL_ColorFragmentOp3ATI(disp, parameters) (*((disp)->ColorFragmentOp3ATI)) parameters -#define GET_ColorFragmentOp3ATI(disp) ((disp)->ColorFragmentOp3ATI) -#define SET_ColorFragmentOp3ATI(disp, fn) ((disp)->ColorFragmentOp3ATI = fn) -#define CALL_DeleteFragmentShaderATI(disp, parameters) (*((disp)->DeleteFragmentShaderATI)) parameters -#define GET_DeleteFragmentShaderATI(disp) ((disp)->DeleteFragmentShaderATI) -#define SET_DeleteFragmentShaderATI(disp, fn) ((disp)->DeleteFragmentShaderATI = fn) -#define CALL_EndFragmentShaderATI(disp, parameters) (*((disp)->EndFragmentShaderATI)) parameters -#define GET_EndFragmentShaderATI(disp) ((disp)->EndFragmentShaderATI) -#define SET_EndFragmentShaderATI(disp, fn) ((disp)->EndFragmentShaderATI = fn) -#define CALL_GenFragmentShadersATI(disp, parameters) (*((disp)->GenFragmentShadersATI)) parameters -#define GET_GenFragmentShadersATI(disp) ((disp)->GenFragmentShadersATI) -#define SET_GenFragmentShadersATI(disp, fn) ((disp)->GenFragmentShadersATI = fn) -#define CALL_PassTexCoordATI(disp, parameters) (*((disp)->PassTexCoordATI)) parameters -#define GET_PassTexCoordATI(disp) ((disp)->PassTexCoordATI) -#define SET_PassTexCoordATI(disp, fn) ((disp)->PassTexCoordATI = fn) -#define CALL_SampleMapATI(disp, parameters) (*((disp)->SampleMapATI)) parameters -#define GET_SampleMapATI(disp) ((disp)->SampleMapATI) -#define SET_SampleMapATI(disp, fn) ((disp)->SampleMapATI = fn) -#define CALL_SetFragmentShaderConstantATI(disp, parameters) (*((disp)->SetFragmentShaderConstantATI)) parameters -#define GET_SetFragmentShaderConstantATI(disp) ((disp)->SetFragmentShaderConstantATI) -#define SET_SetFragmentShaderConstantATI(disp, fn) ((disp)->SetFragmentShaderConstantATI = fn) -#define CALL_PointParameteriNV(disp, parameters) (*((disp)->PointParameteriNV)) parameters -#define GET_PointParameteriNV(disp) ((disp)->PointParameteriNV) -#define SET_PointParameteriNV(disp, fn) ((disp)->PointParameteriNV = fn) -#define CALL_PointParameterivNV(disp, parameters) (*((disp)->PointParameterivNV)) parameters -#define GET_PointParameterivNV(disp) ((disp)->PointParameterivNV) -#define SET_PointParameterivNV(disp, fn) ((disp)->PointParameterivNV = fn) -#define CALL_ActiveStencilFaceEXT(disp, parameters) (*((disp)->ActiveStencilFaceEXT)) parameters -#define GET_ActiveStencilFaceEXT(disp) ((disp)->ActiveStencilFaceEXT) -#define SET_ActiveStencilFaceEXT(disp, fn) ((disp)->ActiveStencilFaceEXT = fn) -#define CALL_BindVertexArrayAPPLE(disp, parameters) (*((disp)->BindVertexArrayAPPLE)) parameters -#define GET_BindVertexArrayAPPLE(disp) ((disp)->BindVertexArrayAPPLE) -#define SET_BindVertexArrayAPPLE(disp, fn) ((disp)->BindVertexArrayAPPLE = fn) -#define CALL_DeleteVertexArraysAPPLE(disp, parameters) (*((disp)->DeleteVertexArraysAPPLE)) parameters -#define GET_DeleteVertexArraysAPPLE(disp) ((disp)->DeleteVertexArraysAPPLE) -#define SET_DeleteVertexArraysAPPLE(disp, fn) ((disp)->DeleteVertexArraysAPPLE = fn) -#define CALL_GenVertexArraysAPPLE(disp, parameters) (*((disp)->GenVertexArraysAPPLE)) parameters -#define GET_GenVertexArraysAPPLE(disp) ((disp)->GenVertexArraysAPPLE) -#define SET_GenVertexArraysAPPLE(disp, fn) ((disp)->GenVertexArraysAPPLE = fn) -#define CALL_IsVertexArrayAPPLE(disp, parameters) (*((disp)->IsVertexArrayAPPLE)) parameters -#define GET_IsVertexArrayAPPLE(disp) ((disp)->IsVertexArrayAPPLE) -#define SET_IsVertexArrayAPPLE(disp, fn) ((disp)->IsVertexArrayAPPLE = fn) -#define CALL_GetProgramNamedParameterdvNV(disp, parameters) (*((disp)->GetProgramNamedParameterdvNV)) parameters -#define GET_GetProgramNamedParameterdvNV(disp) ((disp)->GetProgramNamedParameterdvNV) -#define SET_GetProgramNamedParameterdvNV(disp, fn) ((disp)->GetProgramNamedParameterdvNV = fn) -#define CALL_GetProgramNamedParameterfvNV(disp, parameters) (*((disp)->GetProgramNamedParameterfvNV)) parameters -#define GET_GetProgramNamedParameterfvNV(disp) ((disp)->GetProgramNamedParameterfvNV) -#define SET_GetProgramNamedParameterfvNV(disp, fn) ((disp)->GetProgramNamedParameterfvNV = fn) -#define CALL_ProgramNamedParameter4dNV(disp, parameters) (*((disp)->ProgramNamedParameter4dNV)) parameters -#define GET_ProgramNamedParameter4dNV(disp) ((disp)->ProgramNamedParameter4dNV) -#define SET_ProgramNamedParameter4dNV(disp, fn) ((disp)->ProgramNamedParameter4dNV = fn) -#define CALL_ProgramNamedParameter4dvNV(disp, parameters) (*((disp)->ProgramNamedParameter4dvNV)) parameters -#define GET_ProgramNamedParameter4dvNV(disp) ((disp)->ProgramNamedParameter4dvNV) -#define SET_ProgramNamedParameter4dvNV(disp, fn) ((disp)->ProgramNamedParameter4dvNV = fn) -#define CALL_ProgramNamedParameter4fNV(disp, parameters) (*((disp)->ProgramNamedParameter4fNV)) parameters -#define GET_ProgramNamedParameter4fNV(disp) ((disp)->ProgramNamedParameter4fNV) -#define SET_ProgramNamedParameter4fNV(disp, fn) ((disp)->ProgramNamedParameter4fNV = fn) -#define CALL_ProgramNamedParameter4fvNV(disp, parameters) (*((disp)->ProgramNamedParameter4fvNV)) parameters -#define GET_ProgramNamedParameter4fvNV(disp) ((disp)->ProgramNamedParameter4fvNV) -#define SET_ProgramNamedParameter4fvNV(disp, fn) ((disp)->ProgramNamedParameter4fvNV = fn) -#define CALL_DepthBoundsEXT(disp, parameters) (*((disp)->DepthBoundsEXT)) parameters -#define GET_DepthBoundsEXT(disp) ((disp)->DepthBoundsEXT) -#define SET_DepthBoundsEXT(disp, fn) ((disp)->DepthBoundsEXT = fn) -#define CALL_BlendEquationSeparateEXT(disp, parameters) (*((disp)->BlendEquationSeparateEXT)) parameters -#define GET_BlendEquationSeparateEXT(disp) ((disp)->BlendEquationSeparateEXT) -#define SET_BlendEquationSeparateEXT(disp, fn) ((disp)->BlendEquationSeparateEXT = fn) -#define CALL_BindFramebufferEXT(disp, parameters) (*((disp)->BindFramebufferEXT)) parameters -#define GET_BindFramebufferEXT(disp) ((disp)->BindFramebufferEXT) -#define SET_BindFramebufferEXT(disp, fn) ((disp)->BindFramebufferEXT = fn) -#define CALL_BindRenderbufferEXT(disp, parameters) (*((disp)->BindRenderbufferEXT)) parameters -#define GET_BindRenderbufferEXT(disp) ((disp)->BindRenderbufferEXT) -#define SET_BindRenderbufferEXT(disp, fn) ((disp)->BindRenderbufferEXT = fn) -#define CALL_CheckFramebufferStatusEXT(disp, parameters) (*((disp)->CheckFramebufferStatusEXT)) parameters -#define GET_CheckFramebufferStatusEXT(disp) ((disp)->CheckFramebufferStatusEXT) -#define SET_CheckFramebufferStatusEXT(disp, fn) ((disp)->CheckFramebufferStatusEXT = fn) -#define CALL_DeleteFramebuffersEXT(disp, parameters) (*((disp)->DeleteFramebuffersEXT)) parameters -#define GET_DeleteFramebuffersEXT(disp) ((disp)->DeleteFramebuffersEXT) -#define SET_DeleteFramebuffersEXT(disp, fn) ((disp)->DeleteFramebuffersEXT = fn) -#define CALL_DeleteRenderbuffersEXT(disp, parameters) (*((disp)->DeleteRenderbuffersEXT)) parameters -#define GET_DeleteRenderbuffersEXT(disp) ((disp)->DeleteRenderbuffersEXT) -#define SET_DeleteRenderbuffersEXT(disp, fn) ((disp)->DeleteRenderbuffersEXT = fn) -#define CALL_FramebufferRenderbufferEXT(disp, parameters) (*((disp)->FramebufferRenderbufferEXT)) parameters -#define GET_FramebufferRenderbufferEXT(disp) ((disp)->FramebufferRenderbufferEXT) -#define SET_FramebufferRenderbufferEXT(disp, fn) ((disp)->FramebufferRenderbufferEXT = fn) -#define CALL_FramebufferTexture1DEXT(disp, parameters) (*((disp)->FramebufferTexture1DEXT)) parameters -#define GET_FramebufferTexture1DEXT(disp) ((disp)->FramebufferTexture1DEXT) -#define SET_FramebufferTexture1DEXT(disp, fn) ((disp)->FramebufferTexture1DEXT = fn) -#define CALL_FramebufferTexture2DEXT(disp, parameters) (*((disp)->FramebufferTexture2DEXT)) parameters -#define GET_FramebufferTexture2DEXT(disp) ((disp)->FramebufferTexture2DEXT) -#define SET_FramebufferTexture2DEXT(disp, fn) ((disp)->FramebufferTexture2DEXT = fn) -#define CALL_FramebufferTexture3DEXT(disp, parameters) (*((disp)->FramebufferTexture3DEXT)) parameters -#define GET_FramebufferTexture3DEXT(disp) ((disp)->FramebufferTexture3DEXT) -#define SET_FramebufferTexture3DEXT(disp, fn) ((disp)->FramebufferTexture3DEXT = fn) -#define CALL_GenFramebuffersEXT(disp, parameters) (*((disp)->GenFramebuffersEXT)) parameters -#define GET_GenFramebuffersEXT(disp) ((disp)->GenFramebuffersEXT) -#define SET_GenFramebuffersEXT(disp, fn) ((disp)->GenFramebuffersEXT = fn) -#define CALL_GenRenderbuffersEXT(disp, parameters) (*((disp)->GenRenderbuffersEXT)) parameters -#define GET_GenRenderbuffersEXT(disp) ((disp)->GenRenderbuffersEXT) -#define SET_GenRenderbuffersEXT(disp, fn) ((disp)->GenRenderbuffersEXT = fn) -#define CALL_GenerateMipmapEXT(disp, parameters) (*((disp)->GenerateMipmapEXT)) parameters -#define GET_GenerateMipmapEXT(disp) ((disp)->GenerateMipmapEXT) -#define SET_GenerateMipmapEXT(disp, fn) ((disp)->GenerateMipmapEXT = fn) -#define CALL_GetFramebufferAttachmentParameterivEXT(disp, parameters) (*((disp)->GetFramebufferAttachmentParameterivEXT)) parameters -#define GET_GetFramebufferAttachmentParameterivEXT(disp) ((disp)->GetFramebufferAttachmentParameterivEXT) -#define SET_GetFramebufferAttachmentParameterivEXT(disp, fn) ((disp)->GetFramebufferAttachmentParameterivEXT = fn) -#define CALL_GetRenderbufferParameterivEXT(disp, parameters) (*((disp)->GetRenderbufferParameterivEXT)) parameters -#define GET_GetRenderbufferParameterivEXT(disp) ((disp)->GetRenderbufferParameterivEXT) -#define SET_GetRenderbufferParameterivEXT(disp, fn) ((disp)->GetRenderbufferParameterivEXT = fn) -#define CALL_IsFramebufferEXT(disp, parameters) (*((disp)->IsFramebufferEXT)) parameters -#define GET_IsFramebufferEXT(disp) ((disp)->IsFramebufferEXT) -#define SET_IsFramebufferEXT(disp, fn) ((disp)->IsFramebufferEXT = fn) -#define CALL_IsRenderbufferEXT(disp, parameters) (*((disp)->IsRenderbufferEXT)) parameters -#define GET_IsRenderbufferEXT(disp) ((disp)->IsRenderbufferEXT) -#define SET_IsRenderbufferEXT(disp, fn) ((disp)->IsRenderbufferEXT = fn) -#define CALL_RenderbufferStorageEXT(disp, parameters) (*((disp)->RenderbufferStorageEXT)) parameters -#define GET_RenderbufferStorageEXT(disp) ((disp)->RenderbufferStorageEXT) -#define SET_RenderbufferStorageEXT(disp, fn) ((disp)->RenderbufferStorageEXT = fn) -#define CALL_BlitFramebufferEXT(disp, parameters) (*((disp)->BlitFramebufferEXT)) parameters -#define GET_BlitFramebufferEXT(disp) ((disp)->BlitFramebufferEXT) -#define SET_BlitFramebufferEXT(disp, fn) ((disp)->BlitFramebufferEXT = fn) -#define CALL_BufferParameteriAPPLE(disp, parameters) (*((disp)->BufferParameteriAPPLE)) parameters -#define GET_BufferParameteriAPPLE(disp) ((disp)->BufferParameteriAPPLE) -#define SET_BufferParameteriAPPLE(disp, fn) ((disp)->BufferParameteriAPPLE = fn) -#define CALL_FlushMappedBufferRangeAPPLE(disp, parameters) (*((disp)->FlushMappedBufferRangeAPPLE)) parameters -#define GET_FlushMappedBufferRangeAPPLE(disp) ((disp)->FlushMappedBufferRangeAPPLE) -#define SET_FlushMappedBufferRangeAPPLE(disp, fn) ((disp)->FlushMappedBufferRangeAPPLE = fn) -#define CALL_FramebufferTextureLayerEXT(disp, parameters) (*((disp)->FramebufferTextureLayerEXT)) parameters -#define GET_FramebufferTextureLayerEXT(disp) ((disp)->FramebufferTextureLayerEXT) -#define SET_FramebufferTextureLayerEXT(disp, fn) ((disp)->FramebufferTextureLayerEXT = fn) -#define CALL_ProvokingVertexEXT(disp, parameters) (*((disp)->ProvokingVertexEXT)) parameters -#define GET_ProvokingVertexEXT(disp) ((disp)->ProvokingVertexEXT) -#define SET_ProvokingVertexEXT(disp, fn) ((disp)->ProvokingVertexEXT = fn) -#define CALL_GetTexParameterPointervAPPLE(disp, parameters) (*((disp)->GetTexParameterPointervAPPLE)) parameters -#define GET_GetTexParameterPointervAPPLE(disp) ((disp)->GetTexParameterPointervAPPLE) -#define SET_GetTexParameterPointervAPPLE(disp, fn) ((disp)->GetTexParameterPointervAPPLE = fn) -#define CALL_TextureRangeAPPLE(disp, parameters) (*((disp)->TextureRangeAPPLE)) parameters -#define GET_TextureRangeAPPLE(disp) ((disp)->TextureRangeAPPLE) -#define SET_TextureRangeAPPLE(disp, fn) ((disp)->TextureRangeAPPLE = fn) -#define CALL_StencilFuncSeparateATI(disp, parameters) (*((disp)->StencilFuncSeparateATI)) parameters -#define GET_StencilFuncSeparateATI(disp) ((disp)->StencilFuncSeparateATI) -#define SET_StencilFuncSeparateATI(disp, fn) ((disp)->StencilFuncSeparateATI = fn) -#define CALL_ProgramEnvParameters4fvEXT(disp, parameters) (*((disp)->ProgramEnvParameters4fvEXT)) parameters -#define GET_ProgramEnvParameters4fvEXT(disp) ((disp)->ProgramEnvParameters4fvEXT) -#define SET_ProgramEnvParameters4fvEXT(disp, fn) ((disp)->ProgramEnvParameters4fvEXT = fn) -#define CALL_ProgramLocalParameters4fvEXT(disp, parameters) (*((disp)->ProgramLocalParameters4fvEXT)) parameters -#define GET_ProgramLocalParameters4fvEXT(disp) ((disp)->ProgramLocalParameters4fvEXT) -#define SET_ProgramLocalParameters4fvEXT(disp, fn) ((disp)->ProgramLocalParameters4fvEXT = fn) -#define CALL_GetQueryObjecti64vEXT(disp, parameters) (*((disp)->GetQueryObjecti64vEXT)) parameters -#define GET_GetQueryObjecti64vEXT(disp) ((disp)->GetQueryObjecti64vEXT) -#define SET_GetQueryObjecti64vEXT(disp, fn) ((disp)->GetQueryObjecti64vEXT = fn) -#define CALL_GetQueryObjectui64vEXT(disp, parameters) (*((disp)->GetQueryObjectui64vEXT)) parameters -#define GET_GetQueryObjectui64vEXT(disp) ((disp)->GetQueryObjectui64vEXT) -#define SET_GetQueryObjectui64vEXT(disp, fn) ((disp)->GetQueryObjectui64vEXT = fn) - -#else - -#define driDispatchRemapTable_size 387 -extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; - -#define AttachShader_remap_index 0 -#define CreateProgram_remap_index 1 -#define CreateShader_remap_index 2 -#define DeleteProgram_remap_index 3 -#define DeleteShader_remap_index 4 -#define DetachShader_remap_index 5 -#define GetAttachedShaders_remap_index 6 -#define GetProgramInfoLog_remap_index 7 -#define GetProgramiv_remap_index 8 -#define GetShaderInfoLog_remap_index 9 -#define GetShaderiv_remap_index 10 -#define IsProgram_remap_index 11 -#define IsShader_remap_index 12 -#define StencilFuncSeparate_remap_index 13 -#define StencilMaskSeparate_remap_index 14 -#define StencilOpSeparate_remap_index 15 -#define UniformMatrix2x3fv_remap_index 16 -#define UniformMatrix2x4fv_remap_index 17 -#define UniformMatrix3x2fv_remap_index 18 -#define UniformMatrix3x4fv_remap_index 19 -#define UniformMatrix4x2fv_remap_index 20 -#define UniformMatrix4x3fv_remap_index 21 -#define LoadTransposeMatrixdARB_remap_index 22 -#define LoadTransposeMatrixfARB_remap_index 23 -#define MultTransposeMatrixdARB_remap_index 24 -#define MultTransposeMatrixfARB_remap_index 25 -#define SampleCoverageARB_remap_index 26 -#define CompressedTexImage1DARB_remap_index 27 -#define CompressedTexImage2DARB_remap_index 28 -#define CompressedTexImage3DARB_remap_index 29 -#define CompressedTexSubImage1DARB_remap_index 30 -#define CompressedTexSubImage2DARB_remap_index 31 -#define CompressedTexSubImage3DARB_remap_index 32 -#define GetCompressedTexImageARB_remap_index 33 -#define DisableVertexAttribArrayARB_remap_index 34 -#define EnableVertexAttribArrayARB_remap_index 35 -#define GetProgramEnvParameterdvARB_remap_index 36 -#define GetProgramEnvParameterfvARB_remap_index 37 -#define GetProgramLocalParameterdvARB_remap_index 38 -#define GetProgramLocalParameterfvARB_remap_index 39 -#define GetProgramStringARB_remap_index 40 -#define GetProgramivARB_remap_index 41 -#define GetVertexAttribdvARB_remap_index 42 -#define GetVertexAttribfvARB_remap_index 43 -#define GetVertexAttribivARB_remap_index 44 -#define ProgramEnvParameter4dARB_remap_index 45 -#define ProgramEnvParameter4dvARB_remap_index 46 -#define ProgramEnvParameter4fARB_remap_index 47 -#define ProgramEnvParameter4fvARB_remap_index 48 -#define ProgramLocalParameter4dARB_remap_index 49 -#define ProgramLocalParameter4dvARB_remap_index 50 -#define ProgramLocalParameter4fARB_remap_index 51 -#define ProgramLocalParameter4fvARB_remap_index 52 -#define ProgramStringARB_remap_index 53 -#define VertexAttrib1dARB_remap_index 54 -#define VertexAttrib1dvARB_remap_index 55 -#define VertexAttrib1fARB_remap_index 56 -#define VertexAttrib1fvARB_remap_index 57 -#define VertexAttrib1sARB_remap_index 58 -#define VertexAttrib1svARB_remap_index 59 -#define VertexAttrib2dARB_remap_index 60 -#define VertexAttrib2dvARB_remap_index 61 -#define VertexAttrib2fARB_remap_index 62 -#define VertexAttrib2fvARB_remap_index 63 -#define VertexAttrib2sARB_remap_index 64 -#define VertexAttrib2svARB_remap_index 65 -#define VertexAttrib3dARB_remap_index 66 -#define VertexAttrib3dvARB_remap_index 67 -#define VertexAttrib3fARB_remap_index 68 -#define VertexAttrib3fvARB_remap_index 69 -#define VertexAttrib3sARB_remap_index 70 -#define VertexAttrib3svARB_remap_index 71 -#define VertexAttrib4NbvARB_remap_index 72 -#define VertexAttrib4NivARB_remap_index 73 -#define VertexAttrib4NsvARB_remap_index 74 -#define VertexAttrib4NubARB_remap_index 75 -#define VertexAttrib4NubvARB_remap_index 76 -#define VertexAttrib4NuivARB_remap_index 77 -#define VertexAttrib4NusvARB_remap_index 78 -#define VertexAttrib4bvARB_remap_index 79 -#define VertexAttrib4dARB_remap_index 80 -#define VertexAttrib4dvARB_remap_index 81 -#define VertexAttrib4fARB_remap_index 82 -#define VertexAttrib4fvARB_remap_index 83 -#define VertexAttrib4ivARB_remap_index 84 -#define VertexAttrib4sARB_remap_index 85 -#define VertexAttrib4svARB_remap_index 86 -#define VertexAttrib4ubvARB_remap_index 87 -#define VertexAttrib4uivARB_remap_index 88 -#define VertexAttrib4usvARB_remap_index 89 -#define VertexAttribPointerARB_remap_index 90 -#define BindBufferARB_remap_index 91 -#define BufferDataARB_remap_index 92 -#define BufferSubDataARB_remap_index 93 -#define DeleteBuffersARB_remap_index 94 -#define GenBuffersARB_remap_index 95 -#define GetBufferParameterivARB_remap_index 96 -#define GetBufferPointervARB_remap_index 97 -#define GetBufferSubDataARB_remap_index 98 -#define IsBufferARB_remap_index 99 -#define MapBufferARB_remap_index 100 -#define UnmapBufferARB_remap_index 101 -#define BeginQueryARB_remap_index 102 -#define DeleteQueriesARB_remap_index 103 -#define EndQueryARB_remap_index 104 -#define GenQueriesARB_remap_index 105 -#define GetQueryObjectivARB_remap_index 106 -#define GetQueryObjectuivARB_remap_index 107 -#define GetQueryivARB_remap_index 108 -#define IsQueryARB_remap_index 109 -#define AttachObjectARB_remap_index 110 -#define CompileShaderARB_remap_index 111 -#define CreateProgramObjectARB_remap_index 112 -#define CreateShaderObjectARB_remap_index 113 -#define DeleteObjectARB_remap_index 114 -#define DetachObjectARB_remap_index 115 -#define GetActiveUniformARB_remap_index 116 -#define GetAttachedObjectsARB_remap_index 117 -#define GetHandleARB_remap_index 118 -#define GetInfoLogARB_remap_index 119 -#define GetObjectParameterfvARB_remap_index 120 -#define GetObjectParameterivARB_remap_index 121 -#define GetShaderSourceARB_remap_index 122 -#define GetUniformLocationARB_remap_index 123 -#define GetUniformfvARB_remap_index 124 -#define GetUniformivARB_remap_index 125 -#define LinkProgramARB_remap_index 126 -#define ShaderSourceARB_remap_index 127 -#define Uniform1fARB_remap_index 128 -#define Uniform1fvARB_remap_index 129 -#define Uniform1iARB_remap_index 130 -#define Uniform1ivARB_remap_index 131 -#define Uniform2fARB_remap_index 132 -#define Uniform2fvARB_remap_index 133 -#define Uniform2iARB_remap_index 134 -#define Uniform2ivARB_remap_index 135 -#define Uniform3fARB_remap_index 136 -#define Uniform3fvARB_remap_index 137 -#define Uniform3iARB_remap_index 138 -#define Uniform3ivARB_remap_index 139 -#define Uniform4fARB_remap_index 140 -#define Uniform4fvARB_remap_index 141 -#define Uniform4iARB_remap_index 142 -#define Uniform4ivARB_remap_index 143 -#define UniformMatrix2fvARB_remap_index 144 -#define UniformMatrix3fvARB_remap_index 145 -#define UniformMatrix4fvARB_remap_index 146 -#define UseProgramObjectARB_remap_index 147 -#define ValidateProgramARB_remap_index 148 -#define BindAttribLocationARB_remap_index 149 -#define GetActiveAttribARB_remap_index 150 -#define GetAttribLocationARB_remap_index 151 -#define DrawBuffersARB_remap_index 152 -#define RenderbufferStorageMultisample_remap_index 153 -#define FlushMappedBufferRange_remap_index 154 -#define MapBufferRange_remap_index 155 -#define BindVertexArray_remap_index 156 -#define GenVertexArrays_remap_index 157 -#define CopyBufferSubData_remap_index 158 -#define ClientWaitSync_remap_index 159 -#define DeleteSync_remap_index 160 -#define FenceSync_remap_index 161 -#define GetInteger64v_remap_index 162 -#define GetSynciv_remap_index 163 -#define IsSync_remap_index 164 -#define WaitSync_remap_index 165 -#define DrawElementsBaseVertex_remap_index 166 -#define DrawRangeElementsBaseVertex_remap_index 167 -#define MultiDrawElementsBaseVertex_remap_index 168 -#define PolygonOffsetEXT_remap_index 169 -#define GetPixelTexGenParameterfvSGIS_remap_index 170 -#define GetPixelTexGenParameterivSGIS_remap_index 171 -#define PixelTexGenParameterfSGIS_remap_index 172 -#define PixelTexGenParameterfvSGIS_remap_index 173 -#define PixelTexGenParameteriSGIS_remap_index 174 -#define PixelTexGenParameterivSGIS_remap_index 175 -#define SampleMaskSGIS_remap_index 176 -#define SamplePatternSGIS_remap_index 177 -#define ColorPointerEXT_remap_index 178 -#define EdgeFlagPointerEXT_remap_index 179 -#define IndexPointerEXT_remap_index 180 -#define NormalPointerEXT_remap_index 181 -#define TexCoordPointerEXT_remap_index 182 -#define VertexPointerEXT_remap_index 183 -#define PointParameterfEXT_remap_index 184 -#define PointParameterfvEXT_remap_index 185 -#define LockArraysEXT_remap_index 186 -#define UnlockArraysEXT_remap_index 187 -#define CullParameterdvEXT_remap_index 188 -#define CullParameterfvEXT_remap_index 189 -#define SecondaryColor3bEXT_remap_index 190 -#define SecondaryColor3bvEXT_remap_index 191 -#define SecondaryColor3dEXT_remap_index 192 -#define SecondaryColor3dvEXT_remap_index 193 -#define SecondaryColor3fEXT_remap_index 194 -#define SecondaryColor3fvEXT_remap_index 195 -#define SecondaryColor3iEXT_remap_index 196 -#define SecondaryColor3ivEXT_remap_index 197 -#define SecondaryColor3sEXT_remap_index 198 -#define SecondaryColor3svEXT_remap_index 199 -#define SecondaryColor3ubEXT_remap_index 200 -#define SecondaryColor3ubvEXT_remap_index 201 -#define SecondaryColor3uiEXT_remap_index 202 -#define SecondaryColor3uivEXT_remap_index 203 -#define SecondaryColor3usEXT_remap_index 204 -#define SecondaryColor3usvEXT_remap_index 205 -#define SecondaryColorPointerEXT_remap_index 206 -#define MultiDrawArraysEXT_remap_index 207 -#define MultiDrawElementsEXT_remap_index 208 -#define FogCoordPointerEXT_remap_index 209 -#define FogCoorddEXT_remap_index 210 -#define FogCoorddvEXT_remap_index 211 -#define FogCoordfEXT_remap_index 212 -#define FogCoordfvEXT_remap_index 213 -#define PixelTexGenSGIX_remap_index 214 -#define BlendFuncSeparateEXT_remap_index 215 -#define FlushVertexArrayRangeNV_remap_index 216 -#define VertexArrayRangeNV_remap_index 217 -#define CombinerInputNV_remap_index 218 -#define CombinerOutputNV_remap_index 219 -#define CombinerParameterfNV_remap_index 220 -#define CombinerParameterfvNV_remap_index 221 -#define CombinerParameteriNV_remap_index 222 -#define CombinerParameterivNV_remap_index 223 -#define FinalCombinerInputNV_remap_index 224 -#define GetCombinerInputParameterfvNV_remap_index 225 -#define GetCombinerInputParameterivNV_remap_index 226 -#define GetCombinerOutputParameterfvNV_remap_index 227 -#define GetCombinerOutputParameterivNV_remap_index 228 -#define GetFinalCombinerInputParameterfvNV_remap_index 229 -#define GetFinalCombinerInputParameterivNV_remap_index 230 -#define ResizeBuffersMESA_remap_index 231 -#define WindowPos2dMESA_remap_index 232 -#define WindowPos2dvMESA_remap_index 233 -#define WindowPos2fMESA_remap_index 234 -#define WindowPos2fvMESA_remap_index 235 -#define WindowPos2iMESA_remap_index 236 -#define WindowPos2ivMESA_remap_index 237 -#define WindowPos2sMESA_remap_index 238 -#define WindowPos2svMESA_remap_index 239 -#define WindowPos3dMESA_remap_index 240 -#define WindowPos3dvMESA_remap_index 241 -#define WindowPos3fMESA_remap_index 242 -#define WindowPos3fvMESA_remap_index 243 -#define WindowPos3iMESA_remap_index 244 -#define WindowPos3ivMESA_remap_index 245 -#define WindowPos3sMESA_remap_index 246 -#define WindowPos3svMESA_remap_index 247 -#define WindowPos4dMESA_remap_index 248 -#define WindowPos4dvMESA_remap_index 249 -#define WindowPos4fMESA_remap_index 250 -#define WindowPos4fvMESA_remap_index 251 -#define WindowPos4iMESA_remap_index 252 -#define WindowPos4ivMESA_remap_index 253 -#define WindowPos4sMESA_remap_index 254 -#define WindowPos4svMESA_remap_index 255 -#define MultiModeDrawArraysIBM_remap_index 256 -#define MultiModeDrawElementsIBM_remap_index 257 -#define DeleteFencesNV_remap_index 258 -#define FinishFenceNV_remap_index 259 -#define GenFencesNV_remap_index 260 -#define GetFenceivNV_remap_index 261 -#define IsFenceNV_remap_index 262 -#define SetFenceNV_remap_index 263 -#define TestFenceNV_remap_index 264 -#define AreProgramsResidentNV_remap_index 265 -#define BindProgramNV_remap_index 266 -#define DeleteProgramsNV_remap_index 267 -#define ExecuteProgramNV_remap_index 268 -#define GenProgramsNV_remap_index 269 -#define GetProgramParameterdvNV_remap_index 270 -#define GetProgramParameterfvNV_remap_index 271 -#define GetProgramStringNV_remap_index 272 -#define GetProgramivNV_remap_index 273 -#define GetTrackMatrixivNV_remap_index 274 -#define GetVertexAttribPointervNV_remap_index 275 -#define GetVertexAttribdvNV_remap_index 276 -#define GetVertexAttribfvNV_remap_index 277 -#define GetVertexAttribivNV_remap_index 278 -#define IsProgramNV_remap_index 279 -#define LoadProgramNV_remap_index 280 -#define ProgramParameters4dvNV_remap_index 281 -#define ProgramParameters4fvNV_remap_index 282 -#define RequestResidentProgramsNV_remap_index 283 -#define TrackMatrixNV_remap_index 284 -#define VertexAttrib1dNV_remap_index 285 -#define VertexAttrib1dvNV_remap_index 286 -#define VertexAttrib1fNV_remap_index 287 -#define VertexAttrib1fvNV_remap_index 288 -#define VertexAttrib1sNV_remap_index 289 -#define VertexAttrib1svNV_remap_index 290 -#define VertexAttrib2dNV_remap_index 291 -#define VertexAttrib2dvNV_remap_index 292 -#define VertexAttrib2fNV_remap_index 293 -#define VertexAttrib2fvNV_remap_index 294 -#define VertexAttrib2sNV_remap_index 295 -#define VertexAttrib2svNV_remap_index 296 -#define VertexAttrib3dNV_remap_index 297 -#define VertexAttrib3dvNV_remap_index 298 -#define VertexAttrib3fNV_remap_index 299 -#define VertexAttrib3fvNV_remap_index 300 -#define VertexAttrib3sNV_remap_index 301 -#define VertexAttrib3svNV_remap_index 302 -#define VertexAttrib4dNV_remap_index 303 -#define VertexAttrib4dvNV_remap_index 304 -#define VertexAttrib4fNV_remap_index 305 -#define VertexAttrib4fvNV_remap_index 306 -#define VertexAttrib4sNV_remap_index 307 -#define VertexAttrib4svNV_remap_index 308 -#define VertexAttrib4ubNV_remap_index 309 -#define VertexAttrib4ubvNV_remap_index 310 -#define VertexAttribPointerNV_remap_index 311 -#define VertexAttribs1dvNV_remap_index 312 -#define VertexAttribs1fvNV_remap_index 313 -#define VertexAttribs1svNV_remap_index 314 -#define VertexAttribs2dvNV_remap_index 315 -#define VertexAttribs2fvNV_remap_index 316 -#define VertexAttribs2svNV_remap_index 317 -#define VertexAttribs3dvNV_remap_index 318 -#define VertexAttribs3fvNV_remap_index 319 -#define VertexAttribs3svNV_remap_index 320 -#define VertexAttribs4dvNV_remap_index 321 -#define VertexAttribs4fvNV_remap_index 322 -#define VertexAttribs4svNV_remap_index 323 -#define VertexAttribs4ubvNV_remap_index 324 -#define GetTexBumpParameterfvATI_remap_index 325 -#define GetTexBumpParameterivATI_remap_index 326 -#define TexBumpParameterfvATI_remap_index 327 -#define TexBumpParameterivATI_remap_index 328 -#define AlphaFragmentOp1ATI_remap_index 329 -#define AlphaFragmentOp2ATI_remap_index 330 -#define AlphaFragmentOp3ATI_remap_index 331 -#define BeginFragmentShaderATI_remap_index 332 -#define BindFragmentShaderATI_remap_index 333 -#define ColorFragmentOp1ATI_remap_index 334 -#define ColorFragmentOp2ATI_remap_index 335 -#define ColorFragmentOp3ATI_remap_index 336 -#define DeleteFragmentShaderATI_remap_index 337 -#define EndFragmentShaderATI_remap_index 338 -#define GenFragmentShadersATI_remap_index 339 -#define PassTexCoordATI_remap_index 340 -#define SampleMapATI_remap_index 341 -#define SetFragmentShaderConstantATI_remap_index 342 -#define PointParameteriNV_remap_index 343 -#define PointParameterivNV_remap_index 344 -#define ActiveStencilFaceEXT_remap_index 345 -#define BindVertexArrayAPPLE_remap_index 346 -#define DeleteVertexArraysAPPLE_remap_index 347 -#define GenVertexArraysAPPLE_remap_index 348 -#define IsVertexArrayAPPLE_remap_index 349 -#define GetProgramNamedParameterdvNV_remap_index 350 -#define GetProgramNamedParameterfvNV_remap_index 351 -#define ProgramNamedParameter4dNV_remap_index 352 -#define ProgramNamedParameter4dvNV_remap_index 353 -#define ProgramNamedParameter4fNV_remap_index 354 -#define ProgramNamedParameter4fvNV_remap_index 355 -#define DepthBoundsEXT_remap_index 356 -#define BlendEquationSeparateEXT_remap_index 357 -#define BindFramebufferEXT_remap_index 358 -#define BindRenderbufferEXT_remap_index 359 -#define CheckFramebufferStatusEXT_remap_index 360 -#define DeleteFramebuffersEXT_remap_index 361 -#define DeleteRenderbuffersEXT_remap_index 362 -#define FramebufferRenderbufferEXT_remap_index 363 -#define FramebufferTexture1DEXT_remap_index 364 -#define FramebufferTexture2DEXT_remap_index 365 -#define FramebufferTexture3DEXT_remap_index 366 -#define GenFramebuffersEXT_remap_index 367 -#define GenRenderbuffersEXT_remap_index 368 -#define GenerateMipmapEXT_remap_index 369 -#define GetFramebufferAttachmentParameterivEXT_remap_index 370 -#define GetRenderbufferParameterivEXT_remap_index 371 -#define IsFramebufferEXT_remap_index 372 -#define IsRenderbufferEXT_remap_index 373 -#define RenderbufferStorageEXT_remap_index 374 -#define BlitFramebufferEXT_remap_index 375 -#define BufferParameteriAPPLE_remap_index 376 -#define FlushMappedBufferRangeAPPLE_remap_index 377 -#define FramebufferTextureLayerEXT_remap_index 378 -#define ProvokingVertexEXT_remap_index 379 -#define GetTexParameterPointervAPPLE_remap_index 380 -#define TextureRangeAPPLE_remap_index 381 -#define StencilFuncSeparateATI_remap_index 382 -#define ProgramEnvParameters4fvEXT_remap_index 383 -#define ProgramLocalParameters4fvEXT_remap_index 384 -#define GetQueryObjecti64vEXT_remap_index 385 -#define GetQueryObjectui64vEXT_remap_index 386 - -#define CALL_AttachShader(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint)), driDispatchRemapTable[AttachShader_remap_index], parameters) -#define GET_AttachShader(disp) GET_by_offset(disp, driDispatchRemapTable[AttachShader_remap_index]) -#define SET_AttachShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AttachShader_remap_index], fn) -#define CALL_CreateProgram(disp, parameters) CALL_by_offset(disp, (GLuint (GLAPIENTRYP)(void)), driDispatchRemapTable[CreateProgram_remap_index], parameters) -#define GET_CreateProgram(disp) GET_by_offset(disp, driDispatchRemapTable[CreateProgram_remap_index]) -#define SET_CreateProgram(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CreateProgram_remap_index], fn) -#define CALL_CreateShader(disp, parameters) CALL_by_offset(disp, (GLuint (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[CreateShader_remap_index], parameters) -#define GET_CreateShader(disp) GET_by_offset(disp, driDispatchRemapTable[CreateShader_remap_index]) -#define SET_CreateShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CreateShader_remap_index], fn) -#define CALL_DeleteProgram(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[DeleteProgram_remap_index], parameters) -#define GET_DeleteProgram(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteProgram_remap_index]) -#define SET_DeleteProgram(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteProgram_remap_index], fn) -#define CALL_DeleteShader(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[DeleteShader_remap_index], parameters) -#define GET_DeleteShader(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteShader_remap_index]) -#define SET_DeleteShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteShader_remap_index], fn) -#define CALL_DetachShader(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint)), driDispatchRemapTable[DetachShader_remap_index], parameters) -#define GET_DetachShader(disp) GET_by_offset(disp, driDispatchRemapTable[DetachShader_remap_index]) -#define SET_DetachShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DetachShader_remap_index], fn) -#define CALL_GetAttachedShaders(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, GLsizei *, GLuint *)), driDispatchRemapTable[GetAttachedShaders_remap_index], parameters) -#define GET_GetAttachedShaders(disp) GET_by_offset(disp, driDispatchRemapTable[GetAttachedShaders_remap_index]) -#define SET_GetAttachedShaders(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetAttachedShaders_remap_index], fn) -#define CALL_GetProgramInfoLog(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, GLsizei *, GLchar *)), driDispatchRemapTable[GetProgramInfoLog_remap_index], parameters) -#define GET_GetProgramInfoLog(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramInfoLog_remap_index]) -#define SET_GetProgramInfoLog(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramInfoLog_remap_index], fn) -#define CALL_GetProgramiv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetProgramiv_remap_index], parameters) -#define GET_GetProgramiv(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramiv_remap_index]) -#define SET_GetProgramiv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramiv_remap_index], fn) -#define CALL_GetShaderInfoLog(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, GLsizei *, GLchar *)), driDispatchRemapTable[GetShaderInfoLog_remap_index], parameters) -#define GET_GetShaderInfoLog(disp) GET_by_offset(disp, driDispatchRemapTable[GetShaderInfoLog_remap_index]) -#define SET_GetShaderInfoLog(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetShaderInfoLog_remap_index], fn) -#define CALL_GetShaderiv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetShaderiv_remap_index], parameters) -#define GET_GetShaderiv(disp) GET_by_offset(disp, driDispatchRemapTable[GetShaderiv_remap_index]) -#define SET_GetShaderiv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetShaderiv_remap_index], fn) -#define CALL_IsProgram(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsProgram_remap_index], parameters) -#define GET_IsProgram(disp) GET_by_offset(disp, driDispatchRemapTable[IsProgram_remap_index]) -#define SET_IsProgram(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsProgram_remap_index], fn) -#define CALL_IsShader(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsShader_remap_index], parameters) -#define GET_IsShader(disp) GET_by_offset(disp, driDispatchRemapTable[IsShader_remap_index]) -#define SET_IsShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsShader_remap_index], fn) -#define CALL_StencilFuncSeparate(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint, GLuint)), driDispatchRemapTable[StencilFuncSeparate_remap_index], parameters) -#define GET_StencilFuncSeparate(disp) GET_by_offset(disp, driDispatchRemapTable[StencilFuncSeparate_remap_index]) -#define SET_StencilFuncSeparate(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StencilFuncSeparate_remap_index], fn) -#define CALL_StencilMaskSeparate(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[StencilMaskSeparate_remap_index], parameters) -#define GET_StencilMaskSeparate(disp) GET_by_offset(disp, driDispatchRemapTable[StencilMaskSeparate_remap_index]) -#define SET_StencilMaskSeparate(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StencilMaskSeparate_remap_index], fn) -#define CALL_StencilOpSeparate(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum)), driDispatchRemapTable[StencilOpSeparate_remap_index], parameters) -#define GET_StencilOpSeparate(disp) GET_by_offset(disp, driDispatchRemapTable[StencilOpSeparate_remap_index]) -#define SET_StencilOpSeparate(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StencilOpSeparate_remap_index], fn) -#define CALL_UniformMatrix2x3fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix2x3fv_remap_index], parameters) -#define GET_UniformMatrix2x3fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x3fv_remap_index]) -#define SET_UniformMatrix2x3fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x3fv_remap_index], fn) -#define CALL_UniformMatrix2x4fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix2x4fv_remap_index], parameters) -#define GET_UniformMatrix2x4fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x4fv_remap_index]) -#define SET_UniformMatrix2x4fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x4fv_remap_index], fn) -#define CALL_UniformMatrix3x2fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix3x2fv_remap_index], parameters) -#define GET_UniformMatrix3x2fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x2fv_remap_index]) -#define SET_UniformMatrix3x2fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x2fv_remap_index], fn) -#define CALL_UniformMatrix3x4fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix3x4fv_remap_index], parameters) -#define GET_UniformMatrix3x4fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x4fv_remap_index]) -#define SET_UniformMatrix3x4fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x4fv_remap_index], fn) -#define CALL_UniformMatrix4x2fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix4x2fv_remap_index], parameters) -#define GET_UniformMatrix4x2fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x2fv_remap_index]) -#define SET_UniformMatrix4x2fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x2fv_remap_index], fn) -#define CALL_UniformMatrix4x3fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix4x3fv_remap_index], parameters) -#define GET_UniformMatrix4x3fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x3fv_remap_index]) -#define SET_UniformMatrix4x3fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x3fv_remap_index], fn) -#define CALL_LoadTransposeMatrixdARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index], parameters) -#define GET_LoadTransposeMatrixdARB(disp) GET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index]) -#define SET_LoadTransposeMatrixdARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index], fn) -#define CALL_LoadTransposeMatrixfARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[LoadTransposeMatrixfARB_remap_index], parameters) -#define GET_LoadTransposeMatrixfARB(disp) GET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixfARB_remap_index]) -#define SET_LoadTransposeMatrixfARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixfARB_remap_index], fn) -#define CALL_MultTransposeMatrixdARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[MultTransposeMatrixdARB_remap_index], parameters) -#define GET_MultTransposeMatrixdARB(disp) GET_by_offset(disp, driDispatchRemapTable[MultTransposeMatrixdARB_remap_index]) -#define SET_MultTransposeMatrixdARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultTransposeMatrixdARB_remap_index], fn) -#define CALL_MultTransposeMatrixfARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[MultTransposeMatrixfARB_remap_index], parameters) -#define GET_MultTransposeMatrixfARB(disp) GET_by_offset(disp, driDispatchRemapTable[MultTransposeMatrixfARB_remap_index]) -#define SET_MultTransposeMatrixfARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultTransposeMatrixfARB_remap_index], fn) -#define CALL_SampleCoverageARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLclampf, GLboolean)), driDispatchRemapTable[SampleCoverageARB_remap_index], parameters) -#define GET_SampleCoverageARB(disp) GET_by_offset(disp, driDispatchRemapTable[SampleCoverageARB_remap_index]) -#define SET_SampleCoverageARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SampleCoverageARB_remap_index], fn) -#define CALL_CompressedTexImage1DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexImage1DARB_remap_index], parameters) -#define GET_CompressedTexImage1DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexImage1DARB_remap_index]) -#define SET_CompressedTexImage1DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexImage1DARB_remap_index], fn) -#define CALL_CompressedTexImage2DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexImage2DARB_remap_index], parameters) -#define GET_CompressedTexImage2DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexImage2DARB_remap_index]) -#define SET_CompressedTexImage2DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexImage2DARB_remap_index], fn) -#define CALL_CompressedTexImage3DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexImage3DARB_remap_index], parameters) -#define GET_CompressedTexImage3DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexImage3DARB_remap_index]) -#define SET_CompressedTexImage3DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexImage3DARB_remap_index], fn) -#define CALL_CompressedTexSubImage1DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexSubImage1DARB_remap_index], parameters) -#define GET_CompressedTexSubImage1DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage1DARB_remap_index]) -#define SET_CompressedTexSubImage1DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage1DARB_remap_index], fn) -#define CALL_CompressedTexSubImage2DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexSubImage2DARB_remap_index], parameters) -#define GET_CompressedTexSubImage2DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage2DARB_remap_index]) -#define SET_CompressedTexSubImage2DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage2DARB_remap_index], fn) -#define CALL_CompressedTexSubImage3DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexSubImage3DARB_remap_index], parameters) -#define GET_CompressedTexSubImage3DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage3DARB_remap_index]) -#define SET_CompressedTexSubImage3DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage3DARB_remap_index], fn) -#define CALL_GetCompressedTexImageARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLvoid *)), driDispatchRemapTable[GetCompressedTexImageARB_remap_index], parameters) -#define GET_GetCompressedTexImageARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetCompressedTexImageARB_remap_index]) -#define SET_GetCompressedTexImageARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetCompressedTexImageARB_remap_index], fn) -#define CALL_DisableVertexAttribArrayARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[DisableVertexAttribArrayARB_remap_index], parameters) -#define GET_DisableVertexAttribArrayARB(disp) GET_by_offset(disp, driDispatchRemapTable[DisableVertexAttribArrayARB_remap_index]) -#define SET_DisableVertexAttribArrayARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DisableVertexAttribArrayARB_remap_index], fn) -#define CALL_EnableVertexAttribArrayARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[EnableVertexAttribArrayARB_remap_index], parameters) -#define GET_EnableVertexAttribArrayARB(disp) GET_by_offset(disp, driDispatchRemapTable[EnableVertexAttribArrayARB_remap_index]) -#define SET_EnableVertexAttribArrayARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[EnableVertexAttribArrayARB_remap_index], fn) -#define CALL_GetProgramEnvParameterdvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLdouble *)), driDispatchRemapTable[GetProgramEnvParameterdvARB_remap_index], parameters) -#define GET_GetProgramEnvParameterdvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramEnvParameterdvARB_remap_index]) -#define SET_GetProgramEnvParameterdvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramEnvParameterdvARB_remap_index], fn) -#define CALL_GetProgramEnvParameterfvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLfloat *)), driDispatchRemapTable[GetProgramEnvParameterfvARB_remap_index], parameters) -#define GET_GetProgramEnvParameterfvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramEnvParameterfvARB_remap_index]) -#define SET_GetProgramEnvParameterfvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramEnvParameterfvARB_remap_index], fn) -#define CALL_GetProgramLocalParameterdvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLdouble *)), driDispatchRemapTable[GetProgramLocalParameterdvARB_remap_index], parameters) -#define GET_GetProgramLocalParameterdvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramLocalParameterdvARB_remap_index]) -#define SET_GetProgramLocalParameterdvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramLocalParameterdvARB_remap_index], fn) -#define CALL_GetProgramLocalParameterfvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLfloat *)), driDispatchRemapTable[GetProgramLocalParameterfvARB_remap_index], parameters) -#define GET_GetProgramLocalParameterfvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramLocalParameterfvARB_remap_index]) -#define SET_GetProgramLocalParameterfvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramLocalParameterfvARB_remap_index], fn) -#define CALL_GetProgramStringARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLvoid *)), driDispatchRemapTable[GetProgramStringARB_remap_index], parameters) -#define GET_GetProgramStringARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramStringARB_remap_index]) -#define SET_GetProgramStringARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramStringARB_remap_index], fn) -#define CALL_GetProgramivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetProgramivARB_remap_index], parameters) -#define GET_GetProgramivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramivARB_remap_index]) -#define SET_GetProgramivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramivARB_remap_index], fn) -#define CALL_GetVertexAttribdvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLdouble *)), driDispatchRemapTable[GetVertexAttribdvARB_remap_index], parameters) -#define GET_GetVertexAttribdvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribdvARB_remap_index]) -#define SET_GetVertexAttribdvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribdvARB_remap_index], fn) -#define CALL_GetVertexAttribfvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLfloat *)), driDispatchRemapTable[GetVertexAttribfvARB_remap_index], parameters) -#define GET_GetVertexAttribfvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribfvARB_remap_index]) -#define SET_GetVertexAttribfvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribfvARB_remap_index], fn) -#define CALL_GetVertexAttribivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetVertexAttribivARB_remap_index], parameters) -#define GET_GetVertexAttribivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribivARB_remap_index]) -#define SET_GetVertexAttribivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribivARB_remap_index], fn) -#define CALL_ProgramEnvParameter4dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[ProgramEnvParameter4dARB_remap_index], parameters) -#define GET_ProgramEnvParameter4dARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4dARB_remap_index]) -#define SET_ProgramEnvParameter4dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4dARB_remap_index], fn) -#define CALL_ProgramEnvParameter4dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLdouble *)), driDispatchRemapTable[ProgramEnvParameter4dvARB_remap_index], parameters) -#define GET_ProgramEnvParameter4dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4dvARB_remap_index]) -#define SET_ProgramEnvParameter4dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4dvARB_remap_index], fn) -#define CALL_ProgramEnvParameter4fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[ProgramEnvParameter4fARB_remap_index], parameters) -#define GET_ProgramEnvParameter4fARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4fARB_remap_index]) -#define SET_ProgramEnvParameter4fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4fARB_remap_index], fn) -#define CALL_ProgramEnvParameter4fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLfloat *)), driDispatchRemapTable[ProgramEnvParameter4fvARB_remap_index], parameters) -#define GET_ProgramEnvParameter4fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4fvARB_remap_index]) -#define SET_ProgramEnvParameter4fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4fvARB_remap_index], fn) -#define CALL_ProgramLocalParameter4dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[ProgramLocalParameter4dARB_remap_index], parameters) -#define GET_ProgramLocalParameter4dARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4dARB_remap_index]) -#define SET_ProgramLocalParameter4dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4dARB_remap_index], fn) -#define CALL_ProgramLocalParameter4dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLdouble *)), driDispatchRemapTable[ProgramLocalParameter4dvARB_remap_index], parameters) -#define GET_ProgramLocalParameter4dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4dvARB_remap_index]) -#define SET_ProgramLocalParameter4dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4dvARB_remap_index], fn) -#define CALL_ProgramLocalParameter4fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[ProgramLocalParameter4fARB_remap_index], parameters) -#define GET_ProgramLocalParameter4fARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4fARB_remap_index]) -#define SET_ProgramLocalParameter4fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4fARB_remap_index], fn) -#define CALL_ProgramLocalParameter4fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLfloat *)), driDispatchRemapTable[ProgramLocalParameter4fvARB_remap_index], parameters) -#define GET_ProgramLocalParameter4fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4fvARB_remap_index]) -#define SET_ProgramLocalParameter4fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4fvARB_remap_index], fn) -#define CALL_ProgramStringARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[ProgramStringARB_remap_index], parameters) -#define GET_ProgramStringARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramStringARB_remap_index]) -#define SET_ProgramStringARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramStringARB_remap_index], fn) -#define CALL_VertexAttrib1dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble)), driDispatchRemapTable[VertexAttrib1dARB_remap_index], parameters) -#define GET_VertexAttrib1dARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dARB_remap_index]) -#define SET_VertexAttrib1dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dARB_remap_index], fn) -#define CALL_VertexAttrib1dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib1dvARB_remap_index], parameters) -#define GET_VertexAttrib1dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dvARB_remap_index]) -#define SET_VertexAttrib1dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dvARB_remap_index], fn) -#define CALL_VertexAttrib1fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat)), driDispatchRemapTable[VertexAttrib1fARB_remap_index], parameters) -#define GET_VertexAttrib1fARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fARB_remap_index]) -#define SET_VertexAttrib1fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fARB_remap_index], fn) -#define CALL_VertexAttrib1fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib1fvARB_remap_index], parameters) -#define GET_VertexAttrib1fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fvARB_remap_index]) -#define SET_VertexAttrib1fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fvARB_remap_index], fn) -#define CALL_VertexAttrib1sARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort)), driDispatchRemapTable[VertexAttrib1sARB_remap_index], parameters) -#define GET_VertexAttrib1sARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1sARB_remap_index]) -#define SET_VertexAttrib1sARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1sARB_remap_index], fn) -#define CALL_VertexAttrib1svARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib1svARB_remap_index], parameters) -#define GET_VertexAttrib1svARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1svARB_remap_index]) -#define SET_VertexAttrib1svARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1svARB_remap_index], fn) -#define CALL_VertexAttrib2dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib2dARB_remap_index], parameters) -#define GET_VertexAttrib2dARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dARB_remap_index]) -#define SET_VertexAttrib2dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dARB_remap_index], fn) -#define CALL_VertexAttrib2dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib2dvARB_remap_index], parameters) -#define GET_VertexAttrib2dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dvARB_remap_index]) -#define SET_VertexAttrib2dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dvARB_remap_index], fn) -#define CALL_VertexAttrib2fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib2fARB_remap_index], parameters) -#define GET_VertexAttrib2fARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fARB_remap_index]) -#define SET_VertexAttrib2fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fARB_remap_index], fn) -#define CALL_VertexAttrib2fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib2fvARB_remap_index], parameters) -#define GET_VertexAttrib2fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fvARB_remap_index]) -#define SET_VertexAttrib2fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fvARB_remap_index], fn) -#define CALL_VertexAttrib2sARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib2sARB_remap_index], parameters) -#define GET_VertexAttrib2sARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2sARB_remap_index]) -#define SET_VertexAttrib2sARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2sARB_remap_index], fn) -#define CALL_VertexAttrib2svARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib2svARB_remap_index], parameters) -#define GET_VertexAttrib2svARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2svARB_remap_index]) -#define SET_VertexAttrib2svARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2svARB_remap_index], fn) -#define CALL_VertexAttrib3dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib3dARB_remap_index], parameters) -#define GET_VertexAttrib3dARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dARB_remap_index]) -#define SET_VertexAttrib3dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dARB_remap_index], fn) -#define CALL_VertexAttrib3dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib3dvARB_remap_index], parameters) -#define GET_VertexAttrib3dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dvARB_remap_index]) -#define SET_VertexAttrib3dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dvARB_remap_index], fn) -#define CALL_VertexAttrib3fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib3fARB_remap_index], parameters) -#define GET_VertexAttrib3fARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fARB_remap_index]) -#define SET_VertexAttrib3fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fARB_remap_index], fn) -#define CALL_VertexAttrib3fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib3fvARB_remap_index], parameters) -#define GET_VertexAttrib3fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fvARB_remap_index]) -#define SET_VertexAttrib3fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fvARB_remap_index], fn) -#define CALL_VertexAttrib3sARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib3sARB_remap_index], parameters) -#define GET_VertexAttrib3sARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3sARB_remap_index]) -#define SET_VertexAttrib3sARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3sARB_remap_index], fn) -#define CALL_VertexAttrib3svARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib3svARB_remap_index], parameters) -#define GET_VertexAttrib3svARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3svARB_remap_index]) -#define SET_VertexAttrib3svARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3svARB_remap_index], fn) -#define CALL_VertexAttrib4NbvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLbyte *)), driDispatchRemapTable[VertexAttrib4NbvARB_remap_index], parameters) -#define GET_VertexAttrib4NbvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NbvARB_remap_index]) -#define SET_VertexAttrib4NbvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NbvARB_remap_index], fn) -#define CALL_VertexAttrib4NivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLint *)), driDispatchRemapTable[VertexAttrib4NivARB_remap_index], parameters) -#define GET_VertexAttrib4NivARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NivARB_remap_index]) -#define SET_VertexAttrib4NivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NivARB_remap_index], fn) -#define CALL_VertexAttrib4NsvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib4NsvARB_remap_index], parameters) -#define GET_VertexAttrib4NsvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NsvARB_remap_index]) -#define SET_VertexAttrib4NsvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NsvARB_remap_index], fn) -#define CALL_VertexAttrib4NubARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLubyte, GLubyte, GLubyte, GLubyte)), driDispatchRemapTable[VertexAttrib4NubARB_remap_index], parameters) -#define GET_VertexAttrib4NubARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NubARB_remap_index]) -#define SET_VertexAttrib4NubARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NubARB_remap_index], fn) -#define CALL_VertexAttrib4NubvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLubyte *)), driDispatchRemapTable[VertexAttrib4NubvARB_remap_index], parameters) -#define GET_VertexAttrib4NubvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NubvARB_remap_index]) -#define SET_VertexAttrib4NubvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NubvARB_remap_index], fn) -#define CALL_VertexAttrib4NuivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLuint *)), driDispatchRemapTable[VertexAttrib4NuivARB_remap_index], parameters) -#define GET_VertexAttrib4NuivARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NuivARB_remap_index]) -#define SET_VertexAttrib4NuivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NuivARB_remap_index], fn) -#define CALL_VertexAttrib4NusvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLushort *)), driDispatchRemapTable[VertexAttrib4NusvARB_remap_index], parameters) -#define GET_VertexAttrib4NusvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NusvARB_remap_index]) -#define SET_VertexAttrib4NusvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NusvARB_remap_index], fn) -#define CALL_VertexAttrib4bvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLbyte *)), driDispatchRemapTable[VertexAttrib4bvARB_remap_index], parameters) -#define GET_VertexAttrib4bvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4bvARB_remap_index]) -#define SET_VertexAttrib4bvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4bvARB_remap_index], fn) -#define CALL_VertexAttrib4dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib4dARB_remap_index], parameters) -#define GET_VertexAttrib4dARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dARB_remap_index]) -#define SET_VertexAttrib4dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dARB_remap_index], fn) -#define CALL_VertexAttrib4dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib4dvARB_remap_index], parameters) -#define GET_VertexAttrib4dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dvARB_remap_index]) -#define SET_VertexAttrib4dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dvARB_remap_index], fn) -#define CALL_VertexAttrib4fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib4fARB_remap_index], parameters) -#define GET_VertexAttrib4fARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fARB_remap_index]) -#define SET_VertexAttrib4fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fARB_remap_index], fn) -#define CALL_VertexAttrib4fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib4fvARB_remap_index], parameters) -#define GET_VertexAttrib4fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fvARB_remap_index]) -#define SET_VertexAttrib4fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fvARB_remap_index], fn) -#define CALL_VertexAttrib4ivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLint *)), driDispatchRemapTable[VertexAttrib4ivARB_remap_index], parameters) -#define GET_VertexAttrib4ivARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ivARB_remap_index]) -#define SET_VertexAttrib4ivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ivARB_remap_index], fn) -#define CALL_VertexAttrib4sARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib4sARB_remap_index], parameters) -#define GET_VertexAttrib4sARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4sARB_remap_index]) -#define SET_VertexAttrib4sARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4sARB_remap_index], fn) -#define CALL_VertexAttrib4svARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib4svARB_remap_index], parameters) -#define GET_VertexAttrib4svARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4svARB_remap_index]) -#define SET_VertexAttrib4svARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4svARB_remap_index], fn) -#define CALL_VertexAttrib4ubvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLubyte *)), driDispatchRemapTable[VertexAttrib4ubvARB_remap_index], parameters) -#define GET_VertexAttrib4ubvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubvARB_remap_index]) -#define SET_VertexAttrib4ubvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubvARB_remap_index], fn) -#define CALL_VertexAttrib4uivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLuint *)), driDispatchRemapTable[VertexAttrib4uivARB_remap_index], parameters) -#define GET_VertexAttrib4uivARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4uivARB_remap_index]) -#define SET_VertexAttrib4uivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4uivARB_remap_index], fn) -#define CALL_VertexAttrib4usvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLushort *)), driDispatchRemapTable[VertexAttrib4usvARB_remap_index], parameters) -#define GET_VertexAttrib4usvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4usvARB_remap_index]) -#define SET_VertexAttrib4usvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4usvARB_remap_index], fn) -#define CALL_VertexAttribPointerARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *)), driDispatchRemapTable[VertexAttribPointerARB_remap_index], parameters) -#define GET_VertexAttribPointerARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribPointerARB_remap_index]) -#define SET_VertexAttribPointerARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribPointerARB_remap_index], fn) -#define CALL_BindBufferARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[BindBufferARB_remap_index], parameters) -#define GET_BindBufferARB(disp) GET_by_offset(disp, driDispatchRemapTable[BindBufferARB_remap_index]) -#define SET_BindBufferARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindBufferARB_remap_index], fn) -#define CALL_BufferDataARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizeiptrARB, const GLvoid *, GLenum)), driDispatchRemapTable[BufferDataARB_remap_index], parameters) -#define GET_BufferDataARB(disp) GET_by_offset(disp, driDispatchRemapTable[BufferDataARB_remap_index]) -#define SET_BufferDataARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BufferDataARB_remap_index], fn) -#define CALL_BufferSubDataARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *)), driDispatchRemapTable[BufferSubDataARB_remap_index], parameters) -#define GET_BufferSubDataARB(disp) GET_by_offset(disp, driDispatchRemapTable[BufferSubDataARB_remap_index]) -#define SET_BufferSubDataARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BufferSubDataARB_remap_index], fn) -#define CALL_DeleteBuffersARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteBuffersARB_remap_index], parameters) -#define GET_DeleteBuffersARB(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteBuffersARB_remap_index]) -#define SET_DeleteBuffersARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteBuffersARB_remap_index], fn) -#define CALL_GenBuffersARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenBuffersARB_remap_index], parameters) -#define GET_GenBuffersARB(disp) GET_by_offset(disp, driDispatchRemapTable[GenBuffersARB_remap_index]) -#define SET_GenBuffersARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenBuffersARB_remap_index], fn) -#define CALL_GetBufferParameterivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetBufferParameterivARB_remap_index], parameters) -#define GET_GetBufferParameterivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetBufferParameterivARB_remap_index]) -#define SET_GetBufferParameterivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetBufferParameterivARB_remap_index], fn) -#define CALL_GetBufferPointervARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLvoid **)), driDispatchRemapTable[GetBufferPointervARB_remap_index], parameters) -#define GET_GetBufferPointervARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetBufferPointervARB_remap_index]) -#define SET_GetBufferPointervARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetBufferPointervARB_remap_index], fn) -#define CALL_GetBufferSubDataARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *)), driDispatchRemapTable[GetBufferSubDataARB_remap_index], parameters) -#define GET_GetBufferSubDataARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetBufferSubDataARB_remap_index]) -#define SET_GetBufferSubDataARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetBufferSubDataARB_remap_index], fn) -#define CALL_IsBufferARB(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsBufferARB_remap_index], parameters) -#define GET_IsBufferARB(disp) GET_by_offset(disp, driDispatchRemapTable[IsBufferARB_remap_index]) -#define SET_IsBufferARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsBufferARB_remap_index], fn) -#define CALL_MapBufferARB(disp, parameters) CALL_by_offset(disp, (GLvoid * (GLAPIENTRYP)(GLenum, GLenum)), driDispatchRemapTable[MapBufferARB_remap_index], parameters) -#define GET_MapBufferARB(disp) GET_by_offset(disp, driDispatchRemapTable[MapBufferARB_remap_index]) -#define SET_MapBufferARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MapBufferARB_remap_index], fn) -#define CALL_UnmapBufferARB(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[UnmapBufferARB_remap_index], parameters) -#define GET_UnmapBufferARB(disp) GET_by_offset(disp, driDispatchRemapTable[UnmapBufferARB_remap_index]) -#define SET_UnmapBufferARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UnmapBufferARB_remap_index], fn) -#define CALL_BeginQueryARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[BeginQueryARB_remap_index], parameters) -#define GET_BeginQueryARB(disp) GET_by_offset(disp, driDispatchRemapTable[BeginQueryARB_remap_index]) -#define SET_BeginQueryARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BeginQueryARB_remap_index], fn) -#define CALL_DeleteQueriesARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteQueriesARB_remap_index], parameters) -#define GET_DeleteQueriesARB(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteQueriesARB_remap_index]) -#define SET_DeleteQueriesARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteQueriesARB_remap_index], fn) -#define CALL_EndQueryARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[EndQueryARB_remap_index], parameters) -#define GET_EndQueryARB(disp) GET_by_offset(disp, driDispatchRemapTable[EndQueryARB_remap_index]) -#define SET_EndQueryARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[EndQueryARB_remap_index], fn) -#define CALL_GenQueriesARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenQueriesARB_remap_index], parameters) -#define GET_GenQueriesARB(disp) GET_by_offset(disp, driDispatchRemapTable[GenQueriesARB_remap_index]) -#define SET_GenQueriesARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenQueriesARB_remap_index], fn) -#define CALL_GetQueryObjectivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetQueryObjectivARB_remap_index], parameters) -#define GET_GetQueryObjectivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjectivARB_remap_index]) -#define SET_GetQueryObjectivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjectivARB_remap_index], fn) -#define CALL_GetQueryObjectuivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLuint *)), driDispatchRemapTable[GetQueryObjectuivARB_remap_index], parameters) -#define GET_GetQueryObjectuivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjectuivARB_remap_index]) -#define SET_GetQueryObjectuivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjectuivARB_remap_index], fn) -#define CALL_GetQueryivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetQueryivARB_remap_index], parameters) -#define GET_GetQueryivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryivARB_remap_index]) -#define SET_GetQueryivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryivARB_remap_index], fn) -#define CALL_IsQueryARB(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsQueryARB_remap_index], parameters) -#define GET_IsQueryARB(disp) GET_by_offset(disp, driDispatchRemapTable[IsQueryARB_remap_index]) -#define SET_IsQueryARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsQueryARB_remap_index], fn) -#define CALL_AttachObjectARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLhandleARB)), driDispatchRemapTable[AttachObjectARB_remap_index], parameters) -#define GET_AttachObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[AttachObjectARB_remap_index]) -#define SET_AttachObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AttachObjectARB_remap_index], fn) -#define CALL_CompileShaderARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB)), driDispatchRemapTable[CompileShaderARB_remap_index], parameters) -#define GET_CompileShaderARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompileShaderARB_remap_index]) -#define SET_CompileShaderARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompileShaderARB_remap_index], fn) -#define CALL_CreateProgramObjectARB(disp, parameters) CALL_by_offset(disp, (GLhandleARB (GLAPIENTRYP)(void)), driDispatchRemapTable[CreateProgramObjectARB_remap_index], parameters) -#define GET_CreateProgramObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[CreateProgramObjectARB_remap_index]) -#define SET_CreateProgramObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CreateProgramObjectARB_remap_index], fn) -#define CALL_CreateShaderObjectARB(disp, parameters) CALL_by_offset(disp, (GLhandleARB (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[CreateShaderObjectARB_remap_index], parameters) -#define GET_CreateShaderObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[CreateShaderObjectARB_remap_index]) -#define SET_CreateShaderObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CreateShaderObjectARB_remap_index], fn) -#define CALL_DeleteObjectARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB)), driDispatchRemapTable[DeleteObjectARB_remap_index], parameters) -#define GET_DeleteObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteObjectARB_remap_index]) -#define SET_DeleteObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteObjectARB_remap_index], fn) -#define CALL_DetachObjectARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLhandleARB)), driDispatchRemapTable[DetachObjectARB_remap_index], parameters) -#define GET_DetachObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[DetachObjectARB_remap_index]) -#define SET_DetachObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DetachObjectARB_remap_index], fn) -#define CALL_GetActiveUniformARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *)), driDispatchRemapTable[GetActiveUniformARB_remap_index], parameters) -#define GET_GetActiveUniformARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetActiveUniformARB_remap_index]) -#define SET_GetActiveUniformARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetActiveUniformARB_remap_index], fn) -#define CALL_GetAttachedObjectsARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLsizei, GLsizei *, GLhandleARB *)), driDispatchRemapTable[GetAttachedObjectsARB_remap_index], parameters) -#define GET_GetAttachedObjectsARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetAttachedObjectsARB_remap_index]) -#define SET_GetAttachedObjectsARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetAttachedObjectsARB_remap_index], fn) -#define CALL_GetHandleARB(disp, parameters) CALL_by_offset(disp, (GLhandleARB (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[GetHandleARB_remap_index], parameters) -#define GET_GetHandleARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetHandleARB_remap_index]) -#define SET_GetHandleARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetHandleARB_remap_index], fn) -#define CALL_GetInfoLogARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLsizei, GLsizei *, GLcharARB *)), driDispatchRemapTable[GetInfoLogARB_remap_index], parameters) -#define GET_GetInfoLogARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetInfoLogARB_remap_index]) -#define SET_GetInfoLogARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetInfoLogARB_remap_index], fn) -#define CALL_GetObjectParameterfvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLenum, GLfloat *)), driDispatchRemapTable[GetObjectParameterfvARB_remap_index], parameters) -#define GET_GetObjectParameterfvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetObjectParameterfvARB_remap_index]) -#define SET_GetObjectParameterfvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetObjectParameterfvARB_remap_index], fn) -#define CALL_GetObjectParameterivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLenum, GLint *)), driDispatchRemapTable[GetObjectParameterivARB_remap_index], parameters) -#define GET_GetObjectParameterivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetObjectParameterivARB_remap_index]) -#define SET_GetObjectParameterivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetObjectParameterivARB_remap_index], fn) -#define CALL_GetShaderSourceARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLsizei, GLsizei *, GLcharARB *)), driDispatchRemapTable[GetShaderSourceARB_remap_index], parameters) -#define GET_GetShaderSourceARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetShaderSourceARB_remap_index]) -#define SET_GetShaderSourceARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetShaderSourceARB_remap_index], fn) -#define CALL_GetUniformLocationARB(disp, parameters) CALL_by_offset(disp, (GLint (GLAPIENTRYP)(GLhandleARB, const GLcharARB *)), driDispatchRemapTable[GetUniformLocationARB_remap_index], parameters) -#define GET_GetUniformLocationARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetUniformLocationARB_remap_index]) -#define SET_GetUniformLocationARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetUniformLocationARB_remap_index], fn) -#define CALL_GetUniformfvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLint, GLfloat *)), driDispatchRemapTable[GetUniformfvARB_remap_index], parameters) -#define GET_GetUniformfvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetUniformfvARB_remap_index]) -#define SET_GetUniformfvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetUniformfvARB_remap_index], fn) -#define CALL_GetUniformivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLint, GLint *)), driDispatchRemapTable[GetUniformivARB_remap_index], parameters) -#define GET_GetUniformivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetUniformivARB_remap_index]) -#define SET_GetUniformivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetUniformivARB_remap_index], fn) -#define CALL_LinkProgramARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB)), driDispatchRemapTable[LinkProgramARB_remap_index], parameters) -#define GET_LinkProgramARB(disp) GET_by_offset(disp, driDispatchRemapTable[LinkProgramARB_remap_index]) -#define SET_LinkProgramARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LinkProgramARB_remap_index], fn) -#define CALL_ShaderSourceARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLsizei, const GLcharARB **, const GLint *)), driDispatchRemapTable[ShaderSourceARB_remap_index], parameters) -#define GET_ShaderSourceARB(disp) GET_by_offset(disp, driDispatchRemapTable[ShaderSourceARB_remap_index]) -#define SET_ShaderSourceARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ShaderSourceARB_remap_index], fn) -#define CALL_Uniform1fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLfloat)), driDispatchRemapTable[Uniform1fARB_remap_index], parameters) -#define GET_Uniform1fARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform1fARB_remap_index]) -#define SET_Uniform1fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform1fARB_remap_index], fn) -#define CALL_Uniform1fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLfloat *)), driDispatchRemapTable[Uniform1fvARB_remap_index], parameters) -#define GET_Uniform1fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform1fvARB_remap_index]) -#define SET_Uniform1fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform1fvARB_remap_index], fn) -#define CALL_Uniform1iARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint)), driDispatchRemapTable[Uniform1iARB_remap_index], parameters) -#define GET_Uniform1iARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform1iARB_remap_index]) -#define SET_Uniform1iARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform1iARB_remap_index], fn) -#define CALL_Uniform1ivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLint *)), driDispatchRemapTable[Uniform1ivARB_remap_index], parameters) -#define GET_Uniform1ivARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform1ivARB_remap_index]) -#define SET_Uniform1ivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform1ivARB_remap_index], fn) -#define CALL_Uniform2fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLfloat, GLfloat)), driDispatchRemapTable[Uniform2fARB_remap_index], parameters) -#define GET_Uniform2fARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform2fARB_remap_index]) -#define SET_Uniform2fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform2fARB_remap_index], fn) -#define CALL_Uniform2fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLfloat *)), driDispatchRemapTable[Uniform2fvARB_remap_index], parameters) -#define GET_Uniform2fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform2fvARB_remap_index]) -#define SET_Uniform2fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform2fvARB_remap_index], fn) -#define CALL_Uniform2iARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint)), driDispatchRemapTable[Uniform2iARB_remap_index], parameters) -#define GET_Uniform2iARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform2iARB_remap_index]) -#define SET_Uniform2iARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform2iARB_remap_index], fn) -#define CALL_Uniform2ivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLint *)), driDispatchRemapTable[Uniform2ivARB_remap_index], parameters) -#define GET_Uniform2ivARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform2ivARB_remap_index]) -#define SET_Uniform2ivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform2ivARB_remap_index], fn) -#define CALL_Uniform3fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[Uniform3fARB_remap_index], parameters) -#define GET_Uniform3fARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform3fARB_remap_index]) -#define SET_Uniform3fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform3fARB_remap_index], fn) -#define CALL_Uniform3fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLfloat *)), driDispatchRemapTable[Uniform3fvARB_remap_index], parameters) -#define GET_Uniform3fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform3fvARB_remap_index]) -#define SET_Uniform3fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform3fvARB_remap_index], fn) -#define CALL_Uniform3iARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint, GLint)), driDispatchRemapTable[Uniform3iARB_remap_index], parameters) -#define GET_Uniform3iARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform3iARB_remap_index]) -#define SET_Uniform3iARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform3iARB_remap_index], fn) -#define CALL_Uniform3ivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLint *)), driDispatchRemapTable[Uniform3ivARB_remap_index], parameters) -#define GET_Uniform3ivARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform3ivARB_remap_index]) -#define SET_Uniform3ivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform3ivARB_remap_index], fn) -#define CALL_Uniform4fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[Uniform4fARB_remap_index], parameters) -#define GET_Uniform4fARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform4fARB_remap_index]) -#define SET_Uniform4fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform4fARB_remap_index], fn) -#define CALL_Uniform4fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLfloat *)), driDispatchRemapTable[Uniform4fvARB_remap_index], parameters) -#define GET_Uniform4fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform4fvARB_remap_index]) -#define SET_Uniform4fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform4fvARB_remap_index], fn) -#define CALL_Uniform4iARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint, GLint, GLint)), driDispatchRemapTable[Uniform4iARB_remap_index], parameters) -#define GET_Uniform4iARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform4iARB_remap_index]) -#define SET_Uniform4iARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform4iARB_remap_index], fn) -#define CALL_Uniform4ivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLint *)), driDispatchRemapTable[Uniform4ivARB_remap_index], parameters) -#define GET_Uniform4ivARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform4ivARB_remap_index]) -#define SET_Uniform4ivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform4ivARB_remap_index], fn) -#define CALL_UniformMatrix2fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix2fvARB_remap_index], parameters) -#define GET_UniformMatrix2fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix2fvARB_remap_index]) -#define SET_UniformMatrix2fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix2fvARB_remap_index], fn) -#define CALL_UniformMatrix3fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix3fvARB_remap_index], parameters) -#define GET_UniformMatrix3fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix3fvARB_remap_index]) -#define SET_UniformMatrix3fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix3fvARB_remap_index], fn) -#define CALL_UniformMatrix4fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix4fvARB_remap_index], parameters) -#define GET_UniformMatrix4fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix4fvARB_remap_index]) -#define SET_UniformMatrix4fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix4fvARB_remap_index], fn) -#define CALL_UseProgramObjectARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB)), driDispatchRemapTable[UseProgramObjectARB_remap_index], parameters) -#define GET_UseProgramObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[UseProgramObjectARB_remap_index]) -#define SET_UseProgramObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UseProgramObjectARB_remap_index], fn) -#define CALL_ValidateProgramARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB)), driDispatchRemapTable[ValidateProgramARB_remap_index], parameters) -#define GET_ValidateProgramARB(disp) GET_by_offset(disp, driDispatchRemapTable[ValidateProgramARB_remap_index]) -#define SET_ValidateProgramARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ValidateProgramARB_remap_index], fn) -#define CALL_BindAttribLocationARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLuint, const GLcharARB *)), driDispatchRemapTable[BindAttribLocationARB_remap_index], parameters) -#define GET_BindAttribLocationARB(disp) GET_by_offset(disp, driDispatchRemapTable[BindAttribLocationARB_remap_index]) -#define SET_BindAttribLocationARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindAttribLocationARB_remap_index], fn) -#define CALL_GetActiveAttribARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *)), driDispatchRemapTable[GetActiveAttribARB_remap_index], parameters) -#define GET_GetActiveAttribARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetActiveAttribARB_remap_index]) -#define SET_GetActiveAttribARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetActiveAttribARB_remap_index], fn) -#define CALL_GetAttribLocationARB(disp, parameters) CALL_by_offset(disp, (GLint (GLAPIENTRYP)(GLhandleARB, const GLcharARB *)), driDispatchRemapTable[GetAttribLocationARB_remap_index], parameters) -#define GET_GetAttribLocationARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetAttribLocationARB_remap_index]) -#define SET_GetAttribLocationARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetAttribLocationARB_remap_index], fn) -#define CALL_DrawBuffersARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLenum *)), driDispatchRemapTable[DrawBuffersARB_remap_index], parameters) -#define GET_DrawBuffersARB(disp) GET_by_offset(disp, driDispatchRemapTable[DrawBuffersARB_remap_index]) -#define SET_DrawBuffersARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DrawBuffersARB_remap_index], fn) -#define CALL_RenderbufferStorageMultisample(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, GLenum, GLsizei, GLsizei)), driDispatchRemapTable[RenderbufferStorageMultisample_remap_index], parameters) -#define GET_RenderbufferStorageMultisample(disp) GET_by_offset(disp, driDispatchRemapTable[RenderbufferStorageMultisample_remap_index]) -#define SET_RenderbufferStorageMultisample(disp, fn) SET_by_offset(disp, driDispatchRemapTable[RenderbufferStorageMultisample_remap_index], fn) -#define CALL_FlushMappedBufferRange(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLintptr, GLsizeiptr)), driDispatchRemapTable[FlushMappedBufferRange_remap_index], parameters) -#define GET_FlushMappedBufferRange(disp) GET_by_offset(disp, driDispatchRemapTable[FlushMappedBufferRange_remap_index]) -#define SET_FlushMappedBufferRange(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FlushMappedBufferRange_remap_index], fn) -#define CALL_MapBufferRange(disp, parameters) CALL_by_offset(disp, (GLvoid * (GLAPIENTRYP)(GLenum, GLintptr, GLsizeiptr, GLbitfield)), driDispatchRemapTable[MapBufferRange_remap_index], parameters) -#define GET_MapBufferRange(disp) GET_by_offset(disp, driDispatchRemapTable[MapBufferRange_remap_index]) -#define SET_MapBufferRange(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MapBufferRange_remap_index], fn) -#define CALL_BindVertexArray(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[BindVertexArray_remap_index], parameters) -#define GET_BindVertexArray(disp) GET_by_offset(disp, driDispatchRemapTable[BindVertexArray_remap_index]) -#define SET_BindVertexArray(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindVertexArray_remap_index], fn) -#define CALL_GenVertexArrays(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenVertexArrays_remap_index], parameters) -#define GET_GenVertexArrays(disp) GET_by_offset(disp, driDispatchRemapTable[GenVertexArrays_remap_index]) -#define SET_GenVertexArrays(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenVertexArrays_remap_index], fn) -#define CALL_CopyBufferSubData(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLintptr, GLintptr, GLsizeiptr)), driDispatchRemapTable[CopyBufferSubData_remap_index], parameters) -#define GET_CopyBufferSubData(disp) GET_by_offset(disp, driDispatchRemapTable[CopyBufferSubData_remap_index]) -#define SET_CopyBufferSubData(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CopyBufferSubData_remap_index], fn) -#define CALL_ClientWaitSync(disp, parameters) CALL_by_offset(disp, (GLenum (GLAPIENTRYP)(GLsync, GLbitfield, GLuint64)), driDispatchRemapTable[ClientWaitSync_remap_index], parameters) -#define GET_ClientWaitSync(disp) GET_by_offset(disp, driDispatchRemapTable[ClientWaitSync_remap_index]) -#define SET_ClientWaitSync(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ClientWaitSync_remap_index], fn) -#define CALL_DeleteSync(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsync)), driDispatchRemapTable[DeleteSync_remap_index], parameters) -#define GET_DeleteSync(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteSync_remap_index]) -#define SET_DeleteSync(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteSync_remap_index], fn) -#define CALL_FenceSync(disp, parameters) CALL_by_offset(disp, (GLsync (GLAPIENTRYP)(GLenum, GLbitfield)), driDispatchRemapTable[FenceSync_remap_index], parameters) -#define GET_FenceSync(disp) GET_by_offset(disp, driDispatchRemapTable[FenceSync_remap_index]) -#define SET_FenceSync(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FenceSync_remap_index], fn) -#define CALL_GetInteger64v(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint64 *)), driDispatchRemapTable[GetInteger64v_remap_index], parameters) -#define GET_GetInteger64v(disp) GET_by_offset(disp, driDispatchRemapTable[GetInteger64v_remap_index]) -#define SET_GetInteger64v(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetInteger64v_remap_index], fn) -#define CALL_GetSynciv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsync, GLenum, GLsizei, GLsizei *, GLint *)), driDispatchRemapTable[GetSynciv_remap_index], parameters) -#define GET_GetSynciv(disp) GET_by_offset(disp, driDispatchRemapTable[GetSynciv_remap_index]) -#define SET_GetSynciv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetSynciv_remap_index], fn) -#define CALL_IsSync(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLsync)), driDispatchRemapTable[IsSync_remap_index], parameters) -#define GET_IsSync(disp) GET_by_offset(disp, driDispatchRemapTable[IsSync_remap_index]) -#define SET_IsSync(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsSync_remap_index], fn) -#define CALL_WaitSync(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsync, GLbitfield, GLuint64)), driDispatchRemapTable[WaitSync_remap_index], parameters) -#define GET_WaitSync(disp) GET_by_offset(disp, driDispatchRemapTable[WaitSync_remap_index]) -#define SET_WaitSync(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WaitSync_remap_index], fn) -#define CALL_DrawElementsBaseVertex(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, GLenum, const GLvoid *, GLint)), driDispatchRemapTable[DrawElementsBaseVertex_remap_index], parameters) -#define GET_DrawElementsBaseVertex(disp) GET_by_offset(disp, driDispatchRemapTable[DrawElementsBaseVertex_remap_index]) -#define SET_DrawElementsBaseVertex(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DrawElementsBaseVertex_remap_index], fn) -#define CALL_DrawRangeElementsBaseVertex(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *, GLint)), driDispatchRemapTable[DrawRangeElementsBaseVertex_remap_index], parameters) -#define GET_DrawRangeElementsBaseVertex(disp) GET_by_offset(disp, driDispatchRemapTable[DrawRangeElementsBaseVertex_remap_index]) -#define SET_DrawRangeElementsBaseVertex(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DrawRangeElementsBaseVertex_remap_index], fn) -#define CALL_MultiDrawElementsBaseVertex(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLsizei *, GLenum, const GLvoid **, GLsizei, const GLint *)), driDispatchRemapTable[MultiDrawElementsBaseVertex_remap_index], parameters) -#define GET_MultiDrawElementsBaseVertex(disp) GET_by_offset(disp, driDispatchRemapTable[MultiDrawElementsBaseVertex_remap_index]) -#define SET_MultiDrawElementsBaseVertex(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultiDrawElementsBaseVertex_remap_index], fn) -#define CALL_PolygonOffsetEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat)), driDispatchRemapTable[PolygonOffsetEXT_remap_index], parameters) -#define GET_PolygonOffsetEXT(disp) GET_by_offset(disp, driDispatchRemapTable[PolygonOffsetEXT_remap_index]) -#define SET_PolygonOffsetEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PolygonOffsetEXT_remap_index], fn) -#define CALL_GetPixelTexGenParameterfvSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat *)), driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index], parameters) -#define GET_GetPixelTexGenParameterfvSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index]) -#define SET_GetPixelTexGenParameterfvSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index], fn) -#define CALL_GetPixelTexGenParameterivSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint *)), driDispatchRemapTable[GetPixelTexGenParameterivSGIS_remap_index], parameters) -#define GET_GetPixelTexGenParameterivSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[GetPixelTexGenParameterivSGIS_remap_index]) -#define SET_GetPixelTexGenParameterivSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetPixelTexGenParameterivSGIS_remap_index], fn) -#define CALL_PixelTexGenParameterfSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat)), driDispatchRemapTable[PixelTexGenParameterfSGIS_remap_index], parameters) -#define GET_PixelTexGenParameterfSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterfSGIS_remap_index]) -#define SET_PixelTexGenParameterfSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterfSGIS_remap_index], fn) -#define CALL_PixelTexGenParameterfvSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLfloat *)), driDispatchRemapTable[PixelTexGenParameterfvSGIS_remap_index], parameters) -#define GET_PixelTexGenParameterfvSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterfvSGIS_remap_index]) -#define SET_PixelTexGenParameterfvSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterfvSGIS_remap_index], fn) -#define CALL_PixelTexGenParameteriSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint)), driDispatchRemapTable[PixelTexGenParameteriSGIS_remap_index], parameters) -#define GET_PixelTexGenParameteriSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameteriSGIS_remap_index]) -#define SET_PixelTexGenParameteriSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameteriSGIS_remap_index], fn) -#define CALL_PixelTexGenParameterivSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLint *)), driDispatchRemapTable[PixelTexGenParameterivSGIS_remap_index], parameters) -#define GET_PixelTexGenParameterivSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterivSGIS_remap_index]) -#define SET_PixelTexGenParameterivSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterivSGIS_remap_index], fn) -#define CALL_SampleMaskSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLclampf, GLboolean)), driDispatchRemapTable[SampleMaskSGIS_remap_index], parameters) -#define GET_SampleMaskSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[SampleMaskSGIS_remap_index]) -#define SET_SampleMaskSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SampleMaskSGIS_remap_index], fn) -#define CALL_SamplePatternSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[SamplePatternSGIS_remap_index], parameters) -#define GET_SamplePatternSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[SamplePatternSGIS_remap_index]) -#define SET_SamplePatternSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SamplePatternSGIS_remap_index], fn) -#define CALL_ColorPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLenum, GLsizei, GLsizei, const GLvoid *)), driDispatchRemapTable[ColorPointerEXT_remap_index], parameters) -#define GET_ColorPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[ColorPointerEXT_remap_index]) -#define SET_ColorPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ColorPointerEXT_remap_index], fn) -#define CALL_EdgeFlagPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLsizei, const GLboolean *)), driDispatchRemapTable[EdgeFlagPointerEXT_remap_index], parameters) -#define GET_EdgeFlagPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[EdgeFlagPointerEXT_remap_index]) -#define SET_EdgeFlagPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[EdgeFlagPointerEXT_remap_index], fn) -#define CALL_IndexPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, GLsizei, const GLvoid *)), driDispatchRemapTable[IndexPointerEXT_remap_index], parameters) -#define GET_IndexPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[IndexPointerEXT_remap_index]) -#define SET_IndexPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IndexPointerEXT_remap_index], fn) -#define CALL_NormalPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, GLsizei, const GLvoid *)), driDispatchRemapTable[NormalPointerEXT_remap_index], parameters) -#define GET_NormalPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[NormalPointerEXT_remap_index]) -#define SET_NormalPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[NormalPointerEXT_remap_index], fn) -#define CALL_TexCoordPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLenum, GLsizei, GLsizei, const GLvoid *)), driDispatchRemapTable[TexCoordPointerEXT_remap_index], parameters) -#define GET_TexCoordPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[TexCoordPointerEXT_remap_index]) -#define SET_TexCoordPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TexCoordPointerEXT_remap_index], fn) -#define CALL_VertexPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLenum, GLsizei, GLsizei, const GLvoid *)), driDispatchRemapTable[VertexPointerEXT_remap_index], parameters) -#define GET_VertexPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[VertexPointerEXT_remap_index]) -#define SET_VertexPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexPointerEXT_remap_index], fn) -#define CALL_PointParameterfEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat)), driDispatchRemapTable[PointParameterfEXT_remap_index], parameters) -#define GET_PointParameterfEXT(disp) GET_by_offset(disp, driDispatchRemapTable[PointParameterfEXT_remap_index]) -#define SET_PointParameterfEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PointParameterfEXT_remap_index], fn) -#define CALL_PointParameterfvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLfloat *)), driDispatchRemapTable[PointParameterfvEXT_remap_index], parameters) -#define GET_PointParameterfvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[PointParameterfvEXT_remap_index]) -#define SET_PointParameterfvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PointParameterfvEXT_remap_index], fn) -#define CALL_LockArraysEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei)), driDispatchRemapTable[LockArraysEXT_remap_index], parameters) -#define GET_LockArraysEXT(disp) GET_by_offset(disp, driDispatchRemapTable[LockArraysEXT_remap_index]) -#define SET_LockArraysEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LockArraysEXT_remap_index], fn) -#define CALL_UnlockArraysEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[UnlockArraysEXT_remap_index], parameters) -#define GET_UnlockArraysEXT(disp) GET_by_offset(disp, driDispatchRemapTable[UnlockArraysEXT_remap_index]) -#define SET_UnlockArraysEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UnlockArraysEXT_remap_index], fn) -#define CALL_CullParameterdvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLdouble *)), driDispatchRemapTable[CullParameterdvEXT_remap_index], parameters) -#define GET_CullParameterdvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[CullParameterdvEXT_remap_index]) -#define SET_CullParameterdvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CullParameterdvEXT_remap_index], fn) -#define CALL_CullParameterfvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat *)), driDispatchRemapTable[CullParameterfvEXT_remap_index], parameters) -#define GET_CullParameterfvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[CullParameterfvEXT_remap_index]) -#define SET_CullParameterfvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CullParameterfvEXT_remap_index], fn) -#define CALL_SecondaryColor3bEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLbyte, GLbyte, GLbyte)), driDispatchRemapTable[SecondaryColor3bEXT_remap_index], parameters) -#define GET_SecondaryColor3bEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3bEXT_remap_index]) -#define SET_SecondaryColor3bEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3bEXT_remap_index], fn) -#define CALL_SecondaryColor3bvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLbyte *)), driDispatchRemapTable[SecondaryColor3bvEXT_remap_index], parameters) -#define GET_SecondaryColor3bvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3bvEXT_remap_index]) -#define SET_SecondaryColor3bvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3bvEXT_remap_index], fn) -#define CALL_SecondaryColor3dEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[SecondaryColor3dEXT_remap_index], parameters) -#define GET_SecondaryColor3dEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3dEXT_remap_index]) -#define SET_SecondaryColor3dEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3dEXT_remap_index], fn) -#define CALL_SecondaryColor3dvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[SecondaryColor3dvEXT_remap_index], parameters) -#define GET_SecondaryColor3dvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3dvEXT_remap_index]) -#define SET_SecondaryColor3dvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3dvEXT_remap_index], fn) -#define CALL_SecondaryColor3fEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[SecondaryColor3fEXT_remap_index], parameters) -#define GET_SecondaryColor3fEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3fEXT_remap_index]) -#define SET_SecondaryColor3fEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3fEXT_remap_index], fn) -#define CALL_SecondaryColor3fvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[SecondaryColor3fvEXT_remap_index], parameters) -#define GET_SecondaryColor3fvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3fvEXT_remap_index]) -#define SET_SecondaryColor3fvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3fvEXT_remap_index], fn) -#define CALL_SecondaryColor3iEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint)), driDispatchRemapTable[SecondaryColor3iEXT_remap_index], parameters) -#define GET_SecondaryColor3iEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3iEXT_remap_index]) -#define SET_SecondaryColor3iEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3iEXT_remap_index], fn) -#define CALL_SecondaryColor3ivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLint *)), driDispatchRemapTable[SecondaryColor3ivEXT_remap_index], parameters) -#define GET_SecondaryColor3ivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ivEXT_remap_index]) -#define SET_SecondaryColor3ivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ivEXT_remap_index], fn) -#define CALL_SecondaryColor3sEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLshort, GLshort, GLshort)), driDispatchRemapTable[SecondaryColor3sEXT_remap_index], parameters) -#define GET_SecondaryColor3sEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3sEXT_remap_index]) -#define SET_SecondaryColor3sEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3sEXT_remap_index], fn) -#define CALL_SecondaryColor3svEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLshort *)), driDispatchRemapTable[SecondaryColor3svEXT_remap_index], parameters) -#define GET_SecondaryColor3svEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3svEXT_remap_index]) -#define SET_SecondaryColor3svEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3svEXT_remap_index], fn) -#define CALL_SecondaryColor3ubEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLubyte, GLubyte, GLubyte)), driDispatchRemapTable[SecondaryColor3ubEXT_remap_index], parameters) -#define GET_SecondaryColor3ubEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ubEXT_remap_index]) -#define SET_SecondaryColor3ubEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ubEXT_remap_index], fn) -#define CALL_SecondaryColor3ubvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLubyte *)), driDispatchRemapTable[SecondaryColor3ubvEXT_remap_index], parameters) -#define GET_SecondaryColor3ubvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ubvEXT_remap_index]) -#define SET_SecondaryColor3ubvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ubvEXT_remap_index], fn) -#define CALL_SecondaryColor3uiEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint, GLuint)), driDispatchRemapTable[SecondaryColor3uiEXT_remap_index], parameters) -#define GET_SecondaryColor3uiEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3uiEXT_remap_index]) -#define SET_SecondaryColor3uiEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3uiEXT_remap_index], fn) -#define CALL_SecondaryColor3uivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLuint *)), driDispatchRemapTable[SecondaryColor3uivEXT_remap_index], parameters) -#define GET_SecondaryColor3uivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3uivEXT_remap_index]) -#define SET_SecondaryColor3uivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3uivEXT_remap_index], fn) -#define CALL_SecondaryColor3usEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLushort, GLushort, GLushort)), driDispatchRemapTable[SecondaryColor3usEXT_remap_index], parameters) -#define GET_SecondaryColor3usEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3usEXT_remap_index]) -#define SET_SecondaryColor3usEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3usEXT_remap_index], fn) -#define CALL_SecondaryColor3usvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLushort *)), driDispatchRemapTable[SecondaryColor3usvEXT_remap_index], parameters) -#define GET_SecondaryColor3usvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3usvEXT_remap_index]) -#define SET_SecondaryColor3usvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3usvEXT_remap_index], fn) -#define CALL_SecondaryColorPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[SecondaryColorPointerEXT_remap_index], parameters) -#define GET_SecondaryColorPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColorPointerEXT_remap_index]) -#define SET_SecondaryColorPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColorPointerEXT_remap_index], fn) -#define CALL_MultiDrawArraysEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint *, GLsizei *, GLsizei)), driDispatchRemapTable[MultiDrawArraysEXT_remap_index], parameters) -#define GET_MultiDrawArraysEXT(disp) GET_by_offset(disp, driDispatchRemapTable[MultiDrawArraysEXT_remap_index]) -#define SET_MultiDrawArraysEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultiDrawArraysEXT_remap_index], fn) -#define CALL_MultiDrawElementsEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLsizei *, GLenum, const GLvoid **, GLsizei)), driDispatchRemapTable[MultiDrawElementsEXT_remap_index], parameters) -#define GET_MultiDrawElementsEXT(disp) GET_by_offset(disp, driDispatchRemapTable[MultiDrawElementsEXT_remap_index]) -#define SET_MultiDrawElementsEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultiDrawElementsEXT_remap_index], fn) -#define CALL_FogCoordPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[FogCoordPointerEXT_remap_index], parameters) -#define GET_FogCoordPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FogCoordPointerEXT_remap_index]) -#define SET_FogCoordPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FogCoordPointerEXT_remap_index], fn) -#define CALL_FogCoorddEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLdouble)), driDispatchRemapTable[FogCoorddEXT_remap_index], parameters) -#define GET_FogCoorddEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FogCoorddEXT_remap_index]) -#define SET_FogCoorddEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FogCoorddEXT_remap_index], fn) -#define CALL_FogCoorddvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[FogCoorddvEXT_remap_index], parameters) -#define GET_FogCoorddvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FogCoorddvEXT_remap_index]) -#define SET_FogCoorddvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FogCoorddvEXT_remap_index], fn) -#define CALL_FogCoordfEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat)), driDispatchRemapTable[FogCoordfEXT_remap_index], parameters) -#define GET_FogCoordfEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FogCoordfEXT_remap_index]) -#define SET_FogCoordfEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FogCoordfEXT_remap_index], fn) -#define CALL_FogCoordfvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[FogCoordfvEXT_remap_index], parameters) -#define GET_FogCoordfvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FogCoordfvEXT_remap_index]) -#define SET_FogCoordfvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FogCoordfvEXT_remap_index], fn) -#define CALL_PixelTexGenSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[PixelTexGenSGIX_remap_index], parameters) -#define GET_PixelTexGenSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenSGIX_remap_index]) -#define SET_PixelTexGenSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenSGIX_remap_index], fn) -#define CALL_BlendFuncSeparateEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum)), driDispatchRemapTable[BlendFuncSeparateEXT_remap_index], parameters) -#define GET_BlendFuncSeparateEXT(disp) GET_by_offset(disp, driDispatchRemapTable[BlendFuncSeparateEXT_remap_index]) -#define SET_BlendFuncSeparateEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BlendFuncSeparateEXT_remap_index], fn) -#define CALL_FlushVertexArrayRangeNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[FlushVertexArrayRangeNV_remap_index], parameters) -#define GET_FlushVertexArrayRangeNV(disp) GET_by_offset(disp, driDispatchRemapTable[FlushVertexArrayRangeNV_remap_index]) -#define SET_FlushVertexArrayRangeNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FlushVertexArrayRangeNV_remap_index], fn) -#define CALL_VertexArrayRangeNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLvoid *)), driDispatchRemapTable[VertexArrayRangeNV_remap_index], parameters) -#define GET_VertexArrayRangeNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexArrayRangeNV_remap_index]) -#define SET_VertexArrayRangeNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexArrayRangeNV_remap_index], fn) -#define CALL_CombinerInputNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum, GLenum, GLenum)), driDispatchRemapTable[CombinerInputNV_remap_index], parameters) -#define GET_CombinerInputNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerInputNV_remap_index]) -#define SET_CombinerInputNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerInputNV_remap_index], fn) -#define CALL_CombinerOutputNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean)), driDispatchRemapTable[CombinerOutputNV_remap_index], parameters) -#define GET_CombinerOutputNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerOutputNV_remap_index]) -#define SET_CombinerOutputNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerOutputNV_remap_index], fn) -#define CALL_CombinerParameterfNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat)), driDispatchRemapTable[CombinerParameterfNV_remap_index], parameters) -#define GET_CombinerParameterfNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerParameterfNV_remap_index]) -#define SET_CombinerParameterfNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerParameterfNV_remap_index], fn) -#define CALL_CombinerParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLfloat *)), driDispatchRemapTable[CombinerParameterfvNV_remap_index], parameters) -#define GET_CombinerParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerParameterfvNV_remap_index]) -#define SET_CombinerParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerParameterfvNV_remap_index], fn) -#define CALL_CombinerParameteriNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint)), driDispatchRemapTable[CombinerParameteriNV_remap_index], parameters) -#define GET_CombinerParameteriNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerParameteriNV_remap_index]) -#define SET_CombinerParameteriNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerParameteriNV_remap_index], fn) -#define CALL_CombinerParameterivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLint *)), driDispatchRemapTable[CombinerParameterivNV_remap_index], parameters) -#define GET_CombinerParameterivNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerParameterivNV_remap_index]) -#define SET_CombinerParameterivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerParameterivNV_remap_index], fn) -#define CALL_FinalCombinerInputNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum)), driDispatchRemapTable[FinalCombinerInputNV_remap_index], parameters) -#define GET_FinalCombinerInputNV(disp) GET_by_offset(disp, driDispatchRemapTable[FinalCombinerInputNV_remap_index]) -#define SET_FinalCombinerInputNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FinalCombinerInputNV_remap_index], fn) -#define CALL_GetCombinerInputParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetCombinerInputParameterfvNV_remap_index], parameters) -#define GET_GetCombinerInputParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetCombinerInputParameterfvNV_remap_index]) -#define SET_GetCombinerInputParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetCombinerInputParameterfvNV_remap_index], fn) -#define CALL_GetCombinerInputParameterivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum, GLint *)), driDispatchRemapTable[GetCombinerInputParameterivNV_remap_index], parameters) -#define GET_GetCombinerInputParameterivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetCombinerInputParameterivNV_remap_index]) -#define SET_GetCombinerInputParameterivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetCombinerInputParameterivNV_remap_index], fn) -#define CALL_GetCombinerOutputParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetCombinerOutputParameterfvNV_remap_index], parameters) -#define GET_GetCombinerOutputParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetCombinerOutputParameterfvNV_remap_index]) -#define SET_GetCombinerOutputParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetCombinerOutputParameterfvNV_remap_index], fn) -#define CALL_GetCombinerOutputParameterivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLint *)), driDispatchRemapTable[GetCombinerOutputParameterivNV_remap_index], parameters) -#define GET_GetCombinerOutputParameterivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetCombinerOutputParameterivNV_remap_index]) -#define SET_GetCombinerOutputParameterivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetCombinerOutputParameterivNV_remap_index], fn) -#define CALL_GetFinalCombinerInputParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetFinalCombinerInputParameterfvNV_remap_index], parameters) -#define GET_GetFinalCombinerInputParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetFinalCombinerInputParameterfvNV_remap_index]) -#define SET_GetFinalCombinerInputParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetFinalCombinerInputParameterfvNV_remap_index], fn) -#define CALL_GetFinalCombinerInputParameterivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetFinalCombinerInputParameterivNV_remap_index], parameters) -#define GET_GetFinalCombinerInputParameterivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetFinalCombinerInputParameterivNV_remap_index]) -#define SET_GetFinalCombinerInputParameterivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetFinalCombinerInputParameterivNV_remap_index], fn) -#define CALL_ResizeBuffersMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[ResizeBuffersMESA_remap_index], parameters) -#define GET_ResizeBuffersMESA(disp) GET_by_offset(disp, driDispatchRemapTable[ResizeBuffersMESA_remap_index]) -#define SET_ResizeBuffersMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ResizeBuffersMESA_remap_index], fn) -#define CALL_WindowPos2dMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLdouble, GLdouble)), driDispatchRemapTable[WindowPos2dMESA_remap_index], parameters) -#define GET_WindowPos2dMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2dMESA_remap_index]) -#define SET_WindowPos2dMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2dMESA_remap_index], fn) -#define CALL_WindowPos2dvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[WindowPos2dvMESA_remap_index], parameters) -#define GET_WindowPos2dvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2dvMESA_remap_index]) -#define SET_WindowPos2dvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2dvMESA_remap_index], fn) -#define CALL_WindowPos2fMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat)), driDispatchRemapTable[WindowPos2fMESA_remap_index], parameters) -#define GET_WindowPos2fMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2fMESA_remap_index]) -#define SET_WindowPos2fMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2fMESA_remap_index], fn) -#define CALL_WindowPos2fvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[WindowPos2fvMESA_remap_index], parameters) -#define GET_WindowPos2fvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2fvMESA_remap_index]) -#define SET_WindowPos2fvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2fvMESA_remap_index], fn) -#define CALL_WindowPos2iMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint)), driDispatchRemapTable[WindowPos2iMESA_remap_index], parameters) -#define GET_WindowPos2iMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2iMESA_remap_index]) -#define SET_WindowPos2iMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2iMESA_remap_index], fn) -#define CALL_WindowPos2ivMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLint *)), driDispatchRemapTable[WindowPos2ivMESA_remap_index], parameters) -#define GET_WindowPos2ivMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2ivMESA_remap_index]) -#define SET_WindowPos2ivMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2ivMESA_remap_index], fn) -#define CALL_WindowPos2sMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLshort, GLshort)), driDispatchRemapTable[WindowPos2sMESA_remap_index], parameters) -#define GET_WindowPos2sMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2sMESA_remap_index]) -#define SET_WindowPos2sMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2sMESA_remap_index], fn) -#define CALL_WindowPos2svMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLshort *)), driDispatchRemapTable[WindowPos2svMESA_remap_index], parameters) -#define GET_WindowPos2svMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2svMESA_remap_index]) -#define SET_WindowPos2svMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2svMESA_remap_index], fn) -#define CALL_WindowPos3dMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[WindowPos3dMESA_remap_index], parameters) -#define GET_WindowPos3dMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3dMESA_remap_index]) -#define SET_WindowPos3dMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3dMESA_remap_index], fn) -#define CALL_WindowPos3dvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[WindowPos3dvMESA_remap_index], parameters) -#define GET_WindowPos3dvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3dvMESA_remap_index]) -#define SET_WindowPos3dvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3dvMESA_remap_index], fn) -#define CALL_WindowPos3fMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[WindowPos3fMESA_remap_index], parameters) -#define GET_WindowPos3fMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3fMESA_remap_index]) -#define SET_WindowPos3fMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3fMESA_remap_index], fn) -#define CALL_WindowPos3fvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[WindowPos3fvMESA_remap_index], parameters) -#define GET_WindowPos3fvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3fvMESA_remap_index]) -#define SET_WindowPos3fvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3fvMESA_remap_index], fn) -#define CALL_WindowPos3iMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint)), driDispatchRemapTable[WindowPos3iMESA_remap_index], parameters) -#define GET_WindowPos3iMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3iMESA_remap_index]) -#define SET_WindowPos3iMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3iMESA_remap_index], fn) -#define CALL_WindowPos3ivMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLint *)), driDispatchRemapTable[WindowPos3ivMESA_remap_index], parameters) -#define GET_WindowPos3ivMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3ivMESA_remap_index]) -#define SET_WindowPos3ivMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3ivMESA_remap_index], fn) -#define CALL_WindowPos3sMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLshort, GLshort, GLshort)), driDispatchRemapTable[WindowPos3sMESA_remap_index], parameters) -#define GET_WindowPos3sMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3sMESA_remap_index]) -#define SET_WindowPos3sMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3sMESA_remap_index], fn) -#define CALL_WindowPos3svMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLshort *)), driDispatchRemapTable[WindowPos3svMESA_remap_index], parameters) -#define GET_WindowPos3svMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3svMESA_remap_index]) -#define SET_WindowPos3svMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3svMESA_remap_index], fn) -#define CALL_WindowPos4dMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[WindowPos4dMESA_remap_index], parameters) -#define GET_WindowPos4dMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4dMESA_remap_index]) -#define SET_WindowPos4dMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4dMESA_remap_index], fn) -#define CALL_WindowPos4dvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[WindowPos4dvMESA_remap_index], parameters) -#define GET_WindowPos4dvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4dvMESA_remap_index]) -#define SET_WindowPos4dvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4dvMESA_remap_index], fn) -#define CALL_WindowPos4fMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[WindowPos4fMESA_remap_index], parameters) -#define GET_WindowPos4fMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4fMESA_remap_index]) -#define SET_WindowPos4fMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4fMESA_remap_index], fn) -#define CALL_WindowPos4fvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[WindowPos4fvMESA_remap_index], parameters) -#define GET_WindowPos4fvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4fvMESA_remap_index]) -#define SET_WindowPos4fvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4fvMESA_remap_index], fn) -#define CALL_WindowPos4iMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint, GLint)), driDispatchRemapTable[WindowPos4iMESA_remap_index], parameters) -#define GET_WindowPos4iMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4iMESA_remap_index]) -#define SET_WindowPos4iMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4iMESA_remap_index], fn) -#define CALL_WindowPos4ivMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLint *)), driDispatchRemapTable[WindowPos4ivMESA_remap_index], parameters) -#define GET_WindowPos4ivMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4ivMESA_remap_index]) -#define SET_WindowPos4ivMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4ivMESA_remap_index], fn) -#define CALL_WindowPos4sMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLshort, GLshort, GLshort, GLshort)), driDispatchRemapTable[WindowPos4sMESA_remap_index], parameters) -#define GET_WindowPos4sMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4sMESA_remap_index]) -#define SET_WindowPos4sMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4sMESA_remap_index], fn) -#define CALL_WindowPos4svMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLshort *)), driDispatchRemapTable[WindowPos4svMESA_remap_index], parameters) -#define GET_WindowPos4svMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4svMESA_remap_index]) -#define SET_WindowPos4svMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4svMESA_remap_index], fn) -#define CALL_MultiModeDrawArraysIBM(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint)), driDispatchRemapTable[MultiModeDrawArraysIBM_remap_index], parameters) -#define GET_MultiModeDrawArraysIBM(disp) GET_by_offset(disp, driDispatchRemapTable[MultiModeDrawArraysIBM_remap_index]) -#define SET_MultiModeDrawArraysIBM(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultiModeDrawArraysIBM_remap_index], fn) -#define CALL_MultiModeDrawElementsIBM(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLenum *, const GLsizei *, GLenum, const GLvoid * const *, GLsizei, GLint)), driDispatchRemapTable[MultiModeDrawElementsIBM_remap_index], parameters) -#define GET_MultiModeDrawElementsIBM(disp) GET_by_offset(disp, driDispatchRemapTable[MultiModeDrawElementsIBM_remap_index]) -#define SET_MultiModeDrawElementsIBM(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultiModeDrawElementsIBM_remap_index], fn) -#define CALL_DeleteFencesNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteFencesNV_remap_index], parameters) -#define GET_DeleteFencesNV(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteFencesNV_remap_index]) -#define SET_DeleteFencesNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteFencesNV_remap_index], fn) -#define CALL_FinishFenceNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[FinishFenceNV_remap_index], parameters) -#define GET_FinishFenceNV(disp) GET_by_offset(disp, driDispatchRemapTable[FinishFenceNV_remap_index]) -#define SET_FinishFenceNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FinishFenceNV_remap_index], fn) -#define CALL_GenFencesNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenFencesNV_remap_index], parameters) -#define GET_GenFencesNV(disp) GET_by_offset(disp, driDispatchRemapTable[GenFencesNV_remap_index]) -#define SET_GenFencesNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenFencesNV_remap_index], fn) -#define CALL_GetFenceivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetFenceivNV_remap_index], parameters) -#define GET_GetFenceivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetFenceivNV_remap_index]) -#define SET_GetFenceivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetFenceivNV_remap_index], fn) -#define CALL_IsFenceNV(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsFenceNV_remap_index], parameters) -#define GET_IsFenceNV(disp) GET_by_offset(disp, driDispatchRemapTable[IsFenceNV_remap_index]) -#define SET_IsFenceNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsFenceNV_remap_index], fn) -#define CALL_SetFenceNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum)), driDispatchRemapTable[SetFenceNV_remap_index], parameters) -#define GET_SetFenceNV(disp) GET_by_offset(disp, driDispatchRemapTable[SetFenceNV_remap_index]) -#define SET_SetFenceNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SetFenceNV_remap_index], fn) -#define CALL_TestFenceNV(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[TestFenceNV_remap_index], parameters) -#define GET_TestFenceNV(disp) GET_by_offset(disp, driDispatchRemapTable[TestFenceNV_remap_index]) -#define SET_TestFenceNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TestFenceNV_remap_index], fn) -#define CALL_AreProgramsResidentNV(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLsizei, const GLuint *, GLboolean *)), driDispatchRemapTable[AreProgramsResidentNV_remap_index], parameters) -#define GET_AreProgramsResidentNV(disp) GET_by_offset(disp, driDispatchRemapTable[AreProgramsResidentNV_remap_index]) -#define SET_AreProgramsResidentNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AreProgramsResidentNV_remap_index], fn) -#define CALL_BindProgramNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[BindProgramNV_remap_index], parameters) -#define GET_BindProgramNV(disp) GET_by_offset(disp, driDispatchRemapTable[BindProgramNV_remap_index]) -#define SET_BindProgramNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindProgramNV_remap_index], fn) -#define CALL_DeleteProgramsNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteProgramsNV_remap_index], parameters) -#define GET_DeleteProgramsNV(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteProgramsNV_remap_index]) -#define SET_DeleteProgramsNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteProgramsNV_remap_index], fn) -#define CALL_ExecuteProgramNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLfloat *)), driDispatchRemapTable[ExecuteProgramNV_remap_index], parameters) -#define GET_ExecuteProgramNV(disp) GET_by_offset(disp, driDispatchRemapTable[ExecuteProgramNV_remap_index]) -#define SET_ExecuteProgramNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ExecuteProgramNV_remap_index], fn) -#define CALL_GenProgramsNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenProgramsNV_remap_index], parameters) -#define GET_GenProgramsNV(disp) GET_by_offset(disp, driDispatchRemapTable[GenProgramsNV_remap_index]) -#define SET_GenProgramsNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenProgramsNV_remap_index], fn) -#define CALL_GetProgramParameterdvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLenum, GLdouble *)), driDispatchRemapTable[GetProgramParameterdvNV_remap_index], parameters) -#define GET_GetProgramParameterdvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramParameterdvNV_remap_index]) -#define SET_GetProgramParameterdvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramParameterdvNV_remap_index], fn) -#define CALL_GetProgramParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLenum, GLfloat *)), driDispatchRemapTable[GetProgramParameterfvNV_remap_index], parameters) -#define GET_GetProgramParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramParameterfvNV_remap_index]) -#define SET_GetProgramParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramParameterfvNV_remap_index], fn) -#define CALL_GetProgramStringNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLubyte *)), driDispatchRemapTable[GetProgramStringNV_remap_index], parameters) -#define GET_GetProgramStringNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramStringNV_remap_index]) -#define SET_GetProgramStringNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramStringNV_remap_index], fn) -#define CALL_GetProgramivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetProgramivNV_remap_index], parameters) -#define GET_GetProgramivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramivNV_remap_index]) -#define SET_GetProgramivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramivNV_remap_index], fn) -#define CALL_GetTrackMatrixivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLenum, GLint *)), driDispatchRemapTable[GetTrackMatrixivNV_remap_index], parameters) -#define GET_GetTrackMatrixivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetTrackMatrixivNV_remap_index]) -#define SET_GetTrackMatrixivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetTrackMatrixivNV_remap_index], fn) -#define CALL_GetVertexAttribPointervNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLvoid **)), driDispatchRemapTable[GetVertexAttribPointervNV_remap_index], parameters) -#define GET_GetVertexAttribPointervNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribPointervNV_remap_index]) -#define SET_GetVertexAttribPointervNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribPointervNV_remap_index], fn) -#define CALL_GetVertexAttribdvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLdouble *)), driDispatchRemapTable[GetVertexAttribdvNV_remap_index], parameters) -#define GET_GetVertexAttribdvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribdvNV_remap_index]) -#define SET_GetVertexAttribdvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribdvNV_remap_index], fn) -#define CALL_GetVertexAttribfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLfloat *)), driDispatchRemapTable[GetVertexAttribfvNV_remap_index], parameters) -#define GET_GetVertexAttribfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribfvNV_remap_index]) -#define SET_GetVertexAttribfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribfvNV_remap_index], fn) -#define CALL_GetVertexAttribivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetVertexAttribivNV_remap_index], parameters) -#define GET_GetVertexAttribivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribivNV_remap_index]) -#define SET_GetVertexAttribivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribivNV_remap_index], fn) -#define CALL_IsProgramNV(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsProgramNV_remap_index], parameters) -#define GET_IsProgramNV(disp) GET_by_offset(disp, driDispatchRemapTable[IsProgramNV_remap_index]) -#define SET_IsProgramNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsProgramNV_remap_index], fn) -#define CALL_LoadProgramNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLsizei, const GLubyte *)), driDispatchRemapTable[LoadProgramNV_remap_index], parameters) -#define GET_LoadProgramNV(disp) GET_by_offset(disp, driDispatchRemapTable[LoadProgramNV_remap_index]) -#define SET_LoadProgramNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LoadProgramNV_remap_index], fn) -#define CALL_ProgramParameters4dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, const GLdouble *)), driDispatchRemapTable[ProgramParameters4dvNV_remap_index], parameters) -#define GET_ProgramParameters4dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramParameters4dvNV_remap_index]) -#define SET_ProgramParameters4dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramParameters4dvNV_remap_index], fn) -#define CALL_ProgramParameters4fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, const GLfloat *)), driDispatchRemapTable[ProgramParameters4fvNV_remap_index], parameters) -#define GET_ProgramParameters4fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramParameters4fvNV_remap_index]) -#define SET_ProgramParameters4fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramParameters4fvNV_remap_index], fn) -#define CALL_RequestResidentProgramsNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[RequestResidentProgramsNV_remap_index], parameters) -#define GET_RequestResidentProgramsNV(disp) GET_by_offset(disp, driDispatchRemapTable[RequestResidentProgramsNV_remap_index]) -#define SET_RequestResidentProgramsNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[RequestResidentProgramsNV_remap_index], fn) -#define CALL_TrackMatrixNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLenum, GLenum)), driDispatchRemapTable[TrackMatrixNV_remap_index], parameters) -#define GET_TrackMatrixNV(disp) GET_by_offset(disp, driDispatchRemapTable[TrackMatrixNV_remap_index]) -#define SET_TrackMatrixNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TrackMatrixNV_remap_index], fn) -#define CALL_VertexAttrib1dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble)), driDispatchRemapTable[VertexAttrib1dNV_remap_index], parameters) -#define GET_VertexAttrib1dNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dNV_remap_index]) -#define SET_VertexAttrib1dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dNV_remap_index], fn) -#define CALL_VertexAttrib1dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib1dvNV_remap_index], parameters) -#define GET_VertexAttrib1dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dvNV_remap_index]) -#define SET_VertexAttrib1dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dvNV_remap_index], fn) -#define CALL_VertexAttrib1fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat)), driDispatchRemapTable[VertexAttrib1fNV_remap_index], parameters) -#define GET_VertexAttrib1fNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fNV_remap_index]) -#define SET_VertexAttrib1fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fNV_remap_index], fn) -#define CALL_VertexAttrib1fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib1fvNV_remap_index], parameters) -#define GET_VertexAttrib1fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fvNV_remap_index]) -#define SET_VertexAttrib1fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fvNV_remap_index], fn) -#define CALL_VertexAttrib1sNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort)), driDispatchRemapTable[VertexAttrib1sNV_remap_index], parameters) -#define GET_VertexAttrib1sNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1sNV_remap_index]) -#define SET_VertexAttrib1sNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1sNV_remap_index], fn) -#define CALL_VertexAttrib1svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib1svNV_remap_index], parameters) -#define GET_VertexAttrib1svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1svNV_remap_index]) -#define SET_VertexAttrib1svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1svNV_remap_index], fn) -#define CALL_VertexAttrib2dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib2dNV_remap_index], parameters) -#define GET_VertexAttrib2dNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dNV_remap_index]) -#define SET_VertexAttrib2dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dNV_remap_index], fn) -#define CALL_VertexAttrib2dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib2dvNV_remap_index], parameters) -#define GET_VertexAttrib2dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dvNV_remap_index]) -#define SET_VertexAttrib2dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dvNV_remap_index], fn) -#define CALL_VertexAttrib2fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib2fNV_remap_index], parameters) -#define GET_VertexAttrib2fNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fNV_remap_index]) -#define SET_VertexAttrib2fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fNV_remap_index], fn) -#define CALL_VertexAttrib2fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib2fvNV_remap_index], parameters) -#define GET_VertexAttrib2fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fvNV_remap_index]) -#define SET_VertexAttrib2fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fvNV_remap_index], fn) -#define CALL_VertexAttrib2sNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib2sNV_remap_index], parameters) -#define GET_VertexAttrib2sNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2sNV_remap_index]) -#define SET_VertexAttrib2sNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2sNV_remap_index], fn) -#define CALL_VertexAttrib2svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib2svNV_remap_index], parameters) -#define GET_VertexAttrib2svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2svNV_remap_index]) -#define SET_VertexAttrib2svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2svNV_remap_index], fn) -#define CALL_VertexAttrib3dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib3dNV_remap_index], parameters) -#define GET_VertexAttrib3dNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dNV_remap_index]) -#define SET_VertexAttrib3dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dNV_remap_index], fn) -#define CALL_VertexAttrib3dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib3dvNV_remap_index], parameters) -#define GET_VertexAttrib3dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dvNV_remap_index]) -#define SET_VertexAttrib3dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dvNV_remap_index], fn) -#define CALL_VertexAttrib3fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib3fNV_remap_index], parameters) -#define GET_VertexAttrib3fNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fNV_remap_index]) -#define SET_VertexAttrib3fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fNV_remap_index], fn) -#define CALL_VertexAttrib3fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib3fvNV_remap_index], parameters) -#define GET_VertexAttrib3fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fvNV_remap_index]) -#define SET_VertexAttrib3fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fvNV_remap_index], fn) -#define CALL_VertexAttrib3sNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib3sNV_remap_index], parameters) -#define GET_VertexAttrib3sNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3sNV_remap_index]) -#define SET_VertexAttrib3sNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3sNV_remap_index], fn) -#define CALL_VertexAttrib3svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib3svNV_remap_index], parameters) -#define GET_VertexAttrib3svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3svNV_remap_index]) -#define SET_VertexAttrib3svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3svNV_remap_index], fn) -#define CALL_VertexAttrib4dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib4dNV_remap_index], parameters) -#define GET_VertexAttrib4dNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dNV_remap_index]) -#define SET_VertexAttrib4dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dNV_remap_index], fn) -#define CALL_VertexAttrib4dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib4dvNV_remap_index], parameters) -#define GET_VertexAttrib4dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dvNV_remap_index]) -#define SET_VertexAttrib4dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dvNV_remap_index], fn) -#define CALL_VertexAttrib4fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib4fNV_remap_index], parameters) -#define GET_VertexAttrib4fNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fNV_remap_index]) -#define SET_VertexAttrib4fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fNV_remap_index], fn) -#define CALL_VertexAttrib4fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib4fvNV_remap_index], parameters) -#define GET_VertexAttrib4fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fvNV_remap_index]) -#define SET_VertexAttrib4fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fvNV_remap_index], fn) -#define CALL_VertexAttrib4sNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib4sNV_remap_index], parameters) -#define GET_VertexAttrib4sNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4sNV_remap_index]) -#define SET_VertexAttrib4sNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4sNV_remap_index], fn) -#define CALL_VertexAttrib4svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib4svNV_remap_index], parameters) -#define GET_VertexAttrib4svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4svNV_remap_index]) -#define SET_VertexAttrib4svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4svNV_remap_index], fn) -#define CALL_VertexAttrib4ubNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLubyte, GLubyte, GLubyte, GLubyte)), driDispatchRemapTable[VertexAttrib4ubNV_remap_index], parameters) -#define GET_VertexAttrib4ubNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubNV_remap_index]) -#define SET_VertexAttrib4ubNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubNV_remap_index], fn) -#define CALL_VertexAttrib4ubvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLubyte *)), driDispatchRemapTable[VertexAttrib4ubvNV_remap_index], parameters) -#define GET_VertexAttrib4ubvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubvNV_remap_index]) -#define SET_VertexAttrib4ubvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubvNV_remap_index], fn) -#define CALL_VertexAttribPointerNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLint, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[VertexAttribPointerNV_remap_index], parameters) -#define GET_VertexAttribPointerNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribPointerNV_remap_index]) -#define SET_VertexAttribPointerNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribPointerNV_remap_index], fn) -#define CALL_VertexAttribs1dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLdouble *)), driDispatchRemapTable[VertexAttribs1dvNV_remap_index], parameters) -#define GET_VertexAttribs1dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs1dvNV_remap_index]) -#define SET_VertexAttribs1dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs1dvNV_remap_index], fn) -#define CALL_VertexAttribs1fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[VertexAttribs1fvNV_remap_index], parameters) -#define GET_VertexAttribs1fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs1fvNV_remap_index]) -#define SET_VertexAttribs1fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs1fvNV_remap_index], fn) -#define CALL_VertexAttribs1svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLshort *)), driDispatchRemapTable[VertexAttribs1svNV_remap_index], parameters) -#define GET_VertexAttribs1svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs1svNV_remap_index]) -#define SET_VertexAttribs1svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs1svNV_remap_index], fn) -#define CALL_VertexAttribs2dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLdouble *)), driDispatchRemapTable[VertexAttribs2dvNV_remap_index], parameters) -#define GET_VertexAttribs2dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs2dvNV_remap_index]) -#define SET_VertexAttribs2dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs2dvNV_remap_index], fn) -#define CALL_VertexAttribs2fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[VertexAttribs2fvNV_remap_index], parameters) -#define GET_VertexAttribs2fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs2fvNV_remap_index]) -#define SET_VertexAttribs2fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs2fvNV_remap_index], fn) -#define CALL_VertexAttribs2svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLshort *)), driDispatchRemapTable[VertexAttribs2svNV_remap_index], parameters) -#define GET_VertexAttribs2svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs2svNV_remap_index]) -#define SET_VertexAttribs2svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs2svNV_remap_index], fn) -#define CALL_VertexAttribs3dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLdouble *)), driDispatchRemapTable[VertexAttribs3dvNV_remap_index], parameters) -#define GET_VertexAttribs3dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs3dvNV_remap_index]) -#define SET_VertexAttribs3dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs3dvNV_remap_index], fn) -#define CALL_VertexAttribs3fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[VertexAttribs3fvNV_remap_index], parameters) -#define GET_VertexAttribs3fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs3fvNV_remap_index]) -#define SET_VertexAttribs3fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs3fvNV_remap_index], fn) -#define CALL_VertexAttribs3svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLshort *)), driDispatchRemapTable[VertexAttribs3svNV_remap_index], parameters) -#define GET_VertexAttribs3svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs3svNV_remap_index]) -#define SET_VertexAttribs3svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs3svNV_remap_index], fn) -#define CALL_VertexAttribs4dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLdouble *)), driDispatchRemapTable[VertexAttribs4dvNV_remap_index], parameters) -#define GET_VertexAttribs4dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs4dvNV_remap_index]) -#define SET_VertexAttribs4dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs4dvNV_remap_index], fn) -#define CALL_VertexAttribs4fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[VertexAttribs4fvNV_remap_index], parameters) -#define GET_VertexAttribs4fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs4fvNV_remap_index]) -#define SET_VertexAttribs4fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs4fvNV_remap_index], fn) -#define CALL_VertexAttribs4svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLshort *)), driDispatchRemapTable[VertexAttribs4svNV_remap_index], parameters) -#define GET_VertexAttribs4svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs4svNV_remap_index]) -#define SET_VertexAttribs4svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs4svNV_remap_index], fn) -#define CALL_VertexAttribs4ubvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *)), driDispatchRemapTable[VertexAttribs4ubvNV_remap_index], parameters) -#define GET_VertexAttribs4ubvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs4ubvNV_remap_index]) -#define SET_VertexAttribs4ubvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs4ubvNV_remap_index], fn) -#define CALL_GetTexBumpParameterfvATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat *)), driDispatchRemapTable[GetTexBumpParameterfvATI_remap_index], parameters) -#define GET_GetTexBumpParameterfvATI(disp) GET_by_offset(disp, driDispatchRemapTable[GetTexBumpParameterfvATI_remap_index]) -#define SET_GetTexBumpParameterfvATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetTexBumpParameterfvATI_remap_index], fn) -#define CALL_GetTexBumpParameterivATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint *)), driDispatchRemapTable[GetTexBumpParameterivATI_remap_index], parameters) -#define GET_GetTexBumpParameterivATI(disp) GET_by_offset(disp, driDispatchRemapTable[GetTexBumpParameterivATI_remap_index]) -#define SET_GetTexBumpParameterivATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetTexBumpParameterivATI_remap_index], fn) -#define CALL_TexBumpParameterfvATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLfloat *)), driDispatchRemapTable[TexBumpParameterfvATI_remap_index], parameters) -#define GET_TexBumpParameterfvATI(disp) GET_by_offset(disp, driDispatchRemapTable[TexBumpParameterfvATI_remap_index]) -#define SET_TexBumpParameterfvATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TexBumpParameterfvATI_remap_index], fn) -#define CALL_TexBumpParameterivATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLint *)), driDispatchRemapTable[TexBumpParameterivATI_remap_index], parameters) -#define GET_TexBumpParameterivATI(disp) GET_by_offset(disp, driDispatchRemapTable[TexBumpParameterivATI_remap_index]) -#define SET_TexBumpParameterivATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TexBumpParameterivATI_remap_index], fn) -#define CALL_AlphaFragmentOp1ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[AlphaFragmentOp1ATI_remap_index], parameters) -#define GET_AlphaFragmentOp1ATI(disp) GET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp1ATI_remap_index]) -#define SET_AlphaFragmentOp1ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp1ATI_remap_index], fn) -#define CALL_AlphaFragmentOp2ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[AlphaFragmentOp2ATI_remap_index], parameters) -#define GET_AlphaFragmentOp2ATI(disp) GET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp2ATI_remap_index]) -#define SET_AlphaFragmentOp2ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp2ATI_remap_index], fn) -#define CALL_AlphaFragmentOp3ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[AlphaFragmentOp3ATI_remap_index], parameters) -#define GET_AlphaFragmentOp3ATI(disp) GET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp3ATI_remap_index]) -#define SET_AlphaFragmentOp3ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp3ATI_remap_index], fn) -#define CALL_BeginFragmentShaderATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[BeginFragmentShaderATI_remap_index], parameters) -#define GET_BeginFragmentShaderATI(disp) GET_by_offset(disp, driDispatchRemapTable[BeginFragmentShaderATI_remap_index]) -#define SET_BeginFragmentShaderATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BeginFragmentShaderATI_remap_index], fn) -#define CALL_BindFragmentShaderATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[BindFragmentShaderATI_remap_index], parameters) -#define GET_BindFragmentShaderATI(disp) GET_by_offset(disp, driDispatchRemapTable[BindFragmentShaderATI_remap_index]) -#define SET_BindFragmentShaderATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindFragmentShaderATI_remap_index], fn) -#define CALL_ColorFragmentOp1ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[ColorFragmentOp1ATI_remap_index], parameters) -#define GET_ColorFragmentOp1ATI(disp) GET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp1ATI_remap_index]) -#define SET_ColorFragmentOp1ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp1ATI_remap_index], fn) -#define CALL_ColorFragmentOp2ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[ColorFragmentOp2ATI_remap_index], parameters) -#define GET_ColorFragmentOp2ATI(disp) GET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp2ATI_remap_index]) -#define SET_ColorFragmentOp2ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp2ATI_remap_index], fn) -#define CALL_ColorFragmentOp3ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[ColorFragmentOp3ATI_remap_index], parameters) -#define GET_ColorFragmentOp3ATI(disp) GET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp3ATI_remap_index]) -#define SET_ColorFragmentOp3ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp3ATI_remap_index], fn) -#define CALL_DeleteFragmentShaderATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[DeleteFragmentShaderATI_remap_index], parameters) -#define GET_DeleteFragmentShaderATI(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteFragmentShaderATI_remap_index]) -#define SET_DeleteFragmentShaderATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteFragmentShaderATI_remap_index], fn) -#define CALL_EndFragmentShaderATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[EndFragmentShaderATI_remap_index], parameters) -#define GET_EndFragmentShaderATI(disp) GET_by_offset(disp, driDispatchRemapTable[EndFragmentShaderATI_remap_index]) -#define SET_EndFragmentShaderATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[EndFragmentShaderATI_remap_index], fn) -#define CALL_GenFragmentShadersATI(disp, parameters) CALL_by_offset(disp, (GLuint (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[GenFragmentShadersATI_remap_index], parameters) -#define GET_GenFragmentShadersATI(disp) GET_by_offset(disp, driDispatchRemapTable[GenFragmentShadersATI_remap_index]) -#define SET_GenFragmentShadersATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenFragmentShadersATI_remap_index], fn) -#define CALL_PassTexCoordATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint, GLenum)), driDispatchRemapTable[PassTexCoordATI_remap_index], parameters) -#define GET_PassTexCoordATI(disp) GET_by_offset(disp, driDispatchRemapTable[PassTexCoordATI_remap_index]) -#define SET_PassTexCoordATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PassTexCoordATI_remap_index], fn) -#define CALL_SampleMapATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint, GLenum)), driDispatchRemapTable[SampleMapATI_remap_index], parameters) -#define GET_SampleMapATI(disp) GET_by_offset(disp, driDispatchRemapTable[SampleMapATI_remap_index]) -#define SET_SampleMapATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SampleMapATI_remap_index], fn) -#define CALL_SetFragmentShaderConstantATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[SetFragmentShaderConstantATI_remap_index], parameters) -#define GET_SetFragmentShaderConstantATI(disp) GET_by_offset(disp, driDispatchRemapTable[SetFragmentShaderConstantATI_remap_index]) -#define SET_SetFragmentShaderConstantATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SetFragmentShaderConstantATI_remap_index], fn) -#define CALL_PointParameteriNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint)), driDispatchRemapTable[PointParameteriNV_remap_index], parameters) -#define GET_PointParameteriNV(disp) GET_by_offset(disp, driDispatchRemapTable[PointParameteriNV_remap_index]) -#define SET_PointParameteriNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PointParameteriNV_remap_index], fn) -#define CALL_PointParameterivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLint *)), driDispatchRemapTable[PointParameterivNV_remap_index], parameters) -#define GET_PointParameterivNV(disp) GET_by_offset(disp, driDispatchRemapTable[PointParameterivNV_remap_index]) -#define SET_PointParameterivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PointParameterivNV_remap_index], fn) -#define CALL_ActiveStencilFaceEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[ActiveStencilFaceEXT_remap_index], parameters) -#define GET_ActiveStencilFaceEXT(disp) GET_by_offset(disp, driDispatchRemapTable[ActiveStencilFaceEXT_remap_index]) -#define SET_ActiveStencilFaceEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ActiveStencilFaceEXT_remap_index], fn) -#define CALL_BindVertexArrayAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[BindVertexArrayAPPLE_remap_index], parameters) -#define GET_BindVertexArrayAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[BindVertexArrayAPPLE_remap_index]) -#define SET_BindVertexArrayAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindVertexArrayAPPLE_remap_index], fn) -#define CALL_DeleteVertexArraysAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteVertexArraysAPPLE_remap_index], parameters) -#define GET_DeleteVertexArraysAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteVertexArraysAPPLE_remap_index]) -#define SET_DeleteVertexArraysAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteVertexArraysAPPLE_remap_index], fn) -#define CALL_GenVertexArraysAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenVertexArraysAPPLE_remap_index], parameters) -#define GET_GenVertexArraysAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[GenVertexArraysAPPLE_remap_index]) -#define SET_GenVertexArraysAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenVertexArraysAPPLE_remap_index], fn) -#define CALL_IsVertexArrayAPPLE(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsVertexArrayAPPLE_remap_index], parameters) -#define GET_IsVertexArrayAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[IsVertexArrayAPPLE_remap_index]) -#define SET_IsVertexArrayAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsVertexArrayAPPLE_remap_index], fn) -#define CALL_GetProgramNamedParameterdvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, GLdouble *)), driDispatchRemapTable[GetProgramNamedParameterdvNV_remap_index], parameters) -#define GET_GetProgramNamedParameterdvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramNamedParameterdvNV_remap_index]) -#define SET_GetProgramNamedParameterdvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramNamedParameterdvNV_remap_index], fn) -#define CALL_GetProgramNamedParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, GLfloat *)), driDispatchRemapTable[GetProgramNamedParameterfvNV_remap_index], parameters) -#define GET_GetProgramNamedParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramNamedParameterfvNV_remap_index]) -#define SET_GetProgramNamedParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramNamedParameterfvNV_remap_index], fn) -#define CALL_ProgramNamedParameter4dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[ProgramNamedParameter4dNV_remap_index], parameters) -#define GET_ProgramNamedParameter4dNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4dNV_remap_index]) -#define SET_ProgramNamedParameter4dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4dNV_remap_index], fn) -#define CALL_ProgramNamedParameter4dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, const GLdouble *)), driDispatchRemapTable[ProgramNamedParameter4dvNV_remap_index], parameters) -#define GET_ProgramNamedParameter4dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4dvNV_remap_index]) -#define SET_ProgramNamedParameter4dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4dvNV_remap_index], fn) -#define CALL_ProgramNamedParameter4fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[ProgramNamedParameter4fNV_remap_index], parameters) -#define GET_ProgramNamedParameter4fNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4fNV_remap_index]) -#define SET_ProgramNamedParameter4fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4fNV_remap_index], fn) -#define CALL_ProgramNamedParameter4fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, const GLfloat *)), driDispatchRemapTable[ProgramNamedParameter4fvNV_remap_index], parameters) -#define GET_ProgramNamedParameter4fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4fvNV_remap_index]) -#define SET_ProgramNamedParameter4fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4fvNV_remap_index], fn) -#define CALL_DepthBoundsEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLclampd, GLclampd)), driDispatchRemapTable[DepthBoundsEXT_remap_index], parameters) -#define GET_DepthBoundsEXT(disp) GET_by_offset(disp, driDispatchRemapTable[DepthBoundsEXT_remap_index]) -#define SET_DepthBoundsEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DepthBoundsEXT_remap_index], fn) -#define CALL_BlendEquationSeparateEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum)), driDispatchRemapTable[BlendEquationSeparateEXT_remap_index], parameters) -#define GET_BlendEquationSeparateEXT(disp) GET_by_offset(disp, driDispatchRemapTable[BlendEquationSeparateEXT_remap_index]) -#define SET_BlendEquationSeparateEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BlendEquationSeparateEXT_remap_index], fn) -#define CALL_BindFramebufferEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[BindFramebufferEXT_remap_index], parameters) -#define GET_BindFramebufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[BindFramebufferEXT_remap_index]) -#define SET_BindFramebufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindFramebufferEXT_remap_index], fn) -#define CALL_BindRenderbufferEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[BindRenderbufferEXT_remap_index], parameters) -#define GET_BindRenderbufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[BindRenderbufferEXT_remap_index]) -#define SET_BindRenderbufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindRenderbufferEXT_remap_index], fn) -#define CALL_CheckFramebufferStatusEXT(disp, parameters) CALL_by_offset(disp, (GLenum (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[CheckFramebufferStatusEXT_remap_index], parameters) -#define GET_CheckFramebufferStatusEXT(disp) GET_by_offset(disp, driDispatchRemapTable[CheckFramebufferStatusEXT_remap_index]) -#define SET_CheckFramebufferStatusEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CheckFramebufferStatusEXT_remap_index], fn) -#define CALL_DeleteFramebuffersEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteFramebuffersEXT_remap_index], parameters) -#define GET_DeleteFramebuffersEXT(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteFramebuffersEXT_remap_index]) -#define SET_DeleteFramebuffersEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteFramebuffersEXT_remap_index], fn) -#define CALL_DeleteRenderbuffersEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteRenderbuffersEXT_remap_index], parameters) -#define GET_DeleteRenderbuffersEXT(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteRenderbuffersEXT_remap_index]) -#define SET_DeleteRenderbuffersEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteRenderbuffersEXT_remap_index], fn) -#define CALL_FramebufferRenderbufferEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLuint)), driDispatchRemapTable[FramebufferRenderbufferEXT_remap_index], parameters) -#define GET_FramebufferRenderbufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FramebufferRenderbufferEXT_remap_index]) -#define SET_FramebufferRenderbufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FramebufferRenderbufferEXT_remap_index], fn) -#define CALL_FramebufferTexture1DEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLuint, GLint)), driDispatchRemapTable[FramebufferTexture1DEXT_remap_index], parameters) -#define GET_FramebufferTexture1DEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FramebufferTexture1DEXT_remap_index]) -#define SET_FramebufferTexture1DEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FramebufferTexture1DEXT_remap_index], fn) -#define CALL_FramebufferTexture2DEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLuint, GLint)), driDispatchRemapTable[FramebufferTexture2DEXT_remap_index], parameters) -#define GET_FramebufferTexture2DEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FramebufferTexture2DEXT_remap_index]) -#define SET_FramebufferTexture2DEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FramebufferTexture2DEXT_remap_index], fn) -#define CALL_FramebufferTexture3DEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLuint, GLint, GLint)), driDispatchRemapTable[FramebufferTexture3DEXT_remap_index], parameters) -#define GET_FramebufferTexture3DEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FramebufferTexture3DEXT_remap_index]) -#define SET_FramebufferTexture3DEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FramebufferTexture3DEXT_remap_index], fn) -#define CALL_GenFramebuffersEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenFramebuffersEXT_remap_index], parameters) -#define GET_GenFramebuffersEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GenFramebuffersEXT_remap_index]) -#define SET_GenFramebuffersEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenFramebuffersEXT_remap_index], fn) -#define CALL_GenRenderbuffersEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenRenderbuffersEXT_remap_index], parameters) -#define GET_GenRenderbuffersEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GenRenderbuffersEXT_remap_index]) -#define SET_GenRenderbuffersEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenRenderbuffersEXT_remap_index], fn) -#define CALL_GenerateMipmapEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[GenerateMipmapEXT_remap_index], parameters) -#define GET_GenerateMipmapEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GenerateMipmapEXT_remap_index]) -#define SET_GenerateMipmapEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenerateMipmapEXT_remap_index], fn) -#define CALL_GetFramebufferAttachmentParameterivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLint *)), driDispatchRemapTable[GetFramebufferAttachmentParameterivEXT_remap_index], parameters) -#define GET_GetFramebufferAttachmentParameterivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetFramebufferAttachmentParameterivEXT_remap_index]) -#define SET_GetFramebufferAttachmentParameterivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetFramebufferAttachmentParameterivEXT_remap_index], fn) -#define CALL_GetRenderbufferParameterivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetRenderbufferParameterivEXT_remap_index], parameters) -#define GET_GetRenderbufferParameterivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetRenderbufferParameterivEXT_remap_index]) -#define SET_GetRenderbufferParameterivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetRenderbufferParameterivEXT_remap_index], fn) -#define CALL_IsFramebufferEXT(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsFramebufferEXT_remap_index], parameters) -#define GET_IsFramebufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[IsFramebufferEXT_remap_index]) -#define SET_IsFramebufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsFramebufferEXT_remap_index], fn) -#define CALL_IsRenderbufferEXT(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsRenderbufferEXT_remap_index], parameters) -#define GET_IsRenderbufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[IsRenderbufferEXT_remap_index]) -#define SET_IsRenderbufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsRenderbufferEXT_remap_index], fn) -#define CALL_RenderbufferStorageEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLsizei, GLsizei)), driDispatchRemapTable[RenderbufferStorageEXT_remap_index], parameters) -#define GET_RenderbufferStorageEXT(disp) GET_by_offset(disp, driDispatchRemapTable[RenderbufferStorageEXT_remap_index]) -#define SET_RenderbufferStorageEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[RenderbufferStorageEXT_remap_index], fn) -#define CALL_BlitFramebufferEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum)), driDispatchRemapTable[BlitFramebufferEXT_remap_index], parameters) -#define GET_BlitFramebufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[BlitFramebufferEXT_remap_index]) -#define SET_BlitFramebufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BlitFramebufferEXT_remap_index], fn) -#define CALL_BufferParameteriAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint)), driDispatchRemapTable[BufferParameteriAPPLE_remap_index], parameters) -#define GET_BufferParameteriAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[BufferParameteriAPPLE_remap_index]) -#define SET_BufferParameteriAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BufferParameteriAPPLE_remap_index], fn) -#define CALL_FlushMappedBufferRangeAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLintptr, GLsizeiptr)), driDispatchRemapTable[FlushMappedBufferRangeAPPLE_remap_index], parameters) -#define GET_FlushMappedBufferRangeAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[FlushMappedBufferRangeAPPLE_remap_index]) -#define SET_FlushMappedBufferRangeAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FlushMappedBufferRangeAPPLE_remap_index], fn) -#define CALL_FramebufferTextureLayerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLuint, GLint, GLint)), driDispatchRemapTable[FramebufferTextureLayerEXT_remap_index], parameters) -#define GET_FramebufferTextureLayerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FramebufferTextureLayerEXT_remap_index]) -#define SET_FramebufferTextureLayerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FramebufferTextureLayerEXT_remap_index], fn) -#define CALL_ProvokingVertexEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[ProvokingVertexEXT_remap_index], parameters) -#define GET_ProvokingVertexEXT(disp) GET_by_offset(disp, driDispatchRemapTable[ProvokingVertexEXT_remap_index]) -#define SET_ProvokingVertexEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProvokingVertexEXT_remap_index], fn) -#define CALL_GetTexParameterPointervAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLvoid **)), driDispatchRemapTable[GetTexParameterPointervAPPLE_remap_index], parameters) -#define GET_GetTexParameterPointervAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[GetTexParameterPointervAPPLE_remap_index]) -#define SET_GetTexParameterPointervAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetTexParameterPointervAPPLE_remap_index], fn) -#define CALL_TextureRangeAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, GLvoid *)), driDispatchRemapTable[TextureRangeAPPLE_remap_index], parameters) -#define GET_TextureRangeAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[TextureRangeAPPLE_remap_index]) -#define SET_TextureRangeAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TextureRangeAPPLE_remap_index], fn) -#define CALL_StencilFuncSeparateATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint, GLuint)), driDispatchRemapTable[StencilFuncSeparateATI_remap_index], parameters) -#define GET_StencilFuncSeparateATI(disp) GET_by_offset(disp, driDispatchRemapTable[StencilFuncSeparateATI_remap_index]) -#define SET_StencilFuncSeparateATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StencilFuncSeparateATI_remap_index], fn) -#define CALL_ProgramEnvParameters4fvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[ProgramEnvParameters4fvEXT_remap_index], parameters) -#define GET_ProgramEnvParameters4fvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameters4fvEXT_remap_index]) -#define SET_ProgramEnvParameters4fvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameters4fvEXT_remap_index], fn) -#define CALL_ProgramLocalParameters4fvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index], parameters) -#define GET_ProgramLocalParameters4fvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index]) -#define SET_ProgramLocalParameters4fvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index], fn) -#define CALL_GetQueryObjecti64vEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint64EXT *)), driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index], parameters) -#define GET_GetQueryObjecti64vEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index]) -#define SET_GetQueryObjecti64vEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index], fn) -#define CALL_GetQueryObjectui64vEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLuint64EXT *)), driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index], parameters) -#define GET_GetQueryObjectui64vEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index]) -#define SET_GetQueryObjectui64vEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index], fn) - -#endif /* !defined(IN_DRI_DRIVER) */ +#include "glapidispatch.h" -#endif /* !defined( _DISPATCH_H_ ) */ +#endif /* _DISPATCH_H */ diff --git a/src/mesa/glapi/gl_table.py b/src/mesa/glapi/gl_table.py index 55a33748ae..6cf26f89db 100644 --- a/src/mesa/glapi/gl_table.py +++ b/src/mesa/glapi/gl_table.py @@ -71,7 +71,7 @@ class PrintRemapTable(gl_XML.gl_print_base): def __init__(self): gl_XML.gl_print_base.__init__(self) - self.header_tag = '_DISPATCH_H_' + self.header_tag = '_GLAPI_DISPATCH_H_' self.name = "gl_table.py (from Mesa)" self.license = license.bsd_license_template % ("(C) Copyright IBM Corporation 2005", "IBM") return @@ -79,9 +79,8 @@ class PrintRemapTable(gl_XML.gl_print_base): def printRealHeader(self): print """ -#include "glapitable.h" /** - * \\file dispatch.h + * \\file glapidispatch.h * Macros for handling GL dispatch tables. * * For each known GL function, there are 3 macros in this file. The first diff --git a/src/mesa/glapi/glapidispatch.h b/src/mesa/glapi/glapidispatch.h new file mode 100644 index 0000000000..1d26dfb5bf --- /dev/null +++ b/src/mesa/glapi/glapidispatch.h @@ -0,0 +1,4005 @@ +/* DO NOT EDIT - This file generated automatically by gl_table.py (from Mesa) script */ + +/* + * (C) Copyright IBM Corporation 2005 + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sub license, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * IBM, + * AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN 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. + */ + +#if !defined( _GLAPI_DISPATCH_H_ ) +# define _GLAPI_DISPATCH_H_ + + +/** + * \file glapidispatch.h + * Macros for handling GL dispatch tables. + * + * For each known GL function, there are 3 macros in this file. The first + * macro is named CALL_FuncName and is used to call that GL function using + * the specified dispatch table. The other 2 macros, called GET_FuncName + * can SET_FuncName, are used to get and set the dispatch pointer for the + * named function in the specified dispatch table. + */ + +#define CALL_by_offset(disp, cast, offset, parameters) \ + (*(cast (GET_by_offset(disp, offset)))) parameters +#define GET_by_offset(disp, offset) \ + (offset >= 0) ? (((_glapi_proc *)(disp))[offset]) : NULL +#define SET_by_offset(disp, offset, fn) \ + do { \ + if ( (offset) < 0 ) { \ + /* fprintf( stderr, "[%s:%u] SET_by_offset(%p, %d, %s)!\n", */ \ + /* __func__, __LINE__, disp, offset, # fn); */ \ + /* abort(); */ \ + } \ + else { \ + ( (_glapi_proc *) (disp) )[offset] = (_glapi_proc) fn; \ + } \ + } while(0) + +#define CALL_NewList(disp, parameters) (*((disp)->NewList)) parameters +#define GET_NewList(disp) ((disp)->NewList) +#define SET_NewList(disp, fn) ((disp)->NewList = fn) +#define CALL_EndList(disp, parameters) (*((disp)->EndList)) parameters +#define GET_EndList(disp) ((disp)->EndList) +#define SET_EndList(disp, fn) ((disp)->EndList = fn) +#define CALL_CallList(disp, parameters) (*((disp)->CallList)) parameters +#define GET_CallList(disp) ((disp)->CallList) +#define SET_CallList(disp, fn) ((disp)->CallList = fn) +#define CALL_CallLists(disp, parameters) (*((disp)->CallLists)) parameters +#define GET_CallLists(disp) ((disp)->CallLists) +#define SET_CallLists(disp, fn) ((disp)->CallLists = fn) +#define CALL_DeleteLists(disp, parameters) (*((disp)->DeleteLists)) parameters +#define GET_DeleteLists(disp) ((disp)->DeleteLists) +#define SET_DeleteLists(disp, fn) ((disp)->DeleteLists = fn) +#define CALL_GenLists(disp, parameters) (*((disp)->GenLists)) parameters +#define GET_GenLists(disp) ((disp)->GenLists) +#define SET_GenLists(disp, fn) ((disp)->GenLists = fn) +#define CALL_ListBase(disp, parameters) (*((disp)->ListBase)) parameters +#define GET_ListBase(disp) ((disp)->ListBase) +#define SET_ListBase(disp, fn) ((disp)->ListBase = fn) +#define CALL_Begin(disp, parameters) (*((disp)->Begin)) parameters +#define GET_Begin(disp) ((disp)->Begin) +#define SET_Begin(disp, fn) ((disp)->Begin = fn) +#define CALL_Bitmap(disp, parameters) (*((disp)->Bitmap)) parameters +#define GET_Bitmap(disp) ((disp)->Bitmap) +#define SET_Bitmap(disp, fn) ((disp)->Bitmap = fn) +#define CALL_Color3b(disp, parameters) (*((disp)->Color3b)) parameters +#define GET_Color3b(disp) ((disp)->Color3b) +#define SET_Color3b(disp, fn) ((disp)->Color3b = fn) +#define CALL_Color3bv(disp, parameters) (*((disp)->Color3bv)) parameters +#define GET_Color3bv(disp) ((disp)->Color3bv) +#define SET_Color3bv(disp, fn) ((disp)->Color3bv = fn) +#define CALL_Color3d(disp, parameters) (*((disp)->Color3d)) parameters +#define GET_Color3d(disp) ((disp)->Color3d) +#define SET_Color3d(disp, fn) ((disp)->Color3d = fn) +#define CALL_Color3dv(disp, parameters) (*((disp)->Color3dv)) parameters +#define GET_Color3dv(disp) ((disp)->Color3dv) +#define SET_Color3dv(disp, fn) ((disp)->Color3dv = fn) +#define CALL_Color3f(disp, parameters) (*((disp)->Color3f)) parameters +#define GET_Color3f(disp) ((disp)->Color3f) +#define SET_Color3f(disp, fn) ((disp)->Color3f = fn) +#define CALL_Color3fv(disp, parameters) (*((disp)->Color3fv)) parameters +#define GET_Color3fv(disp) ((disp)->Color3fv) +#define SET_Color3fv(disp, fn) ((disp)->Color3fv = fn) +#define CALL_Color3i(disp, parameters) (*((disp)->Color3i)) parameters +#define GET_Color3i(disp) ((disp)->Color3i) +#define SET_Color3i(disp, fn) ((disp)->Color3i = fn) +#define CALL_Color3iv(disp, parameters) (*((disp)->Color3iv)) parameters +#define GET_Color3iv(disp) ((disp)->Color3iv) +#define SET_Color3iv(disp, fn) ((disp)->Color3iv = fn) +#define CALL_Color3s(disp, parameters) (*((disp)->Color3s)) parameters +#define GET_Color3s(disp) ((disp)->Color3s) +#define SET_Color3s(disp, fn) ((disp)->Color3s = fn) +#define CALL_Color3sv(disp, parameters) (*((disp)->Color3sv)) parameters +#define GET_Color3sv(disp) ((disp)->Color3sv) +#define SET_Color3sv(disp, fn) ((disp)->Color3sv = fn) +#define CALL_Color3ub(disp, parameters) (*((disp)->Color3ub)) parameters +#define GET_Color3ub(disp) ((disp)->Color3ub) +#define SET_Color3ub(disp, fn) ((disp)->Color3ub = fn) +#define CALL_Color3ubv(disp, parameters) (*((disp)->Color3ubv)) parameters +#define GET_Color3ubv(disp) ((disp)->Color3ubv) +#define SET_Color3ubv(disp, fn) ((disp)->Color3ubv = fn) +#define CALL_Color3ui(disp, parameters) (*((disp)->Color3ui)) parameters +#define GET_Color3ui(disp) ((disp)->Color3ui) +#define SET_Color3ui(disp, fn) ((disp)->Color3ui = fn) +#define CALL_Color3uiv(disp, parameters) (*((disp)->Color3uiv)) parameters +#define GET_Color3uiv(disp) ((disp)->Color3uiv) +#define SET_Color3uiv(disp, fn) ((disp)->Color3uiv = fn) +#define CALL_Color3us(disp, parameters) (*((disp)->Color3us)) parameters +#define GET_Color3us(disp) ((disp)->Color3us) +#define SET_Color3us(disp, fn) ((disp)->Color3us = fn) +#define CALL_Color3usv(disp, parameters) (*((disp)->Color3usv)) parameters +#define GET_Color3usv(disp) ((disp)->Color3usv) +#define SET_Color3usv(disp, fn) ((disp)->Color3usv = fn) +#define CALL_Color4b(disp, parameters) (*((disp)->Color4b)) parameters +#define GET_Color4b(disp) ((disp)->Color4b) +#define SET_Color4b(disp, fn) ((disp)->Color4b = fn) +#define CALL_Color4bv(disp, parameters) (*((disp)->Color4bv)) parameters +#define GET_Color4bv(disp) ((disp)->Color4bv) +#define SET_Color4bv(disp, fn) ((disp)->Color4bv = fn) +#define CALL_Color4d(disp, parameters) (*((disp)->Color4d)) parameters +#define GET_Color4d(disp) ((disp)->Color4d) +#define SET_Color4d(disp, fn) ((disp)->Color4d = fn) +#define CALL_Color4dv(disp, parameters) (*((disp)->Color4dv)) parameters +#define GET_Color4dv(disp) ((disp)->Color4dv) +#define SET_Color4dv(disp, fn) ((disp)->Color4dv = fn) +#define CALL_Color4f(disp, parameters) (*((disp)->Color4f)) parameters +#define GET_Color4f(disp) ((disp)->Color4f) +#define SET_Color4f(disp, fn) ((disp)->Color4f = fn) +#define CALL_Color4fv(disp, parameters) (*((disp)->Color4fv)) parameters +#define GET_Color4fv(disp) ((disp)->Color4fv) +#define SET_Color4fv(disp, fn) ((disp)->Color4fv = fn) +#define CALL_Color4i(disp, parameters) (*((disp)->Color4i)) parameters +#define GET_Color4i(disp) ((disp)->Color4i) +#define SET_Color4i(disp, fn) ((disp)->Color4i = fn) +#define CALL_Color4iv(disp, parameters) (*((disp)->Color4iv)) parameters +#define GET_Color4iv(disp) ((disp)->Color4iv) +#define SET_Color4iv(disp, fn) ((disp)->Color4iv = fn) +#define CALL_Color4s(disp, parameters) (*((disp)->Color4s)) parameters +#define GET_Color4s(disp) ((disp)->Color4s) +#define SET_Color4s(disp, fn) ((disp)->Color4s = fn) +#define CALL_Color4sv(disp, parameters) (*((disp)->Color4sv)) parameters +#define GET_Color4sv(disp) ((disp)->Color4sv) +#define SET_Color4sv(disp, fn) ((disp)->Color4sv = fn) +#define CALL_Color4ub(disp, parameters) (*((disp)->Color4ub)) parameters +#define GET_Color4ub(disp) ((disp)->Color4ub) +#define SET_Color4ub(disp, fn) ((disp)->Color4ub = fn) +#define CALL_Color4ubv(disp, parameters) (*((disp)->Color4ubv)) parameters +#define GET_Color4ubv(disp) ((disp)->Color4ubv) +#define SET_Color4ubv(disp, fn) ((disp)->Color4ubv = fn) +#define CALL_Color4ui(disp, parameters) (*((disp)->Color4ui)) parameters +#define GET_Color4ui(disp) ((disp)->Color4ui) +#define SET_Color4ui(disp, fn) ((disp)->Color4ui = fn) +#define CALL_Color4uiv(disp, parameters) (*((disp)->Color4uiv)) parameters +#define GET_Color4uiv(disp) ((disp)->Color4uiv) +#define SET_Color4uiv(disp, fn) ((disp)->Color4uiv = fn) +#define CALL_Color4us(disp, parameters) (*((disp)->Color4us)) parameters +#define GET_Color4us(disp) ((disp)->Color4us) +#define SET_Color4us(disp, fn) ((disp)->Color4us = fn) +#define CALL_Color4usv(disp, parameters) (*((disp)->Color4usv)) parameters +#define GET_Color4usv(disp) ((disp)->Color4usv) +#define SET_Color4usv(disp, fn) ((disp)->Color4usv = fn) +#define CALL_EdgeFlag(disp, parameters) (*((disp)->EdgeFlag)) parameters +#define GET_EdgeFlag(disp) ((disp)->EdgeFlag) +#define SET_EdgeFlag(disp, fn) ((disp)->EdgeFlag = fn) +#define CALL_EdgeFlagv(disp, parameters) (*((disp)->EdgeFlagv)) parameters +#define GET_EdgeFlagv(disp) ((disp)->EdgeFlagv) +#define SET_EdgeFlagv(disp, fn) ((disp)->EdgeFlagv = fn) +#define CALL_End(disp, parameters) (*((disp)->End)) parameters +#define GET_End(disp) ((disp)->End) +#define SET_End(disp, fn) ((disp)->End = fn) +#define CALL_Indexd(disp, parameters) (*((disp)->Indexd)) parameters +#define GET_Indexd(disp) ((disp)->Indexd) +#define SET_Indexd(disp, fn) ((disp)->Indexd = fn) +#define CALL_Indexdv(disp, parameters) (*((disp)->Indexdv)) parameters +#define GET_Indexdv(disp) ((disp)->Indexdv) +#define SET_Indexdv(disp, fn) ((disp)->Indexdv = fn) +#define CALL_Indexf(disp, parameters) (*((disp)->Indexf)) parameters +#define GET_Indexf(disp) ((disp)->Indexf) +#define SET_Indexf(disp, fn) ((disp)->Indexf = fn) +#define CALL_Indexfv(disp, parameters) (*((disp)->Indexfv)) parameters +#define GET_Indexfv(disp) ((disp)->Indexfv) +#define SET_Indexfv(disp, fn) ((disp)->Indexfv = fn) +#define CALL_Indexi(disp, parameters) (*((disp)->Indexi)) parameters +#define GET_Indexi(disp) ((disp)->Indexi) +#define SET_Indexi(disp, fn) ((disp)->Indexi = fn) +#define CALL_Indexiv(disp, parameters) (*((disp)->Indexiv)) parameters +#define GET_Indexiv(disp) ((disp)->Indexiv) +#define SET_Indexiv(disp, fn) ((disp)->Indexiv = fn) +#define CALL_Indexs(disp, parameters) (*((disp)->Indexs)) parameters +#define GET_Indexs(disp) ((disp)->Indexs) +#define SET_Indexs(disp, fn) ((disp)->Indexs = fn) +#define CALL_Indexsv(disp, parameters) (*((disp)->Indexsv)) parameters +#define GET_Indexsv(disp) ((disp)->Indexsv) +#define SET_Indexsv(disp, fn) ((disp)->Indexsv = fn) +#define CALL_Normal3b(disp, parameters) (*((disp)->Normal3b)) parameters +#define GET_Normal3b(disp) ((disp)->Normal3b) +#define SET_Normal3b(disp, fn) ((disp)->Normal3b = fn) +#define CALL_Normal3bv(disp, parameters) (*((disp)->Normal3bv)) parameters +#define GET_Normal3bv(disp) ((disp)->Normal3bv) +#define SET_Normal3bv(disp, fn) ((disp)->Normal3bv = fn) +#define CALL_Normal3d(disp, parameters) (*((disp)->Normal3d)) parameters +#define GET_Normal3d(disp) ((disp)->Normal3d) +#define SET_Normal3d(disp, fn) ((disp)->Normal3d = fn) +#define CALL_Normal3dv(disp, parameters) (*((disp)->Normal3dv)) parameters +#define GET_Normal3dv(disp) ((disp)->Normal3dv) +#define SET_Normal3dv(disp, fn) ((disp)->Normal3dv = fn) +#define CALL_Normal3f(disp, parameters) (*((disp)->Normal3f)) parameters +#define GET_Normal3f(disp) ((disp)->Normal3f) +#define SET_Normal3f(disp, fn) ((disp)->Normal3f = fn) +#define CALL_Normal3fv(disp, parameters) (*((disp)->Normal3fv)) parameters +#define GET_Normal3fv(disp) ((disp)->Normal3fv) +#define SET_Normal3fv(disp, fn) ((disp)->Normal3fv = fn) +#define CALL_Normal3i(disp, parameters) (*((disp)->Normal3i)) parameters +#define GET_Normal3i(disp) ((disp)->Normal3i) +#define SET_Normal3i(disp, fn) ((disp)->Normal3i = fn) +#define CALL_Normal3iv(disp, parameters) (*((disp)->Normal3iv)) parameters +#define GET_Normal3iv(disp) ((disp)->Normal3iv) +#define SET_Normal3iv(disp, fn) ((disp)->Normal3iv = fn) +#define CALL_Normal3s(disp, parameters) (*((disp)->Normal3s)) parameters +#define GET_Normal3s(disp) ((disp)->Normal3s) +#define SET_Normal3s(disp, fn) ((disp)->Normal3s = fn) +#define CALL_Normal3sv(disp, parameters) (*((disp)->Normal3sv)) parameters +#define GET_Normal3sv(disp) ((disp)->Normal3sv) +#define SET_Normal3sv(disp, fn) ((disp)->Normal3sv = fn) +#define CALL_RasterPos2d(disp, parameters) (*((disp)->RasterPos2d)) parameters +#define GET_RasterPos2d(disp) ((disp)->RasterPos2d) +#define SET_RasterPos2d(disp, fn) ((disp)->RasterPos2d = fn) +#define CALL_RasterPos2dv(disp, parameters) (*((disp)->RasterPos2dv)) parameters +#define GET_RasterPos2dv(disp) ((disp)->RasterPos2dv) +#define SET_RasterPos2dv(disp, fn) ((disp)->RasterPos2dv = fn) +#define CALL_RasterPos2f(disp, parameters) (*((disp)->RasterPos2f)) parameters +#define GET_RasterPos2f(disp) ((disp)->RasterPos2f) +#define SET_RasterPos2f(disp, fn) ((disp)->RasterPos2f = fn) +#define CALL_RasterPos2fv(disp, parameters) (*((disp)->RasterPos2fv)) parameters +#define GET_RasterPos2fv(disp) ((disp)->RasterPos2fv) +#define SET_RasterPos2fv(disp, fn) ((disp)->RasterPos2fv = fn) +#define CALL_RasterPos2i(disp, parameters) (*((disp)->RasterPos2i)) parameters +#define GET_RasterPos2i(disp) ((disp)->RasterPos2i) +#define SET_RasterPos2i(disp, fn) ((disp)->RasterPos2i = fn) +#define CALL_RasterPos2iv(disp, parameters) (*((disp)->RasterPos2iv)) parameters +#define GET_RasterPos2iv(disp) ((disp)->RasterPos2iv) +#define SET_RasterPos2iv(disp, fn) ((disp)->RasterPos2iv = fn) +#define CALL_RasterPos2s(disp, parameters) (*((disp)->RasterPos2s)) parameters +#define GET_RasterPos2s(disp) ((disp)->RasterPos2s) +#define SET_RasterPos2s(disp, fn) ((disp)->RasterPos2s = fn) +#define CALL_RasterPos2sv(disp, parameters) (*((disp)->RasterPos2sv)) parameters +#define GET_RasterPos2sv(disp) ((disp)->RasterPos2sv) +#define SET_RasterPos2sv(disp, fn) ((disp)->RasterPos2sv = fn) +#define CALL_RasterPos3d(disp, parameters) (*((disp)->RasterPos3d)) parameters +#define GET_RasterPos3d(disp) ((disp)->RasterPos3d) +#define SET_RasterPos3d(disp, fn) ((disp)->RasterPos3d = fn) +#define CALL_RasterPos3dv(disp, parameters) (*((disp)->RasterPos3dv)) parameters +#define GET_RasterPos3dv(disp) ((disp)->RasterPos3dv) +#define SET_RasterPos3dv(disp, fn) ((disp)->RasterPos3dv = fn) +#define CALL_RasterPos3f(disp, parameters) (*((disp)->RasterPos3f)) parameters +#define GET_RasterPos3f(disp) ((disp)->RasterPos3f) +#define SET_RasterPos3f(disp, fn) ((disp)->RasterPos3f = fn) +#define CALL_RasterPos3fv(disp, parameters) (*((disp)->RasterPos3fv)) parameters +#define GET_RasterPos3fv(disp) ((disp)->RasterPos3fv) +#define SET_RasterPos3fv(disp, fn) ((disp)->RasterPos3fv = fn) +#define CALL_RasterPos3i(disp, parameters) (*((disp)->RasterPos3i)) parameters +#define GET_RasterPos3i(disp) ((disp)->RasterPos3i) +#define SET_RasterPos3i(disp, fn) ((disp)->RasterPos3i = fn) +#define CALL_RasterPos3iv(disp, parameters) (*((disp)->RasterPos3iv)) parameters +#define GET_RasterPos3iv(disp) ((disp)->RasterPos3iv) +#define SET_RasterPos3iv(disp, fn) ((disp)->RasterPos3iv = fn) +#define CALL_RasterPos3s(disp, parameters) (*((disp)->RasterPos3s)) parameters +#define GET_RasterPos3s(disp) ((disp)->RasterPos3s) +#define SET_RasterPos3s(disp, fn) ((disp)->RasterPos3s = fn) +#define CALL_RasterPos3sv(disp, parameters) (*((disp)->RasterPos3sv)) parameters +#define GET_RasterPos3sv(disp) ((disp)->RasterPos3sv) +#define SET_RasterPos3sv(disp, fn) ((disp)->RasterPos3sv = fn) +#define CALL_RasterPos4d(disp, parameters) (*((disp)->RasterPos4d)) parameters +#define GET_RasterPos4d(disp) ((disp)->RasterPos4d) +#define SET_RasterPos4d(disp, fn) ((disp)->RasterPos4d = fn) +#define CALL_RasterPos4dv(disp, parameters) (*((disp)->RasterPos4dv)) parameters +#define GET_RasterPos4dv(disp) ((disp)->RasterPos4dv) +#define SET_RasterPos4dv(disp, fn) ((disp)->RasterPos4dv = fn) +#define CALL_RasterPos4f(disp, parameters) (*((disp)->RasterPos4f)) parameters +#define GET_RasterPos4f(disp) ((disp)->RasterPos4f) +#define SET_RasterPos4f(disp, fn) ((disp)->RasterPos4f = fn) +#define CALL_RasterPos4fv(disp, parameters) (*((disp)->RasterPos4fv)) parameters +#define GET_RasterPos4fv(disp) ((disp)->RasterPos4fv) +#define SET_RasterPos4fv(disp, fn) ((disp)->RasterPos4fv = fn) +#define CALL_RasterPos4i(disp, parameters) (*((disp)->RasterPos4i)) parameters +#define GET_RasterPos4i(disp) ((disp)->RasterPos4i) +#define SET_RasterPos4i(disp, fn) ((disp)->RasterPos4i = fn) +#define CALL_RasterPos4iv(disp, parameters) (*((disp)->RasterPos4iv)) parameters +#define GET_RasterPos4iv(disp) ((disp)->RasterPos4iv) +#define SET_RasterPos4iv(disp, fn) ((disp)->RasterPos4iv = fn) +#define CALL_RasterPos4s(disp, parameters) (*((disp)->RasterPos4s)) parameters +#define GET_RasterPos4s(disp) ((disp)->RasterPos4s) +#define SET_RasterPos4s(disp, fn) ((disp)->RasterPos4s = fn) +#define CALL_RasterPos4sv(disp, parameters) (*((disp)->RasterPos4sv)) parameters +#define GET_RasterPos4sv(disp) ((disp)->RasterPos4sv) +#define SET_RasterPos4sv(disp, fn) ((disp)->RasterPos4sv = fn) +#define CALL_Rectd(disp, parameters) (*((disp)->Rectd)) parameters +#define GET_Rectd(disp) ((disp)->Rectd) +#define SET_Rectd(disp, fn) ((disp)->Rectd = fn) +#define CALL_Rectdv(disp, parameters) (*((disp)->Rectdv)) parameters +#define GET_Rectdv(disp) ((disp)->Rectdv) +#define SET_Rectdv(disp, fn) ((disp)->Rectdv = fn) +#define CALL_Rectf(disp, parameters) (*((disp)->Rectf)) parameters +#define GET_Rectf(disp) ((disp)->Rectf) +#define SET_Rectf(disp, fn) ((disp)->Rectf = fn) +#define CALL_Rectfv(disp, parameters) (*((disp)->Rectfv)) parameters +#define GET_Rectfv(disp) ((disp)->Rectfv) +#define SET_Rectfv(disp, fn) ((disp)->Rectfv = fn) +#define CALL_Recti(disp, parameters) (*((disp)->Recti)) parameters +#define GET_Recti(disp) ((disp)->Recti) +#define SET_Recti(disp, fn) ((disp)->Recti = fn) +#define CALL_Rectiv(disp, parameters) (*((disp)->Rectiv)) parameters +#define GET_Rectiv(disp) ((disp)->Rectiv) +#define SET_Rectiv(disp, fn) ((disp)->Rectiv = fn) +#define CALL_Rects(disp, parameters) (*((disp)->Rects)) parameters +#define GET_Rects(disp) ((disp)->Rects) +#define SET_Rects(disp, fn) ((disp)->Rects = fn) +#define CALL_Rectsv(disp, parameters) (*((disp)->Rectsv)) parameters +#define GET_Rectsv(disp) ((disp)->Rectsv) +#define SET_Rectsv(disp, fn) ((disp)->Rectsv = fn) +#define CALL_TexCoord1d(disp, parameters) (*((disp)->TexCoord1d)) parameters +#define GET_TexCoord1d(disp) ((disp)->TexCoord1d) +#define SET_TexCoord1d(disp, fn) ((disp)->TexCoord1d = fn) +#define CALL_TexCoord1dv(disp, parameters) (*((disp)->TexCoord1dv)) parameters +#define GET_TexCoord1dv(disp) ((disp)->TexCoord1dv) +#define SET_TexCoord1dv(disp, fn) ((disp)->TexCoord1dv = fn) +#define CALL_TexCoord1f(disp, parameters) (*((disp)->TexCoord1f)) parameters +#define GET_TexCoord1f(disp) ((disp)->TexCoord1f) +#define SET_TexCoord1f(disp, fn) ((disp)->TexCoord1f = fn) +#define CALL_TexCoord1fv(disp, parameters) (*((disp)->TexCoord1fv)) parameters +#define GET_TexCoord1fv(disp) ((disp)->TexCoord1fv) +#define SET_TexCoord1fv(disp, fn) ((disp)->TexCoord1fv = fn) +#define CALL_TexCoord1i(disp, parameters) (*((disp)->TexCoord1i)) parameters +#define GET_TexCoord1i(disp) ((disp)->TexCoord1i) +#define SET_TexCoord1i(disp, fn) ((disp)->TexCoord1i = fn) +#define CALL_TexCoord1iv(disp, parameters) (*((disp)->TexCoord1iv)) parameters +#define GET_TexCoord1iv(disp) ((disp)->TexCoord1iv) +#define SET_TexCoord1iv(disp, fn) ((disp)->TexCoord1iv = fn) +#define CALL_TexCoord1s(disp, parameters) (*((disp)->TexCoord1s)) parameters +#define GET_TexCoord1s(disp) ((disp)->TexCoord1s) +#define SET_TexCoord1s(disp, fn) ((disp)->TexCoord1s = fn) +#define CALL_TexCoord1sv(disp, parameters) (*((disp)->TexCoord1sv)) parameters +#define GET_TexCoord1sv(disp) ((disp)->TexCoord1sv) +#define SET_TexCoord1sv(disp, fn) ((disp)->TexCoord1sv = fn) +#define CALL_TexCoord2d(disp, parameters) (*((disp)->TexCoord2d)) parameters +#define GET_TexCoord2d(disp) ((disp)->TexCoord2d) +#define SET_TexCoord2d(disp, fn) ((disp)->TexCoord2d = fn) +#define CALL_TexCoord2dv(disp, parameters) (*((disp)->TexCoord2dv)) parameters +#define GET_TexCoord2dv(disp) ((disp)->TexCoord2dv) +#define SET_TexCoord2dv(disp, fn) ((disp)->TexCoord2dv = fn) +#define CALL_TexCoord2f(disp, parameters) (*((disp)->TexCoord2f)) parameters +#define GET_TexCoord2f(disp) ((disp)->TexCoord2f) +#define SET_TexCoord2f(disp, fn) ((disp)->TexCoord2f = fn) +#define CALL_TexCoord2fv(disp, parameters) (*((disp)->TexCoord2fv)) parameters +#define GET_TexCoord2fv(disp) ((disp)->TexCoord2fv) +#define SET_TexCoord2fv(disp, fn) ((disp)->TexCoord2fv = fn) +#define CALL_TexCoord2i(disp, parameters) (*((disp)->TexCoord2i)) parameters +#define GET_TexCoord2i(disp) ((disp)->TexCoord2i) +#define SET_TexCoord2i(disp, fn) ((disp)->TexCoord2i = fn) +#define CALL_TexCoord2iv(disp, parameters) (*((disp)->TexCoord2iv)) parameters +#define GET_TexCoord2iv(disp) ((disp)->TexCoord2iv) +#define SET_TexCoord2iv(disp, fn) ((disp)->TexCoord2iv = fn) +#define CALL_TexCoord2s(disp, parameters) (*((disp)->TexCoord2s)) parameters +#define GET_TexCoord2s(disp) ((disp)->TexCoord2s) +#define SET_TexCoord2s(disp, fn) ((disp)->TexCoord2s = fn) +#define CALL_TexCoord2sv(disp, parameters) (*((disp)->TexCoord2sv)) parameters +#define GET_TexCoord2sv(disp) ((disp)->TexCoord2sv) +#define SET_TexCoord2sv(disp, fn) ((disp)->TexCoord2sv = fn) +#define CALL_TexCoord3d(disp, parameters) (*((disp)->TexCoord3d)) parameters +#define GET_TexCoord3d(disp) ((disp)->TexCoord3d) +#define SET_TexCoord3d(disp, fn) ((disp)->TexCoord3d = fn) +#define CALL_TexCoord3dv(disp, parameters) (*((disp)->TexCoord3dv)) parameters +#define GET_TexCoord3dv(disp) ((disp)->TexCoord3dv) +#define SET_TexCoord3dv(disp, fn) ((disp)->TexCoord3dv = fn) +#define CALL_TexCoord3f(disp, parameters) (*((disp)->TexCoord3f)) parameters +#define GET_TexCoord3f(disp) ((disp)->TexCoord3f) +#define SET_TexCoord3f(disp, fn) ((disp)->TexCoord3f = fn) +#define CALL_TexCoord3fv(disp, parameters) (*((disp)->TexCoord3fv)) parameters +#define GET_TexCoord3fv(disp) ((disp)->TexCoord3fv) +#define SET_TexCoord3fv(disp, fn) ((disp)->TexCoord3fv = fn) +#define CALL_TexCoord3i(disp, parameters) (*((disp)->TexCoord3i)) parameters +#define GET_TexCoord3i(disp) ((disp)->TexCoord3i) +#define SET_TexCoord3i(disp, fn) ((disp)->TexCoord3i = fn) +#define CALL_TexCoord3iv(disp, parameters) (*((disp)->TexCoord3iv)) parameters +#define GET_TexCoord3iv(disp) ((disp)->TexCoord3iv) +#define SET_TexCoord3iv(disp, fn) ((disp)->TexCoord3iv = fn) +#define CALL_TexCoord3s(disp, parameters) (*((disp)->TexCoord3s)) parameters +#define GET_TexCoord3s(disp) ((disp)->TexCoord3s) +#define SET_TexCoord3s(disp, fn) ((disp)->TexCoord3s = fn) +#define CALL_TexCoord3sv(disp, parameters) (*((disp)->TexCoord3sv)) parameters +#define GET_TexCoord3sv(disp) ((disp)->TexCoord3sv) +#define SET_TexCoord3sv(disp, fn) ((disp)->TexCoord3sv = fn) +#define CALL_TexCoord4d(disp, parameters) (*((disp)->TexCoord4d)) parameters +#define GET_TexCoord4d(disp) ((disp)->TexCoord4d) +#define SET_TexCoord4d(disp, fn) ((disp)->TexCoord4d = fn) +#define CALL_TexCoord4dv(disp, parameters) (*((disp)->TexCoord4dv)) parameters +#define GET_TexCoord4dv(disp) ((disp)->TexCoord4dv) +#define SET_TexCoord4dv(disp, fn) ((disp)->TexCoord4dv = fn) +#define CALL_TexCoord4f(disp, parameters) (*((disp)->TexCoord4f)) parameters +#define GET_TexCoord4f(disp) ((disp)->TexCoord4f) +#define SET_TexCoord4f(disp, fn) ((disp)->TexCoord4f = fn) +#define CALL_TexCoord4fv(disp, parameters) (*((disp)->TexCoord4fv)) parameters +#define GET_TexCoord4fv(disp) ((disp)->TexCoord4fv) +#define SET_TexCoord4fv(disp, fn) ((disp)->TexCoord4fv = fn) +#define CALL_TexCoord4i(disp, parameters) (*((disp)->TexCoord4i)) parameters +#define GET_TexCoord4i(disp) ((disp)->TexCoord4i) +#define SET_TexCoord4i(disp, fn) ((disp)->TexCoord4i = fn) +#define CALL_TexCoord4iv(disp, parameters) (*((disp)->TexCoord4iv)) parameters +#define GET_TexCoord4iv(disp) ((disp)->TexCoord4iv) +#define SET_TexCoord4iv(disp, fn) ((disp)->TexCoord4iv = fn) +#define CALL_TexCoord4s(disp, parameters) (*((disp)->TexCoord4s)) parameters +#define GET_TexCoord4s(disp) ((disp)->TexCoord4s) +#define SET_TexCoord4s(disp, fn) ((disp)->TexCoord4s = fn) +#define CALL_TexCoord4sv(disp, parameters) (*((disp)->TexCoord4sv)) parameters +#define GET_TexCoord4sv(disp) ((disp)->TexCoord4sv) +#define SET_TexCoord4sv(disp, fn) ((disp)->TexCoord4sv = fn) +#define CALL_Vertex2d(disp, parameters) (*((disp)->Vertex2d)) parameters +#define GET_Vertex2d(disp) ((disp)->Vertex2d) +#define SET_Vertex2d(disp, fn) ((disp)->Vertex2d = fn) +#define CALL_Vertex2dv(disp, parameters) (*((disp)->Vertex2dv)) parameters +#define GET_Vertex2dv(disp) ((disp)->Vertex2dv) +#define SET_Vertex2dv(disp, fn) ((disp)->Vertex2dv = fn) +#define CALL_Vertex2f(disp, parameters) (*((disp)->Vertex2f)) parameters +#define GET_Vertex2f(disp) ((disp)->Vertex2f) +#define SET_Vertex2f(disp, fn) ((disp)->Vertex2f = fn) +#define CALL_Vertex2fv(disp, parameters) (*((disp)->Vertex2fv)) parameters +#define GET_Vertex2fv(disp) ((disp)->Vertex2fv) +#define SET_Vertex2fv(disp, fn) ((disp)->Vertex2fv = fn) +#define CALL_Vertex2i(disp, parameters) (*((disp)->Vertex2i)) parameters +#define GET_Vertex2i(disp) ((disp)->Vertex2i) +#define SET_Vertex2i(disp, fn) ((disp)->Vertex2i = fn) +#define CALL_Vertex2iv(disp, parameters) (*((disp)->Vertex2iv)) parameters +#define GET_Vertex2iv(disp) ((disp)->Vertex2iv) +#define SET_Vertex2iv(disp, fn) ((disp)->Vertex2iv = fn) +#define CALL_Vertex2s(disp, parameters) (*((disp)->Vertex2s)) parameters +#define GET_Vertex2s(disp) ((disp)->Vertex2s) +#define SET_Vertex2s(disp, fn) ((disp)->Vertex2s = fn) +#define CALL_Vertex2sv(disp, parameters) (*((disp)->Vertex2sv)) parameters +#define GET_Vertex2sv(disp) ((disp)->Vertex2sv) +#define SET_Vertex2sv(disp, fn) ((disp)->Vertex2sv = fn) +#define CALL_Vertex3d(disp, parameters) (*((disp)->Vertex3d)) parameters +#define GET_Vertex3d(disp) ((disp)->Vertex3d) +#define SET_Vertex3d(disp, fn) ((disp)->Vertex3d = fn) +#define CALL_Vertex3dv(disp, parameters) (*((disp)->Vertex3dv)) parameters +#define GET_Vertex3dv(disp) ((disp)->Vertex3dv) +#define SET_Vertex3dv(disp, fn) ((disp)->Vertex3dv = fn) +#define CALL_Vertex3f(disp, parameters) (*((disp)->Vertex3f)) parameters +#define GET_Vertex3f(disp) ((disp)->Vertex3f) +#define SET_Vertex3f(disp, fn) ((disp)->Vertex3f = fn) +#define CALL_Vertex3fv(disp, parameters) (*((disp)->Vertex3fv)) parameters +#define GET_Vertex3fv(disp) ((disp)->Vertex3fv) +#define SET_Vertex3fv(disp, fn) ((disp)->Vertex3fv = fn) +#define CALL_Vertex3i(disp, parameters) (*((disp)->Vertex3i)) parameters +#define GET_Vertex3i(disp) ((disp)->Vertex3i) +#define SET_Vertex3i(disp, fn) ((disp)->Vertex3i = fn) +#define CALL_Vertex3iv(disp, parameters) (*((disp)->Vertex3iv)) parameters +#define GET_Vertex3iv(disp) ((disp)->Vertex3iv) +#define SET_Vertex3iv(disp, fn) ((disp)->Vertex3iv = fn) +#define CALL_Vertex3s(disp, parameters) (*((disp)->Vertex3s)) parameters +#define GET_Vertex3s(disp) ((disp)->Vertex3s) +#define SET_Vertex3s(disp, fn) ((disp)->Vertex3s = fn) +#define CALL_Vertex3sv(disp, parameters) (*((disp)->Vertex3sv)) parameters +#define GET_Vertex3sv(disp) ((disp)->Vertex3sv) +#define SET_Vertex3sv(disp, fn) ((disp)->Vertex3sv = fn) +#define CALL_Vertex4d(disp, parameters) (*((disp)->Vertex4d)) parameters +#define GET_Vertex4d(disp) ((disp)->Vertex4d) +#define SET_Vertex4d(disp, fn) ((disp)->Vertex4d = fn) +#define CALL_Vertex4dv(disp, parameters) (*((disp)->Vertex4dv)) parameters +#define GET_Vertex4dv(disp) ((disp)->Vertex4dv) +#define SET_Vertex4dv(disp, fn) ((disp)->Vertex4dv = fn) +#define CALL_Vertex4f(disp, parameters) (*((disp)->Vertex4f)) parameters +#define GET_Vertex4f(disp) ((disp)->Vertex4f) +#define SET_Vertex4f(disp, fn) ((disp)->Vertex4f = fn) +#define CALL_Vertex4fv(disp, parameters) (*((disp)->Vertex4fv)) parameters +#define GET_Vertex4fv(disp) ((disp)->Vertex4fv) +#define SET_Vertex4fv(disp, fn) ((disp)->Vertex4fv = fn) +#define CALL_Vertex4i(disp, parameters) (*((disp)->Vertex4i)) parameters +#define GET_Vertex4i(disp) ((disp)->Vertex4i) +#define SET_Vertex4i(disp, fn) ((disp)->Vertex4i = fn) +#define CALL_Vertex4iv(disp, parameters) (*((disp)->Vertex4iv)) parameters +#define GET_Vertex4iv(disp) ((disp)->Vertex4iv) +#define SET_Vertex4iv(disp, fn) ((disp)->Vertex4iv = fn) +#define CALL_Vertex4s(disp, parameters) (*((disp)->Vertex4s)) parameters +#define GET_Vertex4s(disp) ((disp)->Vertex4s) +#define SET_Vertex4s(disp, fn) ((disp)->Vertex4s = fn) +#define CALL_Vertex4sv(disp, parameters) (*((disp)->Vertex4sv)) parameters +#define GET_Vertex4sv(disp) ((disp)->Vertex4sv) +#define SET_Vertex4sv(disp, fn) ((disp)->Vertex4sv = fn) +#define CALL_ClipPlane(disp, parameters) (*((disp)->ClipPlane)) parameters +#define GET_ClipPlane(disp) ((disp)->ClipPlane) +#define SET_ClipPlane(disp, fn) ((disp)->ClipPlane = fn) +#define CALL_ColorMaterial(disp, parameters) (*((disp)->ColorMaterial)) parameters +#define GET_ColorMaterial(disp) ((disp)->ColorMaterial) +#define SET_ColorMaterial(disp, fn) ((disp)->ColorMaterial = fn) +#define CALL_CullFace(disp, parameters) (*((disp)->CullFace)) parameters +#define GET_CullFace(disp) ((disp)->CullFace) +#define SET_CullFace(disp, fn) ((disp)->CullFace = fn) +#define CALL_Fogf(disp, parameters) (*((disp)->Fogf)) parameters +#define GET_Fogf(disp) ((disp)->Fogf) +#define SET_Fogf(disp, fn) ((disp)->Fogf = fn) +#define CALL_Fogfv(disp, parameters) (*((disp)->Fogfv)) parameters +#define GET_Fogfv(disp) ((disp)->Fogfv) +#define SET_Fogfv(disp, fn) ((disp)->Fogfv = fn) +#define CALL_Fogi(disp, parameters) (*((disp)->Fogi)) parameters +#define GET_Fogi(disp) ((disp)->Fogi) +#define SET_Fogi(disp, fn) ((disp)->Fogi = fn) +#define CALL_Fogiv(disp, parameters) (*((disp)->Fogiv)) parameters +#define GET_Fogiv(disp) ((disp)->Fogiv) +#define SET_Fogiv(disp, fn) ((disp)->Fogiv = fn) +#define CALL_FrontFace(disp, parameters) (*((disp)->FrontFace)) parameters +#define GET_FrontFace(disp) ((disp)->FrontFace) +#define SET_FrontFace(disp, fn) ((disp)->FrontFace = fn) +#define CALL_Hint(disp, parameters) (*((disp)->Hint)) parameters +#define GET_Hint(disp) ((disp)->Hint) +#define SET_Hint(disp, fn) ((disp)->Hint = fn) +#define CALL_Lightf(disp, parameters) (*((disp)->Lightf)) parameters +#define GET_Lightf(disp) ((disp)->Lightf) +#define SET_Lightf(disp, fn) ((disp)->Lightf = fn) +#define CALL_Lightfv(disp, parameters) (*((disp)->Lightfv)) parameters +#define GET_Lightfv(disp) ((disp)->Lightfv) +#define SET_Lightfv(disp, fn) ((disp)->Lightfv = fn) +#define CALL_Lighti(disp, parameters) (*((disp)->Lighti)) parameters +#define GET_Lighti(disp) ((disp)->Lighti) +#define SET_Lighti(disp, fn) ((disp)->Lighti = fn) +#define CALL_Lightiv(disp, parameters) (*((disp)->Lightiv)) parameters +#define GET_Lightiv(disp) ((disp)->Lightiv) +#define SET_Lightiv(disp, fn) ((disp)->Lightiv = fn) +#define CALL_LightModelf(disp, parameters) (*((disp)->LightModelf)) parameters +#define GET_LightModelf(disp) ((disp)->LightModelf) +#define SET_LightModelf(disp, fn) ((disp)->LightModelf = fn) +#define CALL_LightModelfv(disp, parameters) (*((disp)->LightModelfv)) parameters +#define GET_LightModelfv(disp) ((disp)->LightModelfv) +#define SET_LightModelfv(disp, fn) ((disp)->LightModelfv = fn) +#define CALL_LightModeli(disp, parameters) (*((disp)->LightModeli)) parameters +#define GET_LightModeli(disp) ((disp)->LightModeli) +#define SET_LightModeli(disp, fn) ((disp)->LightModeli = fn) +#define CALL_LightModeliv(disp, parameters) (*((disp)->LightModeliv)) parameters +#define GET_LightModeliv(disp) ((disp)->LightModeliv) +#define SET_LightModeliv(disp, fn) ((disp)->LightModeliv = fn) +#define CALL_LineStipple(disp, parameters) (*((disp)->LineStipple)) parameters +#define GET_LineStipple(disp) ((disp)->LineStipple) +#define SET_LineStipple(disp, fn) ((disp)->LineStipple = fn) +#define CALL_LineWidth(disp, parameters) (*((disp)->LineWidth)) parameters +#define GET_LineWidth(disp) ((disp)->LineWidth) +#define SET_LineWidth(disp, fn) ((disp)->LineWidth = fn) +#define CALL_Materialf(disp, parameters) (*((disp)->Materialf)) parameters +#define GET_Materialf(disp) ((disp)->Materialf) +#define SET_Materialf(disp, fn) ((disp)->Materialf = fn) +#define CALL_Materialfv(disp, parameters) (*((disp)->Materialfv)) parameters +#define GET_Materialfv(disp) ((disp)->Materialfv) +#define SET_Materialfv(disp, fn) ((disp)->Materialfv = fn) +#define CALL_Materiali(disp, parameters) (*((disp)->Materiali)) parameters +#define GET_Materiali(disp) ((disp)->Materiali) +#define SET_Materiali(disp, fn) ((disp)->Materiali = fn) +#define CALL_Materialiv(disp, parameters) (*((disp)->Materialiv)) parameters +#define GET_Materialiv(disp) ((disp)->Materialiv) +#define SET_Materialiv(disp, fn) ((disp)->Materialiv = fn) +#define CALL_PointSize(disp, parameters) (*((disp)->PointSize)) parameters +#define GET_PointSize(disp) ((disp)->PointSize) +#define SET_PointSize(disp, fn) ((disp)->PointSize = fn) +#define CALL_PolygonMode(disp, parameters) (*((disp)->PolygonMode)) parameters +#define GET_PolygonMode(disp) ((disp)->PolygonMode) +#define SET_PolygonMode(disp, fn) ((disp)->PolygonMode = fn) +#define CALL_PolygonStipple(disp, parameters) (*((disp)->PolygonStipple)) parameters +#define GET_PolygonStipple(disp) ((disp)->PolygonStipple) +#define SET_PolygonStipple(disp, fn) ((disp)->PolygonStipple = fn) +#define CALL_Scissor(disp, parameters) (*((disp)->Scissor)) parameters +#define GET_Scissor(disp) ((disp)->Scissor) +#define SET_Scissor(disp, fn) ((disp)->Scissor = fn) +#define CALL_ShadeModel(disp, parameters) (*((disp)->ShadeModel)) parameters +#define GET_ShadeModel(disp) ((disp)->ShadeModel) +#define SET_ShadeModel(disp, fn) ((disp)->ShadeModel = fn) +#define CALL_TexParameterf(disp, parameters) (*((disp)->TexParameterf)) parameters +#define GET_TexParameterf(disp) ((disp)->TexParameterf) +#define SET_TexParameterf(disp, fn) ((disp)->TexParameterf = fn) +#define CALL_TexParameterfv(disp, parameters) (*((disp)->TexParameterfv)) parameters +#define GET_TexParameterfv(disp) ((disp)->TexParameterfv) +#define SET_TexParameterfv(disp, fn) ((disp)->TexParameterfv = fn) +#define CALL_TexParameteri(disp, parameters) (*((disp)->TexParameteri)) parameters +#define GET_TexParameteri(disp) ((disp)->TexParameteri) +#define SET_TexParameteri(disp, fn) ((disp)->TexParameteri = fn) +#define CALL_TexParameteriv(disp, parameters) (*((disp)->TexParameteriv)) parameters +#define GET_TexParameteriv(disp) ((disp)->TexParameteriv) +#define SET_TexParameteriv(disp, fn) ((disp)->TexParameteriv = fn) +#define CALL_TexImage1D(disp, parameters) (*((disp)->TexImage1D)) parameters +#define GET_TexImage1D(disp) ((disp)->TexImage1D) +#define SET_TexImage1D(disp, fn) ((disp)->TexImage1D = fn) +#define CALL_TexImage2D(disp, parameters) (*((disp)->TexImage2D)) parameters +#define GET_TexImage2D(disp) ((disp)->TexImage2D) +#define SET_TexImage2D(disp, fn) ((disp)->TexImage2D = fn) +#define CALL_TexEnvf(disp, parameters) (*((disp)->TexEnvf)) parameters +#define GET_TexEnvf(disp) ((disp)->TexEnvf) +#define SET_TexEnvf(disp, fn) ((disp)->TexEnvf = fn) +#define CALL_TexEnvfv(disp, parameters) (*((disp)->TexEnvfv)) parameters +#define GET_TexEnvfv(disp) ((disp)->TexEnvfv) +#define SET_TexEnvfv(disp, fn) ((disp)->TexEnvfv = fn) +#define CALL_TexEnvi(disp, parameters) (*((disp)->TexEnvi)) parameters +#define GET_TexEnvi(disp) ((disp)->TexEnvi) +#define SET_TexEnvi(disp, fn) ((disp)->TexEnvi = fn) +#define CALL_TexEnviv(disp, parameters) (*((disp)->TexEnviv)) parameters +#define GET_TexEnviv(disp) ((disp)->TexEnviv) +#define SET_TexEnviv(disp, fn) ((disp)->TexEnviv = fn) +#define CALL_TexGend(disp, parameters) (*((disp)->TexGend)) parameters +#define GET_TexGend(disp) ((disp)->TexGend) +#define SET_TexGend(disp, fn) ((disp)->TexGend = fn) +#define CALL_TexGendv(disp, parameters) (*((disp)->TexGendv)) parameters +#define GET_TexGendv(disp) ((disp)->TexGendv) +#define SET_TexGendv(disp, fn) ((disp)->TexGendv = fn) +#define CALL_TexGenf(disp, parameters) (*((disp)->TexGenf)) parameters +#define GET_TexGenf(disp) ((disp)->TexGenf) +#define SET_TexGenf(disp, fn) ((disp)->TexGenf = fn) +#define CALL_TexGenfv(disp, parameters) (*((disp)->TexGenfv)) parameters +#define GET_TexGenfv(disp) ((disp)->TexGenfv) +#define SET_TexGenfv(disp, fn) ((disp)->TexGenfv = fn) +#define CALL_TexGeni(disp, parameters) (*((disp)->TexGeni)) parameters +#define GET_TexGeni(disp) ((disp)->TexGeni) +#define SET_TexGeni(disp, fn) ((disp)->TexGeni = fn) +#define CALL_TexGeniv(disp, parameters) (*((disp)->TexGeniv)) parameters +#define GET_TexGeniv(disp) ((disp)->TexGeniv) +#define SET_TexGeniv(disp, fn) ((disp)->TexGeniv = fn) +#define CALL_FeedbackBuffer(disp, parameters) (*((disp)->FeedbackBuffer)) parameters +#define GET_FeedbackBuffer(disp) ((disp)->FeedbackBuffer) +#define SET_FeedbackBuffer(disp, fn) ((disp)->FeedbackBuffer = fn) +#define CALL_SelectBuffer(disp, parameters) (*((disp)->SelectBuffer)) parameters +#define GET_SelectBuffer(disp) ((disp)->SelectBuffer) +#define SET_SelectBuffer(disp, fn) ((disp)->SelectBuffer = fn) +#define CALL_RenderMode(disp, parameters) (*((disp)->RenderMode)) parameters +#define GET_RenderMode(disp) ((disp)->RenderMode) +#define SET_RenderMode(disp, fn) ((disp)->RenderMode = fn) +#define CALL_InitNames(disp, parameters) (*((disp)->InitNames)) parameters +#define GET_InitNames(disp) ((disp)->InitNames) +#define SET_InitNames(disp, fn) ((disp)->InitNames = fn) +#define CALL_LoadName(disp, parameters) (*((disp)->LoadName)) parameters +#define GET_LoadName(disp) ((disp)->LoadName) +#define SET_LoadName(disp, fn) ((disp)->LoadName = fn) +#define CALL_PassThrough(disp, parameters) (*((disp)->PassThrough)) parameters +#define GET_PassThrough(disp) ((disp)->PassThrough) +#define SET_PassThrough(disp, fn) ((disp)->PassThrough = fn) +#define CALL_PopName(disp, parameters) (*((disp)->PopName)) parameters +#define GET_PopName(disp) ((disp)->PopName) +#define SET_PopName(disp, fn) ((disp)->PopName = fn) +#define CALL_PushName(disp, parameters) (*((disp)->PushName)) parameters +#define GET_PushName(disp) ((disp)->PushName) +#define SET_PushName(disp, fn) ((disp)->PushName = fn) +#define CALL_DrawBuffer(disp, parameters) (*((disp)->DrawBuffer)) parameters +#define GET_DrawBuffer(disp) ((disp)->DrawBuffer) +#define SET_DrawBuffer(disp, fn) ((disp)->DrawBuffer = fn) +#define CALL_Clear(disp, parameters) (*((disp)->Clear)) parameters +#define GET_Clear(disp) ((disp)->Clear) +#define SET_Clear(disp, fn) ((disp)->Clear = fn) +#define CALL_ClearAccum(disp, parameters) (*((disp)->ClearAccum)) parameters +#define GET_ClearAccum(disp) ((disp)->ClearAccum) +#define SET_ClearAccum(disp, fn) ((disp)->ClearAccum = fn) +#define CALL_ClearIndex(disp, parameters) (*((disp)->ClearIndex)) parameters +#define GET_ClearIndex(disp) ((disp)->ClearIndex) +#define SET_ClearIndex(disp, fn) ((disp)->ClearIndex = fn) +#define CALL_ClearColor(disp, parameters) (*((disp)->ClearColor)) parameters +#define GET_ClearColor(disp) ((disp)->ClearColor) +#define SET_ClearColor(disp, fn) ((disp)->ClearColor = fn) +#define CALL_ClearStencil(disp, parameters) (*((disp)->ClearStencil)) parameters +#define GET_ClearStencil(disp) ((disp)->ClearStencil) +#define SET_ClearStencil(disp, fn) ((disp)->ClearStencil = fn) +#define CALL_ClearDepth(disp, parameters) (*((disp)->ClearDepth)) parameters +#define GET_ClearDepth(disp) ((disp)->ClearDepth) +#define SET_ClearDepth(disp, fn) ((disp)->ClearDepth = fn) +#define CALL_StencilMask(disp, parameters) (*((disp)->StencilMask)) parameters +#define GET_StencilMask(disp) ((disp)->StencilMask) +#define SET_StencilMask(disp, fn) ((disp)->StencilMask = fn) +#define CALL_ColorMask(disp, parameters) (*((disp)->ColorMask)) parameters +#define GET_ColorMask(disp) ((disp)->ColorMask) +#define SET_ColorMask(disp, fn) ((disp)->ColorMask = fn) +#define CALL_DepthMask(disp, parameters) (*((disp)->DepthMask)) parameters +#define GET_DepthMask(disp) ((disp)->DepthMask) +#define SET_DepthMask(disp, fn) ((disp)->DepthMask = fn) +#define CALL_IndexMask(disp, parameters) (*((disp)->IndexMask)) parameters +#define GET_IndexMask(disp) ((disp)->IndexMask) +#define SET_IndexMask(disp, fn) ((disp)->IndexMask = fn) +#define CALL_Accum(disp, parameters) (*((disp)->Accum)) parameters +#define GET_Accum(disp) ((disp)->Accum) +#define SET_Accum(disp, fn) ((disp)->Accum = fn) +#define CALL_Disable(disp, parameters) (*((disp)->Disable)) parameters +#define GET_Disable(disp) ((disp)->Disable) +#define SET_Disable(disp, fn) ((disp)->Disable = fn) +#define CALL_Enable(disp, parameters) (*((disp)->Enable)) parameters +#define GET_Enable(disp) ((disp)->Enable) +#define SET_Enable(disp, fn) ((disp)->Enable = fn) +#define CALL_Finish(disp, parameters) (*((disp)->Finish)) parameters +#define GET_Finish(disp) ((disp)->Finish) +#define SET_Finish(disp, fn) ((disp)->Finish = fn) +#define CALL_Flush(disp, parameters) (*((disp)->Flush)) parameters +#define GET_Flush(disp) ((disp)->Flush) +#define SET_Flush(disp, fn) ((disp)->Flush = fn) +#define CALL_PopAttrib(disp, parameters) (*((disp)->PopAttrib)) parameters +#define GET_PopAttrib(disp) ((disp)->PopAttrib) +#define SET_PopAttrib(disp, fn) ((disp)->PopAttrib = fn) +#define CALL_PushAttrib(disp, parameters) (*((disp)->PushAttrib)) parameters +#define GET_PushAttrib(disp) ((disp)->PushAttrib) +#define SET_PushAttrib(disp, fn) ((disp)->PushAttrib = fn) +#define CALL_Map1d(disp, parameters) (*((disp)->Map1d)) parameters +#define GET_Map1d(disp) ((disp)->Map1d) +#define SET_Map1d(disp, fn) ((disp)->Map1d = fn) +#define CALL_Map1f(disp, parameters) (*((disp)->Map1f)) parameters +#define GET_Map1f(disp) ((disp)->Map1f) +#define SET_Map1f(disp, fn) ((disp)->Map1f = fn) +#define CALL_Map2d(disp, parameters) (*((disp)->Map2d)) parameters +#define GET_Map2d(disp) ((disp)->Map2d) +#define SET_Map2d(disp, fn) ((disp)->Map2d = fn) +#define CALL_Map2f(disp, parameters) (*((disp)->Map2f)) parameters +#define GET_Map2f(disp) ((disp)->Map2f) +#define SET_Map2f(disp, fn) ((disp)->Map2f = fn) +#define CALL_MapGrid1d(disp, parameters) (*((disp)->MapGrid1d)) parameters +#define GET_MapGrid1d(disp) ((disp)->MapGrid1d) +#define SET_MapGrid1d(disp, fn) ((disp)->MapGrid1d = fn) +#define CALL_MapGrid1f(disp, parameters) (*((disp)->MapGrid1f)) parameters +#define GET_MapGrid1f(disp) ((disp)->MapGrid1f) +#define SET_MapGrid1f(disp, fn) ((disp)->MapGrid1f = fn) +#define CALL_MapGrid2d(disp, parameters) (*((disp)->MapGrid2d)) parameters +#define GET_MapGrid2d(disp) ((disp)->MapGrid2d) +#define SET_MapGrid2d(disp, fn) ((disp)->MapGrid2d = fn) +#define CALL_MapGrid2f(disp, parameters) (*((disp)->MapGrid2f)) parameters +#define GET_MapGrid2f(disp) ((disp)->MapGrid2f) +#define SET_MapGrid2f(disp, fn) ((disp)->MapGrid2f = fn) +#define CALL_EvalCoord1d(disp, parameters) (*((disp)->EvalCoord1d)) parameters +#define GET_EvalCoord1d(disp) ((disp)->EvalCoord1d) +#define SET_EvalCoord1d(disp, fn) ((disp)->EvalCoord1d = fn) +#define CALL_EvalCoord1dv(disp, parameters) (*((disp)->EvalCoord1dv)) parameters +#define GET_EvalCoord1dv(disp) ((disp)->EvalCoord1dv) +#define SET_EvalCoord1dv(disp, fn) ((disp)->EvalCoord1dv = fn) +#define CALL_EvalCoord1f(disp, parameters) (*((disp)->EvalCoord1f)) parameters +#define GET_EvalCoord1f(disp) ((disp)->EvalCoord1f) +#define SET_EvalCoord1f(disp, fn) ((disp)->EvalCoord1f = fn) +#define CALL_EvalCoord1fv(disp, parameters) (*((disp)->EvalCoord1fv)) parameters +#define GET_EvalCoord1fv(disp) ((disp)->EvalCoord1fv) +#define SET_EvalCoord1fv(disp, fn) ((disp)->EvalCoord1fv = fn) +#define CALL_EvalCoord2d(disp, parameters) (*((disp)->EvalCoord2d)) parameters +#define GET_EvalCoord2d(disp) ((disp)->EvalCoord2d) +#define SET_EvalCoord2d(disp, fn) ((disp)->EvalCoord2d = fn) +#define CALL_EvalCoord2dv(disp, parameters) (*((disp)->EvalCoord2dv)) parameters +#define GET_EvalCoord2dv(disp) ((disp)->EvalCoord2dv) +#define SET_EvalCoord2dv(disp, fn) ((disp)->EvalCoord2dv = fn) +#define CALL_EvalCoord2f(disp, parameters) (*((disp)->EvalCoord2f)) parameters +#define GET_EvalCoord2f(disp) ((disp)->EvalCoord2f) +#define SET_EvalCoord2f(disp, fn) ((disp)->EvalCoord2f = fn) +#define CALL_EvalCoord2fv(disp, parameters) (*((disp)->EvalCoord2fv)) parameters +#define GET_EvalCoord2fv(disp) ((disp)->EvalCoord2fv) +#define SET_EvalCoord2fv(disp, fn) ((disp)->EvalCoord2fv = fn) +#define CALL_EvalMesh1(disp, parameters) (*((disp)->EvalMesh1)) parameters +#define GET_EvalMesh1(disp) ((disp)->EvalMesh1) +#define SET_EvalMesh1(disp, fn) ((disp)->EvalMesh1 = fn) +#define CALL_EvalPoint1(disp, parameters) (*((disp)->EvalPoint1)) parameters +#define GET_EvalPoint1(disp) ((disp)->EvalPoint1) +#define SET_EvalPoint1(disp, fn) ((disp)->EvalPoint1 = fn) +#define CALL_EvalMesh2(disp, parameters) (*((disp)->EvalMesh2)) parameters +#define GET_EvalMesh2(disp) ((disp)->EvalMesh2) +#define SET_EvalMesh2(disp, fn) ((disp)->EvalMesh2 = fn) +#define CALL_EvalPoint2(disp, parameters) (*((disp)->EvalPoint2)) parameters +#define GET_EvalPoint2(disp) ((disp)->EvalPoint2) +#define SET_EvalPoint2(disp, fn) ((disp)->EvalPoint2 = fn) +#define CALL_AlphaFunc(disp, parameters) (*((disp)->AlphaFunc)) parameters +#define GET_AlphaFunc(disp) ((disp)->AlphaFunc) +#define SET_AlphaFunc(disp, fn) ((disp)->AlphaFunc = fn) +#define CALL_BlendFunc(disp, parameters) (*((disp)->BlendFunc)) parameters +#define GET_BlendFunc(disp) ((disp)->BlendFunc) +#define SET_BlendFunc(disp, fn) ((disp)->BlendFunc = fn) +#define CALL_LogicOp(disp, parameters) (*((disp)->LogicOp)) parameters +#define GET_LogicOp(disp) ((disp)->LogicOp) +#define SET_LogicOp(disp, fn) ((disp)->LogicOp = fn) +#define CALL_StencilFunc(disp, parameters) (*((disp)->StencilFunc)) parameters +#define GET_StencilFunc(disp) ((disp)->StencilFunc) +#define SET_StencilFunc(disp, fn) ((disp)->StencilFunc = fn) +#define CALL_StencilOp(disp, parameters) (*((disp)->StencilOp)) parameters +#define GET_StencilOp(disp) ((disp)->StencilOp) +#define SET_StencilOp(disp, fn) ((disp)->StencilOp = fn) +#define CALL_DepthFunc(disp, parameters) (*((disp)->DepthFunc)) parameters +#define GET_DepthFunc(disp) ((disp)->DepthFunc) +#define SET_DepthFunc(disp, fn) ((disp)->DepthFunc = fn) +#define CALL_PixelZoom(disp, parameters) (*((disp)->PixelZoom)) parameters +#define GET_PixelZoom(disp) ((disp)->PixelZoom) +#define SET_PixelZoom(disp, fn) ((disp)->PixelZoom = fn) +#define CALL_PixelTransferf(disp, parameters) (*((disp)->PixelTransferf)) parameters +#define GET_PixelTransferf(disp) ((disp)->PixelTransferf) +#define SET_PixelTransferf(disp, fn) ((disp)->PixelTransferf = fn) +#define CALL_PixelTransferi(disp, parameters) (*((disp)->PixelTransferi)) parameters +#define GET_PixelTransferi(disp) ((disp)->PixelTransferi) +#define SET_PixelTransferi(disp, fn) ((disp)->PixelTransferi = fn) +#define CALL_PixelStoref(disp, parameters) (*((disp)->PixelStoref)) parameters +#define GET_PixelStoref(disp) ((disp)->PixelStoref) +#define SET_PixelStoref(disp, fn) ((disp)->PixelStoref = fn) +#define CALL_PixelStorei(disp, parameters) (*((disp)->PixelStorei)) parameters +#define GET_PixelStorei(disp) ((disp)->PixelStorei) +#define SET_PixelStorei(disp, fn) ((disp)->PixelStorei = fn) +#define CALL_PixelMapfv(disp, parameters) (*((disp)->PixelMapfv)) parameters +#define GET_PixelMapfv(disp) ((disp)->PixelMapfv) +#define SET_PixelMapfv(disp, fn) ((disp)->PixelMapfv = fn) +#define CALL_PixelMapuiv(disp, parameters) (*((disp)->PixelMapuiv)) parameters +#define GET_PixelMapuiv(disp) ((disp)->PixelMapuiv) +#define SET_PixelMapuiv(disp, fn) ((disp)->PixelMapuiv = fn) +#define CALL_PixelMapusv(disp, parameters) (*((disp)->PixelMapusv)) parameters +#define GET_PixelMapusv(disp) ((disp)->PixelMapusv) +#define SET_PixelMapusv(disp, fn) ((disp)->PixelMapusv = fn) +#define CALL_ReadBuffer(disp, parameters) (*((disp)->ReadBuffer)) parameters +#define GET_ReadBuffer(disp) ((disp)->ReadBuffer) +#define SET_ReadBuffer(disp, fn) ((disp)->ReadBuffer = fn) +#define CALL_CopyPixels(disp, parameters) (*((disp)->CopyPixels)) parameters +#define GET_CopyPixels(disp) ((disp)->CopyPixels) +#define SET_CopyPixels(disp, fn) ((disp)->CopyPixels = fn) +#define CALL_ReadPixels(disp, parameters) (*((disp)->ReadPixels)) parameters +#define GET_ReadPixels(disp) ((disp)->ReadPixels) +#define SET_ReadPixels(disp, fn) ((disp)->ReadPixels = fn) +#define CALL_DrawPixels(disp, parameters) (*((disp)->DrawPixels)) parameters +#define GET_DrawPixels(disp) ((disp)->DrawPixels) +#define SET_DrawPixels(disp, fn) ((disp)->DrawPixels = fn) +#define CALL_GetBooleanv(disp, parameters) (*((disp)->GetBooleanv)) parameters +#define GET_GetBooleanv(disp) ((disp)->GetBooleanv) +#define SET_GetBooleanv(disp, fn) ((disp)->GetBooleanv = fn) +#define CALL_GetClipPlane(disp, parameters) (*((disp)->GetClipPlane)) parameters +#define GET_GetClipPlane(disp) ((disp)->GetClipPlane) +#define SET_GetClipPlane(disp, fn) ((disp)->GetClipPlane = fn) +#define CALL_GetDoublev(disp, parameters) (*((disp)->GetDoublev)) parameters +#define GET_GetDoublev(disp) ((disp)->GetDoublev) +#define SET_GetDoublev(disp, fn) ((disp)->GetDoublev = fn) +#define CALL_GetError(disp, parameters) (*((disp)->GetError)) parameters +#define GET_GetError(disp) ((disp)->GetError) +#define SET_GetError(disp, fn) ((disp)->GetError = fn) +#define CALL_GetFloatv(disp, parameters) (*((disp)->GetFloatv)) parameters +#define GET_GetFloatv(disp) ((disp)->GetFloatv) +#define SET_GetFloatv(disp, fn) ((disp)->GetFloatv = fn) +#define CALL_GetIntegerv(disp, parameters) (*((disp)->GetIntegerv)) parameters +#define GET_GetIntegerv(disp) ((disp)->GetIntegerv) +#define SET_GetIntegerv(disp, fn) ((disp)->GetIntegerv = fn) +#define CALL_GetLightfv(disp, parameters) (*((disp)->GetLightfv)) parameters +#define GET_GetLightfv(disp) ((disp)->GetLightfv) +#define SET_GetLightfv(disp, fn) ((disp)->GetLightfv = fn) +#define CALL_GetLightiv(disp, parameters) (*((disp)->GetLightiv)) parameters +#define GET_GetLightiv(disp) ((disp)->GetLightiv) +#define SET_GetLightiv(disp, fn) ((disp)->GetLightiv = fn) +#define CALL_GetMapdv(disp, parameters) (*((disp)->GetMapdv)) parameters +#define GET_GetMapdv(disp) ((disp)->GetMapdv) +#define SET_GetMapdv(disp, fn) ((disp)->GetMapdv = fn) +#define CALL_GetMapfv(disp, parameters) (*((disp)->GetMapfv)) parameters +#define GET_GetMapfv(disp) ((disp)->GetMapfv) +#define SET_GetMapfv(disp, fn) ((disp)->GetMapfv = fn) +#define CALL_GetMapiv(disp, parameters) (*((disp)->GetMapiv)) parameters +#define GET_GetMapiv(disp) ((disp)->GetMapiv) +#define SET_GetMapiv(disp, fn) ((disp)->GetMapiv = fn) +#define CALL_GetMaterialfv(disp, parameters) (*((disp)->GetMaterialfv)) parameters +#define GET_GetMaterialfv(disp) ((disp)->GetMaterialfv) +#define SET_GetMaterialfv(disp, fn) ((disp)->GetMaterialfv = fn) +#define CALL_GetMaterialiv(disp, parameters) (*((disp)->GetMaterialiv)) parameters +#define GET_GetMaterialiv(disp) ((disp)->GetMaterialiv) +#define SET_GetMaterialiv(disp, fn) ((disp)->GetMaterialiv = fn) +#define CALL_GetPixelMapfv(disp, parameters) (*((disp)->GetPixelMapfv)) parameters +#define GET_GetPixelMapfv(disp) ((disp)->GetPixelMapfv) +#define SET_GetPixelMapfv(disp, fn) ((disp)->GetPixelMapfv = fn) +#define CALL_GetPixelMapuiv(disp, parameters) (*((disp)->GetPixelMapuiv)) parameters +#define GET_GetPixelMapuiv(disp) ((disp)->GetPixelMapuiv) +#define SET_GetPixelMapuiv(disp, fn) ((disp)->GetPixelMapuiv = fn) +#define CALL_GetPixelMapusv(disp, parameters) (*((disp)->GetPixelMapusv)) parameters +#define GET_GetPixelMapusv(disp) ((disp)->GetPixelMapusv) +#define SET_GetPixelMapusv(disp, fn) ((disp)->GetPixelMapusv = fn) +#define CALL_GetPolygonStipple(disp, parameters) (*((disp)->GetPolygonStipple)) parameters +#define GET_GetPolygonStipple(disp) ((disp)->GetPolygonStipple) +#define SET_GetPolygonStipple(disp, fn) ((disp)->GetPolygonStipple = fn) +#define CALL_GetString(disp, parameters) (*((disp)->GetString)) parameters +#define GET_GetString(disp) ((disp)->GetString) +#define SET_GetString(disp, fn) ((disp)->GetString = fn) +#define CALL_GetTexEnvfv(disp, parameters) (*((disp)->GetTexEnvfv)) parameters +#define GET_GetTexEnvfv(disp) ((disp)->GetTexEnvfv) +#define SET_GetTexEnvfv(disp, fn) ((disp)->GetTexEnvfv = fn) +#define CALL_GetTexEnviv(disp, parameters) (*((disp)->GetTexEnviv)) parameters +#define GET_GetTexEnviv(disp) ((disp)->GetTexEnviv) +#define SET_GetTexEnviv(disp, fn) ((disp)->GetTexEnviv = fn) +#define CALL_GetTexGendv(disp, parameters) (*((disp)->GetTexGendv)) parameters +#define GET_GetTexGendv(disp) ((disp)->GetTexGendv) +#define SET_GetTexGendv(disp, fn) ((disp)->GetTexGendv = fn) +#define CALL_GetTexGenfv(disp, parameters) (*((disp)->GetTexGenfv)) parameters +#define GET_GetTexGenfv(disp) ((disp)->GetTexGenfv) +#define SET_GetTexGenfv(disp, fn) ((disp)->GetTexGenfv = fn) +#define CALL_GetTexGeniv(disp, parameters) (*((disp)->GetTexGeniv)) parameters +#define GET_GetTexGeniv(disp) ((disp)->GetTexGeniv) +#define SET_GetTexGeniv(disp, fn) ((disp)->GetTexGeniv = fn) +#define CALL_GetTexImage(disp, parameters) (*((disp)->GetTexImage)) parameters +#define GET_GetTexImage(disp) ((disp)->GetTexImage) +#define SET_GetTexImage(disp, fn) ((disp)->GetTexImage = fn) +#define CALL_GetTexParameterfv(disp, parameters) (*((disp)->GetTexParameterfv)) parameters +#define GET_GetTexParameterfv(disp) ((disp)->GetTexParameterfv) +#define SET_GetTexParameterfv(disp, fn) ((disp)->GetTexParameterfv = fn) +#define CALL_GetTexParameteriv(disp, parameters) (*((disp)->GetTexParameteriv)) parameters +#define GET_GetTexParameteriv(disp) ((disp)->GetTexParameteriv) +#define SET_GetTexParameteriv(disp, fn) ((disp)->GetTexParameteriv = fn) +#define CALL_GetTexLevelParameterfv(disp, parameters) (*((disp)->GetTexLevelParameterfv)) parameters +#define GET_GetTexLevelParameterfv(disp) ((disp)->GetTexLevelParameterfv) +#define SET_GetTexLevelParameterfv(disp, fn) ((disp)->GetTexLevelParameterfv = fn) +#define CALL_GetTexLevelParameteriv(disp, parameters) (*((disp)->GetTexLevelParameteriv)) parameters +#define GET_GetTexLevelParameteriv(disp) ((disp)->GetTexLevelParameteriv) +#define SET_GetTexLevelParameteriv(disp, fn) ((disp)->GetTexLevelParameteriv = fn) +#define CALL_IsEnabled(disp, parameters) (*((disp)->IsEnabled)) parameters +#define GET_IsEnabled(disp) ((disp)->IsEnabled) +#define SET_IsEnabled(disp, fn) ((disp)->IsEnabled = fn) +#define CALL_IsList(disp, parameters) (*((disp)->IsList)) parameters +#define GET_IsList(disp) ((disp)->IsList) +#define SET_IsList(disp, fn) ((disp)->IsList = fn) +#define CALL_DepthRange(disp, parameters) (*((disp)->DepthRange)) parameters +#define GET_DepthRange(disp) ((disp)->DepthRange) +#define SET_DepthRange(disp, fn) ((disp)->DepthRange = fn) +#define CALL_Frustum(disp, parameters) (*((disp)->Frustum)) parameters +#define GET_Frustum(disp) ((disp)->Frustum) +#define SET_Frustum(disp, fn) ((disp)->Frustum = fn) +#define CALL_LoadIdentity(disp, parameters) (*((disp)->LoadIdentity)) parameters +#define GET_LoadIdentity(disp) ((disp)->LoadIdentity) +#define SET_LoadIdentity(disp, fn) ((disp)->LoadIdentity = fn) +#define CALL_LoadMatrixf(disp, parameters) (*((disp)->LoadMatrixf)) parameters +#define GET_LoadMatrixf(disp) ((disp)->LoadMatrixf) +#define SET_LoadMatrixf(disp, fn) ((disp)->LoadMatrixf = fn) +#define CALL_LoadMatrixd(disp, parameters) (*((disp)->LoadMatrixd)) parameters +#define GET_LoadMatrixd(disp) ((disp)->LoadMatrixd) +#define SET_LoadMatrixd(disp, fn) ((disp)->LoadMatrixd = fn) +#define CALL_MatrixMode(disp, parameters) (*((disp)->MatrixMode)) parameters +#define GET_MatrixMode(disp) ((disp)->MatrixMode) +#define SET_MatrixMode(disp, fn) ((disp)->MatrixMode = fn) +#define CALL_MultMatrixf(disp, parameters) (*((disp)->MultMatrixf)) parameters +#define GET_MultMatrixf(disp) ((disp)->MultMatrixf) +#define SET_MultMatrixf(disp, fn) ((disp)->MultMatrixf = fn) +#define CALL_MultMatrixd(disp, parameters) (*((disp)->MultMatrixd)) parameters +#define GET_MultMatrixd(disp) ((disp)->MultMatrixd) +#define SET_MultMatrixd(disp, fn) ((disp)->MultMatrixd = fn) +#define CALL_Ortho(disp, parameters) (*((disp)->Ortho)) parameters +#define GET_Ortho(disp) ((disp)->Ortho) +#define SET_Ortho(disp, fn) ((disp)->Ortho = fn) +#define CALL_PopMatrix(disp, parameters) (*((disp)->PopMatrix)) parameters +#define GET_PopMatrix(disp) ((disp)->PopMatrix) +#define SET_PopMatrix(disp, fn) ((disp)->PopMatrix = fn) +#define CALL_PushMatrix(disp, parameters) (*((disp)->PushMatrix)) parameters +#define GET_PushMatrix(disp) ((disp)->PushMatrix) +#define SET_PushMatrix(disp, fn) ((disp)->PushMatrix = fn) +#define CALL_Rotated(disp, parameters) (*((disp)->Rotated)) parameters +#define GET_Rotated(disp) ((disp)->Rotated) +#define SET_Rotated(disp, fn) ((disp)->Rotated = fn) +#define CALL_Rotatef(disp, parameters) (*((disp)->Rotatef)) parameters +#define GET_Rotatef(disp) ((disp)->Rotatef) +#define SET_Rotatef(disp, fn) ((disp)->Rotatef = fn) +#define CALL_Scaled(disp, parameters) (*((disp)->Scaled)) parameters +#define GET_Scaled(disp) ((disp)->Scaled) +#define SET_Scaled(disp, fn) ((disp)->Scaled = fn) +#define CALL_Scalef(disp, parameters) (*((disp)->Scalef)) parameters +#define GET_Scalef(disp) ((disp)->Scalef) +#define SET_Scalef(disp, fn) ((disp)->Scalef = fn) +#define CALL_Translated(disp, parameters) (*((disp)->Translated)) parameters +#define GET_Translated(disp) ((disp)->Translated) +#define SET_Translated(disp, fn) ((disp)->Translated = fn) +#define CALL_Translatef(disp, parameters) (*((disp)->Translatef)) parameters +#define GET_Translatef(disp) ((disp)->Translatef) +#define SET_Translatef(disp, fn) ((disp)->Translatef = fn) +#define CALL_Viewport(disp, parameters) (*((disp)->Viewport)) parameters +#define GET_Viewport(disp) ((disp)->Viewport) +#define SET_Viewport(disp, fn) ((disp)->Viewport = fn) +#define CALL_ArrayElement(disp, parameters) (*((disp)->ArrayElement)) parameters +#define GET_ArrayElement(disp) ((disp)->ArrayElement) +#define SET_ArrayElement(disp, fn) ((disp)->ArrayElement = fn) +#define CALL_BindTexture(disp, parameters) (*((disp)->BindTexture)) parameters +#define GET_BindTexture(disp) ((disp)->BindTexture) +#define SET_BindTexture(disp, fn) ((disp)->BindTexture = fn) +#define CALL_ColorPointer(disp, parameters) (*((disp)->ColorPointer)) parameters +#define GET_ColorPointer(disp) ((disp)->ColorPointer) +#define SET_ColorPointer(disp, fn) ((disp)->ColorPointer = fn) +#define CALL_DisableClientState(disp, parameters) (*((disp)->DisableClientState)) parameters +#define GET_DisableClientState(disp) ((disp)->DisableClientState) +#define SET_DisableClientState(disp, fn) ((disp)->DisableClientState = fn) +#define CALL_DrawArrays(disp, parameters) (*((disp)->DrawArrays)) parameters +#define GET_DrawArrays(disp) ((disp)->DrawArrays) +#define SET_DrawArrays(disp, fn) ((disp)->DrawArrays = fn) +#define CALL_DrawElements(disp, parameters) (*((disp)->DrawElements)) parameters +#define GET_DrawElements(disp) ((disp)->DrawElements) +#define SET_DrawElements(disp, fn) ((disp)->DrawElements = fn) +#define CALL_EdgeFlagPointer(disp, parameters) (*((disp)->EdgeFlagPointer)) parameters +#define GET_EdgeFlagPointer(disp) ((disp)->EdgeFlagPointer) +#define SET_EdgeFlagPointer(disp, fn) ((disp)->EdgeFlagPointer = fn) +#define CALL_EnableClientState(disp, parameters) (*((disp)->EnableClientState)) parameters +#define GET_EnableClientState(disp) ((disp)->EnableClientState) +#define SET_EnableClientState(disp, fn) ((disp)->EnableClientState = fn) +#define CALL_IndexPointer(disp, parameters) (*((disp)->IndexPointer)) parameters +#define GET_IndexPointer(disp) ((disp)->IndexPointer) +#define SET_IndexPointer(disp, fn) ((disp)->IndexPointer = fn) +#define CALL_Indexub(disp, parameters) (*((disp)->Indexub)) parameters +#define GET_Indexub(disp) ((disp)->Indexub) +#define SET_Indexub(disp, fn) ((disp)->Indexub = fn) +#define CALL_Indexubv(disp, parameters) (*((disp)->Indexubv)) parameters +#define GET_Indexubv(disp) ((disp)->Indexubv) +#define SET_Indexubv(disp, fn) ((disp)->Indexubv = fn) +#define CALL_InterleavedArrays(disp, parameters) (*((disp)->InterleavedArrays)) parameters +#define GET_InterleavedArrays(disp) ((disp)->InterleavedArrays) +#define SET_InterleavedArrays(disp, fn) ((disp)->InterleavedArrays = fn) +#define CALL_NormalPointer(disp, parameters) (*((disp)->NormalPointer)) parameters +#define GET_NormalPointer(disp) ((disp)->NormalPointer) +#define SET_NormalPointer(disp, fn) ((disp)->NormalPointer = fn) +#define CALL_PolygonOffset(disp, parameters) (*((disp)->PolygonOffset)) parameters +#define GET_PolygonOffset(disp) ((disp)->PolygonOffset) +#define SET_PolygonOffset(disp, fn) ((disp)->PolygonOffset = fn) +#define CALL_TexCoordPointer(disp, parameters) (*((disp)->TexCoordPointer)) parameters +#define GET_TexCoordPointer(disp) ((disp)->TexCoordPointer) +#define SET_TexCoordPointer(disp, fn) ((disp)->TexCoordPointer = fn) +#define CALL_VertexPointer(disp, parameters) (*((disp)->VertexPointer)) parameters +#define GET_VertexPointer(disp) ((disp)->VertexPointer) +#define SET_VertexPointer(disp, fn) ((disp)->VertexPointer = fn) +#define CALL_AreTexturesResident(disp, parameters) (*((disp)->AreTexturesResident)) parameters +#define GET_AreTexturesResident(disp) ((disp)->AreTexturesResident) +#define SET_AreTexturesResident(disp, fn) ((disp)->AreTexturesResident = fn) +#define CALL_CopyTexImage1D(disp, parameters) (*((disp)->CopyTexImage1D)) parameters +#define GET_CopyTexImage1D(disp) ((disp)->CopyTexImage1D) +#define SET_CopyTexImage1D(disp, fn) ((disp)->CopyTexImage1D = fn) +#define CALL_CopyTexImage2D(disp, parameters) (*((disp)->CopyTexImage2D)) parameters +#define GET_CopyTexImage2D(disp) ((disp)->CopyTexImage2D) +#define SET_CopyTexImage2D(disp, fn) ((disp)->CopyTexImage2D = fn) +#define CALL_CopyTexSubImage1D(disp, parameters) (*((disp)->CopyTexSubImage1D)) parameters +#define GET_CopyTexSubImage1D(disp) ((disp)->CopyTexSubImage1D) +#define SET_CopyTexSubImage1D(disp, fn) ((disp)->CopyTexSubImage1D = fn) +#define CALL_CopyTexSubImage2D(disp, parameters) (*((disp)->CopyTexSubImage2D)) parameters +#define GET_CopyTexSubImage2D(disp) ((disp)->CopyTexSubImage2D) +#define SET_CopyTexSubImage2D(disp, fn) ((disp)->CopyTexSubImage2D = fn) +#define CALL_DeleteTextures(disp, parameters) (*((disp)->DeleteTextures)) parameters +#define GET_DeleteTextures(disp) ((disp)->DeleteTextures) +#define SET_DeleteTextures(disp, fn) ((disp)->DeleteTextures = fn) +#define CALL_GenTextures(disp, parameters) (*((disp)->GenTextures)) parameters +#define GET_GenTextures(disp) ((disp)->GenTextures) +#define SET_GenTextures(disp, fn) ((disp)->GenTextures = fn) +#define CALL_GetPointerv(disp, parameters) (*((disp)->GetPointerv)) parameters +#define GET_GetPointerv(disp) ((disp)->GetPointerv) +#define SET_GetPointerv(disp, fn) ((disp)->GetPointerv = fn) +#define CALL_IsTexture(disp, parameters) (*((disp)->IsTexture)) parameters +#define GET_IsTexture(disp) ((disp)->IsTexture) +#define SET_IsTexture(disp, fn) ((disp)->IsTexture = fn) +#define CALL_PrioritizeTextures(disp, parameters) (*((disp)->PrioritizeTextures)) parameters +#define GET_PrioritizeTextures(disp) ((disp)->PrioritizeTextures) +#define SET_PrioritizeTextures(disp, fn) ((disp)->PrioritizeTextures = fn) +#define CALL_TexSubImage1D(disp, parameters) (*((disp)->TexSubImage1D)) parameters +#define GET_TexSubImage1D(disp) ((disp)->TexSubImage1D) +#define SET_TexSubImage1D(disp, fn) ((disp)->TexSubImage1D = fn) +#define CALL_TexSubImage2D(disp, parameters) (*((disp)->TexSubImage2D)) parameters +#define GET_TexSubImage2D(disp) ((disp)->TexSubImage2D) +#define SET_TexSubImage2D(disp, fn) ((disp)->TexSubImage2D = fn) +#define CALL_PopClientAttrib(disp, parameters) (*((disp)->PopClientAttrib)) parameters +#define GET_PopClientAttrib(disp) ((disp)->PopClientAttrib) +#define SET_PopClientAttrib(disp, fn) ((disp)->PopClientAttrib = fn) +#define CALL_PushClientAttrib(disp, parameters) (*((disp)->PushClientAttrib)) parameters +#define GET_PushClientAttrib(disp) ((disp)->PushClientAttrib) +#define SET_PushClientAttrib(disp, fn) ((disp)->PushClientAttrib = fn) +#define CALL_BlendColor(disp, parameters) (*((disp)->BlendColor)) parameters +#define GET_BlendColor(disp) ((disp)->BlendColor) +#define SET_BlendColor(disp, fn) ((disp)->BlendColor = fn) +#define CALL_BlendEquation(disp, parameters) (*((disp)->BlendEquation)) parameters +#define GET_BlendEquation(disp) ((disp)->BlendEquation) +#define SET_BlendEquation(disp, fn) ((disp)->BlendEquation = fn) +#define CALL_DrawRangeElements(disp, parameters) (*((disp)->DrawRangeElements)) parameters +#define GET_DrawRangeElements(disp) ((disp)->DrawRangeElements) +#define SET_DrawRangeElements(disp, fn) ((disp)->DrawRangeElements = fn) +#define CALL_ColorTable(disp, parameters) (*((disp)->ColorTable)) parameters +#define GET_ColorTable(disp) ((disp)->ColorTable) +#define SET_ColorTable(disp, fn) ((disp)->ColorTable = fn) +#define CALL_ColorTableParameterfv(disp, parameters) (*((disp)->ColorTableParameterfv)) parameters +#define GET_ColorTableParameterfv(disp) ((disp)->ColorTableParameterfv) +#define SET_ColorTableParameterfv(disp, fn) ((disp)->ColorTableParameterfv = fn) +#define CALL_ColorTableParameteriv(disp, parameters) (*((disp)->ColorTableParameteriv)) parameters +#define GET_ColorTableParameteriv(disp) ((disp)->ColorTableParameteriv) +#define SET_ColorTableParameteriv(disp, fn) ((disp)->ColorTableParameteriv = fn) +#define CALL_CopyColorTable(disp, parameters) (*((disp)->CopyColorTable)) parameters +#define GET_CopyColorTable(disp) ((disp)->CopyColorTable) +#define SET_CopyColorTable(disp, fn) ((disp)->CopyColorTable = fn) +#define CALL_GetColorTable(disp, parameters) (*((disp)->GetColorTable)) parameters +#define GET_GetColorTable(disp) ((disp)->GetColorTable) +#define SET_GetColorTable(disp, fn) ((disp)->GetColorTable = fn) +#define CALL_GetColorTableParameterfv(disp, parameters) (*((disp)->GetColorTableParameterfv)) parameters +#define GET_GetColorTableParameterfv(disp) ((disp)->GetColorTableParameterfv) +#define SET_GetColorTableParameterfv(disp, fn) ((disp)->GetColorTableParameterfv = fn) +#define CALL_GetColorTableParameteriv(disp, parameters) (*((disp)->GetColorTableParameteriv)) parameters +#define GET_GetColorTableParameteriv(disp) ((disp)->GetColorTableParameteriv) +#define SET_GetColorTableParameteriv(disp, fn) ((disp)->GetColorTableParameteriv = fn) +#define CALL_ColorSubTable(disp, parameters) (*((disp)->ColorSubTable)) parameters +#define GET_ColorSubTable(disp) ((disp)->ColorSubTable) +#define SET_ColorSubTable(disp, fn) ((disp)->ColorSubTable = fn) +#define CALL_CopyColorSubTable(disp, parameters) (*((disp)->CopyColorSubTable)) parameters +#define GET_CopyColorSubTable(disp) ((disp)->CopyColorSubTable) +#define SET_CopyColorSubTable(disp, fn) ((disp)->CopyColorSubTable = fn) +#define CALL_ConvolutionFilter1D(disp, parameters) (*((disp)->ConvolutionFilter1D)) parameters +#define GET_ConvolutionFilter1D(disp) ((disp)->ConvolutionFilter1D) +#define SET_ConvolutionFilter1D(disp, fn) ((disp)->ConvolutionFilter1D = fn) +#define CALL_ConvolutionFilter2D(disp, parameters) (*((disp)->ConvolutionFilter2D)) parameters +#define GET_ConvolutionFilter2D(disp) ((disp)->ConvolutionFilter2D) +#define SET_ConvolutionFilter2D(disp, fn) ((disp)->ConvolutionFilter2D = fn) +#define CALL_ConvolutionParameterf(disp, parameters) (*((disp)->ConvolutionParameterf)) parameters +#define GET_ConvolutionParameterf(disp) ((disp)->ConvolutionParameterf) +#define SET_ConvolutionParameterf(disp, fn) ((disp)->ConvolutionParameterf = fn) +#define CALL_ConvolutionParameterfv(disp, parameters) (*((disp)->ConvolutionParameterfv)) parameters +#define GET_ConvolutionParameterfv(disp) ((disp)->ConvolutionParameterfv) +#define SET_ConvolutionParameterfv(disp, fn) ((disp)->ConvolutionParameterfv = fn) +#define CALL_ConvolutionParameteri(disp, parameters) (*((disp)->ConvolutionParameteri)) parameters +#define GET_ConvolutionParameteri(disp) ((disp)->ConvolutionParameteri) +#define SET_ConvolutionParameteri(disp, fn) ((disp)->ConvolutionParameteri = fn) +#define CALL_ConvolutionParameteriv(disp, parameters) (*((disp)->ConvolutionParameteriv)) parameters +#define GET_ConvolutionParameteriv(disp) ((disp)->ConvolutionParameteriv) +#define SET_ConvolutionParameteriv(disp, fn) ((disp)->ConvolutionParameteriv = fn) +#define CALL_CopyConvolutionFilter1D(disp, parameters) (*((disp)->CopyConvolutionFilter1D)) parameters +#define GET_CopyConvolutionFilter1D(disp) ((disp)->CopyConvolutionFilter1D) +#define SET_CopyConvolutionFilter1D(disp, fn) ((disp)->CopyConvolutionFilter1D = fn) +#define CALL_CopyConvolutionFilter2D(disp, parameters) (*((disp)->CopyConvolutionFilter2D)) parameters +#define GET_CopyConvolutionFilter2D(disp) ((disp)->CopyConvolutionFilter2D) +#define SET_CopyConvolutionFilter2D(disp, fn) ((disp)->CopyConvolutionFilter2D = fn) +#define CALL_GetConvolutionFilter(disp, parameters) (*((disp)->GetConvolutionFilter)) parameters +#define GET_GetConvolutionFilter(disp) ((disp)->GetConvolutionFilter) +#define SET_GetConvolutionFilter(disp, fn) ((disp)->GetConvolutionFilter = fn) +#define CALL_GetConvolutionParameterfv(disp, parameters) (*((disp)->GetConvolutionParameterfv)) parameters +#define GET_GetConvolutionParameterfv(disp) ((disp)->GetConvolutionParameterfv) +#define SET_GetConvolutionParameterfv(disp, fn) ((disp)->GetConvolutionParameterfv = fn) +#define CALL_GetConvolutionParameteriv(disp, parameters) (*((disp)->GetConvolutionParameteriv)) parameters +#define GET_GetConvolutionParameteriv(disp) ((disp)->GetConvolutionParameteriv) +#define SET_GetConvolutionParameteriv(disp, fn) ((disp)->GetConvolutionParameteriv = fn) +#define CALL_GetSeparableFilter(disp, parameters) (*((disp)->GetSeparableFilter)) parameters +#define GET_GetSeparableFilter(disp) ((disp)->GetSeparableFilter) +#define SET_GetSeparableFilter(disp, fn) ((disp)->GetSeparableFilter = fn) +#define CALL_SeparableFilter2D(disp, parameters) (*((disp)->SeparableFilter2D)) parameters +#define GET_SeparableFilter2D(disp) ((disp)->SeparableFilter2D) +#define SET_SeparableFilter2D(disp, fn) ((disp)->SeparableFilter2D = fn) +#define CALL_GetHistogram(disp, parameters) (*((disp)->GetHistogram)) parameters +#define GET_GetHistogram(disp) ((disp)->GetHistogram) +#define SET_GetHistogram(disp, fn) ((disp)->GetHistogram = fn) +#define CALL_GetHistogramParameterfv(disp, parameters) (*((disp)->GetHistogramParameterfv)) parameters +#define GET_GetHistogramParameterfv(disp) ((disp)->GetHistogramParameterfv) +#define SET_GetHistogramParameterfv(disp, fn) ((disp)->GetHistogramParameterfv = fn) +#define CALL_GetHistogramParameteriv(disp, parameters) (*((disp)->GetHistogramParameteriv)) parameters +#define GET_GetHistogramParameteriv(disp) ((disp)->GetHistogramParameteriv) +#define SET_GetHistogramParameteriv(disp, fn) ((disp)->GetHistogramParameteriv = fn) +#define CALL_GetMinmax(disp, parameters) (*((disp)->GetMinmax)) parameters +#define GET_GetMinmax(disp) ((disp)->GetMinmax) +#define SET_GetMinmax(disp, fn) ((disp)->GetMinmax = fn) +#define CALL_GetMinmaxParameterfv(disp, parameters) (*((disp)->GetMinmaxParameterfv)) parameters +#define GET_GetMinmaxParameterfv(disp) ((disp)->GetMinmaxParameterfv) +#define SET_GetMinmaxParameterfv(disp, fn) ((disp)->GetMinmaxParameterfv = fn) +#define CALL_GetMinmaxParameteriv(disp, parameters) (*((disp)->GetMinmaxParameteriv)) parameters +#define GET_GetMinmaxParameteriv(disp) ((disp)->GetMinmaxParameteriv) +#define SET_GetMinmaxParameteriv(disp, fn) ((disp)->GetMinmaxParameteriv = fn) +#define CALL_Histogram(disp, parameters) (*((disp)->Histogram)) parameters +#define GET_Histogram(disp) ((disp)->Histogram) +#define SET_Histogram(disp, fn) ((disp)->Histogram = fn) +#define CALL_Minmax(disp, parameters) (*((disp)->Minmax)) parameters +#define GET_Minmax(disp) ((disp)->Minmax) +#define SET_Minmax(disp, fn) ((disp)->Minmax = fn) +#define CALL_ResetHistogram(disp, parameters) (*((disp)->ResetHistogram)) parameters +#define GET_ResetHistogram(disp) ((disp)->ResetHistogram) +#define SET_ResetHistogram(disp, fn) ((disp)->ResetHistogram = fn) +#define CALL_ResetMinmax(disp, parameters) (*((disp)->ResetMinmax)) parameters +#define GET_ResetMinmax(disp) ((disp)->ResetMinmax) +#define SET_ResetMinmax(disp, fn) ((disp)->ResetMinmax = fn) +#define CALL_TexImage3D(disp, parameters) (*((disp)->TexImage3D)) parameters +#define GET_TexImage3D(disp) ((disp)->TexImage3D) +#define SET_TexImage3D(disp, fn) ((disp)->TexImage3D = fn) +#define CALL_TexSubImage3D(disp, parameters) (*((disp)->TexSubImage3D)) parameters +#define GET_TexSubImage3D(disp) ((disp)->TexSubImage3D) +#define SET_TexSubImage3D(disp, fn) ((disp)->TexSubImage3D = fn) +#define CALL_CopyTexSubImage3D(disp, parameters) (*((disp)->CopyTexSubImage3D)) parameters +#define GET_CopyTexSubImage3D(disp) ((disp)->CopyTexSubImage3D) +#define SET_CopyTexSubImage3D(disp, fn) ((disp)->CopyTexSubImage3D = fn) +#define CALL_ActiveTextureARB(disp, parameters) (*((disp)->ActiveTextureARB)) parameters +#define GET_ActiveTextureARB(disp) ((disp)->ActiveTextureARB) +#define SET_ActiveTextureARB(disp, fn) ((disp)->ActiveTextureARB = fn) +#define CALL_ClientActiveTextureARB(disp, parameters) (*((disp)->ClientActiveTextureARB)) parameters +#define GET_ClientActiveTextureARB(disp) ((disp)->ClientActiveTextureARB) +#define SET_ClientActiveTextureARB(disp, fn) ((disp)->ClientActiveTextureARB = fn) +#define CALL_MultiTexCoord1dARB(disp, parameters) (*((disp)->MultiTexCoord1dARB)) parameters +#define GET_MultiTexCoord1dARB(disp) ((disp)->MultiTexCoord1dARB) +#define SET_MultiTexCoord1dARB(disp, fn) ((disp)->MultiTexCoord1dARB = fn) +#define CALL_MultiTexCoord1dvARB(disp, parameters) (*((disp)->MultiTexCoord1dvARB)) parameters +#define GET_MultiTexCoord1dvARB(disp) ((disp)->MultiTexCoord1dvARB) +#define SET_MultiTexCoord1dvARB(disp, fn) ((disp)->MultiTexCoord1dvARB = fn) +#define CALL_MultiTexCoord1fARB(disp, parameters) (*((disp)->MultiTexCoord1fARB)) parameters +#define GET_MultiTexCoord1fARB(disp) ((disp)->MultiTexCoord1fARB) +#define SET_MultiTexCoord1fARB(disp, fn) ((disp)->MultiTexCoord1fARB = fn) +#define CALL_MultiTexCoord1fvARB(disp, parameters) (*((disp)->MultiTexCoord1fvARB)) parameters +#define GET_MultiTexCoord1fvARB(disp) ((disp)->MultiTexCoord1fvARB) +#define SET_MultiTexCoord1fvARB(disp, fn) ((disp)->MultiTexCoord1fvARB = fn) +#define CALL_MultiTexCoord1iARB(disp, parameters) (*((disp)->MultiTexCoord1iARB)) parameters +#define GET_MultiTexCoord1iARB(disp) ((disp)->MultiTexCoord1iARB) +#define SET_MultiTexCoord1iARB(disp, fn) ((disp)->MultiTexCoord1iARB = fn) +#define CALL_MultiTexCoord1ivARB(disp, parameters) (*((disp)->MultiTexCoord1ivARB)) parameters +#define GET_MultiTexCoord1ivARB(disp) ((disp)->MultiTexCoord1ivARB) +#define SET_MultiTexCoord1ivARB(disp, fn) ((disp)->MultiTexCoord1ivARB = fn) +#define CALL_MultiTexCoord1sARB(disp, parameters) (*((disp)->MultiTexCoord1sARB)) parameters +#define GET_MultiTexCoord1sARB(disp) ((disp)->MultiTexCoord1sARB) +#define SET_MultiTexCoord1sARB(disp, fn) ((disp)->MultiTexCoord1sARB = fn) +#define CALL_MultiTexCoord1svARB(disp, parameters) (*((disp)->MultiTexCoord1svARB)) parameters +#define GET_MultiTexCoord1svARB(disp) ((disp)->MultiTexCoord1svARB) +#define SET_MultiTexCoord1svARB(disp, fn) ((disp)->MultiTexCoord1svARB = fn) +#define CALL_MultiTexCoord2dARB(disp, parameters) (*((disp)->MultiTexCoord2dARB)) parameters +#define GET_MultiTexCoord2dARB(disp) ((disp)->MultiTexCoord2dARB) +#define SET_MultiTexCoord2dARB(disp, fn) ((disp)->MultiTexCoord2dARB = fn) +#define CALL_MultiTexCoord2dvARB(disp, parameters) (*((disp)->MultiTexCoord2dvARB)) parameters +#define GET_MultiTexCoord2dvARB(disp) ((disp)->MultiTexCoord2dvARB) +#define SET_MultiTexCoord2dvARB(disp, fn) ((disp)->MultiTexCoord2dvARB = fn) +#define CALL_MultiTexCoord2fARB(disp, parameters) (*((disp)->MultiTexCoord2fARB)) parameters +#define GET_MultiTexCoord2fARB(disp) ((disp)->MultiTexCoord2fARB) +#define SET_MultiTexCoord2fARB(disp, fn) ((disp)->MultiTexCoord2fARB = fn) +#define CALL_MultiTexCoord2fvARB(disp, parameters) (*((disp)->MultiTexCoord2fvARB)) parameters +#define GET_MultiTexCoord2fvARB(disp) ((disp)->MultiTexCoord2fvARB) +#define SET_MultiTexCoord2fvARB(disp, fn) ((disp)->MultiTexCoord2fvARB = fn) +#define CALL_MultiTexCoord2iARB(disp, parameters) (*((disp)->MultiTexCoord2iARB)) parameters +#define GET_MultiTexCoord2iARB(disp) ((disp)->MultiTexCoord2iARB) +#define SET_MultiTexCoord2iARB(disp, fn) ((disp)->MultiTexCoord2iARB = fn) +#define CALL_MultiTexCoord2ivARB(disp, parameters) (*((disp)->MultiTexCoord2ivARB)) parameters +#define GET_MultiTexCoord2ivARB(disp) ((disp)->MultiTexCoord2ivARB) +#define SET_MultiTexCoord2ivARB(disp, fn) ((disp)->MultiTexCoord2ivARB = fn) +#define CALL_MultiTexCoord2sARB(disp, parameters) (*((disp)->MultiTexCoord2sARB)) parameters +#define GET_MultiTexCoord2sARB(disp) ((disp)->MultiTexCoord2sARB) +#define SET_MultiTexCoord2sARB(disp, fn) ((disp)->MultiTexCoord2sARB = fn) +#define CALL_MultiTexCoord2svARB(disp, parameters) (*((disp)->MultiTexCoord2svARB)) parameters +#define GET_MultiTexCoord2svARB(disp) ((disp)->MultiTexCoord2svARB) +#define SET_MultiTexCoord2svARB(disp, fn) ((disp)->MultiTexCoord2svARB = fn) +#define CALL_MultiTexCoord3dARB(disp, parameters) (*((disp)->MultiTexCoord3dARB)) parameters +#define GET_MultiTexCoord3dARB(disp) ((disp)->MultiTexCoord3dARB) +#define SET_MultiTexCoord3dARB(disp, fn) ((disp)->MultiTexCoord3dARB = fn) +#define CALL_MultiTexCoord3dvARB(disp, parameters) (*((disp)->MultiTexCoord3dvARB)) parameters +#define GET_MultiTexCoord3dvARB(disp) ((disp)->MultiTexCoord3dvARB) +#define SET_MultiTexCoord3dvARB(disp, fn) ((disp)->MultiTexCoord3dvARB = fn) +#define CALL_MultiTexCoord3fARB(disp, parameters) (*((disp)->MultiTexCoord3fARB)) parameters +#define GET_MultiTexCoord3fARB(disp) ((disp)->MultiTexCoord3fARB) +#define SET_MultiTexCoord3fARB(disp, fn) ((disp)->MultiTexCoord3fARB = fn) +#define CALL_MultiTexCoord3fvARB(disp, parameters) (*((disp)->MultiTexCoord3fvARB)) parameters +#define GET_MultiTexCoord3fvARB(disp) ((disp)->MultiTexCoord3fvARB) +#define SET_MultiTexCoord3fvARB(disp, fn) ((disp)->MultiTexCoord3fvARB = fn) +#define CALL_MultiTexCoord3iARB(disp, parameters) (*((disp)->MultiTexCoord3iARB)) parameters +#define GET_MultiTexCoord3iARB(disp) ((disp)->MultiTexCoord3iARB) +#define SET_MultiTexCoord3iARB(disp, fn) ((disp)->MultiTexCoord3iARB = fn) +#define CALL_MultiTexCoord3ivARB(disp, parameters) (*((disp)->MultiTexCoord3ivARB)) parameters +#define GET_MultiTexCoord3ivARB(disp) ((disp)->MultiTexCoord3ivARB) +#define SET_MultiTexCoord3ivARB(disp, fn) ((disp)->MultiTexCoord3ivARB = fn) +#define CALL_MultiTexCoord3sARB(disp, parameters) (*((disp)->MultiTexCoord3sARB)) parameters +#define GET_MultiTexCoord3sARB(disp) ((disp)->MultiTexCoord3sARB) +#define SET_MultiTexCoord3sARB(disp, fn) ((disp)->MultiTexCoord3sARB = fn) +#define CALL_MultiTexCoord3svARB(disp, parameters) (*((disp)->MultiTexCoord3svARB)) parameters +#define GET_MultiTexCoord3svARB(disp) ((disp)->MultiTexCoord3svARB) +#define SET_MultiTexCoord3svARB(disp, fn) ((disp)->MultiTexCoord3svARB = fn) +#define CALL_MultiTexCoord4dARB(disp, parameters) (*((disp)->MultiTexCoord4dARB)) parameters +#define GET_MultiTexCoord4dARB(disp) ((disp)->MultiTexCoord4dARB) +#define SET_MultiTexCoord4dARB(disp, fn) ((disp)->MultiTexCoord4dARB = fn) +#define CALL_MultiTexCoord4dvARB(disp, parameters) (*((disp)->MultiTexCoord4dvARB)) parameters +#define GET_MultiTexCoord4dvARB(disp) ((disp)->MultiTexCoord4dvARB) +#define SET_MultiTexCoord4dvARB(disp, fn) ((disp)->MultiTexCoord4dvARB = fn) +#define CALL_MultiTexCoord4fARB(disp, parameters) (*((disp)->MultiTexCoord4fARB)) parameters +#define GET_MultiTexCoord4fARB(disp) ((disp)->MultiTexCoord4fARB) +#define SET_MultiTexCoord4fARB(disp, fn) ((disp)->MultiTexCoord4fARB = fn) +#define CALL_MultiTexCoord4fvARB(disp, parameters) (*((disp)->MultiTexCoord4fvARB)) parameters +#define GET_MultiTexCoord4fvARB(disp) ((disp)->MultiTexCoord4fvARB) +#define SET_MultiTexCoord4fvARB(disp, fn) ((disp)->MultiTexCoord4fvARB = fn) +#define CALL_MultiTexCoord4iARB(disp, parameters) (*((disp)->MultiTexCoord4iARB)) parameters +#define GET_MultiTexCoord4iARB(disp) ((disp)->MultiTexCoord4iARB) +#define SET_MultiTexCoord4iARB(disp, fn) ((disp)->MultiTexCoord4iARB = fn) +#define CALL_MultiTexCoord4ivARB(disp, parameters) (*((disp)->MultiTexCoord4ivARB)) parameters +#define GET_MultiTexCoord4ivARB(disp) ((disp)->MultiTexCoord4ivARB) +#define SET_MultiTexCoord4ivARB(disp, fn) ((disp)->MultiTexCoord4ivARB = fn) +#define CALL_MultiTexCoord4sARB(disp, parameters) (*((disp)->MultiTexCoord4sARB)) parameters +#define GET_MultiTexCoord4sARB(disp) ((disp)->MultiTexCoord4sARB) +#define SET_MultiTexCoord4sARB(disp, fn) ((disp)->MultiTexCoord4sARB = fn) +#define CALL_MultiTexCoord4svARB(disp, parameters) (*((disp)->MultiTexCoord4svARB)) parameters +#define GET_MultiTexCoord4svARB(disp) ((disp)->MultiTexCoord4svARB) +#define SET_MultiTexCoord4svARB(disp, fn) ((disp)->MultiTexCoord4svARB = fn) + +#if !defined(IN_DRI_DRIVER) + +#define CALL_AttachShader(disp, parameters) (*((disp)->AttachShader)) parameters +#define GET_AttachShader(disp) ((disp)->AttachShader) +#define SET_AttachShader(disp, fn) ((disp)->AttachShader = fn) +#define CALL_CreateProgram(disp, parameters) (*((disp)->CreateProgram)) parameters +#define GET_CreateProgram(disp) ((disp)->CreateProgram) +#define SET_CreateProgram(disp, fn) ((disp)->CreateProgram = fn) +#define CALL_CreateShader(disp, parameters) (*((disp)->CreateShader)) parameters +#define GET_CreateShader(disp) ((disp)->CreateShader) +#define SET_CreateShader(disp, fn) ((disp)->CreateShader = fn) +#define CALL_DeleteProgram(disp, parameters) (*((disp)->DeleteProgram)) parameters +#define GET_DeleteProgram(disp) ((disp)->DeleteProgram) +#define SET_DeleteProgram(disp, fn) ((disp)->DeleteProgram = fn) +#define CALL_DeleteShader(disp, parameters) (*((disp)->DeleteShader)) parameters +#define GET_DeleteShader(disp) ((disp)->DeleteShader) +#define SET_DeleteShader(disp, fn) ((disp)->DeleteShader = fn) +#define CALL_DetachShader(disp, parameters) (*((disp)->DetachShader)) parameters +#define GET_DetachShader(disp) ((disp)->DetachShader) +#define SET_DetachShader(disp, fn) ((disp)->DetachShader = fn) +#define CALL_GetAttachedShaders(disp, parameters) (*((disp)->GetAttachedShaders)) parameters +#define GET_GetAttachedShaders(disp) ((disp)->GetAttachedShaders) +#define SET_GetAttachedShaders(disp, fn) ((disp)->GetAttachedShaders = fn) +#define CALL_GetProgramInfoLog(disp, parameters) (*((disp)->GetProgramInfoLog)) parameters +#define GET_GetProgramInfoLog(disp) ((disp)->GetProgramInfoLog) +#define SET_GetProgramInfoLog(disp, fn) ((disp)->GetProgramInfoLog = fn) +#define CALL_GetProgramiv(disp, parameters) (*((disp)->GetProgramiv)) parameters +#define GET_GetProgramiv(disp) ((disp)->GetProgramiv) +#define SET_GetProgramiv(disp, fn) ((disp)->GetProgramiv = fn) +#define CALL_GetShaderInfoLog(disp, parameters) (*((disp)->GetShaderInfoLog)) parameters +#define GET_GetShaderInfoLog(disp) ((disp)->GetShaderInfoLog) +#define SET_GetShaderInfoLog(disp, fn) ((disp)->GetShaderInfoLog = fn) +#define CALL_GetShaderiv(disp, parameters) (*((disp)->GetShaderiv)) parameters +#define GET_GetShaderiv(disp) ((disp)->GetShaderiv) +#define SET_GetShaderiv(disp, fn) ((disp)->GetShaderiv = fn) +#define CALL_IsProgram(disp, parameters) (*((disp)->IsProgram)) parameters +#define GET_IsProgram(disp) ((disp)->IsProgram) +#define SET_IsProgram(disp, fn) ((disp)->IsProgram = fn) +#define CALL_IsShader(disp, parameters) (*((disp)->IsShader)) parameters +#define GET_IsShader(disp) ((disp)->IsShader) +#define SET_IsShader(disp, fn) ((disp)->IsShader = fn) +#define CALL_StencilFuncSeparate(disp, parameters) (*((disp)->StencilFuncSeparate)) parameters +#define GET_StencilFuncSeparate(disp) ((disp)->StencilFuncSeparate) +#define SET_StencilFuncSeparate(disp, fn) ((disp)->StencilFuncSeparate = fn) +#define CALL_StencilMaskSeparate(disp, parameters) (*((disp)->StencilMaskSeparate)) parameters +#define GET_StencilMaskSeparate(disp) ((disp)->StencilMaskSeparate) +#define SET_StencilMaskSeparate(disp, fn) ((disp)->StencilMaskSeparate = fn) +#define CALL_StencilOpSeparate(disp, parameters) (*((disp)->StencilOpSeparate)) parameters +#define GET_StencilOpSeparate(disp) ((disp)->StencilOpSeparate) +#define SET_StencilOpSeparate(disp, fn) ((disp)->StencilOpSeparate = fn) +#define CALL_UniformMatrix2x3fv(disp, parameters) (*((disp)->UniformMatrix2x3fv)) parameters +#define GET_UniformMatrix2x3fv(disp) ((disp)->UniformMatrix2x3fv) +#define SET_UniformMatrix2x3fv(disp, fn) ((disp)->UniformMatrix2x3fv = fn) +#define CALL_UniformMatrix2x4fv(disp, parameters) (*((disp)->UniformMatrix2x4fv)) parameters +#define GET_UniformMatrix2x4fv(disp) ((disp)->UniformMatrix2x4fv) +#define SET_UniformMatrix2x4fv(disp, fn) ((disp)->UniformMatrix2x4fv = fn) +#define CALL_UniformMatrix3x2fv(disp, parameters) (*((disp)->UniformMatrix3x2fv)) parameters +#define GET_UniformMatrix3x2fv(disp) ((disp)->UniformMatrix3x2fv) +#define SET_UniformMatrix3x2fv(disp, fn) ((disp)->UniformMatrix3x2fv = fn) +#define CALL_UniformMatrix3x4fv(disp, parameters) (*((disp)->UniformMatrix3x4fv)) parameters +#define GET_UniformMatrix3x4fv(disp) ((disp)->UniformMatrix3x4fv) +#define SET_UniformMatrix3x4fv(disp, fn) ((disp)->UniformMatrix3x4fv = fn) +#define CALL_UniformMatrix4x2fv(disp, parameters) (*((disp)->UniformMatrix4x2fv)) parameters +#define GET_UniformMatrix4x2fv(disp) ((disp)->UniformMatrix4x2fv) +#define SET_UniformMatrix4x2fv(disp, fn) ((disp)->UniformMatrix4x2fv = fn) +#define CALL_UniformMatrix4x3fv(disp, parameters) (*((disp)->UniformMatrix4x3fv)) parameters +#define GET_UniformMatrix4x3fv(disp) ((disp)->UniformMatrix4x3fv) +#define SET_UniformMatrix4x3fv(disp, fn) ((disp)->UniformMatrix4x3fv = fn) +#define CALL_LoadTransposeMatrixdARB(disp, parameters) (*((disp)->LoadTransposeMatrixdARB)) parameters +#define GET_LoadTransposeMatrixdARB(disp) ((disp)->LoadTransposeMatrixdARB) +#define SET_LoadTransposeMatrixdARB(disp, fn) ((disp)->LoadTransposeMatrixdARB = fn) +#define CALL_LoadTransposeMatrixfARB(disp, parameters) (*((disp)->LoadTransposeMatrixfARB)) parameters +#define GET_LoadTransposeMatrixfARB(disp) ((disp)->LoadTransposeMatrixfARB) +#define SET_LoadTransposeMatrixfARB(disp, fn) ((disp)->LoadTransposeMatrixfARB = fn) +#define CALL_MultTransposeMatrixdARB(disp, parameters) (*((disp)->MultTransposeMatrixdARB)) parameters +#define GET_MultTransposeMatrixdARB(disp) ((disp)->MultTransposeMatrixdARB) +#define SET_MultTransposeMatrixdARB(disp, fn) ((disp)->MultTransposeMatrixdARB = fn) +#define CALL_MultTransposeMatrixfARB(disp, parameters) (*((disp)->MultTransposeMatrixfARB)) parameters +#define GET_MultTransposeMatrixfARB(disp) ((disp)->MultTransposeMatrixfARB) +#define SET_MultTransposeMatrixfARB(disp, fn) ((disp)->MultTransposeMatrixfARB = fn) +#define CALL_SampleCoverageARB(disp, parameters) (*((disp)->SampleCoverageARB)) parameters +#define GET_SampleCoverageARB(disp) ((disp)->SampleCoverageARB) +#define SET_SampleCoverageARB(disp, fn) ((disp)->SampleCoverageARB = fn) +#define CALL_CompressedTexImage1DARB(disp, parameters) (*((disp)->CompressedTexImage1DARB)) parameters +#define GET_CompressedTexImage1DARB(disp) ((disp)->CompressedTexImage1DARB) +#define SET_CompressedTexImage1DARB(disp, fn) ((disp)->CompressedTexImage1DARB = fn) +#define CALL_CompressedTexImage2DARB(disp, parameters) (*((disp)->CompressedTexImage2DARB)) parameters +#define GET_CompressedTexImage2DARB(disp) ((disp)->CompressedTexImage2DARB) +#define SET_CompressedTexImage2DARB(disp, fn) ((disp)->CompressedTexImage2DARB = fn) +#define CALL_CompressedTexImage3DARB(disp, parameters) (*((disp)->CompressedTexImage3DARB)) parameters +#define GET_CompressedTexImage3DARB(disp) ((disp)->CompressedTexImage3DARB) +#define SET_CompressedTexImage3DARB(disp, fn) ((disp)->CompressedTexImage3DARB = fn) +#define CALL_CompressedTexSubImage1DARB(disp, parameters) (*((disp)->CompressedTexSubImage1DARB)) parameters +#define GET_CompressedTexSubImage1DARB(disp) ((disp)->CompressedTexSubImage1DARB) +#define SET_CompressedTexSubImage1DARB(disp, fn) ((disp)->CompressedTexSubImage1DARB = fn) +#define CALL_CompressedTexSubImage2DARB(disp, parameters) (*((disp)->CompressedTexSubImage2DARB)) parameters +#define GET_CompressedTexSubImage2DARB(disp) ((disp)->CompressedTexSubImage2DARB) +#define SET_CompressedTexSubImage2DARB(disp, fn) ((disp)->CompressedTexSubImage2DARB = fn) +#define CALL_CompressedTexSubImage3DARB(disp, parameters) (*((disp)->CompressedTexSubImage3DARB)) parameters +#define GET_CompressedTexSubImage3DARB(disp) ((disp)->CompressedTexSubImage3DARB) +#define SET_CompressedTexSubImage3DARB(disp, fn) ((disp)->CompressedTexSubImage3DARB = fn) +#define CALL_GetCompressedTexImageARB(disp, parameters) (*((disp)->GetCompressedTexImageARB)) parameters +#define GET_GetCompressedTexImageARB(disp) ((disp)->GetCompressedTexImageARB) +#define SET_GetCompressedTexImageARB(disp, fn) ((disp)->GetCompressedTexImageARB = fn) +#define CALL_DisableVertexAttribArrayARB(disp, parameters) (*((disp)->DisableVertexAttribArrayARB)) parameters +#define GET_DisableVertexAttribArrayARB(disp) ((disp)->DisableVertexAttribArrayARB) +#define SET_DisableVertexAttribArrayARB(disp, fn) ((disp)->DisableVertexAttribArrayARB = fn) +#define CALL_EnableVertexAttribArrayARB(disp, parameters) (*((disp)->EnableVertexAttribArrayARB)) parameters +#define GET_EnableVertexAttribArrayARB(disp) ((disp)->EnableVertexAttribArrayARB) +#define SET_EnableVertexAttribArrayARB(disp, fn) ((disp)->EnableVertexAttribArrayARB = fn) +#define CALL_GetProgramEnvParameterdvARB(disp, parameters) (*((disp)->GetProgramEnvParameterdvARB)) parameters +#define GET_GetProgramEnvParameterdvARB(disp) ((disp)->GetProgramEnvParameterdvARB) +#define SET_GetProgramEnvParameterdvARB(disp, fn) ((disp)->GetProgramEnvParameterdvARB = fn) +#define CALL_GetProgramEnvParameterfvARB(disp, parameters) (*((disp)->GetProgramEnvParameterfvARB)) parameters +#define GET_GetProgramEnvParameterfvARB(disp) ((disp)->GetProgramEnvParameterfvARB) +#define SET_GetProgramEnvParameterfvARB(disp, fn) ((disp)->GetProgramEnvParameterfvARB = fn) +#define CALL_GetProgramLocalParameterdvARB(disp, parameters) (*((disp)->GetProgramLocalParameterdvARB)) parameters +#define GET_GetProgramLocalParameterdvARB(disp) ((disp)->GetProgramLocalParameterdvARB) +#define SET_GetProgramLocalParameterdvARB(disp, fn) ((disp)->GetProgramLocalParameterdvARB = fn) +#define CALL_GetProgramLocalParameterfvARB(disp, parameters) (*((disp)->GetProgramLocalParameterfvARB)) parameters +#define GET_GetProgramLocalParameterfvARB(disp) ((disp)->GetProgramLocalParameterfvARB) +#define SET_GetProgramLocalParameterfvARB(disp, fn) ((disp)->GetProgramLocalParameterfvARB = fn) +#define CALL_GetProgramStringARB(disp, parameters) (*((disp)->GetProgramStringARB)) parameters +#define GET_GetProgramStringARB(disp) ((disp)->GetProgramStringARB) +#define SET_GetProgramStringARB(disp, fn) ((disp)->GetProgramStringARB = fn) +#define CALL_GetProgramivARB(disp, parameters) (*((disp)->GetProgramivARB)) parameters +#define GET_GetProgramivARB(disp) ((disp)->GetProgramivARB) +#define SET_GetProgramivARB(disp, fn) ((disp)->GetProgramivARB = fn) +#define CALL_GetVertexAttribdvARB(disp, parameters) (*((disp)->GetVertexAttribdvARB)) parameters +#define GET_GetVertexAttribdvARB(disp) ((disp)->GetVertexAttribdvARB) +#define SET_GetVertexAttribdvARB(disp, fn) ((disp)->GetVertexAttribdvARB = fn) +#define CALL_GetVertexAttribfvARB(disp, parameters) (*((disp)->GetVertexAttribfvARB)) parameters +#define GET_GetVertexAttribfvARB(disp) ((disp)->GetVertexAttribfvARB) +#define SET_GetVertexAttribfvARB(disp, fn) ((disp)->GetVertexAttribfvARB = fn) +#define CALL_GetVertexAttribivARB(disp, parameters) (*((disp)->GetVertexAttribivARB)) parameters +#define GET_GetVertexAttribivARB(disp) ((disp)->GetVertexAttribivARB) +#define SET_GetVertexAttribivARB(disp, fn) ((disp)->GetVertexAttribivARB = fn) +#define CALL_ProgramEnvParameter4dARB(disp, parameters) (*((disp)->ProgramEnvParameter4dARB)) parameters +#define GET_ProgramEnvParameter4dARB(disp) ((disp)->ProgramEnvParameter4dARB) +#define SET_ProgramEnvParameter4dARB(disp, fn) ((disp)->ProgramEnvParameter4dARB = fn) +#define CALL_ProgramEnvParameter4dvARB(disp, parameters) (*((disp)->ProgramEnvParameter4dvARB)) parameters +#define GET_ProgramEnvParameter4dvARB(disp) ((disp)->ProgramEnvParameter4dvARB) +#define SET_ProgramEnvParameter4dvARB(disp, fn) ((disp)->ProgramEnvParameter4dvARB = fn) +#define CALL_ProgramEnvParameter4fARB(disp, parameters) (*((disp)->ProgramEnvParameter4fARB)) parameters +#define GET_ProgramEnvParameter4fARB(disp) ((disp)->ProgramEnvParameter4fARB) +#define SET_ProgramEnvParameter4fARB(disp, fn) ((disp)->ProgramEnvParameter4fARB = fn) +#define CALL_ProgramEnvParameter4fvARB(disp, parameters) (*((disp)->ProgramEnvParameter4fvARB)) parameters +#define GET_ProgramEnvParameter4fvARB(disp) ((disp)->ProgramEnvParameter4fvARB) +#define SET_ProgramEnvParameter4fvARB(disp, fn) ((disp)->ProgramEnvParameter4fvARB = fn) +#define CALL_ProgramLocalParameter4dARB(disp, parameters) (*((disp)->ProgramLocalParameter4dARB)) parameters +#define GET_ProgramLocalParameter4dARB(disp) ((disp)->ProgramLocalParameter4dARB) +#define SET_ProgramLocalParameter4dARB(disp, fn) ((disp)->ProgramLocalParameter4dARB = fn) +#define CALL_ProgramLocalParameter4dvARB(disp, parameters) (*((disp)->ProgramLocalParameter4dvARB)) parameters +#define GET_ProgramLocalParameter4dvARB(disp) ((disp)->ProgramLocalParameter4dvARB) +#define SET_ProgramLocalParameter4dvARB(disp, fn) ((disp)->ProgramLocalParameter4dvARB = fn) +#define CALL_ProgramLocalParameter4fARB(disp, parameters) (*((disp)->ProgramLocalParameter4fARB)) parameters +#define GET_ProgramLocalParameter4fARB(disp) ((disp)->ProgramLocalParameter4fARB) +#define SET_ProgramLocalParameter4fARB(disp, fn) ((disp)->ProgramLocalParameter4fARB = fn) +#define CALL_ProgramLocalParameter4fvARB(disp, parameters) (*((disp)->ProgramLocalParameter4fvARB)) parameters +#define GET_ProgramLocalParameter4fvARB(disp) ((disp)->ProgramLocalParameter4fvARB) +#define SET_ProgramLocalParameter4fvARB(disp, fn) ((disp)->ProgramLocalParameter4fvARB = fn) +#define CALL_ProgramStringARB(disp, parameters) (*((disp)->ProgramStringARB)) parameters +#define GET_ProgramStringARB(disp) ((disp)->ProgramStringARB) +#define SET_ProgramStringARB(disp, fn) ((disp)->ProgramStringARB = fn) +#define CALL_VertexAttrib1dARB(disp, parameters) (*((disp)->VertexAttrib1dARB)) parameters +#define GET_VertexAttrib1dARB(disp) ((disp)->VertexAttrib1dARB) +#define SET_VertexAttrib1dARB(disp, fn) ((disp)->VertexAttrib1dARB = fn) +#define CALL_VertexAttrib1dvARB(disp, parameters) (*((disp)->VertexAttrib1dvARB)) parameters +#define GET_VertexAttrib1dvARB(disp) ((disp)->VertexAttrib1dvARB) +#define SET_VertexAttrib1dvARB(disp, fn) ((disp)->VertexAttrib1dvARB = fn) +#define CALL_VertexAttrib1fARB(disp, parameters) (*((disp)->VertexAttrib1fARB)) parameters +#define GET_VertexAttrib1fARB(disp) ((disp)->VertexAttrib1fARB) +#define SET_VertexAttrib1fARB(disp, fn) ((disp)->VertexAttrib1fARB = fn) +#define CALL_VertexAttrib1fvARB(disp, parameters) (*((disp)->VertexAttrib1fvARB)) parameters +#define GET_VertexAttrib1fvARB(disp) ((disp)->VertexAttrib1fvARB) +#define SET_VertexAttrib1fvARB(disp, fn) ((disp)->VertexAttrib1fvARB = fn) +#define CALL_VertexAttrib1sARB(disp, parameters) (*((disp)->VertexAttrib1sARB)) parameters +#define GET_VertexAttrib1sARB(disp) ((disp)->VertexAttrib1sARB) +#define SET_VertexAttrib1sARB(disp, fn) ((disp)->VertexAttrib1sARB = fn) +#define CALL_VertexAttrib1svARB(disp, parameters) (*((disp)->VertexAttrib1svARB)) parameters +#define GET_VertexAttrib1svARB(disp) ((disp)->VertexAttrib1svARB) +#define SET_VertexAttrib1svARB(disp, fn) ((disp)->VertexAttrib1svARB = fn) +#define CALL_VertexAttrib2dARB(disp, parameters) (*((disp)->VertexAttrib2dARB)) parameters +#define GET_VertexAttrib2dARB(disp) ((disp)->VertexAttrib2dARB) +#define SET_VertexAttrib2dARB(disp, fn) ((disp)->VertexAttrib2dARB = fn) +#define CALL_VertexAttrib2dvARB(disp, parameters) (*((disp)->VertexAttrib2dvARB)) parameters +#define GET_VertexAttrib2dvARB(disp) ((disp)->VertexAttrib2dvARB) +#define SET_VertexAttrib2dvARB(disp, fn) ((disp)->VertexAttrib2dvARB = fn) +#define CALL_VertexAttrib2fARB(disp, parameters) (*((disp)->VertexAttrib2fARB)) parameters +#define GET_VertexAttrib2fARB(disp) ((disp)->VertexAttrib2fARB) +#define SET_VertexAttrib2fARB(disp, fn) ((disp)->VertexAttrib2fARB = fn) +#define CALL_VertexAttrib2fvARB(disp, parameters) (*((disp)->VertexAttrib2fvARB)) parameters +#define GET_VertexAttrib2fvARB(disp) ((disp)->VertexAttrib2fvARB) +#define SET_VertexAttrib2fvARB(disp, fn) ((disp)->VertexAttrib2fvARB = fn) +#define CALL_VertexAttrib2sARB(disp, parameters) (*((disp)->VertexAttrib2sARB)) parameters +#define GET_VertexAttrib2sARB(disp) ((disp)->VertexAttrib2sARB) +#define SET_VertexAttrib2sARB(disp, fn) ((disp)->VertexAttrib2sARB = fn) +#define CALL_VertexAttrib2svARB(disp, parameters) (*((disp)->VertexAttrib2svARB)) parameters +#define GET_VertexAttrib2svARB(disp) ((disp)->VertexAttrib2svARB) +#define SET_VertexAttrib2svARB(disp, fn) ((disp)->VertexAttrib2svARB = fn) +#define CALL_VertexAttrib3dARB(disp, parameters) (*((disp)->VertexAttrib3dARB)) parameters +#define GET_VertexAttrib3dARB(disp) ((disp)->VertexAttrib3dARB) +#define SET_VertexAttrib3dARB(disp, fn) ((disp)->VertexAttrib3dARB = fn) +#define CALL_VertexAttrib3dvARB(disp, parameters) (*((disp)->VertexAttrib3dvARB)) parameters +#define GET_VertexAttrib3dvARB(disp) ((disp)->VertexAttrib3dvARB) +#define SET_VertexAttrib3dvARB(disp, fn) ((disp)->VertexAttrib3dvARB = fn) +#define CALL_VertexAttrib3fARB(disp, parameters) (*((disp)->VertexAttrib3fARB)) parameters +#define GET_VertexAttrib3fARB(disp) ((disp)->VertexAttrib3fARB) +#define SET_VertexAttrib3fARB(disp, fn) ((disp)->VertexAttrib3fARB = fn) +#define CALL_VertexAttrib3fvARB(disp, parameters) (*((disp)->VertexAttrib3fvARB)) parameters +#define GET_VertexAttrib3fvARB(disp) ((disp)->VertexAttrib3fvARB) +#define SET_VertexAttrib3fvARB(disp, fn) ((disp)->VertexAttrib3fvARB = fn) +#define CALL_VertexAttrib3sARB(disp, parameters) (*((disp)->VertexAttrib3sARB)) parameters +#define GET_VertexAttrib3sARB(disp) ((disp)->VertexAttrib3sARB) +#define SET_VertexAttrib3sARB(disp, fn) ((disp)->VertexAttrib3sARB = fn) +#define CALL_VertexAttrib3svARB(disp, parameters) (*((disp)->VertexAttrib3svARB)) parameters +#define GET_VertexAttrib3svARB(disp) ((disp)->VertexAttrib3svARB) +#define SET_VertexAttrib3svARB(disp, fn) ((disp)->VertexAttrib3svARB = fn) +#define CALL_VertexAttrib4NbvARB(disp, parameters) (*((disp)->VertexAttrib4NbvARB)) parameters +#define GET_VertexAttrib4NbvARB(disp) ((disp)->VertexAttrib4NbvARB) +#define SET_VertexAttrib4NbvARB(disp, fn) ((disp)->VertexAttrib4NbvARB = fn) +#define CALL_VertexAttrib4NivARB(disp, parameters) (*((disp)->VertexAttrib4NivARB)) parameters +#define GET_VertexAttrib4NivARB(disp) ((disp)->VertexAttrib4NivARB) +#define SET_VertexAttrib4NivARB(disp, fn) ((disp)->VertexAttrib4NivARB = fn) +#define CALL_VertexAttrib4NsvARB(disp, parameters) (*((disp)->VertexAttrib4NsvARB)) parameters +#define GET_VertexAttrib4NsvARB(disp) ((disp)->VertexAttrib4NsvARB) +#define SET_VertexAttrib4NsvARB(disp, fn) ((disp)->VertexAttrib4NsvARB = fn) +#define CALL_VertexAttrib4NubARB(disp, parameters) (*((disp)->VertexAttrib4NubARB)) parameters +#define GET_VertexAttrib4NubARB(disp) ((disp)->VertexAttrib4NubARB) +#define SET_VertexAttrib4NubARB(disp, fn) ((disp)->VertexAttrib4NubARB = fn) +#define CALL_VertexAttrib4NubvARB(disp, parameters) (*((disp)->VertexAttrib4NubvARB)) parameters +#define GET_VertexAttrib4NubvARB(disp) ((disp)->VertexAttrib4NubvARB) +#define SET_VertexAttrib4NubvARB(disp, fn) ((disp)->VertexAttrib4NubvARB = fn) +#define CALL_VertexAttrib4NuivARB(disp, parameters) (*((disp)->VertexAttrib4NuivARB)) parameters +#define GET_VertexAttrib4NuivARB(disp) ((disp)->VertexAttrib4NuivARB) +#define SET_VertexAttrib4NuivARB(disp, fn) ((disp)->VertexAttrib4NuivARB = fn) +#define CALL_VertexAttrib4NusvARB(disp, parameters) (*((disp)->VertexAttrib4NusvARB)) parameters +#define GET_VertexAttrib4NusvARB(disp) ((disp)->VertexAttrib4NusvARB) +#define SET_VertexAttrib4NusvARB(disp, fn) ((disp)->VertexAttrib4NusvARB = fn) +#define CALL_VertexAttrib4bvARB(disp, parameters) (*((disp)->VertexAttrib4bvARB)) parameters +#define GET_VertexAttrib4bvARB(disp) ((disp)->VertexAttrib4bvARB) +#define SET_VertexAttrib4bvARB(disp, fn) ((disp)->VertexAttrib4bvARB = fn) +#define CALL_VertexAttrib4dARB(disp, parameters) (*((disp)->VertexAttrib4dARB)) parameters +#define GET_VertexAttrib4dARB(disp) ((disp)->VertexAttrib4dARB) +#define SET_VertexAttrib4dARB(disp, fn) ((disp)->VertexAttrib4dARB = fn) +#define CALL_VertexAttrib4dvARB(disp, parameters) (*((disp)->VertexAttrib4dvARB)) parameters +#define GET_VertexAttrib4dvARB(disp) ((disp)->VertexAttrib4dvARB) +#define SET_VertexAttrib4dvARB(disp, fn) ((disp)->VertexAttrib4dvARB = fn) +#define CALL_VertexAttrib4fARB(disp, parameters) (*((disp)->VertexAttrib4fARB)) parameters +#define GET_VertexAttrib4fARB(disp) ((disp)->VertexAttrib4fARB) +#define SET_VertexAttrib4fARB(disp, fn) ((disp)->VertexAttrib4fARB = fn) +#define CALL_VertexAttrib4fvARB(disp, parameters) (*((disp)->VertexAttrib4fvARB)) parameters +#define GET_VertexAttrib4fvARB(disp) ((disp)->VertexAttrib4fvARB) +#define SET_VertexAttrib4fvARB(disp, fn) ((disp)->VertexAttrib4fvARB = fn) +#define CALL_VertexAttrib4ivARB(disp, parameters) (*((disp)->VertexAttrib4ivARB)) parameters +#define GET_VertexAttrib4ivARB(disp) ((disp)->VertexAttrib4ivARB) +#define SET_VertexAttrib4ivARB(disp, fn) ((disp)->VertexAttrib4ivARB = fn) +#define CALL_VertexAttrib4sARB(disp, parameters) (*((disp)->VertexAttrib4sARB)) parameters +#define GET_VertexAttrib4sARB(disp) ((disp)->VertexAttrib4sARB) +#define SET_VertexAttrib4sARB(disp, fn) ((disp)->VertexAttrib4sARB = fn) +#define CALL_VertexAttrib4svARB(disp, parameters) (*((disp)->VertexAttrib4svARB)) parameters +#define GET_VertexAttrib4svARB(disp) ((disp)->VertexAttrib4svARB) +#define SET_VertexAttrib4svARB(disp, fn) ((disp)->VertexAttrib4svARB = fn) +#define CALL_VertexAttrib4ubvARB(disp, parameters) (*((disp)->VertexAttrib4ubvARB)) parameters +#define GET_VertexAttrib4ubvARB(disp) ((disp)->VertexAttrib4ubvARB) +#define SET_VertexAttrib4ubvARB(disp, fn) ((disp)->VertexAttrib4ubvARB = fn) +#define CALL_VertexAttrib4uivARB(disp, parameters) (*((disp)->VertexAttrib4uivARB)) parameters +#define GET_VertexAttrib4uivARB(disp) ((disp)->VertexAttrib4uivARB) +#define SET_VertexAttrib4uivARB(disp, fn) ((disp)->VertexAttrib4uivARB = fn) +#define CALL_VertexAttrib4usvARB(disp, parameters) (*((disp)->VertexAttrib4usvARB)) parameters +#define GET_VertexAttrib4usvARB(disp) ((disp)->VertexAttrib4usvARB) +#define SET_VertexAttrib4usvARB(disp, fn) ((disp)->VertexAttrib4usvARB = fn) +#define CALL_VertexAttribPointerARB(disp, parameters) (*((disp)->VertexAttribPointerARB)) parameters +#define GET_VertexAttribPointerARB(disp) ((disp)->VertexAttribPointerARB) +#define SET_VertexAttribPointerARB(disp, fn) ((disp)->VertexAttribPointerARB = fn) +#define CALL_BindBufferARB(disp, parameters) (*((disp)->BindBufferARB)) parameters +#define GET_BindBufferARB(disp) ((disp)->BindBufferARB) +#define SET_BindBufferARB(disp, fn) ((disp)->BindBufferARB = fn) +#define CALL_BufferDataARB(disp, parameters) (*((disp)->BufferDataARB)) parameters +#define GET_BufferDataARB(disp) ((disp)->BufferDataARB) +#define SET_BufferDataARB(disp, fn) ((disp)->BufferDataARB = fn) +#define CALL_BufferSubDataARB(disp, parameters) (*((disp)->BufferSubDataARB)) parameters +#define GET_BufferSubDataARB(disp) ((disp)->BufferSubDataARB) +#define SET_BufferSubDataARB(disp, fn) ((disp)->BufferSubDataARB = fn) +#define CALL_DeleteBuffersARB(disp, parameters) (*((disp)->DeleteBuffersARB)) parameters +#define GET_DeleteBuffersARB(disp) ((disp)->DeleteBuffersARB) +#define SET_DeleteBuffersARB(disp, fn) ((disp)->DeleteBuffersARB = fn) +#define CALL_GenBuffersARB(disp, parameters) (*((disp)->GenBuffersARB)) parameters +#define GET_GenBuffersARB(disp) ((disp)->GenBuffersARB) +#define SET_GenBuffersARB(disp, fn) ((disp)->GenBuffersARB = fn) +#define CALL_GetBufferParameterivARB(disp, parameters) (*((disp)->GetBufferParameterivARB)) parameters +#define GET_GetBufferParameterivARB(disp) ((disp)->GetBufferParameterivARB) +#define SET_GetBufferParameterivARB(disp, fn) ((disp)->GetBufferParameterivARB = fn) +#define CALL_GetBufferPointervARB(disp, parameters) (*((disp)->GetBufferPointervARB)) parameters +#define GET_GetBufferPointervARB(disp) ((disp)->GetBufferPointervARB) +#define SET_GetBufferPointervARB(disp, fn) ((disp)->GetBufferPointervARB = fn) +#define CALL_GetBufferSubDataARB(disp, parameters) (*((disp)->GetBufferSubDataARB)) parameters +#define GET_GetBufferSubDataARB(disp) ((disp)->GetBufferSubDataARB) +#define SET_GetBufferSubDataARB(disp, fn) ((disp)->GetBufferSubDataARB = fn) +#define CALL_IsBufferARB(disp, parameters) (*((disp)->IsBufferARB)) parameters +#define GET_IsBufferARB(disp) ((disp)->IsBufferARB) +#define SET_IsBufferARB(disp, fn) ((disp)->IsBufferARB = fn) +#define CALL_MapBufferARB(disp, parameters) (*((disp)->MapBufferARB)) parameters +#define GET_MapBufferARB(disp) ((disp)->MapBufferARB) +#define SET_MapBufferARB(disp, fn) ((disp)->MapBufferARB = fn) +#define CALL_UnmapBufferARB(disp, parameters) (*((disp)->UnmapBufferARB)) parameters +#define GET_UnmapBufferARB(disp) ((disp)->UnmapBufferARB) +#define SET_UnmapBufferARB(disp, fn) ((disp)->UnmapBufferARB = fn) +#define CALL_BeginQueryARB(disp, parameters) (*((disp)->BeginQueryARB)) parameters +#define GET_BeginQueryARB(disp) ((disp)->BeginQueryARB) +#define SET_BeginQueryARB(disp, fn) ((disp)->BeginQueryARB = fn) +#define CALL_DeleteQueriesARB(disp, parameters) (*((disp)->DeleteQueriesARB)) parameters +#define GET_DeleteQueriesARB(disp) ((disp)->DeleteQueriesARB) +#define SET_DeleteQueriesARB(disp, fn) ((disp)->DeleteQueriesARB = fn) +#define CALL_EndQueryARB(disp, parameters) (*((disp)->EndQueryARB)) parameters +#define GET_EndQueryARB(disp) ((disp)->EndQueryARB) +#define SET_EndQueryARB(disp, fn) ((disp)->EndQueryARB = fn) +#define CALL_GenQueriesARB(disp, parameters) (*((disp)->GenQueriesARB)) parameters +#define GET_GenQueriesARB(disp) ((disp)->GenQueriesARB) +#define SET_GenQueriesARB(disp, fn) ((disp)->GenQueriesARB = fn) +#define CALL_GetQueryObjectivARB(disp, parameters) (*((disp)->GetQueryObjectivARB)) parameters +#define GET_GetQueryObjectivARB(disp) ((disp)->GetQueryObjectivARB) +#define SET_GetQueryObjectivARB(disp, fn) ((disp)->GetQueryObjectivARB = fn) +#define CALL_GetQueryObjectuivARB(disp, parameters) (*((disp)->GetQueryObjectuivARB)) parameters +#define GET_GetQueryObjectuivARB(disp) ((disp)->GetQueryObjectuivARB) +#define SET_GetQueryObjectuivARB(disp, fn) ((disp)->GetQueryObjectuivARB = fn) +#define CALL_GetQueryivARB(disp, parameters) (*((disp)->GetQueryivARB)) parameters +#define GET_GetQueryivARB(disp) ((disp)->GetQueryivARB) +#define SET_GetQueryivARB(disp, fn) ((disp)->GetQueryivARB = fn) +#define CALL_IsQueryARB(disp, parameters) (*((disp)->IsQueryARB)) parameters +#define GET_IsQueryARB(disp) ((disp)->IsQueryARB) +#define SET_IsQueryARB(disp, fn) ((disp)->IsQueryARB = fn) +#define CALL_AttachObjectARB(disp, parameters) (*((disp)->AttachObjectARB)) parameters +#define GET_AttachObjectARB(disp) ((disp)->AttachObjectARB) +#define SET_AttachObjectARB(disp, fn) ((disp)->AttachObjectARB = fn) +#define CALL_CompileShaderARB(disp, parameters) (*((disp)->CompileShaderARB)) parameters +#define GET_CompileShaderARB(disp) ((disp)->CompileShaderARB) +#define SET_CompileShaderARB(disp, fn) ((disp)->CompileShaderARB = fn) +#define CALL_CreateProgramObjectARB(disp, parameters) (*((disp)->CreateProgramObjectARB)) parameters +#define GET_CreateProgramObjectARB(disp) ((disp)->CreateProgramObjectARB) +#define SET_CreateProgramObjectARB(disp, fn) ((disp)->CreateProgramObjectARB = fn) +#define CALL_CreateShaderObjectARB(disp, parameters) (*((disp)->CreateShaderObjectARB)) parameters +#define GET_CreateShaderObjectARB(disp) ((disp)->CreateShaderObjectARB) +#define SET_CreateShaderObjectARB(disp, fn) ((disp)->CreateShaderObjectARB = fn) +#define CALL_DeleteObjectARB(disp, parameters) (*((disp)->DeleteObjectARB)) parameters +#define GET_DeleteObjectARB(disp) ((disp)->DeleteObjectARB) +#define SET_DeleteObjectARB(disp, fn) ((disp)->DeleteObjectARB = fn) +#define CALL_DetachObjectARB(disp, parameters) (*((disp)->DetachObjectARB)) parameters +#define GET_DetachObjectARB(disp) ((disp)->DetachObjectARB) +#define SET_DetachObjectARB(disp, fn) ((disp)->DetachObjectARB = fn) +#define CALL_GetActiveUniformARB(disp, parameters) (*((disp)->GetActiveUniformARB)) parameters +#define GET_GetActiveUniformARB(disp) ((disp)->GetActiveUniformARB) +#define SET_GetActiveUniformARB(disp, fn) ((disp)->GetActiveUniformARB = fn) +#define CALL_GetAttachedObjectsARB(disp, parameters) (*((disp)->GetAttachedObjectsARB)) parameters +#define GET_GetAttachedObjectsARB(disp) ((disp)->GetAttachedObjectsARB) +#define SET_GetAttachedObjectsARB(disp, fn) ((disp)->GetAttachedObjectsARB = fn) +#define CALL_GetHandleARB(disp, parameters) (*((disp)->GetHandleARB)) parameters +#define GET_GetHandleARB(disp) ((disp)->GetHandleARB) +#define SET_GetHandleARB(disp, fn) ((disp)->GetHandleARB = fn) +#define CALL_GetInfoLogARB(disp, parameters) (*((disp)->GetInfoLogARB)) parameters +#define GET_GetInfoLogARB(disp) ((disp)->GetInfoLogARB) +#define SET_GetInfoLogARB(disp, fn) ((disp)->GetInfoLogARB = fn) +#define CALL_GetObjectParameterfvARB(disp, parameters) (*((disp)->GetObjectParameterfvARB)) parameters +#define GET_GetObjectParameterfvARB(disp) ((disp)->GetObjectParameterfvARB) +#define SET_GetObjectParameterfvARB(disp, fn) ((disp)->GetObjectParameterfvARB = fn) +#define CALL_GetObjectParameterivARB(disp, parameters) (*((disp)->GetObjectParameterivARB)) parameters +#define GET_GetObjectParameterivARB(disp) ((disp)->GetObjectParameterivARB) +#define SET_GetObjectParameterivARB(disp, fn) ((disp)->GetObjectParameterivARB = fn) +#define CALL_GetShaderSourceARB(disp, parameters) (*((disp)->GetShaderSourceARB)) parameters +#define GET_GetShaderSourceARB(disp) ((disp)->GetShaderSourceARB) +#define SET_GetShaderSourceARB(disp, fn) ((disp)->GetShaderSourceARB = fn) +#define CALL_GetUniformLocationARB(disp, parameters) (*((disp)->GetUniformLocationARB)) parameters +#define GET_GetUniformLocationARB(disp) ((disp)->GetUniformLocationARB) +#define SET_GetUniformLocationARB(disp, fn) ((disp)->GetUniformLocationARB = fn) +#define CALL_GetUniformfvARB(disp, parameters) (*((disp)->GetUniformfvARB)) parameters +#define GET_GetUniformfvARB(disp) ((disp)->GetUniformfvARB) +#define SET_GetUniformfvARB(disp, fn) ((disp)->GetUniformfvARB = fn) +#define CALL_GetUniformivARB(disp, parameters) (*((disp)->GetUniformivARB)) parameters +#define GET_GetUniformivARB(disp) ((disp)->GetUniformivARB) +#define SET_GetUniformivARB(disp, fn) ((disp)->GetUniformivARB = fn) +#define CALL_LinkProgramARB(disp, parameters) (*((disp)->LinkProgramARB)) parameters +#define GET_LinkProgramARB(disp) ((disp)->LinkProgramARB) +#define SET_LinkProgramARB(disp, fn) ((disp)->LinkProgramARB = fn) +#define CALL_ShaderSourceARB(disp, parameters) (*((disp)->ShaderSourceARB)) parameters +#define GET_ShaderSourceARB(disp) ((disp)->ShaderSourceARB) +#define SET_ShaderSourceARB(disp, fn) ((disp)->ShaderSourceARB = fn) +#define CALL_Uniform1fARB(disp, parameters) (*((disp)->Uniform1fARB)) parameters +#define GET_Uniform1fARB(disp) ((disp)->Uniform1fARB) +#define SET_Uniform1fARB(disp, fn) ((disp)->Uniform1fARB = fn) +#define CALL_Uniform1fvARB(disp, parameters) (*((disp)->Uniform1fvARB)) parameters +#define GET_Uniform1fvARB(disp) ((disp)->Uniform1fvARB) +#define SET_Uniform1fvARB(disp, fn) ((disp)->Uniform1fvARB = fn) +#define CALL_Uniform1iARB(disp, parameters) (*((disp)->Uniform1iARB)) parameters +#define GET_Uniform1iARB(disp) ((disp)->Uniform1iARB) +#define SET_Uniform1iARB(disp, fn) ((disp)->Uniform1iARB = fn) +#define CALL_Uniform1ivARB(disp, parameters) (*((disp)->Uniform1ivARB)) parameters +#define GET_Uniform1ivARB(disp) ((disp)->Uniform1ivARB) +#define SET_Uniform1ivARB(disp, fn) ((disp)->Uniform1ivARB = fn) +#define CALL_Uniform2fARB(disp, parameters) (*((disp)->Uniform2fARB)) parameters +#define GET_Uniform2fARB(disp) ((disp)->Uniform2fARB) +#define SET_Uniform2fARB(disp, fn) ((disp)->Uniform2fARB = fn) +#define CALL_Uniform2fvARB(disp, parameters) (*((disp)->Uniform2fvARB)) parameters +#define GET_Uniform2fvARB(disp) ((disp)->Uniform2fvARB) +#define SET_Uniform2fvARB(disp, fn) ((disp)->Uniform2fvARB = fn) +#define CALL_Uniform2iARB(disp, parameters) (*((disp)->Uniform2iARB)) parameters +#define GET_Uniform2iARB(disp) ((disp)->Uniform2iARB) +#define SET_Uniform2iARB(disp, fn) ((disp)->Uniform2iARB = fn) +#define CALL_Uniform2ivARB(disp, parameters) (*((disp)->Uniform2ivARB)) parameters +#define GET_Uniform2ivARB(disp) ((disp)->Uniform2ivARB) +#define SET_Uniform2ivARB(disp, fn) ((disp)->Uniform2ivARB = fn) +#define CALL_Uniform3fARB(disp, parameters) (*((disp)->Uniform3fARB)) parameters +#define GET_Uniform3fARB(disp) ((disp)->Uniform3fARB) +#define SET_Uniform3fARB(disp, fn) ((disp)->Uniform3fARB = fn) +#define CALL_Uniform3fvARB(disp, parameters) (*((disp)->Uniform3fvARB)) parameters +#define GET_Uniform3fvARB(disp) ((disp)->Uniform3fvARB) +#define SET_Uniform3fvARB(disp, fn) ((disp)->Uniform3fvARB = fn) +#define CALL_Uniform3iARB(disp, parameters) (*((disp)->Uniform3iARB)) parameters +#define GET_Uniform3iARB(disp) ((disp)->Uniform3iARB) +#define SET_Uniform3iARB(disp, fn) ((disp)->Uniform3iARB = fn) +#define CALL_Uniform3ivARB(disp, parameters) (*((disp)->Uniform3ivARB)) parameters +#define GET_Uniform3ivARB(disp) ((disp)->Uniform3ivARB) +#define SET_Uniform3ivARB(disp, fn) ((disp)->Uniform3ivARB = fn) +#define CALL_Uniform4fARB(disp, parameters) (*((disp)->Uniform4fARB)) parameters +#define GET_Uniform4fARB(disp) ((disp)->Uniform4fARB) +#define SET_Uniform4fARB(disp, fn) ((disp)->Uniform4fARB = fn) +#define CALL_Uniform4fvARB(disp, parameters) (*((disp)->Uniform4fvARB)) parameters +#define GET_Uniform4fvARB(disp) ((disp)->Uniform4fvARB) +#define SET_Uniform4fvARB(disp, fn) ((disp)->Uniform4fvARB = fn) +#define CALL_Uniform4iARB(disp, parameters) (*((disp)->Uniform4iARB)) parameters +#define GET_Uniform4iARB(disp) ((disp)->Uniform4iARB) +#define SET_Uniform4iARB(disp, fn) ((disp)->Uniform4iARB = fn) +#define CALL_Uniform4ivARB(disp, parameters) (*((disp)->Uniform4ivARB)) parameters +#define GET_Uniform4ivARB(disp) ((disp)->Uniform4ivARB) +#define SET_Uniform4ivARB(disp, fn) ((disp)->Uniform4ivARB = fn) +#define CALL_UniformMatrix2fvARB(disp, parameters) (*((disp)->UniformMatrix2fvARB)) parameters +#define GET_UniformMatrix2fvARB(disp) ((disp)->UniformMatrix2fvARB) +#define SET_UniformMatrix2fvARB(disp, fn) ((disp)->UniformMatrix2fvARB = fn) +#define CALL_UniformMatrix3fvARB(disp, parameters) (*((disp)->UniformMatrix3fvARB)) parameters +#define GET_UniformMatrix3fvARB(disp) ((disp)->UniformMatrix3fvARB) +#define SET_UniformMatrix3fvARB(disp, fn) ((disp)->UniformMatrix3fvARB = fn) +#define CALL_UniformMatrix4fvARB(disp, parameters) (*((disp)->UniformMatrix4fvARB)) parameters +#define GET_UniformMatrix4fvARB(disp) ((disp)->UniformMatrix4fvARB) +#define SET_UniformMatrix4fvARB(disp, fn) ((disp)->UniformMatrix4fvARB = fn) +#define CALL_UseProgramObjectARB(disp, parameters) (*((disp)->UseProgramObjectARB)) parameters +#define GET_UseProgramObjectARB(disp) ((disp)->UseProgramObjectARB) +#define SET_UseProgramObjectARB(disp, fn) ((disp)->UseProgramObjectARB = fn) +#define CALL_ValidateProgramARB(disp, parameters) (*((disp)->ValidateProgramARB)) parameters +#define GET_ValidateProgramARB(disp) ((disp)->ValidateProgramARB) +#define SET_ValidateProgramARB(disp, fn) ((disp)->ValidateProgramARB = fn) +#define CALL_BindAttribLocationARB(disp, parameters) (*((disp)->BindAttribLocationARB)) parameters +#define GET_BindAttribLocationARB(disp) ((disp)->BindAttribLocationARB) +#define SET_BindAttribLocationARB(disp, fn) ((disp)->BindAttribLocationARB = fn) +#define CALL_GetActiveAttribARB(disp, parameters) (*((disp)->GetActiveAttribARB)) parameters +#define GET_GetActiveAttribARB(disp) ((disp)->GetActiveAttribARB) +#define SET_GetActiveAttribARB(disp, fn) ((disp)->GetActiveAttribARB = fn) +#define CALL_GetAttribLocationARB(disp, parameters) (*((disp)->GetAttribLocationARB)) parameters +#define GET_GetAttribLocationARB(disp) ((disp)->GetAttribLocationARB) +#define SET_GetAttribLocationARB(disp, fn) ((disp)->GetAttribLocationARB = fn) +#define CALL_DrawBuffersARB(disp, parameters) (*((disp)->DrawBuffersARB)) parameters +#define GET_DrawBuffersARB(disp) ((disp)->DrawBuffersARB) +#define SET_DrawBuffersARB(disp, fn) ((disp)->DrawBuffersARB = fn) +#define CALL_RenderbufferStorageMultisample(disp, parameters) (*((disp)->RenderbufferStorageMultisample)) parameters +#define GET_RenderbufferStorageMultisample(disp) ((disp)->RenderbufferStorageMultisample) +#define SET_RenderbufferStorageMultisample(disp, fn) ((disp)->RenderbufferStorageMultisample = fn) +#define CALL_FlushMappedBufferRange(disp, parameters) (*((disp)->FlushMappedBufferRange)) parameters +#define GET_FlushMappedBufferRange(disp) ((disp)->FlushMappedBufferRange) +#define SET_FlushMappedBufferRange(disp, fn) ((disp)->FlushMappedBufferRange = fn) +#define CALL_MapBufferRange(disp, parameters) (*((disp)->MapBufferRange)) parameters +#define GET_MapBufferRange(disp) ((disp)->MapBufferRange) +#define SET_MapBufferRange(disp, fn) ((disp)->MapBufferRange = fn) +#define CALL_BindVertexArray(disp, parameters) (*((disp)->BindVertexArray)) parameters +#define GET_BindVertexArray(disp) ((disp)->BindVertexArray) +#define SET_BindVertexArray(disp, fn) ((disp)->BindVertexArray = fn) +#define CALL_GenVertexArrays(disp, parameters) (*((disp)->GenVertexArrays)) parameters +#define GET_GenVertexArrays(disp) ((disp)->GenVertexArrays) +#define SET_GenVertexArrays(disp, fn) ((disp)->GenVertexArrays = fn) +#define CALL_CopyBufferSubData(disp, parameters) (*((disp)->CopyBufferSubData)) parameters +#define GET_CopyBufferSubData(disp) ((disp)->CopyBufferSubData) +#define SET_CopyBufferSubData(disp, fn) ((disp)->CopyBufferSubData = fn) +#define CALL_ClientWaitSync(disp, parameters) (*((disp)->ClientWaitSync)) parameters +#define GET_ClientWaitSync(disp) ((disp)->ClientWaitSync) +#define SET_ClientWaitSync(disp, fn) ((disp)->ClientWaitSync = fn) +#define CALL_DeleteSync(disp, parameters) (*((disp)->DeleteSync)) parameters +#define GET_DeleteSync(disp) ((disp)->DeleteSync) +#define SET_DeleteSync(disp, fn) ((disp)->DeleteSync = fn) +#define CALL_FenceSync(disp, parameters) (*((disp)->FenceSync)) parameters +#define GET_FenceSync(disp) ((disp)->FenceSync) +#define SET_FenceSync(disp, fn) ((disp)->FenceSync = fn) +#define CALL_GetInteger64v(disp, parameters) (*((disp)->GetInteger64v)) parameters +#define GET_GetInteger64v(disp) ((disp)->GetInteger64v) +#define SET_GetInteger64v(disp, fn) ((disp)->GetInteger64v = fn) +#define CALL_GetSynciv(disp, parameters) (*((disp)->GetSynciv)) parameters +#define GET_GetSynciv(disp) ((disp)->GetSynciv) +#define SET_GetSynciv(disp, fn) ((disp)->GetSynciv = fn) +#define CALL_IsSync(disp, parameters) (*((disp)->IsSync)) parameters +#define GET_IsSync(disp) ((disp)->IsSync) +#define SET_IsSync(disp, fn) ((disp)->IsSync = fn) +#define CALL_WaitSync(disp, parameters) (*((disp)->WaitSync)) parameters +#define GET_WaitSync(disp) ((disp)->WaitSync) +#define SET_WaitSync(disp, fn) ((disp)->WaitSync = fn) +#define CALL_DrawElementsBaseVertex(disp, parameters) (*((disp)->DrawElementsBaseVertex)) parameters +#define GET_DrawElementsBaseVertex(disp) ((disp)->DrawElementsBaseVertex) +#define SET_DrawElementsBaseVertex(disp, fn) ((disp)->DrawElementsBaseVertex = fn) +#define CALL_DrawRangeElementsBaseVertex(disp, parameters) (*((disp)->DrawRangeElementsBaseVertex)) parameters +#define GET_DrawRangeElementsBaseVertex(disp) ((disp)->DrawRangeElementsBaseVertex) +#define SET_DrawRangeElementsBaseVertex(disp, fn) ((disp)->DrawRangeElementsBaseVertex = fn) +#define CALL_MultiDrawElementsBaseVertex(disp, parameters) (*((disp)->MultiDrawElementsBaseVertex)) parameters +#define GET_MultiDrawElementsBaseVertex(disp) ((disp)->MultiDrawElementsBaseVertex) +#define SET_MultiDrawElementsBaseVertex(disp, fn) ((disp)->MultiDrawElementsBaseVertex = fn) +#define CALL_PolygonOffsetEXT(disp, parameters) (*((disp)->PolygonOffsetEXT)) parameters +#define GET_PolygonOffsetEXT(disp) ((disp)->PolygonOffsetEXT) +#define SET_PolygonOffsetEXT(disp, fn) ((disp)->PolygonOffsetEXT = fn) +#define CALL_GetPixelTexGenParameterfvSGIS(disp, parameters) (*((disp)->GetPixelTexGenParameterfvSGIS)) parameters +#define GET_GetPixelTexGenParameterfvSGIS(disp) ((disp)->GetPixelTexGenParameterfvSGIS) +#define SET_GetPixelTexGenParameterfvSGIS(disp, fn) ((disp)->GetPixelTexGenParameterfvSGIS = fn) +#define CALL_GetPixelTexGenParameterivSGIS(disp, parameters) (*((disp)->GetPixelTexGenParameterivSGIS)) parameters +#define GET_GetPixelTexGenParameterivSGIS(disp) ((disp)->GetPixelTexGenParameterivSGIS) +#define SET_GetPixelTexGenParameterivSGIS(disp, fn) ((disp)->GetPixelTexGenParameterivSGIS = fn) +#define CALL_PixelTexGenParameterfSGIS(disp, parameters) (*((disp)->PixelTexGenParameterfSGIS)) parameters +#define GET_PixelTexGenParameterfSGIS(disp) ((disp)->PixelTexGenParameterfSGIS) +#define SET_PixelTexGenParameterfSGIS(disp, fn) ((disp)->PixelTexGenParameterfSGIS = fn) +#define CALL_PixelTexGenParameterfvSGIS(disp, parameters) (*((disp)->PixelTexGenParameterfvSGIS)) parameters +#define GET_PixelTexGenParameterfvSGIS(disp) ((disp)->PixelTexGenParameterfvSGIS) +#define SET_PixelTexGenParameterfvSGIS(disp, fn) ((disp)->PixelTexGenParameterfvSGIS = fn) +#define CALL_PixelTexGenParameteriSGIS(disp, parameters) (*((disp)->PixelTexGenParameteriSGIS)) parameters +#define GET_PixelTexGenParameteriSGIS(disp) ((disp)->PixelTexGenParameteriSGIS) +#define SET_PixelTexGenParameteriSGIS(disp, fn) ((disp)->PixelTexGenParameteriSGIS = fn) +#define CALL_PixelTexGenParameterivSGIS(disp, parameters) (*((disp)->PixelTexGenParameterivSGIS)) parameters +#define GET_PixelTexGenParameterivSGIS(disp) ((disp)->PixelTexGenParameterivSGIS) +#define SET_PixelTexGenParameterivSGIS(disp, fn) ((disp)->PixelTexGenParameterivSGIS = fn) +#define CALL_SampleMaskSGIS(disp, parameters) (*((disp)->SampleMaskSGIS)) parameters +#define GET_SampleMaskSGIS(disp) ((disp)->SampleMaskSGIS) +#define SET_SampleMaskSGIS(disp, fn) ((disp)->SampleMaskSGIS = fn) +#define CALL_SamplePatternSGIS(disp, parameters) (*((disp)->SamplePatternSGIS)) parameters +#define GET_SamplePatternSGIS(disp) ((disp)->SamplePatternSGIS) +#define SET_SamplePatternSGIS(disp, fn) ((disp)->SamplePatternSGIS = fn) +#define CALL_ColorPointerEXT(disp, parameters) (*((disp)->ColorPointerEXT)) parameters +#define GET_ColorPointerEXT(disp) ((disp)->ColorPointerEXT) +#define SET_ColorPointerEXT(disp, fn) ((disp)->ColorPointerEXT = fn) +#define CALL_EdgeFlagPointerEXT(disp, parameters) (*((disp)->EdgeFlagPointerEXT)) parameters +#define GET_EdgeFlagPointerEXT(disp) ((disp)->EdgeFlagPointerEXT) +#define SET_EdgeFlagPointerEXT(disp, fn) ((disp)->EdgeFlagPointerEXT = fn) +#define CALL_IndexPointerEXT(disp, parameters) (*((disp)->IndexPointerEXT)) parameters +#define GET_IndexPointerEXT(disp) ((disp)->IndexPointerEXT) +#define SET_IndexPointerEXT(disp, fn) ((disp)->IndexPointerEXT = fn) +#define CALL_NormalPointerEXT(disp, parameters) (*((disp)->NormalPointerEXT)) parameters +#define GET_NormalPointerEXT(disp) ((disp)->NormalPointerEXT) +#define SET_NormalPointerEXT(disp, fn) ((disp)->NormalPointerEXT = fn) +#define CALL_TexCoordPointerEXT(disp, parameters) (*((disp)->TexCoordPointerEXT)) parameters +#define GET_TexCoordPointerEXT(disp) ((disp)->TexCoordPointerEXT) +#define SET_TexCoordPointerEXT(disp, fn) ((disp)->TexCoordPointerEXT = fn) +#define CALL_VertexPointerEXT(disp, parameters) (*((disp)->VertexPointerEXT)) parameters +#define GET_VertexPointerEXT(disp) ((disp)->VertexPointerEXT) +#define SET_VertexPointerEXT(disp, fn) ((disp)->VertexPointerEXT = fn) +#define CALL_PointParameterfEXT(disp, parameters) (*((disp)->PointParameterfEXT)) parameters +#define GET_PointParameterfEXT(disp) ((disp)->PointParameterfEXT) +#define SET_PointParameterfEXT(disp, fn) ((disp)->PointParameterfEXT = fn) +#define CALL_PointParameterfvEXT(disp, parameters) (*((disp)->PointParameterfvEXT)) parameters +#define GET_PointParameterfvEXT(disp) ((disp)->PointParameterfvEXT) +#define SET_PointParameterfvEXT(disp, fn) ((disp)->PointParameterfvEXT = fn) +#define CALL_LockArraysEXT(disp, parameters) (*((disp)->LockArraysEXT)) parameters +#define GET_LockArraysEXT(disp) ((disp)->LockArraysEXT) +#define SET_LockArraysEXT(disp, fn) ((disp)->LockArraysEXT = fn) +#define CALL_UnlockArraysEXT(disp, parameters) (*((disp)->UnlockArraysEXT)) parameters +#define GET_UnlockArraysEXT(disp) ((disp)->UnlockArraysEXT) +#define SET_UnlockArraysEXT(disp, fn) ((disp)->UnlockArraysEXT = fn) +#define CALL_CullParameterdvEXT(disp, parameters) (*((disp)->CullParameterdvEXT)) parameters +#define GET_CullParameterdvEXT(disp) ((disp)->CullParameterdvEXT) +#define SET_CullParameterdvEXT(disp, fn) ((disp)->CullParameterdvEXT = fn) +#define CALL_CullParameterfvEXT(disp, parameters) (*((disp)->CullParameterfvEXT)) parameters +#define GET_CullParameterfvEXT(disp) ((disp)->CullParameterfvEXT) +#define SET_CullParameterfvEXT(disp, fn) ((disp)->CullParameterfvEXT = fn) +#define CALL_SecondaryColor3bEXT(disp, parameters) (*((disp)->SecondaryColor3bEXT)) parameters +#define GET_SecondaryColor3bEXT(disp) ((disp)->SecondaryColor3bEXT) +#define SET_SecondaryColor3bEXT(disp, fn) ((disp)->SecondaryColor3bEXT = fn) +#define CALL_SecondaryColor3bvEXT(disp, parameters) (*((disp)->SecondaryColor3bvEXT)) parameters +#define GET_SecondaryColor3bvEXT(disp) ((disp)->SecondaryColor3bvEXT) +#define SET_SecondaryColor3bvEXT(disp, fn) ((disp)->SecondaryColor3bvEXT = fn) +#define CALL_SecondaryColor3dEXT(disp, parameters) (*((disp)->SecondaryColor3dEXT)) parameters +#define GET_SecondaryColor3dEXT(disp) ((disp)->SecondaryColor3dEXT) +#define SET_SecondaryColor3dEXT(disp, fn) ((disp)->SecondaryColor3dEXT = fn) +#define CALL_SecondaryColor3dvEXT(disp, parameters) (*((disp)->SecondaryColor3dvEXT)) parameters +#define GET_SecondaryColor3dvEXT(disp) ((disp)->SecondaryColor3dvEXT) +#define SET_SecondaryColor3dvEXT(disp, fn) ((disp)->SecondaryColor3dvEXT = fn) +#define CALL_SecondaryColor3fEXT(disp, parameters) (*((disp)->SecondaryColor3fEXT)) parameters +#define GET_SecondaryColor3fEXT(disp) ((disp)->SecondaryColor3fEXT) +#define SET_SecondaryColor3fEXT(disp, fn) ((disp)->SecondaryColor3fEXT = fn) +#define CALL_SecondaryColor3fvEXT(disp, parameters) (*((disp)->SecondaryColor3fvEXT)) parameters +#define GET_SecondaryColor3fvEXT(disp) ((disp)->SecondaryColor3fvEXT) +#define SET_SecondaryColor3fvEXT(disp, fn) ((disp)->SecondaryColor3fvEXT = fn) +#define CALL_SecondaryColor3iEXT(disp, parameters) (*((disp)->SecondaryColor3iEXT)) parameters +#define GET_SecondaryColor3iEXT(disp) ((disp)->SecondaryColor3iEXT) +#define SET_SecondaryColor3iEXT(disp, fn) ((disp)->SecondaryColor3iEXT = fn) +#define CALL_SecondaryColor3ivEXT(disp, parameters) (*((disp)->SecondaryColor3ivEXT)) parameters +#define GET_SecondaryColor3ivEXT(disp) ((disp)->SecondaryColor3ivEXT) +#define SET_SecondaryColor3ivEXT(disp, fn) ((disp)->SecondaryColor3ivEXT = fn) +#define CALL_SecondaryColor3sEXT(disp, parameters) (*((disp)->SecondaryColor3sEXT)) parameters +#define GET_SecondaryColor3sEXT(disp) ((disp)->SecondaryColor3sEXT) +#define SET_SecondaryColor3sEXT(disp, fn) ((disp)->SecondaryColor3sEXT = fn) +#define CALL_SecondaryColor3svEXT(disp, parameters) (*((disp)->SecondaryColor3svEXT)) parameters +#define GET_SecondaryColor3svEXT(disp) ((disp)->SecondaryColor3svEXT) +#define SET_SecondaryColor3svEXT(disp, fn) ((disp)->SecondaryColor3svEXT = fn) +#define CALL_SecondaryColor3ubEXT(disp, parameters) (*((disp)->SecondaryColor3ubEXT)) parameters +#define GET_SecondaryColor3ubEXT(disp) ((disp)->SecondaryColor3ubEXT) +#define SET_SecondaryColor3ubEXT(disp, fn) ((disp)->SecondaryColor3ubEXT = fn) +#define CALL_SecondaryColor3ubvEXT(disp, parameters) (*((disp)->SecondaryColor3ubvEXT)) parameters +#define GET_SecondaryColor3ubvEXT(disp) ((disp)->SecondaryColor3ubvEXT) +#define SET_SecondaryColor3ubvEXT(disp, fn) ((disp)->SecondaryColor3ubvEXT = fn) +#define CALL_SecondaryColor3uiEXT(disp, parameters) (*((disp)->SecondaryColor3uiEXT)) parameters +#define GET_SecondaryColor3uiEXT(disp) ((disp)->SecondaryColor3uiEXT) +#define SET_SecondaryColor3uiEXT(disp, fn) ((disp)->SecondaryColor3uiEXT = fn) +#define CALL_SecondaryColor3uivEXT(disp, parameters) (*((disp)->SecondaryColor3uivEXT)) parameters +#define GET_SecondaryColor3uivEXT(disp) ((disp)->SecondaryColor3uivEXT) +#define SET_SecondaryColor3uivEXT(disp, fn) ((disp)->SecondaryColor3uivEXT = fn) +#define CALL_SecondaryColor3usEXT(disp, parameters) (*((disp)->SecondaryColor3usEXT)) parameters +#define GET_SecondaryColor3usEXT(disp) ((disp)->SecondaryColor3usEXT) +#define SET_SecondaryColor3usEXT(disp, fn) ((disp)->SecondaryColor3usEXT = fn) +#define CALL_SecondaryColor3usvEXT(disp, parameters) (*((disp)->SecondaryColor3usvEXT)) parameters +#define GET_SecondaryColor3usvEXT(disp) ((disp)->SecondaryColor3usvEXT) +#define SET_SecondaryColor3usvEXT(disp, fn) ((disp)->SecondaryColor3usvEXT = fn) +#define CALL_SecondaryColorPointerEXT(disp, parameters) (*((disp)->SecondaryColorPointerEXT)) parameters +#define GET_SecondaryColorPointerEXT(disp) ((disp)->SecondaryColorPointerEXT) +#define SET_SecondaryColorPointerEXT(disp, fn) ((disp)->SecondaryColorPointerEXT = fn) +#define CALL_MultiDrawArraysEXT(disp, parameters) (*((disp)->MultiDrawArraysEXT)) parameters +#define GET_MultiDrawArraysEXT(disp) ((disp)->MultiDrawArraysEXT) +#define SET_MultiDrawArraysEXT(disp, fn) ((disp)->MultiDrawArraysEXT = fn) +#define CALL_MultiDrawElementsEXT(disp, parameters) (*((disp)->MultiDrawElementsEXT)) parameters +#define GET_MultiDrawElementsEXT(disp) ((disp)->MultiDrawElementsEXT) +#define SET_MultiDrawElementsEXT(disp, fn) ((disp)->MultiDrawElementsEXT = fn) +#define CALL_FogCoordPointerEXT(disp, parameters) (*((disp)->FogCoordPointerEXT)) parameters +#define GET_FogCoordPointerEXT(disp) ((disp)->FogCoordPointerEXT) +#define SET_FogCoordPointerEXT(disp, fn) ((disp)->FogCoordPointerEXT = fn) +#define CALL_FogCoorddEXT(disp, parameters) (*((disp)->FogCoorddEXT)) parameters +#define GET_FogCoorddEXT(disp) ((disp)->FogCoorddEXT) +#define SET_FogCoorddEXT(disp, fn) ((disp)->FogCoorddEXT = fn) +#define CALL_FogCoorddvEXT(disp, parameters) (*((disp)->FogCoorddvEXT)) parameters +#define GET_FogCoorddvEXT(disp) ((disp)->FogCoorddvEXT) +#define SET_FogCoorddvEXT(disp, fn) ((disp)->FogCoorddvEXT = fn) +#define CALL_FogCoordfEXT(disp, parameters) (*((disp)->FogCoordfEXT)) parameters +#define GET_FogCoordfEXT(disp) ((disp)->FogCoordfEXT) +#define SET_FogCoordfEXT(disp, fn) ((disp)->FogCoordfEXT = fn) +#define CALL_FogCoordfvEXT(disp, parameters) (*((disp)->FogCoordfvEXT)) parameters +#define GET_FogCoordfvEXT(disp) ((disp)->FogCoordfvEXT) +#define SET_FogCoordfvEXT(disp, fn) ((disp)->FogCoordfvEXT = fn) +#define CALL_PixelTexGenSGIX(disp, parameters) (*((disp)->PixelTexGenSGIX)) parameters +#define GET_PixelTexGenSGIX(disp) ((disp)->PixelTexGenSGIX) +#define SET_PixelTexGenSGIX(disp, fn) ((disp)->PixelTexGenSGIX = fn) +#define CALL_BlendFuncSeparateEXT(disp, parameters) (*((disp)->BlendFuncSeparateEXT)) parameters +#define GET_BlendFuncSeparateEXT(disp) ((disp)->BlendFuncSeparateEXT) +#define SET_BlendFuncSeparateEXT(disp, fn) ((disp)->BlendFuncSeparateEXT = fn) +#define CALL_FlushVertexArrayRangeNV(disp, parameters) (*((disp)->FlushVertexArrayRangeNV)) parameters +#define GET_FlushVertexArrayRangeNV(disp) ((disp)->FlushVertexArrayRangeNV) +#define SET_FlushVertexArrayRangeNV(disp, fn) ((disp)->FlushVertexArrayRangeNV = fn) +#define CALL_VertexArrayRangeNV(disp, parameters) (*((disp)->VertexArrayRangeNV)) parameters +#define GET_VertexArrayRangeNV(disp) ((disp)->VertexArrayRangeNV) +#define SET_VertexArrayRangeNV(disp, fn) ((disp)->VertexArrayRangeNV = fn) +#define CALL_CombinerInputNV(disp, parameters) (*((disp)->CombinerInputNV)) parameters +#define GET_CombinerInputNV(disp) ((disp)->CombinerInputNV) +#define SET_CombinerInputNV(disp, fn) ((disp)->CombinerInputNV = fn) +#define CALL_CombinerOutputNV(disp, parameters) (*((disp)->CombinerOutputNV)) parameters +#define GET_CombinerOutputNV(disp) ((disp)->CombinerOutputNV) +#define SET_CombinerOutputNV(disp, fn) ((disp)->CombinerOutputNV = fn) +#define CALL_CombinerParameterfNV(disp, parameters) (*((disp)->CombinerParameterfNV)) parameters +#define GET_CombinerParameterfNV(disp) ((disp)->CombinerParameterfNV) +#define SET_CombinerParameterfNV(disp, fn) ((disp)->CombinerParameterfNV = fn) +#define CALL_CombinerParameterfvNV(disp, parameters) (*((disp)->CombinerParameterfvNV)) parameters +#define GET_CombinerParameterfvNV(disp) ((disp)->CombinerParameterfvNV) +#define SET_CombinerParameterfvNV(disp, fn) ((disp)->CombinerParameterfvNV = fn) +#define CALL_CombinerParameteriNV(disp, parameters) (*((disp)->CombinerParameteriNV)) parameters +#define GET_CombinerParameteriNV(disp) ((disp)->CombinerParameteriNV) +#define SET_CombinerParameteriNV(disp, fn) ((disp)->CombinerParameteriNV = fn) +#define CALL_CombinerParameterivNV(disp, parameters) (*((disp)->CombinerParameterivNV)) parameters +#define GET_CombinerParameterivNV(disp) ((disp)->CombinerParameterivNV) +#define SET_CombinerParameterivNV(disp, fn) ((disp)->CombinerParameterivNV = fn) +#define CALL_FinalCombinerInputNV(disp, parameters) (*((disp)->FinalCombinerInputNV)) parameters +#define GET_FinalCombinerInputNV(disp) ((disp)->FinalCombinerInputNV) +#define SET_FinalCombinerInputNV(disp, fn) ((disp)->FinalCombinerInputNV = fn) +#define CALL_GetCombinerInputParameterfvNV(disp, parameters) (*((disp)->GetCombinerInputParameterfvNV)) parameters +#define GET_GetCombinerInputParameterfvNV(disp) ((disp)->GetCombinerInputParameterfvNV) +#define SET_GetCombinerInputParameterfvNV(disp, fn) ((disp)->GetCombinerInputParameterfvNV = fn) +#define CALL_GetCombinerInputParameterivNV(disp, parameters) (*((disp)->GetCombinerInputParameterivNV)) parameters +#define GET_GetCombinerInputParameterivNV(disp) ((disp)->GetCombinerInputParameterivNV) +#define SET_GetCombinerInputParameterivNV(disp, fn) ((disp)->GetCombinerInputParameterivNV = fn) +#define CALL_GetCombinerOutputParameterfvNV(disp, parameters) (*((disp)->GetCombinerOutputParameterfvNV)) parameters +#define GET_GetCombinerOutputParameterfvNV(disp) ((disp)->GetCombinerOutputParameterfvNV) +#define SET_GetCombinerOutputParameterfvNV(disp, fn) ((disp)->GetCombinerOutputParameterfvNV = fn) +#define CALL_GetCombinerOutputParameterivNV(disp, parameters) (*((disp)->GetCombinerOutputParameterivNV)) parameters +#define GET_GetCombinerOutputParameterivNV(disp) ((disp)->GetCombinerOutputParameterivNV) +#define SET_GetCombinerOutputParameterivNV(disp, fn) ((disp)->GetCombinerOutputParameterivNV = fn) +#define CALL_GetFinalCombinerInputParameterfvNV(disp, parameters) (*((disp)->GetFinalCombinerInputParameterfvNV)) parameters +#define GET_GetFinalCombinerInputParameterfvNV(disp) ((disp)->GetFinalCombinerInputParameterfvNV) +#define SET_GetFinalCombinerInputParameterfvNV(disp, fn) ((disp)->GetFinalCombinerInputParameterfvNV = fn) +#define CALL_GetFinalCombinerInputParameterivNV(disp, parameters) (*((disp)->GetFinalCombinerInputParameterivNV)) parameters +#define GET_GetFinalCombinerInputParameterivNV(disp) ((disp)->GetFinalCombinerInputParameterivNV) +#define SET_GetFinalCombinerInputParameterivNV(disp, fn) ((disp)->GetFinalCombinerInputParameterivNV = fn) +#define CALL_ResizeBuffersMESA(disp, parameters) (*((disp)->ResizeBuffersMESA)) parameters +#define GET_ResizeBuffersMESA(disp) ((disp)->ResizeBuffersMESA) +#define SET_ResizeBuffersMESA(disp, fn) ((disp)->ResizeBuffersMESA = fn) +#define CALL_WindowPos2dMESA(disp, parameters) (*((disp)->WindowPos2dMESA)) parameters +#define GET_WindowPos2dMESA(disp) ((disp)->WindowPos2dMESA) +#define SET_WindowPos2dMESA(disp, fn) ((disp)->WindowPos2dMESA = fn) +#define CALL_WindowPos2dvMESA(disp, parameters) (*((disp)->WindowPos2dvMESA)) parameters +#define GET_WindowPos2dvMESA(disp) ((disp)->WindowPos2dvMESA) +#define SET_WindowPos2dvMESA(disp, fn) ((disp)->WindowPos2dvMESA = fn) +#define CALL_WindowPos2fMESA(disp, parameters) (*((disp)->WindowPos2fMESA)) parameters +#define GET_WindowPos2fMESA(disp) ((disp)->WindowPos2fMESA) +#define SET_WindowPos2fMESA(disp, fn) ((disp)->WindowPos2fMESA = fn) +#define CALL_WindowPos2fvMESA(disp, parameters) (*((disp)->WindowPos2fvMESA)) parameters +#define GET_WindowPos2fvMESA(disp) ((disp)->WindowPos2fvMESA) +#define SET_WindowPos2fvMESA(disp, fn) ((disp)->WindowPos2fvMESA = fn) +#define CALL_WindowPos2iMESA(disp, parameters) (*((disp)->WindowPos2iMESA)) parameters +#define GET_WindowPos2iMESA(disp) ((disp)->WindowPos2iMESA) +#define SET_WindowPos2iMESA(disp, fn) ((disp)->WindowPos2iMESA = fn) +#define CALL_WindowPos2ivMESA(disp, parameters) (*((disp)->WindowPos2ivMESA)) parameters +#define GET_WindowPos2ivMESA(disp) ((disp)->WindowPos2ivMESA) +#define SET_WindowPos2ivMESA(disp, fn) ((disp)->WindowPos2ivMESA = fn) +#define CALL_WindowPos2sMESA(disp, parameters) (*((disp)->WindowPos2sMESA)) parameters +#define GET_WindowPos2sMESA(disp) ((disp)->WindowPos2sMESA) +#define SET_WindowPos2sMESA(disp, fn) ((disp)->WindowPos2sMESA = fn) +#define CALL_WindowPos2svMESA(disp, parameters) (*((disp)->WindowPos2svMESA)) parameters +#define GET_WindowPos2svMESA(disp) ((disp)->WindowPos2svMESA) +#define SET_WindowPos2svMESA(disp, fn) ((disp)->WindowPos2svMESA = fn) +#define CALL_WindowPos3dMESA(disp, parameters) (*((disp)->WindowPos3dMESA)) parameters +#define GET_WindowPos3dMESA(disp) ((disp)->WindowPos3dMESA) +#define SET_WindowPos3dMESA(disp, fn) ((disp)->WindowPos3dMESA = fn) +#define CALL_WindowPos3dvMESA(disp, parameters) (*((disp)->WindowPos3dvMESA)) parameters +#define GET_WindowPos3dvMESA(disp) ((disp)->WindowPos3dvMESA) +#define SET_WindowPos3dvMESA(disp, fn) ((disp)->WindowPos3dvMESA = fn) +#define CALL_WindowPos3fMESA(disp, parameters) (*((disp)->WindowPos3fMESA)) parameters +#define GET_WindowPos3fMESA(disp) ((disp)->WindowPos3fMESA) +#define SET_WindowPos3fMESA(disp, fn) ((disp)->WindowPos3fMESA = fn) +#define CALL_WindowPos3fvMESA(disp, parameters) (*((disp)->WindowPos3fvMESA)) parameters +#define GET_WindowPos3fvMESA(disp) ((disp)->WindowPos3fvMESA) +#define SET_WindowPos3fvMESA(disp, fn) ((disp)->WindowPos3fvMESA = fn) +#define CALL_WindowPos3iMESA(disp, parameters) (*((disp)->WindowPos3iMESA)) parameters +#define GET_WindowPos3iMESA(disp) ((disp)->WindowPos3iMESA) +#define SET_WindowPos3iMESA(disp, fn) ((disp)->WindowPos3iMESA = fn) +#define CALL_WindowPos3ivMESA(disp, parameters) (*((disp)->WindowPos3ivMESA)) parameters +#define GET_WindowPos3ivMESA(disp) ((disp)->WindowPos3ivMESA) +#define SET_WindowPos3ivMESA(disp, fn) ((disp)->WindowPos3ivMESA = fn) +#define CALL_WindowPos3sMESA(disp, parameters) (*((disp)->WindowPos3sMESA)) parameters +#define GET_WindowPos3sMESA(disp) ((disp)->WindowPos3sMESA) +#define SET_WindowPos3sMESA(disp, fn) ((disp)->WindowPos3sMESA = fn) +#define CALL_WindowPos3svMESA(disp, parameters) (*((disp)->WindowPos3svMESA)) parameters +#define GET_WindowPos3svMESA(disp) ((disp)->WindowPos3svMESA) +#define SET_WindowPos3svMESA(disp, fn) ((disp)->WindowPos3svMESA = fn) +#define CALL_WindowPos4dMESA(disp, parameters) (*((disp)->WindowPos4dMESA)) parameters +#define GET_WindowPos4dMESA(disp) ((disp)->WindowPos4dMESA) +#define SET_WindowPos4dMESA(disp, fn) ((disp)->WindowPos4dMESA = fn) +#define CALL_WindowPos4dvMESA(disp, parameters) (*((disp)->WindowPos4dvMESA)) parameters +#define GET_WindowPos4dvMESA(disp) ((disp)->WindowPos4dvMESA) +#define SET_WindowPos4dvMESA(disp, fn) ((disp)->WindowPos4dvMESA = fn) +#define CALL_WindowPos4fMESA(disp, parameters) (*((disp)->WindowPos4fMESA)) parameters +#define GET_WindowPos4fMESA(disp) ((disp)->WindowPos4fMESA) +#define SET_WindowPos4fMESA(disp, fn) ((disp)->WindowPos4fMESA = fn) +#define CALL_WindowPos4fvMESA(disp, parameters) (*((disp)->WindowPos4fvMESA)) parameters +#define GET_WindowPos4fvMESA(disp) ((disp)->WindowPos4fvMESA) +#define SET_WindowPos4fvMESA(disp, fn) ((disp)->WindowPos4fvMESA = fn) +#define CALL_WindowPos4iMESA(disp, parameters) (*((disp)->WindowPos4iMESA)) parameters +#define GET_WindowPos4iMESA(disp) ((disp)->WindowPos4iMESA) +#define SET_WindowPos4iMESA(disp, fn) ((disp)->WindowPos4iMESA = fn) +#define CALL_WindowPos4ivMESA(disp, parameters) (*((disp)->WindowPos4ivMESA)) parameters +#define GET_WindowPos4ivMESA(disp) ((disp)->WindowPos4ivMESA) +#define SET_WindowPos4ivMESA(disp, fn) ((disp)->WindowPos4ivMESA = fn) +#define CALL_WindowPos4sMESA(disp, parameters) (*((disp)->WindowPos4sMESA)) parameters +#define GET_WindowPos4sMESA(disp) ((disp)->WindowPos4sMESA) +#define SET_WindowPos4sMESA(disp, fn) ((disp)->WindowPos4sMESA = fn) +#define CALL_WindowPos4svMESA(disp, parameters) (*((disp)->WindowPos4svMESA)) parameters +#define GET_WindowPos4svMESA(disp) ((disp)->WindowPos4svMESA) +#define SET_WindowPos4svMESA(disp, fn) ((disp)->WindowPos4svMESA = fn) +#define CALL_MultiModeDrawArraysIBM(disp, parameters) (*((disp)->MultiModeDrawArraysIBM)) parameters +#define GET_MultiModeDrawArraysIBM(disp) ((disp)->MultiModeDrawArraysIBM) +#define SET_MultiModeDrawArraysIBM(disp, fn) ((disp)->MultiModeDrawArraysIBM = fn) +#define CALL_MultiModeDrawElementsIBM(disp, parameters) (*((disp)->MultiModeDrawElementsIBM)) parameters +#define GET_MultiModeDrawElementsIBM(disp) ((disp)->MultiModeDrawElementsIBM) +#define SET_MultiModeDrawElementsIBM(disp, fn) ((disp)->MultiModeDrawElementsIBM = fn) +#define CALL_DeleteFencesNV(disp, parameters) (*((disp)->DeleteFencesNV)) parameters +#define GET_DeleteFencesNV(disp) ((disp)->DeleteFencesNV) +#define SET_DeleteFencesNV(disp, fn) ((disp)->DeleteFencesNV = fn) +#define CALL_FinishFenceNV(disp, parameters) (*((disp)->FinishFenceNV)) parameters +#define GET_FinishFenceNV(disp) ((disp)->FinishFenceNV) +#define SET_FinishFenceNV(disp, fn) ((disp)->FinishFenceNV = fn) +#define CALL_GenFencesNV(disp, parameters) (*((disp)->GenFencesNV)) parameters +#define GET_GenFencesNV(disp) ((disp)->GenFencesNV) +#define SET_GenFencesNV(disp, fn) ((disp)->GenFencesNV = fn) +#define CALL_GetFenceivNV(disp, parameters) (*((disp)->GetFenceivNV)) parameters +#define GET_GetFenceivNV(disp) ((disp)->GetFenceivNV) +#define SET_GetFenceivNV(disp, fn) ((disp)->GetFenceivNV = fn) +#define CALL_IsFenceNV(disp, parameters) (*((disp)->IsFenceNV)) parameters +#define GET_IsFenceNV(disp) ((disp)->IsFenceNV) +#define SET_IsFenceNV(disp, fn) ((disp)->IsFenceNV = fn) +#define CALL_SetFenceNV(disp, parameters) (*((disp)->SetFenceNV)) parameters +#define GET_SetFenceNV(disp) ((disp)->SetFenceNV) +#define SET_SetFenceNV(disp, fn) ((disp)->SetFenceNV = fn) +#define CALL_TestFenceNV(disp, parameters) (*((disp)->TestFenceNV)) parameters +#define GET_TestFenceNV(disp) ((disp)->TestFenceNV) +#define SET_TestFenceNV(disp, fn) ((disp)->TestFenceNV = fn) +#define CALL_AreProgramsResidentNV(disp, parameters) (*((disp)->AreProgramsResidentNV)) parameters +#define GET_AreProgramsResidentNV(disp) ((disp)->AreProgramsResidentNV) +#define SET_AreProgramsResidentNV(disp, fn) ((disp)->AreProgramsResidentNV = fn) +#define CALL_BindProgramNV(disp, parameters) (*((disp)->BindProgramNV)) parameters +#define GET_BindProgramNV(disp) ((disp)->BindProgramNV) +#define SET_BindProgramNV(disp, fn) ((disp)->BindProgramNV = fn) +#define CALL_DeleteProgramsNV(disp, parameters) (*((disp)->DeleteProgramsNV)) parameters +#define GET_DeleteProgramsNV(disp) ((disp)->DeleteProgramsNV) +#define SET_DeleteProgramsNV(disp, fn) ((disp)->DeleteProgramsNV = fn) +#define CALL_ExecuteProgramNV(disp, parameters) (*((disp)->ExecuteProgramNV)) parameters +#define GET_ExecuteProgramNV(disp) ((disp)->ExecuteProgramNV) +#define SET_ExecuteProgramNV(disp, fn) ((disp)->ExecuteProgramNV = fn) +#define CALL_GenProgramsNV(disp, parameters) (*((disp)->GenProgramsNV)) parameters +#define GET_GenProgramsNV(disp) ((disp)->GenProgramsNV) +#define SET_GenProgramsNV(disp, fn) ((disp)->GenProgramsNV = fn) +#define CALL_GetProgramParameterdvNV(disp, parameters) (*((disp)->GetProgramParameterdvNV)) parameters +#define GET_GetProgramParameterdvNV(disp) ((disp)->GetProgramParameterdvNV) +#define SET_GetProgramParameterdvNV(disp, fn) ((disp)->GetProgramParameterdvNV = fn) +#define CALL_GetProgramParameterfvNV(disp, parameters) (*((disp)->GetProgramParameterfvNV)) parameters +#define GET_GetProgramParameterfvNV(disp) ((disp)->GetProgramParameterfvNV) +#define SET_GetProgramParameterfvNV(disp, fn) ((disp)->GetProgramParameterfvNV = fn) +#define CALL_GetProgramStringNV(disp, parameters) (*((disp)->GetProgramStringNV)) parameters +#define GET_GetProgramStringNV(disp) ((disp)->GetProgramStringNV) +#define SET_GetProgramStringNV(disp, fn) ((disp)->GetProgramStringNV = fn) +#define CALL_GetProgramivNV(disp, parameters) (*((disp)->GetProgramivNV)) parameters +#define GET_GetProgramivNV(disp) ((disp)->GetProgramivNV) +#define SET_GetProgramivNV(disp, fn) ((disp)->GetProgramivNV = fn) +#define CALL_GetTrackMatrixivNV(disp, parameters) (*((disp)->GetTrackMatrixivNV)) parameters +#define GET_GetTrackMatrixivNV(disp) ((disp)->GetTrackMatrixivNV) +#define SET_GetTrackMatrixivNV(disp, fn) ((disp)->GetTrackMatrixivNV = fn) +#define CALL_GetVertexAttribPointervNV(disp, parameters) (*((disp)->GetVertexAttribPointervNV)) parameters +#define GET_GetVertexAttribPointervNV(disp) ((disp)->GetVertexAttribPointervNV) +#define SET_GetVertexAttribPointervNV(disp, fn) ((disp)->GetVertexAttribPointervNV = fn) +#define CALL_GetVertexAttribdvNV(disp, parameters) (*((disp)->GetVertexAttribdvNV)) parameters +#define GET_GetVertexAttribdvNV(disp) ((disp)->GetVertexAttribdvNV) +#define SET_GetVertexAttribdvNV(disp, fn) ((disp)->GetVertexAttribdvNV = fn) +#define CALL_GetVertexAttribfvNV(disp, parameters) (*((disp)->GetVertexAttribfvNV)) parameters +#define GET_GetVertexAttribfvNV(disp) ((disp)->GetVertexAttribfvNV) +#define SET_GetVertexAttribfvNV(disp, fn) ((disp)->GetVertexAttribfvNV = fn) +#define CALL_GetVertexAttribivNV(disp, parameters) (*((disp)->GetVertexAttribivNV)) parameters +#define GET_GetVertexAttribivNV(disp) ((disp)->GetVertexAttribivNV) +#define SET_GetVertexAttribivNV(disp, fn) ((disp)->GetVertexAttribivNV = fn) +#define CALL_IsProgramNV(disp, parameters) (*((disp)->IsProgramNV)) parameters +#define GET_IsProgramNV(disp) ((disp)->IsProgramNV) +#define SET_IsProgramNV(disp, fn) ((disp)->IsProgramNV = fn) +#define CALL_LoadProgramNV(disp, parameters) (*((disp)->LoadProgramNV)) parameters +#define GET_LoadProgramNV(disp) ((disp)->LoadProgramNV) +#define SET_LoadProgramNV(disp, fn) ((disp)->LoadProgramNV = fn) +#define CALL_ProgramParameters4dvNV(disp, parameters) (*((disp)->ProgramParameters4dvNV)) parameters +#define GET_ProgramParameters4dvNV(disp) ((disp)->ProgramParameters4dvNV) +#define SET_ProgramParameters4dvNV(disp, fn) ((disp)->ProgramParameters4dvNV = fn) +#define CALL_ProgramParameters4fvNV(disp, parameters) (*((disp)->ProgramParameters4fvNV)) parameters +#define GET_ProgramParameters4fvNV(disp) ((disp)->ProgramParameters4fvNV) +#define SET_ProgramParameters4fvNV(disp, fn) ((disp)->ProgramParameters4fvNV = fn) +#define CALL_RequestResidentProgramsNV(disp, parameters) (*((disp)->RequestResidentProgramsNV)) parameters +#define GET_RequestResidentProgramsNV(disp) ((disp)->RequestResidentProgramsNV) +#define SET_RequestResidentProgramsNV(disp, fn) ((disp)->RequestResidentProgramsNV = fn) +#define CALL_TrackMatrixNV(disp, parameters) (*((disp)->TrackMatrixNV)) parameters +#define GET_TrackMatrixNV(disp) ((disp)->TrackMatrixNV) +#define SET_TrackMatrixNV(disp, fn) ((disp)->TrackMatrixNV = fn) +#define CALL_VertexAttrib1dNV(disp, parameters) (*((disp)->VertexAttrib1dNV)) parameters +#define GET_VertexAttrib1dNV(disp) ((disp)->VertexAttrib1dNV) +#define SET_VertexAttrib1dNV(disp, fn) ((disp)->VertexAttrib1dNV = fn) +#define CALL_VertexAttrib1dvNV(disp, parameters) (*((disp)->VertexAttrib1dvNV)) parameters +#define GET_VertexAttrib1dvNV(disp) ((disp)->VertexAttrib1dvNV) +#define SET_VertexAttrib1dvNV(disp, fn) ((disp)->VertexAttrib1dvNV = fn) +#define CALL_VertexAttrib1fNV(disp, parameters) (*((disp)->VertexAttrib1fNV)) parameters +#define GET_VertexAttrib1fNV(disp) ((disp)->VertexAttrib1fNV) +#define SET_VertexAttrib1fNV(disp, fn) ((disp)->VertexAttrib1fNV = fn) +#define CALL_VertexAttrib1fvNV(disp, parameters) (*((disp)->VertexAttrib1fvNV)) parameters +#define GET_VertexAttrib1fvNV(disp) ((disp)->VertexAttrib1fvNV) +#define SET_VertexAttrib1fvNV(disp, fn) ((disp)->VertexAttrib1fvNV = fn) +#define CALL_VertexAttrib1sNV(disp, parameters) (*((disp)->VertexAttrib1sNV)) parameters +#define GET_VertexAttrib1sNV(disp) ((disp)->VertexAttrib1sNV) +#define SET_VertexAttrib1sNV(disp, fn) ((disp)->VertexAttrib1sNV = fn) +#define CALL_VertexAttrib1svNV(disp, parameters) (*((disp)->VertexAttrib1svNV)) parameters +#define GET_VertexAttrib1svNV(disp) ((disp)->VertexAttrib1svNV) +#define SET_VertexAttrib1svNV(disp, fn) ((disp)->VertexAttrib1svNV = fn) +#define CALL_VertexAttrib2dNV(disp, parameters) (*((disp)->VertexAttrib2dNV)) parameters +#define GET_VertexAttrib2dNV(disp) ((disp)->VertexAttrib2dNV) +#define SET_VertexAttrib2dNV(disp, fn) ((disp)->VertexAttrib2dNV = fn) +#define CALL_VertexAttrib2dvNV(disp, parameters) (*((disp)->VertexAttrib2dvNV)) parameters +#define GET_VertexAttrib2dvNV(disp) ((disp)->VertexAttrib2dvNV) +#define SET_VertexAttrib2dvNV(disp, fn) ((disp)->VertexAttrib2dvNV = fn) +#define CALL_VertexAttrib2fNV(disp, parameters) (*((disp)->VertexAttrib2fNV)) parameters +#define GET_VertexAttrib2fNV(disp) ((disp)->VertexAttrib2fNV) +#define SET_VertexAttrib2fNV(disp, fn) ((disp)->VertexAttrib2fNV = fn) +#define CALL_VertexAttrib2fvNV(disp, parameters) (*((disp)->VertexAttrib2fvNV)) parameters +#define GET_VertexAttrib2fvNV(disp) ((disp)->VertexAttrib2fvNV) +#define SET_VertexAttrib2fvNV(disp, fn) ((disp)->VertexAttrib2fvNV = fn) +#define CALL_VertexAttrib2sNV(disp, parameters) (*((disp)->VertexAttrib2sNV)) parameters +#define GET_VertexAttrib2sNV(disp) ((disp)->VertexAttrib2sNV) +#define SET_VertexAttrib2sNV(disp, fn) ((disp)->VertexAttrib2sNV = fn) +#define CALL_VertexAttrib2svNV(disp, parameters) (*((disp)->VertexAttrib2svNV)) parameters +#define GET_VertexAttrib2svNV(disp) ((disp)->VertexAttrib2svNV) +#define SET_VertexAttrib2svNV(disp, fn) ((disp)->VertexAttrib2svNV = fn) +#define CALL_VertexAttrib3dNV(disp, parameters) (*((disp)->VertexAttrib3dNV)) parameters +#define GET_VertexAttrib3dNV(disp) ((disp)->VertexAttrib3dNV) +#define SET_VertexAttrib3dNV(disp, fn) ((disp)->VertexAttrib3dNV = fn) +#define CALL_VertexAttrib3dvNV(disp, parameters) (*((disp)->VertexAttrib3dvNV)) parameters +#define GET_VertexAttrib3dvNV(disp) ((disp)->VertexAttrib3dvNV) +#define SET_VertexAttrib3dvNV(disp, fn) ((disp)->VertexAttrib3dvNV = fn) +#define CALL_VertexAttrib3fNV(disp, parameters) (*((disp)->VertexAttrib3fNV)) parameters +#define GET_VertexAttrib3fNV(disp) ((disp)->VertexAttrib3fNV) +#define SET_VertexAttrib3fNV(disp, fn) ((disp)->VertexAttrib3fNV = fn) +#define CALL_VertexAttrib3fvNV(disp, parameters) (*((disp)->VertexAttrib3fvNV)) parameters +#define GET_VertexAttrib3fvNV(disp) ((disp)->VertexAttrib3fvNV) +#define SET_VertexAttrib3fvNV(disp, fn) ((disp)->VertexAttrib3fvNV = fn) +#define CALL_VertexAttrib3sNV(disp, parameters) (*((disp)->VertexAttrib3sNV)) parameters +#define GET_VertexAttrib3sNV(disp) ((disp)->VertexAttrib3sNV) +#define SET_VertexAttrib3sNV(disp, fn) ((disp)->VertexAttrib3sNV = fn) +#define CALL_VertexAttrib3svNV(disp, parameters) (*((disp)->VertexAttrib3svNV)) parameters +#define GET_VertexAttrib3svNV(disp) ((disp)->VertexAttrib3svNV) +#define SET_VertexAttrib3svNV(disp, fn) ((disp)->VertexAttrib3svNV = fn) +#define CALL_VertexAttrib4dNV(disp, parameters) (*((disp)->VertexAttrib4dNV)) parameters +#define GET_VertexAttrib4dNV(disp) ((disp)->VertexAttrib4dNV) +#define SET_VertexAttrib4dNV(disp, fn) ((disp)->VertexAttrib4dNV = fn) +#define CALL_VertexAttrib4dvNV(disp, parameters) (*((disp)->VertexAttrib4dvNV)) parameters +#define GET_VertexAttrib4dvNV(disp) ((disp)->VertexAttrib4dvNV) +#define SET_VertexAttrib4dvNV(disp, fn) ((disp)->VertexAttrib4dvNV = fn) +#define CALL_VertexAttrib4fNV(disp, parameters) (*((disp)->VertexAttrib4fNV)) parameters +#define GET_VertexAttrib4fNV(disp) ((disp)->VertexAttrib4fNV) +#define SET_VertexAttrib4fNV(disp, fn) ((disp)->VertexAttrib4fNV = fn) +#define CALL_VertexAttrib4fvNV(disp, parameters) (*((disp)->VertexAttrib4fvNV)) parameters +#define GET_VertexAttrib4fvNV(disp) ((disp)->VertexAttrib4fvNV) +#define SET_VertexAttrib4fvNV(disp, fn) ((disp)->VertexAttrib4fvNV = fn) +#define CALL_VertexAttrib4sNV(disp, parameters) (*((disp)->VertexAttrib4sNV)) parameters +#define GET_VertexAttrib4sNV(disp) ((disp)->VertexAttrib4sNV) +#define SET_VertexAttrib4sNV(disp, fn) ((disp)->VertexAttrib4sNV = fn) +#define CALL_VertexAttrib4svNV(disp, parameters) (*((disp)->VertexAttrib4svNV)) parameters +#define GET_VertexAttrib4svNV(disp) ((disp)->VertexAttrib4svNV) +#define SET_VertexAttrib4svNV(disp, fn) ((disp)->VertexAttrib4svNV = fn) +#define CALL_VertexAttrib4ubNV(disp, parameters) (*((disp)->VertexAttrib4ubNV)) parameters +#define GET_VertexAttrib4ubNV(disp) ((disp)->VertexAttrib4ubNV) +#define SET_VertexAttrib4ubNV(disp, fn) ((disp)->VertexAttrib4ubNV = fn) +#define CALL_VertexAttrib4ubvNV(disp, parameters) (*((disp)->VertexAttrib4ubvNV)) parameters +#define GET_VertexAttrib4ubvNV(disp) ((disp)->VertexAttrib4ubvNV) +#define SET_VertexAttrib4ubvNV(disp, fn) ((disp)->VertexAttrib4ubvNV = fn) +#define CALL_VertexAttribPointerNV(disp, parameters) (*((disp)->VertexAttribPointerNV)) parameters +#define GET_VertexAttribPointerNV(disp) ((disp)->VertexAttribPointerNV) +#define SET_VertexAttribPointerNV(disp, fn) ((disp)->VertexAttribPointerNV = fn) +#define CALL_VertexAttribs1dvNV(disp, parameters) (*((disp)->VertexAttribs1dvNV)) parameters +#define GET_VertexAttribs1dvNV(disp) ((disp)->VertexAttribs1dvNV) +#define SET_VertexAttribs1dvNV(disp, fn) ((disp)->VertexAttribs1dvNV = fn) +#define CALL_VertexAttribs1fvNV(disp, parameters) (*((disp)->VertexAttribs1fvNV)) parameters +#define GET_VertexAttribs1fvNV(disp) ((disp)->VertexAttribs1fvNV) +#define SET_VertexAttribs1fvNV(disp, fn) ((disp)->VertexAttribs1fvNV = fn) +#define CALL_VertexAttribs1svNV(disp, parameters) (*((disp)->VertexAttribs1svNV)) parameters +#define GET_VertexAttribs1svNV(disp) ((disp)->VertexAttribs1svNV) +#define SET_VertexAttribs1svNV(disp, fn) ((disp)->VertexAttribs1svNV = fn) +#define CALL_VertexAttribs2dvNV(disp, parameters) (*((disp)->VertexAttribs2dvNV)) parameters +#define GET_VertexAttribs2dvNV(disp) ((disp)->VertexAttribs2dvNV) +#define SET_VertexAttribs2dvNV(disp, fn) ((disp)->VertexAttribs2dvNV = fn) +#define CALL_VertexAttribs2fvNV(disp, parameters) (*((disp)->VertexAttribs2fvNV)) parameters +#define GET_VertexAttribs2fvNV(disp) ((disp)->VertexAttribs2fvNV) +#define SET_VertexAttribs2fvNV(disp, fn) ((disp)->VertexAttribs2fvNV = fn) +#define CALL_VertexAttribs2svNV(disp, parameters) (*((disp)->VertexAttribs2svNV)) parameters +#define GET_VertexAttribs2svNV(disp) ((disp)->VertexAttribs2svNV) +#define SET_VertexAttribs2svNV(disp, fn) ((disp)->VertexAttribs2svNV = fn) +#define CALL_VertexAttribs3dvNV(disp, parameters) (*((disp)->VertexAttribs3dvNV)) parameters +#define GET_VertexAttribs3dvNV(disp) ((disp)->VertexAttribs3dvNV) +#define SET_VertexAttribs3dvNV(disp, fn) ((disp)->VertexAttribs3dvNV = fn) +#define CALL_VertexAttribs3fvNV(disp, parameters) (*((disp)->VertexAttribs3fvNV)) parameters +#define GET_VertexAttribs3fvNV(disp) ((disp)->VertexAttribs3fvNV) +#define SET_VertexAttribs3fvNV(disp, fn) ((disp)->VertexAttribs3fvNV = fn) +#define CALL_VertexAttribs3svNV(disp, parameters) (*((disp)->VertexAttribs3svNV)) parameters +#define GET_VertexAttribs3svNV(disp) ((disp)->VertexAttribs3svNV) +#define SET_VertexAttribs3svNV(disp, fn) ((disp)->VertexAttribs3svNV = fn) +#define CALL_VertexAttribs4dvNV(disp, parameters) (*((disp)->VertexAttribs4dvNV)) parameters +#define GET_VertexAttribs4dvNV(disp) ((disp)->VertexAttribs4dvNV) +#define SET_VertexAttribs4dvNV(disp, fn) ((disp)->VertexAttribs4dvNV = fn) +#define CALL_VertexAttribs4fvNV(disp, parameters) (*((disp)->VertexAttribs4fvNV)) parameters +#define GET_VertexAttribs4fvNV(disp) ((disp)->VertexAttribs4fvNV) +#define SET_VertexAttribs4fvNV(disp, fn) ((disp)->VertexAttribs4fvNV = fn) +#define CALL_VertexAttribs4svNV(disp, parameters) (*((disp)->VertexAttribs4svNV)) parameters +#define GET_VertexAttribs4svNV(disp) ((disp)->VertexAttribs4svNV) +#define SET_VertexAttribs4svNV(disp, fn) ((disp)->VertexAttribs4svNV = fn) +#define CALL_VertexAttribs4ubvNV(disp, parameters) (*((disp)->VertexAttribs4ubvNV)) parameters +#define GET_VertexAttribs4ubvNV(disp) ((disp)->VertexAttribs4ubvNV) +#define SET_VertexAttribs4ubvNV(disp, fn) ((disp)->VertexAttribs4ubvNV = fn) +#define CALL_GetTexBumpParameterfvATI(disp, parameters) (*((disp)->GetTexBumpParameterfvATI)) parameters +#define GET_GetTexBumpParameterfvATI(disp) ((disp)->GetTexBumpParameterfvATI) +#define SET_GetTexBumpParameterfvATI(disp, fn) ((disp)->GetTexBumpParameterfvATI = fn) +#define CALL_GetTexBumpParameterivATI(disp, parameters) (*((disp)->GetTexBumpParameterivATI)) parameters +#define GET_GetTexBumpParameterivATI(disp) ((disp)->GetTexBumpParameterivATI) +#define SET_GetTexBumpParameterivATI(disp, fn) ((disp)->GetTexBumpParameterivATI = fn) +#define CALL_TexBumpParameterfvATI(disp, parameters) (*((disp)->TexBumpParameterfvATI)) parameters +#define GET_TexBumpParameterfvATI(disp) ((disp)->TexBumpParameterfvATI) +#define SET_TexBumpParameterfvATI(disp, fn) ((disp)->TexBumpParameterfvATI = fn) +#define CALL_TexBumpParameterivATI(disp, parameters) (*((disp)->TexBumpParameterivATI)) parameters +#define GET_TexBumpParameterivATI(disp) ((disp)->TexBumpParameterivATI) +#define SET_TexBumpParameterivATI(disp, fn) ((disp)->TexBumpParameterivATI = fn) +#define CALL_AlphaFragmentOp1ATI(disp, parameters) (*((disp)->AlphaFragmentOp1ATI)) parameters +#define GET_AlphaFragmentOp1ATI(disp) ((disp)->AlphaFragmentOp1ATI) +#define SET_AlphaFragmentOp1ATI(disp, fn) ((disp)->AlphaFragmentOp1ATI = fn) +#define CALL_AlphaFragmentOp2ATI(disp, parameters) (*((disp)->AlphaFragmentOp2ATI)) parameters +#define GET_AlphaFragmentOp2ATI(disp) ((disp)->AlphaFragmentOp2ATI) +#define SET_AlphaFragmentOp2ATI(disp, fn) ((disp)->AlphaFragmentOp2ATI = fn) +#define CALL_AlphaFragmentOp3ATI(disp, parameters) (*((disp)->AlphaFragmentOp3ATI)) parameters +#define GET_AlphaFragmentOp3ATI(disp) ((disp)->AlphaFragmentOp3ATI) +#define SET_AlphaFragmentOp3ATI(disp, fn) ((disp)->AlphaFragmentOp3ATI = fn) +#define CALL_BeginFragmentShaderATI(disp, parameters) (*((disp)->BeginFragmentShaderATI)) parameters +#define GET_BeginFragmentShaderATI(disp) ((disp)->BeginFragmentShaderATI) +#define SET_BeginFragmentShaderATI(disp, fn) ((disp)->BeginFragmentShaderATI = fn) +#define CALL_BindFragmentShaderATI(disp, parameters) (*((disp)->BindFragmentShaderATI)) parameters +#define GET_BindFragmentShaderATI(disp) ((disp)->BindFragmentShaderATI) +#define SET_BindFragmentShaderATI(disp, fn) ((disp)->BindFragmentShaderATI = fn) +#define CALL_ColorFragmentOp1ATI(disp, parameters) (*((disp)->ColorFragmentOp1ATI)) parameters +#define GET_ColorFragmentOp1ATI(disp) ((disp)->ColorFragmentOp1ATI) +#define SET_ColorFragmentOp1ATI(disp, fn) ((disp)->ColorFragmentOp1ATI = fn) +#define CALL_ColorFragmentOp2ATI(disp, parameters) (*((disp)->ColorFragmentOp2ATI)) parameters +#define GET_ColorFragmentOp2ATI(disp) ((disp)->ColorFragmentOp2ATI) +#define SET_ColorFragmentOp2ATI(disp, fn) ((disp)->ColorFragmentOp2ATI = fn) +#define CALL_ColorFragmentOp3ATI(disp, parameters) (*((disp)->ColorFragmentOp3ATI)) parameters +#define GET_ColorFragmentOp3ATI(disp) ((disp)->ColorFragmentOp3ATI) +#define SET_ColorFragmentOp3ATI(disp, fn) ((disp)->ColorFragmentOp3ATI = fn) +#define CALL_DeleteFragmentShaderATI(disp, parameters) (*((disp)->DeleteFragmentShaderATI)) parameters +#define GET_DeleteFragmentShaderATI(disp) ((disp)->DeleteFragmentShaderATI) +#define SET_DeleteFragmentShaderATI(disp, fn) ((disp)->DeleteFragmentShaderATI = fn) +#define CALL_EndFragmentShaderATI(disp, parameters) (*((disp)->EndFragmentShaderATI)) parameters +#define GET_EndFragmentShaderATI(disp) ((disp)->EndFragmentShaderATI) +#define SET_EndFragmentShaderATI(disp, fn) ((disp)->EndFragmentShaderATI = fn) +#define CALL_GenFragmentShadersATI(disp, parameters) (*((disp)->GenFragmentShadersATI)) parameters +#define GET_GenFragmentShadersATI(disp) ((disp)->GenFragmentShadersATI) +#define SET_GenFragmentShadersATI(disp, fn) ((disp)->GenFragmentShadersATI = fn) +#define CALL_PassTexCoordATI(disp, parameters) (*((disp)->PassTexCoordATI)) parameters +#define GET_PassTexCoordATI(disp) ((disp)->PassTexCoordATI) +#define SET_PassTexCoordATI(disp, fn) ((disp)->PassTexCoordATI = fn) +#define CALL_SampleMapATI(disp, parameters) (*((disp)->SampleMapATI)) parameters +#define GET_SampleMapATI(disp) ((disp)->SampleMapATI) +#define SET_SampleMapATI(disp, fn) ((disp)->SampleMapATI = fn) +#define CALL_SetFragmentShaderConstantATI(disp, parameters) (*((disp)->SetFragmentShaderConstantATI)) parameters +#define GET_SetFragmentShaderConstantATI(disp) ((disp)->SetFragmentShaderConstantATI) +#define SET_SetFragmentShaderConstantATI(disp, fn) ((disp)->SetFragmentShaderConstantATI = fn) +#define CALL_PointParameteriNV(disp, parameters) (*((disp)->PointParameteriNV)) parameters +#define GET_PointParameteriNV(disp) ((disp)->PointParameteriNV) +#define SET_PointParameteriNV(disp, fn) ((disp)->PointParameteriNV = fn) +#define CALL_PointParameterivNV(disp, parameters) (*((disp)->PointParameterivNV)) parameters +#define GET_PointParameterivNV(disp) ((disp)->PointParameterivNV) +#define SET_PointParameterivNV(disp, fn) ((disp)->PointParameterivNV = fn) +#define CALL_ActiveStencilFaceEXT(disp, parameters) (*((disp)->ActiveStencilFaceEXT)) parameters +#define GET_ActiveStencilFaceEXT(disp) ((disp)->ActiveStencilFaceEXT) +#define SET_ActiveStencilFaceEXT(disp, fn) ((disp)->ActiveStencilFaceEXT = fn) +#define CALL_BindVertexArrayAPPLE(disp, parameters) (*((disp)->BindVertexArrayAPPLE)) parameters +#define GET_BindVertexArrayAPPLE(disp) ((disp)->BindVertexArrayAPPLE) +#define SET_BindVertexArrayAPPLE(disp, fn) ((disp)->BindVertexArrayAPPLE = fn) +#define CALL_DeleteVertexArraysAPPLE(disp, parameters) (*((disp)->DeleteVertexArraysAPPLE)) parameters +#define GET_DeleteVertexArraysAPPLE(disp) ((disp)->DeleteVertexArraysAPPLE) +#define SET_DeleteVertexArraysAPPLE(disp, fn) ((disp)->DeleteVertexArraysAPPLE = fn) +#define CALL_GenVertexArraysAPPLE(disp, parameters) (*((disp)->GenVertexArraysAPPLE)) parameters +#define GET_GenVertexArraysAPPLE(disp) ((disp)->GenVertexArraysAPPLE) +#define SET_GenVertexArraysAPPLE(disp, fn) ((disp)->GenVertexArraysAPPLE = fn) +#define CALL_IsVertexArrayAPPLE(disp, parameters) (*((disp)->IsVertexArrayAPPLE)) parameters +#define GET_IsVertexArrayAPPLE(disp) ((disp)->IsVertexArrayAPPLE) +#define SET_IsVertexArrayAPPLE(disp, fn) ((disp)->IsVertexArrayAPPLE = fn) +#define CALL_GetProgramNamedParameterdvNV(disp, parameters) (*((disp)->GetProgramNamedParameterdvNV)) parameters +#define GET_GetProgramNamedParameterdvNV(disp) ((disp)->GetProgramNamedParameterdvNV) +#define SET_GetProgramNamedParameterdvNV(disp, fn) ((disp)->GetProgramNamedParameterdvNV = fn) +#define CALL_GetProgramNamedParameterfvNV(disp, parameters) (*((disp)->GetProgramNamedParameterfvNV)) parameters +#define GET_GetProgramNamedParameterfvNV(disp) ((disp)->GetProgramNamedParameterfvNV) +#define SET_GetProgramNamedParameterfvNV(disp, fn) ((disp)->GetProgramNamedParameterfvNV = fn) +#define CALL_ProgramNamedParameter4dNV(disp, parameters) (*((disp)->ProgramNamedParameter4dNV)) parameters +#define GET_ProgramNamedParameter4dNV(disp) ((disp)->ProgramNamedParameter4dNV) +#define SET_ProgramNamedParameter4dNV(disp, fn) ((disp)->ProgramNamedParameter4dNV = fn) +#define CALL_ProgramNamedParameter4dvNV(disp, parameters) (*((disp)->ProgramNamedParameter4dvNV)) parameters +#define GET_ProgramNamedParameter4dvNV(disp) ((disp)->ProgramNamedParameter4dvNV) +#define SET_ProgramNamedParameter4dvNV(disp, fn) ((disp)->ProgramNamedParameter4dvNV = fn) +#define CALL_ProgramNamedParameter4fNV(disp, parameters) (*((disp)->ProgramNamedParameter4fNV)) parameters +#define GET_ProgramNamedParameter4fNV(disp) ((disp)->ProgramNamedParameter4fNV) +#define SET_ProgramNamedParameter4fNV(disp, fn) ((disp)->ProgramNamedParameter4fNV = fn) +#define CALL_ProgramNamedParameter4fvNV(disp, parameters) (*((disp)->ProgramNamedParameter4fvNV)) parameters +#define GET_ProgramNamedParameter4fvNV(disp) ((disp)->ProgramNamedParameter4fvNV) +#define SET_ProgramNamedParameter4fvNV(disp, fn) ((disp)->ProgramNamedParameter4fvNV = fn) +#define CALL_DepthBoundsEXT(disp, parameters) (*((disp)->DepthBoundsEXT)) parameters +#define GET_DepthBoundsEXT(disp) ((disp)->DepthBoundsEXT) +#define SET_DepthBoundsEXT(disp, fn) ((disp)->DepthBoundsEXT = fn) +#define CALL_BlendEquationSeparateEXT(disp, parameters) (*((disp)->BlendEquationSeparateEXT)) parameters +#define GET_BlendEquationSeparateEXT(disp) ((disp)->BlendEquationSeparateEXT) +#define SET_BlendEquationSeparateEXT(disp, fn) ((disp)->BlendEquationSeparateEXT = fn) +#define CALL_BindFramebufferEXT(disp, parameters) (*((disp)->BindFramebufferEXT)) parameters +#define GET_BindFramebufferEXT(disp) ((disp)->BindFramebufferEXT) +#define SET_BindFramebufferEXT(disp, fn) ((disp)->BindFramebufferEXT = fn) +#define CALL_BindRenderbufferEXT(disp, parameters) (*((disp)->BindRenderbufferEXT)) parameters +#define GET_BindRenderbufferEXT(disp) ((disp)->BindRenderbufferEXT) +#define SET_BindRenderbufferEXT(disp, fn) ((disp)->BindRenderbufferEXT = fn) +#define CALL_CheckFramebufferStatusEXT(disp, parameters) (*((disp)->CheckFramebufferStatusEXT)) parameters +#define GET_CheckFramebufferStatusEXT(disp) ((disp)->CheckFramebufferStatusEXT) +#define SET_CheckFramebufferStatusEXT(disp, fn) ((disp)->CheckFramebufferStatusEXT = fn) +#define CALL_DeleteFramebuffersEXT(disp, parameters) (*((disp)->DeleteFramebuffersEXT)) parameters +#define GET_DeleteFramebuffersEXT(disp) ((disp)->DeleteFramebuffersEXT) +#define SET_DeleteFramebuffersEXT(disp, fn) ((disp)->DeleteFramebuffersEXT = fn) +#define CALL_DeleteRenderbuffersEXT(disp, parameters) (*((disp)->DeleteRenderbuffersEXT)) parameters +#define GET_DeleteRenderbuffersEXT(disp) ((disp)->DeleteRenderbuffersEXT) +#define SET_DeleteRenderbuffersEXT(disp, fn) ((disp)->DeleteRenderbuffersEXT = fn) +#define CALL_FramebufferRenderbufferEXT(disp, parameters) (*((disp)->FramebufferRenderbufferEXT)) parameters +#define GET_FramebufferRenderbufferEXT(disp) ((disp)->FramebufferRenderbufferEXT) +#define SET_FramebufferRenderbufferEXT(disp, fn) ((disp)->FramebufferRenderbufferEXT = fn) +#define CALL_FramebufferTexture1DEXT(disp, parameters) (*((disp)->FramebufferTexture1DEXT)) parameters +#define GET_FramebufferTexture1DEXT(disp) ((disp)->FramebufferTexture1DEXT) +#define SET_FramebufferTexture1DEXT(disp, fn) ((disp)->FramebufferTexture1DEXT = fn) +#define CALL_FramebufferTexture2DEXT(disp, parameters) (*((disp)->FramebufferTexture2DEXT)) parameters +#define GET_FramebufferTexture2DEXT(disp) ((disp)->FramebufferTexture2DEXT) +#define SET_FramebufferTexture2DEXT(disp, fn) ((disp)->FramebufferTexture2DEXT = fn) +#define CALL_FramebufferTexture3DEXT(disp, parameters) (*((disp)->FramebufferTexture3DEXT)) parameters +#define GET_FramebufferTexture3DEXT(disp) ((disp)->FramebufferTexture3DEXT) +#define SET_FramebufferTexture3DEXT(disp, fn) ((disp)->FramebufferTexture3DEXT = fn) +#define CALL_GenFramebuffersEXT(disp, parameters) (*((disp)->GenFramebuffersEXT)) parameters +#define GET_GenFramebuffersEXT(disp) ((disp)->GenFramebuffersEXT) +#define SET_GenFramebuffersEXT(disp, fn) ((disp)->GenFramebuffersEXT = fn) +#define CALL_GenRenderbuffersEXT(disp, parameters) (*((disp)->GenRenderbuffersEXT)) parameters +#define GET_GenRenderbuffersEXT(disp) ((disp)->GenRenderbuffersEXT) +#define SET_GenRenderbuffersEXT(disp, fn) ((disp)->GenRenderbuffersEXT = fn) +#define CALL_GenerateMipmapEXT(disp, parameters) (*((disp)->GenerateMipmapEXT)) parameters +#define GET_GenerateMipmapEXT(disp) ((disp)->GenerateMipmapEXT) +#define SET_GenerateMipmapEXT(disp, fn) ((disp)->GenerateMipmapEXT = fn) +#define CALL_GetFramebufferAttachmentParameterivEXT(disp, parameters) (*((disp)->GetFramebufferAttachmentParameterivEXT)) parameters +#define GET_GetFramebufferAttachmentParameterivEXT(disp) ((disp)->GetFramebufferAttachmentParameterivEXT) +#define SET_GetFramebufferAttachmentParameterivEXT(disp, fn) ((disp)->GetFramebufferAttachmentParameterivEXT = fn) +#define CALL_GetRenderbufferParameterivEXT(disp, parameters) (*((disp)->GetRenderbufferParameterivEXT)) parameters +#define GET_GetRenderbufferParameterivEXT(disp) ((disp)->GetRenderbufferParameterivEXT) +#define SET_GetRenderbufferParameterivEXT(disp, fn) ((disp)->GetRenderbufferParameterivEXT = fn) +#define CALL_IsFramebufferEXT(disp, parameters) (*((disp)->IsFramebufferEXT)) parameters +#define GET_IsFramebufferEXT(disp) ((disp)->IsFramebufferEXT) +#define SET_IsFramebufferEXT(disp, fn) ((disp)->IsFramebufferEXT = fn) +#define CALL_IsRenderbufferEXT(disp, parameters) (*((disp)->IsRenderbufferEXT)) parameters +#define GET_IsRenderbufferEXT(disp) ((disp)->IsRenderbufferEXT) +#define SET_IsRenderbufferEXT(disp, fn) ((disp)->IsRenderbufferEXT = fn) +#define CALL_RenderbufferStorageEXT(disp, parameters) (*((disp)->RenderbufferStorageEXT)) parameters +#define GET_RenderbufferStorageEXT(disp) ((disp)->RenderbufferStorageEXT) +#define SET_RenderbufferStorageEXT(disp, fn) ((disp)->RenderbufferStorageEXT = fn) +#define CALL_BlitFramebufferEXT(disp, parameters) (*((disp)->BlitFramebufferEXT)) parameters +#define GET_BlitFramebufferEXT(disp) ((disp)->BlitFramebufferEXT) +#define SET_BlitFramebufferEXT(disp, fn) ((disp)->BlitFramebufferEXT = fn) +#define CALL_BufferParameteriAPPLE(disp, parameters) (*((disp)->BufferParameteriAPPLE)) parameters +#define GET_BufferParameteriAPPLE(disp) ((disp)->BufferParameteriAPPLE) +#define SET_BufferParameteriAPPLE(disp, fn) ((disp)->BufferParameteriAPPLE = fn) +#define CALL_FlushMappedBufferRangeAPPLE(disp, parameters) (*((disp)->FlushMappedBufferRangeAPPLE)) parameters +#define GET_FlushMappedBufferRangeAPPLE(disp) ((disp)->FlushMappedBufferRangeAPPLE) +#define SET_FlushMappedBufferRangeAPPLE(disp, fn) ((disp)->FlushMappedBufferRangeAPPLE = fn) +#define CALL_FramebufferTextureLayerEXT(disp, parameters) (*((disp)->FramebufferTextureLayerEXT)) parameters +#define GET_FramebufferTextureLayerEXT(disp) ((disp)->FramebufferTextureLayerEXT) +#define SET_FramebufferTextureLayerEXT(disp, fn) ((disp)->FramebufferTextureLayerEXT = fn) +#define CALL_ProvokingVertexEXT(disp, parameters) (*((disp)->ProvokingVertexEXT)) parameters +#define GET_ProvokingVertexEXT(disp) ((disp)->ProvokingVertexEXT) +#define SET_ProvokingVertexEXT(disp, fn) ((disp)->ProvokingVertexEXT = fn) +#define CALL_GetTexParameterPointervAPPLE(disp, parameters) (*((disp)->GetTexParameterPointervAPPLE)) parameters +#define GET_GetTexParameterPointervAPPLE(disp) ((disp)->GetTexParameterPointervAPPLE) +#define SET_GetTexParameterPointervAPPLE(disp, fn) ((disp)->GetTexParameterPointervAPPLE = fn) +#define CALL_TextureRangeAPPLE(disp, parameters) (*((disp)->TextureRangeAPPLE)) parameters +#define GET_TextureRangeAPPLE(disp) ((disp)->TextureRangeAPPLE) +#define SET_TextureRangeAPPLE(disp, fn) ((disp)->TextureRangeAPPLE = fn) +#define CALL_StencilFuncSeparateATI(disp, parameters) (*((disp)->StencilFuncSeparateATI)) parameters +#define GET_StencilFuncSeparateATI(disp) ((disp)->StencilFuncSeparateATI) +#define SET_StencilFuncSeparateATI(disp, fn) ((disp)->StencilFuncSeparateATI = fn) +#define CALL_ProgramEnvParameters4fvEXT(disp, parameters) (*((disp)->ProgramEnvParameters4fvEXT)) parameters +#define GET_ProgramEnvParameters4fvEXT(disp) ((disp)->ProgramEnvParameters4fvEXT) +#define SET_ProgramEnvParameters4fvEXT(disp, fn) ((disp)->ProgramEnvParameters4fvEXT = fn) +#define CALL_ProgramLocalParameters4fvEXT(disp, parameters) (*((disp)->ProgramLocalParameters4fvEXT)) parameters +#define GET_ProgramLocalParameters4fvEXT(disp) ((disp)->ProgramLocalParameters4fvEXT) +#define SET_ProgramLocalParameters4fvEXT(disp, fn) ((disp)->ProgramLocalParameters4fvEXT = fn) +#define CALL_GetQueryObjecti64vEXT(disp, parameters) (*((disp)->GetQueryObjecti64vEXT)) parameters +#define GET_GetQueryObjecti64vEXT(disp) ((disp)->GetQueryObjecti64vEXT) +#define SET_GetQueryObjecti64vEXT(disp, fn) ((disp)->GetQueryObjecti64vEXT = fn) +#define CALL_GetQueryObjectui64vEXT(disp, parameters) (*((disp)->GetQueryObjectui64vEXT)) parameters +#define GET_GetQueryObjectui64vEXT(disp) ((disp)->GetQueryObjectui64vEXT) +#define SET_GetQueryObjectui64vEXT(disp, fn) ((disp)->GetQueryObjectui64vEXT = fn) + +#else + +#define driDispatchRemapTable_size 387 +extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; + +#define AttachShader_remap_index 0 +#define CreateProgram_remap_index 1 +#define CreateShader_remap_index 2 +#define DeleteProgram_remap_index 3 +#define DeleteShader_remap_index 4 +#define DetachShader_remap_index 5 +#define GetAttachedShaders_remap_index 6 +#define GetProgramInfoLog_remap_index 7 +#define GetProgramiv_remap_index 8 +#define GetShaderInfoLog_remap_index 9 +#define GetShaderiv_remap_index 10 +#define IsProgram_remap_index 11 +#define IsShader_remap_index 12 +#define StencilFuncSeparate_remap_index 13 +#define StencilMaskSeparate_remap_index 14 +#define StencilOpSeparate_remap_index 15 +#define UniformMatrix2x3fv_remap_index 16 +#define UniformMatrix2x4fv_remap_index 17 +#define UniformMatrix3x2fv_remap_index 18 +#define UniformMatrix3x4fv_remap_index 19 +#define UniformMatrix4x2fv_remap_index 20 +#define UniformMatrix4x3fv_remap_index 21 +#define LoadTransposeMatrixdARB_remap_index 22 +#define LoadTransposeMatrixfARB_remap_index 23 +#define MultTransposeMatrixdARB_remap_index 24 +#define MultTransposeMatrixfARB_remap_index 25 +#define SampleCoverageARB_remap_index 26 +#define CompressedTexImage1DARB_remap_index 27 +#define CompressedTexImage2DARB_remap_index 28 +#define CompressedTexImage3DARB_remap_index 29 +#define CompressedTexSubImage1DARB_remap_index 30 +#define CompressedTexSubImage2DARB_remap_index 31 +#define CompressedTexSubImage3DARB_remap_index 32 +#define GetCompressedTexImageARB_remap_index 33 +#define DisableVertexAttribArrayARB_remap_index 34 +#define EnableVertexAttribArrayARB_remap_index 35 +#define GetProgramEnvParameterdvARB_remap_index 36 +#define GetProgramEnvParameterfvARB_remap_index 37 +#define GetProgramLocalParameterdvARB_remap_index 38 +#define GetProgramLocalParameterfvARB_remap_index 39 +#define GetProgramStringARB_remap_index 40 +#define GetProgramivARB_remap_index 41 +#define GetVertexAttribdvARB_remap_index 42 +#define GetVertexAttribfvARB_remap_index 43 +#define GetVertexAttribivARB_remap_index 44 +#define ProgramEnvParameter4dARB_remap_index 45 +#define ProgramEnvParameter4dvARB_remap_index 46 +#define ProgramEnvParameter4fARB_remap_index 47 +#define ProgramEnvParameter4fvARB_remap_index 48 +#define ProgramLocalParameter4dARB_remap_index 49 +#define ProgramLocalParameter4dvARB_remap_index 50 +#define ProgramLocalParameter4fARB_remap_index 51 +#define ProgramLocalParameter4fvARB_remap_index 52 +#define ProgramStringARB_remap_index 53 +#define VertexAttrib1dARB_remap_index 54 +#define VertexAttrib1dvARB_remap_index 55 +#define VertexAttrib1fARB_remap_index 56 +#define VertexAttrib1fvARB_remap_index 57 +#define VertexAttrib1sARB_remap_index 58 +#define VertexAttrib1svARB_remap_index 59 +#define VertexAttrib2dARB_remap_index 60 +#define VertexAttrib2dvARB_remap_index 61 +#define VertexAttrib2fARB_remap_index 62 +#define VertexAttrib2fvARB_remap_index 63 +#define VertexAttrib2sARB_remap_index 64 +#define VertexAttrib2svARB_remap_index 65 +#define VertexAttrib3dARB_remap_index 66 +#define VertexAttrib3dvARB_remap_index 67 +#define VertexAttrib3fARB_remap_index 68 +#define VertexAttrib3fvARB_remap_index 69 +#define VertexAttrib3sARB_remap_index 70 +#define VertexAttrib3svARB_remap_index 71 +#define VertexAttrib4NbvARB_remap_index 72 +#define VertexAttrib4NivARB_remap_index 73 +#define VertexAttrib4NsvARB_remap_index 74 +#define VertexAttrib4NubARB_remap_index 75 +#define VertexAttrib4NubvARB_remap_index 76 +#define VertexAttrib4NuivARB_remap_index 77 +#define VertexAttrib4NusvARB_remap_index 78 +#define VertexAttrib4bvARB_remap_index 79 +#define VertexAttrib4dARB_remap_index 80 +#define VertexAttrib4dvARB_remap_index 81 +#define VertexAttrib4fARB_remap_index 82 +#define VertexAttrib4fvARB_remap_index 83 +#define VertexAttrib4ivARB_remap_index 84 +#define VertexAttrib4sARB_remap_index 85 +#define VertexAttrib4svARB_remap_index 86 +#define VertexAttrib4ubvARB_remap_index 87 +#define VertexAttrib4uivARB_remap_index 88 +#define VertexAttrib4usvARB_remap_index 89 +#define VertexAttribPointerARB_remap_index 90 +#define BindBufferARB_remap_index 91 +#define BufferDataARB_remap_index 92 +#define BufferSubDataARB_remap_index 93 +#define DeleteBuffersARB_remap_index 94 +#define GenBuffersARB_remap_index 95 +#define GetBufferParameterivARB_remap_index 96 +#define GetBufferPointervARB_remap_index 97 +#define GetBufferSubDataARB_remap_index 98 +#define IsBufferARB_remap_index 99 +#define MapBufferARB_remap_index 100 +#define UnmapBufferARB_remap_index 101 +#define BeginQueryARB_remap_index 102 +#define DeleteQueriesARB_remap_index 103 +#define EndQueryARB_remap_index 104 +#define GenQueriesARB_remap_index 105 +#define GetQueryObjectivARB_remap_index 106 +#define GetQueryObjectuivARB_remap_index 107 +#define GetQueryivARB_remap_index 108 +#define IsQueryARB_remap_index 109 +#define AttachObjectARB_remap_index 110 +#define CompileShaderARB_remap_index 111 +#define CreateProgramObjectARB_remap_index 112 +#define CreateShaderObjectARB_remap_index 113 +#define DeleteObjectARB_remap_index 114 +#define DetachObjectARB_remap_index 115 +#define GetActiveUniformARB_remap_index 116 +#define GetAttachedObjectsARB_remap_index 117 +#define GetHandleARB_remap_index 118 +#define GetInfoLogARB_remap_index 119 +#define GetObjectParameterfvARB_remap_index 120 +#define GetObjectParameterivARB_remap_index 121 +#define GetShaderSourceARB_remap_index 122 +#define GetUniformLocationARB_remap_index 123 +#define GetUniformfvARB_remap_index 124 +#define GetUniformivARB_remap_index 125 +#define LinkProgramARB_remap_index 126 +#define ShaderSourceARB_remap_index 127 +#define Uniform1fARB_remap_index 128 +#define Uniform1fvARB_remap_index 129 +#define Uniform1iARB_remap_index 130 +#define Uniform1ivARB_remap_index 131 +#define Uniform2fARB_remap_index 132 +#define Uniform2fvARB_remap_index 133 +#define Uniform2iARB_remap_index 134 +#define Uniform2ivARB_remap_index 135 +#define Uniform3fARB_remap_index 136 +#define Uniform3fvARB_remap_index 137 +#define Uniform3iARB_remap_index 138 +#define Uniform3ivARB_remap_index 139 +#define Uniform4fARB_remap_index 140 +#define Uniform4fvARB_remap_index 141 +#define Uniform4iARB_remap_index 142 +#define Uniform4ivARB_remap_index 143 +#define UniformMatrix2fvARB_remap_index 144 +#define UniformMatrix3fvARB_remap_index 145 +#define UniformMatrix4fvARB_remap_index 146 +#define UseProgramObjectARB_remap_index 147 +#define ValidateProgramARB_remap_index 148 +#define BindAttribLocationARB_remap_index 149 +#define GetActiveAttribARB_remap_index 150 +#define GetAttribLocationARB_remap_index 151 +#define DrawBuffersARB_remap_index 152 +#define RenderbufferStorageMultisample_remap_index 153 +#define FlushMappedBufferRange_remap_index 154 +#define MapBufferRange_remap_index 155 +#define BindVertexArray_remap_index 156 +#define GenVertexArrays_remap_index 157 +#define CopyBufferSubData_remap_index 158 +#define ClientWaitSync_remap_index 159 +#define DeleteSync_remap_index 160 +#define FenceSync_remap_index 161 +#define GetInteger64v_remap_index 162 +#define GetSynciv_remap_index 163 +#define IsSync_remap_index 164 +#define WaitSync_remap_index 165 +#define DrawElementsBaseVertex_remap_index 166 +#define DrawRangeElementsBaseVertex_remap_index 167 +#define MultiDrawElementsBaseVertex_remap_index 168 +#define PolygonOffsetEXT_remap_index 169 +#define GetPixelTexGenParameterfvSGIS_remap_index 170 +#define GetPixelTexGenParameterivSGIS_remap_index 171 +#define PixelTexGenParameterfSGIS_remap_index 172 +#define PixelTexGenParameterfvSGIS_remap_index 173 +#define PixelTexGenParameteriSGIS_remap_index 174 +#define PixelTexGenParameterivSGIS_remap_index 175 +#define SampleMaskSGIS_remap_index 176 +#define SamplePatternSGIS_remap_index 177 +#define ColorPointerEXT_remap_index 178 +#define EdgeFlagPointerEXT_remap_index 179 +#define IndexPointerEXT_remap_index 180 +#define NormalPointerEXT_remap_index 181 +#define TexCoordPointerEXT_remap_index 182 +#define VertexPointerEXT_remap_index 183 +#define PointParameterfEXT_remap_index 184 +#define PointParameterfvEXT_remap_index 185 +#define LockArraysEXT_remap_index 186 +#define UnlockArraysEXT_remap_index 187 +#define CullParameterdvEXT_remap_index 188 +#define CullParameterfvEXT_remap_index 189 +#define SecondaryColor3bEXT_remap_index 190 +#define SecondaryColor3bvEXT_remap_index 191 +#define SecondaryColor3dEXT_remap_index 192 +#define SecondaryColor3dvEXT_remap_index 193 +#define SecondaryColor3fEXT_remap_index 194 +#define SecondaryColor3fvEXT_remap_index 195 +#define SecondaryColor3iEXT_remap_index 196 +#define SecondaryColor3ivEXT_remap_index 197 +#define SecondaryColor3sEXT_remap_index 198 +#define SecondaryColor3svEXT_remap_index 199 +#define SecondaryColor3ubEXT_remap_index 200 +#define SecondaryColor3ubvEXT_remap_index 201 +#define SecondaryColor3uiEXT_remap_index 202 +#define SecondaryColor3uivEXT_remap_index 203 +#define SecondaryColor3usEXT_remap_index 204 +#define SecondaryColor3usvEXT_remap_index 205 +#define SecondaryColorPointerEXT_remap_index 206 +#define MultiDrawArraysEXT_remap_index 207 +#define MultiDrawElementsEXT_remap_index 208 +#define FogCoordPointerEXT_remap_index 209 +#define FogCoorddEXT_remap_index 210 +#define FogCoorddvEXT_remap_index 211 +#define FogCoordfEXT_remap_index 212 +#define FogCoordfvEXT_remap_index 213 +#define PixelTexGenSGIX_remap_index 214 +#define BlendFuncSeparateEXT_remap_index 215 +#define FlushVertexArrayRangeNV_remap_index 216 +#define VertexArrayRangeNV_remap_index 217 +#define CombinerInputNV_remap_index 218 +#define CombinerOutputNV_remap_index 219 +#define CombinerParameterfNV_remap_index 220 +#define CombinerParameterfvNV_remap_index 221 +#define CombinerParameteriNV_remap_index 222 +#define CombinerParameterivNV_remap_index 223 +#define FinalCombinerInputNV_remap_index 224 +#define GetCombinerInputParameterfvNV_remap_index 225 +#define GetCombinerInputParameterivNV_remap_index 226 +#define GetCombinerOutputParameterfvNV_remap_index 227 +#define GetCombinerOutputParameterivNV_remap_index 228 +#define GetFinalCombinerInputParameterfvNV_remap_index 229 +#define GetFinalCombinerInputParameterivNV_remap_index 230 +#define ResizeBuffersMESA_remap_index 231 +#define WindowPos2dMESA_remap_index 232 +#define WindowPos2dvMESA_remap_index 233 +#define WindowPos2fMESA_remap_index 234 +#define WindowPos2fvMESA_remap_index 235 +#define WindowPos2iMESA_remap_index 236 +#define WindowPos2ivMESA_remap_index 237 +#define WindowPos2sMESA_remap_index 238 +#define WindowPos2svMESA_remap_index 239 +#define WindowPos3dMESA_remap_index 240 +#define WindowPos3dvMESA_remap_index 241 +#define WindowPos3fMESA_remap_index 242 +#define WindowPos3fvMESA_remap_index 243 +#define WindowPos3iMESA_remap_index 244 +#define WindowPos3ivMESA_remap_index 245 +#define WindowPos3sMESA_remap_index 246 +#define WindowPos3svMESA_remap_index 247 +#define WindowPos4dMESA_remap_index 248 +#define WindowPos4dvMESA_remap_index 249 +#define WindowPos4fMESA_remap_index 250 +#define WindowPos4fvMESA_remap_index 251 +#define WindowPos4iMESA_remap_index 252 +#define WindowPos4ivMESA_remap_index 253 +#define WindowPos4sMESA_remap_index 254 +#define WindowPos4svMESA_remap_index 255 +#define MultiModeDrawArraysIBM_remap_index 256 +#define MultiModeDrawElementsIBM_remap_index 257 +#define DeleteFencesNV_remap_index 258 +#define FinishFenceNV_remap_index 259 +#define GenFencesNV_remap_index 260 +#define GetFenceivNV_remap_index 261 +#define IsFenceNV_remap_index 262 +#define SetFenceNV_remap_index 263 +#define TestFenceNV_remap_index 264 +#define AreProgramsResidentNV_remap_index 265 +#define BindProgramNV_remap_index 266 +#define DeleteProgramsNV_remap_index 267 +#define ExecuteProgramNV_remap_index 268 +#define GenProgramsNV_remap_index 269 +#define GetProgramParameterdvNV_remap_index 270 +#define GetProgramParameterfvNV_remap_index 271 +#define GetProgramStringNV_remap_index 272 +#define GetProgramivNV_remap_index 273 +#define GetTrackMatrixivNV_remap_index 274 +#define GetVertexAttribPointervNV_remap_index 275 +#define GetVertexAttribdvNV_remap_index 276 +#define GetVertexAttribfvNV_remap_index 277 +#define GetVertexAttribivNV_remap_index 278 +#define IsProgramNV_remap_index 279 +#define LoadProgramNV_remap_index 280 +#define ProgramParameters4dvNV_remap_index 281 +#define ProgramParameters4fvNV_remap_index 282 +#define RequestResidentProgramsNV_remap_index 283 +#define TrackMatrixNV_remap_index 284 +#define VertexAttrib1dNV_remap_index 285 +#define VertexAttrib1dvNV_remap_index 286 +#define VertexAttrib1fNV_remap_index 287 +#define VertexAttrib1fvNV_remap_index 288 +#define VertexAttrib1sNV_remap_index 289 +#define VertexAttrib1svNV_remap_index 290 +#define VertexAttrib2dNV_remap_index 291 +#define VertexAttrib2dvNV_remap_index 292 +#define VertexAttrib2fNV_remap_index 293 +#define VertexAttrib2fvNV_remap_index 294 +#define VertexAttrib2sNV_remap_index 295 +#define VertexAttrib2svNV_remap_index 296 +#define VertexAttrib3dNV_remap_index 297 +#define VertexAttrib3dvNV_remap_index 298 +#define VertexAttrib3fNV_remap_index 299 +#define VertexAttrib3fvNV_remap_index 300 +#define VertexAttrib3sNV_remap_index 301 +#define VertexAttrib3svNV_remap_index 302 +#define VertexAttrib4dNV_remap_index 303 +#define VertexAttrib4dvNV_remap_index 304 +#define VertexAttrib4fNV_remap_index 305 +#define VertexAttrib4fvNV_remap_index 306 +#define VertexAttrib4sNV_remap_index 307 +#define VertexAttrib4svNV_remap_index 308 +#define VertexAttrib4ubNV_remap_index 309 +#define VertexAttrib4ubvNV_remap_index 310 +#define VertexAttribPointerNV_remap_index 311 +#define VertexAttribs1dvNV_remap_index 312 +#define VertexAttribs1fvNV_remap_index 313 +#define VertexAttribs1svNV_remap_index 314 +#define VertexAttribs2dvNV_remap_index 315 +#define VertexAttribs2fvNV_remap_index 316 +#define VertexAttribs2svNV_remap_index 317 +#define VertexAttribs3dvNV_remap_index 318 +#define VertexAttribs3fvNV_remap_index 319 +#define VertexAttribs3svNV_remap_index 320 +#define VertexAttribs4dvNV_remap_index 321 +#define VertexAttribs4fvNV_remap_index 322 +#define VertexAttribs4svNV_remap_index 323 +#define VertexAttribs4ubvNV_remap_index 324 +#define GetTexBumpParameterfvATI_remap_index 325 +#define GetTexBumpParameterivATI_remap_index 326 +#define TexBumpParameterfvATI_remap_index 327 +#define TexBumpParameterivATI_remap_index 328 +#define AlphaFragmentOp1ATI_remap_index 329 +#define AlphaFragmentOp2ATI_remap_index 330 +#define AlphaFragmentOp3ATI_remap_index 331 +#define BeginFragmentShaderATI_remap_index 332 +#define BindFragmentShaderATI_remap_index 333 +#define ColorFragmentOp1ATI_remap_index 334 +#define ColorFragmentOp2ATI_remap_index 335 +#define ColorFragmentOp3ATI_remap_index 336 +#define DeleteFragmentShaderATI_remap_index 337 +#define EndFragmentShaderATI_remap_index 338 +#define GenFragmentShadersATI_remap_index 339 +#define PassTexCoordATI_remap_index 340 +#define SampleMapATI_remap_index 341 +#define SetFragmentShaderConstantATI_remap_index 342 +#define PointParameteriNV_remap_index 343 +#define PointParameterivNV_remap_index 344 +#define ActiveStencilFaceEXT_remap_index 345 +#define BindVertexArrayAPPLE_remap_index 346 +#define DeleteVertexArraysAPPLE_remap_index 347 +#define GenVertexArraysAPPLE_remap_index 348 +#define IsVertexArrayAPPLE_remap_index 349 +#define GetProgramNamedParameterdvNV_remap_index 350 +#define GetProgramNamedParameterfvNV_remap_index 351 +#define ProgramNamedParameter4dNV_remap_index 352 +#define ProgramNamedParameter4dvNV_remap_index 353 +#define ProgramNamedParameter4fNV_remap_index 354 +#define ProgramNamedParameter4fvNV_remap_index 355 +#define DepthBoundsEXT_remap_index 356 +#define BlendEquationSeparateEXT_remap_index 357 +#define BindFramebufferEXT_remap_index 358 +#define BindRenderbufferEXT_remap_index 359 +#define CheckFramebufferStatusEXT_remap_index 360 +#define DeleteFramebuffersEXT_remap_index 361 +#define DeleteRenderbuffersEXT_remap_index 362 +#define FramebufferRenderbufferEXT_remap_index 363 +#define FramebufferTexture1DEXT_remap_index 364 +#define FramebufferTexture2DEXT_remap_index 365 +#define FramebufferTexture3DEXT_remap_index 366 +#define GenFramebuffersEXT_remap_index 367 +#define GenRenderbuffersEXT_remap_index 368 +#define GenerateMipmapEXT_remap_index 369 +#define GetFramebufferAttachmentParameterivEXT_remap_index 370 +#define GetRenderbufferParameterivEXT_remap_index 371 +#define IsFramebufferEXT_remap_index 372 +#define IsRenderbufferEXT_remap_index 373 +#define RenderbufferStorageEXT_remap_index 374 +#define BlitFramebufferEXT_remap_index 375 +#define BufferParameteriAPPLE_remap_index 376 +#define FlushMappedBufferRangeAPPLE_remap_index 377 +#define FramebufferTextureLayerEXT_remap_index 378 +#define ProvokingVertexEXT_remap_index 379 +#define GetTexParameterPointervAPPLE_remap_index 380 +#define TextureRangeAPPLE_remap_index 381 +#define StencilFuncSeparateATI_remap_index 382 +#define ProgramEnvParameters4fvEXT_remap_index 383 +#define ProgramLocalParameters4fvEXT_remap_index 384 +#define GetQueryObjecti64vEXT_remap_index 385 +#define GetQueryObjectui64vEXT_remap_index 386 + +#define CALL_AttachShader(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint)), driDispatchRemapTable[AttachShader_remap_index], parameters) +#define GET_AttachShader(disp) GET_by_offset(disp, driDispatchRemapTable[AttachShader_remap_index]) +#define SET_AttachShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AttachShader_remap_index], fn) +#define CALL_CreateProgram(disp, parameters) CALL_by_offset(disp, (GLuint (GLAPIENTRYP)(void)), driDispatchRemapTable[CreateProgram_remap_index], parameters) +#define GET_CreateProgram(disp) GET_by_offset(disp, driDispatchRemapTable[CreateProgram_remap_index]) +#define SET_CreateProgram(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CreateProgram_remap_index], fn) +#define CALL_CreateShader(disp, parameters) CALL_by_offset(disp, (GLuint (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[CreateShader_remap_index], parameters) +#define GET_CreateShader(disp) GET_by_offset(disp, driDispatchRemapTable[CreateShader_remap_index]) +#define SET_CreateShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CreateShader_remap_index], fn) +#define CALL_DeleteProgram(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[DeleteProgram_remap_index], parameters) +#define GET_DeleteProgram(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteProgram_remap_index]) +#define SET_DeleteProgram(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteProgram_remap_index], fn) +#define CALL_DeleteShader(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[DeleteShader_remap_index], parameters) +#define GET_DeleteShader(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteShader_remap_index]) +#define SET_DeleteShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteShader_remap_index], fn) +#define CALL_DetachShader(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint)), driDispatchRemapTable[DetachShader_remap_index], parameters) +#define GET_DetachShader(disp) GET_by_offset(disp, driDispatchRemapTable[DetachShader_remap_index]) +#define SET_DetachShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DetachShader_remap_index], fn) +#define CALL_GetAttachedShaders(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, GLsizei *, GLuint *)), driDispatchRemapTable[GetAttachedShaders_remap_index], parameters) +#define GET_GetAttachedShaders(disp) GET_by_offset(disp, driDispatchRemapTable[GetAttachedShaders_remap_index]) +#define SET_GetAttachedShaders(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetAttachedShaders_remap_index], fn) +#define CALL_GetProgramInfoLog(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, GLsizei *, GLchar *)), driDispatchRemapTable[GetProgramInfoLog_remap_index], parameters) +#define GET_GetProgramInfoLog(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramInfoLog_remap_index]) +#define SET_GetProgramInfoLog(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramInfoLog_remap_index], fn) +#define CALL_GetProgramiv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetProgramiv_remap_index], parameters) +#define GET_GetProgramiv(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramiv_remap_index]) +#define SET_GetProgramiv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramiv_remap_index], fn) +#define CALL_GetShaderInfoLog(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, GLsizei *, GLchar *)), driDispatchRemapTable[GetShaderInfoLog_remap_index], parameters) +#define GET_GetShaderInfoLog(disp) GET_by_offset(disp, driDispatchRemapTable[GetShaderInfoLog_remap_index]) +#define SET_GetShaderInfoLog(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetShaderInfoLog_remap_index], fn) +#define CALL_GetShaderiv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetShaderiv_remap_index], parameters) +#define GET_GetShaderiv(disp) GET_by_offset(disp, driDispatchRemapTable[GetShaderiv_remap_index]) +#define SET_GetShaderiv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetShaderiv_remap_index], fn) +#define CALL_IsProgram(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsProgram_remap_index], parameters) +#define GET_IsProgram(disp) GET_by_offset(disp, driDispatchRemapTable[IsProgram_remap_index]) +#define SET_IsProgram(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsProgram_remap_index], fn) +#define CALL_IsShader(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsShader_remap_index], parameters) +#define GET_IsShader(disp) GET_by_offset(disp, driDispatchRemapTable[IsShader_remap_index]) +#define SET_IsShader(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsShader_remap_index], fn) +#define CALL_StencilFuncSeparate(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint, GLuint)), driDispatchRemapTable[StencilFuncSeparate_remap_index], parameters) +#define GET_StencilFuncSeparate(disp) GET_by_offset(disp, driDispatchRemapTable[StencilFuncSeparate_remap_index]) +#define SET_StencilFuncSeparate(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StencilFuncSeparate_remap_index], fn) +#define CALL_StencilMaskSeparate(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[StencilMaskSeparate_remap_index], parameters) +#define GET_StencilMaskSeparate(disp) GET_by_offset(disp, driDispatchRemapTable[StencilMaskSeparate_remap_index]) +#define SET_StencilMaskSeparate(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StencilMaskSeparate_remap_index], fn) +#define CALL_StencilOpSeparate(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum)), driDispatchRemapTable[StencilOpSeparate_remap_index], parameters) +#define GET_StencilOpSeparate(disp) GET_by_offset(disp, driDispatchRemapTable[StencilOpSeparate_remap_index]) +#define SET_StencilOpSeparate(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StencilOpSeparate_remap_index], fn) +#define CALL_UniformMatrix2x3fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix2x3fv_remap_index], parameters) +#define GET_UniformMatrix2x3fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x3fv_remap_index]) +#define SET_UniformMatrix2x3fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x3fv_remap_index], fn) +#define CALL_UniformMatrix2x4fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix2x4fv_remap_index], parameters) +#define GET_UniformMatrix2x4fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x4fv_remap_index]) +#define SET_UniformMatrix2x4fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix2x4fv_remap_index], fn) +#define CALL_UniformMatrix3x2fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix3x2fv_remap_index], parameters) +#define GET_UniformMatrix3x2fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x2fv_remap_index]) +#define SET_UniformMatrix3x2fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x2fv_remap_index], fn) +#define CALL_UniformMatrix3x4fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix3x4fv_remap_index], parameters) +#define GET_UniformMatrix3x4fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x4fv_remap_index]) +#define SET_UniformMatrix3x4fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix3x4fv_remap_index], fn) +#define CALL_UniformMatrix4x2fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix4x2fv_remap_index], parameters) +#define GET_UniformMatrix4x2fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x2fv_remap_index]) +#define SET_UniformMatrix4x2fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x2fv_remap_index], fn) +#define CALL_UniformMatrix4x3fv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix4x3fv_remap_index], parameters) +#define GET_UniformMatrix4x3fv(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x3fv_remap_index]) +#define SET_UniformMatrix4x3fv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix4x3fv_remap_index], fn) +#define CALL_LoadTransposeMatrixdARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index], parameters) +#define GET_LoadTransposeMatrixdARB(disp) GET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index]) +#define SET_LoadTransposeMatrixdARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixdARB_remap_index], fn) +#define CALL_LoadTransposeMatrixfARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[LoadTransposeMatrixfARB_remap_index], parameters) +#define GET_LoadTransposeMatrixfARB(disp) GET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixfARB_remap_index]) +#define SET_LoadTransposeMatrixfARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LoadTransposeMatrixfARB_remap_index], fn) +#define CALL_MultTransposeMatrixdARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[MultTransposeMatrixdARB_remap_index], parameters) +#define GET_MultTransposeMatrixdARB(disp) GET_by_offset(disp, driDispatchRemapTable[MultTransposeMatrixdARB_remap_index]) +#define SET_MultTransposeMatrixdARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultTransposeMatrixdARB_remap_index], fn) +#define CALL_MultTransposeMatrixfARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[MultTransposeMatrixfARB_remap_index], parameters) +#define GET_MultTransposeMatrixfARB(disp) GET_by_offset(disp, driDispatchRemapTable[MultTransposeMatrixfARB_remap_index]) +#define SET_MultTransposeMatrixfARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultTransposeMatrixfARB_remap_index], fn) +#define CALL_SampleCoverageARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLclampf, GLboolean)), driDispatchRemapTable[SampleCoverageARB_remap_index], parameters) +#define GET_SampleCoverageARB(disp) GET_by_offset(disp, driDispatchRemapTable[SampleCoverageARB_remap_index]) +#define SET_SampleCoverageARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SampleCoverageARB_remap_index], fn) +#define CALL_CompressedTexImage1DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexImage1DARB_remap_index], parameters) +#define GET_CompressedTexImage1DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexImage1DARB_remap_index]) +#define SET_CompressedTexImage1DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexImage1DARB_remap_index], fn) +#define CALL_CompressedTexImage2DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexImage2DARB_remap_index], parameters) +#define GET_CompressedTexImage2DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexImage2DARB_remap_index]) +#define SET_CompressedTexImage2DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexImage2DARB_remap_index], fn) +#define CALL_CompressedTexImage3DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexImage3DARB_remap_index], parameters) +#define GET_CompressedTexImage3DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexImage3DARB_remap_index]) +#define SET_CompressedTexImage3DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexImage3DARB_remap_index], fn) +#define CALL_CompressedTexSubImage1DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexSubImage1DARB_remap_index], parameters) +#define GET_CompressedTexSubImage1DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage1DARB_remap_index]) +#define SET_CompressedTexSubImage1DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage1DARB_remap_index], fn) +#define CALL_CompressedTexSubImage2DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexSubImage2DARB_remap_index], parameters) +#define GET_CompressedTexSubImage2DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage2DARB_remap_index]) +#define SET_CompressedTexSubImage2DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage2DARB_remap_index], fn) +#define CALL_CompressedTexSubImage3DARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[CompressedTexSubImage3DARB_remap_index], parameters) +#define GET_CompressedTexSubImage3DARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage3DARB_remap_index]) +#define SET_CompressedTexSubImage3DARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompressedTexSubImage3DARB_remap_index], fn) +#define CALL_GetCompressedTexImageARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint, GLvoid *)), driDispatchRemapTable[GetCompressedTexImageARB_remap_index], parameters) +#define GET_GetCompressedTexImageARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetCompressedTexImageARB_remap_index]) +#define SET_GetCompressedTexImageARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetCompressedTexImageARB_remap_index], fn) +#define CALL_DisableVertexAttribArrayARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[DisableVertexAttribArrayARB_remap_index], parameters) +#define GET_DisableVertexAttribArrayARB(disp) GET_by_offset(disp, driDispatchRemapTable[DisableVertexAttribArrayARB_remap_index]) +#define SET_DisableVertexAttribArrayARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DisableVertexAttribArrayARB_remap_index], fn) +#define CALL_EnableVertexAttribArrayARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[EnableVertexAttribArrayARB_remap_index], parameters) +#define GET_EnableVertexAttribArrayARB(disp) GET_by_offset(disp, driDispatchRemapTable[EnableVertexAttribArrayARB_remap_index]) +#define SET_EnableVertexAttribArrayARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[EnableVertexAttribArrayARB_remap_index], fn) +#define CALL_GetProgramEnvParameterdvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLdouble *)), driDispatchRemapTable[GetProgramEnvParameterdvARB_remap_index], parameters) +#define GET_GetProgramEnvParameterdvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramEnvParameterdvARB_remap_index]) +#define SET_GetProgramEnvParameterdvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramEnvParameterdvARB_remap_index], fn) +#define CALL_GetProgramEnvParameterfvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLfloat *)), driDispatchRemapTable[GetProgramEnvParameterfvARB_remap_index], parameters) +#define GET_GetProgramEnvParameterfvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramEnvParameterfvARB_remap_index]) +#define SET_GetProgramEnvParameterfvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramEnvParameterfvARB_remap_index], fn) +#define CALL_GetProgramLocalParameterdvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLdouble *)), driDispatchRemapTable[GetProgramLocalParameterdvARB_remap_index], parameters) +#define GET_GetProgramLocalParameterdvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramLocalParameterdvARB_remap_index]) +#define SET_GetProgramLocalParameterdvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramLocalParameterdvARB_remap_index], fn) +#define CALL_GetProgramLocalParameterfvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLfloat *)), driDispatchRemapTable[GetProgramLocalParameterfvARB_remap_index], parameters) +#define GET_GetProgramLocalParameterfvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramLocalParameterfvARB_remap_index]) +#define SET_GetProgramLocalParameterfvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramLocalParameterfvARB_remap_index], fn) +#define CALL_GetProgramStringARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLvoid *)), driDispatchRemapTable[GetProgramStringARB_remap_index], parameters) +#define GET_GetProgramStringARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramStringARB_remap_index]) +#define SET_GetProgramStringARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramStringARB_remap_index], fn) +#define CALL_GetProgramivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetProgramivARB_remap_index], parameters) +#define GET_GetProgramivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramivARB_remap_index]) +#define SET_GetProgramivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramivARB_remap_index], fn) +#define CALL_GetVertexAttribdvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLdouble *)), driDispatchRemapTable[GetVertexAttribdvARB_remap_index], parameters) +#define GET_GetVertexAttribdvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribdvARB_remap_index]) +#define SET_GetVertexAttribdvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribdvARB_remap_index], fn) +#define CALL_GetVertexAttribfvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLfloat *)), driDispatchRemapTable[GetVertexAttribfvARB_remap_index], parameters) +#define GET_GetVertexAttribfvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribfvARB_remap_index]) +#define SET_GetVertexAttribfvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribfvARB_remap_index], fn) +#define CALL_GetVertexAttribivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetVertexAttribivARB_remap_index], parameters) +#define GET_GetVertexAttribivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribivARB_remap_index]) +#define SET_GetVertexAttribivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribivARB_remap_index], fn) +#define CALL_ProgramEnvParameter4dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[ProgramEnvParameter4dARB_remap_index], parameters) +#define GET_ProgramEnvParameter4dARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4dARB_remap_index]) +#define SET_ProgramEnvParameter4dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4dARB_remap_index], fn) +#define CALL_ProgramEnvParameter4dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLdouble *)), driDispatchRemapTable[ProgramEnvParameter4dvARB_remap_index], parameters) +#define GET_ProgramEnvParameter4dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4dvARB_remap_index]) +#define SET_ProgramEnvParameter4dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4dvARB_remap_index], fn) +#define CALL_ProgramEnvParameter4fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[ProgramEnvParameter4fARB_remap_index], parameters) +#define GET_ProgramEnvParameter4fARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4fARB_remap_index]) +#define SET_ProgramEnvParameter4fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4fARB_remap_index], fn) +#define CALL_ProgramEnvParameter4fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLfloat *)), driDispatchRemapTable[ProgramEnvParameter4fvARB_remap_index], parameters) +#define GET_ProgramEnvParameter4fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4fvARB_remap_index]) +#define SET_ProgramEnvParameter4fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameter4fvARB_remap_index], fn) +#define CALL_ProgramLocalParameter4dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[ProgramLocalParameter4dARB_remap_index], parameters) +#define GET_ProgramLocalParameter4dARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4dARB_remap_index]) +#define SET_ProgramLocalParameter4dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4dARB_remap_index], fn) +#define CALL_ProgramLocalParameter4dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLdouble *)), driDispatchRemapTable[ProgramLocalParameter4dvARB_remap_index], parameters) +#define GET_ProgramLocalParameter4dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4dvARB_remap_index]) +#define SET_ProgramLocalParameter4dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4dvARB_remap_index], fn) +#define CALL_ProgramLocalParameter4fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[ProgramLocalParameter4fARB_remap_index], parameters) +#define GET_ProgramLocalParameter4fARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4fARB_remap_index]) +#define SET_ProgramLocalParameter4fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4fARB_remap_index], fn) +#define CALL_ProgramLocalParameter4fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLfloat *)), driDispatchRemapTable[ProgramLocalParameter4fvARB_remap_index], parameters) +#define GET_ProgramLocalParameter4fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4fvARB_remap_index]) +#define SET_ProgramLocalParameter4fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameter4fvARB_remap_index], fn) +#define CALL_ProgramStringARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[ProgramStringARB_remap_index], parameters) +#define GET_ProgramStringARB(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramStringARB_remap_index]) +#define SET_ProgramStringARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramStringARB_remap_index], fn) +#define CALL_VertexAttrib1dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble)), driDispatchRemapTable[VertexAttrib1dARB_remap_index], parameters) +#define GET_VertexAttrib1dARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dARB_remap_index]) +#define SET_VertexAttrib1dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dARB_remap_index], fn) +#define CALL_VertexAttrib1dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib1dvARB_remap_index], parameters) +#define GET_VertexAttrib1dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dvARB_remap_index]) +#define SET_VertexAttrib1dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dvARB_remap_index], fn) +#define CALL_VertexAttrib1fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat)), driDispatchRemapTable[VertexAttrib1fARB_remap_index], parameters) +#define GET_VertexAttrib1fARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fARB_remap_index]) +#define SET_VertexAttrib1fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fARB_remap_index], fn) +#define CALL_VertexAttrib1fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib1fvARB_remap_index], parameters) +#define GET_VertexAttrib1fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fvARB_remap_index]) +#define SET_VertexAttrib1fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fvARB_remap_index], fn) +#define CALL_VertexAttrib1sARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort)), driDispatchRemapTable[VertexAttrib1sARB_remap_index], parameters) +#define GET_VertexAttrib1sARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1sARB_remap_index]) +#define SET_VertexAttrib1sARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1sARB_remap_index], fn) +#define CALL_VertexAttrib1svARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib1svARB_remap_index], parameters) +#define GET_VertexAttrib1svARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1svARB_remap_index]) +#define SET_VertexAttrib1svARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1svARB_remap_index], fn) +#define CALL_VertexAttrib2dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib2dARB_remap_index], parameters) +#define GET_VertexAttrib2dARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dARB_remap_index]) +#define SET_VertexAttrib2dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dARB_remap_index], fn) +#define CALL_VertexAttrib2dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib2dvARB_remap_index], parameters) +#define GET_VertexAttrib2dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dvARB_remap_index]) +#define SET_VertexAttrib2dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dvARB_remap_index], fn) +#define CALL_VertexAttrib2fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib2fARB_remap_index], parameters) +#define GET_VertexAttrib2fARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fARB_remap_index]) +#define SET_VertexAttrib2fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fARB_remap_index], fn) +#define CALL_VertexAttrib2fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib2fvARB_remap_index], parameters) +#define GET_VertexAttrib2fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fvARB_remap_index]) +#define SET_VertexAttrib2fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fvARB_remap_index], fn) +#define CALL_VertexAttrib2sARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib2sARB_remap_index], parameters) +#define GET_VertexAttrib2sARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2sARB_remap_index]) +#define SET_VertexAttrib2sARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2sARB_remap_index], fn) +#define CALL_VertexAttrib2svARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib2svARB_remap_index], parameters) +#define GET_VertexAttrib2svARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2svARB_remap_index]) +#define SET_VertexAttrib2svARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2svARB_remap_index], fn) +#define CALL_VertexAttrib3dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib3dARB_remap_index], parameters) +#define GET_VertexAttrib3dARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dARB_remap_index]) +#define SET_VertexAttrib3dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dARB_remap_index], fn) +#define CALL_VertexAttrib3dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib3dvARB_remap_index], parameters) +#define GET_VertexAttrib3dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dvARB_remap_index]) +#define SET_VertexAttrib3dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dvARB_remap_index], fn) +#define CALL_VertexAttrib3fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib3fARB_remap_index], parameters) +#define GET_VertexAttrib3fARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fARB_remap_index]) +#define SET_VertexAttrib3fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fARB_remap_index], fn) +#define CALL_VertexAttrib3fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib3fvARB_remap_index], parameters) +#define GET_VertexAttrib3fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fvARB_remap_index]) +#define SET_VertexAttrib3fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fvARB_remap_index], fn) +#define CALL_VertexAttrib3sARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib3sARB_remap_index], parameters) +#define GET_VertexAttrib3sARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3sARB_remap_index]) +#define SET_VertexAttrib3sARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3sARB_remap_index], fn) +#define CALL_VertexAttrib3svARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib3svARB_remap_index], parameters) +#define GET_VertexAttrib3svARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3svARB_remap_index]) +#define SET_VertexAttrib3svARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3svARB_remap_index], fn) +#define CALL_VertexAttrib4NbvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLbyte *)), driDispatchRemapTable[VertexAttrib4NbvARB_remap_index], parameters) +#define GET_VertexAttrib4NbvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NbvARB_remap_index]) +#define SET_VertexAttrib4NbvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NbvARB_remap_index], fn) +#define CALL_VertexAttrib4NivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLint *)), driDispatchRemapTable[VertexAttrib4NivARB_remap_index], parameters) +#define GET_VertexAttrib4NivARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NivARB_remap_index]) +#define SET_VertexAttrib4NivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NivARB_remap_index], fn) +#define CALL_VertexAttrib4NsvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib4NsvARB_remap_index], parameters) +#define GET_VertexAttrib4NsvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NsvARB_remap_index]) +#define SET_VertexAttrib4NsvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NsvARB_remap_index], fn) +#define CALL_VertexAttrib4NubARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLubyte, GLubyte, GLubyte, GLubyte)), driDispatchRemapTable[VertexAttrib4NubARB_remap_index], parameters) +#define GET_VertexAttrib4NubARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NubARB_remap_index]) +#define SET_VertexAttrib4NubARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NubARB_remap_index], fn) +#define CALL_VertexAttrib4NubvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLubyte *)), driDispatchRemapTable[VertexAttrib4NubvARB_remap_index], parameters) +#define GET_VertexAttrib4NubvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NubvARB_remap_index]) +#define SET_VertexAttrib4NubvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NubvARB_remap_index], fn) +#define CALL_VertexAttrib4NuivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLuint *)), driDispatchRemapTable[VertexAttrib4NuivARB_remap_index], parameters) +#define GET_VertexAttrib4NuivARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NuivARB_remap_index]) +#define SET_VertexAttrib4NuivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NuivARB_remap_index], fn) +#define CALL_VertexAttrib4NusvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLushort *)), driDispatchRemapTable[VertexAttrib4NusvARB_remap_index], parameters) +#define GET_VertexAttrib4NusvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NusvARB_remap_index]) +#define SET_VertexAttrib4NusvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4NusvARB_remap_index], fn) +#define CALL_VertexAttrib4bvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLbyte *)), driDispatchRemapTable[VertexAttrib4bvARB_remap_index], parameters) +#define GET_VertexAttrib4bvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4bvARB_remap_index]) +#define SET_VertexAttrib4bvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4bvARB_remap_index], fn) +#define CALL_VertexAttrib4dARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib4dARB_remap_index], parameters) +#define GET_VertexAttrib4dARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dARB_remap_index]) +#define SET_VertexAttrib4dARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dARB_remap_index], fn) +#define CALL_VertexAttrib4dvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib4dvARB_remap_index], parameters) +#define GET_VertexAttrib4dvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dvARB_remap_index]) +#define SET_VertexAttrib4dvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dvARB_remap_index], fn) +#define CALL_VertexAttrib4fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib4fARB_remap_index], parameters) +#define GET_VertexAttrib4fARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fARB_remap_index]) +#define SET_VertexAttrib4fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fARB_remap_index], fn) +#define CALL_VertexAttrib4fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib4fvARB_remap_index], parameters) +#define GET_VertexAttrib4fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fvARB_remap_index]) +#define SET_VertexAttrib4fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fvARB_remap_index], fn) +#define CALL_VertexAttrib4ivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLint *)), driDispatchRemapTable[VertexAttrib4ivARB_remap_index], parameters) +#define GET_VertexAttrib4ivARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ivARB_remap_index]) +#define SET_VertexAttrib4ivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ivARB_remap_index], fn) +#define CALL_VertexAttrib4sARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib4sARB_remap_index], parameters) +#define GET_VertexAttrib4sARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4sARB_remap_index]) +#define SET_VertexAttrib4sARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4sARB_remap_index], fn) +#define CALL_VertexAttrib4svARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib4svARB_remap_index], parameters) +#define GET_VertexAttrib4svARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4svARB_remap_index]) +#define SET_VertexAttrib4svARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4svARB_remap_index], fn) +#define CALL_VertexAttrib4ubvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLubyte *)), driDispatchRemapTable[VertexAttrib4ubvARB_remap_index], parameters) +#define GET_VertexAttrib4ubvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubvARB_remap_index]) +#define SET_VertexAttrib4ubvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubvARB_remap_index], fn) +#define CALL_VertexAttrib4uivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLuint *)), driDispatchRemapTable[VertexAttrib4uivARB_remap_index], parameters) +#define GET_VertexAttrib4uivARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4uivARB_remap_index]) +#define SET_VertexAttrib4uivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4uivARB_remap_index], fn) +#define CALL_VertexAttrib4usvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLushort *)), driDispatchRemapTable[VertexAttrib4usvARB_remap_index], parameters) +#define GET_VertexAttrib4usvARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4usvARB_remap_index]) +#define SET_VertexAttrib4usvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4usvARB_remap_index], fn) +#define CALL_VertexAttribPointerARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *)), driDispatchRemapTable[VertexAttribPointerARB_remap_index], parameters) +#define GET_VertexAttribPointerARB(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribPointerARB_remap_index]) +#define SET_VertexAttribPointerARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribPointerARB_remap_index], fn) +#define CALL_BindBufferARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[BindBufferARB_remap_index], parameters) +#define GET_BindBufferARB(disp) GET_by_offset(disp, driDispatchRemapTable[BindBufferARB_remap_index]) +#define SET_BindBufferARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindBufferARB_remap_index], fn) +#define CALL_BufferDataARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizeiptrARB, const GLvoid *, GLenum)), driDispatchRemapTable[BufferDataARB_remap_index], parameters) +#define GET_BufferDataARB(disp) GET_by_offset(disp, driDispatchRemapTable[BufferDataARB_remap_index]) +#define SET_BufferDataARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BufferDataARB_remap_index], fn) +#define CALL_BufferSubDataARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *)), driDispatchRemapTable[BufferSubDataARB_remap_index], parameters) +#define GET_BufferSubDataARB(disp) GET_by_offset(disp, driDispatchRemapTable[BufferSubDataARB_remap_index]) +#define SET_BufferSubDataARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BufferSubDataARB_remap_index], fn) +#define CALL_DeleteBuffersARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteBuffersARB_remap_index], parameters) +#define GET_DeleteBuffersARB(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteBuffersARB_remap_index]) +#define SET_DeleteBuffersARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteBuffersARB_remap_index], fn) +#define CALL_GenBuffersARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenBuffersARB_remap_index], parameters) +#define GET_GenBuffersARB(disp) GET_by_offset(disp, driDispatchRemapTable[GenBuffersARB_remap_index]) +#define SET_GenBuffersARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenBuffersARB_remap_index], fn) +#define CALL_GetBufferParameterivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetBufferParameterivARB_remap_index], parameters) +#define GET_GetBufferParameterivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetBufferParameterivARB_remap_index]) +#define SET_GetBufferParameterivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetBufferParameterivARB_remap_index], fn) +#define CALL_GetBufferPointervARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLvoid **)), driDispatchRemapTable[GetBufferPointervARB_remap_index], parameters) +#define GET_GetBufferPointervARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetBufferPointervARB_remap_index]) +#define SET_GetBufferPointervARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetBufferPointervARB_remap_index], fn) +#define CALL_GetBufferSubDataARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *)), driDispatchRemapTable[GetBufferSubDataARB_remap_index], parameters) +#define GET_GetBufferSubDataARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetBufferSubDataARB_remap_index]) +#define SET_GetBufferSubDataARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetBufferSubDataARB_remap_index], fn) +#define CALL_IsBufferARB(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsBufferARB_remap_index], parameters) +#define GET_IsBufferARB(disp) GET_by_offset(disp, driDispatchRemapTable[IsBufferARB_remap_index]) +#define SET_IsBufferARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsBufferARB_remap_index], fn) +#define CALL_MapBufferARB(disp, parameters) CALL_by_offset(disp, (GLvoid * (GLAPIENTRYP)(GLenum, GLenum)), driDispatchRemapTable[MapBufferARB_remap_index], parameters) +#define GET_MapBufferARB(disp) GET_by_offset(disp, driDispatchRemapTable[MapBufferARB_remap_index]) +#define SET_MapBufferARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MapBufferARB_remap_index], fn) +#define CALL_UnmapBufferARB(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[UnmapBufferARB_remap_index], parameters) +#define GET_UnmapBufferARB(disp) GET_by_offset(disp, driDispatchRemapTable[UnmapBufferARB_remap_index]) +#define SET_UnmapBufferARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UnmapBufferARB_remap_index], fn) +#define CALL_BeginQueryARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[BeginQueryARB_remap_index], parameters) +#define GET_BeginQueryARB(disp) GET_by_offset(disp, driDispatchRemapTable[BeginQueryARB_remap_index]) +#define SET_BeginQueryARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BeginQueryARB_remap_index], fn) +#define CALL_DeleteQueriesARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteQueriesARB_remap_index], parameters) +#define GET_DeleteQueriesARB(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteQueriesARB_remap_index]) +#define SET_DeleteQueriesARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteQueriesARB_remap_index], fn) +#define CALL_EndQueryARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[EndQueryARB_remap_index], parameters) +#define GET_EndQueryARB(disp) GET_by_offset(disp, driDispatchRemapTable[EndQueryARB_remap_index]) +#define SET_EndQueryARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[EndQueryARB_remap_index], fn) +#define CALL_GenQueriesARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenQueriesARB_remap_index], parameters) +#define GET_GenQueriesARB(disp) GET_by_offset(disp, driDispatchRemapTable[GenQueriesARB_remap_index]) +#define SET_GenQueriesARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenQueriesARB_remap_index], fn) +#define CALL_GetQueryObjectivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetQueryObjectivARB_remap_index], parameters) +#define GET_GetQueryObjectivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjectivARB_remap_index]) +#define SET_GetQueryObjectivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjectivARB_remap_index], fn) +#define CALL_GetQueryObjectuivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLuint *)), driDispatchRemapTable[GetQueryObjectuivARB_remap_index], parameters) +#define GET_GetQueryObjectuivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjectuivARB_remap_index]) +#define SET_GetQueryObjectuivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjectuivARB_remap_index], fn) +#define CALL_GetQueryivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetQueryivARB_remap_index], parameters) +#define GET_GetQueryivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryivARB_remap_index]) +#define SET_GetQueryivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryivARB_remap_index], fn) +#define CALL_IsQueryARB(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsQueryARB_remap_index], parameters) +#define GET_IsQueryARB(disp) GET_by_offset(disp, driDispatchRemapTable[IsQueryARB_remap_index]) +#define SET_IsQueryARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsQueryARB_remap_index], fn) +#define CALL_AttachObjectARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLhandleARB)), driDispatchRemapTable[AttachObjectARB_remap_index], parameters) +#define GET_AttachObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[AttachObjectARB_remap_index]) +#define SET_AttachObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AttachObjectARB_remap_index], fn) +#define CALL_CompileShaderARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB)), driDispatchRemapTable[CompileShaderARB_remap_index], parameters) +#define GET_CompileShaderARB(disp) GET_by_offset(disp, driDispatchRemapTable[CompileShaderARB_remap_index]) +#define SET_CompileShaderARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CompileShaderARB_remap_index], fn) +#define CALL_CreateProgramObjectARB(disp, parameters) CALL_by_offset(disp, (GLhandleARB (GLAPIENTRYP)(void)), driDispatchRemapTable[CreateProgramObjectARB_remap_index], parameters) +#define GET_CreateProgramObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[CreateProgramObjectARB_remap_index]) +#define SET_CreateProgramObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CreateProgramObjectARB_remap_index], fn) +#define CALL_CreateShaderObjectARB(disp, parameters) CALL_by_offset(disp, (GLhandleARB (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[CreateShaderObjectARB_remap_index], parameters) +#define GET_CreateShaderObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[CreateShaderObjectARB_remap_index]) +#define SET_CreateShaderObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CreateShaderObjectARB_remap_index], fn) +#define CALL_DeleteObjectARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB)), driDispatchRemapTable[DeleteObjectARB_remap_index], parameters) +#define GET_DeleteObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteObjectARB_remap_index]) +#define SET_DeleteObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteObjectARB_remap_index], fn) +#define CALL_DetachObjectARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLhandleARB)), driDispatchRemapTable[DetachObjectARB_remap_index], parameters) +#define GET_DetachObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[DetachObjectARB_remap_index]) +#define SET_DetachObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DetachObjectARB_remap_index], fn) +#define CALL_GetActiveUniformARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *)), driDispatchRemapTable[GetActiveUniformARB_remap_index], parameters) +#define GET_GetActiveUniformARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetActiveUniformARB_remap_index]) +#define SET_GetActiveUniformARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetActiveUniformARB_remap_index], fn) +#define CALL_GetAttachedObjectsARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLsizei, GLsizei *, GLhandleARB *)), driDispatchRemapTable[GetAttachedObjectsARB_remap_index], parameters) +#define GET_GetAttachedObjectsARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetAttachedObjectsARB_remap_index]) +#define SET_GetAttachedObjectsARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetAttachedObjectsARB_remap_index], fn) +#define CALL_GetHandleARB(disp, parameters) CALL_by_offset(disp, (GLhandleARB (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[GetHandleARB_remap_index], parameters) +#define GET_GetHandleARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetHandleARB_remap_index]) +#define SET_GetHandleARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetHandleARB_remap_index], fn) +#define CALL_GetInfoLogARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLsizei, GLsizei *, GLcharARB *)), driDispatchRemapTable[GetInfoLogARB_remap_index], parameters) +#define GET_GetInfoLogARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetInfoLogARB_remap_index]) +#define SET_GetInfoLogARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetInfoLogARB_remap_index], fn) +#define CALL_GetObjectParameterfvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLenum, GLfloat *)), driDispatchRemapTable[GetObjectParameterfvARB_remap_index], parameters) +#define GET_GetObjectParameterfvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetObjectParameterfvARB_remap_index]) +#define SET_GetObjectParameterfvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetObjectParameterfvARB_remap_index], fn) +#define CALL_GetObjectParameterivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLenum, GLint *)), driDispatchRemapTable[GetObjectParameterivARB_remap_index], parameters) +#define GET_GetObjectParameterivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetObjectParameterivARB_remap_index]) +#define SET_GetObjectParameterivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetObjectParameterivARB_remap_index], fn) +#define CALL_GetShaderSourceARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLsizei, GLsizei *, GLcharARB *)), driDispatchRemapTable[GetShaderSourceARB_remap_index], parameters) +#define GET_GetShaderSourceARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetShaderSourceARB_remap_index]) +#define SET_GetShaderSourceARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetShaderSourceARB_remap_index], fn) +#define CALL_GetUniformLocationARB(disp, parameters) CALL_by_offset(disp, (GLint (GLAPIENTRYP)(GLhandleARB, const GLcharARB *)), driDispatchRemapTable[GetUniformLocationARB_remap_index], parameters) +#define GET_GetUniformLocationARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetUniformLocationARB_remap_index]) +#define SET_GetUniformLocationARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetUniformLocationARB_remap_index], fn) +#define CALL_GetUniformfvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLint, GLfloat *)), driDispatchRemapTable[GetUniformfvARB_remap_index], parameters) +#define GET_GetUniformfvARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetUniformfvARB_remap_index]) +#define SET_GetUniformfvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetUniformfvARB_remap_index], fn) +#define CALL_GetUniformivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLint, GLint *)), driDispatchRemapTable[GetUniformivARB_remap_index], parameters) +#define GET_GetUniformivARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetUniformivARB_remap_index]) +#define SET_GetUniformivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetUniformivARB_remap_index], fn) +#define CALL_LinkProgramARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB)), driDispatchRemapTable[LinkProgramARB_remap_index], parameters) +#define GET_LinkProgramARB(disp) GET_by_offset(disp, driDispatchRemapTable[LinkProgramARB_remap_index]) +#define SET_LinkProgramARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LinkProgramARB_remap_index], fn) +#define CALL_ShaderSourceARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLsizei, const GLcharARB **, const GLint *)), driDispatchRemapTable[ShaderSourceARB_remap_index], parameters) +#define GET_ShaderSourceARB(disp) GET_by_offset(disp, driDispatchRemapTable[ShaderSourceARB_remap_index]) +#define SET_ShaderSourceARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ShaderSourceARB_remap_index], fn) +#define CALL_Uniform1fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLfloat)), driDispatchRemapTable[Uniform1fARB_remap_index], parameters) +#define GET_Uniform1fARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform1fARB_remap_index]) +#define SET_Uniform1fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform1fARB_remap_index], fn) +#define CALL_Uniform1fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLfloat *)), driDispatchRemapTable[Uniform1fvARB_remap_index], parameters) +#define GET_Uniform1fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform1fvARB_remap_index]) +#define SET_Uniform1fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform1fvARB_remap_index], fn) +#define CALL_Uniform1iARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint)), driDispatchRemapTable[Uniform1iARB_remap_index], parameters) +#define GET_Uniform1iARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform1iARB_remap_index]) +#define SET_Uniform1iARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform1iARB_remap_index], fn) +#define CALL_Uniform1ivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLint *)), driDispatchRemapTable[Uniform1ivARB_remap_index], parameters) +#define GET_Uniform1ivARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform1ivARB_remap_index]) +#define SET_Uniform1ivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform1ivARB_remap_index], fn) +#define CALL_Uniform2fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLfloat, GLfloat)), driDispatchRemapTable[Uniform2fARB_remap_index], parameters) +#define GET_Uniform2fARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform2fARB_remap_index]) +#define SET_Uniform2fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform2fARB_remap_index], fn) +#define CALL_Uniform2fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLfloat *)), driDispatchRemapTable[Uniform2fvARB_remap_index], parameters) +#define GET_Uniform2fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform2fvARB_remap_index]) +#define SET_Uniform2fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform2fvARB_remap_index], fn) +#define CALL_Uniform2iARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint)), driDispatchRemapTable[Uniform2iARB_remap_index], parameters) +#define GET_Uniform2iARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform2iARB_remap_index]) +#define SET_Uniform2iARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform2iARB_remap_index], fn) +#define CALL_Uniform2ivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLint *)), driDispatchRemapTable[Uniform2ivARB_remap_index], parameters) +#define GET_Uniform2ivARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform2ivARB_remap_index]) +#define SET_Uniform2ivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform2ivARB_remap_index], fn) +#define CALL_Uniform3fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[Uniform3fARB_remap_index], parameters) +#define GET_Uniform3fARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform3fARB_remap_index]) +#define SET_Uniform3fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform3fARB_remap_index], fn) +#define CALL_Uniform3fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLfloat *)), driDispatchRemapTable[Uniform3fvARB_remap_index], parameters) +#define GET_Uniform3fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform3fvARB_remap_index]) +#define SET_Uniform3fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform3fvARB_remap_index], fn) +#define CALL_Uniform3iARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint, GLint)), driDispatchRemapTable[Uniform3iARB_remap_index], parameters) +#define GET_Uniform3iARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform3iARB_remap_index]) +#define SET_Uniform3iARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform3iARB_remap_index], fn) +#define CALL_Uniform3ivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLint *)), driDispatchRemapTable[Uniform3ivARB_remap_index], parameters) +#define GET_Uniform3ivARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform3ivARB_remap_index]) +#define SET_Uniform3ivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform3ivARB_remap_index], fn) +#define CALL_Uniform4fARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[Uniform4fARB_remap_index], parameters) +#define GET_Uniform4fARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform4fARB_remap_index]) +#define SET_Uniform4fARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform4fARB_remap_index], fn) +#define CALL_Uniform4fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLfloat *)), driDispatchRemapTable[Uniform4fvARB_remap_index], parameters) +#define GET_Uniform4fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform4fvARB_remap_index]) +#define SET_Uniform4fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform4fvARB_remap_index], fn) +#define CALL_Uniform4iARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint, GLint, GLint)), driDispatchRemapTable[Uniform4iARB_remap_index], parameters) +#define GET_Uniform4iARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform4iARB_remap_index]) +#define SET_Uniform4iARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform4iARB_remap_index], fn) +#define CALL_Uniform4ivARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, const GLint *)), driDispatchRemapTable[Uniform4ivARB_remap_index], parameters) +#define GET_Uniform4ivARB(disp) GET_by_offset(disp, driDispatchRemapTable[Uniform4ivARB_remap_index]) +#define SET_Uniform4ivARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[Uniform4ivARB_remap_index], fn) +#define CALL_UniformMatrix2fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix2fvARB_remap_index], parameters) +#define GET_UniformMatrix2fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix2fvARB_remap_index]) +#define SET_UniformMatrix2fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix2fvARB_remap_index], fn) +#define CALL_UniformMatrix3fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix3fvARB_remap_index], parameters) +#define GET_UniformMatrix3fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix3fvARB_remap_index]) +#define SET_UniformMatrix3fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix3fvARB_remap_index], fn) +#define CALL_UniformMatrix4fvARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei, GLboolean, const GLfloat *)), driDispatchRemapTable[UniformMatrix4fvARB_remap_index], parameters) +#define GET_UniformMatrix4fvARB(disp) GET_by_offset(disp, driDispatchRemapTable[UniformMatrix4fvARB_remap_index]) +#define SET_UniformMatrix4fvARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UniformMatrix4fvARB_remap_index], fn) +#define CALL_UseProgramObjectARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB)), driDispatchRemapTable[UseProgramObjectARB_remap_index], parameters) +#define GET_UseProgramObjectARB(disp) GET_by_offset(disp, driDispatchRemapTable[UseProgramObjectARB_remap_index]) +#define SET_UseProgramObjectARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UseProgramObjectARB_remap_index], fn) +#define CALL_ValidateProgramARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB)), driDispatchRemapTable[ValidateProgramARB_remap_index], parameters) +#define GET_ValidateProgramARB(disp) GET_by_offset(disp, driDispatchRemapTable[ValidateProgramARB_remap_index]) +#define SET_ValidateProgramARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ValidateProgramARB_remap_index], fn) +#define CALL_BindAttribLocationARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLuint, const GLcharARB *)), driDispatchRemapTable[BindAttribLocationARB_remap_index], parameters) +#define GET_BindAttribLocationARB(disp) GET_by_offset(disp, driDispatchRemapTable[BindAttribLocationARB_remap_index]) +#define SET_BindAttribLocationARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindAttribLocationARB_remap_index], fn) +#define CALL_GetActiveAttribARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *)), driDispatchRemapTable[GetActiveAttribARB_remap_index], parameters) +#define GET_GetActiveAttribARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetActiveAttribARB_remap_index]) +#define SET_GetActiveAttribARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetActiveAttribARB_remap_index], fn) +#define CALL_GetAttribLocationARB(disp, parameters) CALL_by_offset(disp, (GLint (GLAPIENTRYP)(GLhandleARB, const GLcharARB *)), driDispatchRemapTable[GetAttribLocationARB_remap_index], parameters) +#define GET_GetAttribLocationARB(disp) GET_by_offset(disp, driDispatchRemapTable[GetAttribLocationARB_remap_index]) +#define SET_GetAttribLocationARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetAttribLocationARB_remap_index], fn) +#define CALL_DrawBuffersARB(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLenum *)), driDispatchRemapTable[DrawBuffersARB_remap_index], parameters) +#define GET_DrawBuffersARB(disp) GET_by_offset(disp, driDispatchRemapTable[DrawBuffersARB_remap_index]) +#define SET_DrawBuffersARB(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DrawBuffersARB_remap_index], fn) +#define CALL_RenderbufferStorageMultisample(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, GLenum, GLsizei, GLsizei)), driDispatchRemapTable[RenderbufferStorageMultisample_remap_index], parameters) +#define GET_RenderbufferStorageMultisample(disp) GET_by_offset(disp, driDispatchRemapTable[RenderbufferStorageMultisample_remap_index]) +#define SET_RenderbufferStorageMultisample(disp, fn) SET_by_offset(disp, driDispatchRemapTable[RenderbufferStorageMultisample_remap_index], fn) +#define CALL_FlushMappedBufferRange(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLintptr, GLsizeiptr)), driDispatchRemapTable[FlushMappedBufferRange_remap_index], parameters) +#define GET_FlushMappedBufferRange(disp) GET_by_offset(disp, driDispatchRemapTable[FlushMappedBufferRange_remap_index]) +#define SET_FlushMappedBufferRange(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FlushMappedBufferRange_remap_index], fn) +#define CALL_MapBufferRange(disp, parameters) CALL_by_offset(disp, (GLvoid * (GLAPIENTRYP)(GLenum, GLintptr, GLsizeiptr, GLbitfield)), driDispatchRemapTable[MapBufferRange_remap_index], parameters) +#define GET_MapBufferRange(disp) GET_by_offset(disp, driDispatchRemapTable[MapBufferRange_remap_index]) +#define SET_MapBufferRange(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MapBufferRange_remap_index], fn) +#define CALL_BindVertexArray(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[BindVertexArray_remap_index], parameters) +#define GET_BindVertexArray(disp) GET_by_offset(disp, driDispatchRemapTable[BindVertexArray_remap_index]) +#define SET_BindVertexArray(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindVertexArray_remap_index], fn) +#define CALL_GenVertexArrays(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenVertexArrays_remap_index], parameters) +#define GET_GenVertexArrays(disp) GET_by_offset(disp, driDispatchRemapTable[GenVertexArrays_remap_index]) +#define SET_GenVertexArrays(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenVertexArrays_remap_index], fn) +#define CALL_CopyBufferSubData(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLintptr, GLintptr, GLsizeiptr)), driDispatchRemapTable[CopyBufferSubData_remap_index], parameters) +#define GET_CopyBufferSubData(disp) GET_by_offset(disp, driDispatchRemapTable[CopyBufferSubData_remap_index]) +#define SET_CopyBufferSubData(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CopyBufferSubData_remap_index], fn) +#define CALL_ClientWaitSync(disp, parameters) CALL_by_offset(disp, (GLenum (GLAPIENTRYP)(GLsync, GLbitfield, GLuint64)), driDispatchRemapTable[ClientWaitSync_remap_index], parameters) +#define GET_ClientWaitSync(disp) GET_by_offset(disp, driDispatchRemapTable[ClientWaitSync_remap_index]) +#define SET_ClientWaitSync(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ClientWaitSync_remap_index], fn) +#define CALL_DeleteSync(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsync)), driDispatchRemapTable[DeleteSync_remap_index], parameters) +#define GET_DeleteSync(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteSync_remap_index]) +#define SET_DeleteSync(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteSync_remap_index], fn) +#define CALL_FenceSync(disp, parameters) CALL_by_offset(disp, (GLsync (GLAPIENTRYP)(GLenum, GLbitfield)), driDispatchRemapTable[FenceSync_remap_index], parameters) +#define GET_FenceSync(disp) GET_by_offset(disp, driDispatchRemapTable[FenceSync_remap_index]) +#define SET_FenceSync(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FenceSync_remap_index], fn) +#define CALL_GetInteger64v(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint64 *)), driDispatchRemapTable[GetInteger64v_remap_index], parameters) +#define GET_GetInteger64v(disp) GET_by_offset(disp, driDispatchRemapTable[GetInteger64v_remap_index]) +#define SET_GetInteger64v(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetInteger64v_remap_index], fn) +#define CALL_GetSynciv(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsync, GLenum, GLsizei, GLsizei *, GLint *)), driDispatchRemapTable[GetSynciv_remap_index], parameters) +#define GET_GetSynciv(disp) GET_by_offset(disp, driDispatchRemapTable[GetSynciv_remap_index]) +#define SET_GetSynciv(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetSynciv_remap_index], fn) +#define CALL_IsSync(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLsync)), driDispatchRemapTable[IsSync_remap_index], parameters) +#define GET_IsSync(disp) GET_by_offset(disp, driDispatchRemapTable[IsSync_remap_index]) +#define SET_IsSync(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsSync_remap_index], fn) +#define CALL_WaitSync(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsync, GLbitfield, GLuint64)), driDispatchRemapTable[WaitSync_remap_index], parameters) +#define GET_WaitSync(disp) GET_by_offset(disp, driDispatchRemapTable[WaitSync_remap_index]) +#define SET_WaitSync(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WaitSync_remap_index], fn) +#define CALL_DrawElementsBaseVertex(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, GLenum, const GLvoid *, GLint)), driDispatchRemapTable[DrawElementsBaseVertex_remap_index], parameters) +#define GET_DrawElementsBaseVertex(disp) GET_by_offset(disp, driDispatchRemapTable[DrawElementsBaseVertex_remap_index]) +#define SET_DrawElementsBaseVertex(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DrawElementsBaseVertex_remap_index], fn) +#define CALL_DrawRangeElementsBaseVertex(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *, GLint)), driDispatchRemapTable[DrawRangeElementsBaseVertex_remap_index], parameters) +#define GET_DrawRangeElementsBaseVertex(disp) GET_by_offset(disp, driDispatchRemapTable[DrawRangeElementsBaseVertex_remap_index]) +#define SET_DrawRangeElementsBaseVertex(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DrawRangeElementsBaseVertex_remap_index], fn) +#define CALL_MultiDrawElementsBaseVertex(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLsizei *, GLenum, const GLvoid **, GLsizei, const GLint *)), driDispatchRemapTable[MultiDrawElementsBaseVertex_remap_index], parameters) +#define GET_MultiDrawElementsBaseVertex(disp) GET_by_offset(disp, driDispatchRemapTable[MultiDrawElementsBaseVertex_remap_index]) +#define SET_MultiDrawElementsBaseVertex(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultiDrawElementsBaseVertex_remap_index], fn) +#define CALL_PolygonOffsetEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat)), driDispatchRemapTable[PolygonOffsetEXT_remap_index], parameters) +#define GET_PolygonOffsetEXT(disp) GET_by_offset(disp, driDispatchRemapTable[PolygonOffsetEXT_remap_index]) +#define SET_PolygonOffsetEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PolygonOffsetEXT_remap_index], fn) +#define CALL_GetPixelTexGenParameterfvSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat *)), driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index], parameters) +#define GET_GetPixelTexGenParameterfvSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index]) +#define SET_GetPixelTexGenParameterfvSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetPixelTexGenParameterfvSGIS_remap_index], fn) +#define CALL_GetPixelTexGenParameterivSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint *)), driDispatchRemapTable[GetPixelTexGenParameterivSGIS_remap_index], parameters) +#define GET_GetPixelTexGenParameterivSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[GetPixelTexGenParameterivSGIS_remap_index]) +#define SET_GetPixelTexGenParameterivSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetPixelTexGenParameterivSGIS_remap_index], fn) +#define CALL_PixelTexGenParameterfSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat)), driDispatchRemapTable[PixelTexGenParameterfSGIS_remap_index], parameters) +#define GET_PixelTexGenParameterfSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterfSGIS_remap_index]) +#define SET_PixelTexGenParameterfSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterfSGIS_remap_index], fn) +#define CALL_PixelTexGenParameterfvSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLfloat *)), driDispatchRemapTable[PixelTexGenParameterfvSGIS_remap_index], parameters) +#define GET_PixelTexGenParameterfvSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterfvSGIS_remap_index]) +#define SET_PixelTexGenParameterfvSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterfvSGIS_remap_index], fn) +#define CALL_PixelTexGenParameteriSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint)), driDispatchRemapTable[PixelTexGenParameteriSGIS_remap_index], parameters) +#define GET_PixelTexGenParameteriSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameteriSGIS_remap_index]) +#define SET_PixelTexGenParameteriSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameteriSGIS_remap_index], fn) +#define CALL_PixelTexGenParameterivSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLint *)), driDispatchRemapTable[PixelTexGenParameterivSGIS_remap_index], parameters) +#define GET_PixelTexGenParameterivSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterivSGIS_remap_index]) +#define SET_PixelTexGenParameterivSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenParameterivSGIS_remap_index], fn) +#define CALL_SampleMaskSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLclampf, GLboolean)), driDispatchRemapTable[SampleMaskSGIS_remap_index], parameters) +#define GET_SampleMaskSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[SampleMaskSGIS_remap_index]) +#define SET_SampleMaskSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SampleMaskSGIS_remap_index], fn) +#define CALL_SamplePatternSGIS(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[SamplePatternSGIS_remap_index], parameters) +#define GET_SamplePatternSGIS(disp) GET_by_offset(disp, driDispatchRemapTable[SamplePatternSGIS_remap_index]) +#define SET_SamplePatternSGIS(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SamplePatternSGIS_remap_index], fn) +#define CALL_ColorPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLenum, GLsizei, GLsizei, const GLvoid *)), driDispatchRemapTable[ColorPointerEXT_remap_index], parameters) +#define GET_ColorPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[ColorPointerEXT_remap_index]) +#define SET_ColorPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ColorPointerEXT_remap_index], fn) +#define CALL_EdgeFlagPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLsizei, const GLboolean *)), driDispatchRemapTable[EdgeFlagPointerEXT_remap_index], parameters) +#define GET_EdgeFlagPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[EdgeFlagPointerEXT_remap_index]) +#define SET_EdgeFlagPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[EdgeFlagPointerEXT_remap_index], fn) +#define CALL_IndexPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, GLsizei, const GLvoid *)), driDispatchRemapTable[IndexPointerEXT_remap_index], parameters) +#define GET_IndexPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[IndexPointerEXT_remap_index]) +#define SET_IndexPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IndexPointerEXT_remap_index], fn) +#define CALL_NormalPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, GLsizei, const GLvoid *)), driDispatchRemapTable[NormalPointerEXT_remap_index], parameters) +#define GET_NormalPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[NormalPointerEXT_remap_index]) +#define SET_NormalPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[NormalPointerEXT_remap_index], fn) +#define CALL_TexCoordPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLenum, GLsizei, GLsizei, const GLvoid *)), driDispatchRemapTable[TexCoordPointerEXT_remap_index], parameters) +#define GET_TexCoordPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[TexCoordPointerEXT_remap_index]) +#define SET_TexCoordPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TexCoordPointerEXT_remap_index], fn) +#define CALL_VertexPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLenum, GLsizei, GLsizei, const GLvoid *)), driDispatchRemapTable[VertexPointerEXT_remap_index], parameters) +#define GET_VertexPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[VertexPointerEXT_remap_index]) +#define SET_VertexPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexPointerEXT_remap_index], fn) +#define CALL_PointParameterfEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat)), driDispatchRemapTable[PointParameterfEXT_remap_index], parameters) +#define GET_PointParameterfEXT(disp) GET_by_offset(disp, driDispatchRemapTable[PointParameterfEXT_remap_index]) +#define SET_PointParameterfEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PointParameterfEXT_remap_index], fn) +#define CALL_PointParameterfvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLfloat *)), driDispatchRemapTable[PointParameterfvEXT_remap_index], parameters) +#define GET_PointParameterfvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[PointParameterfvEXT_remap_index]) +#define SET_PointParameterfvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PointParameterfvEXT_remap_index], fn) +#define CALL_LockArraysEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLsizei)), driDispatchRemapTable[LockArraysEXT_remap_index], parameters) +#define GET_LockArraysEXT(disp) GET_by_offset(disp, driDispatchRemapTable[LockArraysEXT_remap_index]) +#define SET_LockArraysEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LockArraysEXT_remap_index], fn) +#define CALL_UnlockArraysEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[UnlockArraysEXT_remap_index], parameters) +#define GET_UnlockArraysEXT(disp) GET_by_offset(disp, driDispatchRemapTable[UnlockArraysEXT_remap_index]) +#define SET_UnlockArraysEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[UnlockArraysEXT_remap_index], fn) +#define CALL_CullParameterdvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLdouble *)), driDispatchRemapTable[CullParameterdvEXT_remap_index], parameters) +#define GET_CullParameterdvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[CullParameterdvEXT_remap_index]) +#define SET_CullParameterdvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CullParameterdvEXT_remap_index], fn) +#define CALL_CullParameterfvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat *)), driDispatchRemapTable[CullParameterfvEXT_remap_index], parameters) +#define GET_CullParameterfvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[CullParameterfvEXT_remap_index]) +#define SET_CullParameterfvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CullParameterfvEXT_remap_index], fn) +#define CALL_SecondaryColor3bEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLbyte, GLbyte, GLbyte)), driDispatchRemapTable[SecondaryColor3bEXT_remap_index], parameters) +#define GET_SecondaryColor3bEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3bEXT_remap_index]) +#define SET_SecondaryColor3bEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3bEXT_remap_index], fn) +#define CALL_SecondaryColor3bvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLbyte *)), driDispatchRemapTable[SecondaryColor3bvEXT_remap_index], parameters) +#define GET_SecondaryColor3bvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3bvEXT_remap_index]) +#define SET_SecondaryColor3bvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3bvEXT_remap_index], fn) +#define CALL_SecondaryColor3dEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[SecondaryColor3dEXT_remap_index], parameters) +#define GET_SecondaryColor3dEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3dEXT_remap_index]) +#define SET_SecondaryColor3dEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3dEXT_remap_index], fn) +#define CALL_SecondaryColor3dvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[SecondaryColor3dvEXT_remap_index], parameters) +#define GET_SecondaryColor3dvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3dvEXT_remap_index]) +#define SET_SecondaryColor3dvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3dvEXT_remap_index], fn) +#define CALL_SecondaryColor3fEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[SecondaryColor3fEXT_remap_index], parameters) +#define GET_SecondaryColor3fEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3fEXT_remap_index]) +#define SET_SecondaryColor3fEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3fEXT_remap_index], fn) +#define CALL_SecondaryColor3fvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[SecondaryColor3fvEXT_remap_index], parameters) +#define GET_SecondaryColor3fvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3fvEXT_remap_index]) +#define SET_SecondaryColor3fvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3fvEXT_remap_index], fn) +#define CALL_SecondaryColor3iEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint)), driDispatchRemapTable[SecondaryColor3iEXT_remap_index], parameters) +#define GET_SecondaryColor3iEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3iEXT_remap_index]) +#define SET_SecondaryColor3iEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3iEXT_remap_index], fn) +#define CALL_SecondaryColor3ivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLint *)), driDispatchRemapTable[SecondaryColor3ivEXT_remap_index], parameters) +#define GET_SecondaryColor3ivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ivEXT_remap_index]) +#define SET_SecondaryColor3ivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ivEXT_remap_index], fn) +#define CALL_SecondaryColor3sEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLshort, GLshort, GLshort)), driDispatchRemapTable[SecondaryColor3sEXT_remap_index], parameters) +#define GET_SecondaryColor3sEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3sEXT_remap_index]) +#define SET_SecondaryColor3sEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3sEXT_remap_index], fn) +#define CALL_SecondaryColor3svEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLshort *)), driDispatchRemapTable[SecondaryColor3svEXT_remap_index], parameters) +#define GET_SecondaryColor3svEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3svEXT_remap_index]) +#define SET_SecondaryColor3svEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3svEXT_remap_index], fn) +#define CALL_SecondaryColor3ubEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLubyte, GLubyte, GLubyte)), driDispatchRemapTable[SecondaryColor3ubEXT_remap_index], parameters) +#define GET_SecondaryColor3ubEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ubEXT_remap_index]) +#define SET_SecondaryColor3ubEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ubEXT_remap_index], fn) +#define CALL_SecondaryColor3ubvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLubyte *)), driDispatchRemapTable[SecondaryColor3ubvEXT_remap_index], parameters) +#define GET_SecondaryColor3ubvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ubvEXT_remap_index]) +#define SET_SecondaryColor3ubvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3ubvEXT_remap_index], fn) +#define CALL_SecondaryColor3uiEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint, GLuint)), driDispatchRemapTable[SecondaryColor3uiEXT_remap_index], parameters) +#define GET_SecondaryColor3uiEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3uiEXT_remap_index]) +#define SET_SecondaryColor3uiEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3uiEXT_remap_index], fn) +#define CALL_SecondaryColor3uivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLuint *)), driDispatchRemapTable[SecondaryColor3uivEXT_remap_index], parameters) +#define GET_SecondaryColor3uivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3uivEXT_remap_index]) +#define SET_SecondaryColor3uivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3uivEXT_remap_index], fn) +#define CALL_SecondaryColor3usEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLushort, GLushort, GLushort)), driDispatchRemapTable[SecondaryColor3usEXT_remap_index], parameters) +#define GET_SecondaryColor3usEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3usEXT_remap_index]) +#define SET_SecondaryColor3usEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3usEXT_remap_index], fn) +#define CALL_SecondaryColor3usvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLushort *)), driDispatchRemapTable[SecondaryColor3usvEXT_remap_index], parameters) +#define GET_SecondaryColor3usvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColor3usvEXT_remap_index]) +#define SET_SecondaryColor3usvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColor3usvEXT_remap_index], fn) +#define CALL_SecondaryColorPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[SecondaryColorPointerEXT_remap_index], parameters) +#define GET_SecondaryColorPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[SecondaryColorPointerEXT_remap_index]) +#define SET_SecondaryColorPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SecondaryColorPointerEXT_remap_index], fn) +#define CALL_MultiDrawArraysEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint *, GLsizei *, GLsizei)), driDispatchRemapTable[MultiDrawArraysEXT_remap_index], parameters) +#define GET_MultiDrawArraysEXT(disp) GET_by_offset(disp, driDispatchRemapTable[MultiDrawArraysEXT_remap_index]) +#define SET_MultiDrawArraysEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultiDrawArraysEXT_remap_index], fn) +#define CALL_MultiDrawElementsEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLsizei *, GLenum, const GLvoid **, GLsizei)), driDispatchRemapTable[MultiDrawElementsEXT_remap_index], parameters) +#define GET_MultiDrawElementsEXT(disp) GET_by_offset(disp, driDispatchRemapTable[MultiDrawElementsEXT_remap_index]) +#define SET_MultiDrawElementsEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultiDrawElementsEXT_remap_index], fn) +#define CALL_FogCoordPointerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[FogCoordPointerEXT_remap_index], parameters) +#define GET_FogCoordPointerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FogCoordPointerEXT_remap_index]) +#define SET_FogCoordPointerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FogCoordPointerEXT_remap_index], fn) +#define CALL_FogCoorddEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLdouble)), driDispatchRemapTable[FogCoorddEXT_remap_index], parameters) +#define GET_FogCoorddEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FogCoorddEXT_remap_index]) +#define SET_FogCoorddEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FogCoorddEXT_remap_index], fn) +#define CALL_FogCoorddvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[FogCoorddvEXT_remap_index], parameters) +#define GET_FogCoorddvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FogCoorddvEXT_remap_index]) +#define SET_FogCoorddvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FogCoorddvEXT_remap_index], fn) +#define CALL_FogCoordfEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat)), driDispatchRemapTable[FogCoordfEXT_remap_index], parameters) +#define GET_FogCoordfEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FogCoordfEXT_remap_index]) +#define SET_FogCoordfEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FogCoordfEXT_remap_index], fn) +#define CALL_FogCoordfvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[FogCoordfvEXT_remap_index], parameters) +#define GET_FogCoordfvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FogCoordfvEXT_remap_index]) +#define SET_FogCoordfvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FogCoordfvEXT_remap_index], fn) +#define CALL_PixelTexGenSGIX(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[PixelTexGenSGIX_remap_index], parameters) +#define GET_PixelTexGenSGIX(disp) GET_by_offset(disp, driDispatchRemapTable[PixelTexGenSGIX_remap_index]) +#define SET_PixelTexGenSGIX(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PixelTexGenSGIX_remap_index], fn) +#define CALL_BlendFuncSeparateEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum)), driDispatchRemapTable[BlendFuncSeparateEXT_remap_index], parameters) +#define GET_BlendFuncSeparateEXT(disp) GET_by_offset(disp, driDispatchRemapTable[BlendFuncSeparateEXT_remap_index]) +#define SET_BlendFuncSeparateEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BlendFuncSeparateEXT_remap_index], fn) +#define CALL_FlushVertexArrayRangeNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[FlushVertexArrayRangeNV_remap_index], parameters) +#define GET_FlushVertexArrayRangeNV(disp) GET_by_offset(disp, driDispatchRemapTable[FlushVertexArrayRangeNV_remap_index]) +#define SET_FlushVertexArrayRangeNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FlushVertexArrayRangeNV_remap_index], fn) +#define CALL_VertexArrayRangeNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLvoid *)), driDispatchRemapTable[VertexArrayRangeNV_remap_index], parameters) +#define GET_VertexArrayRangeNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexArrayRangeNV_remap_index]) +#define SET_VertexArrayRangeNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexArrayRangeNV_remap_index], fn) +#define CALL_CombinerInputNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum, GLenum, GLenum)), driDispatchRemapTable[CombinerInputNV_remap_index], parameters) +#define GET_CombinerInputNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerInputNV_remap_index]) +#define SET_CombinerInputNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerInputNV_remap_index], fn) +#define CALL_CombinerOutputNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean)), driDispatchRemapTable[CombinerOutputNV_remap_index], parameters) +#define GET_CombinerOutputNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerOutputNV_remap_index]) +#define SET_CombinerOutputNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerOutputNV_remap_index], fn) +#define CALL_CombinerParameterfNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat)), driDispatchRemapTable[CombinerParameterfNV_remap_index], parameters) +#define GET_CombinerParameterfNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerParameterfNV_remap_index]) +#define SET_CombinerParameterfNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerParameterfNV_remap_index], fn) +#define CALL_CombinerParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLfloat *)), driDispatchRemapTable[CombinerParameterfvNV_remap_index], parameters) +#define GET_CombinerParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerParameterfvNV_remap_index]) +#define SET_CombinerParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerParameterfvNV_remap_index], fn) +#define CALL_CombinerParameteriNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint)), driDispatchRemapTable[CombinerParameteriNV_remap_index], parameters) +#define GET_CombinerParameteriNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerParameteriNV_remap_index]) +#define SET_CombinerParameteriNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerParameteriNV_remap_index], fn) +#define CALL_CombinerParameterivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLint *)), driDispatchRemapTable[CombinerParameterivNV_remap_index], parameters) +#define GET_CombinerParameterivNV(disp) GET_by_offset(disp, driDispatchRemapTable[CombinerParameterivNV_remap_index]) +#define SET_CombinerParameterivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CombinerParameterivNV_remap_index], fn) +#define CALL_FinalCombinerInputNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum)), driDispatchRemapTable[FinalCombinerInputNV_remap_index], parameters) +#define GET_FinalCombinerInputNV(disp) GET_by_offset(disp, driDispatchRemapTable[FinalCombinerInputNV_remap_index]) +#define SET_FinalCombinerInputNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FinalCombinerInputNV_remap_index], fn) +#define CALL_GetCombinerInputParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetCombinerInputParameterfvNV_remap_index], parameters) +#define GET_GetCombinerInputParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetCombinerInputParameterfvNV_remap_index]) +#define SET_GetCombinerInputParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetCombinerInputParameterfvNV_remap_index], fn) +#define CALL_GetCombinerInputParameterivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLenum, GLint *)), driDispatchRemapTable[GetCombinerInputParameterivNV_remap_index], parameters) +#define GET_GetCombinerInputParameterivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetCombinerInputParameterivNV_remap_index]) +#define SET_GetCombinerInputParameterivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetCombinerInputParameterivNV_remap_index], fn) +#define CALL_GetCombinerOutputParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetCombinerOutputParameterfvNV_remap_index], parameters) +#define GET_GetCombinerOutputParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetCombinerOutputParameterfvNV_remap_index]) +#define SET_GetCombinerOutputParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetCombinerOutputParameterfvNV_remap_index], fn) +#define CALL_GetCombinerOutputParameterivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLint *)), driDispatchRemapTable[GetCombinerOutputParameterivNV_remap_index], parameters) +#define GET_GetCombinerOutputParameterivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetCombinerOutputParameterivNV_remap_index]) +#define SET_GetCombinerOutputParameterivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetCombinerOutputParameterivNV_remap_index], fn) +#define CALL_GetFinalCombinerInputParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLfloat *)), driDispatchRemapTable[GetFinalCombinerInputParameterfvNV_remap_index], parameters) +#define GET_GetFinalCombinerInputParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetFinalCombinerInputParameterfvNV_remap_index]) +#define SET_GetFinalCombinerInputParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetFinalCombinerInputParameterfvNV_remap_index], fn) +#define CALL_GetFinalCombinerInputParameterivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetFinalCombinerInputParameterivNV_remap_index], parameters) +#define GET_GetFinalCombinerInputParameterivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetFinalCombinerInputParameterivNV_remap_index]) +#define SET_GetFinalCombinerInputParameterivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetFinalCombinerInputParameterivNV_remap_index], fn) +#define CALL_ResizeBuffersMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[ResizeBuffersMESA_remap_index], parameters) +#define GET_ResizeBuffersMESA(disp) GET_by_offset(disp, driDispatchRemapTable[ResizeBuffersMESA_remap_index]) +#define SET_ResizeBuffersMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ResizeBuffersMESA_remap_index], fn) +#define CALL_WindowPos2dMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLdouble, GLdouble)), driDispatchRemapTable[WindowPos2dMESA_remap_index], parameters) +#define GET_WindowPos2dMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2dMESA_remap_index]) +#define SET_WindowPos2dMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2dMESA_remap_index], fn) +#define CALL_WindowPos2dvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[WindowPos2dvMESA_remap_index], parameters) +#define GET_WindowPos2dvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2dvMESA_remap_index]) +#define SET_WindowPos2dvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2dvMESA_remap_index], fn) +#define CALL_WindowPos2fMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat)), driDispatchRemapTable[WindowPos2fMESA_remap_index], parameters) +#define GET_WindowPos2fMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2fMESA_remap_index]) +#define SET_WindowPos2fMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2fMESA_remap_index], fn) +#define CALL_WindowPos2fvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[WindowPos2fvMESA_remap_index], parameters) +#define GET_WindowPos2fvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2fvMESA_remap_index]) +#define SET_WindowPos2fvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2fvMESA_remap_index], fn) +#define CALL_WindowPos2iMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint)), driDispatchRemapTable[WindowPos2iMESA_remap_index], parameters) +#define GET_WindowPos2iMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2iMESA_remap_index]) +#define SET_WindowPos2iMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2iMESA_remap_index], fn) +#define CALL_WindowPos2ivMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLint *)), driDispatchRemapTable[WindowPos2ivMESA_remap_index], parameters) +#define GET_WindowPos2ivMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2ivMESA_remap_index]) +#define SET_WindowPos2ivMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2ivMESA_remap_index], fn) +#define CALL_WindowPos2sMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLshort, GLshort)), driDispatchRemapTable[WindowPos2sMESA_remap_index], parameters) +#define GET_WindowPos2sMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2sMESA_remap_index]) +#define SET_WindowPos2sMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2sMESA_remap_index], fn) +#define CALL_WindowPos2svMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLshort *)), driDispatchRemapTable[WindowPos2svMESA_remap_index], parameters) +#define GET_WindowPos2svMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos2svMESA_remap_index]) +#define SET_WindowPos2svMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos2svMESA_remap_index], fn) +#define CALL_WindowPos3dMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[WindowPos3dMESA_remap_index], parameters) +#define GET_WindowPos3dMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3dMESA_remap_index]) +#define SET_WindowPos3dMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3dMESA_remap_index], fn) +#define CALL_WindowPos3dvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[WindowPos3dvMESA_remap_index], parameters) +#define GET_WindowPos3dvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3dvMESA_remap_index]) +#define SET_WindowPos3dvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3dvMESA_remap_index], fn) +#define CALL_WindowPos3fMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[WindowPos3fMESA_remap_index], parameters) +#define GET_WindowPos3fMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3fMESA_remap_index]) +#define SET_WindowPos3fMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3fMESA_remap_index], fn) +#define CALL_WindowPos3fvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[WindowPos3fvMESA_remap_index], parameters) +#define GET_WindowPos3fvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3fvMESA_remap_index]) +#define SET_WindowPos3fvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3fvMESA_remap_index], fn) +#define CALL_WindowPos3iMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint)), driDispatchRemapTable[WindowPos3iMESA_remap_index], parameters) +#define GET_WindowPos3iMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3iMESA_remap_index]) +#define SET_WindowPos3iMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3iMESA_remap_index], fn) +#define CALL_WindowPos3ivMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLint *)), driDispatchRemapTable[WindowPos3ivMESA_remap_index], parameters) +#define GET_WindowPos3ivMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3ivMESA_remap_index]) +#define SET_WindowPos3ivMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3ivMESA_remap_index], fn) +#define CALL_WindowPos3sMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLshort, GLshort, GLshort)), driDispatchRemapTable[WindowPos3sMESA_remap_index], parameters) +#define GET_WindowPos3sMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3sMESA_remap_index]) +#define SET_WindowPos3sMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3sMESA_remap_index], fn) +#define CALL_WindowPos3svMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLshort *)), driDispatchRemapTable[WindowPos3svMESA_remap_index], parameters) +#define GET_WindowPos3svMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos3svMESA_remap_index]) +#define SET_WindowPos3svMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos3svMESA_remap_index], fn) +#define CALL_WindowPos4dMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[WindowPos4dMESA_remap_index], parameters) +#define GET_WindowPos4dMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4dMESA_remap_index]) +#define SET_WindowPos4dMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4dMESA_remap_index], fn) +#define CALL_WindowPos4dvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLdouble *)), driDispatchRemapTable[WindowPos4dvMESA_remap_index], parameters) +#define GET_WindowPos4dvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4dvMESA_remap_index]) +#define SET_WindowPos4dvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4dvMESA_remap_index], fn) +#define CALL_WindowPos4fMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[WindowPos4fMESA_remap_index], parameters) +#define GET_WindowPos4fMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4fMESA_remap_index]) +#define SET_WindowPos4fMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4fMESA_remap_index], fn) +#define CALL_WindowPos4fvMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLfloat *)), driDispatchRemapTable[WindowPos4fvMESA_remap_index], parameters) +#define GET_WindowPos4fvMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4fvMESA_remap_index]) +#define SET_WindowPos4fvMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4fvMESA_remap_index], fn) +#define CALL_WindowPos4iMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint, GLint)), driDispatchRemapTable[WindowPos4iMESA_remap_index], parameters) +#define GET_WindowPos4iMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4iMESA_remap_index]) +#define SET_WindowPos4iMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4iMESA_remap_index], fn) +#define CALL_WindowPos4ivMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLint *)), driDispatchRemapTable[WindowPos4ivMESA_remap_index], parameters) +#define GET_WindowPos4ivMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4ivMESA_remap_index]) +#define SET_WindowPos4ivMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4ivMESA_remap_index], fn) +#define CALL_WindowPos4sMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLshort, GLshort, GLshort, GLshort)), driDispatchRemapTable[WindowPos4sMESA_remap_index], parameters) +#define GET_WindowPos4sMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4sMESA_remap_index]) +#define SET_WindowPos4sMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4sMESA_remap_index], fn) +#define CALL_WindowPos4svMESA(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLshort *)), driDispatchRemapTable[WindowPos4svMESA_remap_index], parameters) +#define GET_WindowPos4svMESA(disp) GET_by_offset(disp, driDispatchRemapTable[WindowPos4svMESA_remap_index]) +#define SET_WindowPos4svMESA(disp, fn) SET_by_offset(disp, driDispatchRemapTable[WindowPos4svMESA_remap_index], fn) +#define CALL_MultiModeDrawArraysIBM(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint)), driDispatchRemapTable[MultiModeDrawArraysIBM_remap_index], parameters) +#define GET_MultiModeDrawArraysIBM(disp) GET_by_offset(disp, driDispatchRemapTable[MultiModeDrawArraysIBM_remap_index]) +#define SET_MultiModeDrawArraysIBM(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultiModeDrawArraysIBM_remap_index], fn) +#define CALL_MultiModeDrawElementsIBM(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(const GLenum *, const GLsizei *, GLenum, const GLvoid * const *, GLsizei, GLint)), driDispatchRemapTable[MultiModeDrawElementsIBM_remap_index], parameters) +#define GET_MultiModeDrawElementsIBM(disp) GET_by_offset(disp, driDispatchRemapTable[MultiModeDrawElementsIBM_remap_index]) +#define SET_MultiModeDrawElementsIBM(disp, fn) SET_by_offset(disp, driDispatchRemapTable[MultiModeDrawElementsIBM_remap_index], fn) +#define CALL_DeleteFencesNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteFencesNV_remap_index], parameters) +#define GET_DeleteFencesNV(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteFencesNV_remap_index]) +#define SET_DeleteFencesNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteFencesNV_remap_index], fn) +#define CALL_FinishFenceNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[FinishFenceNV_remap_index], parameters) +#define GET_FinishFenceNV(disp) GET_by_offset(disp, driDispatchRemapTable[FinishFenceNV_remap_index]) +#define SET_FinishFenceNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FinishFenceNV_remap_index], fn) +#define CALL_GenFencesNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenFencesNV_remap_index], parameters) +#define GET_GenFencesNV(disp) GET_by_offset(disp, driDispatchRemapTable[GenFencesNV_remap_index]) +#define SET_GenFencesNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenFencesNV_remap_index], fn) +#define CALL_GetFenceivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetFenceivNV_remap_index], parameters) +#define GET_GetFenceivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetFenceivNV_remap_index]) +#define SET_GetFenceivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetFenceivNV_remap_index], fn) +#define CALL_IsFenceNV(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsFenceNV_remap_index], parameters) +#define GET_IsFenceNV(disp) GET_by_offset(disp, driDispatchRemapTable[IsFenceNV_remap_index]) +#define SET_IsFenceNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsFenceNV_remap_index], fn) +#define CALL_SetFenceNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum)), driDispatchRemapTable[SetFenceNV_remap_index], parameters) +#define GET_SetFenceNV(disp) GET_by_offset(disp, driDispatchRemapTable[SetFenceNV_remap_index]) +#define SET_SetFenceNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SetFenceNV_remap_index], fn) +#define CALL_TestFenceNV(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[TestFenceNV_remap_index], parameters) +#define GET_TestFenceNV(disp) GET_by_offset(disp, driDispatchRemapTable[TestFenceNV_remap_index]) +#define SET_TestFenceNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TestFenceNV_remap_index], fn) +#define CALL_AreProgramsResidentNV(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLsizei, const GLuint *, GLboolean *)), driDispatchRemapTable[AreProgramsResidentNV_remap_index], parameters) +#define GET_AreProgramsResidentNV(disp) GET_by_offset(disp, driDispatchRemapTable[AreProgramsResidentNV_remap_index]) +#define SET_AreProgramsResidentNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AreProgramsResidentNV_remap_index], fn) +#define CALL_BindProgramNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[BindProgramNV_remap_index], parameters) +#define GET_BindProgramNV(disp) GET_by_offset(disp, driDispatchRemapTable[BindProgramNV_remap_index]) +#define SET_BindProgramNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindProgramNV_remap_index], fn) +#define CALL_DeleteProgramsNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteProgramsNV_remap_index], parameters) +#define GET_DeleteProgramsNV(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteProgramsNV_remap_index]) +#define SET_DeleteProgramsNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteProgramsNV_remap_index], fn) +#define CALL_ExecuteProgramNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, const GLfloat *)), driDispatchRemapTable[ExecuteProgramNV_remap_index], parameters) +#define GET_ExecuteProgramNV(disp) GET_by_offset(disp, driDispatchRemapTable[ExecuteProgramNV_remap_index]) +#define SET_ExecuteProgramNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ExecuteProgramNV_remap_index], fn) +#define CALL_GenProgramsNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenProgramsNV_remap_index], parameters) +#define GET_GenProgramsNV(disp) GET_by_offset(disp, driDispatchRemapTable[GenProgramsNV_remap_index]) +#define SET_GenProgramsNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenProgramsNV_remap_index], fn) +#define CALL_GetProgramParameterdvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLenum, GLdouble *)), driDispatchRemapTable[GetProgramParameterdvNV_remap_index], parameters) +#define GET_GetProgramParameterdvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramParameterdvNV_remap_index]) +#define SET_GetProgramParameterdvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramParameterdvNV_remap_index], fn) +#define CALL_GetProgramParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLenum, GLfloat *)), driDispatchRemapTable[GetProgramParameterfvNV_remap_index], parameters) +#define GET_GetProgramParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramParameterfvNV_remap_index]) +#define SET_GetProgramParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramParameterfvNV_remap_index], fn) +#define CALL_GetProgramStringNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLubyte *)), driDispatchRemapTable[GetProgramStringNV_remap_index], parameters) +#define GET_GetProgramStringNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramStringNV_remap_index]) +#define SET_GetProgramStringNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramStringNV_remap_index], fn) +#define CALL_GetProgramivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetProgramivNV_remap_index], parameters) +#define GET_GetProgramivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramivNV_remap_index]) +#define SET_GetProgramivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramivNV_remap_index], fn) +#define CALL_GetTrackMatrixivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLenum, GLint *)), driDispatchRemapTable[GetTrackMatrixivNV_remap_index], parameters) +#define GET_GetTrackMatrixivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetTrackMatrixivNV_remap_index]) +#define SET_GetTrackMatrixivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetTrackMatrixivNV_remap_index], fn) +#define CALL_GetVertexAttribPointervNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLvoid **)), driDispatchRemapTable[GetVertexAttribPointervNV_remap_index], parameters) +#define GET_GetVertexAttribPointervNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribPointervNV_remap_index]) +#define SET_GetVertexAttribPointervNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribPointervNV_remap_index], fn) +#define CALL_GetVertexAttribdvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLdouble *)), driDispatchRemapTable[GetVertexAttribdvNV_remap_index], parameters) +#define GET_GetVertexAttribdvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribdvNV_remap_index]) +#define SET_GetVertexAttribdvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribdvNV_remap_index], fn) +#define CALL_GetVertexAttribfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLfloat *)), driDispatchRemapTable[GetVertexAttribfvNV_remap_index], parameters) +#define GET_GetVertexAttribfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribfvNV_remap_index]) +#define SET_GetVertexAttribfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribfvNV_remap_index], fn) +#define CALL_GetVertexAttribivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint *)), driDispatchRemapTable[GetVertexAttribivNV_remap_index], parameters) +#define GET_GetVertexAttribivNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetVertexAttribivNV_remap_index]) +#define SET_GetVertexAttribivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetVertexAttribivNV_remap_index], fn) +#define CALL_IsProgramNV(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsProgramNV_remap_index], parameters) +#define GET_IsProgramNV(disp) GET_by_offset(disp, driDispatchRemapTable[IsProgramNV_remap_index]) +#define SET_IsProgramNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsProgramNV_remap_index], fn) +#define CALL_LoadProgramNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLsizei, const GLubyte *)), driDispatchRemapTable[LoadProgramNV_remap_index], parameters) +#define GET_LoadProgramNV(disp) GET_by_offset(disp, driDispatchRemapTable[LoadProgramNV_remap_index]) +#define SET_LoadProgramNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[LoadProgramNV_remap_index], fn) +#define CALL_ProgramParameters4dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, const GLdouble *)), driDispatchRemapTable[ProgramParameters4dvNV_remap_index], parameters) +#define GET_ProgramParameters4dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramParameters4dvNV_remap_index]) +#define SET_ProgramParameters4dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramParameters4dvNV_remap_index], fn) +#define CALL_ProgramParameters4fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, const GLfloat *)), driDispatchRemapTable[ProgramParameters4fvNV_remap_index], parameters) +#define GET_ProgramParameters4fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramParameters4fvNV_remap_index]) +#define SET_ProgramParameters4fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramParameters4fvNV_remap_index], fn) +#define CALL_RequestResidentProgramsNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[RequestResidentProgramsNV_remap_index], parameters) +#define GET_RequestResidentProgramsNV(disp) GET_by_offset(disp, driDispatchRemapTable[RequestResidentProgramsNV_remap_index]) +#define SET_RequestResidentProgramsNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[RequestResidentProgramsNV_remap_index], fn) +#define CALL_TrackMatrixNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLenum, GLenum)), driDispatchRemapTable[TrackMatrixNV_remap_index], parameters) +#define GET_TrackMatrixNV(disp) GET_by_offset(disp, driDispatchRemapTable[TrackMatrixNV_remap_index]) +#define SET_TrackMatrixNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TrackMatrixNV_remap_index], fn) +#define CALL_VertexAttrib1dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble)), driDispatchRemapTable[VertexAttrib1dNV_remap_index], parameters) +#define GET_VertexAttrib1dNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dNV_remap_index]) +#define SET_VertexAttrib1dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dNV_remap_index], fn) +#define CALL_VertexAttrib1dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib1dvNV_remap_index], parameters) +#define GET_VertexAttrib1dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dvNV_remap_index]) +#define SET_VertexAttrib1dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1dvNV_remap_index], fn) +#define CALL_VertexAttrib1fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat)), driDispatchRemapTable[VertexAttrib1fNV_remap_index], parameters) +#define GET_VertexAttrib1fNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fNV_remap_index]) +#define SET_VertexAttrib1fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fNV_remap_index], fn) +#define CALL_VertexAttrib1fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib1fvNV_remap_index], parameters) +#define GET_VertexAttrib1fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fvNV_remap_index]) +#define SET_VertexAttrib1fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1fvNV_remap_index], fn) +#define CALL_VertexAttrib1sNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort)), driDispatchRemapTable[VertexAttrib1sNV_remap_index], parameters) +#define GET_VertexAttrib1sNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1sNV_remap_index]) +#define SET_VertexAttrib1sNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1sNV_remap_index], fn) +#define CALL_VertexAttrib1svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib1svNV_remap_index], parameters) +#define GET_VertexAttrib1svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib1svNV_remap_index]) +#define SET_VertexAttrib1svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib1svNV_remap_index], fn) +#define CALL_VertexAttrib2dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib2dNV_remap_index], parameters) +#define GET_VertexAttrib2dNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dNV_remap_index]) +#define SET_VertexAttrib2dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dNV_remap_index], fn) +#define CALL_VertexAttrib2dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib2dvNV_remap_index], parameters) +#define GET_VertexAttrib2dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dvNV_remap_index]) +#define SET_VertexAttrib2dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2dvNV_remap_index], fn) +#define CALL_VertexAttrib2fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib2fNV_remap_index], parameters) +#define GET_VertexAttrib2fNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fNV_remap_index]) +#define SET_VertexAttrib2fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fNV_remap_index], fn) +#define CALL_VertexAttrib2fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib2fvNV_remap_index], parameters) +#define GET_VertexAttrib2fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fvNV_remap_index]) +#define SET_VertexAttrib2fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2fvNV_remap_index], fn) +#define CALL_VertexAttrib2sNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib2sNV_remap_index], parameters) +#define GET_VertexAttrib2sNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2sNV_remap_index]) +#define SET_VertexAttrib2sNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2sNV_remap_index], fn) +#define CALL_VertexAttrib2svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib2svNV_remap_index], parameters) +#define GET_VertexAttrib2svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib2svNV_remap_index]) +#define SET_VertexAttrib2svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib2svNV_remap_index], fn) +#define CALL_VertexAttrib3dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib3dNV_remap_index], parameters) +#define GET_VertexAttrib3dNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dNV_remap_index]) +#define SET_VertexAttrib3dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dNV_remap_index], fn) +#define CALL_VertexAttrib3dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib3dvNV_remap_index], parameters) +#define GET_VertexAttrib3dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dvNV_remap_index]) +#define SET_VertexAttrib3dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3dvNV_remap_index], fn) +#define CALL_VertexAttrib3fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib3fNV_remap_index], parameters) +#define GET_VertexAttrib3fNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fNV_remap_index]) +#define SET_VertexAttrib3fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fNV_remap_index], fn) +#define CALL_VertexAttrib3fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib3fvNV_remap_index], parameters) +#define GET_VertexAttrib3fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fvNV_remap_index]) +#define SET_VertexAttrib3fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3fvNV_remap_index], fn) +#define CALL_VertexAttrib3sNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib3sNV_remap_index], parameters) +#define GET_VertexAttrib3sNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3sNV_remap_index]) +#define SET_VertexAttrib3sNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3sNV_remap_index], fn) +#define CALL_VertexAttrib3svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib3svNV_remap_index], parameters) +#define GET_VertexAttrib3svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib3svNV_remap_index]) +#define SET_VertexAttrib3svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib3svNV_remap_index], fn) +#define CALL_VertexAttrib4dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[VertexAttrib4dNV_remap_index], parameters) +#define GET_VertexAttrib4dNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dNV_remap_index]) +#define SET_VertexAttrib4dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dNV_remap_index], fn) +#define CALL_VertexAttrib4dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLdouble *)), driDispatchRemapTable[VertexAttrib4dvNV_remap_index], parameters) +#define GET_VertexAttrib4dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dvNV_remap_index]) +#define SET_VertexAttrib4dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4dvNV_remap_index], fn) +#define CALL_VertexAttrib4fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[VertexAttrib4fNV_remap_index], parameters) +#define GET_VertexAttrib4fNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fNV_remap_index]) +#define SET_VertexAttrib4fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fNV_remap_index], fn) +#define CALL_VertexAttrib4fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[VertexAttrib4fvNV_remap_index], parameters) +#define GET_VertexAttrib4fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fvNV_remap_index]) +#define SET_VertexAttrib4fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4fvNV_remap_index], fn) +#define CALL_VertexAttrib4sNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLshort, GLshort, GLshort, GLshort)), driDispatchRemapTable[VertexAttrib4sNV_remap_index], parameters) +#define GET_VertexAttrib4sNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4sNV_remap_index]) +#define SET_VertexAttrib4sNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4sNV_remap_index], fn) +#define CALL_VertexAttrib4svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLshort *)), driDispatchRemapTable[VertexAttrib4svNV_remap_index], parameters) +#define GET_VertexAttrib4svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4svNV_remap_index]) +#define SET_VertexAttrib4svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4svNV_remap_index], fn) +#define CALL_VertexAttrib4ubNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLubyte, GLubyte, GLubyte, GLubyte)), driDispatchRemapTable[VertexAttrib4ubNV_remap_index], parameters) +#define GET_VertexAttrib4ubNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubNV_remap_index]) +#define SET_VertexAttrib4ubNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubNV_remap_index], fn) +#define CALL_VertexAttrib4ubvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLubyte *)), driDispatchRemapTable[VertexAttrib4ubvNV_remap_index], parameters) +#define GET_VertexAttrib4ubvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubvNV_remap_index]) +#define SET_VertexAttrib4ubvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttrib4ubvNV_remap_index], fn) +#define CALL_VertexAttribPointerNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLint, GLenum, GLsizei, const GLvoid *)), driDispatchRemapTable[VertexAttribPointerNV_remap_index], parameters) +#define GET_VertexAttribPointerNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribPointerNV_remap_index]) +#define SET_VertexAttribPointerNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribPointerNV_remap_index], fn) +#define CALL_VertexAttribs1dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLdouble *)), driDispatchRemapTable[VertexAttribs1dvNV_remap_index], parameters) +#define GET_VertexAttribs1dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs1dvNV_remap_index]) +#define SET_VertexAttribs1dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs1dvNV_remap_index], fn) +#define CALL_VertexAttribs1fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[VertexAttribs1fvNV_remap_index], parameters) +#define GET_VertexAttribs1fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs1fvNV_remap_index]) +#define SET_VertexAttribs1fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs1fvNV_remap_index], fn) +#define CALL_VertexAttribs1svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLshort *)), driDispatchRemapTable[VertexAttribs1svNV_remap_index], parameters) +#define GET_VertexAttribs1svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs1svNV_remap_index]) +#define SET_VertexAttribs1svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs1svNV_remap_index], fn) +#define CALL_VertexAttribs2dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLdouble *)), driDispatchRemapTable[VertexAttribs2dvNV_remap_index], parameters) +#define GET_VertexAttribs2dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs2dvNV_remap_index]) +#define SET_VertexAttribs2dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs2dvNV_remap_index], fn) +#define CALL_VertexAttribs2fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[VertexAttribs2fvNV_remap_index], parameters) +#define GET_VertexAttribs2fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs2fvNV_remap_index]) +#define SET_VertexAttribs2fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs2fvNV_remap_index], fn) +#define CALL_VertexAttribs2svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLshort *)), driDispatchRemapTable[VertexAttribs2svNV_remap_index], parameters) +#define GET_VertexAttribs2svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs2svNV_remap_index]) +#define SET_VertexAttribs2svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs2svNV_remap_index], fn) +#define CALL_VertexAttribs3dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLdouble *)), driDispatchRemapTable[VertexAttribs3dvNV_remap_index], parameters) +#define GET_VertexAttribs3dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs3dvNV_remap_index]) +#define SET_VertexAttribs3dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs3dvNV_remap_index], fn) +#define CALL_VertexAttribs3fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[VertexAttribs3fvNV_remap_index], parameters) +#define GET_VertexAttribs3fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs3fvNV_remap_index]) +#define SET_VertexAttribs3fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs3fvNV_remap_index], fn) +#define CALL_VertexAttribs3svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLshort *)), driDispatchRemapTable[VertexAttribs3svNV_remap_index], parameters) +#define GET_VertexAttribs3svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs3svNV_remap_index]) +#define SET_VertexAttribs3svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs3svNV_remap_index], fn) +#define CALL_VertexAttribs4dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLdouble *)), driDispatchRemapTable[VertexAttribs4dvNV_remap_index], parameters) +#define GET_VertexAttribs4dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs4dvNV_remap_index]) +#define SET_VertexAttribs4dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs4dvNV_remap_index], fn) +#define CALL_VertexAttribs4fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[VertexAttribs4fvNV_remap_index], parameters) +#define GET_VertexAttribs4fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs4fvNV_remap_index]) +#define SET_VertexAttribs4fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs4fvNV_remap_index], fn) +#define CALL_VertexAttribs4svNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLshort *)), driDispatchRemapTable[VertexAttribs4svNV_remap_index], parameters) +#define GET_VertexAttribs4svNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs4svNV_remap_index]) +#define SET_VertexAttribs4svNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs4svNV_remap_index], fn) +#define CALL_VertexAttribs4ubvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *)), driDispatchRemapTable[VertexAttribs4ubvNV_remap_index], parameters) +#define GET_VertexAttribs4ubvNV(disp) GET_by_offset(disp, driDispatchRemapTable[VertexAttribs4ubvNV_remap_index]) +#define SET_VertexAttribs4ubvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[VertexAttribs4ubvNV_remap_index], fn) +#define CALL_GetTexBumpParameterfvATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLfloat *)), driDispatchRemapTable[GetTexBumpParameterfvATI_remap_index], parameters) +#define GET_GetTexBumpParameterfvATI(disp) GET_by_offset(disp, driDispatchRemapTable[GetTexBumpParameterfvATI_remap_index]) +#define SET_GetTexBumpParameterfvATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetTexBumpParameterfvATI_remap_index], fn) +#define CALL_GetTexBumpParameterivATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint *)), driDispatchRemapTable[GetTexBumpParameterivATI_remap_index], parameters) +#define GET_GetTexBumpParameterivATI(disp) GET_by_offset(disp, driDispatchRemapTable[GetTexBumpParameterivATI_remap_index]) +#define SET_GetTexBumpParameterivATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetTexBumpParameterivATI_remap_index], fn) +#define CALL_TexBumpParameterfvATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLfloat *)), driDispatchRemapTable[TexBumpParameterfvATI_remap_index], parameters) +#define GET_TexBumpParameterfvATI(disp) GET_by_offset(disp, driDispatchRemapTable[TexBumpParameterfvATI_remap_index]) +#define SET_TexBumpParameterfvATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TexBumpParameterfvATI_remap_index], fn) +#define CALL_TexBumpParameterivATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLint *)), driDispatchRemapTable[TexBumpParameterivATI_remap_index], parameters) +#define GET_TexBumpParameterivATI(disp) GET_by_offset(disp, driDispatchRemapTable[TexBumpParameterivATI_remap_index]) +#define SET_TexBumpParameterivATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TexBumpParameterivATI_remap_index], fn) +#define CALL_AlphaFragmentOp1ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[AlphaFragmentOp1ATI_remap_index], parameters) +#define GET_AlphaFragmentOp1ATI(disp) GET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp1ATI_remap_index]) +#define SET_AlphaFragmentOp1ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp1ATI_remap_index], fn) +#define CALL_AlphaFragmentOp2ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[AlphaFragmentOp2ATI_remap_index], parameters) +#define GET_AlphaFragmentOp2ATI(disp) GET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp2ATI_remap_index]) +#define SET_AlphaFragmentOp2ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp2ATI_remap_index], fn) +#define CALL_AlphaFragmentOp3ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[AlphaFragmentOp3ATI_remap_index], parameters) +#define GET_AlphaFragmentOp3ATI(disp) GET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp3ATI_remap_index]) +#define SET_AlphaFragmentOp3ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[AlphaFragmentOp3ATI_remap_index], fn) +#define CALL_BeginFragmentShaderATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[BeginFragmentShaderATI_remap_index], parameters) +#define GET_BeginFragmentShaderATI(disp) GET_by_offset(disp, driDispatchRemapTable[BeginFragmentShaderATI_remap_index]) +#define SET_BeginFragmentShaderATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BeginFragmentShaderATI_remap_index], fn) +#define CALL_BindFragmentShaderATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[BindFragmentShaderATI_remap_index], parameters) +#define GET_BindFragmentShaderATI(disp) GET_by_offset(disp, driDispatchRemapTable[BindFragmentShaderATI_remap_index]) +#define SET_BindFragmentShaderATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindFragmentShaderATI_remap_index], fn) +#define CALL_ColorFragmentOp1ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[ColorFragmentOp1ATI_remap_index], parameters) +#define GET_ColorFragmentOp1ATI(disp) GET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp1ATI_remap_index]) +#define SET_ColorFragmentOp1ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp1ATI_remap_index], fn) +#define CALL_ColorFragmentOp2ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[ColorFragmentOp2ATI_remap_index], parameters) +#define GET_ColorFragmentOp2ATI(disp) GET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp2ATI_remap_index]) +#define SET_ColorFragmentOp2ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp2ATI_remap_index], fn) +#define CALL_ColorFragmentOp3ATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint)), driDispatchRemapTable[ColorFragmentOp3ATI_remap_index], parameters) +#define GET_ColorFragmentOp3ATI(disp) GET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp3ATI_remap_index]) +#define SET_ColorFragmentOp3ATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ColorFragmentOp3ATI_remap_index], fn) +#define CALL_DeleteFragmentShaderATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[DeleteFragmentShaderATI_remap_index], parameters) +#define GET_DeleteFragmentShaderATI(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteFragmentShaderATI_remap_index]) +#define SET_DeleteFragmentShaderATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteFragmentShaderATI_remap_index], fn) +#define CALL_EndFragmentShaderATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(void)), driDispatchRemapTable[EndFragmentShaderATI_remap_index], parameters) +#define GET_EndFragmentShaderATI(disp) GET_by_offset(disp, driDispatchRemapTable[EndFragmentShaderATI_remap_index]) +#define SET_EndFragmentShaderATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[EndFragmentShaderATI_remap_index], fn) +#define CALL_GenFragmentShadersATI(disp, parameters) CALL_by_offset(disp, (GLuint (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[GenFragmentShadersATI_remap_index], parameters) +#define GET_GenFragmentShadersATI(disp) GET_by_offset(disp, driDispatchRemapTable[GenFragmentShadersATI_remap_index]) +#define SET_GenFragmentShadersATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenFragmentShadersATI_remap_index], fn) +#define CALL_PassTexCoordATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint, GLenum)), driDispatchRemapTable[PassTexCoordATI_remap_index], parameters) +#define GET_PassTexCoordATI(disp) GET_by_offset(disp, driDispatchRemapTable[PassTexCoordATI_remap_index]) +#define SET_PassTexCoordATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PassTexCoordATI_remap_index], fn) +#define CALL_SampleMapATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLuint, GLenum)), driDispatchRemapTable[SampleMapATI_remap_index], parameters) +#define GET_SampleMapATI(disp) GET_by_offset(disp, driDispatchRemapTable[SampleMapATI_remap_index]) +#define SET_SampleMapATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SampleMapATI_remap_index], fn) +#define CALL_SetFragmentShaderConstantATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, const GLfloat *)), driDispatchRemapTable[SetFragmentShaderConstantATI_remap_index], parameters) +#define GET_SetFragmentShaderConstantATI(disp) GET_by_offset(disp, driDispatchRemapTable[SetFragmentShaderConstantATI_remap_index]) +#define SET_SetFragmentShaderConstantATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[SetFragmentShaderConstantATI_remap_index], fn) +#define CALL_PointParameteriNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLint)), driDispatchRemapTable[PointParameteriNV_remap_index], parameters) +#define GET_PointParameteriNV(disp) GET_by_offset(disp, driDispatchRemapTable[PointParameteriNV_remap_index]) +#define SET_PointParameteriNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PointParameteriNV_remap_index], fn) +#define CALL_PointParameterivNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, const GLint *)), driDispatchRemapTable[PointParameterivNV_remap_index], parameters) +#define GET_PointParameterivNV(disp) GET_by_offset(disp, driDispatchRemapTable[PointParameterivNV_remap_index]) +#define SET_PointParameterivNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[PointParameterivNV_remap_index], fn) +#define CALL_ActiveStencilFaceEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[ActiveStencilFaceEXT_remap_index], parameters) +#define GET_ActiveStencilFaceEXT(disp) GET_by_offset(disp, driDispatchRemapTable[ActiveStencilFaceEXT_remap_index]) +#define SET_ActiveStencilFaceEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ActiveStencilFaceEXT_remap_index], fn) +#define CALL_BindVertexArrayAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[BindVertexArrayAPPLE_remap_index], parameters) +#define GET_BindVertexArrayAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[BindVertexArrayAPPLE_remap_index]) +#define SET_BindVertexArrayAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindVertexArrayAPPLE_remap_index], fn) +#define CALL_DeleteVertexArraysAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteVertexArraysAPPLE_remap_index], parameters) +#define GET_DeleteVertexArraysAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteVertexArraysAPPLE_remap_index]) +#define SET_DeleteVertexArraysAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteVertexArraysAPPLE_remap_index], fn) +#define CALL_GenVertexArraysAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenVertexArraysAPPLE_remap_index], parameters) +#define GET_GenVertexArraysAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[GenVertexArraysAPPLE_remap_index]) +#define SET_GenVertexArraysAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenVertexArraysAPPLE_remap_index], fn) +#define CALL_IsVertexArrayAPPLE(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsVertexArrayAPPLE_remap_index], parameters) +#define GET_IsVertexArrayAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[IsVertexArrayAPPLE_remap_index]) +#define SET_IsVertexArrayAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsVertexArrayAPPLE_remap_index], fn) +#define CALL_GetProgramNamedParameterdvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, GLdouble *)), driDispatchRemapTable[GetProgramNamedParameterdvNV_remap_index], parameters) +#define GET_GetProgramNamedParameterdvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramNamedParameterdvNV_remap_index]) +#define SET_GetProgramNamedParameterdvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramNamedParameterdvNV_remap_index], fn) +#define CALL_GetProgramNamedParameterfvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, GLfloat *)), driDispatchRemapTable[GetProgramNamedParameterfvNV_remap_index], parameters) +#define GET_GetProgramNamedParameterfvNV(disp) GET_by_offset(disp, driDispatchRemapTable[GetProgramNamedParameterfvNV_remap_index]) +#define SET_GetProgramNamedParameterfvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetProgramNamedParameterfvNV_remap_index], fn) +#define CALL_ProgramNamedParameter4dNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble)), driDispatchRemapTable[ProgramNamedParameter4dNV_remap_index], parameters) +#define GET_ProgramNamedParameter4dNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4dNV_remap_index]) +#define SET_ProgramNamedParameter4dNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4dNV_remap_index], fn) +#define CALL_ProgramNamedParameter4dvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, const GLdouble *)), driDispatchRemapTable[ProgramNamedParameter4dvNV_remap_index], parameters) +#define GET_ProgramNamedParameter4dvNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4dvNV_remap_index]) +#define SET_ProgramNamedParameter4dvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4dvNV_remap_index], fn) +#define CALL_ProgramNamedParameter4fNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat)), driDispatchRemapTable[ProgramNamedParameter4fNV_remap_index], parameters) +#define GET_ProgramNamedParameter4fNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4fNV_remap_index]) +#define SET_ProgramNamedParameter4fNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4fNV_remap_index], fn) +#define CALL_ProgramNamedParameter4fvNV(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLsizei, const GLubyte *, const GLfloat *)), driDispatchRemapTable[ProgramNamedParameter4fvNV_remap_index], parameters) +#define GET_ProgramNamedParameter4fvNV(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4fvNV_remap_index]) +#define SET_ProgramNamedParameter4fvNV(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramNamedParameter4fvNV_remap_index], fn) +#define CALL_DepthBoundsEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLclampd, GLclampd)), driDispatchRemapTable[DepthBoundsEXT_remap_index], parameters) +#define GET_DepthBoundsEXT(disp) GET_by_offset(disp, driDispatchRemapTable[DepthBoundsEXT_remap_index]) +#define SET_DepthBoundsEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DepthBoundsEXT_remap_index], fn) +#define CALL_BlendEquationSeparateEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum)), driDispatchRemapTable[BlendEquationSeparateEXT_remap_index], parameters) +#define GET_BlendEquationSeparateEXT(disp) GET_by_offset(disp, driDispatchRemapTable[BlendEquationSeparateEXT_remap_index]) +#define SET_BlendEquationSeparateEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BlendEquationSeparateEXT_remap_index], fn) +#define CALL_BindFramebufferEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[BindFramebufferEXT_remap_index], parameters) +#define GET_BindFramebufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[BindFramebufferEXT_remap_index]) +#define SET_BindFramebufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindFramebufferEXT_remap_index], fn) +#define CALL_BindRenderbufferEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint)), driDispatchRemapTable[BindRenderbufferEXT_remap_index], parameters) +#define GET_BindRenderbufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[BindRenderbufferEXT_remap_index]) +#define SET_BindRenderbufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BindRenderbufferEXT_remap_index], fn) +#define CALL_CheckFramebufferStatusEXT(disp, parameters) CALL_by_offset(disp, (GLenum (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[CheckFramebufferStatusEXT_remap_index], parameters) +#define GET_CheckFramebufferStatusEXT(disp) GET_by_offset(disp, driDispatchRemapTable[CheckFramebufferStatusEXT_remap_index]) +#define SET_CheckFramebufferStatusEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[CheckFramebufferStatusEXT_remap_index], fn) +#define CALL_DeleteFramebuffersEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteFramebuffersEXT_remap_index], parameters) +#define GET_DeleteFramebuffersEXT(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteFramebuffersEXT_remap_index]) +#define SET_DeleteFramebuffersEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteFramebuffersEXT_remap_index], fn) +#define CALL_DeleteRenderbuffersEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, const GLuint *)), driDispatchRemapTable[DeleteRenderbuffersEXT_remap_index], parameters) +#define GET_DeleteRenderbuffersEXT(disp) GET_by_offset(disp, driDispatchRemapTable[DeleteRenderbuffersEXT_remap_index]) +#define SET_DeleteRenderbuffersEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[DeleteRenderbuffersEXT_remap_index], fn) +#define CALL_FramebufferRenderbufferEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLuint)), driDispatchRemapTable[FramebufferRenderbufferEXT_remap_index], parameters) +#define GET_FramebufferRenderbufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FramebufferRenderbufferEXT_remap_index]) +#define SET_FramebufferRenderbufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FramebufferRenderbufferEXT_remap_index], fn) +#define CALL_FramebufferTexture1DEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLuint, GLint)), driDispatchRemapTable[FramebufferTexture1DEXT_remap_index], parameters) +#define GET_FramebufferTexture1DEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FramebufferTexture1DEXT_remap_index]) +#define SET_FramebufferTexture1DEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FramebufferTexture1DEXT_remap_index], fn) +#define CALL_FramebufferTexture2DEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLuint, GLint)), driDispatchRemapTable[FramebufferTexture2DEXT_remap_index], parameters) +#define GET_FramebufferTexture2DEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FramebufferTexture2DEXT_remap_index]) +#define SET_FramebufferTexture2DEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FramebufferTexture2DEXT_remap_index], fn) +#define CALL_FramebufferTexture3DEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLuint, GLint, GLint)), driDispatchRemapTable[FramebufferTexture3DEXT_remap_index], parameters) +#define GET_FramebufferTexture3DEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FramebufferTexture3DEXT_remap_index]) +#define SET_FramebufferTexture3DEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FramebufferTexture3DEXT_remap_index], fn) +#define CALL_GenFramebuffersEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenFramebuffersEXT_remap_index], parameters) +#define GET_GenFramebuffersEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GenFramebuffersEXT_remap_index]) +#define SET_GenFramebuffersEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenFramebuffersEXT_remap_index], fn) +#define CALL_GenRenderbuffersEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLsizei, GLuint *)), driDispatchRemapTable[GenRenderbuffersEXT_remap_index], parameters) +#define GET_GenRenderbuffersEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GenRenderbuffersEXT_remap_index]) +#define SET_GenRenderbuffersEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenRenderbuffersEXT_remap_index], fn) +#define CALL_GenerateMipmapEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[GenerateMipmapEXT_remap_index], parameters) +#define GET_GenerateMipmapEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GenerateMipmapEXT_remap_index]) +#define SET_GenerateMipmapEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GenerateMipmapEXT_remap_index], fn) +#define CALL_GetFramebufferAttachmentParameterivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLenum, GLint *)), driDispatchRemapTable[GetFramebufferAttachmentParameterivEXT_remap_index], parameters) +#define GET_GetFramebufferAttachmentParameterivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetFramebufferAttachmentParameterivEXT_remap_index]) +#define SET_GetFramebufferAttachmentParameterivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetFramebufferAttachmentParameterivEXT_remap_index], fn) +#define CALL_GetRenderbufferParameterivEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint *)), driDispatchRemapTable[GetRenderbufferParameterivEXT_remap_index], parameters) +#define GET_GetRenderbufferParameterivEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetRenderbufferParameterivEXT_remap_index]) +#define SET_GetRenderbufferParameterivEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetRenderbufferParameterivEXT_remap_index], fn) +#define CALL_IsFramebufferEXT(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsFramebufferEXT_remap_index], parameters) +#define GET_IsFramebufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[IsFramebufferEXT_remap_index]) +#define SET_IsFramebufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsFramebufferEXT_remap_index], fn) +#define CALL_IsRenderbufferEXT(disp, parameters) CALL_by_offset(disp, (GLboolean (GLAPIENTRYP)(GLuint)), driDispatchRemapTable[IsRenderbufferEXT_remap_index], parameters) +#define GET_IsRenderbufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[IsRenderbufferEXT_remap_index]) +#define SET_IsRenderbufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[IsRenderbufferEXT_remap_index], fn) +#define CALL_RenderbufferStorageEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLsizei, GLsizei)), driDispatchRemapTable[RenderbufferStorageEXT_remap_index], parameters) +#define GET_RenderbufferStorageEXT(disp) GET_by_offset(disp, driDispatchRemapTable[RenderbufferStorageEXT_remap_index]) +#define SET_RenderbufferStorageEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[RenderbufferStorageEXT_remap_index], fn) +#define CALL_BlitFramebufferEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum)), driDispatchRemapTable[BlitFramebufferEXT_remap_index], parameters) +#define GET_BlitFramebufferEXT(disp) GET_by_offset(disp, driDispatchRemapTable[BlitFramebufferEXT_remap_index]) +#define SET_BlitFramebufferEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BlitFramebufferEXT_remap_index], fn) +#define CALL_BufferParameteriAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint)), driDispatchRemapTable[BufferParameteriAPPLE_remap_index], parameters) +#define GET_BufferParameteriAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[BufferParameteriAPPLE_remap_index]) +#define SET_BufferParameteriAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[BufferParameteriAPPLE_remap_index], fn) +#define CALL_FlushMappedBufferRangeAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLintptr, GLsizeiptr)), driDispatchRemapTable[FlushMappedBufferRangeAPPLE_remap_index], parameters) +#define GET_FlushMappedBufferRangeAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[FlushMappedBufferRangeAPPLE_remap_index]) +#define SET_FlushMappedBufferRangeAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FlushMappedBufferRangeAPPLE_remap_index], fn) +#define CALL_FramebufferTextureLayerEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLuint, GLint, GLint)), driDispatchRemapTable[FramebufferTextureLayerEXT_remap_index], parameters) +#define GET_FramebufferTextureLayerEXT(disp) GET_by_offset(disp, driDispatchRemapTable[FramebufferTextureLayerEXT_remap_index]) +#define SET_FramebufferTextureLayerEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[FramebufferTextureLayerEXT_remap_index], fn) +#define CALL_ProvokingVertexEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum)), driDispatchRemapTable[ProvokingVertexEXT_remap_index], parameters) +#define GET_ProvokingVertexEXT(disp) GET_by_offset(disp, driDispatchRemapTable[ProvokingVertexEXT_remap_index]) +#define SET_ProvokingVertexEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProvokingVertexEXT_remap_index], fn) +#define CALL_GetTexParameterPointervAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLvoid **)), driDispatchRemapTable[GetTexParameterPointervAPPLE_remap_index], parameters) +#define GET_GetTexParameterPointervAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[GetTexParameterPointervAPPLE_remap_index]) +#define SET_GetTexParameterPointervAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetTexParameterPointervAPPLE_remap_index], fn) +#define CALL_TextureRangeAPPLE(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLsizei, GLvoid *)), driDispatchRemapTable[TextureRangeAPPLE_remap_index], parameters) +#define GET_TextureRangeAPPLE(disp) GET_by_offset(disp, driDispatchRemapTable[TextureRangeAPPLE_remap_index]) +#define SET_TextureRangeAPPLE(disp, fn) SET_by_offset(disp, driDispatchRemapTable[TextureRangeAPPLE_remap_index], fn) +#define CALL_StencilFuncSeparateATI(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLenum, GLint, GLuint)), driDispatchRemapTable[StencilFuncSeparateATI_remap_index], parameters) +#define GET_StencilFuncSeparateATI(disp) GET_by_offset(disp, driDispatchRemapTable[StencilFuncSeparateATI_remap_index]) +#define SET_StencilFuncSeparateATI(disp, fn) SET_by_offset(disp, driDispatchRemapTable[StencilFuncSeparateATI_remap_index], fn) +#define CALL_ProgramEnvParameters4fvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[ProgramEnvParameters4fvEXT_remap_index], parameters) +#define GET_ProgramEnvParameters4fvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameters4fvEXT_remap_index]) +#define SET_ProgramEnvParameters4fvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramEnvParameters4fvEXT_remap_index], fn) +#define CALL_ProgramLocalParameters4fvEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLenum, GLuint, GLsizei, const GLfloat *)), driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index], parameters) +#define GET_ProgramLocalParameters4fvEXT(disp) GET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index]) +#define SET_ProgramLocalParameters4fvEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index], fn) +#define CALL_GetQueryObjecti64vEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLint64EXT *)), driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index], parameters) +#define GET_GetQueryObjecti64vEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index]) +#define SET_GetQueryObjecti64vEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index], fn) +#define CALL_GetQueryObjectui64vEXT(disp, parameters) CALL_by_offset(disp, (void (GLAPIENTRYP)(GLuint, GLenum, GLuint64EXT *)), driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index], parameters) +#define GET_GetQueryObjectui64vEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index]) +#define SET_GetQueryObjectui64vEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index], fn) + +#endif /* !defined(IN_DRI_DRIVER) */ + +#endif /* !defined( _GLAPI_DISPATCH_H_ ) */ -- cgit v1.2.3 From 6e99e6ddbf488f6955e34ef0bc438fdcb4d90f74 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Fri, 16 Oct 2009 16:04:06 +0800 Subject: glapi: Always build libglapi.a. This is made possible by making glapioffsets.h and glapidispatch.h internal headers of glapi. They should only be included indirectly through dispatch.h by mesa. Signed-off-by: Chia-I Wu --- src/mesa/Makefile | 6 +----- src/mesa/glapi/dispatch.h | 5 +++++ src/mesa/glapi/gl_offsets.py | 7 +++++-- src/mesa/glapi/gl_table.py | 6 ++++-- src/mesa/glapi/glapidispatch.h | 6 ++++-- src/mesa/glapi/glapioffsets.h | 6 ++++-- src/mesa/glapi/remap_helper.py | 1 - src/mesa/main/api_arrayelt.c | 1 - src/mesa/main/context.c | 1 - src/mesa/main/dispatch.c | 2 +- src/mesa/main/remap_helper.h | 1 - src/mesa/main/vtxfmt_tmp.h | 1 - 12 files changed, 24 insertions(+), 19 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/Makefile b/src/mesa/Makefile index 8300b30144..6f58ad6161 100644 --- a/src/mesa/Makefile +++ b/src/mesa/Makefile @@ -39,11 +39,7 @@ libmesagallium.a: $(MESA_GALLIUM_OBJECTS) # Make archive of gl* API dispatcher functions only libglapi.a: $(GLAPI_OBJECTS) - @if [ "${WINDOW_SYSTEM}" = "dri" ] ; then \ - touch libglapi.a ; \ - else \ - $(MKLIB) -o glapi -static $(GLAPI_OBJECTS) ; \ - fi + $(MKLIB) -o glapi -static $(GLAPI_OBJECTS) ###################################################################### # Device drivers diff --git a/src/mesa/glapi/dispatch.h b/src/mesa/glapi/dispatch.h index dafcf3e8f2..6623d52469 100644 --- a/src/mesa/glapi/dispatch.h +++ b/src/mesa/glapi/dispatch.h @@ -26,7 +26,12 @@ #ifndef _DISPATCH_H #define _DISPATCH_H +#ifdef IN_DRI_DRIVER +#define _GLAPI_USE_REMAP_TABLE +#endif + #include "glapitable.h" +#include "glapioffsets.h" #include "glapidispatch.h" #endif /* _DISPATCH_H */ diff --git a/src/mesa/glapi/gl_offsets.py b/src/mesa/glapi/gl_offsets.py index 59f8d372b0..ca6c90ffd8 100644 --- a/src/mesa/glapi/gl_offsets.py +++ b/src/mesa/glapi/gl_offsets.py @@ -43,6 +43,9 @@ class PrintGlOffsets(gl_XML.gl_print_base): def printBody(self, api): abi = [ "1.0", "1.1", "1.2", "GL_ARB_multitexture" ] + print '/* this file should not be included directly in mesa */' + print '' + functions = [] abi_functions = [] count = 0 @@ -60,7 +63,7 @@ class PrintGlOffsets(gl_XML.gl_print_base): last_static = f.offset print '' - print '#if !defined(IN_DRI_DRIVER)' + print '#if !defined(_GLAPI_USE_REMAP_TABLE)' print '' for [f, index] in functions: @@ -76,7 +79,7 @@ class PrintGlOffsets(gl_XML.gl_print_base): print '#define _gloffset_%s driDispatchRemapTable[%s_remap_index]' % (f.name, f.name) print '' - print '#endif /* !defined(IN_DRI_DRIVER) */' + print '#endif /* !defined(_GLAPI_USE_REMAP_TABLE) */' return diff --git a/src/mesa/glapi/gl_table.py b/src/mesa/glapi/gl_table.py index 6cf26f89db..0e05b3431a 100644 --- a/src/mesa/glapi/gl_table.py +++ b/src/mesa/glapi/gl_table.py @@ -79,6 +79,8 @@ class PrintRemapTable(gl_XML.gl_print_base): def printRealHeader(self): print """ +/* this file should not be included directly in mesa */ + /** * \\file glapidispatch.h * Macros for handling GL dispatch tables. @@ -132,7 +134,7 @@ class PrintRemapTable(gl_XML.gl_print_base): print '' - print '#if !defined(IN_DRI_DRIVER)' + print '#if !defined(_GLAPI_USE_REMAP_TABLE)' print '' for [f, index] in functions: @@ -162,7 +164,7 @@ class PrintRemapTable(gl_XML.gl_print_base): print '' - print '#endif /* !defined(IN_DRI_DRIVER) */' + print '#endif /* !defined(_GLAPI_USE_REMAP_TABLE) */' return diff --git a/src/mesa/glapi/glapidispatch.h b/src/mesa/glapi/glapidispatch.h index 1d26dfb5bf..d6ba92824a 100644 --- a/src/mesa/glapi/glapidispatch.h +++ b/src/mesa/glapi/glapidispatch.h @@ -29,6 +29,8 @@ # define _GLAPI_DISPATCH_H_ +/* this file should not be included directly in mesa */ + /** * \file glapidispatch.h * Macros for handling GL dispatch tables. @@ -1281,7 +1283,7 @@ #define GET_MultiTexCoord4svARB(disp) ((disp)->MultiTexCoord4svARB) #define SET_MultiTexCoord4svARB(disp, fn) ((disp)->MultiTexCoord4svARB = fn) -#if !defined(IN_DRI_DRIVER) +#if !defined(_GLAPI_USE_REMAP_TABLE) #define CALL_AttachShader(disp, parameters) (*((disp)->AttachShader)) parameters #define GET_AttachShader(disp) ((disp)->AttachShader) @@ -4000,6 +4002,6 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define GET_GetQueryObjectui64vEXT(disp) GET_by_offset(disp, driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index]) #define SET_GetQueryObjectui64vEXT(disp, fn) SET_by_offset(disp, driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index], fn) -#endif /* !defined(IN_DRI_DRIVER) */ +#endif /* !defined(_GLAPI_USE_REMAP_TABLE) */ #endif /* !defined( _GLAPI_DISPATCH_H_ ) */ diff --git a/src/mesa/glapi/glapioffsets.h b/src/mesa/glapi/glapioffsets.h index a3807744ff..3d10260a05 100644 --- a/src/mesa/glapi/glapioffsets.h +++ b/src/mesa/glapi/glapioffsets.h @@ -29,6 +29,8 @@ #if !defined( _GLAPI_OFFSETS_H_ ) # define _GLAPI_OFFSETS_H_ +/* this file should not be included directly in mesa */ + #define _gloffset_NewList 0 #define _gloffset_EndList 1 #define _gloffset_CallList 2 @@ -438,7 +440,7 @@ #define _gloffset_MultiTexCoord4sARB 406 #define _gloffset_MultiTexCoord4svARB 407 -#if !defined(IN_DRI_DRIVER) +#if !defined(_GLAPI_USE_REMAP_TABLE) #define _gloffset_AttachShader 408 #define _gloffset_CreateProgram 409 @@ -1219,6 +1221,6 @@ #define _gloffset_GetQueryObjecti64vEXT driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index] #define _gloffset_GetQueryObjectui64vEXT driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index] -#endif /* !defined(IN_DRI_DRIVER) */ +#endif /* !defined(_GLAPI_USE_REMAP_TABLE) */ #endif /* !defined( _GLAPI_OFFSETS_H_ ) */ diff --git a/src/mesa/glapi/remap_helper.py b/src/mesa/glapi/remap_helper.py index 7e68a908e3..e47583a5d3 100644 --- a/src/mesa/glapi/remap_helper.py +++ b/src/mesa/glapi/remap_helper.py @@ -65,7 +65,6 @@ class PrintGlRemap(gl_XML.gl_print_base): def printRealHeader(self): print '#include "glapi/dispatch.h"' - print '#include "glapi/glapioffsets.h"' print '' return diff --git a/src/mesa/main/api_arrayelt.c b/src/mesa/main/api_arrayelt.c index a058227110..469b4529f9 100644 --- a/src/mesa/main/api_arrayelt.c +++ b/src/mesa/main/api_arrayelt.c @@ -32,7 +32,6 @@ #include "context.h" #include "imports.h" #include "macros.h" -#include "glapi/glapioffsets.h" #include "glapi/dispatch.h" typedef void (GLAPIENTRY *array_func)( const void * ); diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index ea820d77b3..c57d7c10b6 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -133,7 +133,6 @@ #include "viewport.h" #include "vtxfmt.h" #include "glapi/glthread.h" -#include "glapi/glapioffsets.h" #include "glapi/glapitable.h" #include "shader/program.h" #include "shader/prog_print.h" diff --git a/src/mesa/main/dispatch.c b/src/mesa/main/dispatch.c index bf1a013789..97d213e8e1 100644 --- a/src/mesa/main/dispatch.c +++ b/src/mesa/main/dispatch.c @@ -43,6 +43,7 @@ #include "main/compiler.h" #include "glapi/glapi.h" #include "glapi/glapitable.h" +#include "glapi/glapidispatch.h" #include "glapi/glthread.h" @@ -88,7 +89,6 @@ #define GLAPIENTRY #endif -#include "glapi/dispatch.h" #include "glapi/glapitemp.h" #endif /* USE_X86_ASM */ diff --git a/src/mesa/main/remap_helper.h b/src/mesa/main/remap_helper.h index 89192d37e5..3886f41862 100644 --- a/src/mesa/main/remap_helper.h +++ b/src/mesa/main/remap_helper.h @@ -26,7 +26,6 @@ */ #include "glapi/dispatch.h" -#include "glapi/glapioffsets.h" struct gl_function_remap { GLint func_index; diff --git a/src/mesa/main/vtxfmt_tmp.h b/src/mesa/main/vtxfmt_tmp.h index d56a2bb95e..ae636fb24f 100644 --- a/src/mesa/main/vtxfmt_tmp.h +++ b/src/mesa/main/vtxfmt_tmp.h @@ -30,7 +30,6 @@ #endif #include "glapi/dispatch.h" -#include "glapi/glapioffsets.h" static void GLAPIENTRY TAG(ArrayElement)( GLint i ) { -- cgit v1.2.3 From 5e4f5e41a487e9baa8a63842327d83cee659622e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Oct 2009 14:37:14 -0600 Subject: mesa: change s3tc vs. fxt1 priority when choosing compressed formats --- src/mesa/main/texformat.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index c709004784..9d5534e396 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -1590,25 +1590,25 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, case GL_COMPRESSED_INTENSITY_ARB: return &_mesa_texformat_intensity; case GL_COMPRESSED_RGB_ARB: -#if FEATURE_texture_fxt1 - if (ctx->Extensions.TDFX_texture_compression_FXT1) - return &_mesa_texformat_rgb_fxt1; -#endif #if FEATURE_texture_s3tc if (ctx->Extensions.EXT_texture_compression_s3tc || ctx->Extensions.S3_s3tc) return &_mesa_texformat_rgb_dxt1; #endif - return &_mesa_texformat_rgb; - case GL_COMPRESSED_RGBA_ARB: #if FEATURE_texture_fxt1 if (ctx->Extensions.TDFX_texture_compression_FXT1) - return &_mesa_texformat_rgba_fxt1; + return &_mesa_texformat_rgb_fxt1; #endif + return &_mesa_texformat_rgb; + case GL_COMPRESSED_RGBA_ARB: #if FEATURE_texture_s3tc if (ctx->Extensions.EXT_texture_compression_s3tc || ctx->Extensions.S3_s3tc) - return &_mesa_texformat_rgba_dxt3; /* Not rgba_dxt1, see spec */ + return &_mesa_texformat_rgba_dxt5; /* Not rgba_dxt1, see spec */ +#endif +#if FEATURE_texture_fxt1 + if (ctx->Extensions.TDFX_texture_compression_FXT1) + return &_mesa_texformat_rgba_fxt1; #endif return &_mesa_texformat_rgba; default: -- cgit v1.2.3 From 9528dc6ed8d09eba0dc3be17dc5e9ef4add8083c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Oct 2009 14:37:41 -0600 Subject: mesa: added _mesa_compressed_format_to_glenum() Maps a compressed MESA_FORMAT_x to correspding GLenum. Needed for querying a texture's actual format when a generic format was originally requested. --- src/mesa/main/texcompress.c | 50 +++++++++++++++++++++++++++++++++++++++++++++ src/mesa/main/texcompress.h | 4 ++++ 2 files changed, 54 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c index c1b8c7675a..2cda4dd859 100644 --- a/src/mesa/main/texcompress.c +++ b/src/mesa/main/texcompress.c @@ -360,3 +360,53 @@ _mesa_compressed_image_address(GLint col, GLint row, GLint img, return addr; } + + +/** + * Given a compressed MESA_FORMAT_x value, return the corresponding + * GLenum for that format. + * This is needed for glGetTexLevelParameter(GL_TEXTURE_INTERNAL_FORMAT) + * which must return the specific texture format used when the user might + * have originally specified a generic compressed format in their + * glTexImage2D() call. + * For non-compressed textures, we always return the user-specified + * internal format unchanged. + */ +GLenum +_mesa_compressed_format_to_glenum(GLcontext *ctx, GLuint mesaFormat) +{ + switch (mesaFormat) { +#if FEATURE_texture_fxt1 + case MESA_FORMAT_RGB_FXT1: + return GL_COMPRESSED_RGB_FXT1_3DFX; + case MESA_FORMAT_RGBA_FXT1: + return GL_COMPRESSED_RGBA_FXT1_3DFX; +#endif +#if FEATURE_texture_s3tc + case MESA_FORMAT_RGB_DXT1: + return GL_COMPRESSED_RGB_S3TC_DXT1_EXT; + case MESA_FORMAT_RGBA_DXT1: + return GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; + case MESA_FORMAT_RGBA_DXT3: + return GL_COMPRESSED_RGBA_S3TC_DXT3_EXT; + case MESA_FORMAT_RGBA_DXT5: + return GL_COMPRESSED_RGBA_S3TC_DXT5_EXT; +#if FEATURE_EXT_texture_sRGB + case MESA_FORMAT_SRGB_DXT1: + return GL_COMPRESSED_SRGB_S3TC_DXT1_EXT; + case MESA_FORMAT_SRGBA_DXT1: + return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT; + case MESA_FORMAT_SRGBA_DXT3: + return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT; + case MESA_FORMAT_SRGBA_DXT5: + return GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT; +#endif +#endif + default: + _mesa_problem(ctx, "Unexpected mesa texture format in" + " _mesa_compressed_format_to_glenum()"); + return 0; + } +} + + diff --git a/src/mesa/main/texcompress.h b/src/mesa/main/texcompress.h index 44f3338222..0f1a38f88e 100644 --- a/src/mesa/main/texcompress.h +++ b/src/mesa/main/texcompress.h @@ -52,6 +52,10 @@ _mesa_compressed_image_address(GLint col, GLint row, GLint img, GLsizei width, const GLubyte *image); +extern GLenum +_mesa_compressed_format_to_glenum(GLcontext *ctx, GLuint mesaFormat); + + extern void _mesa_init_texture_s3tc( GLcontext *ctx ); -- cgit v1.2.3 From cd62b4f00a11e9c548bd61652f88ab772d8421b8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Oct 2009 14:40:40 -0600 Subject: mesa: fix GL_TEXTURE_INTERNAL_FORMAT query for compressed formats Need to return the actual compressed format when the user originally requested a generic compressed format. --- src/mesa/main/texparam.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index b2fbe2205b..9d1fdd0566 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -776,7 +776,15 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, *params = img->Depth; break; case GL_TEXTURE_INTERNAL_FORMAT: - *params = img->InternalFormat; + if (img->IsCompressed) { + /* need to return the actual compressed format */ + *params = _mesa_compressed_format_to_glenum(ctx, + img->TexFormat->MesaFormat); + } + else { + /* return the user's requested internal format */ + *params = img->InternalFormat; + } break; case GL_TEXTURE_BORDER: *params = img->Border; -- cgit v1.2.3 From 2d17dbfb5346b6d75e87c839148cbe125bf5cd6d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 9 Jul 2009 09:32:21 -0700 Subject: intel: Keep track of x,y offsets in miptrees and use them for blitting. By just using offsets, we confused the hardware's tiling calculations, resulting in failures in miptree validation and blit clears. Fixes piglit fbo-clearmipmap. Bug #23552. (automatic mipmap generation) --- src/mesa/drivers/dri/i965/brw_tex_layout.c | 7 +- src/mesa/drivers/dri/intel/intel_blit.c | 19 ++-- src/mesa/drivers/dri/intel/intel_fbo.c | 24 ++--- src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 137 +++++++++++-------------- src/mesa/drivers/dri/intel/intel_mipmap_tree.h | 29 ++---- src/mesa/drivers/dri/intel/intel_regions.h | 2 + src/mesa/drivers/dri/intel/intel_tex_copy.c | 17 +-- src/mesa/drivers/dri/intel/intel_tex_image.c | 23 +++-- 8 files changed, 118 insertions(+), 140 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_tex_layout.c b/src/mesa/drivers/dri/i965/brw_tex_layout.c index 5986cbffad..e59e52ed86 100644 --- a/src/mesa/drivers/dri/i965/brw_tex_layout.c +++ b/src/mesa/drivers/dri/i965/brw_tex_layout.c @@ -86,10 +86,10 @@ GLboolean brw_miptree_layout(struct intel_context *intel, mt->pitch = intel_miptree_pitch_align(intel, mt, tiling, mt->pitch); if (mt->compressed) { - qpitch = (y_pitch + ALIGN(minify(y_pitch), align_h) + 11 * align_h) / 4 * mt->pitch * mt->cpp; + qpitch = (y_pitch + ALIGN(minify(y_pitch), align_h) + 11 * align_h) / 4; mt->total_height = (y_pitch + ALIGN(minify(y_pitch), align_h) + 11 * align_h) / 4 * 6; } else { - qpitch = (y_pitch + ALIGN(minify(y_pitch), align_h) + 11 * align_h) * mt->pitch * mt->cpp; + qpitch = (y_pitch + ALIGN(minify(y_pitch), align_h) + 11 * align_h); mt->total_height = (y_pitch + ALIGN(minify(y_pitch), align_h) + 11 * align_h) * 6; } @@ -102,7 +102,8 @@ GLboolean brw_miptree_layout(struct intel_context *intel, height, 1); for (q = 0; q < nr_images; q++) - intel_miptree_set_image_offset_ex(mt, level, q, x, y, q * qpitch); + intel_miptree_set_image_offset(mt, level, q, + x, y + q * qpitch); if (mt->compressed) img_height = MAX2(1, height/4); diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c index 0c5be4c798..ec4a5b492a 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.c +++ b/src/mesa/drivers/dri/intel/intel_blit.c @@ -441,6 +441,10 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask) intel_region_buffer(intel, irb->region, all ? INTEL_WRITE_FULL : INTEL_WRITE_PART); + int x1 = b.x1 + irb->region->draw_x; + int y1 = b.y1 + irb->region->draw_y; + int x2 = b.x2 + irb->region->draw_x; + int y2 = b.y2 + irb->region->draw_y; GLuint clearVal; GLint pitch, cpp; @@ -449,11 +453,10 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask) pitch = irb->region->pitch; cpp = irb->region->cpp; - DBG("%s dst:buf(%p)/%d+%d %d,%d sz:%dx%d\n", + DBG("%s dst:buf(%p)/%d %d,%d sz:%dx%d\n", __FUNCTION__, irb->region->buffer, (pitch * cpp), - irb->region->draw_offset, - b.x1, b.y1, b.x2 - b.x1, b.y2 - b.y1); + x1, y1, x2 - x1, y2 - y1); BR13 = 0xf0 << 16; CMD = XY_COLOR_BLT_CMD; @@ -526,17 +529,17 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask) buf, irb->Base.Name); */ - assert(b.x1 < b.x2); - assert(b.y1 < b.y2); + assert(x1 < x2); + assert(y1 < y2); BEGIN_BATCH(6, REFERENCES_CLIPRECTS); OUT_BATCH(CMD); OUT_BATCH(BR13); - OUT_BATCH((b.y1 << 16) | b.x1); - OUT_BATCH((b.y2 << 16) | b.x2); + OUT_BATCH((y1 << 16) | x1); + OUT_BATCH((y2 << 16) | x2); OUT_RELOC(write_buffer, I915_GEM_DOMAIN_RENDER, I915_GEM_DOMAIN_RENDER, - irb->region->draw_offset); + 0); OUT_BATCH(clearVal); ADVANCE_BATCH(); clearMask &= ~bufBit; /* turn off bit, for faster loop exit */ diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 804c034840..cf007d5b62 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -571,7 +571,7 @@ intel_render_texture(GLcontext * ctx, = att->Texture->Image[att->CubeMapFace][att->TextureLevel]; struct intel_renderbuffer *irb = intel_renderbuffer(att->Renderbuffer); struct intel_texture_image *intel_image; - GLuint imageOffset; + GLuint dst_x, dst_y; (void) fb; @@ -618,18 +618,16 @@ intel_render_texture(GLcontext * ctx, } /* compute offset of the particular 2D image within the texture region */ - imageOffset = intel_miptree_image_offset(intel_image->mt, - att->CubeMapFace, - att->TextureLevel); - - if (att->Texture->Target == GL_TEXTURE_3D) { - const GLuint *offsets = intel_miptree_depth_offsets(intel_image->mt, - att->TextureLevel); - imageOffset += offsets[att->Zoffset]; - } - - /* store that offset in the region */ - intel_image->mt->region->draw_offset = imageOffset; + intel_miptree_get_image_offset(intel_image->mt, + att->TextureLevel, + att->CubeMapFace, + att->Zoffset, + &dst_x, &dst_y); + + intel_image->mt->region->draw_offset = (dst_y * intel_image->mt->pitch + + dst_x) * intel_image->mt->cpp; + intel_image->mt->region->draw_x = dst_x; + intel_image->mt->region->draw_y = dst_y; /* update drawing region, etc */ intel_draw_buffer(ctx, fb); diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c index 4f5101a312..0589d82db2 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@ -287,9 +287,10 @@ intel_miptree_release(struct intel_context *intel, intel_region_release(&((*mt)->region)); - for (i = 0; i < MAX_TEXTURE_LEVELS; i++) - if ((*mt)->level[i].image_offset) - free((*mt)->level[i].image_offset); + for (i = 0; i < MAX_TEXTURE_LEVELS; i++) { + free((*mt)->level[i].x_offset); + free((*mt)->level[i].y_offset); + } free(*mt); } @@ -350,82 +351,58 @@ intel_miptree_set_level_info(struct intel_mipmap_tree *mt, mt->level[level].height = h; mt->level[level].depth = d; mt->level[level].level_offset = (x + y * mt->pitch) * mt->cpp; + mt->level[level].level_x = x; + mt->level[level].level_y = y; mt->level[level].nr_images = nr_images; DBG("%s level %d size: %d,%d,%d offset %d,%d (0x%x)\n", __FUNCTION__, level, w, h, d, x, y, mt->level[level].level_offset); - /* Not sure when this would happen, but anyway: - */ - if (mt->level[level].image_offset) { - free(mt->level[level].image_offset); - mt->level[level].image_offset = NULL; - } - assert(nr_images); + assert(!mt->level[level].x_offset); - mt->level[level].image_offset = malloc(nr_images * sizeof(GLuint)); - mt->level[level].image_offset[0] = 0; + mt->level[level].x_offset = malloc(nr_images * sizeof(GLuint)); + mt->level[level].x_offset[0] = mt->level[level].level_x; + mt->level[level].y_offset = malloc(nr_images * sizeof(GLuint)); + mt->level[level].y_offset[0] = mt->level[level].level_y; } void -intel_miptree_set_image_offset_ex(struct intel_mipmap_tree *mt, - GLuint level, GLuint img, - GLuint x, GLuint y, - GLuint offset) +intel_miptree_set_image_offset(struct intel_mipmap_tree *mt, + GLuint level, GLuint img, + GLuint x, GLuint y) { if (img == 0 && level == 0) assert(x == 0 && y == 0); assert(img < mt->level[level].nr_images); - mt->level[level].image_offset[img] = (x + y * mt->pitch) * mt->cpp + offset; + mt->level[level].x_offset[img] = mt->level[level].level_x + x; + mt->level[level].y_offset[img] = mt->level[level].level_y + y; - DBG("%s level %d img %d pos %d,%d image_offset %x\n", - __FUNCTION__, level, img, x, y, mt->level[level].image_offset[img]); + DBG("%s level %d img %d pos %d,%d\n", + __FUNCTION__, level, img, + mt->level[level].x_offset[img], mt->level[level].y_offset[img]); } void -intel_miptree_set_image_offset(struct intel_mipmap_tree *mt, - GLuint level, GLuint img, - GLuint x, GLuint y) -{ - intel_miptree_set_image_offset_ex(mt, level, img, x, y, 0); -} - - -/* Although we use the image_offset[] array to store relative offsets - * to cube faces, Mesa doesn't know anything about this and expects - * each cube face to be treated as a separate image. - * - * These functions present that view to mesa: - */ -const GLuint * -intel_miptree_depth_offsets(struct intel_mipmap_tree *mt, GLuint level) -{ - static const GLuint zero = 0; - - if (mt->target != GL_TEXTURE_3D || mt->level[level].nr_images == 1) - return &zero; - else - return mt->level[level].image_offset; -} - - -GLuint -intel_miptree_image_offset(struct intel_mipmap_tree *mt, - GLuint face, GLuint level) +intel_miptree_get_image_offset(struct intel_mipmap_tree *mt, + GLuint level, GLuint face, GLuint depth, + GLuint *x, GLuint *y) { - if (mt->target == GL_TEXTURE_CUBE_MAP_ARB) - return (mt->level[level].level_offset + - mt->level[level].image_offset[face]); - else - return mt->level[level].level_offset; + if (mt->target == GL_TEXTURE_CUBE_MAP_ARB) { + *x = mt->level[level].x_offset[face]; + *y = mt->level[level].y_offset[face]; + } else if (mt->target == GL_TEXTURE_3D) { + *x = mt->level[level].x_offset[depth]; + *y = mt->level[level].y_offset[depth]; + } else { + *x = mt->level[level].x_offset[0]; + *y = mt->level[level].y_offset[0]; + } } - - /** * Map a teximage in a mipmap tree. * \param row_stride returns row stride in bytes @@ -441,6 +418,7 @@ intel_miptree_image_map(struct intel_context * intel, GLuint level, GLuint * row_stride, GLuint * image_offsets) { + GLuint x, y; DBG("%s \n", __FUNCTION__); if (row_stride) @@ -449,17 +427,23 @@ intel_miptree_image_map(struct intel_context * intel, if (mt->target == GL_TEXTURE_3D) { int i; - for (i = 0; i < mt->level[level].depth; i++) - image_offsets[i] = mt->level[level].image_offset[i] / mt->cpp; + for (i = 0; i < mt->level[level].depth; i++) { + + intel_miptree_get_image_offset(mt, level, face, i, + &x, &y); + image_offsets[i] = x + y * mt->pitch; + } + + return intel_region_map(intel, mt->region); } else { assert(mt->level[level].depth == 1); - assert(mt->target == GL_TEXTURE_CUBE_MAP || - mt->level[level].image_offset[0] == 0); + intel_miptree_get_image_offset(mt, level, face, 0, + &x, &y); image_offsets[0] = 0; - } - return (intel_region_map(intel, mt->region) + - intel_miptree_image_offset(mt, face, level)); + return intel_region_map(intel, mt->region) + + (x + y * mt->pitch) * mt->cpp; + } } void @@ -484,20 +468,19 @@ intel_miptree_image_data(struct intel_context *intel, GLuint src_image_pitch) { GLuint depth = dst->level[level].depth; - GLuint dst_offset = intel_miptree_image_offset(dst, face, level); - const GLuint *dst_depth_offset = intel_miptree_depth_offsets(dst, level); GLuint i; - GLuint height = 0; DBG("%s: %d/%d\n", __FUNCTION__, face, level); for (i = 0; i < depth; i++) { + GLuint dst_x, dst_y, height; + + intel_miptree_get_image_offset(dst, level, face, i, &dst_x, &dst_y); + height = dst->level[level].height; if(dst->compressed) height = (height + 3) / 4; intel_region_data(intel, - dst->region, - dst_offset + dst_depth_offset[i], /* dst_offset */ - 0, 0, /* dstx, dsty */ + dst->region, 0, dst_x, dst_y, src, src_row_pitch, 0, 0, /* source x, y */ @@ -519,10 +502,7 @@ intel_miptree_image_copy(struct intel_context *intel, GLuint width = src->level[level].width; GLuint height = src->level[level].height; GLuint depth = src->level[level].depth; - GLuint dst_offset = intel_miptree_image_offset(dst, face, level); - GLuint src_offset = intel_miptree_image_offset(src, face, level); - const GLuint *dst_depth_offset = intel_miptree_depth_offsets(dst, level); - const GLuint *src_depth_offset = intel_miptree_depth_offsets(src, level); + GLuint src_x, src_y, dst_x, dst_y; GLuint i; GLboolean success; @@ -535,22 +515,23 @@ intel_miptree_image_copy(struct intel_context *intel, } for (i = 0; i < depth; i++) { + intel_miptree_get_image_offset(src, level, face, i, &src_x, &src_y); + intel_miptree_get_image_offset(dst, level, face, i, &dst_x, &dst_y); success = intel_region_copy(intel, - dst->region, dst_offset + dst_depth_offset[i], - 0, 0, - src->region, src_offset + src_depth_offset[i], - 0, 0, width, height, GL_COPY); + dst->region, 0, dst_x, dst_y, + src->region, 0, src_x, src_y, width, height, + GL_COPY); if (!success) { GLubyte *src_ptr, *dst_ptr; src_ptr = intel_region_map(intel, src->region); dst_ptr = intel_region_map(intel, dst->region); - _mesa_copy_rect(dst_ptr + dst_offset + dst_depth_offset[i], + _mesa_copy_rect(dst_ptr + dst->cpp * (dst_x + dst_y * dst->pitch), dst->cpp, dst->pitch, 0, 0, width, height, - src_ptr + src_offset + src_depth_offset[i], + src_ptr + src->cpp * (src_x + src_y * src->pitch), src->pitch, 0, 0); intel_region_unmap(intel, src->region); diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h index c890b2a0d0..3bce54daa1 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h @@ -70,6 +70,10 @@ struct intel_mipmap_level * always zero in that case. */ GLuint level_offset; + /** Offset to this miptree level, used in computing x_offset. */ + GLuint level_x; + /** Offset to this miptree level, used in computing y_offset. */ + GLuint level_y; GLuint width; GLuint height; /** Depth of the mipmap at this level: 1 for 1D/2D/CUBE, n for 3D. */ @@ -86,7 +90,7 @@ struct intel_mipmap_level * compute the offsets of depth/cube images within a mipmap level, * so have to store them as a lookup table. */ - GLuint *image_offset; + GLuint *x_offset, *y_offset; }; struct intel_mipmap_tree @@ -176,19 +180,10 @@ GLubyte *intel_miptree_image_map(struct intel_context *intel, void intel_miptree_image_unmap(struct intel_context *intel, struct intel_mipmap_tree *mt); - -/* Return the linear offset of an image relative to the start of the - * tree: - */ -GLuint intel_miptree_image_offset(struct intel_mipmap_tree *mt, - GLuint face, GLuint level); - -/* Return pointers to each 2d slice within an image. Indexed by depth - * value. - */ -const GLuint *intel_miptree_depth_offsets(struct intel_mipmap_tree *mt, - GLuint level); - +void +intel_miptree_get_image_offset(struct intel_mipmap_tree *mt, + GLuint level, GLuint face, GLuint depth, + GLuint *x, GLuint *y); void intel_miptree_set_level_info(struct intel_mipmap_tree *mt, GLuint level, @@ -196,16 +191,10 @@ void intel_miptree_set_level_info(struct intel_mipmap_tree *mt, GLuint x, GLuint y, GLuint w, GLuint h, GLuint d); -void intel_miptree_set_image_offset_ex(struct intel_mipmap_tree *mt, - GLuint level, - GLuint img, GLuint x, GLuint y, - GLuint offset); - void intel_miptree_set_image_offset(struct intel_mipmap_tree *mt, GLuint level, GLuint img, GLuint x, GLuint y); - /* Upload an image into a tree */ void intel_miptree_image_data(struct intel_context *intel, diff --git a/src/mesa/drivers/dri/intel/intel_regions.h b/src/mesa/drivers/dri/intel/intel_regions.h index 0d379bdc6e..535fcd7be0 100644 --- a/src/mesa/drivers/dri/intel/intel_regions.h +++ b/src/mesa/drivers/dri/intel/intel_regions.h @@ -62,6 +62,8 @@ struct intel_region GLuint map_refcount; /**< Reference count for mapping */ GLuint draw_offset; /**< Offset of drawing address within the region */ + GLuint draw_x, draw_y; /**< Offset of drawing within the region */ + uint32_t tiling; /**< Which tiling mode the region is in */ uint32_t bit_6_swizzle; /**< GEM flag for address swizzling requirement */ drmAddress classic_map; /**< drmMap of the region when not in GEM mode */ diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c index b241c11625..9d58b11b14 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_copy.c +++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c @@ -115,20 +115,22 @@ do_copy_texsubimage(struct intel_context *intel, drm_intel_bo *dst_bo = intel_region_buffer(intel, intelImage->mt->region, INTEL_WRITE_PART); - GLuint image_offset = intel_miptree_image_offset(intelImage->mt, - intelImage->face, - intelImage->level); const GLint orig_x = x; const GLint orig_y = y; + GLuint image_x, image_y; GLshort src_pitch; + intel_miptree_get_image_offset(intelImage->mt, + intelImage->level, + intelImage->face, + 0, + &image_x, &image_y); /* Update dst for clipped src. Need to also clip the source rect. */ dstx += x - orig_x; dsty += y - orig_y; /* Can't blit to tiled buffers with non-tile-aligned offset. */ - if (intelImage->mt->region->tiling != I915_TILING_NONE && - (image_offset & 4095) != 0) { + if (intelImage->mt->region->tiling == I915_TILING_Y) { UNLOCK_HARDWARE(intel); return GL_FALSE; } @@ -160,9 +162,10 @@ do_copy_texsubimage(struct intel_context *intel, src->tiling, intelImage->mt->pitch, dst_bo, - image_offset, + 0, intelImage->mt->region->tiling, - x, y, dstx, dsty, width, height, + x, y, image_x + dstx, image_y + dsty, + width, height, GL_COPY)) { UNLOCK_HARDWARE(intel); return GL_FALSE; diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index c5f5220837..2e0945c365 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -204,7 +204,7 @@ try_pbo_upload(struct intel_context *intel, { struct intel_buffer_object *pbo = intel_buffer_object(unpack->BufferObj); GLuint src_offset, src_stride; - GLuint dst_offset, dst_stride; + GLuint dst_x, dst_y, dst_stride; if (unpack->BufferObj->Name == 0 || intel->ctx._ImageTransferState || @@ -221,9 +221,9 @@ try_pbo_upload(struct intel_context *intel, else src_stride = width; - dst_offset = intel_miptree_image_offset(intelImage->mt, - intelImage->face, - intelImage->level); + intel_miptree_get_image_offset(intelImage->mt, intelImage->level, + intelImage->face, 0, + &dst_x, &dst_y); dst_stride = intelImage->mt->pitch; @@ -239,8 +239,8 @@ try_pbo_upload(struct intel_context *intel, if (!intelEmitCopyBlit(intel, intelImage->mt->cpp, src_stride, src_buffer, src_offset, GL_FALSE, - dst_stride, dst_buffer, dst_offset, GL_FALSE, - 0, 0, 0, 0, width, height, + dst_stride, dst_buffer, 0, GL_FALSE, + 0, 0, dst_x, dst_y, width, height, GL_COPY)) { UNLOCK_HARDWARE(intel); return GL_FALSE; @@ -262,7 +262,7 @@ try_pbo_zcopy(struct intel_context *intel, { struct intel_buffer_object *pbo = intel_buffer_object(unpack->BufferObj); GLuint src_offset, src_stride; - GLuint dst_offset, dst_stride; + GLuint dst_x, dst_y, dst_stride; if (unpack->BufferObj->Name == 0 || intel->ctx._ImageTransferState || @@ -279,13 +279,14 @@ try_pbo_zcopy(struct intel_context *intel, else src_stride = width; - dst_offset = intel_miptree_image_offset(intelImage->mt, - intelImage->face, - intelImage->level); + intel_miptree_get_image_offset(intelImage->mt, intelImage->level, + intelImage->face, 0, + &dst_x, &dst_y); dst_stride = intelImage->mt->pitch; - if (src_stride != dst_stride || dst_offset != 0 || src_offset != 0) { + if (src_stride != dst_stride || dst_x != 0 || dst_y != 0 || + src_offset != 0) { DBG("%s: failure 2\n", __FUNCTION__); return GL_FALSE; } -- cgit v1.2.3 From bfd51dc34d45ba584683c70b1f854a513d9104d3 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 7 Jul 2009 19:33:55 -0700 Subject: i965: Annotate _NEW_COLOR dependency for brw_update_renderbuffer_surface(). --- src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index f7cc5153a8..1dd8a0728a 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -564,6 +564,7 @@ brw_update_renderbuffer_surface(struct brw_context *brw, key.cpp = 4; key.draw_offset = 0; } + /* _NEW_COLOR */ memcpy(key.color_mask, ctx->Color.ColorMask, sizeof(key.color_mask)); key.color_blend = (!ctx->Color._LogicOpEnabled && @@ -696,7 +697,7 @@ static void prepare_wm_surfaces(struct brw_context *brw ) GLuint i; int old_nr_surfaces; - /* _NEW_BUFFERS */ + /* _NEW_BUFFERS | _NEW_COLOR */ /* Update surfaces for drawing buffers */ if (ctx->DrawBuffer->_NumColorDrawBuffers >= 1) { for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers; i++) { -- cgit v1.2.3 From 0acb057ad16264b976b00aa7c6ecf285ca8c19e7 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Oct 2009 16:36:15 -0600 Subject: mesa: fix broken _mesa_str_checksum() --- src/mesa/main/imports.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 30fa55997e..91d8d156b8 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -934,9 +934,9 @@ _mesa_str_checksum(const char *str) unsigned int sum, i; const char *c; sum = i = 1; - for (c = str; *c; c++) + for (c = str; *c; c++, i++) sum += *c * (i % 100); - return sum; + return sum + i; } -- cgit v1.2.3 From dc8b139aa23899b00baa919fd7f46c74bf4ef205 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Oct 2009 18:21:59 -0600 Subject: mesa: remove FBO texture depth/stencil test The texture format should not be checked until validation time since the format might be changed by a subsequent glTexImage() call. --- src/mesa/main/fbobject.c | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 825a23090b..ed1db0feca 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1511,18 +1511,6 @@ framebuffer_texture(GLcontext *ctx, const char *caller, GLenum target, return; } - if (texObj && attachment == GL_DEPTH_STENCIL_ATTACHMENT) { - /* the texture format must be depth+stencil */ - const struct gl_texture_image *texImg; - texImg = texObj->Image[0][texObj->BaseLevel]; - if (!texImg || texImg->_BaseFormat != GL_DEPTH_STENCIL) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferTexture%sEXT(texture is not" - " DEPTH_STENCIL format)", caller); - return; - } - } - FLUSH_CURRENT(ctx, _NEW_BUFFERS); /* The above doesn't fully flush the drivers in the way that a * glFlush does, but that is required here: -- cgit v1.2.3 From 9b50ceac03975e75940713313363df1bdd5c19dc Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Oct 2009 11:34:14 -0600 Subject: mesa: more detailed error messages in fbo code --- src/mesa/main/fbobject.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 87061aeb0d..18f6cec91e 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -34,6 +34,7 @@ #include "buffers.h" #include "context.h" +#include "enums.h" #include "fbobject.h" #include "framebuffer.h" #include "hash.h" @@ -1665,7 +1666,8 @@ _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment, att = _mesa_get_attachment(ctx, fb, attachment); if (att == NULL) { _mesa_error(ctx, GL_INVALID_ENUM, - "glFramebufferRenderbufferEXT(attachment)"); + "glFramebufferRenderbufferEXT(invalid attachment %s)", + _mesa_lookup_enum_by_nr(attachment)); return; } @@ -1673,7 +1675,8 @@ _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment, rb = _mesa_lookup_renderbuffer(ctx, renderbuffer); if (!rb) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferRenderbufferEXT(renderbuffer)"); + "glFramebufferRenderbufferEXT(non-existant" + " renderbuffer %u)", renderbuffer); return; } } -- cgit v1.2.3 From d66965c9a1e932444c2538b4221df07fea4c557f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Oct 2009 13:06:13 -0600 Subject: mesa: remove misplaced VERBOSE_TEXTURE tests --- src/mesa/main/blend.c | 6 +++--- src/mesa/main/depth.c | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c index 39cf6153e2..830e3b2e51 100644 --- a/src/mesa/main/blend.c +++ b/src/mesa/main/blend.c @@ -72,7 +72,7 @@ _mesa_BlendFuncSeparateEXT( GLenum sfactorRGB, GLenum dfactorRGB, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(ctx, "glBlendFuncSeparate %s %s %s %s\n", _mesa_lookup_enum_by_nr(sfactorRGB), _mesa_lookup_enum_by_nr(dfactorRGB), @@ -250,7 +250,7 @@ _mesa_BlendEquation( GLenum mode ) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(ctx, "glBlendEquation %s\n", _mesa_lookup_enum_by_nr(mode)); @@ -278,7 +278,7 @@ _mesa_BlendEquationSeparateEXT( GLenum modeRGB, GLenum modeA ) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(ctx, "glBlendEquationSeparateEXT %s %s\n", _mesa_lookup_enum_by_nr(modeRGB), _mesa_lookup_enum_by_nr(modeA)); diff --git a/src/mesa/main/depth.c b/src/mesa/main/depth.c index 91c036ef96..f187205b97 100644 --- a/src/mesa/main/depth.c +++ b/src/mesa/main/depth.c @@ -63,7 +63,7 @@ _mesa_DepthFunc( GLenum func ) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(ctx, "glDepthFunc %s\n", _mesa_lookup_enum_by_nr(func)); switch (func) { @@ -99,7 +99,7 @@ _mesa_DepthMask( GLboolean flag ) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) + if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(ctx, "glDepthMask %d\n", flag); /* -- cgit v1.2.3 From 81a4d34f07d95e6a4bf6ab105efbee4fed116e55 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Oct 2009 13:20:03 -0600 Subject: mesa: rework error checking code for glGetCompressedTexImage() Do all error checking in new getcompressedteximage_error_check() func. Move some additional PBO checks out of the driver fallbacks into the error checking functions. --- src/mesa/main/texgetimage.c | 170 +++++++++++++++++++++++++++++++------------- 1 file changed, 122 insertions(+), 48 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index 14d6fc7659..2520019923 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 7.5 + * Version: 7.7 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * Copyright (c) 2009 VMware, Inc. @@ -31,6 +31,7 @@ #include "glheader.h" #include "bufferobj.h" +#include "enums.h" #include "context.h" #include "image.h" #include "texcompress.h" @@ -130,9 +131,10 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, ctx->Driver.MapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, GL_WRITE_ONLY_ARB, ctx->Pack.BufferObj); if (!buf) { - /* buffer is already mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION,"glGetTexImage(PBO is mapped)"); + /* out of memory or other unexpected error */ + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGetTexImage(map PBO failed)"); return; + } /* was an offset into the PBO. * Now make it a real, client-side pointer inside the mapped region. @@ -321,20 +323,13 @@ _mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level, if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { /* pack texture image into a PBO */ - GLubyte *buf; - if ((const GLubyte *) img + texImage->CompressedSize > - (const GLubyte *) ctx->Pack.BufferObj->Size) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetCompressedTexImage(invalid PBO access)"); - return; - } - buf = (GLubyte *) ctx->Driver.MapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, - GL_WRITE_ONLY_ARB, - ctx->Pack.BufferObj); + GLubyte *buf = (GLubyte *) + ctx->Driver.MapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, + GL_WRITE_ONLY_ARB, ctx->Pack.BufferObj); if (!buf) { - /* buffer is already mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetCompressedTexImage(PBO is mapped)"); + /* out of memory or other unexpected error */ + _mesa_error(ctx, GL_OUT_OF_MEMORY, + "glGetCompresssedTexImage(map PBO failed)"); return; } img = ADD_POINTERS(buf, img); @@ -479,7 +474,14 @@ getteximage_error_check(GLcontext *ctx, GLenum target, GLint level, texImage->Height, texImage->Depth, format, type, pixels)) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetTexImage(invalid PBO access)"); + "glGetTexImage(out of bounds PBO write)"); + return GL_TRUE; + } + + /* PBO should not be mapped */ + if (_mesa_bufferobj_mapped(ctx->Pack.BufferObj)) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetTexImage(PBO is mapped)"); return GL_TRUE; } } @@ -514,6 +516,17 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format, texUnit = _mesa_get_current_tex_unit(ctx); texObj = _mesa_select_tex_object(ctx, texUnit, target); + if (MESA_VERBOSE & (VERBOSE_API | VERBOSE_TEXTURE)) { + struct gl_texture_image *texImage = + _mesa_select_tex_image(ctx, texObj, target, level); + _mesa_debug(ctx, "glGetTexImage(tex %u) format = %d, w=%d, h=%d," + " dstFmt=0x%x, dstType=0x%x\n", + texObj->Name, + texImage->TexFormat->MesaFormat, + texImage->Width, texImage->Height, + format, type); + } + _mesa_lock_texture(ctx, texObj); { struct gl_texture_image *texImage = @@ -527,55 +540,116 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format, } -void GLAPIENTRY -_mesa_GetCompressedTexImageARB(GLenum target, GLint level, GLvoid *img) + +/** + * Do error checking for a glGetCompressedTexImage() call. + * \return GL_TRUE if any error, GL_FALSE if no errors. + */ +static GLboolean +getcompressedteximage_error_check(GLcontext *ctx, GLenum target, GLint level, + GLvoid *img) { const struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; - GLint maxLevels; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + const GLuint maxLevels = _mesa_max_texture_levels(ctx, target); + + if (maxLevels == 0) { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetCompressedTexImage(target=0x%x)", + target); + return GL_TRUE; + } + + if (level < 0 || level >= maxLevels) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glGetCompressedTexImageARB(bad level = %d)", level); + return GL_TRUE; + } + + if (_mesa_is_proxy_texture(target)) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glGetCompressedTexImageARB(bad target = %s)", + _mesa_lookup_enum_by_nr(target)); + return GL_TRUE; + } texUnit = _mesa_get_current_tex_unit(ctx); texObj = _mesa_select_tex_object(ctx, texUnit, target); + if (!texObj) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetCompressedTexImageARB"); - return; + _mesa_error(ctx, GL_INVALID_ENUM, "glGetCompressedTexImageARB(target)"); + return GL_TRUE; + } + + texImage = _mesa_select_tex_image(ctx, texObj, target, level); + + if (!texImage) { + /* probably invalid mipmap level */ + _mesa_error(ctx, GL_INVALID_VALUE, + "glGetCompressedTexImageARB(level)"); + return GL_TRUE; } - maxLevels = _mesa_max_texture_levels(ctx, target); - ASSERT(maxLevels > 0); /* 0 indicates bad target, caught above */ + if (!texImage->IsCompressed) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetCompressedTexImageARB(texture is not compressed)"); + return GL_TRUE; + } - if (level < 0 || level >= maxLevels) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetCompressedTexImageARB(level)"); - return; + if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { + /* make sure PBO is not mapped */ + if (_mesa_bufferobj_mapped(ctx->Pack.BufferObj)) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetCompressedTexImage(PBO is mapped)"); + return GL_TRUE; + } + + /* do bounds checking on PBO write */ + if ((const GLubyte *) img + texImage->CompressedSize > + (const GLubyte *) ctx->Pack.BufferObj->Size) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glGetCompressedTexImage(out of bounds PBO write)"); + return GL_TRUE; + } } - if (_mesa_is_proxy_texture(target)) { - _mesa_error(ctx, GL_INVALID_ENUM, "glGetCompressedTexImageARB(target)"); + return GL_FALSE; +} + + +void GLAPIENTRY +_mesa_GetCompressedTexImageARB(GLenum target, GLint level, GLvoid *img) +{ + const struct gl_texture_unit *texUnit; + struct gl_texture_object *texObj; + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + + if (getcompressedteximage_error_check(ctx, target, level, img)) { return; } + texUnit = _mesa_get_current_tex_unit(ctx); + texObj = _mesa_select_tex_object(ctx, texUnit, target); + + if (MESA_VERBOSE & (VERBOSE_API | VERBOSE_TEXTURE)) { + struct gl_texture_image *texImage = + _mesa_select_tex_image(ctx, texObj, target, level); + _mesa_debug(ctx, + "glGetCompressedTexImage(tex %u) format = %d, w=%d, h=%d\n", + texObj->Name, + texImage->TexFormat->MesaFormat, + texImage->Width, texImage->Height); + } + _mesa_lock_texture(ctx, texObj); { - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - if (texImage) { - if (texImage->IsCompressed) { - /* this typically calls _mesa_get_compressed_teximage() */ - ctx->Driver.GetCompressedTexImage(ctx, target, level, img, - texObj, texImage); - } - else { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetCompressedTexImageARB"); - } - } - else { - /* probably invalid mipmap level */ - _mesa_error(ctx, GL_INVALID_VALUE, - "glGetCompressedTexImageARB(level)"); - } + struct gl_texture_image *texImage = + _mesa_select_tex_image(ctx, texObj, target, level); + + /* this typically calls _mesa_get_compressed_teximage() */ + ctx->Driver.GetCompressedTexImage(ctx, target, level, img, + texObj, texImage); } _mesa_unlock_texture(ctx, texObj); } -- cgit v1.2.3 From 346250b190b023b6fbd2bde5ce3ad94a8d544e20 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Oct 2009 16:31:48 -0600 Subject: mesa: refactor, new print_shader_info() --- src/mesa/shader/shader_api.c | 61 ++++++++++++++++++++++++++------------------ 1 file changed, 36 insertions(+), 25 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index f473bd1173..30fa58ea52 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -1498,6 +1498,41 @@ _mesa_link_program(GLcontext *ctx, GLuint program) } +/** + * Print basic shader info (for debug). + */ +static void +print_shader_info(const struct gl_shader_program *shProg) +{ + GLuint i; + + _mesa_printf("Mesa: glUseProgram(%u)\n", shProg->Name); + for (i = 0; i < shProg->NumShaders; i++) { + const char *s; + switch (shProg->Shaders[i]->Type) { + case GL_VERTEX_SHADER: + s = "vertex"; + break; + case GL_FRAGMENT_SHADER: + s = "fragment"; + break; + case GL_GEOMETRY_SHADER: + s = "geometry"; + break; + default: + s = ""; + } + _mesa_printf(" %s shader %u, checksum %u\n", s, + shProg->Shaders[i]->Name, + shProg->Shaders[i]->SourceChecksum); + } + if (shProg->VertexProgram) + _mesa_printf(" vert prog %u\n", shProg->VertexProgram->Base.Id); + if (shProg->FragmentProgram) + _mesa_printf(" frag prog %u\n", shProg->FragmentProgram->Base.Id); +} + + /** * Called via ctx->Driver.UseProgram() */ @@ -1527,31 +1562,7 @@ _mesa_use_program(GLcontext *ctx, GLuint program) /* debug code */ if (ctx->Shader.Flags & GLSL_USE_PROG) { - GLuint i; - _mesa_printf("Mesa: glUseProgram(%u)\n", shProg->Name); - for (i = 0; i < shProg->NumShaders; i++) { - const char *s; - switch (shProg->Shaders[i]->Type) { - case GL_VERTEX_SHADER: - s = "vertex"; - break; - case GL_FRAGMENT_SHADER: - s = "fragment"; - break; - case GL_GEOMETRY_SHADER: - s = "geometry"; - break; - default: - s = ""; - } - _mesa_printf(" %s shader %u, checksum %u\n", s, - shProg->Shaders[i]->Name, - shProg->Shaders[i]->SourceChecksum); - } - if (shProg->VertexProgram) - _mesa_printf(" vert prog %u\n", shProg->VertexProgram->Base.Id); - if (shProg->FragmentProgram) - _mesa_printf(" frag prog %u\n", shProg->FragmentProgram->Base.Id); + print_shader_info(shProg); } } else { -- cgit v1.2.3 From 26f1ad65b988fe55ae12a99994e4c63aaab899a0 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 23 Oct 2009 18:15:55 -0600 Subject: mesa: simplify att->CubeMapFace assignment --- src/mesa/main/fbobject.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 18f6cec91e..85d3d3db99 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -240,12 +240,7 @@ _mesa_set_texture_attachment(GLcontext *ctx, /* always update these fields */ att->TextureLevel = level; - if (IS_CUBE_FACE(texTarget)) { - att->CubeMapFace = texTarget - GL_TEXTURE_CUBE_MAP_POSITIVE_X; - } - else { - att->CubeMapFace = 0; - } + att->CubeMapFace = _mesa_tex_target_to_face(texTarget); att->Zoffset = zoffset; att->Complete = GL_FALSE; -- cgit v1.2.3 From eb732b1bbb4e4bdd018ee9a1653a62fd8dce2d55 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 24 Oct 2009 08:41:08 -0600 Subject: mesa: additional comments in format code --- src/mesa/main/formats.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index 45ac39a818..d6a1ec81b6 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -39,7 +39,8 @@ struct gl_format_info /** * Base format is one of GL_RGB, GL_RGBA, GL_ALPHA, GL_LUMINANCE, - * GL_LUMINANCE_ALPHA, GL_INTENSITY, GL_COLOR_INDEX, GL_DEPTH_COMPONENT. + * GL_LUMINANCE_ALPHA, GL_INTENSITY, GL_YCBCR_MESA, GL_COLOR_INDEX, + * GL_DEPTH_COMPONENT, GL_STENCIL_INDEX, GL_DEPTH_STENCIL. */ GLenum BaseFormat; @@ -577,6 +578,11 @@ _mesa_get_format_info(gl_format format) } +/** + * Return bytes needed to store a block of pixels in the given format. + * Normally, a block is 1x1 (a single pixel). But for compressed formats + * a block may be 4x4 or 8x4, etc. + */ GLuint _mesa_get_format_bytes(gl_format format) { @@ -586,6 +592,11 @@ _mesa_get_format_bytes(gl_format format) } +/** + * Return bits per component for the given format. + * \param format one of MESA_FORMAT_x + * \param pname the component, such as GL_RED_BITS, GL_TEXTURE_BLUE_BITS, etc. + */ GLint _mesa_get_format_bits(gl_format format, GLenum pname) { @@ -636,6 +647,15 @@ _mesa_get_format_bits(gl_format format, GLenum pname) } +/** + * Return the data type (or more specifically, the data representation) + * for the given format. + * The return value will be one of: + * GL_UNSIGNED_NORMALIZED = unsigned int representing [0,1] + * GL_SIGNED_NORMALIZED = signed int representing [-1, 1] + * GL_UNSIGNED_INT = an ordinary unsigned integer + * GL_FLOAT = an ordinary float + */ GLenum _mesa_get_format_datatype(gl_format format) { @@ -644,6 +664,12 @@ _mesa_get_format_datatype(gl_format format) } +/** + * Return the basic format for the given type. The result will be + * one of GL_RGB, GL_RGBA, GL_ALPHA, GL_LUMINANCE, GL_LUMINANCE_ALPHA, + * GL_INTENSITY, GL_YCBCR_MESA, GL_COLOR_INDEX, GL_DEPTH_COMPONENT, + * GL_STENCIL_INDEX, GL_DEPTH_STENCIL. + */ GLenum _mesa_get_format_base_format(gl_format format) { @@ -652,6 +678,7 @@ _mesa_get_format_base_format(gl_format format) } +/** Is the given format a compressed format? */ GLboolean _mesa_is_format_compressed(gl_format format) { -- cgit v1.2.3 From bee6794eb126bc8af87726a2456d0ebc36eb721d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 24 Oct 2009 08:43:16 -0600 Subject: mesa: added _mesa_get_format_name() --- src/mesa/main/formats.c | 75 +++++++++++++++++++++++++++++++++++++++++++++++++ src/mesa/main/formats.h | 3 ++ 2 files changed, 78 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index d6a1ec81b6..773a8f70b3 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -37,6 +37,9 @@ struct gl_format_info { gl_format Name; + /** text name for debugging */ + const char *StrName; + /** * Base format is one of GL_RGB, GL_RGBA, GL_ALPHA, GL_LUMINANCE, * GL_LUMINANCE_ALPHA, GL_INTENSITY, GL_YCBCR_MESA, GL_COLOR_INDEX, @@ -77,6 +80,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = { { MESA_FORMAT_NONE, /* Name */ + "MESA_FORMAT_NONE", /* StrName */ GL_NONE, /* BaseFormat */ GL_NONE, /* DataType */ 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ @@ -85,6 +89,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_RGBA8888, /* Name */ + "MESA_FORMAT_RGBA8888", /* StrName */ GL_RGBA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 8, 8, 8, 8, /* Red/Green/Blue/AlphaBits */ @@ -93,6 +98,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_RGBA8888_REV, /* Name */ + "MESA_FORMAT_RGBA8888_REV", /* StrName */ GL_RGBA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 8, 8, 8, 8, /* Red/Green/Blue/AlphaBits */ @@ -101,6 +107,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_ARGB8888, /* Name */ + "MESA_FORMAT_ARGB8888", /* StrName */ GL_RGBA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 8, 8, 8, 8, /* Red/Green/Blue/AlphaBits */ @@ -109,6 +116,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_ARGB8888_REV, /* Name */ + "MESA_FORMAT_ARGB8888_REV", /* StrName */ GL_RGBA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 8, 8, 8, 8, /* Red/Green/Blue/AlphaBits */ @@ -117,6 +125,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_XRGB8888, /* Name */ + "MESA_FORMAT_XRGB8888", /* StrName */ GL_RGB, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */ @@ -125,6 +134,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_RGB888, /* Name */ + "MESA_FORMAT_RGB888", /* StrName */ GL_RGB, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */ @@ -133,6 +143,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_BGR888, /* Name */ + "MESA_FORMAT_BGR888", /* StrName */ GL_RGB, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */ @@ -141,6 +152,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_RGB565, /* Name */ + "MESA_FORMAT_RGB565", /* StrName */ GL_RGB, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 5, 6, 5, 0, /* Red/Green/Blue/AlphaBits */ @@ -149,6 +161,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_RGB565_REV, /* Name */ + "MESA_FORMAT_RGB565_REV", /* StrName */ GL_RGB, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 5, 6, 5, 0, /* Red/Green/Blue/AlphaBits */ @@ -157,6 +170,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_ARGB4444, /* Name */ + "MESA_FORMAT_ARGB4444", /* StrName */ GL_RGBA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 4, 4, 4, 4, /* Red/Green/Blue/AlphaBits */ @@ -165,6 +179,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_ARGB4444_REV, /* Name */ + "MESA_FORMAT_ARGB4444_REV", /* StrName */ GL_RGBA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 4, 4, 4, 4, /* Red/Green/Blue/AlphaBits */ @@ -173,6 +188,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_RGBA5551, /* Name */ + "MESA_FORMAT_RGBA5551", /* StrName */ GL_RGBA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 5, 5, 5, 1, /* Red/Green/Blue/AlphaBits */ @@ -181,6 +197,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_ARGB1555, /* Name */ + "MESA_FORMAT_ARGB1555", /* StrName */ GL_RGBA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 5, 5, 5, 1, /* Red/Green/Blue/AlphaBits */ @@ -189,6 +206,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_ARGB1555_REV, /* Name */ + "MESA_FORMAT_ARGB1555_REV", /* StrName */ GL_RGBA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 5, 5, 5, 1, /* Red/Green/Blue/AlphaBits */ @@ -197,6 +215,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_AL88, /* Name */ + "MESA_FORMAT_AL88", /* StrName */ GL_LUMINANCE_ALPHA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 0, 0, 0, 8, /* Red/Green/Blue/AlphaBits */ @@ -205,6 +224,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_AL88_REV, /* Name */ + "MESA_FORMAT_AL88_REV", /* StrName */ GL_LUMINANCE_ALPHA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 0, 0, 0, 8, /* Red/Green/Blue/AlphaBits */ @@ -213,6 +233,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_RGB332, /* Name */ + "MESA_FORMAT_RGB332", /* StrName */ GL_RGB, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 3, 3, 2, 0, /* Red/Green/Blue/AlphaBits */ @@ -221,6 +242,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_A8, /* Name */ + "MESA_FORMAT_A8", /* StrName */ GL_ALPHA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 0, 0, 0, 8, /* Red/Green/Blue/AlphaBits */ @@ -229,6 +251,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_L8, /* Name */ + "MESA_FORMAT_L8", /* StrName */ GL_LUMINANCE, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ @@ -237,6 +260,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_I8, /* Name */ + "MESA_FORMAT_I8", /* StrName */ GL_INTENSITY, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ @@ -245,6 +269,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_CI8, /* Name */ + "MESA_FORMAT_CI8", /* StrName */ GL_COLOR_INDEX, /* BaseFormat */ GL_UNSIGNED_INT, /* DataType */ 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ @@ -253,6 +278,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_YCBCR, /* Name */ + "MESA_FORMAT_YCBCR", /* StrName */ GL_YCBCR_MESA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ @@ -261,6 +287,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_YCBCR_REV, /* Name */ + "MESA_FORMAT_YCBCR_REV", /* StrName */ GL_YCBCR_MESA, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ @@ -269,6 +296,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_Z24_S8, /* Name */ + "MESA_FORMAT_Z24_S8", /* StrName */ GL_DEPTH_STENCIL, /* BaseFormat */ GL_UNSIGNED_INT, /* DataType */ 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ @@ -277,6 +305,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_S8_Z24, /* Name */ + "MESA_FORMAT_S8_Z24", /* StrName */ GL_DEPTH_STENCIL, /* BaseFormat */ GL_UNSIGNED_INT, /* DataType */ 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ @@ -285,6 +314,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_Z16, /* Name */ + "MESA_FORMAT_Z16", /* StrName */ GL_DEPTH_COMPONENT, /* BaseFormat */ GL_UNSIGNED_INT, /* DataType */ 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ @@ -293,6 +323,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_X8_Z24, /* Name */ + "MESA_FORMAT_X8_Z24", /* StrName */ GL_DEPTH_COMPONENT, /* BaseFormat */ GL_UNSIGNED_INT, /* DataType */ 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ @@ -301,6 +332,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_Z32, /* Name */ + "MESA_FORMAT_Z32", /* StrName */ GL_DEPTH_COMPONENT, /* BaseFormat */ GL_UNSIGNED_INT, /* DataType */ 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ @@ -309,6 +341,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_S8, /* Name */ + "MESA_FORMAT_S8", /* StrName */ GL_STENCIL_INDEX, /* BaseFormat */ GL_UNSIGNED_INT, /* DataType */ 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ @@ -317,6 +350,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_SRGB8, + "MESA_FORMAT_SRGB8", GL_RGB, GL_UNSIGNED_NORMALIZED, 8, 8, 8, 0, @@ -325,6 +359,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_SRGBA8, + "MESA_FORMAT_SRGBA8", GL_RGBA, GL_UNSIGNED_NORMALIZED, 8, 8, 8, 8, @@ -333,6 +368,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_SARGB8, + "MESA_FORMAT_SARGB8", GL_RGBA, GL_UNSIGNED_NORMALIZED, 8, 8, 8, 8, @@ -341,6 +377,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_SL8, + "MESA_FORMAT_SL8", GL_LUMINANCE_ALPHA, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 8, @@ -349,6 +386,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_SLA8, + "MESA_FORMAT_SLA8", GL_LUMINANCE_ALPHA, GL_UNSIGNED_NORMALIZED, 0, 0, 0, 8, @@ -357,6 +395,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_SRGB_DXT1, /* Name */ + "MESA_FORMAT_SRGB_DXT1", /* StrName */ GL_RGB, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 4, 4, 4, 0, /* approx Red/Green/Blue/AlphaBits */ @@ -365,6 +404,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_SRGBA_DXT1, + "MESA_FORMAT_SRGBA_DXT1", GL_RGBA, GL_UNSIGNED_NORMALIZED, 4, 4, 4, 4, @@ -373,6 +413,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_SRGBA_DXT3, + "MESA_FORMAT_SRGBA_DXT3", GL_RGBA, GL_UNSIGNED_NORMALIZED, 4, 4, 4, 4, @@ -381,6 +422,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_SRGBA_DXT5, + "MESA_FORMAT_SRGBA_DXT5", GL_RGBA, GL_UNSIGNED_NORMALIZED, 4, 4, 4, 4, @@ -390,6 +432,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = { MESA_FORMAT_RGB_FXT1, + "MESA_FORMAT_RGB_FXT1", GL_RGB, GL_UNSIGNED_NORMALIZED, 8, 8, 8, 0, @@ -398,6 +441,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_RGBA_FXT1, + "MESA_FORMAT_RGBA_FXT1", GL_RGBA, GL_UNSIGNED_NORMALIZED, 8, 8, 8, 8, @@ -407,6 +451,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = { MESA_FORMAT_RGB_DXT1, /* Name */ + "MESA_FORMAT_RGB_DXT1", /* StrName */ GL_RGB, /* BaseFormat */ GL_UNSIGNED_NORMALIZED, /* DataType */ 4, 4, 4, 0, /* approx Red/Green/Blue/AlphaBits */ @@ -415,6 +460,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_RGBA_DXT1, + "MESA_FORMAT_RGBA_DXT1", GL_RGBA, GL_UNSIGNED_NORMALIZED, 4, 4, 4, 4, @@ -423,6 +469,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_RGBA_DXT3, + "MESA_FORMAT_RGBA_DXT3", GL_RGBA, GL_UNSIGNED_NORMALIZED, 4, 4, 4, 4, @@ -431,6 +478,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_RGBA_DXT5, + "MESA_FORMAT_RGBA_DXT5", GL_RGBA, GL_UNSIGNED_NORMALIZED, 4, 4, 4, 4, @@ -439,6 +487,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_RGBA_FLOAT32, + "MESA_FORMAT_RGBA_FLOAT32", GL_RGBA, GL_FLOAT, 32, 32, 32, 32, @@ -447,6 +496,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_RGBA_FLOAT16, + "MESA_FORMAT_RGBA_FLOAT16", GL_RGBA, GL_FLOAT, 16, 16, 16, 16, @@ -455,6 +505,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_RGB_FLOAT32, + "MESA_FORMAT_RGB_FLOAT32", GL_RGB, GL_FLOAT, 32, 32, 32, 0, @@ -463,6 +514,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_RGB_FLOAT16, + "MESA_FORMAT_RGB_FLOAT16", GL_RGB, GL_FLOAT, 16, 16, 16, 0, @@ -471,6 +523,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_ALPHA_FLOAT32, + "MESA_FORMAT_ALPHA_FLOAT32", GL_ALPHA, GL_FLOAT, 0, 0, 0, 32, @@ -479,6 +532,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_ALPHA_FLOAT16, + "MESA_FORMAT_ALPHA_FLOAT16", GL_ALPHA, GL_FLOAT, 0, 0, 0, 16, @@ -487,6 +541,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_LUMINANCE_FLOAT32, + "MESA_FORMAT_LUMINANCE_FLOAT32", GL_ALPHA, GL_FLOAT, 0, 0, 0, 0, @@ -495,6 +550,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_LUMINANCE_FLOAT16, + "MESA_FORMAT_LUMINANCE_FLOAT16", GL_ALPHA, GL_FLOAT, 0, 0, 0, 0, @@ -503,6 +559,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32, + "MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32", GL_LUMINANCE_ALPHA, GL_FLOAT, 0, 0, 0, 32, @@ -511,6 +568,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16, + "MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16", GL_LUMINANCE_ALPHA, GL_FLOAT, 0, 0, 0, 16, @@ -519,6 +577,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_INTENSITY_FLOAT32, + "MESA_FORMAT_INTENSITY_FLOAT32", GL_INTENSITY, GL_FLOAT, 0, 0, 0, 0, @@ -527,6 +586,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_INTENSITY_FLOAT16, + "MESA_FORMAT_INTENSITY_FLOAT16", GL_INTENSITY, GL_FLOAT, 0, 0, 0, 0, @@ -535,6 +595,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_DUDV8, + "MESA_FORMAT_DUDV8", GL_DUDV_ATI, GL_SIGNED_NORMALIZED, 0, 0, 0, 0, @@ -543,6 +604,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_SIGNED_RGBA8888, + "MESA_FORMAT_SIGNED_RGBA8888", GL_RGBA, GL_SIGNED_NORMALIZED, 8, 8, 8, 8, @@ -551,6 +613,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_SIGNED_RGBA8888_REV, + "MESA_FORMAT_SIGNED_RGBA8888_REV", GL_RGBA, GL_SIGNED_NORMALIZED, 8, 8, 8, 8, @@ -559,6 +622,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = }, { MESA_FORMAT_SIGNED_RGBA_16, + "MESA_FORMAT_SIGNED_RGBA_16", GL_RGBA, GL_SIGNED_NORMALIZED, 16, 16, 16, 16, @@ -578,6 +642,17 @@ _mesa_get_format_info(gl_format format) } +/** Return string name of format (for debugging) */ +const char * +_mesa_get_format_name(gl_format format) +{ + const struct gl_format_info *info = _mesa_get_format_info(format); + ASSERT(info->BytesPerBlock); + return info->StrName; +} + + + /** * Return bytes needed to store a block of pixels in the given format. * Normally, a block is 1x1 (a single pixel). But for compressed formats diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index f8b4a6cdf4..72f1b1e287 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -140,6 +140,9 @@ typedef enum } gl_format; +extern const char * +_mesa_get_format_name(gl_format format); + extern GLuint _mesa_get_format_bytes(gl_format format); -- cgit v1.2.3 From 7b16c43e436715bef9118fdb28ca8a9ad91b1e66 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 24 Oct 2009 11:33:10 -0600 Subject: mesa: added _mesa_get_format_block_size() --- src/mesa/main/formats.c | 16 ++++++++++++++++ src/mesa/main/formats.h | 3 +++ 2 files changed, 19 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index 773a8f70b3..72d043c4c3 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -753,6 +753,22 @@ _mesa_get_format_base_format(gl_format format) } +/** + * Return the block size (in pixels) for the given format. Normally + * the block size is 1x1. But compressed formats will have block sizes + * of 4x4 or 8x4 pixels, etc. + * \param bw returns block width in pixels + * \param bh returns block height in pixels + */ +void +_mesa_get_format_block_size(gl_format format, GLuint *bw, GLuint *bh) +{ + const struct gl_format_info *info = _mesa_get_format_info(format); + *bw = info->BlockWidth; + *bh = info->BlockHeight; +} + + /** Is the given format a compressed format? */ GLboolean _mesa_is_format_compressed(gl_format format) diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index 72f1b1e287..91ea023077 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -155,6 +155,9 @@ _mesa_get_format_datatype(gl_format format); extern GLenum _mesa_get_format_base_format(gl_format format); +extern void +_mesa_get_format_block_size(gl_format format, GLuint *bw, GLuint *bh); + extern GLboolean _mesa_is_format_compressed(gl_format format); -- cgit v1.2.3 From d255aaf54f9a4398247698408bd45698b1cefe58 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 24 Oct 2009 11:33:58 -0600 Subject: mesa: remove hard-coded block sizes --- src/mesa/main/texstore.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index d0d4250352..ff6931156e 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -3670,14 +3670,18 @@ _mesa_store_compressed_texsubimage2d(GLcontext *ctx, GLenum target, GLubyte *dest; const GLubyte *src; const gl_format texFormat = texImage->TexFormat; + GLuint bw, bh; + _mesa_get_format_block_size(texFormat, &bw, &bh); + + (void) level; (void) format; /* these should have been caught sooner */ - ASSERT((width & 3) == 0 || width == 2 || width == 1); - ASSERT((height & 3) == 0 || height == 2 || height == 1); - ASSERT((xoffset & 3) == 0); - ASSERT((yoffset & 3) == 0); + ASSERT((width % bw) == 0 || width == 2 || width == 1); + ASSERT((height % bh) == 0 || height == 2 || height == 1); + ASSERT((xoffset % bw) == 0); + ASSERT((yoffset % bh) == 0); /* get pointer to src pixels (may be in a pbo which we'll map here) */ data = _mesa_validate_pbo_compressed_teximage(ctx, imageSize, data, @@ -3696,7 +3700,7 @@ _mesa_store_compressed_texsubimage2d(GLcontext *ctx, GLenum target, (GLubyte *) texImage->Data); bytesPerRow = srcRowStride; - rows = height / 4; + rows = height / bh; /* rows in blocks */ for (i = 0; i < rows; i++) { MEMCPY(dest, src, bytesPerRow); -- cgit v1.2.3 From 2c3787f5130f79c3adbb9e8e1ace8935c919876f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 24 Oct 2009 11:34:27 -0600 Subject: mesa: move assertion after declaration --- src/mesa/main/depthstencil.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/depthstencil.c b/src/mesa/main/depthstencil.c index 6fefdac1e3..193c7f8255 100644 --- a/src/mesa/main/depthstencil.c +++ b/src/mesa/main/depthstencil.c @@ -329,8 +329,8 @@ put_mono_values_z24(GLcontext *ctx, struct gl_renderbuffer *z24rb, } } else { - assert(dsrb->Format == MESA_FORMAT_S8_Z24); const GLuint shiftedVal = *((GLuint *) value); + assert(dsrb->Format == MESA_FORMAT_S8_Z24); for (i = 0; i < count; i++) { if (!mask || mask[i]) { temp[i] = shiftedVal | (temp[i] & 0xff000000); -- cgit v1.2.3 From 1ad9671db7bd60fa84266f30f46555b4e45bcb08 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 24 Oct 2009 11:41:25 -0600 Subject: mesa: s/GLuint/gl_format/ --- src/mesa/main/texcompress.c | 6 +++--- src/mesa/main/texcompress.h | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c index 5713b2c00d..76f2f232f4 100644 --- a/src/mesa/main/texcompress.c +++ b/src/mesa/main/texcompress.c @@ -131,7 +131,7 @@ _mesa_get_compressed_formats(GLcontext *ctx, GLint *formats, GLboolean all) GLuint _mesa_compressed_texture_size( GLcontext *ctx, GLsizei width, GLsizei height, GLsizei depth, - GLuint mesaFormat ) + gl_format mesaFormat ) { return _mesa_format_image_size(mesaFormat, width, height, depth); } @@ -210,7 +210,7 @@ _mesa_compressed_texture_size_glenum(GLcontext *ctx, * \return stride, in bytes, between rows for compressed image */ GLint -_mesa_compressed_row_stride(GLuint mesaFormat, GLsizei width) +_mesa_compressed_row_stride(gl_format mesaFormat, GLsizei width) { GLint stride; @@ -261,7 +261,7 @@ _mesa_compressed_row_stride(GLuint mesaFormat, GLsizei width) */ GLubyte * _mesa_compressed_image_address(GLint col, GLint row, GLint img, - GLuint mesaFormat, + gl_format mesaFormat, GLsizei width, const GLubyte *image) { GLubyte *addr; diff --git a/src/mesa/main/texcompress.h b/src/mesa/main/texcompress.h index 44f3338222..13af148394 100644 --- a/src/mesa/main/texcompress.h +++ b/src/mesa/main/texcompress.h @@ -26,6 +26,7 @@ #define TEXCOMPRESS_H #include "mtypes.h" +#include "formats.h" #if _HAVE_FULL_GL @@ -35,7 +36,7 @@ _mesa_get_compressed_formats(GLcontext *ctx, GLint *formats, GLboolean all); extern GLuint _mesa_compressed_texture_size( GLcontext *ctx, GLsizei width, GLsizei height, GLsizei depth, - GLuint mesaFormat ); + gl_format mesaFormat ); extern GLuint _mesa_compressed_texture_size_glenum(GLcontext *ctx, @@ -43,12 +44,12 @@ _mesa_compressed_texture_size_glenum(GLcontext *ctx, GLsizei depth, GLenum glformat); extern GLint -_mesa_compressed_row_stride(GLuint mesaFormat, GLsizei width); +_mesa_compressed_row_stride(gl_format mesaFormat, GLsizei width); extern GLubyte * _mesa_compressed_image_address(GLint col, GLint row, GLint img, - GLuint mesaFormat, + gl_format mesaFormat, GLsizei width, const GLubyte *image); -- cgit v1.2.3 From 5c8282769601ba30c00f04dac15d1dad6d67db6e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 24 Oct 2009 11:52:31 -0600 Subject: mesa: simplify _mesa_compressed_row_stride(), _mesa_compressed_image_address() _mesa_compressed_row_stride() can go away soon. _mesa_compressed_image_address() can be generalized and moved to formats.c --- src/mesa/main/texcompress.c | 91 ++++++++------------------------------------- 1 file changed, 15 insertions(+), 76 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c index 76f2f232f4..b07265d6d8 100644 --- a/src/mesa/main/texcompress.c +++ b/src/mesa/main/texcompress.c @@ -212,40 +212,7 @@ _mesa_compressed_texture_size_glenum(GLcontext *ctx, GLint _mesa_compressed_row_stride(gl_format mesaFormat, GLsizei width) { - GLint stride; - - switch (mesaFormat) { -#if FEATURE_texture_fxt1 - case MESA_FORMAT_RGB_FXT1: - case MESA_FORMAT_RGBA_FXT1: - stride = ((width + 7) / 8) * 16; /* 16 bytes per 8x4 tile */ - break; -#endif -#if FEATURE_texture_s3tc - case MESA_FORMAT_RGB_DXT1: - case MESA_FORMAT_RGBA_DXT1: -#if FEATURE_EXT_texture_sRGB - case MESA_FORMAT_SRGB_DXT1: - case MESA_FORMAT_SRGBA_DXT1: -#endif - stride = ((width + 3) / 4) * 8; /* 8 bytes per 4x4 tile */ - break; - case MESA_FORMAT_RGBA_DXT3: - case MESA_FORMAT_RGBA_DXT5: -#if FEATURE_EXT_texture_sRGB - case MESA_FORMAT_SRGBA_DXT3: - case MESA_FORMAT_SRGBA_DXT5: -#endif - stride = ((width + 3) / 4) * 16; /* 16 bytes per 4x4 tile */ - break; -#endif - default: - _mesa_problem(NULL, "bad mesaFormat in _mesa_compressed_row_stride"); - return 0; - } - - assert(stride == _mesa_format_row_stride(mesaFormat, width)); - + GLint stride = _mesa_format_row_stride(mesaFormat, width); return stride; } @@ -253,58 +220,30 @@ _mesa_compressed_row_stride(gl_format mesaFormat, GLsizei width) /* * Return the address of the pixel at (col, row, img) in a * compressed texture image. - * \param col, row, img - image position (3D) + * \param col, row, img - image position (3D), should be a multiple of the + * format's block size. * \param format - compressed image format - * \param width - image width + * \param width - image width (stride) in pixels * \param image - the image address - * \return address of pixel at (row, col) + * \return address of pixel at (row, col, img) */ GLubyte * _mesa_compressed_image_address(GLint col, GLint row, GLint img, gl_format mesaFormat, GLsizei width, const GLubyte *image) { - GLubyte *addr; + /* XXX only 2D images implemented, not 3D */ + const GLuint blockSize = _mesa_get_format_bytes(mesaFormat); + GLuint bw, bh; + GLint offset; - (void) img; + _mesa_get_format_block_size(mesaFormat, &bw, &bh); - /* We try to spot a "complete" subtexture "above" ROW, COL; - * this texture is given by appropriate rounding of WIDTH x ROW. - * Then we just add the amount left (usually on the left). - * - * Example for X*Y microtiles (Z bytes each) - * offset = Z * (((width + X - 1) / X) * (row / Y) + col / X); - */ + ASSERT(col % bw == 0); + ASSERT(row % bh == 0); - switch (mesaFormat) { -#if FEATURE_texture_fxt1 - case MESA_FORMAT_RGB_FXT1: - case MESA_FORMAT_RGBA_FXT1: - addr = (GLubyte *) image + 16 * (((width + 7) / 8) * (row / 4) + col / 8); - break; -#endif -#if FEATURE_texture_s3tc - case MESA_FORMAT_RGB_DXT1: - case MESA_FORMAT_RGBA_DXT1: -#if FEATURE_EXT_texture_sRGB - case MESA_FORMAT_SRGB_DXT1: - case MESA_FORMAT_SRGBA_DXT1: -#endif - addr = (GLubyte *) image + 8 * (((width + 3) / 4) * (row / 4) + col / 4); - break; - case MESA_FORMAT_RGBA_DXT3: - case MESA_FORMAT_RGBA_DXT5: -#if FEATURE_EXT_texture_sRGB - case MESA_FORMAT_SRGBA_DXT3: - case MESA_FORMAT_SRGBA_DXT5: -#endif - addr = (GLubyte *) image + 16 * (((width + 3) / 4) * (row / 4) + col / 4); - break; -#endif - default: - _mesa_problem(NULL, "bad mesaFormat in _mesa_compressed_image_address"); - addr = NULL; - } + offset = ((width + bw - 1) / bw) * (row / bh) + col / bw; + offset *= blockSize; - return addr; + return (GLubyte *) image + offset; } -- cgit v1.2.3 From bea245ac2fecc312caec8f4af53174e4fb180103 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 24 Oct 2009 12:04:09 -0600 Subject: mesa: minor clean-ups in _mesa_store_compressed_texsubimage2d() --- src/mesa/main/texstore.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index ff6931156e..e6a63b8603 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -3670,6 +3670,7 @@ _mesa_store_compressed_texsubimage2d(GLcontext *ctx, GLenum target, GLubyte *dest; const GLubyte *src; const gl_format texFormat = texImage->TexFormat; + const GLint destWidth = texImage->Width; GLuint bw, bh; _mesa_get_format_block_size(texFormat, &bw, &bh); @@ -3693,15 +3694,15 @@ _mesa_store_compressed_texsubimage2d(GLcontext *ctx, GLenum target, srcRowStride = _mesa_compressed_row_stride(texFormat, width); src = (const GLubyte *) data; - destRowStride = _mesa_compressed_row_stride(texFormat, texImage->Width); + destRowStride = _mesa_compressed_row_stride(texFormat, destWidth); dest = _mesa_compressed_image_address(xoffset, yoffset, 0, - texFormat, - texImage->Width, + texFormat, destWidth, (GLubyte *) texImage->Data); - bytesPerRow = srcRowStride; + bytesPerRow = srcRowStride; /* bytes per row of blocks */ rows = height / bh; /* rows in blocks */ + /* copy rows of blocks */ for (i = 0; i < rows; i++) { MEMCPY(dest, src, bytesPerRow); dest += destRowStride; -- cgit v1.2.3 From 35efc6a1b3e3dada2cf9bd3a503c1b84f4bcb7f5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 24 Oct 2009 16:28:24 -0600 Subject: mesa: change compressed texture size calls Replace calls to ctx->Driver.CompressedTextureSize with calls to _mesa_format_image_size. The former always called the later. --- src/mesa/drivers/dri/intel/intel_tex_image.c | 9 ++++----- src/mesa/drivers/dri/radeon/radeon_texture.c | 10 ++++------ src/mesa/drivers/dri/tdfx/tdfx_tex.c | 14 ++++---------- src/mesa/drivers/dri/unichrome/via_tex.c | 14 ++++---------- src/mesa/main/mipmap.c | 8 +++----- src/mesa/state_tracker/st_cb_texture.c | 9 ++++----- 6 files changed, 23 insertions(+), 41 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index b159010b8e..cbe29f61a2 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -488,11 +488,10 @@ intelTexImage(GLcontext * ctx, else { /* Allocate regular memory and store the image there temporarily. */ if (_mesa_is_format_compressed(texImage->TexFormat)) { - sizeInBytes = ctx->Driver.CompressedTextureSize(ctx, - texImage->Width, - texImage->Height, - texImage->Depth, - texImage->TexFormat); + sizeInBytes = _mesa_format_image_size(texImage->TexFormat, + texImage->Width, + texImage->Height, + texImage->Depth); dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat, width); assert(dims != 3); diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 8e9276c5ae..1a48e8c955 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -580,12 +580,10 @@ static void radeon_teximage( } else { int size; if (_mesa_is_format_compressed(texImage->TexFormat)) { - size = ctx->Driver.CompressedTextureSize(ctx, - texImage->Width, - texImage->Height, - texImage->Depth, - texImage->TexFormat); - + size = _mesa_format_image_size(texImage->TexFormat, + texImage->Width, + texImage->Height, + texImage->Depth); } else { size = texImage->Width * texImage->Height * texImage->Depth * _mesa_get_format_bytes(texImage->TexFormat); } diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tex.c b/src/mesa/drivers/dri/tdfx/tdfx_tex.c index 0cd9051613..63783d6ecd 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_tex.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_tex.c @@ -1408,11 +1408,8 @@ tdfxTexImage2D(GLcontext *ctx, GLenum target, GLint level, texelBytes = _mesa_get_format_bytes(texImage->TexFormat); if (_mesa_is_format_compressed(texImage->TexFormat)) { - GLuint compressedSize = ctx->Driver.CompressedTextureSize(ctx, - mml->width, - mml->height, - 1, - mesaFormat); + GLuint compressedSize = _mesa_format_image_size(mesaFormat, mml->width, + mml->height, 1); dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat, mml->width); texImage->Data = _mesa_alloc_texmemory(compressedSize); } else { @@ -1637,11 +1634,8 @@ tdfxCompressedTexImage2D (GLcontext *ctx, GLenum target, /* allocate new storage for texture image, if needed */ if (!texImage->Data) { - compressedSize = ctx->Driver.CompressedTextureSize(ctx, - mml->width, - mml->height, - 1, - mesaFormat); + compressedSize = _mesa_format_image_size(mesaFormat, mml->width, + mml->height, 1); texImage->Data = _mesa_alloc_texmemory(compressedSize); if (!texImage->Data) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D"); diff --git a/src/mesa/drivers/dri/unichrome/via_tex.c b/src/mesa/drivers/dri/unichrome/via_tex.c index a72dcd6be2..1bc5ddc429 100644 --- a/src/mesa/drivers/dri/unichrome/via_tex.c +++ b/src/mesa/drivers/dri/unichrome/via_tex.c @@ -672,7 +672,6 @@ static void viaTexImage(GLcontext *ctx, struct via_texture_object *viaObj = (struct via_texture_object *)texObj; struct via_texture_image *viaImage = (struct via_texture_image *)texImage; int heaps[3], nheaps, i; - GLuint compressedSize; if (!is_empty_list(&vmesa->freed_tex_buffers)) { viaCheckBreadcrumb(vmesa, 0); @@ -692,14 +691,6 @@ static void viaTexImage(GLcontext *ctx, texelBytes = _mesa_get_format_bytes(texImage->TexFormat); - if (texelBytes == 0) { - /* compressed format */ - compressedSize = - ctx->Driver.CompressedTextureSize(ctx, texImage->Width, - texImage->Height, texImage->Depth, - texImage->TexFormat); - } - /* Minimum pitch of 32 bytes */ if (postConvWidth * texelBytes < 32) { postConvWidth = 32 / texelBytes; @@ -711,7 +702,10 @@ static void viaTexImage(GLcontext *ctx, /* allocate memory */ if (_mesa_is_format_compressed(texImage->TexFormat)) - sizeInBytes = compressedSize; + sizeInBytes = _mesa_format_image_size(texImage->TexFormat, + texImage->Width, + texImage->Height, + texImage->Depth); else sizeInBytes = postConvWidth * postConvHeight * texelBytes; diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 694d593330..40cf43dfff 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -1618,11 +1618,9 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, * Setup src and dest data pointers. */ if (_mesa_is_format_compressed(dstImage->TexFormat)) { - GLuint dstCompressedSize - = ctx->Driver.CompressedTextureSize(ctx, dstImage->Width, - dstImage->Height, - dstImage->Depth, - dstImage->TexFormat); + GLuint dstCompressedSize = + _mesa_format_image_size(dstImage->TexFormat, dstImage->Width, + dstImage->Height, dstImage->Depth); ASSERT(dstCompressedSize > 0); dstImage->Data = _mesa_alloc_texmemory(dstCompressedSize); diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 01b8e5fd77..f68620aec4 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -694,11 +694,10 @@ st_TexImage(GLcontext * ctx, else { /* Allocate regular memory and store the image there temporarily. */ if (_mesa_is_format_compressed(texImage->TexFormat)) { - sizeInBytes = ctx->Driver.CompressedTextureSize(ctx, - texImage->Width, - texImage->Height, - texImage->Depth, - texImage->TexFormat); + sizeInBytes = _mesa_format_image_size(texImage->TexFormat, + texImage->Width, + texImage->Height, + texImage->Depth); dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat, width); assert(dims != 3); -- cgit v1.2.3 From 4c00981b22b28141af1442e5a679d0923b4358ae Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 24 Oct 2009 16:34:18 -0600 Subject: mesa: remove ctx->Driver.CompressedTextureSize() hook It always just called _mesa_compressed_texture_size() anyway. --- src/mesa/drivers/common/driverfuncs.c | 1 - src/mesa/main/dd.h | 7 ------- src/mesa/state_tracker/st_cb_texture.c | 1 - 3 files changed, 9 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index f09106b77c..fe659a6224 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -115,7 +115,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->CompressedTexSubImage2D = _mesa_store_compressed_texsubimage2d; driver->CompressedTexSubImage3D = _mesa_store_compressed_texsubimage3d; driver->GetCompressedTexImage = _mesa_get_compressed_teximage; - driver->CompressedTextureSize = _mesa_compressed_texture_size; driver->BindTexture = NULL; driver->NewTextureObject = _mesa_new_texture_object; driver->DeleteTexture = _mesa_delete_texture_object; diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 64bf9cba19..5f7c9cb6a3 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -475,13 +475,6 @@ struct dd_function_table { struct gl_texture_object *texObj, struct gl_texture_image *texImage); - /** - * Called to query number of bytes of storage needed to store the - * specified compressed texture. - */ - GLuint (*CompressedTextureSize)( GLcontext *ctx, GLsizei width, - GLsizei height, GLsizei depth, - GLuint mesaFormat ); /*@}*/ /** diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index f68620aec4..8ba7c8e53f 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -1973,7 +1973,6 @@ st_init_texture_functions(struct dd_function_table *functions) /* compressed texture functions */ functions->CompressedTexImage2D = st_CompressedTexImage2D; functions->GetCompressedTexImage = st_GetCompressedTexImage; - functions->CompressedTextureSize = _mesa_compressed_texture_size; functions->NewTextureObject = st_NewTextureObject; functions->NewTextureImage = st_NewTextureImage; -- cgit v1.2.3 From d6ee86c77a8e1543557fd64c1f1c354baa0a8ad8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 24 Oct 2009 16:49:57 -0600 Subject: mesa: remove _mesa_compressed_texture_size() Use _mesa_format_image_size() instead. --- src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c | 2 +- src/mesa/drivers/glide/fxddtex.c | 16 ++++++---------- src/mesa/main/texcompress.c | 24 ------------------------ src/mesa/main/texcompress.h | 6 ------ src/mesa/main/texgetimage.c | 10 ++++------ src/mesa/main/texparam.c | 8 ++------ 6 files changed, 13 insertions(+), 53 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c index 86f596deb9..dadc72f4c1 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c @@ -37,7 +37,7 @@ static GLuint radeon_compressed_texture_size(GLcontext *ctx, GLsizei width, GLsizei height, GLsizei depth, GLuint mesaFormat) { - GLuint size = _mesa_compressed_texture_size(ctx, width, height, depth, mesaFormat); + GLuint size = _mesa_format_image_size(mesaFormat, width, height, depth); if (mesaFormat == MESA_FORMAT_RGB_DXT1 || mesaFormat == MESA_FORMAT_RGBA_DXT1) { diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c index a820cb818e..128c17e08b 100644 --- a/src/mesa/drivers/glide/fxddtex.c +++ b/src/mesa/drivers/glide/fxddtex.c @@ -1397,11 +1397,9 @@ fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level, /* allocate mipmap buffer */ assert(!texImage->Data); if (_mesa_is_format_compressed(texImage->TexFormat)) { - texImage->CompressedSize = _mesa_compressed_texture_size(ctx, - mml->width, - mml->height, - 1, - internalFormat); + texImage->CompressedSize = _mesa_format_image_size(texImage->TexFormat, + mml->width, + mml->height, 1); dstRowStride = _mesa_compressed_row_stride(internalFormat, mml->width); texImage->Data = _mesa_malloc(texImage->CompressedSize); } else { @@ -1664,11 +1662,9 @@ fxDDCompressedTexImage2D (GLcontext *ctx, GLenum target, /* allocate new storage for texture image, if needed */ if (!texImage->Data) { - texImage->CompressedSize = _mesa_compressed_texture_size(ctx, - mml->width, - mml->height, - 1, - internalFormat); + texImage->CompressedSize = _mesa_format_image_size(texImage->TexFormat, + mml->width, + mml->height, 1); texImage->Data = _mesa_malloc(texImage->CompressedSize); if (!texImage->Data) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glCompressedTexImage2D"); diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c index b07265d6d8..ad10993307 100644 --- a/src/mesa/main/texcompress.c +++ b/src/mesa/main/texcompress.c @@ -113,30 +113,6 @@ _mesa_get_compressed_formats(GLcontext *ctx, GLint *formats, GLboolean all) } - -/** - * Return number of bytes needed to store a texture of the given size - * using the specified (compressed?) format. - * This is called via the ctx->Driver.CompressedTextureSize function, - * unless a device driver overrides it. A driver might override this - * if it needs to use an unusual or padded texture memory layout. - * - * \param width texture width in texels. - * \param height texture height in texels. - * \param depth texture depth in texels. - * \param mesaFormat one of the MESA_FORMAT_* compressed formats - * - * \return size in bytes, or zero if bad format - */ -GLuint -_mesa_compressed_texture_size( GLcontext *ctx, - GLsizei width, GLsizei height, GLsizei depth, - gl_format mesaFormat ) -{ - return _mesa_format_image_size(mesaFormat, width, height, depth); -} - - /** * As above, but format is specified by a GLenum (GL_COMPRESSED_*) token. * diff --git a/src/mesa/main/texcompress.h b/src/mesa/main/texcompress.h index 13af148394..70247098b2 100644 --- a/src/mesa/main/texcompress.h +++ b/src/mesa/main/texcompress.h @@ -33,11 +33,6 @@ extern GLuint _mesa_get_compressed_formats(GLcontext *ctx, GLint *formats, GLboolean all); -extern GLuint -_mesa_compressed_texture_size( GLcontext *ctx, - GLsizei width, GLsizei height, GLsizei depth, - gl_format mesaFormat ); - extern GLuint _mesa_compressed_texture_size_glenum(GLcontext *ctx, GLsizei width, GLsizei height, @@ -64,7 +59,6 @@ _mesa_init_texture_fxt1( GLcontext *ctx ); /* no-op macros */ #define _mesa_get_compressed_formats( c, f ) 0 -#define _mesa_compressed_texture_size( c, w, h, d, f ) 0 #define _mesa_compressed_texture_size_glenum( c, w, h, d, f ) 0 #define _mesa_compressed_row_stride( f, w) 0 #define _mesa_compressed_image_address(c, r, i, f, w, i2 ) 0 diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index d5cd4b2b9d..1f0a3d793f 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -320,12 +320,10 @@ _mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_object *texObj, struct gl_texture_image *texImage) { - GLuint size; - - /* don't use texImage->CompressedSize since that may be padded out */ - size = _mesa_compressed_texture_size(ctx, texImage->Width, texImage->Height, - texImage->Depth, - texImage->TexFormat); + const GLuint size = _mesa_format_image_size(texImage->TexFormat, + texImage->Width, + texImage->Height, + texImage->Depth); if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { /* pack texture image into a PBO */ diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index a6b611dffb..afa66f149c 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -853,12 +853,8 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, /* GL_ARB_texture_compression */ case GL_TEXTURE_COMPRESSED_IMAGE_SIZE: if (_mesa_is_format_compressed(img->TexFormat) && !isProxy) { - /* Don't use ctx->Driver.CompressedTextureSize() since that - * may returned a padded hardware size. - */ - *params = _mesa_compressed_texture_size(ctx, img->Width, - img->Height, img->Depth, - texFormat); + *params = _mesa_format_image_size(texFormat, img->Width, + img->Height, img->Depth); } else { _mesa_error(ctx, GL_INVALID_OPERATION, -- cgit v1.2.3 From 54bb414e00a4daedbe530b9933bc11bac4ae7149 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 25 Oct 2009 16:59:08 -0600 Subject: mesa: clean-up, simplify compressed texture size checking --- src/mesa/main/texcompress.c | 61 +++++++++++++-------------------------------- src/mesa/main/texcompress.h | 6 ++--- src/mesa/main/teximage.c | 20 ++++++++++++--- 3 files changed, 36 insertions(+), 51 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c index ad10993307..423ad2490c 100644 --- a/src/mesa/main/texcompress.c +++ b/src/mesa/main/texcompress.c @@ -114,67 +114,42 @@ _mesa_get_compressed_formats(GLcontext *ctx, GLint *formats, GLboolean all) /** - * As above, but format is specified by a GLenum (GL_COMPRESSED_*) token. - * - * Note: This function CAN NOT return a padded hardware texture size. - * That's why we don't call the ctx->Driver.CompressedTextureSize() function. - * - * We use this function to validate the parameter - * of glCompressedTex[Sub]Image1/2/3D(), which must be an exact match. + * Convert a compressed MESA_FORMAT_x to a GLenum. */ -GLuint -_mesa_compressed_texture_size_glenum(GLcontext *ctx, - GLsizei width, GLsizei height, - GLsizei depth, GLenum glformat) +gl_format +_mesa_glenum_to_compressed_format(GLenum format) { - gl_format mesaFormat; - - switch (glformat) { -#if FEATURE_texture_fxt1 + switch (format) { case GL_COMPRESSED_RGB_FXT1_3DFX: - mesaFormat = MESA_FORMAT_RGB_FXT1; - break; + return MESA_FORMAT_RGB_FXT1; case GL_COMPRESSED_RGBA_FXT1_3DFX: - mesaFormat = MESA_FORMAT_RGBA_FXT1; - break; -#endif -#if FEATURE_texture_s3tc + return MESA_FORMAT_RGBA_FXT1; + case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: case GL_RGB_S3TC: - mesaFormat = MESA_FORMAT_RGB_DXT1; - break; + return MESA_FORMAT_RGB_DXT1; case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: case GL_RGB4_S3TC: - mesaFormat = MESA_FORMAT_RGBA_DXT1; - break; + return MESA_FORMAT_RGBA_DXT1; case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT: case GL_RGBA_S3TC: - mesaFormat = MESA_FORMAT_RGBA_DXT3; - break; + return MESA_FORMAT_RGBA_DXT3; case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT: case GL_RGBA4_S3TC: - mesaFormat = MESA_FORMAT_RGBA_DXT5; - break; -#if FEATURE_EXT_texture_sRGB + return MESA_FORMAT_RGBA_DXT5; + case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: - mesaFormat = MESA_FORMAT_SRGB_DXT1; - break; + return MESA_FORMAT_SRGB_DXT1; case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: - mesaFormat = MESA_FORMAT_SRGBA_DXT1; - break; + return MESA_FORMAT_SRGBA_DXT1; case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: - mesaFormat = MESA_FORMAT_SRGBA_DXT3; - break; + return MESA_FORMAT_SRGBA_DXT3; case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: - mesaFormat = MESA_FORMAT_SRGBA_DXT5; - break; -#endif -#endif + return MESA_FORMAT_SRGBA_DXT5; + default: - return 0; + return MESA_FORMAT_NONE; } - - return _mesa_format_image_size(mesaFormat, width, height, depth); } diff --git a/src/mesa/main/texcompress.h b/src/mesa/main/texcompress.h index 70247098b2..43cd741895 100644 --- a/src/mesa/main/texcompress.h +++ b/src/mesa/main/texcompress.h @@ -33,10 +33,8 @@ extern GLuint _mesa_get_compressed_formats(GLcontext *ctx, GLint *formats, GLboolean all); -extern GLuint -_mesa_compressed_texture_size_glenum(GLcontext *ctx, - GLsizei width, GLsizei height, - GLsizei depth, GLenum glformat); +extern gl_format +_mesa_glenum_to_compressed_format(GLenum format); extern GLint _mesa_compressed_row_stride(gl_format mesaFormat, GLsizei width); diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 52d2886d0a..4fbfeb8582 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -3034,6 +3034,20 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level, /**********************************************************************/ +/** + * Return expected size of a compressed texture. + */ +static GLuint +compressed_tex_size(GLsizei width, GLsizei height, GLsizei depth, + GLenum glformat) +{ + gl_format mesaFormat = _mesa_glenum_to_compressed_format(glformat); + return _mesa_format_image_size(mesaFormat, width, height, depth); +} + + + + /** * Error checking for glCompressedTexImage[123]D(). * \return error code or GL_NO_ERROR. @@ -3116,8 +3130,7 @@ compressed_texture_error_check(GLcontext *ctx, GLint dimensions, if (level < 0 || level >= maxLevels) return GL_INVALID_VALUE; - expectedSize = _mesa_compressed_texture_size_glenum(ctx, width, height, - depth, internalFormat); + expectedSize = compressed_tex_size(width, height, depth, internalFormat); if (expectedSize != imageSize) return GL_INVALID_VALUE; @@ -3211,8 +3224,7 @@ compressed_subtexture_error_check(GLcontext *ctx, GLint dimensions, if ((height & 3) != 0 && height != 2 && height != 1) return GL_INVALID_VALUE; - expectedSize = _mesa_compressed_texture_size_glenum(ctx, width, height, - depth, format); + expectedSize = compressed_tex_size(width, height, depth, format); if (expectedSize != imageSize) return GL_INVALID_VALUE; -- cgit v1.2.3 From 07ad6393cb31d8f1f086f9c46705334ef9cf25f6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 25 Oct 2009 17:07:06 -0600 Subject: mesa: fix-up error checking related to compressed texture block size --- src/mesa/main/teximage.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 4fbfeb8582..bd5ad56258 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -3046,6 +3046,15 @@ compressed_tex_size(GLsizei width, GLsizei height, GLsizei depth, } +/* + * Return compressed texture block size, in pixels. + */ +static void +get_compressed_block_size(GLenum glformat, GLuint *bw, GLuint *bh) +{ + gl_format mesaFormat = _mesa_glenum_to_compressed_format(glformat); + _mesa_get_format_block_size(mesaFormat, bw, bh); +} /** @@ -3163,6 +3172,7 @@ compressed_subtexture_error_check(GLcontext *ctx, GLint dimensions, GLenum format, GLsizei imageSize) { GLint expectedSize, maxLevels = 0, maxTextureSize; + GLuint bw, bh; (void) zoffset; if (dimensions == 1) { @@ -3212,16 +3222,18 @@ compressed_subtexture_error_check(GLcontext *ctx, GLint dimensions, if (level < 0 || level >= maxLevels) return GL_INVALID_VALUE; - /* XXX these tests are specific to the compressed format. - * this code should be generalized in some way. + /* + * do checks which depend on compression block size */ - if ((xoffset & 3) != 0 || (yoffset & 3) != 0) + get_compressed_block_size(format, &bw, &bh); + + if ((xoffset % bw != 0) || (yoffset % bh != 0)) return GL_INVALID_VALUE; - if ((width & 3) != 0 && width != 2 && width != 1) + if ((width % bw != 0) && width != 2 && width != 1) return GL_INVALID_VALUE; - if ((height & 3) != 0 && height != 2 && height != 1) + if ((height % bh != 0) && height != 2 && height != 1) return GL_INVALID_VALUE; expectedSize = compressed_tex_size(width, height, depth, format); -- cgit v1.2.3 From 82bcc1c5d27b825db7f002c3c183bd1dc7833438 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 25 Oct 2009 17:15:02 -0600 Subject: mesa: simplify texture_row_stride() helper --- src/mesa/main/texstore.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index e6a63b8603..6887521f55 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -3223,17 +3223,8 @@ texture_size(const struct gl_texture_image *texImage) static GLuint texture_row_stride(const struct gl_texture_image *texImage) { - GLuint stride; - - if (_mesa_is_format_compressed(texImage->TexFormat)) { - stride = _mesa_compressed_row_stride(texImage->TexFormat, + GLuint stride = _mesa_format_row_stride(texImage->TexFormat, texImage->Width); - } - else { - GLuint texelBytes = _mesa_get_format_bytes(texImage->TexFormat); - stride = texImage->RowStride * texelBytes; - } - return stride; } -- cgit v1.2.3 From 2594168e9f3cdc4ac53c925486491167837cda30 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 25 Oct 2009 17:20:13 -0600 Subject: mesa: begin removing _mesa_compressed_row_stride() calls Use equivalent _mesa_format_row_stride() function instead. --- src/mesa/main/mipmap.c | 2 +- src/mesa/main/texstore.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/mipmap.c b/src/mesa/main/mipmap.c index 40cf43dfff..b602d920df 100644 --- a/src/mesa/main/mipmap.c +++ b/src/mesa/main/mipmap.c @@ -1661,7 +1661,7 @@ _mesa_generate_mipmap(GLcontext *ctx, GLenum target, /* compress image from dstData into dstImage->Data */ const GLenum srcFormat = _mesa_get_format_base_format(convertFormat); GLint dstRowStride - = _mesa_compressed_row_stride(dstImage->TexFormat, dstWidth); + = _mesa_format_row_stride(dstImage->TexFormat, dstWidth); ASSERT(srcFormat == GL_RGB || srcFormat == GL_RGBA); _mesa_texstore(ctx, 2, dstImage->_BaseFormat, diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 6887521f55..dd146254b4 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -3682,10 +3682,10 @@ _mesa_store_compressed_texsubimage2d(GLcontext *ctx, GLenum target, if (!data) return; - srcRowStride = _mesa_compressed_row_stride(texFormat, width); + srcRowStride = _mesa_format_row_stride(texFormat, width); src = (const GLubyte *) data; - destRowStride = _mesa_compressed_row_stride(texFormat, destWidth); + destRowStride = _mesa_format_row_stride(texFormat, destWidth); dest = _mesa_compressed_image_address(xoffset, yoffset, 0, texFormat, destWidth, (GLubyte *) texImage->Data); -- cgit v1.2.3 From 253e7fee5dc7f0872987b214a6fa162db5e2aa19 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 25 Oct 2009 17:21:11 -0600 Subject: mesa: remove _mesa_compressed_row_stride() calls --- src/mesa/state_tracker/st_cb_texture.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 8ba7c8e53f..4397adbc12 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -698,8 +698,7 @@ st_TexImage(GLcontext * ctx, texImage->Width, texImage->Height, texImage->Depth); - dstRowStride = - _mesa_compressed_row_stride(texImage->TexFormat, width); + dstRowStride = _mesa_format_row_stride(texImage->TexFormat, width); assert(dims != 3); } else { -- cgit v1.2.3 From c83b7587608e1791e092739cc9753ad0e895f25d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 25 Oct 2009 17:21:25 -0600 Subject: glide: remove _mesa_compressed_row_stride() calls And fix incorrect first parameter. --- src/mesa/drivers/glide/fxddtex.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c index 128c17e08b..9fcbf96114 100644 --- a/src/mesa/drivers/glide/fxddtex.c +++ b/src/mesa/drivers/glide/fxddtex.c @@ -1400,7 +1400,7 @@ fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level, texImage->CompressedSize = _mesa_format_image_size(texImage->TexFormat, mml->width, mml->height, 1); - dstRowStride = _mesa_compressed_row_stride(internalFormat, mml->width); + dstRowStride = _mesa_format_row_stride(texImage->TexFormat, mml->width); texImage->Data = _mesa_malloc(texImage->CompressedSize); } else { dstRowStride = mml->width * texelBytes; @@ -1521,7 +1521,7 @@ fxDDTexSubImage2D(GLcontext * ctx, GLenum target, GLint level, texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); if (_mesa_is_format_compressed(texImage->TexFormat)) { - dstRowStride = _mesa_compressed_row_stride(texImage->InternalFormat, mml->width); + dstRowStride = _mesa_format_row_stride(texImage->TexFormat, mml->width); } else { dstRowStride = mml->width * texelBytes; } @@ -1688,10 +1688,10 @@ fxDDCompressedTexImage2D (GLcontext *ctx, GLenum target, * we replicate the data over the padded area. * For now, we take 2) + 3) but texelfetchers will be wrong! */ - GLuint srcRowStride = _mesa_compressed_row_stride(internalFormat, width); + GLuint srcRowStride = _mesa_format_row_stride(texImage->TexFormat, width); - GLuint destRowStride = _mesa_compressed_row_stride(internalFormat, - mml->width); + GLuint destRowStride = _mesa_format_row_stride(texImage->TexFormat, + mml->width); _mesa_upscale_teximage2d(srcRowStride, (height+3) / 4, destRowStride, (mml->height+3) / 4, @@ -1739,10 +1739,9 @@ fxDDCompressedTexSubImage2D( GLcontext *ctx, GLenum target, mml = FX_MIPMAP_DATA(texImage); assert(mml); - srcRowStride = _mesa_compressed_row_stride(texImage->InternalFormat, width); + srcRowStride = _mesa_format_row_stride(texImage->TexFormat, width); - destRowStride = _mesa_compressed_row_stride(texImage->InternalFormat, - mml->width); + destRowStride = _mesa_format_row_stride(texImage->TexFormat, mml->width); dest = _mesa_compressed_image_address(xoffset, yoffset, 0, texImage->InternalFormat, mml->width, @@ -1760,10 +1759,9 @@ fxDDCompressedTexSubImage2D( GLcontext *ctx, GLenum target, * see fxDDCompressedTexImage2D for caveats */ if (mml->wScale != 1 || mml->hScale != 1) { - srcRowStride = _mesa_compressed_row_stride(texImage->InternalFormat, texImage->Width); + srcRowStride = _mesa_format_row_stride(texImage->TexFormat, texImage->Width); - destRowStride = _mesa_compressed_row_stride(texImage->InternalFormat, - mml->width); + destRowStride = _mesa_format_row_stride(texImage->TexFormat, mml->width); _mesa_upscale_teximage2d(srcRowStride, texImage->Height / 4, destRowStride, mml->height / 4, 1, texImage->Data, destRowStride, -- cgit v1.2.3 From e3f2efc4f14d6f0d06560d2acfac73628f5a74a6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 25 Oct 2009 17:23:37 -0600 Subject: mesa: remove calls to _mesa_compressed_row_stride() --- src/mesa/drivers/dri/intel/intel_tex_image.c | 2 +- src/mesa/drivers/dri/intel/intel_tex_subimage.c | 2 +- src/mesa/drivers/dri/radeon/radeon_texture.c | 8 ++++---- src/mesa/drivers/dri/tdfx/tdfx_tex.c | 16 ++++++++-------- src/mesa/drivers/dri/unichrome/via_tex.c | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index cbe29f61a2..daf6d9da0e 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -493,7 +493,7 @@ intelTexImage(GLcontext * ctx, texImage->Height, texImage->Depth); dstRowStride = - _mesa_compressed_row_stride(texImage->TexFormat, width); + _mesa_format_row_stride(texImage->TexFormat, width); assert(dims != 3); } else { diff --git a/src/mesa/drivers/dri/intel/intel_tex_subimage.c b/src/mesa/drivers/dri/intel/intel_tex_subimage.c index cc329dae58..1f68208266 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_subimage.c +++ b/src/mesa/drivers/dri/intel/intel_tex_subimage.c @@ -87,7 +87,7 @@ intelTexSubimage(GLcontext * ctx, else { if (_mesa_is_format_compressed(texImage->TexFormat)) { dstRowStride = - _mesa_compressed_row_stride(texImage->TexFormat, width); + _mesa_format_row_stride(texImage->TexFormat, width); assert(dims != 3); } else { diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 1a48e8c955..d8e81237d0 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -605,7 +605,7 @@ static void radeon_teximage( if (compressed) { if (image->mt) { uint32_t srcRowStride, bytesPerRow, rows; - srcRowStride = _mesa_compressed_row_stride(texImage->TexFormat, width); + srcRowStride = _mesa_format_row_stride(texImage->TexFormat, width); bytesPerRow = srcRowStride; rows = (height + 3) / 4; copy_rows(texImage->Data, image->mt->levels[level].rowstride, @@ -755,7 +755,7 @@ static void radeon_texsubimage(GLcontext* ctx, int dims, GLenum target, int leve uint32_t srcRowStride, bytesPerRow, rows; GLubyte *img_start; if (!image->mt) { - dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat, texImage->Width); + dstRowStride = _mesa_format_row_stride(texImage->TexFormat, texImage->Width); img_start = _mesa_compressed_image_address(xoffset, yoffset, 0, texImage->TexFormat, texImage->Width, texImage->Data); @@ -764,7 +764,7 @@ static void radeon_texsubimage(GLcontext* ctx, int dims, GLenum target, int leve uint32_t blocks_x = dstRowStride / (image->mt->bpp * 4); img_start = texImage->Data + image->mt->bpp * 4 * (blocks_x * (yoffset / 4) + xoffset / 4); } - srcRowStride = _mesa_compressed_row_stride(texImage->TexFormat, width); + srcRowStride = _mesa_format_row_stride(texImage->TexFormat, width); bytesPerRow = srcRowStride; rows = (height + 3) / 4; @@ -887,7 +887,7 @@ static void migrate_image_to_miptree(radeon_mipmap_tree *mt, radeon_texture_imag /* need to confirm this value is correct */ if (mt->compressed) { height = (image->base.Height + 3) / 4; - srcrowstride = _mesa_compressed_row_stride(image->base.TexFormat, image->base.Width); + srcrowstride = _mesa_format_row_stride(image->base.TexFormat, image->base.Width); } else { height = image->base.Height * image->base.Depth; srcrowstride = image->base.Width * _mesa_get_format_bytes(image->base.TexFormat); diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tex.c b/src/mesa/drivers/dri/tdfx/tdfx_tex.c index 63783d6ecd..af434315c1 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_tex.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_tex.c @@ -1410,7 +1410,7 @@ tdfxTexImage2D(GLcontext *ctx, GLenum target, GLint level, if (_mesa_is_format_compressed(texImage->TexFormat)) { GLuint compressedSize = _mesa_format_image_size(mesaFormat, mml->width, mml->height, 1); - dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat, mml->width); + dstRowStride = _mesa_format_row_stride(texImage->TexFormat, mml->width); texImage->Data = _mesa_alloc_texmemory(compressedSize); } else { dstRowStride = mml->width * texelBytes; @@ -1488,7 +1488,7 @@ tdfxTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, texelBytes = _mesa_get_format_bytes(texImage->TexFormat); if (_mesa_is_format_compressed(texImage->TexFormat)) { - dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat, mml->width); + dstRowStride = _mesa_format_row_stride(texImage->TexFormat, mml->width); } else { dstRowStride = mml->width * texelBytes; } @@ -1660,9 +1660,9 @@ tdfxCompressedTexImage2D (GLcontext *ctx, GLenum target, * For now, we take 2) + 3) but texelfetchers will be wrong! */ const GLuint mesaFormat = texImage->TexFormat; - GLuint srcRowStride = _mesa_compressed_row_stride(mesaFormat, width); + GLuint srcRowStride = _mesa_format_row_stride(mesaFormat, width); - GLuint destRowStride = _mesa_compressed_row_stride(mesaFormat, + GLuint destRowStride = _mesa_format_row_stride(mesaFormat, mml->width); _mesa_upscale_teximage2d(srcRowStride, (height+3) / 4, @@ -1707,9 +1707,9 @@ tdfxCompressedTexSubImage2D( GLcontext *ctx, GLenum target, mml = TDFX_TEXIMAGE_DATA(texImage); assert(mml); - srcRowStride = _mesa_compressed_row_stride(mesaFormat, width); + srcRowStride = _mesa_format_row_stride(mesaFormat, width); - destRowStride = _mesa_compressed_row_stride(mesaFormat, mml->width); + destRowStride = _mesa_format_row_stride(mesaFormat, mml->width); dest = _mesa_compressed_image_address(xoffset, yoffset, 0, mesaFormat, mml->width, @@ -1727,9 +1727,9 @@ tdfxCompressedTexSubImage2D( GLcontext *ctx, GLenum target, * see fxDDCompressedTexImage2D for caveats */ if (mml->wScale != 1 || mml->hScale != 1) { - srcRowStride = _mesa_compressed_row_stride(mesaFormat, texImage->Width); + srcRowStride = _mesa_format_row_stride(mesaFormat, texImage->Width); - destRowStride = _mesa_compressed_row_stride(mesaFormat, mml->width); + destRowStride = _mesa_format_row_stride(mesaFormat, mml->width); _mesa_upscale_teximage2d(srcRowStride, texImage->Height / 4, destRowStride, mml->height / 4, 1, texImage->Data, destRowStride, diff --git a/src/mesa/drivers/dri/unichrome/via_tex.c b/src/mesa/drivers/dri/unichrome/via_tex.c index 1bc5ddc429..24924d2613 100644 --- a/src/mesa/drivers/dri/unichrome/via_tex.c +++ b/src/mesa/drivers/dri/unichrome/via_tex.c @@ -785,7 +785,7 @@ static void viaTexImage(GLcontext *ctx, GLboolean success; if (_mesa_is_format_compressed(texImage->TexFormat)) { - dstRowStride = _mesa_compressed_row_stride(texImage->TexFormat, width); + dstRowStride = _mesa_format_row_stride(texImage->TexFormat, width); } else { dstRowStride = postConvWidth * _mesa_get_format_bytes(texImage->TexFormat); -- cgit v1.2.3 From 20c6c5853261b31ecd50d58e0aae9b92f25e41db Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 25 Oct 2009 17:25:46 -0600 Subject: mesa: remove _mesa_compressed_row_stride() --- src/mesa/main/texcompress.c | 15 --------------- src/mesa/main/texcompress.h | 5 ----- 2 files changed, 20 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c index 423ad2490c..262e8236ed 100644 --- a/src/mesa/main/texcompress.c +++ b/src/mesa/main/texcompress.c @@ -153,21 +153,6 @@ _mesa_glenum_to_compressed_format(GLenum format) } -/* - * Compute the bytes per row in a compressed texture image. - * We use this for computing the destination address for sub-texture updates. - * \param mesaFormat one of the MESA_FORMAT_* compressed formats - * \param width image width in pixels - * \return stride, in bytes, between rows for compressed image - */ -GLint -_mesa_compressed_row_stride(gl_format mesaFormat, GLsizei width) -{ - GLint stride = _mesa_format_row_stride(mesaFormat, width); - return stride; -} - - /* * Return the address of the pixel at (col, row, img) in a * compressed texture image. diff --git a/src/mesa/main/texcompress.h b/src/mesa/main/texcompress.h index 43cd741895..d6c16e936c 100644 --- a/src/mesa/main/texcompress.h +++ b/src/mesa/main/texcompress.h @@ -36,10 +36,6 @@ _mesa_get_compressed_formats(GLcontext *ctx, GLint *formats, GLboolean all); extern gl_format _mesa_glenum_to_compressed_format(GLenum format); -extern GLint -_mesa_compressed_row_stride(gl_format mesaFormat, GLsizei width); - - extern GLubyte * _mesa_compressed_image_address(GLint col, GLint row, GLint img, gl_format mesaFormat, @@ -58,7 +54,6 @@ _mesa_init_texture_fxt1( GLcontext *ctx ); /* no-op macros */ #define _mesa_get_compressed_formats( c, f ) 0 #define _mesa_compressed_texture_size_glenum( c, w, h, d, f ) 0 -#define _mesa_compressed_row_stride( f, w) 0 #define _mesa_compressed_image_address(c, r, i, f, w, i2 ) 0 #define _mesa_compress_teximage( c, w, h, sF, s, sRS, dF, d, drs ) ((void)0) -- cgit v1.2.3 From 355b5bde5056297f4f1636850449b91626958408 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 25 Oct 2009 17:32:56 -0600 Subject: mesa: remove _mesa_compressed_texture_size_glenum() stub --- src/mesa/main/texcompress.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texcompress.h b/src/mesa/main/texcompress.h index d6c16e936c..5ac93ddd18 100644 --- a/src/mesa/main/texcompress.h +++ b/src/mesa/main/texcompress.h @@ -53,7 +53,6 @@ _mesa_init_texture_fxt1( GLcontext *ctx ); /* no-op macros */ #define _mesa_get_compressed_formats( c, f ) 0 -#define _mesa_compressed_texture_size_glenum( c, w, h, d, f ) 0 #define _mesa_compressed_image_address(c, r, i, f, w, i2 ) 0 #define _mesa_compress_teximage( c, w, h, sF, s, sRS, dF, d, drs ) ((void)0) -- cgit v1.2.3 From 11caea687e3f10ae12d33e44edf84635f73047dd Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sun, 25 Oct 2009 18:06:18 -0600 Subject: mesa: choose texture format in core mesa, not drivers Call the ctx->Driver.ChooseTextureFormat() function from core Mesa's _mesa_[Copy]TexImage functions instead of in the driver functions. One less thing for drivers to do. --- src/mesa/drivers/dri/intel/intel_tex_image.c | 6 ---- src/mesa/drivers/dri/r200/r200_texstate.c | 4 +-- src/mesa/drivers/dri/r300/r300_texstate.c | 3 -- src/mesa/drivers/dri/r600/r600_texstate.c | 4 +-- src/mesa/drivers/dri/radeon/radeon_fbo.c | 3 ++ src/mesa/drivers/dri/radeon/radeon_texstate.c | 4 +-- src/mesa/drivers/dri/radeon/radeon_texture.c | 3 -- src/mesa/drivers/dri/tdfx/tdfx_tex.c | 11 ------ src/mesa/drivers/glide/fxddtex.c | 12 ------- src/mesa/main/teximage.c | 48 +++++++++++++++++++++++++++ src/mesa/main/texstore.c | 16 --------- src/mesa/state_tracker/st_cb_texture.c | 4 --- 12 files changed, 54 insertions(+), 64 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index daf6d9da0e..ef5902a5e5 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -330,10 +330,6 @@ intelTexImage(GLcontext * ctx, &postConvHeight); } - /* choose the texture format */ - texImage->TexFormat = intelChooseTextureFormat(ctx, internalFormat, - format, type); - if (_mesa_is_format_compressed(texImage->TexFormat)) { texelBytes = 0; } @@ -787,8 +783,6 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, intelImage->face = target_to_face(target); intelImage->level = level; - texImage->TexFormat = intelChooseTextureFormat(&intel->ctx, internalFormat, - type, format); texImage->RowStride = rb->region->pitch; intel_miptree_reference(&intelImage->mt, intelObj->mt); diff --git a/src/mesa/drivers/dri/r200/r200_texstate.c b/src/mesa/drivers/dri/r200/r200_texstate.c index 20ec6fffaf..7d0afa1add 100644 --- a/src/mesa/drivers/dri/r200/r200_texstate.c +++ b/src/mesa/drivers/dri/r200/r200_texstate.c @@ -835,9 +835,7 @@ void r200SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo _mesa_init_teximage_fields(radeon->glCtx, target, texImage, rb->base.Width, rb->base.Height, 1, 0, rb->cpp); texImage->RowStride = rb->pitch / rb->cpp; - texImage->TexFormat = radeonChooseTextureFormat(radeon->glCtx, - internalFormat, - type, format, 0); + rImage->bo = rb->bo; radeon_bo_ref(rImage->bo); t->bo = rb->bo; diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index 63f0154cd3..b7bb8bfadc 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -444,9 +444,6 @@ void r300SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo _mesa_init_teximage_fields(radeon->glCtx, target, texImage, rb->base.Width, rb->base.Height, 1, 0, rb->cpp); texImage->RowStride = rb->pitch / rb->cpp; - texImage->TexFormat = radeonChooseTextureFormat(radeon->glCtx, - internalFormat, - type, format, 0); rImage->bo = rb->bo; radeon_bo_ref(rImage->bo); t->bo = rb->bo; diff --git a/src/mesa/drivers/dri/r600/r600_texstate.c b/src/mesa/drivers/dri/r600/r600_texstate.c index 63d88f83d6..a083f9afc0 100644 --- a/src/mesa/drivers/dri/r600/r600_texstate.c +++ b/src/mesa/drivers/dri/r600/r600_texstate.c @@ -907,9 +907,7 @@ void r600SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo _mesa_init_teximage_fields(radeon->glCtx, target, texImage, rb->base.Width, rb->base.Height, 1, 0, rb->cpp); texImage->RowStride = rb->pitch / rb->cpp; - texImage->TexFormat = radeonChooseTextureFormat(radeon->glCtx, - internalFormat, - type, format, 0); + rImage->bo = rb->bo; radeon_bo_ref(rImage->bo); t->bo = rb->bo; diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index 40846828c5..3f0ab83996 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -385,6 +385,9 @@ restart: texImage->TexFormat); return GL_FALSE; } + /* XXX why is the tex format being set here? + * I think this can be removed. + */ texImage->TexFormat = radeonChooseTextureFormat(ctx, texImage->InternalFormat, 0, _mesa_get_format_datatype(texImage->TexFormat), 1); diff --git a/src/mesa/drivers/dri/radeon/radeon_texstate.c b/src/mesa/drivers/dri/radeon/radeon_texstate.c index c7786381ae..0fd9a138d6 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texstate.c +++ b/src/mesa/drivers/dri/radeon/radeon_texstate.c @@ -709,9 +709,7 @@ void radeonSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_ _mesa_init_teximage_fields(radeon->glCtx, target, texImage, rb->base.Width, rb->base.Height, 1, 0, rb->cpp); texImage->RowStride = rb->pitch / rb->cpp; - texImage->TexFormat = radeonChooseTextureFormat(radeon->glCtx, - internalFormat, - type, format, 0); + rImage->bo = rb->bo; radeon_bo_ref(rImage->bo); t->bo = rb->bo; diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index d8e81237d0..9b391620c6 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -538,9 +538,6 @@ static void radeon_teximage( &postConvHeight); } - /* Choose and fill in the texture format for this image */ - texImage->TexFormat = radeonChooseTextureFormat(ctx, internalFormat, format, type, 0); - if (_mesa_is_format_compressed(texImage->TexFormat)) { texelBytes = 0; } else { diff --git a/src/mesa/drivers/dri/tdfx/tdfx_tex.c b/src/mesa/drivers/dri/tdfx/tdfx_tex.c index af434315c1..0aa09e733b 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_tex.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_tex.c @@ -1396,11 +1396,6 @@ tdfxTexImage2D(GLcontext *ctx, GLenum target, GLint level, } #endif - /* choose the texture format */ - assert(ctx->Driver.ChooseTextureFormat); - texImage->TexFormat = (*ctx->Driver.ChooseTextureFormat)(ctx, - internalFormat, format, type); - assert(texImage->TexFormat); mesaFormat = texImage->TexFormat; mml->glideFormat = fxGlideFormat(mesaFormat); ti->info.format = mml->glideFormat; @@ -1618,12 +1613,6 @@ tdfxCompressedTexImage2D (GLcontext *ctx, GLenum target, mml->height = height * mml->hScale; - /* choose the texture format */ - assert(ctx->Driver.ChooseTextureFormat); - texImage->TexFormat = (*ctx->Driver.ChooseTextureFormat)(ctx, - internalFormat, -1/*format*/, -1/*type*/); - assert(texImage->TexFormat); - /* Determine the appropriate Glide texel format, * given the user's internal texture format hint. */ diff --git a/src/mesa/drivers/glide/fxddtex.c b/src/mesa/drivers/glide/fxddtex.c index 9fcbf96114..a863b028ad 100644 --- a/src/mesa/drivers/glide/fxddtex.c +++ b/src/mesa/drivers/glide/fxddtex.c @@ -1384,11 +1384,6 @@ fxDDTexImage2D(GLcontext * ctx, GLenum target, GLint level, } #endif - /* choose the texture format */ - assert(ctx->Driver.ChooseTextureFormat); - texImage->TexFormat = (*ctx->Driver.ChooseTextureFormat)(ctx, - internalFormat, format, type); - assert(texImage->TexFormat); texelBytes = _mesa_get_format_bytes(texImage->TexFormat->MesaFormat); /*if (!fxMesa->HaveTexFmt) assert(texelBytes == 1 || texelBytes == 2);*/ @@ -1648,13 +1643,6 @@ fxDDCompressedTexImage2D (GLcontext *ctx, GLenum target, mml->width = width * mml->wScale; mml->height = height * mml->hScale; - - /* choose the texture format */ - assert(ctx->Driver.ChooseTextureFormat); - texImage->TexFormat = (*ctx->Driver.ChooseTextureFormat)(ctx, - internalFormat, -1/*format*/, -1/*type*/); - assert(texImage->TexFormat); - /* Determine the appropriate Glide texel format, * given the user's internal texture format hint. */ diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index bd5ad56258..2555934eca 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -2195,6 +2195,12 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat, postConvWidth, 1, 1, border, internalFormat); + /* Choose actual texture format */ + texImage->TexFormat = + ctx->Driver.ChooseTextureFormat(ctx, internalFormat, + format, type); + ASSERT(texImage->TexFormat != MESA_FORMAT_NONE); + /* Give the texture to the driver. may be null. */ ASSERT(ctx->Driver.TexImage1D); ctx->Driver.TexImage1D(ctx, target, level, internalFormat, @@ -2311,6 +2317,12 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, postConvWidth, postConvHeight, 1, border, internalFormat); + /* Choose actual texture format */ + texImage->TexFormat = + ctx->Driver.ChooseTextureFormat(ctx, internalFormat, + format, type); + ASSERT(texImage->TexFormat != MESA_FORMAT_NONE); + /* Give the texture to the driver. may be null. */ ASSERT(ctx->Driver.TexImage2D); ctx->Driver.TexImage2D(ctx, target, level, internalFormat, @@ -2423,6 +2435,12 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat, width, height, depth, border, internalFormat); + /* Choose actual texture format */ + texImage->TexFormat = + ctx->Driver.ChooseTextureFormat(ctx, internalFormat, + format, type); + ASSERT(texImage->TexFormat != MESA_FORMAT_NONE); + /* Give the texture to the driver. may be null. */ ASSERT(ctx->Driver.TexImage3D); ctx->Driver.TexImage3D(ctx, target, level, internalFormat, @@ -2735,6 +2753,12 @@ _mesa_CopyTexImage1D( GLenum target, GLint level, _mesa_init_teximage_fields(ctx, target, texImage, postConvWidth, 1, 1, border, internalFormat); + /* Choose actual texture format */ + texImage->TexFormat = + ctx->Driver.ChooseTextureFormat(ctx, internalFormat, + GL_NONE, GL_NONE); + ASSERT(texImage->TexFormat != MESA_FORMAT_NONE); + ASSERT(ctx->Driver.CopyTexImage1D); ctx->Driver.CopyTexImage1D(ctx, target, level, internalFormat, x, y, width, border); @@ -2812,6 +2836,12 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat, postConvWidth, postConvHeight, 1, border, internalFormat); + /* Choose actual texture format */ + texImage->TexFormat = + ctx->Driver.ChooseTextureFormat(ctx, internalFormat, + GL_NONE, GL_NONE); + ASSERT(texImage->TexFormat != MESA_FORMAT_NONE); + ASSERT(ctx->Driver.CopyTexImage2D); ctx->Driver.CopyTexImage2D(ctx, target, level, internalFormat, x, y, width, height, border); @@ -3290,6 +3320,12 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level, _mesa_init_teximage_fields(ctx, target, texImage, width, 1, 1, border, internalFormat); + /* Choose actual texture format */ + texImage->TexFormat = + ctx->Driver.ChooseTextureFormat(ctx, internalFormat, + GL_NONE, GL_NONE); + ASSERT(texImage->TexFormat != MESA_FORMAT_NONE); + ASSERT(ctx->Driver.CompressedTexImage1D); ctx->Driver.CompressedTexImage1D(ctx, target, level, internalFormat, width, border, @@ -3396,6 +3432,12 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level, _mesa_init_teximage_fields(ctx, target, texImage, width, height, 1, border, internalFormat); + /* Choose actual texture format */ + texImage->TexFormat = + ctx->Driver.ChooseTextureFormat(ctx, internalFormat, + GL_NONE, GL_NONE); + ASSERT(texImage->TexFormat != MESA_FORMAT_NONE); + ASSERT(ctx->Driver.CompressedTexImage2D); ctx->Driver.CompressedTexImage2D(ctx, target, level, internalFormat, width, height, @@ -3501,6 +3543,12 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level, width, height, depth, border, internalFormat); + /* Choose actual texture format */ + texImage->TexFormat = + ctx->Driver.ChooseTextureFormat(ctx, internalFormat, + GL_NONE, GL_NONE); + ASSERT(texImage->TexFormat != MESA_FORMAT_NONE); + ASSERT(ctx->Driver.CompressedTexImage3D); ctx->Driver.CompressedTexImage3D(ctx, target, level, internalFormat, diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index dd146254b4..692923ba0a 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -3250,10 +3250,6 @@ _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level, GLuint sizeInBytes; (void) border; - texImage->TexFormat - = ctx->Driver.ChooseTextureFormat(ctx, internalFormat, format, type); - ASSERT(texImage->TexFormat); - /* allocate memory */ sizeInBytes = texture_size(texImage); texImage->Data = _mesa_alloc_texmemory(sizeInBytes); @@ -3311,10 +3307,6 @@ _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level, GLuint sizeInBytes; (void) border; - texImage->TexFormat - = ctx->Driver.ChooseTextureFormat(ctx, internalFormat, format, type); - ASSERT(texImage->TexFormat); - /* allocate memory */ sizeInBytes = texture_size(texImage); texImage->Data = _mesa_alloc_texmemory(sizeInBytes); @@ -3368,10 +3360,6 @@ _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level, GLuint sizeInBytes; (void) border; - texImage->TexFormat - = ctx->Driver.ChooseTextureFormat(ctx, internalFormat, format, type); - ASSERT(texImage->TexFormat); - /* allocate memory */ sizeInBytes = texture_size(texImage); texImage->Data = _mesa_alloc_texmemory(sizeInBytes); @@ -3570,10 +3558,6 @@ _mesa_store_compressed_teximage2d(GLcontext *ctx, GLenum target, GLint level, ASSERT(texImage->Depth == 1); ASSERT(texImage->Data == NULL); /* was freed in glCompressedTexImage2DARB */ - texImage->TexFormat - = ctx->Driver.ChooseTextureFormat(ctx, internalFormat, 0, 0); - ASSERT(texImage->TexFormat); - /* allocate storage */ texImage->Data = _mesa_alloc_texmemory(imageSize); if (!texImage->Data) { diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 4397adbc12..e8bb720acc 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -555,10 +555,6 @@ st_TexImage(GLcontext * ctx, } #endif - /* choose the texture format */ - texImage->TexFormat = st_ChooseTextureFormat(ctx, internalFormat, - format, type); - _mesa_set_fetch_functions(texImage, dims); if (_mesa_is_format_compressed(texImage->TexFormat)) { -- cgit v1.2.3 From c9d715da3936149b0d4ca9fef2f8b235bf9389b7 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Sun, 25 Oct 2009 20:20:45 -0700 Subject: mesa: Add remap.c to SConscript. Signed-off-by: Chia-I Wu --- src/mesa/SConscript | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/SConscript b/src/mesa/SConscript index cad5676320..6810ad8321 100644 --- a/src/mesa/SConscript +++ b/src/mesa/SConscript @@ -78,6 +78,7 @@ if env['platform'] != 'winddk': 'main/rastpos.c', 'main/rbadaptors.c', 'main/readpix.c', + 'main/remap.c', 'main/renderbuffer.c', 'main/scissor.c', 'main/shaders.c', -- cgit v1.2.3 From 48dad9c93fd6fb46bf33a58a87de79eb5ffd6e67 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 26 Oct 2009 10:42:45 -0600 Subject: intel: fix GL state bugs in intel_texture_bitmap() Need to push texture state and polygon state too. Fixes rendering glitches seen in progs/demos/engine when changing the rendering mode (wireframe, texture modes). This makes bitmap rendering a little slower, unfortunately. --- src/mesa/drivers/dri/intel/intel_pixel_bitmap.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c index b543a0bbc3..18e6ebd17c 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c @@ -435,13 +435,14 @@ intel_texture_bitmap(GLcontext * ctx, } /* Save GL state before we start setting up our drawing */ - _mesa_PushAttrib(GL_ENABLE_BIT | GL_CURRENT_BIT | - GL_VIEWPORT_BIT); + _mesa_PushAttrib(GL_ENABLE_BIT | GL_CURRENT_BIT | GL_POLYGON_BIT | + GL_TEXTURE_BIT | GL_VIEWPORT_BIT); _mesa_PushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT | GL_CLIENT_PIXEL_STORE_BIT); old_active_texture = ctx->Texture.CurrentUnit; _mesa_Disable(GL_POLYGON_STIPPLE); + _mesa_PolygonMode(GL_FRONT_AND_BACK, GL_FILL); /* Upload our bitmap data to an alpha texture */ _mesa_ActiveTextureARB(GL_TEXTURE0_ARB); @@ -501,8 +502,6 @@ intel_texture_bitmap(GLcontext * ctx, meta_restore_vertex_program(&intel->meta); _mesa_PopClientAttrib(); - _mesa_Disable(GL_TEXTURE_2D); /* asserted that it was disabled at entry */ - _mesa_ActiveTextureARB(GL_TEXTURE0_ARB + old_active_texture); _mesa_PopAttrib(); _mesa_DeleteTextures(1, &texname); -- cgit v1.2.3 From f9e334cb32152fd342ac6b1dd4776215af6e1d49 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 27 Oct 2009 09:27:44 -0600 Subject: Revert "i965: fix hacked Fallback usage in brw_prepare_vertices()" This reverts commit 8810b8f67135185d1044746bb861fe2ff997626c. It turns out the i965 driver uses the intel->Fallback field as a boolean, not as a bitmask. The intelFallback() function is a no-op in the i965 driver. It would have been nice if there were some comments about this. I'll fix that next... --- src/mesa/drivers/dri/i965/brw_context.h | 2 -- src/mesa/drivers/dri/i965/brw_draw_upload.c | 6 ++---- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index b1e7ec8465..da0e091bfd 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -116,8 +116,6 @@ */ -#define BRW_FALLBACK_DRAW (INTEL_FALLBACK_DRIVER << 0) - #define BRW_MAX_CURBE (32*16) struct brw_context; diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index 4f8ceb37bd..9d089e113e 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -375,10 +375,9 @@ static void brw_prepare_vertices(struct brw_context *brw) * isn't an issue at this point. */ if (brw->vb.nr_enabled >= BRW_VEP_MAX) { - FALLBACK(intel, BRW_FALLBACK_DRAW, GL_TRUE); + intel->Fallback = 1; return; } - FALLBACK(intel, BRW_FALLBACK_DRAW, GL_FALSE); for (i = 0; i < brw->vb.nr_enabled; i++) { struct brw_vertex_element *input = brw->vb.enabled[i]; @@ -428,10 +427,9 @@ static void brw_prepare_vertices(struct brw_context *brw) /* Position array not properly enabled: */ if (input->glarray->StrideB == 0) { - FALLBACK(intel, BRW_FALLBACK_DRAW, GL_TRUE); + intel->Fallback = 1; return; } - FALLBACK(intel, BRW_FALLBACK_DRAW, GL_FALSE); interleave = input->glarray->StrideB; ptr = input->glarray->Ptr; -- cgit v1.2.3 From 43dc91f8bbb69499a6a0326a78e434b313f73c2c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 27 Oct 2009 09:31:31 -0600 Subject: i965: be clear that the Fallback field is a boolean, not a bitfield --- src/mesa/drivers/dri/i965/brw_draw_upload.c | 4 ++-- src/mesa/drivers/dri/i965/brw_fallback.c | 6 +++++- src/mesa/drivers/dri/i965/brw_state_upload.c | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index 9d089e113e..348c66154f 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -375,7 +375,7 @@ static void brw_prepare_vertices(struct brw_context *brw) * isn't an issue at this point. */ if (brw->vb.nr_enabled >= BRW_VEP_MAX) { - intel->Fallback = 1; + intel->Fallback = GL_TRUE; /* boolean, not bitfield */ return; } @@ -427,7 +427,7 @@ static void brw_prepare_vertices(struct brw_context *brw) /* Position array not properly enabled: */ if (input->glarray->StrideB == 0) { - intel->Fallback = 1; + intel->Fallback = GL_TRUE; /* boolean, not bitfield */ return; } diff --git a/src/mesa/drivers/dri/i965/brw_fallback.c b/src/mesa/drivers/dri/i965/brw_fallback.c index d27c6c24ca..562a17844b 100644 --- a/src/mesa/drivers/dri/i965/brw_fallback.c +++ b/src/mesa/drivers/dri/i965/brw_fallback.c @@ -133,7 +133,11 @@ const struct brw_tracked_state brw_check_fallback = { -/* Not used: +/** + * Called by the INTEL_FALLBACK() macro. + * NOTE: this is a no-op for the i965 driver. The brw->intel.Fallback + * field is treated as a boolean, not a bitmask. It's only set in a + * couple of places. */ void intelFallback( struct intel_context *intel, GLuint bit, GLboolean mode ) { diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index b817b741e7..ee447afa62 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -308,7 +308,7 @@ void brw_validate_state( struct brw_context *brw ) if (brw->state.dirty.brw & BRW_NEW_CONTEXT) brw_clear_batch_cache(brw); - brw->intel.Fallback = 0; + brw->intel.Fallback = GL_FALSE; /* boolean, not bitfield */ /* do prepare stage for all atoms */ for (i = 0; i < Elements(atoms); i++) { -- cgit v1.2.3 From 70b17db918a2784296434877a43b4c4036be792a Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 27 Oct 2009 10:26:09 -0700 Subject: i915: Fix driver for the miptree x/y offset changes. Bug #24734. --- src/mesa/drivers/dri/i915/i830_texstate.c | 13 ++++++++++--- src/mesa/drivers/dri/i915/i915_texstate.c | 13 ++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i830_texstate.c b/src/mesa/drivers/dri/i915/i830_texstate.c index 6f998fa6f7..20ff46b0b0 100644 --- a/src/mesa/drivers/dri/i915/i830_texstate.c +++ b/src/mesa/drivers/dri/i915/i830_texstate.c @@ -160,11 +160,18 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) pitch = intelObj->pitchOverride; } else { + GLuint dst_x, dst_y; + + intel_miptree_get_image_offset(intelObj->mt, intelObj->firstLevel, 0, 0, + &dst_x, &dst_y); + dri_bo_reference(intelObj->mt->region->buffer); i830->state.tex_buffer[unit] = intelObj->mt->region->buffer; - i830->state.tex_offset[unit] = intel_miptree_image_offset(intelObj->mt, - 0, intelObj-> - firstLevel); + /* XXX: This calculation is probably broken for tiled images with + * a non-page-aligned offset. + */ + i830->state.tex_offset[unit] = (dst_x + dst_y * intelObj->mt->pitch) * + intelObj->mt->cpp; format = translate_texture_format(firstImage->TexFormat->MesaFormat, firstImage->InternalFormat); diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index 32d4b30cf9..998a04f794 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -171,11 +171,18 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) pitch = intelObj->pitchOverride; } else { + GLuint dst_x, dst_y; + + intel_miptree_get_image_offset(intelObj->mt, intelObj->firstLevel, 0, 0, + &dst_x, &dst_y); + dri_bo_reference(intelObj->mt->region->buffer); i915->state.tex_buffer[unit] = intelObj->mt->region->buffer; - i915->state.tex_offset[unit] = intel_miptree_image_offset(intelObj->mt, - 0, intelObj-> - firstLevel); + /* XXX: This calculation is probably broken for tiled images with + * a non-page-aligned offset. + */ + i915->state.tex_offset[unit] = (dst_x + dst_y * intelObj->mt->pitch) * + intelObj->mt->cpp; format = translate_texture_format(firstImage->TexFormat->MesaFormat, firstImage->InternalFormat, -- cgit v1.2.3 From 517ae7a3b65bca6770e8738464aa0ef526cc88b4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 27 Oct 2009 16:28:39 -0600 Subject: glsl: fix memory leak A slightly modified version of a patch from Vinson Lee. --- src/mesa/shader/slang/slang_link.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index 71038d2d94..144c126525 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -104,7 +104,7 @@ link_varying_vars(GLcontext *ctx, GLuint *map, i, firstVarying, newFile; GLbitfield *inOutFlags; - map = (GLuint *) malloc(prog->Varying->NumParameters * sizeof(GLuint)); + map = (GLuint *) _mesa_malloc(prog->Varying->NumParameters * sizeof(GLuint)); if (!map) return GL_FALSE; @@ -135,6 +135,7 @@ link_varying_vars(GLcontext *ctx, &shProg->Varying->Parameters[j]; if (var->Size != v->Size) { link_error(shProg, "mismatched varying variable types"); + _mesa_free(map); return GL_FALSE; } if (!bits_agree(var->Flags, v->Flags, PROG_PARAM_BIT_CENTROID)) { @@ -142,6 +143,7 @@ link_varying_vars(GLcontext *ctx, _mesa_snprintf(msg, sizeof(msg), "centroid modifier mismatch for '%s'", var->Name); link_error(shProg, msg); + _mesa_free(map); return GL_FALSE; } if (!bits_agree(var->Flags, v->Flags, PROG_PARAM_BIT_INVARIANT)) { @@ -149,6 +151,7 @@ link_varying_vars(GLcontext *ctx, _mesa_snprintf(msg, sizeof(msg), "invariant modifier mismatch for '%s'", var->Name); link_error(shProg, msg); + _mesa_free(map); return GL_FALSE; } } @@ -160,6 +163,7 @@ link_varying_vars(GLcontext *ctx, if (shProg->Varying->NumParameters > ctx->Const.MaxVarying) { link_error(shProg, "Too many varying variables"); + _mesa_free(map); return GL_FALSE; } @@ -199,7 +203,7 @@ link_varying_vars(GLcontext *ctx, } } - free(map); + _mesa_free(map); /* these will get recomputed before linking is completed */ prog->InputsRead = 0x0; -- cgit v1.2.3 From 22575abdec73312e010e016e381f7cf8761ad652 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 27 Oct 2009 16:39:01 -0600 Subject: intel: fix src offset bug in do_copy_texsubimage() Use src->draw_offset intead of zero. Zero usually worked, except when the src renderbuffer is actually a texture mipmap level higher than zero. Fixes progs/test/blitfb.c test. --- src/mesa/drivers/dri/intel/intel_tex_copy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c index 9d58b11b14..95dee60f9c 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_copy.c +++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c @@ -158,7 +158,7 @@ do_copy_texsubimage(struct intel_context *intel, intelImage->mt->cpp, src_pitch, src->buffer, - 0, + src->draw_offset, src->tiling, intelImage->mt->pitch, dst_bo, -- cgit v1.2.3 From fe818ea797033d77b814ee88c5b4e220226556ab Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 26 Oct 2009 10:42:45 -0600 Subject: intel: fix GL state bugs in intel_texture_bitmap() Need to push texture state and polygon state too. Fixes rendering glitches seen in progs/demos/engine when changing the rendering mode (wireframe, texture modes). This makes bitmap rendering a little slower, unfortunately. --- src/mesa/drivers/dri/intel/intel_pixel_bitmap.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c index 9a0bcc07a5..f313f8e442 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c @@ -435,13 +435,14 @@ intel_texture_bitmap(GLcontext * ctx, } /* Save GL state before we start setting up our drawing */ - _mesa_PushAttrib(GL_ENABLE_BIT | GL_CURRENT_BIT | - GL_VIEWPORT_BIT); + _mesa_PushAttrib(GL_ENABLE_BIT | GL_CURRENT_BIT | GL_POLYGON_BIT | + GL_TEXTURE_BIT | GL_VIEWPORT_BIT); _mesa_PushClientAttrib(GL_CLIENT_VERTEX_ARRAY_BIT | GL_CLIENT_PIXEL_STORE_BIT); old_active_texture = ctx->Texture.CurrentUnit; _mesa_Disable(GL_POLYGON_STIPPLE); + _mesa_PolygonMode(GL_FRONT_AND_BACK, GL_FILL); /* Upload our bitmap data to an alpha texture */ _mesa_ActiveTextureARB(GL_TEXTURE0_ARB); @@ -501,8 +502,6 @@ intel_texture_bitmap(GLcontext * ctx, meta_restore_vertex_program(&intel->meta); _mesa_PopClientAttrib(); - _mesa_Disable(GL_TEXTURE_2D); /* asserted that it was disabled at entry */ - _mesa_ActiveTextureARB(GL_TEXTURE0_ARB + old_active_texture); _mesa_PopAttrib(); _mesa_DeleteTextures(1, &texname); -- cgit v1.2.3 From 755161b88843f3cfead9a02e076d1a04687d9082 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 27 Oct 2009 09:27:44 -0600 Subject: Revert "i965: fix hacked Fallback usage in brw_prepare_vertices()" This reverts commit 8810b8f67135185d1044746bb861fe2ff997626c. It turns out the i965 driver uses the intel->Fallback field as a boolean, not as a bitmask. The intelFallback() function is a no-op in the i965 driver. It would have been nice if there were some comments about this. I'll fix that next... --- src/mesa/drivers/dri/i965/brw_context.h | 2 -- src/mesa/drivers/dri/i965/brw_draw_upload.c | 6 ++---- 2 files changed, 2 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index 01b6a4a168..7834569761 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -116,8 +116,6 @@ */ -#define BRW_FALLBACK_DRAW (INTEL_FALLBACK_DRIVER << 0) - #define BRW_MAX_CURBE (32*16) struct brw_context; diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index 375afadcbe..a3ff6c58d8 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -375,10 +375,9 @@ static void brw_prepare_vertices(struct brw_context *brw) * isn't an issue at this point. */ if (brw->vb.nr_enabled >= BRW_VEP_MAX) { - FALLBACK(intel, BRW_FALLBACK_DRAW, GL_TRUE); + intel->Fallback = 1; return; } - FALLBACK(intel, BRW_FALLBACK_DRAW, GL_FALSE); for (i = 0; i < brw->vb.nr_enabled; i++) { struct brw_vertex_element *input = brw->vb.enabled[i]; @@ -428,10 +427,9 @@ static void brw_prepare_vertices(struct brw_context *brw) /* Position array not properly enabled: */ if (input->glarray->StrideB == 0) { - FALLBACK(intel, BRW_FALLBACK_DRAW, GL_TRUE); + intel->Fallback = 1; return; } - FALLBACK(intel, BRW_FALLBACK_DRAW, GL_FALSE); interleave = input->glarray->StrideB; ptr = input->glarray->Ptr; -- cgit v1.2.3 From e9b17d6477f99838fc7f261ea1b8d47eea12f42f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 27 Oct 2009 09:31:31 -0600 Subject: i965: be clear that the Fallback field is a boolean, not a bitfield --- src/mesa/drivers/dri/i965/brw_draw_upload.c | 4 ++-- src/mesa/drivers/dri/i965/brw_fallback.c | 6 +++++- src/mesa/drivers/dri/i965/brw_state_upload.c | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index a3ff6c58d8..0fefbd9d81 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -375,7 +375,7 @@ static void brw_prepare_vertices(struct brw_context *brw) * isn't an issue at this point. */ if (brw->vb.nr_enabled >= BRW_VEP_MAX) { - intel->Fallback = 1; + intel->Fallback = GL_TRUE; /* boolean, not bitfield */ return; } @@ -427,7 +427,7 @@ static void brw_prepare_vertices(struct brw_context *brw) /* Position array not properly enabled: */ if (input->glarray->StrideB == 0) { - intel->Fallback = 1; + intel->Fallback = GL_TRUE; /* boolean, not bitfield */ return; } diff --git a/src/mesa/drivers/dri/i965/brw_fallback.c b/src/mesa/drivers/dri/i965/brw_fallback.c index d27c6c24ca..562a17844b 100644 --- a/src/mesa/drivers/dri/i965/brw_fallback.c +++ b/src/mesa/drivers/dri/i965/brw_fallback.c @@ -133,7 +133,11 @@ const struct brw_tracked_state brw_check_fallback = { -/* Not used: +/** + * Called by the INTEL_FALLBACK() macro. + * NOTE: this is a no-op for the i965 driver. The brw->intel.Fallback + * field is treated as a boolean, not a bitmask. It's only set in a + * couple of places. */ void intelFallback( struct intel_context *intel, GLuint bit, GLboolean mode ) { diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index b817b741e7..ee447afa62 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -308,7 +308,7 @@ void brw_validate_state( struct brw_context *brw ) if (brw->state.dirty.brw & BRW_NEW_CONTEXT) brw_clear_batch_cache(brw); - brw->intel.Fallback = 0; + brw->intel.Fallback = GL_FALSE; /* boolean, not bitfield */ /* do prepare stage for all atoms */ for (i = 0; i < Elements(atoms); i++) { -- cgit v1.2.3 From 4f9f5a78408dbd86b2f9c25ee8a15581b9122fcc Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 27 Oct 2009 10:26:09 -0700 Subject: i915: Fix driver for the miptree x/y offset changes. Bug #24734. --- src/mesa/drivers/dri/i915/i830_texstate.c | 12 ++++++++++-- src/mesa/drivers/dri/i915/i915_texstate.c | 12 ++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i830_texstate.c b/src/mesa/drivers/dri/i915/i830_texstate.c index f270a13781..20ff46b0b0 100644 --- a/src/mesa/drivers/dri/i915/i830_texstate.c +++ b/src/mesa/drivers/dri/i915/i830_texstate.c @@ -160,10 +160,18 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) pitch = intelObj->pitchOverride; } else { + GLuint dst_x, dst_y; + + intel_miptree_get_image_offset(intelObj->mt, intelObj->firstLevel, 0, 0, + &dst_x, &dst_y); + dri_bo_reference(intelObj->mt->region->buffer); i830->state.tex_buffer[unit] = intelObj->mt->region->buffer; - i830->state.tex_offset[unit] = - intel_miptree_image_offset(intelObj->mt, 0, intelObj->firstLevel, 0); + /* XXX: This calculation is probably broken for tiled images with + * a non-page-aligned offset. + */ + i830->state.tex_offset[unit] = (dst_x + dst_y * intelObj->mt->pitch) * + intelObj->mt->cpp; format = translate_texture_format(firstImage->TexFormat->MesaFormat, firstImage->InternalFormat); diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index b2f82f5655..998a04f794 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -171,10 +171,18 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) pitch = intelObj->pitchOverride; } else { + GLuint dst_x, dst_y; + + intel_miptree_get_image_offset(intelObj->mt, intelObj->firstLevel, 0, 0, + &dst_x, &dst_y); + dri_bo_reference(intelObj->mt->region->buffer); i915->state.tex_buffer[unit] = intelObj->mt->region->buffer; - i915->state.tex_offset[unit] = - intel_miptree_image_offset(intelObj->mt, 0, intelObj->firstLevel, 0); + /* XXX: This calculation is probably broken for tiled images with + * a non-page-aligned offset. + */ + i915->state.tex_offset[unit] = (dst_x + dst_y * intelObj->mt->pitch) * + intelObj->mt->cpp; format = translate_texture_format(firstImage->TexFormat->MesaFormat, firstImage->InternalFormat, -- cgit v1.2.3 From 4c2a7bc4380017bec53a88cd9a8385cad73a9f0d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 27 Oct 2009 16:28:39 -0600 Subject: glsl: fix memory leak A slightly modified version of a patch from Vinson Lee. --- src/mesa/shader/slang/slang_link.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index 71038d2d94..144c126525 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -104,7 +104,7 @@ link_varying_vars(GLcontext *ctx, GLuint *map, i, firstVarying, newFile; GLbitfield *inOutFlags; - map = (GLuint *) malloc(prog->Varying->NumParameters * sizeof(GLuint)); + map = (GLuint *) _mesa_malloc(prog->Varying->NumParameters * sizeof(GLuint)); if (!map) return GL_FALSE; @@ -135,6 +135,7 @@ link_varying_vars(GLcontext *ctx, &shProg->Varying->Parameters[j]; if (var->Size != v->Size) { link_error(shProg, "mismatched varying variable types"); + _mesa_free(map); return GL_FALSE; } if (!bits_agree(var->Flags, v->Flags, PROG_PARAM_BIT_CENTROID)) { @@ -142,6 +143,7 @@ link_varying_vars(GLcontext *ctx, _mesa_snprintf(msg, sizeof(msg), "centroid modifier mismatch for '%s'", var->Name); link_error(shProg, msg); + _mesa_free(map); return GL_FALSE; } if (!bits_agree(var->Flags, v->Flags, PROG_PARAM_BIT_INVARIANT)) { @@ -149,6 +151,7 @@ link_varying_vars(GLcontext *ctx, _mesa_snprintf(msg, sizeof(msg), "invariant modifier mismatch for '%s'", var->Name); link_error(shProg, msg); + _mesa_free(map); return GL_FALSE; } } @@ -160,6 +163,7 @@ link_varying_vars(GLcontext *ctx, if (shProg->Varying->NumParameters > ctx->Const.MaxVarying) { link_error(shProg, "Too many varying variables"); + _mesa_free(map); return GL_FALSE; } @@ -199,7 +203,7 @@ link_varying_vars(GLcontext *ctx, } } - free(map); + _mesa_free(map); /* these will get recomputed before linking is completed */ prog->InputsRead = 0x0; -- cgit v1.2.3 From 3e45788d5dd7af4635988d8fd9f1bfaa77d1dd9c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 27 Oct 2009 16:39:01 -0600 Subject: intel: fix src offset bug in do_copy_texsubimage() Use src->draw_offset intead of zero. Zero usually worked, except when the src renderbuffer is actually a texture mipmap level higher than zero. Fixes progs/test/blitfb.c test. --- src/mesa/drivers/dri/intel/intel_tex_copy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c index c7c48e3d97..7e0fed89f4 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_copy.c +++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c @@ -158,7 +158,7 @@ do_copy_texsubimage(struct intel_context *intel, intelImage->mt->cpp, src_pitch, src->buffer, - 0, + src->draw_offset, src->tiling, intelImage->mt->pitch, dst_bo, -- cgit v1.2.3 From 33531614de94d396d10a3bed4a020abe2e2a40b5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 26 Oct 2009 17:00:48 -0600 Subject: intel: fix comment, formatting --- src/mesa/drivers/dri/intel/intel_buffers.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c index e7357e78c5..a36438b5e8 100644 --- a/src/mesa/drivers/dri/intel/intel_buffers.c +++ b/src/mesa/drivers/dri/intel/intel_buffers.c @@ -192,7 +192,7 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb) } else { /* Get the intel_renderbuffer for the single colorbuffer we're drawing - * into, and set up cliprects if it's . + * into, and set up cliprects if it's a DRI1 window front buffer. */ if (fb->Name == 0) { intel->constant_cliprect = intel->driScreen->dri2.enabled; @@ -209,7 +209,7 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb) if (!intel->constant_cliprect && intel->front_cliprects) intel_batchbuffer_flush(intel->batch); intel->front_cliprects = GL_FALSE; - colorRegions[0]= intel_get_rb_region(fb, BUFFER_BACK_LEFT); + colorRegions[0] = intel_get_rb_region(fb, BUFFER_BACK_LEFT); } } else { -- cgit v1.2.3 From 72cb441c2feb7e5f11fc84a2d9f551da94ce2f16 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 27 Oct 2009 13:51:51 -0600 Subject: mesa: avoid redundant state setting in glClientActiveTexture Plus add code for verbose/debugging. --- src/mesa/main/texstate.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 16492bd7bc..c735e18aff 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -318,11 +318,18 @@ _mesa_ClientActiveTextureARB(GLenum texture) GLuint texUnit = texture - GL_TEXTURE0; ASSERT_OUTSIDE_BEGIN_END(ctx); + if (MESA_VERBOSE & (VERBOSE_API | VERBOSE_TEXTURE)) + _mesa_debug(ctx, "glClientActiveTexture %s\n", + _mesa_lookup_enum_by_nr(texture)); + if (texUnit >= ctx->Const.MaxTextureCoordUnits) { _mesa_error(ctx, GL_INVALID_ENUM, "glClientActiveTexture(texture)"); return; } + if (ctx->Array.ActiveTexture == texUnit) + return; + FLUSH_VERTICES(ctx, _NEW_ARRAY); ctx->Array.ActiveTexture = texUnit; } -- cgit v1.2.3 From 58a4328e96160ad6c529edb321cdc5ea929a3f02 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 27 Oct 2009 13:52:37 -0600 Subject: mesa: minor code clean-up in client_state() --- src/mesa/main/enable.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 4383aed669..12ce14c5d0 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -55,46 +55,47 @@ static void client_state(GLcontext *ctx, GLenum cap, GLboolean state) { + struct gl_array_object *arrayObj = ctx->Array.ArrayObj; GLuint flag; GLboolean *var; switch (cap) { case GL_VERTEX_ARRAY: - var = &ctx->Array.ArrayObj->Vertex.Enabled; + var = &arrayObj->Vertex.Enabled; flag = _NEW_ARRAY_VERTEX; break; case GL_NORMAL_ARRAY: - var = &ctx->Array.ArrayObj->Normal.Enabled; + var = &arrayObj->Normal.Enabled; flag = _NEW_ARRAY_NORMAL; break; case GL_COLOR_ARRAY: - var = &ctx->Array.ArrayObj->Color.Enabled; + var = &arrayObj->Color.Enabled; flag = _NEW_ARRAY_COLOR0; break; case GL_INDEX_ARRAY: - var = &ctx->Array.ArrayObj->Index.Enabled; + var = &arrayObj->Index.Enabled; flag = _NEW_ARRAY_INDEX; break; case GL_TEXTURE_COORD_ARRAY: - var = &ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled; + var = &arrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled; flag = _NEW_ARRAY_TEXCOORD(ctx->Array.ActiveTexture); break; case GL_EDGE_FLAG_ARRAY: - var = &ctx->Array.ArrayObj->EdgeFlag.Enabled; + var = &arrayObj->EdgeFlag.Enabled; flag = _NEW_ARRAY_EDGEFLAG; break; case GL_FOG_COORDINATE_ARRAY_EXT: - var = &ctx->Array.ArrayObj->FogCoord.Enabled; + var = &arrayObj->FogCoord.Enabled; flag = _NEW_ARRAY_FOGCOORD; break; case GL_SECONDARY_COLOR_ARRAY_EXT: - var = &ctx->Array.ArrayObj->SecondaryColor.Enabled; + var = &arrayObj->SecondaryColor.Enabled; flag = _NEW_ARRAY_COLOR1; break; #if FEATURE_point_size_array case GL_POINT_SIZE_ARRAY_OES: - var = &ctx->Array.ArrayObj->PointSize.Enabled; + var = &arrayObj->PointSize.Enabled; flag = _NEW_ARRAY_POINT_SIZE; break; #endif @@ -120,7 +121,7 @@ client_state(GLcontext *ctx, GLenum cap, GLboolean state) { GLint n = (GLint) cap - GL_VERTEX_ATTRIB_ARRAY0_NV; ASSERT(n < Elements(ctx->Array.ArrayObj->VertexAttrib)); - var = &ctx->Array.ArrayObj->VertexAttrib[n].Enabled; + var = &arrayObj->VertexAttrib[n].Enabled; flag = _NEW_ARRAY_ATTRIB(n); } break; -- cgit v1.2.3 From 403181b91355c733883d0a6d7f48440212226d45 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 27 Oct 2009 13:59:32 -0600 Subject: mesa: more texture debug code changes, improvements --- src/mesa/main/debug.c | 93 ++++++++++++++++++++++++++++++++++++--------------- src/mesa/main/debug.h | 6 ++-- 2 files changed, 69 insertions(+), 30 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 0e35617575..24ced0d6c9 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -58,6 +58,31 @@ const char *_mesa_prim_name[GL_POLYGON+4] = { "unknown state" }; + +static const char * +tex_target_name(GLenum tgt) +{ + static const struct { + GLenum target; + const char *name; + } tex_targets[] = { + { GL_TEXTURE_1D, "GL_TEXTURE_1D" }, + { GL_TEXTURE_2D, "GL_TEXTURE_2D" }, + { GL_TEXTURE_3D, "GL_TEXTURE_3D" }, + { GL_TEXTURE_CUBE_MAP, "GL_TEXTURE_CUBE_MAP" }, + { GL_TEXTURE_RECTANGLE, "GL_TEXTURE_RECTANGLE" }, + { GL_TEXTURE_1D_ARRAY_EXT, "GL_TEXTURE_1D_ARRAY" }, + { GL_TEXTURE_2D_ARRAY_EXT, "GL_TEXTURE_2D_ARRAY" } + }; + GLuint i; + for (i = 0; i < Elements(tex_targets); i++) { + if (tex_targets[i].target == tgt) + return tex_targets[i].name; + } + return "UNKNOWN TEX TARGET"; +} + + void _mesa_print_state( const char *msg, GLuint state ) { @@ -291,7 +316,7 @@ write_texture_image(struct gl_texture_object *texObj, buffer, texObj, img); /* make filename */ - _mesa_sprintf(s, "/tmp/teximage%u.ppm", texObj->Name); + _mesa_sprintf(s, "/tmp/tex%u.l%u.f%u.ppm", texObj->Name, level, face); _mesa_printf(" Writing image level %u to %s\n", level, s); write_ppm(s, buffer, img->Width, img->Height, 4, 0, 1, 2, GL_FALSE); @@ -342,27 +367,36 @@ write_renderbuffer_image(const struct gl_renderbuffer *rb) } -static GLboolean DumpImages; +/** How many texture images (mipmap levels, faces) to write to files */ +#define WRITE_NONE 0 +#define WRITE_ONE 1 +#define WRITE_ALL 2 + +static GLuint WriteImages; static void -dump_texture(struct gl_texture_object *texObj) +dump_texture(struct gl_texture_object *texObj, GLuint writeImages) { - int i; + const GLuint numFaces = texObj->Target == GL_TEXTURE_CUBE_MAP ? 6 : 1; GLboolean written = GL_FALSE; + GLuint i, j; _mesa_printf("Texture %u\n", texObj->Name); - _mesa_printf(" Target 0x%x\n", texObj->Target); + _mesa_printf(" Target %s\n", tex_target_name(texObj->Target)); for (i = 0; i < MAX_TEXTURE_LEVELS; i++) { - struct gl_texture_image *texImg = texObj->Image[0][i]; - if (texImg) { - _mesa_printf(" Image %u: %d x %d x %d, format %u at %p\n", i, - texImg->Width, texImg->Height, texImg->Depth, - texImg->TexFormat->MesaFormat, texImg->Data); - if (DumpImages && !written) { - GLuint face = 0; - write_texture_image(texObj, face, i); - written = GL_TRUE; + for (j = 0; j < numFaces; j++) { + struct gl_texture_image *texImg = texObj->Image[j][i]; + if (texImg) { + _mesa_printf(" Face %u level %u: %d x %d x %d, format %u at %p\n", + j, i, + texImg->Width, texImg->Height, texImg->Depth, + texImg->TexFormat->MesaFormat, texImg->Data); + if (writeImages == WRITE_ALL || + (writeImages == WRITE_ONE && !written)) { + write_texture_image(texObj, j, i); + written = GL_TRUE; + } } } } @@ -373,13 +407,12 @@ dump_texture(struct gl_texture_object *texObj) * Dump a single texture. */ void -_mesa_dump_texture(GLuint texture, GLboolean dumpImages) +_mesa_dump_texture(GLuint texture, GLuint writeImages) { GET_CURRENT_CONTEXT(ctx); struct gl_texture_object *texObj = _mesa_lookup_texture(ctx, texture); if (texObj) { - DumpImages = dumpImages; - dump_texture(texObj); + dump_texture(texObj, writeImages); } } @@ -389,7 +422,7 @@ dump_texture_cb(GLuint id, void *data, void *userData) { struct gl_texture_object *texObj = (struct gl_texture_object *) data; (void) userData; - dump_texture(texObj); + dump_texture(texObj, WriteImages); } @@ -398,38 +431,44 @@ dump_texture_cb(GLuint id, void *data, void *userData) * If dumpImages is true, write PPM of level[0] image to a file. */ void -_mesa_dump_textures(GLboolean dumpImages) +_mesa_dump_textures(GLuint writeImages) { GET_CURRENT_CONTEXT(ctx); - DumpImages = dumpImages; + WriteImages = writeImages; _mesa_HashWalk(ctx->Shared->TexObjects, dump_texture_cb, ctx); } static void -dump_renderbuffer_cb(GLuint id, void *data, void *userData) +dump_renderbuffer(const struct gl_renderbuffer *rb, GLboolean writeImage) { - const struct gl_renderbuffer *rb = (const struct gl_renderbuffer *) data; - (void) userData; - _mesa_printf("Renderbuffer %u: %u x %u IntFormat = %s\n", rb->Name, rb->Width, rb->Height, _mesa_lookup_enum_by_nr(rb->InternalFormat)); - if (DumpImages) { + if (writeImage) { write_renderbuffer_image(rb); } } +static void +dump_renderbuffer_cb(GLuint id, void *data, void *userData) +{ + const struct gl_renderbuffer *rb = (const struct gl_renderbuffer *) data; + (void) userData; + dump_renderbuffer(rb, WriteImages); +} + + /** * Print basic info about all renderbuffers to stdout. * If dumpImages is true, write PPM of level[0] image to a file. */ void -_mesa_dump_renderbuffers(GLboolean dumpImages) +_mesa_dump_renderbuffers(GLboolean writeImages) { GET_CURRENT_CONTEXT(ctx); - DumpImages = dumpImages; + WriteImages = writeImages; _mesa_HashWalk(ctx->Shared->RenderBuffers, dump_renderbuffer_cb, ctx); } diff --git a/src/mesa/main/debug.h b/src/mesa/main/debug.h index f66f774a45..d12ea602dd 100644 --- a/src/mesa/main/debug.h +++ b/src/mesa/main/debug.h @@ -58,13 +58,13 @@ extern void _mesa_init_debug( GLcontext *ctx ); #endif extern void -_mesa_dump_texture(GLuint texture, GLboolean dumpImages); +_mesa_dump_texture(GLuint texture, GLuint writeImages); extern void -_mesa_dump_textures(GLboolean dumpImages); +_mesa_dump_textures(GLuint writeImages); extern void -_mesa_dump_renderbuffers(GLboolean dumpImages); +_mesa_dump_renderbuffers(GLboolean writeImages); extern void _mesa_dump_color_buffer(const char *filename); -- cgit v1.2.3 From 05ec586851290698730990cd810e1fe4d74d2749 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 27 Oct 2009 14:16:59 -0600 Subject: mesa: s/Bilt/Blit --- src/mesa/drivers/common/meta.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index b38f22e130..64b77d864c 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -1025,7 +1025,7 @@ init_blit_depth_pixels(GLcontext *ctx) /** - * Try to do a glBiltFramebuffer using no-copy texturing. + * Try to do a glBlitFramebuffer using no-copy texturing. * We can do this when the src renderbuffer is actually a texture. * But if the src buffer == dst buffer we cannot do this. * -- cgit v1.2.3 From 7fd8c6ca2a6e94d60c02e9c271b00c565c2464cb Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 27 Oct 2009 16:37:00 -0600 Subject: intel: use _mesa_get_current_tex_unit() helper --- src/mesa/drivers/dri/intel/intel_tex_copy.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c index 7e0fed89f4..0284687164 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_copy.c +++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c @@ -29,6 +29,7 @@ #include "main/enums.h" #include "main/image.h" #include "main/teximage.h" +#include "main/texstate.h" #include "main/mipmap.h" #include "drivers/common/meta.h" @@ -183,8 +184,7 @@ intelCopyTexImage1D(GLcontext * ctx, GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border) { - struct gl_texture_unit *texUnit = - &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); struct gl_texture_object *texObj = _mesa_select_tex_object(ctx, texUnit, target); struct gl_texture_image *texImage = @@ -231,8 +231,7 @@ intelCopyTexImage2D(GLcontext * ctx, GLenum target, GLint level, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) { - struct gl_texture_unit *texUnit = - &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); struct gl_texture_object *texObj = _mesa_select_tex_object(ctx, texUnit, target); struct gl_texture_image *texImage = @@ -247,7 +246,7 @@ intelCopyTexImage2D(GLcontext * ctx, GLenum target, GLint level, */ ctx->Driver.TexImage2D(ctx, target, level, internalFormat, width, height, border, - GL_RGBA, CHAN_TYPE, NULL, + GL_RGBA, GL_UNSIGNED_BYTE, NULL, &ctx->DefaultPacking, texObj, texImage); srcx = x; @@ -277,8 +276,7 @@ static void intelCopyTexSubImage1D(GLcontext * ctx, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width) { - struct gl_texture_unit *texUnit = - &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); struct gl_texture_object *texObj = _mesa_select_tex_object(ctx, texUnit, target); struct gl_texture_image *texImage = @@ -303,8 +301,7 @@ intelCopyTexSubImage2D(GLcontext * ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) { - struct gl_texture_unit *texUnit = - &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; + struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); struct gl_texture_object *texObj = _mesa_select_tex_object(ctx, texUnit, target); struct gl_texture_image *texImage = -- cgit v1.2.3 From 3c716669211c00d106ded2df342b4a2525f4795b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 27 Oct 2009 16:37:25 -0600 Subject: intel: minor clean-up, comments --- src/mesa/drivers/dri/intel/intel_tex_copy.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c index 0284687164..bb21dd5ed9 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_copy.c +++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c @@ -93,8 +93,7 @@ do_copy_texsubimage(struct intel_context *intel, GLint x, GLint y, GLsizei width, GLsizei height) { GLcontext *ctx = &intel->ctx; - const struct intel_region *src = - get_teximage_source(intel, internalFormat); + const struct intel_region *src = get_teximage_source(intel, internalFormat); if (!intelImage->mt || !src) { if (INTEL_DEBUG & DEBUG_FALLBACKS) @@ -121,6 +120,7 @@ do_copy_texsubimage(struct intel_context *intel, GLuint image_x, image_y; GLshort src_pitch; + /* get dest x/y in destination texture */ intel_miptree_get_image_offset(intelImage->mt, intelImage->level, intelImage->face, @@ -155,6 +155,7 @@ do_copy_texsubimage(struct intel_context *intel, src_pitch = src->pitch; } + /* blit from src buffer to texture */ if (!intelEmitCopyBlit(intel, intelImage->mt->cpp, src_pitch, -- cgit v1.2.3 From 507cf530b951b5a65999dd4ed7529824bd035087 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 27 Oct 2009 16:55:31 -0600 Subject: via: silence unused var warnings --- src/mesa/drivers/dri/unichrome/via_ioctl.c | 2 -- src/mesa/drivers/dri/unichrome/via_screen.c | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/unichrome/via_ioctl.c b/src/mesa/drivers/dri/unichrome/via_ioctl.c index 6746f552ae..b34c133600 100644 --- a/src/mesa/drivers/dri/unichrome/via_ioctl.c +++ b/src/mesa/drivers/dri/unichrome/via_ioctl.c @@ -886,8 +886,6 @@ void viaFlushDmaLocked(struct via_context *vmesa, GLuint flags) else if (vmesa->numClipRects) { drm_clip_rect_t *pbox = vmesa->pClipRects; __DRIdrawablePrivate *dPriv = vmesa->driDrawable; - struct via_renderbuffer *const vrb = - (struct via_renderbuffer *) dPriv->driverPrivate; for (i = 0; i < vmesa->numClipRects; i++) { drm_clip_rect_t b; diff --git a/src/mesa/drivers/dri/unichrome/via_screen.c b/src/mesa/drivers/dri/unichrome/via_screen.c index 7cfc60a015..966ac41474 100644 --- a/src/mesa/drivers/dri/unichrome/via_screen.c +++ b/src/mesa/drivers/dri/unichrome/via_screen.c @@ -208,7 +208,9 @@ viaCreateBuffer(__DRIscreenPrivate *driScrnPriv, const __GLcontextModes *mesaVis, GLboolean isPixmap) { +#if 0 viaScreenPrivate *screen = (viaScreenPrivate *) driScrnPriv->private; +#endif GLboolean swStencil = (mesaVis->stencilBits > 0 && mesaVis->depthBits != 24); -- cgit v1.2.3 From 21f8d31cfd9612fdf2bd39901472a6f3f11ddfda Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 27 Oct 2009 16:59:23 -0600 Subject: mesa: debug code for glBlitFramebuffer() --- src/mesa/main/fbobject.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 0040099a69..55709ebf9e 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -51,6 +51,9 @@ /** Set this to 1 to help debug FBO incompleteness problems */ #define DEBUG_FBO 0 +/** Set this to 1 to debug/log glBlitFramebuffer() calls */ +#define DEBUG_BLIT 0 + /** * Notes: @@ -1932,6 +1935,20 @@ _mesa_GenerateMipmapEXT(GLenum target) #if FEATURE_EXT_framebuffer_blit + +static const struct gl_renderbuffer_attachment * +find_attachment(const struct gl_framebuffer *fb, const struct gl_renderbuffer *rb) +{ + GLuint i; + for (i = 0; i < Elements(fb->Attachment); i++) { + if (fb->Attachment[i].Renderbuffer == rb) + return &fb->Attachment[i]; + } + return NULL; +} + + + /** * Blit rectangular region, optionally from one framebuffer to another. * @@ -2059,6 +2076,44 @@ _mesa_BlitFramebufferEXT(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, return; } + /* Debug code */ + if (DEBUG_BLIT) { + _mesa_printf("glBlitFramebuffer(%d, %d, %d, %d, %d, %d, %d, %d," + " 0x%x, 0x%x)\n", + srcX0, srcY0, srcX1, srcY1, + dstX0, dstY0, dstX1, dstY1, + mask, filter); + if (colorReadRb) { + const struct gl_renderbuffer_attachment *att; + + att = find_attachment(readFb, colorReadRb); + _mesa_printf(" Src FBO %u RB %u (%dx%d) ", + readFb->Name, colorReadRb->Name, + colorReadRb->Width, colorReadRb->Height); + if (att && att->Texture) { + _mesa_printf("Tex %u tgt 0x%x level %u face %u", + att->Texture->Name, + att->Texture->Target, + att->TextureLevel, + att->CubeMapFace); + } + _mesa_printf("\n"); + + att = find_attachment(drawFb, colorDrawRb); + _mesa_printf(" Dst FBO %u RB %u (%dx%d) ", + drawFb->Name, colorDrawRb->Name, + colorDrawRb->Width, colorDrawRb->Height); + if (att && att->Texture) { + _mesa_printf("Tex %u tgt 0x%x level %u face %u", + att->Texture->Name, + att->Texture->Target, + att->TextureLevel, + att->CubeMapFace); + } + _mesa_printf("\n"); + } + } + ASSERT(ctx->Driver.BlitFramebuffer); ctx->Driver.BlitFramebuffer(ctx, srcX0, srcY0, srcX1, srcY1, -- cgit v1.2.3 From f8155ef51f10bd7f084ea676f7b70af8ef429caa Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 27 Oct 2009 17:01:26 -0600 Subject: intel: silence warning --- src/mesa/drivers/dri/intel/intel_pixel_bitmap.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c index f313f8e442..99330b6ddf 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c @@ -33,6 +33,7 @@ #include "main/macros.h" #include "main/bufferobj.h" #include "main/pixelstore.h" +#include "main/polygon.h" #include "main/state.h" #include "main/teximage.h" #include "main/texenv.h" -- cgit v1.2.3 From 52374d7e4cc183fb783a7012b026d4254ca43b14 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 27 Oct 2009 17:05:08 -0600 Subject: radeon: add case for MESA_FORMAT_X8_Z24 in radeon_create_renderbuffer() --- src/mesa/drivers/dri/radeon/radeon_fbo.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index 3f0ab83996..9e6e8994fa 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -280,12 +280,17 @@ radeon_create_renderbuffer(gl_format format, __DRIdrawablePrivate *driDrawPriv) rrb->base.DataType = GL_UNSIGNED_SHORT; rrb->base._BaseFormat = GL_DEPTH_COMPONENT; break; + case MESA_FORMAT_X8_Z24: + rrb->base.DataType = GL_UNSIGNED_INT; + rrb->base._BaseFormat = GL_DEPTH_COMPONENT; + break; case MESA_FORMAT_S8_Z24: rrb->base.DataType = GL_UNSIGNED_INT_24_8_EXT; rrb->base._BaseFormat = GL_DEPTH_STENCIL; break; default: - fprintf(stderr, "%s: Unknown format 0x%04x\n", __FUNCTION__, format); + fprintf(stderr, "%s: Unknown format %s\n", + __FUNCTION__, _mesa_get_format_name(format)); _mesa_delete_renderbuffer(&rrb->base); return NULL; } -- cgit v1.2.3 From b7eea8c616092f5473a323fba585b04c47ae2010 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 27 Oct 2009 17:34:29 -0600 Subject: intel: added region draw_x/y offsets in x/y_tile_swizzle() funcs This fixes the second part of bug 23552. --- src/mesa/drivers/dri/intel/intel_span.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index 8df4990880..e71366a182 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -163,6 +163,9 @@ static uint32_t x_tile_swizzle(struct intel_renderbuffer *irb, int x_tile_number, y_tile_number; int tile_off, tile_base; + x += irb->region->draw_x; + y += irb->region->draw_y; + tile_stride = (irb->region->pitch * irb->region->cpp) << 3; xbyte = x * irb->region->cpp; @@ -218,6 +221,9 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb, int x_tile_number, y_tile_number; int tile_off, tile_base; + x += irb->region->draw_x; + y += irb->region->draw_y; + tile_stride = (irb->region->pitch * irb->region->cpp) << 5; xbyte = x * irb->region->cpp; -- cgit v1.2.3 From 2643a7ba2972ab8284aa911cc92ab0be163cb92f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 20 Oct 2009 14:51:53 -0700 Subject: intel: Fix flipped condition in ARB_sync GetSYnciv(GL_SYNC_STATUS). Bug #24435 (cherry picked from commit d56125a298106d81e10674f1c4b3b43b51a5139d) --- src/mesa/drivers/dri/intel/intel_syncobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_syncobj.c b/src/mesa/drivers/dri/intel/intel_syncobj.c index 1286fe929b..0d7889d3c2 100644 --- a/src/mesa/drivers/dri/intel/intel_syncobj.c +++ b/src/mesa/drivers/dri/intel/intel_syncobj.c @@ -114,7 +114,7 @@ static void intel_check_sync(GLcontext *ctx, struct gl_sync_object *s) { struct intel_sync_object *sync = (struct intel_sync_object *)s; - if (sync->bo && drm_intel_bo_busy(sync->bo)) { + if (sync->bo && !drm_intel_bo_busy(sync->bo)) { drm_intel_bo_unreference(sync->bo); sync->bo = NULL; s->StatusFlag = 1; -- cgit v1.2.3 From 0f255d195651f104a0c0bed84039b656d94ac4cc Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 27 Oct 2009 11:44:56 -0700 Subject: ARB prog parser: Don't leak symbol table header structures --- src/mesa/shader/symbol_table.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/shader/symbol_table.c b/src/mesa/shader/symbol_table.c index 7a9aa7b8f6..42601a7765 100644 --- a/src/mesa/shader/symbol_table.c +++ b/src/mesa/shader/symbol_table.c @@ -73,6 +73,9 @@ struct symbol { /** */ struct symbol_header { + /** Linkage in list of all headers in a given symbol table. */ + struct symbol_header *next; + /** Symbol name. */ const char *name; @@ -102,6 +105,9 @@ struct _mesa_symbol_table { /** Top of scope stack. */ struct scope_level *current_scope; + + /** List of all symbol headers in the table. */ + struct symbol_header *hdr; }; @@ -301,6 +307,8 @@ _mesa_symbol_table_add_symbol(struct _mesa_symbol_table *table, hdr->name = name; hash_table_insert(table->ht, hdr, name); + hdr->next = table->hdr; + table->hdr = hdr; } check_symbol_table(table); @@ -341,10 +349,18 @@ _mesa_symbol_table_ctor(void) void _mesa_symbol_table_dtor(struct _mesa_symbol_table *table) { + struct symbol_header *hdr; + struct symbol_header *next; + while (table->current_scope != NULL) { _mesa_symbol_table_pop_scope(table); } + for (hdr = table->hdr; hdr != NULL; hdr = next) { + next = hdr->next; + _mesa_free(hdr); + } + hash_table_dtor(table->ht); free(table); } -- cgit v1.2.3 From 8df9587d68752f3369cc1eda1606d3b7c1041ec6 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 27 Oct 2009 11:46:29 -0700 Subject: ARB prog parser: Don't leak program string The program string is kept in the program object. On the second call into glProgramStringARB the previous kept string would be leaked. --- src/mesa/shader/program_parse.y | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index ae9e15ae5a..c3152aa2f8 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -2278,6 +2278,10 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, _mesa_memcpy (strz, str, len); strz[len] = '\0'; + if (state->prog->String != NULL) { + _mesa_free(state->prog->String); + } + state->prog->String = strz; state->st = _mesa_symbol_table_ctor(); -- cgit v1.2.3 From 93dae6761bc90bbd43b450d2673620ec189b2c7a Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 27 Oct 2009 13:40:18 -0700 Subject: ARB prog parser: Fix epic memory leak in lexer / parser interface Anything that matched IDENTIFIER was strdup'ed and returned to the parser. However, almost every case of IDENTIFIER in the parser just dropped the returned string on the floor. Every swizzle string, every option string, every use of a variable, etc. leaked memory. Create a temporary buffer in the parser state (string_dumpster and dumpster_size). Return strings from the lexer to the parser in the buffer. Grow the buffer as needed. When the parser needs to keep a string (i.e., delcaring a new variable), let it make a copy then. The only leak that valgrind now detects is /occasionally/ the copy of the program string in gl_program::String is leaked. I'm not seeing how. :( --- src/mesa/shader/lex.yy.c | 445 ++++++++++++++++++++---------------- src/mesa/shader/program_lexer.l | 45 +++- src/mesa/shader/program_parse.tab.c | 21 +- src/mesa/shader/program_parse.y | 17 +- src/mesa/shader/program_parser.h | 16 ++ 5 files changed, 337 insertions(+), 207 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/lex.yy.c b/src/mesa/shader/lex.yy.c index fefef573ee..728c2dc272 100644 --- a/src/mesa/shader/lex.yy.c +++ b/src/mesa/shader/lex.yy.c @@ -53,7 +53,6 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -84,6 +83,8 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#endif /* ! C99 */ + #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -157,7 +158,15 @@ typedef void* yyscan_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -918,7 +927,7 @@ static yyconst flex_int16_t yy_chk[1023] = if (condition) { \ return token; \ } else { \ - yylval->string = strdup(yytext); \ + yylval->string = return_string(yyextra, yytext); \ return IDENTIFIER; \ } \ } while (0) @@ -941,7 +950,7 @@ static yyconst flex_int16_t yy_chk[1023] = yylval->temp_inst.SaturateMode = SATURATE_ ## sat; \ return token; \ } else { \ - yylval->string = strdup(yytext); \ + yylval->string = return_string(yyextra, yytext); \ return IDENTIFIER; \ } \ } while (0) @@ -949,6 +958,45 @@ static yyconst flex_int16_t yy_chk[1023] = #define SWIZZLE_INVAL MAKE_SWIZZLE4(SWIZZLE_NIL, SWIZZLE_NIL, \ SWIZZLE_NIL, SWIZZLE_NIL) +/** + * Send a string to the parser using asm_parser_state::string_dumpster + * + * Sends a string to the parser using asm_parser_state::string_dumpster as a + * temporary storage buffer. Data previously stored in + * asm_parser_state::string_dumpster will be lost. If + * asm_parser_state::string_dumpster is not large enough to hold the new + * string, the buffer size will be increased. The buffer size is \b never + * decreased. + * + * \param state Assembler parser state tracking + * \param str String to be passed to the parser + * + * \return + * A pointer to asm_parser_state::string_dumpster on success or \c NULL on + * failure. Currently the only failure case is \c ENOMEM. + */ +static char * +return_string(struct asm_parser_state *state, const char *str) +{ + const size_t len = strlen(str); + + if (len >= state->dumpster_size) { + char *const dumpster = _mesa_realloc(state->string_dumpster, + state->dumpster_size, + len + 1); + if (dumpster == NULL) { + return NULL; + } + + state->string_dumpster = dumpster; + state->dumpster_size = len + 1; + } + + memcpy(state->string_dumpster, str, len + 1); + return state->string_dumpster; +} + + static unsigned mask_from_char(char c) { @@ -1004,7 +1052,7 @@ swiz_from_char(char c) } while(0); #define YY_EXTRA_TYPE struct asm_parser_state * -#line 1008 "lex.yy.c" +#line 1056 "lex.yy.c" #define INITIAL 0 @@ -1141,7 +1189,12 @@ static int input (yyscan_t yyscanner ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -1149,7 +1202,7 @@ static int input (yyscan_t yyscanner ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO fwrite( yytext, yyleng, 1, yyout ) +#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1160,7 +1213,7 @@ static int input (yyscan_t yyscanner ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - unsigned n; \ + size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1245,10 +1298,10 @@ YY_DECL register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 137 "program_lexer.l" +#line 176 "program_lexer.l" -#line 1252 "lex.yy.c" +#line 1305 "lex.yy.c" yylval = yylval_param; @@ -1337,17 +1390,17 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 139 "program_lexer.l" +#line 178 "program_lexer.l" { return ARBvp_10; } YY_BREAK case 2: YY_RULE_SETUP -#line 140 "program_lexer.l" +#line 179 "program_lexer.l" { return ARBfp_10; } YY_BREAK case 3: YY_RULE_SETUP -#line 141 "program_lexer.l" +#line 180 "program_lexer.l" { yylval->integer = at_address; return_token_or_IDENTIFIER(require_ARB_vp, ADDRESS); @@ -1355,760 +1408,760 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 145 "program_lexer.l" +#line 184 "program_lexer.l" { return ALIAS; } YY_BREAK case 5: YY_RULE_SETUP -#line 146 "program_lexer.l" +#line 185 "program_lexer.l" { return ATTRIB; } YY_BREAK case 6: YY_RULE_SETUP -#line 147 "program_lexer.l" +#line 186 "program_lexer.l" { return END; } YY_BREAK case 7: YY_RULE_SETUP -#line 148 "program_lexer.l" +#line 187 "program_lexer.l" { return OPTION; } YY_BREAK case 8: YY_RULE_SETUP -#line 149 "program_lexer.l" +#line 188 "program_lexer.l" { return OUTPUT; } YY_BREAK case 9: YY_RULE_SETUP -#line 150 "program_lexer.l" +#line 189 "program_lexer.l" { return PARAM; } YY_BREAK case 10: YY_RULE_SETUP -#line 151 "program_lexer.l" +#line 190 "program_lexer.l" { yylval->integer = at_temp; return TEMP; } YY_BREAK case 11: YY_RULE_SETUP -#line 153 "program_lexer.l" +#line 192 "program_lexer.l" { return_opcode( 1, VECTOR_OP, ABS, OFF); } YY_BREAK case 12: YY_RULE_SETUP -#line 154 "program_lexer.l" +#line 193 "program_lexer.l" { return_opcode(require_ARB_fp, VECTOR_OP, ABS, ZERO_ONE); } YY_BREAK case 13: YY_RULE_SETUP -#line 155 "program_lexer.l" +#line 194 "program_lexer.l" { return_opcode( 1, BIN_OP, ADD, OFF); } YY_BREAK case 14: YY_RULE_SETUP -#line 156 "program_lexer.l" +#line 195 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, ADD, ZERO_ONE); } YY_BREAK case 15: YY_RULE_SETUP -#line 157 "program_lexer.l" +#line 196 "program_lexer.l" { return_opcode(require_ARB_vp, ARL, ARL, OFF); } YY_BREAK case 16: YY_RULE_SETUP -#line 159 "program_lexer.l" +#line 198 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, CMP, OFF); } YY_BREAK case 17: YY_RULE_SETUP -#line 160 "program_lexer.l" +#line 199 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, CMP, ZERO_ONE); } YY_BREAK case 18: YY_RULE_SETUP -#line 161 "program_lexer.l" +#line 200 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, COS, OFF); } YY_BREAK case 19: YY_RULE_SETUP -#line 162 "program_lexer.l" +#line 201 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, COS, ZERO_ONE); } YY_BREAK case 20: YY_RULE_SETUP -#line 164 "program_lexer.l" +#line 203 "program_lexer.l" { return_opcode( 1, BIN_OP, DP3, OFF); } YY_BREAK case 21: YY_RULE_SETUP -#line 165 "program_lexer.l" +#line 204 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, DP3, ZERO_ONE); } YY_BREAK case 22: YY_RULE_SETUP -#line 166 "program_lexer.l" +#line 205 "program_lexer.l" { return_opcode( 1, BIN_OP, DP4, OFF); } YY_BREAK case 23: YY_RULE_SETUP -#line 167 "program_lexer.l" +#line 206 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, DP4, ZERO_ONE); } YY_BREAK case 24: YY_RULE_SETUP -#line 168 "program_lexer.l" +#line 207 "program_lexer.l" { return_opcode( 1, BIN_OP, DPH, OFF); } YY_BREAK case 25: YY_RULE_SETUP -#line 169 "program_lexer.l" +#line 208 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, DPH, ZERO_ONE); } YY_BREAK case 26: YY_RULE_SETUP -#line 170 "program_lexer.l" +#line 209 "program_lexer.l" { return_opcode( 1, BIN_OP, DST, OFF); } YY_BREAK case 27: YY_RULE_SETUP -#line 171 "program_lexer.l" +#line 210 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, DST, ZERO_ONE); } YY_BREAK case 28: YY_RULE_SETUP -#line 173 "program_lexer.l" +#line 212 "program_lexer.l" { return_opcode( 1, SCALAR_OP, EX2, OFF); } YY_BREAK case 29: YY_RULE_SETUP -#line 174 "program_lexer.l" +#line 213 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, EX2, ZERO_ONE); } YY_BREAK case 30: YY_RULE_SETUP -#line 175 "program_lexer.l" +#line 214 "program_lexer.l" { return_opcode(require_ARB_vp, SCALAR_OP, EXP, OFF); } YY_BREAK case 31: YY_RULE_SETUP -#line 177 "program_lexer.l" +#line 216 "program_lexer.l" { return_opcode( 1, VECTOR_OP, FLR, OFF); } YY_BREAK case 32: YY_RULE_SETUP -#line 178 "program_lexer.l" +#line 217 "program_lexer.l" { return_opcode(require_ARB_fp, VECTOR_OP, FLR, ZERO_ONE); } YY_BREAK case 33: YY_RULE_SETUP -#line 179 "program_lexer.l" +#line 218 "program_lexer.l" { return_opcode( 1, VECTOR_OP, FRC, OFF); } YY_BREAK case 34: YY_RULE_SETUP -#line 180 "program_lexer.l" +#line 219 "program_lexer.l" { return_opcode(require_ARB_fp, VECTOR_OP, FRC, ZERO_ONE); } YY_BREAK case 35: YY_RULE_SETUP -#line 182 "program_lexer.l" +#line 221 "program_lexer.l" { return_opcode(require_ARB_fp, KIL, KIL, OFF); } YY_BREAK case 36: YY_RULE_SETUP -#line 184 "program_lexer.l" +#line 223 "program_lexer.l" { return_opcode( 1, VECTOR_OP, LIT, OFF); } YY_BREAK case 37: YY_RULE_SETUP -#line 185 "program_lexer.l" +#line 224 "program_lexer.l" { return_opcode(require_ARB_fp, VECTOR_OP, LIT, ZERO_ONE); } YY_BREAK case 38: YY_RULE_SETUP -#line 186 "program_lexer.l" +#line 225 "program_lexer.l" { return_opcode( 1, SCALAR_OP, LG2, OFF); } YY_BREAK case 39: YY_RULE_SETUP -#line 187 "program_lexer.l" +#line 226 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, LG2, ZERO_ONE); } YY_BREAK case 40: YY_RULE_SETUP -#line 188 "program_lexer.l" +#line 227 "program_lexer.l" { return_opcode(require_ARB_vp, SCALAR_OP, LOG, OFF); } YY_BREAK case 41: YY_RULE_SETUP -#line 189 "program_lexer.l" +#line 228 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, LRP, OFF); } YY_BREAK case 42: YY_RULE_SETUP -#line 190 "program_lexer.l" +#line 229 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, LRP, ZERO_ONE); } YY_BREAK case 43: YY_RULE_SETUP -#line 192 "program_lexer.l" +#line 231 "program_lexer.l" { return_opcode( 1, TRI_OP, MAD, OFF); } YY_BREAK case 44: YY_RULE_SETUP -#line 193 "program_lexer.l" +#line 232 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, MAD, ZERO_ONE); } YY_BREAK case 45: YY_RULE_SETUP -#line 194 "program_lexer.l" +#line 233 "program_lexer.l" { return_opcode( 1, BIN_OP, MAX, OFF); } YY_BREAK case 46: YY_RULE_SETUP -#line 195 "program_lexer.l" +#line 234 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, MAX, ZERO_ONE); } YY_BREAK case 47: YY_RULE_SETUP -#line 196 "program_lexer.l" +#line 235 "program_lexer.l" { return_opcode( 1, BIN_OP, MIN, OFF); } YY_BREAK case 48: YY_RULE_SETUP -#line 197 "program_lexer.l" +#line 236 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, MIN, ZERO_ONE); } YY_BREAK case 49: YY_RULE_SETUP -#line 198 "program_lexer.l" +#line 237 "program_lexer.l" { return_opcode( 1, VECTOR_OP, MOV, OFF); } YY_BREAK case 50: YY_RULE_SETUP -#line 199 "program_lexer.l" +#line 238 "program_lexer.l" { return_opcode(require_ARB_fp, VECTOR_OP, MOV, ZERO_ONE); } YY_BREAK case 51: YY_RULE_SETUP -#line 200 "program_lexer.l" +#line 239 "program_lexer.l" { return_opcode( 1, BIN_OP, MUL, OFF); } YY_BREAK case 52: YY_RULE_SETUP -#line 201 "program_lexer.l" +#line 240 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, MUL, ZERO_ONE); } YY_BREAK case 53: YY_RULE_SETUP -#line 203 "program_lexer.l" +#line 242 "program_lexer.l" { return_opcode( 1, BINSC_OP, POW, OFF); } YY_BREAK case 54: YY_RULE_SETUP -#line 204 "program_lexer.l" +#line 243 "program_lexer.l" { return_opcode(require_ARB_fp, BINSC_OP, POW, ZERO_ONE); } YY_BREAK case 55: YY_RULE_SETUP -#line 206 "program_lexer.l" +#line 245 "program_lexer.l" { return_opcode( 1, SCALAR_OP, RCP, OFF); } YY_BREAK case 56: YY_RULE_SETUP -#line 207 "program_lexer.l" +#line 246 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, RCP, ZERO_ONE); } YY_BREAK case 57: YY_RULE_SETUP -#line 208 "program_lexer.l" +#line 247 "program_lexer.l" { return_opcode( 1, SCALAR_OP, RSQ, OFF); } YY_BREAK case 58: YY_RULE_SETUP -#line 209 "program_lexer.l" +#line 248 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, RSQ, ZERO_ONE); } YY_BREAK case 59: YY_RULE_SETUP -#line 211 "program_lexer.l" +#line 250 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, SCS, OFF); } YY_BREAK case 60: YY_RULE_SETUP -#line 212 "program_lexer.l" +#line 251 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, SCS, ZERO_ONE); } YY_BREAK case 61: YY_RULE_SETUP -#line 213 "program_lexer.l" +#line 252 "program_lexer.l" { return_opcode( 1, BIN_OP, SGE, OFF); } YY_BREAK case 62: YY_RULE_SETUP -#line 214 "program_lexer.l" +#line 253 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, SGE, ZERO_ONE); } YY_BREAK case 63: YY_RULE_SETUP -#line 215 "program_lexer.l" +#line 254 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, SIN, OFF); } YY_BREAK case 64: YY_RULE_SETUP -#line 216 "program_lexer.l" +#line 255 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, SIN, ZERO_ONE); } YY_BREAK case 65: YY_RULE_SETUP -#line 217 "program_lexer.l" +#line 256 "program_lexer.l" { return_opcode( 1, BIN_OP, SLT, OFF); } YY_BREAK case 66: YY_RULE_SETUP -#line 218 "program_lexer.l" +#line 257 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, SLT, ZERO_ONE); } YY_BREAK case 67: YY_RULE_SETUP -#line 219 "program_lexer.l" +#line 258 "program_lexer.l" { return_opcode( 1, BIN_OP, SUB, OFF); } YY_BREAK case 68: YY_RULE_SETUP -#line 220 "program_lexer.l" +#line 259 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, SUB, ZERO_ONE); } YY_BREAK case 69: YY_RULE_SETUP -#line 221 "program_lexer.l" +#line 260 "program_lexer.l" { return_opcode( 1, SWZ, SWZ, OFF); } YY_BREAK case 70: YY_RULE_SETUP -#line 222 "program_lexer.l" +#line 261 "program_lexer.l" { return_opcode(require_ARB_fp, SWZ, SWZ, ZERO_ONE); } YY_BREAK case 71: YY_RULE_SETUP -#line 224 "program_lexer.l" +#line 263 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, OFF); } YY_BREAK case 72: YY_RULE_SETUP -#line 225 "program_lexer.l" +#line 264 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, ZERO_ONE); } YY_BREAK case 73: YY_RULE_SETUP -#line 226 "program_lexer.l" +#line 265 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, OFF); } YY_BREAK case 74: YY_RULE_SETUP -#line 227 "program_lexer.l" +#line 266 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, ZERO_ONE); } YY_BREAK case 75: YY_RULE_SETUP -#line 228 "program_lexer.l" +#line 267 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, OFF); } YY_BREAK case 76: YY_RULE_SETUP -#line 229 "program_lexer.l" +#line 268 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, ZERO_ONE); } YY_BREAK case 77: YY_RULE_SETUP -#line 231 "program_lexer.l" +#line 270 "program_lexer.l" { return_opcode( 1, BIN_OP, XPD, OFF); } YY_BREAK case 78: YY_RULE_SETUP -#line 232 "program_lexer.l" +#line 271 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, XPD, ZERO_ONE); } YY_BREAK case 79: YY_RULE_SETUP -#line 234 "program_lexer.l" +#line 273 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_vp, VERTEX); } YY_BREAK case 80: YY_RULE_SETUP -#line 235 "program_lexer.l" +#line 274 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, FRAGMENT); } YY_BREAK case 81: YY_RULE_SETUP -#line 236 "program_lexer.l" +#line 275 "program_lexer.l" { return PROGRAM; } YY_BREAK case 82: YY_RULE_SETUP -#line 237 "program_lexer.l" +#line 276 "program_lexer.l" { return STATE; } YY_BREAK case 83: YY_RULE_SETUP -#line 238 "program_lexer.l" +#line 277 "program_lexer.l" { return RESULT; } YY_BREAK case 84: YY_RULE_SETUP -#line 240 "program_lexer.l" +#line 279 "program_lexer.l" { return AMBIENT; } YY_BREAK case 85: YY_RULE_SETUP -#line 241 "program_lexer.l" +#line 280 "program_lexer.l" { return ATTENUATION; } YY_BREAK case 86: YY_RULE_SETUP -#line 242 "program_lexer.l" +#line 281 "program_lexer.l" { return BACK; } YY_BREAK case 87: YY_RULE_SETUP -#line 243 "program_lexer.l" +#line 282 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, CLIP); } YY_BREAK case 88: YY_RULE_SETUP -#line 244 "program_lexer.l" +#line 283 "program_lexer.l" { return COLOR; } YY_BREAK case 89: YY_RULE_SETUP -#line 245 "program_lexer.l" +#line 284 "program_lexer.l" { return_token_or_DOT(require_ARB_fp, DEPTH); } YY_BREAK case 90: YY_RULE_SETUP -#line 246 "program_lexer.l" +#line 285 "program_lexer.l" { return DIFFUSE; } YY_BREAK case 91: YY_RULE_SETUP -#line 247 "program_lexer.l" +#line 286 "program_lexer.l" { return DIRECTION; } YY_BREAK case 92: YY_RULE_SETUP -#line 248 "program_lexer.l" +#line 287 "program_lexer.l" { return EMISSION; } YY_BREAK case 93: YY_RULE_SETUP -#line 249 "program_lexer.l" +#line 288 "program_lexer.l" { return ENV; } YY_BREAK case 94: YY_RULE_SETUP -#line 250 "program_lexer.l" +#line 289 "program_lexer.l" { return EYE; } YY_BREAK case 95: YY_RULE_SETUP -#line 251 "program_lexer.l" +#line 290 "program_lexer.l" { return FOGCOORD; } YY_BREAK case 96: YY_RULE_SETUP -#line 252 "program_lexer.l" +#line 291 "program_lexer.l" { return FOG; } YY_BREAK case 97: YY_RULE_SETUP -#line 253 "program_lexer.l" +#line 292 "program_lexer.l" { return FRONT; } YY_BREAK case 98: YY_RULE_SETUP -#line 254 "program_lexer.l" +#line 293 "program_lexer.l" { return HALF; } YY_BREAK case 99: YY_RULE_SETUP -#line 255 "program_lexer.l" +#line 294 "program_lexer.l" { return INVERSE; } YY_BREAK case 100: YY_RULE_SETUP -#line 256 "program_lexer.l" +#line 295 "program_lexer.l" { return INVTRANS; } YY_BREAK case 101: YY_RULE_SETUP -#line 257 "program_lexer.l" +#line 296 "program_lexer.l" { return LIGHT; } YY_BREAK case 102: YY_RULE_SETUP -#line 258 "program_lexer.l" +#line 297 "program_lexer.l" { return LIGHTMODEL; } YY_BREAK case 103: YY_RULE_SETUP -#line 259 "program_lexer.l" +#line 298 "program_lexer.l" { return LIGHTPROD; } YY_BREAK case 104: YY_RULE_SETUP -#line 260 "program_lexer.l" +#line 299 "program_lexer.l" { return LOCAL; } YY_BREAK case 105: YY_RULE_SETUP -#line 261 "program_lexer.l" +#line 300 "program_lexer.l" { return MATERIAL; } YY_BREAK case 106: YY_RULE_SETUP -#line 262 "program_lexer.l" +#line 301 "program_lexer.l" { return MAT_PROGRAM; } YY_BREAK case 107: YY_RULE_SETUP -#line 263 "program_lexer.l" +#line 302 "program_lexer.l" { return MATRIX; } YY_BREAK case 108: YY_RULE_SETUP -#line 264 "program_lexer.l" +#line 303 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, MATRIXINDEX); } YY_BREAK case 109: YY_RULE_SETUP -#line 265 "program_lexer.l" +#line 304 "program_lexer.l" { return MODELVIEW; } YY_BREAK case 110: YY_RULE_SETUP -#line 266 "program_lexer.l" +#line 305 "program_lexer.l" { return MVP; } YY_BREAK case 111: YY_RULE_SETUP -#line 267 "program_lexer.l" +#line 306 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, NORMAL); } YY_BREAK case 112: YY_RULE_SETUP -#line 268 "program_lexer.l" +#line 307 "program_lexer.l" { return OBJECT; } YY_BREAK case 113: YY_RULE_SETUP -#line 269 "program_lexer.l" +#line 308 "program_lexer.l" { return PALETTE; } YY_BREAK case 114: YY_RULE_SETUP -#line 270 "program_lexer.l" +#line 309 "program_lexer.l" { return PARAMS; } YY_BREAK case 115: YY_RULE_SETUP -#line 271 "program_lexer.l" +#line 310 "program_lexer.l" { return PLANE; } YY_BREAK case 116: YY_RULE_SETUP -#line 272 "program_lexer.l" +#line 311 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, POINT_TOK); } YY_BREAK case 117: YY_RULE_SETUP -#line 273 "program_lexer.l" +#line 312 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, POINTSIZE); } YY_BREAK case 118: YY_RULE_SETUP -#line 274 "program_lexer.l" +#line 313 "program_lexer.l" { return POSITION; } YY_BREAK case 119: YY_RULE_SETUP -#line 275 "program_lexer.l" +#line 314 "program_lexer.l" { return PRIMARY; } YY_BREAK case 120: YY_RULE_SETUP -#line 276 "program_lexer.l" +#line 315 "program_lexer.l" { return PROJECTION; } YY_BREAK case 121: YY_RULE_SETUP -#line 277 "program_lexer.l" +#line 316 "program_lexer.l" { return_token_or_DOT(require_ARB_fp, RANGE); } YY_BREAK case 122: YY_RULE_SETUP -#line 278 "program_lexer.l" +#line 317 "program_lexer.l" { return ROW; } YY_BREAK case 123: YY_RULE_SETUP -#line 279 "program_lexer.l" +#line 318 "program_lexer.l" { return SCENECOLOR; } YY_BREAK case 124: YY_RULE_SETUP -#line 280 "program_lexer.l" +#line 319 "program_lexer.l" { return SECONDARY; } YY_BREAK case 125: YY_RULE_SETUP -#line 281 "program_lexer.l" +#line 320 "program_lexer.l" { return SHININESS; } YY_BREAK case 126: YY_RULE_SETUP -#line 282 "program_lexer.l" +#line 321 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, SIZE_TOK); } YY_BREAK case 127: YY_RULE_SETUP -#line 283 "program_lexer.l" +#line 322 "program_lexer.l" { return SPECULAR; } YY_BREAK case 128: YY_RULE_SETUP -#line 284 "program_lexer.l" +#line 323 "program_lexer.l" { return SPOT; } YY_BREAK case 129: YY_RULE_SETUP -#line 285 "program_lexer.l" +#line 324 "program_lexer.l" { return TEXCOORD; } YY_BREAK case 130: YY_RULE_SETUP -#line 286 "program_lexer.l" +#line 325 "program_lexer.l" { return_token_or_DOT(require_ARB_fp, TEXENV); } YY_BREAK case 131: YY_RULE_SETUP -#line 287 "program_lexer.l" +#line 326 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN); } YY_BREAK case 132: YY_RULE_SETUP -#line 288 "program_lexer.l" +#line 327 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN_Q); } YY_BREAK case 133: YY_RULE_SETUP -#line 289 "program_lexer.l" +#line 328 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN_S); } YY_BREAK case 134: YY_RULE_SETUP -#line 290 "program_lexer.l" +#line 329 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN_T); } YY_BREAK case 135: YY_RULE_SETUP -#line 291 "program_lexer.l" +#line 330 "program_lexer.l" { return TEXTURE; } YY_BREAK case 136: YY_RULE_SETUP -#line 292 "program_lexer.l" +#line 331 "program_lexer.l" { return TRANSPOSE; } YY_BREAK case 137: YY_RULE_SETUP -#line 293 "program_lexer.l" +#line 332 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, VTXATTRIB); } YY_BREAK case 138: YY_RULE_SETUP -#line 294 "program_lexer.l" +#line 333 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, WEIGHT); } YY_BREAK case 139: YY_RULE_SETUP -#line 296 "program_lexer.l" +#line 335 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEXTURE_UNIT); } YY_BREAK case 140: YY_RULE_SETUP -#line 297 "program_lexer.l" +#line 336 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_1D); } YY_BREAK case 141: YY_RULE_SETUP -#line 298 "program_lexer.l" +#line 337 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_2D); } YY_BREAK case 142: YY_RULE_SETUP -#line 299 "program_lexer.l" +#line 338 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_3D); } YY_BREAK case 143: YY_RULE_SETUP -#line 300 "program_lexer.l" +#line 339 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_CUBE); } YY_BREAK case 144: YY_RULE_SETUP -#line 301 "program_lexer.l" +#line 340 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_rect, TEX_RECT); } YY_BREAK case 145: YY_RULE_SETUP -#line 302 "program_lexer.l" +#line 341 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW1D); } YY_BREAK case 146: YY_RULE_SETUP -#line 303 "program_lexer.l" +#line 342 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW2D); } YY_BREAK case 147: YY_RULE_SETUP -#line 304 "program_lexer.l" +#line 343 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_rect, TEX_SHADOWRECT); } YY_BREAK case 148: YY_RULE_SETUP -#line 305 "program_lexer.l" +#line 344 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY1D); } YY_BREAK case 149: YY_RULE_SETUP -#line 306 "program_lexer.l" +#line 345 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY2D); } YY_BREAK case 150: YY_RULE_SETUP -#line 307 "program_lexer.l" +#line 346 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW1D); } YY_BREAK case 151: YY_RULE_SETUP -#line 308 "program_lexer.l" +#line 347 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW2D); } YY_BREAK case 152: YY_RULE_SETUP -#line 310 "program_lexer.l" +#line 349 "program_lexer.l" { - yylval->string = strdup(yytext); + yylval->string = return_string(yyextra, yytext); return IDENTIFIER; } YY_BREAK case 153: YY_RULE_SETUP -#line 315 "program_lexer.l" +#line 354 "program_lexer.l" { return DOT_DOT; } YY_BREAK case 154: YY_RULE_SETUP -#line 317 "program_lexer.l" +#line 356 "program_lexer.l" { yylval->integer = strtol(yytext, NULL, 10); return INTEGER; @@ -2116,7 +2169,7 @@ YY_RULE_SETUP YY_BREAK case 155: YY_RULE_SETUP -#line 321 "program_lexer.l" +#line 360 "program_lexer.l" { yylval->real = _mesa_strtod(yytext, NULL); return REAL; @@ -2128,7 +2181,7 @@ case 156: yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 325 "program_lexer.l" +#line 364 "program_lexer.l" { yylval->real = _mesa_strtod(yytext, NULL); return REAL; @@ -2136,7 +2189,7 @@ YY_RULE_SETUP YY_BREAK case 157: YY_RULE_SETUP -#line 329 "program_lexer.l" +#line 368 "program_lexer.l" { yylval->real = _mesa_strtod(yytext, NULL); return REAL; @@ -2144,7 +2197,7 @@ YY_RULE_SETUP YY_BREAK case 158: YY_RULE_SETUP -#line 333 "program_lexer.l" +#line 372 "program_lexer.l" { yylval->real = _mesa_strtod(yytext, NULL); return REAL; @@ -2152,7 +2205,7 @@ YY_RULE_SETUP YY_BREAK case 159: YY_RULE_SETUP -#line 338 "program_lexer.l" +#line 377 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; @@ -2161,7 +2214,7 @@ YY_RULE_SETUP YY_BREAK case 160: YY_RULE_SETUP -#line 344 "program_lexer.l" +#line 383 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@ -2171,7 +2224,7 @@ YY_RULE_SETUP YY_BREAK case 161: YY_RULE_SETUP -#line 350 "program_lexer.l" +#line 389 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; @@ -2180,7 +2233,7 @@ YY_RULE_SETUP YY_BREAK case 162: YY_RULE_SETUP -#line 355 "program_lexer.l" +#line 394 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; @@ -2189,7 +2242,7 @@ YY_RULE_SETUP YY_BREAK case 163: YY_RULE_SETUP -#line 361 "program_lexer.l" +#line 400 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@ -2199,7 +2252,7 @@ YY_RULE_SETUP YY_BREAK case 164: YY_RULE_SETUP -#line 367 "program_lexer.l" +#line 406 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@ -2209,7 +2262,7 @@ YY_RULE_SETUP YY_BREAK case 165: YY_RULE_SETUP -#line 373 "program_lexer.l" +#line 412 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; @@ -2218,7 +2271,7 @@ YY_RULE_SETUP YY_BREAK case 166: YY_RULE_SETUP -#line 379 "program_lexer.l" +#line 418 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@ -2228,7 +2281,7 @@ YY_RULE_SETUP YY_BREAK case 167: YY_RULE_SETUP -#line 386 "program_lexer.l" +#line 425 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@ -2240,7 +2293,7 @@ YY_RULE_SETUP YY_BREAK case 168: YY_RULE_SETUP -#line 395 "program_lexer.l" +#line 434 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; @@ -2249,7 +2302,7 @@ YY_RULE_SETUP YY_BREAK case 169: YY_RULE_SETUP -#line 401 "program_lexer.l" +#line 440 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@ -2259,7 +2312,7 @@ YY_RULE_SETUP YY_BREAK case 170: YY_RULE_SETUP -#line 407 "program_lexer.l" +#line 446 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; @@ -2268,7 +2321,7 @@ YY_RULE_SETUP YY_BREAK case 171: YY_RULE_SETUP -#line 412 "program_lexer.l" +#line 451 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; @@ -2277,7 +2330,7 @@ YY_RULE_SETUP YY_BREAK case 172: YY_RULE_SETUP -#line 418 "program_lexer.l" +#line 457 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@ -2287,7 +2340,7 @@ YY_RULE_SETUP YY_BREAK case 173: YY_RULE_SETUP -#line 424 "program_lexer.l" +#line 463 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@ -2297,7 +2350,7 @@ YY_RULE_SETUP YY_BREAK case 174: YY_RULE_SETUP -#line 430 "program_lexer.l" +#line 469 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; @@ -2306,7 +2359,7 @@ YY_RULE_SETUP YY_BREAK case 175: YY_RULE_SETUP -#line 436 "program_lexer.l" +#line 475 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@ -2316,7 +2369,7 @@ YY_RULE_SETUP YY_BREAK case 176: YY_RULE_SETUP -#line 444 "program_lexer.l" +#line 483 "program_lexer.l" { if (require_ARB_vp) { return TEXGEN_R; @@ -2330,7 +2383,7 @@ YY_RULE_SETUP YY_BREAK case 177: YY_RULE_SETUP -#line 455 "program_lexer.l" +#line 494 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@ -2342,13 +2395,13 @@ YY_RULE_SETUP YY_BREAK case 178: YY_RULE_SETUP -#line 464 "program_lexer.l" +#line 503 "program_lexer.l" { return DOT; } YY_BREAK case 179: /* rule 179 can match eol */ YY_RULE_SETUP -#line 466 "program_lexer.l" +#line 505 "program_lexer.l" { yylloc->first_line++; yylloc->first_column = 1; @@ -2359,7 +2412,7 @@ YY_RULE_SETUP YY_BREAK case 180: YY_RULE_SETUP -#line 473 "program_lexer.l" +#line 512 "program_lexer.l" /* eat whitespace */ ; YY_BREAK case 181: @@ -2367,20 +2420,20 @@ case 181: yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 474 "program_lexer.l" +#line 513 "program_lexer.l" /* eat comments */ ; YY_BREAK case 182: YY_RULE_SETUP -#line 475 "program_lexer.l" +#line 514 "program_lexer.l" { return yytext[0]; } YY_BREAK case 183: YY_RULE_SETUP -#line 476 "program_lexer.l" +#line 515 "program_lexer.l" ECHO; YY_BREAK -#line 2384 "lex.yy.c" +#line 2437 "lex.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -3148,8 +3201,8 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner) /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. - * @param bytes the byte buffer to scan - * @param len the number of bytes in the buffer pointed to by @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ @@ -3555,7 +3608,7 @@ void yyfree (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 476 "program_lexer.l" +#line 515 "program_lexer.l" diff --git a/src/mesa/shader/program_lexer.l b/src/mesa/shader/program_lexer.l index c2803ff707..6c4fad3037 100644 --- a/src/mesa/shader/program_lexer.l +++ b/src/mesa/shader/program_lexer.l @@ -40,7 +40,7 @@ if (condition) { \ return token; \ } else { \ - yylval->string = strdup(yytext); \ + yylval->string = return_string(yyextra, yytext); \ return IDENTIFIER; \ } \ } while (0) @@ -63,7 +63,7 @@ yylval->temp_inst.SaturateMode = SATURATE_ ## sat; \ return token; \ } else { \ - yylval->string = strdup(yytext); \ + yylval->string = return_string(yyextra, yytext); \ return IDENTIFIER; \ } \ } while (0) @@ -71,6 +71,45 @@ #define SWIZZLE_INVAL MAKE_SWIZZLE4(SWIZZLE_NIL, SWIZZLE_NIL, \ SWIZZLE_NIL, SWIZZLE_NIL) +/** + * Send a string to the parser using asm_parser_state::string_dumpster + * + * Sends a string to the parser using asm_parser_state::string_dumpster as a + * temporary storage buffer. Data previously stored in + * asm_parser_state::string_dumpster will be lost. If + * asm_parser_state::string_dumpster is not large enough to hold the new + * string, the buffer size will be increased. The buffer size is \b never + * decreased. + * + * \param state Assembler parser state tracking + * \param str String to be passed to the parser + * + * \return + * A pointer to asm_parser_state::string_dumpster on success or \c NULL on + * failure. Currently the only failure case is \c ENOMEM. + */ +static char * +return_string(struct asm_parser_state *state, const char *str) +{ + const size_t len = strlen(str); + + if (len >= state->dumpster_size) { + char *const dumpster = _mesa_realloc(state->string_dumpster, + state->dumpster_size, + len + 1); + if (dumpster == NULL) { + return NULL; + } + + state->string_dumpster = dumpster; + state->dumpster_size = len + 1; + } + + memcpy(state->string_dumpster, str, len + 1); + return state->string_dumpster; +} + + static unsigned mask_from_char(char c) { @@ -308,7 +347,7 @@ ARRAYSHADOW1D { return_token_or_IDENTIFIER(require_ARB_fp && require ARRAYSHADOW2D { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW2D); } [_a-zA-Z$][_a-zA-Z0-9$]* { - yylval->string = strdup(yytext); + yylval->string = return_string(yyextra, yytext); return IDENTIFIER; } diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index c255e912ed..261b605a2d 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -4565,7 +4565,7 @@ yyreduce: "undefined variable binding in ALIAS statement"); YYERROR; } else { - _mesa_symbol_table_add_symbol(state->st, 0, (yyvsp[(2) - (4)].string), target); + _mesa_symbol_table_add_symbol(state->st, 0, strdup((yyvsp[(2) - (4)].string)), target); } ;} break; @@ -4896,10 +4896,14 @@ declare_variable(struct asm_parser_state *state, char *name, enum asm_type t, if (exist != NULL) { yyerror(locp, state, "redeclared identifier"); } else { - s = calloc(1, sizeof(struct asm_symbol)); - s->name = name; + const size_t name_len = strlen(name); + + s = calloc(1, sizeof(struct asm_symbol) + name_len + 1); + s->name = (char *)(s + 1); s->type = t; + memcpy((char *) s->name, name, name_len + 1); + switch (t) { case at_temp: if (state->prog->NumTemporaries >= state->limits->MaxTemps) { @@ -5147,6 +5151,11 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, _mesa_memcpy (strz, str, len); strz[len] = '\0'; + if (state->prog->String != NULL) { + _mesa_free(state->prog->String); + state->prog->String = NULL; + } + state->prog->String = strz; state->st = _mesa_symbol_table_ctor(); @@ -5236,7 +5245,6 @@ error: for (sym = state->sym; sym != NULL; sym = temp) { temp = sym->next; - _mesa_free((void *) sym->name); _mesa_free(sym); } state->sym = NULL; @@ -5244,6 +5252,11 @@ error: _mesa_symbol_table_dtor(state->st); state->st = NULL; + if (state->string_dumpster != NULL) { + _mesa_free(state->string_dumpster); + state->dumpster_size = 0; + } + return result; } diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index c3152aa2f8..a23625d3fb 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -1919,7 +1919,7 @@ ALIAS_statement: ALIAS IDENTIFIER '=' IDENTIFIER "undefined variable binding in ALIAS statement"); YYERROR; } else { - _mesa_symbol_table_add_symbol(state->st, 0, $2, target); + _mesa_symbol_table_add_symbol(state->st, 0, strdup($2), target); } } ; @@ -2027,10 +2027,14 @@ declare_variable(struct asm_parser_state *state, char *name, enum asm_type t, if (exist != NULL) { yyerror(locp, state, "redeclared identifier"); } else { - s = calloc(1, sizeof(struct asm_symbol)); - s->name = name; + const size_t name_len = strlen(name); + + s = calloc(1, sizeof(struct asm_symbol) + name_len + 1); + s->name = (char *)(s + 1); s->type = t; + memcpy((char *) s->name, name, name_len + 1); + switch (t) { case at_temp: if (state->prog->NumTemporaries >= state->limits->MaxTemps) { @@ -2280,6 +2284,7 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, if (state->prog->String != NULL) { _mesa_free(state->prog->String); + state->prog->String = NULL; } state->prog->String = strz; @@ -2371,7 +2376,6 @@ error: for (sym = state->sym; sym != NULL; sym = temp) { temp = sym->next; - _mesa_free((void *) sym->name); _mesa_free(sym); } state->sym = NULL; @@ -2379,5 +2383,10 @@ error: _mesa_symbol_table_dtor(state->st); state->st = NULL; + if (state->string_dumpster != NULL) { + _mesa_free(state->string_dumpster); + state->dumpster_size = 0; + } + return result; } diff --git a/src/mesa/shader/program_parser.h b/src/mesa/shader/program_parser.h index fa47d84565..8d8b4d89bc 100644 --- a/src/mesa/shader/program_parser.h +++ b/src/mesa/shader/program_parser.h @@ -38,6 +38,13 @@ enum asm_type { at_output, }; +/** + * \note + * Objects of this type are allocated as the object plus the name of the + * symbol. That is, malloc(sizeof(struct asm_symbol) + strlen(name) + 1). + * Alternately, asm_symbol::name could be moved to the bottom of the structure + * and declared as 'char name[0];'. + */ struct asm_symbol { struct asm_symbol *next; /**< List linkage for freeing. */ const char *name; @@ -157,6 +164,15 @@ struct asm_parser_state { /*@}*/ + /** + * Buffer to hold strings transfered from the lexer to the parser + */ + /*@{*/ + char *string_dumpster; /**< String data transfered. */ + size_t dumpster_size; /**< Total size, in bytes, of the buffer. */ + /*@}*/ + + /** * Selected limits copied from gl_constants * -- cgit v1.2.3 From b44304efdee562b294e542ea0e47d6c758816ee8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 27 Oct 2009 20:09:33 -0600 Subject: glsl: avoid redundant state changes in _mesa_use_program() --- src/mesa/shader/shader_api.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/shader_api.c b/src/mesa/shader/shader_api.c index 30fa58ea52..453cd3964a 100644 --- a/src/mesa/shader/shader_api.c +++ b/src/mesa/shader/shader_api.c @@ -1547,8 +1547,6 @@ _mesa_use_program(GLcontext *ctx, GLuint program) return; } - FLUSH_VERTICES(ctx, _NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS); - if (program) { shProg = _mesa_lookup_shader_program_err(ctx, program, "glUseProgram"); if (!shProg) { @@ -1569,7 +1567,10 @@ _mesa_use_program(GLcontext *ctx, GLuint program) shProg = NULL; } - _mesa_reference_shader_program(ctx, &ctx->Shader.CurrentProgram, shProg); + if (ctx->Shader.CurrentProgram != shProg) { + FLUSH_VERTICES(ctx, _NEW_PROGRAM | _NEW_PROGRAM_CONSTANTS); + _mesa_reference_shader_program(ctx, &ctx->Shader.CurrentProgram, shProg); + } } -- cgit v1.2.3 From dd5691e8020df30c47e6d0e43a68b4f301ea4ea9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 27 Oct 2009 20:10:30 -0600 Subject: mesa: code refactoring to eliminate a switch stmt in bind_buffer_object() --- src/mesa/main/bufferobj.c | 111 +++++++++++++++++++--------------------------- 1 file changed, 45 insertions(+), 66 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c index 189b5e1655..52c4995b0a 100644 --- a/src/mesa/main/bufferobj.c +++ b/src/mesa/main/bufferobj.c @@ -52,51 +52,55 @@ /** - * Get the buffer object bound to the specified target in a GL context. - * - * \param ctx GL context - * \param target Buffer object target to be retrieved. Currently this must - * be either \c GL_ARRAY_BUFFER or \c GL_ELEMENT_ARRAY_BUFFER. - * \return A pointer to the buffer object bound to \c target in the + * Return pointer to address of a buffer object target. + * \param ctx the GL context + * \param target the buffer object target to be retrieved. + * \return pointer to pointer to the buffer object bound to \c target in the * specified context or \c NULL if \c target is invalid. */ -static INLINE struct gl_buffer_object * -get_buffer(GLcontext *ctx, GLenum target) +static INLINE struct gl_buffer_object ** +get_buffer_target(GLcontext *ctx, GLenum target) { - struct gl_buffer_object * bufObj = NULL; - switch (target) { - case GL_ARRAY_BUFFER_ARB: - bufObj = ctx->Array.ArrayBufferObj; - break; - case GL_ELEMENT_ARRAY_BUFFER_ARB: - bufObj = ctx->Array.ElementArrayBufferObj; - break; - case GL_PIXEL_PACK_BUFFER_EXT: - bufObj = ctx->Pack.BufferObj; - break; - case GL_PIXEL_UNPACK_BUFFER_EXT: - bufObj = ctx->Unpack.BufferObj; - break; - case GL_COPY_READ_BUFFER: - if (ctx->Extensions.ARB_copy_buffer) { - bufObj = ctx->CopyReadBuffer; - } - break; - case GL_COPY_WRITE_BUFFER: - if (ctx->Extensions.ARB_copy_buffer) { - bufObj = ctx->CopyWriteBuffer; - } - break; - default: - /* error must be recorded by caller */ - return NULL; + case GL_ARRAY_BUFFER_ARB: + return &ctx->Array.ArrayBufferObj; + case GL_ELEMENT_ARRAY_BUFFER_ARB: + return &ctx->Array.ElementArrayBufferObj; + case GL_PIXEL_PACK_BUFFER_EXT: + return &ctx->Pack.BufferObj; + case GL_PIXEL_UNPACK_BUFFER_EXT: + return &ctx->Unpack.BufferObj; + case GL_COPY_READ_BUFFER: + if (ctx->Extensions.ARB_copy_buffer) { + return &ctx->CopyReadBuffer; + } + break; + case GL_COPY_WRITE_BUFFER: + if (ctx->Extensions.ARB_copy_buffer) { + return &ctx->CopyWriteBuffer; + } + break; + default: + return NULL; } + return NULL; +} - /* bufObj should point to NullBufferObj or a user-created buffer object */ - ASSERT(bufObj); - return bufObj; +/** + * Get the buffer object bound to the specified target in a GL context. + * \param ctx the GL context + * \param target the buffer object target to be retrieved. + * \return pointer to the buffer object bound to \c target in the + * specified context or \c NULL if \c target is invalid. + */ +static INLINE struct gl_buffer_object * +get_buffer(GLcontext *ctx, GLenum target) +{ + struct gl_buffer_object **bufObj = get_buffer_target(ctx, target); + if (bufObj) + return *bufObj; + return NULL; } @@ -552,6 +556,7 @@ _mesa_init_buffer_objects( GLcontext *ctx ) /** * Bind the specified target to buffer for the specified context. + * Called by glBindBuffer() and other functions. */ static void bind_buffer_object(GLcontext *ctx, GLenum target, GLuint buffer) @@ -560,40 +565,14 @@ bind_buffer_object(GLcontext *ctx, GLenum target, GLuint buffer) struct gl_buffer_object *newBufObj = NULL; struct gl_buffer_object **bindTarget = NULL; - switch (target) { - case GL_ARRAY_BUFFER_ARB: - bindTarget = &ctx->Array.ArrayBufferObj; - break; - case GL_ELEMENT_ARRAY_BUFFER_ARB: - bindTarget = &ctx->Array.ElementArrayBufferObj; - break; - case GL_PIXEL_PACK_BUFFER_EXT: - bindTarget = &ctx->Pack.BufferObj; - break; - case GL_PIXEL_UNPACK_BUFFER_EXT: - bindTarget = &ctx->Unpack.BufferObj; - break; - case GL_COPY_READ_BUFFER: - if (ctx->Extensions.ARB_copy_buffer) { - bindTarget = &ctx->CopyReadBuffer; - } - break; - case GL_COPY_WRITE_BUFFER: - if (ctx->Extensions.ARB_copy_buffer) { - bindTarget = &ctx->CopyWriteBuffer; - } - break; - default: - ; /* no-op / we'll hit the follow error test next */ - } - + bindTarget = get_buffer_target(ctx, target); if (!bindTarget) { _mesa_error(ctx, GL_INVALID_ENUM, "glBindBufferARB(target 0x%x)"); return; } /* Get pointer to old buffer object (to be unbound) */ - oldBufObj = get_buffer(ctx, target); + oldBufObj = *bindTarget; if (oldBufObj && oldBufObj->Name == buffer) return; /* rebinding the same buffer object- no change */ -- cgit v1.2.3 From 9519603f7405a1043ea39bf1dfaf4c88529ce2d1 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 27 Oct 2009 21:15:36 -0600 Subject: mesa: simplify teximage code with get_current_tex_object() --- src/mesa/main/teximage.c | 98 +++++++++++++++++++----------------------------- 1 file changed, 38 insertions(+), 60 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 465da6b046..cede1cce8d 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1022,6 +1022,18 @@ _mesa_clear_texture_image(GLcontext *ctx, struct gl_texture_image *texImage) } +/** + * Return pointer to texture object for given target on current texture unit. + */ +static struct gl_texture_object * +get_current_tex_object(GLcontext *ctx, GLenum target) +{ + struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); + return _mesa_select_tex_object(ctx, texUnit, target); +} + + + /** * This is the fallback for Driver.TestProxyTexImage(). Test the texture * level, width, height and depth against the ctx->Const limits for textures. @@ -2164,7 +2176,6 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat, if (target == GL_TEXTURE_1D) { /* non-proxy target */ - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; const GLuint face = _mesa_tex_target_to_face(target); @@ -2177,8 +2188,7 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat, if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + texObj = get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { texImage = _mesa_get_tex_image(ctx, texObj, target, level); @@ -2278,7 +2288,6 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, (ctx->Extensions.MESA_texture_array && target == GL_TEXTURE_1D_ARRAY_EXT)) { /* non-proxy target */ - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; const GLuint face = _mesa_tex_target_to_face(target); @@ -2292,8 +2301,7 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + texObj = get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { texImage = _mesa_get_tex_image(ctx, texObj, target, level); @@ -2389,7 +2397,6 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat, (ctx->Extensions.MESA_texture_array && target == GL_TEXTURE_2D_ARRAY_EXT)) { /* non-proxy target */ - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; const GLuint face = _mesa_tex_target_to_face(target); @@ -2402,8 +2409,7 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat, if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + texObj = get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { texImage = _mesa_get_tex_image(ctx, texObj, target, level); @@ -2486,7 +2492,6 @@ _mesa_TexSubImage1D( GLenum target, GLint level, const GLvoid *pixels ) { GLsizei postConvWidth = width; - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage = NULL; GET_CURRENT_CONTEXT(ctx); @@ -2514,8 +2519,7 @@ _mesa_TexSubImage1D( GLenum target, GLint level, } - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + texObj = get_current_tex_object(ctx, target); assert(texObj); _mesa_lock_texture(ctx, texObj); @@ -2553,7 +2557,6 @@ _mesa_TexSubImage2D( GLenum target, GLint level, const GLvoid *pixels ) { GLsizei postConvWidth = width, postConvHeight = height; - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; GET_CURRENT_CONTEXT(ctx); @@ -2582,8 +2585,7 @@ _mesa_TexSubImage2D( GLenum target, GLint level, return; /* error was detected */ } - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + texObj = get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -2621,7 +2623,6 @@ _mesa_TexSubImage3D( GLenum target, GLint level, GLenum format, GLenum type, const GLvoid *pixels ) { - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; GET_CURRENT_CONTEXT(ctx); @@ -2642,8 +2643,7 @@ _mesa_TexSubImage3D( GLenum target, GLint level, return; /* error was detected */ } - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + texObj = get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -2684,7 +2684,6 @@ _mesa_CopyTexImage1D( GLenum target, GLint level, GLint x, GLint y, GLsizei width, GLint border ) { - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; GLsizei postConvWidth = width; @@ -2711,8 +2710,7 @@ _mesa_CopyTexImage1D( GLenum target, GLint level, postConvWidth, 1, border)) return; - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + texObj = get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -2756,7 +2754,6 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ) { - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; GLsizei postConvWidth = width, postConvHeight = height; @@ -2784,8 +2781,7 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat, postConvWidth, postConvHeight, border)) return; - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + texObj = get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -2829,7 +2825,6 @@ void GLAPIENTRY _mesa_CopyTexSubImage1D( GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width ) { - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; GLsizei postConvWidth = width; @@ -2850,8 +2845,7 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level, if (copytexsubimage_error_check1(ctx, 1, target, level)) return; - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + texObj = get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -2894,7 +2888,6 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) { - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; GLsizei postConvWidth = width, postConvHeight = height; @@ -2912,8 +2905,7 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level, if (copytexsubimage_error_check1(ctx, 2, target, level)) return; - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + texObj = get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -2959,7 +2951,6 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ) { - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; GLsizei postConvWidth = width, postConvHeight = height; @@ -2977,8 +2968,7 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level, if (copytexsubimage_error_check1(ctx, 3, target, level)) return; - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + texObj = get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -3230,7 +3220,6 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level, if (target == GL_TEXTURE_1D) { /* non-proxy target */ - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; GLenum error = compressed_texture_error_check(ctx, 1, target, level, @@ -3240,8 +3229,7 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level, return; } - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + texObj = get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -3292,11 +3280,10 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level, } else { /* store the teximage parameters */ - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + + texObj = get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -3334,9 +3321,9 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level, target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB && target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB)) { /* non-proxy target */ - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; + GLenum error = compressed_texture_error_check(ctx, 2, target, level, internalFormat, width, height, 1, border, imageSize); if (error) { @@ -3344,8 +3331,7 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level, return; } - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + texObj = get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -3398,11 +3384,10 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level, } else { /* store the teximage parameters */ - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + + texObj = get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -3437,7 +3422,6 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level, if (target == GL_TEXTURE_3D) { /* non-proxy target */ - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; GLenum error = compressed_texture_error_check(ctx, 3, target, level, @@ -3447,8 +3431,8 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level, return; } - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + texObj = get_current_tex_object(ctx, target); + _mesa_lock_texture(ctx, texObj); { texImage = _mesa_get_tex_image(ctx, texObj, target, level); @@ -3500,11 +3484,11 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level, } else { /* store the teximage parameters */ - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + + texObj = get_current_tex_object(ctx, target); + _mesa_lock_texture(ctx, texObj); { texImage = _mesa_select_tex_image(ctx, texObj, target, level); @@ -3526,7 +3510,6 @@ _mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data) { - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; GLenum error; @@ -3542,8 +3525,7 @@ _mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, return; } - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + texObj = get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -3582,7 +3564,6 @@ _mesa_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, GLenum format, GLsizei imageSize, const GLvoid *data) { - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; GLenum error; @@ -3599,8 +3580,7 @@ _mesa_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, return; } - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + texObj = get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -3640,7 +3620,6 @@ _mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data) { - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; GLenum error; @@ -3656,8 +3635,7 @@ _mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, return; } - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + texObj = get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { -- cgit v1.2.3 From f3c29bd74f01370a6bbff1329966ca9d1864315f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 27 Oct 2009 21:03:44 -0600 Subject: mesa: consolidate CompressedTexSubImage1/2/3DARB() error checking --- src/mesa/main/teximage.c | 86 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 58 insertions(+), 28 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index cede1cce8d..f632c10e76 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -3202,6 +3202,55 @@ compressed_subtexture_error_check(GLcontext *ctx, GLint dimensions, } +/** + * Do second part of glCompressedTexSubImage error checking. + * \return GL_TRUE if error found, GL_FALSE otherwise. + */ +static GLboolean +compressed_subtexture_error_check2(GLcontext *ctx, GLuint dims, + GLsizei width, GLsizei height, + GLsizei depth, GLenum format, + struct gl_texture_image *texImage) +{ + + if ((GLint) format != texImage->InternalFormat) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glCompressedTexSubImage%uD(format=0x%x)", dims, format); + return GL_TRUE; + } + + if (((width == 1 || width == 2) && + (GLuint) width != texImage->Width) || + (width > texImage->Width)) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glCompressedTexSubImage%uD(width=%d)", dims, width); + return GL_TRUE; + } + + if (dims >= 2) { + if (((height == 1 || height == 2) && + (GLuint) height != texImage->Height) || + (height > texImage->Height)) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glCompressedTexSubImage%uD(height=%d)", dims, height); + return GL_TRUE; + } + } + + if (dims >= 3) { + if (((depth == 1 || depth == 2) && + (GLuint) depth != texImage->Depth) || + (depth > texImage->Depth)) { + _mesa_error(ctx, GL_INVALID_VALUE, + "glCompressedTexSubImage%uD(depth=%d)", dims, depth); + return GL_TRUE; + } + } + + return GL_FALSE; +} + + void GLAPIENTRY _mesa_CompressedTexImage1DARB(GLenum target, GLint level, @@ -3532,14 +3581,9 @@ _mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, texImage = _mesa_select_tex_image(ctx, texObj, target, level); assert(texImage); - if ((GLint) format != texImage->InternalFormat) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glCompressedTexSubImage1D(format)"); - } - else if ((width == 1 || width == 2) && - (GLuint) width != texImage->Width) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glCompressedTexSubImage1D(width)"); + if (compressed_subtexture_error_check2(ctx, 1, width, 1, 1, + format, texImage)) { + /* error was recorded */ } else if (width > 0) { if (ctx->Driver.CompressedTexSubImage1D) { @@ -3587,15 +3631,9 @@ _mesa_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, texImage = _mesa_select_tex_image(ctx, texObj, target, level); assert(texImage); - if ((GLint) format != texImage->InternalFormat) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glCompressedTexSubImage2D(format)"); - } - else if (((width == 1 || width == 2) - && (GLuint) width != texImage->Width) || - ((height == 1 || height == 2) - && (GLuint) height != texImage->Height)) { - _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage2D(size)"); + if (compressed_subtexture_error_check2(ctx, 2, width, height, 1, + format, texImage)) { + /* error was recorded */ } else if (width > 0 && height > 0) { if (ctx->Driver.CompressedTexSubImage2D) { @@ -3642,17 +3680,9 @@ _mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, texImage = _mesa_select_tex_image(ctx, texObj, target, level); assert(texImage); - if ((GLint) format != texImage->InternalFormat) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glCompressedTexSubImage3D(format)"); - } - else if (((width == 1 || width == 2) - && (GLuint) width != texImage->Width) || - ((height == 1 || height == 2) - && (GLuint) height != texImage->Height) || - ((depth == 1 || depth == 2) - && (GLuint) depth != texImage->Depth)) { - _mesa_error(ctx, GL_INVALID_VALUE, "glCompressedTexSubImage3D(size)"); + if (compressed_subtexture_error_check2(ctx, 3, width, height, depth, + format, texImage)) { + /* error was recorded */ } else if (width > 0 && height > 0 && depth > 0) { if (ctx->Driver.CompressedTexSubImage3D) { -- cgit v1.2.3 From 6bc1e9fd6989483fbc1c94730a8014b4c62b242c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 27 Oct 2009 21:39:44 -0600 Subject: mesa: consolidate _mesa_CompressedTexSubImage[123]DARB() functions --- src/mesa/main/teximage.c | 152 +++++++++++++++++------------------------------ 1 file changed, 56 insertions(+), 96 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index f632c10e76..fe11adb6f1 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -3554,10 +3554,14 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level, } -void GLAPIENTRY -_mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, - GLsizei width, GLenum format, - GLsizei imageSize, const GLvoid *data) +/** + * Common helper for glCompressedTexSubImage1/2/3D(). + */ +static void +compressed_tex_sub_image(GLuint dims, GLenum target, GLint level, + GLint xoffset, GLint yoffset, GLint zoffset, + GLsizei width, GLsizei height, GLsizei depth, + GLenum format, GLsizei imageSize, const GLvoid *data) { struct gl_texture_object *texObj; struct gl_texture_image *texImage; @@ -3565,12 +3569,12 @@ _mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - error = compressed_subtexture_error_check(ctx, 1, target, level, + error = compressed_subtexture_error_check(ctx, dims, target, level, xoffset, 0, 0, /* pos */ - width, 1, 1, /* size */ + width, height, depth, /* size */ format, imageSize); if (error) { - _mesa_error(ctx, error, "glCompressedTexSubImage1D"); + _mesa_error(ctx, error, "glCompressedTexSubImage%uD", dims); return; } @@ -3581,16 +3585,40 @@ _mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, texImage = _mesa_select_tex_image(ctx, texObj, target, level); assert(texImage); - if (compressed_subtexture_error_check2(ctx, 1, width, 1, 1, + if (compressed_subtexture_error_check2(ctx, dims, width, height, depth, format, texImage)) { /* error was recorded */ } - else if (width > 0) { - if (ctx->Driver.CompressedTexSubImage1D) { - ctx->Driver.CompressedTexSubImage1D(ctx, target, level, - xoffset, width, - format, imageSize, data, - texObj, texImage); + else if (width > 0 && height > 0 && depth > 0) { + switch (dims) { + case 1: + if (ctx->Driver.CompressedTexSubImage1D) { + ctx->Driver.CompressedTexSubImage1D(ctx, target, level, + xoffset, width, + format, imageSize, data, + texObj, texImage); + } + break; + case 2: + if (ctx->Driver.CompressedTexSubImage2D) { + ctx->Driver.CompressedTexSubImage2D(ctx, target, level, + xoffset, yoffset, + width, height, + format, imageSize, data, + texObj, texImage); + } + break; + case 3: + if (ctx->Driver.CompressedTexSubImage3D) { + ctx->Driver.CompressedTexSubImage3D(ctx, target, level, + xoffset, yoffset, zoffset, + width, height, depth, + format, imageSize, data, + texObj, texImage); + } + break; + default: + ; } check_gen_mipmap(ctx, target, texObj, level); @@ -3602,53 +3630,24 @@ _mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, } +void GLAPIENTRY +_mesa_CompressedTexSubImage1DARB(GLenum target, GLint level, GLint xoffset, + GLsizei width, GLenum format, + GLsizei imageSize, const GLvoid *data) +{ + compressed_tex_sub_image(1, target, level, xoffset, 0, 0, width, 1, 1, + format, imageSize, data); +} + + void GLAPIENTRY _mesa_CompressedTexSubImage2DARB(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data) { - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - GLenum error; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - error = compressed_subtexture_error_check(ctx, 2, target, level, - xoffset, yoffset, 0, /* pos */ - width, height, 1, /* size */ - format, imageSize); - if (error) { - /* XXX proxy target? */ - _mesa_error(ctx, error, "glCompressedTexSubImage2D"); - return; - } - - texObj = get_current_tex_object(ctx, target); - - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - assert(texImage); - - if (compressed_subtexture_error_check2(ctx, 2, width, height, 1, - format, texImage)) { - /* error was recorded */ - } - else if (width > 0 && height > 0) { - if (ctx->Driver.CompressedTexSubImage2D) { - ctx->Driver.CompressedTexSubImage2D(ctx, target, level, - xoffset, yoffset, width, height, - format, imageSize, data, - texObj, texImage); - } - - check_gen_mipmap(ctx, target, texObj, level); - - ctx->NewState |= _NEW_TEXTURE; - } - } - _mesa_unlock_texture(ctx, texObj); + compressed_tex_sub_image(2, target, level, xoffset, yoffset, 0, + width, height, 1, format, imageSize, data); } @@ -3658,47 +3657,8 @@ _mesa_CompressedTexSubImage3DARB(GLenum target, GLint level, GLint xoffset, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data) { - struct gl_texture_object *texObj; - struct gl_texture_image *texImage; - GLenum error; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - error = compressed_subtexture_error_check(ctx, 3, target, level, - xoffset, yoffset, zoffset,/*pos*/ - width, height, depth, /*size*/ - format, imageSize); - if (error) { - _mesa_error(ctx, error, "glCompressedTexSubImage3D"); - return; - } - - texObj = get_current_tex_object(ctx, target); - - _mesa_lock_texture(ctx, texObj); - { - texImage = _mesa_select_tex_image(ctx, texObj, target, level); - assert(texImage); - - if (compressed_subtexture_error_check2(ctx, 3, width, height, depth, - format, texImage)) { - /* error was recorded */ - } - else if (width > 0 && height > 0 && depth > 0) { - if (ctx->Driver.CompressedTexSubImage3D) { - ctx->Driver.CompressedTexSubImage3D(ctx, target, level, - xoffset, yoffset, zoffset, - width, height, depth, - format, imageSize, data, - texObj, texImage); - } - - check_gen_mipmap(ctx, target, texObj, level); - - ctx->NewState |= _NEW_TEXTURE; - } - } - _mesa_unlock_texture(ctx, texObj); + compressed_tex_sub_image(3, target, level, xoffset, yoffset, zoffset, + width, height, depth, format, imageSize, data); } -- cgit v1.2.3 From a7d0665c00053839065592c339bfb298187a82be Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 28 Oct 2009 11:09:50 -0600 Subject: intel: Fix memory leak in event of mip tree allocation failure Signed-off-by: Brian Paul --- src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c index 0589d82db2..459e8fbd4b 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@ -134,8 +134,10 @@ intel_miptree_create(struct intel_context *intel, /* * pitch == 0 || height == 0 indicates the null texture */ - if (!mt || !mt->pitch || !mt->total_height) + if (!mt || !mt->pitch || !mt->total_height) { + free(mt); return NULL; + } mt->region = intel_region_alloc(intel, tiling, -- cgit v1.2.3 From 5e3b2baae74e6cde494b2fe5c6b32e3e8ef0ce87 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Oct 2009 11:11:30 -0600 Subject: mesa: include imports.h to silence warning --- src/mesa/shader/symbol_table.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/shader/symbol_table.c b/src/mesa/shader/symbol_table.c index 42601a7765..73eeb616f3 100644 --- a/src/mesa/shader/symbol_table.c +++ b/src/mesa/shader/symbol_table.c @@ -26,6 +26,7 @@ #include #include +#include "main/imports.h" #include "symbol_table.h" #include "hash_table.h" -- cgit v1.2.3 From 0219cd0961e6b47761fe6984dc6c0a8bfa6057d8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Oct 2009 11:13:21 -0600 Subject: mesa: remove unneeded #includes --- src/mesa/shader/hash_table.c | 4 ---- src/mesa/shader/symbol_table.c | 5 ----- 2 files changed, 9 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/hash_table.c b/src/mesa/shader/hash_table.c index 881179f9d8..e89a2564d7 100644 --- a/src/mesa/shader/hash_table.c +++ b/src/mesa/shader/hash_table.c @@ -27,10 +27,6 @@ * * \author Ian Romanick */ -#include -#include - -#include #include "main/imports.h" #include "main/simple_list.h" diff --git a/src/mesa/shader/symbol_table.c b/src/mesa/shader/symbol_table.c index 73eeb616f3..1f6d9b844d 100644 --- a/src/mesa/shader/symbol_table.c +++ b/src/mesa/shader/symbol_table.c @@ -20,11 +20,6 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ -#include -#include -#include -#include -#include #include "main/imports.h" #include "symbol_table.h" -- cgit v1.2.3 From c0a61c8442af3cfa810098d34bf6a21d11a5d720 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 28 Oct 2009 13:09:44 -0600 Subject: intel: Fix memory leak in case of renderbuffer bad format Signed-off-by: Brian Paul --- src/mesa/drivers/dri/intel/intel_fbo.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index cf007d5b62..a49868bfef 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -385,6 +385,7 @@ intel_create_renderbuffer(GLenum intFormat) default: _mesa_problem(NULL, "Unexpected intFormat in intel_create_renderbuffer"); + _mesa_free(irb); return NULL; } -- cgit v1.2.3 From c451011d99a33350d70766f902ad09a0b606f7c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Wed, 28 Oct 2009 01:38:40 +0100 Subject: mesa/st: fix crash in st_texture_image_copy Signed-off-by: Corbin Simpson --- src/mesa/state_tracker/st_texture.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c index ba8d1e8cc1..3f30137747 100644 --- a/src/mesa/state_tracker/st_texture.c +++ b/src/mesa/state_tracker/st_texture.c @@ -342,12 +342,21 @@ st_texture_image_copy(struct pipe_context *pipe, src_surface = screen->get_tex_surface(screen, src, face, srcLevel, i, PIPE_BUFFER_USAGE_GPU_READ); - pipe->surface_copy(pipe, - dst_surface, - 0, 0, /* destX, Y */ - src_surface, - 0, 0, /* srcX, Y */ - width, height); + if (pipe->surface_copy) { + pipe->surface_copy(pipe, + dst_surface, + 0, 0, /* destX, Y */ + src_surface, + 0, 0, /* srcX, Y */ + width, height); + } else { + util_surface_copy(pipe, FALSE, + dst_surface, + 0, 0, /* destX, Y */ + src_surface, + 0, 0, /* srcX, Y */ + width, height); + } pipe_surface_reference(&src_surface, NULL); pipe_surface_reference(&dst_surface, NULL); -- cgit v1.2.3 From 660acd60d00366c97fbe7caf3995a75ce935a19b Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Wed, 28 Oct 2009 15:36:53 -0400 Subject: r600: add occlusion query support Based on initial patch from Stephan Schmid . Basic idea is to dump the zpass count at the start and end of the query and subtract to get the total number of visible fragments. HW writes alternating qwords for up to 4 DBs. On the first pass, we start at buffer address + 0; on the second pass, we start at buffer address + 8 (bytes). The resulting buffer at the end of the query looks like: qw[0]: db0 start qw[1]: db0 end ... qw[6]: db3 start qw[7]: db3 end The MSB of each qword is the valid bit and the lower 63 bits are the zpass count for that DB. OQ on RV740 is disabled at the moment as it only seems to report results for half of its DBs. This needs further investigation. Signed-off-by: Alex Deucher --- src/mesa/drivers/dri/r600/r600_context.c | 31 +++++++++++++-- src/mesa/drivers/dri/r600/r700_chip.c | 54 +++++++++++++++++++++++++++ src/mesa/drivers/dri/r600/r700_state.c | 1 + src/mesa/drivers/dri/radeon/radeon_queryobj.c | 33 +++++++++++++--- 4 files changed, 109 insertions(+), 10 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index c1bf76deb8..6de151d51b 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -64,6 +64,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r600_cmdbuf.h" #include "r600_emit.h" #include "radeon_bocs_wrapper.h" +#include "radeon_queryobj.h" #include "r700_state.h" #include "r700_ioctl.h" @@ -73,11 +74,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "utils.h" #include "xmlpool.h" /* for symbolic values of enum-type options */ -/* hw_tcl_on derives from future_hw_tcl_on when its safe to change it. */ -int future_hw_tcl_on = 1; -int hw_tcl_on = 1; - #define need_GL_VERSION_2_0 +#define need_GL_ARB_occlusion_query #define need_GL_ARB_point_parameters #define need_GL_ARB_vertex_program #define need_GL_EXT_blend_equation_separate @@ -98,6 +96,7 @@ static const struct dri_extension card_extensions[] = { /* *INDENT-OFF* */ {"GL_ARB_depth_texture", NULL}, {"GL_ARB_fragment_program", NULL}, + {"GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions}, {"GL_ARB_multitexture", NULL}, {"GL_ARB_point_parameters", GL_ARB_point_parameters_functions}, {"GL_ARB_shadow", NULL}, @@ -204,6 +203,24 @@ static void r600_fallback(GLcontext *ctx, GLuint bit, GLboolean mode) context->radeon.Fallback &= ~bit; } +static void r600_emit_query_finish(radeonContextPtr radeon) +{ + context_t *context = (context_t*) radeon; + BATCH_LOCALS(&context->radeon); + + struct radeon_query_object *query = radeon->query.current; + + BEGIN_BATCH_NO_AUTOSTATE(4 + 2); + R600_OUT_BATCH(CP_PACKET3(R600_IT_EVENT_WRITE, 2)); + R600_OUT_BATCH(ZPASS_DONE); + R600_OUT_BATCH(query->curr_offset + 8); /* hw writes qwords */ + R600_OUT_BATCH(0x00000000); + R600_OUT_BATCH_RELOC(VGT_EVENT_INITIATOR, query->bo, 0, 0, RADEON_GEM_DOMAIN_GTT, 0); + END_BATCH(); + assert(query->curr_offset < RADEON_QUERY_PAGE_SIZE); + query->emitted_begin = GL_FALSE; +} + static void r600_init_vtbl(radeonContextPtr radeon) { radeon->vtbl.get_lock = r600_get_lock; @@ -212,6 +229,7 @@ static void r600_init_vtbl(radeonContextPtr radeon) radeon->vtbl.swtcl_flush = NULL; radeon->vtbl.pre_emit_atoms = r600_vtbl_pre_emit_atoms; radeon->vtbl.fallback = r600_fallback; + radeon->vtbl.emit_query_finish = r600_emit_query_finish; } static void r600InitConstValues(GLcontext *ctx, radeonScreenPtr screen) @@ -302,6 +320,10 @@ static void r600InitGLExtensions(GLcontext *ctx) { _mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc"); } + + /* XXX: RV740 only seems to report results from half of its DBs */ + if (r600->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV740) + _mesa_disable_extension(ctx, "GL_ARB_occlusion_query"); } /* Create the device specific rendering context. @@ -340,6 +362,7 @@ GLboolean r600CreateContext(const __GLcontextModes * glVisual, r700InitStateFuncs(&functions); r600InitTextureFuncs(&functions); r700InitShaderFuncs(&functions); + radeonInitQueryObjFunctions(&functions); r700InitIoctlFuncs(&functions); radeonInitBufferObjectFuncs(&functions); diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index 75b97c56cd..ace3d24f06 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -1100,6 +1100,32 @@ static void r700SendVSConsts(GLcontext *ctx, struct radeon_state_atom *atom) COMMIT_BATCH(); } +static void r700SendQueryBegin(GLcontext *ctx, struct radeon_state_atom *atom) +{ + radeonContextPtr radeon = RADEON_CONTEXT(ctx); + struct radeon_query_object *query = radeon->query.current; + BATCH_LOCALS(radeon); + radeon_print(RADEON_STATE, RADEON_VERBOSE, "%s\n", __func__); + + /* clear the buffer */ + radeon_bo_map(query->bo, GL_FALSE); + memset(query->bo->ptr, 0, 4 * 2 * sizeof(uint64_t)); /* 4 DBs, 2 qwords each */ + radeon_bo_unmap(query->bo); + + radeon_cs_space_check_with_bo(radeon->cmdbuf.cs, + query->bo, + 0, RADEON_GEM_DOMAIN_GTT); + + BEGIN_BATCH_NO_AUTOSTATE(4 + 2); + R600_OUT_BATCH(CP_PACKET3(R600_IT_EVENT_WRITE, 2)); + R600_OUT_BATCH(ZPASS_DONE); + R600_OUT_BATCH(query->curr_offset); /* hw writes qwords */ + R600_OUT_BATCH(0x00000000); + R600_OUT_BATCH_RELOC(VGT_EVENT_INITIATOR, query->bo, 0, 0, RADEON_GEM_DOMAIN_GTT, 0); + END_BATCH(); + query->emitted_begin = GL_TRUE; +} + static int check_always(GLcontext *ctx, struct radeon_state_atom *atom) { return atom->cmd_size; @@ -1208,6 +1234,20 @@ static int check_vs_consts(GLcontext *ctx, struct radeon_state_atom *atom) return count; } +static int check_queryobj(GLcontext *ctx, struct radeon_state_atom *atom) +{ + radeonContextPtr radeon = RADEON_CONTEXT(ctx); + struct radeon_query_object *query = radeon->query.current; + int count; + + if (!query || query->emitted_begin) + count = 0; + else + count = atom->cmd_size; + radeon_print(RADEON_STATE, RADEON_TRACE, "%s %d\n", __func__, count); + return count; +} + #define ALLOC_STATE( ATOM, CHK, SZ, EMIT ) \ do { \ context->atoms.ATOM.cmd_size = (SZ); \ @@ -1221,6 +1261,19 @@ do { \ insert_at_tail(&context->radeon.hw.atomlist, &context->atoms.ATOM); \ } while (0) +static void r600_init_query_stateobj(radeonContextPtr radeon, int SZ) +{ + radeon->query.queryobj.cmd_size = (SZ); + radeon->query.queryobj.cmd = NULL; + radeon->query.queryobj.name = "queryobj"; + radeon->query.queryobj.idx = 0; + radeon->query.queryobj.check = check_queryobj; + radeon->query.queryobj.dirty = GL_FALSE; + radeon->query.queryobj.emit = r700SendQueryBegin; + radeon->hw.max_state_size += (SZ); + insert_at_tail(&radeon->hw.atomlist, &radeon->query.queryobj); +} + void r600InitAtoms(context_t *context) { radeon_print(RADEON_STATE, RADEON_NORMAL, "%s %p\n", __func__, context); @@ -1260,6 +1313,7 @@ void r600InitAtoms(context_t *context) ALLOC_STATE(tx, tx, (R700_TEXTURE_NUMBERUNITS * 20), r700SendTexState); ALLOC_STATE(tx_smplr, tx, (R700_TEXTURE_NUMBERUNITS * 5), r700SendTexSamplerState); ALLOC_STATE(tx_brdr_clr, tx, (R700_TEXTURE_NUMBERUNITS * 6), r700SendTexBorderColorState); + r600_init_query_stateobj(&context->radeon, 6 * 2); context->radeon.hw.is_dirty = GL_TRUE; context->radeon.hw.all_dirty = GL_TRUE; diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index 9a6a68a68c..0b676362f8 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -1675,6 +1675,7 @@ void r700InitState(GLcontext * ctx) //------------------- SETfield(r700->DB_RENDER_OVERRIDE.u32All, FORCE_DISABLE, FORCE_HIZ_ENABLE_shift, FORCE_HIZ_ENABLE_mask); SETfield(r700->DB_RENDER_OVERRIDE.u32All, FORCE_DISABLE, FORCE_HIS_ENABLE0_shift, FORCE_HIS_ENABLE0_mask); SETfield(r700->DB_RENDER_OVERRIDE.u32All, FORCE_DISABLE, FORCE_HIS_ENABLE1_shift, FORCE_HIS_ENABLE1_mask); + SETbit(r700->DB_RENDER_OVERRIDE.u32All, NOOP_CULL_DISABLE_bit); r700->DB_ALPHA_TO_MASK.u32All = 0; SETfield(r700->DB_ALPHA_TO_MASK.u32All, 2, ALPHA_TO_MASK_OFFSET0_shift, ALPHA_TO_MASK_OFFSET0_mask); diff --git a/src/mesa/drivers/dri/radeon/radeon_queryobj.c b/src/mesa/drivers/dri/radeon/radeon_queryobj.c index b79d864ba2..6539c36268 100644 --- a/src/mesa/drivers/dri/radeon/radeon_queryobj.c +++ b/src/mesa/drivers/dri/radeon/radeon_queryobj.c @@ -47,8 +47,8 @@ static int radeonQueryIsFlushed(GLcontext *ctx, struct gl_query_object *q) static void radeonQueryGetResult(GLcontext *ctx, struct gl_query_object *q) { + radeonContextPtr radeon = RADEON_CONTEXT(ctx); struct radeon_query_object *query = (struct radeon_query_object *)q; - uint32_t *result; int i; radeon_print(RADEON_STATE, RADEON_VERBOSE, @@ -57,12 +57,33 @@ static void radeonQueryGetResult(GLcontext *ctx, struct gl_query_object *q) radeon_bo_map(query->bo, GL_FALSE); - result = query->bo->ptr; - query->Base.Result = 0; - for (i = 0; i < query->curr_offset/sizeof(uint32_t); ++i) { - query->Base.Result += result[i]; - radeon_print(RADEON_STATE, RADEON_TRACE, "result[%d] = %d\n", i, result[i]); + if (IS_R600_CLASS(radeon->radeonScreen)) { + /* ZPASS EVENT writes alternating qwords + * At query start we set the start offset to 0 and + * hw writes zpass start counts to qwords 0, 2, 4, 6. + * At query end we set the start offset to 8 and + * hw writes zpass end counts to qwords 1, 3, 5, 7. + * then we substract. MSB is the valid bit. + */ + uint64_t *result = query->bo->ptr; + for (i = 0; i < 8; i += 2) { + uint64_t start = result[i]; + uint64_t end = result[i + 1]; + if ((start & 0x8000000000000000) && (end & 0x8000000000000000)) { + uint64_t query_count = end - start; + query->Base.Result += query_count; + + } + radeon_print(RADEON_STATE, RADEON_TRACE, + "%d start: %lx, end: %lx %ld\n", i, start, end, end - start); + } + } else { + uint32_t *result = query->bo->ptr; + for (i = 0; i < query->curr_offset/sizeof(uint32_t); ++i) { + query->Base.Result += result[i]; + radeon_print(RADEON_STATE, RADEON_TRACE, "result[%d] = %d\n", i, result[i]); + } } radeon_bo_unmap(query->bo); -- cgit v1.2.3 From 96128fdf2f959e2b59eca8f234dc6f3adf7a553f Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 28 Oct 2009 17:59:49 -0600 Subject: mesa: Fix memory leak if we run out of memory Signed-off-by: Brian Paul --- src/mesa/main/texstore.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index a22db628d3..d3237959e0 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -589,8 +589,12 @@ _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims, /* unpack and transfer the source image */ tempImage = (GLchan *) _mesa_malloc(srcWidth * srcHeight * srcDepth * components * sizeof(GLchan)); - if (!tempImage) + if (!tempImage) { + if (freeSrcImage) { + _mesa_free((void *) srcAddr); + } return NULL; + } dst = tempImage; for (img = 0; img < srcDepth; img++) { -- cgit v1.2.3 From 7ac233ec15743763996e59c8b283f7c2e78a7210 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Oct 2009 19:33:48 -0600 Subject: mesa: choose texture format in _mesa_get_fallback_texture() --- src/mesa/main/texobj.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 678845ece0..f69379da46 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -33,6 +33,7 @@ #include "context.h" #include "enums.h" #include "fbobject.h" +#include "formats.h" #include "hash.h" #include "imports.h" #include "macros.h" @@ -740,6 +741,10 @@ _mesa_get_fallback_texture(GLcontext *ctx) _mesa_init_teximage_fields(ctx, GL_TEXTURE_2D, texImage, 8, 8, 1, 0, GL_RGBA); + texImage->TexFormat = + ctx->Driver.ChooseTextureFormat(ctx, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE); + ASSERT(texImage->TexFormat != MESA_FORMAT_NONE); + /* set image data */ ctx->Driver.TexImage2D(ctx, GL_TEXTURE_2D, 0, GL_RGBA, 8, 8, 0, -- cgit v1.2.3 From 1e7517f059b1f3601502a199b05453eabfe56cdb Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Oct 2009 19:38:12 -0600 Subject: swrast: fix texel decoding in opt_sample_rgba_2d() --- src/mesa/swrast/s_texfilter.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c index db03c6aa39..0bb988e3ef 100644 --- a/src/mesa/swrast/s_texfilter.c +++ b/src/mesa/swrast/s_texfilter.c @@ -1391,11 +1391,11 @@ opt_sample_rgba_2d(GLcontext *ctx, const GLint col = IFLOOR(texcoords[i][0] * width) & colMask; const GLint row = IFLOOR(texcoords[i][1] * height) & rowMask; const GLint pos = (row << shift) | col; - const GLubyte *texel = ((GLubyte *) img->Data) + (pos << 2); /* pos*4 */ - rgba[i][RCOMP] = UBYTE_TO_FLOAT(texel[3]); - rgba[i][GCOMP] = UBYTE_TO_FLOAT(texel[2]); - rgba[i][BCOMP] = UBYTE_TO_FLOAT(texel[1]); - rgba[i][ACOMP] = UBYTE_TO_FLOAT(texel[0]); + const GLuint texel = *((GLuint *) img->Data + pos); + rgba[i][RCOMP] = UBYTE_TO_FLOAT( (texel >> 24) ); + rgba[i][GCOMP] = UBYTE_TO_FLOAT( (texel >> 16) & 0xff ); + rgba[i][BCOMP] = UBYTE_TO_FLOAT( (texel >> 8) & 0xff ); + rgba[i][ACOMP] = UBYTE_TO_FLOAT( (texel ) & 0xff ); } } -- cgit v1.2.3 From 0103d7a47a6f42d8bb7199b5bd55097e3b0b92a4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Oct 2009 19:40:56 -0600 Subject: swrast: clean up and remove dead code in triangle functions --- src/mesa/swrast/s_triangle.c | 104 +++++++++++++++++++------------------------ 1 file changed, 47 insertions(+), 57 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index 005d7a4c82..fdd7314f3b 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -134,15 +134,17 @@ _swrast_culltriangle( GLcontext *ctx, #define SETUP_CODE \ struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0]; \ - struct gl_texture_object *obj = \ + const struct gl_texture_object *obj = \ ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; \ - const GLint b = obj->BaseLevel; \ - const GLfloat twidth = (GLfloat) obj->Image[0][b]->Width; \ - const GLfloat theight = (GLfloat) obj->Image[0][b]->Height; \ - const GLint twidth_log2 = obj->Image[0][b]->WidthLog2; \ - const GLubyte *texture = (const GLubyte *) obj->Image[0][b]->Data; \ - const GLint smask = obj->Image[0][b]->Width - 1; \ - const GLint tmask = obj->Image[0][b]->Height - 1; \ + const struct gl_texture_image *texImg = \ + obj->Image[0][obj->BaseLevel]; \ + const GLfloat twidth = (GLfloat) texImg->Width; \ + const GLfloat theight = (GLfloat) texImg->Height; \ + const GLint twidth_log2 = texImg->WidthLog2; \ + const GLubyte *texture = (const GLubyte *) texImg->Data; \ + const GLint smask = texImg->Width - 1; \ + const GLint tmask = texImg->Height - 1; \ + ASSERT(texImg->TexFormat == MESA_FORMAT_RGB888); \ if (!rb || !texture) { \ return; \ } @@ -186,15 +188,17 @@ _swrast_culltriangle( GLcontext *ctx, #define SETUP_CODE \ struct gl_renderbuffer *rb = ctx->DrawBuffer->_ColorDrawBuffers[0]; \ - struct gl_texture_object *obj = \ + const struct gl_texture_object *obj = \ ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; \ - const GLint b = obj->BaseLevel; \ - const GLfloat twidth = (GLfloat) obj->Image[0][b]->Width; \ - const GLfloat theight = (GLfloat) obj->Image[0][b]->Height; \ - const GLint twidth_log2 = obj->Image[0][b]->WidthLog2; \ - const GLubyte *texture = (const GLubyte *) obj->Image[0][b]->Data; \ - const GLint smask = obj->Image[0][b]->Width - 1; \ - const GLint tmask = obj->Image[0][b]->Height - 1; \ + const struct gl_texture_image *texImg = \ + obj->Image[0][obj->BaseLevel]; \ + const GLfloat twidth = (GLfloat) texImg->Width; \ + const GLfloat theight = (GLfloat) texImg->Height; \ + const GLint twidth_log2 = texImg->WidthLog2; \ + const GLubyte *texture = (const GLubyte *) texImg->Data; \ + const GLint smask = texImg->Width - 1; \ + const GLint tmask = texImg->Height - 1; \ + ASSERT(texImg->TexFormat == MESA_FORMAT_RGB888); \ if (!rb || !texture) { \ return; \ } @@ -536,16 +540,17 @@ affine_span(GLcontext *ctx, SWspan *span, #define SETUP_CODE \ struct affine_info info; \ struct gl_texture_unit *unit = ctx->Texture.Unit+0; \ - struct gl_texture_object *obj = \ + const struct gl_texture_object *obj = \ ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; \ - const GLint b = obj->BaseLevel; \ - const GLfloat twidth = (GLfloat) obj->Image[0][b]->Width; \ - const GLfloat theight = (GLfloat) obj->Image[0][b]->Height; \ - info.texture = (const GLchan *) obj->Image[0][b]->Data; \ - info.twidth_log2 = obj->Image[0][b]->WidthLog2; \ - info.smask = obj->Image[0][b]->Width - 1; \ - info.tmask = obj->Image[0][b]->Height - 1; \ - info.format = obj->Image[0][b]->TexFormat; \ + const struct gl_texture_image *texImg = \ + obj->Image[0][obj->BaseLevel]; \ + const GLfloat twidth = (GLfloat) texImg->Width; \ + const GLfloat theight = (GLfloat) texImg->Height; \ + info.texture = (const GLchan *) texImg->Data; \ + info.twidth_log2 = texImg->WidthLog2; \ + info.smask = texImg->Width - 1; \ + info.tmask = texImg->Height - 1; \ + info.format = texImg->TexFormat; \ info.filter = obj->MinFilter; \ info.envmode = unit->EnvMode; \ span.arrayMask |= SPAN_RGBA; \ @@ -563,25 +568,17 @@ affine_span(GLcontext *ctx, SWspan *span, } \ \ switch (info.format) { \ - case MESA_FORMAT_A8: \ - case MESA_FORMAT_L8: \ - case MESA_FORMAT_I8: \ - info.tbytesline = obj->Image[0][b]->Width; \ - break; \ - case MESA_FORMAT_AL88: \ - info.tbytesline = obj->Image[0][b]->Width * 2; \ - break; \ case MESA_FORMAT_RGB888: \ - info.tbytesline = obj->Image[0][b]->Width * 3; \ + info.tbytesline = texImg->Width * 3; \ break; \ case MESA_FORMAT_RGBA8888: \ - info.tbytesline = obj->Image[0][b]->Width * 4; \ + info.tbytesline = texImg->Width * 4; \ break; \ default: \ _mesa_problem(NULL, "Bad texture format in affine_texture_triangle");\ return; \ } \ - info.tsize = obj->Image[0][b]->Height * info.tbytesline; + info.tsize = texImg->Height * info.tbytesline; #define RENDER_SPAN( span ) affine_span(ctx, &span, &info); @@ -807,14 +804,15 @@ fast_persp_span(GLcontext *ctx, SWspan *span, #define SETUP_CODE \ struct persp_info info; \ const struct gl_texture_unit *unit = ctx->Texture.Unit+0; \ - struct gl_texture_object *obj = \ + const struct gl_texture_object *obj = \ ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; \ - const GLint b = obj->BaseLevel; \ - info.texture = (const GLchan *) obj->Image[0][b]->Data; \ - info.twidth_log2 = obj->Image[0][b]->WidthLog2; \ - info.smask = obj->Image[0][b]->Width - 1; \ - info.tmask = obj->Image[0][b]->Height - 1; \ - info.format = obj->Image[0][b]->TexFormat; \ + const struct gl_texture_image *texImg = \ + obj->Image[0][obj->BaseLevel]; \ + info.texture = (const GLchan *) texImg->Data; \ + info.twidth_log2 = texImg->WidthLog2; \ + info.smask = texImg->Width - 1; \ + info.tmask = texImg->Height - 1; \ + info.format = texImg->TexFormat; \ info.filter = obj->MinFilter; \ info.envmode = unit->EnvMode; \ \ @@ -831,25 +829,17 @@ fast_persp_span(GLcontext *ctx, SWspan *span, } \ \ switch (info.format) { \ - case MESA_FORMAT_A8: \ - case MESA_FORMAT_L8: \ - case MESA_FORMAT_I8: \ - info.tbytesline = obj->Image[0][b]->Width; \ - break; \ - case MESA_FORMAT_AL88: \ - info.tbytesline = obj->Image[0][b]->Width * 2; \ - break; \ case MESA_FORMAT_RGB888: \ - info.tbytesline = obj->Image[0][b]->Width * 3; \ + info.tbytesline = texImg->Width * 3; \ break; \ case MESA_FORMAT_RGBA8888: \ - info.tbytesline = obj->Image[0][b]->Width * 4; \ + info.tbytesline = texImg->Width * 4; \ break; \ default: \ _mesa_problem(NULL, "Bad texture format in persp_textured_triangle");\ return; \ } \ - info.tsize = obj->Image[0][b]->Height * info.tbytesline; + info.tsize = texImg->Height * info.tbytesline; #define RENDER_SPAN( span ) \ span.interpMask &= ~SPAN_RGBA; \ @@ -1067,9 +1057,9 @@ _swrast_choose_triangle( GLcontext *ctx ) texObj2D = ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; texImg = texObj2D ? texObj2D->Image[0][texObj2D->BaseLevel] : NULL; - format = texImg ? texImg->TexFormat : -1; - minFilter = texObj2D ? texObj2D->MinFilter : (GLenum) 0; - magFilter = texObj2D ? texObj2D->MagFilter : (GLenum) 0; + format = texImg ? texImg->TexFormat : MESA_FORMAT_NONE; + minFilter = texObj2D ? texObj2D->MinFilter : GL_NONE; + magFilter = texObj2D ? texObj2D->MagFilter : GL_NONE; envMode = ctx->Texture.Unit[0].EnvMode; /* First see if we can use an optimized 2-D texture function */ -- cgit v1.2.3 From 88bb4b593576a2977b2fe36794bd4d3dbc72063e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Oct 2009 19:41:24 -0600 Subject: swrast: check for single texture unit in _swrast_choose_triangle() --- src/mesa/swrast/s_triangle.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index fdd7314f3b..f417578d89 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -1066,6 +1066,7 @@ _swrast_choose_triangle( GLcontext *ctx ) if (ctx->Texture._EnabledCoordUnits == 0x1 && !ctx->FragmentProgram._Current && !ctx->ATIFragmentShader._Enabled + && ctx->Texture._EnabledUnits == 0x1 && ctx->Texture.Unit[0]._ReallyEnabled == TEXTURE_2D_BIT && texObj2D->WrapS == GL_REPEAT && texObj2D->WrapT == GL_REPEAT -- cgit v1.2.3 From 086f9fc0e2aef27f54eda87c733685500555bf20 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Oct 2009 19:46:26 -0600 Subject: swrast: fix RGB, RGBA texturing code Fix backward component ordering for RGB textures. Only optimize RGBA texture case if running little endian. This restriction could be lifted with a little work. --- src/mesa/swrast/s_triangle.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index f417578d89..5ecc7692c5 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -159,9 +159,9 @@ _swrast_culltriangle( GLcontext *ctx, GLint t = FixedToInt(span.intTex[1]) & tmask; \ GLint pos = (t << twidth_log2) + s; \ pos = pos + pos + pos; /* multiply by 3 */ \ - rgb[i][RCOMP] = texture[pos]; \ + rgb[i][RCOMP] = texture[pos+2]; \ rgb[i][GCOMP] = texture[pos+1]; \ - rgb[i][BCOMP] = texture[pos+2]; \ + rgb[i][BCOMP] = texture[pos+0]; \ span.intTex[0] += span.intTexStep[0]; \ span.intTex[1] += span.intTexStep[1]; \ } \ @@ -215,9 +215,9 @@ _swrast_culltriangle( GLcontext *ctx, GLint t = FixedToInt(span.intTex[1]) & tmask; \ GLint pos = (t << twidth_log2) + s; \ pos = pos + pos + pos; /* multiply by 3 */ \ - rgb[i][RCOMP] = texture[pos]; \ + rgb[i][RCOMP] = texture[pos+2]; \ rgb[i][GCOMP] = texture[pos+1]; \ - rgb[i][BCOMP] = texture[pos+2]; \ + rgb[i][BCOMP] = texture[pos+0]; \ zRow[i] = z; \ span.array->mask[i] = 1; \ } \ @@ -1101,7 +1101,13 @@ _swrast_choose_triangle( GLcontext *ctx ) #if CHAN_BITS != 8 USE(general_triangle); #else - USE(affine_textured_triangle); + if (format == MESA_FORMAT_RGBA8888 && !_mesa_little_endian()) + /* We only handle RGBA8888 correctly on little endian + * in the optimized code above. + */ + USE(general_triangle); + else + USE(affine_textured_triangle); #endif } } -- cgit v1.2.3 From bc143b1a9ffc16af27b2e7183ca3ec59ad5a7c89 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Oct 2009 21:25:56 -0600 Subject: mesa: minor code movement --- src/mesa/main/texcompress.c | 62 ++++++++++++++++++++++----------------------- src/mesa/main/texcompress.h | 7 +++-- 2 files changed, 33 insertions(+), 36 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c index 11f8857fa7..a4f1926ab3 100644 --- a/src/mesa/main/texcompress.c +++ b/src/mesa/main/texcompress.c @@ -153,38 +153,6 @@ _mesa_glenum_to_compressed_format(GLenum format) } -/* - * Return the address of the pixel at (col, row, img) in a - * compressed texture image. - * \param col, row, img - image position (3D), should be a multiple of the - * format's block size. - * \param format - compressed image format - * \param width - image width (stride) in pixels - * \param image - the image address - * \return address of pixel at (row, col, img) - */ -GLubyte * -_mesa_compressed_image_address(GLint col, GLint row, GLint img, - gl_format mesaFormat, - GLsizei width, const GLubyte *image) -{ - /* XXX only 2D images implemented, not 3D */ - const GLuint blockSize = _mesa_get_format_bytes(mesaFormat); - GLuint bw, bh; - GLint offset; - - _mesa_get_format_block_size(mesaFormat, &bw, &bh); - - ASSERT(col % bw == 0); - ASSERT(row % bh == 0); - - offset = ((width + bw - 1) / bw) * (row / bh) + col / bw; - offset *= blockSize; - - return (GLubyte *) image + offset; -} - - /** * Given a compressed MESA_FORMAT_x value, return the corresponding * GLenum for that format. @@ -233,3 +201,33 @@ _mesa_compressed_format_to_glenum(GLcontext *ctx, GLuint mesaFormat) } +/* + * Return the address of the pixel at (col, row, img) in a + * compressed texture image. + * \param col, row, img - image position (3D), should be a multiple of the + * format's block size. + * \param format - compressed image format + * \param width - image width (stride) in pixels + * \param image - the image address + * \return address of pixel at (row, col, img) + */ +GLubyte * +_mesa_compressed_image_address(GLint col, GLint row, GLint img, + gl_format mesaFormat, + GLsizei width, const GLubyte *image) +{ + /* XXX only 2D images implemented, not 3D */ + const GLuint blockSize = _mesa_get_format_bytes(mesaFormat); + GLuint bw, bh; + GLint offset; + + _mesa_get_format_block_size(mesaFormat, &bw, &bh); + + ASSERT(col % bw == 0); + ASSERT(row % bh == 0); + + offset = ((width + bw - 1) / bw) * (row / bh) + col / bw; + offset *= blockSize; + + return (GLubyte *) image + offset; +} diff --git a/src/mesa/main/texcompress.h b/src/mesa/main/texcompress.h index 9c58425fc9..418416746c 100644 --- a/src/mesa/main/texcompress.h +++ b/src/mesa/main/texcompress.h @@ -36,16 +36,15 @@ _mesa_get_compressed_formats(GLcontext *ctx, GLint *formats, GLboolean all); extern gl_format _mesa_glenum_to_compressed_format(GLenum format); +extern GLenum +_mesa_compressed_format_to_glenum(GLcontext *ctx, GLuint mesaFormat); + extern GLubyte * _mesa_compressed_image_address(GLint col, GLint row, GLint img, gl_format mesaFormat, GLsizei width, const GLubyte *image); -extern GLenum -_mesa_compressed_format_to_glenum(GLcontext *ctx, GLuint mesaFormat); - - extern void _mesa_init_texture_s3tc( GLcontext *ctx ); -- cgit v1.2.3 From 960d49b387ff4b64f802097c5013beee4de3649d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Oct 2009 21:43:50 -0600 Subject: mesa: move some gl_texture_image and gl_renderbuffer fields around --- src/mesa/main/mtypes.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 41acc6fdda..94d29a7dbb 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -1120,13 +1120,15 @@ typedef void (*StoreTexelFunc)(struct gl_texture_image *texImage, */ struct gl_texture_image { + GLint InternalFormat; /**< Internal format as given by the user */ GLenum _BaseFormat; /**< Either GL_RGB, GL_RGBA, GL_ALPHA, * GL_LUMINANCE, GL_LUMINANCE_ALPHA, * GL_INTENSITY, GL_COLOR_INDEX, * GL_DEPTH_COMPONENT or GL_DEPTH_STENCIL_EXT * only. Used for choosing TexEnv arithmetic. */ - GLint InternalFormat; /**< Internal format as given by the user */ + GLuint TexFormat; /**< The actual format: MESA_FORMAT_x */ + GLuint Border; /**< 0 or 1 */ GLuint Width; /**< = 2^WidthLog2 + 2*Border */ GLuint Height; /**< = 2^HeightLog2 + 2*Border */ @@ -1144,8 +1146,6 @@ struct gl_texture_image GLboolean IsClientData; /**< Data owned by client? */ GLboolean _IsPowerOfTwo; /**< Are all dimensions powers of two? */ - GLuint TexFormat; /**< XXX Really gl_format */ - struct gl_texture_object *TexObject; /**< Pointer back to parent object */ FetchTexelFuncC FetchTexelc; /**< GLchan texel fetch function pointer */ @@ -2069,10 +2069,12 @@ struct gl_renderbuffer GLuint Name; GLint RefCount; GLuint Width, Height; + GLenum InternalFormat; /**< The user-specified format */ GLenum _BaseFormat; /**< Either GL_RGB, GL_RGBA, GL_DEPTH_COMPONENT or GL_STENCIL_INDEX. */ GLuint Format; /**< The actual format: MESA_FORMAT_x */ + GLubyte NumSamples; GLenum DataType; /**< Type of values passed to the Get/Put functions */ -- cgit v1.2.3 From bd36ca9b76bf7cba96fdef71b2ea73d3fa8dfd26 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Oct 2009 21:46:37 -0600 Subject: mesa: re-remove s3v and trident driver files These were removed from master but a few files came back from the texformat-rework branch. --- src/mesa/drivers/dri/s3v/s3v_tex.c | 544 ------------------------- src/mesa/drivers/dri/s3v/s3v_xmesa.c | 341 ---------------- src/mesa/drivers/dri/trident/trident_context.c | 465 --------------------- 3 files changed, 1350 deletions(-) delete mode 100644 src/mesa/drivers/dri/s3v/s3v_tex.c delete mode 100644 src/mesa/drivers/dri/s3v/s3v_xmesa.c delete mode 100644 src/mesa/drivers/dri/trident/trident_context.c (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/s3v/s3v_tex.c b/src/mesa/drivers/dri/s3v/s3v_tex.c deleted file mode 100644 index 517f5e5ca7..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_tex.c +++ /dev/null @@ -1,544 +0,0 @@ -/* - * Author: Max Lingua - */ - -#include "main/glheader.h" -#include "main/mtypes.h" -#include "main/simple_list.h" -#include "main/enums.h" -#include "main/mm.h" -#include "main/texstore.h" -#include "main/teximage.h" -#include "swrast/swrast.h" - -#include "s3v_context.h" -#include "s3v_tex.h" - - -extern void s3vSwapOutTexObj(s3vContextPtr vmesa, s3vTextureObjectPtr t); -extern void s3vDestroyTexObj(s3vContextPtr vmesa, s3vTextureObjectPtr t); - -/* -static GLuint s3vComputeLodBias(GLfloat bias) -{ -#if TEX_DEBUG_ON - DEBUG_TEX(("*** s3vComputeLodBias ***\n")); -#endif - return bias; -} -*/ - -static void s3vSetTexWrapping(s3vContextPtr vmesa, - s3vTextureObjectPtr t, - GLenum wraps, GLenum wrapt) -{ - GLuint t0 = t->TextureCMD; - GLuint cmd = vmesa->CMD; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vSetTexWrapping: #%i ***\n", ++times)); -#endif - - - t0 &= ~TEX_WRAP_MASK; - cmd &= ~TEX_WRAP_MASK; - - if ((wraps != GL_CLAMP) || (wrapt != GL_CLAMP)) { - DEBUG(("TEX_WRAP_ON\n")); - t0 |= TEX_WRAP_ON; - cmd |= TEX_WRAP_ON; - } - - cmd |= TEX_WRAP_ON; /* FIXME: broken if off */ - t->TextureCMD = t0; - vmesa->CMD = cmd; -} - - -static void s3vSetTexFilter(s3vContextPtr vmesa, - s3vTextureObjectPtr t, - GLenum minf, GLenum magf) -{ - GLuint t0 = t->TextureCMD; - GLuint cmd = vmesa->CMD; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vSetTexFilter: #%i ***\n", ++times)); -#endif - - t0 &= ~TEX_FILTER_MASK; - cmd &= ~TEX_FILTER_MASK; - - switch (minf) { - case GL_NEAREST: - DEBUG(("GL_NEAREST\n")); - t0 |= NEAREST; - cmd |= NEAREST; - break; - case GL_LINEAR: - DEBUG(("GL_LINEAR\n")); - t0 |= LINEAR; - cmd |= LINEAR; - break; - case GL_NEAREST_MIPMAP_NEAREST: - DEBUG(("GL_MIPMAP_NEAREST\n")); - t0 |= MIP_NEAREST; - cmd |= MIP_NEAREST; - break; - case GL_LINEAR_MIPMAP_NEAREST: - DEBUG(("GL_LINEAR_MIPMAP_NEAREST\n")); - t0 |= LINEAR_MIP_NEAREST; - cmd |= LINEAR_MIP_NEAREST; - break; - case GL_NEAREST_MIPMAP_LINEAR: - DEBUG(("GL_NEAREST_MIPMAP_LINEAR\n")); - t0 |= MIP_LINEAR; - cmd |= MIP_LINEAR; - break; - case GL_LINEAR_MIPMAP_LINEAR: - DEBUG(("GL_LINEAR_MIPMAP_LINEAR\n")); - t0 |= LINEAR_MIP_LINEAR; - cmd |= LINEAR_MIP_LINEAR; - break; - default: - break; - } - /* FIXME: bilinear? */ - -#if 0 - switch (magf) { - case GL_NEAREST: - break; - case GL_LINEAR: - break; - default: - break; - } -#endif - - t->TextureCMD = t0; - - DEBUG(("CMD was = 0x%x\n", vmesa->CMD)); - DEBUG(("CMD is = 0x%x\n", cmd)); - - vmesa->CMD = cmd; - /* CMDCHANGE(); */ -} - - -static void s3vSetTexBorderColor(s3vContextPtr vmesa, - s3vTextureObjectPtr t, - const GLfloat color[4]) -{ - GLubyte c[4]; - CLAMPED_FLOAT_TO_UBYTE(c[0], color[0]); - CLAMPED_FLOAT_TO_UBYTE(c[1], color[1]); - CLAMPED_FLOAT_TO_UBYTE(c[2], color[2]); - CLAMPED_FLOAT_TO_UBYTE(c[3], color[3]); - -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vSetTexBorderColor: #%i ***\n", ++times)); -#endif - - /*FIXME: it should depend on tex col format */ - /* switch(t0 ... t->TextureColorMode) */ - - /* case TEX_COL_ARGB1555: */ - t->TextureBorderColor = S3VIRGEPACKCOLOR555(c[0], c[1], c[2], c[3]); - - DEBUG(("TextureBorderColor = 0x%x\n", t->TextureBorderColor)); - - vmesa->TextureBorderColor = t->TextureBorderColor; -} - -static void s3vTexParameter( GLcontext *ctx, GLenum target, - struct gl_texture_object *tObj, - GLenum pname, const GLfloat *params ) -{ - s3vContextPtr vmesa = S3V_CONTEXT(ctx); - s3vTextureObjectPtr t = (s3vTextureObjectPtr) tObj->DriverData; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vTexParameter: #%i ***\n", ++times)); -#endif - - if (!t) return; - - /* Can't do the update now as we don't know whether to flush - * vertices or not. Setting vmesa->new_state means that - * s3vUpdateTextureState() will be called before any triangles are - * rendered. If a statechange has occurred, it will be detected at - * that point, and buffered vertices flushed. - */ - switch (pname) { - case GL_TEXTURE_MIN_FILTER: - case GL_TEXTURE_MAG_FILTER: - s3vSetTexFilter( vmesa, t, tObj->MinFilter, tObj->MagFilter ); - break; - - case GL_TEXTURE_WRAP_S: - case GL_TEXTURE_WRAP_T: - s3vSetTexWrapping( vmesa, t, tObj->WrapS, tObj->WrapT ); - break; - - case GL_TEXTURE_BORDER_COLOR: - s3vSetTexBorderColor( vmesa, t, tObj->BorderColor ); - break; - - case GL_TEXTURE_BASE_LEVEL: - case GL_TEXTURE_MAX_LEVEL: - case GL_TEXTURE_MIN_LOD: - case GL_TEXTURE_MAX_LOD: - /* This isn't the most efficient solution but there doesn't appear to - * be a nice alternative for Virge. Since there's no LOD clamping, - * we just have to rely on loading the right subset of mipmap levels - * to simulate a clamped LOD. - */ - s3vSwapOutTexObj( vmesa, t ); - break; - - default: - return; - } - - if (t == vmesa->CurrentTexObj[0]) - vmesa->dirty |= S3V_UPLOAD_TEX0; - -#if 0 - if (t == vmesa->CurrentTexObj[1]) { - vmesa->dirty |= S3V_UPLOAD_TEX1; - } -#endif -} - - -static void s3vTexEnv( GLcontext *ctx, GLenum target, - GLenum pname, const GLfloat *param ) -{ - s3vContextPtr vmesa = S3V_CONTEXT( ctx ); - GLuint unit = ctx->Texture.CurrentUnit; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vTexEnv: #%i ***\n", ++times)); -#endif - - /* Only one env color. Need a fallback if env colors are different - * and texture setup references env color in both units. - */ - switch (pname) { - case GL_TEXTURE_ENV_COLOR: { - struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - GLfloat *fc = texUnit->EnvColor; - GLuint r, g, b, a, col; - CLAMPED_FLOAT_TO_UBYTE(r, fc[0]); - CLAMPED_FLOAT_TO_UBYTE(g, fc[1]); - CLAMPED_FLOAT_TO_UBYTE(b, fc[2]); - CLAMPED_FLOAT_TO_UBYTE(a, fc[3]); - - col = ((a << 24) | - (r << 16) | - (g << 8) | - (b << 0)); - - break; - } - case GL_TEXTURE_ENV_MODE: - vmesa->TexEnvImageFmt[unit] = 0; /* force recalc of env state */ - break; - case GL_TEXTURE_LOD_BIAS_EXT: { -/* - struct gl_texture_object *tObj = - ctx->Texture.Unit[unit]._Current; - - s3vTextureObjectPtr t = (s3vTextureObjectPtr) tObj->DriverData; -*/ - break; - } - default: - break; - } -} - -static void s3vTexImage1D( GLcontext *ctx, GLenum target, GLint level, - GLint internalFormat, - GLint width, GLint border, - GLenum format, GLenum type, - const GLvoid *pixels, - const struct gl_pixelstore_attrib *pack, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ) -{ - s3vContextPtr vmesa = S3V_CONTEXT( ctx ); - s3vTextureObjectPtr t = (s3vTextureObjectPtr) texObj->DriverData; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vTexImage1D: #%i ***\n", ++times)); -#endif - -#if 1 - if (t) { -#if _TEXFLUSH - DMAFLUSH(); -#endif - s3vSwapOutTexObj( vmesa, t ); -/* - s3vDestroyTexObj( vmesa, t ); - texObj->DriverData = 0; -*/ - } -#endif - _mesa_store_teximage1d( ctx, target, level, internalFormat, - width, border, format, type, - pixels, pack, texObj, texImage ); -} - -static void s3vTexSubImage1D( GLcontext *ctx, - GLenum target, - GLint level, - GLint xoffset, - GLsizei width, - GLenum format, GLenum type, - const GLvoid *pixels, - const struct gl_pixelstore_attrib *pack, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ) -{ - s3vContextPtr vmesa = S3V_CONTEXT( ctx ); - s3vTextureObjectPtr t = (s3vTextureObjectPtr) texObj->DriverData; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vTexSubImage1D: #%i ***\n", ++times)); -#endif - -#if 1 - if (t) { -#if _TEXFLUSH - DMAFLUSH(); -#endif - s3vSwapOutTexObj( vmesa, t ); -/* - s3vDestroyTexObj( vmesa, t ); - texObj->DriverData = 0; -*/ - } -#endif - _mesa_store_texsubimage1d(ctx, target, level, xoffset, width, - format, type, pixels, pack, texObj, - texImage); -} - -static void s3vTexImage2D( GLcontext *ctx, GLenum target, GLint level, - GLint internalFormat, - GLint width, GLint height, GLint border, - GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ) -{ - s3vContextPtr vmesa = S3V_CONTEXT( ctx ); - s3vTextureObjectPtr t = (s3vTextureObjectPtr) texObj->DriverData; - -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vTexImage2D: #%i ***\n", ++times)); -#endif - -#if 1 - if (t) { -#if _TEXFLUSH - DMAFLUSH(); -#endif - s3vSwapOutTexObj( vmesa, t ); -/* - s3vDestroyTexObj( vmesa, t ); - texObj->DriverData = 0; -*/ - } -#endif - _mesa_store_teximage2d( ctx, target, level, internalFormat, - width, height, border, format, type, - pixels, packing, texObj, texImage ); -} - -static void s3vTexSubImage2D( GLcontext *ctx, - GLenum target, - GLint level, - GLint xoffset, GLint yoffset, - GLsizei width, GLsizei height, - GLenum format, GLenum type, - const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage ) -{ - s3vContextPtr vmesa = S3V_CONTEXT( ctx ); - s3vTextureObjectPtr t = (s3vTextureObjectPtr) texObj->DriverData; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vTexSubImage2D: #%i ***\n", ++times)); -#endif - -#if 1 - if (t) { -#if _TEXFLUSH - DMAFLUSH(); -#endif - s3vSwapOutTexObj( vmesa, t ); -/* - s3vDestroyTexObj( vmesa, t ); - texObj->DriverData = 0; -*/ - } -#endif - _mesa_store_texsubimage2d(ctx, target, level, xoffset, yoffset, width, - height, format, type, pixels, packing, texObj, - texImage); -} - - -static void s3vBindTexture( GLcontext *ctx, GLenum target, - struct gl_texture_object *tObj ) -{ - s3vContextPtr vmesa = S3V_CONTEXT( ctx ); - s3vTextureObjectPtr t = (s3vTextureObjectPtr) tObj->DriverData; - GLuint cmd = vmesa->CMD; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vBindTexture: #%i ***\n", ++times)); -#endif - - if (!t) { -/* - GLfloat bias = ctx->Texture.Unit[ctx->Texture.CurrentUnit].LodBias; -*/ - t = CALLOC_STRUCT(s3v_texture_object_t); - - /* Initialize non-image-dependent parts of the state: - */ - t->globj = tObj; -#if 0 - if (target == GL_TEXTURE_2D) { - } else - if (target == GL_TEXTURE_1D) { - } - -#if X_BYTE_ORDER == X_LITTLE_ENDIAN - t->TextureFormat = (TF_LittleEndian | -#else - t->TextureFormat = (TF_BigEndian | -#endif -#endif - t->dirty_images = ~0; - - tObj->DriverData = t; - make_empty_list( t ); -#if 0 - s3vSetTexWrapping( vmesa, t, tObj->WrapS, tObj->WrapT ); - s3vSetTexFilter( vmesa, t, tObj->MinFilter, tObj->MagFilter ); - s3vSetTexBorderColor( vmesa, t, tObj->BorderColor ); -#endif - } - - cmd = vmesa->CMD & ~MIP_MASK; - vmesa->dirty |= S3V_UPLOAD_TEX0; - vmesa->TexOffset = t->TextureBaseAddr[tObj->BaseLevel]; - vmesa->TexStride = t->Pitch; - cmd |= MIPMAP_LEVEL(t->WidthLog2); - vmesa->CMD = cmd; - vmesa->restore_primitive = -1; -#if 0 - printf("t->TextureBaseAddr[0] = 0x%x\n", t->TextureBaseAddr[0]); - printf("t->TextureBaseAddr[1] = 0x%x\n", t->TextureBaseAddr[1]); - printf("t->TextureBaseAddr[2] = 0x%x\n", t->TextureBaseAddr[2]); -#endif -} - - -static void s3vDeleteTexture( GLcontext *ctx, struct gl_texture_object *tObj ) -{ - s3vTextureObjectPtr t = (s3vTextureObjectPtr)tObj->DriverData; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vDeleteTexture: #%i ***\n", ++times)); -#endif - - if (t) { - s3vContextPtr vmesa = S3V_CONTEXT( ctx ); - -#if _TEXFLUSH - if (vmesa) { - DMAFLUSH(); - } -#endif - - s3vDestroyTexObj( vmesa, t ); - tObj->DriverData = 0; - - } -} - -static GLboolean s3vIsTextureResident( GLcontext *ctx, - struct gl_texture_object *tObj ) -{ - s3vTextureObjectPtr t = (s3vTextureObjectPtr)tObj->DriverData; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vIsTextureResident: #%i ***\n", ++times)); -#endif - - return (t && t->MemBlock); -} - -static void s3vInitTextureObjects( GLcontext *ctx ) -{ - /* s3vContextPtr vmesa = S3V_CONTEXT(ctx); */ - struct gl_texture_object *texObj; - GLuint tmp = ctx->Texture.CurrentUnit; -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vInitTextureObjects: #%i ***\n", ++times)); -#endif - -#if 1 - ctx->Texture.CurrentUnit = 0; - - texObj = ctx->Texture.Unit[0].CurrentTex[TEXTURE_1D_INDEX]; - s3vBindTexture( ctx, GL_TEXTURE_1D, texObj ); - - texObj = ctx->Texture.Unit[0].CurrentTex[TEXTURE_2D_INDEX]; - s3vBindTexture( ctx, GL_TEXTURE_2D, texObj ); -#endif - -#if 0 - ctx->Texture.CurrentUnit = 1; - - texObj = ctx->Texture.Unit[1].CurrentTex[TEXTURE_1D_INDEX]; - s3vBindTexture( ctx, GL_TEXTURE_1D, texObj ); - - texObj = ctx->Texture.Unit[1].CurrentTex[TEXTURE_2D_INDEX]; - s3vBindTexture( ctx, GL_TEXTURE_2D, texObj ); -#endif - - ctx->Texture.CurrentUnit = tmp; -} - - -void s3vInitTextureFuncs( GLcontext *ctx ) -{ -#if TEX_DEBUG_ON - static unsigned int times=0; - DEBUG_TEX(("*** s3vInitTextureFuncs: #%i ***\n", ++times)); -#endif - - ctx->Driver.TexEnv = s3vTexEnv; - ctx->Driver.TexImage2D = s3vTexImage2D; - ctx->Driver.TexSubImage2D = s3vTexSubImage2D; - ctx->Driver.BindTexture = s3vBindTexture; - ctx->Driver.DeleteTexture = s3vDeleteTexture; - ctx->Driver.TexParameter = s3vTexParameter; - ctx->Driver.UpdateTexturePalette = 0; - ctx->Driver.IsTextureResident = s3vIsTextureResident; - - s3vInitTextureObjects( ctx ); -} diff --git a/src/mesa/drivers/dri/s3v/s3v_xmesa.c b/src/mesa/drivers/dri/s3v/s3v_xmesa.c deleted file mode 100644 index f1e123d676..0000000000 --- a/src/mesa/drivers/dri/s3v/s3v_xmesa.c +++ /dev/null @@ -1,341 +0,0 @@ -/* - * Author: Max Lingua - */ - -#include "s3v_context.h" -#include "s3v_vb.h" -#include "s3v_dri.h" -#include "main/context.h" -#include "main/matrix.h" -#include "main/framebuffer.h" -#include "main/renderbuffer.h" -#include "main/viewport.h" - -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "tnl/tnl.h" -#include "vbo/vbo.h" - -/* #define DEBUG(str) printf str */ - -static const __DRIconfig ** -s3vInitScreen(__DRIscreen *sPriv) -{ - sPriv->private = (void *) s3vCreateScreen( sPriv ); - - if (!sPriv->private) { - s3vDestroyScreen( sPriv ); - return GL_FALSE; - } - - return NULL; -} - -static void -s3vDestroyContext(__DRIcontextPrivate *driContextPriv) -{ - s3vContextPtr vmesa = (s3vContextPtr)driContextPriv->driverPrivate; - - if (vmesa) { - _swsetup_DestroyContext( vmesa->glCtx ); - _tnl_DestroyContext( vmesa->glCtx ); - _vbo_DestroyContext( vmesa->glCtx ); - _swrast_DestroyContext( vmesa->glCtx ); - - s3vFreeVB( vmesa->glCtx ); - - /* free the Mesa context */ - vmesa->glCtx->DriverCtx = NULL; - _mesa_destroy_context(vmesa->glCtx); - - _mesa_free(vmesa); - driContextPriv->driverPrivate = NULL; - } -} - - -static GLboolean -s3vCreateBuffer( __DRIscreenPrivate *driScrnPriv, - __DRIdrawablePrivate *driDrawPriv, - const __GLcontextModes *mesaVis, - GLboolean isPixmap ) -{ - s3vScreenPtr screen = (s3vScreenPtr) driScrnPriv->private; - - if (isPixmap) { - return GL_FALSE; /* not implemented */ - } - else { - struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis); - - { - driRenderbuffer *frontRb - = driNewRenderbuffer(MESA_FORMAT_ARGB8888, NULL, screen->cpp, - screen->frontOffset, screen->frontPitch, - driDrawPriv); - s3vSetSpanFunctions(frontRb, mesaVis); - _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base); - } - - if (mesaVis->doubleBufferMode) { - driRenderbuffer *backRb - = driNewRenderbuffer(MESA_FORMAT_ARGB8888, NULL, screen->cpp, - screen->backOffset, screen->backPitch, - driDrawPriv); - s3vSetSpanFunctions(backRb, mesaVis); - _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base); - backRb->backBuffer = GL_TRUE; - } - - if (mesaVis->depthBits == 16) { - driRenderbuffer *depthRb - = driNewRenderbuffer(MESA_FORMAT_Z16, NULL, screen->cpp, - screen->depthOffset, screen->depthPitch, - driDrawPriv); - s3vSetSpanFunctions(depthRb, mesaVis); - _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); - } - else if (mesaVis->depthBits == 24) { - driRenderbuffer *depthRb - = driNewRenderbuffer(MESA_FORMAT_Z24_S8, NULL, screen->cpp, - screen->depthOffset, screen->depthPitch, - driDrawPriv); - s3vSetSpanFunctions(depthRb, mesaVis); - _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); - } - - /* no h/w stencil yet? - if (mesaVis->stencilBits > 0) { - driRenderbuffer *stencilRb - = driNewRenderbuffer(MESA_FORMAT_S8, NULL, - screen->cpp, screen->depthOffset, - screen->depthPitch, driDrawPriv); - s3vSetSpanFunctions(stencilRb, mesaVis); - _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base); - } - */ - - _mesa_add_soft_renderbuffers(fb, - GL_FALSE, /* color */ - GL_FALSE, /* depth */ - mesaVis->stencilBits > 0, - mesaVis->accumRedBits > 0, - GL_FALSE, /* alpha */ - GL_FALSE /* aux */); - driDrawPriv->driverPrivate = (void *) fb; - - return (driDrawPriv->driverPrivate != NULL); - } -} - - -static void -s3vDestroyBuffer(__DRIdrawablePrivate *driDrawPriv) -{ - _mesa_reference_framebuffer((GLframebuffer **)(&(driDrawPriv->driverPrivate)), NULL); -} - -static void -s3vSwapBuffers(__DRIdrawablePrivate *drawablePrivate) -{ - __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate; - __DRIscreenPrivate *sPriv; - GLcontext *ctx; - s3vContextPtr vmesa; - s3vScreenPtr s3vscrn; - - vmesa = (s3vContextPtr) dPriv->driContextPriv->driverPrivate; - sPriv = vmesa->driScreen; - s3vscrn = vmesa->s3vScreen; - ctx = vmesa->glCtx; - - DEBUG(("*** s3vSwapBuffers ***\n")); - -/* DMAFLUSH(); */ - - _mesa_notifySwapBuffers( ctx ); - - vmesa = (s3vContextPtr) dPriv->driContextPriv->driverPrivate; -/* driScrnPriv = vmesa->driScreen; */ - -/* if (vmesa->EnabledFlags & S3V_BACK_BUFFER) */ - -/* _mesa_notifySwapBuffers( ctx ); */ -#if 1 -{ - int x0, y0, x1, y1; -/* - int nRect = dPriv->numClipRects; - XF86DRIClipRectPtr pRect = dPriv->pClipRects; - - __DRIscreenPrivate *driScrnPriv = vmesa->driScreen; -*/ - -/* - DEBUG(("s3vSwapBuffers: S3V_BACK_BUFFER = 1 - nClip = %i\n", nRect)); -*/ -/* vmesa->drawOffset=vmesa->s3vScreen->backOffset; */ - - x0 = dPriv->x; - y0 = dPriv->y; - - x1 = x0 + dPriv->w - 1; - y1 = y0 + dPriv->h - 1; - - DMAOUT_CHECK(BITBLT_SRC_BASE, 15); - DMAOUT(vmesa->s3vScreen->backOffset); - DMAOUT(0); /* 0xc0000000 */ - DMAOUT( ((x0 << 16) | x1) ); - DMAOUT( ((y0 << 16) | y1) ); - DMAOUT( (vmesa->DestStride << 16) | vmesa->SrcStride ); - DMAOUT( (~(0)) ); - DMAOUT( (~(0)) ); - DMAOUT(0); - DMAOUT(0); - /* FIXME */ - DMAOUT(0); - DMAOUT(0); - DMAOUT( (0x01 | /* Autoexecute */ - 0x02 | /* clip */ - 0x04 | /* 16 bit */ - 0x20 | /* draw */ - 0x400 | /* word alignment (bit 10=1) */ - (0x2 << 11) | /* offset = 1 byte */ - (0xCC << 17) | /* rop #204 */ - (0x3 << 25)) ); /* l-r, t-b */ - DMAOUT(vmesa->ScissorWH); - DMAOUT( /* 0 */ vmesa->SrcXY ); - DMAOUT( (dPriv->x << 16) | dPriv->y ); - DMAFINISH(); - - DMAFLUSH(); - - vmesa->restore_primitive = -1; - -} -#endif -} - -static GLboolean -s3vMakeCurrent(__DRIcontextPrivate *driContextPriv, - __DRIdrawablePrivate *driDrawPriv, - __DRIdrawablePrivate *driReadPriv) -{ - int x1,x2,y1,y2; - int cx, cy, cw, ch; - unsigned int src_stride, dest_stride; - int cl; - - s3vContextPtr vmesa; - __DRIdrawablePrivate *dPriv = driDrawPriv; - vmesa = (s3vContextPtr) dPriv->driContextPriv->driverPrivate; - - DEBUG(("s3vMakeCurrent\n")); - - DEBUG(("dPriv->x=%i y=%i w=%i h=%i\n", dPriv->x, dPriv->y, - dPriv->w, dPriv->h)); - - if (driContextPriv) { - GET_CURRENT_CONTEXT(ctx); - s3vContextPtr oldVirgeCtx = ctx ? S3V_CONTEXT(ctx) : NULL; - s3vContextPtr newVirgeCtx = (s3vContextPtr) driContextPriv->driverPrivate; - - if ( newVirgeCtx != oldVirgeCtx ) { - - newVirgeCtx->dirty = ~0; - cl = 1; - DEBUG(("newVirgeCtx != oldVirgeCtx\n")); -/* s3vUpdateClipping(newVirgeCtx->glCtx ); */ - } - - if (newVirgeCtx->driDrawable != driDrawPriv) { - newVirgeCtx->driDrawable = driDrawPriv; - DEBUG(("driDrawable != driDrawPriv\n")); - s3vUpdateWindow ( newVirgeCtx->glCtx ); - s3vUpdateViewportOffset( newVirgeCtx->glCtx ); -/* s3vUpdateClipping(newVirgeCtx->glCtx ); */ - } -/* - s3vUpdateWindow ( newVirgeCtx->glCtx ); - s3vUpdateViewportOffset( newVirgeCtx->glCtx ); -*/ - -/* - _mesa_make_current( newVirgeCtx->glCtx, - (GLframebuffer *) driDrawPriv->driverPrivate, - (GLframebuffer *) driReadPriv->driverPrivate ); - - _mesa_set_viewport(newVirgeCtx->glCtx, 0, 0, - newVirgeCtx->driDrawable->w, - newVirgeCtx->driDrawable->h); -*/ - -#if 0 - newVirgeCtx->Window &= ~W_GIDMask; - newVirgeCtx->Window |= (driDrawPriv->index << 5); - CHECK_DMA_BUFFER(newVirgeCtx,1); - WRITE(newVirgeCtx->buf, S3VWindow, newVirgeCtx->Window); -#endif - - newVirgeCtx->new_state |= S3V_NEW_WINDOW; /* FIXME */ - - _mesa_make_current( newVirgeCtx->glCtx, - (GLframebuffer *) driDrawPriv->driverPrivate, - (GLframebuffer *) driReadPriv->driverPrivate ); - - if (!newVirgeCtx->glCtx->Viewport.Width) { - _mesa_set_viewport(newVirgeCtx->glCtx, 0, 0, - driDrawPriv->w, driDrawPriv->h); - -/* s3vUpdateClipping(newVirgeCtx->glCtx ); */ - } - -/* - if (cl) { - s3vUpdateClipping(newVirgeCtx->glCtx ); - cl =0; - } -*/ - - newVirgeCtx->new_state |= S3V_NEW_CLIP; - - if (1) { - cx = dPriv->x; - cw = dPriv->w; - cy = dPriv->y; - ch = dPriv->h; - } - - x1 = y1 = 0; - x2 = cw-1; - y2 = ch-1; - - /* src_stride = vmesa->s3vScreen->w * vmesa->s3vScreen->cpp; - dest_stride = ((x2+31)&~31) * vmesa->s3vScreen->cpp; */ - src_stride = vmesa->driScreen->fbWidth * 2; - dest_stride = ((x2+31)&~31) * 2; - } else { - _mesa_make_current( NULL, NULL, NULL ); - } - - return GL_TRUE; -} - - -static GLboolean -s3vUnbindContext( __DRIcontextPrivate *driContextPriv ) -{ - return GL_TRUE; -} - -const struct __DriverAPIRec driDriverAPI = { - .InitScreen = s3vInitScreen, - .DestroyScreen = s3vDestroyScreen, - .CreateContext = s3vCreateContext, - .DestroyContext = s3vDestroyContext, - .CreateBuffer = s3vCreateBuffer, - .DestroyBuffer = s3vDestroyBuffer, - .SwapBuffers = s3vSwapBuffers, - .MakeCurrent = s3vMakeCurrent, - .UnbindContext = s3vUnbindContext, -}; diff --git a/src/mesa/drivers/dri/trident/trident_context.c b/src/mesa/drivers/dri/trident/trident_context.c deleted file mode 100644 index b693a95ece..0000000000 --- a/src/mesa/drivers/dri/trident/trident_context.c +++ /dev/null @@ -1,465 +0,0 @@ -/* - * Copyright 2002 by Alan Hourihane, Sychdyn, North Wales, UK. - * - * Permission to use, copy, modify, distribute, and sell this software and its - * documentation for any purpose is hereby granted without fee, provided that - * the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation, and that the name of Alan Hourihane not be used in - * advertising or publicity pertaining to distribution of the software without - * specific, written prior permission. Alan Hourihane makes no representations - * about the suitability of this software for any purpose. It is provided - * "as is" without express or implied warranty. - * - * ALAN HOURIHANE DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, - * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO - * EVENT SHALL ALAN HOURIHANE BE LIABLE FOR ANY SPECIAL, INDIRECT OR - * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, - * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER - * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR - * PERFORMANCE OF THIS SOFTWARE. - * - * Authors: Alan Hourihane, - * - * Trident CyberBladeXP driver. - * - */ -#include "trident_dri.h" -#include "trident_context.h" -#include "trident_lock.h" - -#include "swrast/swrast.h" -#include "swrast_setup/swrast_setup.h" -#include "vbo/vbo.h" - -#include "tnl/tnl.h" -#include "tnl/t_pipeline.h" - -#include "main/context.h" -#include "main/simple_list.h" -#include "main/matrix.h" -#include "main/extensions.h" -#include "main/framebuffer.h" -#include "main/renderbuffer.h" -#include "main/viewport.h" -#if defined(USE_X86_ASM) -#include "x86/common_x86_asm.h" -#endif -#include "main/simple_list.h" -#include "main/mm.h" -#include "drirenderbuffer.h" - -#include "drivers/common/driverfuncs.h" -#include "dri_util.h" -#include "utils.h" - -static const struct tnl_pipeline_stage *trident_pipeline[] = { - &_tnl_vertex_transform_stage, - &_tnl_normal_transform_stage, - &_tnl_lighting_stage, - &_tnl_texgen_stage, - &_tnl_texture_transform_stage, - &_tnl_render_stage, - 0, -}; - - -static GLboolean -tridentCreateContext( const __GLcontextModes *glVisual, - __DRIcontextPrivate *driContextPriv, - void *sharedContextPrivate) -{ - GLcontext *ctx, *shareCtx; - __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv; - tridentContextPtr tmesa; - tridentScreenPtr tridentscrn; - struct dd_function_table functions; -#if 0 - drm_trident_sarea_t *saPriv=(drm_trident_sarea_t *)(((char*)sPriv->pSAREA)+ - sizeof(XF86DRISAREARec)); -#endif - - tmesa = (tridentContextPtr) CALLOC( sizeof(*tmesa) ); - if ( !tmesa ) return GL_FALSE; - - /* Allocate the Mesa context */ - if (sharedContextPrivate) - shareCtx = ((tridentContextPtr) sharedContextPrivate)->glCtx; - else - shareCtx = NULL; - - _mesa_init_driver_functions(&functions); - - tmesa->glCtx = - _mesa_create_context(glVisual, shareCtx, &functions, (void *)tmesa); - - if (!tmesa->glCtx) { - FREE(tmesa); - return GL_FALSE; - } - - tmesa->driContext = driContextPriv; - tmesa->driScreen = sPriv; - tmesa->driDrawable = NULL; /* Set by XMesaMakeCurrent */ - - tmesa->hHWContext = driContextPriv->hHWContext; - tmesa->driHwLock = (drmLock *)&sPriv->pSAREA->lock; - tmesa->driFd = sPriv->fd; -#if 0 - tmesa->sarea = saPriv; -#endif - - tridentscrn = tmesa->tridentScreen = (tridentScreenPtr)(sPriv->private); - - ctx = tmesa->glCtx; - - ctx->Const.MaxTextureLevels = 13; /* 4K by 4K? Is that right? */ - ctx->Const.MaxTextureUnits = 1; /* Permedia 3 */ - - ctx->Const.MinLineWidth = 0.0; - ctx->Const.MaxLineWidth = 255.0; - - ctx->Const.MinLineWidthAA = 0.0; - ctx->Const.MaxLineWidthAA = 65536.0; - - ctx->Const.MinPointSize = 0.0; - ctx->Const.MaxPointSize = 255.0; - - ctx->Const.MinPointSizeAA = 0.5; /* 4x4 quality mode */ - ctx->Const.MaxPointSizeAA = 16.0; - ctx->Const.PointSizeGranularity = 0.25; - - ctx->Const.MaxDrawBuffers = 1; - -#if 0 - tmesa->texHeap = mmInit( 0, tmesa->tridentScreen->textureSize ); - - make_empty_list(&tmesa->TexObjList); - make_empty_list(&tmesa->SwappedOut); - - tmesa->CurrentTexObj[0] = 0; - tmesa->CurrentTexObj[1] = 0; /* Permedia 3, second texture */ - - tmesa->RenderIndex = ~0; -#endif - - /* Initialize the software rasterizer and helper modules. - */ - _swrast_CreateContext( ctx ); - _vbo_CreateContext( ctx ); - _tnl_CreateContext( ctx ); - _swsetup_CreateContext( ctx ); - - /* Install the customized pipeline: - */ - _tnl_destroy_pipeline( ctx ); - _tnl_install_pipeline( ctx, trident_pipeline ); - - /* Configure swrast to match hardware characteristics: - */ - _swrast_allow_pixel_fog( ctx, GL_FALSE ); - _swrast_allow_vertex_fog( ctx, GL_TRUE ); - - tridentInitVB( ctx ); - tridentDDInitExtensions( ctx ); - tridentDDInitDriverFuncs( ctx ); - tridentDDInitStateFuncs( ctx ); -#if 0 - tridentDDInitSpanFuncs( ctx ); - tridentDDInitTextureFuncs( ctx ); -#endif - tridentDDInitTriFuncs( ctx ); - tridentDDInitState( tmesa ); - - driContextPriv->driverPrivate = (void *)tmesa; - - UNLOCK_HARDWARE(tmesa); - - return GL_TRUE; -} - -static void -tridentDestroyContext(__DRIcontextPrivate *driContextPriv) -{ - tridentContextPtr tmesa = (tridentContextPtr)driContextPriv->driverPrivate; - - if (tmesa) { - _swsetup_DestroyContext( tmesa->glCtx ); - _tnl_DestroyContext( tmesa->glCtx ); - _vbo_DestroyContext( tmesa->glCtx ); - _swrast_DestroyContext( tmesa->glCtx ); - - /* free the Mesa context */ - tmesa->glCtx->DriverCtx = NULL; - _mesa_destroy_context(tmesa->glCtx); - - _mesa_free(tmesa); - driContextPriv->driverPrivate = NULL; - } -} - - -static GLboolean -tridentCreateBuffer( __DRIscreenPrivate *driScrnPriv, - __DRIdrawablePrivate *driDrawPriv, - const __GLcontextModes *mesaVis, - GLboolean isPixmap ) -{ - tridentScreenPtr screen = (tridentScreenPtr) driScrnPriv->private; - - if (isPixmap) { - return GL_FALSE; /* not implemented */ - } - else { - struct gl_framebuffer *fb = _mesa_create_framebuffer(mesaVis); - - { - driRenderbuffer *frontRb - = driNewRenderbuffer(MESA_FORMAT_ARGB8888, NULL, screen->cpp, - screen->frontOffset, screen->frontPitch, - driDrawPriv); - /* - tridentSetSpanFunctions(frontRb, mesaVis); - */ - _mesa_add_renderbuffer(fb, BUFFER_FRONT_LEFT, &frontRb->Base); - } - - if (mesaVis->doubleBufferMode) { - driRenderbuffer *backRb - = driNewRenderbuffer(MESA_FORMAT_ARGB8888, NULL, screen->cpp, - screen->backOffset, screen->backPitch, - driDrawPriv); - /* - tridentSetSpanFunctions(backRb, mesaVis); - */ - _mesa_add_renderbuffer(fb, BUFFER_BACK_LEFT, &backRb->Base); - } - - if (mesaVis->depthBits == 16) { - driRenderbuffer *depthRb - = driNewRenderbuffer(MESA_FORMAT_Z16, NULL, screen->cpp, - screen->depthOffset, screen->depthPitch, - driDrawPriv); - /* - tridentSetSpanFunctions(depthRb, mesaVis); - */ - _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); - } - else if (mesaVis->depthBits == 24) { - driRenderbuffer *depthRb - = driNewRenderbuffer(MESA_FORMAT_Z24_S8, NULL, screen->cpp, - screen->depthOffset, screen->depthPitch, - driDrawPriv); - /* - tridentSetSpanFunctions(depthRb, mesaVis); - */ - _mesa_add_renderbuffer(fb, BUFFER_DEPTH, &depthRb->Base); - } - - /* no h/w stencil? - if (mesaVis->stencilBits > 0 && !swStencil) { - driRenderbuffer *stencilRb - = driNewRenderbuffer(MESA_FORMAT_S8); - tridentSetSpanFunctions(stencilRb, mesaVis); - _mesa_add_renderbuffer(fb, BUFFER_STENCIL, &stencilRb->Base); - } - */ - - _mesa_add_soft_renderbuffers(fb, - GL_FALSE, /* color */ - GL_FALSE, /* depth */ - mesaVis->stencilBits > 0, - mesaVis->accumRedBits > 0, - GL_FALSE, /* alpha */ - GL_FALSE /* aux */); - driDrawPriv->driverPrivate = (void *) fb; - - return (driDrawPriv->driverPrivate != NULL); - } -} - - -static void -tridentDestroyBuffer(__DRIdrawablePrivate *driDrawPriv) -{ - _mesa_reference_framebuffer((GLframebuffer **)(&(driDrawPriv->driverPrivate)), NULL); -} - -static void -tridentSwapBuffers(__DRIdrawablePrivate *drawablePrivate) -{ - __DRIdrawablePrivate *dPriv = (__DRIdrawablePrivate *) drawablePrivate; - - if (dPriv->driContextPriv && dPriv->driContextPriv->driverPrivate) { - tridentContextPtr tmesa; - GLcontext *ctx; - tmesa = (tridentContextPtr) dPriv->driContextPriv->driverPrivate; - ctx = tmesa->glCtx; - if (ctx->Visual.doubleBufferMode) { - _mesa_notifySwapBuffers( ctx ); /* flush pending rendering comands */ - tridentCopyBuffer( dPriv ); - } - } - else { - /* XXX this shouldn't be an error but we can't handle it for now */ - _mesa_problem(NULL, "tridentSwapBuffers: drawable has no context!\n"); - } -} - -static GLboolean -tridentMakeCurrent(__DRIcontextPrivate *driContextPriv, - __DRIdrawablePrivate *driDrawPriv, - __DRIdrawablePrivate *driReadPriv) -{ - if (driContextPriv) { - GET_CURRENT_CONTEXT(ctx); - tridentContextPtr oldCtx = ctx ? TRIDENT_CONTEXT(ctx) : NULL; - tridentContextPtr newCtx = (tridentContextPtr) driContextPriv->driverPrivate; - - if ( newCtx != oldCtx ) { - newCtx->dirty = ~0; - } - - if (newCtx->driDrawable != driDrawPriv) { - newCtx->driDrawable = driDrawPriv; -#if 0 - tridentUpdateWindow ( newCtx->glCtx ); - tridentUpdateViewportOffset( newCtx->glCtx ); -#endif - } - - newCtx->drawOffset = newCtx->tridentScreen->backOffset; - newCtx->drawPitch = newCtx->tridentScreen->backPitch; - - _mesa_make_current( newCtx->glCtx, - (GLframebuffer *) driDrawPriv->driverPrivate, - (GLframebuffer *) driReadPriv->driverPrivate ); - - if (!newCtx->glCtx->Viewport.Width) { - _mesa_set_viewport(newCtx->glCtx, 0, 0, - driDrawPriv->w, driDrawPriv->h); - } - } else { - _mesa_make_current( NULL, NULL, NULL ); - } - return GL_TRUE; -} - - -static GLboolean -tridentUnbindContext( __DRIcontextPrivate *driContextPriv ) -{ - return GL_TRUE; -} - - -static tridentScreenPtr -tridentCreateScreen( __DRIscreenPrivate *sPriv ) -{ - TRIDENTDRIPtr tDRIPriv = (TRIDENTDRIPtr)sPriv->pDevPriv; - tridentScreenPtr tridentScreen; - - if (sPriv->devPrivSize != sizeof(TRIDENTDRIRec)) { - fprintf(stderr,"\nERROR! sizeof(TRIDENTDRIRec) does not match passed size from device driver\n"); - return GL_FALSE; - } - - /* Allocate the private area */ - tridentScreen = (tridentScreenPtr) CALLOC( sizeof(*tridentScreen) ); - if ( !tridentScreen ) return NULL; - - tridentScreen->driScreen = sPriv; - - tridentScreen->frontOffset = tDRIPriv->frontOffset; - tridentScreen->backOffset = tDRIPriv->backOffset; - tridentScreen->depthOffset = tDRIPriv->depthOffset; - tridentScreen->frontPitch = tDRIPriv->frontPitch; - tridentScreen->backPitch = tDRIPriv->backPitch; - tridentScreen->depthPitch = tDRIPriv->depthPitch; - tridentScreen->width = tDRIPriv->width; - tridentScreen->height = tDRIPriv->height; - -printf("%d %d\n",tridentScreen->width,tridentScreen->height); -printf("%d %d\n",tridentScreen->frontPitch,tridentScreen->backPitch); -printf("offset 0x%x 0x%x\n",tridentScreen->backOffset,tridentScreen->depthOffset); - - tridentScreen->mmio.handle = tDRIPriv->regs; - tridentScreen->mmio.size = 0x20000; - - if (drmMap(sPriv->fd, - tridentScreen->mmio.handle, tridentScreen->mmio.size, - (drmAddressPtr)&tridentScreen->mmio.map)) { - FREE(tridentScreen); - return GL_FALSE; - } -printf("MAPPED at %p\n", tridentScreen->mmio.map); - - return tridentScreen; -} - -/* Destroy the device specific screen private data struct. - */ -static void -tridentDestroyScreen( __DRIscreenPrivate *sPriv ) -{ - tridentScreenPtr tridentScreen = (tridentScreenPtr)sPriv->private; - - FREE(tridentScreen); -} - -static GLboolean -tridentInitDriver(__DRIscreenPrivate *sPriv) -{ - sPriv->private = (void *) tridentCreateScreen( sPriv ); - - if (!sPriv->private) { - tridentDestroyScreen( sPriv ); - return GL_FALSE; - } - - return GL_TRUE; -} - -/** - * This is the driver specific part of the createNewScreen entry point. - * - * \todo maybe fold this into intelInitDriver - * - * \return the __GLcontextModes supported by this driver - */ -const __DRIconfig **tridentInitScreen(__DRIscreenPrivate *psp) -{ - static const __DRIversion ddx_expected = { 4, 0, 0 }; - static const __DRIversion dri_expected = { 3, 1, 0 }; - static const __DRIversion drm_expected = { 1, 0, 0 }; - - if ( ! driCheckDriDdxDrmVersions2( "Trident", - &psp->dri_version, & dri_expected, - &psp->ddx_version, & ddx_expected, - &psp->drm_version, & drm_expected ) ) - return NULL; - - if (!tridentInitDriver(psp)) - return NULL; - - /* Wait... what? This driver doesn't report any modes... */ -#if 0 - TRIDENTDRIPtr dri_priv = (TRIDENTDRIPtr) psp->pDevPriv; - *driver_modes = tridentFillInModes( dri_priv->bytesPerPixel * 8, - GL_TRUE ); -#endif - - return NULL; -} - -const struct __DriverAPIRec driDriverAPI = { - tridentInitScreen, - tridentDestroyScreen, - tridentCreateContext, - tridentDestroyContext, - tridentCreateBuffer, - tridentDestroyBuffer, - tridentSwapBuffers, - tridentMakeCurrent, - tridentUnbindContext, -}; -- cgit v1.2.3 From c6bd5fae0c2af1256ad552d583d9659712807214 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 28 Oct 2009 21:52:37 -0600 Subject: mesa: remove old, unused #define --- src/mesa/main/texstore.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 8ee378e667..36228e671f 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -1087,8 +1087,6 @@ _mesa_texstore_x8_z24(TEXSTORE_PARAMS) } -#define STRIDE_3D 0 - /** * Store a 16-bit integer depth component texture image. */ -- cgit v1.2.3 From 59b29516af2d4d8f83723559921a3709eb77a7d2 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Wed, 28 Oct 2009 22:14:01 -0600 Subject: swrast: added braces --- src/mesa/swrast/s_triangle.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_triangle.c b/src/mesa/swrast/s_triangle.c index 5ecc7692c5..d80a6761f4 100644 --- a/src/mesa/swrast/s_triangle.c +++ b/src/mesa/swrast/s_triangle.c @@ -1101,13 +1101,15 @@ _swrast_choose_triangle( GLcontext *ctx ) #if CHAN_BITS != 8 USE(general_triangle); #else - if (format == MESA_FORMAT_RGBA8888 && !_mesa_little_endian()) + if (format == MESA_FORMAT_RGBA8888 && !_mesa_little_endian()) { /* We only handle RGBA8888 correctly on little endian * in the optimized code above. */ USE(general_triangle); - else + } + else { USE(affine_textured_triangle); + } #endif } } -- cgit v1.2.3 From e2131e017184a595a735e7ea1eced1552b8a7d22 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Oct 2009 07:47:34 -0600 Subject: radeon: fix incorrect Z format in radeon_alloc_renderbuffer_storage() And update error message. --- src/mesa/drivers/dri/radeon/radeon_fbo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index 8dda47fcd1..bf69cd9337 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -133,7 +133,7 @@ radeon_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT24: case GL_DEPTH_COMPONENT32: - rb->Format = MESA_FORMAT_Z32; + rb->Format = MESA_FORMAT_X8_Z24; rb->DataType = GL_UNSIGNED_INT; cpp = 4; break; @@ -145,7 +145,7 @@ radeon_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, break; default: _mesa_problem(ctx, - "Unexpected format in intel_alloc_renderbuffer_storage"); + "Unexpected format in radeon_alloc_renderbuffer_storage"); return GL_FALSE; } -- cgit v1.2.3 From 920f023e8b3a5c2af0877530dc1707d2e50c5d4b Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Thu, 29 Oct 2009 15:19:59 +0800 Subject: mesa/main: Never return NULL in _mesa_get_texstore_func. Signed-off-by: Chia-I Wu --- src/mesa/main/texstore.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 36228e671f..01fea476ae 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -3083,6 +3083,26 @@ texstore_funcs[MESA_FORMAT_COUNT] = }; +static GLboolean +_mesa_texstore_null(TEXSTORE_PARAMS) +{ + (void) ctx; (void) dims; + (void) baseInternalFormat; + (void) dstFormat; + (void) dstAddr; + (void) dstXoffset; (void) dstYoffset; (void) dstZoffset; + (void) dstRowStride; (void) dstImageOffsets; + (void) srcWidth; (void) srcHeight; (void) srcDepth; + (void) srcFormat; (void) srcType; + (void) srcAddr; + (void) srcPacking; + + /* should never happen */ + _mesa_problem(NULL, "_mesa_texstore_null() is called"); + return GL_FALSE; +} + + /** * Return the StoreTexImageFunc pointer to store an image in the given format. */ @@ -3096,7 +3116,11 @@ _mesa_get_texstore_func(gl_format format) } #endif ASSERT(texstore_funcs[format].Name == format); - return texstore_funcs[format].Store; + + if (texstore_funcs[format].Store) + return texstore_funcs[format].Store; + else + return _mesa_texstore_null; } @@ -3112,8 +3136,6 @@ _mesa_texstore(TEXSTORE_PARAMS) storeImage = _mesa_get_texstore_func(dstFormat); - assert(storeImage); - success = storeImage(ctx, dims, baseInternalFormat, dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, dstRowStride, dstImageOffsets, -- cgit v1.2.3 From 20e20fc5afa7525e247fd607e04d9adfffe730b4 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Thu, 29 Oct 2009 14:14:04 +0800 Subject: mesa/main: Make FEATURE_texture_fxt1 follow feature conventions. Also remove the unused initialization and GLchan fetch functions. Signed-off-by: Chia-I Wu --- src/mesa/main/context.c | 3 --- src/mesa/main/texcompress.h | 3 --- src/mesa/main/texcompress_fxt1.c | 35 ++++++----------------------------- src/mesa/main/texcompress_fxt1.h | 22 ++++++++++++++-------- 4 files changed, 20 insertions(+), 43 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index c57d7c10b6..1d540eb732 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -706,9 +706,6 @@ init_attrib_groups(GLcontext *ctx) #if FEATURE_texture_s3tc _mesa_init_texture_s3tc( ctx ); #endif -#if FEATURE_texture_fxt1 - _mesa_init_texture_fxt1( ctx ); -#endif /* Miscellaneous */ ctx->NewState = _NEW_ALL; diff --git a/src/mesa/main/texcompress.h b/src/mesa/main/texcompress.h index 418416746c..d4873db54a 100644 --- a/src/mesa/main/texcompress.h +++ b/src/mesa/main/texcompress.h @@ -48,9 +48,6 @@ _mesa_compressed_image_address(GLint col, GLint row, GLint img, extern void _mesa_init_texture_s3tc( GLcontext *ctx ); -extern void -_mesa_init_texture_fxt1( GLcontext *ctx ); - #else /* _HAVE_FULL_GL */ diff --git a/src/mesa/main/texcompress_fxt1.c b/src/mesa/main/texcompress_fxt1.c index ef42fb92b7..85becb80d2 100644 --- a/src/mesa/main/texcompress_fxt1.c +++ b/src/mesa/main/texcompress_fxt1.c @@ -41,6 +41,9 @@ #include "texstore.h" +#if FEATURE_texture_fxt1 + + static void fxt1_encode (GLuint width, GLuint height, GLint comps, const void *source, GLint srcRowStride, @@ -51,16 +54,6 @@ fxt1_decode_1 (const void *texture, GLint stride, GLint i, GLint j, GLchan *rgba); -/** - * Called during context initialization. - */ -void -_mesa_init_texture_fxt1( GLcontext *ctx ) -{ - (void) ctx; -} - - /** * Store user's image in rgb_fxt1 format. */ @@ -175,15 +168,6 @@ _mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS) } -void -_mesa_fetch_texel_2d_rgba_fxt1( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - (void) k; - fxt1_decode_1(texImage->Data, texImage->RowStride, i, j, texel); -} - - void _mesa_fetch_texel_2d_f_rgba_fxt1( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) @@ -199,16 +183,6 @@ _mesa_fetch_texel_2d_f_rgba_fxt1( const struct gl_texture_image *texImage, } -void -_mesa_fetch_texel_2d_rgb_fxt1( const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel ) -{ - (void) k; - fxt1_decode_1(texImage->Data, texImage->RowStride, i, j, texel); - texel[ACOMP] = 255; -} - - void _mesa_fetch_texel_2d_f_rgb_fxt1( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) @@ -1673,3 +1647,6 @@ fxt1_decode_1 (const void *texture, GLint stride, /* in pixels */ decode_1[mode](code, t, rgba); } + + +#endif /* FEATURE_texture_fxt1 */ diff --git a/src/mesa/main/texcompress_fxt1.h b/src/mesa/main/texcompress_fxt1.h index b74f955fcd..d63ca71e21 100644 --- a/src/mesa/main/texcompress_fxt1.h +++ b/src/mesa/main/texcompress_fxt1.h @@ -25,29 +25,35 @@ #ifndef TEXCOMPRESS_FXT1_H #define TEXCOMPRESS_FXT1_H +#include "main/mtypes.h" #include "texstore.h" +#if FEATURE_texture_fxt1 + extern GLboolean _mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS); extern GLboolean _mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS); -extern void -_mesa_fetch_texel_2d_rgba_fxt1(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel); - extern void _mesa_fetch_texel_2d_f_rgba_fxt1(const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel); -extern void -_mesa_fetch_texel_2d_rgb_fxt1(const struct gl_texture_image *texImage, - GLint i, GLint j, GLint k, GLchan *texel); - extern void _mesa_fetch_texel_2d_f_rgb_fxt1(const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel); +#else /* FEATURE_texture_fxt1 */ + +/* these are used only in texstore_funcs[] */ +#define _mesa_texstore_rgb_fxt1 NULL +#define _mesa_texstore_rgba_fxt1 NULL + +/* these are used only in texfetch_funcs[] */ +#define _mesa_fetch_texel_2d_f_rgba_fxt1 NULL +#define _mesa_fetch_texel_2d_f_rgb_fxt1 NULL + +#endif /* FEATURE_texture_fxt1 */ #endif /* TEXCOMPRESS_FXT1_H */ -- cgit v1.2.3 From 59798cd8864b601e035cf2414517cd90d24ed786 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Thu, 29 Oct 2009 14:59:42 +0800 Subject: mesa/main: Make FEATURE_texture_s3tc follow feature conventions. Signed-off-by: Chia-I Wu --- src/mesa/main/context.c | 4 +--- src/mesa/main/texcompress.h | 5 ----- src/mesa/main/texcompress_s3tc.c | 8 +++++++- src/mesa/main/texcompress_s3tc.h | 31 +++++++++++++++++++++++++++++++ 4 files changed, 39 insertions(+), 9 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 1d540eb732..101d3c6b67 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -123,7 +123,7 @@ #include "simple_list.h" #include "state.h" #include "stencil.h" -#include "texcompress.h" +#include "texcompress_s3tc.h" #include "teximage.h" #include "texobj.h" #include "texstate.h" @@ -703,9 +703,7 @@ init_attrib_groups(GLcontext *ctx) if (!_mesa_init_texture( ctx )) return GL_FALSE; -#if FEATURE_texture_s3tc _mesa_init_texture_s3tc( ctx ); -#endif /* Miscellaneous */ ctx->NewState = _NEW_ALL; diff --git a/src/mesa/main/texcompress.h b/src/mesa/main/texcompress.h index d4873db54a..5e73a3149b 100644 --- a/src/mesa/main/texcompress.h +++ b/src/mesa/main/texcompress.h @@ -44,11 +44,6 @@ _mesa_compressed_image_address(GLint col, GLint row, GLint img, gl_format mesaFormat, GLsizei width, const GLubyte *image); - -extern void -_mesa_init_texture_s3tc( GLcontext *ctx ); - - #else /* _HAVE_FULL_GL */ /* no-op macros */ diff --git a/src/mesa/main/texcompress_s3tc.c b/src/mesa/main/texcompress_s3tc.c index 9fc73fec51..b271a539a7 100644 --- a/src/mesa/main/texcompress_s3tc.c +++ b/src/mesa/main/texcompress_s3tc.c @@ -44,6 +44,10 @@ #include "texcompress_s3tc.h" #include "texstore.h" + +#if FEATURE_texture_s3tc + + #ifdef __MINGW32__ #define DXTN_LIBNAME "dxtn.dll" #define RTLD_LAZY 0 @@ -564,5 +568,7 @@ _mesa_fetch_texel_2d_f_srgba_dxt5(const struct gl_texture_image *texImage, texel[BCOMP] = nonlinear_to_linear(rgba[BCOMP]); texel[ACOMP] = CHAN_TO_FLOAT(rgba[ACOMP]); } -#endif +#endif /* FEATURE_EXT_texture_sRGB */ + +#endif /* FEATURE_texture_s3tc */ diff --git a/src/mesa/main/texcompress_s3tc.h b/src/mesa/main/texcompress_s3tc.h index 4041d244d1..2e7688d366 100644 --- a/src/mesa/main/texcompress_s3tc.h +++ b/src/mesa/main/texcompress_s3tc.h @@ -25,8 +25,12 @@ #ifndef TEXCOMPRESS_S3TC_H #define TEXCOMPRESS_S3TC_H +#include "main/mtypes.h" #include "texstore.h" + +#if FEATURE_texture_s3tc + extern GLboolean _mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS); @@ -71,5 +75,32 @@ extern void _mesa_fetch_texel_2d_f_srgba_dxt5(const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel); +extern void +_mesa_init_texture_s3tc(GLcontext *ctx); + +#else /* FEATURE_texture_s3tc */ + +/* these are used only in texstore_funcs[] */ +#define _mesa_texstore_rgb_dxt1 NULL +#define _mesa_texstore_rgba_dxt1 NULL +#define _mesa_texstore_rgba_dxt3 NULL +#define _mesa_texstore_rgba_dxt5 NULL + +/* these are used only in texfetch_funcs[] */ +#define _mesa_fetch_texel_2d_f_rgb_dxt1 NULL +#define _mesa_fetch_texel_2d_f_rgba_dxt1 NULL +#define _mesa_fetch_texel_2d_f_rgba_dxt3 NULL +#define _mesa_fetch_texel_2d_f_rgba_dxt5 NULL +#define _mesa_fetch_texel_2d_f_srgb_dxt1 NULL +#define _mesa_fetch_texel_2d_f_srgba_dxt1 NULL +#define _mesa_fetch_texel_2d_f_srgba_dxt3 NULL +#define _mesa_fetch_texel_2d_f_srgba_dxt5 NULL + +static INLINE void +_mesa_init_texture_s3tc(GLcontext *ctx) +{ +} + +#endif /* FEATURE_texture_s3tc */ #endif /* TEXCOMPRESS_S3TC_H */ -- cgit v1.2.3 From 9927d7f31c5c46c7b061cf8e13324ac4a837c4b7 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Fri, 2 Oct 2009 15:32:04 +0800 Subject: mesa: Fix compilation errors and warnings when features are disabled. Some of the fixes are cherry-picked from opengl-es branch. Signed-off-by: Chia-I Wu --- src/mesa/main/fbobject.c | 2 ++ src/mesa/main/texparam.c | 2 +- src/mesa/main/texstore.c | 21 ++++++++++----------- src/mesa/state_tracker/st_cb_blit.c | 2 ++ 4 files changed, 15 insertions(+), 12 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 1d6ccf7fdd..4c6528bcf7 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -650,6 +650,8 @@ _mesa_test_framebuffer_completeness(GLcontext *ctx, struct gl_framebuffer *fb) return; } } +#else + (void) j; #endif if (numImages == 0) { diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 4258476092..79298e867a 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -600,7 +600,7 @@ _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params) iparams[1] = (GLint) params[1]; iparams[2] = (GLint) params[2]; iparams[3] = (GLint) params[3]; - need_update = set_tex_parameteri(ctx, target, iparams); + need_update = set_tex_parameteri(ctx, texObj, pname, iparams); } break; #endif diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 01fea476ae..7b449d03be 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -277,16 +277,6 @@ compute_component_mapping(GLenum inFormat, GLenum outFormat, } -#if !FEATURE_convolve -static void -_mesa_adjust_image_for_convolution(GLcontext *ctx, GLuint dims, - GLsizei *srcWidth, GLsizei *srcHeight) -{ - /* no-op */ -} -#endif - - /** * Make a temporary (color) texture image with GLfloat components. * Apply all needed pixel unpacking and pixel transfer operations. @@ -353,7 +343,7 @@ make_temp_float_image(GLcontext *ctx, GLuint dims, const GLuint postConvTransferOps = (transferOps & IMAGE_POST_CONVOLUTION_BITS) | IMAGE_CLAMP_BIT; GLint img, row; - GLint convWidth, convHeight; + GLint convWidth = srcWidth, convHeight = srcHeight; GLfloat *convImage; /* pre-convolution image buffer (3D) */ @@ -3004,6 +2994,15 @@ _mesa_texstore_sla8(TEXSTORE_PARAMS) return k; } +#else + +/* these are used only in texstore_funcs[] below */ +#define _mesa_texstore_srgb8 NULL +#define _mesa_texstore_srgba8 NULL +#define _mesa_texstore_sargb8 NULL +#define _mesa_texstore_sl8 NULL +#define _mesa_texstore_sla8 NULL + #endif /* FEATURE_EXT_texture_sRGB */ diff --git a/src/mesa/state_tracker/st_cb_blit.c b/src/mesa/state_tracker/st_cb_blit.c index 5626e25323..563615ed0d 100644 --- a/src/mesa/state_tracker/st_cb_blit.c +++ b/src/mesa/state_tracker/st_cb_blit.c @@ -64,6 +64,7 @@ st_destroy_blit(struct st_context *st) } +#if FEATURE_EXT_framebuffer_blit static void st_BlitFramebuffer(GLcontext *ctx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, @@ -206,6 +207,7 @@ st_BlitFramebuffer(GLcontext *ctx, } } } +#endif /* FEATURE_EXT_framebuffer_blit */ -- cgit v1.2.3 From 1f1bfe8cb5c74ee8708fb717a19d8389c9fadb80 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Oct 2009 07:54:44 -0600 Subject: mesa: move declaration to prevent unused var warning --- src/mesa/main/texstore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 7b449d03be..6237511e9f 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -3108,8 +3108,8 @@ _mesa_texstore_null(TEXSTORE_PARAMS) static StoreTexImageFunc _mesa_get_texstore_func(gl_format format) { - GLuint i; #ifdef DEBUG + GLuint i; for (i = 0; i < MESA_FORMAT_COUNT; i++) { ASSERT(texstore_funcs[i].Name == i); } -- cgit v1.2.3 From c2f5eb71485e0d4d717bad7ab94fdb4a75f7e38f Mon Sep 17 00:00:00 2001 From: David Heidelberger Date: Thu, 29 Oct 2009 09:54:31 -0600 Subject: st/mesa: Fix nouveau glxinfo after merging texformat-rework. Signed-off-by: David Heidelberger Signed-off-by: Brian Paul --- src/mesa/state_tracker/st_format.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index 0be2737272..7c6615fe04 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -218,6 +218,8 @@ st_mesa_format_to_pipe_format(gl_format mesaFormat) case MESA_FORMAT_ARGB8888_REV: case MESA_FORMAT_ARGB8888: return PIPE_FORMAT_A8R8G8B8_UNORM; + case MESA_FORMAT_XRGB8888: + return PIPE_FORMAT_X8R8G8B8_UNORM; case MESA_FORMAT_ARGB1555: return PIPE_FORMAT_A1R5G5B5_UNORM; case MESA_FORMAT_ARGB4444: @@ -287,6 +289,8 @@ st_pipe_format_to_mesa_format(enum pipe_format pipeFormat) switch (pipeFormat) { case PIPE_FORMAT_A8R8G8B8_UNORM: return MESA_FORMAT_ARGB8888; + case PIPE_FORMAT_X8R8G8B8_UNORM: + return MESA_FORMAT_XRGB8888; case PIPE_FORMAT_A1R5G5B5_UNORM: return MESA_FORMAT_ARGB1555; case PIPE_FORMAT_A4R4G4B4_UNORM: @@ -698,6 +702,8 @@ translate_gallium_format_to_mesa_format(enum pipe_format format) switch (format) { case PIPE_FORMAT_A8R8G8B8_UNORM: return MESA_FORMAT_ARGB8888; + case PIPE_FORMAT_X8R8G8B8_UNORM: + return MESA_FORMAT_XRGB8888; case PIPE_FORMAT_A1R5G5B5_UNORM: return MESA_FORMAT_ARGB1555; case PIPE_FORMAT_A4R4G4B4_UNORM: -- cgit v1.2.3 From 10a509564fa13f036b1b177fafae4337928a39a9 Mon Sep 17 00:00:00 2001 From: David Heidelberger Date: Thu, 29 Oct 2009 09:56:12 -0600 Subject: st/mesa: Add conversion from PIPE_FORMAT_X8Z24_UNORM to MESA_FORMAT_S8_Z24. Fix glxgears and openarena for Nouveau (no more asserts and crash). Signed-off-by: David Heidelberger --- src/mesa/state_tracker/st_format.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index 7c6615fe04..02d3bd943d 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -311,6 +311,7 @@ st_pipe_format_to_mesa_format(enum pipe_format pipeFormat) return MESA_FORMAT_Z32; case PIPE_FORMAT_Z24S8_UNORM: return MESA_FORMAT_Z24_S8; + case PIPE_FORMAT_X8Z24_UNORM: case PIPE_FORMAT_S8Z24_UNORM: return MESA_FORMAT_S8_Z24; case PIPE_FORMAT_S8_UNORM: @@ -724,6 +725,7 @@ translate_gallium_format_to_mesa_format(enum pipe_format format) return MESA_FORMAT_Z32; case PIPE_FORMAT_Z24S8_UNORM: return MESA_FORMAT_Z24_S8; + case PIPE_FORMAT_X8Z24_UNORM: case PIPE_FORMAT_S8Z24_UNORM: return MESA_FORMAT_S8_Z24; case PIPE_FORMAT_YCBCR: -- cgit v1.2.3 From 41892e9b17e4e252ce1e73bc2dbc9d24eb13001b Mon Sep 17 00:00:00 2001 From: David Heidelberger Date: Thu, 29 Oct 2009 10:14:39 -0600 Subject: st/mesa: fix PIPE_FORMAT_X8Z24 <> MESA_FORMAT_X8_Z24 conversion Signed-off-by: David Heidelberger Signed-off-by: Brian Paul --- src/mesa/state_tracker/st_format.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index 02d3bd943d..bb57adbf32 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -312,6 +312,7 @@ st_pipe_format_to_mesa_format(enum pipe_format pipeFormat) case PIPE_FORMAT_Z24S8_UNORM: return MESA_FORMAT_Z24_S8; case PIPE_FORMAT_X8Z24_UNORM: + return MESA_FORMAT_X8_Z24; case PIPE_FORMAT_S8Z24_UNORM: return MESA_FORMAT_S8_Z24; case PIPE_FORMAT_S8_UNORM: @@ -726,6 +727,7 @@ translate_gallium_format_to_mesa_format(enum pipe_format format) case PIPE_FORMAT_Z24S8_UNORM: return MESA_FORMAT_Z24_S8; case PIPE_FORMAT_X8Z24_UNORM: + return MESA_FORMAT_X8_Z24; case PIPE_FORMAT_S8Z24_UNORM: return MESA_FORMAT_S8_Z24; case PIPE_FORMAT_YCBCR: -- cgit v1.2.3 From c89f5b6ac86d46af4f0311fa76db6186825fbf1e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Oct 2009 08:28:52 -0600 Subject: glsl: make shader substitution a little better --- src/mesa/main/shaders.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/shaders.c b/src/mesa/main/shaders.c index 96fd8695a5..d0dc7e551c 100644 --- a/src/mesa/main/shaders.c +++ b/src/mesa/main/shaders.c @@ -26,6 +26,12 @@ #include "glheader.h" #include "context.h" #include "shaders.h" +#include "shader/shader_api.h" + + +/** Define this to enable shader substitution (see below) */ +#define SHADER_SUBST 0 + /** @@ -404,7 +410,6 @@ _mesa_read_shader(const char *fname) } - /** * Called via glShaderSource() and glShaderSourceARB() API functions. * Basically, concatenate the source code strings into one long string @@ -418,6 +423,7 @@ _mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count, GLint *offsets; GLsizei i, totalLength; GLcharARB *source; + GLuint checksum; if (!shaderObj || string == NULL) { _mesa_error(ctx, GL_INVALID_VALUE, "glShaderSourceARB"); @@ -469,15 +475,16 @@ _mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count, source[totalLength - 1] = '\0'; source[totalLength - 2] = '\0'; - if (0) { + if (SHADER_SUBST) { /* Compute the shader's source code checksum then try to open a file * named newshader_. If it exists, use it in place of the * original shader source code. For debugging. */ - const GLuint checksum = _mesa_str_checksum(source); char filename[100]; GLcharARB *newSource; + checksum = _mesa_str_checksum(source); + sprintf(filename, "newshader_%d", checksum); newSource = _mesa_read_shader(filename); @@ -491,6 +498,12 @@ _mesa_ShaderSourceARB(GLhandleARB shaderObj, GLsizei count, ctx->Driver.ShaderSource(ctx, shaderObj, source); + if (SHADER_SUBST) { + struct gl_shader *sh = _mesa_lookup_shader(ctx, shaderObj); + if (sh) + sh->SourceChecksum = checksum; /* save original checksum */ + } + _mesa_free(offsets); } -- cgit v1.2.3 From cf7040594e7987c021903f022784e2c6dae2db36 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Oct 2009 09:31:29 -0600 Subject: mesa: remove unneedded is_srgb_teximage() function Use _mesa_get_format_color_encoding() function instead. --- src/mesa/main/texgetimage.c | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index 1338d4552d..9a88ec9ce3 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -44,29 +44,6 @@ #if FEATURE_EXT_texture_sRGB -/** - * Test if given texture image is an sRGB format. - */ -static GLboolean -is_srgb_teximage(const struct gl_texture_image *texImage) -{ - switch (texImage->TexFormat) { - case MESA_FORMAT_SRGB8: - case MESA_FORMAT_SRGBA8: - case MESA_FORMAT_SARGB8: - case MESA_FORMAT_SL8: - case MESA_FORMAT_SLA8: - case MESA_FORMAT_SRGB_DXT1: - case MESA_FORMAT_SRGBA_DXT1: - case MESA_FORMAT_SRGBA_DXT3: - case MESA_FORMAT_SRGBA_DXT5: - return GL_TRUE; - default: - return GL_FALSE; - } -} - - /** * Convert a float value from linear space to a * non-linear sRGB value in [0, 255]. @@ -224,7 +201,8 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, } } #if FEATURE_EXT_texture_sRGB - else if (is_srgb_teximage(texImage)) { + else if (_mesa_get_format_color_encoding(texImage->TexFormat) + == GL_SRGB) { /* special case this since need to backconvert values */ /* convert row to RGBA format */ GLfloat rgba[MAX_WIDTH][4]; -- cgit v1.2.3 From d580c0c8f7cad69b808118ef2aa6161f62f160d8 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Oct 2009 09:19:24 -0600 Subject: mesa: fix some tests in subtexture_error_check2() Don't use hard-coded compressed block sizes. Update comments and error strings. --- src/mesa/main/teximage.c | 45 ++++++++++++++++++++++----------------------- 1 file changed, 22 insertions(+), 23 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 0db98795dc..13053ce9ba 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1538,6 +1538,11 @@ subtexture_error_check( GLcontext *ctx, GLuint dimensions, return GL_FALSE; } + +/** + * Do second part of glTexSubImage which depends on the destination texture. + * \return GL_TRUE if error recorded, GL_FALSE otherwise + */ static GLboolean subtexture_error_check2( GLcontext *ctx, GLuint dimensions, GLenum target, GLint level, @@ -1585,41 +1590,35 @@ subtexture_error_check2( GLcontext *ctx, GLuint dimensions, } } -#if FEATURE_EXT_texture_sRGB - if (destTex->InternalFormat == GL_COMPRESSED_SRGB_S3TC_DXT1_EXT || - destTex->InternalFormat == GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT || - destTex->InternalFormat == GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT || - destTex->InternalFormat == GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT) { - if ((width & 0x3) || (height & 0x3) || - (xoffset & 0x3) || (yoffset & 0x3)) - _mesa_error(ctx, GL_INVALID_OPERATION, - "glTexSubImage%dD(size or offset not multiple of 4)", - dimensions); - return GL_TRUE; - } -#endif - if (_mesa_is_format_compressed(destTex->TexFormat)) { + GLuint bw, bh; + if (!target_can_be_compressed(ctx, target)) { _mesa_error(ctx, GL_INVALID_ENUM, - "glTexSubImage%D(target)", dimensions); + "glTexSubImage%D(target=%s)", dimensions, + _mesa_lookup_enum_by_nr(target)); return GL_TRUE; } - /* offset must be multiple of 4 */ - if ((xoffset & 3) || (yoffset & 3)) { + + /* do tests which depend on compression block size */ + _mesa_get_format_block_size(destTex->TexFormat, &bw, &bh); + + /* offset must be multiple of block size */ + if ((xoffset % bw != 0) || (yoffset % bh != 0)) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glTexSubImage%D(xoffset or yoffset)", dimensions); + "glTexSubImage%D(xoffset = %d, yoffset = %d)", + dimensions, xoffset, yoffset); return GL_TRUE; } - /* size must be multiple of 4 or equal to whole texture size */ - if ((width & 3) && (GLuint) width != destTex->Width) { + /* size must be multiple of bw by bh or equal to whole texture size */ + if ((width % bw != 0) && (GLuint) width != destTex->Width) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glTexSubImage%D(width)", dimensions); + "glTexSubImage%D(width = %d)", dimensions, width); return GL_TRUE; } - if ((height & 3) && (GLuint) height != destTex->Height) { + if ((height % bh != 0) && (GLuint) height != destTex->Height) { _mesa_error(ctx, GL_INVALID_OPERATION, - "glTexSubImage%D(width)", dimensions); + "glTexSubImage%D(height = %d)", dimensions, height); return GL_TRUE; } } -- cgit v1.2.3 From 67df4fb56bcb72eddcfc187454d95b663cc43578 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Oct 2009 09:25:16 -0600 Subject: mesa: move, clean-up _mesa_print_texture() --- src/mesa/main/debug.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++ src/mesa/main/debug.h | 3 +++ src/mesa/main/teximage.c | 57 -------------------------------------------- 3 files changed, 64 insertions(+), 57 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index ee8cc29301..a42113edca 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -574,3 +574,64 @@ _mesa_dump_stencil_buffer(const char *filename) _mesa_free(buf); _mesa_free(buf2); } + + +/** + * Quick and dirty function to "print" a texture to stdout. + */ +void +_mesa_print_texture(GLcontext *ctx, const struct gl_texture_image *img) +{ +#if CHAN_TYPE != GL_UNSIGNED_BYTE + _mesa_problem(NULL, "PrintTexture not supported"); +#else + GLuint i, j, c; + const GLubyte *data = (const GLubyte *) img->Data; + + if (!data) { + _mesa_printf("No texture data\n"); + return; + } + + /* XXX add more formats or make into a new format utility function */ + switch (img->TexFormat) { + case MESA_FORMAT_A8: + case MESA_FORMAT_L8: + case MESA_FORMAT_I8: + case MESA_FORMAT_CI8: + c = 1; + break; + case MESA_FORMAT_AL88: + case MESA_FORMAT_AL88_REV: + c = 2; + break; + case MESA_FORMAT_RGB888: + case MESA_FORMAT_BGR888: + c = 3; + break; + case MESA_FORMAT_RGBA8888: + case MESA_FORMAT_ARGB8888: + c = 4; + break; + default: + _mesa_problem(NULL, "error in PrintTexture\n"); + return; + } + + for (i = 0; i < img->Height; i++) { + for (j = 0; j < img->Width; j++) { + if (c==1) + _mesa_printf("%02x ", data[0]); + else if (c==2) + _mesa_printf("%02x%02x ", data[0], data[1]); + else if (c==3) + _mesa_printf("%02x%02x%02x ", data[0], data[1], data[2]); + else if (c==4) + _mesa_printf("%02x%02x%02x%02x ", data[0], data[1], data[2], data[3]); + data += (img->RowStride - img->Width) * c; + } + /* XXX use img->ImageStride here */ + _mesa_printf("\n"); + } +#endif +} diff --git a/src/mesa/main/debug.h b/src/mesa/main/debug.h index d12ea602dd..0449cb1798 100644 --- a/src/mesa/main/debug.h +++ b/src/mesa/main/debug.h @@ -75,4 +75,7 @@ _mesa_dump_depth_buffer(const char *filename); extern void _mesa_dump_stencil_buffer(const char *filename); +extern void +_mesa_print_texture(GLcontext *ctx, const struct gl_texture_image *img); + #endif diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 13053ce9ba..73a555a181 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -82,63 +82,6 @@ _mesa_free_texmemory(void *m) } - - -#if 0 -static void PrintTexture(GLcontext *ctx, const struct gl_texture_image *img) -{ -#if CHAN_TYPE != GL_UNSIGNED_BYTE - _mesa_problem(NULL, "PrintTexture not supported"); -#else - GLuint i, j, c; - const GLubyte *data = (const GLubyte *) img->Data; - - if (!data) { - _mesa_printf("No texture data\n"); - return; - } - - switch (img->Format) { - case GL_ALPHA: - case GL_LUMINANCE: - case GL_INTENSITY: - case GL_COLOR_INDEX: - c = 1; - break; - case GL_LUMINANCE_ALPHA: - c = 2; - break; - case GL_RGB: - c = 3; - break; - case GL_RGBA: - c = 4; - break; - default: - _mesa_problem(NULL, "error in PrintTexture\n"); - return; - } - - for (i = 0; i < img->Height; i++) { - for (j = 0; j < img->Width; j++) { - if (c==1) - _mesa_printf("%02x ", data[0]); - else if (c==2) - _mesa_printf("%02x%02x ", data[0], data[1]); - else if (c==3) - _mesa_printf("%02x%02x%02x ", data[0], data[1], data[2]); - else if (c==4) - _mesa_printf("%02x%02x%02x%02x ", data[0], data[1], data[2], data[3]); - data += (img->RowStride - img->Width) * c; - } - /* XXX use img->ImageStride here */ - _mesa_printf("\n"); - } -#endif -} -#endif - - /* * Compute floor(log_base_2(n)). * If n < 0 return -1. -- cgit v1.2.3 From 99bbf4b4f55b3b0038cbaadefb92ea4a73af6e0a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Oct 2009 10:05:06 -0600 Subject: mesa: consolidate some code in _mesa_GetTexImage() --- src/mesa/main/texgetimage.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index 9a88ec9ce3..2a6c358e41 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -488,6 +488,7 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format, { const struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; + struct gl_texture_image *texImage; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); @@ -497,10 +498,9 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format, texUnit = _mesa_get_current_tex_unit(ctx); texObj = _mesa_select_tex_object(ctx, texUnit, target); + texImage = _mesa_select_tex_image(ctx, texObj, target, level); if (MESA_VERBOSE & (VERBOSE_API | VERBOSE_TEXTURE)) { - struct gl_texture_image *texImage = - _mesa_select_tex_image(ctx, texObj, target, level); _mesa_debug(ctx, "glGetTexImage(tex %u) format = %s, w=%d, h=%d," " dstFmt=0x%x, dstType=0x%x\n", texObj->Name, @@ -511,10 +511,6 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format, _mesa_lock_texture(ctx, texObj); { - struct gl_texture_image *texImage = - _mesa_select_tex_image(ctx, texObj, target, level); - - /* typically, this will call _mesa_get_teximage() */ ctx->Driver.GetTexImage(ctx, target, level, format, type, pixels, texObj, texImage); } -- cgit v1.2.3 From 01ee5c63d3a8334f20e3fcaf6d19ba00bddf8268 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Oct 2009 10:44:46 -0600 Subject: mesa: move pixels==NULL check in glGetTexImage() --- src/mesa/main/texgetimage.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index 2a6c358e41..0b439f2e2e 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -111,17 +111,12 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, /* out of memory or other unexpected error */ _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGetTexImage(map PBO failed)"); return; - } /* was an offset into the PBO. * Now make it a real, client-side pointer inside the mapped region. */ pixels = ADD_POINTERS(buf, pixels); } - else if (!pixels) { - /* not an error */ - return; - } { const GLint width = texImage->Width; @@ -318,10 +313,6 @@ _mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level, } img = ADD_POINTERS(buf, img); } - else if (!img) { - /* not an error */ - return; - } /* just memcpy, no pixelstore or pixel transfer */ _mesa_memcpy(img, texImage->Data, size); @@ -496,6 +487,11 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format, return; } + if (_mesa_is_bufferobj(ctx->Pack.BufferObj) && !pixels) { + /* not an error, do nothing */ + return; + } + texUnit = _mesa_get_current_tex_unit(ctx); texObj = _mesa_select_tex_object(ctx, texUnit, target); texImage = _mesa_select_tex_image(ctx, texObj, target, level); @@ -614,6 +610,11 @@ _mesa_GetCompressedTexImageARB(GLenum target, GLint level, GLvoid *img) return; } + if (_mesa_is_bufferobj(ctx->Pack.BufferObj) && !img) { + /* not an error, do nothing */ + return; + } + texUnit = _mesa_get_current_tex_unit(ctx); texObj = _mesa_select_tex_object(ctx, texUnit, target); -- cgit v1.2.3 From dcb4716802878690908a101b1c196737851d4151 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Oct 2009 10:50:10 -0600 Subject: intel: added fast memcpy path for glGetTexImage() --- src/mesa/drivers/dri/intel/intel_tex_image.c | 105 ++++++++++++++++++++++++++- 1 file changed, 102 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index 7e57e99be6..0199837cbe 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -6,6 +6,7 @@ #include "main/bufferobj.h" #include "main/convolve.h" #include "main/context.h" +#include "main/image.h" #include "main/texcompress.h" #include "main/texstore.h" #include "main/texgetimage.h" @@ -618,6 +619,100 @@ intelCompressedTexImage2D( GLcontext *ctx, GLenum target, GLint level, } +/** + * Try to use memcpy() to do a glGetTexImage(). + * \return GL_TRUE if done, GL_FALSE otherwise + */ +static GLboolean +memcpy_get_tex_image(GLcontext *ctx, GLenum target, GLint level, + GLenum format, GLenum type, GLvoid * pixels, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage) +{ + GLboolean memCopy = GL_FALSE; + + /* Texture image should have been mapped already */ + assert(texImage->Data); + + /* + * Check if the src/dst formats are compatible. + * Also note that GL's pixel transfer ops don't apply to glGetTexImage() + * so we don't have to worry about those. + */ + if ((texObj->Target == GL_TEXTURE_1D || + texObj->Target == GL_TEXTURE_2D || + texObj->Target == GL_TEXTURE_RECTANGLE || + (texObj->Target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X && + texObj->Target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z))) { + if (texImage->TexFormat == MESA_FORMAT_ARGB8888 && + format == GL_BGRA && + type == GL_UNSIGNED_BYTE && + _mesa_little_endian()) { + memCopy = GL_TRUE; + } + else if (texImage->TexFormat == MESA_FORMAT_AL88 && + format == GL_LUMINANCE_ALPHA && + type == GL_UNSIGNED_BYTE && + _mesa_little_endian()) { + memCopy = GL_TRUE; + } + else if (texImage->TexFormat == MESA_FORMAT_L8 && + format == GL_LUMINANCE && + type == GL_UNSIGNED_BYTE) { + memCopy = GL_TRUE; + } + else if (texImage->TexFormat == MESA_FORMAT_A8 && + format == GL_ALPHA && + type == GL_UNSIGNED_BYTE) { + memCopy = GL_TRUE; + } + } + + if (memCopy) { + struct gl_pixelstore_attrib *pack = &ctx->Pack; + + if (_mesa_is_bufferobj(pack->BufferObj)) { + /* Packing texture image into a PBO */ + GLubyte *buf = (GLubyte *) + ctx->Driver.MapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, + GL_WRITE_ONLY_ARB, pack->BufferObj); + if (!buf) { + /* out of memory or other unexpected error */ + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGetTexImage(map PBO failed)"); + return GL_TRUE; /* failed, but done */ + } + pixels = ADD_POINTERS(buf, pixels); + } + + { + const GLuint bpp = _mesa_get_format_bytes(texImage->TexFormat); + const GLuint bytesPerRow = texImage->Width * bpp; + GLubyte *dst = + _mesa_image_address2d(&ctx->Pack, pixels, texImage->Width, + texImage->Height, format, type, 0, 0); + const GLint dstRowStride = + _mesa_image_row_stride(&ctx->Pack, texImage->Width, format, type); + const GLubyte *src = texImage->Data; + const GLint srcRowStride = texImage->RowStride * bpp; + GLuint row; + + printf("Fast getteximage!\n"); + for (row = 0; row < texImage->Height; row++) { + memcpy(dst, src, bytesPerRow); + dst += dstRowStride; + src += srcRowStride; + } + } + + if (_mesa_is_bufferobj(pack->BufferObj)) { + ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, pack->BufferObj); + } + } + + return memCopy; +} + + /** * Need to map texture image into memory before copying image data, * then unmap it. @@ -667,9 +762,13 @@ intel_get_tex_image(GLcontext * ctx, GLenum target, GLint level, if (compressed) { _mesa_get_compressed_teximage(ctx, target, level, pixels, texObj, texImage); - } else { - _mesa_get_teximage(ctx, target, level, format, type, pixels, - texObj, texImage); + } + else { + if (!memcpy_get_tex_image(ctx, target, level, format, type, pixels, + texObj, texImage)) { + _mesa_get_teximage(ctx, target, level, format, type, pixels, + texObj, texImage); + } } -- cgit v1.2.3 From 2b628d43c0a2f9a14ea1e87dbdcac512fca7198a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Oct 2009 10:53:26 -0600 Subject: mesa: consolidate some code in _mesa_GetCompressedTexImageARB() --- src/mesa/main/texgetimage.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index 0b439f2e2e..fbd61d5ae6 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -603,6 +603,7 @@ _mesa_GetCompressedTexImageARB(GLenum target, GLint level, GLvoid *img) { const struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; + struct gl_texture_image *texImage; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); @@ -617,10 +618,9 @@ _mesa_GetCompressedTexImageARB(GLenum target, GLint level, GLvoid *img) texUnit = _mesa_get_current_tex_unit(ctx); texObj = _mesa_select_tex_object(ctx, texUnit, target); + texImage = _mesa_select_tex_image(ctx, texObj, target, level); if (MESA_VERBOSE & (VERBOSE_API | VERBOSE_TEXTURE)) { - struct gl_texture_image *texImage = - _mesa_select_tex_image(ctx, texObj, target, level); _mesa_debug(ctx, "glGetCompressedTexImage(tex %u) format = %s, w=%d, h=%d\n", texObj->Name, @@ -630,10 +630,6 @@ _mesa_GetCompressedTexImageARB(GLenum target, GLint level, GLvoid *img) _mesa_lock_texture(ctx, texObj); { - struct gl_texture_image *texImage = - _mesa_select_tex_image(ctx, texObj, target, level); - - /* this typically calls _mesa_get_compressed_teximage() */ ctx->Driver.GetCompressedTexImage(ctx, target, level, img, texObj, texImage); } -- cgit v1.2.3 From 1596f714d2377036152bd126949c6526fdb06fbf Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Oct 2009 10:56:13 -0600 Subject: intel: remove debug code --- src/mesa/drivers/dri/intel/intel_tex_image.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index 0199837cbe..c861fc552f 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -696,7 +696,6 @@ memcpy_get_tex_image(GLcontext *ctx, GLenum target, GLint level, const GLint srcRowStride = texImage->RowStride * bpp; GLuint row; - printf("Fast getteximage!\n"); for (row = 0; row < texImage->Height; row++) { memcpy(dst, src, bytesPerRow); dst += dstRowStride; -- cgit v1.2.3 From fb0084e69e3326b49aca8ca004e19acb7f8c8555 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 26 Oct 2009 09:15:42 -0700 Subject: intel: Clean up merge leftover from the DRI2 swap throttling. --- src/mesa/drivers/dri/intel/intel_batchbuffer.c | 5 ----- 1 file changed, 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.c b/src/mesa/drivers/dri/intel/intel_batchbuffer.c index 6aa36d10b1..e94b8368cd 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.c @@ -201,11 +201,6 @@ _intel_batchbuffer_flush(struct intel_batchbuffer *batch, const char *file, drm_intel_bo_reference(intel->first_post_swapbuffers_batch); } - if (intel->first_post_swapbuffers_batch == NULL) { - intel->first_post_swapbuffers_batch = intel->batch->buf; - drm_intel_bo_reference(intel->first_post_swapbuffers_batch); - } - if (used == 0) { batch->cliprect_mode = IGNORE_CLIPRECTS; return; -- cgit v1.2.3 From 6eb6a0e9cbed6ba5543d54e277f7ac11a0612070 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 26 Oct 2009 09:37:53 -0700 Subject: intel: Don't bother MI_FLUSHing on glFlush in the DRI2 case. We only need it when drawing to the front buffer, which we never do for DRI2. No significant performance difference, but the flush is definitely gone from the end of every batchbuffer. --- src/mesa/drivers/dri/intel/intel_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index c3432497ca..a7d94ced9a 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -484,7 +484,7 @@ intel_flush(GLcontext *ctx, GLboolean needs_mi_flush) * lands onscreen in a timely manner, even if the X Server doesn't trigger * a flush for us. */ - if (needs_mi_flush) + if (!intel->driScreen->dri2.enabled && needs_mi_flush) intel_batchbuffer_emit_mi_flush(intel->batch); if (intel->batch->map != intel->batch->ptr) -- cgit v1.2.3 From 32ec3f26731ac998b6fda7ce596ec568d6f76eeb Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 28 Oct 2009 16:35:16 -0700 Subject: mesa: Mostly fix swrast's ARB_depth_clamp support. I'd written a testcase for the hard part of the extension enablement, so naturally the easy stuff was completely broken. There are still issues, as I'm seeing FLOAT_TO_UINT(max_f) == 0x0 when max_f == 1.0, but it gets piglit depth-clamp-range closer to success. --- src/mesa/swrast/s_depth.c | 28 +++++++++++++++++++--------- src/mesa/swrast/s_span.c | 10 +++++++--- 2 files changed, 26 insertions(+), 12 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c index 393590c673..c37a54eb3e 100644 --- a/src/mesa/swrast/s_depth.c +++ b/src/mesa/swrast/s_depth.c @@ -506,22 +506,32 @@ _swrast_depth_clamp_span( GLcontext *ctx, SWspan *span ) struct gl_renderbuffer *rb = fb->_DepthBuffer; const GLuint count = span->end; GLuint *zValues = span->array->z; - GLuint near, far; + GLuint min, max; + GLfloat min_f, max_f; int i; + if (ctx->Viewport.Near < ctx->Viewport.Far) { + min_f = ctx->Viewport.Near; + max_f = ctx->Viewport.Far; + } else { + min_f = ctx->Viewport.Far; + max_f = ctx->Viewport.Near; + } + if (rb->DataType == GL_UNSIGNED_SHORT) { - near = FLOAT_TO_UINT(ctx->Viewport.Near); - far = FLOAT_TO_UINT(ctx->Viewport.Far); + CLAMPED_FLOAT_TO_USHORT(min, min_f); + CLAMPED_FLOAT_TO_USHORT(max, max_f); } else { assert(rb->DataType == GL_UNSIGNED_INT); - CLAMPED_FLOAT_TO_USHORT(near, ctx->Viewport.Near); - CLAMPED_FLOAT_TO_USHORT(far, ctx->Viewport.Far); + min = FLOAT_TO_UINT(min_f); + max = FLOAT_TO_UINT(max_f); } + for (i = 0; i < count; i++) { - if (zValues[i] < near) - zValues[i] = near; - if (zValues[i] > far) - zValues[i] = far; + if (zValues[i] < min) + zValues[i] = min; + if (zValues[i] > max) + zValues[i] = max; } } diff --git a/src/mesa/swrast/s_span.c b/src/mesa/swrast/s_span.c index 704230d1d7..d36c8132f6 100644 --- a/src/mesa/swrast/s_span.c +++ b/src/mesa/swrast/s_span.c @@ -880,14 +880,14 @@ _swrast_write_index_span( GLcontext *ctx, SWspan *span) stipple_polygon_span(ctx, span); } - if (ctx->Transform.DepthClamp) - _swrast_depth_clamp_span(ctx, span); - /* Stencil and Z testing */ if (ctx->Stencil._Enabled || ctx->Depth.Test) { if (!(span->arrayMask & SPAN_Z)) _swrast_span_interpolate_z(ctx, span); + if (ctx->Transform.DepthClamp) + _swrast_depth_clamp_span(ctx, span); + if (ctx->Stencil._Enabled) { if (!_swrast_stencil_and_ztest_span(ctx, span)) { span->arrayMask = origArrayMask; @@ -1356,6 +1356,10 @@ _swrast_write_rgba_span( GLcontext *ctx, SWspan *span) if (ctx->Stencil._Enabled || ctx->Depth.Test) { if (!(span->arrayMask & SPAN_Z)) _swrast_span_interpolate_z(ctx, span); + + if (ctx->Transform.DepthClamp) + _swrast_depth_clamp_span(ctx, span); + if (ctx->Stencil._Enabled) { /* Combined Z/stencil tests */ if (!_swrast_stencil_and_ztest_span(ctx, span)) { -- cgit v1.2.3 From 92e7c6a2581b5f612a84587500399bb00318c6f0 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 28 Oct 2009 16:36:35 -0700 Subject: i965: Fix fallout from ARB_depth_clamp enablement that broke glDepthRange. If a backwards glDepthRange was supplied (as with the old Quake no-z-clearing hack), the hardware would have always clamped because we weren't clamping to the min of near/far and the max of near/far. Also, we shouldn't be clamping to near/far at all when not in depth clamp mode (this usually didn't matter since near/far are usually the same as the 0.0, 1.0 clamping you do for fixed-point depth). This should fix funny depth issues in PlaneShift, and fixes piglit depth-clamp-range --- src/mesa/drivers/dri/i965/brw_cc.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_cc.c b/src/mesa/drivers/dri/i965/brw_cc.c index 1088a7a607..5cca605c3f 100644 --- a/src/mesa/drivers/dri/i965/brw_cc.c +++ b/src/mesa/drivers/dri/i965/brw_cc.c @@ -44,9 +44,15 @@ static void prepare_cc_vp( struct brw_context *brw ) memset(&ccv, 0, sizeof(ccv)); - /* _NEW_VIEWPORT */ - ccv.min_depth = ctx->Viewport.Near; - ccv.max_depth = ctx->Viewport.Far; + /* _NEW_TRANSOFORM */ + if (ctx->Transform.DepthClamp) { + /* _NEW_VIEWPORT */ + ccv.min_depth = MIN2(ctx->Viewport.Near, ctx->Viewport.Far); + ccv.max_depth = MAX2(ctx->Viewport.Near, ctx->Viewport.Far); + } else { + ccv.min_depth = 0.0; + ccv.max_depth = 1.0; + } dri_bo_unreference(brw->cc.vp_bo); brw->cc.vp_bo = brw_cache_data( &brw->cache, BRW_CC_VP, &ccv, NULL, 0 ); @@ -54,7 +60,7 @@ static void prepare_cc_vp( struct brw_context *brw ) const struct brw_tracked_state brw_cc_vp = { .dirty = { - .mesa = _NEW_VIEWPORT, + .mesa = _NEW_VIEWPORT | _NEW_TRANSFORM, .brw = BRW_NEW_CONTEXT, .cache = 0 }, -- cgit v1.2.3 From ea414e331802e49d59eb2ddd2466d58a383bc931 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Oct 2009 11:04:11 -0600 Subject: intel: check for single memcpy() in memcpy_get_tex_image() --- src/mesa/drivers/dri/intel/intel_tex_image.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index c861fc552f..6301444c34 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -696,11 +696,16 @@ memcpy_get_tex_image(GLcontext *ctx, GLenum target, GLint level, const GLint srcRowStride = texImage->RowStride * bpp; GLuint row; - for (row = 0; row < texImage->Height; row++) { - memcpy(dst, src, bytesPerRow); - dst += dstRowStride; - src += srcRowStride; - } + if (bytesPerRow == dstRowStride && bytesPerRow == dstRowStride) { + memcpy(dst, src, bytesPerRow * texImage->Height); + } + else { + for (row = 0; row < texImage->Height; row++) { + memcpy(dst, src, bytesPerRow); + dst += dstRowStride; + src += srcRowStride; + } + } } if (_mesa_is_bufferobj(pack->BufferObj)) { -- cgit v1.2.3 From 374447244165b3b79892cb6840a76ea4c2f21f1e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 29 Oct 2009 10:36:22 -0700 Subject: i965: Replace a MIN(MAX()) with CLAMP(). --- src/mesa/drivers/dri/i965/brw_wm_sampler_state.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c index dff466587a..416ffc9761 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c @@ -228,8 +228,8 @@ static void brw_update_sampler_state(struct wm_sampler_entry *key, */ sampler->ss0.base_level = U_FIXED(0, 1); - sampler->ss1.max_lod = U_FIXED(MIN2(MAX2(key->maxlod, 0), 13), 6); - sampler->ss1.min_lod = U_FIXED(MIN2(MAX2(key->minlod, 0), 13), 6); + sampler->ss1.max_lod = U_FIXED(CLAMP(key->maxlod, 0, 13), 6); + sampler->ss1.min_lod = U_FIXED(CLAMP(key->minlod, 0, 13), 6); sampler->ss2.default_color_pointer = sdc_bo->offset >> 5; /* reloc */ } -- cgit v1.2.3 From f8f40b53a6a4551630e25bfd7f6e12334bb0f3f8 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 29 Oct 2009 11:52:28 -0700 Subject: i915: Implement min/max LOD clamping with the hardware. This gets us expected behavior for clamping between mipmap levels, and avoids relayout of textures for doing clamping. Fixes piglit lodclamp-between. --- src/mesa/drivers/dri/i915/i915_texstate.c | 12 ++++-- src/mesa/drivers/dri/i965/brw_wm_sampler_state.c | 13 ------- src/mesa/drivers/dri/intel/intel_context.h | 13 +++++++ src/mesa/drivers/dri/intel/intel_tex_validate.c | 48 ++++++++++++------------ 4 files changed, 46 insertions(+), 40 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index 3a20e9c3ab..1397f04a59 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -27,6 +27,7 @@ #include "main/mtypes.h" #include "main/enums.h" +#include "main/macros.h" #include "intel_mipmap_tree.h" #include "intel_tex.h" @@ -200,10 +201,10 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) } state[I915_TEXREG_MS4] = - ((((pitch / 4) - 1) << MS4_PITCH_SHIFT) | MS4_CUBE_FACE_ENA_MASK | - ((((intelObj->lastLevel - intelObj->firstLevel) * 4)) << - MS4_MAX_LOD_SHIFT) | ((firstImage->Depth - 1) << - MS4_VOLUME_DEPTH_SHIFT)); + ((((pitch / 4) - 1) << MS4_PITCH_SHIFT) | + MS4_CUBE_FACE_ENA_MASK | + (U_FIXED(CLAMP(tObj->MaxLod, 0.0, 11.0), 2) << MS4_MAX_LOD_SHIFT) | + ((firstImage->Depth - 1) << MS4_VOLUME_DEPTH_SHIFT)); { @@ -333,6 +334,9 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) (translate_wrap_mode(wr) << SS3_TCZ_ADDR_MODE_SHIFT)); state[I915_TEXREG_SS3] |= (unit << SS3_TEXTUREMAP_INDEX_SHIFT); + state[I915_TEXREG_SS3] |= (U_FIXED(CLAMP(tObj->MinLod, 0.0, 11.0), 4) << + SS3_MIN_LOD_SHIFT); + } /* convert border color from float to ubyte */ diff --git a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c index 416ffc9761..0acb027431 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c @@ -66,19 +66,6 @@ static GLuint translate_wrap_mode( GLenum wrap ) } } - -static GLuint U_FIXED(GLfloat value, GLuint frac_bits) -{ - value *= (1<prim.flush) \ diff --git a/src/mesa/drivers/dri/intel/intel_tex_validate.c b/src/mesa/drivers/dri/intel/intel_tex_validate.c index d5b562f5e5..504993989a 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_validate.c +++ b/src/mesa/drivers/dri/intel/intel_tex_validate.c @@ -5,6 +5,7 @@ #include "intel_batchbuffer.h" #include "intel_mipmap_tree.h" #include "intel_tex.h" +#include "intel_chipset.h" #define FILE_DEBUG_FLAG DEBUG_TEXTURE @@ -14,7 +15,8 @@ * GL_TEXTURE_MAX_LOD, GL_TEXTURE_BASE_LEVEL, and GL_TEXTURE_MAX_LEVEL. */ static void -intel_calculate_first_last_level(struct intel_texture_object *intelObj) +intel_calculate_first_last_level(struct intel_context *intel, + struct intel_texture_object *intelObj) { struct gl_texture_object *tObj = &intelObj->base; const struct gl_texture_image *const baseImage = @@ -40,27 +42,27 @@ intel_calculate_first_last_level(struct intel_texture_object *intelObj) firstLevel = lastLevel = tObj->BaseLevel; } else { -#ifdef I915 - firstLevel = tObj->BaseLevel + (GLint) (tObj->MinLod + 0.5); - firstLevel = MAX2(firstLevel, tObj->BaseLevel); - firstLevel = MIN2(firstLevel, tObj->BaseLevel + baseImage->MaxLog2); - lastLevel = tObj->BaseLevel + (GLint) (tObj->MaxLod + 0.5); - lastLevel = MAX2(lastLevel, tObj->BaseLevel); - lastLevel = MIN2(lastLevel, tObj->BaseLevel + baseImage->MaxLog2); - lastLevel = MIN2(lastLevel, tObj->MaxLevel); - lastLevel = MAX2(firstLevel, lastLevel); /* need at least one level */ -#else - /* Currently not taking min/max lod into account here, those - * values are programmed as sampler state elsewhere and we - * upload the same mipmap levels regardless. Not sure if - * this makes sense as it means it isn't possible for the app - * to use min/max lod to reduce texture memory pressure: - */ - firstLevel = tObj->BaseLevel; - lastLevel = MIN2(tObj->BaseLevel + baseImage->MaxLog2, - tObj->MaxLevel); - lastLevel = MAX2(firstLevel, lastLevel); /* need at least one level */ -#endif + if (!IS_9XX(intel->intelScreen->deviceID)) { + firstLevel = tObj->BaseLevel + (GLint) (tObj->MinLod + 0.5); + firstLevel = MAX2(firstLevel, tObj->BaseLevel); + firstLevel = MIN2(firstLevel, tObj->BaseLevel + baseImage->MaxLog2); + lastLevel = tObj->BaseLevel + (GLint) (tObj->MaxLod + 0.5); + lastLevel = MAX2(lastLevel, tObj->BaseLevel); + lastLevel = MIN2(lastLevel, tObj->BaseLevel + baseImage->MaxLog2); + lastLevel = MIN2(lastLevel, tObj->MaxLevel); + lastLevel = MAX2(firstLevel, lastLevel); /* need at least one level */ + } else { + /* Min/max LOD are taken into account in sampler state. We don't + * want to re-layout textures just because clamping has been applied + * since it means a bunch of blitting around and probably no memory + * savings (since we have to keep the other levels around anyway). + */ + firstLevel = tObj->BaseLevel; + lastLevel = MIN2(tObj->BaseLevel + baseImage->MaxLog2, + tObj->MaxLevel); + /* need at least one level */ + lastLevel = MAX2(firstLevel, lastLevel); + } } break; case GL_TEXTURE_RECTANGLE_NV: @@ -135,7 +137,7 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit) /* What levels must the tree include at a minimum? */ - intel_calculate_first_last_level(intelObj); + intel_calculate_first_last_level(intel, intelObj); firstImage = intel_texture_image(intelObj->base.Image[0][intelObj->firstLevel]); -- cgit v1.2.3 From c6164ff155189007c02aabb31549f5f4dc767d1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Fonseca?= Date: Thu, 29 Oct 2009 20:03:51 +0000 Subject: mesa: Add MESA_FORMAT_Z24_X8. --- src/mesa/main/formats.c | 14 +++++++++++++ src/mesa/main/formats.h | 1 + src/mesa/main/texfetch.c | 7 +++++++ src/mesa/main/texstore.c | 41 +++++++++++++++++++++++++++++++++++++- src/mesa/state_tracker/st_format.c | 2 ++ 5 files changed, 64 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index 72d043c4c3..aed313445f 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -330,6 +330,15 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 0, 0, 0, 24, 0, /* Lum/Int/Index/Depth/StencilBits */ 1, 1, 4 /* BlockWidth/Height,Bytes */ }, + { + MESA_FORMAT_Z24_X8, /* Name */ + "MESA_FORMAT_Z24_X8", /* StrName */ + GL_DEPTH_COMPONENT, /* BaseFormat */ + GL_UNSIGNED_INT, /* DataType */ + 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 24, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, { MESA_FORMAT_Z32, /* Name */ "MESA_FORMAT_Z32", /* StrName */ @@ -1004,6 +1013,11 @@ _mesa_format_to_type_and_comps(gl_format format, *comps = 1; return; + case MESA_FORMAT_Z24_X8: + *datatype = GL_UNSIGNED_INT; + *comps = 1; + return; + case MESA_FORMAT_Z32: *datatype = GL_UNSIGNED_INT; *comps = 1; diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index 91ea023077..fa6359f5c8 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -77,6 +77,7 @@ typedef enum MESA_FORMAT_S8_Z24, /* SSSS SSSS ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */ MESA_FORMAT_Z16, /* ZZZZ ZZZZ ZZZZ ZZZZ */ MESA_FORMAT_X8_Z24, /* xxxx xxxx ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */ + MESA_FORMAT_Z24_X8, /* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ xxxx xxxx */ MESA_FORMAT_Z32, /* ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ ZZZZ */ MESA_FORMAT_S8, /* SSSS SSSS */ /*@}*/ diff --git a/src/mesa/main/texfetch.c b/src/mesa/main/texfetch.c index e6e28aef19..314ccb7b65 100644 --- a/src/mesa/main/texfetch.c +++ b/src/mesa/main/texfetch.c @@ -529,6 +529,13 @@ texfetch_funcs[MESA_FORMAT_COUNT] = fetch_texel_3d_f_s8_z24, store_texel_s8_z24 }, + { + MESA_FORMAT_Z24_X8, + fetch_texel_1d_f_z24_s8, + fetch_texel_2d_f_z24_s8, + fetch_texel_3d_f_z24_s8, + store_texel_z24_s8 + }, { MESA_FORMAT_Z32, fetch_texel_1d_f_z32, diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 6237511e9f..14cad6b32f 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -1077,6 +1077,44 @@ _mesa_texstore_x8_z24(TEXSTORE_PARAMS) } +/** + * Store a 24-bit integer depth component texture image. + */ +static GLboolean +_mesa_texstore_z24_x8(TEXSTORE_PARAMS) +{ + const GLuint depthScale = 0xffffff; + const GLuint texelBytes = 4; + + (void) dims; + ASSERT(dstFormat == MESA_FORMAT_Z24_X8); + + { + /* general path */ + GLint img, row; + for (img = 0; img < srcDepth; img++) { + GLubyte *dstRow = (GLubyte *) dstAddr + + dstImageOffsets[dstZoffset + img] * texelBytes + + dstYoffset * dstRowStride + + dstXoffset * texelBytes; + for (row = 0; row < srcHeight; row++) { + const GLvoid *src = _mesa_image_address(dims, srcPacking, + srcAddr, srcWidth, srcHeight, srcFormat, srcType, img, row, 0); + GLuint *dst = (GLuint *) dstRow; + GLint i; + _mesa_unpack_depth_span(ctx, srcWidth, + GL_UNSIGNED_INT, dst, + depthScale, srcType, src, srcPacking); + for (i = 0; i < srcWidth; i++) + dst[i] <<= 8; + dstRow += dstRowStride; + } + } + } + return GL_TRUE; +} + + /** * Store a 16-bit integer depth component texture image. */ @@ -3012,7 +3050,7 @@ _mesa_texstore_sla8(TEXSTORE_PARAMS) * Table mapping MESA_FORMAT_8 to _mesa_texstore_*() * XXX this is somewhat temporary. */ -static struct { +const static struct { gl_format Name; StoreTexImageFunc Store; } @@ -3046,6 +3084,7 @@ texstore_funcs[MESA_FORMAT_COUNT] = { MESA_FORMAT_S8_Z24, _mesa_texstore_s8_z24 }, { MESA_FORMAT_Z16, _mesa_texstore_z16 }, { MESA_FORMAT_X8_Z24, _mesa_texstore_x8_z24 }, + { MESA_FORMAT_Z24_X8, _mesa_texstore_z24_x8 }, { MESA_FORMAT_Z32, _mesa_texstore_z32 }, { MESA_FORMAT_S8, NULL/*_mesa_texstore_s8*/ }, { MESA_FORMAT_SRGB8, _mesa_texstore_srgb8 }, diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index bb57adbf32..02f80057c2 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -309,6 +309,8 @@ st_pipe_format_to_mesa_format(enum pipe_format pipeFormat) return MESA_FORMAT_Z16; case PIPE_FORMAT_Z32_UNORM: return MESA_FORMAT_Z32; + case PIPE_FORMAT_Z24X8_UNORM: + return MESA_FORMAT_Z24_X8; case PIPE_FORMAT_Z24S8_UNORM: return MESA_FORMAT_Z24_S8; case PIPE_FORMAT_X8Z24_UNORM: -- cgit v1.2.3 From a0959bcee5df4272db40a56c468f8c7cc299d5ef Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Oct 2009 14:16:18 -0600 Subject: i965: minor code reformatting --- src/mesa/drivers/dri/i965/brw_wm_fp.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c index 4e3edfbbff..4ef437e2fa 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_fp.c +++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c @@ -971,13 +971,12 @@ static void emit_fb_write( struct brw_wm_compile *c ) if (brw->state.nr_color_regions > 1) { for (i = 0 ; i < brw->state.nr_color_regions; i++) { outcolor = src_reg(PROGRAM_OUTPUT, FRAG_RESULT_DATA0 + i); - last_inst = inst = emit_op(c, - WM_FB_WRITE, dst_mask(dst_undef(),0), 0, - outcolor, payload_r0_depth, outdepth); + last_inst = inst = emit_op(c, WM_FB_WRITE, dst_mask(dst_undef(), 0), + 0, outcolor, payload_r0_depth, outdepth); inst->Aux = (i<<1); if (c->fp_fragcolor_emitted) { outcolor = src_reg(PROGRAM_OUTPUT, FRAG_RESULT_COLOR); - last_inst = inst = emit_op(c, WM_FB_WRITE, dst_mask(dst_undef(),0), + last_inst = inst = emit_op(c, WM_FB_WRITE, dst_mask(dst_undef(), 0), 0, outcolor, payload_r0_depth, outdepth); inst->Aux = (i<<1); } -- cgit v1.2.3 From a8d233e509a2c1aada7cd4e83b126ba06cb90565 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Oct 2009 14:29:55 -0600 Subject: i965: use macros to get/set prog_instruction::Aux field This makes things a bit easier to remember/understand. --- src/mesa/drivers/dri/i965/brw_wm.h | 6 ++++++ src/mesa/drivers/dri/i965/brw_wm_fp.c | 8 ++++---- src/mesa/drivers/dri/i965/brw_wm_glsl.c | 4 ++-- src/mesa/drivers/dri/i965/brw_wm_pass0.c | 4 ++-- 4 files changed, 14 insertions(+), 8 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index 872b1f3ecf..f13a958a44 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -271,6 +271,12 @@ struct brw_wm_compile { }; +/** Bits for prog_instruction::Aux field */ +#define INST_AUX_EOT 0x1 +#define INST_AUX_TARGET(T) (T << 1) +#define INST_AUX_GET_TARGET(AUX) ((AUX) >> 1) + + GLuint brw_wm_nr_args( GLuint opcode ); GLuint brw_wm_is_scalar_result( GLuint opcode ); diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c index 4ef437e2fa..d33fd9abed 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_fp.c +++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c @@ -973,15 +973,15 @@ static void emit_fb_write( struct brw_wm_compile *c ) outcolor = src_reg(PROGRAM_OUTPUT, FRAG_RESULT_DATA0 + i); last_inst = inst = emit_op(c, WM_FB_WRITE, dst_mask(dst_undef(), 0), 0, outcolor, payload_r0_depth, outdepth); - inst->Aux = (i<<1); + inst->Aux = INST_AUX_TARGET(i); if (c->fp_fragcolor_emitted) { outcolor = src_reg(PROGRAM_OUTPUT, FRAG_RESULT_COLOR); last_inst = inst = emit_op(c, WM_FB_WRITE, dst_mask(dst_undef(), 0), 0, outcolor, payload_r0_depth, outdepth); - inst->Aux = (i<<1); + inst->Aux = INST_AUX_TARGET(i); } } - last_inst->Aux |= 1; //eot + last_inst->Aux |= INST_AUX_EOT; } else { /* if gl_FragData[0] is written, use it, else use gl_FragColor */ @@ -992,7 +992,7 @@ static void emit_fb_write( struct brw_wm_compile *c ) inst = emit_op(c, WM_FB_WRITE, dst_mask(dst_undef(),0), 0, outcolor, payload_r0_depth, outdepth); - inst->Aux = 1|(0<<1); + inst->Aux = INST_AUX_EOT | INST_AUX_TARGET(0); } } diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index c9fe1dd8ad..28d6d4eba5 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -841,8 +841,8 @@ static void emit_fb_write(struct brw_wm_compile *c, nr += 2; } - target = inst->Aux >> 1; - eot = inst->Aux & 1; + target = INST_AUX_GET_TARGET(inst->Aux); + eot = inst->Aux & INST_AUX_EOT; fire_fb_write(c, 0, nr, target, eot); } diff --git a/src/mesa/drivers/dri/i965/brw_wm_pass0.c b/src/mesa/drivers/dri/i965/brw_wm_pass0.c index 6279258339..602b1351ef 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_pass0.c +++ b/src/mesa/drivers/dri/i965/brw_wm_pass0.c @@ -322,8 +322,8 @@ translate_insn(struct brw_wm_compile *c, out->tex_unit = inst->TexSrcUnit; out->tex_idx = inst->TexSrcTarget; out->tex_shadow = inst->TexShadow; - out->eot = inst->Aux & 1; - out->target = inst->Aux >> 1; + out->eot = inst->Aux & INST_AUX_EOT; + out->target = INST_AUX_GET_TARGET(inst->Aux); /* Args: */ -- cgit v1.2.3 From 9ef33b86855c4d000271774030bd1b19b6d79687 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Oct 2009 14:53:53 -0600 Subject: i965: don't use context state in emit_fb_write() Put the state that we care about in the hash key. Issue spotted by Keith Whitwell. --- src/mesa/drivers/dri/i965/brw_wm.c | 2 ++ src/mesa/drivers/dri/i965/brw_wm.h | 1 + src/mesa/drivers/dri/i965/brw_wm_fp.c | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index 5a2ac1a651..eeb25980fa 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -325,6 +325,8 @@ static void brw_wm_populate_key( struct brw_context *brw, key->drawable_height = brw->intel.driDrawable->h; } + key->nr_color_regions = brw->state.nr_color_regions; + /* CACHE_NEW_VS_PROG */ key->vp_outputs_written = brw->vs.prog_data->outputs_written & DO_SETUP_BITS; diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index f13a958a44..d0f30607d0 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -67,6 +67,7 @@ struct brw_wm_prog_key { GLuint flat_shade:1; GLuint linear_color:1; /**< linear interpolation vs perspective interp */ GLuint runtime_check_aads_emit:1; + GLuint nr_color_regions:2; GLbitfield proj_attrib_mask; /**< one bit per fragment program attribute */ GLuint shadowtex_mask:16; diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c index d33fd9abed..9a0aea872b 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_fp.c +++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c @@ -968,8 +968,8 @@ static void emit_fb_write( struct brw_wm_compile *c ) /* The inst->Aux field is used for FB write target and the EOT marker */ - if (brw->state.nr_color_regions > 1) { - for (i = 0 ; i < brw->state.nr_color_regions; i++) { + if (c->key.nr_color_regions > 1) { + for (i = 0 ; i < c->key.nr_color_regions; i++) { outcolor = src_reg(PROGRAM_OUTPUT, FRAG_RESULT_DATA0 + i); last_inst = inst = emit_op(c, WM_FB_WRITE, dst_mask(dst_undef(), 0), 0, outcolor, payload_r0_depth, outdepth); -- cgit v1.2.3 From 7648c80ac8dd0631c5a0f86ad03347675a48eee6 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Oct 2009 15:00:18 -0600 Subject: i965: remove unused var --- src/mesa/drivers/dri/i965/brw_wm_fp.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c index 9a0aea872b..53fdd06f42 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_fp.c +++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c @@ -964,7 +964,6 @@ static void emit_fb_write( struct brw_wm_compile *c ) GLuint i; struct prog_instruction *inst, *last_inst; - struct brw_context *brw = c->func.brw; /* The inst->Aux field is used for FB write target and the EOT marker */ -- cgit v1.2.3 From 198ec96d364dabd82952a451eeda7937db383f0d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Oct 2009 15:01:02 -0600 Subject: i965: define, use BRW_MAX_DRAW_BUFFERS i965 might support more than 4 color draw buffers. But if not, this protects from breakage if the Mesa limit is raised. --- src/mesa/drivers/dri/i965/brw_context.c | 1 + src/mesa/drivers/dri/i965/brw_context.h | 9 ++++++--- src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index c300c33adc..48685c087b 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -105,6 +105,7 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis, TNL_CONTEXT(ctx)->Driver.RunPipeline = _tnl_run_pipeline; + ctx->Const.MaxDrawBuffers = BRW_MAX_DRAW_BUFFERS; ctx->Const.MaxTextureImageUnits = BRW_MAX_TEX_UNIT; ctx->Const.MaxTextureCoordUnits = 8; /* Mesa limit */ ctx->Const.MaxTextureUnits = MIN2(ctx->Const.MaxTextureCoordUnits, diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index 7834569761..59f9475b5a 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -252,20 +252,23 @@ struct brw_vs_ouput_sizes { /** Number of texture sampler units */ #define BRW_MAX_TEX_UNIT 16 +/** Max number of render targets in a shader */ +#define BRW_MAX_DRAW_BUFFERS 4 + /** * Size of our surface binding table for the WM. * This contains pointers to the drawing surfaces and current texture * objects and shader constant buffers (+2). */ -#define BRW_WM_MAX_SURF (MAX_DRAW_BUFFERS + BRW_MAX_TEX_UNIT + 1) +#define BRW_WM_MAX_SURF (BRW_MAX_DRAW_BUFFERS + BRW_MAX_TEX_UNIT + 1) /** * Helpers to convert drawing buffers, textures and constant buffers * to surface binding table indexes, for WM. */ #define SURF_INDEX_DRAW(d) (d) -#define SURF_INDEX_FRAG_CONST_BUFFER (MAX_DRAW_BUFFERS) -#define SURF_INDEX_TEXTURE(t) (MAX_DRAW_BUFFERS + 1 + (t)) +#define SURF_INDEX_FRAG_CONST_BUFFER (BRW_MAX_DRAW_BUFFERS) +#define SURF_INDEX_TEXTURE(t) (BRW_MAX_DRAW_BUFFERS + 1 + (t)) /** * Size of surface binding table for the VS. diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index 73ae06eea1..3b2c6a25be 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -709,7 +709,7 @@ static void prepare_wm_surfaces(struct brw_context *brw ) } old_nr_surfaces = brw->wm.nr_surfaces; - brw->wm.nr_surfaces = MAX_DRAW_BUFFERS; + brw->wm.nr_surfaces = BRW_MAX_DRAW_BUFFERS; if (brw->wm.surf_bo[SURF_INDEX_FRAG_CONST_BUFFER] != NULL) brw->wm.nr_surfaces = SURF_INDEX_FRAG_CONST_BUFFER + 1; -- cgit v1.2.3 From 861fec163c1ae7e431956db0a08989d841e2b74e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Oct 2009 15:29:41 -0600 Subject: i965: avoid shader translation on window resize If the fragment shader doesn't use FRAG_ATTRIB_WPOS (gl_FragCoord) we don't need to worry about the window size and origin in brw_wm_populate_key(). This avoids re-generating the i965 shader code when a window is resized. Issue spotted by Keith Whitwell. --- src/mesa/drivers/dri/i965/brw_wm.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index eeb25980fa..964ee104c2 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -308,6 +308,9 @@ static void brw_wm_populate_key( struct brw_context *brw, * from the incoming screen origin relative position we get as part of our * payload. * + * This is only needed for the WM_WPOSXY opcode when the fragment program + * uses the gl_FragCoord input. + * * We could avoid recompiling by including this as a constant referenced by * our program, but if we were to do that it would also be nice to handle * getting that constant updated at batchbuffer submit time (when we @@ -316,13 +319,15 @@ static void brw_wm_populate_key( struct brw_context *brw, * just avoid using this as key data if the program doesn't use * fragment.position. * - * This pretty much becomes moot with DRI2 and redirected buffers anyway, - * as our origins will always be zero then. + * For DRI2 the origin_x/y will always be (0,0) but we still need the + * drawable height in order to invert the Y axis. */ - if (brw->intel.driDrawable != NULL) { - key->origin_x = brw->intel.driDrawable->x; - key->origin_y = brw->intel.driDrawable->y; - key->drawable_height = brw->intel.driDrawable->h; + if (fp->program.Base.InputsRead & FRAG_BIT_WPOS) { + if (brw->intel.driDrawable != NULL) { + key->origin_x = brw->intel.driDrawable->x; + key->origin_y = brw->intel.driDrawable->y; + key->drawable_height = brw->intel.driDrawable->h; + } } key->nr_color_regions = brw->state.nr_color_regions; -- cgit v1.2.3 From 4b377ae292f75645ef356bd3bfac407230faf73a Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 29 Oct 2009 13:35:03 -0700 Subject: i915: Correct and make use of the defines for 32-bit depth texture modes. Previously, S8_Z24 depth textures would always be treated as intensity. Fixes piglit depth-tex-modes. --- src/mesa/drivers/dri/i915/i915_reg.h | 6 +++--- src/mesa/drivers/dri/i915/i915_texstate.c | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i915_reg.h b/src/mesa/drivers/dri/i915/i915_reg.h index b5fa7fddb9..7f31ff674f 100644 --- a/src/mesa/drivers/dri/i915/i915_reg.h +++ b/src/mesa/drivers/dri/i915/i915_reg.h @@ -626,9 +626,9 @@ #define MT_32BIT_AWVU2101010 (0xA<<3) #define MT_32BIT_GR1616 (0xB<<3) #define MT_32BIT_VU1616 (0xC<<3) -#define MT_32BIT_xI824 (0xD<<3) -#define MT_32BIT_xA824 (0xE<<3) -#define MT_32BIT_xL824 (0xF<<3) +#define MT_32BIT_x8I24 (0xD<<3) +#define MT_32BIT_x8L24 (0xE<<3) +#define MT_32BIT_x8A24 (0xF<<3) #define MT_422_YCRCB_SWAPY (0<<3) /* SURFACE_422 */ #define MT_422_YCRCB_NORMAL (1<<3) #define MT_422_YCRCB_SWAPUV (2<<3) diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index 1397f04a59..0c29c558ec 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -82,7 +82,12 @@ translate_texture_format(gl_format mesa_format, GLuint internal_format, case MESA_FORMAT_RGBA_DXT5: return (MAPSURF_COMPRESSED | MT_COMPRESS_DXT4_5); case MESA_FORMAT_S8_Z24: - return (MAPSURF_32BIT | MT_32BIT_xI824); + if (DepthMode == GL_ALPHA) + return (MAPSURF_32BIT | MT_32BIT_x8A24); + else if (DepthMode == GL_INTENSITY) + return (MAPSURF_32BIT | MT_32BIT_x8I24); + else + return (MAPSURF_32BIT | MT_32BIT_x8L24); default: fprintf(stderr, "%s: bad image format %x\n", __FUNCTION__, mesa_format); abort(); -- cgit v1.2.3 From 8a9afe71b8d89a2a967cb37f5b5b00d86de387bc Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 29 Oct 2009 14:38:44 -0700 Subject: i915: Fix 1D texture mapping in the t coordinate. Fixes piglit tex1d-2dborder test. --- src/mesa/drivers/dri/i915/i915_texstate.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index 0c29c558ec..bea47f5af8 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -305,6 +305,12 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) GLenum wt = tObj->WrapT; GLenum wr = tObj->WrapR; + /* We program 1D textures as 2D textures, so the 2D texcoord could + * result in sampling border values if we don't set the T wrap to + * repeat. + */ + if (tObj->Target == GL_TEXTURE_1D) + wt = GL_REPEAT; /* 3D textures don't seem to respect the border color. * Fallback if there's ever a danger that they might refer to -- cgit v1.2.3 From 035b21f365f563cba9bf9b8cb4fef613ceb9d3ac Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Oct 2009 15:57:22 -0600 Subject: i965: make brw_wm_prog_key a little smaller GLushort is big enough for the swizzle and origin fields. The key could probably be made smaller still by re-ordering things. I'll hold off on that until after the outputswritten64 branch is merged. The key will get a little larger again with the GLbitfield64 fields. --- src/mesa/drivers/dri/i965/brw_wm.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index d0f30607d0..dd4644fc36 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -74,11 +74,11 @@ struct brw_wm_prog_key { GLuint yuvtex_mask:16; GLuint yuvtex_swap_mask:16; /* UV swaped */ - GLuint tex_swizzles[BRW_MAX_TEX_UNIT]; + GLushort tex_swizzles[BRW_MAX_TEX_UNIT]; GLuint program_string_id:32; - GLuint origin_x, origin_y; - GLuint drawable_height; + GLushort origin_x, origin_y; + GLushort drawable_height; GLuint vp_outputs_written; }; -- cgit v1.2.3 From 26d22b094bb7b2f37d4bc8edfeb1b2a9a1c96d88 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Oct 2009 16:02:35 -0600 Subject: i965: make brw_sf_prog_key::sprite_origin_lower_left one bit Shrinks size of key to 8 bytes from 12. Note that progs/demos/spriteblast.c is still broken. --- src/mesa/drivers/dri/i965/brw_sf.c | 2 +- src/mesa/drivers/dri/i965/brw_sf.h | 4 ++-- src/mesa/drivers/dri/i965/brw_sf_emit.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_sf.c b/src/mesa/drivers/dri/i965/brw_sf.c index e1c2c7777b..f350cbd74e 100644 --- a/src/mesa/drivers/dri/i965/brw_sf.c +++ b/src/mesa/drivers/dri/i965/brw_sf.c @@ -161,7 +161,7 @@ static void upload_sf_prog(struct brw_context *brw) } key.do_point_sprite = ctx->Point.PointSprite; - key.SpriteOrigin = ctx->Point.SpriteOrigin; + key.sprite_origin_lower_left = (ctx->Point.SpriteOrigin == GL_LOWER_LEFT); /* _NEW_LIGHT */ key.do_flat_shading = (ctx->Light.ShadeModel == GL_FLAT); key.do_twoside_color = (ctx->Light.Enabled && ctx->Light.Model.TwoSide); diff --git a/src/mesa/drivers/dri/i965/brw_sf.h b/src/mesa/drivers/dri/i965/brw_sf.h index 6426b6df9f..e415bbd775 100644 --- a/src/mesa/drivers/dri/i965/brw_sf.h +++ b/src/mesa/drivers/dri/i965/brw_sf.h @@ -52,8 +52,8 @@ struct brw_sf_prog_key { GLuint frontface_ccw:1; GLuint do_point_sprite:1; GLuint linear_color:1; /**< linear interp vs. perspective interp */ - GLuint pad:25; - GLenum SpriteOrigin; + GLuint sprite_origin_lower_left:1; + GLuint pad:24; }; struct brw_sf_point_tex { diff --git a/src/mesa/drivers/dri/i965/brw_sf_emit.c b/src/mesa/drivers/dri/i965/brw_sf_emit.c index ca8f97f9f9..561fcd501b 100644 --- a/src/mesa/drivers/dri/i965/brw_sf_emit.c +++ b/src/mesa/drivers/dri/i965/brw_sf_emit.c @@ -551,7 +551,7 @@ void brw_emit_point_sprite_setup( struct brw_sf_compile *c, GLboolean allocate) BRW_MATH_DATA_SCALAR, BRW_MATH_PRECISION_FULL); - if (c->key.SpriteOrigin == GL_LOWER_LEFT) { + if (c->key.sprite_origin_lower_left) { brw_MUL(p, c->m1Cx, c->tmp, c->inv_w[0]); brw_MOV(p, vec1(suboffset(c->m1Cx, 1)), brw_imm_f(0.0)); brw_MUL(p, c->m2Cy, c->tmp, negate(c->inv_w[0])); @@ -570,7 +570,7 @@ void brw_emit_point_sprite_setup( struct brw_sf_compile *c, GLboolean allocate) { brw_set_predicate_control_flag_value(p, pc); if (tex->CoordReplace) { - if (c->key.SpriteOrigin == GL_LOWER_LEFT) { + if (c->key.sprite_origin_lower_left) { brw_MUL(p, c->m3C0, c->inv_w[0], brw_imm_f(1.0)); brw_MOV(p, vec1(suboffset(c->m3C0, 0)), brw_imm_f(0.0)); } -- cgit v1.2.3 From 217a40d8d92d377e73ed1ab5a326703fab779dd1 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Oct 2009 16:06:30 -0600 Subject: i965: indentation fix --- src/mesa/drivers/dri/i965/brw_sf.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_sf.h b/src/mesa/drivers/dri/i965/brw_sf.h index e415bbd775..e835229a1d 100644 --- a/src/mesa/drivers/dri/i965/brw_sf.h +++ b/src/mesa/drivers/dri/i965/brw_sf.h @@ -57,7 +57,7 @@ struct brw_sf_prog_key { }; struct brw_sf_point_tex { - GLboolean CoordReplace; + GLboolean CoordReplace; }; struct brw_sf_compile { -- cgit v1.2.3 From bde7874317bfbab284397bc611fc71263cbc0975 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Oct 2009 16:26:09 -0600 Subject: mesa: refactor _mesa_get_teximage() code Break different formats into different functions to make it easier to read. --- src/mesa/main/texgetimage.c | 460 +++++++++++++++++++++++++++++--------------- 1 file changed, 302 insertions(+), 158 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index fbd61d5ae6..3dff86feb1 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -85,9 +85,279 @@ type_with_negative_values(GLenum type) } +/** + * glGetTexImage for color index pixels. + */ +static void +get_tex_color_index(GLcontext *ctx, GLuint dimensions, + GLenum format, GLenum type, GLvoid *pixels, + const struct gl_texture_image *texImage) +{ + const GLint width = texImage->Width; + const GLint height = texImage->Height; + const GLint depth = texImage->Depth; + const GLuint indexBits = + _mesa_get_format_bits(texImage->TexFormat, GL_TEXTURE_INDEX_SIZE_EXT); + const GLbitfield transferOps = 0x0; + GLint img, row, col; + + for (img = 0; img < depth; img++) { + for (row = 0; row < height; row++) { + GLuint indexRow[MAX_WIDTH]; + void *dest = _mesa_image_address(dimensions, &ctx->Pack, pixels, + width, height, format, type, + img, row, 0); + assert(dest); + + if (indexBits == 8) { + const GLubyte *src = (const GLubyte *) texImage->Data; + src += width * (img * texImage->Height + row); + for (col = 0; col < width; col++) { + indexRow[col] = src[col]; + } + } + else if (indexBits == 16) { + const GLushort *src = (const GLushort *) texImage->Data; + src += width * (img * texImage->Height + row); + for (col = 0; col < width; col++) { + indexRow[col] = src[col]; + } + } + else { + _mesa_problem(ctx, "Color index problem in _mesa_GetTexImage"); + } + _mesa_pack_index_span(ctx, width, type, dest, + indexRow, &ctx->Pack, transferOps); + } + } +} + + +/** + * glGetTexImage for depth/Z pixels. + */ +static void +get_tex_depth(GLcontext *ctx, GLuint dimensions, + GLenum format, GLenum type, GLvoid *pixels, + const struct gl_texture_image *texImage) +{ + const GLint width = texImage->Width; + const GLint height = texImage->Height; + const GLint depth = texImage->Depth; + GLint img, row, col; + + for (img = 0; img < depth; img++) { + for (row = 0; row < height; row++) { + GLfloat depthRow[MAX_WIDTH]; + void *dest = _mesa_image_address(dimensions, &ctx->Pack, pixels, + width, height, format, type, + img, row, 0); + assert(dest); + + for (col = 0; col < width; col++) { + texImage->FetchTexelf(texImage, col, row, img, depthRow + col); + } + _mesa_pack_depth_span(ctx, width, dest, type, depthRow, &ctx->Pack); + } + } +} + + +/** + * glGetTexImage for depth/stencil pixels. + */ +static void +get_tex_depth_stencil(GLcontext *ctx, GLuint dimensions, + GLenum format, GLenum type, GLvoid *pixels, + const struct gl_texture_image *texImage) +{ + const GLint width = texImage->Width; + const GLint height = texImage->Height; + const GLint depth = texImage->Depth; + const GLuint *src = (const GLuint *) texImage->Data; + GLint img, row; + + for (img = 0; img < depth; img++) { + for (row = 0; row < height; row++) { + void *dest = _mesa_image_address(dimensions, &ctx->Pack, pixels, + width, height, format, type, + img, row, 0); + _mesa_memcpy(dest, src, width * sizeof(GLuint)); + if (ctx->Pack.SwapBytes) { + _mesa_swap4((GLuint *) dest, width); + } + + src += width * row + width * height * img; + } + } +} + + +/** + * glGetTexImage for YCbCr pixels. + */ +static void +get_tex_ycbcr(GLcontext *ctx, GLuint dimensions, + GLenum format, GLenum type, GLvoid *pixels, + const struct gl_texture_image *texImage) +{ + const GLint width = texImage->Width; + const GLint height = texImage->Height; + const GLint depth = texImage->Depth; + const GLint rowstride = texImage->RowStride; + const GLushort *src = (const GLushort *) texImage->Data; + GLint img, row; + + for (img = 0; img < depth; img++) { + for (row = 0; row < height; row++) { + void *dest = _mesa_image_address(dimensions, &ctx->Pack, pixels, + width, height, format, type, + img, row, 0); + _mesa_memcpy(dest, src, width * sizeof(GLushort)); + + /* check for byte swapping */ + if ((texImage->TexFormat == MESA_FORMAT_YCBCR + && type == GL_UNSIGNED_SHORT_8_8_REV_MESA) || + (texImage->TexFormat == MESA_FORMAT_YCBCR_REV + && type == GL_UNSIGNED_SHORT_8_8_MESA)) { + if (!ctx->Pack.SwapBytes) + _mesa_swap2((GLushort *) dest, width); + } + else if (ctx->Pack.SwapBytes) { + _mesa_swap2((GLushort *) dest, width); + } + + src += rowstride; + } + } +} + + +/** + * glGetTexImagefor sRGB pixels; + */ +static void +get_tex_srgb(GLcontext *ctx, GLuint dimensions, + GLenum format, GLenum type, GLvoid *pixels, + const struct gl_texture_image *texImage) +{ + const GLint width = texImage->Width; + const GLint height = texImage->Height; + const GLint depth = texImage->Depth; + const GLbitfield transferOps = 0x0; + GLint img, row; + + for (img = 0; img < depth; img++) { + for (row = 0; row < height; row++) { + void *dest = _mesa_image_address(dimensions, &ctx->Pack, pixels, + width, height, format, type, + img, row, 0); + + GLfloat rgba[MAX_WIDTH][4]; + GLint col; + + /* convert row to RGBA format */ + for (col = 0; col < width; col++) { + texImage->FetchTexelf(texImage, col, row, img, rgba[col]); + if (texImage->_BaseFormat == GL_LUMINANCE) { + rgba[col][RCOMP] = linear_to_nonlinear(rgba[col][RCOMP]); + rgba[col][GCOMP] = 0.0; + rgba[col][BCOMP] = 0.0; + } + else if (texImage->_BaseFormat == GL_LUMINANCE_ALPHA) { + rgba[col][RCOMP] = linear_to_nonlinear(rgba[col][RCOMP]); + rgba[col][GCOMP] = 0.0; + rgba[col][BCOMP] = 0.0; + } + else if (texImage->_BaseFormat == GL_RGB || + texImage->_BaseFormat == GL_RGBA) { + rgba[col][RCOMP] = linear_to_nonlinear(rgba[col][RCOMP]); + rgba[col][GCOMP] = linear_to_nonlinear(rgba[col][GCOMP]); + rgba[col][BCOMP] = linear_to_nonlinear(rgba[col][BCOMP]); + } + } + _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) rgba, + format, type, dest, + &ctx->Pack, transferOps); + } + } +} + + +/** + * glGetTexImagefor RGBA, Luminance, etc. pixels. + * This is the slow way since we use texture sampling. + */ +static void +get_tex_rgba(GLcontext *ctx, GLuint dimensions, + GLenum format, GLenum type, GLvoid *pixels, + const struct gl_texture_image *texImage) +{ + const GLint width = texImage->Width; + const GLint height = texImage->Height; + const GLint depth = texImage->Depth; + /* Normally, no pixel transfer ops are performed during glGetTexImage. + * The only possible exception is component clamping to [0,1]. + */ + GLbitfield transferOps = 0x0; + GLint img, row; + + for (img = 0; img < depth; img++) { + for (row = 0; row < height; row++) { + void *dest = _mesa_image_address(dimensions, &ctx->Pack, pixels, + width, height, format, type, + img, row, 0); + GLfloat rgba[MAX_WIDTH][4]; + GLint col; + GLenum dataType = _mesa_get_format_datatype(texImage->TexFormat); + + /* clamp does not apply to GetTexImage (final conversion)? + * Looks like we need clamp though when going from format + * containing negative values to unsigned format. + */ + if (format == GL_LUMINANCE || format == GL_LUMINANCE_ALPHA) { + transferOps |= IMAGE_CLAMP_BIT; + } + else if (!type_with_negative_values(type) && + (dataType == GL_FLOAT || + dataType == GL_SIGNED_NORMALIZED)) { + transferOps |= IMAGE_CLAMP_BIT; + } + + for (col = 0; col < width; col++) { + texImage->FetchTexelf(texImage, col, row, img, rgba[col]); + if (texImage->_BaseFormat == GL_ALPHA) { + rgba[col][RCOMP] = 0.0F; + rgba[col][GCOMP] = 0.0F; + rgba[col][BCOMP] = 0.0F; + } + else if (texImage->_BaseFormat == GL_LUMINANCE) { + rgba[col][GCOMP] = 0.0F; + rgba[col][BCOMP] = 0.0F; + rgba[col][ACOMP] = 1.0F; + } + else if (texImage->_BaseFormat == GL_LUMINANCE_ALPHA) { + rgba[col][GCOMP] = 0.0F; + rgba[col][BCOMP] = 0.0F; + } + else if (texImage->_BaseFormat == GL_INTENSITY) { + rgba[col][GCOMP] = 0.0F; + rgba[col][BCOMP] = 0.0F; + rgba[col][ACOMP] = 1.0F; + } + } + _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) rgba, + format, type, dest, + &ctx->Pack, transferOps); + } + } +} + + /** * This is the software fallback for Driver.GetTexImage(). * All error checking will have been done before this routine is called. + * The texture image must be mapped. */ void _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, @@ -95,7 +365,21 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_object *texObj, struct gl_texture_image *texImage) { - const GLuint dimensions = (target == GL_TEXTURE_3D) ? 3 : 2; + GLuint dimensions; + + /* If we get here, the texture image should be mapped */ + assert(texImage->Data); + + switch (target) { + case GL_TEXTURE_1D: + dimensions = 1; + break; + case GL_TEXTURE_3D: + dimensions = 3; + break; + default: + dimensions = 2; + } if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { /* Packing texture image into a PBO. @@ -118,163 +402,23 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, pixels = ADD_POINTERS(buf, pixels); } - { - const GLint width = texImage->Width; - const GLint height = texImage->Height; - const GLint depth = texImage->Depth; - GLint img, row; - for (img = 0; img < depth; img++) { - for (row = 0; row < height; row++) { - /* compute destination address in client memory */ - GLvoid *dest = _mesa_image_address( dimensions, &ctx->Pack, pixels, - width, height, format, type, - img, row, 0); - assert(dest); - - if (format == GL_COLOR_INDEX) { - GLuint indexRow[MAX_WIDTH]; - GLint col; - GLuint indexBits = _mesa_get_format_bits(texImage->TexFormat, GL_TEXTURE_INDEX_SIZE_EXT); - /* Can't use FetchTexel here because that returns RGBA */ - if (indexBits == 8) { - const GLubyte *src = (const GLubyte *) texImage->Data; - src += width * (img * texImage->Height + row); - for (col = 0; col < width; col++) { - indexRow[col] = src[col]; - } - } - else if (indexBits == 16) { - const GLushort *src = (const GLushort *) texImage->Data; - src += width * (img * texImage->Height + row); - for (col = 0; col < width; col++) { - indexRow[col] = src[col]; - } - } - else { - _mesa_problem(ctx, - "Color index problem in _mesa_GetTexImage"); - } - _mesa_pack_index_span(ctx, width, type, dest, - indexRow, &ctx->Pack, - 0 /* no image transfer */); - } - else if (format == GL_DEPTH_COMPONENT) { - GLfloat depthRow[MAX_WIDTH]; - GLint col; - for (col = 0; col < width; col++) { - (*texImage->FetchTexelf)(texImage, col, row, img, - depthRow + col); - } - _mesa_pack_depth_span(ctx, width, dest, type, - depthRow, &ctx->Pack); - } - else if (format == GL_DEPTH_STENCIL_EXT) { - /* XXX Note: we're bypassing texImage->FetchTexel()! */ - const GLuint *src = (const GLuint *) texImage->Data; - src += width * row + width * height * img; - _mesa_memcpy(dest, src, width * sizeof(GLuint)); - if (ctx->Pack.SwapBytes) { - _mesa_swap4((GLuint *) dest, width); - } - } - else if (format == GL_YCBCR_MESA) { - /* No pixel transfer */ - const GLint rowstride = texImage->RowStride; - MEMCPY(dest, - (const GLushort *) texImage->Data + row * rowstride, - width * sizeof(GLushort)); - /* check for byte swapping */ - if ((texImage->TexFormat == MESA_FORMAT_YCBCR - && type == GL_UNSIGNED_SHORT_8_8_REV_MESA) || - (texImage->TexFormat == MESA_FORMAT_YCBCR_REV - && type == GL_UNSIGNED_SHORT_8_8_MESA)) { - if (!ctx->Pack.SwapBytes) - _mesa_swap2((GLushort *) dest, width); - } - else if (ctx->Pack.SwapBytes) { - _mesa_swap2((GLushort *) dest, width); - } - } -#if FEATURE_EXT_texture_sRGB - else if (_mesa_get_format_color_encoding(texImage->TexFormat) - == GL_SRGB) { - /* special case this since need to backconvert values */ - /* convert row to RGBA format */ - GLfloat rgba[MAX_WIDTH][4]; - GLint col; - GLbitfield transferOps = 0x0; - - for (col = 0; col < width; col++) { - (*texImage->FetchTexelf)(texImage, col, row, img, rgba[col]); - if (texImage->_BaseFormat == GL_LUMINANCE) { - rgba[col][RCOMP] = linear_to_nonlinear(rgba[col][RCOMP]); - rgba[col][GCOMP] = 0.0; - rgba[col][BCOMP] = 0.0; - } - else if (texImage->_BaseFormat == GL_LUMINANCE_ALPHA) { - rgba[col][RCOMP] = linear_to_nonlinear(rgba[col][RCOMP]); - rgba[col][GCOMP] = 0.0; - rgba[col][BCOMP] = 0.0; - } - else if (texImage->_BaseFormat == GL_RGB || - texImage->_BaseFormat == GL_RGBA) { - rgba[col][RCOMP] = linear_to_nonlinear(rgba[col][RCOMP]); - rgba[col][GCOMP] = linear_to_nonlinear(rgba[col][GCOMP]); - rgba[col][BCOMP] = linear_to_nonlinear(rgba[col][BCOMP]); - } - } - _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) rgba, - format, type, dest, - &ctx->Pack, transferOps); - } -#endif /* FEATURE_EXT_texture_sRGB */ - else { - /* general case: convert row to RGBA format */ - GLfloat rgba[MAX_WIDTH][4]; - GLint col; - GLbitfield transferOps = 0x0; - GLenum dataType = - _mesa_get_format_datatype(texImage->TexFormat); - - /* clamp does not apply to GetTexImage (final conversion)? - * Looks like we need clamp though when going from format - * containing negative values to unsigned format. - */ - if (format == GL_LUMINANCE || format == GL_LUMINANCE_ALPHA) - transferOps |= IMAGE_CLAMP_BIT; - else if (!type_with_negative_values(type) && - (dataType == GL_FLOAT || - dataType == GL_SIGNED_NORMALIZED)) - transferOps |= IMAGE_CLAMP_BIT; - - for (col = 0; col < width; col++) { - (*texImage->FetchTexelf)(texImage, col, row, img, rgba[col]); - if (texImage->_BaseFormat == GL_ALPHA) { - rgba[col][RCOMP] = 0.0; - rgba[col][GCOMP] = 0.0; - rgba[col][BCOMP] = 0.0; - } - else if (texImage->_BaseFormat == GL_LUMINANCE) { - rgba[col][GCOMP] = 0.0; - rgba[col][BCOMP] = 0.0; - rgba[col][ACOMP] = 1.0; - } - else if (texImage->_BaseFormat == GL_LUMINANCE_ALPHA) { - rgba[col][GCOMP] = 0.0; - rgba[col][BCOMP] = 0.0; - } - else if (texImage->_BaseFormat == GL_INTENSITY) { - rgba[col][GCOMP] = 0.0; - rgba[col][BCOMP] = 0.0; - rgba[col][ACOMP] = 1.0; - } - } - _mesa_pack_rgba_span_float(ctx, width, (GLfloat (*)[4]) rgba, - format, type, dest, - &ctx->Pack, transferOps); - } /* format */ - } /* row */ - } /* img */ + if (format == GL_COLOR_INDEX) { + get_tex_color_index(ctx, dimensions, format, type, pixels, texImage); + } + else if (format == GL_DEPTH_COMPONENT) { + get_tex_depth(ctx, dimensions, format, type, pixels, texImage); + } + else if (format == GL_DEPTH_STENCIL_EXT) { + get_tex_depth_stencil(ctx, dimensions, format, type, pixels, texImage); + } + else if (format == GL_YCBCR_MESA) { + get_tex_ycbcr(ctx, dimensions, format, type, pixels, texImage); + } + else if (_mesa_get_format_color_encoding(texImage->TexFormat) == GL_SRGB) { + get_tex_srgb(ctx, dimensions, format, type, pixels, texImage); + } + else { + get_tex_rgba(ctx, dimensions, format, type, pixels, texImage); } if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { -- cgit v1.2.3 From fcbf66364032743abeb41a82a5ceaf68a15d900f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Oct 2009 16:29:31 -0600 Subject: mesa: lift memcpy_get_tex_image() code from intel driver into core Mesa The code should work for any driver. --- src/mesa/main/texgetimage.c | 84 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 83 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index 3dff86feb1..10c6947c37 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -354,6 +354,85 @@ get_tex_rgba(GLcontext *ctx, GLuint dimensions, } +/** + * Try to do glGetTexImage() with simple memcpy(). + * \return GL_TRUE if done, GL_FALSE otherwise + */ +static GLboolean +get_tex_memcpy(GLcontext *ctx, GLenum format, GLenum type, GLvoid *pixels, + const struct gl_texture_object *texObj, + const struct gl_texture_image *texImage) +{ + GLboolean memCopy = GL_FALSE; + + /* Texture image should have been mapped already */ + assert(texImage->Data); + + /* + * Check if the src/dst formats are compatible. + * Also note that GL's pixel transfer ops don't apply to glGetTexImage() + * so we don't have to worry about those. + * XXX more format combinations could be supported here. + */ + if ((texObj->Target == GL_TEXTURE_1D || + texObj->Target == GL_TEXTURE_2D || + texObj->Target == GL_TEXTURE_RECTANGLE || + (texObj->Target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X && + texObj->Target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z))) { + if (texImage->TexFormat == MESA_FORMAT_ARGB8888 && + format == GL_BGRA && + type == GL_UNSIGNED_BYTE && + !ctx->Pack.SwapBytes && + _mesa_little_endian()) { + memCopy = GL_TRUE; + } + else if (texImage->TexFormat == MESA_FORMAT_AL88 && + format == GL_LUMINANCE_ALPHA && + type == GL_UNSIGNED_BYTE && + !ctx->Pack.SwapBytes && + _mesa_little_endian()) { + memCopy = GL_TRUE; + } + else if (texImage->TexFormat == MESA_FORMAT_L8 && + format == GL_LUMINANCE && + type == GL_UNSIGNED_BYTE) { + memCopy = GL_TRUE; + } + else if (texImage->TexFormat == MESA_FORMAT_A8 && + format == GL_ALPHA && + type == GL_UNSIGNED_BYTE) { + memCopy = GL_TRUE; + } + } + + if (memCopy) { + const GLuint bpp = _mesa_get_format_bytes(texImage->TexFormat); + const GLuint bytesPerRow = texImage->Width * bpp; + GLubyte *dst = + _mesa_image_address2d(&ctx->Pack, pixels, texImage->Width, + texImage->Height, format, type, 0, 0); + const GLint dstRowStride = + _mesa_image_row_stride(&ctx->Pack, texImage->Width, format, type); + const GLubyte *src = texImage->Data; + const GLint srcRowStride = texImage->RowStride * bpp; + GLuint row; + + if (bytesPerRow == dstRowStride && bytesPerRow == srcRowStride) { + memcpy(dst, src, bytesPerRow * texImage->Height); + } + else { + for (row = 0; row < texImage->Height; row++) { + memcpy(dst, src, bytesPerRow); + dst += dstRowStride; + src += srcRowStride; + } + } + } + + return memCopy; +} + + /** * This is the software fallback for Driver.GetTexImage(). * All error checking will have been done before this routine is called. @@ -402,7 +481,10 @@ _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level, pixels = ADD_POINTERS(buf, pixels); } - if (format == GL_COLOR_INDEX) { + if (get_tex_memcpy(ctx, format, type, pixels, texObj, texImage)) { + /* all done */ + } + else if (format == GL_COLOR_INDEX) { get_tex_color_index(ctx, dimensions, format, type, pixels, texImage); } else if (format == GL_DEPTH_COMPONENT) { -- cgit v1.2.3 From d0b6147291fe42d7d733b3d0e5b10c4f4f08030f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Oct 2009 16:30:36 -0600 Subject: intel: remove memcpy_get_tex_image() code This has been lifted into core Mesa where it can be used for all drivers that use the _mesa_get_teximage() fallback for ctx->Driver.GetTexImage(). --- src/mesa/drivers/dri/intel/intel_tex_image.c | 105 +-------------------------- 1 file changed, 2 insertions(+), 103 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index 6301444c34..3dce1b0a87 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -619,104 +619,6 @@ intelCompressedTexImage2D( GLcontext *ctx, GLenum target, GLint level, } -/** - * Try to use memcpy() to do a glGetTexImage(). - * \return GL_TRUE if done, GL_FALSE otherwise - */ -static GLboolean -memcpy_get_tex_image(GLcontext *ctx, GLenum target, GLint level, - GLenum format, GLenum type, GLvoid * pixels, - struct gl_texture_object *texObj, - struct gl_texture_image *texImage) -{ - GLboolean memCopy = GL_FALSE; - - /* Texture image should have been mapped already */ - assert(texImage->Data); - - /* - * Check if the src/dst formats are compatible. - * Also note that GL's pixel transfer ops don't apply to glGetTexImage() - * so we don't have to worry about those. - */ - if ((texObj->Target == GL_TEXTURE_1D || - texObj->Target == GL_TEXTURE_2D || - texObj->Target == GL_TEXTURE_RECTANGLE || - (texObj->Target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X && - texObj->Target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z))) { - if (texImage->TexFormat == MESA_FORMAT_ARGB8888 && - format == GL_BGRA && - type == GL_UNSIGNED_BYTE && - _mesa_little_endian()) { - memCopy = GL_TRUE; - } - else if (texImage->TexFormat == MESA_FORMAT_AL88 && - format == GL_LUMINANCE_ALPHA && - type == GL_UNSIGNED_BYTE && - _mesa_little_endian()) { - memCopy = GL_TRUE; - } - else if (texImage->TexFormat == MESA_FORMAT_L8 && - format == GL_LUMINANCE && - type == GL_UNSIGNED_BYTE) { - memCopy = GL_TRUE; - } - else if (texImage->TexFormat == MESA_FORMAT_A8 && - format == GL_ALPHA && - type == GL_UNSIGNED_BYTE) { - memCopy = GL_TRUE; - } - } - - if (memCopy) { - struct gl_pixelstore_attrib *pack = &ctx->Pack; - - if (_mesa_is_bufferobj(pack->BufferObj)) { - /* Packing texture image into a PBO */ - GLubyte *buf = (GLubyte *) - ctx->Driver.MapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, - GL_WRITE_ONLY_ARB, pack->BufferObj); - if (!buf) { - /* out of memory or other unexpected error */ - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGetTexImage(map PBO failed)"); - return GL_TRUE; /* failed, but done */ - } - pixels = ADD_POINTERS(buf, pixels); - } - - { - const GLuint bpp = _mesa_get_format_bytes(texImage->TexFormat); - const GLuint bytesPerRow = texImage->Width * bpp; - GLubyte *dst = - _mesa_image_address2d(&ctx->Pack, pixels, texImage->Width, - texImage->Height, format, type, 0, 0); - const GLint dstRowStride = - _mesa_image_row_stride(&ctx->Pack, texImage->Width, format, type); - const GLubyte *src = texImage->Data; - const GLint srcRowStride = texImage->RowStride * bpp; - GLuint row; - - if (bytesPerRow == dstRowStride && bytesPerRow == dstRowStride) { - memcpy(dst, src, bytesPerRow * texImage->Height); - } - else { - for (row = 0; row < texImage->Height; row++) { - memcpy(dst, src, bytesPerRow); - dst += dstRowStride; - src += srcRowStride; - } - } - } - - if (_mesa_is_bufferobj(pack->BufferObj)) { - ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, pack->BufferObj); - } - } - - return memCopy; -} - - /** * Need to map texture image into memory before copying image data, * then unmap it. @@ -768,11 +670,8 @@ intel_get_tex_image(GLcontext * ctx, GLenum target, GLint level, texObj, texImage); } else { - if (!memcpy_get_tex_image(ctx, target, level, format, type, pixels, - texObj, texImage)) { - _mesa_get_teximage(ctx, target, level, format, type, pixels, - texObj, texImage); - } + _mesa_get_teximage(ctx, target, level, format, type, pixels, + texObj, texImage); } -- cgit v1.2.3 From b924579bd4afaf5daa9df8d4f120f42fa20cafc6 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Thu, 29 Oct 2009 19:42:12 -0400 Subject: r600: Add support for ARB_depth_clamp --- src/mesa/drivers/dri/r600/r600_context.c | 1 + src/mesa/drivers/dri/r600/r700_state.c | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index 6de151d51b..dbd233729c 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -94,6 +94,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. static const struct dri_extension card_extensions[] = { /* *INDENT-OFF* */ + {"GL_ARB_depth_clamp", NULL}, {"GL_ARB_depth_texture", NULL}, {"GL_ARB_fragment_program", NULL}, {"GL_ARB_occlusion_query", GL_ARB_occlusion_query_functions}, diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index 2b42bfa3f9..b278887266 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -1030,6 +1030,7 @@ static void r700UpdateWindow(GLcontext * ctx, int id) //-------------------- GLfloat tz = v[MAT_TZ] * depthScale; R600_STATECHANGE(context, vpt); + R600_STATECHANGE(context, cl); r700->viewport[id].PA_CL_VPORT_XSCALE.f32All = sx; r700->viewport[id].PA_CL_VPORT_XOFFSET.f32All = tx; @@ -1040,6 +1041,18 @@ static void r700UpdateWindow(GLcontext * ctx, int id) //-------------------- r700->viewport[id].PA_CL_VPORT_ZSCALE.f32All = sz; r700->viewport[id].PA_CL_VPORT_ZOFFSET.f32All = tz; + if (ctx->Transform.DepthClamp) { + r700->viewport[id].PA_SC_VPORT_ZMIN_0.f32All = MIN2(ctx->Viewport.Near, ctx->Viewport.Far); + r700->viewport[id].PA_SC_VPORT_ZMAX_0.f32All = MAX2(ctx->Viewport.Near, ctx->Viewport.Far); + SETbit(r700->PA_CL_CLIP_CNTL.u32All, ZCLIP_NEAR_DISABLE_bit); + SETbit(r700->PA_CL_CLIP_CNTL.u32All, ZCLIP_FAR_DISABLE_bit); + } else { + r700->viewport[id].PA_SC_VPORT_ZMIN_0.f32All = 0.0; + r700->viewport[id].PA_SC_VPORT_ZMAX_0.f32All = 1.0; + CLEARbit(r700->PA_CL_CLIP_CNTL.u32All, ZCLIP_NEAR_DISABLE_bit); + CLEARbit(r700->PA_CL_CLIP_CNTL.u32All, ZCLIP_FAR_DISABLE_bit); + } + r700->viewport[id].enabled = GL_TRUE; r700SetScissor(context); @@ -1345,8 +1358,6 @@ void r700SetScissor(context_t *context) //--------------- SETfield(r700->viewport[id].PA_SC_VPORT_SCISSOR_0_BR.u32All, y2, PA_SC_VPORT_SCISSOR_0_BR__BR_Y_shift, PA_SC_VPORT_SCISSOR_0_BR__BR_Y_mask); - r700->viewport[id].PA_SC_VPORT_ZMIN_0.u32All = 0; - r700->viewport[id].PA_SC_VPORT_ZMAX_0.u32All = 0x3F800000; r700->viewport[id].enabled = GL_TRUE; } -- cgit v1.2.3 From c243e8dd23e8827afe926ec6314ffdfa15b3f7ab Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Thu, 29 Oct 2009 19:44:35 -0400 Subject: r600: remove the no rrb messages --- src/mesa/drivers/dri/r600/r700_chip.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index ace3d24f06..47b38d2e36 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -358,7 +358,6 @@ static void r700SendDepthTargetState(GLcontext *ctx, struct radeon_state_atom *a rrb = radeon_get_depthbuffer(&context->radeon); if (!rrb || !rrb->bo) { - fprintf(stderr, "no rrb\n"); return; } @@ -400,7 +399,6 @@ static void r700SendRenderTargetState(GLcontext *ctx, struct radeon_state_atom * rrb = radeon_get_colorbuffer(&context->radeon); if (!rrb || !rrb->bo) { - fprintf(stderr, "no rrb\n"); return; } -- cgit v1.2.3 From f920d496e1b5b01a3ba9bcd7dcff5c19bc109da2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Oct 2009 17:49:50 -0600 Subject: mesa: fix _mesa_texstore_argb8888() for MESA_FORMAT_XRGB8888 If we hit the general path and call _mesa_make_temp_chan_image() we always want to get a GL_RGBA texture. We were getting a 3-channel GL_RGB texture before and that messed up the memory layout. --- src/mesa/main/texstore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 14cad6b32f..e48d472061 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -1406,7 +1406,7 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) { const GLboolean littleEndian = _mesa_little_endian(); const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); - const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); + const GLenum baseFormat = GL_RGBA; ASSERT(dstFormat == MESA_FORMAT_ARGB8888 || dstFormat == MESA_FORMAT_ARGB8888_REV || -- cgit v1.2.3 From 4a253431abf43a0638afb43605b44a8742b72a60 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 29 Oct 2009 19:12:50 -0600 Subject: intel: update intel_create_renderbuffer(format), add XRGB support Pass a gl_format to intel_create_renderbuffer() instead of GLenum. Add cases for MESA_FORMAT_XRGB8888 textures and renderbuffers. However, we don't yet create any renderbuffers or textures with that format. It seems the default alpha value is zero instead of one. Need to investigate that first. --- src/mesa/drivers/dri/i915/i830_texstate.c | 2 ++ src/mesa/drivers/dri/i915/i830_vtbl.c | 1 + src/mesa/drivers/dri/i915/i915_texstate.c | 2 ++ src/mesa/drivers/dri/i915/i915_vtbl.c | 1 + src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 7 ++++ src/mesa/drivers/dri/intel/intel_blit.c | 1 + src/mesa/drivers/dri/intel/intel_fbo.c | 44 +++++++++--------------- src/mesa/drivers/dri/intel/intel_fbo.h | 2 +- src/mesa/drivers/dri/intel/intel_pixel_draw.c | 2 +- src/mesa/drivers/dri/intel/intel_screen.c | 14 ++++---- src/mesa/drivers/dri/intel/intel_span.c | 15 ++++++++ src/mesa/drivers/dri/intel/intel_tex_format.c | 2 ++ 12 files changed, 57 insertions(+), 36 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i830_texstate.c b/src/mesa/drivers/dri/i915/i830_texstate.c index 28263fbe3c..f4bbb53b86 100644 --- a/src/mesa/drivers/dri/i915/i830_texstate.c +++ b/src/mesa/drivers/dri/i915/i830_texstate.c @@ -59,6 +59,8 @@ translate_texture_format(GLuint mesa_format, GLuint internal_format) return MAPSURF_32BIT | MT_32BIT_XRGB8888; else return MAPSURF_32BIT | MT_32BIT_ARGB8888; + case MESA_FORMAT_XRGB8888: + return MAPSURF_32BIT | MT_32BIT_XRGB8888; case MESA_FORMAT_YCBCR_REV: return (MAPSURF_422 | MT_422_YCRCB_NORMAL); case MESA_FORMAT_YCBCR: diff --git a/src/mesa/drivers/dri/i915/i830_vtbl.c b/src/mesa/drivers/dri/i915/i830_vtbl.c index 22f8bc7f19..4133696129 100644 --- a/src/mesa/drivers/dri/i915/i830_vtbl.c +++ b/src/mesa/drivers/dri/i915/i830_vtbl.c @@ -647,6 +647,7 @@ i830_state_draw_region(struct intel_context *intel, if (irb != NULL) { switch (irb->texformat) { case MESA_FORMAT_ARGB8888: + case MESA_FORMAT_XRGB8888: value |= DV_PF_8888; break; case MESA_FORMAT_RGB565: diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index bea47f5af8..d6689af53f 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -60,6 +60,8 @@ translate_texture_format(gl_format mesa_format, GLuint internal_format, return MAPSURF_32BIT | MT_32BIT_XRGB8888; else return MAPSURF_32BIT | MT_32BIT_ARGB8888; + case MESA_FORMAT_XRGB8888: + return MAPSURF_32BIT | MT_32BIT_XRGB8888; case MESA_FORMAT_YCBCR_REV: return (MAPSURF_422 | MT_422_YCRCB_NORMAL); case MESA_FORMAT_YCBCR: diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c b/src/mesa/drivers/dri/i915/i915_vtbl.c index d84df1a142..3c1b2dd0b0 100644 --- a/src/mesa/drivers/dri/i915/i915_vtbl.c +++ b/src/mesa/drivers/dri/i915/i915_vtbl.c @@ -589,6 +589,7 @@ i915_state_draw_region(struct intel_context *intel, if (irb != NULL) { switch (irb->texformat) { case MESA_FORMAT_ARGB8888: + case MESA_FORMAT_XRGB8888: value |= DV_PF_8888; break; case MESA_FORMAT_RGB565: diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index 3b2c6a25be..0bf735c0f2 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -96,7 +96,11 @@ static GLuint translate_tex_format( gl_format mesa_format, else return BRW_SURFACEFORMAT_B8G8R8A8_UNORM; + case MESA_FORMAT_XRGB8888: + return BRW_SURFACEFORMAT_B8G8R8X8_UNORM; + case MESA_FORMAT_RGBA8888_REV: + _mesa_problem(NULL, "unexpected format in i965:translate_tex_format()"); if (internal_format == GL_RGB) return BRW_SURFACEFORMAT_R8G8B8X8_UNORM; else @@ -531,6 +535,9 @@ brw_update_renderbuffer_surface(struct brw_context *brw, case MESA_FORMAT_ARGB8888: key.surface_format = BRW_SURFACEFORMAT_B8G8R8A8_UNORM; break; + case MESA_FORMAT_XRGB8888: + key.surface_format = BRW_SURFACEFORMAT_B8G8R8X8_UNORM; + break; case MESA_FORMAT_RGB565: key.surface_format = BRW_SURFACEFORMAT_B5G6R5_UNORM; break; diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c index 55d97a0f76..817223da41 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.c +++ b/src/mesa/drivers/dri/intel/intel_blit.c @@ -498,6 +498,7 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask) switch (irb->texformat) { case MESA_FORMAT_ARGB8888: + case MESA_FORMAT_XRGB8888: clearVal = intel->ClearColor8888; break; case MESA_FORMAT_RGB565: diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index d006389f5a..9c780d40cc 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -292,7 +292,7 @@ intel_renderbuffer_set_region(struct intel_renderbuffer *rb, * not a user-created renderbuffer. */ struct intel_renderbuffer * -intel_create_renderbuffer(GLenum intFormat) +intel_create_renderbuffer(gl_format format) { GET_CURRENT_CONTEXT(ctx); @@ -308,48 +308,30 @@ intel_create_renderbuffer(GLenum intFormat) _mesa_init_renderbuffer(&irb->Base, name); irb->Base.ClassID = INTEL_RB_CLASS; - switch (intFormat) { - case GL_RGB5: - irb->Base.Format = MESA_FORMAT_RGB565; + switch (format) { + case MESA_FORMAT_RGB565: irb->Base._BaseFormat = GL_RGB; irb->Base.DataType = GL_UNSIGNED_BYTE; - irb->texformat = MESA_FORMAT_RGB565; break; - case GL_RGB8: - irb->Base.Format = MESA_FORMAT_ARGB8888; /* XXX: NEED XRGB8888 */ + case MESA_FORMAT_XRGB8888: irb->Base._BaseFormat = GL_RGB; irb->Base.DataType = GL_UNSIGNED_BYTE; - irb->texformat = MESA_FORMAT_ARGB8888; /* XXX: NEED XRGB8888 */ break; - case GL_RGBA8: - irb->Base.Format = MESA_FORMAT_ARGB8888; + case MESA_FORMAT_ARGB8888: irb->Base._BaseFormat = GL_RGBA; irb->Base.DataType = GL_UNSIGNED_BYTE; - irb->texformat = MESA_FORMAT_ARGB8888; - break; - case GL_STENCIL_INDEX8_EXT: - irb->Base.Format = MESA_FORMAT_S8_Z24; - irb->Base._BaseFormat = GL_STENCIL_INDEX; - irb->Base.DataType = GL_UNSIGNED_BYTE; - irb->texformat = MESA_FORMAT_S8_Z24; break; - case GL_DEPTH_COMPONENT16: - irb->Base.Format = MESA_FORMAT_Z16; + case MESA_FORMAT_Z16: irb->Base._BaseFormat = GL_DEPTH_COMPONENT; irb->Base.DataType = GL_UNSIGNED_SHORT; - irb->texformat = MESA_FORMAT_Z16; break; - case GL_DEPTH_COMPONENT24: - irb->Base.Format = MESA_FORMAT_S8_Z24; + case MESA_FORMAT_X8_Z24: irb->Base._BaseFormat = GL_DEPTH_COMPONENT; irb->Base.DataType = GL_UNSIGNED_INT; - irb->texformat = MESA_FORMAT_S8_Z24; break; - case GL_DEPTH24_STENCIL8_EXT: - irb->Base.Format = MESA_FORMAT_S8_Z24; + case MESA_FORMAT_S8_Z24: irb->Base._BaseFormat = GL_DEPTH_STENCIL; irb->Base.DataType = GL_UNSIGNED_INT_24_8_EXT; - irb->texformat = MESA_FORMAT_S8_Z24; break; default: _mesa_problem(NULL, @@ -358,7 +340,10 @@ intel_create_renderbuffer(GLenum intFormat) return NULL; } - irb->Base.InternalFormat = intFormat; + assert(irb->Base._BaseFormat == _mesa_get_format_base_format(format)); + irb->Base.Format = format; + irb->Base.InternalFormat = irb->Base._BaseFormat; + irb->texformat = format; /* intel-specific methods */ irb->Base.Delete = intel_delete_renderbuffer; @@ -442,6 +427,10 @@ intel_update_wrapper(GLcontext *ctx, struct intel_renderbuffer *irb, irb->Base.DataType = GL_UNSIGNED_BYTE; DBG("Render to RGBA8 texture OK\n"); } + else if (texImage->TexFormat == MESA_FORMAT_XRGB8888) { + irb->Base.DataType = GL_UNSIGNED_BYTE; + DBG("Render to XGBA8 texture OK\n"); + } else if (texImage->TexFormat == MESA_FORMAT_RGB565) { irb->Base.DataType = GL_UNSIGNED_BYTE; DBG("Render to RGB5 texture OK\n"); @@ -644,6 +633,7 @@ intel_validate_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb) switch (irb->texformat) { case MESA_FORMAT_ARGB8888: + case MESA_FORMAT_XRGB8888: case MESA_FORMAT_RGB565: case MESA_FORMAT_ARGB1555: case MESA_FORMAT_ARGB4444: diff --git a/src/mesa/drivers/dri/intel/intel_fbo.h b/src/mesa/drivers/dri/intel/intel_fbo.h index e0584e3494..50a8a95985 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.h +++ b/src/mesa/drivers/dri/intel/intel_fbo.h @@ -115,7 +115,7 @@ intel_renderbuffer_set_region(struct intel_renderbuffer *irb, extern struct intel_renderbuffer * -intel_create_renderbuffer(GLenum intFormat); +intel_create_renderbuffer(gl_format format); extern void diff --git a/src/mesa/drivers/dri/intel/intel_pixel_draw.c b/src/mesa/drivers/dri/intel/intel_pixel_draw.c index 5ffa847fd4..9b382e3622 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_draw.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_draw.c @@ -169,7 +169,7 @@ intel_stencil_drawpixels(GLcontext * ctx, * buffer. */ depth_irb = intel_get_renderbuffer(ctx->DrawBuffer, BUFFER_DEPTH); - irb = intel_create_renderbuffer(GL_RGBA8); + irb = intel_create_renderbuffer(MESA_FORMAT_ARGB8888); rb = &irb->Base; irb->Base.Width = depth_irb->Base.Width; irb->Base.Height = depth_irb->Base.Height; diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index 41342ddcae..62c322b4ed 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -349,7 +349,7 @@ intelCreateBuffer(__DRIscreenPrivate * driScrnPriv, else { GLboolean swStencil = (mesaVis->stencilBits > 0 && mesaVis->depthBits != 24); - GLenum rgbFormat; + gl_format rgbFormat; struct intel_framebuffer *intel_fb = CALLOC_STRUCT(intel_framebuffer); @@ -359,11 +359,11 @@ intelCreateBuffer(__DRIscreenPrivate * driScrnPriv, _mesa_initialize_framebuffer(&intel_fb->Base, mesaVis); if (mesaVis->redBits == 5) - rgbFormat = GL_RGB5; + rgbFormat = MESA_FORMAT_RGB565; else if (mesaVis->alphaBits == 0) - rgbFormat = GL_RGB8; + rgbFormat = MESA_FORMAT_ARGB8888; /* XXX change to XRGB someday */ else - rgbFormat = GL_RGBA8; + rgbFormat = MESA_FORMAT_ARGB8888; /* setup the hardware-based renderbuffers */ intel_fb->color_rb[0] = intel_create_renderbuffer(rgbFormat); @@ -382,7 +382,7 @@ intelCreateBuffer(__DRIscreenPrivate * driScrnPriv, if (mesaVis->stencilBits == 8) { /* combined depth/stencil buffer */ struct intel_renderbuffer *depthStencilRb - = intel_create_renderbuffer(GL_DEPTH24_STENCIL8_EXT); + = intel_create_renderbuffer(MESA_FORMAT_S8_Z24); /* note: bind RB to two attachment points */ _mesa_add_renderbuffer(&intel_fb->Base, BUFFER_DEPTH, &depthStencilRb->Base); @@ -390,7 +390,7 @@ intelCreateBuffer(__DRIscreenPrivate * driScrnPriv, &depthStencilRb->Base); } else { struct intel_renderbuffer *depthRb - = intel_create_renderbuffer(GL_DEPTH_COMPONENT24); + = intel_create_renderbuffer(MESA_FORMAT_X8_Z24); _mesa_add_renderbuffer(&intel_fb->Base, BUFFER_DEPTH, &depthRb->Base); } @@ -398,7 +398,7 @@ intelCreateBuffer(__DRIscreenPrivate * driScrnPriv, else if (mesaVis->depthBits == 16) { /* just 16-bit depth buffer, no hw stencil */ struct intel_renderbuffer *depthRb - = intel_create_renderbuffer(GL_DEPTH_COMPONENT16); + = intel_create_renderbuffer(MESA_FORMAT_Z16); _mesa_add_renderbuffer(&intel_fb->Base, BUFFER_DEPTH, &depthRb->Base); } diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index a36c077fbd..b0484a9959 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -651,8 +651,23 @@ intel_set_span_functions(struct intel_context *intel, break; } break; + case MESA_FORMAT_XRGB8888: + switch (tiling) { + case I915_TILING_NONE: + default: + intelInitPointers_xRGB8888(rb); + break; + case I915_TILING_X: + intel_XTile_InitPointers_xRGB8888(rb); + break; + case I915_TILING_Y: + intel_YTile_InitPointers_xRGB8888(rb); + break; + } + break; case MESA_FORMAT_ARGB8888: if (0 /*rb->AlphaBits == 0*/) { /* XXX: Need xRGB8888 Mesa format */ + /* XXX remove this code someday when we enable XRGB surfaces */ /* 8888 RGBx */ switch (tiling) { case I915_TILING_NONE: diff --git a/src/mesa/drivers/dri/intel/intel_tex_format.c b/src/mesa/drivers/dri/intel/intel_tex_format.c index eca0f6d572..f37a545c7f 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_format.c +++ b/src/mesa/drivers/dri/intel/intel_tex_format.c @@ -50,6 +50,7 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat, if (format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5) { return MESA_FORMAT_RGB565; } + /* XXX use MESA_FORMAT_XRGB8888 someday */ return do32bpt ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_RGB565; case GL_RGBA8: @@ -69,6 +70,7 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat, case GL_RGB10: case GL_RGB12: case GL_RGB16: + /* XXX use MESA_FORMAT_XRGB8888 someday */ return MESA_FORMAT_ARGB8888; case GL_RGB5: -- cgit v1.2.3 From 35506dec6734a1ae777dc16981cb19e514f41897 Mon Sep 17 00:00:00 2001 From: Chow Loong Jin Date: Wed, 28 Oct 2009 14:34:14 +0800 Subject: Add --with-dri-searchpath argument * Add an extra argument to configure which allows for specifying different DRI driver search paths to libGL (FDO #24766) Signed-off-by: Dan Nicholson --- src/mesa/drivers/dri/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/Makefile b/src/mesa/drivers/dri/Makefile index 32db097861..264648c3fb 100644 --- a/src/mesa/drivers/dri/Makefile +++ b/src/mesa/drivers/dri/Makefile @@ -25,7 +25,7 @@ pcedit = sed \ -e 's,@INSTALL_LIB_DIR@,$(INSTALL_LIB_DIR),' \ -e 's,@INSTALL_INC_DIR@,$(INSTALL_INC_DIR),' \ -e 's,@VERSION@,$(MESA_MAJOR).$(MESA_MINOR).$(MESA_TINY),' \ - -e 's,@DRI_DRIVER_DIR@,$(DRI_DRIVER_SEARCH_DIR),' \ + -e 's,@DRI_DRIVER_DIR@,$(DRI_DRIVER_INSTALL_DIR),' \ -e 's,@DRI_PC_REQ_PRIV@,$(DRI_PC_REQ_PRIV),' dri.pc: dri.pc.in -- cgit v1.2.3 From 71cd40bccf8dcbf628a7d7d3f7c877d547338c5a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 30 Oct 2009 08:19:50 -0600 Subject: mesa: fix incorrect format info for MESA_FORMAT_SL8 Fixes bugs 24798 and 24801. --- src/mesa/main/formats.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index aed313445f..e9b33e489a 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -387,11 +387,11 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = { MESA_FORMAT_SL8, "MESA_FORMAT_SL8", - GL_LUMINANCE_ALPHA, + GL_LUMINANCE, GL_UNSIGNED_NORMALIZED, - 0, 0, 0, 8, + 0, 0, 0, 0, 8, 0, 0, 0, 0, - 1, 1, 2 + 1, 1, 1 }, { MESA_FORMAT_SLA8, -- cgit v1.2.3 From 730a3de9f9774710ad5bbea2f32dc3af3c764732 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 30 Oct 2009 08:30:59 -0600 Subject: mesa: fix inverted buffer object test Fixes bug 24799. --- src/mesa/main/texgetimage.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index 10c6947c37..e4a9ac14b1 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -713,7 +713,7 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format, return; } - if (_mesa_is_bufferobj(ctx->Pack.BufferObj) && !pixels) { + if (!_mesa_is_bufferobj(ctx->Pack.BufferObj) && !pixels) { /* not an error, do nothing */ return; } -- cgit v1.2.3 From 409469fb70682cd819ab405e0f92a4659381cfbe Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 30 Oct 2009 09:12:11 -0600 Subject: intel: fix up some XRGB breakage We weren't choosing the right XRGB span functions for reading the framebuffer. XRGB formats still aren't turned on yet though. --- src/mesa/drivers/dri/intel/intel_fbo.c | 5 ++++- src/mesa/drivers/dri/intel/intel_screen.c | 2 +- src/mesa/drivers/dri/intel/intel_span.c | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 9c780d40cc..d8ac4d3663 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -314,6 +314,10 @@ intel_create_renderbuffer(gl_format format) irb->Base.DataType = GL_UNSIGNED_BYTE; break; case MESA_FORMAT_XRGB8888: + /* XXX this is a hack since XRGB surfaces don't seem to work + * properly yet. Reading the alpha channel returns 0 instead of 1. + */ + format = MESA_FORMAT_ARGB8888; irb->Base._BaseFormat = GL_RGB; irb->Base.DataType = GL_UNSIGNED_BYTE; break; @@ -340,7 +344,6 @@ intel_create_renderbuffer(gl_format format) return NULL; } - assert(irb->Base._BaseFormat == _mesa_get_format_base_format(format)); irb->Base.Format = format; irb->Base.InternalFormat = irb->Base._BaseFormat; irb->texformat = format; diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index 62c322b4ed..789135b49f 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -361,7 +361,7 @@ intelCreateBuffer(__DRIscreenPrivate * driScrnPriv, if (mesaVis->redBits == 5) rgbFormat = MESA_FORMAT_RGB565; else if (mesaVis->alphaBits == 0) - rgbFormat = MESA_FORMAT_ARGB8888; /* XXX change to XRGB someday */ + rgbFormat = MESA_FORMAT_XRGB8888; else rgbFormat = MESA_FORMAT_ARGB8888; diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index b0484a9959..927e4fd982 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -666,7 +666,7 @@ intel_set_span_functions(struct intel_context *intel, } break; case MESA_FORMAT_ARGB8888: - if (0 /*rb->AlphaBits == 0*/) { /* XXX: Need xRGB8888 Mesa format */ + if (rb->_BaseFormat == GL_RGB) { /* XXX remove this code someday when we enable XRGB surfaces */ /* 8888 RGBx */ switch (tiling) { -- cgit v1.2.3 From 5f7d5d3ea3932ef6028b21bb22d8d28dbdd9fa9f Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Wed, 28 Oct 2009 18:02:22 +0200 Subject: r600: use AUTO_INDEX for draw - saves cmd buffer space also seems we can use INDX_OFFSET if start != 0 --- src/mesa/drivers/dri/r600/r700_render.c | 28 ++++++++++------------------ 1 file changed, 10 insertions(+), 18 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c index 9cf984f966..dc117183cb 100644 --- a/src/mesa/drivers/dri/r600/r700_render.c +++ b/src/mesa/drivers/dri/r600/r700_render.c @@ -259,8 +259,6 @@ static void r700RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim uint32_t vgt_index_type = 0; uint32_t vgt_primitive_type = 0; uint32_t vgt_num_indices = 0; - TNLcontext *tnl = TNL_CONTEXT(ctx); - struct vertex_buffer *vb = &tnl->vb; GLboolean bUseDrawIndex; if(NULL != context->ind_buf.bo) @@ -287,6 +285,7 @@ static void r700RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim total_emit = 3 /* VGT_PRIMITIVE_TYPE */ + 2 /* VGT_INDEX_TYPE */ + 2 /* NUM_INSTANCES */ + + 3 /* VGT_INDEX_OFFSET */ + 5 + 2; /* DRAW_INDEX */ } else @@ -294,7 +293,8 @@ static void r700RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim total_emit = 3 /* VGT_PRIMITIVE_TYPE */ + 2 /* VGT_INDEX_TYPE */ + 2 /* NUM_INSTANCES */ - + num_indices + 3; /* DRAW_INDEX_IMMD */ + + 3 /* VGT_INDEX_OFFSET */ + + 3; /* DRAW_INDEX_IMMD */ } BEGIN_BATCH_NO_AUTOSTATE(total_emit); @@ -332,13 +332,15 @@ static void r700RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim } else { - SETfield(vgt_draw_initiator, DI_SRC_SEL_IMMEDIATE, SOURCE_SELECT_shift, SOURCE_SELECT_mask); + SETfield(vgt_draw_initiator, DI_SRC_SEL_AUTO_INDEX, SOURCE_SELECT_shift, SOURCE_SELECT_mask); } SETfield(vgt_draw_initiator, DI_MAJOR_MODE_0, MAJOR_MODE_shift, MAJOR_MODE_mask); if(GL_TRUE == bUseDrawIndex) { + R600_OUT_BATCH_REGSEQ(VGT_INDX_OFFSET, 1); + R600_OUT_BATCH(0); R600_OUT_BATCH(CP_PACKET3(R600_IT_DRAW_INDEX, 3)); R600_OUT_BATCH(context->ind_buf.bo_offset); R600_OUT_BATCH(0); @@ -351,21 +353,11 @@ static void r700RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim } else { - R600_OUT_BATCH(CP_PACKET3(R600_IT_DRAW_INDEX_IMMD, (num_indices + 1))); + R600_OUT_BATCH_REGSEQ(VGT_INDX_OFFSET, 1); + R600_OUT_BATCH(start); + R600_OUT_BATCH(CP_PACKET3(R600_IT_DRAW_INDEX_AUTO,1)); R600_OUT_BATCH(vgt_num_indices); R600_OUT_BATCH(vgt_draw_initiator); - - for (i = start; i < (start + num_indices); i++) - { - if(vb->Elts) - { - R600_OUT_BATCH(vb->Elts[i]); - } - else - { - R600_OUT_BATCH(i); - } - } } END_BATCH(); @@ -391,7 +383,7 @@ static GLuint r700PredictRenderSize(GLcontext* ctx, else { for (i = 0; i < nr_prims; ++i) { - dwords += prim[i].count + 10; + dwords += 13; } } -- cgit v1.2.3 From 57864f6e0450c589059e07534e2af152bbefa75f Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Fri, 30 Oct 2009 11:51:24 -0400 Subject: r600: fix a warning, update comments --- src/mesa/drivers/dri/r600/r700_render.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c index dc117183cb..268bfd8bf0 100644 --- a/src/mesa/drivers/dri/r600/r700_render.c +++ b/src/mesa/drivers/dri/r600/r700_render.c @@ -253,7 +253,7 @@ static void r700RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim { context_t *context = R700_CONTEXT(ctx); BATCH_LOCALS(&context->radeon); - int type, i, total_emit; + int type, total_emit; int num_indices; uint32_t vgt_draw_initiator = 0; uint32_t vgt_index_type = 0; @@ -294,7 +294,7 @@ static void r700RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim + 2 /* VGT_INDEX_TYPE */ + 2 /* NUM_INSTANCES */ + 3 /* VGT_INDEX_OFFSET */ - + 3; /* DRAW_INDEX_IMMD */ + + 3; /* DRAW_INDEX_AUTO */ } BEGIN_BATCH_NO_AUTOSTATE(total_emit); @@ -335,7 +335,7 @@ static void r700RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim SETfield(vgt_draw_initiator, DI_SRC_SEL_AUTO_INDEX, SOURCE_SELECT_shift, SOURCE_SELECT_mask); } - SETfield(vgt_draw_initiator, DI_MAJOR_MODE_0, MAJOR_MODE_shift, MAJOR_MODE_mask); + SETfield(vgt_draw_initiator, DI_MAJOR_MODE_0, MAJOR_MODE_shift, MAJOR_MODE_mask); if(GL_TRUE == bUseDrawIndex) { -- cgit v1.2.3 From 703a836d4075b0e95633020765000430192986bb Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Fri, 30 Oct 2009 15:02:34 -0400 Subject: r600: fill in some missing tex formats This improves shadowtex since the component ordering is at least correct now, but I'm not sure how to deal with texturing from a depth surface yet due to differences in depth and color tile layouts. Signed-off-by: Alex Deucher --- src/mesa/drivers/dri/r600/r600_texstate.c | 46 +++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r600_texstate.c b/src/mesa/drivers/dri/r600/r600_texstate.c index c2f2be1d4c..6357d52523 100644 --- a/src/mesa/drivers/dri/r600/r600_texstate.c +++ b/src/mesa/drivers/dri/r600/r600_texstate.c @@ -85,10 +85,21 @@ static GLboolean r600GetTexFormat(struct gl_texture_object *tObj, gl_format mesa CLEARfield(t->SQ_TEX_RESOURCE4, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Y_mask); CLEARfield(t->SQ_TEX_RESOURCE4, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_mask); CLEARfield(t->SQ_TEX_RESOURCE4, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask); + CLEARfield(t->SQ_TEX_RESOURCE4, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask); + + SETfield(t->SQ_TEX_RESOURCE4, SQ_FORMAT_COMP_UNSIGNED, + FORMAT_COMP_X_shift, FORMAT_COMP_X_mask); + SETfield(t->SQ_TEX_RESOURCE4, SQ_FORMAT_COMP_UNSIGNED, + FORMAT_COMP_Y_shift, FORMAT_COMP_Y_mask); + SETfield(t->SQ_TEX_RESOURCE4, SQ_FORMAT_COMP_UNSIGNED, + FORMAT_COMP_X_shift, FORMAT_COMP_Z_mask); + SETfield(t->SQ_TEX_RESOURCE4, SQ_FORMAT_COMP_UNSIGNED, + FORMAT_COMP_W_shift, FORMAT_COMP_W_mask); switch (mesa_format) /* This is mesa format. */ { case MESA_FORMAT_RGBA8888: + case MESA_FORMAT_SIGNED_RGBA8888: SETfield(t->SQ_TEX_RESOURCE1, FMT_8_8_8_8, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask); @@ -100,8 +111,19 @@ static GLboolean r600GetTexFormat(struct gl_texture_object *tObj, gl_format mesa SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_X, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask); + if (mesa_format == MESA_FORMAT_SIGNED_RGBA8888) { + SETfield(t->SQ_TEX_RESOURCE4, SQ_FORMAT_COMP_SIGNED, + FORMAT_COMP_X_shift, FORMAT_COMP_X_mask); + SETfield(t->SQ_TEX_RESOURCE4, SQ_FORMAT_COMP_SIGNED, + FORMAT_COMP_Y_shift, FORMAT_COMP_Y_mask); + SETfield(t->SQ_TEX_RESOURCE4, SQ_FORMAT_COMP_SIGNED, + FORMAT_COMP_Z_shift, FORMAT_COMP_Z_mask); + SETfield(t->SQ_TEX_RESOURCE4, SQ_FORMAT_COMP_SIGNED, + FORMAT_COMP_W_shift, FORMAT_COMP_W_mask); + } break; case MESA_FORMAT_RGBA8888_REV: + case MESA_FORMAT_SIGNED_RGBA8888_REV: SETfield(t->SQ_TEX_RESOURCE1, FMT_8_8_8_8, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask); @@ -113,6 +135,16 @@ static GLboolean r600GetTexFormat(struct gl_texture_object *tObj, gl_format mesa SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_SEL_W, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask); + if (mesa_format == MESA_FORMAT_SIGNED_RGBA8888_REV) { + SETfield(t->SQ_TEX_RESOURCE4, SQ_FORMAT_COMP_SIGNED, + FORMAT_COMP_X_shift, FORMAT_COMP_X_mask); + SETfield(t->SQ_TEX_RESOURCE4, SQ_FORMAT_COMP_SIGNED, + FORMAT_COMP_Y_shift, FORMAT_COMP_Y_mask); + SETfield(t->SQ_TEX_RESOURCE4, SQ_FORMAT_COMP_SIGNED, + FORMAT_COMP_Z_shift, FORMAT_COMP_Z_mask); + SETfield(t->SQ_TEX_RESOURCE4, SQ_FORMAT_COMP_SIGNED, + FORMAT_COMP_W_shift, FORMAT_COMP_W_mask); + } break; case MESA_FORMAT_ARGB8888: SETfield(t->SQ_TEX_RESOURCE1, FMT_8_8_8_8, @@ -479,14 +511,22 @@ static GLboolean r600GetTexFormat(struct gl_texture_object *tObj, gl_format mesa SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_shift, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask); break; case MESA_FORMAT_Z16: + case MESA_FORMAT_X8_Z24: case MESA_FORMAT_S8_Z24: + case MESA_FORMAT_Z24_S8: case MESA_FORMAT_Z32: + case MESA_FORMAT_S8: switch (mesa_format) { case MESA_FORMAT_Z16: SETfield(t->SQ_TEX_RESOURCE1, FMT_16, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask); break; + case MESA_FORMAT_X8_Z24: case MESA_FORMAT_S8_Z24: + SETfield(t->SQ_TEX_RESOURCE1, FMT_8_24, + SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask); + break; + case MESA_FORMAT_Z24_S8: SETfield(t->SQ_TEX_RESOURCE1, FMT_24_8, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask); break; @@ -494,6 +534,12 @@ static GLboolean r600GetTexFormat(struct gl_texture_object *tObj, gl_format mesa SETfield(t->SQ_TEX_RESOURCE1, FMT_32, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask); break; + case MESA_FORMAT_S8: + SETfield(t->SQ_TEX_RESOURCE1, FMT_8, + SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_shift, SQ_TEX_RESOURCE_WORD1_0__DATA_FORMAT_mask); + break; + default: + break; }; switch (tObj->DepthMode) { case GL_LUMINANCE: /* X, X, X, ONE */ -- cgit v1.2.3 From b568a2c808cc2258c354bf14f640bb1f6eaba4ba Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Fri, 30 Oct 2009 15:08:09 -0400 Subject: r600: remove duplicate line --- src/mesa/drivers/dri/r600/r600_texstate.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r600_texstate.c b/src/mesa/drivers/dri/r600/r600_texstate.c index 6357d52523..27c8354923 100644 --- a/src/mesa/drivers/dri/r600/r600_texstate.c +++ b/src/mesa/drivers/dri/r600/r600_texstate.c @@ -85,7 +85,6 @@ static GLboolean r600GetTexFormat(struct gl_texture_object *tObj, gl_format mesa CLEARfield(t->SQ_TEX_RESOURCE4, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Y_mask); CLEARfield(t->SQ_TEX_RESOURCE4, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_Z_mask); CLEARfield(t->SQ_TEX_RESOURCE4, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask); - CLEARfield(t->SQ_TEX_RESOURCE4, SQ_TEX_RESOURCE_WORD4_0__DST_SEL_W_mask); SETfield(t->SQ_TEX_RESOURCE4, SQ_FORMAT_COMP_UNSIGNED, FORMAT_COMP_X_shift, FORMAT_COMP_X_mask); -- cgit v1.2.3 From 2073006c9566b08888b4338748a843c645bd0db1 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 30 Oct 2009 12:26:54 -0700 Subject: intel: Set the texture format in the TFP path. This fixes a regression in piglit's tfp test as of 11caea687e3f10ae12d33e44edf84635f73047dd. Additionally, set the texture format for the RGB textures to MESA_FORMAT_XRGB8888 and support it in the hw paths so that hopefully sw fallbacks involving TFP get better alpha behavior. The radeon drivers appear to need the same fix. Bug #24803 --- src/mesa/drivers/dri/intel/intel_tex_image.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index 3dce1b0a87..3412e761ca 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -6,6 +6,7 @@ #include "main/bufferobj.h" #include "main/convolve.h" #include "main/context.h" +#include "main/formats.h" #include "main/image.h" #include "main/texcompress.h" #include "main/texstore.h" @@ -741,7 +742,7 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; - int level = 0, type, format, internalFormat; + int level = 0, internalFormat; texUnit = &intel->ctx.Texture.Unit[intel->ctx.Texture.CurrentUnit]; texObj = _mesa_select_tex_object(&intel->ctx, texUnit, target); @@ -759,8 +760,6 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, if (rb->region == NULL) return; - type = GL_BGRA; - format = GL_UNSIGNED_BYTE; if (glx_texture_format == GLX_TEXTURE_FORMAT_RGB_EXT) internalFormat = GL_RGB; else @@ -791,6 +790,10 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, intelImage->face = target_to_face(target); intelImage->level = level; + if (glx_texture_format == GLX_TEXTURE_FORMAT_RGB_EXT) + texImage->TexFormat = MESA_FORMAT_XRGB8888; + else + texImage->TexFormat = MESA_FORMAT_ARGB8888; texImage->RowStride = rb->region->pitch; intel_miptree_reference(&intelImage->mt, intelObj->mt); -- cgit v1.2.3 From 2c30ee9bd69ed606b984c051748a7cdb34905eeb Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 30 Oct 2009 13:20:13 -0700 Subject: i965: Fix BRW_WM_MAX_INSN to reflect current limits. Part of fixing bug #24355. --- src/mesa/drivers/dri/i965/brw_wm.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index dd4644fc36..47aa4da306 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -154,13 +154,12 @@ struct brw_wm_instruction { }; -#define BRW_WM_MAX_INSN (MAX_NV_FRAGMENT_PROGRAM_INSTRUCTIONS*3 + FRAG_ATTRIB_MAX + 3) +#define BRW_WM_MAX_INSN (MAX_PROGRAM_INSTRUCTIONS*3 + FRAG_ATTRIB_MAX + 3) #define BRW_WM_MAX_GRF 128 /* hardware limit */ #define BRW_WM_MAX_VREG (BRW_WM_MAX_INSN * 4) #define BRW_WM_MAX_REF (BRW_WM_MAX_INSN * 12) #define BRW_WM_MAX_PARAM 256 #define BRW_WM_MAX_CONST 256 -#define BRW_WM_MAX_KILLS MAX_NV_FRAGMENT_PROGRAM_INSTRUCTIONS #define BRW_WM_MAX_SUBROUTINE 16 -- cgit v1.2.3 From cb132406ded760a622513cd1ab86bf83bb945671 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 30 Oct 2009 13:28:44 -0700 Subject: i965: Add an index assert on get_fp_inst array like other compiler arrays. --- src/mesa/drivers/dri/i965/brw_wm_fp.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c index 53fdd06f42..0e86d75dea 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_fp.c +++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c @@ -181,6 +181,7 @@ static void release_temp( struct brw_wm_compile *c, struct prog_dst_register tem static struct prog_instruction *get_fp_inst(struct brw_wm_compile *c) { + assert(c->nr_fp_insns < BRW_WM_MAX_INSN); return &c->prog_instructions[c->nr_fp_insns++]; } -- cgit v1.2.3 From 21a3a79371c34b20fb3de2af0f031856468bdfed Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 30 Oct 2009 15:36:10 -0700 Subject: intel: Fix up z24_x8 depth spans since the texformat merge. --- src/mesa/drivers/dri/intel/intel_span.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index 927e4fd982..b5e3cad3ff 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -359,18 +359,11 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb, #define INTEL_TAG(name) name##_z16 #include "intel_depthtmp.h" -/* z24 depthbuffer functions. */ +/* z24x8 depthbuffer functions. */ #define INTEL_VALUE_TYPE GLuint #define INTEL_WRITE_DEPTH(offset, d) pwrite_32(irb, offset, d) #define INTEL_READ_DEPTH(offset) pread_32(irb, offset) -#define INTEL_TAG(name) name##_z24 -#include "intel_depthtmp.h" - -/* z24s8 depthbuffer functions. */ -#define INTEL_VALUE_TYPE GLuint -#define INTEL_WRITE_DEPTH(offset, d) pwrite_32(irb, offset, d) -#define INTEL_READ_DEPTH(offset) pread_32(irb, offset) -#define INTEL_TAG(name) name##_z24_s8 +#define INTEL_TAG(name) name##_z24_x8 #include "intel_depthtmp.h" @@ -711,6 +704,7 @@ intel_set_span_functions(struct intel_context *intel, break; } break; + case MESA_FORMAT_X8_Z24: case MESA_FORMAT_S8_Z24: /* There are a few different ways SW asks us to access the S8Z24 data: * Z24 depth-only depth reads @@ -721,13 +715,13 @@ intel_set_span_functions(struct intel_context *intel, switch (tiling) { case I915_TILING_NONE: default: - intelInitDepthPointers_z24_s8(rb); + intelInitDepthPointers_z24_x8(rb); break; case I915_TILING_X: - intel_XTile_InitDepthPointers_z24_s8(rb); + intel_XTile_InitDepthPointers_z24_x8(rb); break; case I915_TILING_Y: - intel_YTile_InitDepthPointers_z24_s8(rb); + intel_YTile_InitDepthPointers_z24_x8(rb); break; } } else if (rb->Format == MESA_FORMAT_S8) { -- cgit v1.2.3 From d63c29ef20b26aa90fb310216011d03253e4f09b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 30 Oct 2009 17:22:58 -0700 Subject: x86: Fix the test for negative pixel count in optimized rgb565 spans. There's a bunch of bogus looking stuff the count handling in this code, but this fixes the testcases we have. --- src/mesa/x86/read_rgba_span_x86.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/x86/read_rgba_span_x86.S b/src/mesa/x86/read_rgba_span_x86.S index 80144b889c..92b1c2d902 100644 --- a/src/mesa/x86/read_rgba_span_x86.S +++ b/src/mesa/x86/read_rgba_span_x86.S @@ -522,7 +522,7 @@ _generic_read_RGBA_span_RGB565_MMX: addl $32,%esp sarl $2, %ecx - jle .L01 /* Bail early if the count is negative. */ + jl .L01 /* Bail early if the count is negative. */ jmp .L02 .L03: -- cgit v1.2.3 From 7c8bed62e0165a0be3363f7abf81bf9e30341e00 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 30 Oct 2009 15:33:11 -0700 Subject: intel: Use GTT mapping when available for swrast. This improves piglit quick.tests runtime from 19:33 minutes to 6:06 on my GM45. It should also hide most of the A17 swizzling issues, though they'll still exist when swapping occurs (which is the kernel's problem either way). --- src/mesa/drivers/dri/intel/intel_depthtmp.h | 10 ++++ src/mesa/drivers/dri/intel/intel_span.c | 73 ++++++++++++++++++++++++++++- src/mesa/drivers/dri/intel/intel_spantmp.h | 6 +++ 3 files changed, 88 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_depthtmp.h b/src/mesa/drivers/dri/intel/intel_depthtmp.h index 16d7708453..a9c75d44cf 100644 --- a/src/mesa/drivers/dri/intel/intel_depthtmp.h +++ b/src/mesa/drivers/dri/intel/intel_depthtmp.h @@ -30,6 +30,16 @@ * all the tiling styles. */ +#define VALUE_TYPE INTEL_VALUE_TYPE +#define WRITE_DEPTH(_x, _y, d) \ + (*(INTEL_VALUE_TYPE *)(irb->region->buffer->virtual + \ + NO_TILE(_x, _y)) = d) +#define READ_DEPTH(d, _x, _y) \ + d = *(INTEL_VALUE_TYPE *)(irb->region->buffer->virtual + \ + NO_TILE(_x, _y)) +#define TAG(x) INTEL_TAG(intel_gttmap_##x) +#include "depthtmp.h" + #define VALUE_TYPE INTEL_VALUE_TYPE #define WRITE_DEPTH(_x, _y, d) INTEL_WRITE_DEPTH(NO_TILE(_x, _y), d) #define READ_DEPTH(d, _x, _y) d = INTEL_READ_DEPTH(NO_TILE(_x, _y)) diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index b5e3cad3ff..638e05f2ad 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -266,8 +266,11 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb, unsigned int num_cliprects; \ struct drm_clip_rect *cliprects; \ int x_off, y_off; \ + int pitch = irb->region->pitch * irb->region->cpp; \ + void *buf = irb->region->buffer->virtual; \ GLuint p; \ (void) p; \ + (void)buf; (void)pitch; /* unused for non-gttmap. */ \ intel_get_cliprects(intel, &cliprects, &num_cliprects, &x_off, &y_off); /* XXX FBO: this is identical to the macro in spantmp2.h except we get @@ -347,6 +350,9 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb, unsigned int num_cliprects; \ struct drm_clip_rect *cliprects; \ int x_off, y_off; \ + int pitch = irb->region->pitch * irb->region->cpp; \ + void *buf = irb->region->buffer->virtual; \ + (void)buf; (void)pitch; /* unused for non-gttmap. */ \ intel_get_cliprects(intel, &cliprects, &num_cliprects, &x_off, &y_off); @@ -367,6 +373,15 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb, #include "intel_depthtmp.h" +/** + ** 8-bit stencil function (XXX FBO: This is obsolete) + **/ +/* XXX */ +#define WRITE_STENCIL(_x, _y, d) pwrite_8(irb, NO_TILE(_x, _y) + 3, d) +#define READ_STENCIL(d, _x, _y) d = pread_8(irb, NO_TILE(_x, _y) + 3); +#define TAG(x) intel_gttmap_##x##_z24_s8 +#include "stenciltmp.h" + /** ** 8-bit stencil function (XXX FBO: This is obsolete) **/ @@ -399,6 +414,9 @@ intel_renderbuffer_map(struct intel_context *intel, struct gl_renderbuffer *rb) if (irb == NULL || irb->region == NULL) return; + if (intel->intelScreen->kernel_exec_fencing) + drm_intel_gem_bo_map_gtt(irb->region->buffer); + intel_set_span_functions(intel, rb); } @@ -411,7 +429,10 @@ intel_renderbuffer_unmap(struct intel_context *intel, if (irb == NULL || irb->region == NULL) return; - clear_span_cache(irb); + if (intel->intelScreen->kernel_exec_fencing) + drm_intel_gem_bo_unmap_gtt(irb->region->buffer); + else + clear_span_cache(irb); rb->GetRow = NULL; rb->PutRow = NULL; @@ -601,6 +622,56 @@ intel_set_span_functions(struct intel_context *intel, else tiling = I915_TILING_NONE; + if (intel->intelScreen->kernel_exec_fencing) { + switch (irb->texformat) { + case MESA_FORMAT_RGB565: + intel_gttmap_InitPointers_RGB565(rb); + break; + case MESA_FORMAT_ARGB4444: + intel_gttmap_InitPointers_ARGB4444(rb); + break; + case MESA_FORMAT_ARGB1555: + intel_gttmap_InitPointers_ARGB1555(rb); + break; + case MESA_FORMAT_XRGB8888: + intel_gttmap_InitPointers_xRGB8888(rb); + break; + case MESA_FORMAT_ARGB8888: + if (rb->_BaseFormat == GL_RGB) { + /* XXX remove this code someday when we enable XRGB surfaces */ + /* 8888 RGBx */ + intel_gttmap_InitPointers_xRGB8888(rb); + } else { + intel_gttmap_InitPointers_ARGB8888(rb); + } + break; + case MESA_FORMAT_Z16: + intel_gttmap_InitDepthPointers_z16(rb); + break; + case MESA_FORMAT_X8_Z24: + intel_gttmap_InitDepthPointers_z24_x8(rb); + break; + case MESA_FORMAT_S8_Z24: + /* There are a few different ways SW asks us to access the S8Z24 data: + * Z24 depth-only depth reads + * S8Z24 depth reads + * S8Z24 stencil reads. + */ + if (rb->Format == MESA_FORMAT_S8_Z24) { + intel_gttmap_InitDepthPointers_z24_x8(rb); + } else if (rb->Format == MESA_FORMAT_S8) { + intel_gttmap_InitStencilPointers_z24_s8(rb); + } + break; + default: + _mesa_problem(NULL, + "Unexpected MesaFormat %d in intelSetSpanFunctions", + irb->texformat); + break; + } + return; + } + switch (irb->texformat) { case MESA_FORMAT_RGB565: switch (tiling) { diff --git a/src/mesa/drivers/dri/intel/intel_spantmp.h b/src/mesa/drivers/dri/intel/intel_spantmp.h index ead0b1c168..98cc6585f4 100644 --- a/src/mesa/drivers/dri/intel/intel_spantmp.h +++ b/src/mesa/drivers/dri/intel/intel_spantmp.h @@ -30,6 +30,12 @@ * all the tiling styles. */ +#define SPANTMP_PIXEL_FMT INTEL_PIXEL_FMT +#define SPANTMP_PIXEL_TYPE INTEL_PIXEL_TYPE +#define TAG(x) INTEL_TAG(intel_gttmap_##x) +#define TAG2(x, y) INTEL_TAG(intel_gttmap_##x##y) +#include "spantmp2.h" + #define SPANTMP_PIXEL_FMT INTEL_PIXEL_FMT #define SPANTMP_PIXEL_TYPE INTEL_PIXEL_TYPE #define PUT_VALUE(_x, _y, v) INTEL_WRITE_VALUE(NO_TILE(_x, _y), v) -- cgit v1.2.3 From a71edc9455ef81a8dd5ec284e88061a585e63580 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 30 Oct 2009 19:03:44 -0600 Subject: mesa: better error message --- src/mesa/main/teximage.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 73a555a181..69ef2cca5e 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1268,8 +1268,8 @@ texture_error_check( GLcontext *ctx, GLenum target, if (_mesa_base_tex_format(ctx, internalFormat) < 0) { if (!isProxy) { _mesa_error(ctx, GL_INVALID_VALUE, - "glTexImage%dD(internalFormat=0x%x)", - dimensions, internalFormat); + "glTexImage%dD(internalFormat=%s)", + dimensions, _mesa_lookup_enum_by_nr(internalFormat)); } return GL_TRUE; } -- cgit v1.2.3 From df5615de1f1bfc68417eb2a6381fe3d8ab9ac035 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 30 Oct 2009 19:05:50 -0600 Subject: ARB prog parser: new set_src_reg(), set_dst_reg() helpers These functions do sanity checks on the register file and index. --- src/mesa/shader/program_parse.y | 83 +++++++++++++++++++++++++++-------------- 1 file changed, 55 insertions(+), 28 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 20bde83af7..32b058400c 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -66,8 +66,14 @@ static int validate_inputs(struct YYLTYPE *locp, static void init_dst_reg(struct prog_dst_register *r); +static void set_dst_reg(struct prog_dst_register *r, + gl_register_file file, GLint index); + static void init_src_reg(struct asm_src_register *r); +static void set_src_reg(struct asm_src_register *r, + gl_register_file file, GLint index); + static void asm_instruction_set_operands(struct asm_instruction *inst, const struct prog_dst_register *dst, const struct asm_src_register *src0, const struct asm_src_register *src1, const struct asm_src_register *src2); @@ -580,9 +586,7 @@ scalarUse: srcReg scalarSuffix temp_sym.param_binding_begin = ~0; initialize_symbol_from_const(state->prog, & temp_sym, & $1); - init_src_reg(& $$); - $$.Base.File = PROGRAM_CONSTANT; - $$.Base.Index = temp_sym.param_binding_begin; + set_src_reg(& $$, PROGRAM_CONSTANT, temp_sym.param_binding_begin); } ; @@ -644,9 +648,7 @@ maskedDstReg: dstReg optionalMask optionalCcMask maskedAddrReg: addrReg addrWriteMask { - init_dst_reg(& $$); - $$.File = PROGRAM_ADDRESS; - $$.Index = 0; + set_dst_reg(& $$, PROGRAM_ADDRESS, 0); $$.WriteMask = $2.mask; } ; @@ -776,16 +778,13 @@ srcReg: USED_IDENTIFIER /* temporaryReg | progParamSingle */ init_src_reg(& $$); switch (s->type) { case at_temp: - $$.Base.File = PROGRAM_TEMPORARY; - $$.Base.Index = s->temp_binding; + set_src_reg(& $$, PROGRAM_TEMPORARY, s->temp_binding); break; case at_param: - $$.Base.File = s->param_binding_type; - $$.Base.Index = s->param_binding_begin; + set_src_reg(& $$, s->param_binding_type, s->param_binding_begin); break; case at_attrib: - $$.Base.File = PROGRAM_INPUT; - $$.Base.Index = s->attrib_binding; + set_src_reg(& $$, PROGRAM_INPUT, s->attrib_binding); state->prog->InputsRead |= (1U << $$.Base.Index); if (!validate_inputs(& @1, state)) { @@ -800,9 +799,7 @@ srcReg: USED_IDENTIFIER /* temporaryReg | progParamSingle */ } | attribBinding { - init_src_reg(& $$); - $$.Base.File = PROGRAM_INPUT; - $$.Base.Index = $1; + set_src_reg(& $$, PROGRAM_INPUT, $1); state->prog->InputsRead |= (1U << $$.Base.Index); if (!validate_inputs(& @1, state)) { @@ -832,19 +829,16 @@ srcReg: USED_IDENTIFIER /* temporaryReg | progParamSingle */ } | paramSingleItemUse { - init_src_reg(& $$); - $$.Base.File = ($1.name != NULL) + gl_register_file file = ($1.name != NULL) ? $1.param_binding_type : PROGRAM_CONSTANT; - $$.Base.Index = $1.param_binding_begin; + set_src_reg(& $$, file, $1.param_binding_begin); } ; dstReg: resultBinding { - init_dst_reg(& $$); - $$.File = PROGRAM_OUTPUT; - $$.Index = $1; + set_dst_reg(& $$, PROGRAM_OUTPUT, $1); } | USED_IDENTIFIER /* temporaryReg | vertexResultReg */ { @@ -859,19 +853,15 @@ dstReg: resultBinding YYERROR; } - init_dst_reg(& $$); switch (s->type) { case at_temp: - $$.File = PROGRAM_TEMPORARY; - $$.Index = s->temp_binding; + set_dst_reg(& $$, PROGRAM_TEMPORARY, s->temp_binding); break; case at_output: - $$.File = PROGRAM_OUTPUT; - $$.Index = s->output_binding; + set_dst_reg(& $$, PROGRAM_OUTPUT, s->output_binding); break; default: - $$.File = s->param_binding_type; - $$.Index = s->param_binding_begin; + set_dst_reg(& $$, s->param_binding_type, s->param_binding_begin); break; } } @@ -2263,6 +2253,26 @@ init_dst_reg(struct prog_dst_register *r) } +/** Like init_dst_reg() but set the File and Index fields. */ +void +set_dst_reg(struct prog_dst_register *r, gl_register_file file, GLint index) +{ + const GLint maxIndex = 1 << INST_INDEX_BITS; + const GLint minIndex = 0; + ASSERT(index >= minIndex); + ASSERT(index <= maxIndex); + ASSERT(file == PROGRAM_TEMPORARY || + file == PROGRAM_ADDRESS || + file == PROGRAM_OUTPUT); + memset(r, 0, sizeof(*r)); + r->File = file; + r->Index = index; + r->WriteMask = WRITEMASK_XYZW; + r->CondMask = COND_TR; + r->CondSwizzle = SWIZZLE_NOOP; +} + + void init_src_reg(struct asm_src_register *r) { @@ -2273,6 +2283,23 @@ init_src_reg(struct asm_src_register *r) } +/** Like init_src_reg() but set the File and Index fields. */ +void +set_src_reg(struct asm_src_register *r, gl_register_file file, GLint index) +{ + const GLint maxIndex = (1 << INST_INDEX_BITS) - 1; + const GLint minIndex = -(1 << INST_INDEX_BITS); + ASSERT(index >= minIndex); + ASSERT(index <= maxIndex); + ASSERT(file < PROGRAM_FILE_MAX); + memset(r, 0, sizeof(*r)); + r->Base.File = file; + r->Base.Index = index; + r->Base.Swizzle = SWIZZLE_NOOP; + r->Symbol = NULL; +} + + /** * Validate the set of inputs used by a program * -- cgit v1.2.3 From 5e9f97f0eae5519b7273f0e17000b9d5152f3274 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 30 Oct 2009 19:06:56 -0600 Subject: ARB prog parser: regenerated files --- src/mesa/shader/program_parse.tab.c | 613 +++++++++++++++++++----------------- src/mesa/shader/program_parse.tab.h | 2 +- 2 files changed, 321 insertions(+), 294 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 6e4095eca6..7f45e0987d 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -353,8 +353,14 @@ static int validate_inputs(struct YYLTYPE *locp, static void init_dst_reg(struct prog_dst_register *r); +static void set_dst_reg(struct prog_dst_register *r, + gl_register_file file, GLint index); + static void init_src_reg(struct asm_src_register *r); +static void set_src_reg(struct asm_src_register *r, + gl_register_file file, GLint index); + static void asm_instruction_set_operands(struct asm_instruction *inst, const struct prog_dst_register *dst, const struct asm_src_register *src0, const struct asm_src_register *src1, const struct asm_src_register *src2); @@ -414,7 +420,7 @@ static struct asm_instruction *asm_instruction_copy_ctor( #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 116 "program_parse.y" +#line 122 "program_parse.y" { struct asm_instruction *inst; struct asm_symbol *sym; @@ -441,7 +447,7 @@ typedef union YYSTYPE } ext_swizzle; } /* Line 187 of yacc.c. */ -#line 445 "program_parse.tab.c" +#line 451 "program_parse.tab.c" YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 @@ -463,14 +469,14 @@ typedef struct YYLTYPE /* Copy the second part of user declarations. */ -#line 261 "program_parse.y" +#line 267 "program_parse.y" extern int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, void *yyscanner); /* Line 216 of yacc.c. */ -#line 474 "program_parse.tab.c" +#line 480 "program_parse.tab.c" #ifdef short # undef short @@ -871,35 +877,35 @@ static const yytype_int16 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 268, 268, 271, 279, 291, 292, 295, 317, 318, - 321, 336, 339, 344, 351, 352, 353, 354, 355, 356, - 357, 360, 361, 362, 365, 371, 377, 383, 390, 396, - 403, 447, 452, 462, 506, 512, 513, 514, 515, 516, - 517, 518, 519, 520, 521, 522, 523, 526, 538, 546, - 563, 570, 589, 600, 620, 645, 654, 687, 694, 709, - 759, 801, 812, 833, 843, 849, 880, 897, 897, 899, - 906, 918, 919, 920, 923, 937, 951, 969, 980, 992, - 994, 995, 996, 997, 1000, 1000, 1000, 1000, 1001, 1004, - 1008, 1013, 1020, 1027, 1034, 1057, 1080, 1081, 1082, 1083, - 1084, 1085, 1088, 1106, 1110, 1116, 1120, 1124, 1128, 1137, - 1146, 1150, 1155, 1161, 1172, 1172, 1173, 1175, 1179, 1183, - 1187, 1193, 1193, 1195, 1211, 1234, 1237, 1248, 1254, 1260, - 1261, 1268, 1274, 1280, 1288, 1294, 1300, 1308, 1314, 1320, - 1328, 1329, 1332, 1333, 1334, 1335, 1336, 1337, 1338, 1339, - 1340, 1341, 1342, 1345, 1354, 1358, 1362, 1368, 1377, 1381, - 1385, 1394, 1398, 1404, 1410, 1417, 1422, 1430, 1440, 1442, - 1450, 1456, 1460, 1464, 1470, 1481, 1490, 1494, 1499, 1503, - 1507, 1511, 1517, 1524, 1528, 1534, 1542, 1553, 1560, 1564, - 1570, 1580, 1591, 1595, 1613, 1622, 1625, 1631, 1635, 1639, - 1645, 1656, 1661, 1666, 1671, 1676, 1681, 1689, 1692, 1697, - 1710, 1718, 1729, 1737, 1737, 1739, 1739, 1741, 1751, 1756, - 1763, 1773, 1782, 1787, 1794, 1804, 1814, 1826, 1826, 1827, - 1827, 1829, 1839, 1847, 1857, 1865, 1873, 1882, 1893, 1897, - 1903, 1904, 1905, 1908, 1908, 1911, 1946, 1950, 1950, 1953, - 1959, 1967, 1980, 1989, 1998, 2002, 2011, 2020, 2031, 2038, - 2043, 2052, 2064, 2067, 2076, 2087, 2088, 2089, 2092, 2093, - 2094, 2097, 2098, 2101, 2102, 2105, 2106, 2109, 2120, 2131, - 2142, 2163, 2164 + 0, 274, 274, 277, 285, 297, 298, 301, 323, 324, + 327, 342, 345, 350, 357, 358, 359, 360, 361, 362, + 363, 366, 367, 368, 371, 377, 383, 389, 396, 402, + 409, 453, 458, 468, 512, 518, 519, 520, 521, 522, + 523, 524, 525, 526, 527, 528, 529, 532, 544, 552, + 569, 576, 593, 604, 624, 649, 656, 689, 696, 711, + 761, 800, 809, 830, 839, 843, 870, 887, 887, 889, + 896, 908, 909, 910, 913, 927, 941, 959, 970, 982, + 984, 985, 986, 987, 990, 990, 990, 990, 991, 994, + 998, 1003, 1010, 1017, 1024, 1047, 1070, 1071, 1072, 1073, + 1074, 1075, 1078, 1096, 1100, 1106, 1110, 1114, 1118, 1127, + 1136, 1140, 1145, 1151, 1162, 1162, 1163, 1165, 1169, 1173, + 1177, 1183, 1183, 1185, 1201, 1224, 1227, 1238, 1244, 1250, + 1251, 1258, 1264, 1270, 1278, 1284, 1290, 1298, 1304, 1310, + 1318, 1319, 1322, 1323, 1324, 1325, 1326, 1327, 1328, 1329, + 1330, 1331, 1332, 1335, 1344, 1348, 1352, 1358, 1367, 1371, + 1375, 1384, 1388, 1394, 1400, 1407, 1412, 1420, 1430, 1432, + 1440, 1446, 1450, 1454, 1460, 1471, 1480, 1484, 1489, 1493, + 1497, 1501, 1507, 1514, 1518, 1524, 1532, 1543, 1550, 1554, + 1560, 1570, 1581, 1585, 1603, 1612, 1615, 1621, 1625, 1629, + 1635, 1646, 1651, 1656, 1661, 1666, 1671, 1679, 1682, 1687, + 1700, 1708, 1719, 1727, 1727, 1729, 1729, 1731, 1741, 1746, + 1753, 1763, 1772, 1777, 1784, 1794, 1804, 1816, 1816, 1817, + 1817, 1819, 1829, 1837, 1847, 1855, 1863, 1872, 1883, 1887, + 1893, 1894, 1895, 1898, 1898, 1901, 1936, 1940, 1940, 1943, + 1949, 1957, 1970, 1979, 1988, 1992, 2001, 2010, 2021, 2028, + 2033, 2042, 2054, 2057, 2066, 2077, 2078, 2079, 2082, 2083, + 2084, 2087, 2088, 2091, 2092, 2095, 2096, 2099, 2110, 2121, + 2132, 2153, 2154 }; #endif @@ -2197,7 +2203,7 @@ yyreduce: switch (yyn) { case 3: -#line 272 "program_parse.y" +#line 278 "program_parse.y" { if (state->prog->Target != GL_VERTEX_PROGRAM_ARB) { yyerror(& (yylsp[(1) - (1)]), state, "invalid fragment program header"); @@ -2208,7 +2214,7 @@ yyreduce: break; case 4: -#line 280 "program_parse.y" +#line 286 "program_parse.y" { if (state->prog->Target != GL_FRAGMENT_PROGRAM_ARB) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex program header"); @@ -2221,7 +2227,7 @@ yyreduce: break; case 7: -#line 296 "program_parse.y" +#line 302 "program_parse.y" { int valid = 0; @@ -2244,7 +2250,7 @@ yyreduce: break; case 10: -#line 322 "program_parse.y" +#line 328 "program_parse.y" { if ((yyvsp[(1) - (2)].inst) != NULL) { if (state->inst_tail == NULL) { @@ -2262,7 +2268,7 @@ yyreduce: break; case 12: -#line 340 "program_parse.y" +#line 346 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumAluInstructions++; @@ -2270,7 +2276,7 @@ yyreduce: break; case 13: -#line 345 "program_parse.y" +#line 351 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumTexInstructions++; @@ -2278,49 +2284,49 @@ yyreduce: break; case 24: -#line 366 "program_parse.y" +#line 372 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_ARL, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} break; case 25: -#line 372 "program_parse.y" +#line 378 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (4)].temp_inst), & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} break; case 26: -#line 378 "program_parse.y" +#line 384 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (4)].temp_inst), & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} break; case 27: -#line 384 "program_parse.y" +#line 390 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (6)].temp_inst), & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); ;} break; case 28: -#line 391 "program_parse.y" +#line 397 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (6)].temp_inst), & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); ;} break; case 29: -#line 398 "program_parse.y" +#line 404 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (8)].temp_inst), & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), & (yyvsp[(6) - (8)].src_reg), & (yyvsp[(8) - (8)].src_reg)); ;} break; case 30: -#line 404 "program_parse.y" +#line 410 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (8)].temp_inst), & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), NULL, NULL); if ((yyval.inst) != NULL) { @@ -2365,7 +2371,7 @@ yyreduce: break; case 31: -#line 448 "program_parse.y" +#line 454 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_KIL, NULL, & (yyvsp[(2) - (2)].src_reg), NULL, NULL); state->fragment.UsesKill = 1; @@ -2373,7 +2379,7 @@ yyreduce: break; case 32: -#line 453 "program_parse.y" +#line 459 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_KIL_NV, NULL, NULL, NULL, NULL); (yyval.inst)->Base.DstReg.CondMask = (yyvsp[(2) - (2)].dst_reg).CondMask; @@ -2384,7 +2390,7 @@ yyreduce: break; case 33: -#line 463 "program_parse.y" +#line 469 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (12)].temp_inst), & (yyvsp[(2) - (12)].dst_reg), & (yyvsp[(4) - (12)].src_reg), & (yyvsp[(6) - (12)].src_reg), & (yyvsp[(8) - (12)].src_reg)); if ((yyval.inst) != NULL) { @@ -2429,74 +2435,74 @@ yyreduce: break; case 34: -#line 507 "program_parse.y" +#line 513 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; case 35: -#line 512 "program_parse.y" +#line 518 "program_parse.y" { (yyval.integer) = TEXTURE_1D_INDEX; ;} break; case 36: -#line 513 "program_parse.y" +#line 519 "program_parse.y" { (yyval.integer) = TEXTURE_2D_INDEX; ;} break; case 37: -#line 514 "program_parse.y" +#line 520 "program_parse.y" { (yyval.integer) = TEXTURE_3D_INDEX; ;} break; case 38: -#line 515 "program_parse.y" +#line 521 "program_parse.y" { (yyval.integer) = TEXTURE_CUBE_INDEX; ;} break; case 39: -#line 516 "program_parse.y" +#line 522 "program_parse.y" { (yyval.integer) = TEXTURE_RECT_INDEX; ;} break; case 40: -#line 517 "program_parse.y" +#line 523 "program_parse.y" { (yyval.integer) = -TEXTURE_1D_INDEX; ;} break; case 41: -#line 518 "program_parse.y" +#line 524 "program_parse.y" { (yyval.integer) = -TEXTURE_2D_INDEX; ;} break; case 42: -#line 519 "program_parse.y" +#line 525 "program_parse.y" { (yyval.integer) = -TEXTURE_RECT_INDEX; ;} break; case 43: -#line 520 "program_parse.y" +#line 526 "program_parse.y" { (yyval.integer) = TEXTURE_1D_ARRAY_INDEX; ;} break; case 44: -#line 521 "program_parse.y" +#line 527 "program_parse.y" { (yyval.integer) = TEXTURE_2D_ARRAY_INDEX; ;} break; case 45: -#line 522 "program_parse.y" +#line 528 "program_parse.y" { (yyval.integer) = -TEXTURE_1D_ARRAY_INDEX; ;} break; case 46: -#line 523 "program_parse.y" +#line 529 "program_parse.y" { (yyval.integer) = -TEXTURE_2D_ARRAY_INDEX; ;} break; case 47: -#line 527 "program_parse.y" +#line 533 "program_parse.y" { /* FIXME: Is this correct? Should the extenedSwizzle be applied * FIXME: to the existing swizzle? @@ -2509,7 +2515,7 @@ yyreduce: break; case 48: -#line 539 "program_parse.y" +#line 545 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (2)].src_reg); @@ -2520,7 +2526,7 @@ yyreduce: break; case 49: -#line 547 "program_parse.y" +#line 553 "program_parse.y" { (yyval.src_reg) = (yyvsp[(3) - (4)].src_reg); @@ -2538,7 +2544,7 @@ yyreduce: break; case 50: -#line 564 "program_parse.y" +#line 570 "program_parse.y" { (yyval.src_reg) = (yyvsp[(1) - (2)].src_reg); @@ -2548,7 +2554,7 @@ yyreduce: break; case 51: -#line 571 "program_parse.y" +#line 577 "program_parse.y" { struct asm_symbol temp_sym; @@ -2561,14 +2567,12 @@ yyreduce: temp_sym.param_binding_begin = ~0; initialize_symbol_from_const(state->prog, & temp_sym, & (yyvsp[(1) - (1)].vector)); - init_src_reg(& (yyval.src_reg)); - (yyval.src_reg).Base.File = PROGRAM_CONSTANT; - (yyval.src_reg).Base.Index = temp_sym.param_binding_begin; + set_src_reg(& (yyval.src_reg), PROGRAM_CONSTANT, temp_sym.param_binding_begin); ;} break; case 52: -#line 590 "program_parse.y" +#line 594 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); @@ -2582,7 +2586,7 @@ yyreduce: break; case 53: -#line 601 "program_parse.y" +#line 605 "program_parse.y" { (yyval.src_reg) = (yyvsp[(3) - (5)].src_reg); @@ -2602,7 +2606,7 @@ yyreduce: break; case 54: -#line 621 "program_parse.y" +#line 625 "program_parse.y" { (yyval.dst_reg) = (yyvsp[(1) - (3)].dst_reg); (yyval.dst_reg).WriteMask = (yyvsp[(2) - (3)].swiz_mask).mask; @@ -2628,17 +2632,15 @@ yyreduce: break; case 55: -#line 646 "program_parse.y" +#line 650 "program_parse.y" { - init_dst_reg(& (yyval.dst_reg)); - (yyval.dst_reg).File = PROGRAM_ADDRESS; - (yyval.dst_reg).Index = 0; + set_dst_reg(& (yyval.dst_reg), PROGRAM_ADDRESS, 0); (yyval.dst_reg).WriteMask = (yyvsp[(2) - (2)].swiz_mask).mask; ;} break; case 56: -#line 655 "program_parse.y" +#line 657 "program_parse.y" { const unsigned xyzw_valid = ((yyvsp[(1) - (7)].ext_swizzle).xyzw_valid << 0) @@ -2672,7 +2674,7 @@ yyreduce: break; case 57: -#line 688 "program_parse.y" +#line 690 "program_parse.y" { (yyval.ext_swizzle) = (yyvsp[(2) - (2)].ext_swizzle); (yyval.ext_swizzle).negate = ((yyvsp[(1) - (2)].negate)) ? 1 : 0; @@ -2680,7 +2682,7 @@ yyreduce: break; case 58: -#line 695 "program_parse.y" +#line 697 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) != 0) && ((yyvsp[(1) - (1)].integer) != 1)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2698,7 +2700,7 @@ yyreduce: break; case 59: -#line 710 "program_parse.y" +#line 712 "program_parse.y" { if (strlen((yyvsp[(1) - (1)].string)) > 1) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2749,7 +2751,7 @@ yyreduce: break; case 60: -#line 760 "program_parse.y" +#line 762 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2769,16 +2771,13 @@ yyreduce: init_src_reg(& (yyval.src_reg)); switch (s->type) { case at_temp: - (yyval.src_reg).Base.File = PROGRAM_TEMPORARY; - (yyval.src_reg).Base.Index = s->temp_binding; + set_src_reg(& (yyval.src_reg), PROGRAM_TEMPORARY, s->temp_binding); break; case at_param: - (yyval.src_reg).Base.File = s->param_binding_type; - (yyval.src_reg).Base.Index = s->param_binding_begin; + set_src_reg(& (yyval.src_reg), s->param_binding_type, s->param_binding_begin); break; case at_attrib: - (yyval.src_reg).Base.File = PROGRAM_INPUT; - (yyval.src_reg).Base.Index = s->attrib_binding; + set_src_reg(& (yyval.src_reg), PROGRAM_INPUT, s->attrib_binding); state->prog->InputsRead |= (1U << (yyval.src_reg).Base.Index); if (!validate_inputs(& (yylsp[(1) - (1)]), state)) { @@ -2794,11 +2793,9 @@ yyreduce: break; case 61: -#line 802 "program_parse.y" +#line 801 "program_parse.y" { - init_src_reg(& (yyval.src_reg)); - (yyval.src_reg).Base.File = PROGRAM_INPUT; - (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].attrib); + set_src_reg(& (yyval.src_reg), PROGRAM_INPUT, (yyvsp[(1) - (1)].attrib)); state->prog->InputsRead |= (1U << (yyval.src_reg).Base.Index); if (!validate_inputs(& (yylsp[(1) - (1)]), state)) { @@ -2808,7 +2805,7 @@ yyreduce: break; case 62: -#line 813 "program_parse.y" +#line 810 "program_parse.y" { if (! (yyvsp[(3) - (4)].src_reg).Base.RelAddr && ((unsigned) (yyvsp[(3) - (4)].src_reg).Base.Index >= (yyvsp[(1) - (4)].sym)->param_binding_length)) { @@ -2832,27 +2829,24 @@ yyreduce: break; case 63: -#line 834 "program_parse.y" +#line 831 "program_parse.y" { - init_src_reg(& (yyval.src_reg)); - (yyval.src_reg).Base.File = ((yyvsp[(1) - (1)].temp_sym).name != NULL) + gl_register_file file = ((yyvsp[(1) - (1)].temp_sym).name != NULL) ? (yyvsp[(1) - (1)].temp_sym).param_binding_type : PROGRAM_CONSTANT; - (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].temp_sym).param_binding_begin; + set_src_reg(& (yyval.src_reg), file, (yyvsp[(1) - (1)].temp_sym).param_binding_begin); ;} break; case 64: -#line 844 "program_parse.y" +#line 840 "program_parse.y" { - init_dst_reg(& (yyval.dst_reg)); - (yyval.dst_reg).File = PROGRAM_OUTPUT; - (yyval.dst_reg).Index = (yyvsp[(1) - (1)].result); + set_dst_reg(& (yyval.dst_reg), PROGRAM_OUTPUT, (yyvsp[(1) - (1)].result)); ;} break; case 65: -#line 850 "program_parse.y" +#line 844 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2865,26 +2859,22 @@ yyreduce: YYERROR; } - init_dst_reg(& (yyval.dst_reg)); switch (s->type) { case at_temp: - (yyval.dst_reg).File = PROGRAM_TEMPORARY; - (yyval.dst_reg).Index = s->temp_binding; + set_dst_reg(& (yyval.dst_reg), PROGRAM_TEMPORARY, s->temp_binding); break; case at_output: - (yyval.dst_reg).File = PROGRAM_OUTPUT; - (yyval.dst_reg).Index = s->output_binding; + set_dst_reg(& (yyval.dst_reg), PROGRAM_OUTPUT, s->output_binding); break; default: - (yyval.dst_reg).File = s->param_binding_type; - (yyval.dst_reg).Index = s->param_binding_begin; + set_dst_reg(& (yyval.dst_reg), s->param_binding_type, s->param_binding_begin); break; } ;} break; case 66: -#line 881 "program_parse.y" +#line 871 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2902,7 +2892,7 @@ yyreduce: break; case 69: -#line 900 "program_parse.y" +#line 890 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].integer); @@ -2910,7 +2900,7 @@ yyreduce: break; case 70: -#line 907 "program_parse.y" +#line 897 "program_parse.y" { /* FINISHME: Add support for multiple address registers. */ @@ -2923,22 +2913,22 @@ yyreduce: break; case 71: -#line 918 "program_parse.y" +#line 908 "program_parse.y" { (yyval.integer) = 0; ;} break; case 72: -#line 919 "program_parse.y" +#line 909 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; case 73: -#line 920 "program_parse.y" +#line 910 "program_parse.y" { (yyval.integer) = -(yyvsp[(2) - (2)].integer); ;} break; case 74: -#line 924 "program_parse.y" +#line 914 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 63)) { char s[100]; @@ -2953,7 +2943,7 @@ yyreduce: break; case 75: -#line 938 "program_parse.y" +#line 928 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 64)) { char s[100]; @@ -2968,7 +2958,7 @@ yyreduce: break; case 76: -#line 952 "program_parse.y" +#line 942 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2987,7 +2977,7 @@ yyreduce: break; case 77: -#line 970 "program_parse.y" +#line 960 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, "invalid address component selector"); @@ -2999,7 +2989,7 @@ yyreduce: break; case 78: -#line 981 "program_parse.y" +#line 971 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, @@ -3012,31 +3002,31 @@ yyreduce: break; case 83: -#line 997 "program_parse.y" +#line 987 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 88: -#line 1001 "program_parse.y" +#line 991 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 89: -#line 1005 "program_parse.y" +#line 995 "program_parse.y" { (yyval.dst_reg) = (yyvsp[(2) - (3)].dst_reg); ;} break; case 90: -#line 1009 "program_parse.y" +#line 999 "program_parse.y" { (yyval.dst_reg) = (yyvsp[(2) - (3)].dst_reg); ;} break; case 91: -#line 1013 "program_parse.y" +#line 1003 "program_parse.y" { (yyval.dst_reg).CondMask = COND_TR; (yyval.dst_reg).CondSwizzle = SWIZZLE_NOOP; @@ -3045,7 +3035,7 @@ yyreduce: break; case 92: -#line 1021 "program_parse.y" +#line 1011 "program_parse.y" { (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); (yyval.dst_reg).CondSwizzle = (yyvsp[(2) - (2)].swiz_mask).swizzle; @@ -3053,7 +3043,7 @@ yyreduce: break; case 93: -#line 1028 "program_parse.y" +#line 1018 "program_parse.y" { (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); (yyval.dst_reg).CondSwizzle = (yyvsp[(2) - (2)].swiz_mask).swizzle; @@ -3061,7 +3051,7 @@ yyreduce: break; case 94: -#line 1035 "program_parse.y" +#line 1025 "program_parse.y" { const int cond = _mesa_parse_cc((yyvsp[(1) - (1)].string)); if ((cond == 0) || ((yyvsp[(1) - (1)].string)[2] != '\0')) { @@ -3085,7 +3075,7 @@ yyreduce: break; case 95: -#line 1058 "program_parse.y" +#line 1048 "program_parse.y" { const int cond = _mesa_parse_cc((yyvsp[(1) - (1)].string)); if ((cond == 0) || ((yyvsp[(1) - (1)].string)[2] != '\0')) { @@ -3109,7 +3099,7 @@ yyreduce: break; case 102: -#line 1089 "program_parse.y" +#line 1079 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_attrib, & (yylsp[(2) - (4)])); @@ -3128,42 +3118,42 @@ yyreduce: break; case 103: -#line 1107 "program_parse.y" +#line 1097 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} break; case 104: -#line 1111 "program_parse.y" +#line 1101 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} break; case 105: -#line 1117 "program_parse.y" +#line 1107 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_POS; ;} break; case 106: -#line 1121 "program_parse.y" +#line 1111 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_WEIGHT; ;} break; case 107: -#line 1125 "program_parse.y" +#line 1115 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_NORMAL; ;} break; case 108: -#line 1129 "program_parse.y" +#line 1119 "program_parse.y" { if (!state->ctx->Extensions.EXT_secondary_color) { yyerror(& (yylsp[(2) - (2)]), state, "GL_EXT_secondary_color not supported"); @@ -3175,7 +3165,7 @@ yyreduce: break; case 109: -#line 1138 "program_parse.y" +#line 1128 "program_parse.y" { if (!state->ctx->Extensions.EXT_fog_coord) { yyerror(& (yylsp[(1) - (1)]), state, "GL_EXT_fog_coord not supported"); @@ -3187,14 +3177,14 @@ yyreduce: break; case 110: -#line 1147 "program_parse.y" +#line 1137 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} break; case 111: -#line 1151 "program_parse.y" +#line 1141 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; @@ -3202,14 +3192,14 @@ yyreduce: break; case 112: -#line 1156 "program_parse.y" +#line 1146 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_GENERIC0 + (yyvsp[(3) - (4)].integer); ;} break; case 113: -#line 1162 "program_parse.y" +#line 1152 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxAttribs) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex attribute reference"); @@ -3221,35 +3211,35 @@ yyreduce: break; case 117: -#line 1176 "program_parse.y" +#line 1166 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_WPOS; ;} break; case 118: -#line 1180 "program_parse.y" +#line 1170 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_COL0 + (yyvsp[(2) - (2)].integer); ;} break; case 119: -#line 1184 "program_parse.y" +#line 1174 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_FOGC; ;} break; case 120: -#line 1188 "program_parse.y" +#line 1178 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} break; case 123: -#line 1196 "program_parse.y" +#line 1186 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (3)].string), at_param, & (yylsp[(2) - (3)])); @@ -3266,7 +3256,7 @@ yyreduce: break; case 124: -#line 1212 "program_parse.y" +#line 1202 "program_parse.y" { if (((yyvsp[(4) - (6)].integer) != 0) && ((unsigned) (yyvsp[(4) - (6)].integer) != (yyvsp[(6) - (6)].temp_sym).param_binding_length)) { yyerror(& (yylsp[(4) - (6)]), state, @@ -3289,14 +3279,14 @@ yyreduce: break; case 125: -#line 1234 "program_parse.y" +#line 1224 "program_parse.y" { (yyval.integer) = 0; ;} break; case 126: -#line 1238 "program_parse.y" +#line 1228 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 1) || ((unsigned) (yyvsp[(1) - (1)].integer) > state->limits->MaxParameters)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid parameter array size"); @@ -3308,21 +3298,21 @@ yyreduce: break; case 127: -#line 1249 "program_parse.y" +#line 1239 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(2) - (2)].temp_sym); ;} break; case 128: -#line 1255 "program_parse.y" +#line 1245 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(3) - (4)].temp_sym); ;} break; case 130: -#line 1262 "program_parse.y" +#line 1252 "program_parse.y" { (yyvsp[(1) - (3)].temp_sym).param_binding_length += (yyvsp[(3) - (3)].temp_sym).param_binding_length; (yyval.temp_sym) = (yyvsp[(1) - (3)].temp_sym); @@ -3330,7 +3320,7 @@ yyreduce: break; case 131: -#line 1269 "program_parse.y" +#line 1259 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3339,7 +3329,7 @@ yyreduce: break; case 132: -#line 1275 "program_parse.y" +#line 1265 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3348,7 +3338,7 @@ yyreduce: break; case 133: -#line 1281 "program_parse.y" +#line 1271 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3357,7 +3347,7 @@ yyreduce: break; case 134: -#line 1289 "program_parse.y" +#line 1279 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3366,7 +3356,7 @@ yyreduce: break; case 135: -#line 1295 "program_parse.y" +#line 1285 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3375,7 +3365,7 @@ yyreduce: break; case 136: -#line 1301 "program_parse.y" +#line 1291 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3384,7 +3374,7 @@ yyreduce: break; case 137: -#line 1309 "program_parse.y" +#line 1299 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3393,7 +3383,7 @@ yyreduce: break; case 138: -#line 1315 "program_parse.y" +#line 1305 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3402,7 +3392,7 @@ yyreduce: break; case 139: -#line 1321 "program_parse.y" +#line 1311 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3411,72 +3401,72 @@ yyreduce: break; case 140: -#line 1328 "program_parse.y" +#line 1318 "program_parse.y" { memcpy((yyval.state), (yyvsp[(1) - (1)].state), sizeof((yyval.state))); ;} break; case 141: -#line 1329 "program_parse.y" +#line 1319 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 142: -#line 1332 "program_parse.y" +#line 1322 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 143: -#line 1333 "program_parse.y" +#line 1323 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 144: -#line 1334 "program_parse.y" +#line 1324 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 145: -#line 1335 "program_parse.y" +#line 1325 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 146: -#line 1336 "program_parse.y" +#line 1326 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 147: -#line 1337 "program_parse.y" +#line 1327 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 148: -#line 1338 "program_parse.y" +#line 1328 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 149: -#line 1339 "program_parse.y" +#line 1329 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 150: -#line 1340 "program_parse.y" +#line 1330 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 151: -#line 1341 "program_parse.y" +#line 1331 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 152: -#line 1342 "program_parse.y" +#line 1332 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 153: -#line 1346 "program_parse.y" +#line 1336 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_MATERIAL; @@ -3486,28 +3476,28 @@ yyreduce: break; case 154: -#line 1355 "program_parse.y" +#line 1345 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 155: -#line 1359 "program_parse.y" +#line 1349 "program_parse.y" { (yyval.integer) = STATE_EMISSION; ;} break; case 156: -#line 1363 "program_parse.y" +#line 1353 "program_parse.y" { (yyval.integer) = STATE_SHININESS; ;} break; case 157: -#line 1369 "program_parse.y" +#line 1359 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHT; @@ -3517,21 +3507,21 @@ yyreduce: break; case 158: -#line 1378 "program_parse.y" +#line 1368 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 159: -#line 1382 "program_parse.y" +#line 1372 "program_parse.y" { (yyval.integer) = STATE_POSITION; ;} break; case 160: -#line 1386 "program_parse.y" +#line 1376 "program_parse.y" { if (!state->ctx->Extensions.EXT_point_parameters) { yyerror(& (yylsp[(1) - (1)]), state, "GL_ARB_point_parameters not supported"); @@ -3543,28 +3533,28 @@ yyreduce: break; case 161: -#line 1395 "program_parse.y" +#line 1385 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; case 162: -#line 1399 "program_parse.y" +#line 1389 "program_parse.y" { (yyval.integer) = STATE_HALF_VECTOR; ;} break; case 163: -#line 1405 "program_parse.y" +#line 1395 "program_parse.y" { (yyval.integer) = STATE_SPOT_DIRECTION; ;} break; case 164: -#line 1411 "program_parse.y" +#line 1401 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (2)].state)[1]; @@ -3572,7 +3562,7 @@ yyreduce: break; case 165: -#line 1418 "program_parse.y" +#line 1408 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_AMBIENT; @@ -3580,7 +3570,7 @@ yyreduce: break; case 166: -#line 1423 "program_parse.y" +#line 1413 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_SCENECOLOR; @@ -3589,7 +3579,7 @@ yyreduce: break; case 167: -#line 1431 "program_parse.y" +#line 1421 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTPROD; @@ -3600,7 +3590,7 @@ yyreduce: break; case 169: -#line 1443 "program_parse.y" +#line 1433 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(3) - (3)].integer); @@ -3609,35 +3599,35 @@ yyreduce: break; case 170: -#line 1451 "program_parse.y" +#line 1441 "program_parse.y" { (yyval.integer) = STATE_TEXENV_COLOR; ;} break; case 171: -#line 1457 "program_parse.y" +#line 1447 "program_parse.y" { (yyval.integer) = STATE_AMBIENT; ;} break; case 172: -#line 1461 "program_parse.y" +#line 1451 "program_parse.y" { (yyval.integer) = STATE_DIFFUSE; ;} break; case 173: -#line 1465 "program_parse.y" +#line 1455 "program_parse.y" { (yyval.integer) = STATE_SPECULAR; ;} break; case 174: -#line 1471 "program_parse.y" +#line 1461 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxLights) { yyerror(& (yylsp[(1) - (1)]), state, "invalid light selector"); @@ -3649,7 +3639,7 @@ yyreduce: break; case 175: -#line 1482 "program_parse.y" +#line 1472 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_TEXGEN; @@ -3659,49 +3649,49 @@ yyreduce: break; case 176: -#line 1491 "program_parse.y" +#line 1481 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S; ;} break; case 177: -#line 1495 "program_parse.y" +#line 1485 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_OBJECT_S; ;} break; case 178: -#line 1500 "program_parse.y" +#line 1490 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S; ;} break; case 179: -#line 1504 "program_parse.y" +#line 1494 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S; ;} break; case 180: -#line 1508 "program_parse.y" +#line 1498 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S; ;} break; case 181: -#line 1512 "program_parse.y" +#line 1502 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S; ;} break; case 182: -#line 1518 "program_parse.y" +#line 1508 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); @@ -3709,21 +3699,21 @@ yyreduce: break; case 183: -#line 1525 "program_parse.y" +#line 1515 "program_parse.y" { (yyval.integer) = STATE_FOG_COLOR; ;} break; case 184: -#line 1529 "program_parse.y" +#line 1519 "program_parse.y" { (yyval.integer) = STATE_FOG_PARAMS; ;} break; case 185: -#line 1535 "program_parse.y" +#line 1525 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_CLIPPLANE; @@ -3732,7 +3722,7 @@ yyreduce: break; case 186: -#line 1543 "program_parse.y" +#line 1533 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxClipPlanes) { yyerror(& (yylsp[(1) - (1)]), state, "invalid clip plane selector"); @@ -3744,7 +3734,7 @@ yyreduce: break; case 187: -#line 1554 "program_parse.y" +#line 1544 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); @@ -3752,21 +3742,21 @@ yyreduce: break; case 188: -#line 1561 "program_parse.y" +#line 1551 "program_parse.y" { (yyval.integer) = STATE_POINT_SIZE; ;} break; case 189: -#line 1565 "program_parse.y" +#line 1555 "program_parse.y" { (yyval.integer) = STATE_POINT_ATTENUATION; ;} break; case 190: -#line 1571 "program_parse.y" +#line 1561 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (5)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (5)].state)[1]; @@ -3777,7 +3767,7 @@ yyreduce: break; case 191: -#line 1581 "program_parse.y" +#line 1571 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (2)].state)[1]; @@ -3788,7 +3778,7 @@ yyreduce: break; case 192: -#line 1591 "program_parse.y" +#line 1581 "program_parse.y" { (yyval.state)[2] = 0; (yyval.state)[3] = 3; @@ -3796,7 +3786,7 @@ yyreduce: break; case 193: -#line 1596 "program_parse.y" +#line 1586 "program_parse.y" { /* It seems logical that the matrix row range specifier would have * to specify a range or more than one row (i.e., $5 > $3). @@ -3815,7 +3805,7 @@ yyreduce: break; case 194: -#line 1614 "program_parse.y" +#line 1604 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (3)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (3)].state)[1]; @@ -3824,42 +3814,42 @@ yyreduce: break; case 195: -#line 1622 "program_parse.y" +#line 1612 "program_parse.y" { (yyval.integer) = 0; ;} break; case 196: -#line 1626 "program_parse.y" +#line 1616 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 197: -#line 1632 "program_parse.y" +#line 1622 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVERSE; ;} break; case 198: -#line 1636 "program_parse.y" +#line 1626 "program_parse.y" { (yyval.integer) = STATE_MATRIX_TRANSPOSE; ;} break; case 199: -#line 1640 "program_parse.y" +#line 1630 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVTRANS; ;} break; case 200: -#line 1646 "program_parse.y" +#line 1636 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) > 3) { yyerror(& (yylsp[(1) - (1)]), state, "invalid matrix row reference"); @@ -3871,7 +3861,7 @@ yyreduce: break; case 201: -#line 1657 "program_parse.y" +#line 1647 "program_parse.y" { (yyval.state)[0] = STATE_MODELVIEW_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); @@ -3879,7 +3869,7 @@ yyreduce: break; case 202: -#line 1662 "program_parse.y" +#line 1652 "program_parse.y" { (yyval.state)[0] = STATE_PROJECTION_MATRIX; (yyval.state)[1] = 0; @@ -3887,7 +3877,7 @@ yyreduce: break; case 203: -#line 1667 "program_parse.y" +#line 1657 "program_parse.y" { (yyval.state)[0] = STATE_MVP_MATRIX; (yyval.state)[1] = 0; @@ -3895,7 +3885,7 @@ yyreduce: break; case 204: -#line 1672 "program_parse.y" +#line 1662 "program_parse.y" { (yyval.state)[0] = STATE_TEXTURE_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); @@ -3903,7 +3893,7 @@ yyreduce: break; case 205: -#line 1677 "program_parse.y" +#line 1667 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; @@ -3911,7 +3901,7 @@ yyreduce: break; case 206: -#line 1682 "program_parse.y" +#line 1672 "program_parse.y" { (yyval.state)[0] = STATE_PROGRAM_MATRIX; (yyval.state)[1] = (yyvsp[(3) - (4)].integer); @@ -3919,21 +3909,21 @@ yyreduce: break; case 207: -#line 1689 "program_parse.y" +#line 1679 "program_parse.y" { (yyval.integer) = 0; ;} break; case 208: -#line 1693 "program_parse.y" +#line 1683 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 209: -#line 1698 "program_parse.y" +#line 1688 "program_parse.y" { /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix * zero is valid. @@ -3948,7 +3938,7 @@ yyreduce: break; case 210: -#line 1711 "program_parse.y" +#line 1701 "program_parse.y" { /* Since GL_ARB_matrix_palette isn't supported, just let any value * through here. The error will be generated later. @@ -3958,7 +3948,7 @@ yyreduce: break; case 211: -#line 1719 "program_parse.y" +#line 1709 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxProgramMatrices) { yyerror(& (yylsp[(1) - (1)]), state, "invalid program matrix selector"); @@ -3970,7 +3960,7 @@ yyreduce: break; case 212: -#line 1730 "program_parse.y" +#line 1720 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_DEPTH_RANGE; @@ -3978,7 +3968,7 @@ yyreduce: break; case 217: -#line 1742 "program_parse.y" +#line 1732 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3989,7 +3979,7 @@ yyreduce: break; case 218: -#line 1752 "program_parse.y" +#line 1742 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); @@ -3997,7 +3987,7 @@ yyreduce: break; case 219: -#line 1757 "program_parse.y" +#line 1747 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); @@ -4005,7 +3995,7 @@ yyreduce: break; case 220: -#line 1764 "program_parse.y" +#line 1754 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4016,7 +4006,7 @@ yyreduce: break; case 221: -#line 1774 "program_parse.y" +#line 1764 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4027,7 +4017,7 @@ yyreduce: break; case 222: -#line 1783 "program_parse.y" +#line 1773 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); @@ -4035,7 +4025,7 @@ yyreduce: break; case 223: -#line 1788 "program_parse.y" +#line 1778 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); @@ -4043,7 +4033,7 @@ yyreduce: break; case 224: -#line 1795 "program_parse.y" +#line 1785 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4054,7 +4044,7 @@ yyreduce: break; case 225: -#line 1805 "program_parse.y" +#line 1795 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxEnvParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid environment parameter reference"); @@ -4065,7 +4055,7 @@ yyreduce: break; case 226: -#line 1815 "program_parse.y" +#line 1805 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxLocalParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid local parameter reference"); @@ -4076,7 +4066,7 @@ yyreduce: break; case 231: -#line 1830 "program_parse.y" +#line 1820 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -4087,7 +4077,7 @@ yyreduce: break; case 232: -#line 1840 "program_parse.y" +#line 1830 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -4098,7 +4088,7 @@ yyreduce: break; case 233: -#line 1848 "program_parse.y" +#line 1838 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (float) (yyvsp[(1) - (1)].integer); @@ -4109,7 +4099,7 @@ yyreduce: break; case 234: -#line 1858 "program_parse.y" +#line 1848 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (3)].real); @@ -4120,7 +4110,7 @@ yyreduce: break; case 235: -#line 1866 "program_parse.y" +#line 1856 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (5)].real); @@ -4131,7 +4121,7 @@ yyreduce: break; case 236: -#line 1875 "program_parse.y" +#line 1865 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (7)].real); @@ -4142,7 +4132,7 @@ yyreduce: break; case 237: -#line 1884 "program_parse.y" +#line 1874 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (9)].real); @@ -4153,41 +4143,41 @@ yyreduce: break; case 238: -#line 1894 "program_parse.y" +#line 1884 "program_parse.y" { (yyval.real) = ((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].real) : (yyvsp[(2) - (2)].real); ;} break; case 239: -#line 1898 "program_parse.y" +#line 1888 "program_parse.y" { (yyval.real) = (float)(((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].integer) : (yyvsp[(2) - (2)].integer)); ;} break; case 240: -#line 1903 "program_parse.y" +#line 1893 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 241: -#line 1904 "program_parse.y" +#line 1894 "program_parse.y" { (yyval.negate) = TRUE; ;} break; case 242: -#line 1905 "program_parse.y" +#line 1895 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 243: -#line 1908 "program_parse.y" +#line 1898 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; case 245: -#line 1912 "program_parse.y" +#line 1902 "program_parse.y" { /* NV_fragment_program_option defines the size qualifiers in a * fairly broken way. "SHORT" or "LONG" can optionally be used @@ -4224,18 +4214,18 @@ yyreduce: break; case 246: -#line 1946 "program_parse.y" +#line 1936 "program_parse.y" { ;} break; case 247: -#line 1950 "program_parse.y" +#line 1940 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 249: -#line 1954 "program_parse.y" +#line 1944 "program_parse.y" { if (!declare_variable(state, (yyvsp[(3) - (3)].string), (yyvsp[(0) - (3)].integer), & (yylsp[(3) - (3)]))) { YYERROR; @@ -4244,7 +4234,7 @@ yyreduce: break; case 250: -#line 1960 "program_parse.y" +#line 1950 "program_parse.y" { if (!declare_variable(state, (yyvsp[(1) - (1)].string), (yyvsp[(0) - (1)].integer), & (yylsp[(1) - (1)]))) { YYERROR; @@ -4253,7 +4243,7 @@ yyreduce: break; case 251: -#line 1968 "program_parse.y" +#line 1958 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(3) - (5)].string), at_output, & (yylsp[(3) - (5)])); @@ -4267,7 +4257,7 @@ yyreduce: break; case 252: -#line 1981 "program_parse.y" +#line 1971 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_HPOS; @@ -4279,7 +4269,7 @@ yyreduce: break; case 253: -#line 1990 "program_parse.y" +#line 1980 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_FOGC; @@ -4291,14 +4281,14 @@ yyreduce: break; case 254: -#line 1999 "program_parse.y" +#line 1989 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (2)].result); ;} break; case 255: -#line 2003 "program_parse.y" +#line 1993 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_PSIZ; @@ -4310,7 +4300,7 @@ yyreduce: break; case 256: -#line 2012 "program_parse.y" +#line 2002 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_TEX0 + (yyvsp[(3) - (3)].integer); @@ -4322,7 +4312,7 @@ yyreduce: break; case 257: -#line 2021 "program_parse.y" +#line 2011 "program_parse.y" { if (state->mode == ARB_fragment) { (yyval.result) = FRAG_RESULT_DEPTH; @@ -4334,14 +4324,14 @@ yyreduce: break; case 258: -#line 2032 "program_parse.y" +#line 2022 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (3)].integer) + (yyvsp[(3) - (3)].integer); ;} break; case 259: -#line 2038 "program_parse.y" +#line 2028 "program_parse.y" { (yyval.integer) = (state->mode == ARB_vertex) ? VERT_RESULT_COL0 @@ -4350,7 +4340,7 @@ yyreduce: break; case 260: -#line 2044 "program_parse.y" +#line 2034 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_COL0; @@ -4362,7 +4352,7 @@ yyreduce: break; case 261: -#line 2053 "program_parse.y" +#line 2043 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_BFC0; @@ -4374,14 +4364,14 @@ yyreduce: break; case 262: -#line 2064 "program_parse.y" +#line 2054 "program_parse.y" { (yyval.integer) = 0; ;} break; case 263: -#line 2068 "program_parse.y" +#line 2058 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 0; @@ -4393,7 +4383,7 @@ yyreduce: break; case 264: -#line 2077 "program_parse.y" +#line 2067 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 1; @@ -4405,67 +4395,67 @@ yyreduce: break; case 265: -#line 2087 "program_parse.y" +#line 2077 "program_parse.y" { (yyval.integer) = 0; ;} break; case 266: -#line 2088 "program_parse.y" +#line 2078 "program_parse.y" { (yyval.integer) = 0; ;} break; case 267: -#line 2089 "program_parse.y" +#line 2079 "program_parse.y" { (yyval.integer) = 1; ;} break; case 268: -#line 2092 "program_parse.y" +#line 2082 "program_parse.y" { (yyval.integer) = 0; ;} break; case 269: -#line 2093 "program_parse.y" +#line 2083 "program_parse.y" { (yyval.integer) = 0; ;} break; case 270: -#line 2094 "program_parse.y" +#line 2084 "program_parse.y" { (yyval.integer) = 1; ;} break; case 271: -#line 2097 "program_parse.y" +#line 2087 "program_parse.y" { (yyval.integer) = 0; ;} break; case 272: -#line 2098 "program_parse.y" +#line 2088 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 273: -#line 2101 "program_parse.y" +#line 2091 "program_parse.y" { (yyval.integer) = 0; ;} break; case 274: -#line 2102 "program_parse.y" +#line 2092 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 275: -#line 2105 "program_parse.y" +#line 2095 "program_parse.y" { (yyval.integer) = 0; ;} break; case 276: -#line 2106 "program_parse.y" +#line 2096 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 277: -#line 2110 "program_parse.y" +#line 2100 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture coordinate unit selector"); @@ -4477,7 +4467,7 @@ yyreduce: break; case 278: -#line 2121 "program_parse.y" +#line 2111 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture image unit selector"); @@ -4489,7 +4479,7 @@ yyreduce: break; case 279: -#line 2132 "program_parse.y" +#line 2122 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture unit selector"); @@ -4501,7 +4491,7 @@ yyreduce: break; case 280: -#line 2143 "program_parse.y" +#line 2133 "program_parse.y" { struct asm_symbol *exist = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(2) - (4)].string)); @@ -4524,7 +4514,7 @@ yyreduce: /* Line 1267 of yacc.c. */ -#line 4528 "program_parse.tab.c" +#line 4518 "program_parse.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -4744,7 +4734,7 @@ yyreturn: } -#line 2167 "program_parse.y" +#line 2157 "program_parse.y" void @@ -4844,6 +4834,26 @@ init_dst_reg(struct prog_dst_register *r) } +/** Like init_dst_reg() but set the File and Index fields. */ +void +set_dst_reg(struct prog_dst_register *r, gl_register_file file, GLint index) +{ + const GLint maxIndex = 1 << INST_INDEX_BITS; + const GLint minIndex = 0; + ASSERT(index >= minIndex); + ASSERT(index <= maxIndex); + ASSERT(file == PROGRAM_TEMPORARY || + file == PROGRAM_ADDRESS || + file == PROGRAM_OUTPUT); + memset(r, 0, sizeof(*r)); + r->File = file; + r->Index = index; + r->WriteMask = WRITEMASK_XYZW; + r->CondMask = COND_TR; + r->CondSwizzle = SWIZZLE_NOOP; +} + + void init_src_reg(struct asm_src_register *r) { @@ -4854,6 +4864,23 @@ init_src_reg(struct asm_src_register *r) } +/** Like init_src_reg() but set the File and Index fields. */ +void +set_src_reg(struct asm_src_register *r, gl_register_file file, GLint index) +{ + const GLint maxIndex = (1 << INST_INDEX_BITS) - 1; + const GLint minIndex = -(1 << INST_INDEX_BITS); + ASSERT(index >= minIndex); + ASSERT(index <= maxIndex); + ASSERT(file < PROGRAM_FILE_MAX); + memset(r, 0, sizeof(*r)); + r->Base.File = file; + r->Base.Index = index; + r->Base.Swizzle = SWIZZLE_NOOP; + r->Symbol = NULL; +} + + /** * Validate the set of inputs used by a program * diff --git a/src/mesa/shader/program_parse.tab.h b/src/mesa/shader/program_parse.tab.h index ae6dd8c34e..25048065c1 100644 --- a/src/mesa/shader/program_parse.tab.h +++ b/src/mesa/shader/program_parse.tab.h @@ -258,7 +258,7 @@ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 116 "program_parse.y" +#line 122 "program_parse.y" { struct asm_instruction *inst; struct asm_symbol *sym; -- cgit v1.2.3 From 5cf7c8e2d58a877bfc786f866d4e0d363ddd22aa Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sat, 31 Oct 2009 15:48:59 +1000 Subject: radeon: use _mesa_get_current_tex_unit --- src/mesa/drivers/dri/radeon/radeon_texstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_texstate.c b/src/mesa/drivers/dri/radeon/radeon_texstate.c index 0fd9a138d6..d6e8d4984a 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texstate.c +++ b/src/mesa/drivers/dri/radeon/radeon_texstate.c @@ -661,7 +661,7 @@ void radeonSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_ rmesa = pDRICtx->driverPrivate; rfb = dPriv->driverPrivate; - texUnit = &radeon->glCtx->Texture.Unit[radeon->glCtx->Texture.CurrentUnit]; + texUnit = _mesa_get_current_tex_unit(radeon->glCtx); texObj = _mesa_select_tex_object(radeon->glCtx, texUnit, target); texImage = _mesa_get_tex_image(radeon->glCtx, texObj, target, 0); -- cgit v1.2.3 From 73b45b06690c95cf24cb6f9a81d61269ad51f9dd Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sat, 31 Oct 2009 21:23:37 +1000 Subject: radeon: add missing include --- src/mesa/drivers/dri/radeon/radeon_texstate.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_texstate.c b/src/mesa/drivers/dri/radeon/radeon_texstate.c index d6e8d4984a..429977a8bc 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texstate.c +++ b/src/mesa/drivers/dri/radeon/radeon_texstate.c @@ -39,6 +39,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/context.h" #include "main/macros.h" #include "main/teximage.h" +#include "main/texstate.h" #include "main/texobj.h" #include "main/enums.h" -- cgit v1.2.3 From c02cd82b463661def7842f910dc561313559df80 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 2 Nov 2009 06:52:05 -0700 Subject: mesa: fix incorrect approx bits/channel for fxt1 formats See bug 24806. --- src/mesa/main/formats.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index e9b33e489a..7d0e2d2914 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -444,7 +444,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = "MESA_FORMAT_RGB_FXT1", GL_RGB, GL_UNSIGNED_NORMALIZED, - 8, 8, 8, 0, + 4, 4, 4, 0, /* approx Red/Green/BlueBits */ 0, 0, 0, 0, 0, 8, 4, 16 /* 16 bytes per 8x4 block */ }, @@ -453,7 +453,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = "MESA_FORMAT_RGBA_FXT1", GL_RGBA, GL_UNSIGNED_NORMALIZED, - 8, 8, 8, 8, + 4, 4, 4, 1, /* approx Red/Green/Blue/AlphaBits */ 0, 0, 0, 0, 0, 8, 4, 16 /* 16 bytes per 8x4 block */ }, -- cgit v1.2.3 From d00cbba403640c82683a876fa795cd638f1bbc24 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Sun, 1 Nov 2009 21:38:48 +0100 Subject: r600: implement EXP op in compiler --- src/mesa/drivers/dri/r600/r700_assembler.c | 132 ++++++++++++++++++++++++++++- src/mesa/drivers/dri/r600/r700_assembler.h | 1 + 2 files changed, 130 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 917318c02a..fbf1f29fa3 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -2729,6 +2729,133 @@ GLboolean assemble_EX2(r700_AssemblerBase *pAsm) { return assemble_math_function(pAsm, SQ_OP2_INST_EXP_IEEE); } + +GLboolean assemble_EXP(r700_AssemblerBase *pAsm) +{ + BITS tmp; + + checkop1(pAsm); + + tmp = gethelpr(pAsm); + + // FLOOR tmp.x, a.x + // EX2 dst.x tmp.x + + if (pAsm->pILInst->DstReg.WriteMask & 0x1) { + pAsm->D.dst.opcode = SQ_OP2_INST_FLOOR; + + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = tmp; + pAsm->D.dst.writex = 1; + + if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + { + return GL_FALSE; + } + + if( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } + + pAsm->D.dst.opcode = SQ_OP2_INST_EXP_IEEE; + pAsm->D.dst.math = 1; + + if( GL_FALSE == assemble_dst(pAsm) ) + { + return GL_FALSE; + } + + pAsm->D.dst.writey = pAsm->D.dst.writez = pAsm->D.dst.writew = 0; + + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = DST_REG_TEMPORARY; + pAsm->S[0].src.reg = tmp; + + setswizzle_PVSSRC(&(pAsm->S[0].src), SQ_SEL_X); + noneg_PVSSRC(&(pAsm->S[0].src)); + + if( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } + } + + // FRACT dst.y a.x + + if ((pAsm->pILInst->DstReg.WriteMask >> 1) & 0x1) { + pAsm->D.dst.opcode = SQ_OP2_INST_FRACT; + + if( GL_FALSE == assemble_dst(pAsm) ) + { + return GL_FALSE; + } + + if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + { + return GL_FALSE; + } + + pAsm->D.dst.writex = pAsm->D.dst.writez = pAsm->D.dst.writew = 0; + + if( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } + } + + // EX2 dst.z, a.x + + if ((pAsm->pILInst->DstReg.WriteMask >> 2) & 0x1) { + pAsm->D.dst.opcode = SQ_OP2_INST_EXP_IEEE; + pAsm->D.dst.math = 1; + + if( GL_FALSE == assemble_dst(pAsm) ) + { + return GL_FALSE; + } + + if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + { + return GL_FALSE; + } + + pAsm->D.dst.writex = pAsm->D.dst.writey = pAsm->D.dst.writew = 0; + + if( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } + } + + // MOV dst.w 1.0 + + if ((pAsm->pILInst->DstReg.WriteMask >> 3) & 0x1) { + pAsm->D.dst.opcode = SQ_OP2_INST_MOV; + + if( GL_FALSE == assemble_dst(pAsm) ) + { + return GL_FALSE; + } + + pAsm->D.dst.writex = pAsm->D.dst.writey = pAsm->D.dst.writez = 0; + + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[0].src.reg = tmp; + + setswizzle_PVSSRC(&(pAsm->S[0].src), SQ_SEL_1); + noneg_PVSSRC(&(pAsm->S[0].src)); + + if( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } + } + + return GL_TRUE; +} GLboolean assemble_FLR(r700_AssemblerBase *pAsm) { @@ -4004,10 +4131,9 @@ GLboolean AssembleInstr(GLuint uiNumberInsts, return GL_FALSE; break; case OPCODE_EXP: - radeon_error("Not yet implemented instruction OPCODE_EXP \n"); - //if ( GL_FALSE == assemble_BAD("EXP") ) + if ( GL_FALSE == assemble_EXP(pR700AsmCode) ) return GL_FALSE; - break; // approx of EX2 + break; case OPCODE_FLR: if ( GL_FALSE == assemble_FLR(pR700AsmCode) ) diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index 8cbca066e9..317feb1b7d 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -477,6 +477,7 @@ GLboolean assemble_COS(r700_AssemblerBase *pAsm); GLboolean assemble_DOT(r700_AssemblerBase *pAsm); GLboolean assemble_DST(r700_AssemblerBase *pAsm); GLboolean assemble_EX2(r700_AssemblerBase *pAsm); +GLboolean assemble_EXP(r700_AssemblerBase *pAsm); GLboolean assemble_FLR(r700_AssemblerBase *pAsm); GLboolean assemble_FLR_INT(r700_AssemblerBase *pAsm); GLboolean assemble_FRC(r700_AssemblerBase *pAsm); -- cgit v1.2.3 From 213ec8251cb3e859b41306eae4092d89592c33db Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Sun, 1 Nov 2009 22:28:02 +0100 Subject: r600: implement LOG op in compiler --- src/mesa/drivers/dri/r600/r700_assembler.c | 216 ++++++++++++++++++++++++++++- src/mesa/drivers/dri/r600/r700_assembler.h | 1 + 2 files changed, 214 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index fbf1f29fa3..e0d7d4fa6b 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -3037,6 +3037,217 @@ GLboolean assemble_LRP(r700_AssemblerBase *pAsm) return GL_TRUE; } +GLboolean assemble_LOG(r700_AssemblerBase *pAsm) +{ + BITS tmp1, tmp2, tmp3; + + checkop1(pAsm); + + tmp1 = gethelpr(pAsm); + tmp2 = gethelpr(pAsm); + tmp3 = gethelpr(pAsm); + + // FIXME: The hardware can do fabs() directly on input + // elements, but the compiler doesn't have the + // capability to use that. + + // MAX tmp1.x, a.x, -a.x (fabs(a.x)) + + pAsm->D.dst.opcode = SQ_OP2_INST_MAX; + + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = tmp1; + pAsm->D.dst.writex = 1; + + if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + { + return GL_FALSE; + } + + pAsm->S[1].bits = pAsm->S[0].bits; + flipneg_PVSSRC(&(pAsm->S[1].src)); + + if ( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } + + // Entire algo: + // + // LG2 tmp2.x, tmp1.x + // FLOOR tmp3.x, tmp2.x + // MOV dst.x, tmp3.x + // ADD tmp3.x, tmp2.x, -tmp3.x + // EX2 dst.y, tmp3.x + // MOV dst.z, tmp2.x + // MOV dst.w, 1.0 + + // LG2 tmp2.x, tmp1.x + // FLOOR tmp3.x, tmp2.x + + pAsm->D.dst.opcode = SQ_OP2_INST_LOG_IEEE; + pAsm->D.dst.math = 1; + + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = tmp2; + pAsm->D.dst.writex = 1; + + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = DST_REG_TEMPORARY; + pAsm->S[0].src.reg = tmp1; + + setswizzle_PVSSRC(&(pAsm->S[0].src), SQ_SEL_X); + noneg_PVSSRC(&(pAsm->S[0].src)); + + if( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } + + pAsm->D.dst.opcode = SQ_OP2_INST_FLOOR; + + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = tmp3; + pAsm->D.dst.writex = 1; + + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = DST_REG_TEMPORARY; + pAsm->S[0].src.reg = tmp2; + + setswizzle_PVSSRC(&(pAsm->S[0].src), SQ_SEL_X); + noneg_PVSSRC(&(pAsm->S[0].src)); + + if( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } + + // MOV dst.x, tmp3.x + + pAsm->D.dst.opcode = SQ_OP2_INST_MOV; + + if( GL_FALSE == assemble_dst(pAsm) ) + { + return GL_FALSE; + } + + pAsm->D.dst.writey = pAsm->D.dst.writez = pAsm->D.dst.writew = 0; + + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = DST_REG_TEMPORARY; + pAsm->S[0].src.reg = tmp3; + + setswizzle_PVSSRC(&(pAsm->S[0].src), SQ_SEL_X); + noneg_PVSSRC(&(pAsm->S[0].src)); + + if( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } + + // ADD tmp3.x, tmp2.x, -tmp3.x + // EX2 dst.y, tmp3.x + + pAsm->D.dst.opcode = SQ_OP2_INST_ADD; + + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = tmp3; + pAsm->D.dst.writex = 1; + + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = DST_REG_TEMPORARY; + pAsm->S[0].src.reg = tmp2; + + setswizzle_PVSSRC(&(pAsm->S[0].src), SQ_SEL_X); + noneg_PVSSRC(&(pAsm->S[0].src)); + + setaddrmode_PVSSRC(&(pAsm->S[1].src), ADDR_ABSOLUTE); + pAsm->S[1].src.rtype = DST_REG_TEMPORARY; + pAsm->S[1].src.reg = tmp3; + + setswizzle_PVSSRC(&(pAsm->S[1].src), SQ_SEL_X); + neg_PVSSRC(&(pAsm->S[1].src)); + + if( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } + + pAsm->D.dst.opcode = SQ_OP2_INST_EXP_IEEE; + pAsm->D.dst.math = 1; + + if( GL_FALSE == assemble_dst(pAsm) ) + { + return GL_FALSE; + } + + pAsm->D.dst.writex = pAsm->D.dst.writez = pAsm->D.dst.writew = 0; + + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = DST_REG_TEMPORARY; + pAsm->S[0].src.reg = tmp3; + + setswizzle_PVSSRC(&(pAsm->S[0].src), SQ_SEL_X); + noneg_PVSSRC(&(pAsm->S[0].src)); + + if( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } + + // MOV dst.z, tmp2.x + + pAsm->D.dst.opcode = SQ_OP2_INST_MOV; + + if( GL_FALSE == assemble_dst(pAsm) ) + { + return GL_FALSE; + } + + pAsm->D.dst.writex = pAsm->D.dst.writey = pAsm->D.dst.writew = 0; + + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = DST_REG_TEMPORARY; + pAsm->S[0].src.reg = tmp2; + + setswizzle_PVSSRC(&(pAsm->S[0].src), SQ_SEL_X); + noneg_PVSSRC(&(pAsm->S[0].src)); + + if( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } + + // MOV dst.w 1.0 + + pAsm->D.dst.opcode = SQ_OP2_INST_MOV; + + if( GL_FALSE == assemble_dst(pAsm) ) + { + return GL_FALSE; + } + + pAsm->D.dst.writex = pAsm->D.dst.writey = pAsm->D.dst.writez = 0; + + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[0].src.reg = tmp1; + + setswizzle_PVSSRC(&(pAsm->S[0].src), SQ_SEL_1); + noneg_PVSSRC(&(pAsm->S[0].src)); + + if( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } + + return GL_TRUE; +} + GLboolean assemble_MAD(struct r700_AssemblerBase *pAsm) { int tmp, ii; @@ -4166,10 +4377,9 @@ GLboolean AssembleInstr(GLuint uiNumberInsts, return GL_FALSE; break; case OPCODE_LOG: - radeon_error("Not yet implemented instruction OPCODE_LOG \n"); - //if ( GL_FALSE == assemble_BAD("LOG") ) + if ( GL_FALSE == assemble_LOG(pR700AsmCode) ) return GL_FALSE; - break; // approx of LG2 + break; case OPCODE_MAD: if ( GL_FALSE == assemble_MAD(pR700AsmCode) ) diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index 317feb1b7d..c66db502a1 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -484,6 +484,7 @@ GLboolean assemble_FRC(r700_AssemblerBase *pAsm); GLboolean assemble_KIL(r700_AssemblerBase *pAsm); GLboolean assemble_LG2(r700_AssemblerBase *pAsm); GLboolean assemble_LRP(r700_AssemblerBase *pAsm); +GLboolean assemble_LOG(r700_AssemblerBase *pAsm); GLboolean assemble_MAD(r700_AssemblerBase *pAsm); GLboolean assemble_LIT(r700_AssemblerBase *pAsm); GLboolean assemble_MAX(r700_AssemblerBase *pAsm); -- cgit v1.2.3 From 731810f8546174e45c717b0a9aa289a26593dfa0 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 2 Nov 2009 12:44:14 -0800 Subject: ARB prog parser: Fix a couple issues with previous merge from mesa_7_6_branch Since the addition of support for Nvidia condition codes, the lexer internally uses handle_ident to select between returning IDENTIFIER and USED_IDENTIFIER. Also, use return_string instead of strdup. Fixes bug #24809. --- src/mesa/shader/lex.yy.c | 382 +++++++++++++++++++++------------------- src/mesa/shader/program_lexer.l | 8 +- 2 files changed, 200 insertions(+), 190 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/lex.yy.c b/src/mesa/shader/lex.yy.c index 5e605274aa..fc78b30fb4 100644 --- a/src/mesa/shader/lex.yy.c +++ b/src/mesa/shader/lex.yy.c @@ -53,7 +53,6 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; -#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -84,6 +83,8 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif +#endif /* ! C99 */ + #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -157,7 +158,15 @@ typedef void* yyscan_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k. + * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. + * Ditto for the __ia64__ case accordingly. + */ +#define YY_BUF_SIZE 32768 +#else #define YY_BUF_SIZE 16384 +#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -1057,8 +1066,7 @@ static yyconst flex_int16_t yy_chk[1368] = if (condition) { \ return token; \ } else { \ - yylval->string = return_string(yyextra, yytext); \ - return IDENTIFIER; \ + return handle_ident(yyextra, yytext, yylval); \ } \ } while (0) @@ -1082,8 +1090,7 @@ static yyconst flex_int16_t yy_chk[1368] = yylval->temp_inst.Opcode = OPCODE_ ## opcode; \ return token; \ } else { \ - yylval->string = return_string(yyextra, yytext); \ - return IDENTIFIER; \ + return handle_ident(yyextra, yytext, yylval); \ } \ } while (0) @@ -1174,7 +1181,7 @@ swiz_from_char(char c) static int handle_ident(struct asm_parser_state *state, const char *text, YYSTYPE *lval) { - lval->string = strdup(text); + lval->string = return_string(state, text); return (_mesa_symbol_table_find_symbol(state->st, 0, text) == NULL) ? IDENTIFIER : USED_IDENTIFIER; @@ -1193,7 +1200,7 @@ handle_ident(struct asm_parser_state *state, const char *text, YYSTYPE *lval) } while(0); #define YY_EXTRA_TYPE struct asm_parser_state * -#line 1197 "lex.yy.c" +#line 1204 "lex.yy.c" #define INITIAL 0 @@ -1330,7 +1337,12 @@ static int input (yyscan_t yyscanner ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE +#ifdef __ia64__ +/* On IA-64, the buffer size is 16k, not 8k */ +#define YY_READ_BUF_SIZE 16384 +#else #define YY_READ_BUF_SIZE 8192 +#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -1338,7 +1350,7 @@ static int input (yyscan_t yyscanner ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO fwrite( yytext, yyleng, 1, yyout ) +#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1349,7 +1361,7 @@ static int input (yyscan_t yyscanner ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - unsigned n; \ + size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1434,10 +1446,10 @@ YY_DECL register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 198 "program_lexer.l" +#line 196 "program_lexer.l" -#line 1441 "lex.yy.c" +#line 1453 "lex.yy.c" yylval = yylval_param; @@ -1526,17 +1538,17 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 200 "program_lexer.l" +#line 198 "program_lexer.l" { return ARBvp_10; } YY_BREAK case 2: YY_RULE_SETUP -#line 201 "program_lexer.l" +#line 199 "program_lexer.l" { return ARBfp_10; } YY_BREAK case 3: YY_RULE_SETUP -#line 202 "program_lexer.l" +#line 200 "program_lexer.l" { yylval->integer = at_address; return_token_or_IDENTIFIER(require_ARB_vp, ADDRESS); @@ -1544,692 +1556,692 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 206 "program_lexer.l" +#line 204 "program_lexer.l" { return ALIAS; } YY_BREAK case 5: YY_RULE_SETUP -#line 207 "program_lexer.l" +#line 205 "program_lexer.l" { return ATTRIB; } YY_BREAK case 6: YY_RULE_SETUP -#line 208 "program_lexer.l" +#line 206 "program_lexer.l" { return END; } YY_BREAK case 7: YY_RULE_SETUP -#line 209 "program_lexer.l" +#line 207 "program_lexer.l" { return OPTION; } YY_BREAK case 8: YY_RULE_SETUP -#line 210 "program_lexer.l" +#line 208 "program_lexer.l" { return OUTPUT; } YY_BREAK case 9: YY_RULE_SETUP -#line 211 "program_lexer.l" +#line 209 "program_lexer.l" { return PARAM; } YY_BREAK case 10: YY_RULE_SETUP -#line 212 "program_lexer.l" +#line 210 "program_lexer.l" { yylval->integer = at_temp; return TEMP; } YY_BREAK case 11: YY_RULE_SETUP -#line 214 "program_lexer.l" +#line 212 "program_lexer.l" { return_opcode( 1, VECTOR_OP, ABS, 3); } YY_BREAK case 12: YY_RULE_SETUP -#line 215 "program_lexer.l" +#line 213 "program_lexer.l" { return_opcode( 1, BIN_OP, ADD, 3); } YY_BREAK case 13: YY_RULE_SETUP -#line 216 "program_lexer.l" +#line 214 "program_lexer.l" { return_opcode(require_ARB_vp, ARL, ARL, 3); } YY_BREAK case 14: YY_RULE_SETUP -#line 218 "program_lexer.l" +#line 216 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, CMP, 3); } YY_BREAK case 15: YY_RULE_SETUP -#line 219 "program_lexer.l" +#line 217 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, COS, 3); } YY_BREAK case 16: YY_RULE_SETUP -#line 221 "program_lexer.l" +#line 219 "program_lexer.l" { return_opcode(require_NV_fp, VECTOR_OP, DDX, 3); } YY_BREAK case 17: YY_RULE_SETUP -#line 222 "program_lexer.l" +#line 220 "program_lexer.l" { return_opcode(require_NV_fp, VECTOR_OP, DDY, 3); } YY_BREAK case 18: YY_RULE_SETUP -#line 223 "program_lexer.l" +#line 221 "program_lexer.l" { return_opcode( 1, BIN_OP, DP3, 3); } YY_BREAK case 19: YY_RULE_SETUP -#line 224 "program_lexer.l" +#line 222 "program_lexer.l" { return_opcode( 1, BIN_OP, DP4, 3); } YY_BREAK case 20: YY_RULE_SETUP -#line 225 "program_lexer.l" +#line 223 "program_lexer.l" { return_opcode( 1, BIN_OP, DPH, 3); } YY_BREAK case 21: YY_RULE_SETUP -#line 226 "program_lexer.l" +#line 224 "program_lexer.l" { return_opcode( 1, BIN_OP, DST, 3); } YY_BREAK case 22: YY_RULE_SETUP -#line 228 "program_lexer.l" +#line 226 "program_lexer.l" { return_opcode( 1, SCALAR_OP, EX2, 3); } YY_BREAK case 23: YY_RULE_SETUP -#line 229 "program_lexer.l" +#line 227 "program_lexer.l" { return_opcode(require_ARB_vp, SCALAR_OP, EXP, 3); } YY_BREAK case 24: YY_RULE_SETUP -#line 231 "program_lexer.l" +#line 229 "program_lexer.l" { return_opcode( 1, VECTOR_OP, FLR, 3); } YY_BREAK case 25: YY_RULE_SETUP -#line 232 "program_lexer.l" +#line 230 "program_lexer.l" { return_opcode( 1, VECTOR_OP, FRC, 3); } YY_BREAK case 26: YY_RULE_SETUP -#line 234 "program_lexer.l" +#line 232 "program_lexer.l" { return_opcode(require_ARB_fp, KIL, KIL, 3); } YY_BREAK case 27: YY_RULE_SETUP -#line 236 "program_lexer.l" +#line 234 "program_lexer.l" { return_opcode( 1, VECTOR_OP, LIT, 3); } YY_BREAK case 28: YY_RULE_SETUP -#line 237 "program_lexer.l" +#line 235 "program_lexer.l" { return_opcode( 1, SCALAR_OP, LG2, 3); } YY_BREAK case 29: YY_RULE_SETUP -#line 238 "program_lexer.l" +#line 236 "program_lexer.l" { return_opcode(require_ARB_vp, SCALAR_OP, LOG, 3); } YY_BREAK case 30: YY_RULE_SETUP -#line 239 "program_lexer.l" +#line 237 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, LRP, 3); } YY_BREAK case 31: YY_RULE_SETUP -#line 241 "program_lexer.l" +#line 239 "program_lexer.l" { return_opcode( 1, TRI_OP, MAD, 3); } YY_BREAK case 32: YY_RULE_SETUP -#line 242 "program_lexer.l" +#line 240 "program_lexer.l" { return_opcode( 1, BIN_OP, MAX, 3); } YY_BREAK case 33: YY_RULE_SETUP -#line 243 "program_lexer.l" +#line 241 "program_lexer.l" { return_opcode( 1, BIN_OP, MIN, 3); } YY_BREAK case 34: YY_RULE_SETUP -#line 244 "program_lexer.l" +#line 242 "program_lexer.l" { return_opcode( 1, VECTOR_OP, MOV, 3); } YY_BREAK case 35: YY_RULE_SETUP -#line 245 "program_lexer.l" +#line 243 "program_lexer.l" { return_opcode( 1, BIN_OP, MUL, 3); } YY_BREAK case 36: YY_RULE_SETUP -#line 247 "program_lexer.l" +#line 245 "program_lexer.l" { return_opcode(require_NV_fp, VECTOR_OP, PK2H, 4); } YY_BREAK case 37: YY_RULE_SETUP -#line 248 "program_lexer.l" +#line 246 "program_lexer.l" { return_opcode(require_NV_fp, VECTOR_OP, PK2US, 5); } YY_BREAK case 38: YY_RULE_SETUP -#line 249 "program_lexer.l" +#line 247 "program_lexer.l" { return_opcode(require_NV_fp, VECTOR_OP, PK4B, 4); } YY_BREAK case 39: YY_RULE_SETUP -#line 250 "program_lexer.l" +#line 248 "program_lexer.l" { return_opcode(require_NV_fp, VECTOR_OP, PK4UB, 5); } YY_BREAK case 40: YY_RULE_SETUP -#line 251 "program_lexer.l" +#line 249 "program_lexer.l" { return_opcode( 1, BINSC_OP, POW, 3); } YY_BREAK case 41: YY_RULE_SETUP -#line 253 "program_lexer.l" +#line 251 "program_lexer.l" { return_opcode( 1, SCALAR_OP, RCP, 3); } YY_BREAK case 42: YY_RULE_SETUP -#line 254 "program_lexer.l" +#line 252 "program_lexer.l" { return_opcode(require_NV_fp, BIN_OP, RFL, 3); } YY_BREAK case 43: YY_RULE_SETUP -#line 255 "program_lexer.l" +#line 253 "program_lexer.l" { return_opcode( 1, SCALAR_OP, RSQ, 3); } YY_BREAK case 44: YY_RULE_SETUP -#line 257 "program_lexer.l" +#line 255 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, SCS, 3); } YY_BREAK case 45: YY_RULE_SETUP -#line 258 "program_lexer.l" +#line 256 "program_lexer.l" { return_opcode(require_NV_fp, BIN_OP, SEQ, 3); } YY_BREAK case 46: YY_RULE_SETUP -#line 259 "program_lexer.l" +#line 257 "program_lexer.l" { return_opcode(require_NV_fp, BIN_OP, SFL, 3); } YY_BREAK case 47: YY_RULE_SETUP -#line 260 "program_lexer.l" +#line 258 "program_lexer.l" { return_opcode( 1, BIN_OP, SGE, 3); } YY_BREAK case 48: YY_RULE_SETUP -#line 261 "program_lexer.l" +#line 259 "program_lexer.l" { return_opcode(require_NV_fp, BIN_OP, SGT, 3); } YY_BREAK case 49: YY_RULE_SETUP -#line 262 "program_lexer.l" +#line 260 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, SIN, 3); } YY_BREAK case 50: YY_RULE_SETUP -#line 263 "program_lexer.l" +#line 261 "program_lexer.l" { return_opcode(require_NV_fp, BIN_OP, SLE, 3); } YY_BREAK case 51: YY_RULE_SETUP -#line 264 "program_lexer.l" +#line 262 "program_lexer.l" { return_opcode( 1, BIN_OP, SLT, 3); } YY_BREAK case 52: YY_RULE_SETUP -#line 265 "program_lexer.l" +#line 263 "program_lexer.l" { return_opcode(require_NV_fp, BIN_OP, SNE, 3); } YY_BREAK case 53: YY_RULE_SETUP -#line 266 "program_lexer.l" +#line 264 "program_lexer.l" { return_opcode(require_NV_fp, BIN_OP, STR, 3); } YY_BREAK case 54: YY_RULE_SETUP -#line 267 "program_lexer.l" +#line 265 "program_lexer.l" { return_opcode( 1, BIN_OP, SUB, 3); } YY_BREAK case 55: YY_RULE_SETUP -#line 268 "program_lexer.l" +#line 266 "program_lexer.l" { return_opcode( 1, SWZ, SWZ, 3); } YY_BREAK case 56: YY_RULE_SETUP -#line 270 "program_lexer.l" +#line 268 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, 3); } YY_BREAK case 57: YY_RULE_SETUP -#line 271 "program_lexer.l" +#line 269 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, 3); } YY_BREAK case 58: YY_RULE_SETUP -#line 272 "program_lexer.l" +#line 270 "program_lexer.l" { return_opcode(require_NV_fp, TXD_OP, TXD, 3); } YY_BREAK case 59: YY_RULE_SETUP -#line 273 "program_lexer.l" +#line 271 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, 3); } YY_BREAK case 60: YY_RULE_SETUP -#line 275 "program_lexer.l" +#line 273 "program_lexer.l" { return_opcode(require_NV_fp, SCALAR_OP, UP2H, 4); } YY_BREAK case 61: YY_RULE_SETUP -#line 276 "program_lexer.l" +#line 274 "program_lexer.l" { return_opcode(require_NV_fp, SCALAR_OP, UP2US, 5); } YY_BREAK case 62: YY_RULE_SETUP -#line 277 "program_lexer.l" +#line 275 "program_lexer.l" { return_opcode(require_NV_fp, SCALAR_OP, UP4B, 4); } YY_BREAK case 63: YY_RULE_SETUP -#line 278 "program_lexer.l" +#line 276 "program_lexer.l" { return_opcode(require_NV_fp, SCALAR_OP, UP4UB, 5); } YY_BREAK case 64: YY_RULE_SETUP -#line 280 "program_lexer.l" +#line 278 "program_lexer.l" { return_opcode(require_NV_fp, TRI_OP, X2D, 3); } YY_BREAK case 65: YY_RULE_SETUP -#line 281 "program_lexer.l" +#line 279 "program_lexer.l" { return_opcode( 1, BIN_OP, XPD, 3); } YY_BREAK case 66: YY_RULE_SETUP -#line 283 "program_lexer.l" +#line 281 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_vp, VERTEX); } YY_BREAK case 67: YY_RULE_SETUP -#line 284 "program_lexer.l" +#line 282 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, FRAGMENT); } YY_BREAK case 68: YY_RULE_SETUP -#line 285 "program_lexer.l" +#line 283 "program_lexer.l" { return PROGRAM; } YY_BREAK case 69: YY_RULE_SETUP -#line 286 "program_lexer.l" +#line 284 "program_lexer.l" { return STATE; } YY_BREAK case 70: YY_RULE_SETUP -#line 287 "program_lexer.l" +#line 285 "program_lexer.l" { return RESULT; } YY_BREAK case 71: YY_RULE_SETUP -#line 289 "program_lexer.l" +#line 287 "program_lexer.l" { return AMBIENT; } YY_BREAK case 72: YY_RULE_SETUP -#line 290 "program_lexer.l" +#line 288 "program_lexer.l" { return ATTENUATION; } YY_BREAK case 73: YY_RULE_SETUP -#line 291 "program_lexer.l" +#line 289 "program_lexer.l" { return BACK; } YY_BREAK case 74: YY_RULE_SETUP -#line 292 "program_lexer.l" +#line 290 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, CLIP); } YY_BREAK case 75: YY_RULE_SETUP -#line 293 "program_lexer.l" +#line 291 "program_lexer.l" { return COLOR; } YY_BREAK case 76: YY_RULE_SETUP -#line 294 "program_lexer.l" +#line 292 "program_lexer.l" { return_token_or_DOT(require_ARB_fp, DEPTH); } YY_BREAK case 77: YY_RULE_SETUP -#line 295 "program_lexer.l" +#line 293 "program_lexer.l" { return DIFFUSE; } YY_BREAK case 78: YY_RULE_SETUP -#line 296 "program_lexer.l" +#line 294 "program_lexer.l" { return DIRECTION; } YY_BREAK case 79: YY_RULE_SETUP -#line 297 "program_lexer.l" +#line 295 "program_lexer.l" { return EMISSION; } YY_BREAK case 80: YY_RULE_SETUP -#line 298 "program_lexer.l" +#line 296 "program_lexer.l" { return ENV; } YY_BREAK case 81: YY_RULE_SETUP -#line 299 "program_lexer.l" +#line 297 "program_lexer.l" { return EYE; } YY_BREAK case 82: YY_RULE_SETUP -#line 300 "program_lexer.l" +#line 298 "program_lexer.l" { return FOGCOORD; } YY_BREAK case 83: YY_RULE_SETUP -#line 301 "program_lexer.l" +#line 299 "program_lexer.l" { return FOG; } YY_BREAK case 84: YY_RULE_SETUP -#line 302 "program_lexer.l" +#line 300 "program_lexer.l" { return FRONT; } YY_BREAK case 85: YY_RULE_SETUP -#line 303 "program_lexer.l" +#line 301 "program_lexer.l" { return HALF; } YY_BREAK case 86: YY_RULE_SETUP -#line 304 "program_lexer.l" +#line 302 "program_lexer.l" { return INVERSE; } YY_BREAK case 87: YY_RULE_SETUP -#line 305 "program_lexer.l" +#line 303 "program_lexer.l" { return INVTRANS; } YY_BREAK case 88: YY_RULE_SETUP -#line 306 "program_lexer.l" +#line 304 "program_lexer.l" { return LIGHT; } YY_BREAK case 89: YY_RULE_SETUP -#line 307 "program_lexer.l" +#line 305 "program_lexer.l" { return LIGHTMODEL; } YY_BREAK case 90: YY_RULE_SETUP -#line 308 "program_lexer.l" +#line 306 "program_lexer.l" { return LIGHTPROD; } YY_BREAK case 91: YY_RULE_SETUP -#line 309 "program_lexer.l" +#line 307 "program_lexer.l" { return LOCAL; } YY_BREAK case 92: YY_RULE_SETUP -#line 310 "program_lexer.l" +#line 308 "program_lexer.l" { return MATERIAL; } YY_BREAK case 93: YY_RULE_SETUP -#line 311 "program_lexer.l" +#line 309 "program_lexer.l" { return MAT_PROGRAM; } YY_BREAK case 94: YY_RULE_SETUP -#line 312 "program_lexer.l" +#line 310 "program_lexer.l" { return MATRIX; } YY_BREAK case 95: YY_RULE_SETUP -#line 313 "program_lexer.l" +#line 311 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, MATRIXINDEX); } YY_BREAK case 96: YY_RULE_SETUP -#line 314 "program_lexer.l" +#line 312 "program_lexer.l" { return MODELVIEW; } YY_BREAK case 97: YY_RULE_SETUP -#line 315 "program_lexer.l" +#line 313 "program_lexer.l" { return MVP; } YY_BREAK case 98: YY_RULE_SETUP -#line 316 "program_lexer.l" +#line 314 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, NORMAL); } YY_BREAK case 99: YY_RULE_SETUP -#line 317 "program_lexer.l" +#line 315 "program_lexer.l" { return OBJECT; } YY_BREAK case 100: YY_RULE_SETUP -#line 318 "program_lexer.l" +#line 316 "program_lexer.l" { return PALETTE; } YY_BREAK case 101: YY_RULE_SETUP -#line 319 "program_lexer.l" +#line 317 "program_lexer.l" { return PARAMS; } YY_BREAK case 102: YY_RULE_SETUP -#line 320 "program_lexer.l" +#line 318 "program_lexer.l" { return PLANE; } YY_BREAK case 103: YY_RULE_SETUP -#line 321 "program_lexer.l" +#line 319 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, POINT_TOK); } YY_BREAK case 104: YY_RULE_SETUP -#line 322 "program_lexer.l" +#line 320 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, POINTSIZE); } YY_BREAK case 105: YY_RULE_SETUP -#line 323 "program_lexer.l" +#line 321 "program_lexer.l" { return POSITION; } YY_BREAK case 106: YY_RULE_SETUP -#line 324 "program_lexer.l" +#line 322 "program_lexer.l" { return PRIMARY; } YY_BREAK case 107: YY_RULE_SETUP -#line 325 "program_lexer.l" +#line 323 "program_lexer.l" { return PROJECTION; } YY_BREAK case 108: YY_RULE_SETUP -#line 326 "program_lexer.l" +#line 324 "program_lexer.l" { return_token_or_DOT(require_ARB_fp, RANGE); } YY_BREAK case 109: YY_RULE_SETUP -#line 327 "program_lexer.l" +#line 325 "program_lexer.l" { return ROW; } YY_BREAK case 110: YY_RULE_SETUP -#line 328 "program_lexer.l" +#line 326 "program_lexer.l" { return SCENECOLOR; } YY_BREAK case 111: YY_RULE_SETUP -#line 329 "program_lexer.l" +#line 327 "program_lexer.l" { return SECONDARY; } YY_BREAK case 112: YY_RULE_SETUP -#line 330 "program_lexer.l" +#line 328 "program_lexer.l" { return SHININESS; } YY_BREAK case 113: YY_RULE_SETUP -#line 331 "program_lexer.l" +#line 329 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, SIZE_TOK); } YY_BREAK case 114: YY_RULE_SETUP -#line 332 "program_lexer.l" +#line 330 "program_lexer.l" { return SPECULAR; } YY_BREAK case 115: YY_RULE_SETUP -#line 333 "program_lexer.l" +#line 331 "program_lexer.l" { return SPOT; } YY_BREAK case 116: YY_RULE_SETUP -#line 334 "program_lexer.l" +#line 332 "program_lexer.l" { return TEXCOORD; } YY_BREAK case 117: YY_RULE_SETUP -#line 335 "program_lexer.l" +#line 333 "program_lexer.l" { return_token_or_DOT(require_ARB_fp, TEXENV); } YY_BREAK case 118: YY_RULE_SETUP -#line 336 "program_lexer.l" +#line 334 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN); } YY_BREAK case 119: YY_RULE_SETUP -#line 337 "program_lexer.l" +#line 335 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN_Q); } YY_BREAK case 120: YY_RULE_SETUP -#line 338 "program_lexer.l" +#line 336 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN_S); } YY_BREAK case 121: YY_RULE_SETUP -#line 339 "program_lexer.l" +#line 337 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN_T); } YY_BREAK case 122: YY_RULE_SETUP -#line 340 "program_lexer.l" +#line 338 "program_lexer.l" { return TEXTURE; } YY_BREAK case 123: YY_RULE_SETUP -#line 341 "program_lexer.l" +#line 339 "program_lexer.l" { return TRANSPOSE; } YY_BREAK case 124: YY_RULE_SETUP -#line 342 "program_lexer.l" +#line 340 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, VTXATTRIB); } YY_BREAK case 125: YY_RULE_SETUP -#line 343 "program_lexer.l" +#line 341 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, WEIGHT); } YY_BREAK case 126: YY_RULE_SETUP -#line 345 "program_lexer.l" +#line 343 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEXTURE_UNIT); } YY_BREAK case 127: YY_RULE_SETUP -#line 346 "program_lexer.l" +#line 344 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_1D); } YY_BREAK case 128: YY_RULE_SETUP -#line 347 "program_lexer.l" +#line 345 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_2D); } YY_BREAK case 129: YY_RULE_SETUP -#line 348 "program_lexer.l" +#line 346 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_3D); } YY_BREAK case 130: YY_RULE_SETUP -#line 349 "program_lexer.l" +#line 347 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_CUBE); } YY_BREAK case 131: YY_RULE_SETUP -#line 350 "program_lexer.l" +#line 348 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_rect, TEX_RECT); } YY_BREAK case 132: YY_RULE_SETUP -#line 351 "program_lexer.l" +#line 349 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW1D); } YY_BREAK case 133: YY_RULE_SETUP -#line 352 "program_lexer.l" +#line 350 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW2D); } YY_BREAK case 134: YY_RULE_SETUP -#line 353 "program_lexer.l" +#line 351 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_rect, TEX_SHADOWRECT); } YY_BREAK case 135: YY_RULE_SETUP -#line 354 "program_lexer.l" +#line 352 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY1D); } YY_BREAK case 136: YY_RULE_SETUP -#line 355 "program_lexer.l" +#line 353 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY2D); } YY_BREAK case 137: YY_RULE_SETUP -#line 356 "program_lexer.l" +#line 354 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW1D); } YY_BREAK case 138: YY_RULE_SETUP -#line 357 "program_lexer.l" +#line 355 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW2D); } YY_BREAK case 139: YY_RULE_SETUP -#line 359 "program_lexer.l" +#line 357 "program_lexer.l" { return handle_ident(yyextra, yytext, yylval); } YY_BREAK case 140: YY_RULE_SETUP -#line 361 "program_lexer.l" +#line 359 "program_lexer.l" { return DOT_DOT; } YY_BREAK case 141: YY_RULE_SETUP -#line 363 "program_lexer.l" +#line 361 "program_lexer.l" { yylval->integer = strtol(yytext, NULL, 10); return INTEGER; @@ -2237,7 +2249,7 @@ YY_RULE_SETUP YY_BREAK case 142: YY_RULE_SETUP -#line 367 "program_lexer.l" +#line 365 "program_lexer.l" { yylval->real = _mesa_strtod(yytext, NULL); return REAL; @@ -2249,7 +2261,7 @@ case 143: yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 371 "program_lexer.l" +#line 369 "program_lexer.l" { yylval->real = _mesa_strtod(yytext, NULL); return REAL; @@ -2257,7 +2269,7 @@ YY_RULE_SETUP YY_BREAK case 144: YY_RULE_SETUP -#line 375 "program_lexer.l" +#line 373 "program_lexer.l" { yylval->real = _mesa_strtod(yytext, NULL); return REAL; @@ -2265,7 +2277,7 @@ YY_RULE_SETUP YY_BREAK case 145: YY_RULE_SETUP -#line 379 "program_lexer.l" +#line 377 "program_lexer.l" { yylval->real = _mesa_strtod(yytext, NULL); return REAL; @@ -2273,7 +2285,7 @@ YY_RULE_SETUP YY_BREAK case 146: YY_RULE_SETUP -#line 384 "program_lexer.l" +#line 382 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; @@ -2282,7 +2294,7 @@ YY_RULE_SETUP YY_BREAK case 147: YY_RULE_SETUP -#line 390 "program_lexer.l" +#line 388 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@ -2292,7 +2304,7 @@ YY_RULE_SETUP YY_BREAK case 148: YY_RULE_SETUP -#line 396 "program_lexer.l" +#line 394 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; @@ -2301,7 +2313,7 @@ YY_RULE_SETUP YY_BREAK case 149: YY_RULE_SETUP -#line 401 "program_lexer.l" +#line 399 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; @@ -2310,7 +2322,7 @@ YY_RULE_SETUP YY_BREAK case 150: YY_RULE_SETUP -#line 407 "program_lexer.l" +#line 405 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@ -2320,7 +2332,7 @@ YY_RULE_SETUP YY_BREAK case 151: YY_RULE_SETUP -#line 413 "program_lexer.l" +#line 411 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@ -2330,7 +2342,7 @@ YY_RULE_SETUP YY_BREAK case 152: YY_RULE_SETUP -#line 419 "program_lexer.l" +#line 417 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; @@ -2339,7 +2351,7 @@ YY_RULE_SETUP YY_BREAK case 153: YY_RULE_SETUP -#line 425 "program_lexer.l" +#line 423 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@ -2349,7 +2361,7 @@ YY_RULE_SETUP YY_BREAK case 154: YY_RULE_SETUP -#line 432 "program_lexer.l" +#line 430 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@ -2361,7 +2373,7 @@ YY_RULE_SETUP YY_BREAK case 155: YY_RULE_SETUP -#line 441 "program_lexer.l" +#line 439 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; @@ -2370,7 +2382,7 @@ YY_RULE_SETUP YY_BREAK case 156: YY_RULE_SETUP -#line 447 "program_lexer.l" +#line 445 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@ -2380,7 +2392,7 @@ YY_RULE_SETUP YY_BREAK case 157: YY_RULE_SETUP -#line 453 "program_lexer.l" +#line 451 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; @@ -2389,7 +2401,7 @@ YY_RULE_SETUP YY_BREAK case 158: YY_RULE_SETUP -#line 458 "program_lexer.l" +#line 456 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; @@ -2398,7 +2410,7 @@ YY_RULE_SETUP YY_BREAK case 159: YY_RULE_SETUP -#line 464 "program_lexer.l" +#line 462 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@ -2408,7 +2420,7 @@ YY_RULE_SETUP YY_BREAK case 160: YY_RULE_SETUP -#line 470 "program_lexer.l" +#line 468 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@ -2418,7 +2430,7 @@ YY_RULE_SETUP YY_BREAK case 161: YY_RULE_SETUP -#line 476 "program_lexer.l" +#line 474 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; @@ -2427,7 +2439,7 @@ YY_RULE_SETUP YY_BREAK case 162: YY_RULE_SETUP -#line 482 "program_lexer.l" +#line 480 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@ -2437,7 +2449,7 @@ YY_RULE_SETUP YY_BREAK case 163: YY_RULE_SETUP -#line 490 "program_lexer.l" +#line 488 "program_lexer.l" { if (require_ARB_vp) { return TEXGEN_R; @@ -2451,7 +2463,7 @@ YY_RULE_SETUP YY_BREAK case 164: YY_RULE_SETUP -#line 501 "program_lexer.l" +#line 499 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@ -2463,13 +2475,13 @@ YY_RULE_SETUP YY_BREAK case 165: YY_RULE_SETUP -#line 510 "program_lexer.l" +#line 508 "program_lexer.l" { return DOT; } YY_BREAK case 166: /* rule 166 can match eol */ YY_RULE_SETUP -#line 512 "program_lexer.l" +#line 510 "program_lexer.l" { yylloc->first_line++; yylloc->first_column = 1; @@ -2480,7 +2492,7 @@ YY_RULE_SETUP YY_BREAK case 167: YY_RULE_SETUP -#line 519 "program_lexer.l" +#line 517 "program_lexer.l" /* eat whitespace */ ; YY_BREAK case 168: @@ -2488,20 +2500,20 @@ case 168: yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 520 "program_lexer.l" +#line 518 "program_lexer.l" /* eat comments */ ; YY_BREAK case 169: YY_RULE_SETUP -#line 521 "program_lexer.l" +#line 519 "program_lexer.l" { return yytext[0]; } YY_BREAK case 170: YY_RULE_SETUP -#line 522 "program_lexer.l" +#line 520 "program_lexer.l" ECHO; YY_BREAK -#line 2505 "lex.yy.c" +#line 2517 "lex.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -3269,8 +3281,8 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner) /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. - * @param bytes the byte buffer to scan - * @param len the number of bytes in the buffer pointed to by @a bytes. + * @param yybytes the byte buffer to scan + * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ @@ -3676,7 +3688,7 @@ void yyfree (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 522 "program_lexer.l" +#line 520 "program_lexer.l" diff --git a/src/mesa/shader/program_lexer.l b/src/mesa/shader/program_lexer.l index b50fb3c7dc..e8dae7bc26 100644 --- a/src/mesa/shader/program_lexer.l +++ b/src/mesa/shader/program_lexer.l @@ -46,8 +46,7 @@ if (condition) { \ return token; \ } else { \ - yylval->string = return_string(yyextra, yytext); \ - return IDENTIFIER; \ + return handle_ident(yyextra, yytext, yylval); \ } \ } while (0) @@ -71,8 +70,7 @@ yylval->temp_inst.Opcode = OPCODE_ ## opcode; \ return token; \ } else { \ - yylval->string = return_string(yyextra, yytext); \ - return IDENTIFIER; \ + return handle_ident(yyextra, yytext, yylval); \ } \ } while (0) @@ -163,7 +161,7 @@ swiz_from_char(char c) static int handle_ident(struct asm_parser_state *state, const char *text, YYSTYPE *lval) { - lval->string = strdup(text); + lval->string = return_string(state, text); return (_mesa_symbol_table_find_symbol(state->st, 0, text) == NULL) ? IDENTIFIER : USED_IDENTIFIER; -- cgit v1.2.3 From b8fdb900fb9b1c8b1e9ec88509624237307a869a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 31 Oct 2009 08:07:23 -0600 Subject: mesa: make _mesa_get_current_tex_objec() public --- src/mesa/main/teximage.c | 61 ++++++++++++++++++++++++------------------------ src/mesa/main/teximage.h | 3 +++ 2 files changed, 33 insertions(+), 31 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 69ef2cca5e..b10076875b 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -582,6 +582,17 @@ _mesa_select_tex_object(GLcontext *ctx, const struct gl_texture_unit *texUnit, } +/** + * Return pointer to texture object for given target on current texture unit. + */ +struct gl_texture_object * +_mesa_get_current_tex_object(GLcontext *ctx, GLenum target) +{ + struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); + return _mesa_select_tex_object(ctx, texUnit, target); +} + + /** * Get a texture image pointer from a texture object, given a texture * target and mipmap level. The target and level parameters should @@ -963,18 +974,6 @@ _mesa_clear_texture_image(GLcontext *ctx, struct gl_texture_image *texImage) } -/** - * Return pointer to texture object for given target on current texture unit. - */ -static struct gl_texture_object * -get_current_tex_object(GLcontext *ctx, GLenum target) -{ - struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); - return _mesa_select_tex_object(ctx, texUnit, target); -} - - - /** * This is the fallback for Driver.TestProxyTexImage(). Test the texture * level, width, height and depth against the ctx->Const limits for textures. @@ -2128,7 +2127,7 @@ _mesa_TexImage1D( GLenum target, GLint level, GLint internalFormat, if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); - texObj = get_current_tex_object(ctx, target); + texObj = _mesa_get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { texImage = _mesa_get_tex_image(ctx, texObj, target, level); @@ -2249,7 +2248,7 @@ _mesa_TexImage2D( GLenum target, GLint level, GLint internalFormat, if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); - texObj = get_current_tex_object(ctx, target); + texObj = _mesa_get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { texImage = _mesa_get_tex_image(ctx, texObj, target, level); @@ -2365,7 +2364,7 @@ _mesa_TexImage3D( GLenum target, GLint level, GLint internalFormat, if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) _mesa_update_state(ctx); - texObj = get_current_tex_object(ctx, target); + texObj = _mesa_get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { texImage = _mesa_get_tex_image(ctx, texObj, target, level); @@ -2457,7 +2456,7 @@ _mesa_TexSubImage1D( GLenum target, GLint level, { GLsizei postConvWidth = width; struct gl_texture_object *texObj; - struct gl_texture_image *texImage = NULL; + struct gl_texture_image *texImage; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); @@ -2483,7 +2482,7 @@ _mesa_TexSubImage1D( GLenum target, GLint level, } - texObj = get_current_tex_object(ctx, target); + texObj = _mesa_get_current_tex_object(ctx, target); assert(texObj); _mesa_lock_texture(ctx, texObj); @@ -2549,7 +2548,7 @@ _mesa_TexSubImage2D( GLenum target, GLint level, return; /* error was detected */ } - texObj = get_current_tex_object(ctx, target); + texObj = _mesa_get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -2607,7 +2606,7 @@ _mesa_TexSubImage3D( GLenum target, GLint level, return; /* error was detected */ } - texObj = get_current_tex_object(ctx, target); + texObj = _mesa_get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -2674,7 +2673,7 @@ _mesa_CopyTexImage1D( GLenum target, GLint level, postConvWidth, 1, border)) return; - texObj = get_current_tex_object(ctx, target); + texObj = _mesa_get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -2753,7 +2752,7 @@ _mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat, postConvWidth, postConvHeight, border)) return; - texObj = get_current_tex_object(ctx, target); + texObj = _mesa_get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -2825,7 +2824,7 @@ _mesa_CopyTexSubImage1D( GLenum target, GLint level, if (copytexsubimage_error_check1(ctx, 1, target, level)) return; - texObj = get_current_tex_object(ctx, target); + texObj = _mesa_get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -2885,7 +2884,7 @@ _mesa_CopyTexSubImage2D( GLenum target, GLint level, if (copytexsubimage_error_check1(ctx, 2, target, level)) return; - texObj = get_current_tex_object(ctx, target); + texObj = _mesa_get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -2948,7 +2947,7 @@ _mesa_CopyTexSubImage3D( GLenum target, GLint level, if (copytexsubimage_error_check1(ctx, 3, target, level)) return; - texObj = get_current_tex_object(ctx, target); + texObj = _mesa_get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -3282,7 +3281,7 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level, return; } - texObj = get_current_tex_object(ctx, target); + texObj = _mesa_get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -3344,7 +3343,7 @@ _mesa_CompressedTexImage1DARB(GLenum target, GLint level, struct gl_texture_object *texObj; struct gl_texture_image *texImage; - texObj = get_current_tex_object(ctx, target); + texObj = _mesa_get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -3392,7 +3391,7 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level, return; } - texObj = get_current_tex_object(ctx, target); + texObj = _mesa_get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -3456,7 +3455,7 @@ _mesa_CompressedTexImage2DARB(GLenum target, GLint level, struct gl_texture_object *texObj; struct gl_texture_image *texImage; - texObj = get_current_tex_object(ctx, target); + texObj = _mesa_get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -3500,7 +3499,7 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level, return; } - texObj = get_current_tex_object(ctx, target); + texObj = _mesa_get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -3564,7 +3563,7 @@ _mesa_CompressedTexImage3DARB(GLenum target, GLint level, struct gl_texture_object *texObj; struct gl_texture_image *texImage; - texObj = get_current_tex_object(ctx, target); + texObj = _mesa_get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { @@ -3606,7 +3605,7 @@ compressed_tex_sub_image(GLuint dims, GLenum target, GLint level, return; } - texObj = get_current_tex_object(ctx, target); + texObj = _mesa_get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); { diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h index 094177da79..97c9018319 100644 --- a/src/mesa/main/teximage.h +++ b/src/mesa/main/teximage.h @@ -86,6 +86,9 @@ extern struct gl_texture_object * _mesa_select_tex_object(GLcontext *ctx, const struct gl_texture_unit *texUnit, GLenum target); +extern struct gl_texture_object * +_mesa_get_current_tex_object(GLcontext *ctx, GLenum target); + extern struct gl_texture_image * _mesa_select_tex_image(GLcontext *ctx, const struct gl_texture_object *texObj, -- cgit v1.2.3 From 1afe60e802e22318a7a10a8ab2fa4f8222f98e31 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 31 Oct 2009 08:07:46 -0600 Subject: mesa: use _mesa_get_current_tex_object() --- src/mesa/main/texgetimage.c | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index e4a9ac14b1..2f88718933 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -559,7 +559,6 @@ static GLboolean getteximage_error_check(GLcontext *ctx, GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels ) { - const struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; const GLuint maxLevels = _mesa_max_texture_levels(ctx, target); @@ -613,8 +612,7 @@ getteximage_error_check(GLcontext *ctx, GLenum target, GLint level, return GL_TRUE; } - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + texObj = _mesa_get_current_tex_object(ctx, target); if (!texObj || _mesa_is_proxy_texture(target)) { _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(target)"); @@ -703,7 +701,6 @@ void GLAPIENTRY _mesa_GetTexImage( GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels ) { - const struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; GET_CURRENT_CONTEXT(ctx); @@ -718,8 +715,7 @@ _mesa_GetTexImage( GLenum target, GLint level, GLenum format, return; } - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + texObj = _mesa_get_current_tex_object(ctx, target); texImage = _mesa_select_tex_image(ctx, texObj, target, level); if (MESA_VERBOSE & (VERBOSE_API | VERBOSE_TEXTURE)) { @@ -749,7 +745,6 @@ static GLboolean getcompressedteximage_error_check(GLcontext *ctx, GLenum target, GLint level, GLvoid *img) { - const struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; const GLuint maxLevels = _mesa_max_texture_levels(ctx, target); @@ -773,9 +768,7 @@ getcompressedteximage_error_check(GLcontext *ctx, GLenum target, GLint level, return GL_TRUE; } - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); - + texObj = _mesa_get_current_tex_object(ctx, target); if (!texObj) { _mesa_error(ctx, GL_INVALID_ENUM, "glGetCompressedTexImageARB(target)"); return GL_TRUE; @@ -827,7 +820,6 @@ getcompressedteximage_error_check(GLcontext *ctx, GLenum target, GLint level, void GLAPIENTRY _mesa_GetCompressedTexImageARB(GLenum target, GLint level, GLvoid *img) { - const struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; GET_CURRENT_CONTEXT(ctx); @@ -842,8 +834,7 @@ _mesa_GetCompressedTexImageARB(GLenum target, GLint level, GLvoid *img) return; } - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + texObj = _mesa_get_current_tex_object(ctx, target); texImage = _mesa_select_tex_image(ctx, texObj, target, level); if (MESA_VERBOSE & (VERBOSE_API | VERBOSE_TEXTURE)) { -- cgit v1.2.3 From 7157479b253b3051f1ec454a39b2aff825bab047 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 31 Oct 2009 08:08:05 -0600 Subject: mesa: use _mesa_get_current_tex_object() --- src/mesa/drivers/common/meta.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 22cd6de564..a431519143 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -2464,7 +2464,6 @@ copy_tex_image(GLcontext *ctx, GLuint dims, GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) { - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; GLsizei postConvWidth = width, postConvHeight = height; @@ -2472,8 +2471,7 @@ copy_tex_image(GLcontext *ctx, GLuint dims, GLenum target, GLint level, GLint bpp; void *buf; - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + texObj = _mesa_get_current_tex_object(ctx, target); texImage = _mesa_get_tex_image(ctx, texObj, target, level); format = _mesa_base_tex_format(ctx, internalFormat); @@ -2583,15 +2581,13 @@ copy_tex_sub_image(GLcontext *ctx, GLuint dims, GLenum target, GLint level, GLint x, GLint y, GLsizei width, GLsizei height) { - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; GLenum format, type; GLint bpp; void *buf; - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + texObj = _mesa_get_current_tex_object(ctx, target); texImage = _mesa_select_tex_image(ctx, texObj, target, level); format = _mesa_get_format_base_format(texImage->TexFormat); -- cgit v1.2.3 From 644d8fd363ca7d8f40f4fa319919985cc002df9e Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Sat, 31 Oct 2009 08:08:19 -0600 Subject: mesa: added comment --- src/mesa/main/texparam.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 79298e867a..ab170cde35 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -79,6 +79,8 @@ validate_texture_wrap_mode(GLcontext * ctx, GLenum target, GLenum wrap) /** * Get current texture object for given target. * Return NULL if any error. + * Note that this is different from _mesa_select_tex_object() in that proxy + * targets are not accepted. */ static struct gl_texture_object * get_texobj(GLcontext *ctx, GLenum target) -- cgit v1.2.3 From 0197348641614188c400d7c616573bb7f1eea781 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 3 Nov 2009 09:26:32 -0700 Subject: st/mesa: fix tests for depth and depth/stencil texture formats --- src/mesa/state_tracker/st_cb_texture.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 50675b5896..e8e81ede00 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -1313,7 +1313,8 @@ fallback_copy_texsubimage(GLcontext *ctx, GLenum target, GLint level, srcX, srcY, width, height); - if (baseFormat == GL_DEPTH_COMPONENT && + if ((baseFormat == GL_DEPTH_COMPONENT || + baseFormat == GL_DEPTH_STENCIL) && pf_is_depth_and_stencil(stImage->pt->format)) transfer_usage = PIPE_TRANSFER_READ_WRITE; else @@ -1326,7 +1327,7 @@ fallback_copy_texsubimage(GLcontext *ctx, GLenum target, GLint level, destX, destY, width, height); if (baseFormat == GL_DEPTH_COMPONENT || - baseFormat == GL_DEPTH24_STENCIL8) { + baseFormat == GL_DEPTH_STENCIL) { const GLboolean scaleOrBias = (ctx->Pixel.DepthScale != 1.0F || ctx->Pixel.DepthBias != 0.0F); GLint row, yStep; @@ -1453,7 +1454,7 @@ st_copy_texsubimage(GLcontext *ctx, struct gl_texture_image *texImage = _mesa_select_tex_image(ctx, texObj, target, level); struct st_texture_image *stImage = st_texture_image(texImage); - const GLenum texBaseFormat = texImage->InternalFormat; + const GLenum texBaseFormat = texImage->_BaseFormat; struct gl_framebuffer *fb = ctx->ReadBuffer; struct st_renderbuffer *strb; struct pipe_context *pipe = ctx->st->pipe; @@ -1474,12 +1475,9 @@ st_copy_texsubimage(GLcontext *ctx, /* determine if copying depth or color data */ if (texBaseFormat == GL_DEPTH_COMPONENT || - texBaseFormat == GL_DEPTH24_STENCIL8) { + texBaseFormat == GL_DEPTH_STENCIL) { strb = st_renderbuffer(fb->_DepthBuffer); } - else if (texBaseFormat == GL_DEPTH_STENCIL_EXT) { - strb = st_renderbuffer(fb->_StencilBuffer); - } else { /* texBaseFormat == GL_RGB, GL_RGBA, GL_ALPHA, etc */ strb = st_renderbuffer(fb->_ColorReadBuffer); -- cgit v1.2.3 From e60ebebb392d1d4c47541766737b5a79685a24d5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 3 Nov 2009 09:30:20 -0700 Subject: st/mesa: don't use util_blit_pixels_writemask() for depth or depth/stencil util_blit_pixels_writemask() only works for color formats at this time. Also, it might never work for depth/stencil surfaces since we can't get handle stencil values in a fragment shader. Fixes glCopyTexSubImage(GL_DEPTH_COMPONENT). --- src/mesa/state_tracker/st_cb_texture.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index e8e81ede00..f45b3e6032 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -1560,6 +1560,8 @@ st_copy_texsubimage(GLcontext *ctx, use_fallback = GL_FALSE; } else if (format_writemask && + texBaseFormat != GL_DEPTH_COMPONENT && + texBaseFormat != GL_DEPTH_STENCIL && screen->is_format_supported(screen, src_format, PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_SAMPLER, -- cgit v1.2.3 From a0cd2b7029e1ac6699b807baa255e7fd2abe7f54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Tue, 3 Nov 2009 16:16:05 +0100 Subject: st/mesa: clip pixels in draw_stencil_pixels to avoid crash Signed-off-by: Brian Paul --- src/mesa/state_tracker/st_cb_drawpixels.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index c655690603..2a227a7fde 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -661,6 +661,15 @@ draw_stencil_pixels(GLcontext *ctx, GLint x, GLint y, const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0; GLint skipPixels; ubyte *stmap; + struct gl_pixelstore_attrib clippedUnpack = *unpack; + + if (!zoom) { + if (!_mesa_clip_drawpixels(ctx, &x, &y, &width, &height, + &clippedUnpack)) { + /* totally clipped */ + return; + } + } strb = st_renderbuffer(ctx->DrawBuffer-> Attachment[BUFFER_STENCIL].Renderbuffer); @@ -681,7 +690,7 @@ draw_stencil_pixels(GLcontext *ctx, GLint x, GLint y, stmap = screen->transfer_map(screen, pt); - pixels = _mesa_map_pbo_source(ctx, unpack, pixels); + pixels = _mesa_map_pbo_source(ctx, &clippedUnpack, pixels); assert(pixels); /* if width > MAX_WIDTH, have to process image in chunks */ @@ -694,17 +703,18 @@ draw_stencil_pixels(GLcontext *ctx, GLint x, GLint y, GLubyte sValues[MAX_WIDTH]; GLuint zValues[MAX_WIDTH]; GLenum destType = GL_UNSIGNED_BYTE; - const GLvoid *source = _mesa_image_address2d(unpack, pixels, + const GLvoid *source = _mesa_image_address2d(&clippedUnpack, pixels, width, height, format, type, row, skipPixels); _mesa_unpack_stencil_span(ctx, spanWidth, destType, sValues, - type, source, unpack, + type, source, &clippedUnpack, ctx->_ImageTransferState); if (format == GL_DEPTH_STENCIL) { _mesa_unpack_depth_span(ctx, spanWidth, GL_UNSIGNED_INT, zValues, - (1 << 24) - 1, type, source, unpack); + (1 << 24) - 1, type, source, + &clippedUnpack); } if (zoom) { @@ -775,7 +785,7 @@ draw_stencil_pixels(GLcontext *ctx, GLint x, GLint y, skipPixels += spanWidth; } - _mesa_unmap_pbo_source(ctx, unpack); + _mesa_unmap_pbo_source(ctx, &clippedUnpack); /* unmap the stencil buffer */ screen->transfer_unmap(screen, pt); -- cgit v1.2.3 From bcbfda71b03303d3f008a6f3cf8cb7d9667bf8d2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 2 Nov 2009 12:40:04 -0700 Subject: intel: avoid unnecessary front buffer flushing/updating Before, if we just called glXMakeCurrent() and didn't render anything we'd still trigger a flushFrontBuffer() call. Now only set the intel->front_buffer_dirty field at state validation time just before we draw something. NOTE: additional calls to intel_check_front_buffer_rendering() might be needed if I missed some rendering paths. --- src/mesa/drivers/dri/i915/intel_tris.c | 1 + src/mesa/drivers/dri/i965/brw_state_upload.c | 3 +++ src/mesa/drivers/dri/intel/intel_buffers.c | 21 +++++++++++++++++++-- src/mesa/drivers/dri/intel/intel_buffers.h | 2 ++ src/mesa/drivers/dri/intel/intel_span.c | 2 ++ 5 files changed, 27 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/intel_tris.c b/src/mesa/drivers/dri/i915/intel_tris.c index c3cbba8404..bc527aae47 100644 --- a/src/mesa/drivers/dri/i915/intel_tris.c +++ b/src/mesa/drivers/dri/i915/intel_tris.c @@ -1088,6 +1088,7 @@ intelRenderStart(GLcontext * ctx) { struct intel_context *intel = intel_context(ctx); + intel_check_front_buffer_rendering(intel); intel->vtbl.render_start(intel_context(ctx)); intel->vtbl.emit_state(intel); } diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index ee447afa62..f4283bda1b 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -34,6 +34,7 @@ #include "brw_context.h" #include "brw_state.h" #include "intel_batchbuffer.h" +#include "intel_buffers.h" /* This is used to initialize brw->state.atoms[]. We could use this * list directly except for a single atom, brw_constant_buffer, which @@ -324,6 +325,8 @@ void brw_validate_state( struct brw_context *brw ) } } + intel_check_front_buffer_rendering(intel); + /* Make sure that the textures which are referenced by the current * brw fragment program are actually present/valid. * If this fails, we can experience GPU lock-ups. diff --git a/src/mesa/drivers/dri/intel/intel_buffers.c b/src/mesa/drivers/dri/intel/intel_buffers.c index 639ffa6437..6b12d484d8 100644 --- a/src/mesa/drivers/dri/intel/intel_buffers.c +++ b/src/mesa/drivers/dri/intel/intel_buffers.c @@ -132,6 +132,25 @@ intel_get_cliprects(struct intel_context *intel, } +/** + * Check if we're about to draw into the front color buffer. + * If so, set the intel->front_buffer_dirty field to true. + */ +void +intel_check_front_buffer_rendering(struct intel_context *intel) +{ + const struct gl_framebuffer *fb = intel->ctx.DrawBuffer; + if (fb->Name == 0) { + /* drawing to window system buffer */ + if (fb->_NumColorDrawBuffers > 0) { + if (fb->_ColorDrawBufferIndexes[0] == BUFFER_FRONT_LEFT) { + intel->front_buffer_dirty = GL_TRUE; + } + } + } +} + + /** * Update the hardware state for drawing into a window or framebuffer object. * @@ -202,8 +221,6 @@ intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb) intel_batchbuffer_flush(intel->batch); intel->front_cliprects = GL_TRUE; colorRegions[0] = intel_get_rb_region(fb, BUFFER_FRONT_LEFT); - - intel->front_buffer_dirty = GL_TRUE; } else { if (!intel->constant_cliprect && intel->front_cliprects) diff --git a/src/mesa/drivers/dri/intel/intel_buffers.h b/src/mesa/drivers/dri/intel/intel_buffers.h index 6069d38e9e..d7800f2ca2 100644 --- a/src/mesa/drivers/dri/intel/intel_buffers.h +++ b/src/mesa/drivers/dri/intel/intel_buffers.h @@ -45,6 +45,8 @@ extern struct intel_region *intel_readbuf_region(struct intel_context *intel); extern struct intel_region *intel_drawbuf_region(struct intel_context *intel); +extern void intel_check_front_buffer_rendering(struct intel_context *intel); + extern void intel_draw_buffer(GLcontext * ctx, struct gl_framebuffer *fb); extern void intelInitBufferFuncs(struct dd_function_table *functions); diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index 638e05f2ad..bab13e3665 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -501,6 +501,8 @@ intel_map_unmap_framebuffer(struct intel_context *intel, else intel_renderbuffer_unmap(intel, fb->_StencilBuffer->Wrapped); } + + intel_check_front_buffer_rendering(intel); } /** -- cgit v1.2.3 From 2d11c48223adb78353ca32f0cc07941957310389 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 2 Nov 2009 12:58:51 -0700 Subject: mesa: added assertion, another comment --- src/mesa/main/buffers.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index d8b5f3b1f4..b5acda8823 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -344,7 +344,7 @@ _mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers) /** * Helper function to set the GL_DRAW_BUFFER state in the context and - * current FBO. + * current FBO. Called via glDrawBuffer(), glDrawBuffersARB() * * All error checking will have been done prior to calling this function * so nothing should go wrong at this point. @@ -392,6 +392,8 @@ _mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers, GLuint buf, count = 0; for (buf = 0; buf < n; buf++ ) { if (destMask[buf]) { + /* only one bit should be set in the destMask[buf] field */ + ASSERT(_mesa_bitcount(destMask[buf]) == 1); fb->_ColorDrawBufferIndexes[buf] = _mesa_ffs(destMask[buf]) - 1; fb->ColorDrawBuffer[buf] = buffers[buf]; count = buf + 1; -- cgit v1.2.3 From b28c637382cd3c3fcd54cd77062dab3df78230a9 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 2 Nov 2009 13:20:19 -0700 Subject: mesa: use ffs() to shorten loop in _mesa_drawbuffers() --- src/mesa/main/buffers.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index b5acda8823..cdd16a8ad1 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -375,15 +375,19 @@ _mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers, destMask = mask; } + /* + * If n==1, destMask[0] may have up to four bits set. + * Otherwise, destMask[x] can only have one bit set. + */ if (n == 1) { - GLuint buf, count = 0; + GLuint count = 0, destMask0 = destMask[0]; /* init to -1 to help catch errors */ fb->_ColorDrawBufferIndexes[0] = -1; - for (buf = 0; buf < BUFFER_COUNT; buf++) { - if (destMask[0] & (1 << buf)) { - fb->_ColorDrawBufferIndexes[count] = buf; - count++; - } + while (destMask0) { + GLint bufIndex = _mesa_ffs(destMask0) - 1; + fb->_ColorDrawBufferIndexes[count] = bufIndex; + count++; + destMask0 &= ~(1 << bufIndex); } fb->ColorDrawBuffer[0] = buffers[0]; fb->_NumColorDrawBuffers = count; -- cgit v1.2.3 From 8df699b3bb1aa05b633f05b121d09d812c86a22d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 2 Nov 2009 14:41:17 -0700 Subject: mesa: avoid extraneous _NEW_BUFFER state in _mesa_drawbuffers() --- src/mesa/main/buffers.c | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index cdd16a8ad1..028644fe4b 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -362,6 +362,7 @@ _mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers, { struct gl_framebuffer *fb = ctx->DrawBuffer; GLbitfield mask[MAX_DRAW_BUFFERS]; + GLboolean newState = GL_FALSE; if (!destMask) { /* compute destMask values now */ @@ -382,35 +383,50 @@ _mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers, if (n == 1) { GLuint count = 0, destMask0 = destMask[0]; /* init to -1 to help catch errors */ - fb->_ColorDrawBufferIndexes[0] = -1; + //fb->_ColorDrawBufferIndexes[0] = -1; while (destMask0) { GLint bufIndex = _mesa_ffs(destMask0) - 1; - fb->_ColorDrawBufferIndexes[count] = bufIndex; + if (fb->_ColorDrawBufferIndexes[count] != bufIndex) { + fb->_ColorDrawBufferIndexes[count] = bufIndex; + newState = GL_TRUE; + } count++; destMask0 &= ~(1 << bufIndex); } fb->ColorDrawBuffer[0] = buffers[0]; - fb->_NumColorDrawBuffers = count; + if (fb->_NumColorDrawBuffers != count) { + fb->_NumColorDrawBuffers = count; + newState = GL_TRUE; + } } else { GLuint buf, count = 0; for (buf = 0; buf < n; buf++ ) { if (destMask[buf]) { + GLint bufIndex = _mesa_ffs(destMask[buf]) - 1; /* only one bit should be set in the destMask[buf] field */ ASSERT(_mesa_bitcount(destMask[buf]) == 1); - fb->_ColorDrawBufferIndexes[buf] = _mesa_ffs(destMask[buf]) - 1; + if (fb->_ColorDrawBufferIndexes[buf] != bufIndex) { + fb->_ColorDrawBufferIndexes[buf] = bufIndex; + newState = GL_TRUE; + } fb->ColorDrawBuffer[buf] = buffers[buf]; count = buf + 1; } else { - fb->_ColorDrawBufferIndexes[buf] = -1; + if (fb->_ColorDrawBufferIndexes[buf] != -1) { + fb->_ColorDrawBufferIndexes[buf] = -1; + newState = GL_TRUE; + } } } /* set remaining outputs to -1 (GL_NONE) */ while (buf < ctx->Const.MaxDrawBuffers) { - fb->_ColorDrawBufferIndexes[buf] = -1; + if (fb->_ColorDrawBufferIndexes[buf] != -1) { + fb->_ColorDrawBufferIndexes[buf] = -1; + buf++; + } fb->ColorDrawBuffer[buf] = GL_NONE; - buf++; } fb->_NumColorDrawBuffers = count; } @@ -419,11 +435,15 @@ _mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers, /* also set context drawbuffer state */ GLuint buf; for (buf = 0; buf < ctx->Const.MaxDrawBuffers; buf++) { - ctx->Color.DrawBuffer[buf] = fb->ColorDrawBuffer[buf]; + if (ctx->Color.DrawBuffer[buf] != fb->ColorDrawBuffer[buf]) { + ctx->Color.DrawBuffer[buf] = fb->ColorDrawBuffer[buf]; + newState = GL_TRUE; + } } } - ctx->NewState |= _NEW_BUFFERS; + if (newState) + ctx->NewState |= _NEW_BUFFERS; } -- cgit v1.2.3 From c7048f9d9f91ef8c3ef35e31976adbf686349c41 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 2 Nov 2009 15:27:57 -0700 Subject: mesa: use FLUSH_VERTICES() in _mesa_drawbuffers() --- src/mesa/main/buffers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index 028644fe4b..740ac3f4ae 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -443,7 +443,7 @@ _mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers, } if (newState) - ctx->NewState |= _NEW_BUFFERS; + FLUSH_VERTICES(ctx, _NEW_BUFFERS); } -- cgit v1.2.3 From 18af75e5011cc31b52d62befba2cacfd353ce638 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 2 Nov 2009 15:29:03 -0700 Subject: mesa: avoid extraneous _NEW_BUFFER changes in _mesa_BindFramebufferEXT() --- src/mesa/main/fbobject.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 4c6528bcf7..4229ede8c0 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1228,8 +1228,6 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) return; } - FLUSH_CURRENT(ctx, _NEW_BUFFERS); - if (framebuffer) { /* Binding a user-created framebuffer object */ newFb = _mesa_lookup_framebuffer(ctx, framebuffer); @@ -1268,12 +1266,14 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) /* * OK, now bind the new Draw/Read framebuffers, if they're changing. */ - if (bindReadBuf) { - if (ctx->ReadBuffer == newFbread) + if (ctx->ReadBuffer == newFbread) { bindReadBuf = GL_FALSE; /* no change */ - else + } + else { + FLUSH_VERTICES(ctx, _NEW_BUFFERS); _mesa_reference_framebuffer(&ctx->ReadBuffer, newFbread); + } } if (bindDrawBuf) { @@ -1282,10 +1282,13 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) check_end_texture_render(ctx, ctx->DrawBuffer); } - if (ctx->DrawBuffer == newFb) + if (ctx->DrawBuffer == newFb) { bindDrawBuf = GL_FALSE; /* no change */ - else + } + else { + FLUSH_VERTICES(ctx, _NEW_BUFFERS); _mesa_reference_framebuffer(&ctx->DrawBuffer, newFb); + } if (newFb->Name != 0) { /* check if newly bound framebuffer has any texture attachments */ -- cgit v1.2.3 From 5698d7cd7557659440f8417716839ba07cffc5a5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 2 Nov 2009 15:29:54 -0700 Subject: mesa: clean-up formatting --- src/mesa/main/buffers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index 740ac3f4ae..e76cf87cb0 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -338,7 +338,7 @@ _mesa_DrawBuffersARB(GLsizei n, const GLenum *buffers) if (ctx->Driver.DrawBuffers) ctx->Driver.DrawBuffers(ctx, n, buffers); else if (ctx->Driver.DrawBuffer) - ctx->Driver.DrawBuffer(ctx, n>0? buffers[0]:GL_NONE); + ctx->Driver.DrawBuffer(ctx, n > 0 ? buffers[0] : GL_NONE); } -- cgit v1.2.3 From 4de18fb093e700ee33ed49035ab77f4a9453329a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 2 Nov 2009 15:30:51 -0700 Subject: mesa: fix indentation --- src/mesa/main/fbobject.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 4229ede8c0..f9aea27860 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -712,8 +712,7 @@ _mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer) ASSERT_OUTSIDE_BEGIN_END(ctx); if (target != GL_RENDERBUFFER_EXT) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glBindRenderbufferEXT(target)"); + _mesa_error(ctx, GL_INVALID_ENUM, "glBindRenderbufferEXT(target)"); return; } -- cgit v1.2.3 From 800e553e7a1703e33e54f45d0638b67001665fc5 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 2 Nov 2009 15:39:39 -0700 Subject: mesa: clean-up, remove some flushing in FBO functions Remove some unneeded flushes. Replace FLUSH_CURRENT w/ FLUSH_VERTICES in other places. --- src/mesa/main/fbobject.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index f9aea27860..319d0f2ce9 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -716,7 +716,9 @@ _mesa_BindRenderbufferEXT(GLenum target, GLuint renderbuffer) return; } - FLUSH_CURRENT(ctx, _NEW_BUFFERS); + /* No need to flush here since the render buffer binding has no + * effect on rendering state. + */ if (renderbuffer) { newRb = _mesa_lookup_renderbuffer(ctx, renderbuffer); @@ -1093,7 +1095,9 @@ _mesa_GetRenderbufferParameterivEXT(GLenum target, GLenum pname, GLint *params) return; } - FLUSH_VERTICES(ctx, _NEW_BUFFERS); + /* No need to flush here since we're just quering state which is + * not effected by rendering. + */ switch (pname) { case GL_RENDERBUFFER_WIDTH_EXT: @@ -1308,7 +1312,7 @@ _mesa_DeleteFramebuffersEXT(GLsizei n, const GLuint *framebuffers) GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); - FLUSH_CURRENT(ctx, _NEW_BUFFERS); + FLUSH_VERTICES(ctx, _NEW_BUFFERS); for (i = 0; i < n; i++) { if (framebuffers[i] > 0) { @@ -1413,7 +1417,7 @@ _mesa_CheckFramebufferStatusEXT(GLenum target) return GL_FRAMEBUFFER_COMPLETE_EXT; } - FLUSH_VERTICES(ctx, _NEW_BUFFERS); + /* No need to flush here */ if (buffer->_Status != GL_FRAMEBUFFER_COMPLETE) { _mesa_test_framebuffer_completeness(ctx, buffer); @@ -1529,7 +1533,7 @@ framebuffer_texture(GLcontext *ctx, const char *caller, GLenum target, return; } - FLUSH_CURRENT(ctx, _NEW_BUFFERS); + FLUSH_VERTICES(ctx, _NEW_BUFFERS); _glthread_LOCK_MUTEX(fb->Mutex); if (texObj) { @@ -1709,7 +1713,7 @@ _mesa_FramebufferRenderbufferEXT(GLenum target, GLenum attachment, } - FLUSH_CURRENT(ctx, _NEW_BUFFERS); + FLUSH_VERTICES(ctx, _NEW_BUFFERS); assert(ctx->Driver.FramebufferRenderbuffer); ctx->Driver.FramebufferRenderbuffer(ctx, fb, attachment, rb); @@ -1785,7 +1789,7 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, } } - FLUSH_CURRENT(ctx, _NEW_BUFFERS); + /* No need to flush here */ switch (pname) { case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT: -- cgit v1.2.3 From e713a95c96e4af9d3b97ab8383fff3ccf98b012d Mon Sep 17 00:00:00 2001 From: Karl Schultz Date: Tue, 3 Nov 2009 16:05:12 -0700 Subject: mesa: added GLAPIENTRY keywords for sync object functions Signed-off-by: Brian Paul --- src/mesa/main/syncobj.c | 12 ++++++------ src/mesa/main/syncobj.h | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/syncobj.c b/src/mesa/main/syncobj.c index 64f923ff91..ac3f9eb175 100644 --- a/src/mesa/main/syncobj.c +++ b/src/mesa/main/syncobj.c @@ -190,7 +190,7 @@ _mesa_unref_sync_object(GLcontext *ctx, struct gl_sync_object *syncObj) } -GLboolean +GLboolean GLAPIENTRY _mesa_IsSync(GLsync sync) { GET_CURRENT_CONTEXT(ctx); @@ -201,7 +201,7 @@ _mesa_IsSync(GLsync sync) } -void +void GLAPIENTRY _mesa_DeleteSync(GLsync sync) { GET_CURRENT_CONTEXT(ctx); @@ -231,7 +231,7 @@ _mesa_DeleteSync(GLsync sync) } -GLsync +GLsync GLAPIENTRY _mesa_FenceSync(GLenum condition, GLbitfield flags) { GET_CURRENT_CONTEXT(ctx); @@ -278,7 +278,7 @@ _mesa_FenceSync(GLenum condition, GLbitfield flags) } -GLenum +GLenum GLAPIENTRY _mesa_ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout) { GET_CURRENT_CONTEXT(ctx); @@ -319,7 +319,7 @@ _mesa_ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout) } -void +void GLAPIENTRY _mesa_WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout) { GET_CURRENT_CONTEXT(ctx); @@ -348,7 +348,7 @@ _mesa_WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout) } -void +void GLAPIENTRY _mesa_GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values) { diff --git a/src/mesa/main/syncobj.h b/src/mesa/main/syncobj.h index fc160af289..f23fa281e2 100644 --- a/src/mesa/main/syncobj.h +++ b/src/mesa/main/syncobj.h @@ -48,22 +48,22 @@ _mesa_ref_sync_object(GLcontext *ctx, struct gl_sync_object *syncObj); extern void _mesa_unref_sync_object(GLcontext *ctx, struct gl_sync_object *syncObj); -extern GLboolean +extern GLboolean GLAPIENTRY _mesa_IsSync(GLsync sync); -extern void +extern void GLAPIENTRY _mesa_DeleteSync(GLsync sync); -extern GLsync +extern GLsync GLAPIENTRY _mesa_FenceSync(GLenum condition, GLbitfield flags); -extern GLenum +extern GLenum GLAPIENTRY _mesa_ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout); -extern void +extern void GLAPIENTRY _mesa_WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout); -extern void +extern void GLAPIENTRY _mesa_GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values); -- cgit v1.2.3 From 077eb0d81ca88a8f2b9182b3a274b11a81bab974 Mon Sep 17 00:00:00 2001 From: Karl Schultz Date: Tue, 3 Nov 2009 16:07:01 -0700 Subject: windows: remove old entrypoints from mesa.def file Signed-off-by: Brian Paul --- src/mesa/drivers/windows/gdi/mesa.def | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/windows/gdi/mesa.def b/src/mesa/drivers/windows/gdi/mesa.def index bd3e5b2137..05817fde16 100644 --- a/src/mesa/drivers/windows/gdi/mesa.def +++ b/src/mesa/drivers/windows/gdi/mesa.def @@ -867,12 +867,6 @@ EXPORTS _glapi_get_proc_address _mesa_add_soft_renderbuffers _mesa_add_renderbuffer - _mesa_begin_query - _mesa_buffer_data - _mesa_buffer_get_subdata - _mesa_buffer_map - _mesa_buffer_subdata - _mesa_buffer_unmap _mesa_bzero _mesa_calloc _mesa_choose_tex_format @@ -880,9 +874,7 @@ EXPORTS _mesa_create_framebuffer _mesa_create_visual _mesa_delete_array_object - _mesa_delete_buffer_object _mesa_delete_program - _mesa_delete_query _mesa_delete_texture_object _mesa_destroy_framebuffer _mesa_destroy_visual @@ -892,7 +884,6 @@ EXPORTS _mesa_enable_2_0_extensions _mesa_enable_2_1_extensions _mesa_enable_sw_extensions - _mesa_end_query _mesa_error _mesa_finish_render_texture _mesa_framebuffer_renderbuffer @@ -911,10 +902,8 @@ EXPORTS _mesa_memcpy _mesa_memset _mesa_new_array_object - _mesa_new_buffer_object _mesa_new_framebuffer _mesa_new_program - _mesa_new_query_object _mesa_new_renderbuffer _mesa_new_soft_renderbuffer _mesa_new_texture_image @@ -943,7 +932,6 @@ EXPORTS _mesa_update_framebuffer_visual _mesa_use_program _mesa_Viewport - _mesa_wait_query _swrast_Accum _swrast_Bitmap _swrast_BlitFramebuffer -- cgit v1.2.3 From 6eb71519f7d08344b7f9819db22980f9c6fade3c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 3 Nov 2009 16:13:22 -0700 Subject: mesa: (GLint64) casts in get.c to silence Visual Studio warnings Revised version of a patch from Karl Schultz. --- src/mesa/main/get.c | 344 +++++++++++++++++++++++------------------------ src/mesa/main/get_gen.py | 2 +- 2 files changed, 173 insertions(+), 173 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 477ed01030..604b106217 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -5580,16 +5580,16 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) switch (pname) { case GL_ACCUM_RED_BITS: - params[0] = ctx->DrawBuffer->Visual.accumRedBits; + params[0] = (GLint64)(ctx->DrawBuffer->Visual.accumRedBits); break; case GL_ACCUM_GREEN_BITS: - params[0] = ctx->DrawBuffer->Visual.accumGreenBits; + params[0] = (GLint64)(ctx->DrawBuffer->Visual.accumGreenBits); break; case GL_ACCUM_BLUE_BITS: - params[0] = ctx->DrawBuffer->Visual.accumBlueBits; + params[0] = (GLint64)(ctx->DrawBuffer->Visual.accumBlueBits); break; case GL_ACCUM_ALPHA_BITS: - params[0] = ctx->DrawBuffer->Visual.accumAlphaBits; + params[0] = (GLint64)(ctx->DrawBuffer->Visual.accumAlphaBits); break; case GL_ACCUM_CLEAR_VALUE: params[0] = FLOAT_TO_INT64(ctx->Accum.ClearColor[0]); @@ -5601,7 +5601,7 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) params[0] = IROUND64(ctx->Pixel.AlphaBias); break; case GL_ALPHA_BITS: - params[0] = ctx->DrawBuffer->Visual.alphaBits; + params[0] = (GLint64)(ctx->DrawBuffer->Visual.alphaBits); break; case GL_ALPHA_SCALE: params[0] = IROUND64(ctx->Pixel.AlphaScale); @@ -5616,13 +5616,13 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) params[0] = FLOAT_TO_INT64(ctx->Color.AlphaRef); break; case GL_ATTRIB_STACK_DEPTH: - params[0] = ctx->AttribStackDepth; + params[0] = (GLint64)(ctx->AttribStackDepth); break; case GL_AUTO_NORMAL: params[0] = BOOLEAN_TO_INT64(ctx->Eval.AutoNormal); break; case GL_AUX_BUFFERS: - params[0] = ctx->DrawBuffer->Visual.numAuxBuffers; + params[0] = (GLint64)(ctx->DrawBuffer->Visual.numAuxBuffers); break; case GL_BLEND: params[0] = BOOLEAN_TO_INT64(ctx->Color.BlendEnabled); @@ -5661,13 +5661,13 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) params[0] = IROUND64(ctx->Pixel.BlueBias); break; case GL_BLUE_BITS: - params[0] = ctx->DrawBuffer->Visual.blueBits; + params[0] = (GLint64)(ctx->DrawBuffer->Visual.blueBits); break; case GL_BLUE_SCALE: params[0] = IROUND64(ctx->Pixel.BlueScale); break; case GL_CLIENT_ATTRIB_STACK_DEPTH: - params[0] = ctx->ClientAttribStackDepth; + params[0] = (GLint64)(ctx->ClientAttribStackDepth); break; case GL_CLIP_PLANE0: params[0] = BOOLEAN_TO_INT64((ctx->Transform.ClipPlanesEnabled >> 0) & 1); @@ -5703,10 +5703,10 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) params[0] = ENUM_TO_INT64(ctx->Light.ColorMaterialMode); break; case GL_COLOR_WRITEMASK: - params[0] = ctx->Color.ColorMask[RCOMP] ? 1 : 0; - params[1] = ctx->Color.ColorMask[GCOMP] ? 1 : 0; - params[2] = ctx->Color.ColorMask[BCOMP] ? 1 : 0; - params[3] = ctx->Color.ColorMask[ACOMP] ? 1 : 0; + params[0] = (GLint64)(ctx->Color.ColorMask[RCOMP] ? 1 : 0); + params[1] = (GLint64)(ctx->Color.ColorMask[GCOMP] ? 1 : 0); + params[2] = (GLint64)(ctx->Color.ColorMask[BCOMP] ? 1 : 0); + params[3] = (GLint64)(ctx->Color.ColorMask[ACOMP] ? 1 : 0); break; case GL_CULL_FACE: params[0] = BOOLEAN_TO_INT64(ctx->Polygon.CullFlag); @@ -5787,7 +5787,7 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) params[0] = IROUND64(ctx->Pixel.DepthBias); break; case GL_DEPTH_BITS: - params[0] = ctx->DrawBuffer->Visual.depthBits; + params[0] = (GLint64)(ctx->DrawBuffer->Visual.depthBits); break; case GL_DEPTH_CLEAR_VALUE: params[0] = FLOAT_TO_INT64(((GLfloat) ctx->Depth.Clear)); @@ -5824,7 +5824,7 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) } break; case GL_FEEDBACK_BUFFER_SIZE: - params[0] = ctx->Feedback.BufferSize; + params[0] = (GLint64)(ctx->Feedback.BufferSize); break; case GL_FEEDBACK_BUFFER_TYPE: params[0] = ENUM_TO_INT64(ctx->Feedback.Type); @@ -5863,28 +5863,28 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) params[0] = IROUND64(ctx->Pixel.GreenBias); break; case GL_GREEN_BITS: - params[0] = ctx->DrawBuffer->Visual.greenBits; + params[0] = (GLint64)(ctx->DrawBuffer->Visual.greenBits); break; case GL_GREEN_SCALE: params[0] = IROUND64(ctx->Pixel.GreenScale); break; case GL_INDEX_BITS: - params[0] = ctx->DrawBuffer->Visual.indexBits; + params[0] = (GLint64)(ctx->DrawBuffer->Visual.indexBits); break; case GL_INDEX_CLEAR_VALUE: - params[0] = ctx->Color.ClearIndex; + params[0] = (GLint64)(ctx->Color.ClearIndex); break; case GL_INDEX_MODE: params[0] = BOOLEAN_TO_INT64(!ctx->DrawBuffer->Visual.rgbMode); break; case GL_INDEX_OFFSET: - params[0] = ctx->Pixel.IndexOffset; + params[0] = (GLint64)(ctx->Pixel.IndexOffset); break; case GL_INDEX_SHIFT: - params[0] = ctx->Pixel.IndexShift; + params[0] = (GLint64)(ctx->Pixel.IndexShift); break; case GL_INDEX_WRITEMASK: - params[0] = ctx->Color.IndexMask; + params[0] = (GLint64)(ctx->Color.IndexMask); break; case GL_LIGHT0: params[0] = BOOLEAN_TO_INT64(ctx->Light.Light[0].Enabled); @@ -5938,10 +5938,10 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) params[0] = BOOLEAN_TO_INT64(ctx->Line.StippleFlag); break; case GL_LINE_STIPPLE_PATTERN: - params[0] = ctx->Line.StipplePattern; + params[0] = (GLint64)(ctx->Line.StipplePattern); break; case GL_LINE_STIPPLE_REPEAT: - params[0] = ctx->Line.StippleFactor; + params[0] = (GLint64)(ctx->Line.StippleFactor); break; case GL_LINE_WIDTH: params[0] = IROUND64(ctx->Line.Width); @@ -5958,10 +5958,10 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) params[1] = IROUND64(ctx->Const.MaxLineWidth); break; case GL_LIST_BASE: - params[0] = ctx->List.ListBase; + params[0] = (GLint64)(ctx->List.ListBase); break; case GL_LIST_INDEX: - params[0] = (ctx->ListState.CurrentList ? ctx->ListState.CurrentList->Name : 0); + params[0] = (GLint64)((ctx->ListState.CurrentList ? ctx->ListState.CurrentList->Name : 0)); break; case GL_LIST_MODE: { @@ -5992,7 +5992,7 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) params[1] = IROUND64(ctx->Eval.MapGrid1u2); break; case GL_MAP1_GRID_SEGMENTS: - params[0] = ctx->Eval.MapGrid1un; + params[0] = (GLint64)(ctx->Eval.MapGrid1un); break; case GL_MAP1_INDEX: params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map1Index); @@ -6028,8 +6028,8 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) params[3] = IROUND64(ctx->Eval.MapGrid2v2); break; case GL_MAP2_GRID_SEGMENTS: - params[0] = ctx->Eval.MapGrid2un; - params[1] = ctx->Eval.MapGrid2vn; + params[0] = (GLint64)(ctx->Eval.MapGrid2un); + params[1] = (GLint64)(ctx->Eval.MapGrid2vn); break; case GL_MAP2_INDEX: params[0] = BOOLEAN_TO_INT64(ctx->Eval.Map2Index); @@ -6065,53 +6065,53 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) params[0] = ENUM_TO_INT64(ctx->Transform.MatrixMode); break; case GL_MAX_ATTRIB_STACK_DEPTH: - params[0] = MAX_ATTRIB_STACK_DEPTH; + params[0] = (GLint64)(MAX_ATTRIB_STACK_DEPTH); break; case GL_MAX_CLIENT_ATTRIB_STACK_DEPTH: - params[0] = MAX_CLIENT_ATTRIB_STACK_DEPTH; + params[0] = (GLint64)(MAX_CLIENT_ATTRIB_STACK_DEPTH); break; case GL_MAX_CLIP_PLANES: - params[0] = ctx->Const.MaxClipPlanes; + params[0] = (GLint64)(ctx->Const.MaxClipPlanes); break; case GL_MAX_ELEMENTS_VERTICES: - params[0] = ctx->Const.MaxArrayLockSize; + params[0] = (GLint64)(ctx->Const.MaxArrayLockSize); break; case GL_MAX_ELEMENTS_INDICES: - params[0] = ctx->Const.MaxArrayLockSize; + params[0] = (GLint64)(ctx->Const.MaxArrayLockSize); break; case GL_MAX_EVAL_ORDER: - params[0] = MAX_EVAL_ORDER; + params[0] = (GLint64)(MAX_EVAL_ORDER); break; case GL_MAX_LIGHTS: - params[0] = ctx->Const.MaxLights; + params[0] = (GLint64)(ctx->Const.MaxLights); break; case GL_MAX_LIST_NESTING: - params[0] = MAX_LIST_NESTING; + params[0] = (GLint64)(MAX_LIST_NESTING); break; case GL_MAX_MODELVIEW_STACK_DEPTH: - params[0] = MAX_MODELVIEW_STACK_DEPTH; + params[0] = (GLint64)(MAX_MODELVIEW_STACK_DEPTH); break; case GL_MAX_NAME_STACK_DEPTH: - params[0] = MAX_NAME_STACK_DEPTH; + params[0] = (GLint64)(MAX_NAME_STACK_DEPTH); break; case GL_MAX_PIXEL_MAP_TABLE: - params[0] = MAX_PIXEL_MAP_TABLE; + params[0] = (GLint64)(MAX_PIXEL_MAP_TABLE); break; case GL_MAX_PROJECTION_STACK_DEPTH: - params[0] = MAX_PROJECTION_STACK_DEPTH; + params[0] = (GLint64)(MAX_PROJECTION_STACK_DEPTH); break; case GL_MAX_TEXTURE_SIZE: - params[0] = 1 << (ctx->Const.MaxTextureLevels - 1); + params[0] = (GLint64)(1 << (ctx->Const.MaxTextureLevels - 1)); break; case GL_MAX_3D_TEXTURE_SIZE: - params[0] = 1 << (ctx->Const.Max3DTextureLevels - 1); + params[0] = (GLint64)(1 << (ctx->Const.Max3DTextureLevels - 1)); break; case GL_MAX_TEXTURE_STACK_DEPTH: - params[0] = MAX_TEXTURE_STACK_DEPTH; + params[0] = (GLint64)(MAX_TEXTURE_STACK_DEPTH); break; case GL_MAX_VIEWPORT_DIMS: - params[0] = ctx->Const.MaxViewportWidth; - params[1] = ctx->Const.MaxViewportHeight; + params[0] = (GLint64)(ctx->Const.MaxViewportWidth); + params[1] = (GLint64)(ctx->Const.MaxViewportHeight); break; case GL_MODELVIEW_MATRIX: { @@ -6135,37 +6135,37 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) } break; case GL_MODELVIEW_STACK_DEPTH: - params[0] = ctx->ModelviewMatrixStack.Depth + 1; + params[0] = (GLint64)(ctx->ModelviewMatrixStack.Depth + 1); break; case GL_NAME_STACK_DEPTH: - params[0] = ctx->Select.NameStackDepth; + params[0] = (GLint64)(ctx->Select.NameStackDepth); break; case GL_NORMALIZE: params[0] = BOOLEAN_TO_INT64(ctx->Transform.Normalize); break; case GL_PACK_ALIGNMENT: - params[0] = ctx->Pack.Alignment; + params[0] = (GLint64)(ctx->Pack.Alignment); break; case GL_PACK_LSB_FIRST: params[0] = BOOLEAN_TO_INT64(ctx->Pack.LsbFirst); break; case GL_PACK_ROW_LENGTH: - params[0] = ctx->Pack.RowLength; + params[0] = (GLint64)(ctx->Pack.RowLength); break; case GL_PACK_SKIP_PIXELS: - params[0] = ctx->Pack.SkipPixels; + params[0] = (GLint64)(ctx->Pack.SkipPixels); break; case GL_PACK_SKIP_ROWS: - params[0] = ctx->Pack.SkipRows; + params[0] = (GLint64)(ctx->Pack.SkipRows); break; case GL_PACK_SWAP_BYTES: params[0] = BOOLEAN_TO_INT64(ctx->Pack.SwapBytes); break; case GL_PACK_SKIP_IMAGES_EXT: - params[0] = ctx->Pack.SkipImages; + params[0] = (GLint64)(ctx->Pack.SkipImages); break; case GL_PACK_IMAGE_HEIGHT_EXT: - params[0] = ctx->Pack.ImageHeight; + params[0] = (GLint64)(ctx->Pack.ImageHeight); break; case GL_PACK_INVERT_MESA: params[0] = BOOLEAN_TO_INT64(ctx->Pack.Invert); @@ -6174,34 +6174,34 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) params[0] = ENUM_TO_INT64(ctx->Hint.PerspectiveCorrection); break; case GL_PIXEL_MAP_A_TO_A_SIZE: - params[0] = ctx->PixelMaps.AtoA.Size; + params[0] = (GLint64)(ctx->PixelMaps.AtoA.Size); break; case GL_PIXEL_MAP_B_TO_B_SIZE: - params[0] = ctx->PixelMaps.BtoB.Size; + params[0] = (GLint64)(ctx->PixelMaps.BtoB.Size); break; case GL_PIXEL_MAP_G_TO_G_SIZE: - params[0] = ctx->PixelMaps.GtoG.Size; + params[0] = (GLint64)(ctx->PixelMaps.GtoG.Size); break; case GL_PIXEL_MAP_I_TO_A_SIZE: - params[0] = ctx->PixelMaps.ItoA.Size; + params[0] = (GLint64)(ctx->PixelMaps.ItoA.Size); break; case GL_PIXEL_MAP_I_TO_B_SIZE: - params[0] = ctx->PixelMaps.ItoB.Size; + params[0] = (GLint64)(ctx->PixelMaps.ItoB.Size); break; case GL_PIXEL_MAP_I_TO_G_SIZE: - params[0] = ctx->PixelMaps.ItoG.Size; + params[0] = (GLint64)(ctx->PixelMaps.ItoG.Size); break; case GL_PIXEL_MAP_I_TO_I_SIZE: - params[0] = ctx->PixelMaps.ItoI.Size; + params[0] = (GLint64)(ctx->PixelMaps.ItoI.Size); break; case GL_PIXEL_MAP_I_TO_R_SIZE: - params[0] = ctx->PixelMaps.ItoR.Size; + params[0] = (GLint64)(ctx->PixelMaps.ItoR.Size); break; case GL_PIXEL_MAP_R_TO_R_SIZE: - params[0] = ctx->PixelMaps.RtoR.Size; + params[0] = (GLint64)(ctx->PixelMaps.RtoR.Size); break; case GL_PIXEL_MAP_S_TO_S_SIZE: - params[0] = ctx->PixelMaps.StoS.Size; + params[0] = (GLint64)(ctx->PixelMaps.StoS.Size); break; case GL_POINT_SIZE: params[0] = IROUND64(ctx->Point.Size); @@ -6290,7 +6290,7 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) } break; case GL_PROJECTION_STACK_DEPTH: - params[0] = ctx->ProjectionMatrixStack.Depth + 1; + params[0] = (GLint64)(ctx->ProjectionMatrixStack.Depth + 1); break; case GL_READ_BUFFER: params[0] = ENUM_TO_INT64(ctx->ReadBuffer->ColorReadBuffer); @@ -6299,7 +6299,7 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) params[0] = IROUND64(ctx->Pixel.RedBias); break; case GL_RED_BITS: - params[0] = ctx->DrawBuffer->Visual.redBits; + params[0] = (GLint64)(ctx->DrawBuffer->Visual.redBits); break; case GL_RED_SCALE: params[0] = IROUND64(ctx->Pixel.RedScale); @@ -6314,16 +6314,16 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) params[0] = BOOLEAN_TO_INT64(ctx->DrawBuffer->Visual.rgbMode); break; case GL_SCISSOR_BOX: - params[0] = ctx->Scissor.X; - params[1] = ctx->Scissor.Y; - params[2] = ctx->Scissor.Width; - params[3] = ctx->Scissor.Height; + params[0] = (GLint64)(ctx->Scissor.X); + params[1] = (GLint64)(ctx->Scissor.Y); + params[2] = (GLint64)(ctx->Scissor.Width); + params[3] = (GLint64)(ctx->Scissor.Height); break; case GL_SCISSOR_TEST: params[0] = BOOLEAN_TO_INT64(ctx->Scissor.Enabled); break; case GL_SELECTION_BUFFER_SIZE: - params[0] = ctx->Select.BufferSize; + params[0] = (GLint64)(ctx->Select.BufferSize); break; case GL_SHADE_MODEL: params[0] = ENUM_TO_INT64(ctx->Light.ShadeModel); @@ -6332,10 +6332,10 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) params[0] = BOOLEAN_TO_INT64(ctx->Texture.SharedPalette); break; case GL_STENCIL_BITS: - params[0] = ctx->DrawBuffer->Visual.stencilBits; + params[0] = (GLint64)(ctx->DrawBuffer->Visual.stencilBits); break; case GL_STENCIL_CLEAR_VALUE: - params[0] = ctx->Stencil.Clear; + params[0] = (GLint64)(ctx->Stencil.Clear); break; case GL_STENCIL_FAIL: params[0] = ENUM_TO_INT64(ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace]); @@ -6350,22 +6350,22 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) params[0] = ENUM_TO_INT64(ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace]); break; case GL_STENCIL_REF: - params[0] = ctx->Stencil.Ref[ctx->Stencil.ActiveFace]; + params[0] = (GLint64)(ctx->Stencil.Ref[ctx->Stencil.ActiveFace]); break; case GL_STENCIL_TEST: params[0] = BOOLEAN_TO_INT64(ctx->Stencil.Enabled); break; case GL_STENCIL_VALUE_MASK: - params[0] = ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace]; + params[0] = (GLint64)(ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace]); break; case GL_STENCIL_WRITEMASK: - params[0] = ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace]; + params[0] = (GLint64)(ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace]); break; case GL_STEREO: params[0] = BOOLEAN_TO_INT64(ctx->DrawBuffer->Visual.stereoMode); break; case GL_SUBPIXEL_BITS: - params[0] = ctx->Const.SubPixelBits; + params[0] = (GLint64)(ctx->Const.SubPixelBits); break; case GL_TEXTURE_1D: params[0] = BOOLEAN_TO_INT64(_mesa_IsEnabled(GL_TEXTURE_1D)); @@ -6385,21 +6385,21 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) params[0] = BOOLEAN_TO_INT64(_mesa_IsEnabled(GL_TEXTURE_2D_ARRAY_EXT)); break; case GL_TEXTURE_BINDING_1D: - params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_INDEX]->Name; + params[0] = (GLint64)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_INDEX]->Name); break; case GL_TEXTURE_BINDING_2D: - params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_INDEX]->Name; + params[0] = (GLint64)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_INDEX]->Name); break; case GL_TEXTURE_BINDING_3D: - params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_3D_INDEX]->Name; + params[0] = (GLint64)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_3D_INDEX]->Name); break; case GL_TEXTURE_BINDING_1D_ARRAY_EXT: CHECK_EXT1(MESA_texture_array, "GetInteger64v"); - params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_ARRAY_INDEX]->Name; + params[0] = (GLint64)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_1D_ARRAY_INDEX]->Name); break; case GL_TEXTURE_BINDING_2D_ARRAY_EXT: CHECK_EXT1(MESA_texture_array, "GetInteger64v"); - params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_ARRAY_INDEX]->Name; + params[0] = (GLint64)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_2D_ARRAY_INDEX]->Name); break; case GL_TEXTURE_GEN_S: params[0] = BOOLEAN_TO_INT64(((ctx->Texture.Unit[ctx->Texture.CurrentUnit].TexGenEnabled & S_BIT) ? 1 : 0)); @@ -6435,40 +6435,40 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) } break; case GL_TEXTURE_STACK_DEPTH: - params[0] = ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Depth + 1; + params[0] = (GLint64)(ctx->TextureMatrixStack[ctx->Texture.CurrentUnit].Depth + 1); break; case GL_UNPACK_ALIGNMENT: - params[0] = ctx->Unpack.Alignment; + params[0] = (GLint64)(ctx->Unpack.Alignment); break; case GL_UNPACK_LSB_FIRST: params[0] = BOOLEAN_TO_INT64(ctx->Unpack.LsbFirst); break; case GL_UNPACK_ROW_LENGTH: - params[0] = ctx->Unpack.RowLength; + params[0] = (GLint64)(ctx->Unpack.RowLength); break; case GL_UNPACK_SKIP_PIXELS: - params[0] = ctx->Unpack.SkipPixels; + params[0] = (GLint64)(ctx->Unpack.SkipPixels); break; case GL_UNPACK_SKIP_ROWS: - params[0] = ctx->Unpack.SkipRows; + params[0] = (GLint64)(ctx->Unpack.SkipRows); break; case GL_UNPACK_SWAP_BYTES: params[0] = BOOLEAN_TO_INT64(ctx->Unpack.SwapBytes); break; case GL_UNPACK_SKIP_IMAGES_EXT: - params[0] = ctx->Unpack.SkipImages; + params[0] = (GLint64)(ctx->Unpack.SkipImages); break; case GL_UNPACK_IMAGE_HEIGHT_EXT: - params[0] = ctx->Unpack.ImageHeight; + params[0] = (GLint64)(ctx->Unpack.ImageHeight); break; case GL_UNPACK_CLIENT_STORAGE_APPLE: params[0] = BOOLEAN_TO_INT64(ctx->Unpack.ClientStorage); break; case GL_VIEWPORT: - params[0] = ctx->Viewport.X; - params[1] = ctx->Viewport.Y; - params[2] = ctx->Viewport.Width; - params[3] = ctx->Viewport.Height; + params[0] = (GLint64)(ctx->Viewport.X); + params[1] = (GLint64)(ctx->Viewport.Y); + params[2] = (GLint64)(ctx->Viewport.Width); + params[3] = (GLint64)(ctx->Viewport.Height); break; case GL_ZOOM_X: params[0] = IROUND64(ctx->Pixel.ZoomX); @@ -6480,16 +6480,16 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->Vertex.Enabled); break; case GL_VERTEX_ARRAY_SIZE: - params[0] = ctx->Array.ArrayObj->Vertex.Size; + params[0] = (GLint64)(ctx->Array.ArrayObj->Vertex.Size); break; case GL_VERTEX_ARRAY_TYPE: params[0] = ENUM_TO_INT64(ctx->Array.ArrayObj->Vertex.Type); break; case GL_VERTEX_ARRAY_STRIDE: - params[0] = ctx->Array.ArrayObj->Vertex.Stride; + params[0] = (GLint64)(ctx->Array.ArrayObj->Vertex.Stride); break; case GL_VERTEX_ARRAY_COUNT_EXT: - params[0] = 0; + params[0] = (GLint64)(0); break; case GL_NORMAL_ARRAY: params[0] = ENUM_TO_INT64(ctx->Array.ArrayObj->Normal.Enabled); @@ -6498,25 +6498,25 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) params[0] = ENUM_TO_INT64(ctx->Array.ArrayObj->Normal.Type); break; case GL_NORMAL_ARRAY_STRIDE: - params[0] = ctx->Array.ArrayObj->Normal.Stride; + params[0] = (GLint64)(ctx->Array.ArrayObj->Normal.Stride); break; case GL_NORMAL_ARRAY_COUNT_EXT: - params[0] = 0; + params[0] = (GLint64)(0); break; case GL_COLOR_ARRAY: params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->Color.Enabled); break; case GL_COLOR_ARRAY_SIZE: - params[0] = ctx->Array.ArrayObj->Color.Size; + params[0] = (GLint64)(ctx->Array.ArrayObj->Color.Size); break; case GL_COLOR_ARRAY_TYPE: params[0] = ENUM_TO_INT64(ctx->Array.ArrayObj->Color.Type); break; case GL_COLOR_ARRAY_STRIDE: - params[0] = ctx->Array.ArrayObj->Color.Stride; + params[0] = (GLint64)(ctx->Array.ArrayObj->Color.Stride); break; case GL_COLOR_ARRAY_COUNT_EXT: - params[0] = 0; + params[0] = (GLint64)(0); break; case GL_INDEX_ARRAY: params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->Index.Enabled); @@ -6525,46 +6525,46 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) params[0] = ENUM_TO_INT64(ctx->Array.ArrayObj->Index.Type); break; case GL_INDEX_ARRAY_STRIDE: - params[0] = ctx->Array.ArrayObj->Index.Stride; + params[0] = (GLint64)(ctx->Array.ArrayObj->Index.Stride); break; case GL_INDEX_ARRAY_COUNT_EXT: - params[0] = 0; + params[0] = (GLint64)(0); break; case GL_TEXTURE_COORD_ARRAY: params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Enabled); break; case GL_TEXTURE_COORD_ARRAY_SIZE: - params[0] = ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Size; + params[0] = (GLint64)(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Size); break; case GL_TEXTURE_COORD_ARRAY_TYPE: params[0] = ENUM_TO_INT64(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Type); break; case GL_TEXTURE_COORD_ARRAY_STRIDE: - params[0] = ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Stride; + params[0] = (GLint64)(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].Stride); break; case GL_TEXTURE_COORD_ARRAY_COUNT_EXT: - params[0] = 0; + params[0] = (GLint64)(0); break; case GL_EDGE_FLAG_ARRAY: params[0] = BOOLEAN_TO_INT64(ctx->Array.ArrayObj->EdgeFlag.Enabled); break; case GL_EDGE_FLAG_ARRAY_STRIDE: - params[0] = ctx->Array.ArrayObj->EdgeFlag.Stride; + params[0] = (GLint64)(ctx->Array.ArrayObj->EdgeFlag.Stride); break; case GL_EDGE_FLAG_ARRAY_COUNT_EXT: - params[0] = 0; + params[0] = (GLint64)(0); break; case GL_MAX_TEXTURE_UNITS_ARB: CHECK_EXT1(ARB_multitexture, "GetInteger64v"); - params[0] = ctx->Const.MaxTextureUnits; + params[0] = (GLint64)(ctx->Const.MaxTextureUnits); break; case GL_ACTIVE_TEXTURE_ARB: CHECK_EXT1(ARB_multitexture, "GetInteger64v"); - params[0] = GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit; + params[0] = (GLint64)(GL_TEXTURE0_ARB + ctx->Texture.CurrentUnit); break; case GL_CLIENT_ACTIVE_TEXTURE_ARB: CHECK_EXT1(ARB_multitexture, "GetInteger64v"); - params[0] = GL_TEXTURE0_ARB + ctx->Array.ActiveTexture; + params[0] = (GLint64)(GL_TEXTURE0_ARB + ctx->Array.ActiveTexture); break; case GL_TEXTURE_CUBE_MAP_ARB: CHECK_EXT1(ARB_texture_cube_map, "GetInteger64v"); @@ -6572,17 +6572,17 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) break; case GL_TEXTURE_BINDING_CUBE_MAP_ARB: CHECK_EXT1(ARB_texture_cube_map, "GetInteger64v"); - params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_CUBE_INDEX]->Name; + params[0] = (GLint64)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_CUBE_INDEX]->Name); break; case GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB: CHECK_EXT1(ARB_texture_cube_map, "GetInteger64v"); - params[0] = (1 << (ctx->Const.MaxCubeTextureLevels - 1)); + params[0] = (GLint64)((1 << (ctx->Const.MaxCubeTextureLevels - 1))); break; case GL_TEXTURE_COMPRESSION_HINT_ARB: - params[0] = ctx->Hint.TextureCompression; + params[0] = (GLint64)(ctx->Hint.TextureCompression); break; case GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB: - params[0] = _mesa_get_compressed_formats(ctx, NULL, GL_FALSE); + params[0] = (GLint64)(_mesa_get_compressed_formats(ctx, NULL, GL_FALSE)); break; case GL_COMPRESSED_TEXTURE_FORMATS_ARB: { @@ -6595,11 +6595,11 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) break; case GL_ARRAY_ELEMENT_LOCK_FIRST_EXT: CHECK_EXT1(EXT_compiled_vertex_array, "GetInteger64v"); - params[0] = ctx->Array.LockFirst; + params[0] = (GLint64)(ctx->Array.LockFirst); break; case GL_ARRAY_ELEMENT_LOCK_COUNT_EXT: CHECK_EXT1(EXT_compiled_vertex_array, "GetInteger64v"); - params[0] = ctx->Array.LockCount; + params[0] = (GLint64)(ctx->Array.LockCount); break; case GL_TRANSPOSE_COLOR_MATRIX_ARB: { @@ -6707,10 +6707,10 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) } break; case GL_COLOR_MATRIX_STACK_DEPTH_SGI: - params[0] = ctx->ColorMatrixStack.Depth + 1; + params[0] = (GLint64)(ctx->ColorMatrixStack.Depth + 1); break; case GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI: - params[0] = MAX_COLOR_STACK_DEPTH; + params[0] = (GLint64)(MAX_COLOR_STACK_DEPTH); break; case GL_POST_COLOR_MATRIX_RED_SCALE_SGI: params[0] = IROUND64(ctx->Pixel.PostColorMatrixScale[0]); @@ -6828,11 +6828,11 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) break; case GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT: CHECK_EXT1(EXT_secondary_color, "GetInteger64v"); - params[0] = ctx->Array.ArrayObj->SecondaryColor.Stride; + params[0] = (GLint64)(ctx->Array.ArrayObj->SecondaryColor.Stride); break; case GL_SECONDARY_COLOR_ARRAY_SIZE_EXT: CHECK_EXT1(EXT_secondary_color, "GetInteger64v"); - params[0] = ctx->Array.ArrayObj->SecondaryColor.Size; + params[0] = (GLint64)(ctx->Array.ArrayObj->SecondaryColor.Size); break; case GL_CURRENT_FOG_COORDINATE_EXT: CHECK_EXT1(EXT_fog_coord, "GetInteger64v"); @@ -6851,7 +6851,7 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) break; case GL_FOG_COORDINATE_ARRAY_STRIDE_EXT: CHECK_EXT1(EXT_fog_coord, "GetInteger64v"); - params[0] = ctx->Array.ArrayObj->FogCoord.Stride; + params[0] = (GLint64)(ctx->Array.ArrayObj->FogCoord.Stride); break; case GL_FOG_COORDINATE_SOURCE_EXT: CHECK_EXT1(EXT_fog_coord, "GetInteger64v"); @@ -6884,10 +6884,10 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) params[0] = BOOLEAN_TO_INT64(ctx->Multisample.SampleCoverageInvert); break; case GL_SAMPLE_BUFFERS_ARB: - params[0] = ctx->DrawBuffer->Visual.sampleBuffers; + params[0] = (GLint64)(ctx->DrawBuffer->Visual.sampleBuffers); break; case GL_SAMPLES_ARB: - params[0] = ctx->DrawBuffer->Visual.samples; + params[0] = (GLint64)(ctx->DrawBuffer->Visual.samples); break; case GL_RASTER_POSITION_UNCLIPPED_IBM: CHECK_EXT1(IBM_rasterpos_clip, "GetInteger64v"); @@ -6911,7 +6911,7 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) break; case GL_VERTEX_PROGRAM_BINDING_NV: CHECK_EXT1(NV_vertex_program, "GetInteger64v"); - params[0] = (ctx->VertexProgram.Current ? ctx->VertexProgram.Current->Base.Id : 0); + params[0] = (GLint64)((ctx->VertexProgram.Current ? ctx->VertexProgram.Current->Base.Id : 0)); break; case GL_VERTEX_ATTRIB_ARRAY0_NV: CHECK_EXT1(NV_vertex_program, "GetInteger64v"); @@ -7047,11 +7047,11 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) break; case GL_FRAGMENT_PROGRAM_BINDING_NV: CHECK_EXT1(NV_fragment_program, "GetInteger64v"); - params[0] = ctx->FragmentProgram.Current ? ctx->FragmentProgram.Current->Base.Id : 0; + params[0] = (GLint64)(ctx->FragmentProgram.Current ? ctx->FragmentProgram.Current->Base.Id : 0); break; case GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV: CHECK_EXT1(NV_fragment_program, "GetInteger64v"); - params[0] = MAX_NV_FRAGMENT_PROGRAM_PARAMS; + params[0] = (GLint64)(MAX_NV_FRAGMENT_PROGRAM_PARAMS); break; case GL_TEXTURE_RECTANGLE_NV: CHECK_EXT1(NV_texture_rectangle, "GetInteger64v"); @@ -7059,11 +7059,11 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) break; case GL_TEXTURE_BINDING_RECTANGLE_NV: CHECK_EXT1(NV_texture_rectangle, "GetInteger64v"); - params[0] = ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_RECT_INDEX]->Name; + params[0] = (GLint64)(ctx->Texture.Unit[ctx->Texture.CurrentUnit].CurrentTex[TEXTURE_RECT_INDEX]->Name); break; case GL_MAX_RECTANGLE_TEXTURE_SIZE_NV: CHECK_EXT1(NV_texture_rectangle, "GetInteger64v"); - params[0] = ctx->Const.MaxTextureRectSize; + params[0] = (GLint64)(ctx->Const.MaxTextureRectSize); break; case GL_STENCIL_TEST_TWO_SIDE_EXT: CHECK_EXT1(EXT_stencil_two_side, "GetInteger64v"); @@ -7082,42 +7082,42 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) params[0] = IROUND64(ctx->Const.MaxSpotExponent); break; case GL_ARRAY_BUFFER_BINDING_ARB: - params[0] = ctx->Array.ArrayBufferObj->Name; + params[0] = (GLint64)(ctx->Array.ArrayBufferObj->Name); break; case GL_VERTEX_ARRAY_BUFFER_BINDING_ARB: - params[0] = ctx->Array.ArrayObj->Vertex.BufferObj->Name; + params[0] = (GLint64)(ctx->Array.ArrayObj->Vertex.BufferObj->Name); break; case GL_NORMAL_ARRAY_BUFFER_BINDING_ARB: - params[0] = ctx->Array.ArrayObj->Normal.BufferObj->Name; + params[0] = (GLint64)(ctx->Array.ArrayObj->Normal.BufferObj->Name); break; case GL_COLOR_ARRAY_BUFFER_BINDING_ARB: - params[0] = ctx->Array.ArrayObj->Color.BufferObj->Name; + params[0] = (GLint64)(ctx->Array.ArrayObj->Color.BufferObj->Name); break; case GL_INDEX_ARRAY_BUFFER_BINDING_ARB: - params[0] = ctx->Array.ArrayObj->Index.BufferObj->Name; + params[0] = (GLint64)(ctx->Array.ArrayObj->Index.BufferObj->Name); break; case GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB: - params[0] = ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name; + params[0] = (GLint64)(ctx->Array.ArrayObj->TexCoord[ctx->Array.ActiveTexture].BufferObj->Name); break; case GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB: - params[0] = ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name; + params[0] = (GLint64)(ctx->Array.ArrayObj->EdgeFlag.BufferObj->Name); break; case GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB: - params[0] = ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name; + params[0] = (GLint64)(ctx->Array.ArrayObj->SecondaryColor.BufferObj->Name); break; case GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB: - params[0] = ctx->Array.ArrayObj->FogCoord.BufferObj->Name; + params[0] = (GLint64)(ctx->Array.ArrayObj->FogCoord.BufferObj->Name); break; case GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB: - params[0] = ctx->Array.ElementArrayBufferObj->Name; + params[0] = (GLint64)(ctx->Array.ElementArrayBufferObj->Name); break; case GL_PIXEL_PACK_BUFFER_BINDING_EXT: CHECK_EXT1(EXT_pixel_buffer_object, "GetInteger64v"); - params[0] = ctx->Pack.BufferObj->Name; + params[0] = (GLint64)(ctx->Pack.BufferObj->Name); break; case GL_PIXEL_UNPACK_BUFFER_BINDING_EXT: CHECK_EXT1(EXT_pixel_buffer_object, "GetInteger64v"); - params[0] = ctx->Unpack.BufferObj->Name; + params[0] = (GLint64)(ctx->Unpack.BufferObj->Name); break; case GL_VERTEX_PROGRAM_ARB: CHECK_EXT2(ARB_vertex_program, NV_vertex_program, "GetInteger64v"); @@ -7133,11 +7133,11 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) break; case GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB: CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetInteger64v"); - params[0] = ctx->Const.MaxProgramMatrixStackDepth; + params[0] = (GLint64)(ctx->Const.MaxProgramMatrixStackDepth); break; case GL_MAX_PROGRAM_MATRICES_ARB: CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetInteger64v"); - params[0] = ctx->Const.MaxProgramMatrices; + params[0] = (GLint64)(ctx->Const.MaxProgramMatrices); break; case GL_CURRENT_MATRIX_STACK_DEPTH_ARB: CHECK_EXT3(ARB_vertex_program, ARB_fragment_program, NV_vertex_program, "GetInteger64v"); @@ -7189,11 +7189,11 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) break; case GL_MAX_VERTEX_ATTRIBS_ARB: CHECK_EXT1(ARB_vertex_program, "GetInteger64v"); - params[0] = ctx->Const.VertexProgram.MaxAttribs; + params[0] = (GLint64)(ctx->Const.VertexProgram.MaxAttribs); break; case GL_PROGRAM_ERROR_POSITION_ARB: CHECK_EXT4(NV_vertex_program, ARB_vertex_program, NV_fragment_program, ARB_fragment_program, "GetInteger64v"); - params[0] = ctx->Program.ErrorPos; + params[0] = (GLint64)(ctx->Program.ErrorPos); break; case GL_FRAGMENT_PROGRAM_ARB: CHECK_EXT1(ARB_fragment_program, "GetInteger64v"); @@ -7201,11 +7201,11 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) break; case GL_MAX_TEXTURE_COORDS_ARB: CHECK_EXT2(ARB_fragment_program, NV_fragment_program, "GetInteger64v"); - params[0] = ctx->Const.MaxTextureCoordUnits; + params[0] = (GLint64)(ctx->Const.MaxTextureCoordUnits); break; case GL_MAX_TEXTURE_IMAGE_UNITS_ARB: CHECK_EXT2(ARB_fragment_program, NV_fragment_program, "GetInteger64v"); - params[0] = ctx->Const.MaxTextureImageUnits; + params[0] = (GLint64)(ctx->Const.MaxTextureImageUnits); break; case GL_DEPTH_BOUNDS_TEST_EXT: CHECK_EXT1(EXT_depth_bounds_test, "GetInteger64v"); @@ -7217,7 +7217,7 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) params[1] = IROUND64(ctx->Depth.BoundsMax); break; case GL_MAX_DRAW_BUFFERS_ARB: - params[0] = ctx->Const.MaxDrawBuffers; + params[0] = (GLint64)(ctx->Const.MaxDrawBuffers); break; case GL_DRAW_BUFFER0_ARB: params[0] = ENUM_TO_INT64(ctx->DrawBuffer->ColorDrawBuffer[0]); @@ -7257,31 +7257,31 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) break; case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: CHECK_EXT1(OES_read_format, "GetInteger64v"); - params[0] = ctx->Const.ColorReadType; + params[0] = (GLint64)(ctx->Const.ColorReadType); break; case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: CHECK_EXT1(OES_read_format, "GetInteger64v"); - params[0] = ctx->Const.ColorReadFormat; + params[0] = (GLint64)(ctx->Const.ColorReadFormat); break; case GL_NUM_FRAGMENT_REGISTERS_ATI: CHECK_EXT1(ATI_fragment_shader, "GetInteger64v"); - params[0] = 6; + params[0] = (GLint64)(6); break; case GL_NUM_FRAGMENT_CONSTANTS_ATI: CHECK_EXT1(ATI_fragment_shader, "GetInteger64v"); - params[0] = 8; + params[0] = (GLint64)(8); break; case GL_NUM_PASSES_ATI: CHECK_EXT1(ATI_fragment_shader, "GetInteger64v"); - params[0] = 2; + params[0] = (GLint64)(2); break; case GL_NUM_INSTRUCTIONS_PER_PASS_ATI: CHECK_EXT1(ATI_fragment_shader, "GetInteger64v"); - params[0] = 8; + params[0] = (GLint64)(8); break; case GL_NUM_INSTRUCTIONS_TOTAL_ATI: CHECK_EXT1(ATI_fragment_shader, "GetInteger64v"); - params[0] = 16; + params[0] = (GLint64)(16); break; case GL_COLOR_ALPHA_PAIRING_ATI: CHECK_EXT1(ATI_fragment_shader, "GetInteger64v"); @@ -7289,23 +7289,23 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) break; case GL_NUM_LOOPBACK_COMPONENTS_ATI: CHECK_EXT1(ATI_fragment_shader, "GetInteger64v"); - params[0] = 3; + params[0] = (GLint64)(3); break; case GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI: CHECK_EXT1(ATI_fragment_shader, "GetInteger64v"); - params[0] = 3; + params[0] = (GLint64)(3); break; case GL_STENCIL_BACK_FUNC: params[0] = ENUM_TO_INT64(ctx->Stencil.Function[1]); break; case GL_STENCIL_BACK_VALUE_MASK: - params[0] = ctx->Stencil.ValueMask[1]; + params[0] = (GLint64)(ctx->Stencil.ValueMask[1]); break; case GL_STENCIL_BACK_WRITEMASK: - params[0] = ctx->Stencil.WriteMask[1]; + params[0] = (GLint64)(ctx->Stencil.WriteMask[1]); break; case GL_STENCIL_BACK_REF: - params[0] = ctx->Stencil.Ref[1]; + params[0] = (GLint64)(ctx->Stencil.Ref[1]); break; case GL_STENCIL_BACK_FAIL: params[0] = ENUM_TO_INT64(ctx->Stencil.FailFunc[1]); @@ -7318,23 +7318,23 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) break; case GL_FRAMEBUFFER_BINDING_EXT: CHECK_EXT1(EXT_framebuffer_object, "GetInteger64v"); - params[0] = ctx->DrawBuffer->Name; + params[0] = (GLint64)(ctx->DrawBuffer->Name); break; case GL_RENDERBUFFER_BINDING_EXT: CHECK_EXT1(EXT_framebuffer_object, "GetInteger64v"); - params[0] = ctx->CurrentRenderbuffer ? ctx->CurrentRenderbuffer->Name : 0; + params[0] = (GLint64)(ctx->CurrentRenderbuffer ? ctx->CurrentRenderbuffer->Name : 0); break; case GL_MAX_COLOR_ATTACHMENTS_EXT: CHECK_EXT1(EXT_framebuffer_object, "GetInteger64v"); - params[0] = ctx->Const.MaxColorAttachments; + params[0] = (GLint64)(ctx->Const.MaxColorAttachments); break; case GL_MAX_RENDERBUFFER_SIZE_EXT: CHECK_EXT1(EXT_framebuffer_object, "GetInteger64v"); - params[0] = ctx->Const.MaxRenderbufferSize; + params[0] = (GLint64)(ctx->Const.MaxRenderbufferSize); break; case GL_READ_FRAMEBUFFER_BINDING_EXT: CHECK_EXT1(EXT_framebuffer_blit, "GetInteger64v"); - params[0] = ctx->ReadBuffer->Name; + params[0] = (GLint64)(ctx->ReadBuffer->Name); break; case GL_PROVOKING_VERTEX_EXT: CHECK_EXT1(EXT_provoking_vertex, "GetInteger64v"); @@ -7346,7 +7346,7 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) break; case GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB: CHECK_EXT1(ARB_fragment_shader, "GetInteger64v"); - params[0] = ctx->Const.FragmentProgram.MaxUniformComponents; + params[0] = (GLint64)(ctx->Const.FragmentProgram.MaxUniformComponents); break; case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB: CHECK_EXT1(ARB_fragment_shader, "GetInteger64v"); @@ -7354,31 +7354,31 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) break; case GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB: CHECK_EXT1(ARB_vertex_shader, "GetInteger64v"); - params[0] = ctx->Const.VertexProgram.MaxUniformComponents; + params[0] = (GLint64)(ctx->Const.VertexProgram.MaxUniformComponents); break; case GL_MAX_VARYING_FLOATS_ARB: CHECK_EXT1(ARB_vertex_shader, "GetInteger64v"); - params[0] = ctx->Const.MaxVarying * 4; + params[0] = (GLint64)(ctx->Const.MaxVarying * 4); break; case GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB: CHECK_EXT1(ARB_vertex_shader, "GetInteger64v"); - params[0] = ctx->Const.MaxVertexTextureImageUnits; + params[0] = (GLint64)(ctx->Const.MaxVertexTextureImageUnits); break; case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB: CHECK_EXT1(ARB_vertex_shader, "GetInteger64v"); - params[0] = MAX_COMBINED_TEXTURE_IMAGE_UNITS; + params[0] = (GLint64)(MAX_COMBINED_TEXTURE_IMAGE_UNITS); break; case GL_CURRENT_PROGRAM: CHECK_EXT1(ARB_shader_objects, "GetInteger64v"); - params[0] = ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0; + params[0] = (GLint64)(ctx->Shader.CurrentProgram ? ctx->Shader.CurrentProgram->Name : 0); break; case GL_MAX_SAMPLES: CHECK_EXT1(ARB_framebuffer_object, "GetInteger64v"); - params[0] = ctx->Const.MaxSamples; + params[0] = (GLint64)(ctx->Const.MaxSamples); break; case GL_VERTEX_ARRAY_BINDING_APPLE: CHECK_EXT1(APPLE_vertex_array_object, "GetInteger64v"); - params[0] = ctx->Array.ArrayObj->Name; + params[0] = (GLint64)(ctx->Array.ArrayObj->Name); break; case GL_TEXTURE_CUBE_MAP_SEAMLESS: CHECK_EXT1(ARB_seamless_cube_map, "GetInteger64v"); diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py index 2878c1b552..c7babd1c81 100644 --- a/src/mesa/main/get_gen.py +++ b/src/mesa/main/get_gen.py @@ -1042,7 +1042,7 @@ def ConversionFunc(fromType, toType): elif fromType == GLint and toType == GLfloat: # but not GLfloatN! return "(GLfloat)" elif fromType == GLint and toType == GLint64: - return "" + return "(GLint64)" elif fromType == GLint64 and toType == GLfloat: # but not GLfloatN! return "(GLfloat)" else: -- cgit v1.2.3 From 51f7763c00ca47d522ea62457fdce5df5c89d5b2 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 4 Nov 2009 07:14:55 -0700 Subject: glslcompiler: Fix Mac OS build. Signed-off-by: Brian Paul --- src/mesa/drivers/glslcompiler/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/glslcompiler/Makefile b/src/mesa/drivers/glslcompiler/Makefile index ffe4e0a234..fa8293d039 100644 --- a/src/mesa/drivers/glslcompiler/Makefile +++ b/src/mesa/drivers/glslcompiler/Makefile @@ -37,7 +37,7 @@ glslcompiler: $(OBJECTS) glslcompiler.o: glslcompiler.c - $(CC) -c $(CFLAGS) $(INCLUDES) glslcompiler.c -o $@ + $(CC) -c $(INCLUDES) $(CFLAGS) glslcompiler.c -o $@ clean: -- cgit v1.2.3 From 3040b2ee9dcb5fcf7660ae8ee2cd3f7d86e7da47 Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Wed, 4 Nov 2009 14:48:25 +0000 Subject: Fix YTILE spantmp functions --- src/mesa/drivers/dri/intel/intel_spantmp.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_spantmp.h b/src/mesa/drivers/dri/intel/intel_spantmp.h index 98cc6585f4..bad03398f6 100644 --- a/src/mesa/drivers/dri/intel/intel_spantmp.h +++ b/src/mesa/drivers/dri/intel/intel_spantmp.h @@ -54,8 +54,8 @@ #define SPANTMP_PIXEL_FMT INTEL_PIXEL_FMT #define SPANTMP_PIXEL_TYPE INTEL_PIXEL_TYPE -#define PUT_VALUE(_x, _y, v) INTEL_WRITE_VALUE(X_TILE(_x, _y), v) -#define GET_VALUE(_x, _y) INTEL_READ_VALUE(X_TILE(_x, _y)) +#define PUT_VALUE(_x, _y, v) INTEL_WRITE_VALUE(Y_TILE(_x, _y), v) +#define GET_VALUE(_x, _y) INTEL_READ_VALUE(Y_TILE(_x, _y)) #define TAG(x) INTEL_TAG(intel_YTile_##x) #define TAG2(x, y) INTEL_TAG(intel_YTile_##x)##y #include "spantmp2.h" -- cgit v1.2.3 From f1b91ccc0839f5088b86c3fe81eed957c1f91293 Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Wed, 4 Nov 2009 14:48:25 +0000 Subject: Fix YTILE spantmp functions --- src/mesa/drivers/dri/intel/intel_spantmp.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_spantmp.h b/src/mesa/drivers/dri/intel/intel_spantmp.h index ead0b1c168..35df969be3 100644 --- a/src/mesa/drivers/dri/intel/intel_spantmp.h +++ b/src/mesa/drivers/dri/intel/intel_spantmp.h @@ -48,8 +48,8 @@ #define SPANTMP_PIXEL_FMT INTEL_PIXEL_FMT #define SPANTMP_PIXEL_TYPE INTEL_PIXEL_TYPE -#define PUT_VALUE(_x, _y, v) INTEL_WRITE_VALUE(X_TILE(_x, _y), v) -#define GET_VALUE(_x, _y) INTEL_READ_VALUE(X_TILE(_x, _y)) +#define PUT_VALUE(_x, _y, v) INTEL_WRITE_VALUE(Y_TILE(_x, _y), v) +#define GET_VALUE(_x, _y) INTEL_READ_VALUE(Y_TILE(_x, _y)) #define TAG(x) INTEL_TAG(intel_YTile_##x) #define TAG2(x, y) INTEL_TAG(intel_YTile_##x)##y #include "spantmp2.h" -- cgit v1.2.3 From 70dade8afeadf83c6c993b39d3322e7c9353eea7 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Wed, 4 Nov 2009 14:43:24 -0500 Subject: r600: fix count prediction for IB case Signed-off-by: Alex Deucher --- src/mesa/drivers/dri/r600/r700_render.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c index 268bfd8bf0..b20b129d17 100644 --- a/src/mesa/drivers/dri/r600/r700_render.c +++ b/src/mesa/drivers/dri/r600/r700_render.c @@ -379,7 +379,7 @@ static GLuint r700PredictRenderSize(GLcontext* ctx, dwords = PRE_EMIT_STATE_BUFSZ; if (ib) - dwords += nr_prims * 14; + dwords += nr_prims * 17; else { for (i = 0; i < nr_prims; ++i) { -- cgit v1.2.3 From 9fce12b894c3af33d7a0732332446893682a48d5 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Wed, 4 Nov 2009 16:59:13 -0500 Subject: r600: rework draw functions Seems INDX_OFFSET doesn't work properly on some cards, so change back to immediate mode indices. Seems to only affect DRI1. Needs more investigation. Rework and clean up the draw functions. Signed-off-by: Alex Deucher --- src/mesa/drivers/dri/r600/r700_render.c | 198 +++++++++++++++++++++----------- 1 file changed, 134 insertions(+), 64 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c index b20b129d17..c345b9d8ac 100644 --- a/src/mesa/drivers/dri/r600/r700_render.c +++ b/src/mesa/drivers/dri/r600/r700_render.c @@ -259,16 +259,6 @@ static void r700RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim uint32_t vgt_index_type = 0; uint32_t vgt_primitive_type = 0; uint32_t vgt_num_indices = 0; - GLboolean bUseDrawIndex; - - if(NULL != context->ind_buf.bo) - { - bUseDrawIndex = GL_TRUE; - } - else - { - bUseDrawIndex = GL_FALSE; - } type = r700PrimitiveType(prim); num_indices = r700NumVerts(end - start, prim); @@ -280,85 +270,154 @@ static void r700RunRenderPrimitive(GLcontext * ctx, int start, int end, int prim if (type < 0 || num_indices <= 0) return; - if(GL_TRUE == bUseDrawIndex) - { - total_emit = 3 /* VGT_PRIMITIVE_TYPE */ - + 2 /* VGT_INDEX_TYPE */ - + 2 /* NUM_INSTANCES */ - + 3 /* VGT_INDEX_OFFSET */ - + 5 + 2; /* DRAW_INDEX */ - } - else - { - total_emit = 3 /* VGT_PRIMITIVE_TYPE */ - + 2 /* VGT_INDEX_TYPE */ - + 2 /* NUM_INSTANCES */ - + 3 /* VGT_INDEX_OFFSET */ - + 3; /* DRAW_INDEX_AUTO */ - } - - BEGIN_BATCH_NO_AUTOSTATE(total_emit); - // prim SETfield(vgt_primitive_type, type, VGT_PRIMITIVE_TYPE__PRIM_TYPE_shift, VGT_PRIMITIVE_TYPE__PRIM_TYPE_mask); - R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_CONFIG_REG, 1)); - R600_OUT_BATCH(mmVGT_PRIMITIVE_TYPE - ASIC_CONFIG_BASE_INDEX); - R600_OUT_BATCH(vgt_primitive_type); - // index type SETfield(vgt_index_type, DI_INDEX_SIZE_32_BIT, INDEX_TYPE_shift, INDEX_TYPE_mask); - if(GL_TRUE == bUseDrawIndex) + if(GL_TRUE != context->ind_buf.is_32bit) { - if(GL_TRUE != context->ind_buf.is_32bit) - { SETfield(vgt_index_type, DI_INDEX_SIZE_16_BIT, INDEX_TYPE_shift, INDEX_TYPE_mask); - } } + vgt_num_indices = num_indices; + SETfield(vgt_draw_initiator, DI_SRC_SEL_DMA, SOURCE_SELECT_shift, SOURCE_SELECT_mask); + SETfield(vgt_draw_initiator, DI_MAJOR_MODE_0, MAJOR_MODE_shift, MAJOR_MODE_mask); + + total_emit = 3 /* VGT_PRIMITIVE_TYPE */ + + 2 /* VGT_INDEX_TYPE */ + + 2 /* NUM_INSTANCES */ + + 5 + 2; /* DRAW_INDEX */ + + BEGIN_BATCH_NO_AUTOSTATE(total_emit); + // prim + R600_OUT_BATCH_REGSEQ(VGT_PRIMITIVE_TYPE, 1); + R600_OUT_BATCH(vgt_primitive_type); + // index type R600_OUT_BATCH(CP_PACKET3(R600_IT_INDEX_TYPE, 0)); R600_OUT_BATCH(vgt_index_type); - // num instances R600_OUT_BATCH(CP_PACKET3(R600_IT_NUM_INSTANCES, 0)); R600_OUT_BATCH(1); - // draw packet - vgt_num_indices = num_indices; + R600_OUT_BATCH(CP_PACKET3(R600_IT_DRAW_INDEX, 3)); + R600_OUT_BATCH(context->ind_buf.bo_offset); + R600_OUT_BATCH(0); + R600_OUT_BATCH(vgt_num_indices); + R600_OUT_BATCH(vgt_draw_initiator); + R600_OUT_BATCH_RELOC(context->ind_buf.bo_offset, + context->ind_buf.bo, + context->ind_buf.bo_offset, + RADEON_GEM_DOMAIN_GTT, 0, 0); + END_BATCH(); + COMMIT_BATCH(); +} + +static void r700RunRenderPrimitiveImmediate(GLcontext * ctx, int start, int end, int prim) +{ + context_t *context = R700_CONTEXT(ctx); + BATCH_LOCALS(&context->radeon); + int type, i; + uint32_t num_indices, total_emit = 0; + uint32_t vgt_draw_initiator = 0; + uint32_t vgt_index_type = 0; + uint32_t vgt_primitive_type = 0; + uint32_t vgt_num_indices = 0; + + type = r700PrimitiveType(prim); + num_indices = r700NumVerts(end - start, prim); - if(GL_TRUE == bUseDrawIndex) + radeon_print(RADEON_RENDER, RADEON_TRACE, + "%s type %x num_indices %d\n", + __func__, type, num_indices); + + if (type < 0 || num_indices <= 0) + return; + + SETfield(vgt_primitive_type, type, + VGT_PRIMITIVE_TYPE__PRIM_TYPE_shift, VGT_PRIMITIVE_TYPE__PRIM_TYPE_mask); + + if (num_indices > 0xffff) { - SETfield(vgt_draw_initiator, DI_SRC_SEL_DMA, SOURCE_SELECT_shift, SOURCE_SELECT_mask); + SETfield(vgt_index_type, DI_INDEX_SIZE_32_BIT, INDEX_TYPE_shift, INDEX_TYPE_mask); } else { - SETfield(vgt_draw_initiator, DI_SRC_SEL_AUTO_INDEX, SOURCE_SELECT_shift, SOURCE_SELECT_mask); + SETfield(vgt_index_type, DI_INDEX_SIZE_16_BIT, INDEX_TYPE_shift, INDEX_TYPE_mask); } + vgt_num_indices = num_indices; SETfield(vgt_draw_initiator, DI_MAJOR_MODE_0, MAJOR_MODE_shift, MAJOR_MODE_mask); - if(GL_TRUE == bUseDrawIndex) + if (start == 0) { - R600_OUT_BATCH_REGSEQ(VGT_INDX_OFFSET, 1); - R600_OUT_BATCH(0); - R600_OUT_BATCH(CP_PACKET3(R600_IT_DRAW_INDEX, 3)); - R600_OUT_BATCH(context->ind_buf.bo_offset); - R600_OUT_BATCH(0); - R600_OUT_BATCH(vgt_num_indices); - R600_OUT_BATCH(vgt_draw_initiator); - R600_OUT_BATCH_RELOC(context->ind_buf.bo_offset, - context->ind_buf.bo, - context->ind_buf.bo_offset, - RADEON_GEM_DOMAIN_GTT, 0, 0); + SETfield(vgt_draw_initiator, DI_SRC_SEL_AUTO_INDEX, SOURCE_SELECT_shift, SOURCE_SELECT_mask); } else { - R600_OUT_BATCH_REGSEQ(VGT_INDX_OFFSET, 1); - R600_OUT_BATCH(start); - R600_OUT_BATCH(CP_PACKET3(R600_IT_DRAW_INDEX_AUTO,1)); + if (num_indices > 0xffff) + { + total_emit += num_indices; + } + else + { + total_emit += (num_indices + 1) / 2; + } + SETfield(vgt_draw_initiator, DI_SRC_SEL_IMMEDIATE, SOURCE_SELECT_shift, SOURCE_SELECT_mask); + } + + total_emit += 3 /* VGT_PRIMITIVE_TYPE */ + + 2 /* VGT_INDEX_TYPE */ + + 2 /* NUM_INSTANCES */ + + 3; /* DRAW */ + + BEGIN_BATCH_NO_AUTOSTATE(total_emit); + // prim + R600_OUT_BATCH_REGSEQ(VGT_PRIMITIVE_TYPE, 1); + R600_OUT_BATCH(vgt_primitive_type); + // index type + R600_OUT_BATCH(CP_PACKET3(R600_IT_INDEX_TYPE, 0)); + R600_OUT_BATCH(vgt_index_type); + // num instances + R600_OUT_BATCH(CP_PACKET3(R600_IT_NUM_INSTANCES, 0)); + R600_OUT_BATCH(1); + // draw packet + if(start == 0) + { + R600_OUT_BATCH(CP_PACKET3(R600_IT_DRAW_INDEX_AUTO, 1)); R600_OUT_BATCH(vgt_num_indices); R600_OUT_BATCH(vgt_draw_initiator); } + else + { + if (num_indices > 0xffff) + { + R600_OUT_BATCH(CP_PACKET3(R600_IT_DRAW_INDEX_IMMD, (num_indices + 1))); + R600_OUT_BATCH(vgt_num_indices); + R600_OUT_BATCH(vgt_draw_initiator); + for (i = start; i < (start + num_indices); i++) + { + R600_OUT_BATCH(i); + } + } + else + { + R600_OUT_BATCH(CP_PACKET3(R600_IT_DRAW_INDEX_IMMD, (((num_indices + 1) / 2) + 1))); + R600_OUT_BATCH(vgt_num_indices); + R600_OUT_BATCH(vgt_draw_initiator); + for (i = start; i < (start + num_indices); i += 2) + { + if ((i + 1) == (start + num_indices)) + { + R600_OUT_BATCH(i); + } + else + { + R600_OUT_BATCH(((i + 1) << 16) | (i)); + } + } + } + } END_BATCH(); COMMIT_BATCH(); @@ -379,11 +438,16 @@ static GLuint r700PredictRenderSize(GLcontext* ctx, dwords = PRE_EMIT_STATE_BUFSZ; if (ib) - dwords += nr_prims * 17; + dwords += nr_prims * 14; else { for (i = 0; i < nr_prims; ++i) { - dwords += 13; + if (prim[i].start == 0) + dwords += 10; + else if (prim[i].count > 0xffff) + dwords += prim[i].count + 10; + else + dwords += ((prim[i].count + 1) / 2) + 10; } } @@ -840,10 +904,16 @@ static GLboolean r700TryDrawPrims(GLcontext *ctx, radeon_debug_add_indent(); for (i = 0; i < nr_prims; ++i) { - r700RunRenderPrimitive(ctx, - prim[i].start, - prim[i].start + prim[i].count, - prim[i].mode); + if (context->ind_buf.bo) + r700RunRenderPrimitive(ctx, + prim[i].start, + prim[i].start + prim[i].count, + prim[i].mode); + else + r700RunRenderPrimitiveImmediate(ctx, + prim[i].start, + prim[i].start + prim[i].count, + prim[i].mode); } radeon_debug_remove_indent(); -- cgit v1.2.3 From fe86f8d73268785b31bc8d5a278a233bff42034d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 4 Nov 2009 17:26:48 -0700 Subject: ARB prog parser: include variable name in error text --- src/mesa/shader/program_parse.tab.c | 1065 ++++++++++++++++++++++++----------- src/mesa/shader/program_parse.tab.h | 151 +---- src/mesa/shader/program_parse.y | 5 +- 3 files changed, 751 insertions(+), 470 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 7f45e0987d..e57c83ea65 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -1,24 +1,23 @@ -/* A Bison parser, made by GNU Bison 2.3. */ -/* Skeleton implementation for Bison's Yacc-like parsers in C +/* A Bison parser, made by GNU Bison 2.4.1. */ - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify + + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -29,7 +28,7 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@ -47,7 +46,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.3" +#define YYBISON_VERSION "2.4.1" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -55,235 +54,20 @@ /* Pure parsers. */ #define YYPURE 1 -/* Using locations. */ -#define YYLSP_NEEDED 1 - +/* Push parsers. */ +#define YYPUSH 0 +/* Pull parsers. */ +#define YYPULL 1 -/* Tokens. */ -#ifndef YYTOKENTYPE -# define YYTOKENTYPE - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - ARBvp_10 = 258, - ARBfp_10 = 259, - ADDRESS = 260, - ALIAS = 261, - ATTRIB = 262, - OPTION = 263, - OUTPUT = 264, - PARAM = 265, - TEMP = 266, - END = 267, - BIN_OP = 268, - BINSC_OP = 269, - SAMPLE_OP = 270, - SCALAR_OP = 271, - TRI_OP = 272, - VECTOR_OP = 273, - ARL = 274, - KIL = 275, - SWZ = 276, - TXD_OP = 277, - INTEGER = 278, - REAL = 279, - AMBIENT = 280, - ATTENUATION = 281, - BACK = 282, - CLIP = 283, - COLOR = 284, - DEPTH = 285, - DIFFUSE = 286, - DIRECTION = 287, - EMISSION = 288, - ENV = 289, - EYE = 290, - FOG = 291, - FOGCOORD = 292, - FRAGMENT = 293, - FRONT = 294, - HALF = 295, - INVERSE = 296, - INVTRANS = 297, - LIGHT = 298, - LIGHTMODEL = 299, - LIGHTPROD = 300, - LOCAL = 301, - MATERIAL = 302, - MAT_PROGRAM = 303, - MATRIX = 304, - MATRIXINDEX = 305, - MODELVIEW = 306, - MVP = 307, - NORMAL = 308, - OBJECT = 309, - PALETTE = 310, - PARAMS = 311, - PLANE = 312, - POINT_TOK = 313, - POINTSIZE = 314, - POSITION = 315, - PRIMARY = 316, - PROGRAM = 317, - PROJECTION = 318, - RANGE = 319, - RESULT = 320, - ROW = 321, - SCENECOLOR = 322, - SECONDARY = 323, - SHININESS = 324, - SIZE_TOK = 325, - SPECULAR = 326, - SPOT = 327, - STATE = 328, - TEXCOORD = 329, - TEXENV = 330, - TEXGEN = 331, - TEXGEN_Q = 332, - TEXGEN_R = 333, - TEXGEN_S = 334, - TEXGEN_T = 335, - TEXTURE = 336, - TRANSPOSE = 337, - TEXTURE_UNIT = 338, - TEX_1D = 339, - TEX_2D = 340, - TEX_3D = 341, - TEX_CUBE = 342, - TEX_RECT = 343, - TEX_SHADOW1D = 344, - TEX_SHADOW2D = 345, - TEX_SHADOWRECT = 346, - TEX_ARRAY1D = 347, - TEX_ARRAY2D = 348, - TEX_ARRAYSHADOW1D = 349, - TEX_ARRAYSHADOW2D = 350, - VERTEX = 351, - VTXATTRIB = 352, - WEIGHT = 353, - IDENTIFIER = 354, - USED_IDENTIFIER = 355, - MASK4 = 356, - MASK3 = 357, - MASK2 = 358, - MASK1 = 359, - SWIZZLE = 360, - DOT_DOT = 361, - DOT = 362 - }; -#endif -/* Tokens. */ -#define ARBvp_10 258 -#define ARBfp_10 259 -#define ADDRESS 260 -#define ALIAS 261 -#define ATTRIB 262 -#define OPTION 263 -#define OUTPUT 264 -#define PARAM 265 -#define TEMP 266 -#define END 267 -#define BIN_OP 268 -#define BINSC_OP 269 -#define SAMPLE_OP 270 -#define SCALAR_OP 271 -#define TRI_OP 272 -#define VECTOR_OP 273 -#define ARL 274 -#define KIL 275 -#define SWZ 276 -#define TXD_OP 277 -#define INTEGER 278 -#define REAL 279 -#define AMBIENT 280 -#define ATTENUATION 281 -#define BACK 282 -#define CLIP 283 -#define COLOR 284 -#define DEPTH 285 -#define DIFFUSE 286 -#define DIRECTION 287 -#define EMISSION 288 -#define ENV 289 -#define EYE 290 -#define FOG 291 -#define FOGCOORD 292 -#define FRAGMENT 293 -#define FRONT 294 -#define HALF 295 -#define INVERSE 296 -#define INVTRANS 297 -#define LIGHT 298 -#define LIGHTMODEL 299 -#define LIGHTPROD 300 -#define LOCAL 301 -#define MATERIAL 302 -#define MAT_PROGRAM 303 -#define MATRIX 304 -#define MATRIXINDEX 305 -#define MODELVIEW 306 -#define MVP 307 -#define NORMAL 308 -#define OBJECT 309 -#define PALETTE 310 -#define PARAMS 311 -#define PLANE 312 -#define POINT_TOK 313 -#define POINTSIZE 314 -#define POSITION 315 -#define PRIMARY 316 -#define PROGRAM 317 -#define PROJECTION 318 -#define RANGE 319 -#define RESULT 320 -#define ROW 321 -#define SCENECOLOR 322 -#define SECONDARY 323 -#define SHININESS 324 -#define SIZE_TOK 325 -#define SPECULAR 326 -#define SPOT 327 -#define STATE 328 -#define TEXCOORD 329 -#define TEXENV 330 -#define TEXGEN 331 -#define TEXGEN_Q 332 -#define TEXGEN_R 333 -#define TEXGEN_S 334 -#define TEXGEN_T 335 -#define TEXTURE 336 -#define TRANSPOSE 337 -#define TEXTURE_UNIT 338 -#define TEX_1D 339 -#define TEX_2D 340 -#define TEX_3D 341 -#define TEX_CUBE 342 -#define TEX_RECT 343 -#define TEX_SHADOW1D 344 -#define TEX_SHADOW2D 345 -#define TEX_SHADOWRECT 346 -#define TEX_ARRAY1D 347 -#define TEX_ARRAY2D 348 -#define TEX_ARRAYSHADOW1D 349 -#define TEX_ARRAYSHADOW2D 350 -#define VERTEX 351 -#define VTXATTRIB 352 -#define WEIGHT 353 -#define IDENTIFIER 354 -#define USED_IDENTIFIER 355 -#define MASK4 356 -#define MASK3 357 -#define MASK2 358 -#define MASK1 359 -#define SWIZZLE 360 -#define DOT_DOT 361 -#define DOT 362 - +/* Using locations. */ +#define YYLSP_NEEDED 1 /* Copy the first part of user declarations. */ + +/* Line 189 of yacc.c */ #line 1 "program_parse.y" /* @@ -400,6 +184,9 @@ static struct asm_instruction *asm_instruction_copy_ctor( #define YYLEX_PARAM state->scanner +/* Line 189 of yacc.c */ +#line 189 "program_parse.tab.c" + /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 @@ -418,10 +205,130 @@ static struct asm_instruction *asm_instruction_copy_ctor( # define YYTOKEN_TABLE 0 #endif + +/* Tokens. */ +#ifndef YYTOKENTYPE +# define YYTOKENTYPE + /* Put the tokens into the symbol table, so that GDB and other debuggers + know about them. */ + enum yytokentype { + ARBvp_10 = 258, + ARBfp_10 = 259, + ADDRESS = 260, + ALIAS = 261, + ATTRIB = 262, + OPTION = 263, + OUTPUT = 264, + PARAM = 265, + TEMP = 266, + END = 267, + BIN_OP = 268, + BINSC_OP = 269, + SAMPLE_OP = 270, + SCALAR_OP = 271, + TRI_OP = 272, + VECTOR_OP = 273, + ARL = 274, + KIL = 275, + SWZ = 276, + TXD_OP = 277, + INTEGER = 278, + REAL = 279, + AMBIENT = 280, + ATTENUATION = 281, + BACK = 282, + CLIP = 283, + COLOR = 284, + DEPTH = 285, + DIFFUSE = 286, + DIRECTION = 287, + EMISSION = 288, + ENV = 289, + EYE = 290, + FOG = 291, + FOGCOORD = 292, + FRAGMENT = 293, + FRONT = 294, + HALF = 295, + INVERSE = 296, + INVTRANS = 297, + LIGHT = 298, + LIGHTMODEL = 299, + LIGHTPROD = 300, + LOCAL = 301, + MATERIAL = 302, + MAT_PROGRAM = 303, + MATRIX = 304, + MATRIXINDEX = 305, + MODELVIEW = 306, + MVP = 307, + NORMAL = 308, + OBJECT = 309, + PALETTE = 310, + PARAMS = 311, + PLANE = 312, + POINT_TOK = 313, + POINTSIZE = 314, + POSITION = 315, + PRIMARY = 316, + PROGRAM = 317, + PROJECTION = 318, + RANGE = 319, + RESULT = 320, + ROW = 321, + SCENECOLOR = 322, + SECONDARY = 323, + SHININESS = 324, + SIZE_TOK = 325, + SPECULAR = 326, + SPOT = 327, + STATE = 328, + TEXCOORD = 329, + TEXENV = 330, + TEXGEN = 331, + TEXGEN_Q = 332, + TEXGEN_R = 333, + TEXGEN_S = 334, + TEXGEN_T = 335, + TEXTURE = 336, + TRANSPOSE = 337, + TEXTURE_UNIT = 338, + TEX_1D = 339, + TEX_2D = 340, + TEX_3D = 341, + TEX_CUBE = 342, + TEX_RECT = 343, + TEX_SHADOW1D = 344, + TEX_SHADOW2D = 345, + TEX_SHADOWRECT = 346, + TEX_ARRAY1D = 347, + TEX_ARRAY2D = 348, + TEX_ARRAYSHADOW1D = 349, + TEX_ARRAYSHADOW2D = 350, + VERTEX = 351, + VTXATTRIB = 352, + WEIGHT = 353, + IDENTIFIER = 354, + USED_IDENTIFIER = 355, + MASK4 = 356, + MASK3 = 357, + MASK2 = 358, + MASK1 = 359, + SWIZZLE = 360, + DOT_DOT = 361, + DOT = 362 + }; +#endif + + + #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 122 "program_parse.y" { + +/* Line 214 of yacc.c */ +#line 122 "program_parse.y" + struct asm_instruction *inst; struct asm_symbol *sym; struct asm_symbol temp_sym; @@ -445,13 +352,15 @@ typedef union YYSTYPE unsigned xyzw_valid:1; unsigned negate:1; } ext_swizzle; -} -/* Line 187 of yacc.c. */ -#line 451 "program_parse.tab.c" - YYSTYPE; + + + +/* Line 214 of yacc.c */ +#line 360 "program_parse.tab.c" +} YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 #endif #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED @@ -469,14 +378,16 @@ typedef struct YYLTYPE /* Copy the second part of user declarations. */ + +/* Line 264 of yacc.c */ #line 267 "program_parse.y" extern int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, void *yyscanner); -/* Line 216 of yacc.c. */ -#line 480 "program_parse.tab.c" +/* Line 264 of yacc.c */ +#line 391 "program_parse.tab.c" #ifdef short # undef short @@ -551,14 +462,14 @@ typedef short int yytype_int16; #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int -YYID (int i) +YYID (int yyi) #else static int -YYID (i) - int i; +YYID (yyi) + int yyi; #endif { - return i; + return yyi; } #endif @@ -640,9 +551,9 @@ void free (void *); /* INFRINGES ON USER NAME SPACE */ /* A type that is properly aligned for any stack member. */ union yyalloc { - yytype_int16 yyss; - YYSTYPE yyvs; - YYLTYPE yyls; + yytype_int16 yyss_alloc; + YYSTYPE yyvs_alloc; + YYLTYPE yyls_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ @@ -677,12 +588,12 @@ union yyalloc elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ -# define YYSTACK_RELOCATE(Stack) \ +# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack, Stack, yysize); \ - Stack = &yyptr->Stack; \ + YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ + Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ @@ -905,7 +816,7 @@ static const yytype_uint16 yyrline[] = 1949, 1957, 1970, 1979, 1988, 1992, 2001, 2010, 2021, 2028, 2033, 2042, 2054, 2057, 2066, 2077, 2078, 2079, 2082, 2083, 2084, 2087, 2088, 2091, 2092, 2095, 2096, 2099, 2110, 2121, - 2132, 2153, 2154 + 2132, 2154, 2155 }; #endif @@ -1553,17 +1464,20 @@ yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, state) #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void -yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) +yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) #else static void -yy_stack_print (bottom, top) - yytype_int16 *bottom; - yytype_int16 *top; +yy_stack_print (yybottom, yytop) + yytype_int16 *yybottom; + yytype_int16 *yytop; #endif { YYFPRINTF (stderr, "Stack now"); - for (; bottom <= top; ++bottom) - YYFPRINTF (stderr, " %d", *bottom); + for (; yybottom <= yytop; yybottom++) + { + int yybot = *yybottom; + YYFPRINTF (stderr, " %d", yybot); + } YYFPRINTF (stderr, "\n"); } @@ -1599,11 +1513,11 @@ yy_reduce_print (yyvsp, yylsp, yyrule, state) /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { - fprintf (stderr, " $%d = ", yyi + 1); + YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) , &(yylsp[(yyi + 1) - (yynrhs)]) , state); - fprintf (stderr, "\n"); + YYFPRINTF (stderr, "\n"); } } @@ -1887,10 +1801,8 @@ yydestruct (yymsg, yytype, yyvaluep, yylocationp, state) break; } } - /* Prevent warnings from -Wmissing-prototypes. */ - #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); @@ -1909,10 +1821,9 @@ int yyparse (); - -/*----------. -| yyparse. | -`----------*/ +/*-------------------------. +| yyparse or yypush_parse. | +`-------------------------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ @@ -1936,24 +1847,59 @@ yyparse (state) #endif #endif { - /* The look-ahead symbol. */ +/* The lookahead symbol. */ int yychar; -/* The semantic value of the look-ahead symbol. */ +/* The semantic value of the lookahead symbol. */ YYSTYPE yylval; -/* Number of syntax errors so far. */ -int yynerrs; -/* Location data for the look-ahead symbol. */ +/* Location data for the lookahead symbol. */ YYLTYPE yylloc; - int yystate; + /* Number of syntax errors so far. */ + int yynerrs; + + int yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + + /* The stacks and their tools: + `yyss': related to states. + `yyvs': related to semantic values. + `yyls': related to locations. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; + + /* The location stack. */ + YYLTYPE yylsa[YYINITDEPTH]; + YYLTYPE *yyls; + YYLTYPE *yylsp; + + /* The locations where the error started and ended. */ + YYLTYPE yyerror_range[2]; + + YYSIZE_T yystacksize; + int yyn; int yyresult; - /* Number of tokens to shift before error messages enabled. */ - int yyerrstatus; - /* Look-ahead token as an internal (translated) token number. */ - int yytoken = 0; + /* Lookahead token as an internal (translated) token number. */ + int yytoken; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + YYLTYPE yyloc; + #if YYERROR_VERBOSE /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; @@ -1961,63 +1907,37 @@ YYLTYPE yylloc; YYSIZE_T yymsg_alloc = sizeof yymsgbuf; #endif - /* Three stacks and their tools: - `yyss': related to states, - `yyvs': related to semantic values, - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss = yyssa; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs = yyvsa; - YYSTYPE *yyvsp; - - /* The location stack. */ - YYLTYPE yylsa[YYINITDEPTH]; - YYLTYPE *yyls = yylsa; - YYLTYPE *yylsp; - /* The locations where the error started and ended. */ - YYLTYPE yyerror_range[2]; - #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) - YYSIZE_T yystacksize = YYINITDEPTH; - - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - YYLTYPE yyloc; - /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; + yytoken = 0; + yyss = yyssa; + yyvs = yyvsa; + yyls = yylsa; + yystacksize = YYINITDEPTH; + YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; - yychar = YYEMPTY; /* Cause a token to be read. */ + yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ - yyssp = yyss; yyvsp = yyvs; yylsp = yyls; + #if YYLTYPE_IS_TRIVIAL /* Initialize the default location before parsing starts. */ yylloc.first_line = yylloc.last_line = 1; - yylloc.first_column = yylloc.last_column = 0; + yylloc.first_column = yylloc.last_column = 1; #endif goto yysetstate; @@ -2056,6 +1976,7 @@ YYLTYPE yylloc; &yyvs1, yysize * sizeof (*yyvsp), &yyls1, yysize * sizeof (*yylsp), &yystacksize); + yyls = yyls1; yyss = yyss1; yyvs = yyvs1; @@ -2077,9 +1998,9 @@ YYLTYPE yylloc; (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss); - YYSTACK_RELOCATE (yyvs); - YYSTACK_RELOCATE (yyls); + YYSTACK_RELOCATE (yyss_alloc, yyss); + YYSTACK_RELOCATE (yyvs_alloc, yyvs); + YYSTACK_RELOCATE (yyls_alloc, yyls); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); @@ -2100,6 +2021,9 @@ YYLTYPE yylloc; YYDPRINTF ((stderr, "Entering state %d\n", yystate)); + if (yystate == YYFINAL) + YYACCEPT; + goto yybackup; /*-----------. @@ -2108,16 +2032,16 @@ YYLTYPE yylloc; yybackup: /* Do appropriate processing given the current state. Read a - look-ahead token if we need one and don't already have one. */ + lookahead token if we need one and don't already have one. */ - /* First try to decide what to do without reference to look-ahead token. */ + /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; - /* Not known => get a look-ahead token if don't already have one. */ + /* Not known => get a lookahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); @@ -2149,20 +2073,16 @@ yybackup: goto yyreduce; } - if (yyn == YYFINAL) - YYACCEPT; - /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; - /* Shift the look-ahead token. */ + /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - /* Discard the shifted token unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; + /* Discard the shifted token. */ + yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; @@ -2203,6 +2123,8 @@ yyreduce: switch (yyn) { case 3: + +/* Line 1455 of yacc.c */ #line 278 "program_parse.y" { if (state->prog->Target != GL_VERTEX_PROGRAM_ARB) { @@ -2214,6 +2136,8 @@ yyreduce: break; case 4: + +/* Line 1455 of yacc.c */ #line 286 "program_parse.y" { if (state->prog->Target != GL_FRAGMENT_PROGRAM_ARB) { @@ -2227,6 +2151,8 @@ yyreduce: break; case 7: + +/* Line 1455 of yacc.c */ #line 302 "program_parse.y" { int valid = 0; @@ -2250,6 +2176,8 @@ yyreduce: break; case 10: + +/* Line 1455 of yacc.c */ #line 328 "program_parse.y" { if ((yyvsp[(1) - (2)].inst) != NULL) { @@ -2268,6 +2196,8 @@ yyreduce: break; case 12: + +/* Line 1455 of yacc.c */ #line 346 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); @@ -2276,6 +2206,8 @@ yyreduce: break; case 13: + +/* Line 1455 of yacc.c */ #line 351 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); @@ -2284,6 +2216,8 @@ yyreduce: break; case 24: + +/* Line 1455 of yacc.c */ #line 372 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_ARL, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); @@ -2291,6 +2225,8 @@ yyreduce: break; case 25: + +/* Line 1455 of yacc.c */ #line 378 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (4)].temp_inst), & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); @@ -2298,6 +2234,8 @@ yyreduce: break; case 26: + +/* Line 1455 of yacc.c */ #line 384 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (4)].temp_inst), & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); @@ -2305,6 +2243,8 @@ yyreduce: break; case 27: + +/* Line 1455 of yacc.c */ #line 390 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (6)].temp_inst), & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); @@ -2312,6 +2252,8 @@ yyreduce: break; case 28: + +/* Line 1455 of yacc.c */ #line 397 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (6)].temp_inst), & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); @@ -2319,6 +2261,8 @@ yyreduce: break; case 29: + +/* Line 1455 of yacc.c */ #line 404 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (8)].temp_inst), & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), & (yyvsp[(6) - (8)].src_reg), & (yyvsp[(8) - (8)].src_reg)); @@ -2326,6 +2270,8 @@ yyreduce: break; case 30: + +/* Line 1455 of yacc.c */ #line 410 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (8)].temp_inst), & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), NULL, NULL); @@ -2371,6 +2317,8 @@ yyreduce: break; case 31: + +/* Line 1455 of yacc.c */ #line 454 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_KIL, NULL, & (yyvsp[(2) - (2)].src_reg), NULL, NULL); @@ -2379,6 +2327,8 @@ yyreduce: break; case 32: + +/* Line 1455 of yacc.c */ #line 459 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_KIL_NV, NULL, NULL, NULL, NULL); @@ -2390,6 +2340,8 @@ yyreduce: break; case 33: + +/* Line 1455 of yacc.c */ #line 469 "program_parse.y" { (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (12)].temp_inst), & (yyvsp[(2) - (12)].dst_reg), & (yyvsp[(4) - (12)].src_reg), & (yyvsp[(6) - (12)].src_reg), & (yyvsp[(8) - (12)].src_reg)); @@ -2435,6 +2387,8 @@ yyreduce: break; case 34: + +/* Line 1455 of yacc.c */ #line 513 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); @@ -2442,66 +2396,92 @@ yyreduce: break; case 35: + +/* Line 1455 of yacc.c */ #line 518 "program_parse.y" { (yyval.integer) = TEXTURE_1D_INDEX; ;} break; case 36: + +/* Line 1455 of yacc.c */ #line 519 "program_parse.y" { (yyval.integer) = TEXTURE_2D_INDEX; ;} break; case 37: + +/* Line 1455 of yacc.c */ #line 520 "program_parse.y" { (yyval.integer) = TEXTURE_3D_INDEX; ;} break; case 38: + +/* Line 1455 of yacc.c */ #line 521 "program_parse.y" { (yyval.integer) = TEXTURE_CUBE_INDEX; ;} break; case 39: + +/* Line 1455 of yacc.c */ #line 522 "program_parse.y" { (yyval.integer) = TEXTURE_RECT_INDEX; ;} break; case 40: + +/* Line 1455 of yacc.c */ #line 523 "program_parse.y" { (yyval.integer) = -TEXTURE_1D_INDEX; ;} break; case 41: + +/* Line 1455 of yacc.c */ #line 524 "program_parse.y" { (yyval.integer) = -TEXTURE_2D_INDEX; ;} break; case 42: + +/* Line 1455 of yacc.c */ #line 525 "program_parse.y" { (yyval.integer) = -TEXTURE_RECT_INDEX; ;} break; case 43: + +/* Line 1455 of yacc.c */ #line 526 "program_parse.y" { (yyval.integer) = TEXTURE_1D_ARRAY_INDEX; ;} break; case 44: + +/* Line 1455 of yacc.c */ #line 527 "program_parse.y" { (yyval.integer) = TEXTURE_2D_ARRAY_INDEX; ;} break; case 45: + +/* Line 1455 of yacc.c */ #line 528 "program_parse.y" { (yyval.integer) = -TEXTURE_1D_ARRAY_INDEX; ;} break; case 46: + +/* Line 1455 of yacc.c */ #line 529 "program_parse.y" { (yyval.integer) = -TEXTURE_2D_ARRAY_INDEX; ;} break; case 47: + +/* Line 1455 of yacc.c */ #line 533 "program_parse.y" { /* FIXME: Is this correct? Should the extenedSwizzle be applied @@ -2515,6 +2495,8 @@ yyreduce: break; case 48: + +/* Line 1455 of yacc.c */ #line 545 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (2)].src_reg); @@ -2526,6 +2508,8 @@ yyreduce: break; case 49: + +/* Line 1455 of yacc.c */ #line 553 "program_parse.y" { (yyval.src_reg) = (yyvsp[(3) - (4)].src_reg); @@ -2544,6 +2528,8 @@ yyreduce: break; case 50: + +/* Line 1455 of yacc.c */ #line 570 "program_parse.y" { (yyval.src_reg) = (yyvsp[(1) - (2)].src_reg); @@ -2554,6 +2540,8 @@ yyreduce: break; case 51: + +/* Line 1455 of yacc.c */ #line 577 "program_parse.y" { struct asm_symbol temp_sym; @@ -2572,6 +2560,8 @@ yyreduce: break; case 52: + +/* Line 1455 of yacc.c */ #line 594 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); @@ -2586,6 +2576,8 @@ yyreduce: break; case 53: + +/* Line 1455 of yacc.c */ #line 605 "program_parse.y" { (yyval.src_reg) = (yyvsp[(3) - (5)].src_reg); @@ -2606,6 +2598,8 @@ yyreduce: break; case 54: + +/* Line 1455 of yacc.c */ #line 625 "program_parse.y" { (yyval.dst_reg) = (yyvsp[(1) - (3)].dst_reg); @@ -2632,6 +2626,8 @@ yyreduce: break; case 55: + +/* Line 1455 of yacc.c */ #line 650 "program_parse.y" { set_dst_reg(& (yyval.dst_reg), PROGRAM_ADDRESS, 0); @@ -2640,6 +2636,8 @@ yyreduce: break; case 56: + +/* Line 1455 of yacc.c */ #line 657 "program_parse.y" { const unsigned xyzw_valid = @@ -2674,6 +2672,8 @@ yyreduce: break; case 57: + +/* Line 1455 of yacc.c */ #line 690 "program_parse.y" { (yyval.ext_swizzle) = (yyvsp[(2) - (2)].ext_swizzle); @@ -2682,6 +2682,8 @@ yyreduce: break; case 58: + +/* Line 1455 of yacc.c */ #line 697 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) != 0) && ((yyvsp[(1) - (1)].integer) != 1)) { @@ -2700,6 +2702,8 @@ yyreduce: break; case 59: + +/* Line 1455 of yacc.c */ #line 712 "program_parse.y" { if (strlen((yyvsp[(1) - (1)].string)) > 1) { @@ -2751,6 +2755,8 @@ yyreduce: break; case 60: + +/* Line 1455 of yacc.c */ #line 762 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) @@ -2793,6 +2799,8 @@ yyreduce: break; case 61: + +/* Line 1455 of yacc.c */ #line 801 "program_parse.y" { set_src_reg(& (yyval.src_reg), PROGRAM_INPUT, (yyvsp[(1) - (1)].attrib)); @@ -2805,6 +2813,8 @@ yyreduce: break; case 62: + +/* Line 1455 of yacc.c */ #line 810 "program_parse.y" { if (! (yyvsp[(3) - (4)].src_reg).Base.RelAddr @@ -2829,6 +2839,8 @@ yyreduce: break; case 63: + +/* Line 1455 of yacc.c */ #line 831 "program_parse.y" { gl_register_file file = ((yyvsp[(1) - (1)].temp_sym).name != NULL) @@ -2839,6 +2851,8 @@ yyreduce: break; case 64: + +/* Line 1455 of yacc.c */ #line 840 "program_parse.y" { set_dst_reg(& (yyval.dst_reg), PROGRAM_OUTPUT, (yyvsp[(1) - (1)].result)); @@ -2846,6 +2860,8 @@ yyreduce: break; case 65: + +/* Line 1455 of yacc.c */ #line 844 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) @@ -2874,6 +2890,8 @@ yyreduce: break; case 66: + +/* Line 1455 of yacc.c */ #line 871 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) @@ -2892,6 +2910,8 @@ yyreduce: break; case 69: + +/* Line 1455 of yacc.c */ #line 890 "program_parse.y" { init_src_reg(& (yyval.src_reg)); @@ -2900,6 +2920,8 @@ yyreduce: break; case 70: + +/* Line 1455 of yacc.c */ #line 897 "program_parse.y" { /* FINISHME: Add support for multiple address registers. @@ -2913,21 +2935,29 @@ yyreduce: break; case 71: + +/* Line 1455 of yacc.c */ #line 908 "program_parse.y" { (yyval.integer) = 0; ;} break; case 72: + +/* Line 1455 of yacc.c */ #line 909 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; case 73: + +/* Line 1455 of yacc.c */ #line 910 "program_parse.y" { (yyval.integer) = -(yyvsp[(2) - (2)].integer); ;} break; case 74: + +/* Line 1455 of yacc.c */ #line 914 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 63)) { @@ -2943,6 +2973,8 @@ yyreduce: break; case 75: + +/* Line 1455 of yacc.c */ #line 928 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 64)) { @@ -2958,6 +2990,8 @@ yyreduce: break; case 76: + +/* Line 1455 of yacc.c */ #line 942 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) @@ -2977,6 +3011,8 @@ yyreduce: break; case 77: + +/* Line 1455 of yacc.c */ #line 960 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { @@ -2989,6 +3025,8 @@ yyreduce: break; case 78: + +/* Line 1455 of yacc.c */ #line 971 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { @@ -3002,16 +3040,22 @@ yyreduce: break; case 83: + +/* Line 1455 of yacc.c */ #line 987 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 88: + +/* Line 1455 of yacc.c */ #line 991 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 89: + +/* Line 1455 of yacc.c */ #line 995 "program_parse.y" { (yyval.dst_reg) = (yyvsp[(2) - (3)].dst_reg); @@ -3019,6 +3063,8 @@ yyreduce: break; case 90: + +/* Line 1455 of yacc.c */ #line 999 "program_parse.y" { (yyval.dst_reg) = (yyvsp[(2) - (3)].dst_reg); @@ -3026,6 +3072,8 @@ yyreduce: break; case 91: + +/* Line 1455 of yacc.c */ #line 1003 "program_parse.y" { (yyval.dst_reg).CondMask = COND_TR; @@ -3035,6 +3083,8 @@ yyreduce: break; case 92: + +/* Line 1455 of yacc.c */ #line 1011 "program_parse.y" { (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); @@ -3043,6 +3093,8 @@ yyreduce: break; case 93: + +/* Line 1455 of yacc.c */ #line 1018 "program_parse.y" { (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); @@ -3051,6 +3103,8 @@ yyreduce: break; case 94: + +/* Line 1455 of yacc.c */ #line 1025 "program_parse.y" { const int cond = _mesa_parse_cc((yyvsp[(1) - (1)].string)); @@ -3075,6 +3129,8 @@ yyreduce: break; case 95: + +/* Line 1455 of yacc.c */ #line 1048 "program_parse.y" { const int cond = _mesa_parse_cc((yyvsp[(1) - (1)].string)); @@ -3099,6 +3155,8 @@ yyreduce: break; case 102: + +/* Line 1455 of yacc.c */ #line 1079 "program_parse.y" { struct asm_symbol *const s = @@ -3118,6 +3176,8 @@ yyreduce: break; case 103: + +/* Line 1455 of yacc.c */ #line 1097 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); @@ -3125,6 +3185,8 @@ yyreduce: break; case 104: + +/* Line 1455 of yacc.c */ #line 1101 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); @@ -3132,6 +3194,8 @@ yyreduce: break; case 105: + +/* Line 1455 of yacc.c */ #line 1107 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_POS; @@ -3139,6 +3203,8 @@ yyreduce: break; case 106: + +/* Line 1455 of yacc.c */ #line 1111 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_WEIGHT; @@ -3146,6 +3212,8 @@ yyreduce: break; case 107: + +/* Line 1455 of yacc.c */ #line 1115 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_NORMAL; @@ -3153,6 +3221,8 @@ yyreduce: break; case 108: + +/* Line 1455 of yacc.c */ #line 1119 "program_parse.y" { if (!state->ctx->Extensions.EXT_secondary_color) { @@ -3165,6 +3235,8 @@ yyreduce: break; case 109: + +/* Line 1455 of yacc.c */ #line 1128 "program_parse.y" { if (!state->ctx->Extensions.EXT_fog_coord) { @@ -3177,6 +3249,8 @@ yyreduce: break; case 110: + +/* Line 1455 of yacc.c */ #line 1137 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); @@ -3184,6 +3258,8 @@ yyreduce: break; case 111: + +/* Line 1455 of yacc.c */ #line 1141 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); @@ -3192,6 +3268,8 @@ yyreduce: break; case 112: + +/* Line 1455 of yacc.c */ #line 1146 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_GENERIC0 + (yyvsp[(3) - (4)].integer); @@ -3199,6 +3277,8 @@ yyreduce: break; case 113: + +/* Line 1455 of yacc.c */ #line 1152 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxAttribs) { @@ -3211,6 +3291,8 @@ yyreduce: break; case 117: + +/* Line 1455 of yacc.c */ #line 1166 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_WPOS; @@ -3218,6 +3300,8 @@ yyreduce: break; case 118: + +/* Line 1455 of yacc.c */ #line 1170 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_COL0 + (yyvsp[(2) - (2)].integer); @@ -3225,6 +3309,8 @@ yyreduce: break; case 119: + +/* Line 1455 of yacc.c */ #line 1174 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_FOGC; @@ -3232,6 +3318,8 @@ yyreduce: break; case 120: + +/* Line 1455 of yacc.c */ #line 1178 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); @@ -3239,6 +3327,8 @@ yyreduce: break; case 123: + +/* Line 1455 of yacc.c */ #line 1186 "program_parse.y" { struct asm_symbol *const s = @@ -3256,6 +3346,8 @@ yyreduce: break; case 124: + +/* Line 1455 of yacc.c */ #line 1202 "program_parse.y" { if (((yyvsp[(4) - (6)].integer) != 0) && ((unsigned) (yyvsp[(4) - (6)].integer) != (yyvsp[(6) - (6)].temp_sym).param_binding_length)) { @@ -3279,6 +3371,8 @@ yyreduce: break; case 125: + +/* Line 1455 of yacc.c */ #line 1224 "program_parse.y" { (yyval.integer) = 0; @@ -3286,6 +3380,8 @@ yyreduce: break; case 126: + +/* Line 1455 of yacc.c */ #line 1228 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 1) || ((unsigned) (yyvsp[(1) - (1)].integer) > state->limits->MaxParameters)) { @@ -3298,6 +3394,8 @@ yyreduce: break; case 127: + +/* Line 1455 of yacc.c */ #line 1239 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(2) - (2)].temp_sym); @@ -3305,6 +3403,8 @@ yyreduce: break; case 128: + +/* Line 1455 of yacc.c */ #line 1245 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(3) - (4)].temp_sym); @@ -3312,6 +3412,8 @@ yyreduce: break; case 130: + +/* Line 1455 of yacc.c */ #line 1252 "program_parse.y" { (yyvsp[(1) - (3)].temp_sym).param_binding_length += (yyvsp[(3) - (3)].temp_sym).param_binding_length; @@ -3320,6 +3422,8 @@ yyreduce: break; case 131: + +/* Line 1455 of yacc.c */ #line 1259 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); @@ -3329,6 +3433,8 @@ yyreduce: break; case 132: + +/* Line 1455 of yacc.c */ #line 1265 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); @@ -3338,6 +3444,8 @@ yyreduce: break; case 133: + +/* Line 1455 of yacc.c */ #line 1271 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); @@ -3347,6 +3455,8 @@ yyreduce: break; case 134: + +/* Line 1455 of yacc.c */ #line 1279 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); @@ -3356,6 +3466,8 @@ yyreduce: break; case 135: + +/* Line 1455 of yacc.c */ #line 1285 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); @@ -3365,6 +3477,8 @@ yyreduce: break; case 136: + +/* Line 1455 of yacc.c */ #line 1291 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); @@ -3374,6 +3488,8 @@ yyreduce: break; case 137: + +/* Line 1455 of yacc.c */ #line 1299 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); @@ -3383,6 +3499,8 @@ yyreduce: break; case 138: + +/* Line 1455 of yacc.c */ #line 1305 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); @@ -3392,6 +3510,8 @@ yyreduce: break; case 139: + +/* Line 1455 of yacc.c */ #line 1311 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); @@ -3401,71 +3521,99 @@ yyreduce: break; case 140: + +/* Line 1455 of yacc.c */ #line 1318 "program_parse.y" { memcpy((yyval.state), (yyvsp[(1) - (1)].state), sizeof((yyval.state))); ;} break; case 141: + +/* Line 1455 of yacc.c */ #line 1319 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 142: + +/* Line 1455 of yacc.c */ #line 1322 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 143: + +/* Line 1455 of yacc.c */ #line 1323 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 144: + +/* Line 1455 of yacc.c */ #line 1324 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 145: + +/* Line 1455 of yacc.c */ #line 1325 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 146: + +/* Line 1455 of yacc.c */ #line 1326 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 147: + +/* Line 1455 of yacc.c */ #line 1327 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 148: + +/* Line 1455 of yacc.c */ #line 1328 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 149: + +/* Line 1455 of yacc.c */ #line 1329 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 150: + +/* Line 1455 of yacc.c */ #line 1330 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 151: + +/* Line 1455 of yacc.c */ #line 1331 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 152: + +/* Line 1455 of yacc.c */ #line 1332 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 153: + +/* Line 1455 of yacc.c */ #line 1336 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); @@ -3476,6 +3624,8 @@ yyreduce: break; case 154: + +/* Line 1455 of yacc.c */ #line 1345 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); @@ -3483,6 +3633,8 @@ yyreduce: break; case 155: + +/* Line 1455 of yacc.c */ #line 1349 "program_parse.y" { (yyval.integer) = STATE_EMISSION; @@ -3490,6 +3642,8 @@ yyreduce: break; case 156: + +/* Line 1455 of yacc.c */ #line 1353 "program_parse.y" { (yyval.integer) = STATE_SHININESS; @@ -3497,6 +3651,8 @@ yyreduce: break; case 157: + +/* Line 1455 of yacc.c */ #line 1359 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); @@ -3507,6 +3663,8 @@ yyreduce: break; case 158: + +/* Line 1455 of yacc.c */ #line 1368 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); @@ -3514,6 +3672,8 @@ yyreduce: break; case 159: + +/* Line 1455 of yacc.c */ #line 1372 "program_parse.y" { (yyval.integer) = STATE_POSITION; @@ -3521,6 +3681,8 @@ yyreduce: break; case 160: + +/* Line 1455 of yacc.c */ #line 1376 "program_parse.y" { if (!state->ctx->Extensions.EXT_point_parameters) { @@ -3533,6 +3695,8 @@ yyreduce: break; case 161: + +/* Line 1455 of yacc.c */ #line 1385 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); @@ -3540,6 +3704,8 @@ yyreduce: break; case 162: + +/* Line 1455 of yacc.c */ #line 1389 "program_parse.y" { (yyval.integer) = STATE_HALF_VECTOR; @@ -3547,6 +3713,8 @@ yyreduce: break; case 163: + +/* Line 1455 of yacc.c */ #line 1395 "program_parse.y" { (yyval.integer) = STATE_SPOT_DIRECTION; @@ -3554,6 +3722,8 @@ yyreduce: break; case 164: + +/* Line 1455 of yacc.c */ #line 1401 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (2)].state)[0]; @@ -3562,6 +3732,8 @@ yyreduce: break; case 165: + +/* Line 1455 of yacc.c */ #line 1408 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); @@ -3570,6 +3742,8 @@ yyreduce: break; case 166: + +/* Line 1455 of yacc.c */ #line 1413 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); @@ -3579,6 +3753,8 @@ yyreduce: break; case 167: + +/* Line 1455 of yacc.c */ #line 1421 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); @@ -3590,6 +3766,8 @@ yyreduce: break; case 169: + +/* Line 1455 of yacc.c */ #line 1433 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); @@ -3599,6 +3777,8 @@ yyreduce: break; case 170: + +/* Line 1455 of yacc.c */ #line 1441 "program_parse.y" { (yyval.integer) = STATE_TEXENV_COLOR; @@ -3606,6 +3786,8 @@ yyreduce: break; case 171: + +/* Line 1455 of yacc.c */ #line 1447 "program_parse.y" { (yyval.integer) = STATE_AMBIENT; @@ -3613,6 +3795,8 @@ yyreduce: break; case 172: + +/* Line 1455 of yacc.c */ #line 1451 "program_parse.y" { (yyval.integer) = STATE_DIFFUSE; @@ -3620,6 +3804,8 @@ yyreduce: break; case 173: + +/* Line 1455 of yacc.c */ #line 1455 "program_parse.y" { (yyval.integer) = STATE_SPECULAR; @@ -3627,6 +3813,8 @@ yyreduce: break; case 174: + +/* Line 1455 of yacc.c */ #line 1461 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxLights) { @@ -3639,6 +3827,8 @@ yyreduce: break; case 175: + +/* Line 1455 of yacc.c */ #line 1472 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); @@ -3649,6 +3839,8 @@ yyreduce: break; case 176: + +/* Line 1455 of yacc.c */ #line 1481 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S; @@ -3656,6 +3848,8 @@ yyreduce: break; case 177: + +/* Line 1455 of yacc.c */ #line 1485 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_OBJECT_S; @@ -3663,6 +3857,8 @@ yyreduce: break; case 178: + +/* Line 1455 of yacc.c */ #line 1490 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S; @@ -3670,6 +3866,8 @@ yyreduce: break; case 179: + +/* Line 1455 of yacc.c */ #line 1494 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S; @@ -3677,6 +3875,8 @@ yyreduce: break; case 180: + +/* Line 1455 of yacc.c */ #line 1498 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S; @@ -3684,6 +3884,8 @@ yyreduce: break; case 181: + +/* Line 1455 of yacc.c */ #line 1502 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S; @@ -3691,6 +3893,8 @@ yyreduce: break; case 182: + +/* Line 1455 of yacc.c */ #line 1508 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); @@ -3699,6 +3903,8 @@ yyreduce: break; case 183: + +/* Line 1455 of yacc.c */ #line 1515 "program_parse.y" { (yyval.integer) = STATE_FOG_COLOR; @@ -3706,6 +3912,8 @@ yyreduce: break; case 184: + +/* Line 1455 of yacc.c */ #line 1519 "program_parse.y" { (yyval.integer) = STATE_FOG_PARAMS; @@ -3713,6 +3921,8 @@ yyreduce: break; case 185: + +/* Line 1455 of yacc.c */ #line 1525 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); @@ -3722,6 +3932,8 @@ yyreduce: break; case 186: + +/* Line 1455 of yacc.c */ #line 1533 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxClipPlanes) { @@ -3734,6 +3946,8 @@ yyreduce: break; case 187: + +/* Line 1455 of yacc.c */ #line 1544 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); @@ -3742,6 +3956,8 @@ yyreduce: break; case 188: + +/* Line 1455 of yacc.c */ #line 1551 "program_parse.y" { (yyval.integer) = STATE_POINT_SIZE; @@ -3749,6 +3965,8 @@ yyreduce: break; case 189: + +/* Line 1455 of yacc.c */ #line 1555 "program_parse.y" { (yyval.integer) = STATE_POINT_ATTENUATION; @@ -3756,6 +3974,8 @@ yyreduce: break; case 190: + +/* Line 1455 of yacc.c */ #line 1561 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (5)].state)[0]; @@ -3767,6 +3987,8 @@ yyreduce: break; case 191: + +/* Line 1455 of yacc.c */ #line 1571 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (2)].state)[0]; @@ -3778,6 +4000,8 @@ yyreduce: break; case 192: + +/* Line 1455 of yacc.c */ #line 1581 "program_parse.y" { (yyval.state)[2] = 0; @@ -3786,6 +4010,8 @@ yyreduce: break; case 193: + +/* Line 1455 of yacc.c */ #line 1586 "program_parse.y" { /* It seems logical that the matrix row range specifier would have @@ -3805,6 +4031,8 @@ yyreduce: break; case 194: + +/* Line 1455 of yacc.c */ #line 1604 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (3)].state)[0]; @@ -3814,6 +4042,8 @@ yyreduce: break; case 195: + +/* Line 1455 of yacc.c */ #line 1612 "program_parse.y" { (yyval.integer) = 0; @@ -3821,6 +4051,8 @@ yyreduce: break; case 196: + +/* Line 1455 of yacc.c */ #line 1616 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); @@ -3828,6 +4060,8 @@ yyreduce: break; case 197: + +/* Line 1455 of yacc.c */ #line 1622 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVERSE; @@ -3835,6 +4069,8 @@ yyreduce: break; case 198: + +/* Line 1455 of yacc.c */ #line 1626 "program_parse.y" { (yyval.integer) = STATE_MATRIX_TRANSPOSE; @@ -3842,6 +4078,8 @@ yyreduce: break; case 199: + +/* Line 1455 of yacc.c */ #line 1630 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVTRANS; @@ -3849,6 +4087,8 @@ yyreduce: break; case 200: + +/* Line 1455 of yacc.c */ #line 1636 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) > 3) { @@ -3861,6 +4101,8 @@ yyreduce: break; case 201: + +/* Line 1455 of yacc.c */ #line 1647 "program_parse.y" { (yyval.state)[0] = STATE_MODELVIEW_MATRIX; @@ -3869,6 +4111,8 @@ yyreduce: break; case 202: + +/* Line 1455 of yacc.c */ #line 1652 "program_parse.y" { (yyval.state)[0] = STATE_PROJECTION_MATRIX; @@ -3877,6 +4121,8 @@ yyreduce: break; case 203: + +/* Line 1455 of yacc.c */ #line 1657 "program_parse.y" { (yyval.state)[0] = STATE_MVP_MATRIX; @@ -3885,6 +4131,8 @@ yyreduce: break; case 204: + +/* Line 1455 of yacc.c */ #line 1662 "program_parse.y" { (yyval.state)[0] = STATE_TEXTURE_MATRIX; @@ -3893,6 +4141,8 @@ yyreduce: break; case 205: + +/* Line 1455 of yacc.c */ #line 1667 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); @@ -3901,6 +4151,8 @@ yyreduce: break; case 206: + +/* Line 1455 of yacc.c */ #line 1672 "program_parse.y" { (yyval.state)[0] = STATE_PROGRAM_MATRIX; @@ -3909,6 +4161,8 @@ yyreduce: break; case 207: + +/* Line 1455 of yacc.c */ #line 1679 "program_parse.y" { (yyval.integer) = 0; @@ -3916,6 +4170,8 @@ yyreduce: break; case 208: + +/* Line 1455 of yacc.c */ #line 1683 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); @@ -3923,6 +4179,8 @@ yyreduce: break; case 209: + +/* Line 1455 of yacc.c */ #line 1688 "program_parse.y" { /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix @@ -3938,6 +4196,8 @@ yyreduce: break; case 210: + +/* Line 1455 of yacc.c */ #line 1701 "program_parse.y" { /* Since GL_ARB_matrix_palette isn't supported, just let any value @@ -3948,6 +4208,8 @@ yyreduce: break; case 211: + +/* Line 1455 of yacc.c */ #line 1709 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxProgramMatrices) { @@ -3960,6 +4222,8 @@ yyreduce: break; case 212: + +/* Line 1455 of yacc.c */ #line 1720 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); @@ -3968,6 +4232,8 @@ yyreduce: break; case 217: + +/* Line 1455 of yacc.c */ #line 1732 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); @@ -3979,6 +4245,8 @@ yyreduce: break; case 218: + +/* Line 1455 of yacc.c */ #line 1742 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); @@ -3987,6 +4255,8 @@ yyreduce: break; case 219: + +/* Line 1455 of yacc.c */ #line 1747 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); @@ -3995,6 +4265,8 @@ yyreduce: break; case 220: + +/* Line 1455 of yacc.c */ #line 1754 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); @@ -4006,6 +4278,8 @@ yyreduce: break; case 221: + +/* Line 1455 of yacc.c */ #line 1764 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); @@ -4017,6 +4291,8 @@ yyreduce: break; case 222: + +/* Line 1455 of yacc.c */ #line 1773 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); @@ -4025,6 +4301,8 @@ yyreduce: break; case 223: + +/* Line 1455 of yacc.c */ #line 1778 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); @@ -4033,6 +4311,8 @@ yyreduce: break; case 224: + +/* Line 1455 of yacc.c */ #line 1785 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); @@ -4044,6 +4324,8 @@ yyreduce: break; case 225: + +/* Line 1455 of yacc.c */ #line 1795 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxEnvParams) { @@ -4055,6 +4337,8 @@ yyreduce: break; case 226: + +/* Line 1455 of yacc.c */ #line 1805 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxLocalParams) { @@ -4066,6 +4350,8 @@ yyreduce: break; case 231: + +/* Line 1455 of yacc.c */ #line 1820 "program_parse.y" { (yyval.vector).count = 4; @@ -4077,6 +4363,8 @@ yyreduce: break; case 232: + +/* Line 1455 of yacc.c */ #line 1830 "program_parse.y" { (yyval.vector).count = 1; @@ -4088,6 +4376,8 @@ yyreduce: break; case 233: + +/* Line 1455 of yacc.c */ #line 1838 "program_parse.y" { (yyval.vector).count = 1; @@ -4099,6 +4389,8 @@ yyreduce: break; case 234: + +/* Line 1455 of yacc.c */ #line 1848 "program_parse.y" { (yyval.vector).count = 4; @@ -4110,6 +4402,8 @@ yyreduce: break; case 235: + +/* Line 1455 of yacc.c */ #line 1856 "program_parse.y" { (yyval.vector).count = 4; @@ -4121,6 +4415,8 @@ yyreduce: break; case 236: + +/* Line 1455 of yacc.c */ #line 1865 "program_parse.y" { (yyval.vector).count = 4; @@ -4132,6 +4428,8 @@ yyreduce: break; case 237: + +/* Line 1455 of yacc.c */ #line 1874 "program_parse.y" { (yyval.vector).count = 4; @@ -4143,6 +4441,8 @@ yyreduce: break; case 238: + +/* Line 1455 of yacc.c */ #line 1884 "program_parse.y" { (yyval.real) = ((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].real) : (yyvsp[(2) - (2)].real); @@ -4150,6 +4450,8 @@ yyreduce: break; case 239: + +/* Line 1455 of yacc.c */ #line 1888 "program_parse.y" { (yyval.real) = (float)(((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].integer) : (yyvsp[(2) - (2)].integer)); @@ -4157,26 +4459,36 @@ yyreduce: break; case 240: + +/* Line 1455 of yacc.c */ #line 1893 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 241: + +/* Line 1455 of yacc.c */ #line 1894 "program_parse.y" { (yyval.negate) = TRUE; ;} break; case 242: + +/* Line 1455 of yacc.c */ #line 1895 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 243: + +/* Line 1455 of yacc.c */ #line 1898 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; case 245: + +/* Line 1455 of yacc.c */ #line 1902 "program_parse.y" { /* NV_fragment_program_option defines the size qualifiers in a @@ -4214,17 +4526,23 @@ yyreduce: break; case 246: + +/* Line 1455 of yacc.c */ #line 1936 "program_parse.y" { ;} break; case 247: + +/* Line 1455 of yacc.c */ #line 1940 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 249: + +/* Line 1455 of yacc.c */ #line 1944 "program_parse.y" { if (!declare_variable(state, (yyvsp[(3) - (3)].string), (yyvsp[(0) - (3)].integer), & (yylsp[(3) - (3)]))) { @@ -4234,6 +4552,8 @@ yyreduce: break; case 250: + +/* Line 1455 of yacc.c */ #line 1950 "program_parse.y" { if (!declare_variable(state, (yyvsp[(1) - (1)].string), (yyvsp[(0) - (1)].integer), & (yylsp[(1) - (1)]))) { @@ -4243,6 +4563,8 @@ yyreduce: break; case 251: + +/* Line 1455 of yacc.c */ #line 1958 "program_parse.y" { struct asm_symbol *const s = @@ -4257,6 +4579,8 @@ yyreduce: break; case 252: + +/* Line 1455 of yacc.c */ #line 1971 "program_parse.y" { if (state->mode == ARB_vertex) { @@ -4269,6 +4593,8 @@ yyreduce: break; case 253: + +/* Line 1455 of yacc.c */ #line 1980 "program_parse.y" { if (state->mode == ARB_vertex) { @@ -4281,6 +4607,8 @@ yyreduce: break; case 254: + +/* Line 1455 of yacc.c */ #line 1989 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (2)].result); @@ -4288,6 +4616,8 @@ yyreduce: break; case 255: + +/* Line 1455 of yacc.c */ #line 1993 "program_parse.y" { if (state->mode == ARB_vertex) { @@ -4300,6 +4630,8 @@ yyreduce: break; case 256: + +/* Line 1455 of yacc.c */ #line 2002 "program_parse.y" { if (state->mode == ARB_vertex) { @@ -4312,6 +4644,8 @@ yyreduce: break; case 257: + +/* Line 1455 of yacc.c */ #line 2011 "program_parse.y" { if (state->mode == ARB_fragment) { @@ -4324,6 +4658,8 @@ yyreduce: break; case 258: + +/* Line 1455 of yacc.c */ #line 2022 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (3)].integer) + (yyvsp[(3) - (3)].integer); @@ -4331,6 +4667,8 @@ yyreduce: break; case 259: + +/* Line 1455 of yacc.c */ #line 2028 "program_parse.y" { (yyval.integer) = (state->mode == ARB_vertex) @@ -4340,6 +4678,8 @@ yyreduce: break; case 260: + +/* Line 1455 of yacc.c */ #line 2034 "program_parse.y" { if (state->mode == ARB_vertex) { @@ -4352,6 +4692,8 @@ yyreduce: break; case 261: + +/* Line 1455 of yacc.c */ #line 2043 "program_parse.y" { if (state->mode == ARB_vertex) { @@ -4364,6 +4706,8 @@ yyreduce: break; case 262: + +/* Line 1455 of yacc.c */ #line 2054 "program_parse.y" { (yyval.integer) = 0; @@ -4371,6 +4715,8 @@ yyreduce: break; case 263: + +/* Line 1455 of yacc.c */ #line 2058 "program_parse.y" { if (state->mode == ARB_vertex) { @@ -4383,6 +4729,8 @@ yyreduce: break; case 264: + +/* Line 1455 of yacc.c */ #line 2067 "program_parse.y" { if (state->mode == ARB_vertex) { @@ -4395,66 +4743,92 @@ yyreduce: break; case 265: + +/* Line 1455 of yacc.c */ #line 2077 "program_parse.y" { (yyval.integer) = 0; ;} break; case 266: + +/* Line 1455 of yacc.c */ #line 2078 "program_parse.y" { (yyval.integer) = 0; ;} break; case 267: + +/* Line 1455 of yacc.c */ #line 2079 "program_parse.y" { (yyval.integer) = 1; ;} break; case 268: + +/* Line 1455 of yacc.c */ #line 2082 "program_parse.y" { (yyval.integer) = 0; ;} break; case 269: + +/* Line 1455 of yacc.c */ #line 2083 "program_parse.y" { (yyval.integer) = 0; ;} break; case 270: + +/* Line 1455 of yacc.c */ #line 2084 "program_parse.y" { (yyval.integer) = 1; ;} break; case 271: + +/* Line 1455 of yacc.c */ #line 2087 "program_parse.y" { (yyval.integer) = 0; ;} break; case 272: + +/* Line 1455 of yacc.c */ #line 2088 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 273: + +/* Line 1455 of yacc.c */ #line 2091 "program_parse.y" { (yyval.integer) = 0; ;} break; case 274: + +/* Line 1455 of yacc.c */ #line 2092 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 275: + +/* Line 1455 of yacc.c */ #line 2095 "program_parse.y" { (yyval.integer) = 0; ;} break; case 276: + +/* Line 1455 of yacc.c */ #line 2096 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 277: + +/* Line 1455 of yacc.c */ #line 2100 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) { @@ -4467,6 +4841,8 @@ yyreduce: break; case 278: + +/* Line 1455 of yacc.c */ #line 2111 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) { @@ -4479,6 +4855,8 @@ yyreduce: break; case 279: + +/* Line 1455 of yacc.c */ #line 2122 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) { @@ -4491,6 +4869,8 @@ yyreduce: break; case 280: + +/* Line 1455 of yacc.c */ #line 2133 "program_parse.y" { struct asm_symbol *exist = (struct asm_symbol *) @@ -4498,9 +4878,10 @@ yyreduce: struct asm_symbol *target = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(4) - (4)].string)); - if (exist != NULL) { - yyerror(& (yylsp[(2) - (4)]), state, "redeclared identifier"); + char m[1000]; + _mesa_snprintf(m, sizeof(m), "redeclared identifier: %s", (yyvsp[(2) - (4)].string)); + yyerror(& (yylsp[(2) - (4)]), state, m); YYERROR; } else if (target == NULL) { yyerror(& (yylsp[(4) - (4)]), state, @@ -4513,8 +4894,9 @@ yyreduce: break; -/* Line 1267 of yacc.c. */ -#line 4518 "program_parse.tab.c" + +/* Line 1455 of yacc.c */ +#line 4900 "program_parse.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -4590,7 +4972,7 @@ yyerrlab: if (yyerrstatus == 3) { - /* If just tried and failed to reuse look-ahead token after an + /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYEOF) @@ -4607,7 +4989,7 @@ yyerrlab: } } - /* Else will try to reuse look-ahead token after shifting the error + /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; @@ -4665,14 +5047,11 @@ yyerrlab1: YY_STACK_PRINT (yyss, yyssp); } - if (yyn == YYFINAL) - YYACCEPT; - *++yyvsp = yylval; yyerror_range[1] = yylloc; /* Using YYLLOC is tempting, but would change the location of - the look-ahead. YYLOC is available though. */ + the lookahead. YYLOC is available though. */ YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); *++yylsp = yyloc; @@ -4697,7 +5076,7 @@ yyabortlab: yyresult = 1; goto yyreturn; -#ifndef yyoverflow +#if !defined(yyoverflow) || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ @@ -4708,7 +5087,7 @@ yyexhaustedlab: #endif yyreturn: - if (yychar != YYEOF && yychar != YYEMPTY) + if (yychar != YYEMPTY) yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc, state); /* Do not reclaim the symbols of the rule which action triggered @@ -4734,7 +5113,9 @@ yyreturn: } -#line 2157 "program_parse.y" + +/* Line 1675 of yacc.c */ +#line 2158 "program_parse.y" void diff --git a/src/mesa/shader/program_parse.tab.h b/src/mesa/shader/program_parse.tab.h index 25048065c1..406100c859 100644 --- a/src/mesa/shader/program_parse.tab.h +++ b/src/mesa/shader/program_parse.tab.h @@ -1,24 +1,23 @@ -/* A Bison parser, made by GNU Bison 2.3. */ -/* Skeleton interface for Bison's Yacc-like parsers in C +/* A Bison parser, made by GNU Bison 2.4.1. */ - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 +/* Skeleton interface for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. - - This program is free software; you can redistribute it and/or modify + + This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2, or (at your option) - any later version. - + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - + You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. */ + along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@ -29,10 +28,11 @@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. - + This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ + /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE @@ -146,120 +146,16 @@ DOT = 362 }; #endif -/* Tokens. */ -#define ARBvp_10 258 -#define ARBfp_10 259 -#define ADDRESS 260 -#define ALIAS 261 -#define ATTRIB 262 -#define OPTION 263 -#define OUTPUT 264 -#define PARAM 265 -#define TEMP 266 -#define END 267 -#define BIN_OP 268 -#define BINSC_OP 269 -#define SAMPLE_OP 270 -#define SCALAR_OP 271 -#define TRI_OP 272 -#define VECTOR_OP 273 -#define ARL 274 -#define KIL 275 -#define SWZ 276 -#define TXD_OP 277 -#define INTEGER 278 -#define REAL 279 -#define AMBIENT 280 -#define ATTENUATION 281 -#define BACK 282 -#define CLIP 283 -#define COLOR 284 -#define DEPTH 285 -#define DIFFUSE 286 -#define DIRECTION 287 -#define EMISSION 288 -#define ENV 289 -#define EYE 290 -#define FOG 291 -#define FOGCOORD 292 -#define FRAGMENT 293 -#define FRONT 294 -#define HALF 295 -#define INVERSE 296 -#define INVTRANS 297 -#define LIGHT 298 -#define LIGHTMODEL 299 -#define LIGHTPROD 300 -#define LOCAL 301 -#define MATERIAL 302 -#define MAT_PROGRAM 303 -#define MATRIX 304 -#define MATRIXINDEX 305 -#define MODELVIEW 306 -#define MVP 307 -#define NORMAL 308 -#define OBJECT 309 -#define PALETTE 310 -#define PARAMS 311 -#define PLANE 312 -#define POINT_TOK 313 -#define POINTSIZE 314 -#define POSITION 315 -#define PRIMARY 316 -#define PROGRAM 317 -#define PROJECTION 318 -#define RANGE 319 -#define RESULT 320 -#define ROW 321 -#define SCENECOLOR 322 -#define SECONDARY 323 -#define SHININESS 324 -#define SIZE_TOK 325 -#define SPECULAR 326 -#define SPOT 327 -#define STATE 328 -#define TEXCOORD 329 -#define TEXENV 330 -#define TEXGEN 331 -#define TEXGEN_Q 332 -#define TEXGEN_R 333 -#define TEXGEN_S 334 -#define TEXGEN_T 335 -#define TEXTURE 336 -#define TRANSPOSE 337 -#define TEXTURE_UNIT 338 -#define TEX_1D 339 -#define TEX_2D 340 -#define TEX_3D 341 -#define TEX_CUBE 342 -#define TEX_RECT 343 -#define TEX_SHADOW1D 344 -#define TEX_SHADOW2D 345 -#define TEX_SHADOWRECT 346 -#define TEX_ARRAY1D 347 -#define TEX_ARRAY2D 348 -#define TEX_ARRAYSHADOW1D 349 -#define TEX_ARRAYSHADOW2D 350 -#define VERTEX 351 -#define VTXATTRIB 352 -#define WEIGHT 353 -#define IDENTIFIER 354 -#define USED_IDENTIFIER 355 -#define MASK4 356 -#define MASK3 357 -#define MASK2 358 -#define MASK1 359 -#define SWIZZLE 360 -#define DOT_DOT 361 -#define DOT 362 - #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE -#line 122 "program_parse.y" { + +/* Line 1676 of yacc.c */ +#line 122 "program_parse.y" + struct asm_instruction *inst; struct asm_symbol *sym; struct asm_symbol temp_sym; @@ -283,13 +179,15 @@ typedef union YYSTYPE unsigned xyzw_valid:1; unsigned negate:1; } ext_swizzle; -} -/* Line 1489 of yacc.c. */ -#line 289 "program_parse.tab.h" - YYSTYPE; + + + +/* Line 1676 of yacc.c */ +#line 187 "program_parse.tab.h" +} YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 -# define YYSTYPE_IS_TRIVIAL 1 #endif @@ -308,3 +206,4 @@ typedef struct YYLTYPE #endif + diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 32b058400c..5767c51759 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -2136,9 +2136,10 @@ ALIAS_statement: ALIAS IDENTIFIER '=' USED_IDENTIFIER struct asm_symbol *target = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, $4); - if (exist != NULL) { - yyerror(& @2, state, "redeclared identifier"); + char m[1000]; + _mesa_snprintf(m, sizeof(m), "redeclared identifier: %s", $2); + yyerror(& @2, state, m); YYERROR; } else if (target == NULL) { yyerror(& @4, state, -- cgit v1.2.3 From 76aa0c0fd3d972000cb6707a3834128cea2f9738 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 4 Nov 2009 17:42:01 -0700 Subject: mesa: silence warning from gcc 4.4.1 --- src/mesa/main/imports.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 91d8d156b8..46ffb929b6 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -108,8 +108,8 @@ _mesa_align_malloc(size_t bytes, unsigned long alignment) { #if defined(HAVE_POSIX_MEMALIGN) void *mem; - - (void) posix_memalign(& mem, alignment, bytes); + int err = posix_memalign(& mem, alignment, bytes); + (void) err; return mem; #elif defined(_WIN32) && defined(_MSC_VER) return _aligned_malloc(bytes, alignment); -- cgit v1.2.3 From bc4ad7c2ae069a7d361f2210d39dbb91777cce76 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 4 Nov 2009 17:42:30 -0700 Subject: mesa: fix broken pack_histogram() case for GLhalf --- src/mesa/main/histogram.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/histogram.c b/src/mesa/main/histogram.c index ceb0d5a6a8..4c46f92787 100644 --- a/src/mesa/main/histogram.c +++ b/src/mesa/main/histogram.c @@ -186,16 +186,17 @@ pack_histogram( GLcontext *ctx, { /* temporarily store as GLuints */ GLuint temp[4*HISTOGRAM_TABLE_SIZE]; - GLhalfARB *dst = (GLhalfARB *) destination; + GLuint *dst = temp; + GLhalfARB *half = destination; GLuint i; /* get GLuint values */ PACK_MACRO(GLuint); /* convert to GLhalf */ for (i = 0; i < n * comps; i++) { - dst[i] = _mesa_float_to_half((GLfloat) temp[i]); + half[i] = _mesa_float_to_half((GLfloat) temp[i]); } if (packing->SwapBytes) { - _mesa_swap2((GLushort *) dst, n * comps); + _mesa_swap2((GLushort *) half, n * comps); } } break; -- cgit v1.2.3 From 1c3f7ab74ce492d6c92f2e3a0f29957fa9a71d96 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 4 Nov 2009 17:51:21 -0700 Subject: vbo: fix out-of-bounds array access The exec->vtx.inputs[] array was being written past its end. This was clobbering the following vbo_exec_context::eval state. Probably not noticed since evaluators and immediate mode rendering don't happen at the same time. Fixed the loop in vbo_exec_vtx_init(). Changed the size of the vbo_exec_context::vtx.arrays[] array. Added a bunch of debug-build assertions. Issue found by Vinson Lee. --- src/mesa/vbo/vbo_exec.h | 2 +- src/mesa/vbo/vbo_exec_api.c | 6 ++++++ src/mesa/vbo/vbo_exec_draw.c | 4 ++++ 3 files changed, 11 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/vbo/vbo_exec.h b/src/mesa/vbo/vbo_exec.h index e0f44892cf..7fb5926160 100644 --- a/src/mesa/vbo/vbo_exec.h +++ b/src/mesa/vbo/vbo_exec.h @@ -103,7 +103,7 @@ struct vbo_exec_context GLubyte active_sz[VBO_ATTRIB_MAX]; GLfloat *attrptr[VBO_ATTRIB_MAX]; - struct gl_client_array arrays[VBO_ATTRIB_MAX]; + struct gl_client_array arrays[VERT_ATTRIB_MAX]; /* According to program mode, the values above plus current * values are squashed down to the 32 attributes passed to the diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index 387d4ee3d4..acc7647900 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -695,8 +695,14 @@ void vbo_exec_vtx_init( struct vbo_exec_context *exec ) _mesa_install_exec_vtxfmt( exec->ctx, &exec->vtxfmt ); for (i = 0 ; i < VBO_ATTRIB_MAX ; i++) { + ASSERT(i < Elements(exec->vtx.attrsz)); exec->vtx.attrsz[i] = 0; + ASSERT(i < Elements(exec->vtx.active_sz)); exec->vtx.active_sz[i] = 0; + } + for (i = 0 ; i < VERT_ATTRIB_MAX; i++) { + ASSERT(i < Elements(exec->vtx.inputs)); + ASSERT(i < Elements(exec->vtx.arrays)); exec->vtx.inputs[i] = &exec->vtx.arrays[i]; } diff --git a/src/mesa/vbo/vbo_exec_draw.c b/src/mesa/vbo/vbo_exec_draw.c index 0c258c535e..f41d629450 100644 --- a/src/mesa/vbo/vbo_exec_draw.c +++ b/src/mesa/vbo/vbo_exec_draw.c @@ -172,6 +172,7 @@ vbo_exec_bind_arrays( GLcontext *ctx ) exec->vtx.inputs[attr] = &vbo->legacy_currval[attr]; } for (attr = 0; attr < MAT_ATTRIB_MAX; attr++) { + ASSERT(attr + 16 < Elements(exec->vtx.inputs)); exec->vtx.inputs[attr + 16] = &vbo->mat_currval[attr]; } map = vbo->map_vp_none; @@ -184,6 +185,7 @@ vbo_exec_bind_arrays( GLcontext *ctx ) */ for (attr = 0; attr < 16; attr++) { exec->vtx.inputs[attr] = &vbo->legacy_currval[attr]; + ASSERT(attr + 16 < Elements(exec->vtx.inputs)); exec->vtx.inputs[attr + 16] = &vbo->generic_currval[attr]; } map = vbo->map_vp_arb; @@ -212,6 +214,8 @@ vbo_exec_bind_arrays( GLcontext *ctx ) if (exec->vtx.attrsz[src]) { /* override the default array set above */ + ASSERT(attr < Elements(exec->vtx.inputs)); + ASSERT(attr < Elements(exec->vtx.arrays)); /* arrays[] */ exec->vtx.inputs[attr] = &arrays[attr]; if (_mesa_is_bufferobj(exec->vtx.bufferobj)) { -- cgit v1.2.3 From 7c623905bc032480a0765093825f3bd105345121 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 4 Nov 2009 17:58:43 -0700 Subject: mesa: added cast to silence warning --- src/mesa/main/histogram.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/histogram.c b/src/mesa/main/histogram.c index 4c46f92787..2b3e62c7d5 100644 --- a/src/mesa/main/histogram.c +++ b/src/mesa/main/histogram.c @@ -187,7 +187,7 @@ pack_histogram( GLcontext *ctx, /* temporarily store as GLuints */ GLuint temp[4*HISTOGRAM_TABLE_SIZE]; GLuint *dst = temp; - GLhalfARB *half = destination; + GLhalfARB *half = (GLhalfARB *) destination; GLuint i; /* get GLuint values */ PACK_MACRO(GLuint); -- cgit v1.2.3 From d971069fc6f5dcec64b1f1a60a8a2e7063aaf018 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 5 Nov 2009 13:16:19 -0700 Subject: mesa: fix infinite loop bug in _mesa_drawbuffers() Fixes bug 24946. This regression came from 8df699b3bb1aa05b633f05b121d09d812c86a22d. --- src/mesa/main/buffers.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index e76cf87cb0..7f77c5d772 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -424,9 +424,10 @@ _mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers, while (buf < ctx->Const.MaxDrawBuffers) { if (fb->_ColorDrawBufferIndexes[buf] != -1) { fb->_ColorDrawBufferIndexes[buf] = -1; - buf++; + newState = GL_TRUE; } fb->ColorDrawBuffer[buf] = GL_NONE; + buf++; } fb->_NumColorDrawBuffers = count; } -- cgit v1.2.3 From 63191bd244f18fd78bebb9586d2b85ab9d5b38e2 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 5 Nov 2009 16:48:50 -0700 Subject: xmesa: pass pixmap to clip_for_xgetimage() The code was assuming ctx->DrawBuffer == ctx->ReadBuffer. Passing the pixmap is simpler and better. Fixes a potential segfault. --- src/mesa/drivers/x11/xm_span.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/x11/xm_span.c b/src/mesa/drivers/x11/xm_span.c index 309cefcb8e..c39d87c451 100644 --- a/src/mesa/drivers/x11/xm_span.c +++ b/src/mesa/drivers/x11/xm_span.c @@ -3773,7 +3773,7 @@ static void put_values_ci_ximage( PUT_VALUES_ARGS ) * else return number of pixels to skip in the destination array. */ static int -clip_for_xgetimage(GLcontext *ctx, GLuint *n, GLint *x, GLint *y) +clip_for_xgetimage(GLcontext *ctx, XMesaPixmap pixmap, GLuint *n, GLint *x, GLint *y) { XMesaContext xmesa = XMESA_CONTEXT(ctx); XMesaBuffer source = XMESA_BUFFER(ctx->DrawBuffer); @@ -3783,7 +3783,7 @@ clip_for_xgetimage(GLcontext *ctx, GLuint *n, GLint *x, GLint *y) GLint dx, dy; if (source->type == PBUFFER || source->type == PIXMAP) return 0; - XTranslateCoordinates(xmesa->display, source->frontxrb->pixmap, rootWin, + XTranslateCoordinates(xmesa->display, pixmap, rootWin, *x, *y, &dx, &dy, &child); if (dx >= screenWidth) { /* totally clipped on right */ @@ -3827,7 +3827,7 @@ get_row_ci(GLcontext *ctx, struct gl_renderbuffer *rb, #ifndef XFree86Server XMesaImage *span = NULL; int error; - int k = clip_for_xgetimage(ctx, &n, &x, &y); + int k = clip_for_xgetimage(ctx, xrb->pixmap, &n, &x, &y); if (k < 0) return; index += k; @@ -3892,7 +3892,7 @@ get_row_rgba(GLcontext *ctx, struct gl_renderbuffer *rb, #else int k; y = YFLIP(xrb, y); - k = clip_for_xgetimage(ctx, &n, &x, &y); + k = clip_for_xgetimage(ctx, xrb->pixmap, &n, &x, &y); if (k < 0) return; rgba += k; -- cgit v1.2.3 From f611425101eab5c4b41407c38966f4deca542f56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Fonseca?= Date: Fri, 6 Nov 2009 12:04:49 +0000 Subject: mesa: Translate MAP_UNSYNCHRONIZED_BIT. --- src/mesa/state_tracker/st_cb_bufferobjects.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c index 8e09d0b932..63196afba9 100644 --- a/src/mesa/state_tracker/st_cb_bufferobjects.c +++ b/src/mesa/state_tracker/st_cb_bufferobjects.c @@ -239,6 +239,9 @@ st_bufferobj_map_range(GLcontext *ctx, GLenum target, if (access & GL_MAP_FLUSH_EXPLICIT_BIT) flags |= PIPE_BUFFER_USAGE_FLUSH_EXPLICIT; + if (access & GL_MAP_UNSYNCHRONIZED_BIT) + flags |= PIPE_BUFFER_USAGE_UNSYNCHRONIZED; + /* ... other flags ... */ -- cgit v1.2.3 From 577a598dc905d435a31422bb6135ee9d4352f6b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Fonseca?= Date: Fri, 6 Nov 2009 12:05:43 +0000 Subject: mesa: Export S3_s3tc as well. Used in Quake3. --- src/mesa/state_tracker/st_extensions.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index 3f835d38dd..57fe72d76a 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -284,6 +284,7 @@ void st_init_extensions(struct st_context *st) PIPE_TEXTURE_2D, PIPE_TEXTURE_USAGE_SAMPLER, 0)) { ctx->Extensions.EXT_texture_compression_s3tc = GL_TRUE; + ctx->Extensions.S3_s3tc = GL_TRUE; } /* ycbcr support */ -- cgit v1.2.3 From 38d3c156dc64679e5602816070a0bac4f1f39302 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 6 Nov 2009 07:59:18 -0700 Subject: intel: call intel_check_front_buffer_rendering() in intelClear() fixes bug 24953. --- src/mesa/drivers/dri/intel/intel_clear.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_clear.c b/src/mesa/drivers/dri/intel/intel_clear.c index fb62f0f430..1cf41ee6b8 100644 --- a/src/mesa/drivers/dri/intel/intel_clear.c +++ b/src/mesa/drivers/dri/intel/intel_clear.c @@ -33,6 +33,7 @@ #include "intel_context.h" #include "intel_blit.h" +#include "intel_buffers.h" #include "intel_chipset.h" #include "intel_clear.h" #include "intel_fbo.h" @@ -75,6 +76,8 @@ intelClear(GLcontext *ctx, GLbitfield mask) struct gl_framebuffer *fb = ctx->DrawBuffer; GLuint i; + intel_check_front_buffer_rendering(intel); + if (0) fprintf(stderr, "%s\n", __FUNCTION__); -- cgit v1.2.3 From 1c7337d46eab0cfd36ebc0ad22c5a66ec9b91d39 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 4 Nov 2009 12:03:44 -0800 Subject: Revert "ARB prog parser: Fix epic memory leak in lexer / parser interface" This reverts commit 93dae6761bc90bbd43b450d2673620ec189b2c7a. This change was completely broken when the parser uses multiple strings in a single production. It would be nice if bug fixes could initially land somewhere other than the stable branch. --- src/mesa/shader/lex.yy.c | 445 ++++++++++++++++-------------------- src/mesa/shader/program_lexer.l | 45 +--- src/mesa/shader/program_parse.tab.c | 21 +- src/mesa/shader/program_parse.y | 17 +- src/mesa/shader/program_parser.h | 16 -- 5 files changed, 207 insertions(+), 337 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/lex.yy.c b/src/mesa/shader/lex.yy.c index 728c2dc272..fefef573ee 100644 --- a/src/mesa/shader/lex.yy.c +++ b/src/mesa/shader/lex.yy.c @@ -53,6 +53,7 @@ typedef int flex_int32_t; typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; +#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@ -83,8 +84,6 @@ typedef unsigned int flex_uint32_t; #define UINT32_MAX (4294967295U) #endif -#endif /* ! C99 */ - #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@ -158,15 +157,7 @@ typedef void* yyscan_t; /* Size of default input buffer. */ #ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else #define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ #endif /* The state buf must be large enough to hold one state per character in the main buffer. @@ -927,7 +918,7 @@ static yyconst flex_int16_t yy_chk[1023] = if (condition) { \ return token; \ } else { \ - yylval->string = return_string(yyextra, yytext); \ + yylval->string = strdup(yytext); \ return IDENTIFIER; \ } \ } while (0) @@ -950,7 +941,7 @@ static yyconst flex_int16_t yy_chk[1023] = yylval->temp_inst.SaturateMode = SATURATE_ ## sat; \ return token; \ } else { \ - yylval->string = return_string(yyextra, yytext); \ + yylval->string = strdup(yytext); \ return IDENTIFIER; \ } \ } while (0) @@ -958,45 +949,6 @@ static yyconst flex_int16_t yy_chk[1023] = #define SWIZZLE_INVAL MAKE_SWIZZLE4(SWIZZLE_NIL, SWIZZLE_NIL, \ SWIZZLE_NIL, SWIZZLE_NIL) -/** - * Send a string to the parser using asm_parser_state::string_dumpster - * - * Sends a string to the parser using asm_parser_state::string_dumpster as a - * temporary storage buffer. Data previously stored in - * asm_parser_state::string_dumpster will be lost. If - * asm_parser_state::string_dumpster is not large enough to hold the new - * string, the buffer size will be increased. The buffer size is \b never - * decreased. - * - * \param state Assembler parser state tracking - * \param str String to be passed to the parser - * - * \return - * A pointer to asm_parser_state::string_dumpster on success or \c NULL on - * failure. Currently the only failure case is \c ENOMEM. - */ -static char * -return_string(struct asm_parser_state *state, const char *str) -{ - const size_t len = strlen(str); - - if (len >= state->dumpster_size) { - char *const dumpster = _mesa_realloc(state->string_dumpster, - state->dumpster_size, - len + 1); - if (dumpster == NULL) { - return NULL; - } - - state->string_dumpster = dumpster; - state->dumpster_size = len + 1; - } - - memcpy(state->string_dumpster, str, len + 1); - return state->string_dumpster; -} - - static unsigned mask_from_char(char c) { @@ -1052,7 +1004,7 @@ swiz_from_char(char c) } while(0); #define YY_EXTRA_TYPE struct asm_parser_state * -#line 1056 "lex.yy.c" +#line 1008 "lex.yy.c" #define INITIAL 0 @@ -1189,12 +1141,7 @@ static int input (yyscan_t yyscanner ); /* Amount of stuff to slurp up with each read. */ #ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else #define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ #endif /* Copy whatever the last rule matched to the standard output. */ @@ -1202,7 +1149,7 @@ static int input (yyscan_t yyscanner ); /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ -#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) +#define ECHO fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@ -1213,7 +1160,7 @@ static int input (yyscan_t yyscanner ); if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ - size_t n; \ + unsigned n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -1298,10 +1245,10 @@ YY_DECL register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 176 "program_lexer.l" +#line 137 "program_lexer.l" -#line 1305 "lex.yy.c" +#line 1252 "lex.yy.c" yylval = yylval_param; @@ -1390,17 +1337,17 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 178 "program_lexer.l" +#line 139 "program_lexer.l" { return ARBvp_10; } YY_BREAK case 2: YY_RULE_SETUP -#line 179 "program_lexer.l" +#line 140 "program_lexer.l" { return ARBfp_10; } YY_BREAK case 3: YY_RULE_SETUP -#line 180 "program_lexer.l" +#line 141 "program_lexer.l" { yylval->integer = at_address; return_token_or_IDENTIFIER(require_ARB_vp, ADDRESS); @@ -1408,760 +1355,760 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 184 "program_lexer.l" +#line 145 "program_lexer.l" { return ALIAS; } YY_BREAK case 5: YY_RULE_SETUP -#line 185 "program_lexer.l" +#line 146 "program_lexer.l" { return ATTRIB; } YY_BREAK case 6: YY_RULE_SETUP -#line 186 "program_lexer.l" +#line 147 "program_lexer.l" { return END; } YY_BREAK case 7: YY_RULE_SETUP -#line 187 "program_lexer.l" +#line 148 "program_lexer.l" { return OPTION; } YY_BREAK case 8: YY_RULE_SETUP -#line 188 "program_lexer.l" +#line 149 "program_lexer.l" { return OUTPUT; } YY_BREAK case 9: YY_RULE_SETUP -#line 189 "program_lexer.l" +#line 150 "program_lexer.l" { return PARAM; } YY_BREAK case 10: YY_RULE_SETUP -#line 190 "program_lexer.l" +#line 151 "program_lexer.l" { yylval->integer = at_temp; return TEMP; } YY_BREAK case 11: YY_RULE_SETUP -#line 192 "program_lexer.l" +#line 153 "program_lexer.l" { return_opcode( 1, VECTOR_OP, ABS, OFF); } YY_BREAK case 12: YY_RULE_SETUP -#line 193 "program_lexer.l" +#line 154 "program_lexer.l" { return_opcode(require_ARB_fp, VECTOR_OP, ABS, ZERO_ONE); } YY_BREAK case 13: YY_RULE_SETUP -#line 194 "program_lexer.l" +#line 155 "program_lexer.l" { return_opcode( 1, BIN_OP, ADD, OFF); } YY_BREAK case 14: YY_RULE_SETUP -#line 195 "program_lexer.l" +#line 156 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, ADD, ZERO_ONE); } YY_BREAK case 15: YY_RULE_SETUP -#line 196 "program_lexer.l" +#line 157 "program_lexer.l" { return_opcode(require_ARB_vp, ARL, ARL, OFF); } YY_BREAK case 16: YY_RULE_SETUP -#line 198 "program_lexer.l" +#line 159 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, CMP, OFF); } YY_BREAK case 17: YY_RULE_SETUP -#line 199 "program_lexer.l" +#line 160 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, CMP, ZERO_ONE); } YY_BREAK case 18: YY_RULE_SETUP -#line 200 "program_lexer.l" +#line 161 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, COS, OFF); } YY_BREAK case 19: YY_RULE_SETUP -#line 201 "program_lexer.l" +#line 162 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, COS, ZERO_ONE); } YY_BREAK case 20: YY_RULE_SETUP -#line 203 "program_lexer.l" +#line 164 "program_lexer.l" { return_opcode( 1, BIN_OP, DP3, OFF); } YY_BREAK case 21: YY_RULE_SETUP -#line 204 "program_lexer.l" +#line 165 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, DP3, ZERO_ONE); } YY_BREAK case 22: YY_RULE_SETUP -#line 205 "program_lexer.l" +#line 166 "program_lexer.l" { return_opcode( 1, BIN_OP, DP4, OFF); } YY_BREAK case 23: YY_RULE_SETUP -#line 206 "program_lexer.l" +#line 167 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, DP4, ZERO_ONE); } YY_BREAK case 24: YY_RULE_SETUP -#line 207 "program_lexer.l" +#line 168 "program_lexer.l" { return_opcode( 1, BIN_OP, DPH, OFF); } YY_BREAK case 25: YY_RULE_SETUP -#line 208 "program_lexer.l" +#line 169 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, DPH, ZERO_ONE); } YY_BREAK case 26: YY_RULE_SETUP -#line 209 "program_lexer.l" +#line 170 "program_lexer.l" { return_opcode( 1, BIN_OP, DST, OFF); } YY_BREAK case 27: YY_RULE_SETUP -#line 210 "program_lexer.l" +#line 171 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, DST, ZERO_ONE); } YY_BREAK case 28: YY_RULE_SETUP -#line 212 "program_lexer.l" +#line 173 "program_lexer.l" { return_opcode( 1, SCALAR_OP, EX2, OFF); } YY_BREAK case 29: YY_RULE_SETUP -#line 213 "program_lexer.l" +#line 174 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, EX2, ZERO_ONE); } YY_BREAK case 30: YY_RULE_SETUP -#line 214 "program_lexer.l" +#line 175 "program_lexer.l" { return_opcode(require_ARB_vp, SCALAR_OP, EXP, OFF); } YY_BREAK case 31: YY_RULE_SETUP -#line 216 "program_lexer.l" +#line 177 "program_lexer.l" { return_opcode( 1, VECTOR_OP, FLR, OFF); } YY_BREAK case 32: YY_RULE_SETUP -#line 217 "program_lexer.l" +#line 178 "program_lexer.l" { return_opcode(require_ARB_fp, VECTOR_OP, FLR, ZERO_ONE); } YY_BREAK case 33: YY_RULE_SETUP -#line 218 "program_lexer.l" +#line 179 "program_lexer.l" { return_opcode( 1, VECTOR_OP, FRC, OFF); } YY_BREAK case 34: YY_RULE_SETUP -#line 219 "program_lexer.l" +#line 180 "program_lexer.l" { return_opcode(require_ARB_fp, VECTOR_OP, FRC, ZERO_ONE); } YY_BREAK case 35: YY_RULE_SETUP -#line 221 "program_lexer.l" +#line 182 "program_lexer.l" { return_opcode(require_ARB_fp, KIL, KIL, OFF); } YY_BREAK case 36: YY_RULE_SETUP -#line 223 "program_lexer.l" +#line 184 "program_lexer.l" { return_opcode( 1, VECTOR_OP, LIT, OFF); } YY_BREAK case 37: YY_RULE_SETUP -#line 224 "program_lexer.l" +#line 185 "program_lexer.l" { return_opcode(require_ARB_fp, VECTOR_OP, LIT, ZERO_ONE); } YY_BREAK case 38: YY_RULE_SETUP -#line 225 "program_lexer.l" +#line 186 "program_lexer.l" { return_opcode( 1, SCALAR_OP, LG2, OFF); } YY_BREAK case 39: YY_RULE_SETUP -#line 226 "program_lexer.l" +#line 187 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, LG2, ZERO_ONE); } YY_BREAK case 40: YY_RULE_SETUP -#line 227 "program_lexer.l" +#line 188 "program_lexer.l" { return_opcode(require_ARB_vp, SCALAR_OP, LOG, OFF); } YY_BREAK case 41: YY_RULE_SETUP -#line 228 "program_lexer.l" +#line 189 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, LRP, OFF); } YY_BREAK case 42: YY_RULE_SETUP -#line 229 "program_lexer.l" +#line 190 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, LRP, ZERO_ONE); } YY_BREAK case 43: YY_RULE_SETUP -#line 231 "program_lexer.l" +#line 192 "program_lexer.l" { return_opcode( 1, TRI_OP, MAD, OFF); } YY_BREAK case 44: YY_RULE_SETUP -#line 232 "program_lexer.l" +#line 193 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, MAD, ZERO_ONE); } YY_BREAK case 45: YY_RULE_SETUP -#line 233 "program_lexer.l" +#line 194 "program_lexer.l" { return_opcode( 1, BIN_OP, MAX, OFF); } YY_BREAK case 46: YY_RULE_SETUP -#line 234 "program_lexer.l" +#line 195 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, MAX, ZERO_ONE); } YY_BREAK case 47: YY_RULE_SETUP -#line 235 "program_lexer.l" +#line 196 "program_lexer.l" { return_opcode( 1, BIN_OP, MIN, OFF); } YY_BREAK case 48: YY_RULE_SETUP -#line 236 "program_lexer.l" +#line 197 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, MIN, ZERO_ONE); } YY_BREAK case 49: YY_RULE_SETUP -#line 237 "program_lexer.l" +#line 198 "program_lexer.l" { return_opcode( 1, VECTOR_OP, MOV, OFF); } YY_BREAK case 50: YY_RULE_SETUP -#line 238 "program_lexer.l" +#line 199 "program_lexer.l" { return_opcode(require_ARB_fp, VECTOR_OP, MOV, ZERO_ONE); } YY_BREAK case 51: YY_RULE_SETUP -#line 239 "program_lexer.l" +#line 200 "program_lexer.l" { return_opcode( 1, BIN_OP, MUL, OFF); } YY_BREAK case 52: YY_RULE_SETUP -#line 240 "program_lexer.l" +#line 201 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, MUL, ZERO_ONE); } YY_BREAK case 53: YY_RULE_SETUP -#line 242 "program_lexer.l" +#line 203 "program_lexer.l" { return_opcode( 1, BINSC_OP, POW, OFF); } YY_BREAK case 54: YY_RULE_SETUP -#line 243 "program_lexer.l" +#line 204 "program_lexer.l" { return_opcode(require_ARB_fp, BINSC_OP, POW, ZERO_ONE); } YY_BREAK case 55: YY_RULE_SETUP -#line 245 "program_lexer.l" +#line 206 "program_lexer.l" { return_opcode( 1, SCALAR_OP, RCP, OFF); } YY_BREAK case 56: YY_RULE_SETUP -#line 246 "program_lexer.l" +#line 207 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, RCP, ZERO_ONE); } YY_BREAK case 57: YY_RULE_SETUP -#line 247 "program_lexer.l" +#line 208 "program_lexer.l" { return_opcode( 1, SCALAR_OP, RSQ, OFF); } YY_BREAK case 58: YY_RULE_SETUP -#line 248 "program_lexer.l" +#line 209 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, RSQ, ZERO_ONE); } YY_BREAK case 59: YY_RULE_SETUP -#line 250 "program_lexer.l" +#line 211 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, SCS, OFF); } YY_BREAK case 60: YY_RULE_SETUP -#line 251 "program_lexer.l" +#line 212 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, SCS, ZERO_ONE); } YY_BREAK case 61: YY_RULE_SETUP -#line 252 "program_lexer.l" +#line 213 "program_lexer.l" { return_opcode( 1, BIN_OP, SGE, OFF); } YY_BREAK case 62: YY_RULE_SETUP -#line 253 "program_lexer.l" +#line 214 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, SGE, ZERO_ONE); } YY_BREAK case 63: YY_RULE_SETUP -#line 254 "program_lexer.l" +#line 215 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, SIN, OFF); } YY_BREAK case 64: YY_RULE_SETUP -#line 255 "program_lexer.l" +#line 216 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, SIN, ZERO_ONE); } YY_BREAK case 65: YY_RULE_SETUP -#line 256 "program_lexer.l" +#line 217 "program_lexer.l" { return_opcode( 1, BIN_OP, SLT, OFF); } YY_BREAK case 66: YY_RULE_SETUP -#line 257 "program_lexer.l" +#line 218 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, SLT, ZERO_ONE); } YY_BREAK case 67: YY_RULE_SETUP -#line 258 "program_lexer.l" +#line 219 "program_lexer.l" { return_opcode( 1, BIN_OP, SUB, OFF); } YY_BREAK case 68: YY_RULE_SETUP -#line 259 "program_lexer.l" +#line 220 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, SUB, ZERO_ONE); } YY_BREAK case 69: YY_RULE_SETUP -#line 260 "program_lexer.l" +#line 221 "program_lexer.l" { return_opcode( 1, SWZ, SWZ, OFF); } YY_BREAK case 70: YY_RULE_SETUP -#line 261 "program_lexer.l" +#line 222 "program_lexer.l" { return_opcode(require_ARB_fp, SWZ, SWZ, ZERO_ONE); } YY_BREAK case 71: YY_RULE_SETUP -#line 263 "program_lexer.l" +#line 224 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, OFF); } YY_BREAK case 72: YY_RULE_SETUP -#line 264 "program_lexer.l" +#line 225 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, ZERO_ONE); } YY_BREAK case 73: YY_RULE_SETUP -#line 265 "program_lexer.l" +#line 226 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, OFF); } YY_BREAK case 74: YY_RULE_SETUP -#line 266 "program_lexer.l" +#line 227 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, ZERO_ONE); } YY_BREAK case 75: YY_RULE_SETUP -#line 267 "program_lexer.l" +#line 228 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, OFF); } YY_BREAK case 76: YY_RULE_SETUP -#line 268 "program_lexer.l" +#line 229 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, ZERO_ONE); } YY_BREAK case 77: YY_RULE_SETUP -#line 270 "program_lexer.l" +#line 231 "program_lexer.l" { return_opcode( 1, BIN_OP, XPD, OFF); } YY_BREAK case 78: YY_RULE_SETUP -#line 271 "program_lexer.l" +#line 232 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, XPD, ZERO_ONE); } YY_BREAK case 79: YY_RULE_SETUP -#line 273 "program_lexer.l" +#line 234 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_vp, VERTEX); } YY_BREAK case 80: YY_RULE_SETUP -#line 274 "program_lexer.l" +#line 235 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, FRAGMENT); } YY_BREAK case 81: YY_RULE_SETUP -#line 275 "program_lexer.l" +#line 236 "program_lexer.l" { return PROGRAM; } YY_BREAK case 82: YY_RULE_SETUP -#line 276 "program_lexer.l" +#line 237 "program_lexer.l" { return STATE; } YY_BREAK case 83: YY_RULE_SETUP -#line 277 "program_lexer.l" +#line 238 "program_lexer.l" { return RESULT; } YY_BREAK case 84: YY_RULE_SETUP -#line 279 "program_lexer.l" +#line 240 "program_lexer.l" { return AMBIENT; } YY_BREAK case 85: YY_RULE_SETUP -#line 280 "program_lexer.l" +#line 241 "program_lexer.l" { return ATTENUATION; } YY_BREAK case 86: YY_RULE_SETUP -#line 281 "program_lexer.l" +#line 242 "program_lexer.l" { return BACK; } YY_BREAK case 87: YY_RULE_SETUP -#line 282 "program_lexer.l" +#line 243 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, CLIP); } YY_BREAK case 88: YY_RULE_SETUP -#line 283 "program_lexer.l" +#line 244 "program_lexer.l" { return COLOR; } YY_BREAK case 89: YY_RULE_SETUP -#line 284 "program_lexer.l" +#line 245 "program_lexer.l" { return_token_or_DOT(require_ARB_fp, DEPTH); } YY_BREAK case 90: YY_RULE_SETUP -#line 285 "program_lexer.l" +#line 246 "program_lexer.l" { return DIFFUSE; } YY_BREAK case 91: YY_RULE_SETUP -#line 286 "program_lexer.l" +#line 247 "program_lexer.l" { return DIRECTION; } YY_BREAK case 92: YY_RULE_SETUP -#line 287 "program_lexer.l" +#line 248 "program_lexer.l" { return EMISSION; } YY_BREAK case 93: YY_RULE_SETUP -#line 288 "program_lexer.l" +#line 249 "program_lexer.l" { return ENV; } YY_BREAK case 94: YY_RULE_SETUP -#line 289 "program_lexer.l" +#line 250 "program_lexer.l" { return EYE; } YY_BREAK case 95: YY_RULE_SETUP -#line 290 "program_lexer.l" +#line 251 "program_lexer.l" { return FOGCOORD; } YY_BREAK case 96: YY_RULE_SETUP -#line 291 "program_lexer.l" +#line 252 "program_lexer.l" { return FOG; } YY_BREAK case 97: YY_RULE_SETUP -#line 292 "program_lexer.l" +#line 253 "program_lexer.l" { return FRONT; } YY_BREAK case 98: YY_RULE_SETUP -#line 293 "program_lexer.l" +#line 254 "program_lexer.l" { return HALF; } YY_BREAK case 99: YY_RULE_SETUP -#line 294 "program_lexer.l" +#line 255 "program_lexer.l" { return INVERSE; } YY_BREAK case 100: YY_RULE_SETUP -#line 295 "program_lexer.l" +#line 256 "program_lexer.l" { return INVTRANS; } YY_BREAK case 101: YY_RULE_SETUP -#line 296 "program_lexer.l" +#line 257 "program_lexer.l" { return LIGHT; } YY_BREAK case 102: YY_RULE_SETUP -#line 297 "program_lexer.l" +#line 258 "program_lexer.l" { return LIGHTMODEL; } YY_BREAK case 103: YY_RULE_SETUP -#line 298 "program_lexer.l" +#line 259 "program_lexer.l" { return LIGHTPROD; } YY_BREAK case 104: YY_RULE_SETUP -#line 299 "program_lexer.l" +#line 260 "program_lexer.l" { return LOCAL; } YY_BREAK case 105: YY_RULE_SETUP -#line 300 "program_lexer.l" +#line 261 "program_lexer.l" { return MATERIAL; } YY_BREAK case 106: YY_RULE_SETUP -#line 301 "program_lexer.l" +#line 262 "program_lexer.l" { return MAT_PROGRAM; } YY_BREAK case 107: YY_RULE_SETUP -#line 302 "program_lexer.l" +#line 263 "program_lexer.l" { return MATRIX; } YY_BREAK case 108: YY_RULE_SETUP -#line 303 "program_lexer.l" +#line 264 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, MATRIXINDEX); } YY_BREAK case 109: YY_RULE_SETUP -#line 304 "program_lexer.l" +#line 265 "program_lexer.l" { return MODELVIEW; } YY_BREAK case 110: YY_RULE_SETUP -#line 305 "program_lexer.l" +#line 266 "program_lexer.l" { return MVP; } YY_BREAK case 111: YY_RULE_SETUP -#line 306 "program_lexer.l" +#line 267 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, NORMAL); } YY_BREAK case 112: YY_RULE_SETUP -#line 307 "program_lexer.l" +#line 268 "program_lexer.l" { return OBJECT; } YY_BREAK case 113: YY_RULE_SETUP -#line 308 "program_lexer.l" +#line 269 "program_lexer.l" { return PALETTE; } YY_BREAK case 114: YY_RULE_SETUP -#line 309 "program_lexer.l" +#line 270 "program_lexer.l" { return PARAMS; } YY_BREAK case 115: YY_RULE_SETUP -#line 310 "program_lexer.l" +#line 271 "program_lexer.l" { return PLANE; } YY_BREAK case 116: YY_RULE_SETUP -#line 311 "program_lexer.l" +#line 272 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, POINT_TOK); } YY_BREAK case 117: YY_RULE_SETUP -#line 312 "program_lexer.l" +#line 273 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, POINTSIZE); } YY_BREAK case 118: YY_RULE_SETUP -#line 313 "program_lexer.l" +#line 274 "program_lexer.l" { return POSITION; } YY_BREAK case 119: YY_RULE_SETUP -#line 314 "program_lexer.l" +#line 275 "program_lexer.l" { return PRIMARY; } YY_BREAK case 120: YY_RULE_SETUP -#line 315 "program_lexer.l" +#line 276 "program_lexer.l" { return PROJECTION; } YY_BREAK case 121: YY_RULE_SETUP -#line 316 "program_lexer.l" +#line 277 "program_lexer.l" { return_token_or_DOT(require_ARB_fp, RANGE); } YY_BREAK case 122: YY_RULE_SETUP -#line 317 "program_lexer.l" +#line 278 "program_lexer.l" { return ROW; } YY_BREAK case 123: YY_RULE_SETUP -#line 318 "program_lexer.l" +#line 279 "program_lexer.l" { return SCENECOLOR; } YY_BREAK case 124: YY_RULE_SETUP -#line 319 "program_lexer.l" +#line 280 "program_lexer.l" { return SECONDARY; } YY_BREAK case 125: YY_RULE_SETUP -#line 320 "program_lexer.l" +#line 281 "program_lexer.l" { return SHININESS; } YY_BREAK case 126: YY_RULE_SETUP -#line 321 "program_lexer.l" +#line 282 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, SIZE_TOK); } YY_BREAK case 127: YY_RULE_SETUP -#line 322 "program_lexer.l" +#line 283 "program_lexer.l" { return SPECULAR; } YY_BREAK case 128: YY_RULE_SETUP -#line 323 "program_lexer.l" +#line 284 "program_lexer.l" { return SPOT; } YY_BREAK case 129: YY_RULE_SETUP -#line 324 "program_lexer.l" +#line 285 "program_lexer.l" { return TEXCOORD; } YY_BREAK case 130: YY_RULE_SETUP -#line 325 "program_lexer.l" +#line 286 "program_lexer.l" { return_token_or_DOT(require_ARB_fp, TEXENV); } YY_BREAK case 131: YY_RULE_SETUP -#line 326 "program_lexer.l" +#line 287 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN); } YY_BREAK case 132: YY_RULE_SETUP -#line 327 "program_lexer.l" +#line 288 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN_Q); } YY_BREAK case 133: YY_RULE_SETUP -#line 328 "program_lexer.l" +#line 289 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN_S); } YY_BREAK case 134: YY_RULE_SETUP -#line 329 "program_lexer.l" +#line 290 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN_T); } YY_BREAK case 135: YY_RULE_SETUP -#line 330 "program_lexer.l" +#line 291 "program_lexer.l" { return TEXTURE; } YY_BREAK case 136: YY_RULE_SETUP -#line 331 "program_lexer.l" +#line 292 "program_lexer.l" { return TRANSPOSE; } YY_BREAK case 137: YY_RULE_SETUP -#line 332 "program_lexer.l" +#line 293 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, VTXATTRIB); } YY_BREAK case 138: YY_RULE_SETUP -#line 333 "program_lexer.l" +#line 294 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, WEIGHT); } YY_BREAK case 139: YY_RULE_SETUP -#line 335 "program_lexer.l" +#line 296 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEXTURE_UNIT); } YY_BREAK case 140: YY_RULE_SETUP -#line 336 "program_lexer.l" +#line 297 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_1D); } YY_BREAK case 141: YY_RULE_SETUP -#line 337 "program_lexer.l" +#line 298 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_2D); } YY_BREAK case 142: YY_RULE_SETUP -#line 338 "program_lexer.l" +#line 299 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_3D); } YY_BREAK case 143: YY_RULE_SETUP -#line 339 "program_lexer.l" +#line 300 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_CUBE); } YY_BREAK case 144: YY_RULE_SETUP -#line 340 "program_lexer.l" +#line 301 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_rect, TEX_RECT); } YY_BREAK case 145: YY_RULE_SETUP -#line 341 "program_lexer.l" +#line 302 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW1D); } YY_BREAK case 146: YY_RULE_SETUP -#line 342 "program_lexer.l" +#line 303 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW2D); } YY_BREAK case 147: YY_RULE_SETUP -#line 343 "program_lexer.l" +#line 304 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_rect, TEX_SHADOWRECT); } YY_BREAK case 148: YY_RULE_SETUP -#line 344 "program_lexer.l" +#line 305 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY1D); } YY_BREAK case 149: YY_RULE_SETUP -#line 345 "program_lexer.l" +#line 306 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY2D); } YY_BREAK case 150: YY_RULE_SETUP -#line 346 "program_lexer.l" +#line 307 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW1D); } YY_BREAK case 151: YY_RULE_SETUP -#line 347 "program_lexer.l" +#line 308 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW2D); } YY_BREAK case 152: YY_RULE_SETUP -#line 349 "program_lexer.l" +#line 310 "program_lexer.l" { - yylval->string = return_string(yyextra, yytext); + yylval->string = strdup(yytext); return IDENTIFIER; } YY_BREAK case 153: YY_RULE_SETUP -#line 354 "program_lexer.l" +#line 315 "program_lexer.l" { return DOT_DOT; } YY_BREAK case 154: YY_RULE_SETUP -#line 356 "program_lexer.l" +#line 317 "program_lexer.l" { yylval->integer = strtol(yytext, NULL, 10); return INTEGER; @@ -2169,7 +2116,7 @@ YY_RULE_SETUP YY_BREAK case 155: YY_RULE_SETUP -#line 360 "program_lexer.l" +#line 321 "program_lexer.l" { yylval->real = _mesa_strtod(yytext, NULL); return REAL; @@ -2181,7 +2128,7 @@ case 156: yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 364 "program_lexer.l" +#line 325 "program_lexer.l" { yylval->real = _mesa_strtod(yytext, NULL); return REAL; @@ -2189,7 +2136,7 @@ YY_RULE_SETUP YY_BREAK case 157: YY_RULE_SETUP -#line 368 "program_lexer.l" +#line 329 "program_lexer.l" { yylval->real = _mesa_strtod(yytext, NULL); return REAL; @@ -2197,7 +2144,7 @@ YY_RULE_SETUP YY_BREAK case 158: YY_RULE_SETUP -#line 372 "program_lexer.l" +#line 333 "program_lexer.l" { yylval->real = _mesa_strtod(yytext, NULL); return REAL; @@ -2205,7 +2152,7 @@ YY_RULE_SETUP YY_BREAK case 159: YY_RULE_SETUP -#line 377 "program_lexer.l" +#line 338 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; @@ -2214,7 +2161,7 @@ YY_RULE_SETUP YY_BREAK case 160: YY_RULE_SETUP -#line 383 "program_lexer.l" +#line 344 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@ -2224,7 +2171,7 @@ YY_RULE_SETUP YY_BREAK case 161: YY_RULE_SETUP -#line 389 "program_lexer.l" +#line 350 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; @@ -2233,7 +2180,7 @@ YY_RULE_SETUP YY_BREAK case 162: YY_RULE_SETUP -#line 394 "program_lexer.l" +#line 355 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; @@ -2242,7 +2189,7 @@ YY_RULE_SETUP YY_BREAK case 163: YY_RULE_SETUP -#line 400 "program_lexer.l" +#line 361 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@ -2252,7 +2199,7 @@ YY_RULE_SETUP YY_BREAK case 164: YY_RULE_SETUP -#line 406 "program_lexer.l" +#line 367 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@ -2262,7 +2209,7 @@ YY_RULE_SETUP YY_BREAK case 165: YY_RULE_SETUP -#line 412 "program_lexer.l" +#line 373 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; @@ -2271,7 +2218,7 @@ YY_RULE_SETUP YY_BREAK case 166: YY_RULE_SETUP -#line 418 "program_lexer.l" +#line 379 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@ -2281,7 +2228,7 @@ YY_RULE_SETUP YY_BREAK case 167: YY_RULE_SETUP -#line 425 "program_lexer.l" +#line 386 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@ -2293,7 +2240,7 @@ YY_RULE_SETUP YY_BREAK case 168: YY_RULE_SETUP -#line 434 "program_lexer.l" +#line 395 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; @@ -2302,7 +2249,7 @@ YY_RULE_SETUP YY_BREAK case 169: YY_RULE_SETUP -#line 440 "program_lexer.l" +#line 401 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@ -2312,7 +2259,7 @@ YY_RULE_SETUP YY_BREAK case 170: YY_RULE_SETUP -#line 446 "program_lexer.l" +#line 407 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; @@ -2321,7 +2268,7 @@ YY_RULE_SETUP YY_BREAK case 171: YY_RULE_SETUP -#line 451 "program_lexer.l" +#line 412 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; @@ -2330,7 +2277,7 @@ YY_RULE_SETUP YY_BREAK case 172: YY_RULE_SETUP -#line 457 "program_lexer.l" +#line 418 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@ -2340,7 +2287,7 @@ YY_RULE_SETUP YY_BREAK case 173: YY_RULE_SETUP -#line 463 "program_lexer.l" +#line 424 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@ -2350,7 +2297,7 @@ YY_RULE_SETUP YY_BREAK case 174: YY_RULE_SETUP -#line 469 "program_lexer.l" +#line 430 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; @@ -2359,7 +2306,7 @@ YY_RULE_SETUP YY_BREAK case 175: YY_RULE_SETUP -#line 475 "program_lexer.l" +#line 436 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@ -2369,7 +2316,7 @@ YY_RULE_SETUP YY_BREAK case 176: YY_RULE_SETUP -#line 483 "program_lexer.l" +#line 444 "program_lexer.l" { if (require_ARB_vp) { return TEXGEN_R; @@ -2383,7 +2330,7 @@ YY_RULE_SETUP YY_BREAK case 177: YY_RULE_SETUP -#line 494 "program_lexer.l" +#line 455 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@ -2395,13 +2342,13 @@ YY_RULE_SETUP YY_BREAK case 178: YY_RULE_SETUP -#line 503 "program_lexer.l" +#line 464 "program_lexer.l" { return DOT; } YY_BREAK case 179: /* rule 179 can match eol */ YY_RULE_SETUP -#line 505 "program_lexer.l" +#line 466 "program_lexer.l" { yylloc->first_line++; yylloc->first_column = 1; @@ -2412,7 +2359,7 @@ YY_RULE_SETUP YY_BREAK case 180: YY_RULE_SETUP -#line 512 "program_lexer.l" +#line 473 "program_lexer.l" /* eat whitespace */ ; YY_BREAK case 181: @@ -2420,20 +2367,20 @@ case 181: yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 513 "program_lexer.l" +#line 474 "program_lexer.l" /* eat comments */ ; YY_BREAK case 182: YY_RULE_SETUP -#line 514 "program_lexer.l" +#line 475 "program_lexer.l" { return yytext[0]; } YY_BREAK case 183: YY_RULE_SETUP -#line 515 "program_lexer.l" +#line 476 "program_lexer.l" ECHO; YY_BREAK -#line 2437 "lex.yy.c" +#line 2384 "lex.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -3201,8 +3148,8 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner) /** Setup the input buffer state to scan the given bytes. The next call to yylex() will * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. + * @param bytes the byte buffer to scan + * @param len the number of bytes in the buffer pointed to by @a bytes. * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ @@ -3608,7 +3555,7 @@ void yyfree (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 515 "program_lexer.l" +#line 476 "program_lexer.l" diff --git a/src/mesa/shader/program_lexer.l b/src/mesa/shader/program_lexer.l index 6c4fad3037..c2803ff707 100644 --- a/src/mesa/shader/program_lexer.l +++ b/src/mesa/shader/program_lexer.l @@ -40,7 +40,7 @@ if (condition) { \ return token; \ } else { \ - yylval->string = return_string(yyextra, yytext); \ + yylval->string = strdup(yytext); \ return IDENTIFIER; \ } \ } while (0) @@ -63,7 +63,7 @@ yylval->temp_inst.SaturateMode = SATURATE_ ## sat; \ return token; \ } else { \ - yylval->string = return_string(yyextra, yytext); \ + yylval->string = strdup(yytext); \ return IDENTIFIER; \ } \ } while (0) @@ -71,45 +71,6 @@ #define SWIZZLE_INVAL MAKE_SWIZZLE4(SWIZZLE_NIL, SWIZZLE_NIL, \ SWIZZLE_NIL, SWIZZLE_NIL) -/** - * Send a string to the parser using asm_parser_state::string_dumpster - * - * Sends a string to the parser using asm_parser_state::string_dumpster as a - * temporary storage buffer. Data previously stored in - * asm_parser_state::string_dumpster will be lost. If - * asm_parser_state::string_dumpster is not large enough to hold the new - * string, the buffer size will be increased. The buffer size is \b never - * decreased. - * - * \param state Assembler parser state tracking - * \param str String to be passed to the parser - * - * \return - * A pointer to asm_parser_state::string_dumpster on success or \c NULL on - * failure. Currently the only failure case is \c ENOMEM. - */ -static char * -return_string(struct asm_parser_state *state, const char *str) -{ - const size_t len = strlen(str); - - if (len >= state->dumpster_size) { - char *const dumpster = _mesa_realloc(state->string_dumpster, - state->dumpster_size, - len + 1); - if (dumpster == NULL) { - return NULL; - } - - state->string_dumpster = dumpster; - state->dumpster_size = len + 1; - } - - memcpy(state->string_dumpster, str, len + 1); - return state->string_dumpster; -} - - static unsigned mask_from_char(char c) { @@ -347,7 +308,7 @@ ARRAYSHADOW1D { return_token_or_IDENTIFIER(require_ARB_fp && require ARRAYSHADOW2D { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW2D); } [_a-zA-Z$][_a-zA-Z0-9$]* { - yylval->string = return_string(yyextra, yytext); + yylval->string = strdup(yytext); return IDENTIFIER; } diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 261b605a2d..c255e912ed 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -4565,7 +4565,7 @@ yyreduce: "undefined variable binding in ALIAS statement"); YYERROR; } else { - _mesa_symbol_table_add_symbol(state->st, 0, strdup((yyvsp[(2) - (4)].string)), target); + _mesa_symbol_table_add_symbol(state->st, 0, (yyvsp[(2) - (4)].string), target); } ;} break; @@ -4896,14 +4896,10 @@ declare_variable(struct asm_parser_state *state, char *name, enum asm_type t, if (exist != NULL) { yyerror(locp, state, "redeclared identifier"); } else { - const size_t name_len = strlen(name); - - s = calloc(1, sizeof(struct asm_symbol) + name_len + 1); - s->name = (char *)(s + 1); + s = calloc(1, sizeof(struct asm_symbol)); + s->name = name; s->type = t; - memcpy((char *) s->name, name, name_len + 1); - switch (t) { case at_temp: if (state->prog->NumTemporaries >= state->limits->MaxTemps) { @@ -5151,11 +5147,6 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, _mesa_memcpy (strz, str, len); strz[len] = '\0'; - if (state->prog->String != NULL) { - _mesa_free(state->prog->String); - state->prog->String = NULL; - } - state->prog->String = strz; state->st = _mesa_symbol_table_ctor(); @@ -5245,6 +5236,7 @@ error: for (sym = state->sym; sym != NULL; sym = temp) { temp = sym->next; + _mesa_free((void *) sym->name); _mesa_free(sym); } state->sym = NULL; @@ -5252,11 +5244,6 @@ error: _mesa_symbol_table_dtor(state->st); state->st = NULL; - if (state->string_dumpster != NULL) { - _mesa_free(state->string_dumpster); - state->dumpster_size = 0; - } - return result; } diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index a23625d3fb..c3152aa2f8 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -1919,7 +1919,7 @@ ALIAS_statement: ALIAS IDENTIFIER '=' IDENTIFIER "undefined variable binding in ALIAS statement"); YYERROR; } else { - _mesa_symbol_table_add_symbol(state->st, 0, strdup($2), target); + _mesa_symbol_table_add_symbol(state->st, 0, $2, target); } } ; @@ -2027,14 +2027,10 @@ declare_variable(struct asm_parser_state *state, char *name, enum asm_type t, if (exist != NULL) { yyerror(locp, state, "redeclared identifier"); } else { - const size_t name_len = strlen(name); - - s = calloc(1, sizeof(struct asm_symbol) + name_len + 1); - s->name = (char *)(s + 1); + s = calloc(1, sizeof(struct asm_symbol)); + s->name = name; s->type = t; - memcpy((char *) s->name, name, name_len + 1); - switch (t) { case at_temp: if (state->prog->NumTemporaries >= state->limits->MaxTemps) { @@ -2284,7 +2280,6 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, if (state->prog->String != NULL) { _mesa_free(state->prog->String); - state->prog->String = NULL; } state->prog->String = strz; @@ -2376,6 +2371,7 @@ error: for (sym = state->sym; sym != NULL; sym = temp) { temp = sym->next; + _mesa_free((void *) sym->name); _mesa_free(sym); } state->sym = NULL; @@ -2383,10 +2379,5 @@ error: _mesa_symbol_table_dtor(state->st); state->st = NULL; - if (state->string_dumpster != NULL) { - _mesa_free(state->string_dumpster); - state->dumpster_size = 0; - } - return result; } diff --git a/src/mesa/shader/program_parser.h b/src/mesa/shader/program_parser.h index 8d8b4d89bc..fa47d84565 100644 --- a/src/mesa/shader/program_parser.h +++ b/src/mesa/shader/program_parser.h @@ -38,13 +38,6 @@ enum asm_type { at_output, }; -/** - * \note - * Objects of this type are allocated as the object plus the name of the - * symbol. That is, malloc(sizeof(struct asm_symbol) + strlen(name) + 1). - * Alternately, asm_symbol::name could be moved to the bottom of the structure - * and declared as 'char name[0];'. - */ struct asm_symbol { struct asm_symbol *next; /**< List linkage for freeing. */ const char *name; @@ -164,15 +157,6 @@ struct asm_parser_state { /*@}*/ - /** - * Buffer to hold strings transfered from the lexer to the parser - */ - /*@{*/ - char *string_dumpster; /**< String data transfered. */ - size_t dumpster_size; /**< Total size, in bytes, of the buffer. */ - /*@}*/ - - /** * Selected limits copied from gl_constants * -- cgit v1.2.3 From 301a9b7e28f7404b8f6d8c34649f0035b49a8249 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 5 Nov 2009 14:15:56 -0800 Subject: ARB prog parser: Release strings returned from the lexer that don't need to be kept --- src/mesa/shader/program_parse.y | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index c3152aa2f8..b2db2958be 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -291,6 +291,8 @@ option: OPTION IDENTIFIER ';' } + free($2); + if (!valid) { const char *const err_str = (state->mode == ARB_vertex) ? "invalid ARB vertex program option" @@ -591,12 +593,17 @@ extSwizSel: INTEGER } | IDENTIFIER { + char s; + if (strlen($1) > 1) { yyerror(& @1, state, "invalid extended swizzle selector"); YYERROR; } - switch ($1[0]) { + s = $1[0]; + free($1); + + switch (s) { case 'x': $$.swz = SWIZZLE_X; $$.xyzw_valid = 1; @@ -644,6 +651,8 @@ srcReg: IDENTIFIER /* temporaryReg | progParamSingle */ struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, $1); + free($1); + if (s == NULL) { yyerror(& @1, state, "invalid operand variable"); YYERROR; @@ -734,6 +743,8 @@ dstReg: resultBinding struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, $1); + free($1); + if (s == NULL) { yyerror(& @1, state, "invalid operand variable"); YYERROR; @@ -765,6 +776,8 @@ progParamArray: IDENTIFIER struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, $1); + free($1); + if (s == NULL) { yyerror(& @1, state, "invalid operand variable"); YYERROR; @@ -832,6 +845,8 @@ addrReg: IDENTIFIER struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, $1); + free($1); + if (s == NULL) { yyerror(& @1, state, "invalid array member"); YYERROR; @@ -894,6 +909,7 @@ ATTRIB_statement: ATTRIB IDENTIFIER '=' attribBinding declare_variable(state, $2, at_attrib, & @2); if (s == NULL) { + free($2); YYERROR; } else { s->attrib_binding = $4; @@ -1001,6 +1017,7 @@ PARAM_singleStmt: PARAM IDENTIFIER paramSingleInit declare_variable(state, $2, at_param, & @2); if (s == NULL) { + free($2); YYERROR; } else { s->param_binding_type = $3.param_binding_type; @@ -1014,6 +1031,7 @@ PARAM_singleStmt: PARAM IDENTIFIER paramSingleInit PARAM_multipleStmt: PARAM IDENTIFIER '[' optArraySize ']' paramMultipleInit { if (($4 != 0) && ((unsigned) $4 != $6.param_binding_length)) { + free($2); yyerror(& @4, state, "parameter array size and number of bindings must match"); YYERROR; @@ -1022,6 +1040,7 @@ PARAM_multipleStmt: PARAM IDENTIFIER '[' optArraySize ']' paramMultipleInit declare_variable(state, $2, $6.type, & @2); if (s == NULL) { + free($2); YYERROR; } else { s->param_binding_type = $6.param_binding_type; @@ -1717,12 +1736,14 @@ ADDRESS_statement: ADDRESS { $$ = $1; } varNameList varNameList: varNameList ',' IDENTIFIER { if (!declare_variable(state, $3, $0, & @3)) { + free($3); YYERROR; } } | IDENTIFIER { if (!declare_variable(state, $1, $0, & @1)) { + free($1); YYERROR; } } @@ -1734,6 +1755,7 @@ OUTPUT_statement: OUTPUT IDENTIFIER '=' resultBinding declare_variable(state, $2, at_output, & @2); if (s == NULL) { + free($2); YYERROR; } else { s->output_binding = $4; @@ -1911,10 +1933,14 @@ ALIAS_statement: ALIAS IDENTIFIER '=' IDENTIFIER _mesa_symbol_table_find_symbol(state->st, 0, $4); + free($4); + if (exist != NULL) { + free($2); yyerror(& @2, state, "redeclared identifier"); YYERROR; } else if (target == NULL) { + free($2); yyerror(& @4, state, "undefined variable binding in ALIAS statement"); YYERROR; -- cgit v1.2.3 From d8e256f9236d3e9dfd433c3a59718f0fdf1ca79a Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 5 Nov 2009 14:17:07 -0800 Subject: ARB prog parser: Release old program string in _mesa_parse_arb_{fragment,vertex}_program The program structure passed to _mesa_parse_arb_program is just a place holder. The stings that actually need to be released are only known to the functions calling _mesa_parse_arb_program, so they should be freed there. --- src/mesa/shader/arbprogparse.c | 6 ++++++ src/mesa/shader/program_parse.y | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index 05ee4f563e..dd732b6666 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -87,6 +87,9 @@ _mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target, return; } + if (program->Base.String != NULL) + _mesa_free(program->Base.String); + /* Copy the relevant contents of the arb_program struct into the * fragment_program struct. */ @@ -178,6 +181,9 @@ _mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target, return; } + if (program->Base.String != NULL) + _mesa_free(program->Base.String); + /* Copy the relevant contents of the arb_program struct into the * vertex_program struct. */ diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index b2db2958be..aad5eeb7da 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -2304,10 +2304,6 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, _mesa_memcpy (strz, str, len); strz[len] = '\0'; - if (state->prog->String != NULL) { - _mesa_free(state->prog->String); - } - state->prog->String = strz; state->st = _mesa_symbol_table_ctor(); -- cgit v1.2.3 From 9348ac03ce23392013ba22c22a182eea4453027a Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 5 Nov 2009 14:20:16 -0800 Subject: ARB prog parser: Regenerate parser from previous commits. --- src/mesa/shader/program_parse.tab.c | 510 +++++++++++++++++++----------------- 1 file changed, 268 insertions(+), 242 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index c255e912ed..b7bac7e5a3 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -763,33 +763,33 @@ static const yytype_int16 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 256, 256, 259, 267, 279, 280, 283, 305, 306, - 309, 324, 327, 332, 339, 340, 341, 342, 343, 344, - 345, 348, 349, 352, 358, 365, 372, 380, 387, 395, - 440, 447, 453, 454, 455, 456, 457, 458, 459, 460, - 461, 462, 463, 464, 467, 480, 493, 506, 528, 537, - 570, 577, 592, 642, 684, 695, 716, 726, 732, 763, - 780, 780, 782, 789, 801, 802, 803, 806, 818, 830, - 848, 859, 871, 873, 874, 875, 876, 879, 879, 879, - 879, 880, 883, 884, 885, 886, 887, 888, 891, 909, - 913, 919, 923, 927, 931, 940, 949, 953, 958, 964, - 975, 975, 976, 978, 982, 986, 990, 996, 996, 998, - 1014, 1037, 1040, 1051, 1057, 1063, 1064, 1071, 1077, 1083, - 1091, 1097, 1103, 1111, 1117, 1123, 1131, 1132, 1135, 1136, - 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1148, - 1157, 1161, 1165, 1171, 1180, 1184, 1188, 1197, 1201, 1207, - 1213, 1220, 1225, 1233, 1243, 1245, 1253, 1259, 1263, 1267, - 1273, 1284, 1293, 1297, 1302, 1306, 1310, 1314, 1320, 1327, - 1331, 1337, 1345, 1356, 1363, 1367, 1373, 1383, 1394, 1398, - 1416, 1425, 1428, 1434, 1438, 1442, 1448, 1459, 1464, 1469, - 1474, 1479, 1484, 1492, 1495, 1500, 1513, 1521, 1532, 1540, - 1540, 1542, 1542, 1544, 1554, 1559, 1566, 1576, 1585, 1590, - 1597, 1607, 1617, 1629, 1629, 1630, 1630, 1632, 1642, 1650, - 1660, 1668, 1676, 1685, 1696, 1700, 1706, 1707, 1708, 1711, - 1711, 1714, 1714, 1717, 1723, 1731, 1744, 1753, 1762, 1766, - 1775, 1784, 1795, 1802, 1807, 1816, 1828, 1831, 1840, 1851, - 1852, 1853, 1856, 1857, 1858, 1861, 1862, 1865, 1866, 1869, - 1870, 1873, 1884, 1895, 1906 + 0, 256, 256, 259, 267, 279, 280, 283, 307, 308, + 311, 326, 329, 334, 341, 342, 343, 344, 345, 346, + 347, 350, 351, 354, 360, 367, 374, 382, 389, 397, + 442, 449, 455, 456, 457, 458, 459, 460, 461, 462, + 463, 464, 465, 466, 469, 482, 495, 508, 530, 539, + 572, 579, 594, 649, 693, 704, 725, 735, 741, 774, + 793, 793, 795, 802, 814, 815, 816, 819, 831, 843, + 863, 874, 886, 888, 889, 890, 891, 894, 894, 894, + 894, 895, 898, 899, 900, 901, 902, 903, 906, 925, + 929, 935, 939, 943, 947, 956, 965, 969, 974, 980, + 991, 991, 992, 994, 998, 1002, 1006, 1012, 1012, 1014, + 1031, 1056, 1059, 1070, 1076, 1082, 1083, 1090, 1096, 1102, + 1110, 1116, 1122, 1130, 1136, 1142, 1150, 1151, 1154, 1155, + 1156, 1157, 1158, 1159, 1160, 1161, 1162, 1163, 1164, 1167, + 1176, 1180, 1184, 1190, 1199, 1203, 1207, 1216, 1220, 1226, + 1232, 1239, 1244, 1252, 1262, 1264, 1272, 1278, 1282, 1286, + 1292, 1303, 1312, 1316, 1321, 1325, 1329, 1333, 1339, 1346, + 1350, 1356, 1364, 1375, 1382, 1386, 1392, 1402, 1413, 1417, + 1435, 1444, 1447, 1453, 1457, 1461, 1467, 1478, 1483, 1488, + 1493, 1498, 1503, 1511, 1514, 1519, 1532, 1540, 1551, 1559, + 1559, 1561, 1561, 1563, 1573, 1578, 1585, 1595, 1604, 1609, + 1616, 1626, 1636, 1648, 1648, 1649, 1649, 1651, 1661, 1669, + 1679, 1687, 1695, 1704, 1715, 1719, 1725, 1726, 1727, 1730, + 1730, 1733, 1733, 1736, 1743, 1752, 1766, 1775, 1784, 1788, + 1797, 1806, 1817, 1824, 1829, 1838, 1850, 1853, 1862, 1873, + 1874, 1875, 1878, 1879, 1880, 1883, 1884, 1887, 1888, 1891, + 1892, 1895, 1906, 1917, 1928 }; #endif @@ -2107,6 +2107,8 @@ yyreduce: } + free((yyvsp[(2) - (3)].string)); + if (!valid) { const char *const err_str = (state->mode == ARB_vertex) ? "invalid ARB vertex program option" @@ -2121,7 +2123,7 @@ yyreduce: case 10: /* Line 1455 of yacc.c */ -#line 310 "program_parse.y" +#line 312 "program_parse.y" { if ((yyvsp[(1) - (2)].inst) != NULL) { if (state->inst_tail == NULL) { @@ -2141,7 +2143,7 @@ yyreduce: case 12: /* Line 1455 of yacc.c */ -#line 328 "program_parse.y" +#line 330 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumAluInstructions++; @@ -2151,7 +2153,7 @@ yyreduce: case 13: /* Line 1455 of yacc.c */ -#line 333 "program_parse.y" +#line 335 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumTexInstructions++; @@ -2161,7 +2163,7 @@ yyreduce: case 23: /* Line 1455 of yacc.c */ -#line 353 "program_parse.y" +#line 355 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_ARL, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} @@ -2170,7 +2172,7 @@ yyreduce: case 24: /* Line 1455 of yacc.c */ -#line 359 "program_parse.y" +#line 361 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (4)].temp_inst).Opcode, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (4)].temp_inst).SaturateMode; @@ -2180,7 +2182,7 @@ yyreduce: case 25: /* Line 1455 of yacc.c */ -#line 366 "program_parse.y" +#line 368 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (4)].temp_inst).Opcode, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (4)].temp_inst).SaturateMode; @@ -2190,7 +2192,7 @@ yyreduce: case 26: /* Line 1455 of yacc.c */ -#line 373 "program_parse.y" +#line 375 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (6)].temp_inst).Opcode, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; @@ -2200,7 +2202,7 @@ yyreduce: case 27: /* Line 1455 of yacc.c */ -#line 381 "program_parse.y" +#line 383 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (6)].temp_inst).Opcode, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; @@ -2210,7 +2212,7 @@ yyreduce: case 28: /* Line 1455 of yacc.c */ -#line 389 "program_parse.y" +#line 391 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (8)].temp_inst).Opcode, & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), & (yyvsp[(6) - (8)].src_reg), & (yyvsp[(8) - (8)].src_reg)); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (8)].temp_inst).SaturateMode; @@ -2220,7 +2222,7 @@ yyreduce: case 29: /* Line 1455 of yacc.c */ -#line 396 "program_parse.y" +#line 398 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (8)].temp_inst).Opcode, & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), NULL, NULL); if ((yyval.inst) != NULL) { @@ -2268,7 +2270,7 @@ yyreduce: case 30: /* Line 1455 of yacc.c */ -#line 441 "program_parse.y" +#line 443 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_KIL, NULL, & (yyvsp[(2) - (2)].src_reg), NULL, NULL); state->fragment.UsesKill = 1; @@ -2278,7 +2280,7 @@ yyreduce: case 31: /* Line 1455 of yacc.c */ -#line 448 "program_parse.y" +#line 450 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} @@ -2287,91 +2289,91 @@ yyreduce: case 32: /* Line 1455 of yacc.c */ -#line 453 "program_parse.y" +#line 455 "program_parse.y" { (yyval.integer) = TEXTURE_1D_INDEX; ;} break; case 33: /* Line 1455 of yacc.c */ -#line 454 "program_parse.y" +#line 456 "program_parse.y" { (yyval.integer) = TEXTURE_2D_INDEX; ;} break; case 34: /* Line 1455 of yacc.c */ -#line 455 "program_parse.y" +#line 457 "program_parse.y" { (yyval.integer) = TEXTURE_3D_INDEX; ;} break; case 35: /* Line 1455 of yacc.c */ -#line 456 "program_parse.y" +#line 458 "program_parse.y" { (yyval.integer) = TEXTURE_CUBE_INDEX; ;} break; case 36: /* Line 1455 of yacc.c */ -#line 457 "program_parse.y" +#line 459 "program_parse.y" { (yyval.integer) = TEXTURE_RECT_INDEX; ;} break; case 37: /* Line 1455 of yacc.c */ -#line 458 "program_parse.y" +#line 460 "program_parse.y" { (yyval.integer) = -TEXTURE_1D_INDEX; ;} break; case 38: /* Line 1455 of yacc.c */ -#line 459 "program_parse.y" +#line 461 "program_parse.y" { (yyval.integer) = -TEXTURE_2D_INDEX; ;} break; case 39: /* Line 1455 of yacc.c */ -#line 460 "program_parse.y" +#line 462 "program_parse.y" { (yyval.integer) = -TEXTURE_RECT_INDEX; ;} break; case 40: /* Line 1455 of yacc.c */ -#line 461 "program_parse.y" +#line 463 "program_parse.y" { (yyval.integer) = TEXTURE_1D_ARRAY_INDEX; ;} break; case 41: /* Line 1455 of yacc.c */ -#line 462 "program_parse.y" +#line 464 "program_parse.y" { (yyval.integer) = TEXTURE_2D_ARRAY_INDEX; ;} break; case 42: /* Line 1455 of yacc.c */ -#line 463 "program_parse.y" +#line 465 "program_parse.y" { (yyval.integer) = -TEXTURE_1D_ARRAY_INDEX; ;} break; case 43: /* Line 1455 of yacc.c */ -#line 464 "program_parse.y" +#line 466 "program_parse.y" { (yyval.integer) = -TEXTURE_2D_ARRAY_INDEX; ;} break; case 44: /* Line 1455 of yacc.c */ -#line 468 "program_parse.y" +#line 470 "program_parse.y" { /* FIXME: Is this correct? Should the extenedSwizzle be applied * FIXME: to the existing swizzle? @@ -2387,7 +2389,7 @@ yyreduce: case 45: /* Line 1455 of yacc.c */ -#line 481 "program_parse.y" +#line 483 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); @@ -2403,7 +2405,7 @@ yyreduce: case 46: /* Line 1455 of yacc.c */ -#line 494 "program_parse.y" +#line 496 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); @@ -2419,7 +2421,7 @@ yyreduce: case 47: /* Line 1455 of yacc.c */ -#line 507 "program_parse.y" +#line 509 "program_parse.y" { (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); (yyval.dst_reg).WriteMask = (yyvsp[(2) - (2)].swiz_mask).mask; @@ -2444,7 +2446,7 @@ yyreduce: case 48: /* Line 1455 of yacc.c */ -#line 529 "program_parse.y" +#line 531 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_ADDRESS; @@ -2456,7 +2458,7 @@ yyreduce: case 49: /* Line 1455 of yacc.c */ -#line 538 "program_parse.y" +#line 540 "program_parse.y" { const unsigned xyzw_valid = ((yyvsp[(1) - (7)].ext_swizzle).xyzw_valid << 0) @@ -2492,7 +2494,7 @@ yyreduce: case 50: /* Line 1455 of yacc.c */ -#line 571 "program_parse.y" +#line 573 "program_parse.y" { (yyval.ext_swizzle) = (yyvsp[(2) - (2)].ext_swizzle); (yyval.ext_swizzle).negate = ((yyvsp[(1) - (2)].negate)) ? 1 : 0; @@ -2502,7 +2504,7 @@ yyreduce: case 51: /* Line 1455 of yacc.c */ -#line 578 "program_parse.y" +#line 580 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) != 0) && ((yyvsp[(1) - (1)].integer) != 1)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2522,14 +2524,19 @@ yyreduce: case 52: /* Line 1455 of yacc.c */ -#line 593 "program_parse.y" +#line 595 "program_parse.y" { + char s; + if (strlen((yyvsp[(1) - (1)].string)) > 1) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); YYERROR; } - switch ((yyvsp[(1) - (1)].string)[0]) { + s = (yyvsp[(1) - (1)].string)[0]; + free((yyvsp[(1) - (1)].string)); + + switch (s) { case 'x': (yyval.ext_swizzle).swz = SWIZZLE_X; (yyval.ext_swizzle).xyzw_valid = 1; @@ -2575,11 +2582,13 @@ yyreduce: case 53: /* Line 1455 of yacc.c */ -#line 643 "program_parse.y" +#line 650 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); + free((yyvsp[(1) - (1)].string)); + if (s == NULL) { yyerror(& (yylsp[(1) - (1)]), state, "invalid operand variable"); YYERROR; @@ -2622,7 +2631,7 @@ yyreduce: case 54: /* Line 1455 of yacc.c */ -#line 685 "program_parse.y" +#line 694 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = PROGRAM_INPUT; @@ -2638,7 +2647,7 @@ yyreduce: case 55: /* Line 1455 of yacc.c */ -#line 696 "program_parse.y" +#line 705 "program_parse.y" { if (! (yyvsp[(3) - (4)].src_reg).Base.RelAddr && ((unsigned) (yyvsp[(3) - (4)].src_reg).Base.Index >= (yyvsp[(1) - (4)].sym)->param_binding_length)) { @@ -2664,7 +2673,7 @@ yyreduce: case 56: /* Line 1455 of yacc.c */ -#line 717 "program_parse.y" +#line 726 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = ((yyvsp[(1) - (1)].temp_sym).name != NULL) @@ -2677,7 +2686,7 @@ yyreduce: case 57: /* Line 1455 of yacc.c */ -#line 727 "program_parse.y" +#line 736 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_OUTPUT; @@ -2688,11 +2697,13 @@ yyreduce: case 58: /* Line 1455 of yacc.c */ -#line 733 "program_parse.y" +#line 742 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); + free((yyvsp[(1) - (1)].string)); + if (s == NULL) { yyerror(& (yylsp[(1) - (1)]), state, "invalid operand variable"); YYERROR; @@ -2722,11 +2733,13 @@ yyreduce: case 59: /* Line 1455 of yacc.c */ -#line 764 "program_parse.y" +#line 775 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); + free((yyvsp[(1) - (1)].string)); + if (s == NULL) { yyerror(& (yylsp[(1) - (1)]), state, "invalid operand variable"); YYERROR; @@ -2742,7 +2755,7 @@ yyreduce: case 62: /* Line 1455 of yacc.c */ -#line 783 "program_parse.y" +#line 796 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].integer); @@ -2752,7 +2765,7 @@ yyreduce: case 63: /* Line 1455 of yacc.c */ -#line 790 "program_parse.y" +#line 803 "program_parse.y" { /* FINISHME: Add support for multiple address registers. */ @@ -2767,28 +2780,28 @@ yyreduce: case 64: /* Line 1455 of yacc.c */ -#line 801 "program_parse.y" +#line 814 "program_parse.y" { (yyval.integer) = 0; ;} break; case 65: /* Line 1455 of yacc.c */ -#line 802 "program_parse.y" +#line 815 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; case 66: /* Line 1455 of yacc.c */ -#line 803 "program_parse.y" +#line 816 "program_parse.y" { (yyval.integer) = -(yyvsp[(2) - (2)].integer); ;} break; case 67: /* Line 1455 of yacc.c */ -#line 807 "program_parse.y" +#line 820 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 63)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2803,7 +2816,7 @@ yyreduce: case 68: /* Line 1455 of yacc.c */ -#line 819 "program_parse.y" +#line 832 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 64)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2818,11 +2831,13 @@ yyreduce: case 69: /* Line 1455 of yacc.c */ -#line 831 "program_parse.y" +#line 844 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); + free((yyvsp[(1) - (1)].string)); + if (s == NULL) { yyerror(& (yylsp[(1) - (1)]), state, "invalid array member"); YYERROR; @@ -2839,7 +2854,7 @@ yyreduce: case 70: /* Line 1455 of yacc.c */ -#line 849 "program_parse.y" +#line 864 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, "invalid address component selector"); @@ -2853,7 +2868,7 @@ yyreduce: case 71: /* Line 1455 of yacc.c */ -#line 860 "program_parse.y" +#line 875 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2868,26 +2883,27 @@ yyreduce: case 76: /* Line 1455 of yacc.c */ -#line 876 "program_parse.y" +#line 891 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 81: /* Line 1455 of yacc.c */ -#line 880 "program_parse.y" +#line 895 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 88: /* Line 1455 of yacc.c */ -#line 892 "program_parse.y" +#line 907 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_attrib, & (yylsp[(2) - (4)])); if (s == NULL) { + free((yyvsp[(2) - (4)].string)); YYERROR; } else { s->attrib_binding = (yyvsp[(4) - (4)].attrib); @@ -2903,7 +2919,7 @@ yyreduce: case 89: /* Line 1455 of yacc.c */ -#line 910 "program_parse.y" +#line 926 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} @@ -2912,7 +2928,7 @@ yyreduce: case 90: /* Line 1455 of yacc.c */ -#line 914 "program_parse.y" +#line 930 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} @@ -2921,7 +2937,7 @@ yyreduce: case 91: /* Line 1455 of yacc.c */ -#line 920 "program_parse.y" +#line 936 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_POS; ;} @@ -2930,7 +2946,7 @@ yyreduce: case 92: /* Line 1455 of yacc.c */ -#line 924 "program_parse.y" +#line 940 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_WEIGHT; ;} @@ -2939,7 +2955,7 @@ yyreduce: case 93: /* Line 1455 of yacc.c */ -#line 928 "program_parse.y" +#line 944 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_NORMAL; ;} @@ -2948,7 +2964,7 @@ yyreduce: case 94: /* Line 1455 of yacc.c */ -#line 932 "program_parse.y" +#line 948 "program_parse.y" { if (!state->ctx->Extensions.EXT_secondary_color) { yyerror(& (yylsp[(2) - (2)]), state, "GL_EXT_secondary_color not supported"); @@ -2962,7 +2978,7 @@ yyreduce: case 95: /* Line 1455 of yacc.c */ -#line 941 "program_parse.y" +#line 957 "program_parse.y" { if (!state->ctx->Extensions.EXT_fog_coord) { yyerror(& (yylsp[(1) - (1)]), state, "GL_EXT_fog_coord not supported"); @@ -2976,7 +2992,7 @@ yyreduce: case 96: /* Line 1455 of yacc.c */ -#line 950 "program_parse.y" +#line 966 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} @@ -2985,7 +3001,7 @@ yyreduce: case 97: /* Line 1455 of yacc.c */ -#line 954 "program_parse.y" +#line 970 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; @@ -2995,7 +3011,7 @@ yyreduce: case 98: /* Line 1455 of yacc.c */ -#line 959 "program_parse.y" +#line 975 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_GENERIC0 + (yyvsp[(3) - (4)].integer); ;} @@ -3004,7 +3020,7 @@ yyreduce: case 99: /* Line 1455 of yacc.c */ -#line 965 "program_parse.y" +#line 981 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxAttribs) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex attribute reference"); @@ -3018,7 +3034,7 @@ yyreduce: case 103: /* Line 1455 of yacc.c */ -#line 979 "program_parse.y" +#line 995 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_WPOS; ;} @@ -3027,7 +3043,7 @@ yyreduce: case 104: /* Line 1455 of yacc.c */ -#line 983 "program_parse.y" +#line 999 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_COL0 + (yyvsp[(2) - (2)].integer); ;} @@ -3036,7 +3052,7 @@ yyreduce: case 105: /* Line 1455 of yacc.c */ -#line 987 "program_parse.y" +#line 1003 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_FOGC; ;} @@ -3045,7 +3061,7 @@ yyreduce: case 106: /* Line 1455 of yacc.c */ -#line 991 "program_parse.y" +#line 1007 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} @@ -3054,12 +3070,13 @@ yyreduce: case 109: /* Line 1455 of yacc.c */ -#line 999 "program_parse.y" +#line 1015 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (3)].string), at_param, & (yylsp[(2) - (3)])); if (s == NULL) { + free((yyvsp[(2) - (3)].string)); YYERROR; } else { s->param_binding_type = (yyvsp[(3) - (3)].temp_sym).param_binding_type; @@ -3073,9 +3090,10 @@ yyreduce: case 110: /* Line 1455 of yacc.c */ -#line 1015 "program_parse.y" +#line 1032 "program_parse.y" { if (((yyvsp[(4) - (6)].integer) != 0) && ((unsigned) (yyvsp[(4) - (6)].integer) != (yyvsp[(6) - (6)].temp_sym).param_binding_length)) { + free((yyvsp[(2) - (6)].string)); yyerror(& (yylsp[(4) - (6)]), state, "parameter array size and number of bindings must match"); YYERROR; @@ -3084,6 +3102,7 @@ yyreduce: declare_variable(state, (yyvsp[(2) - (6)].string), (yyvsp[(6) - (6)].temp_sym).type, & (yylsp[(2) - (6)])); if (s == NULL) { + free((yyvsp[(2) - (6)].string)); YYERROR; } else { s->param_binding_type = (yyvsp[(6) - (6)].temp_sym).param_binding_type; @@ -3098,7 +3117,7 @@ yyreduce: case 111: /* Line 1455 of yacc.c */ -#line 1037 "program_parse.y" +#line 1056 "program_parse.y" { (yyval.integer) = 0; ;} @@ -3107,7 +3126,7 @@ yyreduce: case 112: /* Line 1455 of yacc.c */ -#line 1041 "program_parse.y" +#line 1060 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 1) || ((unsigned) (yyvsp[(1) - (1)].integer) > state->limits->MaxParameters)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid parameter array size"); @@ -3121,7 +3140,7 @@ yyreduce: case 113: /* Line 1455 of yacc.c */ -#line 1052 "program_parse.y" +#line 1071 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(2) - (2)].temp_sym); ;} @@ -3130,7 +3149,7 @@ yyreduce: case 114: /* Line 1455 of yacc.c */ -#line 1058 "program_parse.y" +#line 1077 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(3) - (4)].temp_sym); ;} @@ -3139,7 +3158,7 @@ yyreduce: case 116: /* Line 1455 of yacc.c */ -#line 1065 "program_parse.y" +#line 1084 "program_parse.y" { (yyvsp[(1) - (3)].temp_sym).param_binding_length += (yyvsp[(3) - (3)].temp_sym).param_binding_length; (yyval.temp_sym) = (yyvsp[(1) - (3)].temp_sym); @@ -3149,7 +3168,7 @@ yyreduce: case 117: /* Line 1455 of yacc.c */ -#line 1072 "program_parse.y" +#line 1091 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3160,7 +3179,7 @@ yyreduce: case 118: /* Line 1455 of yacc.c */ -#line 1078 "program_parse.y" +#line 1097 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3171,7 +3190,7 @@ yyreduce: case 119: /* Line 1455 of yacc.c */ -#line 1084 "program_parse.y" +#line 1103 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3182,7 +3201,7 @@ yyreduce: case 120: /* Line 1455 of yacc.c */ -#line 1092 "program_parse.y" +#line 1111 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3193,7 +3212,7 @@ yyreduce: case 121: /* Line 1455 of yacc.c */ -#line 1098 "program_parse.y" +#line 1117 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3204,7 +3223,7 @@ yyreduce: case 122: /* Line 1455 of yacc.c */ -#line 1104 "program_parse.y" +#line 1123 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3215,7 +3234,7 @@ yyreduce: case 123: /* Line 1455 of yacc.c */ -#line 1112 "program_parse.y" +#line 1131 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3226,7 +3245,7 @@ yyreduce: case 124: /* Line 1455 of yacc.c */ -#line 1118 "program_parse.y" +#line 1137 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3237,7 +3256,7 @@ yyreduce: case 125: /* Line 1455 of yacc.c */ -#line 1124 "program_parse.y" +#line 1143 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3248,98 +3267,98 @@ yyreduce: case 126: /* Line 1455 of yacc.c */ -#line 1131 "program_parse.y" +#line 1150 "program_parse.y" { memcpy((yyval.state), (yyvsp[(1) - (1)].state), sizeof((yyval.state))); ;} break; case 127: /* Line 1455 of yacc.c */ -#line 1132 "program_parse.y" +#line 1151 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 128: /* Line 1455 of yacc.c */ -#line 1135 "program_parse.y" +#line 1154 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 129: /* Line 1455 of yacc.c */ -#line 1136 "program_parse.y" +#line 1155 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 130: /* Line 1455 of yacc.c */ -#line 1137 "program_parse.y" +#line 1156 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 131: /* Line 1455 of yacc.c */ -#line 1138 "program_parse.y" +#line 1157 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 132: /* Line 1455 of yacc.c */ -#line 1139 "program_parse.y" +#line 1158 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 133: /* Line 1455 of yacc.c */ -#line 1140 "program_parse.y" +#line 1159 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 134: /* Line 1455 of yacc.c */ -#line 1141 "program_parse.y" +#line 1160 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 135: /* Line 1455 of yacc.c */ -#line 1142 "program_parse.y" +#line 1161 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 136: /* Line 1455 of yacc.c */ -#line 1143 "program_parse.y" +#line 1162 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 137: /* Line 1455 of yacc.c */ -#line 1144 "program_parse.y" +#line 1163 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 138: /* Line 1455 of yacc.c */ -#line 1145 "program_parse.y" +#line 1164 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 139: /* Line 1455 of yacc.c */ -#line 1149 "program_parse.y" +#line 1168 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_MATERIAL; @@ -3351,7 +3370,7 @@ yyreduce: case 140: /* Line 1455 of yacc.c */ -#line 1158 "program_parse.y" +#line 1177 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3360,7 +3379,7 @@ yyreduce: case 141: /* Line 1455 of yacc.c */ -#line 1162 "program_parse.y" +#line 1181 "program_parse.y" { (yyval.integer) = STATE_EMISSION; ;} @@ -3369,7 +3388,7 @@ yyreduce: case 142: /* Line 1455 of yacc.c */ -#line 1166 "program_parse.y" +#line 1185 "program_parse.y" { (yyval.integer) = STATE_SHININESS; ;} @@ -3378,7 +3397,7 @@ yyreduce: case 143: /* Line 1455 of yacc.c */ -#line 1172 "program_parse.y" +#line 1191 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHT; @@ -3390,7 +3409,7 @@ yyreduce: case 144: /* Line 1455 of yacc.c */ -#line 1181 "program_parse.y" +#line 1200 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3399,7 +3418,7 @@ yyreduce: case 145: /* Line 1455 of yacc.c */ -#line 1185 "program_parse.y" +#line 1204 "program_parse.y" { (yyval.integer) = STATE_POSITION; ;} @@ -3408,7 +3427,7 @@ yyreduce: case 146: /* Line 1455 of yacc.c */ -#line 1189 "program_parse.y" +#line 1208 "program_parse.y" { if (!state->ctx->Extensions.EXT_point_parameters) { yyerror(& (yylsp[(1) - (1)]), state, "GL_ARB_point_parameters not supported"); @@ -3422,7 +3441,7 @@ yyreduce: case 147: /* Line 1455 of yacc.c */ -#line 1198 "program_parse.y" +#line 1217 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} @@ -3431,7 +3450,7 @@ yyreduce: case 148: /* Line 1455 of yacc.c */ -#line 1202 "program_parse.y" +#line 1221 "program_parse.y" { (yyval.integer) = STATE_HALF_VECTOR; ;} @@ -3440,7 +3459,7 @@ yyreduce: case 149: /* Line 1455 of yacc.c */ -#line 1208 "program_parse.y" +#line 1227 "program_parse.y" { (yyval.integer) = STATE_SPOT_DIRECTION; ;} @@ -3449,7 +3468,7 @@ yyreduce: case 150: /* Line 1455 of yacc.c */ -#line 1214 "program_parse.y" +#line 1233 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (2)].state)[1]; @@ -3459,7 +3478,7 @@ yyreduce: case 151: /* Line 1455 of yacc.c */ -#line 1221 "program_parse.y" +#line 1240 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_AMBIENT; @@ -3469,7 +3488,7 @@ yyreduce: case 152: /* Line 1455 of yacc.c */ -#line 1226 "program_parse.y" +#line 1245 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_SCENECOLOR; @@ -3480,7 +3499,7 @@ yyreduce: case 153: /* Line 1455 of yacc.c */ -#line 1234 "program_parse.y" +#line 1253 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTPROD; @@ -3493,7 +3512,7 @@ yyreduce: case 155: /* Line 1455 of yacc.c */ -#line 1246 "program_parse.y" +#line 1265 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(3) - (3)].integer); @@ -3504,7 +3523,7 @@ yyreduce: case 156: /* Line 1455 of yacc.c */ -#line 1254 "program_parse.y" +#line 1273 "program_parse.y" { (yyval.integer) = STATE_TEXENV_COLOR; ;} @@ -3513,7 +3532,7 @@ yyreduce: case 157: /* Line 1455 of yacc.c */ -#line 1260 "program_parse.y" +#line 1279 "program_parse.y" { (yyval.integer) = STATE_AMBIENT; ;} @@ -3522,7 +3541,7 @@ yyreduce: case 158: /* Line 1455 of yacc.c */ -#line 1264 "program_parse.y" +#line 1283 "program_parse.y" { (yyval.integer) = STATE_DIFFUSE; ;} @@ -3531,7 +3550,7 @@ yyreduce: case 159: /* Line 1455 of yacc.c */ -#line 1268 "program_parse.y" +#line 1287 "program_parse.y" { (yyval.integer) = STATE_SPECULAR; ;} @@ -3540,7 +3559,7 @@ yyreduce: case 160: /* Line 1455 of yacc.c */ -#line 1274 "program_parse.y" +#line 1293 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxLights) { yyerror(& (yylsp[(1) - (1)]), state, "invalid light selector"); @@ -3554,7 +3573,7 @@ yyreduce: case 161: /* Line 1455 of yacc.c */ -#line 1285 "program_parse.y" +#line 1304 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_TEXGEN; @@ -3566,7 +3585,7 @@ yyreduce: case 162: /* Line 1455 of yacc.c */ -#line 1294 "program_parse.y" +#line 1313 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S; ;} @@ -3575,7 +3594,7 @@ yyreduce: case 163: /* Line 1455 of yacc.c */ -#line 1298 "program_parse.y" +#line 1317 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_OBJECT_S; ;} @@ -3584,7 +3603,7 @@ yyreduce: case 164: /* Line 1455 of yacc.c */ -#line 1303 "program_parse.y" +#line 1322 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S; ;} @@ -3593,7 +3612,7 @@ yyreduce: case 165: /* Line 1455 of yacc.c */ -#line 1307 "program_parse.y" +#line 1326 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S; ;} @@ -3602,7 +3621,7 @@ yyreduce: case 166: /* Line 1455 of yacc.c */ -#line 1311 "program_parse.y" +#line 1330 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S; ;} @@ -3611,7 +3630,7 @@ yyreduce: case 167: /* Line 1455 of yacc.c */ -#line 1315 "program_parse.y" +#line 1334 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S; ;} @@ -3620,7 +3639,7 @@ yyreduce: case 168: /* Line 1455 of yacc.c */ -#line 1321 "program_parse.y" +#line 1340 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); @@ -3630,7 +3649,7 @@ yyreduce: case 169: /* Line 1455 of yacc.c */ -#line 1328 "program_parse.y" +#line 1347 "program_parse.y" { (yyval.integer) = STATE_FOG_COLOR; ;} @@ -3639,7 +3658,7 @@ yyreduce: case 170: /* Line 1455 of yacc.c */ -#line 1332 "program_parse.y" +#line 1351 "program_parse.y" { (yyval.integer) = STATE_FOG_PARAMS; ;} @@ -3648,7 +3667,7 @@ yyreduce: case 171: /* Line 1455 of yacc.c */ -#line 1338 "program_parse.y" +#line 1357 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_CLIPPLANE; @@ -3659,7 +3678,7 @@ yyreduce: case 172: /* Line 1455 of yacc.c */ -#line 1346 "program_parse.y" +#line 1365 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxClipPlanes) { yyerror(& (yylsp[(1) - (1)]), state, "invalid clip plane selector"); @@ -3673,7 +3692,7 @@ yyreduce: case 173: /* Line 1455 of yacc.c */ -#line 1357 "program_parse.y" +#line 1376 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); @@ -3683,7 +3702,7 @@ yyreduce: case 174: /* Line 1455 of yacc.c */ -#line 1364 "program_parse.y" +#line 1383 "program_parse.y" { (yyval.integer) = STATE_POINT_SIZE; ;} @@ -3692,7 +3711,7 @@ yyreduce: case 175: /* Line 1455 of yacc.c */ -#line 1368 "program_parse.y" +#line 1387 "program_parse.y" { (yyval.integer) = STATE_POINT_ATTENUATION; ;} @@ -3701,7 +3720,7 @@ yyreduce: case 176: /* Line 1455 of yacc.c */ -#line 1374 "program_parse.y" +#line 1393 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (5)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (5)].state)[1]; @@ -3714,7 +3733,7 @@ yyreduce: case 177: /* Line 1455 of yacc.c */ -#line 1384 "program_parse.y" +#line 1403 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (2)].state)[1]; @@ -3727,7 +3746,7 @@ yyreduce: case 178: /* Line 1455 of yacc.c */ -#line 1394 "program_parse.y" +#line 1413 "program_parse.y" { (yyval.state)[2] = 0; (yyval.state)[3] = 3; @@ -3737,7 +3756,7 @@ yyreduce: case 179: /* Line 1455 of yacc.c */ -#line 1399 "program_parse.y" +#line 1418 "program_parse.y" { /* It seems logical that the matrix row range specifier would have * to specify a range or more than one row (i.e., $5 > $3). @@ -3758,7 +3777,7 @@ yyreduce: case 180: /* Line 1455 of yacc.c */ -#line 1417 "program_parse.y" +#line 1436 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (3)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (3)].state)[1]; @@ -3769,7 +3788,7 @@ yyreduce: case 181: /* Line 1455 of yacc.c */ -#line 1425 "program_parse.y" +#line 1444 "program_parse.y" { (yyval.integer) = 0; ;} @@ -3778,7 +3797,7 @@ yyreduce: case 182: /* Line 1455 of yacc.c */ -#line 1429 "program_parse.y" +#line 1448 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3787,7 +3806,7 @@ yyreduce: case 183: /* Line 1455 of yacc.c */ -#line 1435 "program_parse.y" +#line 1454 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVERSE; ;} @@ -3796,7 +3815,7 @@ yyreduce: case 184: /* Line 1455 of yacc.c */ -#line 1439 "program_parse.y" +#line 1458 "program_parse.y" { (yyval.integer) = STATE_MATRIX_TRANSPOSE; ;} @@ -3805,7 +3824,7 @@ yyreduce: case 185: /* Line 1455 of yacc.c */ -#line 1443 "program_parse.y" +#line 1462 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVTRANS; ;} @@ -3814,7 +3833,7 @@ yyreduce: case 186: /* Line 1455 of yacc.c */ -#line 1449 "program_parse.y" +#line 1468 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) > 3) { yyerror(& (yylsp[(1) - (1)]), state, "invalid matrix row reference"); @@ -3828,7 +3847,7 @@ yyreduce: case 187: /* Line 1455 of yacc.c */ -#line 1460 "program_parse.y" +#line 1479 "program_parse.y" { (yyval.state)[0] = STATE_MODELVIEW_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); @@ -3838,7 +3857,7 @@ yyreduce: case 188: /* Line 1455 of yacc.c */ -#line 1465 "program_parse.y" +#line 1484 "program_parse.y" { (yyval.state)[0] = STATE_PROJECTION_MATRIX; (yyval.state)[1] = 0; @@ -3848,7 +3867,7 @@ yyreduce: case 189: /* Line 1455 of yacc.c */ -#line 1470 "program_parse.y" +#line 1489 "program_parse.y" { (yyval.state)[0] = STATE_MVP_MATRIX; (yyval.state)[1] = 0; @@ -3858,7 +3877,7 @@ yyreduce: case 190: /* Line 1455 of yacc.c */ -#line 1475 "program_parse.y" +#line 1494 "program_parse.y" { (yyval.state)[0] = STATE_TEXTURE_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); @@ -3868,7 +3887,7 @@ yyreduce: case 191: /* Line 1455 of yacc.c */ -#line 1480 "program_parse.y" +#line 1499 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; @@ -3878,7 +3897,7 @@ yyreduce: case 192: /* Line 1455 of yacc.c */ -#line 1485 "program_parse.y" +#line 1504 "program_parse.y" { (yyval.state)[0] = STATE_PROGRAM_MATRIX; (yyval.state)[1] = (yyvsp[(3) - (4)].integer); @@ -3888,7 +3907,7 @@ yyreduce: case 193: /* Line 1455 of yacc.c */ -#line 1492 "program_parse.y" +#line 1511 "program_parse.y" { (yyval.integer) = 0; ;} @@ -3897,7 +3916,7 @@ yyreduce: case 194: /* Line 1455 of yacc.c */ -#line 1496 "program_parse.y" +#line 1515 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} @@ -3906,7 +3925,7 @@ yyreduce: case 195: /* Line 1455 of yacc.c */ -#line 1501 "program_parse.y" +#line 1520 "program_parse.y" { /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix * zero is valid. @@ -3923,7 +3942,7 @@ yyreduce: case 196: /* Line 1455 of yacc.c */ -#line 1514 "program_parse.y" +#line 1533 "program_parse.y" { /* Since GL_ARB_matrix_palette isn't supported, just let any value * through here. The error will be generated later. @@ -3935,7 +3954,7 @@ yyreduce: case 197: /* Line 1455 of yacc.c */ -#line 1522 "program_parse.y" +#line 1541 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxProgramMatrices) { yyerror(& (yylsp[(1) - (1)]), state, "invalid program matrix selector"); @@ -3949,7 +3968,7 @@ yyreduce: case 198: /* Line 1455 of yacc.c */ -#line 1533 "program_parse.y" +#line 1552 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_DEPTH_RANGE; @@ -3959,7 +3978,7 @@ yyreduce: case 203: /* Line 1455 of yacc.c */ -#line 1545 "program_parse.y" +#line 1564 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3972,7 +3991,7 @@ yyreduce: case 204: /* Line 1455 of yacc.c */ -#line 1555 "program_parse.y" +#line 1574 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); @@ -3982,7 +4001,7 @@ yyreduce: case 205: /* Line 1455 of yacc.c */ -#line 1560 "program_parse.y" +#line 1579 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); @@ -3992,7 +4011,7 @@ yyreduce: case 206: /* Line 1455 of yacc.c */ -#line 1567 "program_parse.y" +#line 1586 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4005,7 +4024,7 @@ yyreduce: case 207: /* Line 1455 of yacc.c */ -#line 1577 "program_parse.y" +#line 1596 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4018,7 +4037,7 @@ yyreduce: case 208: /* Line 1455 of yacc.c */ -#line 1586 "program_parse.y" +#line 1605 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); @@ -4028,7 +4047,7 @@ yyreduce: case 209: /* Line 1455 of yacc.c */ -#line 1591 "program_parse.y" +#line 1610 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); @@ -4038,7 +4057,7 @@ yyreduce: case 210: /* Line 1455 of yacc.c */ -#line 1598 "program_parse.y" +#line 1617 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -4051,7 +4070,7 @@ yyreduce: case 211: /* Line 1455 of yacc.c */ -#line 1608 "program_parse.y" +#line 1627 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxEnvParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid environment parameter reference"); @@ -4064,7 +4083,7 @@ yyreduce: case 212: /* Line 1455 of yacc.c */ -#line 1618 "program_parse.y" +#line 1637 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxLocalParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid local parameter reference"); @@ -4077,7 +4096,7 @@ yyreduce: case 217: /* Line 1455 of yacc.c */ -#line 1633 "program_parse.y" +#line 1652 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -4090,7 +4109,7 @@ yyreduce: case 218: /* Line 1455 of yacc.c */ -#line 1643 "program_parse.y" +#line 1662 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -4103,7 +4122,7 @@ yyreduce: case 219: /* Line 1455 of yacc.c */ -#line 1651 "program_parse.y" +#line 1670 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (float) (yyvsp[(1) - (1)].integer); @@ -4116,7 +4135,7 @@ yyreduce: case 220: /* Line 1455 of yacc.c */ -#line 1661 "program_parse.y" +#line 1680 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (3)].real); @@ -4129,7 +4148,7 @@ yyreduce: case 221: /* Line 1455 of yacc.c */ -#line 1669 "program_parse.y" +#line 1688 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (5)].real); @@ -4142,7 +4161,7 @@ yyreduce: case 222: /* Line 1455 of yacc.c */ -#line 1678 "program_parse.y" +#line 1697 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (7)].real); @@ -4155,7 +4174,7 @@ yyreduce: case 223: /* Line 1455 of yacc.c */ -#line 1687 "program_parse.y" +#line 1706 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (9)].real); @@ -4168,7 +4187,7 @@ yyreduce: case 224: /* Line 1455 of yacc.c */ -#line 1697 "program_parse.y" +#line 1716 "program_parse.y" { (yyval.real) = ((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].real) : (yyvsp[(2) - (2)].real); ;} @@ -4177,7 +4196,7 @@ yyreduce: case 225: /* Line 1455 of yacc.c */ -#line 1701 "program_parse.y" +#line 1720 "program_parse.y" { (yyval.real) = (float)(((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].integer) : (yyvsp[(2) - (2)].integer)); ;} @@ -4186,44 +4205,45 @@ yyreduce: case 226: /* Line 1455 of yacc.c */ -#line 1706 "program_parse.y" +#line 1725 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 227: /* Line 1455 of yacc.c */ -#line 1707 "program_parse.y" +#line 1726 "program_parse.y" { (yyval.negate) = TRUE; ;} break; case 228: /* Line 1455 of yacc.c */ -#line 1708 "program_parse.y" +#line 1727 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 229: /* Line 1455 of yacc.c */ -#line 1711 "program_parse.y" +#line 1730 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 231: /* Line 1455 of yacc.c */ -#line 1714 "program_parse.y" +#line 1733 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 233: /* Line 1455 of yacc.c */ -#line 1718 "program_parse.y" +#line 1737 "program_parse.y" { if (!declare_variable(state, (yyvsp[(3) - (3)].string), (yyvsp[(0) - (3)].integer), & (yylsp[(3) - (3)]))) { + free((yyvsp[(3) - (3)].string)); YYERROR; } ;} @@ -4232,9 +4252,10 @@ yyreduce: case 234: /* Line 1455 of yacc.c */ -#line 1724 "program_parse.y" +#line 1744 "program_parse.y" { if (!declare_variable(state, (yyvsp[(1) - (1)].string), (yyvsp[(0) - (1)].integer), & (yylsp[(1) - (1)]))) { + free((yyvsp[(1) - (1)].string)); YYERROR; } ;} @@ -4243,12 +4264,13 @@ yyreduce: case 235: /* Line 1455 of yacc.c */ -#line 1732 "program_parse.y" +#line 1753 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_output, & (yylsp[(2) - (4)])); if (s == NULL) { + free((yyvsp[(2) - (4)].string)); YYERROR; } else { s->output_binding = (yyvsp[(4) - (4)].result); @@ -4259,7 +4281,7 @@ yyreduce: case 236: /* Line 1455 of yacc.c */ -#line 1745 "program_parse.y" +#line 1767 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_HPOS; @@ -4273,7 +4295,7 @@ yyreduce: case 237: /* Line 1455 of yacc.c */ -#line 1754 "program_parse.y" +#line 1776 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_FOGC; @@ -4287,7 +4309,7 @@ yyreduce: case 238: /* Line 1455 of yacc.c */ -#line 1763 "program_parse.y" +#line 1785 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (2)].result); ;} @@ -4296,7 +4318,7 @@ yyreduce: case 239: /* Line 1455 of yacc.c */ -#line 1767 "program_parse.y" +#line 1789 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_PSIZ; @@ -4310,7 +4332,7 @@ yyreduce: case 240: /* Line 1455 of yacc.c */ -#line 1776 "program_parse.y" +#line 1798 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_TEX0 + (yyvsp[(3) - (3)].integer); @@ -4324,7 +4346,7 @@ yyreduce: case 241: /* Line 1455 of yacc.c */ -#line 1785 "program_parse.y" +#line 1807 "program_parse.y" { if (state->mode == ARB_fragment) { (yyval.result) = FRAG_RESULT_DEPTH; @@ -4338,7 +4360,7 @@ yyreduce: case 242: /* Line 1455 of yacc.c */ -#line 1796 "program_parse.y" +#line 1818 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (3)].integer) + (yyvsp[(3) - (3)].integer); ;} @@ -4347,7 +4369,7 @@ yyreduce: case 243: /* Line 1455 of yacc.c */ -#line 1802 "program_parse.y" +#line 1824 "program_parse.y" { (yyval.integer) = (state->mode == ARB_vertex) ? VERT_RESULT_COL0 @@ -4358,7 +4380,7 @@ yyreduce: case 244: /* Line 1455 of yacc.c */ -#line 1808 "program_parse.y" +#line 1830 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_COL0; @@ -4372,7 +4394,7 @@ yyreduce: case 245: /* Line 1455 of yacc.c */ -#line 1817 "program_parse.y" +#line 1839 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_BFC0; @@ -4386,7 +4408,7 @@ yyreduce: case 246: /* Line 1455 of yacc.c */ -#line 1828 "program_parse.y" +#line 1850 "program_parse.y" { (yyval.integer) = 0; ;} @@ -4395,7 +4417,7 @@ yyreduce: case 247: /* Line 1455 of yacc.c */ -#line 1832 "program_parse.y" +#line 1854 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 0; @@ -4409,7 +4431,7 @@ yyreduce: case 248: /* Line 1455 of yacc.c */ -#line 1841 "program_parse.y" +#line 1863 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 1; @@ -4423,91 +4445,91 @@ yyreduce: case 249: /* Line 1455 of yacc.c */ -#line 1851 "program_parse.y" +#line 1873 "program_parse.y" { (yyval.integer) = 0; ;} break; case 250: /* Line 1455 of yacc.c */ -#line 1852 "program_parse.y" +#line 1874 "program_parse.y" { (yyval.integer) = 0; ;} break; case 251: /* Line 1455 of yacc.c */ -#line 1853 "program_parse.y" +#line 1875 "program_parse.y" { (yyval.integer) = 1; ;} break; case 252: /* Line 1455 of yacc.c */ -#line 1856 "program_parse.y" +#line 1878 "program_parse.y" { (yyval.integer) = 0; ;} break; case 253: /* Line 1455 of yacc.c */ -#line 1857 "program_parse.y" +#line 1879 "program_parse.y" { (yyval.integer) = 0; ;} break; case 254: /* Line 1455 of yacc.c */ -#line 1858 "program_parse.y" +#line 1880 "program_parse.y" { (yyval.integer) = 1; ;} break; case 255: /* Line 1455 of yacc.c */ -#line 1861 "program_parse.y" +#line 1883 "program_parse.y" { (yyval.integer) = 0; ;} break; case 256: /* Line 1455 of yacc.c */ -#line 1862 "program_parse.y" +#line 1884 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 257: /* Line 1455 of yacc.c */ -#line 1865 "program_parse.y" +#line 1887 "program_parse.y" { (yyval.integer) = 0; ;} break; case 258: /* Line 1455 of yacc.c */ -#line 1866 "program_parse.y" +#line 1888 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 259: /* Line 1455 of yacc.c */ -#line 1869 "program_parse.y" +#line 1891 "program_parse.y" { (yyval.integer) = 0; ;} break; case 260: /* Line 1455 of yacc.c */ -#line 1870 "program_parse.y" +#line 1892 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 261: /* Line 1455 of yacc.c */ -#line 1874 "program_parse.y" +#line 1896 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture coordinate unit selector"); @@ -4521,7 +4543,7 @@ yyreduce: case 262: /* Line 1455 of yacc.c */ -#line 1885 "program_parse.y" +#line 1907 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture image unit selector"); @@ -4535,7 +4557,7 @@ yyreduce: case 263: /* Line 1455 of yacc.c */ -#line 1896 "program_parse.y" +#line 1918 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture unit selector"); @@ -4549,7 +4571,7 @@ yyreduce: case 264: /* Line 1455 of yacc.c */ -#line 1907 "program_parse.y" +#line 1929 "program_parse.y" { struct asm_symbol *exist = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(2) - (4)].string)); @@ -4557,10 +4579,14 @@ yyreduce: _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(4) - (4)].string)); + free((yyvsp[(4) - (4)].string)); + if (exist != NULL) { + free((yyvsp[(2) - (4)].string)); yyerror(& (yylsp[(2) - (4)]), state, "redeclared identifier"); YYERROR; } else if (target == NULL) { + free((yyvsp[(2) - (4)].string)); yyerror(& (yylsp[(4) - (4)]), state, "undefined variable binding in ALIAS statement"); YYERROR; @@ -4573,7 +4599,7 @@ yyreduce: /* Line 1455 of yacc.c */ -#line 4577 "program_parse.tab.c" +#line 4603 "program_parse.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -4792,7 +4818,7 @@ yyreturn: /* Line 1675 of yacc.c */ -#line 1927 "program_parse.y" +#line 1953 "program_parse.y" struct asm_instruction * -- cgit v1.2.3 From caf3038123d6d29afd7d1f0cd6db98a2282c3ca1 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 26 Oct 2009 09:28:32 -0700 Subject: Make a convenient int for what chipset generation we're on. gen2/3/4 are easier to say than "8xx, 915-945/g33/pineview, 965/g45/misc", and compares on generation are often easier than stringing together a bunch of chipset checks. --- src/mesa/drivers/dri/intel/intel_context.c | 17 ++++++++++++----- src/mesa/drivers/dri/intel/intel_context.h | 5 +++++ src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 2 +- src/mesa/drivers/dri/intel/intel_regions.c | 3 +-- src/mesa/drivers/dri/intel/intel_tex_validate.c | 2 +- 5 files changed, 20 insertions(+), 9 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index a7d94ced9a..e0022ad548 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -477,7 +477,7 @@ intel_flush(GLcontext *ctx, GLboolean needs_mi_flush) if (intel->Fallback) _swrast_flush(ctx); - if (!IS_965(intel->intelScreen->deviceID)) + if (intel->gen < 4) INTEL_FIREVERTICES(intel); /* Emit a flush so that any frontbuffer rendering that might have occurred @@ -614,6 +614,13 @@ intelInitContext(struct intel_context *intel, intel->sarea = intelScreen->sarea; intel->driContext = driContextPriv; + if (IS_965(intel->intelScreen->deviceID)) + intel->gen = 4; + else if (IS_9XX(intel->intelScreen->deviceID)) + intel->gen = 3; + else + intel->gen = 2; + /* Dri stuff */ intel->hHWContext = driContextPriv->hHWContext; intel->driFd = sPriv->fd; @@ -621,7 +628,7 @@ intelInitContext(struct intel_context *intel, driParseConfigFiles(&intel->optionCache, &intelScreen->optionCache, intel->driScreen->myNum, - IS_965(intelScreen->deviceID) ? "i965" : "i915"); + (intel->gen >= 4) ? "i965" : "i915"); if (intelScreen->deviceID == PCI_CHIP_I865_G) intel->maxBatchSize = 4096; else @@ -683,7 +690,7 @@ intelInitContext(struct intel_context *intel, meta_init_metaops(ctx, &intel->meta); ctx->Const.MaxColorAttachments = 4; /* XXX FBO: review this */ - if (IS_965(intelScreen->deviceID)) { + if (intel->gen >= 4) { if (MAX_WIDTH > 8192) ctx->Const.MaxRenderbufferSize = 8192; } else { @@ -720,7 +727,7 @@ intelInitContext(struct intel_context *intel, break; } - if (IS_965(intelScreen->deviceID)) + if (intel->gen >= 4) intel->polygon_offset_scale /= 0xffff; intel->RenderIndex = ~0; @@ -733,7 +740,7 @@ intelInitContext(struct intel_context *intel, intel->do_usleeps = (fthrottle_mode == DRI_CONF_FTHROTTLE_USLEEPS); - if (IS_965(intelScreen->deviceID) && !intel->intelScreen->irq_active) { + if (intel->gen >= 4 && !intel->intelScreen->irq_active) { _mesa_printf("IRQs not active. Exiting\n"); exit(1); } diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index 356fa4d1e5..2fc224e51a 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -183,6 +183,11 @@ struct intel_context dri_bufmgr *bufmgr; unsigned int maxBatchSize; + /** + * Generation number of the hardware: 2 is 8xx, 3 is 9xx pre-965, 4 is 965. + */ + int gen; + struct intel_region *front_region; struct intel_region *back_region; struct intel_region *depth_region; diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c index 3996c100a5..2a19816e12 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@ -122,7 +122,7 @@ intel_miptree_create(struct intel_context *intel, if (intel->use_texture_tiling && compress_byte == 0 && intel->intelScreen->kernel_exec_fencing) { - if (IS_965(intel->intelScreen->deviceID) && + if (intel->gen >= 4 && (base_format == GL_DEPTH_COMPONENT || base_format == GL_DEPTH_STENCIL_EXT)) tiling = I915_TILING_Y; diff --git a/src/mesa/drivers/dri/intel/intel_regions.c b/src/mesa/drivers/dri/intel/intel_regions.c index a86c66a844..80975163d4 100644 --- a/src/mesa/drivers/dri/intel/intel_regions.c +++ b/src/mesa/drivers/dri/intel/intel_regions.c @@ -582,8 +582,7 @@ intel_recreate_static(struct intel_context *intel, * instead of which tiling mode it is. Guess. */ if (region_desc->tiled) { - if (IS_965(intel->intelScreen->deviceID) && - region_desc == &intelScreen->depth) + if (intel->gen >= 4 && region_desc == &intelScreen->depth) region->tiling = I915_TILING_Y; else region->tiling = I915_TILING_X; diff --git a/src/mesa/drivers/dri/intel/intel_tex_validate.c b/src/mesa/drivers/dri/intel/intel_tex_validate.c index 504993989a..df93b3b759 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_validate.c +++ b/src/mesa/drivers/dri/intel/intel_tex_validate.c @@ -42,7 +42,7 @@ intel_calculate_first_last_level(struct intel_context *intel, firstLevel = lastLevel = tObj->BaseLevel; } else { - if (!IS_9XX(intel->intelScreen->deviceID)) { + if (intel->gen == 2) { firstLevel = tObj->BaseLevel + (GLint) (tObj->MinLod + 0.5); firstLevel = MAX2(firstLevel, tObj->BaseLevel); firstLevel = MIN2(firstLevel, tObj->BaseLevel + baseImage->MaxLog2); -- cgit v1.2.3 From 8e0f40d28777f1ae599a95312788fe29a0515a0d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 3 Nov 2009 17:18:36 -0800 Subject: intel: Use PIPE_CONTROL on gen4 hardware for doing pipeline flushing. This should do all the things that MI_FLUSH did, but it can be pipelined so that further rendering isn't blocked on the flush completion unless necessary. --- src/mesa/drivers/dri/i915/i830_vtbl.c | 10 -------- src/mesa/drivers/dri/i915/i915_vtbl.c | 7 ------ src/mesa/drivers/dri/i965/brw_draw.c | 8 ++---- src/mesa/drivers/dri/i965/brw_vtbl.c | 15 ------------ src/mesa/drivers/dri/intel/intel_batchbuffer.c | 34 ++++++++++++++++++++++++-- src/mesa/drivers/dri/intel/intel_batchbuffer.h | 12 +++------ src/mesa/drivers/dri/intel/intel_context.h | 2 -- 7 files changed, 37 insertions(+), 51 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i830_vtbl.c b/src/mesa/drivers/dri/i915/i830_vtbl.c index 4133696129..a6f554701e 100644 --- a/src/mesa/drivers/dri/i915/i830_vtbl.c +++ b/src/mesa/drivers/dri/i915/i830_vtbl.c @@ -719,15 +719,6 @@ i830_new_batch(struct intel_context *intel) assert(!intel->no_batch_wrap); } - - -static GLuint -i830_flush_cmd(void) -{ - return MI_FLUSH | FLUSH_MAP_CACHE; -} - - static void i830_assert_not_dirty( struct intel_context *intel ) { @@ -753,7 +744,6 @@ i830InitVtbl(struct i830_context *i830) i830->intel.vtbl.reduced_primitive_state = i830_reduced_primitive_state; i830->intel.vtbl.set_draw_region = i830_set_draw_region; i830->intel.vtbl.update_texture_state = i830UpdateTextureState; - i830->intel.vtbl.flush_cmd = i830_flush_cmd; i830->intel.vtbl.render_start = i830_render_start; i830->intel.vtbl.render_prevalidate = i830_render_prevalidate; i830->intel.vtbl.assert_not_dirty = i830_assert_not_dirty; diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c b/src/mesa/drivers/dri/i915/i915_vtbl.c index 3c1b2dd0b0..77ba8d5581 100644 --- a/src/mesa/drivers/dri/i915/i915_vtbl.c +++ b/src/mesa/drivers/dri/i915/i915_vtbl.c @@ -672,12 +672,6 @@ i915_new_batch(struct intel_context *intel) assert(!intel->no_batch_wrap); } -static GLuint -i915_flush_cmd(void) -{ - return MI_FLUSH | FLUSH_MAP_CACHE; -} - static void i915_assert_not_dirty( struct intel_context *intel ) { @@ -699,7 +693,6 @@ i915InitVtbl(struct i915_context *i915) i915->intel.vtbl.render_prevalidate = i915_render_prevalidate; i915->intel.vtbl.set_draw_region = i915_set_draw_region; i915->intel.vtbl.update_texture_state = i915UpdateTextureState; - i915->intel.vtbl.flush_cmd = i915_flush_cmd; i915->intel.vtbl.assert_not_dirty = i915_assert_not_dirty; i915->intel.vtbl.finish_batch = intel_finish_vb; } diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index 44bb7bd588..8bcb6083f7 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -153,18 +153,14 @@ static void brw_emit_prim(struct brw_context *brw, * the besides the draw code. */ if (intel->always_flush_cache) { - BEGIN_BATCH(1, IGNORE_CLIPRECTS); - OUT_BATCH(intel->vtbl.flush_cmd()); - ADVANCE_BATCH(); + intel_batchbuffer_emit_mi_flush(intel->batch); } if (prim_packet.verts_per_instance) { intel_batchbuffer_data( brw->intel.batch, &prim_packet, sizeof(prim_packet), LOOP_CLIPRECTS); } if (intel->always_flush_cache) { - BEGIN_BATCH(1, IGNORE_CLIPRECTS); - OUT_BATCH(intel->vtbl.flush_cmd()); - ADVANCE_BATCH(); + intel_batchbuffer_emit_mi_flush(intel->batch); } brw->no_batch_wrap = GL_FALSE; diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c index 124fde25fe..114e6bd018 100644 --- a/src/mesa/drivers/dri/i965/brw_vtbl.c +++ b/src/mesa/drivers/dri/i965/brw_vtbl.c @@ -175,20 +175,6 @@ static void brw_note_fence( struct intel_context *intel, GLuint fence ) brw_context(&intel->ctx)->state.dirty.brw |= BRW_NEW_FENCE; } -/* called from intelWaitForIdle() and intelFlush() - * - * For now, just flush everything. Could be smarter later. - */ -static GLuint brw_flush_cmd( void ) -{ - struct brw_mi_flush flush; - flush.opcode = CMD_MI_FLUSH; - flush.pad = 0; - flush.flags = BRW_FLUSH_STATE_CACHE; - return *(GLuint *)&flush; -} - - static void brw_invalidate_state( struct intel_context *intel, GLuint new_state ) { /* nothing */ @@ -209,6 +195,5 @@ void brwInitVtbl( struct brw_context *brw ) brw->intel.vtbl.finish_batch = brw_finish_batch; brw->intel.vtbl.destroy = brw_destroy_context; brw->intel.vtbl.set_draw_region = brw_set_draw_region; - brw->intel.vtbl.flush_cmd = brw_flush_cmd; brw->intel.vtbl.debug_batch = brw_debug_batch; } diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.c b/src/mesa/drivers/dri/intel/intel_batchbuffer.c index e94b8368cd..ca6e2fa5b1 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.c @@ -210,10 +210,10 @@ _intel_batchbuffer_flush(struct intel_batchbuffer *batch, const char *file, fprintf(stderr, "%s:%d: Batchbuffer flush with %db used\n", file, line, used); + batch->reserved_space = 0; /* Emit a flush if the bufmgr doesn't do it for us. */ if (intel->always_flush_cache || !intel->ttm) { - *(GLuint *) (batch->ptr) = intel->vtbl.flush_cmd(); - batch->ptr += 4; + intel_batchbuffer_emit_mi_flush(batch); used = batch->ptr - batch->map; } @@ -244,6 +244,8 @@ _intel_batchbuffer_flush(struct intel_batchbuffer *batch, const char *file, if (intel->vtbl.finish_batch) intel->vtbl.finish_batch(intel); + batch->reserved_space = BATCH_RESERVED; + /* TODO: Just pass the relocation list and dma buffer up to the * kernel. */ @@ -299,3 +301,31 @@ intel_batchbuffer_data(struct intel_batchbuffer *batch, __memcpy(batch->ptr, data, bytes); batch->ptr += bytes; } + +/* Emit a pipelined flush to either flush render and texture cache for + * reading from a FBO-drawn texture, or flush so that frontbuffer + * render appears on the screen in DRI1. + * + * This is also used for the always_flush_cache driconf debug option. + */ +void +intel_batchbuffer_emit_mi_flush(struct intel_batchbuffer *batch) +{ + struct intel_context *intel = batch->intel; + + if (intel->gen >= 4) { + BEGIN_BATCH(4, IGNORE_CLIPRECTS); + OUT_BATCH(_3DSTATE_PIPE_CONTROL | + PIPE_CONTROL_INSTRUCTION_FLUSH | + PIPE_CONTROL_WRITE_FLUSH | + PIPE_CONTROL_NO_WRITE); + OUT_BATCH(0); /* write address */ + OUT_BATCH(0); /* write data */ + OUT_BATCH(0); /* write data */ + ADVANCE_BATCH(); + } else { + BEGIN_BATCH(1, IGNORE_CLIPRECTS); + OUT_BATCH(MI_FLUSH); + ADVANCE_BATCH(); + } +} diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.h b/src/mesa/drivers/dri/intel/intel_batchbuffer.h index d4899aab7f..d4a94454dd 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.h +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.h @@ -62,6 +62,7 @@ struct intel_batchbuffer } emit; GLuint dirty_state; + GLuint reserved_space; }; struct intel_batchbuffer *intel_batchbuffer_alloc(struct intel_context @@ -95,6 +96,7 @@ GLboolean intel_batchbuffer_emit_reloc(struct intel_batchbuffer *batch, uint32_t read_domains, uint32_t write_domain, uint32_t offset); +void intel_batchbuffer_emit_mi_flush(struct intel_batchbuffer *batch); /* Inline functions - might actually be better off with these * non-inlined. Certainly better off switching all command packets to @@ -104,7 +106,7 @@ GLboolean intel_batchbuffer_emit_reloc(struct intel_batchbuffer *batch, static INLINE GLint intel_batchbuffer_space(struct intel_batchbuffer *batch) { - return (batch->size - BATCH_RESERVED) - (batch->ptr - batch->map); + return (batch->size - batch->reserved_space) - (batch->ptr - batch->map); } @@ -173,12 +175,4 @@ intel_batchbuffer_require_space(struct intel_batchbuffer *batch, intel->batch->emit.start_ptr = NULL; \ } while(0) - -static INLINE void -intel_batchbuffer_emit_mi_flush(struct intel_batchbuffer *batch) -{ - intel_batchbuffer_require_space(batch, 4, IGNORE_CLIPRECTS); - intel_batchbuffer_emit_dword(batch, MI_FLUSH); -} - #endif diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index 2fc224e51a..84fbfc564c 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -117,8 +117,6 @@ struct intel_context struct intel_region * depth_region, GLuint num_regions); - GLuint (*flush_cmd) (void); - void (*reduced_primitive_state) (struct intel_context * intel, GLenum rprim); -- cgit v1.2.3 From bb2dd50be00000b66218bc6a9e6be8de70b31493 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 3 Nov 2009 17:30:46 -0800 Subject: intel: Remove obsolete comment about GEM in the spans code. --- src/mesa/drivers/dri/intel/intel_span.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index bab13e3665..3607c7dded 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -292,7 +292,6 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb, #define Y_FLIP(_y) ((_y) * yScale + yBias) -/* XXX with GEM, these need to tell the kernel */ #define HW_LOCK() #define HW_UNLOCK() -- cgit v1.2.3 From 2bc8bcdcd334db715f8916f80ef4f4bc5f9a170d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 3 Nov 2009 17:40:13 -0800 Subject: i965: Remove an XXX comment for testing some code that seems to work. --- src/mesa/drivers/dri/i965/brw_wm_fp.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c index 0e86d75dea..a453250e79 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_fp.c +++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c @@ -448,7 +448,6 @@ static void emit_interp( struct brw_wm_compile *c, break; case FRAG_ATTRIB_FACE: - /* XXX review/test this case */ emit_op(c, WM_FRONTFACING, dst_mask(dst, WRITEMASK_X), -- cgit v1.2.3 From 8f30ceaaefc33401b08739a16ce1c5638d6432fa Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 4 Nov 2009 13:41:48 -0800 Subject: intel: Remove duplicated arguments from intel_miptree_match_image(). --- src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 5 +++-- src/mesa/drivers/dri/intel/intel_mipmap_tree.h | 3 +-- src/mesa/drivers/dri/intel/intel_tex_image.c | 9 +++------ 3 files changed, 7 insertions(+), 10 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c index 2a19816e12..e082ebc799 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@ -315,10 +315,11 @@ intel_miptree_release(struct intel_context *intel, */ GLboolean intel_miptree_match_image(struct intel_mipmap_tree *mt, - struct gl_texture_image *image, - GLuint face, GLuint level) + struct gl_texture_image *image) { GLboolean isCompressed = _mesa_is_format_compressed(image->TexFormat); + struct intel_texture_image *intelImage = intel_texture_image(image); + GLuint level = intelImage->level; /* Images with borders are never pulled into mipmap trees. */ diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h index 3bce54daa1..b19c548def 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.h +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.h @@ -165,8 +165,7 @@ void intel_miptree_release(struct intel_context *intel, /* Check if an image fits an existing mipmap tree layout */ GLboolean intel_miptree_match_image(struct intel_mipmap_tree *mt, - struct gl_texture_image *image, - GLuint face, GLuint level); + struct gl_texture_image *image); /* Return a pointer to an image within a tree. Return image stride as * well. diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index 3412e761ca..0644277c05 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -368,8 +368,7 @@ intelTexImage(GLcontext * ctx, intelObj->mt->first_level == level && intelObj->mt->last_level == level && intelObj->mt->target != GL_TEXTURE_CUBE_MAP_ARB && - !intel_miptree_match_image(intelObj->mt, &intelImage->base, - intelImage->face, intelImage->level)) { + !intel_miptree_match_image(intelObj->mt, &intelImage->base)) { DBG("release it\n"); intel_miptree_release(intel, &intelObj->mt); @@ -386,8 +385,7 @@ intelTexImage(GLcontext * ctx, assert(!intelImage->mt); if (intelObj->mt && - intel_miptree_match_image(intelObj->mt, &intelImage->base, - intelImage->face, intelImage->level)) { + intel_miptree_match_image(intelObj->mt, &intelImage->base)) { intel_miptree_reference(&intelImage->mt, intelObj->mt); assert(intelImage->mt); @@ -797,8 +795,7 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, texImage->RowStride = rb->region->pitch; intel_miptree_reference(&intelImage->mt, intelObj->mt); - if (!intel_miptree_match_image(intelObj->mt, &intelImage->base, - intelImage->face, intelImage->level)) { + if (!intel_miptree_match_image(intelObj->mt, &intelImage->base)) { fprintf(stderr, "miptree doesn't match image\n"); } -- cgit v1.2.3 From ee7dfbbd6cc85f221b371bf512bd1571744158e8 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 4 Nov 2009 16:49:05 -0800 Subject: intel: Use _mesa_get_current_tex_object() to clean up TFP path. --- src/mesa/drivers/dri/intel/intel_tex_image.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex_image.c b/src/mesa/drivers/dri/intel/intel_tex_image.c index 0644277c05..66d61f93ea 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_image.c +++ b/src/mesa/drivers/dri/intel/intel_tex_image.c @@ -115,7 +115,8 @@ guess_and_alloc_mipmap_tree(struct intel_context *intel, */ if ((intelObj->base.MinFilter == GL_NEAREST || intelObj->base.MinFilter == GL_LINEAR) && - intelImage->level == firstLevel) { + intelImage->level == firstLevel && + (intel->gen < 4 || firstLevel == 0)) { lastLevel = firstLevel; } else { @@ -733,17 +734,16 @@ intelSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, { struct intel_framebuffer *intel_fb = dPriv->driverPrivate; struct intel_context *intel = pDRICtx->driverPrivate; + GLcontext *ctx = &intel->ctx; struct intel_texture_object *intelObj; struct intel_texture_image *intelImage; struct intel_mipmap_tree *mt; struct intel_renderbuffer *rb; - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; struct gl_texture_image *texImage; int level = 0, internalFormat; - texUnit = &intel->ctx.Texture.Unit[intel->ctx.Texture.CurrentUnit]; - texObj = _mesa_select_tex_object(&intel->ctx, texUnit, target); + texObj = _mesa_get_current_tex_object(ctx, target); intelObj = intel_texture_object(texObj); if (!intelObj) -- cgit v1.2.3 From 8df81bca1704aef2f5cdc4052ef313d8f84f5d06 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 4 Nov 2009 15:11:02 -0800 Subject: intel: Clean up some extra struct indirection in finalize. --- src/mesa/drivers/dri/intel/intel_tex_validate.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex_validate.c b/src/mesa/drivers/dri/intel/intel_tex_validate.c index df93b3b759..dbef288615 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_validate.c +++ b/src/mesa/drivers/dri/intel/intel_tex_validate.c @@ -138,8 +138,7 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit) /* What levels must the tree include at a minimum? */ intel_calculate_first_last_level(intel, intelObj); - firstImage = - intel_texture_image(intelObj->base.Image[0][intelObj->firstLevel]); + firstImage = intel_texture_image(tObj->Image[0][intelObj->firstLevel]); /* Fallback case: */ -- cgit v1.2.3 From 6b68482e6869bdc03339ef5380d7273e14a61a56 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 4 Nov 2009 14:31:30 -0800 Subject: mesa: Attempt to pair up Driver.RenderTexture and FinishRenderTexture() This is probably not 100% complete (bind vs unbind may still not pair up exactly), but it should help out drivers which are relying on FinishRenderTexture to be called when we're done rendering to a particular texture level, not just when we're done rendering to the object at all. This is the case for the one consumer of FinishRenderTexture() so far: the gallium state tracker. Noticed when trying to make use of FRT() in the intel driver. --- src/mesa/main/fbobject.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 319d0f2ce9..c4454550db 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -233,9 +233,13 @@ _mesa_set_texture_attachment(GLcontext *ctx, if (att->Texture == texObj) { /* re-attaching same texture */ ASSERT(att->Type == GL_TEXTURE); + if (ctx->Driver.FinishRenderTexture) + ctx->Driver.FinishRenderTexture(ctx, att); } else { /* new attachment */ + if (ctx->Driver.FinishRenderTexture && att->Texture) + ctx->Driver.FinishRenderTexture(ctx, att); _mesa_remove_attachment(ctx, att); att->Type = GL_TEXTURE; assert(!att->Texture); -- cgit v1.2.3 From 75bdbdd90b15c8704d87ca195a364ff6a42edbb1 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 4 Nov 2009 14:54:09 -0800 Subject: intel: Don't validate in a texture image used as a render target. Otherwise, we could lose track of rendering to that image, which could easily happen during mipmap generation. --- src/mesa/drivers/dri/intel/intel_fbo.c | 18 ++++++++---------- src/mesa/drivers/dri/intel/intel_tex_obj.h | 1 + src/mesa/drivers/dri/intel/intel_tex_validate.c | 7 ++++++- 3 files changed, 15 insertions(+), 11 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index d8ac4d3663..5615040946 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -577,6 +577,7 @@ intel_render_texture(GLcontext * ctx, dst_x) * intel_image->mt->cpp; intel_image->mt->region->draw_x = dst_x; intel_image->mt->region->draw_y = dst_y; + intel_image->used_as_render_target = GL_TRUE; /* update drawing region, etc */ intel_draw_buffer(ctx, fb); @@ -590,16 +591,13 @@ static void intel_finish_render_texture(GLcontext * ctx, struct gl_renderbuffer_attachment *att) { - /* no-op - * Previously we released the renderbuffer's intel_region but - * that's not necessary and actually caused problems when trying - * to do a glRead/CopyPixels from the renderbuffer later. - * The region will be released later if the texture is replaced - * or the renderbuffer deleted. - * - * The intention of this driver hook is more of a "done rendering - * to texture, please re-twiddle/etc if necessary". - */ + struct gl_texture_object *tex_obj = att->Texture; + struct gl_texture_image *image = + tex_obj->Image[att->CubeMapFace][att->TextureLevel]; + struct intel_texture_image *intel_image = intel_texture_image(image); + + /* Flag that this image may now be validated into the object's miptree. */ + intel_image->used_as_render_target = GL_FALSE; } diff --git a/src/mesa/drivers/dri/intel/intel_tex_obj.h b/src/mesa/drivers/dri/intel/intel_tex_obj.h index 5a93461525..3ad10d3d23 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_obj.h +++ b/src/mesa/drivers/dri/intel/intel_tex_obj.h @@ -66,6 +66,7 @@ struct intel_texture_image * Else there is no image data. */ struct intel_mipmap_tree *mt; + GLboolean used_as_render_target; }; static INLINE struct intel_texture_object * diff --git a/src/mesa/drivers/dri/intel/intel_tex_validate.c b/src/mesa/drivers/dri/intel/intel_tex_validate.c index dbef288615..c9a24ac398 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_validate.c +++ b/src/mesa/drivers/dri/intel/intel_tex_validate.c @@ -222,8 +222,13 @@ intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit) intel_texture_image(intelObj->base.Image[face][i]); /* Need to import images in main memory or held in other trees. + * If it's a render target, then its data isn't needed to be in + * the object tree (otherwise we'd be FBO incomplete), and we need + * to keep track of the image's MT as needing to be pulled in still, + * or we'll lose the rendering that's done to it. */ - if (intelObj->mt != intelImage->mt) { + if (intelObj->mt != intelImage->mt && + !intelImage->used_as_render_target) { copy_image_data_to_tree(intel, intelObj, intelImage); } } -- cgit v1.2.3 From 1166294d1dd253da63620235100a11f1981aa86d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 4 Nov 2009 17:31:01 -0800 Subject: intel: Finish removing the fallback code for bug #16697. I fixed it properly as of 7216679c1998b49ff5b08e6b43f8d5779415bf54. --- src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c index e082ebc799..abb3024bfb 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@ -321,12 +321,8 @@ intel_miptree_match_image(struct intel_mipmap_tree *mt, struct intel_texture_image *intelImage = intel_texture_image(image); GLuint level = intelImage->level; - /* Images with borders are never pulled into mipmap trees. - */ - if (image->Border || - ((image->_BaseFormat == GL_DEPTH_COMPONENT) && - ((image->TexObject->WrapS == GL_CLAMP_TO_BORDER) || - (image->TexObject->WrapT == GL_CLAMP_TO_BORDER)))) + /* Images with borders are never pulled into mipmap trees. */ + if (image->Border) return GL_FALSE; if (image->InternalFormat != mt->internal_format || -- cgit v1.2.3 From 8395da2e8af40367714c70afe299568272f36cc8 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 5 Nov 2009 10:25:34 -0800 Subject: i965: Always pass the size argument to brw_cache_data. This keeps the individual state files from having to export their structures for brw_state_cache initialization. --- src/mesa/drivers/dri/i965/brw_cc.c | 3 +- src/mesa/drivers/dri/i965/brw_context.h | 1 - src/mesa/drivers/dri/i965/brw_sf_state.c | 3 +- src/mesa/drivers/dri/i965/brw_state.h | 8 +--- src/mesa/drivers/dri/i965/brw_state_cache.c | 59 ++++++------------------ src/mesa/drivers/dri/i965/brw_wm_sampler_state.c | 4 +- 6 files changed, 21 insertions(+), 57 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_cc.c b/src/mesa/drivers/dri/i965/brw_cc.c index 5cca605c3f..d4ccd28c9e 100644 --- a/src/mesa/drivers/dri/i965/brw_cc.c +++ b/src/mesa/drivers/dri/i965/brw_cc.c @@ -55,7 +55,8 @@ static void prepare_cc_vp( struct brw_context *brw ) } dri_bo_unreference(brw->cc.vp_bo); - brw->cc.vp_bo = brw_cache_data( &brw->cache, BRW_CC_VP, &ccv, NULL, 0 ); + brw->cc.vp_bo = brw_cache_data(&brw->cache, BRW_CC_VP, &ccv, sizeof(ccv), + NULL, 0); } const struct brw_tracked_state brw_cc_vp = { diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index 59f9475b5a..e01930a4a0 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -333,7 +333,6 @@ struct brw_cache { struct brw_cache_item **items; GLuint size, n_items; - GLuint key_size[BRW_MAX_CACHE]; /* for fixed-size keys */ GLuint aux_size[BRW_MAX_CACHE]; char *name[BRW_MAX_CACHE]; diff --git a/src/mesa/drivers/dri/i965/brw_sf_state.c b/src/mesa/drivers/dri/i965/brw_sf_state.c index bc0f076073..d6b47b5d8d 100644 --- a/src/mesa/drivers/dri/i965/brw_sf_state.c +++ b/src/mesa/drivers/dri/i965/brw_sf_state.c @@ -93,7 +93,8 @@ static void upload_sf_vp(struct brw_context *brw) } dri_bo_unreference(brw->sf.vp_bo); - brw->sf.vp_bo = brw_cache_data( &brw->cache, BRW_SF_VP, &sfv, NULL, 0 ); + brw->sf.vp_bo = brw_cache_data(&brw->cache, BRW_SF_VP, &sfv, sizeof(sfv), + NULL, 0); } const struct brw_tracked_state brw_sf_vp = { diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h index d639656b9d..ab6f158080 100644 --- a/src/mesa/drivers/dri/i965/brw_state.h +++ b/src/mesa/drivers/dri/i965/brw_state.h @@ -119,16 +119,10 @@ void brw_destroy_state(struct brw_context *brw); dri_bo *brw_cache_data(struct brw_cache *cache, enum brw_cache_id cache_id, const void *data, + GLuint size, dri_bo **reloc_bufs, GLuint nr_reloc_bufs); -dri_bo *brw_cache_data_sz(struct brw_cache *cache, - enum brw_cache_id cache_id, - const void *data, - GLuint data_size, - dri_bo **reloc_bufs, - GLuint nr_reloc_bufs); - dri_bo *brw_upload_cache( struct brw_cache *cache, enum brw_cache_id cache_id, const void *key, diff --git a/src/mesa/drivers/dri/i965/brw_state_cache.c b/src/mesa/drivers/dri/i965/brw_state_cache.c index c262e1db8b..d2ab624783 100644 --- a/src/mesa/drivers/dri/i965/brw_state_cache.c +++ b/src/mesa/drivers/dri/i965/brw_state_cache.c @@ -275,15 +275,22 @@ brw_upload_cache( struct brw_cache *cache, /** - * This doesn't really work with aux data. Use search/upload instead + * Wrapper around brw_cache_data_sz using the cache_id's canonical key size. + * + * If nr_reloc_bufs is nonzero, brw_search_cache()/brw_upload_cache() would be + * better to use, as the potentially changing offsets in the data-used-as-key + * will result in excessive cache misses. + * + * If aux data is involved, use search/upload instead. + */ dri_bo * -brw_cache_data_sz(struct brw_cache *cache, - enum brw_cache_id cache_id, - const void *data, - GLuint data_size, - dri_bo **reloc_bufs, - GLuint nr_reloc_bufs) +brw_cache_data(struct brw_cache *cache, + enum brw_cache_id cache_id, + const void *data, + GLuint data_size, + dri_bo **reloc_bufs, + GLuint nr_reloc_bufs) { dri_bo *bo; struct brw_cache_item *item; @@ -306,25 +313,6 @@ brw_cache_data_sz(struct brw_cache *cache, return bo; } - -/** - * Wrapper around brw_cache_data_sz using the cache_id's canonical key size. - * - * If nr_reloc_bufs is nonzero, brw_search_cache()/brw_upload_cache() would be - * better to use, as the potentially changing offsets in the data-used-as-key - * will result in excessive cache misses. - */ -dri_bo * -brw_cache_data(struct brw_cache *cache, - enum brw_cache_id cache_id, - const void *data, - dri_bo **reloc_bufs, - GLuint nr_reloc_bufs) -{ - return brw_cache_data_sz(cache, cache_id, data, cache->key_size[cache_id], - reloc_bufs, nr_reloc_bufs); -} - enum pool_type { DW_SURFACE_STATE, DW_GENERAL_STATE @@ -335,11 +323,9 @@ static void brw_init_cache_id(struct brw_cache *cache, const char *name, enum brw_cache_id id, - GLuint key_size, GLuint aux_size) { cache->name[id] = strdup(name); - cache->key_size[id] = key_size; cache->aux_size[id] = aux_size; } @@ -359,91 +345,76 @@ brw_init_non_surface_cache(struct brw_context *brw) brw_init_cache_id(cache, "CC_VP", BRW_CC_VP, - sizeof(struct brw_cc_viewport), 0); brw_init_cache_id(cache, "CC_UNIT", BRW_CC_UNIT, - sizeof(struct brw_cc_unit_state), 0); brw_init_cache_id(cache, "WM_PROG", BRW_WM_PROG, - sizeof(struct brw_wm_prog_key), sizeof(struct brw_wm_prog_data)); brw_init_cache_id(cache, "SAMPLER_DEFAULT_COLOR", BRW_SAMPLER_DEFAULT_COLOR, - sizeof(struct brw_sampler_default_color), 0); brw_init_cache_id(cache, "SAMPLER", BRW_SAMPLER, - 0, /* variable key/data size */ 0); brw_init_cache_id(cache, "WM_UNIT", BRW_WM_UNIT, - sizeof(struct brw_wm_unit_state), 0); brw_init_cache_id(cache, "SF_PROG", BRW_SF_PROG, - sizeof(struct brw_sf_prog_key), sizeof(struct brw_sf_prog_data)); brw_init_cache_id(cache, "SF_VP", BRW_SF_VP, - sizeof(struct brw_sf_viewport), 0); brw_init_cache_id(cache, "SF_UNIT", BRW_SF_UNIT, - sizeof(struct brw_sf_unit_state), 0); brw_init_cache_id(cache, "VS_UNIT", BRW_VS_UNIT, - sizeof(struct brw_vs_unit_state), 0); brw_init_cache_id(cache, "VS_PROG", BRW_VS_PROG, - sizeof(struct brw_vs_prog_key), sizeof(struct brw_vs_prog_data)); brw_init_cache_id(cache, "CLIP_UNIT", BRW_CLIP_UNIT, - sizeof(struct brw_clip_unit_state), 0); brw_init_cache_id(cache, "CLIP_PROG", BRW_CLIP_PROG, - sizeof(struct brw_clip_prog_key), sizeof(struct brw_clip_prog_data)); brw_init_cache_id(cache, "GS_UNIT", BRW_GS_UNIT, - sizeof(struct brw_gs_unit_state), 0); brw_init_cache_id(cache, "GS_PROG", BRW_GS_PROG, - sizeof(struct brw_gs_prog_key), sizeof(struct brw_gs_prog_data)); } @@ -463,13 +434,11 @@ brw_init_surface_cache(struct brw_context *brw) brw_init_cache_id(cache, "SS_SURFACE", BRW_SS_SURFACE, - sizeof(struct brw_surface_state), 0); brw_init_cache_id(cache, "SS_SURF_BIND", BRW_SS_SURF_BIND, - 0, 0); } diff --git a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c index 0acb027431..aa2e519588 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c @@ -73,8 +73,8 @@ static dri_bo *upload_default_color( struct brw_context *brw, COPY_4V(sdc.color, color); - return brw_cache_data( &brw->cache, BRW_SAMPLER_DEFAULT_COLOR, &sdc, - NULL, 0 ); + return brw_cache_data(&brw->cache, BRW_SAMPLER_DEFAULT_COLOR, + &sdc, sizeof(sdc), NULL, 0); } -- cgit v1.2.3 From 3105f3aa88e4b59eed3c7f175af77fbdb4af5924 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 6 Nov 2009 13:52:48 -0700 Subject: intel: better front color buffer test in intelClear() --- src/mesa/drivers/dri/intel/intel_clear.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_clear.c b/src/mesa/drivers/dri/intel/intel_clear.c index 1cf41ee6b8..f682ee3de5 100644 --- a/src/mesa/drivers/dri/intel/intel_clear.c +++ b/src/mesa/drivers/dri/intel/intel_clear.c @@ -33,7 +33,6 @@ #include "intel_context.h" #include "intel_blit.h" -#include "intel_buffers.h" #include "intel_chipset.h" #include "intel_clear.h" #include "intel_fbo.h" @@ -76,7 +75,9 @@ intelClear(GLcontext *ctx, GLbitfield mask) struct gl_framebuffer *fb = ctx->DrawBuffer; GLuint i; - intel_check_front_buffer_rendering(intel); + if (mask & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_FRONT_RIGHT)) { + intel->front_buffer_dirty = GL_TRUE; + } if (0) fprintf(stderr, "%s\n", __FUNCTION__); -- cgit v1.2.3 From ee0a9e6e10060287747d9dd4afead3cbbb168e09 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 12 Jun 2009 12:37:25 -0700 Subject: mesa: Fix up the remove_dead_code pass to operate on a channel basis. This cleans up a bunch of instructions in GLSL programs to have limited writemasks, which would translate to wins in shaders that hit the i965 brw_wm_glsl.c path by depending less on in-driver optimizations. It will also help hit other optimization passes I'm looking at. --- src/mesa/shader/prog_optimize.c | 84 +++++++++++++++++++++++++++-------------- 1 file changed, 56 insertions(+), 28 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/prog_optimize.c b/src/mesa/shader/prog_optimize.c index 9d937488e3..e627715b5a 100644 --- a/src/mesa/shader/prog_optimize.c +++ b/src/mesa/shader/prog_optimize.c @@ -187,11 +187,10 @@ _mesa_consolidate_registers(struct gl_program *prog) static void _mesa_remove_dead_code(struct gl_program *prog) { - GLboolean tempWritten[MAX_PROGRAM_TEMPS], tempRead[MAX_PROGRAM_TEMPS]; + GLboolean tempRead[MAX_PROGRAM_TEMPS][4]; GLboolean *removeInst; /* per-instruction removal flag */ - GLuint i, rem; + GLuint i, rem = 0, comp; - memset(tempWritten, 0, sizeof(tempWritten)); memset(tempRead, 0, sizeof(tempRead)); if (dbg) { @@ -217,11 +216,27 @@ _mesa_remove_dead_code(struct gl_program *prog) if (inst->SrcReg[j].RelAddr) { if (dbg) _mesa_printf("abort remove dead code (indirect temp)\n"); - _mesa_free(removeInst); - return; + goto done; } - tempRead[index] = GL_TRUE; + for (comp = 0; comp < 4; comp++) { + GLuint swz = (inst->SrcReg[j].Swizzle >> (3 * comp)) & 0x7; + + switch (swz) { + case SWIZZLE_X: + tempRead[index][0] = GL_TRUE; + break; + case SWIZZLE_Y: + tempRead[index][1] = GL_TRUE; + break; + case SWIZZLE_Z: + tempRead[index][2] = GL_TRUE; + break; + case SWIZZLE_W: + tempRead[index][3] = GL_TRUE; + break; + } + } } } @@ -233,50 +248,63 @@ _mesa_remove_dead_code(struct gl_program *prog) if (inst->DstReg.RelAddr) { if (dbg) _mesa_printf("abort remove dead code (indirect temp)\n"); - _mesa_free(removeInst); - return; + goto done; } - tempWritten[index] = GL_TRUE; if (inst->CondUpdate) { /* If we're writing to this register and setting condition * codes we cannot remove the instruction. Prevent removal * by setting the 'read' flag. */ - tempRead[index] = GL_TRUE; + tempRead[index][0] = GL_TRUE; + tempRead[index][1] = GL_TRUE; + tempRead[index][2] = GL_TRUE; + tempRead[index][3] = GL_TRUE; } } } - if (dbg) { - for (i = 0; i < MAX_PROGRAM_TEMPS; i++) { - if (tempWritten[i] && !tempRead[i]) - _mesa_printf("Remove writes to tmp %u\n", i); - } - } - /* find instructions that write to dead registers, flag for removal */ for (i = 0; i < prog->NumInstructions; i++) { - const struct prog_instruction *inst = prog->Instructions + i; - if (inst->DstReg.File == PROGRAM_TEMPORARY) { - GLint index = inst->DstReg.Index; - removeInst[i] = (tempWritten[index] && !tempRead[index]); - if (dbg && removeInst[i]) { - _mesa_printf("Remove inst %u: ", i); - _mesa_print_instruction(inst); - } + struct prog_instruction *inst = prog->Instructions + i; + const GLuint numDst = _mesa_num_inst_dst_regs(inst->Opcode); + + if (numDst != 0 && inst->DstReg.File == PROGRAM_TEMPORARY) { + GLint chan, index = inst->DstReg.Index; + + for (chan = 0; chan < 4; chan++) { + if (!tempRead[index][chan] && + inst->DstReg.WriteMask & (1 << chan)) { + if (dbg) { + _mesa_printf("Remove writemask on %u.%c\n", i, + chan == 3 ? 'w' : 'x' + chan); + } + inst->DstReg.WriteMask &= ~(1 << chan); + rem++; + } + } + + if (inst->DstReg.WriteMask == 0) { + /* If we cleared all writes, the instruction can be removed. */ + if (dbg) + _mesa_printf("Remove instruction %u: \n", i); + removeInst[i] = GL_TRUE; + } } } /* now remove the instructions which aren't needed */ rem = remove_instructions(prog, removeInst); - _mesa_free(removeInst); - if (dbg) { - _mesa_printf("Optimize: End dead code removal. %u instructions removed\n", rem); + _mesa_printf("Optimize: End dead code removal.\n"); + _mesa_printf(" %u channel writes removed\n", rem); + _mesa_printf(" %u instructions removed\n", rem); /*_mesa_print_program(prog);*/ } + +done: + _mesa_free(removeInst); } -- cgit v1.2.3 From e4e312d493847e07ced026b93d2b588b8036ae02 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sat, 16 May 2009 01:47:44 -0700 Subject: mesa: Add an optimization path to remove use of pointless MOVs. GLSL code such as: vec4 result = {0, 1, 0, 0}; gl_FragColor = result; emits code like: 0: MOV TEMP[0], CONST[0]; 1: MOV OUTPUT[1], TEMP[0]; and this replaces it with: 0: MOV TEMP[0], CONST[0]; 1: MOV OUTPUT[1], CONST[0]; Even when the dead code eliminator fails to clean up a now-useless MOV instruction (since it doesn't do live/dead ranges), this should at reduce dependencies. --- src/mesa/shader/prog_optimize.c | 84 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 83 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/prog_optimize.c b/src/mesa/shader/prog_optimize.c index e627715b5a..5aff16be46 100644 --- a/src/mesa/shader/prog_optimize.c +++ b/src/mesa/shader/prog_optimize.c @@ -38,7 +38,6 @@ static GLboolean dbg = GL_FALSE; - /** * In 'prog' remove instruction[i] if removeFlags[i] == TRUE. * \return number of instructions removed @@ -354,6 +353,87 @@ find_next_temp_use(const struct gl_program *prog, GLuint start, GLuint index) } +/** + * Try to remove use of extraneous MOV instructions, to free them up for dead + * code removal. + */ +static void +_mesa_remove_extra_move_use(struct gl_program *prog) +{ + GLuint i; + + if (dbg) { + _mesa_printf("Optimize: Begin remove extra move use\n"); + _mesa_print_program(prog); + } + + /* + * Look for sequences such as this: + * MOV tmpX, arg0; + * FOO tmpY, tmpX, arg1; + * and convert into: + * MOV tmpX, arg0; + * FOO tmpY, arg0, arg1; + */ + + for (i = 0; i < prog->NumInstructions - 1; i++) { + const struct prog_instruction *mov = prog->Instructions + i; + struct prog_instruction *inst2 = prog->Instructions + i + 1; + int arg; + + if (mov->Opcode != OPCODE_MOV || + mov->DstReg.File != PROGRAM_TEMPORARY || + mov->DstReg.RelAddr || + mov->DstReg.CondMask != COND_TR || + mov->SaturateMode != SATURATE_OFF) + continue; + + for (arg = 0; arg < _mesa_num_inst_src_regs(inst2->Opcode); arg++) { + int comp; + + if (inst2->SrcReg[arg].File != mov->DstReg.File || + inst2->SrcReg[arg].Index != mov->DstReg.Index || + inst2->SrcReg[arg].RelAddr || + inst2->SrcReg[arg].Abs) + continue; + + /* Check that all the sources for this arg of inst2 come from inst1 + * or constants. + */ + for (comp = 0; comp < 4; comp++) { + int src_swz = GET_SWZ(inst2->SrcReg[arg].Swizzle, comp); + + /* If the MOV didn't write that channel, can't use it. */ + if (src_swz <= SWIZZLE_W && + (mov->DstReg.WriteMask & (1 << src_swz)) == 0) + break; + } + if (comp != 4) + continue; + + /* Adjust the swizzles of inst2 to point at MOV's source */ + for (comp = 0; comp < 4; comp++) { + int inst2_swz = GET_SWZ(inst2->SrcReg[arg].Swizzle, comp); + + if (inst2_swz <= SWIZZLE_W) { + GLuint s = GET_SWZ(mov->SrcReg[0].Swizzle, inst2_swz); + inst2->SrcReg[arg].Swizzle &= ~(7 << (3 * comp)); + inst2->SrcReg[arg].Swizzle |= s << (3 * comp); + inst2->SrcReg[arg].Negate ^= (((mov->SrcReg[0].Negate >> + inst2_swz) & 0x1) << comp); + } + } + inst2->SrcReg[arg].File = mov->SrcReg[0].File; + inst2->SrcReg[arg].Index = mov->SrcReg[0].Index; + } + } + + if (dbg) { + _mesa_printf("Optimize: End remove extra move use.\n"); + /*_mesa_print_program(prog);*/ + } +} + /** * Try to remove extraneous MOV instructions from the given program. */ @@ -851,6 +931,8 @@ _mesa_reallocate_registers(struct gl_program *prog) void _mesa_optimize_program(GLcontext *ctx, struct gl_program *program) { + _mesa_remove_extra_move_use(program); + if (1) _mesa_remove_dead_code(program); -- cgit v1.2.3 From f3cacfe216fb58b913bbc23de49d696a33da69e1 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 6 Nov 2009 13:04:54 -0800 Subject: mesa: Fix remove_instructions to successfully remove when removeFlags[0]. This fixes the dead code elimination to work on the particular code mentioned in the previous commit. --- src/mesa/shader/prog_optimize.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/shader/prog_optimize.c b/src/mesa/shader/prog_optimize.c index 5aff16be46..b4658cb37f 100644 --- a/src/mesa/shader/prog_optimize.c +++ b/src/mesa/shader/prog_optimize.c @@ -73,6 +73,12 @@ remove_instructions(struct gl_program *prog, const GLboolean *removeFlags) } } } + /* Finish removing if the first instruction was to be removed. */ + if (removeCount > 0) { + GLint removeStart = removeEnd - removeCount + 1; + _mesa_delete_instructions(prog, removeStart, removeCount); + removeStart = removeCount = 0; /* reset removal info */ + } return totalRemoved; } -- cgit v1.2.3 From 6b0bcfafab7b380ee71da1a7754f4c09614811d6 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 6 Nov 2009 14:06:08 -0800 Subject: mesa: Reduce the source channels considered in optimization passes. Depending on the writemask or the opcode, we can often trim the source channels considered used for dead code elimination. This saves actual instructions on 965 in the non-GLSL path for glean glsl1, and cleans up the writemasks of programs even further. --- src/mesa/shader/prog_optimize.c | 41 ++++++++++++++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/prog_optimize.c b/src/mesa/shader/prog_optimize.c index b4658cb37f..94d3dce6ea 100644 --- a/src/mesa/shader/prog_optimize.c +++ b/src/mesa/shader/prog_optimize.c @@ -38,6 +38,39 @@ static GLboolean dbg = GL_FALSE; +/* Returns the mask of channels read from the given srcreg in this instruction. + */ +static GLuint +get_src_arg_mask(const struct prog_instruction *inst, int arg) +{ + int writemask = inst->DstReg.WriteMask; + + if (inst->CondUpdate) + writemask = WRITEMASK_XYZW; + + switch (inst->Opcode) { + case OPCODE_MOV: + case OPCODE_ABS: + case OPCODE_ADD: + case OPCODE_MUL: + case OPCODE_SUB: + return writemask; + case OPCODE_RCP: + case OPCODE_SIN: + case OPCODE_COS: + case OPCODE_RSQ: + case OPCODE_POW: + case OPCODE_EX2: + return WRITEMASK_X; + case OPCODE_DP2: + return WRITEMASK_XY; + case OPCODE_DP3: + return WRITEMASK_XYZ; + default: + return WRITEMASK_XYZW; + } +} + /** * In 'prog' remove instruction[i] if removeFlags[i] == TRUE. * \return number of instructions removed @@ -217,6 +250,7 @@ _mesa_remove_dead_code(struct gl_program *prog) if (inst->SrcReg[j].File == PROGRAM_TEMPORARY) { const GLuint index = inst->SrcReg[j].Index; ASSERT(index < MAX_PROGRAM_TEMPS); + int read_mask = get_src_arg_mask(inst, j); if (inst->SrcReg[j].RelAddr) { if (dbg) @@ -227,6 +261,9 @@ _mesa_remove_dead_code(struct gl_program *prog) for (comp = 0; comp < 4; comp++) { GLuint swz = (inst->SrcReg[j].Swizzle >> (3 * comp)) & 0x7; + if ((read_mask & (1 << comp)) == 0) + continue; + switch (swz) { case SWIZZLE_X: tempRead[index][0] = GL_TRUE; @@ -396,6 +433,7 @@ _mesa_remove_extra_move_use(struct gl_program *prog) for (arg = 0; arg < _mesa_num_inst_src_regs(inst2->Opcode); arg++) { int comp; + int read_mask = get_src_arg_mask(inst2, arg); if (inst2->SrcReg[arg].File != mov->DstReg.File || inst2->SrcReg[arg].Index != mov->DstReg.Index || @@ -410,7 +448,8 @@ _mesa_remove_extra_move_use(struct gl_program *prog) int src_swz = GET_SWZ(inst2->SrcReg[arg].Swizzle, comp); /* If the MOV didn't write that channel, can't use it. */ - if (src_swz <= SWIZZLE_W && + if ((read_mask & (1 << comp)) && + src_swz <= SWIZZLE_W && (mov->DstReg.WriteMask & (1 << src_swz)) == 0) break; } -- cgit v1.2.3 From 0f34cdf6210b748db77c5eba2993637f4af6faeb Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 12 Aug 2009 12:56:35 -0700 Subject: i965: Collect GLSL src/dst regs up in generic code. This matches brw_wm_emit.c, which we'll be using shortly. There's a possible penalty here in that we'll allocate registers for unused channels, since we aren't doing ref tracking like brw_wm_pass*.c does. However, my measurements on GM965 don't show any for either OA or UT2004 with the GLSL path forced. --- src/mesa/drivers/dri/i965/brw_wm.h | 2 ++ src/mesa/drivers/dri/i965/brw_wm_glsl.c | 22 +++++++++++++++------- 2 files changed, 17 insertions(+), 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index 47aa4da306..f841d25870 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -162,6 +162,8 @@ struct brw_wm_instruction { #define BRW_WM_MAX_CONST 256 #define BRW_WM_MAX_SUBROUTINE 16 +/* used in masks next to WRITEMASK_*. */ +#define SATURATE (1<<5) /* New opcodes to track internal operations required for WM unit. diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index 28d6d4eba5..fd6d6c5602 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -2771,6 +2771,21 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) if (c->fp->use_const_buffer) fetch_constants(c, inst); + if (inst->Opcode != OPCODE_ARL) { + for (j = 0; j < 4; j++) { + if (inst->DstReg.WriteMask & (1 << j)) + dst[j] = get_dst_reg(c, inst, j); + else + dst[j] = brw_null_reg(); + } + } + for (j = 0; j < brw_wm_nr_args(inst->Opcode); j++) + get_argument_regs(c, inst, j, args[j], WRITEMASK_XYZW); + + dst_flags = inst->DstReg.WriteMask; + if (inst->SaturateMode == SATURATE_ZERO_ONE) + dst_flags |= SATURATE; + if (inst->CondUpdate) brw_set_conditionalmod(p, BRW_CONDITIONAL_NZ); else @@ -2866,13 +2881,6 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) break; case OPCODE_DDX: case OPCODE_DDY: - for (j = 0; j < 4; j++) { - if (inst->DstReg.WriteMask & (1 << j)) - dst[j] = get_dst_reg(c, inst, j); - else - dst[j] = brw_null_reg(); - } - get_argument_regs(c, inst, 0, args[0], WRITEMASK_XYZW); emit_ddxy(p, dst, dst_flags, (inst->Opcode == OPCODE_DDX), args[0]); break; -- cgit v1.2.3 From 71af5080722afcbbb8a935138d95214ef7afe219 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 11 Aug 2009 16:31:19 -0700 Subject: i965: Share basic ALU ops between brw_wm_glsl and brw_wm_emit.c This drops support for get_src_reg_imm in these, but the prospect of getting brw_wm_pass*.c onto our GLSL path is well worth some temporary pain. --- src/mesa/drivers/dri/i965/brw_wm.h | 17 +++++ src/mesa/drivers/dri/i965/brw_wm_emit.c | 32 +++++----- src/mesa/drivers/dri/i965/brw_wm_glsl.c | 106 ++------------------------------ 3 files changed, 38 insertions(+), 117 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index f841d25870..93f79dbfe5 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -308,6 +308,23 @@ void brw_wm_lookup_iz( GLuint line_aa, GLboolean brw_wm_is_glsl(const struct gl_fragment_program *fp); void brw_wm_glsl_emit(struct brw_context *brw, struct brw_wm_compile *c); +/* brw_wm_emit.c */ +void emit_alu1(struct brw_compile *p, + struct brw_instruction *(*func)(struct brw_compile *, + struct brw_reg, + struct brw_reg), + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0); +void emit_alu2(struct brw_compile *p, + struct brw_instruction *(*func)(struct brw_compile *, + struct brw_reg, + struct brw_reg, + struct brw_reg), + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0, + const struct brw_reg *arg1); void emit_ddxy(struct brw_compile *p, const struct brw_reg *dst, GLuint mask, diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index bf80a2942a..5e41a3f571 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -352,13 +352,13 @@ void emit_ddxy(struct brw_compile *p, brw_set_saturate(p, 0); } -static void emit_alu1( struct brw_compile *p, - struct brw_instruction *(*func)(struct brw_compile *, - struct brw_reg, - struct brw_reg), - const struct brw_reg *dst, - GLuint mask, - const struct brw_reg *arg0 ) +void emit_alu1(struct brw_compile *p, + struct brw_instruction *(*func)(struct brw_compile *, + struct brw_reg, + struct brw_reg), + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0) { GLuint i; @@ -376,15 +376,15 @@ static void emit_alu1( struct brw_compile *p, } -static void emit_alu2( struct brw_compile *p, - struct brw_instruction *(*func)(struct brw_compile *, - struct brw_reg, - struct brw_reg, - struct brw_reg), - const struct brw_reg *dst, - GLuint mask, - const struct brw_reg *arg0, - const struct brw_reg *arg1 ) +void emit_alu2(struct brw_compile *p, + struct brw_instruction *(*func)(struct brw_compile *, + struct brw_reg, + struct brw_reg, + struct brw_reg), + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0, + const struct brw_reg *arg1) { GLuint i; diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index fd6d6c5602..fdd31d4ed5 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -668,26 +668,6 @@ static void emit_trunc( struct brw_wm_compile *c, brw_set_saturate(p, 0); } -static void emit_mov( struct brw_wm_compile *c, - const struct prog_instruction *inst) -{ - int i; - struct brw_compile *p = &c->func; - GLuint mask = inst->DstReg.WriteMask; - brw_set_saturate(p, inst->SaturateMode != SATURATE_OFF); - for (i = 0; i < 4; i++) { - if (mask & (1<func; - struct brw_reg src0, src1, dst; - GLuint mask = inst->DstReg.WriteMask; - int i; - brw_set_saturate(p, (inst->SaturateMode != SATURATE_OFF) ? 1 : 0); - for (i = 0 ; i < 4; i++) { - if (mask & (1<func; - struct brw_reg src0, src1, dst; - GLuint mask = inst->DstReg.WriteMask; - int i; - brw_set_saturate(p, (inst->SaturateMode != SATURATE_OFF) ? 1 : 0); - for (i = 0 ; i < 4; i++) { - if (mask & (1<func; - struct brw_reg src0, dst; - GLuint mask = inst->DstReg.WriteMask; - int i; - brw_set_saturate(p, (inst->SaturateMode != SATURATE_OFF) ? 1 : 0); - for (i = 0 ; i < 4; i++) { - if (mask & (1<SaturateMode != SATURATE_OFF) - brw_set_saturate(p, 0); -} - -static void emit_flr(struct brw_wm_compile *c, - const struct prog_instruction *inst) -{ - struct brw_compile *p = &c->func; - struct brw_reg src0, dst; - GLuint mask = inst->DstReg.WriteMask; - int i; - brw_set_saturate(p, (inst->SaturateMode != SATURATE_OFF) ? 1 : 0); - for (i = 0 ; i < 4; i++) { - if (mask & (1< Date: Tue, 11 Aug 2009 16:47:15 -0700 Subject: i965: Use a normal alu1 emit for OPCODE_TRUNC. --- src/mesa/drivers/dri/i965/brw_wm_emit.c | 16 +--------------- src/mesa/drivers/dri/i965/brw_wm_glsl.c | 20 +------------------- 2 files changed, 2 insertions(+), 34 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index 5e41a3f571..215515d10b 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -422,20 +422,6 @@ static void emit_mad( struct brw_compile *p, } } -static void emit_trunc( struct brw_compile *p, - const struct brw_reg *dst, - GLuint mask, - const struct brw_reg *arg0) -{ - GLuint i; - - for (i = 0; i < 4; i++) { - if (mask & (1<func; - GLuint mask = inst->DstReg.WriteMask; - brw_set_saturate(p, inst->SaturateMode != SATURATE_OFF); - for (i = 0; i < 4; i++) { - if (mask & (1< Date: Tue, 11 Aug 2009 17:52:44 -0700 Subject: i965: Add generic GLSL code for unaliasing a 3-arg opcode, and share LRP code. --- src/mesa/drivers/dri/i965/brw_wm.h | 6 ++ src/mesa/drivers/dri/i965/brw_wm_emit.c | 12 ++-- src/mesa/drivers/dri/i965/brw_wm_glsl.c | 98 ++++++++++++++++++++------------- 3 files changed, 71 insertions(+), 45 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index 93f79dbfe5..66902bab65 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -330,5 +330,11 @@ void emit_ddxy(struct brw_compile *p, GLuint mask, GLboolean is_ddx, const struct brw_reg *arg0); +void emit_lrp(struct brw_compile *p, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0, + const struct brw_reg *arg1, + const struct brw_reg *arg2); #endif diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index 215515d10b..9e637ef3f2 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -422,12 +422,12 @@ static void emit_mad( struct brw_compile *p, } } -static void emit_lrp( struct brw_compile *p, - const struct brw_reg *dst, - GLuint mask, - const struct brw_reg *arg0, - const struct brw_reg *arg1, - const struct brw_reg *arg2 ) +void emit_lrp(struct brw_compile *p, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0, + const struct brw_reg *arg1, + const struct brw_reg *arg2) { GLuint i; diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index cd5a59463c..458d06187a 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -650,6 +650,63 @@ static void invoke_subroutine( struct brw_wm_compile *c, } } +/* Workaround for using brw_wm_emit.c's emit functions, which expect + * destination regs to be uniquely written. Moves arguments out to + * temporaries as necessary for instructions which use their destination as + * a temporary. + */ +static void +unalias3(struct brw_wm_compile *c, + void (*func)(struct brw_compile *c, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0, + const struct brw_reg *arg1, + const struct brw_reg *arg2), + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0, + const struct brw_reg *arg1, + const struct brw_reg *arg2) +{ + struct brw_compile *p = &c->func; + struct brw_reg tmp_arg0[4], tmp_arg1[4], tmp_arg2[4]; + int i, j; + int mark = mark_tmps(c); + + for (j = 0; j < 4; j++) { + tmp_arg0[j] = arg0[j]; + tmp_arg1[j] = arg1[j]; + tmp_arg2[j] = arg2[j]; + } + + for (i = 0; i < 4; i++) { + if (mask & (1<func; - GLuint mask = inst->DstReg.WriteMask; - struct brw_reg dst, tmp1, tmp2, src0, src1, src2; - int i; - int mark = mark_tmps(c); - for (i = 0; i < 4; i++) { - if (mask & (1<SaturateMode != SATURATE_OFF) ? 1 : 0); - brw_MAC(p, dst, src0, tmp1); - brw_set_saturate(p, 0); - } - release_tmps(c, mark); - } -} - /** * For GLSL shaders, this KIL will be unconditional. * It may be contained inside an IF/ENDIF structure of course. @@ -2722,7 +2741,8 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) emit_alu1(p, brw_RNDD, dst, dst_flags, args[0]); break; case OPCODE_LRP: - emit_lrp(c, inst); + unalias3(c, emit_lrp, + dst, dst_flags, args[0], args[1], args[2]); break; case OPCODE_TRUNC: emit_alu1(p, brw_RNDZ, dst, dst_flags, args[0]); -- cgit v1.2.3 From bad5b120be8de37cf8481d865790298fd9651381 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 11 Aug 2009 19:13:52 -0700 Subject: i965: Share the DP3, DP4, and DPH between brw_wm_glsl.c and brw_wm_emit.c --- src/mesa/drivers/dri/i965/brw_wm.h | 15 ++++++ src/mesa/drivers/dri/i965/brw_wm_emit.c | 30 ++++++------ src/mesa/drivers/dri/i965/brw_wm_glsl.c | 87 ++------------------------------- 3 files changed, 33 insertions(+), 99 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index 66902bab65..18f17f2488 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -330,6 +330,21 @@ void emit_ddxy(struct brw_compile *p, GLuint mask, GLboolean is_ddx, const struct brw_reg *arg0); +void emit_dp3(struct brw_compile *p, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0, + const struct brw_reg *arg1); +void emit_dp4(struct brw_compile *p, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0, + const struct brw_reg *arg1); +void emit_dph(struct brw_compile *p, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0, + const struct brw_reg *arg1); void emit_lrp(struct brw_compile *p, const struct brw_reg *dst, GLuint mask, diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index 9e637ef3f2..bc5abb942b 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -594,11 +594,11 @@ static void emit_min( struct brw_compile *p, } -static void emit_dp3( struct brw_compile *p, - const struct brw_reg *dst, - GLuint mask, - const struct brw_reg *arg0, - const struct brw_reg *arg1 ) +void emit_dp3(struct brw_compile *p, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0, + const struct brw_reg *arg1) { int dst_chan = _mesa_ffs(mask & WRITEMASK_XYZW) - 1; @@ -616,11 +616,11 @@ static void emit_dp3( struct brw_compile *p, } -static void emit_dp4( struct brw_compile *p, - const struct brw_reg *dst, - GLuint mask, - const struct brw_reg *arg0, - const struct brw_reg *arg1 ) +void emit_dp4(struct brw_compile *p, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0, + const struct brw_reg *arg1) { int dst_chan = _mesa_ffs(mask & WRITEMASK_XYZW) - 1; @@ -639,11 +639,11 @@ static void emit_dp4( struct brw_compile *p, } -static void emit_dph( struct brw_compile *p, - const struct brw_reg *dst, - GLuint mask, - const struct brw_reg *arg0, - const struct brw_reg *arg1 ) +void emit_dph(struct brw_compile *p, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0, + const struct brw_reg *arg1) { const int dst_chan = _mesa_ffs(mask & WRITEMASK_XYZW) - 1; diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index 458d06187a..536eac8851 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -1038,87 +1038,6 @@ static void emit_xpd(struct brw_wm_compile *c, brw_set_saturate(p, 0); } -static void emit_dp3(struct brw_wm_compile *c, - const struct prog_instruction *inst) -{ - struct brw_reg src0[3], src1[3], dst; - int i; - struct brw_compile *p = &c->func; - GLuint mask = inst->DstReg.WriteMask; - int dst_chan = _mesa_ffs(mask & WRITEMASK_XYZW) - 1; - - if (!(mask & WRITEMASK_XYZW)) - return; - - assert(is_power_of_two(mask & WRITEMASK_XYZW)); - - for (i = 0; i < 3; i++) { - src0[i] = get_src_reg(c, inst, 0, i); - src1[i] = get_src_reg_imm(c, inst, 1, i); - } - - dst = get_dst_reg(c, inst, dst_chan); - brw_MUL(p, brw_null_reg(), src0[0], src1[0]); - brw_MAC(p, brw_null_reg(), src0[1], src1[1]); - brw_set_saturate(p, (inst->SaturateMode != SATURATE_OFF) ? 1 : 0); - brw_MAC(p, dst, src0[2], src1[2]); - brw_set_saturate(p, 0); -} - -static void emit_dp4(struct brw_wm_compile *c, - const struct prog_instruction *inst) -{ - struct brw_reg src0[4], src1[4], dst; - int i; - struct brw_compile *p = &c->func; - GLuint mask = inst->DstReg.WriteMask; - int dst_chan = _mesa_ffs(mask & WRITEMASK_XYZW) - 1; - - if (!(mask & WRITEMASK_XYZW)) - return; - - assert(is_power_of_two(mask & WRITEMASK_XYZW)); - - for (i = 0; i < 4; i++) { - src0[i] = get_src_reg(c, inst, 0, i); - src1[i] = get_src_reg_imm(c, inst, 1, i); - } - dst = get_dst_reg(c, inst, dst_chan); - brw_MUL(p, brw_null_reg(), src0[0], src1[0]); - brw_MAC(p, brw_null_reg(), src0[1], src1[1]); - brw_MAC(p, brw_null_reg(), src0[2], src1[2]); - brw_set_saturate(p, (inst->SaturateMode != SATURATE_OFF) ? 1 : 0); - brw_MAC(p, dst, src0[3], src1[3]); - brw_set_saturate(p, 0); -} - -static void emit_dph(struct brw_wm_compile *c, - const struct prog_instruction *inst) -{ - struct brw_reg src0[4], src1[4], dst; - int i; - struct brw_compile *p = &c->func; - GLuint mask = inst->DstReg.WriteMask; - int dst_chan = _mesa_ffs(mask & WRITEMASK_XYZW) - 1; - - if (!(mask & WRITEMASK_XYZW)) - return; - - assert(is_power_of_two(mask & WRITEMASK_XYZW)); - - for (i = 0; i < 4; i++) { - src0[i] = get_src_reg(c, inst, 0, i); - src1[i] = get_src_reg_imm(c, inst, 1, i); - } - dst = get_dst_reg(c, inst, dst_chan); - brw_MUL(p, brw_null_reg(), src0[0], src1[0]); - brw_MAC(p, brw_null_reg(), src0[1], src1[1]); - brw_MAC(p, dst, src0[2], src1[2]); - brw_set_saturate(p, (inst->SaturateMode != SATURATE_OFF) ? 1 : 0); - brw_ADD(p, dst, dst, src1[3]); - brw_set_saturate(p, 0); -} - /** * Emit a scalar instruction, like RCP, RSQ, LOG, EXP. * Note that the result of the function is smeared across the dest @@ -2752,16 +2671,16 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) emit_alu1(p, brw_MOV, dst, dst_flags, args[0]); break; case OPCODE_DP3: - emit_dp3(c, inst); + emit_dp3(p, dst, dst_flags, args[0], args[1]); break; case OPCODE_DP4: - emit_dp4(c, inst); + emit_dp4(p, dst, dst_flags, args[0], args[1]); break; case OPCODE_XPD: emit_xpd(c, inst); break; case OPCODE_DPH: - emit_dph(c, inst); + emit_dph(p, dst, dst_flags, args[0], args[1]); break; case OPCODE_RCP: emit_rcp(c, inst); -- cgit v1.2.3 From 726ad1560660a1fc769c87e0ea16f8b3334df0d2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 11 Aug 2009 19:17:31 -0700 Subject: i965: Share OPCODE_MAD between brw_wm_glsl.c and brw_wm_emit.c --- src/mesa/drivers/dri/i965/brw_wm.h | 6 ++++++ src/mesa/drivers/dri/i965/brw_wm_emit.c | 12 ++++++------ src/mesa/drivers/dri/i965/brw_wm_glsl.c | 25 +------------------------ 3 files changed, 13 insertions(+), 30 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index 18f17f2488..e0445aaf52 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -351,5 +351,11 @@ void emit_lrp(struct brw_compile *p, const struct brw_reg *arg0, const struct brw_reg *arg1, const struct brw_reg *arg2); +void emit_mad(struct brw_compile *p, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0, + const struct brw_reg *arg1, + const struct brw_reg *arg2); #endif diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index bc5abb942b..6cdc4f7483 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -402,12 +402,12 @@ void emit_alu2(struct brw_compile *p, } -static void emit_mad( struct brw_compile *p, - const struct brw_reg *dst, - GLuint mask, - const struct brw_reg *arg0, - const struct brw_reg *arg1, - const struct brw_reg *arg2 ) +void emit_mad(struct brw_compile *p, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0, + const struct brw_reg *arg1, + const struct brw_reg *arg2) { GLuint i; diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index 536eac8851..55e3e9fa7f 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -1214,29 +1214,6 @@ static void emit_kil(struct brw_wm_compile *c) brw_pop_insn_state(p); } -static void emit_mad(struct brw_wm_compile *c, - const struct prog_instruction *inst) -{ - struct brw_compile *p = &c->func; - GLuint mask = inst->DstReg.WriteMask; - struct brw_reg dst, src0, src1, src2; - int i; - - for (i = 0; i < 4; i++) { - if (mask & (1<SaturateMode != SATURATE_OFF) ? 1 : 0); - brw_ADD(p, dst, dst, src2); - brw_set_saturate(p, 0); - } - } -} - static void emit_sop(struct brw_wm_compile *c, const struct prog_instruction *inst, GLuint cond) { @@ -2734,7 +2711,7 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) emit_pow(c, inst); break; case OPCODE_MAD: - emit_mad(c, inst); + emit_mad(p, dst, dst_flags, args[0], args[1], args[2]); break; case OPCODE_NOISE1: emit_noise1(c, inst); -- cgit v1.2.3 From 7059aa0eff9ff6ec361e584b413f63b25762a89c Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 11 Aug 2009 21:17:14 -0700 Subject: i965: Share the sop opcodes between brw_wm_glsl.c and brw_wm_emit.c. --- src/mesa/drivers/dri/i965/brw_wm.h | 6 +++ src/mesa/drivers/dri/i965/brw_wm_emit.c | 19 ++++---- src/mesa/drivers/dri/i965/brw_wm_glsl.c | 78 +++++---------------------------- 3 files changed, 29 insertions(+), 74 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index e0445aaf52..df8e467aaf 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -357,5 +357,11 @@ void emit_mad(struct brw_compile *p, const struct brw_reg *arg0, const struct brw_reg *arg1, const struct brw_reg *arg2); +void emit_sop(struct brw_compile *p, + const struct brw_reg *dst, + GLuint mask, + GLuint cond, + const struct brw_reg *arg0, + const struct brw_reg *arg1); #endif diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index 6cdc4f7483..41ebadb553 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -447,21 +447,24 @@ void emit_lrp(struct brw_compile *p, } } -static void emit_sop( struct brw_compile *p, - const struct brw_reg *dst, - GLuint mask, - GLuint cond, - const struct brw_reg *arg0, - const struct brw_reg *arg1 ) +void emit_sop(struct brw_compile *p, + const struct brw_reg *dst, + GLuint mask, + GLuint cond, + const struct brw_reg *arg0, + const struct brw_reg *arg1) { GLuint i; for (i = 0; i < 4; i++) { if (mask & (1<func; - GLuint mask = inst->DstReg.WriteMask; - struct brw_reg dst, src0, src1; - int i; - - for (i = 0; i < 4; i++) { - if (mask & (1< Date: Wed, 12 Aug 2009 09:52:44 -0700 Subject: i965: Share math functions between brw_wm_glsl.c and brw_wm_emit.c. --- src/mesa/drivers/dri/i965/brw_wm.h | 16 +++ src/mesa/drivers/dri/i965/brw_wm_emit.c | 139 +++++++++++++++---------- src/mesa/drivers/dri/i965/brw_wm_glsl.c | 177 ++------------------------------ 3 files changed, 111 insertions(+), 221 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index df8e467aaf..7d470e8dfe 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -357,11 +357,27 @@ void emit_mad(struct brw_compile *p, const struct brw_reg *arg0, const struct brw_reg *arg1, const struct brw_reg *arg2); +void emit_math1(struct brw_wm_compile *c, + GLuint function, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0); +void emit_math2(struct brw_wm_compile *c, + GLuint function, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0, + const struct brw_reg *arg1); void emit_sop(struct brw_compile *p, const struct brw_reg *dst, GLuint mask, GLuint cond, const struct brw_reg *arg0, const struct brw_reg *arg1); +void emit_xpd(struct brw_compile *p, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0, + const struct brw_reg *arg1); #endif diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index 41ebadb553..763fe4b4d6 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -665,11 +665,11 @@ void emit_dph(struct brw_compile *p, } -static void emit_xpd( struct brw_compile *p, - const struct brw_reg *dst, - GLuint mask, - const struct brw_reg *arg0, - const struct brw_reg *arg1 ) +void emit_xpd(struct brw_compile *p, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0, + const struct brw_reg *arg1) { GLuint i; @@ -690,41 +690,68 @@ static void emit_xpd( struct brw_compile *p, } -static void emit_math1( struct brw_compile *p, - GLuint function, - const struct brw_reg *dst, - GLuint mask, - const struct brw_reg *arg0 ) +void emit_math1(struct brw_wm_compile *c, + GLuint function, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0) { + struct brw_compile *p = &c->func; int dst_chan = _mesa_ffs(mask & WRITEMASK_XYZW) - 1; + GLuint saturate = ((mask & SATURATE) ? + BRW_MATH_SATURATE_SATURATE : + BRW_MATH_SATURATE_NONE); if (!(mask & WRITEMASK_XYZW)) return; /* Do not emit dead code */ assert(is_power_of_two(mask & WRITEMASK_XYZW)); + /* If compressed, this will write message reg 2,3 from arg0.x's 16 + * channels. + */ brw_MOV(p, brw_message_reg(2), arg0[0]); /* Send two messages to perform all 16 operations: */ - brw_math_16(p, - dst[dst_chan], + brw_push_insn_state(p); + brw_set_compression_control(p, BRW_COMPRESSION_NONE); + brw_math(p, + dst[dst_chan], + function, + saturate, + 2, + brw_null_reg(), + BRW_MATH_DATA_VECTOR, + BRW_MATH_PRECISION_FULL); + + if (c->dispatch_width == 16) { + brw_set_compression_control(p, BRW_COMPRESSION_2NDHALF); + brw_math(p, + offset(dst[dst_chan],1), function, - (mask & SATURATE) ? BRW_MATH_SATURATE_SATURATE : BRW_MATH_SATURATE_NONE, - 2, + saturate, + 3, brw_null_reg(), + BRW_MATH_DATA_VECTOR, BRW_MATH_PRECISION_FULL); + } + brw_pop_insn_state(p); } -static void emit_math2( struct brw_compile *p, - GLuint function, - const struct brw_reg *dst, - GLuint mask, - const struct brw_reg *arg0, - const struct brw_reg *arg1) +void emit_math2(struct brw_wm_compile *c, + GLuint function, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0, + const struct brw_reg *arg1) { + struct brw_compile *p = &c->func; int dst_chan = _mesa_ffs(mask & WRITEMASK_XYZW) - 1; + GLuint saturate = ((mask & SATURATE) ? + BRW_MATH_SATURATE_SATURATE : + BRW_MATH_SATURATE_NONE); if (!(mask & WRITEMASK_XYZW)) return; /* Do not emit dead code */ @@ -735,37 +762,41 @@ static void emit_math2( struct brw_compile *p, brw_set_compression_control(p, BRW_COMPRESSION_NONE); brw_MOV(p, brw_message_reg(2), arg0[0]); - brw_set_compression_control(p, BRW_COMPRESSION_2NDHALF); - brw_MOV(p, brw_message_reg(4), sechalf(arg0[0])); + if (c->dispatch_width == 16) { + brw_set_compression_control(p, BRW_COMPRESSION_2NDHALF); + brw_MOV(p, brw_message_reg(4), sechalf(arg0[0])); + } brw_set_compression_control(p, BRW_COMPRESSION_NONE); brw_MOV(p, brw_message_reg(3), arg1[0]); - brw_set_compression_control(p, BRW_COMPRESSION_2NDHALF); - brw_MOV(p, brw_message_reg(5), sechalf(arg1[0])); + if (c->dispatch_width == 16) { + brw_set_compression_control(p, BRW_COMPRESSION_2NDHALF); + brw_MOV(p, brw_message_reg(5), sechalf(arg1[0])); + } - - /* Send two messages to perform all 16 operations: - */ brw_set_compression_control(p, BRW_COMPRESSION_NONE); brw_math(p, dst[dst_chan], function, - (mask & SATURATE) ? BRW_MATH_SATURATE_SATURATE : BRW_MATH_SATURATE_NONE, + saturate, 2, brw_null_reg(), BRW_MATH_DATA_VECTOR, BRW_MATH_PRECISION_FULL); - brw_set_compression_control(p, BRW_COMPRESSION_2NDHALF); - brw_math(p, - offset(dst[dst_chan],1), - function, - (mask & SATURATE) ? BRW_MATH_SATURATE_SATURATE : BRW_MATH_SATURATE_NONE, - 4, - brw_null_reg(), - BRW_MATH_DATA_VECTOR, - BRW_MATH_PRECISION_FULL); - + /* Send two messages to perform all 16 operations: + */ + if (c->dispatch_width == 16) { + brw_set_compression_control(p, BRW_COMPRESSION_2NDHALF); + brw_math(p, + offset(dst[dst_chan],1), + function, + saturate, + 4, + brw_null_reg(), + BRW_MATH_DATA_VECTOR, + BRW_MATH_PRECISION_FULL); + } brw_pop_insn_state(p); } @@ -909,11 +940,13 @@ static void emit_txb( struct brw_wm_compile *c, } -static void emit_lit( struct brw_compile *p, - const struct brw_reg *dst, - GLuint mask, - const struct brw_reg *arg0 ) +static void emit_lit(struct brw_wm_compile *c, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0) { + struct brw_compile *p = &c->func; + assert((mask & WRITEMASK_XW) == 0); if (mask & WRITEMASK_Y) { @@ -923,7 +956,7 @@ static void emit_lit( struct brw_compile *p, } if (mask & WRITEMASK_Z) { - emit_math2(p, BRW_MATH_FUNCTION_POW, + emit_math2(c, BRW_MATH_FUNCTION_POW, &dst[2], WRITEMASK_X | (mask & SATURATE), &arg0[1], @@ -1380,27 +1413,27 @@ void brw_wm_emit( struct brw_wm_compile *c ) /* Higher math functions: */ case OPCODE_RCP: - emit_math1(p, BRW_MATH_FUNCTION_INV, dst, dst_flags, args[0]); + emit_math1(c, BRW_MATH_FUNCTION_INV, dst, dst_flags, args[0]); break; case OPCODE_RSQ: - emit_math1(p, BRW_MATH_FUNCTION_RSQ, dst, dst_flags, args[0]); + emit_math1(c, BRW_MATH_FUNCTION_RSQ, dst, dst_flags, args[0]); break; case OPCODE_SIN: - emit_math1(p, BRW_MATH_FUNCTION_SIN, dst, dst_flags, args[0]); + emit_math1(c, BRW_MATH_FUNCTION_SIN, dst, dst_flags, args[0]); break; case OPCODE_COS: - emit_math1(p, BRW_MATH_FUNCTION_COS, dst, dst_flags, args[0]); + emit_math1(c, BRW_MATH_FUNCTION_COS, dst, dst_flags, args[0]); break; case OPCODE_EX2: - emit_math1(p, BRW_MATH_FUNCTION_EXP, dst, dst_flags, args[0]); + emit_math1(c, BRW_MATH_FUNCTION_EXP, dst, dst_flags, args[0]); break; case OPCODE_LG2: - emit_math1(p, BRW_MATH_FUNCTION_LOG, dst, dst_flags, args[0]); + emit_math1(c, BRW_MATH_FUNCTION_LOG, dst, dst_flags, args[0]); break; case OPCODE_SCS: @@ -1408,13 +1441,13 @@ void brw_wm_emit( struct brw_wm_compile *c ) * fixup for 16-element execution. */ if (dst_flags & WRITEMASK_X) - emit_math1(p, BRW_MATH_FUNCTION_COS, dst, (dst_flags&SATURATE)|WRITEMASK_X, args[0]); + emit_math1(c, BRW_MATH_FUNCTION_COS, dst, (dst_flags&SATURATE)|WRITEMASK_X, args[0]); if (dst_flags & WRITEMASK_Y) - emit_math1(p, BRW_MATH_FUNCTION_SIN, dst+1, (dst_flags&SATURATE)|WRITEMASK_X, args[0]); + emit_math1(c, BRW_MATH_FUNCTION_SIN, dst+1, (dst_flags&SATURATE)|WRITEMASK_X, args[0]); break; case OPCODE_POW: - emit_math2(p, BRW_MATH_FUNCTION_POW, dst, dst_flags, args[0], args[1]); + emit_math2(c, BRW_MATH_FUNCTION_POW, dst, dst_flags, args[0], args[1]); break; /* Comparisons: @@ -1452,7 +1485,7 @@ void brw_wm_emit( struct brw_wm_compile *c ) break; case OPCODE_LIT: - emit_lit(p, dst, dst_flags, args[0]); + emit_lit(c, dst, dst_flags, args[0]); break; /* Texturing operations: diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index 2df47344d5..02b119154f 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -550,42 +550,6 @@ static struct brw_reg get_src_reg(struct brw_wm_compile *c, } } - -/** - * Same as \sa get_src_reg() but if the register is a literal, emit - * a brw_reg encoding the literal. - * Note that a brw instruction only allows one src operand to be a literal. - * For instructions with more than one operand, only the second can be a - * literal. This means that we treat some literals as constants/uniforms - * (which why PROGRAM_CONSTANT is checked in fetch_constants()). - * - */ -static struct brw_reg get_src_reg_imm(struct brw_wm_compile *c, - const struct prog_instruction *inst, - GLuint srcRegIndex, GLuint channel) -{ - const struct prog_src_register *src = &inst->SrcReg[srcRegIndex]; - if (src->File == PROGRAM_CONSTANT) { - /* a literal */ - const int component = GET_SWZ(src->Swizzle, channel); - const GLfloat *param = - c->fp->program.Base.Parameters->ParameterValues[src->Index]; - GLfloat value = param[component]; - if (src->Negate & (1 << channel)) - value = -value; - if (src->Abs) - value = FABSF(value); -#if 0 - printf(" form immed value %f for chan %d\n", value, channel); -#endif - return brw_imm_f(value); - } - else { - return get_src_reg(c, inst, srcRegIndex, channel); - } -} - - /** * Subroutines are minimal support for resusable instruction sequences. * They are implemented as simply as possible to minimise overhead: there @@ -1013,100 +977,6 @@ static void emit_frontfacing(struct brw_wm_compile *c, brw_set_predicate_control_flag_value(p, 0xff); } -static void emit_xpd(struct brw_wm_compile *c, - const struct prog_instruction *inst) -{ - int i; - struct brw_compile *p = &c->func; - GLuint mask = inst->DstReg.WriteMask; - for (i = 0; i < 4; i++) { - GLuint i2 = (i+2)%3; - GLuint i1 = (i+1)%3; - if (mask & (1<SaturateMode != SATURATE_OFF); - brw_MAC(p, dst, src0, src1); - brw_set_saturate(p, 0); - } - } - brw_set_saturate(p, 0); -} - -/** - * Emit a scalar instruction, like RCP, RSQ, LOG, EXP. - * Note that the result of the function is smeared across the dest - * register's X, Y, Z and W channels (subject to writemasking of course). - */ -static void emit_math1(struct brw_wm_compile *c, - const struct prog_instruction *inst, GLuint func) -{ - struct brw_compile *p = &c->func; - struct brw_reg src0, dst; - GLuint mask = inst->DstReg.WriteMask; - int dst_chan = _mesa_ffs(mask & WRITEMASK_XYZW) - 1; - - if (!(mask & WRITEMASK_XYZW)) - return; - - assert(is_power_of_two(mask & WRITEMASK_XYZW)); - - /* Get first component of source register */ - dst = get_dst_reg(c, inst, dst_chan); - src0 = get_src_reg(c, inst, 0, 0); - - brw_MOV(p, brw_message_reg(2), src0); - brw_math(p, - dst, - func, - (inst->SaturateMode != SATURATE_OFF) ? BRW_MATH_SATURATE_SATURATE : BRW_MATH_SATURATE_NONE, - 2, - brw_null_reg(), - BRW_MATH_DATA_VECTOR, - BRW_MATH_PRECISION_FULL); -} - -static void emit_rcp(struct brw_wm_compile *c, - const struct prog_instruction *inst) -{ - emit_math1(c, inst, BRW_MATH_FUNCTION_INV); -} - -static void emit_rsq(struct brw_wm_compile *c, - const struct prog_instruction *inst) -{ - emit_math1(c, inst, BRW_MATH_FUNCTION_RSQ); -} - -static void emit_sin(struct brw_wm_compile *c, - const struct prog_instruction *inst) -{ - emit_math1(c, inst, BRW_MATH_FUNCTION_SIN); -} - -static void emit_cos(struct brw_wm_compile *c, - const struct prog_instruction *inst) -{ - emit_math1(c, inst, BRW_MATH_FUNCTION_COS); -} - -static void emit_ex2(struct brw_wm_compile *c, - const struct prog_instruction *inst) -{ - emit_math1(c, inst, BRW_MATH_FUNCTION_EXP); -} - -static void emit_lg2(struct brw_wm_compile *c, - const struct prog_instruction *inst) -{ - emit_math1(c, inst, BRW_MATH_FUNCTION_LOG); -} - static void emit_arl(struct brw_wm_compile *c, const struct prog_instruction *inst) { @@ -1169,36 +1039,6 @@ static void emit_min_max(struct brw_wm_compile *c, release_tmps(c, mark); } -static void emit_pow(struct brw_wm_compile *c, - const struct prog_instruction *inst) -{ - struct brw_compile *p = &c->func; - struct brw_reg dst, src0, src1; - GLuint mask = inst->DstReg.WriteMask; - int dst_chan = _mesa_ffs(mask & WRITEMASK_XYZW) - 1; - - if (!(mask & WRITEMASK_XYZW)) - return; - - assert(is_power_of_two(mask & WRITEMASK_XYZW)); - - dst = get_dst_reg(c, inst, dst_chan); - src0 = get_src_reg_imm(c, inst, 0, 0); - src1 = get_src_reg_imm(c, inst, 1, 0); - - brw_MOV(p, brw_message_reg(2), src0); - brw_MOV(p, brw_message_reg(3), src1); - - brw_math(p, - dst, - BRW_MATH_FUNCTION_POW, - (inst->SaturateMode != SATURATE_OFF) ? BRW_MATH_SATURATE_SATURATE : BRW_MATH_SATURATE_NONE, - 2, - brw_null_reg(), - BRW_MATH_DATA_VECTOR, - BRW_MATH_PRECISION_FULL); -} - /** * For GLSL shaders, this KIL will be unconditional. * It may be contained inside an IF/ENDIF structure of course. @@ -2594,28 +2434,28 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) emit_dp4(p, dst, dst_flags, args[0], args[1]); break; case OPCODE_XPD: - emit_xpd(c, inst); + emit_xpd(p, dst, dst_flags, args[0], args[1]); break; case OPCODE_DPH: emit_dph(p, dst, dst_flags, args[0], args[1]); break; case OPCODE_RCP: - emit_rcp(c, inst); + emit_math1(c, BRW_MATH_FUNCTION_INV, dst, dst_flags, args[0]); break; case OPCODE_RSQ: - emit_rsq(c, inst); + emit_math1(c, BRW_MATH_FUNCTION_RSQ, dst, dst_flags, args[0]); break; case OPCODE_SIN: - emit_sin(c, inst); + emit_math1(c, BRW_MATH_FUNCTION_SIN, dst, dst_flags, args[0]); break; case OPCODE_COS: - emit_cos(c, inst); + emit_math1(c, BRW_MATH_FUNCTION_COS, dst, dst_flags, args[0]); break; case OPCODE_EX2: - emit_ex2(c, inst); + emit_math1(c, BRW_MATH_FUNCTION_EXP, dst, dst_flags, args[0]); break; case OPCODE_LG2: - emit_lg2(c, inst); + emit_math1(c, BRW_MATH_FUNCTION_LOG, dst, dst_flags, args[0]); break; case OPCODE_MIN: case OPCODE_MAX: @@ -2654,7 +2494,8 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) emit_alu2(p, brw_MUL, dst, dst_flags, args[0], args[1]); break; case OPCODE_POW: - emit_pow(c, inst); + emit_math2(c, BRW_MATH_FUNCTION_POW, + dst, dst_flags, args[0], args[1]); break; case OPCODE_MAD: emit_mad(p, dst, dst_flags, args[0], args[1], args[2]); -- cgit v1.2.3 From 2b58c31257f8900067276b6d6537bb2ce54b1b10 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 12 Aug 2009 10:19:31 -0700 Subject: i965: Share most of the WM functions between brw_wm_glsl.c and brw_wm_emit.c The PINTERP code should be faster for brw_wm_glsl.c now since brw_wm_emit.c's had been improved, and pixel_w should no longer stomp on a neighbor to dst. --- src/mesa/drivers/dri/i965/brw_wm.h | 34 +++++ src/mesa/drivers/dri/i965/brw_wm_emit.c | 115 ++++++++------ src/mesa/drivers/dri/i965/brw_wm_glsl.c | 257 +------------------------------- 3 files changed, 109 insertions(+), 297 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index 7d470e8dfe..eba828f6e3 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -325,11 +325,19 @@ void emit_alu2(struct brw_compile *p, GLuint mask, const struct brw_reg *arg0, const struct brw_reg *arg1); +void emit_cinterp(struct brw_compile *p, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0); void emit_ddxy(struct brw_compile *p, const struct brw_reg *dst, GLuint mask, GLboolean is_ddx, const struct brw_reg *arg0); +void emit_delta_xy(struct brw_compile *p, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0); void emit_dp3(struct brw_compile *p, const struct brw_reg *dst, GLuint mask, @@ -345,6 +353,14 @@ void emit_dph(struct brw_compile *p, GLuint mask, const struct brw_reg *arg0, const struct brw_reg *arg1); +void emit_frontfacing(struct brw_compile *p, + const struct brw_reg *dst, + GLuint mask); +void emit_linterp(struct brw_compile *p, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0, + const struct brw_reg *deltas); void emit_lrp(struct brw_compile *p, const struct brw_reg *dst, GLuint mask, @@ -368,12 +384,30 @@ void emit_math2(struct brw_wm_compile *c, GLuint mask, const struct brw_reg *arg0, const struct brw_reg *arg1); +void emit_pinterp(struct brw_compile *p, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0, + const struct brw_reg *deltas, + const struct brw_reg *w); +void emit_pixel_xy(struct brw_wm_compile *c, + const struct brw_reg *dst, + GLuint mask); +void emit_pixel_w(struct brw_wm_compile *c, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0, + const struct brw_reg *deltas); void emit_sop(struct brw_compile *p, const struct brw_reg *dst, GLuint mask, GLuint cond, const struct brw_reg *arg0, const struct brw_reg *arg1); +void emit_wpos_xy(struct brw_wm_compile *c, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0); void emit_xpd(struct brw_compile *p, const struct brw_reg *dst, GLuint mask, diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index 763fe4b4d6..6eaa2792be 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -44,6 +44,7 @@ static INLINE struct brw_reg sechalf( struct brw_reg reg ) return reg; } + /* Payload R0: * * R0.0 -- pixel mask, one bit for each of 4 pixels in 4 tiles, @@ -60,42 +61,50 @@ static INLINE struct brw_reg sechalf( struct brw_reg reg ) * R1.8 -- ? */ - -static void emit_pixel_xy(struct brw_compile *p, - const struct brw_reg *dst, - GLuint mask) +void emit_pixel_xy(struct brw_wm_compile *c, + const struct brw_reg *dst, + GLuint mask) { + struct brw_compile *p = &c->func; struct brw_reg r1 = brw_vec1_grf(1, 0); struct brw_reg r1_uw = retype(r1, BRW_REGISTER_TYPE_UW); + struct brw_reg dst0_uw, dst1_uw; + brw_push_insn_state(p); brw_set_compression_control(p, BRW_COMPRESSION_NONE); + if (c->dispatch_width == 16) { + dst0_uw = vec16(retype(dst[0], BRW_REGISTER_TYPE_UW)); + dst1_uw = vec16(retype(dst[1], BRW_REGISTER_TYPE_UW)); + } else { + dst0_uw = vec8(retype(dst[0], BRW_REGISTER_TYPE_UW)); + dst1_uw = vec8(retype(dst[1], BRW_REGISTER_TYPE_UW)); + } + /* Calculate pixel centers by adding 1 or 0 to each of the * micro-tile coordinates passed in r1. */ if (mask & WRITEMASK_X) { brw_ADD(p, - vec16(retype(dst[0], BRW_REGISTER_TYPE_UW)), + dst0_uw, stride(suboffset(r1_uw, 4), 2, 4, 0), brw_imm_v(0x10101010)); } if (mask & WRITEMASK_Y) { brw_ADD(p, - vec16(retype(dst[1], BRW_REGISTER_TYPE_UW)), + dst1_uw, stride(suboffset(r1_uw,5), 2, 4, 0), brw_imm_v(0x11001100)); } - - brw_set_compression_control(p, BRW_COMPRESSION_COMPRESSED); + brw_pop_insn_state(p); } - -static void emit_delta_xy(struct brw_compile *p, - const struct brw_reg *dst, - GLuint mask, - const struct brw_reg *arg0) +void emit_delta_xy(struct brw_compile *p, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0) { struct brw_reg r1 = brw_vec1_grf(1, 0); @@ -118,10 +127,10 @@ static void emit_delta_xy(struct brw_compile *p, } } -static void emit_wpos_xy(struct brw_wm_compile *c, - const struct brw_reg *dst, - GLuint mask, - const struct brw_reg *arg0) +void emit_wpos_xy(struct brw_wm_compile *c, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0) { struct brw_compile *p = &c->func; @@ -146,12 +155,14 @@ static void emit_wpos_xy(struct brw_wm_compile *c, } -static void emit_pixel_w( struct brw_compile *p, - const struct brw_reg *dst, - GLuint mask, - const struct brw_reg *arg0, - const struct brw_reg *deltas) +void emit_pixel_w(struct brw_wm_compile *c, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0, + const struct brw_reg *deltas) { + struct brw_compile *p = &c->func; + /* Don't need this if all you are doing is interpolating color, for * instance. */ @@ -165,21 +176,29 @@ static void emit_pixel_w( struct brw_compile *p, brw_MAC(p, brw_message_reg(2), suboffset(interp3, 1), deltas[1]); /* Calc w */ - brw_math_16( p, dst[3], - BRW_MATH_FUNCTION_INV, - BRW_MATH_SATURATE_NONE, - 2, brw_null_reg(), - BRW_MATH_PRECISION_FULL); + if (c->dispatch_width == 16) { + brw_math_16(p, dst[3], + BRW_MATH_FUNCTION_INV, + BRW_MATH_SATURATE_NONE, + 2, brw_null_reg(), + BRW_MATH_PRECISION_FULL); + } else { + brw_math(p, dst[3], + BRW_MATH_FUNCTION_INV, + BRW_MATH_SATURATE_NONE, + 2, brw_null_reg(), + BRW_MATH_DATA_VECTOR, + BRW_MATH_PRECISION_FULL); + } } } - -static void emit_linterp( struct brw_compile *p, - const struct brw_reg *dst, - GLuint mask, - const struct brw_reg *arg0, - const struct brw_reg *deltas ) +void emit_linterp(struct brw_compile *p, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0, + const struct brw_reg *deltas) { struct brw_reg interp[4]; GLuint nr = arg0[0].nr; @@ -199,12 +218,12 @@ static void emit_linterp( struct brw_compile *p, } -static void emit_pinterp( struct brw_compile *p, - const struct brw_reg *dst, - GLuint mask, - const struct brw_reg *arg0, - const struct brw_reg *deltas, - const struct brw_reg *w) +void emit_pinterp(struct brw_compile *p, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0, + const struct brw_reg *deltas, + const struct brw_reg *w) { struct brw_reg interp[4]; GLuint nr = arg0[0].nr; @@ -229,10 +248,10 @@ static void emit_pinterp( struct brw_compile *p, } -static void emit_cinterp( struct brw_compile *p, - const struct brw_reg *dst, - GLuint mask, - const struct brw_reg *arg0 ) +void emit_cinterp(struct brw_compile *p, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0) { struct brw_reg interp[4]; GLuint nr = arg0[0].nr; @@ -251,9 +270,9 @@ static void emit_cinterp( struct brw_compile *p, } /* Sets the destination channels to 1.0 or 0.0 according to glFrontFacing. */ -static void emit_frontfacing( struct brw_compile *p, - const struct brw_reg *dst, - GLuint mask ) +void emit_frontfacing(struct brw_compile *p, + const struct brw_reg *dst, + GLuint mask) { struct brw_reg r1_6ud = retype(brw_vec1_grf(1, 6), BRW_REGISTER_TYPE_UD); GLuint i; @@ -1316,7 +1335,7 @@ void brw_wm_emit( struct brw_wm_compile *c ) /* Generated instructions for calculating triangle interpolants: */ case WM_PIXELXY: - emit_pixel_xy(p, dst, dst_flags); + emit_pixel_xy(c, dst, dst_flags); break; case WM_DELTAXY: @@ -1328,7 +1347,7 @@ void brw_wm_emit( struct brw_wm_compile *c ) break; case WM_PIXELW: - emit_pixel_w(p, dst, dst_flags, args[0], args[1]); + emit_pixel_w(c, dst, dst_flags, args[0], args[1]); break; case WM_LINTERP: diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index 02b119154f..d0987362a4 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -671,67 +671,6 @@ unalias3(struct brw_wm_compile *c, release_tmps(c, mark); } -static void emit_pixel_xy(struct brw_wm_compile *c, - const struct prog_instruction *inst) -{ - struct brw_reg r1 = brw_vec1_grf(1, 0); - struct brw_reg r1_uw = retype(r1, BRW_REGISTER_TYPE_UW); - - struct brw_reg dst0, dst1; - struct brw_compile *p = &c->func; - GLuint mask = inst->DstReg.WriteMask; - - dst0 = get_dst_reg(c, inst, 0); - dst1 = get_dst_reg(c, inst, 1); - /* Calculate pixel centers by adding 1 or 0 to each of the - * micro-tile coordinates passed in r1. - */ - if (mask & WRITEMASK_X) { - brw_ADD(p, - vec8(retype(dst0, BRW_REGISTER_TYPE_UW)), - stride(suboffset(r1_uw, 4), 2, 4, 0), - brw_imm_v(0x10101010)); - } - - if (mask & WRITEMASK_Y) { - brw_ADD(p, - vec8(retype(dst1, BRW_REGISTER_TYPE_UW)), - stride(suboffset(r1_uw, 5), 2, 4, 0), - brw_imm_v(0x11001100)); - } -} - -static void emit_delta_xy(struct brw_wm_compile *c, - const struct prog_instruction *inst) -{ - struct brw_reg r1 = brw_vec1_grf(1, 0); - struct brw_reg dst0, dst1, src0, src1; - struct brw_compile *p = &c->func; - GLuint mask = inst->DstReg.WriteMask; - - dst0 = get_dst_reg(c, inst, 0); - dst1 = get_dst_reg(c, inst, 1); - src0 = get_src_reg(c, inst, 0, 0); - src1 = get_src_reg(c, inst, 0, 1); - /* Calc delta X,Y by subtracting origin in r1 from the pixel - * centers. - */ - if (mask & WRITEMASK_X) { - brw_ADD(p, - dst0, - retype(src0, BRW_REGISTER_TYPE_UW), - negate(r1)); - } - - if (mask & WRITEMASK_Y) { - brw_ADD(p, - dst1, - retype(src1, BRW_REGISTER_TYPE_UW), - negate(suboffset(r1,1))); - - } -} - static void fire_fb_write( struct brw_wm_compile *c, GLuint base_reg, GLuint nr, @@ -829,154 +768,6 @@ static void emit_fb_write(struct brw_wm_compile *c, fire_fb_write(c, 0, nr, target, eot); } -static void emit_pixel_w( struct brw_wm_compile *c, - const struct prog_instruction *inst) -{ - struct brw_compile *p = &c->func; - GLuint mask = inst->DstReg.WriteMask; - if (mask & WRITEMASK_W) { - struct brw_reg dst, src0, delta0, delta1; - struct brw_reg interp3; - - dst = get_dst_reg(c, inst, 3); - src0 = get_src_reg(c, inst, 0, 0); - delta0 = get_src_reg(c, inst, 1, 0); - delta1 = get_src_reg(c, inst, 1, 1); - - interp3 = brw_vec1_grf(src0.nr+1, 4); - /* Calc 1/w - just linterp wpos[3] optimized by putting the - * result straight into a message reg. - */ - brw_LINE(p, brw_null_reg(), interp3, delta0); - brw_MAC(p, brw_message_reg(2), suboffset(interp3, 1), delta1); - - /* Calc w */ - brw_math_16( p, dst, - BRW_MATH_FUNCTION_INV, - BRW_MATH_SATURATE_NONE, - 2, brw_null_reg(), - BRW_MATH_PRECISION_FULL); - } -} - -static void emit_linterp(struct brw_wm_compile *c, - const struct prog_instruction *inst) -{ - struct brw_compile *p = &c->func; - GLuint mask = inst->DstReg.WriteMask; - struct brw_reg interp[4]; - struct brw_reg dst, delta0, delta1; - struct brw_reg src0; - GLuint nr, i; - - src0 = get_src_reg(c, inst, 0, 0); - delta0 = get_src_reg(c, inst, 1, 0); - delta1 = get_src_reg(c, inst, 1, 1); - nr = src0.nr; - - interp[0] = brw_vec1_grf(nr, 0); - interp[1] = brw_vec1_grf(nr, 4); - interp[2] = brw_vec1_grf(nr+1, 0); - interp[3] = brw_vec1_grf(nr+1, 4); - - for(i = 0; i < 4; i++ ) { - if (mask & (1<func; - GLuint mask = inst->DstReg.WriteMask; - - struct brw_reg interp[4]; - struct brw_reg dst, src0; - GLuint nr, i; - - src0 = get_src_reg(c, inst, 0, 0); - nr = src0.nr; - - interp[0] = brw_vec1_grf(nr, 0); - interp[1] = brw_vec1_grf(nr, 4); - interp[2] = brw_vec1_grf(nr+1, 0); - interp[3] = brw_vec1_grf(nr+1, 4); - - for(i = 0; i < 4; i++ ) { - if (mask & (1<func; - GLuint mask = inst->DstReg.WriteMask; - - struct brw_reg interp[4]; - struct brw_reg dst, delta0, delta1; - struct brw_reg src0, w; - GLuint nr, i; - - src0 = get_src_reg(c, inst, 0, 0); - delta0 = get_src_reg(c, inst, 1, 0); - delta1 = get_src_reg(c, inst, 1, 1); - w = get_src_reg(c, inst, 2, 3); - nr = src0.nr; - - interp[0] = brw_vec1_grf(nr, 0); - interp[1] = brw_vec1_grf(nr, 4); - interp[2] = brw_vec1_grf(nr+1, 0); - interp[3] = brw_vec1_grf(nr+1, 4); - - for(i = 0; i < 4; i++ ) { - if (mask & (1<func; - struct brw_reg r1_6ud = retype(brw_vec1_grf(1, 6), BRW_REGISTER_TYPE_UD); - struct brw_reg dst; - GLuint mask = inst->DstReg.WriteMask; - int i; - - for (i = 0; i < 4; i++) { - if (mask & (1<func; - GLuint mask = inst->DstReg.WriteMask; - struct brw_reg src0[2], dst[2]; - - dst[0] = get_dst_reg(c, inst, 0); - dst[1] = get_dst_reg(c, inst, 1); - src0[0] = get_src_reg(c, inst, 0, 0); - src0[1] = get_src_reg(c, inst, 0, 1); - - /* Calculate the pixel offset from window bottom left into destination - * X and Y channels. - */ - if (mask & WRITEMASK_X) { - /* X' = X - origin_x */ - brw_ADD(p, - dst[0], - retype(src0[0], BRW_REGISTER_TYPE_W), - brw_imm_d(0 - c->key.origin_x)); - } - - if (mask & WRITEMASK_Y) { - /* Y' = height - (Y - origin_y) = height + origin_y - Y */ - brw_ADD(p, - dst[1], - negate(retype(src0[1], BRW_REGISTER_TYPE_W)), - brw_imm_d(c->key.origin_y + c->key.drawable_height - 1)); - } -} /* TODO BIAS on SIMD8 not working yet... @@ -2378,31 +2137,31 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) switch (inst->Opcode) { case WM_PIXELXY: - emit_pixel_xy(c, inst); + emit_pixel_xy(c, dst, dst_flags); break; case WM_DELTAXY: - emit_delta_xy(c, inst); + emit_delta_xy(p, dst, dst_flags, args[0]); break; case WM_PIXELW: - emit_pixel_w(c, inst); + emit_pixel_w(c, dst, dst_flags, args[0], args[1]); break; case WM_LINTERP: - emit_linterp(c, inst); + emit_linterp(p, dst, dst_flags, args[0], args[1]); break; case WM_PINTERP: - emit_pinterp(c, inst); + emit_pinterp(p, dst, dst_flags, args[0], args[1], args[2]); break; case WM_CINTERP: - emit_cinterp(c, inst); + emit_cinterp(p, dst, dst_flags, args[0]); break; case WM_WPOSXY: - emit_wpos_xy(c, inst); + emit_wpos_xy(c, dst, dst_flags, args[0]); break; case WM_FB_WRITE: emit_fb_write(c, inst); break; case WM_FRONTFACING: - emit_frontfacing(c, inst); + emit_frontfacing(p, dst, dst_flags); break; case OPCODE_ADD: emit_alu2(p, brw_ADD, dst, dst_flags, args[0], args[1]); -- cgit v1.2.3 From cfa927766ab610a9a76730d337d77008d876ebbd Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 19 Aug 2009 11:48:09 -0700 Subject: i965: Share emit_fb_write() between brw_wm_emit.c and brw_wm_glsl.c This should fix issues with antialiased lines in GLSL. --- src/mesa/drivers/dri/i965/brw_wm.h | 6 ++ src/mesa/drivers/dri/i965/brw_wm_emit.c | 56 +++++++++--------- src/mesa/drivers/dri/i965/brw_wm_fp.c | 4 +- src/mesa/drivers/dri/i965/brw_wm_glsl.c | 101 +------------------------------- 4 files changed, 40 insertions(+), 127 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index eba828f6e3..bde0c366bd 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -353,6 +353,12 @@ void emit_dph(struct brw_compile *p, GLuint mask, const struct brw_reg *arg0, const struct brw_reg *arg1); +void emit_fb_write(struct brw_wm_compile *c, + struct brw_reg *arg0, + struct brw_reg *arg1, + struct brw_reg *arg2, + GLuint target, + GLuint eot); void emit_frontfacing(struct brw_compile *p, const struct brw_reg *dst, GLuint mask); diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index 6eaa2792be..d02e3cb9ac 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -1042,7 +1042,13 @@ static void fire_fb_write( struct brw_wm_compile *c, GLuint eot ) { struct brw_compile *p = &c->func; - + struct brw_reg dst; + + if (c->dispatch_width == 16) + dst = retype(vec16(brw_null_reg()), BRW_REGISTER_TYPE_UW); + else + dst = retype(vec8(brw_null_reg()), BRW_REGISTER_TYPE_UW); + /* Pass through control information: */ /* mov (8) m1.0<1>:ud r1.0<8;8,1>:ud { Align1 NoMask } */ @@ -1059,7 +1065,7 @@ static void fire_fb_write( struct brw_wm_compile *c, /* Send framebuffer write message: */ /* send (16) null.0<1>:uw m0 r0.0<8;8,1>:uw 0x85a04000:ud { Align1 EOT } */ brw_fb_WRITE(p, - retype(vec16(brw_null_reg()), BRW_REGISTER_TYPE_UW), + dst, base_reg, retype(brw_vec8_grf(0, 0), BRW_REGISTER_TYPE_UW), target, @@ -1091,12 +1097,12 @@ static void emit_aa( struct brw_wm_compile *c, * \param arg1 the pass-through depth value * \param arg2 the shader-computed depth value */ -static void emit_fb_write( struct brw_wm_compile *c, - struct brw_reg *arg0, - struct brw_reg *arg1, - struct brw_reg *arg2, - GLuint target, - GLuint eot) +void emit_fb_write(struct brw_wm_compile *c, + struct brw_reg *arg0, + struct brw_reg *arg1, + struct brw_reg *arg2, + GLuint target, + GLuint eot) { struct brw_compile *p = &c->func; GLuint nr = 2; @@ -1110,30 +1116,27 @@ static void emit_fb_write( struct brw_wm_compile *c, /* I don't really understand how this achieves the color interleave * (ie RGBARGBA) in the result: [Do the saturation here] */ - { - brw_push_insn_state(p); - - for (channel = 0; channel < 4; channel++) { - /* mov (8) m2.0<1>:ud r28.0<8;8,1>:ud { Align1 } */ - /* mov (8) m6.0<1>:ud r29.0<8;8,1>:ud { Align1 SecHalf } */ + brw_push_insn_state(p); - brw_set_compression_control(p, BRW_COMPRESSION_NONE); - brw_MOV(p, - brw_message_reg(nr + channel), - arg0[channel]); - + for (channel = 0; channel < 4; channel++) { + /* mov (8) m2.0<1>:ud r28.0<8;8,1>:ud { Align1 } */ + /* mov (8) m6.0<1>:ud r29.0<8;8,1>:ud { Align1 SecHalf } */ + brw_set_compression_control(p, BRW_COMPRESSION_NONE); + brw_MOV(p, + brw_message_reg(nr + channel), + arg0[channel]); + + if (c->dispatch_width == 16) { brw_set_compression_control(p, BRW_COMPRESSION_2NDHALF); brw_MOV(p, brw_message_reg(nr + channel + 4), sechalf(arg0[channel])); } - - /* skip over the regs populated above: - */ - nr += 8; - - brw_pop_insn_state(p); } + /* skip over the regs populated above: + */ + nr += 8; + brw_pop_insn_state(p); if (c->key.source_depth_to_render_target) { @@ -1183,7 +1186,7 @@ static void emit_fb_write( struct brw_wm_compile *c, get_element_ud(brw_vec8_grf(1,0), 6), brw_imm_ud(1<<26)); - jmp = brw_JMPI(p, ip, ip, brw_imm_d(0)); + jmp = brw_JMPI(p, ip, ip, brw_imm_w(0)); { emit_aa(c, arg1, 2); fire_fb_write(c, 0, nr, target, eot); @@ -1197,7 +1200,6 @@ static void emit_fb_write( struct brw_wm_compile *c, } } - /** * Move a GPR to scratch memory. */ diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c index a453250e79..549afd31de 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_fp.c +++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c @@ -956,7 +956,7 @@ static void precalc_txp( struct brw_wm_compile *c, -static void emit_fb_write( struct brw_wm_compile *c ) +static void emit_render_target_writes( struct brw_wm_compile *c ) { struct prog_src_register payload_r0_depth = src_reg(PROGRAM_PAYLOAD, PAYLOAD_DEPTH); struct prog_src_register outdepth = src_reg(PROGRAM_OUTPUT, FRAG_RESULT_DEPTH); @@ -1153,7 +1153,7 @@ void brw_wm_pass_fp( struct brw_wm_compile *c ) out->DstReg.WriteMask = 0; break; case OPCODE_END: - emit_fb_write(c); + emit_render_target_writes(c); break; case OPCODE_PRINT: break; diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index d0987362a4..be89bcf4ba 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -671,103 +671,6 @@ unalias3(struct brw_wm_compile *c, release_tmps(c, mark); } -static void fire_fb_write( struct brw_wm_compile *c, - GLuint base_reg, - GLuint nr, - GLuint target, - GLuint eot) -{ - struct brw_compile *p = &c->func; - /* Pass through control information: - */ - /* mov (8) m1.0<1>:ud r1.0<8;8,1>:ud { Align1 NoMask } */ - { - brw_push_insn_state(p); - brw_set_mask_control(p, BRW_MASK_DISABLE); /* ? */ - brw_MOV(p, - brw_message_reg(base_reg + 1), - brw_vec8_grf(1, 0)); - brw_pop_insn_state(p); - } - /* Send framebuffer write message: */ - brw_fb_WRITE(p, - retype(vec8(brw_null_reg()), BRW_REGISTER_TYPE_UW), - base_reg, - retype(brw_vec8_grf(0, 0), BRW_REGISTER_TYPE_UW), - target, - nr, - 0, - eot); -} - -static void emit_fb_write(struct brw_wm_compile *c, - const struct prog_instruction *inst) -{ - struct brw_compile *p = &c->func; - int nr = 2; - int channel; - GLuint target, eot; - struct brw_reg src0; - - /* Reserve a space for AA - may not be needed: - */ - if (c->key.aa_dest_stencil_reg) - nr += 1; - - brw_push_insn_state(p); - for (channel = 0; channel < 4; channel++) { - src0 = get_src_reg(c, inst, 0, channel); - /* mov (8) m2.0<1>:ud r28.0<8;8,1>:ud { Align1 } */ - /* mov (8) m6.0<1>:ud r29.0<8;8,1>:ud { Align1 SecHalf } */ - brw_MOV(p, brw_message_reg(nr + channel), src0); - } - /* skip over the regs populated above: */ - nr += 8; - brw_pop_insn_state(p); - - if (c->key.source_depth_to_render_target) { - if (c->key.computes_depth) { - src0 = get_src_reg(c, inst, 2, 2); - brw_MOV(p, brw_message_reg(nr), src0); - } - else { - src0 = get_src_reg(c, inst, 1, 1); - brw_MOV(p, brw_message_reg(nr), src0); - } - - nr += 2; - } - - if (c->key.dest_depth_reg) { - const GLuint comp = c->key.dest_depth_reg / 2; - const GLuint off = c->key.dest_depth_reg % 2; - - if (off != 0) { - /* XXX this code needs review/testing */ - struct brw_reg arg1_0 = get_src_reg(c, inst, 1, comp); - struct brw_reg arg1_1 = get_src_reg(c, inst, 1, comp+1); - - brw_push_insn_state(p); - brw_set_compression_control(p, BRW_COMPRESSION_NONE); - - brw_MOV(p, brw_message_reg(nr), offset(arg1_0, 1)); - /* 2nd half? */ - brw_MOV(p, brw_message_reg(nr+1), arg1_1); - brw_pop_insn_state(p); - } - else - { - struct brw_reg src = get_src_reg(c, inst, 1, 1); - brw_MOV(p, brw_message_reg(nr), src); - } - nr += 2; - } - - target = INST_AUX_GET_TARGET(inst->Aux); - eot = inst->Aux & INST_AUX_EOT; - fire_fb_write(c, 0, nr, target, eot); -} - static void emit_arl(struct brw_wm_compile *c, const struct prog_instruction *inst) { @@ -2158,7 +2061,9 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) emit_wpos_xy(c, dst, dst_flags, args[0]); break; case WM_FB_WRITE: - emit_fb_write(c, inst); + emit_fb_write(c, args[0], args[1], args[2], + INST_AUX_GET_TARGET(inst->Aux), + inst->Aux & INST_AUX_EOT); break; case WM_FRONTFACING: emit_frontfacing(p, dst, dst_flags); -- cgit v1.2.3 From ec66644ed0af976cacb069ca7c7f0d6731666359 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 19 Aug 2009 11:57:32 -0700 Subject: i965: Share min/max between brw_wm_emit.c and brw_wm_glsl.c --- src/mesa/drivers/dri/i965/brw_wm.h | 10 ++++ src/mesa/drivers/dri/i965/brw_wm_emit.c | 20 +++---- src/mesa/drivers/dri/i965/brw_wm_glsl.c | 102 ++++++++++++++++---------------- 3 files changed, 72 insertions(+), 60 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index bde0c366bd..1fa2f1c06c 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -390,6 +390,16 @@ void emit_math2(struct brw_wm_compile *c, GLuint mask, const struct brw_reg *arg0, const struct brw_reg *arg1); +void emit_min(struct brw_compile *p, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0, + const struct brw_reg *arg1); +void emit_max(struct brw_compile *p, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0, + const struct brw_reg *arg1); void emit_pinterp(struct brw_compile *p, const struct brw_reg *dst, GLuint mask, diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index d02e3cb9ac..9cd1fedacb 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -567,11 +567,11 @@ static void emit_cmp( struct brw_compile *p, } } -static void emit_max( struct brw_compile *p, - const struct brw_reg *dst, - GLuint mask, - const struct brw_reg *arg0, - const struct brw_reg *arg1 ) +void emit_max(struct brw_compile *p, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0, + const struct brw_reg *arg1) { GLuint i; @@ -591,11 +591,11 @@ static void emit_max( struct brw_compile *p, } } -static void emit_min( struct brw_compile *p, - const struct brw_reg *dst, - GLuint mask, - const struct brw_reg *arg0, - const struct brw_reg *arg1 ) +void emit_min(struct brw_compile *p, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0, + const struct brw_reg *arg1) { GLuint i; diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index be89bcf4ba..9d3bc66f49 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -671,6 +671,55 @@ unalias3(struct brw_wm_compile *c, release_tmps(c, mark); } +/* Workaround for using brw_wm_emit.c's emit functions, which expect + * destination regs to be uniquely written. Moves arguments out to + * temporaries as necessary for instructions which use their destination as + * a temporary. + */ +static void +unalias2(struct brw_wm_compile *c, + void (*func)(struct brw_compile *c, + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0, + const struct brw_reg *arg1), + const struct brw_reg *dst, + GLuint mask, + const struct brw_reg *arg0, + const struct brw_reg *arg1) +{ + struct brw_compile *p = &c->func; + struct brw_reg tmp_arg0[4], tmp_arg1[4]; + int i, j; + int mark = mark_tmps(c); + + for (j = 0; j < 4; j++) { + tmp_arg0[j] = arg0[j]; + tmp_arg1[j] = arg1[j]; + } + + for (i = 0; i < 4; i++) { + if (mask & (1<func; - const GLuint mask = inst->DstReg.WriteMask; - const int mark = mark_tmps(c); - int i; - brw_push_insn_state(p); - for (i = 0; i < 4; i++) { - if (mask & (1<SaturateMode != SATURATE_OFF) ? 1 : 0); - brw_MOV(p, dst, src0); - brw_set_saturate(p, 0); - - if (inst->Opcode == OPCODE_MIN) - brw_CMP(p, brw_null_reg(), BRW_CONDITIONAL_L, src1, src0); - else - brw_CMP(p, brw_null_reg(), BRW_CONDITIONAL_G, src1, src0); - - brw_set_saturate(p, (inst->SaturateMode != SATURATE_OFF) ? 1 : 0); - brw_set_predicate_control(p, BRW_PREDICATE_NORMAL); - brw_MOV(p, dst, src1); - brw_set_saturate(p, 0); - brw_set_predicate_control_flag_value(p, 0xff); - if (use_temp) - brw_MOV(p, real_dst, dst); - } - } - brw_pop_insn_state(p); - release_tmps(c, mark); -} - /** * For GLSL shaders, this KIL will be unconditional. * It may be contained inside an IF/ENDIF structure of course. @@ -2122,8 +2122,10 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) emit_math1(c, BRW_MATH_FUNCTION_LOG, dst, dst_flags, args[0]); break; case OPCODE_MIN: + unalias2(c, emit_min, dst, dst_flags, args[0], args[1]); + break; case OPCODE_MAX: - emit_min_max(c, inst); + unalias2(c, emit_max, dst, dst_flags, args[0], args[1]); break; case OPCODE_DDX: case OPCODE_DDY: -- cgit v1.2.3 From 8baee3d25beb616f6d5ba575684e889d60e38740 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 6 Nov 2009 17:45:13 -0800 Subject: i965: Use Compr4 instruction compression mode on G4X and newer. No statistically significant performance difference at n=3 with either openarena or my GL demo, but cutting program size seems like a good thing to be doing for the hypothetical app that has a working set near icache size. --- src/mesa/drivers/dri/i965/brw_eu.h | 10 +++++----- src/mesa/drivers/dri/i965/brw_eu_emit.c | 3 ++- src/mesa/drivers/dri/i965/brw_wm_emit.c | 33 ++++++++++++++++++++++----------- 3 files changed, 29 insertions(+), 17 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_eu.h b/src/mesa/drivers/dri/i965/brw_eu.h index 30603bdd0e..39eb88d7c2 100644 --- a/src/mesa/drivers/dri/i965/brw_eu.h +++ b/src/mesa/drivers/dri/i965/brw_eu.h @@ -170,11 +170,11 @@ static INLINE struct brw_reg brw_reg( GLuint file, GLuint writemask ) { struct brw_reg reg; - if (type == BRW_GENERAL_REGISTER_FILE) + if (file == BRW_GENERAL_REGISTER_FILE) assert(nr < BRW_MAX_GRF); - else if (type == BRW_MESSAGE_REGISTER_FILE) - assert(nr < BRW_MAX_MRF); - else if (type == BRW_ARCHITECTURE_REGISTER_FILE) + else if (file == BRW_MESSAGE_REGISTER_FILE) + assert((nr & ~(1 << 7)) < BRW_MAX_MRF); + else if (file == BRW_ARCHITECTURE_REGISTER_FILE) assert(nr <= BRW_ARF_IP); reg.type = type; @@ -538,7 +538,7 @@ static INLINE struct brw_reg brw_mask_reg( GLuint subnr ) static INLINE struct brw_reg brw_message_reg( GLuint nr ) { - assert(nr < BRW_MAX_MRF); + assert((nr & ~(1 << 7)) < BRW_MAX_MRF); return brw_vec8_reg(BRW_MESSAGE_REGISTER_FILE, nr, 0); diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c index 241cdc33f8..7ceabba288 100644 --- a/src/mesa/drivers/dri/i965/brw_eu_emit.c +++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c @@ -55,7 +55,8 @@ static void guess_execution_size( struct brw_instruction *insn, static void brw_set_dest( struct brw_instruction *insn, struct brw_reg dest ) { - if (dest.type != BRW_ARCHITECTURE_REGISTER_FILE) + if (dest.file != BRW_ARCHITECTURE_REGISTER_FILE && + dest.file != BRW_MESSAGE_REGISTER_FILE) assert(dest.nr < 128); insn->bits1.da1.dest_reg_file = dest.file; diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index 9cd1fedacb..eb37ea1864 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -1105,6 +1105,7 @@ void emit_fb_write(struct brw_wm_compile *c, GLuint eot) { struct brw_compile *p = &c->func; + struct brw_context *brw = p->brw; GLuint nr = 2; GLuint channel; @@ -1119,18 +1120,28 @@ void emit_fb_write(struct brw_wm_compile *c, brw_push_insn_state(p); for (channel = 0; channel < 4; channel++) { - /* mov (8) m2.0<1>:ud r28.0<8;8,1>:ud { Align1 } */ - /* mov (8) m6.0<1>:ud r29.0<8;8,1>:ud { Align1 SecHalf } */ - brw_set_compression_control(p, BRW_COMPRESSION_NONE); - brw_MOV(p, - brw_message_reg(nr + channel), - arg0[channel]); - - if (c->dispatch_width == 16) { - brw_set_compression_control(p, BRW_COMPRESSION_2NDHALF); + if (c->dispatch_width == 16 && (BRW_IS_G4X(brw) || BRW_IS_IGDNG(brw))) { + /* By setting the high bit of the MRF register number, we indicate + * that we want COMPR4 mode - instead of doing the usual destination + * + 1 for the second half we get destination + 4. + */ brw_MOV(p, - brw_message_reg(nr + channel + 4), - sechalf(arg0[channel])); + brw_message_reg(nr + channel + (1 << 7)), + arg0[channel]); + } else { + /* mov (8) m2.0<1>:ud r28.0<8;8,1>:ud { Align1 } */ + /* mov (8) m6.0<1>:ud r29.0<8;8,1>:ud { Align1 SecHalf } */ + brw_set_compression_control(p, BRW_COMPRESSION_NONE); + brw_MOV(p, + brw_message_reg(nr + channel), + arg0[channel]); + + if (c->dispatch_width == 16) { + brw_set_compression_control(p, BRW_COMPRESSION_2NDHALF); + brw_MOV(p, + brw_message_reg(nr + channel + 4), + sechalf(arg0[channel])); + } } } /* skip over the regs populated above: -- cgit v1.2.3 From 18768393d19dedee7d4282e84905bb396dd30960 Mon Sep 17 00:00:00 2001 From: brian Date: Sat, 7 Nov 2009 08:18:03 -0700 Subject: mesa: move code after decl Fixes bug 24967. --- src/mesa/shader/prog_optimize.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/prog_optimize.c b/src/mesa/shader/prog_optimize.c index 94d3dce6ea..8638754e24 100644 --- a/src/mesa/shader/prog_optimize.c +++ b/src/mesa/shader/prog_optimize.c @@ -249,8 +249,9 @@ _mesa_remove_dead_code(struct gl_program *prog) for (j = 0; j < numSrc; j++) { if (inst->SrcReg[j].File == PROGRAM_TEMPORARY) { const GLuint index = inst->SrcReg[j].Index; + GLuint read_mask; ASSERT(index < MAX_PROGRAM_TEMPS); - int read_mask = get_src_arg_mask(inst, j); + read_mask = get_src_arg_mask(inst, j); if (inst->SrcReg[j].RelAddr) { if (dbg) -- cgit v1.2.3 From 7452877cf64b48c58f70f73f3eda9bf2692bb9a6 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 2 Nov 2009 13:37:47 -0800 Subject: prog parse: Handle GL_FRAGMENT_PROGRAM_NV in glProgramStringARB --- src/mesa/shader/arbprogram.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c index 4d8cff0700..ca71a3939c 100644 --- a/src/mesa/shader/arbprogram.c +++ b/src/mesa/shader/arbprogram.c @@ -37,6 +37,7 @@ #include "main/mtypes.h" #include "arbprogram.h" #include "arbprogparse.h" +#include "nvfragparse.h" #include "program.h" @@ -428,6 +429,7 @@ void GLAPIENTRY _mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len, const GLvoid *string) { + struct gl_program *base; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -442,22 +444,30 @@ _mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len, && ctx->Extensions.ARB_vertex_program) { struct gl_vertex_program *prog = ctx->VertexProgram.Current; _mesa_parse_arb_vertex_program(ctx, target, string, len, prog); - - if (ctx->Program.ErrorPos == -1 && ctx->Driver.ProgramStringNotify) - ctx->Driver.ProgramStringNotify( ctx, target, &prog->Base ); + + base = & prog->Base; } else if (target == GL_FRAGMENT_PROGRAM_ARB && ctx->Extensions.ARB_fragment_program) { struct gl_fragment_program *prog = ctx->FragmentProgram.Current; _mesa_parse_arb_fragment_program(ctx, target, string, len, prog); - if (ctx->Program.ErrorPos == -1 && ctx->Driver.ProgramStringNotify) - ctx->Driver.ProgramStringNotify( ctx, target, &prog->Base ); + base = & prog->Base; + } + else if (target == GL_FRAGMENT_PROGRAM_NV + && ctx->Extensions.NV_fragment_program) { + struct gl_fragment_program *prog = ctx->FragmentProgram.Current; + _mesa_parse_nv_fragment_program(ctx, target, string, len, prog); + + base = & prog->Base; } else { _mesa_error(ctx, GL_INVALID_ENUM, "glProgramStringARB(target)"); return; } + + if (ctx->Program.ErrorPos == -1 && ctx->Driver.ProgramStringNotify) + ctx->Driver.ProgramStringNotify( ctx, target, base ); } -- cgit v1.2.3 From 289db82b2d42b0d79fd0c01781612bd4e69a9474 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 2 Nov 2009 13:38:15 -0800 Subject: prog parse: Handle GL_FRAGMENT_PROGRAM_ARB in glLoadProgramNV --- src/mesa/shader/nvprogram.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c index 471a7358a2..80ed410c24 100644 --- a/src/mesa/shader/nvprogram.c +++ b/src/mesa/shader/nvprogram.c @@ -47,6 +47,7 @@ #include "prog_instruction.h" #include "nvfragparse.h" #include "nvvertparse.h" +#include "arbprogparse.h" #include "nvprogram.h" @@ -643,6 +644,20 @@ _mesa_LoadProgramNV(GLenum target, GLuint id, GLsizei len, } _mesa_parse_nv_fragment_program(ctx, target, program, len, fprog); } + else if (target == GL_FRAGMENT_PROGRAM_ARB + && ctx->Extensions.ARB_fragment_program) { + struct gl_fragment_program *fprog = (struct gl_fragment_program *) prog; + if (!fprog || prog == &_mesa_DummyProgram) { + fprog = (struct gl_fragment_program *) + ctx->Driver.NewProgram(ctx, target, id); + if (!fprog) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glLoadProgramNV"); + return; + } + _mesa_HashInsert(ctx->Shared->Programs, id, fprog); + } + _mesa_parse_arb_fragment_program(ctx, target, program, len, fprog); + } else { _mesa_error(ctx, GL_INVALID_ENUM, "glLoadProgramNV(target)"); } -- cgit v1.2.3 From 6d2ceda780967848b6147061287095c35bc9d92f Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 2 Nov 2009 14:08:51 -0800 Subject: prog parse: Handle GL_VERTEX_PROGRAM_NV in glProgramStringARB Handle both NV vertex programs and NV vertex state programs passed to glProgramStringARB. --- src/mesa/shader/arbprogram.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/arbprogram.c b/src/mesa/shader/arbprogram.c index ca71a3939c..eb537cd1b9 100644 --- a/src/mesa/shader/arbprogram.c +++ b/src/mesa/shader/arbprogram.c @@ -38,6 +38,7 @@ #include "arbprogram.h" #include "arbprogparse.h" #include "nvfragparse.h" +#include "nvvertparse.h" #include "program.h" @@ -435,18 +436,39 @@ _mesa_ProgramStringARB(GLenum target, GLenum format, GLsizei len, FLUSH_VERTICES(ctx, _NEW_PROGRAM); + if (!ctx->Extensions.ARB_vertex_program + && !ctx->Extensions.ARB_fragment_program) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glProgramStringARB()"); + return; + } + if (format != GL_PROGRAM_FORMAT_ASCII_ARB) { _mesa_error(ctx, GL_INVALID_ENUM, "glProgramStringARB(format)"); return; } + /* The first couple cases are complicated. The same enum value is used for + * ARB and NV vertex programs. If the target is a vertex program, parse it + * using the ARB grammar if the string starts with "!!ARB" or if + * NV_vertex_program is not supported. + */ if (target == GL_VERTEX_PROGRAM_ARB - && ctx->Extensions.ARB_vertex_program) { + && ctx->Extensions.ARB_vertex_program + && ((strncmp(string, "!!ARB", 5) == 0) + || !ctx->Extensions.NV_vertex_program)) { struct gl_vertex_program *prog = ctx->VertexProgram.Current; _mesa_parse_arb_vertex_program(ctx, target, string, len, prog); base = & prog->Base; } + else if ((target == GL_VERTEX_PROGRAM_ARB + || target == GL_VERTEX_STATE_PROGRAM_NV) + && ctx->Extensions.NV_vertex_program) { + struct gl_vertex_program *prog = ctx->VertexProgram.Current; + _mesa_parse_nv_vertex_program(ctx, target, string, len, prog); + + base = & prog->Base; + } else if (target == GL_FRAGMENT_PROGRAM_ARB && ctx->Extensions.ARB_fragment_program) { struct gl_fragment_program *prog = ctx->FragmentProgram.Current; -- cgit v1.2.3 From 2cda507fa170c040e207190dee44d1be5e8572f7 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 2 Nov 2009 14:10:38 -0800 Subject: prog parse: Handle GL_VERTEX_PROGRAM_ARB in glLoadProgramNV --- src/mesa/shader/nvprogram.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/nvprogram.c b/src/mesa/shader/nvprogram.c index 80ed410c24..fd6cbb0f40 100644 --- a/src/mesa/shader/nvprogram.c +++ b/src/mesa/shader/nvprogram.c @@ -596,6 +596,12 @@ _mesa_LoadProgramNV(GLenum target, GLuint id, GLsizei len, GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); + if (!ctx->Extensions.NV_vertex_program + && !ctx->Extensions.NV_fragment_program) { + _mesa_error(ctx, GL_INVALID_OPERATION, "glLoadProgramNV()"); + return; + } + if (id == 0) { _mesa_error(ctx, GL_INVALID_VALUE, "glLoadProgramNV(id)"); return; @@ -628,7 +634,13 @@ _mesa_LoadProgramNV(GLenum target, GLuint id, GLsizei len, } _mesa_HashInsert(ctx->Shared->Programs, id, vprog); } - _mesa_parse_nv_vertex_program(ctx, target, program, len, vprog); + + if (ctx->Extensions.ARB_vertex_program + && (strncmp((char *) program, "!!ARB", 5) == 0)) { + _mesa_parse_arb_vertex_program(ctx, target, program, len, vprog); + } else { + _mesa_parse_nv_vertex_program(ctx, target, program, len, vprog); + } } else if (target == GL_FRAGMENT_PROGRAM_NV && ctx->Extensions.NV_fragment_program) { -- cgit v1.2.3 From a9035f3dc313d047ce3af191d6d7ac8ada8167df Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 9 Nov 2009 11:34:13 -0500 Subject: r600: add missing ZPASS setup bits for r7xx+ --- src/mesa/drivers/dri/r600/r600_reg_r7xx.h | 2 ++ src/mesa/drivers/dri/r600/r700_state.c | 4 ++++ 2 files changed, 6 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r600_reg_r7xx.h b/src/mesa/drivers/dri/r600/r600_reg_r7xx.h index e5c01c861a..eb169bd885 100644 --- a/src/mesa/drivers/dri/r600/r600_reg_r7xx.h +++ b/src/mesa/drivers/dri/r600/r600_reg_r7xx.h @@ -143,6 +143,8 @@ enum { // SQ_TEX_SAMPLER_MISC_0 = 0x0003d03c, R7xx_TRUNCATE_COORD_bit = 1 << 9, R7xx_DISABLE_CUBE_WRAP_bit = 1 << 10, +// DB_RENDER_CONTROL = 0x00028d0c, + PERFECT_ZPASS_COUNTS_bit = 1 << 15, } ; diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index b278887266..b95fc87d30 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -1686,6 +1686,10 @@ void r700InitState(GLcontext * ctx) //------------------- SETfield(r700->DB_RENDER_OVERRIDE.u32All, FORCE_DISABLE, FORCE_HIS_ENABLE0_shift, FORCE_HIS_ENABLE0_mask); SETfield(r700->DB_RENDER_OVERRIDE.u32All, FORCE_DISABLE, FORCE_HIS_ENABLE1_shift, FORCE_HIS_ENABLE1_mask); SETbit(r700->DB_RENDER_OVERRIDE.u32All, NOOP_CULL_DISABLE_bit); + if (context->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV770) + { + CLEARbit(r700->DB_RENDER_CONTROL.u32All, PERFECT_ZPASS_COUNTS_bit); + } r700->DB_ALPHA_TO_MASK.u32All = 0; SETfield(r700->DB_ALPHA_TO_MASK.u32All, 2, ALPHA_TO_MASK_OFFSET0_shift, ALPHA_TO_MASK_OFFSET0_mask); -- cgit v1.2.3 From 37676b396a8416ad35253412d3a2e06482859a4d Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 9 Nov 2009 11:36:10 -0500 Subject: r600: don't emit htile regs These are needed for HiZ which is not currently used and the _BASE reg requires a reloc which is not currently supported in the drm. --- src/mesa/drivers/dri/r600/r700_chip.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index 47b38d2e36..ec76fbcb6d 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -784,8 +784,7 @@ static void r700SendDBState(GLcontext *ctx, struct radeon_state_atom *atom) BATCH_LOCALS(&context->radeon); radeon_print(RADEON_STATE, RADEON_VERBOSE, "%s\n", __func__); - BEGIN_BATCH_NO_AUTOSTATE(23); - R600_OUT_BATCH_REGVAL(DB_HTILE_DATA_BASE, r700->DB_HTILE_DATA_BASE.u32All); + BEGIN_BATCH_NO_AUTOSTATE(17); R600_OUT_BATCH_REGSEQ(DB_STENCIL_CLEAR, 2); R600_OUT_BATCH(r700->DB_STENCIL_CLEAR.u32All); @@ -798,7 +797,6 @@ static void r700SendDBState(GLcontext *ctx, struct radeon_state_atom *atom) R600_OUT_BATCH(r700->DB_RENDER_CONTROL.u32All); R600_OUT_BATCH(r700->DB_RENDER_OVERRIDE.u32All); - R600_OUT_BATCH_REGVAL(DB_HTILE_SURFACE, r700->DB_HTILE_SURFACE.u32All); R600_OUT_BATCH_REGVAL(DB_ALPHA_TO_MASK, r700->DB_ALPHA_TO_MASK.u32All); END_BATCH(); @@ -1282,7 +1280,7 @@ void r600InitAtoms(context_t *context) context->radeon.hw.atomlist.name = "atom-list"; ALLOC_STATE(sq, always, 34, r700SendSQConfig); - ALLOC_STATE(db, always, 23, r700SendDBState); + ALLOC_STATE(db, always, 17, r700SendDBState); ALLOC_STATE(stencil, always, 4, r700SendStencilState); ALLOC_STATE(db_target, always, 12, r700SendDepthTargetState); ALLOC_STATE(sc, always, 15, r700SendSCState); -- cgit v1.2.3 From 66d6f9e860143c3d705f1d78c324159cadd258cc Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 9 Nov 2009 12:20:47 -0500 Subject: r600: rework DB render setup - consolidate DB render setup - only enable perfect ZPASS counts and cull disable when OQ is active - enable early Z --- src/mesa/drivers/dri/r600/r700_fragprog.c | 27 ++-------- src/mesa/drivers/dri/r600/r700_render.c | 4 +- src/mesa/drivers/dri/r600/r700_state.c | 82 +++++++++++++++++++++++++------ src/mesa/drivers/dri/r600/r700_state.h | 2 +- 4 files changed, 73 insertions(+), 42 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_fragprog.c b/src/mesa/drivers/dri/r600/r700_fragprog.c index 0f549ead9c..ccafd433bf 100644 --- a/src/mesa/drivers/dri/r600/r700_fragprog.c +++ b/src/mesa/drivers/dri/r600/r700_fragprog.c @@ -393,26 +393,6 @@ GLboolean r700SetupFragmentProgram(GLcontext * ctx) SETfield(r700->ps.SQ_PGM_EXPORTS_PS.u32All, fp->r700Shader.exportMode, EXPORT_MODE_shift, EXPORT_MODE_mask); - R600_STATECHANGE(context, db); - - if(fp->r700Shader.killIsUsed) - { - SETbit(r700->DB_SHADER_CONTROL.u32All, KILL_ENABLE_bit); - } - else - { - CLEARbit(r700->DB_SHADER_CONTROL.u32All, KILL_ENABLE_bit); - } - - if(fp->r700Shader.depthIsExported) - { - SETbit(r700->DB_SHADER_CONTROL.u32All, Z_EXPORT_ENABLE_bit); - } - else - { - CLEARbit(r700->DB_SHADER_CONTROL.u32All, Z_EXPORT_ENABLE_bit); - } - // emit ps input map unBit = 1 << FRAG_ATTRIB_WPOS; if(mesa_fp->Base.InputsRead & unBit) @@ -479,9 +459,12 @@ GLboolean r700SetupFragmentProgram(GLcontext * ctx) } } - R600_STATECHANGE(context, cb); exportCount = (r700->ps.SQ_PGM_EXPORTS_PS.u32All & EXPORT_MODE_mask) / (1 << EXPORT_MODE_shift); - r700->CB_SHADER_CONTROL.u32All = (1 << exportCount) - 1; + if (r700->CB_SHADER_CONTROL.u32All != ((1 << exportCount) - 1)) + { + R600_STATECHANGE(context, cb); + r700->CB_SHADER_CONTROL.u32All = (1 << exportCount) - 1; + } /* sent out shader constants. */ paramList = fp->mesa_program.Base.Parameters; diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c index c345b9d8ac..47f89c91f8 100644 --- a/src/mesa/drivers/dri/r600/r700_render.c +++ b/src/mesa/drivers/dri/r600/r700_render.c @@ -59,9 +59,7 @@ void r700WaitForIdle(context_t *context); void r700WaitForIdleClean(context_t *context); -GLboolean r700SendTextureState(context_t *context); static unsigned int r700PrimitiveType(int prim); -void r600UpdateTextureState(GLcontext * ctx); GLboolean r700SyncSurf(context_t *context, struct radeon_bo *pbo, uint32_t read_domain, @@ -891,7 +889,7 @@ static GLboolean r700TryDrawPrims(GLcontext *ctx, r700SetScissor(context); r700SetupVertexProgram(ctx); r700SetupFragmentProgram(ctx); - r600UpdateTextureState(ctx); + r700UpdateShaderStates(ctx); GLuint emit_end = r700PredictRenderSize(ctx, prim, ib, nr_prims) + context->radeon.cmdbuf.cs->cdw; diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index b95fc87d30..41000dc8ce 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -54,7 +54,7 @@ #include "r700_fragprog.h" #include "r700_vertprog.h" - +void r600UpdateTextureState(GLcontext * ctx); static void r700SetClipPlaneState(GLcontext * ctx, GLenum cap, GLboolean state); static void r700UpdatePolygonMode(GLcontext * ctx); static void r700SetPolygonOffsetState(GLcontext * ctx, GLboolean state); @@ -191,6 +191,70 @@ static void r700InvalidateState(GLcontext * ctx, GLuint new_state) //----------- context->radeon.NewGLState |= new_state; } +static void r700SetDBRenderState(GLcontext * ctx) +{ + context_t *context = R700_CONTEXT(ctx); + R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); + struct r700_fragment_program *fp = (struct r700_fragment_program *) + (ctx->FragmentProgram._Current); + + R600_STATECHANGE(context, db); + + SETbit(r700->DB_SHADER_CONTROL.u32All, DUAL_EXPORT_ENABLE_bit); + SETfield(r700->DB_SHADER_CONTROL.u32All, EARLY_Z_THEN_LATE_Z, Z_ORDER_shift, Z_ORDER_mask); + /* XXX not sure if this is required */ + if (context->radeon.radeonScreen->chip_family < CHIP_FAMILY_RV770) + SETbit(r700->DB_RENDER_OVERRIDE.u32All, FORCE_SHADER_Z_ORDER_bit); + /* XXX need to enable htile for hiz/s */ + SETfield(r700->DB_RENDER_OVERRIDE.u32All, FORCE_DISABLE, FORCE_HIZ_ENABLE_shift, FORCE_HIZ_ENABLE_mask); + SETfield(r700->DB_RENDER_OVERRIDE.u32All, FORCE_DISABLE, FORCE_HIS_ENABLE0_shift, FORCE_HIS_ENABLE0_mask); + SETfield(r700->DB_RENDER_OVERRIDE.u32All, FORCE_DISABLE, FORCE_HIS_ENABLE1_shift, FORCE_HIS_ENABLE1_mask); + + if (context->radeon.query.current) + { + SETbit(r700->DB_RENDER_OVERRIDE.u32All, NOOP_CULL_DISABLE_bit); + if (context->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV770) + { + SETbit(r700->DB_RENDER_CONTROL.u32All, PERFECT_ZPASS_COUNTS_bit); + } + } + else + { + CLEARbit(r700->DB_RENDER_OVERRIDE.u32All, NOOP_CULL_DISABLE_bit); + if (context->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV770) + { + CLEARbit(r700->DB_RENDER_CONTROL.u32All, PERFECT_ZPASS_COUNTS_bit); + } + } + + if (fp) + { + if (fp->r700Shader.killIsUsed) + { + SETbit(r700->DB_SHADER_CONTROL.u32All, KILL_ENABLE_bit); + } + else + { + CLEARbit(r700->DB_SHADER_CONTROL.u32All, KILL_ENABLE_bit); + } + + if (fp->r700Shader.depthIsExported) + { + SETbit(r700->DB_SHADER_CONTROL.u32All, Z_EXPORT_ENABLE_bit); + } + else + { + CLEARbit(r700->DB_SHADER_CONTROL.u32All, Z_EXPORT_ENABLE_bit); + } + } +} + +void r700UpdateShaderStates(GLcontext * ctx) +{ + r700SetDBRenderState(ctx); + r600UpdateTextureState(ctx); +} + static void r700SetDepthState(GLcontext * ctx) { context_t *context = R700_CONTEXT(ctx); @@ -1672,24 +1736,10 @@ void r700InitState(GLcontext * ctx) //------------------- r700Enable(ctx, GL_DEPTH_TEST, ctx->Depth.Test); r700DepthMask(ctx, ctx->Depth.Mask); r700DepthFunc(ctx, ctx->Depth.Func); - SETbit(r700->DB_SHADER_CONTROL.u32All, DUAL_EXPORT_ENABLE_bit); - r700->DB_DEPTH_CLEAR.u32All = 0x3F800000; - - r700->DB_RENDER_CONTROL.u32All = 0; SETbit(r700->DB_RENDER_CONTROL.u32All, STENCIL_COMPRESS_DISABLE_bit); SETbit(r700->DB_RENDER_CONTROL.u32All, DEPTH_COMPRESS_DISABLE_bit); - r700->DB_RENDER_OVERRIDE.u32All = 0; - if (context->radeon.radeonScreen->chip_family < CHIP_FAMILY_RV770) - SETbit(r700->DB_RENDER_OVERRIDE.u32All, FORCE_SHADER_Z_ORDER_bit); - SETfield(r700->DB_RENDER_OVERRIDE.u32All, FORCE_DISABLE, FORCE_HIZ_ENABLE_shift, FORCE_HIZ_ENABLE_mask); - SETfield(r700->DB_RENDER_OVERRIDE.u32All, FORCE_DISABLE, FORCE_HIS_ENABLE0_shift, FORCE_HIS_ENABLE0_mask); - SETfield(r700->DB_RENDER_OVERRIDE.u32All, FORCE_DISABLE, FORCE_HIS_ENABLE1_shift, FORCE_HIS_ENABLE1_mask); - SETbit(r700->DB_RENDER_OVERRIDE.u32All, NOOP_CULL_DISABLE_bit); - if (context->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV770) - { - CLEARbit(r700->DB_RENDER_CONTROL.u32All, PERFECT_ZPASS_COUNTS_bit); - } + r700SetDBRenderState(ctx); r700->DB_ALPHA_TO_MASK.u32All = 0; SETfield(r700->DB_ALPHA_TO_MASK.u32All, 2, ALPHA_TO_MASK_OFFSET0_shift, ALPHA_TO_MASK_OFFSET0_mask); diff --git a/src/mesa/drivers/dri/r600/r700_state.h b/src/mesa/drivers/dri/r600/r700_state.h index 209189d8d7..60c6a7f23c 100644 --- a/src/mesa/drivers/dri/r600/r700_state.h +++ b/src/mesa/drivers/dri/r600/r700_state.h @@ -35,7 +35,7 @@ extern void r700UpdateStateParameters(GLcontext * ctx, GLuint new_state); extern void r700UpdateShaders (GLcontext * ctx); -extern void r700UpdateShaders2(GLcontext * ctx); +extern void r700UpdateShaderStates(GLcontext * ctx); extern void r700UpdateViewportOffset(GLcontext * ctx); -- cgit v1.2.3 From 74ef3207d8bd97a529e7b0ab8d99e44c805f3af0 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 9 Nov 2009 11:36:10 -0500 Subject: r600: don't emit htile regs These are needed for HiZ which is not currently used and the _BASE reg requires a reloc which is not currently supported in the drm. --- src/mesa/drivers/dri/r600/r700_chip.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index 06d7e9c9ab..8707a764ac 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -794,8 +794,7 @@ static void r700SendDBState(GLcontext *ctx, struct radeon_state_atom *atom) BATCH_LOCALS(&context->radeon); radeon_print(RADEON_STATE, RADEON_VERBOSE, "%s\n", __func__); - BEGIN_BATCH_NO_AUTOSTATE(23); - R600_OUT_BATCH_REGVAL(DB_HTILE_DATA_BASE, r700->DB_HTILE_DATA_BASE.u32All); + BEGIN_BATCH_NO_AUTOSTATE(17); R600_OUT_BATCH_REGSEQ(DB_STENCIL_CLEAR, 2); R600_OUT_BATCH(r700->DB_STENCIL_CLEAR.u32All); @@ -808,7 +807,6 @@ static void r700SendDBState(GLcontext *ctx, struct radeon_state_atom *atom) R600_OUT_BATCH(r700->DB_RENDER_CONTROL.u32All); R600_OUT_BATCH(r700->DB_RENDER_OVERRIDE.u32All); - R600_OUT_BATCH_REGVAL(DB_HTILE_SURFACE, r700->DB_HTILE_SURFACE.u32All); R600_OUT_BATCH_REGVAL(DB_ALPHA_TO_MASK, r700->DB_ALPHA_TO_MASK.u32All); END_BATCH(); @@ -1239,7 +1237,7 @@ void r600InitAtoms(context_t *context) context->radeon.hw.atomlist.name = "atom-list"; ALLOC_STATE(sq, always, 34, r700SendSQConfig); - ALLOC_STATE(db, always, 23, r700SendDBState); + ALLOC_STATE(db, always, 17, r700SendDBState); ALLOC_STATE(stencil, always, 4, r700SendStencilState); ALLOC_STATE(db_target, always, 12, r700SendDepthTargetState); ALLOC_STATE(sc, always, 15, r700SendSCState); -- cgit v1.2.3 From 216319fc0fe5dc3f298dd602812afa0f28a4ee60 Mon Sep 17 00:00:00 2001 From: Jerome Glisse Date: Mon, 9 Nov 2009 22:37:41 +0100 Subject: r600/r700: typo, fix mask of DB_ALPHA_TO_MASK --- src/mesa/drivers/dri/r600/r600_reg_r6xx.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r600_reg_r6xx.h b/src/mesa/drivers/dri/r600/r600_reg_r6xx.h index f7702c46de..74af7b4fed 100644 --- a/src/mesa/drivers/dri/r600/r600_reg_r6xx.h +++ b/src/mesa/drivers/dri/r600/r600_reg_r6xx.h @@ -415,11 +415,11 @@ enum { ALPHA_TO_MASK_ENABLE = 1 << 0, ALPHA_TO_MASK_OFFSET0_mask = 0x03 << 8, ALPHA_TO_MASK_OFFSET0_shift = 8, - ALPHA_TO_MASK_OFFSET1_mask = 0x03 << 8, + ALPHA_TO_MASK_OFFSET1_mask = 0x03 << 10, ALPHA_TO_MASK_OFFSET1_shift = 10, - ALPHA_TO_MASK_OFFSET2_mask = 0x03 << 8, + ALPHA_TO_MASK_OFFSET2_mask = 0x03 << 12, ALPHA_TO_MASK_OFFSET2_shift = 12, - ALPHA_TO_MASK_OFFSET3_mask = 0x03 << 8, + ALPHA_TO_MASK_OFFSET3_mask = 0x03 << 14, ALPHA_TO_MASK_OFFSET3_shift = 14, // SQ_VTX_CONSTANT_WORD2_0 = 0x00038008, -- cgit v1.2.3 From 83760d961fbaeaca8ab82ae497b26e90691f7654 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 10 Nov 2009 02:46:24 +0100 Subject: slang: Handle OOM condition in new_instruction(). --- src/mesa/shader/slang/slang_emit.c | 101 +++++++++++++++++++++++++++++-------- 1 file changed, 81 insertions(+), 20 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index 3af301eacd..d4a61dcd49 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -431,6 +431,9 @@ new_instruction(slang_emit_info *emitInfo, gl_inst_opcode opcode) _mesa_realloc_instructions(prog->Instructions, prog->NumInstructions, emitInfo->MaxInstructions); + if (!prog->Instructions) { + return NULL; + } } inst = prog->Instructions + prog->NumInstructions; @@ -451,12 +454,14 @@ emit_arl_load(slang_emit_info *emitInfo, gl_register_file file, GLint index, GLuint swizzle) { struct prog_instruction *inst = new_instruction(emitInfo, OPCODE_ARL); - inst->SrcReg[0].File = file; - inst->SrcReg[0].Index = index; - inst->SrcReg[0].Swizzle = fix_swizzle(swizzle); - inst->DstReg.File = PROGRAM_ADDRESS; - inst->DstReg.Index = 0; - inst->DstReg.WriteMask = WRITEMASK_X; + if (inst) { + inst->SrcReg[0].File = file; + inst->SrcReg[0].Index = index; + inst->SrcReg[0].Swizzle = fix_swizzle(swizzle); + inst->DstReg.File = PROGRAM_ADDRESS; + inst->DstReg.Index = 0; + inst->DstReg.WriteMask = WRITEMASK_X; + } return inst; } @@ -765,7 +770,9 @@ static struct prog_instruction * emit_comment(slang_emit_info *emitInfo, const char *comment) { struct prog_instruction *inst = new_instruction(emitInfo, OPCODE_NOP); - inst_comment(inst, comment); + if (inst) { + inst_comment(inst, comment); + } return inst; } @@ -1191,6 +1198,9 @@ emit_fcall(slang_emit_info *emitInfo, slang_ir_node *n) * really just a NOP to attach the label to. */ inst = new_instruction(emitInfo, OPCODE_BGNSUB); + if (!inst) { + return NULL; + } inst_comment(inst, n->Label->Name); } @@ -1202,10 +1212,16 @@ emit_fcall(slang_emit_info *emitInfo, slang_ir_node *n) inst = prev_instruction(emitInfo); if (inst && inst->Opcode != OPCODE_RET) { inst = new_instruction(emitInfo, OPCODE_RET); + if (!inst) { + return NULL; + } } if (emitInfo->EmitBeginEndSub) { inst = new_instruction(emitInfo, OPCODE_ENDSUB); + if (!inst) { + return NULL; + } inst_comment(inst, n->Label->Name); } @@ -1215,6 +1231,9 @@ emit_fcall(slang_emit_info *emitInfo, slang_ir_node *n) /* emit the function call */ inst = new_instruction(emitInfo, OPCODE_CAL); + if (!inst) { + return NULL; + } /* The branch target is just the subroutine number (changed later) */ inst->BranchTarget = subroutineId; inst_comment(inst, n->Label->Name); @@ -1249,6 +1268,9 @@ emit_kill(slang_emit_info *emitInfo) * Note that ARB-KILL depends on sign of vector operand. */ inst = new_instruction(emitInfo, OPCODE_KIL_NV); + if (!inst) { + return NULL; + } inst->DstReg.CondMask = COND_TR; /* always kill */ assert(emitInfo->prog->Target == GL_FRAGMENT_PROGRAM_ARB); @@ -1600,8 +1622,10 @@ emit_if(slang_emit_info *emitInfo, slang_ir_node *n) if (emitInfo->EmitHighLevelInstructions) { if (emitInfo->EmitCondCodes) { /* IF condcode THEN ... */ - struct prog_instruction *ifInst; - ifInst = new_instruction(emitInfo, OPCODE_IF); + struct prog_instruction *ifInst = new_instruction(emitInfo, OPCODE_IF); + if (!ifInst) { + return NULL; + } ifInst->DstReg.CondMask = COND_NE; /* if cond is non-zero */ /* only test the cond code (1 of 4) that was updated by the * previous instruction. @@ -1620,6 +1644,9 @@ emit_if(slang_emit_info *emitInfo, slang_ir_node *n) else { /* conditional jump to else, or endif */ struct prog_instruction *ifInst = new_instruction(emitInfo, OPCODE_BRA); + if (!ifInst) { + return NULL; + } ifInst->DstReg.CondMask = COND_EQ; /* BRA if cond is zero */ inst_comment(ifInst, "if zero"); ifInst->DstReg.CondSwizzle = writemask_to_swizzle(condWritemask); @@ -1632,12 +1659,17 @@ emit_if(slang_emit_info *emitInfo, slang_ir_node *n) /* have else body */ elseInstLoc = prog->NumInstructions; if (emitInfo->EmitHighLevelInstructions) { - (void) new_instruction(emitInfo, OPCODE_ELSE); + struct prog_instruction *inst = new_instruction(emitInfo, OPCODE_ELSE); + if (!inst) { + return NULL; + } } else { /* jump to endif instruction */ - struct prog_instruction *inst; - inst = new_instruction(emitInfo, OPCODE_BRA); + struct prog_instruction *inst = new_instruction(emitInfo, OPCODE_BRA); + if (!inst) { + return NULL; + } inst_comment(inst, "else"); inst->DstReg.CondMask = COND_TR; /* always branch */ } @@ -1650,7 +1682,10 @@ emit_if(slang_emit_info *emitInfo, slang_ir_node *n) } if (emitInfo->EmitHighLevelInstructions) { - (void) new_instruction(emitInfo, OPCODE_ENDIF); + struct prog_instruction *inst = new_instruction(emitInfo, OPCODE_ENDIF); + if (!inst) { + return NULL; + } } if (n->Children[2]) { @@ -1671,7 +1706,10 @@ emit_loop(slang_emit_info *emitInfo, slang_ir_node *n) /* emit OPCODE_BGNLOOP */ beginInstLoc = prog->NumInstructions; if (emitInfo->EmitHighLevelInstructions) { - (void) new_instruction(emitInfo, OPCODE_BGNLOOP); + struct prog_instruction *inst = new_instruction(emitInfo, OPCODE_BGNLOOP); + if (!inst) { + return NULL; + } } /* body */ @@ -1689,10 +1727,16 @@ emit_loop(slang_emit_info *emitInfo, slang_ir_node *n) if (emitInfo->EmitHighLevelInstructions) { /* emit OPCODE_ENDLOOP */ endInst = new_instruction(emitInfo, OPCODE_ENDLOOP); + if (!endInst) { + return NULL; + } } else { /* emit unconditional BRA-nch */ endInst = new_instruction(emitInfo, OPCODE_BRA); + if (!endInst) { + return NULL; + } endInst->DstReg.CondMask = COND_TR; /* always true */ } /* ENDLOOP's BranchTarget points to the BGNLOOP inst */ @@ -1762,7 +1806,9 @@ emit_cont_break(slang_emit_info *emitInfo, slang_ir_node *n) } n->InstLocation = emitInfo->prog->NumInstructions; inst = new_instruction(emitInfo, opcode); - inst->DstReg.CondMask = COND_TR; /* always true */ + if (inst) { + inst->DstReg.CondMask = COND_TR; /* always true */ + } return inst; } @@ -1798,8 +1844,10 @@ emit_cont_break_if_true(slang_emit_info *emitInfo, slang_ir_node *n) */ const GLuint condWritemask = inst->DstReg.WriteMask; inst = new_instruction(emitInfo, opcode); - inst->DstReg.CondMask = COND_NE; - inst->DstReg.CondSwizzle = writemask_to_swizzle(condWritemask); + if (inst) { + inst->DstReg.CondMask = COND_NE; + inst->DstReg.CondSwizzle = writemask_to_swizzle(condWritemask); + } return inst; } else { @@ -1817,7 +1865,13 @@ emit_cont_break_if_true(slang_emit_info *emitInfo, slang_ir_node *n) n->InstLocation = emitInfo->prog->NumInstructions; inst = new_instruction(emitInfo, opcode); + if (!inst) { + return NULL; + } inst = new_instruction(emitInfo, OPCODE_ENDIF); + if (!inst) { + return NULL; + } emitInfo->prog->Instructions[ifInstLoc].BranchTarget = emitInfo->prog->NumInstructions; @@ -1828,8 +1882,10 @@ emit_cont_break_if_true(slang_emit_info *emitInfo, slang_ir_node *n) const GLuint condWritemask = inst->DstReg.WriteMask; assert(emitInfo->EmitCondCodes); inst = new_instruction(emitInfo, OPCODE_BRA); - inst->DstReg.CondMask = COND_NE; - inst->DstReg.CondSwizzle = writemask_to_swizzle(condWritemask); + if (inst) { + inst->DstReg.CondMask = COND_NE; + inst->DstReg.CondSwizzle = writemask_to_swizzle(condWritemask); + } return inst; } } @@ -2201,7 +2257,9 @@ emit(slang_emit_info *emitInfo, slang_ir_node *n) if (n->Comment) { inst = new_instruction(emitInfo, OPCODE_NOP); - inst->Comment = _mesa_strdup(n->Comment); + if (inst) { + inst->Comment = _mesa_strdup(n->Comment); + } inst = NULL; } @@ -2503,6 +2561,9 @@ _slang_emit_code(slang_ir_node *n, slang_var_table *vt, if (withEnd) { struct prog_instruction *inst; inst = new_instruction(&emitInfo, OPCODE_END); + if (!inst) { + return GL_FALSE; + } } _slang_resolve_subroutines(&emitInfo); -- cgit v1.2.3 From b2a29ad3092c17f9a7d75ab123ec5c4619c87ec3 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 10 Nov 2009 03:25:06 +0100 Subject: slang: Fix signed/unsigned int handling in _slang_free_temp(). --- src/mesa/shader/slang/slang_vartable.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/slang/slang_vartable.c b/src/mesa/shader/slang/slang_vartable.c index a4ebacc093..e07e3a226a 100644 --- a/src/mesa/shader/slang/slang_vartable.c +++ b/src/mesa/shader/slang/slang_vartable.c @@ -311,10 +311,10 @@ _slang_free_temp(slang_var_table *vt, slang_ir_storage *store) { struct table *t = vt->Top; GLuint i; - GLuint r = store->Index; + GLint r = store->Index; assert(store->Size > 0); assert(r >= 0); - assert(r + store->Size <= vt->MaxRegisters * 4); + assert((GLuint)r + store->Size <= vt->MaxRegisters * 4); if (dbg) printf("Free temp sz %d at %d.%s (level %d) store %p\n", store->Size, r, _mesa_swizzle_string(store->Swizzle, 0, 0), -- cgit v1.2.3 From cc470bf0ca65592b834c31c662fc795fb7acc58c Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 10 Nov 2009 04:03:55 +0100 Subject: slang: Check return value from new_instruction(). --- src/mesa/shader/slang/slang_emit.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index d4a61dcd49..5eabe615b9 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -1254,7 +1254,9 @@ emit_return(slang_emit_info *emitInfo, slang_ir_node *n) assert(n->Opcode == IR_RETURN); assert(n->Label); inst = new_instruction(emitInfo, OPCODE_RET); - inst->DstReg.CondMask = COND_TR; /* always return */ + if (inst) { + inst->DstReg.CondMask = COND_TR; /* always return */ + } return inst; } -- cgit v1.2.3 From 413e933fd57c53e6d6659cfcf21aba42249f43ca Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 10 Nov 2009 18:27:20 +0100 Subject: slang: Check OOM conditions for alloc_node_storage(). --- src/mesa/shader/slang/slang_emit.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index 5eabe615b9..18d0146277 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -195,6 +195,9 @@ alloc_node_storage(slang_emit_info *emitInfo, slang_ir_node *n, if (!n->Store) { assert(defaultSize > 0); n->Store = _slang_new_ir_storage(PROGRAM_TEMPORARY, -1, defaultSize); + if (!n->Store) { + return GL_FALSE; + } } /* now allocate actual register(s). I.e. set n->Store->Index >= 0 */ @@ -799,7 +802,9 @@ emit_arith(slang_emit_info *emitInfo, slang_ir_node *n) emit(emitInfo, n->Children[0]->Children[0]); /* A */ emit(emitInfo, n->Children[0]->Children[1]); /* B */ emit(emitInfo, n->Children[1]); /* C */ - alloc_node_storage(emitInfo, n, -1); /* dest */ + if (alloc_node_storage(emitInfo, n, -1)) { /* dest */ + return NULL; + } inst = emit_instruction(emitInfo, OPCODE_MAD, @@ -820,7 +825,9 @@ emit_arith(slang_emit_info *emitInfo, slang_ir_node *n) emit(emitInfo, n->Children[0]); /* A */ emit(emitInfo, n->Children[1]->Children[0]); /* B */ emit(emitInfo, n->Children[1]->Children[1]); /* C */ - alloc_node_storage(emitInfo, n, -1); /* dest */ + if (!alloc_node_storage(emitInfo, n, -1)) { /* dest */ + return NULL; + } inst = emit_instruction(emitInfo, OPCODE_MAD, @@ -846,7 +853,9 @@ emit_arith(slang_emit_info *emitInfo, slang_ir_node *n) } /* result storage */ - alloc_node_storage(emitInfo, n, -1); + if (!alloc_node_storage(emitInfo, n, -1)) { + return NULL; + } inst = emit_instruction(emitInfo, info->InstOpcode, @@ -1100,7 +1109,9 @@ emit_clamp(slang_emit_info *emitInfo, slang_ir_node *n) * the intermediate result. Use a temp register instead. */ _mesa_bzero(&tmpNode, sizeof(tmpNode)); - alloc_node_storage(emitInfo, &tmpNode, n->Store->Size); + if (!alloc_node_storage(emitInfo, &tmpNode, n->Store->Size)) { + return NULL; + } /* tmp = max(ch[0], ch[1]) */ inst = emit_instruction(emitInfo, OPCODE_MAX, -- cgit v1.2.3 From 28039ffdc8a7eb7d8578534a46b78ae43d16112c Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 10 Nov 2009 19:25:17 +0100 Subject: slang: Fix return value check. --- src/mesa/shader/slang/slang_emit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index 18d0146277..c0e4b27aa5 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -802,7 +802,7 @@ emit_arith(slang_emit_info *emitInfo, slang_ir_node *n) emit(emitInfo, n->Children[0]->Children[0]); /* A */ emit(emitInfo, n->Children[0]->Children[1]); /* B */ emit(emitInfo, n->Children[1]); /* C */ - if (alloc_node_storage(emitInfo, n, -1)) { /* dest */ + if (!alloc_node_storage(emitInfo, n, -1)) { /* dest */ return NULL; } -- cgit v1.2.3 From d52d78b4bcd6d4c0578f972c0b8ebac09e632196 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 10 Nov 2009 10:43:19 -0800 Subject: i965: Allow use of PROGRAM_LOCAL constants in ARB_vp. Fixes piglit arl.vp. --- src/mesa/drivers/dri/i965/brw_vs_emit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c index 1638ef8111..604d63d5f2 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_emit.c +++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c @@ -912,6 +912,7 @@ get_src_reg( struct brw_vs_compile *c, case PROGRAM_CONSTANT: case PROGRAM_UNIFORM: case PROGRAM_ENV_PARAM: + case PROGRAM_LOCAL_PARAM: if (c->vp->use_const_buffer) { return get_constant(c, inst, argIndex); } @@ -930,7 +931,6 @@ get_src_reg( struct brw_vs_compile *c, /* this is a normal case since we loop over all three src args */ return brw_null_reg(); - case PROGRAM_LOCAL_PARAM: case PROGRAM_WRITE_ONLY: default: assert(0); -- cgit v1.2.3 From 56ab92bad8f1d05bc22b8a8471d5aeb663f220de Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 10 Nov 2009 10:54:15 -0800 Subject: i965: Unalias src/dst registers for SGE and friends. Fixes piglit vp-sge-alias test, and the googleearth ground shader. \o/ Bug #22228 --- src/mesa/drivers/dri/i965/brw_vs_emit.c | 40 +++++++++++++++++---------------- 1 file changed, 21 insertions(+), 19 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c index 604d63d5f2..15154c3b8e 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_emit.c +++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c @@ -331,63 +331,65 @@ static void unalias3( struct brw_vs_compile *c, } } -static void emit_sop( struct brw_compile *p, +static void emit_sop( struct brw_vs_compile *c, struct brw_reg dst, struct brw_reg arg0, struct brw_reg arg1, GLuint cond) { + struct brw_compile *p = &c->func; + brw_MOV(p, dst, brw_imm_f(0.0f)); brw_CMP(p, brw_null_reg(), cond, arg0, arg1); brw_MOV(p, dst, brw_imm_f(1.0f)); brw_set_predicate_control_flag_value(p, 0xff); } -static void emit_seq( struct brw_compile *p, +static void emit_seq( struct brw_vs_compile *c, struct brw_reg dst, struct brw_reg arg0, struct brw_reg arg1 ) { - emit_sop(p, dst, arg0, arg1, BRW_CONDITIONAL_EQ); + emit_sop(c, dst, arg0, arg1, BRW_CONDITIONAL_EQ); } -static void emit_sne( struct brw_compile *p, +static void emit_sne( struct brw_vs_compile *c, struct brw_reg dst, struct brw_reg arg0, struct brw_reg arg1 ) { - emit_sop(p, dst, arg0, arg1, BRW_CONDITIONAL_NEQ); + emit_sop(c, dst, arg0, arg1, BRW_CONDITIONAL_NEQ); } -static void emit_slt( struct brw_compile *p, +static void emit_slt( struct brw_vs_compile *c, struct brw_reg dst, struct brw_reg arg0, struct brw_reg arg1 ) { - emit_sop(p, dst, arg0, arg1, BRW_CONDITIONAL_L); + emit_sop(c, dst, arg0, arg1, BRW_CONDITIONAL_L); } -static void emit_sle( struct brw_compile *p, +static void emit_sle( struct brw_vs_compile *c, struct brw_reg dst, struct brw_reg arg0, struct brw_reg arg1 ) { - emit_sop(p, dst, arg0, arg1, BRW_CONDITIONAL_LE); + emit_sop(c, dst, arg0, arg1, BRW_CONDITIONAL_LE); } -static void emit_sgt( struct brw_compile *p, +static void emit_sgt( struct brw_vs_compile *c, struct brw_reg dst, struct brw_reg arg0, struct brw_reg arg1 ) { - emit_sop(p, dst, arg0, arg1, BRW_CONDITIONAL_G); + emit_sop(c, dst, arg0, arg1, BRW_CONDITIONAL_G); } -static void emit_sge( struct brw_compile *p, +static void emit_sge( struct brw_vs_compile *c, struct brw_reg dst, struct brw_reg arg0, struct brw_reg arg1 ) { - emit_sop(p, dst, arg0, arg1, BRW_CONDITIONAL_GE); + emit_sop(c, dst, arg0, arg1, BRW_CONDITIONAL_GE); } static void emit_max( struct brw_compile *p, @@ -1473,25 +1475,25 @@ void brw_vs_emit(struct brw_vs_compile *c ) break; case OPCODE_SEQ: - emit_seq(p, dst, args[0], args[1]); + unalias2(c, dst, args[0], args[1], emit_seq); break; case OPCODE_SIN: emit_math1(c, BRW_MATH_FUNCTION_SIN, dst, args[0], BRW_MATH_PRECISION_FULL); break; case OPCODE_SNE: - emit_sne(p, dst, args[0], args[1]); + unalias2(c, dst, args[0], args[1], emit_sne); break; case OPCODE_SGE: - emit_sge(p, dst, args[0], args[1]); + unalias2(c, dst, args[0], args[1], emit_sge); break; case OPCODE_SGT: - emit_sgt(p, dst, args[0], args[1]); + unalias2(c, dst, args[0], args[1], emit_sgt); break; case OPCODE_SLT: - emit_slt(p, dst, args[0], args[1]); + unalias2(c, dst, args[0], args[1], emit_slt); break; case OPCODE_SLE: - emit_sle(p, dst, args[0], args[1]); + unalias2(c, dst, args[0], args[1], emit_sle); break; case OPCODE_SUB: brw_ADD(p, dst, args[0], negate(args[1])); -- cgit v1.2.3 From eb6a1f8a00596156cd7164838ef9e9a5b39e7254 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 10 Nov 2009 13:57:29 -0800 Subject: i965: Add a note explaining the data cache domain. --- src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index 0bf735c0f2..e2f0a383e7 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -358,7 +358,10 @@ brw_create_constant_surface( struct brw_context *brw, NULL, NULL); if (key->bo) { - /* Emit relocation to surface contents */ + /* Emit relocation to surface contents. Section 5.1.1 of the gen4 + * bspec ("Data Cache") says that the data cache does not exist as + * a separate cache and is just the sampler cache. + */ dri_bo_emit_reloc(bo, I915_GEM_DOMAIN_SAMPLER, 0, 0, -- cgit v1.2.3 From c5413839b3e99c7b162f1260142f3c175502b0ce Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 10 Nov 2009 15:51:29 -0800 Subject: i965: avoid memsetting all the BRW_WM_MAX_INSN arrays for every compile. For an app that's blowing out the state cache, like sauerbraten, the memset of the giant arrays ended up taking 11% of the CPU even when only a "few" of the entries got used. With this, the WM program compile drops back down to 1% of CPU time. Bug #24981 (bisected to BRW_WM_MAX_INSN increase). --- src/mesa/drivers/dri/i965/brw_wm.c | 14 ++++++++++++++ src/mesa/drivers/dri/i965/brw_wm.h | 8 ++++---- src/mesa/drivers/dri/i965/brw_wm_fp.c | 2 ++ src/mesa/drivers/dri/i965/brw_wm_pass0.c | 3 +++ 4 files changed, 23 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index 964ee104c2..d8971321f3 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -152,8 +152,22 @@ static void do_wm_prog( struct brw_context *brw, */ return; } + c->instruction = _mesa_calloc(BRW_WM_MAX_INSN * sizeof(*c->instruction)); + c->prog_instructions = _mesa_calloc(BRW_WM_MAX_INSN * + sizeof(*c->prog_instructions)); + c->vreg = _mesa_calloc(BRW_WM_MAX_VREG * sizeof(*c->vreg)); + c->refs = _mesa_calloc(BRW_WM_MAX_REF * sizeof(*c->refs)); + c->vreg = _mesa_calloc(BRW_WM_MAX_VREG * sizeof(*c->vreg)); } else { + void *instruction = c->instruction; + void *prog_instructions = c->prog_instructions; + void *vreg = c->vreg; + void *refs = c->refs; memset(c, 0, sizeof(*brw->wm.compile_data)); + c->instruction = instruction; + c->prog_instructions = prog_instructions; + c->vreg = vreg; + c->refs = refs; } memcpy(&c->key, key, sizeof(*key)); diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index 1fa2f1c06c..7db212e392 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -202,7 +202,7 @@ struct brw_wm_compile { * simplifying and adding instructions for interpolation and * framebuffer writes. */ - struct prog_instruction prog_instructions[BRW_WM_MAX_INSN]; + struct prog_instruction *prog_instructions; GLuint nr_fp_insns; GLuint fp_temp; GLuint fp_interp_emitted; @@ -213,7 +213,7 @@ struct brw_wm_compile { struct prog_src_register pixel_w; - struct brw_wm_value vreg[BRW_WM_MAX_VREG]; + struct brw_wm_value *vreg; GLuint nr_vreg; struct brw_wm_value creg[BRW_WM_MAX_PARAM]; @@ -230,10 +230,10 @@ struct brw_wm_compile { struct brw_wm_ref undef_ref; struct brw_wm_value undef_value; - struct brw_wm_ref refs[BRW_WM_MAX_REF]; + struct brw_wm_ref *refs; GLuint nr_refs; - struct brw_wm_instruction instruction[BRW_WM_MAX_INSN]; + struct brw_wm_instruction *instruction; GLuint nr_insns; struct brw_wm_constref constref[BRW_WM_MAX_CONST]; diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c index 549afd31de..1c4f62ba48 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_fp.c +++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c @@ -182,6 +182,8 @@ static void release_temp( struct brw_wm_compile *c, struct prog_dst_register tem static struct prog_instruction *get_fp_inst(struct brw_wm_compile *c) { assert(c->nr_fp_insns < BRW_WM_MAX_INSN); + memset(&c->prog_instructions[c->nr_fp_insns], 0, + sizeof(*c->prog_instructions)); return &c->prog_instructions[c->nr_fp_insns++]; } diff --git a/src/mesa/drivers/dri/i965/brw_wm_pass0.c b/src/mesa/drivers/dri/i965/brw_wm_pass0.c index 602b1351ef..ff4c082d5e 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_pass0.c +++ b/src/mesa/drivers/dri/i965/brw_wm_pass0.c @@ -42,12 +42,14 @@ static struct brw_wm_ref *get_ref( struct brw_wm_compile *c ) { assert(c->nr_refs < BRW_WM_MAX_REF); + memset(&c->refs[c->nr_refs], 0, sizeof(*c->refs)); return &c->refs[c->nr_refs++]; } static struct brw_wm_value *get_value( struct brw_wm_compile *c) { assert(c->nr_refs < BRW_WM_MAX_VREG); + memset(&c->vreg[c->nr_vreg], 0, sizeof(*c->vreg)); return &c->vreg[c->nr_vreg++]; } @@ -55,6 +57,7 @@ static struct brw_wm_value *get_value( struct brw_wm_compile *c) static struct brw_wm_instruction *get_instruction( struct brw_wm_compile *c ) { assert(c->nr_insns < BRW_WM_MAX_INSN); + memset(&c->instruction[c->nr_insns], 0, sizeof(*c->instruction)); return &c->instruction[c->nr_insns++]; } -- cgit v1.2.3 From a492ab765a9e36c5f224f0d58e172ca6ecf25a1c Mon Sep 17 00:00:00 2001 From: brian Date: Tue, 10 Nov 2009 15:33:31 -0700 Subject: mesa: added comment for check_begin_texture_render() --- src/mesa/main/fbobject.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index c4454550db..2641123857 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1149,6 +1149,11 @@ _mesa_IsFramebufferEXT(GLuint framebuffer) } +/** + * Check if any of the attachments of the given framebuffer are textures + * (render to texture). Call ctx->Driver.RenderTexture() for such + * attachments. + */ static void check_begin_texture_render(GLcontext *ctx, struct gl_framebuffer *fb) { -- cgit v1.2.3 From e6f60d30375c637c0823a9aade8098a45f70d6a7 Mon Sep 17 00:00:00 2001 From: brian Date: Tue, 10 Nov 2009 15:47:34 -0700 Subject: mesa: rename vars in _mesa_BindFramebufferEXT() --- src/mesa/main/fbobject.c | 43 +++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 22 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 2641123857..5896f1b95f 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1193,7 +1193,7 @@ check_end_texture_render(GLcontext *ctx, struct gl_framebuffer *fb) void GLAPIENTRY _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) { - struct gl_framebuffer *newFb, *newFbread; + struct gl_framebuffer *newDrawFb, *newReadFb; GLboolean bindReadBuf, bindDrawBuf; GET_CURRENT_CONTEXT(ctx); @@ -1242,74 +1242,73 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) if (framebuffer) { /* Binding a user-created framebuffer object */ - newFb = _mesa_lookup_framebuffer(ctx, framebuffer); - if (newFb == &DummyFramebuffer) { + newDrawFb = _mesa_lookup_framebuffer(ctx, framebuffer); + if (newDrawFb == &DummyFramebuffer) { /* ID was reserved, but no real framebuffer object made yet */ - newFb = NULL; + newDrawFb = NULL; } - else if (!newFb && ctx->Extensions.ARB_framebuffer_object) { + else if (!newDrawFb && ctx->Extensions.ARB_framebuffer_object) { /* All FBO IDs must be Gen'd */ _mesa_error(ctx, GL_INVALID_OPERATION, "glBindFramebuffer(buffer)"); return; } - if (!newFb) { + if (!newDrawFb) { /* create new framebuffer object */ - newFb = ctx->Driver.NewFramebuffer(ctx, framebuffer); - if (!newFb) { + newDrawFb = ctx->Driver.NewFramebuffer(ctx, framebuffer); + if (!newDrawFb) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindFramebufferEXT"); return; } - _mesa_HashInsert(ctx->Shared->FrameBuffers, framebuffer, newFb); + _mesa_HashInsert(ctx->Shared->FrameBuffers, framebuffer, newDrawFb); } - newFbread = newFb; + newReadFb = newDrawFb; } else { /* Binding the window system framebuffer (which was originally set * with MakeCurrent). */ - newFb = ctx->WinSysDrawBuffer; - newFbread = ctx->WinSysReadBuffer; + newDrawFb = ctx->WinSysDrawBuffer; + newReadFb = ctx->WinSysReadBuffer; } - ASSERT(newFb); - ASSERT(newFb != &DummyFramebuffer); + ASSERT(newDrawFb); + ASSERT(newDrawFb != &DummyFramebuffer); /* * OK, now bind the new Draw/Read framebuffers, if they're changing. */ if (bindReadBuf) { - if (ctx->ReadBuffer == newFbread) { + if (ctx->ReadBuffer == newReadFb) { bindReadBuf = GL_FALSE; /* no change */ } else { FLUSH_VERTICES(ctx, _NEW_BUFFERS); - _mesa_reference_framebuffer(&ctx->ReadBuffer, newFbread); + _mesa_reference_framebuffer(&ctx->ReadBuffer, newReadFb); } } if (bindDrawBuf) { - /* check if old FB had any texture attachments */ if (ctx->DrawBuffer->Name != 0) { check_end_texture_render(ctx, ctx->DrawBuffer); } - if (ctx->DrawBuffer == newFb) { + if (ctx->DrawBuffer == newDrawFb) { bindDrawBuf = GL_FALSE; /* no change */ } else { FLUSH_VERTICES(ctx, _NEW_BUFFERS); - _mesa_reference_framebuffer(&ctx->DrawBuffer, newFb); + _mesa_reference_framebuffer(&ctx->DrawBuffer, newDrawFb); } - if (newFb->Name != 0) { + if (newDrawFb->Name != 0) { /* check if newly bound framebuffer has any texture attachments */ - check_begin_texture_render(ctx, newFb); + check_begin_texture_render(ctx, newDrawFb); } } if ((bindDrawBuf || bindReadBuf) && ctx->Driver.BindFramebuffer) { - ctx->Driver.BindFramebuffer(ctx, target, newFb, newFbread); + ctx->Driver.BindFramebuffer(ctx, target, newDrawFb, newReadFb); } } -- cgit v1.2.3 From d96e55fa7bbbc033f47dbeb942b872c6d21eb42d Mon Sep 17 00:00:00 2001 From: brian Date: Tue, 10 Nov 2009 15:50:22 -0700 Subject: mesa: new vars: oldDrawFb, oldReadFb in _mesa_BindFramebufferEXT() --- src/mesa/main/fbobject.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 5896f1b95f..9bf43416a6 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1194,6 +1194,7 @@ void GLAPIENTRY _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) { struct gl_framebuffer *newDrawFb, *newReadFb; + struct gl_framebuffer *oldDrawFb, *oldReadFb; GLboolean bindReadBuf, bindDrawBuf; GET_CURRENT_CONTEXT(ctx); @@ -1275,11 +1276,14 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) ASSERT(newDrawFb); ASSERT(newDrawFb != &DummyFramebuffer); + oldDrawFb = ctx->DrawBuffer; + oldReadFb = ctx->ReadBuffer; + /* * OK, now bind the new Draw/Read framebuffers, if they're changing. */ if (bindReadBuf) { - if (ctx->ReadBuffer == newReadFb) { + if (oldReadFb == newReadFb) { bindReadBuf = GL_FALSE; /* no change */ } else { @@ -1289,11 +1293,11 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) } if (bindDrawBuf) { - if (ctx->DrawBuffer->Name != 0) { + if (oldDrawFb->Name != 0) { check_end_texture_render(ctx, ctx->DrawBuffer); } - if (ctx->DrawBuffer == newDrawFb) { + if (oldDrawFb == newDrawFb) { bindDrawBuf = GL_FALSE; /* no change */ } else { -- cgit v1.2.3 From bc569cd6bee0550c7f83412476b6b39e89c51ac3 Mon Sep 17 00:00:00 2001 From: brian Date: Tue, 10 Nov 2009 16:00:35 -0700 Subject: mesa: move check_begin/end_texture_render() calls --- src/mesa/main/fbobject.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 9bf43416a6..6d8d1876d6 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1288,26 +1288,28 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) } else { FLUSH_VERTICES(ctx, _NEW_BUFFERS); + _mesa_reference_framebuffer(&ctx->ReadBuffer, newReadFb); } } if (bindDrawBuf) { - if (oldDrawFb->Name != 0) { - check_end_texture_render(ctx, ctx->DrawBuffer); - } - if (oldDrawFb == newDrawFb) { bindDrawBuf = GL_FALSE; /* no change */ } else { FLUSH_VERTICES(ctx, _NEW_BUFFERS); - _mesa_reference_framebuffer(&ctx->DrawBuffer, newDrawFb); - } - if (newDrawFb->Name != 0) { - /* check if newly bound framebuffer has any texture attachments */ - check_begin_texture_render(ctx, newDrawFb); + if (oldDrawFb->Name != 0) { + check_end_texture_render(ctx, oldDrawFb); + } + + if (newDrawFb->Name != 0) { + /* check if newly bound framebuffer has any texture attachments */ + check_begin_texture_render(ctx, newDrawFb); + } + + _mesa_reference_framebuffer(&ctx->DrawBuffer, newDrawFb); } } -- cgit v1.2.3 From a65b84d9554815af891d793012eba17de80cbfa3 Mon Sep 17 00:00:00 2001 From: brian Date: Tue, 10 Nov 2009 18:02:03 -0700 Subject: mesa: fix some begin/end render-to-texture logic Before, we weren't aggressive enough in checking for the start or end of render-to-texture. In particular, if only the ctx->ReadBuffer had texture attachments, we were treating that as a render-to-texture case. This fixes a regression from commit 75bdbdd90b15c8704d87ca195a364ff6a42edbb1 "intel: Don't validate in a texture image used as a render target." --- src/mesa/main/fbobject.c | 59 +++++++++++++++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 21 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 6d8d1876d6..2d0bfb3ad7 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1159,6 +1159,10 @@ check_begin_texture_render(GLcontext *ctx, struct gl_framebuffer *fb) { GLuint i; ASSERT(ctx->Driver.RenderTexture); + + if (fb->Name == 0) + return; /* can't render to texture with winsys framebuffers */ + for (i = 0; i < BUFFER_COUNT; i++) { struct gl_renderbuffer_attachment *att = fb->Attachment + i; struct gl_texture_object *texObj = att->Texture; @@ -1178,6 +1182,9 @@ check_begin_texture_render(GLcontext *ctx, struct gl_framebuffer *fb) static void check_end_texture_render(GLcontext *ctx, struct gl_framebuffer *fb) { + if (fb->Name == 0) + return; /* can't render to texture with winsys framebuffers */ + if (ctx->Driver.FinishRenderTexture) { GLuint i; for (i = 0; i < BUFFER_COUNT; i++) { @@ -1276,41 +1283,51 @@ _mesa_BindFramebufferEXT(GLenum target, GLuint framebuffer) ASSERT(newDrawFb); ASSERT(newDrawFb != &DummyFramebuffer); + /* save pointers to current/old framebuffers */ oldDrawFb = ctx->DrawBuffer; oldReadFb = ctx->ReadBuffer; + /* check if really changing bindings */ + if (oldDrawFb == newDrawFb) + bindDrawBuf = GL_FALSE; + if (oldReadFb == newReadFb) + bindReadBuf = GL_FALSE; + /* * OK, now bind the new Draw/Read framebuffers, if they're changing. + * + * We also check if we're beginning and/or ending render-to-texture. + * When a framebuffer with texture attachments is unbound, call + * ctx->Driver.FinishRenderTexture(). + * When a framebuffer with texture attachments is bound, call + * ctx->Driver.RenderTexture(). + * + * Note that if the ReadBuffer has texture attachments we don't consider + * that a render-to-texture case. */ if (bindReadBuf) { - if (oldReadFb == newReadFb) { - bindReadBuf = GL_FALSE; /* no change */ - } - else { - FLUSH_VERTICES(ctx, _NEW_BUFFERS); + FLUSH_VERTICES(ctx, _NEW_BUFFERS); - _mesa_reference_framebuffer(&ctx->ReadBuffer, newReadFb); - } + /* check if old readbuffer was render-to-texture */ + check_end_texture_render(ctx, oldReadFb); + + _mesa_reference_framebuffer(&ctx->ReadBuffer, newReadFb); } if (bindDrawBuf) { - if (oldDrawFb == newDrawFb) { - bindDrawBuf = GL_FALSE; /* no change */ - } - else { - FLUSH_VERTICES(ctx, _NEW_BUFFERS); + FLUSH_VERTICES(ctx, _NEW_BUFFERS); - if (oldDrawFb->Name != 0) { - check_end_texture_render(ctx, oldDrawFb); - } + /* check if old read/draw buffers were render-to-texture */ + if (!bindReadBuf) + check_end_texture_render(ctx, oldReadFb); - if (newDrawFb->Name != 0) { - /* check if newly bound framebuffer has any texture attachments */ - check_begin_texture_render(ctx, newDrawFb); - } + if (oldDrawFb != oldReadFb) + check_end_texture_render(ctx, oldDrawFb); - _mesa_reference_framebuffer(&ctx->DrawBuffer, newDrawFb); - } + /* check if newly bound framebuffer has any texture attachments */ + check_begin_texture_render(ctx, newDrawFb); + + _mesa_reference_framebuffer(&ctx->DrawBuffer, newDrawFb); } if ((bindDrawBuf || bindReadBuf) && ctx->Driver.BindFramebuffer) { -- cgit v1.2.3 From b81f213157538ab050dbdfc22d6be0d2418c634b Mon Sep 17 00:00:00 2001 From: brian Date: Tue, 10 Nov 2009 18:23:59 -0700 Subject: swrast: update renderbuffer format assertions --- src/mesa/swrast/s_readpix.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c index a1aeb2e01f..a855fd8068 100644 --- a/src/mesa/swrast/s_readpix.c +++ b/src/mesa/swrast/s_readpix.c @@ -29,6 +29,7 @@ #include "main/convolve.h" #include "main/context.h" #include "main/feedback.h" +#include "main/formats.h" #include "main/image.h" #include "main/macros.h" #include "main/imports.h" @@ -107,7 +108,7 @@ read_depth_pixels( GLcontext *ctx, && !biasOrScale && !packing->SwapBytes) { /* Special case: directly read 16-bit unsigned depth values. */ GLint j; - ASSERT(rb->InternalFormat == GL_DEPTH_COMPONENT16); + ASSERT(rb->Format == MESA_FORMAT_Z16); ASSERT(rb->DataType == GL_UNSIGNED_SHORT); for (j = 0; j < height; j++, y++) { void *dest =_mesa_image_address2d(packing, pixels, width, height, @@ -119,7 +120,7 @@ read_depth_pixels( GLcontext *ctx, && !biasOrScale && !packing->SwapBytes) { /* Special case: directly read 24-bit unsigned depth values. */ GLint j; - ASSERT(rb->InternalFormat == GL_DEPTH_COMPONENT24); + ASSERT(rb->Format == MESA_FORMAT_X8_Z24); ASSERT(rb->DataType == GL_UNSIGNED_INT); for (j = 0; j < height; j++, y++) { GLuint *dest = (GLuint *) @@ -138,7 +139,7 @@ read_depth_pixels( GLcontext *ctx, && !biasOrScale && !packing->SwapBytes) { /* Special case: directly read 32-bit unsigned depth values. */ GLint j; - ASSERT(rb->InternalFormat == GL_DEPTH_COMPONENT32); + ASSERT(rb->Format == MESA_FORMAT_Z32); ASSERT(rb->DataType == GL_UNSIGNED_INT); for (j = 0; j < height; j++, y++) { void *dest = _mesa_image_address2d(packing, pixels, width, height, -- cgit v1.2.3 From 23a4a6727efb5c8b2bf84f88f638c15e7255b363 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 10 Nov 2009 10:43:19 -0800 Subject: i965: Allow use of PROGRAM_LOCAL constants in ARB_vp. Fixes piglit arl.vp. (cherry picked from commit d52d78b4bcd6d4c0578f972c0b8ebac09e632196) --- src/mesa/drivers/dri/i965/brw_vs_emit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c index 108e19cdbc..ec1f22c92d 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_emit.c +++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c @@ -912,6 +912,7 @@ get_src_reg( struct brw_vs_compile *c, case PROGRAM_CONSTANT: case PROGRAM_UNIFORM: case PROGRAM_ENV_PARAM: + case PROGRAM_LOCAL_PARAM: if (c->vp->use_const_buffer) { return get_constant(c, inst, argIndex); } @@ -930,7 +931,6 @@ get_src_reg( struct brw_vs_compile *c, /* this is a normal case since we loop over all three src args */ return brw_null_reg(); - case PROGRAM_LOCAL_PARAM: case PROGRAM_WRITE_ONLY: default: assert(0); -- cgit v1.2.3 From e5ffb9f5ea03c2acd148222259a334cde0f3afc9 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 10 Nov 2009 10:54:15 -0800 Subject: i965: Unalias src/dst registers for SGE and friends. Fixes piglit vp-sge-alias test, and the googleearth ground shader. \o/ Bug #22228 (cherry picked from commit 56ab92bad8f1d05bc22b8a8471d5aeb663f220de) --- src/mesa/drivers/dri/i965/brw_vs_emit.c | 40 +++++++++++++++++---------------- 1 file changed, 21 insertions(+), 19 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c index ec1f22c92d..a4f34660de 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_emit.c +++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c @@ -331,63 +331,65 @@ static void unalias3( struct brw_vs_compile *c, } } -static void emit_sop( struct brw_compile *p, +static void emit_sop( struct brw_vs_compile *c, struct brw_reg dst, struct brw_reg arg0, struct brw_reg arg1, GLuint cond) { + struct brw_compile *p = &c->func; + brw_MOV(p, dst, brw_imm_f(0.0f)); brw_CMP(p, brw_null_reg(), cond, arg0, arg1); brw_MOV(p, dst, brw_imm_f(1.0f)); brw_set_predicate_control_flag_value(p, 0xff); } -static void emit_seq( struct brw_compile *p, +static void emit_seq( struct brw_vs_compile *c, struct brw_reg dst, struct brw_reg arg0, struct brw_reg arg1 ) { - emit_sop(p, dst, arg0, arg1, BRW_CONDITIONAL_EQ); + emit_sop(c, dst, arg0, arg1, BRW_CONDITIONAL_EQ); } -static void emit_sne( struct brw_compile *p, +static void emit_sne( struct brw_vs_compile *c, struct brw_reg dst, struct brw_reg arg0, struct brw_reg arg1 ) { - emit_sop(p, dst, arg0, arg1, BRW_CONDITIONAL_NEQ); + emit_sop(c, dst, arg0, arg1, BRW_CONDITIONAL_NEQ); } -static void emit_slt( struct brw_compile *p, +static void emit_slt( struct brw_vs_compile *c, struct brw_reg dst, struct brw_reg arg0, struct brw_reg arg1 ) { - emit_sop(p, dst, arg0, arg1, BRW_CONDITIONAL_L); + emit_sop(c, dst, arg0, arg1, BRW_CONDITIONAL_L); } -static void emit_sle( struct brw_compile *p, +static void emit_sle( struct brw_vs_compile *c, struct brw_reg dst, struct brw_reg arg0, struct brw_reg arg1 ) { - emit_sop(p, dst, arg0, arg1, BRW_CONDITIONAL_LE); + emit_sop(c, dst, arg0, arg1, BRW_CONDITIONAL_LE); } -static void emit_sgt( struct brw_compile *p, +static void emit_sgt( struct brw_vs_compile *c, struct brw_reg dst, struct brw_reg arg0, struct brw_reg arg1 ) { - emit_sop(p, dst, arg0, arg1, BRW_CONDITIONAL_G); + emit_sop(c, dst, arg0, arg1, BRW_CONDITIONAL_G); } -static void emit_sge( struct brw_compile *p, +static void emit_sge( struct brw_vs_compile *c, struct brw_reg dst, struct brw_reg arg0, struct brw_reg arg1 ) { - emit_sop(p, dst, arg0, arg1, BRW_CONDITIONAL_GE); + emit_sop(c, dst, arg0, arg1, BRW_CONDITIONAL_GE); } static void emit_max( struct brw_compile *p, @@ -1453,25 +1455,25 @@ void brw_vs_emit(struct brw_vs_compile *c ) break; case OPCODE_SEQ: - emit_seq(p, dst, args[0], args[1]); + unalias2(c, dst, args[0], args[1], emit_seq); break; case OPCODE_SIN: emit_math1(c, BRW_MATH_FUNCTION_SIN, dst, args[0], BRW_MATH_PRECISION_FULL); break; case OPCODE_SNE: - emit_sne(p, dst, args[0], args[1]); + unalias2(c, dst, args[0], args[1], emit_sne); break; case OPCODE_SGE: - emit_sge(p, dst, args[0], args[1]); + unalias2(c, dst, args[0], args[1], emit_sge); break; case OPCODE_SGT: - emit_sgt(p, dst, args[0], args[1]); + unalias2(c, dst, args[0], args[1], emit_sgt); break; case OPCODE_SLT: - emit_slt(p, dst, args[0], args[1]); + unalias2(c, dst, args[0], args[1], emit_slt); break; case OPCODE_SLE: - emit_sle(p, dst, args[0], args[1]); + unalias2(c, dst, args[0], args[1], emit_sle); break; case OPCODE_SUB: brw_ADD(p, dst, args[0], negate(args[1])); -- cgit v1.2.3 From 1220aba99bc78290bb89ade649719508e3031e4b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 10 Nov 2009 14:11:46 -0800 Subject: i965: Fix VS constant buffer value loading. Previously, we'd load linearly from ParameterValues[0] for the constants, though ParameterValues[1] may not equal ParameterValues[0] + 4. Additionally, the STATE_VAL type paramters didn't get updated. Fixes piglit vp-constant-array-huge.vpfp and ET:QW object locations. Bug #23226. --- src/mesa/drivers/dri/i965/brw_vs_surface_state.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c index 89f47522a1..746d097d23 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c @@ -53,6 +53,7 @@ brw_vs_update_constant_buffer(struct brw_context *brw) const struct gl_program_parameter_list *params = vp->program.Base.Parameters; const int size = params->NumParameters * 4 * sizeof(GLfloat); drm_intel_bo *const_buffer; + int i; /* BRW_NEW_VERTEX_PROGRAM */ if (!vp->use_const_buffer) @@ -62,7 +63,16 @@ brw_vs_update_constant_buffer(struct brw_context *brw) size, 64); /* _NEW_PROGRAM_CONSTANTS */ - dri_bo_subdata(const_buffer, 0, size, params->ParameterValues); + + /* Updates the ParamaterValues[i] pointers for all parameters of the + * basic type of PROGRAM_STATE_VAR. + */ + _mesa_load_state_parameters(&brw->intel.ctx, vp->program.Base.Parameters); + + for (i = 0; i < params->NumParameters; i++) { + dri_bo_subdata(const_buffer, i * 4 * sizeof(float), 4 * sizeof(float), + params->ParameterValues[i]); + } return const_buffer; } -- cgit v1.2.3 From cbee31a1f84a4d28d126356aaca317e2cdd003dc Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Wed, 11 Nov 2009 03:05:16 -0800 Subject: r300, r300g: Add missing registers. --- src/mesa/drivers/dri/r300/r300_reg.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h index 623da60333..ea684e7df1 100644 --- a/src/mesa/drivers/dri/r300/r300_reg.h +++ b/src/mesa/drivers/dri/r300/r300_reg.h @@ -1789,6 +1789,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. # define R300_ALU_DSTC_OUTPUT_X (1 << 26) # define R300_ALU_DSTC_OUTPUT_Y (1 << 27) # define R300_ALU_DSTC_OUTPUT_Z (1 << 28) +# define R300_RGB_TARGET(x) ((x) << 29) #define R300_US_ALU_ALPHA_ADDR_0 0x47C0 # define R300_ALU_SRC0A_SHIFT 0 @@ -1806,6 +1807,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. # define R300_ALU_DSTA_REG (1 << 23) # define R300_ALU_DSTA_OUTPUT (1 << 24) # define R300_ALU_DSTA_DEPTH (1 << 27) +# define R300_ALPHA_TARGET(x) ((x) << 25) #define R300_US_ALU_RGB_INST_0 0x48C0 # define R300_ALU_ARGC_SRC0C_XYZ 0 -- cgit v1.2.3 From ab12e764ba3f57ad9f0d7252262cfc6e07839928 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Wed, 11 Nov 2009 17:57:56 -0800 Subject: i965: fix EXT_provoking_vertex support This didn't work for quad/quadstrips at all, and for all other primitive types it only worked when they were unclipped. Fix up the former in gs stage (could probably do without these changes and instead set QuadsFollowProvokingVertexConvention to false), and the rest in clip stage. --- src/mesa/drivers/dri/i965/brw_clip.c | 1 + src/mesa/drivers/dri/i965/brw_clip.h | 7 +++--- src/mesa/drivers/dri/i965/brw_clip_line.c | 8 +++++-- src/mesa/drivers/dri/i965/brw_clip_tri.c | 12 +++++++--- src/mesa/drivers/dri/i965/brw_gs.c | 10 +++++--- src/mesa/drivers/dri/i965/brw_gs.h | 7 +++--- src/mesa/drivers/dri/i965/brw_gs_emit.c | 38 ++++++++++++++++++++++--------- src/mesa/drivers/dri/i965/brw_sf_state.c | 7 +++--- 8 files changed, 61 insertions(+), 29 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_clip.c b/src/mesa/drivers/dri/i965/brw_clip.c index 20a927cf38..f45dcf8282 100644 --- a/src/mesa/drivers/dri/i965/brw_clip.c +++ b/src/mesa/drivers/dri/i965/brw_clip.c @@ -156,6 +156,7 @@ static void upload_clip_prog(struct brw_context *brw) key.attrs = brw->vs.prog_data->outputs_written; /* _NEW_LIGHT */ key.do_flat_shading = (ctx->Light.ShadeModel == GL_FLAT); + key.pv_first = (ctx->Light.ProvokingVertex == GL_FIRST_VERTEX_CONVENTION); /* _NEW_TRANSFORM */ key.nr_userclip = brw_count_bits(ctx->Transform.ClipPlanesEnabled); diff --git a/src/mesa/drivers/dri/i965/brw_clip.h b/src/mesa/drivers/dri/i965/brw_clip.h index 957df441ab..dc550ac793 100644 --- a/src/mesa/drivers/dri/i965/brw_clip.h +++ b/src/mesa/drivers/dri/i965/brw_clip.h @@ -46,18 +46,17 @@ struct brw_clip_prog_key { GLuint primitive:4; GLuint nr_userclip:3; GLuint do_flat_shading:1; + GLuint pv_first:1; GLuint do_unfilled:1; GLuint fill_cw:2; /* includes cull information */ GLuint fill_ccw:2; /* includes cull information */ GLuint offset_cw:1; GLuint offset_ccw:1; - GLuint pad0:17; - GLuint copy_bfc_cw:1; GLuint copy_bfc_ccw:1; GLuint clip_mode:3; - GLuint pad1:27; - + GLuint pad0:11; + GLfloat offset_factor; GLfloat offset_units; }; diff --git a/src/mesa/drivers/dri/i965/brw_clip_line.c b/src/mesa/drivers/dri/i965/brw_clip_line.c index 048ca620fa..fa9648f50f 100644 --- a/src/mesa/drivers/dri/i965/brw_clip_line.c +++ b/src/mesa/drivers/dri/i965/brw_clip_line.c @@ -269,8 +269,12 @@ void brw_emit_line_clip( struct brw_clip_compile *c ) brw_clip_line_alloc_regs(c); brw_clip_init_ff_sync(c); - if (c->key.do_flat_shading) - brw_clip_copy_colors(c, 0, 1); + if (c->key.do_flat_shading) { + if (c->key.pv_first) + brw_clip_copy_colors(c, 1, 0); + else + brw_clip_copy_colors(c, 0, 1); + } clip_and_emit_line(c); } diff --git a/src/mesa/drivers/dri/i965/brw_clip_tri.c b/src/mesa/drivers/dri/i965/brw_clip_tri.c index 0efd77225e..cf79224be4 100644 --- a/src/mesa/drivers/dri/i965/brw_clip_tri.c +++ b/src/mesa/drivers/dri/i965/brw_clip_tri.c @@ -188,14 +188,20 @@ void brw_clip_tri_flat_shade( struct brw_clip_compile *c ) brw_imm_ud(_3DPRIM_POLYGON)); is_poly = brw_IF(p, BRW_EXECUTE_1); - { + { brw_clip_copy_colors(c, 1, 0); brw_clip_copy_colors(c, 2, 0); } is_poly = brw_ELSE(p, is_poly); { - brw_clip_copy_colors(c, 0, 2); - brw_clip_copy_colors(c, 1, 2); + if (c->key.pv_first) { + brw_clip_copy_colors(c, 1, 0); + brw_clip_copy_colors(c, 2, 0); + } + else { + brw_clip_copy_colors(c, 0, 2); + brw_clip_copy_colors(c, 1, 2); + } } brw_ENDIF(p, is_poly); } diff --git a/src/mesa/drivers/dri/i965/brw_gs.c b/src/mesa/drivers/dri/i965/brw_gs.c index 48c2b9a41c..610b6c35e2 100644 --- a/src/mesa/drivers/dri/i965/brw_gs.c +++ b/src/mesa/drivers/dri/i965/brw_gs.c @@ -85,10 +85,10 @@ static void compile_gs_prog( struct brw_context *brw, */ switch (key->primitive) { case GL_QUADS: - brw_gs_quads( &c ); + brw_gs_quads( &c, key ); break; case GL_QUAD_STRIP: - brw_gs_quad_strip( &c ); + brw_gs_quad_strip( &c, key ); break; case GL_LINE_LOOP: brw_gs_lines( &c ); @@ -149,6 +149,7 @@ static const GLenum gs_prim[GL_POLYGON+1] = { static void populate_key( struct brw_context *brw, struct brw_gs_prog_key *key ) { + GLcontext *ctx = &brw->intel.ctx; memset(key, 0, sizeof(*key)); /* CACHE_NEW_VS_PROG */ @@ -158,6 +159,9 @@ static void populate_key( struct brw_context *brw, key->primitive = gs_prim[brw->primitive]; key->hint_gs_always = 0; /* debug code? */ + + /* _NEW_LIGHT */ + key->pv_first = (ctx->Light.ProvokingVertex == GL_FIRST_VERTEX_CONVENTION); key->need_gs_prog = (key->hint_gs_always || brw->primitive == GL_QUADS || @@ -193,7 +197,7 @@ static void prepare_gs_prog(struct brw_context *brw) const struct brw_tracked_state brw_gs_prog = { .dirty = { - .mesa = 0, + .mesa = _NEW_LIGHT, .brw = BRW_NEW_PRIMITIVE, .cache = CACHE_NEW_VS_PROG }, diff --git a/src/mesa/drivers/dri/i965/brw_gs.h b/src/mesa/drivers/dri/i965/brw_gs.h index bbb991ea2e..e0cf07256b 100644 --- a/src/mesa/drivers/dri/i965/brw_gs.h +++ b/src/mesa/drivers/dri/i965/brw_gs.h @@ -43,8 +43,9 @@ struct brw_gs_prog_key { GLuint attrs:32; GLuint primitive:4; GLuint hint_gs_always:1; + GLuint pv_first:1; GLuint need_gs_prog:1; - GLuint pad:26; + GLuint pad:25; }; struct brw_gs_compile { @@ -67,8 +68,8 @@ struct brw_gs_compile { #define ATTR_SIZE (4*4) -void brw_gs_quads( struct brw_gs_compile *c ); -void brw_gs_quad_strip( struct brw_gs_compile *c ); +void brw_gs_quads( struct brw_gs_compile *c, struct brw_gs_prog_key *key ); +void brw_gs_quad_strip( struct brw_gs_compile *c, struct brw_gs_prog_key *key ); void brw_gs_tris( struct brw_gs_compile *c ); void brw_gs_lines( struct brw_gs_compile *c ); void brw_gs_points( struct brw_gs_compile *c ); diff --git a/src/mesa/drivers/dri/i965/brw_gs_emit.c b/src/mesa/drivers/dri/i965/brw_gs_emit.c index a9b2aa2eac..0fc5b02c61 100644 --- a/src/mesa/drivers/dri/i965/brw_gs_emit.c +++ b/src/mesa/drivers/dri/i965/brw_gs_emit.c @@ -120,7 +120,7 @@ static void brw_gs_ff_sync(struct brw_gs_compile *c, int num_prim) } -void brw_gs_quads( struct brw_gs_compile *c ) +void brw_gs_quads( struct brw_gs_compile *c, struct brw_gs_prog_key *key ) { brw_gs_alloc_regs(c, 4); @@ -128,23 +128,39 @@ void brw_gs_quads( struct brw_gs_compile *c ) * is the PV for quads, but vertex 0 for polygons: */ if (c->need_ff_sync) - brw_gs_ff_sync(c, 1); - brw_gs_emit_vue(c, c->reg.vertex[3], 0, ((_3DPRIM_POLYGON << 2) | R02_PRIM_START)); - brw_gs_emit_vue(c, c->reg.vertex[0], 0, (_3DPRIM_POLYGON << 2)); - brw_gs_emit_vue(c, c->reg.vertex[1], 0, (_3DPRIM_POLYGON << 2)); - brw_gs_emit_vue(c, c->reg.vertex[2], 1, ((_3DPRIM_POLYGON << 2) | R02_PRIM_END)); + brw_gs_ff_sync(c, 1); + if (key->pv_first) { + brw_gs_emit_vue(c, c->reg.vertex[0], 0, ((_3DPRIM_POLYGON << 2) | R02_PRIM_START)); + brw_gs_emit_vue(c, c->reg.vertex[1], 0, (_3DPRIM_POLYGON << 2)); + brw_gs_emit_vue(c, c->reg.vertex[2], 0, (_3DPRIM_POLYGON << 2)); + brw_gs_emit_vue(c, c->reg.vertex[3], 1, ((_3DPRIM_POLYGON << 2) | R02_PRIM_END)); + } + else { + brw_gs_emit_vue(c, c->reg.vertex[3], 0, ((_3DPRIM_POLYGON << 2) | R02_PRIM_START)); + brw_gs_emit_vue(c, c->reg.vertex[0], 0, (_3DPRIM_POLYGON << 2)); + brw_gs_emit_vue(c, c->reg.vertex[1], 0, (_3DPRIM_POLYGON << 2)); + brw_gs_emit_vue(c, c->reg.vertex[2], 1, ((_3DPRIM_POLYGON << 2) | R02_PRIM_END)); + } } -void brw_gs_quad_strip( struct brw_gs_compile *c ) +void brw_gs_quad_strip( struct brw_gs_compile *c, struct brw_gs_prog_key *key ) { brw_gs_alloc_regs(c, 4); if (c->need_ff_sync) brw_gs_ff_sync(c, 1); - brw_gs_emit_vue(c, c->reg.vertex[2], 0, ((_3DPRIM_POLYGON << 2) | R02_PRIM_START)); - brw_gs_emit_vue(c, c->reg.vertex[3], 0, (_3DPRIM_POLYGON << 2)); - brw_gs_emit_vue(c, c->reg.vertex[0], 0, (_3DPRIM_POLYGON << 2)); - brw_gs_emit_vue(c, c->reg.vertex[1], 1, ((_3DPRIM_POLYGON << 2) | R02_PRIM_END)); + if (key->pv_first) { + brw_gs_emit_vue(c, c->reg.vertex[0], 0, ((_3DPRIM_POLYGON << 2) | R02_PRIM_START)); + brw_gs_emit_vue(c, c->reg.vertex[1], 0, (_3DPRIM_POLYGON << 2)); + brw_gs_emit_vue(c, c->reg.vertex[2], 0, (_3DPRIM_POLYGON << 2)); + brw_gs_emit_vue(c, c->reg.vertex[3], 1, ((_3DPRIM_POLYGON << 2) | R02_PRIM_END)); + } + else { + brw_gs_emit_vue(c, c->reg.vertex[2], 0, ((_3DPRIM_POLYGON << 2) | R02_PRIM_START)); + brw_gs_emit_vue(c, c->reg.vertex[3], 0, (_3DPRIM_POLYGON << 2)); + brw_gs_emit_vue(c, c->reg.vertex[0], 0, (_3DPRIM_POLYGON << 2)); + brw_gs_emit_vue(c, c->reg.vertex[1], 1, ((_3DPRIM_POLYGON << 2) | R02_PRIM_END)); + } } void brw_gs_tris( struct brw_gs_compile *c ) diff --git a/src/mesa/drivers/dri/i965/brw_sf_state.c b/src/mesa/drivers/dri/i965/brw_sf_state.c index bc0f076073..79f37097d3 100644 --- a/src/mesa/drivers/dri/i965/brw_sf_state.c +++ b/src/mesa/drivers/dri/i965/brw_sf_state.c @@ -113,7 +113,8 @@ struct brw_sf_unit_key { unsigned int nr_urb_entries, urb_size, sfsize; - GLenum front_face, cull_face, provoking_vertex; + GLenum front_face, cull_face; + unsigned pv_first:1; unsigned scissor:1; unsigned line_smooth:1; unsigned point_sprite:1; @@ -154,7 +155,7 @@ sf_unit_populate_key(struct brw_context *brw, struct brw_sf_unit_key *key) key->point_attenuated = ctx->Point._Attenuated; /* _NEW_LIGHT */ - key->provoking_vertex = ctx->Light.ProvokingVertex; + key->pv_first = (ctx->Light.ProvokingVertex == GL_FIRST_VERTEX_CONVENTION); key->render_to_fbo = brw->intel.ctx.DrawBuffer->Name != 0; } @@ -287,7 +288,7 @@ sf_unit_create_from_key(struct brw_context *brw, struct brw_sf_unit_key *key, /* might be BRW_NEW_PRIMITIVE if we have to adjust pv for polygons: */ - if (key->provoking_vertex == GL_LAST_VERTEX_CONVENTION) { + if (!key->pv_first) { sf.sf7.trifan_pv = 2; sf.sf7.linestrip_pv = 1; sf.sf7.tristrip_pv = 2; -- cgit v1.2.3 From 0a39620d6de27ae471c181046480d274a2327476 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 11 Nov 2009 19:37:53 -0700 Subject: swrast: handle additional Z24 formats in read_depth_pixels() --- src/mesa/swrast/s_readpix.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c index a855fd8068..44a11cd6dd 100644 --- a/src/mesa/swrast/s_readpix.c +++ b/src/mesa/swrast/s_readpix.c @@ -120,8 +120,12 @@ read_depth_pixels( GLcontext *ctx, && !biasOrScale && !packing->SwapBytes) { /* Special case: directly read 24-bit unsigned depth values. */ GLint j; - ASSERT(rb->Format == MESA_FORMAT_X8_Z24); - ASSERT(rb->DataType == GL_UNSIGNED_INT); + ASSERT(rb->Format == MESA_FORMAT_X8_Z24 || + rb->Format == MESA_FORMAT_S8_Z24 || + rb->Format == MESA_FORMAT_Z24_X8 || + rb->Format == MESA_FORMAT_Z24_S8); + ASSERT(rb->DataType == GL_UNSIGNED_INT || + rb->DataType == GL_UNSIGNED_INT_24_8); for (j = 0; j < height; j++, y++) { GLuint *dest = (GLuint *) _mesa_image_address2d(packing, pixels, width, height, @@ -129,9 +133,18 @@ read_depth_pixels( GLcontext *ctx, GLint k; rb->GetRow(ctx, rb, width, x, y, dest); /* convert range from 24-bit to 32-bit */ - for (k = 0; k < width; k++) { - /* Note: put MSByte of 24-bit value into LSByte */ - dest[k] = (dest[k] << 8) | ((dest[k] >> 16) & 0xff); + if (rb->Format == MESA_FORMAT_X8_Z24 || + rb->Format == MESA_FORMAT_S8_Z24) { + for (k = 0; k < width; k++) { + /* Note: put MSByte of 24-bit value into LSByte */ + dest[k] = (dest[k] << 8) | ((dest[k] >> 16) & 0xff); + } + } + else { + for (k = 0; k < width; k++) { + /* Note: fill in LSByte by replication */ + dest[k] = dest[k] | ((dest[k] >> 8) & 0xff); + } } } } -- cgit v1.2.3 From 5f305b1db925c819ddeb29a75f6fbad6500a2d11 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 11 Nov 2009 14:49:03 -0800 Subject: i965: Fix VBO last-valid-offset setup on Ironlake. Instead of doing math based on the (broken for VBO && offset != 0) input->count number, just use the BO size. Fixes assertion failure in ETQW. --- src/mesa/drivers/dri/i965/brw_draw_upload.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index 348c66154f..2b1347b698 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -536,16 +536,9 @@ static void brw_emit_vertices(struct brw_context *brw) I915_GEM_DOMAIN_VERTEX, 0, input->offset); if (BRW_IS_IGDNG(brw)) { - if (input->stride) { - OUT_RELOC(input->bo, - I915_GEM_DOMAIN_VERTEX, 0, - input->offset + input->stride * input->count - 1); - } else { - assert(input->count == 1); - OUT_RELOC(input->bo, - I915_GEM_DOMAIN_VERTEX, 0, - input->offset + input->element_size - 1); - } + OUT_RELOC(input->bo, + I915_GEM_DOMAIN_VERTEX, 0, + input->bo->size - 1); } else OUT_BATCH(input->stride ? input->count : 0); OUT_BATCH(0); /* Instance data step rate */ -- cgit v1.2.3 From 514544f373b6e6fae11b7b4426949b8ad64c441b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 12 Nov 2009 09:08:50 -0800 Subject: i965: Fix Ironlake shadow comparisons. The cube map array index arg is always present. --- src/mesa/drivers/dri/i965/brw_wm_emit.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index 268f7965c0..9b1f54414b 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -745,22 +745,32 @@ static void emit_tex( struct brw_wm_compile *c, abort(); } - if (inst->tex_shadow) { - nr = 4; - emit |= WRITEMASK_W; - } + /* For shadow comparisons, we have to supply u,v,r. */ + if (inst->tex_shadow) + nr = 3; msgLength = 1; for (i = 0; i < nr; i++) { - static const GLuint swz[4] = {0,1,2,2}; - if (emit & (1<brw) && inst->tex_shadow) { + brw_MOV(p, brw_message_reg(msgLength+1), brw_imm_f(0)); + msgLength += 2; + } + + /* Fill in the shadow comparison reference value. */ + if (inst->tex_shadow) { + brw_MOV(p, brw_message_reg(msgLength+1), arg[2]); + msgLength += 2; + } + responseLength = 8; /* always */ if (BRW_IS_IGDNG(p->brw)) { -- cgit v1.2.3 From a736d3f4399a99b54d6af140f2227253f2ee262b Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 12 Nov 2009 15:36:02 -0800 Subject: intel: Remove unused enable_imaging parameter to intelInitExtensions --- src/mesa/drivers/dri/intel/intel_context.c | 2 +- src/mesa/drivers/dri/intel/intel_extensions.c | 6 ++---- src/mesa/drivers/dri/intel/intel_extensions.h | 2 +- 3 files changed, 4 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index e0022ad548..2aeca6b81b 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -745,7 +745,7 @@ intelInitContext(struct intel_context *intel, exit(1); } - intelInitExtensions(ctx, GL_FALSE); + intelInitExtensions(ctx); INTEL_DEBUG = driParseDebugString(getenv("INTEL_DEBUG"), debug_control); if (INTEL_DEBUG & DEBUG_BUFMGR) diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index b6754c9fcb..d8a3981b53 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -194,15 +194,13 @@ static const struct dri_extension fragment_shader_extensions[] = { * extensions for a context. */ void -intelInitExtensions(GLcontext *ctx, GLboolean enable_imaging) +intelInitExtensions(GLcontext *ctx) { struct intel_context *intel = ctx?intel_context(ctx):NULL; /* Disable imaging extension until convolution is working in teximage paths. */ - enable_imaging = GL_FALSE; - - driInitExtensions(ctx, card_extensions, enable_imaging); + driInitExtensions(ctx, card_extensions, GL_FALSE); if (intel == NULL || intel->ttm) driInitExtensions(ctx, ttm_extensions, GL_FALSE); diff --git a/src/mesa/drivers/dri/intel/intel_extensions.h b/src/mesa/drivers/dri/intel/intel_extensions.h index 97147ecdb0..1d1c97a4a9 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.h +++ b/src/mesa/drivers/dri/intel/intel_extensions.h @@ -30,7 +30,7 @@ extern void -intelInitExtensions(GLcontext *ctx, GLboolean enable_imaging); +intelInitExtensions(GLcontext *ctx); #endif -- cgit v1.2.3 From b6b753f72728b734fc9886f4ec513ae09e6b269d Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 12 Nov 2009 15:39:59 -0800 Subject: intel: Don't check for context pointer to be NULL during extension init Thanks to Chia-I Wu's changes to the extension function infrastructure, we no longer have to tell the loader which extensions the driver might enable. This means that intelInitExtensions will never be called with a NULL context pointer. Remove all the NULL checks. Signed-off-by: Ian Romanick Reviewed-by: Eric Anholt --- src/mesa/drivers/dri/intel/intel_extensions.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index d8a3981b53..1682e115cc 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -196,27 +196,26 @@ static const struct dri_extension fragment_shader_extensions[] = { void intelInitExtensions(GLcontext *ctx) { - struct intel_context *intel = ctx?intel_context(ctx):NULL; + struct intel_context *intel = intel_context(ctx); /* Disable imaging extension until convolution is working in teximage paths. */ driInitExtensions(ctx, card_extensions, GL_FALSE); - if (intel == NULL || intel->ttm) + if (intel->ttm) driInitExtensions(ctx, ttm_extensions, GL_FALSE); - if (intel == NULL || IS_965(intel->intelScreen->deviceID)) + if (IS_965(intel->intelScreen->deviceID)) driInitExtensions(ctx, brw_extensions, GL_FALSE); - if (intel == NULL || IS_915(intel->intelScreen->deviceID) + if (IS_915(intel->intelScreen->deviceID) || IS_945(intel->intelScreen->deviceID)) { driInitExtensions(ctx, i915_extensions, GL_FALSE); - if (intel == NULL || driQueryOptionb(&intel->optionCache, "fragment_shader")) + if (driQueryOptionb(&intel->optionCache, "fragment_shader")) driInitExtensions(ctx, fragment_shader_extensions, GL_FALSE); - if (intel == NULL || driQueryOptionb(&intel->optionCache, - "stub_occlusion_query")) + if (driQueryOptionb(&intel->optionCache, "stub_occlusion_query")) driInitExtensions(ctx, arb_oq_extensions, GL_FALSE); } } -- cgit v1.2.3 From d6690ce15fb8c7c6abf1bc0d847c1d2da2c33904 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 11 Nov 2009 13:26:26 -0800 Subject: mesa: Improve the eliminate-move-use to work across multiple instructions. This shaves more instructions off of the VS of my GL demo, but no performance difference this time at n=6. This also fixes a regression that was in this path, which is now piglit's glsl-vs-mov-after-deref. --- src/mesa/shader/prog_optimize.c | 126 +++++++++++++++++++++++++++------------- 1 file changed, 85 insertions(+), 41 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/prog_optimize.c b/src/mesa/shader/prog_optimize.c index 8638754e24..3d28d885a4 100644 --- a/src/mesa/shader/prog_optimize.c +++ b/src/mesa/shader/prog_optimize.c @@ -65,6 +65,7 @@ get_src_arg_mask(const struct prog_instruction *inst, int arg) case OPCODE_DP2: return WRITEMASK_XY; case OPCODE_DP3: + case OPCODE_XPD: return WRITEMASK_XYZ; default: return WRITEMASK_XYZW; @@ -396,6 +397,26 @@ find_next_temp_use(const struct gl_program *prog, GLuint start, GLuint index) return END; } +static GLboolean _mesa_is_flow_control_opcode(enum prog_opcode opcode) +{ + switch (opcode) { + case OPCODE_BGNLOOP: + case OPCODE_BGNSUB: + case OPCODE_BRA: + case OPCODE_CAL: + case OPCODE_CONT: + case OPCODE_IF: + case OPCODE_ELSE: + case OPCODE_END: + case OPCODE_ENDIF: + case OPCODE_ENDLOOP: + case OPCODE_ENDSUB: + case OPCODE_RET: + return GL_TRUE; + default: + return GL_FALSE; + } +} /** * Try to remove use of extraneous MOV instructions, to free them up for dead @@ -404,7 +425,7 @@ find_next_temp_use(const struct gl_program *prog, GLuint start, GLuint index) static void _mesa_remove_extra_move_use(struct gl_program *prog) { - GLuint i; + GLuint i, j; if (dbg) { _mesa_printf("Optimize: Begin remove extra move use\n"); @@ -414,63 +435,86 @@ _mesa_remove_extra_move_use(struct gl_program *prog) /* * Look for sequences such as this: * MOV tmpX, arg0; + * ... * FOO tmpY, tmpX, arg1; * and convert into: * MOV tmpX, arg0; + * ... * FOO tmpY, arg0, arg1; */ for (i = 0; i < prog->NumInstructions - 1; i++) { const struct prog_instruction *mov = prog->Instructions + i; - struct prog_instruction *inst2 = prog->Instructions + i + 1; - int arg; if (mov->Opcode != OPCODE_MOV || mov->DstReg.File != PROGRAM_TEMPORARY || mov->DstReg.RelAddr || mov->DstReg.CondMask != COND_TR || - mov->SaturateMode != SATURATE_OFF) + mov->SaturateMode != SATURATE_OFF || + mov->SrcReg[0].RelAddr) continue; - for (arg = 0; arg < _mesa_num_inst_src_regs(inst2->Opcode); arg++) { - int comp; - int read_mask = get_src_arg_mask(inst2, arg); - - if (inst2->SrcReg[arg].File != mov->DstReg.File || - inst2->SrcReg[arg].Index != mov->DstReg.Index || - inst2->SrcReg[arg].RelAddr || - inst2->SrcReg[arg].Abs) - continue; - - /* Check that all the sources for this arg of inst2 come from inst1 - * or constants. - */ - for (comp = 0; comp < 4; comp++) { - int src_swz = GET_SWZ(inst2->SrcReg[arg].Swizzle, comp); - - /* If the MOV didn't write that channel, can't use it. */ - if ((read_mask & (1 << comp)) && - src_swz <= SWIZZLE_W && - (mov->DstReg.WriteMask & (1 << src_swz)) == 0) - break; - } - if (comp != 4) - continue; - - /* Adjust the swizzles of inst2 to point at MOV's source */ - for (comp = 0; comp < 4; comp++) { - int inst2_swz = GET_SWZ(inst2->SrcReg[arg].Swizzle, comp); - - if (inst2_swz <= SWIZZLE_W) { - GLuint s = GET_SWZ(mov->SrcReg[0].Swizzle, inst2_swz); - inst2->SrcReg[arg].Swizzle &= ~(7 << (3 * comp)); - inst2->SrcReg[arg].Swizzle |= s << (3 * comp); - inst2->SrcReg[arg].Negate ^= (((mov->SrcReg[0].Negate >> - inst2_swz) & 0x1) << comp); + /* Walk through remaining instructions until the or src reg gets + * rewritten or we get into some flow-control, eliminating the use of + * this MOV. + */ + for (j = i + 1; j < prog->NumInstructions; j++) { + struct prog_instruction *inst2 = prog->Instructions + j; + int arg; + + if (_mesa_is_flow_control_opcode(inst2->Opcode)) + break; + + /* First rewrite this instruction's args if appropriate. */ + for (arg = 0; arg < _mesa_num_inst_src_regs(inst2->Opcode); arg++) { + int comp; + int read_mask = get_src_arg_mask(inst2, arg); + + if (inst2->SrcReg[arg].File != mov->DstReg.File || + inst2->SrcReg[arg].Index != mov->DstReg.Index || + inst2->SrcReg[arg].RelAddr || + inst2->SrcReg[arg].Abs) + continue; + + /* Check that all the sources for this arg of inst2 come from inst1 + * or constants. + */ + for (comp = 0; comp < 4; comp++) { + int src_swz = GET_SWZ(inst2->SrcReg[arg].Swizzle, comp); + + /* If the MOV didn't write that channel, can't use it. */ + if ((read_mask & (1 << comp)) && + src_swz <= SWIZZLE_W && + (mov->DstReg.WriteMask & (1 << src_swz)) == 0) + break; + } + if (comp != 4) + continue; + + /* Adjust the swizzles of inst2 to point at MOV's source */ + for (comp = 0; comp < 4; comp++) { + int inst2_swz = GET_SWZ(inst2->SrcReg[arg].Swizzle, comp); + + if (inst2_swz <= SWIZZLE_W) { + GLuint s = GET_SWZ(mov->SrcReg[0].Swizzle, inst2_swz); + inst2->SrcReg[arg].Swizzle &= ~(7 << (3 * comp)); + inst2->SrcReg[arg].Swizzle |= s << (3 * comp); + inst2->SrcReg[arg].Negate ^= (((mov->SrcReg[0].Negate >> + inst2_swz) & 0x1) << comp); + } } + inst2->SrcReg[arg].File = mov->SrcReg[0].File; + inst2->SrcReg[arg].Index = mov->SrcReg[0].Index; } - inst2->SrcReg[arg].File = mov->SrcReg[0].File; - inst2->SrcReg[arg].Index = mov->SrcReg[0].Index; + + /* If this instruction overwrote part of the move, our time is up. */ + if ((inst2->DstReg.File == mov->DstReg.File && + (inst2->DstReg.RelAddr || + inst2->DstReg.Index == mov->DstReg.Index)) || + (inst2->DstReg.File == mov->SrcReg[0].File && + (inst2->DstReg.RelAddr || + inst2->DstReg.Index == mov->SrcReg[0].Index))) + break; } } -- cgit v1.2.3 From 91bd593109c71310fb7e101c5f73a14f1bbd5f93 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 11 Nov 2009 11:58:12 -0800 Subject: i965: Avoid moving the current value back into the accumulator for MAD. This is a 2.9% (+/-.3%) performance win for my GL demo, which hits MAD sequences for matrix transforms. --- src/mesa/drivers/dri/i965/brw_vs_emit.c | 35 ++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_vs_emit.c b/src/mesa/drivers/dri/i965/brw_vs_emit.c index 15154c3b8e..f7b0726636 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_emit.c +++ b/src/mesa/drivers/dri/i965/brw_vs_emit.c @@ -1271,6 +1271,38 @@ post_vs_emit( struct brw_vs_compile *c, } } +static GLboolean +accumulator_contains(struct brw_vs_compile *c, struct brw_reg val) +{ + struct brw_compile *p = &c->func; + struct brw_instruction *prev_insn = &p->store[p->nr_insn - 1]; + + if (p->nr_insn == 0) + return GL_FALSE; + + if (val.address_mode != BRW_ADDRESS_DIRECT) + return GL_FALSE; + + switch (prev_insn->header.opcode) { + case BRW_OPCODE_MOV: + case BRW_OPCODE_MAC: + case BRW_OPCODE_MUL: + if (prev_insn->header.access_mode == BRW_ALIGN_16 && + prev_insn->header.execution_size == val.width && + prev_insn->bits1.da1.dest_reg_file == val.file && + prev_insn->bits1.da1.dest_reg_type == val.type && + prev_insn->bits1.da1.dest_address_mode == val.address_mode && + prev_insn->bits1.da1.dest_reg_nr == val.nr && + prev_insn->bits1.da16.dest_subreg_nr == val.subnr / 16 && + prev_insn->bits1.da16.dest_writemask == 0xf) + return GL_TRUE; + else + return GL_FALSE; + default: + return GL_FALSE; + } +} + static uint32_t get_predicate(const struct prog_instruction *inst) { @@ -1449,7 +1481,8 @@ void brw_vs_emit(struct brw_vs_compile *c ) unalias3(c, dst, args[0], args[1], args[2], emit_lrp_noalias); break; case OPCODE_MAD: - brw_MOV(p, brw_acc_reg(), args[2]); + if (!accumulator_contains(c, args[2])) + brw_MOV(p, brw_acc_reg(), args[2]); brw_MAC(p, dst, args[0], args[1]); break; case OPCODE_MAX: -- cgit v1.2.3 From 4e50ce35ee1376062de2c6fa69da144be30a61e2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 11 Nov 2009 15:29:34 -0800 Subject: i965: Clean up Ironlake sampler type definitions. They're the same regardless of execution width for 8, 4x2, and 16. --- src/mesa/drivers/dri/i965/brw_defines.h | 16 ++++------------ src/mesa/drivers/dri/i965/brw_wm_emit.c | 6 +++--- src/mesa/drivers/dri/i965/brw_wm_glsl.c | 6 +++--- 3 files changed, 10 insertions(+), 18 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h index 78d457ad2b..c19510bbd4 100644 --- a/src/mesa/drivers/dri/i965/brw_defines.h +++ b/src/mesa/drivers/dri/i965/brw_defines.h @@ -673,18 +673,10 @@ #define BRW_SAMPLER_MESSAGE_SIMD8_LD 3 #define BRW_SAMPLER_MESSAGE_SIMD16_LD 3 -#define BRW_SAMPLER_MESSAGE_SIMD8_SAMPLE_IGDNG 0 -#define BRW_SAMPLER_MESSAGE_SIMD4X2_SAMPLE_IGDNG 0 -#define BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE_IGDNG 0 -#define BRW_SAMPLER_MESSAGE_SIMD8_SAMPLE_BIAS_IGDNG 1 -#define BRW_SAMPLER_MESSAGE_SIMD4X2_SAMPLE_BIAS_IGDNG 1 -#define BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE_BIAS_IGDNG 1 -#define BRW_SAMPLER_MESSAGE_SIMD8_SAMPLE_LOD_IGDNG 2 -#define BRW_SAMPLER_MESSAGE_SIMD4X2_SAMPLE_LOD_IGDNG 2 -#define BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE_LOD_IGDNG 2 -#define BRW_SAMPLER_MESSAGE_SIMD8_SAMPLE_COMPARE_IGDNG 3 -#define BRW_SAMPLER_MESSAGE_SIMD4X2_SAMPLE_COMPARE_IGDNG 3 -#define BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE_COMPARE_IGDNG 3 +#define BRW_SAMPLER_MESSAGE_SAMPLE_IGDNG 0 +#define BRW_SAMPLER_MESSAGE_SAMPLE_BIAS_IGDNG 1 +#define BRW_SAMPLER_MESSAGE_SAMPLE_LOD_IGDNG 2 +#define BRW_SAMPLER_MESSAGE_SAMPLE_COMPARE_IGDNG 3 /* for IGDNG only */ #define BRW_SAMPLER_SIMD_MODE_SIMD4X2 0 diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index eb37ea1864..abad5d2692 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -875,9 +875,9 @@ static void emit_tex( struct brw_wm_compile *c, if (BRW_IS_IGDNG(p->brw)) { if (inst->tex_shadow) - msg_type = BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE_COMPARE_IGDNG; + msg_type = BRW_SAMPLER_MESSAGE_SAMPLE_COMPARE_IGDNG; else - msg_type = BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE_IGDNG; + msg_type = BRW_SAMPLER_MESSAGE_SAMPLE_IGDNG; } else { if (inst->tex_shadow) msg_type = BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE_COMPARE; @@ -939,7 +939,7 @@ static void emit_txb( struct brw_wm_compile *c, msgLength = 9; if (BRW_IS_IGDNG(p->brw)) - msg_type = BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE_BIAS_IGDNG; + msg_type = BRW_SAMPLER_MESSAGE_SAMPLE_BIAS_IGDNG; else msg_type = BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE_BIAS; diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index 9d3bc66f49..42a13fc80f 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -1850,7 +1850,7 @@ static void emit_txb(struct brw_wm_compile *c, brw_MOV(p, brw_message_reg(6), brw_imm_f(0)); /* ref (unused?) */ if (BRW_IS_IGDNG(p->brw)) { - msg_type = BRW_SAMPLER_MESSAGE_SIMD8_SAMPLE_BIAS_IGDNG; + msg_type = BRW_SAMPLER_MESSAGE_SAMPLE_BIAS_IGDNG; } else { /* Does it work well on SIMD8? */ msg_type = BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE_BIAS; @@ -1932,9 +1932,9 @@ static void emit_tex(struct brw_wm_compile *c, if (BRW_IS_IGDNG(p->brw)) { if (shadow) - msg_type = BRW_SAMPLER_MESSAGE_SIMD8_SAMPLE_COMPARE_IGDNG; + msg_type = BRW_SAMPLER_MESSAGE_SAMPLE_COMPARE_IGDNG; else - msg_type = BRW_SAMPLER_MESSAGE_SIMD8_SAMPLE_IGDNG; + msg_type = BRW_SAMPLER_MESSAGE_SAMPLE_IGDNG; } else { /* Does it work for shadow on SIMD8 ? */ msg_type = BRW_SAMPLER_MESSAGE_SIMD8_SAMPLE; -- cgit v1.2.3 From 3c05c1eb6326dc28e8ab073d179eb669e5699f4b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 12 Nov 2009 10:45:05 -0800 Subject: intel: When subdataing a busy buffer, use a temporary and blit in. This cuts a massive number of waits in ET:QW, which uses a VBO ringbuffer. Unfortunately it doesn't BufferData when wrapping back to 0, so we can't be clever with tracking what's been initialized. --- src/mesa/drivers/dri/intel/intel_buffer_objects.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c b/src/mesa/drivers/dri/intel/intel_buffer_objects.c index ea9d5a6276..669becdab4 100644 --- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c +++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c @@ -209,10 +209,23 @@ intel_bufferobj_subdata(GLcontext * ctx, memcpy((char *)intel_obj->sys_buffer + offset, data, size); else { /* Flush any existing batchbuffer that might reference this data. */ - if (drm_intel_bo_references(intel->batch->buf, intel_obj->buffer)) - intelFlush(ctx); + if (drm_intel_bo_busy(intel_obj->buffer) || + drm_intel_bo_references(intel->batch->buf, intel_obj->buffer)) { + drm_intel_bo *temp_bo; - dri_bo_subdata(intel_obj->buffer, offset, size, data); + temp_bo = drm_intel_bo_alloc(intel->bufmgr, "subdata temp", size, 64); + + drm_intel_bo_subdata(temp_bo, 0, size, data); + + intel_emit_linear_blit(intel, + intel_obj->buffer, offset, + temp_bo, 0, + size); + + drm_intel_bo_unreference(temp_bo); + } else { + dri_bo_subdata(intel_obj->buffer, offset, size, data); + } } } -- cgit v1.2.3 From 8e8586e62671e8337c08b086bf7f3c54cc46191d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 12 Nov 2009 14:05:18 -0800 Subject: i965: Validate the number of URB entries selected for the VS. --- src/mesa/drivers/dri/i965/brw_vs_state.c | 37 ++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_vs_state.c b/src/mesa/drivers/dri/i965/brw_vs_state.c index d790ab6555..7285466645 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_state.c +++ b/src/mesa/drivers/dri/i965/brw_vs_state.c @@ -109,10 +109,39 @@ vs_unit_create_from_key(struct brw_context *brw, struct brw_vs_unit_key *key) vs.thread3.urb_entry_read_offset = 0; vs.thread3.const_urb_entry_read_offset = key->curbe_offset * 2; - if (BRW_IS_IGDNG(brw)) - vs.thread4.nr_urb_entries = key->nr_urb_entries >> 2; - else - vs.thread4.nr_urb_entries = key->nr_urb_entries; + if (BRW_IS_IGDNG(brw)) { + switch (key->nr_urb_entries) { + case 8: + case 12: + case 16: + case 32: + case 64: + case 96: + case 128: + case 168: + case 192: + case 224: + case 256: + vs.thread4.nr_urb_entries = key->nr_urb_entries >> 2; + break; + default: + assert(0); + } + } else { + switch (key->nr_urb_entries) { + case 8: + case 12: + case 16: + case 32: + break; + case 64: + assert(BRW_IS_G4X(brw)); + break; + default: + assert(0); + } + vs.thread4.nr_urb_entries = key->nr_urb_entries; + } vs.thread4.urb_entry_allocation_size = key->urb_size - 1; -- cgit v1.2.3 From ded0ec1ea5db8e08b0bec8ac0d9d30f98e360003 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 12 Nov 2009 14:57:30 -0800 Subject: i965: Use bo_map instead of subdata to upload the bits of constant buffer. Saves CPU time, resulting in a 2.5% FPS win on ETQW. --- src/mesa/drivers/dri/i965/brw_vs_surface_state.c | 7 +++++-- src/mesa/drivers/dri/intel/intel_context.h | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c index 5dac632969..3bc9840a97 100644 --- a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c @@ -68,10 +68,13 @@ brw_vs_update_constant_buffer(struct brw_context *brw) */ _mesa_load_state_parameters(&brw->intel.ctx, vp->program.Base.Parameters); + intel_bo_map_gtt_preferred(intel, const_buffer, GL_TRUE); for (i = 0; i < params->NumParameters; i++) { - dri_bo_subdata(const_buffer, i * 4 * sizeof(float), 4 * sizeof(float), - params->ParameterValues[i]); + memcpy(const_buffer->virtual + i * 4 * sizeof(float), + params->ParameterValues[i], + 4 * sizeof(float)); } + intel_bo_unmap_gtt_preferred(intel, const_buffer); return const_buffer; } diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index 84fbfc564c..8936f757a4 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -590,4 +590,25 @@ is_power_of_two(uint32_t value) return (value & (value - 1)) == 0; } +static inline void +intel_bo_map_gtt_preferred(struct intel_context *intel, + drm_intel_bo *bo, + GLboolean write) +{ + if (intel->intelScreen->kernel_exec_fencing) + drm_intel_gem_bo_map_gtt(bo); + else + drm_intel_bo_map(bo, write); +} + +static inline void +intel_bo_unmap_gtt_preferred(struct intel_context *intel, + drm_intel_bo *bo) +{ + if (intel->intelScreen->kernel_exec_fencing) + drm_intel_gem_bo_unmap_gtt(bo); + else + drm_intel_bo_unmap(bo); +} + #endif -- cgit v1.2.3 From b54f8eeae8e7f5c5b43cb17255fee70227713c9c Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 12 Nov 2009 17:48:55 -0800 Subject: i965: Remove long dead structures for ffvertex_prog.c. --- src/mesa/drivers/dri/i965/brw_context.h | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index e01930a4a0..2681913a90 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -412,23 +412,6 @@ struct brw_vertex_info { GLuint sizes[ATTRIB_BIT_DWORDS * 2]; /* sizes:2[VERT_ATTRIB_MAX] */ }; - - - -/* Cache for TNL programs. - */ -struct brw_tnl_cache_item { - GLuint hash; - void *key; - void *data; - struct brw_tnl_cache_item *next; -}; - -struct brw_tnl_cache { - struct brw_tnl_cache_item **items; - GLuint size, n_items; -}; - struct brw_query_object { struct gl_query_object Base; -- cgit v1.2.3 From 3727858ceb324c955b00ae29b8c1e12f47060fce Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 12 Nov 2009 18:27:12 -0800 Subject: i965: Remove an unused cache_item field. --- src/mesa/drivers/dri/i965/brw_context.h | 1 - src/mesa/drivers/dri/i965/brw_state_cache.c | 1 - src/mesa/drivers/dri/intel/intel_tex_copy.c | 2 +- 3 files changed, 1 insertion(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index 2681913a90..87e8a6aad4 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -320,7 +320,6 @@ struct brw_cache_item { GLuint nr_reloc_bufs; dri_bo *bo; - GLuint data_size; struct brw_cache_item *next; }; diff --git a/src/mesa/drivers/dri/i965/brw_state_cache.c b/src/mesa/drivers/dri/i965/brw_state_cache.c index d2ab624783..e4c9ba7d87 100644 --- a/src/mesa/drivers/dri/i965/brw_state_cache.c +++ b/src/mesa/drivers/dri/i965/brw_state_cache.c @@ -245,7 +245,6 @@ brw_upload_cache( struct brw_cache *cache, item->bo = bo; dri_bo_reference(bo); - item->data_size = data_size; if (cache->n_items > cache->size * 1.5) rehash(cache); diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c index bb21dd5ed9..4b5fe7be9f 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_copy.c +++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c @@ -109,7 +109,7 @@ do_copy_texsubimage(struct intel_context *intel, return GL_FALSE; } - intelFlush(ctx); + // intelFlush(ctx); LOCK_HARDWARE(intel); { drm_intel_bo *dst_bo = intel_region_buffer(intel, -- cgit v1.2.3 From 1ffd0a77896d4921677f0717e6fa8708f6586eea Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 12 Nov 2009 19:12:11 -0800 Subject: intel: Remove some dead context structure fields. --- src/mesa/drivers/dri/intel/intel_context.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index 8936f757a4..eb7be7ddd0 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -174,7 +174,6 @@ struct intel_context struct dri_metaops meta; - GLint refcount; GLbitfield Fallback; /**< mask of INTEL_FALLBACK_x bits */ GLuint NewGLState; @@ -199,7 +198,6 @@ struct intel_context struct intel_batchbuffer *batch; drm_intel_bo *first_post_swapbuffers_batch; GLboolean no_batch_wrap; - unsigned batch_id; struct { -- cgit v1.2.3 From 99077e77927ec26edf85bfef81a6d433171c3a1e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 12 Nov 2009 20:08:44 -0800 Subject: i965: Flag BRW_NEW_CONTEXT on some context state. Fixing this is a prereq for avoiding flagging all state at new batch time. Eliminating that still causes problems, though (notably glean logicOp fails on my GM965). --- src/mesa/drivers/dri/i965/brw_curbe.c | 2 +- src/mesa/drivers/dri/i965/brw_misc_state.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_curbe.c b/src/mesa/drivers/dri/i965/brw_curbe.c index 4be6c77aa1..aadcfbe2da 100644 --- a/src/mesa/drivers/dri/i965/brw_curbe.c +++ b/src/mesa/drivers/dri/i965/brw_curbe.c @@ -130,7 +130,7 @@ static void calculate_curbe_offsets( struct brw_context *brw ) const struct brw_tracked_state brw_curbe_offsets = { .dirty = { .mesa = _NEW_TRANSFORM, - .brw = BRW_NEW_VERTEX_PROGRAM, + .brw = BRW_NEW_VERTEX_PROGRAM | BRW_NEW_CONTEXT, .cache = CACHE_NEW_WM_PROG }, .prepare = calculate_curbe_offsets diff --git a/src/mesa/drivers/dri/i965/brw_misc_state.c b/src/mesa/drivers/dri/i965/brw_misc_state.c index ea71857548..4b0d598336 100644 --- a/src/mesa/drivers/dri/i965/brw_misc_state.c +++ b/src/mesa/drivers/dri/i965/brw_misc_state.c @@ -66,7 +66,7 @@ static void upload_blend_constant_color(struct brw_context *brw) const struct brw_tracked_state brw_blend_constant_color = { .dirty = { .mesa = _NEW_COLOR, - .brw = 0, + .brw = BRW_NEW_CONTEXT, .cache = 0 }, .emit = upload_blend_constant_color @@ -93,7 +93,7 @@ static void upload_drawing_rect(struct brw_context *brw) const struct brw_tracked_state brw_drawing_rect = { .dirty = { .mesa = _NEW_BUFFERS, - .brw = 0, + .brw = BRW_NEW_CONTEXT, .cache = 0 }, .emit = upload_drawing_rect @@ -317,7 +317,7 @@ static void upload_polygon_stipple(struct brw_context *brw) const struct brw_tracked_state brw_polygon_stipple = { .dirty = { .mesa = _NEW_POLYGONSTIPPLE, - .brw = 0, + .brw = BRW_NEW_CONTEXT, .cache = 0 }, .emit = upload_polygon_stipple @@ -362,7 +362,7 @@ static void upload_polygon_stipple_offset(struct brw_context *brw) const struct brw_tracked_state brw_polygon_stipple_offset = { .dirty = { .mesa = _NEW_WINDOW_POS, - .brw = 0, + .brw = BRW_NEW_CONTEXT, .cache = 0 }, .emit = upload_polygon_stipple_offset @@ -425,7 +425,7 @@ static void upload_line_stipple(struct brw_context *brw) const struct brw_tracked_state brw_line_stipple = { .dirty = { .mesa = _NEW_LINE, - .brw = 0, + .brw = BRW_NEW_CONTEXT, .cache = 0 }, .emit = upload_line_stipple -- cgit v1.2.3 From a0fd49b33455317466a75ec77eb292f41d6021d7 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 13 Nov 2009 15:16:17 -0800 Subject: i965: Clean up emit_tex a bit. --- src/mesa/drivers/dri/i965/brw_wm_emit.c | 51 ++++++++++++++++----------------- 1 file changed, 24 insertions(+), 27 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index d91fad0f45..a47bf3f667 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -828,8 +828,8 @@ static void emit_tex( struct brw_wm_compile *c, struct brw_reg *arg ) { struct brw_compile *p = &c->func; - GLuint msgLength, responseLength; - GLuint i, nr; + GLuint cur_mrf = 2, response_length; + GLuint i, nr_texcoords; GLuint emit; GLuint msg_type; @@ -838,17 +838,17 @@ static void emit_tex( struct brw_wm_compile *c, switch (inst->tex_idx) { case TEXTURE_1D_INDEX: emit = WRITEMASK_X; - nr = 1; + nr_texcoords = 1; break; case TEXTURE_2D_INDEX: case TEXTURE_RECT_INDEX: emit = WRITEMASK_XY; - nr = 2; + nr_texcoords = 2; break; case TEXTURE_3D_INDEX: case TEXTURE_CUBE_INDEX: emit = WRITEMASK_XYZ; - nr = 3; + nr_texcoords = 3; break; default: /* unexpected target */ @@ -857,31 +857,28 @@ static void emit_tex( struct brw_wm_compile *c, /* For shadow comparisons, we have to supply u,v,r. */ if (inst->tex_shadow) - nr = 3; + nr_texcoords = 3; - msgLength = 1; - - for (i = 0; i < nr; i++) { + for (i = 0; i < nr_texcoords; i++) { if (emit & (1<brw) && inst->tex_shadow) { - brw_MOV(p, brw_message_reg(msgLength+1), brw_imm_f(0)); - msgLength += 2; + brw_MOV(p, brw_message_reg(cur_mrf), brw_imm_f(0)); + cur_mrf += 2; } /* Fill in the shadow comparison reference value. */ if (inst->tex_shadow) { - brw_MOV(p, brw_message_reg(msgLength+1), arg[2]); - msgLength += 2; + if (BRW_IS_IGDNG(p->brw)) { + /* Fill in the cube map array index value. */ + brw_MOV(p, brw_message_reg(cur_mrf), brw_imm_f(0)); + cur_mrf += 2; + } + brw_MOV(p, brw_message_reg(cur_mrf), arg[2]); + cur_mrf += 2; } - responseLength = 8; /* always */ + response_length = 8; /* always */ if (BRW_IS_IGDNG(p->brw)) { if (inst->tex_shadow) @@ -895,19 +892,19 @@ static void emit_tex( struct brw_wm_compile *c, msg_type = BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE; } - brw_SAMPLE(p, + brw_SAMPLE(p, retype(vec16(dst[0]), BRW_REGISTER_TYPE_UW), 1, retype(c->payload.depth[0].hw_reg, BRW_REGISTER_TYPE_UW), SURF_INDEX_TEXTURE(inst->tex_unit), inst->tex_unit, /* sampler */ inst->writemask, - msg_type, - responseLength, - msgLength, - 0, + msg_type, + response_length, + cur_mrf - 1, + 0, 1, - BRW_SAMPLER_SIMD_MODE_SIMD16); + BRW_SAMPLER_SIMD_MODE_SIMD16); } -- cgit v1.2.3 From 1be0efcbdc74f9a84136c9d1f953755c1560e52e Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 19 Aug 2009 14:48:11 -0700 Subject: i965: Share OPCODE_TEX between brw_wm_emit.c and brw_wm_glsl.c. New comments should explain some of the confusion about how this message works. --- src/mesa/drivers/dri/i965/brw_wm.h | 8 +++ src/mesa/drivers/dri/i965/brw_wm_emit.c | 87 ++++++++++++++++++++---------- src/mesa/drivers/dri/i965/brw_wm_glsl.c | 95 +++------------------------------ 3 files changed, 72 insertions(+), 118 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index 7db212e392..c497e8a46b 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -420,6 +420,14 @@ void emit_sop(struct brw_compile *p, GLuint cond, const struct brw_reg *arg0, const struct brw_reg *arg1); +void emit_tex(struct brw_wm_compile *c, + struct brw_reg *dst, + GLuint dst_flags, + struct brw_reg *arg, + struct brw_reg depth_payload, + GLuint tex_idx, + GLuint sampler, + GLboolean shadow); void emit_wpos_xy(struct brw_wm_compile *c, const struct brw_reg *dst, GLuint mask, diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index a47bf3f667..52bb73971b 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -818,24 +818,41 @@ void emit_math2(struct brw_wm_compile *c, } brw_pop_insn_state(p); } - -static void emit_tex( struct brw_wm_compile *c, - const struct brw_wm_instruction *inst, - struct brw_reg *dst, - GLuint dst_flags, - struct brw_reg *arg ) +void emit_tex(struct brw_wm_compile *c, + struct brw_reg *dst, + GLuint dst_flags, + struct brw_reg *arg, + struct brw_reg depth_payload, + GLuint tex_idx, + GLuint sampler, + GLboolean shadow) { struct brw_compile *p = &c->func; + struct brw_reg dst_retyped; GLuint cur_mrf = 2, response_length; GLuint i, nr_texcoords; GLuint emit; GLuint msg_type; + GLuint mrf_per_channel; + GLuint simd_mode; + + if (c->dispatch_width == 16) { + mrf_per_channel = 2; + response_length = 8; + dst_retyped = retype(vec16(dst[0]), BRW_REGISTER_TYPE_UW); + simd_mode = BRW_SAMPLER_SIMD_MODE_SIMD16; + } else { + mrf_per_channel = 1; + response_length = 4; + dst_retyped = retype(vec8(dst[0]), BRW_REGISTER_TYPE_UW); + simd_mode = BRW_SAMPLER_SIMD_MODE_SIMD8; + } /* How many input regs are there? */ - switch (inst->tex_idx) { + switch (tex_idx) { case TEXTURE_1D_INDEX: emit = WRITEMASK_X; nr_texcoords = 1; @@ -855,56 +872,66 @@ static void emit_tex( struct brw_wm_compile *c, abort(); } + /* Pre-Ironlake, the 8-wide sampler always took u,v,r. */ + if (!BRW_IS_IGDNG(p->brw) && c->dispatch_width == 8) + nr_texcoords = 3; + /* For shadow comparisons, we have to supply u,v,r. */ - if (inst->tex_shadow) + if (shadow) nr_texcoords = 3; + /* Emit the texcoords. */ for (i = 0; i < nr_texcoords; i++) { if (emit & (1<tex_shadow) { + if (shadow) { if (BRW_IS_IGDNG(p->brw)) { /* Fill in the cube map array index value. */ brw_MOV(p, brw_message_reg(cur_mrf), brw_imm_f(0)); - cur_mrf += 2; + cur_mrf += mrf_per_channel; + } else if (c->dispatch_width == 8) { + /* Fill in the LOD bias value. */ + brw_MOV(p, brw_message_reg(cur_mrf), brw_imm_f(0)); + cur_mrf += mrf_per_channel; } brw_MOV(p, brw_message_reg(cur_mrf), arg[2]); - cur_mrf += 2; + cur_mrf += mrf_per_channel; } - response_length = 8; /* always */ - if (BRW_IS_IGDNG(p->brw)) { - if (inst->tex_shadow) - msg_type = BRW_SAMPLER_MESSAGE_SAMPLE_COMPARE_IGDNG; - else - msg_type = BRW_SAMPLER_MESSAGE_SAMPLE_IGDNG; + if (shadow) + msg_type = BRW_SAMPLER_MESSAGE_SAMPLE_COMPARE_IGDNG; + else + msg_type = BRW_SAMPLER_MESSAGE_SAMPLE_IGDNG; } else { - if (inst->tex_shadow) - msg_type = BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE_COMPARE; - else - msg_type = BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE; + /* Note that G45 and older determines shadow compare and dispatch width + * from message length for most messages. + */ + if (c->dispatch_width == 16 && shadow) + msg_type = BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE_COMPARE; + else + msg_type = BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE; } brw_SAMPLE(p, - retype(vec16(dst[0]), BRW_REGISTER_TYPE_UW), + dst_retyped, 1, - retype(c->payload.depth[0].hw_reg, BRW_REGISTER_TYPE_UW), - SURF_INDEX_TEXTURE(inst->tex_unit), - inst->tex_unit, /* sampler */ - inst->writemask, + retype(depth_payload, BRW_REGISTER_TYPE_UW), + SURF_INDEX_TEXTURE(sampler), + sampler, + dst_flags & WRITEMASK_XYZW, msg_type, response_length, cur_mrf - 1, 0, 1, - BRW_SAMPLER_SIMD_MODE_SIMD16); + simd_mode); } @@ -1530,7 +1557,9 @@ void brw_wm_emit( struct brw_wm_compile *c ) /* Texturing operations: */ case OPCODE_TEX: - emit_tex(c, inst, dst, dst_flags, args[0]); + emit_tex(c, dst, dst_flags, args[0], c->payload.depth[0].hw_reg, + inst->tex_idx, inst->tex_unit, + inst->tex_shadow); break; case OPCODE_TXB: diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index 42a13fc80f..4af01a5f2a 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -1871,94 +1871,6 @@ static void emit_txb(struct brw_wm_compile *c, BRW_SAMPLER_SIMD_MODE_SIMD8); } - -static void emit_tex(struct brw_wm_compile *c, - const struct prog_instruction *inst) -{ - struct brw_compile *p = &c->func; - struct brw_reg dst[4], src[4], payload_reg; - /* Note: TexSrcUnit was already looked up through SamplerTextures[] */ - const GLuint unit = inst->TexSrcUnit; - GLuint msg_len; - GLuint i, nr; - GLuint emit; - GLboolean shadow = (c->key.shadowtex_mask & (1<TexSrcTarget) { - case TEXTURE_1D_INDEX: - emit = WRITEMASK_X; - nr = 1; - break; - case TEXTURE_2D_INDEX: - case TEXTURE_RECT_INDEX: - emit = WRITEMASK_XY; - nr = 2; - break; - case TEXTURE_3D_INDEX: - case TEXTURE_CUBE_INDEX: - emit = WRITEMASK_XYZ; - nr = 3; - break; - default: - /* invalid target */ - abort(); - } - msg_len = 1; - - /* move/load S, T, R coords */ - for (i = 0; i < nr; i++) { - static const GLuint swz[4] = {0,1,2,2}; - if (emit & (1<brw)) { - if (shadow) - msg_type = BRW_SAMPLER_MESSAGE_SAMPLE_COMPARE_IGDNG; - else - msg_type = BRW_SAMPLER_MESSAGE_SAMPLE_IGDNG; - } else { - /* Does it work for shadow on SIMD8 ? */ - msg_type = BRW_SAMPLER_MESSAGE_SIMD8_SAMPLE; - } - - brw_SAMPLE(p, - retype(vec8(dst[0]), BRW_REGISTER_TYPE_UW), /* dest */ - 1, /* msg_reg_nr */ - retype(payload_reg, BRW_REGISTER_TYPE_UW), /* src0 */ - SURF_INDEX_TEXTURE(unit), - unit, /* sampler */ - inst->DstReg.WriteMask, /* writemask */ - msg_type, /* msg_type */ - 4, /* response_length */ - shadow ? 6 : 4, /* msg_length */ - 0, /* eot */ - 1, - BRW_SAMPLER_SIMD_MODE_SIMD8); - - if (shadow) - brw_MOV(p, dst[3], brw_imm_f(1.0)); -} - - /** * Resolve subroutine calls after code emit is done. */ @@ -2179,7 +2091,12 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) emit_noise4(c, inst); break; case OPCODE_TEX: - emit_tex(c, inst); + emit_tex(c, dst, dst_flags, args[0], + get_reg(c, PROGRAM_PAYLOAD, PAYLOAD_DEPTH, + 0, 1, 0, 0), + inst->TexSrcTarget, + inst->TexSrcUnit, + (c->key.shadowtex_mask & (1 << inst->TexSrcUnit)) != 0); break; case OPCODE_TXB: emit_txb(c, inst); -- cgit v1.2.3 From 57f40b18377f87c434f17d5670a13838d58065c9 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 19 Aug 2009 13:44:13 -0700 Subject: i965: Share OPCODE_TXB between brw_wm_emit.c and brw_wm_glsl.c This should fix TXB on G45 and older in the GLSL case. --- src/mesa/drivers/dri/i965/brw_wm.h | 7 +++ src/mesa/drivers/dri/i965/brw_wm_emit.c | 81 +++++++++++++++++++++------------ src/mesa/drivers/dri/i965/brw_wm_glsl.c | 76 ++----------------------------- 3 files changed, 63 insertions(+), 101 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index c497e8a46b..b3c05eb0ad 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -428,6 +428,13 @@ void emit_tex(struct brw_wm_compile *c, GLuint tex_idx, GLuint sampler, GLboolean shadow); +void emit_txb(struct brw_wm_compile *c, + struct brw_reg *dst, + GLuint dst_flags, + struct brw_reg *arg, + struct brw_reg depth_payload, + GLuint tex_idx, + GLuint sampler); void emit_wpos_xy(struct brw_wm_compile *c, const struct brw_reg *dst, GLuint mask, diff --git a/src/mesa/drivers/dri/i965/brw_wm_emit.c b/src/mesa/drivers/dri/i965/brw_wm_emit.c index 52bb73971b..5390fd2584 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_emit.c +++ b/src/mesa/drivers/dri/i965/brw_wm_emit.c @@ -935,57 +935,77 @@ void emit_tex(struct brw_wm_compile *c, } -static void emit_txb( struct brw_wm_compile *c, - const struct brw_wm_instruction *inst, - struct brw_reg *dst, - GLuint dst_flags, - struct brw_reg *arg ) +void emit_txb(struct brw_wm_compile *c, + struct brw_reg *dst, + GLuint dst_flags, + struct brw_reg *arg, + struct brw_reg depth_payload, + GLuint tex_idx, + GLuint sampler) { struct brw_compile *p = &c->func; GLuint msgLength; GLuint msg_type; - /* Shadow ignored for txb. + GLuint mrf_per_channel; + GLuint response_length; + struct brw_reg dst_retyped; + + /* The G45 and older chipsets don't support 8-wide dispatch for LOD biased + * samples, so we'll use the 16-wide instruction, leave the second halves + * undefined, and trust the execution mask to keep the undefined pixels + * from mattering. */ - switch (inst->tex_idx) { + if (c->dispatch_width == 16 || !BRW_IS_IGDNG(p->brw)) { + if (BRW_IS_IGDNG(p->brw)) + msg_type = BRW_SAMPLER_MESSAGE_SAMPLE_BIAS_IGDNG; + else + msg_type = BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE_BIAS; + mrf_per_channel = 2; + dst_retyped = retype(vec16(dst[0]), BRW_REGISTER_TYPE_UW); + response_length = 8; + } else { + msg_type = BRW_SAMPLER_MESSAGE_SAMPLE_BIAS_IGDNG; + mrf_per_channel = 1; + dst_retyped = retype(vec8(dst[0]), BRW_REGISTER_TYPE_UW); + response_length = 4; + } + + /* Shadow ignored for txb. */ + switch (tex_idx) { case TEXTURE_1D_INDEX: - brw_MOV(p, brw_message_reg(2), arg[0]); - brw_MOV(p, brw_message_reg(4), brw_imm_f(0)); - brw_MOV(p, brw_message_reg(6), brw_imm_f(0)); + brw_MOV(p, brw_message_reg(2 + 0 * mrf_per_channel), arg[0]); + brw_MOV(p, brw_message_reg(2 + 1 * mrf_per_channel), brw_imm_f(0)); + brw_MOV(p, brw_message_reg(2 + 2 * mrf_per_channel), brw_imm_f(0)); break; case TEXTURE_2D_INDEX: case TEXTURE_RECT_INDEX: - brw_MOV(p, brw_message_reg(2), arg[0]); - brw_MOV(p, brw_message_reg(4), arg[1]); - brw_MOV(p, brw_message_reg(6), brw_imm_f(0)); + brw_MOV(p, brw_message_reg(2 + 0 * mrf_per_channel), arg[0]); + brw_MOV(p, brw_message_reg(2 + 1 * mrf_per_channel), arg[1]); + brw_MOV(p, brw_message_reg(2 + 2 * mrf_per_channel), brw_imm_f(0)); break; case TEXTURE_3D_INDEX: case TEXTURE_CUBE_INDEX: - brw_MOV(p, brw_message_reg(2), arg[0]); - brw_MOV(p, brw_message_reg(4), arg[1]); - brw_MOV(p, brw_message_reg(6), arg[2]); + brw_MOV(p, brw_message_reg(2 + 0 * mrf_per_channel), arg[0]); + brw_MOV(p, brw_message_reg(2 + 1 * mrf_per_channel), arg[1]); + brw_MOV(p, brw_message_reg(2 + 2 * mrf_per_channel), arg[2]); break; default: /* unexpected target */ abort(); } - brw_MOV(p, brw_message_reg(8), arg[3]); - msgLength = 9; - - if (BRW_IS_IGDNG(p->brw)) - msg_type = BRW_SAMPLER_MESSAGE_SAMPLE_BIAS_IGDNG; - else - msg_type = BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE_BIAS; + brw_MOV(p, brw_message_reg(2 + 3 * mrf_per_channel), arg[3]); + msgLength = 2 + 4 * mrf_per_channel - 1; brw_SAMPLE(p, - retype(vec16(dst[0]), BRW_REGISTER_TYPE_UW), + dst_retyped, 1, - retype(c->payload.depth[0].hw_reg, BRW_REGISTER_TYPE_UW), - SURF_INDEX_TEXTURE(inst->tex_unit), - inst->tex_unit, /* sampler */ - inst->writemask, + retype(depth_payload, BRW_REGISTER_TYPE_UW), + SURF_INDEX_TEXTURE(sampler), + sampler, + dst_flags & WRITEMASK_XYZW, msg_type, - 8, /* responseLength */ + response_length, msgLength, 0, 1, @@ -1563,7 +1583,8 @@ void brw_wm_emit( struct brw_wm_compile *c ) break; case OPCODE_TXB: - emit_txb(c, inst, dst, dst_flags, args[0]); + emit_txb(c, dst, dst_flags, args[0], c->payload.depth[0].hw_reg, + inst->tex_idx, inst->tex_unit); break; case OPCODE_KIL: diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index 4af01a5f2a..3ab446164c 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -1801,76 +1801,6 @@ static void emit_noise4( struct brw_wm_compile *c, release_tmps( c, mark ); } - -/* TODO - BIAS on SIMD8 not working yet... - */ -static void emit_txb(struct brw_wm_compile *c, - const struct prog_instruction *inst) -{ - struct brw_compile *p = &c->func; - struct brw_reg dst[4], src[4], payload_reg; - /* Note: TexSrcUnit was already looked up through SamplerTextures[] */ - const GLuint unit = inst->TexSrcUnit; - GLuint i; - GLuint msg_type; - - assert(unit < BRW_MAX_TEX_UNIT); - - payload_reg = get_reg(c, PROGRAM_PAYLOAD, PAYLOAD_DEPTH, 0, 1, 0, 0); - - for (i = 0; i < 4; i++) - dst[i] = get_dst_reg(c, inst, i); - for (i = 0; i < 4; i++) - src[i] = get_src_reg(c, inst, 0, i); - - switch (inst->TexSrcTarget) { - case TEXTURE_1D_INDEX: - brw_MOV(p, brw_message_reg(2), src[0]); /* s coord */ - brw_MOV(p, brw_message_reg(3), brw_imm_f(0)); /* t coord */ - brw_MOV(p, brw_message_reg(4), brw_imm_f(0)); /* r coord */ - break; - case TEXTURE_2D_INDEX: - case TEXTURE_RECT_INDEX: - brw_MOV(p, brw_message_reg(2), src[0]); - brw_MOV(p, brw_message_reg(3), src[1]); - brw_MOV(p, brw_message_reg(4), brw_imm_f(0)); - break; - case TEXTURE_3D_INDEX: - case TEXTURE_CUBE_INDEX: - brw_MOV(p, brw_message_reg(2), src[0]); - brw_MOV(p, brw_message_reg(3), src[1]); - brw_MOV(p, brw_message_reg(4), src[2]); - break; - default: - /* invalid target */ - abort(); - } - brw_MOV(p, brw_message_reg(5), src[3]); /* bias */ - brw_MOV(p, brw_message_reg(6), brw_imm_f(0)); /* ref (unused?) */ - - if (BRW_IS_IGDNG(p->brw)) { - msg_type = BRW_SAMPLER_MESSAGE_SAMPLE_BIAS_IGDNG; - } else { - /* Does it work well on SIMD8? */ - msg_type = BRW_SAMPLER_MESSAGE_SIMD16_SAMPLE_BIAS; - } - - brw_SAMPLE(p, - retype(vec8(dst[0]), BRW_REGISTER_TYPE_UW), /* dest */ - 1, /* msg_reg_nr */ - retype(payload_reg, BRW_REGISTER_TYPE_UW), /* src0 */ - SURF_INDEX_TEXTURE(unit), - unit, /* sampler */ - inst->DstReg.WriteMask, /* writemask */ - msg_type, /* msg_type */ - 4, /* response_length */ - 4, /* msg_length */ - 0, /* eot */ - 1, - BRW_SAMPLER_SIMD_MODE_SIMD8); -} - /** * Resolve subroutine calls after code emit is done. */ @@ -2099,7 +2029,11 @@ static void brw_wm_emit_glsl(struct brw_context *brw, struct brw_wm_compile *c) (c->key.shadowtex_mask & (1 << inst->TexSrcUnit)) != 0); break; case OPCODE_TXB: - emit_txb(c, inst); + emit_txb(c, dst, dst_flags, args[0], + get_reg(c, PROGRAM_PAYLOAD, PAYLOAD_DEPTH, + 0, 1, 0, 0), + inst->TexSrcTarget, + c->fp->program.Base.SamplerUnits[inst->TexSrcUnit]); break; case OPCODE_KIL_NV: emit_kil(c); -- cgit v1.2.3 From e92492295ba6a716b69adcd14e80adf6b5900132 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 7 Nov 2009 22:03:32 +0100 Subject: r300: remove unneeded includes --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 2 -- src/mesa/drivers/dri/r300/r300_emit.h | 1 - src/mesa/drivers/dri/r300/r300_render.c | 2 -- 3 files changed, 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index 1e2a54f634..8a56b9e63c 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -46,14 +46,12 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_context.h" #include "r300_ioctl.h" -#include "radeon_reg.h" #include "r300_reg.h" #include "r300_cmdbuf.h" #include "r300_emit.h" #include "radeon_bocs_wrapper.h" #include "radeon_mipmap_tree.h" #include "r300_state.h" -#include "radeon_reg.h" #include "radeon_queryobj.h" /** # of dwords reserved for additional instructions that may need to be written diff --git a/src/mesa/drivers/dri/r300/r300_emit.h b/src/mesa/drivers/dri/r300/r300_emit.h index 8e57e354d1..a456d8867c 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.h +++ b/src/mesa/drivers/dri/r300/r300_emit.h @@ -42,7 +42,6 @@ #include "main/glheader.h" #include "r300_context.h" #include "r300_cmdbuf.h" -#include "radeon_reg.h" static INLINE uint32_t cmdpacket0(struct radeon_screen *rscrn, int reg, int count) diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 3cd38753b8..4ae593cbe7 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -67,8 +67,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "vbo/vbo_split.h" #include "tnl/tnl.h" #include "tnl/t_vp_build.h" -#include "radeon_reg.h" -#include "radeon_macros.h" #include "r300_context.h" #include "r300_ioctl.h" #include "r300_state.h" -- cgit v1.2.3 From 0aad2aee66392989777ee74078efda197f292ee7 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sun, 8 Nov 2009 16:58:07 +0100 Subject: r300: add missing texformat --- src/mesa/drivers/dri/r300/r300_texstate.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index 44ca24daf8..4699342994 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -83,6 +83,7 @@ static const struct tx_table { _ASSIGN(ARGB8888, R300_EASY_TX_FORMAT(W, Z, Y, X, W8Z8Y8X8)), _ASSIGN(ARGB8888_REV, R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8)), #endif + _ASSIGN(XRGB8888, R300_EASY_TX_FORMAT(X, Y, Z, ONE, W8Z8Y8X8)), _ASSIGN(RGB888, R300_EASY_TX_FORMAT(X, Y, Z, ONE, W8Z8Y8X8)), _ASSIGN(RGB565, R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z5Y6X5)), _ASSIGN(RGB565_REV, R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z5Y6X5)), -- cgit v1.2.3 From 49876ab6a7f2b06177d7ac9651bd7a07956cbb25 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Mon, 9 Nov 2009 23:11:29 +0100 Subject: radeon: remove unnecessary call to radeonEmitState fixes bo space accounting errors --- src/mesa/drivers/dri/radeon/radeon_common.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c b/src/mesa/drivers/dri/radeon/radeon_common.c index 097ab7cf61..420dce4ac9 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common.c +++ b/src/mesa/drivers/dri/radeon/radeon_common.c @@ -1123,8 +1123,6 @@ void radeonFlush(GLcontext *ctx) if (radeon->dma.flush) radeon->dma.flush( ctx ); - radeonEmitState(radeon); - if (radeon->cmdbuf.cs->cdw) rcommonFlushCmdBuf(radeon, __FUNCTION__); -- cgit v1.2.3 From 084f43c1502db1988ca53494ea590cf1351180ec Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Wed, 11 Nov 2009 12:53:06 +0100 Subject: radeon: add radeon_bo_is_referenced_by_cs function --- src/mesa/drivers/dri/radeon/radeon_bo_drm.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_bo_drm.h b/src/mesa/drivers/dri/radeon/radeon_bo_drm.h index 7141371633..46e30b905a 100644 --- a/src/mesa/drivers/dri/radeon/radeon_bo_drm.h +++ b/src/mesa/drivers/dri/radeon/radeon_bo_drm.h @@ -39,6 +39,7 @@ #define RADEON_BO_FLAGS_MICRO_TILE 2 struct radeon_bo_manager; +struct radeon_cs; struct radeon_bo { uint32_t alignment; @@ -74,6 +75,7 @@ struct radeon_bo_funcs { int (*bo_get_tiling)(struct radeon_bo *bo, uint32_t *tiling_flags, uint32_t *pitch); int (*bo_is_busy)(struct radeon_bo *bo, uint32_t *domain); + int (*bo_is_referenced_by_cs)(struct radeon_bo *bo, struct radeon_cs *cs); }; struct radeon_bo_manager { @@ -199,6 +201,15 @@ static inline int radeon_bo_is_static(struct radeon_bo *bo) return 0; } +static inline int _radeon_bo_is_referenced_by_cs(struct radeon_bo *bo, + struct radeon_cs *cs, + const char *file, + const char *func, + unsigned line) +{ + return bo->cref > 1; +} + #define radeon_bo_open(bom, h, s, a, d, f)\ _radeon_bo_open(bom, h, s, a, d, f, __FILE__, __FUNCTION__, __LINE__) #define radeon_bo_ref(bo)\ @@ -215,5 +226,7 @@ static inline int radeon_bo_is_static(struct radeon_bo *bo) _radeon_bo_wait(bo, __FILE__, __func__, __LINE__) #define radeon_bo_is_busy(bo, domain) \ _radeon_bo_is_busy(bo, domain, __FILE__, __func__, __LINE__) +#define radeon_bo_is_referenced_by_cs(bo, cs) \ + _radeon_bo_is_referenced_by_cs(bo, cs, __FILE__, __FUNCTION__, __LINE__) #endif -- cgit v1.2.3 From f6d0993212fac0eb67827716be1ab4a292c8b4e5 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Wed, 11 Nov 2009 13:00:10 +0100 Subject: radeon: fix glBufferSubData --- src/mesa/drivers/dri/radeon/radeon_buffer_objects.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c b/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c index 8fac5c6c51..99d3ec7005 100644 --- a/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c +++ b/src/mesa/drivers/dri/radeon/radeon_buffer_objects.c @@ -136,8 +136,13 @@ radeonBufferSubData(GLcontext * ctx, const GLvoid * data, struct gl_buffer_object *obj) { + radeonContextPtr radeon = RADEON_CONTEXT(ctx); struct radeon_buffer_object *radeon_obj = get_radeon_buffer_object(obj); + if (radeon_bo_is_referenced_by_cs(radeon_obj->bo, radeon->cmdbuf.cs)) { + radeon_firevertices(radeon); + } + radeon_bo_map(radeon_obj->bo, GL_TRUE); _mesa_memcpy(radeon_obj->bo->ptr + offset, data, size); -- cgit v1.2.3 From 286bf89e5a1fc931dbf523ded861b809859485e2 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Wed, 11 Nov 2009 13:06:19 +0100 Subject: radeon/r300: no need to flush the cmdbuf when changing scissors state in KMM mode --- src/mesa/drivers/dri/r300/r300_state.c | 3 ++- src/mesa/drivers/dri/radeon/radeon_common.c | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index ac20c08e20..1fd32d497b 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1741,7 +1741,8 @@ static void r300Enable(GLcontext * ctx, GLenum cap, GLboolean state) r300SetPolygonOffsetState(ctx, state); break; case GL_SCISSOR_TEST: - radeon_firevertices(&rmesa->radeon); + if (!rmesa->radeon.radeonScreen->kernel_mm) + radeon_firevertices(&rmesa->radeon); rmesa->radeon.state.scissor.enabled = state; radeonUpdateScissor( ctx ); break; diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c b/src/mesa/drivers/dri/radeon/radeon_common.c index 420dce4ac9..cb344f1d21 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common.c +++ b/src/mesa/drivers/dri/radeon/radeon_common.c @@ -257,7 +257,9 @@ void radeonScissor(GLcontext* ctx, GLint x, GLint y, GLsizei w, GLsizei h) radeonContextPtr radeon = RADEON_CONTEXT(ctx); if (ctx->Scissor.Enabled) { /* We don't pipeline cliprect changes */ - radeon_firevertices(radeon); + if (!radeon->radeonScreen->kernel_mm) { + radeon_firevertices(radeon); + } radeonUpdateScissor(ctx); } } -- cgit v1.2.3 From d3fa67c9b83b5736724ca57a0487857631e6c415 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Wed, 11 Nov 2009 13:50:06 +0100 Subject: radeon/r300: don't flush cmdbuf if not necessary --- src/mesa/drivers/dri/r300/r300_tex.c | 6 +++++- src/mesa/drivers/dri/radeon/radeon_texture.c | 16 ++++++++++++++-- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c index 27b78a912f..427237d200 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.c +++ b/src/mesa/drivers/dri/r300/r300_tex.c @@ -270,7 +270,11 @@ static void r300DeleteTexture(GLcontext * ctx, struct gl_texture_object *texObj) if (rmesa) { int i; - radeon_firevertices(&rmesa->radeon); + struct radeon_bo *bo; + bo = !t->mt ? t->bo : t->mt->bo; + if (bo && radeon_bo_is_referenced_by_cs(bo, rmesa->radeon.cmdbuf.cs)) { + radeon_firevertices(&rmesa->radeon); + } for(i = 0; i < R300_MAX_TEXTURE_UNITS; ++i) if (rmesa->hw.textures[i] == t) diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index baa99b752b..59bc8c34de 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -534,7 +534,13 @@ static void radeon_teximage( GLuint texelBytes; GLuint face = radeon_face_for_target(target); - radeon_firevertices(rmesa); + { + struct radeon_bo *bo; + bo = !image->mt ? image->bo : image->mt->bo; + if (bo && radeon_bo_is_referenced_by_cs(bo, rmesa->cmdbuf.cs)) { + radeon_firevertices(rmesa); + } + } t->validated = GL_FALSE; @@ -731,7 +737,13 @@ static void radeon_texsubimage(GLcontext* ctx, int dims, GLenum target, int leve radeonTexObj* t = radeon_tex_obj(texObj); radeon_texture_image* image = get_radeon_texture_image(texImage); - radeon_firevertices(rmesa); + { + struct radeon_bo *bo; + bo = !image->mt ? image->bo : image->mt->bo; + if (bo && radeon_bo_is_referenced_by_cs(bo, rmesa->cmdbuf.cs)) { + radeon_firevertices(rmesa); + } + } t->validated = GL_FALSE; if (compressed) { -- cgit v1.2.3 From aa195611586cdfb21bb1707b12b16e461a92d42e Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Wed, 11 Nov 2009 14:00:15 +0100 Subject: radeon: use radeon_bo_is_referenced_by_cs for query objects --- src/mesa/drivers/dri/radeon/radeon_common.c | 3 --- src/mesa/drivers/dri/radeon/radeon_common_context.c | 1 - src/mesa/drivers/dri/radeon/radeon_common_context.h | 1 - src/mesa/drivers/dri/radeon/radeon_queryobj.c | 21 +++------------------ 4 files changed, 3 insertions(+), 23 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c b/src/mesa/drivers/dri/radeon/radeon_common.c index cb344f1d21..3b4366aa61 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common.c +++ b/src/mesa/drivers/dri/radeon/radeon_common.c @@ -1147,9 +1147,6 @@ void radeonFlush(GLcontext *ctx) } } } - - make_empty_list(&radeon->query.not_flushed_head); - } /* Make sure all commands have been sent to the hardware and have diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.c b/src/mesa/drivers/dri/radeon/radeon_common_context.c index fe99644907..2a38c4599c 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.c @@ -265,7 +265,6 @@ GLboolean radeonInitContext(radeonContextPtr radeon, radeon->texture_compressed_row_align = 64; } - make_empty_list(&radeon->query.not_flushed_head); radeon_init_dma(radeon); return GL_TRUE; diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.h b/src/mesa/drivers/dri/radeon/radeon_common_context.h index 0309345393..5a0678b9d6 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.h +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.h @@ -502,7 +502,6 @@ struct radeon_context { struct { struct radeon_query_object *current; - struct radeon_query_object not_flushed_head; struct radeon_state_atom queryobj; } query; diff --git a/src/mesa/drivers/dri/radeon/radeon_queryobj.c b/src/mesa/drivers/dri/radeon/radeon_queryobj.c index 6539c36268..b734f86eb3 100644 --- a/src/mesa/drivers/dri/radeon/radeon_queryobj.c +++ b/src/mesa/drivers/dri/radeon/radeon_queryobj.c @@ -31,20 +31,6 @@ #include "main/imports.h" #include "main/simple_list.h" -static int radeonQueryIsFlushed(GLcontext *ctx, struct gl_query_object *q) -{ - radeonContextPtr radeon = RADEON_CONTEXT(ctx); - struct radeon_query_object *tmp, *query = (struct radeon_query_object *)q; - - foreach(tmp, &radeon->query.not_flushed_head) { - if (tmp == query) { - return 0; - } - } - - return 1; -} - static void radeonQueryGetResult(GLcontext *ctx, struct gl_query_object *q) { radeonContextPtr radeon = RADEON_CONTEXT(ctx); @@ -120,10 +106,11 @@ static void radeonDeleteQuery(GLcontext *ctx, struct gl_query_object *q) static void radeonWaitQuery(GLcontext *ctx, struct gl_query_object *q) { + radeonContextPtr radeon = RADEON_CONTEXT(ctx); struct radeon_query_object *query = (struct radeon_query_object *)q; /* If the cmdbuf with packets for this query hasn't been flushed yet, do it now */ - if (!radeonQueryIsFlushed(ctx, q)) + if (radeon_bo_is_referenced_by_cs(query->bo, radeon->cmdbuf.cs)) ctx->Driver.Flush(ctx); radeon_print(RADEON_STATE, RADEON_VERBOSE, "%s: query id %d, bo %p, offset %d\n", __FUNCTION__, q->Id, query->bo, query->curr_offset); @@ -155,8 +142,6 @@ static void radeonBeginQuery(GLcontext *ctx, struct gl_query_object *q) radeon->query.queryobj.dirty = GL_TRUE; radeon->hw.is_dirty = GL_TRUE; - insert_at_tail(&radeon->query.not_flushed_head, query); - } void radeonEmitQueryEnd(GLcontext *ctx) @@ -204,7 +189,7 @@ static void radeonCheckQuery(GLcontext *ctx, struct gl_query_object *q) uint32_t domain; /* Need to perform a flush, as per ARB_occlusion_query spec */ - if (!radeonQueryIsFlushed(ctx, q)) { + if (radeon_bo_is_referenced_by_cs(query->bo, radeon->cmdbuf.cs)) { ctx->Driver.Flush(ctx); } -- cgit v1.2.3 From 6e5d473cc16ca2d001df213fc1d907f2943a95bb Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Wed, 11 Nov 2009 18:55:49 +0100 Subject: r300: fix regression introduced in 1d5a06a1f7812c055db1d724e40d21a0e3686dd1 Spotted by Dave Airlie --- src/mesa/drivers/dri/r300/r300_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 6f66e970e4..3ed49a85c5 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -439,7 +439,7 @@ static void r300InitGLExtensions(GLcontext *ctx) if (r300->options.stencil_two_side_disabled) _mesa_disable_extension(ctx, "GL_EXT_stencil_two_side"); - if (r300->options.s3tc_force_enabled) { + if (ctx->Mesa_DXTn || r300->options.s3tc_force_enabled) { _mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc"); _mesa_enable_extension(ctx, "GL_S3_s3tc"); } else if (r300->options.s3tc_force_disabled) { -- cgit v1.2.3 From 7628b06ba32e42f57a4fdb322bc32e3b411c1f18 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 14 Nov 2009 14:55:13 +0100 Subject: radeon: rework mipmap tree reference counting --- src/mesa/drivers/dri/r300/r300_tex.c | 13 ++++-------- src/mesa/drivers/dri/r300/r300_texstate.c | 12 ++++-------- src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c | 12 ++++++++++-- src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h | 5 +++-- src/mesa/drivers/dri/radeon/radeon_texture.c | 25 +++++++++--------------- 5 files changed, 30 insertions(+), 37 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c index 427237d200..7e94e93df2 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.c +++ b/src/mesa/drivers/dri/r300/r300_tex.c @@ -228,11 +228,8 @@ static void r300TexParameter(GLcontext * ctx, GLenum target, * we just have to rely on loading the right subset of mipmap levels * to simulate a clamped LOD. */ - if (t->mt) { - radeon_miptree_unreference(t->mt); - t->mt = 0; - t->validated = GL_FALSE; - } + radeon_miptree_unreference(&t->mt); + t->validated = GL_FALSE; break; case GL_DEPTH_TEXTURE_MODE: @@ -286,10 +283,8 @@ static void r300DeleteTexture(GLcontext * ctx, struct gl_texture_object *texObj) t->bo = NULL; } - if (t->mt) { - radeon_miptree_unreference(t->mt); - t->mt = 0; - } + radeon_miptree_unreference(&t->mt); + _mesa_delete_texture_object(ctx, texObj); } diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index 4699342994..7b1adcf31d 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -438,14 +438,10 @@ void r300SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo radeon_bo_unref(rImage->bo); rImage->bo = NULL; } - if (t->mt) { - radeon_miptree_unreference(t->mt); - t->mt = NULL; - } - if (rImage->mt) { - radeon_miptree_unreference(rImage->mt); - rImage->mt = NULL; - } + + radeon_miptree_unreference(&t->mt); + radeon_miptree_unreference(&rImage->mt); + _mesa_init_teximage_fields(radeon->glCtx, target, texImage, rb->base.Width, rb->base.Height, 1, 0, rb->cpp); texImage->RowStride = rb->pitch / rb->cpp; diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c index dadc72f4c1..f635f58d6a 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c @@ -223,23 +223,31 @@ radeon_mipmap_tree* radeon_miptree_create(radeonContextPtr rmesa, radeonTexObj * return mt; } -void radeon_miptree_reference(radeon_mipmap_tree *mt) +void radeon_miptree_reference(radeon_mipmap_tree *mt, radeon_mipmap_tree **ptr) { + assert(!*ptr); + mt->refcount++; assert(mt->refcount > 0); + + *ptr = mt; } -void radeon_miptree_unreference(radeon_mipmap_tree *mt) +void radeon_miptree_unreference(radeon_mipmap_tree **ptr) { + radeon_mipmap_tree *mt = *ptr; if (!mt) return; assert(mt->refcount > 0); + mt->refcount--; if (!mt->refcount) { radeon_bo_unref(mt->bo); free(mt); } + + *ptr = 0; } diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h index db28252da3..57299ceafa 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h @@ -87,8 +87,9 @@ radeon_mipmap_tree* radeon_miptree_create(radeonContextPtr rmesa, radeonTexObj * GLenum target, GLenum internal_format, GLuint firstLevel, GLuint lastLevel, GLuint width0, GLuint height0, GLuint depth0, GLuint bpp, GLuint tilebits, GLuint compressed); -void radeon_miptree_reference(radeon_mipmap_tree *mt); -void radeon_miptree_unreference(radeon_mipmap_tree *mt); + +void radeon_miptree_reference(radeon_mipmap_tree *mt, radeon_mipmap_tree **ptr); +void radeon_miptree_unreference(radeon_mipmap_tree **ptr); GLboolean radeon_miptree_matches_image(radeon_mipmap_tree *mt, struct gl_texture_image *texImage, GLuint face, GLuint level); diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 59bc8c34de..607ce7864e 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -81,8 +81,7 @@ void radeonFreeTexImageData(GLcontext *ctx, struct gl_texture_image *timage) radeon_texture_image* image = get_radeon_texture_image(timage); if (image->mt) { - radeon_miptree_unreference(image->mt); - image->mt = 0; + radeon_miptree_unreference(&image->mt); assert(!image->base.Data); } else { _mesa_free_texture_image_data(ctx, timage); @@ -240,8 +239,7 @@ static void radeon_generate_mipmap(GLcontext *ctx, GLenum target, image->mtlevel = i; image->mtface = face; - radeon_miptree_unreference(image->mt); - image->mt = NULL; + radeon_miptree_unreference(&image->mt); } } @@ -571,18 +569,16 @@ static void radeon_teximage( t->mt->lastLevel == level && t->mt->target != GL_TEXTURE_CUBE_MAP_ARB && !radeon_miptree_matches_image(t->mt, texImage, face, level)) { - radeon_miptree_unreference(t->mt); - t->mt = NULL; + radeon_miptree_unreference(&t->mt); } if (!t->mt) radeon_try_alloc_miptree(rmesa, t, image, face, level); if (t->mt && radeon_miptree_matches_image(t->mt, texImage, face, level)) { radeon_mipmap_level *lvl; - image->mt = t->mt; image->mtlevel = level - t->mt->firstLevel; image->mtface = face; - radeon_miptree_reference(t->mt); + radeon_miptree_reference(t->mt, &image->mt); lvl = &image->mt->levels[image->mtlevel]; dstRowStride = lvl->rowstride; } else { @@ -894,7 +890,7 @@ static void migrate_image_to_miptree(radeon_mipmap_tree *mt, radeon_texture_imag dstlvl->size); radeon_bo_unmap(image->mt->bo); - radeon_miptree_unreference(image->mt); + radeon_miptree_unreference(&image->mt); } else { uint32_t srcrowstride; uint32_t height; @@ -919,10 +915,9 @@ static void migrate_image_to_miptree(radeon_mipmap_tree *mt, radeon_texture_imag radeon_bo_unmap(mt->bo); - image->mt = mt; image->mtface = face; image->mtlevel = level; - radeon_miptree_reference(image->mt); + radeon_miptree_reference(mt, &image->mt); } int radeon_validate_texture_miptree(GLcontext * ctx, struct gl_texture_object *texObj) @@ -954,12 +949,10 @@ int radeon_validate_texture_miptree(GLcontext * ctx, struct gl_texture_object *t if (baseimage->mt && baseimage->mt != t->mt && radeon_miptree_matches_texture(baseimage->mt, &t->base)) { - radeon_miptree_unreference(t->mt); - t->mt = baseimage->mt; - radeon_miptree_reference(t->mt); + radeon_miptree_unreference(&t->mt); + radeon_miptree_reference(baseimage->mt, &t->mt); } else if (t->mt && !radeon_miptree_matches_texture(t->mt, &t->base)) { - radeon_miptree_unreference(t->mt); - t->mt = 0; + radeon_miptree_unreference(&t->mt); } if (!t->mt) { -- cgit v1.2.3 From 9d0af686b27b82dce8ad1ee4c951098660807be6 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 14 Nov 2009 15:03:31 +0100 Subject: radeon: minor refactoring of texture code Also properly set dstImageOffsets for TexSubImage case. --- src/mesa/drivers/dri/radeon/radeon_texture.c | 57 ++++++++++++++++++++++------ 1 file changed, 46 insertions(+), 11 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 607ce7864e..8fc686581b 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -508,6 +508,27 @@ gl_format radeonChooseTextureFormat(GLcontext * ctx, return MESA_FORMAT_NONE; /* never get here */ } +static GLuint * allocate_image_offsets(GLcontext *ctx, + unsigned alignedWidth, + unsigned height, + unsigned depth) +{ + int i; + GLuint *offsets; + + offsets = _mesa_malloc(depth * sizeof(GLuint)) ; + if (!offsets) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTex[Sub]Image"); + return NULL; + } + + for (i = 0; i < depth; ++i) { + offsets[i] = alignedWidth * height * i; + } + + return offsets; +} + /** * All glTexImage calls go through this function. */ @@ -605,8 +626,8 @@ static void radeon_teximage( } if (pixels) { - radeon_teximage_map(image, GL_TRUE); if (compressed) { + radeon_teximage_map(image, GL_TRUE); if (image->mt) { uint32_t srcRowStride, bytesPerRow, rows; srcRowStride = _mesa_format_row_stride(texImage->TexFormat, width); @@ -629,19 +650,17 @@ static void radeon_teximage( } if (dims == 3) { - int i; - - dstImageOffsets = _mesa_malloc(depth * sizeof(GLuint)) ; - if (!dstImageOffsets) - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage"); - - for (i = 0; i < depth; ++i) { - dstImageOffsets[i] = dstRowStride/_mesa_get_format_bytes(texImage->TexFormat) * height * i; + unsigned alignedWidth = dstRowStride/_mesa_get_format_bytes(texImage->TexFormat); + dstImageOffsets = allocate_image_offsets(ctx, alignedWidth, height, depth); + if (!dstImageOffsets) { + return; } } else { dstImageOffsets = texImage->ImageOffsets; } + radeon_teximage_map(image, GL_TRUE); + if (!_mesa_texstore(ctx, dims, texImage->_BaseFormat, texImage->TexFormat, @@ -752,7 +771,7 @@ static void radeon_texsubimage(GLcontext* ctx, int dims, GLenum target, int leve if (pixels) { GLint dstRowStride; - radeon_teximage_map(image, GL_TRUE); + GLuint *dstImageOffsets; if (image->mt) { radeon_mipmap_level *lvl = &image->mt->levels[image->mtlevel]; @@ -761,6 +780,18 @@ static void radeon_texsubimage(GLcontext* ctx, int dims, GLenum target, int leve dstRowStride = texImage->RowStride * _mesa_get_format_bytes(texImage->TexFormat); } + if (dims == 3) { + unsigned alignedWidth = dstRowStride/_mesa_get_format_bytes(texImage->TexFormat); + dstImageOffsets = allocate_image_offsets(ctx, alignedWidth, height, depth); + if (!dstImageOffsets) { + return; + } + } else { + dstImageOffsets = texImage->ImageOffsets; + } + + radeon_teximage_map(image, GL_TRUE); + if (compressed) { uint32_t srcRowStride, bytesPerRow, rows; GLubyte *img_start; @@ -786,12 +817,16 @@ static void radeon_texsubimage(GLcontext* ctx, int dims, GLenum target, int leve texImage->TexFormat, texImage->Data, xoffset, yoffset, zoffset, dstRowStride, - texImage->ImageOffsets, + dstImageOffsets, width, height, depth, format, type, pixels, packing)) { _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage"); } } + + if (dims == 3) { + _mesa_free(dstImageOffsets); + } } radeon_teximage_unmap(image); -- cgit v1.2.3 From 8f88cf3938f0156d4df6fcc5fde2711d40b85d03 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 14 Nov 2009 15:15:42 +0100 Subject: radeon: more texture code refactoring --- src/mesa/drivers/dri/radeon/radeon_texture.c | 208 ++++++++++++--------------- 1 file changed, 92 insertions(+), 116 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 8fc686581b..c093d1283d 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -529,6 +529,83 @@ static GLuint * allocate_image_offsets(GLcontext *ctx, return offsets; } +/** + * Update a subregion of the given texture image. + */ +static void radeon_store_teximage(GLcontext* ctx, int dims, + GLint xoffset, GLint yoffset, GLint zoffset, + GLsizei width, GLsizei height, GLsizei depth, + GLsizei imageSize, + GLenum format, GLenum type, + const GLvoid * pixels, + const struct gl_pixelstore_attrib *packing, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage, + int compressed) +{ + radeon_texture_image* image = get_radeon_texture_image(texImage); + + GLint dstRowStride; + GLuint *dstImageOffsets; + + if (image->mt) { + radeon_mipmap_level *lvl = &image->mt->levels[image->mtlevel]; + dstRowStride = lvl->rowstride; + } else { + dstRowStride = texImage->RowStride * _mesa_get_format_bytes(texImage->TexFormat); + } + + if (dims == 3) { + unsigned alignedWidth = dstRowStride/_mesa_get_format_bytes(texImage->TexFormat); + dstImageOffsets = allocate_image_offsets(ctx, alignedWidth, height, depth); + if (!dstImageOffsets) { + return; + } + } else { + dstImageOffsets = texImage->ImageOffsets; + } + + radeon_teximage_map(image, GL_TRUE); + + if (compressed) { + uint32_t srcRowStride, bytesPerRow, rows; + GLubyte *img_start; + if (!image->mt) { + dstRowStride = _mesa_format_row_stride(texImage->TexFormat, texImage->Width); + img_start = _mesa_compressed_image_address(xoffset, yoffset, 0, + texImage->TexFormat, + texImage->Width, texImage->Data); + } + else { + uint32_t blocks_x = dstRowStride / (image->mt->bpp * 4); + img_start = texImage->Data + image->mt->bpp * 4 * (blocks_x * (yoffset / 4) + xoffset / 4); + } + srcRowStride = _mesa_format_row_stride(texImage->TexFormat, width); + bytesPerRow = srcRowStride; + rows = (height + 3) / 4; + + copy_rows(img_start, dstRowStride, pixels, srcRowStride, rows, bytesPerRow); + + } + else { + if (!_mesa_texstore(ctx, dims, texImage->_BaseFormat, + texImage->TexFormat, texImage->Data, + xoffset, yoffset, zoffset, + dstRowStride, + dstImageOffsets, + width, height, depth, + format, type, pixels, packing)) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage"); + } + } + + if (dims == 3) { + _mesa_free(dstImageOffsets); + } + + radeon_teximage_unmap(image); +} + /** * All glTexImage calls go through this function. */ @@ -626,63 +703,16 @@ static void radeon_teximage( } if (pixels) { - if (compressed) { - radeon_teximage_map(image, GL_TRUE); - if (image->mt) { - uint32_t srcRowStride, bytesPerRow, rows; - srcRowStride = _mesa_format_row_stride(texImage->TexFormat, width); - bytesPerRow = srcRowStride; - rows = (height + 3) / 4; - copy_rows(texImage->Data, image->mt->levels[level].rowstride, - pixels, srcRowStride, rows, bytesPerRow); - } else { - memcpy(texImage->Data, pixels, imageSize); - } - } else { - GLuint dstRowStride; - GLuint *dstImageOffsets; - - if (image->mt) { - radeon_mipmap_level *lvl = &image->mt->levels[image->mtlevel]; - dstRowStride = lvl->rowstride; - } else { - dstRowStride = texImage->Width * _mesa_get_format_bytes(texImage->TexFormat); - } - - if (dims == 3) { - unsigned alignedWidth = dstRowStride/_mesa_get_format_bytes(texImage->TexFormat); - dstImageOffsets = allocate_image_offsets(ctx, alignedWidth, height, depth); - if (!dstImageOffsets) { - return; - } - } else { - dstImageOffsets = texImage->ImageOffsets; - } - - radeon_teximage_map(image, GL_TRUE); - - if (!_mesa_texstore(ctx, dims, - texImage->_BaseFormat, - texImage->TexFormat, - texImage->Data, 0, 0, 0, /* dstX/Y/Zoffset */ - dstRowStride, - dstImageOffsets, - width, height, depth, - format, type, pixels, packing)) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexImage"); - } - - if (dims == 3) - _mesa_free(dstImageOffsets); - } + radeon_store_teximage(ctx, dims, + 0, 0, 0, + width, height, depth, + imageSize, format, type, + pixels, packing, + texObj, texImage, + compressed); } _mesa_unmap_teximage_pbo(ctx, packing); - - if (pixels) - radeon_teximage_unmap(image); - - } void radeonTexImage1D(GLcontext * ctx, GLenum target, GLint level, @@ -735,7 +765,7 @@ void radeonTexImage3D(GLcontext * ctx, GLenum target, GLint level, } /** - * Update a subregion of the given texture image. + * All glTexSubImage calls go through this function. */ static void radeon_texsubimage(GLcontext* ctx, int dims, GLenum target, int level, GLint xoffset, GLint yoffset, GLint zoffset, @@ -770,70 +800,16 @@ static void radeon_texsubimage(GLcontext* ctx, int dims, GLenum target, int leve } if (pixels) { - GLint dstRowStride; - GLuint *dstImageOffsets; - - if (image->mt) { - radeon_mipmap_level *lvl = &image->mt->levels[image->mtlevel]; - dstRowStride = lvl->rowstride; - } else { - dstRowStride = texImage->RowStride * _mesa_get_format_bytes(texImage->TexFormat); - } - - if (dims == 3) { - unsigned alignedWidth = dstRowStride/_mesa_get_format_bytes(texImage->TexFormat); - dstImageOffsets = allocate_image_offsets(ctx, alignedWidth, height, depth); - if (!dstImageOffsets) { - return; - } - } else { - dstImageOffsets = texImage->ImageOffsets; - } - - radeon_teximage_map(image, GL_TRUE); - - if (compressed) { - uint32_t srcRowStride, bytesPerRow, rows; - GLubyte *img_start; - if (!image->mt) { - dstRowStride = _mesa_format_row_stride(texImage->TexFormat, texImage->Width); - img_start = _mesa_compressed_image_address(xoffset, yoffset, 0, - texImage->TexFormat, - texImage->Width, texImage->Data); - } - else { - uint32_t blocks_x = dstRowStride / (image->mt->bpp * 4); - img_start = texImage->Data + image->mt->bpp * 4 * (blocks_x * (yoffset / 4) + xoffset / 4); - } - srcRowStride = _mesa_format_row_stride(texImage->TexFormat, width); - bytesPerRow = srcRowStride; - rows = (height + 3) / 4; - - copy_rows(img_start, dstRowStride, pixels, srcRowStride, rows, bytesPerRow); - - } - else { - if (!_mesa_texstore(ctx, dims, texImage->_BaseFormat, - texImage->TexFormat, texImage->Data, - xoffset, yoffset, zoffset, - dstRowStride, - dstImageOffsets, - width, height, depth, - format, type, pixels, packing)) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glTexSubImage"); - } - } - - if (dims == 3) { - _mesa_free(dstImageOffsets); - } + radeon_store_teximage(ctx, dims, + xoffset, yoffset, zoffset, + width, height, depth, + imageSize, format, type, + pixels, packing, + texObj, texImage, + compressed); } - radeon_teximage_unmap(image); - _mesa_unmap_teximage_pbo(ctx, packing); - - } void radeonTexSubImage1D(GLcontext * ctx, GLenum target, GLint level, -- cgit v1.2.3 From 23ec7c457483aae1e0d399e9b570f1860c27c780 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 14 Nov 2009 16:55:39 +0100 Subject: radeon: rework mipmap tree --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 2 +- src/mesa/drivers/dri/r300/r300_tex.c | 6 - src/mesa/drivers/dri/r300/r300_texstate.c | 8 +- .../drivers/dri/radeon/radeon_common_context.h | 4 + src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c | 474 ++++++++++++++------- src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h | 24 +- src/mesa/drivers/dri/radeon/radeon_texture.c | 243 +++-------- src/mesa/drivers/dri/radeon/radeon_texture.h | 3 +- 8 files changed, 400 insertions(+), 364 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index 8a56b9e63c..4b5ed2d410 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -169,7 +169,7 @@ static void emit_tex_offsets(GLcontext *ctx, struct radeon_state_atom * atom) if (t && !t->image_override) { BEGIN_BATCH_NO_AUTOSTATE(4); OUT_BATCH_REGSEQ(R300_TX_OFFSET_0 + (i * 4), 1); - OUT_BATCH_RELOC(t->tile_bits, t->mt->bo, 0, + OUT_BATCH_RELOC(t->tile_bits, t->mt->bo, get_base_teximage_offset(t), RADEON_GEM_DOMAIN_GTT|RADEON_GEM_DOMAIN_VRAM, 0, 0); END_BATCH(); } else if (!t) { diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c index 7e94e93df2..726b3ff98e 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.c +++ b/src/mesa/drivers/dri/r300/r300_tex.c @@ -223,12 +223,6 @@ static void r300TexParameter(GLcontext * ctx, GLenum target, case GL_TEXTURE_MAX_LEVEL: case GL_TEXTURE_MIN_LOD: case GL_TEXTURE_MAX_LOD: - /* This isn't the most efficient solution but there doesn't appear to - * be a nice alternative. Since there's no LOD clamping, - * we just have to rely on loading the right subset of mipmap levels - * to simulate a clamped LOD. - */ - radeon_miptree_unreference(&t->mt); t->validated = GL_FALSE; break; diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index 7b1adcf31d..e6f2c0c1a7 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -203,9 +203,7 @@ void r300SetDepthTexMode(struct gl_texture_object *tObj) static void setup_hardware_state(r300ContextPtr rmesa, radeonTexObj *t) { const struct gl_texture_image *firstImage; - int firstlevel = t->mt ? t->mt->firstLevel : 0; - - firstImage = t->base.Image[0][firstlevel]; + firstImage = t->base.Image[0][t->minLod]; if (!t->image_override && VALID_FORMAT(firstImage->TexFormat)) { @@ -228,7 +226,7 @@ static void setup_hardware_state(r300ContextPtr rmesa, radeonTexObj *t) t->pp_txsize = (((R300_TX_WIDTHMASK_MASK & ((firstImage->Width - 1) << R300_TX_WIDTHMASK_SHIFT))) | ((R300_TX_HEIGHTMASK_MASK & ((firstImage->Height - 1) << R300_TX_HEIGHTMASK_SHIFT))) | ((R300_TX_DEPTHMASK_MASK & ((firstImage->DepthLog2) << R300_TX_DEPTHMASK_SHIFT))) - | ((R300_TX_MAX_MIP_LEVEL_MASK & ((t->mt->lastLevel - t->mt->firstLevel) << R300_TX_MAX_MIP_LEVEL_SHIFT)))); + | ((R300_TX_MAX_MIP_LEVEL_MASK & ((t->maxLod - t->minLod) << R300_TX_MAX_MIP_LEVEL_SHIFT)))); t->tile_bits = 0; @@ -239,7 +237,7 @@ static void setup_hardware_state(r300ContextPtr rmesa, radeonTexObj *t) if (t->base.Target == GL_TEXTURE_RECTANGLE_NV) { - unsigned int align = (64 / t->mt->bpp) - 1; + unsigned int align = (64 / _mesa_get_format_bytes(firstImage->TexFormat)) - 1; t->pp_txsize |= R300_TX_SIZE_TXPITCH_EN; if (!t->image_override) t->pp_txpitch = ((firstImage->Width + align) & ~align) - 1; diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.h b/src/mesa/drivers/dri/radeon/radeon_common_context.h index 5a0678b9d6..ded81fff29 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.h +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.h @@ -208,6 +208,10 @@ struct radeon_tex_obj { * and so on. */ GLboolean validated; + /* Minimum LOD to be used during rendering */ + unsigned minLod; + /* Miximum LOD to be used during rendering */ + unsigned maxLod; GLuint override_offset; GLboolean image_override; /* Image overridden by GLX_EXT_tfp */ diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c index f635f58d6a..f01136b9d4 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c @@ -1,4 +1,5 @@ /* + * Copyright (C) 2009 Maciej Cencora. * Copyright (C) 2008 Nicolai Haehnle. * * All Rights Reserved. @@ -32,10 +33,14 @@ #include "main/simple_list.h" #include "main/texcompress.h" +#include "main/teximage.h" +/* TODO: remove if texture completeness check is removed */ +#include "main/texobj.h" +#include "radeon_texture.h" static GLuint radeon_compressed_texture_size(GLcontext *ctx, GLsizei width, GLsizei height, GLsizei depth, - GLuint mesaFormat) + gl_format mesaFormat) { GLuint size = _mesa_format_image_size(mesaFormat, width, height, depth); @@ -55,29 +60,6 @@ static GLuint radeon_compressed_texture_size(GLcontext *ctx, return size; } - -static int radeon_compressed_num_bytes(GLuint mesaFormat) -{ - int bytes = 0; - switch(mesaFormat) { - - case MESA_FORMAT_RGB_FXT1: - case MESA_FORMAT_RGBA_FXT1: - case MESA_FORMAT_RGB_DXT1: - case MESA_FORMAT_RGBA_DXT1: - bytes = 2; - break; - - case MESA_FORMAT_RGBA_DXT3: - case MESA_FORMAT_RGBA_DXT5: - bytes = 4; - default: - break; - } - - return bytes; -} - /** * Compute sizes and fill in offset and blit information for the given * image (determined by \p face and \p level). @@ -92,25 +74,24 @@ static void compute_tex_image_offset(radeonContextPtr rmesa, radeon_mipmap_tree uint32_t row_align; /* Find image size in bytes */ - if (mt->compressed) { + if (_mesa_is_format_compressed(mt->mesaFormat)) { /* TODO: Is this correct? Need test cases for compressed textures! */ row_align = rmesa->texture_compressed_row_align - 1; - lvl->rowstride = (lvl->width * mt->bpp + row_align) & ~row_align; - lvl->size = radeon_compressed_texture_size(mt->radeon->glCtx, - lvl->width, lvl->height, lvl->depth, mt->compressed); + lvl->rowstride = (_mesa_format_row_stride(mt->mesaFormat, lvl->width) + row_align) & ~row_align; + lvl->size = radeon_compressed_texture_size(rmesa->glCtx, lvl->width, lvl->height, lvl->depth, mt->mesaFormat); } else if (mt->target == GL_TEXTURE_RECTANGLE_NV) { row_align = rmesa->texture_rect_row_align - 1; - lvl->rowstride = (lvl->width * mt->bpp + row_align) & ~row_align; + lvl->rowstride = (_mesa_format_row_stride(mt->mesaFormat, lvl->width) + row_align) & ~row_align; lvl->size = lvl->rowstride * lvl->height; } else if (mt->tilebits & RADEON_TXO_MICRO_TILE) { /* tile pattern is 16 bytes x2. mipmaps stay 32 byte aligned, * though the actual offset may be different (if texture is less than * 32 bytes width) to the untiled case */ - lvl->rowstride = (lvl->width * mt->bpp * 2 + 31) & ~31; + lvl->rowstride = (_mesa_format_row_stride(mt->mesaFormat, lvl->width) * 2 + 31) & ~31; lvl->size = lvl->rowstride * ((lvl->height + 1) / 2) * lvl->depth; } else { row_align = rmesa->texture_row_align - 1; - lvl->rowstride = (lvl->width * mt->bpp + row_align) & ~row_align; + lvl->rowstride = (_mesa_format_row_stride(mt->mesaFormat, lvl->width) + row_align) & ~row_align; lvl->size = lvl->rowstride * lvl->height * lvl->depth; } assert(lvl->size > 0); @@ -138,17 +119,15 @@ static GLuint minify(GLuint size, GLuint levels) static void calculate_miptree_layout_r100(radeonContextPtr rmesa, radeon_mipmap_tree *mt) { GLuint curOffset; - GLuint numLevels; GLuint i; GLuint face; - numLevels = mt->lastLevel - mt->firstLevel + 1; - assert(numLevels <= rmesa->glCtx->Const.MaxTextureLevels); + assert(mt->numLevels <= rmesa->glCtx->Const.MaxTextureLevels); curOffset = 0; for(face = 0; face < mt->faces; face++) { - for(i = 0; i < numLevels; i++) { + for(i = 0; i < mt->numLevels; i++) { mt->levels[i].width = minify(mt->width0, i); mt->levels[i].height = minify(mt->height0, i); mt->levels[i].depth = minify(mt->depth0, i); @@ -163,14 +142,12 @@ static void calculate_miptree_layout_r100(radeonContextPtr rmesa, radeon_mipmap_ static void calculate_miptree_layout_r300(radeonContextPtr rmesa, radeon_mipmap_tree *mt) { GLuint curOffset; - GLuint numLevels; GLuint i; - numLevels = mt->lastLevel - mt->firstLevel + 1; - assert(numLevels <= rmesa->glCtx->Const.MaxTextureLevels); + assert(mt->numLevels <= rmesa->glCtx->Const.MaxTextureLevels); curOffset = 0; - for(i = 0; i < numLevels; i++) { + for(i = 0; i < mt->numLevels; i++) { GLuint face; mt->levels[i].width = minify(mt->width0, i); @@ -188,27 +165,22 @@ static void calculate_miptree_layout_r300(radeonContextPtr rmesa, radeon_mipmap_ /** * Create a new mipmap tree, calculate its layout and allocate memory. */ -radeon_mipmap_tree* radeon_miptree_create(radeonContextPtr rmesa, radeonTexObj *t, - GLenum target, GLenum internal_format, GLuint firstLevel, GLuint lastLevel, - GLuint width0, GLuint height0, GLuint depth0, - GLuint bpp, GLuint tilebits, GLuint compressed) +static radeon_mipmap_tree* radeon_miptree_create(radeonContextPtr rmesa, + GLenum target, gl_format mesaFormat, GLuint baseLevel, GLuint numLevels, + GLuint width0, GLuint height0, GLuint depth0, GLuint tilebits) { radeon_mipmap_tree *mt = CALLOC_STRUCT(_radeon_mipmap_tree); - mt->radeon = rmesa; - mt->internal_format = internal_format; + mt->mesaFormat = mesaFormat; mt->refcount = 1; - mt->t = t; mt->target = target; mt->faces = (target == GL_TEXTURE_CUBE_MAP) ? 6 : 1; - mt->firstLevel = firstLevel; - mt->lastLevel = lastLevel; + mt->baseLevel = baseLevel; + mt->numLevels = numLevels; mt->width0 = width0; mt->height0 = height0; mt->depth0 = depth0; - mt->bpp = compressed ? radeon_compressed_num_bytes(compressed) : bpp; mt->tilebits = tilebits; - mt->compressed = compressed; if (rmesa->radeonScreen->chip_family >= CHIP_FAMILY_R300) calculate_miptree_layout_r300(rmesa, mt); @@ -250,34 +222,16 @@ void radeon_miptree_unreference(radeon_mipmap_tree **ptr) *ptr = 0; } - /** - * Calculate first and last mip levels for the given texture object, - * where the dimensions are taken from the given texture image at - * the given level. - * - * Note: level is the OpenGL level number, which is not necessarily the same - * as the first level that is actually present. - * - * The base level image of the given texture face must be non-null, - * or this will fail. + * Calculate min and max LOD for the given texture object. + * @param[in] tObj texture object whose LOD values to calculate + * @param[out] pminLod minimal LOD + * @param[out] pmaxLod maximal LOD */ -static void calculate_first_last_level(struct gl_texture_object *tObj, - GLuint *pfirstLevel, GLuint *plastLevel, - GLuint face, GLuint level) +static void calculate_min_max_lod(struct gl_texture_object *tObj, + unsigned *pminLod, unsigned *pmaxLod) { - const struct gl_texture_image * const baseImage = - tObj->Image[face][level]; - - assert(baseImage); - - /* These must be signed values. MinLod and MaxLod can be negative numbers, - * and having firstLevel and lastLevel as signed prevents the need for - * extra sign checks. - */ - int firstLevel; - int lastLevel; - + int minLod, maxLod; /* Yes, this looks overly complicated, but it's all needed. */ switch (tObj->Target) { @@ -288,55 +242,46 @@ static void calculate_first_last_level(struct gl_texture_object *tObj, if (tObj->MinFilter == GL_NEAREST || tObj->MinFilter == GL_LINEAR) { /* GL_NEAREST and GL_LINEAR only care about GL_TEXTURE_BASE_LEVEL. */ - firstLevel = lastLevel = tObj->BaseLevel; + minLod = maxLod = tObj->BaseLevel; } else { - firstLevel = tObj->BaseLevel + (GLint)(tObj->MinLod + 0.5); - firstLevel = MAX2(firstLevel, tObj->BaseLevel); - firstLevel = MIN2(firstLevel, level + baseImage->MaxLog2); - lastLevel = tObj->BaseLevel + (GLint)(tObj->MaxLod + 0.5); - lastLevel = MAX2(lastLevel, tObj->BaseLevel); - lastLevel = MIN2(lastLevel, level + baseImage->MaxLog2); - lastLevel = MIN2(lastLevel, tObj->MaxLevel); - lastLevel = MAX2(firstLevel, lastLevel); /* need at least one level */ + minLod = tObj->BaseLevel + (GLint)(tObj->MinLod); + minLod = MAX2(minLod, tObj->BaseLevel); + minLod = MIN2(minLod, tObj->MaxLevel); + maxLod = tObj->BaseLevel + (GLint)(tObj->MaxLod + 0.5); + maxLod = MIN2(maxLod, tObj->MaxLevel); + maxLod = MIN2(maxLod, tObj->Image[0][minLod]->MaxLog2 + minLod); + maxLod = MAX2(maxLod, minLod); /* need at least one level */ } break; case GL_TEXTURE_RECTANGLE_NV: case GL_TEXTURE_4D_SGIS: - firstLevel = lastLevel = 0; + minLod = maxLod = 0; break; default: return; } /* save these values */ - *pfirstLevel = firstLevel; - *plastLevel = lastLevel; + *pminLod = minLod; + *pmaxLod = maxLod; } - /** * Checks whether the given miptree can hold the given texture image at the * given face and level. */ GLboolean radeon_miptree_matches_image(radeon_mipmap_tree *mt, - struct gl_texture_image *texImage, GLuint face, GLuint level) + struct gl_texture_image *texImage, GLuint face, GLuint mtLevel) { - GLboolean isCompressed = _mesa_is_format_compressed(texImage->TexFormat); radeon_mipmap_level *lvl; - if (face >= mt->faces || level < mt->firstLevel || level > mt->lastLevel) - return GL_FALSE; - - if (texImage->InternalFormat != mt->internal_format || - isCompressed != mt->compressed) + if (face >= mt->faces || mtLevel > mt->numLevels) return GL_FALSE; - if (!isCompressed && - !mt->compressed && - _mesa_get_format_bytes(texImage->TexFormat) != mt->bpp) + if (texImage->TexFormat != mt->mesaFormat) return GL_FALSE; - lvl = &mt->levels[level - mt->firstLevel]; + lvl = &mt->levels[mtLevel]; if (lvl->width != texImage->Width || lvl->height != texImage->Height || lvl->depth != texImage->Depth) @@ -345,64 +290,72 @@ GLboolean radeon_miptree_matches_image(radeon_mipmap_tree *mt, return GL_TRUE; } - /** * Checks whether the given miptree has the right format to store the given texture object. */ -GLboolean radeon_miptree_matches_texture(radeon_mipmap_tree *mt, struct gl_texture_object *texObj) +static GLboolean radeon_miptree_matches_texture(radeon_mipmap_tree *mt, struct gl_texture_object *texObj) { struct gl_texture_image *firstImage; - GLuint compressed; - GLuint numfaces = 1; - GLuint firstLevel, lastLevel; - GLuint texelBytes; - - calculate_first_last_level(texObj, &firstLevel, &lastLevel, 0, texObj->BaseLevel); - if (texObj->Target == GL_TEXTURE_CUBE_MAP) - numfaces = 6; - - firstImage = texObj->Image[0][firstLevel]; - compressed = _mesa_is_format_compressed(firstImage->TexFormat) ? firstImage->TexFormat : 0; - texelBytes = _mesa_get_format_bytes(firstImage->TexFormat); - - return (mt->firstLevel == firstLevel && - mt->lastLevel == lastLevel && - mt->width0 == firstImage->Width && - mt->height0 == firstImage->Height && - mt->depth0 == firstImage->Depth && - mt->compressed == compressed && - (!mt->compressed ? (mt->bpp == texelBytes) : 1)); -} + unsigned numLevels; + radeon_mipmap_level *mtBaseLevel; + if (texObj->BaseLevel < mt->baseLevel) + return GL_FALSE; + + mtBaseLevel = &mt->levels[texObj->BaseLevel - mt->baseLevel]; + firstImage = texObj->Image[0][texObj->BaseLevel]; + numLevels = MIN2(texObj->MaxLevel - texObj->BaseLevel + 1, firstImage->MaxLog2 + 1); + + if (RADEON_DEBUG & RADEON_TEXTURE) { + fprintf(stderr, "Checking if miptree %p matches texObj %p\n", mt, texObj); + fprintf(stderr, "target %d vs %d\n", mt->target, texObj->Target); + fprintf(stderr, "format %d vs %d\n", mt->mesaFormat, firstImage->TexFormat); + fprintf(stderr, "numLevels %d vs %d\n", mt->numLevels, numLevels); + fprintf(stderr, "width0 %d vs %d\n", mtBaseLevel->width, firstImage->Width); + fprintf(stderr, "height0 %d vs %d\n", mtBaseLevel->height, firstImage->Height); + fprintf(stderr, "depth0 %d vs %d\n", mtBaseLevel->depth, firstImage->Depth); + if (mt->target == texObj->Target && + mt->mesaFormat == firstImage->TexFormat && + mt->numLevels >= numLevels && + mtBaseLevel->width == firstImage->Width && + mtBaseLevel->height == firstImage->Height && + mtBaseLevel->depth == firstImage->Depth) { + fprintf(stderr, "MATCHED\n"); + } else { + fprintf(stderr, "NOT MATCHED\n"); + } + } + + return (mt->target == texObj->Target && + mt->mesaFormat == firstImage->TexFormat && + mt->numLevels >= numLevels && + mtBaseLevel->width == firstImage->Width && + mtBaseLevel->height == firstImage->Height && + mtBaseLevel->depth == firstImage->Depth); +} /** - * Try to allocate a mipmap tree for the given texture that will fit the - * given image in the given position. + * Try to allocate a mipmap tree for the given texture object. + * @param[in] rmesa radeon context + * @param[in] t radeon texture object */ -void radeon_try_alloc_miptree(radeonContextPtr rmesa, radeonTexObj *t, - radeon_texture_image *image, GLuint face, GLuint level) +void radeon_try_alloc_miptree(radeonContextPtr rmesa, radeonTexObj *t) { - GLuint compressed = _mesa_is_format_compressed(image->base.TexFormat) ? image->base.TexFormat : 0; - GLuint numfaces = 1; - GLuint firstLevel, lastLevel; - GLuint texelBytes; + struct gl_texture_object *texObj = &t->base; + struct gl_texture_image *texImg = texObj->Image[0][texObj->BaseLevel]; + GLuint numLevels; assert(!t->mt); - calculate_first_last_level(&t->base, &firstLevel, &lastLevel, face, level); - if (t->base.Target == GL_TEXTURE_CUBE_MAP) - numfaces = 6; - - if (level != firstLevel || face >= numfaces) + if (!texImg) return; - texelBytes = _mesa_get_format_bytes(image->base.TexFormat); + numLevels = MIN2(texObj->MaxLevel - texObj->BaseLevel + 1, texImg->MaxLog2 + 1); - t->mt = radeon_miptree_create(rmesa, t, t->base.Target, - image->base.InternalFormat, - firstLevel, lastLevel, - image->base.Width, image->base.Height, image->base.Depth, - texelBytes, t->tile_bits, compressed); + t->mt = radeon_miptree_create(rmesa, t->base.Target, + texImg->TexFormat, texObj->BaseLevel, + numLevels, texImg->Width, texImg->Height, + texImg->Depth, t->tile_bits); } /* Although we use the image_offset[] array to store relative offsets @@ -414,21 +367,238 @@ void radeon_try_alloc_miptree(radeonContextPtr rmesa, radeonTexObj *t, void radeon_miptree_depth_offsets(radeon_mipmap_tree *mt, GLuint level, GLuint *offsets) { - if (mt->target != GL_TEXTURE_3D || mt->faces == 1) - offsets[0] = 0; - else { - int i; - for (i = 0; i < 6; i++) - offsets[i] = mt->levels[level].faces[i].offset; - } + if (mt->target != GL_TEXTURE_3D || mt->faces == 1) { + offsets[0] = 0; + } else { + int i; + for (i = 0; i < 6; i++) { + offsets[i] = mt->levels[level].faces[i].offset; + } + } } GLuint radeon_miptree_image_offset(radeon_mipmap_tree *mt, GLuint face, GLuint level) { - if (mt->target == GL_TEXTURE_CUBE_MAP_ARB) - return (mt->levels[level].faces[face].offset); - else - return mt->levels[level].faces[0].offset; + if (mt->target == GL_TEXTURE_CUBE_MAP_ARB) + return (mt->levels[level].faces[face].offset); + else + return mt->levels[level].faces[0].offset; +} + +/** + * Convert radeon miptree texture level to GL texture level + * @param[in] tObj texture object whom level is to be converted + * @param[in] level radeon miptree texture level + * @return GL texture level + */ +unsigned radeon_miptree_level_to_gl_level(struct gl_texture_object *tObj, unsigned level) +{ + return level + tObj->BaseLevel; +} + +/** + * Convert GL texture level to radeon miptree texture level + * @param[in] tObj texture object whom level is to be converted + * @param[in] level GL texture level + * @return radeon miptree texture level + */ +unsigned radeon_gl_level_to_miptree_level(struct gl_texture_object *tObj, unsigned level) +{ + return level - tObj->BaseLevel; } + +/** + * Ensure that the given image is stored in the given miptree from now on. + */ +static void migrate_image_to_miptree(radeon_mipmap_tree *mt, + radeon_texture_image *image, + int face, int mtLevel) +{ + radeon_mipmap_level *dstlvl = &mt->levels[mtLevel]; + unsigned char *dest; + + assert(image->mt != mt); + assert(dstlvl->width == image->base.Width); + assert(dstlvl->height == image->base.Height); + assert(dstlvl->depth == image->base.Depth); + + radeon_bo_map(mt->bo, GL_TRUE); + dest = mt->bo->ptr + dstlvl->faces[face].offset; + + if (image->mt) { + /* Format etc. should match, so we really just need a memcpy(). + * In fact, that memcpy() could be done by the hardware in many + * cases, provided that we have a proper memory manager. + */ + assert(mt->mesaFormat == image->base.TexFormat); + + radeon_mipmap_level *srclvl = &image->mt->levels[image->mtlevel]; + + assert(srclvl->size == dstlvl->size); + assert(srclvl->rowstride == dstlvl->rowstride); + + radeon_bo_map(image->mt->bo, GL_FALSE); + + memcpy(dest, + image->mt->bo->ptr + srclvl->faces[face].offset, + dstlvl->size); + radeon_bo_unmap(image->mt->bo); + + radeon_miptree_unreference(&image->mt); + } else { + /* need to confirm this value is correct */ + if (_mesa_is_format_compressed(image->base.TexFormat)) { + unsigned size = _mesa_format_image_size(image->base.TexFormat, + image->base.Width, + image->base.Height, + image->base.Depth); + memcpy(dest, image->base.Data, size); + } else { + uint32_t srcrowstride; + uint32_t height; + + height = image->base.Height * image->base.Depth; + srcrowstride = image->base.Width * _mesa_get_format_bytes(image->base.TexFormat); + copy_rows(dest, dstlvl->rowstride, image->base.Data, srcrowstride, + height, srcrowstride); + } + + _mesa_free_texmemory(image->base.Data); + image->base.Data = 0; + } + + radeon_bo_unmap(mt->bo); + + radeon_miptree_reference(mt, &image->mt); + image->mtface = face; + image->mtlevel = mtLevel; +} + +/** + * Filter matching miptrees, and select one with the most of data. + * @param[in] texObj radeon texture object + * @param[in] firstLevel first texture level to check + * @param[in] lastLevel last texture level to check + */ +static radeon_mipmap_tree * get_biggest_matching_miptree(radeonTexObj *texObj, + unsigned firstLevel, + unsigned lastLevel) +{ + const unsigned numLevels = lastLevel - firstLevel; + unsigned *mtSizes = calloc(numLevels, sizeof(unsigned)); + radeon_mipmap_tree **mts = calloc(numLevels, sizeof(radeon_mipmap_tree *)); + unsigned mtCount = 0; + unsigned maxMtIndex = 0; + + for (unsigned level = firstLevel; level <= lastLevel; ++level) { + radeon_texture_image *img = get_radeon_texture_image(texObj->base.Image[0][level]); + unsigned found = 0; + // TODO: why this hack?? + if (!img) + break; + + if (!img->mt || !radeon_miptree_matches_texture(img->mt, &texObj->base)) + continue; + + for (int i = 0; i < mtCount; ++i) { + if (mts[i] == img->mt) { + found = 1; + mtSizes[i] += img->mt->levels[img->mtlevel].size; + break; + } + } + + if (!found) { + mtSizes[mtCount] += img->mt->levels[img->mtlevel].size; + mts[mtCount++] = img->mt; + mtCount++; + } + } + + if (mtCount == 0) { + return NULL; + } + + for (int i = 1; i < mtCount; ++i) { + if (mtSizes[i] > mtSizes[maxMtIndex]) { + maxMtIndex = i; + } + } + + return mts[maxMtIndex]; +} + +/** + * Validate texture mipmap tree. + * If individual images are stored in different mipmap trees + * use the mipmap tree that has the most of the correct data. + */ +int radeon_validate_texture_miptree(GLcontext * ctx, struct gl_texture_object *texObj) +{ + radeonContextPtr rmesa = RADEON_CONTEXT(ctx); + radeonTexObj *t = radeon_tex_obj(texObj); + + if (t->validated || t->image_override) { + return GL_TRUE; + } + + if (texObj->Image[0][texObj->BaseLevel]->Border > 0) + return GL_FALSE; + + /* TODO: is this really necessary? */ + _mesa_test_texobj_completeness(rmesa->glCtx, texObj); + assert(texObj->_Complete); + + calculate_min_max_lod(&t->base, &t->minLod, &t->maxLod); + + if (RADEON_DEBUG & RADEON_TEXTURE) + fprintf(stderr, "%s: Validating texture %p now, minLod = %d, maxLod = %d\n", + __FUNCTION__, texObj ,t->minLod, t->maxLod); + + radeon_mipmap_tree *dst_miptree; + dst_miptree = get_biggest_matching_miptree(t, t->minLod, t->maxLod); + + if (!dst_miptree) { + radeon_miptree_unreference(&t->mt); + radeon_try_alloc_miptree(rmesa, t); + dst_miptree = t->mt; + } + + const unsigned faces = texObj->Target == GL_TEXTURE_CUBE_MAP ? 6 : 1; + unsigned face, level; + radeon_texture_image *img; + /* Validate only the levels that will actually be used during rendering */ + for (face = 0; face < faces; ++face) { + for (level = t->minLod; level <= t->maxLod; ++level) { + img = get_radeon_texture_image(texObj->Image[face][level]); + + if (RADEON_DEBUG & RADEON_TEXTURE) { + fprintf(stderr, "Checking image level %d, face %d, mt %p ... ", level, face, img->mt); + } + + if (img->mt != dst_miptree) { + if (RADEON_DEBUG & RADEON_TEXTURE) { + fprintf(stderr, "MIGRATING\n"); + } + migrate_image_to_miptree(dst_miptree, img, face, radeon_gl_level_to_miptree_level(texObj, level)); + } else if (RADEON_DEBUG & RADEON_TEXTURE) { + fprintf(stderr, "OK\n"); + } + } + } + + t->validated = GL_TRUE; + + return GL_TRUE; +} + +uint32_t get_base_teximage_offset(radeonTexObj *texObj) +{ + if (!texObj->mt) { + return 0; + } else { + return radeon_miptree_image_offset(texObj->mt, 0, texObj->minLod); + } +} \ No newline at end of file diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h index 57299ceafa..28b8485095 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h @@ -59,44 +59,38 @@ struct _radeon_mipmap_level { * changed. */ struct _radeon_mipmap_tree { - radeonContextPtr radeon; - radeonTexObj *t; struct radeon_bo *bo; GLuint refcount; GLuint totalsize; /** total size of the miptree, in bytes */ GLenum target; /** GL_TEXTURE_xxx */ - GLenum internal_format; + GLenum mesaFormat; /** MESA_FORMAT_xxx */ GLuint faces; /** # of faces: 6 for cubemaps, 1 otherwise */ - GLuint firstLevel; /** First mip level stored in this mipmap tree */ - GLuint lastLevel; /** Last mip level stored in this mipmap tree */ + GLuint baseLevel; /** gl_texture_object->baseLevel it was created for */ + GLuint numLevels; /** Number of mip levels stored in this mipmap tree */ GLuint width0; /** Width of firstLevel image */ GLuint height0; /** Height of firstLevel image */ GLuint depth0; /** Depth of firstLevel image */ - GLuint bpp; /** Bytes per texel */ GLuint tilebits; /** RADEON_TXO_xxx_TILE */ - GLuint compressed; /** MESA_FORMAT_xxx indicating a compressed format, or 0 if uncompressed */ radeon_mipmap_level levels[RADEON_MIPTREE_MAX_TEXTURE_LEVELS]; }; -radeon_mipmap_tree* radeon_miptree_create(radeonContextPtr rmesa, radeonTexObj *t, - GLenum target, GLenum internal_format, GLuint firstLevel, GLuint lastLevel, - GLuint width0, GLuint height0, GLuint depth0, - GLuint bpp, GLuint tilebits, GLuint compressed); - void radeon_miptree_reference(radeon_mipmap_tree *mt, radeon_mipmap_tree **ptr); void radeon_miptree_unreference(radeon_mipmap_tree **ptr); GLboolean radeon_miptree_matches_image(radeon_mipmap_tree *mt, struct gl_texture_image *texImage, GLuint face, GLuint level); -GLboolean radeon_miptree_matches_texture(radeon_mipmap_tree *mt, struct gl_texture_object *texObj); -void radeon_try_alloc_miptree(radeonContextPtr rmesa, radeonTexObj *t, - radeon_texture_image *texImage, GLuint face, GLuint level); +void radeon_try_alloc_miptree(radeonContextPtr rmesa, radeonTexObj *t); GLuint radeon_miptree_image_offset(radeon_mipmap_tree *mt, GLuint face, GLuint level); void radeon_miptree_depth_offsets(radeon_mipmap_tree *mt, GLuint level, GLuint *offsets); + +unsigned radeon_miptree_level_to_gl_level(struct gl_texture_object *tObj, unsigned level); +unsigned radeon_gl_level_to_miptree_level(struct gl_texture_object *tObj, unsigned level); + +uint32_t get_base_teximage_offset(radeonTexObj *texObj); #endif /* __RADEON_MIPMAP_TREE_H_ */ diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index c093d1283d..6f11f1fa4a 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -1,4 +1,5 @@ /* + * Copyright (C) 2009 Maciej Cencora. * Copyright (C) 2008 Nicolai Haehnle. * Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. * @@ -46,7 +47,7 @@ #include "radeon_mipmap_tree.h" -static void copy_rows(void* dst, GLuint dststride, const void* src, GLuint srcstride, +void copy_rows(void* dst, GLuint dststride, const void* src, GLuint srcstride, GLuint numrows, GLuint rowsize) { assert(rowsize <= dststride); @@ -107,7 +108,7 @@ static void teximage_set_map_data(radeon_texture_image *image) lvl = &image->mt->levels[image->mtlevel]; image->base.Data = image->mt->bo->ptr + lvl->faces[image->mtface].offset; - image->base.RowStride = lvl->rowstride / image->mt->bpp; + image->base.RowStride = lvl->rowstride / _mesa_get_format_bytes(image->base.TexFormat); } @@ -173,7 +174,7 @@ void radeonMapTexture(GLcontext *ctx, struct gl_texture_object *texObj) radeon_bo_map(t->mt->bo, GL_FALSE); for(face = 0; face < t->mt->faces; ++face) { - for(level = t->mt->firstLevel; level <= t->mt->lastLevel; ++level) + for(level = t->minLod; level <= t->maxLod; ++level) teximage_set_map_data(get_radeon_texture_image(texObj->Image[face][level])); } } @@ -190,7 +191,7 @@ void radeonUnmapTexture(GLcontext *ctx, struct gl_texture_object *texObj) return; for(face = 0; face < t->mt->faces; ++face) { - for(level = t->mt->firstLevel; level <= t->mt->lastLevel; ++level) + for(level = t->minLod; level <= t->maxLod; ++level) texObj->Image[face][level]->Data = 0; } radeon_bo_unmap(t->mt->bo); @@ -508,6 +509,31 @@ gl_format radeonChooseTextureFormat(GLcontext * ctx, return MESA_FORMAT_NONE; /* never get here */ } +static void teximage_assign_miptree(radeonContextPtr rmesa, + struct gl_texture_object *texObj, + struct gl_texture_image *texImage, + unsigned face, + unsigned level) +{ + radeonTexObj *t = radeon_tex_obj(texObj); + radeon_texture_image* image = get_radeon_texture_image(texImage); + + /* Try using current miptree, or create new if there isn't any */ + if (!t->mt || !radeon_miptree_matches_image(t->mt, texImage, face, + radeon_gl_level_to_miptree_level(texObj, level))) { + radeon_miptree_unreference(&t->mt); + radeon_try_alloc_miptree(rmesa, t); + } + + /* Miptree alocation may have failed, + * when there was no image for baselevel specified */ + if (t->mt) { + image->mtface = face; + image->mtlevel = radeon_gl_level_to_miptree_level(texObj, level); + radeon_miptree_reference(t->mt, &image->mt); + } +} + static GLuint * allocate_image_offsets(GLcontext *ctx, unsigned alignedWidth, unsigned height, @@ -543,16 +569,20 @@ static void radeon_store_teximage(GLcontext* ctx, int dims, struct gl_texture_image *texImage, int compressed) { + radeonTexObj *t = radeon_tex_obj(texObj); radeon_texture_image* image = get_radeon_texture_image(texImage); - GLint dstRowStride; + GLuint dstRowStride; GLuint *dstImageOffsets; if (image->mt) { - radeon_mipmap_level *lvl = &image->mt->levels[image->mtlevel]; - dstRowStride = lvl->rowstride; + dstRowStride = image->mt->levels[image->mtlevel].rowstride; + } else if (t->bo) { + /* TFP case */ + /* TODO */ + assert(0); } else { - dstRowStride = texImage->RowStride * _mesa_get_format_bytes(texImage->TexFormat); + dstRowStride = _mesa_format_row_stride(texImage->TexFormat, width); } if (dims == 3) { @@ -577,8 +607,10 @@ static void radeon_store_teximage(GLcontext* ctx, int dims, texImage->Width, texImage->Data); } else { - uint32_t blocks_x = dstRowStride / (image->mt->bpp * 4); - img_start = texImage->Data + image->mt->bpp * 4 * (blocks_x * (yoffset / 4) + xoffset / 4); + uint32_t blocks_x, block_width, block_height; + _mesa_get_format_block_size(image->mt->mesaFormat, &block_width, &block_height); + blocks_x = dstRowStride / block_width; + img_start = texImage->Data + _mesa_get_format_bytes(image->mt->mesaFormat) * 4 * (blocks_x * (yoffset / 4) + xoffset / 4); } srcRowStride = _mesa_format_row_stride(texImage->TexFormat, width); bytesPerRow = srcRowStride; @@ -624,10 +656,8 @@ static void radeon_teximage( radeonContextPtr rmesa = RADEON_CONTEXT(ctx); radeonTexObj* t = radeon_tex_obj(texObj); radeon_texture_image* image = get_radeon_texture_image(texImage); - GLuint dstRowStride; GLint postConvWidth = width; GLint postConvHeight = height; - GLuint texelBytes; GLuint face = radeon_face_for_target(target); { @@ -645,51 +675,30 @@ static void radeon_teximage( &postConvHeight); } - if (_mesa_is_format_compressed(texImage->TexFormat)) { - texelBytes = 0; - } else { - texelBytes = _mesa_get_format_bytes(texImage->TexFormat); + if (!_mesa_is_format_compressed(texImage->TexFormat)) { + GLuint texelBytes = _mesa_get_format_bytes(texImage->TexFormat); /* Minimum pitch of 32 bytes */ if (postConvWidth * texelBytes < 32) { - postConvWidth = 32 / texelBytes; - texImage->RowStride = postConvWidth; + postConvWidth = 32 / texelBytes; + texImage->RowStride = postConvWidth; } - if (!image->mt) { + if (!image->mt) { assert(texImage->RowStride == postConvWidth); } } - /* Allocate memory for image */ - radeonFreeTexImageData(ctx, texImage); /* Mesa core only clears texImage->Data but not image->mt */ + /* Mesa core only clears texImage->Data but not image->mt */ + radeonFreeTexImageData(ctx, texImage); - if (t->mt && - t->mt->firstLevel == level && - t->mt->lastLevel == level && - t->mt->target != GL_TEXTURE_CUBE_MAP_ARB && - !radeon_miptree_matches_image(t->mt, texImage, face, level)) { - radeon_miptree_unreference(&t->mt); - } - - if (!t->mt) - radeon_try_alloc_miptree(rmesa, t, image, face, level); - if (t->mt && radeon_miptree_matches_image(t->mt, texImage, face, level)) { - radeon_mipmap_level *lvl; - image->mtlevel = level - t->mt->firstLevel; - image->mtface = face; - radeon_miptree_reference(t->mt, &image->mt); - lvl = &image->mt->levels[image->mtlevel]; - dstRowStride = lvl->rowstride; - } else { - int size; - if (_mesa_is_format_compressed(texImage->TexFormat)) { - size = _mesa_format_image_size(texImage->TexFormat, - texImage->Width, - texImage->Height, - texImage->Depth); - } else { - size = texImage->Width * texImage->Height * texImage->Depth * _mesa_get_format_bytes(texImage->TexFormat); + if (!t->bo) { + teximage_assign_miptree(rmesa, texObj, texImage, face, level); + if (!t->mt) { + int size = _mesa_format_image_size(texImage->TexFormat, + texImage->Width, + texImage->Height, + texImage->Depth); + texImage->Data = _mesa_alloc_texmemory(size); } - texImage->Data = _mesa_alloc_texmemory(size); } /* Upload texture image; note that the spec allows pixels to be NULL */ @@ -793,10 +802,10 @@ static void radeon_texsubimage(GLcontext* ctx, int dims, GLenum target, int leve t->validated = GL_FALSE; if (compressed) { pixels = _mesa_validate_pbo_compressed_teximage( - ctx, imageSize, pixels, packing, "glCompressedTexImage"); + ctx, imageSize, pixels, packing, "glCompressedTexSubImage"); } else { pixels = _mesa_validate_pbo_teximage(ctx, dims, - width, height, depth, format, type, pixels, packing, "glTexSubImage1D"); + width, height, depth, format, type, pixels, packing, "glTexSubImage"); } if (pixels) { @@ -865,140 +874,6 @@ void radeonTexSubImage3D(GLcontext * ctx, GLenum target, GLint level, format, type, pixels, packing, texObj, texImage, 0); } - - -/** - * Ensure that the given image is stored in the given miptree from now on. - */ -static void migrate_image_to_miptree(radeon_mipmap_tree *mt, radeon_texture_image *image, int face, int level) -{ - radeon_mipmap_level *dstlvl = &mt->levels[level - mt->firstLevel]; - unsigned char *dest; - - assert(image->mt != mt); - assert(dstlvl->width == image->base.Width); - assert(dstlvl->height == image->base.Height); - assert(dstlvl->depth == image->base.Depth); - - - radeon_bo_map(mt->bo, GL_TRUE); - dest = mt->bo->ptr + dstlvl->faces[face].offset; - - if (image->mt) { - /* Format etc. should match, so we really just need a memcpy(). - * In fact, that memcpy() could be done by the hardware in many - * cases, provided that we have a proper memory manager. - */ - radeon_mipmap_level *srclvl = &image->mt->levels[image->mtlevel-image->mt->firstLevel]; - - assert(srclvl->size == dstlvl->size); - assert(srclvl->rowstride == dstlvl->rowstride); - - radeon_bo_map(image->mt->bo, GL_FALSE); - - memcpy(dest, - image->mt->bo->ptr + srclvl->faces[face].offset, - dstlvl->size); - radeon_bo_unmap(image->mt->bo); - - radeon_miptree_unreference(&image->mt); - } else { - uint32_t srcrowstride; - uint32_t height; - /* need to confirm this value is correct */ - if (mt->compressed) { - height = (image->base.Height + 3) / 4; - srcrowstride = _mesa_format_row_stride(image->base.TexFormat, image->base.Width); - } else { - height = image->base.Height * image->base.Depth; - srcrowstride = image->base.Width * _mesa_get_format_bytes(image->base.TexFormat); - } - -// if (mt->tilebits) -// WARN_ONCE("%s: tiling not supported yet", __FUNCTION__); - - copy_rows(dest, dstlvl->rowstride, image->base.Data, srcrowstride, - height, srcrowstride); - - _mesa_free_texmemory(image->base.Data); - image->base.Data = 0; - } - - radeon_bo_unmap(mt->bo); - - image->mtface = face; - image->mtlevel = level; - radeon_miptree_reference(mt, &image->mt); -} - -int radeon_validate_texture_miptree(GLcontext * ctx, struct gl_texture_object *texObj) -{ - radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - radeonTexObj *t = radeon_tex_obj(texObj); - radeon_texture_image *baseimage = get_radeon_texture_image(texObj->Image[0][texObj->BaseLevel]); - int face, level; - - if (t->validated || t->image_override) - return GL_TRUE; - - if (RADEON_DEBUG & RADEON_TEXTURE) - fprintf(stderr, "%s: Validating texture %p now\n", __FUNCTION__, texObj); - - if (baseimage->base.Border > 0) - return GL_FALSE; - - /* Ensure a matching miptree exists. - * - * Differing mipmap trees can result when the app uses TexImage to - * change texture dimensions. - * - * Prefer to use base image's miptree if it - * exists, since that most likely contains more valid data (remember - * that the base level is usually significantly larger than the rest - * of the miptree, so cubemaps are the only possible exception). - */ - if (baseimage->mt && - baseimage->mt != t->mt && - radeon_miptree_matches_texture(baseimage->mt, &t->base)) { - radeon_miptree_unreference(&t->mt); - radeon_miptree_reference(baseimage->mt, &t->mt); - } else if (t->mt && !radeon_miptree_matches_texture(t->mt, &t->base)) { - radeon_miptree_unreference(&t->mt); - } - - if (!t->mt) { - if (RADEON_DEBUG & RADEON_TEXTURE) - fprintf(stderr, " Allocate new miptree\n"); - radeon_try_alloc_miptree(rmesa, t, baseimage, 0, texObj->BaseLevel); - if (!t->mt) { - _mesa_problem(ctx, "radeon_validate_texture failed to alloc miptree"); - return GL_FALSE; - } - } - - /* Ensure all images are stored in the single main miptree */ - for(face = 0; face < t->mt->faces; ++face) { - for(level = t->mt->firstLevel; level <= t->mt->lastLevel; ++level) { - radeon_texture_image *image = get_radeon_texture_image(texObj->Image[face][level]); - if (RADEON_DEBUG & RADEON_TEXTURE) - fprintf(stderr, " face %i, level %i... %p vs %p ", face, level, t->mt, image->mt); - if (t->mt == image->mt || (!image->mt && !image->base.Data)) { - if (RADEON_DEBUG & RADEON_TEXTURE) - fprintf(stderr, "OK\n"); - - continue; - } - - if (RADEON_DEBUG & RADEON_TEXTURE) - fprintf(stderr, "migrating\n"); - migrate_image_to_miptree(t->mt, image, face, level); - } - } - - return GL_TRUE; -} - - /** * Need to map texture image into memory before copying image data, * then unmap it. diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.h b/src/mesa/drivers/dri/radeon/radeon_texture.h index 8995546d77..906daf12d0 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.h +++ b/src/mesa/drivers/dri/radeon/radeon_texture.h @@ -33,7 +33,8 @@ #include "main/formats.h" - +void copy_rows(void* dst, GLuint dststride, const void* src, GLuint srcstride, + GLuint numrows, GLuint rowsize); struct gl_texture_image *radeonNewTextureImage(GLcontext *ctx); void radeonFreeTexImageData(GLcontext *ctx, struct gl_texture_image *timage); -- cgit v1.2.3 From ad83aeccdc54beecf25f217e2dd24c8edf6d6767 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 14 Nov 2009 18:11:16 +0100 Subject: radeon: return false on texture validation if texture isn't complete --- src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c index f01136b9d4..0497fa7db5 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c @@ -34,7 +34,6 @@ #include "main/simple_list.h" #include "main/texcompress.h" #include "main/teximage.h" -/* TODO: remove if texture completeness check is removed */ #include "main/texobj.h" #include "radeon_texture.h" @@ -547,9 +546,10 @@ int radeon_validate_texture_miptree(GLcontext * ctx, struct gl_texture_object *t if (texObj->Image[0][texObj->BaseLevel]->Border > 0) return GL_FALSE; - /* TODO: is this really necessary? */ _mesa_test_texobj_completeness(rmesa->glCtx, texObj); - assert(texObj->_Complete); + if (!texObj->_Complete) { + return GL_FALSE; + } calculate_min_max_lod(&t->base, &t->minLod, &t->maxLod); -- cgit v1.2.3 From b44b70dc114ddcfb4d359759928df4d7b9efaafb Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Sat, 14 Nov 2009 19:46:45 -0800 Subject: mesa/st: don't calculate unused vs input semantic tags --- src/mesa/state_tracker/st_program.c | 71 ++----------------------------------- 1 file changed, 2 insertions(+), 69 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index a9be80ce8f..b6c9e7463a 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -69,8 +69,6 @@ st_translate_vertex_program(struct st_context *st, GLuint attr, i; GLuint num_generic = 0; - ubyte vs_input_semantic_name[PIPE_MAX_SHADER_INPUTS]; - ubyte vs_input_semantic_index[PIPE_MAX_SHADER_INPUTS]; uint vs_num_inputs = 0; ubyte vs_output_semantic_name[PIPE_MAX_SHADER_OUTPUTS]; @@ -100,71 +98,6 @@ st_translate_vertex_program(struct st_context *st, stvp->input_to_index[attr] = slot; stvp->index_to_input[slot] = attr; - switch (attr) { - case VERT_ATTRIB_POS: - vs_input_semantic_name[slot] = TGSI_SEMANTIC_POSITION; - vs_input_semantic_index[slot] = 0; - break; - case VERT_ATTRIB_WEIGHT: - /* fall-through */ - case VERT_ATTRIB_NORMAL: - /* just label as a generic */ - vs_input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC; - vs_input_semantic_index[slot] = 0; - break; - case VERT_ATTRIB_COLOR0: - vs_input_semantic_name[slot] = TGSI_SEMANTIC_COLOR; - vs_input_semantic_index[slot] = 0; - break; - case VERT_ATTRIB_COLOR1: - vs_input_semantic_name[slot] = TGSI_SEMANTIC_COLOR; - vs_input_semantic_index[slot] = 1; - break; - case VERT_ATTRIB_FOG: - vs_input_semantic_name[slot] = TGSI_SEMANTIC_FOG; - vs_input_semantic_index[slot] = 0; - break; - case VERT_ATTRIB_POINT_SIZE: - vs_input_semantic_name[slot] = TGSI_SEMANTIC_PSIZE; - vs_input_semantic_index[slot] = 0; - break; - case VERT_ATTRIB_TEX0: - case VERT_ATTRIB_TEX1: - case VERT_ATTRIB_TEX2: - case VERT_ATTRIB_TEX3: - case VERT_ATTRIB_TEX4: - case VERT_ATTRIB_TEX5: - case VERT_ATTRIB_TEX6: - case VERT_ATTRIB_TEX7: - assert(slot < Elements(vs_input_semantic_name)); - vs_input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC; - vs_input_semantic_index[slot] = num_generic++; - break; - case VERT_ATTRIB_GENERIC0: - case VERT_ATTRIB_GENERIC1: - case VERT_ATTRIB_GENERIC2: - case VERT_ATTRIB_GENERIC3: - case VERT_ATTRIB_GENERIC4: - case VERT_ATTRIB_GENERIC5: - case VERT_ATTRIB_GENERIC6: - case VERT_ATTRIB_GENERIC7: - case VERT_ATTRIB_GENERIC8: - case VERT_ATTRIB_GENERIC9: - case VERT_ATTRIB_GENERIC10: - case VERT_ATTRIB_GENERIC11: - case VERT_ATTRIB_GENERIC12: - case VERT_ATTRIB_GENERIC13: - case VERT_ATTRIB_GENERIC14: - case VERT_ATTRIB_GENERIC15: - assert(attr < VERT_ATTRIB_MAX); - assert(slot < Elements(vs_input_semantic_name)); - vs_input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC; - vs_input_semantic_index[slot] = num_generic++; - break; - default: - assert(0); - } - input_flags[slot] = stvp->Base.Base.InputFlags[attr]; } } @@ -330,8 +263,8 @@ st_translate_vertex_program(struct st_context *st, /* inputs */ vs_num_inputs, stvp->input_to_index, - vs_input_semantic_name, - vs_input_semantic_index, + NULL, /* input semantic name */ + NULL, /* input semantic index */ NULL, input_flags, /* outputs */ -- cgit v1.2.3 From 0ffdd1c1e897c448cbc359aea3e3a3ba098bbfe5 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Sat, 14 Nov 2009 19:48:42 -0800 Subject: mesa/st: don't calculate unused input_flags data --- src/mesa/state_tracker/st_mesa_to_tgsi.c | 1 - src/mesa/state_tracker/st_mesa_to_tgsi.h | 1 - src/mesa/state_tracker/st_program.c | 16 ++-------------- 3 files changed, 2 insertions(+), 16 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c index 3d6c215819..81f02d01e9 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -704,7 +704,6 @@ st_translate_mesa_program( const ubyte inputSemanticName[], const ubyte inputSemanticIndex[], const GLuint interpMode[], - const GLbitfield inputFlags[], GLuint numOutputs, const GLuint outputMapping[], const ubyte outputSemanticName[], diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.h b/src/mesa/state_tracker/st_mesa_to_tgsi.h index c0d1ff59e1..384831762d 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.h +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.h @@ -49,7 +49,6 @@ st_translate_mesa_program( const ubyte inputSemanticName[], const ubyte inputSemanticIndex[], const GLuint interpMode[], - const GLbitfield inputFlags[], GLuint numOutputs, const GLuint outputMapping[], const ubyte outputSemanticName[], diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index b6c9e7463a..fd1b213eb8 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -75,11 +75,9 @@ st_translate_vertex_program(struct st_context *st, ubyte vs_output_semantic_index[PIPE_MAX_SHADER_OUTPUTS]; uint vs_num_outputs = 0; - GLbitfield input_flags[MAX_PROGRAM_INPUTS]; GLbitfield output_flags[MAX_PROGRAM_OUTPUTS]; // memset(&vs, 0, sizeof(vs)); - memset(input_flags, 0, sizeof(input_flags)); memset(output_flags, 0, sizeof(output_flags)); if (stvp->Base.IsPositionInvariant) @@ -91,14 +89,10 @@ st_translate_vertex_program(struct st_context *st, */ for (attr = 0; attr < VERT_ATTRIB_MAX; attr++) { if (stvp->Base.Base.InputsRead & (1 << attr)) { - const GLuint slot = vs_num_inputs; + stvp->input_to_index[attr] = vs_num_inputs; + stvp->index_to_input[vs_num_inputs] = attr; vs_num_inputs++; - - stvp->input_to_index[attr] = slot; - stvp->index_to_input[slot] = attr; - - input_flags[slot] = stvp->Base.Base.InputFlags[attr]; } } @@ -266,7 +260,6 @@ st_translate_vertex_program(struct st_context *st, NULL, /* input semantic name */ NULL, /* input semantic index */ NULL, - input_flags, /* outputs */ vs_num_outputs, outputMapping, @@ -316,11 +309,9 @@ st_translate_fragment_program(struct st_context *st, ubyte fs_output_semantic_index[PIPE_MAX_SHADER_OUTPUTS]; uint fs_num_outputs = 0; - GLbitfield input_flags[MAX_PROGRAM_INPUTS]; GLbitfield output_flags[MAX_PROGRAM_OUTPUTS]; // memset(&fs, 0, sizeof(fs)); - memset(input_flags, 0, sizeof(input_flags)); memset(output_flags, 0, sizeof(output_flags)); /* which vertex output goes to the first fragment input: */ @@ -392,8 +383,6 @@ st_translate_fragment_program(struct st_context *st, stfp->input_semantic_index[slot] = num_generic++; interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE; } - - input_flags[slot] = stfp->Base.Base.InputFlags[attr]; } } @@ -451,7 +440,6 @@ st_translate_fragment_program(struct st_context *st, stfp->input_semantic_name, stfp->input_semantic_index, interpMode, - input_flags, /* outputs */ fs_num_outputs, outputMapping, -- cgit v1.2.3 From 9953fe4cb48b02a0d75735b88173f0ed170a77f2 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Sat, 14 Nov 2009 19:50:45 -0800 Subject: mesa/st: don't calculate unused output_flags data either --- src/mesa/state_tracker/st_mesa_to_tgsi.c | 3 +-- src/mesa/state_tracker/st_mesa_to_tgsi.h | 3 +-- src/mesa/state_tracker/st_program.c | 22 ++-------------------- 3 files changed, 4 insertions(+), 24 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c index 81f02d01e9..d84832f539 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -707,8 +707,7 @@ st_translate_mesa_program( GLuint numOutputs, const GLuint outputMapping[], const ubyte outputSemanticName[], - const ubyte outputSemanticIndex[], - const GLbitfield outputFlags[] ) + const ubyte outputSemanticIndex[] ) { struct st_translate translate, *t; struct ureg_program *ureg; diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.h b/src/mesa/state_tracker/st_mesa_to_tgsi.h index 384831762d..dc0362fe79 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.h +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.h @@ -52,8 +52,7 @@ st_translate_mesa_program( GLuint numOutputs, const GLuint outputMapping[], const ubyte outputSemanticName[], - const ubyte outputSemanticIndex[], - const GLbitfield outputFlags[] ); + const ubyte outputSemanticIndex[] ); void st_free_tokens(const struct tgsi_token *tokens); diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index fd1b213eb8..5450b59a2d 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -75,11 +75,6 @@ st_translate_vertex_program(struct st_context *st, ubyte vs_output_semantic_index[PIPE_MAX_SHADER_OUTPUTS]; uint vs_num_outputs = 0; - GLbitfield output_flags[MAX_PROGRAM_OUTPUTS]; - -// memset(&vs, 0, sizeof(vs)); - memset(output_flags, 0, sizeof(output_flags)); - if (stvp->Base.IsPositionInvariant) _mesa_insert_mvp_code(st->ctx, &stvp->Base); @@ -115,7 +110,6 @@ st_translate_vertex_program(struct st_context *st, assert(i < Elements(vs_output_semantic_name)); vs_output_semantic_name[i] = TGSI_SEMANTIC_GENERIC; vs_output_semantic_index[i] = 0; - output_flags[i] = 0x0; } num_generic = 0; @@ -201,9 +195,6 @@ st_translate_vertex_program(struct st_context *st, vs_output_semantic_index[slot] = num_generic++; } } - - assert(slot < Elements(output_flags)); - output_flags[slot] = stvp->Base.Base.OutputFlags[attr]; } } @@ -264,8 +255,7 @@ st_translate_vertex_program(struct st_context *st, vs_num_outputs, outputMapping, vs_output_semantic_name, - vs_output_semantic_index, - output_flags ); + vs_output_semantic_index ); stvp->num_inputs = vs_num_inputs; stvp->driver_shader = pipe->create_vs_state(pipe, &stvp->state); @@ -309,11 +299,6 @@ st_translate_fragment_program(struct st_context *st, ubyte fs_output_semantic_index[PIPE_MAX_SHADER_OUTPUTS]; uint fs_num_outputs = 0; - GLbitfield output_flags[MAX_PROGRAM_OUTPUTS]; - -// memset(&fs, 0, sizeof(fs)); - memset(output_flags, 0, sizeof(output_flags)); - /* which vertex output goes to the first fragment input: */ if (inputsRead & FRAG_BIT_WPOS) vslot = 0; @@ -420,8 +405,6 @@ st_translate_fragment_program(struct st_context *st, break; } - output_flags[fs_num_outputs] = stfp->Base.Base.OutputFlags[attr]; - fs_num_outputs++; } } @@ -444,8 +427,7 @@ st_translate_fragment_program(struct st_context *st, fs_num_outputs, outputMapping, fs_output_semantic_name, - fs_output_semantic_index, - output_flags ); + fs_output_semantic_index ); stfp->driver_shader = pipe->create_fs_state(pipe, &stfp->state); -- cgit v1.2.3 From 1454f20a991ddda35f1a2ffda953012078b407ba Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Sun, 15 Nov 2009 10:26:35 -0800 Subject: mesa/st: emit tgsi vertex shader directly for drawpixels One of several cases where we build mesa shaders and then translate them to tgsi. Many of those cases it's because we're combining two mesa programs and there are helpers for that, but in this case at least can go straight to tgsi. --- src/mesa/state_tracker/st_cb_drawpixels.c | 124 +++++++++++------------------- 1 file changed, 47 insertions(+), 77 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 1d33e81c2c..13e454b7a7 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -60,6 +60,7 @@ #include "pipe/p_context.h" #include "pipe/p_defines.h" #include "pipe/p_inlines.h" +#include "tgsi/tgsi_ureg.h" #include "util/u_tile.h" #include "util/u_draw_quad.h" #include "util/u_math.h" @@ -236,78 +237,41 @@ make_fragment_shader_z(struct st_context *st) * Create a simple vertex shader that just passes through the * vertex position and texcoord (and optionally, color). */ -static struct st_vertex_program * -st_make_passthrough_vertex_shader(struct st_context *st, GLboolean passColor) +static void * +st_make_passthrough_vertex_shader(struct st_context *st, + GLboolean passColor) { - GLcontext *ctx = st->ctx; - struct st_vertex_program *stvp; - struct gl_program *p; - GLuint ic = 0; - - if (st->drawpix.vert_shaders[passColor]) - return st->drawpix.vert_shaders[passColor]; - - /* - * Create shader now - */ - p = ctx->Driver.NewProgram(ctx, GL_VERTEX_PROGRAM_ARB, 0); - if (!p) - return NULL; - - if (passColor) - p->NumInstructions = 4; - else - p->NumInstructions = 3; - - p->Instructions = _mesa_alloc_instructions(p->NumInstructions); - if (!p->Instructions) { - ctx->Driver.DeleteProgram(ctx, p); - return NULL; - } - _mesa_init_instructions(p->Instructions, p->NumInstructions); - /* MOV result.pos, vertex.pos; */ - p->Instructions[0].Opcode = OPCODE_MOV; - p->Instructions[0].DstReg.File = PROGRAM_OUTPUT; - p->Instructions[0].DstReg.Index = VERT_RESULT_HPOS; - p->Instructions[0].SrcReg[0].File = PROGRAM_INPUT; - p->Instructions[0].SrcReg[0].Index = VERT_ATTRIB_POS; - /* MOV result.texcoord0, vertex.texcoord0; */ - p->Instructions[1].Opcode = OPCODE_MOV; - p->Instructions[1].DstReg.File = PROGRAM_OUTPUT; - p->Instructions[1].DstReg.Index = VERT_RESULT_TEX0; - p->Instructions[1].SrcReg[0].File = PROGRAM_INPUT; - p->Instructions[1].SrcReg[0].Index = VERT_ATTRIB_TEX0; - ic = 2; - if (passColor) { - /* MOV result.color0, vertex.color0; */ - p->Instructions[ic].Opcode = OPCODE_MOV; - p->Instructions[ic].DstReg.File = PROGRAM_OUTPUT; - p->Instructions[ic].DstReg.Index = VERT_RESULT_COL0; - p->Instructions[ic].SrcReg[0].File = PROGRAM_INPUT; - p->Instructions[ic].SrcReg[0].Index = VERT_ATTRIB_COLOR0; - ic++; - } - - /* END; */ - p->Instructions[ic].Opcode = OPCODE_END; - ic++; - - assert(ic == p->NumInstructions); + if (!st->drawpix.vert_shaders[passColor]) { + struct ureg_program *ureg = + ureg_create( TGSI_PROCESSOR_VERTEX ); + + if (ureg == NULL) + return NULL; + + /* MOV result.pos, vertex.pos; */ + ureg_MOV(ureg, + ureg_DECL_output( ureg, TGSI_SEMANTIC_POSITION, 0 ), + ureg_DECL_vs_input( ureg, 0 )); + + /* MOV result.texcoord0, vertex.texcoord0; */ + ureg_MOV(ureg, + ureg_DECL_output( ureg, TGSI_SEMANTIC_GENERIC, 0 ), + ureg_DECL_vs_input( ureg, 1 )); + + if (passColor) { + /* MOV result.color0, vertex.color0; */ + ureg_MOV(ureg, + ureg_DECL_output( ureg, TGSI_SEMANTIC_COLOR, 0 ), + ureg_DECL_vs_input( ureg, 2 )); + } - p->InputsRead = VERT_BIT_POS | VERT_BIT_TEX0; - p->OutputsWritten = ((1 << VERT_RESULT_TEX0) | - (1 << VERT_RESULT_HPOS)); - if (passColor) { - p->InputsRead |= VERT_BIT_COLOR0; - p->OutputsWritten |= (1 << VERT_RESULT_COL0); + ureg_END( ureg ); + + st->drawpix.vert_shaders[passColor] = + ureg_create_shader_and_destroy( ureg, st->pipe ); } - stvp = (struct st_vertex_program *) p; - st_translate_vertex_program(st, stvp, NULL, NULL, NULL); - - st->drawpix.vert_shaders[passColor] = stvp; - - return stvp; + return st->drawpix.vert_shaders[passColor]; } @@ -539,8 +503,8 @@ draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z, GLsizei width, GLsizei height, GLfloat zoomX, GLfloat zoomY, struct pipe_texture *pt, - struct st_vertex_program *stvp, - struct st_fragment_program *stfp, + void *driver_vp, + void *driver_fp, const GLfloat *color, GLboolean invertTex) { @@ -575,10 +539,10 @@ draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z, } /* fragment shader state: TEX lookup program */ - cso_set_fragment_shader_handle(cso, stfp->driver_shader); + cso_set_fragment_shader_handle(cso, driver_fp); /* vertex shader state: position + texcoord pass-through */ - cso_set_vertex_shader_handle(cso, stvp->driver_shader); + cso_set_vertex_shader_handle(cso, driver_vp); /* texture sampling state: */ @@ -806,7 +770,7 @@ st_DrawPixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels) { struct st_fragment_program *stfp; - struct st_vertex_program *stvp; + void *driver_vp; struct st_context *st = st_context(ctx); struct pipe_surface *ps; const GLfloat *color; @@ -826,13 +790,13 @@ st_DrawPixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, if (format == GL_DEPTH_COMPONENT) { ps = st->state.framebuffer.zsbuf; stfp = make_fragment_shader_z(st); - stvp = st_make_passthrough_vertex_shader(st, GL_TRUE); + driver_vp = st_make_passthrough_vertex_shader(st, GL_TRUE); color = ctx->Current.RasterColor; } else { ps = st->state.framebuffer.cbufs[0]; stfp = combined_drawpix_fragment_program(ctx); - stvp = st_make_passthrough_vertex_shader(st, GL_FALSE); + driver_vp = st_make_passthrough_vertex_shader(st, GL_FALSE); color = NULL; } @@ -843,7 +807,10 @@ st_DrawPixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, if (pt) { draw_textured_quad(ctx, x, y, ctx->Current.RasterPos[2], width, height, ctx->Pixel.ZoomX, ctx->Pixel.ZoomY, - pt, stvp, stfp, color, GL_FALSE); + pt, + driver_vp, + stfp->driver_shader, + color, GL_FALSE); pipe_texture_reference(&pt, NULL); } } @@ -1148,7 +1115,10 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, /* draw textured quad */ draw_textured_quad(ctx, dstx, dsty, ctx->Current.RasterPos[2], width, height, ctx->Pixel.ZoomX, ctx->Pixel.ZoomY, - pt, stvp, stfp, color, GL_TRUE); + pt, + stvp->driver_shader, + stfp->driver_shader, + color, GL_TRUE); pipe_texture_reference(&pt, NULL); } -- cgit v1.2.3 From 07fafc7c9346aa260829603bf3188596481e9e62 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Sun, 15 Nov 2009 11:15:25 -0800 Subject: mesa/st: refactor vertex and fragment shader translation Translate vertex shaders independently of fragment shaders. Previously tried to make fragment shader semantic indexes always start at zero and exclude holes. This was unnecessary but meant that vertex shader translation had to be adjusted to take this into account. Now use a fixed scheme for labelling special FS input semantics (color, etc), and another fixed scheme for the generics. With this, vertex shaders can be translated independently of the bound fragment shader, assuming mesa has done its own job and ensured that the vertex shader provides at least the inputs the fragment shader is looking for. The state-tracker didn't attempt to do anything about this previously, so it shouldn't be needed now. --- src/mesa/state_tracker/st_atom.c | 3 +- src/mesa/state_tracker/st_atom.h | 3 +- src/mesa/state_tracker/st_atom_shader.c | 326 ++++++++---------------------- src/mesa/state_tracker/st_cb_bitmap.c | 5 - src/mesa/state_tracker/st_cb_drawpixels.c | 8 +- src/mesa/state_tracker/st_cb_program.c | 43 +--- src/mesa/state_tracker/st_context.h | 2 + src/mesa/state_tracker/st_debug.c | 3 +- src/mesa/state_tracker/st_draw.c | 2 +- src/mesa/state_tracker/st_draw_feedback.c | 8 +- src/mesa/state_tracker/st_program.c | 267 +++++++++++------------- src/mesa/state_tracker/st_program.h | 75 +++++-- 12 files changed, 276 insertions(+), 469 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_atom.c b/src/mesa/state_tracker/st_atom.c index ca15ce1b47..dfce955fd9 100644 --- a/src/mesa/state_tracker/st_atom.c +++ b/src/mesa/state_tracker/st_atom.c @@ -46,7 +46,8 @@ static const struct st_tracked_state *atoms[] = &st_update_clip, &st_finalize_textures, - &st_update_shader, + &st_update_fp, + &st_update_vp, &st_update_rasterizer, &st_update_polygon_stipple, diff --git a/src/mesa/state_tracker/st_atom.h b/src/mesa/state_tracker/st_atom.h index c7cffd85c8..f34b49203b 100644 --- a/src/mesa/state_tracker/st_atom.h +++ b/src/mesa/state_tracker/st_atom.h @@ -47,7 +47,8 @@ void st_validate_state( struct st_context *st ); extern const struct st_tracked_state st_update_framebuffer; extern const struct st_tracked_state st_update_clip; extern const struct st_tracked_state st_update_depth_stencil_alpha; -extern const struct st_tracked_state st_update_shader; +extern const struct st_tracked_state st_update_fp; +extern const struct st_tracked_state st_update_vp; extern const struct st_tracked_state st_update_rasterizer; extern const struct st_tracked_state st_update_polygon_stipple; extern const struct st_tracked_state st_update_viewport; diff --git a/src/mesa/state_tracker/st_atom_shader.c b/src/mesa/state_tracker/st_atom_shader.c index ee649be885..09baff875b 100644 --- a/src/mesa/state_tracker/st_atom_shader.c +++ b/src/mesa/state_tracker/st_atom_shader.c @@ -56,82 +56,18 @@ #include "st_mesa_to_tgsi.h" -/** - * This represents a vertex program, especially translated to match - * the inputs of a particular fragment shader. - */ -struct translated_vertex_program -{ - struct st_vertex_program *master; - - /** The fragment shader "signature" this vertex shader is meant for: */ - GLbitfield frag_inputs; - /** Compared against master vertex program's serialNo: */ - GLuint serialNo; - /** Maps VERT_RESULT_x to slot */ - GLuint output_to_slot[VERT_RESULT_MAX]; - ubyte output_to_semantic_name[VERT_RESULT_MAX]; - ubyte output_to_semantic_index[VERT_RESULT_MAX]; - - /** Pointer to the translated vertex program */ - struct st_vertex_program *vp; - - struct translated_vertex_program *next; /**< next in linked list */ -}; - - -/** - * Given a vertex program output attribute, return the corresponding - * fragment program input attribute. - * \return -1 for vertex outputs that have no corresponding fragment input +/* + * Translate fragment program if needed. */ -static GLint -vp_out_to_fp_in(GLuint vertResult) -{ - if (vertResult >= VERT_RESULT_TEX0 && - vertResult < VERT_RESULT_TEX0 + MAX_TEXTURE_COORD_UNITS) - return FRAG_ATTRIB_TEX0 + (vertResult - VERT_RESULT_TEX0); - - if (vertResult >= VERT_RESULT_VAR0 && - vertResult < VERT_RESULT_VAR0 + MAX_VARYING) - return FRAG_ATTRIB_VAR0 + (vertResult - VERT_RESULT_VAR0); - - switch (vertResult) { - case VERT_RESULT_HPOS: - return FRAG_ATTRIB_WPOS; - case VERT_RESULT_COL0: - return FRAG_ATTRIB_COL0; - case VERT_RESULT_COL1: - return FRAG_ATTRIB_COL1; - case VERT_RESULT_FOGC: - return FRAG_ATTRIB_FOGC; - default: - /* Back-face colors, edge flags, etc */ - return -1; - } -} - - -/** - * Find a translated vertex program that corresponds to stvp and - * has outputs matched to stfp's inputs. - * This performs vertex and fragment translation (to TGSI) when needed. - */ -static struct translated_vertex_program * -find_translated_vp(struct st_context *st, - struct st_vertex_program *stvp, - struct st_fragment_program *stfp) +static void +translate_fp(struct st_context *st, + struct st_fragment_program *stfp) { - static const GLuint UNUSED = ~0; - struct translated_vertex_program *xvp; const GLbitfield fragInputsRead = stfp->Base.Base.InputsRead; - /* - * Translate fragment program if needed. - */ if (!stfp->state.tokens) { GLuint inAttr, numIn = 0; @@ -141,7 +77,7 @@ find_translated_vp(struct st_context *st, numIn++; } else { - stfp->input_to_slot[inAttr] = UNUSED; + stfp->input_to_slot[inAttr] = -1; } } @@ -151,170 +87,63 @@ find_translated_vp(struct st_context *st, st_translate_fragment_program(st, stfp, stfp->input_to_slot); } +} - /* See if we've got a translated vertex program whose outputs match - * the fragment program's inputs. - * XXX This could be a hash lookup, using InputsRead as the key. - */ - for (xvp = stfp->vertex_programs; xvp; xvp = xvp->next) { - if (xvp->master == stvp && xvp->frag_inputs == fragInputsRead) { - break; - } - } - /* No? Allocate translated vp object now */ - if (!xvp) { - xvp = ST_CALLOC_STRUCT(translated_vertex_program); - xvp->frag_inputs = fragInputsRead; - xvp->master = stvp; +/** + * Find a translated vertex program that corresponds to stvp and + * has outputs matched to stfp's inputs. + * This performs vertex and fragment translation (to TGSI) when needed. + */ +static struct st_vp_varient * +find_translated_vp(struct st_context *st, + struct st_vertex_program *stvp ) +{ + struct st_vp_varient *vpv; + struct st_vp_varient_key key; - xvp->next = stfp->vertex_programs; - stfp->vertex_programs = xvp; - } + /* Nothing in our key yet. This will change: + */ + memset(&key, 0, sizeof key); + key.dummy = 0; - /* See if we need to translate vertex program to TGSI form */ - if (xvp->serialNo != stvp->serialNo) { - GLuint outAttr; - const GLbitfield outputsWritten = stvp->Base.Base.OutputsWritten; - GLuint numVpOuts = 0; - GLboolean emitPntSize = GL_FALSE, emitBFC0 = GL_FALSE, emitBFC1 = GL_FALSE; - GLbitfield usedGenerics = 0x0; - GLbitfield usedOutputSlots = 0x0; - - /* Compute mapping of vertex program outputs to slots, which depends - * on the fragment program's input->slot mapping. + /* Do we need to throw away old translations after a change in the + * GL program string? + */ + if (stvp->serialNo != stvp->lastSerialNo) { + /* These may have changed if the program string changed. */ - for (outAttr = 0; outAttr < VERT_RESULT_MAX; outAttr++) { - /* set defaults: */ - xvp->output_to_slot[outAttr] = UNUSED; - xvp->output_to_semantic_name[outAttr] = TGSI_SEMANTIC_COUNT; - xvp->output_to_semantic_index[outAttr] = 99; - - if (outAttr == VERT_RESULT_HPOS) { - /* always put xformed position into slot zero */ - GLuint slot = 0; - xvp->output_to_slot[VERT_RESULT_HPOS] = slot; - xvp->output_to_semantic_name[outAttr] = TGSI_SEMANTIC_POSITION; - xvp->output_to_semantic_index[outAttr] = 0; - numVpOuts++; - usedOutputSlots |= (1 << slot); - } - else if (outputsWritten & (1 << outAttr)) { - /* see if the frag prog wants this vert output */ - GLint fpInAttrib = vp_out_to_fp_in(outAttr); - if (fpInAttrib >= 0) { - GLuint fpInSlot = stfp->input_to_slot[fpInAttrib]; - if (fpInSlot != ~0) { - /* match this vp output to the fp input */ - GLuint vpOutSlot = stfp->input_map[fpInSlot]; - xvp->output_to_slot[outAttr] = vpOutSlot; - xvp->output_to_semantic_name[outAttr] = stfp->input_semantic_name[fpInSlot]; - xvp->output_to_semantic_index[outAttr] = stfp->input_semantic_index[fpInSlot]; - numVpOuts++; - usedOutputSlots |= (1 << vpOutSlot); - } - else { -#if 0 /*debug*/ - printf("VP output %d not used by FP\n", outAttr); -#endif - } - } - else if (outAttr == VERT_RESULT_PSIZ) - emitPntSize = GL_TRUE; - else if (outAttr == VERT_RESULT_BFC0) - emitBFC0 = GL_TRUE; - else if (outAttr == VERT_RESULT_BFC1) - emitBFC1 = GL_TRUE; - } -#if 0 /*debug*/ - printf("assign vp output_to_slot[%d] = %d\n", outAttr, - xvp->output_to_slot[outAttr]); -#endif - } - - /* must do these last */ - if (emitPntSize) { - GLuint slot = numVpOuts++; - xvp->output_to_slot[VERT_RESULT_PSIZ] = slot; - xvp->output_to_semantic_name[VERT_RESULT_PSIZ] = TGSI_SEMANTIC_PSIZE; - xvp->output_to_semantic_index[VERT_RESULT_PSIZ] = 0; - usedOutputSlots |= (1 << slot); - } - if (emitBFC0) { - GLuint slot = numVpOuts++; - xvp->output_to_slot[VERT_RESULT_BFC0] = slot; - xvp->output_to_semantic_name[VERT_RESULT_BFC0] = TGSI_SEMANTIC_COLOR; - xvp->output_to_semantic_index[VERT_RESULT_BFC0] = 0; - usedOutputSlots |= (1 << slot); - } - if (emitBFC1) { - GLuint slot = numVpOuts++; - xvp->output_to_slot[VERT_RESULT_BFC1] = slot; - xvp->output_to_semantic_name[VERT_RESULT_BFC1] = TGSI_SEMANTIC_COLOR; - xvp->output_to_semantic_index[VERT_RESULT_BFC1] = 1; - usedOutputSlots |= (1 << slot); - } - - /* build usedGenerics mask */ - usedGenerics = 0x0; - for (outAttr = 0; outAttr < VERT_RESULT_MAX; outAttr++) { - if (xvp->output_to_semantic_name[outAttr] == TGSI_SEMANTIC_GENERIC) { - usedGenerics |= (1 << xvp->output_to_semantic_index[outAttr]); - } - } + st_prepare_vertex_program( st, stvp ); - /* For each vertex program output that doesn't match up to a fragment - * program input, map the vertex program output to a free slot and - * free generic attribute. + /* We are now up-to-date: */ - for (outAttr = 0; outAttr < VERT_RESULT_MAX; outAttr++) { - if (outputsWritten & (1 << outAttr)) { - if (xvp->output_to_slot[outAttr] == UNUSED) { - GLint freeGeneric = _mesa_ffs(~usedGenerics) - 1; - GLint freeSlot = _mesa_ffs(~usedOutputSlots) - 1; - usedGenerics |= (1 << freeGeneric); - usedOutputSlots |= (1 << freeSlot); - xvp->output_to_slot[outAttr] = freeSlot; - xvp->output_to_semantic_name[outAttr] = TGSI_SEMANTIC_GENERIC; - xvp->output_to_semantic_index[outAttr] = freeGeneric; - } - } - -#if 0 /*debug*/ - printf("vp output_to_slot[%d] = %d\n", outAttr, - xvp->output_to_slot[outAttr]); -#endif + stvp->lastSerialNo = stvp->serialNo; + } + + /* See if we've got a translated vertex program whose outputs match + * the fragment program's inputs. + */ + for (vpv = stvp->varients; vpv; vpv = vpv->next) { + if (memcmp(&vpv->key, &key, sizeof key) == 0) { + break; } + } - assert(stvp->Base.Base.NumInstructions > 1); - - st_translate_vertex_program(st, stvp, xvp->output_to_slot, - xvp->output_to_semantic_name, - xvp->output_to_semantic_index); - - xvp->vp = stvp; - - /* translated VP is up to date now */ - xvp->serialNo = stvp->serialNo; + /* No? Perform new translation here. */ + if (!vpv) { + vpv = st_translate_vertex_program(st, stvp, &key); + if (!vpv) + return NULL; + + vpv->next = stvp->varients; + stvp->varients = vpv; } - return xvp; + return vpv; } -void -st_free_translated_vertex_programs(struct st_context *st, - struct translated_vertex_program *xvp) -{ - struct translated_vertex_program *next; - - while (xvp) { - next = xvp->next; - _mesa_free(xvp); - xvp = next; - } -} static void * @@ -328,32 +157,19 @@ get_passthrough_fs(struct st_context *st) return st->passthrough_fs; } - static void -update_linkage( struct st_context *st ) +update_fp( struct st_context *st ) { - struct st_vertex_program *stvp; struct st_fragment_program *stfp; - struct translated_vertex_program *xvp; - - /* find active shader and params -- Should be covered by - * ST_NEW_VERTEX_PROGRAM - */ - assert(st->ctx->VertexProgram._Current); - stvp = st_vertex_program(st->ctx->VertexProgram._Current); - assert(stvp->Base.Base.Target == GL_VERTEX_PROGRAM_ARB); assert(st->ctx->FragmentProgram._Current); stfp = st_fragment_program(st->ctx->FragmentProgram._Current); assert(stfp->Base.Base.Target == GL_FRAGMENT_PROGRAM_ARB); - xvp = find_translated_vp(st, stvp, stfp); + translate_fp(st, stfp); - st_reference_vertprog(st, &st->vp, stvp); st_reference_fragprog(st, &st->fp, stfp); - cso_set_vertex_shader_handle(st->cso_context, stvp->driver_shader); - if (st->missing_textures) { /* use a pass-through frag shader that uses no textures */ void *fs = get_passthrough_fs(st); @@ -362,16 +178,48 @@ update_linkage( struct st_context *st ) else { cso_set_fragment_shader_handle(st->cso_context, stfp->driver_shader); } +} + +const struct st_tracked_state st_update_fp = { + "st_update_fp", /* name */ + { /* dirty */ + 0, /* mesa */ + ST_NEW_FRAGMENT_PROGRAM /* st */ + }, + update_fp /* update */ +}; + + + + +static void +update_vp( struct st_context *st ) +{ + struct st_vertex_program *stvp; + + /* find active shader and params -- Should be covered by + * ST_NEW_VERTEX_PROGRAM + */ + assert(st->ctx->VertexProgram._Current); + stvp = st_vertex_program(st->ctx->VertexProgram._Current); + assert(stvp->Base.Base.Target == GL_VERTEX_PROGRAM_ARB); + + st->vp_varient = find_translated_vp(st, stvp); + + st_reference_vertprog(st, &st->vp, stvp); + + cso_set_vertex_shader_handle(st->cso_context, + st->vp_varient->driver_shader); - st->vertex_result_to_slot = xvp->output_to_slot; + st->vertex_result_to_slot = stvp->result_to_output; } -const struct st_tracked_state st_update_shader = { - "st_update_shader", /* name */ +const struct st_tracked_state st_update_vp = { + "st_update_vp", /* name */ { /* dirty */ 0, /* mesa */ - ST_NEW_VERTEX_PROGRAM | ST_NEW_FRAGMENT_PROGRAM /* st */ + ST_NEW_VERTEX_PROGRAM /* st */ }, - update_linkage /* update */ + update_vp /* update */ }; diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index a22fa68299..226d1ab14c 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -169,11 +169,6 @@ make_bitmap_fragment_program(GLcontext *ctx, GLuint samplerIndex) stfp = (struct st_fragment_program *) p; stfp->Base.UsesKill = GL_TRUE; - /* No need to send this incomplete program down to hardware: - * - * st_translate_fragment_program(ctx->st, stfp, NULL); - */ - return stfp; } diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 13e454b7a7..60394731f7 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -927,7 +927,7 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, struct pipe_context *pipe = st->pipe; struct pipe_screen *screen = pipe->screen; struct st_renderbuffer *rbRead; - struct st_vertex_program *stvp; + void *driver_vp; struct st_fragment_program *stfp; struct pipe_texture *pt; GLfloat *color; @@ -976,14 +976,14 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, rbRead = st_get_color_read_renderbuffer(ctx); color = NULL; stfp = combined_drawpix_fragment_program(ctx); - stvp = st_make_passthrough_vertex_shader(st, GL_FALSE); + driver_vp = st_make_passthrough_vertex_shader(st, GL_FALSE); } else { assert(type == GL_DEPTH); rbRead = st_renderbuffer(ctx->ReadBuffer->_DepthBuffer); color = ctx->Current.Attrib[VERT_ATTRIB_COLOR0]; stfp = make_fragment_shader_z(st); - stvp = st_make_passthrough_vertex_shader(st, GL_TRUE); + driver_vp = st_make_passthrough_vertex_shader(st, GL_TRUE); } srcFormat = rbRead->texture->format; @@ -1116,7 +1116,7 @@ st_CopyPixels(GLcontext *ctx, GLint srcx, GLint srcy, draw_textured_quad(ctx, dstx, dsty, ctx->Current.RasterPos[2], width, height, ctx->Pixel.ZoomX, ctx->Pixel.ZoomY, pt, - stvp->driver_shader, + driver_vp, stfp->driver_shader, color, GL_TRUE); diff --git a/src/mesa/state_tracker/st_cb_program.c b/src/mesa/state_tracker/st_cb_program.c index b2d5c39a3a..8c276f8128 100644 --- a/src/mesa/state_tracker/st_cb_program.c +++ b/src/mesa/state_tracker/st_cb_program.c @@ -138,24 +138,7 @@ st_delete_program(GLcontext *ctx, struct gl_program *prog) case GL_VERTEX_PROGRAM_ARB: { struct st_vertex_program *stvp = (struct st_vertex_program *) prog; - - if (stvp->driver_shader) { - cso_delete_vertex_shader(st->cso_context, stvp->driver_shader); - stvp->driver_shader = NULL; - } - - if (stvp->draw_shader) { -#if FEATURE_feedback || FEATURE_drawpix - /* this would only have been allocated for the RasterPos path */ - draw_delete_vertex_shader(st->draw, stvp->draw_shader); - stvp->draw_shader = NULL; -#endif - } - - if (stvp->state.tokens) { - st_free_tokens(stvp->state.tokens); - stvp->state.tokens = NULL; - } + st_vp_release_varients( st, stvp ); } break; case GL_FRAGMENT_PROGRAM_ARB: @@ -177,8 +160,6 @@ st_delete_program(GLcontext *ctx, struct gl_program *prog) _mesa_reference_program(ctx, &prg, NULL); stfp->bitmap_program = NULL; } - - st_free_translated_vertex_programs(st, stfp->vertex_programs); } break; default: @@ -219,8 +200,6 @@ static void st_program_string_notify( GLcontext *ctx, stfp->state.tokens = NULL; } - stfp->param_state = stfp->Base.Base.Parameters->StateFlags; - if (st->fp == stfp) st->dirty.st |= ST_NEW_FRAGMENT_PROGRAM; } @@ -229,25 +208,7 @@ static void st_program_string_notify( GLcontext *ctx, stvp->serialNo++; - if (stvp->driver_shader) { - cso_delete_vertex_shader(st->cso_context, stvp->driver_shader); - stvp->driver_shader = NULL; - } - - if (stvp->draw_shader) { -#if FEATURE_feedback || FEATURE_drawpix - /* this would only have been allocated for the RasterPos path */ - draw_delete_vertex_shader(st->draw, stvp->draw_shader); - stvp->draw_shader = NULL; -#endif - } - - if (stvp->state.tokens) { - st_free_tokens(stvp->state.tokens); - stvp->state.tokens = NULL; - } - - stvp->param_state = stvp->Base.Base.Parameters->StateFlags; + st_vp_release_varients( st, stvp ); if (st->vp == stvp) st->dirty.st |= ST_NEW_VERTEX_PROGRAM; diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index 18adb35e87..b760728658 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -127,6 +127,8 @@ struct st_context struct st_vertex_program *vp; /**< Currently bound vertex program */ struct st_fragment_program *fp; /**< Currently bound fragment program */ + struct st_vp_varient *vp_varient; + struct gl_texture_object *default_texture; struct { diff --git a/src/mesa/state_tracker/st_debug.c b/src/mesa/state_tracker/st_debug.c index 3009cde9d5..6e699ca552 100644 --- a/src/mesa/state_tracker/st_debug.c +++ b/src/mesa/state_tracker/st_debug.c @@ -86,7 +86,8 @@ st_print_current(void) } #endif - tgsi_dump( st->vp->state.tokens, 0 ); + if (st->vp->varients) + tgsi_dump( st->vp->varients[0].state.tokens, 0 ); if (st->vp->Base.Base.Parameters) _mesa_print_parameter_list(st->vp->Base.Base.Parameters); diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index c76bff9181..337c21a6c4 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -563,7 +563,7 @@ st_draw_vbo(GLcontext *ctx, /* must get these after state validation! */ vp = ctx->st->vp; - vs = &ctx->st->vp->state; + vs = &ctx->st->vp_varient->state; #if 0 if (MESA_VERBOSE & VERBOSE_GLSL) { diff --git a/src/mesa/state_tracker/st_draw_feedback.c b/src/mesa/state_tracker/st_draw_feedback.c index b2d682ef64..d793f820bc 100644 --- a/src/mesa/state_tracker/st_draw_feedback.c +++ b/src/mesa/state_tracker/st_draw_feedback.c @@ -120,10 +120,10 @@ st_feedback_draw_vbo(GLcontext *ctx, /* must get these after state validation! */ vp = ctx->st->vp; - vs = &st->vp->state; + vs = &st->vp_varient->state; - if (!st->vp->draw_shader) { - st->vp->draw_shader = draw_create_vertex_shader(draw, vs); + if (!st->vp_varient->draw_shader) { + st->vp_varient->draw_shader = draw_create_vertex_shader(draw, vs); } /* @@ -136,7 +136,7 @@ st_feedback_draw_vbo(GLcontext *ctx, draw_set_viewport_state(draw, &st->state.viewport); draw_set_clip_state(draw, &st->state.clip); draw_set_rasterizer_state(draw, &st->state.rasterizer); - draw_bind_vertex_shader(draw, st->vp->draw_shader); + draw_bind_vertex_shader(draw, st->vp_varient->draw_shader); set_feedback_vertex_format(ctx); /* loop over TGSI shader inputs to determine vertex buffer diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 5450b59a2d..6a2b99cf1b 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -49,6 +49,36 @@ #include "st_mesa_to_tgsi.h" #include "cso_cache/cso_context.h" + /* Clean out any old compilations: + */ +void +st_vp_release_varients( struct st_context *st, + struct st_vertex_program *stvp ) +{ + struct st_vp_varient *vpv; + + for (vpv = stvp->varients; vpv; ) { + struct st_vp_varient *next = vpv->next; + + if (vpv->driver_shader) + cso_delete_vertex_shader(st->cso_context, vpv->driver_shader); + + if (vpv->draw_shader) + draw_delete_vertex_shader( st->draw, vpv->draw_shader ); + + if (vpv->state.tokens) + st_free_tokens(vpv->state.tokens); + + FREE( vpv ); + + vpv = next; + } + + stvp->varients = NULL; +} + + + /** * Translate a Mesa vertex shader into a TGSI shader. @@ -58,22 +88,13 @@ * \return pointer to cached pipe_shader object. */ void -st_translate_vertex_program(struct st_context *st, - struct st_vertex_program *stvp, - const GLuint outputMapping[], - const ubyte *outputSemanticName, - const ubyte *outputSemanticIndex) +st_prepare_vertex_program(struct st_context *st, + struct st_vertex_program *stvp) { - struct pipe_context *pipe = st->pipe; - GLuint defaultOutputMapping[VERT_RESULT_MAX]; - GLuint attr, i; - GLuint num_generic = 0; - - uint vs_num_inputs = 0; + GLuint attr; - ubyte vs_output_semantic_name[PIPE_MAX_SHADER_OUTPUTS]; - ubyte vs_output_semantic_index[PIPE_MAX_SHADER_OUTPUTS]; - uint vs_num_outputs = 0; + stvp->num_inputs = 0; + stvp->num_outputs = 0; if (stvp->Base.IsPositionInvariant) _mesa_insert_mvp_code(st->ctx, &stvp->Base); @@ -84,92 +105,56 @@ st_translate_vertex_program(struct st_context *st, */ for (attr = 0; attr < VERT_ATTRIB_MAX; attr++) { if (stvp->Base.Base.InputsRead & (1 << attr)) { - stvp->input_to_index[attr] = vs_num_inputs; - stvp->index_to_input[vs_num_inputs] = attr; - - vs_num_inputs++; + stvp->input_to_index[attr] = stvp->num_inputs; + stvp->index_to_input[stvp->num_inputs] = attr; + stvp->num_inputs++; } } -#if 0 - if (outputMapping && outputSemanticName) { - printf("VERT_RESULT written out_slot semantic_name semantic_index\n"); - for (attr = 0; attr < VERT_RESULT_MAX; attr++) { - printf(" %-2d %c %3d %2d %2d\n", - attr, - ((stvp->Base.Base.OutputsWritten & (1 << attr)) ? 'Y' : ' '), - outputMapping[attr], - outputSemanticName[attr], - outputSemanticIndex[attr]); - } - } -#endif - - /* initialize output semantics to defaults */ - for (i = 0; i < PIPE_MAX_SHADER_OUTPUTS; i++) { - assert(i < Elements(vs_output_semantic_name)); - vs_output_semantic_name[i] = TGSI_SEMANTIC_GENERIC; - vs_output_semantic_index[i] = 0; - } - - num_generic = 0; - /* - * Determine number of outputs, the (default) output register - * mapping and the semantic information for each output. + /* Compute mapping of vertex program outputs to slots. */ for (attr = 0; attr < VERT_RESULT_MAX; attr++) { - if (stvp->Base.Base.OutputsWritten & (1 << attr)) { - GLuint slot; - - /* XXX - * Pass in the fragment program's input's semantic info. - * Use the generic semantic indexes from there, instead of - * guessing below. - */ - - if (outputMapping) { - slot = outputMapping[attr]; - assert(slot != ~0); - } - else { - slot = vs_num_outputs; - vs_num_outputs++; - defaultOutputMapping[attr] = slot; - } + if ((stvp->Base.Base.OutputsWritten & (1 << attr)) == 0) { + stvp->result_to_output[attr] = ~0; + } + else { + unsigned slot = stvp->num_outputs++; + + stvp->result_to_output[attr] = slot; switch (attr) { case VERT_RESULT_HPOS: - assert(slot == 0); - vs_output_semantic_name[slot] = TGSI_SEMANTIC_POSITION; - vs_output_semantic_index[slot] = 0; + stvp->output_semantic_name[slot] = TGSI_SEMANTIC_POSITION; + stvp->output_semantic_index[slot] = 0; break; case VERT_RESULT_COL0: - vs_output_semantic_name[slot] = TGSI_SEMANTIC_COLOR; - vs_output_semantic_index[slot] = 0; + stvp->output_semantic_name[slot] = TGSI_SEMANTIC_COLOR; + stvp->output_semantic_index[slot] = 0; break; case VERT_RESULT_COL1: - vs_output_semantic_name[slot] = TGSI_SEMANTIC_COLOR; - vs_output_semantic_index[slot] = 1; + stvp->output_semantic_name[slot] = TGSI_SEMANTIC_COLOR; + stvp->output_semantic_index[slot] = 1; break; case VERT_RESULT_BFC0: - vs_output_semantic_name[slot] = TGSI_SEMANTIC_BCOLOR; - vs_output_semantic_index[slot] = 0; + stvp->output_semantic_name[slot] = TGSI_SEMANTIC_BCOLOR; + stvp->output_semantic_index[slot] = 0; break; case VERT_RESULT_BFC1: - vs_output_semantic_name[slot] = TGSI_SEMANTIC_BCOLOR; - vs_output_semantic_index[slot] = 1; + stvp->output_semantic_name[slot] = TGSI_SEMANTIC_BCOLOR; + stvp->output_semantic_index[slot] = 1; break; case VERT_RESULT_FOGC: - vs_output_semantic_name[slot] = TGSI_SEMANTIC_FOG; - vs_output_semantic_index[slot] = 0; + stvp->output_semantic_name[slot] = TGSI_SEMANTIC_FOG; + stvp->output_semantic_index[slot] = 0; break; case VERT_RESULT_PSIZ: - vs_output_semantic_name[slot] = TGSI_SEMANTIC_PSIZE; - vs_output_semantic_index[slot] = 0; + stvp->output_semantic_name[slot] = TGSI_SEMANTIC_PSIZE; + stvp->output_semantic_index[slot] = 0; break; case VERT_RESULT_EDGE: assert(0); break; + case VERT_RESULT_TEX0: case VERT_RESULT_TEX1: case VERT_RESULT_TEX2: @@ -178,87 +163,50 @@ st_translate_vertex_program(struct st_context *st, case VERT_RESULT_TEX5: case VERT_RESULT_TEX6: case VERT_RESULT_TEX7: - /* fall-through */ + stvp->output_semantic_name[slot] = TGSI_SEMANTIC_GENERIC; + stvp->output_semantic_index[slot] = attr - VERT_RESULT_TEX0; + break; + case VERT_RESULT_VAR0: - /* fall-through */ default: - assert(slot < Elements(vs_output_semantic_name)); - if (outputSemanticName) { - /* use provided semantic into */ - assert(outputSemanticName[attr] != TGSI_SEMANTIC_COUNT); - vs_output_semantic_name[slot] = outputSemanticName[attr]; - vs_output_semantic_index[slot] = outputSemanticIndex[attr]; - } - else { - /* use default semantic info */ - vs_output_semantic_name[slot] = TGSI_SEMANTIC_GENERIC; - vs_output_semantic_index[slot] = num_generic++; - } + assert(attr < VERT_RESULT_MAX); + stvp->output_semantic_name[slot] = TGSI_SEMANTIC_GENERIC; + stvp->output_semantic_index[slot] = (FRAG_ATTRIB_VAR0 - + FRAG_ATTRIB_TEX0 + + attr - + VERT_RESULT_VAR0); + break; } } } +} - if (outputMapping) { - /* find max output slot referenced to compute vs_num_outputs */ - GLuint maxSlot = 0; - for (attr = 0; attr < VERT_RESULT_MAX; attr++) { - if (outputMapping[attr] != ~0 && outputMapping[attr] > maxSlot) - maxSlot = outputMapping[attr]; - } - vs_num_outputs = maxSlot + 1; - } - else { - outputMapping = defaultOutputMapping; - } -#if 0 /* debug */ - { - GLuint i; - printf("outputMapping? %d\n", outputMapping ? 1 : 0); - if (outputMapping) { - printf("attr -> slot\n"); - for (i = 0; i < 16; i++) { - printf(" %2d %3d\n", i, outputMapping[i]); - } - } - printf("slot sem_name sem_index\n"); - for (i = 0; i < vs_num_outputs; i++) { - printf(" %2d %d %d\n", - i, - vs_output_semantic_name[i], - vs_output_semantic_index[i]); - } - } -#endif - - /* free old shader state, if any */ - if (stvp->state.tokens) { - st_free_tokens(stvp->state.tokens); - stvp->state.tokens = NULL; - } - if (stvp->driver_shader) { - cso_delete_vertex_shader(st->cso_context, stvp->driver_shader); - stvp->driver_shader = NULL; - } +struct st_vp_varient * +st_translate_vertex_program(struct st_context *st, + struct st_vertex_program *stvp, + const struct st_vp_varient_key *key) +{ + struct st_vp_varient *vpv = CALLOC_STRUCT(st_vp_varient); + struct pipe_context *pipe = st->pipe; - stvp->state.tokens = + vpv->state.tokens = st_translate_mesa_program(st->ctx, TGSI_PROCESSOR_VERTEX, &stvp->Base.Base, /* inputs */ - vs_num_inputs, + stvp->num_inputs, stvp->input_to_index, NULL, /* input semantic name */ NULL, /* input semantic index */ NULL, /* outputs */ - vs_num_outputs, - outputMapping, - vs_output_semantic_name, - vs_output_semantic_index ); + stvp->num_outputs, + stvp->result_to_output, + stvp->output_semantic_name, + stvp->output_semantic_index ); - stvp->num_inputs = vs_num_inputs; - stvp->driver_shader = pipe->create_vs_state(pipe, &stvp->state); + vpv->driver_shader = pipe->create_vs_state(pipe, &vpv->state); if ((ST_DEBUG & DEBUG_TGSI) && (ST_DEBUG & DEBUG_MESA)) { _mesa_print_program(&stvp->Base.Base); @@ -266,9 +214,11 @@ st_translate_vertex_program(struct st_context *st, } if (ST_DEBUG & DEBUG_TGSI) { - tgsi_dump( stvp->state.tokens, 0 ); + tgsi_dump( vpv->state.tokens, 0 ); debug_printf("\n"); } + + return vpv; } @@ -291,7 +241,6 @@ st_translate_fragment_program(struct st_context *st, GLuint attr; const GLbitfield inputsRead = stfp->Base.Base.InputsRead; GLuint vslot = 0; - GLuint num_generic = 0; uint fs_num_inputs = 0; @@ -341,14 +290,25 @@ st_translate_fragment_program(struct st_context *st, break; case FRAG_ATTRIB_FACE: stfp->input_semantic_name[slot] = TGSI_SEMANTIC_FACE; - stfp->input_semantic_index[slot] = num_generic++; + stfp->input_semantic_index[slot] = 0; interpMode[slot] = TGSI_INTERPOLATE_CONSTANT; break; - case FRAG_ATTRIB_PNTC: - stfp->input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC; - stfp->input_semantic_index[slot] = num_generic++; - interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE; - break; + + /* In most cases, there is nothing special about these + * inputs, so adopt a convention to use the generic + * semantic name and the mesa FRAG_ATTRIB_ number as the + * index. + * + * All that is required is that the vertex shader labels + * its own outputs similarly, and that the vertex shader + * generates at least every output required by the + * fragment shader plus fixed-function hardware (such as + * BFC). + * + * There is no requirement that semantic indexes start at + * zero or be restricted to a particular range -- nobody + * should be building tables based on semantic index. + */ case FRAG_ATTRIB_TEX0: case FRAG_ATTRIB_TEX1: case FRAG_ATTRIB_TEX2: @@ -357,16 +317,17 @@ st_translate_fragment_program(struct st_context *st, case FRAG_ATTRIB_TEX5: case FRAG_ATTRIB_TEX6: case FRAG_ATTRIB_TEX7: - stfp->input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC; - stfp->input_semantic_index[slot] = num_generic++; - interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE; - break; + case FRAG_ATTRIB_PNTC: case FRAG_ATTRIB_VAR0: - /* fall-through */ default: + /* Actually, let's try and zero-base this just for + * readability of the generated TGSI. + */ + assert(attr >= FRAG_ATTRIB_TEX0); + stfp->input_semantic_index[slot] = (attr - FRAG_ATTRIB_TEX0); stfp->input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC; - stfp->input_semantic_index[slot] = num_generic++; interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE; + break; } } } diff --git a/src/mesa/state_tracker/st_program.h b/src/mesa/state_tracker/st_program.h index e2e5eddef2..88aadbd751 100644 --- a/src/mesa/state_tracker/st_program.h +++ b/src/mesa/state_tracker/st_program.h @@ -64,41 +64,70 @@ struct st_fragment_program struct pipe_shader_state state; void *driver_shader; - GLuint param_state; - - /** List of vertex programs which have been translated such that their - * outputs match this fragment program's inputs. - */ - struct translated_vertex_program *vertex_programs; - /** Program prefixed with glBitmap prologue */ struct st_fragment_program *bitmap_program; uint bitmap_sampler; }; + +struct st_vp_varient_key +{ + char dummy; /* currently unused */ +}; + + +/** + * This represents a vertex program, especially translated to match + * the inputs of a particular fragment shader. + */ +struct st_vp_varient +{ + /* Parameters which generated this translated version of a vertex + * shader: + */ + struct st_vp_varient_key key; + + /** TGSI tokens -- why? + */ + struct pipe_shader_state state; + + /** Driver's compiled shader */ + void *driver_shader; + + /** For using our private draw module (glRasterPos) */ + struct draw_vertex_shader *draw_shader; + + /** Next in linked list */ + struct st_vp_varient *next; +}; + + + + /** * Derived from Mesa gl_fragment_program: */ struct st_vertex_program { struct gl_vertex_program Base; /**< The Mesa vertex program */ - GLuint serialNo; + GLuint serialNo, lastSerialNo; /** maps a Mesa VERT_ATTRIB_x to a packed TGSI input index */ GLuint input_to_index[VERT_ATTRIB_MAX]; /** maps a TGSI input index back to a Mesa VERT_ATTRIB_x */ GLuint index_to_input[PIPE_MAX_SHADER_INPUTS]; - GLuint num_inputs; - struct pipe_shader_state state; - void *driver_shader; + /** Maps VERT_RESULT_x to slot */ + GLuint result_to_output[VERT_RESULT_MAX]; + ubyte output_semantic_name[VERT_RESULT_MAX]; + ubyte output_semantic_index[VERT_RESULT_MAX]; + GLuint num_outputs; - /** For using our private draw module (glRasterPos) */ - struct draw_vertex_shader *draw_shader; - - GLuint param_state; + /** List of translated varients of this vertex program. + */ + struct st_vp_varient *varients; }; @@ -143,13 +172,21 @@ st_translate_fragment_program(struct st_context *st, const GLuint inputMapping[]); +/* Called after program string change, discard all previous + * compilation results. + */ extern void +st_prepare_vertex_program(struct st_context *st, + struct st_vertex_program *stvp); + +extern struct st_vp_varient * st_translate_vertex_program(struct st_context *st, - struct st_vertex_program *vp, - const GLuint vert_output_to_slot[], - const ubyte *fs_input_semantic_name, - const ubyte *fs_input_semantic_index); + struct st_vertex_program *stvp, + const struct st_vp_varient_key *key); +void +st_vp_release_varients( struct st_context *st, + struct st_vertex_program *stvp ); extern void st_print_shaders(GLcontext *ctx); -- cgit v1.2.3 From afae49cc152d05e6795ccaba4d818df946248584 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 12 Nov 2009 20:59:26 -0700 Subject: st/mesa: comments for st_draw.c --- src/mesa/state_tracker/st_draw.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_draw.c b/src/mesa/state_tracker/st_draw.c index c76bff9181..68bc76b572 100644 --- a/src/mesa/state_tracker/st_draw.c +++ b/src/mesa/state_tracker/st_draw.c @@ -25,10 +25,20 @@ * **************************************************************************/ - /* - * Authors: - * Keith Whitwell - */ +/* + * This file implements the st_draw_vbo() function which is called from + * Mesa's VBO module. All point/line/triangle rendering is done through + * this function whether the user called glBegin/End, glDrawArrays, + * glDrawElements, glEvalMesh, or glCalList, etc. + * + * We basically convert the VBO's vertex attribute/array information into + * Gallium vertex state, bind the vertex buffer objects and call + * pipe->draw_elements(), pipe->draw_range_elements() or pipe->draw_arrays(). + * + * Authors: + * Keith Whitwell + */ + #include "main/imports.h" #include "main/image.h" -- cgit v1.2.3 From ecb03d75a2961b28ab3d90fdd5df768608fc9447 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 16 Nov 2009 08:14:23 -0700 Subject: mesa: added another check in check_gen_mipmap() We don't need to call ctx->Driver.GenerateMipmap() if we're updating a texture level >= MAX_LEVEL. --- src/mesa/main/teximage.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index b10076875b..b946f3c69d 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -2035,7 +2035,9 @@ check_gen_mipmap(GLcontext *ctx, GLenum target, struct gl_texture_object *texObj, GLint level) { ASSERT(target != GL_TEXTURE_CUBE_MAP); - if (texObj->GenerateMipmap && level == texObj->BaseLevel) { + if (texObj->GenerateMipmap && + level == texObj->BaseLevel && + level < texObj->MaxLevel) { ASSERT(ctx->Driver.GenerateMipmap); ctx->Driver.GenerateMipmap(ctx, target, texObj); } -- cgit v1.2.3 From a719395b458ef59efe4e8746e390b006a0b8792b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 16 Nov 2009 08:21:28 -0700 Subject: mesa: use _mesa_get_current_tex_object() --- src/mesa/main/fbobject.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 2d0bfb3ad7..a2264b0dbf 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1942,7 +1942,6 @@ _mesa_GetFramebufferAttachmentParameterivEXT(GLenum target, GLenum attachment, void GLAPIENTRY _mesa_GenerateMipmapEXT(GLenum target) { - struct gl_texture_unit *texUnit; struct gl_texture_object *texObj; GET_CURRENT_CONTEXT(ctx); @@ -1961,8 +1960,7 @@ _mesa_GenerateMipmapEXT(GLenum target) return; } - texUnit = _mesa_get_current_tex_unit(ctx); - texObj = _mesa_select_tex_object(ctx, texUnit, target); + texObj = _mesa_get_current_tex_object(ctx, target); _mesa_lock_texture(ctx, texObj); if (target == GL_TEXTURE_CUBE_MAP) { -- cgit v1.2.3 From 652828ec0efd1a7d7a8b497e0324a7bd9f66fd17 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 16 Nov 2009 08:25:17 -0700 Subject: mesa: check BaseLevel, MaxLevel in _mesa_GenerateMipmapEXT() --- src/mesa/main/fbobject.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index a2264b0dbf..7b3599f932 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1962,6 +1962,11 @@ _mesa_GenerateMipmapEXT(GLenum target) texObj = _mesa_get_current_tex_object(ctx, target); + if (texObj->BaseLevel >= texObj->MaxLevel) { + /* nothing to do */ + return; + } + _mesa_lock_texture(ctx, texObj); if (target == GL_TEXTURE_CUBE_MAP) { GLuint face; -- cgit v1.2.3 From f549f4c4b6012178df3706b26539ca672399260f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 12 Nov 2009 23:04:26 -0700 Subject: mesa: remove unused vertex array driver hooks --- src/mesa/drivers/common/driverfuncs.c | 13 ----- src/mesa/main/dd.h | 28 ---------- src/mesa/main/varray.c | 102 +++++++++------------------------- 3 files changed, 26 insertions(+), 117 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index e5aab02a42..4ca0e7bcc3 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -183,19 +183,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->TexParameter = NULL; driver->Viewport = NULL; - /* vertex arrays */ - driver->VertexPointer = NULL; - driver->NormalPointer = NULL; - driver->ColorPointer = NULL; - driver->FogCoordPointer = NULL; - driver->IndexPointer = NULL; - driver->SecondaryColorPointer = NULL; - driver->TexCoordPointer = NULL; - driver->EdgeFlagPointer = NULL; - driver->VertexAttribPointer = NULL; - driver->LockArraysEXT = NULL; - driver->UnlockArraysEXT = NULL; - /* state queries */ driver->GetBooleanv = NULL; driver->GetDoublev = NULL; diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 99f2cad402..27ed921761 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -709,34 +709,6 @@ struct dd_function_table { /*@}*/ - /** - * \name Vertex array functions - * - * Called by the corresponding OpenGL functions. - */ - /*@{*/ - void (*VertexPointer)(GLcontext *ctx, GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr); - void (*NormalPointer)(GLcontext *ctx, GLenum type, - GLsizei stride, const GLvoid *ptr); - void (*ColorPointer)(GLcontext *ctx, GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr); - void (*FogCoordPointer)(GLcontext *ctx, GLenum type, - GLsizei stride, const GLvoid *ptr); - void (*IndexPointer)(GLcontext *ctx, GLenum type, - GLsizei stride, const GLvoid *ptr); - void (*SecondaryColorPointer)(GLcontext *ctx, GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr); - void (*TexCoordPointer)(GLcontext *ctx, GLint size, GLenum type, - GLsizei stride, const GLvoid *ptr); - void (*EdgeFlagPointer)(GLcontext *ctx, GLsizei stride, const GLvoid *ptr); - void (*VertexAttribPointer)(GLcontext *ctx, GLuint index, GLint size, - GLenum type, GLsizei stride, const GLvoid *ptr); - void (*LockArraysEXT)( GLcontext *ctx, GLint first, GLsizei count ); - void (*UnlockArraysEXT)( GLcontext *ctx ); - /*@}*/ - - /** * \name State-query functions * diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c index 6cd2a2f4f6..c2193074cd 100644 --- a/src/mesa/main/varray.c +++ b/src/mesa/main/varray.c @@ -51,9 +51,8 @@ * \param stride stride between elements, in elements * \param normalized are integer types converted to floats in [-1, 1]? * \param ptr the address (or offset inside VBO) of the array data - * \return GL_TRUE if no error, GL_FALSE if error */ -static GLboolean +static void update_array(GLcontext *ctx, struct gl_client_array *array, GLbitfield dirtyBit, GLsizei elementSize, GLint size, GLenum type, GLenum format, @@ -68,7 +67,7 @@ update_array(GLcontext *ctx, struct gl_client_array *array, */ _mesa_error(ctx, GL_INVALID_OPERATION, "glVertex/Normal/EtcPointer(non-VBO array)"); - return GL_FALSE; + return; } array->Size = size; @@ -85,8 +84,6 @@ update_array(GLcontext *ctx, struct gl_client_array *array, ctx->NewState |= _NEW_ARRAY; ctx->Array.NewState |= dirtyBit; - - return GL_TRUE; } @@ -140,12 +137,8 @@ _mesa_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) return; } - if (!update_array(ctx, &ctx->Array.ArrayObj->Vertex, _NEW_ARRAY_VERTEX, - elementSize, size, type, GL_RGBA, stride, GL_FALSE, ptr)) - return; - - if (ctx->Driver.VertexPointer) - ctx->Driver.VertexPointer( ctx, size, type, stride, ptr ); + update_array(ctx, &ctx->Array.ArrayObj->Vertex, _NEW_ARRAY_VERTEX, + elementSize, size, type, GL_RGBA, stride, GL_FALSE, ptr); } @@ -192,12 +185,8 @@ _mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr ) return; } - if (!update_array(ctx, &ctx->Array.ArrayObj->Normal, _NEW_ARRAY_NORMAL, - elementSize, 3, type, GL_RGBA, stride, GL_TRUE, ptr)) - return; - - if (ctx->Driver.NormalPointer) - ctx->Driver.NormalPointer( ctx, type, stride, ptr ); + update_array(ctx, &ctx->Array.ArrayObj->Normal, _NEW_ARRAY_NORMAL, + elementSize, 3, type, GL_RGBA, stride, GL_TRUE, ptr); } @@ -272,12 +261,8 @@ _mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) return; } - if (!update_array(ctx, &ctx->Array.ArrayObj->Color, _NEW_ARRAY_COLOR0, - elementSize, size, type, format, stride, GL_TRUE, ptr)) - return; - - if (ctx->Driver.ColorPointer) - ctx->Driver.ColorPointer( ctx, size, type, stride, ptr ); + update_array(ctx, &ctx->Array.ArrayObj->Color, _NEW_ARRAY_COLOR0, + elementSize, size, type, format, stride, GL_TRUE, ptr); } @@ -305,12 +290,8 @@ _mesa_FogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid *ptr) return; } - if (!update_array(ctx, &ctx->Array.ArrayObj->FogCoord, _NEW_ARRAY_FOGCOORD, - elementSize, 1, type, GL_RGBA, stride, GL_FALSE, ptr)) - return; - - if (ctx->Driver.FogCoordPointer) - ctx->Driver.FogCoordPointer( ctx, type, stride, ptr ); + update_array(ctx, &ctx->Array.ArrayObj->FogCoord, _NEW_ARRAY_FOGCOORD, + elementSize, 1, type, GL_RGBA, stride, GL_FALSE, ptr); } @@ -347,12 +328,8 @@ _mesa_IndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr) return; } - if (!update_array(ctx, &ctx->Array.ArrayObj->Index, _NEW_ARRAY_INDEX, - elementSize, 1, type, GL_RGBA, stride, GL_FALSE, ptr)) - return; - - if (ctx->Driver.IndexPointer) - ctx->Driver.IndexPointer( ctx, type, stride, ptr ); + update_array(ctx, &ctx->Array.ArrayObj->Index, _NEW_ARRAY_INDEX, + elementSize, 1, type, GL_RGBA, stride, GL_FALSE, ptr); } @@ -423,13 +400,8 @@ _mesa_SecondaryColorPointerEXT(GLint size, GLenum type, return; } - if (!update_array(ctx, &ctx->Array.ArrayObj->SecondaryColor, - _NEW_ARRAY_COLOR1, elementSize, size, type, - format, stride, GL_TRUE, ptr)) - return; - - if (ctx->Driver.SecondaryColorPointer) - ctx->Driver.SecondaryColorPointer( ctx, size, type, stride, ptr ); + update_array(ctx, &ctx->Array.ArrayObj->SecondaryColor, _NEW_ARRAY_COLOR1, + elementSize, size, type, format, stride, GL_TRUE, ptr); } @@ -485,13 +457,9 @@ _mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride, return; } - if (!update_array(ctx, &ctx->Array.ArrayObj->TexCoord[unit], - _NEW_ARRAY_TEXCOORD(unit), - elementSize, size, type, GL_RGBA, stride, GL_FALSE, ptr)) - return; - - if (ctx->Driver.TexCoordPointer) - ctx->Driver.TexCoordPointer( ctx, size, type, stride, ptr ); + update_array(ctx, &ctx->Array.ArrayObj->TexCoord[unit], + _NEW_ARRAY_TEXCOORD(unit), + elementSize, size, type, GL_RGBA, stride, GL_FALSE, ptr); } @@ -506,13 +474,9 @@ _mesa_EdgeFlagPointer(GLsizei stride, const GLvoid *ptr) return; } - if (!update_array(ctx, &ctx->Array.ArrayObj->EdgeFlag, _NEW_ARRAY_EDGEFLAG, - sizeof(GLboolean), 1, GL_UNSIGNED_BYTE, GL_RGBA, - stride, GL_FALSE, ptr)) - return; - - if (ctx->Driver.EdgeFlagPointer) - ctx->Driver.EdgeFlagPointer( ctx, stride, ptr ); + update_array(ctx, &ctx->Array.ArrayObj->EdgeFlag, _NEW_ARRAY_EDGEFLAG, + sizeof(GLboolean), 1, GL_UNSIGNED_BYTE, GL_RGBA, + stride, GL_FALSE, ptr); } @@ -620,13 +584,9 @@ _mesa_VertexAttribPointerNV(GLuint index, GLint size, GLenum type, return; } - if (!update_array(ctx, &ctx->Array.ArrayObj->VertexAttrib[index], - _NEW_ARRAY_ATTRIB(index), - elementSize, size, type, format, stride, normalized, ptr)) - return; - - if (ctx->Driver.VertexAttribPointer) - ctx->Driver.VertexAttribPointer( ctx, index, size, type, stride, ptr ); + update_array(ctx, &ctx->Array.ArrayObj->VertexAttrib[index], + _NEW_ARRAY_ATTRIB(index), + elementSize, size, type, format, stride, normalized, ptr); } #endif @@ -720,13 +680,9 @@ _mesa_VertexAttribPointerARB(GLuint index, GLint size, GLenum type, return; } - if (!update_array(ctx, &ctx->Array.ArrayObj->VertexAttrib[index], - _NEW_ARRAY_ATTRIB(index), - elementSize, size, type, format, stride, normalized, ptr)) - return; - - if (ctx->Driver.VertexAttribPointer) - ctx->Driver.VertexAttribPointer(ctx, index, size, type, stride, ptr); + update_array(ctx, &ctx->Array.ArrayObj->VertexAttrib[index], + _NEW_ARRAY_ATTRIB(index), + elementSize, size, type, format, stride, normalized, ptr); } #endif @@ -989,9 +945,6 @@ _mesa_LockArraysEXT(GLint first, GLsizei count) ctx->NewState |= _NEW_ARRAY; ctx->Array.NewState |= _NEW_ARRAY_ALL; - - if (ctx->Driver.LockArraysEXT) - ctx->Driver.LockArraysEXT( ctx, first, count ); } @@ -1013,9 +966,6 @@ _mesa_UnlockArraysEXT( void ) ctx->Array.LockCount = 0; ctx->NewState |= _NEW_ARRAY; ctx->Array.NewState |= _NEW_ARRAY_ALL; - - if (ctx->Driver.UnlockArraysEXT) - ctx->Driver.UnlockArraysEXT( ctx ); } -- cgit v1.2.3 From d683acb101a65d0688bfd0818a0ddb4be16e376d Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Mon, 16 Nov 2009 15:03:48 -0500 Subject: r600: don't force Z order Let the hw decide (early vs late Z) fixes fdo bug 25092 Signed-off-by: Alex Deucher --- src/mesa/drivers/dri/r600/r700_state.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_state.c b/src/mesa/drivers/dri/r600/r700_state.c index 41000dc8ce..d7420678ff 100644 --- a/src/mesa/drivers/dri/r600/r700_state.c +++ b/src/mesa/drivers/dri/r600/r700_state.c @@ -202,9 +202,6 @@ static void r700SetDBRenderState(GLcontext * ctx) SETbit(r700->DB_SHADER_CONTROL.u32All, DUAL_EXPORT_ENABLE_bit); SETfield(r700->DB_SHADER_CONTROL.u32All, EARLY_Z_THEN_LATE_Z, Z_ORDER_shift, Z_ORDER_mask); - /* XXX not sure if this is required */ - if (context->radeon.radeonScreen->chip_family < CHIP_FAMILY_RV770) - SETbit(r700->DB_RENDER_OVERRIDE.u32All, FORCE_SHADER_Z_ORDER_bit); /* XXX need to enable htile for hiz/s */ SETfield(r700->DB_RENDER_OVERRIDE.u32All, FORCE_DISABLE, FORCE_HIZ_ENABLE_shift, FORCE_HIZ_ENABLE_mask); SETfield(r700->DB_RENDER_OVERRIDE.u32All, FORCE_DISABLE, FORCE_HIS_ENABLE0_shift, FORCE_HIS_ENABLE0_mask); -- cgit v1.2.3 From 5fb07a4046a7f00f060bbc6dae92213e635d55f5 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 16 Nov 2009 14:30:47 -0800 Subject: AL1616: Add macros to pack two GLushorts into a texel --- src/mesa/main/colormac.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/colormac.h b/src/mesa/main/colormac.h index 7ae781ae23..905f4e2283 100644 --- a/src/mesa/main/colormac.h +++ b/src/mesa/main/colormac.h @@ -210,6 +210,12 @@ do { \ #define PACK_COLOR_88_REV( L, A ) \ (((A) << 8) | (L)) +#define PACK_COLOR_1616( L, A ) \ + (((L) << 16) | (A)) + +#define PACK_COLOR_1616_REV( L, A ) \ + (((A) << 16) | (L)) + #define PACK_COLOR_332( R, G, B ) \ (((R) & 0xe0) | (((G) & 0xe0) >> 3) | (((B) & 0xc0) >> 6)) -- cgit v1.2.3 From eb437fabe017611e1f855fffa45f59cd38709be8 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 16 Nov 2009 14:49:40 -0800 Subject: AL1616: Add formats for GL_LUMINANCE16_ALPHA16 textures --- src/mesa/main/formats.c | 25 +++++++++++++++++++++++++ src/mesa/main/formats.h | 2 ++ 2 files changed, 27 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index 7d0e2d2914..7d64c462b1 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -231,6 +231,24 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 8, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ 1, 1, 2 /* BlockWidth/Height,Bytes */ }, + { + MESA_FORMAT_AL1616, /* Name */ + "MESA_FORMAT_AL1616", /* StrName */ + GL_LUMINANCE_ALPHA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 0, 0, 0, 16, /* Red/Green/Blue/AlphaBits */ + 16, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, + { + MESA_FORMAT_AL1616_REV, /* Name */ + "MESA_FORMAT_AL1616_REV", /* StrName */ + GL_LUMINANCE_ALPHA, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 0, 0, 0, 16, /* Red/Green/Blue/AlphaBits */ + 16, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, { MESA_FORMAT_RGB332, /* Name */ "MESA_FORMAT_RGB332", /* StrName */ @@ -974,6 +992,13 @@ _mesa_format_to_type_and_comps(gl_format format, *datatype = GL_UNSIGNED_BYTE; *comps = 2; return; + + case MESA_FORMAT_AL1616: + case MESA_FORMAT_AL1616_REV: + *datatype = GL_UNSIGNED_SHORT; + *comps = 2; + return; + case MESA_FORMAT_RGB332: *datatype = GL_UNSIGNED_BYTE_3_3_2; *comps = 3; diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index fa6359f5c8..d3ac436b1b 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -66,6 +66,8 @@ typedef enum MESA_FORMAT_ARGB1555_REV, /* GGGB BBBB ARRR RRGG */ MESA_FORMAT_AL88, /* AAAA AAAA LLLL LLLL */ MESA_FORMAT_AL88_REV, /* LLLL LLLL AAAA AAAA */ + MESA_FORMAT_AL1616, /* AAAA AAAA AAAA AAAA LLLL LLLL LLLL LLLL */ + MESA_FORMAT_AL1616_REV, /* LLLL LLLL LLLL LLLL AAAA AAAA AAAA AAAA */ MESA_FORMAT_RGB332, /* RRRG GGBB */ MESA_FORMAT_A8, /* AAAA AAAA */ MESA_FORMAT_L8, /* LLLL LLLL */ -- cgit v1.2.3 From 975871b4d5e25ddcd350f4e1600c00d37f65fea1 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 16 Nov 2009 14:52:43 -0800 Subject: AL1616: Add texel fetch / store routines --- src/mesa/main/texfetch.c | 14 +++++++++++++ src/mesa/main/texfetch_tmp.h | 48 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/texfetch.c b/src/mesa/main/texfetch.c index 314ccb7b65..c431d3a1db 100644 --- a/src/mesa/main/texfetch.c +++ b/src/mesa/main/texfetch.c @@ -452,6 +452,20 @@ texfetch_funcs[MESA_FORMAT_COUNT] = fetch_texel_3d_f_al88_rev, store_texel_al88_rev }, + { + MESA_FORMAT_AL1616, + fetch_texel_1d_f_al1616, + fetch_texel_2d_f_al1616, + fetch_texel_3d_f_al1616, + store_texel_al1616 + }, + { + MESA_FORMAT_AL1616_REV, + fetch_texel_1d_f_al1616_rev, + fetch_texel_2d_f_al1616_rev, + fetch_texel_3d_f_al1616_rev, + store_texel_al1616_rev + }, { MESA_FORMAT_RGB332, fetch_texel_1d_f_rgb332, diff --git a/src/mesa/main/texfetch_tmp.h b/src/mesa/main/texfetch_tmp.h index 27434946ec..093e0abc49 100644 --- a/src/mesa/main/texfetch_tmp.h +++ b/src/mesa/main/texfetch_tmp.h @@ -834,6 +834,54 @@ static void store_texel_al88_rev(struct gl_texture_image *texImage, #endif +/* MESA_FORMAT_AL1616 ********************************************************/ + +/* Fetch texel from 1D, 2D or 3D al1616 texture, return 4 GLchans */ +static void FETCH(f_al1616)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = USHORT_TO_FLOAT( s & 0xffff ); + texel[ACOMP] = USHORT_TO_FLOAT( s >> 16 ); +} + +#if DIM == 3 +static void store_texel_al1616(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLushort *rgba = (const GLushort *) texel; + GLuint *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + *dst = PACK_COLOR_1616(rgba[ACOMP], rgba[RCOMP]); +} +#endif + + +/* MESA_FORMAT_AL1616_REV ****************************************************/ + +/* Fetch texel from 1D, 2D or 3D al1616_rev texture, return 4 GLchans */ +static void FETCH(f_al1616_rev)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[RCOMP] = + texel[GCOMP] = + texel[BCOMP] = USHORT_TO_FLOAT( s >> 16 ); + texel[ACOMP] = USHORT_TO_FLOAT( s & 0xffff ); +} + +#if DIM == 3 +static void store_texel_al1616_rev(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLushort *rgba = (const GLushort *) texel; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + *dst = PACK_COLOR_1616(rgba[RCOMP], rgba[ACOMP]); +} +#endif + + /* MESA_FORMAT_RGB332 ********************************************************/ /* Fetch texel from 1D, 2D or 3D rgb332 texture, return 4 GLchans */ -- cgit v1.2.3 From 3325dc91be2534079ebf7997700b6e5f17a75283 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 16 Nov 2009 14:53:12 -0800 Subject: AL1616: Add TexImage storage path --- src/mesa/main/texstore.c | 73 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index e48d472061..f43e216bc5 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -2145,6 +2145,77 @@ _mesa_texstore_al88(TEXSTORE_PARAMS) } +static GLboolean +_mesa_texstore_al1616(TEXSTORE_PARAMS) +{ + const GLboolean littleEndian = _mesa_little_endian(); + const GLuint texelBytes = _mesa_get_format_bytes(dstFormat); + const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); + + ASSERT(dstFormat == MESA_FORMAT_AL1616 || + dstFormat == MESA_FORMAT_AL1616_REV); + ASSERT(texelBytes == 4); + + if (!ctx->_ImageTransferState && + !srcPacking->SwapBytes && + dstFormat == MESA_FORMAT_AL1616 && + baseInternalFormat == GL_LUMINANCE_ALPHA && + srcFormat == GL_LUMINANCE_ALPHA && + srcType == GL_UNSIGNED_SHORT && + littleEndian) { + /* simple memcpy path */ + memcpy_texture(ctx, dims, + dstFormat, dstAddr, dstXoffset, dstYoffset, dstZoffset, + dstRowStride, + dstImageOffsets, + srcWidth, srcHeight, srcDepth, srcFormat, srcType, + srcAddr, srcPacking); + } + else { + /* general path */ + const GLfloat *tempImage = make_temp_float_image(ctx, dims, + baseInternalFormat, + baseFormat, + srcWidth, srcHeight, srcDepth, + srcFormat, srcType, srcAddr, + srcPacking); + const GLfloat *src = tempImage; + GLint img, row, col; + if (!tempImage) + return GL_FALSE; + _mesa_adjust_image_for_convolution(ctx, dims, &srcWidth, &srcHeight); + for (img = 0; img < srcDepth; img++) { + GLubyte *dstRow = (GLubyte *) dstAddr + + dstImageOffsets[dstZoffset + img] * texelBytes + + dstYoffset * dstRowStride + + dstXoffset * texelBytes; + for (row = 0; row < srcHeight; row++) { + GLuint *dstUI = (GLuint *) dstRow; + if (dstFormat == MESA_FORMAT_AL1616) { + for (col = 0; col < srcWidth; col++) { + /* src[0] is luminance, src[1] is alpha */ + dstUI[col] = PACK_COLOR_88( FLOAT_TO_USHORT(src[1]), + FLOAT_TO_USHORT(src[0]) ); + src += 2; + } + } + else { + for (col = 0; col < srcWidth; col++) { + /* src[0] is luminance, src[1] is alpha */ + dstUI[col] = PACK_COLOR_1616_REV( FLOAT_TO_UBYTE(src[1]), + FLOAT_TO_UBYTE(src[0]) ); + src += 2; + } + } + dstRow += dstRowStride; + } + } + _mesa_free((void *) tempImage); + } + return GL_TRUE; +} + + static GLboolean _mesa_texstore_rgb332(TEXSTORE_PARAMS) { @@ -3073,6 +3144,8 @@ texstore_funcs[MESA_FORMAT_COUNT] = { MESA_FORMAT_ARGB1555_REV, _mesa_texstore_argb1555 }, { MESA_FORMAT_AL88, _mesa_texstore_al88 }, { MESA_FORMAT_AL88_REV, _mesa_texstore_al88 }, + { MESA_FORMAT_AL1616, _mesa_texstore_al1616 }, + { MESA_FORMAT_AL1616_REV, _mesa_texstore_al1616 }, { MESA_FORMAT_RGB332, _mesa_texstore_rgb332 }, { MESA_FORMAT_A8, _mesa_texstore_a8 }, { MESA_FORMAT_L8, _mesa_texstore_a8 }, -- cgit v1.2.3 From 12982e381d3474c5c00f89cc442d442df097339b Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 16 Nov 2009 14:53:36 -0800 Subject: AL1616: Enable MESA_FORMAT_AL1616 for software paths --- src/mesa/main/texformat.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index 39c561e278..1a374e7bee 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -115,11 +115,13 @@ _mesa_choose_tex_format( GLcontext *ctx, GLint internalFormat, case GL_LUMINANCE_ALPHA: case GL_LUMINANCE4_ALPHA4: case GL_LUMINANCE6_ALPHA2: + case GL_LUMINANCE8_ALPHA8: + return MESA_FORMAT_AL88; + case GL_LUMINANCE12_ALPHA4: case GL_LUMINANCE12_ALPHA12: case GL_LUMINANCE16_ALPHA16: - case GL_LUMINANCE8_ALPHA8: - return MESA_FORMAT_AL88; + return MESA_FORMAT_AL1616; case GL_INTENSITY: case GL_INTENSITY4: -- cgit v1.2.3 From b1616b2a811b9a161d1ee2a8251e0efe32a8c192 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 16 Nov 2009 14:56:17 -0800 Subject: Move 'static' to start of declaration to silence compiler warning --- src/mesa/main/texstore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index f43e216bc5..7cf3287713 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -3121,7 +3121,7 @@ _mesa_texstore_sla8(TEXSTORE_PARAMS) * Table mapping MESA_FORMAT_8 to _mesa_texstore_*() * XXX this is somewhat temporary. */ -const static struct { +static const struct { gl_format Name; StoreTexImageFunc Store; } -- cgit v1.2.3 From fdfbae3381553fc93202560abe3b41b4d543f0bf Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 16 Nov 2009 15:09:24 -0800 Subject: i965: Use MESA_FORMAT_AL1616 when appropriate --- src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 3 +++ src/mesa/drivers/dri/intel/intel_tex_format.c | 12 +++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index e2f0a383e7..47035cc6fc 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -86,6 +86,9 @@ static GLuint translate_tex_format( gl_format mesa_format, case MESA_FORMAT_AL88: return BRW_SURFACEFORMAT_L8A8_UNORM; + case MESA_FORMAT_AL1616: + return BRW_SURFACEFORMAT_L16A16_UNORM; + case MESA_FORMAT_RGB888: assert(0); /* not supported for sampling */ return BRW_SURFACEFORMAT_R8G8B8_UNORM; diff --git a/src/mesa/drivers/dri/intel/intel_tex_format.c b/src/mesa/drivers/dri/intel/intel_tex_format.c index f37a545c7f..bfa3dba1f5 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_format.c +++ b/src/mesa/drivers/dri/intel/intel_tex_format.c @@ -95,14 +95,20 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat, case GL_COMPRESSED_LUMINANCE: return MESA_FORMAT_L8; + case GL_LUMINANCE12_ALPHA4: + case GL_LUMINANCE12_ALPHA12: + case GL_LUMINANCE16_ALPHA16: +#ifndef I915 + return MESA_FORMAT_AL1616; +#else + /* FALLTHROUGH */ +#endif + case 2: case GL_LUMINANCE_ALPHA: case GL_LUMINANCE4_ALPHA4: case GL_LUMINANCE6_ALPHA2: case GL_LUMINANCE8_ALPHA8: - case GL_LUMINANCE12_ALPHA4: - case GL_LUMINANCE12_ALPHA12: - case GL_LUMINANCE16_ALPHA16: case GL_COMPRESSED_LUMINANCE_ALPHA: return MESA_FORMAT_AL88; -- cgit v1.2.3 From e015a4c29bf61077a50780cc99381510671b20ec Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 17 Nov 2009 16:06:26 +1000 Subject: radeon: rn50's have no 3D engine so don't try and init 3D driver. --- src/mesa/drivers/dri/radeon/radeon_screen.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 7a124a8be6..2bcceb16d6 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -390,12 +390,14 @@ static int radeon_set_screen_flags(radeonScreenPtr screen, int device_id) screen->device_id = device_id; screen->chip_flags = 0; switch ( device_id ) { + case PCI_CHIP_RN50_515E: + case PCI_CHIP_RN50_5969: + return -1; + case PCI_CHIP_RADEON_LY: case PCI_CHIP_RADEON_LZ: case PCI_CHIP_RADEON_QY: case PCI_CHIP_RADEON_QZ: - case PCI_CHIP_RN50_515E: - case PCI_CHIP_RN50_5969: screen->chip_family = CHIP_FAMILY_RV100; break; -- cgit v1.2.3 From 2d0c2952566810ef1b277b49b064f4874a973112 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Tue, 17 Nov 2009 08:05:22 +0100 Subject: Add MESA_FORMAT_XRGB8888_REV. --- src/mesa/main/formats.c | 9 +++++++++ src/mesa/main/formats.h | 1 + src/mesa/main/texfetch.c | 7 +++++++ src/mesa/main/texfetch_tmp.h | 24 ++++++++++++++++++++++++ src/mesa/main/texstore.c | 11 ++++++++--- 5 files changed, 49 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index 7d64c462b1..329b795074 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -132,6 +132,15 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ 1, 1, 4 /* BlockWidth/Height,Bytes */ }, + { + MESA_FORMAT_XRGB8888_REV, /* Name */ + "MESA_FORMAT_XRGB8888_REV", /* StrName */ + GL_RGB, /* BaseFormat */ + GL_UNSIGNED_NORMALIZED, /* DataType */ + 8, 8, 8, 0, /* Red/Green/Blue/AlphaBits */ + 0, 0, 0, 0, 0, /* Lum/Int/Index/Depth/StencilBits */ + 1, 1, 4 /* BlockWidth/Height,Bytes */ + }, { MESA_FORMAT_RGB888, /* Name */ "MESA_FORMAT_RGB888", /* StrName */ diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index d3ac436b1b..eba28a69be 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -55,6 +55,7 @@ typedef enum MESA_FORMAT_ARGB8888, /* AAAA AAAA RRRR RRRR GGGG GGGG BBBB BBBB */ MESA_FORMAT_ARGB8888_REV, /* BBBB BBBB GGGG GGGG RRRR RRRR AAAA AAAA */ MESA_FORMAT_XRGB8888, /* xxxx xxxx RRRR RRRR GGGG GGGG BBBB BBBB */ + MESA_FORMAT_XRGB8888_REV, /* BBBB BBBB GGGG GGGG RRRR RRRR xxxx xxxx */ MESA_FORMAT_RGB888, /* RRRR RRRR GGGG GGGG BBBB BBBB */ MESA_FORMAT_BGR888, /* BBBB BBBB GGGG GGGG RRRR RRRR */ MESA_FORMAT_RGB565, /* RRRR RGGG GGGB BBBB */ diff --git a/src/mesa/main/texfetch.c b/src/mesa/main/texfetch.c index c431d3a1db..f4f2be48c3 100644 --- a/src/mesa/main/texfetch.c +++ b/src/mesa/main/texfetch.c @@ -375,6 +375,13 @@ texfetch_funcs[MESA_FORMAT_COUNT] = fetch_texel_3d_f_xrgb8888, store_texel_xrgb8888 }, + { + MESA_FORMAT_XRGB8888_REV, + fetch_texel_1d_f_xrgb8888_rev, + fetch_texel_2d_f_xrgb8888_rev, + fetch_texel_3d_f_xrgb8888_rev, + store_texel_xrgb8888_rev, + }, { MESA_FORMAT_RGB888, fetch_texel_1d_f_rgb888, diff --git a/src/mesa/main/texfetch_tmp.h b/src/mesa/main/texfetch_tmp.h index 093e0abc49..6fac7ba1e1 100644 --- a/src/mesa/main/texfetch_tmp.h +++ b/src/mesa/main/texfetch_tmp.h @@ -559,6 +559,30 @@ static void store_texel_xrgb8888(struct gl_texture_image *texImage, #endif +/* MESA_FORMAT_XRGB8888_REV **************************************************/ + +/* Fetch texel from 1D, 2D or 3D xrgb8888_rev texture, return 4 GLfloats */ +static void FETCH(f_xrgb8888_rev)( const struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, GLfloat *texel ) +{ + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + texel[RCOMP] = UBYTE_TO_FLOAT( (s >> 8) & 0xff ); + texel[GCOMP] = UBYTE_TO_FLOAT( (s >> 16) & 0xff ); + texel[BCOMP] = UBYTE_TO_FLOAT( (s >> 24) ); + texel[ACOMP] = 1.0f; +} + +#if DIM == 3 +static void store_texel_xrgb8888_rev(struct gl_texture_image *texImage, + GLint i, GLint j, GLint k, const void *texel) +{ + const GLubyte *rgba = (const GLubyte *) texel; + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); + *dst = PACK_COLOR_8888(rgba[BCOMP], rgba[GCOMP], rgba[RCOMP], 0xff); +} +#endif + + /* MESA_FORMAT_RGB888 ********************************************************/ /* Fetch texel from 1D, 2D or 3D rgb888 texture, return 4 GLchans */ diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 7cf3287713..abb4ed2663 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -1410,7 +1410,8 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) ASSERT(dstFormat == MESA_FORMAT_ARGB8888 || dstFormat == MESA_FORMAT_ARGB8888_REV || - dstFormat == MESA_FORMAT_XRGB8888); + dstFormat == MESA_FORMAT_XRGB8888 || + dstFormat == MESA_FORMAT_XRGB8888_REV ); ASSERT(texelBytes == 4); if (!ctx->_ImageTransferState && @@ -1431,7 +1432,8 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) } else if (!ctx->_ImageTransferState && !srcPacking->SwapBytes && - dstFormat == MESA_FORMAT_ARGB8888_REV && + (dstFormat == MESA_FORMAT_ARGB8888_REV || + dstFormat == MESA_FORMAT_XRGB8888_REV) && baseInternalFormat == GL_RGBA && srcFormat == GL_BGRA && ((srcType == GL_UNSIGNED_BYTE && !littleEndian) || @@ -1524,7 +1526,8 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) */ if ((littleEndian && dstFormat == MESA_FORMAT_ARGB8888) || (littleEndian && dstFormat == MESA_FORMAT_XRGB8888) || - (!littleEndian && dstFormat == MESA_FORMAT_ARGB8888_REV)) { + (!littleEndian && dstFormat == MESA_FORMAT_ARGB8888_REV) || + (!littleEndian && dstFormat == MESA_FORMAT_XRGB8888_REV)) { dstmap[3] = 3; /* alpha */ dstmap[2] = 0; /* red */ dstmap[1] = 1; /* green */ @@ -1533,6 +1536,7 @@ _mesa_texstore_argb8888(TEXSTORE_PARAMS) else { assert((littleEndian && dstFormat == MESA_FORMAT_ARGB8888_REV) || (!littleEndian && dstFormat == MESA_FORMAT_ARGB8888) || + (littleEndian && dstFormat == MESA_FORMAT_XRGB8888_REV) || (!littleEndian && dstFormat == MESA_FORMAT_XRGB8888)); dstmap[3] = 2; dstmap[2] = 1; @@ -3133,6 +3137,7 @@ texstore_funcs[MESA_FORMAT_COUNT] = { MESA_FORMAT_ARGB8888, _mesa_texstore_argb8888 }, { MESA_FORMAT_ARGB8888_REV, _mesa_texstore_argb8888 }, { MESA_FORMAT_XRGB8888, _mesa_texstore_argb8888 }, + { MESA_FORMAT_XRGB8888_REV, _mesa_texstore_argb8888 }, { MESA_FORMAT_RGB888, _mesa_texstore_rgb888 }, { MESA_FORMAT_BGR888, _mesa_texstore_bgr888 }, { MESA_FORMAT_RGB565, _mesa_texstore_rgb565 }, -- cgit v1.2.3 From f2651264d385fb31f89859fc1287ca0e41835cf4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Tue, 17 Nov 2009 08:05:22 +0100 Subject: radeon: FBO fixes for big endian. --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 15 +++++++++++++ src/mesa/drivers/dri/radeon/radeon_fbo.c | 34 ++++++++++++++++++++++------- src/mesa/drivers/dri/radeon/radeon_screen.c | 6 ++--- 3 files changed, 44 insertions(+), 11 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index 1e2a54f634..c7996eb76a 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -281,12 +281,27 @@ static void emit_cb_offset(GLcontext *ctx, struct radeon_state_atom * atom) cbpitch |= R300_COLOR_FORMAT_ARGB8888; else switch (rrb->base.Format) { case MESA_FORMAT_RGB565: + assert(_mesa_little_endian()); + cbpitch |= R300_COLOR_FORMAT_RGB565; + break; + case MESA_FORMAT_RGB565_REV: + assert(!_mesa_little_endian()); cbpitch |= R300_COLOR_FORMAT_RGB565; break; case MESA_FORMAT_ARGB4444: + assert(_mesa_little_endian()); + cbpitch |= R300_COLOR_FORMAT_ARGB4444; + break; + case MESA_FORMAT_ARGB4444_REV: + assert(!_mesa_little_endian()); cbpitch |= R300_COLOR_FORMAT_ARGB4444; break; case MESA_FORMAT_ARGB1555: + assert(_mesa_little_endian()); + cbpitch |= R300_COLOR_FORMAT_ARGB1555; + break; + case MESA_FORMAT_ARGB1555_REV: + assert(!_mesa_little_endian()); cbpitch |= R300_COLOR_FORMAT_ARGB1555; break; default: diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index bf69cd9337..7ec641ff18 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -90,7 +90,7 @@ radeon_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_R3_G3_B2: case GL_RGB4: case GL_RGB5: - rb->Format = MESA_FORMAT_RGB565; + rb->Format = _dri_texformat_rgb565; rb->DataType = GL_UNSIGNED_BYTE; cpp = 2; break; @@ -99,7 +99,7 @@ radeon_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_RGB10: case GL_RGB12: case GL_RGB16: - rb->Format = MESA_FORMAT_ARGB8888; + rb->Format = _dri_texformat_argb8888; rb->DataType = GL_UNSIGNED_BYTE; cpp = 4; break; @@ -111,7 +111,7 @@ radeon_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_RGB10_A2: case GL_RGBA12: case GL_RGBA16: - rb->Format = MESA_FORMAT_ARGB8888; + rb->Format = _dri_texformat_argb8888; rb->DataType = GL_UNSIGNED_BYTE; cpp = 4; break; @@ -261,14 +261,32 @@ radeon_create_renderbuffer(gl_format format, __DRIdrawablePrivate *driDrawPriv) switch (format) { case MESA_FORMAT_RGB565: + assert(_mesa_little_endian()); + rrb->base.DataType = GL_UNSIGNED_BYTE; + rrb->base._BaseFormat = GL_RGB; + break; + case MESA_FORMAT_RGB565_REV: + assert(!_mesa_little_endian()); rrb->base.DataType = GL_UNSIGNED_BYTE; rrb->base._BaseFormat = GL_RGB; break; case MESA_FORMAT_XRGB8888: + assert(_mesa_little_endian()); + rrb->base.DataType = GL_UNSIGNED_BYTE; + rrb->base._BaseFormat = GL_RGB; + break; + case MESA_FORMAT_XRGB8888_REV: + assert(!_mesa_little_endian()); rrb->base.DataType = GL_UNSIGNED_BYTE; rrb->base._BaseFormat = GL_RGB; break; case MESA_FORMAT_ARGB8888: + assert(_mesa_little_endian()); + rrb->base.DataType = GL_UNSIGNED_BYTE; + rrb->base._BaseFormat = GL_RGBA; + break; + case MESA_FORMAT_ARGB8888_REV: + assert(!_mesa_little_endian()); rrb->base.DataType = GL_UNSIGNED_BYTE; rrb->base._BaseFormat = GL_RGBA; break; @@ -359,21 +377,21 @@ radeon_update_wrapper(GLcontext *ctx, struct radeon_renderbuffer *rrb, gl_format texFormat; restart: - if (texImage->TexFormat == MESA_FORMAT_ARGB8888) { + if (texImage->TexFormat == _dri_texformat_argb8888) { rrb->base.DataType = GL_UNSIGNED_BYTE; DBG("Render to RGBA8 texture OK\n"); } - else if (texImage->TexFormat == MESA_FORMAT_RGB565) { + else if (texImage->TexFormat == _dri_texformat_rgb565) { rrb->base.DataType = GL_UNSIGNED_BYTE; DBG("Render to RGB5 texture OK\n"); } - else if (texImage->TexFormat == MESA_FORMAT_ARGB1555) { + else if (texImage->TexFormat == _dri_texformat_argb1555) { rrb->base.DataType = GL_UNSIGNED_BYTE; DBG("Render to ARGB1555 texture OK\n"); } - else if (texImage->TexFormat == MESA_FORMAT_ARGB4444) { + else if (texImage->TexFormat == _dri_texformat_argb4444) { rrb->base.DataType = GL_UNSIGNED_BYTE; - DBG("Render to ARGB1555 texture OK\n"); + DBG("Render to ARGB4444 texture OK\n"); } else if (texImage->TexFormat == MESA_FORMAT_Z16) { rrb->base.DataType = GL_UNSIGNED_SHORT; diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 2bcceb16d6..be2d8365ef 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -1484,11 +1484,11 @@ radeonCreateBuffer( __DRIscreenPrivate *driScrnPriv, _mesa_initialize_framebuffer(&rfb->base, mesaVis); if (mesaVis->redBits == 5) - rgbFormat = MESA_FORMAT_RGB565; + rgbFormat = _mesa_little_endian() ? MESA_FORMAT_RGB565 : MESA_FORMAT_RGB565_REV; else if (mesaVis->alphaBits == 0) - rgbFormat = MESA_FORMAT_XRGB8888; + rgbFormat = _mesa_little_endian() ? MESA_FORMAT_XRGB8888 : MESA_FORMAT_XRGB8888_REV; else - rgbFormat = MESA_FORMAT_ARGB8888; + rgbFormat = _mesa_little_endian() ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_ARGB8888_REV; /* front color renderbuffer */ rfb->color_rb[0] = radeon_create_renderbuffer(rgbFormat, driDrawPriv); -- cgit v1.2.3 From 22627654256ee09bfd659624568865a79eb725b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Tue, 17 Nov 2009 08:05:23 +0100 Subject: radeon: Fix software fallbacks with KMS on big endian. --- src/mesa/drivers/dri/common/spantmp2.h | 152 ++++++++++++++++++++++++++++++ src/mesa/drivers/dri/radeon/radeon_span.c | 63 +++++++++++++ 2 files changed, 215 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/common/spantmp2.h b/src/mesa/drivers/dri/common/spantmp2.h index 89c815722f..dd5e29f8ce 100644 --- a/src/mesa/drivers/dri/common/spantmp2.h +++ b/src/mesa/drivers/dri/common/spantmp2.h @@ -82,6 +82,71 @@ rgba[3] = 0xff; \ } while (0) +#elif (SPANTMP_PIXEL_FMT == GL_RGB) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_5_6_5_REV) + +/** + ** GL_RGB, GL_UNSIGNED_SHORT_5_6_5_REV + **/ + +#ifndef GET_VALUE +#ifndef GET_PTR +#define GET_PTR(_x, _y) (buf + (_x) * 2 + (_y) * pitch) +#endif + +#define GET_VALUE(_x, _y) *(volatile GLushort *)(GET_PTR(_x, _y)) +#define PUT_VALUE(_x, _y, _v) *(volatile GLushort *)(GET_PTR(_x, _y)) = (_v) +#endif /* GET_VALUE */ + +#define INIT_MONO_PIXEL(p, color) \ + p = PACK_COLOR_565_REV( color[0], color[1], color[2] ) + +#define WRITE_RGBA( _x, _y, r, g, b, a ) \ + PUT_VALUE(_x, _y, PACK_COLOR_565_REV( r, g, b )) + +#define WRITE_PIXEL( _x, _y, p ) PUT_VALUE(_x, _y, p) + +#define READ_RGBA( rgba, _x, _y ) \ + do { \ + GLushort p = bswap_16(GET_VALUE(_x, _y)); \ + rgba[0] = ((p >> 8) & 0xf8) * 255 / 0xf8; \ + rgba[1] = ((p >> 3) & 0xfc) * 255 / 0xfc; \ + rgba[2] = ((p << 3) & 0xf8) * 255 / 0xf8; \ + rgba[3] = 0xff; \ + } while (0) + +#elif (SPANTMP_PIXEL_FMT == GL_BGRA) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_4_4_4_4) + +/** + ** GL_BGRA, GL_UNSIGNED_SHORT_4_4_4_4 + **/ + +#ifndef GET_VALUE +#ifndef GET_PTR +#define GET_PTR(_x, _y) (buf + (_x) * 2 + (_y) * pitch) +#endif + +#define GET_VALUE(_x, _y) *(volatile GLushort *)(GET_PTR(_x, _y)) +#define PUT_VALUE(_x, _y, _v) *(volatile GLushort *)(GET_PTR(_x, _y)) = (_v) +#endif /* GET_VALUE */ + +#define INIT_MONO_PIXEL(p, color) \ + p = PACK_COLOR_4444_REV(color[3], color[0], color[1], color[2]) + +#define WRITE_RGBA( _x, _y, r, g, b, a ) \ + PUT_VALUE(_x, _y, PACK_COLOR_4444_REV(a, r, g, b)) \ + +#define WRITE_PIXEL( _x, _y, p ) PUT_VALUE(_x, _y, p) + +#define READ_RGBA( rgba, _x, _y ) \ + do { \ + GLushort p = GET_VALUE(_x, _y); \ + rgba[0] = ((p >> 0) & 0xf) * 0x11; \ + rgba[1] = ((p >> 12) & 0xf) * 0x11; \ + rgba[2] = ((p >> 4) & 0xf) * 0x11; \ + rgba[3] = ((p >> 8) & 0xf) * 0x11; \ + } while (0) + + #elif (SPANTMP_PIXEL_FMT == GL_BGRA) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_4_4_4_4_REV) /** @@ -147,6 +212,38 @@ rgba[3] = ((p >> 15) & 0x1) * 0xff; \ } while (0) +#elif (SPANTMP_PIXEL_FMT == GL_BGRA) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_SHORT_1_5_5_5) + +/** + ** GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5 + **/ + +#ifndef GET_VALUE +#ifndef GET_PTR +#define GET_PTR(_x, _y) (buf + (_x) * 2 + (_y) * pitch) +#endif + +#define GET_VALUE(_x, _y) *(volatile GLushort *)(GET_PTR(_x, _y)) +#define PUT_VALUE(_x, _y, _v) *(volatile GLushort *)(GET_PTR(_x, _y)) = (_v) +#endif /* GET_VALUE */ + +#define INIT_MONO_PIXEL(p, color) \ + p = PACK_COLOR_1555_REV(color[3], color[0], color[1], color[2]) + +#define WRITE_RGBA( _x, _y, r, g, b, a ) \ + PUT_VALUE(_x, _y, PACK_COLOR_1555_REV(a, r, g, b)) \ + +#define WRITE_PIXEL( _x, _y, p ) PUT_VALUE(_x, _y, p) + +#define READ_RGBA( rgba, _x, _y ) \ + do { \ + GLushort p = bswap_16(GET_VALUE(_x, _y)); \ + rgba[0] = ((p >> 7) & 0xf8) * 255 / 0xf8; \ + rgba[1] = ((p >> 2) & 0xf8) * 255 / 0xf8; \ + rgba[2] = ((p << 3) & 0xf8) * 255 / 0xf8; \ + rgba[3] = ((p >> 15) & 0x1) * 0xff; \ + } while (0) + #elif (SPANTMP_PIXEL_FMT == GL_BGRA) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV) /** @@ -202,6 +299,61 @@ } while (0) # endif +#elif (SPANTMP_PIXEL_FMT == GL_BGRA) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8) + +/** + ** GL_BGRA, GL_UNSIGNED_INT_8_8_8_8 + **/ + +#ifndef GET_VALUE +#ifndef GET_PTR +#define GET_PTR(_x, _y) ( buf + (_x) * 4 + (_y) * pitch) +#endif + +#define GET_VALUE(_x, _y) *(volatile GLuint *)(GET_PTR(_x, _y)) +#define PUT_VALUE(_x, _y, _v) *(volatile GLuint *)(GET_PTR(_x, _y)) = (_v) +#endif /* GET_VALUE */ + +# define INIT_MONO_PIXEL(p, color) \ + p = PACK_COLOR_8888(color[2], color[1], color[0], color[3]) + +# define WRITE_RGBA(_x, _y, r, g, b, a) \ + PUT_VALUE(_x, _y, ((r << 8) | \ + (g << 16) | \ + (b << 24) | \ + (a << 0))) + +#define WRITE_PIXEL(_x, _y, p) PUT_VALUE(_x, _y, p) + +# if defined( USE_X86_ASM ) +# define READ_RGBA(rgba, _x, _y) \ + do { \ + GLuint p = GET_VALUE(_x, _y); \ + __asm__ __volatile__( "rorl $8, %0" \ + : "=r" (p) : "0" (p) ); \ + ((GLuint *)rgba)[0] = p; \ + } while (0) +# elif defined( MESA_BIG_ENDIAN ) + /* On PowerPC with GCC 3.4.2 the shift madness below becomes a single + * rotlwi instruction. It also produces good code on SPARC. + */ +# define READ_RGBA( rgba, _x, _y ) \ + do { \ + GLuint p = CPU_TO_LE32(GET_VALUE(_x, _y)); \ + GLuint t = p; \ + *((uint32_t *) rgba) = (t >> 24) | (p << 8); \ + } while (0) +# else +# define READ_RGBA( rgba, _x, _y ) \ + do { \ + GLuint p = GET_VALUE(_x, _y); \ + rgba[0] = (p >> 8) & 0xff; \ + rgba[1] = (p >> 16) & 0xff; \ + rgba[2] = (p >> 24) & 0xff; \ + rgba[3] = (p >> 0) & 0xff; \ + } while (0) +# endif + #else #error SPANTMP_PIXEL_FMT must be set to a valid value! #endif diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c b/src/mesa/drivers/dri/radeon/radeon_span.c index 2bc7d31254..30a8762586 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.c +++ b/src/mesa/drivers/dri/radeon/radeon_span.c @@ -41,6 +41,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include "main/glheader.h" +#include "main/texformat.h" #include "swrast/swrast.h" #include "radeon_common.h" @@ -400,6 +401,18 @@ static GLubyte *radeon_ptr_2byte_8x2(const struct radeon_renderbuffer * rrb, #endif #include "spantmp2.h" +#define SPANTMP_PIXEL_FMT GL_RGB +#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_5_6_5_REV + +#define TAG(x) radeon##x##_RGB565_REV +#define TAG2(x,y) radeon##x##_RGB565_REV##y +#if defined(RADEON_R600) +#define GET_PTR(X,Y) r600_ptr_color(rrb, (X) + x_off, (Y) + y_off) +#else +#define GET_PTR(X,Y) radeon_ptr_2byte_8x2(rrb, (X) + x_off, (Y) + y_off) +#endif +#include "spantmp2.h" + /* 16 bit, ARGB1555 color spanline and pixel functions */ #define SPANTMP_PIXEL_FMT GL_BGRA @@ -414,6 +427,14 @@ static GLubyte *radeon_ptr_2byte_8x2(const struct radeon_renderbuffer * rrb, #endif #include "spantmp2.h" +#define SPANTMP_PIXEL_FMT GL_BGRA +#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_1_5_5_5 + +#define TAG(x) radeon##x##_ARGB1555_REV +#define TAG2(x,y) radeon##x##_ARGB1555_REV##y +#define GET_PTR(X,Y) radeon_ptr_2byte_8x2(rrb, (X) + x_off, (Y) + y_off) +#include "spantmp2.h" + /* 16 bit, RGBA4 color spanline and pixel functions */ #define SPANTMP_PIXEL_FMT GL_BGRA @@ -428,6 +449,14 @@ static GLubyte *radeon_ptr_2byte_8x2(const struct radeon_renderbuffer * rrb, #endif #include "spantmp2.h" +#define SPANTMP_PIXEL_FMT GL_BGRA +#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_SHORT_4_4_4_4 + +#define TAG(x) radeon##x##_ARGB4444_REV +#define TAG2(x,y) radeon##x##_ARGB4444_REV##y +#define GET_PTR(X,Y) radeon_ptr_2byte_8x2(rrb, (X) + x_off, (Y) + y_off) +#include "spantmp2.h" + /* 32 bit, xRGB8888 color spanline and pixel functions */ #define SPANTMP_PIXEL_FMT GL_BGRA @@ -472,6 +501,30 @@ static GLubyte *radeon_ptr_2byte_8x2(const struct radeon_renderbuffer * rrb, #endif #include "spantmp2.h" +/* 32 bit, BGRx8888 color spanline and pixel functions + */ +#define SPANTMP_PIXEL_FMT GL_BGRA +#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8 + +#define TAG(x) radeon##x##_BGRx8888 +#define TAG2(x,y) radeon##x##_BGRx8888##y +#define GET_VALUE(_x, _y) ((*(GLuint*)(radeon_ptr_4byte(rrb, _x + x_off, _y + y_off)) | 0x000000ff)) +#define PUT_VALUE(_x, _y, d) { \ + GLuint *_ptr = (GLuint*)radeon_ptr_4byte( rrb, _x + x_off, _y + y_off ); \ + *_ptr = d; \ +} while (0) +#include "spantmp2.h" + +/* 32 bit, BGRA8888 color spanline and pixel functions + */ +#define SPANTMP_PIXEL_FMT GL_BGRA +#define SPANTMP_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8 + +#define TAG(x) radeon##x##_BGRA8888 +#define TAG2(x,y) radeon##x##_BGRA8888##y +#define GET_PTR(X,Y) radeon_ptr_4byte(rrb, (X) + x_off, (Y) + y_off) +#include "spantmp2.h" + /* ================================================================ * Depth buffer */ @@ -848,14 +901,24 @@ static void radeonSetSpanFunctions(struct radeon_renderbuffer *rrb) { if (rrb->base.Format == MESA_FORMAT_RGB565) { radeonInitPointers_RGB565(&rrb->base); + } else if (rrb->base.Format == MESA_FORMAT_RGB565_REV) { + radeonInitPointers_RGB565_REV(&rrb->base); } else if (rrb->base.Format == MESA_FORMAT_XRGB8888) { radeonInitPointers_xRGB8888(&rrb->base); + } else if (rrb->base.Format == MESA_FORMAT_XRGB8888_REV) { + radeonInitPointers_BGRx8888(&rrb->base); } else if (rrb->base.Format == MESA_FORMAT_ARGB8888) { radeonInitPointers_ARGB8888(&rrb->base); + } else if (rrb->base.Format == MESA_FORMAT_ARGB8888_REV) { + radeonInitPointers_BGRA8888(&rrb->base); } else if (rrb->base.Format == MESA_FORMAT_ARGB4444) { radeonInitPointers_ARGB4444(&rrb->base); + } else if (rrb->base.Format == MESA_FORMAT_ARGB4444_REV) { + radeonInitPointers_ARGB4444_REV(&rrb->base); } else if (rrb->base.Format == MESA_FORMAT_ARGB1555) { radeonInitPointers_ARGB1555(&rrb->base); + } else if (rrb->base.Format == MESA_FORMAT_ARGB1555_REV) { + radeonInitPointers_ARGB1555_REV(&rrb->base); } else if (rrb->base.Format == MESA_FORMAT_Z16) { radeonInitDepthPointers_z16(&rrb->base); } else if (rrb->base.Format == MESA_FORMAT_X8_Z24) { -- cgit v1.2.3 From 592ce48ce9eecfdd74f59e52c8d51bdb62059e3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Tue, 17 Nov 2009 08:05:24 +0100 Subject: radeon: Fix occlusion queries on big endian. --- src/mesa/drivers/dri/radeon/radeon_queryobj.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_queryobj.c b/src/mesa/drivers/dri/radeon/radeon_queryobj.c index 6539c36268..452d0446f9 100644 --- a/src/mesa/drivers/dri/radeon/radeon_queryobj.c +++ b/src/mesa/drivers/dri/radeon/radeon_queryobj.c @@ -49,6 +49,7 @@ static void radeonQueryGetResult(GLcontext *ctx, struct gl_query_object *q) { radeonContextPtr radeon = RADEON_CONTEXT(ctx); struct radeon_query_object *query = (struct radeon_query_object *)q; + uint32_t *result; int i; radeon_print(RADEON_STATE, RADEON_VERBOSE, @@ -56,6 +57,7 @@ static void radeonQueryGetResult(GLcontext *ctx, struct gl_query_object *q) __FUNCTION__, query->Base.Id, (int) query->Base.Result); radeon_bo_map(query->bo, GL_FALSE); + result = query->bo->ptr; query->Base.Result = 0; if (IS_R600_CLASS(radeon->radeonScreen)) { @@ -66,10 +68,11 @@ static void radeonQueryGetResult(GLcontext *ctx, struct gl_query_object *q) * hw writes zpass end counts to qwords 1, 3, 5, 7. * then we substract. MSB is the valid bit. */ - uint64_t *result = query->bo->ptr; - for (i = 0; i < 8; i += 2) { - uint64_t start = result[i]; - uint64_t end = result[i + 1]; + for (i = 0; i < 16; i += 4) { + uint64_t start = (uint64_t)LE32_TO_CPU(result[i]) | + (uint64_t)LE32_TO_CPU(result[i + 1]) << 32; + uint64_t end = (uint64_t)LE32_TO_CPU(result[i + 2]) | + (uint64_t)LE32_TO_CPU(result[i + 3]) << 32; if ((start & 0x8000000000000000) && (end & 0x8000000000000000)) { uint64_t query_count = end - start; query->Base.Result += query_count; @@ -79,10 +82,9 @@ static void radeonQueryGetResult(GLcontext *ctx, struct gl_query_object *q) "%d start: %lx, end: %lx %ld\n", i, start, end, end - start); } } else { - uint32_t *result = query->bo->ptr; for (i = 0; i < query->curr_offset/sizeof(uint32_t); ++i) { - query->Base.Result += result[i]; - radeon_print(RADEON_STATE, RADEON_TRACE, "result[%d] = %d\n", i, result[i]); + query->Base.Result += LE32_TO_CPU(result[i]); + radeon_print(RADEON_STATE, RADEON_TRACE, "result[%d] = %d\n", i, LE32_TO_CPU(result[i])); } } -- cgit v1.2.3 From 081bf9563fca3f64aed8676f20d17af3eb115016 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Tue, 17 Nov 2009 08:05:24 +0100 Subject: radeon: Depth/stencil span code fixes for big endian. Fixes e.g. text in progs/demos/arbocclude. --- src/mesa/drivers/dri/radeon/radeon_span.c | 48 +++++++++++++++---------------- 1 file changed, 24 insertions(+), 24 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c b/src/mesa/drivers/dri/radeon/radeon_span.c index 30a8762586..390d522856 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.c +++ b/src/mesa/drivers/dri/radeon/radeon_span.c @@ -579,10 +579,10 @@ static GLubyte *radeon_ptr_2byte_8x2(const struct radeon_renderbuffer * rrb, #define WRITE_DEPTH( _x, _y, d ) \ do { \ GLuint *_ptr = (GLuint*)radeon_ptr_4byte( rrb, _x + x_off, _y + y_off ); \ - GLuint tmp = *_ptr; \ + GLuint tmp = LE32_TO_CPU(*_ptr); \ tmp &= 0x000000ff; \ tmp |= ((d << 8) & 0xffffff00); \ - *_ptr = tmp; \ + *_ptr = CPU_TO_LE32(tmp); \ } while (0) #elif defined(RADEON_R600) #define WRITE_DEPTH( _x, _y, d ) \ @@ -597,26 +597,26 @@ do { \ #define WRITE_DEPTH( _x, _y, d ) \ do { \ GLuint *_ptr = (GLuint*)r200_depth_4byte( rrb, _x + x_off, _y + y_off ); \ - GLuint tmp = *_ptr; \ + GLuint tmp = LE32_TO_CPU(*_ptr); \ tmp &= 0xff000000; \ tmp |= ((d) & 0x00ffffff); \ - *_ptr = tmp; \ + *_ptr = CPU_TO_LE32(tmp); \ } while (0) #else #define WRITE_DEPTH( _x, _y, d ) \ do { \ GLuint *_ptr = (GLuint*)radeon_ptr_4byte( rrb, _x + x_off, _y + y_off ); \ - GLuint tmp = *_ptr; \ + GLuint tmp = LE32_TO_CPU(*_ptr); \ tmp &= 0xff000000; \ tmp |= ((d) & 0x00ffffff); \ - *_ptr = tmp; \ + *_ptr = CPU_TO_LE32(tmp); \ } while (0) #endif #if defined(RADEON_R300) #define READ_DEPTH( d, _x, _y ) \ do { \ - d = (*(GLuint*)(radeon_ptr_4byte(rrb, _x + x_off, _y + y_off)) & 0xffffff00) >> 8; \ + d = (LE32_TO_CPU(*(GLuint*)(radeon_ptr_4byte(rrb, _x + x_off, _y + y_off))) & 0xffffff00) >> 8; \ }while(0) #elif defined(RADEON_R600) #define READ_DEPTH( d, _x, _y ) \ @@ -626,11 +626,11 @@ do { \ #elif defined(RADEON_R200) #define READ_DEPTH( d, _x, _y ) \ do { \ - d = *(GLuint*)(r200_depth_4byte(rrb, _x + x_off, _y + y_off)) & 0x00ffffff; \ + d = LE32_TO_CPU(*(GLuint*)(r200_depth_4byte(rrb, _x + x_off, _y + y_off))) & 0x00ffffff; \ }while(0) #else #define READ_DEPTH( d, _x, _y ) \ - d = *(GLuint*)(radeon_ptr_4byte(rrb, _x + x_off, _y + y_off)) & 0x00ffffff; + d = LE32_TO_CPU(*(GLuint*)(radeon_ptr_4byte(rrb, _x + x_off, _y + y_off))) & 0x00ffffff; #endif #define TAG(x) radeon##x##_z24 @@ -648,7 +648,7 @@ do { \ #define WRITE_DEPTH( _x, _y, d ) \ do { \ GLuint *_ptr = (GLuint*)radeon_ptr_4byte( rrb, _x + x_off, _y + y_off ); \ - *_ptr = d; \ + *_ptr = CPU_TO_LE32(d); \ } while (0) #elif defined(RADEON_R600) #define WRITE_DEPTH( _x, _y, d ) \ @@ -668,20 +668,20 @@ do { \ #define WRITE_DEPTH( _x, _y, d ) \ do { \ GLuint *_ptr = (GLuint*)r200_depth_4byte( rrb, _x + x_off, _y + y_off ); \ - *_ptr = d; \ + *_ptr = CPU_TO_LE32(d); \ } while (0) #else #define WRITE_DEPTH( _x, _y, d ) \ do { \ GLuint *_ptr = (GLuint*)radeon_ptr_4byte( rrb, _x + x_off, _y + y_off ); \ - *_ptr = d; \ + *_ptr = CPU_TO_LE32(d); \ } while (0) #endif #if defined(RADEON_R300) #define READ_DEPTH( d, _x, _y ) \ do { \ - d = (*(GLuint*)(radeon_ptr_4byte(rrb, _x + x_off, _y + y_off))); \ + d = LE32_TO_CPU(*(GLuint*)(radeon_ptr_4byte(rrb, _x + x_off, _y + y_off))); \ }while(0) #elif defined(RADEON_R600) #define READ_DEPTH( d, _x, _y ) \ @@ -692,11 +692,11 @@ do { \ #elif defined(RADEON_R200) #define READ_DEPTH( d, _x, _y ) \ do { \ - d = *(GLuint*)(r200_depth_4byte(rrb, _x + x_off, _y + y_off)); \ + d = LE32_TO_CPU(*(GLuint*)(r200_depth_4byte(rrb, _x + x_off, _y + y_off))); \ }while(0) #else #define READ_DEPTH( d, _x, _y ) do { \ - d = *(GLuint*)(radeon_ptr_4byte(rrb, _x + x_off, _y + y_off )); \ + d = LE32_TO_CPU(*(GLuint*)(radeon_ptr_4byte(rrb, _x + x_off, _y + y_off))); \ } while (0) #endif @@ -713,10 +713,10 @@ do { \ #define WRITE_STENCIL( _x, _y, d ) \ do { \ GLuint *_ptr = (GLuint*)radeon_ptr_4byte(rrb, _x + x_off, _y + y_off); \ - GLuint tmp = *_ptr; \ + GLuint tmp = LE32_TO_CPU(*_ptr); \ tmp &= 0xffffff00; \ tmp |= (d) & 0xff; \ - *_ptr = tmp; \ + *_ptr = CPU_TO_LE32(tmp); \ } while (0) #elif defined(RADEON_R600) #define WRITE_STENCIL( _x, _y, d ) \ @@ -731,19 +731,19 @@ do { \ #define WRITE_STENCIL( _x, _y, d ) \ do { \ GLuint *_ptr = (GLuint*)r200_depth_4byte(rrb, _x + x_off, _y + y_off); \ - GLuint tmp = *_ptr; \ + GLuint tmp = LE32_TO_CPU(*_ptr); \ tmp &= 0x00ffffff; \ tmp |= (((d) & 0xff) << 24); \ - *_ptr = tmp; \ + *_ptr = CPU_TO_LE32(tmp); \ } while (0) #else #define WRITE_STENCIL( _x, _y, d ) \ do { \ GLuint *_ptr = (GLuint*)radeon_ptr_4byte(rrb, _x + x_off, _y + y_off); \ - GLuint tmp = *_ptr; \ + GLuint tmp = LE32_TO_CPU(*_ptr); \ tmp &= 0x00ffffff; \ tmp |= (((d) & 0xff) << 24); \ - *_ptr = tmp; \ + *_ptr = CPU_TO_LE32(tmp); \ } while (0) #endif @@ -751,7 +751,7 @@ do { \ #define READ_STENCIL( d, _x, _y ) \ do { \ GLuint *_ptr = (GLuint*)radeon_ptr_4byte( rrb, _x + x_off, _y + y_off ); \ - GLuint tmp = *_ptr; \ + GLuint tmp = LE32_TO_CPU(*_ptr); \ d = tmp & 0x000000ff; \ } while (0) #elif defined(RADEON_R600) @@ -765,14 +765,14 @@ do { \ #define READ_STENCIL( d, _x, _y ) \ do { \ GLuint *_ptr = (GLuint*)r200_depth_4byte( rrb, _x + x_off, _y + y_off ); \ - GLuint tmp = *_ptr; \ + GLuint tmp = LE32_TO_CPU(*_ptr); \ d = (tmp & 0xff000000) >> 24; \ } while (0) #else #define READ_STENCIL( d, _x, _y ) \ do { \ GLuint *_ptr = (GLuint*)radeon_ptr_4byte( rrb, _x + x_off, _y + y_off ); \ - GLuint tmp = *_ptr; \ + GLuint tmp = LE32_TO_CPU(*_ptr); \ d = (tmp & 0xff000000) >> 24; \ } while (0) #endif -- cgit v1.2.3 From 29f3e7e1d1e8cdff3596b88990ed84d7eeff6f80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Tue, 17 Nov 2009 18:47:24 +0100 Subject: r600: Attempt to fix span breakage introduced by big endian fixes. Only compile tested; I happened to notice people on IRC reporting .../r600_dri.so: undefined symbol: radeon_ptr_2byte_8x2 --- src/mesa/drivers/dri/radeon/radeon_span.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c b/src/mesa/drivers/dri/radeon/radeon_span.c index 390d522856..459ad4b34a 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.c +++ b/src/mesa/drivers/dri/radeon/radeon_span.c @@ -432,7 +432,11 @@ static GLubyte *radeon_ptr_2byte_8x2(const struct radeon_renderbuffer * rrb, #define TAG(x) radeon##x##_ARGB1555_REV #define TAG2(x,y) radeon##x##_ARGB1555_REV##y +#if defined(RADEON_R600) +#define GET_PTR(X,Y) r600_ptr_color(rrb, (X) + x_off, (Y) + y_off) +#else #define GET_PTR(X,Y) radeon_ptr_2byte_8x2(rrb, (X) + x_off, (Y) + y_off) +#endif #include "spantmp2.h" /* 16 bit, RGBA4 color spanline and pixel functions @@ -454,7 +458,11 @@ static GLubyte *radeon_ptr_2byte_8x2(const struct radeon_renderbuffer * rrb, #define TAG(x) radeon##x##_ARGB4444_REV #define TAG2(x,y) radeon##x##_ARGB4444_REV##y +#if defined(RADEON_R600) +#define GET_PTR(X,Y) r600_ptr_color(rrb, (X) + x_off, (Y) + y_off) +#else #define GET_PTR(X,Y) radeon_ptr_2byte_8x2(rrb, (X) + x_off, (Y) + y_off) +#endif #include "spantmp2.h" /* 32 bit, xRGB8888 color spanline and pixel functions -- cgit v1.2.3 From 33e93f42770e344edf1cd693a6c8115acd505a08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Tue, 17 Nov 2009 19:02:03 +0100 Subject: r600: More span breakage fixes. At least now the compiler doesn't complain about implicitly declared functions anymore... --- src/mesa/drivers/dri/radeon/radeon_span.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c b/src/mesa/drivers/dri/radeon/radeon_span.c index 459ad4b34a..b3986ef64d 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.c +++ b/src/mesa/drivers/dri/radeon/radeon_span.c @@ -516,11 +516,19 @@ static GLubyte *radeon_ptr_2byte_8x2(const struct radeon_renderbuffer * rrb, #define TAG(x) radeon##x##_BGRx8888 #define TAG2(x,y) radeon##x##_BGRx8888##y +#if defined(RADEON_R600) +#define GET_VALUE(_x, _y) ((*(GLuint*)(r600_ptr_color(rrb, _x + x_off, _y + y_off)) | 0x000000ff)) +#define PUT_VALUE(_x, _y, d) { \ + GLuint *_ptr = (GLuint*)r600_ptr_color( rrb, _x + x_off, _y + y_off ); \ + *_ptr = d; \ +} while (0) +#else #define GET_VALUE(_x, _y) ((*(GLuint*)(radeon_ptr_4byte(rrb, _x + x_off, _y + y_off)) | 0x000000ff)) #define PUT_VALUE(_x, _y, d) { \ GLuint *_ptr = (GLuint*)radeon_ptr_4byte( rrb, _x + x_off, _y + y_off ); \ *_ptr = d; \ } while (0) +#endif #include "spantmp2.h" /* 32 bit, BGRA8888 color spanline and pixel functions @@ -530,7 +538,11 @@ static GLubyte *radeon_ptr_2byte_8x2(const struct radeon_renderbuffer * rrb, #define TAG(x) radeon##x##_BGRA8888 #define TAG2(x,y) radeon##x##_BGRA8888##y +#if defined(RADEON_R600) +#define GET_PTR(X,Y) r600_ptr_color(rrb, (X) + x_off, (Y) + y_off) +#else #define GET_PTR(X,Y) radeon_ptr_4byte(rrb, (X) + x_off, (Y) + y_off) +#endif #include "spantmp2.h" /* ================================================================ -- cgit v1.2.3 From cf65d81cf1eb031384f7e8bfe849ce59c458f27e Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Mon, 9 Nov 2009 05:51:23 -0800 Subject: dri: Ensure subdirs have finished before linking driver Recursive make is hard. If there are subdirectories in the DRI drivers, it's pretty certain we want to finish building in them before linking the driver. Add a new target to serialize the rules. Signed-off-by: Dan Nicholson --- src/mesa/drivers/dri/Makefile.template | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/Makefile.template b/src/mesa/drivers/dri/Makefile.template index 1ce9315530..39d25ce3f4 100644 --- a/src/mesa/drivers/dri/Makefile.template +++ b/src/mesa/drivers/dri/Makefile.template @@ -60,9 +60,13 @@ SHARED_INCLUDES = \ ##### TARGETS ##### -default: symlinks subdirs depend $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME) +default: subdirs lib +.PHONY: lib +lib: symlinks subdirs depend + @$(MAKE) $(LIBNAME) $(TOP)/$(LIB_DIR)/$(LIBNAME) + $(LIBNAME): $(OBJECTS) $(MESA_MODULES) $(EXTRA_MODULES) $(WINOBJ) Makefile \ $(TOP)/src/mesa/drivers/dri/Makefile.template $(MKLIB) -o $@ -noprefix -linker '$(CC)' -ldflags '$(LDFLAGS)' \ -- cgit v1.2.3 From 52be96b7feb23d9d502c74c4de52dadfb546dc82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Tue, 17 Nov 2009 19:41:29 +0100 Subject: Remove unconditional use of glibc specific bswap_16() macro. Fixes unresolved symbol bswap_16 on non-glibc or little endian glibc platforms. --- src/mesa/drivers/dri/common/spantmp2.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/common/spantmp2.h b/src/mesa/drivers/dri/common/spantmp2.h index dd5e29f8ce..95f97414a9 100644 --- a/src/mesa/drivers/dri/common/spantmp2.h +++ b/src/mesa/drivers/dri/common/spantmp2.h @@ -107,7 +107,8 @@ #define READ_RGBA( rgba, _x, _y ) \ do { \ - GLushort p = bswap_16(GET_VALUE(_x, _y)); \ + GLushort p = GET_VALUE(_x, _y); \ + p = p << 8 | p >> 8; \ rgba[0] = ((p >> 8) & 0xf8) * 255 / 0xf8; \ rgba[1] = ((p >> 3) & 0xfc) * 255 / 0xfc; \ rgba[2] = ((p << 3) & 0xf8) * 255 / 0xf8; \ @@ -237,7 +238,8 @@ #define READ_RGBA( rgba, _x, _y ) \ do { \ - GLushort p = bswap_16(GET_VALUE(_x, _y)); \ + GLushort p = GET_VALUE(_x, _y); \ + p = p << 8 | p >> 8; \ rgba[0] = ((p >> 7) & 0xf8) * 255 / 0xf8; \ rgba[1] = ((p >> 2) & 0xf8) * 255 / 0xf8; \ rgba[2] = ((p << 3) & 0xf8) * 255 / 0xf8; \ -- cgit v1.2.3 From aef769207d3e554db8cc452d6ea3f678e5549cfb Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Tue, 17 Nov 2009 21:27:31 +0100 Subject: r300: fix reads and writes for MESA_FORMAT_S8Z24 buffer Regression was introduced by texformat-rework branch merge. --- src/mesa/drivers/dri/radeon/radeon_span.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_span.c b/src/mesa/drivers/dri/radeon/radeon_span.c index b3986ef64d..37904dc8dc 100644 --- a/src/mesa/drivers/dri/radeon/radeon_span.c +++ b/src/mesa/drivers/dri/radeon/radeon_span.c @@ -668,7 +668,7 @@ do { \ #define WRITE_DEPTH( _x, _y, d ) \ do { \ GLuint *_ptr = (GLuint*)radeon_ptr_4byte( rrb, _x + x_off, _y + y_off ); \ - *_ptr = CPU_TO_LE32(d); \ + *_ptr = CPU_TO_LE32((((d) & 0xff000000) >> 24) | (((d) & 0x00ffffff) << 8)); \ } while (0) #elif defined(RADEON_R600) #define WRITE_DEPTH( _x, _y, d ) \ @@ -701,7 +701,8 @@ do { \ #if defined(RADEON_R300) #define READ_DEPTH( d, _x, _y ) \ do { \ - d = LE32_TO_CPU(*(GLuint*)(radeon_ptr_4byte(rrb, _x + x_off, _y + y_off))); \ + GLuint tmp = (*(GLuint*)(radeon_ptr_4byte(rrb, _x + x_off, _y + y_off))); \ + d = LE32_TO_CPU(((tmp & 0x000000ff) << 24) | ((tmp & 0xffffff00) >> 8)); \ }while(0) #elif defined(RADEON_R600) #define READ_DEPTH( d, _x, _y ) \ -- cgit v1.2.3 From 93eb2ab8c395f81e40fa298d78805bb2c777f891 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Tue, 17 Nov 2009 19:46:37 +0100 Subject: radeon: align for mipmap tree changes --- src/mesa/drivers/dri/radeon/radeon_state_init.c | 4 ++-- src/mesa/drivers/dri/radeon/radeon_tex.c | 18 +++--------------- src/mesa/drivers/dri/radeon/radeon_texstate.c | 22 +++++++++------------- 3 files changed, 14 insertions(+), 30 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_state_init.c b/src/mesa/drivers/dri/radeon/radeon_state_init.c index 2d19220d8a..dd82888254 100644 --- a/src/mesa/drivers/dri/radeon/radeon_state_init.c +++ b/src/mesa/drivers/dri/radeon/radeon_state_init.c @@ -645,11 +645,11 @@ static void tex_emit_cs(GLcontext *ctx, struct radeon_state_atom *atom) OUT_BATCH(CP_PACKET0(RADEON_PP_TXOFFSET_0 + (24 * i), 0)); if (t->mt && !t->image_override) { if ((ctx->Texture.Unit[i]._ReallyEnabled & TEXTURE_CUBE_BIT)) { - lvl = &t->mt->levels[0]; + lvl = &t->mt->levels[t->minLod]; OUT_BATCH_RELOC(lvl->faces[5].offset, t->mt->bo, lvl->faces[5].offset, RADEON_GEM_DOMAIN_GTT|RADEON_GEM_DOMAIN_VRAM, 0, 0); } else { - OUT_BATCH_RELOC(t->tile_bits, t->mt->bo, 0, + OUT_BATCH_RELOC(t->tile_bits, t->mt->bo, get_base_teximage_offset(t), RADEON_GEM_DOMAIN_GTT|RADEON_GEM_DOMAIN_VRAM, 0, 0); } } else { diff --git a/src/mesa/drivers/dri/radeon/radeon_tex.c b/src/mesa/drivers/dri/radeon/radeon_tex.c index 60981aada2..749ab75f20 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tex.c +++ b/src/mesa/drivers/dri/radeon/radeon_tex.c @@ -348,17 +348,7 @@ static void radeonTexParameter( GLcontext *ctx, GLenum target, case GL_TEXTURE_MAX_LEVEL: case GL_TEXTURE_MIN_LOD: case GL_TEXTURE_MAX_LOD: - - /* This isn't the most efficient solution but there doesn't appear to - * be a nice alternative. Since there's no LOD clamping, - * we just have to rely on loading the right subset of mipmap levels - * to simulate a clamped LOD. - */ - if (t->mt) { - radeon_miptree_unreference(t->mt); - t->mt = 0; - t->validated = GL_FALSE; - } + t->validated = GL_FALSE; break; default: @@ -388,10 +378,8 @@ static void radeonDeleteTexture( GLcontext *ctx, } } - if (t->mt) { - radeon_miptree_unreference(t->mt); - t->mt = 0; - } + radeon_miptree_unreference(&t->mt); + /* Free mipmap images and the texture object itself */ _mesa_delete_texture_object(ctx, texObj); } diff --git a/src/mesa/drivers/dri/radeon/radeon_texstate.c b/src/mesa/drivers/dri/radeon/radeon_texstate.c index 429977a8bc..4d9eb73d20 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texstate.c +++ b/src/mesa/drivers/dri/radeon/radeon_texstate.c @@ -699,14 +699,10 @@ void radeonSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_ radeon_bo_unref(rImage->bo); rImage->bo = NULL; } - if (t->mt) { - radeon_miptree_unreference(t->mt); - t->mt = NULL; - } - if (rImage->mt) { - radeon_miptree_unreference(rImage->mt); - rImage->mt = NULL; - } + + radeon_miptree_unreference(&t->mt); + radeon_miptree_unreference(&rImage->mt); + _mesa_init_teximage_fields(radeon->glCtx, target, texImage, rb->base.Width, rb->base.Height, 1, 0, rb->cpp); texImage->RowStride = rb->pitch / rb->cpp; @@ -1021,7 +1017,7 @@ static GLboolean setup_hardware_state(r100ContextPtr rmesa, radeonTexObj *t, int return GL_TRUE; } - firstImage = t->base.Image[0][t->mt->firstLevel]; + firstImage = t->base.Image[0][t->minLod]; if (firstImage->Border > 0) { fprintf(stderr, "%s: border\n", __FUNCTION__); @@ -1049,9 +1045,9 @@ static GLboolean setup_hardware_state(r100ContextPtr rmesa, radeonTexObj *t, int return GL_FALSE; } } - + t->pp_txfilter &= ~RADEON_MAX_MIP_LEVEL_MASK; - t->pp_txfilter |= (t->mt->lastLevel - t->mt->firstLevel) << RADEON_MAX_MIP_LEVEL_SHIFT; + t->pp_txfilter |= (t->maxLod - t->minLod) << RADEON_MAX_MIP_LEVEL_SHIFT; t->pp_txformat &= ~(RADEON_TXFORMAT_WIDTH_MASK | RADEON_TXFORMAT_HEIGHT_MASK | @@ -1060,9 +1056,9 @@ static GLboolean setup_hardware_state(r100ContextPtr rmesa, radeonTexObj *t, int RADEON_TXFORMAT_F5_HEIGHT_MASK); t->pp_txformat |= ((log2Width << RADEON_TXFORMAT_WIDTH_SHIFT) | (log2Height << RADEON_TXFORMAT_HEIGHT_SHIFT)); - + t->tile_bits = 0; - + if (t->base.Target == GL_TEXTURE_CUBE_MAP) { ASSERT(log2Width == log2Height); t->pp_txformat |= ((log2Width << RADEON_TXFORMAT_F5_WIDTH_SHIFT) | -- cgit v1.2.3 From afe84fa698eae3e035e967589f0a8d55f6a83698 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Tue, 17 Nov 2009 19:46:59 +0100 Subject: r200: align for mipmap tree changes --- src/mesa/drivers/dri/r200/r200_state_init.c | 2 +- src/mesa/drivers/dri/r200/r200_tex.c | 21 +++++---------------- src/mesa/drivers/dri/r200/r200_texstate.c | 21 ++++++++------------- 3 files changed, 14 insertions(+), 30 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r200/r200_state_init.c b/src/mesa/drivers/dri/r200/r200_state_init.c index 68bfeea701..e53fd72290 100644 --- a/src/mesa/drivers/dri/r200/r200_state_init.c +++ b/src/mesa/drivers/dri/r200/r200_state_init.c @@ -640,7 +640,7 @@ static void tex_emit(GLcontext *ctx, struct radeon_state_atom *atom) OUT_BATCH_TABLE(atom->cmd, 10); if (t && t->mt && !t->image_override) { - OUT_BATCH_RELOC(t->tile_bits, t->mt->bo, 0, + OUT_BATCH_RELOC(t->tile_bits, t->mt->bo, get_base_teximage_offset(t), RADEON_GEM_DOMAIN_GTT|RADEON_GEM_DOMAIN_VRAM, 0, 0); } else if (!t) { /* workaround for old CS mechanism */ diff --git a/src/mesa/drivers/dri/r200/r200_tex.c b/src/mesa/drivers/dri/r200/r200_tex.c index 5a21a8b9c5..a417721553 100644 --- a/src/mesa/drivers/dri/r200/r200_tex.c +++ b/src/mesa/drivers/dri/r200/r200_tex.c @@ -385,16 +385,7 @@ static void r200TexParameter( GLcontext *ctx, GLenum target, case GL_TEXTURE_MAX_LEVEL: case GL_TEXTURE_MIN_LOD: case GL_TEXTURE_MAX_LOD: - /* This isn't the most efficient solution but there doesn't appear to - * be a nice alternative. Since there's no LOD clamping, - * we just have to rely on loading the right subset of mipmap levels - * to simulate a clamped LOD. - */ - if (t->mt) { - radeon_miptree_unreference(t->mt); - t->mt = 0; - t->validated = GL_FALSE; - } + t->validated = GL_FALSE; break; default: @@ -413,7 +404,7 @@ static void r200DeleteTexture(GLcontext * ctx, struct gl_texture_object *texObj) (void *)texObj, _mesa_lookup_enum_by_nr(texObj->Target)); } - + if (rmesa) { int i; radeon_firevertices(&rmesa->radeon); @@ -425,11 +416,9 @@ static void r200DeleteTexture(GLcontext * ctx, struct gl_texture_object *texObj) } } } - - if (t->mt) { - radeon_miptree_unreference(t->mt); - t->mt = 0; - } + + radeon_miptree_unreference(&t->mt); + _mesa_delete_texture_object(ctx, texObj); } diff --git a/src/mesa/drivers/dri/r200/r200_texstate.c b/src/mesa/drivers/dri/r200/r200_texstate.c index 7d0afa1add..7782404a79 100644 --- a/src/mesa/drivers/dri/r200/r200_texstate.c +++ b/src/mesa/drivers/dri/r200/r200_texstate.c @@ -824,14 +824,10 @@ void r200SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo radeon_bo_unref(rImage->bo); rImage->bo = NULL; } - if (t->mt) { - radeon_miptree_unreference(t->mt); - t->mt = NULL; - } - if (rImage->mt) { - radeon_miptree_unreference(rImage->mt); - rImage->mt = NULL; - } + + radeon_miptree_unreference(&t->mt); + radeon_miptree_unreference(&rImage->mt); + _mesa_init_teximage_fields(radeon->glCtx, target, texImage, rb->base.Width, rb->base.Height, 1, 0, rb->cpp); texImage->RowStride = rb->pitch / rb->cpp; @@ -1423,10 +1419,9 @@ void set_re_cntl_d3d( GLcontext *ctx, int unit, GLboolean use_d3d ) */ static void setup_hardware_state(r200ContextPtr rmesa, radeonTexObj *t) { - int firstlevel = t->mt ? t->mt->firstLevel : 0; - const struct gl_texture_image *firstImage = t->base.Image[0][firstlevel]; + const struct gl_texture_image *firstImage = t->base.Image[0][t->minLod]; GLint log2Width, log2Height, log2Depth, texelBytes; - + if ( t->bo ) { return; } @@ -1454,9 +1449,9 @@ static void setup_hardware_state(r200ContextPtr rmesa, radeonTexObj *t) return; } } - + t->pp_txfilter &= ~R200_MAX_MIP_LEVEL_MASK; - t->pp_txfilter |= (t->mt->lastLevel - t->mt->firstLevel) << R200_MAX_MIP_LEVEL_SHIFT; + t->pp_txfilter |= (t->maxLod - t->minLod) << R200_MAX_MIP_LEVEL_SHIFT; t->pp_txformat &= ~(R200_TXFORMAT_WIDTH_MASK | R200_TXFORMAT_HEIGHT_MASK | -- cgit v1.2.3 From e36751ec81736a8466b1a6a722c1b2cf578d713b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 17 Nov 2009 16:05:24 -0700 Subject: mesa: remove a bit of old code --- src/mesa/main/buffers.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index 7f77c5d772..7c31a46ab9 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -383,7 +383,6 @@ _mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers, if (n == 1) { GLuint count = 0, destMask0 = destMask[0]; /* init to -1 to help catch errors */ - //fb->_ColorDrawBufferIndexes[0] = -1; while (destMask0) { GLint bufIndex = _mesa_ffs(destMask0) - 1; if (fb->_ColorDrawBufferIndexes[count] != bufIndex) { -- cgit v1.2.3 From 0422053eca12b4fb912e0229c96a9d12453e31c4 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 17 Nov 2009 16:05:59 -0700 Subject: mesa: remove trailing comment to silence warning --- src/mesa/main/formats.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index eba28a69be..0eeeb8b2ba 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -140,7 +140,7 @@ typedef enum MESA_FORMAT_SIGNED_RGBA_16, /*@}*/ - MESA_FORMAT_COUNT, + MESA_FORMAT_COUNT } gl_format; -- cgit v1.2.3 From bc8fb028c6c9e7c9bd4f6aaf094a606c447e3711 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 17 Nov 2009 16:15:56 -0700 Subject: mesa: fix incorrect type in store_texel_al1616() --- src/mesa/main/texfetch_tmp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texfetch_tmp.h b/src/mesa/main/texfetch_tmp.h index 6fac7ba1e1..1f0d436236 100644 --- a/src/mesa/main/texfetch_tmp.h +++ b/src/mesa/main/texfetch_tmp.h @@ -876,7 +876,7 @@ static void store_texel_al1616(struct gl_texture_image *texImage, GLint i, GLint j, GLint k, const void *texel) { const GLushort *rgba = (const GLushort *) texel; - GLuint *dst = TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + GLuint *dst = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); *dst = PACK_COLOR_1616(rgba[ACOMP], rgba[RCOMP]); } #endif -- cgit v1.2.3 From 133501bef2933395f14b2ebdfeda84279be93c60 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 17 Nov 2009 16:16:16 -0700 Subject: mesa: fix assorted compiler warnings --- src/mesa/shader/program_parser.h | 2 +- src/mesa/shader/slang/slang_codegen.c | 2 +- src/mesa/state_tracker/st_atom.c | 8 ++++---- src/mesa/state_tracker/st_cb_bitmap.c | 2 +- src/mesa/state_tracker/st_program.c | 4 ++-- src/mesa/vbo/vbo_exec_array.c | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/program_parser.h b/src/mesa/shader/program_parser.h index bce6041381..c170948f73 100644 --- a/src/mesa/shader/program_parser.h +++ b/src/mesa/shader/program_parser.h @@ -35,7 +35,7 @@ enum asm_type { at_attrib, at_param, at_temp, - at_output, + at_output }; struct asm_symbol { diff --git a/src/mesa/shader/slang/slang_codegen.c b/src/mesa/shader/slang/slang_codegen.c index 344dfdc680..ee5a50ca82 100644 --- a/src/mesa/shader/slang/slang_codegen.c +++ b/src/mesa/shader/slang/slang_codegen.c @@ -925,7 +925,7 @@ gen_return_with_expression(slang_assemble_ctx *A, slang_operation *oper) slang_operation_copy(rhs, &oper->children[0]); } - ///blockOper->locals->outer_scope = oper->locals->outer_scope; + /*blockOper->locals->outer_scope = oper->locals->outer_scope;*/ /*slang_print_tree(blockOper, 0);*/ diff --git a/src/mesa/state_tracker/st_atom.c b/src/mesa/state_tracker/st_atom.c index ca15ce1b47..0e89a624c4 100644 --- a/src/mesa/state_tracker/st_atom.c +++ b/src/mesa/state_tracker/st_atom.c @@ -137,7 +137,7 @@ void st_validate_state( struct st_context *st ) if (state->st == 0) return; -// _mesa_printf("%s %x/%x\n", __FUNCTION__, state->mesa, state->st); + /*_mesa_printf("%s %x/%x\n", __FUNCTION__, state->mesa, state->st);*/ if (1) { /* Debug version which enforces various sanity checks on the @@ -152,7 +152,7 @@ void st_validate_state( struct st_context *st ) const struct st_tracked_state *atom = atoms[i]; struct st_state_flags generated; -// _mesa_printf("atom %s %x/%x\n", atom->name, atom->dirty.mesa, atom->dirty.st); + /*_mesa_printf("atom %s %x/%x\n", atom->name, atom->dirty.mesa, atom->dirty.st);*/ if (!(atom->dirty.mesa || atom->dirty.st) || !atom->update) { @@ -162,7 +162,7 @@ void st_validate_state( struct st_context *st ) if (check_state(state, &atom->dirty)) { atoms[i]->update( st ); -// _mesa_printf("after: %x\n", atom->dirty.mesa); + /*_mesa_printf("after: %x\n", atom->dirty.mesa);*/ } accumulate_state(&examined, &atom->dirty); @@ -175,7 +175,7 @@ void st_validate_state( struct st_context *st ) assert(!check_state(&examined, &generated)); prev = *state; } -// _mesa_printf("\n"); + /*_mesa_printf("\n");*/ } else { diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index a22fa68299..1960d171bf 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -526,7 +526,7 @@ reset_cache(struct st_context *st) struct pipe_screen *screen = pipe->screen; struct bitmap_cache *cache = st->bitmap.cache; - //memset(cache->buffer, 0xff, sizeof(cache->buffer)); + /*memset(cache->buffer, 0xff, sizeof(cache->buffer));*/ cache->empty = GL_TRUE; cache->xmin = 1000000; diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index a9be80ce8f..6d02722c13 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -80,7 +80,7 @@ st_translate_vertex_program(struct st_context *st, GLbitfield input_flags[MAX_PROGRAM_INPUTS]; GLbitfield output_flags[MAX_PROGRAM_OUTPUTS]; -// memset(&vs, 0, sizeof(vs)); + /*memset(&vs, 0, sizeof(vs));*/ memset(input_flags, 0, sizeof(input_flags)); memset(output_flags, 0, sizeof(output_flags)); @@ -386,7 +386,7 @@ st_translate_fragment_program(struct st_context *st, GLbitfield input_flags[MAX_PROGRAM_INPUTS]; GLbitfield output_flags[MAX_PROGRAM_OUTPUTS]; -// memset(&fs, 0, sizeof(fs)); + /*memset(&fs, 0, sizeof(fs));*/ memset(input_flags, 0, sizeof(input_flags)); memset(output_flags, 0, sizeof(output_flags)); diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index fd70b57b72..6de8f059b7 100644 --- a/src/mesa/vbo/vbo_exec_array.c +++ b/src/mesa/vbo/vbo_exec_array.c @@ -146,7 +146,7 @@ check_array_data(GLcontext *ctx, struct gl_client_array *array, array->Ptr, array->BufferObj->Name); f[k] = 1.0; /* XXX replace the bad value! */ } - //assert(!IS_INF_OR_NAN(f[k])); + /*assert(!IS_INF_OR_NAN(f[k]));*/ } } break; -- cgit v1.2.3 From a54033bedb1d3ac7f7a0c1365c25c638e58de566 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 17 Nov 2009 16:18:29 -0700 Subject: mesa: remove old comment --- src/mesa/main/buffers.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c index 7c31a46ab9..97f0659758 100644 --- a/src/mesa/main/buffers.c +++ b/src/mesa/main/buffers.c @@ -382,7 +382,6 @@ _mesa_drawbuffers(GLcontext *ctx, GLuint n, const GLenum *buffers, */ if (n == 1) { GLuint count = 0, destMask0 = destMask[0]; - /* init to -1 to help catch errors */ while (destMask0) { GLint bufIndex = _mesa_ffs(destMask0) - 1; if (fb->_ColorDrawBufferIndexes[count] != bufIndex) { -- cgit v1.2.3 From c185ff96c98b397d494eec5125c668df4db45cf3 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 11 Nov 2009 14:44:43 -0800 Subject: ARB_fbo: Remove _EXT from enum names --- src/mesa/glapi/ARB_framebuffer_object.xml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/glapi/ARB_framebuffer_object.xml b/src/mesa/glapi/ARB_framebuffer_object.xml index b700e7e77d..7fc0f439b1 100644 --- a/src/mesa/glapi/ARB_framebuffer_object.xml +++ b/src/mesa/glapi/ARB_framebuffer_object.xml @@ -12,10 +12,10 @@ - - - - + + + + @@ -98,28 +98,28 @@ - - + + - + - + - + - + - + - + -- cgit v1.2.3 From 30f09573ed4b3b2a5460143b366aa9fb8b91e6a4 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 11 Nov 2009 14:51:29 -0800 Subject: ARB_fbo: Add missing protocol "Get" information --- src/mesa/glapi/ARB_framebuffer_object.xml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/glapi/ARB_framebuffer_object.xml b/src/mesa/glapi/ARB_framebuffer_object.xml index 7fc0f439b1..89c23938fb 100644 --- a/src/mesa/glapi/ARB_framebuffer_object.xml +++ b/src/mesa/glapi/ARB_framebuffer_object.xml @@ -93,7 +93,9 @@ - + + + @@ -131,7 +133,10 @@ - + + + + -- cgit v1.2.3 From 92b38bc3050d8f1ee8c64ff976584ec3c0b77f0c Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 11 Nov 2009 15:01:25 -0800 Subject: EXT_fbo_blit: Add missing GLX protocol render opcode --- src/mesa/glapi/gl_API.xml | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/glapi/gl_API.xml b/src/mesa/glapi/gl_API.xml index da4be14707..2834c5bf51 100644 --- a/src/mesa/glapi/gl_API.xml +++ b/src/mesa/glapi/gl_API.xml @@ -12260,6 +12260,7 @@ + -- cgit v1.2.3 From b244b702b3a7bed08250e20b54192ea73892b552 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 11 Nov 2009 15:08:49 -0800 Subject: EXT_pds: Add GL_EXT_packed_depth_stencil --- src/mesa/glapi/EXT_packed_depth_stencil.xml | 18 ++++++++++++++++++ src/mesa/glapi/gl_API.xml | 2 ++ 2 files changed, 20 insertions(+) create mode 100644 src/mesa/glapi/EXT_packed_depth_stencil.xml (limited to 'src/mesa') diff --git a/src/mesa/glapi/EXT_packed_depth_stencil.xml b/src/mesa/glapi/EXT_packed_depth_stencil.xml new file mode 100644 index 0000000000..5be810302f --- /dev/null +++ b/src/mesa/glapi/EXT_packed_depth_stencil.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/mesa/glapi/gl_API.xml b/src/mesa/glapi/gl_API.xml index 2834c5bf51..7180334bdb 100644 --- a/src/mesa/glapi/gl_API.xml +++ b/src/mesa/glapi/gl_API.xml @@ -12238,6 +12238,8 @@ + + -- cgit v1.2.3 From daad31d52732b5a954360a0baacdeff89d3c153a Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 11 Nov 2009 15:09:44 -0800 Subject: EXT_pds: Alias GL_NV_packed_depth_stencil to GL_EXT_packed_depth_stencil GL_EXT_packed_depth_stencil is a functional superset of GL_NV_packed_depth_stencil. If a driver enables EXT_pds, make NV_pds available as well. --- src/mesa/main/extensions.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 54cf37c5f4..96f3511273 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -169,6 +169,7 @@ static const struct { { OFF, "GL_NV_fragment_program", F(NV_fragment_program) }, { OFF, "GL_NV_fragment_program_option", F(NV_fragment_program_option) }, { ON, "GL_NV_light_max_exponent", F(NV_light_max_exponent) }, + { OFF, "GL_NV_packed_depth_stencil", F(EXT_packed_depth_stencil) }, { OFF, "GL_NV_point_sprite", F(NV_point_sprite) }, { OFF, "GL_NV_texture_env_combine4", F(NV_texture_env_combine4) }, { OFF, "GL_NV_texture_rectangle", F(NV_texture_rectangle) }, -- cgit v1.2.3 From afab8d9958a4deedca16fb9856bc7f372c21debd Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 11 Nov 2009 15:15:35 -0800 Subject: ARB_fbo: Add GL_EXT_framebuffer_multisample Add GL_EXT_framebuffer_multisample. Make glRenderbufferStorageMultisampleEXT in GL_EXT_framebuffer_object alias glRenderbufferStorageMultisample. Also add the missing GLX render opcode to glRenderbufferStorageMultisample. Since this extension is layered on GL_EXT_framebuffer_object, I put it in EXT_framebuffer_object.xml. --- src/mesa/glapi/ARB_framebuffer_object.xml | 1 + src/mesa/glapi/EXT_framebuffer_object.xml | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/glapi/ARB_framebuffer_object.xml b/src/mesa/glapi/ARB_framebuffer_object.xml index 89c23938fb..e6bdcd6e50 100644 --- a/src/mesa/glapi/ARB_framebuffer_object.xml +++ b/src/mesa/glapi/ARB_framebuffer_object.xml @@ -173,6 +173,7 @@ + diff --git a/src/mesa/glapi/EXT_framebuffer_object.xml b/src/mesa/glapi/EXT_framebuffer_object.xml index 5559b48b11..8c5b1c3a1e 100644 --- a/src/mesa/glapi/EXT_framebuffer_object.xml +++ b/src/mesa/glapi/EXT_framebuffer_object.xml @@ -192,4 +192,20 @@ + + + + + + + + + + + + + + + + -- cgit v1.2.3 From 50b05e7c1f64437a12afb56e38bb588b8b85bd5e Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 11 Nov 2009 15:18:22 -0800 Subject: ARB_fbo: Move EXT_fb_blit to EXT_framebuffer_object.xml This extension is layered on GL_EXT_framebuffer_object, so it should live in the same XML file. --- src/mesa/glapi/EXT_framebuffer_object.xml | 24 ++++++++++++++++++++++++ src/mesa/glapi/gl_API.xml | 24 ------------------------ 2 files changed, 24 insertions(+), 24 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/glapi/EXT_framebuffer_object.xml b/src/mesa/glapi/EXT_framebuffer_object.xml index 8c5b1c3a1e..4f418f7b64 100644 --- a/src/mesa/glapi/EXT_framebuffer_object.xml +++ b/src/mesa/glapi/EXT_framebuffer_object.xml @@ -192,6 +192,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mesa/glapi/gl_API.xml b/src/mesa/glapi/gl_API.xml index 7180334bdb..34c7746e1b 100644 --- a/src/mesa/glapi/gl_API.xml +++ b/src/mesa/glapi/gl_API.xml @@ -12242,30 +12242,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - -- cgit v1.2.3 From 7fd44005ae67d598c0070bb6ad82a26bc0944284 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 12 Nov 2009 11:50:28 -0800 Subject: ARB_fbo: Regenerate files from previous commits. --- src/mesa/glapi/glapitemp.h | 6 + src/mesa/glapi/glprocs.h | 198 +- src/mesa/main/enums.c | 5282 ++++++++++++++++++++-------------------- src/mesa/main/remap_helper.h | 2292 ++++++++--------- src/mesa/sparc/glapi_sparc.S | 1 + src/mesa/x86-64/glapi_x86-64.S | 1 + src/mesa/x86/glapi_x86.S | 1 + 7 files changed, 3919 insertions(+), 3862 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/glapi/glapitemp.h b/src/mesa/glapi/glapitemp.h index d9a3690f2a..319a4ab55b 100644 --- a/src/mesa/glapi/glapitemp.h +++ b/src/mesa/glapi/glapitemp.h @@ -4011,6 +4011,11 @@ KEYWORD1 void KEYWORD2 NAME(RenderbufferStorageMultisample)(GLenum target, GLsiz DISPATCH(RenderbufferStorageMultisample, (target, samples, internalformat, width, height), (F, "glRenderbufferStorageMultisample(0x%x, %d, 0x%x, %d, %d);\n", target, samples, internalformat, width, height)); } +KEYWORD1 void KEYWORD2 NAME(RenderbufferStorageMultisampleEXT)(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) +{ + DISPATCH(RenderbufferStorageMultisample, (target, samples, internalformat, width, height), (F, "glRenderbufferStorageMultisampleEXT(0x%x, %d, 0x%x, %d, %d);\n", target, samples, internalformat, width, height)); +} + KEYWORD1 void KEYWORD2 NAME(FlushMappedBufferRange)(GLenum target, GLintptr offset, GLsizeiptr length) { DISPATCH(FlushMappedBufferRange, (target, offset, length), (F, "glFlushMappedBufferRange(0x%x, %d, %d);\n", target, offset, length)); @@ -6837,6 +6842,7 @@ static _glapi_proc UNUSED_TABLE_NAME[] = { TABLE_ENTRY(GetAttribLocation), TABLE_ENTRY(DrawBuffers), TABLE_ENTRY(DrawBuffersATI), + TABLE_ENTRY(RenderbufferStorageMultisampleEXT), TABLE_ENTRY(PointParameterf), TABLE_ENTRY(PointParameterfARB), TABLE_ENTRY(PointParameterfv), diff --git a/src/mesa/glapi/glprocs.h b/src/mesa/glapi/glprocs.h index c29f8b57be..1ad7e84337 100644 --- a/src/mesa/glapi/glprocs.h +++ b/src/mesa/glapi/glprocs.h @@ -1050,6 +1050,7 @@ static const char gl_string_table[] = "glGetAttribLocation\0" "glDrawBuffers\0" "glDrawBuffersATI\0" + "glRenderbufferStorageMultisampleEXT\0" "glSampleMaskEXT\0" "glSamplePatternEXT\0" "glPointParameterf\0" @@ -2257,104 +2258,105 @@ static const glprocs_table_t static_functions[] = { NAME_FUNC_OFFSET(17904, glGetAttribLocationARB, glGetAttribLocationARB, NULL, _gloffset_GetAttribLocationARB), NAME_FUNC_OFFSET(17924, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), NAME_FUNC_OFFSET(17938, glDrawBuffersARB, glDrawBuffersARB, NULL, _gloffset_DrawBuffersARB), - NAME_FUNC_OFFSET(17955, gl_dispatch_stub_584, gl_dispatch_stub_584, NULL, _gloffset_SampleMaskSGIS), - NAME_FUNC_OFFSET(17971, gl_dispatch_stub_585, gl_dispatch_stub_585, NULL, _gloffset_SamplePatternSGIS), - NAME_FUNC_OFFSET(17990, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), - NAME_FUNC_OFFSET(18008, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), - NAME_FUNC_OFFSET(18029, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), - NAME_FUNC_OFFSET(18051, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), - NAME_FUNC_OFFSET(18070, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), - NAME_FUNC_OFFSET(18092, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), - NAME_FUNC_OFFSET(18115, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT), - NAME_FUNC_OFFSET(18134, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT), - NAME_FUNC_OFFSET(18154, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT), - NAME_FUNC_OFFSET(18173, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT), - NAME_FUNC_OFFSET(18193, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT), - NAME_FUNC_OFFSET(18212, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT), - NAME_FUNC_OFFSET(18232, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT), - NAME_FUNC_OFFSET(18251, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT), - NAME_FUNC_OFFSET(18271, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT), - NAME_FUNC_OFFSET(18290, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT), - NAME_FUNC_OFFSET(18310, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT), - NAME_FUNC_OFFSET(18330, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT), - NAME_FUNC_OFFSET(18351, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT), - NAME_FUNC_OFFSET(18371, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT), - NAME_FUNC_OFFSET(18392, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT), - NAME_FUNC_OFFSET(18412, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT), - NAME_FUNC_OFFSET(18433, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT), - NAME_FUNC_OFFSET(18457, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT), - NAME_FUNC_OFFSET(18475, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT), - NAME_FUNC_OFFSET(18495, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT), - NAME_FUNC_OFFSET(18513, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT), - NAME_FUNC_OFFSET(18525, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT), - NAME_FUNC_OFFSET(18538, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT), - NAME_FUNC_OFFSET(18550, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT), - NAME_FUNC_OFFSET(18563, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), - NAME_FUNC_OFFSET(18583, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), - NAME_FUNC_OFFSET(18607, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), - NAME_FUNC_OFFSET(18621, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), - NAME_FUNC_OFFSET(18638, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), - NAME_FUNC_OFFSET(18653, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), - NAME_FUNC_OFFSET(18671, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), - NAME_FUNC_OFFSET(18685, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), - NAME_FUNC_OFFSET(18702, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), - NAME_FUNC_OFFSET(18717, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), - NAME_FUNC_OFFSET(18735, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), - NAME_FUNC_OFFSET(18749, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), - NAME_FUNC_OFFSET(18766, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), - NAME_FUNC_OFFSET(18781, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), - NAME_FUNC_OFFSET(18799, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), - NAME_FUNC_OFFSET(18813, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), - NAME_FUNC_OFFSET(18830, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), - NAME_FUNC_OFFSET(18845, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), - NAME_FUNC_OFFSET(18863, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), - NAME_FUNC_OFFSET(18877, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), - NAME_FUNC_OFFSET(18894, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), - NAME_FUNC_OFFSET(18909, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), - NAME_FUNC_OFFSET(18927, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), - NAME_FUNC_OFFSET(18941, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), - NAME_FUNC_OFFSET(18958, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), - NAME_FUNC_OFFSET(18973, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), - NAME_FUNC_OFFSET(18991, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), - NAME_FUNC_OFFSET(19005, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), - NAME_FUNC_OFFSET(19022, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), - NAME_FUNC_OFFSET(19037, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), - NAME_FUNC_OFFSET(19055, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), - NAME_FUNC_OFFSET(19069, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), - NAME_FUNC_OFFSET(19086, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), - NAME_FUNC_OFFSET(19101, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), - NAME_FUNC_OFFSET(19119, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV), - NAME_FUNC_OFFSET(19136, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV), - NAME_FUNC_OFFSET(19156, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV), - NAME_FUNC_OFFSET(19173, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), - NAME_FUNC_OFFSET(19199, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), - NAME_FUNC_OFFSET(19228, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV), - NAME_FUNC_OFFSET(19243, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV), - NAME_FUNC_OFFSET(19261, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV), - NAME_FUNC_OFFSET(19280, gl_dispatch_stub_755, gl_dispatch_stub_755, NULL, _gloffset_DeleteVertexArraysAPPLE), - NAME_FUNC_OFFSET(19301, gl_dispatch_stub_757, gl_dispatch_stub_757, NULL, _gloffset_IsVertexArrayAPPLE), - NAME_FUNC_OFFSET(19317, gl_dispatch_stub_765, gl_dispatch_stub_765, NULL, _gloffset_BlendEquationSeparateEXT), - NAME_FUNC_OFFSET(19341, gl_dispatch_stub_765, gl_dispatch_stub_765, NULL, _gloffset_BlendEquationSeparateEXT), - NAME_FUNC_OFFSET(19368, glBindFramebufferEXT, glBindFramebufferEXT, NULL, _gloffset_BindFramebufferEXT), - NAME_FUNC_OFFSET(19386, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, _gloffset_BindRenderbufferEXT), - NAME_FUNC_OFFSET(19405, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, _gloffset_CheckFramebufferStatusEXT), - NAME_FUNC_OFFSET(19430, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, _gloffset_DeleteFramebuffersEXT), - NAME_FUNC_OFFSET(19451, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, _gloffset_DeleteRenderbuffersEXT), - NAME_FUNC_OFFSET(19473, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, _gloffset_FramebufferRenderbufferEXT), - NAME_FUNC_OFFSET(19499, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, _gloffset_FramebufferTexture1DEXT), - NAME_FUNC_OFFSET(19522, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, _gloffset_FramebufferTexture2DEXT), - NAME_FUNC_OFFSET(19545, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, _gloffset_FramebufferTexture3DEXT), - NAME_FUNC_OFFSET(19568, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, _gloffset_GenFramebuffersEXT), - NAME_FUNC_OFFSET(19586, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, _gloffset_GenRenderbuffersEXT), - NAME_FUNC_OFFSET(19605, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, _gloffset_GenerateMipmapEXT), - NAME_FUNC_OFFSET(19622, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, _gloffset_GetFramebufferAttachmentParameterivEXT), - NAME_FUNC_OFFSET(19660, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, _gloffset_GetRenderbufferParameterivEXT), - NAME_FUNC_OFFSET(19689, glIsFramebufferEXT, glIsFramebufferEXT, NULL, _gloffset_IsFramebufferEXT), - NAME_FUNC_OFFSET(19705, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, _gloffset_IsRenderbufferEXT), - NAME_FUNC_OFFSET(19722, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, _gloffset_RenderbufferStorageEXT), - NAME_FUNC_OFFSET(19744, gl_dispatch_stub_783, gl_dispatch_stub_783, NULL, _gloffset_BlitFramebufferEXT), - NAME_FUNC_OFFSET(19762, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, _gloffset_FramebufferTextureLayerEXT), - NAME_FUNC_OFFSET(19788, glProvokingVertexEXT, glProvokingVertexEXT, NULL, _gloffset_ProvokingVertexEXT), + NAME_FUNC_OFFSET(17955, glRenderbufferStorageMultisample, glRenderbufferStorageMultisample, NULL, _gloffset_RenderbufferStorageMultisample), + NAME_FUNC_OFFSET(17991, gl_dispatch_stub_584, gl_dispatch_stub_584, NULL, _gloffset_SampleMaskSGIS), + NAME_FUNC_OFFSET(18007, gl_dispatch_stub_585, gl_dispatch_stub_585, NULL, _gloffset_SamplePatternSGIS), + NAME_FUNC_OFFSET(18026, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), + NAME_FUNC_OFFSET(18044, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), + NAME_FUNC_OFFSET(18065, glPointParameterfEXT, glPointParameterfEXT, NULL, _gloffset_PointParameterfEXT), + NAME_FUNC_OFFSET(18087, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), + NAME_FUNC_OFFSET(18106, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), + NAME_FUNC_OFFSET(18128, glPointParameterfvEXT, glPointParameterfvEXT, NULL, _gloffset_PointParameterfvEXT), + NAME_FUNC_OFFSET(18151, glSecondaryColor3bEXT, glSecondaryColor3bEXT, NULL, _gloffset_SecondaryColor3bEXT), + NAME_FUNC_OFFSET(18170, glSecondaryColor3bvEXT, glSecondaryColor3bvEXT, NULL, _gloffset_SecondaryColor3bvEXT), + NAME_FUNC_OFFSET(18190, glSecondaryColor3dEXT, glSecondaryColor3dEXT, NULL, _gloffset_SecondaryColor3dEXT), + NAME_FUNC_OFFSET(18209, glSecondaryColor3dvEXT, glSecondaryColor3dvEXT, NULL, _gloffset_SecondaryColor3dvEXT), + NAME_FUNC_OFFSET(18229, glSecondaryColor3fEXT, glSecondaryColor3fEXT, NULL, _gloffset_SecondaryColor3fEXT), + NAME_FUNC_OFFSET(18248, glSecondaryColor3fvEXT, glSecondaryColor3fvEXT, NULL, _gloffset_SecondaryColor3fvEXT), + NAME_FUNC_OFFSET(18268, glSecondaryColor3iEXT, glSecondaryColor3iEXT, NULL, _gloffset_SecondaryColor3iEXT), + NAME_FUNC_OFFSET(18287, glSecondaryColor3ivEXT, glSecondaryColor3ivEXT, NULL, _gloffset_SecondaryColor3ivEXT), + NAME_FUNC_OFFSET(18307, glSecondaryColor3sEXT, glSecondaryColor3sEXT, NULL, _gloffset_SecondaryColor3sEXT), + NAME_FUNC_OFFSET(18326, glSecondaryColor3svEXT, glSecondaryColor3svEXT, NULL, _gloffset_SecondaryColor3svEXT), + NAME_FUNC_OFFSET(18346, glSecondaryColor3ubEXT, glSecondaryColor3ubEXT, NULL, _gloffset_SecondaryColor3ubEXT), + NAME_FUNC_OFFSET(18366, glSecondaryColor3ubvEXT, glSecondaryColor3ubvEXT, NULL, _gloffset_SecondaryColor3ubvEXT), + NAME_FUNC_OFFSET(18387, glSecondaryColor3uiEXT, glSecondaryColor3uiEXT, NULL, _gloffset_SecondaryColor3uiEXT), + NAME_FUNC_OFFSET(18407, glSecondaryColor3uivEXT, glSecondaryColor3uivEXT, NULL, _gloffset_SecondaryColor3uivEXT), + NAME_FUNC_OFFSET(18428, glSecondaryColor3usEXT, glSecondaryColor3usEXT, NULL, _gloffset_SecondaryColor3usEXT), + NAME_FUNC_OFFSET(18448, glSecondaryColor3usvEXT, glSecondaryColor3usvEXT, NULL, _gloffset_SecondaryColor3usvEXT), + NAME_FUNC_OFFSET(18469, glSecondaryColorPointerEXT, glSecondaryColorPointerEXT, NULL, _gloffset_SecondaryColorPointerEXT), + NAME_FUNC_OFFSET(18493, glMultiDrawArraysEXT, glMultiDrawArraysEXT, NULL, _gloffset_MultiDrawArraysEXT), + NAME_FUNC_OFFSET(18511, glMultiDrawElementsEXT, glMultiDrawElementsEXT, NULL, _gloffset_MultiDrawElementsEXT), + NAME_FUNC_OFFSET(18531, glFogCoordPointerEXT, glFogCoordPointerEXT, NULL, _gloffset_FogCoordPointerEXT), + NAME_FUNC_OFFSET(18549, glFogCoorddEXT, glFogCoorddEXT, NULL, _gloffset_FogCoorddEXT), + NAME_FUNC_OFFSET(18561, glFogCoorddvEXT, glFogCoorddvEXT, NULL, _gloffset_FogCoorddvEXT), + NAME_FUNC_OFFSET(18574, glFogCoordfEXT, glFogCoordfEXT, NULL, _gloffset_FogCoordfEXT), + NAME_FUNC_OFFSET(18586, glFogCoordfvEXT, glFogCoordfvEXT, NULL, _gloffset_FogCoordfvEXT), + NAME_FUNC_OFFSET(18599, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), + NAME_FUNC_OFFSET(18619, glBlendFuncSeparateEXT, glBlendFuncSeparateEXT, NULL, _gloffset_BlendFuncSeparateEXT), + NAME_FUNC_OFFSET(18643, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), + NAME_FUNC_OFFSET(18657, glWindowPos2dMESA, glWindowPos2dMESA, NULL, _gloffset_WindowPos2dMESA), + NAME_FUNC_OFFSET(18674, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), + NAME_FUNC_OFFSET(18689, glWindowPos2dvMESA, glWindowPos2dvMESA, NULL, _gloffset_WindowPos2dvMESA), + NAME_FUNC_OFFSET(18707, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), + NAME_FUNC_OFFSET(18721, glWindowPos2fMESA, glWindowPos2fMESA, NULL, _gloffset_WindowPos2fMESA), + NAME_FUNC_OFFSET(18738, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), + NAME_FUNC_OFFSET(18753, glWindowPos2fvMESA, glWindowPos2fvMESA, NULL, _gloffset_WindowPos2fvMESA), + NAME_FUNC_OFFSET(18771, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), + NAME_FUNC_OFFSET(18785, glWindowPos2iMESA, glWindowPos2iMESA, NULL, _gloffset_WindowPos2iMESA), + NAME_FUNC_OFFSET(18802, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), + NAME_FUNC_OFFSET(18817, glWindowPos2ivMESA, glWindowPos2ivMESA, NULL, _gloffset_WindowPos2ivMESA), + NAME_FUNC_OFFSET(18835, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), + NAME_FUNC_OFFSET(18849, glWindowPos2sMESA, glWindowPos2sMESA, NULL, _gloffset_WindowPos2sMESA), + NAME_FUNC_OFFSET(18866, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), + NAME_FUNC_OFFSET(18881, glWindowPos2svMESA, glWindowPos2svMESA, NULL, _gloffset_WindowPos2svMESA), + NAME_FUNC_OFFSET(18899, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), + NAME_FUNC_OFFSET(18913, glWindowPos3dMESA, glWindowPos3dMESA, NULL, _gloffset_WindowPos3dMESA), + NAME_FUNC_OFFSET(18930, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), + NAME_FUNC_OFFSET(18945, glWindowPos3dvMESA, glWindowPos3dvMESA, NULL, _gloffset_WindowPos3dvMESA), + NAME_FUNC_OFFSET(18963, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), + NAME_FUNC_OFFSET(18977, glWindowPos3fMESA, glWindowPos3fMESA, NULL, _gloffset_WindowPos3fMESA), + NAME_FUNC_OFFSET(18994, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), + NAME_FUNC_OFFSET(19009, glWindowPos3fvMESA, glWindowPos3fvMESA, NULL, _gloffset_WindowPos3fvMESA), + NAME_FUNC_OFFSET(19027, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), + NAME_FUNC_OFFSET(19041, glWindowPos3iMESA, glWindowPos3iMESA, NULL, _gloffset_WindowPos3iMESA), + NAME_FUNC_OFFSET(19058, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), + NAME_FUNC_OFFSET(19073, glWindowPos3ivMESA, glWindowPos3ivMESA, NULL, _gloffset_WindowPos3ivMESA), + NAME_FUNC_OFFSET(19091, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), + NAME_FUNC_OFFSET(19105, glWindowPos3sMESA, glWindowPos3sMESA, NULL, _gloffset_WindowPos3sMESA), + NAME_FUNC_OFFSET(19122, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), + NAME_FUNC_OFFSET(19137, glWindowPos3svMESA, glWindowPos3svMESA, NULL, _gloffset_WindowPos3svMESA), + NAME_FUNC_OFFSET(19155, glBindProgramNV, glBindProgramNV, NULL, _gloffset_BindProgramNV), + NAME_FUNC_OFFSET(19172, glDeleteProgramsNV, glDeleteProgramsNV, NULL, _gloffset_DeleteProgramsNV), + NAME_FUNC_OFFSET(19192, glGenProgramsNV, glGenProgramsNV, NULL, _gloffset_GenProgramsNV), + NAME_FUNC_OFFSET(19209, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), + NAME_FUNC_OFFSET(19235, glGetVertexAttribPointervNV, glGetVertexAttribPointervNV, NULL, _gloffset_GetVertexAttribPointervNV), + NAME_FUNC_OFFSET(19264, glIsProgramNV, glIsProgramNV, NULL, _gloffset_IsProgramNV), + NAME_FUNC_OFFSET(19279, glPointParameteriNV, glPointParameteriNV, NULL, _gloffset_PointParameteriNV), + NAME_FUNC_OFFSET(19297, glPointParameterivNV, glPointParameterivNV, NULL, _gloffset_PointParameterivNV), + NAME_FUNC_OFFSET(19316, gl_dispatch_stub_755, gl_dispatch_stub_755, NULL, _gloffset_DeleteVertexArraysAPPLE), + NAME_FUNC_OFFSET(19337, gl_dispatch_stub_757, gl_dispatch_stub_757, NULL, _gloffset_IsVertexArrayAPPLE), + NAME_FUNC_OFFSET(19353, gl_dispatch_stub_765, gl_dispatch_stub_765, NULL, _gloffset_BlendEquationSeparateEXT), + NAME_FUNC_OFFSET(19377, gl_dispatch_stub_765, gl_dispatch_stub_765, NULL, _gloffset_BlendEquationSeparateEXT), + NAME_FUNC_OFFSET(19404, glBindFramebufferEXT, glBindFramebufferEXT, NULL, _gloffset_BindFramebufferEXT), + NAME_FUNC_OFFSET(19422, glBindRenderbufferEXT, glBindRenderbufferEXT, NULL, _gloffset_BindRenderbufferEXT), + NAME_FUNC_OFFSET(19441, glCheckFramebufferStatusEXT, glCheckFramebufferStatusEXT, NULL, _gloffset_CheckFramebufferStatusEXT), + NAME_FUNC_OFFSET(19466, glDeleteFramebuffersEXT, glDeleteFramebuffersEXT, NULL, _gloffset_DeleteFramebuffersEXT), + NAME_FUNC_OFFSET(19487, glDeleteRenderbuffersEXT, glDeleteRenderbuffersEXT, NULL, _gloffset_DeleteRenderbuffersEXT), + NAME_FUNC_OFFSET(19509, glFramebufferRenderbufferEXT, glFramebufferRenderbufferEXT, NULL, _gloffset_FramebufferRenderbufferEXT), + NAME_FUNC_OFFSET(19535, glFramebufferTexture1DEXT, glFramebufferTexture1DEXT, NULL, _gloffset_FramebufferTexture1DEXT), + NAME_FUNC_OFFSET(19558, glFramebufferTexture2DEXT, glFramebufferTexture2DEXT, NULL, _gloffset_FramebufferTexture2DEXT), + NAME_FUNC_OFFSET(19581, glFramebufferTexture3DEXT, glFramebufferTexture3DEXT, NULL, _gloffset_FramebufferTexture3DEXT), + NAME_FUNC_OFFSET(19604, glGenFramebuffersEXT, glGenFramebuffersEXT, NULL, _gloffset_GenFramebuffersEXT), + NAME_FUNC_OFFSET(19622, glGenRenderbuffersEXT, glGenRenderbuffersEXT, NULL, _gloffset_GenRenderbuffersEXT), + NAME_FUNC_OFFSET(19641, glGenerateMipmapEXT, glGenerateMipmapEXT, NULL, _gloffset_GenerateMipmapEXT), + NAME_FUNC_OFFSET(19658, glGetFramebufferAttachmentParameterivEXT, glGetFramebufferAttachmentParameterivEXT, NULL, _gloffset_GetFramebufferAttachmentParameterivEXT), + NAME_FUNC_OFFSET(19696, glGetRenderbufferParameterivEXT, glGetRenderbufferParameterivEXT, NULL, _gloffset_GetRenderbufferParameterivEXT), + NAME_FUNC_OFFSET(19725, glIsFramebufferEXT, glIsFramebufferEXT, NULL, _gloffset_IsFramebufferEXT), + NAME_FUNC_OFFSET(19741, glIsRenderbufferEXT, glIsRenderbufferEXT, NULL, _gloffset_IsRenderbufferEXT), + NAME_FUNC_OFFSET(19758, glRenderbufferStorageEXT, glRenderbufferStorageEXT, NULL, _gloffset_RenderbufferStorageEXT), + NAME_FUNC_OFFSET(19780, gl_dispatch_stub_783, gl_dispatch_stub_783, NULL, _gloffset_BlitFramebufferEXT), + NAME_FUNC_OFFSET(19798, glFramebufferTextureLayerEXT, glFramebufferTextureLayerEXT, NULL, _gloffset_FramebufferTextureLayerEXT), + NAME_FUNC_OFFSET(19824, glProvokingVertexEXT, glProvokingVertexEXT, NULL, _gloffset_ProvokingVertexEXT), NAME_FUNC_OFFSET(-1, NULL, NULL, NULL, 0) }; diff --git a/src/mesa/main/enums.c b/src/mesa/main/enums.c index 606d50c59a..f9f4bc7853 100644 --- a/src/mesa/main/enums.c +++ b/src/mesa/main/enums.c @@ -384,6 +384,7 @@ LONGSTRING static const char enum_string_table[] = "GL_DELETE_STATUS\0" "GL_DEPTH\0" "GL_DEPTH24_STENCIL8\0" + "GL_DEPTH24_STENCIL8_EXT\0" "GL_DEPTH_ATTACHMENT\0" "GL_DEPTH_ATTACHMENT_EXT\0" "GL_DEPTH_BIAS\0" @@ -409,6 +410,7 @@ LONGSTRING static const char enum_string_table[] = "GL_DEPTH_SCALE\0" "GL_DEPTH_STENCIL\0" "GL_DEPTH_STENCIL_ATTACHMENT\0" + "GL_DEPTH_STENCIL_EXT\0" "GL_DEPTH_STENCIL_NV\0" "GL_DEPTH_STENCIL_TO_BGRA_NV\0" "GL_DEPTH_STENCIL_TO_RGBA_NV\0" @@ -478,6 +480,7 @@ LONGSTRING static const char enum_string_table[] = "GL_DRAW_BUFFER9_ARB\0" "GL_DRAW_BUFFER9_ATI\0" "GL_DRAW_FRAMEBUFFER\0" + "GL_DRAW_FRAMEBUFFER_BINDING\0" "GL_DRAW_FRAMEBUFFER_BINDING_EXT\0" "GL_DRAW_FRAMEBUFFER_EXT\0" "GL_DRAW_PIXEL_TOKEN\0" @@ -593,6 +596,7 @@ LONGSTRING static const char enum_string_table[] = "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT\0" "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL\0" "GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT\0" + "GL_FRAMEBUFFER_BINDING\0" "GL_FRAMEBUFFER_BINDING_EXT\0" "GL_FRAMEBUFFER_COMPLETE\0" "GL_FRAMEBUFFER_COMPLETE_EXT\0" @@ -601,12 +605,15 @@ LONGSTRING static const char enum_string_table[] = "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT\0" "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT\0" "GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT\0" + "GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER\0" "GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT\0" "GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT\0" "GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT\0" "GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT\0" "GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT\0" "GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE\0" + "GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT\0" + "GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER\0" "GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT\0" "GL_FRAMEBUFFER_STATUS_ERROR_EXT\0" "GL_FRAMEBUFFER_UNDEFINED\0" @@ -892,6 +899,7 @@ LONGSTRING static const char enum_string_table[] = "GL_MAX_CLIPMAP_DEPTH_SGIX\0" "GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX\0" "GL_MAX_CLIP_PLANES\0" + "GL_MAX_COLOR_ATTACHMENTS\0" "GL_MAX_COLOR_ATTACHMENTS_EXT\0" "GL_MAX_COLOR_MATRIX_STACK_DEPTH\0" "GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI\0" @@ -947,8 +955,10 @@ LONGSTRING static const char enum_string_table[] = "GL_MAX_PROJECTION_STACK_DEPTH\0" "GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB\0" "GL_MAX_RECTANGLE_TEXTURE_SIZE_NV\0" + "GL_MAX_RENDERBUFFER_SIZE\0" "GL_MAX_RENDERBUFFER_SIZE_EXT\0" "GL_MAX_SAMPLES\0" + "GL_MAX_SAMPLES_EXT\0" "GL_MAX_SERVER_WAIT_TIMEOUT\0" "GL_MAX_SHININESS_NV\0" "GL_MAX_SPOT_EXPONENT_NV\0" @@ -1327,6 +1337,7 @@ LONGSTRING static const char enum_string_table[] = "GL_RASTER_POSITION_UNCLIPPED_IBM\0" "GL_READ_BUFFER\0" "GL_READ_FRAMEBUFFER\0" + "GL_READ_FRAMEBUFFER_BINDING\0" "GL_READ_FRAMEBUFFER_BINDING_EXT\0" "GL_READ_FRAMEBUFFER_EXT\0" "GL_READ_ONLY\0" @@ -1345,6 +1356,7 @@ LONGSTRING static const char enum_string_table[] = "GL_RENDER\0" "GL_RENDERBUFFER\0" "GL_RENDERBUFFER_ALPHA_SIZE\0" + "GL_RENDERBUFFER_BINDING\0" "GL_RENDERBUFFER_BINDING_EXT\0" "GL_RENDERBUFFER_BLUE_SIZE\0" "GL_RENDERBUFFER_DEPTH_SIZE\0" @@ -1356,6 +1368,7 @@ LONGSTRING static const char enum_string_table[] = "GL_RENDERBUFFER_INTERNAL_FORMAT_EXT\0" "GL_RENDERBUFFER_RED_SIZE\0" "GL_RENDERBUFFER_SAMPLES\0" + "GL_RENDERBUFFER_SAMPLES_EXT\0" "GL_RENDERBUFFER_STENCIL_SIZE\0" "GL_RENDERBUFFER_WIDTH\0" "GL_RENDERBUFFER_WIDTH_EXT\0" @@ -1541,9 +1554,13 @@ LONGSTRING static const char enum_string_table[] = "GL_STENCIL_FAIL\0" "GL_STENCIL_FUNC\0" "GL_STENCIL_INDEX\0" + "GL_STENCIL_INDEX1\0" + "GL_STENCIL_INDEX16\0" "GL_STENCIL_INDEX16_EXT\0" "GL_STENCIL_INDEX1_EXT\0" + "GL_STENCIL_INDEX4\0" "GL_STENCIL_INDEX4_EXT\0" + "GL_STENCIL_INDEX8\0" "GL_STENCIL_INDEX8_EXT\0" "GL_STENCIL_INDEX_EXT\0" "GL_STENCIL_PASS_DEPTH_FAIL\0" @@ -1761,6 +1778,7 @@ LONGSTRING static const char enum_string_table[] = "GL_TEXTURE_RESIDENT\0" "GL_TEXTURE_STACK_DEPTH\0" "GL_TEXTURE_STENCIL_SIZE\0" + "GL_TEXTURE_STENCIL_SIZE_EXT\0" "GL_TEXTURE_STORAGE_HINT_APPLE\0" "GL_TEXTURE_TOO_LARGE_EXT\0" "GL_TEXTURE_UNSIGNED_REMAP_MODE_NV\0" @@ -1804,6 +1822,7 @@ LONGSTRING static const char enum_string_table[] = "GL_UNSIGNED_INT\0" "GL_UNSIGNED_INT_10_10_10_2\0" "GL_UNSIGNED_INT_24_8\0" + "GL_UNSIGNED_INT_24_8_EXT\0" "GL_UNSIGNED_INT_24_8_NV\0" "GL_UNSIGNED_INT_2_10_10_10_REV\0" "GL_UNSIGNED_INT_8_8_8_8\0" @@ -1900,7 +1919,7 @@ LONGSTRING static const char enum_string_table[] = "GL_ZOOM_Y\0" ; -static const enum_elt all_enums[1862] = +static const enum_elt all_enums[1881] = { { 0, 0x00000600 }, /* GL_2D */ { 6, 0x00001407 }, /* GL_2_BYTES */ @@ -2250,1600 +2269,1619 @@ static const enum_elt all_enums[1862] = { 7144, 0x00008B80 }, /* GL_DELETE_STATUS */ { 7161, 0x00001801 }, /* GL_DEPTH */ { 7170, 0x000088F0 }, /* GL_DEPTH24_STENCIL8 */ - { 7190, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT */ - { 7210, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT_EXT */ - { 7234, 0x00000D1F }, /* GL_DEPTH_BIAS */ - { 7248, 0x00000D56 }, /* GL_DEPTH_BITS */ - { 7262, 0x00008891 }, /* GL_DEPTH_BOUNDS_EXT */ - { 7282, 0x00008890 }, /* GL_DEPTH_BOUNDS_TEST_EXT */ - { 7307, 0x00000100 }, /* GL_DEPTH_BUFFER_BIT */ - { 7327, 0x0000864F }, /* GL_DEPTH_CLAMP */ - { 7342, 0x0000864F }, /* GL_DEPTH_CLAMP_NV */ - { 7360, 0x00000B73 }, /* GL_DEPTH_CLEAR_VALUE */ - { 7381, 0x00001902 }, /* GL_DEPTH_COMPONENT */ - { 7400, 0x000081A5 }, /* GL_DEPTH_COMPONENT16 */ - { 7421, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_ARB */ - { 7446, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_SGIX */ - { 7472, 0x000081A6 }, /* GL_DEPTH_COMPONENT24 */ - { 7493, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_ARB */ - { 7518, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_SGIX */ - { 7544, 0x000081A7 }, /* GL_DEPTH_COMPONENT32 */ - { 7565, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_ARB */ - { 7590, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_SGIX */ - { 7616, 0x00000B74 }, /* GL_DEPTH_FUNC */ - { 7630, 0x00000B70 }, /* GL_DEPTH_RANGE */ - { 7645, 0x00000D1E }, /* GL_DEPTH_SCALE */ - { 7660, 0x000084F9 }, /* GL_DEPTH_STENCIL */ - { 7677, 0x0000821A }, /* GL_DEPTH_STENCIL_ATTACHMENT */ - { 7705, 0x000084F9 }, /* GL_DEPTH_STENCIL_NV */ - { 7725, 0x0000886F }, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ - { 7753, 0x0000886E }, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ - { 7781, 0x00000B71 }, /* GL_DEPTH_TEST */ - { 7795, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE */ - { 7817, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE_ARB */ - { 7843, 0x00000B72 }, /* GL_DEPTH_WRITEMASK */ - { 7862, 0x00001201 }, /* GL_DIFFUSE */ - { 7873, 0x00000BD0 }, /* GL_DITHER */ - { 7883, 0x00000A02 }, /* GL_DOMAIN */ - { 7893, 0x00001100 }, /* GL_DONT_CARE */ - { 7906, 0x000086AE }, /* GL_DOT3_RGB */ - { 7918, 0x000086AF }, /* GL_DOT3_RGBA */ - { 7931, 0x000086AF }, /* GL_DOT3_RGBA_ARB */ - { 7948, 0x00008741 }, /* GL_DOT3_RGBA_EXT */ - { 7965, 0x000086AE }, /* GL_DOT3_RGB_ARB */ - { 7981, 0x00008740 }, /* GL_DOT3_RGB_EXT */ - { 7997, 0x0000140A }, /* GL_DOUBLE */ - { 8007, 0x00000C32 }, /* GL_DOUBLEBUFFER */ - { 8023, 0x00000C01 }, /* GL_DRAW_BUFFER */ - { 8038, 0x00008825 }, /* GL_DRAW_BUFFER0 */ - { 8054, 0x00008825 }, /* GL_DRAW_BUFFER0_ARB */ - { 8074, 0x00008825 }, /* GL_DRAW_BUFFER0_ATI */ - { 8094, 0x00008826 }, /* GL_DRAW_BUFFER1 */ - { 8110, 0x0000882F }, /* GL_DRAW_BUFFER10 */ - { 8127, 0x0000882F }, /* GL_DRAW_BUFFER10_ARB */ - { 8148, 0x0000882F }, /* GL_DRAW_BUFFER10_ATI */ - { 8169, 0x00008830 }, /* GL_DRAW_BUFFER11 */ - { 8186, 0x00008830 }, /* GL_DRAW_BUFFER11_ARB */ - { 8207, 0x00008830 }, /* GL_DRAW_BUFFER11_ATI */ - { 8228, 0x00008831 }, /* GL_DRAW_BUFFER12 */ - { 8245, 0x00008831 }, /* GL_DRAW_BUFFER12_ARB */ - { 8266, 0x00008831 }, /* GL_DRAW_BUFFER12_ATI */ - { 8287, 0x00008832 }, /* GL_DRAW_BUFFER13 */ - { 8304, 0x00008832 }, /* GL_DRAW_BUFFER13_ARB */ - { 8325, 0x00008832 }, /* GL_DRAW_BUFFER13_ATI */ - { 8346, 0x00008833 }, /* GL_DRAW_BUFFER14 */ - { 8363, 0x00008833 }, /* GL_DRAW_BUFFER14_ARB */ - { 8384, 0x00008833 }, /* GL_DRAW_BUFFER14_ATI */ - { 8405, 0x00008834 }, /* GL_DRAW_BUFFER15 */ - { 8422, 0x00008834 }, /* GL_DRAW_BUFFER15_ARB */ - { 8443, 0x00008834 }, /* GL_DRAW_BUFFER15_ATI */ - { 8464, 0x00008826 }, /* GL_DRAW_BUFFER1_ARB */ - { 8484, 0x00008826 }, /* GL_DRAW_BUFFER1_ATI */ - { 8504, 0x00008827 }, /* GL_DRAW_BUFFER2 */ - { 8520, 0x00008827 }, /* GL_DRAW_BUFFER2_ARB */ - { 8540, 0x00008827 }, /* GL_DRAW_BUFFER2_ATI */ - { 8560, 0x00008828 }, /* GL_DRAW_BUFFER3 */ - { 8576, 0x00008828 }, /* GL_DRAW_BUFFER3_ARB */ - { 8596, 0x00008828 }, /* GL_DRAW_BUFFER3_ATI */ - { 8616, 0x00008829 }, /* GL_DRAW_BUFFER4 */ - { 8632, 0x00008829 }, /* GL_DRAW_BUFFER4_ARB */ - { 8652, 0x00008829 }, /* GL_DRAW_BUFFER4_ATI */ - { 8672, 0x0000882A }, /* GL_DRAW_BUFFER5 */ - { 8688, 0x0000882A }, /* GL_DRAW_BUFFER5_ARB */ - { 8708, 0x0000882A }, /* GL_DRAW_BUFFER5_ATI */ - { 8728, 0x0000882B }, /* GL_DRAW_BUFFER6 */ - { 8744, 0x0000882B }, /* GL_DRAW_BUFFER6_ARB */ - { 8764, 0x0000882B }, /* GL_DRAW_BUFFER6_ATI */ - { 8784, 0x0000882C }, /* GL_DRAW_BUFFER7 */ - { 8800, 0x0000882C }, /* GL_DRAW_BUFFER7_ARB */ - { 8820, 0x0000882C }, /* GL_DRAW_BUFFER7_ATI */ - { 8840, 0x0000882D }, /* GL_DRAW_BUFFER8 */ - { 8856, 0x0000882D }, /* GL_DRAW_BUFFER8_ARB */ - { 8876, 0x0000882D }, /* GL_DRAW_BUFFER8_ATI */ - { 8896, 0x0000882E }, /* GL_DRAW_BUFFER9 */ - { 8912, 0x0000882E }, /* GL_DRAW_BUFFER9_ARB */ - { 8932, 0x0000882E }, /* GL_DRAW_BUFFER9_ATI */ - { 8952, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER */ - { 8972, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ - { 9004, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER_EXT */ - { 9028, 0x00000705 }, /* GL_DRAW_PIXEL_TOKEN */ - { 9048, 0x00000304 }, /* GL_DST_ALPHA */ - { 9061, 0x00000306 }, /* GL_DST_COLOR */ - { 9074, 0x0000877A }, /* GL_DU8DV8_ATI */ - { 9088, 0x00008779 }, /* GL_DUDV_ATI */ - { 9100, 0x000088EA }, /* GL_DYNAMIC_COPY */ - { 9116, 0x000088EA }, /* GL_DYNAMIC_COPY_ARB */ - { 9136, 0x000088E8 }, /* GL_DYNAMIC_DRAW */ - { 9152, 0x000088E8 }, /* GL_DYNAMIC_DRAW_ARB */ - { 9172, 0x000088E9 }, /* GL_DYNAMIC_READ */ - { 9188, 0x000088E9 }, /* GL_DYNAMIC_READ_ARB */ - { 9208, 0x00000B43 }, /* GL_EDGE_FLAG */ - { 9221, 0x00008079 }, /* GL_EDGE_FLAG_ARRAY */ - { 9240, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ - { 9274, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB */ - { 9312, 0x00008093 }, /* GL_EDGE_FLAG_ARRAY_POINTER */ - { 9339, 0x0000808C }, /* GL_EDGE_FLAG_ARRAY_STRIDE */ - { 9365, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER */ - { 9389, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ - { 9421, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB */ - { 9457, 0x00001600 }, /* GL_EMISSION */ - { 9469, 0x00002000 }, /* GL_ENABLE_BIT */ - { 9483, 0x00000202 }, /* GL_EQUAL */ - { 9492, 0x00001509 }, /* GL_EQUIV */ - { 9501, 0x00010000 }, /* GL_EVAL_BIT */ - { 9513, 0x00000800 }, /* GL_EXP */ - { 9520, 0x00000801 }, /* GL_EXP2 */ - { 9528, 0x00001F03 }, /* GL_EXTENSIONS */ - { 9542, 0x00002400 }, /* GL_EYE_LINEAR */ - { 9556, 0x00002502 }, /* GL_EYE_PLANE */ - { 9569, 0x0000855C }, /* GL_EYE_PLANE_ABSOLUTE_NV */ - { 9594, 0x0000855B }, /* GL_EYE_RADIAL_NV */ - { 9611, 0x00000000 }, /* GL_FALSE */ - { 9620, 0x00001101 }, /* GL_FASTEST */ - { 9631, 0x00001C01 }, /* GL_FEEDBACK */ - { 9643, 0x00000DF0 }, /* GL_FEEDBACK_BUFFER_POINTER */ - { 9670, 0x00000DF1 }, /* GL_FEEDBACK_BUFFER_SIZE */ - { 9694, 0x00000DF2 }, /* GL_FEEDBACK_BUFFER_TYPE */ - { 9718, 0x00001B02 }, /* GL_FILL */ - { 9726, 0x00008E4D }, /* GL_FIRST_VERTEX_CONVENTION */ - { 9753, 0x00008E4D }, /* GL_FIRST_VERTEX_CONVENTION_EXT */ - { 9784, 0x00001D00 }, /* GL_FLAT */ - { 9792, 0x00001406 }, /* GL_FLOAT */ - { 9801, 0x00008B5A }, /* GL_FLOAT_MAT2 */ - { 9815, 0x00008B5A }, /* GL_FLOAT_MAT2_ARB */ - { 9833, 0x00008B65 }, /* GL_FLOAT_MAT2x3 */ - { 9849, 0x00008B66 }, /* GL_FLOAT_MAT2x4 */ - { 9865, 0x00008B5B }, /* GL_FLOAT_MAT3 */ - { 9879, 0x00008B5B }, /* GL_FLOAT_MAT3_ARB */ - { 9897, 0x00008B67 }, /* GL_FLOAT_MAT3x2 */ - { 9913, 0x00008B68 }, /* GL_FLOAT_MAT3x4 */ - { 9929, 0x00008B5C }, /* GL_FLOAT_MAT4 */ - { 9943, 0x00008B5C }, /* GL_FLOAT_MAT4_ARB */ - { 9961, 0x00008B69 }, /* GL_FLOAT_MAT4x2 */ - { 9977, 0x00008B6A }, /* GL_FLOAT_MAT4x3 */ - { 9993, 0x00008B50 }, /* GL_FLOAT_VEC2 */ - { 10007, 0x00008B50 }, /* GL_FLOAT_VEC2_ARB */ - { 10025, 0x00008B51 }, /* GL_FLOAT_VEC3 */ - { 10039, 0x00008B51 }, /* GL_FLOAT_VEC3_ARB */ - { 10057, 0x00008B52 }, /* GL_FLOAT_VEC4 */ - { 10071, 0x00008B52 }, /* GL_FLOAT_VEC4_ARB */ - { 10089, 0x00000B60 }, /* GL_FOG */ - { 10096, 0x00000080 }, /* GL_FOG_BIT */ - { 10107, 0x00000B66 }, /* GL_FOG_COLOR */ - { 10120, 0x00008451 }, /* GL_FOG_COORD */ - { 10133, 0x00008451 }, /* GL_FOG_COORDINATE */ - { 10151, 0x00008457 }, /* GL_FOG_COORDINATE_ARRAY */ - { 10175, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ - { 10214, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB */ - { 10257, 0x00008456 }, /* GL_FOG_COORDINATE_ARRAY_POINTER */ - { 10289, 0x00008455 }, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ - { 10320, 0x00008454 }, /* GL_FOG_COORDINATE_ARRAY_TYPE */ - { 10349, 0x00008450 }, /* GL_FOG_COORDINATE_SOURCE */ - { 10374, 0x00008457 }, /* GL_FOG_COORD_ARRAY */ - { 10393, 0x0000889D }, /* GL_FOG_COORD_ARRAY_BUFFER_BINDING */ - { 10427, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */ - { 10454, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */ - { 10480, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */ - { 10504, 0x00008450 }, /* GL_FOG_COORD_SRC */ - { 10521, 0x00000B62 }, /* GL_FOG_DENSITY */ - { 10536, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */ - { 10560, 0x00000B64 }, /* GL_FOG_END */ - { 10571, 0x00000C54 }, /* GL_FOG_HINT */ - { 10583, 0x00000B61 }, /* GL_FOG_INDEX */ - { 10596, 0x00000B65 }, /* GL_FOG_MODE */ - { 10608, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */ - { 10627, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */ - { 10652, 0x00000B63 }, /* GL_FOG_START */ - { 10665, 0x00008452 }, /* GL_FRAGMENT_DEPTH */ - { 10683, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */ - { 10707, 0x00008B30 }, /* GL_FRAGMENT_SHADER */ - { 10726, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */ - { 10749, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ - { 10784, 0x00008D40 }, /* GL_FRAMEBUFFER */ - { 10799, 0x00008215 }, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ - { 10836, 0x00008214 }, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ - { 10872, 0x00008210 }, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ - { 10913, 0x00008211 }, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ - { 10954, 0x00008216 }, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ - { 10991, 0x00008213 }, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ - { 11028, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ - { 11066, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */ - { 11108, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ - { 11146, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */ - { 11188, 0x00008212 }, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ - { 11223, 0x00008217 }, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ - { 11262, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */ - { 11311, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ - { 11359, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */ - { 11411, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ - { 11451, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ - { 11495, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ - { 11535, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */ - { 11579, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */ - { 11606, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE */ - { 11630, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */ - { 11658, 0x00008218 }, /* GL_FRAMEBUFFER_DEFAULT */ - { 11681, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */ - { 11700, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ - { 11737, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */ - { 11778, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ - { 11819, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ - { 11861, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ - { 11912, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ - { 11950, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ - { 11995, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */ - { 12044, 0x00008D56 }, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ - { 12082, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ - { 12124, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ - { 12156, 0x00008219 }, /* GL_FRAMEBUFFER_UNDEFINED */ - { 12181, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED */ - { 12208, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */ - { 12239, 0x00000404 }, /* GL_FRONT */ - { 12248, 0x00000408 }, /* GL_FRONT_AND_BACK */ - { 12266, 0x00000B46 }, /* GL_FRONT_FACE */ - { 12280, 0x00000400 }, /* GL_FRONT_LEFT */ - { 12294, 0x00000401 }, /* GL_FRONT_RIGHT */ - { 12309, 0x00008006 }, /* GL_FUNC_ADD */ - { 12321, 0x00008006 }, /* GL_FUNC_ADD_EXT */ - { 12337, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */ - { 12362, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */ - { 12391, 0x0000800A }, /* GL_FUNC_SUBTRACT */ - { 12408, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */ - { 12429, 0x00008191 }, /* GL_GENERATE_MIPMAP */ - { 12448, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */ - { 12472, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */ - { 12501, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */ - { 12525, 0x00000206 }, /* GL_GEQUAL */ - { 12535, 0x00000204 }, /* GL_GREATER */ - { 12546, 0x00001904 }, /* GL_GREEN */ - { 12555, 0x00000D19 }, /* GL_GREEN_BIAS */ - { 12569, 0x00000D53 }, /* GL_GREEN_BITS */ - { 12583, 0x00000D18 }, /* GL_GREEN_SCALE */ - { 12598, 0x00008000 }, /* GL_HINT_BIT */ - { 12610, 0x00008024 }, /* GL_HISTOGRAM */ - { 12623, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */ - { 12647, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */ - { 12675, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */ - { 12698, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */ - { 12725, 0x00008024 }, /* GL_HISTOGRAM_EXT */ - { 12742, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */ - { 12762, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */ - { 12786, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */ - { 12810, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */ - { 12838, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */ - { 12866, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */ - { 12898, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */ - { 12920, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */ - { 12946, 0x0000802D }, /* GL_HISTOGRAM_SINK */ - { 12964, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */ - { 12986, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */ - { 13005, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */ - { 13028, 0x0000862A }, /* GL_IDENTITY_NV */ - { 13043, 0x00008150 }, /* GL_IGNORE_BORDER_HP */ - { 13063, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ - { 13103, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ - { 13141, 0x00001E02 }, /* GL_INCR */ - { 13149, 0x00008507 }, /* GL_INCR_WRAP */ - { 13162, 0x00008507 }, /* GL_INCR_WRAP_EXT */ - { 13179, 0x00008222 }, /* GL_INDEX */ - { 13188, 0x00008077 }, /* GL_INDEX_ARRAY */ - { 13203, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */ - { 13233, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */ - { 13267, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */ - { 13290, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */ - { 13312, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */ - { 13332, 0x00000D51 }, /* GL_INDEX_BITS */ - { 13346, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */ - { 13367, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */ - { 13385, 0x00000C30 }, /* GL_INDEX_MODE */ - { 13399, 0x00000D13 }, /* GL_INDEX_OFFSET */ - { 13415, 0x00000D12 }, /* GL_INDEX_SHIFT */ - { 13430, 0x00000C21 }, /* GL_INDEX_WRITEMASK */ - { 13449, 0x00008B84 }, /* GL_INFO_LOG_LENGTH */ - { 13468, 0x00001404 }, /* GL_INT */ - { 13475, 0x00008049 }, /* GL_INTENSITY */ - { 13488, 0x0000804C }, /* GL_INTENSITY12 */ - { 13503, 0x0000804C }, /* GL_INTENSITY12_EXT */ - { 13522, 0x0000804D }, /* GL_INTENSITY16 */ - { 13537, 0x0000804D }, /* GL_INTENSITY16_EXT */ - { 13556, 0x0000804A }, /* GL_INTENSITY4 */ - { 13570, 0x0000804A }, /* GL_INTENSITY4_EXT */ - { 13588, 0x0000804B }, /* GL_INTENSITY8 */ - { 13602, 0x0000804B }, /* GL_INTENSITY8_EXT */ - { 13620, 0x00008049 }, /* GL_INTENSITY_EXT */ - { 13637, 0x00008575 }, /* GL_INTERPOLATE */ - { 13652, 0x00008575 }, /* GL_INTERPOLATE_ARB */ - { 13671, 0x00008575 }, /* GL_INTERPOLATE_EXT */ - { 13690, 0x00008B53 }, /* GL_INT_VEC2 */ - { 13702, 0x00008B53 }, /* GL_INT_VEC2_ARB */ - { 13718, 0x00008B54 }, /* GL_INT_VEC3 */ - { 13730, 0x00008B54 }, /* GL_INT_VEC3_ARB */ - { 13746, 0x00008B55 }, /* GL_INT_VEC4 */ - { 13758, 0x00008B55 }, /* GL_INT_VEC4_ARB */ - { 13774, 0x00000500 }, /* GL_INVALID_ENUM */ - { 13790, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION */ - { 13823, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ - { 13860, 0x00000502 }, /* GL_INVALID_OPERATION */ - { 13881, 0x00000501 }, /* GL_INVALID_VALUE */ - { 13898, 0x0000862B }, /* GL_INVERSE_NV */ - { 13912, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */ - { 13936, 0x0000150A }, /* GL_INVERT */ - { 13946, 0x00001E00 }, /* GL_KEEP */ - { 13954, 0x00008E4E }, /* GL_LAST_VERTEX_CONVENTION */ - { 13980, 0x00008E4E }, /* GL_LAST_VERTEX_CONVENTION_EXT */ - { 14010, 0x00000406 }, /* GL_LEFT */ - { 14018, 0x00000203 }, /* GL_LEQUAL */ - { 14028, 0x00000201 }, /* GL_LESS */ - { 14036, 0x00004000 }, /* GL_LIGHT0 */ - { 14046, 0x00004001 }, /* GL_LIGHT1 */ - { 14056, 0x00004002 }, /* GL_LIGHT2 */ - { 14066, 0x00004003 }, /* GL_LIGHT3 */ - { 14076, 0x00004004 }, /* GL_LIGHT4 */ - { 14086, 0x00004005 }, /* GL_LIGHT5 */ - { 14096, 0x00004006 }, /* GL_LIGHT6 */ - { 14106, 0x00004007 }, /* GL_LIGHT7 */ - { 14116, 0x00000B50 }, /* GL_LIGHTING */ - { 14128, 0x00000040 }, /* GL_LIGHTING_BIT */ - { 14144, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */ - { 14167, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */ - { 14196, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */ - { 14229, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ - { 14257, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */ - { 14281, 0x00001B01 }, /* GL_LINE */ - { 14289, 0x00002601 }, /* GL_LINEAR */ - { 14299, 0x00001208 }, /* GL_LINEAR_ATTENUATION */ - { 14321, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ - { 14351, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ - { 14382, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */ - { 14406, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */ - { 14431, 0x00000001 }, /* GL_LINES */ - { 14440, 0x00000004 }, /* GL_LINE_BIT */ - { 14452, 0x00000002 }, /* GL_LINE_LOOP */ - { 14465, 0x00000707 }, /* GL_LINE_RESET_TOKEN */ - { 14485, 0x00000B20 }, /* GL_LINE_SMOOTH */ - { 14500, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */ - { 14520, 0x00000B24 }, /* GL_LINE_STIPPLE */ - { 14536, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */ - { 14560, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */ - { 14583, 0x00000003 }, /* GL_LINE_STRIP */ - { 14597, 0x00000702 }, /* GL_LINE_TOKEN */ - { 14611, 0x00000B21 }, /* GL_LINE_WIDTH */ - { 14625, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */ - { 14651, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */ - { 14671, 0x00008B82 }, /* GL_LINK_STATUS */ - { 14686, 0x00000B32 }, /* GL_LIST_BASE */ - { 14699, 0x00020000 }, /* GL_LIST_BIT */ - { 14711, 0x00000B33 }, /* GL_LIST_INDEX */ - { 14725, 0x00000B30 }, /* GL_LIST_MODE */ - { 14738, 0x00000101 }, /* GL_LOAD */ - { 14746, 0x00000BF1 }, /* GL_LOGIC_OP */ - { 14758, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */ - { 14775, 0x00008CA1 }, /* GL_LOWER_LEFT */ - { 14789, 0x00001909 }, /* GL_LUMINANCE */ - { 14802, 0x00008041 }, /* GL_LUMINANCE12 */ - { 14817, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */ - { 14840, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */ - { 14867, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */ - { 14889, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */ - { 14915, 0x00008041 }, /* GL_LUMINANCE12_EXT */ - { 14934, 0x00008042 }, /* GL_LUMINANCE16 */ - { 14949, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */ - { 14972, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */ - { 14999, 0x00008042 }, /* GL_LUMINANCE16_EXT */ - { 15018, 0x0000803F }, /* GL_LUMINANCE4 */ - { 15032, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */ - { 15053, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */ - { 15078, 0x0000803F }, /* GL_LUMINANCE4_EXT */ - { 15096, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */ - { 15117, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */ - { 15142, 0x00008040 }, /* GL_LUMINANCE8 */ - { 15156, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */ - { 15177, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */ - { 15202, 0x00008040 }, /* GL_LUMINANCE8_EXT */ - { 15220, 0x0000190A }, /* GL_LUMINANCE_ALPHA */ - { 15239, 0x00000D90 }, /* GL_MAP1_COLOR_4 */ - { 15255, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */ - { 15275, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */ - { 15297, 0x00000D91 }, /* GL_MAP1_INDEX */ - { 15311, 0x00000D92 }, /* GL_MAP1_NORMAL */ - { 15326, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */ - { 15350, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */ - { 15374, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */ - { 15398, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */ - { 15422, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */ - { 15439, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */ - { 15456, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ - { 15484, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ - { 15513, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ - { 15542, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ - { 15571, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ - { 15600, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ - { 15629, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ - { 15658, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ - { 15686, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ - { 15714, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ - { 15742, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ - { 15770, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ - { 15798, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ - { 15826, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ - { 15854, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ - { 15882, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ - { 15910, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */ - { 15926, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */ - { 15946, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */ - { 15968, 0x00000DB1 }, /* GL_MAP2_INDEX */ - { 15982, 0x00000DB2 }, /* GL_MAP2_NORMAL */ - { 15997, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */ - { 16021, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */ - { 16045, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */ - { 16069, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */ - { 16093, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */ - { 16110, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */ - { 16127, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ - { 16155, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ - { 16184, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ - { 16213, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ - { 16242, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ - { 16271, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ - { 16300, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ - { 16329, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ - { 16357, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ - { 16385, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ - { 16413, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ - { 16441, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ - { 16469, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ - { 16497, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */ - { 16525, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ - { 16553, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ - { 16581, 0x00000D10 }, /* GL_MAP_COLOR */ - { 16594, 0x00000010 }, /* GL_MAP_FLUSH_EXPLICIT_BIT */ - { 16620, 0x00000008 }, /* GL_MAP_INVALIDATE_BUFFER_BIT */ - { 16649, 0x00000004 }, /* GL_MAP_INVALIDATE_RANGE_BIT */ - { 16677, 0x00000001 }, /* GL_MAP_READ_BIT */ - { 16693, 0x00000D11 }, /* GL_MAP_STENCIL */ - { 16708, 0x00000020 }, /* GL_MAP_UNSYNCHRONIZED_BIT */ - { 16734, 0x00000002 }, /* GL_MAP_WRITE_BIT */ - { 16751, 0x000088C0 }, /* GL_MATRIX0_ARB */ - { 16766, 0x00008630 }, /* GL_MATRIX0_NV */ - { 16780, 0x000088CA }, /* GL_MATRIX10_ARB */ - { 16796, 0x000088CB }, /* GL_MATRIX11_ARB */ - { 16812, 0x000088CC }, /* GL_MATRIX12_ARB */ - { 16828, 0x000088CD }, /* GL_MATRIX13_ARB */ - { 16844, 0x000088CE }, /* GL_MATRIX14_ARB */ - { 16860, 0x000088CF }, /* GL_MATRIX15_ARB */ - { 16876, 0x000088D0 }, /* GL_MATRIX16_ARB */ - { 16892, 0x000088D1 }, /* GL_MATRIX17_ARB */ - { 16908, 0x000088D2 }, /* GL_MATRIX18_ARB */ - { 16924, 0x000088D3 }, /* GL_MATRIX19_ARB */ - { 16940, 0x000088C1 }, /* GL_MATRIX1_ARB */ - { 16955, 0x00008631 }, /* GL_MATRIX1_NV */ - { 16969, 0x000088D4 }, /* GL_MATRIX20_ARB */ - { 16985, 0x000088D5 }, /* GL_MATRIX21_ARB */ - { 17001, 0x000088D6 }, /* GL_MATRIX22_ARB */ - { 17017, 0x000088D7 }, /* GL_MATRIX23_ARB */ - { 17033, 0x000088D8 }, /* GL_MATRIX24_ARB */ - { 17049, 0x000088D9 }, /* GL_MATRIX25_ARB */ - { 17065, 0x000088DA }, /* GL_MATRIX26_ARB */ - { 17081, 0x000088DB }, /* GL_MATRIX27_ARB */ - { 17097, 0x000088DC }, /* GL_MATRIX28_ARB */ - { 17113, 0x000088DD }, /* GL_MATRIX29_ARB */ - { 17129, 0x000088C2 }, /* GL_MATRIX2_ARB */ - { 17144, 0x00008632 }, /* GL_MATRIX2_NV */ - { 17158, 0x000088DE }, /* GL_MATRIX30_ARB */ - { 17174, 0x000088DF }, /* GL_MATRIX31_ARB */ - { 17190, 0x000088C3 }, /* GL_MATRIX3_ARB */ - { 17205, 0x00008633 }, /* GL_MATRIX3_NV */ - { 17219, 0x000088C4 }, /* GL_MATRIX4_ARB */ - { 17234, 0x00008634 }, /* GL_MATRIX4_NV */ - { 17248, 0x000088C5 }, /* GL_MATRIX5_ARB */ - { 17263, 0x00008635 }, /* GL_MATRIX5_NV */ - { 17277, 0x000088C6 }, /* GL_MATRIX6_ARB */ - { 17292, 0x00008636 }, /* GL_MATRIX6_NV */ - { 17306, 0x000088C7 }, /* GL_MATRIX7_ARB */ - { 17321, 0x00008637 }, /* GL_MATRIX7_NV */ - { 17335, 0x000088C8 }, /* GL_MATRIX8_ARB */ - { 17350, 0x000088C9 }, /* GL_MATRIX9_ARB */ - { 17365, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */ - { 17391, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ - { 17425, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ - { 17456, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ - { 17489, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ - { 17520, 0x00000BA0 }, /* GL_MATRIX_MODE */ - { 17535, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */ - { 17557, 0x00008008 }, /* GL_MAX */ - { 17564, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */ - { 17587, 0x000088FF }, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ - { 17619, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */ - { 17645, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ - { 17678, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ - { 17704, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - { 17738, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */ - { 17757, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ - { 17786, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ - { 17818, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */ - { 17854, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ - { 17890, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */ - { 17930, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */ - { 17956, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */ - { 17986, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */ - { 18011, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */ - { 18040, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ - { 18069, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */ - { 18102, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS */ - { 18122, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */ - { 18146, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */ - { 18170, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */ - { 18194, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */ - { 18219, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */ - { 18237, 0x00008008 }, /* GL_MAX_EXT */ - { 18248, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ - { 18283, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */ - { 18322, 0x00000D31 }, /* GL_MAX_LIGHTS */ - { 18336, 0x00000B31 }, /* GL_MAX_LIST_NESTING */ - { 18356, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ - { 18394, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */ - { 18423, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */ - { 18447, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */ - { 18475, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */ - { 18498, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ - { 18535, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ - { 18571, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ - { 18598, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ - { 18627, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ - { 18661, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ - { 18697, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ - { 18724, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ - { 18756, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ - { 18792, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ - { 18821, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ - { 18850, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */ - { 18878, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ - { 18916, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - { 18960, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - { 19003, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ - { 19037, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - { 19076, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ - { 19113, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ - { 19151, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - { 19194, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - { 19237, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ - { 19267, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ - { 19298, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ - { 19334, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ - { 19370, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */ - { 19400, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ - { 19434, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */ - { 19467, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ - { 19496, 0x00008D57 }, /* GL_MAX_SAMPLES */ - { 19511, 0x00009111 }, /* GL_MAX_SERVER_WAIT_TIMEOUT */ - { 19538, 0x00008504 }, /* GL_MAX_SHININESS_NV */ - { 19558, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */ - { 19582, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS */ - { 19604, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */ - { 19630, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS */ - { 19657, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */ - { 19688, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */ - { 19712, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ - { 19746, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */ - { 19766, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */ - { 19793, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */ - { 19814, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */ - { 19839, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */ - { 19864, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */ - { 19899, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */ - { 19921, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */ - { 19947, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */ - { 19969, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */ - { 19995, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ - { 20029, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ - { 20067, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ - { 20100, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */ - { 20137, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */ - { 20161, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */ - { 20182, 0x00008007 }, /* GL_MIN */ - { 20189, 0x0000802E }, /* GL_MINMAX */ - { 20199, 0x0000802E }, /* GL_MINMAX_EXT */ - { 20213, 0x0000802F }, /* GL_MINMAX_FORMAT */ - { 20230, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */ - { 20251, 0x00008030 }, /* GL_MINMAX_SINK */ - { 20266, 0x00008030 }, /* GL_MINMAX_SINK_EXT */ - { 20285, 0x00008007 }, /* GL_MIN_EXT */ - { 20296, 0x00008370 }, /* GL_MIRRORED_REPEAT */ - { 20315, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */ - { 20338, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */ - { 20361, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */ - { 20381, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */ - { 20401, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ - { 20431, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */ - { 20459, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ - { 20487, 0x00001700 }, /* GL_MODELVIEW */ - { 20500, 0x00001700 }, /* GL_MODELVIEW0_ARB */ - { 20518, 0x0000872A }, /* GL_MODELVIEW10_ARB */ - { 20537, 0x0000872B }, /* GL_MODELVIEW11_ARB */ - { 20556, 0x0000872C }, /* GL_MODELVIEW12_ARB */ - { 20575, 0x0000872D }, /* GL_MODELVIEW13_ARB */ - { 20594, 0x0000872E }, /* GL_MODELVIEW14_ARB */ - { 20613, 0x0000872F }, /* GL_MODELVIEW15_ARB */ - { 20632, 0x00008730 }, /* GL_MODELVIEW16_ARB */ - { 20651, 0x00008731 }, /* GL_MODELVIEW17_ARB */ - { 20670, 0x00008732 }, /* GL_MODELVIEW18_ARB */ - { 20689, 0x00008733 }, /* GL_MODELVIEW19_ARB */ - { 20708, 0x0000850A }, /* GL_MODELVIEW1_ARB */ - { 20726, 0x00008734 }, /* GL_MODELVIEW20_ARB */ - { 20745, 0x00008735 }, /* GL_MODELVIEW21_ARB */ - { 20764, 0x00008736 }, /* GL_MODELVIEW22_ARB */ - { 20783, 0x00008737 }, /* GL_MODELVIEW23_ARB */ - { 20802, 0x00008738 }, /* GL_MODELVIEW24_ARB */ - { 20821, 0x00008739 }, /* GL_MODELVIEW25_ARB */ - { 20840, 0x0000873A }, /* GL_MODELVIEW26_ARB */ - { 20859, 0x0000873B }, /* GL_MODELVIEW27_ARB */ - { 20878, 0x0000873C }, /* GL_MODELVIEW28_ARB */ - { 20897, 0x0000873D }, /* GL_MODELVIEW29_ARB */ - { 20916, 0x00008722 }, /* GL_MODELVIEW2_ARB */ - { 20934, 0x0000873E }, /* GL_MODELVIEW30_ARB */ - { 20953, 0x0000873F }, /* GL_MODELVIEW31_ARB */ - { 20972, 0x00008723 }, /* GL_MODELVIEW3_ARB */ - { 20990, 0x00008724 }, /* GL_MODELVIEW4_ARB */ - { 21008, 0x00008725 }, /* GL_MODELVIEW5_ARB */ - { 21026, 0x00008726 }, /* GL_MODELVIEW6_ARB */ - { 21044, 0x00008727 }, /* GL_MODELVIEW7_ARB */ - { 21062, 0x00008728 }, /* GL_MODELVIEW8_ARB */ - { 21080, 0x00008729 }, /* GL_MODELVIEW9_ARB */ - { 21098, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */ - { 21118, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */ - { 21145, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */ - { 21170, 0x00002100 }, /* GL_MODULATE */ - { 21182, 0x00008744 }, /* GL_MODULATE_ADD_ATI */ - { 21202, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */ - { 21229, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */ - { 21254, 0x00000103 }, /* GL_MULT */ - { 21262, 0x0000809D }, /* GL_MULTISAMPLE */ - { 21277, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */ - { 21297, 0x0000809D }, /* GL_MULTISAMPLE_ARB */ - { 21316, 0x20000000 }, /* GL_MULTISAMPLE_BIT */ - { 21335, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */ - { 21359, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */ - { 21382, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */ - { 21412, 0x00002A25 }, /* GL_N3F_V3F */ - { 21423, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */ - { 21443, 0x0000150E }, /* GL_NAND */ - { 21451, 0x00002600 }, /* GL_NEAREST */ - { 21462, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ - { 21493, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ - { 21525, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */ - { 21550, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */ - { 21576, 0x00000200 }, /* GL_NEVER */ - { 21585, 0x00001102 }, /* GL_NICEST */ - { 21595, 0x00000000 }, /* GL_NONE */ - { 21603, 0x00001505 }, /* GL_NOOP */ - { 21611, 0x00001508 }, /* GL_NOR */ - { 21618, 0x00000BA1 }, /* GL_NORMALIZE */ - { 21631, 0x00008075 }, /* GL_NORMAL_ARRAY */ - { 21647, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ - { 21678, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */ - { 21713, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */ - { 21737, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */ - { 21760, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */ - { 21781, 0x00008511 }, /* GL_NORMAL_MAP */ - { 21795, 0x00008511 }, /* GL_NORMAL_MAP_ARB */ - { 21813, 0x00008511 }, /* GL_NORMAL_MAP_NV */ - { 21830, 0x00000205 }, /* GL_NOTEQUAL */ - { 21842, 0x00000000 }, /* GL_NO_ERROR */ - { 21854, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ - { 21888, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB */ - { 21926, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */ - { 21958, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */ - { 22000, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */ - { 22030, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */ - { 22070, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */ - { 22101, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */ - { 22130, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */ - { 22158, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */ - { 22188, 0x00002401 }, /* GL_OBJECT_LINEAR */ - { 22205, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */ - { 22231, 0x00002501 }, /* GL_OBJECT_PLANE */ - { 22247, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */ - { 22282, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */ - { 22304, 0x00009112 }, /* GL_OBJECT_TYPE */ - { 22319, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */ - { 22338, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */ - { 22368, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */ - { 22389, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */ - { 22417, 0x00000001 }, /* GL_ONE */ - { 22424, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */ - { 22452, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */ - { 22484, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */ - { 22512, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */ - { 22544, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */ - { 22567, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */ - { 22590, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */ - { 22613, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */ - { 22636, 0x00008598 }, /* GL_OPERAND0_ALPHA */ - { 22654, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */ - { 22676, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */ - { 22698, 0x00008590 }, /* GL_OPERAND0_RGB */ - { 22714, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */ - { 22734, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */ - { 22754, 0x00008599 }, /* GL_OPERAND1_ALPHA */ - { 22772, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */ - { 22794, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */ - { 22816, 0x00008591 }, /* GL_OPERAND1_RGB */ - { 22832, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */ - { 22852, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */ - { 22872, 0x0000859A }, /* GL_OPERAND2_ALPHA */ - { 22890, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */ - { 22912, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */ - { 22934, 0x00008592 }, /* GL_OPERAND2_RGB */ - { 22950, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */ - { 22970, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */ - { 22990, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */ - { 23011, 0x00008593 }, /* GL_OPERAND3_RGB_NV */ - { 23030, 0x00001507 }, /* GL_OR */ - { 23036, 0x00000A01 }, /* GL_ORDER */ - { 23045, 0x0000150D }, /* GL_OR_INVERTED */ - { 23060, 0x0000150B }, /* GL_OR_REVERSE */ - { 23074, 0x00000505 }, /* GL_OUT_OF_MEMORY */ - { 23091, 0x00000D05 }, /* GL_PACK_ALIGNMENT */ - { 23109, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */ - { 23130, 0x00008758 }, /* GL_PACK_INVERT_MESA */ - { 23150, 0x00000D01 }, /* GL_PACK_LSB_FIRST */ - { 23168, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */ - { 23187, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */ - { 23207, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */ - { 23227, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */ - { 23245, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */ - { 23264, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */ - { 23289, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */ - { 23313, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */ - { 23334, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */ - { 23356, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */ - { 23378, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */ - { 23403, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */ - { 23427, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */ - { 23448, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */ - { 23470, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */ - { 23492, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */ - { 23514, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */ - { 23545, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */ - { 23565, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */ - { 23590, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */ - { 23610, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */ - { 23635, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */ - { 23655, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */ - { 23680, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */ - { 23700, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */ - { 23725, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */ - { 23745, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */ - { 23770, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */ - { 23790, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */ - { 23815, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */ - { 23835, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */ - { 23860, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */ - { 23880, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */ - { 23905, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */ - { 23925, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */ - { 23950, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */ - { 23970, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */ - { 23995, 0x00000020 }, /* GL_PIXEL_MODE_BIT */ - { 24013, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER */ - { 24034, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING */ - { 24063, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */ - { 24096, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */ - { 24121, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER */ - { 24144, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING */ - { 24175, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */ - { 24210, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */ - { 24237, 0x00001B00 }, /* GL_POINT */ - { 24246, 0x00000000 }, /* GL_POINTS */ - { 24256, 0x00000002 }, /* GL_POINT_BIT */ - { 24269, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */ - { 24299, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */ - { 24333, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */ - { 24367, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */ - { 24402, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */ - { 24431, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */ - { 24464, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */ - { 24497, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */ - { 24531, 0x00000B11 }, /* GL_POINT_SIZE */ - { 24545, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */ - { 24571, 0x00008127 }, /* GL_POINT_SIZE_MAX */ - { 24589, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */ - { 24611, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */ - { 24633, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */ - { 24656, 0x00008126 }, /* GL_POINT_SIZE_MIN */ - { 24674, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */ - { 24696, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */ - { 24718, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */ - { 24741, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */ - { 24761, 0x00000B10 }, /* GL_POINT_SMOOTH */ - { 24777, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */ - { 24798, 0x00008861 }, /* GL_POINT_SPRITE */ - { 24814, 0x00008861 }, /* GL_POINT_SPRITE_ARB */ - { 24834, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */ - { 24863, 0x00008861 }, /* GL_POINT_SPRITE_NV */ - { 24882, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */ - { 24908, 0x00000701 }, /* GL_POINT_TOKEN */ - { 24923, 0x00000009 }, /* GL_POLYGON */ - { 24934, 0x00000008 }, /* GL_POLYGON_BIT */ - { 24949, 0x00000B40 }, /* GL_POLYGON_MODE */ - { 24965, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */ - { 24988, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */ - { 25013, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */ - { 25036, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */ - { 25059, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */ - { 25083, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */ - { 25107, 0x00000B41 }, /* GL_POLYGON_SMOOTH */ - { 25125, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */ - { 25148, 0x00000B42 }, /* GL_POLYGON_STIPPLE */ - { 25167, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */ - { 25190, 0x00000703 }, /* GL_POLYGON_TOKEN */ - { 25207, 0x00001203 }, /* GL_POSITION */ - { 25219, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ - { 25251, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */ - { 25287, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ - { 25320, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */ - { 25357, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ - { 25388, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */ - { 25423, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ - { 25455, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */ - { 25491, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ - { 25524, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ - { 25556, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */ - { 25592, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ - { 25625, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */ - { 25662, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */ - { 25692, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */ - { 25726, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */ - { 25757, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */ - { 25792, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ - { 25823, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */ - { 25858, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ - { 25890, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */ - { 25926, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */ - { 25956, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */ - { 25990, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */ - { 26021, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */ - { 26056, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */ - { 26088, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */ - { 26119, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */ - { 26154, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */ - { 26186, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */ - { 26222, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */ - { 26251, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */ - { 26284, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */ - { 26314, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */ - { 26348, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ - { 26387, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ - { 26420, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ - { 26460, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ - { 26494, 0x00008578 }, /* GL_PREVIOUS */ - { 26506, 0x00008578 }, /* GL_PREVIOUS_ARB */ - { 26522, 0x00008578 }, /* GL_PREVIOUS_EXT */ - { 26538, 0x00008577 }, /* GL_PRIMARY_COLOR */ - { 26555, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */ - { 26576, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */ - { 26597, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ - { 26630, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ - { 26662, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */ - { 26685, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */ - { 26708, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */ - { 26738, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */ - { 26767, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */ - { 26795, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */ - { 26817, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */ - { 26845, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */ - { 26873, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */ - { 26895, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */ - { 26916, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - { 26956, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - { 26995, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ - { 27025, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - { 27060, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ - { 27093, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ - { 27127, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - { 27166, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - { 27205, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */ - { 27227, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */ - { 27253, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */ - { 27277, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */ - { 27300, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */ - { 27322, 0x00008628 }, /* GL_PROGRAM_STRING_NV */ - { 27343, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */ - { 27364, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */ - { 27391, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ - { 27423, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ - { 27455, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ - { 27490, 0x00001701 }, /* GL_PROJECTION */ - { 27504, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */ - { 27525, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */ - { 27551, 0x00008E4F }, /* GL_PROVOKING_VERTEX */ - { 27571, 0x00008E4F }, /* GL_PROVOKING_VERTEX_EXT */ - { 27595, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */ - { 27616, 0x00008025 }, /* GL_PROXY_HISTOGRAM */ - { 27635, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */ - { 27658, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ - { 27697, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ - { 27735, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */ - { 27755, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ - { 27785, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */ - { 27809, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */ - { 27829, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ - { 27859, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */ - { 27883, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */ - { 27903, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ - { 27936, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */ - { 27962, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */ - { 27992, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ - { 28023, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */ - { 28053, 0x00002003 }, /* GL_Q */ - { 28058, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */ - { 28083, 0x00000007 }, /* GL_QUADS */ - { 28092, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */ - { 28136, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT */ - { 28184, 0x00008614 }, /* GL_QUAD_MESH_SUN */ - { 28201, 0x00000008 }, /* GL_QUAD_STRIP */ - { 28215, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */ - { 28237, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */ - { 28263, 0x00008866 }, /* GL_QUERY_RESULT */ - { 28279, 0x00008866 }, /* GL_QUERY_RESULT_ARB */ - { 28299, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */ - { 28325, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */ - { 28355, 0x00002002 }, /* GL_R */ - { 28360, 0x00002A10 }, /* GL_R3_G3_B2 */ - { 28372, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ - { 28405, 0x00000C02 }, /* GL_READ_BUFFER */ - { 28420, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER */ - { 28440, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ - { 28472, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */ - { 28496, 0x000088B8 }, /* GL_READ_ONLY */ - { 28509, 0x000088B8 }, /* GL_READ_ONLY_ARB */ - { 28526, 0x000088BA }, /* GL_READ_WRITE */ - { 28540, 0x000088BA }, /* GL_READ_WRITE_ARB */ - { 28558, 0x00001903 }, /* GL_RED */ - { 28565, 0x00008016 }, /* GL_REDUCE */ - { 28575, 0x00008016 }, /* GL_REDUCE_EXT */ - { 28589, 0x00000D15 }, /* GL_RED_BIAS */ - { 28601, 0x00000D52 }, /* GL_RED_BITS */ - { 28613, 0x00000D14 }, /* GL_RED_SCALE */ - { 28626, 0x00008512 }, /* GL_REFLECTION_MAP */ - { 28644, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */ - { 28666, 0x00008512 }, /* GL_REFLECTION_MAP_NV */ - { 28687, 0x00001C00 }, /* GL_RENDER */ - { 28697, 0x00008D41 }, /* GL_RENDERBUFFER */ - { 28713, 0x00008D53 }, /* GL_RENDERBUFFER_ALPHA_SIZE */ - { 28740, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */ - { 28768, 0x00008D52 }, /* GL_RENDERBUFFER_BLUE_SIZE */ - { 28794, 0x00008D54 }, /* GL_RENDERBUFFER_DEPTH_SIZE */ - { 28821, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */ - { 28841, 0x00008D51 }, /* GL_RENDERBUFFER_GREEN_SIZE */ - { 28868, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT */ - { 28891, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */ - { 28918, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ - { 28950, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ - { 28986, 0x00008D50 }, /* GL_RENDERBUFFER_RED_SIZE */ - { 29011, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES */ - { 29035, 0x00008D55 }, /* GL_RENDERBUFFER_STENCIL_SIZE */ - { 29064, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH */ - { 29086, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */ - { 29112, 0x00001F01 }, /* GL_RENDERER */ - { 29124, 0x00000C40 }, /* GL_RENDER_MODE */ - { 29139, 0x00002901 }, /* GL_REPEAT */ - { 29149, 0x00001E01 }, /* GL_REPLACE */ - { 29160, 0x00008062 }, /* GL_REPLACE_EXT */ - { 29175, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */ - { 29198, 0x0000803A }, /* GL_RESCALE_NORMAL */ - { 29216, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */ - { 29238, 0x00000102 }, /* GL_RETURN */ - { 29248, 0x00001907 }, /* GL_RGB */ - { 29255, 0x00008052 }, /* GL_RGB10 */ - { 29264, 0x00008059 }, /* GL_RGB10_A2 */ - { 29276, 0x00008059 }, /* GL_RGB10_A2_EXT */ - { 29292, 0x00008052 }, /* GL_RGB10_EXT */ - { 29305, 0x00008053 }, /* GL_RGB12 */ - { 29314, 0x00008053 }, /* GL_RGB12_EXT */ - { 29327, 0x00008054 }, /* GL_RGB16 */ - { 29336, 0x00008054 }, /* GL_RGB16_EXT */ - { 29349, 0x0000804E }, /* GL_RGB2_EXT */ - { 29361, 0x0000804F }, /* GL_RGB4 */ - { 29369, 0x0000804F }, /* GL_RGB4_EXT */ - { 29381, 0x000083A1 }, /* GL_RGB4_S3TC */ - { 29394, 0x00008050 }, /* GL_RGB5 */ - { 29402, 0x00008057 }, /* GL_RGB5_A1 */ - { 29413, 0x00008057 }, /* GL_RGB5_A1_EXT */ - { 29428, 0x00008050 }, /* GL_RGB5_EXT */ - { 29440, 0x00008051 }, /* GL_RGB8 */ - { 29448, 0x00008051 }, /* GL_RGB8_EXT */ - { 29460, 0x00001908 }, /* GL_RGBA */ - { 29468, 0x0000805A }, /* GL_RGBA12 */ - { 29478, 0x0000805A }, /* GL_RGBA12_EXT */ - { 29492, 0x0000805B }, /* GL_RGBA16 */ - { 29502, 0x0000805B }, /* GL_RGBA16_EXT */ - { 29516, 0x00008055 }, /* GL_RGBA2 */ - { 29525, 0x00008055 }, /* GL_RGBA2_EXT */ - { 29538, 0x00008056 }, /* GL_RGBA4 */ - { 29547, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */ - { 29566, 0x00008056 }, /* GL_RGBA4_EXT */ - { 29579, 0x000083A3 }, /* GL_RGBA4_S3TC */ - { 29593, 0x00008058 }, /* GL_RGBA8 */ - { 29602, 0x00008058 }, /* GL_RGBA8_EXT */ - { 29615, 0x00008F97 }, /* GL_RGBA8_SNORM */ - { 29630, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */ - { 29648, 0x00000C31 }, /* GL_RGBA_MODE */ - { 29661, 0x000083A2 }, /* GL_RGBA_S3TC */ - { 29674, 0x00008F93 }, /* GL_RGBA_SNORM */ - { 29688, 0x000083A0 }, /* GL_RGB_S3TC */ - { 29700, 0x00008573 }, /* GL_RGB_SCALE */ - { 29713, 0x00008573 }, /* GL_RGB_SCALE_ARB */ - { 29730, 0x00008573 }, /* GL_RGB_SCALE_EXT */ - { 29747, 0x00000407 }, /* GL_RIGHT */ - { 29756, 0x00002000 }, /* GL_S */ - { 29761, 0x00008B5D }, /* GL_SAMPLER_1D */ - { 29775, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */ - { 29796, 0x00008B5E }, /* GL_SAMPLER_2D */ - { 29810, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */ - { 29831, 0x00008B5F }, /* GL_SAMPLER_3D */ - { 29845, 0x00008B60 }, /* GL_SAMPLER_CUBE */ - { 29861, 0x000080A9 }, /* GL_SAMPLES */ - { 29872, 0x000086B4 }, /* GL_SAMPLES_3DFX */ - { 29888, 0x000080A9 }, /* GL_SAMPLES_ARB */ - { 29903, 0x00008914 }, /* GL_SAMPLES_PASSED */ - { 29921, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */ - { 29943, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ - { 29971, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */ - { 30003, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */ - { 30026, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */ - { 30053, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */ - { 30071, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */ - { 30094, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */ - { 30116, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */ - { 30135, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */ - { 30158, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */ - { 30184, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */ - { 30214, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */ - { 30239, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */ - { 30268, 0x00080000 }, /* GL_SCISSOR_BIT */ - { 30283, 0x00000C10 }, /* GL_SCISSOR_BOX */ - { 30298, 0x00000C11 }, /* GL_SCISSOR_TEST */ - { 30314, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */ - { 30339, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ - { 30379, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */ - { 30423, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ - { 30456, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ - { 30486, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ - { 30518, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ - { 30548, 0x00001C02 }, /* GL_SELECT */ - { 30558, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */ - { 30586, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */ - { 30611, 0x00008012 }, /* GL_SEPARABLE_2D */ - { 30627, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */ - { 30654, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */ - { 30685, 0x0000150F }, /* GL_SET */ - { 30692, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */ - { 30713, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */ - { 30737, 0x00008B4F }, /* GL_SHADER_TYPE */ - { 30752, 0x00000B54 }, /* GL_SHADE_MODEL */ - { 30767, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */ - { 30795, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */ - { 30818, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */ - { 30848, 0x00001601 }, /* GL_SHININESS */ - { 30861, 0x00001402 }, /* GL_SHORT */ - { 30870, 0x00009119 }, /* GL_SIGNALED */ - { 30882, 0x00008F9C }, /* GL_SIGNED_NORMALIZED */ - { 30903, 0x000081F9 }, /* GL_SINGLE_COLOR */ - { 30919, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */ - { 30939, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */ - { 30958, 0x00008C46 }, /* GL_SLUMINANCE */ - { 30972, 0x00008C47 }, /* GL_SLUMINANCE8 */ - { 30987, 0x00008C45 }, /* GL_SLUMINANCE8_ALPHA8 */ - { 31009, 0x00008C44 }, /* GL_SLUMINANCE_ALPHA */ - { 31029, 0x00001D01 }, /* GL_SMOOTH */ - { 31039, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */ - { 31072, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */ - { 31099, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */ - { 31132, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */ - { 31159, 0x00008588 }, /* GL_SOURCE0_ALPHA */ - { 31176, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */ - { 31197, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */ - { 31218, 0x00008580 }, /* GL_SOURCE0_RGB */ - { 31233, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */ - { 31252, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */ - { 31271, 0x00008589 }, /* GL_SOURCE1_ALPHA */ - { 31288, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */ - { 31309, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */ - { 31330, 0x00008581 }, /* GL_SOURCE1_RGB */ - { 31345, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */ - { 31364, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */ - { 31383, 0x0000858A }, /* GL_SOURCE2_ALPHA */ - { 31400, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */ - { 31421, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */ - { 31442, 0x00008582 }, /* GL_SOURCE2_RGB */ - { 31457, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */ - { 31476, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */ - { 31495, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */ - { 31515, 0x00008583 }, /* GL_SOURCE3_RGB_NV */ - { 31533, 0x00001202 }, /* GL_SPECULAR */ - { 31545, 0x00002402 }, /* GL_SPHERE_MAP */ - { 31559, 0x00001206 }, /* GL_SPOT_CUTOFF */ - { 31574, 0x00001204 }, /* GL_SPOT_DIRECTION */ - { 31592, 0x00001205 }, /* GL_SPOT_EXPONENT */ - { 31609, 0x00008588 }, /* GL_SRC0_ALPHA */ - { 31623, 0x00008580 }, /* GL_SRC0_RGB */ - { 31635, 0x00008589 }, /* GL_SRC1_ALPHA */ - { 31649, 0x00008581 }, /* GL_SRC1_RGB */ - { 31661, 0x0000858A }, /* GL_SRC2_ALPHA */ - { 31675, 0x00008582 }, /* GL_SRC2_RGB */ - { 31687, 0x00000302 }, /* GL_SRC_ALPHA */ - { 31700, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */ - { 31722, 0x00000300 }, /* GL_SRC_COLOR */ - { 31735, 0x00008C40 }, /* GL_SRGB */ - { 31743, 0x00008C41 }, /* GL_SRGB8 */ - { 31752, 0x00008C43 }, /* GL_SRGB8_ALPHA8 */ - { 31768, 0x00008C42 }, /* GL_SRGB_ALPHA */ - { 31782, 0x00000503 }, /* GL_STACK_OVERFLOW */ - { 31800, 0x00000504 }, /* GL_STACK_UNDERFLOW */ - { 31819, 0x000088E6 }, /* GL_STATIC_COPY */ - { 31834, 0x000088E6 }, /* GL_STATIC_COPY_ARB */ - { 31853, 0x000088E4 }, /* GL_STATIC_DRAW */ - { 31868, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */ - { 31887, 0x000088E5 }, /* GL_STATIC_READ */ - { 31902, 0x000088E5 }, /* GL_STATIC_READ_ARB */ - { 31921, 0x00001802 }, /* GL_STENCIL */ - { 31932, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT */ - { 31954, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */ - { 31980, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */ - { 32001, 0x00008801 }, /* GL_STENCIL_BACK_FAIL_ATI */ - { 32026, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */ - { 32047, 0x00008800 }, /* GL_STENCIL_BACK_FUNC_ATI */ - { 32072, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ - { 32104, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI */ - { 32140, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ - { 32172, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI */ - { 32208, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */ - { 32228, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */ - { 32255, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */ - { 32281, 0x00000D57 }, /* GL_STENCIL_BITS */ - { 32297, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */ - { 32319, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */ - { 32342, 0x00000B94 }, /* GL_STENCIL_FAIL */ - { 32358, 0x00000B92 }, /* GL_STENCIL_FUNC */ - { 32374, 0x00001901 }, /* GL_STENCIL_INDEX */ - { 32391, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */ - { 32414, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */ - { 32436, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */ - { 32458, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */ - { 32480, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */ - { 32501, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */ - { 32528, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */ - { 32555, 0x00000B97 }, /* GL_STENCIL_REF */ - { 32570, 0x00000B90 }, /* GL_STENCIL_TEST */ - { 32586, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ - { 32615, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */ - { 32637, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */ - { 32658, 0x00000C33 }, /* GL_STEREO */ - { 32668, 0x000085BE }, /* GL_STORAGE_CACHED_APPLE */ - { 32692, 0x000085BD }, /* GL_STORAGE_PRIVATE_APPLE */ - { 32717, 0x000085BF }, /* GL_STORAGE_SHARED_APPLE */ - { 32741, 0x000088E2 }, /* GL_STREAM_COPY */ - { 32756, 0x000088E2 }, /* GL_STREAM_COPY_ARB */ - { 32775, 0x000088E0 }, /* GL_STREAM_DRAW */ - { 32790, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */ - { 32809, 0x000088E1 }, /* GL_STREAM_READ */ - { 32824, 0x000088E1 }, /* GL_STREAM_READ_ARB */ - { 32843, 0x00000D50 }, /* GL_SUBPIXEL_BITS */ - { 32860, 0x000084E7 }, /* GL_SUBTRACT */ - { 32872, 0x000084E7 }, /* GL_SUBTRACT_ARB */ - { 32888, 0x00009113 }, /* GL_SYNC_CONDITION */ - { 32906, 0x00009116 }, /* GL_SYNC_FENCE */ - { 32920, 0x00009115 }, /* GL_SYNC_FLAGS */ - { 32934, 0x00000001 }, /* GL_SYNC_FLUSH_COMMANDS_BIT */ - { 32961, 0x00009117 }, /* GL_SYNC_GPU_COMMANDS_COMPLETE */ - { 32991, 0x00009114 }, /* GL_SYNC_STATUS */ - { 33006, 0x00002001 }, /* GL_T */ - { 33011, 0x00002A2A }, /* GL_T2F_C3F_V3F */ - { 33026, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */ - { 33045, 0x00002A29 }, /* GL_T2F_C4UB_V3F */ - { 33061, 0x00002A2B }, /* GL_T2F_N3F_V3F */ - { 33076, 0x00002A27 }, /* GL_T2F_V3F */ - { 33087, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */ - { 33106, 0x00002A28 }, /* GL_T4F_V4F */ - { 33117, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */ - { 33140, 0x00001702 }, /* GL_TEXTURE */ - { 33151, 0x000084C0 }, /* GL_TEXTURE0 */ - { 33163, 0x000084C0 }, /* GL_TEXTURE0_ARB */ - { 33179, 0x000084C1 }, /* GL_TEXTURE1 */ - { 33191, 0x000084CA }, /* GL_TEXTURE10 */ - { 33204, 0x000084CA }, /* GL_TEXTURE10_ARB */ - { 33221, 0x000084CB }, /* GL_TEXTURE11 */ - { 33234, 0x000084CB }, /* GL_TEXTURE11_ARB */ - { 33251, 0x000084CC }, /* GL_TEXTURE12 */ - { 33264, 0x000084CC }, /* GL_TEXTURE12_ARB */ - { 33281, 0x000084CD }, /* GL_TEXTURE13 */ - { 33294, 0x000084CD }, /* GL_TEXTURE13_ARB */ - { 33311, 0x000084CE }, /* GL_TEXTURE14 */ - { 33324, 0x000084CE }, /* GL_TEXTURE14_ARB */ - { 33341, 0x000084CF }, /* GL_TEXTURE15 */ - { 33354, 0x000084CF }, /* GL_TEXTURE15_ARB */ - { 33371, 0x000084D0 }, /* GL_TEXTURE16 */ - { 33384, 0x000084D0 }, /* GL_TEXTURE16_ARB */ - { 33401, 0x000084D1 }, /* GL_TEXTURE17 */ - { 33414, 0x000084D1 }, /* GL_TEXTURE17_ARB */ - { 33431, 0x000084D2 }, /* GL_TEXTURE18 */ - { 33444, 0x000084D2 }, /* GL_TEXTURE18_ARB */ - { 33461, 0x000084D3 }, /* GL_TEXTURE19 */ - { 33474, 0x000084D3 }, /* GL_TEXTURE19_ARB */ - { 33491, 0x000084C1 }, /* GL_TEXTURE1_ARB */ - { 33507, 0x000084C2 }, /* GL_TEXTURE2 */ - { 33519, 0x000084D4 }, /* GL_TEXTURE20 */ - { 33532, 0x000084D4 }, /* GL_TEXTURE20_ARB */ - { 33549, 0x000084D5 }, /* GL_TEXTURE21 */ - { 33562, 0x000084D5 }, /* GL_TEXTURE21_ARB */ - { 33579, 0x000084D6 }, /* GL_TEXTURE22 */ - { 33592, 0x000084D6 }, /* GL_TEXTURE22_ARB */ - { 33609, 0x000084D7 }, /* GL_TEXTURE23 */ - { 33622, 0x000084D7 }, /* GL_TEXTURE23_ARB */ - { 33639, 0x000084D8 }, /* GL_TEXTURE24 */ - { 33652, 0x000084D8 }, /* GL_TEXTURE24_ARB */ - { 33669, 0x000084D9 }, /* GL_TEXTURE25 */ - { 33682, 0x000084D9 }, /* GL_TEXTURE25_ARB */ - { 33699, 0x000084DA }, /* GL_TEXTURE26 */ - { 33712, 0x000084DA }, /* GL_TEXTURE26_ARB */ - { 33729, 0x000084DB }, /* GL_TEXTURE27 */ - { 33742, 0x000084DB }, /* GL_TEXTURE27_ARB */ - { 33759, 0x000084DC }, /* GL_TEXTURE28 */ - { 33772, 0x000084DC }, /* GL_TEXTURE28_ARB */ - { 33789, 0x000084DD }, /* GL_TEXTURE29 */ - { 33802, 0x000084DD }, /* GL_TEXTURE29_ARB */ - { 33819, 0x000084C2 }, /* GL_TEXTURE2_ARB */ - { 33835, 0x000084C3 }, /* GL_TEXTURE3 */ - { 33847, 0x000084DE }, /* GL_TEXTURE30 */ - { 33860, 0x000084DE }, /* GL_TEXTURE30_ARB */ - { 33877, 0x000084DF }, /* GL_TEXTURE31 */ - { 33890, 0x000084DF }, /* GL_TEXTURE31_ARB */ - { 33907, 0x000084C3 }, /* GL_TEXTURE3_ARB */ - { 33923, 0x000084C4 }, /* GL_TEXTURE4 */ - { 33935, 0x000084C4 }, /* GL_TEXTURE4_ARB */ - { 33951, 0x000084C5 }, /* GL_TEXTURE5 */ - { 33963, 0x000084C5 }, /* GL_TEXTURE5_ARB */ - { 33979, 0x000084C6 }, /* GL_TEXTURE6 */ - { 33991, 0x000084C6 }, /* GL_TEXTURE6_ARB */ - { 34007, 0x000084C7 }, /* GL_TEXTURE7 */ - { 34019, 0x000084C7 }, /* GL_TEXTURE7_ARB */ - { 34035, 0x000084C8 }, /* GL_TEXTURE8 */ - { 34047, 0x000084C8 }, /* GL_TEXTURE8_ARB */ - { 34063, 0x000084C9 }, /* GL_TEXTURE9 */ - { 34075, 0x000084C9 }, /* GL_TEXTURE9_ARB */ - { 34091, 0x00000DE0 }, /* GL_TEXTURE_1D */ - { 34105, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY_EXT */ - { 34129, 0x00000DE1 }, /* GL_TEXTURE_2D */ - { 34143, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY_EXT */ - { 34167, 0x0000806F }, /* GL_TEXTURE_3D */ - { 34181, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */ - { 34203, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */ - { 34229, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */ - { 34251, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */ - { 34273, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ - { 34305, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */ - { 34327, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ - { 34359, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */ - { 34381, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */ - { 34409, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */ - { 34441, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ - { 34474, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */ - { 34506, 0x00040000 }, /* GL_TEXTURE_BIT */ - { 34521, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */ - { 34542, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */ - { 34567, 0x00001005 }, /* GL_TEXTURE_BORDER */ - { 34585, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */ - { 34609, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ - { 34640, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ - { 34670, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ - { 34700, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ - { 34735, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ - { 34766, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - { 34804, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */ - { 34831, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ - { 34863, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ - { 34897, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */ - { 34921, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */ - { 34949, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */ - { 34973, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */ - { 35001, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ - { 35034, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */ - { 35058, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */ - { 35080, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */ - { 35102, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */ - { 35128, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */ - { 35162, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ - { 35195, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */ - { 35232, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */ - { 35260, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */ - { 35292, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */ - { 35315, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ - { 35353, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */ - { 35395, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */ - { 35426, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */ - { 35454, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ - { 35484, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */ - { 35512, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */ - { 35532, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */ - { 35556, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ - { 35587, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */ - { 35622, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ - { 35653, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */ - { 35688, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ - { 35719, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */ - { 35754, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ - { 35785, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */ - { 35820, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ - { 35851, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */ - { 35886, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ - { 35917, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */ - { 35952, 0x000088F4 }, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */ - { 35981, 0x00008071 }, /* GL_TEXTURE_DEPTH */ - { 35998, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */ - { 36020, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */ - { 36046, 0x00002300 }, /* GL_TEXTURE_ENV */ - { 36061, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */ - { 36082, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */ - { 36102, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */ - { 36128, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */ - { 36148, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */ - { 36165, 0x00000C62 }, /* GL_TEXTURE_GEN_R */ - { 36182, 0x00000C60 }, /* GL_TEXTURE_GEN_S */ - { 36199, 0x00000C61 }, /* GL_TEXTURE_GEN_T */ - { 36216, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */ - { 36241, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */ - { 36263, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */ - { 36289, 0x00001001 }, /* GL_TEXTURE_HEIGHT */ - { 36307, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */ - { 36333, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */ - { 36359, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */ - { 36389, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */ - { 36416, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */ - { 36441, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */ - { 36461, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */ - { 36485, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ - { 36512, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ - { 36539, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ - { 36566, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */ - { 36592, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */ - { 36622, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */ - { 36644, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */ - { 36662, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ - { 36692, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ - { 36720, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ - { 36748, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ - { 36776, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */ - { 36797, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */ - { 36816, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */ - { 36838, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */ - { 36857, 0x00008066 }, /* GL_TEXTURE_PRIORITY */ - { 36877, 0x000085B7 }, /* GL_TEXTURE_RANGE_LENGTH_APPLE */ - { 36907, 0x000085B8 }, /* GL_TEXTURE_RANGE_POINTER_APPLE */ - { 36938, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */ - { 36963, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */ - { 36987, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */ - { 37007, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */ - { 37031, 0x00008067 }, /* GL_TEXTURE_RESIDENT */ - { 37051, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */ - { 37074, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE */ - { 37098, 0x000085BC }, /* GL_TEXTURE_STORAGE_HINT_APPLE */ - { 37128, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */ - { 37153, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ - { 37187, 0x00001000 }, /* GL_TEXTURE_WIDTH */ - { 37204, 0x00008072 }, /* GL_TEXTURE_WRAP_R */ - { 37222, 0x00002802 }, /* GL_TEXTURE_WRAP_S */ - { 37240, 0x00002803 }, /* GL_TEXTURE_WRAP_T */ - { 37258, 0x0000911B }, /* GL_TIMEOUT_EXPIRED */ - { 37277, 0xFFFFFFFFFFFFFFFF }, /* GL_TIMEOUT_IGNORED */ - { 37296, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */ - { 37316, 0x00008648 }, /* GL_TRACK_MATRIX_NV */ - { 37335, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */ - { 37364, 0x00001000 }, /* GL_TRANSFORM_BIT */ - { 37381, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */ - { 37407, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */ - { 37437, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ - { 37469, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ - { 37499, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */ - { 37533, 0x0000862C }, /* GL_TRANSPOSE_NV */ - { 37549, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */ - { 37580, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */ - { 37615, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */ - { 37643, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */ - { 37675, 0x00000004 }, /* GL_TRIANGLES */ - { 37688, 0x00000006 }, /* GL_TRIANGLE_FAN */ - { 37704, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */ - { 37725, 0x00000005 }, /* GL_TRIANGLE_STRIP */ - { 37743, 0x00000001 }, /* GL_TRUE */ - { 37751, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */ - { 37771, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */ - { 37794, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */ - { 37814, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */ - { 37835, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */ - { 37857, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */ - { 37879, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */ - { 37899, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */ - { 37920, 0x00009118 }, /* GL_UNSIGNALED */ - { 37934, 0x00001401 }, /* GL_UNSIGNED_BYTE */ - { 37951, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */ - { 37978, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */ - { 38001, 0x00001405 }, /* GL_UNSIGNED_INT */ - { 38017, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */ - { 38044, 0x000084FA }, /* GL_UNSIGNED_INT_24_8 */ - { 38065, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */ - { 38089, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */ - { 38120, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */ - { 38144, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */ - { 38172, 0x00008C17 }, /* GL_UNSIGNED_NORMALIZED */ - { 38195, 0x00001403 }, /* GL_UNSIGNED_SHORT */ - { 38213, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ - { 38243, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */ - { 38269, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ - { 38299, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */ - { 38325, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */ - { 38349, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */ - { 38377, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */ - { 38405, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */ - { 38432, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ - { 38464, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */ - { 38495, 0x00008CA2 }, /* GL_UPPER_LEFT */ - { 38509, 0x00002A20 }, /* GL_V2F */ - { 38516, 0x00002A21 }, /* GL_V3F */ - { 38523, 0x00008B83 }, /* GL_VALIDATE_STATUS */ - { 38542, 0x00001F00 }, /* GL_VENDOR */ - { 38552, 0x00001F02 }, /* GL_VERSION */ - { 38563, 0x00008074 }, /* GL_VERTEX_ARRAY */ - { 38579, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING */ - { 38603, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */ - { 38633, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ - { 38664, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */ - { 38699, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */ - { 38723, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */ - { 38744, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */ - { 38767, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */ - { 38788, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ - { 38815, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ - { 38843, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ - { 38871, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ - { 38899, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ - { 38927, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ - { 38955, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ - { 38983, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ - { 39010, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ - { 39037, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ - { 39064, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ - { 39091, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ - { 39118, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ - { 39145, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ - { 39172, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ - { 39199, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ - { 39226, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ - { 39264, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */ - { 39306, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ - { 39337, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ - { 39372, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ - { 39406, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ - { 39444, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ - { 39475, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ - { 39510, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ - { 39538, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ - { 39570, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ - { 39600, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ - { 39634, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ - { 39662, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ - { 39694, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */ - { 39714, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */ - { 39736, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */ - { 39765, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */ - { 39786, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */ - { 39815, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ - { 39848, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */ - { 39880, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */ - { 39907, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ - { 39938, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */ - { 39968, 0x00008B31 }, /* GL_VERTEX_SHADER */ - { 39985, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */ - { 40006, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */ - { 40033, 0x00000BA2 }, /* GL_VIEWPORT */ - { 40045, 0x00000800 }, /* GL_VIEWPORT_BIT */ - { 40061, 0x0000911D }, /* GL_WAIT_FAILED */ - { 40076, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */ - { 40096, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ - { 40127, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */ - { 40162, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */ - { 40190, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */ - { 40215, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ - { 40242, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */ - { 40267, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */ - { 40291, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */ - { 40310, 0x000088B9 }, /* GL_WRITE_ONLY */ - { 40324, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */ - { 40342, 0x00001506 }, /* GL_XOR */ - { 40349, 0x000085B9 }, /* GL_YCBCR_422_APPLE */ - { 40368, 0x00008757 }, /* GL_YCBCR_MESA */ - { 40382, 0x00000000 }, /* GL_ZERO */ - { 40390, 0x00000D16 }, /* GL_ZOOM_X */ - { 40400, 0x00000D17 }, /* GL_ZOOM_Y */ + { 7190, 0x000088F0 }, /* GL_DEPTH24_STENCIL8_EXT */ + { 7214, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT */ + { 7234, 0x00008D00 }, /* GL_DEPTH_ATTACHMENT_EXT */ + { 7258, 0x00000D1F }, /* GL_DEPTH_BIAS */ + { 7272, 0x00000D56 }, /* GL_DEPTH_BITS */ + { 7286, 0x00008891 }, /* GL_DEPTH_BOUNDS_EXT */ + { 7306, 0x00008890 }, /* GL_DEPTH_BOUNDS_TEST_EXT */ + { 7331, 0x00000100 }, /* GL_DEPTH_BUFFER_BIT */ + { 7351, 0x0000864F }, /* GL_DEPTH_CLAMP */ + { 7366, 0x0000864F }, /* GL_DEPTH_CLAMP_NV */ + { 7384, 0x00000B73 }, /* GL_DEPTH_CLEAR_VALUE */ + { 7405, 0x00001902 }, /* GL_DEPTH_COMPONENT */ + { 7424, 0x000081A5 }, /* GL_DEPTH_COMPONENT16 */ + { 7445, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_ARB */ + { 7470, 0x000081A5 }, /* GL_DEPTH_COMPONENT16_SGIX */ + { 7496, 0x000081A6 }, /* GL_DEPTH_COMPONENT24 */ + { 7517, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_ARB */ + { 7542, 0x000081A6 }, /* GL_DEPTH_COMPONENT24_SGIX */ + { 7568, 0x000081A7 }, /* GL_DEPTH_COMPONENT32 */ + { 7589, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_ARB */ + { 7614, 0x000081A7 }, /* GL_DEPTH_COMPONENT32_SGIX */ + { 7640, 0x00000B74 }, /* GL_DEPTH_FUNC */ + { 7654, 0x00000B70 }, /* GL_DEPTH_RANGE */ + { 7669, 0x00000D1E }, /* GL_DEPTH_SCALE */ + { 7684, 0x000084F9 }, /* GL_DEPTH_STENCIL */ + { 7701, 0x0000821A }, /* GL_DEPTH_STENCIL_ATTACHMENT */ + { 7729, 0x000084F9 }, /* GL_DEPTH_STENCIL_EXT */ + { 7750, 0x000084F9 }, /* GL_DEPTH_STENCIL_NV */ + { 7770, 0x0000886F }, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ + { 7798, 0x0000886E }, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ + { 7826, 0x00000B71 }, /* GL_DEPTH_TEST */ + { 7840, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE */ + { 7862, 0x0000884B }, /* GL_DEPTH_TEXTURE_MODE_ARB */ + { 7888, 0x00000B72 }, /* GL_DEPTH_WRITEMASK */ + { 7907, 0x00001201 }, /* GL_DIFFUSE */ + { 7918, 0x00000BD0 }, /* GL_DITHER */ + { 7928, 0x00000A02 }, /* GL_DOMAIN */ + { 7938, 0x00001100 }, /* GL_DONT_CARE */ + { 7951, 0x000086AE }, /* GL_DOT3_RGB */ + { 7963, 0x000086AF }, /* GL_DOT3_RGBA */ + { 7976, 0x000086AF }, /* GL_DOT3_RGBA_ARB */ + { 7993, 0x00008741 }, /* GL_DOT3_RGBA_EXT */ + { 8010, 0x000086AE }, /* GL_DOT3_RGB_ARB */ + { 8026, 0x00008740 }, /* GL_DOT3_RGB_EXT */ + { 8042, 0x0000140A }, /* GL_DOUBLE */ + { 8052, 0x00000C32 }, /* GL_DOUBLEBUFFER */ + { 8068, 0x00000C01 }, /* GL_DRAW_BUFFER */ + { 8083, 0x00008825 }, /* GL_DRAW_BUFFER0 */ + { 8099, 0x00008825 }, /* GL_DRAW_BUFFER0_ARB */ + { 8119, 0x00008825 }, /* GL_DRAW_BUFFER0_ATI */ + { 8139, 0x00008826 }, /* GL_DRAW_BUFFER1 */ + { 8155, 0x0000882F }, /* GL_DRAW_BUFFER10 */ + { 8172, 0x0000882F }, /* GL_DRAW_BUFFER10_ARB */ + { 8193, 0x0000882F }, /* GL_DRAW_BUFFER10_ATI */ + { 8214, 0x00008830 }, /* GL_DRAW_BUFFER11 */ + { 8231, 0x00008830 }, /* GL_DRAW_BUFFER11_ARB */ + { 8252, 0x00008830 }, /* GL_DRAW_BUFFER11_ATI */ + { 8273, 0x00008831 }, /* GL_DRAW_BUFFER12 */ + { 8290, 0x00008831 }, /* GL_DRAW_BUFFER12_ARB */ + { 8311, 0x00008831 }, /* GL_DRAW_BUFFER12_ATI */ + { 8332, 0x00008832 }, /* GL_DRAW_BUFFER13 */ + { 8349, 0x00008832 }, /* GL_DRAW_BUFFER13_ARB */ + { 8370, 0x00008832 }, /* GL_DRAW_BUFFER13_ATI */ + { 8391, 0x00008833 }, /* GL_DRAW_BUFFER14 */ + { 8408, 0x00008833 }, /* GL_DRAW_BUFFER14_ARB */ + { 8429, 0x00008833 }, /* GL_DRAW_BUFFER14_ATI */ + { 8450, 0x00008834 }, /* GL_DRAW_BUFFER15 */ + { 8467, 0x00008834 }, /* GL_DRAW_BUFFER15_ARB */ + { 8488, 0x00008834 }, /* GL_DRAW_BUFFER15_ATI */ + { 8509, 0x00008826 }, /* GL_DRAW_BUFFER1_ARB */ + { 8529, 0x00008826 }, /* GL_DRAW_BUFFER1_ATI */ + { 8549, 0x00008827 }, /* GL_DRAW_BUFFER2 */ + { 8565, 0x00008827 }, /* GL_DRAW_BUFFER2_ARB */ + { 8585, 0x00008827 }, /* GL_DRAW_BUFFER2_ATI */ + { 8605, 0x00008828 }, /* GL_DRAW_BUFFER3 */ + { 8621, 0x00008828 }, /* GL_DRAW_BUFFER3_ARB */ + { 8641, 0x00008828 }, /* GL_DRAW_BUFFER3_ATI */ + { 8661, 0x00008829 }, /* GL_DRAW_BUFFER4 */ + { 8677, 0x00008829 }, /* GL_DRAW_BUFFER4_ARB */ + { 8697, 0x00008829 }, /* GL_DRAW_BUFFER4_ATI */ + { 8717, 0x0000882A }, /* GL_DRAW_BUFFER5 */ + { 8733, 0x0000882A }, /* GL_DRAW_BUFFER5_ARB */ + { 8753, 0x0000882A }, /* GL_DRAW_BUFFER5_ATI */ + { 8773, 0x0000882B }, /* GL_DRAW_BUFFER6 */ + { 8789, 0x0000882B }, /* GL_DRAW_BUFFER6_ARB */ + { 8809, 0x0000882B }, /* GL_DRAW_BUFFER6_ATI */ + { 8829, 0x0000882C }, /* GL_DRAW_BUFFER7 */ + { 8845, 0x0000882C }, /* GL_DRAW_BUFFER7_ARB */ + { 8865, 0x0000882C }, /* GL_DRAW_BUFFER7_ATI */ + { 8885, 0x0000882D }, /* GL_DRAW_BUFFER8 */ + { 8901, 0x0000882D }, /* GL_DRAW_BUFFER8_ARB */ + { 8921, 0x0000882D }, /* GL_DRAW_BUFFER8_ATI */ + { 8941, 0x0000882E }, /* GL_DRAW_BUFFER9 */ + { 8957, 0x0000882E }, /* GL_DRAW_BUFFER9_ARB */ + { 8977, 0x0000882E }, /* GL_DRAW_BUFFER9_ATI */ + { 8997, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER */ + { 9017, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING */ + { 9045, 0x00008CA6 }, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ + { 9077, 0x00008CA9 }, /* GL_DRAW_FRAMEBUFFER_EXT */ + { 9101, 0x00000705 }, /* GL_DRAW_PIXEL_TOKEN */ + { 9121, 0x00000304 }, /* GL_DST_ALPHA */ + { 9134, 0x00000306 }, /* GL_DST_COLOR */ + { 9147, 0x0000877A }, /* GL_DU8DV8_ATI */ + { 9161, 0x00008779 }, /* GL_DUDV_ATI */ + { 9173, 0x000088EA }, /* GL_DYNAMIC_COPY */ + { 9189, 0x000088EA }, /* GL_DYNAMIC_COPY_ARB */ + { 9209, 0x000088E8 }, /* GL_DYNAMIC_DRAW */ + { 9225, 0x000088E8 }, /* GL_DYNAMIC_DRAW_ARB */ + { 9245, 0x000088E9 }, /* GL_DYNAMIC_READ */ + { 9261, 0x000088E9 }, /* GL_DYNAMIC_READ_ARB */ + { 9281, 0x00000B43 }, /* GL_EDGE_FLAG */ + { 9294, 0x00008079 }, /* GL_EDGE_FLAG_ARRAY */ + { 9313, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ + { 9347, 0x0000889B }, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB */ + { 9385, 0x00008093 }, /* GL_EDGE_FLAG_ARRAY_POINTER */ + { 9412, 0x0000808C }, /* GL_EDGE_FLAG_ARRAY_STRIDE */ + { 9438, 0x00008893 }, /* GL_ELEMENT_ARRAY_BUFFER */ + { 9462, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ + { 9494, 0x00008895 }, /* GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB */ + { 9530, 0x00001600 }, /* GL_EMISSION */ + { 9542, 0x00002000 }, /* GL_ENABLE_BIT */ + { 9556, 0x00000202 }, /* GL_EQUAL */ + { 9565, 0x00001509 }, /* GL_EQUIV */ + { 9574, 0x00010000 }, /* GL_EVAL_BIT */ + { 9586, 0x00000800 }, /* GL_EXP */ + { 9593, 0x00000801 }, /* GL_EXP2 */ + { 9601, 0x00001F03 }, /* GL_EXTENSIONS */ + { 9615, 0x00002400 }, /* GL_EYE_LINEAR */ + { 9629, 0x00002502 }, /* GL_EYE_PLANE */ + { 9642, 0x0000855C }, /* GL_EYE_PLANE_ABSOLUTE_NV */ + { 9667, 0x0000855B }, /* GL_EYE_RADIAL_NV */ + { 9684, 0x00000000 }, /* GL_FALSE */ + { 9693, 0x00001101 }, /* GL_FASTEST */ + { 9704, 0x00001C01 }, /* GL_FEEDBACK */ + { 9716, 0x00000DF0 }, /* GL_FEEDBACK_BUFFER_POINTER */ + { 9743, 0x00000DF1 }, /* GL_FEEDBACK_BUFFER_SIZE */ + { 9767, 0x00000DF2 }, /* GL_FEEDBACK_BUFFER_TYPE */ + { 9791, 0x00001B02 }, /* GL_FILL */ + { 9799, 0x00008E4D }, /* GL_FIRST_VERTEX_CONVENTION */ + { 9826, 0x00008E4D }, /* GL_FIRST_VERTEX_CONVENTION_EXT */ + { 9857, 0x00001D00 }, /* GL_FLAT */ + { 9865, 0x00001406 }, /* GL_FLOAT */ + { 9874, 0x00008B5A }, /* GL_FLOAT_MAT2 */ + { 9888, 0x00008B5A }, /* GL_FLOAT_MAT2_ARB */ + { 9906, 0x00008B65 }, /* GL_FLOAT_MAT2x3 */ + { 9922, 0x00008B66 }, /* GL_FLOAT_MAT2x4 */ + { 9938, 0x00008B5B }, /* GL_FLOAT_MAT3 */ + { 9952, 0x00008B5B }, /* GL_FLOAT_MAT3_ARB */ + { 9970, 0x00008B67 }, /* GL_FLOAT_MAT3x2 */ + { 9986, 0x00008B68 }, /* GL_FLOAT_MAT3x4 */ + { 10002, 0x00008B5C }, /* GL_FLOAT_MAT4 */ + { 10016, 0x00008B5C }, /* GL_FLOAT_MAT4_ARB */ + { 10034, 0x00008B69 }, /* GL_FLOAT_MAT4x2 */ + { 10050, 0x00008B6A }, /* GL_FLOAT_MAT4x3 */ + { 10066, 0x00008B50 }, /* GL_FLOAT_VEC2 */ + { 10080, 0x00008B50 }, /* GL_FLOAT_VEC2_ARB */ + { 10098, 0x00008B51 }, /* GL_FLOAT_VEC3 */ + { 10112, 0x00008B51 }, /* GL_FLOAT_VEC3_ARB */ + { 10130, 0x00008B52 }, /* GL_FLOAT_VEC4 */ + { 10144, 0x00008B52 }, /* GL_FLOAT_VEC4_ARB */ + { 10162, 0x00000B60 }, /* GL_FOG */ + { 10169, 0x00000080 }, /* GL_FOG_BIT */ + { 10180, 0x00000B66 }, /* GL_FOG_COLOR */ + { 10193, 0x00008451 }, /* GL_FOG_COORD */ + { 10206, 0x00008451 }, /* GL_FOG_COORDINATE */ + { 10224, 0x00008457 }, /* GL_FOG_COORDINATE_ARRAY */ + { 10248, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ + { 10287, 0x0000889D }, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB */ + { 10330, 0x00008456 }, /* GL_FOG_COORDINATE_ARRAY_POINTER */ + { 10362, 0x00008455 }, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ + { 10393, 0x00008454 }, /* GL_FOG_COORDINATE_ARRAY_TYPE */ + { 10422, 0x00008450 }, /* GL_FOG_COORDINATE_SOURCE */ + { 10447, 0x00008457 }, /* GL_FOG_COORD_ARRAY */ + { 10466, 0x0000889D }, /* GL_FOG_COORD_ARRAY_BUFFER_BINDING */ + { 10500, 0x00008456 }, /* GL_FOG_COORD_ARRAY_POINTER */ + { 10527, 0x00008455 }, /* GL_FOG_COORD_ARRAY_STRIDE */ + { 10553, 0x00008454 }, /* GL_FOG_COORD_ARRAY_TYPE */ + { 10577, 0x00008450 }, /* GL_FOG_COORD_SRC */ + { 10594, 0x00000B62 }, /* GL_FOG_DENSITY */ + { 10609, 0x0000855A }, /* GL_FOG_DISTANCE_MODE_NV */ + { 10633, 0x00000B64 }, /* GL_FOG_END */ + { 10644, 0x00000C54 }, /* GL_FOG_HINT */ + { 10656, 0x00000B61 }, /* GL_FOG_INDEX */ + { 10669, 0x00000B65 }, /* GL_FOG_MODE */ + { 10681, 0x00008198 }, /* GL_FOG_OFFSET_SGIX */ + { 10700, 0x00008199 }, /* GL_FOG_OFFSET_VALUE_SGIX */ + { 10725, 0x00000B63 }, /* GL_FOG_START */ + { 10738, 0x00008452 }, /* GL_FRAGMENT_DEPTH */ + { 10756, 0x00008804 }, /* GL_FRAGMENT_PROGRAM_ARB */ + { 10780, 0x00008B30 }, /* GL_FRAGMENT_SHADER */ + { 10799, 0x00008B30 }, /* GL_FRAGMENT_SHADER_ARB */ + { 10822, 0x00008B8B }, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ + { 10857, 0x00008D40 }, /* GL_FRAMEBUFFER */ + { 10872, 0x00008215 }, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ + { 10909, 0x00008214 }, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ + { 10945, 0x00008210 }, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ + { 10986, 0x00008211 }, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ + { 11027, 0x00008216 }, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ + { 11064, 0x00008213 }, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ + { 11101, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ + { 11139, 0x00008CD1 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT */ + { 11181, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ + { 11219, 0x00008CD0 }, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT */ + { 11261, 0x00008212 }, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ + { 11296, 0x00008217 }, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ + { 11335, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT */ + { 11384, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ + { 11432, 0x00008CD3 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT */ + { 11484, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ + { 11524, 0x00008CD4 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT */ + { 11568, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ + { 11608, 0x00008CD2 }, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT */ + { 11652, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING */ + { 11675, 0x00008CA6 }, /* GL_FRAMEBUFFER_BINDING_EXT */ + { 11702, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE */ + { 11726, 0x00008CD5 }, /* GL_FRAMEBUFFER_COMPLETE_EXT */ + { 11754, 0x00008218 }, /* GL_FRAMEBUFFER_DEFAULT */ + { 11777, 0x00008D40 }, /* GL_FRAMEBUFFER_EXT */ + { 11796, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ + { 11833, 0x00008CD6 }, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT */ + { 11874, 0x00008CD9 }, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ + { 11915, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */ + { 11953, 0x00008CDB }, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ + { 11995, 0x00008CD8 }, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ + { 12046, 0x00008CDA }, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ + { 12084, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ + { 12129, 0x00008CD7 }, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT */ + { 12178, 0x00008D56 }, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ + { 12216, 0x00008D56 }, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT */ + { 12258, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */ + { 12296, 0x00008CDC }, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ + { 12338, 0x00008CDE }, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ + { 12370, 0x00008219 }, /* GL_FRAMEBUFFER_UNDEFINED */ + { 12395, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED */ + { 12422, 0x00008CDD }, /* GL_FRAMEBUFFER_UNSUPPORTED_EXT */ + { 12453, 0x00000404 }, /* GL_FRONT */ + { 12462, 0x00000408 }, /* GL_FRONT_AND_BACK */ + { 12480, 0x00000B46 }, /* GL_FRONT_FACE */ + { 12494, 0x00000400 }, /* GL_FRONT_LEFT */ + { 12508, 0x00000401 }, /* GL_FRONT_RIGHT */ + { 12523, 0x00008006 }, /* GL_FUNC_ADD */ + { 12535, 0x00008006 }, /* GL_FUNC_ADD_EXT */ + { 12551, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT */ + { 12576, 0x0000800B }, /* GL_FUNC_REVERSE_SUBTRACT_EXT */ + { 12605, 0x0000800A }, /* GL_FUNC_SUBTRACT */ + { 12622, 0x0000800A }, /* GL_FUNC_SUBTRACT_EXT */ + { 12643, 0x00008191 }, /* GL_GENERATE_MIPMAP */ + { 12662, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT */ + { 12686, 0x00008192 }, /* GL_GENERATE_MIPMAP_HINT_SGIS */ + { 12715, 0x00008191 }, /* GL_GENERATE_MIPMAP_SGIS */ + { 12739, 0x00000206 }, /* GL_GEQUAL */ + { 12749, 0x00000204 }, /* GL_GREATER */ + { 12760, 0x00001904 }, /* GL_GREEN */ + { 12769, 0x00000D19 }, /* GL_GREEN_BIAS */ + { 12783, 0x00000D53 }, /* GL_GREEN_BITS */ + { 12797, 0x00000D18 }, /* GL_GREEN_SCALE */ + { 12812, 0x00008000 }, /* GL_HINT_BIT */ + { 12824, 0x00008024 }, /* GL_HISTOGRAM */ + { 12837, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE */ + { 12861, 0x0000802B }, /* GL_HISTOGRAM_ALPHA_SIZE_EXT */ + { 12889, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE */ + { 12912, 0x0000802A }, /* GL_HISTOGRAM_BLUE_SIZE_EXT */ + { 12939, 0x00008024 }, /* GL_HISTOGRAM_EXT */ + { 12956, 0x00008027 }, /* GL_HISTOGRAM_FORMAT */ + { 12976, 0x00008027 }, /* GL_HISTOGRAM_FORMAT_EXT */ + { 13000, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE */ + { 13024, 0x00008029 }, /* GL_HISTOGRAM_GREEN_SIZE_EXT */ + { 13052, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE */ + { 13080, 0x0000802C }, /* GL_HISTOGRAM_LUMINANCE_SIZE_EXT */ + { 13112, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE */ + { 13134, 0x00008028 }, /* GL_HISTOGRAM_RED_SIZE_EXT */ + { 13160, 0x0000802D }, /* GL_HISTOGRAM_SINK */ + { 13178, 0x0000802D }, /* GL_HISTOGRAM_SINK_EXT */ + { 13200, 0x00008026 }, /* GL_HISTOGRAM_WIDTH */ + { 13219, 0x00008026 }, /* GL_HISTOGRAM_WIDTH_EXT */ + { 13242, 0x0000862A }, /* GL_IDENTITY_NV */ + { 13257, 0x00008150 }, /* GL_IGNORE_BORDER_HP */ + { 13277, 0x00008B9B }, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ + { 13317, 0x00008B9A }, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ + { 13355, 0x00001E02 }, /* GL_INCR */ + { 13363, 0x00008507 }, /* GL_INCR_WRAP */ + { 13376, 0x00008507 }, /* GL_INCR_WRAP_EXT */ + { 13393, 0x00008222 }, /* GL_INDEX */ + { 13402, 0x00008077 }, /* GL_INDEX_ARRAY */ + { 13417, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING */ + { 13447, 0x00008899 }, /* GL_INDEX_ARRAY_BUFFER_BINDING_ARB */ + { 13481, 0x00008091 }, /* GL_INDEX_ARRAY_POINTER */ + { 13504, 0x00008086 }, /* GL_INDEX_ARRAY_STRIDE */ + { 13526, 0x00008085 }, /* GL_INDEX_ARRAY_TYPE */ + { 13546, 0x00000D51 }, /* GL_INDEX_BITS */ + { 13560, 0x00000C20 }, /* GL_INDEX_CLEAR_VALUE */ + { 13581, 0x00000BF1 }, /* GL_INDEX_LOGIC_OP */ + { 13599, 0x00000C30 }, /* GL_INDEX_MODE */ + { 13613, 0x00000D13 }, /* GL_INDEX_OFFSET */ + { 13629, 0x00000D12 }, /* GL_INDEX_SHIFT */ + { 13644, 0x00000C21 }, /* GL_INDEX_WRITEMASK */ + { 13663, 0x00008B84 }, /* GL_INFO_LOG_LENGTH */ + { 13682, 0x00001404 }, /* GL_INT */ + { 13689, 0x00008049 }, /* GL_INTENSITY */ + { 13702, 0x0000804C }, /* GL_INTENSITY12 */ + { 13717, 0x0000804C }, /* GL_INTENSITY12_EXT */ + { 13736, 0x0000804D }, /* GL_INTENSITY16 */ + { 13751, 0x0000804D }, /* GL_INTENSITY16_EXT */ + { 13770, 0x0000804A }, /* GL_INTENSITY4 */ + { 13784, 0x0000804A }, /* GL_INTENSITY4_EXT */ + { 13802, 0x0000804B }, /* GL_INTENSITY8 */ + { 13816, 0x0000804B }, /* GL_INTENSITY8_EXT */ + { 13834, 0x00008049 }, /* GL_INTENSITY_EXT */ + { 13851, 0x00008575 }, /* GL_INTERPOLATE */ + { 13866, 0x00008575 }, /* GL_INTERPOLATE_ARB */ + { 13885, 0x00008575 }, /* GL_INTERPOLATE_EXT */ + { 13904, 0x00008B53 }, /* GL_INT_VEC2 */ + { 13916, 0x00008B53 }, /* GL_INT_VEC2_ARB */ + { 13932, 0x00008B54 }, /* GL_INT_VEC3 */ + { 13944, 0x00008B54 }, /* GL_INT_VEC3_ARB */ + { 13960, 0x00008B55 }, /* GL_INT_VEC4 */ + { 13972, 0x00008B55 }, /* GL_INT_VEC4_ARB */ + { 13988, 0x00000500 }, /* GL_INVALID_ENUM */ + { 14004, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION */ + { 14037, 0x00000506 }, /* GL_INVALID_FRAMEBUFFER_OPERATION_EXT */ + { 14074, 0x00000502 }, /* GL_INVALID_OPERATION */ + { 14095, 0x00000501 }, /* GL_INVALID_VALUE */ + { 14112, 0x0000862B }, /* GL_INVERSE_NV */ + { 14126, 0x0000862D }, /* GL_INVERSE_TRANSPOSE_NV */ + { 14150, 0x0000150A }, /* GL_INVERT */ + { 14160, 0x00001E00 }, /* GL_KEEP */ + { 14168, 0x00008E4E }, /* GL_LAST_VERTEX_CONVENTION */ + { 14194, 0x00008E4E }, /* GL_LAST_VERTEX_CONVENTION_EXT */ + { 14224, 0x00000406 }, /* GL_LEFT */ + { 14232, 0x00000203 }, /* GL_LEQUAL */ + { 14242, 0x00000201 }, /* GL_LESS */ + { 14250, 0x00004000 }, /* GL_LIGHT0 */ + { 14260, 0x00004001 }, /* GL_LIGHT1 */ + { 14270, 0x00004002 }, /* GL_LIGHT2 */ + { 14280, 0x00004003 }, /* GL_LIGHT3 */ + { 14290, 0x00004004 }, /* GL_LIGHT4 */ + { 14300, 0x00004005 }, /* GL_LIGHT5 */ + { 14310, 0x00004006 }, /* GL_LIGHT6 */ + { 14320, 0x00004007 }, /* GL_LIGHT7 */ + { 14330, 0x00000B50 }, /* GL_LIGHTING */ + { 14342, 0x00000040 }, /* GL_LIGHTING_BIT */ + { 14358, 0x00000B53 }, /* GL_LIGHT_MODEL_AMBIENT */ + { 14381, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL */ + { 14410, 0x000081F8 }, /* GL_LIGHT_MODEL_COLOR_CONTROL_EXT */ + { 14443, 0x00000B51 }, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ + { 14471, 0x00000B52 }, /* GL_LIGHT_MODEL_TWO_SIDE */ + { 14495, 0x00001B01 }, /* GL_LINE */ + { 14503, 0x00002601 }, /* GL_LINEAR */ + { 14513, 0x00001208 }, /* GL_LINEAR_ATTENUATION */ + { 14535, 0x00008170 }, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ + { 14565, 0x0000844F }, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ + { 14596, 0x00002703 }, /* GL_LINEAR_MIPMAP_LINEAR */ + { 14620, 0x00002701 }, /* GL_LINEAR_MIPMAP_NEAREST */ + { 14645, 0x00000001 }, /* GL_LINES */ + { 14654, 0x00000004 }, /* GL_LINE_BIT */ + { 14666, 0x00000002 }, /* GL_LINE_LOOP */ + { 14679, 0x00000707 }, /* GL_LINE_RESET_TOKEN */ + { 14699, 0x00000B20 }, /* GL_LINE_SMOOTH */ + { 14714, 0x00000C52 }, /* GL_LINE_SMOOTH_HINT */ + { 14734, 0x00000B24 }, /* GL_LINE_STIPPLE */ + { 14750, 0x00000B25 }, /* GL_LINE_STIPPLE_PATTERN */ + { 14774, 0x00000B26 }, /* GL_LINE_STIPPLE_REPEAT */ + { 14797, 0x00000003 }, /* GL_LINE_STRIP */ + { 14811, 0x00000702 }, /* GL_LINE_TOKEN */ + { 14825, 0x00000B21 }, /* GL_LINE_WIDTH */ + { 14839, 0x00000B23 }, /* GL_LINE_WIDTH_GRANULARITY */ + { 14865, 0x00000B22 }, /* GL_LINE_WIDTH_RANGE */ + { 14885, 0x00008B82 }, /* GL_LINK_STATUS */ + { 14900, 0x00000B32 }, /* GL_LIST_BASE */ + { 14913, 0x00020000 }, /* GL_LIST_BIT */ + { 14925, 0x00000B33 }, /* GL_LIST_INDEX */ + { 14939, 0x00000B30 }, /* GL_LIST_MODE */ + { 14952, 0x00000101 }, /* GL_LOAD */ + { 14960, 0x00000BF1 }, /* GL_LOGIC_OP */ + { 14972, 0x00000BF0 }, /* GL_LOGIC_OP_MODE */ + { 14989, 0x00008CA1 }, /* GL_LOWER_LEFT */ + { 15003, 0x00001909 }, /* GL_LUMINANCE */ + { 15016, 0x00008041 }, /* GL_LUMINANCE12 */ + { 15031, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12 */ + { 15054, 0x00008047 }, /* GL_LUMINANCE12_ALPHA12_EXT */ + { 15081, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4 */ + { 15103, 0x00008046 }, /* GL_LUMINANCE12_ALPHA4_EXT */ + { 15129, 0x00008041 }, /* GL_LUMINANCE12_EXT */ + { 15148, 0x00008042 }, /* GL_LUMINANCE16 */ + { 15163, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16 */ + { 15186, 0x00008048 }, /* GL_LUMINANCE16_ALPHA16_EXT */ + { 15213, 0x00008042 }, /* GL_LUMINANCE16_EXT */ + { 15232, 0x0000803F }, /* GL_LUMINANCE4 */ + { 15246, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4 */ + { 15267, 0x00008043 }, /* GL_LUMINANCE4_ALPHA4_EXT */ + { 15292, 0x0000803F }, /* GL_LUMINANCE4_EXT */ + { 15310, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2 */ + { 15331, 0x00008044 }, /* GL_LUMINANCE6_ALPHA2_EXT */ + { 15356, 0x00008040 }, /* GL_LUMINANCE8 */ + { 15370, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8 */ + { 15391, 0x00008045 }, /* GL_LUMINANCE8_ALPHA8_EXT */ + { 15416, 0x00008040 }, /* GL_LUMINANCE8_EXT */ + { 15434, 0x0000190A }, /* GL_LUMINANCE_ALPHA */ + { 15453, 0x00000D90 }, /* GL_MAP1_COLOR_4 */ + { 15469, 0x00000DD0 }, /* GL_MAP1_GRID_DOMAIN */ + { 15489, 0x00000DD1 }, /* GL_MAP1_GRID_SEGMENTS */ + { 15511, 0x00000D91 }, /* GL_MAP1_INDEX */ + { 15525, 0x00000D92 }, /* GL_MAP1_NORMAL */ + { 15540, 0x00000D93 }, /* GL_MAP1_TEXTURE_COORD_1 */ + { 15564, 0x00000D94 }, /* GL_MAP1_TEXTURE_COORD_2 */ + { 15588, 0x00000D95 }, /* GL_MAP1_TEXTURE_COORD_3 */ + { 15612, 0x00000D96 }, /* GL_MAP1_TEXTURE_COORD_4 */ + { 15636, 0x00000D97 }, /* GL_MAP1_VERTEX_3 */ + { 15653, 0x00000D98 }, /* GL_MAP1_VERTEX_4 */ + { 15670, 0x00008660 }, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ + { 15698, 0x0000866A }, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ + { 15727, 0x0000866B }, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ + { 15756, 0x0000866C }, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ + { 15785, 0x0000866D }, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ + { 15814, 0x0000866E }, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ + { 15843, 0x0000866F }, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ + { 15872, 0x00008661 }, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ + { 15900, 0x00008662 }, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ + { 15928, 0x00008663 }, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ + { 15956, 0x00008664 }, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ + { 15984, 0x00008665 }, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ + { 16012, 0x00008666 }, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ + { 16040, 0x00008667 }, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ + { 16068, 0x00008668 }, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ + { 16096, 0x00008669 }, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ + { 16124, 0x00000DB0 }, /* GL_MAP2_COLOR_4 */ + { 16140, 0x00000DD2 }, /* GL_MAP2_GRID_DOMAIN */ + { 16160, 0x00000DD3 }, /* GL_MAP2_GRID_SEGMENTS */ + { 16182, 0x00000DB1 }, /* GL_MAP2_INDEX */ + { 16196, 0x00000DB2 }, /* GL_MAP2_NORMAL */ + { 16211, 0x00000DB3 }, /* GL_MAP2_TEXTURE_COORD_1 */ + { 16235, 0x00000DB4 }, /* GL_MAP2_TEXTURE_COORD_2 */ + { 16259, 0x00000DB5 }, /* GL_MAP2_TEXTURE_COORD_3 */ + { 16283, 0x00000DB6 }, /* GL_MAP2_TEXTURE_COORD_4 */ + { 16307, 0x00000DB7 }, /* GL_MAP2_VERTEX_3 */ + { 16324, 0x00000DB8 }, /* GL_MAP2_VERTEX_4 */ + { 16341, 0x00008670 }, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ + { 16369, 0x0000867A }, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ + { 16398, 0x0000867B }, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ + { 16427, 0x0000867C }, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ + { 16456, 0x0000867D }, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ + { 16485, 0x0000867E }, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ + { 16514, 0x0000867F }, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ + { 16543, 0x00008671 }, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ + { 16571, 0x00008672 }, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ + { 16599, 0x00008673 }, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ + { 16627, 0x00008674 }, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ + { 16655, 0x00008675 }, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ + { 16683, 0x00008676 }, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ + { 16711, 0x00008677 }, /* GL_MAP2_VERTEX_ATTRIB7_4_NV */ + { 16739, 0x00008678 }, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ + { 16767, 0x00008679 }, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ + { 16795, 0x00000D10 }, /* GL_MAP_COLOR */ + { 16808, 0x00000010 }, /* GL_MAP_FLUSH_EXPLICIT_BIT */ + { 16834, 0x00000008 }, /* GL_MAP_INVALIDATE_BUFFER_BIT */ + { 16863, 0x00000004 }, /* GL_MAP_INVALIDATE_RANGE_BIT */ + { 16891, 0x00000001 }, /* GL_MAP_READ_BIT */ + { 16907, 0x00000D11 }, /* GL_MAP_STENCIL */ + { 16922, 0x00000020 }, /* GL_MAP_UNSYNCHRONIZED_BIT */ + { 16948, 0x00000002 }, /* GL_MAP_WRITE_BIT */ + { 16965, 0x000088C0 }, /* GL_MATRIX0_ARB */ + { 16980, 0x00008630 }, /* GL_MATRIX0_NV */ + { 16994, 0x000088CA }, /* GL_MATRIX10_ARB */ + { 17010, 0x000088CB }, /* GL_MATRIX11_ARB */ + { 17026, 0x000088CC }, /* GL_MATRIX12_ARB */ + { 17042, 0x000088CD }, /* GL_MATRIX13_ARB */ + { 17058, 0x000088CE }, /* GL_MATRIX14_ARB */ + { 17074, 0x000088CF }, /* GL_MATRIX15_ARB */ + { 17090, 0x000088D0 }, /* GL_MATRIX16_ARB */ + { 17106, 0x000088D1 }, /* GL_MATRIX17_ARB */ + { 17122, 0x000088D2 }, /* GL_MATRIX18_ARB */ + { 17138, 0x000088D3 }, /* GL_MATRIX19_ARB */ + { 17154, 0x000088C1 }, /* GL_MATRIX1_ARB */ + { 17169, 0x00008631 }, /* GL_MATRIX1_NV */ + { 17183, 0x000088D4 }, /* GL_MATRIX20_ARB */ + { 17199, 0x000088D5 }, /* GL_MATRIX21_ARB */ + { 17215, 0x000088D6 }, /* GL_MATRIX22_ARB */ + { 17231, 0x000088D7 }, /* GL_MATRIX23_ARB */ + { 17247, 0x000088D8 }, /* GL_MATRIX24_ARB */ + { 17263, 0x000088D9 }, /* GL_MATRIX25_ARB */ + { 17279, 0x000088DA }, /* GL_MATRIX26_ARB */ + { 17295, 0x000088DB }, /* GL_MATRIX27_ARB */ + { 17311, 0x000088DC }, /* GL_MATRIX28_ARB */ + { 17327, 0x000088DD }, /* GL_MATRIX29_ARB */ + { 17343, 0x000088C2 }, /* GL_MATRIX2_ARB */ + { 17358, 0x00008632 }, /* GL_MATRIX2_NV */ + { 17372, 0x000088DE }, /* GL_MATRIX30_ARB */ + { 17388, 0x000088DF }, /* GL_MATRIX31_ARB */ + { 17404, 0x000088C3 }, /* GL_MATRIX3_ARB */ + { 17419, 0x00008633 }, /* GL_MATRIX3_NV */ + { 17433, 0x000088C4 }, /* GL_MATRIX4_ARB */ + { 17448, 0x00008634 }, /* GL_MATRIX4_NV */ + { 17462, 0x000088C5 }, /* GL_MATRIX5_ARB */ + { 17477, 0x00008635 }, /* GL_MATRIX5_NV */ + { 17491, 0x000088C6 }, /* GL_MATRIX6_ARB */ + { 17506, 0x00008636 }, /* GL_MATRIX6_NV */ + { 17520, 0x000088C7 }, /* GL_MATRIX7_ARB */ + { 17535, 0x00008637 }, /* GL_MATRIX7_NV */ + { 17549, 0x000088C8 }, /* GL_MATRIX8_ARB */ + { 17564, 0x000088C9 }, /* GL_MATRIX9_ARB */ + { 17579, 0x00008844 }, /* GL_MATRIX_INDEX_ARRAY_ARB */ + { 17605, 0x00008849 }, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ + { 17639, 0x00008846 }, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ + { 17670, 0x00008848 }, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ + { 17703, 0x00008847 }, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ + { 17734, 0x00000BA0 }, /* GL_MATRIX_MODE */ + { 17749, 0x00008840 }, /* GL_MATRIX_PALETTE_ARB */ + { 17771, 0x00008008 }, /* GL_MAX */ + { 17778, 0x00008073 }, /* GL_MAX_3D_TEXTURE_SIZE */ + { 17801, 0x000088FF }, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ + { 17833, 0x00000D35 }, /* GL_MAX_ATTRIB_STACK_DEPTH */ + { 17859, 0x00000D3B }, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ + { 17892, 0x00008177 }, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ + { 17918, 0x00008178 }, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + { 17952, 0x00000D32 }, /* GL_MAX_CLIP_PLANES */ + { 17971, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS */ + { 17996, 0x00008CDF }, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ + { 18025, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ + { 18057, 0x000080B3 }, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI */ + { 18093, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ + { 18129, 0x00008B4D }, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB */ + { 18169, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT */ + { 18195, 0x0000801B }, /* GL_MAX_CONVOLUTION_HEIGHT_EXT */ + { 18225, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH */ + { 18250, 0x0000801A }, /* GL_MAX_CONVOLUTION_WIDTH_EXT */ + { 18279, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ + { 18308, 0x0000851C }, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB */ + { 18341, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS */ + { 18361, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ARB */ + { 18385, 0x00008824 }, /* GL_MAX_DRAW_BUFFERS_ATI */ + { 18409, 0x000080E9 }, /* GL_MAX_ELEMENTS_INDICES */ + { 18433, 0x000080E8 }, /* GL_MAX_ELEMENTS_VERTICES */ + { 18458, 0x00000D30 }, /* GL_MAX_EVAL_ORDER */ + { 18476, 0x00008008 }, /* GL_MAX_EXT */ + { 18487, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ + { 18522, 0x00008B49 }, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB */ + { 18561, 0x00000D31 }, /* GL_MAX_LIGHTS */ + { 18575, 0x00000B31 }, /* GL_MAX_LIST_NESTING */ + { 18595, 0x00008841 }, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ + { 18633, 0x00000D36 }, /* GL_MAX_MODELVIEW_STACK_DEPTH */ + { 18662, 0x00000D37 }, /* GL_MAX_NAME_STACK_DEPTH */ + { 18686, 0x00008842 }, /* GL_MAX_PALETTE_MATRICES_ARB */ + { 18714, 0x00000D34 }, /* GL_MAX_PIXEL_MAP_TABLE */ + { 18737, 0x000088B1 }, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ + { 18774, 0x0000880B }, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ + { 18810, 0x000088AD }, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ + { 18837, 0x000088F5 }, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ + { 18866, 0x000088B5 }, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ + { 18900, 0x000088F4 }, /* GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ + { 18936, 0x000088F6 }, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ + { 18963, 0x000088A1 }, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ + { 18995, 0x000088B4 }, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ + { 19031, 0x000088F8 }, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ + { 19060, 0x000088F7 }, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ + { 19089, 0x0000862F }, /* GL_MAX_PROGRAM_MATRICES_ARB */ + { 19117, 0x0000862E }, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ + { 19155, 0x000088B3 }, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + { 19199, 0x0000880E }, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + { 19242, 0x000088AF }, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ + { 19276, 0x000088A3 }, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + { 19315, 0x000088AB }, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ + { 19352, 0x000088A7 }, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ + { 19390, 0x00008810 }, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + { 19433, 0x0000880F }, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + { 19476, 0x000088A9 }, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ + { 19506, 0x000088A5 }, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ + { 19537, 0x0000880D }, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ + { 19573, 0x0000880C }, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ + { 19609, 0x00000D38 }, /* GL_MAX_PROJECTION_STACK_DEPTH */ + { 19639, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ + { 19673, 0x000084F8 }, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_NV */ + { 19706, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE */ + { 19731, 0x000084E8 }, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ + { 19760, 0x00008D57 }, /* GL_MAX_SAMPLES */ + { 19775, 0x00008D57 }, /* GL_MAX_SAMPLES_EXT */ + { 19794, 0x00009111 }, /* GL_MAX_SERVER_WAIT_TIMEOUT */ + { 19821, 0x00008504 }, /* GL_MAX_SHININESS_NV */ + { 19841, 0x00008505 }, /* GL_MAX_SPOT_EXPONENT_NV */ + { 19865, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS */ + { 19887, 0x00008871 }, /* GL_MAX_TEXTURE_COORDS_ARB */ + { 19913, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS */ + { 19940, 0x00008872 }, /* GL_MAX_TEXTURE_IMAGE_UNITS_ARB */ + { 19971, 0x000084FD }, /* GL_MAX_TEXTURE_LOD_BIAS */ + { 19995, 0x000084FF }, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ + { 20029, 0x00000D33 }, /* GL_MAX_TEXTURE_SIZE */ + { 20049, 0x00000D39 }, /* GL_MAX_TEXTURE_STACK_DEPTH */ + { 20076, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS */ + { 20097, 0x000084E2 }, /* GL_MAX_TEXTURE_UNITS_ARB */ + { 20122, 0x0000862F }, /* GL_MAX_TRACK_MATRICES_NV */ + { 20147, 0x0000862E }, /* GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV */ + { 20182, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS */ + { 20204, 0x00008B4B }, /* GL_MAX_VARYING_FLOATS_ARB */ + { 20230, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS */ + { 20252, 0x00008869 }, /* GL_MAX_VERTEX_ATTRIBS_ARB */ + { 20278, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ + { 20312, 0x00008B4C }, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ + { 20350, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ + { 20383, 0x00008B4A }, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB */ + { 20420, 0x000086A4 }, /* GL_MAX_VERTEX_UNITS_ARB */ + { 20444, 0x00000D3A }, /* GL_MAX_VIEWPORT_DIMS */ + { 20465, 0x00008007 }, /* GL_MIN */ + { 20472, 0x0000802E }, /* GL_MINMAX */ + { 20482, 0x0000802E }, /* GL_MINMAX_EXT */ + { 20496, 0x0000802F }, /* GL_MINMAX_FORMAT */ + { 20513, 0x0000802F }, /* GL_MINMAX_FORMAT_EXT */ + { 20534, 0x00008030 }, /* GL_MINMAX_SINK */ + { 20549, 0x00008030 }, /* GL_MINMAX_SINK_EXT */ + { 20568, 0x00008007 }, /* GL_MIN_EXT */ + { 20579, 0x00008370 }, /* GL_MIRRORED_REPEAT */ + { 20598, 0x00008370 }, /* GL_MIRRORED_REPEAT_ARB */ + { 20621, 0x00008370 }, /* GL_MIRRORED_REPEAT_IBM */ + { 20644, 0x00008742 }, /* GL_MIRROR_CLAMP_ATI */ + { 20664, 0x00008742 }, /* GL_MIRROR_CLAMP_EXT */ + { 20684, 0x00008912 }, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ + { 20714, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_ATI */ + { 20742, 0x00008743 }, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ + { 20770, 0x00001700 }, /* GL_MODELVIEW */ + { 20783, 0x00001700 }, /* GL_MODELVIEW0_ARB */ + { 20801, 0x0000872A }, /* GL_MODELVIEW10_ARB */ + { 20820, 0x0000872B }, /* GL_MODELVIEW11_ARB */ + { 20839, 0x0000872C }, /* GL_MODELVIEW12_ARB */ + { 20858, 0x0000872D }, /* GL_MODELVIEW13_ARB */ + { 20877, 0x0000872E }, /* GL_MODELVIEW14_ARB */ + { 20896, 0x0000872F }, /* GL_MODELVIEW15_ARB */ + { 20915, 0x00008730 }, /* GL_MODELVIEW16_ARB */ + { 20934, 0x00008731 }, /* GL_MODELVIEW17_ARB */ + { 20953, 0x00008732 }, /* GL_MODELVIEW18_ARB */ + { 20972, 0x00008733 }, /* GL_MODELVIEW19_ARB */ + { 20991, 0x0000850A }, /* GL_MODELVIEW1_ARB */ + { 21009, 0x00008734 }, /* GL_MODELVIEW20_ARB */ + { 21028, 0x00008735 }, /* GL_MODELVIEW21_ARB */ + { 21047, 0x00008736 }, /* GL_MODELVIEW22_ARB */ + { 21066, 0x00008737 }, /* GL_MODELVIEW23_ARB */ + { 21085, 0x00008738 }, /* GL_MODELVIEW24_ARB */ + { 21104, 0x00008739 }, /* GL_MODELVIEW25_ARB */ + { 21123, 0x0000873A }, /* GL_MODELVIEW26_ARB */ + { 21142, 0x0000873B }, /* GL_MODELVIEW27_ARB */ + { 21161, 0x0000873C }, /* GL_MODELVIEW28_ARB */ + { 21180, 0x0000873D }, /* GL_MODELVIEW29_ARB */ + { 21199, 0x00008722 }, /* GL_MODELVIEW2_ARB */ + { 21217, 0x0000873E }, /* GL_MODELVIEW30_ARB */ + { 21236, 0x0000873F }, /* GL_MODELVIEW31_ARB */ + { 21255, 0x00008723 }, /* GL_MODELVIEW3_ARB */ + { 21273, 0x00008724 }, /* GL_MODELVIEW4_ARB */ + { 21291, 0x00008725 }, /* GL_MODELVIEW5_ARB */ + { 21309, 0x00008726 }, /* GL_MODELVIEW6_ARB */ + { 21327, 0x00008727 }, /* GL_MODELVIEW7_ARB */ + { 21345, 0x00008728 }, /* GL_MODELVIEW8_ARB */ + { 21363, 0x00008729 }, /* GL_MODELVIEW9_ARB */ + { 21381, 0x00000BA6 }, /* GL_MODELVIEW_MATRIX */ + { 21401, 0x00008629 }, /* GL_MODELVIEW_PROJECTION_NV */ + { 21428, 0x00000BA3 }, /* GL_MODELVIEW_STACK_DEPTH */ + { 21453, 0x00002100 }, /* GL_MODULATE */ + { 21465, 0x00008744 }, /* GL_MODULATE_ADD_ATI */ + { 21485, 0x00008745 }, /* GL_MODULATE_SIGNED_ADD_ATI */ + { 21512, 0x00008746 }, /* GL_MODULATE_SUBTRACT_ATI */ + { 21537, 0x00000103 }, /* GL_MULT */ + { 21545, 0x0000809D }, /* GL_MULTISAMPLE */ + { 21560, 0x000086B2 }, /* GL_MULTISAMPLE_3DFX */ + { 21580, 0x0000809D }, /* GL_MULTISAMPLE_ARB */ + { 21599, 0x20000000 }, /* GL_MULTISAMPLE_BIT */ + { 21618, 0x20000000 }, /* GL_MULTISAMPLE_BIT_3DFX */ + { 21642, 0x20000000 }, /* GL_MULTISAMPLE_BIT_ARB */ + { 21665, 0x00008534 }, /* GL_MULTISAMPLE_FILTER_HINT_NV */ + { 21695, 0x00002A25 }, /* GL_N3F_V3F */ + { 21706, 0x00000D70 }, /* GL_NAME_STACK_DEPTH */ + { 21726, 0x0000150E }, /* GL_NAND */ + { 21734, 0x00002600 }, /* GL_NEAREST */ + { 21745, 0x0000844E }, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ + { 21776, 0x0000844D }, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ + { 21808, 0x00002702 }, /* GL_NEAREST_MIPMAP_LINEAR */ + { 21833, 0x00002700 }, /* GL_NEAREST_MIPMAP_NEAREST */ + { 21859, 0x00000200 }, /* GL_NEVER */ + { 21868, 0x00001102 }, /* GL_NICEST */ + { 21878, 0x00000000 }, /* GL_NONE */ + { 21886, 0x00001505 }, /* GL_NOOP */ + { 21894, 0x00001508 }, /* GL_NOR */ + { 21901, 0x00000BA1 }, /* GL_NORMALIZE */ + { 21914, 0x00008075 }, /* GL_NORMAL_ARRAY */ + { 21930, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ + { 21961, 0x00008897 }, /* GL_NORMAL_ARRAY_BUFFER_BINDING_ARB */ + { 21996, 0x0000808F }, /* GL_NORMAL_ARRAY_POINTER */ + { 22020, 0x0000807F }, /* GL_NORMAL_ARRAY_STRIDE */ + { 22043, 0x0000807E }, /* GL_NORMAL_ARRAY_TYPE */ + { 22064, 0x00008511 }, /* GL_NORMAL_MAP */ + { 22078, 0x00008511 }, /* GL_NORMAL_MAP_ARB */ + { 22096, 0x00008511 }, /* GL_NORMAL_MAP_NV */ + { 22113, 0x00000205 }, /* GL_NOTEQUAL */ + { 22125, 0x00000000 }, /* GL_NO_ERROR */ + { 22137, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ + { 22171, 0x000086A2 }, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB */ + { 22209, 0x00008B89 }, /* GL_OBJECT_ACTIVE_ATTRIBUTES_ARB */ + { 22241, 0x00008B8A }, /* GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB */ + { 22283, 0x00008B86 }, /* GL_OBJECT_ACTIVE_UNIFORMS_ARB */ + { 22313, 0x00008B87 }, /* GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB */ + { 22353, 0x00008B85 }, /* GL_OBJECT_ATTACHED_OBJECTS_ARB */ + { 22384, 0x00008B81 }, /* GL_OBJECT_COMPILE_STATUS_ARB */ + { 22413, 0x00008B80 }, /* GL_OBJECT_DELETE_STATUS_ARB */ + { 22441, 0x00008B84 }, /* GL_OBJECT_INFO_LOG_LENGTH_ARB */ + { 22471, 0x00002401 }, /* GL_OBJECT_LINEAR */ + { 22488, 0x00008B82 }, /* GL_OBJECT_LINK_STATUS_ARB */ + { 22514, 0x00002501 }, /* GL_OBJECT_PLANE */ + { 22530, 0x00008B88 }, /* GL_OBJECT_SHADER_SOURCE_LENGTH_ARB */ + { 22565, 0x00008B4F }, /* GL_OBJECT_SUBTYPE_ARB */ + { 22587, 0x00009112 }, /* GL_OBJECT_TYPE */ + { 22602, 0x00008B4E }, /* GL_OBJECT_TYPE_ARB */ + { 22621, 0x00008B83 }, /* GL_OBJECT_VALIDATE_STATUS_ARB */ + { 22651, 0x00008165 }, /* GL_OCCLUSION_TEST_HP */ + { 22672, 0x00008166 }, /* GL_OCCLUSION_TEST_RESULT_HP */ + { 22700, 0x00000001 }, /* GL_ONE */ + { 22707, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA */ + { 22735, 0x00008004 }, /* GL_ONE_MINUS_CONSTANT_ALPHA_EXT */ + { 22767, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR */ + { 22795, 0x00008002 }, /* GL_ONE_MINUS_CONSTANT_COLOR_EXT */ + { 22827, 0x00000305 }, /* GL_ONE_MINUS_DST_ALPHA */ + { 22850, 0x00000307 }, /* GL_ONE_MINUS_DST_COLOR */ + { 22873, 0x00000303 }, /* GL_ONE_MINUS_SRC_ALPHA */ + { 22896, 0x00000301 }, /* GL_ONE_MINUS_SRC_COLOR */ + { 22919, 0x00008598 }, /* GL_OPERAND0_ALPHA */ + { 22937, 0x00008598 }, /* GL_OPERAND0_ALPHA_ARB */ + { 22959, 0x00008598 }, /* GL_OPERAND0_ALPHA_EXT */ + { 22981, 0x00008590 }, /* GL_OPERAND0_RGB */ + { 22997, 0x00008590 }, /* GL_OPERAND0_RGB_ARB */ + { 23017, 0x00008590 }, /* GL_OPERAND0_RGB_EXT */ + { 23037, 0x00008599 }, /* GL_OPERAND1_ALPHA */ + { 23055, 0x00008599 }, /* GL_OPERAND1_ALPHA_ARB */ + { 23077, 0x00008599 }, /* GL_OPERAND1_ALPHA_EXT */ + { 23099, 0x00008591 }, /* GL_OPERAND1_RGB */ + { 23115, 0x00008591 }, /* GL_OPERAND1_RGB_ARB */ + { 23135, 0x00008591 }, /* GL_OPERAND1_RGB_EXT */ + { 23155, 0x0000859A }, /* GL_OPERAND2_ALPHA */ + { 23173, 0x0000859A }, /* GL_OPERAND2_ALPHA_ARB */ + { 23195, 0x0000859A }, /* GL_OPERAND2_ALPHA_EXT */ + { 23217, 0x00008592 }, /* GL_OPERAND2_RGB */ + { 23233, 0x00008592 }, /* GL_OPERAND2_RGB_ARB */ + { 23253, 0x00008592 }, /* GL_OPERAND2_RGB_EXT */ + { 23273, 0x0000859B }, /* GL_OPERAND3_ALPHA_NV */ + { 23294, 0x00008593 }, /* GL_OPERAND3_RGB_NV */ + { 23313, 0x00001507 }, /* GL_OR */ + { 23319, 0x00000A01 }, /* GL_ORDER */ + { 23328, 0x0000150D }, /* GL_OR_INVERTED */ + { 23343, 0x0000150B }, /* GL_OR_REVERSE */ + { 23357, 0x00000505 }, /* GL_OUT_OF_MEMORY */ + { 23374, 0x00000D05 }, /* GL_PACK_ALIGNMENT */ + { 23392, 0x0000806C }, /* GL_PACK_IMAGE_HEIGHT */ + { 23413, 0x00008758 }, /* GL_PACK_INVERT_MESA */ + { 23433, 0x00000D01 }, /* GL_PACK_LSB_FIRST */ + { 23451, 0x00000D02 }, /* GL_PACK_ROW_LENGTH */ + { 23470, 0x0000806B }, /* GL_PACK_SKIP_IMAGES */ + { 23490, 0x00000D04 }, /* GL_PACK_SKIP_PIXELS */ + { 23510, 0x00000D03 }, /* GL_PACK_SKIP_ROWS */ + { 23528, 0x00000D00 }, /* GL_PACK_SWAP_BYTES */ + { 23547, 0x00008B92 }, /* GL_PALETTE4_R5_G6_B5_OES */ + { 23572, 0x00008B94 }, /* GL_PALETTE4_RGB5_A1_OES */ + { 23596, 0x00008B90 }, /* GL_PALETTE4_RGB8_OES */ + { 23617, 0x00008B93 }, /* GL_PALETTE4_RGBA4_OES */ + { 23639, 0x00008B91 }, /* GL_PALETTE4_RGBA8_OES */ + { 23661, 0x00008B97 }, /* GL_PALETTE8_R5_G6_B5_OES */ + { 23686, 0x00008B99 }, /* GL_PALETTE8_RGB5_A1_OES */ + { 23710, 0x00008B95 }, /* GL_PALETTE8_RGB8_OES */ + { 23731, 0x00008B98 }, /* GL_PALETTE8_RGBA4_OES */ + { 23753, 0x00008B96 }, /* GL_PALETTE8_RGBA8_OES */ + { 23775, 0x00000700 }, /* GL_PASS_THROUGH_TOKEN */ + { 23797, 0x00000C50 }, /* GL_PERSPECTIVE_CORRECTION_HINT */ + { 23828, 0x00000C79 }, /* GL_PIXEL_MAP_A_TO_A */ + { 23848, 0x00000CB9 }, /* GL_PIXEL_MAP_A_TO_A_SIZE */ + { 23873, 0x00000C78 }, /* GL_PIXEL_MAP_B_TO_B */ + { 23893, 0x00000CB8 }, /* GL_PIXEL_MAP_B_TO_B_SIZE */ + { 23918, 0x00000C77 }, /* GL_PIXEL_MAP_G_TO_G */ + { 23938, 0x00000CB7 }, /* GL_PIXEL_MAP_G_TO_G_SIZE */ + { 23963, 0x00000C75 }, /* GL_PIXEL_MAP_I_TO_A */ + { 23983, 0x00000CB5 }, /* GL_PIXEL_MAP_I_TO_A_SIZE */ + { 24008, 0x00000C74 }, /* GL_PIXEL_MAP_I_TO_B */ + { 24028, 0x00000CB4 }, /* GL_PIXEL_MAP_I_TO_B_SIZE */ + { 24053, 0x00000C73 }, /* GL_PIXEL_MAP_I_TO_G */ + { 24073, 0x00000CB3 }, /* GL_PIXEL_MAP_I_TO_G_SIZE */ + { 24098, 0x00000C70 }, /* GL_PIXEL_MAP_I_TO_I */ + { 24118, 0x00000CB0 }, /* GL_PIXEL_MAP_I_TO_I_SIZE */ + { 24143, 0x00000C72 }, /* GL_PIXEL_MAP_I_TO_R */ + { 24163, 0x00000CB2 }, /* GL_PIXEL_MAP_I_TO_R_SIZE */ + { 24188, 0x00000C76 }, /* GL_PIXEL_MAP_R_TO_R */ + { 24208, 0x00000CB6 }, /* GL_PIXEL_MAP_R_TO_R_SIZE */ + { 24233, 0x00000C71 }, /* GL_PIXEL_MAP_S_TO_S */ + { 24253, 0x00000CB1 }, /* GL_PIXEL_MAP_S_TO_S_SIZE */ + { 24278, 0x00000020 }, /* GL_PIXEL_MODE_BIT */ + { 24296, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER */ + { 24317, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING */ + { 24346, 0x000088ED }, /* GL_PIXEL_PACK_BUFFER_BINDING_EXT */ + { 24379, 0x000088EB }, /* GL_PIXEL_PACK_BUFFER_EXT */ + { 24404, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER */ + { 24427, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING */ + { 24458, 0x000088EF }, /* GL_PIXEL_UNPACK_BUFFER_BINDING_EXT */ + { 24493, 0x000088EC }, /* GL_PIXEL_UNPACK_BUFFER_EXT */ + { 24520, 0x00001B00 }, /* GL_POINT */ + { 24529, 0x00000000 }, /* GL_POINTS */ + { 24539, 0x00000002 }, /* GL_POINT_BIT */ + { 24552, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION */ + { 24582, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_ARB */ + { 24616, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_EXT */ + { 24650, 0x00008129 }, /* GL_POINT_DISTANCE_ATTENUATION_SGIS */ + { 24685, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE */ + { 24714, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_ARB */ + { 24747, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_EXT */ + { 24780, 0x00008128 }, /* GL_POINT_FADE_THRESHOLD_SIZE_SGIS */ + { 24814, 0x00000B11 }, /* GL_POINT_SIZE */ + { 24828, 0x00000B13 }, /* GL_POINT_SIZE_GRANULARITY */ + { 24854, 0x00008127 }, /* GL_POINT_SIZE_MAX */ + { 24872, 0x00008127 }, /* GL_POINT_SIZE_MAX_ARB */ + { 24894, 0x00008127 }, /* GL_POINT_SIZE_MAX_EXT */ + { 24916, 0x00008127 }, /* GL_POINT_SIZE_MAX_SGIS */ + { 24939, 0x00008126 }, /* GL_POINT_SIZE_MIN */ + { 24957, 0x00008126 }, /* GL_POINT_SIZE_MIN_ARB */ + { 24979, 0x00008126 }, /* GL_POINT_SIZE_MIN_EXT */ + { 25001, 0x00008126 }, /* GL_POINT_SIZE_MIN_SGIS */ + { 25024, 0x00000B12 }, /* GL_POINT_SIZE_RANGE */ + { 25044, 0x00000B10 }, /* GL_POINT_SMOOTH */ + { 25060, 0x00000C51 }, /* GL_POINT_SMOOTH_HINT */ + { 25081, 0x00008861 }, /* GL_POINT_SPRITE */ + { 25097, 0x00008861 }, /* GL_POINT_SPRITE_ARB */ + { 25117, 0x00008CA0 }, /* GL_POINT_SPRITE_COORD_ORIGIN */ + { 25146, 0x00008861 }, /* GL_POINT_SPRITE_NV */ + { 25165, 0x00008863 }, /* GL_POINT_SPRITE_R_MODE_NV */ + { 25191, 0x00000701 }, /* GL_POINT_TOKEN */ + { 25206, 0x00000009 }, /* GL_POLYGON */ + { 25217, 0x00000008 }, /* GL_POLYGON_BIT */ + { 25232, 0x00000B40 }, /* GL_POLYGON_MODE */ + { 25248, 0x00008039 }, /* GL_POLYGON_OFFSET_BIAS */ + { 25271, 0x00008038 }, /* GL_POLYGON_OFFSET_FACTOR */ + { 25296, 0x00008037 }, /* GL_POLYGON_OFFSET_FILL */ + { 25319, 0x00002A02 }, /* GL_POLYGON_OFFSET_LINE */ + { 25342, 0x00002A01 }, /* GL_POLYGON_OFFSET_POINT */ + { 25366, 0x00002A00 }, /* GL_POLYGON_OFFSET_UNITS */ + { 25390, 0x00000B41 }, /* GL_POLYGON_SMOOTH */ + { 25408, 0x00000C53 }, /* GL_POLYGON_SMOOTH_HINT */ + { 25431, 0x00000B42 }, /* GL_POLYGON_STIPPLE */ + { 25450, 0x00000010 }, /* GL_POLYGON_STIPPLE_BIT */ + { 25473, 0x00000703 }, /* GL_POLYGON_TOKEN */ + { 25490, 0x00001203 }, /* GL_POSITION */ + { 25502, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ + { 25534, 0x000080BB }, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI */ + { 25570, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ + { 25603, 0x000080B7 }, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI */ + { 25640, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ + { 25671, 0x000080BA }, /* GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI */ + { 25706, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ + { 25738, 0x000080B6 }, /* GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI */ + { 25774, 0x000080D2 }, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ + { 25807, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ + { 25839, 0x000080B9 }, /* GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI */ + { 25875, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ + { 25908, 0x000080B5 }, /* GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI */ + { 25945, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS */ + { 25975, 0x000080B8 }, /* GL_POST_COLOR_MATRIX_RED_BIAS_SGI */ + { 26009, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE */ + { 26040, 0x000080B4 }, /* GL_POST_COLOR_MATRIX_RED_SCALE_SGI */ + { 26075, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ + { 26106, 0x00008023 }, /* GL_POST_CONVOLUTION_ALPHA_BIAS_EXT */ + { 26141, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ + { 26173, 0x0000801F }, /* GL_POST_CONVOLUTION_ALPHA_SCALE_EXT */ + { 26209, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS */ + { 26239, 0x00008022 }, /* GL_POST_CONVOLUTION_BLUE_BIAS_EXT */ + { 26273, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE */ + { 26304, 0x0000801E }, /* GL_POST_CONVOLUTION_BLUE_SCALE_EXT */ + { 26339, 0x000080D1 }, /* GL_POST_CONVOLUTION_COLOR_TABLE */ + { 26371, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS */ + { 26402, 0x00008021 }, /* GL_POST_CONVOLUTION_GREEN_BIAS_EXT */ + { 26437, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE */ + { 26469, 0x0000801D }, /* GL_POST_CONVOLUTION_GREEN_SCALE_EXT */ + { 26505, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS */ + { 26534, 0x00008020 }, /* GL_POST_CONVOLUTION_RED_BIAS_EXT */ + { 26567, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE */ + { 26597, 0x0000801C }, /* GL_POST_CONVOLUTION_RED_SCALE_EXT */ + { 26631, 0x0000817B }, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ + { 26670, 0x00008179 }, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ + { 26703, 0x0000817C }, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ + { 26743, 0x0000817A }, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ + { 26777, 0x00008578 }, /* GL_PREVIOUS */ + { 26789, 0x00008578 }, /* GL_PREVIOUS_ARB */ + { 26805, 0x00008578 }, /* GL_PREVIOUS_EXT */ + { 26821, 0x00008577 }, /* GL_PRIMARY_COLOR */ + { 26838, 0x00008577 }, /* GL_PRIMARY_COLOR_ARB */ + { 26859, 0x00008577 }, /* GL_PRIMARY_COLOR_EXT */ + { 26880, 0x000088B0 }, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ + { 26913, 0x00008805 }, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ + { 26945, 0x000088AC }, /* GL_PROGRAM_ATTRIBS_ARB */ + { 26968, 0x00008677 }, /* GL_PROGRAM_BINDING_ARB */ + { 26991, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_ARB */ + { 27021, 0x0000864B }, /* GL_PROGRAM_ERROR_POSITION_NV */ + { 27050, 0x00008874 }, /* GL_PROGRAM_ERROR_STRING_ARB */ + { 27078, 0x00008876 }, /* GL_PROGRAM_FORMAT_ARB */ + { 27100, 0x00008875 }, /* GL_PROGRAM_FORMAT_ASCII_ARB */ + { 27128, 0x000088A0 }, /* GL_PROGRAM_INSTRUCTIONS_ARB */ + { 27156, 0x00008627 }, /* GL_PROGRAM_LENGTH_ARB */ + { 27178, 0x00008627 }, /* GL_PROGRAM_LENGTH_NV */ + { 27199, 0x000088B2 }, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + { 27239, 0x00008808 }, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + { 27278, 0x000088AE }, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ + { 27308, 0x000088A2 }, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + { 27343, 0x000088AA }, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ + { 27376, 0x000088A6 }, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ + { 27410, 0x0000880A }, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + { 27449, 0x00008809 }, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + { 27488, 0x00008B40 }, /* GL_PROGRAM_OBJECT_ARB */ + { 27510, 0x000088A8 }, /* GL_PROGRAM_PARAMETERS_ARB */ + { 27536, 0x00008644 }, /* GL_PROGRAM_PARAMETER_NV */ + { 27560, 0x00008647 }, /* GL_PROGRAM_RESIDENT_NV */ + { 27583, 0x00008628 }, /* GL_PROGRAM_STRING_ARB */ + { 27605, 0x00008628 }, /* GL_PROGRAM_STRING_NV */ + { 27626, 0x00008646 }, /* GL_PROGRAM_TARGET_NV */ + { 27647, 0x000088A4 }, /* GL_PROGRAM_TEMPORARIES_ARB */ + { 27674, 0x00008807 }, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ + { 27706, 0x00008806 }, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ + { 27738, 0x000088B6 }, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ + { 27773, 0x00001701 }, /* GL_PROJECTION */ + { 27787, 0x00000BA7 }, /* GL_PROJECTION_MATRIX */ + { 27808, 0x00000BA4 }, /* GL_PROJECTION_STACK_DEPTH */ + { 27834, 0x00008E4F }, /* GL_PROVOKING_VERTEX */ + { 27854, 0x00008E4F }, /* GL_PROVOKING_VERTEX_EXT */ + { 27878, 0x000080D3 }, /* GL_PROXY_COLOR_TABLE */ + { 27899, 0x00008025 }, /* GL_PROXY_HISTOGRAM */ + { 27918, 0x00008025 }, /* GL_PROXY_HISTOGRAM_EXT */ + { 27941, 0x000080D5 }, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ + { 27980, 0x000080D4 }, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ + { 28018, 0x00008063 }, /* GL_PROXY_TEXTURE_1D */ + { 28038, 0x00008C19 }, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ + { 28068, 0x00008063 }, /* GL_PROXY_TEXTURE_1D_EXT */ + { 28092, 0x00008064 }, /* GL_PROXY_TEXTURE_2D */ + { 28112, 0x00008C1B }, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ + { 28142, 0x00008064 }, /* GL_PROXY_TEXTURE_2D_EXT */ + { 28166, 0x00008070 }, /* GL_PROXY_TEXTURE_3D */ + { 28186, 0x000080BD }, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ + { 28219, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP */ + { 28245, 0x0000851B }, /* GL_PROXY_TEXTURE_CUBE_MAP_ARB */ + { 28275, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ + { 28306, 0x000084F7 }, /* GL_PROXY_TEXTURE_RECTANGLE_NV */ + { 28336, 0x00002003 }, /* GL_Q */ + { 28341, 0x00001209 }, /* GL_QUADRATIC_ATTENUATION */ + { 28366, 0x00000007 }, /* GL_QUADS */ + { 28375, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */ + { 28419, 0x00008E4C }, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT */ + { 28467, 0x00008614 }, /* GL_QUAD_MESH_SUN */ + { 28484, 0x00000008 }, /* GL_QUAD_STRIP */ + { 28498, 0x00008864 }, /* GL_QUERY_COUNTER_BITS */ + { 28520, 0x00008864 }, /* GL_QUERY_COUNTER_BITS_ARB */ + { 28546, 0x00008866 }, /* GL_QUERY_RESULT */ + { 28562, 0x00008866 }, /* GL_QUERY_RESULT_ARB */ + { 28582, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE */ + { 28608, 0x00008867 }, /* GL_QUERY_RESULT_AVAILABLE_ARB */ + { 28638, 0x00002002 }, /* GL_R */ + { 28643, 0x00002A10 }, /* GL_R3_G3_B2 */ + { 28655, 0x00019262 }, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ + { 28688, 0x00000C02 }, /* GL_READ_BUFFER */ + { 28703, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER */ + { 28723, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING */ + { 28751, 0x00008CAA }, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ + { 28783, 0x00008CA8 }, /* GL_READ_FRAMEBUFFER_EXT */ + { 28807, 0x000088B8 }, /* GL_READ_ONLY */ + { 28820, 0x000088B8 }, /* GL_READ_ONLY_ARB */ + { 28837, 0x000088BA }, /* GL_READ_WRITE */ + { 28851, 0x000088BA }, /* GL_READ_WRITE_ARB */ + { 28869, 0x00001903 }, /* GL_RED */ + { 28876, 0x00008016 }, /* GL_REDUCE */ + { 28886, 0x00008016 }, /* GL_REDUCE_EXT */ + { 28900, 0x00000D15 }, /* GL_RED_BIAS */ + { 28912, 0x00000D52 }, /* GL_RED_BITS */ + { 28924, 0x00000D14 }, /* GL_RED_SCALE */ + { 28937, 0x00008512 }, /* GL_REFLECTION_MAP */ + { 28955, 0x00008512 }, /* GL_REFLECTION_MAP_ARB */ + { 28977, 0x00008512 }, /* GL_REFLECTION_MAP_NV */ + { 28998, 0x00001C00 }, /* GL_RENDER */ + { 29008, 0x00008D41 }, /* GL_RENDERBUFFER */ + { 29024, 0x00008D53 }, /* GL_RENDERBUFFER_ALPHA_SIZE */ + { 29051, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING */ + { 29075, 0x00008CA7 }, /* GL_RENDERBUFFER_BINDING_EXT */ + { 29103, 0x00008D52 }, /* GL_RENDERBUFFER_BLUE_SIZE */ + { 29129, 0x00008D54 }, /* GL_RENDERBUFFER_DEPTH_SIZE */ + { 29156, 0x00008D41 }, /* GL_RENDERBUFFER_EXT */ + { 29176, 0x00008D51 }, /* GL_RENDERBUFFER_GREEN_SIZE */ + { 29203, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT */ + { 29226, 0x00008D43 }, /* GL_RENDERBUFFER_HEIGHT_EXT */ + { 29253, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ + { 29285, 0x00008D44 }, /* GL_RENDERBUFFER_INTERNAL_FORMAT_EXT */ + { 29321, 0x00008D50 }, /* GL_RENDERBUFFER_RED_SIZE */ + { 29346, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES */ + { 29370, 0x00008CAB }, /* GL_RENDERBUFFER_SAMPLES_EXT */ + { 29398, 0x00008D55 }, /* GL_RENDERBUFFER_STENCIL_SIZE */ + { 29427, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH */ + { 29449, 0x00008D42 }, /* GL_RENDERBUFFER_WIDTH_EXT */ + { 29475, 0x00001F01 }, /* GL_RENDERER */ + { 29487, 0x00000C40 }, /* GL_RENDER_MODE */ + { 29502, 0x00002901 }, /* GL_REPEAT */ + { 29512, 0x00001E01 }, /* GL_REPLACE */ + { 29523, 0x00008062 }, /* GL_REPLACE_EXT */ + { 29538, 0x00008153 }, /* GL_REPLICATE_BORDER_HP */ + { 29561, 0x0000803A }, /* GL_RESCALE_NORMAL */ + { 29579, 0x0000803A }, /* GL_RESCALE_NORMAL_EXT */ + { 29601, 0x00000102 }, /* GL_RETURN */ + { 29611, 0x00001907 }, /* GL_RGB */ + { 29618, 0x00008052 }, /* GL_RGB10 */ + { 29627, 0x00008059 }, /* GL_RGB10_A2 */ + { 29639, 0x00008059 }, /* GL_RGB10_A2_EXT */ + { 29655, 0x00008052 }, /* GL_RGB10_EXT */ + { 29668, 0x00008053 }, /* GL_RGB12 */ + { 29677, 0x00008053 }, /* GL_RGB12_EXT */ + { 29690, 0x00008054 }, /* GL_RGB16 */ + { 29699, 0x00008054 }, /* GL_RGB16_EXT */ + { 29712, 0x0000804E }, /* GL_RGB2_EXT */ + { 29724, 0x0000804F }, /* GL_RGB4 */ + { 29732, 0x0000804F }, /* GL_RGB4_EXT */ + { 29744, 0x000083A1 }, /* GL_RGB4_S3TC */ + { 29757, 0x00008050 }, /* GL_RGB5 */ + { 29765, 0x00008057 }, /* GL_RGB5_A1 */ + { 29776, 0x00008057 }, /* GL_RGB5_A1_EXT */ + { 29791, 0x00008050 }, /* GL_RGB5_EXT */ + { 29803, 0x00008051 }, /* GL_RGB8 */ + { 29811, 0x00008051 }, /* GL_RGB8_EXT */ + { 29823, 0x00001908 }, /* GL_RGBA */ + { 29831, 0x0000805A }, /* GL_RGBA12 */ + { 29841, 0x0000805A }, /* GL_RGBA12_EXT */ + { 29855, 0x0000805B }, /* GL_RGBA16 */ + { 29865, 0x0000805B }, /* GL_RGBA16_EXT */ + { 29879, 0x00008055 }, /* GL_RGBA2 */ + { 29888, 0x00008055 }, /* GL_RGBA2_EXT */ + { 29901, 0x00008056 }, /* GL_RGBA4 */ + { 29910, 0x000083A5 }, /* GL_RGBA4_DXT5_S3TC */ + { 29929, 0x00008056 }, /* GL_RGBA4_EXT */ + { 29942, 0x000083A3 }, /* GL_RGBA4_S3TC */ + { 29956, 0x00008058 }, /* GL_RGBA8 */ + { 29965, 0x00008058 }, /* GL_RGBA8_EXT */ + { 29978, 0x00008F97 }, /* GL_RGBA8_SNORM */ + { 29993, 0x000083A4 }, /* GL_RGBA_DXT5_S3TC */ + { 30011, 0x00000C31 }, /* GL_RGBA_MODE */ + { 30024, 0x000083A2 }, /* GL_RGBA_S3TC */ + { 30037, 0x00008F93 }, /* GL_RGBA_SNORM */ + { 30051, 0x000083A0 }, /* GL_RGB_S3TC */ + { 30063, 0x00008573 }, /* GL_RGB_SCALE */ + { 30076, 0x00008573 }, /* GL_RGB_SCALE_ARB */ + { 30093, 0x00008573 }, /* GL_RGB_SCALE_EXT */ + { 30110, 0x00000407 }, /* GL_RIGHT */ + { 30119, 0x00002000 }, /* GL_S */ + { 30124, 0x00008B5D }, /* GL_SAMPLER_1D */ + { 30138, 0x00008B61 }, /* GL_SAMPLER_1D_SHADOW */ + { 30159, 0x00008B5E }, /* GL_SAMPLER_2D */ + { 30173, 0x00008B62 }, /* GL_SAMPLER_2D_SHADOW */ + { 30194, 0x00008B5F }, /* GL_SAMPLER_3D */ + { 30208, 0x00008B60 }, /* GL_SAMPLER_CUBE */ + { 30224, 0x000080A9 }, /* GL_SAMPLES */ + { 30235, 0x000086B4 }, /* GL_SAMPLES_3DFX */ + { 30251, 0x000080A9 }, /* GL_SAMPLES_ARB */ + { 30266, 0x00008914 }, /* GL_SAMPLES_PASSED */ + { 30284, 0x00008914 }, /* GL_SAMPLES_PASSED_ARB */ + { 30306, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ + { 30334, 0x0000809E }, /* GL_SAMPLE_ALPHA_TO_COVERAGE_ARB */ + { 30366, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE */ + { 30389, 0x0000809F }, /* GL_SAMPLE_ALPHA_TO_ONE_ARB */ + { 30416, 0x000080A8 }, /* GL_SAMPLE_BUFFERS */ + { 30434, 0x000086B3 }, /* GL_SAMPLE_BUFFERS_3DFX */ + { 30457, 0x000080A8 }, /* GL_SAMPLE_BUFFERS_ARB */ + { 30479, 0x000080A0 }, /* GL_SAMPLE_COVERAGE */ + { 30498, 0x000080A0 }, /* GL_SAMPLE_COVERAGE_ARB */ + { 30521, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT */ + { 30547, 0x000080AB }, /* GL_SAMPLE_COVERAGE_INVERT_ARB */ + { 30577, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE */ + { 30602, 0x000080AA }, /* GL_SAMPLE_COVERAGE_VALUE_ARB */ + { 30631, 0x00080000 }, /* GL_SCISSOR_BIT */ + { 30646, 0x00000C10 }, /* GL_SCISSOR_BOX */ + { 30661, 0x00000C11 }, /* GL_SCISSOR_TEST */ + { 30677, 0x0000845E }, /* GL_SECONDARY_COLOR_ARRAY */ + { 30702, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ + { 30742, 0x0000889C }, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB */ + { 30786, 0x0000845D }, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ + { 30819, 0x0000845A }, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ + { 30849, 0x0000845C }, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ + { 30881, 0x0000845B }, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ + { 30911, 0x00001C02 }, /* GL_SELECT */ + { 30921, 0x00000DF3 }, /* GL_SELECTION_BUFFER_POINTER */ + { 30949, 0x00000DF4 }, /* GL_SELECTION_BUFFER_SIZE */ + { 30974, 0x00008012 }, /* GL_SEPARABLE_2D */ + { 30990, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR */ + { 31017, 0x000081FA }, /* GL_SEPARATE_SPECULAR_COLOR_EXT */ + { 31048, 0x0000150F }, /* GL_SET */ + { 31055, 0x00008B48 }, /* GL_SHADER_OBJECT_ARB */ + { 31076, 0x00008B88 }, /* GL_SHADER_SOURCE_LENGTH */ + { 31100, 0x00008B4F }, /* GL_SHADER_TYPE */ + { 31115, 0x00000B54 }, /* GL_SHADE_MODEL */ + { 31130, 0x00008B8C }, /* GL_SHADING_LANGUAGE_VERSION */ + { 31158, 0x000080BF }, /* GL_SHADOW_AMBIENT_SGIX */ + { 31181, 0x000081FB }, /* GL_SHARED_TEXTURE_PALETTE_EXT */ + { 31211, 0x00001601 }, /* GL_SHININESS */ + { 31224, 0x00001402 }, /* GL_SHORT */ + { 31233, 0x00009119 }, /* GL_SIGNALED */ + { 31245, 0x00008F9C }, /* GL_SIGNED_NORMALIZED */ + { 31266, 0x000081F9 }, /* GL_SINGLE_COLOR */ + { 31282, 0x000081F9 }, /* GL_SINGLE_COLOR_EXT */ + { 31302, 0x000085CC }, /* GL_SLICE_ACCUM_SUN */ + { 31321, 0x00008C46 }, /* GL_SLUMINANCE */ + { 31335, 0x00008C47 }, /* GL_SLUMINANCE8 */ + { 31350, 0x00008C45 }, /* GL_SLUMINANCE8_ALPHA8 */ + { 31372, 0x00008C44 }, /* GL_SLUMINANCE_ALPHA */ + { 31392, 0x00001D01 }, /* GL_SMOOTH */ + { 31402, 0x00000B23 }, /* GL_SMOOTH_LINE_WIDTH_GRANULARITY */ + { 31435, 0x00000B22 }, /* GL_SMOOTH_LINE_WIDTH_RANGE */ + { 31462, 0x00000B13 }, /* GL_SMOOTH_POINT_SIZE_GRANULARITY */ + { 31495, 0x00000B12 }, /* GL_SMOOTH_POINT_SIZE_RANGE */ + { 31522, 0x00008588 }, /* GL_SOURCE0_ALPHA */ + { 31539, 0x00008588 }, /* GL_SOURCE0_ALPHA_ARB */ + { 31560, 0x00008588 }, /* GL_SOURCE0_ALPHA_EXT */ + { 31581, 0x00008580 }, /* GL_SOURCE0_RGB */ + { 31596, 0x00008580 }, /* GL_SOURCE0_RGB_ARB */ + { 31615, 0x00008580 }, /* GL_SOURCE0_RGB_EXT */ + { 31634, 0x00008589 }, /* GL_SOURCE1_ALPHA */ + { 31651, 0x00008589 }, /* GL_SOURCE1_ALPHA_ARB */ + { 31672, 0x00008589 }, /* GL_SOURCE1_ALPHA_EXT */ + { 31693, 0x00008581 }, /* GL_SOURCE1_RGB */ + { 31708, 0x00008581 }, /* GL_SOURCE1_RGB_ARB */ + { 31727, 0x00008581 }, /* GL_SOURCE1_RGB_EXT */ + { 31746, 0x0000858A }, /* GL_SOURCE2_ALPHA */ + { 31763, 0x0000858A }, /* GL_SOURCE2_ALPHA_ARB */ + { 31784, 0x0000858A }, /* GL_SOURCE2_ALPHA_EXT */ + { 31805, 0x00008582 }, /* GL_SOURCE2_RGB */ + { 31820, 0x00008582 }, /* GL_SOURCE2_RGB_ARB */ + { 31839, 0x00008582 }, /* GL_SOURCE2_RGB_EXT */ + { 31858, 0x0000858B }, /* GL_SOURCE3_ALPHA_NV */ + { 31878, 0x00008583 }, /* GL_SOURCE3_RGB_NV */ + { 31896, 0x00001202 }, /* GL_SPECULAR */ + { 31908, 0x00002402 }, /* GL_SPHERE_MAP */ + { 31922, 0x00001206 }, /* GL_SPOT_CUTOFF */ + { 31937, 0x00001204 }, /* GL_SPOT_DIRECTION */ + { 31955, 0x00001205 }, /* GL_SPOT_EXPONENT */ + { 31972, 0x00008588 }, /* GL_SRC0_ALPHA */ + { 31986, 0x00008580 }, /* GL_SRC0_RGB */ + { 31998, 0x00008589 }, /* GL_SRC1_ALPHA */ + { 32012, 0x00008581 }, /* GL_SRC1_RGB */ + { 32024, 0x0000858A }, /* GL_SRC2_ALPHA */ + { 32038, 0x00008582 }, /* GL_SRC2_RGB */ + { 32050, 0x00000302 }, /* GL_SRC_ALPHA */ + { 32063, 0x00000308 }, /* GL_SRC_ALPHA_SATURATE */ + { 32085, 0x00000300 }, /* GL_SRC_COLOR */ + { 32098, 0x00008C40 }, /* GL_SRGB */ + { 32106, 0x00008C41 }, /* GL_SRGB8 */ + { 32115, 0x00008C43 }, /* GL_SRGB8_ALPHA8 */ + { 32131, 0x00008C42 }, /* GL_SRGB_ALPHA */ + { 32145, 0x00000503 }, /* GL_STACK_OVERFLOW */ + { 32163, 0x00000504 }, /* GL_STACK_UNDERFLOW */ + { 32182, 0x000088E6 }, /* GL_STATIC_COPY */ + { 32197, 0x000088E6 }, /* GL_STATIC_COPY_ARB */ + { 32216, 0x000088E4 }, /* GL_STATIC_DRAW */ + { 32231, 0x000088E4 }, /* GL_STATIC_DRAW_ARB */ + { 32250, 0x000088E5 }, /* GL_STATIC_READ */ + { 32265, 0x000088E5 }, /* GL_STATIC_READ_ARB */ + { 32284, 0x00001802 }, /* GL_STENCIL */ + { 32295, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT */ + { 32317, 0x00008D20 }, /* GL_STENCIL_ATTACHMENT_EXT */ + { 32343, 0x00008801 }, /* GL_STENCIL_BACK_FAIL */ + { 32364, 0x00008801 }, /* GL_STENCIL_BACK_FAIL_ATI */ + { 32389, 0x00008800 }, /* GL_STENCIL_BACK_FUNC */ + { 32410, 0x00008800 }, /* GL_STENCIL_BACK_FUNC_ATI */ + { 32435, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ + { 32467, 0x00008802 }, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI */ + { 32503, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ + { 32535, 0x00008803 }, /* GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI */ + { 32571, 0x00008CA3 }, /* GL_STENCIL_BACK_REF */ + { 32591, 0x00008CA4 }, /* GL_STENCIL_BACK_VALUE_MASK */ + { 32618, 0x00008CA5 }, /* GL_STENCIL_BACK_WRITEMASK */ + { 32644, 0x00000D57 }, /* GL_STENCIL_BITS */ + { 32660, 0x00000400 }, /* GL_STENCIL_BUFFER_BIT */ + { 32682, 0x00000B91 }, /* GL_STENCIL_CLEAR_VALUE */ + { 32705, 0x00000B94 }, /* GL_STENCIL_FAIL */ + { 32721, 0x00000B92 }, /* GL_STENCIL_FUNC */ + { 32737, 0x00001901 }, /* GL_STENCIL_INDEX */ + { 32754, 0x00008D46 }, /* GL_STENCIL_INDEX1 */ + { 32772, 0x00008D49 }, /* GL_STENCIL_INDEX16 */ + { 32791, 0x00008D49 }, /* GL_STENCIL_INDEX16_EXT */ + { 32814, 0x00008D46 }, /* GL_STENCIL_INDEX1_EXT */ + { 32836, 0x00008D47 }, /* GL_STENCIL_INDEX4 */ + { 32854, 0x00008D47 }, /* GL_STENCIL_INDEX4_EXT */ + { 32876, 0x00008D48 }, /* GL_STENCIL_INDEX8 */ + { 32894, 0x00008D48 }, /* GL_STENCIL_INDEX8_EXT */ + { 32916, 0x00008D45 }, /* GL_STENCIL_INDEX_EXT */ + { 32937, 0x00000B95 }, /* GL_STENCIL_PASS_DEPTH_FAIL */ + { 32964, 0x00000B96 }, /* GL_STENCIL_PASS_DEPTH_PASS */ + { 32991, 0x00000B97 }, /* GL_STENCIL_REF */ + { 33006, 0x00000B90 }, /* GL_STENCIL_TEST */ + { 33022, 0x00008910 }, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ + { 33051, 0x00000B93 }, /* GL_STENCIL_VALUE_MASK */ + { 33073, 0x00000B98 }, /* GL_STENCIL_WRITEMASK */ + { 33094, 0x00000C33 }, /* GL_STEREO */ + { 33104, 0x000085BE }, /* GL_STORAGE_CACHED_APPLE */ + { 33128, 0x000085BD }, /* GL_STORAGE_PRIVATE_APPLE */ + { 33153, 0x000085BF }, /* GL_STORAGE_SHARED_APPLE */ + { 33177, 0x000088E2 }, /* GL_STREAM_COPY */ + { 33192, 0x000088E2 }, /* GL_STREAM_COPY_ARB */ + { 33211, 0x000088E0 }, /* GL_STREAM_DRAW */ + { 33226, 0x000088E0 }, /* GL_STREAM_DRAW_ARB */ + { 33245, 0x000088E1 }, /* GL_STREAM_READ */ + { 33260, 0x000088E1 }, /* GL_STREAM_READ_ARB */ + { 33279, 0x00000D50 }, /* GL_SUBPIXEL_BITS */ + { 33296, 0x000084E7 }, /* GL_SUBTRACT */ + { 33308, 0x000084E7 }, /* GL_SUBTRACT_ARB */ + { 33324, 0x00009113 }, /* GL_SYNC_CONDITION */ + { 33342, 0x00009116 }, /* GL_SYNC_FENCE */ + { 33356, 0x00009115 }, /* GL_SYNC_FLAGS */ + { 33370, 0x00000001 }, /* GL_SYNC_FLUSH_COMMANDS_BIT */ + { 33397, 0x00009117 }, /* GL_SYNC_GPU_COMMANDS_COMPLETE */ + { 33427, 0x00009114 }, /* GL_SYNC_STATUS */ + { 33442, 0x00002001 }, /* GL_T */ + { 33447, 0x00002A2A }, /* GL_T2F_C3F_V3F */ + { 33462, 0x00002A2C }, /* GL_T2F_C4F_N3F_V3F */ + { 33481, 0x00002A29 }, /* GL_T2F_C4UB_V3F */ + { 33497, 0x00002A2B }, /* GL_T2F_N3F_V3F */ + { 33512, 0x00002A27 }, /* GL_T2F_V3F */ + { 33523, 0x00002A2D }, /* GL_T4F_C4F_N3F_V4F */ + { 33542, 0x00002A28 }, /* GL_T4F_V4F */ + { 33553, 0x00008031 }, /* GL_TABLE_TOO_LARGE_EXT */ + { 33576, 0x00001702 }, /* GL_TEXTURE */ + { 33587, 0x000084C0 }, /* GL_TEXTURE0 */ + { 33599, 0x000084C0 }, /* GL_TEXTURE0_ARB */ + { 33615, 0x000084C1 }, /* GL_TEXTURE1 */ + { 33627, 0x000084CA }, /* GL_TEXTURE10 */ + { 33640, 0x000084CA }, /* GL_TEXTURE10_ARB */ + { 33657, 0x000084CB }, /* GL_TEXTURE11 */ + { 33670, 0x000084CB }, /* GL_TEXTURE11_ARB */ + { 33687, 0x000084CC }, /* GL_TEXTURE12 */ + { 33700, 0x000084CC }, /* GL_TEXTURE12_ARB */ + { 33717, 0x000084CD }, /* GL_TEXTURE13 */ + { 33730, 0x000084CD }, /* GL_TEXTURE13_ARB */ + { 33747, 0x000084CE }, /* GL_TEXTURE14 */ + { 33760, 0x000084CE }, /* GL_TEXTURE14_ARB */ + { 33777, 0x000084CF }, /* GL_TEXTURE15 */ + { 33790, 0x000084CF }, /* GL_TEXTURE15_ARB */ + { 33807, 0x000084D0 }, /* GL_TEXTURE16 */ + { 33820, 0x000084D0 }, /* GL_TEXTURE16_ARB */ + { 33837, 0x000084D1 }, /* GL_TEXTURE17 */ + { 33850, 0x000084D1 }, /* GL_TEXTURE17_ARB */ + { 33867, 0x000084D2 }, /* GL_TEXTURE18 */ + { 33880, 0x000084D2 }, /* GL_TEXTURE18_ARB */ + { 33897, 0x000084D3 }, /* GL_TEXTURE19 */ + { 33910, 0x000084D3 }, /* GL_TEXTURE19_ARB */ + { 33927, 0x000084C1 }, /* GL_TEXTURE1_ARB */ + { 33943, 0x000084C2 }, /* GL_TEXTURE2 */ + { 33955, 0x000084D4 }, /* GL_TEXTURE20 */ + { 33968, 0x000084D4 }, /* GL_TEXTURE20_ARB */ + { 33985, 0x000084D5 }, /* GL_TEXTURE21 */ + { 33998, 0x000084D5 }, /* GL_TEXTURE21_ARB */ + { 34015, 0x000084D6 }, /* GL_TEXTURE22 */ + { 34028, 0x000084D6 }, /* GL_TEXTURE22_ARB */ + { 34045, 0x000084D7 }, /* GL_TEXTURE23 */ + { 34058, 0x000084D7 }, /* GL_TEXTURE23_ARB */ + { 34075, 0x000084D8 }, /* GL_TEXTURE24 */ + { 34088, 0x000084D8 }, /* GL_TEXTURE24_ARB */ + { 34105, 0x000084D9 }, /* GL_TEXTURE25 */ + { 34118, 0x000084D9 }, /* GL_TEXTURE25_ARB */ + { 34135, 0x000084DA }, /* GL_TEXTURE26 */ + { 34148, 0x000084DA }, /* GL_TEXTURE26_ARB */ + { 34165, 0x000084DB }, /* GL_TEXTURE27 */ + { 34178, 0x000084DB }, /* GL_TEXTURE27_ARB */ + { 34195, 0x000084DC }, /* GL_TEXTURE28 */ + { 34208, 0x000084DC }, /* GL_TEXTURE28_ARB */ + { 34225, 0x000084DD }, /* GL_TEXTURE29 */ + { 34238, 0x000084DD }, /* GL_TEXTURE29_ARB */ + { 34255, 0x000084C2 }, /* GL_TEXTURE2_ARB */ + { 34271, 0x000084C3 }, /* GL_TEXTURE3 */ + { 34283, 0x000084DE }, /* GL_TEXTURE30 */ + { 34296, 0x000084DE }, /* GL_TEXTURE30_ARB */ + { 34313, 0x000084DF }, /* GL_TEXTURE31 */ + { 34326, 0x000084DF }, /* GL_TEXTURE31_ARB */ + { 34343, 0x000084C3 }, /* GL_TEXTURE3_ARB */ + { 34359, 0x000084C4 }, /* GL_TEXTURE4 */ + { 34371, 0x000084C4 }, /* GL_TEXTURE4_ARB */ + { 34387, 0x000084C5 }, /* GL_TEXTURE5 */ + { 34399, 0x000084C5 }, /* GL_TEXTURE5_ARB */ + { 34415, 0x000084C6 }, /* GL_TEXTURE6 */ + { 34427, 0x000084C6 }, /* GL_TEXTURE6_ARB */ + { 34443, 0x000084C7 }, /* GL_TEXTURE7 */ + { 34455, 0x000084C7 }, /* GL_TEXTURE7_ARB */ + { 34471, 0x000084C8 }, /* GL_TEXTURE8 */ + { 34483, 0x000084C8 }, /* GL_TEXTURE8_ARB */ + { 34499, 0x000084C9 }, /* GL_TEXTURE9 */ + { 34511, 0x000084C9 }, /* GL_TEXTURE9_ARB */ + { 34527, 0x00000DE0 }, /* GL_TEXTURE_1D */ + { 34541, 0x00008C18 }, /* GL_TEXTURE_1D_ARRAY_EXT */ + { 34565, 0x00000DE1 }, /* GL_TEXTURE_2D */ + { 34579, 0x00008C1A }, /* GL_TEXTURE_2D_ARRAY_EXT */ + { 34603, 0x0000806F }, /* GL_TEXTURE_3D */ + { 34617, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE */ + { 34639, 0x0000805F }, /* GL_TEXTURE_ALPHA_SIZE_EXT */ + { 34665, 0x0000813C }, /* GL_TEXTURE_BASE_LEVEL */ + { 34687, 0x00008068 }, /* GL_TEXTURE_BINDING_1D */ + { 34709, 0x00008C1C }, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ + { 34741, 0x00008069 }, /* GL_TEXTURE_BINDING_2D */ + { 34763, 0x00008C1D }, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ + { 34795, 0x0000806A }, /* GL_TEXTURE_BINDING_3D */ + { 34817, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP */ + { 34845, 0x00008514 }, /* GL_TEXTURE_BINDING_CUBE_MAP_ARB */ + { 34877, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ + { 34910, 0x000084F6 }, /* GL_TEXTURE_BINDING_RECTANGLE_NV */ + { 34942, 0x00040000 }, /* GL_TEXTURE_BIT */ + { 34957, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE */ + { 34978, 0x0000805E }, /* GL_TEXTURE_BLUE_SIZE_EXT */ + { 35003, 0x00001005 }, /* GL_TEXTURE_BORDER */ + { 35021, 0x00001004 }, /* GL_TEXTURE_BORDER_COLOR */ + { 35045, 0x00008171 }, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ + { 35076, 0x00008176 }, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ + { 35106, 0x00008172 }, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ + { 35136, 0x00008175 }, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ + { 35171, 0x00008173 }, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ + { 35202, 0x00008174 }, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + { 35240, 0x000080BC }, /* GL_TEXTURE_COLOR_TABLE_SGI */ + { 35267, 0x000081EF }, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ + { 35299, 0x000080BF }, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + { 35333, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC */ + { 35357, 0x0000884D }, /* GL_TEXTURE_COMPARE_FUNC_ARB */ + { 35385, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE */ + { 35409, 0x0000884C }, /* GL_TEXTURE_COMPARE_MODE_ARB */ + { 35437, 0x0000819B }, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ + { 35470, 0x0000819A }, /* GL_TEXTURE_COMPARE_SGIX */ + { 35494, 0x00001003 }, /* GL_TEXTURE_COMPONENTS */ + { 35516, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED */ + { 35538, 0x000086A1 }, /* GL_TEXTURE_COMPRESSED_ARB */ + { 35564, 0x000086A3 }, /* GL_TEXTURE_COMPRESSED_FORMATS_ARB */ + { 35598, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ + { 35631, 0x000086A0 }, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB */ + { 35668, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT */ + { 35696, 0x000084EF }, /* GL_TEXTURE_COMPRESSION_HINT_ARB */ + { 35728, 0x00008078 }, /* GL_TEXTURE_COORD_ARRAY */ + { 35751, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ + { 35789, 0x0000889A }, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB */ + { 35831, 0x00008092 }, /* GL_TEXTURE_COORD_ARRAY_POINTER */ + { 35862, 0x00008088 }, /* GL_TEXTURE_COORD_ARRAY_SIZE */ + { 35890, 0x0000808A }, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ + { 35920, 0x00008089 }, /* GL_TEXTURE_COORD_ARRAY_TYPE */ + { 35948, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP */ + { 35968, 0x00008513 }, /* GL_TEXTURE_CUBE_MAP_ARB */ + { 35992, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ + { 36023, 0x00008516 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB */ + { 36058, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ + { 36089, 0x00008518 }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB */ + { 36124, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ + { 36155, 0x0000851A }, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB */ + { 36190, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ + { 36221, 0x00008515 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB */ + { 36256, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ + { 36287, 0x00008517 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB */ + { 36322, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ + { 36353, 0x00008519 }, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB */ + { 36388, 0x000088F4 }, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */ + { 36417, 0x00008071 }, /* GL_TEXTURE_DEPTH */ + { 36434, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE */ + { 36456, 0x0000884A }, /* GL_TEXTURE_DEPTH_SIZE_ARB */ + { 36482, 0x00002300 }, /* GL_TEXTURE_ENV */ + { 36497, 0x00002201 }, /* GL_TEXTURE_ENV_COLOR */ + { 36518, 0x00002200 }, /* GL_TEXTURE_ENV_MODE */ + { 36538, 0x00008500 }, /* GL_TEXTURE_FILTER_CONTROL */ + { 36564, 0x00002500 }, /* GL_TEXTURE_GEN_MODE */ + { 36584, 0x00000C63 }, /* GL_TEXTURE_GEN_Q */ + { 36601, 0x00000C62 }, /* GL_TEXTURE_GEN_R */ + { 36618, 0x00000C60 }, /* GL_TEXTURE_GEN_S */ + { 36635, 0x00000C61 }, /* GL_TEXTURE_GEN_T */ + { 36652, 0x0000819D }, /* GL_TEXTURE_GEQUAL_R_SGIX */ + { 36677, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE */ + { 36699, 0x0000805D }, /* GL_TEXTURE_GREEN_SIZE_EXT */ + { 36725, 0x00001001 }, /* GL_TEXTURE_HEIGHT */ + { 36743, 0x000080ED }, /* GL_TEXTURE_INDEX_SIZE_EXT */ + { 36769, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE */ + { 36795, 0x00008061 }, /* GL_TEXTURE_INTENSITY_SIZE_EXT */ + { 36825, 0x00001003 }, /* GL_TEXTURE_INTERNAL_FORMAT */ + { 36852, 0x0000819C }, /* GL_TEXTURE_LEQUAL_R_SGIX */ + { 36877, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS */ + { 36897, 0x00008501 }, /* GL_TEXTURE_LOD_BIAS_EXT */ + { 36921, 0x00008190 }, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ + { 36948, 0x0000818E }, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ + { 36975, 0x0000818F }, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ + { 37002, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE */ + { 37028, 0x00008060 }, /* GL_TEXTURE_LUMINANCE_SIZE_EXT */ + { 37058, 0x00002800 }, /* GL_TEXTURE_MAG_FILTER */ + { 37080, 0x00000BA8 }, /* GL_TEXTURE_MATRIX */ + { 37098, 0x000084FE }, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ + { 37128, 0x0000836B }, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ + { 37156, 0x00008369 }, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ + { 37184, 0x0000836A }, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ + { 37212, 0x0000813D }, /* GL_TEXTURE_MAX_LEVEL */ + { 37233, 0x0000813B }, /* GL_TEXTURE_MAX_LOD */ + { 37252, 0x00002801 }, /* GL_TEXTURE_MIN_FILTER */ + { 37274, 0x0000813A }, /* GL_TEXTURE_MIN_LOD */ + { 37293, 0x00008066 }, /* GL_TEXTURE_PRIORITY */ + { 37313, 0x000085B7 }, /* GL_TEXTURE_RANGE_LENGTH_APPLE */ + { 37343, 0x000085B8 }, /* GL_TEXTURE_RANGE_POINTER_APPLE */ + { 37374, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_ARB */ + { 37399, 0x000084F5 }, /* GL_TEXTURE_RECTANGLE_NV */ + { 37423, 0x0000805C }, /* GL_TEXTURE_RED_SIZE */ + { 37443, 0x0000805C }, /* GL_TEXTURE_RED_SIZE_EXT */ + { 37467, 0x00008067 }, /* GL_TEXTURE_RESIDENT */ + { 37487, 0x00000BA5 }, /* GL_TEXTURE_STACK_DEPTH */ + { 37510, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE */ + { 37534, 0x000088F1 }, /* GL_TEXTURE_STENCIL_SIZE_EXT */ + { 37562, 0x000085BC }, /* GL_TEXTURE_STORAGE_HINT_APPLE */ + { 37592, 0x00008065 }, /* GL_TEXTURE_TOO_LARGE_EXT */ + { 37617, 0x0000888F }, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ + { 37651, 0x00001000 }, /* GL_TEXTURE_WIDTH */ + { 37668, 0x00008072 }, /* GL_TEXTURE_WRAP_R */ + { 37686, 0x00002802 }, /* GL_TEXTURE_WRAP_S */ + { 37704, 0x00002803 }, /* GL_TEXTURE_WRAP_T */ + { 37722, 0x0000911B }, /* GL_TIMEOUT_EXPIRED */ + { 37741, 0xFFFFFFFFFFFFFFFF }, /* GL_TIMEOUT_IGNORED */ + { 37760, 0x000088BF }, /* GL_TIME_ELAPSED_EXT */ + { 37780, 0x00008648 }, /* GL_TRACK_MATRIX_NV */ + { 37799, 0x00008649 }, /* GL_TRACK_MATRIX_TRANSFORM_NV */ + { 37828, 0x00001000 }, /* GL_TRANSFORM_BIT */ + { 37845, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX */ + { 37871, 0x000084E6 }, /* GL_TRANSPOSE_COLOR_MATRIX_ARB */ + { 37901, 0x000088B7 }, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ + { 37933, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ + { 37963, 0x000084E3 }, /* GL_TRANSPOSE_MODELVIEW_MATRIX_ARB */ + { 37997, 0x0000862C }, /* GL_TRANSPOSE_NV */ + { 38013, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX */ + { 38044, 0x000084E4 }, /* GL_TRANSPOSE_PROJECTION_MATRIX_ARB */ + { 38079, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX */ + { 38107, 0x000084E5 }, /* GL_TRANSPOSE_TEXTURE_MATRIX_ARB */ + { 38139, 0x00000004 }, /* GL_TRIANGLES */ + { 38152, 0x00000006 }, /* GL_TRIANGLE_FAN */ + { 38168, 0x00008615 }, /* GL_TRIANGLE_MESH_SUN */ + { 38189, 0x00000005 }, /* GL_TRIANGLE_STRIP */ + { 38207, 0x00000001 }, /* GL_TRUE */ + { 38215, 0x00000CF5 }, /* GL_UNPACK_ALIGNMENT */ + { 38235, 0x0000806E }, /* GL_UNPACK_IMAGE_HEIGHT */ + { 38258, 0x00000CF1 }, /* GL_UNPACK_LSB_FIRST */ + { 38278, 0x00000CF2 }, /* GL_UNPACK_ROW_LENGTH */ + { 38299, 0x0000806D }, /* GL_UNPACK_SKIP_IMAGES */ + { 38321, 0x00000CF4 }, /* GL_UNPACK_SKIP_PIXELS */ + { 38343, 0x00000CF3 }, /* GL_UNPACK_SKIP_ROWS */ + { 38363, 0x00000CF0 }, /* GL_UNPACK_SWAP_BYTES */ + { 38384, 0x00009118 }, /* GL_UNSIGNALED */ + { 38398, 0x00001401 }, /* GL_UNSIGNED_BYTE */ + { 38415, 0x00008362 }, /* GL_UNSIGNED_BYTE_2_3_3_REV */ + { 38442, 0x00008032 }, /* GL_UNSIGNED_BYTE_3_3_2 */ + { 38465, 0x00001405 }, /* GL_UNSIGNED_INT */ + { 38481, 0x00008036 }, /* GL_UNSIGNED_INT_10_10_10_2 */ + { 38508, 0x000084FA }, /* GL_UNSIGNED_INT_24_8 */ + { 38529, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_EXT */ + { 38554, 0x000084FA }, /* GL_UNSIGNED_INT_24_8_NV */ + { 38578, 0x00008368 }, /* GL_UNSIGNED_INT_2_10_10_10_REV */ + { 38609, 0x00008035 }, /* GL_UNSIGNED_INT_8_8_8_8 */ + { 38633, 0x00008367 }, /* GL_UNSIGNED_INT_8_8_8_8_REV */ + { 38661, 0x00008C17 }, /* GL_UNSIGNED_NORMALIZED */ + { 38684, 0x00001403 }, /* GL_UNSIGNED_SHORT */ + { 38702, 0x00008366 }, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ + { 38732, 0x00008033 }, /* GL_UNSIGNED_SHORT_4_4_4_4 */ + { 38758, 0x00008365 }, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ + { 38788, 0x00008034 }, /* GL_UNSIGNED_SHORT_5_5_5_1 */ + { 38814, 0x00008363 }, /* GL_UNSIGNED_SHORT_5_6_5 */ + { 38838, 0x00008364 }, /* GL_UNSIGNED_SHORT_5_6_5_REV */ + { 38866, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_APPLE */ + { 38894, 0x000085BA }, /* GL_UNSIGNED_SHORT_8_8_MESA */ + { 38921, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ + { 38953, 0x000085BB }, /* GL_UNSIGNED_SHORT_8_8_REV_MESA */ + { 38984, 0x00008CA2 }, /* GL_UPPER_LEFT */ + { 38998, 0x00002A20 }, /* GL_V2F */ + { 39005, 0x00002A21 }, /* GL_V3F */ + { 39012, 0x00008B83 }, /* GL_VALIDATE_STATUS */ + { 39031, 0x00001F00 }, /* GL_VENDOR */ + { 39041, 0x00001F02 }, /* GL_VERSION */ + { 39052, 0x00008074 }, /* GL_VERTEX_ARRAY */ + { 39068, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING */ + { 39092, 0x000085B5 }, /* GL_VERTEX_ARRAY_BINDING_APPLE */ + { 39122, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ + { 39153, 0x00008896 }, /* GL_VERTEX_ARRAY_BUFFER_BINDING_ARB */ + { 39188, 0x0000808E }, /* GL_VERTEX_ARRAY_POINTER */ + { 39212, 0x0000807A }, /* GL_VERTEX_ARRAY_SIZE */ + { 39233, 0x0000807C }, /* GL_VERTEX_ARRAY_STRIDE */ + { 39256, 0x0000807B }, /* GL_VERTEX_ARRAY_TYPE */ + { 39277, 0x00008650 }, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ + { 39304, 0x0000865A }, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ + { 39332, 0x0000865B }, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ + { 39360, 0x0000865C }, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ + { 39388, 0x0000865D }, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ + { 39416, 0x0000865E }, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ + { 39444, 0x0000865F }, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ + { 39472, 0x00008651 }, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ + { 39499, 0x00008652 }, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ + { 39526, 0x00008653 }, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ + { 39553, 0x00008654 }, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ + { 39580, 0x00008655 }, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ + { 39607, 0x00008656 }, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ + { 39634, 0x00008657 }, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ + { 39661, 0x00008658 }, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ + { 39688, 0x00008659 }, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ + { 39715, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ + { 39753, 0x0000889F }, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB */ + { 39795, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ + { 39826, 0x00008622 }, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB */ + { 39861, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ + { 39895, 0x0000886A }, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB */ + { 39933, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ + { 39964, 0x00008645 }, /* GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB */ + { 39999, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ + { 40027, 0x00008623 }, /* GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB */ + { 40059, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ + { 40089, 0x00008624 }, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB */ + { 40123, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ + { 40151, 0x00008625 }, /* GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB */ + { 40183, 0x000086A7 }, /* GL_VERTEX_BLEND_ARB */ + { 40203, 0x00008620 }, /* GL_VERTEX_PROGRAM_ARB */ + { 40225, 0x0000864A }, /* GL_VERTEX_PROGRAM_BINDING_NV */ + { 40254, 0x00008620 }, /* GL_VERTEX_PROGRAM_NV */ + { 40275, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE */ + { 40304, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_ARB */ + { 40337, 0x00008642 }, /* GL_VERTEX_PROGRAM_POINT_SIZE_NV */ + { 40369, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE */ + { 40396, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_ARB */ + { 40427, 0x00008643 }, /* GL_VERTEX_PROGRAM_TWO_SIDE_NV */ + { 40457, 0x00008B31 }, /* GL_VERTEX_SHADER */ + { 40474, 0x00008B31 }, /* GL_VERTEX_SHADER_ARB */ + { 40495, 0x00008621 }, /* GL_VERTEX_STATE_PROGRAM_NV */ + { 40522, 0x00000BA2 }, /* GL_VIEWPORT */ + { 40534, 0x00000800 }, /* GL_VIEWPORT_BIT */ + { 40550, 0x0000911D }, /* GL_WAIT_FAILED */ + { 40565, 0x000086AD }, /* GL_WEIGHT_ARRAY_ARB */ + { 40585, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ + { 40616, 0x0000889E }, /* GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB */ + { 40651, 0x000086AC }, /* GL_WEIGHT_ARRAY_POINTER_ARB */ + { 40679, 0x000086AB }, /* GL_WEIGHT_ARRAY_SIZE_ARB */ + { 40704, 0x000086AA }, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ + { 40731, 0x000086A9 }, /* GL_WEIGHT_ARRAY_TYPE_ARB */ + { 40756, 0x000086A6 }, /* GL_WEIGHT_SUM_UNITY_ARB */ + { 40780, 0x000081D4 }, /* GL_WRAP_BORDER_SUN */ + { 40799, 0x000088B9 }, /* GL_WRITE_ONLY */ + { 40813, 0x000088B9 }, /* GL_WRITE_ONLY_ARB */ + { 40831, 0x00001506 }, /* GL_XOR */ + { 40838, 0x000085B9 }, /* GL_YCBCR_422_APPLE */ + { 40857, 0x00008757 }, /* GL_YCBCR_MESA */ + { 40871, 0x00000000 }, /* GL_ZERO */ + { 40879, 0x00000D16 }, /* GL_ZOOM_X */ + { 40889, 0x00000D17 }, /* GL_ZOOM_Y */ }; static const unsigned reduced_enums[1347] = { - 476, /* GL_FALSE */ - 694, /* GL_LINES */ - 696, /* GL_LINE_LOOP */ - 703, /* GL_LINE_STRIP */ - 1748, /* GL_TRIANGLES */ - 1751, /* GL_TRIANGLE_STRIP */ - 1749, /* GL_TRIANGLE_FAN */ - 1275, /* GL_QUADS */ - 1279, /* GL_QUAD_STRIP */ - 1161, /* GL_POLYGON */ - 1173, /* GL_POLYGON_STIPPLE_BIT */ - 1122, /* GL_PIXEL_MODE_BIT */ - 681, /* GL_LIGHTING_BIT */ - 506, /* GL_FOG_BIT */ + 479, /* GL_FALSE */ + 701, /* GL_LINES */ + 703, /* GL_LINE_LOOP */ + 710, /* GL_LINE_STRIP */ + 1766, /* GL_TRIANGLES */ + 1769, /* GL_TRIANGLE_STRIP */ + 1767, /* GL_TRIANGLE_FAN */ + 1285, /* GL_QUADS */ + 1289, /* GL_QUAD_STRIP */ + 1171, /* GL_POLYGON */ + 1183, /* GL_POLYGON_STIPPLE_BIT */ + 1132, /* GL_PIXEL_MODE_BIT */ + 688, /* GL_LIGHTING_BIT */ + 509, /* GL_FOG_BIT */ 8, /* GL_ACCUM */ - 713, /* GL_LOAD */ - 1331, /* GL_RETURN */ - 994, /* GL_MULT */ + 720, /* GL_LOAD */ + 1344, /* GL_RETURN */ + 1004, /* GL_MULT */ 23, /* GL_ADD */ - 1010, /* GL_NEVER */ - 671, /* GL_LESS */ - 466, /* GL_EQUAL */ - 670, /* GL_LEQUAL */ - 592, /* GL_GREATER */ - 1025, /* GL_NOTEQUAL */ - 591, /* GL_GEQUAL */ + 1020, /* GL_NEVER */ + 678, /* GL_LESS */ + 469, /* GL_EQUAL */ + 677, /* GL_LEQUAL */ + 599, /* GL_GREATER */ + 1035, /* GL_NOTEQUAL */ + 598, /* GL_GEQUAL */ 47, /* GL_ALWAYS */ - 1472, /* GL_SRC_COLOR */ - 1055, /* GL_ONE_MINUS_SRC_COLOR */ - 1470, /* GL_SRC_ALPHA */ - 1054, /* GL_ONE_MINUS_SRC_ALPHA */ - 445, /* GL_DST_ALPHA */ - 1052, /* GL_ONE_MINUS_DST_ALPHA */ - 446, /* GL_DST_COLOR */ - 1053, /* GL_ONE_MINUS_DST_COLOR */ - 1471, /* GL_SRC_ALPHA_SATURATE */ - 579, /* GL_FRONT_LEFT */ - 580, /* GL_FRONT_RIGHT */ + 1485, /* GL_SRC_COLOR */ + 1065, /* GL_ONE_MINUS_SRC_COLOR */ + 1483, /* GL_SRC_ALPHA */ + 1064, /* GL_ONE_MINUS_SRC_ALPHA */ + 448, /* GL_DST_ALPHA */ + 1062, /* GL_ONE_MINUS_DST_ALPHA */ + 449, /* GL_DST_COLOR */ + 1063, /* GL_ONE_MINUS_DST_COLOR */ + 1484, /* GL_SRC_ALPHA_SATURATE */ + 586, /* GL_FRONT_LEFT */ + 587, /* GL_FRONT_RIGHT */ 69, /* GL_BACK_LEFT */ 70, /* GL_BACK_RIGHT */ - 576, /* GL_FRONT */ + 583, /* GL_FRONT */ 68, /* GL_BACK */ - 669, /* GL_LEFT */ - 1373, /* GL_RIGHT */ - 577, /* GL_FRONT_AND_BACK */ + 676, /* GL_LEFT */ + 1386, /* GL_RIGHT */ + 584, /* GL_FRONT_AND_BACK */ 63, /* GL_AUX0 */ 64, /* GL_AUX1 */ 65, /* GL_AUX2 */ 66, /* GL_AUX3 */ - 658, /* GL_INVALID_ENUM */ - 662, /* GL_INVALID_VALUE */ - 661, /* GL_INVALID_OPERATION */ - 1477, /* GL_STACK_OVERFLOW */ - 1478, /* GL_STACK_UNDERFLOW */ - 1080, /* GL_OUT_OF_MEMORY */ - 659, /* GL_INVALID_FRAMEBUFFER_OPERATION */ + 665, /* GL_INVALID_ENUM */ + 669, /* GL_INVALID_VALUE */ + 668, /* GL_INVALID_OPERATION */ + 1490, /* GL_STACK_OVERFLOW */ + 1491, /* GL_STACK_UNDERFLOW */ + 1090, /* GL_OUT_OF_MEMORY */ + 666, /* GL_INVALID_FRAMEBUFFER_OPERATION */ 0, /* GL_2D */ 2, /* GL_3D */ 3, /* GL_3D_COLOR */ 4, /* GL_3D_COLOR_TEXTURE */ 6, /* GL_4D_COLOR_TEXTURE */ - 1100, /* GL_PASS_THROUGH_TOKEN */ - 1160, /* GL_POINT_TOKEN */ - 704, /* GL_LINE_TOKEN */ - 1174, /* GL_POLYGON_TOKEN */ + 1110, /* GL_PASS_THROUGH_TOKEN */ + 1170, /* GL_POINT_TOKEN */ + 711, /* GL_LINE_TOKEN */ + 1184, /* GL_POLYGON_TOKEN */ 74, /* GL_BITMAP_TOKEN */ - 444, /* GL_DRAW_PIXEL_TOKEN */ + 447, /* GL_DRAW_PIXEL_TOKEN */ 301, /* GL_COPY_PIXEL_TOKEN */ - 697, /* GL_LINE_RESET_TOKEN */ - 469, /* GL_EXP */ - 470, /* GL_EXP2 */ + 704, /* GL_LINE_RESET_TOKEN */ + 472, /* GL_EXP */ + 473, /* GL_EXP2 */ 337, /* GL_CW */ 125, /* GL_CCW */ 146, /* GL_COEFF */ - 1077, /* GL_ORDER */ - 382, /* GL_DOMAIN */ + 1087, /* GL_ORDER */ + 384, /* GL_DOMAIN */ 311, /* GL_CURRENT_COLOR */ 314, /* GL_CURRENT_INDEX */ 320, /* GL_CURRENT_NORMAL */ @@ -3854,519 +3892,519 @@ static const unsigned reduced_enums[1347] = 328, /* GL_CURRENT_RASTER_POSITION */ 329, /* GL_CURRENT_RASTER_POSITION_VALID */ 326, /* GL_CURRENT_RASTER_DISTANCE */ - 1153, /* GL_POINT_SMOOTH */ - 1142, /* GL_POINT_SIZE */ - 1152, /* GL_POINT_SIZE_RANGE */ - 1143, /* GL_POINT_SIZE_GRANULARITY */ - 698, /* GL_LINE_SMOOTH */ - 705, /* GL_LINE_WIDTH */ - 707, /* GL_LINE_WIDTH_RANGE */ - 706, /* GL_LINE_WIDTH_GRANULARITY */ - 700, /* GL_LINE_STIPPLE */ - 701, /* GL_LINE_STIPPLE_PATTERN */ - 702, /* GL_LINE_STIPPLE_REPEAT */ - 712, /* GL_LIST_MODE */ - 877, /* GL_MAX_LIST_NESTING */ - 709, /* GL_LIST_BASE */ - 711, /* GL_LIST_INDEX */ - 1163, /* GL_POLYGON_MODE */ - 1170, /* GL_POLYGON_SMOOTH */ - 1172, /* GL_POLYGON_STIPPLE */ - 455, /* GL_EDGE_FLAG */ + 1163, /* GL_POINT_SMOOTH */ + 1152, /* GL_POINT_SIZE */ + 1162, /* GL_POINT_SIZE_RANGE */ + 1153, /* GL_POINT_SIZE_GRANULARITY */ + 705, /* GL_LINE_SMOOTH */ + 712, /* GL_LINE_WIDTH */ + 714, /* GL_LINE_WIDTH_RANGE */ + 713, /* GL_LINE_WIDTH_GRANULARITY */ + 707, /* GL_LINE_STIPPLE */ + 708, /* GL_LINE_STIPPLE_PATTERN */ + 709, /* GL_LINE_STIPPLE_REPEAT */ + 719, /* GL_LIST_MODE */ + 885, /* GL_MAX_LIST_NESTING */ + 716, /* GL_LIST_BASE */ + 718, /* GL_LIST_INDEX */ + 1173, /* GL_POLYGON_MODE */ + 1180, /* GL_POLYGON_SMOOTH */ + 1182, /* GL_POLYGON_STIPPLE */ + 458, /* GL_EDGE_FLAG */ 304, /* GL_CULL_FACE */ 305, /* GL_CULL_FACE_MODE */ - 578, /* GL_FRONT_FACE */ - 680, /* GL_LIGHTING */ - 685, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ - 686, /* GL_LIGHT_MODEL_TWO_SIDE */ - 682, /* GL_LIGHT_MODEL_AMBIENT */ - 1419, /* GL_SHADE_MODEL */ + 585, /* GL_FRONT_FACE */ + 687, /* GL_LIGHTING */ + 692, /* GL_LIGHT_MODEL_LOCAL_VIEWER */ + 693, /* GL_LIGHT_MODEL_TWO_SIDE */ + 689, /* GL_LIGHT_MODEL_AMBIENT */ + 1432, /* GL_SHADE_MODEL */ 193, /* GL_COLOR_MATERIAL_FACE */ 194, /* GL_COLOR_MATERIAL_PARAMETER */ 192, /* GL_COLOR_MATERIAL */ - 505, /* GL_FOG */ - 527, /* GL_FOG_INDEX */ - 523, /* GL_FOG_DENSITY */ - 531, /* GL_FOG_START */ - 525, /* GL_FOG_END */ - 528, /* GL_FOG_MODE */ - 507, /* GL_FOG_COLOR */ - 369, /* GL_DEPTH_RANGE */ - 376, /* GL_DEPTH_TEST */ - 379, /* GL_DEPTH_WRITEMASK */ - 357, /* GL_DEPTH_CLEAR_VALUE */ - 368, /* GL_DEPTH_FUNC */ + 508, /* GL_FOG */ + 530, /* GL_FOG_INDEX */ + 526, /* GL_FOG_DENSITY */ + 534, /* GL_FOG_START */ + 528, /* GL_FOG_END */ + 531, /* GL_FOG_MODE */ + 510, /* GL_FOG_COLOR */ + 370, /* GL_DEPTH_RANGE */ + 378, /* GL_DEPTH_TEST */ + 381, /* GL_DEPTH_WRITEMASK */ + 358, /* GL_DEPTH_CLEAR_VALUE */ + 369, /* GL_DEPTH_FUNC */ 12, /* GL_ACCUM_CLEAR_VALUE */ - 1513, /* GL_STENCIL_TEST */ - 1501, /* GL_STENCIL_CLEAR_VALUE */ - 1503, /* GL_STENCIL_FUNC */ - 1515, /* GL_STENCIL_VALUE_MASK */ - 1502, /* GL_STENCIL_FAIL */ - 1510, /* GL_STENCIL_PASS_DEPTH_FAIL */ - 1511, /* GL_STENCIL_PASS_DEPTH_PASS */ - 1512, /* GL_STENCIL_REF */ - 1516, /* GL_STENCIL_WRITEMASK */ - 846, /* GL_MATRIX_MODE */ - 1015, /* GL_NORMALIZE */ - 1842, /* GL_VIEWPORT */ - 989, /* GL_MODELVIEW_STACK_DEPTH */ - 1253, /* GL_PROJECTION_STACK_DEPTH */ - 1723, /* GL_TEXTURE_STACK_DEPTH */ - 987, /* GL_MODELVIEW_MATRIX */ - 1252, /* GL_PROJECTION_MATRIX */ - 1706, /* GL_TEXTURE_MATRIX */ + 1530, /* GL_STENCIL_TEST */ + 1514, /* GL_STENCIL_CLEAR_VALUE */ + 1516, /* GL_STENCIL_FUNC */ + 1532, /* GL_STENCIL_VALUE_MASK */ + 1515, /* GL_STENCIL_FAIL */ + 1527, /* GL_STENCIL_PASS_DEPTH_FAIL */ + 1528, /* GL_STENCIL_PASS_DEPTH_PASS */ + 1529, /* GL_STENCIL_REF */ + 1533, /* GL_STENCIL_WRITEMASK */ + 853, /* GL_MATRIX_MODE */ + 1025, /* GL_NORMALIZE */ + 1861, /* GL_VIEWPORT */ + 999, /* GL_MODELVIEW_STACK_DEPTH */ + 1263, /* GL_PROJECTION_STACK_DEPTH */ + 1740, /* GL_TEXTURE_STACK_DEPTH */ + 997, /* GL_MODELVIEW_MATRIX */ + 1262, /* GL_PROJECTION_MATRIX */ + 1723, /* GL_TEXTURE_MATRIX */ 61, /* GL_ATTRIB_STACK_DEPTH */ 136, /* GL_CLIENT_ATTRIB_STACK_DEPTH */ 43, /* GL_ALPHA_TEST */ 44, /* GL_ALPHA_TEST_FUNC */ 45, /* GL_ALPHA_TEST_REF */ - 381, /* GL_DITHER */ + 383, /* GL_DITHER */ 78, /* GL_BLEND_DST */ 87, /* GL_BLEND_SRC */ 75, /* GL_BLEND */ - 715, /* GL_LOGIC_OP_MODE */ - 632, /* GL_INDEX_LOGIC_OP */ + 722, /* GL_LOGIC_OP_MODE */ + 639, /* GL_INDEX_LOGIC_OP */ 191, /* GL_COLOR_LOGIC_OP */ 67, /* GL_AUX_BUFFERS */ - 392, /* GL_DRAW_BUFFER */ - 1289, /* GL_READ_BUFFER */ - 1400, /* GL_SCISSOR_BOX */ - 1401, /* GL_SCISSOR_TEST */ - 631, /* GL_INDEX_CLEAR_VALUE */ - 636, /* GL_INDEX_WRITEMASK */ + 394, /* GL_DRAW_BUFFER */ + 1299, /* GL_READ_BUFFER */ + 1413, /* GL_SCISSOR_BOX */ + 1414, /* GL_SCISSOR_TEST */ + 638, /* GL_INDEX_CLEAR_VALUE */ + 643, /* GL_INDEX_WRITEMASK */ 188, /* GL_COLOR_CLEAR_VALUE */ 230, /* GL_COLOR_WRITEMASK */ - 633, /* GL_INDEX_MODE */ - 1366, /* GL_RGBA_MODE */ - 391, /* GL_DOUBLEBUFFER */ - 1517, /* GL_STEREO */ - 1324, /* GL_RENDER_MODE */ - 1101, /* GL_PERSPECTIVE_CORRECTION_HINT */ - 1154, /* GL_POINT_SMOOTH_HINT */ - 699, /* GL_LINE_SMOOTH_HINT */ - 1171, /* GL_POLYGON_SMOOTH_HINT */ - 526, /* GL_FOG_HINT */ - 1687, /* GL_TEXTURE_GEN_S */ - 1688, /* GL_TEXTURE_GEN_T */ - 1686, /* GL_TEXTURE_GEN_R */ - 1685, /* GL_TEXTURE_GEN_Q */ - 1114, /* GL_PIXEL_MAP_I_TO_I */ - 1120, /* GL_PIXEL_MAP_S_TO_S */ - 1116, /* GL_PIXEL_MAP_I_TO_R */ - 1112, /* GL_PIXEL_MAP_I_TO_G */ - 1110, /* GL_PIXEL_MAP_I_TO_B */ - 1108, /* GL_PIXEL_MAP_I_TO_A */ - 1118, /* GL_PIXEL_MAP_R_TO_R */ - 1106, /* GL_PIXEL_MAP_G_TO_G */ - 1104, /* GL_PIXEL_MAP_B_TO_B */ - 1102, /* GL_PIXEL_MAP_A_TO_A */ - 1115, /* GL_PIXEL_MAP_I_TO_I_SIZE */ - 1121, /* GL_PIXEL_MAP_S_TO_S_SIZE */ - 1117, /* GL_PIXEL_MAP_I_TO_R_SIZE */ - 1113, /* GL_PIXEL_MAP_I_TO_G_SIZE */ - 1111, /* GL_PIXEL_MAP_I_TO_B_SIZE */ - 1109, /* GL_PIXEL_MAP_I_TO_A_SIZE */ - 1119, /* GL_PIXEL_MAP_R_TO_R_SIZE */ - 1107, /* GL_PIXEL_MAP_G_TO_G_SIZE */ - 1105, /* GL_PIXEL_MAP_B_TO_B_SIZE */ - 1103, /* GL_PIXEL_MAP_A_TO_A_SIZE */ - 1760, /* GL_UNPACK_SWAP_BYTES */ - 1755, /* GL_UNPACK_LSB_FIRST */ - 1756, /* GL_UNPACK_ROW_LENGTH */ - 1759, /* GL_UNPACK_SKIP_ROWS */ - 1758, /* GL_UNPACK_SKIP_PIXELS */ - 1753, /* GL_UNPACK_ALIGNMENT */ - 1089, /* GL_PACK_SWAP_BYTES */ - 1084, /* GL_PACK_LSB_FIRST */ - 1085, /* GL_PACK_ROW_LENGTH */ - 1088, /* GL_PACK_SKIP_ROWS */ - 1087, /* GL_PACK_SKIP_PIXELS */ - 1081, /* GL_PACK_ALIGNMENT */ - 793, /* GL_MAP_COLOR */ - 798, /* GL_MAP_STENCIL */ - 635, /* GL_INDEX_SHIFT */ - 634, /* GL_INDEX_OFFSET */ - 1302, /* GL_RED_SCALE */ - 1300, /* GL_RED_BIAS */ - 1860, /* GL_ZOOM_X */ - 1861, /* GL_ZOOM_Y */ - 596, /* GL_GREEN_SCALE */ - 594, /* GL_GREEN_BIAS */ + 640, /* GL_INDEX_MODE */ + 1379, /* GL_RGBA_MODE */ + 393, /* GL_DOUBLEBUFFER */ + 1534, /* GL_STEREO */ + 1337, /* GL_RENDER_MODE */ + 1111, /* GL_PERSPECTIVE_CORRECTION_HINT */ + 1164, /* GL_POINT_SMOOTH_HINT */ + 706, /* GL_LINE_SMOOTH_HINT */ + 1181, /* GL_POLYGON_SMOOTH_HINT */ + 529, /* GL_FOG_HINT */ + 1704, /* GL_TEXTURE_GEN_S */ + 1705, /* GL_TEXTURE_GEN_T */ + 1703, /* GL_TEXTURE_GEN_R */ + 1702, /* GL_TEXTURE_GEN_Q */ + 1124, /* GL_PIXEL_MAP_I_TO_I */ + 1130, /* GL_PIXEL_MAP_S_TO_S */ + 1126, /* GL_PIXEL_MAP_I_TO_R */ + 1122, /* GL_PIXEL_MAP_I_TO_G */ + 1120, /* GL_PIXEL_MAP_I_TO_B */ + 1118, /* GL_PIXEL_MAP_I_TO_A */ + 1128, /* GL_PIXEL_MAP_R_TO_R */ + 1116, /* GL_PIXEL_MAP_G_TO_G */ + 1114, /* GL_PIXEL_MAP_B_TO_B */ + 1112, /* GL_PIXEL_MAP_A_TO_A */ + 1125, /* GL_PIXEL_MAP_I_TO_I_SIZE */ + 1131, /* GL_PIXEL_MAP_S_TO_S_SIZE */ + 1127, /* GL_PIXEL_MAP_I_TO_R_SIZE */ + 1123, /* GL_PIXEL_MAP_I_TO_G_SIZE */ + 1121, /* GL_PIXEL_MAP_I_TO_B_SIZE */ + 1119, /* GL_PIXEL_MAP_I_TO_A_SIZE */ + 1129, /* GL_PIXEL_MAP_R_TO_R_SIZE */ + 1117, /* GL_PIXEL_MAP_G_TO_G_SIZE */ + 1115, /* GL_PIXEL_MAP_B_TO_B_SIZE */ + 1113, /* GL_PIXEL_MAP_A_TO_A_SIZE */ + 1778, /* GL_UNPACK_SWAP_BYTES */ + 1773, /* GL_UNPACK_LSB_FIRST */ + 1774, /* GL_UNPACK_ROW_LENGTH */ + 1777, /* GL_UNPACK_SKIP_ROWS */ + 1776, /* GL_UNPACK_SKIP_PIXELS */ + 1771, /* GL_UNPACK_ALIGNMENT */ + 1099, /* GL_PACK_SWAP_BYTES */ + 1094, /* GL_PACK_LSB_FIRST */ + 1095, /* GL_PACK_ROW_LENGTH */ + 1098, /* GL_PACK_SKIP_ROWS */ + 1097, /* GL_PACK_SKIP_PIXELS */ + 1091, /* GL_PACK_ALIGNMENT */ + 800, /* GL_MAP_COLOR */ + 805, /* GL_MAP_STENCIL */ + 642, /* GL_INDEX_SHIFT */ + 641, /* GL_INDEX_OFFSET */ + 1313, /* GL_RED_SCALE */ + 1311, /* GL_RED_BIAS */ + 1879, /* GL_ZOOM_X */ + 1880, /* GL_ZOOM_Y */ + 603, /* GL_GREEN_SCALE */ + 601, /* GL_GREEN_BIAS */ 93, /* GL_BLUE_SCALE */ 91, /* GL_BLUE_BIAS */ 42, /* GL_ALPHA_SCALE */ 40, /* GL_ALPHA_BIAS */ - 370, /* GL_DEPTH_SCALE */ - 350, /* GL_DEPTH_BIAS */ - 872, /* GL_MAX_EVAL_ORDER */ - 876, /* GL_MAX_LIGHTS */ - 855, /* GL_MAX_CLIP_PLANES */ - 922, /* GL_MAX_TEXTURE_SIZE */ - 882, /* GL_MAX_PIXEL_MAP_TABLE */ - 851, /* GL_MAX_ATTRIB_STACK_DEPTH */ - 879, /* GL_MAX_MODELVIEW_STACK_DEPTH */ - 880, /* GL_MAX_NAME_STACK_DEPTH */ - 908, /* GL_MAX_PROJECTION_STACK_DEPTH */ - 923, /* GL_MAX_TEXTURE_STACK_DEPTH */ - 937, /* GL_MAX_VIEWPORT_DIMS */ - 852, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ - 1527, /* GL_SUBPIXEL_BITS */ - 630, /* GL_INDEX_BITS */ - 1301, /* GL_RED_BITS */ - 595, /* GL_GREEN_BITS */ + 371, /* GL_DEPTH_SCALE */ + 351, /* GL_DEPTH_BIAS */ + 880, /* GL_MAX_EVAL_ORDER */ + 884, /* GL_MAX_LIGHTS */ + 862, /* GL_MAX_CLIP_PLANES */ + 932, /* GL_MAX_TEXTURE_SIZE */ + 890, /* GL_MAX_PIXEL_MAP_TABLE */ + 858, /* GL_MAX_ATTRIB_STACK_DEPTH */ + 887, /* GL_MAX_MODELVIEW_STACK_DEPTH */ + 888, /* GL_MAX_NAME_STACK_DEPTH */ + 916, /* GL_MAX_PROJECTION_STACK_DEPTH */ + 933, /* GL_MAX_TEXTURE_STACK_DEPTH */ + 947, /* GL_MAX_VIEWPORT_DIMS */ + 859, /* GL_MAX_CLIENT_ATTRIB_STACK_DEPTH */ + 1544, /* GL_SUBPIXEL_BITS */ + 637, /* GL_INDEX_BITS */ + 1312, /* GL_RED_BITS */ + 602, /* GL_GREEN_BITS */ 92, /* GL_BLUE_BITS */ 41, /* GL_ALPHA_BITS */ - 351, /* GL_DEPTH_BITS */ - 1499, /* GL_STENCIL_BITS */ + 352, /* GL_DEPTH_BITS */ + 1512, /* GL_STENCIL_BITS */ 14, /* GL_ACCUM_RED_BITS */ 13, /* GL_ACCUM_GREEN_BITS */ 10, /* GL_ACCUM_BLUE_BITS */ 9, /* GL_ACCUM_ALPHA_BITS */ - 1003, /* GL_NAME_STACK_DEPTH */ + 1013, /* GL_NAME_STACK_DEPTH */ 62, /* GL_AUTO_NORMAL */ - 739, /* GL_MAP1_COLOR_4 */ - 742, /* GL_MAP1_INDEX */ - 743, /* GL_MAP1_NORMAL */ - 744, /* GL_MAP1_TEXTURE_COORD_1 */ - 745, /* GL_MAP1_TEXTURE_COORD_2 */ - 746, /* GL_MAP1_TEXTURE_COORD_3 */ - 747, /* GL_MAP1_TEXTURE_COORD_4 */ - 748, /* GL_MAP1_VERTEX_3 */ - 749, /* GL_MAP1_VERTEX_4 */ - 766, /* GL_MAP2_COLOR_4 */ - 769, /* GL_MAP2_INDEX */ - 770, /* GL_MAP2_NORMAL */ - 771, /* GL_MAP2_TEXTURE_COORD_1 */ - 772, /* GL_MAP2_TEXTURE_COORD_2 */ - 773, /* GL_MAP2_TEXTURE_COORD_3 */ - 774, /* GL_MAP2_TEXTURE_COORD_4 */ - 775, /* GL_MAP2_VERTEX_3 */ - 776, /* GL_MAP2_VERTEX_4 */ - 740, /* GL_MAP1_GRID_DOMAIN */ - 741, /* GL_MAP1_GRID_SEGMENTS */ - 767, /* GL_MAP2_GRID_DOMAIN */ - 768, /* GL_MAP2_GRID_SEGMENTS */ - 1610, /* GL_TEXTURE_1D */ - 1612, /* GL_TEXTURE_2D */ - 479, /* GL_FEEDBACK_BUFFER_POINTER */ - 480, /* GL_FEEDBACK_BUFFER_SIZE */ - 481, /* GL_FEEDBACK_BUFFER_TYPE */ - 1410, /* GL_SELECTION_BUFFER_POINTER */ - 1411, /* GL_SELECTION_BUFFER_SIZE */ - 1728, /* GL_TEXTURE_WIDTH */ - 1692, /* GL_TEXTURE_HEIGHT */ - 1647, /* GL_TEXTURE_COMPONENTS */ - 1631, /* GL_TEXTURE_BORDER_COLOR */ - 1630, /* GL_TEXTURE_BORDER */ - 383, /* GL_DONT_CARE */ - 477, /* GL_FASTEST */ - 1011, /* GL_NICEST */ + 746, /* GL_MAP1_COLOR_4 */ + 749, /* GL_MAP1_INDEX */ + 750, /* GL_MAP1_NORMAL */ + 751, /* GL_MAP1_TEXTURE_COORD_1 */ + 752, /* GL_MAP1_TEXTURE_COORD_2 */ + 753, /* GL_MAP1_TEXTURE_COORD_3 */ + 754, /* GL_MAP1_TEXTURE_COORD_4 */ + 755, /* GL_MAP1_VERTEX_3 */ + 756, /* GL_MAP1_VERTEX_4 */ + 773, /* GL_MAP2_COLOR_4 */ + 776, /* GL_MAP2_INDEX */ + 777, /* GL_MAP2_NORMAL */ + 778, /* GL_MAP2_TEXTURE_COORD_1 */ + 779, /* GL_MAP2_TEXTURE_COORD_2 */ + 780, /* GL_MAP2_TEXTURE_COORD_3 */ + 781, /* GL_MAP2_TEXTURE_COORD_4 */ + 782, /* GL_MAP2_VERTEX_3 */ + 783, /* GL_MAP2_VERTEX_4 */ + 747, /* GL_MAP1_GRID_DOMAIN */ + 748, /* GL_MAP1_GRID_SEGMENTS */ + 774, /* GL_MAP2_GRID_DOMAIN */ + 775, /* GL_MAP2_GRID_SEGMENTS */ + 1627, /* GL_TEXTURE_1D */ + 1629, /* GL_TEXTURE_2D */ + 482, /* GL_FEEDBACK_BUFFER_POINTER */ + 483, /* GL_FEEDBACK_BUFFER_SIZE */ + 484, /* GL_FEEDBACK_BUFFER_TYPE */ + 1423, /* GL_SELECTION_BUFFER_POINTER */ + 1424, /* GL_SELECTION_BUFFER_SIZE */ + 1746, /* GL_TEXTURE_WIDTH */ + 1709, /* GL_TEXTURE_HEIGHT */ + 1664, /* GL_TEXTURE_COMPONENTS */ + 1648, /* GL_TEXTURE_BORDER_COLOR */ + 1647, /* GL_TEXTURE_BORDER */ + 385, /* GL_DONT_CARE */ + 480, /* GL_FASTEST */ + 1021, /* GL_NICEST */ 48, /* GL_AMBIENT */ - 380, /* GL_DIFFUSE */ - 1459, /* GL_SPECULAR */ - 1175, /* GL_POSITION */ - 1462, /* GL_SPOT_DIRECTION */ - 1463, /* GL_SPOT_EXPONENT */ - 1461, /* GL_SPOT_CUTOFF */ + 382, /* GL_DIFFUSE */ + 1472, /* GL_SPECULAR */ + 1185, /* GL_POSITION */ + 1475, /* GL_SPOT_DIRECTION */ + 1476, /* GL_SPOT_EXPONENT */ + 1474, /* GL_SPOT_CUTOFF */ 275, /* GL_CONSTANT_ATTENUATION */ - 689, /* GL_LINEAR_ATTENUATION */ - 1274, /* GL_QUADRATIC_ATTENUATION */ + 696, /* GL_LINEAR_ATTENUATION */ + 1284, /* GL_QUADRATIC_ATTENUATION */ 244, /* GL_COMPILE */ 245, /* GL_COMPILE_AND_EXECUTE */ 120, /* GL_BYTE */ - 1762, /* GL_UNSIGNED_BYTE */ - 1424, /* GL_SHORT */ - 1773, /* GL_UNSIGNED_SHORT */ - 638, /* GL_INT */ - 1765, /* GL_UNSIGNED_INT */ - 486, /* GL_FLOAT */ + 1780, /* GL_UNSIGNED_BYTE */ + 1437, /* GL_SHORT */ + 1792, /* GL_UNSIGNED_SHORT */ + 645, /* GL_INT */ + 1783, /* GL_UNSIGNED_INT */ + 489, /* GL_FLOAT */ 1, /* GL_2_BYTES */ 5, /* GL_3_BYTES */ 7, /* GL_4_BYTES */ - 390, /* GL_DOUBLE */ + 392, /* GL_DOUBLE */ 132, /* GL_CLEAR */ 50, /* GL_AND */ 52, /* GL_AND_REVERSE */ 299, /* GL_COPY */ 51, /* GL_AND_INVERTED */ - 1013, /* GL_NOOP */ - 1856, /* GL_XOR */ - 1076, /* GL_OR */ - 1014, /* GL_NOR */ - 467, /* GL_EQUIV */ - 665, /* GL_INVERT */ - 1079, /* GL_OR_REVERSE */ + 1023, /* GL_NOOP */ + 1875, /* GL_XOR */ + 1086, /* GL_OR */ + 1024, /* GL_NOR */ + 470, /* GL_EQUIV */ + 672, /* GL_INVERT */ + 1089, /* GL_OR_REVERSE */ 300, /* GL_COPY_INVERTED */ - 1078, /* GL_OR_INVERTED */ - 1004, /* GL_NAND */ - 1415, /* GL_SET */ - 464, /* GL_EMISSION */ - 1423, /* GL_SHININESS */ + 1088, /* GL_OR_INVERTED */ + 1014, /* GL_NAND */ + 1428, /* GL_SET */ + 467, /* GL_EMISSION */ + 1436, /* GL_SHININESS */ 49, /* GL_AMBIENT_AND_DIFFUSE */ 190, /* GL_COLOR_INDEXES */ - 954, /* GL_MODELVIEW */ - 1251, /* GL_PROJECTION */ - 1545, /* GL_TEXTURE */ + 964, /* GL_MODELVIEW */ + 1261, /* GL_PROJECTION */ + 1562, /* GL_TEXTURE */ 147, /* GL_COLOR */ 346, /* GL_DEPTH */ - 1485, /* GL_STENCIL */ + 1498, /* GL_STENCIL */ 189, /* GL_COLOR_INDEX */ - 1504, /* GL_STENCIL_INDEX */ - 358, /* GL_DEPTH_COMPONENT */ - 1297, /* GL_RED */ - 593, /* GL_GREEN */ + 1517, /* GL_STENCIL_INDEX */ + 359, /* GL_DEPTH_COMPONENT */ + 1308, /* GL_RED */ + 600, /* GL_GREEN */ 90, /* GL_BLUE */ 31, /* GL_ALPHA */ - 1332, /* GL_RGB */ - 1351, /* GL_RGBA */ - 717, /* GL_LUMINANCE */ - 738, /* GL_LUMINANCE_ALPHA */ + 1345, /* GL_RGB */ + 1364, /* GL_RGBA */ + 724, /* GL_LUMINANCE */ + 745, /* GL_LUMINANCE_ALPHA */ 73, /* GL_BITMAP */ - 1131, /* GL_POINT */ - 687, /* GL_LINE */ - 482, /* GL_FILL */ - 1306, /* GL_RENDER */ - 478, /* GL_FEEDBACK */ - 1409, /* GL_SELECT */ - 485, /* GL_FLAT */ - 1434, /* GL_SMOOTH */ - 666, /* GL_KEEP */ - 1326, /* GL_REPLACE */ - 620, /* GL_INCR */ + 1141, /* GL_POINT */ + 694, /* GL_LINE */ + 485, /* GL_FILL */ + 1317, /* GL_RENDER */ + 481, /* GL_FEEDBACK */ + 1422, /* GL_SELECT */ + 488, /* GL_FLAT */ + 1447, /* GL_SMOOTH */ + 673, /* GL_KEEP */ + 1339, /* GL_REPLACE */ + 627, /* GL_INCR */ 342, /* GL_DECR */ - 1788, /* GL_VENDOR */ - 1323, /* GL_RENDERER */ - 1789, /* GL_VERSION */ - 471, /* GL_EXTENSIONS */ - 1374, /* GL_S */ - 1536, /* GL_T */ - 1286, /* GL_R */ - 1273, /* GL_Q */ - 990, /* GL_MODULATE */ + 1807, /* GL_VENDOR */ + 1336, /* GL_RENDERER */ + 1808, /* GL_VERSION */ + 474, /* GL_EXTENSIONS */ + 1387, /* GL_S */ + 1553, /* GL_T */ + 1296, /* GL_R */ + 1283, /* GL_Q */ + 1000, /* GL_MODULATE */ 341, /* GL_DECAL */ - 1682, /* GL_TEXTURE_ENV_MODE */ - 1681, /* GL_TEXTURE_ENV_COLOR */ - 1680, /* GL_TEXTURE_ENV */ - 472, /* GL_EYE_LINEAR */ - 1037, /* GL_OBJECT_LINEAR */ - 1460, /* GL_SPHERE_MAP */ - 1684, /* GL_TEXTURE_GEN_MODE */ - 1039, /* GL_OBJECT_PLANE */ - 473, /* GL_EYE_PLANE */ - 1005, /* GL_NEAREST */ - 688, /* GL_LINEAR */ - 1009, /* GL_NEAREST_MIPMAP_NEAREST */ - 693, /* GL_LINEAR_MIPMAP_NEAREST */ - 1008, /* GL_NEAREST_MIPMAP_LINEAR */ - 692, /* GL_LINEAR_MIPMAP_LINEAR */ - 1705, /* GL_TEXTURE_MAG_FILTER */ - 1713, /* GL_TEXTURE_MIN_FILTER */ - 1730, /* GL_TEXTURE_WRAP_S */ - 1731, /* GL_TEXTURE_WRAP_T */ + 1699, /* GL_TEXTURE_ENV_MODE */ + 1698, /* GL_TEXTURE_ENV_COLOR */ + 1697, /* GL_TEXTURE_ENV */ + 475, /* GL_EYE_LINEAR */ + 1047, /* GL_OBJECT_LINEAR */ + 1473, /* GL_SPHERE_MAP */ + 1701, /* GL_TEXTURE_GEN_MODE */ + 1049, /* GL_OBJECT_PLANE */ + 476, /* GL_EYE_PLANE */ + 1015, /* GL_NEAREST */ + 695, /* GL_LINEAR */ + 1019, /* GL_NEAREST_MIPMAP_NEAREST */ + 700, /* GL_LINEAR_MIPMAP_NEAREST */ + 1018, /* GL_NEAREST_MIPMAP_LINEAR */ + 699, /* GL_LINEAR_MIPMAP_LINEAR */ + 1722, /* GL_TEXTURE_MAG_FILTER */ + 1730, /* GL_TEXTURE_MIN_FILTER */ + 1748, /* GL_TEXTURE_WRAP_S */ + 1749, /* GL_TEXTURE_WRAP_T */ 126, /* GL_CLAMP */ - 1325, /* GL_REPEAT */ - 1169, /* GL_POLYGON_OFFSET_UNITS */ - 1168, /* GL_POLYGON_OFFSET_POINT */ - 1167, /* GL_POLYGON_OFFSET_LINE */ - 1287, /* GL_R3_G3_B2 */ - 1785, /* GL_V2F */ - 1786, /* GL_V3F */ + 1338, /* GL_REPEAT */ + 1179, /* GL_POLYGON_OFFSET_UNITS */ + 1178, /* GL_POLYGON_OFFSET_POINT */ + 1177, /* GL_POLYGON_OFFSET_LINE */ + 1297, /* GL_R3_G3_B2 */ + 1804, /* GL_V2F */ + 1805, /* GL_V3F */ 123, /* GL_C4UB_V2F */ 124, /* GL_C4UB_V3F */ 121, /* GL_C3F_V3F */ - 1002, /* GL_N3F_V3F */ + 1012, /* GL_N3F_V3F */ 122, /* GL_C4F_N3F_V3F */ - 1541, /* GL_T2F_V3F */ - 1543, /* GL_T4F_V4F */ - 1539, /* GL_T2F_C4UB_V3F */ - 1537, /* GL_T2F_C3F_V3F */ - 1540, /* GL_T2F_N3F_V3F */ - 1538, /* GL_T2F_C4F_N3F_V3F */ - 1542, /* GL_T4F_C4F_N3F_V4F */ + 1558, /* GL_T2F_V3F */ + 1560, /* GL_T4F_V4F */ + 1556, /* GL_T2F_C4UB_V3F */ + 1554, /* GL_T2F_C3F_V3F */ + 1557, /* GL_T2F_N3F_V3F */ + 1555, /* GL_T2F_C4F_N3F_V3F */ + 1559, /* GL_T4F_C4F_N3F_V4F */ 139, /* GL_CLIP_PLANE0 */ 140, /* GL_CLIP_PLANE1 */ 141, /* GL_CLIP_PLANE2 */ 142, /* GL_CLIP_PLANE3 */ 143, /* GL_CLIP_PLANE4 */ 144, /* GL_CLIP_PLANE5 */ - 672, /* GL_LIGHT0 */ - 673, /* GL_LIGHT1 */ - 674, /* GL_LIGHT2 */ - 675, /* GL_LIGHT3 */ - 676, /* GL_LIGHT4 */ - 677, /* GL_LIGHT5 */ - 678, /* GL_LIGHT6 */ - 679, /* GL_LIGHT7 */ - 597, /* GL_HINT_BIT */ + 679, /* GL_LIGHT0 */ + 680, /* GL_LIGHT1 */ + 681, /* GL_LIGHT2 */ + 682, /* GL_LIGHT3 */ + 683, /* GL_LIGHT4 */ + 684, /* GL_LIGHT5 */ + 685, /* GL_LIGHT6 */ + 686, /* GL_LIGHT7 */ + 604, /* GL_HINT_BIT */ 277, /* GL_CONSTANT_COLOR */ - 1050, /* GL_ONE_MINUS_CONSTANT_COLOR */ + 1060, /* GL_ONE_MINUS_CONSTANT_COLOR */ 272, /* GL_CONSTANT_ALPHA */ - 1048, /* GL_ONE_MINUS_CONSTANT_ALPHA */ + 1058, /* GL_ONE_MINUS_CONSTANT_ALPHA */ 76, /* GL_BLEND_COLOR */ - 581, /* GL_FUNC_ADD */ - 938, /* GL_MIN */ - 848, /* GL_MAX */ + 588, /* GL_FUNC_ADD */ + 948, /* GL_MIN */ + 855, /* GL_MAX */ 81, /* GL_BLEND_EQUATION */ - 585, /* GL_FUNC_SUBTRACT */ - 583, /* GL_FUNC_REVERSE_SUBTRACT */ + 592, /* GL_FUNC_SUBTRACT */ + 590, /* GL_FUNC_REVERSE_SUBTRACT */ 280, /* GL_CONVOLUTION_1D */ 281, /* GL_CONVOLUTION_2D */ - 1412, /* GL_SEPARABLE_2D */ + 1425, /* GL_SEPARABLE_2D */ 284, /* GL_CONVOLUTION_BORDER_MODE */ 288, /* GL_CONVOLUTION_FILTER_SCALE */ 286, /* GL_CONVOLUTION_FILTER_BIAS */ - 1298, /* GL_REDUCE */ + 1309, /* GL_REDUCE */ 290, /* GL_CONVOLUTION_FORMAT */ 294, /* GL_CONVOLUTION_WIDTH */ 292, /* GL_CONVOLUTION_HEIGHT */ - 863, /* GL_MAX_CONVOLUTION_WIDTH */ - 861, /* GL_MAX_CONVOLUTION_HEIGHT */ - 1208, /* GL_POST_CONVOLUTION_RED_SCALE */ - 1204, /* GL_POST_CONVOLUTION_GREEN_SCALE */ - 1199, /* GL_POST_CONVOLUTION_BLUE_SCALE */ - 1195, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ - 1206, /* GL_POST_CONVOLUTION_RED_BIAS */ - 1202, /* GL_POST_CONVOLUTION_GREEN_BIAS */ - 1197, /* GL_POST_CONVOLUTION_BLUE_BIAS */ - 1193, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ - 598, /* GL_HISTOGRAM */ - 1257, /* GL_PROXY_HISTOGRAM */ - 614, /* GL_HISTOGRAM_WIDTH */ - 604, /* GL_HISTOGRAM_FORMAT */ - 610, /* GL_HISTOGRAM_RED_SIZE */ - 606, /* GL_HISTOGRAM_GREEN_SIZE */ - 601, /* GL_HISTOGRAM_BLUE_SIZE */ - 599, /* GL_HISTOGRAM_ALPHA_SIZE */ - 608, /* GL_HISTOGRAM_LUMINANCE_SIZE */ - 612, /* GL_HISTOGRAM_SINK */ - 939, /* GL_MINMAX */ - 941, /* GL_MINMAX_FORMAT */ - 943, /* GL_MINMAX_SINK */ - 1544, /* GL_TABLE_TOO_LARGE_EXT */ - 1764, /* GL_UNSIGNED_BYTE_3_3_2 */ - 1775, /* GL_UNSIGNED_SHORT_4_4_4_4 */ - 1777, /* GL_UNSIGNED_SHORT_5_5_5_1 */ - 1770, /* GL_UNSIGNED_INT_8_8_8_8 */ - 1766, /* GL_UNSIGNED_INT_10_10_10_2 */ - 1166, /* GL_POLYGON_OFFSET_FILL */ - 1165, /* GL_POLYGON_OFFSET_FACTOR */ - 1164, /* GL_POLYGON_OFFSET_BIAS */ - 1329, /* GL_RESCALE_NORMAL */ + 871, /* GL_MAX_CONVOLUTION_WIDTH */ + 869, /* GL_MAX_CONVOLUTION_HEIGHT */ + 1218, /* GL_POST_CONVOLUTION_RED_SCALE */ + 1214, /* GL_POST_CONVOLUTION_GREEN_SCALE */ + 1209, /* GL_POST_CONVOLUTION_BLUE_SCALE */ + 1205, /* GL_POST_CONVOLUTION_ALPHA_SCALE */ + 1216, /* GL_POST_CONVOLUTION_RED_BIAS */ + 1212, /* GL_POST_CONVOLUTION_GREEN_BIAS */ + 1207, /* GL_POST_CONVOLUTION_BLUE_BIAS */ + 1203, /* GL_POST_CONVOLUTION_ALPHA_BIAS */ + 605, /* GL_HISTOGRAM */ + 1267, /* GL_PROXY_HISTOGRAM */ + 621, /* GL_HISTOGRAM_WIDTH */ + 611, /* GL_HISTOGRAM_FORMAT */ + 617, /* GL_HISTOGRAM_RED_SIZE */ + 613, /* GL_HISTOGRAM_GREEN_SIZE */ + 608, /* GL_HISTOGRAM_BLUE_SIZE */ + 606, /* GL_HISTOGRAM_ALPHA_SIZE */ + 615, /* GL_HISTOGRAM_LUMINANCE_SIZE */ + 619, /* GL_HISTOGRAM_SINK */ + 949, /* GL_MINMAX */ + 951, /* GL_MINMAX_FORMAT */ + 953, /* GL_MINMAX_SINK */ + 1561, /* GL_TABLE_TOO_LARGE_EXT */ + 1782, /* GL_UNSIGNED_BYTE_3_3_2 */ + 1794, /* GL_UNSIGNED_SHORT_4_4_4_4 */ + 1796, /* GL_UNSIGNED_SHORT_5_5_5_1 */ + 1789, /* GL_UNSIGNED_INT_8_8_8_8 */ + 1784, /* GL_UNSIGNED_INT_10_10_10_2 */ + 1176, /* GL_POLYGON_OFFSET_FILL */ + 1175, /* GL_POLYGON_OFFSET_FACTOR */ + 1174, /* GL_POLYGON_OFFSET_BIAS */ + 1342, /* GL_RESCALE_NORMAL */ 36, /* GL_ALPHA4 */ 38, /* GL_ALPHA8 */ 32, /* GL_ALPHA12 */ 34, /* GL_ALPHA16 */ - 728, /* GL_LUMINANCE4 */ - 734, /* GL_LUMINANCE8 */ - 718, /* GL_LUMINANCE12 */ - 724, /* GL_LUMINANCE16 */ - 729, /* GL_LUMINANCE4_ALPHA4 */ - 732, /* GL_LUMINANCE6_ALPHA2 */ - 735, /* GL_LUMINANCE8_ALPHA8 */ - 721, /* GL_LUMINANCE12_ALPHA4 */ - 719, /* GL_LUMINANCE12_ALPHA12 */ - 725, /* GL_LUMINANCE16_ALPHA16 */ - 639, /* GL_INTENSITY */ - 644, /* GL_INTENSITY4 */ - 646, /* GL_INTENSITY8 */ - 640, /* GL_INTENSITY12 */ - 642, /* GL_INTENSITY16 */ - 1341, /* GL_RGB2_EXT */ - 1342, /* GL_RGB4 */ - 1345, /* GL_RGB5 */ - 1349, /* GL_RGB8 */ - 1333, /* GL_RGB10 */ - 1337, /* GL_RGB12 */ - 1339, /* GL_RGB16 */ - 1356, /* GL_RGBA2 */ - 1358, /* GL_RGBA4 */ - 1346, /* GL_RGB5_A1 */ - 1362, /* GL_RGBA8 */ - 1334, /* GL_RGB10_A2 */ - 1352, /* GL_RGBA12 */ - 1354, /* GL_RGBA16 */ - 1720, /* GL_TEXTURE_RED_SIZE */ - 1690, /* GL_TEXTURE_GREEN_SIZE */ - 1628, /* GL_TEXTURE_BLUE_SIZE */ - 1615, /* GL_TEXTURE_ALPHA_SIZE */ - 1703, /* GL_TEXTURE_LUMINANCE_SIZE */ - 1694, /* GL_TEXTURE_INTENSITY_SIZE */ - 1327, /* GL_REPLACE_EXT */ - 1261, /* GL_PROXY_TEXTURE_1D */ - 1264, /* GL_PROXY_TEXTURE_2D */ - 1726, /* GL_TEXTURE_TOO_LARGE_EXT */ - 1715, /* GL_TEXTURE_PRIORITY */ - 1722, /* GL_TEXTURE_RESIDENT */ - 1618, /* GL_TEXTURE_BINDING_1D */ - 1620, /* GL_TEXTURE_BINDING_2D */ - 1622, /* GL_TEXTURE_BINDING_3D */ - 1086, /* GL_PACK_SKIP_IMAGES */ - 1082, /* GL_PACK_IMAGE_HEIGHT */ - 1757, /* GL_UNPACK_SKIP_IMAGES */ - 1754, /* GL_UNPACK_IMAGE_HEIGHT */ - 1614, /* GL_TEXTURE_3D */ - 1267, /* GL_PROXY_TEXTURE_3D */ - 1677, /* GL_TEXTURE_DEPTH */ - 1729, /* GL_TEXTURE_WRAP_R */ - 849, /* GL_MAX_3D_TEXTURE_SIZE */ - 1790, /* GL_VERTEX_ARRAY */ - 1016, /* GL_NORMAL_ARRAY */ + 735, /* GL_LUMINANCE4 */ + 741, /* GL_LUMINANCE8 */ + 725, /* GL_LUMINANCE12 */ + 731, /* GL_LUMINANCE16 */ + 736, /* GL_LUMINANCE4_ALPHA4 */ + 739, /* GL_LUMINANCE6_ALPHA2 */ + 742, /* GL_LUMINANCE8_ALPHA8 */ + 728, /* GL_LUMINANCE12_ALPHA4 */ + 726, /* GL_LUMINANCE12_ALPHA12 */ + 732, /* GL_LUMINANCE16_ALPHA16 */ + 646, /* GL_INTENSITY */ + 651, /* GL_INTENSITY4 */ + 653, /* GL_INTENSITY8 */ + 647, /* GL_INTENSITY12 */ + 649, /* GL_INTENSITY16 */ + 1354, /* GL_RGB2_EXT */ + 1355, /* GL_RGB4 */ + 1358, /* GL_RGB5 */ + 1362, /* GL_RGB8 */ + 1346, /* GL_RGB10 */ + 1350, /* GL_RGB12 */ + 1352, /* GL_RGB16 */ + 1369, /* GL_RGBA2 */ + 1371, /* GL_RGBA4 */ + 1359, /* GL_RGB5_A1 */ + 1375, /* GL_RGBA8 */ + 1347, /* GL_RGB10_A2 */ + 1365, /* GL_RGBA12 */ + 1367, /* GL_RGBA16 */ + 1737, /* GL_TEXTURE_RED_SIZE */ + 1707, /* GL_TEXTURE_GREEN_SIZE */ + 1645, /* GL_TEXTURE_BLUE_SIZE */ + 1632, /* GL_TEXTURE_ALPHA_SIZE */ + 1720, /* GL_TEXTURE_LUMINANCE_SIZE */ + 1711, /* GL_TEXTURE_INTENSITY_SIZE */ + 1340, /* GL_REPLACE_EXT */ + 1271, /* GL_PROXY_TEXTURE_1D */ + 1274, /* GL_PROXY_TEXTURE_2D */ + 1744, /* GL_TEXTURE_TOO_LARGE_EXT */ + 1732, /* GL_TEXTURE_PRIORITY */ + 1739, /* GL_TEXTURE_RESIDENT */ + 1635, /* GL_TEXTURE_BINDING_1D */ + 1637, /* GL_TEXTURE_BINDING_2D */ + 1639, /* GL_TEXTURE_BINDING_3D */ + 1096, /* GL_PACK_SKIP_IMAGES */ + 1092, /* GL_PACK_IMAGE_HEIGHT */ + 1775, /* GL_UNPACK_SKIP_IMAGES */ + 1772, /* GL_UNPACK_IMAGE_HEIGHT */ + 1631, /* GL_TEXTURE_3D */ + 1277, /* GL_PROXY_TEXTURE_3D */ + 1694, /* GL_TEXTURE_DEPTH */ + 1747, /* GL_TEXTURE_WRAP_R */ + 856, /* GL_MAX_3D_TEXTURE_SIZE */ + 1809, /* GL_VERTEX_ARRAY */ + 1026, /* GL_NORMAL_ARRAY */ 148, /* GL_COLOR_ARRAY */ - 624, /* GL_INDEX_ARRAY */ - 1655, /* GL_TEXTURE_COORD_ARRAY */ - 456, /* GL_EDGE_FLAG_ARRAY */ - 1796, /* GL_VERTEX_ARRAY_SIZE */ - 1798, /* GL_VERTEX_ARRAY_TYPE */ - 1797, /* GL_VERTEX_ARRAY_STRIDE */ - 1021, /* GL_NORMAL_ARRAY_TYPE */ - 1020, /* GL_NORMAL_ARRAY_STRIDE */ + 631, /* GL_INDEX_ARRAY */ + 1672, /* GL_TEXTURE_COORD_ARRAY */ + 459, /* GL_EDGE_FLAG_ARRAY */ + 1815, /* GL_VERTEX_ARRAY_SIZE */ + 1817, /* GL_VERTEX_ARRAY_TYPE */ + 1816, /* GL_VERTEX_ARRAY_STRIDE */ + 1031, /* GL_NORMAL_ARRAY_TYPE */ + 1030, /* GL_NORMAL_ARRAY_STRIDE */ 152, /* GL_COLOR_ARRAY_SIZE */ 154, /* GL_COLOR_ARRAY_TYPE */ 153, /* GL_COLOR_ARRAY_STRIDE */ - 629, /* GL_INDEX_ARRAY_TYPE */ - 628, /* GL_INDEX_ARRAY_STRIDE */ - 1659, /* GL_TEXTURE_COORD_ARRAY_SIZE */ - 1661, /* GL_TEXTURE_COORD_ARRAY_TYPE */ - 1660, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ - 460, /* GL_EDGE_FLAG_ARRAY_STRIDE */ - 1795, /* GL_VERTEX_ARRAY_POINTER */ - 1019, /* GL_NORMAL_ARRAY_POINTER */ + 636, /* GL_INDEX_ARRAY_TYPE */ + 635, /* GL_INDEX_ARRAY_STRIDE */ + 1676, /* GL_TEXTURE_COORD_ARRAY_SIZE */ + 1678, /* GL_TEXTURE_COORD_ARRAY_TYPE */ + 1677, /* GL_TEXTURE_COORD_ARRAY_STRIDE */ + 463, /* GL_EDGE_FLAG_ARRAY_STRIDE */ + 1814, /* GL_VERTEX_ARRAY_POINTER */ + 1029, /* GL_NORMAL_ARRAY_POINTER */ 151, /* GL_COLOR_ARRAY_POINTER */ - 627, /* GL_INDEX_ARRAY_POINTER */ - 1658, /* GL_TEXTURE_COORD_ARRAY_POINTER */ - 459, /* GL_EDGE_FLAG_ARRAY_POINTER */ - 995, /* GL_MULTISAMPLE */ - 1386, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ - 1388, /* GL_SAMPLE_ALPHA_TO_ONE */ - 1393, /* GL_SAMPLE_COVERAGE */ - 1390, /* GL_SAMPLE_BUFFERS */ - 1381, /* GL_SAMPLES */ - 1397, /* GL_SAMPLE_COVERAGE_VALUE */ - 1395, /* GL_SAMPLE_COVERAGE_INVERT */ + 634, /* GL_INDEX_ARRAY_POINTER */ + 1675, /* GL_TEXTURE_COORD_ARRAY_POINTER */ + 462, /* GL_EDGE_FLAG_ARRAY_POINTER */ + 1005, /* GL_MULTISAMPLE */ + 1399, /* GL_SAMPLE_ALPHA_TO_COVERAGE */ + 1401, /* GL_SAMPLE_ALPHA_TO_ONE */ + 1406, /* GL_SAMPLE_COVERAGE */ + 1403, /* GL_SAMPLE_BUFFERS */ + 1394, /* GL_SAMPLES */ + 1410, /* GL_SAMPLE_COVERAGE_VALUE */ + 1408, /* GL_SAMPLE_COVERAGE_INVERT */ 195, /* GL_COLOR_MATRIX */ 197, /* GL_COLOR_MATRIX_STACK_DEPTH */ - 857, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ - 1191, /* GL_POST_COLOR_MATRIX_RED_SCALE */ - 1187, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ - 1182, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ - 1178, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ - 1189, /* GL_POST_COLOR_MATRIX_RED_BIAS */ - 1185, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ - 1180, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ - 1176, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ - 1638, /* GL_TEXTURE_COLOR_TABLE_SGI */ - 1268, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ - 1640, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ + 865, /* GL_MAX_COLOR_MATRIX_STACK_DEPTH */ + 1201, /* GL_POST_COLOR_MATRIX_RED_SCALE */ + 1197, /* GL_POST_COLOR_MATRIX_GREEN_SCALE */ + 1192, /* GL_POST_COLOR_MATRIX_BLUE_SCALE */ + 1188, /* GL_POST_COLOR_MATRIX_ALPHA_SCALE */ + 1199, /* GL_POST_COLOR_MATRIX_RED_BIAS */ + 1195, /* GL_POST_COLOR_MATRIX_GREEN_BIAS */ + 1190, /* GL_POST_COLOR_MATRIX_BLUE_BIAS */ + 1186, /* GL_POST_COLOR_MATRIX_ALPHA_BIAS */ + 1655, /* GL_TEXTURE_COLOR_TABLE_SGI */ + 1278, /* GL_PROXY_TEXTURE_COLOR_TABLE_SGI */ + 1657, /* GL_TEXTURE_COMPARE_FAIL_VALUE_ARB */ 80, /* GL_BLEND_DST_RGB */ 89, /* GL_BLEND_SRC_RGB */ 79, /* GL_BLEND_DST_ALPHA */ 88, /* GL_BLEND_SRC_ALPHA */ 201, /* GL_COLOR_TABLE */ - 1201, /* GL_POST_CONVOLUTION_COLOR_TABLE */ - 1184, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ - 1256, /* GL_PROXY_COLOR_TABLE */ - 1260, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ - 1259, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ + 1211, /* GL_POST_CONVOLUTION_COLOR_TABLE */ + 1194, /* GL_POST_COLOR_MATRIX_COLOR_TABLE */ + 1266, /* GL_PROXY_COLOR_TABLE */ + 1270, /* GL_PROXY_POST_CONVOLUTION_COLOR_TABLE */ + 1269, /* GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE */ 225, /* GL_COLOR_TABLE_SCALE */ 205, /* GL_COLOR_TABLE_BIAS */ 210, /* GL_COLOR_TABLE_FORMAT */ @@ -4379,380 +4417,380 @@ static const unsigned reduced_enums[1347] = 216, /* GL_COLOR_TABLE_INTENSITY_SIZE */ 71, /* GL_BGR */ 72, /* GL_BGRA */ - 871, /* GL_MAX_ELEMENTS_VERTICES */ - 870, /* GL_MAX_ELEMENTS_INDICES */ - 1693, /* GL_TEXTURE_INDEX_SIZE_EXT */ + 879, /* GL_MAX_ELEMENTS_VERTICES */ + 878, /* GL_MAX_ELEMENTS_INDICES */ + 1710, /* GL_TEXTURE_INDEX_SIZE_EXT */ 145, /* GL_CLIP_VOLUME_CLIPPING_HINT_EXT */ - 1148, /* GL_POINT_SIZE_MIN */ - 1144, /* GL_POINT_SIZE_MAX */ - 1138, /* GL_POINT_FADE_THRESHOLD_SIZE */ - 1134, /* GL_POINT_DISTANCE_ATTENUATION */ + 1158, /* GL_POINT_SIZE_MIN */ + 1154, /* GL_POINT_SIZE_MAX */ + 1148, /* GL_POINT_FADE_THRESHOLD_SIZE */ + 1144, /* GL_POINT_DISTANCE_ATTENUATION */ 127, /* GL_CLAMP_TO_BORDER */ 130, /* GL_CLAMP_TO_EDGE */ - 1714, /* GL_TEXTURE_MIN_LOD */ - 1712, /* GL_TEXTURE_MAX_LOD */ - 1617, /* GL_TEXTURE_BASE_LEVEL */ - 1711, /* GL_TEXTURE_MAX_LEVEL */ - 617, /* GL_IGNORE_BORDER_HP */ + 1731, /* GL_TEXTURE_MIN_LOD */ + 1729, /* GL_TEXTURE_MAX_LOD */ + 1634, /* GL_TEXTURE_BASE_LEVEL */ + 1728, /* GL_TEXTURE_MAX_LEVEL */ + 624, /* GL_IGNORE_BORDER_HP */ 276, /* GL_CONSTANT_BORDER_HP */ - 1328, /* GL_REPLICATE_BORDER_HP */ + 1341, /* GL_REPLICATE_BORDER_HP */ 282, /* GL_CONVOLUTION_BORDER_COLOR */ - 1045, /* GL_OCCLUSION_TEST_HP */ - 1046, /* GL_OCCLUSION_TEST_RESULT_HP */ - 690, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ - 1632, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ - 1634, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ - 1636, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ - 1637, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - 1635, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ - 1633, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ - 853, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ - 854, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ - 1211, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ - 1213, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ - 1210, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ - 1212, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ - 1701, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ - 1702, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ - 1700, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ - 587, /* GL_GENERATE_MIPMAP */ - 588, /* GL_GENERATE_MIPMAP_HINT */ - 529, /* GL_FOG_OFFSET_SGIX */ - 530, /* GL_FOG_OFFSET_VALUE_SGIX */ - 1646, /* GL_TEXTURE_COMPARE_SGIX */ - 1645, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ - 1697, /* GL_TEXTURE_LEQUAL_R_SGIX */ - 1689, /* GL_TEXTURE_GEQUAL_R_SGIX */ - 359, /* GL_DEPTH_COMPONENT16 */ - 362, /* GL_DEPTH_COMPONENT24 */ - 365, /* GL_DEPTH_COMPONENT32 */ + 1055, /* GL_OCCLUSION_TEST_HP */ + 1056, /* GL_OCCLUSION_TEST_RESULT_HP */ + 697, /* GL_LINEAR_CLIPMAP_LINEAR_SGIX */ + 1649, /* GL_TEXTURE_CLIPMAP_CENTER_SGIX */ + 1651, /* GL_TEXTURE_CLIPMAP_FRAME_SGIX */ + 1653, /* GL_TEXTURE_CLIPMAP_OFFSET_SGIX */ + 1654, /* GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + 1652, /* GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX */ + 1650, /* GL_TEXTURE_CLIPMAP_DEPTH_SGIX */ + 860, /* GL_MAX_CLIPMAP_DEPTH_SGIX */ + 861, /* GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX */ + 1221, /* GL_POST_TEXTURE_FILTER_BIAS_SGIX */ + 1223, /* GL_POST_TEXTURE_FILTER_SCALE_SGIX */ + 1220, /* GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX */ + 1222, /* GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX */ + 1718, /* GL_TEXTURE_LOD_BIAS_S_SGIX */ + 1719, /* GL_TEXTURE_LOD_BIAS_T_SGIX */ + 1717, /* GL_TEXTURE_LOD_BIAS_R_SGIX */ + 594, /* GL_GENERATE_MIPMAP */ + 595, /* GL_GENERATE_MIPMAP_HINT */ + 532, /* GL_FOG_OFFSET_SGIX */ + 533, /* GL_FOG_OFFSET_VALUE_SGIX */ + 1663, /* GL_TEXTURE_COMPARE_SGIX */ + 1662, /* GL_TEXTURE_COMPARE_OPERATOR_SGIX */ + 1714, /* GL_TEXTURE_LEQUAL_R_SGIX */ + 1706, /* GL_TEXTURE_GEQUAL_R_SGIX */ + 360, /* GL_DEPTH_COMPONENT16 */ + 363, /* GL_DEPTH_COMPONENT24 */ + 366, /* GL_DEPTH_COMPONENT32 */ 306, /* GL_CULL_VERTEX_EXT */ 308, /* GL_CULL_VERTEX_OBJECT_POSITION_EXT */ 307, /* GL_CULL_VERTEX_EYE_POSITION_EXT */ - 1853, /* GL_WRAP_BORDER_SUN */ - 1639, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ - 683, /* GL_LIGHT_MODEL_COLOR_CONTROL */ - 1427, /* GL_SINGLE_COLOR */ - 1413, /* GL_SEPARATE_SPECULAR_COLOR */ - 1422, /* GL_SHARED_TEXTURE_PALETTE_EXT */ - 540, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ - 541, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ - 548, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ - 543, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ - 539, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ - 538, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ - 542, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ - 549, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ - 560, /* GL_FRAMEBUFFER_DEFAULT */ - 573, /* GL_FRAMEBUFFER_UNDEFINED */ - 372, /* GL_DEPTH_STENCIL_ATTACHMENT */ - 623, /* GL_INDEX */ - 1763, /* GL_UNSIGNED_BYTE_2_3_3_REV */ - 1778, /* GL_UNSIGNED_SHORT_5_6_5 */ - 1779, /* GL_UNSIGNED_SHORT_5_6_5_REV */ - 1776, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ - 1774, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ - 1771, /* GL_UNSIGNED_INT_8_8_8_8_REV */ - 1769, /* GL_UNSIGNED_INT_2_10_10_10_REV */ - 1709, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ - 1710, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ - 1708, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ - 946, /* GL_MIRRORED_REPEAT */ - 1369, /* GL_RGB_S3TC */ - 1344, /* GL_RGB4_S3TC */ - 1367, /* GL_RGBA_S3TC */ - 1361, /* GL_RGBA4_S3TC */ - 1365, /* GL_RGBA_DXT5_S3TC */ - 1359, /* GL_RGBA4_DXT5_S3TC */ + 1872, /* GL_WRAP_BORDER_SUN */ + 1656, /* GL_TEXTURE_COLOR_WRITEMASK_SGIS */ + 690, /* GL_LIGHT_MODEL_COLOR_CONTROL */ + 1440, /* GL_SINGLE_COLOR */ + 1426, /* GL_SEPARATE_SPECULAR_COLOR */ + 1435, /* GL_SHARED_TEXTURE_PALETTE_EXT */ + 543, /* GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING */ + 544, /* GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE */ + 551, /* GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE */ + 546, /* GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE */ + 542, /* GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE */ + 541, /* GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE */ + 545, /* GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE */ + 552, /* GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE */ + 564, /* GL_FRAMEBUFFER_DEFAULT */ + 580, /* GL_FRAMEBUFFER_UNDEFINED */ + 373, /* GL_DEPTH_STENCIL_ATTACHMENT */ + 630, /* GL_INDEX */ + 1781, /* GL_UNSIGNED_BYTE_2_3_3_REV */ + 1797, /* GL_UNSIGNED_SHORT_5_6_5 */ + 1798, /* GL_UNSIGNED_SHORT_5_6_5_REV */ + 1795, /* GL_UNSIGNED_SHORT_4_4_4_4_REV */ + 1793, /* GL_UNSIGNED_SHORT_1_5_5_5_REV */ + 1790, /* GL_UNSIGNED_INT_8_8_8_8_REV */ + 1788, /* GL_UNSIGNED_INT_2_10_10_10_REV */ + 1726, /* GL_TEXTURE_MAX_CLAMP_S_SGIX */ + 1727, /* GL_TEXTURE_MAX_CLAMP_T_SGIX */ + 1725, /* GL_TEXTURE_MAX_CLAMP_R_SGIX */ + 956, /* GL_MIRRORED_REPEAT */ + 1382, /* GL_RGB_S3TC */ + 1357, /* GL_RGB4_S3TC */ + 1380, /* GL_RGBA_S3TC */ + 1374, /* GL_RGBA4_S3TC */ + 1378, /* GL_RGBA_DXT5_S3TC */ + 1372, /* GL_RGBA4_DXT5_S3TC */ 264, /* GL_COMPRESSED_RGB_S3TC_DXT1_EXT */ 259, /* GL_COMPRESSED_RGBA_S3TC_DXT1_EXT */ 260, /* GL_COMPRESSED_RGBA_S3TC_DXT3_EXT */ 261, /* GL_COMPRESSED_RGBA_S3TC_DXT5_EXT */ - 1007, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ - 1006, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ - 691, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ - 516, /* GL_FOG_COORDINATE_SOURCE */ - 508, /* GL_FOG_COORD */ - 532, /* GL_FRAGMENT_DEPTH */ + 1017, /* GL_NEAREST_CLIPMAP_NEAREST_SGIX */ + 1016, /* GL_NEAREST_CLIPMAP_LINEAR_SGIX */ + 698, /* GL_LINEAR_CLIPMAP_NEAREST_SGIX */ + 519, /* GL_FOG_COORDINATE_SOURCE */ + 511, /* GL_FOG_COORD */ + 535, /* GL_FRAGMENT_DEPTH */ 312, /* GL_CURRENT_FOG_COORD */ - 515, /* GL_FOG_COORDINATE_ARRAY_TYPE */ - 514, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ - 513, /* GL_FOG_COORDINATE_ARRAY_POINTER */ - 510, /* GL_FOG_COORDINATE_ARRAY */ + 518, /* GL_FOG_COORDINATE_ARRAY_TYPE */ + 517, /* GL_FOG_COORDINATE_ARRAY_STRIDE */ + 516, /* GL_FOG_COORDINATE_ARRAY_POINTER */ + 513, /* GL_FOG_COORDINATE_ARRAY */ 199, /* GL_COLOR_SUM */ 332, /* GL_CURRENT_SECONDARY_COLOR */ - 1406, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ - 1408, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ - 1407, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ - 1405, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ - 1402, /* GL_SECONDARY_COLOR_ARRAY */ + 1419, /* GL_SECONDARY_COLOR_ARRAY_SIZE */ + 1421, /* GL_SECONDARY_COLOR_ARRAY_TYPE */ + 1420, /* GL_SECONDARY_COLOR_ARRAY_STRIDE */ + 1418, /* GL_SECONDARY_COLOR_ARRAY_POINTER */ + 1415, /* GL_SECONDARY_COLOR_ARRAY */ 330, /* GL_CURRENT_RASTER_SECONDARY_COLOR */ 28, /* GL_ALIASED_POINT_SIZE_RANGE */ 27, /* GL_ALIASED_LINE_WIDTH_RANGE */ - 1546, /* GL_TEXTURE0 */ - 1548, /* GL_TEXTURE1 */ - 1570, /* GL_TEXTURE2 */ - 1592, /* GL_TEXTURE3 */ - 1598, /* GL_TEXTURE4 */ - 1600, /* GL_TEXTURE5 */ - 1602, /* GL_TEXTURE6 */ - 1604, /* GL_TEXTURE7 */ - 1606, /* GL_TEXTURE8 */ - 1608, /* GL_TEXTURE9 */ - 1549, /* GL_TEXTURE10 */ - 1551, /* GL_TEXTURE11 */ - 1553, /* GL_TEXTURE12 */ - 1555, /* GL_TEXTURE13 */ - 1557, /* GL_TEXTURE14 */ - 1559, /* GL_TEXTURE15 */ - 1561, /* GL_TEXTURE16 */ - 1563, /* GL_TEXTURE17 */ - 1565, /* GL_TEXTURE18 */ - 1567, /* GL_TEXTURE19 */ - 1571, /* GL_TEXTURE20 */ - 1573, /* GL_TEXTURE21 */ - 1575, /* GL_TEXTURE22 */ - 1577, /* GL_TEXTURE23 */ - 1579, /* GL_TEXTURE24 */ - 1581, /* GL_TEXTURE25 */ - 1583, /* GL_TEXTURE26 */ - 1585, /* GL_TEXTURE27 */ - 1587, /* GL_TEXTURE28 */ - 1589, /* GL_TEXTURE29 */ - 1593, /* GL_TEXTURE30 */ - 1595, /* GL_TEXTURE31 */ + 1563, /* GL_TEXTURE0 */ + 1565, /* GL_TEXTURE1 */ + 1587, /* GL_TEXTURE2 */ + 1609, /* GL_TEXTURE3 */ + 1615, /* GL_TEXTURE4 */ + 1617, /* GL_TEXTURE5 */ + 1619, /* GL_TEXTURE6 */ + 1621, /* GL_TEXTURE7 */ + 1623, /* GL_TEXTURE8 */ + 1625, /* GL_TEXTURE9 */ + 1566, /* GL_TEXTURE10 */ + 1568, /* GL_TEXTURE11 */ + 1570, /* GL_TEXTURE12 */ + 1572, /* GL_TEXTURE13 */ + 1574, /* GL_TEXTURE14 */ + 1576, /* GL_TEXTURE15 */ + 1578, /* GL_TEXTURE16 */ + 1580, /* GL_TEXTURE17 */ + 1582, /* GL_TEXTURE18 */ + 1584, /* GL_TEXTURE19 */ + 1588, /* GL_TEXTURE20 */ + 1590, /* GL_TEXTURE21 */ + 1592, /* GL_TEXTURE22 */ + 1594, /* GL_TEXTURE23 */ + 1596, /* GL_TEXTURE24 */ + 1598, /* GL_TEXTURE25 */ + 1600, /* GL_TEXTURE26 */ + 1602, /* GL_TEXTURE27 */ + 1604, /* GL_TEXTURE28 */ + 1606, /* GL_TEXTURE29 */ + 1610, /* GL_TEXTURE30 */ + 1612, /* GL_TEXTURE31 */ 18, /* GL_ACTIVE_TEXTURE */ 133, /* GL_CLIENT_ACTIVE_TEXTURE */ - 924, /* GL_MAX_TEXTURE_UNITS */ - 1741, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ - 1744, /* GL_TRANSPOSE_PROJECTION_MATRIX */ - 1746, /* GL_TRANSPOSE_TEXTURE_MATRIX */ - 1738, /* GL_TRANSPOSE_COLOR_MATRIX */ - 1528, /* GL_SUBTRACT */ - 911, /* GL_MAX_RENDERBUFFER_SIZE_EXT */ + 934, /* GL_MAX_TEXTURE_UNITS */ + 1759, /* GL_TRANSPOSE_MODELVIEW_MATRIX */ + 1762, /* GL_TRANSPOSE_PROJECTION_MATRIX */ + 1764, /* GL_TRANSPOSE_TEXTURE_MATRIX */ + 1756, /* GL_TRANSPOSE_COLOR_MATRIX */ + 1545, /* GL_SUBTRACT */ + 919, /* GL_MAX_RENDERBUFFER_SIZE */ 247, /* GL_COMPRESSED_ALPHA */ 251, /* GL_COMPRESSED_LUMINANCE */ 252, /* GL_COMPRESSED_LUMINANCE_ALPHA */ 249, /* GL_COMPRESSED_INTENSITY */ 255, /* GL_COMPRESSED_RGB */ 256, /* GL_COMPRESSED_RGBA */ - 1653, /* GL_TEXTURE_COMPRESSION_HINT */ - 1718, /* GL_TEXTURE_RECTANGLE_ARB */ - 1625, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ - 1271, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ - 909, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ - 371, /* GL_DEPTH_STENCIL */ - 1767, /* GL_UNSIGNED_INT_24_8 */ - 920, /* GL_MAX_TEXTURE_LOD_BIAS */ - 1707, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ - 921, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ - 1683, /* GL_TEXTURE_FILTER_CONTROL */ - 1698, /* GL_TEXTURE_LOD_BIAS */ + 1670, /* GL_TEXTURE_COMPRESSION_HINT */ + 1735, /* GL_TEXTURE_RECTANGLE_ARB */ + 1642, /* GL_TEXTURE_BINDING_RECTANGLE_ARB */ + 1281, /* GL_PROXY_TEXTURE_RECTANGLE_ARB */ + 917, /* GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB */ + 372, /* GL_DEPTH_STENCIL */ + 1785, /* GL_UNSIGNED_INT_24_8 */ + 930, /* GL_MAX_TEXTURE_LOD_BIAS */ + 1724, /* GL_TEXTURE_MAX_ANISOTROPY_EXT */ + 931, /* GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT */ + 1700, /* GL_TEXTURE_FILTER_CONTROL */ + 1715, /* GL_TEXTURE_LOD_BIAS */ 232, /* GL_COMBINE4 */ - 914, /* GL_MAX_SHININESS_NV */ - 915, /* GL_MAX_SPOT_EXPONENT_NV */ - 621, /* GL_INCR_WRAP */ + 924, /* GL_MAX_SHININESS_NV */ + 925, /* GL_MAX_SPOT_EXPONENT_NV */ + 628, /* GL_INCR_WRAP */ 343, /* GL_DECR_WRAP */ - 966, /* GL_MODELVIEW1_ARB */ - 1022, /* GL_NORMAL_MAP */ - 1303, /* GL_REFLECTION_MAP */ - 1662, /* GL_TEXTURE_CUBE_MAP */ - 1623, /* GL_TEXTURE_BINDING_CUBE_MAP */ - 1670, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ - 1664, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ - 1672, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ - 1666, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ - 1674, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ - 1668, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ - 1269, /* GL_PROXY_TEXTURE_CUBE_MAP */ - 865, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ - 1001, /* GL_MULTISAMPLE_FILTER_HINT_NV */ - 524, /* GL_FOG_DISTANCE_MODE_NV */ - 475, /* GL_EYE_RADIAL_NV */ - 474, /* GL_EYE_PLANE_ABSOLUTE_NV */ + 976, /* GL_MODELVIEW1_ARB */ + 1032, /* GL_NORMAL_MAP */ + 1314, /* GL_REFLECTION_MAP */ + 1679, /* GL_TEXTURE_CUBE_MAP */ + 1640, /* GL_TEXTURE_BINDING_CUBE_MAP */ + 1687, /* GL_TEXTURE_CUBE_MAP_POSITIVE_X */ + 1681, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_X */ + 1689, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Y */ + 1683, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Y */ + 1691, /* GL_TEXTURE_CUBE_MAP_POSITIVE_Z */ + 1685, /* GL_TEXTURE_CUBE_MAP_NEGATIVE_Z */ + 1279, /* GL_PROXY_TEXTURE_CUBE_MAP */ + 873, /* GL_MAX_CUBE_MAP_TEXTURE_SIZE */ + 1011, /* GL_MULTISAMPLE_FILTER_HINT_NV */ + 527, /* GL_FOG_DISTANCE_MODE_NV */ + 478, /* GL_EYE_RADIAL_NV */ + 477, /* GL_EYE_PLANE_ABSOLUTE_NV */ 231, /* GL_COMBINE */ 238, /* GL_COMBINE_RGB */ 233, /* GL_COMBINE_ALPHA */ - 1370, /* GL_RGB_SCALE */ + 1383, /* GL_RGB_SCALE */ 24, /* GL_ADD_SIGNED */ - 649, /* GL_INTERPOLATE */ + 656, /* GL_INTERPOLATE */ 271, /* GL_CONSTANT */ - 1217, /* GL_PRIMARY_COLOR */ - 1214, /* GL_PREVIOUS */ - 1442, /* GL_SOURCE0_RGB */ - 1448, /* GL_SOURCE1_RGB */ - 1454, /* GL_SOURCE2_RGB */ - 1458, /* GL_SOURCE3_RGB_NV */ - 1439, /* GL_SOURCE0_ALPHA */ - 1445, /* GL_SOURCE1_ALPHA */ - 1451, /* GL_SOURCE2_ALPHA */ - 1457, /* GL_SOURCE3_ALPHA_NV */ - 1059, /* GL_OPERAND0_RGB */ - 1065, /* GL_OPERAND1_RGB */ - 1071, /* GL_OPERAND2_RGB */ - 1075, /* GL_OPERAND3_RGB_NV */ - 1056, /* GL_OPERAND0_ALPHA */ - 1062, /* GL_OPERAND1_ALPHA */ - 1068, /* GL_OPERAND2_ALPHA */ - 1074, /* GL_OPERAND3_ALPHA_NV */ - 1791, /* GL_VERTEX_ARRAY_BINDING */ - 1716, /* GL_TEXTURE_RANGE_LENGTH_APPLE */ - 1717, /* GL_TEXTURE_RANGE_POINTER_APPLE */ - 1857, /* GL_YCBCR_422_APPLE */ - 1780, /* GL_UNSIGNED_SHORT_8_8_APPLE */ - 1782, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ - 1725, /* GL_TEXTURE_STORAGE_HINT_APPLE */ - 1519, /* GL_STORAGE_PRIVATE_APPLE */ - 1518, /* GL_STORAGE_CACHED_APPLE */ - 1520, /* GL_STORAGE_SHARED_APPLE */ - 1429, /* GL_SLICE_ACCUM_SUN */ - 1278, /* GL_QUAD_MESH_SUN */ - 1750, /* GL_TRIANGLE_MESH_SUN */ - 1830, /* GL_VERTEX_PROGRAM_ARB */ - 1841, /* GL_VERTEX_STATE_PROGRAM_NV */ - 1817, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ - 1823, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ - 1825, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ - 1827, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ + 1227, /* GL_PRIMARY_COLOR */ + 1224, /* GL_PREVIOUS */ + 1455, /* GL_SOURCE0_RGB */ + 1461, /* GL_SOURCE1_RGB */ + 1467, /* GL_SOURCE2_RGB */ + 1471, /* GL_SOURCE3_RGB_NV */ + 1452, /* GL_SOURCE0_ALPHA */ + 1458, /* GL_SOURCE1_ALPHA */ + 1464, /* GL_SOURCE2_ALPHA */ + 1470, /* GL_SOURCE3_ALPHA_NV */ + 1069, /* GL_OPERAND0_RGB */ + 1075, /* GL_OPERAND1_RGB */ + 1081, /* GL_OPERAND2_RGB */ + 1085, /* GL_OPERAND3_RGB_NV */ + 1066, /* GL_OPERAND0_ALPHA */ + 1072, /* GL_OPERAND1_ALPHA */ + 1078, /* GL_OPERAND2_ALPHA */ + 1084, /* GL_OPERAND3_ALPHA_NV */ + 1810, /* GL_VERTEX_ARRAY_BINDING */ + 1733, /* GL_TEXTURE_RANGE_LENGTH_APPLE */ + 1734, /* GL_TEXTURE_RANGE_POINTER_APPLE */ + 1876, /* GL_YCBCR_422_APPLE */ + 1799, /* GL_UNSIGNED_SHORT_8_8_APPLE */ + 1801, /* GL_UNSIGNED_SHORT_8_8_REV_APPLE */ + 1743, /* GL_TEXTURE_STORAGE_HINT_APPLE */ + 1536, /* GL_STORAGE_PRIVATE_APPLE */ + 1535, /* GL_STORAGE_CACHED_APPLE */ + 1537, /* GL_STORAGE_SHARED_APPLE */ + 1442, /* GL_SLICE_ACCUM_SUN */ + 1288, /* GL_QUAD_MESH_SUN */ + 1768, /* GL_TRIANGLE_MESH_SUN */ + 1849, /* GL_VERTEX_PROGRAM_ARB */ + 1860, /* GL_VERTEX_STATE_PROGRAM_NV */ + 1836, /* GL_VERTEX_ATTRIB_ARRAY_ENABLED */ + 1842, /* GL_VERTEX_ATTRIB_ARRAY_SIZE */ + 1844, /* GL_VERTEX_ATTRIB_ARRAY_STRIDE */ + 1846, /* GL_VERTEX_ATTRIB_ARRAY_TYPE */ 334, /* GL_CURRENT_VERTEX_ATTRIB */ - 1230, /* GL_PROGRAM_LENGTH_ARB */ - 1244, /* GL_PROGRAM_STRING_ARB */ - 988, /* GL_MODELVIEW_PROJECTION_NV */ - 616, /* GL_IDENTITY_NV */ - 663, /* GL_INVERSE_NV */ - 1743, /* GL_TRANSPOSE_NV */ - 664, /* GL_INVERSE_TRANSPOSE_NV */ - 895, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ - 894, /* GL_MAX_PROGRAM_MATRICES_ARB */ - 802, /* GL_MATRIX0_NV */ - 814, /* GL_MATRIX1_NV */ - 826, /* GL_MATRIX2_NV */ - 830, /* GL_MATRIX3_NV */ - 832, /* GL_MATRIX4_NV */ - 834, /* GL_MATRIX5_NV */ - 836, /* GL_MATRIX6_NV */ - 838, /* GL_MATRIX7_NV */ + 1240, /* GL_PROGRAM_LENGTH_ARB */ + 1254, /* GL_PROGRAM_STRING_ARB */ + 998, /* GL_MODELVIEW_PROJECTION_NV */ + 623, /* GL_IDENTITY_NV */ + 670, /* GL_INVERSE_NV */ + 1761, /* GL_TRANSPOSE_NV */ + 671, /* GL_INVERSE_TRANSPOSE_NV */ + 903, /* GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB */ + 902, /* GL_MAX_PROGRAM_MATRICES_ARB */ + 809, /* GL_MATRIX0_NV */ + 821, /* GL_MATRIX1_NV */ + 833, /* GL_MATRIX2_NV */ + 837, /* GL_MATRIX3_NV */ + 839, /* GL_MATRIX4_NV */ + 841, /* GL_MATRIX5_NV */ + 843, /* GL_MATRIX6_NV */ + 845, /* GL_MATRIX7_NV */ 318, /* GL_CURRENT_MATRIX_STACK_DEPTH_ARB */ 315, /* GL_CURRENT_MATRIX_ARB */ - 1833, /* GL_VERTEX_PROGRAM_POINT_SIZE */ - 1836, /* GL_VERTEX_PROGRAM_TWO_SIDE */ - 1242, /* GL_PROGRAM_PARAMETER_NV */ - 1821, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ - 1246, /* GL_PROGRAM_TARGET_NV */ - 1243, /* GL_PROGRAM_RESIDENT_NV */ - 1735, /* GL_TRACK_MATRIX_NV */ - 1736, /* GL_TRACK_MATRIX_TRANSFORM_NV */ - 1831, /* GL_VERTEX_PROGRAM_BINDING_NV */ - 1224, /* GL_PROGRAM_ERROR_POSITION_ARB */ - 355, /* GL_DEPTH_CLAMP */ - 1799, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ - 1806, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ - 1807, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ - 1808, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ - 1809, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ - 1810, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ - 1811, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ - 1812, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ - 1813, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ - 1814, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ - 1800, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ - 1801, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ - 1802, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ - 1803, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ - 1804, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ - 1805, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ - 750, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ - 757, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ - 758, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ - 759, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ - 760, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ - 761, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ - 762, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ - 763, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ - 764, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ - 765, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ - 751, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ - 752, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ - 753, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ - 754, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ - 755, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ - 756, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ - 777, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ - 784, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ - 785, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ - 786, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ - 787, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ - 788, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ - 789, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ - 1223, /* GL_PROGRAM_BINDING_ARB */ - 791, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ - 792, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ - 778, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ - 779, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ - 780, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ - 781, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ - 782, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ - 783, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ - 1651, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ - 1648, /* GL_TEXTURE_COMPRESSED */ - 1027, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ + 1852, /* GL_VERTEX_PROGRAM_POINT_SIZE */ + 1855, /* GL_VERTEX_PROGRAM_TWO_SIDE */ + 1252, /* GL_PROGRAM_PARAMETER_NV */ + 1840, /* GL_VERTEX_ATTRIB_ARRAY_POINTER */ + 1256, /* GL_PROGRAM_TARGET_NV */ + 1253, /* GL_PROGRAM_RESIDENT_NV */ + 1753, /* GL_TRACK_MATRIX_NV */ + 1754, /* GL_TRACK_MATRIX_TRANSFORM_NV */ + 1850, /* GL_VERTEX_PROGRAM_BINDING_NV */ + 1234, /* GL_PROGRAM_ERROR_POSITION_ARB */ + 356, /* GL_DEPTH_CLAMP */ + 1818, /* GL_VERTEX_ATTRIB_ARRAY0_NV */ + 1825, /* GL_VERTEX_ATTRIB_ARRAY1_NV */ + 1826, /* GL_VERTEX_ATTRIB_ARRAY2_NV */ + 1827, /* GL_VERTEX_ATTRIB_ARRAY3_NV */ + 1828, /* GL_VERTEX_ATTRIB_ARRAY4_NV */ + 1829, /* GL_VERTEX_ATTRIB_ARRAY5_NV */ + 1830, /* GL_VERTEX_ATTRIB_ARRAY6_NV */ + 1831, /* GL_VERTEX_ATTRIB_ARRAY7_NV */ + 1832, /* GL_VERTEX_ATTRIB_ARRAY8_NV */ + 1833, /* GL_VERTEX_ATTRIB_ARRAY9_NV */ + 1819, /* GL_VERTEX_ATTRIB_ARRAY10_NV */ + 1820, /* GL_VERTEX_ATTRIB_ARRAY11_NV */ + 1821, /* GL_VERTEX_ATTRIB_ARRAY12_NV */ + 1822, /* GL_VERTEX_ATTRIB_ARRAY13_NV */ + 1823, /* GL_VERTEX_ATTRIB_ARRAY14_NV */ + 1824, /* GL_VERTEX_ATTRIB_ARRAY15_NV */ + 757, /* GL_MAP1_VERTEX_ATTRIB0_4_NV */ + 764, /* GL_MAP1_VERTEX_ATTRIB1_4_NV */ + 765, /* GL_MAP1_VERTEX_ATTRIB2_4_NV */ + 766, /* GL_MAP1_VERTEX_ATTRIB3_4_NV */ + 767, /* GL_MAP1_VERTEX_ATTRIB4_4_NV */ + 768, /* GL_MAP1_VERTEX_ATTRIB5_4_NV */ + 769, /* GL_MAP1_VERTEX_ATTRIB6_4_NV */ + 770, /* GL_MAP1_VERTEX_ATTRIB7_4_NV */ + 771, /* GL_MAP1_VERTEX_ATTRIB8_4_NV */ + 772, /* GL_MAP1_VERTEX_ATTRIB9_4_NV */ + 758, /* GL_MAP1_VERTEX_ATTRIB10_4_NV */ + 759, /* GL_MAP1_VERTEX_ATTRIB11_4_NV */ + 760, /* GL_MAP1_VERTEX_ATTRIB12_4_NV */ + 761, /* GL_MAP1_VERTEX_ATTRIB13_4_NV */ + 762, /* GL_MAP1_VERTEX_ATTRIB14_4_NV */ + 763, /* GL_MAP1_VERTEX_ATTRIB15_4_NV */ + 784, /* GL_MAP2_VERTEX_ATTRIB0_4_NV */ + 791, /* GL_MAP2_VERTEX_ATTRIB1_4_NV */ + 792, /* GL_MAP2_VERTEX_ATTRIB2_4_NV */ + 793, /* GL_MAP2_VERTEX_ATTRIB3_4_NV */ + 794, /* GL_MAP2_VERTEX_ATTRIB4_4_NV */ + 795, /* GL_MAP2_VERTEX_ATTRIB5_4_NV */ + 796, /* GL_MAP2_VERTEX_ATTRIB6_4_NV */ + 1233, /* GL_PROGRAM_BINDING_ARB */ + 798, /* GL_MAP2_VERTEX_ATTRIB8_4_NV */ + 799, /* GL_MAP2_VERTEX_ATTRIB9_4_NV */ + 785, /* GL_MAP2_VERTEX_ATTRIB10_4_NV */ + 786, /* GL_MAP2_VERTEX_ATTRIB11_4_NV */ + 787, /* GL_MAP2_VERTEX_ATTRIB12_4_NV */ + 788, /* GL_MAP2_VERTEX_ATTRIB13_4_NV */ + 789, /* GL_MAP2_VERTEX_ATTRIB14_4_NV */ + 790, /* GL_MAP2_VERTEX_ATTRIB15_4_NV */ + 1668, /* GL_TEXTURE_COMPRESSED_IMAGE_SIZE */ + 1665, /* GL_TEXTURE_COMPRESSED */ + 1037, /* GL_NUM_COMPRESSED_TEXTURE_FORMATS */ 269, /* GL_COMPRESSED_TEXTURE_FORMATS */ - 936, /* GL_MAX_VERTEX_UNITS_ARB */ + 946, /* GL_MAX_VERTEX_UNITS_ARB */ 22, /* GL_ACTIVE_VERTEX_UNITS_ARB */ - 1852, /* GL_WEIGHT_SUM_UNITY_ARB */ - 1829, /* GL_VERTEX_BLEND_ARB */ + 1871, /* GL_WEIGHT_SUM_UNITY_ARB */ + 1848, /* GL_VERTEX_BLEND_ARB */ 336, /* GL_CURRENT_WEIGHT_ARB */ - 1851, /* GL_WEIGHT_ARRAY_TYPE_ARB */ - 1850, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ - 1849, /* GL_WEIGHT_ARRAY_SIZE_ARB */ - 1848, /* GL_WEIGHT_ARRAY_POINTER_ARB */ - 1845, /* GL_WEIGHT_ARRAY_ARB */ - 384, /* GL_DOT3_RGB */ - 385, /* GL_DOT3_RGBA */ + 1870, /* GL_WEIGHT_ARRAY_TYPE_ARB */ + 1869, /* GL_WEIGHT_ARRAY_STRIDE_ARB */ + 1868, /* GL_WEIGHT_ARRAY_SIZE_ARB */ + 1867, /* GL_WEIGHT_ARRAY_POINTER_ARB */ + 1864, /* GL_WEIGHT_ARRAY_ARB */ + 386, /* GL_DOT3_RGB */ + 387, /* GL_DOT3_RGBA */ 263, /* GL_COMPRESSED_RGB_FXT1_3DFX */ 258, /* GL_COMPRESSED_RGBA_FXT1_3DFX */ - 996, /* GL_MULTISAMPLE_3DFX */ - 1391, /* GL_SAMPLE_BUFFERS_3DFX */ - 1382, /* GL_SAMPLES_3DFX */ - 977, /* GL_MODELVIEW2_ARB */ - 980, /* GL_MODELVIEW3_ARB */ - 981, /* GL_MODELVIEW4_ARB */ - 982, /* GL_MODELVIEW5_ARB */ - 983, /* GL_MODELVIEW6_ARB */ - 984, /* GL_MODELVIEW7_ARB */ - 985, /* GL_MODELVIEW8_ARB */ - 986, /* GL_MODELVIEW9_ARB */ - 956, /* GL_MODELVIEW10_ARB */ - 957, /* GL_MODELVIEW11_ARB */ - 958, /* GL_MODELVIEW12_ARB */ - 959, /* GL_MODELVIEW13_ARB */ - 960, /* GL_MODELVIEW14_ARB */ - 961, /* GL_MODELVIEW15_ARB */ - 962, /* GL_MODELVIEW16_ARB */ - 963, /* GL_MODELVIEW17_ARB */ - 964, /* GL_MODELVIEW18_ARB */ - 965, /* GL_MODELVIEW19_ARB */ - 967, /* GL_MODELVIEW20_ARB */ - 968, /* GL_MODELVIEW21_ARB */ - 969, /* GL_MODELVIEW22_ARB */ - 970, /* GL_MODELVIEW23_ARB */ - 971, /* GL_MODELVIEW24_ARB */ - 972, /* GL_MODELVIEW25_ARB */ - 973, /* GL_MODELVIEW26_ARB */ - 974, /* GL_MODELVIEW27_ARB */ - 975, /* GL_MODELVIEW28_ARB */ - 976, /* GL_MODELVIEW29_ARB */ - 978, /* GL_MODELVIEW30_ARB */ - 979, /* GL_MODELVIEW31_ARB */ - 389, /* GL_DOT3_RGB_EXT */ - 387, /* GL_DOT3_RGBA_EXT */ - 950, /* GL_MIRROR_CLAMP_EXT */ - 953, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ - 991, /* GL_MODULATE_ADD_ATI */ - 992, /* GL_MODULATE_SIGNED_ADD_ATI */ - 993, /* GL_MODULATE_SUBTRACT_ATI */ - 1858, /* GL_YCBCR_MESA */ - 1083, /* GL_PACK_INVERT_MESA */ + 1006, /* GL_MULTISAMPLE_3DFX */ + 1404, /* GL_SAMPLE_BUFFERS_3DFX */ + 1395, /* GL_SAMPLES_3DFX */ + 987, /* GL_MODELVIEW2_ARB */ + 990, /* GL_MODELVIEW3_ARB */ + 991, /* GL_MODELVIEW4_ARB */ + 992, /* GL_MODELVIEW5_ARB */ + 993, /* GL_MODELVIEW6_ARB */ + 994, /* GL_MODELVIEW7_ARB */ + 995, /* GL_MODELVIEW8_ARB */ + 996, /* GL_MODELVIEW9_ARB */ + 966, /* GL_MODELVIEW10_ARB */ + 967, /* GL_MODELVIEW11_ARB */ + 968, /* GL_MODELVIEW12_ARB */ + 969, /* GL_MODELVIEW13_ARB */ + 970, /* GL_MODELVIEW14_ARB */ + 971, /* GL_MODELVIEW15_ARB */ + 972, /* GL_MODELVIEW16_ARB */ + 973, /* GL_MODELVIEW17_ARB */ + 974, /* GL_MODELVIEW18_ARB */ + 975, /* GL_MODELVIEW19_ARB */ + 977, /* GL_MODELVIEW20_ARB */ + 978, /* GL_MODELVIEW21_ARB */ + 979, /* GL_MODELVIEW22_ARB */ + 980, /* GL_MODELVIEW23_ARB */ + 981, /* GL_MODELVIEW24_ARB */ + 982, /* GL_MODELVIEW25_ARB */ + 983, /* GL_MODELVIEW26_ARB */ + 984, /* GL_MODELVIEW27_ARB */ + 985, /* GL_MODELVIEW28_ARB */ + 986, /* GL_MODELVIEW29_ARB */ + 988, /* GL_MODELVIEW30_ARB */ + 989, /* GL_MODELVIEW31_ARB */ + 391, /* GL_DOT3_RGB_EXT */ + 389, /* GL_DOT3_RGBA_EXT */ + 960, /* GL_MIRROR_CLAMP_EXT */ + 963, /* GL_MIRROR_CLAMP_TO_EDGE_EXT */ + 1001, /* GL_MODULATE_ADD_ATI */ + 1002, /* GL_MODULATE_SIGNED_ADD_ATI */ + 1003, /* GL_MODULATE_SUBTRACT_ATI */ + 1877, /* GL_YCBCR_MESA */ + 1093, /* GL_PACK_INVERT_MESA */ 339, /* GL_DEBUG_OBJECT_MESA */ 340, /* GL_DEBUG_PRINT_MESA */ 338, /* GL_DEBUG_ASSERT_MESA */ @@ -4762,292 +4800,292 @@ static const unsigned reduced_enums[1347] = 117, /* GL_BUMP_ROT_MATRIX_SIZE_ATI */ 115, /* GL_BUMP_NUM_TEX_UNITS_ATI */ 119, /* GL_BUMP_TEX_UNITS_ATI */ - 448, /* GL_DUDV_ATI */ - 447, /* GL_DU8DV8_ATI */ + 451, /* GL_DUDV_ATI */ + 450, /* GL_DU8DV8_ATI */ 114, /* GL_BUMP_ENVMAP_ATI */ 118, /* GL_BUMP_TARGET_ATI */ - 1490, /* GL_STENCIL_BACK_FUNC */ - 1488, /* GL_STENCIL_BACK_FAIL */ - 1492, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ - 1494, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ - 533, /* GL_FRAGMENT_PROGRAM_ARB */ - 1221, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ - 1249, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ - 1248, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ - 1233, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - 1239, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - 1238, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - 884, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ - 907, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ - 906, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ - 897, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ - 903, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ - 902, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ - 867, /* GL_MAX_DRAW_BUFFERS */ - 393, /* GL_DRAW_BUFFER0 */ - 396, /* GL_DRAW_BUFFER1 */ - 417, /* GL_DRAW_BUFFER2 */ - 420, /* GL_DRAW_BUFFER3 */ - 423, /* GL_DRAW_BUFFER4 */ - 426, /* GL_DRAW_BUFFER5 */ - 429, /* GL_DRAW_BUFFER6 */ - 432, /* GL_DRAW_BUFFER7 */ - 435, /* GL_DRAW_BUFFER8 */ - 438, /* GL_DRAW_BUFFER9 */ - 397, /* GL_DRAW_BUFFER10 */ - 400, /* GL_DRAW_BUFFER11 */ - 403, /* GL_DRAW_BUFFER12 */ - 406, /* GL_DRAW_BUFFER13 */ - 409, /* GL_DRAW_BUFFER14 */ - 412, /* GL_DRAW_BUFFER15 */ + 1503, /* GL_STENCIL_BACK_FUNC */ + 1501, /* GL_STENCIL_BACK_FAIL */ + 1505, /* GL_STENCIL_BACK_PASS_DEPTH_FAIL */ + 1507, /* GL_STENCIL_BACK_PASS_DEPTH_PASS */ + 536, /* GL_FRAGMENT_PROGRAM_ARB */ + 1231, /* GL_PROGRAM_ALU_INSTRUCTIONS_ARB */ + 1259, /* GL_PROGRAM_TEX_INSTRUCTIONS_ARB */ + 1258, /* GL_PROGRAM_TEX_INDIRECTIONS_ARB */ + 1243, /* GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + 1249, /* GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + 1248, /* GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + 892, /* GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB */ + 915, /* GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB */ + 914, /* GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB */ + 905, /* GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB */ + 911, /* GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB */ + 910, /* GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB */ + 875, /* GL_MAX_DRAW_BUFFERS */ + 395, /* GL_DRAW_BUFFER0 */ + 398, /* GL_DRAW_BUFFER1 */ + 419, /* GL_DRAW_BUFFER2 */ + 422, /* GL_DRAW_BUFFER3 */ + 425, /* GL_DRAW_BUFFER4 */ + 428, /* GL_DRAW_BUFFER5 */ + 431, /* GL_DRAW_BUFFER6 */ + 434, /* GL_DRAW_BUFFER7 */ + 437, /* GL_DRAW_BUFFER8 */ + 440, /* GL_DRAW_BUFFER9 */ + 399, /* GL_DRAW_BUFFER10 */ + 402, /* GL_DRAW_BUFFER11 */ + 405, /* GL_DRAW_BUFFER12 */ + 408, /* GL_DRAW_BUFFER13 */ + 411, /* GL_DRAW_BUFFER14 */ + 414, /* GL_DRAW_BUFFER15 */ 82, /* GL_BLEND_EQUATION_ALPHA */ - 847, /* GL_MATRIX_PALETTE_ARB */ - 878, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ - 881, /* GL_MAX_PALETTE_MATRICES_ARB */ + 854, /* GL_MATRIX_PALETTE_ARB */ + 886, /* GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB */ + 889, /* GL_MAX_PALETTE_MATRICES_ARB */ 321, /* GL_CURRENT_PALETTE_MATRIX_ARB */ - 841, /* GL_MATRIX_INDEX_ARRAY_ARB */ + 848, /* GL_MATRIX_INDEX_ARRAY_ARB */ 316, /* GL_CURRENT_MATRIX_INDEX_ARB */ - 843, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ - 845, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ - 844, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ - 842, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ - 1678, /* GL_TEXTURE_DEPTH_SIZE */ - 377, /* GL_DEPTH_TEXTURE_MODE */ - 1643, /* GL_TEXTURE_COMPARE_MODE */ - 1641, /* GL_TEXTURE_COMPARE_FUNC */ + 850, /* GL_MATRIX_INDEX_ARRAY_SIZE_ARB */ + 852, /* GL_MATRIX_INDEX_ARRAY_TYPE_ARB */ + 851, /* GL_MATRIX_INDEX_ARRAY_STRIDE_ARB */ + 849, /* GL_MATRIX_INDEX_ARRAY_POINTER_ARB */ + 1695, /* GL_TEXTURE_DEPTH_SIZE */ + 379, /* GL_DEPTH_TEXTURE_MODE */ + 1660, /* GL_TEXTURE_COMPARE_MODE */ + 1658, /* GL_TEXTURE_COMPARE_FUNC */ 242, /* GL_COMPARE_R_TO_TEXTURE */ - 1155, /* GL_POINT_SPRITE */ + 1165, /* GL_POINT_SPRITE */ 296, /* GL_COORD_REPLACE */ - 1159, /* GL_POINT_SPRITE_R_MODE_NV */ - 1280, /* GL_QUERY_COUNTER_BITS */ + 1169, /* GL_POINT_SPRITE_R_MODE_NV */ + 1290, /* GL_QUERY_COUNTER_BITS */ 323, /* GL_CURRENT_QUERY */ - 1282, /* GL_QUERY_RESULT */ - 1284, /* GL_QUERY_RESULT_AVAILABLE */ - 930, /* GL_MAX_VERTEX_ATTRIBS */ - 1819, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ - 375, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ - 374, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ - 916, /* GL_MAX_TEXTURE_COORDS */ - 918, /* GL_MAX_TEXTURE_IMAGE_UNITS */ - 1226, /* GL_PROGRAM_ERROR_STRING_ARB */ - 1228, /* GL_PROGRAM_FORMAT_ASCII_ARB */ - 1227, /* GL_PROGRAM_FORMAT_ARB */ - 1727, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ - 353, /* GL_DEPTH_BOUNDS_TEST_EXT */ - 352, /* GL_DEPTH_BOUNDS_EXT */ + 1292, /* GL_QUERY_RESULT */ + 1294, /* GL_QUERY_RESULT_AVAILABLE */ + 940, /* GL_MAX_VERTEX_ATTRIBS */ + 1838, /* GL_VERTEX_ATTRIB_ARRAY_NORMALIZED */ + 377, /* GL_DEPTH_STENCIL_TO_RGBA_NV */ + 376, /* GL_DEPTH_STENCIL_TO_BGRA_NV */ + 926, /* GL_MAX_TEXTURE_COORDS */ + 928, /* GL_MAX_TEXTURE_IMAGE_UNITS */ + 1236, /* GL_PROGRAM_ERROR_STRING_ARB */ + 1238, /* GL_PROGRAM_FORMAT_ASCII_ARB */ + 1237, /* GL_PROGRAM_FORMAT_ARB */ + 1745, /* GL_TEXTURE_UNSIGNED_REMAP_MODE_NV */ + 354, /* GL_DEPTH_BOUNDS_TEST_EXT */ + 353, /* GL_DEPTH_BOUNDS_EXT */ 53, /* GL_ARRAY_BUFFER */ - 461, /* GL_ELEMENT_ARRAY_BUFFER */ + 464, /* GL_ELEMENT_ARRAY_BUFFER */ 54, /* GL_ARRAY_BUFFER_BINDING */ - 462, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ - 1793, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ - 1017, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ + 465, /* GL_ELEMENT_ARRAY_BUFFER_BINDING */ + 1812, /* GL_VERTEX_ARRAY_BUFFER_BINDING */ + 1027, /* GL_NORMAL_ARRAY_BUFFER_BINDING */ 149, /* GL_COLOR_ARRAY_BUFFER_BINDING */ - 625, /* GL_INDEX_ARRAY_BUFFER_BINDING */ - 1656, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ - 457, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ - 1403, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ - 511, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ - 1846, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ - 1815, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ - 1229, /* GL_PROGRAM_INSTRUCTIONS_ARB */ - 890, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ - 1235, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - 899, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ - 1247, /* GL_PROGRAM_TEMPORARIES_ARB */ - 905, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ - 1237, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ - 901, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ - 1241, /* GL_PROGRAM_PARAMETERS_ARB */ - 904, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ - 1236, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ - 900, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ - 1222, /* GL_PROGRAM_ATTRIBS_ARB */ - 885, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ - 1234, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ - 898, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ - 1220, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ - 883, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ - 1232, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - 896, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ - 891, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ - 887, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ - 1250, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ - 1740, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ - 1293, /* GL_READ_ONLY */ - 1854, /* GL_WRITE_ONLY */ - 1295, /* GL_READ_WRITE */ + 632, /* GL_INDEX_ARRAY_BUFFER_BINDING */ + 1673, /* GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING */ + 460, /* GL_EDGE_FLAG_ARRAY_BUFFER_BINDING */ + 1416, /* GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING */ + 514, /* GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING */ + 1865, /* GL_WEIGHT_ARRAY_BUFFER_BINDING */ + 1834, /* GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING */ + 1239, /* GL_PROGRAM_INSTRUCTIONS_ARB */ + 898, /* GL_MAX_PROGRAM_INSTRUCTIONS_ARB */ + 1245, /* GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + 907, /* GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB */ + 1257, /* GL_PROGRAM_TEMPORARIES_ARB */ + 913, /* GL_MAX_PROGRAM_TEMPORARIES_ARB */ + 1247, /* GL_PROGRAM_NATIVE_TEMPORARIES_ARB */ + 909, /* GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB */ + 1251, /* GL_PROGRAM_PARAMETERS_ARB */ + 912, /* GL_MAX_PROGRAM_PARAMETERS_ARB */ + 1246, /* GL_PROGRAM_NATIVE_PARAMETERS_ARB */ + 908, /* GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB */ + 1232, /* GL_PROGRAM_ATTRIBS_ARB */ + 893, /* GL_MAX_PROGRAM_ATTRIBS_ARB */ + 1244, /* GL_PROGRAM_NATIVE_ATTRIBS_ARB */ + 906, /* GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB */ + 1230, /* GL_PROGRAM_ADDRESS_REGISTERS_ARB */ + 891, /* GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB */ + 1242, /* GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + 904, /* GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB */ + 899, /* GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB */ + 895, /* GL_MAX_PROGRAM_ENV_PARAMETERS_ARB */ + 1260, /* GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB */ + 1758, /* GL_TRANSPOSE_CURRENT_MATRIX_ARB */ + 1304, /* GL_READ_ONLY */ + 1873, /* GL_WRITE_ONLY */ + 1306, /* GL_READ_WRITE */ 102, /* GL_BUFFER_ACCESS */ 105, /* GL_BUFFER_MAPPED */ 107, /* GL_BUFFER_MAP_POINTER */ - 1734, /* GL_TIME_ELAPSED_EXT */ - 801, /* GL_MATRIX0_ARB */ - 813, /* GL_MATRIX1_ARB */ - 825, /* GL_MATRIX2_ARB */ - 829, /* GL_MATRIX3_ARB */ - 831, /* GL_MATRIX4_ARB */ - 833, /* GL_MATRIX5_ARB */ - 835, /* GL_MATRIX6_ARB */ - 837, /* GL_MATRIX7_ARB */ - 839, /* GL_MATRIX8_ARB */ - 840, /* GL_MATRIX9_ARB */ - 803, /* GL_MATRIX10_ARB */ - 804, /* GL_MATRIX11_ARB */ - 805, /* GL_MATRIX12_ARB */ - 806, /* GL_MATRIX13_ARB */ - 807, /* GL_MATRIX14_ARB */ - 808, /* GL_MATRIX15_ARB */ - 809, /* GL_MATRIX16_ARB */ - 810, /* GL_MATRIX17_ARB */ - 811, /* GL_MATRIX18_ARB */ - 812, /* GL_MATRIX19_ARB */ - 815, /* GL_MATRIX20_ARB */ - 816, /* GL_MATRIX21_ARB */ - 817, /* GL_MATRIX22_ARB */ - 818, /* GL_MATRIX23_ARB */ - 819, /* GL_MATRIX24_ARB */ - 820, /* GL_MATRIX25_ARB */ - 821, /* GL_MATRIX26_ARB */ - 822, /* GL_MATRIX27_ARB */ - 823, /* GL_MATRIX28_ARB */ - 824, /* GL_MATRIX29_ARB */ - 827, /* GL_MATRIX30_ARB */ - 828, /* GL_MATRIX31_ARB */ - 1523, /* GL_STREAM_DRAW */ - 1525, /* GL_STREAM_READ */ - 1521, /* GL_STREAM_COPY */ - 1481, /* GL_STATIC_DRAW */ - 1483, /* GL_STATIC_READ */ - 1479, /* GL_STATIC_COPY */ - 451, /* GL_DYNAMIC_DRAW */ - 453, /* GL_DYNAMIC_READ */ - 449, /* GL_DYNAMIC_COPY */ - 1123, /* GL_PIXEL_PACK_BUFFER */ - 1127, /* GL_PIXEL_UNPACK_BUFFER */ - 1124, /* GL_PIXEL_PACK_BUFFER_BINDING */ - 1128, /* GL_PIXEL_UNPACK_BUFFER_BINDING */ + 1752, /* GL_TIME_ELAPSED_EXT */ + 808, /* GL_MATRIX0_ARB */ + 820, /* GL_MATRIX1_ARB */ + 832, /* GL_MATRIX2_ARB */ + 836, /* GL_MATRIX3_ARB */ + 838, /* GL_MATRIX4_ARB */ + 840, /* GL_MATRIX5_ARB */ + 842, /* GL_MATRIX6_ARB */ + 844, /* GL_MATRIX7_ARB */ + 846, /* GL_MATRIX8_ARB */ + 847, /* GL_MATRIX9_ARB */ + 810, /* GL_MATRIX10_ARB */ + 811, /* GL_MATRIX11_ARB */ + 812, /* GL_MATRIX12_ARB */ + 813, /* GL_MATRIX13_ARB */ + 814, /* GL_MATRIX14_ARB */ + 815, /* GL_MATRIX15_ARB */ + 816, /* GL_MATRIX16_ARB */ + 817, /* GL_MATRIX17_ARB */ + 818, /* GL_MATRIX18_ARB */ + 819, /* GL_MATRIX19_ARB */ + 822, /* GL_MATRIX20_ARB */ + 823, /* GL_MATRIX21_ARB */ + 824, /* GL_MATRIX22_ARB */ + 825, /* GL_MATRIX23_ARB */ + 826, /* GL_MATRIX24_ARB */ + 827, /* GL_MATRIX25_ARB */ + 828, /* GL_MATRIX26_ARB */ + 829, /* GL_MATRIX27_ARB */ + 830, /* GL_MATRIX28_ARB */ + 831, /* GL_MATRIX29_ARB */ + 834, /* GL_MATRIX30_ARB */ + 835, /* GL_MATRIX31_ARB */ + 1540, /* GL_STREAM_DRAW */ + 1542, /* GL_STREAM_READ */ + 1538, /* GL_STREAM_COPY */ + 1494, /* GL_STATIC_DRAW */ + 1496, /* GL_STATIC_READ */ + 1492, /* GL_STATIC_COPY */ + 454, /* GL_DYNAMIC_DRAW */ + 456, /* GL_DYNAMIC_READ */ + 452, /* GL_DYNAMIC_COPY */ + 1133, /* GL_PIXEL_PACK_BUFFER */ + 1137, /* GL_PIXEL_UNPACK_BUFFER */ + 1134, /* GL_PIXEL_PACK_BUFFER_BINDING */ + 1138, /* GL_PIXEL_UNPACK_BUFFER_BINDING */ 347, /* GL_DEPTH24_STENCIL8 */ - 1724, /* GL_TEXTURE_STENCIL_SIZE */ - 1676, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */ - 886, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ - 889, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ - 893, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ - 892, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ - 850, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ - 1514, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ + 1741, /* GL_TEXTURE_STENCIL_SIZE */ + 1693, /* GL_TEXTURE_CUBE_MAP_SEAMLESS */ + 894, /* GL_MAX_PROGRAM_CALL_DEPTH_NV */ + 897, /* GL_MAX_PROGRAM_IF_DEPTH_NV */ + 901, /* GL_MAX_PROGRAM_LOOP_DEPTH_NV */ + 900, /* GL_MAX_PROGRAM_LOOP_COUNT_NV */ + 857, /* GL_MAX_ARRAY_TEXTURE_LAYERS_EXT */ + 1531, /* GL_STENCIL_TEST_TWO_SIDE_EXT */ 17, /* GL_ACTIVE_STENCIL_FACE_EXT */ - 951, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ - 1384, /* GL_SAMPLES_PASSED */ + 961, /* GL_MIRROR_CLAMP_TO_BORDER_EXT */ + 1397, /* GL_SAMPLES_PASSED */ 109, /* GL_BUFFER_SERIALIZED_MODIFY_APPLE */ 104, /* GL_BUFFER_FLUSHING_UNMAP_APPLE */ - 534, /* GL_FRAGMENT_SHADER */ - 1839, /* GL_VERTEX_SHADER */ - 1240, /* GL_PROGRAM_OBJECT_ARB */ - 1416, /* GL_SHADER_OBJECT_ARB */ - 874, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ - 934, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ - 928, /* GL_MAX_VARYING_FLOATS */ - 932, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ - 859, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ - 1043, /* GL_OBJECT_TYPE_ARB */ - 1418, /* GL_SHADER_TYPE */ - 499, /* GL_FLOAT_VEC2 */ - 501, /* GL_FLOAT_VEC3 */ - 503, /* GL_FLOAT_VEC4 */ - 652, /* GL_INT_VEC2 */ - 654, /* GL_INT_VEC3 */ - 656, /* GL_INT_VEC4 */ + 537, /* GL_FRAGMENT_SHADER */ + 1858, /* GL_VERTEX_SHADER */ + 1250, /* GL_PROGRAM_OBJECT_ARB */ + 1429, /* GL_SHADER_OBJECT_ARB */ + 882, /* GL_MAX_FRAGMENT_UNIFORM_COMPONENTS */ + 944, /* GL_MAX_VERTEX_UNIFORM_COMPONENTS */ + 938, /* GL_MAX_VARYING_FLOATS */ + 942, /* GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS */ + 867, /* GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS */ + 1053, /* GL_OBJECT_TYPE_ARB */ + 1431, /* GL_SHADER_TYPE */ + 502, /* GL_FLOAT_VEC2 */ + 504, /* GL_FLOAT_VEC3 */ + 506, /* GL_FLOAT_VEC4 */ + 659, /* GL_INT_VEC2 */ + 661, /* GL_INT_VEC3 */ + 663, /* GL_INT_VEC4 */ 94, /* GL_BOOL */ 96, /* GL_BOOL_VEC2 */ 98, /* GL_BOOL_VEC3 */ 100, /* GL_BOOL_VEC4 */ - 487, /* GL_FLOAT_MAT2 */ - 491, /* GL_FLOAT_MAT3 */ - 495, /* GL_FLOAT_MAT4 */ - 1375, /* GL_SAMPLER_1D */ - 1377, /* GL_SAMPLER_2D */ - 1379, /* GL_SAMPLER_3D */ - 1380, /* GL_SAMPLER_CUBE */ - 1376, /* GL_SAMPLER_1D_SHADOW */ - 1378, /* GL_SAMPLER_2D_SHADOW */ - 489, /* GL_FLOAT_MAT2x3 */ - 490, /* GL_FLOAT_MAT2x4 */ - 493, /* GL_FLOAT_MAT3x2 */ - 494, /* GL_FLOAT_MAT3x4 */ - 497, /* GL_FLOAT_MAT4x2 */ - 498, /* GL_FLOAT_MAT4x3 */ + 490, /* GL_FLOAT_MAT2 */ + 494, /* GL_FLOAT_MAT3 */ + 498, /* GL_FLOAT_MAT4 */ + 1388, /* GL_SAMPLER_1D */ + 1390, /* GL_SAMPLER_2D */ + 1392, /* GL_SAMPLER_3D */ + 1393, /* GL_SAMPLER_CUBE */ + 1389, /* GL_SAMPLER_1D_SHADOW */ + 1391, /* GL_SAMPLER_2D_SHADOW */ + 492, /* GL_FLOAT_MAT2x3 */ + 493, /* GL_FLOAT_MAT2x4 */ + 496, /* GL_FLOAT_MAT3x2 */ + 497, /* GL_FLOAT_MAT3x4 */ + 500, /* GL_FLOAT_MAT4x2 */ + 501, /* GL_FLOAT_MAT4x3 */ 345, /* GL_DELETE_STATUS */ 246, /* GL_COMPILE_STATUS */ - 708, /* GL_LINK_STATUS */ - 1787, /* GL_VALIDATE_STATUS */ - 637, /* GL_INFO_LOG_LENGTH */ + 715, /* GL_LINK_STATUS */ + 1806, /* GL_VALIDATE_STATUS */ + 644, /* GL_INFO_LOG_LENGTH */ 56, /* GL_ATTACHED_SHADERS */ 20, /* GL_ACTIVE_UNIFORMS */ 21, /* GL_ACTIVE_UNIFORM_MAX_LENGTH */ - 1417, /* GL_SHADER_SOURCE_LENGTH */ + 1430, /* GL_SHADER_SOURCE_LENGTH */ 15, /* GL_ACTIVE_ATTRIBUTES */ 16, /* GL_ACTIVE_ATTRIBUTE_MAX_LENGTH */ - 536, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ - 1420, /* GL_SHADING_LANGUAGE_VERSION */ + 539, /* GL_FRAGMENT_SHADER_DERIVATIVE_HINT */ + 1433, /* GL_SHADING_LANGUAGE_VERSION */ 322, /* GL_CURRENT_PROGRAM */ - 1092, /* GL_PALETTE4_RGB8_OES */ - 1094, /* GL_PALETTE4_RGBA8_OES */ - 1090, /* GL_PALETTE4_R5_G6_B5_OES */ - 1093, /* GL_PALETTE4_RGBA4_OES */ - 1091, /* GL_PALETTE4_RGB5_A1_OES */ - 1097, /* GL_PALETTE8_RGB8_OES */ - 1099, /* GL_PALETTE8_RGBA8_OES */ - 1095, /* GL_PALETTE8_R5_G6_B5_OES */ - 1098, /* GL_PALETTE8_RGBA4_OES */ - 1096, /* GL_PALETTE8_RGB5_A1_OES */ - 619, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ - 618, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ - 1772, /* GL_UNSIGNED_NORMALIZED */ - 1611, /* GL_TEXTURE_1D_ARRAY_EXT */ - 1262, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ - 1613, /* GL_TEXTURE_2D_ARRAY_EXT */ - 1265, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ - 1619, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ - 1621, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ - 1473, /* GL_SRGB */ - 1474, /* GL_SRGB8 */ - 1476, /* GL_SRGB_ALPHA */ - 1475, /* GL_SRGB8_ALPHA8 */ - 1433, /* GL_SLUMINANCE_ALPHA */ - 1432, /* GL_SLUMINANCE8_ALPHA8 */ - 1430, /* GL_SLUMINANCE */ - 1431, /* GL_SLUMINANCE8 */ + 1102, /* GL_PALETTE4_RGB8_OES */ + 1104, /* GL_PALETTE4_RGBA8_OES */ + 1100, /* GL_PALETTE4_R5_G6_B5_OES */ + 1103, /* GL_PALETTE4_RGBA4_OES */ + 1101, /* GL_PALETTE4_RGB5_A1_OES */ + 1107, /* GL_PALETTE8_RGB8_OES */ + 1109, /* GL_PALETTE8_RGBA8_OES */ + 1105, /* GL_PALETTE8_R5_G6_B5_OES */ + 1108, /* GL_PALETTE8_RGBA4_OES */ + 1106, /* GL_PALETTE8_RGB5_A1_OES */ + 626, /* GL_IMPLEMENTATION_COLOR_READ_TYPE_OES */ + 625, /* GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES */ + 1791, /* GL_UNSIGNED_NORMALIZED */ + 1628, /* GL_TEXTURE_1D_ARRAY_EXT */ + 1272, /* GL_PROXY_TEXTURE_1D_ARRAY_EXT */ + 1630, /* GL_TEXTURE_2D_ARRAY_EXT */ + 1275, /* GL_PROXY_TEXTURE_2D_ARRAY_EXT */ + 1636, /* GL_TEXTURE_BINDING_1D_ARRAY_EXT */ + 1638, /* GL_TEXTURE_BINDING_2D_ARRAY_EXT */ + 1486, /* GL_SRGB */ + 1487, /* GL_SRGB8 */ + 1489, /* GL_SRGB_ALPHA */ + 1488, /* GL_SRGB8_ALPHA8 */ + 1446, /* GL_SLUMINANCE_ALPHA */ + 1445, /* GL_SLUMINANCE8_ALPHA8 */ + 1443, /* GL_SLUMINANCE */ + 1444, /* GL_SLUMINANCE8 */ 267, /* GL_COMPRESSED_SRGB */ 268, /* GL_COMPRESSED_SRGB_ALPHA */ 265, /* GL_COMPRESSED_SLUMINANCE */ 266, /* GL_COMPRESSED_SLUMINANCE_ALPHA */ - 1157, /* GL_POINT_SPRITE_COORD_ORIGIN */ - 716, /* GL_LOWER_LEFT */ - 1784, /* GL_UPPER_LEFT */ - 1496, /* GL_STENCIL_BACK_REF */ - 1497, /* GL_STENCIL_BACK_VALUE_MASK */ - 1498, /* GL_STENCIL_BACK_WRITEMASK */ - 442, /* GL_DRAW_FRAMEBUFFER_BINDING_EXT */ - 1309, /* GL_RENDERBUFFER_BINDING_EXT */ - 1290, /* GL_READ_FRAMEBUFFER */ - 441, /* GL_DRAW_FRAMEBUFFER */ - 1291, /* GL_READ_FRAMEBUFFER_BINDING_EXT */ - 1319, /* GL_RENDERBUFFER_SAMPLES */ - 546, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ - 544, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ - 555, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ - 551, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ - 553, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ - 558, /* GL_FRAMEBUFFER_COMPLETE */ - 562, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ - 568, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ - 566, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ - 564, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ - 567, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ - 565, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT */ - 571, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT */ - 574, /* GL_FRAMEBUFFER_UNSUPPORTED */ - 572, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ - 856, /* GL_MAX_COLOR_ATTACHMENTS_EXT */ + 1167, /* GL_POINT_SPRITE_COORD_ORIGIN */ + 723, /* GL_LOWER_LEFT */ + 1803, /* GL_UPPER_LEFT */ + 1509, /* GL_STENCIL_BACK_REF */ + 1510, /* GL_STENCIL_BACK_VALUE_MASK */ + 1511, /* GL_STENCIL_BACK_WRITEMASK */ + 444, /* GL_DRAW_FRAMEBUFFER_BINDING */ + 1320, /* GL_RENDERBUFFER_BINDING */ + 1300, /* GL_READ_FRAMEBUFFER */ + 443, /* GL_DRAW_FRAMEBUFFER */ + 1301, /* GL_READ_FRAMEBUFFER_BINDING */ + 1331, /* GL_RENDERBUFFER_SAMPLES */ + 549, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE */ + 547, /* GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME */ + 558, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL */ + 554, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE */ + 556, /* GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER */ + 562, /* GL_FRAMEBUFFER_COMPLETE */ + 566, /* GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT */ + 573, /* GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT */ + 571, /* GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT */ + 568, /* GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT */ + 572, /* GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT */ + 569, /* GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER */ + 577, /* GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER */ + 581, /* GL_FRAMEBUFFER_UNSUPPORTED */ + 579, /* GL_FRAMEBUFFER_STATUS_ERROR_EXT */ + 863, /* GL_MAX_COLOR_ATTACHMENTS */ 155, /* GL_COLOR_ATTACHMENT0 */ 157, /* GL_COLOR_ATTACHMENT1 */ 171, /* GL_COLOR_ATTACHMENT2 */ @@ -5064,57 +5102,57 @@ static const unsigned reduced_enums[1347] = 164, /* GL_COLOR_ATTACHMENT13 */ 166, /* GL_COLOR_ATTACHMENT14 */ 168, /* GL_COLOR_ATTACHMENT15 */ - 348, /* GL_DEPTH_ATTACHMENT */ - 1486, /* GL_STENCIL_ATTACHMENT */ - 537, /* GL_FRAMEBUFFER */ - 1307, /* GL_RENDERBUFFER */ - 1321, /* GL_RENDERBUFFER_WIDTH */ - 1314, /* GL_RENDERBUFFER_HEIGHT */ - 1316, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ - 1509, /* GL_STENCIL_INDEX_EXT */ - 1506, /* GL_STENCIL_INDEX1_EXT */ - 1507, /* GL_STENCIL_INDEX4_EXT */ - 1508, /* GL_STENCIL_INDEX8_EXT */ - 1505, /* GL_STENCIL_INDEX16_EXT */ - 1318, /* GL_RENDERBUFFER_RED_SIZE */ - 1313, /* GL_RENDERBUFFER_GREEN_SIZE */ - 1310, /* GL_RENDERBUFFER_BLUE_SIZE */ - 1308, /* GL_RENDERBUFFER_ALPHA_SIZE */ - 1311, /* GL_RENDERBUFFER_DEPTH_SIZE */ - 1320, /* GL_RENDERBUFFER_STENCIL_SIZE */ - 570, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ - 912, /* GL_MAX_SAMPLES */ - 1276, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */ - 483, /* GL_FIRST_VERTEX_CONVENTION */ - 667, /* GL_LAST_VERTEX_CONVENTION */ - 1254, /* GL_PROVOKING_VERTEX */ + 349, /* GL_DEPTH_ATTACHMENT */ + 1499, /* GL_STENCIL_ATTACHMENT */ + 540, /* GL_FRAMEBUFFER */ + 1318, /* GL_RENDERBUFFER */ + 1334, /* GL_RENDERBUFFER_WIDTH */ + 1326, /* GL_RENDERBUFFER_HEIGHT */ + 1328, /* GL_RENDERBUFFER_INTERNAL_FORMAT */ + 1526, /* GL_STENCIL_INDEX_EXT */ + 1518, /* GL_STENCIL_INDEX1 */ + 1522, /* GL_STENCIL_INDEX4 */ + 1524, /* GL_STENCIL_INDEX8 */ + 1519, /* GL_STENCIL_INDEX16 */ + 1330, /* GL_RENDERBUFFER_RED_SIZE */ + 1325, /* GL_RENDERBUFFER_GREEN_SIZE */ + 1322, /* GL_RENDERBUFFER_BLUE_SIZE */ + 1319, /* GL_RENDERBUFFER_ALPHA_SIZE */ + 1323, /* GL_RENDERBUFFER_DEPTH_SIZE */ + 1333, /* GL_RENDERBUFFER_STENCIL_SIZE */ + 575, /* GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE */ + 921, /* GL_MAX_SAMPLES */ + 1286, /* GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION */ + 486, /* GL_FIRST_VERTEX_CONVENTION */ + 674, /* GL_LAST_VERTEX_CONVENTION */ + 1264, /* GL_PROVOKING_VERTEX */ 302, /* GL_COPY_READ_BUFFER */ 303, /* GL_COPY_WRITE_BUFFER */ - 1368, /* GL_RGBA_SNORM */ - 1364, /* GL_RGBA8_SNORM */ - 1426, /* GL_SIGNED_NORMALIZED */ - 913, /* GL_MAX_SERVER_WAIT_TIMEOUT */ - 1042, /* GL_OBJECT_TYPE */ - 1530, /* GL_SYNC_CONDITION */ - 1535, /* GL_SYNC_STATUS */ - 1532, /* GL_SYNC_FLAGS */ - 1531, /* GL_SYNC_FENCE */ - 1534, /* GL_SYNC_GPU_COMMANDS_COMPLETE */ - 1761, /* GL_UNSIGNALED */ - 1425, /* GL_SIGNALED */ + 1381, /* GL_RGBA_SNORM */ + 1377, /* GL_RGBA8_SNORM */ + 1439, /* GL_SIGNED_NORMALIZED */ + 923, /* GL_MAX_SERVER_WAIT_TIMEOUT */ + 1052, /* GL_OBJECT_TYPE */ + 1547, /* GL_SYNC_CONDITION */ + 1552, /* GL_SYNC_STATUS */ + 1549, /* GL_SYNC_FLAGS */ + 1548, /* GL_SYNC_FENCE */ + 1551, /* GL_SYNC_GPU_COMMANDS_COMPLETE */ + 1779, /* GL_UNSIGNALED */ + 1438, /* GL_SIGNALED */ 46, /* GL_ALREADY_SIGNALED */ - 1732, /* GL_TIMEOUT_EXPIRED */ + 1750, /* GL_TIMEOUT_EXPIRED */ 270, /* GL_CONDITION_SATISFIED */ - 1844, /* GL_WAIT_FAILED */ - 468, /* GL_EVAL_BIT */ - 1288, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ - 710, /* GL_LIST_BIT */ - 1627, /* GL_TEXTURE_BIT */ - 1399, /* GL_SCISSOR_BIT */ + 1863, /* GL_WAIT_FAILED */ + 471, /* GL_EVAL_BIT */ + 1298, /* GL_RASTER_POSITION_UNCLIPPED_IBM */ + 717, /* GL_LIST_BIT */ + 1644, /* GL_TEXTURE_BIT */ + 1412, /* GL_SCISSOR_BIT */ 29, /* GL_ALL_ATTRIB_BITS */ - 998, /* GL_MULTISAMPLE_BIT */ + 1008, /* GL_MULTISAMPLE_BIT */ 30, /* GL_ALL_CLIENT_ATTRIB_BITS */ - 1733, /* GL_TIMEOUT_IGNORED */ + 1751, /* GL_TIMEOUT_IGNORED */ }; typedef int (*cfunc)(const void *, const void *); diff --git a/src/mesa/main/remap_helper.h b/src/mesa/main/remap_helper.h index 3886f41862..c80a524b4f 100644 --- a/src/mesa/main/remap_helper.h +++ b/src/mesa/main/remap_helper.h @@ -1584,2742 +1584,2743 @@ static const char _mesa_function_pool[] = "ip\0" "glDeleteFencesNV\0" "\0" - /* _mesa_function_pool[10713]: DepthMask (offset 211) */ + /* _mesa_function_pool[10713]: DeformationMap3dSGIX (dynamic) */ + "iddiiddiiddiip\0" + "glDeformationMap3dSGIX\0" + "\0" + /* _mesa_function_pool[10752]: DepthMask (offset 211) */ "i\0" "glDepthMask\0" "\0" - /* _mesa_function_pool[10728]: IsShader (will be remapped) */ + /* _mesa_function_pool[10767]: IsShader (will be remapped) */ "i\0" "glIsShader\0" "\0" - /* _mesa_function_pool[10742]: Indexf (offset 46) */ + /* _mesa_function_pool[10781]: Indexf (offset 46) */ "f\0" "glIndexf\0" "\0" - /* _mesa_function_pool[10754]: GetImageTransformParameterivHP (dynamic) */ + /* _mesa_function_pool[10793]: GetImageTransformParameterivHP (dynamic) */ "iip\0" "glGetImageTransformParameterivHP\0" "\0" - /* _mesa_function_pool[10792]: Indexd (offset 44) */ + /* _mesa_function_pool[10831]: Indexd (offset 44) */ "d\0" "glIndexd\0" "\0" - /* _mesa_function_pool[10804]: GetMaterialiv (offset 270) */ + /* _mesa_function_pool[10843]: GetMaterialiv (offset 270) */ "iip\0" "glGetMaterialiv\0" "\0" - /* _mesa_function_pool[10825]: StencilOp (offset 244) */ + /* _mesa_function_pool[10864]: StencilOp (offset 244) */ "iii\0" "glStencilOp\0" "\0" - /* _mesa_function_pool[10842]: WindowPos4ivMESA (will be remapped) */ + /* _mesa_function_pool[10881]: WindowPos4ivMESA (will be remapped) */ "p\0" "glWindowPos4ivMESA\0" "\0" - /* _mesa_function_pool[10864]: MultiTexCoord3svARB (offset 399) */ + /* _mesa_function_pool[10903]: MultiTexCoord3svARB (offset 399) */ "ip\0" "glMultiTexCoord3sv\0" "glMultiTexCoord3svARB\0" "\0" - /* _mesa_function_pool[10909]: TexEnvfv (offset 185) */ + /* _mesa_function_pool[10948]: TexEnvfv (offset 185) */ "iip\0" "glTexEnvfv\0" "\0" - /* _mesa_function_pool[10925]: MultiTexCoord4iARB (offset 404) */ + /* _mesa_function_pool[10964]: MultiTexCoord4iARB (offset 404) */ "iiiii\0" "glMultiTexCoord4i\0" "glMultiTexCoord4iARB\0" "\0" - /* _mesa_function_pool[10971]: Indexs (offset 50) */ + /* _mesa_function_pool[11010]: Indexs (offset 50) */ "i\0" "glIndexs\0" "\0" - /* _mesa_function_pool[10983]: Binormal3ivEXT (dynamic) */ + /* _mesa_function_pool[11022]: Binormal3ivEXT (dynamic) */ "p\0" "glBinormal3ivEXT\0" "\0" - /* _mesa_function_pool[11003]: ResizeBuffersMESA (will be remapped) */ + /* _mesa_function_pool[11042]: ResizeBuffersMESA (will be remapped) */ "\0" "glResizeBuffersMESA\0" "\0" - /* _mesa_function_pool[11025]: GetUniformivARB (will be remapped) */ + /* _mesa_function_pool[11064]: GetUniformivARB (will be remapped) */ "iip\0" "glGetUniformiv\0" "glGetUniformivARB\0" "\0" - /* _mesa_function_pool[11063]: PixelTexGenParameteriSGIS (will be remapped) */ + /* _mesa_function_pool[11102]: PixelTexGenParameteriSGIS (will be remapped) */ "ii\0" "glPixelTexGenParameteriSGIS\0" "\0" - /* _mesa_function_pool[11095]: VertexPointervINTEL (dynamic) */ + /* _mesa_function_pool[11134]: VertexPointervINTEL (dynamic) */ "iip\0" "glVertexPointervINTEL\0" "\0" - /* _mesa_function_pool[11122]: Vertex2i (offset 130) */ + /* _mesa_function_pool[11161]: Vertex2i (offset 130) */ "ii\0" "glVertex2i\0" "\0" - /* _mesa_function_pool[11137]: LoadMatrixf (offset 291) */ + /* _mesa_function_pool[11176]: LoadMatrixf (offset 291) */ "p\0" "glLoadMatrixf\0" "\0" - /* _mesa_function_pool[11154]: Vertex2f (offset 128) */ + /* _mesa_function_pool[11193]: Vertex2f (offset 128) */ "ff\0" "glVertex2f\0" "\0" - /* _mesa_function_pool[11169]: ReplacementCodeuiColor4fNormal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[11208]: ReplacementCodeuiColor4fNormal3fVertex3fvSUN (dynamic) */ "pppp\0" "glReplacementCodeuiColor4fNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[11222]: Color4bv (offset 26) */ + /* _mesa_function_pool[11261]: Color4bv (offset 26) */ "p\0" "glColor4bv\0" "\0" - /* _mesa_function_pool[11236]: VertexPointer (offset 321) */ + /* _mesa_function_pool[11275]: VertexPointer (offset 321) */ "iiip\0" "glVertexPointer\0" "\0" - /* _mesa_function_pool[11258]: SecondaryColor3uiEXT (will be remapped) */ + /* _mesa_function_pool[11297]: SecondaryColor3uiEXT (will be remapped) */ "iii\0" "glSecondaryColor3ui\0" "glSecondaryColor3uiEXT\0" "\0" - /* _mesa_function_pool[11306]: StartInstrumentsSGIX (dynamic) */ + /* _mesa_function_pool[11345]: StartInstrumentsSGIX (dynamic) */ "\0" "glStartInstrumentsSGIX\0" "\0" - /* _mesa_function_pool[11331]: SecondaryColor3usvEXT (will be remapped) */ + /* _mesa_function_pool[11370]: SecondaryColor3usvEXT (will be remapped) */ "p\0" "glSecondaryColor3usv\0" "glSecondaryColor3usvEXT\0" "\0" - /* _mesa_function_pool[11379]: VertexAttrib2fvNV (will be remapped) */ + /* _mesa_function_pool[11418]: VertexAttrib2fvNV (will be remapped) */ "ip\0" "glVertexAttrib2fvNV\0" "\0" - /* _mesa_function_pool[11403]: ProgramLocalParameter4dvARB (will be remapped) */ + /* _mesa_function_pool[11442]: ProgramLocalParameter4dvARB (will be remapped) */ "iip\0" "glProgramLocalParameter4dvARB\0" "\0" - /* _mesa_function_pool[11438]: DeleteLists (offset 4) */ + /* _mesa_function_pool[11477]: DeleteLists (offset 4) */ "ii\0" "glDeleteLists\0" "\0" - /* _mesa_function_pool[11456]: LogicOp (offset 242) */ + /* _mesa_function_pool[11495]: LogicOp (offset 242) */ "i\0" "glLogicOp\0" "\0" - /* _mesa_function_pool[11469]: MatrixIndexuivARB (dynamic) */ + /* _mesa_function_pool[11508]: MatrixIndexuivARB (dynamic) */ "ip\0" "glMatrixIndexuivARB\0" "\0" - /* _mesa_function_pool[11493]: Vertex2s (offset 132) */ + /* _mesa_function_pool[11532]: Vertex2s (offset 132) */ "ii\0" "glVertex2s\0" "\0" - /* _mesa_function_pool[11508]: RenderbufferStorageMultisample (will be remapped) */ + /* _mesa_function_pool[11547]: RenderbufferStorageMultisample (will be remapped) */ "iiiii\0" "glRenderbufferStorageMultisample\0" + "glRenderbufferStorageMultisampleEXT\0" "\0" - /* _mesa_function_pool[11548]: TexCoord4fv (offset 121) */ + /* _mesa_function_pool[11623]: TexCoord4fv (offset 121) */ "p\0" "glTexCoord4fv\0" "\0" - /* _mesa_function_pool[11565]: Tangent3sEXT (dynamic) */ + /* _mesa_function_pool[11640]: Tangent3sEXT (dynamic) */ "iii\0" "glTangent3sEXT\0" "\0" - /* _mesa_function_pool[11585]: GlobalAlphaFactorfSUN (dynamic) */ + /* _mesa_function_pool[11660]: GlobalAlphaFactorfSUN (dynamic) */ "f\0" "glGlobalAlphaFactorfSUN\0" "\0" - /* _mesa_function_pool[11612]: MultiTexCoord3iARB (offset 396) */ + /* _mesa_function_pool[11687]: MultiTexCoord3iARB (offset 396) */ "iiii\0" "glMultiTexCoord3i\0" "glMultiTexCoord3iARB\0" "\0" - /* _mesa_function_pool[11657]: IsProgram (will be remapped) */ + /* _mesa_function_pool[11732]: IsProgram (will be remapped) */ "i\0" "glIsProgram\0" "\0" - /* _mesa_function_pool[11672]: TexCoordPointerListIBM (dynamic) */ + /* _mesa_function_pool[11747]: TexCoordPointerListIBM (dynamic) */ "iiipi\0" "glTexCoordPointerListIBM\0" "\0" - /* _mesa_function_pool[11704]: GlobalAlphaFactorusSUN (dynamic) */ + /* _mesa_function_pool[11779]: GlobalAlphaFactorusSUN (dynamic) */ "i\0" "glGlobalAlphaFactorusSUN\0" "\0" - /* _mesa_function_pool[11732]: VertexAttrib2dvNV (will be remapped) */ + /* _mesa_function_pool[11807]: VertexAttrib2dvNV (will be remapped) */ "ip\0" "glVertexAttrib2dvNV\0" "\0" - /* _mesa_function_pool[11756]: FramebufferRenderbufferEXT (will be remapped) */ + /* _mesa_function_pool[11831]: FramebufferRenderbufferEXT (will be remapped) */ "iiii\0" "glFramebufferRenderbuffer\0" "glFramebufferRenderbufferEXT\0" "\0" - /* _mesa_function_pool[11817]: VertexAttrib1dvNV (will be remapped) */ + /* _mesa_function_pool[11892]: VertexAttrib1dvNV (will be remapped) */ "ip\0" "glVertexAttrib1dvNV\0" "\0" - /* _mesa_function_pool[11841]: GenTextures (offset 328) */ + /* _mesa_function_pool[11916]: GenTextures (offset 328) */ "ip\0" "glGenTextures\0" "glGenTexturesEXT\0" "\0" - /* _mesa_function_pool[11876]: SetFenceNV (will be remapped) */ + /* _mesa_function_pool[11951]: SetFenceNV (will be remapped) */ "ii\0" "glSetFenceNV\0" "\0" - /* _mesa_function_pool[11893]: FramebufferTexture1DEXT (will be remapped) */ + /* _mesa_function_pool[11968]: FramebufferTexture1DEXT (will be remapped) */ "iiiii\0" "glFramebufferTexture1D\0" "glFramebufferTexture1DEXT\0" "\0" - /* _mesa_function_pool[11949]: GetCombinerOutputParameterivNV (will be remapped) */ + /* _mesa_function_pool[12024]: GetCombinerOutputParameterivNV (will be remapped) */ "iiip\0" "glGetCombinerOutputParameterivNV\0" "\0" - /* _mesa_function_pool[11988]: MultiModeDrawArraysIBM (will be remapped) */ - "pppii\0" - "glMultiModeDrawArraysIBM\0" - "\0" - /* _mesa_function_pool[12020]: PixelTexGenParameterivSGIS (will be remapped) */ + /* _mesa_function_pool[12063]: PixelTexGenParameterivSGIS (will be remapped) */ "ip\0" "glPixelTexGenParameterivSGIS\0" "\0" - /* _mesa_function_pool[12053]: TextureNormalEXT (dynamic) */ + /* _mesa_function_pool[12096]: TextureNormalEXT (dynamic) */ "i\0" "glTextureNormalEXT\0" "\0" - /* _mesa_function_pool[12075]: IndexPointerListIBM (dynamic) */ + /* _mesa_function_pool[12118]: IndexPointerListIBM (dynamic) */ "iipi\0" "glIndexPointerListIBM\0" "\0" - /* _mesa_function_pool[12103]: WeightfvARB (dynamic) */ + /* _mesa_function_pool[12146]: WeightfvARB (dynamic) */ "ip\0" "glWeightfvARB\0" "\0" - /* _mesa_function_pool[12121]: RasterPos2sv (offset 69) */ + /* _mesa_function_pool[12164]: RasterPos2sv (offset 69) */ "p\0" "glRasterPos2sv\0" "\0" - /* _mesa_function_pool[12139]: Color4ubv (offset 36) */ + /* _mesa_function_pool[12182]: Color4ubv (offset 36) */ "p\0" "glColor4ubv\0" "\0" - /* _mesa_function_pool[12154]: DrawBuffer (offset 202) */ + /* _mesa_function_pool[12197]: DrawBuffer (offset 202) */ "i\0" "glDrawBuffer\0" "\0" - /* _mesa_function_pool[12170]: TexCoord2fv (offset 105) */ + /* _mesa_function_pool[12213]: TexCoord2fv (offset 105) */ "p\0" "glTexCoord2fv\0" "\0" - /* _mesa_function_pool[12187]: WindowPos4fMESA (will be remapped) */ + /* _mesa_function_pool[12230]: WindowPos4fMESA (will be remapped) */ "ffff\0" "glWindowPos4fMESA\0" "\0" - /* _mesa_function_pool[12211]: TexCoord1sv (offset 101) */ + /* _mesa_function_pool[12254]: TexCoord1sv (offset 101) */ "p\0" "glTexCoord1sv\0" "\0" - /* _mesa_function_pool[12228]: WindowPos3dvMESA (will be remapped) */ + /* _mesa_function_pool[12271]: WindowPos3dvMESA (will be remapped) */ "p\0" "glWindowPos3dv\0" "glWindowPos3dvARB\0" "glWindowPos3dvMESA\0" "\0" - /* _mesa_function_pool[12283]: DepthFunc (offset 245) */ + /* _mesa_function_pool[12326]: DepthFunc (offset 245) */ "i\0" "glDepthFunc\0" "\0" - /* _mesa_function_pool[12298]: PixelMapusv (offset 253) */ + /* _mesa_function_pool[12341]: PixelMapusv (offset 253) */ "iip\0" "glPixelMapusv\0" "\0" - /* _mesa_function_pool[12317]: GetQueryObjecti64vEXT (will be remapped) */ + /* _mesa_function_pool[12360]: GetQueryObjecti64vEXT (will be remapped) */ "iip\0" "glGetQueryObjecti64vEXT\0" "\0" - /* _mesa_function_pool[12346]: MultiTexCoord1dARB (offset 376) */ + /* _mesa_function_pool[12389]: MultiTexCoord1dARB (offset 376) */ "id\0" "glMultiTexCoord1d\0" "glMultiTexCoord1dARB\0" "\0" - /* _mesa_function_pool[12389]: PointParameterivNV (will be remapped) */ + /* _mesa_function_pool[12432]: PointParameterivNV (will be remapped) */ "ip\0" "glPointParameteriv\0" "glPointParameterivNV\0" "\0" - /* _mesa_function_pool[12433]: BlendFunc (offset 241) */ + /* _mesa_function_pool[12476]: BlendFunc (offset 241) */ "ii\0" "glBlendFunc\0" "\0" - /* _mesa_function_pool[12449]: Uniform2fvARB (will be remapped) */ + /* _mesa_function_pool[12492]: Uniform2fvARB (will be remapped) */ "iip\0" "glUniform2fv\0" "glUniform2fvARB\0" "\0" - /* _mesa_function_pool[12483]: BufferParameteriAPPLE (will be remapped) */ + /* _mesa_function_pool[12526]: BufferParameteriAPPLE (will be remapped) */ "iii\0" "glBufferParameteriAPPLE\0" "\0" - /* _mesa_function_pool[12512]: MultiTexCoord3dvARB (offset 393) */ + /* _mesa_function_pool[12555]: MultiTexCoord3dvARB (offset 393) */ "ip\0" "glMultiTexCoord3dv\0" "glMultiTexCoord3dvARB\0" "\0" - /* _mesa_function_pool[12557]: ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[12600]: ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (dynamic) */ "pppp\0" "glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[12613]: DeleteObjectARB (will be remapped) */ + /* _mesa_function_pool[12656]: DeleteObjectARB (will be remapped) */ "i\0" "glDeleteObjectARB\0" "\0" - /* _mesa_function_pool[12634]: MatrixIndexPointerARB (dynamic) */ + /* _mesa_function_pool[12677]: MatrixIndexPointerARB (dynamic) */ "iiip\0" "glMatrixIndexPointerARB\0" "\0" - /* _mesa_function_pool[12664]: ProgramNamedParameter4dvNV (will be remapped) */ + /* _mesa_function_pool[12707]: ProgramNamedParameter4dvNV (will be remapped) */ "iipp\0" "glProgramNamedParameter4dvNV\0" "\0" - /* _mesa_function_pool[12699]: Tangent3fvEXT (dynamic) */ + /* _mesa_function_pool[12742]: Tangent3fvEXT (dynamic) */ "p\0" "glTangent3fvEXT\0" "\0" - /* _mesa_function_pool[12718]: Flush (offset 217) */ + /* _mesa_function_pool[12761]: Flush (offset 217) */ "\0" "glFlush\0" "\0" - /* _mesa_function_pool[12728]: Color4uiv (offset 38) */ + /* _mesa_function_pool[12771]: Color4uiv (offset 38) */ "p\0" "glColor4uiv\0" "\0" - /* _mesa_function_pool[12743]: GenVertexArrays (will be remapped) */ + /* _mesa_function_pool[12786]: GenVertexArrays (will be remapped) */ "ip\0" "glGenVertexArrays\0" "\0" - /* _mesa_function_pool[12765]: RasterPos3sv (offset 77) */ + /* _mesa_function_pool[12808]: RasterPos3sv (offset 77) */ "p\0" "glRasterPos3sv\0" "\0" - /* _mesa_function_pool[12783]: BindFramebufferEXT (will be remapped) */ + /* _mesa_function_pool[12826]: BindFramebufferEXT (will be remapped) */ "ii\0" "glBindFramebuffer\0" "glBindFramebufferEXT\0" "\0" - /* _mesa_function_pool[12826]: ReferencePlaneSGIX (dynamic) */ + /* _mesa_function_pool[12869]: ReferencePlaneSGIX (dynamic) */ "p\0" "glReferencePlaneSGIX\0" "\0" - /* _mesa_function_pool[12850]: PushAttrib (offset 219) */ + /* _mesa_function_pool[12893]: PushAttrib (offset 219) */ "i\0" "glPushAttrib\0" "\0" - /* _mesa_function_pool[12866]: RasterPos2i (offset 66) */ + /* _mesa_function_pool[12909]: RasterPos2i (offset 66) */ "ii\0" "glRasterPos2i\0" "\0" - /* _mesa_function_pool[12884]: ValidateProgramARB (will be remapped) */ + /* _mesa_function_pool[12927]: ValidateProgramARB (will be remapped) */ "i\0" "glValidateProgram\0" "glValidateProgramARB\0" "\0" - /* _mesa_function_pool[12926]: TexParameteriv (offset 181) */ + /* _mesa_function_pool[12969]: TexParameteriv (offset 181) */ "iip\0" "glTexParameteriv\0" "\0" - /* _mesa_function_pool[12948]: UnlockArraysEXT (will be remapped) */ + /* _mesa_function_pool[12991]: UnlockArraysEXT (will be remapped) */ "\0" "glUnlockArraysEXT\0" "\0" - /* _mesa_function_pool[12968]: TexCoord2fColor3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[13011]: TexCoord2fColor3fVertex3fSUN (dynamic) */ "ffffffff\0" "glTexCoord2fColor3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[13009]: WindowPos3fvMESA (will be remapped) */ + /* _mesa_function_pool[13052]: WindowPos3fvMESA (will be remapped) */ "p\0" "glWindowPos3fv\0" "glWindowPos3fvARB\0" "glWindowPos3fvMESA\0" "\0" - /* _mesa_function_pool[13064]: RasterPos2f (offset 64) */ + /* _mesa_function_pool[13107]: RasterPos2f (offset 64) */ "ff\0" "glRasterPos2f\0" "\0" - /* _mesa_function_pool[13082]: VertexAttrib1svNV (will be remapped) */ + /* _mesa_function_pool[13125]: VertexAttrib1svNV (will be remapped) */ "ip\0" "glVertexAttrib1svNV\0" "\0" - /* _mesa_function_pool[13106]: RasterPos2d (offset 62) */ + /* _mesa_function_pool[13149]: RasterPos2d (offset 62) */ "dd\0" "glRasterPos2d\0" "\0" - /* _mesa_function_pool[13124]: RasterPos3fv (offset 73) */ + /* _mesa_function_pool[13167]: RasterPos3fv (offset 73) */ "p\0" "glRasterPos3fv\0" "\0" - /* _mesa_function_pool[13142]: CopyTexSubImage3D (offset 373) */ + /* _mesa_function_pool[13185]: CopyTexSubImage3D (offset 373) */ "iiiiiiiii\0" "glCopyTexSubImage3D\0" "glCopyTexSubImage3DEXT\0" "\0" - /* _mesa_function_pool[13196]: VertexAttrib2dARB (will be remapped) */ + /* _mesa_function_pool[13239]: VertexAttrib2dARB (will be remapped) */ "idd\0" "glVertexAttrib2d\0" "glVertexAttrib2dARB\0" "\0" - /* _mesa_function_pool[13238]: Color4ub (offset 35) */ + /* _mesa_function_pool[13281]: Color4ub (offset 35) */ "iiii\0" "glColor4ub\0" "\0" - /* _mesa_function_pool[13255]: GetInteger64v (will be remapped) */ + /* _mesa_function_pool[13298]: GetInteger64v (will be remapped) */ "ip\0" "glGetInteger64v\0" "\0" - /* _mesa_function_pool[13275]: TextureColorMaskSGIS (dynamic) */ + /* _mesa_function_pool[13318]: TextureColorMaskSGIS (dynamic) */ "iiii\0" "glTextureColorMaskSGIS\0" "\0" - /* _mesa_function_pool[13304]: RasterPos2s (offset 68) */ + /* _mesa_function_pool[13347]: RasterPos2s (offset 68) */ "ii\0" "glRasterPos2s\0" "\0" - /* _mesa_function_pool[13322]: GetColorTable (offset 343) */ + /* _mesa_function_pool[13365]: GetColorTable (offset 343) */ "iiip\0" "glGetColorTable\0" "glGetColorTableSGI\0" "glGetColorTableEXT\0" "\0" - /* _mesa_function_pool[13382]: SelectBuffer (offset 195) */ + /* _mesa_function_pool[13425]: SelectBuffer (offset 195) */ "ip\0" "glSelectBuffer\0" "\0" - /* _mesa_function_pool[13401]: Indexiv (offset 49) */ + /* _mesa_function_pool[13444]: Indexiv (offset 49) */ "p\0" "glIndexiv\0" "\0" - /* _mesa_function_pool[13414]: TexCoord3i (offset 114) */ + /* _mesa_function_pool[13457]: TexCoord3i (offset 114) */ "iii\0" "glTexCoord3i\0" "\0" - /* _mesa_function_pool[13432]: CopyColorTable (offset 342) */ + /* _mesa_function_pool[13475]: CopyColorTable (offset 342) */ "iiiii\0" "glCopyColorTable\0" "glCopyColorTableSGI\0" "\0" - /* _mesa_function_pool[13476]: GetHistogramParameterfv (offset 362) */ + /* _mesa_function_pool[13519]: GetHistogramParameterfv (offset 362) */ "iip\0" "glGetHistogramParameterfv\0" "glGetHistogramParameterfvEXT\0" "\0" - /* _mesa_function_pool[13536]: Frustum (offset 289) */ + /* _mesa_function_pool[13579]: Frustum (offset 289) */ "dddddd\0" "glFrustum\0" "\0" - /* _mesa_function_pool[13554]: GetString (offset 275) */ + /* _mesa_function_pool[13597]: GetString (offset 275) */ "i\0" "glGetString\0" "\0" - /* _mesa_function_pool[13569]: ColorPointervINTEL (dynamic) */ + /* _mesa_function_pool[13612]: ColorPointervINTEL (dynamic) */ "iip\0" "glColorPointervINTEL\0" "\0" - /* _mesa_function_pool[13595]: TexEnvf (offset 184) */ + /* _mesa_function_pool[13638]: TexEnvf (offset 184) */ "iif\0" "glTexEnvf\0" "\0" - /* _mesa_function_pool[13610]: TexCoord3d (offset 110) */ + /* _mesa_function_pool[13653]: TexCoord3d (offset 110) */ "ddd\0" "glTexCoord3d\0" "\0" - /* _mesa_function_pool[13628]: AlphaFragmentOp1ATI (will be remapped) */ + /* _mesa_function_pool[13671]: AlphaFragmentOp1ATI (will be remapped) */ "iiiiii\0" "glAlphaFragmentOp1ATI\0" "\0" - /* _mesa_function_pool[13658]: TexCoord3f (offset 112) */ + /* _mesa_function_pool[13701]: TexCoord3f (offset 112) */ "fff\0" "glTexCoord3f\0" "\0" - /* _mesa_function_pool[13676]: MultiTexCoord3ivARB (offset 397) */ + /* _mesa_function_pool[13719]: MultiTexCoord3ivARB (offset 397) */ "ip\0" "glMultiTexCoord3iv\0" "glMultiTexCoord3ivARB\0" "\0" - /* _mesa_function_pool[13721]: MultiTexCoord2sARB (offset 390) */ + /* _mesa_function_pool[13764]: MultiTexCoord2sARB (offset 390) */ "iii\0" "glMultiTexCoord2s\0" "glMultiTexCoord2sARB\0" "\0" - /* _mesa_function_pool[13765]: VertexAttrib1dvARB (will be remapped) */ + /* _mesa_function_pool[13808]: VertexAttrib1dvARB (will be remapped) */ "ip\0" "glVertexAttrib1dv\0" "glVertexAttrib1dvARB\0" "\0" - /* _mesa_function_pool[13808]: DeleteTextures (offset 327) */ + /* _mesa_function_pool[13851]: DeleteTextures (offset 327) */ "ip\0" "glDeleteTextures\0" "glDeleteTexturesEXT\0" "\0" - /* _mesa_function_pool[13849]: TexCoordPointerEXT (will be remapped) */ + /* _mesa_function_pool[13892]: TexCoordPointerEXT (will be remapped) */ "iiiip\0" "glTexCoordPointerEXT\0" "\0" - /* _mesa_function_pool[13877]: TexSubImage4DSGIS (dynamic) */ + /* _mesa_function_pool[13920]: TexSubImage4DSGIS (dynamic) */ "iiiiiiiiiiiip\0" "glTexSubImage4DSGIS\0" "\0" - /* _mesa_function_pool[13912]: TexCoord3s (offset 116) */ + /* _mesa_function_pool[13955]: TexCoord3s (offset 116) */ "iii\0" "glTexCoord3s\0" "\0" - /* _mesa_function_pool[13930]: GetTexLevelParameteriv (offset 285) */ + /* _mesa_function_pool[13973]: GetTexLevelParameteriv (offset 285) */ "iiip\0" "glGetTexLevelParameteriv\0" "\0" - /* _mesa_function_pool[13961]: CombinerStageParameterfvNV (dynamic) */ + /* _mesa_function_pool[14004]: CombinerStageParameterfvNV (dynamic) */ "iip\0" "glCombinerStageParameterfvNV\0" "\0" - /* _mesa_function_pool[13995]: StopInstrumentsSGIX (dynamic) */ + /* _mesa_function_pool[14038]: StopInstrumentsSGIX (dynamic) */ "i\0" "glStopInstrumentsSGIX\0" "\0" - /* _mesa_function_pool[14020]: TexCoord4fColor4fNormal3fVertex4fSUN (dynamic) */ + /* _mesa_function_pool[14063]: TexCoord4fColor4fNormal3fVertex4fSUN (dynamic) */ "fffffffffffffff\0" "glTexCoord4fColor4fNormal3fVertex4fSUN\0" "\0" - /* _mesa_function_pool[14076]: ClearAccum (offset 204) */ + /* _mesa_function_pool[14119]: ClearAccum (offset 204) */ "ffff\0" "glClearAccum\0" "\0" - /* _mesa_function_pool[14095]: DeformSGIX (dynamic) */ + /* _mesa_function_pool[14138]: DeformSGIX (dynamic) */ "i\0" "glDeformSGIX\0" "\0" - /* _mesa_function_pool[14111]: GetVertexAttribfvARB (will be remapped) */ + /* _mesa_function_pool[14154]: GetVertexAttribfvARB (will be remapped) */ "iip\0" "glGetVertexAttribfv\0" "glGetVertexAttribfvARB\0" "\0" - /* _mesa_function_pool[14159]: SecondaryColor3ivEXT (will be remapped) */ + /* _mesa_function_pool[14202]: SecondaryColor3ivEXT (will be remapped) */ "p\0" "glSecondaryColor3iv\0" "glSecondaryColor3ivEXT\0" "\0" - /* _mesa_function_pool[14205]: TexCoord4iv (offset 123) */ + /* _mesa_function_pool[14248]: TexCoord4iv (offset 123) */ "p\0" "glTexCoord4iv\0" "\0" - /* _mesa_function_pool[14222]: UniformMatrix4x2fv (will be remapped) */ + /* _mesa_function_pool[14265]: UniformMatrix4x2fv (will be remapped) */ "iiip\0" "glUniformMatrix4x2fv\0" "\0" - /* _mesa_function_pool[14249]: GetDetailTexFuncSGIS (dynamic) */ + /* _mesa_function_pool[14292]: GetDetailTexFuncSGIS (dynamic) */ "ip\0" "glGetDetailTexFuncSGIS\0" "\0" - /* _mesa_function_pool[14276]: GetCombinerStageParameterfvNV (dynamic) */ + /* _mesa_function_pool[14319]: GetCombinerStageParameterfvNV (dynamic) */ "iip\0" "glGetCombinerStageParameterfvNV\0" "\0" - /* _mesa_function_pool[14313]: PolygonOffset (offset 319) */ + /* _mesa_function_pool[14356]: PolygonOffset (offset 319) */ "ff\0" "glPolygonOffset\0" "\0" - /* _mesa_function_pool[14333]: BindVertexArray (will be remapped) */ + /* _mesa_function_pool[14376]: BindVertexArray (will be remapped) */ "i\0" "glBindVertexArray\0" "\0" - /* _mesa_function_pool[14354]: Color4ubVertex2fvSUN (dynamic) */ + /* _mesa_function_pool[14397]: Color4ubVertex2fvSUN (dynamic) */ "pp\0" "glColor4ubVertex2fvSUN\0" "\0" - /* _mesa_function_pool[14381]: Rectd (offset 86) */ + /* _mesa_function_pool[14424]: Rectd (offset 86) */ "dddd\0" "glRectd\0" "\0" - /* _mesa_function_pool[14395]: TexFilterFuncSGIS (dynamic) */ + /* _mesa_function_pool[14438]: TexFilterFuncSGIS (dynamic) */ "iiip\0" "glTexFilterFuncSGIS\0" "\0" - /* _mesa_function_pool[14421]: SampleMaskSGIS (will be remapped) */ + /* _mesa_function_pool[14464]: SampleMaskSGIS (will be remapped) */ "fi\0" "glSampleMaskSGIS\0" "glSampleMaskEXT\0" "\0" - /* _mesa_function_pool[14458]: GetAttribLocationARB (will be remapped) */ + /* _mesa_function_pool[14501]: GetAttribLocationARB (will be remapped) */ "ip\0" "glGetAttribLocation\0" "glGetAttribLocationARB\0" "\0" - /* _mesa_function_pool[14505]: RasterPos3i (offset 74) */ + /* _mesa_function_pool[14548]: RasterPos3i (offset 74) */ "iii\0" "glRasterPos3i\0" "\0" - /* _mesa_function_pool[14524]: VertexAttrib4ubvARB (will be remapped) */ + /* _mesa_function_pool[14567]: VertexAttrib4ubvARB (will be remapped) */ "ip\0" "glVertexAttrib4ubv\0" "glVertexAttrib4ubvARB\0" "\0" - /* _mesa_function_pool[14569]: DetailTexFuncSGIS (dynamic) */ + /* _mesa_function_pool[14612]: DetailTexFuncSGIS (dynamic) */ "iip\0" "glDetailTexFuncSGIS\0" "\0" - /* _mesa_function_pool[14594]: Normal3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[14637]: Normal3fVertex3fSUN (dynamic) */ "ffffff\0" "glNormal3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[14624]: CopyTexImage2D (offset 324) */ + /* _mesa_function_pool[14667]: CopyTexImage2D (offset 324) */ "iiiiiiii\0" "glCopyTexImage2D\0" "glCopyTexImage2DEXT\0" "\0" - /* _mesa_function_pool[14671]: GetBufferPointervARB (will be remapped) */ + /* _mesa_function_pool[14714]: GetBufferPointervARB (will be remapped) */ "iip\0" "glGetBufferPointerv\0" "glGetBufferPointervARB\0" "\0" - /* _mesa_function_pool[14719]: ProgramEnvParameter4fARB (will be remapped) */ + /* _mesa_function_pool[14762]: ProgramEnvParameter4fARB (will be remapped) */ "iiffff\0" "glProgramEnvParameter4fARB\0" "glProgramParameter4fNV\0" "\0" - /* _mesa_function_pool[14777]: Uniform3ivARB (will be remapped) */ + /* _mesa_function_pool[14820]: Uniform3ivARB (will be remapped) */ "iip\0" "glUniform3iv\0" "glUniform3ivARB\0" "\0" - /* _mesa_function_pool[14811]: Lightfv (offset 160) */ + /* _mesa_function_pool[14854]: Lightfv (offset 160) */ "iip\0" "glLightfv\0" "\0" - /* _mesa_function_pool[14826]: ClearDepth (offset 208) */ + /* _mesa_function_pool[14869]: ClearDepth (offset 208) */ "d\0" "glClearDepth\0" "\0" - /* _mesa_function_pool[14842]: GetFenceivNV (will be remapped) */ + /* _mesa_function_pool[14885]: GetFenceivNV (will be remapped) */ "iip\0" "glGetFenceivNV\0" "\0" - /* _mesa_function_pool[14862]: WindowPos4dvMESA (will be remapped) */ + /* _mesa_function_pool[14905]: WindowPos4dvMESA (will be remapped) */ "p\0" "glWindowPos4dvMESA\0" "\0" - /* _mesa_function_pool[14884]: ColorSubTable (offset 346) */ + /* _mesa_function_pool[14927]: ColorSubTable (offset 346) */ "iiiiip\0" "glColorSubTable\0" "glColorSubTableEXT\0" "\0" - /* _mesa_function_pool[14927]: Color4fv (offset 30) */ + /* _mesa_function_pool[14970]: Color4fv (offset 30) */ "p\0" "glColor4fv\0" "\0" - /* _mesa_function_pool[14941]: MultiTexCoord4ivARB (offset 405) */ + /* _mesa_function_pool[14984]: MultiTexCoord4ivARB (offset 405) */ "ip\0" "glMultiTexCoord4iv\0" "glMultiTexCoord4ivARB\0" "\0" - /* _mesa_function_pool[14986]: ProgramLocalParameters4fvEXT (will be remapped) */ + /* _mesa_function_pool[15029]: ProgramLocalParameters4fvEXT (will be remapped) */ "iiip\0" "glProgramLocalParameters4fvEXT\0" "\0" - /* _mesa_function_pool[15023]: ColorPointer (offset 308) */ + /* _mesa_function_pool[15066]: ColorPointer (offset 308) */ "iiip\0" "glColorPointer\0" "\0" - /* _mesa_function_pool[15044]: Rects (offset 92) */ + /* _mesa_function_pool[15087]: Rects (offset 92) */ "iiii\0" "glRects\0" "\0" - /* _mesa_function_pool[15058]: GetMapAttribParameterfvNV (dynamic) */ + /* _mesa_function_pool[15101]: GetMapAttribParameterfvNV (dynamic) */ "iiip\0" "glGetMapAttribParameterfvNV\0" "\0" - /* _mesa_function_pool[15092]: Lightiv (offset 162) */ + /* _mesa_function_pool[15135]: Lightiv (offset 162) */ "iip\0" "glLightiv\0" "\0" - /* _mesa_function_pool[15107]: VertexAttrib4sARB (will be remapped) */ + /* _mesa_function_pool[15150]: VertexAttrib4sARB (will be remapped) */ "iiiii\0" "glVertexAttrib4s\0" "glVertexAttrib4sARB\0" "\0" - /* _mesa_function_pool[15151]: GetQueryObjectuivARB (will be remapped) */ + /* _mesa_function_pool[15194]: GetQueryObjectuivARB (will be remapped) */ "iip\0" "glGetQueryObjectuiv\0" "glGetQueryObjectuivARB\0" "\0" - /* _mesa_function_pool[15199]: GetTexParameteriv (offset 283) */ + /* _mesa_function_pool[15242]: GetTexParameteriv (offset 283) */ "iip\0" "glGetTexParameteriv\0" "\0" - /* _mesa_function_pool[15224]: MapParameterivNV (dynamic) */ + /* _mesa_function_pool[15267]: MapParameterivNV (dynamic) */ "iip\0" "glMapParameterivNV\0" "\0" - /* _mesa_function_pool[15248]: GenRenderbuffersEXT (will be remapped) */ + /* _mesa_function_pool[15291]: GenRenderbuffersEXT (will be remapped) */ "ip\0" "glGenRenderbuffers\0" "glGenRenderbuffersEXT\0" "\0" - /* _mesa_function_pool[15293]: VertexAttrib2dvARB (will be remapped) */ + /* _mesa_function_pool[15336]: VertexAttrib2dvARB (will be remapped) */ "ip\0" "glVertexAttrib2dv\0" "glVertexAttrib2dvARB\0" "\0" - /* _mesa_function_pool[15336]: EdgeFlagPointerEXT (will be remapped) */ + /* _mesa_function_pool[15379]: EdgeFlagPointerEXT (will be remapped) */ "iip\0" "glEdgeFlagPointerEXT\0" "\0" - /* _mesa_function_pool[15362]: VertexAttribs2svNV (will be remapped) */ + /* _mesa_function_pool[15405]: VertexAttribs2svNV (will be remapped) */ "iip\0" "glVertexAttribs2svNV\0" "\0" - /* _mesa_function_pool[15388]: WeightbvARB (dynamic) */ + /* _mesa_function_pool[15431]: WeightbvARB (dynamic) */ "ip\0" "glWeightbvARB\0" "\0" - /* _mesa_function_pool[15406]: VertexAttrib2fvARB (will be remapped) */ + /* _mesa_function_pool[15449]: VertexAttrib2fvARB (will be remapped) */ "ip\0" "glVertexAttrib2fv\0" "glVertexAttrib2fvARB\0" "\0" - /* _mesa_function_pool[15449]: GetBufferParameterivARB (will be remapped) */ + /* _mesa_function_pool[15492]: GetBufferParameterivARB (will be remapped) */ "iip\0" "glGetBufferParameteriv\0" "glGetBufferParameterivARB\0" "\0" - /* _mesa_function_pool[15503]: Rectdv (offset 87) */ + /* _mesa_function_pool[15546]: Rectdv (offset 87) */ "pp\0" "glRectdv\0" "\0" - /* _mesa_function_pool[15516]: ListParameteriSGIX (dynamic) */ + /* _mesa_function_pool[15559]: ListParameteriSGIX (dynamic) */ "iii\0" "glListParameteriSGIX\0" "\0" - /* _mesa_function_pool[15542]: ReplacementCodeuiColor4fNormal3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[15585]: ReplacementCodeuiColor4fNormal3fVertex3fSUN (dynamic) */ "iffffffffff\0" "glReplacementCodeuiColor4fNormal3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[15601]: InstrumentsBufferSGIX (dynamic) */ + /* _mesa_function_pool[15644]: InstrumentsBufferSGIX (dynamic) */ "ip\0" "glInstrumentsBufferSGIX\0" "\0" - /* _mesa_function_pool[15629]: VertexAttrib4NivARB (will be remapped) */ + /* _mesa_function_pool[15672]: VertexAttrib4NivARB (will be remapped) */ "ip\0" "glVertexAttrib4Niv\0" "glVertexAttrib4NivARB\0" "\0" - /* _mesa_function_pool[15674]: GetAttachedShaders (will be remapped) */ + /* _mesa_function_pool[15717]: GetAttachedShaders (will be remapped) */ "iipp\0" "glGetAttachedShaders\0" "\0" - /* _mesa_function_pool[15701]: GenVertexArraysAPPLE (will be remapped) */ + /* _mesa_function_pool[15744]: GenVertexArraysAPPLE (will be remapped) */ "ip\0" "glGenVertexArraysAPPLE\0" "\0" - /* _mesa_function_pool[15728]: Materialiv (offset 172) */ + /* _mesa_function_pool[15771]: Materialiv (offset 172) */ "iip\0" "glMaterialiv\0" "\0" - /* _mesa_function_pool[15746]: PushClientAttrib (offset 335) */ + /* _mesa_function_pool[15789]: PushClientAttrib (offset 335) */ "i\0" "glPushClientAttrib\0" "\0" - /* _mesa_function_pool[15768]: ProgramEnvParameters4fvEXT (will be remapped) */ + /* _mesa_function_pool[15811]: ProgramEnvParameters4fvEXT (will be remapped) */ "iiip\0" "glProgramEnvParameters4fvEXT\0" "\0" - /* _mesa_function_pool[15803]: TexCoord2fColor4fNormal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[15846]: TexCoord2fColor4fNormal3fVertex3fvSUN (dynamic) */ "pppp\0" "glTexCoord2fColor4fNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[15849]: WindowPos2iMESA (will be remapped) */ + /* _mesa_function_pool[15892]: WindowPos2iMESA (will be remapped) */ "ii\0" "glWindowPos2i\0" "glWindowPos2iARB\0" "glWindowPos2iMESA\0" "\0" - /* _mesa_function_pool[15902]: SecondaryColor3fvEXT (will be remapped) */ + /* _mesa_function_pool[15945]: SecondaryColor3fvEXT (will be remapped) */ "p\0" "glSecondaryColor3fv\0" "glSecondaryColor3fvEXT\0" "\0" - /* _mesa_function_pool[15948]: PolygonMode (offset 174) */ + /* _mesa_function_pool[15991]: PolygonMode (offset 174) */ "ii\0" "glPolygonMode\0" "\0" - /* _mesa_function_pool[15966]: CompressedTexSubImage1DARB (will be remapped) */ + /* _mesa_function_pool[16009]: CompressedTexSubImage1DARB (will be remapped) */ "iiiiiip\0" "glCompressedTexSubImage1D\0" "glCompressedTexSubImage1DARB\0" "\0" - /* _mesa_function_pool[16030]: GetVertexAttribivNV (will be remapped) */ + /* _mesa_function_pool[16073]: GetVertexAttribivNV (will be remapped) */ "iip\0" "glGetVertexAttribivNV\0" "\0" - /* _mesa_function_pool[16057]: GetProgramStringARB (will be remapped) */ + /* _mesa_function_pool[16100]: GetProgramStringARB (will be remapped) */ "iip\0" "glGetProgramStringARB\0" "\0" - /* _mesa_function_pool[16084]: TexBumpParameterfvATI (will be remapped) */ + /* _mesa_function_pool[16127]: TexBumpParameterfvATI (will be remapped) */ "ip\0" "glTexBumpParameterfvATI\0" "\0" - /* _mesa_function_pool[16112]: CompileShaderARB (will be remapped) */ + /* _mesa_function_pool[16155]: CompileShaderARB (will be remapped) */ "i\0" "glCompileShader\0" "glCompileShaderARB\0" "\0" - /* _mesa_function_pool[16150]: DeleteShader (will be remapped) */ + /* _mesa_function_pool[16193]: DeleteShader (will be remapped) */ "i\0" "glDeleteShader\0" "\0" - /* _mesa_function_pool[16168]: DisableClientState (offset 309) */ + /* _mesa_function_pool[16211]: DisableClientState (offset 309) */ "i\0" "glDisableClientState\0" "\0" - /* _mesa_function_pool[16192]: TexGeni (offset 192) */ + /* _mesa_function_pool[16235]: TexGeni (offset 192) */ "iii\0" "glTexGeni\0" "\0" - /* _mesa_function_pool[16207]: TexGenf (offset 190) */ + /* _mesa_function_pool[16250]: TexGenf (offset 190) */ "iif\0" "glTexGenf\0" "\0" - /* _mesa_function_pool[16222]: Uniform3fARB (will be remapped) */ + /* _mesa_function_pool[16265]: Uniform3fARB (will be remapped) */ "ifff\0" "glUniform3f\0" "glUniform3fARB\0" "\0" - /* _mesa_function_pool[16255]: TexGend (offset 188) */ + /* _mesa_function_pool[16298]: TexGend (offset 188) */ "iid\0" "glTexGend\0" "\0" - /* _mesa_function_pool[16270]: ListParameterfvSGIX (dynamic) */ + /* _mesa_function_pool[16313]: ListParameterfvSGIX (dynamic) */ "iip\0" "glListParameterfvSGIX\0" "\0" - /* _mesa_function_pool[16297]: GetPolygonStipple (offset 274) */ + /* _mesa_function_pool[16340]: GetPolygonStipple (offset 274) */ "p\0" "glGetPolygonStipple\0" "\0" - /* _mesa_function_pool[16320]: Tangent3dvEXT (dynamic) */ + /* _mesa_function_pool[16363]: Tangent3dvEXT (dynamic) */ "p\0" "glTangent3dvEXT\0" "\0" - /* _mesa_function_pool[16339]: GetVertexAttribfvNV (will be remapped) */ + /* _mesa_function_pool[16382]: GetVertexAttribfvNV (will be remapped) */ "iip\0" "glGetVertexAttribfvNV\0" "\0" - /* _mesa_function_pool[16366]: WindowPos3sMESA (will be remapped) */ + /* _mesa_function_pool[16409]: WindowPos3sMESA (will be remapped) */ "iii\0" "glWindowPos3s\0" "glWindowPos3sARB\0" "glWindowPos3sMESA\0" "\0" - /* _mesa_function_pool[16420]: VertexAttrib2svNV (will be remapped) */ + /* _mesa_function_pool[16463]: VertexAttrib2svNV (will be remapped) */ "ip\0" "glVertexAttrib2svNV\0" "\0" - /* _mesa_function_pool[16444]: VertexAttribs1fvNV (will be remapped) */ + /* _mesa_function_pool[16487]: VertexAttribs1fvNV (will be remapped) */ "iip\0" "glVertexAttribs1fvNV\0" "\0" - /* _mesa_function_pool[16470]: TexCoord2fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[16513]: TexCoord2fVertex3fvSUN (dynamic) */ "pp\0" "glTexCoord2fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[16499]: WindowPos4sMESA (will be remapped) */ + /* _mesa_function_pool[16542]: WindowPos4sMESA (will be remapped) */ "iiii\0" "glWindowPos4sMESA\0" "\0" - /* _mesa_function_pool[16523]: VertexAttrib4NuivARB (will be remapped) */ + /* _mesa_function_pool[16566]: VertexAttrib4NuivARB (will be remapped) */ "ip\0" "glVertexAttrib4Nuiv\0" "glVertexAttrib4NuivARB\0" "\0" - /* _mesa_function_pool[16570]: ClientActiveTextureARB (offset 375) */ + /* _mesa_function_pool[16613]: ClientActiveTextureARB (offset 375) */ "i\0" "glClientActiveTexture\0" "glClientActiveTextureARB\0" "\0" - /* _mesa_function_pool[16620]: PixelTexGenSGIX (will be remapped) */ + /* _mesa_function_pool[16663]: PixelTexGenSGIX (will be remapped) */ "i\0" "glPixelTexGenSGIX\0" "\0" - /* _mesa_function_pool[16641]: ReplacementCodeusvSUN (dynamic) */ + /* _mesa_function_pool[16684]: ReplacementCodeusvSUN (dynamic) */ "p\0" "glReplacementCodeusvSUN\0" "\0" - /* _mesa_function_pool[16668]: Uniform4fARB (will be remapped) */ + /* _mesa_function_pool[16711]: Uniform4fARB (will be remapped) */ "iffff\0" "glUniform4f\0" "glUniform4fARB\0" "\0" - /* _mesa_function_pool[16702]: Color4sv (offset 34) */ + /* _mesa_function_pool[16745]: Color4sv (offset 34) */ "p\0" "glColor4sv\0" "\0" - /* _mesa_function_pool[16716]: FlushMappedBufferRange (will be remapped) */ + /* _mesa_function_pool[16759]: FlushMappedBufferRange (will be remapped) */ "iii\0" "glFlushMappedBufferRange\0" "\0" - /* _mesa_function_pool[16746]: IsProgramNV (will be remapped) */ + /* _mesa_function_pool[16789]: IsProgramNV (will be remapped) */ "i\0" "glIsProgramARB\0" "glIsProgramNV\0" "\0" - /* _mesa_function_pool[16778]: FlushMappedBufferRangeAPPLE (will be remapped) */ + /* _mesa_function_pool[16821]: FlushMappedBufferRangeAPPLE (will be remapped) */ "iii\0" "glFlushMappedBufferRangeAPPLE\0" "\0" - /* _mesa_function_pool[16813]: PixelZoom (offset 246) */ + /* _mesa_function_pool[16856]: PixelZoom (offset 246) */ "ff\0" "glPixelZoom\0" "\0" - /* _mesa_function_pool[16829]: ReplacementCodePointerSUN (dynamic) */ + /* _mesa_function_pool[16872]: ReplacementCodePointerSUN (dynamic) */ "iip\0" "glReplacementCodePointerSUN\0" "\0" - /* _mesa_function_pool[16862]: ProgramEnvParameter4dARB (will be remapped) */ + /* _mesa_function_pool[16905]: ProgramEnvParameter4dARB (will be remapped) */ "iidddd\0" "glProgramEnvParameter4dARB\0" "glProgramParameter4dNV\0" "\0" - /* _mesa_function_pool[16920]: ColorTableParameterfv (offset 340) */ + /* _mesa_function_pool[16963]: ColorTableParameterfv (offset 340) */ "iip\0" "glColorTableParameterfv\0" "glColorTableParameterfvSGI\0" "\0" - /* _mesa_function_pool[16976]: FragmentLightModelfSGIX (dynamic) */ + /* _mesa_function_pool[17019]: FragmentLightModelfSGIX (dynamic) */ "if\0" "glFragmentLightModelfSGIX\0" "\0" - /* _mesa_function_pool[17006]: Binormal3bvEXT (dynamic) */ + /* _mesa_function_pool[17049]: Binormal3bvEXT (dynamic) */ "p\0" "glBinormal3bvEXT\0" "\0" - /* _mesa_function_pool[17026]: PixelMapuiv (offset 252) */ + /* _mesa_function_pool[17069]: PixelMapuiv (offset 252) */ "iip\0" "glPixelMapuiv\0" "\0" - /* _mesa_function_pool[17045]: Color3dv (offset 12) */ + /* _mesa_function_pool[17088]: Color3dv (offset 12) */ "p\0" "glColor3dv\0" "\0" - /* _mesa_function_pool[17059]: IsTexture (offset 330) */ + /* _mesa_function_pool[17102]: IsTexture (offset 330) */ "i\0" "glIsTexture\0" "glIsTextureEXT\0" "\0" - /* _mesa_function_pool[17089]: VertexWeightfvEXT (dynamic) */ + /* _mesa_function_pool[17132]: VertexWeightfvEXT (dynamic) */ "p\0" "glVertexWeightfvEXT\0" "\0" - /* _mesa_function_pool[17112]: VertexAttrib1dARB (will be remapped) */ + /* _mesa_function_pool[17155]: VertexAttrib1dARB (will be remapped) */ "id\0" "glVertexAttrib1d\0" "glVertexAttrib1dARB\0" "\0" - /* _mesa_function_pool[17153]: ImageTransformParameterivHP (dynamic) */ + /* _mesa_function_pool[17196]: ImageTransformParameterivHP (dynamic) */ "iip\0" "glImageTransformParameterivHP\0" "\0" - /* _mesa_function_pool[17188]: TexCoord4i (offset 122) */ + /* _mesa_function_pool[17231]: TexCoord4i (offset 122) */ "iiii\0" "glTexCoord4i\0" "\0" - /* _mesa_function_pool[17207]: DeleteQueriesARB (will be remapped) */ + /* _mesa_function_pool[17250]: DeleteQueriesARB (will be remapped) */ "ip\0" "glDeleteQueries\0" "glDeleteQueriesARB\0" "\0" - /* _mesa_function_pool[17246]: Color4ubVertex2fSUN (dynamic) */ + /* _mesa_function_pool[17289]: Color4ubVertex2fSUN (dynamic) */ "iiiiff\0" "glColor4ubVertex2fSUN\0" "\0" - /* _mesa_function_pool[17276]: FragmentColorMaterialSGIX (dynamic) */ + /* _mesa_function_pool[17319]: FragmentColorMaterialSGIX (dynamic) */ "ii\0" "glFragmentColorMaterialSGIX\0" "\0" - /* _mesa_function_pool[17308]: CurrentPaletteMatrixARB (dynamic) */ + /* _mesa_function_pool[17351]: CurrentPaletteMatrixARB (dynamic) */ "i\0" "glCurrentPaletteMatrixARB\0" "\0" - /* _mesa_function_pool[17337]: GetMapdv (offset 266) */ + /* _mesa_function_pool[17380]: GetMapdv (offset 266) */ "iip\0" "glGetMapdv\0" "\0" - /* _mesa_function_pool[17353]: SamplePatternSGIS (will be remapped) */ + /* _mesa_function_pool[17396]: SamplePatternSGIS (will be remapped) */ "i\0" "glSamplePatternSGIS\0" "glSamplePatternEXT\0" "\0" - /* _mesa_function_pool[17395]: PixelStoref (offset 249) */ + /* _mesa_function_pool[17438]: PixelStoref (offset 249) */ "if\0" "glPixelStoref\0" "\0" - /* _mesa_function_pool[17413]: IsQueryARB (will be remapped) */ + /* _mesa_function_pool[17456]: IsQueryARB (will be remapped) */ "i\0" "glIsQuery\0" "glIsQueryARB\0" "\0" - /* _mesa_function_pool[17439]: ReplacementCodeuiColor4ubVertex3fSUN (dynamic) */ + /* _mesa_function_pool[17482]: ReplacementCodeuiColor4ubVertex3fSUN (dynamic) */ "iiiiifff\0" "glReplacementCodeuiColor4ubVertex3fSUN\0" "\0" - /* _mesa_function_pool[17488]: PixelStorei (offset 250) */ + /* _mesa_function_pool[17531]: PixelStorei (offset 250) */ "ii\0" "glPixelStorei\0" "\0" - /* _mesa_function_pool[17506]: VertexAttrib4usvARB (will be remapped) */ + /* _mesa_function_pool[17549]: VertexAttrib4usvARB (will be remapped) */ "ip\0" "glVertexAttrib4usv\0" "glVertexAttrib4usvARB\0" "\0" - /* _mesa_function_pool[17551]: LinkProgramARB (will be remapped) */ + /* _mesa_function_pool[17594]: LinkProgramARB (will be remapped) */ "i\0" "glLinkProgram\0" "glLinkProgramARB\0" "\0" - /* _mesa_function_pool[17585]: VertexAttrib2fNV (will be remapped) */ + /* _mesa_function_pool[17628]: VertexAttrib2fNV (will be remapped) */ "iff\0" "glVertexAttrib2fNV\0" "\0" - /* _mesa_function_pool[17609]: ShaderSourceARB (will be remapped) */ + /* _mesa_function_pool[17652]: ShaderSourceARB (will be remapped) */ "iipp\0" "glShaderSource\0" "glShaderSourceARB\0" "\0" - /* _mesa_function_pool[17648]: FragmentMaterialiSGIX (dynamic) */ + /* _mesa_function_pool[17691]: FragmentMaterialiSGIX (dynamic) */ "iii\0" "glFragmentMaterialiSGIX\0" "\0" - /* _mesa_function_pool[17677]: EvalCoord2dv (offset 233) */ + /* _mesa_function_pool[17720]: EvalCoord2dv (offset 233) */ "p\0" "glEvalCoord2dv\0" "\0" - /* _mesa_function_pool[17695]: VertexAttrib3svARB (will be remapped) */ + /* _mesa_function_pool[17738]: VertexAttrib3svARB (will be remapped) */ "ip\0" "glVertexAttrib3sv\0" "glVertexAttrib3svARB\0" "\0" - /* _mesa_function_pool[17738]: ColorMaterial (offset 151) */ + /* _mesa_function_pool[17781]: ColorMaterial (offset 151) */ "ii\0" "glColorMaterial\0" "\0" - /* _mesa_function_pool[17758]: CompressedTexSubImage3DARB (will be remapped) */ + /* _mesa_function_pool[17801]: CompressedTexSubImage3DARB (will be remapped) */ "iiiiiiiiiip\0" "glCompressedTexSubImage3D\0" "glCompressedTexSubImage3DARB\0" "\0" - /* _mesa_function_pool[17826]: WindowPos2ivMESA (will be remapped) */ + /* _mesa_function_pool[17869]: WindowPos2ivMESA (will be remapped) */ "p\0" "glWindowPos2iv\0" "glWindowPos2ivARB\0" "glWindowPos2ivMESA\0" "\0" - /* _mesa_function_pool[17881]: IsFramebufferEXT (will be remapped) */ + /* _mesa_function_pool[17924]: IsFramebufferEXT (will be remapped) */ "i\0" "glIsFramebuffer\0" "glIsFramebufferEXT\0" "\0" - /* _mesa_function_pool[17919]: Uniform4ivARB (will be remapped) */ + /* _mesa_function_pool[17962]: Uniform4ivARB (will be remapped) */ "iip\0" "glUniform4iv\0" "glUniform4ivARB\0" "\0" - /* _mesa_function_pool[17953]: GetVertexAttribdvARB (will be remapped) */ + /* _mesa_function_pool[17996]: GetVertexAttribdvARB (will be remapped) */ "iip\0" "glGetVertexAttribdv\0" "glGetVertexAttribdvARB\0" "\0" - /* _mesa_function_pool[18001]: TexBumpParameterivATI (will be remapped) */ + /* _mesa_function_pool[18044]: TexBumpParameterivATI (will be remapped) */ "ip\0" "glTexBumpParameterivATI\0" "\0" - /* _mesa_function_pool[18029]: GetSeparableFilter (offset 359) */ + /* _mesa_function_pool[18072]: GetSeparableFilter (offset 359) */ "iiippp\0" "glGetSeparableFilter\0" "glGetSeparableFilterEXT\0" "\0" - /* _mesa_function_pool[18082]: Binormal3dEXT (dynamic) */ + /* _mesa_function_pool[18125]: Binormal3dEXT (dynamic) */ "ddd\0" "glBinormal3dEXT\0" "\0" - /* _mesa_function_pool[18103]: SpriteParameteriSGIX (dynamic) */ + /* _mesa_function_pool[18146]: SpriteParameteriSGIX (dynamic) */ "ii\0" "glSpriteParameteriSGIX\0" "\0" - /* _mesa_function_pool[18130]: RequestResidentProgramsNV (will be remapped) */ + /* _mesa_function_pool[18173]: RequestResidentProgramsNV (will be remapped) */ "ip\0" "glRequestResidentProgramsNV\0" "\0" - /* _mesa_function_pool[18162]: TagSampleBufferSGIX (dynamic) */ + /* _mesa_function_pool[18205]: TagSampleBufferSGIX (dynamic) */ "\0" "glTagSampleBufferSGIX\0" "\0" - /* _mesa_function_pool[18186]: ReplacementCodeusSUN (dynamic) */ + /* _mesa_function_pool[18229]: ReplacementCodeusSUN (dynamic) */ "i\0" "glReplacementCodeusSUN\0" "\0" - /* _mesa_function_pool[18212]: FeedbackBuffer (offset 194) */ + /* _mesa_function_pool[18255]: FeedbackBuffer (offset 194) */ "iip\0" "glFeedbackBuffer\0" "\0" - /* _mesa_function_pool[18234]: RasterPos2iv (offset 67) */ + /* _mesa_function_pool[18277]: RasterPos2iv (offset 67) */ "p\0" "glRasterPos2iv\0" "\0" - /* _mesa_function_pool[18252]: TexImage1D (offset 182) */ + /* _mesa_function_pool[18295]: TexImage1D (offset 182) */ "iiiiiiip\0" "glTexImage1D\0" "\0" - /* _mesa_function_pool[18275]: ListParameterivSGIX (dynamic) */ + /* _mesa_function_pool[18318]: ListParameterivSGIX (dynamic) */ "iip\0" "glListParameterivSGIX\0" "\0" - /* _mesa_function_pool[18302]: MultiDrawElementsEXT (will be remapped) */ + /* _mesa_function_pool[18345]: MultiDrawElementsEXT (will be remapped) */ "ipipi\0" "glMultiDrawElements\0" "glMultiDrawElementsEXT\0" "\0" - /* _mesa_function_pool[18352]: Color3s (offset 17) */ + /* _mesa_function_pool[18395]: Color3s (offset 17) */ "iii\0" "glColor3s\0" "\0" - /* _mesa_function_pool[18367]: Uniform1ivARB (will be remapped) */ + /* _mesa_function_pool[18410]: Uniform1ivARB (will be remapped) */ "iip\0" "glUniform1iv\0" "glUniform1ivARB\0" "\0" - /* _mesa_function_pool[18401]: WindowPos2sMESA (will be remapped) */ + /* _mesa_function_pool[18444]: WindowPos2sMESA (will be remapped) */ "ii\0" "glWindowPos2s\0" "glWindowPos2sARB\0" "glWindowPos2sMESA\0" "\0" - /* _mesa_function_pool[18454]: WeightusvARB (dynamic) */ + /* _mesa_function_pool[18497]: WeightusvARB (dynamic) */ "ip\0" "glWeightusvARB\0" "\0" - /* _mesa_function_pool[18473]: TexCoordPointer (offset 320) */ + /* _mesa_function_pool[18516]: TexCoordPointer (offset 320) */ "iiip\0" "glTexCoordPointer\0" "\0" - /* _mesa_function_pool[18497]: FogCoordPointerEXT (will be remapped) */ + /* _mesa_function_pool[18540]: FogCoordPointerEXT (will be remapped) */ "iip\0" "glFogCoordPointer\0" "glFogCoordPointerEXT\0" "\0" - /* _mesa_function_pool[18541]: IndexMaterialEXT (dynamic) */ + /* _mesa_function_pool[18584]: IndexMaterialEXT (dynamic) */ "ii\0" "glIndexMaterialEXT\0" "\0" - /* _mesa_function_pool[18564]: Color3i (offset 15) */ + /* _mesa_function_pool[18607]: Color3i (offset 15) */ "iii\0" "glColor3i\0" "\0" - /* _mesa_function_pool[18579]: FrontFace (offset 157) */ + /* _mesa_function_pool[18622]: FrontFace (offset 157) */ "i\0" "glFrontFace\0" "\0" - /* _mesa_function_pool[18594]: EvalCoord2d (offset 232) */ + /* _mesa_function_pool[18637]: EvalCoord2d (offset 232) */ "dd\0" "glEvalCoord2d\0" "\0" - /* _mesa_function_pool[18612]: SecondaryColor3ubvEXT (will be remapped) */ + /* _mesa_function_pool[18655]: SecondaryColor3ubvEXT (will be remapped) */ "p\0" "glSecondaryColor3ubv\0" "glSecondaryColor3ubvEXT\0" "\0" - /* _mesa_function_pool[18660]: EvalCoord2f (offset 234) */ + /* _mesa_function_pool[18703]: EvalCoord2f (offset 234) */ "ff\0" "glEvalCoord2f\0" "\0" - /* _mesa_function_pool[18678]: VertexAttrib4dvARB (will be remapped) */ + /* _mesa_function_pool[18721]: VertexAttrib4dvARB (will be remapped) */ "ip\0" "glVertexAttrib4dv\0" "glVertexAttrib4dvARB\0" "\0" - /* _mesa_function_pool[18721]: BindAttribLocationARB (will be remapped) */ + /* _mesa_function_pool[18764]: BindAttribLocationARB (will be remapped) */ "iip\0" "glBindAttribLocation\0" "glBindAttribLocationARB\0" "\0" - /* _mesa_function_pool[18771]: Color3b (offset 9) */ + /* _mesa_function_pool[18814]: Color3b (offset 9) */ "iii\0" "glColor3b\0" "\0" - /* _mesa_function_pool[18786]: MultiTexCoord2dARB (offset 384) */ + /* _mesa_function_pool[18829]: MultiTexCoord2dARB (offset 384) */ "idd\0" "glMultiTexCoord2d\0" "glMultiTexCoord2dARB\0" "\0" - /* _mesa_function_pool[18830]: ExecuteProgramNV (will be remapped) */ + /* _mesa_function_pool[18873]: ExecuteProgramNV (will be remapped) */ "iip\0" "glExecuteProgramNV\0" "\0" - /* _mesa_function_pool[18854]: Color3f (offset 13) */ + /* _mesa_function_pool[18897]: Color3f (offset 13) */ "fff\0" "glColor3f\0" "\0" - /* _mesa_function_pool[18869]: LightEnviSGIX (dynamic) */ + /* _mesa_function_pool[18912]: LightEnviSGIX (dynamic) */ "ii\0" "glLightEnviSGIX\0" "\0" - /* _mesa_function_pool[18889]: Color3d (offset 11) */ + /* _mesa_function_pool[18932]: Color3d (offset 11) */ "ddd\0" "glColor3d\0" "\0" - /* _mesa_function_pool[18904]: Normal3dv (offset 55) */ + /* _mesa_function_pool[18947]: Normal3dv (offset 55) */ "p\0" "glNormal3dv\0" "\0" - /* _mesa_function_pool[18919]: Lightf (offset 159) */ + /* _mesa_function_pool[18962]: Lightf (offset 159) */ "iif\0" "glLightf\0" "\0" - /* _mesa_function_pool[18933]: ReplacementCodeuiSUN (dynamic) */ + /* _mesa_function_pool[18976]: ReplacementCodeuiSUN (dynamic) */ "i\0" "glReplacementCodeuiSUN\0" "\0" - /* _mesa_function_pool[18959]: MatrixMode (offset 293) */ + /* _mesa_function_pool[19002]: MatrixMode (offset 293) */ "i\0" "glMatrixMode\0" "\0" - /* _mesa_function_pool[18975]: GetPixelMapusv (offset 273) */ + /* _mesa_function_pool[19018]: GetPixelMapusv (offset 273) */ "ip\0" "glGetPixelMapusv\0" "\0" - /* _mesa_function_pool[18996]: Lighti (offset 161) */ + /* _mesa_function_pool[19039]: Lighti (offset 161) */ "iii\0" "glLighti\0" "\0" - /* _mesa_function_pool[19010]: VertexAttribPointerNV (will be remapped) */ + /* _mesa_function_pool[19053]: VertexAttribPointerNV (will be remapped) */ "iiiip\0" "glVertexAttribPointerNV\0" "\0" - /* _mesa_function_pool[19041]: GetFramebufferAttachmentParameterivEXT (will be remapped) */ + /* _mesa_function_pool[19084]: GetFramebufferAttachmentParameterivEXT (will be remapped) */ "iiip\0" "glGetFramebufferAttachmentParameteriv\0" "glGetFramebufferAttachmentParameterivEXT\0" "\0" - /* _mesa_function_pool[19126]: PixelTransformParameterfEXT (dynamic) */ + /* _mesa_function_pool[19169]: PixelTransformParameterfEXT (dynamic) */ "iif\0" "glPixelTransformParameterfEXT\0" "\0" - /* _mesa_function_pool[19161]: MultiTexCoord4dvARB (offset 401) */ + /* _mesa_function_pool[19204]: MultiTexCoord4dvARB (offset 401) */ "ip\0" "glMultiTexCoord4dv\0" "glMultiTexCoord4dvARB\0" "\0" - /* _mesa_function_pool[19206]: PixelTransformParameteriEXT (dynamic) */ + /* _mesa_function_pool[19249]: PixelTransformParameteriEXT (dynamic) */ "iii\0" "glPixelTransformParameteriEXT\0" "\0" - /* _mesa_function_pool[19241]: GetDoublev (offset 260) */ + /* _mesa_function_pool[19284]: GetDoublev (offset 260) */ "ip\0" "glGetDoublev\0" "\0" - /* _mesa_function_pool[19258]: MultMatrixd (offset 295) */ + /* _mesa_function_pool[19301]: MultMatrixd (offset 295) */ "p\0" "glMultMatrixd\0" "\0" - /* _mesa_function_pool[19275]: MultMatrixf (offset 294) */ + /* _mesa_function_pool[19318]: MultMatrixf (offset 294) */ "p\0" "glMultMatrixf\0" "\0" - /* _mesa_function_pool[19292]: TexCoord2fColor4ubVertex3fSUN (dynamic) */ + /* _mesa_function_pool[19335]: TexCoord2fColor4ubVertex3fSUN (dynamic) */ "ffiiiifff\0" "glTexCoord2fColor4ubVertex3fSUN\0" "\0" - /* _mesa_function_pool[19335]: Uniform1iARB (will be remapped) */ + /* _mesa_function_pool[19378]: Uniform1iARB (will be remapped) */ "ii\0" "glUniform1i\0" "glUniform1iARB\0" "\0" - /* _mesa_function_pool[19366]: VertexAttribPointerARB (will be remapped) */ + /* _mesa_function_pool[19409]: VertexAttribPointerARB (will be remapped) */ "iiiiip\0" "glVertexAttribPointer\0" "glVertexAttribPointerARB\0" "\0" - /* _mesa_function_pool[19421]: SharpenTexFuncSGIS (dynamic) */ + /* _mesa_function_pool[19464]: SharpenTexFuncSGIS (dynamic) */ "iip\0" "glSharpenTexFuncSGIS\0" "\0" - /* _mesa_function_pool[19447]: MultiTexCoord4fvARB (offset 403) */ + /* _mesa_function_pool[19490]: MultiTexCoord4fvARB (offset 403) */ "ip\0" "glMultiTexCoord4fv\0" "glMultiTexCoord4fvARB\0" "\0" - /* _mesa_function_pool[19492]: UniformMatrix2x3fv (will be remapped) */ + /* _mesa_function_pool[19535]: UniformMatrix2x3fv (will be remapped) */ "iiip\0" "glUniformMatrix2x3fv\0" "\0" - /* _mesa_function_pool[19519]: TrackMatrixNV (will be remapped) */ + /* _mesa_function_pool[19562]: TrackMatrixNV (will be remapped) */ "iiii\0" "glTrackMatrixNV\0" "\0" - /* _mesa_function_pool[19541]: CombinerParameteriNV (will be remapped) */ + /* _mesa_function_pool[19584]: CombinerParameteriNV (will be remapped) */ "ii\0" "glCombinerParameteriNV\0" "\0" - /* _mesa_function_pool[19568]: DeleteAsyncMarkersSGIX (dynamic) */ + /* _mesa_function_pool[19611]: DeleteAsyncMarkersSGIX (dynamic) */ "ii\0" "glDeleteAsyncMarkersSGIX\0" "\0" - /* _mesa_function_pool[19597]: IsAsyncMarkerSGIX (dynamic) */ + /* _mesa_function_pool[19640]: IsAsyncMarkerSGIX (dynamic) */ "i\0" "glIsAsyncMarkerSGIX\0" "\0" - /* _mesa_function_pool[19620]: FrameZoomSGIX (dynamic) */ + /* _mesa_function_pool[19663]: FrameZoomSGIX (dynamic) */ "i\0" "glFrameZoomSGIX\0" "\0" - /* _mesa_function_pool[19639]: Normal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[19682]: Normal3fVertex3fvSUN (dynamic) */ "pp\0" "glNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[19666]: RasterPos4sv (offset 85) */ + /* _mesa_function_pool[19709]: RasterPos4sv (offset 85) */ "p\0" "glRasterPos4sv\0" "\0" - /* _mesa_function_pool[19684]: VertexAttrib4NsvARB (will be remapped) */ + /* _mesa_function_pool[19727]: VertexAttrib4NsvARB (will be remapped) */ "ip\0" "glVertexAttrib4Nsv\0" "glVertexAttrib4NsvARB\0" "\0" - /* _mesa_function_pool[19729]: VertexAttrib3fvARB (will be remapped) */ + /* _mesa_function_pool[19772]: VertexAttrib3fvARB (will be remapped) */ "ip\0" "glVertexAttrib3fv\0" "glVertexAttrib3fvARB\0" "\0" - /* _mesa_function_pool[19772]: ClearColor (offset 206) */ + /* _mesa_function_pool[19815]: ClearColor (offset 206) */ "ffff\0" "glClearColor\0" "\0" - /* _mesa_function_pool[19791]: GetSynciv (will be remapped) */ + /* _mesa_function_pool[19834]: GetSynciv (will be remapped) */ "iiipp\0" "glGetSynciv\0" "\0" - /* _mesa_function_pool[19810]: DeleteFramebuffersEXT (will be remapped) */ + /* _mesa_function_pool[19853]: DeleteFramebuffersEXT (will be remapped) */ "ip\0" "glDeleteFramebuffers\0" "glDeleteFramebuffersEXT\0" "\0" - /* _mesa_function_pool[19859]: GlobalAlphaFactorsSUN (dynamic) */ + /* _mesa_function_pool[19902]: GlobalAlphaFactorsSUN (dynamic) */ "i\0" "glGlobalAlphaFactorsSUN\0" "\0" - /* _mesa_function_pool[19886]: TexEnviv (offset 187) */ + /* _mesa_function_pool[19929]: TexEnviv (offset 187) */ "iip\0" "glTexEnviv\0" "\0" - /* _mesa_function_pool[19902]: TexSubImage3D (offset 372) */ + /* _mesa_function_pool[19945]: TexSubImage3D (offset 372) */ "iiiiiiiiiip\0" "glTexSubImage3D\0" "glTexSubImage3DEXT\0" "\0" - /* _mesa_function_pool[19950]: Tangent3fEXT (dynamic) */ + /* _mesa_function_pool[19993]: Tangent3fEXT (dynamic) */ "fff\0" "glTangent3fEXT\0" "\0" - /* _mesa_function_pool[19970]: SecondaryColor3uivEXT (will be remapped) */ + /* _mesa_function_pool[20013]: SecondaryColor3uivEXT (will be remapped) */ "p\0" "glSecondaryColor3uiv\0" "glSecondaryColor3uivEXT\0" "\0" - /* _mesa_function_pool[20018]: MatrixIndexubvARB (dynamic) */ + /* _mesa_function_pool[20061]: MatrixIndexubvARB (dynamic) */ "ip\0" "glMatrixIndexubvARB\0" "\0" - /* _mesa_function_pool[20042]: Color4fNormal3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[20085]: Color4fNormal3fVertex3fSUN (dynamic) */ "ffffffffff\0" "glColor4fNormal3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[20083]: PixelTexGenParameterfSGIS (will be remapped) */ + /* _mesa_function_pool[20126]: PixelTexGenParameterfSGIS (will be remapped) */ "if\0" "glPixelTexGenParameterfSGIS\0" "\0" - /* _mesa_function_pool[20115]: CreateShader (will be remapped) */ + /* _mesa_function_pool[20158]: CreateShader (will be remapped) */ "i\0" "glCreateShader\0" "\0" - /* _mesa_function_pool[20133]: GetColorTableParameterfv (offset 344) */ + /* _mesa_function_pool[20176]: GetColorTableParameterfv (offset 344) */ "iip\0" "glGetColorTableParameterfv\0" "glGetColorTableParameterfvSGI\0" "glGetColorTableParameterfvEXT\0" "\0" - /* _mesa_function_pool[20225]: FragmentLightModelfvSGIX (dynamic) */ + /* _mesa_function_pool[20268]: FragmentLightModelfvSGIX (dynamic) */ "ip\0" "glFragmentLightModelfvSGIX\0" "\0" - /* _mesa_function_pool[20256]: Bitmap (offset 8) */ + /* _mesa_function_pool[20299]: Bitmap (offset 8) */ "iiffffp\0" "glBitmap\0" "\0" - /* _mesa_function_pool[20274]: MultiTexCoord3fARB (offset 394) */ + /* _mesa_function_pool[20317]: MultiTexCoord3fARB (offset 394) */ "ifff\0" "glMultiTexCoord3f\0" "glMultiTexCoord3fARB\0" "\0" - /* _mesa_function_pool[20319]: GetTexLevelParameterfv (offset 284) */ + /* _mesa_function_pool[20362]: GetTexLevelParameterfv (offset 284) */ "iiip\0" "glGetTexLevelParameterfv\0" "\0" - /* _mesa_function_pool[20350]: GetPixelTexGenParameterfvSGIS (will be remapped) */ + /* _mesa_function_pool[20393]: GetPixelTexGenParameterfvSGIS (will be remapped) */ "ip\0" "glGetPixelTexGenParameterfvSGIS\0" "\0" - /* _mesa_function_pool[20386]: GenFramebuffersEXT (will be remapped) */ + /* _mesa_function_pool[20429]: GenFramebuffersEXT (will be remapped) */ "ip\0" "glGenFramebuffers\0" "glGenFramebuffersEXT\0" "\0" - /* _mesa_function_pool[20429]: GetProgramParameterdvNV (will be remapped) */ + /* _mesa_function_pool[20472]: GetProgramParameterdvNV (will be remapped) */ "iiip\0" "glGetProgramParameterdvNV\0" "\0" - /* _mesa_function_pool[20461]: Vertex2sv (offset 133) */ + /* _mesa_function_pool[20504]: Vertex2sv (offset 133) */ "p\0" "glVertex2sv\0" "\0" - /* _mesa_function_pool[20476]: GetIntegerv (offset 263) */ + /* _mesa_function_pool[20519]: GetIntegerv (offset 263) */ "ip\0" "glGetIntegerv\0" "\0" - /* _mesa_function_pool[20494]: IsVertexArrayAPPLE (will be remapped) */ + /* _mesa_function_pool[20537]: IsVertexArrayAPPLE (will be remapped) */ "i\0" "glIsVertexArray\0" "glIsVertexArrayAPPLE\0" "\0" - /* _mesa_function_pool[20534]: FragmentLightfvSGIX (dynamic) */ + /* _mesa_function_pool[20577]: FragmentLightfvSGIX (dynamic) */ "iip\0" "glFragmentLightfvSGIX\0" "\0" - /* _mesa_function_pool[20561]: DetachShader (will be remapped) */ + /* _mesa_function_pool[20604]: DetachShader (will be remapped) */ "ii\0" "glDetachShader\0" "\0" - /* _mesa_function_pool[20580]: VertexAttrib4NubARB (will be remapped) */ + /* _mesa_function_pool[20623]: VertexAttrib4NubARB (will be remapped) */ "iiiii\0" "glVertexAttrib4Nub\0" "glVertexAttrib4NubARB\0" "\0" - /* _mesa_function_pool[20628]: GetProgramEnvParameterfvARB (will be remapped) */ + /* _mesa_function_pool[20671]: GetProgramEnvParameterfvARB (will be remapped) */ "iip\0" "glGetProgramEnvParameterfvARB\0" "\0" - /* _mesa_function_pool[20663]: GetTrackMatrixivNV (will be remapped) */ + /* _mesa_function_pool[20706]: GetTrackMatrixivNV (will be remapped) */ "iiip\0" "glGetTrackMatrixivNV\0" "\0" - /* _mesa_function_pool[20690]: VertexAttrib3svNV (will be remapped) */ + /* _mesa_function_pool[20733]: VertexAttrib3svNV (will be remapped) */ "ip\0" "glVertexAttrib3svNV\0" "\0" - /* _mesa_function_pool[20714]: Uniform4fvARB (will be remapped) */ + /* _mesa_function_pool[20757]: Uniform4fvARB (will be remapped) */ "iip\0" "glUniform4fv\0" "glUniform4fvARB\0" "\0" - /* _mesa_function_pool[20748]: MultTransposeMatrixfARB (will be remapped) */ + /* _mesa_function_pool[20791]: MultTransposeMatrixfARB (will be remapped) */ "p\0" "glMultTransposeMatrixf\0" "glMultTransposeMatrixfARB\0" "\0" - /* _mesa_function_pool[20800]: GetTexEnviv (offset 277) */ + /* _mesa_function_pool[20843]: GetTexEnviv (offset 277) */ "iip\0" "glGetTexEnviv\0" "\0" - /* _mesa_function_pool[20819]: ColorFragmentOp1ATI (will be remapped) */ + /* _mesa_function_pool[20862]: ColorFragmentOp1ATI (will be remapped) */ "iiiiiii\0" "glColorFragmentOp1ATI\0" "\0" - /* _mesa_function_pool[20850]: GetUniformfvARB (will be remapped) */ + /* _mesa_function_pool[20893]: GetUniformfvARB (will be remapped) */ "iip\0" "glGetUniformfv\0" "glGetUniformfvARB\0" "\0" - /* _mesa_function_pool[20888]: PopClientAttrib (offset 334) */ + /* _mesa_function_pool[20931]: PopClientAttrib (offset 334) */ "\0" "glPopClientAttrib\0" "\0" - /* _mesa_function_pool[20908]: ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[20951]: ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (dynamic) */ "iffffffffffff\0" "glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[20979]: DetachObjectARB (will be remapped) */ + /* _mesa_function_pool[21022]: DetachObjectARB (will be remapped) */ "ii\0" "glDetachObjectARB\0" "\0" - /* _mesa_function_pool[21001]: VertexBlendARB (dynamic) */ + /* _mesa_function_pool[21044]: VertexBlendARB (dynamic) */ "i\0" "glVertexBlendARB\0" "\0" - /* _mesa_function_pool[21021]: WindowPos3iMESA (will be remapped) */ + /* _mesa_function_pool[21064]: WindowPos3iMESA (will be remapped) */ "iii\0" "glWindowPos3i\0" "glWindowPos3iARB\0" "glWindowPos3iMESA\0" "\0" - /* _mesa_function_pool[21075]: SeparableFilter2D (offset 360) */ + /* _mesa_function_pool[21118]: SeparableFilter2D (offset 360) */ "iiiiiipp\0" "glSeparableFilter2D\0" "glSeparableFilter2DEXT\0" "\0" - /* _mesa_function_pool[21128]: ReplacementCodeuiColor4ubVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[21171]: ReplacementCodeuiColor4ubVertex3fvSUN (dynamic) */ "ppp\0" "glReplacementCodeuiColor4ubVertex3fvSUN\0" "\0" - /* _mesa_function_pool[21173]: Map1d (offset 220) */ + /* _mesa_function_pool[21216]: Map1d (offset 220) */ "iddiip\0" "glMap1d\0" "\0" - /* _mesa_function_pool[21189]: Map1f (offset 221) */ + /* _mesa_function_pool[21232]: Map1f (offset 221) */ "iffiip\0" "glMap1f\0" "\0" - /* _mesa_function_pool[21205]: CompressedTexImage2DARB (will be remapped) */ + /* _mesa_function_pool[21248]: CompressedTexImage2DARB (will be remapped) */ "iiiiiiip\0" "glCompressedTexImage2D\0" "glCompressedTexImage2DARB\0" "\0" - /* _mesa_function_pool[21264]: ArrayElement (offset 306) */ + /* _mesa_function_pool[21307]: ArrayElement (offset 306) */ "i\0" "glArrayElement\0" "glArrayElementEXT\0" "\0" - /* _mesa_function_pool[21300]: TexImage2D (offset 183) */ + /* _mesa_function_pool[21343]: TexImage2D (offset 183) */ "iiiiiiiip\0" "glTexImage2D\0" "\0" - /* _mesa_function_pool[21324]: DepthBoundsEXT (will be remapped) */ + /* _mesa_function_pool[21367]: DepthBoundsEXT (will be remapped) */ "dd\0" "glDepthBoundsEXT\0" "\0" - /* _mesa_function_pool[21345]: ProgramParameters4fvNV (will be remapped) */ + /* _mesa_function_pool[21388]: ProgramParameters4fvNV (will be remapped) */ "iiip\0" "glProgramParameters4fvNV\0" "\0" - /* _mesa_function_pool[21376]: DeformationMap3fSGIX (dynamic) */ + /* _mesa_function_pool[21419]: DeformationMap3fSGIX (dynamic) */ "iffiiffiiffiip\0" "glDeformationMap3fSGIX\0" "\0" - /* _mesa_function_pool[21415]: GetProgramivNV (will be remapped) */ + /* _mesa_function_pool[21458]: GetProgramivNV (will be remapped) */ "iip\0" "glGetProgramivNV\0" "\0" - /* _mesa_function_pool[21437]: GetMinmaxParameteriv (offset 366) */ + /* _mesa_function_pool[21480]: GetMinmaxParameteriv (offset 366) */ "iip\0" "glGetMinmaxParameteriv\0" "glGetMinmaxParameterivEXT\0" "\0" - /* _mesa_function_pool[21491]: PixelTransferf (offset 247) */ + /* _mesa_function_pool[21534]: PixelTransferf (offset 247) */ "if\0" "glPixelTransferf\0" "\0" - /* _mesa_function_pool[21512]: CopyTexImage1D (offset 323) */ + /* _mesa_function_pool[21555]: CopyTexImage1D (offset 323) */ "iiiiiii\0" "glCopyTexImage1D\0" "glCopyTexImage1DEXT\0" "\0" - /* _mesa_function_pool[21558]: PushMatrix (offset 298) */ + /* _mesa_function_pool[21601]: PushMatrix (offset 298) */ "\0" "glPushMatrix\0" "\0" - /* _mesa_function_pool[21573]: Fogiv (offset 156) */ + /* _mesa_function_pool[21616]: Fogiv (offset 156) */ "ip\0" "glFogiv\0" "\0" - /* _mesa_function_pool[21585]: TexCoord1dv (offset 95) */ + /* _mesa_function_pool[21628]: TexCoord1dv (offset 95) */ "p\0" "glTexCoord1dv\0" "\0" - /* _mesa_function_pool[21602]: AlphaFragmentOp3ATI (will be remapped) */ + /* _mesa_function_pool[21645]: AlphaFragmentOp3ATI (will be remapped) */ "iiiiiiiiiiii\0" "glAlphaFragmentOp3ATI\0" "\0" - /* _mesa_function_pool[21638]: PixelTransferi (offset 248) */ + /* _mesa_function_pool[21681]: PixelTransferi (offset 248) */ "ii\0" "glPixelTransferi\0" "\0" - /* _mesa_function_pool[21659]: GetVertexAttribdvNV (will be remapped) */ + /* _mesa_function_pool[21702]: GetVertexAttribdvNV (will be remapped) */ "iip\0" "glGetVertexAttribdvNV\0" "\0" - /* _mesa_function_pool[21686]: VertexAttrib3fvNV (will be remapped) */ + /* _mesa_function_pool[21729]: VertexAttrib3fvNV (will be remapped) */ "ip\0" "glVertexAttrib3fvNV\0" "\0" - /* _mesa_function_pool[21710]: Rotatef (offset 300) */ + /* _mesa_function_pool[21753]: Rotatef (offset 300) */ "ffff\0" "glRotatef\0" "\0" - /* _mesa_function_pool[21726]: GetFinalCombinerInputParameterivNV (will be remapped) */ + /* _mesa_function_pool[21769]: GetFinalCombinerInputParameterivNV (will be remapped) */ "iip\0" "glGetFinalCombinerInputParameterivNV\0" "\0" - /* _mesa_function_pool[21768]: Vertex3i (offset 138) */ + /* _mesa_function_pool[21811]: Vertex3i (offset 138) */ "iii\0" "glVertex3i\0" "\0" - /* _mesa_function_pool[21784]: Vertex3f (offset 136) */ + /* _mesa_function_pool[21827]: Vertex3f (offset 136) */ "fff\0" "glVertex3f\0" "\0" - /* _mesa_function_pool[21800]: Clear (offset 203) */ + /* _mesa_function_pool[21843]: Clear (offset 203) */ "i\0" "glClear\0" "\0" - /* _mesa_function_pool[21811]: Vertex3d (offset 134) */ + /* _mesa_function_pool[21854]: Vertex3d (offset 134) */ "ddd\0" "glVertex3d\0" "\0" - /* _mesa_function_pool[21827]: GetMapParameterivNV (dynamic) */ + /* _mesa_function_pool[21870]: GetMapParameterivNV (dynamic) */ "iip\0" "glGetMapParameterivNV\0" "\0" - /* _mesa_function_pool[21854]: Uniform4iARB (will be remapped) */ + /* _mesa_function_pool[21897]: Uniform4iARB (will be remapped) */ "iiiii\0" "glUniform4i\0" "glUniform4iARB\0" "\0" - /* _mesa_function_pool[21888]: ReadBuffer (offset 254) */ + /* _mesa_function_pool[21931]: ReadBuffer (offset 254) */ "i\0" "glReadBuffer\0" "\0" - /* _mesa_function_pool[21904]: ConvolutionParameteri (offset 352) */ + /* _mesa_function_pool[21947]: ConvolutionParameteri (offset 352) */ "iii\0" "glConvolutionParameteri\0" "glConvolutionParameteriEXT\0" "\0" - /* _mesa_function_pool[21960]: Ortho (offset 296) */ + /* _mesa_function_pool[22003]: Ortho (offset 296) */ "dddddd\0" "glOrtho\0" "\0" - /* _mesa_function_pool[21976]: Binormal3sEXT (dynamic) */ + /* _mesa_function_pool[22019]: Binormal3sEXT (dynamic) */ "iii\0" "glBinormal3sEXT\0" "\0" - /* _mesa_function_pool[21997]: ListBase (offset 6) */ + /* _mesa_function_pool[22040]: ListBase (offset 6) */ "i\0" "glListBase\0" "\0" - /* _mesa_function_pool[22011]: Vertex3s (offset 140) */ + /* _mesa_function_pool[22054]: Vertex3s (offset 140) */ "iii\0" "glVertex3s\0" "\0" - /* _mesa_function_pool[22027]: ConvolutionParameterf (offset 350) */ + /* _mesa_function_pool[22070]: ConvolutionParameterf (offset 350) */ "iif\0" "glConvolutionParameterf\0" "glConvolutionParameterfEXT\0" "\0" - /* _mesa_function_pool[22083]: GetColorTableParameteriv (offset 345) */ + /* _mesa_function_pool[22126]: GetColorTableParameteriv (offset 345) */ "iip\0" "glGetColorTableParameteriv\0" "glGetColorTableParameterivSGI\0" "glGetColorTableParameterivEXT\0" "\0" - /* _mesa_function_pool[22175]: ProgramEnvParameter4dvARB (will be remapped) */ + /* _mesa_function_pool[22218]: ProgramEnvParameter4dvARB (will be remapped) */ "iip\0" "glProgramEnvParameter4dvARB\0" "glProgramParameter4dvNV\0" "\0" - /* _mesa_function_pool[22232]: ShadeModel (offset 177) */ + /* _mesa_function_pool[22275]: ShadeModel (offset 177) */ "i\0" "glShadeModel\0" "\0" - /* _mesa_function_pool[22248]: VertexAttribs2fvNV (will be remapped) */ + /* _mesa_function_pool[22291]: VertexAttribs2fvNV (will be remapped) */ "iip\0" "glVertexAttribs2fvNV\0" "\0" - /* _mesa_function_pool[22274]: Rectiv (offset 91) */ + /* _mesa_function_pool[22317]: Rectiv (offset 91) */ "pp\0" "glRectiv\0" "\0" - /* _mesa_function_pool[22287]: UseProgramObjectARB (will be remapped) */ + /* _mesa_function_pool[22330]: UseProgramObjectARB (will be remapped) */ "i\0" "glUseProgram\0" "glUseProgramObjectARB\0" "\0" - /* _mesa_function_pool[22325]: GetMapParameterfvNV (dynamic) */ + /* _mesa_function_pool[22368]: GetMapParameterfvNV (dynamic) */ "iip\0" "glGetMapParameterfvNV\0" "\0" - /* _mesa_function_pool[22352]: PassTexCoordATI (will be remapped) */ + /* _mesa_function_pool[22395]: PassTexCoordATI (will be remapped) */ "iii\0" "glPassTexCoordATI\0" "\0" - /* _mesa_function_pool[22375]: DeleteProgram (will be remapped) */ + /* _mesa_function_pool[22418]: DeleteProgram (will be remapped) */ "i\0" "glDeleteProgram\0" "\0" - /* _mesa_function_pool[22394]: Tangent3ivEXT (dynamic) */ + /* _mesa_function_pool[22437]: Tangent3ivEXT (dynamic) */ "p\0" "glTangent3ivEXT\0" "\0" - /* _mesa_function_pool[22413]: Tangent3dEXT (dynamic) */ + /* _mesa_function_pool[22456]: Tangent3dEXT (dynamic) */ "ddd\0" "glTangent3dEXT\0" "\0" - /* _mesa_function_pool[22433]: SecondaryColor3dvEXT (will be remapped) */ + /* _mesa_function_pool[22476]: SecondaryColor3dvEXT (will be remapped) */ "p\0" "glSecondaryColor3dv\0" "glSecondaryColor3dvEXT\0" "\0" - /* _mesa_function_pool[22479]: Vertex2fv (offset 129) */ + /* _mesa_function_pool[22522]: Vertex2fv (offset 129) */ "p\0" "glVertex2fv\0" "\0" - /* _mesa_function_pool[22494]: MultiDrawArraysEXT (will be remapped) */ + /* _mesa_function_pool[22537]: MultiDrawArraysEXT (will be remapped) */ "ippi\0" "glMultiDrawArrays\0" "glMultiDrawArraysEXT\0" "\0" - /* _mesa_function_pool[22539]: BindRenderbufferEXT (will be remapped) */ + /* _mesa_function_pool[22582]: BindRenderbufferEXT (will be remapped) */ "ii\0" "glBindRenderbuffer\0" "glBindRenderbufferEXT\0" "\0" - /* _mesa_function_pool[22584]: MultiTexCoord4dARB (offset 400) */ + /* _mesa_function_pool[22627]: MultiTexCoord4dARB (offset 400) */ "idddd\0" "glMultiTexCoord4d\0" "glMultiTexCoord4dARB\0" "\0" - /* _mesa_function_pool[22630]: Vertex3sv (offset 141) */ + /* _mesa_function_pool[22673]: Vertex3sv (offset 141) */ "p\0" "glVertex3sv\0" "\0" - /* _mesa_function_pool[22645]: SecondaryColor3usEXT (will be remapped) */ + /* _mesa_function_pool[22688]: SecondaryColor3usEXT (will be remapped) */ "iii\0" "glSecondaryColor3us\0" "glSecondaryColor3usEXT\0" "\0" - /* _mesa_function_pool[22693]: ProgramLocalParameter4fvARB (will be remapped) */ + /* _mesa_function_pool[22736]: ProgramLocalParameter4fvARB (will be remapped) */ "iip\0" "glProgramLocalParameter4fvARB\0" "\0" - /* _mesa_function_pool[22728]: DeleteProgramsNV (will be remapped) */ + /* _mesa_function_pool[22771]: DeleteProgramsNV (will be remapped) */ "ip\0" "glDeleteProgramsARB\0" "glDeleteProgramsNV\0" "\0" - /* _mesa_function_pool[22771]: EvalMesh1 (offset 236) */ + /* _mesa_function_pool[22814]: EvalMesh1 (offset 236) */ "iii\0" "glEvalMesh1\0" "\0" - /* _mesa_function_pool[22788]: MultiTexCoord1sARB (offset 382) */ + /* _mesa_function_pool[22831]: MultiTexCoord1sARB (offset 382) */ "ii\0" "glMultiTexCoord1s\0" "glMultiTexCoord1sARB\0" "\0" - /* _mesa_function_pool[22831]: ReplacementCodeuiColor3fVertex3fSUN (dynamic) */ + /* _mesa_function_pool[22874]: ReplacementCodeuiColor3fVertex3fSUN (dynamic) */ "iffffff\0" "glReplacementCodeuiColor3fVertex3fSUN\0" "\0" - /* _mesa_function_pool[22878]: GetVertexAttribPointervNV (will be remapped) */ + /* _mesa_function_pool[22921]: GetVertexAttribPointervNV (will be remapped) */ "iip\0" "glGetVertexAttribPointerv\0" "glGetVertexAttribPointervARB\0" "glGetVertexAttribPointervNV\0" "\0" - /* _mesa_function_pool[22966]: MultiTexCoord1dvARB (offset 377) */ + /* _mesa_function_pool[23009]: MultiTexCoord1dvARB (offset 377) */ "ip\0" "glMultiTexCoord1dv\0" "glMultiTexCoord1dvARB\0" "\0" - /* _mesa_function_pool[23011]: Uniform2iARB (will be remapped) */ + /* _mesa_function_pool[23054]: Uniform2iARB (will be remapped) */ "iii\0" "glUniform2i\0" "glUniform2iARB\0" "\0" - /* _mesa_function_pool[23043]: Vertex2iv (offset 131) */ + /* _mesa_function_pool[23086]: Vertex2iv (offset 131) */ "p\0" "glVertex2iv\0" "\0" - /* _mesa_function_pool[23058]: GetProgramStringNV (will be remapped) */ + /* _mesa_function_pool[23101]: GetProgramStringNV (will be remapped) */ "iip\0" "glGetProgramStringNV\0" "\0" - /* _mesa_function_pool[23084]: ColorPointerEXT (will be remapped) */ + /* _mesa_function_pool[23127]: ColorPointerEXT (will be remapped) */ "iiiip\0" "glColorPointerEXT\0" "\0" - /* _mesa_function_pool[23109]: LineWidth (offset 168) */ + /* _mesa_function_pool[23152]: LineWidth (offset 168) */ "f\0" "glLineWidth\0" "\0" - /* _mesa_function_pool[23124]: MapBufferARB (will be remapped) */ + /* _mesa_function_pool[23167]: MapBufferARB (will be remapped) */ "ii\0" "glMapBuffer\0" "glMapBufferARB\0" "\0" - /* _mesa_function_pool[23155]: MultiDrawElementsBaseVertex (will be remapped) */ + /* _mesa_function_pool[23198]: MultiDrawElementsBaseVertex (will be remapped) */ "ipipip\0" "glMultiDrawElementsBaseVertex\0" "\0" - /* _mesa_function_pool[23193]: Binormal3svEXT (dynamic) */ + /* _mesa_function_pool[23236]: Binormal3svEXT (dynamic) */ "p\0" "glBinormal3svEXT\0" "\0" - /* _mesa_function_pool[23213]: ApplyTextureEXT (dynamic) */ + /* _mesa_function_pool[23256]: ApplyTextureEXT (dynamic) */ "i\0" "glApplyTextureEXT\0" "\0" - /* _mesa_function_pool[23234]: TexGendv (offset 189) */ + /* _mesa_function_pool[23277]: TexGendv (offset 189) */ "iip\0" "glTexGendv\0" "\0" - /* _mesa_function_pool[23250]: TextureMaterialEXT (dynamic) */ + /* _mesa_function_pool[23293]: TextureMaterialEXT (dynamic) */ "ii\0" "glTextureMaterialEXT\0" "\0" - /* _mesa_function_pool[23275]: TextureLightEXT (dynamic) */ + /* _mesa_function_pool[23318]: TextureLightEXT (dynamic) */ "i\0" "glTextureLightEXT\0" "\0" - /* _mesa_function_pool[23296]: ResetMinmax (offset 370) */ + /* _mesa_function_pool[23339]: ResetMinmax (offset 370) */ "i\0" "glResetMinmax\0" "glResetMinmaxEXT\0" "\0" - /* _mesa_function_pool[23330]: SpriteParameterfSGIX (dynamic) */ + /* _mesa_function_pool[23373]: SpriteParameterfSGIX (dynamic) */ "if\0" "glSpriteParameterfSGIX\0" "\0" - /* _mesa_function_pool[23357]: EnableClientState (offset 313) */ + /* _mesa_function_pool[23400]: EnableClientState (offset 313) */ "i\0" "glEnableClientState\0" "\0" - /* _mesa_function_pool[23380]: VertexAttrib4sNV (will be remapped) */ + /* _mesa_function_pool[23423]: VertexAttrib4sNV (will be remapped) */ "iiiii\0" "glVertexAttrib4sNV\0" "\0" - /* _mesa_function_pool[23406]: GetConvolutionParameterfv (offset 357) */ + /* _mesa_function_pool[23449]: GetConvolutionParameterfv (offset 357) */ "iip\0" "glGetConvolutionParameterfv\0" "glGetConvolutionParameterfvEXT\0" "\0" - /* _mesa_function_pool[23470]: VertexAttribs4dvNV (will be remapped) */ + /* _mesa_function_pool[23513]: VertexAttribs4dvNV (will be remapped) */ "iip\0" "glVertexAttribs4dvNV\0" "\0" - /* _mesa_function_pool[23496]: VertexAttrib4dARB (will be remapped) */ + /* _mesa_function_pool[23539]: MultiModeDrawArraysIBM (will be remapped) */ + "pppii\0" + "glMultiModeDrawArraysIBM\0" + "\0" + /* _mesa_function_pool[23571]: VertexAttrib4dARB (will be remapped) */ "idddd\0" "glVertexAttrib4d\0" "glVertexAttrib4dARB\0" "\0" - /* _mesa_function_pool[23540]: GetTexBumpParameterfvATI (will be remapped) */ + /* _mesa_function_pool[23615]: GetTexBumpParameterfvATI (will be remapped) */ "ip\0" "glGetTexBumpParameterfvATI\0" "\0" - /* _mesa_function_pool[23571]: ProgramNamedParameter4dNV (will be remapped) */ + /* _mesa_function_pool[23646]: ProgramNamedParameter4dNV (will be remapped) */ "iipdddd\0" "glProgramNamedParameter4dNV\0" "\0" - /* _mesa_function_pool[23608]: GetMaterialfv (offset 269) */ + /* _mesa_function_pool[23683]: GetMaterialfv (offset 269) */ "iip\0" "glGetMaterialfv\0" "\0" - /* _mesa_function_pool[23629]: VertexWeightfEXT (dynamic) */ + /* _mesa_function_pool[23704]: VertexWeightfEXT (dynamic) */ "f\0" "glVertexWeightfEXT\0" "\0" - /* _mesa_function_pool[23651]: Binormal3fEXT (dynamic) */ + /* _mesa_function_pool[23726]: Binormal3fEXT (dynamic) */ "fff\0" "glBinormal3fEXT\0" "\0" - /* _mesa_function_pool[23672]: CallList (offset 2) */ + /* _mesa_function_pool[23747]: CallList (offset 2) */ "i\0" "glCallList\0" "\0" - /* _mesa_function_pool[23686]: Materialfv (offset 170) */ + /* _mesa_function_pool[23761]: Materialfv (offset 170) */ "iip\0" "glMaterialfv\0" "\0" - /* _mesa_function_pool[23704]: TexCoord3fv (offset 113) */ + /* _mesa_function_pool[23779]: TexCoord3fv (offset 113) */ "p\0" "glTexCoord3fv\0" "\0" - /* _mesa_function_pool[23721]: FogCoordfvEXT (will be remapped) */ + /* _mesa_function_pool[23796]: FogCoordfvEXT (will be remapped) */ "p\0" "glFogCoordfv\0" "glFogCoordfvEXT\0" "\0" - /* _mesa_function_pool[23753]: MultiTexCoord1ivARB (offset 381) */ + /* _mesa_function_pool[23828]: MultiTexCoord1ivARB (offset 381) */ "ip\0" "glMultiTexCoord1iv\0" "glMultiTexCoord1ivARB\0" "\0" - /* _mesa_function_pool[23798]: SecondaryColor3ubEXT (will be remapped) */ + /* _mesa_function_pool[23873]: SecondaryColor3ubEXT (will be remapped) */ "iii\0" "glSecondaryColor3ub\0" "glSecondaryColor3ubEXT\0" "\0" - /* _mesa_function_pool[23846]: MultiTexCoord2ivARB (offset 389) */ + /* _mesa_function_pool[23921]: MultiTexCoord2ivARB (offset 389) */ "ip\0" "glMultiTexCoord2iv\0" "glMultiTexCoord2ivARB\0" "\0" - /* _mesa_function_pool[23891]: FogFuncSGIS (dynamic) */ + /* _mesa_function_pool[23966]: FogFuncSGIS (dynamic) */ "ip\0" "glFogFuncSGIS\0" "\0" - /* _mesa_function_pool[23909]: CopyTexSubImage2D (offset 326) */ + /* _mesa_function_pool[23984]: CopyTexSubImage2D (offset 326) */ "iiiiiiii\0" "glCopyTexSubImage2D\0" "glCopyTexSubImage2DEXT\0" "\0" - /* _mesa_function_pool[23962]: GetObjectParameterivARB (will be remapped) */ + /* _mesa_function_pool[24037]: GetObjectParameterivARB (will be remapped) */ "iip\0" "glGetObjectParameterivARB\0" "\0" - /* _mesa_function_pool[23993]: Color3iv (offset 16) */ + /* _mesa_function_pool[24068]: Color3iv (offset 16) */ "p\0" "glColor3iv\0" "\0" - /* _mesa_function_pool[24007]: TexCoord4fVertex4fSUN (dynamic) */ + /* _mesa_function_pool[24082]: TexCoord4fVertex4fSUN (dynamic) */ "ffffffff\0" "glTexCoord4fVertex4fSUN\0" "\0" - /* _mesa_function_pool[24041]: DrawElements (offset 311) */ + /* _mesa_function_pool[24116]: DrawElements (offset 311) */ "iiip\0" "glDrawElements\0" "\0" - /* _mesa_function_pool[24062]: BindVertexArrayAPPLE (will be remapped) */ + /* _mesa_function_pool[24137]: BindVertexArrayAPPLE (will be remapped) */ "i\0" "glBindVertexArrayAPPLE\0" "\0" - /* _mesa_function_pool[24088]: GetProgramLocalParameterdvARB (will be remapped) */ + /* _mesa_function_pool[24163]: GetProgramLocalParameterdvARB (will be remapped) */ "iip\0" "glGetProgramLocalParameterdvARB\0" "\0" - /* _mesa_function_pool[24125]: GetHistogramParameteriv (offset 363) */ + /* _mesa_function_pool[24200]: GetHistogramParameteriv (offset 363) */ "iip\0" "glGetHistogramParameteriv\0" "glGetHistogramParameterivEXT\0" "\0" - /* _mesa_function_pool[24185]: MultiTexCoord1iARB (offset 380) */ + /* _mesa_function_pool[24260]: MultiTexCoord1iARB (offset 380) */ "ii\0" "glMultiTexCoord1i\0" "glMultiTexCoord1iARB\0" "\0" - /* _mesa_function_pool[24228]: GetConvolutionFilter (offset 356) */ + /* _mesa_function_pool[24303]: GetConvolutionFilter (offset 356) */ "iiip\0" "glGetConvolutionFilter\0" "glGetConvolutionFilterEXT\0" "\0" - /* _mesa_function_pool[24283]: GetProgramivARB (will be remapped) */ + /* _mesa_function_pool[24358]: GetProgramivARB (will be remapped) */ "iip\0" "glGetProgramivARB\0" "\0" - /* _mesa_function_pool[24306]: BlendFuncSeparateEXT (will be remapped) */ + /* _mesa_function_pool[24381]: BlendFuncSeparateEXT (will be remapped) */ "iiii\0" "glBlendFuncSeparate\0" "glBlendFuncSeparateEXT\0" "glBlendFuncSeparateINGR\0" "\0" - /* _mesa_function_pool[24379]: MapBufferRange (will be remapped) */ + /* _mesa_function_pool[24454]: MapBufferRange (will be remapped) */ "iiii\0" "glMapBufferRange\0" "\0" - /* _mesa_function_pool[24402]: ProgramParameters4dvNV (will be remapped) */ + /* _mesa_function_pool[24477]: ProgramParameters4dvNV (will be remapped) */ "iiip\0" "glProgramParameters4dvNV\0" "\0" - /* _mesa_function_pool[24433]: TexCoord2fColor3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[24508]: TexCoord2fColor3fVertex3fvSUN (dynamic) */ "ppp\0" "glTexCoord2fColor3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[24470]: EvalPoint2 (offset 239) */ + /* _mesa_function_pool[24545]: EvalPoint2 (offset 239) */ "ii\0" "glEvalPoint2\0" "\0" - /* _mesa_function_pool[24487]: EvalPoint1 (offset 237) */ + /* _mesa_function_pool[24562]: EvalPoint1 (offset 237) */ "i\0" "glEvalPoint1\0" "\0" - /* _mesa_function_pool[24503]: Binormal3dvEXT (dynamic) */ + /* _mesa_function_pool[24578]: Binormal3dvEXT (dynamic) */ "p\0" "glBinormal3dvEXT\0" "\0" - /* _mesa_function_pool[24523]: PopMatrix (offset 297) */ + /* _mesa_function_pool[24598]: PopMatrix (offset 297) */ "\0" "glPopMatrix\0" "\0" - /* _mesa_function_pool[24537]: FinishFenceNV (will be remapped) */ + /* _mesa_function_pool[24612]: FinishFenceNV (will be remapped) */ "i\0" "glFinishFenceNV\0" "\0" - /* _mesa_function_pool[24556]: GetFogFuncSGIS (dynamic) */ + /* _mesa_function_pool[24631]: GetFogFuncSGIS (dynamic) */ "p\0" "glGetFogFuncSGIS\0" "\0" - /* _mesa_function_pool[24576]: GetUniformLocationARB (will be remapped) */ + /* _mesa_function_pool[24651]: GetUniformLocationARB (will be remapped) */ "ip\0" "glGetUniformLocation\0" "glGetUniformLocationARB\0" "\0" - /* _mesa_function_pool[24625]: SecondaryColor3fEXT (will be remapped) */ + /* _mesa_function_pool[24700]: SecondaryColor3fEXT (will be remapped) */ "fff\0" "glSecondaryColor3f\0" "glSecondaryColor3fEXT\0" "\0" - /* _mesa_function_pool[24671]: GetTexGeniv (offset 280) */ + /* _mesa_function_pool[24746]: GetTexGeniv (offset 280) */ "iip\0" "glGetTexGeniv\0" "\0" - /* _mesa_function_pool[24690]: CombinerInputNV (will be remapped) */ + /* _mesa_function_pool[24765]: CombinerInputNV (will be remapped) */ "iiiiii\0" "glCombinerInputNV\0" "\0" - /* _mesa_function_pool[24716]: VertexAttrib3sARB (will be remapped) */ + /* _mesa_function_pool[24791]: VertexAttrib3sARB (will be remapped) */ "iiii\0" "glVertexAttrib3s\0" "glVertexAttrib3sARB\0" "\0" - /* _mesa_function_pool[24759]: ReplacementCodeuiNormal3fVertex3fvSUN (dynamic) */ + /* _mesa_function_pool[24834]: ReplacementCodeuiNormal3fVertex3fvSUN (dynamic) */ "ppp\0" "glReplacementCodeuiNormal3fVertex3fvSUN\0" "\0" - /* _mesa_function_pool[24804]: Map2d (offset 222) */ + /* _mesa_function_pool[24879]: Map2d (offset 222) */ "iddiiddiip\0" "glMap2d\0" "\0" - /* _mesa_function_pool[24824]: Map2f (offset 223) */ + /* _mesa_function_pool[24899]: Map2f (offset 223) */ "iffiiffiip\0" "glMap2f\0" "\0" - /* _mesa_function_pool[24844]: ProgramStringARB (will be remapped) */ + /* _mesa_function_pool[24919]: ProgramStringARB (will be remapped) */ "iiip\0" "glProgramStringARB\0" "\0" - /* _mesa_function_pool[24869]: Vertex4s (offset 148) */ + /* _mesa_function_pool[24944]: Vertex4s (offset 148) */ "iiii\0" "glVertex4s\0" "\0" - /* _mesa_function_pool[24886]: TexCoord4fVertex4fvSUN (dynamic) */ + /* _mesa_function_pool[24961]: TexCoord4fVertex4fvSUN (dynamic) */ "pp\0" "glTexCoord4fVertex4fvSUN\0" "\0" - /* _mesa_function_pool[24915]: VertexAttrib3sNV (will be remapped) */ + /* _mesa_function_pool[24990]: VertexAttrib3sNV (will be remapped) */ "iiii\0" "glVertexAttrib3sNV\0" "\0" - /* _mesa_function_pool[24940]: VertexAttrib1fNV (will be remapped) */ + /* _mesa_function_pool[25015]: VertexAttrib1fNV (will be remapped) */ "if\0" "glVertexAttrib1fNV\0" "\0" - /* _mesa_function_pool[24963]: Vertex4f (offset 144) */ + /* _mesa_function_pool[25038]: Vertex4f (offset 144) */ "ffff\0" "glVertex4f\0" "\0" - /* _mesa_function_pool[24980]: EvalCoord1d (offset 228) */ + /* _mesa_function_pool[25055]: EvalCoord1d (offset 228) */ "d\0" "glEvalCoord1d\0" "\0" - /* _mesa_function_pool[24997]: Vertex4d (offset 142) */ + /* _mesa_function_pool[25072]: Vertex4d (offset 142) */ "dddd\0" "glVertex4d\0" "\0" - /* _mesa_function_pool[25014]: RasterPos4dv (offset 79) */ + /* _mesa_function_pool[25089]: RasterPos4dv (offset 79) */ "p\0" "glRasterPos4dv\0" "\0" - /* _mesa_function_pool[25032]: FragmentLightfSGIX (dynamic) */ + /* _mesa_function_pool[25107]: FragmentLightfSGIX (dynamic) */ "iif\0" "glFragmentLightfSGIX\0" "\0" - /* _mesa_function_pool[25058]: GetCompressedTexImageARB (will be remapped) */ + /* _mesa_function_pool[25133]: GetCompressedTexImageARB (will be remapped) */ "iip\0" "glGetCompressedTexImage\0" "glGetCompressedTexImageARB\0" "\0" - /* _mesa_function_pool[25114]: GetTexGenfv (offset 279) */ + /* _mesa_function_pool[25189]: GetTexGenfv (offset 279) */ "iip\0" "glGetTexGenfv\0" "\0" - /* _mesa_function_pool[25133]: Vertex4i (offset 146) */ + /* _mesa_function_pool[25208]: Vertex4i (offset 146) */ "iiii\0" "glVertex4i\0" "\0" - /* _mesa_function_pool[25150]: VertexWeightPointerEXT (dynamic) */ + /* _mesa_function_pool[25225]: VertexWeightPointerEXT (dynamic) */ "iiip\0" "glVertexWeightPointerEXT\0" "\0" - /* _mesa_function_pool[25181]: GetHistogram (offset 361) */ + /* _mesa_function_pool[25256]: GetHistogram (offset 361) */ "iiiip\0" "glGetHistogram\0" "glGetHistogramEXT\0" "\0" - /* _mesa_function_pool[25221]: ActiveStencilFaceEXT (will be remapped) */ + /* _mesa_function_pool[25296]: ActiveStencilFaceEXT (will be remapped) */ "i\0" "glActiveStencilFaceEXT\0" "\0" - /* _mesa_function_pool[25247]: StencilFuncSeparateATI (will be remapped) */ + /* _mesa_function_pool[25322]: StencilFuncSeparateATI (will be remapped) */ "iiii\0" "glStencilFuncSeparateATI\0" "\0" - /* _mesa_function_pool[25278]: Materialf (offset 169) */ + /* _mesa_function_pool[25353]: Materialf (offset 169) */ "iif\0" "glMaterialf\0" "\0" - /* _mesa_function_pool[25295]: GetShaderSourceARB (will be remapped) */ + /* _mesa_function_pool[25370]: GetShaderSourceARB (will be remapped) */ "iipp\0" "glGetShaderSource\0" "glGetShaderSourceARB\0" "\0" - /* _mesa_function_pool[25340]: IglooInterfaceSGIX (dynamic) */ + /* _mesa_function_pool[25415]: IglooInterfaceSGIX (dynamic) */ "ip\0" "glIglooInterfaceSGIX\0" "\0" - /* _mesa_function_pool[25365]: Materiali (offset 171) */ + /* _mesa_function_pool[25440]: Materiali (offset 171) */ "iii\0" "glMateriali\0" "\0" - /* _mesa_function_pool[25382]: VertexAttrib4dNV (will be remapped) */ + /* _mesa_function_pool[25457]: VertexAttrib4dNV (will be remapped) */ "idddd\0" "glVertexAttrib4dNV\0" "\0" - /* _mesa_function_pool[25408]: MultiModeDrawElementsIBM (will be remapped) */ + /* _mesa_function_pool[25483]: MultiModeDrawElementsIBM (will be remapped) */ "ppipii\0" "glMultiModeDrawElementsIBM\0" "\0" - /* _mesa_function_pool[25443]: Indexsv (offset 51) */ + /* _mesa_function_pool[25518]: Indexsv (offset 51) */ "p\0" "glIndexsv\0" "\0" - /* _mesa_function_pool[25456]: MultiTexCoord4svARB (offset 407) */ + /* _mesa_function_pool[25531]: MultiTexCoord4svARB (offset 407) */ "ip\0" "glMultiTexCoord4sv\0" "glMultiTexCoord4svARB\0" "\0" - /* _mesa_function_pool[25501]: LightModelfv (offset 164) */ + /* _mesa_function_pool[25576]: LightModelfv (offset 164) */ "ip\0" "glLightModelfv\0" "\0" - /* _mesa_function_pool[25520]: TexCoord2dv (offset 103) */ + /* _mesa_function_pool[25595]: TexCoord2dv (offset 103) */ "p\0" "glTexCoord2dv\0" "\0" - /* _mesa_function_pool[25537]: GenQueriesARB (will be remapped) */ + /* _mesa_function_pool[25612]: GenQueriesARB (will be remapped) */ "ip\0" "glGenQueries\0" "glGenQueriesARB\0" "\0" - /* _mesa_function_pool[25570]: EvalCoord1dv (offset 229) */ + /* _mesa_function_pool[25645]: EvalCoord1dv (offset 229) */ "p\0" "glEvalCoord1dv\0" "\0" - /* _mesa_function_pool[25588]: ReplacementCodeuiVertex3fSUN (dynamic) */ + /* _mesa_function_pool[25663]: ReplacementCodeuiVertex3fSUN (dynamic) */ "ifff\0" "glReplacementCodeuiVertex3fSUN\0" "\0" - /* _mesa_function_pool[25625]: Translated (offset 303) */ + /* _mesa_function_pool[25700]: Translated (offset 303) */ "ddd\0" "glTranslated\0" "\0" - /* _mesa_function_pool[25643]: Translatef (offset 304) */ + /* _mesa_function_pool[25718]: Translatef (offset 304) */ "fff\0" "glTranslatef\0" "\0" - /* _mesa_function_pool[25661]: StencilMask (offset 209) */ + /* _mesa_function_pool[25736]: StencilMask (offset 209) */ "i\0" "glStencilMask\0" "\0" - /* _mesa_function_pool[25678]: Tangent3iEXT (dynamic) */ + /* _mesa_function_pool[25753]: Tangent3iEXT (dynamic) */ "iii\0" "glTangent3iEXT\0" "\0" - /* _mesa_function_pool[25698]: GetLightiv (offset 265) */ + /* _mesa_function_pool[25773]: GetLightiv (offset 265) */ "iip\0" "glGetLightiv\0" "\0" - /* _mesa_function_pool[25716]: DrawMeshArraysSUN (dynamic) */ + /* _mesa_function_pool[25791]: DrawMeshArraysSUN (dynamic) */ "iiii\0" "glDrawMeshArraysSUN\0" "\0" - /* _mesa_function_pool[25742]: IsList (offset 287) */ + /* _mesa_function_pool[25817]: IsList (offset 287) */ "i\0" "glIsList\0" "\0" - /* _mesa_function_pool[25754]: IsSync (will be remapped) */ + /* _mesa_function_pool[25829]: IsSync (will be remapped) */ "i\0" "glIsSync\0" "\0" - /* _mesa_function_pool[25766]: RenderMode (offset 196) */ + /* _mesa_function_pool[25841]: RenderMode (offset 196) */ "i\0" "glRenderMode\0" "\0" - /* _mesa_function_pool[25782]: GetMapControlPointsNV (dynamic) */ + /* _mesa_function_pool[25857]: GetMapControlPointsNV (dynamic) */ "iiiiiip\0" "glGetMapControlPointsNV\0" "\0" - /* _mesa_function_pool[25815]: DrawBuffersARB (will be remapped) */ + /* _mesa_function_pool[25890]: DrawBuffersARB (will be remapped) */ "ip\0" "glDrawBuffers\0" "glDrawBuffersARB\0" "glDrawBuffersATI\0" "\0" - /* _mesa_function_pool[25867]: ProgramLocalParameter4fARB (will be remapped) */ + /* _mesa_function_pool[25942]: ProgramLocalParameter4fARB (will be remapped) */ "iiffff\0" "glProgramLocalParameter4fARB\0" "\0" - /* _mesa_function_pool[25904]: SpriteParameterivSGIX (dynamic) */ + /* _mesa_function_pool[25979]: SpriteParameterivSGIX (dynamic) */ "ip\0" "glSpriteParameterivSGIX\0" "\0" - /* _mesa_function_pool[25932]: ProvokingVertexEXT (will be remapped) */ + /* _mesa_function_pool[26007]: ProvokingVertexEXT (will be remapped) */ "i\0" "glProvokingVertexEXT\0" "glProvokingVertex\0" "\0" - /* _mesa_function_pool[25974]: MultiTexCoord1fARB (offset 378) */ + /* _mesa_function_pool[26049]: MultiTexCoord1fARB (offset 378) */ "if\0" "glMultiTexCoord1f\0" "glMultiTexCoord1fARB\0" "\0" - /* _mesa_function_pool[26017]: LoadName (offset 198) */ + /* _mesa_function_pool[26092]: LoadName (offset 198) */ "i\0" "glLoadName\0" "\0" - /* _mesa_function_pool[26031]: VertexAttribs4ubvNV (will be remapped) */ + /* _mesa_function_pool[26106]: VertexAttribs4ubvNV (will be remapped) */ "iip\0" "glVertexAttribs4ubvNV\0" "\0" - /* _mesa_function_pool[26058]: WeightsvARB (dynamic) */ + /* _mesa_function_pool[26133]: WeightsvARB (dynamic) */ "ip\0" "glWeightsvARB\0" "\0" - /* _mesa_function_pool[26076]: Uniform1fvARB (will be remapped) */ + /* _mesa_function_pool[26151]: Uniform1fvARB (will be remapped) */ "iip\0" "glUniform1fv\0" "glUniform1fvARB\0" "\0" - /* _mesa_function_pool[26110]: CopyTexSubImage1D (offset 325) */ + /* _mesa_function_pool[26185]: CopyTexSubImage1D (offset 325) */ "iiiiii\0" "glCopyTexSubImage1D\0" "glCopyTexSubImage1DEXT\0" "\0" - /* _mesa_function_pool[26161]: CullFace (offset 152) */ + /* _mesa_function_pool[26236]: CullFace (offset 152) */ "i\0" "glCullFace\0" "\0" - /* _mesa_function_pool[26175]: BindTexture (offset 307) */ + /* _mesa_function_pool[26250]: BindTexture (offset 307) */ "ii\0" "glBindTexture\0" "glBindTextureEXT\0" "\0" - /* _mesa_function_pool[26210]: BeginFragmentShaderATI (will be remapped) */ + /* _mesa_function_pool[26285]: BeginFragmentShaderATI (will be remapped) */ "\0" "glBeginFragmentShaderATI\0" "\0" - /* _mesa_function_pool[26237]: MultiTexCoord4fARB (offset 402) */ + /* _mesa_function_pool[26312]: MultiTexCoord4fARB (offset 402) */ "iffff\0" "glMultiTexCoord4f\0" "glMultiTexCoord4fARB\0" "\0" - /* _mesa_function_pool[26283]: VertexAttribs3svNV (will be remapped) */ + /* _mesa_function_pool[26358]: VertexAttribs3svNV (will be remapped) */ "iip\0" "glVertexAttribs3svNV\0" "\0" - /* _mesa_function_pool[26309]: StencilFunc (offset 243) */ + /* _mesa_function_pool[26384]: StencilFunc (offset 243) */ "iii\0" "glStencilFunc\0" "\0" - /* _mesa_function_pool[26328]: CopyPixels (offset 255) */ + /* _mesa_function_pool[26403]: CopyPixels (offset 255) */ "iiiii\0" "glCopyPixels\0" "\0" - /* _mesa_function_pool[26348]: Rectsv (offset 93) */ + /* _mesa_function_pool[26423]: Rectsv (offset 93) */ "pp\0" "glRectsv\0" "\0" - /* _mesa_function_pool[26361]: ReplacementCodeuivSUN (dynamic) */ + /* _mesa_function_pool[26436]: ReplacementCodeuivSUN (dynamic) */ "p\0" "glReplacementCodeuivSUN\0" "\0" - /* _mesa_function_pool[26388]: EnableVertexAttribArrayARB (will be remapped) */ + /* _mesa_function_pool[26463]: EnableVertexAttribArrayARB (will be remapped) */ "i\0" "glEnableVertexAttribArray\0" "glEnableVertexAttribArrayARB\0" "\0" - /* _mesa_function_pool[26446]: NormalPointervINTEL (dynamic) */ + /* _mesa_function_pool[26521]: NormalPointervINTEL (dynamic) */ "ip\0" "glNormalPointervINTEL\0" "\0" - /* _mesa_function_pool[26472]: CopyConvolutionFilter2D (offset 355) */ + /* _mesa_function_pool[26547]: CopyConvolutionFilter2D (offset 355) */ "iiiiii\0" "glCopyConvolutionFilter2D\0" "glCopyConvolutionFilter2DEXT\0" "\0" - /* _mesa_function_pool[26535]: WindowPos3ivMESA (will be remapped) */ + /* _mesa_function_pool[26610]: WindowPos3ivMESA (will be remapped) */ "p\0" "glWindowPos3iv\0" "glWindowPos3ivARB\0" "glWindowPos3ivMESA\0" "\0" - /* _mesa_function_pool[26590]: CopyBufferSubData (will be remapped) */ + /* _mesa_function_pool[26665]: CopyBufferSubData (will be remapped) */ "iiiii\0" "glCopyBufferSubData\0" "\0" - /* _mesa_function_pool[26617]: NormalPointer (offset 318) */ + /* _mesa_function_pool[26692]: NormalPointer (offset 318) */ "iip\0" "glNormalPointer\0" "\0" - /* _mesa_function_pool[26638]: TexParameterfv (offset 179) */ + /* _mesa_function_pool[26713]: TexParameterfv (offset 179) */ "iip\0" "glTexParameterfv\0" "\0" - /* _mesa_function_pool[26660]: IsBufferARB (will be remapped) */ + /* _mesa_function_pool[26735]: IsBufferARB (will be remapped) */ "i\0" "glIsBuffer\0" "glIsBufferARB\0" "\0" - /* _mesa_function_pool[26688]: WindowPos4iMESA (will be remapped) */ + /* _mesa_function_pool[26763]: WindowPos4iMESA (will be remapped) */ "iiii\0" "glWindowPos4iMESA\0" "\0" - /* _mesa_function_pool[26712]: VertexAttrib4uivARB (will be remapped) */ + /* _mesa_function_pool[26787]: VertexAttrib4uivARB (will be remapped) */ "ip\0" "glVertexAttrib4uiv\0" "glVertexAttrib4uivARB\0" "\0" - /* _mesa_function_pool[26757]: Tangent3bvEXT (dynamic) */ + /* _mesa_function_pool[26832]: Tangent3bvEXT (dynamic) */ "p\0" "glTangent3bvEXT\0" "\0" - /* _mesa_function_pool[26776]: UniformMatrix3x4fv (will be remapped) */ + /* _mesa_function_pool[26851]: UniformMatrix3x4fv (will be remapped) */ "iiip\0" "glUniformMatrix3x4fv\0" "\0" - /* _mesa_function_pool[26803]: ClipPlane (offset 150) */ + /* _mesa_function_pool[26878]: ClipPlane (offset 150) */ "ip\0" "glClipPlane\0" "\0" - /* _mesa_function_pool[26819]: Recti (offset 90) */ + /* _mesa_function_pool[26894]: Recti (offset 90) */ "iiii\0" "glRecti\0" "\0" - /* _mesa_function_pool[26833]: DrawRangeElementsBaseVertex (will be remapped) */ + /* _mesa_function_pool[26908]: DrawRangeElementsBaseVertex (will be remapped) */ "iiiiipi\0" "glDrawRangeElementsBaseVertex\0" "\0" - /* _mesa_function_pool[26872]: TexCoordPointervINTEL (dynamic) */ + /* _mesa_function_pool[26947]: TexCoordPointervINTEL (dynamic) */ "iip\0" "glTexCoordPointervINTEL\0" "\0" - /* _mesa_function_pool[26901]: DeleteBuffersARB (will be remapped) */ + /* _mesa_function_pool[26976]: DeleteBuffersARB (will be remapped) */ "ip\0" "glDeleteBuffers\0" "glDeleteBuffersARB\0" "\0" - /* _mesa_function_pool[26940]: WindowPos4fvMESA (will be remapped) */ + /* _mesa_function_pool[27015]: WindowPos4fvMESA (will be remapped) */ "p\0" "glWindowPos4fvMESA\0" "\0" - /* _mesa_function_pool[26962]: GetPixelMapuiv (offset 272) */ + /* _mesa_function_pool[27037]: GetPixelMapuiv (offset 272) */ "ip\0" "glGetPixelMapuiv\0" "\0" - /* _mesa_function_pool[26983]: Rectf (offset 88) */ + /* _mesa_function_pool[27058]: Rectf (offset 88) */ "ffff\0" "glRectf\0" "\0" - /* _mesa_function_pool[26997]: VertexAttrib1sNV (will be remapped) */ + /* _mesa_function_pool[27072]: VertexAttrib1sNV (will be remapped) */ "ii\0" "glVertexAttrib1sNV\0" "\0" - /* _mesa_function_pool[27020]: Indexfv (offset 47) */ + /* _mesa_function_pool[27095]: Indexfv (offset 47) */ "p\0" "glIndexfv\0" "\0" - /* _mesa_function_pool[27033]: SecondaryColor3svEXT (will be remapped) */ + /* _mesa_function_pool[27108]: SecondaryColor3svEXT (will be remapped) */ "p\0" "glSecondaryColor3sv\0" "glSecondaryColor3svEXT\0" "\0" - /* _mesa_function_pool[27079]: LoadTransposeMatrixfARB (will be remapped) */ + /* _mesa_function_pool[27154]: LoadTransposeMatrixfARB (will be remapped) */ "p\0" "glLoadTransposeMatrixf\0" "glLoadTransposeMatrixfARB\0" "\0" - /* _mesa_function_pool[27131]: GetPointerv (offset 329) */ + /* _mesa_function_pool[27206]: GetPointerv (offset 329) */ "ip\0" "glGetPointerv\0" "glGetPointervEXT\0" "\0" - /* _mesa_function_pool[27166]: Tangent3bEXT (dynamic) */ + /* _mesa_function_pool[27241]: Tangent3bEXT (dynamic) */ "iii\0" "glTangent3bEXT\0" "\0" - /* _mesa_function_pool[27186]: CombinerParameterfNV (will be remapped) */ + /* _mesa_function_pool[27261]: CombinerParameterfNV (will be remapped) */ "if\0" "glCombinerParameterfNV\0" "\0" - /* _mesa_function_pool[27213]: IndexMask (offset 212) */ + /* _mesa_function_pool[27288]: IndexMask (offset 212) */ "i\0" "glIndexMask\0" "\0" - /* _mesa_function_pool[27228]: BindProgramNV (will be remapped) */ + /* _mesa_function_pool[27303]: BindProgramNV (will be remapped) */ "ii\0" "glBindProgramARB\0" "glBindProgramNV\0" "\0" - /* _mesa_function_pool[27265]: VertexAttrib4svARB (will be remapped) */ + /* _mesa_function_pool[27340]: VertexAttrib4svARB (will be remapped) */ "ip\0" "glVertexAttrib4sv\0" "glVertexAttrib4svARB\0" "\0" - /* _mesa_function_pool[27308]: GetFloatv (offset 262) */ + /* _mesa_function_pool[27383]: GetFloatv (offset 262) */ "ip\0" "glGetFloatv\0" "\0" - /* _mesa_function_pool[27324]: CreateDebugObjectMESA (dynamic) */ + /* _mesa_function_pool[27399]: CreateDebugObjectMESA (dynamic) */ "\0" "glCreateDebugObjectMESA\0" "\0" - /* _mesa_function_pool[27350]: GetShaderiv (will be remapped) */ + /* _mesa_function_pool[27425]: GetShaderiv (will be remapped) */ "iip\0" "glGetShaderiv\0" "\0" - /* _mesa_function_pool[27369]: ClientWaitSync (will be remapped) */ + /* _mesa_function_pool[27444]: ClientWaitSync (will be remapped) */ "iii\0" "glClientWaitSync\0" "\0" - /* _mesa_function_pool[27391]: TexCoord4s (offset 124) */ + /* _mesa_function_pool[27466]: TexCoord4s (offset 124) */ "iiii\0" "glTexCoord4s\0" "\0" - /* _mesa_function_pool[27410]: TexCoord3sv (offset 117) */ + /* _mesa_function_pool[27485]: TexCoord3sv (offset 117) */ "p\0" "glTexCoord3sv\0" "\0" - /* _mesa_function_pool[27427]: BindFragmentShaderATI (will be remapped) */ + /* _mesa_function_pool[27502]: BindFragmentShaderATI (will be remapped) */ "i\0" "glBindFragmentShaderATI\0" "\0" - /* _mesa_function_pool[27454]: PopAttrib (offset 218) */ + /* _mesa_function_pool[27529]: PopAttrib (offset 218) */ "\0" "glPopAttrib\0" "\0" - /* _mesa_function_pool[27468]: Fogfv (offset 154) */ + /* _mesa_function_pool[27543]: Fogfv (offset 154) */ "ip\0" "glFogfv\0" "\0" - /* _mesa_function_pool[27480]: UnmapBufferARB (will be remapped) */ + /* _mesa_function_pool[27555]: UnmapBufferARB (will be remapped) */ "i\0" "glUnmapBuffer\0" "glUnmapBufferARB\0" "\0" - /* _mesa_function_pool[27514]: InitNames (offset 197) */ + /* _mesa_function_pool[27589]: InitNames (offset 197) */ "\0" "glInitNames\0" "\0" - /* _mesa_function_pool[27528]: Normal3sv (offset 61) */ + /* _mesa_function_pool[27603]: Normal3sv (offset 61) */ "p\0" "glNormal3sv\0" "\0" - /* _mesa_function_pool[27543]: Minmax (offset 368) */ + /* _mesa_function_pool[27618]: Minmax (offset 368) */ "iii\0" "glMinmax\0" "glMinmaxEXT\0" "\0" - /* _mesa_function_pool[27569]: TexCoord4d (offset 118) */ + /* _mesa_function_pool[27644]: TexCoord4d (offset 118) */ "dddd\0" "glTexCoord4d\0" "\0" - /* _mesa_function_pool[27588]: DeformationMap3dSGIX (dynamic) */ - "iddiiddiiddiip\0" - "glDeformationMap3dSGIX\0" - "\0" - /* _mesa_function_pool[27627]: TexCoord4f (offset 120) */ + /* _mesa_function_pool[27663]: TexCoord4f (offset 120) */ "ffff\0" "glTexCoord4f\0" "\0" - /* _mesa_function_pool[27646]: FogCoorddvEXT (will be remapped) */ + /* _mesa_function_pool[27682]: FogCoorddvEXT (will be remapped) */ "p\0" "glFogCoorddv\0" "glFogCoorddvEXT\0" "\0" - /* _mesa_function_pool[27678]: FinishTextureSUNX (dynamic) */ + /* _mesa_function_pool[27714]: FinishTextureSUNX (dynamic) */ "\0" "glFinishTextureSUNX\0" "\0" - /* _mesa_function_pool[27700]: GetFragmentLightfvSGIX (dynamic) */ + /* _mesa_function_pool[27736]: GetFragmentLightfvSGIX (dynamic) */ "iip\0" "glGetFragmentLightfvSGIX\0" "\0" - /* _mesa_function_pool[27730]: Binormal3fvEXT (dynamic) */ + /* _mesa_function_pool[27766]: Binormal3fvEXT (dynamic) */ "p\0" "glBinormal3fvEXT\0" "\0" - /* _mesa_function_pool[27750]: GetBooleanv (offset 258) */ + /* _mesa_function_pool[27786]: GetBooleanv (offset 258) */ "ip\0" "glGetBooleanv\0" "\0" - /* _mesa_function_pool[27768]: ColorFragmentOp3ATI (will be remapped) */ + /* _mesa_function_pool[27804]: ColorFragmentOp3ATI (will be remapped) */ "iiiiiiiiiiiii\0" "glColorFragmentOp3ATI\0" "\0" - /* _mesa_function_pool[27805]: Hint (offset 158) */ + /* _mesa_function_pool[27841]: Hint (offset 158) */ "ii\0" "glHint\0" "\0" - /* _mesa_function_pool[27816]: Color4dv (offset 28) */ + /* _mesa_function_pool[27852]: Color4dv (offset 28) */ "p\0" "glColor4dv\0" "\0" - /* _mesa_function_pool[27830]: VertexAttrib2svARB (will be remapped) */ + /* _mesa_function_pool[27866]: VertexAttrib2svARB (will be remapped) */ "ip\0" "glVertexAttrib2sv\0" "glVertexAttrib2svARB\0" "\0" - /* _mesa_function_pool[27873]: AreProgramsResidentNV (will be remapped) */ + /* _mesa_function_pool[27909]: AreProgramsResidentNV (will be remapped) */ "ipp\0" "glAreProgramsResidentNV\0" "\0" - /* _mesa_function_pool[27902]: WindowPos3svMESA (will be remapped) */ + /* _mesa_function_pool[27938]: WindowPos3svMESA (will be remapped) */ "p\0" "glWindowPos3sv\0" "glWindowPos3svARB\0" "glWindowPos3svMESA\0" "\0" - /* _mesa_function_pool[27957]: CopyColorSubTable (offset 347) */ + /* _mesa_function_pool[27993]: CopyColorSubTable (offset 347) */ "iiiii\0" "glCopyColorSubTable\0" "glCopyColorSubTableEXT\0" "\0" - /* _mesa_function_pool[28007]: WeightdvARB (dynamic) */ + /* _mesa_function_pool[28043]: WeightdvARB (dynamic) */ "ip\0" "glWeightdvARB\0" "\0" - /* _mesa_function_pool[28025]: DeleteRenderbuffersEXT (will be remapped) */ + /* _mesa_function_pool[28061]: DeleteRenderbuffersEXT (will be remapped) */ "ip\0" "glDeleteRenderbuffers\0" "glDeleteRenderbuffersEXT\0" "\0" - /* _mesa_function_pool[28076]: VertexAttrib4NubvARB (will be remapped) */ + /* _mesa_function_pool[28112]: VertexAttrib4NubvARB (will be remapped) */ "ip\0" "glVertexAttrib4Nubv\0" "glVertexAttrib4NubvARB\0" "\0" - /* _mesa_function_pool[28123]: VertexAttrib3dvNV (will be remapped) */ + /* _mesa_function_pool[28159]: VertexAttrib3dvNV (will be remapped) */ "ip\0" "glVertexAttrib3dvNV\0" "\0" - /* _mesa_function_pool[28147]: GetObjectParameterfvARB (will be remapped) */ + /* _mesa_function_pool[28183]: GetObjectParameterfvARB (will be remapped) */ "iip\0" "glGetObjectParameterfvARB\0" "\0" - /* _mesa_function_pool[28178]: Vertex4iv (offset 147) */ + /* _mesa_function_pool[28214]: Vertex4iv (offset 147) */ "p\0" "glVertex4iv\0" "\0" - /* _mesa_function_pool[28193]: GetProgramEnvParameterdvARB (will be remapped) */ + /* _mesa_function_pool[28229]: GetProgramEnvParameterdvARB (will be remapped) */ "iip\0" "glGetProgramEnvParameterdvARB\0" "\0" - /* _mesa_function_pool[28228]: TexCoord4dv (offset 119) */ + /* _mesa_function_pool[28264]: TexCoord4dv (offset 119) */ "p\0" "glTexCoord4dv\0" "\0" - /* _mesa_function_pool[28245]: LockArraysEXT (will be remapped) */ + /* _mesa_function_pool[28281]: LockArraysEXT (will be remapped) */ "ii\0" "glLockArraysEXT\0" "\0" - /* _mesa_function_pool[28265]: Begin (offset 7) */ + /* _mesa_function_pool[28301]: Begin (offset 7) */ "i\0" "glBegin\0" "\0" - /* _mesa_function_pool[28276]: LightModeli (offset 165) */ + /* _mesa_function_pool[28312]: LightModeli (offset 165) */ "ii\0" "glLightModeli\0" "\0" - /* _mesa_function_pool[28294]: Rectfv (offset 89) */ + /* _mesa_function_pool[28330]: Rectfv (offset 89) */ "pp\0" "glRectfv\0" "\0" - /* _mesa_function_pool[28307]: LightModelf (offset 163) */ + /* _mesa_function_pool[28343]: LightModelf (offset 163) */ "if\0" "glLightModelf\0" "\0" - /* _mesa_function_pool[28325]: GetTexParameterfv (offset 282) */ + /* _mesa_function_pool[28361]: GetTexParameterfv (offset 282) */ "iip\0" "glGetTexParameterfv\0" "\0" - /* _mesa_function_pool[28350]: GetLightfv (offset 264) */ + /* _mesa_function_pool[28386]: GetLightfv (offset 264) */ "iip\0" "glGetLightfv\0" "\0" - /* _mesa_function_pool[28368]: PixelTransformParameterivEXT (dynamic) */ + /* _mesa_function_pool[28404]: PixelTransformParameterivEXT (dynamic) */ "iip\0" "glPixelTransformParameterivEXT\0" "\0" - /* _mesa_function_pool[28404]: BinormalPointerEXT (dynamic) */ + /* _mesa_function_pool[28440]: BinormalPointerEXT (dynamic) */ "iip\0" "glBinormalPointerEXT\0" "\0" - /* _mesa_function_pool[28430]: VertexAttrib1dNV (will be remapped) */ + /* _mesa_function_pool[28466]: VertexAttrib1dNV (will be remapped) */ "id\0" "glVertexAttrib1dNV\0" "\0" - /* _mesa_function_pool[28453]: GetCombinerInputParameterivNV (will be remapped) */ + /* _mesa_function_pool[28489]: GetCombinerInputParameterivNV (will be remapped) */ "iiiip\0" "glGetCombinerInputParameterivNV\0" "\0" - /* _mesa_function_pool[28492]: Disable (offset 214) */ + /* _mesa_function_pool[28528]: Disable (offset 214) */ "i\0" "glDisable\0" "\0" - /* _mesa_function_pool[28505]: MultiTexCoord2fvARB (offset 387) */ + /* _mesa_function_pool[28541]: MultiTexCoord2fvARB (offset 387) */ "ip\0" "glMultiTexCoord2fv\0" "glMultiTexCoord2fvARB\0" "\0" - /* _mesa_function_pool[28550]: GetRenderbufferParameterivEXT (will be remapped) */ + /* _mesa_function_pool[28586]: GetRenderbufferParameterivEXT (will be remapped) */ "iip\0" "glGetRenderbufferParameteriv\0" "glGetRenderbufferParameterivEXT\0" "\0" - /* _mesa_function_pool[28616]: CombinerParameterivNV (will be remapped) */ + /* _mesa_function_pool[28652]: CombinerParameterivNV (will be remapped) */ "ip\0" "glCombinerParameterivNV\0" "\0" - /* _mesa_function_pool[28644]: GenFragmentShadersATI (will be remapped) */ + /* _mesa_function_pool[28680]: GenFragmentShadersATI (will be remapped) */ "i\0" "glGenFragmentShadersATI\0" "\0" - /* _mesa_function_pool[28671]: DrawArrays (offset 310) */ + /* _mesa_function_pool[28707]: DrawArrays (offset 310) */ "iii\0" "glDrawArrays\0" "glDrawArraysEXT\0" "\0" - /* _mesa_function_pool[28705]: WeightuivARB (dynamic) */ + /* _mesa_function_pool[28741]: WeightuivARB (dynamic) */ "ip\0" "glWeightuivARB\0" "\0" - /* _mesa_function_pool[28724]: VertexAttrib2sARB (will be remapped) */ + /* _mesa_function_pool[28760]: VertexAttrib2sARB (will be remapped) */ "iii\0" "glVertexAttrib2s\0" "glVertexAttrib2sARB\0" "\0" - /* _mesa_function_pool[28766]: ColorMask (offset 210) */ + /* _mesa_function_pool[28802]: ColorMask (offset 210) */ "iiii\0" "glColorMask\0" "\0" - /* _mesa_function_pool[28784]: GenAsyncMarkersSGIX (dynamic) */ + /* _mesa_function_pool[28820]: GenAsyncMarkersSGIX (dynamic) */ "i\0" "glGenAsyncMarkersSGIX\0" "\0" - /* _mesa_function_pool[28809]: Tangent3svEXT (dynamic) */ + /* _mesa_function_pool[28845]: Tangent3svEXT (dynamic) */ "p\0" "glTangent3svEXT\0" "\0" - /* _mesa_function_pool[28828]: GetListParameterivSGIX (dynamic) */ + /* _mesa_function_pool[28864]: GetListParameterivSGIX (dynamic) */ "iip\0" "glGetListParameterivSGIX\0" "\0" - /* _mesa_function_pool[28858]: BindBufferARB (will be remapped) */ + /* _mesa_function_pool[28894]: BindBufferARB (will be remapped) */ "ii\0" "glBindBuffer\0" "glBindBufferARB\0" "\0" - /* _mesa_function_pool[28891]: GetInfoLogARB (will be remapped) */ + /* _mesa_function_pool[28927]: GetInfoLogARB (will be remapped) */ "iipp\0" "glGetInfoLogARB\0" "\0" - /* _mesa_function_pool[28913]: RasterPos4iv (offset 83) */ + /* _mesa_function_pool[28949]: RasterPos4iv (offset 83) */ "p\0" "glRasterPos4iv\0" "\0" - /* _mesa_function_pool[28931]: Enable (offset 215) */ + /* _mesa_function_pool[28967]: Enable (offset 215) */ "i\0" "glEnable\0" "\0" - /* _mesa_function_pool[28943]: LineStipple (offset 167) */ + /* _mesa_function_pool[28979]: LineStipple (offset 167) */ "ii\0" "glLineStipple\0" "\0" - /* _mesa_function_pool[28961]: VertexAttribs4svNV (will be remapped) */ + /* _mesa_function_pool[28997]: VertexAttribs4svNV (will be remapped) */ "iip\0" "glVertexAttribs4svNV\0" "\0" - /* _mesa_function_pool[28987]: EdgeFlagPointerListIBM (dynamic) */ + /* _mesa_function_pool[29023]: EdgeFlagPointerListIBM (dynamic) */ "ipi\0" "glEdgeFlagPointerListIBM\0" "\0" - /* _mesa_function_pool[29017]: UniformMatrix3x2fv (will be remapped) */ + /* _mesa_function_pool[29053]: UniformMatrix3x2fv (will be remapped) */ "iiip\0" "glUniformMatrix3x2fv\0" "\0" - /* _mesa_function_pool[29044]: GetMinmaxParameterfv (offset 365) */ + /* _mesa_function_pool[29080]: GetMinmaxParameterfv (offset 365) */ "iip\0" "glGetMinmaxParameterfv\0" "glGetMinmaxParameterfvEXT\0" "\0" - /* _mesa_function_pool[29098]: VertexAttrib1fvARB (will be remapped) */ + /* _mesa_function_pool[29134]: VertexAttrib1fvARB (will be remapped) */ "ip\0" "glVertexAttrib1fv\0" "glVertexAttrib1fvARB\0" "\0" - /* _mesa_function_pool[29141]: GenBuffersARB (will be remapped) */ + /* _mesa_function_pool[29177]: GenBuffersARB (will be remapped) */ "ip\0" "glGenBuffers\0" "glGenBuffersARB\0" "\0" - /* _mesa_function_pool[29174]: VertexAttribs1svNV (will be remapped) */ + /* _mesa_function_pool[29210]: VertexAttribs1svNV (will be remapped) */ "iip\0" "glVertexAttribs1svNV\0" "\0" - /* _mesa_function_pool[29200]: Vertex3fv (offset 137) */ + /* _mesa_function_pool[29236]: Vertex3fv (offset 137) */ "p\0" "glVertex3fv\0" "\0" - /* _mesa_function_pool[29215]: GetTexBumpParameterivATI (will be remapped) */ + /* _mesa_function_pool[29251]: GetTexBumpParameterivATI (will be remapped) */ "ip\0" "glGetTexBumpParameterivATI\0" "\0" - /* _mesa_function_pool[29246]: Binormal3bEXT (dynamic) */ + /* _mesa_function_pool[29282]: Binormal3bEXT (dynamic) */ "iii\0" "glBinormal3bEXT\0" "\0" - /* _mesa_function_pool[29267]: FragmentMaterialivSGIX (dynamic) */ + /* _mesa_function_pool[29303]: FragmentMaterialivSGIX (dynamic) */ "iip\0" "glFragmentMaterialivSGIX\0" "\0" - /* _mesa_function_pool[29297]: IsRenderbufferEXT (will be remapped) */ + /* _mesa_function_pool[29333]: IsRenderbufferEXT (will be remapped) */ "i\0" "glIsRenderbuffer\0" "glIsRenderbufferEXT\0" "\0" - /* _mesa_function_pool[29337]: GenProgramsNV (will be remapped) */ + /* _mesa_function_pool[29373]: GenProgramsNV (will be remapped) */ "ip\0" "glGenProgramsARB\0" "glGenProgramsNV\0" "\0" - /* _mesa_function_pool[29374]: VertexAttrib4dvNV (will be remapped) */ + /* _mesa_function_pool[29410]: VertexAttrib4dvNV (will be remapped) */ "ip\0" "glVertexAttrib4dvNV\0" "\0" - /* _mesa_function_pool[29398]: EndFragmentShaderATI (will be remapped) */ + /* _mesa_function_pool[29434]: EndFragmentShaderATI (will be remapped) */ "\0" "glEndFragmentShaderATI\0" "\0" - /* _mesa_function_pool[29423]: Binormal3iEXT (dynamic) */ + /* _mesa_function_pool[29459]: Binormal3iEXT (dynamic) */ "iii\0" "glBinormal3iEXT\0" "\0" - /* _mesa_function_pool[29444]: WindowPos2fMESA (will be remapped) */ + /* _mesa_function_pool[29480]: WindowPos2fMESA (will be remapped) */ "ff\0" "glWindowPos2f\0" "glWindowPos2fARB\0" @@ -4334,390 +4335,390 @@ static const struct { } MESA_remap_table_functions[] = { { 1461, AttachShader_remap_index }, { 8704, CreateProgram_remap_index }, - { 20115, CreateShader_remap_index }, - { 22375, DeleteProgram_remap_index }, - { 16150, DeleteShader_remap_index }, - { 20561, DetachShader_remap_index }, - { 15674, GetAttachedShaders_remap_index }, + { 20158, CreateShader_remap_index }, + { 22418, DeleteProgram_remap_index }, + { 16193, DeleteShader_remap_index }, + { 20604, DetachShader_remap_index }, + { 15717, GetAttachedShaders_remap_index }, { 4244, GetProgramInfoLog_remap_index }, { 361, GetProgramiv_remap_index }, { 5547, GetShaderInfoLog_remap_index }, - { 27350, GetShaderiv_remap_index }, - { 11657, IsProgram_remap_index }, - { 10728, IsShader_remap_index }, + { 27425, GetShaderiv_remap_index }, + { 11732, IsProgram_remap_index }, + { 10767, IsShader_remap_index }, { 8808, StencilFuncSeparate_remap_index }, { 3487, StencilMaskSeparate_remap_index }, { 6623, StencilOpSeparate_remap_index }, - { 19492, UniformMatrix2x3fv_remap_index }, + { 19535, UniformMatrix2x3fv_remap_index }, { 2615, UniformMatrix2x4fv_remap_index }, - { 29017, UniformMatrix3x2fv_remap_index }, - { 26776, UniformMatrix3x4fv_remap_index }, - { 14222, UniformMatrix4x2fv_remap_index }, + { 29053, UniformMatrix3x2fv_remap_index }, + { 26851, UniformMatrix3x4fv_remap_index }, + { 14265, UniformMatrix4x2fv_remap_index }, { 2937, UniformMatrix4x3fv_remap_index }, { 8722, LoadTransposeMatrixdARB_remap_index }, - { 27079, LoadTransposeMatrixfARB_remap_index }, + { 27154, LoadTransposeMatrixfARB_remap_index }, { 4817, MultTransposeMatrixdARB_remap_index }, - { 20748, MultTransposeMatrixfARB_remap_index }, + { 20791, MultTransposeMatrixfARB_remap_index }, { 172, SampleCoverageARB_remap_index }, { 4971, CompressedTexImage1DARB_remap_index }, - { 21205, CompressedTexImage2DARB_remap_index }, + { 21248, CompressedTexImage2DARB_remap_index }, { 3550, CompressedTexImage3DARB_remap_index }, - { 15966, CompressedTexSubImage1DARB_remap_index }, + { 16009, CompressedTexSubImage1DARB_remap_index }, { 1880, CompressedTexSubImage2DARB_remap_index }, - { 17758, CompressedTexSubImage3DARB_remap_index }, - { 25058, GetCompressedTexImageARB_remap_index }, + { 17801, CompressedTexSubImage3DARB_remap_index }, + { 25133, GetCompressedTexImageARB_remap_index }, { 3395, DisableVertexAttribArrayARB_remap_index }, - { 26388, EnableVertexAttribArrayARB_remap_index }, - { 28193, GetProgramEnvParameterdvARB_remap_index }, - { 20628, GetProgramEnvParameterfvARB_remap_index }, - { 24088, GetProgramLocalParameterdvARB_remap_index }, + { 26463, EnableVertexAttribArrayARB_remap_index }, + { 28229, GetProgramEnvParameterdvARB_remap_index }, + { 20671, GetProgramEnvParameterfvARB_remap_index }, + { 24163, GetProgramLocalParameterdvARB_remap_index }, { 7065, GetProgramLocalParameterfvARB_remap_index }, - { 16057, GetProgramStringARB_remap_index }, - { 24283, GetProgramivARB_remap_index }, - { 17953, GetVertexAttribdvARB_remap_index }, - { 14111, GetVertexAttribfvARB_remap_index }, + { 16100, GetProgramStringARB_remap_index }, + { 24358, GetProgramivARB_remap_index }, + { 17996, GetVertexAttribdvARB_remap_index }, + { 14154, GetVertexAttribfvARB_remap_index }, { 8617, GetVertexAttribivARB_remap_index }, - { 16862, ProgramEnvParameter4dARB_remap_index }, - { 22175, ProgramEnvParameter4dvARB_remap_index }, - { 14719, ProgramEnvParameter4fARB_remap_index }, + { 16905, ProgramEnvParameter4dARB_remap_index }, + { 22218, ProgramEnvParameter4dvARB_remap_index }, + { 14762, ProgramEnvParameter4fARB_remap_index }, { 7928, ProgramEnvParameter4fvARB_remap_index }, { 3513, ProgramLocalParameter4dARB_remap_index }, - { 11403, ProgramLocalParameter4dvARB_remap_index }, - { 25867, ProgramLocalParameter4fARB_remap_index }, - { 22693, ProgramLocalParameter4fvARB_remap_index }, - { 24844, ProgramStringARB_remap_index }, - { 17112, VertexAttrib1dARB_remap_index }, - { 13765, VertexAttrib1dvARB_remap_index }, + { 11442, ProgramLocalParameter4dvARB_remap_index }, + { 25942, ProgramLocalParameter4fARB_remap_index }, + { 22736, ProgramLocalParameter4fvARB_remap_index }, + { 24919, ProgramStringARB_remap_index }, + { 17155, VertexAttrib1dARB_remap_index }, + { 13808, VertexAttrib1dvARB_remap_index }, { 3688, VertexAttrib1fARB_remap_index }, - { 29098, VertexAttrib1fvARB_remap_index }, + { 29134, VertexAttrib1fvARB_remap_index }, { 6149, VertexAttrib1sARB_remap_index }, { 2054, VertexAttrib1svARB_remap_index }, - { 13196, VertexAttrib2dARB_remap_index }, - { 15293, VertexAttrib2dvARB_remap_index }, + { 13239, VertexAttrib2dARB_remap_index }, + { 15336, VertexAttrib2dvARB_remap_index }, { 1480, VertexAttrib2fARB_remap_index }, - { 15406, VertexAttrib2fvARB_remap_index }, - { 28724, VertexAttrib2sARB_remap_index }, - { 27830, VertexAttrib2svARB_remap_index }, + { 15449, VertexAttrib2fvARB_remap_index }, + { 28760, VertexAttrib2sARB_remap_index }, + { 27866, VertexAttrib2svARB_remap_index }, { 9926, VertexAttrib3dARB_remap_index }, { 7631, VertexAttrib3dvARB_remap_index }, { 1567, VertexAttrib3fARB_remap_index }, - { 19729, VertexAttrib3fvARB_remap_index }, - { 24716, VertexAttrib3sARB_remap_index }, - { 17695, VertexAttrib3svARB_remap_index }, + { 19772, VertexAttrib3fvARB_remap_index }, + { 24791, VertexAttrib3sARB_remap_index }, + { 17738, VertexAttrib3svARB_remap_index }, { 4270, VertexAttrib4NbvARB_remap_index }, - { 15629, VertexAttrib4NivARB_remap_index }, - { 19684, VertexAttrib4NsvARB_remap_index }, - { 20580, VertexAttrib4NubARB_remap_index }, - { 28076, VertexAttrib4NubvARB_remap_index }, - { 16523, VertexAttrib4NuivARB_remap_index }, + { 15672, VertexAttrib4NivARB_remap_index }, + { 19727, VertexAttrib4NsvARB_remap_index }, + { 20623, VertexAttrib4NubARB_remap_index }, + { 28112, VertexAttrib4NubvARB_remap_index }, + { 16566, VertexAttrib4NuivARB_remap_index }, { 2810, VertexAttrib4NusvARB_remap_index }, { 9549, VertexAttrib4bvARB_remap_index }, - { 23496, VertexAttrib4dARB_remap_index }, - { 18678, VertexAttrib4dvARB_remap_index }, + { 23571, VertexAttrib4dARB_remap_index }, + { 18721, VertexAttrib4dvARB_remap_index }, { 10033, VertexAttrib4fARB_remap_index }, { 10403, VertexAttrib4fvARB_remap_index }, { 9001, VertexAttrib4ivARB_remap_index }, - { 15107, VertexAttrib4sARB_remap_index }, - { 27265, VertexAttrib4svARB_remap_index }, - { 14524, VertexAttrib4ubvARB_remap_index }, - { 26712, VertexAttrib4uivARB_remap_index }, - { 17506, VertexAttrib4usvARB_remap_index }, - { 19366, VertexAttribPointerARB_remap_index }, - { 28858, BindBufferARB_remap_index }, + { 15150, VertexAttrib4sARB_remap_index }, + { 27340, VertexAttrib4svARB_remap_index }, + { 14567, VertexAttrib4ubvARB_remap_index }, + { 26787, VertexAttrib4uivARB_remap_index }, + { 17549, VertexAttrib4usvARB_remap_index }, + { 19409, VertexAttribPointerARB_remap_index }, + { 28894, BindBufferARB_remap_index }, { 5862, BufferDataARB_remap_index }, { 1382, BufferSubDataARB_remap_index }, - { 26901, DeleteBuffersARB_remap_index }, - { 29141, GenBuffersARB_remap_index }, - { 15449, GetBufferParameterivARB_remap_index }, - { 14671, GetBufferPointervARB_remap_index }, + { 26976, DeleteBuffersARB_remap_index }, + { 29177, GenBuffersARB_remap_index }, + { 15492, GetBufferParameterivARB_remap_index }, + { 14714, GetBufferPointervARB_remap_index }, { 1335, GetBufferSubDataARB_remap_index }, - { 26660, IsBufferARB_remap_index }, - { 23124, MapBufferARB_remap_index }, - { 27480, UnmapBufferARB_remap_index }, + { 26735, IsBufferARB_remap_index }, + { 23167, MapBufferARB_remap_index }, + { 27555, UnmapBufferARB_remap_index }, { 268, BeginQueryARB_remap_index }, - { 17207, DeleteQueriesARB_remap_index }, + { 17250, DeleteQueriesARB_remap_index }, { 10664, EndQueryARB_remap_index }, - { 25537, GenQueriesARB_remap_index }, + { 25612, GenQueriesARB_remap_index }, { 1772, GetQueryObjectivARB_remap_index }, - { 15151, GetQueryObjectuivARB_remap_index }, + { 15194, GetQueryObjectuivARB_remap_index }, { 1624, GetQueryivARB_remap_index }, - { 17413, IsQueryARB_remap_index }, + { 17456, IsQueryARB_remap_index }, { 7241, AttachObjectARB_remap_index }, - { 16112, CompileShaderARB_remap_index }, + { 16155, CompileShaderARB_remap_index }, { 2879, CreateProgramObjectARB_remap_index }, { 5807, CreateShaderObjectARB_remap_index }, - { 12613, DeleteObjectARB_remap_index }, - { 20979, DetachObjectARB_remap_index }, + { 12656, DeleteObjectARB_remap_index }, + { 21022, DetachObjectARB_remap_index }, { 10475, GetActiveUniformARB_remap_index }, { 8320, GetAttachedObjectsARB_remap_index }, { 8599, GetHandleARB_remap_index }, - { 28891, GetInfoLogARB_remap_index }, - { 28147, GetObjectParameterfvARB_remap_index }, - { 23962, GetObjectParameterivARB_remap_index }, - { 25295, GetShaderSourceARB_remap_index }, - { 24576, GetUniformLocationARB_remap_index }, - { 20850, GetUniformfvARB_remap_index }, - { 11025, GetUniformivARB_remap_index }, - { 17551, LinkProgramARB_remap_index }, - { 17609, ShaderSourceARB_remap_index }, + { 28927, GetInfoLogARB_remap_index }, + { 28183, GetObjectParameterfvARB_remap_index }, + { 24037, GetObjectParameterivARB_remap_index }, + { 25370, GetShaderSourceARB_remap_index }, + { 24651, GetUniformLocationARB_remap_index }, + { 20893, GetUniformfvARB_remap_index }, + { 11064, GetUniformivARB_remap_index }, + { 17594, LinkProgramARB_remap_index }, + { 17652, ShaderSourceARB_remap_index }, { 6523, Uniform1fARB_remap_index }, - { 26076, Uniform1fvARB_remap_index }, - { 19335, Uniform1iARB_remap_index }, - { 18367, Uniform1ivARB_remap_index }, + { 26151, Uniform1fvARB_remap_index }, + { 19378, Uniform1iARB_remap_index }, + { 18410, Uniform1ivARB_remap_index }, { 2003, Uniform2fARB_remap_index }, - { 12449, Uniform2fvARB_remap_index }, - { 23011, Uniform2iARB_remap_index }, + { 12492, Uniform2fvARB_remap_index }, + { 23054, Uniform2iARB_remap_index }, { 2123, Uniform2ivARB_remap_index }, - { 16222, Uniform3fARB_remap_index }, + { 16265, Uniform3fARB_remap_index }, { 8350, Uniform3fvARB_remap_index }, { 5481, Uniform3iARB_remap_index }, - { 14777, Uniform3ivARB_remap_index }, - { 16668, Uniform4fARB_remap_index }, - { 20714, Uniform4fvARB_remap_index }, - { 21854, Uniform4iARB_remap_index }, - { 17919, Uniform4ivARB_remap_index }, + { 14820, Uniform3ivARB_remap_index }, + { 16711, Uniform4fARB_remap_index }, + { 20757, Uniform4fvARB_remap_index }, + { 21897, Uniform4iARB_remap_index }, + { 17962, Uniform4ivARB_remap_index }, { 7293, UniformMatrix2fvARB_remap_index }, { 17, UniformMatrix3fvARB_remap_index }, { 2475, UniformMatrix4fvARB_remap_index }, - { 22287, UseProgramObjectARB_remap_index }, - { 12884, ValidateProgramARB_remap_index }, - { 18721, BindAttribLocationARB_remap_index }, + { 22330, UseProgramObjectARB_remap_index }, + { 12927, ValidateProgramARB_remap_index }, + { 18764, BindAttribLocationARB_remap_index }, { 4315, GetActiveAttribARB_remap_index }, - { 14458, GetAttribLocationARB_remap_index }, - { 25815, DrawBuffersARB_remap_index }, - { 11508, RenderbufferStorageMultisample_remap_index }, - { 16716, FlushMappedBufferRange_remap_index }, - { 24379, MapBufferRange_remap_index }, - { 14333, BindVertexArray_remap_index }, - { 12743, GenVertexArrays_remap_index }, - { 26590, CopyBufferSubData_remap_index }, - { 27369, ClientWaitSync_remap_index }, + { 14501, GetAttribLocationARB_remap_index }, + { 25890, DrawBuffersARB_remap_index }, + { 11547, RenderbufferStorageMultisample_remap_index }, + { 16759, FlushMappedBufferRange_remap_index }, + { 24454, MapBufferRange_remap_index }, + { 14376, BindVertexArray_remap_index }, + { 12786, GenVertexArrays_remap_index }, + { 26665, CopyBufferSubData_remap_index }, + { 27444, ClientWaitSync_remap_index }, { 2394, DeleteSync_remap_index }, { 6190, FenceSync_remap_index }, - { 13255, GetInteger64v_remap_index }, - { 19791, GetSynciv_remap_index }, - { 25754, IsSync_remap_index }, + { 13298, GetInteger64v_remap_index }, + { 19834, GetSynciv_remap_index }, + { 25829, IsSync_remap_index }, { 8268, WaitSync_remap_index }, { 3363, DrawElementsBaseVertex_remap_index }, - { 26833, DrawRangeElementsBaseVertex_remap_index }, - { 23155, MultiDrawElementsBaseVertex_remap_index }, + { 26908, DrawRangeElementsBaseVertex_remap_index }, + { 23198, MultiDrawElementsBaseVertex_remap_index }, { 4680, PolygonOffsetEXT_remap_index }, - { 20350, GetPixelTexGenParameterfvSGIS_remap_index }, + { 20393, GetPixelTexGenParameterfvSGIS_remap_index }, { 3895, GetPixelTexGenParameterivSGIS_remap_index }, - { 20083, PixelTexGenParameterfSGIS_remap_index }, + { 20126, PixelTexGenParameterfSGIS_remap_index }, { 580, PixelTexGenParameterfvSGIS_remap_index }, - { 11063, PixelTexGenParameteriSGIS_remap_index }, - { 12020, PixelTexGenParameterivSGIS_remap_index }, - { 14421, SampleMaskSGIS_remap_index }, - { 17353, SamplePatternSGIS_remap_index }, - { 23084, ColorPointerEXT_remap_index }, - { 15336, EdgeFlagPointerEXT_remap_index }, + { 11102, PixelTexGenParameteriSGIS_remap_index }, + { 12063, PixelTexGenParameterivSGIS_remap_index }, + { 14464, SampleMaskSGIS_remap_index }, + { 17396, SamplePatternSGIS_remap_index }, + { 23127, ColorPointerEXT_remap_index }, + { 15379, EdgeFlagPointerEXT_remap_index }, { 5135, IndexPointerEXT_remap_index }, { 5215, NormalPointerEXT_remap_index }, - { 13849, TexCoordPointerEXT_remap_index }, + { 13892, TexCoordPointerEXT_remap_index }, { 5985, VertexPointerEXT_remap_index }, { 3165, PointParameterfEXT_remap_index }, { 6830, PointParameterfvEXT_remap_index }, - { 28245, LockArraysEXT_remap_index }, - { 12948, UnlockArraysEXT_remap_index }, + { 28281, LockArraysEXT_remap_index }, + { 12991, UnlockArraysEXT_remap_index }, { 7837, CullParameterdvEXT_remap_index }, { 10270, CullParameterfvEXT_remap_index }, { 1151, SecondaryColor3bEXT_remap_index }, { 6989, SecondaryColor3bvEXT_remap_index }, { 9178, SecondaryColor3dEXT_remap_index }, - { 22433, SecondaryColor3dvEXT_remap_index }, - { 24625, SecondaryColor3fEXT_remap_index }, - { 15902, SecondaryColor3fvEXT_remap_index }, + { 22476, SecondaryColor3dvEXT_remap_index }, + { 24700, SecondaryColor3fEXT_remap_index }, + { 15945, SecondaryColor3fvEXT_remap_index }, { 426, SecondaryColor3iEXT_remap_index }, - { 14159, SecondaryColor3ivEXT_remap_index }, + { 14202, SecondaryColor3ivEXT_remap_index }, { 8836, SecondaryColor3sEXT_remap_index }, - { 27033, SecondaryColor3svEXT_remap_index }, - { 23798, SecondaryColor3ubEXT_remap_index }, - { 18612, SecondaryColor3ubvEXT_remap_index }, - { 11258, SecondaryColor3uiEXT_remap_index }, - { 19970, SecondaryColor3uivEXT_remap_index }, - { 22645, SecondaryColor3usEXT_remap_index }, - { 11331, SecondaryColor3usvEXT_remap_index }, + { 27108, SecondaryColor3svEXT_remap_index }, + { 23873, SecondaryColor3ubEXT_remap_index }, + { 18655, SecondaryColor3ubvEXT_remap_index }, + { 11297, SecondaryColor3uiEXT_remap_index }, + { 20013, SecondaryColor3uivEXT_remap_index }, + { 22688, SecondaryColor3usEXT_remap_index }, + { 11370, SecondaryColor3usvEXT_remap_index }, { 10346, SecondaryColorPointerEXT_remap_index }, - { 22494, MultiDrawArraysEXT_remap_index }, - { 18302, MultiDrawElementsEXT_remap_index }, - { 18497, FogCoordPointerEXT_remap_index }, + { 22537, MultiDrawArraysEXT_remap_index }, + { 18345, MultiDrawElementsEXT_remap_index }, + { 18540, FogCoordPointerEXT_remap_index }, { 4044, FogCoorddEXT_remap_index }, - { 27646, FogCoorddvEXT_remap_index }, + { 27682, FogCoorddvEXT_remap_index }, { 4105, FogCoordfEXT_remap_index }, - { 23721, FogCoordfvEXT_remap_index }, - { 16620, PixelTexGenSGIX_remap_index }, - { 24306, BlendFuncSeparateEXT_remap_index }, + { 23796, FogCoordfvEXT_remap_index }, + { 16663, PixelTexGenSGIX_remap_index }, + { 24381, BlendFuncSeparateEXT_remap_index }, { 5897, FlushVertexArrayRangeNV_remap_index }, { 4629, VertexArrayRangeNV_remap_index }, - { 24690, CombinerInputNV_remap_index }, + { 24765, CombinerInputNV_remap_index }, { 1946, CombinerOutputNV_remap_index }, - { 27186, CombinerParameterfNV_remap_index }, + { 27261, CombinerParameterfNV_remap_index }, { 4549, CombinerParameterfvNV_remap_index }, - { 19541, CombinerParameteriNV_remap_index }, - { 28616, CombinerParameterivNV_remap_index }, + { 19584, CombinerParameteriNV_remap_index }, + { 28652, CombinerParameterivNV_remap_index }, { 6267, FinalCombinerInputNV_remap_index }, { 8665, GetCombinerInputParameterfvNV_remap_index }, - { 28453, GetCombinerInputParameterivNV_remap_index }, + { 28489, GetCombinerInputParameterivNV_remap_index }, { 6066, GetCombinerOutputParameterfvNV_remap_index }, - { 11949, GetCombinerOutputParameterivNV_remap_index }, + { 12024, GetCombinerOutputParameterivNV_remap_index }, { 5642, GetFinalCombinerInputParameterfvNV_remap_index }, - { 21726, GetFinalCombinerInputParameterivNV_remap_index }, - { 11003, ResizeBuffersMESA_remap_index }, + { 21769, GetFinalCombinerInputParameterivNV_remap_index }, + { 11042, ResizeBuffersMESA_remap_index }, { 9753, WindowPos2dMESA_remap_index }, { 944, WindowPos2dvMESA_remap_index }, - { 29444, WindowPos2fMESA_remap_index }, + { 29480, WindowPos2fMESA_remap_index }, { 6934, WindowPos2fvMESA_remap_index }, - { 15849, WindowPos2iMESA_remap_index }, - { 17826, WindowPos2ivMESA_remap_index }, - { 18401, WindowPos2sMESA_remap_index }, + { 15892, WindowPos2iMESA_remap_index }, + { 17869, WindowPos2ivMESA_remap_index }, + { 18444, WindowPos2sMESA_remap_index }, { 4885, WindowPos2svMESA_remap_index }, { 6759, WindowPos3dMESA_remap_index }, - { 12228, WindowPos3dvMESA_remap_index }, + { 12271, WindowPos3dvMESA_remap_index }, { 472, WindowPos3fMESA_remap_index }, - { 13009, WindowPos3fvMESA_remap_index }, - { 21021, WindowPos3iMESA_remap_index }, - { 26535, WindowPos3ivMESA_remap_index }, - { 16366, WindowPos3sMESA_remap_index }, - { 27902, WindowPos3svMESA_remap_index }, + { 13052, WindowPos3fvMESA_remap_index }, + { 21064, WindowPos3iMESA_remap_index }, + { 26610, WindowPos3ivMESA_remap_index }, + { 16409, WindowPos3sMESA_remap_index }, + { 27938, WindowPos3svMESA_remap_index }, { 9704, WindowPos4dMESA_remap_index }, - { 14862, WindowPos4dvMESA_remap_index }, - { 12187, WindowPos4fMESA_remap_index }, - { 26940, WindowPos4fvMESA_remap_index }, - { 26688, WindowPos4iMESA_remap_index }, - { 10842, WindowPos4ivMESA_remap_index }, - { 16499, WindowPos4sMESA_remap_index }, + { 14905, WindowPos4dvMESA_remap_index }, + { 12230, WindowPos4fMESA_remap_index }, + { 27015, WindowPos4fvMESA_remap_index }, + { 26763, WindowPos4iMESA_remap_index }, + { 10881, WindowPos4ivMESA_remap_index }, + { 16542, WindowPos4sMESA_remap_index }, { 2857, WindowPos4svMESA_remap_index }, - { 11988, MultiModeDrawArraysIBM_remap_index }, - { 25408, MultiModeDrawElementsIBM_remap_index }, + { 23539, MultiModeDrawArraysIBM_remap_index }, + { 25483, MultiModeDrawElementsIBM_remap_index }, { 10692, DeleteFencesNV_remap_index }, - { 24537, FinishFenceNV_remap_index }, + { 24612, FinishFenceNV_remap_index }, { 3287, GenFencesNV_remap_index }, - { 14842, GetFenceivNV_remap_index }, + { 14885, GetFenceivNV_remap_index }, { 7226, IsFenceNV_remap_index }, - { 11876, SetFenceNV_remap_index }, + { 11951, SetFenceNV_remap_index }, { 3744, TestFenceNV_remap_index }, - { 27873, AreProgramsResidentNV_remap_index }, - { 27228, BindProgramNV_remap_index }, - { 22728, DeleteProgramsNV_remap_index }, - { 18830, ExecuteProgramNV_remap_index }, - { 29337, GenProgramsNV_remap_index }, - { 20429, GetProgramParameterdvNV_remap_index }, + { 27909, AreProgramsResidentNV_remap_index }, + { 27303, BindProgramNV_remap_index }, + { 22771, DeleteProgramsNV_remap_index }, + { 18873, ExecuteProgramNV_remap_index }, + { 29373, GenProgramsNV_remap_index }, + { 20472, GetProgramParameterdvNV_remap_index }, { 9240, GetProgramParameterfvNV_remap_index }, - { 23058, GetProgramStringNV_remap_index }, - { 21415, GetProgramivNV_remap_index }, - { 20663, GetTrackMatrixivNV_remap_index }, - { 22878, GetVertexAttribPointervNV_remap_index }, - { 21659, GetVertexAttribdvNV_remap_index }, - { 16339, GetVertexAttribfvNV_remap_index }, - { 16030, GetVertexAttribivNV_remap_index }, - { 16746, IsProgramNV_remap_index }, + { 23101, GetProgramStringNV_remap_index }, + { 21458, GetProgramivNV_remap_index }, + { 20706, GetTrackMatrixivNV_remap_index }, + { 22921, GetVertexAttribPointervNV_remap_index }, + { 21702, GetVertexAttribdvNV_remap_index }, + { 16382, GetVertexAttribfvNV_remap_index }, + { 16073, GetVertexAttribivNV_remap_index }, + { 16789, IsProgramNV_remap_index }, { 8246, LoadProgramNV_remap_index }, - { 24402, ProgramParameters4dvNV_remap_index }, - { 21345, ProgramParameters4fvNV_remap_index }, - { 18130, RequestResidentProgramsNV_remap_index }, - { 19519, TrackMatrixNV_remap_index }, - { 28430, VertexAttrib1dNV_remap_index }, - { 11817, VertexAttrib1dvNV_remap_index }, - { 24940, VertexAttrib1fNV_remap_index }, + { 24477, ProgramParameters4dvNV_remap_index }, + { 21388, ProgramParameters4fvNV_remap_index }, + { 18173, RequestResidentProgramsNV_remap_index }, + { 19562, TrackMatrixNV_remap_index }, + { 28466, VertexAttrib1dNV_remap_index }, + { 11892, VertexAttrib1dvNV_remap_index }, + { 25015, VertexAttrib1fNV_remap_index }, { 2245, VertexAttrib1fvNV_remap_index }, - { 26997, VertexAttrib1sNV_remap_index }, - { 13082, VertexAttrib1svNV_remap_index }, + { 27072, VertexAttrib1sNV_remap_index }, + { 13125, VertexAttrib1svNV_remap_index }, { 4220, VertexAttrib2dNV_remap_index }, - { 11732, VertexAttrib2dvNV_remap_index }, - { 17585, VertexAttrib2fNV_remap_index }, - { 11379, VertexAttrib2fvNV_remap_index }, + { 11807, VertexAttrib2dvNV_remap_index }, + { 17628, VertexAttrib2fNV_remap_index }, + { 11418, VertexAttrib2fvNV_remap_index }, { 5045, VertexAttrib2sNV_remap_index }, - { 16420, VertexAttrib2svNV_remap_index }, + { 16463, VertexAttrib2svNV_remap_index }, { 9901, VertexAttrib3dNV_remap_index }, - { 28123, VertexAttrib3dvNV_remap_index }, + { 28159, VertexAttrib3dvNV_remap_index }, { 9052, VertexAttrib3fNV_remap_index }, - { 21686, VertexAttrib3fvNV_remap_index }, - { 24915, VertexAttrib3sNV_remap_index }, - { 20690, VertexAttrib3svNV_remap_index }, - { 25382, VertexAttrib4dNV_remap_index }, - { 29374, VertexAttrib4dvNV_remap_index }, + { 21729, VertexAttrib3fvNV_remap_index }, + { 24990, VertexAttrib3sNV_remap_index }, + { 20733, VertexAttrib3svNV_remap_index }, + { 25457, VertexAttrib4dNV_remap_index }, + { 29410, VertexAttrib4dvNV_remap_index }, { 3945, VertexAttrib4fNV_remap_index }, { 8296, VertexAttrib4fvNV_remap_index }, - { 23380, VertexAttrib4sNV_remap_index }, + { 23423, VertexAttrib4sNV_remap_index }, { 1293, VertexAttrib4svNV_remap_index }, { 4378, VertexAttrib4ubNV_remap_index }, { 734, VertexAttrib4ubvNV_remap_index }, - { 19010, VertexAttribPointerNV_remap_index }, + { 19053, VertexAttribPointerNV_remap_index }, { 2097, VertexAttribs1dvNV_remap_index }, - { 16444, VertexAttribs1fvNV_remap_index }, - { 29174, VertexAttribs1svNV_remap_index }, + { 16487, VertexAttribs1fvNV_remap_index }, + { 29210, VertexAttribs1svNV_remap_index }, { 9077, VertexAttribs2dvNV_remap_index }, - { 22248, VertexAttribs2fvNV_remap_index }, - { 15362, VertexAttribs2svNV_remap_index }, + { 22291, VertexAttribs2fvNV_remap_index }, + { 15405, VertexAttribs2svNV_remap_index }, { 4577, VertexAttribs3dvNV_remap_index }, { 1977, VertexAttribs3fvNV_remap_index }, - { 26283, VertexAttribs3svNV_remap_index }, - { 23470, VertexAttribs4dvNV_remap_index }, + { 26358, VertexAttribs3svNV_remap_index }, + { 23513, VertexAttribs4dvNV_remap_index }, { 4603, VertexAttribs4fvNV_remap_index }, - { 28961, VertexAttribs4svNV_remap_index }, - { 26031, VertexAttribs4ubvNV_remap_index }, - { 23540, GetTexBumpParameterfvATI_remap_index }, - { 29215, GetTexBumpParameterivATI_remap_index }, - { 16084, TexBumpParameterfvATI_remap_index }, - { 18001, TexBumpParameterivATI_remap_index }, - { 13628, AlphaFragmentOp1ATI_remap_index }, + { 28997, VertexAttribs4svNV_remap_index }, + { 26106, VertexAttribs4ubvNV_remap_index }, + { 23615, GetTexBumpParameterfvATI_remap_index }, + { 29251, GetTexBumpParameterivATI_remap_index }, + { 16127, TexBumpParameterfvATI_remap_index }, + { 18044, TexBumpParameterivATI_remap_index }, + { 13671, AlphaFragmentOp1ATI_remap_index }, { 9592, AlphaFragmentOp2ATI_remap_index }, - { 21602, AlphaFragmentOp3ATI_remap_index }, - { 26210, BeginFragmentShaderATI_remap_index }, - { 27427, BindFragmentShaderATI_remap_index }, - { 20819, ColorFragmentOp1ATI_remap_index }, + { 21645, AlphaFragmentOp3ATI_remap_index }, + { 26285, BeginFragmentShaderATI_remap_index }, + { 27502, BindFragmentShaderATI_remap_index }, + { 20862, ColorFragmentOp1ATI_remap_index }, { 3823, ColorFragmentOp2ATI_remap_index }, - { 27768, ColorFragmentOp3ATI_remap_index }, + { 27804, ColorFragmentOp3ATI_remap_index }, { 4722, DeleteFragmentShaderATI_remap_index }, - { 29398, EndFragmentShaderATI_remap_index }, - { 28644, GenFragmentShadersATI_remap_index }, - { 22352, PassTexCoordATI_remap_index }, + { 29434, EndFragmentShaderATI_remap_index }, + { 28680, GenFragmentShadersATI_remap_index }, + { 22395, PassTexCoordATI_remap_index }, { 5965, SampleMapATI_remap_index }, { 5738, SetFragmentShaderConstantATI_remap_index }, { 319, PointParameteriNV_remap_index }, - { 12389, PointParameterivNV_remap_index }, - { 25221, ActiveStencilFaceEXT_remap_index }, - { 24062, BindVertexArrayAPPLE_remap_index }, + { 12432, PointParameterivNV_remap_index }, + { 25296, ActiveStencilFaceEXT_remap_index }, + { 24137, BindVertexArrayAPPLE_remap_index }, { 2522, DeleteVertexArraysAPPLE_remap_index }, - { 15701, GenVertexArraysAPPLE_remap_index }, - { 20494, IsVertexArrayAPPLE_remap_index }, + { 15744, GenVertexArraysAPPLE_remap_index }, + { 20537, IsVertexArrayAPPLE_remap_index }, { 775, GetProgramNamedParameterdvNV_remap_index }, { 3128, GetProgramNamedParameterfvNV_remap_index }, - { 23571, ProgramNamedParameter4dNV_remap_index }, - { 12664, ProgramNamedParameter4dvNV_remap_index }, + { 23646, ProgramNamedParameter4dNV_remap_index }, + { 12707, ProgramNamedParameter4dvNV_remap_index }, { 7862, ProgramNamedParameter4fNV_remap_index }, { 10311, ProgramNamedParameter4fvNV_remap_index }, - { 21324, DepthBoundsEXT_remap_index }, + { 21367, DepthBoundsEXT_remap_index }, { 1043, BlendEquationSeparateEXT_remap_index }, - { 12783, BindFramebufferEXT_remap_index }, - { 22539, BindRenderbufferEXT_remap_index }, + { 12826, BindFramebufferEXT_remap_index }, + { 22582, BindRenderbufferEXT_remap_index }, { 8515, CheckFramebufferStatusEXT_remap_index }, - { 19810, DeleteFramebuffersEXT_remap_index }, - { 28025, DeleteRenderbuffersEXT_remap_index }, - { 11756, FramebufferRenderbufferEXT_remap_index }, - { 11893, FramebufferTexture1DEXT_remap_index }, + { 19853, DeleteFramebuffersEXT_remap_index }, + { 28061, DeleteRenderbuffersEXT_remap_index }, + { 11831, FramebufferRenderbufferEXT_remap_index }, + { 11968, FramebufferTexture1DEXT_remap_index }, { 10139, FramebufferTexture2DEXT_remap_index }, { 9806, FramebufferTexture3DEXT_remap_index }, - { 20386, GenFramebuffersEXT_remap_index }, - { 15248, GenRenderbuffersEXT_remap_index }, + { 20429, GenFramebuffersEXT_remap_index }, + { 15291, GenRenderbuffersEXT_remap_index }, { 5684, GenerateMipmapEXT_remap_index }, - { 19041, GetFramebufferAttachmentParameterivEXT_remap_index }, - { 28550, GetRenderbufferParameterivEXT_remap_index }, - { 17881, IsFramebufferEXT_remap_index }, - { 29297, IsRenderbufferEXT_remap_index }, + { 19084, GetFramebufferAttachmentParameterivEXT_remap_index }, + { 28586, GetRenderbufferParameterivEXT_remap_index }, + { 17924, IsFramebufferEXT_remap_index }, + { 29333, IsRenderbufferEXT_remap_index }, { 7173, RenderbufferStorageEXT_remap_index }, { 651, BlitFramebufferEXT_remap_index }, - { 12483, BufferParameteriAPPLE_remap_index }, - { 16778, FlushMappedBufferRangeAPPLE_remap_index }, + { 12526, BufferParameteriAPPLE_remap_index }, + { 16821, FlushMappedBufferRangeAPPLE_remap_index }, { 2701, FramebufferTextureLayerEXT_remap_index }, - { 25932, ProvokingVertexEXT_remap_index }, + { 26007, ProvokingVertexEXT_remap_index }, { 9461, GetTexParameterPointervAPPLE_remap_index }, { 4405, TextureRangeAPPLE_remap_index }, - { 25247, StencilFuncSeparateATI_remap_index }, - { 15768, ProgramEnvParameters4fvEXT_remap_index }, - { 14986, ProgramLocalParameters4fvEXT_remap_index }, - { 12317, GetQueryObjecti64vEXT_remap_index }, + { 25322, StencilFuncSeparateATI_remap_index }, + { 15811, ProgramEnvParameters4fvEXT_remap_index }, + { 15029, ProgramLocalParameters4fvEXT_remap_index }, + { 12360, GetQueryObjecti64vEXT_remap_index }, { 9103, GetQueryObjectui64vEXT_remap_index }, { -1, -1 } }; @@ -4729,8 +4730,8 @@ static const struct gl_function_remap MESA_alt_functions[] = { /* from GL_EXT_blend_minmax */ { 9863, _gloffset_BlendEquation }, /* from GL_EXT_color_subtable */ - { 14884, _gloffset_ColorSubTable }, - { 27957, _gloffset_CopyColorSubTable }, + { 14927, _gloffset_ColorSubTable }, + { 27993, _gloffset_CopyColorSubTable }, /* from GL_EXT_convolution */ { 213, _gloffset_ConvolutionFilter1D }, { 2284, _gloffset_CopyConvolutionFilter1D }, @@ -4738,62 +4739,62 @@ static const struct gl_function_remap MESA_alt_functions[] = { { 7522, _gloffset_ConvolutionFilter2D }, { 7688, _gloffset_ConvolutionParameteriv }, { 8148, _gloffset_ConvolutionParameterfv }, - { 18029, _gloffset_GetSeparableFilter }, - { 21075, _gloffset_SeparableFilter2D }, - { 21904, _gloffset_ConvolutionParameteri }, - { 22027, _gloffset_ConvolutionParameterf }, - { 23406, _gloffset_GetConvolutionParameterfv }, - { 24228, _gloffset_GetConvolutionFilter }, - { 26472, _gloffset_CopyConvolutionFilter2D }, + { 18072, _gloffset_GetSeparableFilter }, + { 21118, _gloffset_SeparableFilter2D }, + { 21947, _gloffset_ConvolutionParameteri }, + { 22070, _gloffset_ConvolutionParameterf }, + { 23449, _gloffset_GetConvolutionParameterfv }, + { 24303, _gloffset_GetConvolutionFilter }, + { 26547, _gloffset_CopyConvolutionFilter2D }, /* from GL_EXT_copy_texture */ - { 13142, _gloffset_CopyTexSubImage3D }, - { 14624, _gloffset_CopyTexImage2D }, - { 21512, _gloffset_CopyTexImage1D }, - { 23909, _gloffset_CopyTexSubImage2D }, - { 26110, _gloffset_CopyTexSubImage1D }, + { 13185, _gloffset_CopyTexSubImage3D }, + { 14667, _gloffset_CopyTexImage2D }, + { 21555, _gloffset_CopyTexImage1D }, + { 23984, _gloffset_CopyTexSubImage2D }, + { 26185, _gloffset_CopyTexSubImage1D }, /* from GL_EXT_draw_range_elements */ { 8402, _gloffset_DrawRangeElements }, /* from GL_EXT_histogram */ { 812, _gloffset_Histogram }, { 3088, _gloffset_ResetHistogram }, { 8774, _gloffset_GetMinmax }, - { 13476, _gloffset_GetHistogramParameterfv }, - { 21437, _gloffset_GetMinmaxParameteriv }, - { 23296, _gloffset_ResetMinmax }, - { 24125, _gloffset_GetHistogramParameteriv }, - { 25181, _gloffset_GetHistogram }, - { 27543, _gloffset_Minmax }, - { 29044, _gloffset_GetMinmaxParameterfv }, + { 13519, _gloffset_GetHistogramParameterfv }, + { 21480, _gloffset_GetMinmaxParameteriv }, + { 23339, _gloffset_ResetMinmax }, + { 24200, _gloffset_GetHistogramParameteriv }, + { 25256, _gloffset_GetHistogram }, + { 27618, _gloffset_Minmax }, + { 29080, _gloffset_GetMinmaxParameterfv }, /* from GL_EXT_paletted_texture */ { 7384, _gloffset_ColorTable }, - { 13322, _gloffset_GetColorTable }, - { 20133, _gloffset_GetColorTableParameterfv }, - { 22083, _gloffset_GetColorTableParameteriv }, + { 13365, _gloffset_GetColorTable }, + { 20176, _gloffset_GetColorTableParameterfv }, + { 22126, _gloffset_GetColorTableParameteriv }, /* from GL_EXT_subtexture */ { 6105, _gloffset_TexSubImage1D }, { 9388, _gloffset_TexSubImage2D }, /* from GL_EXT_texture3D */ { 1658, _gloffset_TexImage3D }, - { 19902, _gloffset_TexSubImage3D }, + { 19945, _gloffset_TexSubImage3D }, /* from GL_EXT_texture_object */ { 2964, _gloffset_PrioritizeTextures }, { 6554, _gloffset_AreTexturesResident }, - { 11841, _gloffset_GenTextures }, - { 13808, _gloffset_DeleteTextures }, - { 17059, _gloffset_IsTexture }, - { 26175, _gloffset_BindTexture }, + { 11916, _gloffset_GenTextures }, + { 13851, _gloffset_DeleteTextures }, + { 17102, _gloffset_IsTexture }, + { 26250, _gloffset_BindTexture }, /* from GL_EXT_vertex_array */ - { 21264, _gloffset_ArrayElement }, - { 27131, _gloffset_GetPointerv }, - { 28671, _gloffset_DrawArrays }, + { 21307, _gloffset_ArrayElement }, + { 27206, _gloffset_GetPointerv }, + { 28707, _gloffset_DrawArrays }, /* from GL_SGI_color_table */ { 6672, _gloffset_ColorTableParameteriv }, { 7384, _gloffset_ColorTable }, - { 13322, _gloffset_GetColorTable }, - { 13432, _gloffset_CopyColorTable }, - { 16920, _gloffset_ColorTableParameterfv }, - { 20133, _gloffset_GetColorTableParameterfv }, - { 22083, _gloffset_GetColorTableParameteriv }, + { 13365, _gloffset_GetColorTable }, + { 13475, _gloffset_CopyColorTable }, + { 16963, _gloffset_ColorTableParameterfv }, + { 20176, _gloffset_GetColorTableParameterfv }, + { 22126, _gloffset_GetColorTableParameteriv }, /* from GL_VERSION_1_3 */ { 381, _gloffset_MultiTexCoord3sARB }, { 613, _gloffset_ActiveTextureARB }, @@ -4806,29 +4807,29 @@ static const struct gl_function_remap MESA_alt_functions[] = { { 9625, _gloffset_MultiTexCoord4sARB }, { 10225, _gloffset_MultiTexCoord2dvARB }, { 10607, _gloffset_MultiTexCoord1svARB }, - { 10864, _gloffset_MultiTexCoord3svARB }, - { 10925, _gloffset_MultiTexCoord4iARB }, - { 11612, _gloffset_MultiTexCoord3iARB }, - { 12346, _gloffset_MultiTexCoord1dARB }, - { 12512, _gloffset_MultiTexCoord3dvARB }, - { 13676, _gloffset_MultiTexCoord3ivARB }, - { 13721, _gloffset_MultiTexCoord2sARB }, - { 14941, _gloffset_MultiTexCoord4ivARB }, - { 16570, _gloffset_ClientActiveTextureARB }, - { 18786, _gloffset_MultiTexCoord2dARB }, - { 19161, _gloffset_MultiTexCoord4dvARB }, - { 19447, _gloffset_MultiTexCoord4fvARB }, - { 20274, _gloffset_MultiTexCoord3fARB }, - { 22584, _gloffset_MultiTexCoord4dARB }, - { 22788, _gloffset_MultiTexCoord1sARB }, - { 22966, _gloffset_MultiTexCoord1dvARB }, - { 23753, _gloffset_MultiTexCoord1ivARB }, - { 23846, _gloffset_MultiTexCoord2ivARB }, - { 24185, _gloffset_MultiTexCoord1iARB }, - { 25456, _gloffset_MultiTexCoord4svARB }, - { 25974, _gloffset_MultiTexCoord1fARB }, - { 26237, _gloffset_MultiTexCoord4fARB }, - { 28505, _gloffset_MultiTexCoord2fvARB }, + { 10903, _gloffset_MultiTexCoord3svARB }, + { 10964, _gloffset_MultiTexCoord4iARB }, + { 11687, _gloffset_MultiTexCoord3iARB }, + { 12389, _gloffset_MultiTexCoord1dARB }, + { 12555, _gloffset_MultiTexCoord3dvARB }, + { 13719, _gloffset_MultiTexCoord3ivARB }, + { 13764, _gloffset_MultiTexCoord2sARB }, + { 14984, _gloffset_MultiTexCoord4ivARB }, + { 16613, _gloffset_ClientActiveTextureARB }, + { 18829, _gloffset_MultiTexCoord2dARB }, + { 19204, _gloffset_MultiTexCoord4dvARB }, + { 19490, _gloffset_MultiTexCoord4fvARB }, + { 20317, _gloffset_MultiTexCoord3fARB }, + { 22627, _gloffset_MultiTexCoord4dARB }, + { 22831, _gloffset_MultiTexCoord1sARB }, + { 23009, _gloffset_MultiTexCoord1dvARB }, + { 23828, _gloffset_MultiTexCoord1ivARB }, + { 23921, _gloffset_MultiTexCoord2ivARB }, + { 24260, _gloffset_MultiTexCoord1iARB }, + { 25531, _gloffset_MultiTexCoord4svARB }, + { 26049, _gloffset_MultiTexCoord1fARB }, + { 26312, _gloffset_MultiTexCoord4fARB }, + { 28541, _gloffset_MultiTexCoord2fvARB }, { -1, -1 } }; @@ -4900,10 +4901,10 @@ static const struct gl_function_remap GL_ARB_map_buffer_range_functions[] = { #if defined(need_GL_ARB_matrix_palette) static const struct gl_function_remap GL_ARB_matrix_palette_functions[] = { { 3339, -1 }, /* MatrixIndexusvARB */ - { 11469, -1 }, /* MatrixIndexuivARB */ - { 12634, -1 }, /* MatrixIndexPointerARB */ - { 17308, -1 }, /* CurrentPaletteMatrixARB */ - { 20018, -1 }, /* MatrixIndexubvARB */ + { 11508, -1 }, /* MatrixIndexuivARB */ + { 12677, -1 }, /* MatrixIndexPointerARB */ + { 17351, -1 }, /* CurrentPaletteMatrixARB */ + { 20061, -1 }, /* MatrixIndexubvARB */ { -1, -1 } }; #endif @@ -4976,13 +4977,13 @@ static const struct gl_function_remap GL_ARB_vertex_blend_functions[] = { { 2226, -1 }, /* WeightubvARB */ { 5572, -1 }, /* WeightivARB */ { 9728, -1 }, /* WeightPointerARB */ - { 12103, -1 }, /* WeightfvARB */ - { 15388, -1 }, /* WeightbvARB */ - { 18454, -1 }, /* WeightusvARB */ - { 21001, -1 }, /* VertexBlendARB */ - { 26058, -1 }, /* WeightsvARB */ - { 28007, -1 }, /* WeightdvARB */ - { 28705, -1 }, /* WeightuivARB */ + { 12146, -1 }, /* WeightfvARB */ + { 15431, -1 }, /* WeightbvARB */ + { 18497, -1 }, /* WeightusvARB */ + { 21044, -1 }, /* VertexBlendARB */ + { 26133, -1 }, /* WeightsvARB */ + { 28043, -1 }, /* WeightdvARB */ + { 28741, -1 }, /* WeightuivARB */ { -1, -1 } }; #endif @@ -5080,8 +5081,8 @@ static const struct gl_function_remap GL_EXT_blend_minmax_functions[] = { #if defined(need_GL_EXT_color_subtable) static const struct gl_function_remap GL_EXT_color_subtable_functions[] = { - { 14884, _gloffset_ColorSubTable }, - { 27957, _gloffset_CopyColorSubTable }, + { 14927, _gloffset_ColorSubTable }, + { 27993, _gloffset_CopyColorSubTable }, { -1, -1 } }; #endif @@ -5101,13 +5102,13 @@ static const struct gl_function_remap GL_EXT_convolution_functions[] = { { 7522, _gloffset_ConvolutionFilter2D }, { 7688, _gloffset_ConvolutionParameteriv }, { 8148, _gloffset_ConvolutionParameterfv }, - { 18029, _gloffset_GetSeparableFilter }, - { 21075, _gloffset_SeparableFilter2D }, - { 21904, _gloffset_ConvolutionParameteri }, - { 22027, _gloffset_ConvolutionParameterf }, - { 23406, _gloffset_GetConvolutionParameterfv }, - { 24228, _gloffset_GetConvolutionFilter }, - { 26472, _gloffset_CopyConvolutionFilter2D }, + { 18072, _gloffset_GetSeparableFilter }, + { 21118, _gloffset_SeparableFilter2D }, + { 21947, _gloffset_ConvolutionParameteri }, + { 22070, _gloffset_ConvolutionParameterf }, + { 23449, _gloffset_GetConvolutionParameterfv }, + { 24303, _gloffset_GetConvolutionFilter }, + { 26547, _gloffset_CopyConvolutionFilter2D }, { -1, -1 } }; #endif @@ -5115,38 +5116,38 @@ static const struct gl_function_remap GL_EXT_convolution_functions[] = { #if defined(need_GL_EXT_coordinate_frame) static const struct gl_function_remap GL_EXT_coordinate_frame_functions[] = { { 9272, -1 }, /* TangentPointerEXT */ - { 10983, -1 }, /* Binormal3ivEXT */ - { 11565, -1 }, /* Tangent3sEXT */ - { 12699, -1 }, /* Tangent3fvEXT */ - { 16320, -1 }, /* Tangent3dvEXT */ - { 17006, -1 }, /* Binormal3bvEXT */ - { 18082, -1 }, /* Binormal3dEXT */ - { 19950, -1 }, /* Tangent3fEXT */ - { 21976, -1 }, /* Binormal3sEXT */ - { 22394, -1 }, /* Tangent3ivEXT */ - { 22413, -1 }, /* Tangent3dEXT */ - { 23193, -1 }, /* Binormal3svEXT */ - { 23651, -1 }, /* Binormal3fEXT */ - { 24503, -1 }, /* Binormal3dvEXT */ - { 25678, -1 }, /* Tangent3iEXT */ - { 26757, -1 }, /* Tangent3bvEXT */ - { 27166, -1 }, /* Tangent3bEXT */ - { 27730, -1 }, /* Binormal3fvEXT */ - { 28404, -1 }, /* BinormalPointerEXT */ - { 28809, -1 }, /* Tangent3svEXT */ - { 29246, -1 }, /* Binormal3bEXT */ - { 29423, -1 }, /* Binormal3iEXT */ + { 11022, -1 }, /* Binormal3ivEXT */ + { 11640, -1 }, /* Tangent3sEXT */ + { 12742, -1 }, /* Tangent3fvEXT */ + { 16363, -1 }, /* Tangent3dvEXT */ + { 17049, -1 }, /* Binormal3bvEXT */ + { 18125, -1 }, /* Binormal3dEXT */ + { 19993, -1 }, /* Tangent3fEXT */ + { 22019, -1 }, /* Binormal3sEXT */ + { 22437, -1 }, /* Tangent3ivEXT */ + { 22456, -1 }, /* Tangent3dEXT */ + { 23236, -1 }, /* Binormal3svEXT */ + { 23726, -1 }, /* Binormal3fEXT */ + { 24578, -1 }, /* Binormal3dvEXT */ + { 25753, -1 }, /* Tangent3iEXT */ + { 26832, -1 }, /* Tangent3bvEXT */ + { 27241, -1 }, /* Tangent3bEXT */ + { 27766, -1 }, /* Binormal3fvEXT */ + { 28440, -1 }, /* BinormalPointerEXT */ + { 28845, -1 }, /* Tangent3svEXT */ + { 29282, -1 }, /* Binormal3bEXT */ + { 29459, -1 }, /* Binormal3iEXT */ { -1, -1 } }; #endif #if defined(need_GL_EXT_copy_texture) static const struct gl_function_remap GL_EXT_copy_texture_functions[] = { - { 13142, _gloffset_CopyTexSubImage3D }, - { 14624, _gloffset_CopyTexImage2D }, - { 21512, _gloffset_CopyTexImage1D }, - { 23909, _gloffset_CopyTexSubImage2D }, - { 26110, _gloffset_CopyTexSubImage1D }, + { 13185, _gloffset_CopyTexSubImage3D }, + { 14667, _gloffset_CopyTexImage2D }, + { 21555, _gloffset_CopyTexImage1D }, + { 23984, _gloffset_CopyTexSubImage2D }, + { 26185, _gloffset_CopyTexSubImage1D }, { -1, -1 } }; #endif @@ -5186,6 +5187,13 @@ static const struct gl_function_remap GL_EXT_framebuffer_blit_functions[] = { }; #endif +#if defined(need_GL_EXT_framebuffer_multisample) +/* functions defined in MESA_remap_table_functions are excluded */ +static const struct gl_function_remap GL_EXT_framebuffer_multisample_functions[] = { + { -1, -1 } +}; +#endif + #if defined(need_GL_EXT_framebuffer_object) /* functions defined in MESA_remap_table_functions are excluded */ static const struct gl_function_remap GL_EXT_framebuffer_object_functions[] = { @@ -5205,13 +5213,13 @@ static const struct gl_function_remap GL_EXT_histogram_functions[] = { { 812, _gloffset_Histogram }, { 3088, _gloffset_ResetHistogram }, { 8774, _gloffset_GetMinmax }, - { 13476, _gloffset_GetHistogramParameterfv }, - { 21437, _gloffset_GetMinmaxParameteriv }, - { 23296, _gloffset_ResetMinmax }, - { 24125, _gloffset_GetHistogramParameteriv }, - { 25181, _gloffset_GetHistogram }, - { 27543, _gloffset_Minmax }, - { 29044, _gloffset_GetMinmaxParameterfv }, + { 13519, _gloffset_GetHistogramParameterfv }, + { 21480, _gloffset_GetMinmaxParameteriv }, + { 23339, _gloffset_ResetMinmax }, + { 24200, _gloffset_GetHistogramParameteriv }, + { 25256, _gloffset_GetHistogram }, + { 27618, _gloffset_Minmax }, + { 29080, _gloffset_GetMinmaxParameterfv }, { -1, -1 } }; #endif @@ -5225,16 +5233,16 @@ static const struct gl_function_remap GL_EXT_index_func_functions[] = { #if defined(need_GL_EXT_index_material) static const struct gl_function_remap GL_EXT_index_material_functions[] = { - { 18541, -1 }, /* IndexMaterialEXT */ + { 18584, -1 }, /* IndexMaterialEXT */ { -1, -1 } }; #endif #if defined(need_GL_EXT_light_texture) static const struct gl_function_remap GL_EXT_light_texture_functions[] = { - { 23213, -1 }, /* ApplyTextureEXT */ - { 23250, -1 }, /* TextureMaterialEXT */ - { 23275, -1 }, /* TextureLightEXT */ + { 23256, -1 }, /* ApplyTextureEXT */ + { 23293, -1 }, /* TextureMaterialEXT */ + { 23318, -1 }, /* TextureLightEXT */ { -1, -1 } }; #endif @@ -5256,9 +5264,9 @@ static const struct gl_function_remap GL_EXT_multisample_functions[] = { #if defined(need_GL_EXT_paletted_texture) static const struct gl_function_remap GL_EXT_paletted_texture_functions[] = { { 7384, _gloffset_ColorTable }, - { 13322, _gloffset_GetColorTable }, - { 20133, _gloffset_GetColorTableParameterfv }, - { 22083, _gloffset_GetColorTableParameteriv }, + { 13365, _gloffset_GetColorTable }, + { 20176, _gloffset_GetColorTableParameterfv }, + { 22126, _gloffset_GetColorTableParameteriv }, { -1, -1 } }; #endif @@ -5266,9 +5274,9 @@ static const struct gl_function_remap GL_EXT_paletted_texture_functions[] = { #if defined(need_GL_EXT_pixel_transform) static const struct gl_function_remap GL_EXT_pixel_transform_functions[] = { { 9513, -1 }, /* PixelTransformParameterfvEXT */ - { 19126, -1 }, /* PixelTransformParameterfEXT */ - { 19206, -1 }, /* PixelTransformParameteriEXT */ - { 28368, -1 }, /* PixelTransformParameterivEXT */ + { 19169, -1 }, /* PixelTransformParameterfEXT */ + { 19249, -1 }, /* PixelTransformParameteriEXT */ + { 28404, -1 }, /* PixelTransformParameterivEXT */ { -1, -1 } }; #endif @@ -5319,7 +5327,7 @@ static const struct gl_function_remap GL_EXT_subtexture_functions[] = { #if defined(need_GL_EXT_texture3D) static const struct gl_function_remap GL_EXT_texture3D_functions[] = { { 1658, _gloffset_TexImage3D }, - { 19902, _gloffset_TexSubImage3D }, + { 19945, _gloffset_TexSubImage3D }, { -1, -1 } }; #endif @@ -5335,17 +5343,17 @@ static const struct gl_function_remap GL_EXT_texture_array_functions[] = { static const struct gl_function_remap GL_EXT_texture_object_functions[] = { { 2964, _gloffset_PrioritizeTextures }, { 6554, _gloffset_AreTexturesResident }, - { 11841, _gloffset_GenTextures }, - { 13808, _gloffset_DeleteTextures }, - { 17059, _gloffset_IsTexture }, - { 26175, _gloffset_BindTexture }, + { 11916, _gloffset_GenTextures }, + { 13851, _gloffset_DeleteTextures }, + { 17102, _gloffset_IsTexture }, + { 26250, _gloffset_BindTexture }, { -1, -1 } }; #endif #if defined(need_GL_EXT_texture_perturb_normal) static const struct gl_function_remap GL_EXT_texture_perturb_normal_functions[] = { - { 12053, -1 }, /* TextureNormalEXT */ + { 12096, -1 }, /* TextureNormalEXT */ { -1, -1 } }; #endif @@ -5360,18 +5368,18 @@ static const struct gl_function_remap GL_EXT_timer_query_functions[] = { #if defined(need_GL_EXT_vertex_array) /* functions defined in MESA_remap_table_functions are excluded */ static const struct gl_function_remap GL_EXT_vertex_array_functions[] = { - { 21264, _gloffset_ArrayElement }, - { 27131, _gloffset_GetPointerv }, - { 28671, _gloffset_DrawArrays }, + { 21307, _gloffset_ArrayElement }, + { 27206, _gloffset_GetPointerv }, + { 28707, _gloffset_DrawArrays }, { -1, -1 } }; #endif #if defined(need_GL_EXT_vertex_weighting) static const struct gl_function_remap GL_EXT_vertex_weighting_functions[] = { - { 17089, -1 }, /* VertexWeightfvEXT */ - { 23629, -1 }, /* VertexWeightfEXT */ - { 25150, -1 }, /* VertexWeightPointerEXT */ + { 17132, -1 }, /* VertexWeightfvEXT */ + { 23704, -1 }, /* VertexWeightfEXT */ + { 25225, -1 }, /* VertexWeightPointerEXT */ { -1, -1 } }; #endif @@ -5382,8 +5390,8 @@ static const struct gl_function_remap GL_HP_image_transform_functions[] = { { 3305, -1 }, /* ImageTransformParameterfHP */ { 8966, -1 }, /* ImageTransformParameterfvHP */ { 10525, -1 }, /* ImageTransformParameteriHP */ - { 10754, -1 }, /* GetImageTransformParameterivHP */ - { 17153, -1 }, /* ImageTransformParameterivHP */ + { 10793, -1 }, /* GetImageTransformParameterivHP */ + { 17196, -1 }, /* ImageTransformParameterivHP */ { -1, -1 } }; #endif @@ -5402,9 +5410,9 @@ static const struct gl_function_remap GL_IBM_vertex_array_lists_functions[] = { { 6728, -1 }, /* FogCoordPointerListIBM */ { 7035, -1 }, /* VertexPointerListIBM */ { 10446, -1 }, /* ColorPointerListIBM */ - { 11672, -1 }, /* TexCoordPointerListIBM */ - { 12075, -1 }, /* IndexPointerListIBM */ - { 28987, -1 }, /* EdgeFlagPointerListIBM */ + { 11747, -1 }, /* TexCoordPointerListIBM */ + { 12118, -1 }, /* IndexPointerListIBM */ + { 29023, -1 }, /* EdgeFlagPointerListIBM */ { -1, -1 } }; #endif @@ -5418,10 +5426,10 @@ static const struct gl_function_remap GL_INGR_blend_func_separate_functions[] = #if defined(need_GL_INTEL_parallel_arrays) static const struct gl_function_remap GL_INTEL_parallel_arrays_functions[] = { - { 11095, -1 }, /* VertexPointervINTEL */ - { 13569, -1 }, /* ColorPointervINTEL */ - { 26446, -1 }, /* NormalPointervINTEL */ - { 26872, -1 }, /* TexCoordPointervINTEL */ + { 11134, -1 }, /* VertexPointervINTEL */ + { 13612, -1 }, /* ColorPointervINTEL */ + { 26521, -1 }, /* NormalPointervINTEL */ + { 26947, -1 }, /* TexCoordPointervINTEL */ { -1, -1 } }; #endif @@ -5438,7 +5446,7 @@ static const struct gl_function_remap GL_MESA_shader_debug_functions[] = { { 1522, -1 }, /* GetDebugLogLengthMESA */ { 3063, -1 }, /* ClearDebugLogMESA */ { 4018, -1 }, /* GetDebugLogMESA */ - { 27324, -1 }, /* CreateDebugObjectMESA */ + { 27399, -1 }, /* CreateDebugObjectMESA */ { -1, -1 } }; #endif @@ -5456,11 +5464,11 @@ static const struct gl_function_remap GL_NV_evaluators_functions[] = { { 7490, -1 }, /* MapControlPointsNV */ { 7589, -1 }, /* MapParameterfvNV */ { 9371, -1 }, /* EvalMapsNV */ - { 15058, -1 }, /* GetMapAttribParameterfvNV */ - { 15224, -1 }, /* MapParameterivNV */ - { 21827, -1 }, /* GetMapParameterivNV */ - { 22325, -1 }, /* GetMapParameterfvNV */ - { 25782, -1 }, /* GetMapControlPointsNV */ + { 15101, -1 }, /* GetMapAttribParameterfvNV */ + { 15267, -1 }, /* MapParameterivNV */ + { 21870, -1 }, /* GetMapParameterivNV */ + { 22368, -1 }, /* GetMapParameterfvNV */ + { 25857, -1 }, /* GetMapControlPointsNV */ { -1, -1 } }; #endif @@ -5495,8 +5503,8 @@ static const struct gl_function_remap GL_NV_register_combiners_functions[] = { #if defined(need_GL_NV_register_combiners2) static const struct gl_function_remap GL_NV_register_combiners2_functions[] = { - { 13961, -1 }, /* CombinerStageParameterfvNV */ - { 14276, -1 }, /* GetCombinerStageParameterfvNV */ + { 14004, -1 }, /* CombinerStageParameterfvNV */ + { 14319, -1 }, /* GetCombinerStageParameterfvNV */ { -1, -1 } }; #endif @@ -5524,16 +5532,16 @@ static const struct gl_function_remap GL_PGI_misc_hints_functions[] = { #if defined(need_GL_SGIS_detail_texture) static const struct gl_function_remap GL_SGIS_detail_texture_functions[] = { - { 14249, -1 }, /* GetDetailTexFuncSGIS */ - { 14569, -1 }, /* DetailTexFuncSGIS */ + { 14292, -1 }, /* GetDetailTexFuncSGIS */ + { 14612, -1 }, /* DetailTexFuncSGIS */ { -1, -1 } }; #endif #if defined(need_GL_SGIS_fog_function) static const struct gl_function_remap GL_SGIS_fog_function_functions[] = { - { 23891, -1 }, /* FogFuncSGIS */ - { 24556, -1 }, /* GetFogFuncSGIS */ + { 23966, -1 }, /* FogFuncSGIS */ + { 24631, -1 }, /* GetFogFuncSGIS */ { -1, -1 } }; #endif @@ -5562,7 +5570,7 @@ static const struct gl_function_remap GL_SGIS_point_parameters_functions[] = { #if defined(need_GL_SGIS_sharpen_texture) static const struct gl_function_remap GL_SGIS_sharpen_texture_functions[] = { { 5834, -1 }, /* GetSharpenTexFuncSGIS */ - { 19421, -1 }, /* SharpenTexFuncSGIS */ + { 19464, -1 }, /* SharpenTexFuncSGIS */ { -1, -1 } }; #endif @@ -5570,14 +5578,14 @@ static const struct gl_function_remap GL_SGIS_sharpen_texture_functions[] = { #if defined(need_GL_SGIS_texture4D) static const struct gl_function_remap GL_SGIS_texture4D_functions[] = { { 894, -1 }, /* TexImage4DSGIS */ - { 13877, -1 }, /* TexSubImage4DSGIS */ + { 13920, -1 }, /* TexSubImage4DSGIS */ { -1, -1 } }; #endif #if defined(need_GL_SGIS_texture_color_mask) static const struct gl_function_remap GL_SGIS_texture_color_mask_functions[] = { - { 13275, -1 }, /* TextureColorMaskSGIS */ + { 13318, -1 }, /* TextureColorMaskSGIS */ { -1, -1 } }; #endif @@ -5585,7 +5593,7 @@ static const struct gl_function_remap GL_SGIS_texture_color_mask_functions[] = { #if defined(need_GL_SGIS_texture_filter4) static const struct gl_function_remap GL_SGIS_texture_filter4_functions[] = { { 6011, -1 }, /* GetTexFilterFuncSGIS */ - { 14395, -1 }, /* TexFilterFuncSGIS */ + { 14438, -1 }, /* TexFilterFuncSGIS */ { -1, -1 } }; #endif @@ -5595,9 +5603,9 @@ static const struct gl_function_remap GL_SGIX_async_functions[] = { { 3014, -1 }, /* AsyncMarkerSGIX */ { 3997, -1 }, /* FinishAsyncSGIX */ { 4703, -1 }, /* PollAsyncSGIX */ - { 19568, -1 }, /* DeleteAsyncMarkersSGIX */ - { 19597, -1 }, /* IsAsyncMarkerSGIX */ - { 28784, -1 }, /* GenAsyncMarkersSGIX */ + { 19611, -1 }, /* DeleteAsyncMarkersSGIX */ + { 19640, -1 }, /* IsAsyncMarkerSGIX */ + { 28820, -1 }, /* GenAsyncMarkersSGIX */ { -1, -1 } }; #endif @@ -5620,29 +5628,29 @@ static const struct gl_function_remap GL_SGIX_fragment_lighting_functions[] = { { 8100, -1 }, /* FragmentLightModeliSGIX */ { 9434, -1 }, /* FragmentLightivSGIX */ { 9671, -1 }, /* GetFragmentMaterialivSGIX */ - { 16976, -1 }, /* FragmentLightModelfSGIX */ - { 17276, -1 }, /* FragmentColorMaterialSGIX */ - { 17648, -1 }, /* FragmentMaterialiSGIX */ - { 18869, -1 }, /* LightEnviSGIX */ - { 20225, -1 }, /* FragmentLightModelfvSGIX */ - { 20534, -1 }, /* FragmentLightfvSGIX */ - { 25032, -1 }, /* FragmentLightfSGIX */ - { 27700, -1 }, /* GetFragmentLightfvSGIX */ - { 29267, -1 }, /* FragmentMaterialivSGIX */ + { 17019, -1 }, /* FragmentLightModelfSGIX */ + { 17319, -1 }, /* FragmentColorMaterialSGIX */ + { 17691, -1 }, /* FragmentMaterialiSGIX */ + { 18912, -1 }, /* LightEnviSGIX */ + { 20268, -1 }, /* FragmentLightModelfvSGIX */ + { 20577, -1 }, /* FragmentLightfvSGIX */ + { 25107, -1 }, /* FragmentLightfSGIX */ + { 27736, -1 }, /* GetFragmentLightfvSGIX */ + { 29303, -1 }, /* FragmentMaterialivSGIX */ { -1, -1 } }; #endif #if defined(need_GL_SGIX_framezoom) static const struct gl_function_remap GL_SGIX_framezoom_functions[] = { - { 19620, -1 }, /* FrameZoomSGIX */ + { 19663, -1 }, /* FrameZoomSGIX */ { -1, -1 } }; #endif #if defined(need_GL_SGIX_igloo_interface) static const struct gl_function_remap GL_SGIX_igloo_interface_functions[] = { - { 25340, -1 }, /* IglooInterfaceSGIX */ + { 25415, -1 }, /* IglooInterfaceSGIX */ { -1, -1 } }; #endif @@ -5652,9 +5660,9 @@ static const struct gl_function_remap GL_SGIX_instruments_functions[] = { { 2573, -1 }, /* ReadInstrumentsSGIX */ { 5590, -1 }, /* PollInstrumentsSGIX */ { 9332, -1 }, /* GetInstrumentsSGIX */ - { 11306, -1 }, /* StartInstrumentsSGIX */ - { 13995, -1 }, /* StopInstrumentsSGIX */ - { 15601, -1 }, /* InstrumentsBufferSGIX */ + { 11345, -1 }, /* StartInstrumentsSGIX */ + { 14038, -1 }, /* StopInstrumentsSGIX */ + { 15644, -1 }, /* InstrumentsBufferSGIX */ { -1, -1 } }; #endif @@ -5663,10 +5671,10 @@ static const struct gl_function_remap GL_SGIX_instruments_functions[] = { static const struct gl_function_remap GL_SGIX_list_priority_functions[] = { { 1125, -1 }, /* ListParameterfSGIX */ { 2763, -1 }, /* GetListParameterfvSGIX */ - { 15516, -1 }, /* ListParameteriSGIX */ - { 16270, -1 }, /* ListParameterfvSGIX */ - { 18275, -1 }, /* ListParameterivSGIX */ - { 28828, -1 }, /* GetListParameterivSGIX */ + { 15559, -1 }, /* ListParameteriSGIX */ + { 16313, -1 }, /* ListParameterfvSGIX */ + { 18318, -1 }, /* ListParameterivSGIX */ + { 28864, -1 }, /* GetListParameterivSGIX */ { -1, -1 } }; #endif @@ -5681,16 +5689,16 @@ static const struct gl_function_remap GL_SGIX_pixel_texture_functions[] = { #if defined(need_GL_SGIX_polynomial_ffd) static const struct gl_function_remap GL_SGIX_polynomial_ffd_functions[] = { { 3251, -1 }, /* LoadIdentityDeformationMapSGIX */ - { 14095, -1 }, /* DeformSGIX */ - { 21376, -1 }, /* DeformationMap3fSGIX */ - { 27588, -1 }, /* DeformationMap3dSGIX */ + { 10713, -1 }, /* DeformationMap3dSGIX */ + { 14138, -1 }, /* DeformSGIX */ + { 21419, -1 }, /* DeformationMap3fSGIX */ { -1, -1 } }; #endif #if defined(need_GL_SGIX_reference_plane) static const struct gl_function_remap GL_SGIX_reference_plane_functions[] = { - { 12826, -1 }, /* ReferencePlaneSGIX */ + { 12869, -1 }, /* ReferencePlaneSGIX */ { -1, -1 } }; #endif @@ -5698,16 +5706,16 @@ static const struct gl_function_remap GL_SGIX_reference_plane_functions[] = { #if defined(need_GL_SGIX_sprite) static const struct gl_function_remap GL_SGIX_sprite_functions[] = { { 8487, -1 }, /* SpriteParameterfvSGIX */ - { 18103, -1 }, /* SpriteParameteriSGIX */ - { 23330, -1 }, /* SpriteParameterfSGIX */ - { 25904, -1 }, /* SpriteParameterivSGIX */ + { 18146, -1 }, /* SpriteParameteriSGIX */ + { 23373, -1 }, /* SpriteParameterfSGIX */ + { 25979, -1 }, /* SpriteParameterivSGIX */ { -1, -1 } }; #endif #if defined(need_GL_SGIX_tag_sample_buffer) static const struct gl_function_remap GL_SGIX_tag_sample_buffer_functions[] = { - { 18162, -1 }, /* TagSampleBufferSGIX */ + { 18205, -1 }, /* TagSampleBufferSGIX */ { -1, -1 } }; #endif @@ -5716,18 +5724,18 @@ static const struct gl_function_remap GL_SGIX_tag_sample_buffer_functions[] = { static const struct gl_function_remap GL_SGI_color_table_functions[] = { { 6672, _gloffset_ColorTableParameteriv }, { 7384, _gloffset_ColorTable }, - { 13322, _gloffset_GetColorTable }, - { 13432, _gloffset_CopyColorTable }, - { 16920, _gloffset_ColorTableParameterfv }, - { 20133, _gloffset_GetColorTableParameterfv }, - { 22083, _gloffset_GetColorTableParameteriv }, + { 13365, _gloffset_GetColorTable }, + { 13475, _gloffset_CopyColorTable }, + { 16963, _gloffset_ColorTableParameterfv }, + { 20176, _gloffset_GetColorTableParameterfv }, + { 22126, _gloffset_GetColorTableParameteriv }, { -1, -1 } }; #endif #if defined(need_GL_SUNX_constant_data) static const struct gl_function_remap GL_SUNX_constant_data_functions[] = { - { 27678, -1 }, /* FinishTextureSUNX */ + { 27714, -1 }, /* FinishTextureSUNX */ { -1, -1 } }; #endif @@ -5739,16 +5747,16 @@ static const struct gl_function_remap GL_SUN_global_alpha_functions[] = { { 5615, -1 }, /* GlobalAlphaFactordSUN */ { 8571, -1 }, /* GlobalAlphaFactoruiSUN */ { 8923, -1 }, /* GlobalAlphaFactorbSUN */ - { 11585, -1 }, /* GlobalAlphaFactorfSUN */ - { 11704, -1 }, /* GlobalAlphaFactorusSUN */ - { 19859, -1 }, /* GlobalAlphaFactorsSUN */ + { 11660, -1 }, /* GlobalAlphaFactorfSUN */ + { 11779, -1 }, /* GlobalAlphaFactorusSUN */ + { 19902, -1 }, /* GlobalAlphaFactorsSUN */ { -1, -1 } }; #endif #if defined(need_GL_SUN_mesh_array) static const struct gl_function_remap GL_SUN_mesh_array_functions[] = { - { 25716, -1 }, /* DrawMeshArraysSUN */ + { 25791, -1 }, /* DrawMeshArraysSUN */ { -1, -1 } }; #endif @@ -5757,11 +5765,11 @@ static const struct gl_function_remap GL_SUN_mesh_array_functions[] = { static const struct gl_function_remap GL_SUN_triangle_list_functions[] = { { 3971, -1 }, /* ReplacementCodeubSUN */ { 5454, -1 }, /* ReplacementCodeubvSUN */ - { 16641, -1 }, /* ReplacementCodeusvSUN */ - { 16829, -1 }, /* ReplacementCodePointerSUN */ - { 18186, -1 }, /* ReplacementCodeusSUN */ - { 18933, -1 }, /* ReplacementCodeuiSUN */ - { 26361, -1 }, /* ReplacementCodeuivSUN */ + { 16684, -1 }, /* ReplacementCodeusvSUN */ + { 16872, -1 }, /* ReplacementCodePointerSUN */ + { 18229, -1 }, /* ReplacementCodeusSUN */ + { 18976, -1 }, /* ReplacementCodeuiSUN */ + { 26436, -1 }, /* ReplacementCodeuivSUN */ { -1, -1 } }; #endif @@ -5786,28 +5794,28 @@ static const struct gl_function_remap GL_SUN_vertex_functions[] = { { 8882, -1 }, /* Color3fVertex3fvSUN */ { 9297, -1 }, /* Color4fNormal3fVertex3fvSUN */ { 9969, -1 }, /* ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN */ - { 11169, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fvSUN */ - { 12557, -1 }, /* ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN */ - { 12968, -1 }, /* TexCoord2fColor3fVertex3fSUN */ - { 14020, -1 }, /* TexCoord4fColor4fNormal3fVertex4fSUN */ - { 14354, -1 }, /* Color4ubVertex2fvSUN */ - { 14594, -1 }, /* Normal3fVertex3fSUN */ - { 15542, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fSUN */ - { 15803, -1 }, /* TexCoord2fColor4fNormal3fVertex3fvSUN */ - { 16470, -1 }, /* TexCoord2fVertex3fvSUN */ - { 17246, -1 }, /* Color4ubVertex2fSUN */ - { 17439, -1 }, /* ReplacementCodeuiColor4ubVertex3fSUN */ - { 19292, -1 }, /* TexCoord2fColor4ubVertex3fSUN */ - { 19639, -1 }, /* Normal3fVertex3fvSUN */ - { 20042, -1 }, /* Color4fNormal3fVertex3fSUN */ - { 20908, -1 }, /* ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN */ - { 21128, -1 }, /* ReplacementCodeuiColor4ubVertex3fvSUN */ - { 22831, -1 }, /* ReplacementCodeuiColor3fVertex3fSUN */ - { 24007, -1 }, /* TexCoord4fVertex4fSUN */ - { 24433, -1 }, /* TexCoord2fColor3fVertex3fvSUN */ - { 24759, -1 }, /* ReplacementCodeuiNormal3fVertex3fvSUN */ - { 24886, -1 }, /* TexCoord4fVertex4fvSUN */ - { 25588, -1 }, /* ReplacementCodeuiVertex3fSUN */ + { 11208, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fvSUN */ + { 12600, -1 }, /* ReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN */ + { 13011, -1 }, /* TexCoord2fColor3fVertex3fSUN */ + { 14063, -1 }, /* TexCoord4fColor4fNormal3fVertex4fSUN */ + { 14397, -1 }, /* Color4ubVertex2fvSUN */ + { 14637, -1 }, /* Normal3fVertex3fSUN */ + { 15585, -1 }, /* ReplacementCodeuiColor4fNormal3fVertex3fSUN */ + { 15846, -1 }, /* TexCoord2fColor4fNormal3fVertex3fvSUN */ + { 16513, -1 }, /* TexCoord2fVertex3fvSUN */ + { 17289, -1 }, /* Color4ubVertex2fSUN */ + { 17482, -1 }, /* ReplacementCodeuiColor4ubVertex3fSUN */ + { 19335, -1 }, /* TexCoord2fColor4ubVertex3fSUN */ + { 19682, -1 }, /* Normal3fVertex3fvSUN */ + { 20085, -1 }, /* Color4fNormal3fVertex3fSUN */ + { 20951, -1 }, /* ReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN */ + { 21171, -1 }, /* ReplacementCodeuiColor4ubVertex3fvSUN */ + { 22874, -1 }, /* ReplacementCodeuiColor3fVertex3fSUN */ + { 24082, -1 }, /* TexCoord4fVertex4fSUN */ + { 24508, -1 }, /* TexCoord2fColor3fVertex3fvSUN */ + { 24834, -1 }, /* ReplacementCodeuiNormal3fVertex3fvSUN */ + { 24961, -1 }, /* TexCoord4fVertex4fvSUN */ + { 25663, -1 }, /* ReplacementCodeuiVertex3fSUN */ { -1, -1 } }; #endif @@ -5826,29 +5834,29 @@ static const struct gl_function_remap GL_VERSION_1_3_functions[] = { { 9625, _gloffset_MultiTexCoord4sARB }, { 10225, _gloffset_MultiTexCoord2dvARB }, { 10607, _gloffset_MultiTexCoord1svARB }, - { 10864, _gloffset_MultiTexCoord3svARB }, - { 10925, _gloffset_MultiTexCoord4iARB }, - { 11612, _gloffset_MultiTexCoord3iARB }, - { 12346, _gloffset_MultiTexCoord1dARB }, - { 12512, _gloffset_MultiTexCoord3dvARB }, - { 13676, _gloffset_MultiTexCoord3ivARB }, - { 13721, _gloffset_MultiTexCoord2sARB }, - { 14941, _gloffset_MultiTexCoord4ivARB }, - { 16570, _gloffset_ClientActiveTextureARB }, - { 18786, _gloffset_MultiTexCoord2dARB }, - { 19161, _gloffset_MultiTexCoord4dvARB }, - { 19447, _gloffset_MultiTexCoord4fvARB }, - { 20274, _gloffset_MultiTexCoord3fARB }, - { 22584, _gloffset_MultiTexCoord4dARB }, - { 22788, _gloffset_MultiTexCoord1sARB }, - { 22966, _gloffset_MultiTexCoord1dvARB }, - { 23753, _gloffset_MultiTexCoord1ivARB }, - { 23846, _gloffset_MultiTexCoord2ivARB }, - { 24185, _gloffset_MultiTexCoord1iARB }, - { 25456, _gloffset_MultiTexCoord4svARB }, - { 25974, _gloffset_MultiTexCoord1fARB }, - { 26237, _gloffset_MultiTexCoord4fARB }, - { 28505, _gloffset_MultiTexCoord2fvARB }, + { 10903, _gloffset_MultiTexCoord3svARB }, + { 10964, _gloffset_MultiTexCoord4iARB }, + { 11687, _gloffset_MultiTexCoord3iARB }, + { 12389, _gloffset_MultiTexCoord1dARB }, + { 12555, _gloffset_MultiTexCoord3dvARB }, + { 13719, _gloffset_MultiTexCoord3ivARB }, + { 13764, _gloffset_MultiTexCoord2sARB }, + { 14984, _gloffset_MultiTexCoord4ivARB }, + { 16613, _gloffset_ClientActiveTextureARB }, + { 18829, _gloffset_MultiTexCoord2dARB }, + { 19204, _gloffset_MultiTexCoord4dvARB }, + { 19490, _gloffset_MultiTexCoord4fvARB }, + { 20317, _gloffset_MultiTexCoord3fARB }, + { 22627, _gloffset_MultiTexCoord4dARB }, + { 22831, _gloffset_MultiTexCoord1sARB }, + { 23009, _gloffset_MultiTexCoord1dvARB }, + { 23828, _gloffset_MultiTexCoord1ivARB }, + { 23921, _gloffset_MultiTexCoord2ivARB }, + { 24260, _gloffset_MultiTexCoord1iARB }, + { 25531, _gloffset_MultiTexCoord4svARB }, + { 26049, _gloffset_MultiTexCoord1fARB }, + { 26312, _gloffset_MultiTexCoord4fARB }, + { 28541, _gloffset_MultiTexCoord2fvARB }, { -1, -1 } }; #endif diff --git a/src/mesa/sparc/glapi_sparc.S b/src/mesa/sparc/glapi_sparc.S index aaa17e6a3b..731ff2b823 100644 --- a/src/mesa/sparc/glapi_sparc.S +++ b/src/mesa/sparc/glapi_sparc.S @@ -1272,6 +1272,7 @@ gl_dispatch_functions_start: GL_STUB_ALIAS(glGetAttribLocation, glGetAttribLocationARB) GL_STUB_ALIAS(glDrawBuffers, glDrawBuffersARB) GL_STUB_ALIAS(glDrawBuffersATI, glDrawBuffersARB) + GL_STUB_ALIAS(glRenderbufferStorageMultisampleEXT, glRenderbufferStorageMultisample) GL_STUB_ALIAS(glPointParameterf, glPointParameterfEXT) GL_STUB_ALIAS(glPointParameterfARB, glPointParameterfEXT) GL_STUB_ALIAS(glPointParameterfSGIS, glPointParameterfEXT) diff --git a/src/mesa/x86-64/glapi_x86-64.S b/src/mesa/x86-64/glapi_x86-64.S index 72d0532906..134cff7ca4 100644 --- a/src/mesa/x86-64/glapi_x86-64.S +++ b/src/mesa/x86-64/glapi_x86-64.S @@ -30302,6 +30302,7 @@ GL_PREFIX(_dispatch_stub_794): .globl GL_PREFIX(GetAttribLocation) ; .set GL_PREFIX(GetAttribLocation), GL_PREFIX(GetAttribLocationARB) .globl GL_PREFIX(DrawBuffers) ; .set GL_PREFIX(DrawBuffers), GL_PREFIX(DrawBuffersARB) .globl GL_PREFIX(DrawBuffersATI) ; .set GL_PREFIX(DrawBuffersATI), GL_PREFIX(DrawBuffersARB) + .globl GL_PREFIX(RenderbufferStorageMultisampleEXT) ; .set GL_PREFIX(RenderbufferStorageMultisampleEXT), GL_PREFIX(RenderbufferStorageMultisample) .globl GL_PREFIX(PointParameterf) ; .set GL_PREFIX(PointParameterf), GL_PREFIX(PointParameterfEXT) .globl GL_PREFIX(PointParameterfARB) ; .set GL_PREFIX(PointParameterfARB), GL_PREFIX(PointParameterfEXT) .globl GL_PREFIX(PointParameterfv) ; .set GL_PREFIX(PointParameterfv), GL_PREFIX(PointParameterfvEXT) diff --git a/src/mesa/x86/glapi_x86.S b/src/mesa/x86/glapi_x86.S index 12c77f434e..0da924c37f 100644 --- a/src/mesa/x86/glapi_x86.S +++ b/src/mesa/x86/glapi_x86.S @@ -1226,6 +1226,7 @@ GLNAME(gl_dispatch_functions_start): GL_STUB_ALIAS(GetAttribLocation, _gloffset_GetAttribLocationARB, GetAttribLocation@8, GetAttribLocationARB, GetAttribLocationARB@8) GL_STUB_ALIAS(DrawBuffers, _gloffset_DrawBuffersARB, DrawBuffers@8, DrawBuffersARB, DrawBuffersARB@8) GL_STUB_ALIAS(DrawBuffersATI, _gloffset_DrawBuffersARB, DrawBuffersATI@8, DrawBuffersARB, DrawBuffersARB@8) + GL_STUB_ALIAS(RenderbufferStorageMultisampleEXT, _gloffset_RenderbufferStorageMultisample, RenderbufferStorageMultisampleEXT@20, RenderbufferStorageMultisample, RenderbufferStorageMultisample@20) GL_STUB_ALIAS(PointParameterf, _gloffset_PointParameterfEXT, PointParameterf@8, PointParameterfEXT, PointParameterfEXT@8) GL_STUB_ALIAS(PointParameterfARB, _gloffset_PointParameterfEXT, PointParameterfARB@8, PointParameterfEXT, PointParameterfEXT@8) GL_STUB_ALIAS(PointParameterfSGIS, _gloffset_PointParameterfEXT, PointParameterfSGIS@8, PointParameterfEXT, PointParameterfEXT@8) -- cgit v1.2.3 From 4d6ec214396461c0cf3ad8ede449b299ff06c1aa Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 11 Nov 2009 15:33:23 -0800 Subject: ARB_fbo: Enable GL_EXT_framebuffer_multisample All of this functionality is already included in ARB_fbo. This just enables the string. I was a bit lazy in using FEATURE_ARB_framebuffer_object for this feature as well. I don't think it makes much difference in the long run. --- src/mesa/main/extensions.c | 6 +++++- src/mesa/main/mtypes.h | 3 ++- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c index 96f3511273..2138bfe40e 100644 --- a/src/mesa/main/extensions.c +++ b/src/mesa/main/extensions.c @@ -104,8 +104,9 @@ static const struct { { ON, "GL_EXT_copy_texture", F(EXT_copy_texture) }, { OFF, "GL_EXT_depth_bounds_test", F(EXT_depth_bounds_test) }, { ON, "GL_EXT_draw_range_elements", F(EXT_draw_range_elements) }, - { OFF, "GL_EXT_framebuffer_object", F(EXT_framebuffer_object) }, { OFF, "GL_EXT_framebuffer_blit", F(EXT_framebuffer_blit) }, + { OFF, "GL_EXT_framebuffer_multisample", F(EXT_framebuffer_multisample) }, + { OFF, "GL_EXT_framebuffer_object", F(EXT_framebuffer_object) }, { OFF, "GL_EXT_fog_coord", F(EXT_fog_coord) }, { OFF, "GL_EXT_gpu_program_parameters", F(EXT_gpu_program_parameters) }, { OFF, "GL_EXT_histogram", F(EXT_histogram) }, @@ -274,6 +275,9 @@ _mesa_enable_sw_extensions(GLcontext *ctx) #endif #if FEATURE_EXT_framebuffer_blit ctx->Extensions.EXT_framebuffer_blit = GL_TRUE; +#endif +#if FEATURE_ARB_framebuffer_object + ctx->Extensions.EXT_framebuffer_multisample = GL_TRUE; #endif ctx->Extensions.EXT_histogram = GL_TRUE; /*ctx->Extensions.EXT_multi_draw_arrays = GL_TRUE;*/ diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 94d29a7dbb..34c51b5442 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2412,9 +2412,10 @@ struct gl_extensions GLboolean EXT_copy_texture; GLboolean EXT_depth_bounds_test; GLboolean EXT_draw_range_elements; - GLboolean EXT_framebuffer_object; GLboolean EXT_fog_coord; GLboolean EXT_framebuffer_blit; + GLboolean EXT_framebuffer_multisample; + GLboolean EXT_framebuffer_object; GLboolean EXT_gpu_program_parameters; GLboolean EXT_histogram; GLboolean EXT_multi_draw_arrays; -- cgit v1.2.3 From 5fbfd883386a8ff78bd6ca10ab761aff1b38e46d Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 12 Nov 2009 11:59:35 -0800 Subject: Add missing XML files to API_XML When the files missing from the list were modified, the generated files weren't regenerated. --- src/mesa/glapi/Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/glapi/Makefile b/src/mesa/glapi/Makefile index fb6be1a3a9..71bef68ea5 100644 --- a/src/mesa/glapi/Makefile +++ b/src/mesa/glapi/Makefile @@ -47,16 +47,19 @@ SERVER_OUTPUTS = \ $(SERVER_GLAPI_FILES) API_XML = gl_API.xml \ - EXT_framebuffer_object.xml \ ARB_copy_buffer.xml \ ARB_depth_clamp.xml \ + ARB_draw_elements_base_vertex.xml \ ARB_framebuffer_object.xml \ ARB_map_buffer_range.xml \ ARB_seamless_cube_map.xml \ ARB_sync.xml \ ARB_vertex_array_object.xml \ APPLE_vertex_array_object.xml \ - EXT_provoking_vertex.xml + EXT_framebuffer_object.xml \ + EXT_packed_depth_stencil.xml \ + EXT_provoking_vertex.xml \ + EXT_texture_array.xml COMMON = gl_XML.py glX_XML.py license.py $(API_XML) typeexpr.py COMMON_GLX = $(COMMON) glX_API.xml glX_XML.py glX_proto_common.py -- cgit v1.2.3 From 4e7476f601e15cf4c52d7de44f0f775aaaedd094 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 12 Nov 2009 13:22:12 -0800 Subject: ARB_fbo: Add missing GLX render opcode for glFramebufferTextureLayerEXT Also regenerate the GLX protocol files from this change. --- src/mesa/glapi/EXT_texture_array.xml | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/glapi/EXT_texture_array.xml b/src/mesa/glapi/EXT_texture_array.xml index e5bd9f3c69..b5b8bd406f 100644 --- a/src/mesa/glapi/EXT_texture_array.xml +++ b/src/mesa/glapi/EXT_texture_array.xml @@ -35,6 +35,7 @@ + -- cgit v1.2.3 From 5606dfb572bf4b89b4882265924705bacc8c182b Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 17 Nov 2009 16:10:24 -0800 Subject: Merge branch 'outputswritten64' Add a GLbitfield64 type and several macros to operate on 64-bit fields. The OutputsWritten field of gl_program is changed to use that type. This results in a fair amount of fallout in drivers that use programs. No changes are strictly necessary at this point as all bits used are below the 32-bit boundary. Fairly soon several bits will be added for clip distances written by a vertex shader. This will cause several bits used for varyings to be pushed above the 32-bit boundary. This will affect any drivers that support GLSL. At this point, only the i965 driver has been modified to support this eventuality. I did this as a "squash" merge. There were several places through the outputswritten64 branch where things were broken. I foresee this causing difficulties later for bisecting. The history is still available in the branch. Conflicts: src/mesa/drivers/dri/i965/brw_wm.h --- src/mesa/drivers/dri/i965/brw_clip.c | 2 +- src/mesa/drivers/dri/i965/brw_clip.h | 2 +- src/mesa/drivers/dri/i965/brw_context.h | 6 +----- src/mesa/drivers/dri/i965/brw_gs.h | 2 +- src/mesa/drivers/dri/i965/brw_sf.c | 6 +++--- src/mesa/drivers/dri/i965/brw_sf.h | 2 +- src/mesa/drivers/dri/i965/brw_sf_emit.c | 18 +++++++++--------- src/mesa/drivers/dri/i965/brw_util.c | 2 +- src/mesa/drivers/dri/i965/brw_util.h | 2 +- src/mesa/drivers/dri/i965/brw_vs.c | 2 +- src/mesa/drivers/dri/i965/brw_vs_emit.c | 8 ++++---- src/mesa/drivers/dri/i965/brw_wm.c | 4 ++-- src/mesa/drivers/dri/i965/brw_wm.h | 2 +- src/mesa/drivers/dri/i965/brw_wm_fp.c | 2 +- src/mesa/drivers/dri/i965/brw_wm_glsl.c | 2 +- src/mesa/drivers/dri/i965/brw_wm_pass2.c | 4 ++-- src/mesa/drivers/dri/i965/brw_wm_state.c | 2 +- src/mesa/drivers/dri/r200/r200_tcl.c | 15 ++++++++------- src/mesa/main/config.h | 2 +- src/mesa/main/context.c | 8 +++++--- src/mesa/main/ffvertex_prog.c | 2 +- src/mesa/main/mtypes.h | 27 ++++++++++++++++++++++++++- src/mesa/main/texenvprogram.c | 2 +- src/mesa/shader/prog_print.c | 6 +++--- src/mesa/shader/program_parse.tab.c | 2 +- src/mesa/shader/program_parse.y | 2 +- src/mesa/shader/programopt.c | 8 ++++---- src/mesa/shader/slang/slang_link.c | 25 +++++++++++++++---------- src/mesa/state_tracker/st_atom_shader.c | 2 +- src/mesa/state_tracker/st_program.c | 2 +- src/mesa/swrast/s_fragprog.c | 12 ++++++------ src/mesa/tnl/t_context.c | 2 +- src/mesa/tnl/t_vb_program.c | 8 ++++---- 33 files changed, 111 insertions(+), 82 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_clip.c b/src/mesa/drivers/dri/i965/brw_clip.c index f45dcf8282..dbd10a5297 100644 --- a/src/mesa/drivers/dri/i965/brw_clip.c +++ b/src/mesa/drivers/dri/i965/brw_clip.c @@ -78,7 +78,7 @@ static void compile_clip_prog( struct brw_context *brw, delta = REG_SIZE; for (i = 0; i < VERT_RESULT_MAX; i++) - if (c.key.attrs & (1<= VERT_RESULT_TEX0 && i <= VERT_RESULT_TEX7) { @@ -147,7 +147,7 @@ static void upload_sf_prog(struct brw_context *brw) * edgeflag testing here, it is already done in the clip * program. */ - if (key.attrs & (1<key.attrs & (1<key.attrs & BITFIELD64_BIT(attr)) ? 1 : 0; } /*********************************************************************** @@ -122,8 +122,8 @@ static void do_twoside_color( struct brw_sf_compile *c ) * Flat shading */ -#define VERT_RESULT_COLOR_BITS ((1<nr_setup_regs - 1); - GLuint persp_mask; - GLuint linear_mask; + GLbitfield64 persp_mask; + GLbitfield64 linear_mask; if (c->key.do_flat_shading || c->key.linear_color) persp_mask = c->key.attrs & ~(FRAG_BIT_WPOS | @@ -331,10 +331,10 @@ static GLboolean calculate_masks( struct brw_sf_compile *c, *pc_linear = 0; *pc = 0xf; - if (persp_mask & (1 << c->idx_to_attr[reg*2])) + if (persp_mask & BITFIELD64_BIT(c->idx_to_attr[reg*2])) *pc_persp = 0xf; - if (linear_mask & (1 << c->idx_to_attr[reg*2])) + if (linear_mask & BITFIELD64_BIT(c->idx_to_attr[reg*2])) *pc_linear = 0xf; /* Maybe only processs one attribute on the final round: @@ -342,10 +342,10 @@ static GLboolean calculate_masks( struct brw_sf_compile *c, if (reg*2+1 < c->nr_setup_attrs) { *pc |= 0xf0; - if (persp_mask & (1 << c->idx_to_attr[reg*2+1])) + if (persp_mask & BITFIELD64_BIT(c->idx_to_attr[reg*2+1])) *pc_persp |= 0xf0; - if (linear_mask & (1 << c->idx_to_attr[reg*2+1])) + if (linear_mask & BITFIELD64_BIT(c->idx_to_attr[reg*2+1])) *pc_linear |= 0xf0; } diff --git a/src/mesa/drivers/dri/i965/brw_util.c b/src/mesa/drivers/dri/i965/brw_util.c index ce21aa4869..bba9249d1b 100644 --- a/src/mesa/drivers/dri/i965/brw_util.c +++ b/src/mesa/drivers/dri/i965/brw_util.c @@ -35,7 +35,7 @@ #include "brw_util.h" #include "brw_defines.h" -GLuint brw_count_bits( GLuint val ) +GLuint brw_count_bits(uint64_t val) { GLuint i; for (i = 0; val ; val >>= 1) diff --git a/src/mesa/drivers/dri/i965/brw_util.h b/src/mesa/drivers/dri/i965/brw_util.h index 33e7cd87e4..04f3175d3e 100644 --- a/src/mesa/drivers/dri/i965/brw_util.h +++ b/src/mesa/drivers/dri/i965/brw_util.h @@ -35,7 +35,7 @@ #include "main/mtypes.h" -extern GLuint brw_count_bits( GLuint val ); +extern GLuint brw_count_bits(uint64_t val); extern GLuint brw_parameter_list_state_flags(struct gl_program_parameter_list *paramList); extern GLuint brw_translate_blend_factor( GLenum factor ); extern GLuint brw_translate_blend_equation( GLenum mode ); diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c index f0c79efbd9..fd055e225e 100644 --- a/src/mesa/drivers/dri/i965/brw_vs.c +++ b/src/mesa/drivers/dri/i965/brw_vs.c @@ -56,7 +56,7 @@ static void do_vs_prog( struct brw_context *brw, c.prog_data.inputs_read = vp->program.Base.InputsRead; if (c.key.copy_edgeflag) { - c.prog_data.outputs_written |= 1<prog_data.outputs_written & (1 << i)) { + if (c->prog_data.outputs_written & BITFIELD64_BIT(i)) { c->nr_outputs++; assert(i < Elements(c->regs[PROGRAM_OUTPUT])); if (i == VERT_RESULT_HPOS) { @@ -1124,7 +1124,7 @@ static void emit_vertex_write( struct brw_vs_compile *c) /* Update the header for point size, user clipping flags, and -ve rhw * workaround. */ - if ((c->prog_data.outputs_written & (1<prog_data.outputs_written & BITFIELD64_BIT(VERT_RESULT_PSIZ)) || c->key.nr_userclip || BRW_IS_965(p->brw)) { struct brw_reg header1 = retype(get_tmp(c), BRW_REGISTER_TYPE_UD); @@ -1134,7 +1134,7 @@ static void emit_vertex_write( struct brw_vs_compile *c) brw_set_access_mode(p, BRW_ALIGN_16); - if (c->prog_data.outputs_written & (1<prog_data.outputs_written & BITFIELD64_BIT(VERT_RESULT_PSIZ)) { struct brw_reg psiz = c->regs[PROGRAM_OUTPUT][VERT_RESULT_PSIZ]; brw_MUL(p, brw_writemask(header1, WRITEMASK_W), brw_swizzle1(psiz, 0), brw_imm_f(1<<11)); brw_AND(p, brw_writemask(header1, WRITEMASK_W), header1, brw_imm_ud(0x7ff<<8)); @@ -1224,7 +1224,7 @@ static void emit_vertex_write( struct brw_vs_compile *c) */ GLuint i, mrf = 0; for (i = c->first_overflow_output; i < VERT_RESULT_MAX; i++) { - if (c->prog_data.outputs_written & (1 << i)) { + if (c->prog_data.outputs_written & BITFIELD64_BIT(i)) { /* move from GRF to MRF */ brw_MOV(p, brw_message_reg(4+mrf), c->regs[PROGRAM_OUTPUT][i]); mrf++; diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index d8971321f3..77e3b2c32a 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -231,7 +231,7 @@ static void brw_wm_populate_key( struct brw_context *brw, ctx->Color.AlphaEnabled) lookup |= IZ_PS_KILL_ALPHATEST_BIT; - if (fp->program.Base.OutputsWritten & (1<program.Base.OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH)) lookup |= IZ_PS_COMPUTES_DEPTH_BIT; /* _NEW_DEPTH */ @@ -347,7 +347,7 @@ static void brw_wm_populate_key( struct brw_context *brw, key->nr_color_regions = brw->state.nr_color_regions; /* CACHE_NEW_VS_PROG */ - key->vp_outputs_written = brw->vs.prog_data->outputs_written & DO_SETUP_BITS; + key->vp_outputs_written = brw->vs.prog_data->outputs_written; /* The unique fragment program ID */ key->program_string_id = fp->id; diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index b3c05eb0ad..9dcb6e14bb 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -79,7 +79,7 @@ struct brw_wm_prog_key { GLuint program_string_id:32; GLushort origin_x, origin_y; GLushort drawable_height; - GLuint vp_outputs_written; + GLbitfield64 vp_outputs_written; }; diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c index 1c4f62ba48..7d03179588 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_fp.c +++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c @@ -986,7 +986,7 @@ static void emit_render_target_writes( struct brw_wm_compile *c ) } else { /* if gl_FragData[0] is written, use it, else use gl_FragColor */ - if (c->fp->program.Base.OutputsWritten & (1 << FRAG_RESULT_DATA0)) + if (c->fp->program.Base.OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_DATA0)) outcolor = src_reg(PROGRAM_OUTPUT, FRAG_RESULT_DATA0); else outcolor = src_reg(PROGRAM_OUTPUT, FRAG_RESULT_COLOR); diff --git a/src/mesa/drivers/dri/i965/brw_wm_glsl.c b/src/mesa/drivers/dri/i965/brw_wm_glsl.c index 3ab446164c..e8c2cb66ec 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_glsl.c +++ b/src/mesa/drivers/dri/i965/brw_wm_glsl.c @@ -371,7 +371,7 @@ static void prealloc_reg(struct brw_wm_compile *c) for (j = 0; j < 4; j++) set_reg(c, PROGRAM_PAYLOAD, fp_input, j, reg); } - if (c->key.vp_outputs_written & (1 << i)) { + if (c->key.vp_outputs_written & BITFIELD64_BIT(i)) { reg_index += 2; } } diff --git a/src/mesa/drivers/dri/i965/brw_wm_pass2.c b/src/mesa/drivers/dri/i965/brw_wm_pass2.c index 6faea018fb..31303febf0 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_pass2.c +++ b/src/mesa/drivers/dri/i965/brw_wm_pass2.c @@ -82,8 +82,8 @@ static void init_registers( struct brw_wm_compile *c ) for (j = 0; j < c->nr_creg; j++) prealloc_reg(c, &c->creg[j], i++); - for (j = 0; j < FRAG_ATTRIB_MAX; j++) { - if (c->key.vp_outputs_written & (1<key.vp_outputs_written & BITFIELD64_BIT(j)) { int fp_index; if (j >= VERT_RESULT_VAR0) diff --git a/src/mesa/drivers/dri/i965/brw_wm_state.c b/src/mesa/drivers/dri/i965/brw_wm_state.c index 361f91292b..f89ed9bce7 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_state.c @@ -106,7 +106,7 @@ wm_unit_populate_key(struct brw_context *brw, struct brw_wm_unit_key *key) /* as far as we can tell */ key->computes_depth = - (fp->Base.OutputsWritten & (1 << FRAG_RESULT_DEPTH)) != 0; + (fp->Base.OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH)) != 0; /* BRW_NEW_DEPTH_BUFFER * Override for NULL depthbuffer case, required by the Pixel Shader Computed * Depth field. diff --git a/src/mesa/drivers/dri/r200/r200_tcl.c b/src/mesa/drivers/dri/r200/r200_tcl.c index c702910ef2..e7d48a7f29 100644 --- a/src/mesa/drivers/dri/r200/r200_tcl.c +++ b/src/mesa/drivers/dri/r200/r200_tcl.c @@ -509,25 +509,26 @@ static GLboolean r200_run_tcl_render( GLcontext *ctx, prog to a not enabled output however, so just don't mess with it. We only need to change compsel. */ GLuint out_compsel = 0; - GLuint vp_out = rmesa->curr_vp_hw->mesa_program.Base.OutputsWritten; + const GLbitfield64 vp_out = + rmesa->curr_vp_hw->mesa_program.Base.OutputsWritten; vimap_rev = &rmesa->curr_vp_hw->inputmap_rev[0]; - assert(vp_out & (1 << VERT_RESULT_HPOS)); + assert(vp_out & BITFIELD64_BIT(VERT_RESULT_HPOS)); out_compsel = R200_OUTPUT_XYZW; - if (vp_out & (1 << VERT_RESULT_COL0)) { + if (vp_out & BITFIELD64_BIT(VERT_RESULT_COL0)) { out_compsel |= R200_OUTPUT_COLOR_0; } - if (vp_out & (1 << VERT_RESULT_COL1)) { + if (vp_out & BITFIELD64_BIT(VERT_RESULT_COL1)) { out_compsel |= R200_OUTPUT_COLOR_1; } - if (vp_out & (1 << VERT_RESULT_FOGC)) { + if (vp_out & BITFIELD64_BIT(VERT_RESULT_FOGC)) { out_compsel |= R200_OUTPUT_DISCRETE_FOG; } - if (vp_out & (1 << VERT_RESULT_PSIZ)) { + if (vp_out & BITFIELD64_BIT(VERT_RESULT_PSIZ)) { out_compsel |= R200_OUTPUT_PT_SIZE; } for (i = VERT_RESULT_TEX0; i < VERT_RESULT_TEX6; i++) { - if (vp_out & (1 << i)) { + if (vp_out & BITFIELD64_BIT(i)) { out_compsel |= R200_OUTPUT_TEX_0 << (i - VERT_RESULT_TEX0); } } diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h index 8a09efdb53..c5048970cc 100644 --- a/src/mesa/main/config.h +++ b/src/mesa/main/config.h @@ -205,7 +205,7 @@ #define MAX_VARYING 16 /**< number of float[4] vectors */ #define MAX_SAMPLERS MAX_TEXTURE_IMAGE_UNITS #define MAX_PROGRAM_INPUTS 32 -#define MAX_PROGRAM_OUTPUTS 32 +#define MAX_PROGRAM_OUTPUTS 64 /*@}*/ /** For GL_ARB_vertex_program */ diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 101d3c6b67..b5bf46718f 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -601,9 +601,11 @@ _mesa_init_constants(GLcontext *ctx) ASSERT(MAX_NV_VERTEX_PROGRAM_INPUTS <= VERT_ATTRIB_MAX); ASSERT(MAX_NV_VERTEX_PROGRAM_OUTPUTS <= VERT_RESULT_MAX); - /* check that we don't exceed various 32-bit bitfields */ - ASSERT(VERT_RESULT_MAX <= 32); - ASSERT(FRAG_ATTRIB_MAX <= 32); + /* check that we don't exceed the size of various bitfields */ + ASSERT(VERT_RESULT_MAX <= + (8 * sizeof(ctx->VertexProgram._Current->Base.OutputsWritten))); + ASSERT(FRAG_ATTRIB_MAX <= + (8 * sizeof(ctx->FragmentProgram._Current->Base.InputsRead))); } diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c index 356476e35a..fe2416d894 100644 --- a/src/mesa/main/ffvertex_prog.c +++ b/src/mesa/main/ffvertex_prog.c @@ -438,7 +438,7 @@ static struct ureg register_input( struct tnl_program *p, GLuint input ) */ static struct ureg register_output( struct tnl_program *p, GLuint output ) { - p->program->Base.OutputsWritten |= (1<program->Base.OutputsWritten |= BITFIELD64_BIT(output); return make_ureg(PROGRAM_OUTPUT, output); } diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 34c51b5442..881d233ca3 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -78,6 +78,31 @@ #endif +/** + * \name 64-bit extension of GLbitfield. + */ +/*@{*/ +typedef GLuint64 GLbitfield64; + +#define BITFIELD64_ONE 1ULL +#define BITFIELD64_ALLONES ~0ULL + +/** Set a single bit */ +#define BITFIELD64_BIT(b) (BITFIELD64_ONE << (b)) + +/** Set a mask of the least significant \c b bits */ +#define BITFIELD64_MASK(b) (((b) >= 64) ? BITFIELD64_ALLONES : \ + (BITFIELD64_BIT(b) - 1)) + +/** + * Set all bits from l (low bit) to h (high bit), inclusive. + * + * \note \C BITFIELD_64_RANGE(0, 63) return 64 set bits. + */ +#define BITFIELD64_RANGE(l, h) (BITFIELD64_MASK((h) + 1) & ~BITFIELD64_MASK(l)) +/*@}*/ + + /** * \name Some forward type declarations */ @@ -1670,7 +1695,7 @@ struct gl_program struct prog_instruction *Instructions; GLbitfield InputsRead; /**< Bitmask of which input regs are read */ - GLbitfield OutputsWritten; /**< Bitmask of which output regs are written to */ + GLbitfield64 OutputsWritten; /**< Bitmask of which output regs are written */ GLbitfield InputFlags[MAX_PROGRAM_INPUTS]; /**< PROG_PARAM_BIT_x flags */ GLbitfield OutputFlags[MAX_PROGRAM_OUTPUTS]; /**< PROG_PARAM_BIT_x flags */ GLbitfield TexturesUsed[MAX_TEXTURE_UNITS]; /**< TEXTURE_x_BIT bitmask */ diff --git a/src/mesa/main/texenvprogram.c b/src/mesa/main/texenvprogram.c index d7e77e759e..f439d4addb 100644 --- a/src/mesa/main/texenvprogram.c +++ b/src/mesa/main/texenvprogram.c @@ -367,7 +367,7 @@ static GLbitfield get_fp_input_mask( GLcontext *ctx ) else { /* calculate from vp->outputs */ struct gl_vertex_program *vprog; - GLbitfield vp_outputs; + GLbitfield64 vp_outputs; /* Choose GLSL vertex shader over ARB vertex program. Need this * since vertex shader state validation comes after fragment state diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c index ba4d39452f..52c102cbaa 100644 --- a/src/mesa/shader/prog_print.c +++ b/src/mesa/shader/prog_print.c @@ -826,11 +826,11 @@ _mesa_print_program(const struct gl_program *prog) * XXX move to imports.[ch] if useful elsewhere. */ static const char * -binary(GLbitfield val) +binary(GLbitfield64 val) { - static char buf[50]; + static char buf[80]; GLint i, len = 0; - for (i = 31; i >= 0; --i) { + for (i = 63; i >= 0; --i) { if (val & (1 << i)) buf[len++] = '1'; else if (len > 0 || i == 0) diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index b9ef88b64b..d4f8429488 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -2622,7 +2622,7 @@ yyreduce: YYERROR; } - state->prog->OutputsWritten |= (1U << (yyval.dst_reg).Index); + state->prog->OutputsWritten |= BITFIELD64_BIT((yyval.dst_reg).Index); } ;} break; diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index d07bf85b36..8ca6f9805b 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -643,7 +643,7 @@ maskedDstReg: dstReg optionalMask optionalCcMask YYERROR; } - state->prog->OutputsWritten |= (1U << $$.Index); + state->prog->OutputsWritten |= BITFIELD64_BIT($$.Index); } } ; diff --git a/src/mesa/shader/programopt.c b/src/mesa/shader/programopt.c index 3b8529592d..a0daac1b80 100644 --- a/src/mesa/shader/programopt.c +++ b/src/mesa/shader/programopt.c @@ -109,7 +109,7 @@ _mesa_insert_mvp_dp4_code(GLcontext *ctx, struct gl_vertex_program *vprog) vprog->Base.Instructions = newInst; vprog->Base.NumInstructions = newLen; vprog->Base.InputsRead |= VERT_BIT_POS; - vprog->Base.OutputsWritten |= (1 << VERT_RESULT_HPOS); + vprog->Base.OutputsWritten |= BITFIELD64_BIT(VERT_RESULT_HPOS); } @@ -211,7 +211,7 @@ _mesa_insert_mvp_mad_code(GLcontext *ctx, struct gl_vertex_program *vprog) vprog->Base.Instructions = newInst; vprog->Base.NumInstructions = newLen; vprog->Base.InputsRead |= VERT_BIT_POS; - vprog->Base.OutputsWritten |= (1 << VERT_RESULT_HPOS); + vprog->Base.OutputsWritten |= BITFIELD64_BIT(VERT_RESULT_HPOS); } @@ -613,7 +613,7 @@ _mesa_nop_fragment_program(GLcontext *ctx, struct gl_fragment_program *prog) prog->Base.Instructions = inst; prog->Base.NumInstructions = 2; prog->Base.InputsRead = 1 << inputAttr; - prog->Base.OutputsWritten = 1 << FRAG_RESULT_COLOR; + prog->Base.OutputsWritten = BITFIELD64_BIT(FRAG_RESULT_COLOR); } @@ -657,7 +657,7 @@ _mesa_nop_vertex_program(GLcontext *ctx, struct gl_vertex_program *prog) prog->Base.Instructions = inst; prog->Base.NumInstructions = 2; prog->Base.InputsRead = 1 << inputAttr; - prog->Base.OutputsWritten = 1 << VERT_RESULT_COL0; + prog->Base.OutputsWritten = BITFIELD64_BIT(VERT_RESULT_COL0); /* * Now insert code to do standard modelview/projection transformation. diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index 144c126525..0a2bc49780 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -515,7 +515,7 @@ _slang_update_inputs_outputs(struct gl_program *prog) } if (inst->DstReg.File == PROGRAM_OUTPUT) { - prog->OutputsWritten |= 1 << inst->DstReg.Index; + prog->OutputsWritten |= BITFIELD64_BIT(inst->DstReg.Index); if (inst->DstReg.RelAddr) { /* If the output attribute is indexed with relative addressing * we know that it must be a varying or texcoord such as @@ -528,14 +528,17 @@ _slang_update_inputs_outputs(struct gl_program *prog) if (prog->Target == GL_VERTEX_PROGRAM_ARB) { if (inst->DstReg.Index == VERT_RESULT_TEX0) { /* mark all texcoord outputs as written */ - const GLbitfield mask = - ((1 << MAX_TEXTURE_COORD_UNITS) - 1) << VERT_RESULT_TEX0; + const GLbitfield64 mask = + BITFIELD64_RANGE(VERT_RESULT_TEX0, + (VERT_RESULT_TEX0 + + MAX_TEXTURE_COORD_UNITS - 1)); prog->OutputsWritten |= mask; } else if (inst->DstReg.Index == VERT_RESULT_VAR0) { /* mark all generic varying outputs as written */ - const GLbitfield mask = - ((1 << MAX_VARYING) - 1) << VERT_RESULT_VAR0; + const GLbitfield64 mask = + BITFIELD64_RANGE(VERT_RESULT_VAR0, + (VERT_RESULT_VAR0 + MAX_VARYING - 1)); prog->OutputsWritten |= mask; } } @@ -807,7 +810,8 @@ _slang_link(GLcontext *ctx, if (shProg->VertexProgram) { _slang_update_inputs_outputs(&shProg->VertexProgram->Base); _slang_count_temporaries(&shProg->VertexProgram->Base); - if (!(shProg->VertexProgram->Base.OutputsWritten & (1 << VERT_RESULT_HPOS))) { + if (!(shProg->VertexProgram->Base.OutputsWritten + & BITFIELD64_BIT(VERT_RESULT_HPOS))) { /* the vertex program did not compute a vertex position */ link_error(shProg, "gl_Position was not written by vertex shader\n"); @@ -825,7 +829,7 @@ _slang_link(GLcontext *ctx, if (shProg->FragmentProgram) { const GLbitfield varyingRead = shProg->FragmentProgram->Base.InputsRead >> FRAG_ATTRIB_VAR0; - const GLbitfield varyingWritten = shProg->VertexProgram ? + const GLbitfield64 varyingWritten = shProg->VertexProgram ? shProg->VertexProgram->Base.OutputsWritten >> VERT_RESULT_VAR0 : 0x0; if ((varyingRead & varyingWritten) != varyingRead) { link_error(shProg, @@ -836,9 +840,10 @@ _slang_link(GLcontext *ctx, /* check that gl_FragColor and gl_FragData are not both written to */ if (shProg->FragmentProgram) { - GLbitfield outputsWritten = shProg->FragmentProgram->Base.OutputsWritten; - if ((outputsWritten & ((1 << FRAG_RESULT_COLOR))) && - (outputsWritten >= (1 << FRAG_RESULT_DATA0))) { + const GLbitfield64 outputsWritten = + shProg->FragmentProgram->Base.OutputsWritten; + if ((outputsWritten & BITFIELD64_BIT(FRAG_RESULT_COLOR)) && + (outputsWritten >= BITFIELD64_BIT(FRAG_RESULT_DATA0))) { link_error(shProg, "Fragment program cannot write both gl_FragColor" " and gl_FragData[].\n"); return; diff --git a/src/mesa/state_tracker/st_atom_shader.c b/src/mesa/state_tracker/st_atom_shader.c index ee649be885..6e311e537e 100644 --- a/src/mesa/state_tracker/st_atom_shader.c +++ b/src/mesa/state_tracker/st_atom_shader.c @@ -176,7 +176,7 @@ find_translated_vp(struct st_context *st, /* See if we need to translate vertex program to TGSI form */ if (xvp->serialNo != stvp->serialNo) { GLuint outAttr; - const GLbitfield outputsWritten = stvp->Base.Base.OutputsWritten; + const GLbitfield64 outputsWritten = stvp->Base.Base.OutputsWritten; GLuint numVpOuts = 0; GLboolean emitPntSize = GL_FALSE, emitBFC0 = GL_FALSE, emitBFC1 = GL_FALSE; GLbitfield usedGenerics = 0x0; diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 6d02722c13..190b6a5526 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -469,7 +469,7 @@ st_translate_fragment_program(struct st_context *st, */ { uint numColors = 0; - GLbitfield outputsWritten = stfp->Base.Base.OutputsWritten; + GLbitfield64 outputsWritten = stfp->Base.Base.OutputsWritten; /* if z is written, emit that first */ if (outputsWritten & (1 << FRAG_RESULT_DEPTH)) { diff --git a/src/mesa/swrast/s_fragprog.c b/src/mesa/swrast/s_fragprog.c index 77a77f0bcb..a22d34415d 100644 --- a/src/mesa/swrast/s_fragprog.c +++ b/src/mesa/swrast/s_fragprog.c @@ -190,7 +190,7 @@ run_program(GLcontext *ctx, SWspan *span, GLuint start, GLuint end) { SWcontext *swrast = SWRAST_CONTEXT(ctx); const struct gl_fragment_program *program = ctx->FragmentProgram._Current; - const GLbitfield outputsWritten = program->Base.OutputsWritten; + const GLbitfield64 outputsWritten = program->Base.OutputsWritten; struct gl_program_machine *machine = &swrast->FragProgMachine; GLuint i; @@ -201,7 +201,7 @@ run_program(GLcontext *ctx, SWspan *span, GLuint start, GLuint end) if (_mesa_execute_program(ctx, &program->Base, machine)) { /* Store result color */ - if (outputsWritten & (1 << FRAG_RESULT_COLOR)) { + if (outputsWritten & BITFIELD64_BIT(FRAG_RESULT_COLOR)) { COPY_4V(span->array->attribs[FRAG_ATTRIB_COL0][i], machine->Outputs[FRAG_RESULT_COLOR]); } @@ -212,7 +212,7 @@ run_program(GLcontext *ctx, SWspan *span, GLuint start, GLuint end) */ GLuint buf; for (buf = 0; buf < ctx->DrawBuffer->_NumColorDrawBuffers; buf++) { - if (outputsWritten & (1 << (FRAG_RESULT_DATA0 + buf))) { + if (outputsWritten & BITFIELD64_BIT(FRAG_RESULT_DATA0 + buf)) { COPY_4V(span->array->attribs[FRAG_ATTRIB_COL0 + buf][i], machine->Outputs[FRAG_RESULT_DATA0 + buf]); } @@ -220,7 +220,7 @@ run_program(GLcontext *ctx, SWspan *span, GLuint start, GLuint end) } /* Store result depth/z */ - if (outputsWritten & (1 << FRAG_RESULT_DEPTH)) { + if (outputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH)) { const GLfloat depth = machine->Outputs[FRAG_RESULT_DEPTH][2]; if (depth <= 0.0) span->array->z[i] = 0; @@ -256,12 +256,12 @@ _swrast_exec_fragment_program( GLcontext *ctx, SWspan *span ) run_program(ctx, span, 0, span->end); - if (program->Base.OutputsWritten & (1 << FRAG_RESULT_COLOR)) { + if (program->Base.OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_COLOR)) { span->interpMask &= ~SPAN_RGBA; span->arrayMask |= SPAN_RGBA; } - if (program->Base.OutputsWritten & (1 << FRAG_RESULT_DEPTH)) { + if (program->Base.OutputsWritten & BITFIELD64_BIT(FRAG_RESULT_DEPTH)) { span->interpMask &= ~SPAN_Z; span->arrayMask |= SPAN_Z; } diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c index f2771cde09..db21b4589d 100644 --- a/src/mesa/tnl/t_context.c +++ b/src/mesa/tnl/t_context.c @@ -171,7 +171,7 @@ _tnl_InvalidateState( GLcontext *ctx, GLuint new_state ) if (vp) { GLuint i; for (i = 0; i < MAX_VARYING; i++) { - if (vp->Base.OutputsWritten & (1 << (VERT_RESULT_VAR0 + i))) { + if (vp->Base.OutputsWritten & BITFIELD64_BIT(VERT_RESULT_VAR0 + i)) { RENDERINPUTS_SET(tnl->render_inputs_bitset, _TNL_ATTRIB_GENERIC(i)); } diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index c10a27614f..e69f7d5766 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -329,7 +329,7 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage ) /* make list of outputs to save some time below */ numOutputs = 0; for (i = 0; i < VERT_RESULT_MAX; i++) { - if (program->Base.OutputsWritten & (1 << i)) { + if (program->Base.OutputsWritten & BITFIELD64_BIT(i)) { outputs[numOutputs++] = i; } } @@ -407,14 +407,14 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage ) /* Fixup fog and point size results if needed */ if (program->IsNVProgram) { if (ctx->Fog.Enabled && - (program->Base.OutputsWritten & (1 << VERT_RESULT_FOGC)) == 0) { + (program->Base.OutputsWritten & BITFIELD64_BIT(VERT_RESULT_FOGC)) == 0) { for (i = 0; i < VB->Count; i++) { store->results[VERT_RESULT_FOGC].data[i][0] = 1.0; } } if (ctx->VertexProgram.PointSizeEnabled && - (program->Base.OutputsWritten & (1 << VERT_RESULT_PSIZ)) == 0) { + (program->Base.OutputsWritten & BITFIELD64_BIT(VERT_RESULT_PSIZ)) == 0) { for (i = 0; i < VB->Count; i++) { store->results[VERT_RESULT_PSIZ].data[i][0] = ctx->Point.Size; } @@ -472,7 +472,7 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage ) } for (i = 0; i < ctx->Const.MaxVarying; i++) { - if (program->Base.OutputsWritten & (1 << (VERT_RESULT_VAR0 + i))) { + if (program->Base.OutputsWritten & BITFIELD64_BIT(VERT_RESULT_VAR0 + i)) { /* Note: varying results get put into the generic attributes */ VB->AttribPtr[VERT_ATTRIB_GENERIC0+i] = &store->results[VERT_RESULT_VAR0 + i]; -- cgit v1.2.3 From 70dca0c273d681d004b014dd8d4434be664cb202 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 17 Nov 2009 22:53:06 -0800 Subject: AL1616: Fix cut-and-paste bug One of the PACK_COLOR_88 cases was left over from copying _mesa_texstore_al88 to _mesa_texstore_al1616. --- src/mesa/main/texstore.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index abb4ed2663..5387eb1283 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -2198,8 +2198,8 @@ _mesa_texstore_al1616(TEXSTORE_PARAMS) if (dstFormat == MESA_FORMAT_AL1616) { for (col = 0; col < srcWidth; col++) { /* src[0] is luminance, src[1] is alpha */ - dstUI[col] = PACK_COLOR_88( FLOAT_TO_USHORT(src[1]), - FLOAT_TO_USHORT(src[0]) ); + dstUI[col] = PACK_COLOR_1616( FLOAT_TO_USHORT(src[1]), + FLOAT_TO_USHORT(src[0]) ); src += 2; } } -- cgit v1.2.3 From 7118db870091d4c9c2465e79f361ff0ed36d1f90 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Wed, 18 Nov 2009 22:02:48 +0100 Subject: r600: align for mipmap tree changes --- src/mesa/drivers/dri/r600/r600_tex.c | 17 +++----------- src/mesa/drivers/dri/r600/r600_texstate.c | 37 ++++++++++++------------------- src/mesa/drivers/dri/r600/r700_chip.c | 10 ++++++--- 3 files changed, 24 insertions(+), 40 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r600_tex.c b/src/mesa/drivers/dri/r600/r600_tex.c index 20965bb3c8..9d83a64e22 100644 --- a/src/mesa/drivers/dri/r600/r600_tex.c +++ b/src/mesa/drivers/dri/r600/r600_tex.c @@ -312,16 +312,7 @@ static void r600TexParameter(GLcontext * ctx, GLenum target, case GL_TEXTURE_MAX_LEVEL: case GL_TEXTURE_MIN_LOD: case GL_TEXTURE_MAX_LOD: - /* This isn't the most efficient solution but there doesn't appear to - * be a nice alternative. Since there's no LOD clamping, - * we just have to rely on loading the right subset of mipmap levels - * to simulate a clamped LOD. - */ - if (t->mt) { - radeon_miptree_unreference(t->mt); - t->mt = 0; - t->validated = GL_FALSE; - } + t->validated = GL_FALSE; break; case GL_DEPTH_TEXTURE_MODE: @@ -369,10 +360,8 @@ static void r600DeleteTexture(GLcontext * ctx, struct gl_texture_object *texObj) t->bo = NULL; } - if (t->mt) { - radeon_miptree_unreference(t->mt); - t->mt = 0; - } + radeon_miptree_unreference(&t->mt); + _mesa_delete_texture_object(ctx, texObj); } diff --git a/src/mesa/drivers/dri/r600/r600_texstate.c b/src/mesa/drivers/dri/r600/r600_texstate.c index 27c8354923..4ec315b78c 100644 --- a/src/mesa/drivers/dri/r600/r600_texstate.c +++ b/src/mesa/drivers/dri/r600/r600_texstate.c @@ -649,7 +649,6 @@ static void setup_hardware_state(context_t *rmesa, struct gl_texture_object *tex { radeonTexObj *t = radeon_tex_obj(texObj); const struct gl_texture_image *firstImage; - int firstlevel = t->mt ? t->mt->firstLevel : 0; GLuint uTexelPitch, row_align; if (rmesa->radeon.radeonScreen->driScreen->dri2.enabled && @@ -657,7 +656,7 @@ static void setup_hardware_state(context_t *rmesa, struct gl_texture_object *tex t->bo) return; - firstImage = t->base.Image[0][firstlevel]; + firstImage = t->base.Image[0][t->minLod]; if (!t->image_override) { if (!r600GetTexFormat(texObj, firstImage->TexFormat)) { @@ -692,7 +691,8 @@ static void setup_hardware_state(context_t *rmesa, struct gl_texture_object *tex } row_align = rmesa->radeon.texture_row_align - 1; - uTexelPitch = ((firstImage->Width * t->mt->bpp + row_align) & ~row_align) / t->mt->bpp; + uTexelPitch = (_mesa_format_row_stride(firstImage->TexFormat, firstImage->Width) + row_align) & ~row_align; + uTexelPitch = uTexelPitch / _mesa_get_format_bytes(firstImage->TexFormat); uTexelPitch = (uTexelPitch + R700_TEXEL_PITCH_ALIGNMENT_MASK) & ~R700_TEXEL_PITCH_ALIGNMENT_MASK; @@ -706,10 +706,10 @@ static void setup_hardware_state(context_t *rmesa, struct gl_texture_object *tex SETfield(t->SQ_TEX_RESOURCE1, firstImage->Height - 1, TEX_HEIGHT_shift, TEX_HEIGHT_mask); - if ((t->mt->lastLevel - t->mt->firstLevel) > 0) { - t->SQ_TEX_RESOURCE3 = t->mt->levels[0].size / 256; - SETfield(t->SQ_TEX_RESOURCE4, t->mt->firstLevel, BASE_LEVEL_shift, BASE_LEVEL_mask); - SETfield(t->SQ_TEX_RESOURCE5, t->mt->lastLevel, LAST_LEVEL_shift, LAST_LEVEL_mask); + if ((t->maxLod - t->minLod) > 0) { + t->SQ_TEX_RESOURCE3 = t->mt->levels[t->minLod].size / 256; + SETfield(t->SQ_TEX_RESOURCE4, 0, BASE_LEVEL_shift, BASE_LEVEL_mask); + SETfield(t->SQ_TEX_RESOURCE5, t->maxLod - t->minLod, LAST_LEVEL_shift, LAST_LEVEL_mask); } } @@ -808,9 +808,8 @@ void r600SetTexOffset(__DRIcontext * pDRICtx, GLint texname, struct gl_texture_object *tObj = _mesa_lookup_texture(rmesa->radeon.glCtx, texname); radeonTexObjPtr t = radeon_tex_obj(tObj); - int firstlevel = t->mt ? t->mt->firstLevel : 0; const struct gl_texture_image *firstImage; - uint32_t pitch_val, size, row_align, bpp; + uint32_t pitch_val, size, row_align; if (!tObj) return; @@ -820,13 +819,9 @@ void r600SetTexOffset(__DRIcontext * pDRICtx, GLint texname, if (!offset) return; - bpp = depth / 8; - if (bpp == 3) - bpp = 4; - - firstImage = t->base.Image[0][firstlevel]; + firstImage = t->base.Image[0][t->minLod]; row_align = rmesa->radeon.texture_row_align - 1; - size = ((firstImage->Width * bpp + row_align) & ~row_align) * firstImage->Height; + size = ((_mesa_format_row_stride(firstImage->TexFormat, firstImage->Width) + row_align) & ~row_align) * firstImage->Height; if (t->bo) { radeon_bo_unref(t->bo); t->bo = NULL; @@ -949,14 +944,10 @@ void r600SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo radeon_bo_unref(rImage->bo); rImage->bo = NULL; } - if (t->mt) { - radeon_miptree_unreference(t->mt); - t->mt = NULL; - } - if (rImage->mt) { - radeon_miptree_unreference(rImage->mt); - rImage->mt = NULL; - } + + radeon_miptree_unreference(&t->mt); + radeon_miptree_unreference(&rImage->mt); + _mesa_init_teximage_fields(radeon->glCtx, target, texImage, rb->base.Width, rb->base.Height, 1, 0, rb->cpp); texImage->RowStride = rb->pitch / rb->cpp; diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index ec76fbcb6d..2b2b4d748f 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -54,11 +54,15 @@ static void r700SendTexState(GLcontext *ctx, struct radeon_state_atom *atom) for (i = 0; i < R700_TEXTURE_NUMBERUNITS; i++) { if (ctx->Texture.Unit[i]._ReallyEnabled) { radeonTexObj *t = r700->textures[i]; + uint32_t offset; if (t) { - if (!t->image_override) + if (!t->image_override) { bo = t->mt->bo; - else + offset = get_base_teximage_offset(t); + } else { bo = t->bo; + offset = 0; + } if (bo) { r700SyncSurf(context, bo, @@ -77,7 +81,7 @@ static void r700SendTexState(GLcontext *ctx, struct radeon_state_atom *atom) R600_OUT_BATCH(r700->textures[i]->SQ_TEX_RESOURCE6); R600_OUT_BATCH_RELOC(r700->textures[i]->SQ_TEX_RESOURCE2, bo, - 0, + offset, RADEON_GEM_DOMAIN_GTT|RADEON_GEM_DOMAIN_VRAM, 0, 0); R600_OUT_BATCH_RELOC(r700->textures[i]->SQ_TEX_RESOURCE3, bo, -- cgit v1.2.3 From 3bf12c8bea667f5fff0b6f495820a27141f595a2 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Wed, 18 Nov 2009 22:19:25 +0100 Subject: r300: allow disabling s3tc support if libtxc_dxtn is available --- src/mesa/drivers/dri/r300/r300_context.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 3ed49a85c5..5f07b95634 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -439,11 +439,11 @@ static void r300InitGLExtensions(GLcontext *ctx) if (r300->options.stencil_two_side_disabled) _mesa_disable_extension(ctx, "GL_EXT_stencil_two_side"); - if (ctx->Mesa_DXTn || r300->options.s3tc_force_enabled) { + if (r300->options.s3tc_force_disabled) { + _mesa_disable_extension(ctx, "GL_EXT_texture_compression_s3tc"); + } else if (ctx->Mesa_DXTn || r300->options.s3tc_force_enabled) { _mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc"); _mesa_enable_extension(ctx, "GL_S3_s3tc"); - } else if (r300->options.s3tc_force_disabled) { - _mesa_disable_extension(ctx, "GL_EXT_texture_compression_s3tc"); } if (!r300->radeon.radeonScreen->drmSupportsOcclusionQueries) { -- cgit v1.2.3 From 61a3716ab5ad72ed2d2e926055716be99a4b2abd Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 18 Nov 2009 07:25:33 -0700 Subject: mesa: bump version to 7.8 --- src/mesa/main/version.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index 0cae1860a3..dc55cb7ccc 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.h @@ -1,6 +1,6 @@ /* * Mesa 3-D graphics library - * Version: 7.7 + * Version: 7.8 * * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. * Copyright (C) 2009 VMware, Inc. All Rights Reserved. @@ -30,9 +30,9 @@ /* Mesa version */ #define MESA_MAJOR 7 -#define MESA_MINOR 7 +#define MESA_MINOR 8 #define MESA_PATCH 0 -#define MESA_VERSION_STRING "7.7-devel" +#define MESA_VERSION_STRING "7.8-devel" /* To make version comparison easy */ #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -- cgit v1.2.3 From 027abddf4f47163276f55c2fa8f81408b652f072 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 18 Nov 2009 08:08:25 -0700 Subject: mesa: set version string to 7.6.1-rc1 --- src/mesa/main/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index f24e11cc51..3e9143979a 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.h @@ -32,7 +32,7 @@ #define MESA_MAJOR 7 #define MESA_MINOR 6 #define MESA_PATCH 1 -#define MESA_VERSION_STRING "7.6.1-devel" +#define MESA_VERSION_STRING "7.6.1-rc1" /* To make version comparison easy */ #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -- cgit v1.2.3 From 13b5a624b1899c457279907d58046dfb3c95addc Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Wed, 18 Nov 2009 11:27:36 -0500 Subject: Revert "radeon: Fix legacy bo not to reuse dma buffers before refcount is 1." This reverts commit 284a7af274bc148f112bd0ebb40583923ee26b49. This breaks kde desktop effects. See fdo bug 24131 --- src/mesa/drivers/dri/radeon/radeon_dma.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_dma.c b/src/mesa/drivers/dri/radeon/radeon_dma.c index c6edbae9a1..c9a32c808b 100644 --- a/src/mesa/drivers/dri/radeon/radeon_dma.c +++ b/src/mesa/drivers/dri/radeon/radeon_dma.c @@ -207,6 +207,7 @@ again_alloc: counter on unused buffers for later freeing them from begin of list */ dma_bo = last_elem(&rmesa->dma.free); + assert(dma_bo->bo->cref == 1); remove_from_list(dma_bo); insert_at_head(&rmesa->dma.reserved, dma_bo); } @@ -306,10 +307,6 @@ static int radeon_bo_is_idle(struct radeon_bo* bo) WARN_ONCE("Your libdrm or kernel doesn't have support for busy query.\n" "This may cause small performance drop for you.\n"); } - /* Protect against bug in legacy bo handling that causes bos stay - * referenced even after they should be freed */ - if (bo->cref != 1) - return 0; return ret != -EBUSY; } @@ -346,9 +343,7 @@ void radeonReleaseDmaRegions(radeonContextPtr rmesa) foreach_s(dma_bo, temp, &rmesa->dma.wait) { if (dma_bo->expire_counter == time) { WARN_ONCE("Leaking dma buffer object!\n"); - /* force free of buffer so we don't realy start - * leaking stuff now*/ - while ((dma_bo->bo = radeon_bo_unref(dma_bo->bo))) {} + radeon_bo_unref(dma_bo->bo); remove_from_list(dma_bo); FREE(dma_bo); continue; -- cgit v1.2.3 From c4e8918cd248189d43cdc8df9f9f0450040261c5 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Fri, 20 Nov 2009 21:42:06 +0100 Subject: mesa: Fix NULL deref in optimizer when NumInstructions == 0. Bug #24984. --- src/mesa/shader/prog_optimize.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/prog_optimize.c b/src/mesa/shader/prog_optimize.c index 3d28d885a4..4fe351251e 100644 --- a/src/mesa/shader/prog_optimize.c +++ b/src/mesa/shader/prog_optimize.c @@ -443,7 +443,7 @@ _mesa_remove_extra_move_use(struct gl_program *prog) * FOO tmpY, arg0, arg1; */ - for (i = 0; i < prog->NumInstructions - 1; i++) { + for (i = 0; i + 1 < prog->NumInstructions; i++) { const struct prog_instruction *mov = prog->Instructions + i; if (mov->Opcode != OPCODE_MOV || -- cgit v1.2.3 From fe5c46546e740a16a13fe9e8aaa4b071bc13d70b Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Wed, 18 Nov 2009 11:51:20 -0500 Subject: r600: disable compressed texture support It's not implemented yet. fixes fdo bug 24047 --- src/mesa/drivers/dri/r600/r600_context.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index e0b77d4385..8dab57b433 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -362,6 +362,7 @@ GLboolean r600CreateContext(const __GLcontextModes * glVisual, (&r600->radeon.optionCache, "disable_stencil_two_side")) _mesa_disable_extension(ctx, "GL_EXT_stencil_two_side"); +#if 0 if (r600->radeon.glCtx->Mesa_DXTn && !driQueryOptionb(&r600->radeon.optionCache, "disable_s3tc")) { _mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc"); @@ -371,6 +372,9 @@ GLboolean r600CreateContext(const __GLcontextModes * glVisual, { _mesa_enable_extension(ctx, "GL_EXT_texture_compression_s3tc"); } +#else + _mesa_disable_extension(ctx, "GL_ARB_texture_compression"); +#endif radeon_fbo_init(&r600->radeon); radeonInitSpanFuncs( ctx ); -- cgit v1.2.3 From 3132853e1242607d5ff62785cd7dad5ef3a783d0 Mon Sep 17 00:00:00 2001 From: Richard Li Date: Tue, 17 Nov 2009 16:25:02 -0500 Subject: r600 : Initial version of glsl fc. --- src/mesa/drivers/dri/r600/r700_assembler.c | 2572 ++++++++++++++++++++++++---- src/mesa/drivers/dri/r600/r700_assembler.h | 111 +- src/mesa/drivers/dri/r600/r700_chip.c | 99 +- src/mesa/drivers/dri/r600/r700_fragprog.c | 94 +- src/mesa/drivers/dri/r600/r700_shader.c | 9 +- src/mesa/drivers/dri/r600/r700_shader.h | 3 +- src/mesa/drivers/dri/r600/r700_vertprog.c | 21 +- 7 files changed, 2507 insertions(+), 402 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index e0d7d4fa6b..4b5d40bd3a 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -38,6 +38,8 @@ #include "r700_assembler.h" +#define USE_CF_FOR_CONTINUE_BREAK 1 + BITS addrmode_PVSDST(PVSDST * pPVSDST) { return pPVSDST->addrmode0 | ((BITS)pPVSDST->addrmode1 << 1); @@ -343,6 +345,8 @@ unsigned int r700GetNumOperands(r700_AssemblerBase* pAsm) case SQ_OP2_INST_MIN: //case SQ_OP2_INST_MAX_DX10: //case SQ_OP2_INST_MIN_DX10: + case SQ_OP2_INST_SETE: + case SQ_OP2_INST_SETNE: case SQ_OP2_INST_SETGT: case SQ_OP2_INST_SETGE: case SQ_OP2_INST_PRED_SETE: @@ -398,6 +402,9 @@ int Init_r700_AssemblerBase(SHADER_PIPE_TYPE spt, r700_AssemblerBase* pAsm, R700 pAsm->number_of_exports = 0; pAsm->number_of_export_opcodes = 0; + pAsm->alu_x_opcode = 0; + + pAsm->D2.bits = 0; pAsm->D.bits = 0; pAsm->S[0].bits = 0; @@ -474,6 +481,22 @@ int Init_r700_AssemblerBase(SHADER_PIPE_TYPE spt, r700_AssemblerBase* pAsm, R700 pAsm->is_tex = GL_FALSE; pAsm->need_tex_barrier = GL_FALSE; + pAsm->subs = NULL; + pAsm->unSubArraySize = 0; + pAsm->unSubArrayPointer = 0; + pAsm->callers = NULL; + pAsm->unCallerArraySize = 0; + pAsm->unCallerArrayPointer = 0; + + pAsm->CALLSP = 0; + pAsm->CALLSTACK[0].FCSP_BeforeEntry; + pAsm->CALLSTACK[0].plstCFInstructions_local + = &(pAsm->pR700Shader->lstCFInstructions); + + SetActiveCFlist(pAsm->pR700Shader, pAsm->CALLSTACK[0].plstCFInstructions_local); + + pAsm->unCFflags = 0; + return 0; } @@ -592,6 +615,31 @@ int check_current_clause(r700_AssemblerBase* pAsm, return GL_TRUE; } +GLboolean add_cf_instruction(r700_AssemblerBase* pAsm) +{ + if(GL_FALSE == check_current_clause(pAsm, CF_OTHER_CLAUSE)) + { + return GL_FALSE; + } + + pAsm->cf_current_cf_clause_ptr = + (R700ControlFlowGenericClause*) CALLOC_STRUCT(R700ControlFlowGenericClause); + + if (pAsm->cf_current_cf_clause_ptr != NULL) + { + Init_R700ControlFlowGenericClause(pAsm->cf_current_cf_clause_ptr); + AddCFInstruction( pAsm->pR700Shader, + (R700ControlFlowInstruction *)pAsm->cf_current_cf_clause_ptr ); + } + else + { + radeon_error("Could not allocate a new VFetch CF instruction.\n"); + return GL_FALSE; + } + + return GL_TRUE; +} + GLboolean add_vfetch_instruction(r700_AssemblerBase* pAsm, R700VertexInstruction* vertex_instruction_ptr) { @@ -1153,6 +1201,7 @@ GLboolean assemble_src(r700_AssemblerBase *pAsm, case PROGRAM_LOCAL_PARAM: case PROGRAM_ENV_PARAM: case PROGRAM_STATE_VAR: + case PROGRAM_UNIFORM: if (1 == pILInst->SrcReg[src].RelAddr) { setaddrmode_PVSSRC(&(pAsm->S[fld].src), ADDR_RELATIVE_A0); @@ -1179,7 +1228,7 @@ GLboolean assemble_src(r700_AssemblerBase *pAsm, } break; default: - radeon_error("Invalid source argument type\n"); + radeon_error("Invalid source argument type : %d \n", pILInst->SrcReg[src].File); return GL_FALSE; } } @@ -1315,7 +1364,7 @@ GLboolean tex_src(r700_AssemblerBase *pAsm) case FRAG_ATTRIB_TEX0: case FRAG_ATTRIB_TEX1: case FRAG_ATTRIB_TEX2: - case FRAG_ATTRIB_TEX3: + case FRAG_ATTRIB_TEX3: case FRAG_ATTRIB_TEX4: case FRAG_ATTRIB_TEX5: case FRAG_ATTRIB_TEX6: @@ -1335,6 +1384,16 @@ GLboolean tex_src(r700_AssemblerBase *pAsm) fprintf(stderr, "FRAG_ATTRIB_VAR0 unsupported\n"); break; } + + if( (pILInst->SrcReg[0].Index >= FRAG_ATTRIB_VAR0) || + (pILInst->SrcReg[0].Index < FRAG_ATTRIB_MAX) ) + { + bValidTexCoord = GL_TRUE; + pAsm->S[0].src.reg = + pAsm->uiFP_AttributeMap[pILInst->SrcReg[0].Index]; + pAsm->S[0].src.rtype = SRC_REG_INPUT; + } + break; } } @@ -1517,6 +1576,10 @@ GLboolean assemble_alu_src(R700ALUInstruction* alu_instruction_ptr, { src_sel = pSource->reg + CFILE_REGISTER_OFFSET; } + else if (pSource->rtype == SRC_REC_LITERAL) + { + src_sel = SQ_ALU_SRC_LITERAL; + } else { radeon_error("Source (%d) register type (%d) not one of TEMP, INPUT, or CONSTANT.\n", @@ -1606,7 +1669,8 @@ GLboolean add_alu_instruction(r700_AssemblerBase* pAsm, return GL_FALSE; } - if ( pAsm->cf_current_alu_clause_ptr == NULL || + if ( pAsm->alu_x_opcode != 0 || + pAsm->cf_current_alu_clause_ptr == NULL || ( (pAsm->cf_current_alu_clause_ptr != NULL) && (pAsm->cf_current_alu_clause_ptr->m_Word1.f.count >= (GetCFMaxInstructions(pAsm->cf_current_alu_clause_ptr->m_ShaderInstType)-contiguous_slots_needed-1) ) ) ) @@ -1636,9 +1700,17 @@ GLboolean add_alu_instruction(r700_AssemblerBase* pAsm, pAsm->cf_current_alu_clause_ptr->m_Word1.f.kcache_addr0 = 0x0; pAsm->cf_current_alu_clause_ptr->m_Word1.f.kcache_addr1 = 0x0; - //cf_current_alu_clause_ptr->m_Word1.f.count = number_of_scalar_operations - 1; pAsm->cf_current_alu_clause_ptr->m_Word1.f.count = 0x0; - pAsm->cf_current_alu_clause_ptr->m_Word1.f.cf_inst = SQ_CF_INST_ALU; + + if(pAsm->alu_x_opcode != 0) + { + pAsm->cf_current_alu_clause_ptr->m_Word1.f.cf_inst = pAsm->alu_x_opcode; + pAsm->alu_x_opcode = 0; + } + else + { + pAsm->cf_current_alu_clause_ptr->m_Word1.f.cf_inst = SQ_CF_INST_ALU; + } pAsm->cf_current_alu_clause_ptr->m_Word1.f.whole_quad_mode = 0x0; @@ -2358,146 +2430,711 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) return GL_TRUE; } -GLboolean next_ins(r700_AssemblerBase *pAsm) +GLboolean assemble_alu_instruction2(r700_AssemblerBase *pAsm) { - struct prog_instruction *pILInst = &(pAsm->pILInst[pAsm->uiCurInst]); + GLuint number_of_scalar_operations; + GLboolean is_single_scalar_operation; + GLuint scalar_channel_index; - if( GL_TRUE == pAsm->is_tex ) + PVSSRC * pcurrent_source; + int current_source_index; + GLuint contiguous_slots_needed; + + GLuint uNumSrc = r700GetNumOperands(pAsm); + + GLboolean bSplitInst = GL_FALSE; + + if (1 == pAsm->D.dst.math) { - if (pILInst->TexSrcTarget == TEXTURE_RECT_INDEX) { - if( GL_FALSE == assemble_tex_instruction(pAsm, GL_FALSE) ) - { - radeon_error("Error assembling TEX instruction\n"); - return GL_FALSE; - } - } else { - if( GL_FALSE == assemble_tex_instruction(pAsm, GL_TRUE) ) - { - radeon_error("Error assembling TEX instruction\n"); - return GL_FALSE; - } - } + is_single_scalar_operation = GL_TRUE; + number_of_scalar_operations = 1; } else - { //ALU - if( GL_FALSE == assemble_alu_instruction(pAsm) ) - { - radeon_error("Error assembling ALU instruction\n"); - return GL_FALSE; - } - } - - if(pAsm->D.dst.rtype == DST_REG_OUT) { - if(pAsm->D.dst.op3) - { - // There is no mask for OP3 instructions, so all channels are written - pAsm->pucOutMask[pAsm->D.dst.reg - pAsm->starting_export_register_number] = 0xF; - } - else - { - pAsm->pucOutMask[pAsm->D.dst.reg - pAsm->starting_export_register_number] - |= (unsigned char)pAsm->pILInst[pAsm->uiCurInst].DstReg.WriteMask; - } + is_single_scalar_operation = GL_FALSE; + number_of_scalar_operations = 4; } - - //reset for next inst. - pAsm->D.bits = 0; - pAsm->S[0].bits = 0; - pAsm->S[1].bits = 0; - pAsm->S[2].bits = 0; - pAsm->is_tex = GL_FALSE; - pAsm->need_tex_barrier = GL_FALSE; - return GL_TRUE; -} - -GLboolean assemble_math_function(r700_AssemblerBase* pAsm, BITS opcode) -{ - BITS tmp; - - checkop1(pAsm); - - tmp = gethelpr(pAsm); - - // opcode tmp.x, a.x - // MOV dst, tmp.x - pAsm->D.dst.opcode = opcode; - pAsm->D.dst.math = 1; - - setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); - pAsm->D.dst.rtype = DST_REG_TEMPORARY; - pAsm->D.dst.reg = tmp; - pAsm->D.dst.writex = 1; + contiguous_slots_needed = 0; - if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + if(GL_TRUE == is_reduction_opcode(&(pAsm->D)) ) { - return GL_FALSE; + contiguous_slots_needed = 4; } - if ( GL_FALSE == next_ins(pAsm) ) + initialize(pAsm); + + for (scalar_channel_index=0; + scalar_channel_index < number_of_scalar_operations; + scalar_channel_index++) { - return GL_FALSE; - } + R700ALUInstruction* alu_instruction_ptr = (R700ALUInstruction*) CALLOC_STRUCT(R700ALUInstruction); + if (alu_instruction_ptr == NULL) + { + return GL_FALSE; + } + Init_R700ALUInstruction(alu_instruction_ptr); + + //src 0 + current_source_index = 0; + pcurrent_source = &(pAsm->S[0].src); - // Now replicate result to all necessary channels in destination - pAsm->D.dst.opcode = SQ_OP2_INST_MOV; + if (GL_FALSE == assemble_alu_src(alu_instruction_ptr, + current_source_index, + pcurrent_source, + scalar_channel_index) ) + { + return GL_FALSE; + } + + if (uNumSrc > 1) + { + // Process source 1 + current_source_index = 1; + pcurrent_source = &(pAsm->S[current_source_index].src); - if( GL_FALSE == assemble_dst(pAsm) ) - { - return GL_FALSE; - } + if (GL_FALSE == assemble_alu_src(alu_instruction_ptr, + current_source_index, + pcurrent_source, + scalar_channel_index) ) + { + return GL_FALSE; + } + } - setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); - pAsm->S[0].src.rtype = DST_REG_TEMPORARY; - pAsm->S[0].src.reg = tmp; + //other bits + alu_instruction_ptr->m_Word0.f.index_mode = SQ_INDEX_LOOP; - setswizzle_PVSSRC(&(pAsm->S[0].src), SQ_SEL_X); - noneg_PVSSRC(&(pAsm->S[0].src)); + if( (is_single_scalar_operation == GL_TRUE) + || (GL_TRUE == bSplitInst) ) + { + alu_instruction_ptr->m_Word0.f.last = 1; + } + else + { + alu_instruction_ptr->m_Word0.f.last = (scalar_channel_index == 3) ? 1 : 0; + } - if( GL_FALSE == next_ins(pAsm) ) - { - return GL_FALSE; - } + alu_instruction_ptr->m_Word0.f.pred_sel = (pAsm->D.dst.pred_inv > 0) ? 1 : 0; + if(1 == pAsm->D.dst.predicated) + { + alu_instruction_ptr->m_Word1_OP2.f.update_pred = 0x1; + alu_instruction_ptr->m_Word1_OP2.f.update_execute_mask = 0x1; + } + else + { + alu_instruction_ptr->m_Word1_OP2.f.update_pred = 0x0; + alu_instruction_ptr->m_Word1_OP2.f.update_execute_mask = 0x0; + } + + // dst + if( (pAsm->D.dst.rtype == DST_REG_TEMPORARY) || + (pAsm->D.dst.rtype == DST_REG_OUT) ) + { + alu_instruction_ptr->m_Word1.f.dst_gpr = pAsm->D.dst.reg; + } + else + { + radeon_error("Only temp destination registers supported for ALU dest regs.\n"); + return GL_FALSE; + } - return GL_TRUE; -} + alu_instruction_ptr->m_Word1.f.dst_rel = SQ_ABSOLUTE; //D.rtype -GLboolean assemble_ABS(r700_AssemblerBase *pAsm) -{ - checkop1(pAsm); + if ( is_single_scalar_operation == GL_TRUE ) + { + // Override scalar_channel_index since only one scalar value will be written + if(pAsm->D.dst.writex) + { + scalar_channel_index = 0; + } + else if(pAsm->D.dst.writey) + { + scalar_channel_index = 1; + } + else if(pAsm->D.dst.writez) + { + scalar_channel_index = 2; + } + else if(pAsm->D.dst.writew) + { + scalar_channel_index = 3; + } + } - pAsm->D.dst.opcode = SQ_OP2_INST_MAX; + alu_instruction_ptr->m_Word1.f.dst_chan = scalar_channel_index; - if( GL_FALSE == assemble_dst(pAsm) ) - { - return GL_FALSE; - } - if( GL_FALSE == assemble_src(pAsm, 0, -1) ) - { - return GL_FALSE; - } - - pAsm->S[1].bits = pAsm->S[0].bits; - flipneg_PVSSRC(&(pAsm->S[1].src)); + alu_instruction_ptr->m_Word1.f.clamp = pAsm->D2.dst2.SaturateMode; - if ( GL_FALSE == next_ins(pAsm) ) - { - return GL_FALSE; - } + if (pAsm->D.dst.op3) + { + //op3 - return GL_TRUE; -} + alu_instruction_ptr->m_Word1_OP3.f.alu_inst = pAsm->D.dst.opcode; -GLboolean assemble_ADD(r700_AssemblerBase *pAsm) -{ - if( GL_FALSE == checkop2(pAsm) ) - { - return GL_FALSE; - } + //There's 3rd src for op3 + current_source_index = 2; + pcurrent_source = &(pAsm->S[current_source_index].src); - pAsm->D.dst.opcode = SQ_OP2_INST_ADD; - + if ( GL_FALSE == assemble_alu_src(alu_instruction_ptr, + current_source_index, + pcurrent_source, + scalar_channel_index) ) + { + return GL_FALSE; + } + } + else + { + //op2 + if (pAsm->bR6xx) + { + alu_instruction_ptr->m_Word1_OP2.f6.alu_inst = pAsm->D.dst.opcode; + + alu_instruction_ptr->m_Word1_OP2.f6.src0_abs = 0x0; + alu_instruction_ptr->m_Word1_OP2.f6.src1_abs = 0x0; + + //alu_instruction_ptr->m_Word1_OP2.f6.update_execute_mask = 0x0; + //alu_instruction_ptr->m_Word1_OP2.f6.update_pred = 0x0; + switch (scalar_channel_index) + { + case 0: + alu_instruction_ptr->m_Word1_OP2.f6.write_mask = pAsm->D.dst.writex; + break; + case 1: + alu_instruction_ptr->m_Word1_OP2.f6.write_mask = pAsm->D.dst.writey; + break; + case 2: + alu_instruction_ptr->m_Word1_OP2.f6.write_mask = pAsm->D.dst.writez; + break; + case 3: + alu_instruction_ptr->m_Word1_OP2.f6.write_mask = pAsm->D.dst.writew; + break; + default: + alu_instruction_ptr->m_Word1_OP2.f6.write_mask = 1; //SQ_SEL_MASK; + break; + } + alu_instruction_ptr->m_Word1_OP2.f6.omod = SQ_ALU_OMOD_OFF; + } + else + { + alu_instruction_ptr->m_Word1_OP2.f.alu_inst = pAsm->D.dst.opcode; + + alu_instruction_ptr->m_Word1_OP2.f.src0_abs = 0x0; + alu_instruction_ptr->m_Word1_OP2.f.src1_abs = 0x0; + + //alu_instruction_ptr->m_Word1_OP2.f.update_execute_mask = 0x0; + //alu_instruction_ptr->m_Word1_OP2.f.update_pred = 0x0; + switch (scalar_channel_index) + { + case 0: + alu_instruction_ptr->m_Word1_OP2.f.write_mask = pAsm->D.dst.writex; + break; + case 1: + alu_instruction_ptr->m_Word1_OP2.f.write_mask = pAsm->D.dst.writey; + break; + case 2: + alu_instruction_ptr->m_Word1_OP2.f.write_mask = pAsm->D.dst.writez; + break; + case 3: + alu_instruction_ptr->m_Word1_OP2.f.write_mask = pAsm->D.dst.writew; + break; + default: + alu_instruction_ptr->m_Word1_OP2.f.write_mask = 1; //SQ_SEL_MASK; + break; + } + alu_instruction_ptr->m_Word1_OP2.f.omod = SQ_ALU_OMOD_OFF; + } + } + + if(GL_FALSE == add_alu_instruction(pAsm, alu_instruction_ptr, contiguous_slots_needed) ) + { + return GL_FALSE; + } + + /* + * Judge the type of current instruction, is it vector or scalar + * instruction. + */ + if (is_single_scalar_operation) + { + if(GL_FALSE == check_scalar(pAsm, alu_instruction_ptr) ) + { + return GL_FALSE; + } + } + else + { + if(GL_FALSE == check_vector(pAsm, alu_instruction_ptr) ) + { + return 1; + } + } + + contiguous_slots_needed = 0; + } + + return GL_TRUE; +} + +GLboolean assemble_alu_instruction_literal(r700_AssemblerBase *pAsm, GLfloat * pLiteral) +{ + R700ALUInstruction * alu_instruction_ptr; + R700ALUInstructionHalfLiteral * alu_instruction_ptr_hl; + R700ALUInstructionFullLiteral * alu_instruction_ptr_fl; + + GLuint number_of_scalar_operations; + GLboolean is_single_scalar_operation; + GLuint scalar_channel_index; + + GLuint contiguous_slots_needed; + GLuint lastInstruction; + GLuint not_masked[4]; + + GLuint uNumSrc = r700GetNumOperands(pAsm); + + GLboolean bSplitInst = GL_FALSE; + + number_of_scalar_operations = 0; + contiguous_slots_needed = 0; + + if(1 == pAsm->D.dst.writew) + { + lastInstruction = 3; + number_of_scalar_operations++; + not_masked[3] = 1; + } + else + { + not_masked[3] = 0; + } + if(1 == pAsm->D.dst.writez) + { + lastInstruction = 2; + number_of_scalar_operations++; + not_masked[2] = 1; + } + else + { + not_masked[2] = 0; + } + if(1 == pAsm->D.dst.writey) + { + lastInstruction = 1; + number_of_scalar_operations++; + not_masked[1] = 1; + } + else + { + not_masked[1] = 0; + } + if(1 == pAsm->D.dst.writex) + { + lastInstruction = 0; + number_of_scalar_operations++; + not_masked[0] = 1; + } + else + { + not_masked[0] = 0; + } + + if(GL_TRUE == is_reduction_opcode(&(pAsm->D)) ) + { + contiguous_slots_needed = 4; + } + else + { + contiguous_slots_needed = number_of_scalar_operations; + } + + if(1 == pAsm->D2.dst2.literal) + { + contiguous_slots_needed += 1; + } + else if(2 == pAsm->D2.dst2.literal) + { + contiguous_slots_needed += 2; + } + + initialize(pAsm); + + for (scalar_channel_index=0; scalar_channel_index < 4; scalar_channel_index++) + { + if(0 == not_masked[scalar_channel_index]) + { + continue; + } + + if(scalar_channel_index == lastInstruction) + { + switch (pAsm->D2.dst2.literal) + { + case 0: + alu_instruction_ptr = (R700ALUInstruction*) CALLOC_STRUCT(R700ALUInstruction); + if (alu_instruction_ptr == NULL) + { + return GL_FALSE; + } + Init_R700ALUInstruction(alu_instruction_ptr); + break; + case 1: + alu_instruction_ptr_hl = (R700ALUInstructionHalfLiteral*) CALLOC_STRUCT(R700ALUInstructionHalfLiteral); + if (alu_instruction_ptr_hl == NULL) + { + return GL_FALSE; + } + Init_R700ALUInstructionHalfLiteral(alu_instruction_ptr_hl, pLiteral[0], pLiteral[1]); + alu_instruction_ptr = (R700ALUInstruction*)alu_instruction_ptr_hl; + break; + case 2: + alu_instruction_ptr_fl = (R700ALUInstructionFullLiteral*) CALLOC_STRUCT(R700ALUInstructionFullLiteral); + if (alu_instruction_ptr_fl == NULL) + { + return GL_FALSE; + } + Init_R700ALUInstructionFullLiteral(alu_instruction_ptr_fl, pLiteral[0], pLiteral[1], pLiteral[2], pLiteral[3]); + alu_instruction_ptr = (R700ALUInstruction*)alu_instruction_ptr_fl; + break; + default: + break; + }; + } + else + { + alu_instruction_ptr = (R700ALUInstruction*) CALLOC_STRUCT(R700ALUInstruction); + if (alu_instruction_ptr == NULL) + { + return GL_FALSE; + } + Init_R700ALUInstruction(alu_instruction_ptr); + } + + //src 0 + if (GL_FALSE == assemble_alu_src(alu_instruction_ptr, + 0, + &(pAsm->S[0].src), + scalar_channel_index) ) + { + return GL_FALSE; + } + + if (uNumSrc > 1) + { + // Process source 1 + if (GL_FALSE == assemble_alu_src(alu_instruction_ptr, + 1, + &(pAsm->S[1].src), + scalar_channel_index) ) + { + return GL_FALSE; + } + } + + //other bits + alu_instruction_ptr->m_Word0.f.index_mode = SQ_INDEX_LOOP; + + if(scalar_channel_index == lastInstruction) + { + alu_instruction_ptr->m_Word0.f.last = 1; + } + + alu_instruction_ptr->m_Word0.f.pred_sel = 0x0; + if(1 == pAsm->D.dst.predicated) + { + alu_instruction_ptr->m_Word1_OP2.f.update_pred = 0x1; + alu_instruction_ptr->m_Word1_OP2.f.update_execute_mask = 0x1; + } + else + { + alu_instruction_ptr->m_Word1_OP2.f.update_pred = 0; + alu_instruction_ptr->m_Word1_OP2.f.update_execute_mask = 0; + } + + // dst + if( (pAsm->D.dst.rtype == DST_REG_TEMPORARY) || + (pAsm->D.dst.rtype == DST_REG_OUT) ) + { + alu_instruction_ptr->m_Word1.f.dst_gpr = pAsm->D.dst.reg; + } + else + { + radeon_error("Only temp destination registers supported for ALU dest regs.\n"); + return GL_FALSE; + } + + alu_instruction_ptr->m_Word1.f.dst_rel = SQ_ABSOLUTE; //D.rtype + + alu_instruction_ptr->m_Word1.f.dst_chan = scalar_channel_index; + + alu_instruction_ptr->m_Word1.f.clamp = pAsm->D2.dst2.SaturateMode; + + if (pAsm->D.dst.op3) + { + //op3 + alu_instruction_ptr->m_Word1_OP3.f.alu_inst = pAsm->D.dst.opcode; + + //There's 3rd src for op3 + if ( GL_FALSE == assemble_alu_src(alu_instruction_ptr, + 2, + &(pAsm->S[2].src), + scalar_channel_index) ) + { + return GL_FALSE; + } + } + else + { + //op2 + if (pAsm->bR6xx) + { + alu_instruction_ptr->m_Word1_OP2.f6.alu_inst = pAsm->D.dst.opcode; + alu_instruction_ptr->m_Word1_OP2.f6.src0_abs = 0x0; + alu_instruction_ptr->m_Word1_OP2.f6.src1_abs = 0x0; + alu_instruction_ptr->m_Word1_OP2.f6.write_mask = 1; + alu_instruction_ptr->m_Word1_OP2.f6.omod = SQ_ALU_OMOD_OFF; + } + else + { + alu_instruction_ptr->m_Word1_OP2.f.alu_inst = pAsm->D.dst.opcode; + alu_instruction_ptr->m_Word1_OP2.f.src0_abs = 0x0; + alu_instruction_ptr->m_Word1_OP2.f.src1_abs = 0x0; + alu_instruction_ptr->m_Word1_OP2.f.write_mask = 1; + alu_instruction_ptr->m_Word1_OP2.f.omod = SQ_ALU_OMOD_OFF; + } + } + + if(GL_FALSE == add_alu_instruction(pAsm, alu_instruction_ptr, contiguous_slots_needed) ) + { + return GL_FALSE; + } + + if (1 == number_of_scalar_operations) + { + if(GL_FALSE == check_scalar(pAsm, alu_instruction_ptr) ) + { + return GL_FALSE; + } + } + else + { + if(GL_FALSE == check_vector(pAsm, alu_instruction_ptr) ) + { + return GL_FALSE; + } + } + + contiguous_slots_needed -= 2; + } + + return GL_TRUE; +} + +GLboolean next_ins(r700_AssemblerBase *pAsm) +{ + struct prog_instruction *pILInst = &(pAsm->pILInst[pAsm->uiCurInst]); + + if( GL_TRUE == pAsm->is_tex ) + { + if (pILInst->TexSrcTarget == TEXTURE_RECT_INDEX) { + if( GL_FALSE == assemble_tex_instruction(pAsm, GL_FALSE) ) + { + radeon_error("Error assembling TEX instruction\n"); + return GL_FALSE; + } + } else { + if( GL_FALSE == assemble_tex_instruction(pAsm, GL_TRUE) ) + { + radeon_error("Error assembling TEX instruction\n"); + return GL_FALSE; + } + } + } + else + { //ALU + if( GL_FALSE == assemble_alu_instruction(pAsm) ) + { + radeon_error("Error assembling ALU instruction\n"); + return GL_FALSE; + } + } + + if(pAsm->D.dst.rtype == DST_REG_OUT) + { + if(pAsm->D.dst.op3) + { + // There is no mask for OP3 instructions, so all channels are written + pAsm->pucOutMask[pAsm->D.dst.reg - pAsm->starting_export_register_number] = 0xF; + } + else + { + pAsm->pucOutMask[pAsm->D.dst.reg - pAsm->starting_export_register_number] + |= (unsigned char)pAsm->pILInst[pAsm->uiCurInst].DstReg.WriteMask; + } + } + + //reset for next inst. + pAsm->D.bits = 0; + pAsm->D2.bits = 0; + pAsm->S[0].bits = 0; + pAsm->S[1].bits = 0; + pAsm->S[2].bits = 0; + pAsm->is_tex = GL_FALSE; + pAsm->need_tex_barrier = GL_FALSE; + + return GL_TRUE; +} + +GLboolean next_ins2(r700_AssemblerBase *pAsm) +{ + struct prog_instruction *pILInst = &(pAsm->pILInst[pAsm->uiCurInst]); + + //ALU + if( GL_FALSE == assemble_alu_instruction2(pAsm) ) + { + radeon_error("Error assembling ALU instruction\n"); + return GL_FALSE; + } + + if(pAsm->D.dst.rtype == DST_REG_OUT) + { + if(pAsm->D.dst.op3) + { + // There is no mask for OP3 instructions, so all channels are written + pAsm->pucOutMask[pAsm->D.dst.reg - pAsm->starting_export_register_number] = 0xF; + } + else + { + pAsm->pucOutMask[pAsm->D.dst.reg - pAsm->starting_export_register_number] + |= (unsigned char)pAsm->pILInst[pAsm->uiCurInst].DstReg.WriteMask; + } + } + + //reset for next inst. + pAsm->D.bits = 0; + pAsm->D2.bits = 0; + pAsm->S[0].bits = 0; + pAsm->S[1].bits = 0; + pAsm->S[2].bits = 0; + pAsm->is_tex = GL_FALSE; + pAsm->need_tex_barrier = GL_FALSE; + + //richard nov.16 glsl + pAsm->D2.bits = 0; + + return GL_TRUE; +} + +/* not work yet */ +GLboolean next_ins_literal(r700_AssemblerBase *pAsm, GLfloat * pLiteral) +{ + struct prog_instruction *pILInst = &(pAsm->pILInst[pAsm->uiCurInst]); + + //ALU + if( GL_FALSE == assemble_alu_instruction_literal(pAsm, pLiteral) ) + { + radeon_error("Error assembling ALU instruction\n"); + return GL_FALSE; + } + + //reset for next inst. + pAsm->D.bits = 0; + pAsm->D2.bits = 0; + pAsm->S[0].bits = 0; + pAsm->S[1].bits = 0; + pAsm->S[2].bits = 0; + pAsm->is_tex = GL_FALSE; + pAsm->need_tex_barrier = GL_FALSE; + return GL_TRUE; +} + +GLboolean assemble_math_function(r700_AssemblerBase* pAsm, BITS opcode) +{ + BITS tmp; + + checkop1(pAsm); + + tmp = gethelpr(pAsm); + + // opcode tmp.x, a.x + // MOV dst, tmp.x + + pAsm->D.dst.opcode = opcode; + pAsm->D.dst.math = 1; + + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = tmp; + pAsm->D.dst.writex = 1; + + if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + { + return GL_FALSE; + } + + if ( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } + + // Now replicate result to all necessary channels in destination + pAsm->D.dst.opcode = SQ_OP2_INST_MOV; + + if( GL_FALSE == assemble_dst(pAsm) ) + { + return GL_FALSE; + } + + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = DST_REG_TEMPORARY; + pAsm->S[0].src.reg = tmp; + + setswizzle_PVSSRC(&(pAsm->S[0].src), SQ_SEL_X); + noneg_PVSSRC(&(pAsm->S[0].src)); + + if( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } + + return GL_TRUE; +} + +GLboolean assemble_ABS(r700_AssemblerBase *pAsm) +{ + checkop1(pAsm); + + pAsm->D.dst.opcode = SQ_OP2_INST_MAX; + + if( GL_FALSE == assemble_dst(pAsm) ) + { + return GL_FALSE; + } + if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + { + return GL_FALSE; + } + + pAsm->S[1].bits = pAsm->S[0].bits; + flipneg_PVSSRC(&(pAsm->S[1].src)); + + if ( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } + + return GL_TRUE; +} + +GLboolean assemble_ADD(r700_AssemblerBase *pAsm) +{ + if( GL_FALSE == checkop2(pAsm) ) + { + return GL_FALSE; + } + + pAsm->D.dst.opcode = SQ_OP2_INST_ADD; + if( GL_FALSE == assemble_dst(pAsm) ) { return GL_FALSE; @@ -3809,10 +4446,78 @@ GLboolean assemble_SCS(r700_AssemblerBase *pAsm) pAsm->S[0].src.swizzlez = SQ_SEL_0; pAsm->S[0].src.swizzlew = SQ_SEL_0; - if ( GL_FALSE == next_ins(pAsm) ) - { - return GL_FALSE; - } + if ( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } + + return GL_TRUE; +} + +GLboolean assemble_LOGIC(r700_AssemblerBase *pAsm, BITS opcode) +{ + if( GL_FALSE == checkop2(pAsm) ) + { + return GL_FALSE; + } + + pAsm->D.dst.opcode = opcode; + pAsm->D.dst.math = 1; + + if( GL_FALSE == assemble_dst(pAsm) ) + { + return GL_FALSE; + } + + if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + { + return GL_FALSE; + } + + if( GL_FALSE == assemble_src(pAsm, 1, -1) ) + { + return GL_FALSE; + } + + if( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } + + return GL_TRUE; +} + +GLboolean assemble_LOGIC_PRED(r700_AssemblerBase *pAsm, BITS opcode) +{ + if( GL_FALSE == checkop2(pAsm) ) + { + return GL_FALSE; + } + + pAsm->D.dst.opcode = opcode; + pAsm->D.dst.math = 1; + pAsm->D.dst.predicated = 1; + pAsm->D2.dst2.SaturateMode = pAsm->pILInst[pAsm->uiCurInst].SaturateMode; + + if( GL_FALSE == assemble_dst(pAsm) ) + { + return GL_FALSE; + } + + if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + { + return GL_FALSE; + } + + if( GL_FALSE == assemble_src(pAsm, 1, -1) ) + { + return GL_FALSE; + } + + if( GL_FALSE == next_ins2(pAsm) ) + { + return GL_FALSE; + } return GL_TRUE; } @@ -4077,223 +4782,930 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) pAsm->D.dst.writez = 0; pAsm->D.dst.writew = 0; - setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); - pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; - pAsm->S[0].src.reg = tmp2; - noswizzle_PVSSRC(&(pAsm->S[0].src)); - setaddrmode_PVSSRC(&(pAsm->S[1].src), ADDR_ABSOLUTE); - pAsm->S[1].src.rtype = SRC_REG_TEMPORARY; - pAsm->S[1].src.reg = 252; // SQ_ALU_SRC_0_5 - noswizzle_PVSSRC(&(pAsm->S[1].src)); + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[0].src.reg = tmp2; + noswizzle_PVSSRC(&(pAsm->S[0].src)); + setaddrmode_PVSSRC(&(pAsm->S[1].src), ADDR_ABSOLUTE); + pAsm->S[1].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[1].src.reg = 252; // SQ_ALU_SRC_0_5 + noswizzle_PVSSRC(&(pAsm->S[1].src)); + + next_ins(pAsm); + + /* tmp1.xy = temp2.xy */ + pAsm->D.dst.opcode = SQ_OP2_INST_MOV; + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = tmp1; + pAsm->D.dst.writex = 1; + pAsm->D.dst.writey = 1; + pAsm->D.dst.writez = 0; + pAsm->D.dst.writew = 0; + + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[0].src.reg = tmp2; + noswizzle_PVSSRC(&(pAsm->S[0].src)); + + next_ins(pAsm); + pAsm->aArgSubst[1] = tmp1; + need_barrier = GL_TRUE; + + } + + pAsm->D.dst.opcode = SQ_TEX_INST_SAMPLE; + pAsm->is_tex = GL_TRUE; + if ( GL_TRUE == need_barrier ) + { + pAsm->need_tex_barrier = GL_TRUE; + } + // Set src1 to tex unit id + pAsm->S[1].src.reg = pAsm->pILInst[pAsm->uiCurInst].TexSrcUnit; + pAsm->S[1].src.rtype = SRC_REG_TEMPORARY; + + //No sw info from mesa compiler, so hard code here. + pAsm->S[1].src.swizzlex = SQ_SEL_X; + pAsm->S[1].src.swizzley = SQ_SEL_Y; + pAsm->S[1].src.swizzlez = SQ_SEL_Z; + pAsm->S[1].src.swizzlew = SQ_SEL_W; + + if( GL_FALSE == tex_dst(pAsm) ) + { + return GL_FALSE; + } + + if( GL_FALSE == tex_src(pAsm) ) + { + return GL_FALSE; + } + + if(pAsm->pILInst[pAsm->uiCurInst].Opcode == OPCODE_TXP) + { + /* hopefully did swizzles before */ + noswizzle_PVSSRC(&(pAsm->S[0].src)); + } + + if(pAsm->pILInst[pAsm->uiCurInst].TexSrcTarget == TEXTURE_CUBE_INDEX) + { + /* SAMPLE dst, tmp.yxwy, CUBE */ + pAsm->S[0].src.swizzlex = SQ_SEL_Y; + pAsm->S[0].src.swizzley = SQ_SEL_X; + pAsm->S[0].src.swizzlez = SQ_SEL_W; + pAsm->S[0].src.swizzlew = SQ_SEL_Y; + } + + if ( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } + + return GL_TRUE; +} + +GLboolean assemble_XPD(r700_AssemblerBase *pAsm) +{ + BITS tmp; + + if( GL_FALSE == checkop2(pAsm) ) + { + return GL_FALSE; + } + + tmp = gethelpr(pAsm); + + pAsm->D.dst.opcode = SQ_OP2_INST_MUL; + + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = tmp; + nomask_PVSDST(&(pAsm->D.dst)); + + if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + { + return GL_FALSE; + } + + if( GL_FALSE == assemble_src(pAsm, 1, -1) ) + { + return GL_FALSE; + } + + swizzleagain_PVSSRC(&(pAsm->S[0].src), SQ_SEL_Z, SQ_SEL_X, SQ_SEL_Y, SQ_SEL_0); + swizzleagain_PVSSRC(&(pAsm->S[1].src), SQ_SEL_Y, SQ_SEL_Z, SQ_SEL_X, SQ_SEL_0); + + if( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } + + pAsm->D.dst.opcode = SQ_OP3_INST_MULADD; + pAsm->D.dst.op3 = 1; + + if(0xF != pAsm->pILInst[pAsm->uiCurInst].DstReg.WriteMask) + { + tmp = gethelpr(pAsm); + + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = tmp; + + nomask_PVSDST(&(pAsm->D.dst)); + } + else + { + if( GL_FALSE == assemble_dst(pAsm) ) + { + return GL_FALSE; + } + } + + if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + { + return GL_FALSE; + } + + if( GL_FALSE == assemble_src(pAsm, 1, -1) ) + { + return GL_FALSE; + } + + swizzleagain_PVSSRC(&(pAsm->S[0].src), SQ_SEL_Y, SQ_SEL_Z, SQ_SEL_X, SQ_SEL_0); + swizzleagain_PVSSRC(&(pAsm->S[1].src), SQ_SEL_Z, SQ_SEL_X, SQ_SEL_Y, SQ_SEL_0); + + // result1 + (neg) result0 + setaddrmode_PVSSRC(&(pAsm->S[2].src),ADDR_ABSOLUTE); + pAsm->S[2].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[2].src.reg = tmp; + + neg_PVSSRC(&(pAsm->S[2].src)); + noswizzle_PVSSRC(&(pAsm->S[2].src)); + + if( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } + + + if(0xF != pAsm->pILInst[pAsm->uiCurInst].DstReg.WriteMask) + { + if( GL_FALSE == assemble_dst(pAsm) ) + { + return GL_FALSE; + } + + pAsm->D.dst.opcode = SQ_OP2_INST_MOV; + + // Use tmp as source + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[0].src.reg = tmp; + + noneg_PVSSRC(&(pAsm->S[0].src)); + noswizzle_PVSSRC(&(pAsm->S[0].src)); + + if( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } + } + + return GL_TRUE; +} + +GLboolean assemble_EXPORT(r700_AssemblerBase *pAsm) +{ + return GL_TRUE; +} + +GLboolean jumpToOffest(r700_AssemblerBase *pAsm, GLuint pops, GLint offset) +{ + if(GL_FALSE == add_cf_instruction(pAsm) ) + { + return GL_FALSE; + } + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.pop_count = pops; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cond = SQ_CF_COND_ACTIVE; + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.end_of_program = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_inst = SQ_CF_INST_JUMP; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.whole_quad_mode = 0x0; + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.barrier = 0x1; + + pAsm->cf_current_cf_clause_ptr->m_Word0.f.addr = pAsm->cf_current_cf_clause_ptr->m_uIndex + offset; + + return GL_TRUE; +} + +GLboolean pops(r700_AssemblerBase *pAsm, GLuint pops) +{ + if(GL_FALSE == add_cf_instruction(pAsm) ) + { + return GL_FALSE; + } + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.pop_count = pops; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cond = SQ_CF_COND_ACTIVE; + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.end_of_program = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_inst = SQ_CF_INST_POP; + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.whole_quad_mode = 0x0; + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.barrier = 0x1; + pAsm->cf_current_cf_clause_ptr->m_Word0.f.addr = pAsm->cf_current_cf_clause_ptr->m_uIndex + 1; + + return GL_TRUE; +} + +GLboolean assemble_IF(r700_AssemblerBase *pAsm) +{ + if(GL_FALSE == add_cf_instruction(pAsm) ) + { + return GL_FALSE; + } + + if(GL_TRUE != bHasElse) + { + pAsm->cf_current_cf_clause_ptr->m_Word1.f.pop_count = 1; + } + else + { + pAsm->cf_current_cf_clause_ptr->m_Word1.f.pop_count = 0; + } + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cond = SQ_CF_COND_ACTIVE; + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.end_of_program = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_inst = SQ_CF_INST_JUMP; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.whole_quad_mode = 0x0; + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.barrier = 0x1; + + pAsm->FCSP++; + pAsm->fc_stack[pAsm->FCSP].type = FC_IF; + pAsm->fc_stack[pAsm->FCSP].bpush = 0; + pAsm->fc_stack[pAsm->FCSP].mid = NULL; + pAsm->fc_stack[pAsm->FCSP].midLen= 0; + pAsm->fc_stack[pAsm->FCSP].first = pAsm->cf_current_cf_clause_ptr; + + if(GL_TRUE != bHasElse) + { + pAsm->alu_x_opcode = SQ_CF_INST_ALU_POP_AFTER; + } + + pAsm->branch_depth++; + + if(pAsm->branch_depth > pAsm->max_branch_depth) + { + pAsm->max_branch_depth = pAsm->branch_depth; + } + return GL_TRUE; +} + +GLboolean assemble_ELSE(r700_AssemblerBase *pAsm) +{ + if(GL_FALSE == add_cf_instruction(pAsm) ) + { + return GL_FALSE; + } + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.pop_count = 1; /// + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cond = SQ_CF_COND_ACTIVE; - next_ins(pAsm); + pAsm->cf_current_cf_clause_ptr->m_Word1.f.end_of_program = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_inst = SQ_CF_INST_ELSE; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.whole_quad_mode = 0x0; - /* tmp1.xy = temp2.xy */ - pAsm->D.dst.opcode = SQ_OP2_INST_MOV; - setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); - pAsm->D.dst.rtype = DST_REG_TEMPORARY; - pAsm->D.dst.reg = tmp1; - pAsm->D.dst.writex = 1; - pAsm->D.dst.writey = 1; - pAsm->D.dst.writez = 0; - pAsm->D.dst.writew = 0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.barrier = 0x1; - setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); - pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; - pAsm->S[0].src.reg = tmp2; - noswizzle_PVSSRC(&(pAsm->S[0].src)); + pAsm->fc_stack[pAsm->FCSP].mid = (R700ControlFlowGenericClause **)_mesa_realloc( (void *)pAsm->fc_stack[pAsm->FCSP].mid, + 0, + sizeof(R700ControlFlowGenericClause *) ); + pAsm->fc_stack[pAsm->FCSP].mid[0] = pAsm->cf_current_cf_clause_ptr; + //pAsm->fc_stack[pAsm->FCSP].unNumMid = 1; - next_ins(pAsm); - pAsm->aArgSubst[1] = tmp1; - need_barrier = GL_TRUE; + pAsm->alu_x_opcode = SQ_CF_INST_ALU_POP_AFTER; + + pAsm->fc_stack[pAsm->FCSP].first->m_Word0.f.addr = pAsm->pR700Shader->plstCFInstructions_active->uNumOfNode - 1; + + return GL_TRUE; +} + +GLboolean assemble_ENDIF(r700_AssemblerBase *pAsm) +{ + pAsm->alu_x_opcode = SQ_CF_INST_ALU; + if(NULL == pAsm->fc_stack[pAsm->FCSP].mid) + { + /* no else in between */ + pAsm->fc_stack[pAsm->FCSP].first->m_Word0.f.addr = pAsm->pR700Shader->plstCFInstructions_active->uNumOfNode; + } + else + { + pAsm->fc_stack[pAsm->FCSP].mid[0]->m_Word0.f.addr = pAsm->pR700Shader->plstCFInstructions_active->uNumOfNode; } - pAsm->D.dst.opcode = SQ_TEX_INST_SAMPLE; - pAsm->is_tex = GL_TRUE; - if ( GL_TRUE == need_barrier ) + if(NULL != pAsm->fc_stack[pAsm->FCSP].mid) { - pAsm->need_tex_barrier = GL_TRUE; + FREE(pAsm->fc_stack[pAsm->FCSP].mid); } - // Set src1 to tex unit id - pAsm->S[1].src.reg = pAsm->pILInst[pAsm->uiCurInst].TexSrcUnit; - pAsm->S[1].src.rtype = SRC_REG_TEMPORARY; - //No sw info from mesa compiler, so hard code here. - pAsm->S[1].src.swizzlex = SQ_SEL_X; - pAsm->S[1].src.swizzley = SQ_SEL_Y; - pAsm->S[1].src.swizzlez = SQ_SEL_Z; - pAsm->S[1].src.swizzlew = SQ_SEL_W; + if(pAsm->fc_stack[pAsm->FCSP].type != FC_IF) + { + radeon_error("if/endif in shader code are not paired. \n"); + return GL_FALSE; + } + pAsm->branch_depth--; + pAsm->FCSP--; - if( GL_FALSE == tex_dst(pAsm) ) + return GL_TRUE; +} + +GLboolean assemble_BGNLOOP(r700_AssemblerBase *pAsm) +{ + if(GL_FALSE == add_cf_instruction(pAsm) ) { return GL_FALSE; } - if( GL_FALSE == tex_src(pAsm) ) + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.pop_count = 0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cond = SQ_CF_COND_ACTIVE; + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.end_of_program = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_inst = SQ_CF_INST_LOOP_START_NO_AL; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.whole_quad_mode = 0x0; + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.barrier = 0x1; + + pAsm->FCSP++; + pAsm->fc_stack[pAsm->FCSP].type = FC_LOOP; + pAsm->fc_stack[pAsm->FCSP].bpush = 1; + pAsm->fc_stack[pAsm->FCSP].mid = NULL; + pAsm->fc_stack[pAsm->FCSP].unNumMid = 0; + pAsm->fc_stack[pAsm->FCSP].midLen = 0; + pAsm->fc_stack[pAsm->FCSP].first = pAsm->cf_current_cf_clause_ptr; + + pAsm->branch_depth++; + + if(pAsm->branch_depth > pAsm->max_branch_depth) + { + pAsm->max_branch_depth = pAsm->branch_depth; + } + return GL_TRUE; +} + +GLboolean assemble_BRK(r700_AssemblerBase *pAsm) +{ +#ifdef USE_CF_FOR_CONTINUE_BREAK + unsigned int unFCSP; + for(unFCSP=pAsm->FCSP; unFCSP>0; unFCSP--) + { + if(FC_LOOP == pAsm->fc_stack[unFCSP].type) + { + break; + } + } + if(0 == FC_LOOP) { + radeon_error("Break is not inside loop/endloop pair.\n"); return GL_FALSE; } - if(pAsm->pILInst[pAsm->uiCurInst].Opcode == OPCODE_TXP) + if(GL_FALSE == add_cf_instruction(pAsm) ) { - /* hopefully did swizzles before */ - noswizzle_PVSSRC(&(pAsm->S[0].src)); + return GL_FALSE; } - - if(pAsm->pILInst[pAsm->uiCurInst].TexSrcTarget == TEXTURE_CUBE_INDEX) + + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.pop_count = 1; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cond = SQ_CF_COND_ACTIVE; + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.end_of_program = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_inst = SQ_CF_INST_LOOP_BREAK; + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.whole_quad_mode = 0x0; + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.barrier = 0x1; + + pAsm->fc_stack[unFCSP].mid = (R700ControlFlowGenericClause **)_mesa_realloc( + (void *)pAsm->fc_stack[unFCSP].mid, + sizeof(R700ControlFlowGenericClause *) * pAsm->fc_stack[unFCSP].unNumMid, + sizeof(R700ControlFlowGenericClause *) * (pAsm->fc_stack[unFCSP].unNumMid + 1) ); + pAsm->fc_stack[unFCSP].mid[pAsm->fc_stack[unFCSP].unNumMid] = pAsm->cf_current_cf_clause_ptr; + pAsm->fc_stack[unFCSP].unNumMid++; + + if(GL_FALSE == add_cf_instruction(pAsm) ) { - /* SAMPLE dst, tmp.yxwy, CUBE */ - pAsm->S[0].src.swizzlex = SQ_SEL_Y; - pAsm->S[0].src.swizzley = SQ_SEL_X; - pAsm->S[0].src.swizzlez = SQ_SEL_W; - pAsm->S[0].src.swizzlew = SQ_SEL_Y; + return GL_FALSE; } + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.pop_count = 1; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cond = SQ_CF_COND_ACTIVE; + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.end_of_program = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_inst = SQ_CF_INST_POP; - if ( GL_FALSE == next_ins(pAsm) ) - { - return GL_FALSE; - } + pAsm->cf_current_cf_clause_ptr->m_Word1.f.whole_quad_mode = 0x0; + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.barrier = 0x1; + pAsm->cf_current_cf_clause_ptr->m_Word0.f.addr = pAsm->cf_current_cf_clause_ptr->m_uIndex + 1; +#endif //USE_CF_FOR_CONTINUE_BREAK return GL_TRUE; } -GLboolean assemble_XPD(r700_AssemblerBase *pAsm) +GLboolean assemble_CONT(r700_AssemblerBase *pAsm) { - BITS tmp; +#ifdef USE_CF_FOR_CONTINUE_BREAK + unsigned int unFCSP; + for(unFCSP=pAsm->FCSP; unFCSP>0; unFCSP--) + { + if(FC_LOOP == pAsm->fc_stack[unFCSP].type) + { + break; + } + } + if(0 == FC_LOOP) + { + radeon_error("Continue is not inside loop/endloop pair.\n"); + return GL_FALSE; + } - if( GL_FALSE == checkop2(pAsm) ) + if(GL_FALSE == add_cf_instruction(pAsm) ) { - return GL_FALSE; + return GL_FALSE; } - tmp = gethelpr(pAsm); + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.pop_count = 1; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cond = SQ_CF_COND_ACTIVE; - pAsm->D.dst.opcode = SQ_OP2_INST_MUL; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.end_of_program = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_inst = SQ_CF_INST_LOOP_CONTINUE; + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.whole_quad_mode = 0x0; - setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); - pAsm->D.dst.rtype = DST_REG_TEMPORARY; - pAsm->D.dst.reg = tmp; - nomask_PVSDST(&(pAsm->D.dst)); - - if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + pAsm->cf_current_cf_clause_ptr->m_Word1.f.barrier = 0x1; + + pAsm->fc_stack[unFCSP].mid = (R700ControlFlowGenericClause **)_mesa_realloc( + (void *)pAsm->fc_stack[unFCSP].mid, + sizeof(R700ControlFlowGenericClause *) * pAsm->fc_stack[unFCSP].unNumMid, + sizeof(R700ControlFlowGenericClause *) * (pAsm->fc_stack[unFCSP].unNumMid + 1) ); + pAsm->fc_stack[unFCSP].mid[pAsm->fc_stack[unFCSP].unNumMid] = pAsm->cf_current_cf_clause_ptr; + pAsm->fc_stack[unFCSP].unNumMid++; + + if(GL_FALSE == add_cf_instruction(pAsm) ) { return GL_FALSE; } - if( GL_FALSE == assemble_src(pAsm, 1, -1) ) + pAsm->cf_current_cf_clause_ptr->m_Word1.f.pop_count = 1; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cond = SQ_CF_COND_ACTIVE; + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.end_of_program = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_inst = SQ_CF_INST_POP; + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.whole_quad_mode = 0x0; + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.barrier = 0x1; + pAsm->cf_current_cf_clause_ptr->m_Word0.f.addr = pAsm->cf_current_cf_clause_ptr->m_uIndex + 1; + +#endif /* USE_CF_FOR_CONTINUE_BREAK */ + + return GL_TRUE; +} + +GLboolean assemble_ENDLOOP(r700_AssemblerBase *pAsm) +{ + GLuint i; + + if(GL_FALSE == add_cf_instruction(pAsm) ) { return GL_FALSE; } - - swizzleagain_PVSSRC(&(pAsm->S[0].src), SQ_SEL_Z, SQ_SEL_X, SQ_SEL_Y, SQ_SEL_0); - swizzleagain_PVSSRC(&(pAsm->S[1].src), SQ_SEL_Y, SQ_SEL_Z, SQ_SEL_X, SQ_SEL_0); - if( GL_FALSE == next_ins(pAsm) ) + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.pop_count = 0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cond = SQ_CF_COND_ACTIVE; + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.end_of_program = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_inst = SQ_CF_INST_LOOP_END; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.whole_quad_mode = 0x0; + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.barrier = 0x1; + + pAsm->cf_current_cf_clause_ptr->m_Word0.f.addr = pAsm->fc_stack[pAsm->FCSP].first->m_uIndex + 1; + pAsm->fc_stack[pAsm->FCSP].first->m_Word0.f.addr = pAsm->cf_current_cf_clause_ptr->m_uIndex + 1; + +#ifdef USE_CF_FOR_CONTINUE_BREAK + for(i=0; ifc_stack[pAsm->FCSP].unNumMid; i++) + { + pAsm->fc_stack[pAsm->FCSP].mid[i]->m_Word0.f.addr = pAsm->cf_current_cf_clause_ptr->m_uIndex; + } + if(NULL != pAsm->fc_stack[pAsm->FCSP].mid) + { + FREE(pAsm->fc_stack[pAsm->FCSP].mid); + } +#endif + + if(pAsm->fc_stack[pAsm->FCSP].type != FC_LOOP) { + radeon_error("loop/endloop in shader code are not paired. \n"); return GL_FALSE; } - pAsm->D.dst.opcode = SQ_OP3_INST_MULADD; - pAsm->D.dst.op3 = 1; + unsigned int unFCSP = 0; + if((pAsm->unCFflags & HAS_CURRENT_LOOPRET) > 0) + { + for(unFCSP=(pAsm->FCSP-1); unFCSP>pAsm->CALLSTACK[pAsm->CALLSP].FCSP_BeforeEntry; unFCSP--) + { + if(FC_LOOP == pAsm->fc_stack[unFCSP].type) + { + break; + } + } + if(unFCSP <= pAsm->CALLSTACK[pAsm->CALLSP].FCSP_BeforeEntry) + { + unFCSP = 0; - if(0xF != pAsm->pILInst[pAsm->uiCurInst].DstReg.WriteMask) - { - tmp = gethelpr(pAsm); + returnOnFlag(pAsm); + pAsm->unCFflags &= ~HAS_CURRENT_LOOPRET; + } + } - setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); - pAsm->D.dst.rtype = DST_REG_TEMPORARY; - pAsm->D.dst.reg = tmp; + pAsm->branch_depth--; + pAsm->FCSP--; - nomask_PVSDST(&(pAsm->D.dst)); + if(unFCSP > 0) + { + breakLoopOnFlag(pAsm, unFCSP); } - else + + return GL_TRUE; +} + +void add_return_inst(r700_AssemblerBase *pAsm) +{ + if(GL_FALSE == add_cf_instruction(pAsm) ) { - if( GL_FALSE == assemble_dst(pAsm) ) + return GL_FALSE; + } + //pAsm->cf_current_cf_clause_ptr->m_Word1.f.pop_count = 1; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.pop_count = 0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cond = SQ_CF_COND_ACTIVE; + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.end_of_program = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_inst = SQ_CF_INST_RETURN; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.whole_quad_mode = 0x0; + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.barrier = 0x1; +} + +GLboolean assemble_BGNSUB(r700_AssemblerBase *pAsm, GLint nILindex) +{ + /* Put in sub */ + if( (pAsm->unSubArrayPointer + 1) > pAsm->unSubArraySize ) + { + pAsm->subs = (SUB_OFFSET*)_mesa_realloc( (void *)pAsm->subs, + sizeof(SUB_OFFSET) * pAsm->unSubArraySize, + sizeof(SUB_OFFSET) * (pAsm->unSubArraySize + 10) ); + if(NULL == pAsm->subs) { return GL_FALSE; } + pAsm->unSubArraySize += 10; } - if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + pAsm->subs[pAsm->unSubArrayPointer].subIL_Offset = nILindex; + pAsm->subs[pAsm->unSubArrayPointer].lstCFInstructions_local.pHead=NULL; + pAsm->subs[pAsm->unSubArrayPointer].lstCFInstructions_local.pTail=NULL; + pAsm->subs[pAsm->unSubArrayPointer].lstCFInstructions_local.uNumOfNode=0; + + pAsm->CALLSP++; + pAsm->CALLSTACK[pAsm->CALLSP].FCSP_BeforeEntry = pAsm->FCSP; + pAsm->CALLSTACK[pAsm->CALLSP].plstCFInstructions_local + = &(pAsm->subs[pAsm->unSubArrayPointer].lstCFInstructions_local); + SetActiveCFlist(pAsm->pR700Shader, + pAsm->CALLSTACK[pAsm->CALLSP].plstCFInstructions_local); + + pAsm->unSubArrayPointer++; + + /* start sub */ + pAsm->alu_x_opcode = SQ_CF_INST_ALU; + + return GL_TRUE; +} + +GLboolean assemble_ENDSUB(r700_AssemblerBase *pAsm) +{ + pAsm->CALLSP--; + SetActiveCFlist(pAsm->pR700Shader, + pAsm->CALLSTACK[pAsm->CALLSP].plstCFInstructions_local); + + pAsm->alu_x_opcode = SQ_CF_INST_ALU; + + return GL_TRUE; +} + +GLboolean assemble_RET(r700_AssemblerBase *pAsm) +{ + if(pAsm->CALLSP > 0) + { /* in sub */ + unsigned int unFCSP; + for(unFCSP=pAsm->FCSP; unFCSP>pAsm->CALLSTACK[pAsm->CALLSP].FCSP_BeforeEntry; unFCSP--) + { + if(FC_LOOP == pAsm->fc_stack[unFCSP].type) + { + setRetInLoopFlag(pAsm, SQ_SEL_1); + breakLoopOnFlag(pAsm, unFCSP); + pAsm->unCFflags |= LOOPRET_FLAGS; + + return GL_TRUE; + } + } + } + + add_return_inst(pAsm); + + return GL_TRUE; +} + +GLboolean assemble_CAL(r700_AssemblerBase *pAsm, + GLint nILindex, + GLuint uiNumberInsts, + struct prog_instruction *pILInst) +{ + pAsm->alu_x_opcode = SQ_CF_INST_ALU; + + if(GL_FALSE == add_cf_instruction(pAsm) ) { return GL_FALSE; } - if( GL_FALSE == assemble_src(pAsm, 1, -1) ) + pAsm->cf_current_cf_clause_ptr->m_Word1.f.call_count = 1; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.pop_count = 0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cond = SQ_CF_COND_ACTIVE; + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.end_of_program = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_inst = SQ_CF_INST_CALL; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.whole_quad_mode = 0x0; + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.barrier = 0x1; + + /* Put in caller */ + if( (pAsm->unCallerArrayPointer + 1) > pAsm->unCallerArraySize ) { - return GL_FALSE; + pAsm->callers = (CALLER_POINTER*)_mesa_realloc( (void *)pAsm->callers, + sizeof(CALLER_POINTER) * pAsm->unCallerArraySize, + sizeof(CALLER_POINTER) * (pAsm->unCallerArraySize + 10) ); + if(NULL == pAsm->callers) + { + return GL_FALSE; + } + pAsm->unCallerArraySize += 10; } - - swizzleagain_PVSSRC(&(pAsm->S[0].src), SQ_SEL_Y, SQ_SEL_Z, SQ_SEL_X, SQ_SEL_0); - swizzleagain_PVSSRC(&(pAsm->S[1].src), SQ_SEL_Z, SQ_SEL_X, SQ_SEL_Y, SQ_SEL_0); + + pAsm->callers[pAsm->unCallerArrayPointer].subIL_Offset = nILindex; + pAsm->callers[pAsm->unCallerArrayPointer].cf_ptr = pAsm->cf_current_cf_clause_ptr; - // result1 + (neg) result0 - setaddrmode_PVSSRC(&(pAsm->S[2].src),ADDR_ABSOLUTE); - pAsm->S[2].src.rtype = SRC_REG_TEMPORARY; - pAsm->S[2].src.reg = tmp; + pAsm->unCallerArrayPointer++; - neg_PVSSRC(&(pAsm->S[2].src)); - noswizzle_PVSSRC(&(pAsm->S[2].src)); + int j; + for(j=0; junSubArrayPointer; j++) + { + if(nILindex == pAsm->subs[j].subIL_Offset) + { /* compiled before */ + pAsm->callers[pAsm->unCallerArrayPointer - 1].subDescIndex = j; + return GL_TRUE; + } + } + + pAsm->callers[pAsm->unCallerArrayPointer - 1].subDescIndex = pAsm->unSubArrayPointer; + + return AssembleInstr(nILindex, uiNumberInsts, pILInst, pAsm); +} + +GLboolean setRetInLoopFlag(r700_AssemblerBase *pAsm, GLuint flagValue) +{ + GLfloat fLiteral[2] = {0.1, 0.0}; + + pAsm->D.dst.opcode = SQ_OP2_INST_MOV; + pAsm->D.dst.op3 = 0; + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = pAsm->flag_reg_index; + pAsm->D.dst.writex = 1; + pAsm->D.dst.writey = 0; + pAsm->D.dst.writez = 0; + pAsm->D.dst.writew = 0; + pAsm->D2.dst2.literal = 1; + pAsm->D2.dst2.SaturateMode = SATURATE_OFF; + pAsm->D.dst.predicated = 0; +#if 0 + pAsm->S[0].src.rtype = SRC_REC_LITERAL; + //pAsm->S[0].src.reg = 0; + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + noneg_PVSSRC(&(pAsm->S[0].src)); + pAsm->S[0].src.swizzlex = SQ_SEL_X; + pAsm->S[0].src.swizzley = SQ_SEL_Y; + pAsm->S[0].src.swizzlez = SQ_SEL_Z; + pAsm->S[0].src.swizzlew = SQ_SEL_W; + + if( GL_FALSE == next_ins_literal(pAsm, &(fLiteral[0])) ) + { + return GL_FALSE; + } +#else + pAsm->S[0].src.rtype = DST_REG_TEMPORARY; + pAsm->S[0].src.reg = 0; + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + noneg_PVSSRC(&(pAsm->S[0].src)); + pAsm->S[0].src.swizzlex = flagValue; + pAsm->S[0].src.swizzley = flagValue; + pAsm->S[0].src.swizzlez = flagValue; + pAsm->S[0].src.swizzlew = flagValue; - if( GL_FALSE == next_ins(pAsm) ) + if( GL_FALSE == next_ins2(pAsm) ) { return GL_FALSE; } +#endif + return GL_TRUE; +} - if(0xF != pAsm->pILInst[pAsm->uiCurInst].DstReg.WriteMask) - { - if( GL_FALSE == assemble_dst(pAsm) ) - { - return GL_FALSE; - } +GLboolean testFlag(r700_AssemblerBase *pAsm) +{ + GLfloat fLiteral[2] = {0.1, 0.0}; - pAsm->D.dst.opcode = SQ_OP2_INST_MOV; + //Test flag + GLuint tmp = gethelpr(pAsm); + pAsm->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; - // Use tmp as source - setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); - pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; - pAsm->S[0].src.reg = tmp; + pAsm->D.dst.opcode = SQ_OP2_INST_PRED_SETE; + pAsm->D.dst.math = 1; + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = tmp; + pAsm->D.dst.writex = 1; + pAsm->D.dst.writey = 0; + pAsm->D.dst.writez = 0; + pAsm->D.dst.writew = 0; + pAsm->D2.dst2.literal = 1; + pAsm->D2.dst2.SaturateMode = SATURATE_OFF; + pAsm->D.dst.predicated = 1; - noneg_PVSSRC(&(pAsm->S[0].src)); - noswizzle_PVSSRC(&(pAsm->S[0].src)); + pAsm->S[0].src.rtype = DST_REG_TEMPORARY; + pAsm->S[0].src.reg = pAsm->flag_reg_index; + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + noneg_PVSSRC(&(pAsm->S[0].src)); + pAsm->S[0].src.swizzlex = SQ_SEL_X; + pAsm->S[0].src.swizzley = SQ_SEL_Y; + pAsm->S[0].src.swizzlez = SQ_SEL_Z; + pAsm->S[0].src.swizzlew = SQ_SEL_W; +#if 0 + pAsm->S[1].src.rtype = SRC_REC_LITERAL; + //pAsm->S[1].src.reg = 0; + setaddrmode_PVSSRC(&(pAsm->S[1].src), ADDR_ABSOLUTE); + noneg_PVSSRC(&(pAsm->S[1].src)); + pAsm->S[1].src.swizzlex = SQ_SEL_X; + pAsm->S[1].src.swizzley = SQ_SEL_Y; + pAsm->S[1].src.swizzlez = SQ_SEL_Z; + pAsm->S[1].src.swizzlew = SQ_SEL_W; - if( GL_FALSE == next_ins(pAsm) ) - { - return GL_FALSE; - } + if( GL_FALSE == next_ins_literal(pAsm, &(fLiteral[0])) ) + { + return GL_FALSE; + } +#else + pAsm->S[1].src.rtype = DST_REG_TEMPORARY; + pAsm->S[1].src.reg = 0; + setaddrmode_PVSSRC(&(pAsm->S[1].src), ADDR_ABSOLUTE); + noneg_PVSSRC(&(pAsm->S[1].src)); + pAsm->S[1].src.swizzlex = SQ_SEL_1; + pAsm->S[1].src.swizzley = SQ_SEL_1; + pAsm->S[1].src.swizzlez = SQ_SEL_1; + pAsm->S[1].src.swizzlew = SQ_SEL_1; + + if( GL_FALSE == next_ins2(pAsm) ) + { + return GL_FALSE; } +#endif return GL_TRUE; } -GLboolean assemble_EXPORT(r700_AssemblerBase *pAsm) +GLboolean returnOnFlag(r700_AssemblerBase *pAsm) { - return GL_TRUE; -} + testFlag(pAsm); + jumpToOffest(pAsm, 1, 4); + setRetInLoopFlag(pAsm, SQ_SEL_0); + pops(pAsm, 1); + add_return_inst(pAsm); -GLboolean assemble_IF(r700_AssemblerBase *pAsm) -{ return GL_TRUE; } -GLboolean assemble_ENDIF(r700_AssemblerBase *pAsm) +GLboolean breakLoopOnFlag(r700_AssemblerBase *pAsm, GLuint unFCSP) { + testFlag(pAsm); + + //break + if(GL_FALSE == add_cf_instruction(pAsm) ) + { + return GL_FALSE; + } + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.pop_count = 1; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_const = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cond = SQ_CF_COND_ACTIVE; + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.end_of_program = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.valid_pixel_mode = 0x0; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.cf_inst = SQ_CF_INST_LOOP_BREAK; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.whole_quad_mode = 0x0; + + pAsm->cf_current_cf_clause_ptr->m_Word1.f.barrier = 0x1; + + pAsm->fc_stack[unFCSP].mid = (R700ControlFlowGenericClause **)_mesa_realloc( + (void *)pAsm->fc_stack[unFCSP].mid, + sizeof(R700ControlFlowGenericClause *) * pAsm->fc_stack[unFCSP].unNumMid, + sizeof(R700ControlFlowGenericClause *) * (pAsm->fc_stack[unFCSP].unNumMid + 1) ); + pAsm->fc_stack[unFCSP].mid[pAsm->fc_stack[unFCSP].unNumMid] = pAsm->cf_current_cf_clause_ptr; + pAsm->fc_stack[unFCSP].unNumMid++; + + pops(pAsm, 1); + return GL_TRUE; } -GLboolean AssembleInstr(GLuint uiNumberInsts, +GLboolean AssembleInstr(GLuint uiFirstInst, + GLuint uiNumberInsts, struct prog_instruction *pILInst, r700_AssemblerBase *pR700AsmCode) { GLuint i; pR700AsmCode->pILInst = pILInst; - for(i=0; iuiCurInst = i; +#ifndef USE_CF_FOR_CONTINUE_BREAK + if(OPCODE_BRK == pILInst[i+1].Opcode) + { + switch(pILInst[i].Opcode) + { + case OPCODE_SLE: + pILInst[i].Opcode = OPCODE_SGT; + break; + case OPCODE_SLT: + pILInst[i].Opcode = OPCODE_SGE; + break; + case OPCODE_SGE: + pILInst[i].Opcode = OPCODE_SLT; + break; + case OPCODE_SGT: + pILInst[i].Opcode = OPCODE_SLE; + break; + case OPCODE_SEQ: + pILInst[i].Opcode = OPCODE_SNE; + break; + case OPCODE_SNE: + pILInst[i].Opcode = OPCODE_SEQ; + break; + default: + break; + } + } +#endif + switch (pILInst[i].Opcode) { case OPCODE_ABS: @@ -4337,101 +5749,383 @@ GLboolean AssembleInstr(GLuint uiNumberInsts, return GL_FALSE; break; - case OPCODE_EX2: - if ( GL_FALSE == assemble_EX2(pR700AsmCode) ) - return GL_FALSE; - break; - case OPCODE_EXP: - if ( GL_FALSE == assemble_EXP(pR700AsmCode) ) - return GL_FALSE; + case OPCODE_EX2: + if ( GL_FALSE == assemble_EX2(pR700AsmCode) ) + return GL_FALSE; + break; + case OPCODE_EXP: + if ( GL_FALSE == assemble_EXP(pR700AsmCode) ) + return GL_FALSE; + break; + + case OPCODE_FLR: + if ( GL_FALSE == assemble_FLR(pR700AsmCode) ) + return GL_FALSE; + break; + //case OP_FLR_INT: + // if ( GL_FALSE == assemble_FLR_INT() ) + // return GL_FALSE; + // break; + + case OPCODE_FRC: + if ( GL_FALSE == assemble_FRC(pR700AsmCode) ) + return GL_FALSE; + break; + + case OPCODE_KIL: + if ( GL_FALSE == assemble_KIL(pR700AsmCode) ) + return GL_FALSE; + break; + case OPCODE_LG2: + if ( GL_FALSE == assemble_LG2(pR700AsmCode) ) + return GL_FALSE; + break; + case OPCODE_LIT: + if ( GL_FALSE == assemble_LIT(pR700AsmCode) ) + return GL_FALSE; + break; + case OPCODE_LRP: + if ( GL_FALSE == assemble_LRP(pR700AsmCode) ) + return GL_FALSE; + break; + case OPCODE_LOG: + if ( GL_FALSE == assemble_LOG(pR700AsmCode) ) + return GL_FALSE; + break; + + case OPCODE_MAD: + if ( GL_FALSE == assemble_MAD(pR700AsmCode) ) + return GL_FALSE; + break; + case OPCODE_MAX: + if ( GL_FALSE == assemble_MAX(pR700AsmCode) ) + return GL_FALSE; + break; + case OPCODE_MIN: + if ( GL_FALSE == assemble_MIN(pR700AsmCode) ) + return GL_FALSE; + break; + + case OPCODE_MOV: + if ( GL_FALSE == assemble_MOV(pR700AsmCode) ) + return GL_FALSE; + break; + case OPCODE_MUL: + if ( GL_FALSE == assemble_MUL(pR700AsmCode) ) + return GL_FALSE; + break; + + case OPCODE_POW: + if ( GL_FALSE == assemble_POW(pR700AsmCode) ) + return GL_FALSE; + break; + case OPCODE_RCP: + if ( GL_FALSE == assemble_RCP(pR700AsmCode) ) + return GL_FALSE; + break; + case OPCODE_RSQ: + if ( GL_FALSE == assemble_RSQ(pR700AsmCode) ) + return GL_FALSE; + break; + case OPCODE_SIN: + if ( GL_FALSE == assemble_SIN(pR700AsmCode) ) + return GL_FALSE; + break; + case OPCODE_SCS: + if ( GL_FALSE == assemble_SCS(pR700AsmCode) ) + return GL_FALSE; + break; + + case OPCODE_SEQ: + if(OPCODE_IF == pILInst[i+1].Opcode) + { + pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; + if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETE) ) + { + return GL_FALSE; + } + } + else if(OPCODE_BRK == pILInst[i+1].Opcode) + { +#ifdef USE_CF_FOR_CONTINUE_BREAK + pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; +#else + pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_BREAK; +#endif + if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETE) ) + { + return GL_FALSE; + } + } + else if(OPCODE_CONT == pILInst[i+1].Opcode) + { +#ifdef USE_CF_FOR_CONTINUE_BREAK + pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; +#else + pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_CONTINUE; +#endif + if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETE) ) + { + return GL_FALSE; + } + } + else + { + if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETE) ) + { + return GL_FALSE; + } + } + break; + + case OPCODE_SGT: + if(OPCODE_IF == pILInst[i+1].Opcode) + { + pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; + if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGT) ) + { + return GL_FALSE; + } + } + else if(OPCODE_BRK == pILInst[i+1].Opcode) + { +#ifdef USE_CF_FOR_CONTINUE_BREAK + pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; +#else + pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_BREAK; +#endif + if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGT) ) + { + return GL_FALSE; + } + } + else if(OPCODE_CONT == pILInst[i+1].Opcode) + { +#ifdef USE_CF_FOR_CONTINUE_BREAK + pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; +#else + pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_CONTINUE; +#endif + + if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGT) ) + { + return GL_FALSE; + } + } + else + { + if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETGT) ) + { + return GL_FALSE; + } + } + break; + + case OPCODE_SGE: + if(OPCODE_IF == pILInst[i+1].Opcode) + { + pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; + if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGE) ) + { + return GL_FALSE; + } + } + else if(OPCODE_BRK == pILInst[i+1].Opcode) + { +#ifdef USE_CF_FOR_CONTINUE_BREAK + pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; +#else + pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_BREAK; +#endif + if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGE) ) + { + return GL_FALSE; + } + } + else if(OPCODE_CONT == pILInst[i+1].Opcode) + { +#ifdef USE_CF_FOR_CONTINUE_BREAK + pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; +#else + pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_CONTINUE; +#endif + + if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGE) ) + { + return GL_FALSE; + } + } + else + { + if ( GL_FALSE == assemble_SGE(pR700AsmCode) ) + { + return GL_FALSE; + } + } + break; + + /* NO LT, LE, TODO : use GE => LE, GT => LT : reverse 2 src order would be simpliest. Or use SQ_CF_COND_FALSE for SQ_CF_COND_ACTIVE.*/ + case OPCODE_SLT: + { + struct prog_src_register SrcRegSave[2]; + SrcRegSave[0] = pILInst[i].SrcReg[0]; + SrcRegSave[1] = pILInst[i].SrcReg[1]; + pILInst[i].SrcReg[0] = SrcRegSave[1]; + pILInst[i].SrcReg[1] = SrcRegSave[0]; + if(OPCODE_IF == pILInst[i+1].Opcode) + { + pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; + if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGT) ) + { + pILInst[i].SrcReg[0] = SrcRegSave[0]; + pILInst[i].SrcReg[1] = SrcRegSave[1]; + return GL_FALSE; + } + } + else if(OPCODE_BRK == pILInst[i+1].Opcode) + { +#ifdef USE_CF_FOR_CONTINUE_BREAK + pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; +#else + pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_BREAK; +#endif + if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGT) ) + { + pILInst[i].SrcReg[0] = SrcRegSave[0]; + pILInst[i].SrcReg[1] = SrcRegSave[1]; + return GL_FALSE; + } + } + else if(OPCODE_CONT == pILInst[i+1].Opcode) + { +#ifdef USE_CF_FOR_CONTINUE_BREAK + pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; +#else + pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_CONTINUE; +#endif + + if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGT) ) + { + pILInst[i].SrcReg[0] = SrcRegSave[0]; + pILInst[i].SrcReg[1] = SrcRegSave[1]; + return GL_FALSE; + } + } + else + { + if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETGT) ) + { + pILInst[i].SrcReg[0] = SrcRegSave[0]; + pILInst[i].SrcReg[1] = SrcRegSave[1]; + return GL_FALSE; + } + } + pILInst[i].SrcReg[0] = SrcRegSave[0]; + pILInst[i].SrcReg[1] = SrcRegSave[1]; + } break; - case OPCODE_FLR: - if ( GL_FALSE == assemble_FLR(pR700AsmCode) ) - return GL_FALSE; - break; - //case OP_FLR_INT: - // if ( GL_FALSE == assemble_FLR_INT() ) - // return GL_FALSE; - // break; - - case OPCODE_FRC: - if ( GL_FALSE == assemble_FRC(pR700AsmCode) ) - return GL_FALSE; - break; + case OPCODE_SLE: + { + struct prog_src_register SrcRegSave[2]; + SrcRegSave[0] = pILInst[i].SrcReg[0]; + SrcRegSave[1] = pILInst[i].SrcReg[1]; + pILInst[i].SrcReg[0] = SrcRegSave[1]; + pILInst[i].SrcReg[1] = SrcRegSave[0]; + if(OPCODE_IF == pILInst[i+1].Opcode) + { + pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; + if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGE) ) + { + pILInst[i].SrcReg[0] = SrcRegSave[0]; + pILInst[i].SrcReg[1] = SrcRegSave[1]; + return GL_FALSE; + } + } + else if(OPCODE_BRK == pILInst[i+1].Opcode) + { +#ifdef USE_CF_FOR_CONTINUE_BREAK + pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; +#else + pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_BREAK; +#endif + if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGE) ) + { + pILInst[i].SrcReg[0] = SrcRegSave[0]; + pILInst[i].SrcReg[1] = SrcRegSave[1]; + return GL_FALSE; + } + } + else if(OPCODE_CONT == pILInst[i+1].Opcode) + { +#ifdef USE_CF_FOR_CONTINUE_BREAK + pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; +#else + pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_CONTINUE; +#endif - case OPCODE_KIL: - if ( GL_FALSE == assemble_KIL(pR700AsmCode) ) - return GL_FALSE; - break; - case OPCODE_LG2: - if ( GL_FALSE == assemble_LG2(pR700AsmCode) ) - return GL_FALSE; - break; - case OPCODE_LIT: - if ( GL_FALSE == assemble_LIT(pR700AsmCode) ) - return GL_FALSE; - break; - case OPCODE_LRP: - if ( GL_FALSE == assemble_LRP(pR700AsmCode) ) - return GL_FALSE; - break; - case OPCODE_LOG: - if ( GL_FALSE == assemble_LOG(pR700AsmCode) ) - return GL_FALSE; + if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGE) ) + { + pILInst[i].SrcReg[0] = SrcRegSave[0]; + pILInst[i].SrcReg[1] = SrcRegSave[1]; + return GL_FALSE; + } + } + else + { + if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETGE) ) + { + pILInst[i].SrcReg[0] = SrcRegSave[0]; + pILInst[i].SrcReg[1] = SrcRegSave[1]; + return GL_FALSE; + } + } + pILInst[i].SrcReg[0] = SrcRegSave[0]; + pILInst[i].SrcReg[1] = SrcRegSave[1]; + } break; - case OPCODE_MAD: - if ( GL_FALSE == assemble_MAD(pR700AsmCode) ) - return GL_FALSE; - break; - case OPCODE_MAX: - if ( GL_FALSE == assemble_MAX(pR700AsmCode) ) - return GL_FALSE; - break; - case OPCODE_MIN: - if ( GL_FALSE == assemble_MIN(pR700AsmCode) ) - return GL_FALSE; - break; - - case OPCODE_MOV: - if ( GL_FALSE == assemble_MOV(pR700AsmCode) ) - return GL_FALSE; - break; - case OPCODE_MUL: - if ( GL_FALSE == assemble_MUL(pR700AsmCode) ) - return GL_FALSE; - break; - - case OPCODE_POW: - if ( GL_FALSE == assemble_POW(pR700AsmCode) ) - return GL_FALSE; - break; - case OPCODE_RCP: - if ( GL_FALSE == assemble_RCP(pR700AsmCode) ) - return GL_FALSE; - break; - case OPCODE_RSQ: - if ( GL_FALSE == assemble_RSQ(pR700AsmCode) ) - return GL_FALSE; - break; - case OPCODE_SIN: - if ( GL_FALSE == assemble_SIN(pR700AsmCode) ) - return GL_FALSE; - break; - case OPCODE_SCS: - if ( GL_FALSE == assemble_SCS(pR700AsmCode) ) - return GL_FALSE; - break; - - case OPCODE_SGE: - if ( GL_FALSE == assemble_SGE(pR700AsmCode) ) - return GL_FALSE; - break; - case OPCODE_SLT: - if ( GL_FALSE == assemble_SLT(pR700AsmCode) ) - return GL_FALSE; - break; + case OPCODE_SNE: + if(OPCODE_IF == pILInst[i+1].Opcode) + { + pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; + if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETNE) ) + { + return GL_FALSE; + } + } + else if(OPCODE_BRK == pILInst[i+1].Opcode) + { +#ifdef USE_CF_FOR_CONTINUE_BREAK + pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; +#else + pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_BREAK; +#endif + if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETNE) ) + { + return GL_FALSE; + } + } + else if(OPCODE_CONT == pILInst[i+1].Opcode) + { +#ifdef USE_CF_FOR_CONTINUE_BREAK + pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; +#else + pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_CONTINUE; +#endif + if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETNE) ) + { + return GL_FALSE; + } + } + else + { + if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETNE) ) + { + return GL_FALSE; + } + } + break; //case OP_STP: // if ( GL_FALSE == assemble_STP(pR700AsmCode) ) @@ -4471,24 +6165,91 @@ GLboolean AssembleInstr(GLuint uiNumberInsts, break; case OPCODE_IF : - if ( GL_FALSE == assemble_IF(pR700AsmCode) ) - return GL_FALSE; + { + GLboolean bHasElse = GL_FALSE; + + if(pILInst[pILInst[i].BranchTarget - 1].Opcode == OPCODE_ELSE) + { + bHasElse = GL_TRUE; + } + + if ( GL_FALSE == assemble_IF(pR700AsmCode, bHasElse) ) + { + return GL_FALSE; + } + } break; + case OPCODE_ELSE : - radeon_error("Not yet implemented instruction OPCODE_ELSE \n"); - //if ( GL_FALSE == assemble_BAD("ELSE") ) + if ( GL_FALSE == assemble_ELSE(pR700AsmCode) ) return GL_FALSE; break; + case OPCODE_ENDIF: if ( GL_FALSE == assemble_ENDIF(pR700AsmCode) ) return GL_FALSE; break; + case OPCODE_BGNLOOP: + if( GL_FALSE == assemble_BGNLOOP(pR700AsmCode) ) + { + return GL_FALSE; + } + break; + + case OPCODE_BRK: + if( GL_FALSE == assemble_BRK(pR700AsmCode) ) + { + return GL_FALSE; + } + break; + + case OPCODE_CONT: + if( GL_FALSE == assemble_CONT(pR700AsmCode) ) + { + return GL_FALSE; + } + break; + + case OPCODE_ENDLOOP: + if( GL_FALSE == assemble_ENDLOOP(pR700AsmCode) ) + { + return GL_FALSE; + } + break; + + case OPCODE_BGNSUB: + if( GL_FALSE == assemble_BGNSUB(pR700AsmCode, i) ) + { + return GL_FALSE; + } + break; + + case OPCODE_RET: + if( GL_FALSE == assemble_RET(pR700AsmCode) ) + { + return GL_FALSE; + } + break; + + case OPCODE_CAL: + if( GL_FALSE == assemble_CAL(pR700AsmCode, + pILInst[i].BranchTarget, + uiNumberInsts, + pILInst) ) + { + return GL_FALSE; + } + break; + //case OPCODE_EXPORT: // if ( GL_FALSE == assemble_EXPORT() ) // return GL_FALSE; // break; + case OPCODE_ENDSUB: + return assemble_ENDSUB(pR700AsmCode); + case OPCODE_END: //pR700AsmCode->uiCurInst = i; //This is to remaind that if in later exoort there is depth/stencil @@ -4505,6 +6266,116 @@ GLboolean AssembleInstr(GLuint uiNumberInsts, return GL_TRUE; } +GLboolean InitShaderProgram(r700_AssemblerBase * pAsm) +{ + setRetInLoopFlag(pAsm, SQ_SEL_0); + return GL_TRUE; +} + +GLboolean RelocProgram(r700_AssemblerBase * pAsm) +{ + GLuint i; + GLuint unCFoffset; + TypedShaderList * plstCFmain; + TypedShaderList * plstCFsub; + + R700ShaderInstruction * pInst; + R700ControlFlowGenericClause * pCFInst; + + if(0 == pAsm->unSubArrayPointer) + { + return GL_TRUE; + } + + plstCFmain = pAsm->CALLSTACK[0].plstCFInstructions_local; + unCFoffset = plstCFmain->uNumOfNode; + + /* Reloc subs */ + for(i=0; iunSubArrayPointer; i++) + { + pAsm->subs[i].unCFoffset = unCFoffset; + plstCFsub = &(pAsm->subs[i].lstCFInstructions_local); + + pInst = plstCFsub->pHead; + + /* reloc instructions */ + while(pInst) + { + if(SIT_CF_GENERIC == pInst->m_ShaderInstType) + { + pCFInst = (R700ControlFlowGenericClause *)pInst; + + switch (pCFInst->m_Word1.f.cf_inst) + { + case SQ_CF_INST_POP: + case SQ_CF_INST_JUMP: + case SQ_CF_INST_ELSE: + case SQ_CF_INST_LOOP_END: + case SQ_CF_INST_LOOP_START: + case SQ_CF_INST_LOOP_START_NO_AL: + case SQ_CF_INST_LOOP_CONTINUE: + case SQ_CF_INST_LOOP_BREAK: + pCFInst->m_Word0.f.addr += unCFoffset; + break; + default: + break; + } + } + + pInst->m_uIndex += unCFoffset; + + pInst = pInst->pNextInst; + }; + + /* Put sub into main */ + plstCFmain->pTail->pNextInst = plstCFsub->pHead; + plstCFmain->pTail = plstCFsub->pTail; + plstCFmain->uNumOfNode += plstCFsub->uNumOfNode; + + unCFoffset += plstCFsub->uNumOfNode; + } + + /* reloc callers */ + for(i=0; iunCallerArrayPointer; i++) + { + pAsm->callers[i].cf_ptr->m_Word0.f.addr + = pAsm->subs[pAsm->callers[i].subDescIndex].unCFoffset; + } + + /* remove flags init if they are not used */ + if((pAsm->unCFflags & HAS_LOOPRET) == 0) + { + R700ControlFlowALUClause * pCF_ALU; + pInst = plstCFmain->pHead; + while(pInst) + { + if(SIT_CF_ALU == pInst->m_ShaderInstType) + { + pCF_ALU = (R700ControlFlowALUClause *)pInst; + if(1 == pCF_ALU->m_Word1.f.count) + { + pCF_ALU->m_Word1.f.cf_inst = SQ_CF_INST_NOP; + } + else + { + R700ALUInstruction * pALU = pCF_ALU->m_pLinkedALUInstruction; + + pALU->m_pLinkedALUClause = NULL; + pALU = (R700ALUInstruction *)(pALU->pNextInst); + pALU->m_pLinkedALUClause = pCF_ALU; + pCF_ALU->m_pLinkedALUInstruction = pALU; + + pCF_ALU->m_Word1.f.count--; + } + break; + } + pInst = pInst->pNextInst; + }; + } + + return GL_TRUE; +} + GLboolean Process_Export(r700_AssemblerBase* pAsm, GLuint type, GLuint export_starting_index, @@ -4800,6 +6671,25 @@ GLboolean Process_Vertex_Exports(r700_AssemblerBase *pR700AsmCode, } } + for(i=VERT_RESULT_VAR0; iucVP_OutputMap[i], + GL_FALSE) ) + { + return GL_FALSE; + } + + export_starting_index++; + } + } + // At least one param should be exported if (export_count) { @@ -4833,6 +6723,16 @@ GLboolean Clean_Up_Assembler(r700_AssemblerBase *pR700AsmCode) { FREE(pR700AsmCode->pucOutMask); FREE(pR700AsmCode->pInstDeps); + + if(NULL != pR700AsmCode->subs) + { + FREE(pR700AsmCode->subs); + } + if(NULL != pR700AsmCode->callers) + { + FREE(pR700AsmCode->callers); + } + return GL_TRUE; } diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index c66db502a1..85d32212c0 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -72,7 +72,8 @@ typedef enum SrcRegisterType SRC_REG_INPUT = 1, SRC_REG_CONSTANT = 2, SRC_REG_ALT_TEMPORARY = 3, - NUMBER_OF_SRC_REG_TYPE = 4 + SRC_REC_LITERAL = 4, + NUMBER_OF_SRC_REG_TYPE = 5 } SrcRegisterType; typedef enum DstRegisterType @@ -111,6 +112,12 @@ typedef struct PVSDSTtag BITS addrmode1:1; //32 } PVSDST; +typedef struct PVSINSTtag +{ + BITS literal :2; + BITS SaturateMode :2; +} PVSINST; + typedef struct PVSSRCtag { BITS rtype:4; @@ -148,6 +155,7 @@ typedef union PVSDWORDtag { BITS bits; PVSDST dst; + PVSINST dst2; PVSSRC src; PVSMATH math; float f; @@ -263,14 +271,15 @@ enum typedef struct FC_LEVEL { - unsigned int first; ///< first fc instruction on level (if, rep, loop) - unsigned int* mid; ///< middle instructions - else or all breaks on this level - unsigned int midLen; - unsigned int type; - unsigned int cond; - unsigned int inv; - unsigned int bpush; ///< 1 if first instruction does branch stack push - int id; ///< id of bool or int variable + R700ControlFlowGenericClause * first; + R700ControlFlowGenericClause ** mid; + unsigned int unNumMid; + unsigned int midLen; + unsigned int type; + unsigned int cond; + unsigned int inv; + unsigned int bpush; ///< 1 if first instruction does branch stack push + int id; ///< id of bool or int variable } FC_LEVEL; typedef struct VTX_FETCH_METHOD @@ -279,6 +288,28 @@ typedef struct VTX_FETCH_METHOD GLuint mega_fetch_remainder; } VTX_FETCH_METHOD; +typedef struct SUB_OFFSET +{ + GLint subIL_Offset; + GLuint unCFoffset; + TypedShaderList lstCFInstructions_local; +} SUB_OFFSET; + +typedef struct CALLER_POINTER +{ + GLint subIL_Offset; + GLint subDescIndex; + R700ControlFlowGenericClause* cf_ptr; +} CALLER_POINTER; + +#define SQ_MAX_CALL_DEPTH 0x00000020 + +typedef struct CALL_LEVEL +{ + unsigned int FCSP_BeforeEntry; + TypedShaderList * plstCFInstructions_local; +} CALL_LEVEL; + typedef struct r700_AssemblerBase { R700ControlFlowSXClause* cf_last_export_ptr; @@ -294,11 +325,14 @@ typedef struct r700_AssemblerBase // No clause has been created yet CF_CLAUSE_TYPE cf_current_clause_type; + BITS alu_x_opcode; + GLuint number_of_exports; GLuint number_of_colorandz_exports; GLuint number_of_export_opcodes; PVSDWORD D; + PVSDWORD D2; PVSDWORD S[3]; unsigned int uLastPosUpdate; @@ -310,6 +344,8 @@ typedef struct r700_AssemblerBase unsigned int number_used_registers; unsigned int uUsedConsts; + unsigned int flag_reg_index; + // Fragment programs unsigned int uiFP_AttributeMap[FRAG_ATTRIB_MAX]; unsigned int uiFP_OutputMap[FRAG_RESULT_MAX]; @@ -378,6 +414,18 @@ typedef struct r700_AssemblerBase GLboolean is_tex; /* we inserted helper intructions and need barrier on next TEX ins */ GLboolean need_tex_barrier; + + SUB_OFFSET * subs; + GLuint unSubArraySize; + GLuint unSubArrayPointer; + CALLER_POINTER * callers; + GLuint unCallerArraySize; + GLuint unCallerArrayPointer; + unsigned int CALLSP; + CALL_LEVEL CALLSTACK[SQ_MAX_CALL_DEPTH]; + + GLuint unCFflags; + } r700_AssemblerBase; //Internal use @@ -446,6 +494,10 @@ GLboolean assemble_alu_src(R700ALUInstruction* alu_instruction_ptr, GLboolean add_alu_instruction(r700_AssemblerBase* pAsm, R700ALUInstruction* alu_instruction_ptr, GLuint contiguous_slots_needed); + +GLboolean add_cf_instruction(r700_AssemblerBase* pAsm); +void add_return_inst(r700_AssemblerBase *pAsm); + void get_src_properties(R700ALUInstruction* alu_instruction_ptr, int source_index, BITS* psrc_sel, @@ -467,6 +519,21 @@ GLboolean check_vector(r700_AssemblerBase* pAsm, R700ALUInstruction* alu_instruction_ptr); GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm); GLboolean next_ins(r700_AssemblerBase *pAsm); + +GLboolean next_ins2(r700_AssemblerBase *pAsm); +GLboolean assemble_alu_instruction2(r700_AssemblerBase *pAsm); + +/* TODO : merge next_ins/2/literal, assemble_alu_instruction/2/literal */ +GLboolean next_ins_literal(r700_AssemblerBase *pAsm, GLfloat * pLiteral); +GLboolean assemble_alu_instruction_literal(r700_AssemblerBase *pAsm, GLfloat * pLiteral); + +GLboolean pops(r700_AssemblerBase *pAsm, GLuint pops); +GLboolean jumpToOffest(r700_AssemblerBase *pAsm, GLuint pops, GLint offset); +GLboolean setRetInLoopFlag(r700_AssemblerBase *pAsm, GLuint flagValue); +GLboolean testFlag(r700_AssemblerBase *pAsm); +GLboolean breakLoopOnFlag(r700_AssemblerBase *pAsm, GLuint unFCSP); +GLboolean returnOnFlag(r700_AssemblerBase *pAsm); + GLboolean assemble_math_function(r700_AssemblerBase* pAsm, BITS opcode); GLboolean assemble_ABS(r700_AssemblerBase *pAsm); GLboolean assemble_ADD(r700_AssemblerBase *pAsm); @@ -497,14 +564,32 @@ GLboolean assemble_RSQ(r700_AssemblerBase *pAsm); GLboolean assemble_SIN(r700_AssemblerBase *pAsm); GLboolean assemble_SCS(r700_AssemblerBase *pAsm); GLboolean assemble_SGE(r700_AssemblerBase *pAsm); + +GLboolean assemble_LOGIC(r700_AssemblerBase *pAsm, BITS opcode); +GLboolean assemble_LOGIC_PRED(r700_AssemblerBase *pAsm, BITS opcode); + GLboolean assemble_SLT(r700_AssemblerBase *pAsm); GLboolean assemble_STP(r700_AssemblerBase *pAsm); GLboolean assemble_TEX(r700_AssemblerBase *pAsm); GLboolean assemble_XPD(r700_AssemblerBase *pAsm); GLboolean assemble_EXPORT(r700_AssemblerBase *pAsm); -GLboolean assemble_IF(r700_AssemblerBase *pAsm); +GLboolean assemble_IF(r700_AssemblerBase *pAsm, GLboolean bHasElse); +GLboolean assemble_ELSE(r700_AssemblerBase *pAsm); GLboolean assemble_ENDIF(r700_AssemblerBase *pAsm); +GLboolean assemble_BGNLOOP(r700_AssemblerBase *pAsm); +GLboolean assemble_BRK(r700_AssemblerBase *pAsm); +GLboolean assemble_COND(r700_AssemblerBase *pAsm); +GLboolean assemble_ENDLOOP(r700_AssemblerBase *pAsm); + +GLboolean assemble_BGNSUB(r700_AssemblerBase *pAsm, GLint nILindex); +GLboolean assemble_ENDSUB(r700_AssemblerBase *pAsm); +GLboolean assemble_RET(r700_AssemblerBase *pAsm); +GLboolean assemble_CAL(r700_AssemblerBase *pAsm, + GLint nILindex, + GLuint uiNumberInsts, + struct prog_instruction *pILInst); + GLboolean Process_Export(r700_AssemblerBase* pAsm, GLuint type, GLuint export_starting_index, @@ -516,12 +601,16 @@ GLboolean Move_Depth_Exports_To_Correct_Channels(r700_AssemblerBase *pAsm, //Interface -GLboolean AssembleInstr(GLuint uiNumberInsts, +GLboolean AssembleInstr(GLuint uiFirstInst, + GLuint uiNumberInsts, struct prog_instruction *pILInst, r700_AssemblerBase *pR700AsmCode); GLboolean Process_Fragment_Exports(r700_AssemblerBase *pR700AsmCode, GLbitfield OutputsWritten); GLboolean Process_Vertex_Exports(r700_AssemblerBase *pR700AsmCode, GLbitfield OutputsWritten); +GLboolean RelocProgram(r700_AssemblerBase * pAsm); +GLboolean InitShaderProgram(r700_AssemblerBase * pAsm); + int Init_r700_AssemblerBase(SHADER_PIPE_TYPE spt, r700_AssemblerBase* pAsm, R700_Shader* pShader); GLboolean Clean_Up_Assembler(r700_AssemblerBase *pR700AsmCode); diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index ec76fbcb6d..197916ac0d 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -442,68 +442,77 @@ static void r700SendRenderTargetState(GLcontext *ctx, struct radeon_state_atom * static void r700SendPSState(GLcontext *ctx, struct radeon_state_atom *atom) { - context_t *context = R700_CONTEXT(ctx); - R700_CHIP_CONTEXT *r700 = R700_CONTEXT_STATES(context); - struct radeon_bo * pbo; - BATCH_LOCALS(&context->radeon); - radeon_print(RADEON_STATE, RADEON_VERBOSE, "%s\n", __func__); + context_t *context = R700_CONTEXT(ctx); + R700_CHIP_CONTEXT *r700 = R700_CONTEXT_STATES(context); + struct radeon_bo * pbo; + BATCH_LOCALS(&context->radeon); + radeon_print(RADEON_STATE, RADEON_VERBOSE, "%s\n", __func__); - pbo = (struct radeon_bo *)r700GetActiveFpShaderBo(GL_CONTEXT(context)); + pbo = (struct radeon_bo *)r700GetActiveFpShaderBo(GL_CONTEXT(context)); - if (!pbo) - return; + if (!pbo) + return; - r700SyncSurf(context, pbo, RADEON_GEM_DOMAIN_GTT, 0, SH_ACTION_ENA_bit); + r700SyncSurf(context, pbo, RADEON_GEM_DOMAIN_GTT, 0, SH_ACTION_ENA_bit); - BEGIN_BATCH_NO_AUTOSTATE(3 + 2); - R600_OUT_BATCH_REGSEQ(SQ_PGM_START_PS, 1); - R600_OUT_BATCH(r700->ps.SQ_PGM_START_PS.u32All); - R600_OUT_BATCH_RELOC(r700->ps.SQ_PGM_START_PS.u32All, - pbo, - r700->ps.SQ_PGM_START_PS.u32All, - RADEON_GEM_DOMAIN_GTT, 0, 0); - END_BATCH(); + BEGIN_BATCH_NO_AUTOSTATE(3 + 2); + R600_OUT_BATCH_REGSEQ(SQ_PGM_START_PS, 1); + R600_OUT_BATCH(r700->ps.SQ_PGM_START_PS.u32All); + R600_OUT_BATCH_RELOC(r700->ps.SQ_PGM_START_PS.u32All, + pbo, + r700->ps.SQ_PGM_START_PS.u32All, + RADEON_GEM_DOMAIN_GTT, 0, 0); + END_BATCH(); - BEGIN_BATCH_NO_AUTOSTATE(9); - R600_OUT_BATCH_REGVAL(SQ_PGM_RESOURCES_PS, r700->ps.SQ_PGM_RESOURCES_PS.u32All); - R600_OUT_BATCH_REGVAL(SQ_PGM_EXPORTS_PS, r700->ps.SQ_PGM_EXPORTS_PS.u32All); - R600_OUT_BATCH_REGVAL(SQ_PGM_CF_OFFSET_PS, r700->ps.SQ_PGM_CF_OFFSET_PS.u32All); - END_BATCH(); + BEGIN_BATCH_NO_AUTOSTATE(9); + R600_OUT_BATCH_REGVAL(SQ_PGM_RESOURCES_PS, r700->ps.SQ_PGM_RESOURCES_PS.u32All); + R600_OUT_BATCH_REGVAL(SQ_PGM_EXPORTS_PS, r700->ps.SQ_PGM_EXPORTS_PS.u32All); + R600_OUT_BATCH_REGVAL(SQ_PGM_CF_OFFSET_PS, r700->ps.SQ_PGM_CF_OFFSET_PS.u32All); + END_BATCH(); - COMMIT_BATCH(); + BEGIN_BATCH_NO_AUTOSTATE(3); + R600_OUT_BATCH_REGVAL(SQ_LOOP_CONST_0, 0x01000FFF); + END_BATCH(); + + COMMIT_BATCH(); } static void r700SendVSState(GLcontext *ctx, struct radeon_state_atom *atom) { - context_t *context = R700_CONTEXT(ctx); - R700_CHIP_CONTEXT *r700 = R700_CONTEXT_STATES(context); - struct radeon_bo * pbo; - BATCH_LOCALS(&context->radeon); - radeon_print(RADEON_STATE, RADEON_VERBOSE, "%s\n", __func__); + context_t *context = R700_CONTEXT(ctx); + R700_CHIP_CONTEXT *r700 = R700_CONTEXT_STATES(context); + struct radeon_bo * pbo; + BATCH_LOCALS(&context->radeon); + radeon_print(RADEON_STATE, RADEON_VERBOSE, "%s\n", __func__); - pbo = (struct radeon_bo *)r700GetActiveVpShaderBo(GL_CONTEXT(context)); + pbo = (struct radeon_bo *)r700GetActiveVpShaderBo(GL_CONTEXT(context)); - if (!pbo) - return; + if (!pbo) + return; - r700SyncSurf(context, pbo, RADEON_GEM_DOMAIN_GTT, 0, SH_ACTION_ENA_bit); + r700SyncSurf(context, pbo, RADEON_GEM_DOMAIN_GTT, 0, SH_ACTION_ENA_bit); - BEGIN_BATCH_NO_AUTOSTATE(3 + 2); - R600_OUT_BATCH_REGSEQ(SQ_PGM_START_VS, 1); - R600_OUT_BATCH(r700->vs.SQ_PGM_START_VS.u32All); - R600_OUT_BATCH_RELOC(r700->vs.SQ_PGM_START_VS.u32All, - pbo, - r700->vs.SQ_PGM_START_VS.u32All, - RADEON_GEM_DOMAIN_GTT, 0, 0); - END_BATCH(); + BEGIN_BATCH_NO_AUTOSTATE(3 + 2); + R600_OUT_BATCH_REGSEQ(SQ_PGM_START_VS, 1); + R600_OUT_BATCH(r700->vs.SQ_PGM_START_VS.u32All); + R600_OUT_BATCH_RELOC(r700->vs.SQ_PGM_START_VS.u32All, + pbo, + r700->vs.SQ_PGM_START_VS.u32All, + RADEON_GEM_DOMAIN_GTT, 0, 0); + END_BATCH(); - BEGIN_BATCH_NO_AUTOSTATE(6); - R600_OUT_BATCH_REGVAL(SQ_PGM_RESOURCES_VS, r700->vs.SQ_PGM_RESOURCES_VS.u32All); - R600_OUT_BATCH_REGVAL(SQ_PGM_CF_OFFSET_VS, r700->vs.SQ_PGM_CF_OFFSET_VS.u32All); - END_BATCH(); + BEGIN_BATCH_NO_AUTOSTATE(6); + R600_OUT_BATCH_REGVAL(SQ_PGM_RESOURCES_VS, r700->vs.SQ_PGM_RESOURCES_VS.u32All); + R600_OUT_BATCH_REGVAL(SQ_PGM_CF_OFFSET_VS, r700->vs.SQ_PGM_CF_OFFSET_VS.u32All); + END_BATCH(); - COMMIT_BATCH(); + BEGIN_BATCH_NO_AUTOSTATE(3); + R600_OUT_BATCH_REGVAL((SQ_LOOP_CONST_0 + 32*4), 0x0100000F); + //R600_OUT_BATCH_REGVAL((SQ_LOOP_CONST_0 + (SQ_LOOP_CONST_vs<2)), 0x0100000F); + END_BATCH(); + + COMMIT_BATCH(); } static void r700SendFSState(GLcontext *ctx, struct radeon_state_atom *atom) diff --git a/src/mesa/drivers/dri/r600/r700_fragprog.c b/src/mesa/drivers/dri/r600/r700_fragprog.c index ccafd433bf..21ac46e7b8 100644 --- a/src/mesa/drivers/dri/r600/r700_fragprog.c +++ b/src/mesa/drivers/dri/r600/r700_fragprog.c @@ -73,11 +73,11 @@ void Map_Fragment_Program(r700_AssemblerBase *pAsm, pAsm->uiFP_AttributeMap[FRAG_ATTRIB_COL1] = pAsm->number_used_registers++; } - unBit = 1 << FRAG_ATTRIB_FOGC; - if(mesa_fp->Base.InputsRead & unBit) - { - pAsm->uiFP_AttributeMap[FRAG_ATTRIB_FOGC] = pAsm->number_used_registers++; - } + unBit = 1 << FRAG_ATTRIB_FOGC; + if(mesa_fp->Base.InputsRead & unBit) + { + pAsm->uiFP_AttributeMap[FRAG_ATTRIB_FOGC] = pAsm->number_used_registers++; + } for(i=0; i<8; i++) { @@ -88,6 +88,62 @@ void Map_Fragment_Program(r700_AssemblerBase *pAsm, } } +/* order has been taken care of */ +#if 1 + for(i=FRAG_ATTRIB_VAR0; iBase.InputsRead & unBit) + { + pAsm->uiFP_AttributeMap[i] = pAsm->number_used_registers++; + } + } +#else + if( (mesa_fp->Base.InputsRead >> FRAG_ATTRIB_VAR0) > 0 ) + { + struct r700_vertex_program_cont *vpc = + (struct r700_vertex_program_cont *)ctx->VertexProgram._Current; + struct gl_program_parameter_list * VsVarying = vpc->mesa_program.Base.Varying; + struct gl_program_parameter_list * PsVarying = mesa_fp->Base.Varying; + struct gl_program_parameter * pVsParam; + struct gl_program_parameter * pPsParam; + GLuint j, k; + GLuint unMaxVarying = 0; + + for(i=0; iNumParameters; i++) + { + pAsm->uiFP_AttributeMap[i + FRAG_ATTRIB_VAR0] = 0; + } + + for(i=FRAG_ATTRIB_VAR0; iBase.InputsRead & unBit) + { + j = i - FRAG_ATTRIB_VAR0; + pPsParam = PsVarying->Parameters + j; + + for(k=0; kNumParameters; k++) + { + pVsParam = VsVarying->Parameters + k; + + if( strcmp(pPsParam->Name, pVsParam->Name) == 0) + { + pAsm->uiFP_AttributeMap[i] = pAsm->number_used_registers + k; + if(k > unMaxVarying) + { + unMaxVarying = k; + } + break; + } + } + } + } + + pAsm->number_used_registers += unMaxVarying + 1; + } +#endif + /* Map temporary registers (GPRs) */ pAsm->starting_temp_register_number = pAsm->number_used_registers; @@ -127,6 +183,8 @@ void Map_Fragment_Program(r700_AssemblerBase *pAsm, pAsm->pucOutMask[ui] = 0x0; } + pAsm->flag_reg_index = pAsm->number_used_registers++; + pAsm->uFirstHelpReg = pAsm->number_used_registers; } @@ -247,8 +305,11 @@ GLboolean r700TranslateFragmentShader(struct r700_fragment_program *fp, { return GL_FALSE; } + + InitShaderProgram(&(fp->r700AsmCode)); - if( GL_FALSE == AssembleInstr(mesa_fp->Base.NumInstructions, + if( GL_FALSE == AssembleInstr(0, + mesa_fp->Base.NumInstructions, &(mesa_fp->Base.Instructions[0]), &(fp->r700AsmCode)) ) { @@ -260,6 +321,11 @@ GLboolean r700TranslateFragmentShader(struct r700_fragment_program *fp, return GL_FALSE; } + if( GL_FALSE == RelocProgram(&(fp->r700AsmCode)) ) + { + return GL_FALSE; + } + fp->r700Shader.nRegs = (fp->r700AsmCode.number_used_registers == 0) ? 0 : (fp->r700AsmCode.number_used_registers - 1); @@ -459,6 +525,22 @@ GLboolean r700SetupFragmentProgram(GLcontext * ctx) } } + for(i=FRAG_ATTRIB_VAR0; iBase.InputsRead & unBit) + { + ui = pAsm->uiFP_AttributeMap[i]; + SETbit(r700->SPI_PS_INPUT_CNTL[ui].u32All, SEL_CENTROID_bit); + SETfield(r700->SPI_PS_INPUT_CNTL[ui].u32All, ui, + SEMANTIC_shift, SEMANTIC_mask); + if (r700->SPI_INTERP_CONTROL_0.u32All & FLAT_SHADE_ENA_bit) + SETbit(r700->SPI_PS_INPUT_CNTL[ui].u32All, FLAT_SHADE_bit); + else + CLEARbit(r700->SPI_PS_INPUT_CNTL[ui].u32All, FLAT_SHADE_bit); + } + } + exportCount = (r700->ps.SQ_PGM_EXPORTS_PS.u32All & EXPORT_MODE_mask) / (1 << EXPORT_MODE_shift); if (r700->CB_SHADER_CONTROL.u32All != ((1 << exportCount) - 1)) { diff --git a/src/mesa/drivers/dri/r600/r700_shader.c b/src/mesa/drivers/dri/r600/r700_shader.c index 955ea4e4e1..2eed1acc2f 100644 --- a/src/mesa/drivers/dri/r600/r700_shader.c +++ b/src/mesa/drivers/dri/r600/r700_shader.c @@ -159,13 +159,18 @@ void Init_R700_Shader(R700_Shader * pShader) pShader->lstVTXInstructions.uNumOfNode=0; } +void SetActiveCFlist(R700_Shader *pShader, TypedShaderList * plstCF) +{ + pShader->plstCFInstructions_active = plstCF; +} + void AddCFInstruction(R700_Shader *pShader, R700ControlFlowInstruction *pCFInst) { R700ControlFlowSXClause* pSXClause; R700ControlFlowSMXClause* pSMXClause; - pCFInst->m_uIndex = pShader->lstCFInstructions.uNumOfNode; - AddInstToList(&(pShader->lstCFInstructions), + pCFInst->m_uIndex = pShader->plstCFInstructions_active->uNumOfNode; + AddInstToList(pShader->plstCFInstructions_active, (R700ShaderInstruction*)pCFInst); pShader->uShaderBinaryDWORDSize += GetInstructionSize(pCFInst->m_ShaderInstType); diff --git a/src/mesa/drivers/dri/r600/r700_shader.h b/src/mesa/drivers/dri/r600/r700_shader.h index c6a058617e..0599ffd901 100644 --- a/src/mesa/drivers/dri/r600/r700_shader.h +++ b/src/mesa/drivers/dri/r600/r700_shader.h @@ -109,6 +109,7 @@ typedef struct R700_Shader GLuint uStackSize; GLuint uMaxCallDepth; + TypedShaderList * plstCFInstructions_active; TypedShaderList lstCFInstructions; TypedShaderList lstALUInstructions; TypedShaderList lstTEXInstructions; @@ -132,13 +133,13 @@ void TakeInstOutFromList(TypedShaderList * plstCFInstructions, R700ShaderInstruc void ResolveLinks(R700_Shader *pShader); void Assemble(R700_Shader *pShader); - //Interface void Init_R700_Shader(R700_Shader * pShader); void AddCFInstruction(R700_Shader *pShader, R700ControlFlowInstruction *pCFInst); void AddVTXInstruction(R700_Shader *pShader, R700VertexInstruction *pVTXInst); void AddTEXInstruction(R700_Shader *pShader, R700TextureInstruction *pTEXInst); void AddALUInstruction(R700_Shader *pShader, R700ALUInstruction *pALUInst); +void SetActiveCFlist(R700_Shader *pShader, TypedShaderList * plstCF); void LoadProgram(R700_Shader *pShader); void UpdateShaderRegisters(R700_Shader *pShader); diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.c b/src/mesa/drivers/dri/r600/r700_vertprog.c index ffc6068bd8..c8f72d588b 100644 --- a/src/mesa/drivers/dri/r600/r700_vertprog.c +++ b/src/mesa/drivers/dri/r600/r700_vertprog.c @@ -111,6 +111,15 @@ unsigned int Map_Vertex_Output(r700_AssemblerBase *pAsm, } } + for(i=VERT_RESULT_VAR0; iBase.OutputsWritten & unBit) + { + pAsm->ucVP_OutputMap[i] = unTotal++; + } + } + return (unTotal - unStart); } @@ -235,6 +244,8 @@ void Map_Vertex_Program(GLcontext *ctx, pAsm->number_used_registers += mesa_vp->Base.NumTemporaries; } + pAsm->flag_reg_index = pAsm->number_used_registers++; + pAsm->uFirstHelpReg = pAsm->number_used_registers; } @@ -324,7 +335,10 @@ struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, return NULL; } - if(GL_FALSE == AssembleInstr(vp->mesa_program->Base.NumInstructions, + InitShaderProgram(&(vp->r700AsmCode)); + + if(GL_FALSE == AssembleInstr(0, + vp->mesa_program->Base.NumInstructions, &(vp->mesa_program->Base.Instructions[0]), &(vp->r700AsmCode)) ) { @@ -336,6 +350,11 @@ struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, return NULL; } + if( GL_FALSE == RelocProgram(&(vp->r700AsmCode)) ) + { + return GL_FALSE; + } + vp->r700Shader.nRegs = (vp->r700AsmCode.number_used_registers == 0) ? 0 : (vp->r700AsmCode.number_used_registers - 1); -- cgit v1.2.3 From de460871605c5575c5513dd1283cb61710b60cfe Mon Sep 17 00:00:00 2001 From: Richard Li Date: Wed, 18 Nov 2009 14:43:59 -0500 Subject: r600 : add some defs --- src/mesa/drivers/dri/r600/r700_assembler.c | 35 ++++++++++++++++++++++++++++-- src/mesa/drivers/dri/r600/r700_assembler.h | 21 ++++++++++++++++++ src/mesa/drivers/dri/r600/r700_shader.c | 2 +- 3 files changed, 55 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 4b5d40bd3a..6e8d1cd927 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -39,6 +39,7 @@ #include "r700_assembler.h" #define USE_CF_FOR_CONTINUE_BREAK 1 +#define USE_CF_FOR_POP_AFTER 1 BITS addrmode_PVSDST(PVSDST * pPVSDST) { @@ -489,10 +490,12 @@ int Init_r700_AssemblerBase(SHADER_PIPE_TYPE spt, r700_AssemblerBase* pAsm, R700 pAsm->unCallerArrayPointer = 0; pAsm->CALLSP = 0; - pAsm->CALLSTACK[0].FCSP_BeforeEntry; + pAsm->CALLSTACK[0].FCSP_BeforeEntry = 0; pAsm->CALLSTACK[0].plstCFInstructions_local = &(pAsm->pR700Shader->lstCFInstructions); + pAsm->CALLSTACK[0].stackUsage.bits = 0; + SetActiveCFlist(pAsm->pR700Shader, pAsm->CALLSTACK[0].plstCFInstructions_local); pAsm->unCFflags = 0; @@ -4978,6 +4981,21 @@ GLboolean assemble_EXPORT(r700_AssemblerBase *pAsm) return GL_TRUE; } +inline void checkStackDepth(r700_AssemblerBase *pAsm, GLuint uReason) +{ + switch (uReason) + { + case FC_PUSH_VPM: + break; + case FC_PUSH_WQM: + break; + case FC_LOOP: + break; + case FC_REP: + break; + }; +} + GLboolean jumpToOffest(r700_AssemblerBase *pAsm, GLuint pops, GLint offset) { if(GL_FALSE == add_cf_instruction(pAsm) ) @@ -5024,7 +5042,7 @@ GLboolean pops(r700_AssemblerBase *pAsm, GLuint pops) return GL_TRUE; } -GLboolean assemble_IF(r700_AssemblerBase *pAsm) +GLboolean assemble_IF(r700_AssemblerBase *pAsm, GLboolean bHasElse) { if(GL_FALSE == add_cf_instruction(pAsm) ) { @@ -5056,10 +5074,12 @@ GLboolean assemble_IF(r700_AssemblerBase *pAsm) pAsm->fc_stack[pAsm->FCSP].midLen= 0; pAsm->fc_stack[pAsm->FCSP].first = pAsm->cf_current_cf_clause_ptr; +#ifndef USE_CF_FOR_POP_AFTER if(GL_TRUE != bHasElse) { pAsm->alu_x_opcode = SQ_CF_INST_ALU_POP_AFTER; } +#endif /* USE_CF_FOR_POP_AFTER */ pAsm->branch_depth++; @@ -5072,6 +5092,10 @@ GLboolean assemble_IF(r700_AssemblerBase *pAsm) GLboolean assemble_ELSE(r700_AssemblerBase *pAsm) { +#ifdef USE_CF_FOR_POP_AFTER + pops(pAsm, 1); +#endif /* USE_CF_FOR_POP_AFTER */ + if(GL_FALSE == add_cf_instruction(pAsm) ) { return GL_FALSE; @@ -5094,7 +5118,9 @@ GLboolean assemble_ELSE(r700_AssemblerBase *pAsm) pAsm->fc_stack[pAsm->FCSP].mid[0] = pAsm->cf_current_cf_clause_ptr; //pAsm->fc_stack[pAsm->FCSP].unNumMid = 1; +#ifndef USE_CF_FOR_POP_AFTER pAsm->alu_x_opcode = SQ_CF_INST_ALU_POP_AFTER; +#endif /* USE_CF_FOR_POP_AFTER */ pAsm->fc_stack[pAsm->FCSP].first->m_Word0.f.addr = pAsm->pR700Shader->plstCFInstructions_active->uNumOfNode - 1; @@ -5103,6 +5129,10 @@ GLboolean assemble_ELSE(r700_AssemblerBase *pAsm) GLboolean assemble_ENDIF(r700_AssemblerBase *pAsm) { +#ifdef USE_CF_FOR_POP_AFTER + pops(pAsm, 1); +#endif /* USE_CF_FOR_POP_AFTER */ + pAsm->alu_x_opcode = SQ_CF_INST_ALU; if(NULL == pAsm->fc_stack[pAsm->FCSP].mid) @@ -5410,6 +5440,7 @@ GLboolean assemble_BGNSUB(r700_AssemblerBase *pAsm, GLint nILindex) pAsm->CALLSTACK[pAsm->CALLSP].FCSP_BeforeEntry = pAsm->FCSP; pAsm->CALLSTACK[pAsm->CALLSP].plstCFInstructions_local = &(pAsm->subs[pAsm->unSubArrayPointer].lstCFInstructions_local); + pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.bits = 0; SetActiveCFlist(pAsm->pR700Shader, pAsm->CALLSTACK[pAsm->CALLSP].plstCFInstructions_local); diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index 85d32212c0..516923f67c 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -259,6 +259,8 @@ enum FC_IF = 1, FC_LOOP = 2, FC_REP = 3, + FC_PUSH_VPM = 4, + FC_PUSH_WQM = 5, COND_NONE = 0, COND_BOOL = 1, @@ -304,12 +306,30 @@ typedef struct CALLER_POINTER #define SQ_MAX_CALL_DEPTH 0x00000020 +typedef struct STACK_USAGE +{ + BITS pushs :8; + BITS current :8; + BITS max :8; +} STACK_USAGE; + +typedef union STACKDWORDtag +{ + BITS bits; + STACK_USAGE su; +} STACKDWORD; + typedef struct CALL_LEVEL { unsigned int FCSP_BeforeEntry; + STACKDWORD stackUsage; TypedShaderList * plstCFInstructions_local; } CALL_LEVEL; +#define HAS_CURRENT_LOOPRET 0x1L +#define HAS_LOOPRET 0x2L +#define LOOPRET_FLAGS HAS_LOOPRET | HAS_CURRENT_LOOPRET + typedef struct r700_AssemblerBase { R700ControlFlowSXClause* cf_last_export_ptr; @@ -429,6 +449,7 @@ typedef struct r700_AssemblerBase } r700_AssemblerBase; //Internal use +inline void checkStackDepth(r700_AssemblerBase *pAsm, GLuint uReason); BITS addrmode_PVSDST(PVSDST * pPVSDST); void setaddrmode_PVSDST(PVSDST * pPVSDST, BITS addrmode); void nomask_PVSDST(PVSDST * pPVSDST); diff --git a/src/mesa/drivers/dri/r600/r700_shader.c b/src/mesa/drivers/dri/r600/r700_shader.c index 2eed1acc2f..db951e48c4 100644 --- a/src/mesa/drivers/dri/r600/r700_shader.c +++ b/src/mesa/drivers/dri/r600/r700_shader.c @@ -140,7 +140,7 @@ void Init_R700_Shader(R700_Shader * pShader) pShader->killIsUsed = GL_FALSE; pShader->uCFOffset = 0; - pShader->uStackSize = 0; + pShader->uStackSize = 10; //richard test pShader->uMaxCallDepth = 0; pShader->bSurfAllocated = GL_FALSE; -- cgit v1.2.3 From eec428280075c12dfef61bf3f18012dece384923 Mon Sep 17 00:00:00 2001 From: Richard Li Date: Wed, 18 Nov 2009 14:56:01 -0500 Subject: r600 : update PS and VS emit count for loop constants. --- src/mesa/drivers/dri/r600/r700_chip.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index 197916ac0d..705b5738ed 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -1310,8 +1310,8 @@ void r600InitAtoms(context_t *context) ALLOC_STATE(spi, always, (59 + R700_MAX_SHADER_EXPORTS), r700SendSPIState); ALLOC_STATE(vpt, always, 16, r700SendViewportState); ALLOC_STATE(fs, always, 18, r700SendFSState); - ALLOC_STATE(vs, always, 18, r700SendVSState); - ALLOC_STATE(ps, always, 21, r700SendPSState); + ALLOC_STATE(vs, always, 21, r700SendVSState); + ALLOC_STATE(ps, always, 24, r700SendPSState); ALLOC_STATE(vs_consts, vs_consts, (2 + (R700_MAX_DX9_CONSTS * 4)), r700SendVSConsts); ALLOC_STATE(ps_consts, ps_consts, (2 + (R700_MAX_DX9_CONSTS * 4)), r700SendPSConsts); ALLOC_STATE(vtx, vtx, (6 + (VERT_ATTRIB_MAX * 18)), r700SendVTXState); -- cgit v1.2.3 From abed06421b892aed9f38ea75862e4b7e8aca25fa Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 17 Nov 2009 11:15:13 -0800 Subject: tnl: Remove unused NotifyInputChanges() tnl dd hook. --- src/mesa/tnl/t_context.h | 5 ----- src/mesa/tnl/t_pipeline.c | 4 ---- 2 files changed, 9 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h index 6137c2d2fe..8915770d8b 100644 --- a/src/mesa/tnl/t_context.h +++ b/src/mesa/tnl/t_context.h @@ -402,11 +402,6 @@ struct tnl_device_driver /* Alert tnl-aware drivers of changes to material. */ - void (*NotifyInputChanges)(GLcontext *ctx, GLuint bitmask); - /* Alert tnl-aware drivers of changes to size and stride of input - * arrays. - */ - /*** *** Rendering -- These functions called only from t_vb_render.c ***/ diff --git a/src/mesa/tnl/t_pipeline.c b/src/mesa/tnl/t_pipeline.c index 357ef1e24b..01b30babb4 100644 --- a/src/mesa/tnl/t_pipeline.c +++ b/src/mesa/tnl/t_pipeline.c @@ -86,10 +86,6 @@ static GLuint check_input_changes( GLcontext *ctx ) } } - if (tnl->pipeline.input_changes && - tnl->Driver.NotifyInputChanges) - tnl->Driver.NotifyInputChanges( ctx, tnl->pipeline.input_changes ); - return tnl->pipeline.input_changes; } -- cgit v1.2.3 From 22bcb59a95ec833cfd73b300376c918eb6a658f2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 17 Nov 2009 13:00:01 -0800 Subject: tnl: Replace NormalPtr with AttribPtr[_TNL_ATTRIB_NORMAL] --- src/mesa/drivers/dri/radeon/radeon_maos_arrays.c | 4 ++-- src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h | 6 +++--- src/mesa/tnl/t_context.h | 3 +-- src/mesa/tnl/t_draw.c | 1 - src/mesa/tnl/t_vb_normals.c | 1 - src/mesa/x86/gen_matypes.c | 2 +- 6 files changed, 7 insertions(+), 10 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c b/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c index 08e1c5d00d..4769f1cb4d 100644 --- a/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c +++ b/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c @@ -216,9 +216,9 @@ void radeonEmitArrays( GLcontext *ctx, GLuint inputs ) if (!rmesa->tcl.norm.buf) rcommon_emit_vector( ctx, &(rmesa->tcl.aos[nr]), - (char *)VB->NormalPtr->data, + (char *)VB->AttribPtr[_TNL_ATTRIB_NORMAL]->data, 3, - VB->NormalPtr->stride, + VB->AttribPtr[_TNL_ATTRIB_NORMAL]->stride, count); vfmt |= RADEON_CP_VC_FRMT_N0; diff --git a/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h b/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h index 515783135d..1abde5ddee 100644 --- a/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h +++ b/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h @@ -112,9 +112,9 @@ static void TAG(emit)( GLcontext *ctx, } if (DO_NORM) { - if (VB->NormalPtr) { - norm_stride = VB->NormalPtr->stride; - norm = (GLuint (*)[4])VB->NormalPtr->data; + if (VB->AttribPtr[_TNL_ATTRIB_NORMAL]) { + norm_stride = VB->AttribPtr[_TNL_ATTRIB_NORMAL]->stride; + norm = (GLuint (*)[4])VB->AttribPtr[_TNL_ATTRIB_NORMAL]->data; } else { norm_stride = 0; norm = (GLuint (*)[4])&ctx->Current.Attrib[VERT_ATTRIB_NORMAL]; diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h index 8915770d8b..504e8c5044 100644 --- a/src/mesa/tnl/t_context.h +++ b/src/mesa/tnl/t_context.h @@ -200,7 +200,7 @@ struct vertex_buffer /* Pointers to current data. * XXX some of these fields alias AttribPtr below and should be removed - * such as NormalPtr, TexCoordPtr, FogCoordPtr, etc. + * such as TexCoordPtr, FogCoordPtr, etc. */ GLuint *Elts; GLvector4f *ObjPtr; /* _TNL_BIT_POS */ @@ -210,7 +210,6 @@ struct vertex_buffer GLubyte ClipOrMask; /* _TNL_BIT_POS */ GLubyte ClipAndMask; /* _TNL_BIT_POS */ GLubyte *ClipMask; /* _TNL_BIT_POS */ - GLvector4f *NormalPtr; /* _TNL_BIT_NORMAL */ GLfloat *NormalLengthPtr; /* _TNL_BIT_NORMAL */ GLboolean *EdgeFlag; /* _TNL_BIT_EDGEFLAG */ GLvector4f *TexCoordPtr[MAX_TEXTURE_COORD_UNITS]; /* VERT_TEX_0..n */ diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c index 04fa106300..2df9444d2b 100644 --- a/src/mesa/tnl/t_draw.c +++ b/src/mesa/tnl/t_draw.c @@ -255,7 +255,6 @@ static void bind_inputs( GLcontext *ctx, /* Legacy pointers -- remove one day. */ VB->ObjPtr = VB->AttribPtr[_TNL_ATTRIB_POS]; - VB->NormalPtr = VB->AttribPtr[_TNL_ATTRIB_NORMAL]; VB->ColorPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR0]; VB->ColorPtr[1] = NULL; VB->IndexPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR_INDEX]; diff --git a/src/mesa/tnl/t_vb_normals.c b/src/mesa/tnl/t_vb_normals.c index a4821cc1cc..693d3dc118 100644 --- a/src/mesa/tnl/t_vb_normals.c +++ b/src/mesa/tnl/t_vb_normals.c @@ -79,7 +79,6 @@ run_normal_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage) } VB->AttribPtr[_TNL_ATTRIB_NORMAL] = &store->normal; - VB->NormalPtr = &store->normal; VB->NormalLengthPtr = NULL; /* no longer valid */ return GL_TRUE; diff --git a/src/mesa/x86/gen_matypes.c b/src/mesa/x86/gen_matypes.c index d56b701aa8..f78a277601 100644 --- a/src/mesa/x86/gen_matypes.c +++ b/src/mesa/x86/gen_matypes.c @@ -126,7 +126,7 @@ int main( int argc, char **argv ) OFFSET( "VB_PROJ_CLIP_PTR ", struct vertex_buffer, NdcPtr ); OFFSET( "VB_CLIP_OR_MASK ", struct vertex_buffer, ClipOrMask ); OFFSET( "VB_CLIP_MASK ", struct vertex_buffer, ClipMask ); - OFFSET( "VB_NORMAL_PTR ", struct vertex_buffer, NormalPtr ); + OFFSET( "VB_NORMAL_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_NORMAL] ); OFFSET( "VB_EDGE_FLAG ", struct vertex_buffer, EdgeFlag ); OFFSET( "VB_TEX0_COORD_PTR ", struct vertex_buffer, TexCoordPtr[0] ); OFFSET( "VB_TEX1_COORD_PTR ", struct vertex_buffer, TexCoordPtr[1] ); -- cgit v1.2.3 From df582ca767a38f185f9b4c449e7ed4266c414ae2 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 17 Nov 2009 16:00:53 -0800 Subject: tnl: Replace deprecated TexCoordPtr with AttribPtr[_TNL_ATTRIB_TEX*] --- src/mesa/drivers/dri/gamma/gamma_render.c | 6 +- src/mesa/drivers/dri/i915/i830_vtbl.c | 2 +- src/mesa/drivers/dri/i915/i915_fragprog.c | 2 +- src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h | 20 +++---- src/mesa/drivers/dri/mach64/mach64_vbtmp.h | 64 +++++++++++----------- src/mesa/drivers/dri/r128/r128_tris.c | 4 +- src/mesa/drivers/dri/r200/r200_swtcl.c | 2 +- src/mesa/drivers/dri/r300/r300_swtcl.c | 6 +- src/mesa/drivers/dri/radeon/radeon_maos_arrays.c | 12 ++-- src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h | 30 +++++----- src/mesa/drivers/dri/radeon/radeon_maos_verts.c | 6 +- src/mesa/drivers/dri/radeon/radeon_swtcl.c | 2 +- src/mesa/drivers/dri/savage/savagerender.c | 8 +-- src/mesa/drivers/dri/savage/savagetris.c | 18 +++--- src/mesa/drivers/dri/sis/sis_tris.c | 4 +- src/mesa/drivers/dri/tdfx/tdfx_vbtmp.h | 20 +++---- src/mesa/drivers/dri/unichrome/via_tris.c | 4 +- src/mesa/drivers/glide/fxvbtmp.h | 21 +++---- .../windows/gldirect/dx7/gld_primitive_dx7.c | 8 +-- .../windows/gldirect/dx8/gld_primitive_dx8.c | 8 +-- .../windows/gldirect/dx9/gld_primitive_dx9.c | 8 +-- src/mesa/tnl/t_context.h | 3 +- src/mesa/tnl/t_draw.c | 4 -- src/mesa/tnl/t_vb_program.c | 1 - src/mesa/tnl/t_vb_texgen.c | 1 - src/mesa/tnl/t_vb_texmat.c | 1 - src/mesa/tnl_dd/t_dd_vbtmp.h | 64 +++++++++++----------- src/mesa/x86/gen_matypes.c | 8 +-- 28 files changed, 165 insertions(+), 172 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/gamma/gamma_render.c b/src/mesa/drivers/dri/gamma/gamma_render.c index 1b9fd169f4..741936488a 100644 --- a/src/mesa/drivers/dri/gamma/gamma_render.c +++ b/src/mesa/drivers/dri/gamma/gamma_render.c @@ -57,9 +57,9 @@ static void gamma_emit( GLcontext *ctx, GLuint start, GLuint end) col_stride = VB->ColorPtr[0]->stride; if (ctx->Texture.Unit[0]._ReallyEnabled) { - tc0_stride = VB->TexCoordPtr[0]->stride; - tc0 = VB->TexCoordPtr[0]->data; - tc0_size = VB->TexCoordPtr[0]->size; + tc0_stride = VB->AttribPtr[_TNL_ATTRIB_TEX0]->stride; + tc0 = VB->AttribPtr[_TNL_ATTRIB_TEX0]->data; + tc0_size = VB->AttribPtr[_TNL_ATTRIB_TEX0]->size; coord = VB->ClipPtr->data; coord_stride = VB->ClipPtr->stride; } else { diff --git a/src/mesa/drivers/dri/i915/i830_vtbl.c b/src/mesa/drivers/dri/i915/i830_vtbl.c index a6f554701e..7d76b39caa 100644 --- a/src/mesa/drivers/dri/i915/i830_vtbl.c +++ b/src/mesa/drivers/dri/i915/i830_vtbl.c @@ -126,7 +126,7 @@ i830_render_start(struct intel_context *intel) for (i = 0; i < I830_TEX_UNITS; i++) { if (RENDERINPUTS_TEST(index_bitset, _TNL_ATTRIB_TEX(i))) { - GLuint sz = VB->TexCoordPtr[i]->size; + GLuint sz = VB->AttribPtr[_TNL_ATTRIB_TEX0 + i]->size; GLuint emit; GLuint mcs = (i830->state.Tex[i][I830_TEXREG_MCS] & ~TEXCOORDTYPE_MASK); diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c index d9c61446f5..9e4d318036 100644 --- a/src/mesa/drivers/dri/i915/i915_fragprog.c +++ b/src/mesa/drivers/dri/i915/i915_fragprog.c @@ -1301,7 +1301,7 @@ i915ValidateFragmentProgram(struct i915_context *i915) for (i = 0; i < p->ctx->Const.MaxTextureCoordUnits; i++) { if (inputsRead & FRAG_BIT_TEX(i)) { - int sz = VB->TexCoordPtr[i]->size; + int sz = VB->AttribPtr[_TNL_ATTRIB_TEX0 + i]->size; s2 &= ~S2_TEXCOORD_FMT(i, S2_TEXCOORD_FMT0_MASK); s2 |= S2_TEXCOORD_FMT(i, SZ_TO_HW(sz)); diff --git a/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h b/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h index 684f2acc89..1a93e5f034 100644 --- a/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h +++ b/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h @@ -103,10 +103,10 @@ static void TAG(emit)( GLcontext *ctx, #if DO_TEX1 { const GLuint t1 = GET_TEXSOURCE(1); - tc1 = VB->TexCoordPtr[t1]->data; - tc1_stride = VB->TexCoordPtr[t1]->stride; + tc1 = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t1]->data; + tc1_stride = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t1]->stride; #if DO_PTEX - tc1_size = VB->TexCoordPtr[t1]->size; + tc1_size = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t1]->size; #endif } #endif @@ -114,10 +114,10 @@ static void TAG(emit)( GLcontext *ctx, #if DO_TEX0 { const GLuint t0 = GET_TEXSOURCE(0); - tc0 = VB->TexCoordPtr[t0]->data; - tc0_stride = VB->TexCoordPtr[t0]->stride; + tc0 = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t0]->data; + tc0_stride = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t0]->stride; #if DO_PTEX - tc0_size = VB->TexCoordPtr[t0]->size; + tc0_size = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t0]->size; #endif } #endif @@ -319,8 +319,8 @@ static GLboolean TAG(check_tex_sizes)( GLcontext *ctx ) /* Force 'missing' texcoords to something valid. */ - if (DO_TEX1 && VB->TexCoordPtr[0] == 0) - VB->TexCoordPtr[0] = VB->TexCoordPtr[1]; + if (DO_TEX1 && VB->AttribPtr[_TNL_ATTRIB_TEX0] == 0) + VB->AttribPtr[_TNL_ATTRIB_TEX0] = VB->AttribPtr[_TNL_ATTRIB_TEX1]; if (DO_PTEX) return GL_TRUE; @@ -328,12 +328,12 @@ static GLboolean TAG(check_tex_sizes)( GLcontext *ctx ) /* No hardware support for projective texture. Can fake it for * TEX0 only. */ - if ((DO_TEX1 && VB->TexCoordPtr[GET_TEXSOURCE(1)]->size == 4)) { + if ((DO_TEX1 && VB->AttribPtr[_TNL_ATTRIB_TEX0 + GET_TEXSOURCE(1)]->size == 4)) { PTEX_FALLBACK(); return GL_FALSE; } - if (DO_TEX0 && VB->TexCoordPtr[GET_TEXSOURCE(0)]->size == 4) { + if (DO_TEX0 && VB->AttribPtr[_TNL_ATTRIB_TEX0 + GET_TEXSOURCE(0)]->size == 4) { if (DO_TEX1) { PTEX_FALLBACK(); } diff --git a/src/mesa/drivers/dri/mach64/mach64_vbtmp.h b/src/mesa/drivers/dri/mach64/mach64_vbtmp.h index 938804af9e..eb94e6e398 100644 --- a/src/mesa/drivers/dri/mach64/mach64_vbtmp.h +++ b/src/mesa/drivers/dri/mach64/mach64_vbtmp.h @@ -156,34 +156,34 @@ static void TAG(emit)( GLcontext *ctx, if (DO_TEX3) { const GLuint t3 = GET_TEXSOURCE(3); - tc3 = VB->TexCoordPtr[t3]->data; - tc3_stride = VB->TexCoordPtr[t3]->stride; + tc3 = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t3]->data; + tc3_stride = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t3]->stride; if (DO_PTEX) - tc3_size = VB->TexCoordPtr[t3]->size; + tc3_size = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t3]->size; } if (DO_TEX2) { const GLuint t2 = GET_TEXSOURCE(2); - tc2 = VB->TexCoordPtr[t2]->data; - tc2_stride = VB->TexCoordPtr[t2]->stride; + tc2 = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t2]->data; + tc2_stride = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t2]->stride; if (DO_PTEX) - tc2_size = VB->TexCoordPtr[t2]->size; + tc2_size = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t2]->size; } if (DO_TEX1) { const GLuint t1 = GET_TEXSOURCE(1); - tc1 = VB->TexCoordPtr[t1]->data; - tc1_stride = VB->TexCoordPtr[t1]->stride; + tc1 = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t1]->data; + tc1_stride = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t1]->stride; if (DO_PTEX) - tc1_size = VB->TexCoordPtr[t1]->size; + tc1_size = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t1]->size; } if (DO_TEX0) { const GLuint t0 = GET_TEXSOURCE(0); - tc0_stride = VB->TexCoordPtr[t0]->stride; - tc0 = VB->TexCoordPtr[t0]->data; + tc0_stride = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t0]->stride; + tc0 = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t0]->data; if (DO_PTEX) - tc0_size = VB->TexCoordPtr[t0]->size; + tc0_size = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t0]->size; } if (DO_RGBA) { @@ -473,22 +473,22 @@ static GLboolean TAG(check_tex_sizes)( GLcontext *ctx ) /* Force 'missing' texcoords to something valid. */ - if (DO_TEX3 && VB->TexCoordPtr[2] == 0) - VB->TexCoordPtr[2] = VB->TexCoordPtr[3]; + if (DO_TEX3 && VB->AttribPtr[_TNL_ATTRIB_TEX2] == 0) + VB->AttribPtr[_TNL_ATTRIB_TEX2] = VB->AttribPtr[_TNL_ATTRIB_TEX3]; - if (DO_TEX2 && VB->TexCoordPtr[1] == 0) - VB->TexCoordPtr[1] = VB->TexCoordPtr[2]; + if (DO_TEX2 && VB->AttribPtr[_TNL_ATTRIB_TEX1] == 0) + VB->AttribPtr[_TNL_ATTRIB_TEX1] = VB->AttribPtr[_TNL_ATTRIB_TEX2]; - if (DO_TEX1 && VB->TexCoordPtr[0] == 0) - VB->TexCoordPtr[0] = VB->TexCoordPtr[1]; + if (DO_TEX1 && VB->AttribPtr[_TNL_ATTRIB_TEX0] == 0) + VB->AttribPtr[_TNL_ATTRIB_TEX0] = VB->AttribPtr[_TNL_ATTRIB_TEX1]; if (DO_PTEX) return GL_TRUE; - if ((DO_TEX3 && VB->TexCoordPtr[GET_TEXSOURCE(3)]->size == 4) || - (DO_TEX2 && VB->TexCoordPtr[GET_TEXSOURCE(2)]->size == 4) || - (DO_TEX1 && VB->TexCoordPtr[GET_TEXSOURCE(1)]->size == 4) || - (DO_TEX0 && VB->TexCoordPtr[GET_TEXSOURCE(0)]->size == 4)) + if ((DO_TEX3 && VB->AttribPtr[_TNL_ATTRIB_TEX0 + GET_TEXSOURCE(3)]->size == 4) || + (DO_TEX2 && VB->AttribPtr[_TNL_ATTRIB_TEX0 + GET_TEXSOURCE(2)]->size == 4) || + (DO_TEX1 && VB->AttribPtr[_TNL_ATTRIB_TEX0 + GET_TEXSOURCE(1)]->size == 4) || + (DO_TEX0 && VB->AttribPtr[_TNL_ATTRIB_TEX0 + GET_TEXSOURCE(0)]->size == 4)) return GL_FALSE; return GL_TRUE; @@ -501,14 +501,14 @@ static GLboolean TAG(check_tex_sizes)( GLcontext *ctx ) /* Force 'missing' texcoords to something valid. */ - if (DO_TEX3 && VB->TexCoordPtr[2] == 0) - VB->TexCoordPtr[2] = VB->TexCoordPtr[3]; + if (DO_TEX3 && VB->AttribPtr[_TNL_ATTRIB_TEX2] == 0) + VB->AttribPtr[_TNL_ATTRIB_TEX2] = VB->AttribPtr[_TNL_ATTRIB_TEX3]; - if (DO_TEX2 && VB->TexCoordPtr[1] == 0) - VB->TexCoordPtr[1] = VB->TexCoordPtr[2]; + if (DO_TEX2 && VB->AttribPtr[_TNL_ATTRIB_TEX1] == 0) + VB->AttribPtr[_TNL_ATTRIB_TEX1] = VB->AttribPtr[_TNL_ATTRIB_TEX2]; - if (DO_TEX1 && VB->TexCoordPtr[0] == 0) - VB->TexCoordPtr[0] = VB->TexCoordPtr[1]; + if (DO_TEX1 && VB->AttribPtr[_TNL_ATTRIB_TEX0] == 0) + VB->AttribPtr[_TNL_ATTRIB_TEX0] = VB->AttribPtr[_TNL_ATTRIB_TEX1]; if (DO_PTEX) return GL_TRUE; @@ -516,14 +516,14 @@ static GLboolean TAG(check_tex_sizes)( GLcontext *ctx ) /* No hardware support for projective texture. Can fake it for * TEX0 only. */ - if ((DO_TEX3 && VB->TexCoordPtr[GET_TEXSOURCE(3)]->size == 4) || - (DO_TEX2 && VB->TexCoordPtr[GET_TEXSOURCE(2)]->size == 4) || - (DO_TEX1 && VB->TexCoordPtr[GET_TEXSOURCE(1)]->size == 4)) { + if ((DO_TEX3 && VB->AttribPtr[_TNL_ATTRIB_TEX0 + GET_TEXSOURCE(3)]->size == 4) || + (DO_TEX2 && VB->AttribPtr[_TNL_ATTRIB_TEX0 + GET_TEXSOURCE(2)]->size == 4) || + (DO_TEX1 && VB->AttribPtr[_TNL_ATTRIB_TEX0 + GET_TEXSOURCE(1)]->size == 4)) { PTEX_FALLBACK(); return GL_FALSE; } - if (DO_TEX0 && VB->TexCoordPtr[GET_TEXSOURCE(0)]->size == 4) { + if (DO_TEX0 && VB->AttribPtr[_TNL_ATTRIB_TEX0 + GET_TEXSOURCE(0)]->size == 4) { if (DO_TEX1 || DO_TEX2 || DO_TEX3) { PTEX_FALLBACK(); } diff --git a/src/mesa/drivers/dri/r128/r128_tris.c b/src/mesa/drivers/dri/r128/r128_tris.c index 5b91271d74..448e34e047 100644 --- a/src/mesa/drivers/dri/r128/r128_tris.c +++ b/src/mesa/drivers/dri/r128/r128_tris.c @@ -650,12 +650,12 @@ static void r128RenderStart( GLcontext *ctx ) } if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX(rmesa->tmu_source[0]) )) { - if ( VB->TexCoordPtr[rmesa->tmu_source[0]]->size > 2 ) + if ( VB->AttribPtr[_TNL_ATTRIB_TEX0 + rmesa->tmu_source[0]]->size > 2 ) fallback_projtex = GL_TRUE; EMIT_ATTR( _TNL_ATTRIB_TEX0, EMIT_2F, R128_CCE_VC_FRMT_S_T, 8 ); } if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX(rmesa->tmu_source[1]) )) { - if ( VB->TexCoordPtr[rmesa->tmu_source[1]]->size > 2 ) + if ( VB->AttribPtr[_TNL_ATTRIB_TEX0 + rmesa->tmu_source[1]]->size > 2 ) fallback_projtex = GL_TRUE; EMIT_ATTR( _TNL_ATTRIB_TEX1, EMIT_2F, R128_CCE_VC_FRMT_S2_T2, 8 ); } diff --git a/src/mesa/drivers/dri/r200/r200_swtcl.c b/src/mesa/drivers/dri/r200/r200_swtcl.c index 240fb45078..fadc766b49 100644 --- a/src/mesa/drivers/dri/r200/r200_swtcl.c +++ b/src/mesa/drivers/dri/r200/r200_swtcl.c @@ -168,7 +168,7 @@ static void r200SetVertexFormat( GLcontext *ctx ) for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX(i) )) { - GLuint sz = VB->TexCoordPtr[i]->size; + GLuint sz = VB->AttribPtr[_TNL_ATTRIB_TEX0 + i]->size; fmt_1 |= sz << (3 * i); EMIT_ATTR( _TNL_ATTRIB_TEX0+i, EMIT_1F + sz - 1, 0 ); diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.c b/src/mesa/drivers/dri/r300/r300_swtcl.c index ee2c71e1a7..677c504b90 100644 --- a/src/mesa/drivers/dri/r300/r300_swtcl.c +++ b/src/mesa/drivers/dri/r300/r300_swtcl.c @@ -159,7 +159,7 @@ void r300ChooseSwtclVertexFormat(GLcontext *ctx, GLuint *_InputsRead, GLuint *_ int tex_id = rmesa->selected_fp->wpos_attr - FRAG_ATTRIB_TEX0; VB->AttribPtr[VERT_ATTRIB_TEX0 + tex_id] = VB->AttribPtr[VERT_ATTRIB_POS]; - VB->TexCoordPtr[tex_id] = VB->AttribPtr[VERT_ATTRIB_POS]; + VB->AttribPtr[_TNL_ATTRIB_TEX0 + tex_id] = VB->AttribPtr[VERT_ATTRIB_POS]; RENDERINPUTS_SET(tnl->render_inputs_bitset, _TNL_ATTRIB_TEX0 + tex_id); } @@ -167,7 +167,7 @@ void r300ChooseSwtclVertexFormat(GLcontext *ctx, GLuint *_InputsRead, GLuint *_ int tex_id = rmesa->selected_fp->fog_attr - FRAG_ATTRIB_TEX0; VB->AttribPtr[VERT_ATTRIB_TEX0 + tex_id] = VB->AttribPtr[VERT_ATTRIB_FOG]; - VB->TexCoordPtr[tex_id] = VB->AttribPtr[VERT_ATTRIB_FOG]; + VB->AttribPtr[_TNL_ATTRIB_TEX0 + tex_id] = VB->AttribPtr[VERT_ATTRIB_FOG]; RENDERINPUTS_SET(tnl->render_inputs_bitset, _TNL_ATTRIB_TEX0 + tex_id); } @@ -180,7 +180,7 @@ void r300ChooseSwtclVertexFormat(GLcontext *ctx, GLuint *_InputsRead, GLuint *_ GLuint swiz, format, hw_format; for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { if (fp_reads & FRAG_BIT_TEX(i)) { - switch (VB->TexCoordPtr[i]->size) { + switch (VB->AttribPtr[_TNL_ATTRIB_TEX0 + i]->size) { case 1: format = EMIT_1F; hw_format = R300_DATA_TYPE_FLOAT_1; diff --git a/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c b/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c index 4769f1cb4d..1cd1d6e778 100644 --- a/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c +++ b/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c @@ -290,24 +290,24 @@ void radeonEmitArrays( GLcontext *ctx, GLuint inputs ) if (!rmesa->tcl.tex[unit].buf) emit_tex_vector( ctx, &(rmesa->tcl.aos[nr]), - (char *)VB->TexCoordPtr[unit]->data, - VB->TexCoordPtr[unit]->size, - VB->TexCoordPtr[unit]->stride, + (char *)VB->AttribPtr[_TNL_ATTRIB_TEX0 + unit]->data, + VB->AttribPtr[_TNL_ATTRIB_TEX0 + unit]->size, + VB->AttribPtr[_TNL_ATTRIB_TEX0 + unit]->stride, count ); nr++; vfmt |= RADEON_ST_BIT(unit); /* assume we need the 3rd coord if texgen is active for r/q OR at least 3 coords are submitted. This may not be 100% correct */ - if (VB->TexCoordPtr[unit]->size >= 3) { + if (VB->AttribPtr[_TNL_ATTRIB_TEX0 + unit]->size >= 3) { vtx |= RADEON_Q_BIT(unit); vfmt |= RADEON_Q_BIT(unit); } if ( (ctx->Texture.Unit[unit].TexGenEnabled & (R_BIT | Q_BIT)) ) vtx |= RADEON_Q_BIT(unit); - else if ((VB->TexCoordPtr[unit]->size >= 3) && + else if ((VB->AttribPtr[_TNL_ATTRIB_TEX0 + unit]->size >= 3) && ((ctx->Texture.Unit[unit]._ReallyEnabled & (TEXTURE_CUBE_BIT)) == 0)) { - GLuint swaptexmatcol = (VB->TexCoordPtr[unit]->size - 3); + GLuint swaptexmatcol = (VB->AttribPtr[_TNL_ATTRIB_TEX0 + unit]->size - 3); if (((rmesa->NeedTexMatrix >> unit) & 1) && (swaptexmatcol != ((rmesa->TexMatColSwap >> unit) & 1))) radeonUploadTexMatrix( rmesa, unit, swaptexmatcol ) ; diff --git a/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h b/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h index 1abde5ddee..cb57416c3e 100644 --- a/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h +++ b/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h @@ -60,14 +60,14 @@ static void TAG(emit)( GLcontext *ctx, coord_stride = VB->ObjPtr->stride; if (DO_TEX2) { - if (VB->TexCoordPtr[2]) { + if (VB->AttribPtr[_TNL_ATTRIB_TEX2]) { const GLuint t2 = GET_TEXSOURCE(2); - tc2 = (GLuint (*)[4])VB->TexCoordPtr[t2]->data; - tc2_stride = VB->TexCoordPtr[t2]->stride; - if (DO_PTEX && VB->TexCoordPtr[t2]->size < 3) { + tc2 = (GLuint (*)[4])VB->AttribPtr[_TNL_ATTRIB_TEX0 + t2]->data; + tc2_stride = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t2]->stride; + if (DO_PTEX && VB->AttribPtr[_TNL_ATTRIB_TEX0 + t2]->size < 3) { fill_tex |= (1<<2); } - else if (DO_PTEX && VB->TexCoordPtr[t2]->size < 4) { + else if (DO_PTEX && VB->AttribPtr[_TNL_ATTRIB_TEX0 + t2]->size < 4) { rqcoordsnoswap |= (1<<2); } } else { @@ -77,14 +77,14 @@ static void TAG(emit)( GLcontext *ctx, } if (DO_TEX1) { - if (VB->TexCoordPtr[1]) { + if (VB->AttribPtr[_TNL_ATTRIB_TEX1]) { const GLuint t1 = GET_TEXSOURCE(1); - tc1 = (GLuint (*)[4])VB->TexCoordPtr[t1]->data; - tc1_stride = VB->TexCoordPtr[t1]->stride; - if (DO_PTEX && VB->TexCoordPtr[t1]->size < 3) { + tc1 = (GLuint (*)[4])VB->AttribPtr[_TNL_ATTRIB_TEX0 + t1]->data; + tc1_stride = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t1]->stride; + if (DO_PTEX && VB->AttribPtr[_TNL_ATTRIB_TEX0 + t1]->size < 3) { fill_tex |= (1<<1); } - else if (DO_PTEX && VB->TexCoordPtr[t1]->size < 4) { + else if (DO_PTEX && VB->AttribPtr[_TNL_ATTRIB_TEX0 + t1]->size < 4) { rqcoordsnoswap |= (1<<1); } } else { @@ -94,14 +94,14 @@ static void TAG(emit)( GLcontext *ctx, } if (DO_TEX0) { - if (VB->TexCoordPtr[0]) { + if (VB->AttribPtr[_TNL_ATTRIB_TEX0]) { const GLuint t0 = GET_TEXSOURCE(0); - tc0_stride = VB->TexCoordPtr[t0]->stride; - tc0 = (GLuint (*)[4])VB->TexCoordPtr[t0]->data; - if (DO_PTEX && VB->TexCoordPtr[t0]->size < 3) { + tc0_stride = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t0]->stride; + tc0 = (GLuint (*)[4])VB->AttribPtr[_TNL_ATTRIB_TEX0 + t0]->data; + if (DO_PTEX && VB->AttribPtr[_TNL_ATTRIB_TEX0 + t0]->size < 3) { fill_tex |= (1<<0); } - else if (DO_PTEX && VB->TexCoordPtr[t0]->size < 4) { + else if (DO_PTEX && VB->AttribPtr[_TNL_ATTRIB_TEX0 + t0]->size < 4) { rqcoordsnoswap |= (1<<0); } } else { diff --git a/src/mesa/drivers/dri/radeon/radeon_maos_verts.c b/src/mesa/drivers/dri/radeon/radeon_maos_verts.c index 78ec119302..a6aff69aac 100644 --- a/src/mesa/drivers/dri/radeon/radeon_maos_verts.c +++ b/src/mesa/drivers/dri/radeon/radeon_maos_verts.c @@ -348,15 +348,15 @@ void radeonEmitArrays( GLcontext *ctx, GLuint inputs ) req |= RADEON_ST_BIT(unit); /* assume we need the 3rd coord if texgen is active for r/q OR at least 3 coords are submitted. This may not be 100% correct */ - if (VB->TexCoordPtr[unit]->size >= 3) { + if (VB->AttribPtr[_TNL_ATTRIB_TEX0 + unit]->size >= 3) { req |= RADEON_Q_BIT(unit); vtx |= RADEON_Q_BIT(unit); } if ( (ctx->Texture.Unit[unit].TexGenEnabled & (R_BIT | Q_BIT)) ) vtx |= RADEON_Q_BIT(unit); - else if ((VB->TexCoordPtr[unit]->size >= 3) && + else if ((VB->AttribPtr[_TNL_ATTRIB_TEX0 + unit]->size >= 3) && ((ctx->Texture.Unit[unit]._ReallyEnabled & (TEXTURE_CUBE_BIT)) == 0)) { - GLuint swaptexmatcol = (VB->TexCoordPtr[unit]->size - 3); + GLuint swaptexmatcol = (VB->AttribPtr[_TNL_ATTRIB_TEX0 + unit]->size - 3); if (((rmesa->NeedTexMatrix >> unit) & 1) && (swaptexmatcol != ((rmesa->TexMatColSwap >> unit) & 1))) radeonUploadTexMatrix( rmesa, unit, swaptexmatcol ) ; diff --git a/src/mesa/drivers/dri/radeon/radeon_swtcl.c b/src/mesa/drivers/dri/radeon/radeon_swtcl.c index e61f59eaea..6bbe8e252e 100644 --- a/src/mesa/drivers/dri/radeon/radeon_swtcl.c +++ b/src/mesa/drivers/dri/radeon/radeon_swtcl.c @@ -179,7 +179,7 @@ static void radeonSetVertexFormat( GLcontext *ctx ) for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX(i) )) { - GLuint sz = VB->TexCoordPtr[i]->size; + GLuint sz = VB->AttribPtr[_TNL_ATTRIB_TEX0 + i]->size; switch (sz) { case 1: diff --git a/src/mesa/drivers/dri/savage/savagerender.c b/src/mesa/drivers/dri/savage/savagerender.c index 32c74f9467..8221edf387 100644 --- a/src/mesa/drivers/dri/savage/savagerender.c +++ b/src/mesa/drivers/dri/savage/savagerender.c @@ -252,13 +252,13 @@ static GLboolean run_texnorm_stage( GLcontext *ctx, const GLboolean normalizeS = (texObj->WrapS == GL_REPEAT); const GLboolean normalizeT = (reallyEnabled & TEXTURE_2D_BIT) && (texObj->WrapT == GL_REPEAT); - const GLfloat *in = (GLfloat *)VB->TexCoordPtr[i]->data; - const GLint instride = VB->TexCoordPtr[i]->stride; + const GLfloat *in = (GLfloat *)VB->AttribPtr[_TNL_ATTRIB_TEX0 + i]->data; + const GLint instride = VB->AttribPtr[_TNL_ATTRIB_TEX0 + i]->stride; GLfloat (*out)[4] = store->texcoord[i].data; GLint j; if (!ctx->Texture.Unit[i]._ReallyEnabled || - VB->TexCoordPtr[i]->size == 4) + VB->AttribPtr[_TNL_ATTRIB_TEX0 + i]->size == 4) /* Never try to normalize homogenous tex coords! */ continue; @@ -297,7 +297,7 @@ static GLboolean run_texnorm_stage( GLcontext *ctx, } if (normalizeS || normalizeT) - VB->AttribPtr[VERT_ATTRIB_TEX0+i] = VB->TexCoordPtr[i] = &store->texcoord[i]; + VB->AttribPtr[_TNL_ATTRIB_TEX0 + i] = &store->texcoord[i]; } } diff --git a/src/mesa/drivers/dri/savage/savagetris.c b/src/mesa/drivers/dri/savage/savagetris.c index c04763b40e..e9529d1939 100644 --- a/src/mesa/drivers/dri/savage/savagetris.c +++ b/src/mesa/drivers/dri/savage/savagetris.c @@ -879,13 +879,13 @@ static GLboolean savageCheckPTexHack( GLcontext *ctx ) RENDERINPUTS_COPY( index_bitset, tnl->render_inputs_bitset ); - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX0 ) && VB->TexCoordPtr[0]->size == 4) { + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX0 ) && VB->AttribPtr[_TNL_ATTRIB_TEX0]->size == 4) { if (!RENDERINPUTS_TEST_RANGE( index_bitset, _TNL_ATTRIB_TEX1, _TNL_LAST_TEX )) return GL_TRUE; /* apply ptex hack */ else FALLBACK(ctx, SAVAGE_FALLBACK_PROJ_TEXTURE, GL_TRUE); } - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX1 ) && VB->TexCoordPtr[1]->size == 4) + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX1 ) && VB->AttribPtr[_TNL_ATTRIB_TEX1]->size == 4) FALLBACK(ctx, SAVAGE_FALLBACK_PROJ_TEXTURE, GL_TRUE); return GL_FALSE; /* don't apply ptex hack */ @@ -976,13 +976,13 @@ static INLINE GLuint savageChooseVertexFormat_s3d( GLcontext *ctx ) if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX0 )) { if (imesa->ptexHack) EMIT_ATTR( _TNL_ATTRIB_TEX0, EMIT_3F_XYW, SAVAGE_EMIT_STQ0, SAVAGE_SKIP_ST0); - else if (VB->TexCoordPtr[0]->size == 4) + else if (VB->AttribPtr[_TNL_ATTRIB_TEX0]->size == 4) assert (0); /* should be caught by savageCheckPTexHack */ - else if (VB->TexCoordPtr[0]->size >= 2) + else if (VB->AttribPtr[_TNL_ATTRIB_TEX0]->size >= 2) /* The chromium menu emits some 3D tex coords even though no * 3D texture is enabled. Ignore the 3rd coordinate. */ EMIT_ATTR( _TNL_ATTRIB_TEX0, EMIT_2F, SAVAGE_EMIT_ST0, SAVAGE_SKIP_ST0 ); - else if (VB->TexCoordPtr[0]->size == 1) { + else if (VB->AttribPtr[_TNL_ATTRIB_TEX0]->size == 1) { EMIT_ATTR( _TNL_ATTRIB_TEX0, EMIT_1F, SAVAGE_EMIT_S0, SAVAGE_SKIP_S0 ); EMIT_PAD( 4 ); } else @@ -1025,9 +1025,9 @@ static INLINE GLuint savageChooseVertexFormat_s4( GLcontext *ctx ) if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX0 )) { if (imesa->ptexHack) NEED_ATTR( SAVAGE_EMIT_STQ0, SAVAGE_SKIP_ST0); - else if (VB->TexCoordPtr[0]->size == 4) + else if (VB->AttribPtr[_TNL_ATTRIB_TEX0]->size == 4) assert (0); /* should be caught by savageCheckPTexHack */ - else if (VB->TexCoordPtr[0]->size >= 2) + else if (VB->AttribPtr[_TNL_ATTRIB_TEX0]->size >= 2) /* The chromium menu emits some 3D tex coords even though no * 3D texture is enabled. Ignore the 3rd coordinate. */ NEED_ATTR( SAVAGE_EMIT_ST0, SAVAGE_SKIP_ST0 ); @@ -1035,10 +1035,10 @@ static INLINE GLuint savageChooseVertexFormat_s4( GLcontext *ctx ) NEED_ATTR( SAVAGE_EMIT_S0, SAVAGE_SKIP_S0 ); } if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX1 )) { - if (VB->TexCoordPtr[1]->size == 4) + if (VB->AttribPtr[_TNL_ATTRIB_TEX1]->size == 4) /* projective textures are not supported by the hardware */ assert (0); /* should be caught by savageCheckPTexHack */ - else if (VB->TexCoordPtr[1]->size >= 2) + else if (VB->AttribPtr[_TNL_ATTRIB_TEX1]->size >= 2) NEED_ATTR( SAVAGE_EMIT_ST1, SAVAGE_SKIP_ST1 ); else NEED_ATTR( SAVAGE_EMIT_S1, SAVAGE_SKIP_S1 ); diff --git a/src/mesa/drivers/dri/sis/sis_tris.c b/src/mesa/drivers/dri/sis/sis_tris.c index 76d12d07b3..3cf10007b5 100644 --- a/src/mesa/drivers/dri/sis/sis_tris.c +++ b/src/mesa/drivers/dri/sis/sis_tris.c @@ -903,14 +903,14 @@ static void sisRenderStart( GLcontext *ctx ) /* projective textures are not supported by the hardware */ if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX0 )) { - if (VB->TexCoordPtr[0]->size > 2) + if (VB->AttribPtr[_TNL_ATTRIB_TEX0]->size > 2) tex_fallback = GL_TRUE; EMIT_ATTR(_TNL_ATTRIB_TEX0, EMIT_2F); AGPParseSet |= SiS_PS_HAS_UV0; } /* Will only hit tex1 on SiS300 */ if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX1 )) { - if (VB->TexCoordPtr[1]->size > 2) + if (VB->AttribPtr[_TNL_ATTRIB_TEX1]->size > 2) tex_fallback = GL_TRUE; EMIT_ATTR(_TNL_ATTRIB_TEX1, EMIT_2F); AGPParseSet |= SiS_PS_HAS_UV1; diff --git a/src/mesa/drivers/dri/tdfx/tdfx_vbtmp.h b/src/mesa/drivers/dri/tdfx/tdfx_vbtmp.h index 9b780761f4..809d5d7dd9 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_vbtmp.h +++ b/src/mesa/drivers/dri/tdfx/tdfx_vbtmp.h @@ -58,21 +58,21 @@ static void TAG(emit)( GLcontext *ctx, /* fprintf(stderr, "%s\n", __FUNCTION__); */ if (IND & TDFX_TEX0_BIT) { - tc0_stride = VB->TexCoordPtr[tmu0_source]->stride; - tc0 = VB->TexCoordPtr[tmu0_source]->data; + tc0_stride = VB->AttribPtr[_TNL_ATTRIB_TEX0 + tmu0_source]->stride; + tc0 = VB->AttribPtr[_TNL_ATTRIB_TEX0 + tmu0_source]->data; u0scale = fxMesa->sScale0; v0scale = fxMesa->tScale0; if (IND & TDFX_PTEX_BIT) - tc0_size = VB->TexCoordPtr[tmu0_source]->size; + tc0_size = VB->AttribPtr[_TNL_ATTRIB_TEX0 + tmu0_source]->size; } if (IND & TDFX_TEX1_BIT) { - tc1 = VB->TexCoordPtr[tmu1_source]->data; - tc1_stride = VB->TexCoordPtr[tmu1_source]->stride; + tc1 = VB->AttribPtr[_TNL_ATTRIB_TEX0 + tmu1_source]->data; + tc1_stride = VB->AttribPtr[_TNL_ATTRIB_TEX0 + tmu1_source]->stride; u1scale = fxMesa->sScale1; v1scale = fxMesa->tScale1; if (IND & TDFX_PTEX_BIT) - tc1_size = VB->TexCoordPtr[tmu1_source]->size; + tc1_size = VB->AttribPtr[_TNL_ATTRIB_TEX0 + tmu1_source]->size; } if (IND & TDFX_RGBA_BIT) { @@ -168,14 +168,14 @@ static GLboolean TAG(check_tex_sizes)( GLcontext *ctx ) struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; if (IND & TDFX_TEX1_BIT) { - if (VB->TexCoordPtr[0] == 0) - VB->TexCoordPtr[0] = VB->TexCoordPtr[1]; + if (VB->AttribPtr[_TNL_ATTRIB_TEX0] == 0) + VB->AttribPtr[_TNL_ATTRIB_TEX0] = VB->AttribPtr[_TNL_ATTRIB_TEX1]; - if (VB->TexCoordPtr[1]->size == 4) + if (VB->AttribPtr[_TNL_ATTRIB_TEX1]->size == 4) return GL_FALSE; } - if (VB->TexCoordPtr[0]->size == 4) + if (VB->AttribPtr[_TNL_ATTRIB_TEX0]->size == 4) return GL_FALSE; } diff --git a/src/mesa/drivers/dri/unichrome/via_tris.c b/src/mesa/drivers/dri/unichrome/via_tris.c index 79e67620c9..ab457d41dc 100644 --- a/src/mesa/drivers/dri/unichrome/via_tris.c +++ b/src/mesa/drivers/dri/unichrome/via_tris.c @@ -832,13 +832,13 @@ static GLboolean viaCheckPTexHack( GLcontext *ctx ) RENDERINPUTS_COPY( index_bitset, tnl->render_inputs_bitset ); - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX0 ) && VB->TexCoordPtr[0]->size == 4) { + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX0 ) && VB->AttribPtr[_TNL_ATTRIB_TEX0]->size == 4) { if (!RENDERINPUTS_TEST_RANGE( index_bitset, _TNL_ATTRIB_TEX1, _TNL_LAST_TEX )) ptexHack = GL_TRUE; else fallback = GL_TRUE; } - if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX1 ) && VB->TexCoordPtr[1]->size == 4) + if (RENDERINPUTS_TEST( index_bitset, _TNL_ATTRIB_TEX1 ) && VB->AttribPtr[_TNL_ATTRIB_TEX1]->size == 4) fallback = GL_TRUE; FALLBACK(VIA_CONTEXT(ctx), VIA_FALLBACK_PROJ_TEXTURE, fallback); diff --git a/src/mesa/drivers/glide/fxvbtmp.h b/src/mesa/drivers/glide/fxvbtmp.h index f7970c78e2..674d9c6799 100644 --- a/src/mesa/drivers/glide/fxvbtmp.h +++ b/src/mesa/drivers/glide/fxvbtmp.h @@ -62,21 +62,21 @@ static void TAG(emit)( GLcontext *ctx, } if (IND & SETUP_TMU0) { - tc0 = VB->TexCoordPtr[tmu0_source]->data; - tc0_stride = VB->TexCoordPtr[tmu0_source]->stride; + tc0 = VB->AttribPtr[_TNL_ATTRIB_TEX0 + tmu0_source]->data; + tc0_stride = VB->AttribPtr[_TNL_ATTRIB_TEX0 + tmu0_source]->stride; u0scale = fxMesa->s0scale; v0scale = fxMesa->t0scale; if (IND & SETUP_PTEX) - tc0_size = VB->TexCoordPtr[tmu0_source]->size; + tc0_size = VB->AttribPtr[_TNL_ATTRIB_TEX0 + tmu0_source]->size; } if (IND & SETUP_TMU1) { - tc1 = VB->TexCoordPtr[tmu1_source]->data; - tc1_stride = VB->TexCoordPtr[tmu1_source]->stride; + tc1 = VB->AttribPtr[_TNL_ATTRIB_TEX0 + tmu1_source]->data; + tc1_stride = VB->AttribPtr[_TNL_ATTRIB_TEX0 + tmu1_source]->stride; u1scale = fxMesa->s1scale; /* wrong if tmu1_source == 0, possible? */ v1scale = fxMesa->t1scale; if (IND & SETUP_PTEX) - tc1_size = VB->TexCoordPtr[tmu1_source]->size; + tc1_size = VB->AttribPtr[_TNL_ATTRIB_TEX0 + tmu1_source]->size; } if (IND & SETUP_RGBA) { @@ -220,14 +220,15 @@ static GLboolean TAG(check_tex_sizes)( GLcontext *ctx ) struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; if (IND & SETUP_TMU1) { - if (VB->TexCoordPtr[0] == 0) - VB->TexCoordPtr[0] = VB->TexCoordPtr[1]; + if (VB->AttribPtr[_TNL_ATTRIB_TEX0] == 0) + VB->AttribPtr[_TNL_ATTRIB_TEX0] = VB->AttribPtr[_TNL_ATTRIB_TEX1]; - if (VB->TexCoordPtr[1]->size == 4) + if (VB->AttribPtr[_TNL_ATTRIB_TEX1]->size == 4) return GL_FALSE; } - if (VB->TexCoordPtr[0] && VB->TexCoordPtr[0]->size == 4) + if (VB->AttribPtr[_TNL_ATTRIB_TEX0] && + VB->AttribPtr[_TNL_ATTRIB_TEX0]->size == 4) return GL_FALSE; } diff --git a/src/mesa/drivers/windows/gldirect/dx7/gld_primitive_dx7.c b/src/mesa/drivers/windows/gldirect/dx7/gld_primitive_dx7.c index c99ba0bba5..aa2e7e3a8d 100644 --- a/src/mesa/drivers/windows/gldirect/dx7/gld_primitive_dx7.c +++ b/src/mesa/drivers/windows/gldirect/dx7/gld_primitive_dx7.c @@ -259,15 +259,15 @@ pV->Diffuse = dwColor; #define GLD_SETUP_TEX0_3D(v) \ - if (VB->TexCoordPtr[0]) { \ - tc = VB->TexCoordPtr[0]->data; \ + if (VB->AttribPtr[_TNL_ATTRIB_TEX0]) { \ + tc = VB->AttribPtr[_TNL_ATTRIB_TEX0]->data; \ pV->TexUnit0.x = tc[##v][0]; \ pV->TexUnit0.y = tc[##v][1]; \ } #define GLD_SETUP_TEX1_3D(v) \ - if (VB->TexCoordPtr[1]) { \ - tc = VB->TexCoordPtr[1]->data; \ + if (VB->AttribPtr[_TNL_ATTRIB_TEX1]) { \ + tc = VB->AttribPtr[_TNL_ATTRIB_TEX1]->data; \ pV->TexUnit1.x = tc[##v][0]; \ pV->TexUnit1.y = tc[##v][1]; \ } diff --git a/src/mesa/drivers/windows/gldirect/dx8/gld_primitive_dx8.c b/src/mesa/drivers/windows/gldirect/dx8/gld_primitive_dx8.c index a5b5462f03..7cc2ef6f30 100644 --- a/src/mesa/drivers/windows/gldirect/dx8/gld_primitive_dx8.c +++ b/src/mesa/drivers/windows/gldirect/dx8/gld_primitive_dx8.c @@ -259,15 +259,15 @@ pV->Diffuse = dwColor; #define GLD_SETUP_TEX0_3D(v) \ - if (VB->TexCoordPtr[0]) { \ - tc = VB->TexCoordPtr[0]->data; \ + if (VB->AttribPtr[_TNL_ATTRIB_TEX0]) { \ + tc = VB->TnlAttribPtr[_TNL_ATTRIB_TEX0]->data; \ pV->TexUnit0.x = tc[##v][0]; \ pV->TexUnit0.y = tc[##v][1]; \ } #define GLD_SETUP_TEX1_3D(v) \ - if (VB->TexCoordPtr[1]) { \ - tc = VB->TexCoordPtr[1]->data; \ + if (VB->TnlAttribPtr[_TNL_ATTRIB_TEX1]) { \ + tc = VB->TnlAttribPtr[_TNL_ATTRIB_TEX1]->data; \ pV->TexUnit1.x = tc[##v][0]; \ pV->TexUnit1.y = tc[##v][1]; \ } diff --git a/src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c b/src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c index 403a9d5f86..3b8af8546e 100644 --- a/src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c +++ b/src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c @@ -259,15 +259,15 @@ pV->Diffuse = dwColor; #define GLD_SETUP_TEX0_3D(v) \ - if (VB->TexCoordPtr[0]) { \ - tc = VB->TexCoordPtr[0]->data; \ + if (VB->AttribPtr[_TNL_ATTRIB_TEX0]) { \ + tc = VB->AttribPtr[_TNL_ATTRIB_TEX0]->data; \ pV->TexUnit0.x = tc[##v][0]; \ pV->TexUnit0.y = tc[##v][1]; \ } #define GLD_SETUP_TEX1_3D(v) \ - if (VB->TexCoordPtr[1]) { \ - tc = VB->TexCoordPtr[1]->data; \ + if (VB->AttribPtr[_TNL_ATTRIB_TEX1]) { \ + tc = VB->AttribPtr[_TNL_ATTRIB_TEX1]->data; \ pV->TexUnit1.x = tc[##v][0]; \ pV->TexUnit1.y = tc[##v][1]; \ } diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h index 504e8c5044..d2b13f1b02 100644 --- a/src/mesa/tnl/t_context.h +++ b/src/mesa/tnl/t_context.h @@ -200,7 +200,7 @@ struct vertex_buffer /* Pointers to current data. * XXX some of these fields alias AttribPtr below and should be removed - * such as TexCoordPtr, FogCoordPtr, etc. + * such as FogCoordPtr, etc. */ GLuint *Elts; GLvector4f *ObjPtr; /* _TNL_BIT_POS */ @@ -212,7 +212,6 @@ struct vertex_buffer GLubyte *ClipMask; /* _TNL_BIT_POS */ GLfloat *NormalLengthPtr; /* _TNL_BIT_NORMAL */ GLboolean *EdgeFlag; /* _TNL_BIT_EDGEFLAG */ - GLvector4f *TexCoordPtr[MAX_TEXTURE_COORD_UNITS]; /* VERT_TEX_0..n */ GLvector4f *IndexPtr[2]; /* _TNL_BIT_INDEX */ GLvector4f *ColorPtr[2]; /* _TNL_BIT_COLOR0 */ GLvector4f *SecondaryColorPtr[2]; /* _TNL_BIT_COLOR1 */ diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c index 2df9444d2b..202c6ae3ce 100644 --- a/src/mesa/tnl/t_draw.c +++ b/src/mesa/tnl/t_draw.c @@ -263,10 +263,6 @@ static void bind_inputs( GLcontext *ctx, VB->SecondaryColorPtr[1] = NULL; VB->FogCoordPtr = VB->AttribPtr[_TNL_ATTRIB_FOG]; - for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { - VB->TexCoordPtr[i] = VB->AttribPtr[_TNL_ATTRIB_TEX0 + i]; - } - /* Clipping and drawing code still requires this to be a packed * array of ubytes which can be written into. TODO: Fix and * remove. diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index e69f7d5766..d76b0a6b9d 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -466,7 +466,6 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage ) VB->AttribPtr[_TNL_ATTRIB_POINTSIZE] = &store->results[VERT_RESULT_PSIZ]; for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { - VB->TexCoordPtr[i] = VB->AttribPtr[_TNL_ATTRIB_TEX0 + i] = &store->results[VERT_RESULT_TEX0 + i]; } diff --git a/src/mesa/tnl/t_vb_texgen.c b/src/mesa/tnl/t_vb_texgen.c index 7c1819b223..83b74c0ebf 100644 --- a/src/mesa/tnl/t_vb_texgen.c +++ b/src/mesa/tnl/t_vb_texgen.c @@ -498,7 +498,6 @@ static GLboolean run_texgen_stage( GLcontext *ctx, store->TexgenFunc[i]( ctx, store, i ); - VB->TexCoordPtr[i] = VB->AttribPtr[VERT_ATTRIB_TEX0 + i] = &store->texcoord[i]; } } diff --git a/src/mesa/tnl/t_vb_texmat.c b/src/mesa/tnl/t_vb_texmat.c index 0abe8cc35d..83688290e5 100644 --- a/src/mesa/tnl/t_vb_texmat.c +++ b/src/mesa/tnl/t_vb_texmat.c @@ -73,7 +73,6 @@ static GLboolean run_texmat_stage( GLcontext *ctx, ctx->TextureMatrixStack[i].Top, VB->AttribPtr[_TNL_ATTRIB_TEX0 + i]); - VB->TexCoordPtr[i] = VB->AttribPtr[VERT_ATTRIB_TEX0+i] = &store->texcoord[i]; } } diff --git a/src/mesa/tnl_dd/t_dd_vbtmp.h b/src/mesa/tnl_dd/t_dd_vbtmp.h index 92dd8931c3..c1cc6ae1bf 100644 --- a/src/mesa/tnl_dd/t_dd_vbtmp.h +++ b/src/mesa/tnl_dd/t_dd_vbtmp.h @@ -153,34 +153,34 @@ static void TAG(emit)( GLcontext *ctx, if (DO_TEX3) { const GLuint t3 = GET_TEXSOURCE(3); - tc3 = VB->TexCoordPtr[t3]->data; - tc3_stride = VB->TexCoordPtr[t3]->stride; + tc3 = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t3]->data; + tc3_stride = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t3]->stride; if (DO_PTEX) - tc3_size = VB->TexCoordPtr[t3]->size; + tc3_size = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t3]->size; } if (DO_TEX2) { const GLuint t2 = GET_TEXSOURCE(2); - tc2 = VB->TexCoordPtr[t2]->data; - tc2_stride = VB->TexCoordPtr[t2]->stride; + tc2 = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t2]->data; + tc2_stride = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t2]->stride; if (DO_PTEX) - tc2_size = VB->TexCoordPtr[t2]->size; + tc2_size = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t2]->size; } if (DO_TEX1) { const GLuint t1 = GET_TEXSOURCE(1); - tc1 = VB->TexCoordPtr[t1]->data; - tc1_stride = VB->TexCoordPtr[t1]->stride; + tc1 = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t1]->data; + tc1_stride = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t1]->stride; if (DO_PTEX) - tc1_size = VB->TexCoordPtr[t1]->size; + tc1_size = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t1]->size; } if (DO_TEX0) { const GLuint t0 = GET_TEXSOURCE(0); - tc0_stride = VB->TexCoordPtr[t0]->stride; - tc0 = VB->TexCoordPtr[t0]->data; + tc0_stride = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t0]->stride; + tc0 = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t0]->data; if (DO_PTEX) - tc0_size = VB->TexCoordPtr[t0]->size; + tc0_size = VB->AttribPtr[_TNL_ATTRIB_TEX0 + t0]->size; } if (DO_RGBA) { @@ -410,22 +410,22 @@ static GLboolean TAG(check_tex_sizes)( GLcontext *ctx ) /* Force 'missing' texcoords to something valid. */ - if (DO_TEX3 && VB->TexCoordPtr[2] == 0) - VB->TexCoordPtr[2] = VB->TexCoordPtr[3]; + if (DO_TEX3 && VB->AttribPtr[_TNL_ATTRIB_TEX0 + 2] == 0) + VB->AttribPtr[_TNL_ATTRIB_TEX0 + 2] = VB->AttribPtr[_TNL_ATTRIB_TEX0 + 3]; - if (DO_TEX2 && VB->TexCoordPtr[1] == 0) - VB->TexCoordPtr[1] = VB->TexCoordPtr[2]; + if (DO_TEX2 && VB->AttribPtr[_TNL_ATTRIB_TEX0 + 1] == 0) + VB->AttribPtr[_TNL_ATTRIB_TEX0 + 1] = VB->AttribPtr[_TNL_ATTRIB_TEX0 + 2]; - if (DO_TEX1 && VB->TexCoordPtr[0] == 0) - VB->TexCoordPtr[0] = VB->TexCoordPtr[1]; + if (DO_TEX1 && VB->AttribPtr[_TNL_ATTRIB_TEX0 + 0] == 0) + VB->AttribPtr[_TNL_ATTRIB_TEX0 + 0] = VB->AttribPtr[_TNL_ATTRIB_TEX0 + 1]; if (DO_PTEX) return GL_TRUE; - if ((DO_TEX3 && VB->TexCoordPtr[GET_TEXSOURCE(3)]->size == 4) || - (DO_TEX2 && VB->TexCoordPtr[GET_TEXSOURCE(2)]->size == 4) || - (DO_TEX1 && VB->TexCoordPtr[GET_TEXSOURCE(1)]->size == 4) || - (DO_TEX0 && VB->TexCoordPtr[GET_TEXSOURCE(0)]->size == 4)) + if ((DO_TEX3 && VB->AttribPtr[_TNL_ATTRIB_TEX0 + GET_TEXSOURCE(3)]->size == 4) || + (DO_TEX2 && VB->AttribPtr[_TNL_ATTRIB_TEX0 + GET_TEXSOURCE(2)]->size == 4) || + (DO_TEX1 && VB->AttribPtr[_TNL_ATTRIB_TEX0 + GET_TEXSOURCE(1)]->size == 4) || + (DO_TEX0 && VB->AttribPtr[_TNL_ATTRIB_TEX0 + GET_TEXSOURCE(0)]->size == 4)) return GL_FALSE; return GL_TRUE; @@ -438,14 +438,14 @@ static GLboolean TAG(check_tex_sizes)( GLcontext *ctx ) /* Force 'missing' texcoords to something valid. */ - if (DO_TEX3 && VB->TexCoordPtr[2] == 0) - VB->TexCoordPtr[2] = VB->TexCoordPtr[3]; + if (DO_TEX3 && VB->AttribPtr[_TNL_ATTRIB_TEX0 + 2] == 0) + VB->AttribPtr[_TNL_ATTRIB_TEX0 + 2] = VB->AttribPtr[_TNL_ATTRIB_TEX0 + 3]; - if (DO_TEX2 && VB->TexCoordPtr[1] == 0) - VB->TexCoordPtr[1] = VB->TexCoordPtr[2]; + if (DO_TEX2 && VB->AttribPtr[_TNL_ATTRIB_TEX0 + 1] == 0) + VB->AttribPtr[_TNL_ATTRIB_TEX0 + 1] = VB->AttribPtr[_TNL_ATTRIB_TEX0 + 2]; - if (DO_TEX1 && VB->TexCoordPtr[0] == 0) - VB->TexCoordPtr[0] = VB->TexCoordPtr[1]; + if (DO_TEX1 && VB->AttribPtr[_TNL_ATTRIB_TEX0 + 0] == 0) + VB->AttribPtr[_TNL_ATTRIB_TEX0 + 0] = VB->AttribPtr[_TNL_ATTRIB_TEX0 + 1]; if (DO_PTEX) return GL_TRUE; @@ -453,14 +453,14 @@ static GLboolean TAG(check_tex_sizes)( GLcontext *ctx ) /* No hardware support for projective texture. Can fake it for * TEX0 only. */ - if ((DO_TEX3 && VB->TexCoordPtr[GET_TEXSOURCE(3)]->size == 4) || - (DO_TEX2 && VB->TexCoordPtr[GET_TEXSOURCE(2)]->size == 4) || - (DO_TEX1 && VB->TexCoordPtr[GET_TEXSOURCE(1)]->size == 4)) { + if ((DO_TEX3 && VB->AttribPtr[_TNL_ATTRIB_TEX0 + GET_TEXSOURCE(3)]->size == 4) || + (DO_TEX2 && VB->AttribPtr[_TNL_ATTRIB_TEX0 + GET_TEXSOURCE(2)]->size == 4) || + (DO_TEX1 && VB->AttribPtr[_TNL_ATTRIB_TEX0 + GET_TEXSOURCE(1)]->size == 4)) { PTEX_FALLBACK(); return GL_FALSE; } - if (DO_TEX0 && VB->TexCoordPtr[GET_TEXSOURCE(0)]->size == 4) { + if (DO_TEX0 && VB->AttribPtr[_TNL_ATTRIB_TEX0 + GET_TEXSOURCE(0)]->size == 4) { if (DO_TEX1 || DO_TEX2 || DO_TEX3) { PTEX_FALLBACK(); } diff --git a/src/mesa/x86/gen_matypes.c b/src/mesa/x86/gen_matypes.c index f78a277601..a70fdc1fa0 100644 --- a/src/mesa/x86/gen_matypes.c +++ b/src/mesa/x86/gen_matypes.c @@ -128,10 +128,10 @@ int main( int argc, char **argv ) OFFSET( "VB_CLIP_MASK ", struct vertex_buffer, ClipMask ); OFFSET( "VB_NORMAL_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_NORMAL] ); OFFSET( "VB_EDGE_FLAG ", struct vertex_buffer, EdgeFlag ); - OFFSET( "VB_TEX0_COORD_PTR ", struct vertex_buffer, TexCoordPtr[0] ); - OFFSET( "VB_TEX1_COORD_PTR ", struct vertex_buffer, TexCoordPtr[1] ); - OFFSET( "VB_TEX2_COORD_PTR ", struct vertex_buffer, TexCoordPtr[2] ); - OFFSET( "VB_TEX3_COORD_PTR ", struct vertex_buffer, TexCoordPtr[3] ); + OFFSET( "VB_TEX0_COORD_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_TEX0] ); + OFFSET( "VB_TEX1_COORD_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_TEX1] ); + OFFSET( "VB_TEX2_COORD_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_TEX2] ); + OFFSET( "VB_TEX3_COORD_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_TEX3] ); OFFSET( "VB_INDEX_PTR ", struct vertex_buffer, IndexPtr ); OFFSET( "VB_COLOR_PTR ", struct vertex_buffer, ColorPtr ); OFFSET( "VB_SECONDARY_COLOR_PTR ", struct vertex_buffer, SecondaryColorPtr ); -- cgit v1.2.3 From 165b860da6f16ef4817a4959774a57f57ba3756d Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 17 Nov 2009 23:27:13 -0800 Subject: tnl: Replace deprecated ObjPtr with AttribPtr[_TNL_ATTRIB_POS] --- src/mesa/drivers/dri/radeon/radeon_maos_arrays.c | 8 ++++---- src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h | 4 ++-- src/mesa/drivers/dri/radeon/radeon_maos_verts.c | 16 ++++++++-------- .../drivers/windows/gldirect/dx7/gld_primitive_dx7.c | 2 +- .../drivers/windows/gldirect/dx8/gld_primitive_dx8.c | 2 +- .../drivers/windows/gldirect/dx9/gld_primitive_dx9.c | 2 +- src/mesa/tnl/t_context.h | 1 - src/mesa/tnl/t_draw.c | 1 - src/mesa/tnl/t_vb_fog.c | 13 +++++++------ src/mesa/tnl/t_vb_light.c | 10 +++++----- src/mesa/tnl/t_vb_texgen.c | 2 +- src/mesa/tnl/t_vb_vertex.c | 6 +++--- src/mesa/x86/gen_matypes.c | 2 +- 13 files changed, 34 insertions(+), 35 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c b/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c index 1cd1d6e778..74b66900c9 100644 --- a/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c +++ b/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c @@ -196,12 +196,12 @@ void radeonEmitArrays( GLcontext *ctx, GLuint inputs ) if (!rmesa->tcl.obj.buf) rcommon_emit_vector( ctx, &(rmesa->tcl.aos[nr]), - (char *)VB->ObjPtr->data, - VB->ObjPtr->size, - VB->ObjPtr->stride, + (char *)VB->AttribPtr[_TNL_ATTRIB_POS]->data, + VB->AttribPtr[_TNL_ATTRIB_POS]->size, + VB->AttribPtr[_TNL_ATTRIB_POS]->stride, count); - switch( VB->ObjPtr->size ) { + switch( VB->AttribPtr[_TNL_ATTRIB_POS]->size ) { case 4: vfmt |= RADEON_CP_VC_FRMT_W0; case 3: vfmt |= RADEON_CP_VC_FRMT_Z; case 2: vfmt |= RADEON_CP_VC_FRMT_XY; diff --git a/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h b/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h index cb57416c3e..efb06db80e 100644 --- a/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h +++ b/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h @@ -56,8 +56,8 @@ static void TAG(emit)( GLcontext *ctx, radeon_print(RADEON_SWRENDER, RADEON_VERBOSE, "%s\n", __FUNCTION__); - coord = (GLuint (*)[4])VB->ObjPtr->data; - coord_stride = VB->ObjPtr->stride; + coord = (GLuint (*)[4])VB->AttribPtr[_TNL_ATTRIB_POS]->data; + coord_stride = VB->AttribPtr[_TNL_ATTRIB_POS]->stride; if (DO_TEX2) { if (VB->AttribPtr[_TNL_ATTRIB_TEX2]) { diff --git a/src/mesa/drivers/dri/radeon/radeon_maos_verts.c b/src/mesa/drivers/dri/radeon/radeon_maos_verts.c index a6aff69aac..5ed11d0a9d 100644 --- a/src/mesa/drivers/dri/radeon/radeon_maos_verts.c +++ b/src/mesa/drivers/dri/radeon/radeon_maos_verts.c @@ -326,7 +326,7 @@ void radeonEmitArrays( GLcontext *ctx, GLuint inputs ) if (1) { req |= RADEON_CP_VC_FRMT_Z; - if (VB->ObjPtr->size == 4) { + if (VB->AttribPtr[_TNL_ATTRIB_POS]->size == 4) { req |= RADEON_CP_VC_FRMT_W0; } } @@ -390,19 +390,19 @@ void radeonEmitArrays( GLcontext *ctx, GLuint inputs ) * this, add more vertex code (for obj-2, obj-3) or preferably move * to maos. */ - if (VB->ObjPtr->size < 3 || - (VB->ObjPtr->size == 3 && + if (VB->AttribPtr[_TNL_ATTRIB_POS]->size < 3 || + (VB->AttribPtr[_TNL_ATTRIB_POS]->size == 3 && (setup_tab[i].vertex_format & RADEON_CP_VC_FRMT_W0))) { _math_trans_4f( rmesa->tcl.ObjClean.data, - VB->ObjPtr->data, - VB->ObjPtr->stride, + VB->AttribPtr[_TNL_ATTRIB_POS]->data, + VB->AttribPtr[_TNL_ATTRIB_POS]->stride, GL_FLOAT, - VB->ObjPtr->size, + VB->AttribPtr[_TNL_ATTRIB_POS]->size, 0, VB->Count ); - switch (VB->ObjPtr->size) { + switch (VB->AttribPtr[_TNL_ATTRIB_POS]->size) { case 1: _mesa_vector4f_clean_elem(&rmesa->tcl.ObjClean, VB->Count, 1); case 2: @@ -416,7 +416,7 @@ void radeonEmitArrays( GLcontext *ctx, GLuint inputs ) break; } - VB->ObjPtr = &rmesa->tcl.ObjClean; + VB->AttribPtr[_TNL_ATTRIB_POS] = &rmesa->tcl.ObjClean; } diff --git a/src/mesa/drivers/windows/gldirect/dx7/gld_primitive_dx7.c b/src/mesa/drivers/windows/gldirect/dx7/gld_primitive_dx7.c index aa2e7e3a8d..46e652dc73 100644 --- a/src/mesa/drivers/windows/gldirect/dx7/gld_primitive_dx7.c +++ b/src/mesa/drivers/windows/gldirect/dx7/gld_primitive_dx7.c @@ -241,7 +241,7 @@ DWORD dwColor; #define GLD_SETUP_3D_VERTEX(v) \ - p4f = VB->ObjPtr->data; \ + p4f = VB->AttribPtr[_TNL_ATTRIB_POS]->data; \ pV->Position.x = p4f[##v][0]; \ pV->Position.y = p4f[##v][1]; \ pV->Position.z = p4f[##v][2]; diff --git a/src/mesa/drivers/windows/gldirect/dx8/gld_primitive_dx8.c b/src/mesa/drivers/windows/gldirect/dx8/gld_primitive_dx8.c index 7cc2ef6f30..b95351553c 100644 --- a/src/mesa/drivers/windows/gldirect/dx8/gld_primitive_dx8.c +++ b/src/mesa/drivers/windows/gldirect/dx8/gld_primitive_dx8.c @@ -241,7 +241,7 @@ DWORD dwColor; #define GLD_SETUP_3D_VERTEX(v) \ - p4f = VB->ObjPtr->data; \ + p4f = VB->AttribPtr[_TNL_ATTRIB_POS]->data; \ pV->Position.x = p4f[##v][0]; \ pV->Position.y = p4f[##v][1]; \ pV->Position.z = p4f[##v][2]; diff --git a/src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c b/src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c index 3b8af8546e..1b84cdee28 100644 --- a/src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c +++ b/src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c @@ -241,7 +241,7 @@ DWORD dwColor; #define GLD_SETUP_3D_VERTEX(v) \ - p4f = VB->ObjPtr->data; \ + p4f = VB->AttribPtr[_TNL_ATTRIB_POS]->data; \ pV->Position.x = p4f[##v][0]; \ pV->Position.y = p4f[##v][1]; \ pV->Position.z = p4f[##v][2]; diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h index d2b13f1b02..bfba09fd56 100644 --- a/src/mesa/tnl/t_context.h +++ b/src/mesa/tnl/t_context.h @@ -203,7 +203,6 @@ struct vertex_buffer * such as FogCoordPtr, etc. */ GLuint *Elts; - GLvector4f *ObjPtr; /* _TNL_BIT_POS */ GLvector4f *EyePtr; /* _TNL_BIT_POS */ GLvector4f *ClipPtr; /* _TNL_BIT_POS */ GLvector4f *NdcPtr; /* _TNL_BIT_POS */ diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c index 202c6ae3ce..2a293243e5 100644 --- a/src/mesa/tnl/t_draw.c +++ b/src/mesa/tnl/t_draw.c @@ -254,7 +254,6 @@ static void bind_inputs( GLcontext *ctx, /* Legacy pointers -- remove one day. */ - VB->ObjPtr = VB->AttribPtr[_TNL_ATTRIB_POS]; VB->ColorPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR0]; VB->ColorPtr[1] = NULL; VB->IndexPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR_INDEX]; diff --git a/src/mesa/tnl/t_vb_fog.c b/src/mesa/tnl/t_vb_fog.c index f3a7bd49f4..a68310de4d 100644 --- a/src/mesa/tnl/t_vb_fog.c +++ b/src/mesa/tnl/t_vb_fog.c @@ -156,7 +156,7 @@ run_fog_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage) GLuint i; GLfloat *coord; /* Fog is computed from vertex or fragment Z values */ - /* source = VB->ObjPtr or VB->EyePtr coords */ + /* source = VB->AttribPtr[_TNL_ATTRIB_POS] or VB->EyePtr coords */ /* dest = VB->AttribPtr[_TNL_ATTRIB_FOG] = fog stage private storage */ VB->AttribPtr[_TNL_ATTRIB_FOG] = &store->fogcoord; @@ -176,11 +176,12 @@ run_fog_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage) /* Full eye coords weren't required, just calculate the * eye Z values. */ - _mesa_dotprod_tab[VB->ObjPtr->size]( (GLfloat *) input->data, - 4 * sizeof(GLfloat), - VB->ObjPtr, plane ); + _mesa_dotprod_tab[VB->AttribPtr[_TNL_ATTRIB_POS]->size] + ( (GLfloat *) input->data, + 4 * sizeof(GLfloat), + VB->AttribPtr[_TNL_ATTRIB_POS], plane ); - input->count = VB->ObjPtr->count; + input->count = VB->AttribPtr[_TNL_ATTRIB_POS]->count; /* make sure coords are really positive NOTE should avoid going through array twice */ @@ -213,7 +214,7 @@ run_fog_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage) /* input->count may be one if glFogCoord was only called once * before glBegin. But we need to compute fog for all vertices. */ - input->count = VB->ObjPtr->count; + input->count = VB->AttribPtr[_TNL_ATTRIB_POS]->count; VB->AttribPtr[_TNL_ATTRIB_FOG] = &store->fogcoord; /* dest data */ } diff --git a/src/mesa/tnl/t_vb_light.c b/src/mesa/tnl/t_vb_light.c index f47f99397c..360452192d 100644 --- a/src/mesa/tnl/t_vb_light.c +++ b/src/mesa/tnl/t_vb_light.c @@ -200,7 +200,7 @@ static GLboolean run_lighting( GLcontext *ctx, struct light_stage_data *store = LIGHT_STAGE_DATA(stage); TNLcontext *tnl = TNL_CONTEXT(ctx); struct vertex_buffer *VB = &tnl->vb; - GLvector4f *input = ctx->_NeedEyeCoords ? VB->EyePtr : VB->ObjPtr; + GLvector4f *input = ctx->_NeedEyeCoords ? VB->EyePtr : VB->AttribPtr[_TNL_ATTRIB_POS]; GLuint idx; if (!ctx->Light.Enabled || ctx->VertexProgram._Current) @@ -208,13 +208,13 @@ static GLboolean run_lighting( GLcontext *ctx, /* Make sure we can talk about position x,y and z: */ - if (input->size <= 2 && input == VB->ObjPtr) { + if (input->size <= 2 && input == VB->AttribPtr[_TNL_ATTRIB_POS]) { _math_trans_4f( store->Input.data, - VB->ObjPtr->data, - VB->ObjPtr->stride, + VB->AttribPtr[_TNL_ATTRIB_POS]->data, + VB->AttribPtr[_TNL_ATTRIB_POS]->stride, GL_FLOAT, - VB->ObjPtr->size, + VB->AttribPtr[_TNL_ATTRIB_POS]->size, 0, VB->Count ); diff --git a/src/mesa/tnl/t_vb_texgen.c b/src/mesa/tnl/t_vb_texgen.c index 83b74c0ebf..9ef13bc96d 100644 --- a/src/mesa/tnl/t_vb_texgen.c +++ b/src/mesa/tnl/t_vb_texgen.c @@ -341,7 +341,7 @@ static void texgen( GLcontext *ctx, GLvector4f *in = VB->AttribPtr[VERT_ATTRIB_TEX0 + unit]; GLvector4f *out = &store->texcoord[unit]; const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; - const GLvector4f *obj = VB->ObjPtr; + const GLvector4f *obj = VB->AttribPtr[_TNL_ATTRIB_POS]; const GLvector4f *eye = VB->EyePtr; const GLvector4f *normal = VB->AttribPtr[_TNL_ATTRIB_NORMAL]; const GLfloat *m = store->tmp_m; diff --git a/src/mesa/tnl/t_vb_vertex.c b/src/mesa/tnl/t_vb_vertex.c index 4734754ea4..bc7e0951ec 100644 --- a/src/mesa/tnl/t_vb_vertex.c +++ b/src/mesa/tnl/t_vb_vertex.c @@ -152,16 +152,16 @@ static GLboolean run_vertex_stage( GLcontext *ctx, * Use combined ModelProject to avoid some depth artifacts */ if (ctx->ModelviewMatrixStack.Top->type == MATRIX_IDENTITY) - VB->EyePtr = VB->ObjPtr; + VB->EyePtr = VB->AttribPtr[_TNL_ATTRIB_POS]; else VB->EyePtr = TransformRaw( &store->eye, ctx->ModelviewMatrixStack.Top, - VB->ObjPtr); + VB->AttribPtr[_TNL_ATTRIB_POS]); } VB->ClipPtr = TransformRaw( &store->clip, &ctx->_ModelProjectMatrix, - VB->ObjPtr ); + VB->AttribPtr[_TNL_ATTRIB_POS] ); /* Drivers expect this to be clean to element 4... */ diff --git a/src/mesa/x86/gen_matypes.c b/src/mesa/x86/gen_matypes.c index a70fdc1fa0..61d6d16a76 100644 --- a/src/mesa/x86/gen_matypes.c +++ b/src/mesa/x86/gen_matypes.c @@ -120,7 +120,7 @@ int main( int argc, char **argv ) OFFSET( "VB_COUNT ", struct vertex_buffer, Count ); printf( "\n" ); OFFSET( "VB_ELTS ", struct vertex_buffer, Elts ); - OFFSET( "VB_OBJ_PTR ", struct vertex_buffer, ObjPtr ); + OFFSET( "VB_OBJ_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_POS] ); OFFSET( "VB_EYE_PTR ", struct vertex_buffer, EyePtr ); OFFSET( "VB_CLIP_PTR ", struct vertex_buffer, ClipPtr ); OFFSET( "VB_PROJ_CLIP_PTR ", struct vertex_buffer, NdcPtr ); -- cgit v1.2.3 From fc9a2970dc539b21b035ea0a770ec69822962145 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 17 Nov 2009 23:38:35 -0800 Subject: tnl: Replace deprecated IndexPtr[] with AttribPtr[] or new BackfaceIndexPtr --- src/mesa/swrast_setup/ss_tritmp.h | 2 +- src/mesa/tnl/t_context.h | 7 +++++-- src/mesa/tnl/t_draw.c | 3 +-- src/mesa/tnl/t_vb_light.c | 1 - src/mesa/tnl/t_vb_lighttmp.h | 8 ++++---- src/mesa/tnl/t_vertex_generic.c | 12 ++++++------ src/mesa/tnl_dd/t_dd_tritmp.h | 4 ++-- src/mesa/x86/gen_matypes.c | 2 +- 8 files changed, 20 insertions(+), 19 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/swrast_setup/ss_tritmp.h b/src/mesa/swrast_setup/ss_tritmp.h index 724b5e94fa..9700cf8c54 100644 --- a/src/mesa/swrast_setup/ss_tritmp.h +++ b/src/mesa/swrast_setup/ss_tritmp.h @@ -127,7 +127,7 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) } } } else { - GLfloat *vbindex = (GLfloat *)VB->IndexPtr[1]->data; + GLfloat *vbindex = (GLfloat *)VB->BackfaceIndexPtr->data; saved_index[0] = v[0]->attrib[FRAG_ATTRIB_CI][0]; saved_index[1] = v[1]->attrib[FRAG_ATTRIB_CI][0]; saved_index[2] = v[2]->attrib[FRAG_ATTRIB_CI][0]; diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h index bfba09fd56..b41cf93897 100644 --- a/src/mesa/tnl/t_context.h +++ b/src/mesa/tnl/t_context.h @@ -198,7 +198,10 @@ struct vertex_buffer */ GLuint Count; /**< Number of vertices currently in buffer */ - /* Pointers to current data. + /* Pointers to current data. Most of the data is in AttribPtr -- all of + * it that is one of VERT_ATTRIB_X. For things only produced by TNL, + * such as backface color or eye-space coordinates, they are stored + * here. * XXX some of these fields alias AttribPtr below and should be removed * such as FogCoordPtr, etc. */ @@ -211,7 +214,7 @@ struct vertex_buffer GLubyte *ClipMask; /* _TNL_BIT_POS */ GLfloat *NormalLengthPtr; /* _TNL_BIT_NORMAL */ GLboolean *EdgeFlag; /* _TNL_BIT_EDGEFLAG */ - GLvector4f *IndexPtr[2]; /* _TNL_BIT_INDEX */ + GLvector4f *BackfaceIndexPtr; /* _TNL_BIT_INDEX */ GLvector4f *ColorPtr[2]; /* _TNL_BIT_COLOR0 */ GLvector4f *SecondaryColorPtr[2]; /* _TNL_BIT_COLOR1 */ GLvector4f *FogCoordPtr; /* _TNL_BIT_FOG */ diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c index 2a293243e5..8092627645 100644 --- a/src/mesa/tnl/t_draw.c +++ b/src/mesa/tnl/t_draw.c @@ -256,8 +256,7 @@ static void bind_inputs( GLcontext *ctx, */ VB->ColorPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR0]; VB->ColorPtr[1] = NULL; - VB->IndexPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR_INDEX]; - VB->IndexPtr[1] = NULL; + VB->BackfaceIndexPtr = NULL; VB->SecondaryColorPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR1]; VB->SecondaryColorPtr[1] = NULL; VB->FogCoordPtr = VB->AttribPtr[_TNL_ATTRIB_FOG]; diff --git a/src/mesa/tnl/t_vb_light.c b/src/mesa/tnl/t_vb_light.c index 360452192d..e72a807f0d 100644 --- a/src/mesa/tnl/t_vb_light.c +++ b/src/mesa/tnl/t_vb_light.c @@ -248,7 +248,6 @@ static GLboolean run_lighting( GLcontext *ctx, VB->AttribPtr[_TNL_ATTRIB_COLOR0] = VB->ColorPtr[0]; VB->AttribPtr[_TNL_ATTRIB_COLOR1] = VB->SecondaryColorPtr[0]; - VB->AttribPtr[_TNL_ATTRIB_COLOR_INDEX] = VB->IndexPtr[0]; return GL_TRUE; } diff --git a/src/mesa/tnl/t_vb_lighttmp.h b/src/mesa/tnl/t_vb_lighttmp.h index 124ca3c74f..dd117e435c 100644 --- a/src/mesa/tnl/t_vb_lighttmp.h +++ b/src/mesa/tnl/t_vb_lighttmp.h @@ -665,14 +665,14 @@ static void TAG(light_ci)( GLcontext *ctx, fprintf(stderr, "%s\n", __FUNCTION__ ); #endif - VB->IndexPtr[0] = &store->LitIndex[0]; + VB->AttribPtr[_TNL_ATTRIB_COLOR_INDEX] = &store->LitIndex[0]; #if IDX & LIGHT_TWOSIDE - VB->IndexPtr[1] = &store->LitIndex[1]; + VB->BackfaceIndexPtr = &store->LitIndex[1]; #endif - indexResult[0] = (GLfloat *)VB->IndexPtr[0]->data; + indexResult[0] = (GLfloat *)VB->AttribPtr[_TNL_ATTRIB_COLOR_INDEX]->data; #if IDX & LIGHT_TWOSIDE - indexResult[1] = (GLfloat *)VB->IndexPtr[1]->data; + indexResult[1] = (GLfloat *)VB->BackfaceIndexPtr->data; #endif /* loop over vertices */ diff --git a/src/mesa/tnl/t_vertex_generic.c b/src/mesa/tnl/t_vertex_generic.c index 9812f8c808..f97ad7c2ed 100644 --- a/src/mesa/tnl/t_vertex_generic.c +++ b/src/mesa/tnl/t_vertex_generic.c @@ -1115,10 +1115,10 @@ void _tnl_generic_interp_extras( GLcontext *ctx, VB->SecondaryColorPtr[1]->data[in] ); } - if (VB->IndexPtr[1]) { - VB->IndexPtr[1]->data[dst][0] = LINTERP( t, - VB->IndexPtr[1]->data[out][0], - VB->IndexPtr[1]->data[in][0] ); + if (VB->BackfaceIndexPtr) { + VB->BackfaceIndexPtr->data[dst][0] = LINTERP( t, + VB->BackfaceIndexPtr->data[out][0], + VB->BackfaceIndexPtr->data[in][0] ); } if (VB->EdgeFlag) { @@ -1145,8 +1145,8 @@ void _tnl_generic_copy_pv_extras( GLcontext *ctx, VB->SecondaryColorPtr[1]->data[src] ); } - if (VB->IndexPtr[1]) { - VB->IndexPtr[1]->data[dst][0] = VB->IndexPtr[1]->data[src][0]; + if (VB->BackfaceIndexPtr) { + VB->BackfaceIndexPtr->data[dst][0] = VB->BackfaceIndexPtr->data[src][0]; } _tnl_generic_copy_pv(ctx, dst, src); diff --git a/src/mesa/tnl_dd/t_dd_tritmp.h b/src/mesa/tnl_dd/t_dd_tritmp.h index 1ae70f4059..0e3bc1329d 100644 --- a/src/mesa/tnl_dd/t_dd_tritmp.h +++ b/src/mesa/tnl_dd/t_dd_tritmp.h @@ -237,7 +237,7 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) } } else { - GLfloat (*vbindex) = (GLfloat *)VB->IndexPtr[1]->data; + GLfloat (*vbindex) = (GLfloat *)VB->BackfaceIndexPtr->data; if (!DO_FLAT) { VERT_SAVE_IND( 0 ); VERT_SAVE_IND( 1 ); @@ -506,7 +506,7 @@ static void TAG(quadr)( GLcontext *ctx, } } else { - GLfloat *vbindex = (GLfloat *)VB->IndexPtr[1]->data; + GLfloat *vbindex = (GLfloat *)VB->BackfaceIndexPtr->data; if (!DO_FLAT) { VERT_SAVE_IND( 0 ); VERT_SAVE_IND( 1 ); diff --git a/src/mesa/x86/gen_matypes.c b/src/mesa/x86/gen_matypes.c index 61d6d16a76..5355c26874 100644 --- a/src/mesa/x86/gen_matypes.c +++ b/src/mesa/x86/gen_matypes.c @@ -132,7 +132,7 @@ int main( int argc, char **argv ) OFFSET( "VB_TEX1_COORD_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_TEX1] ); OFFSET( "VB_TEX2_COORD_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_TEX2] ); OFFSET( "VB_TEX3_COORD_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_TEX3] ); - OFFSET( "VB_INDEX_PTR ", struct vertex_buffer, IndexPtr ); + OFFSET( "VB_INDEX_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_COLOR_INDEX] ); OFFSET( "VB_COLOR_PTR ", struct vertex_buffer, ColorPtr ); OFFSET( "VB_SECONDARY_COLOR_PTR ", struct vertex_buffer, SecondaryColorPtr ); OFFSET( "VB_FOG_COORD_PTR ", struct vertex_buffer, FogCoordPtr ); -- cgit v1.2.3 From 0a9187801505130738ae947c69cafa8a1dd118d1 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 18 Nov 2009 01:38:55 -0800 Subject: tnl: Replace deprecated ColorPtr[] with AttribPtr or new BackfaceColorPtr. --- src/mesa/drivers/dri/ffb/ffb_vbtmp.h | 8 ++--- src/mesa/drivers/dri/gamma/gamma_render.c | 4 +-- src/mesa/drivers/dri/mach64/mach64_native_vb.c | 30 +++++++++---------- src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h | 10 +++---- src/mesa/drivers/dri/mach64/mach64_vbtmp.h | 16 +++++----- src/mesa/drivers/dri/r300/r300_swtcl.c | 4 +-- src/mesa/drivers/dri/radeon/radeon_maos_arrays.c | 14 ++++----- src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h | 12 ++++---- src/mesa/drivers/dri/tdfx/tdfx_vb.c | 14 ++++----- src/mesa/drivers/dri/tdfx/tdfx_vbtmp.h | 6 ++-- src/mesa/drivers/glide/fxvb.c | 34 +++++++++++----------- src/mesa/drivers/glide/fxvbtmp.h | 10 +++---- .../windows/gldirect/dx7/gld_primitive_dx7.c | 10 +++---- .../windows/gldirect/dx7/gld_vb_d3d_render_dx7.c | 2 +- .../windows/gldirect/dx8/gld_primitive_dx8.c | 10 +++---- .../windows/gldirect/dx8/gld_vb_d3d_render_dx8.c | 2 +- .../windows/gldirect/dx9/gld_primitive_dx9.c | 10 +++---- .../windows/gldirect/dx9/gld_vb_d3d_render_dx9.c | 2 +- src/mesa/swrast_setup/ss_tritmp.h | 16 +++++----- src/mesa/tnl/t_context.h | 6 ++-- src/mesa/tnl/t_draw.c | 6 ++-- src/mesa/tnl/t_vb_light.c | 5 +--- src/mesa/tnl/t_vb_lighttmp.h | 20 ++++++------- src/mesa/tnl/t_vb_program.c | 8 ++--- src/mesa/tnl/t_vertex_generic.c | 34 +++++++++++----------- src/mesa/tnl_dd/t_dd_dmatmp.h | 4 +-- src/mesa/tnl_dd/t_dd_tritmp.h | 34 +++++++++++----------- src/mesa/tnl_dd/t_dd_vb.c | 30 +++++++++---------- src/mesa/tnl_dd/t_dd_vbtmp.h | 18 ++++++------ src/mesa/x86/gen_matypes.c | 4 +-- 30 files changed, 189 insertions(+), 194 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/ffb/ffb_vbtmp.h b/src/mesa/drivers/dri/ffb/ffb_vbtmp.h index 0495d0e276..c548ef3ad5 100644 --- a/src/mesa/drivers/dri/ffb/ffb_vbtmp.h +++ b/src/mesa/drivers/dri/ffb/ffb_vbtmp.h @@ -38,11 +38,11 @@ static void TAG(emit)(GLcontext *ctx, GLuint start, GLuint end) #endif #if (IND & (FFB_VB_RGBA_BIT)) - col0 = VB->ColorPtr[0]->data; - col0_stride = VB->ColorPtr[0]->stride; + col0 = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data; + col0_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride; #if (IND & (FFB_VB_TWOSIDE_BIT)) - col1 = VB->ColorPtr[1]->data; - col1_stride = VB->ColorPtr[1]->stride; + col1 = VB->BackfaceColorPtr->data; + col1_stride = VB->BackfaceColorPtr->stride; #endif #endif diff --git a/src/mesa/drivers/dri/gamma/gamma_render.c b/src/mesa/drivers/dri/gamma/gamma_render.c index 741936488a..a03a93d132 100644 --- a/src/mesa/drivers/dri/gamma/gamma_render.c +++ b/src/mesa/drivers/dri/gamma/gamma_render.c @@ -53,8 +53,8 @@ static void gamma_emit( GLcontext *ctx, GLuint start, GLuint end) GLfloat (*tc0)[4] = 0; GLuint tc0_size = 0; - col = VB->ColorPtr[0]->data; - col_stride = VB->ColorPtr[0]->stride; + col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data; + col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride; if (ctx->Texture.Unit[0]._ReallyEnabled) { tc0_stride = VB->AttribPtr[_TNL_ATTRIB_TEX0]->stride; diff --git a/src/mesa/drivers/dri/mach64/mach64_native_vb.c b/src/mesa/drivers/dri/mach64/mach64_native_vb.c index 99f1a14e17..816682ec5f 100644 --- a/src/mesa/drivers/dri/mach64/mach64_native_vb.c +++ b/src/mesa/drivers/dri/mach64/mach64_native_vb.c @@ -207,19 +207,19 @@ INTERP_QUALIFIER void TAG(interp_extras)( GLcontext *ctx, LOCALVARS struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - if (VB->ColorPtr[1]) { - assert(VB->ColorPtr[1]->stride == 4 * sizeof(GLfloat)); + if (VB->BackfaceColorPtr) { + assert(VB->BackfaceColorPtr->stride == 4 * sizeof(GLfloat)); INTERP_4F( t, - GET_COLOR(VB->ColorPtr[1], dst), - GET_COLOR(VB->ColorPtr[1], out), - GET_COLOR(VB->ColorPtr[1], in) ); + GET_COLOR(VB->BackfaceColorPtr, dst), + GET_COLOR(VB->BackfaceColorPtr, out), + GET_COLOR(VB->BackfaceColorPtr, in) ); - if (VB->SecondaryColorPtr[1]) { + if (VB->BackfaceSecondaryColorPtr) { INTERP_3F( t, - GET_COLOR(VB->SecondaryColorPtr[1], dst), - GET_COLOR(VB->SecondaryColorPtr[1], out), - GET_COLOR(VB->SecondaryColorPtr[1], in) ); + GET_COLOR(VB->BackfaceSecondaryColorPtr, dst), + GET_COLOR(VB->BackfaceSecondaryColorPtr, out), + GET_COLOR(VB->BackfaceSecondaryColorPtr, in) ); } } @@ -236,13 +236,13 @@ INTERP_QUALIFIER void TAG(copy_pv_extras)( GLcontext *ctx, LOCALVARS struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - if (VB->ColorPtr[1]) { - COPY_4FV( GET_COLOR(VB->ColorPtr[1], dst), - GET_COLOR(VB->ColorPtr[1], src) ); + if (VB->BackfaceColorPtr) { + COPY_4FV( GET_COLOR(VB->BackfaceColorPtr, dst), + GET_COLOR(VB->BackfaceColorPtr, src) ); - if (VB->SecondaryColorPtr[1]) { - COPY_4FV( GET_COLOR(VB->SecondaryColorPtr[1], dst), - GET_COLOR(VB->SecondaryColorPtr[1], src) ); + if (VB->BackfaceSecondaryColorPtr) { + COPY_4FV( GET_COLOR(VB->BackfaceSecondaryColorPtr, dst), + GET_COLOR(VB->BackfaceSecondaryColorPtr, src) ); } } diff --git a/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h b/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h index 1a93e5f034..2af84fa9b6 100644 --- a/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h +++ b/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h @@ -123,9 +123,9 @@ static void TAG(emit)( GLcontext *ctx, #endif #if DO_SPEC - if (VB->SecondaryColorPtr[0]) { - spec = VB->SecondaryColorPtr[0]->data; - spec_stride = VB->SecondaryColorPtr[0]->stride; + if (VB->AttribPtr[_TNL_ATTRIB_COLOR1]) { + spec = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->data; + spec_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->stride; } else { spec = (GLfloat (*)[4])ctx->Current.Attrib[VERT_ATTRIB_COLOR1]; spec_stride = 0; @@ -144,8 +144,8 @@ static void TAG(emit)( GLcontext *ctx, #endif #if DO_RGBA - col = VB->ColorPtr[0]->data; - col_stride = VB->ColorPtr[0]->stride; + col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data; + col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride; #endif coord = VB->NdcPtr->data; diff --git a/src/mesa/drivers/dri/mach64/mach64_vbtmp.h b/src/mesa/drivers/dri/mach64/mach64_vbtmp.h index eb94e6e398..636b7de80f 100644 --- a/src/mesa/drivers/dri/mach64/mach64_vbtmp.h +++ b/src/mesa/drivers/dri/mach64/mach64_vbtmp.h @@ -187,13 +187,13 @@ static void TAG(emit)( GLcontext *ctx, } if (DO_RGBA) { - col = VB->ColorPtr[0]->data; - col_stride = VB->ColorPtr[0]->stride; + col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data; + col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride; } if (DO_SPEC) { - spec = VB->SecondaryColorPtr[0]->data; - spec_stride = VB->SecondaryColorPtr[0]->stride; + spec = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->data; + spec_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->stride; } else { spec = (GLfloat (*)[4])ctx->Current.Attrib[VERT_ATTRIB_COLOR1]; spec_stride = 0; @@ -384,8 +384,8 @@ static void TAG(emit)( GLcontext *ctx, GLuint start, GLuint end, ASSERT(stride == 4); - col = VB->ColorPtr[0]->data; - col_stride = VB->ColorPtr[0]->stride; + col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data; + col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride; /* Pack what's left into a 4-dword vertex. Color is in a different * place, and there is no 'w' coordinate. @@ -432,8 +432,8 @@ static void TAG(emit)( GLcontext *ctx, GLuint start, GLuint end, GLfloat *v = (GLfloat *)dest; int i; - col = VB->ColorPtr[0]->data; - col_stride = VB->ColorPtr[0]->stride; + col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data; + col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride; if (start) STRIDE_4F(col, col_stride * start); diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.c b/src/mesa/drivers/dri/r300/r300_swtcl.c index 677c504b90..99bd22edac 100644 --- a/src/mesa/drivers/dri/r300/r300_swtcl.c +++ b/src/mesa/drivers/dri/r300/r300_swtcl.c @@ -124,7 +124,7 @@ void r300ChooseSwtclVertexFormat(GLcontext *ctx, GLuint *_InputsRead, GLuint *_ } if (ctx->Light.Enabled && ctx->Light.Model.TwoSide) { - VB->AttribPtr[VERT_ATTRIB_GENERIC0] = VB->ColorPtr[1]; + VB->AttribPtr[VERT_ATTRIB_GENERIC0] = VB->BackfaceColorPtr; OutputsWritten |= 1 << VERT_RESULT_BFC0; #if MESA_LITTLE_ENDIAN EMIT_ATTR( _TNL_ATTRIB_GENERIC0, EMIT_4UB_4F_RGBA ); @@ -134,7 +134,7 @@ void r300ChooseSwtclVertexFormat(GLcontext *ctx, GLuint *_InputsRead, GLuint *_ ADD_ATTR(VERT_ATTRIB_GENERIC0, R300_DATA_TYPE_BYTE, SWTCL_OVM_COLOR2, SWIZZLE_XYZW, MASK_XYZW, 1); #endif if (fp_reads & FRAG_BIT_COL1) { - VB->AttribPtr[VERT_ATTRIB_GENERIC1] = VB->SecondaryColorPtr[1]; + VB->AttribPtr[VERT_ATTRIB_GENERIC1] = VB->BackfaceSecondaryColorPtr; GLuint swiz = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_Y, SWIZZLE_Z, SWIZZLE_ONE); OutputsWritten |= 1 << VERT_RESULT_BFC1; #if MESA_LITTLE_ENDIAN diff --git a/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c b/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c index 74b66900c9..8b51af81a6 100644 --- a/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c +++ b/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c @@ -227,9 +227,9 @@ void radeonEmitArrays( GLcontext *ctx, GLuint inputs ) if (inputs & VERT_BIT_COLOR0) { int emitsize; - if (VB->ColorPtr[0]->size == 4 && - (VB->ColorPtr[0]->stride != 0 || - VB->ColorPtr[0]->data[0][3] != 1.0)) { + if (VB->AttribPtr[_TNL_ATTRIB_COLOR0]->size == 4 && + (VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride != 0 || + VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data[0][3] != 1.0)) { vfmt |= RADEON_CP_VC_FRMT_FPCOLOR | RADEON_CP_VC_FRMT_FPALPHA; emitsize = 4; } @@ -242,9 +242,9 @@ void radeonEmitArrays( GLcontext *ctx, GLuint inputs ) if (!rmesa->tcl.rgba.buf) rcommon_emit_vector( ctx, &(rmesa->tcl.aos[nr]), - (char *)VB->ColorPtr[0]->data, + (char *)VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data, emitsize, - VB->ColorPtr[0]->stride, + VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride, count); nr++; @@ -256,9 +256,9 @@ void radeonEmitArrays( GLcontext *ctx, GLuint inputs ) rcommon_emit_vector( ctx, &(rmesa->tcl.aos[nr]), - (char *)VB->SecondaryColorPtr[0]->data, + (char *)VB->AttribPtr[_TNL_ATTRIB_COLOR1]->data, 3, - VB->SecondaryColorPtr[0]->stride, + VB->AttribPtr[_TNL_ATTRIB_COLOR1]->stride, count); } diff --git a/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h b/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h index efb06db80e..aa53e98fc8 100644 --- a/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h +++ b/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h @@ -122,9 +122,9 @@ static void TAG(emit)( GLcontext *ctx, } if (DO_RGBA) { - if (VB->ColorPtr[0]) { - col = VB->ColorPtr[0]->data; - col_stride = VB->ColorPtr[0]->stride; + if (VB->AttribPtr[_TNL_ATTRIB_COLOR0]) { + col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data; + col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride; } else { col = (GLfloat (*)[4])ctx->Current.Attrib[VERT_ATTRIB_COLOR0]; col_stride = 0; @@ -132,9 +132,9 @@ static void TAG(emit)( GLcontext *ctx, } if (DO_SPEC_OR_FOG) { - if (VB->SecondaryColorPtr[0]) { - spec = VB->SecondaryColorPtr[0]->data; - spec_stride = VB->SecondaryColorPtr[0]->stride; + if (VB->AttribPtr[_TNL_ATTRIB_COLOR1]) { + spec = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->data; + spec_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->stride; } else { spec = (GLfloat (*)[4])ctx->Current.Attrib[VERT_ATTRIB_COLOR1]; spec_stride = 0; diff --git a/src/mesa/drivers/dri/tdfx/tdfx_vb.c b/src/mesa/drivers/dri/tdfx/tdfx_vb.c index 4928802232..c200ba3255 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_vb.c +++ b/src/mesa/drivers/dri/tdfx/tdfx_vb.c @@ -69,11 +69,11 @@ static void interp_extras( GLcontext *ctx, /*fprintf(stderr, "%s\n", __FUNCTION__);*/ - if (VB->ColorPtr[1]) { + if (VB->BackfaceColorPtr) { INTERP_4F( t, - GET_COLOR(VB->ColorPtr[1], dst), - GET_COLOR(VB->ColorPtr[1], out), - GET_COLOR(VB->ColorPtr[1], in) ); + GET_COLOR(VB->BackfaceColorPtr, dst), + GET_COLOR(VB->BackfaceColorPtr, out), + GET_COLOR(VB->BackfaceColorPtr, in) ); } if (VB->EdgeFlag) { @@ -88,9 +88,9 @@ static void copy_pv_extras( GLcontext *ctx, GLuint dst, GLuint src ) { struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - if (VB->ColorPtr[1]) { - COPY_4FV( GET_COLOR(VB->ColorPtr[1], dst), - GET_COLOR(VB->ColorPtr[1], src) ); + if (VB->BackfaceColorPtr) { + COPY_4FV( GET_COLOR(VB->BackfaceColorPtr, dst), + GET_COLOR(VB->BackfaceColorPtr, src) ); } setup_tab[TDFX_CONTEXT(ctx)->SetupIndex].copy_pv(ctx, dst, src); diff --git a/src/mesa/drivers/dri/tdfx/tdfx_vbtmp.h b/src/mesa/drivers/dri/tdfx/tdfx_vbtmp.h index 809d5d7dd9..07e6e9a6a7 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_vbtmp.h +++ b/src/mesa/drivers/dri/tdfx/tdfx_vbtmp.h @@ -76,9 +76,9 @@ static void TAG(emit)( GLcontext *ctx, } if (IND & TDFX_RGBA_BIT) { - col = VB->ColorPtr[0]->data; - col_stride = VB->ColorPtr[0]->stride; - col_size = VB->ColorPtr[0]->size; + col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data; + col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride; + col_size = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->size; } if (IND & TDFX_FOGC_BIT) { diff --git a/src/mesa/drivers/glide/fxvb.c b/src/mesa/drivers/glide/fxvb.c index 1dc5f9891a..cc9ad0e8b8 100644 --- a/src/mesa/drivers/glide/fxvb.c +++ b/src/mesa/drivers/glide/fxvb.c @@ -104,24 +104,24 @@ static void interp_extras( GLcontext *ctx, { struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - if (VB->ColorPtr[1]) { - /* If stride is zero, ColorPtr[1] is constant across the VB, so + if (VB->BackfaceColorPtr) { + /* If stride is zero, BackfaceColorPtr is constant across the VB, so * there is no point interpolating between two values as they will * be identical. This case is handled in t_dd_tritmp.h */ - if (VB->ColorPtr[1]->stride) { - assert(VB->ColorPtr[1]->stride == 4 * sizeof(GLfloat)); + if (VB->BackfaceColorPtr->stride) { + assert(VB->BackfaceColorPtr->stride == 4 * sizeof(GLfloat)); INTERP_4F( t, - GET_COLOR(VB->ColorPtr[1], dst), - GET_COLOR(VB->ColorPtr[1], out), - GET_COLOR(VB->ColorPtr[1], in) ); + GET_COLOR(VB->BackfaceColorPtr, dst), + GET_COLOR(VB->BackfaceColorPtr, out), + GET_COLOR(VB->BackfaceColorPtr, in) ); } - if (VB->SecondaryColorPtr[1]) { + if (VB->BackfaceSecondaryColorPtr) { INTERP_3F( t, - GET_COLOR(VB->SecondaryColorPtr[1], dst), - GET_COLOR(VB->SecondaryColorPtr[1], out), - GET_COLOR(VB->SecondaryColorPtr[1], in) ); + GET_COLOR(VB->BackfaceSecondaryColorPtr, dst), + GET_COLOR(VB->BackfaceSecondaryColorPtr, out), + GET_COLOR(VB->BackfaceSecondaryColorPtr, in) ); } } @@ -137,13 +137,13 @@ static void copy_pv_extras( GLcontext *ctx, GLuint dst, GLuint src ) { struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - if (VB->ColorPtr[1]) { - COPY_4FV( GET_COLOR(VB->ColorPtr[1], dst), - GET_COLOR(VB->ColorPtr[1], src) ); + if (VB->BackfaceColorPtr) { + COPY_4FV( GET_COLOR(VB->BackfaceColorPtr, dst), + GET_COLOR(VB->BackfaceColorPtr, src) ); - if (VB->SecondaryColorPtr[1]) { - COPY_3FV( GET_COLOR(VB->SecondaryColorPtr[1], dst), - GET_COLOR(VB->SecondaryColorPtr[1], src) ); + if (VB->BackfaceSecondaryColorPtr) { + COPY_3FV( GET_COLOR(VB->BackfaceSecondaryColorPtr, dst), + GET_COLOR(VB->BackfaceSecondaryColorPtr, src) ); } } diff --git a/src/mesa/drivers/glide/fxvbtmp.h b/src/mesa/drivers/glide/fxvbtmp.h index 674d9c6799..742f500863 100644 --- a/src/mesa/drivers/glide/fxvbtmp.h +++ b/src/mesa/drivers/glide/fxvbtmp.h @@ -80,14 +80,14 @@ static void TAG(emit)( GLcontext *ctx, } if (IND & SETUP_RGBA) { - col = VB->ColorPtr[0]->data; - col_stride = VB->ColorPtr[0]->stride; - col_size = VB->ColorPtr[0]->size; + col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data; + col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride; + col_size = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->size; } if (IND & SETUP_SPEC) { - spec = VB->SecondaryColorPtr[0]->data; - spec_stride = VB->SecondaryColorPtr[0]->stride; + spec = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->data; + spec_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->stride; } if (IND & SETUP_FOGC) { diff --git a/src/mesa/drivers/windows/gldirect/dx7/gld_primitive_dx7.c b/src/mesa/drivers/windows/gldirect/dx7/gld_primitive_dx7.c index 46e652dc73..0b373814fe 100644 --- a/src/mesa/drivers/windows/gldirect/dx7/gld_primitive_dx7.c +++ b/src/mesa/drivers/windows/gldirect/dx7/gld_primitive_dx7.c @@ -189,9 +189,9 @@ GLfloat ex,ey,fx,fy,cc; \ /* Get vars for later */ \ VB = &TNL_CONTEXT(ctx)->vb; \ - vbcolor = (GLchan (*)[4])VB->ColorPtr[1]->data; \ - if (VB->SecondaryColorPtr[1]) { \ - vbspec = (GLchan (*)[4])VB->SecondaryColorPtr[1]->data; \ + vbcolor = (GLchan (*)[4])VB->BackfaceColorPtr->data; \ + if (VB->BackfaceSecondaryColorPtr) { \ + vbspec = (GLchan (*)[4])VB->BackfaceSecondaryColorPtr->data; \ } else { \ vbspec = NULL; \ } \ @@ -247,12 +247,12 @@ pV->Position.z = p4f[##v][2]; #define GLD_SETUP_SMOOTH_COLOUR_3D(v) \ - p4f = (GLfloat (*)[4])VB->ColorPtr[0]->data; \ + p4f = (GLfloat (*)[4])VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data; \ pV->Diffuse = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]); #define GLD_SETUP_GET_FLAT_COLOUR_3D(v) \ - p4f = (GLfloat (*)[4])VB->ColorPtr[0]->data; \ + p4f = (GLfloat (*)[4])VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data; \ dwColor = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]); #define GLD_SETUP_USE_FLAT_COLOUR_3D \ diff --git a/src/mesa/drivers/windows/gldirect/dx7/gld_vb_d3d_render_dx7.c b/src/mesa/drivers/windows/gldirect/dx7/gld_vb_d3d_render_dx7.c index a85620dde8..c39775cad3 100644 --- a/src/mesa/drivers/windows/gldirect/dx7/gld_vb_d3d_render_dx7.c +++ b/src/mesa/drivers/windows/gldirect/dx7/gld_vb_d3d_render_dx7.c @@ -151,7 +151,7 @@ static GLboolean gld_d3d_render_stage_run( #if 0 // For debugging: Useful to see if an app passes colour data in // an unusual format. - switch (VB->ColorPtr[0]->Type) { + switch (VB->AttribPtr[_TNL_ATTRIB_COLOR0]->Type) { case GL_FLOAT: ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_FLOAT\n"); break; diff --git a/src/mesa/drivers/windows/gldirect/dx8/gld_primitive_dx8.c b/src/mesa/drivers/windows/gldirect/dx8/gld_primitive_dx8.c index b95351553c..990922580a 100644 --- a/src/mesa/drivers/windows/gldirect/dx8/gld_primitive_dx8.c +++ b/src/mesa/drivers/windows/gldirect/dx8/gld_primitive_dx8.c @@ -189,9 +189,9 @@ GLfloat ex,ey,fx,fy,cc; \ /* Get vars for later */ \ VB = &TNL_CONTEXT(ctx)->vb; \ - vbcolor = (GLchan (*)[4])VB->ColorPtr[1]->data; \ - if (VB->SecondaryColorPtr[1]) { \ - vbspec = (GLchan (*)[4])VB->SecondaryColorPtr[1]->data; \ + vbcolor = (GLchan (*)[4])VB->BackfaceColorPtr->data; \ + if (VB->BackfaceSecondaryColorPtr) { \ + vbspec = (GLchan (*)[4])VB->BackfaceSecondaryColorPtr->data; \ } else { \ vbspec = NULL; \ } \ @@ -247,12 +247,12 @@ pV->Position.z = p4f[##v][2]; #define GLD_SETUP_SMOOTH_COLOUR_3D(v) \ - p4f = (GLfloat (*)[4])VB->ColorPtr[0]->data; \ + p4f = (GLfloat (*)[4])VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data; \ pV->Diffuse = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]); #define GLD_SETUP_GET_FLAT_COLOUR_3D(v) \ - p4f = (GLfloat (*)[4])VB->ColorPtr[0]->data; \ + p4f = (GLfloat (*)[4])VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data; \ dwColor = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]); #define GLD_SETUP_USE_FLAT_COLOUR_3D \ diff --git a/src/mesa/drivers/windows/gldirect/dx8/gld_vb_d3d_render_dx8.c b/src/mesa/drivers/windows/gldirect/dx8/gld_vb_d3d_render_dx8.c index cafbf4f5c5..265c81fb4a 100644 --- a/src/mesa/drivers/windows/gldirect/dx8/gld_vb_d3d_render_dx8.c +++ b/src/mesa/drivers/windows/gldirect/dx8/gld_vb_d3d_render_dx8.c @@ -149,7 +149,7 @@ static GLboolean gld_d3d_render_stage_run( #if 0 // For debugging: Useful to see if an app passes colour data in // an unusual format. - switch (VB->ColorPtr[0]->Type) { + switch (VB->AttribPtr[_TNL_ATTRIB_COLOR0]->Type) { case GL_FLOAT: ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_FLOAT\n"); break; diff --git a/src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c b/src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c index 1b84cdee28..fd4dd4ed75 100644 --- a/src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c +++ b/src/mesa/drivers/windows/gldirect/dx9/gld_primitive_dx9.c @@ -189,9 +189,9 @@ GLfloat ex,ey,fx,fy,cc; \ /* Get vars for later */ \ VB = &TNL_CONTEXT(ctx)->vb; \ - vbcolor = (GLchan (*)[4])VB->ColorPtr[1]->data; \ - if (VB->SecondaryColorPtr[1]) { \ - vbspec = (GLchan (*)[4])VB->SecondaryColorPtr[1]->data; \ + vbcolor = (GLchan (*)[4])VB->BackfaceColorPtr->data; \ + if (VB->BackfaceSecondaryColorPtr) { \ + vbspec = (GLchan (*)[4])VB->BackfaceSecondaryColorPtr->data; \ } else { \ vbspec = NULL; \ } \ @@ -247,12 +247,12 @@ pV->Position.z = p4f[##v][2]; #define GLD_SETUP_SMOOTH_COLOUR_3D(v) \ - p4f = (GLfloat (*)[4])VB->ColorPtr[0]->data; \ + p4f = (GLfloat (*)[4])VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data; \ pV->Diffuse = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]); #define GLD_SETUP_GET_FLAT_COLOUR_3D(v) \ - p4f = (GLfloat (*)[4])VB->ColorPtr[0]->data; \ + p4f = (GLfloat (*)[4])VB->AttribPtr[_TNL_ATTRIB_COLOR00]->data; \ dwColor = D3DCOLOR_COLORVALUE(p4f[##v][0], p4f[##v][1], p4f[##v][2], p4f[##v][3]); #define GLD_SETUP_USE_FLAT_COLOUR_3D \ diff --git a/src/mesa/drivers/windows/gldirect/dx9/gld_vb_d3d_render_dx9.c b/src/mesa/drivers/windows/gldirect/dx9/gld_vb_d3d_render_dx9.c index 4fa6bcaf1a..91a68b3f2d 100644 --- a/src/mesa/drivers/windows/gldirect/dx9/gld_vb_d3d_render_dx9.c +++ b/src/mesa/drivers/windows/gldirect/dx9/gld_vb_d3d_render_dx9.c @@ -149,7 +149,7 @@ static GLboolean gld_d3d_render_stage_run( #if 0 // For debugging: Useful to see if an app passes colour data in // an unusual format. - switch (VB->ColorPtr[0]->Type) { + switch (VB->AttribPtr[_TNL_ATTRIB_COLOR0]->Type) { case GL_FLOAT: ddlogMessage(GLDLOG_SYSTEM, "ColorPtr: GL_FLOAT\n"); break; diff --git a/src/mesa/swrast_setup/ss_tritmp.h b/src/mesa/swrast_setup/ss_tritmp.h index 9700cf8c54..17f3863956 100644 --- a/src/mesa/swrast_setup/ss_tritmp.h +++ b/src/mesa/swrast_setup/ss_tritmp.h @@ -67,8 +67,8 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) if (facing == 1) { if (IND & SS_TWOSIDE_BIT) { if (IND & SS_RGBA_BIT) { - if (VB->ColorPtr[1]) { - GLfloat (*vbcolor)[4] = VB->ColorPtr[1]->data; + if (VB->BackfaceColorPtr) { + GLfloat (*vbcolor)[4] = VB->BackfaceColorPtr->data; if (swsetup->intColors) { COPY_CHAN4(saved_color[0], v[0]->color); @@ -81,7 +81,7 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) COPY_4V(saved_col0[2], v[2]->attrib[FRAG_ATTRIB_COL0]); } - if (VB->ColorPtr[1]->stride) { + if (VB->BackfaceColorPtr->stride) { if (swsetup->intColors) { SS_COLOR(v[0]->color, vbcolor[e0]); SS_COLOR(v[1]->color, vbcolor[e1]); @@ -108,14 +108,14 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) } } - if (VB->SecondaryColorPtr[1]) { - GLfloat (*vbspec)[4] = VB->SecondaryColorPtr[1]->data; + if (VB->BackfaceSecondaryColorPtr) { + GLfloat (*vbspec)[4] = VB->BackfaceSecondaryColorPtr->data; COPY_4V(saved_spec[0], v[0]->attrib[FRAG_ATTRIB_COL1]); COPY_4V(saved_spec[1], v[1]->attrib[FRAG_ATTRIB_COL1]); COPY_4V(saved_spec[2], v[2]->attrib[FRAG_ATTRIB_COL1]); - if (VB->SecondaryColorPtr[1]->stride) { + if (VB->BackfaceSecondaryColorPtr->stride) { SS_SPEC(v[0]->attrib[FRAG_ATTRIB_COL1], vbspec[e0]); SS_SPEC(v[1]->attrib[FRAG_ATTRIB_COL1], vbspec[e1]); SS_SPEC(v[2]->attrib[FRAG_ATTRIB_COL1], vbspec[e2]); @@ -200,7 +200,7 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) if (IND & SS_TWOSIDE_BIT) { if (facing == 1) { if (IND & SS_RGBA_BIT) { - if (VB->ColorPtr[1]) { + if (VB->BackfaceColorPtr) { if (swsetup->intColors) { COPY_CHAN4(v[0]->color, saved_color[0]); COPY_CHAN4(v[1]->color, saved_color[1]); @@ -213,7 +213,7 @@ static void TAG(triangle)(GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) } } - if (VB->SecondaryColorPtr[1]) { + if (VB->BackfaceSecondaryColorPtr) { COPY_4V(v[0]->attrib[FRAG_ATTRIB_COL1], saved_spec[0]); COPY_4V(v[1]->attrib[FRAG_ATTRIB_COL1], saved_spec[1]); COPY_4V(v[2]->attrib[FRAG_ATTRIB_COL1], saved_spec[2]); diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h index b41cf93897..09ff8f8252 100644 --- a/src/mesa/tnl/t_context.h +++ b/src/mesa/tnl/t_context.h @@ -214,9 +214,9 @@ struct vertex_buffer GLubyte *ClipMask; /* _TNL_BIT_POS */ GLfloat *NormalLengthPtr; /* _TNL_BIT_NORMAL */ GLboolean *EdgeFlag; /* _TNL_BIT_EDGEFLAG */ - GLvector4f *BackfaceIndexPtr; /* _TNL_BIT_INDEX */ - GLvector4f *ColorPtr[2]; /* _TNL_BIT_COLOR0 */ - GLvector4f *SecondaryColorPtr[2]; /* _TNL_BIT_COLOR1 */ + GLvector4f *BackfaceIndexPtr; + GLvector4f *BackfaceColorPtr; + GLvector4f *BackfaceSecondaryColorPtr; GLvector4f *FogCoordPtr; /* _TNL_BIT_FOG */ const struct _mesa_prim *Primitive; diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c index 8092627645..0862fdfa85 100644 --- a/src/mesa/tnl/t_draw.c +++ b/src/mesa/tnl/t_draw.c @@ -254,11 +254,9 @@ static void bind_inputs( GLcontext *ctx, /* Legacy pointers -- remove one day. */ - VB->ColorPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR0]; - VB->ColorPtr[1] = NULL; + VB->BackfaceColorPtr = NULL; VB->BackfaceIndexPtr = NULL; - VB->SecondaryColorPtr[0] = VB->AttribPtr[_TNL_ATTRIB_COLOR1]; - VB->SecondaryColorPtr[1] = NULL; + VB->BackfaceSecondaryColorPtr = NULL; VB->FogCoordPtr = VB->AttribPtr[_TNL_ATTRIB_FOG]; /* Clipping and drawing code still requires this to be a packed diff --git a/src/mesa/tnl/t_vb_light.c b/src/mesa/tnl/t_vb_light.c index e72a807f0d..8a0fe63fd8 100644 --- a/src/mesa/tnl/t_vb_light.c +++ b/src/mesa/tnl/t_vb_light.c @@ -127,7 +127,7 @@ prepare_materials(GLcontext *ctx, const GLuint bitmask = ctx->Light.ColorMaterialBitmask; for (i = 0 ; i < MAT_ATTRIB_MAX ; i++) if (bitmask & (1<AttribPtr[_TNL_ATTRIB_MAT_FRONT_AMBIENT + i] = VB->ColorPtr[0]; + VB->AttribPtr[_TNL_ATTRIB_MAT_FRONT_AMBIENT + i] = VB->AttribPtr[_TNL_ATTRIB_COLOR0]; } /* Now, for each material attribute that's tracking vertex color, save @@ -246,9 +246,6 @@ static GLboolean run_lighting( GLcontext *ctx, */ store->light_func_tab[idx]( ctx, VB, stage, input ); - VB->AttribPtr[_TNL_ATTRIB_COLOR0] = VB->ColorPtr[0]; - VB->AttribPtr[_TNL_ATTRIB_COLOR1] = VB->SecondaryColorPtr[0]; - return GL_TRUE; } diff --git a/src/mesa/tnl/t_vb_lighttmp.h b/src/mesa/tnl/t_vb_lighttmp.h index dd117e435c..4ebef2356f 100644 --- a/src/mesa/tnl/t_vb_lighttmp.h +++ b/src/mesa/tnl/t_vb_lighttmp.h @@ -72,13 +72,13 @@ static void TAG(light_rgba_spec)( GLcontext *ctx, fprintf(stderr, "%s\n", __FUNCTION__ ); #endif - VB->ColorPtr[0] = &store->LitColor[0]; - VB->SecondaryColorPtr[0] = &store->LitSecondary[0]; + VB->AttribPtr[_TNL_ATTRIB_COLOR0] = &store->LitColor[0]; + VB->AttribPtr[_TNL_ATTRIB_COLOR1] = &store->LitSecondary[0]; sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3]; #if IDX & LIGHT_TWOSIDE - VB->ColorPtr[1] = &store->LitColor[1]; - VB->SecondaryColorPtr[1] = &store->LitSecondary[1]; + VB->BackfaceColorPtr = &store->LitColor[1]; + VB->BackfaceSecondaryColorPtr = &store->LitSecondary[1]; sumA[1] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3]; #endif @@ -259,11 +259,11 @@ static void TAG(light_rgba)( GLcontext *ctx, fprintf(stderr, "%s\n", __FUNCTION__ ); #endif - VB->ColorPtr[0] = &store->LitColor[0]; + VB->AttribPtr[_TNL_ATTRIB_COLOR0] = &store->LitColor[0]; sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3]; #if IDX & LIGHT_TWOSIDE - VB->ColorPtr[1] = &store->LitColor[1]; + VB->BackfaceColorPtr = &store->LitColor[1]; sumA[1] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3]; #endif @@ -449,9 +449,9 @@ static void TAG(light_fast_rgba_single)( GLcontext *ctx, (void) input; /* doesn't refer to Eye or Obj */ - VB->ColorPtr[0] = &store->LitColor[0]; + VB->AttribPtr[_TNL_ATTRIB_COLOR0] = &store->LitColor[0]; #if IDX & LIGHT_TWOSIDE - VB->ColorPtr[1] = &store->LitColor[1]; + VB->BackfaceColorPtr = &store->LitColor[1]; #endif if (nr > 1) { @@ -559,9 +559,9 @@ static void TAG(light_fast_rgba)( GLcontext *ctx, sumA[0] = ctx->Light.Material.Attrib[MAT_ATTRIB_FRONT_DIFFUSE][3]; sumA[1] = ctx->Light.Material.Attrib[MAT_ATTRIB_BACK_DIFFUSE][3]; - VB->ColorPtr[0] = &store->LitColor[0]; + VB->AttribPtr[_TNL_ATTRIB_COLOR0] = &store->LitColor[0]; #if IDX & LIGHT_TWOSIDE - VB->ColorPtr[1] = &store->LitColor[1]; + VB->BackfaceColorPtr = &store->LitColor[1]; #endif if (nr > 1) { diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index d76b0a6b9d..7002f74a00 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -454,10 +454,10 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage ) VB->ClipPtr->count = VB->Count; } - VB->ColorPtr[0] = &store->results[VERT_RESULT_COL0]; - VB->ColorPtr[1] = &store->results[VERT_RESULT_BFC0]; - VB->SecondaryColorPtr[0] = &store->results[VERT_RESULT_COL1]; - VB->SecondaryColorPtr[1] = &store->results[VERT_RESULT_BFC1]; + VB->AttribPtr[_TNL_ATTRIB_COLOR0] = &store->results[VERT_RESULT_COL0]; + VB->BackfaceColorPtr = &store->results[VERT_RESULT_BFC0]; + VB->AttribPtr[_TNL_ATTRIB_COLOR1] = &store->results[VERT_RESULT_COL1]; + VB->BackfaceSecondaryColorPtr = &store->results[VERT_RESULT_BFC1]; VB->FogCoordPtr = &store->results[VERT_RESULT_FOGC]; VB->AttribPtr[VERT_ATTRIB_COLOR0] = &store->results[VERT_RESULT_COL0]; diff --git a/src/mesa/tnl/t_vertex_generic.c b/src/mesa/tnl/t_vertex_generic.c index f97ad7c2ed..fa34d11d7b 100644 --- a/src/mesa/tnl/t_vertex_generic.c +++ b/src/mesa/tnl/t_vertex_generic.c @@ -1092,27 +1092,27 @@ void _tnl_generic_interp_extras( GLcontext *ctx, { struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - /* If stride is zero, ColorPtr[1] is constant across the VB, so + /* If stride is zero, BackfaceColorPtr is constant across the VB, so * there is no point interpolating between two values as they will * be identical. In all other cases, this value is generated by * t_vb_lighttmp.h and has a stride of 4 dwords. */ - if (VB->ColorPtr[1] && VB->ColorPtr[1]->stride) { - assert(VB->ColorPtr[1]->stride == 4 * sizeof(GLfloat)); + if (VB->BackfaceColorPtr && VB->BackfaceColorPtr->stride) { + assert(VB->BackfaceColorPtr->stride == 4 * sizeof(GLfloat)); INTERP_4F( t, - VB->ColorPtr[1]->data[dst], - VB->ColorPtr[1]->data[out], - VB->ColorPtr[1]->data[in] ); + VB->BackfaceColorPtr->data[dst], + VB->BackfaceColorPtr->data[out], + VB->BackfaceColorPtr->data[in] ); } - if (VB->SecondaryColorPtr[1]) { - assert(VB->SecondaryColorPtr[1]->stride == 4 * sizeof(GLfloat)); + if (VB->BackfaceSecondaryColorPtr) { + assert(VB->BackfaceSecondaryColorPtr->stride == 4 * sizeof(GLfloat)); INTERP_3F( t, - VB->SecondaryColorPtr[1]->data[dst], - VB->SecondaryColorPtr[1]->data[out], - VB->SecondaryColorPtr[1]->data[in] ); + VB->BackfaceSecondaryColorPtr->data[dst], + VB->BackfaceSecondaryColorPtr->data[out], + VB->BackfaceSecondaryColorPtr->data[in] ); } if (VB->BackfaceIndexPtr) { @@ -1135,14 +1135,14 @@ void _tnl_generic_copy_pv_extras( GLcontext *ctx, /* See above comment: */ - if (VB->ColorPtr[1] && VB->ColorPtr[1]->stride) { - COPY_4FV( VB->ColorPtr[1]->data[dst], - VB->ColorPtr[1]->data[src] ); + if (VB->BackfaceColorPtr && VB->BackfaceColorPtr->stride) { + COPY_4FV( VB->BackfaceColorPtr->data[dst], + VB->BackfaceColorPtr->data[src] ); } - if (VB->SecondaryColorPtr[1]) { - COPY_4FV( VB->SecondaryColorPtr[1]->data[dst], - VB->SecondaryColorPtr[1]->data[src] ); + if (VB->BackfaceSecondaryColorPtr) { + COPY_4FV( VB->BackfaceSecondaryColorPtr->data[dst], + VB->BackfaceSecondaryColorPtr->data[src] ); } if (VB->BackfaceIndexPtr) { diff --git a/src/mesa/tnl_dd/t_dd_dmatmp.h b/src/mesa/tnl_dd/t_dd_dmatmp.h index e4b535fb68..e5885782c7 100644 --- a/src/mesa/tnl_dd/t_dd_dmatmp.h +++ b/src/mesa/tnl_dd/t_dd_dmatmp.h @@ -443,7 +443,7 @@ static void TAG(render_quad_strip_verts)( GLcontext *ctx, } else if (HAVE_TRI_STRIPS && ctx->Light.ShadeModel == GL_FLAT && - TNL_CONTEXT(ctx)->vb.ColorPtr[0]->stride) { + TNL_CONTEXT(ctx)->vb.AttribPtr[_TNL_ATTRIB_COLOR0]->stride) { if (HAVE_ELTS) { LOCAL_VARS; int dmasz = GET_SUBSEQUENT_VB_MAX_ELTS(); @@ -1221,7 +1221,7 @@ static GLboolean TAG(validate_render)( GLcontext *ctx, ok = GL_TRUE; } else if (HAVE_TRI_STRIPS && ctx->Light.ShadeModel == GL_FLAT && - VB->ColorPtr[0]->stride != 0) { + VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride != 0) { if (HAVE_ELTS) { ok = (GLint) count < GET_SUBSEQUENT_VB_MAX_ELTS(); } diff --git a/src/mesa/tnl_dd/t_dd_tritmp.h b/src/mesa/tnl_dd/t_dd_tritmp.h index 0e3bc1329d..8574fe618b 100644 --- a/src/mesa/tnl_dd/t_dd_tritmp.h +++ b/src/mesa/tnl_dd/t_dd_tritmp.h @@ -195,7 +195,7 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) } } else { - GLfloat (*vbcolor)[4] = VB->ColorPtr[1]->data; + GLfloat (*vbcolor)[4] = VB->BackfaceColorPtr->data; (void) vbcolor; if (!DO_FLAT) { @@ -204,8 +204,8 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) } VERT_SAVE_RGBA( 2 ); - if (VB->ColorPtr[1]->stride) { - ASSERT(VB->ColorPtr[1]->stride == 4*sizeof(GLfloat)); + if (VB->BackfaceColorPtr->stride) { + ASSERT(VB->BackfaceColorPtr->stride == 4*sizeof(GLfloat)); if (!DO_FLAT) { VERT_SET_RGBA( v[0], vbcolor[e0] ); @@ -221,9 +221,9 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) VERT_SET_RGBA( v[2], vbcolor[0] ); } - if (HAVE_SPEC && VB->SecondaryColorPtr[1]) { - GLfloat (*vbspec)[4] = VB->SecondaryColorPtr[1]->data; - ASSERT(VB->SecondaryColorPtr[1]->stride == 4*sizeof(GLfloat)); + if (HAVE_SPEC && VB->BackfaceSecondaryColorPtr) { + GLfloat (*vbspec)[4] = VB->BackfaceSecondaryColorPtr->data; + ASSERT(VB->BackfaceSecondaryColorPtr->stride == 4*sizeof(GLfloat)); if (!DO_FLAT) { VERT_SAVE_SPEC( 0 ); @@ -279,7 +279,7 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) VERT_SAVE_RGBA( 1 ); VERT_COPY_RGBA( v[0], v[2] ); VERT_COPY_RGBA( v[1], v[2] ); - if (HAVE_SPEC && VB->SecondaryColorPtr[0]) { + if (HAVE_SPEC && VB->AttribPtr[_TNL_ATTRIB_COLOR1]) { VERT_SAVE_SPEC( 0 ); VERT_SAVE_SPEC( 1 ); VERT_COPY_SPEC( v[0], v[2] ); @@ -374,7 +374,7 @@ static void TAG(triangle)( GLcontext *ctx, GLuint e0, GLuint e1, GLuint e2 ) if (HAVE_RGBA) { VERT_RESTORE_RGBA( 0 ); VERT_RESTORE_RGBA( 1 ); - if (HAVE_SPEC && VB->SecondaryColorPtr[0]) { + if (HAVE_SPEC && VB->AttribPtr[_TNL_ATTRIB_COLOR1]) { VERT_RESTORE_SPEC( 0 ); VERT_RESTORE_SPEC( 1 ); } @@ -436,7 +436,7 @@ static void TAG(quadr)( GLcontext *ctx, if (DO_TWOSIDE && facing == 1) { if (HAVE_RGBA) { - GLfloat (*vbcolor)[4] = VB->ColorPtr[1]->data; + GLfloat (*vbcolor)[4] = VB->BackfaceColorPtr->data; (void)vbcolor; if (HAVE_BACK_COLORS) { @@ -471,7 +471,7 @@ static void TAG(quadr)( GLcontext *ctx, } VERT_SAVE_RGBA( 3 ); - if (VB->ColorPtr[1]->stride) { + if (VB->BackfaceColorPtr->stride) { if (!DO_FLAT) { VERT_SET_RGBA( v[0], vbcolor[e0] ); VERT_SET_RGBA( v[1], vbcolor[e1] ); @@ -488,9 +488,9 @@ static void TAG(quadr)( GLcontext *ctx, VERT_SET_RGBA( v[3], vbcolor[0] ); } - if (HAVE_SPEC && VB->SecondaryColorPtr[1]) { - GLfloat (*vbspec)[4] = VB->SecondaryColorPtr[1]->data; - ASSERT(VB->SecondaryColorPtr[1]->stride==4*sizeof(GLfloat)); + if (HAVE_SPEC && VB->BackfaceSecondaryColorPtr) { + GLfloat (*vbspec)[4] = VB->BackfaceSecondaryColorPtr->data; + ASSERT(VB->BackfaceSecondaryColorPtr->stride==4*sizeof(GLfloat)); if (!DO_FLAT) { VERT_SAVE_SPEC( 0 ); @@ -553,7 +553,7 @@ static void TAG(quadr)( GLcontext *ctx, VERT_COPY_RGBA( v[0], v[3] ); VERT_COPY_RGBA( v[1], v[3] ); VERT_COPY_RGBA( v[2], v[3] ); - if (HAVE_SPEC && VB->SecondaryColorPtr[0]) { + if (HAVE_SPEC && VB->AttribPtr[_TNL_ATTRIB_COLOR1]) { VERT_SAVE_SPEC( 0 ); VERT_SAVE_SPEC( 1 ); VERT_SAVE_SPEC( 2 ); @@ -659,7 +659,7 @@ static void TAG(quadr)( GLcontext *ctx, VERT_RESTORE_RGBA( 0 ); VERT_RESTORE_RGBA( 1 ); VERT_RESTORE_RGBA( 2 ); - if (HAVE_SPEC && VB->SecondaryColorPtr[0]) { + if (HAVE_SPEC && VB->AttribPtr[_TNL_ATTRIB_COLOR1]) { VERT_RESTORE_SPEC( 0 ); VERT_RESTORE_SPEC( 1 ); VERT_RESTORE_SPEC( 2 ); @@ -708,7 +708,7 @@ static void TAG(line)( GLcontext *ctx, GLuint e0, GLuint e1 ) if (HAVE_RGBA) { VERT_SAVE_RGBA( 0 ); VERT_COPY_RGBA( v[0], v[1] ); - if (HAVE_SPEC && VB->SecondaryColorPtr[0]) { + if (HAVE_SPEC && VB->AttribPtr[_TNL_ATTRIB_COLOR1]) { VERT_SAVE_SPEC( 0 ); VERT_COPY_SPEC( v[0], v[1] ); } @@ -725,7 +725,7 @@ static void TAG(line)( GLcontext *ctx, GLuint e0, GLuint e1 ) if (HAVE_RGBA) { VERT_RESTORE_RGBA( 0 ); - if (HAVE_SPEC && VB->SecondaryColorPtr[0]) { + if (HAVE_SPEC && VB->AttribPtr[_TNL_ATTRIB_COLOR1]) { VERT_RESTORE_SPEC( 0 ); } } diff --git a/src/mesa/tnl_dd/t_dd_vb.c b/src/mesa/tnl_dd/t_dd_vb.c index b3937c29a0..a8a0a69768 100644 --- a/src/mesa/tnl_dd/t_dd_vb.c +++ b/src/mesa/tnl_dd/t_dd_vb.c @@ -297,19 +297,19 @@ INTERP_QUALIFIER void TAG(interp_extras)( GLcontext *ctx, LOCALVARS struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - if (VB->ColorPtr[1]) { - assert(VB->ColorPtr[1]->stride == 4 * sizeof(GLfloat)); + if (VB->BackfaceColorPtr) { + assert(VB->BackfaceColorPtr->stride == 4 * sizeof(GLfloat)); INTERP_4F( t, - GET_COLOR(VB->ColorPtr[1], dst), - GET_COLOR(VB->ColorPtr[1], out), - GET_COLOR(VB->ColorPtr[1], in) ); + GET_COLOR(VB->BackfaceColorPtr, dst), + GET_COLOR(VB->BackfaceColorPtr, out), + GET_COLOR(VB->BackfaceColorPtr, in) ); - if (VB->SecondaryColorPtr[1]) { + if (VB->BackfaceSecondaryColorPtr) { INTERP_3F( t, - GET_COLOR(VB->SecondaryColorPtr[1], dst), - GET_COLOR(VB->SecondaryColorPtr[1], out), - GET_COLOR(VB->SecondaryColorPtr[1], in) ); + GET_COLOR(VB->BackfaceSecondaryColorPtr, dst), + GET_COLOR(VB->BackfaceSecondaryColorPtr, out), + GET_COLOR(VB->BackfaceSecondaryColorPtr, in) ); } } @@ -326,13 +326,13 @@ INTERP_QUALIFIER void TAG(copy_pv_extras)( GLcontext *ctx, LOCALVARS struct vertex_buffer *VB = &TNL_CONTEXT(ctx)->vb; - if (VB->ColorPtr[1]) { - COPY_4FV( GET_COLOR(VB->ColorPtr[1], dst), - GET_COLOR(VB->ColorPtr[1], src) ); + if (VB->BackfaceColorPtr) { + COPY_4FV( GET_COLOR(VB->BackfaceColorPtr, dst), + GET_COLOR(VB->BackfaceColorPtr, src) ); - if (VB->SecondaryColorPtr[1]) { - COPY_4FV( GET_COLOR(VB->SecondaryColorPtr[1], dst), - GET_COLOR(VB->SecondaryColorPtr[1], src) ); + if (VB->BackfaceSecondaryColorPtr) { + COPY_4FV( GET_COLOR(VB->BackfaceSecondaryColorPtr, dst), + GET_COLOR(VB->BackfaceSecondaryColorPtr, src) ); } } diff --git a/src/mesa/tnl_dd/t_dd_vbtmp.h b/src/mesa/tnl_dd/t_dd_vbtmp.h index c1cc6ae1bf..a35218a158 100644 --- a/src/mesa/tnl_dd/t_dd_vbtmp.h +++ b/src/mesa/tnl_dd/t_dd_vbtmp.h @@ -184,15 +184,15 @@ static void TAG(emit)( GLcontext *ctx, } if (DO_RGBA) { - col_stride = VB->ColorPtr[0]->stride; - col = VB->ColorPtr[0]->data; - col_size = VB->ColorPtr[0]->size; + col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride; + col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data; + col_size = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->size; } if (DO_SPEC) { - if (VB->SecondaryColorPtr[0]) { - spec_stride = VB->SecondaryColorPtr[0]->stride; - spec = VB->SecondaryColorPtr[0]->data; + if (VB->AttribPtr[_TNL_ATTRIB_COLOR1]) { + spec_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->stride; + spec = VB->AttribPtr[_TNL_ATTRIB_COLOR1]->data; } else { spec = (GLfloat (*)[4])ctx->Current.Attrib[VERT_ATTRIB_COLOR1]; spec_stride = 0; @@ -356,9 +356,9 @@ static void TAG(emit)( GLcontext *ctx, GLuint start, GLuint end, ASSERT(stride == 4); - col = VB->ColorPtr[0]->data; - col_stride = VB->ColorPtr[0]->stride; - col_size = VB->ColorPtr[0]->size; + col = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->data; + col_stride = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->stride; + col_size = VB->AttribPtr[_TNL_ATTRIB_COLOR0]->size; /* fprintf(stderr, "%s(small) importable %x\n", */ /* __FUNCTION__, VB->importable_data); */ diff --git a/src/mesa/x86/gen_matypes.c b/src/mesa/x86/gen_matypes.c index 5355c26874..ce91b75f3a 100644 --- a/src/mesa/x86/gen_matypes.c +++ b/src/mesa/x86/gen_matypes.c @@ -133,8 +133,8 @@ int main( int argc, char **argv ) OFFSET( "VB_TEX2_COORD_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_TEX2] ); OFFSET( "VB_TEX3_COORD_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_TEX3] ); OFFSET( "VB_INDEX_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_COLOR_INDEX] ); - OFFSET( "VB_COLOR_PTR ", struct vertex_buffer, ColorPtr ); - OFFSET( "VB_SECONDARY_COLOR_PTR ", struct vertex_buffer, SecondaryColorPtr ); + OFFSET( "VB_COLOR_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_COLOR0] ); + OFFSET( "VB_SECONDARY_COLOR_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_COLOR1] ); OFFSET( "VB_FOG_COORD_PTR ", struct vertex_buffer, FogCoordPtr ); OFFSET( "VB_PRIMITIVE ", struct vertex_buffer, Primitive ); printf( "\n" ); -- cgit v1.2.3 From 37c79d4d765b10a79e0cf217cc1e70d3fbb7a0c5 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 18 Nov 2009 01:45:42 -0800 Subject: tnl: Replace deprecated FogCoordPtr with AttribPtr[_TNL_ATTRIB_FOG] --- src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h | 6 +++--- src/mesa/drivers/dri/mach64/mach64_vbtmp.h | 6 +++--- src/mesa/drivers/dri/radeon/radeon_maos_arrays.c | 4 ++-- src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h | 6 +++--- src/mesa/drivers/dri/tdfx/tdfx_vbtmp.h | 4 ++-- src/mesa/drivers/glide/fxvbtmp.h | 4 ++-- src/mesa/tnl/t_context.h | 3 --- src/mesa/tnl/t_draw.c | 5 +---- src/mesa/tnl/t_vb_fog.c | 1 - src/mesa/tnl/t_vb_program.c | 8 ++------ src/mesa/tnl_dd/t_dd_vbtmp.h | 6 +++--- src/mesa/x86/gen_matypes.c | 2 +- 12 files changed, 22 insertions(+), 33 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h b/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h index 2af84fa9b6..6e5fa3520e 100644 --- a/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h +++ b/src/mesa/drivers/dri/mach64/mach64_native_vbtmp.h @@ -133,9 +133,9 @@ static void TAG(emit)( GLcontext *ctx, #endif #if DO_FOG - if (VB->FogCoordPtr) { - fog = VB->FogCoordPtr->data; - fog_stride = VB->FogCoordPtr->stride; + if (VB->AttribPtr[_TNL_ATTRIB_FOG]) { + fog = VB->AttribPtr[_TNL_ATTRIB_FOG]->data; + fog_stride = VB->AttribPtr[_TNL_ATTRIB_FOG]->stride; } else { static GLfloat tmp[4] = {0, 0, 0, 0}; fog = &tmp; diff --git a/src/mesa/drivers/dri/mach64/mach64_vbtmp.h b/src/mesa/drivers/dri/mach64/mach64_vbtmp.h index 636b7de80f..60bfab8f6d 100644 --- a/src/mesa/drivers/dri/mach64/mach64_vbtmp.h +++ b/src/mesa/drivers/dri/mach64/mach64_vbtmp.h @@ -200,9 +200,9 @@ static void TAG(emit)( GLcontext *ctx, } if (DO_FOG) { - if (VB->FogCoordPtr) { - fog = VB->FogCoordPtr->data; - fog_stride = VB->FogCoordPtr->stride; + if (VB->AttribPtr[_TNL_ATTRIB_FOG]) { + fog = VB->AttribPtr[_TNL_ATTRIB_FOG]->data; + fog_stride = VB->AttribPtr[_TNL_ATTRIB_FOG]->stride; } else { static GLfloat tmp[4] = {0, 0, 0, 0}; fog = &tmp; diff --git a/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c b/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c index 8b51af81a6..de18d2ddd6 100644 --- a/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c +++ b/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c @@ -273,8 +273,8 @@ void radeonEmitArrays( GLcontext *ctx, GLuint inputs ) if (!rmesa->tcl.fog.buf) emit_vecfog( ctx, &(rmesa->tcl.aos[nr]), - (char *)VB->FogCoordPtr->data, - VB->FogCoordPtr->stride, + (char *)VB->AttribPtr[_TNL_ATTRIB_FOG]->data, + VB->AttribPtr[_TNL_ATTRIB_FOG]->stride, count); vfmt |= RADEON_CP_VC_FRMT_FPFOG; diff --git a/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h b/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h index aa53e98fc8..d764ccb982 100644 --- a/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h +++ b/src/mesa/drivers/dri/radeon/radeon_maos_vbtmp.h @@ -142,9 +142,9 @@ static void TAG(emit)( GLcontext *ctx, } if (DO_SPEC_OR_FOG) { - if (VB->FogCoordPtr) { - fog = VB->FogCoordPtr->data; - fog_stride = VB->FogCoordPtr->stride; + if (VB->AttribPtr[_TNL_ATTRIB_FOG]) { + fog = VB->AttribPtr[_TNL_ATTRIB_FOG]->data; + fog_stride = VB->AttribPtr[_TNL_ATTRIB_FOG]->stride; } else { fog = (GLfloat (*)[4])ctx->Current.Attrib[VERT_ATTRIB_FOG]; fog_stride = 0; diff --git a/src/mesa/drivers/dri/tdfx/tdfx_vbtmp.h b/src/mesa/drivers/dri/tdfx/tdfx_vbtmp.h index 07e6e9a6a7..19baf7d0d2 100644 --- a/src/mesa/drivers/dri/tdfx/tdfx_vbtmp.h +++ b/src/mesa/drivers/dri/tdfx/tdfx_vbtmp.h @@ -82,8 +82,8 @@ static void TAG(emit)( GLcontext *ctx, } if (IND & TDFX_FOGC_BIT) { - fog = VB->FogCoordPtr->data; - fog_stride = VB->FogCoordPtr->stride; + fog = VB->AttribPtr[_TNL_ATTRIB_FOG]->data; + fog_stride = VB->AttribPtr[_TNL_ATTRIB_FOG]->stride; } { diff --git a/src/mesa/drivers/glide/fxvbtmp.h b/src/mesa/drivers/glide/fxvbtmp.h index 742f500863..f7893c1573 100644 --- a/src/mesa/drivers/glide/fxvbtmp.h +++ b/src/mesa/drivers/glide/fxvbtmp.h @@ -91,8 +91,8 @@ static void TAG(emit)( GLcontext *ctx, } if (IND & SETUP_FOGC) { - fog = VB->FogCoordPtr->data; - fog_stride = VB->FogCoordPtr->stride; + fog = VB->AttribPtr[_TNL_ATTRIB_FOG]->data; + fog_stride = VB->AttribPtr[_TNL_ATTRIB_FOG]->stride; } if (start) { diff --git a/src/mesa/tnl/t_context.h b/src/mesa/tnl/t_context.h index 09ff8f8252..ebaae6335b 100644 --- a/src/mesa/tnl/t_context.h +++ b/src/mesa/tnl/t_context.h @@ -202,8 +202,6 @@ struct vertex_buffer * it that is one of VERT_ATTRIB_X. For things only produced by TNL, * such as backface color or eye-space coordinates, they are stored * here. - * XXX some of these fields alias AttribPtr below and should be removed - * such as FogCoordPtr, etc. */ GLuint *Elts; GLvector4f *EyePtr; /* _TNL_BIT_POS */ @@ -217,7 +215,6 @@ struct vertex_buffer GLvector4f *BackfaceIndexPtr; GLvector4f *BackfaceColorPtr; GLvector4f *BackfaceSecondaryColorPtr; - GLvector4f *FogCoordPtr; /* _TNL_BIT_FOG */ const struct _mesa_prim *Primitive; GLuint PrimitiveCount; diff --git a/src/mesa/tnl/t_draw.c b/src/mesa/tnl/t_draw.c index 0862fdfa85..1c7c733883 100644 --- a/src/mesa/tnl/t_draw.c +++ b/src/mesa/tnl/t_draw.c @@ -251,13 +251,10 @@ static void bind_inputs( GLcontext *ctx, */ VB->Count = count; - - /* Legacy pointers -- remove one day. - */ + /* These should perhaps be part of _TNL_ATTRIB_* */ VB->BackfaceColorPtr = NULL; VB->BackfaceIndexPtr = NULL; VB->BackfaceSecondaryColorPtr = NULL; - VB->FogCoordPtr = VB->AttribPtr[_TNL_ATTRIB_FOG]; /* Clipping and drawing code still requires this to be a packed * array of ubytes which can be written into. TODO: Fix and diff --git a/src/mesa/tnl/t_vb_fog.c b/src/mesa/tnl/t_vb_fog.c index a68310de4d..4a0e6ad4f9 100644 --- a/src/mesa/tnl/t_vb_fog.c +++ b/src/mesa/tnl/t_vb_fog.c @@ -228,7 +228,6 @@ run_fog_stage(GLcontext *ctx, struct tnl_pipeline_stage *stage) VB->AttribPtr[_TNL_ATTRIB_FOG] = input; } - VB->FogCoordPtr = VB->AttribPtr[_TNL_ATTRIB_FOG]; return GL_TRUE; } diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index 7002f74a00..c289cdfbaa 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -454,16 +454,12 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage ) VB->ClipPtr->count = VB->Count; } - VB->AttribPtr[_TNL_ATTRIB_COLOR0] = &store->results[VERT_RESULT_COL0]; - VB->BackfaceColorPtr = &store->results[VERT_RESULT_BFC0]; - VB->AttribPtr[_TNL_ATTRIB_COLOR1] = &store->results[VERT_RESULT_COL1]; - VB->BackfaceSecondaryColorPtr = &store->results[VERT_RESULT_BFC1]; - VB->FogCoordPtr = &store->results[VERT_RESULT_FOGC]; - VB->AttribPtr[VERT_ATTRIB_COLOR0] = &store->results[VERT_RESULT_COL0]; VB->AttribPtr[VERT_ATTRIB_COLOR1] = &store->results[VERT_RESULT_COL1]; VB->AttribPtr[VERT_ATTRIB_FOG] = &store->results[VERT_RESULT_FOGC]; VB->AttribPtr[_TNL_ATTRIB_POINTSIZE] = &store->results[VERT_RESULT_PSIZ]; + VB->BackfaceColorPtr = &store->results[VERT_RESULT_BFC0]; + VB->BackfaceSecondaryColorPtr = &store->results[VERT_RESULT_BFC1]; for (i = 0; i < ctx->Const.MaxTextureCoordUnits; i++) { VB->AttribPtr[_TNL_ATTRIB_TEX0 + i] diff --git a/src/mesa/tnl_dd/t_dd_vbtmp.h b/src/mesa/tnl_dd/t_dd_vbtmp.h index a35218a158..85101b9ceb 100644 --- a/src/mesa/tnl_dd/t_dd_vbtmp.h +++ b/src/mesa/tnl_dd/t_dd_vbtmp.h @@ -200,9 +200,9 @@ static void TAG(emit)( GLcontext *ctx, } if (DO_FOG) { - if (VB->FogCoordPtr) { - fog = VB->FogCoordPtr->data; - fog_stride = VB->FogCoordPtr->stride; + if (VB->AttribPtr[_TNL_ATTRIB_FOG]) { + fog = VB->AttribPtr[_TNL_ATTRIB_FOG]->data; + fog_stride = VB->AttribPtr[_TNL_ATTRIB_FOG]->stride; } else { static GLfloat tmp[4] = {0, 0, 0, 0}; diff --git a/src/mesa/x86/gen_matypes.c b/src/mesa/x86/gen_matypes.c index ce91b75f3a..0d7e0f1f98 100644 --- a/src/mesa/x86/gen_matypes.c +++ b/src/mesa/x86/gen_matypes.c @@ -135,7 +135,7 @@ int main( int argc, char **argv ) OFFSET( "VB_INDEX_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_COLOR_INDEX] ); OFFSET( "VB_COLOR_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_COLOR0] ); OFFSET( "VB_SECONDARY_COLOR_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_COLOR1] ); - OFFSET( "VB_FOG_COORD_PTR ", struct vertex_buffer, FogCoordPtr ); + OFFSET( "VB_FOG_COORD_PTR ", struct vertex_buffer, AttribPtr[_TNL_ATTRIB_FOG] ); OFFSET( "VB_PRIMITIVE ", struct vertex_buffer, Primitive ); printf( "\n" ); -- cgit v1.2.3 From cc39fcad89db2a4fc96b64915d42e5b1ac59d345 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 18 Nov 2009 02:58:15 -0800 Subject: i915: Remove dead meta_draw_quad code. --- src/mesa/drivers/dri/i915/intel_tris.c | 78 ------------------------------ src/mesa/drivers/dri/intel/intel_context.h | 8 --- 2 files changed, 86 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/intel_tris.c b/src/mesa/drivers/dri/i915/intel_tris.c index bc527aae47..8a3ab39bc2 100644 --- a/src/mesa/drivers/dri/i915/intel_tris.c +++ b/src/mesa/drivers/dri/i915/intel_tris.c @@ -1250,81 +1250,6 @@ union fi GLint i; }; - -/**********************************************************************/ -/* Used only with the metaops callbacks. */ -/**********************************************************************/ -static void -intel_meta_draw_poly(struct intel_context *intel, - GLuint n, - GLfloat xy[][2], - GLfloat z, GLuint color, GLfloat tex[][2]) -{ - union fi *vb; - GLint i; - unsigned int saved_vertex_size = intel->vertex_size; - - LOCK_HARDWARE(intel); - - intel->vertex_size = 6; - - /* All 3d primitives should be emitted with LOOP_CLIPRECTS, - * otherwise the drawing origin (DR4) might not be set correctly. - */ - intel_set_prim(intel, PRIM3D_TRIFAN); - vb = (union fi *) intel_get_prim_space(intel, n); - - for (i = 0; i < n; i++) { - vb[0].f = xy[i][0]; - vb[1].f = xy[i][1]; - vb[2].f = z; - vb[3].i = color; - vb[4].f = tex[i][0]; - vb[5].f = tex[i][1]; - vb += 6; - } - - INTEL_FIREVERTICES(intel); - - intel->vertex_size = saved_vertex_size; - - UNLOCK_HARDWARE(intel); -} - -static void -intel_meta_draw_quad(struct intel_context *intel, - GLfloat x0, GLfloat x1, - GLfloat y0, GLfloat y1, - GLfloat z, - GLuint color, - GLfloat s0, GLfloat s1, GLfloat t0, GLfloat t1) -{ - GLfloat xy[4][2]; - GLfloat tex[4][2]; - - xy[0][0] = x0; - xy[0][1] = y0; - xy[1][0] = x1; - xy[1][1] = y0; - xy[2][0] = x1; - xy[2][1] = y1; - xy[3][0] = x0; - xy[3][1] = y1; - - tex[0][0] = s0; - tex[0][1] = t0; - tex[1][0] = s1; - tex[1][1] = t0; - tex[2][0] = s1; - tex[2][1] = t1; - tex[3][0] = s0; - tex[3][1] = t1; - - intel_meta_draw_poly(intel, 4, xy, z, color, tex); -} - - - /**********************************************************************/ /* Initialization. */ /**********************************************************************/ @@ -1333,7 +1258,6 @@ intel_meta_draw_quad(struct intel_context *intel, void intelInitTriFuncs(GLcontext * ctx) { - struct intel_context *intel = intel_context(ctx); TNLcontext *tnl = TNL_CONTEXT(ctx); static int firsttime = 1; @@ -1350,6 +1274,4 @@ intelInitTriFuncs(GLcontext * ctx) tnl->Driver.Render.BuildVertices = _tnl_build_vertices; tnl->Driver.Render.CopyPV = _tnl_copy_pv; tnl->Driver.Render.Interp = _tnl_interp; - - intel->vtbl.meta_draw_quad = intel_meta_draw_quad; } diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index eb7be7ddd0..81beff4819 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -135,14 +135,6 @@ struct intel_context struct intel_region * draw_region, struct intel_region * depth_region); - void (*meta_draw_quad)(struct intel_context *intel, - GLfloat x0, GLfloat x1, - GLfloat y0, GLfloat y1, - GLfloat z, - GLuint color, /* ARGB32 */ - GLfloat s0, GLfloat s1, - GLfloat t0, GLfloat t1); - void (*meta_color_mask) (struct intel_context * intel, GLboolean); void (*meta_stencil_replace) (struct intel_context * intel, -- cgit v1.2.3 From 92d35b91f132deda1fb27d2071a50e8187301fe5 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 18 Nov 2009 03:01:42 -0800 Subject: i965: Pack the brw_wm_prog_key better. --- src/mesa/drivers/dri/i965/brw_wm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm.h b/src/mesa/drivers/dri/i965/brw_wm.h index 9dcb6e14bb..b9b987ea70 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.h +++ b/src/mesa/drivers/dri/i965/brw_wm.h @@ -76,10 +76,10 @@ struct brw_wm_prog_key { GLushort tex_swizzles[BRW_MAX_TEX_UNIT]; - GLuint program_string_id:32; GLushort origin_x, origin_y; GLushort drawable_height; GLbitfield64 vp_outputs_written; + GLuint program_string_id:32; }; -- cgit v1.2.3 From 15fa484f514726a29bbf24df33c0551844f878d0 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 18 Nov 2009 03:05:14 -0800 Subject: mesa: Remove gratuitous padding in prog_dst_register. The padding was there to indicate the amount of space left from the number of expected bytes in the struct minus allocated bits. But uint bitfields get packed so that they don't cross uint boundaries, and we ended up allocating an extra dword to hold the pad field! --- src/mesa/drivers/dri/i965/brw_wm_fp.c | 1 - src/mesa/main/ffvertex_prog.c | 1 - src/mesa/shader/prog_instruction.h | 1 - 3 files changed, 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_wm_fp.c b/src/mesa/drivers/dri/i965/brw_wm_fp.c index 7d03179588..3737faf26f 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_fp.c +++ b/src/mesa/drivers/dri/i965/brw_wm_fp.c @@ -138,7 +138,6 @@ static struct prog_dst_register dst_reg(GLuint file, GLuint idx) reg.CondMask = COND_TR; reg.CondSwizzle = 0; reg.CondSrc = 0; - reg.pad = 0; return reg; } diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c index fe2416d894..5cfa898031 100644 --- a/src/mesa/main/ffvertex_prog.c +++ b/src/mesa/main/ffvertex_prog.c @@ -523,7 +523,6 @@ static void emit_dst( struct prog_dst_register *dst, dst->CondMask = COND_TR; /* always pass cond test */ dst->CondSwizzle = SWIZZLE_NOOP; dst->CondSrc = 0; - dst->pad = 0; /* Check that bitfield sizes aren't exceeded */ ASSERT(dst->Index == reg.idx); } diff --git a/src/mesa/shader/prog_instruction.h b/src/mesa/shader/prog_instruction.h index 1c687bc16c..224350caac 100644 --- a/src/mesa/shader/prog_instruction.h +++ b/src/mesa/shader/prog_instruction.h @@ -312,7 +312,6 @@ struct prog_dst_register */ GLuint CondSrc:1; /*@}*/ - GLuint pad:28; }; -- cgit v1.2.3 From edd449fb9714ec1aa2d6c0cf95623f460594e685 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 18 Nov 2009 03:13:14 -0800 Subject: i965: Pack brw_wm_fragment_program better. --- src/mesa/drivers/dri/i965/brw_context.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index fded47aa2f..6d2ce15682 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -172,8 +172,8 @@ struct brw_fragment_program { GLuint id; /**< serial no. to identify frag progs, never re-used */ GLboolean isGLSL; /**< really, any IF/LOOP/CONT/BREAK instructions */ - dri_bo *const_buffer; /** Program constant buffer/surface */ GLboolean use_const_buffer; + dri_bo *const_buffer; /** Program constant buffer/surface */ /** for debugging, which texture units are referenced */ GLbitfield tex_units_used; -- cgit v1.2.3 From a376e5c48237be0300bce6702ed947086d3ee23f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 18 Nov 2009 03:21:17 -0800 Subject: intel: Consistently use no_batch_wrap in intel_context struct. --- src/mesa/drivers/dri/i915/i830_vtbl.c | 3 --- src/mesa/drivers/dri/i915/i915_vtbl.c | 3 --- src/mesa/drivers/dri/i965/brw_context.h | 1 - src/mesa/drivers/dri/i965/brw_draw.c | 4 ++-- src/mesa/drivers/dri/i965/brw_vtbl.c | 3 --- src/mesa/drivers/dri/intel/intel_batchbuffer.c | 3 +++ 6 files changed, 5 insertions(+), 12 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i830_vtbl.c b/src/mesa/drivers/dri/i915/i830_vtbl.c index 7d76b39caa..c05c7759ac 100644 --- a/src/mesa/drivers/dri/i915/i830_vtbl.c +++ b/src/mesa/drivers/dri/i915/i830_vtbl.c @@ -714,9 +714,6 @@ i830_new_batch(struct intel_context *intel) { struct i830_context *i830 = i830_context(&intel->ctx); i830->state.emitted = 0; - - /* Check that we didn't just wrap our batchbuffer at a bad time. */ - assert(!intel->no_batch_wrap); } static void diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c b/src/mesa/drivers/dri/i915/i915_vtbl.c index 77ba8d5581..3e7b5101cc 100644 --- a/src/mesa/drivers/dri/i915/i915_vtbl.c +++ b/src/mesa/drivers/dri/i915/i915_vtbl.c @@ -667,9 +667,6 @@ i915_new_batch(struct intel_context *intel) * difficulties associated with them (physical address requirements). */ i915->state.emitted = 0; - - /* Check that we didn't just wrap our batchbuffer at a bad time. */ - assert(!intel->no_batch_wrap); } static void diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h index 6d2ce15682..e73e21433c 100644 --- a/src/mesa/drivers/dri/i965/brw_context.h +++ b/src/mesa/drivers/dri/i965/brw_context.h @@ -438,7 +438,6 @@ struct brw_context GLuint primitive; GLboolean emit_state_always; - GLboolean no_batch_wrap; struct { struct brw_state_flags dirty; diff --git a/src/mesa/drivers/dri/i965/brw_draw.c b/src/mesa/drivers/dri/i965/brw_draw.c index 8bcb6083f7..7ad860898f 100644 --- a/src/mesa/drivers/dri/i965/brw_draw.c +++ b/src/mesa/drivers/dri/i965/brw_draw.c @@ -145,7 +145,7 @@ static void brw_emit_prim(struct brw_context *brw, prim_packet.base_vert_location = prim->basevertex; /* Can't wrap here, since we rely on the validated state. */ - brw->no_batch_wrap = GL_TRUE; + intel->no_batch_wrap = GL_TRUE; /* If we're set to always flush, do it before and after the primitive emit. * We want to catch both missed flushes that hurt instruction/state cache @@ -163,7 +163,7 @@ static void brw_emit_prim(struct brw_context *brw, intel_batchbuffer_emit_mi_flush(intel->batch); } - brw->no_batch_wrap = GL_FALSE; + intel->no_batch_wrap = GL_FALSE; } static void brw_merge_inputs( struct brw_context *brw, diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c index 114e6bd018..dc47f08dd4 100644 --- a/src/mesa/drivers/dri/i965/brw_vtbl.c +++ b/src/mesa/drivers/dri/i965/brw_vtbl.c @@ -144,9 +144,6 @@ static void brw_new_batch( struct intel_context *intel ) { struct brw_context *brw = brw_context(&intel->ctx); - /* Check that we didn't just wrap our batchbuffer at a bad time. */ - assert(!brw->no_batch_wrap); - brw->curbe.need_new_bo = GL_TRUE; /* Mark all context state as needing to be re-emitted. diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.c b/src/mesa/drivers/dri/intel/intel_batchbuffer.c index ca6e2fa5b1..12c5a30d6b 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.c @@ -244,6 +244,9 @@ _intel_batchbuffer_flush(struct intel_batchbuffer *batch, const char *file, if (intel->vtbl.finish_batch) intel->vtbl.finish_batch(intel); + /* Check that we didn't just wrap our batchbuffer at a bad time. */ + assert(!intel->no_batch_wrap); + batch->reserved_space = BATCH_RESERVED; /* TODO: Just pass the relocation list and dma buffer up to the -- cgit v1.2.3 From c4b7c47fe3135f852919cf2d4a2f64210e8cf125 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 18 Nov 2009 03:32:35 -0800 Subject: intel: Pack colors for blit at blit time, rather than at ClearColor. --- src/mesa/drivers/dri/intel/intel_blit.c | 5 +++-- src/mesa/drivers/dri/intel/intel_context.h | 4 ---- src/mesa/drivers/dri/intel/intel_state.c | 20 -------------------- 3 files changed, 3 insertions(+), 26 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c index 817223da41..f14854602b 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.c +++ b/src/mesa/drivers/dri/intel/intel_blit.c @@ -499,10 +499,11 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask) switch (irb->texformat) { case MESA_FORMAT_ARGB8888: case MESA_FORMAT_XRGB8888: - clearVal = intel->ClearColor8888; + clearVal = PACK_COLOR_8888(clear[3], clear[0], + clear[1], clear[2]); break; case MESA_FORMAT_RGB565: - clearVal = intel->ClearColor565; + clearVal = PACK_COLOR_565(clear[0], clear[1], clear[2]); break; case MESA_FORMAT_ARGB4444: clearVal = PACK_COLOR_4444(clear[3], clear[0], diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index 81beff4819..2d352090a5 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -209,10 +209,6 @@ struct intel_context char *prevLockFile; int prevLockLine; - GLuint ClearColor565; - GLuint ClearColor8888; - - /* Offsets of fields within the current vertex: */ GLuint coloroffset; diff --git a/src/mesa/drivers/dri/intel/intel_state.c b/src/mesa/drivers/dri/intel/intel_state.c index 4ee742377d..aefae53eb2 100644 --- a/src/mesa/drivers/dri/intel/intel_state.c +++ b/src/mesa/drivers/dri/intel/intel_state.c @@ -196,25 +196,6 @@ intel_translate_logic_op(GLenum opcode) } } - -static void -intelClearColor(GLcontext *ctx, const GLfloat color[4]) -{ - struct intel_context *intel = intel_context(ctx); - GLubyte clear[4]; - - CLAMPED_FLOAT_TO_UBYTE(clear[0], color[0]); - CLAMPED_FLOAT_TO_UBYTE(clear[1], color[1]); - CLAMPED_FLOAT_TO_UBYTE(clear[2], color[2]); - CLAMPED_FLOAT_TO_UBYTE(clear[3], color[3]); - - /* compute both 32 and 16-bit clear values */ - intel->ClearColor8888 = INTEL_PACKCOLOR8888(clear[0], clear[1], - clear[2], clear[3]); - intel->ClearColor565 = INTEL_PACKCOLOR565(clear[0], clear[1], clear[2]); -} - - /* Fallback to swrast for select and feedback. */ static void @@ -229,5 +210,4 @@ void intelInitStateFuncs(struct dd_function_table *functions) { functions->RenderMode = intelRenderMode; - functions->ClearColor = intelClearColor; } -- cgit v1.2.3 From ee64347979b4e22976910cb97869887f7de4241c Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 18 Nov 2009 03:39:20 -0800 Subject: intel: Remove our special color packing macros and just use colormac.h. --- src/mesa/drivers/dri/i915/i830_texstate.c | 10 +++++----- src/mesa/drivers/dri/i915/i915_texstate.c | 17 +++++++++-------- src/mesa/drivers/dri/intel/intel_context.h | 23 ----------------------- src/mesa/drivers/dri/intel/intel_pixel_bitmap.c | 5 ++--- 4 files changed, 16 insertions(+), 39 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i830_texstate.c b/src/mesa/drivers/dri/i915/i830_texstate.c index f4bbb53b86..c62281d341 100644 --- a/src/mesa/drivers/dri/i915/i830_texstate.c +++ b/src/mesa/drivers/dri/i915/i830_texstate.c @@ -27,6 +27,7 @@ #include "main/mtypes.h" #include "main/enums.h" +#include "main/colormac.h" #include "intel_mipmap_tree.h" #include "intel_tex.h" @@ -311,11 +312,10 @@ i830_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) CLAMPED_FLOAT_TO_UBYTE(border[2], tObj->BorderColor[2]); CLAMPED_FLOAT_TO_UBYTE(border[3], tObj->BorderColor[3]); - state[I830_TEXREG_TM0S4] = INTEL_PACKCOLOR8888(border[0], - border[1], - border[2], - border[3]); - + state[I830_TEXREG_TM0S4] = PACK_COLOR_8888(border[3], + border[0], + border[1], + border[2]); I830_ACTIVESTATE(i830, I830_UPLOAD_TEX(unit), GL_TRUE); /* memcmp was already disabled, but definitely won't work as the diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index d6689af53f..1bacd51aec 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -28,6 +28,7 @@ #include "main/mtypes.h" #include "main/enums.h" #include "main/macros.h" +#include "main/colormac.h" #include "intel_mipmap_tree.h" #include "intel_tex.h" @@ -363,15 +364,15 @@ i915_update_tex_unit(struct intel_context *intel, GLuint unit, GLuint ss3) * R channel, while the hardware uses A. Spam R into all the channels * for safety. */ - state[I915_TEXREG_SS4] = INTEL_PACKCOLOR8888(border[0], - border[0], - border[0], - border[0]); + state[I915_TEXREG_SS4] = PACK_COLOR_8888(border[0], + border[0], + border[0], + border[0]); } else { - state[I915_TEXREG_SS4] = INTEL_PACKCOLOR8888(border[0], - border[1], - border[2], - border[3]); + state[I915_TEXREG_SS4] = PACK_COLOR_8888(border[3], + border[0], + border[1], + border[2]); } diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index 2d352090a5..8cd3efea8a 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -361,29 +361,6 @@ do { \ (intel)->prim.flush(intel); \ } while (0) -/* ================================================================ - * Color packing: - */ - -#define INTEL_PACKCOLOR4444(r,g,b,a) \ - ((((a) & 0xf0) << 8) | (((r) & 0xf0) << 4) | ((g) & 0xf0) | ((b) >> 4)) - -#define INTEL_PACKCOLOR1555(r,g,b,a) \ - ((((r) & 0xf8) << 7) | (((g) & 0xf8) << 2) | (((b) & 0xf8) >> 3) | \ - ((a) ? 0x8000 : 0)) - -#define INTEL_PACKCOLOR565(r,g,b) \ - ((((r) & 0xf8) << 8) | (((g) & 0xfc) << 3) | (((b) & 0xf8) >> 3)) - -#define INTEL_PACKCOLOR8888(r,g,b,a) \ - ((a<<24) | (r<<16) | (g<<8) | b) - -#define INTEL_PACKCOLOR(format, r, g, b, a) \ -(format == DV_PF_555 ? INTEL_PACKCOLOR1555(r,g,b,a) : \ - (format == DV_PF_565 ? INTEL_PACKCOLOR565(r,g,b) : \ - (format == DV_PF_8888 ? INTEL_PACKCOLOR8888(r,g,b,a) : \ - 0))) - /* ================================================================ * From linux kernel i386 header files, copes with odd sizes better * than COPY_DWORDS would: diff --git a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c index 99330b6ddf..9572b67326 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c @@ -228,10 +228,9 @@ do_blit_bitmap( GLcontext *ctx, UNCLAMPED_FLOAT_TO_UBYTE(ubcolor[3], tmpColor[3]); if (dst->cpp == 2) - color = INTEL_PACKCOLOR565(ubcolor[0], ubcolor[1], ubcolor[2]); + color = PACK_COLOR_565(ubcolor[0], ubcolor[1], ubcolor[2]); else - color = INTEL_PACKCOLOR8888(ubcolor[0], ubcolor[1], - ubcolor[2], ubcolor[3]); + color = PACK_COLOR_8888(ubcolor[3], ubcolor[0], ubcolor[1], ubcolor[2]); if (!intel_check_blit_fragment_ops(ctx, tmpColor[3] == 1.0F)) return GL_FALSE; -- cgit v1.2.3 From 667760f53c16fae45ab29881c5ea12eef5fcda54 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 18 Nov 2009 03:43:16 -0800 Subject: intel: Remove dead intel_context members and move some packing around. --- src/mesa/drivers/dri/intel/intel_context.c | 6 ------ src/mesa/drivers/dri/intel/intel_context.h | 10 +--------- 2 files changed, 1 insertion(+), 15 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 2aeca6b81b..7b7c0a0b5a 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -733,12 +733,6 @@ intelInitContext(struct intel_context *intel, intel->RenderIndex = ~0; fthrottle_mode = driQueryOptioni(&intel->optionCache, "fthrottle_mode"); - intel->irqsEmitted = 0; - - intel->do_irqs = (intel->intelScreen->irq_active && - fthrottle_mode == DRI_CONF_FTHROTTLE_IRQS); - - intel->do_usleeps = (fthrottle_mode == DRI_CONF_FTHROTTLE_USLEEPS); if (intel->gen >= 4 && !intel->intelScreen->irq_active) { _mesa_printf("IRQs not active. Exiting\n"); diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index 8cd3efea8a..f16f502c1d 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -225,6 +225,7 @@ struct intel_context GLboolean hw_stipple; GLboolean depth_buffer_is_float; GLboolean no_rast; + GLboolean no_hw; GLboolean always_flush_batch; GLboolean always_flush_cache; @@ -290,13 +291,6 @@ struct intel_context GLboolean use_early_z; drm_clip_rect_t fboRect; /**< cliprect for FBO rendering */ - int perf_boxes; - - GLuint do_usleeps; - int do_irqs; - GLuint irqsEmitted; - - GLboolean scissor; drm_clip_rect_t draw_rect; drm_clip_rect_t scissor_rect; @@ -313,8 +307,6 @@ struct intel_context GLuint lastStamp; - GLboolean no_hw; - /** * Configuration cache */ -- cgit v1.2.3 From 827ba44f6ee83ab21c6a2b09323f6f1df4a7d4c8 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 18 Nov 2009 18:15:25 +0100 Subject: intel: Remove non-GEM support. This really isn't supported at this point. GEM's been in the kernel for a year, and the fake bufmgr never really worked. --- src/mesa/drivers/dri/i965/brw_draw_upload.c | 8 ---- src/mesa/drivers/dri/intel/intel_batchbuffer.c | 4 +- src/mesa/drivers/dri/intel/intel_context.c | 38 ++++------------- src/mesa/drivers/dri/intel/intel_context.h | 6 --- src/mesa/drivers/dri/intel/intel_extensions.c | 14 ++----- src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 16 +++----- src/mesa/drivers/dri/intel/intel_regions.c | 57 +++++--------------------- src/mesa/drivers/dri/intel/intel_screen.c | 38 ++++------------- src/mesa/drivers/dri/intel/intel_screen.h | 1 - src/mesa/drivers/dri/intel/intel_span.c | 13 ++---- 10 files changed, 43 insertions(+), 152 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_draw_upload.c b/src/mesa/drivers/dri/i965/brw_draw_upload.c index 271a88dae0..7c796dae93 100644 --- a/src/mesa/drivers/dri/i965/brw_draw_upload.c +++ b/src/mesa/drivers/dri/i965/brw_draw_upload.c @@ -243,14 +243,6 @@ static void wrap_buffers( struct brw_context *brw, dri_bo_unreference(brw->vb.upload.bo); brw->vb.upload.bo = dri_bo_alloc(brw->intel.bufmgr, "temporary VBO", size, 1); - - /* Set the internal VBO\ to no-backing-store. We only use them as a - * temporary within a brw_try_draw_prims while the lock is held. - */ - /* DON'T DO THIS AS IF WE HAVE TO RE-ORG MEMORY WE NEED SOMEWHERE WITH - FAKE TO PUSH THIS STUFF */ -// if (!brw->intel.ttm) -// dri_bo_fake_disable_backing_store(brw->vb.upload.bo, NULL, NULL); } static void get_space( struct brw_context *brw, diff --git a/src/mesa/drivers/dri/intel/intel_batchbuffer.c b/src/mesa/drivers/dri/intel/intel_batchbuffer.c index 12c5a30d6b..2eae9b66d8 100644 --- a/src/mesa/drivers/dri/intel/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/intel/intel_batchbuffer.c @@ -80,7 +80,7 @@ intel_batchbuffer_reset(struct intel_batchbuffer *batch) batch->buf = NULL; } - if (!batch->buffer && intel->ttm == GL_TRUE) + if (!batch->buffer) batch->buffer = malloc (intel->maxBatchSize); batch->buf = dri_bo_alloc(intel->bufmgr, "batchbuffer", @@ -212,7 +212,7 @@ _intel_batchbuffer_flush(struct intel_batchbuffer *batch, const char *file, batch->reserved_space = 0; /* Emit a flush if the bufmgr doesn't do it for us. */ - if (intel->always_flush_cache || !intel->ttm) { + if (intel->always_flush_cache) { intel_batchbuffer_emit_mi_flush(batch); used = batch->ptr - batch->map; } diff --git a/src/mesa/drivers/dri/intel/intel_context.c b/src/mesa/drivers/dri/intel/intel_context.c index 7b7c0a0b5a..1434ae530b 100644 --- a/src/mesa/drivers/dri/intel/intel_context.c +++ b/src/mesa/drivers/dri/intel/intel_context.c @@ -176,9 +176,7 @@ intelGetString(GLcontext * ctx, GLenum name) break; } - (void) driGetRendererString(buffer, chipset, - (intel->ttm) ? DRIVER_DATE_GEM : DRIVER_DATE, - 0); + (void) driGetRendererString(buffer, chipset, DRIVER_DATE_GEM, 0); return (GLubyte *) buffer; default: @@ -601,6 +599,7 @@ intelInitContext(struct intel_context *intel, __DRIscreenPrivate *sPriv = driContextPriv->driScreenPriv; intelScreenPrivate *intelScreen = (intelScreenPrivate *) sPriv->private; int fthrottle_mode; + int bo_reuse_mode; if (!_mesa_initialize_context(&intel->ctx, mesaVis, shareCtx, functions, (void *) intel)) { @@ -635,18 +634,14 @@ intelInitContext(struct intel_context *intel, intel->maxBatchSize = BATCH_SZ; intel->bufmgr = intelScreen->bufmgr; - intel->ttm = intelScreen->ttm; - if (intel->ttm) { - int bo_reuse_mode; - bo_reuse_mode = driQueryOptioni(&intel->optionCache, "bo_reuse"); - switch (bo_reuse_mode) { - case DRI_CONF_BO_REUSE_DISABLED: - break; - case DRI_CONF_BO_REUSE_ALL: - intel_bufmgr_gem_enable_reuse(intel->bufmgr); - break; - } + bo_reuse_mode = driQueryOptioni(&intel->optionCache, "bo_reuse"); + switch (bo_reuse_mode) { + case DRI_CONF_BO_REUSE_DISABLED: + break; + case DRI_CONF_BO_REUSE_ALL: + intel_bufmgr_gem_enable_reuse(intel->bufmgr); + break; } /* This doesn't yet catch all non-conformant rendering, but it's a @@ -1052,21 +1047,6 @@ intelContendedLock(struct intel_context *intel, GLuint flags) sarea->ctxOwner = me; } - /* If the last consumer of the texture memory wasn't us, notify the fake - * bufmgr and record the new owner. We should have the memory shared - * between contexts of a single fake bufmgr, but this will at least make - * things correct for now. - */ - if (!intel->ttm && sarea->texAge != intel->hHWContext) { - sarea->texAge = intel->hHWContext; - intel_bufmgr_fake_contended_lock_take(intel->bufmgr); - if (INTEL_DEBUG & DEBUG_BATCH) - intel_decode_context_reset(); - if (INTEL_DEBUG & DEBUG_BUFMGR) - fprintf(stderr, "Lost Textures: sarea->texAge %x hw context %x\n", - sarea->ctxOwner, intel->hHWContext); - } - /* Drawable changed? */ if (dPriv && intel->lastStamp != dPriv->lastStamp) { diff --git a/src/mesa/drivers/dri/intel/intel_context.h b/src/mesa/drivers/dri/intel/intel_context.h index f16f502c1d..481202c971 100644 --- a/src/mesa/drivers/dri/intel/intel_context.h +++ b/src/mesa/drivers/dri/intel/intel_context.h @@ -181,12 +181,6 @@ struct intel_context struct intel_region *back_region; struct intel_region *depth_region; - /** - * This value indicates that the kernel memory manager is being used - * instead of the fake client-side memory manager. - */ - GLboolean ttm; - struct intel_batchbuffer *batch; drm_intel_bo *first_post_swapbuffers_batch; GLboolean no_batch_wrap; diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index 1682e115cc..f5fe543b5d 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -79,6 +79,7 @@ static const struct dri_extension card_extensions[] = { { "GL_ARB_half_float_pixel", NULL }, { "GL_ARB_map_buffer_range", GL_ARB_map_buffer_range_functions }, { "GL_ARB_multitexture", NULL }, + { "GL_ARB_pixel_buffer_object", NULL }, { "GL_ARB_point_parameters", GL_ARB_point_parameters_functions }, { "GL_ARB_point_sprite", NULL }, { "GL_ARB_shader_objects", GL_ARB_shader_objects_functions }, @@ -104,6 +105,8 @@ static const struct dri_extension card_extensions[] = { { "GL_EXT_blend_logic_op", NULL }, { "GL_EXT_blend_subtract", NULL }, { "GL_EXT_cull_vertex", GL_EXT_cull_vertex_functions }, + { "GL_EXT_framebuffer_blit", GL_EXT_framebuffer_blit_functions }, + { "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions }, { "GL_EXT_fog_coord", GL_EXT_fog_coord_functions }, { "GL_EXT_gpu_program_parameters", GL_EXT_gpu_program_parameters_functions }, { "GL_EXT_packed_depth_stencil", NULL }, @@ -176,14 +179,6 @@ static const struct dri_extension arb_oq_extensions[] = { { NULL, NULL } }; - -static const struct dri_extension ttm_extensions[] = { - { "GL_ARB_pixel_buffer_object", NULL }, - { "GL_EXT_framebuffer_blit", GL_EXT_framebuffer_blit_functions }, - { "GL_EXT_framebuffer_object", GL_EXT_framebuffer_object_functions }, - { NULL, NULL } -}; - static const struct dri_extension fragment_shader_extensions[] = { { "GL_ARB_fragment_shader", NULL }, { NULL, NULL } @@ -202,9 +197,6 @@ intelInitExtensions(GLcontext *ctx) */ driInitExtensions(ctx, card_extensions, GL_FALSE); - if (intel->ttm) - driInitExtensions(ctx, ttm_extensions, GL_FALSE); - if (IS_965(intel->intelScreen->deviceID)) driInitExtensions(ctx, brw_extensions, GL_FALSE); diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c index abb3024bfb..6a565f80cf 100644 --- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c @@ -224,16 +224,12 @@ int intel_miptree_pitch_align (struct intel_context *intel, if (!mt->compressed) { int pitch_align; - if (intel->ttm) { - /* XXX: Align pitch to multiple of 64 bytes for now to allow - * render-to-texture to work in all cases. This should probably be - * replaced at some point by some scheme to only do this when really - * necessary. - */ - pitch_align = 64; - } else { - pitch_align = 4; - } + /* XXX: Align pitch to multiple of 64 bytes for now to allow + * render-to-texture to work in all cases. This should probably be + * replaced at some point by some scheme to only do this when really + * necessary. + */ + pitch_align = 64; if (tiling == I915_TILING_X) pitch_align = 512; diff --git a/src/mesa/drivers/dri/intel/intel_regions.c b/src/mesa/drivers/dri/intel/intel_regions.c index 80975163d4..d6b9dc4446 100644 --- a/src/mesa/drivers/dri/intel/intel_regions.c +++ b/src/mesa/drivers/dri/intel/intel_regions.c @@ -542,55 +542,18 @@ intel_recreate_static(struct intel_context *intel, region->buffer = NULL; } - if (intel->ttm) { - assert(region_desc->bo_handle != -1); - region->buffer = intel_bo_gem_create_from_name(intel->bufmgr, - name, - region_desc->bo_handle); - - ret = dri_bo_get_tiling(region->buffer, ®ion->tiling, - ®ion->bit_6_swizzle); - if (ret != 0) { - fprintf(stderr, "Couldn't get tiling of buffer %d (%s): %s\n", - region_desc->bo_handle, name, strerror(-ret)); - intel_region_release(®ion); - return NULL; - } - } else { - if (region->classic_map != NULL) { - drmUnmap(region->classic_map, - region->pitch * region->cpp * region->height); - region->classic_map = NULL; - } - ret = drmMap(intel->driFd, region_desc->handle, - region->pitch * region->cpp * region->height, - ®ion->classic_map); - if (ret != 0) { - fprintf(stderr, "Failed to drmMap %s buffer\n", name); - free(region); - return NULL; - } - - region->buffer = intel_bo_fake_alloc_static(intel->bufmgr, + assert(region_desc->bo_handle != -1); + region->buffer = intel_bo_gem_create_from_name(intel->bufmgr, name, - region_desc->offset, - region->pitch * region->cpp * - region->height, - region->classic_map); - - /* The sarea just gives us a boolean for whether it's tiled or not, - * instead of which tiling mode it is. Guess. - */ - if (region_desc->tiled) { - if (intel->gen >= 4 && region_desc == &intelScreen->depth) - region->tiling = I915_TILING_Y; - else - region->tiling = I915_TILING_X; - } else { - region->tiling = I915_TILING_NONE; - } + region_desc->bo_handle); - region->bit_6_swizzle = I915_BIT_6_SWIZZLE_NONE; + ret = dri_bo_get_tiling(region->buffer, ®ion->tiling, + ®ion->bit_6_swizzle); + if (ret != 0) { + fprintf(stderr, "Couldn't get tiling of buffer %d (%s): %s\n", + region_desc->bo_handle, name, strerror(-ret)); + intel_region_release(®ion); + return NULL; } assert(region->buffer != NULL); diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index 789135b49f..2c5a884a9b 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -605,7 +605,6 @@ intelFillInModes(__DRIscreenPrivate *psp, static GLboolean intel_init_bufmgr(intelScreenPrivate *intelScreen) { - GLboolean gem_disable = getenv("INTEL_NO_GEM") != NULL; int gem_kernel = 0; GLboolean gem_supported; struct drm_i915_getparam gp; @@ -622,43 +621,24 @@ intel_init_bufmgr(intelScreenPrivate *intelScreen) /* If we've got a new enough DDX that's initializing GEM and giving us * object handles for the shared buffers, use that. */ - intelScreen->ttm = GL_FALSE; if (intelScreen->driScrnPriv->dri2.enabled) gem_supported = GL_TRUE; else if (intelScreen->driScrnPriv->ddx_version.minor >= 9 && gem_kernel && intelScreen->front.bo_handle != -1) gem_supported = GL_TRUE; - else - gem_supported = GL_FALSE; - - if (!gem_disable && gem_supported) { - intelScreen->bufmgr = intel_bufmgr_gem_init(spriv->fd, BATCH_SZ); - if (intelScreen->bufmgr != NULL) - intelScreen->ttm = GL_TRUE; + else { + fprintf(stderr, "[%s:%u] Error initializing GEM.\n", + __func__, __LINE__); + return GL_FALSE; } + + intelScreen->bufmgr = intel_bufmgr_gem_init(spriv->fd, BATCH_SZ); /* Otherwise, use the classic buffer manager. */ if (intelScreen->bufmgr == NULL) { - if (gem_disable) { - _mesa_warning(NULL, "GEM disabled. Using classic."); - } else { - _mesa_warning(NULL, - "Failed to initialize GEM. Falling back to classic."); - } - - if (intelScreen->tex.size == 0) { - fprintf(stderr, "[%s:%u] Error initializing buffer manager.\n", - __func__, __LINE__); - return GL_FALSE; - } - - intelScreen->bufmgr = - intel_bufmgr_fake_init(spriv->fd, - intelScreen->tex.offset, - intelScreen->tex.map, - intelScreen->tex.size, - (unsigned int * volatile) - &intelScreen->sarea->last_dispatch); + fprintf(stderr, "[%s:%u] Error initializing buffer manager.\n", + __func__, __LINE__); + return GL_FALSE; } if (intel_get_param(spriv, I915_PARAM_NUM_FENCES_AVAIL, &num_fences)) diff --git a/src/mesa/drivers/dri/intel/intel_screen.h b/src/mesa/drivers/dri/intel/intel_screen.h index a9b9e109a6..14ca0903b6 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.h +++ b/src/mesa/drivers/dri/intel/intel_screen.h @@ -77,7 +77,6 @@ typedef struct GLboolean no_hw; GLboolean no_vbo; - int ttm; dri_bufmgr *bufmgr; GLboolean kernel_exec_fencing; diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index 3607c7dded..2c89a66a95 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -613,15 +613,7 @@ intel_set_span_functions(struct intel_context *intel, struct gl_renderbuffer *rb) { struct intel_renderbuffer *irb = (struct intel_renderbuffer *) rb; - uint32_t tiling; - - /* If in GEM mode, we need to do the tile address swizzling ourselves, - * instead of the fence registers handling it. - */ - if (intel->ttm) - tiling = irb->region->tiling; - else - tiling = I915_TILING_NONE; + uint32_t tiling = irb->region->tiling; if (intel->intelScreen->kernel_exec_fencing) { switch (irb->texformat) { @@ -673,6 +665,9 @@ intel_set_span_functions(struct intel_context *intel, return; } + /* If in GEM mode, we need to do the tile address swizzling ourselves, + * instead of the fence registers handling it. + */ switch (irb->texformat) { case MESA_FORMAT_RGB565: switch (tiling) { -- cgit v1.2.3 From 4e6e2462ea1fb5b7fc24bb0e707a9cf6507c47c9 Mon Sep 17 00:00:00 2001 From: Tom Fogal Date: Thu, 19 Nov 2009 09:18:48 -0700 Subject: mesa: define 32bit byteswap for AIX. Fixes `xlib' driver build on AIX. Signed-off-by: Brian Paul --- src/mesa/main/compiler.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h index 9319505a75..522295a9bf 100644 --- a/src/mesa/main/compiler.h +++ b/src/mesa/main/compiler.h @@ -235,7 +235,12 @@ extern "C" { #elif defined(__APPLE__) #include #define CPU_TO_LE32( x ) CFSwapInt32HostToLittle( x ) -#else /*__linux__ __APPLE__*/ +#elif defined(_AIX) +#define CPU_TO_LE32( x ) x = ((x & 0x000000ff) << 24) | \ + ((x & 0x0000ff00) << 8) | \ + ((x & 0x00ff0000) >> 8) | \ + ((x & 0xff000000) >> 24); +#else /*__linux__ */ #include #define CPU_TO_LE32( x ) bswap32( x ) #endif /*__linux__*/ -- cgit v1.2.3 From 6345a7ba447d3e04b939ead6fee44fe9201ec2e3 Mon Sep 17 00:00:00 2001 From: Richard Li Date: Thu, 19 Nov 2009 16:05:43 -0500 Subject: r600 : check in shader code test enable flag: if flag R600_ENABLE_GLSL_TEST defined, IL shader code will goto r600 assembler. The test base is /mesa/progs/glsl/brick, and changes shader code in CH06-brick.frag/vert to test different logic op combination. (if,else,while,function,...). The stack depth code is not in yet, so it is hard coded now. So complex code would not run (such as things like 8 loops embeded loop in loop). --- src/mesa/drivers/dri/r600/r600_context.c | 54 +++++++++++++++++++++++++++--- src/mesa/drivers/dri/r600/r700_assembler.c | 44 +++++++++++++++--------- 2 files changed, 77 insertions(+), 21 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index dbd233729c..ca0a670f3c 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -72,7 +72,9 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "vblank.h" #include "utils.h" -#include "xmlpool.h" /* for symbolic values of enum-type options */ +#include "xmlpool.h" /* for symbolic values of enum-type options */ + +//#define R600_ENABLE_GLSL_TEST 1 #define need_GL_VERSION_2_0 #define need_GL_ARB_occlusion_query @@ -154,8 +156,12 @@ static const struct dri_extension mm_extensions[] = { * The GL 2.0 functions are needed to make display lists work with * functions added by GL_ATI_separate_stencil. */ -static const struct dri_extension gl_20_extension[] = { - {"GL_VERSION_2_0", GL_VERSION_2_0_functions }, +static const struct dri_extension gl_20_extension[] = { +#ifdef R600_ENABLE_GLSL_TEST + {"GL_ARB_shading_language_100", GL_VERSION_2_0_functions }, +#else + {"GL_VERSION_2_0", GL_VERSION_2_0_functions }, +#endif /* R600_ENABLE_GLSL_TEST */ }; static const struct tnl_pipeline_stage *r600_pipeline[] = { @@ -306,7 +312,28 @@ static void r600InitGLExtensions(GLcontext *ctx) driInitExtensions(ctx, card_extensions, GL_TRUE); if (r600->radeon.radeonScreen->kernel_mm) - driInitExtensions(ctx, mm_extensions, GL_FALSE); + driInitExtensions(ctx, mm_extensions, GL_FALSE); + +#ifdef R600_ENABLE_GLSL_TEST + driInitExtensions(ctx, gl_20_extension, GL_TRUE); + //_mesa_enable_2_0_extensions(ctx); + //1.5 + ctx->Extensions.ARB_occlusion_query = GL_TRUE; + ctx->Extensions.ARB_vertex_buffer_object = GL_TRUE; + ctx->Extensions.EXT_shadow_funcs = GL_TRUE; + //2.0 + ctx->Extensions.ARB_draw_buffers = GL_TRUE; + ctx->Extensions.ARB_point_sprite = GL_TRUE; + ctx->Extensions.ARB_shader_objects = GL_TRUE; + ctx->Extensions.ARB_vertex_shader = GL_TRUE; + ctx->Extensions.ARB_fragment_shader = GL_TRUE; + ctx->Extensions.ARB_texture_non_power_of_two = GL_TRUE; + ctx->Extensions.EXT_blend_equation_separate = GL_TRUE; + ctx->Extensions.ATI_separate_stencil = GL_TRUE; + + /* glsl compiler has problem if this is not GL_TRUE */ + ctx->Shader.EmitCondCodes = GL_TRUE; +#endif /* R600_ENABLE_GLSL_TEST */ if (driQueryOptionb (&r600->radeon.optionCache, "disable_stencil_two_side")) @@ -341,7 +368,24 @@ GLboolean r600CreateContext(const __GLcontextModes * glVisual, assert(glVisual); assert(driContextPriv); - assert(screen); + assert(screen); + + //richard test + FILE *pFile = NULL; + unsigned long ulByteToWrite = 0; + char szStr[1024]; + + pFile = fopen("//home//richard//rtp-log//func_call.log", "a+"); + if(NULL != pFile) + { + sprintf(szStr, "r600CreateContext \r\n"); + ulByteToWrite = strlen(szStr); + fwrite(szStr, 1, ulByteToWrite, pFile); + + fclose(pFile); + pFile = NULL; + } + //------------- /* Allocate the R600 context */ r600 = (context_t*) CALLOC(sizeof(*r600)); diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 6e8d1cd927..16ac920f29 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -4983,17 +4983,31 @@ GLboolean assemble_EXPORT(r700_AssemblerBase *pAsm) inline void checkStackDepth(r700_AssemblerBase *pAsm, GLuint uReason) { - switch (uReason) - { - case FC_PUSH_VPM: - break; - case FC_PUSH_WQM: - break; - case FC_LOOP: - break; - case FC_REP: - break; - }; + switch (uReason) + { + case FC_PUSH_VPM: + pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.pushs++; + pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.current++; + break; + case FC_PUSH_WQM: + pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.pushs++; + pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.current += 4; + break; + case FC_LOOP: + pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.pushs += 4; + break; + case FC_REP: + /* TODO : for 16 vp asic, should += 2; */ + pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.pushs += 1; + break; + }; + + if(pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.pushs + > pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.max) + { + pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.max = + pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.pushs; + } } GLboolean jumpToOffest(r700_AssemblerBase *pAsm, GLuint pops, GLint offset) @@ -5092,10 +5106,6 @@ GLboolean assemble_IF(r700_AssemblerBase *pAsm, GLboolean bHasElse) GLboolean assemble_ELSE(r700_AssemblerBase *pAsm) { -#ifdef USE_CF_FOR_POP_AFTER - pops(pAsm, 1); -#endif /* USE_CF_FOR_POP_AFTER */ - if(GL_FALSE == add_cf_instruction(pAsm) ) { return GL_FALSE; @@ -5647,7 +5657,9 @@ GLboolean testFlag(r700_AssemblerBase *pAsm) { return GL_FALSE; } -#endif +#endif + + checkStackDepth(pAsm, FC_PUSH_VPM); return GL_TRUE; } -- cgit v1.2.3 From 273f4d6b5fe125bf0cba44c5ee8b25c76d3396c0 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 19 Nov 2009 14:10:57 -0700 Subject: st/mesa: remove pointless assertion --- src/mesa/state_tracker/st_cb_texture.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 9186db76e1..5283ece551 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -1724,8 +1724,6 @@ copy_image_data_to_texture(struct st_context *st, pipe_texture_reference(&stImage->pt, NULL); } else if (stImage->base.Data) { - assert(stImage->base.Data != NULL); - /* More straightforward upload. */ -- cgit v1.2.3 From 92863109af05acdb4ee5e42141c83ab0f18b7f88 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 19 Nov 2009 14:17:09 -0700 Subject: st/mesa: remove is_compressed_mesa_format() --- src/mesa/state_tracker/st_cb_texture.c | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 5283ece551..76b6bbeb4b 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -119,25 +119,6 @@ compressed_num_bytes(gl_format format) } -static GLboolean -is_compressed_mesa_format(gl_format format) -{ - switch (format) { - case MESA_FORMAT_RGB_DXT1: - case MESA_FORMAT_RGBA_DXT1: - case MESA_FORMAT_RGBA_DXT3: - case MESA_FORMAT_RGBA_DXT5: - case MESA_FORMAT_SRGB_DXT1: - case MESA_FORMAT_SRGBA_DXT1: - case MESA_FORMAT_SRGBA_DXT3: - case MESA_FORMAT_SRGBA_DXT5: - return GL_TRUE; - default: - return GL_FALSE; - } -} - - /** called via ctx->Driver.NewTextureImage() */ static struct gl_texture_image * st_NewTextureImage(GLcontext * ctx) @@ -663,7 +644,7 @@ st_TexImage(GLcontext * ctx, */ if (!compressed_src && !ctx->Mesa_DXTn && - is_compressed_mesa_format(texImage->TexFormat) && + _mesa_is_format_compressed(texImage->TexFormat) && screen->is_format_supported(screen, stImage->pt->format, stImage->pt->target, @@ -1066,7 +1047,7 @@ st_TexSubimage(GLcontext *ctx, GLint dims, GLenum target, GLint level, /* See if we can do texture compression with a blit/render. */ if (!ctx->Mesa_DXTn && - is_compressed_mesa_format(texImage->TexFormat) && + _mesa_is_format_compressed(texImage->TexFormat) && screen->is_format_supported(screen, stImage->pt->format, stImage->pt->target, -- cgit v1.2.3 From dc41d62250ce51f28e94f1d365836ac9f2ff8907 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 19 Nov 2009 14:35:38 -0700 Subject: st/mesa: get rid of compressed_num_bytes() code --- src/mesa/state_tracker/st_cb_texture.c | 40 ++++------------------------------ 1 file changed, 4 insertions(+), 36 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 76b6bbeb4b..d4630a514f 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -93,32 +93,6 @@ gl_target_to_pipe(GLenum target) } -/** - * Return nominal bytes per texel for a compressed format, 0 for non-compressed - * format. - */ -static GLuint -compressed_num_bytes(gl_format format) -{ - switch (format) { -#if FEATURE_texture_fxt1 - case MESA_FORMAT_RGB_FXT1: - case MESA_FORMAT_RGBA_FXT1: -#endif -#if FEATURE_texture_s3tc - case MESA_FORMAT_RGB_DXT1: - case MESA_FORMAT_RGBA_DXT1: - return 2; - case MESA_FORMAT_RGBA_DXT3: - case MESA_FORMAT_RGBA_DXT5: - return 4; -#endif - default: - return 0; - } -} - - /** called via ctx->Driver.NewTextureImage() */ static struct gl_texture_image * st_NewTextureImage(GLcontext * ctx) @@ -1743,7 +1717,7 @@ st_finalize_texture(GLcontext *ctx, { struct st_texture_object *stObj = st_texture_object(tObj); const GLuint nr_faces = (stObj->base.Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1; - GLuint cpp, face; + GLuint blockSize, face; struct st_texture_image *firstImage; *needFlush = GL_FALSE; @@ -1775,13 +1749,8 @@ st_finalize_texture(GLcontext *ctx, pipe_texture_reference(&stObj->pt, firstImage->pt); } - /* FIXME: determine format block instead of cpp */ - if (_mesa_is_format_compressed(firstImage->base.TexFormat)) { - cpp = compressed_num_bytes(firstImage->base.TexFormat); - } - else { - cpp = _mesa_get_format_bytes(firstImage->base.TexFormat); - } + /* bytes per pixel block (blocks are usually 1x1) */ + blockSize = _mesa_get_format_bytes(firstImage->base.TexFormat); /* If we already have a gallium texture, check that it matches the texture * object's format, target, size, num_levels, etc. @@ -1795,8 +1764,7 @@ st_finalize_texture(GLcontext *ctx, stObj->pt->width[0] != firstImage->base.Width2 || stObj->pt->height[0] != firstImage->base.Height2 || stObj->pt->depth[0] != firstImage->base.Depth2 || - /* Nominal bytes per pixel: */ - stObj->pt->block.size / stObj->pt->block.width != cpp) + stObj->pt->block.size != blockSize) { pipe_texture_reference(&stObj->pt, NULL); ctx->st->dirty.st |= ST_NEW_FRAMEBUFFER; -- cgit v1.2.3 From 48dfd3938e428295c45692cfde0a2afff04a7970 Mon Sep 17 00:00:00 2001 From: Richard Li Date: Thu, 19 Nov 2009 16:55:16 -0500 Subject: r600 : change shader pop method for now. --- src/mesa/drivers/dri/r600/r700_assembler.c | 54 +++++++++++++++--------------- 1 file changed, 27 insertions(+), 27 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 16ac920f29..e3bc46802f 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -39,7 +39,7 @@ #include "r700_assembler.h" #define USE_CF_FOR_CONTINUE_BREAK 1 -#define USE_CF_FOR_POP_AFTER 1 +//#define USE_CF_FOR_POP_AFTER 1 BITS addrmode_PVSDST(PVSDST * pPVSDST) { @@ -4983,30 +4983,30 @@ GLboolean assemble_EXPORT(r700_AssemblerBase *pAsm) inline void checkStackDepth(r700_AssemblerBase *pAsm, GLuint uReason) { - switch (uReason) - { - case FC_PUSH_VPM: - pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.pushs++; - pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.current++; - break; - case FC_PUSH_WQM: - pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.pushs++; - pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.current += 4; - break; - case FC_LOOP: - pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.pushs += 4; - break; - case FC_REP: - /* TODO : for 16 vp asic, should += 2; */ - pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.pushs += 1; - break; - }; - - if(pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.pushs - > pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.max) - { - pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.max = - pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.pushs; + switch (uReason) + { + case FC_PUSH_VPM: + pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.pushs++; + pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.current++; + break; + case FC_PUSH_WQM: + pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.pushs++; + pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.current += 4; + break; + case FC_LOOP: + pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.pushs += 4; + break; + case FC_REP: + /* TODO : for 16 vp asic, should += 2; */ + pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.pushs += 1; + break; + }; + + if(pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.pushs + > pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.max) + { + pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.max = + pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.pushs; } } @@ -5657,8 +5657,8 @@ GLboolean testFlag(r700_AssemblerBase *pAsm) { return GL_FALSE; } -#endif - +#endif + checkStackDepth(pAsm, FC_PUSH_VPM); return GL_TRUE; -- cgit v1.2.3 From 2198497203ec427f836978098028abf3350e5e57 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 19 Nov 2009 15:17:56 -0700 Subject: vbo: added recursion check in vbo_exec_FlushVertices() --- src/mesa/vbo/vbo_exec_api.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index f72d2d84f3..c90565eae8 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -867,15 +867,27 @@ void vbo_exec_FlushVertices_internal( GLcontext *ctx, GLboolean unmap ) } - +/** + * \param flags bitmask of FLUSH_STORED_VERTICES, FLUSH_UPDATE_CURRENT + */ void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags ) { struct vbo_exec_context *exec = &vbo_context(ctx)->exec; +#ifdef DEBUG + /* debug check: make sure we don't get called recursively */ + static GLuint callDepth = 0; + callDepth++; + assert(callDepth == 1); +#endif + if (0) _mesa_printf("%s\n", __FUNCTION__); if (exec->ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { if (0) _mesa_printf("%s - inside begin/end\n", __FUNCTION__); +#ifdef DEBUG + callDepth--; +#endif return; } @@ -889,6 +901,10 @@ void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags ) } exec->ctx->Driver.NeedFlush &= ~flags; + +#ifdef DEBUG + callDepth--; +#endif } -- cgit v1.2.3 From 4e6c79ac166b71414f09e671aaad0e1d0d406e42 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 19 Nov 2009 15:18:17 -0700 Subject: st/mesa: replace st_flush() with pipe->flush() We only need to flush the gallium driver in this case. Fixes a recursive state validation bug. --- src/mesa/state_tracker/st_texture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c index 3945822f66..10f1351283 100644 --- a/src/mesa/state_tracker/st_texture.c +++ b/src/mesa/state_tracker/st_texture.c @@ -588,5 +588,5 @@ st_teximage_flush_before_map(struct st_context *st, if (referenced && ((referenced & PIPE_REFERENCED_FOR_WRITE) || (usage & PIPE_TRANSFER_WRITE))) - st_flush(st, PIPE_FLUSH_RENDER_CACHE, NULL); + st->pipe->flush(st->pipe, PIPE_FLUSH_RENDER_CACHE, NULL); } -- cgit v1.2.3 From 683e35f726a182ed9fc6b6d5cb07146eebe14dea Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Thu, 19 Nov 2009 14:39:34 -0800 Subject: gallium: don't use arrays for texture width,height,depth --- src/mesa/state_tracker/st_atom_framebuffer.c | 5 ++-- src/mesa/state_tracker/st_atom_pixeltransfer.c | 2 +- src/mesa/state_tracker/st_cb_drawpixels.c | 4 +-- src/mesa/state_tracker/st_cb_fbo.c | 6 ++-- src/mesa/state_tracker/st_cb_readpixels.c | 2 +- src/mesa/state_tracker/st_cb_texture.c | 12 ++++---- src/mesa/state_tracker/st_gen_mipmap.c | 39 +++++++++++++++----------- src/mesa/state_tracker/st_texture.c | 36 +++++++++++++----------- 8 files changed, 57 insertions(+), 49 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_atom_framebuffer.c b/src/mesa/state_tracker/st_atom_framebuffer.c index e18c0f6e0a..8ca4335e33 100644 --- a/src/mesa/state_tracker/st_atom_framebuffer.c +++ b/src/mesa/state_tracker/st_atom_framebuffer.c @@ -40,6 +40,7 @@ #include "pipe/p_inlines.h" #include "cso_cache/cso_context.h" #include "util/u_rect.h" +#include "util/u_math.h" @@ -64,8 +65,8 @@ update_renderbuffer_surface(struct st_context *st, GLuint level; /* find matching mipmap level size */ for (level = 0; level <= texture->last_level; level++) { - if (texture->width[level] == rtt_width && - texture->height[level] == rtt_height) { + if (u_minify(texture->width0, level) == rtt_width && + u_minify(texture->height0, level) == rtt_height) { pipe_surface_reference(&strb->surface, NULL); diff --git a/src/mesa/state_tracker/st_atom_pixeltransfer.c b/src/mesa/state_tracker/st_atom_pixeltransfer.c index babfcc87b4..4b35f59cc2 100644 --- a/src/mesa/state_tracker/st_atom_pixeltransfer.c +++ b/src/mesa/state_tracker/st_atom_pixeltransfer.c @@ -145,7 +145,7 @@ load_color_map_texture(GLcontext *ctx, struct pipe_texture *pt) const GLuint gSize = ctx->PixelMaps.GtoG.Size; const GLuint bSize = ctx->PixelMaps.BtoB.Size; const GLuint aSize = ctx->PixelMaps.AtoA.Size; - const uint texSize = pt->width[0]; + const uint texSize = pt->width0; uint *dest; uint i, j; diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 1d33e81c2c..7ec4599280 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -637,8 +637,8 @@ draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z, y1 = y + height * ctx->Pixel.ZoomY; draw_quad(ctx, x0, y0, z, x1, y1, color, invertTex, - (GLfloat) width / pt->width[0], - (GLfloat) height / pt->height[0]); + (GLfloat) width / pt->width0, + (GLfloat) height / pt->height0); /* restore state */ cso_restore_rasterizer(cso); diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 65ce12ccd4..0469fb9978 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -128,9 +128,9 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb, template.target = PIPE_TEXTURE_2D; template.format = format; pf_get_block(format, &template.block); - template.width[0] = width; - template.height[0] = height; - template.depth[0] = 1; + template.width0 = width; + template.height0 = height; + template.depth0 = 1; template.last_level = 0; template.nr_samples = rb->NumSamples; if (pf_is_depth_stencil(format)) { diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c index 772bb3bb69..103861d6f9 100644 --- a/src/mesa/state_tracker/st_cb_readpixels.c +++ b/src/mesa/state_tracker/st_cb_readpixels.c @@ -243,7 +243,7 @@ st_fast_readpixels(GLcontext *ctx, struct st_renderbuffer *strb, GLint row, col, dy, dstStride; if (st_fb_orientation(ctx->ReadBuffer) == Y_0_TOP) { - y = strb->texture->height[0] - y - height; + y = strb->texture->height0 - y - height; } trans = st_cond_flush_get_tex_transfer(st_context(ctx), strb->texture, diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 9186db76e1..72892b7c8c 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -451,9 +451,9 @@ compress_with_blit(GLcontext * ctx, templ.target = PIPE_TEXTURE_2D; templ.format = st_mesa_format_to_pipe_format(mesa_format); pf_get_block(templ.format, &templ.block); - templ.width[0] = width; - templ.height[0] = height; - templ.depth[0] = 1; + templ.width0 = width; + templ.height0 = height; + templ.depth0 = 1; templ.last_level = 0; templ.tex_usage = PIPE_TEXTURE_USAGE_SAMPLER; src_tex = screen->texture_create(screen, &templ); @@ -1813,9 +1813,9 @@ st_finalize_texture(GLcontext *ctx, if (stObj->pt->target != gl_target_to_pipe(stObj->base.Target) || stObj->pt->format != fmt || stObj->pt->last_level < stObj->lastLevel || - stObj->pt->width[0] != firstImage->base.Width2 || - stObj->pt->height[0] != firstImage->base.Height2 || - stObj->pt->depth[0] != firstImage->base.Depth2 || + stObj->pt->width0 != firstImage->base.Width2 || + stObj->pt->height0 != firstImage->base.Height2 || + stObj->pt->depth0 != firstImage->base.Depth2 || /* Nominal bytes per pixel: */ stObj->pt->block.size / stObj->pt->block.width != cpp) { diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c index 16ca2771b0..f8068fa12b 100644 --- a/src/mesa/state_tracker/st_gen_mipmap.c +++ b/src/mesa/state_tracker/st_gen_mipmap.c @@ -38,6 +38,7 @@ #include "pipe/p_defines.h" #include "pipe/p_inlines.h" #include "util/u_gen_mipmap.h" +#include "util/u_math.h" #include "cso_cache/cso_cache.h" #include "cso_cache/cso_context.h" @@ -133,14 +134,14 @@ fallback_generate_mipmap(GLcontext *ctx, GLenum target, srcTrans = st_cond_flush_get_tex_transfer(st_context(ctx), pt, face, srcLevel, zslice, PIPE_TRANSFER_READ, 0, 0, - pt->width[srcLevel], - pt->height[srcLevel]); + u_minify(pt->width0, srcLevel), + u_minify(pt->height0, srcLevel)); dstTrans = st_cond_flush_get_tex_transfer(st_context(ctx), pt, face, dstLevel, zslice, PIPE_TRANSFER_WRITE, 0, 0, - pt->width[dstLevel], - pt->height[dstLevel]); + u_minify(pt->width0, dstLevel), + u_minify(pt->height0, dstLevel)); srcData = (ubyte *) screen->transfer_map(screen, srcTrans); dstData = (ubyte *) screen->transfer_map(screen, dstTrans); @@ -149,13 +150,17 @@ fallback_generate_mipmap(GLcontext *ctx, GLenum target, dstStride = dstTrans->stride / dstTrans->block.size; _mesa_generate_mipmap_level(target, datatype, comps, - 0 /*border*/, - pt->width[srcLevel], pt->height[srcLevel], pt->depth[srcLevel], - srcData, - srcStride, /* stride in texels */ - pt->width[dstLevel], pt->height[dstLevel], pt->depth[dstLevel], - dstData, - dstStride); /* stride in texels */ + 0 /*border*/, + u_minify(pt->width0, srcLevel), + u_minify(pt->height0, srcLevel), + u_minify(pt->depth0, srcLevel), + srcData, + srcStride, /* stride in texels */ + u_minify(pt->width0, dstLevel), + u_minify(pt->height0, dstLevel), + u_minify(pt->depth0, dstLevel), + dstData, + dstStride); /* stride in texels */ screen->transfer_unmap(screen, srcTrans); screen->transfer_unmap(screen, dstTrans); @@ -232,9 +237,9 @@ st_generate_mipmap(GLcontext *ctx, GLenum target, oldTex->target, oldTex->format, lastLevel, - oldTex->width[0], - oldTex->height[0], - oldTex->depth[0], + oldTex->width0, + oldTex->height0, + oldTex->depth0, oldTex->tex_usage); /* The texture isn't in a "complete" state yet so set the expected @@ -269,9 +274,9 @@ st_generate_mipmap(GLcontext *ctx, GLenum target, = _mesa_get_tex_image(ctx, texObj, target, srcLevel); struct gl_texture_image *dstImage; struct st_texture_image *stImage; - uint dstWidth = pt->width[dstLevel]; - uint dstHeight = pt->height[dstLevel]; - uint dstDepth = pt->depth[dstLevel]; + uint dstWidth = u_minify(pt->width0, dstLevel); + uint dstHeight = u_minify(pt->height0, dstLevel); + uint dstDepth = u_minify(pt->depth0, dstLevel); uint border = srcImage->Border; dstImage = _mesa_get_tex_image(ctx, texObj, target, dstLevel); diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c index 3945822f66..aa88fdcd78 100644 --- a/src/mesa/state_tracker/st_texture.c +++ b/src/mesa/state_tracker/st_texture.c @@ -44,6 +44,7 @@ #include "pipe/p_defines.h" #include "pipe/p_inlines.h" #include "util/u_rect.h" +#include "util/u_math.h" #define DBG if(0) printf @@ -100,9 +101,9 @@ st_texture_create(struct st_context *st, pt.target = target; pt.format = format; pt.last_level = last_level; - pt.width[0] = width0; - pt.height[0] = height0; - pt.depth[0] = depth0; + pt.width0 = width0; + pt.height0 = height0; + pt.depth0 = depth0; pf_get_block(format, &pt.block); pt.tex_usage = usage; @@ -135,9 +136,9 @@ st_texture_match_image(const struct pipe_texture *pt, /* Test if this image's size matches what's expected in the * established texture. */ - if (image->Width != pt->width[level] || - image->Height != pt->height[level] || - image->Depth != pt->depth[level]) + if (image->Width != u_minify(pt->width0, level) || + image->Height != u_minify(pt->height0, level) || + image->Depth != u_minify(pt->depth0, level)) return GL_FALSE; return GL_TRUE; @@ -265,7 +266,7 @@ st_texture_image_data(struct st_context *st, { struct pipe_context *pipe = st->pipe; struct pipe_screen *screen = pipe->screen; - GLuint depth = dst->depth[level]; + GLuint depth = u_minify(dst->depth0, level); GLuint i; const GLubyte *srcUB = src; struct pipe_transfer *dst_transfer; @@ -275,15 +276,16 @@ st_texture_image_data(struct st_context *st, for (i = 0; i < depth; i++) { dst_transfer = st_no_flush_get_tex_transfer(st, dst, face, level, i, PIPE_TRANSFER_WRITE, 0, 0, - dst->width[level], - dst->height[level]); + u_minify(dst->width0, level), + u_minify(dst->height0, level)); st_surface_data(pipe, dst_transfer, 0, 0, /* dstx, dsty */ srcUB, src_row_stride, 0, 0, /* source x, y */ - dst->width[level], dst->height[level]); /* width, height */ + u_minify(dst->width0, level), + u_minify(dst->height0, level)); /* width, height */ screen->tex_transfer_destroy(dst_transfer); @@ -301,9 +303,9 @@ st_texture_image_copy(struct pipe_context *pipe, GLuint face) { struct pipe_screen *screen = pipe->screen; - GLuint width = dst->width[dstLevel]; - GLuint height = dst->height[dstLevel]; - GLuint depth = dst->depth[dstLevel]; + GLuint width = u_minify(dst->width0, dstLevel); + GLuint height = u_minify(dst->height0, dstLevel); + GLuint depth = u_minify(dst->depth0, dstLevel); struct pipe_surface *src_surface; struct pipe_surface *dst_surface; GLuint i; @@ -313,13 +315,13 @@ st_texture_image_copy(struct pipe_context *pipe, /* find src texture level of needed size */ for (srcLevel = 0; srcLevel <= src->last_level; srcLevel++) { - if (src->width[srcLevel] == width && - src->height[srcLevel] == height) { + if (u_minify(src->width0, srcLevel) == width && + u_minify(src->height0, srcLevel) == height) { break; } } - assert(src->width[srcLevel] == width); - assert(src->height[srcLevel] == height); + assert(u_minify(src->width0, srcLevel) == width); + assert(u_minify(src->height0, srcLevel) == height); #if 0 { -- cgit v1.2.3 From b09e74901a4f92299fe3f52f57d27fd5ca5bdd2d Mon Sep 17 00:00:00 2001 From: Richard Li Date: Thu, 19 Nov 2009 17:41:10 -0500 Subject: r600 : Clean up a bit test code mess. --- src/mesa/drivers/dri/r600/r600_context.c | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index ca0a670f3c..97b25ea3ff 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -369,23 +369,6 @@ GLboolean r600CreateContext(const __GLcontextModes * glVisual, assert(glVisual); assert(driContextPriv); assert(screen); - - //richard test - FILE *pFile = NULL; - unsigned long ulByteToWrite = 0; - char szStr[1024]; - - pFile = fopen("//home//richard//rtp-log//func_call.log", "a+"); - if(NULL != pFile) - { - sprintf(szStr, "r600CreateContext \r\n"); - ulByteToWrite = strlen(szStr); - fwrite(szStr, 1, ulByteToWrite, pFile); - - fclose(pFile); - pFile = NULL; - } - //------------- /* Allocate the R600 context */ r600 = (context_t*) CALLOC(sizeof(*r600)); -- cgit v1.2.3 From f8ea5318200c1ed839fc387b16a57c8d9969974b Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 20 Nov 2009 11:45:43 +1000 Subject: r100: fix texture_from_pixmap and compiz. r100 state emission has separate rect and non-rect states, if we are doing TFP for a TEXTURE_2D we shouldn't use the rect states as they won't get emitted properly. Signed-off-by: Dave Airlie --- src/mesa/drivers/dri/radeon/radeon_texstate.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_texstate.c b/src/mesa/drivers/dri/radeon/radeon_texstate.c index 4d9eb73d20..3cbe3b4725 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texstate.c +++ b/src/mesa/drivers/dri/radeon/radeon_texstate.c @@ -714,8 +714,6 @@ void radeonSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_ t->tile_bits = 0; t->image_override = GL_TRUE; t->override_offset = 0; - t->pp_txpitch &= (1 << 13) -1; - pitch_val = rb->pitch; switch (rb->cpp) { case 4: if (glx_texture_format == GLX_TEXTURE_FORMAT_RGB_EXT) @@ -734,12 +732,17 @@ void radeonSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_ t->pp_txfilter |= tx_table[MESA_FORMAT_RGB565].filter; break; } - t->pp_txsize = ((rb->base.Width - 1) << RADEON_TEX_USIZE_SHIFT) - | ((rb->base.Height - 1) << RADEON_TEX_VSIZE_SHIFT); - t->pp_txformat |= RADEON_TXFORMAT_NON_POWER2; - t->pp_txpitch = pitch_val; - t->pp_txpitch -= 32; + t->pp_txpitch &= (1 << 13) -1; + pitch_val = rb->pitch; + + t->pp_txsize = ((rb->base.Width - 1) << RADEON_TEX_USIZE_SHIFT) + | ((rb->base.Height - 1) << RADEON_TEX_VSIZE_SHIFT); + if (target == GL_TEXTURE_RECTANGLE_NV) { + t->pp_txformat |= RADEON_TXFORMAT_NON_POWER2; + t->pp_txpitch = pitch_val; + t->pp_txpitch -= 32; + } t->validated = GL_TRUE; _mesa_unlock_texture(radeon->glCtx, texObj); return; -- cgit v1.2.3 From 08e5d1ecad79d1c08541ba08a436f5145c5c9376 Mon Sep 17 00:00:00 2001 From: Richard Li Date: Fri, 20 Nov 2009 10:58:05 -0500 Subject: r600 : eliminate Wondows line ending for test code. --- src/mesa/drivers/dri/r600/r600_context.c | 56 ++++++++++++++++---------------- 1 file changed, 28 insertions(+), 28 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index 97b25ea3ff..7de29e5bb8 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -72,8 +72,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "vblank.h" #include "utils.h" -#include "xmlpool.h" /* for symbolic values of enum-type options */ - +#include "xmlpool.h" /* for symbolic values of enum-type options */ + //#define R600_ENABLE_GLSL_TEST 1 #define need_GL_VERSION_2_0 @@ -156,11 +156,11 @@ static const struct dri_extension mm_extensions[] = { * The GL 2.0 functions are needed to make display lists work with * functions added by GL_ATI_separate_stencil. */ -static const struct dri_extension gl_20_extension[] = { -#ifdef R600_ENABLE_GLSL_TEST - {"GL_ARB_shading_language_100", GL_VERSION_2_0_functions }, +static const struct dri_extension gl_20_extension[] = { +#ifdef R600_ENABLE_GLSL_TEST + {"GL_ARB_shading_language_100", GL_VERSION_2_0_functions }, #else - {"GL_VERSION_2_0", GL_VERSION_2_0_functions }, + {"GL_VERSION_2_0", GL_VERSION_2_0_functions }, #endif /* R600_ENABLE_GLSL_TEST */ }; @@ -312,27 +312,27 @@ static void r600InitGLExtensions(GLcontext *ctx) driInitExtensions(ctx, card_extensions, GL_TRUE); if (r600->radeon.radeonScreen->kernel_mm) - driInitExtensions(ctx, mm_extensions, GL_FALSE); - -#ifdef R600_ENABLE_GLSL_TEST - driInitExtensions(ctx, gl_20_extension, GL_TRUE); - //_mesa_enable_2_0_extensions(ctx); - //1.5 - ctx->Extensions.ARB_occlusion_query = GL_TRUE; - ctx->Extensions.ARB_vertex_buffer_object = GL_TRUE; - ctx->Extensions.EXT_shadow_funcs = GL_TRUE; - //2.0 - ctx->Extensions.ARB_draw_buffers = GL_TRUE; - ctx->Extensions.ARB_point_sprite = GL_TRUE; - ctx->Extensions.ARB_shader_objects = GL_TRUE; - ctx->Extensions.ARB_vertex_shader = GL_TRUE; - ctx->Extensions.ARB_fragment_shader = GL_TRUE; - ctx->Extensions.ARB_texture_non_power_of_two = GL_TRUE; - ctx->Extensions.EXT_blend_equation_separate = GL_TRUE; - ctx->Extensions.ATI_separate_stencil = GL_TRUE; - - /* glsl compiler has problem if this is not GL_TRUE */ - ctx->Shader.EmitCondCodes = GL_TRUE; + driInitExtensions(ctx, mm_extensions, GL_FALSE); + +#ifdef R600_ENABLE_GLSL_TEST + driInitExtensions(ctx, gl_20_extension, GL_TRUE); + //_mesa_enable_2_0_extensions(ctx); + //1.5 + ctx->Extensions.ARB_occlusion_query = GL_TRUE; + ctx->Extensions.ARB_vertex_buffer_object = GL_TRUE; + ctx->Extensions.EXT_shadow_funcs = GL_TRUE; + //2.0 + ctx->Extensions.ARB_draw_buffers = GL_TRUE; + ctx->Extensions.ARB_point_sprite = GL_TRUE; + ctx->Extensions.ARB_shader_objects = GL_TRUE; + ctx->Extensions.ARB_vertex_shader = GL_TRUE; + ctx->Extensions.ARB_fragment_shader = GL_TRUE; + ctx->Extensions.ARB_texture_non_power_of_two = GL_TRUE; + ctx->Extensions.EXT_blend_equation_separate = GL_TRUE; + ctx->Extensions.ATI_separate_stencil = GL_TRUE; + + /* glsl compiler has problem if this is not GL_TRUE */ + ctx->Shader.EmitCondCodes = GL_TRUE; #endif /* R600_ENABLE_GLSL_TEST */ if (driQueryOptionb @@ -368,7 +368,7 @@ GLboolean r600CreateContext(const __GLcontextModes * glVisual, assert(glVisual); assert(driContextPriv); - assert(screen); + assert(screen); /* Allocate the R600 context */ r600 = (context_t*) CALLOC(sizeof(*r600)); -- cgit v1.2.3 From 8451b29d9628f09b65962385bfbd95cd7f26427f Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sat, 21 Nov 2009 13:33:21 +0100 Subject: i965: Fix several memory leaks on exit. Bug #25194. --- src/mesa/drivers/dri/i965/brw_state.h | 1 + src/mesa/drivers/dri/i965/brw_state_upload.c | 2 +- src/mesa/drivers/dri/i965/brw_vtbl.c | 12 +++++++++--- src/mesa/drivers/dri/i965/brw_wm.c | 1 - 4 files changed, 11 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h index ab6f158080..b129b1f1c3 100644 --- a/src/mesa/drivers/dri/i965/brw_state.h +++ b/src/mesa/drivers/dri/i965/brw_state.h @@ -112,6 +112,7 @@ void brw_validate_state(struct brw_context *brw); void brw_upload_state(struct brw_context *brw); void brw_init_state(struct brw_context *brw); void brw_destroy_state(struct brw_context *brw); +void brw_clear_validated_bos(struct brw_context *brw); /*********************************************************************** * brw_state_cache.c diff --git a/src/mesa/drivers/dri/i965/brw_state_upload.c b/src/mesa/drivers/dri/i965/brw_state_upload.c index f4283bda1b..af8dfb4c15 100644 --- a/src/mesa/drivers/dri/i965/brw_state_upload.c +++ b/src/mesa/drivers/dri/i965/brw_state_upload.c @@ -143,7 +143,7 @@ static void xor_states( struct brw_state_flags *result, result->cache = a->cache ^ b->cache; } -static void +void brw_clear_validated_bos(struct brw_context *brw) { int i; diff --git a/src/mesa/drivers/dri/i965/brw_vtbl.c b/src/mesa/drivers/dri/i965/brw_vtbl.c index 114e6bd018..34aaea3736 100644 --- a/src/mesa/drivers/dri/i965/brw_vtbl.c +++ b/src/mesa/drivers/dri/i965/brw_vtbl.c @@ -46,7 +46,7 @@ #include "brw_state.h" #include "brw_fallback.h" #include "brw_vs.h" - +#include "brw_wm.h" static void dri_bo_release(dri_bo **bo) @@ -66,8 +66,14 @@ static void brw_destroy_context( struct intel_context *intel ) brw_destroy_state(brw); brw_draw_destroy( brw ); - - _mesa_free(brw->wm.compile_data); + brw_clear_validated_bos(brw); + if (brw->wm.compile_data) { + _mesa_free(brw->wm.compile_data->instruction); + _mesa_free(brw->wm.compile_data->vreg); + _mesa_free(brw->wm.compile_data->refs); + _mesa_free(brw->wm.compile_data->prog_instructions); + _mesa_free(brw->wm.compile_data); + } for (i = 0; i < brw->state.nr_color_regions; i++) intel_region_release(&brw->state.color_regions[i]); diff --git a/src/mesa/drivers/dri/i965/brw_wm.c b/src/mesa/drivers/dri/i965/brw_wm.c index 77e3b2c32a..6895f64410 100644 --- a/src/mesa/drivers/dri/i965/brw_wm.c +++ b/src/mesa/drivers/dri/i965/brw_wm.c @@ -157,7 +157,6 @@ static void do_wm_prog( struct brw_context *brw, sizeof(*c->prog_instructions)); c->vreg = _mesa_calloc(BRW_WM_MAX_VREG * sizeof(*c->vreg)); c->refs = _mesa_calloc(BRW_WM_MAX_REF * sizeof(*c->refs)); - c->vreg = _mesa_calloc(BRW_WM_MAX_VREG * sizeof(*c->vreg)); } else { void *instruction = c->instruction; void *prog_instructions = c->prog_instructions; -- cgit v1.2.3 From c367f4d46ee70c1d5879031235824e59e13f6677 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Sat, 21 Nov 2009 04:22:50 -0800 Subject: mesa: handle different RowStride in _mesa_get_compressed_teximage drivers storing compressed textures with non-native stride but relying on _mesa_get_compressed_teximage for GetCompressedTexImage otherwise won't work correctly (for instance i965 compressed mipmaps). --- src/mesa/main/texgetimage.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index 2f88718933..008407210d 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -521,10 +521,11 @@ _mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_object *texObj, struct gl_texture_image *texImage) { - const GLuint size = _mesa_format_image_size(texImage->TexFormat, - texImage->Width, - texImage->Height, - texImage->Depth); + const GLuint row_stride = _mesa_format_row_stride(texImage->TexFormat, + texImage->Width); + const GLuint row_stride_stored = _mesa_format_row_stride(texImage->TexFormat, + texImage->RowStride); + GLuint i; if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { /* pack texture image into a PBO */ @@ -540,8 +541,22 @@ _mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level, img = ADD_POINTERS(buf, img); } - /* just memcpy, no pixelstore or pixel transfer */ - _mesa_memcpy(img, texImage->Data, size); + /* no pixelstore or pixel transfer, but respect stride */ + + if (row_stride == row_stride_stored) { + const GLuint size = _mesa_format_image_size(texImage->TexFormat, + texImage->Width, + texImage->Height, + texImage->Depth); + _mesa_memcpy(img, texImage->Data, size); + } + else { + GLuint bw, bh; + _mesa_get_format_block_size(texImage->TexFormat, &bw, &bh); + for (i = 0; i < (texImage->Height + bh - 1) / bh; i++) { + memcpy(img + i * row_stride, texImage->Data + i * row_stride_stored, row_stride); + } + } if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { ctx->Driver.UnmapBuffer(ctx, GL_PIXEL_PACK_BUFFER_EXT, -- cgit v1.2.3 From 465fee75ee8991349da742e5a1a5be3cd179bb62 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Sat, 21 Nov 2009 04:39:30 -0800 Subject: intel: make CopyTex[Sub]Image fallback debug messages more consistent --- src/mesa/drivers/dri/intel/intel_tex_copy.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex_copy.c b/src/mesa/drivers/dri/intel/intel_tex_copy.c index 4b5fe7be9f..767d04d2f4 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_copy.c +++ b/src/mesa/drivers/dri/intel/intel_tex_copy.c @@ -221,6 +221,8 @@ intelCopyTexImage1D(GLcontext * ctx, GLenum target, GLint level, return; fail: + if (INTEL_DEBUG & DEBUG_FALLBACKS) + fprintf(stderr, "%s - fallback to swrast\n", __FUNCTION__); _mesa_meta_CopyTexImage1D(ctx, target, level, internalFormat, x, y, width, border); } @@ -268,6 +270,8 @@ intelCopyTexImage2D(GLcontext * ctx, GLenum target, GLint level, return; fail: + if (INTEL_DEBUG & DEBUG_FALLBACKS) + fprintf(stderr, "%s - fallback to swrast\n", __FUNCTION__); _mesa_meta_CopyTexImage2D(ctx, target, level, internalFormat, x, y, width, height, border); } @@ -292,6 +296,8 @@ intelCopyTexSubImage1D(GLcontext * ctx, GLenum target, GLint level, if (!do_copy_texsubimage(intel_context(ctx), target, intel_texture_image(texImage), internalFormat, xoffset, 0, x, y, width, 1)) { + if (INTEL_DEBUG & DEBUG_FALLBACKS) + fprintf(stderr, "%s - fallback to swrast\n", __FUNCTION__); _mesa_meta_CopyTexSubImage1D(ctx, target, level, xoffset, x, y, width); } } @@ -317,8 +323,8 @@ intelCopyTexSubImage2D(GLcontext * ctx, GLenum target, GLint level, internalFormat, xoffset, yoffset, x, y, width, height)) { - DBG("%s - fallback to _mesa_meta_CopyTexSubImage2D\n", __FUNCTION__); - + if (INTEL_DEBUG & DEBUG_FALLBACKS) + fprintf(stderr, "%s - fallback to swrast\n", __FUNCTION__); _mesa_meta_CopyTexSubImage2D(ctx, target, level, xoffset, yoffset, x, y, width, height); } -- cgit v1.2.3 From 1d1f81af93058541992bd0795b86500509edea56 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 21 Nov 2009 15:56:02 +0100 Subject: radeon: fix glCompressedTexSubImage --- src/mesa/drivers/dri/radeon/radeon_texture.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 6f11f1fa4a..1ee9e2792a 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -582,12 +582,12 @@ static void radeon_store_teximage(GLcontext* ctx, int dims, /* TODO */ assert(0); } else { - dstRowStride = _mesa_format_row_stride(texImage->TexFormat, width); + dstRowStride = _mesa_format_row_stride(texImage->TexFormat, texImage->Width); } if (dims == 3) { unsigned alignedWidth = dstRowStride/_mesa_get_format_bytes(texImage->TexFormat); - dstImageOffsets = allocate_image_offsets(ctx, alignedWidth, height, depth); + dstImageOffsets = allocate_image_offsets(ctx, alignedWidth, texImage->Height, texImage->Depth); if (!dstImageOffsets) { return; } @@ -598,8 +598,11 @@ static void radeon_store_teximage(GLcontext* ctx, int dims, radeon_teximage_map(image, GL_TRUE); if (compressed) { - uint32_t srcRowStride, bytesPerRow, rows; + uint32_t srcRowStride, bytesPerRow, rows, block_width, block_height; GLubyte *img_start; + + _mesa_get_format_block_size(texImage->TexFormat, &block_width, &block_height); + if (!image->mt) { dstRowStride = _mesa_format_row_stride(texImage->TexFormat, texImage->Width); img_start = _mesa_compressed_image_address(xoffset, yoffset, 0, @@ -607,17 +610,16 @@ static void radeon_store_teximage(GLcontext* ctx, int dims, texImage->Width, texImage->Data); } else { - uint32_t blocks_x, block_width, block_height; - _mesa_get_format_block_size(image->mt->mesaFormat, &block_width, &block_height); - blocks_x = dstRowStride / block_width; - img_start = texImage->Data + _mesa_get_format_bytes(image->mt->mesaFormat) * 4 * (blocks_x * (yoffset / 4) + xoffset / 4); + uint32_t offset; + offset = dstRowStride / _mesa_get_format_bytes(texImage->TexFormat) * yoffset / block_height + xoffset / block_width; + offset *= _mesa_get_format_bytes(texImage->TexFormat); + img_start = texImage->Data + offset; } srcRowStride = _mesa_format_row_stride(texImage->TexFormat, width); bytesPerRow = srcRowStride; - rows = (height + 3) / 4; - - copy_rows(img_start, dstRowStride, pixels, srcRowStride, rows, bytesPerRow); + rows = (height + block_height - 1) / block_height; + copy_rows(img_start, dstRowStride, pixels, srcRowStride, rows, bytesPerRow); } else { if (!_mesa_texstore(ctx, dims, texImage->_BaseFormat, -- cgit v1.2.3 From 563fe6e8f6c021ea45120cb1f201a1950b8d6057 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 21 Nov 2009 15:56:23 +0100 Subject: radeon: fix compressed mipmapped textures Tested on r300 only, other cards may require adjusting texture_compressed_row_align. --- .../drivers/dri/radeon/radeon_common_context.c | 2 +- src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c | 49 ++++++++++++---------- 2 files changed, 29 insertions(+), 22 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.c b/src/mesa/drivers/dri/radeon/radeon_common_context.c index 2a38c4599c..71f70d724b 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.c @@ -262,7 +262,7 @@ GLboolean radeonInitContext(radeonContextPtr radeon, else radeon->texture_row_align = 32; radeon->texture_rect_row_align = 64; - radeon->texture_compressed_row_align = 64; + radeon->texture_compressed_row_align = 32; } radeon_init_dma(radeon); diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c index 0497fa7db5..a11b5b9979 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c @@ -37,26 +37,35 @@ #include "main/texobj.h" #include "radeon_texture.h" -static GLuint radeon_compressed_texture_size(GLcontext *ctx, - GLsizei width, GLsizei height, GLsizei depth, - gl_format mesaFormat) +static unsigned get_aligned_compressed_row_stride( + gl_format format, + unsigned width, + unsigned minStride) { - GLuint size = _mesa_format_image_size(mesaFormat, width, height, depth); - - if (mesaFormat == MESA_FORMAT_RGB_DXT1 || - mesaFormat == MESA_FORMAT_RGBA_DXT1) { - if (width + 3 < 8) /* width one block */ - size = size * 4; - else if (width + 3 < 16) - size = size * 2; - } else { - /* DXT3/5, 16 bytes per block */ - // WARN_ONCE("DXT 3/5 suffers from multitexturing problems!\n"); - if (width + 3 < 8) - size = size * 2; + const unsigned blockSize = _mesa_get_format_bytes(format); + unsigned blockWidth, blockHeight, numXBlocks; + + _mesa_get_format_block_size(format, &blockWidth, &blockHeight); + numXBlocks = (width + blockWidth - 1) / blockWidth; + + while (numXBlocks * blockSize < minStride) + { + ++numXBlocks; } - return size; + return numXBlocks * blockSize; +} + +static unsigned get_compressed_image_size( + gl_format format, + unsigned rowStride, + unsigned height) +{ + unsigned blockWidth, blockHeight; + + _mesa_get_format_block_size(format, &blockWidth, &blockHeight); + + return rowStride * ((height + blockHeight - 1) / blockHeight); } /** @@ -74,10 +83,8 @@ static void compute_tex_image_offset(radeonContextPtr rmesa, radeon_mipmap_tree /* Find image size in bytes */ if (_mesa_is_format_compressed(mt->mesaFormat)) { - /* TODO: Is this correct? Need test cases for compressed textures! */ - row_align = rmesa->texture_compressed_row_align - 1; - lvl->rowstride = (_mesa_format_row_stride(mt->mesaFormat, lvl->width) + row_align) & ~row_align; - lvl->size = radeon_compressed_texture_size(rmesa->glCtx, lvl->width, lvl->height, lvl->depth, mt->mesaFormat); + lvl->rowstride = get_aligned_compressed_row_stride(mt->mesaFormat, lvl->width, rmesa->texture_compressed_row_align); + lvl->size = get_compressed_image_size(mt->mesaFormat, lvl->rowstride, lvl->height); } else if (mt->target == GL_TEXTURE_RECTANGLE_NV) { row_align = rmesa->texture_rect_row_align - 1; lvl->rowstride = (_mesa_format_row_stride(mt->mesaFormat, lvl->width) + row_align) & ~row_align; -- cgit v1.2.3 From dfe440c856826450195e3fc5100a3b97d7c0b173 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sun, 22 Nov 2009 14:13:18 +0100 Subject: r300: fix SIN/COS/SCS instructions for R300 fp --- src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c b/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c index 0326d25233..ced66af1eb 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program_alu.c @@ -560,23 +560,23 @@ static void sincos_constants(struct radeon_compiler* c, unsigned int *constants) * MAD dest, tmp.y, weight, tmp.x */ static void sin_approx( - struct radeon_compiler* c, struct rc_instruction * before, + struct radeon_compiler* c, struct rc_instruction * inst, struct rc_dst_register dst, struct rc_src_register src, const unsigned int* constants) { unsigned int tempreg = rc_find_free_temporary(c); - emit2(c, before, RC_OPCODE_MUL, 0, dstregtmpmask(tempreg, RC_MASK_XY), + emit2(c, inst->Prev, RC_OPCODE_MUL, 0, dstregtmpmask(tempreg, RC_MASK_XY), swizzle(src, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X), srcreg(RC_FILE_CONSTANT, constants[0])); - emit3(c, before, RC_OPCODE_MAD, 0, dstregtmpmask(tempreg, RC_MASK_X), + emit3(c, inst->Prev, RC_OPCODE_MAD, 0, dstregtmpmask(tempreg, RC_MASK_X), swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_Y, RC_SWIZZLE_Y, RC_SWIZZLE_Y, RC_SWIZZLE_Y), absolute(swizzle(src, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X)), swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X)); - emit3(c, before, RC_OPCODE_MAD, 0, dstregtmpmask(tempreg, RC_MASK_Y), + emit3(c, inst->Prev, RC_OPCODE_MAD, 0, dstregtmpmask(tempreg, RC_MASK_Y), swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X), absolute(swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X)), negate(swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X))); - emit3(c, before, RC_OPCODE_MAD, 0, dst, + emit3(c, inst->Prev, RC_OPCODE_MAD, 0, dst, swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_Y, RC_SWIZZLE_Y, RC_SWIZZLE_Y, RC_SWIZZLE_Y), swizzle(srcreg(RC_FILE_CONSTANT, constants[0]), RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W, RC_SWIZZLE_W), swizzle(srcreg(RC_FILE_TEMPORARY, tempreg), RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X, RC_SWIZZLE_X)); -- cgit v1.2.3 From e0fda040135490fdd54e57000c7995e27dc70657 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sun, 22 Nov 2009 15:08:46 +0100 Subject: r300: fix VP source conflict resolution on 64-bit machines On 32bit machines we were lucky because the sizeof(reg) == sizeof(rc_src_register). On 64bit machines pointers are 8 bytes long, so we were overwriting other data. --- src/mesa/drivers/dri/r300/compiler/radeon_program.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/compiler/radeon_program.h b/src/mesa/drivers/dri/r300/compiler/radeon_program.h index 33db3ea0ff..03592884eb 100644 --- a/src/mesa/drivers/dri/r300/compiler/radeon_program.h +++ b/src/mesa/drivers/dri/r300/compiler/radeon_program.h @@ -191,7 +191,7 @@ struct rc_src_register lmul_swizzle(unsigned int swizzle, struct rc_src_register static inline void reset_srcreg(struct rc_src_register* reg) { - memset(reg, 0, sizeof(reg)); + memset(reg, 0, sizeof(struct rc_src_register)); reg->Swizzle = RC_SWIZZLE_XYZW; } -- cgit v1.2.3 From a02938a8421270389178d4969a5411a1691d929a Mon Sep 17 00:00:00 2001 From: Richard Li Date: Fri, 20 Nov 2009 16:36:55 -0500 Subject: r600 : use cf for all pop now, left optimization for future. --- src/mesa/drivers/dri/r600/r700_assembler.c | 56 ++++++++++++++++++++++-------- src/mesa/drivers/dri/r600/r700_assembler.h | 2 +- 2 files changed, 42 insertions(+), 16 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index e3bc46802f..27083a895c 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -39,7 +39,7 @@ #include "r700_assembler.h" #define USE_CF_FOR_CONTINUE_BREAK 1 -//#define USE_CF_FOR_POP_AFTER 1 +#define USE_CF_FOR_POP_AFTER 1 BITS addrmode_PVSDST(PVSDST * pPVSDST) { @@ -3022,7 +3022,6 @@ GLboolean next_ins2(r700_AssemblerBase *pAsm) pAsm->is_tex = GL_FALSE; pAsm->need_tex_barrier = GL_FALSE; - //richard nov.16 glsl pAsm->D2.bits = 0; return GL_TRUE; @@ -5377,32 +5376,35 @@ GLboolean assemble_ENDLOOP(r700_AssemblerBase *pAsm) return GL_FALSE; } - unsigned int unFCSP = 0; + GLuint unFCSP; + GLuint unIF = 0; if((pAsm->unCFflags & HAS_CURRENT_LOOPRET) > 0) { for(unFCSP=(pAsm->FCSP-1); unFCSP>pAsm->CALLSTACK[pAsm->CALLSP].FCSP_BeforeEntry; unFCSP--) { if(FC_LOOP == pAsm->fc_stack[unFCSP].type) { + breakLoopOnFlag(pAsm, unFCSP); break; } + else if(FC_IF == pAsm->fc_stack[unFCSP].type) + { + unIF++; + } } if(unFCSP <= pAsm->CALLSTACK[pAsm->CALLSP].FCSP_BeforeEntry) { - unFCSP = 0; - - returnOnFlag(pAsm); +#ifdef USE_CF_FOR_POP_AFTER + returnOnFlag(pAsm, unIF); +#else + returnOnFlag(pAsm, 0); +#endif /* USE_CF_FOR_POP_AFTER */ pAsm->unCFflags &= ~HAS_CURRENT_LOOPRET; } } pAsm->branch_depth--; pAsm->FCSP--; - - if(unFCSP > 0) - { - breakLoopOnFlag(pAsm, unFCSP); - } return GL_TRUE; } @@ -5459,25 +5461,38 @@ GLboolean assemble_BGNSUB(r700_AssemblerBase *pAsm, GLint nILindex) /* start sub */ pAsm->alu_x_opcode = SQ_CF_INST_ALU; + pAsm->FCSP++; + pAsm->fc_stack[pAsm->FCSP].type = FC_REP; + return GL_TRUE; } GLboolean assemble_ENDSUB(r700_AssemblerBase *pAsm) { + if(pAsm->fc_stack[pAsm->FCSP].type != FC_REP) + { + radeon_error("BGNSUB/ENDSUB in shader code are not paired. \n"); + return GL_FALSE; + } + pAsm->CALLSP--; SetActiveCFlist(pAsm->pR700Shader, pAsm->CALLSTACK[pAsm->CALLSP].plstCFInstructions_local); pAsm->alu_x_opcode = SQ_CF_INST_ALU; + pAsm->FCSP--; + return GL_TRUE; } GLboolean assemble_RET(r700_AssemblerBase *pAsm) { + GLuint unIF = 0; + if(pAsm->CALLSP > 0) { /* in sub */ - unsigned int unFCSP; + GLuint unFCSP; for(unFCSP=pAsm->FCSP; unFCSP>pAsm->CALLSTACK[pAsm->CALLSP].FCSP_BeforeEntry; unFCSP--) { if(FC_LOOP == pAsm->fc_stack[unFCSP].type) @@ -5488,9 +5503,20 @@ GLboolean assemble_RET(r700_AssemblerBase *pAsm) return GL_TRUE; } + else if(FC_IF == pAsm->fc_stack[unFCSP].type) + { + unIF++; + } } } - + +#ifdef USE_CF_FOR_POP_AFTER + if(unIF > 0) + { + pops(pAsm, unIF); + } +#endif /* USE_CF_FOR_POP_AFTER */ + add_return_inst(pAsm); return GL_TRUE; @@ -5664,12 +5690,12 @@ GLboolean testFlag(r700_AssemblerBase *pAsm) return GL_TRUE; } -GLboolean returnOnFlag(r700_AssemblerBase *pAsm) +GLboolean returnOnFlag(r700_AssemblerBase *pAsm, GLuint unIF) { testFlag(pAsm); jumpToOffest(pAsm, 1, 4); setRetInLoopFlag(pAsm, SQ_SEL_0); - pops(pAsm, 1); + pops(pAsm, unIF + 1); add_return_inst(pAsm); return GL_TRUE; diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index 516923f67c..ca562d29f1 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -553,7 +553,7 @@ GLboolean jumpToOffest(r700_AssemblerBase *pAsm, GLuint pops, GLint offset); GLboolean setRetInLoopFlag(r700_AssemblerBase *pAsm, GLuint flagValue); GLboolean testFlag(r700_AssemblerBase *pAsm); GLboolean breakLoopOnFlag(r700_AssemblerBase *pAsm, GLuint unFCSP); -GLboolean returnOnFlag(r700_AssemblerBase *pAsm); +GLboolean returnOnFlag(r700_AssemblerBase *pAsm, GLuint unIF); GLboolean assemble_math_function(r700_AssemblerBase* pAsm, BITS opcode); GLboolean assemble_ABS(r700_AssemblerBase *pAsm); -- cgit v1.2.3 From 1f8c23d9db84178f5b129dcd5f6dbae4a31f796a Mon Sep 17 00:00:00 2001 From: Richard Li Date: Sun, 22 Nov 2009 12:58:28 -0500 Subject: r600 : add stack depth calculation, enable CF pop. --- src/mesa/drivers/dri/r600/r700_assembler.c | 341 ++++++++++++++++++----------- src/mesa/drivers/dri/r600/r700_assembler.h | 41 ++-- src/mesa/drivers/dri/r600/r700_shader.c | 2 +- 3 files changed, 223 insertions(+), 161 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 27083a895c..16cdb741ae 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -388,99 +388,94 @@ int Init_r700_AssemblerBase(SHADER_PIPE_TYPE spt, r700_AssemblerBase* pAsm, R700 pAsm->pR700Shader = pShader; pAsm->currentShaderType = spt; - pAsm->cf_last_export_ptr = NULL; + pAsm->cf_last_export_ptr = NULL; - pAsm->cf_current_export_clause_ptr = NULL; - pAsm->cf_current_alu_clause_ptr = NULL; - pAsm->cf_current_tex_clause_ptr = NULL; - pAsm->cf_current_vtx_clause_ptr = NULL; - pAsm->cf_current_cf_clause_ptr = NULL; + pAsm->cf_current_export_clause_ptr = NULL; + pAsm->cf_current_alu_clause_ptr = NULL; + pAsm->cf_current_tex_clause_ptr = NULL; + pAsm->cf_current_vtx_clause_ptr = NULL; + pAsm->cf_current_cf_clause_ptr = NULL; - // No clause has been created yet - pAsm->cf_current_clause_type = CF_EMPTY_CLAUSE; + // No clause has been created yet + pAsm->cf_current_clause_type = CF_EMPTY_CLAUSE; - pAsm->number_of_colorandz_exports = 0; - pAsm->number_of_exports = 0; - pAsm->number_of_export_opcodes = 0; + pAsm->number_of_colorandz_exports = 0; + pAsm->number_of_exports = 0; + pAsm->number_of_export_opcodes = 0; pAsm->alu_x_opcode = 0; pAsm->D2.bits = 0; - pAsm->D.bits = 0; - pAsm->S[0].bits = 0; - pAsm->S[1].bits = 0; - pAsm->S[2].bits = 0; + pAsm->D.bits = 0; + pAsm->S[0].bits = 0; + pAsm->S[1].bits = 0; + pAsm->S[2].bits = 0; - pAsm->uLastPosUpdate = 0; + pAsm->uLastPosUpdate = 0; - *(BITS *) &pAsm->fp_stOutFmt0 = 0; - - pAsm->uIIns = 0; - pAsm->uOIns = 0; - pAsm->number_used_registers = 0; - pAsm->uUsedConsts = 256; - + *(BITS *) &pAsm->fp_stOutFmt0 = 0; - // Fragment programs - pAsm->uBoolConsts = 0; - pAsm->uIntConsts = 0; - pAsm->uInsts = 0; - pAsm->uConsts = 0; + pAsm->uIIns = 0; + pAsm->uOIns = 0; + pAsm->number_used_registers = 0; + pAsm->uUsedConsts = 256; - pAsm->FCSP = 0; - pAsm->fc_stack[0].type = FC_NONE; - pAsm->branch_depth = 0; - pAsm->max_branch_depth = 0; + // Fragment programs + pAsm->uBoolConsts = 0; + pAsm->uIntConsts = 0; + pAsm->uInsts = 0; + pAsm->uConsts = 0; - pAsm->aArgSubst[0] = - pAsm->aArgSubst[1] = - pAsm->aArgSubst[2] = - pAsm->aArgSubst[3] = (-1); + pAsm->FCSP = 0; + pAsm->fc_stack[0].type = FC_NONE; - pAsm->uOutputs = 0; - - for (i=0; icolor_export_register_number[i] = (-1); - } + pAsm->aArgSubst[0] = + pAsm->aArgSubst[1] = + pAsm->aArgSubst[2] = + pAsm->aArgSubst[3] = (-1); + pAsm->uOutputs = 0; - pAsm->depth_export_register_number = (-1); - pAsm->stencil_export_register_number = (-1); - pAsm->coverage_to_mask_export_register_number = (-1); - pAsm->mask_export_register_number = (-1); + for (i=0; icolor_export_register_number[i] = (-1); + } - pAsm->starting_export_register_number = 0; - pAsm->starting_vfetch_register_number = 0; - pAsm->starting_temp_register_number = 0; - pAsm->uFirstHelpReg = 0; + pAsm->depth_export_register_number = (-1); + pAsm->stencil_export_register_number = (-1); + pAsm->coverage_to_mask_export_register_number = (-1); + pAsm->mask_export_register_number = (-1); - pAsm->input_position_is_used = GL_FALSE; - pAsm->input_normal_is_used = GL_FALSE; + pAsm->starting_export_register_number = 0; + pAsm->starting_vfetch_register_number = 0; + pAsm->starting_temp_register_number = 0; + pAsm->uFirstHelpReg = 0; + pAsm->input_position_is_used = GL_FALSE; + pAsm->input_normal_is_used = GL_FALSE; - for (i=0; iinput_color_is_used[ i ] = GL_FALSE; - } + for (i=0; iinput_color_is_used[ i ] = GL_FALSE; + } - for (i=0; iinput_texture_unit_is_used[ i ] = GL_FALSE; - } + for (i=0; iinput_texture_unit_is_used[ i ] = GL_FALSE; + } - for (i=0; ivfetch_instruction_ptr_array[ i ] = NULL; - } + for (i=0; ivfetch_instruction_ptr_array[ i ] = NULL; + } - pAsm->number_of_inputs = 0; + pAsm->number_of_inputs = 0; - pAsm->is_tex = GL_FALSE; - pAsm->need_tex_barrier = GL_FALSE; + pAsm->is_tex = GL_FALSE; + pAsm->need_tex_barrier = GL_FALSE; pAsm->subs = NULL; pAsm->unSubArraySize = 0; @@ -494,13 +489,14 @@ int Init_r700_AssemblerBase(SHADER_PIPE_TYPE spt, r700_AssemblerBase* pAsm, R700 pAsm->CALLSTACK[0].plstCFInstructions_local = &(pAsm->pR700Shader->lstCFInstructions); - pAsm->CALLSTACK[0].stackUsage.bits = 0; + pAsm->CALLSTACK[0].max = 0; + pAsm->CALLSTACK[0].current = 0; SetActiveCFlist(pAsm->pR700Shader, pAsm->CALLSTACK[0].plstCFInstructions_local); pAsm->unCFflags = 0; - return 0; + return 0; } GLboolean IsTex(gl_inst_opcode Opcode) @@ -4980,32 +4976,74 @@ GLboolean assemble_EXPORT(r700_AssemblerBase *pAsm) return GL_TRUE; } -inline void checkStackDepth(r700_AssemblerBase *pAsm, GLuint uReason) +inline void decreaseCurrent(r700_AssemblerBase *pAsm, GLuint uReason) +{ + switch (uReason) + { + case FC_PUSH_VPM: + pAsm->CALLSTACK[pAsm->CALLSP].current--; + break; + case FC_PUSH_WQM: + pAsm->CALLSTACK[pAsm->CALLSP].current -= 4; + break; + case FC_LOOP: + pAsm->CALLSTACK[pAsm->CALLSP].current -= 4; + break; + case FC_REP: + /* TODO : for 16 vp asic, should -= 2; */ + pAsm->CALLSTACK[pAsm->CALLSP].current -= 1; + break; + }; +} + +inline void checkStackDepth(r700_AssemblerBase *pAsm, GLuint uReason, GLboolean bCheckMaxOnly) { + if(GL_TRUE == bCheckMaxOnly) + { + switch (uReason) + { + case FC_PUSH_VPM: + if((pAsm->CALLSTACK[pAsm->CALLSP].current + 1) + > pAsm->CALLSTACK[pAsm->CALLSP].max) + { + pAsm->CALLSTACK[pAsm->CALLSP].max = + pAsm->CALLSTACK[pAsm->CALLSP].current + 1; + } + break; + case FC_PUSH_WQM: + if((pAsm->CALLSTACK[pAsm->CALLSP].current + 4) + > pAsm->CALLSTACK[pAsm->CALLSP].max) + { + pAsm->CALLSTACK[pAsm->CALLSP].max = + pAsm->CALLSTACK[pAsm->CALLSP].current + 4; + } + break; + } + return; + } + switch (uReason) { case FC_PUSH_VPM: - pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.pushs++; - pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.current++; + pAsm->CALLSTACK[pAsm->CALLSP].current++; break; case FC_PUSH_WQM: - pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.pushs++; - pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.current += 4; + pAsm->CALLSTACK[pAsm->CALLSP].current += 4; break; case FC_LOOP: - pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.pushs += 4; + pAsm->CALLSTACK[pAsm->CALLSP].current += 4; break; case FC_REP: /* TODO : for 16 vp asic, should += 2; */ - pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.pushs += 1; + pAsm->CALLSTACK[pAsm->CALLSP].current += 1; break; }; - if(pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.pushs - > pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.max) + if(pAsm->CALLSTACK[pAsm->CALLSP].current + > pAsm->CALLSTACK[pAsm->CALLSP].max) { - pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.max = - pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.su.pushs; + pAsm->CALLSTACK[pAsm->CALLSP].max = + pAsm->CALLSTACK[pAsm->CALLSP].current; } } @@ -5082,7 +5120,6 @@ GLboolean assemble_IF(r700_AssemblerBase *pAsm, GLboolean bHasElse) pAsm->FCSP++; pAsm->fc_stack[pAsm->FCSP].type = FC_IF; - pAsm->fc_stack[pAsm->FCSP].bpush = 0; pAsm->fc_stack[pAsm->FCSP].mid = NULL; pAsm->fc_stack[pAsm->FCSP].midLen= 0; pAsm->fc_stack[pAsm->FCSP].first = pAsm->cf_current_cf_clause_ptr; @@ -5094,12 +5131,8 @@ GLboolean assemble_IF(r700_AssemblerBase *pAsm, GLboolean bHasElse) } #endif /* USE_CF_FOR_POP_AFTER */ - pAsm->branch_depth++; + checkStackDepth(pAsm, FC_PUSH_VPM, GL_FALSE); - if(pAsm->branch_depth > pAsm->max_branch_depth) - { - pAsm->max_branch_depth = pAsm->branch_depth; - } return GL_TRUE; } @@ -5164,9 +5197,11 @@ GLboolean assemble_ENDIF(r700_AssemblerBase *pAsm) radeon_error("if/endif in shader code are not paired. \n"); return GL_FALSE; } - pAsm->branch_depth--; + pAsm->FCSP--; + decreaseCurrent(pAsm, FC_PUSH_VPM); + return GL_TRUE; } @@ -5191,18 +5226,13 @@ GLboolean assemble_BGNLOOP(r700_AssemblerBase *pAsm) pAsm->FCSP++; pAsm->fc_stack[pAsm->FCSP].type = FC_LOOP; - pAsm->fc_stack[pAsm->FCSP].bpush = 1; pAsm->fc_stack[pAsm->FCSP].mid = NULL; pAsm->fc_stack[pAsm->FCSP].unNumMid = 0; pAsm->fc_stack[pAsm->FCSP].midLen = 0; pAsm->fc_stack[pAsm->FCSP].first = pAsm->cf_current_cf_clause_ptr; - pAsm->branch_depth++; + checkStackDepth(pAsm, FC_LOOP, GL_FALSE); - if(pAsm->branch_depth > pAsm->max_branch_depth) - { - pAsm->max_branch_depth = pAsm->branch_depth; - } return GL_TRUE; } @@ -5266,6 +5296,8 @@ GLboolean assemble_BRK(r700_AssemblerBase *pAsm) pAsm->cf_current_cf_clause_ptr->m_Word1.f.barrier = 0x1; pAsm->cf_current_cf_clause_ptr->m_Word0.f.addr = pAsm->cf_current_cf_clause_ptr->m_uIndex + 1; + checkStackDepth(pAsm, FC_PUSH_VPM, GL_TRUE); + #endif //USE_CF_FOR_CONTINUE_BREAK return GL_TRUE; } @@ -5330,6 +5362,8 @@ GLboolean assemble_CONT(r700_AssemblerBase *pAsm) pAsm->cf_current_cf_clause_ptr->m_Word1.f.barrier = 0x1; pAsm->cf_current_cf_clause_ptr->m_Word0.f.addr = pAsm->cf_current_cf_clause_ptr->m_uIndex + 1; + checkStackDepth(pAsm, FC_PUSH_VPM, GL_TRUE); + #endif /* USE_CF_FOR_CONTINUE_BREAK */ return GL_TRUE; @@ -5403,8 +5437,9 @@ GLboolean assemble_ENDLOOP(r700_AssemblerBase *pAsm) } } - pAsm->branch_depth--; pAsm->FCSP--; + + decreaseCurrent(pAsm, FC_LOOP); return GL_TRUE; } @@ -5445,14 +5480,16 @@ GLboolean assemble_BGNSUB(r700_AssemblerBase *pAsm, GLint nILindex) pAsm->subs[pAsm->unSubArrayPointer].subIL_Offset = nILindex; pAsm->subs[pAsm->unSubArrayPointer].lstCFInstructions_local.pHead=NULL; - pAsm->subs[pAsm->unSubArrayPointer].lstCFInstructions_local.pTail=NULL; - pAsm->subs[pAsm->unSubArrayPointer].lstCFInstructions_local.uNumOfNode=0; + pAsm->subs[pAsm->unSubArrayPointer].lstCFInstructions_local.pTail=NULL; + pAsm->subs[pAsm->unSubArrayPointer].lstCFInstructions_local.uNumOfNode=0; pAsm->CALLSP++; + pAsm->CALLSTACK[pAsm->CALLSP].subDescIndex = pAsm->unSubArrayPointer; pAsm->CALLSTACK[pAsm->CALLSP].FCSP_BeforeEntry = pAsm->FCSP; pAsm->CALLSTACK[pAsm->CALLSP].plstCFInstructions_local = &(pAsm->subs[pAsm->unSubArrayPointer].lstCFInstructions_local); - pAsm->CALLSTACK[pAsm->CALLSP].stackUsage.bits = 0; + pAsm->CALLSTACK[pAsm->CALLSP].max = 0; + pAsm->CALLSTACK[pAsm->CALLSP].current = 0; SetActiveCFlist(pAsm->pR700Shader, pAsm->CALLSTACK[pAsm->CALLSP].plstCFInstructions_local); @@ -5462,7 +5499,9 @@ GLboolean assemble_BGNSUB(r700_AssemblerBase *pAsm, GLint nILindex) pAsm->alu_x_opcode = SQ_CF_INST_ALU; pAsm->FCSP++; - pAsm->fc_stack[pAsm->FCSP].type = FC_REP; + pAsm->fc_stack[pAsm->FCSP].type = FC_REP; + + checkStackDepth(pAsm, FC_REP, GL_FALSE); return GL_TRUE; } @@ -5475,6 +5514,12 @@ GLboolean assemble_ENDSUB(r700_AssemblerBase *pAsm) return GL_FALSE; } + /* copy max to sub structure */ + pAsm->subs[pAsm->CALLSTACK[pAsm->CALLSP].subDescIndex].unStackDepthMax + = pAsm->CALLSTACK[pAsm->CALLSP].max; + + decreaseCurrent(pAsm, FC_REP); + pAsm->CALLSP--; SetActiveCFlist(pAsm->pR700Shader, pAsm->CALLSTACK[pAsm->CALLSP].plstCFInstructions_local); @@ -5565,18 +5610,42 @@ GLboolean assemble_CAL(r700_AssemblerBase *pAsm, pAsm->unCallerArrayPointer++; int j; + GLuint max; + GLuint unSubID; + GLboolean bRet; for(j=0; junSubArrayPointer; j++) { if(nILindex == pAsm->subs[j].subIL_Offset) { /* compiled before */ + + max = pAsm->subs[j].unStackDepthMax + + pAsm->CALLSTACK[pAsm->CALLSP].current; + if(max > pAsm->CALLSTACK[pAsm->CALLSP].max) + { + pAsm->CALLSTACK[pAsm->CALLSP].max = max; + } + pAsm->callers[pAsm->unCallerArrayPointer - 1].subDescIndex = j; return GL_TRUE; } } pAsm->callers[pAsm->unCallerArrayPointer - 1].subDescIndex = pAsm->unSubArrayPointer; + unSubID = pAsm->unSubArrayPointer; + + bRet = AssembleInstr(nILindex, uiNumberInsts, pILInst, pAsm); + + if(GL_TRUE == bRet) + { + max = pAsm->subs[unSubID].unStackDepthMax + + pAsm->CALLSTACK[pAsm->CALLSP].current; + if(max > pAsm->CALLSTACK[pAsm->CALLSP].max) + { + pAsm->CALLSTACK[pAsm->CALLSP].max = max; + } + } - return AssembleInstr(nILindex, uiNumberInsts, pILInst, pAsm); + return bRet; } GLboolean setRetInLoopFlag(r700_AssemblerBase *pAsm, GLuint flagValue) @@ -5685,7 +5754,7 @@ GLboolean testFlag(r700_AssemblerBase *pAsm) } #endif - checkStackDepth(pAsm, FC_PUSH_VPM); + checkStackDepth(pAsm, FC_PUSH_VPM, GL_TRUE); return GL_TRUE; } @@ -5704,7 +5773,7 @@ GLboolean returnOnFlag(r700_AssemblerBase *pAsm, GLuint unIF) GLboolean breakLoopOnFlag(r700_AssemblerBase *pAsm, GLuint unFCSP) { testFlag(pAsm); - + //break if(GL_FALSE == add_cf_instruction(pAsm) ) { @@ -5831,7 +5900,8 @@ GLboolean AssembleInstr(GLuint uiFirstInst, if ( GL_FALSE == assemble_FLR(pR700AsmCode) ) return GL_FALSE; break; - //case OP_FLR_INT: + //case OP_FLR_INT: ; + // if ( GL_FALSE == assemble_FLR_INT() ) // return GL_FALSE; // break; @@ -6351,11 +6421,47 @@ GLboolean RelocProgram(r700_AssemblerBase * pAsm) R700ShaderInstruction * pInst; R700ControlFlowGenericClause * pCFInst; + /* remove flags init if they are not used */ + if((pAsm->unCFflags & HAS_LOOPRET) == 0) + { + R700ControlFlowALUClause * pCF_ALU; + pInst = plstCFmain->pHead; + while(pInst) + { + if(SIT_CF_ALU == pInst->m_ShaderInstType) + { + pCF_ALU = (R700ControlFlowALUClause *)pInst; + if(1 == pCF_ALU->m_Word1.f.count) + { + pCF_ALU->m_Word1.f.cf_inst = SQ_CF_INST_NOP; + } + else + { + R700ALUInstruction * pALU = pCF_ALU->m_pLinkedALUInstruction; + + pALU->m_pLinkedALUClause = NULL; + pALU = (R700ALUInstruction *)(pALU->pNextInst); + pALU->m_pLinkedALUClause = pCF_ALU; + pCF_ALU->m_pLinkedALUInstruction = pALU; + + pCF_ALU->m_Word1.f.count--; + } + break; + } + pInst = pInst->pNextInst; + }; + } + if(0 == pAsm->unSubArrayPointer) { return GL_TRUE; } + if(pAsm->CALLSTACK[0].max > 0) + { + pAsm->pR700Shader->uStackSize = ((pAsm->CALLSTACK[0].max + 3)>>2) + 2; + } + plstCFmain = pAsm->CALLSTACK[0].plstCFInstructions_local; unCFoffset = plstCFmain->uNumOfNode; @@ -6411,37 +6517,6 @@ GLboolean RelocProgram(r700_AssemblerBase * pAsm) = pAsm->subs[pAsm->callers[i].subDescIndex].unCFoffset; } - /* remove flags init if they are not used */ - if((pAsm->unCFflags & HAS_LOOPRET) == 0) - { - R700ControlFlowALUClause * pCF_ALU; - pInst = plstCFmain->pHead; - while(pInst) - { - if(SIT_CF_ALU == pInst->m_ShaderInstType) - { - pCF_ALU = (R700ControlFlowALUClause *)pInst; - if(1 == pCF_ALU->m_Word1.f.count) - { - pCF_ALU->m_Word1.f.cf_inst = SQ_CF_INST_NOP; - } - else - { - R700ALUInstruction * pALU = pCF_ALU->m_pLinkedALUInstruction; - - pALU->m_pLinkedALUClause = NULL; - pALU = (R700ALUInstruction *)(pALU->pNextInst); - pALU->m_pLinkedALUClause = pCF_ALU; - pCF_ALU->m_pLinkedALUInstruction = pALU; - - pCF_ALU->m_Word1.f.count--; - } - break; - } - pInst = pInst->pNextInst; - }; - } - return GL_TRUE; } diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index ca562d29f1..7efb346fa7 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -273,27 +273,27 @@ enum typedef struct FC_LEVEL { - R700ControlFlowGenericClause * first; + R700ControlFlowGenericClause * first; R700ControlFlowGenericClause ** mid; unsigned int unNumMid; - unsigned int midLen; - unsigned int type; - unsigned int cond; - unsigned int inv; - unsigned int bpush; ///< 1 if first instruction does branch stack push - int id; ///< id of bool or int variable + unsigned int midLen; + unsigned int type; + unsigned int cond; + unsigned int inv; + int id; ///< id of bool or int variable } FC_LEVEL; typedef struct VTX_FETCH_METHOD { - GLboolean bEnableMini; - GLuint mega_fetch_remainder; + GLboolean bEnableMini; + GLuint mega_fetch_remainder; } VTX_FETCH_METHOD; typedef struct SUB_OFFSET { GLint subIL_Offset; GLuint unCFoffset; + GLuint unStackDepthMax; TypedShaderList lstCFInstructions_local; } SUB_OFFSET; @@ -306,23 +306,12 @@ typedef struct CALLER_POINTER #define SQ_MAX_CALL_DEPTH 0x00000020 -typedef struct STACK_USAGE -{ - BITS pushs :8; - BITS current :8; - BITS max :8; -} STACK_USAGE; - -typedef union STACKDWORDtag -{ - BITS bits; - STACK_USAGE su; -} STACKDWORD; - typedef struct CALL_LEVEL { unsigned int FCSP_BeforeEntry; - STACKDWORD stackUsage; + GLint subDescIndex; + GLushort current; + GLushort max; TypedShaderList * plstCFInstructions_local; } CALL_LEVEL; @@ -386,9 +375,6 @@ typedef struct r700_AssemblerBase unsigned int FCSP; FC_LEVEL fc_stack[32]; - unsigned int branch_depth; - unsigned int max_branch_depth; - //----------------------------------------------------------------------------------- // ArgSubst used in Assemble_Source() function //----------------------------------------------------------------------------------- @@ -449,7 +435,8 @@ typedef struct r700_AssemblerBase } r700_AssemblerBase; //Internal use -inline void checkStackDepth(r700_AssemblerBase *pAsm, GLuint uReason); +inline void checkStackDepth(r700_AssemblerBase *pAsm, GLuint uReason, GLboolean bCheckMaxOnly); +inline void decreaseCurrent(r700_AssemblerBase *pAsm, GLuint uReason); BITS addrmode_PVSDST(PVSDST * pPVSDST); void setaddrmode_PVSDST(PVSDST * pPVSDST, BITS addrmode); void nomask_PVSDST(PVSDST * pPVSDST); diff --git a/src/mesa/drivers/dri/r600/r700_shader.c b/src/mesa/drivers/dri/r600/r700_shader.c index db951e48c4..2eed1acc2f 100644 --- a/src/mesa/drivers/dri/r600/r700_shader.c +++ b/src/mesa/drivers/dri/r600/r700_shader.c @@ -140,7 +140,7 @@ void Init_R700_Shader(R700_Shader * pShader) pShader->killIsUsed = GL_FALSE; pShader->uCFOffset = 0; - pShader->uStackSize = 10; //richard test + pShader->uStackSize = 0; pShader->uMaxCallDepth = 0; pShader->bSurfAllocated = GL_FALSE; -- cgit v1.2.3 From f9b0f1dfa1695db79553f67fd0c156d445062ffa Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 23 Nov 2009 06:31:29 +1000 Subject: r600: fix inline issues --- src/mesa/drivers/dri/r600/r700_assembler.c | 4 ++-- src/mesa/drivers/dri/r600/r700_assembler.h | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 16cdb741ae..c46dd757d0 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -4976,7 +4976,7 @@ GLboolean assemble_EXPORT(r700_AssemblerBase *pAsm) return GL_TRUE; } -inline void decreaseCurrent(r700_AssemblerBase *pAsm, GLuint uReason) +static inline void decreaseCurrent(r700_AssemblerBase *pAsm, GLuint uReason) { switch (uReason) { @@ -4996,7 +4996,7 @@ inline void decreaseCurrent(r700_AssemblerBase *pAsm, GLuint uReason) }; } -inline void checkStackDepth(r700_AssemblerBase *pAsm, GLuint uReason, GLboolean bCheckMaxOnly) +static inline void checkStackDepth(r700_AssemblerBase *pAsm, GLuint uReason, GLboolean bCheckMaxOnly) { if(GL_TRUE == bCheckMaxOnly) { diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index 7efb346fa7..3e4106335a 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -435,8 +435,6 @@ typedef struct r700_AssemblerBase } r700_AssemblerBase; //Internal use -inline void checkStackDepth(r700_AssemblerBase *pAsm, GLuint uReason, GLboolean bCheckMaxOnly); -inline void decreaseCurrent(r700_AssemblerBase *pAsm, GLuint uReason); BITS addrmode_PVSDST(PVSDST * pPVSDST); void setaddrmode_PVSDST(PVSDST * pPVSDST, BITS addrmode); void nomask_PVSDST(PVSDST * pPVSDST); -- cgit v1.2.3 From c3c8c40cab193e0aa0f1a42bff7b0d726df8cf9f Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 23 Nov 2009 06:44:29 +1000 Subject: r600: hopefully fix segfault. --- src/mesa/drivers/dri/r600/r700_assembler.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index c46dd757d0..702add9772 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -6421,6 +6421,8 @@ GLboolean RelocProgram(r700_AssemblerBase * pAsm) R700ShaderInstruction * pInst; R700ControlFlowGenericClause * pCFInst; + plstCFmain = pAsm->CALLSTACK[0].plstCFInstructions_local; + /* remove flags init if they are not used */ if((pAsm->unCFflags & HAS_LOOPRET) == 0) { @@ -6462,7 +6464,6 @@ GLboolean RelocProgram(r700_AssemblerBase * pAsm) pAsm->pR700Shader->uStackSize = ((pAsm->CALLSTACK[0].max + 3)>>2) + 2; } - plstCFmain = pAsm->CALLSTACK[0].plstCFInstructions_local; unCFoffset = plstCFmain->uNumOfNode; /* Reloc subs */ -- cgit v1.2.3 From a12b468d002edb6c8a7c95882edd3e5e7f615a4e Mon Sep 17 00:00:00 2001 From: Richard Li Date: Sun, 22 Nov 2009 21:31:46 -0500 Subject: r600 : add support for shader instruction trunc and discard. --- src/mesa/drivers/dri/r600/r700_assembler.c | 105 +++++++++++++++++++++-------- src/mesa/drivers/dri/r600/r700_assembler.h | 2 +- 2 files changed, 78 insertions(+), 29 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 702add9772..8e57396a0d 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -340,7 +340,10 @@ unsigned int r700GetNumOperands(r700_AssemblerBase* pAsm) switch (pAsm->D.dst.opcode) { case SQ_OP2_INST_ADD: + case SQ_OP2_INST_KILLE: case SQ_OP2_INST_KILLGT: + case SQ_OP2_INST_KILLGE: + case SQ_OP2_INST_KILLNE: case SQ_OP2_INST_MUL: case SQ_OP2_INST_MAX: case SQ_OP2_INST_MIN: @@ -363,6 +366,7 @@ unsigned int r700GetNumOperands(r700_AssemblerBase* pAsm) case SQ_OP2_INST_MOVA_FLOOR: case SQ_OP2_INST_FRACT: case SQ_OP2_INST_FLOOR: + case SQ_OP2_INST_TRUNC: case SQ_OP2_INST_EXP_IEEE: case SQ_OP2_INST_LOG_CLAMPED: case SQ_OP2_INST_LOG_IEEE: @@ -1379,19 +1383,16 @@ GLboolean tex_src(r700_AssemblerBase *pAsm) case FRAG_ATTRIB_PNTC: fprintf(stderr, "FRAG_ATTRIB_PNTC unsupported\n"); break; - case FRAG_ATTRIB_VAR0: - fprintf(stderr, "FRAG_ATTRIB_VAR0 unsupported\n"); - break; } if( (pILInst->SrcReg[0].Index >= FRAG_ATTRIB_VAR0) || - (pILInst->SrcReg[0].Index < FRAG_ATTRIB_MAX) ) - { + (pILInst->SrcReg[0].Index < FRAG_ATTRIB_MAX) ) + { bValidTexCoord = GL_TRUE; pAsm->S[0].src.reg = pAsm->uiFP_AttributeMap[pILInst->SrcReg[0].Index]; pAsm->S[0].src.rtype = SRC_REG_INPUT; - } + } break; } @@ -2469,9 +2470,9 @@ GLboolean assemble_alu_instruction2(r700_AssemblerBase *pAsm) { R700ALUInstruction* alu_instruction_ptr = (R700ALUInstruction*) CALLOC_STRUCT(R700ALUInstruction); if (alu_instruction_ptr == NULL) - { - return GL_FALSE; - } + { + return GL_FALSE; + } Init_R700ALUInstruction(alu_instruction_ptr); //src 0 @@ -3545,13 +3546,12 @@ GLboolean assemble_FRC(r700_AssemblerBase *pAsm) return GL_TRUE; } -GLboolean assemble_KIL(r700_AssemblerBase *pAsm) -{ - /* TODO: doc says KILL has to be last(end) ALU clause */ - - checkop1(pAsm); +GLboolean assemble_KIL(r700_AssemblerBase *pAsm, GLuint opcode) +{ + checkop2(pAsm); - pAsm->D.dst.opcode = SQ_OP2_INST_KILLGT; + pAsm->D.dst.opcode = opcode; + pAsm->D.dst.math = 1; setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); pAsm->D.dst.rtype = DST_REG_TEMPORARY; @@ -3561,24 +3561,24 @@ GLboolean assemble_KIL(r700_AssemblerBase *pAsm) pAsm->D.dst.writez = 0; pAsm->D.dst.writew = 0; - setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); - pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; - pAsm->S[0].src.reg = 0; - - setswizzle_PVSSRC(&(pAsm->S[0].src), SQ_SEL_0); - noneg_PVSSRC(&(pAsm->S[0].src)); + if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + { + return GL_FALSE; + } - if ( GL_FALSE == assemble_src(pAsm, 0, 1) ) + if( GL_FALSE == assemble_src(pAsm, 1, -1) ) { return GL_FALSE; } - if ( GL_FALSE == next_ins(pAsm) ) + if ( GL_FALSE == next_ins2(pAsm) ) { return GL_FALSE; } + /* Doc says KILL has to be last(end) ALU clause */ pAsm->pR700Shader->killIsUsed = GL_TRUE; + pAsm->alu_x_opcode = SQ_CF_INST_ALU; return GL_TRUE; } @@ -5018,7 +5018,7 @@ static inline void checkStackDepth(r700_AssemblerBase *pAsm, GLuint uReason, GLb pAsm->CALLSTACK[pAsm->CALLSP].current + 4; } break; - } + } return; } @@ -5102,7 +5102,7 @@ GLboolean assemble_IF(r700_AssemblerBase *pAsm, GLboolean bHasElse) if(GL_TRUE != bHasElse) { - pAsm->cf_current_cf_clause_ptr->m_Word1.f.pop_count = 1; + pAsm->cf_current_cf_clause_ptr->m_Word1.f.pop_count = 1; } else { @@ -5172,7 +5172,7 @@ GLboolean assemble_ELSE(r700_AssemblerBase *pAsm) GLboolean assemble_ENDIF(r700_AssemblerBase *pAsm) { #ifdef USE_CF_FOR_POP_AFTER - pops(pAsm, 1); + pops(pAsm, 1); #endif /* USE_CF_FOR_POP_AFTER */ pAsm->alu_x_opcode = SQ_CF_INST_ALU; @@ -5912,8 +5912,10 @@ GLboolean AssembleInstr(GLuint uiFirstInst, break; case OPCODE_KIL: - if ( GL_FALSE == assemble_KIL(pR700AsmCode) ) - return GL_FALSE; + case OPCODE_KIL_NV: + /* done at OPCODE_SE/SGT...etc. */ + /* if ( GL_FALSE == assemble_KIL(pR700AsmCode) ) + return GL_FALSE; */ break; case OPCODE_LG2: if ( GL_FALSE == assemble_LG2(pR700AsmCode) ) @@ -6008,6 +6010,13 @@ GLboolean AssembleInstr(GLuint uiFirstInst, return GL_FALSE; } } + else if((OPCODE_KIL == pILInst[i+1].Opcode)||(OPCODE_KIL_NV == pILInst[i+1].Opcode)) + { + if ( GL_FALSE == assemble_KIL(pR700AsmCode, SQ_OP2_INST_KILLE) ) + { + return GL_FALSE; + } + } else { if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETE) ) @@ -6051,6 +6060,13 @@ GLboolean AssembleInstr(GLuint uiFirstInst, return GL_FALSE; } } + else if((OPCODE_KIL == pILInst[i+1].Opcode)||(OPCODE_KIL_NV == pILInst[i+1].Opcode)) + { + if ( GL_FALSE == assemble_KIL(pR700AsmCode, SQ_OP2_INST_KILLGT) ) + { + return GL_FALSE; + } + } else { if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETGT) ) @@ -6094,6 +6110,13 @@ GLboolean AssembleInstr(GLuint uiFirstInst, return GL_FALSE; } } + else if((OPCODE_KIL == pILInst[i+1].Opcode)||(OPCODE_KIL_NV == pILInst[i+1].Opcode)) + { + if ( GL_FALSE == assemble_KIL(pR700AsmCode, SQ_OP2_INST_KILLGE) ) + { + return GL_FALSE; + } + } else { if ( GL_FALSE == assemble_SGE(pR700AsmCode) ) @@ -6150,6 +6173,13 @@ GLboolean AssembleInstr(GLuint uiFirstInst, return GL_FALSE; } } + else if((OPCODE_KIL == pILInst[i+1].Opcode)||(OPCODE_KIL_NV == pILInst[i+1].Opcode)) + { + if ( GL_FALSE == assemble_KIL(pR700AsmCode, SQ_OP2_INST_KILLGT) ) + { + return GL_FALSE; + } + } else { if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETGT) ) @@ -6210,6 +6240,13 @@ GLboolean AssembleInstr(GLuint uiFirstInst, return GL_FALSE; } } + else if((OPCODE_KIL == pILInst[i+1].Opcode)||(OPCODE_KIL_NV == pILInst[i+1].Opcode)) + { + if ( GL_FALSE == assemble_KIL(pR700AsmCode, SQ_OP2_INST_KILLGE) ) + { + return GL_FALSE; + } + } else { if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETGE) ) @@ -6257,6 +6294,13 @@ GLboolean AssembleInstr(GLuint uiFirstInst, return GL_FALSE; } } + else if((OPCODE_KIL == pILInst[i+1].Opcode)||(OPCODE_KIL_NV == pILInst[i+1].Opcode)) + { + if ( GL_FALSE == assemble_KIL(pR700AsmCode, SQ_OP2_INST_KILLNE) ) + { + return GL_FALSE; + } + } else { if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETNE) ) @@ -6298,6 +6342,11 @@ GLboolean AssembleInstr(GLuint uiFirstInst, return GL_FALSE; break; + case OPCODE_TRUNC: + if ( GL_FALSE == assemble_math_function(pR700AsmCode, SQ_OP2_INST_TRUNC) ) + return GL_FALSE; + break; + case OPCODE_XPD: if ( GL_FALSE == assemble_XPD(pR700AsmCode) ) return GL_FALSE; diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index 3e4106335a..130fc89dae 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -554,7 +554,7 @@ GLboolean assemble_EXP(r700_AssemblerBase *pAsm); GLboolean assemble_FLR(r700_AssemblerBase *pAsm); GLboolean assemble_FLR_INT(r700_AssemblerBase *pAsm); GLboolean assemble_FRC(r700_AssemblerBase *pAsm); -GLboolean assemble_KIL(r700_AssemblerBase *pAsm); +GLboolean assemble_KIL(r700_AssemblerBase *pAsm, GLuint opcode); GLboolean assemble_LG2(r700_AssemblerBase *pAsm); GLboolean assemble_LRP(r700_AssemblerBase *pAsm); GLboolean assemble_LOG(r700_AssemblerBase *pAsm); -- cgit v1.2.3 From 67125c7f9aa141a7948ebb915ece9d991bb6ff19 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Mon, 23 Nov 2009 01:52:59 -0500 Subject: mesa: Initialize variable in _mesa_get_texel_fetch_func. --- src/mesa/main/texfetch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texfetch.c b/src/mesa/main/texfetch.c index f4f2be48c3..b37039429f 100644 --- a/src/mesa/main/texfetch.c +++ b/src/mesa/main/texfetch.c @@ -570,7 +570,7 @@ texfetch_funcs[MESA_FORMAT_COUNT] = static FetchTexelFuncF _mesa_get_texel_fetch_func(gl_format format, GLuint dims) { - FetchTexelFuncF f; + FetchTexelFuncF f = NULL; GLuint i; /* XXX replace loop with direct table lookup */ for (i = 0; i < MESA_FORMAT_COUNT; i++) { -- cgit v1.2.3 From f61865799defe6636ac893c7ddb510911e5bfa0c Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 19 Nov 2009 12:52:58 +0100 Subject: slang: Be more robust with memory in concat_shaders(). --- src/mesa/shader/slang/slang_link.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/slang/slang_link.c b/src/mesa/shader/slang/slang_link.c index 0a2bc49780..ed27821a95 100644 --- a/src/mesa/shader/slang/slang_link.c +++ b/src/mesa/shader/slang/slang_link.c @@ -590,11 +590,16 @@ concat_shaders(struct gl_shader_program *shProg, GLenum shaderType) { struct gl_shader *newShader; const struct gl_shader *firstShader = NULL; - GLuint shaderLengths[100]; + GLuint *shaderLengths; GLchar *source; GLuint totalLen = 0, len = 0; GLuint i; + shaderLengths = (GLuint *)_mesa_malloc(shProg->NumShaders * sizeof(GLuint)); + if (!shaderLengths) { + return NULL; + } + /* compute total size of new shader source code */ for (i = 0; i < shProg->NumShaders; i++) { const struct gl_shader *shader = shProg->Shaders[i]; @@ -606,12 +611,16 @@ concat_shaders(struct gl_shader_program *shProg, GLenum shaderType) } } - if (totalLen == 0) + if (totalLen == 0) { + _mesa_free(shaderLengths); return NULL; + } source = (GLchar *) _mesa_malloc(totalLen + 1); - if (!source) + if (!source) { + _mesa_free(shaderLengths); return NULL; + } /* concatenate shaders */ for (i = 0; i < shProg->NumShaders; i++) { @@ -626,9 +635,16 @@ concat_shaders(struct gl_shader_program *shProg, GLenum shaderType) _mesa_printf("---NEW CONCATENATED SHADER---:\n%s\n------------\n", source); */ + _mesa_free(shaderLengths); + remove_extra_version_directives(source); newShader = CALLOC_STRUCT(gl_shader); + if (!newShader) { + _mesa_free(source); + return NULL; + } + newShader->Type = shaderType; newShader->Source = source; newShader->Pragmas = firstShader->Pragmas; -- cgit v1.2.3 From 18384af7491c408c4182b72807b02c11b55509f8 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 23 Nov 2009 13:22:04 +0100 Subject: slang: Check return value from emit_instruction(). --- src/mesa/shader/slang/slang_emit.c | 73 ++++++++++++++++++++++++++++++++++---- 1 file changed, 67 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index c0e4b27aa5..fe39b46dbb 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -551,6 +551,9 @@ emit_instruction(slang_emit_info *emitInfo, &srcRelAddr, NULL, NULL); + if (!inst) { + return NULL; + } src[i] = &newSrc[i]; } @@ -948,6 +951,9 @@ emit_compare(slang_emit_info *emitInfo, slang_ir_node *n) n->Children[0]->Store, n->Children[1]->Store, NULL); + if (!inst) { + return NULL; + } inst_comment(inst, "Compare values"); /* Compute val = DOT(temp, temp) (reduction) */ @@ -957,6 +963,9 @@ emit_compare(slang_emit_info *emitInfo, slang_ir_node *n) &tempStore, &tempStore, NULL); + if (!inst) { + return NULL; + } inst->SrcReg[0].Swizzle = inst->SrcReg[1].Swizzle = swizzle; /*override*/ inst_comment(inst, "Reduce vec to bool"); @@ -972,6 +981,9 @@ emit_compare(slang_emit_info *emitInfo, slang_ir_node *n) n->Store, &zero, NULL); + if (!inst) { + return NULL; + } inst_comment(inst, "Invert true/false"); } } @@ -1001,6 +1013,9 @@ emit_compare(slang_emit_info *emitInfo, slang_ir_node *n) &srcStore0, &srcStore1, NULL); + if (!inst) { + return NULL; + } inst_comment(inst, "Begin struct/array comparison"); } else { @@ -1010,12 +1025,18 @@ emit_compare(slang_emit_info *emitInfo, slang_ir_node *n) &srcStore0, &srcStore1, NULL); + if (!inst) { + return NULL; + } /* ADD accTemp, accTemp, sneTemp; # like logical-OR */ inst = emit_instruction(emitInfo, OPCODE_ADD, &accTemp, /* dest */ &accTemp, &sneTemp, NULL); + if (!inst) { + return NULL; + } } } @@ -1025,6 +1046,9 @@ emit_compare(slang_emit_info *emitInfo, slang_ir_node *n) &accTemp, &accTemp, NULL); + if (!inst) { + return NULL; + } inst_comment(inst, "End struct/array comparison"); if (n->Opcode == IR_EQUAL) { @@ -1036,6 +1060,9 @@ emit_compare(slang_emit_info *emitInfo, slang_ir_node *n) n->Store, &zero, NULL); + if (!inst) { + return NULL; + } inst_comment(inst, "Invert true/false"); } @@ -1119,6 +1146,9 @@ emit_clamp(slang_emit_info *emitInfo, slang_ir_node *n) n->Children[0]->Store, n->Children[1]->Store, NULL); + if (!inst) { + return NULL; + } /* n->dest = min(tmp, ch[2]) */ inst = emit_instruction(emitInfo, OPCODE_MIN, @@ -1153,7 +1183,9 @@ emit_negation(slang_emit_info *emitInfo, slang_ir_node *n) n->Children[0]->Store, NULL, NULL); - inst->SrcReg[0].Negate = NEGATE_XYZW; + if (inst) { + inst->SrcReg[0].Negate = NEGATE_XYZW; + } return inst; } @@ -1356,6 +1388,9 @@ emit_tex(slang_emit_info *emitInfo, slang_ir_node *n) n->Children[1]->Store, NULL, NULL); + if (!inst) { + return NULL; + } inst->TexShadow = shadow; @@ -1458,6 +1493,9 @@ emit_copy(slang_emit_info *emitInfo, slang_ir_node *n) &srcStore, NULL, NULL); + if (!inst) { + return NULL; + } inst_comment(inst, "IR_COPY block"); srcStore.Index++; dstStore.Index++; @@ -1473,6 +1511,9 @@ emit_copy(slang_emit_info *emitInfo, slang_ir_node *n) n->Children[1]->Store, NULL, NULL); + if (!inst) { + return NULL; + } dstAnnot = storage_annotation(n->Children[0], emitInfo->prog); srcAnnot = storage_annotation(n->Children[1], emitInfo->prog); inst->Comment = instruction_annotation(inst->Opcode, dstAnnot, @@ -1534,6 +1575,9 @@ emit_cond(slang_emit_info *emitInfo, slang_ir_node *n) n->Children[0]->Store, NULL, NULL); + if (!inst) { + return NULL; + } inst->CondUpdate = GL_TRUE; inst_comment(inst, "COND expr"); _slang_free_temp(emitInfo->vt, n->Store); @@ -1596,6 +1640,9 @@ emit_not(slang_emit_info *emitInfo, slang_ir_node *n) n->Children[0]->Store, &zero, NULL); + if (!inst) { + return NULL; + } inst_comment(inst, "NOT"); free_node_storage(emitInfo->vt, n->Children[0]); @@ -1646,12 +1693,17 @@ emit_if(slang_emit_info *emitInfo, slang_ir_node *n) ifInst->DstReg.CondSwizzle = writemask_to_swizzle(condWritemask); } else { + struct prog_instruction *inst; + /* IF src[0] THEN ... */ - emit_instruction(emitInfo, OPCODE_IF, - NULL, /* dst */ - n->Children[0]->Store, /* op0 */ - NULL, - NULL); + inst = emit_instruction(emitInfo, OPCODE_IF, + NULL, /* dst */ + n->Children[0]->Store, /* op0 */ + NULL, + NULL); + if (!inst) { + return NULL; + } } } else { @@ -1875,6 +1927,9 @@ emit_cont_break_if_true(slang_emit_info *emitInfo, slang_ir_node *n) n->Children[0]->Store, NULL, NULL); + if (!inst) { + return NULL; + } n->InstLocation = emitInfo->prog->NumInstructions; inst = new_instruction(emitInfo, opcode); @@ -2045,6 +2100,9 @@ emit_array_element(slang_emit_info *emitInfo, slang_ir_node *n) indexStore, /* the index */ &elemSizeStore, NULL); + if (!inst) { + return NULL; + } indexStore = indexTemp; } @@ -2071,6 +2129,9 @@ emit_array_element(slang_emit_info *emitInfo, slang_ir_node *n) indexStore, /* the index */ &indirectArray, /* indirect array base */ NULL); + if (!inst) { + return NULL; + } indexStore = indexTemp; } -- cgit v1.2.3 From 601edbef172f3106b9e4c0b96b24d8b5eea8d2a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Mon, 23 Nov 2009 19:33:59 +0100 Subject: Fix the DRI swrast driver for big endian platforms. Too bad I didn't realize earlier how easy this could be... Fixes http://bugs.freedesktop.org/show_bug.cgi?id=22767 . --- src/mesa/drivers/dri/swrast/swrast_span.c | 72 +++++++++++++------------------ 1 file changed, 29 insertions(+), 43 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/swrast/swrast_span.c b/src/mesa/drivers/dri/swrast/swrast_span.c index 2d3c25dcbe..f8e503463f 100644 --- a/src/mesa/drivers/dri/swrast/swrast_span.c +++ b/src/mesa/drivers/dri/swrast/swrast_span.c @@ -63,56 +63,42 @@ static const GLubyte kernel[16] = { /* 32-bit BGRA */ #define STORE_PIXEL_A8R8G8B8(DST, X, Y, VALUE) \ - DST[3] = VALUE[ACOMP]; \ - DST[2] = VALUE[RCOMP]; \ - DST[1] = VALUE[GCOMP]; \ - DST[0] = VALUE[BCOMP] + *DST = VALUE[ACOMP] << 24 | VALUE[RCOMP] << 16 | VALUE[GCOMP] << 8 | VALUE[BCOMP] #define STORE_PIXEL_RGB_A8R8G8B8(DST, X, Y, VALUE) \ - DST[3] = 0xff; \ - DST[2] = VALUE[RCOMP]; \ - DST[1] = VALUE[GCOMP]; \ - DST[0] = VALUE[BCOMP] + *DST = 0xff << 24 | VALUE[RCOMP] << 16 | VALUE[GCOMP] << 8 | VALUE[BCOMP] #define FETCH_PIXEL_A8R8G8B8(DST, SRC) \ - DST[ACOMP] = SRC[3]; \ - DST[RCOMP] = SRC[2]; \ - DST[GCOMP] = SRC[1]; \ - DST[BCOMP] = SRC[0] + DST[ACOMP] = *SRC >> 24; \ + DST[RCOMP] = (*SRC >> 16) & 0xff; \ + DST[GCOMP] = (*SRC >> 8) & 0xff; \ + DST[BCOMP] = *SRC & 0xff /* 32-bit BGRX */ #define STORE_PIXEL_X8R8G8B8(DST, X, Y, VALUE) \ - DST[3] = 0xff; \ - DST[2] = VALUE[RCOMP]; \ - DST[1] = VALUE[GCOMP]; \ - DST[0] = VALUE[BCOMP] + *DST = 0xff << 24 | VALUE[RCOMP] << 16 | VALUE[GCOMP] << 8 | VALUE[BCOMP] #define STORE_PIXEL_RGB_X8R8G8B8(DST, X, Y, VALUE) \ - DST[3] = 0xff; \ - DST[2] = VALUE[RCOMP]; \ - DST[1] = VALUE[GCOMP]; \ - DST[0] = VALUE[BCOMP] + *DST = 0xff << 24 | VALUE[RCOMP] << 16 | VALUE[GCOMP] << 8 | VALUE[BCOMP] #define FETCH_PIXEL_X8R8G8B8(DST, SRC) \ - DST[ACOMP] = 0xff; \ - DST[RCOMP] = SRC[2]; \ - DST[GCOMP] = SRC[1]; \ - DST[BCOMP] = SRC[0] + DST[ACOMP] = 0xff; \ + DST[RCOMP] = (*SRC >> 16) & 0xff; \ + DST[GCOMP] = (*SRC >> 8) & 0xff; \ + DST[BCOMP] = *SRC & 0xff /* 16-bit BGR */ #define STORE_PIXEL_R5G6B5(DST, X, Y, VALUE) \ do { \ int d = DITHER_COMP(X, Y) >> 6; \ - GLushort *p = (GLushort *)DST; \ - *p = ( ((DITHER_CLAMP((VALUE[RCOMP]) + d) & 0xf8) << 8) | \ - ((DITHER_CLAMP((VALUE[GCOMP]) + d) & 0xfc) << 3) | \ - ((DITHER_CLAMP((VALUE[BCOMP]) + d) & 0xf8) >> 3) ); \ + *DST = ( ((DITHER_CLAMP((VALUE[RCOMP]) + d) & 0xf8) << 8) | \ + ((DITHER_CLAMP((VALUE[GCOMP]) + d) & 0xfc) << 3) | \ + ((DITHER_CLAMP((VALUE[BCOMP]) + d) & 0xf8) >> 3) ); \ } while(0) #define FETCH_PIXEL_R5G6B5(DST, SRC) \ do { \ - GLushort p = *(GLushort *)SRC; \ DST[ACOMP] = 0xff; \ - DST[RCOMP] = ((p >> 8) & 0xf8) * 255 / 0xf8; \ - DST[GCOMP] = ((p >> 3) & 0xfc) * 255 / 0xfc; \ - DST[BCOMP] = ((p << 3) & 0xf8) * 255 / 0xf8; \ + DST[RCOMP] = ((*SRC >> 8) & 0xf8) * 255 / 0xf8; \ + DST[GCOMP] = ((*SRC >> 3) & 0xfc) * 255 / 0xfc; \ + DST[BCOMP] = ((*SRC << 3) & 0xf8) * 255 / 0xf8; \ } while(0) @@ -145,8 +131,8 @@ static const GLubyte kernel[16] = { #define SPAN_VARS \ struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb); #define INIT_PIXEL_PTR(P, X, Y) \ - GLubyte *P = (GLubyte *)xrb->Base.Data + YFLIP(xrb, Y) * xrb->pitch + (X) * 4; -#define INC_PIXEL_PTR(P) P += 4 + GLuint *P = (GLuint *)xrb->Base.Data + YFLIP(xrb, Y) * xrb->pitch / 4 + (X) +#define INC_PIXEL_PTR(P) P++ #define STORE_PIXEL(DST, X, Y, VALUE) \ STORE_PIXEL_A8R8G8B8(DST, X, Y, VALUE) #define STORE_PIXEL_RGB(DST, X, Y, VALUE) \ @@ -163,8 +149,8 @@ static const GLubyte kernel[16] = { #define SPAN_VARS \ struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb); #define INIT_PIXEL_PTR(P, X, Y) \ - GLubyte *P = (GLubyte *)xrb->Base.Data + YFLIP(xrb, Y) * xrb->pitch + (X) * 4; -#define INC_PIXEL_PTR(P) P += 4 + GLuint *P = (GLuint *)xrb->Base.Data + YFLIP(xrb, Y) * xrb->pitch / 4 + (X); +#define INC_PIXEL_PTR(P) P++ #define STORE_PIXEL(DST, X, Y, VALUE) \ STORE_PIXEL_X8R8G8B8(DST, X, Y, VALUE) #define STORE_PIXEL_RGB(DST, X, Y, VALUE) \ @@ -181,8 +167,8 @@ static const GLubyte kernel[16] = { #define SPAN_VARS \ struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb); #define INIT_PIXEL_PTR(P, X, Y) \ - GLubyte *P = (GLubyte *)xrb->Base.Data + YFLIP(xrb, Y) * xrb->pitch + (X) * 2; -#define INC_PIXEL_PTR(P) P += 2 + GLushort *P = (GLushort *)xrb->Base.Data + YFLIP(xrb, Y) * xrb->pitch / 2 + (X); +#define INC_PIXEL_PTR(P) P++ #define STORE_PIXEL(DST, X, Y, VALUE) \ STORE_PIXEL_R5G6B5(DST, X, Y, VALUE) #define FETCH_PIXEL(DST, SRC) \ @@ -234,8 +220,8 @@ static const GLubyte kernel[16] = { #define SPAN_VARS \ struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb); #define INIT_PIXEL_PTR(P, X, Y) \ - GLubyte *P = (GLubyte *)row; -#define INC_PIXEL_PTR(P) P += 4 + GLuint *P = (GLuint *)row; +#define INC_PIXEL_PTR(P) P++ #define STORE_PIXEL(DST, X, Y, VALUE) \ STORE_PIXEL_A8R8G8B8(DST, X, Y, VALUE) #define STORE_PIXEL_RGB(DST, X, Y, VALUE) \ @@ -252,8 +238,8 @@ static const GLubyte kernel[16] = { #define SPAN_VARS \ struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb); #define INIT_PIXEL_PTR(P, X, Y) \ - GLubyte *P = (GLubyte *)row; -#define INC_PIXEL_PTR(P) P += 4 + GLuint *P = (GLuint *)row; +#define INC_PIXEL_PTR(P) P++ #define STORE_PIXEL(DST, X, Y, VALUE) \ STORE_PIXEL_X8R8G8B8(DST, X, Y, VALUE) #define STORE_PIXEL_RGB(DST, X, Y, VALUE) \ @@ -270,7 +256,7 @@ static const GLubyte kernel[16] = { #define SPAN_VARS \ struct swrast_renderbuffer *xrb = swrast_renderbuffer(rb); #define INIT_PIXEL_PTR(P, X, Y) \ - GLubyte *P = (GLubyte *)row; + GLushort *P = (GLushort *)row; #define INC_PIXEL_PTR(P) P += 2 #define STORE_PIXEL(DST, X, Y, VALUE) \ STORE_PIXEL_R5G6B5(DST, X, Y, VALUE) -- cgit v1.2.3 From 960464e42dce138fde11c379ce7744bc4be14aa2 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Mon, 23 Nov 2009 21:59:08 +0100 Subject: radeon: fix errors in miptree related function - typo - memory leak - off by one (spotted by airlied) --- src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c index a11b5b9979..46603de2e7 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c @@ -492,11 +492,12 @@ static radeon_mipmap_tree * get_biggest_matching_miptree(radeonTexObj *texObj, unsigned firstLevel, unsigned lastLevel) { - const unsigned numLevels = lastLevel - firstLevel; + const unsigned numLevels = lastLevel - firstLevel + 1; unsigned *mtSizes = calloc(numLevels, sizeof(unsigned)); radeon_mipmap_tree **mts = calloc(numLevels, sizeof(radeon_mipmap_tree *)); unsigned mtCount = 0; unsigned maxMtIndex = 0; + radeon_mipmap_tree *tmp; for (unsigned level = firstLevel; level <= lastLevel; ++level) { radeon_texture_image *img = get_radeon_texture_image(texObj->base.Image[0][level]); @@ -518,7 +519,7 @@ static radeon_mipmap_tree * get_biggest_matching_miptree(radeonTexObj *texObj, if (!found) { mtSizes[mtCount] += img->mt->levels[img->mtlevel].size; - mts[mtCount++] = img->mt; + mts[mtCount] = img->mt; mtCount++; } } @@ -533,7 +534,11 @@ static radeon_mipmap_tree * get_biggest_matching_miptree(radeonTexObj *texObj, } } - return mts[maxMtIndex]; + tmp = mts[maxMtIndex]; + free(mtSizes); + free(mts); + + return tmp; } /** -- cgit v1.2.3 From 364070b1f2b08d43fb205ec198894a35bec6b2f3 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 24 Nov 2009 00:57:55 -0500 Subject: dri: Fix potential null pointer deference in dri_put_drawable. --- src/mesa/drivers/dri/common/dri_util.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index e48e10d7c0..439f66a7b8 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -498,11 +498,11 @@ static void dri_put_drawable(__DRIdrawable *pdp) { __DRIscreenPrivate *psp; - pdp->refcount--; - if (pdp->refcount) - return; - if (pdp) { + pdp->refcount--; + if (pdp->refcount) + return; + psp = pdp->driScreenPriv; (*psp->DriverAPI.DestroyBuffer)(pdp); if (pdp->pClipRects) { -- cgit v1.2.3 From 863ad9a68388979e1d305f8689146e18ef4f098c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 23 Nov 2009 18:09:46 -0700 Subject: mesa: use gcc __builtin_popcount() --- src/mesa/main/imports.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index 46ffb929b6..c9e00cf752 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -629,11 +629,15 @@ _mesa_ffsll(int64_t val) unsigned int _mesa_bitcount(unsigned int n) { +#if defined(__GNUC__) + return __builtin_popcount(n); +#else unsigned int bits; for (bits = 0; n > 0; n = n >> 1) { bits += (n & 1); } return bits; +#endif } -- cgit v1.2.3 From bd13e6e5e2403ada2098e3a07c0af4b4ba989ab7 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 24 Nov 2009 10:49:34 +1000 Subject: radeon/r200/r300/r600: make bo mapping be explicit This moves the bo mapping outside the DMA layer and makes it explicit, this should in theory make it simpler to split the clean up the dma/cmdbuf linkage that I created before that is broken. Tested on: r600, rv380 (tcl/no-tcl), rv200 (tcl/no-tcl) Signed-off-by: Dave Airlie --- src/mesa/drivers/dri/r200/r200_maos_arrays.c | 2 ++ src/mesa/drivers/dri/r200/r200_swtcl.c | 2 +- src/mesa/drivers/dri/r300/r300_draw.c | 15 ++++++++++++-- src/mesa/drivers/dri/r300/r300_swtcl.c | 8 ++++---- src/mesa/drivers/dri/r600/r700_render.c | 21 ++++++++++++++++++- .../drivers/dri/radeon/radeon_common_context.h | 1 + src/mesa/drivers/dri/radeon/radeon_dma.c | 24 +++++++++++----------- src/mesa/drivers/dri/radeon/radeon_maos_arrays.c | 4 ++++ src/mesa/drivers/dri/radeon/radeon_maos_verts.c | 4 ++-- src/mesa/drivers/dri/radeon/radeon_swtcl.c | 2 +- 10 files changed, 60 insertions(+), 23 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r200/r200_maos_arrays.c b/src/mesa/drivers/dri/r200/r200_maos_arrays.c index 383a0c4b0d..249c0bbc11 100644 --- a/src/mesa/drivers/dri/r200/r200_maos_arrays.c +++ b/src/mesa/drivers/dri/r200/r200_maos_arrays.c @@ -90,12 +90,14 @@ static void r200_emit_vecfog(GLcontext *ctx, struct radeon_aos *aos, aos->components = size; aos->count = count; + radeon_bo_map(aos->bo, 1); out = (uint32_t*)((char*)aos->bo->ptr + aos->offset); for (i = 0; i < count; i++) { out[0] = r200ComputeFogBlendFactor( ctx, *(GLfloat *)data ); out++; data += stride; } + radeon_bo_unmap(aos->bo); } /* Emit any changed arrays to new GART memory, re-emit a packet to diff --git a/src/mesa/drivers/dri/r200/r200_swtcl.c b/src/mesa/drivers/dri/r200/r200_swtcl.c index fadc766b49..4596912ddc 100644 --- a/src/mesa/drivers/dri/r200/r200_swtcl.c +++ b/src/mesa/drivers/dri/r200/r200_swtcl.c @@ -297,7 +297,7 @@ void r200_swtcl_flush(GLcontext *ctx, uint32_t current_offset) radeonEmitState(&rmesa->radeon); r200EmitVertexAOS( rmesa, rmesa->radeon.swtcl.vertex_size, - first_elem(&rmesa->radeon.dma.reserved)->bo, + rmesa->radeon.swtcl.bo, current_offset); diff --git a/src/mesa/drivers/dri/r300/r300_draw.c b/src/mesa/drivers/dri/r300/r300_draw.c index e9968f9ffe..3dcd986e22 100644 --- a/src/mesa/drivers/dri/r300/r300_draw.c +++ b/src/mesa/drivers/dri/r300/r300_draw.c @@ -100,7 +100,7 @@ static void r300FixupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer GLubyte *in = (GLubyte *)src_ptr; radeonAllocDmaRegion(&r300->radeon, &r300->ind_buf.bo, &r300->ind_buf.bo_offset, size, 4); - + radeon_bo_map(r300->ind_buf.bo, 1); assert(r300->ind_buf.bo->ptr != NULL); out = (GLuint *)ADD_POINTERS(r300->ind_buf.bo->ptr, r300->ind_buf.bo_offset); @@ -111,7 +111,7 @@ static void r300FixupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer if (i < mesa_ind_buf->count) { *out++ = in[i]; } - + radeon_bo_unmap(r300->ind_buf.bo); #if MESA_BIG_ENDIAN } else { /* if (mesa_ind_buf->type == GL_UNSIGNED_SHORT) */ GLushort *in = (GLushort *)src_ptr; @@ -120,6 +120,7 @@ static void r300FixupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer radeonAllocDmaRegion(&r300->radeon, &r300->ind_buf.bo, &r300->ind_buf.bo_offset, size, 4); + radeon_bo_map(r300->ind_buf.bo, 1); assert(r300->ind_buf.bo->ptr != NULL); out = (GLuint *)ADD_POINTERS(r300->ind_buf.bo->ptr, r300->ind_buf.bo_offset); @@ -130,6 +131,7 @@ static void r300FixupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer if (i < mesa_ind_buf->count) { *out++ = in[i]; } + radeon_bo_unmap(r300->ind_buf.bo); #endif } @@ -173,10 +175,12 @@ static void r300SetupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer radeonAllocDmaRegion(&r300->radeon, &r300->ind_buf.bo, &r300->ind_buf.bo_offset, size, 4); + radeon_bo_map(r300->ind_buf.bo, 1); assert(r300->ind_buf.bo->ptr != NULL); dst_ptr = ADD_POINTERS(r300->ind_buf.bo->ptr, r300->ind_buf.bo_offset); _mesa_memcpy(dst_ptr, src_ptr, size); + radeon_bo_unmap(r300->ind_buf.bo); r300->ind_buf.is_32bit = (mesa_ind_buf->type == GL_UNSIGNED_INT); r300->ind_buf.count = mesa_ind_buf->count; @@ -242,6 +246,7 @@ static void r300ConvertAttrib(GLcontext *ctx, int count, const struct gl_client_ } radeonAllocDmaRegion(&r300->radeon, &attr->bo, &attr->bo_offset, sizeof(GLfloat) * input->Size * count, 32); + radeon_bo_map(attr->bo, 1); dst_ptr = (GLfloat *)ADD_POINTERS(attr->bo->ptr, attr->bo_offset); radeon_print(RADEON_FALLBACKS, RADEON_IMPORTANT, @@ -280,6 +285,7 @@ static void r300ConvertAttrib(GLcontext *ctx, int count, const struct gl_client_ break; } + radeon_bo_unmap(attr->bo); if (mapped_named_bo) { ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER, input->BufferObj); } @@ -294,6 +300,8 @@ static void r300AlignDataToDword(GLcontext *ctx, const struct gl_client_array *i radeonAllocDmaRegion(&r300->radeon, &attr->bo, &attr->bo_offset, size, 32); + radeon_bo_map(attr->bo, 1); + if (!input->BufferObj->Pointer) { ctx->Driver.MapBuffer(ctx, GL_ARRAY_BUFFER, GL_READ_ONLY_ARB, input->BufferObj); mapped_named_bo = GL_TRUE; @@ -317,6 +325,7 @@ static void r300AlignDataToDword(GLcontext *ctx, const struct gl_client_array *i ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER, input->BufferObj); } + radeon_bo_unmap(attr->bo); attr->stride = dst_stride; } @@ -527,6 +536,7 @@ static void r300AllocDmaRegions(GLcontext *ctx, const struct gl_client_array *in } radeonAllocDmaRegion(&r300->radeon, &vbuf->attribs[index].bo, &vbuf->attribs[index].bo_offset, size, 32); + radeon_bo_map(vbuf->attribs[index].bo, 1); assert(vbuf->attribs[index].bo->ptr != NULL); dst = (uint32_t *)ADD_POINTERS(vbuf->attribs[index].bo->ptr, vbuf->attribs[index].bo_offset); switch (vbuf->attribs[index].dwords) { @@ -536,6 +546,7 @@ static void r300AllocDmaRegions(GLcontext *ctx, const struct gl_client_array *in case 4: radeonEmitVec16(dst, input[i]->Ptr, input[i]->StrideB, local_count); break; default: assert(0); break; } + radeon_bo_unmap(vbuf->attribs[index].bo); } } diff --git a/src/mesa/drivers/dri/r300/r300_swtcl.c b/src/mesa/drivers/dri/r300/r300_swtcl.c index 99bd22edac..383c8a274b 100644 --- a/src/mesa/drivers/dri/r300/r300_swtcl.c +++ b/src/mesa/drivers/dri/r300/r300_swtcl.c @@ -665,11 +665,11 @@ void r300_swtcl_flush(GLcontext *ctx, uint32_t current_offset) r300EmitCacheFlush(rmesa); radeonEmitState(&rmesa->radeon); - r300_emit_scissor(ctx); + r300_emit_scissor(ctx); r300EmitVertexAOS(rmesa, - rmesa->radeon.swtcl.vertex_size, - first_elem(&rmesa->radeon.dma.reserved)->bo, - current_offset); + rmesa->radeon.swtcl.vertex_size, + rmesa->radeon.swtcl.bo, + current_offset); r300EmitVbufPrim(rmesa, rmesa->radeon.swtcl.hw_primitive, diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c index 47f89c91f8..eab27cbd84 100644 --- a/src/mesa/drivers/dri/r600/r700_render.c +++ b/src/mesa/drivers/dri/r600/r700_render.c @@ -526,6 +526,9 @@ static void r700ConvertAttrib(GLcontext *ctx, int count, radeonAllocDmaRegion(&context->radeon, &attr->bo, &attr->bo_offset, sizeof(GLfloat) * input->Size * count, 32); + + radeon_bo_map(attr->bo, 1); + dst_ptr = (GLfloat *)ADD_POINTERS(attr->bo->ptr, attr->bo_offset); assert(src_ptr != NULL); @@ -559,6 +562,8 @@ static void r700ConvertAttrib(GLcontext *ctx, int count, break; } + radeon_bo_unmap(attr->bo); + if (mapped_named_bo) { ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER, input->BufferObj); @@ -577,6 +582,8 @@ static void r700AlignDataToDword(GLcontext *ctx, radeonAllocDmaRegion(&context->radeon, &attr->bo, &attr->bo_offset, size, 32); + radeon_bo_map(attr->bo, 1); + if (!input->BufferObj->Pointer) { ctx->Driver.MapBuffer(ctx, GL_ARRAY_BUFFER, GL_READ_ONLY_ARB, input->BufferObj); @@ -596,6 +603,7 @@ static void r700AlignDataToDword(GLcontext *ctx, } } + radeon_bo_unmap(attr->bo); if (mapped_named_bo) { ctx->Driver.UnmapBuffer(ctx, GL_ARRAY_BUFFER, input->BufferObj); @@ -664,14 +672,18 @@ static void r700SetupStreams(GLcontext *ctx, const struct gl_client_array *input radeonAllocDmaRegion(&context->radeon, &context->stream_desc[index].bo, &context->stream_desc[index].bo_offset, size, 32); + + radeon_bo_map(context->stream_desc[index].bo, 1); assert(context->stream_desc[index].bo->ptr != NULL); + + dst = (uint32_t *)ADD_POINTERS(context->stream_desc[index].bo->ptr, context->stream_desc[index].bo_offset); switch (context->stream_desc[index].dwords) { case 1: - radeonEmitVec4(dst, input[i]->Ptr, input[i]->StrideB, local_count); + radeonEmitVec4(dst, input[i]->Ptr, input[i]->StrideB, local_count); break; case 2: radeonEmitVec8(dst, input[i]->Ptr, input[i]->StrideB, local_count); @@ -686,6 +698,7 @@ static void r700SetupStreams(GLcontext *ctx, const struct gl_client_array *input assert(0); break; } + radeon_bo_unmap(context->stream_desc[index].bo); } } @@ -757,6 +770,7 @@ static void r700FixupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer radeonAllocDmaRegion(&context->radeon, &context->ind_buf.bo, &context->ind_buf.bo_offset, size, 4); + radeon_bo_map(context->ind_buf.bo, 1); assert(context->ind_buf.bo->ptr != NULL); out = (GLuint *)ADD_POINTERS(context->ind_buf.bo->ptr, context->ind_buf.bo_offset); @@ -770,6 +784,7 @@ static void r700FixupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer *out++ = in[i]; } + radeon_bo_unmap(context->ind_buf.bo); #if MESA_BIG_ENDIAN } else @@ -780,6 +795,7 @@ static void r700FixupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer radeonAllocDmaRegion(&context->radeon, &context->ind_buf.bo, &context->ind_buf.bo_offset, size, 4); + radeon_bo_map(context->ind_buf.bo, 1); assert(context->ind_buf.bo->ptr != NULL); out = (GLuint *)ADD_POINTERS(context->ind_buf.bo->ptr, context->ind_buf.bo_offset); @@ -792,6 +808,7 @@ static void r700FixupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer { *out++ = in[i]; } + radeon_bo_unmap(context->ind_buf.bo); #endif } @@ -837,11 +854,13 @@ static void r700SetupIndexBuffer(GLcontext *ctx, const struct _mesa_index_buffer radeonAllocDmaRegion(&context->radeon, &context->ind_buf.bo, &context->ind_buf.bo_offset, size, 4); + radeon_bo_map(context->ind_buf.bo, 1); assert(context->ind_buf.bo->ptr != NULL); dst_ptr = ADD_POINTERS(context->ind_buf.bo->ptr, context->ind_buf.bo_offset); _mesa_memcpy(dst_ptr, src_ptr, size); + radeon_bo_unmap(context->ind_buf.bo); context->ind_buf.is_32bit = (mesa_ind_buf->type == GL_UNSIGNED_INT); context->ind_buf.count = mesa_ind_buf->count; diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.h b/src/mesa/drivers/dri/radeon/radeon_common_context.h index ded81fff29..ad953ddbb5 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.h +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.h @@ -328,6 +328,7 @@ struct radeon_swtcl_info { GLuint vertex_attr_count; GLuint emit_prediction; + struct radeon_bo *bo; }; #define RADEON_MAX_AOS_ARRAYS 16 diff --git a/src/mesa/drivers/dri/radeon/radeon_dma.c b/src/mesa/drivers/dri/radeon/radeon_dma.c index c6edbae9a1..2a1bd7357a 100644 --- a/src/mesa/drivers/dri/radeon/radeon_dma.c +++ b/src/mesa/drivers/dri/radeon/radeon_dma.c @@ -151,6 +151,7 @@ void rcommon_emit_vector(GLcontext * ctx, struct radeon_aos *aos, aos->components = size; aos->count = count; + radeon_bo_map(aos->bo, 1); out = (uint32_t*)((char*)aos->bo->ptr + aos->offset); switch (size) { case 1: radeonEmitVec4(out, data, stride, count); break; @@ -161,6 +162,7 @@ void rcommon_emit_vector(GLcontext * ctx, struct radeon_aos *aos, assert(0); break; } + radeon_bo_unmap(aos->bo); } void radeon_init_dma(radeonContextPtr rmesa) @@ -183,10 +185,6 @@ void radeonRefillCurrentDmaRegion(radeonContextPtr rmesa, int size) __FUNCTION__, size, rmesa->dma.minimum_size); - /* unmap old reserved bo */ - if (!is_empty_list(&rmesa->dma.reserved)) - radeon_bo_unmap(first_elem(&rmesa->dma.reserved)->bo); - if (is_empty_list(&rmesa->dma.free) || last_elem(&rmesa->dma.free)->bo->size < size) { dma_bo = CALLOC_STRUCT(radeon_dma_bo); @@ -223,8 +221,6 @@ again_alloc: /* Cmd buff have been flushed in radeon_revalidate_bos */ goto again_alloc; } - - radeon_bo_map(first_elem(&rmesa->dma.reserved)->bo, 1); } /* Allocates a region from rmesa->dma.current. If there isn't enough @@ -281,7 +277,6 @@ void radeonFreeDmaRegions(radeonContextPtr rmesa) foreach_s(dma_bo, temp, &rmesa->dma.reserved) { remove_from_list(dma_bo); - radeon_bo_unmap(dma_bo->bo); radeon_bo_unref(dma_bo->bo); FREE(dma_bo); } @@ -367,9 +362,6 @@ void radeonReleaseDmaRegions(radeonContextPtr rmesa) insert_at_tail(&rmesa->dma.free, dma_bo); } - /* unmap the last dma region */ - if (!is_empty_list(&rmesa->dma.reserved)) - radeon_bo_unmap(first_elem(&rmesa->dma.reserved)->bo); /* move reserved to wait list */ foreach_s(dma_bo, temp, &rmesa->dma.reserved) { /* free objects that are too small to be used because of large request */ @@ -403,11 +395,12 @@ void rcommon_flush_last_swtcl_prim( GLcontext *ctx ) radeonContextPtr rmesa = RADEON_CONTEXT(ctx); struct radeon_dma *dma = &rmesa->dma; - if (RADEON_DEBUG & RADEON_IOCTL) fprintf(stderr, "%s\n", __FUNCTION__); dma->flush = NULL; + radeon_bo_unmap(rmesa->swtcl.bo); + if (!is_empty_list(&dma->reserved)) { GLuint current_offset = dma->current_used; @@ -422,6 +415,8 @@ void rcommon_flush_last_swtcl_prim( GLcontext *ctx ) } rmesa->swtcl.numverts = 0; } + radeon_bo_unref(rmesa->swtcl.bo); + rmesa->swtcl.bo = NULL; } /* Alloc space in the current dma region. */ @@ -432,6 +427,7 @@ rcommonAllocDmaLowVerts( radeonContextPtr rmesa, int nverts, int vsize ) void *head; if (RADEON_DEBUG & RADEON_IOCTL) fprintf(stderr, "%s\n", __FUNCTION__); + if(is_empty_list(&rmesa->dma.reserved) ||rmesa->dma.current_vertexptr + bytes > first_elem(&rmesa->dma.reserved)->bo->size) { if (rmesa->dma.flush) { @@ -455,7 +451,11 @@ rcommonAllocDmaLowVerts( radeonContextPtr rmesa, int nverts, int vsize ) rmesa->swtcl.numverts * rmesa->swtcl.vertex_size * 4 == rmesa->dma.current_vertexptr ); - head = (first_elem(&rmesa->dma.reserved)->bo->ptr + rmesa->dma.current_vertexptr); + rmesa->swtcl.bo = first_elem(&rmesa->dma.reserved)->bo; + radeon_bo_ref(rmesa->swtcl.bo); + radeon_bo_map(rmesa->swtcl.bo, 1); + + head = (rmesa->swtcl.bo->ptr + rmesa->dma.current_vertexptr); rmesa->dma.current_vertexptr += bytes; rmesa->swtcl.numverts += nverts; return head; diff --git a/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c b/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c index de18d2ddd6..d810e6080e 100644 --- a/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c +++ b/src/mesa/drivers/dri/radeon/radeon_maos_arrays.c @@ -76,12 +76,14 @@ static void emit_vecfog(GLcontext *ctx, struct radeon_aos *aos, /* Emit the data */ + radeon_bo_map(aos->bo, 1); out = (uint32_t*)((char*)aos->bo->ptr + aos->offset); for (i = 0; i < count; i++) { out[0] = radeonComputeFogBlendFactor( ctx, *(GLfloat *)data ); out++; data += stride; } + radeon_bo_unmap(aos->bo); } static void emit_s0_vec(uint32_t *out, GLvoid *data, int stride, int count) @@ -151,6 +153,7 @@ static void emit_tex_vector(GLcontext *ctx, struct radeon_aos *aos, /* Emit the data */ + radeon_bo_map(aos->bo, 1); out = (uint32_t*)((char*)aos->bo->ptr + aos->offset); switch (size) { case 1: @@ -170,6 +173,7 @@ static void emit_tex_vector(GLcontext *ctx, struct radeon_aos *aos, exit(1); break; } + radeon_bo_unmap(aos->bo); } diff --git a/src/mesa/drivers/dri/radeon/radeon_maos_verts.c b/src/mesa/drivers/dri/radeon/radeon_maos_verts.c index 5ed11d0a9d..98f96ff2a7 100644 --- a/src/mesa/drivers/dri/radeon/radeon_maos_verts.c +++ b/src/mesa/drivers/dri/radeon/radeon_maos_verts.c @@ -420,10 +420,10 @@ void radeonEmitArrays( GLcontext *ctx, GLuint inputs ) } - + radeon_bo_map(rmesa->radeon.tcl.aos[0].bo, 1); setup_tab[i].emit( ctx, 0, VB->Count, rmesa->radeon.tcl.aos[0].bo->ptr + rmesa->radeon.tcl.aos[0].offset); - + radeon_bo_unmap(rmesa->radeon.tcl.aos[0].bo); // rmesa->radeon.tcl.aos[0].size = setup_tab[i].vertex_size; rmesa->radeon.tcl.aos[0].stride = setup_tab[i].vertex_size; rmesa->tcl.vertex_format = setup_tab[i].vertex_format; diff --git a/src/mesa/drivers/dri/radeon/radeon_swtcl.c b/src/mesa/drivers/dri/radeon/radeon_swtcl.c index 6bbe8e252e..8bf1bfbc57 100644 --- a/src/mesa/drivers/dri/radeon/radeon_swtcl.c +++ b/src/mesa/drivers/dri/radeon/radeon_swtcl.c @@ -309,7 +309,7 @@ void r100_swtcl_flush(GLcontext *ctx, uint32_t current_offset) radeonEmitState(&rmesa->radeon); radeonEmitVertexAOS( rmesa, rmesa->radeon.swtcl.vertex_size, - first_elem(&rmesa->radeon.dma.reserved)->bo, + rmesa->radeon.swtcl.bo, current_offset); -- cgit v1.2.3 From 2176b3ed9ab832122e56aed3242dfda102a5fec6 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 24 Nov 2009 11:56:45 +1000 Subject: r300: fix swtcl bo leak problem. We can get a lot of swtcl bo allocations - need to probably abstract this a bit further. Signed-off-by: Dave Airlie --- src/mesa/drivers/dri/radeon/radeon_dma.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_dma.c b/src/mesa/drivers/dri/radeon/radeon_dma.c index 2a1bd7357a..89a99974e2 100644 --- a/src/mesa/drivers/dri/radeon/radeon_dma.c +++ b/src/mesa/drivers/dri/radeon/radeon_dma.c @@ -451,9 +451,11 @@ rcommonAllocDmaLowVerts( radeonContextPtr rmesa, int nverts, int vsize ) rmesa->swtcl.numverts * rmesa->swtcl.vertex_size * 4 == rmesa->dma.current_vertexptr ); - rmesa->swtcl.bo = first_elem(&rmesa->dma.reserved)->bo; - radeon_bo_ref(rmesa->swtcl.bo); - radeon_bo_map(rmesa->swtcl.bo, 1); + if (!rmesa->swtcl.bo) { + rmesa->swtcl.bo = first_elem(&rmesa->dma.reserved)->bo; + radeon_bo_ref(rmesa->swtcl.bo); + radeon_bo_map(rmesa->swtcl.bo, 1); + } head = (rmesa->swtcl.bo->ptr + rmesa->dma.current_vertexptr); rmesa->dma.current_vertexptr += bytes; -- cgit v1.2.3 From b12ca6b87b55e3359e81d5a3be380c860478e353 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 23 Nov 2009 23:14:49 -0800 Subject: i915: Initialize Length and Offset fields when mapping a buffer object This fixes an assertion failure in _mesa_MapBufferARB. Fixes bugzilla #25253. --- src/mesa/drivers/dri/intel/intel_buffer_objects.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_buffer_objects.c b/src/mesa/drivers/dri/intel/intel_buffer_objects.c index a0225936c8..ccce9e712d 100644 --- a/src/mesa/drivers/dri/intel/intel_buffer_objects.c +++ b/src/mesa/drivers/dri/intel/intel_buffer_objects.c @@ -254,6 +254,8 @@ intel_bufferobj_map(GLcontext * ctx, if (intel_obj->sys_buffer) { obj->Pointer = intel_obj->sys_buffer; + obj->Length = obj->Size; + obj->Offset = 0; return obj->Pointer; } -- cgit v1.2.3 From 53d9b7d361915d6cf33b73017789e746342cc453 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 24 Nov 2009 11:17:16 +0100 Subject: mesa: Fix pointer arithmetic. --- src/mesa/main/texgetimage.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index 008407210d..bd7cc8d278 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -554,7 +554,9 @@ _mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level, GLuint bw, bh; _mesa_get_format_block_size(texImage->TexFormat, &bw, &bh); for (i = 0; i < (texImage->Height + bh - 1) / bh; i++) { - memcpy(img + i * row_stride, texImage->Data + i * row_stride_stored, row_stride); + memcpy((GLubyte *)img + i * row_stride, + (GLubyte *)texImage->Data + i * row_stride_stored, + row_stride); } } -- cgit v1.2.3 From bae9ece685e3c10fc0118e99771845d15895a0cc Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 24 Nov 2009 11:22:03 +0100 Subject: slang: Fix allocation size. We don't need 16K+ to store a single pointer. --- src/mesa/shader/slang/slang_emit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index fe39b46dbb..99eb254cee 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -81,8 +81,8 @@ new_subroutine(slang_emit_info *emitInfo, GLuint *id) emitInfo->Subroutines = (struct gl_program **) _mesa_realloc(emitInfo->Subroutines, - n * sizeof(struct gl_program), - (n + 1) * sizeof(struct gl_program)); + n * sizeof(struct gl_program *), + (n + 1) * sizeof(struct gl_program *)); emitInfo->Subroutines[n] = ctx->Driver.NewProgram(ctx, emitInfo->prog->Target, 0); emitInfo->Subroutines[n]->Parameters = emitInfo->prog->Parameters; emitInfo->NumSubroutines++; -- cgit v1.2.3 From 92c6a26a8a0f6ce540fe7c9681fb9a30b0da9e5f Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 25 Nov 2009 20:23:22 +1000 Subject: radeon: fix context destroy needing lock for flushing. Thanks to Intel code which I've just stolen pretty much as usual. This fixes fdo bug 22851 which is a dri1 regression since rewrite. Tested by: fpiobaf (Fabio) on #radeon Signed-off-by: Dave Airlie --- src/mesa/drivers/dri/radeon/radeon_lock.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_lock.c b/src/mesa/drivers/dri/radeon/radeon_lock.c index 02de8e5fd1..7ad781ba61 100644 --- a/src/mesa/drivers/dri/radeon/radeon_lock.c +++ b/src/mesa/drivers/dri/radeon/radeon_lock.c @@ -62,8 +62,6 @@ void radeonGetLock(radeonContextPtr rmesa, GLuint flags) __DRIdrawablePrivate *const readable = radeon_get_readable(rmesa); __DRIscreenPrivate *sPriv = rmesa->dri.screen; - assert(drawable != NULL); - drmGetLock(rmesa->dri.fd, rmesa->dri.hwContext, flags); /* The window might have moved, so we might need to get new clip @@ -74,12 +72,13 @@ void radeonGetLock(radeonContextPtr rmesa, GLuint flags) * Since the hardware state depends on having the latest drawable * clip rects, all state checking must be done _after_ this call. */ - DRI_VALIDATE_DRAWABLE_INFO(sPriv, drawable); - if (drawable != readable) { + if (drawable) + DRI_VALIDATE_DRAWABLE_INFO(sPriv, drawable); + if (readable && drawable != readable) { DRI_VALIDATE_DRAWABLE_INFO(sPriv, readable); } - if (rmesa->lastStamp != drawable->lastStamp) { + if (drawable && (rmesa->lastStamp != drawable->lastStamp)) { radeon_window_moved(rmesa); rmesa->lastStamp = drawable->lastStamp; } -- cgit v1.2.3 From d4c2f53ca56beb8fe9289fb17c3f5fcc2cc7dc10 Mon Sep 17 00:00:00 2001 From: Richard Li Date: Tue, 24 Nov 2009 12:16:39 -0500 Subject: r600 : fix stack depth setting bug. --- src/mesa/drivers/dri/r600/r700_assembler.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 8e57396a0d..0c16594adc 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -6503,14 +6503,14 @@ GLboolean RelocProgram(r700_AssemblerBase * pAsm) }; } - if(0 == pAsm->unSubArrayPointer) + if(pAsm->CALLSTACK[0].max > 0) { - return GL_TRUE; + pAsm->pR700Shader->uStackSize = ((pAsm->CALLSTACK[0].max + 3)>>2) + 2; } - if(pAsm->CALLSTACK[0].max > 0) + if(0 == pAsm->unSubArrayPointer) { - pAsm->pR700Shader->uStackSize = ((pAsm->CALLSTACK[0].max + 3)>>2) + 2; + return GL_TRUE; } unCFoffset = plstCFmain->uNumOfNode; -- cgit v1.2.3 From 11dce740305ea3f45966a9e9f72ba94b4eae6d40 Mon Sep 17 00:00:00 2001 From: Richard Li Date: Tue, 24 Nov 2009 16:00:25 -0500 Subject: r600 : reset stack flag with one channel only. --- src/mesa/drivers/dri/r600/r700_assembler.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 0c16594adc..ba97d3e073 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -5663,6 +5663,8 @@ GLboolean setRetInLoopFlag(r700_AssemblerBase *pAsm, GLuint flagValue) pAsm->D2.dst2.literal = 1; pAsm->D2.dst2.SaturateMode = SATURATE_OFF; pAsm->D.dst.predicated = 0; + /* in reloc where dislink flag init inst, only one slot alu inst is handled. */ + pAsm->D.dst.math = 1; /* TODO : not math really, but one channel op, more generic alu assembler needed */ #if 0 pAsm->S[0].src.rtype = SRC_REC_LITERAL; //pAsm->S[0].src.reg = 0; @@ -6457,6 +6459,7 @@ GLboolean AssembleInstr(GLuint uiFirstInst, GLboolean InitShaderProgram(r700_AssemblerBase * pAsm) { setRetInLoopFlag(pAsm, SQ_SEL_0); + pAsm->alu_x_opcode = SQ_CF_INST_ALU; return GL_TRUE; } @@ -6482,7 +6485,7 @@ GLboolean RelocProgram(r700_AssemblerBase * pAsm) if(SIT_CF_ALU == pInst->m_ShaderInstType) { pCF_ALU = (R700ControlFlowALUClause *)pInst; - if(1 == pCF_ALU->m_Word1.f.count) + if(0 == pCF_ALU->m_Word1.f.count) { pCF_ALU->m_Word1.f.cf_inst = SQ_CF_INST_NOP; } -- cgit v1.2.3 From ce56a867f71d0a74172a00869a3c5cb1862f4b04 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 25 Nov 2009 15:45:31 +1000 Subject: r600: add ARB_texture_non_power_of_two support. This makes the miptree rounds up to the near POT for each level for all radeons, however since mipmaps aren't support with NPOT on previous radeons this calculation shouldn't cause any problems. If it does we can just make it r600 only. I tested a few mipmap demos on r500 and they all seem to work. Signed-off-by: Dave Airlie --- src/mesa/drivers/dri/r600/r600_context.c | 2 +- src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c | 26 +++++++++++++++++++----- 2 files changed, 22 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index 7de29e5bb8..25314eff56 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -111,6 +111,7 @@ static const struct dri_extension card_extensions[] = { {"GL_ARB_texture_env_crossbar", NULL}, {"GL_ARB_texture_env_dot3", NULL}, {"GL_ARB_texture_mirrored_repeat", NULL}, + {"GL_ARB_texture_non_power_of_two", NULL}, {"GL_ARB_vertex_program", GL_ARB_vertex_program_functions}, {"GL_EXT_blend_equation_separate", GL_EXT_blend_equation_separate_functions}, {"GL_EXT_blend_func_separate", GL_EXT_blend_func_separate_functions}, @@ -327,7 +328,6 @@ static void r600InitGLExtensions(GLcontext *ctx) ctx->Extensions.ARB_shader_objects = GL_TRUE; ctx->Extensions.ARB_vertex_shader = GL_TRUE; ctx->Extensions.ARB_fragment_shader = GL_TRUE; - ctx->Extensions.ARB_texture_non_power_of_two = GL_TRUE; ctx->Extensions.EXT_blend_equation_separate = GL_TRUE; ctx->Extensions.ATI_separate_stencil = GL_TRUE; diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c index 46603de2e7..f2f7b2a9fd 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c @@ -68,6 +68,19 @@ static unsigned get_compressed_image_size( return rowStride * ((height + blockHeight - 1) / blockHeight); } +static int find_next_power_of_two(GLuint value) +{ + int i, tmp; + + i = 0; + tmp = value - 1; + while (tmp) { + tmp >>= 1; + i++; + } + return (1 << i); +} + /** * Compute sizes and fill in offset and blit information for the given * image (determined by \p face and \p level). @@ -80,25 +93,28 @@ static void compute_tex_image_offset(radeonContextPtr rmesa, radeon_mipmap_tree { radeon_mipmap_level *lvl = &mt->levels[level]; uint32_t row_align; + GLuint height; + + height = find_next_power_of_two(lvl->height); /* Find image size in bytes */ if (_mesa_is_format_compressed(mt->mesaFormat)) { lvl->rowstride = get_aligned_compressed_row_stride(mt->mesaFormat, lvl->width, rmesa->texture_compressed_row_align); - lvl->size = get_compressed_image_size(mt->mesaFormat, lvl->rowstride, lvl->height); + lvl->size = get_compressed_image_size(mt->mesaFormat, lvl->rowstride, height); } else if (mt->target == GL_TEXTURE_RECTANGLE_NV) { row_align = rmesa->texture_rect_row_align - 1; lvl->rowstride = (_mesa_format_row_stride(mt->mesaFormat, lvl->width) + row_align) & ~row_align; - lvl->size = lvl->rowstride * lvl->height; + lvl->size = lvl->rowstride * height; } else if (mt->tilebits & RADEON_TXO_MICRO_TILE) { /* tile pattern is 16 bytes x2. mipmaps stay 32 byte aligned, * though the actual offset may be different (if texture is less than * 32 bytes width) to the untiled case */ lvl->rowstride = (_mesa_format_row_stride(mt->mesaFormat, lvl->width) * 2 + 31) & ~31; - lvl->size = lvl->rowstride * ((lvl->height + 1) / 2) * lvl->depth; + lvl->size = lvl->rowstride * ((height + 1) / 2) * lvl->depth; } else { row_align = rmesa->texture_row_align - 1; lvl->rowstride = (_mesa_format_row_stride(mt->mesaFormat, lvl->width) + row_align) & ~row_align; - lvl->size = lvl->rowstride * lvl->height * lvl->depth; + lvl->size = lvl->rowstride * height * lvl->depth; } assert(lvl->size > 0); @@ -110,7 +126,7 @@ static void compute_tex_image_offset(radeonContextPtr rmesa, radeon_mipmap_tree if (RADEON_DEBUG & RADEON_TEXTURE) fprintf(stderr, "level %d, face %d: rs:%d %dx%d at %d\n", - level, face, lvl->rowstride, lvl->width, lvl->height, lvl->faces[face].offset); + level, face, lvl->rowstride, lvl->width, height, lvl->faces[face].offset); } static GLuint minify(GLuint size, GLuint levels) -- cgit v1.2.3 From e4c5fe52c99bdf651aafa1569d9cf901891004d8 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 25 Nov 2009 20:23:22 +1000 Subject: radeon: fix context destroy needing lock for flushing. Thanks to Intel code which I've just stolen pretty much as usual. This fixes fdo bug 22851 which is a dri1 regression since rewrite. Tested by: fpiobaf (Fabio) on #radeon Signed-off-by: Dave Airlie --- src/mesa/drivers/dri/radeon/radeon_lock.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_lock.c b/src/mesa/drivers/dri/radeon/radeon_lock.c index 02de8e5fd1..7ad781ba61 100644 --- a/src/mesa/drivers/dri/radeon/radeon_lock.c +++ b/src/mesa/drivers/dri/radeon/radeon_lock.c @@ -62,8 +62,6 @@ void radeonGetLock(radeonContextPtr rmesa, GLuint flags) __DRIdrawablePrivate *const readable = radeon_get_readable(rmesa); __DRIscreenPrivate *sPriv = rmesa->dri.screen; - assert(drawable != NULL); - drmGetLock(rmesa->dri.fd, rmesa->dri.hwContext, flags); /* The window might have moved, so we might need to get new clip @@ -74,12 +72,13 @@ void radeonGetLock(radeonContextPtr rmesa, GLuint flags) * Since the hardware state depends on having the latest drawable * clip rects, all state checking must be done _after_ this call. */ - DRI_VALIDATE_DRAWABLE_INFO(sPriv, drawable); - if (drawable != readable) { + if (drawable) + DRI_VALIDATE_DRAWABLE_INFO(sPriv, drawable); + if (readable && drawable != readable) { DRI_VALIDATE_DRAWABLE_INFO(sPriv, readable); } - if (rmesa->lastStamp != drawable->lastStamp) { + if (drawable && (rmesa->lastStamp != drawable->lastStamp)) { radeon_window_moved(rmesa); rmesa->lastStamp = drawable->lastStamp; } -- cgit v1.2.3 From 0528f40e3b8ca3e59d3a641c4504d34cf9364578 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 25 Nov 2009 16:31:28 -0800 Subject: Improve implementation of GL_POINT_SPRITE_COORD_ORIGIN errors This enum is only supported for OpenGL 2.0. If a driver supports OpenGL 1.4 and GL_ARB_point_sprite, using this enum should generate an error. This is important because, for example, i915 and i830 can support GL_ARB_point_sprite, but they cannot support GL_POINT_SPRITE_COORD_ORIGIN. This commit just removes the check for NV_point_sprite, which is completely wrong, and add some comments describing what the code should do. I don't see an easy way to check for version >= 2.0 from inside Mesa. Perhaps we should add an extension GL_MESA_point_sprite_20 (like Intel's old GL_EXT_packed_pixels_12) to indicate that this added bit of functionality is available. Also note that glean's pointSprite test only checks for GL_ARB_point_sprite before trying to use GL_POINT_SPRITE_COORD_ORIGIN. Naturally, that fails on non-2.0 implementations (i.e., Mac OS X on GMA 950). --- src/mesa/main/points.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c index 4c8fc1f72e..b330544890 100644 --- a/src/mesa/main/points.c +++ b/src/mesa/main/points.c @@ -200,7 +200,12 @@ _mesa_PointParameterfv( GLenum pname, const GLfloat *params) } break; case GL_POINT_SPRITE_COORD_ORIGIN: - if (ctx->Extensions.ARB_point_sprite || ctx->Extensions.NV_point_sprite) { + /* This is not completely correct. GL_POINT_SPRITE_COORD_ORIGIN was + * added to point sprites when the extension was merged into OpenGL + * 2.0. It is expected that an implementation supporting OpenGL 1.4 + * and GL_ARB_point_sprite will generate an error here. + */ + if (ctx->Extensions.ARB_point_sprite) { GLenum value = (GLenum) params[0]; if (value != GL_LOWER_LEFT && value != GL_UPPER_LEFT) { _mesa_error(ctx, GL_INVALID_VALUE, -- cgit v1.2.3 From d509f84543d0979e9bb53c20c195f378dd61e728 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Thu, 26 Nov 2009 22:49:58 +0100 Subject: gallium: fix more statetrackers/drivers for not using texture width/height/depth arrays --- src/mesa/state_tracker/st_cb_fbo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 0469fb9978..659a6c9193 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -376,7 +376,7 @@ st_render_texture(GLcontext *ctx, rb->_BaseFormat = texImage->_BaseFormat; /*printf("***** render to texture level %d: %d x %d\n", att->TextureLevel, rb->Width, rb->Height);*/ - /*printf("***** pipe texture %d x %d\n", pt->width[0], pt->height[0]);*/ + /*printf("***** pipe texture %d x %d\n", pt->width0, pt->height0);*/ pipe_texture_reference( &strb->texture, pt ); -- cgit v1.2.3 From f62f976e3ff9ff83d760e706c615e098d131e103 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Fonseca?= Date: Fri, 27 Nov 2009 15:58:02 +0000 Subject: mesa: Avoid void pointer arithmetic. --- src/mesa/main/texgetimage.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c index 008407210d..23765d2753 100644 --- a/src/mesa/main/texgetimage.c +++ b/src/mesa/main/texgetimage.c @@ -554,7 +554,8 @@ _mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level, GLuint bw, bh; _mesa_get_format_block_size(texImage->TexFormat, &bw, &bh); for (i = 0; i < (texImage->Height + bh - 1) / bh; i++) { - memcpy(img + i * row_stride, texImage->Data + i * row_stride_stored, row_stride); + memcpy((GLubyte *)img + i * row_stride, + (GLubyte *)texImage->Data + i * row_stride_stored, row_stride); } } -- cgit v1.2.3 From e5159996a43d64f71d44dd2bd477d10e37ec9a27 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 28 Nov 2009 21:31:24 +0100 Subject: radeon: need to flush cs when moving images between mipmap trees --- src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c index 46603de2e7..94211048ae 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c @@ -594,6 +594,10 @@ int radeon_validate_texture_miptree(GLcontext * ctx, struct gl_texture_object *t if (RADEON_DEBUG & RADEON_TEXTURE) { fprintf(stderr, "MIGRATING\n"); } + struct radeon_bo *src_bo = (img->mt) ? img->mt->bo : img->bo; + if (src_bo && radeon_bo_is_referenced_by_cs(src_bo, rmesa->cmdbuf.cs)) { + radeon_firevertices(rmesa); + } migrate_image_to_miptree(dst_miptree, img, face, radeon_gl_level_to_miptree_level(texObj, level)); } else if (RADEON_DEBUG & RADEON_TEXTURE) { fprintf(stderr, "OK\n"); -- cgit v1.2.3 From a11d60d14caf8efc07f70af63b57b33273f8cf9b Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 28 Nov 2009 22:04:06 -0500 Subject: mesa: Fix array out-of-bounds access in _mesa_TexEnvf. _mesa_TexEnvf calls _mesa_TexEnvfv, which uses the param argument as an array. --- src/mesa/main/texenv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texenv.c b/src/mesa/main/texenv.c index 6d86a4275c..4442fb8cf8 100644 --- a/src/mesa/main/texenv.c +++ b/src/mesa/main/texenv.c @@ -598,7 +598,10 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) void GLAPIENTRY _mesa_TexEnvf( GLenum target, GLenum pname, GLfloat param ) { - _mesa_TexEnvfv( target, pname, ¶m ); + GLfloat p[4]; + p[0] = param; + p[1] = p[2] = p[3] = 0.0; + _mesa_TexEnvfv( target, pname, p ); } -- cgit v1.2.3 From 919898e92fa23ff71a59d86a46ff0886a6f34e4d Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 28 Nov 2009 23:22:31 -0500 Subject: dri: Fix potential null pointer dereference in driBindContext. --- src/mesa/drivers/dri/common/dri_util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index 439f66a7b8..da81ec9de5 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -167,11 +167,12 @@ static int driBindContext(__DRIcontext *pcp, __DRIdrawable *pdp, __DRIdrawable *prp) { - __DRIscreenPrivate *psp = pcp->driScreenPriv; + __DRIscreenPrivate *psp; /* Bind the drawable to the context */ if (pcp) { + psp = pcp->driScreenPriv; pcp->driDrawablePriv = pdp; pcp->driReadablePriv = prp; if (pdp) { -- cgit v1.2.3 From d55fb7c835b56951f05a058083e7eda264ba192e Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 28 Nov 2009 23:47:23 -0500 Subject: mesa: Fix array out-of-bounds access by _mesa_TexGeni. _mesa_TexGeni calls _mesa_TexGeniv, which uses the params argument as an array. --- src/mesa/main/texgen.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texgen.c b/src/mesa/main/texgen.c index 733e129fcf..087f66bbf3 100644 --- a/src/mesa/main/texgen.c +++ b/src/mesa/main/texgen.c @@ -218,7 +218,10 @@ _mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param ) void GLAPIENTRY _mesa_TexGeni( GLenum coord, GLenum pname, GLint param ) { - _mesa_TexGeniv( coord, pname, ¶m ); + GLint p[4]; + p[0] = param; + p[1] = p[2] = p[3] = 0; + _mesa_TexGeniv( coord, pname, p ); } -- cgit v1.2.3 From ca5a7aadb4361e7d053aea8687372cd44cbd8795 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sun, 29 Nov 2009 00:50:48 -0500 Subject: mesa: Fix array out-of-bounds access by _mesa_TexGenf. _mesa_TexGenf calls _mesa_TexGenfv, which uses the params argument as an array. --- src/mesa/main/texgen.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texgen.c b/src/mesa/main/texgen.c index 087f66bbf3..5abb1ff0ab 100644 --- a/src/mesa/main/texgen.c +++ b/src/mesa/main/texgen.c @@ -211,7 +211,10 @@ _mesa_TexGendv(GLenum coord, GLenum pname, const GLdouble *params ) static void GLAPIENTRY _mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param ) { - _mesa_TexGenfv(coord, pname, ¶m); + GLfloat p[4]; + p[0] = param; + p[1] = p[2] = p[3] = 0.0F; + _mesa_TexGenfv(coord, pname, p); } -- cgit v1.2.3 From e8f0c8ab9d3509dc399ea58c320056ed90895792 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sun, 29 Nov 2009 12:27:29 +0100 Subject: radeon: add some debugging info --- src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c | 5 +++++ src/mesa/drivers/dri/radeon/radeon_texture.c | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c index 94211048ae..d0b9691204 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c @@ -576,6 +576,11 @@ int radeon_validate_texture_miptree(GLcontext * ctx, struct gl_texture_object *t radeon_miptree_unreference(&t->mt); radeon_try_alloc_miptree(rmesa, t); dst_miptree = t->mt; + if (RADEON_DEBUG & RADEON_TEXTURE) { + fprintf(stderr, "%s: No matching miptree found, allocated new one %p\n", __FUNCTION__, t->mt); + } + } else if (RADEON_DEBUG & RADEON_TEXTURE) { + fprintf(stderr, "%s: Using miptree %p\n", __FUNCTION__, t->mt); } const unsigned faces = texObj->Target == GL_TEXTURE_CUBE_MAP ? 6 : 1; diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 1ee9e2792a..c715650d55 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -523,6 +523,11 @@ static void teximage_assign_miptree(radeonContextPtr rmesa, radeon_gl_level_to_miptree_level(texObj, level))) { radeon_miptree_unreference(&t->mt); radeon_try_alloc_miptree(rmesa, t); + if (RADEON_DEBUG & RADEON_TEXTURE) { + fprintf(stderr, "%s: texObj %p, texImage %p, face %d, level %d, " + "texObj miptree doesn't match, allocated new miptree %p\n", + __FUNCTION__, texObj, texImage, face, level, t->mt); + } } /* Miptree alocation may have failed, @@ -670,6 +675,11 @@ static void radeon_teximage( } } + if (RADEON_DEBUG & RADEON_TEXTURE) { + fprintf(stderr, "radeon_teximage%dd: texObj %p, texImage %p, face %d, level %d\n", + dims, texObj, texImage, face, level); + } + t->validated = GL_FALSE; if (ctx->_ImageTransferState & IMAGE_CONVOLUTION_BIT) { @@ -700,6 +710,11 @@ static void radeon_teximage( texImage->Height, texImage->Depth); texImage->Data = _mesa_alloc_texmemory(size); + if (RADEON_DEBUG & RADEON_TEXTURE) { + fprintf(stderr, "radeon_teximage%dd: texObj %p, texImage %p, " + " no miptree assigned, using local memory %p\n", + dims, texObj, texImage, texImage->Data); + } } } @@ -801,6 +816,11 @@ static void radeon_texsubimage(GLcontext* ctx, int dims, GLenum target, int leve } } + if (RADEON_DEBUG & RADEON_TEXTURE) { + fprintf(stderr, "radeon_texsubimage%dd: texObj %p, texImage %p, face %d, level %d\n", + dims, texObj, texImage, radeon_face_for_target(target), level); + } + t->validated = GL_FALSE; if (compressed) { pixels = _mesa_validate_pbo_compressed_teximage( -- cgit v1.2.3 From 2773556d55fe6043bee3d4c86f7b78906e5d60e0 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sun, 29 Nov 2009 12:36:09 +0100 Subject: radeon: don't check the same miptree many times when looking for matching miptrees --- src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c index d0b9691204..39b6d50094 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c @@ -506,7 +506,7 @@ static radeon_mipmap_tree * get_biggest_matching_miptree(radeonTexObj *texObj, if (!img) break; - if (!img->mt || !radeon_miptree_matches_texture(img->mt, &texObj->base)) + if (!img->mt) continue; for (int i = 0; i < mtCount; ++i) { @@ -517,8 +517,8 @@ static radeon_mipmap_tree * get_biggest_matching_miptree(radeonTexObj *texObj, } } - if (!found) { - mtSizes[mtCount] += img->mt->levels[img->mtlevel].size; + if (!found && radeon_miptree_matches_texture(img->mt, &texObj->base)) { + mtSizes[mtCount] = img->mt->levels[img->mtlevel].size; mts[mtCount] = img->mt; mtCount++; } -- cgit v1.2.3 From 63c00c53a3019b801c5eee8a12f7862422f79f10 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sun, 29 Nov 2009 15:40:13 +0100 Subject: radeon: update miptree code a little Simplify gl image level <-> miptree level mapping (are equal now). Don't allocate miptree for images that won't fit in it (fixes #25230). --- src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c | 70 +++++++++--------------- src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h | 10 ++-- src/mesa/drivers/dri/radeon/radeon_texture.c | 36 ++++++++++-- 3 files changed, 61 insertions(+), 55 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c index 39b6d50094..a9d601a0b5 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c @@ -124,20 +124,19 @@ static GLuint minify(GLuint size, GLuint levels) static void calculate_miptree_layout_r100(radeonContextPtr rmesa, radeon_mipmap_tree *mt) { - GLuint curOffset; - GLuint i; - GLuint face; + GLuint curOffset, i, face, level; assert(mt->numLevels <= rmesa->glCtx->Const.MaxTextureLevels); curOffset = 0; for(face = 0; face < mt->faces; face++) { - for(i = 0; i < mt->numLevels; i++) { - mt->levels[i].width = minify(mt->width0, i); - mt->levels[i].height = minify(mt->height0, i); - mt->levels[i].depth = minify(mt->depth0, i); - compute_tex_image_offset(rmesa, mt, face, i, &curOffset); + for(i = 0, level = mt->baseLevel; i < mt->numLevels; i++, level++) { + mt->levels[level].valid = 1; + mt->levels[level].width = minify(mt->width0, i); + mt->levels[level].height = minify(mt->height0, i); + mt->levels[level].depth = minify(mt->depth0, i); + compute_tex_image_offset(rmesa, mt, face, level, &curOffset); } } @@ -147,21 +146,21 @@ static void calculate_miptree_layout_r100(radeonContextPtr rmesa, radeon_mipmap_ static void calculate_miptree_layout_r300(radeonContextPtr rmesa, radeon_mipmap_tree *mt) { - GLuint curOffset; - GLuint i; + GLuint curOffset, i, level; assert(mt->numLevels <= rmesa->glCtx->Const.MaxTextureLevels); curOffset = 0; - for(i = 0; i < mt->numLevels; i++) { + for(i = 0, level = mt->baseLevel; i < mt->numLevels; i++, level++) { GLuint face; - mt->levels[i].width = minify(mt->width0, i); - mt->levels[i].height = minify(mt->height0, i); - mt->levels[i].depth = minify(mt->depth0, i); + mt->levels[level].valid = 1; + mt->levels[level].width = minify(mt->width0, i); + mt->levels[level].height = minify(mt->height0, i); + mt->levels[level].depth = minify(mt->depth0, i); for(face = 0; face < mt->faces; face++) - compute_tex_image_offset(rmesa, mt, face, i, &curOffset); + compute_tex_image_offset(rmesa, mt, face, level, &curOffset); } /* Note the required size in memory */ @@ -277,18 +276,19 @@ static void calculate_min_max_lod(struct gl_texture_object *tObj, * given face and level. */ GLboolean radeon_miptree_matches_image(radeon_mipmap_tree *mt, - struct gl_texture_image *texImage, GLuint face, GLuint mtLevel) + struct gl_texture_image *texImage, GLuint face, GLuint level) { radeon_mipmap_level *lvl; - if (face >= mt->faces || mtLevel > mt->numLevels) + if (face >= mt->faces) return GL_FALSE; if (texImage->TexFormat != mt->mesaFormat) return GL_FALSE; - lvl = &mt->levels[mtLevel]; - if (lvl->width != texImage->Width || + lvl = &mt->levels[level]; + if (!lvl->valid || + lvl->width != texImage->Width || lvl->height != texImage->Height || lvl->depth != texImage->Depth) return GL_FALSE; @@ -393,39 +393,18 @@ radeon_miptree_image_offset(radeon_mipmap_tree *mt, return mt->levels[level].faces[0].offset; } -/** - * Convert radeon miptree texture level to GL texture level - * @param[in] tObj texture object whom level is to be converted - * @param[in] level radeon miptree texture level - * @return GL texture level - */ -unsigned radeon_miptree_level_to_gl_level(struct gl_texture_object *tObj, unsigned level) -{ - return level + tObj->BaseLevel; -} - -/** - * Convert GL texture level to radeon miptree texture level - * @param[in] tObj texture object whom level is to be converted - * @param[in] level GL texture level - * @return radeon miptree texture level - */ -unsigned radeon_gl_level_to_miptree_level(struct gl_texture_object *tObj, unsigned level) -{ - return level - tObj->BaseLevel; -} - /** * Ensure that the given image is stored in the given miptree from now on. */ static void migrate_image_to_miptree(radeon_mipmap_tree *mt, radeon_texture_image *image, - int face, int mtLevel) + int face, int level) { - radeon_mipmap_level *dstlvl = &mt->levels[mtLevel]; + radeon_mipmap_level *dstlvl = &mt->levels[level]; unsigned char *dest; assert(image->mt != mt); + assert(dstlvl->valid); assert(dstlvl->width == image->base.Width); assert(dstlvl->height == image->base.Height); assert(dstlvl->depth == image->base.Depth); @@ -442,6 +421,7 @@ static void migrate_image_to_miptree(radeon_mipmap_tree *mt, radeon_mipmap_level *srclvl = &image->mt->levels[image->mtlevel]; + assert(image->mtlevel == level); assert(srclvl->size == dstlvl->size); assert(srclvl->rowstride == dstlvl->rowstride); @@ -479,7 +459,7 @@ static void migrate_image_to_miptree(radeon_mipmap_tree *mt, radeon_miptree_reference(mt, &image->mt); image->mtface = face; - image->mtlevel = mtLevel; + image->mtlevel = level; } /** @@ -603,7 +583,7 @@ int radeon_validate_texture_miptree(GLcontext * ctx, struct gl_texture_object *t if (src_bo && radeon_bo_is_referenced_by_cs(src_bo, rmesa->cmdbuf.cs)) { radeon_firevertices(rmesa); } - migrate_image_to_miptree(dst_miptree, img, face, radeon_gl_level_to_miptree_level(texObj, level)); + migrate_image_to_miptree(dst_miptree, img, face, level); } else if (RADEON_DEBUG & RADEON_TEXTURE) { fprintf(stderr, "OK\n"); } diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h index 28b8485095..a10649b5ae 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.h @@ -44,6 +44,7 @@ struct _radeon_mipmap_level { GLuint depth; GLuint size; /** Size of each image, in bytes */ GLuint rowstride; /** in bytes */ + GLuint valid; radeon_mipmap_image faces[6]; }; @@ -70,9 +71,9 @@ struct _radeon_mipmap_tree { GLuint baseLevel; /** gl_texture_object->baseLevel it was created for */ GLuint numLevels; /** Number of mip levels stored in this mipmap tree */ - GLuint width0; /** Width of firstLevel image */ - GLuint height0; /** Height of firstLevel image */ - GLuint depth0; /** Depth of firstLevel image */ + GLuint width0; /** Width of baseLevel image */ + GLuint height0; /** Height of baseLevel image */ + GLuint depth0; /** Depth of baseLevel image */ GLuint tilebits; /** RADEON_TXO_xxx_TILE */ @@ -89,8 +90,5 @@ GLuint radeon_miptree_image_offset(radeon_mipmap_tree *mt, GLuint face, GLuint level); void radeon_miptree_depth_offsets(radeon_mipmap_tree *mt, GLuint level, GLuint *offsets); -unsigned radeon_miptree_level_to_gl_level(struct gl_texture_object *tObj, unsigned level); -unsigned radeon_gl_level_to_miptree_level(struct gl_texture_object *tObj, unsigned level); - uint32_t get_base_teximage_offset(radeonTexObj *texObj); #endif /* __RADEON_MIPMAP_TREE_H_ */ diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index c715650d55..0390d376ba 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -509,6 +509,27 @@ gl_format radeonChooseTextureFormat(GLcontext * ctx, return MESA_FORMAT_NONE; /* never get here */ } +/** Check if given image is valid within current texture object. + */ +static int image_matches_texture_obj(struct gl_texture_object *texObj, + struct gl_texture_image *texImage, + unsigned level) +{ + const struct gl_texture_image *baseImage = texObj->Image[0][level]; + + if (level < texObj->BaseLevel || level > texObj->MaxLevel) + return 0; + + const unsigned levelDiff = level - texObj->BaseLevel; + const unsigned refWidth = baseImage->Width >> levelDiff; + const unsigned refHeight = baseImage->Height >> levelDiff; + const unsigned refDepth = baseImage->Depth >> levelDiff; + + return (texImage->Width == refWidth && + texImage->Height == refHeight && + texImage->Depth == refDepth); +} + static void teximage_assign_miptree(radeonContextPtr rmesa, struct gl_texture_object *texObj, struct gl_texture_image *texImage, @@ -518,9 +539,14 @@ static void teximage_assign_miptree(radeonContextPtr rmesa, radeonTexObj *t = radeon_tex_obj(texObj); radeon_texture_image* image = get_radeon_texture_image(texImage); + /* Since miptree holds only images for levels + * don't allocate the miptree if the teximage won't fit. + */ + if (!image_matches_texture_obj(texObj, texImage, level)) + return; + /* Try using current miptree, or create new if there isn't any */ - if (!t->mt || !radeon_miptree_matches_image(t->mt, texImage, face, - radeon_gl_level_to_miptree_level(texObj, level))) { + if (!t->mt || !radeon_miptree_matches_image(t->mt, texImage, face, level)) { radeon_miptree_unreference(&t->mt); radeon_try_alloc_miptree(rmesa, t); if (RADEON_DEBUG & RADEON_TEXTURE) { @@ -534,7 +560,7 @@ static void teximage_assign_miptree(radeonContextPtr rmesa, * when there was no image for baselevel specified */ if (t->mt) { image->mtface = face; - image->mtlevel = radeon_gl_level_to_miptree_level(texObj, level); + image->mtlevel = level; radeon_miptree_reference(t->mt, &image->mt); } } @@ -590,6 +616,8 @@ static void radeon_store_teximage(GLcontext* ctx, int dims, dstRowStride = _mesa_format_row_stride(texImage->TexFormat, texImage->Width); } + assert(dstRowStride); + if (dims == 3) { unsigned alignedWidth = dstRowStride/_mesa_get_format_bytes(texImage->TexFormat); dstImageOffsets = allocate_image_offsets(ctx, alignedWidth, texImage->Height, texImage->Depth); @@ -704,7 +732,7 @@ static void radeon_teximage( if (!t->bo) { teximage_assign_miptree(rmesa, texObj, texImage, face, level); - if (!t->mt) { + if (!image->mt) { int size = _mesa_format_image_size(texImage->TexFormat, texImage->Width, texImage->Height, -- cgit v1.2.3 From 2db72f329f35ee6e12df3ed472de2ee72cf23399 Mon Sep 17 00:00:00 2001 From: Richard Li Date: Sun, 29 Nov 2009 12:12:19 -0500 Subject: r600 : add read port allocation for uniform; mapping ps input based on vs output; fix bugs including constants updating for vs. --- src/mesa/drivers/dri/r600/r700_assembler.c | 46 +++++++++------- src/mesa/drivers/dri/r600/r700_fragprog.c | 85 +++++++++++++++++------------- src/mesa/drivers/dri/r600/r700_fragprog.h | 6 ++- src/mesa/drivers/dri/r600/r700_vertprog.c | 26 +++++++-- 4 files changed, 101 insertions(+), 62 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index ba97d3e073..309c90fdd0 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -1038,7 +1038,8 @@ GLboolean checkop2(r700_AssemblerBase* pAsm) checkop_init(pAsm); - if( (pILInst->SrcReg[0].File == PROGRAM_CONSTANT) || + if( (pILInst->SrcReg[0].File == PROGRAM_UNIFORM) || + (pILInst->SrcReg[0].File == PROGRAM_CONSTANT) || (pILInst->SrcReg[0].File == PROGRAM_LOCAL_PARAM) || (pILInst->SrcReg[0].File == PROGRAM_ENV_PARAM) || (pILInst->SrcReg[0].File == PROGRAM_STATE_VAR) ) @@ -1049,7 +1050,8 @@ GLboolean checkop2(r700_AssemblerBase* pAsm) { bSrcConst[0] = GL_FALSE; } - if( (pILInst->SrcReg[1].File == PROGRAM_CONSTANT) || + if( (pILInst->SrcReg[1].File == PROGRAM_UNIFORM) || + (pILInst->SrcReg[1].File == PROGRAM_CONSTANT) || (pILInst->SrcReg[1].File == PROGRAM_LOCAL_PARAM) || (pILInst->SrcReg[1].File == PROGRAM_ENV_PARAM) || (pILInst->SrcReg[1].File == PROGRAM_STATE_VAR) ) @@ -1082,7 +1084,8 @@ GLboolean checkop3(r700_AssemblerBase* pAsm) checkop_init(pAsm); - if( (pILInst->SrcReg[0].File == PROGRAM_CONSTANT) || + if( (pILInst->SrcReg[0].File == PROGRAM_UNIFORM) || + (pILInst->SrcReg[0].File == PROGRAM_CONSTANT) || (pILInst->SrcReg[0].File == PROGRAM_LOCAL_PARAM) || (pILInst->SrcReg[0].File == PROGRAM_ENV_PARAM) || (pILInst->SrcReg[0].File == PROGRAM_STATE_VAR) ) @@ -1093,7 +1096,8 @@ GLboolean checkop3(r700_AssemblerBase* pAsm) { bSrcConst[0] = GL_FALSE; } - if( (pILInst->SrcReg[1].File == PROGRAM_CONSTANT) || + if( (pILInst->SrcReg[1].File == PROGRAM_UNIFORM) || + (pILInst->SrcReg[1].File == PROGRAM_CONSTANT) || (pILInst->SrcReg[1].File == PROGRAM_LOCAL_PARAM) || (pILInst->SrcReg[1].File == PROGRAM_ENV_PARAM) || (pILInst->SrcReg[1].File == PROGRAM_STATE_VAR) ) @@ -1104,7 +1108,8 @@ GLboolean checkop3(r700_AssemblerBase* pAsm) { bSrcConst[1] = GL_FALSE; } - if( (pILInst->SrcReg[2].File == PROGRAM_CONSTANT) || + if( (pILInst->SrcReg[2].File == PROGRAM_UNIFORM) || + (pILInst->SrcReg[2].File == PROGRAM_CONSTANT) || (pILInst->SrcReg[2].File == PROGRAM_LOCAL_PARAM) || (pILInst->SrcReg[2].File == PROGRAM_ENV_PARAM) || (pILInst->SrcReg[2].File == PROGRAM_STATE_VAR) ) @@ -1218,7 +1223,7 @@ GLboolean assemble_src(r700_AssemblerBase *pAsm, pAsm->S[fld].src.reg = pILInst->SrcReg[src].Index; break; case PROGRAM_INPUT: - setaddrmode_PVSSRC(&(pAsm->S[fld].src), ADDR_ABSOLUTE); + setaddrmode_PVSSRC(&(pAsm->S[fld].src), ADDR_ABSOLUTE); pAsm->S[fld].src.rtype = SRC_REG_INPUT; switch (pAsm->currentShaderType) { @@ -1346,6 +1351,7 @@ GLboolean tex_src(r700_AssemblerBase *pAsm) else { switch (pILInst->SrcReg[0].File) { + case PROGRAM_UNIFORM: case PROGRAM_CONSTANT: case PROGRAM_LOCAL_PARAM: case PROGRAM_ENV_PARAM: @@ -2117,7 +2123,7 @@ GLboolean check_vector(r700_AssemblerBase* pAsm, if( is_gpr(sel) ) { if( GL_FALSE == cycle_for_vector_bank_swizzle(bank_swizzle, src, &cycle) ) - { + { return GL_FALSE; } @@ -2129,7 +2135,7 @@ GLboolean check_vector(r700_AssemblerBase* pAsm, else { if( GL_FALSE == reserve_gpr(pAsm, sel, chan, cycle) ) - { + { return GL_FALSE; } } @@ -2141,7 +2147,7 @@ GLboolean check_vector(r700_AssemblerBase* pAsm, if( is_cfile(sel) ) { if( GL_FALSE == reserve_cfile(pAsm, sel, chan) ) - { + { return GL_FALSE; } } @@ -2244,7 +2250,7 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) current_source_index, pcurrent_source, scalar_channel_index) ) - { + { return GL_FALSE; } @@ -2258,7 +2264,7 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) current_source_index, pcurrent_source, scalar_channel_index) ) - { + { return GL_FALSE; } } @@ -2287,7 +2293,7 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) alu_instruction_ptr->m_Word1.f.dst_gpr = pAsm->D.dst.reg; } else - { + { radeon_error("Only temp destination registers supported for ALU dest regs.\n"); return GL_FALSE; } @@ -2401,7 +2407,7 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) } if(GL_FALSE == add_alu_instruction(pAsm, alu_instruction_ptr, contiguous_slots_needed) ) - { + { return GL_FALSE; } @@ -2412,15 +2418,15 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) if (is_single_scalar_operation) { if(GL_FALSE == check_scalar(pAsm, alu_instruction_ptr) ) - { + { return GL_FALSE; } } else { if(GL_FALSE == check_vector(pAsm, alu_instruction_ptr) ) - { - return 1; + { + return GL_FALSE; } } @@ -2667,7 +2673,7 @@ GLboolean assemble_alu_instruction2(r700_AssemblerBase *pAsm) { if(GL_FALSE == check_vector(pAsm, alu_instruction_ptr) ) { - return 1; + return GL_FALSE; } } @@ -3642,6 +3648,7 @@ GLboolean assemble_LRP(r700_AssemblerBase *pAsm) { return GL_FALSE; } + if( GL_FALSE == assemble_src(pAsm, 2, -1) ) { return GL_FALSE; @@ -4598,6 +4605,7 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) switch (pAsm->pILInst[pAsm->uiCurInst].SrcReg[0].File) { + case PROGRAM_UNIFORM: case PROGRAM_CONSTANT: case PROGRAM_LOCAL_PARAM: case PROGRAM_ENV_PARAM: @@ -6867,7 +6875,7 @@ GLboolean Process_Vertex_Exports(r700_AssemblerBase *pR700AsmCode, export_starting_index++; } } - + for(i=VERT_RESULT_VAR0; iucVP_OutputMap[i], GL_FALSE) ) - { + { return GL_FALSE; } diff --git a/src/mesa/drivers/dri/r600/r700_fragprog.c b/src/mesa/drivers/dri/r600/r700_fragprog.c index 21ac46e7b8..e9ef6c8695 100644 --- a/src/mesa/drivers/dri/r600/r700_fragprog.c +++ b/src/mesa/drivers/dri/r600/r700_fragprog.c @@ -44,12 +44,18 @@ //TODO : Validate FP input with VP output. void Map_Fragment_Program(r700_AssemblerBase *pAsm, - struct gl_fragment_program *mesa_fp) + struct gl_fragment_program *mesa_fp, + GLcontext *ctx) { unsigned int unBit; unsigned int i; GLuint ui; + /* match fp inputs with vp exports. */ + struct r700_vertex_program_cont *vpc = + (struct r700_vertex_program_cont *)ctx->VertexProgram._Current; + GLbitfield OutputsWritten = vpc->mesa_program.Base.OutputsWritten; + pAsm->number_used_registers = 0; //Input mapping : mesa_fp->Base.InputsRead set the flag, set in @@ -61,41 +67,41 @@ void Map_Fragment_Program(r700_AssemblerBase *pAsm, pAsm->uiFP_AttributeMap[FRAG_ATTRIB_WPOS] = pAsm->number_used_registers++; } - unBit = 1 << FRAG_ATTRIB_COL0; - if(mesa_fp->Base.InputsRead & unBit) + unBit = 1 << VERT_RESULT_COL0; + if(OutputsWritten & unBit) { pAsm->uiFP_AttributeMap[FRAG_ATTRIB_COL0] = pAsm->number_used_registers++; } - unBit = 1 << FRAG_ATTRIB_COL1; - if(mesa_fp->Base.InputsRead & unBit) + unBit = 1 << VERT_RESULT_COL1; + if(OutputsWritten & unBit) { pAsm->uiFP_AttributeMap[FRAG_ATTRIB_COL1] = pAsm->number_used_registers++; } - unBit = 1 << FRAG_ATTRIB_FOGC; - if(mesa_fp->Base.InputsRead & unBit) + unBit = 1 << VERT_RESULT_FOGC; + if(OutputsWritten & unBit) { - pAsm->uiFP_AttributeMap[FRAG_ATTRIB_FOGC] = pAsm->number_used_registers++; + pAsm->uiFP_AttributeMap[FRAG_ATTRIB_FOGC] = pAsm->number_used_registers++; } for(i=0; i<8; i++) { - unBit = 1 << (FRAG_ATTRIB_TEX0 + i); - if(mesa_fp->Base.InputsRead & unBit) + unBit = 1 << (VERT_RESULT_TEX0 + i); + if(OutputsWritten & unBit) { pAsm->uiFP_AttributeMap[FRAG_ATTRIB_TEX0 + i] = pAsm->number_used_registers++; } } -/* order has been taken care of */ +/* order has been taken care of */ #if 1 - for(i=FRAG_ATTRIB_VAR0; iBase.InputsRead & unBit) + if(OutputsWritten & unBit) { - pAsm->uiFP_AttributeMap[i] = pAsm->number_used_registers++; + pAsm->uiFP_AttributeMap[i-VERT_RESULT_VAR0+FRAG_ATTRIB_VAR0] = pAsm->number_used_registers++; } } #else @@ -291,7 +297,8 @@ GLboolean Find_Instruction_Dependencies_fp(struct r700_fragment_program *fp, } GLboolean r700TranslateFragmentShader(struct r700_fragment_program *fp, - struct gl_fragment_program *mesa_fp) + struct gl_fragment_program *mesa_fp, + GLcontext *ctx) { GLuint number_of_colors_exported; GLboolean z_enabled = GL_FALSE; @@ -299,7 +306,7 @@ GLboolean r700TranslateFragmentShader(struct r700_fragment_program *fp, //Init_Program Init_r700_AssemblerBase( SPT_FP, &(fp->r700AsmCode), &(fp->r700Shader) ); - Map_Fragment_Program(&(fp->r700AsmCode), mesa_fp); + Map_Fragment_Program(&(fp->r700AsmCode), mesa_fp, ctx); if( GL_FALSE == Find_Instruction_Dependencies_fp(fp, mesa_fp) ) { @@ -366,7 +373,7 @@ void r700SelectFragmentShader(GLcontext *ctx) } if (GL_FALSE == fp->translated) - r700TranslateFragmentShader(fp, &(fp->mesa_program)); + r700TranslateFragmentShader(fp, &(fp->mesa_program), ctx); } void * r700GetActiveFpShaderBo(GLcontext * ctx) @@ -460,6 +467,9 @@ GLboolean r700SetupFragmentProgram(GLcontext * ctx) EXPORT_MODE_shift, EXPORT_MODE_mask); // emit ps input map + struct r700_vertex_program_cont *vpc = + (struct r700_vertex_program_cont *)ctx->VertexProgram._Current; + GLbitfield OutputsWritten = vpc->mesa_program.Base.OutputsWritten; unBit = 1 << FRAG_ATTRIB_WPOS; if(mesa_fp->Base.InputsRead & unBit) { @@ -473,8 +483,8 @@ GLboolean r700SetupFragmentProgram(GLcontext * ctx) CLEARbit(r700->SPI_PS_INPUT_CNTL[ui].u32All, FLAT_SHADE_bit); } - unBit = 1 << FRAG_ATTRIB_COL0; - if(mesa_fp->Base.InputsRead & unBit) + unBit = 1 << VERT_RESULT_COL0; + if(OutputsWritten & unBit) { ui = pAsm->uiFP_AttributeMap[FRAG_ATTRIB_COL0]; SETbit(r700->SPI_PS_INPUT_CNTL[ui].u32All, SEL_CENTROID_bit); @@ -486,8 +496,8 @@ GLboolean r700SetupFragmentProgram(GLcontext * ctx) CLEARbit(r700->SPI_PS_INPUT_CNTL[ui].u32All, FLAT_SHADE_bit); } - unBit = 1 << FRAG_ATTRIB_COL1; - if(mesa_fp->Base.InputsRead & unBit) + unBit = 1 << VERT_RESULT_COL1; + if(OutputsWritten & unBit) { ui = pAsm->uiFP_AttributeMap[FRAG_ATTRIB_COL1]; SETbit(r700->SPI_PS_INPUT_CNTL[ui].u32All, SEL_CENTROID_bit); @@ -499,8 +509,8 @@ GLboolean r700SetupFragmentProgram(GLcontext * ctx) CLEARbit(r700->SPI_PS_INPUT_CNTL[ui].u32All, FLAT_SHADE_bit); } - unBit = 1 << FRAG_ATTRIB_FOGC; - if(mesa_fp->Base.InputsRead & unBit) + unBit = 1 << VERT_RESULT_FOGC; + if(OutputsWritten & unBit) { ui = pAsm->uiFP_AttributeMap[FRAG_ATTRIB_FOGC]; SETbit(r700->SPI_PS_INPUT_CNTL[ui].u32All, SEL_CENTROID_bit); @@ -514,8 +524,8 @@ GLboolean r700SetupFragmentProgram(GLcontext * ctx) for(i=0; i<8; i++) { - unBit = 1 << (FRAG_ATTRIB_TEX0 + i); - if(mesa_fp->Base.InputsRead & unBit) + unBit = 1 << (VERT_RESULT_TEX0 + i); + if(OutputsWritten & unBit) { ui = pAsm->uiFP_AttributeMap[FRAG_ATTRIB_TEX0 + i]; SETbit(r700->SPI_PS_INPUT_CNTL[ui].u32All, SEL_CENTROID_bit); @@ -525,12 +535,12 @@ GLboolean r700SetupFragmentProgram(GLcontext * ctx) } } - for(i=FRAG_ATTRIB_VAR0; iBase.InputsRead & unBit) + unBit = 1 << i; + if(OutputsWritten & unBit) { - ui = pAsm->uiFP_AttributeMap[i]; + ui = pAsm->uiFP_AttributeMap[i-VERT_RESULT_VAR0+FRAG_ATTRIB_VAR0]; SETbit(r700->SPI_PS_INPUT_CNTL[ui].u32All, SEL_CENTROID_bit); SETfield(r700->SPI_PS_INPUT_CNTL[ui].u32All, ui, SEMANTIC_shift, SEMANTIC_mask); @@ -538,8 +548,8 @@ GLboolean r700SetupFragmentProgram(GLcontext * ctx) SETbit(r700->SPI_PS_INPUT_CNTL[ui].u32All, FLAT_SHADE_bit); else CLEARbit(r700->SPI_PS_INPUT_CNTL[ui].u32All, FLAT_SHADE_bit); - } - } + } + } exportCount = (r700->ps.SQ_PGM_EXPORTS_PS.u32All & EXPORT_MODE_mask) / (1 << EXPORT_MODE_shift); if (r700->CB_SHADER_CONTROL.u32All != ((1 << exportCount) - 1)) @@ -551,7 +561,8 @@ GLboolean r700SetupFragmentProgram(GLcontext * ctx) /* sent out shader constants. */ paramList = fp->mesa_program.Base.Parameters; - if(NULL != paramList) { + if(NULL != paramList) + { _mesa_load_state_parameters(ctx, paramList); if (paramList->NumParameters > R700_MAX_DX9_CONSTS) @@ -564,10 +575,10 @@ GLboolean r700SetupFragmentProgram(GLcontext * ctx) unNumParamData = paramList->NumParameters; for(ui=0; uips.consts[ui][0].f32All = paramList->ParameterValues[ui][0]; - r700->ps.consts[ui][1].f32All = paramList->ParameterValues[ui][1]; - r700->ps.consts[ui][2].f32All = paramList->ParameterValues[ui][2]; - r700->ps.consts[ui][3].f32All = paramList->ParameterValues[ui][3]; + r700->ps.consts[ui][0].f32All = paramList->ParameterValues[ui][0]; + r700->ps.consts[ui][1].f32All = paramList->ParameterValues[ui][1]; + r700->ps.consts[ui][2].f32All = paramList->ParameterValues[ui][2]; + r700->ps.consts[ui][3].f32All = paramList->ParameterValues[ui][3]; } } else r700->ps.num_consts = 0; diff --git a/src/mesa/drivers/dri/r600/r700_fragprog.h b/src/mesa/drivers/dri/r600/r700_fragprog.h index cbb108d212..843de2c029 100644 --- a/src/mesa/drivers/dri/r600/r700_fragprog.h +++ b/src/mesa/drivers/dri/r600/r700_fragprog.h @@ -49,12 +49,14 @@ struct r700_fragment_program /* Internal */ void Map_Fragment_Program(r700_AssemblerBase *pAsm, - struct gl_fragment_program *mesa_fp); + struct gl_fragment_program *mesa_fp, + GLcontext *ctx); //richard glsl nov.27 GLboolean Find_Instruction_Dependencies_fp(struct r700_fragment_program *fp, struct gl_fragment_program *mesa_fp); GLboolean r700TranslateFragmentShader(struct r700_fragment_program *fp, - struct gl_fragment_program *mesa_vp); + struct gl_fragment_program *mesa_vp, + GLcontext *ctx); //richard glsl nov.27 /* Interface */ extern void r700SelectFragmentShader(GLcontext *ctx); diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.c b/src/mesa/drivers/dri/r600/r700_vertprog.c index c8f72d588b..7715214da1 100644 --- a/src/mesa/drivers/dri/r600/r700_vertprog.c +++ b/src/mesa/drivers/dri/r600/r700_vertprog.c @@ -631,6 +631,14 @@ GLboolean r700SetupVertexProgram(GLcontext * ctx) paramList = vp->mesa_program->Base.Parameters; if(NULL != paramList) { + //vp->mesa_program was cloned, not updated by glsl shader api. + //_mesa_reference_program has already checked glsl shProg is ok and set ctx->VertexProgem._Current + // so, use ctx->VertexProgem._Current + struct gl_program_parameter_list *paramListOrginal = + paramListOrginal = ctx->VertexProgram._Current->Base.Parameters; + + //--------------------------- + _mesa_load_state_parameters(ctx, paramList); if (paramList->NumParameters > R700_MAX_DX9_CONSTS) @@ -643,10 +651,20 @@ GLboolean r700SetupVertexProgram(GLcontext * ctx) unNumParamData = paramList->NumParameters; for(ui=0; uivs.consts[ui][0].f32All = paramList->ParameterValues[ui][0]; - r700->vs.consts[ui][1].f32All = paramList->ParameterValues[ui][1]; - r700->vs.consts[ui][2].f32All = paramList->ParameterValues[ui][2]; - r700->vs.consts[ui][3].f32All = paramList->ParameterValues[ui][3]; + if(paramList->Parameters[ui].Type == PROGRAM_UNIFORM) + { + r700->vs.consts[ui][0].f32All = paramListOrginal->ParameterValues[ui][0]; + r700->vs.consts[ui][1].f32All = paramListOrginal->ParameterValues[ui][1]; + r700->vs.consts[ui][2].f32All = paramListOrginal->ParameterValues[ui][2]; + r700->vs.consts[ui][3].f32All = paramListOrginal->ParameterValues[ui][3]; + } + else + { + r700->vs.consts[ui][0].f32All = paramList->ParameterValues[ui][0]; + r700->vs.consts[ui][1].f32All = paramList->ParameterValues[ui][1]; + r700->vs.consts[ui][2].f32All = paramList->ParameterValues[ui][2]; + r700->vs.consts[ui][3].f32All = paramList->ParameterValues[ui][3]; + } } } else r700->vs.num_consts = 0; -- cgit v1.2.3 From a1b9c4e22a83d2125f66c3a3af3143bc0daee9a4 Mon Sep 17 00:00:00 2001 From: Richard Li Date: Sun, 29 Nov 2009 12:28:32 -0500 Subject: r600 : clena up a bit for last commit. --- src/mesa/drivers/dri/r600/r700_fragprog.h | 4 ++-- src/mesa/drivers/dri/r600/r700_vertprog.c | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_fragprog.h b/src/mesa/drivers/dri/r600/r700_fragprog.h index 843de2c029..e562bfa478 100644 --- a/src/mesa/drivers/dri/r600/r700_fragprog.h +++ b/src/mesa/drivers/dri/r600/r700_fragprog.h @@ -50,13 +50,13 @@ struct r700_fragment_program /* Internal */ void Map_Fragment_Program(r700_AssemblerBase *pAsm, struct gl_fragment_program *mesa_fp, - GLcontext *ctx); //richard glsl nov.27 + GLcontext *ctx); GLboolean Find_Instruction_Dependencies_fp(struct r700_fragment_program *fp, struct gl_fragment_program *mesa_fp); GLboolean r700TranslateFragmentShader(struct r700_fragment_program *fp, struct gl_fragment_program *mesa_vp, - GLcontext *ctx); //richard glsl nov.27 + GLcontext *ctx); /* Interface */ extern void r700SelectFragmentShader(GLcontext *ctx); diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.c b/src/mesa/drivers/dri/r600/r700_vertprog.c index 7715214da1..d3d1da7959 100644 --- a/src/mesa/drivers/dri/r600/r700_vertprog.c +++ b/src/mesa/drivers/dri/r600/r700_vertprog.c @@ -631,14 +631,12 @@ GLboolean r700SetupVertexProgram(GLcontext * ctx) paramList = vp->mesa_program->Base.Parameters; if(NULL != paramList) { - //vp->mesa_program was cloned, not updated by glsl shader api. - //_mesa_reference_program has already checked glsl shProg is ok and set ctx->VertexProgem._Current - // so, use ctx->VertexProgem._Current + /* vp->mesa_program was cloned, not updated by glsl shader api. */ + /* _mesa_reference_program has already checked glsl shProg is ok and set ctx->VertexProgem._Current */ + /* so, use ctx->VertexProgem._Current */ struct gl_program_parameter_list *paramListOrginal = paramListOrginal = ctx->VertexProgram._Current->Base.Parameters; - - //--------------------------- - + _mesa_load_state_parameters(ctx, paramList); if (paramList->NumParameters > R700_MAX_DX9_CONSTS) -- cgit v1.2.3 From a201dfb6bf28b89d6f511c2ec9ae0d81ef18511d Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sun, 29 Nov 2009 18:18:23 -0500 Subject: mesa: Fix array out-of-bounds access by _mesa_TexParameterf. _mesa_TexParameterf calls set_tex_parameteri, which uses the params argument as an array. --- src/mesa/main/texparam.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index ab170cde35..032c22b252 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -547,8 +547,10 @@ _mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param) case GL_DEPTH_TEXTURE_MODE_ARB: { /* convert float param to int */ - GLint p = (GLint) param; - need_update = set_tex_parameteri(ctx, texObj, pname, &p); + GLint p[4]; + p[0] = (GLint) param; + p[1] = p[2] = p[3] = 0; + need_update = set_tex_parameteri(ctx, texObj, pname, p); } break; default: -- cgit v1.2.3 From d8d49716cf5d5cabebadc32d7717eec787c75ff1 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Sun, 29 Nov 2009 17:40:02 -0800 Subject: i915: Enable point sprite coordinate generation Support still isn't completely correct, but it's better. piglit point-sprite now passes. However, glean's pointSprite test fails. In that test the texture on the sprite is somehow inverted as though GL_POINT_SPRITE_COORD_ORIGIN were set to GL_LOWER_LEFT. i915 hardware shouldn't be able to do that! I believe there are also problems when not all texture units have GL_COORD_REPLACE set. The hardware enable seems to be all or nothing. Fixes bug #25313. --- src/mesa/drivers/dri/i915/i915_state.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c index b60efea75b..1ec84ef116 100644 --- a/src/mesa/drivers/dri/i915/i915_state.c +++ b/src/mesa/drivers/dri/i915/i915_state.c @@ -599,6 +599,24 @@ i915PointSize(GLcontext * ctx, GLfloat size) } +static void +i915PointParameterfv(GLcontext * ctx, GLenum pname, const GLfloat *params) +{ + struct i915_context *i915 = I915_CONTEXT(ctx); + + switch (pname) { + case GL_POINT_SPRITE_COORD_ORIGIN: + /* This could be supported, but it would require modifying the fragment + * program to invert the y component of the texture coordinate by + * inserting a 'SUB tc.y, {1.0}.xxxx, tc' instruction. + */ + FALLBACK(&i915->intel, I915_FALLBACK_POINT_SPRITE_COORD_ORIGIN, + (params[0] != GL_UPPER_LEFT)); + break; + } +} + + /* ============================================================= * Color masks */ @@ -939,6 +957,17 @@ i915Enable(GLcontext * ctx, GLenum cap, GLboolean state) case GL_POLYGON_SMOOTH: break; + case GL_POINT_SPRITE: + /* This state change is handled in i915_reduced_primitive_state because + * the hardware bit should only be set when rendering points. + */ + I915_STATECHANGE(i915, I915_UPLOAD_CTX); + if (state) + i915->state.Ctx[I915_CTXREG_LIS4] |= S4_SPRITE_POINT_ENABLE; + else + i915->state.Ctx[I915_CTXREG_LIS4] &= ~S4_SPRITE_POINT_ENABLE; + break; + case GL_POINT_SMOOTH: break; -- cgit v1.2.3 From 718f31b830b2c4edad8b7e04804ff23e1db93e5a Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Sun, 29 Nov 2009 17:43:38 -0800 Subject: i915: Round point sizes instead of truncate. --- src/mesa/drivers/dri/i915/i915_state.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c index 1ec84ef116..86f37379dc 100644 --- a/src/mesa/drivers/dri/i915/i915_state.c +++ b/src/mesa/drivers/dri/i915/i915_state.c @@ -585,7 +585,7 @@ i915PointSize(GLcontext * ctx, GLfloat size) { struct i915_context *i915 = I915_CONTEXT(ctx); int lis4 = i915->state.Ctx[I915_CTXREG_LIS4] & ~S4_POINT_WIDTH_MASK; - GLint point_size = (int) size; + GLint point_size = (int) round(size); DBG("%s\n", __FUNCTION__); -- cgit v1.2.3 From 533b7660073f2c1cd1a19105d4989ec11bfdcd87 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Sun, 29 Nov 2009 17:49:55 -0800 Subject: i915: Fallback bit define missed on previous commit --- src/mesa/drivers/dri/i915/i915_context.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i915_context.h b/src/mesa/drivers/dri/i915/i915_context.h index 8de4a9d0d3..90e698bacf 100644 --- a/src/mesa/drivers/dri/i915/i915_context.h +++ b/src/mesa/drivers/dri/i915/i915_context.h @@ -39,6 +39,7 @@ #define I915_FALLBACK_LOGICOP 0x20000 #define I915_FALLBACK_POLYGON_SMOOTH 0x40000 #define I915_FALLBACK_POINT_SMOOTH 0x80000 +#define I915_FALLBACK_POINT_SPRITE_COORD_ORIGIN 0x100000 #define I915_UPLOAD_CTX 0x1 #define I915_UPLOAD_BUFFERS 0x2 -- cgit v1.2.3 From 270d36da146b899d39e08f830fe34b63833a3731 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sun, 29 Nov 2009 21:17:44 -0500 Subject: mesa: Fix array out-of-bounds access by _mesa_TexParameterf. _mesa_TexParameterf calls set_tex_parameterf, which uses the params argument as an array. --- src/mesa/main/texparam.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 032c22b252..310d594cd5 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -554,8 +554,13 @@ _mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param) } break; default: - /* this will generate an error if pname is illegal */ - need_update = set_tex_parameterf(ctx, texObj, pname, ¶m); + { + /* this will generate an error if pname is illegal */ + GLfloat p[4]; + p[0] = param; + p[1] = p[2] = p[3] = 0.0F; + need_update = set_tex_parameterf(ctx, texObj, pname, p); + } } if (ctx->Driver.TexParameter && need_update) { -- cgit v1.2.3 From 7725744433827509d1da1cf1b27cda4bc8012ef3 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 30 Nov 2009 08:56:47 -0700 Subject: st/mesa: handle front/back-face +1/-1 vs. 1/0 conversion Fixes progs/glsl/twoside.c demo. --- src/mesa/state_tracker/st_mesa_to_tgsi.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c index d84832f539..5e8e61135e 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -675,6 +675,31 @@ emit_inverted_wpos( struct st_translate *t, } +/** + * OpenGL's fragment gl_FrontFace input is 1 for front-facing, 0 for back. + * TGSI uses +1 for front, -1 for back. + * This function converts the TGSI value to the GL value. Simply clamping/ + * saturating the value to [0,1] does the job. + */ +static void +emit_face_var( struct st_translate *t, + const struct gl_program *program ) +{ + struct ureg_program *ureg = t->ureg; + struct ureg_dst face_temp = ureg_DECL_temporary( ureg ); + struct ureg_src face_input = t->inputs[t->inputMapping[FRAG_ATTRIB_FACE]]; + + /* MOV_SAT face_temp, input[face] + */ + face_temp = ureg_saturate( face_temp ); + ureg_MOV( ureg, face_temp, face_input ); + + /* Use face_temp as face input from here on: + */ + t->inputs[t->inputMapping[FRAG_ATTRIB_FACE]] = ureg_src(face_temp); +} + + /** * Translate Mesa program to TGSI format. * \param program the program to translate @@ -746,6 +771,10 @@ st_translate_mesa_program( emit_inverted_wpos( t, program ); } + if (program->InputsRead & FRAG_BIT_FACE) { + emit_face_var( t, program ); + } + /* * Declare output attributes. */ -- cgit v1.2.3 From ac400ffce62be47fc77e8d10cabcd39b92b6c627 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 30 Nov 2009 20:29:18 +0100 Subject: gallium: interface cleanups, remove nblocksx/y from pipe_texture and more This patch removes nblocksx, nblocksy arrays from pipe_texture (can be recalculated if needed). Furthermore, pipe_format_block struct is gone completely (again, contains just derived state). nblocksx, nblocksy, block are also removed from pipe_transfer, together with the format enum (can be obtained from the texture associated with the transfer). --- src/mesa/state_tracker/st_cb_drawpixels.c | 8 ++++---- src/mesa/state_tracker/st_cb_fbo.c | 7 ++----- src/mesa/state_tracker/st_cb_readpixels.c | 14 ++++++------- src/mesa/state_tracker/st_cb_texture.c | 33 ++++++++++++++----------------- src/mesa/state_tracker/st_gen_mipmap.c | 4 ++-- src/mesa/state_tracker/st_texture.c | 4 ++-- 6 files changed, 32 insertions(+), 38 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index a68a29e126..a15043da78 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -701,7 +701,7 @@ draw_stencil_pixels(GLcontext *ctx, GLint x, GLint y, } /* now pack the stencil (and Z) values in the dest format */ - switch (pt->format) { + switch (pt->texture->format) { case PIPE_FORMAT_S8_UNORM: { ubyte *dest = stmap + spanY * pt->stride + spanX; @@ -856,8 +856,8 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy, usage, dstx, dsty, width, height); - assert(ptDraw->block.width == 1); - assert(ptDraw->block.height == 1); + assert(pf_get_blockwidth(ptDraw->texture->format) == 1); + assert(pf_get_blockheight(ptDraw->texture->format) == 1); /* map the stencil buffer */ drawMap = screen->transfer_map(screen, ptDraw); @@ -878,7 +878,7 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy, dst = drawMap + y * ptDraw->stride; src = buffer + i * width; - switch (ptDraw->format) { + switch (ptDraw->texture->format) { case PIPE_FORMAT_S8Z24_UNORM: { uint *dst4 = (uint *) dst; diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 659a6c9193..ead8e22888 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -98,16 +98,14 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb, strb->defined = GL_FALSE; /* undefined contents now */ if(strb->software) { - struct pipe_format_block block; size_t size; _mesa_free(strb->data); assert(strb->format != PIPE_FORMAT_NONE); - pf_get_block(strb->format, &block); - strb->stride = pf_get_stride(&block, width); - size = pf_get_2d_size(&block, strb->stride, height); + strb->stride = pf_get_stride(strb->format, width); + size = pf_get_2d_size(strb->format, strb->stride, height); strb->data = _mesa_malloc(size); @@ -127,7 +125,6 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb, memset(&template, 0, sizeof(template)); template.target = PIPE_TEXTURE_2D; template.format = format; - pf_get_block(format, &template.block); template.width0 = width; template.height0 = height; template.depth0 = 1; diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c index 103861d6f9..6fa7bb64f2 100644 --- a/src/mesa/state_tracker/st_cb_readpixels.c +++ b/src/mesa/state_tracker/st_cb_readpixels.c @@ -103,7 +103,7 @@ st_read_stencil_pixels(GLcontext *ctx, GLint x, GLint y, } /* get stencil (and Z) values */ - switch (pt->format) { + switch (pt->texture->format) { case PIPE_FORMAT_S8_UNORM: { const ubyte *src = stmap + srcY * pt->stride; @@ -431,8 +431,8 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, const GLint dstStride = _mesa_image_row_stride(&clippedPacking, width, format, type); - if (trans->format == PIPE_FORMAT_S8Z24_UNORM || - trans->format == PIPE_FORMAT_X8Z24_UNORM) { + if (trans->texture->format == PIPE_FORMAT_S8Z24_UNORM || + trans->texture->format == PIPE_FORMAT_X8Z24_UNORM) { if (format == GL_DEPTH_COMPONENT) { for (i = 0; i < height; i++) { GLuint ztemp[MAX_WIDTH]; @@ -463,8 +463,8 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, } } } - else if (trans->format == PIPE_FORMAT_Z24S8_UNORM || - trans->format == PIPE_FORMAT_Z24X8_UNORM) { + else if (trans->texture->format == PIPE_FORMAT_Z24S8_UNORM || + trans->texture->format == PIPE_FORMAT_Z24X8_UNORM) { if (format == GL_DEPTH_COMPONENT) { for (i = 0; i < height; i++) { GLuint ztemp[MAX_WIDTH]; @@ -490,7 +490,7 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, } } } - else if (trans->format == PIPE_FORMAT_Z16_UNORM) { + else if (trans->texture->format == PIPE_FORMAT_Z16_UNORM) { for (i = 0; i < height; i++) { GLushort ztemp[MAX_WIDTH]; GLfloat zfloat[MAX_WIDTH]; @@ -505,7 +505,7 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, dst += dstStride; } } - else if (trans->format == PIPE_FORMAT_Z32_UNORM) { + else if (trans->texture->format == PIPE_FORMAT_Z32_UNORM) { for (i = 0; i < height; i++) { GLuint ztemp[MAX_WIDTH]; GLfloat zfloat[MAX_WIDTH]; diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 3a2337802f..6d136f5abf 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -405,7 +405,6 @@ compress_with_blit(GLcontext * ctx, memset(&templ, 0, sizeof(templ)); templ.target = PIPE_TEXTURE_2D; templ.format = st_mesa_format_to_pipe_format(mesa_format); - pf_get_block(templ.format, &templ.block); templ.width0 = width; templ.height0 = height; templ.depth0 = 1; @@ -833,7 +832,7 @@ decompress_with_blit(GLcontext * ctx, GLenum target, GLint level, /* copy/pack data into user buffer */ if (st_equal_formats(stImage->pt->format, format, type)) { /* memcpy */ - const uint bytesPerRow = width * pf_get_size(stImage->pt->format); + const uint bytesPerRow = width * pf_get_blocksize(stImage->pt->format); ubyte *map = screen->transfer_map(screen, tex_xfer); GLuint row; for (row = 0; row < height; row++) { @@ -915,7 +914,7 @@ st_get_tex_image(GLcontext * ctx, GLenum target, GLint level, PIPE_TRANSFER_READ, 0, 0, stImage->base.Width, stImage->base.Height); - texImage->RowStride = stImage->transfer->stride / stImage->pt->block.size; + texImage->RowStride = stImage->transfer->stride / pf_get_blocksize(stImage->pt->format); } else { /* Otherwise, the image should actually be stored in @@ -1163,10 +1162,10 @@ st_CompressedTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_image *texImage) { struct st_texture_image *stImage = st_texture_image(texImage); - struct pipe_format_block block; int srcBlockStride; int dstBlockStride; int y; + enum pipe_format pformat= stImage->pt->format; if (stImage->pt) { unsigned face = _mesa_tex_target_to_face(target); @@ -1178,8 +1177,7 @@ st_CompressedTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, xoffset, yoffset, width, height); - block = stImage->pt->block; - srcBlockStride = pf_get_stride(&block, width); + srcBlockStride = pf_get_stride(pformat, width); dstBlockStride = stImage->transfer->stride; } else { assert(stImage->pt); @@ -1193,16 +1191,16 @@ st_CompressedTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, return; } - assert(xoffset % block.width == 0); - assert(yoffset % block.height == 0); - assert(width % block.width == 0); - assert(height % block.height == 0); + assert(xoffset % pf_get_blockwidth(pformat) == 0); + assert(yoffset % pf_get_blockheight(pformat) == 0); + assert(width % pf_get_blockwidth(pformat) == 0); + assert(height % pf_get_blockheight(pformat) == 0); - for (y = 0; y < height; y += block.height) { + for (y = 0; y < height; y += pf_get_blockheight(pformat)) { /* don't need to adjust for xoffset and yoffset as st_texture_image_map does that */ - const char *src = (const char*)data + srcBlockStride * pf_get_nblocksy(&block, y); - char *dst = (char*)texImage->Data + dstBlockStride * pf_get_nblocksy(&block, y); - memcpy(dst, src, pf_get_stride(&block, width)); + const char *src = (const char*)data + srcBlockStride * pf_get_nblocksy(pformat, y); + char *dst = (char*)texImage->Data + dstBlockStride * pf_get_nblocksy(pformat, y); + memcpy(dst, src, pf_get_stride(pformat, width)); } if (stImage->pt) { @@ -1692,10 +1690,10 @@ copy_image_data_to_texture(struct st_context *st, dstLevel, stImage->base.Data, stImage->base.RowStride * - stObj->pt->block.size, + pf_get_blocksize(stObj->pt->format), stImage->base.RowStride * stImage->base.Height * - stObj->pt->block.size); + pf_get_blocksize(stObj->pt->format)); _mesa_align_free(stImage->base.Data); stImage->base.Data = NULL; } @@ -1763,8 +1761,7 @@ st_finalize_texture(GLcontext *ctx, stObj->pt->last_level < stObj->lastLevel || stObj->pt->width0 != firstImage->base.Width2 || stObj->pt->height0 != firstImage->base.Height2 || - stObj->pt->depth0 != firstImage->base.Depth2 || - stObj->pt->block.size != blockSize) + stObj->pt->depth0 != firstImage->base.Depth2) { pipe_texture_reference(&stObj->pt, NULL); ctx->st->dirty.st |= ST_NEW_FRAMEBUFFER; diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c index f8068fa12b..7700551830 100644 --- a/src/mesa/state_tracker/st_gen_mipmap.c +++ b/src/mesa/state_tracker/st_gen_mipmap.c @@ -146,8 +146,8 @@ fallback_generate_mipmap(GLcontext *ctx, GLenum target, srcData = (ubyte *) screen->transfer_map(screen, srcTrans); dstData = (ubyte *) screen->transfer_map(screen, dstTrans); - srcStride = srcTrans->stride / srcTrans->block.size; - dstStride = dstTrans->stride / dstTrans->block.size; + srcStride = srcTrans->stride / pf_get_blocksize(srcTrans->texture->format); + dstStride = dstTrans->stride / pf_get_blocksize(dstTrans->texture->format); _mesa_generate_mipmap_level(target, datatype, comps, 0 /*border*/, diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c index dbccee86c1..3035d78b61 100644 --- a/src/mesa/state_tracker/st_texture.c +++ b/src/mesa/state_tracker/st_texture.c @@ -104,7 +104,6 @@ st_texture_create(struct st_context *st, pt.width0 = width0; pt.height0 = height0; pt.depth0 = depth0; - pf_get_block(format, &pt.block); pt.tex_usage = usage; newtex = screen->texture_create(screen, &pt); @@ -242,8 +241,9 @@ st_surface_data(struct pipe_context *pipe, struct pipe_screen *screen = pipe->screen; void *map = screen->transfer_map(screen, dst); + assert(dst->texture); util_copy_rect(map, - &dst->block, + dst->texture->format, dst->stride, dstx, dsty, width, height, -- cgit v1.2.3 From 587a52e95bbe96788e8b96b63f091bb3022fc048 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 30 Nov 2009 12:43:12 -0800 Subject: i915: Actually put i915PointParameterfv in the driver function table. Duh. --- src/mesa/drivers/dri/i915/i915_state.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i915_state.c b/src/mesa/drivers/dri/i915/i915_state.c index 86f37379dc..cc98d125db 100644 --- a/src/mesa/drivers/dri/i915/i915_state.c +++ b/src/mesa/drivers/dri/i915/i915_state.c @@ -1137,6 +1137,7 @@ i915InitStateFunctions(struct dd_function_table *functions) functions->LineWidth = i915LineWidth; functions->LogicOpcode = i915LogicOp; functions->PointSize = i915PointSize; + functions->PointParameterfv = i915PointParameterfv; functions->PolygonStipple = i915PolygonStipple; functions->Scissor = i915Scissor; functions->ShadeModel = i915ShadeModel; -- cgit v1.2.3 From 910aaed4daad319b584b68ae2468432c8f6bac21 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 30 Nov 2009 17:55:21 -0800 Subject: mesa: set version string to 7.6.1-rc2 --- src/mesa/main/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index 3e9143979a..e2fed57080 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.h @@ -32,7 +32,7 @@ #define MESA_MAJOR 7 #define MESA_MINOR 6 #define MESA_PATCH 1 -#define MESA_VERSION_STRING "7.6.1-rc1" +#define MESA_VERSION_STRING "7.6.1-rc2" /* To make version comparison easy */ #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -- cgit v1.2.3 From f17dbe256bb38c35d885260be7e5856f1561de97 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 30 Nov 2009 17:56:07 -0800 Subject: mesa: set version string to 7.7-rc1 --- src/mesa/main/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index 0cae1860a3..fddb9a851f 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.h @@ -32,7 +32,7 @@ #define MESA_MAJOR 7 #define MESA_MINOR 7 #define MESA_PATCH 0 -#define MESA_VERSION_STRING "7.7-devel" +#define MESA_VERSION_STRING "7.7-rc1" /* To make version comparison easy */ #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -- cgit v1.2.3 From e197652ce08cacf0fdbf0509db5eb26500d556c5 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 1 Dec 2009 08:44:18 +0100 Subject: st: Update for renamed sampler/texture state setters. --- src/mesa/state_tracker/st_cb_drawpixels.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index a68a29e126..03617b7a93 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -585,10 +585,10 @@ draw_textured_quad(GLcontext *ctx, GLint x, GLint y, GLfloat z, struct pipe_texture *textures[2]; textures[0] = pt; textures[1] = st->pixel_xfer.pixelmap_texture; - pipe->set_sampler_textures(pipe, 2, textures); + pipe->set_fragment_sampler_textures(pipe, 2, textures); } else { - pipe->set_sampler_textures(pipe, 1, &pt); + pipe->set_fragment_sampler_textures(pipe, 1, &pt); } /* Compute window coords (y=0=bottom) with pixel zoom. -- cgit v1.2.3 From 853d4807fe220b17cf5af5a76b24f2466238013b Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 1 Dec 2009 11:19:33 +0100 Subject: mesa: Update vertex texture code after gallium changes. --- src/mesa/drivers/dri/i965/brw_context.c | 1 + src/mesa/main/context.c | 1 + src/mesa/main/get.c | 8 ++++---- src/mesa/main/get_gen.py | 2 +- src/mesa/main/mtypes.h | 1 + src/mesa/state_tracker/st_atom_sampler.c | 9 +++++++++ src/mesa/state_tracker/st_atom_texture.c | 8 ++++++++ src/mesa/state_tracker/st_extensions.c | 4 ++++ 8 files changed, 29 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 48685c087b..8bdda60697 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -111,6 +111,7 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis, ctx->Const.MaxTextureUnits = MIN2(ctx->Const.MaxTextureCoordUnits, ctx->Const.MaxTextureImageUnits); ctx->Const.MaxVertexTextureImageUnits = 0; /* no vertex shader textures */ + ctx->Const.MaxCombinedTextureImageUnits = 0; /* Mesa limits textures to 4kx4k; it would be nice to fix that someday */ diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index b5bf46718f..03fc57e665 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -575,6 +575,7 @@ _mesa_init_constants(GLcontext *ctx) #if FEATURE_ARB_vertex_shader ctx->Const.MaxVertexTextureImageUnits = MAX_VERTEX_TEXTURE_IMAGE_UNITS; + ctx->Const.MaxCombinedTextureImageUnits = MAX_COMBINED_TEXTURE_IMAGE_UNITS; ctx->Const.MaxVarying = MAX_VARYING; #endif diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 6c5ce02913..e8932f83b6 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -1876,7 +1876,7 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) break; case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB: CHECK_EXT1(ARB_vertex_shader, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(MAX_COMBINED_TEXTURE_IMAGE_UNITS); + params[0] = INT_TO_BOOLEAN(ctx->Const.MaxCombinedTextureImageUnits); break; case GL_CURRENT_PROGRAM: CHECK_EXT1(ARB_shader_objects, "GetBooleanv"); @@ -3711,7 +3711,7 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) break; case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB: CHECK_EXT1(ARB_vertex_shader, "GetFloatv"); - params[0] = (GLfloat)(MAX_COMBINED_TEXTURE_IMAGE_UNITS); + params[0] = (GLfloat)(ctx->Const.MaxCombinedTextureImageUnits); break; case GL_CURRENT_PROGRAM: CHECK_EXT1(ARB_shader_objects, "GetFloatv"); @@ -5546,7 +5546,7 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) break; case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB: CHECK_EXT1(ARB_vertex_shader, "GetIntegerv"); - params[0] = MAX_COMBINED_TEXTURE_IMAGE_UNITS; + params[0] = ctx->Const.MaxCombinedTextureImageUnits; break; case GL_CURRENT_PROGRAM: CHECK_EXT1(ARB_shader_objects, "GetIntegerv"); @@ -7382,7 +7382,7 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) break; case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB: CHECK_EXT1(ARB_vertex_shader, "GetInteger64v"); - params[0] = (GLint64)(MAX_COMBINED_TEXTURE_IMAGE_UNITS); + params[0] = (GLint64)(ctx->Const.MaxCombinedTextureImageUnits); break; case GL_CURRENT_PROGRAM: CHECK_EXT1(ARB_shader_objects, "GetInteger64v"); diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py index 930c3362fa..a29962d334 100644 --- a/src/mesa/main/get_gen.py +++ b/src/mesa/main/get_gen.py @@ -1006,7 +1006,7 @@ StateVars = [ ( "GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB", GLint, ["ctx->Const.MaxVertexTextureImageUnits"], "", ["ARB_vertex_shader"] ), ( "GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB", GLint, - ["MAX_COMBINED_TEXTURE_IMAGE_UNITS"], "", ["ARB_vertex_shader"] ), + ["ctx->Const.MaxCombinedTextureImageUnits"], "", ["ARB_vertex_shader"] ), # GL_ARB_shader_objects # Actually, this token isn't part of GL_ARB_shader_objects, but is diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 881d233ca3..5f01244827 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2319,6 +2319,7 @@ struct gl_constants GLuint MaxTextureCoordUnits; GLuint MaxTextureImageUnits; GLuint MaxVertexTextureImageUnits; + GLuint MaxCombinedTextureImageUnits; GLuint MaxTextureUnits; /**< = MIN(CoordUnits, ImageUnits) */ GLfloat MaxTextureMaxAnisotropy; /**< GL_EXT_texture_filter_anisotropic */ GLfloat MaxTextureLodBias; /**< GL_EXT_texture_lod_bias */ diff --git a/src/mesa/state_tracker/st_atom_sampler.c b/src/mesa/state_tracker/st_atom_sampler.c index 6611956ae8..d6e3a3e561 100644 --- a/src/mesa/state_tracker/st_atom_sampler.c +++ b/src/mesa/state_tracker/st_atom_sampler.c @@ -229,14 +229,23 @@ update_samplers(struct st_context *st) /*printf("%s su=%u non-null\n", __FUNCTION__, su);*/ cso_single_sampler(st->cso_context, su, sampler); + if (su < st->ctx->Const.MaxVertexTextureImageUnits) { + cso_single_vertex_sampler(st->cso_context, su, sampler); + } } else { /*printf("%s su=%u null\n", __FUNCTION__, su);*/ cso_single_sampler(st->cso_context, su, NULL); + if (su < st->ctx->Const.MaxVertexTextureImageUnits) { + cso_single_vertex_sampler(st->cso_context, su, NULL); + } } } cso_single_sampler_done(st->cso_context); + if (st->ctx->Const.MaxVertexTextureImageUnits > 0) { + cso_single_vertex_sampler_done(st->cso_context); + } } diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c index 4d4f97da7e..0b68447d21 100644 --- a/src/mesa/state_tracker/st_atom_texture.c +++ b/src/mesa/state_tracker/st_atom_texture.c @@ -32,6 +32,8 @@ */ +#include "main/macros.h" + #include "st_context.h" #include "st_atom.h" #include "st_texture.h" @@ -99,6 +101,12 @@ update_textures(struct st_context *st) cso_set_sampler_textures(st->cso_context, st->state.num_textures, st->state.sampler_texture); + if (st->ctx->Const.MaxVertexTextureImageUnits > 0) { + cso_set_vertex_sampler_textures(st->cso_context, + MIN2(st->state.num_textures, + st->ctx->Const.MaxVertexTextureImageUnits), + st->state.sampler_texture); + } } diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index 57fe72d76a..ef3cbc53ee 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -92,6 +92,10 @@ void st_init_limits(struct st_context *st) = _min(screen->get_param(screen, PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS), MAX_VERTEX_TEXTURE_IMAGE_UNITS); + c->MaxCombinedTextureImageUnits + = _min(screen->get_param(screen, PIPE_CAP_MAX_COMBINED_SAMPLERS), + MAX_COMBINED_TEXTURE_IMAGE_UNITS); + c->MaxTextureCoordUnits = _min(c->MaxTextureImageUnits, MAX_TEXTURE_COORD_UNITS); -- cgit v1.2.3 From 8c26cefec7ad52c4fa52fd1a89e18f463b85257b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 30 Nov 2009 08:41:37 -0700 Subject: st/mesa: updated emit_swz() comment --- src/mesa/state_tracker/st_mesa_to_tgsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c index 3d6c215819..bd94c9d79e 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -278,7 +278,7 @@ static struct ureg_src swizzle_4v( struct ureg_src src, /** - * Translate SWZ instructions into a single MAD. EG: + * Translate a SWZ instruction into a MOV, MUL or MAD instruction. EG: * * SWZ dst, src.x-y10 * -- cgit v1.2.3 From c8cdce665790263bb2142d894a81c87abc4da9fb Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 1 Dec 2009 13:26:15 -0700 Subject: vbo: make flush recursion check code per-context This fixes invalid failed assertions when running multi-threaded apps. --- src/mesa/vbo/vbo_exec.h | 4 ++++ src/mesa/vbo/vbo_exec_api.c | 11 ++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/vbo/vbo_exec.h b/src/mesa/vbo/vbo_exec.h index 0a05b8df89..98c1f363d9 100644 --- a/src/mesa/vbo/vbo_exec.h +++ b/src/mesa/vbo/vbo_exec.h @@ -138,6 +138,10 @@ struct vbo_exec_context */ const struct gl_client_array *inputs[VERT_ATTRIB_MAX]; } array; + +#ifdef DEBUG + GLint flush_call_depth; +#endif }; diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index c90565eae8..f0a7eeadd0 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -876,9 +876,8 @@ void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags ) #ifdef DEBUG /* debug check: make sure we don't get called recursively */ - static GLuint callDepth = 0; - callDepth++; - assert(callDepth == 1); + exec->flush_call_depth++; + assert(exec->flush_call_depth == 1); #endif if (0) _mesa_printf("%s\n", __FUNCTION__); @@ -886,7 +885,8 @@ void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags ) if (exec->ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { if (0) _mesa_printf("%s - inside begin/end\n", __FUNCTION__); #ifdef DEBUG - callDepth--; + exec->flush_call_depth--; + assert(exec->flush_call_depth == 0); #endif return; } @@ -903,7 +903,8 @@ void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags ) exec->ctx->Driver.NeedFlush &= ~flags; #ifdef DEBUG - callDepth--; + exec->flush_call_depth--; + assert(exec->flush_call_depth == 0); #endif } -- cgit v1.2.3 From e84dddde9b6eb7727760814ae211c95218bb28a3 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 2 Dec 2009 11:01:19 +1000 Subject: Revert "radeon/r300: no need to flush the cmdbuf when changing scissors state in KMM mode" This reverts commit 286bf89e5a1fc931dbf523ded861b809859485e2. This doesn't appear to be correct, regression so revert it. http://bugs.freedesktop.org/show_bug.cgi?id=25193 --- src/mesa/drivers/dri/r300/r300_state.c | 3 +-- src/mesa/drivers/dri/radeon/radeon_common.c | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 1fd32d497b..ac20c08e20 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1741,8 +1741,7 @@ static void r300Enable(GLcontext * ctx, GLenum cap, GLboolean state) r300SetPolygonOffsetState(ctx, state); break; case GL_SCISSOR_TEST: - if (!rmesa->radeon.radeonScreen->kernel_mm) - radeon_firevertices(&rmesa->radeon); + radeon_firevertices(&rmesa->radeon); rmesa->radeon.state.scissor.enabled = state; radeonUpdateScissor( ctx ); break; diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c b/src/mesa/drivers/dri/radeon/radeon_common.c index 3b4366aa61..184287aa44 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common.c +++ b/src/mesa/drivers/dri/radeon/radeon_common.c @@ -257,9 +257,7 @@ void radeonScissor(GLcontext* ctx, GLint x, GLint y, GLsizei w, GLsizei h) radeonContextPtr radeon = RADEON_CONTEXT(ctx); if (ctx->Scissor.Enabled) { /* We don't pipeline cliprect changes */ - if (!radeon->radeonScreen->kernel_mm) { - radeon_firevertices(radeon); - } + radeon_firevertices(radeon); radeonUpdateScissor(ctx); } } -- cgit v1.2.3 From a7e4a311e971005f7b23572ff3ca93f6d3c17edf Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 2 Dec 2009 11:56:18 -0800 Subject: intel: Fix more front-buffer rendering after Brian's less flushing patch. bcbfda71b03303d3f008a6f3cf8cb7d9667bf8d2 left out many blit paths. This fixes up more of them to get Blender to work again. Bug #25030. --- src/mesa/drivers/dri/intel/intel_pixel_bitmap.c | 2 ++ src/mesa/drivers/dri/intel/intel_pixel_copy.c | 2 ++ 2 files changed, 4 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c index 99330b6ddf..204a233173 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c @@ -336,6 +336,8 @@ out: unpack->BufferObj); } + intel_check_front_buffer_rendering(intel); + return GL_TRUE; } diff --git a/src/mesa/drivers/dri/intel/intel_pixel_copy.c b/src/mesa/drivers/dri/intel/intel_pixel_copy.c index f058b3c8e4..622aaa22d6 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_copy.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_copy.c @@ -222,6 +222,8 @@ do_blit_copypixels(GLcontext * ctx, out: UNLOCK_HARDWARE(intel); + intel_check_front_buffer_rendering(intel); + DBG("%s: success\n", __FUNCTION__); return GL_TRUE; } -- cgit v1.2.3 From d8da270a2be18849eee8a168d1c1528e96677b41 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 24 Nov 2009 11:59:23 -0800 Subject: intel: Remove GL_NV_point_sprite from extension list i830 does not (and cannot!) support the any of the non-default GL_POINT_SPRITE_R_MODE_NV settings. i915 and i965 could, but currently do not. In both cases it would require mucking about with the fragment shader. --- src/mesa/drivers/dri/intel/intel_extensions.c | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index 2e61c556d8..877f5b5971 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -114,7 +114,6 @@ static const struct dri_extension card_extensions[] = { { "GL_MESA_pack_invert", NULL }, { "GL_MESA_ycbcr_texture", NULL }, { "GL_NV_blend_square", NULL }, - { "GL_NV_point_sprite", GL_NV_point_sprite_functions }, { "GL_NV_vertex_program", GL_NV_vertex_program_functions }, { "GL_NV_vertex_program1_1", NULL }, { "GL_SGIS_generate_mipmap", NULL }, -- cgit v1.2.3 From 09325b9ff456ae475069bac5a04cf10a32235e43 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 19 Nov 2009 09:55:08 -0700 Subject: mesa: added comment for target_enum_to_index() --- src/mesa/main/texobj.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index aaccc03a7c..7e8a2489ac 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -940,7 +940,8 @@ _mesa_DeleteTextures( GLsizei n, const GLuint *textures) /** * Convert a GL texture target enum such as GL_TEXTURE_2D or GL_TEXTURE_3D * into the corresponding Mesa texture target index. - * Return -1 if target is invalid. + * Note that proxy targets are not valid here. + * \return TEXTURE_x_INDEX or -1 if target is invalid */ static GLint target_enum_to_index(GLenum target) -- cgit v1.2.3 From b47f7316dab5eb81bc7e60dc93bb5dbe824c43d4 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 2 Dec 2009 12:15:46 -0800 Subject: mesa: Fix copy'n'paste problem in al1616 texel fetch. --- src/mesa/main/texfetch_tmp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texfetch_tmp.h b/src/mesa/main/texfetch_tmp.h index 1f0d436236..e6772c89f3 100644 --- a/src/mesa/main/texfetch_tmp.h +++ b/src/mesa/main/texfetch_tmp.h @@ -864,7 +864,7 @@ static void store_texel_al88_rev(struct gl_texture_image *texImage, static void FETCH(f_al1616)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLuint s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = USHORT_TO_FLOAT( s & 0xffff ); -- cgit v1.2.3 From db352f58fab419c475b89418cd27b35f5f5d3822 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 2 Dec 2009 12:42:36 -0800 Subject: mesa: Fix bad conversion in AL1616_REV texstore. --- src/mesa/main/texstore.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 5387eb1283..792c83141e 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -2197,18 +2197,22 @@ _mesa_texstore_al1616(TEXSTORE_PARAMS) GLuint *dstUI = (GLuint *) dstRow; if (dstFormat == MESA_FORMAT_AL1616) { for (col = 0; col < srcWidth; col++) { - /* src[0] is luminance, src[1] is alpha */ - dstUI[col] = PACK_COLOR_1616( FLOAT_TO_USHORT(src[1]), - FLOAT_TO_USHORT(src[0]) ); - src += 2; + GLushort l, a; + + UNCLAMPED_FLOAT_TO_USHORT(l, src[0]); + UNCLAMPED_FLOAT_TO_USHORT(a, src[1]); + dstUI[col] = PACK_COLOR_1616(a, l); + src += 2; } } else { for (col = 0; col < srcWidth; col++) { - /* src[0] is luminance, src[1] is alpha */ - dstUI[col] = PACK_COLOR_1616_REV( FLOAT_TO_UBYTE(src[1]), - FLOAT_TO_UBYTE(src[0]) ); - src += 2; + GLushort l, a; + + UNCLAMPED_FLOAT_TO_USHORT(l, src[0]); + UNCLAMPED_FLOAT_TO_USHORT(a, src[1]); + dstUI[col] = PACK_COLOR_1616_REV(a, l); + src += 2; } } dstRow += dstRowStride; -- cgit v1.2.3 From 4598942b1b88a2a7d5af7febae7e79eedf00e385 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 2 Dec 2009 13:00:15 -0800 Subject: intel: Make RGB renderbuffers use XRGB8888 like we do for RGB system buffers. --- src/mesa/drivers/dri/intel/intel_fbo.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 5615040946..b6e0d823ed 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -126,7 +126,7 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_RGB16: rb->Format = MESA_FORMAT_ARGB8888; rb->DataType = GL_UNSIGNED_BYTE; - irb->texformat = MESA_FORMAT_ARGB8888; /* XXX: Need xrgb8888 */ + irb->texformat = MESA_FORMAT_XRGB8888; cpp = 4; break; case GL_RGBA: @@ -314,10 +314,6 @@ intel_create_renderbuffer(gl_format format) irb->Base.DataType = GL_UNSIGNED_BYTE; break; case MESA_FORMAT_XRGB8888: - /* XXX this is a hack since XRGB surfaces don't seem to work - * properly yet. Reading the alpha channel returns 0 instead of 1. - */ - format = MESA_FORMAT_ARGB8888; irb->Base._BaseFormat = GL_RGB; irb->Base.DataType = GL_UNSIGNED_BYTE; break; -- cgit v1.2.3 From 2b5618fc5bdcbee3434f8b5aa3a31eb06fb479c0 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Thu, 3 Dec 2009 11:20:40 -0500 Subject: r200: fix polygon stipple fixes fdo bug 25354 Signed-off-by: Alex Deucher --- src/mesa/drivers/dri/r200/r200_context.c | 4 ++-- src/mesa/drivers/dri/r200/r200_state.c | 7 ++----- src/mesa/drivers/dri/r200/r200_state.h | 2 +- src/mesa/drivers/dri/r200/r200_state_init.c | 15 ++++++--------- 4 files changed, 11 insertions(+), 17 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index 3ddb5bf7d6..4e34e0986d 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -325,9 +325,9 @@ GLboolean r200CreateContext( const __GLcontextModes *glVisual, _mesa_init_driver_functions(&functions); r200InitDriverFuncs(&functions); r200InitIoctlFuncs(&functions); - r200InitStateFuncs(&functions, screen->kernel_mm); + r200InitStateFuncs(&functions); r200InitTextureFuncs(&functions); - r200InitShaderFuncs(&functions); + r200InitShaderFuncs(&functions); radeonInitQueryObjFunctions(&functions); if (!radeonInitContext(&rmesa->radeon, &functions, diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c index d28e96d9d9..6d99c039de 100644 --- a/src/mesa/drivers/dri/r200/r200_state.c +++ b/src/mesa/drivers/dri/r200/r200_state.c @@ -2476,7 +2476,7 @@ static void r200PolygonStipple( GLcontext *ctx, const GLubyte *mask ) } /* Initialize the driver's state functions. */ -void r200InitStateFuncs( struct dd_function_table *functions, GLboolean dri2 ) +void r200InitStateFuncs( struct dd_function_table *functions ) { functions->UpdateState = r200InvalidateState; functions->LightingSpaceChange = r200LightingSpaceChange; @@ -2510,10 +2510,7 @@ void r200InitStateFuncs( struct dd_function_table *functions, GLboolean dri2 ) functions->LogicOpcode = r200LogicOpCode; functions->PolygonMode = r200PolygonMode; functions->PolygonOffset = r200PolygonOffset; - if (dri2) - functions->PolygonStipple = r200PolygonStipple; - else - functions->PolygonStipple = radeonPolygonStipplePreKMS; + functions->PolygonStipple = r200PolygonStipple; functions->PointParameterfv = r200PointParameter; functions->PointSize = r200PointSize; functions->RenderMode = r200RenderMode; diff --git a/src/mesa/drivers/dri/r200/r200_state.h b/src/mesa/drivers/dri/r200/r200_state.h index 9c62f0a644..7b9b0c106a 100644 --- a/src/mesa/drivers/dri/r200/r200_state.h +++ b/src/mesa/drivers/dri/r200/r200_state.h @@ -38,7 +38,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r200_context.h" extern void r200InitState( r200ContextPtr rmesa ); -extern void r200InitStateFuncs( struct dd_function_table *functions, GLboolean dri2 ); +extern void r200InitStateFuncs( struct dd_function_table *functions ); extern void r200InitTnlFuncs( GLcontext *ctx ); extern void r200UpdateMaterial( GLcontext *ctx ); diff --git a/src/mesa/drivers/dri/r200/r200_state_init.c b/src/mesa/drivers/dri/r200/r200_state_init.c index 7697306d88..8553be0197 100644 --- a/src/mesa/drivers/dri/r200/r200_state_init.c +++ b/src/mesa/drivers/dri/r200/r200_state_init.c @@ -885,10 +885,8 @@ void r200InitState( r200ContextPtr rmesa ) } } } - /* polygon stipple is done with irq for non-kms */ - if (rmesa->radeon.radeonScreen->kernel_mm) { - ALLOC_STATE( stp, always, STP_STATE_SIZE, "STP/stp", 0 ); - } + + ALLOC_STATE( stp, always, STP_STATE_SIZE, "STP/stp", 0 ); for (i = 0; i < 6; i++) if (rmesa->radeon.radeonScreen->kernel_mm) @@ -1120,12 +1118,11 @@ void r200InitState( r200ContextPtr rmesa ) rmesa->hw.sci.cmd[SCI_CMD_1] = CP_PACKET0(R200_RE_TOP_LEFT, 0); rmesa->hw.sci.cmd[SCI_CMD_2] = CP_PACKET0(R200_RE_WIDTH_HEIGHT, 0); - if (rmesa->radeon.radeonScreen->kernel_mm) { - - rmesa->hw.stp.cmd[STP_CMD_0] = CP_PACKET0(RADEON_RE_STIPPLE_ADDR, 0); - rmesa->hw.stp.cmd[STP_DATA_0] = 0; - rmesa->hw.stp.cmd[STP_CMD_1] = CP_PACKET0_ONE(RADEON_RE_STIPPLE_DATA, 31); + rmesa->hw.stp.cmd[STP_CMD_0] = CP_PACKET0(RADEON_RE_STIPPLE_ADDR, 0); + rmesa->hw.stp.cmd[STP_DATA_0] = 0; + rmesa->hw.stp.cmd[STP_CMD_1] = CP_PACKET0_ONE(RADEON_RE_STIPPLE_DATA, 31); + if (rmesa->radeon.radeonScreen->kernel_mm) { rmesa->hw.mtl[0].emit = mtl_emit; rmesa->hw.mtl[1].emit = mtl_emit; -- cgit v1.2.3 From 8cde43eb19c4dcceb74166e1da123d316a429c21 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Wed, 2 Dec 2009 23:03:51 +0100 Subject: radeon: properly check if image should be placed in the miptree Fixes #25355 --- src/mesa/drivers/dri/radeon/radeon_texture.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 0390d376ba..00e0658dc5 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -515,7 +515,10 @@ static int image_matches_texture_obj(struct gl_texture_object *texObj, struct gl_texture_image *texImage, unsigned level) { - const struct gl_texture_image *baseImage = texObj->Image[0][level]; + const struct gl_texture_image *baseImage = texObj->Image[0][texObj->BaseLevel]; + + if (!baseImage) + return 0; if (level < texObj->BaseLevel || level > texObj->MaxLevel) return 0; -- cgit v1.2.3 From 6c41bb25a2e260dbce2c2d72ec64d1beb74527de Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Thu, 3 Dec 2009 20:21:16 +0100 Subject: radeon: workaround an FBO issue Fixes #21501 --- src/mesa/drivers/dri/radeon/radeon_fbo.c | 6 ++++++ src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c | 3 +++ 2 files changed, 9 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index 7ec641ff18..fc21069a92 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -369,6 +369,12 @@ radeon_framebuffer_renderbuffer(GLcontext * ctx, } +/* TODO: According to EXT_fbo spec internal format of texture image + * once set during glTexImage call, should be preserved when + * attaching image to renderbuffer. When HW doesn't support + * rendering to format of attached image, set framebuffer + * completeness accordingly in radeon_validate_framebuffer (issue #79). + */ static GLboolean radeon_update_wrapper(GLcontext *ctx, struct radeon_renderbuffer *rrb, struct gl_texture_image *texImage) diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c index a9d601a0b5..0415a50d0b 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c @@ -421,9 +421,12 @@ static void migrate_image_to_miptree(radeon_mipmap_tree *mt, radeon_mipmap_level *srclvl = &image->mt->levels[image->mtlevel]; + /* TODO: bring back these assertions once the FBOs are fixed */ +#if 0 assert(image->mtlevel == level); assert(srclvl->size == dstlvl->size); assert(srclvl->rowstride == dstlvl->rowstride); +#endif radeon_bo_map(image->mt->bo, GL_FALSE); -- cgit v1.2.3 From 86c8f70db10a584aa78e4d5f397ad3543fdb77d2 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Thu, 3 Dec 2009 23:26:13 +0100 Subject: mesa: use _mesa_memcpy for COPY_4FV macro Gets rid of one of the worst strict-aliasing offenders, and actually produces faster code (at least in some cases, when compiler can use for instance 64bit moves for memcpy). (note _mesa_memcpy should get inlined) --- src/mesa/main/macros.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h index 3d9a1aba98..f0ea463fb9 100644 --- a/src/mesa/main/macros.h +++ b/src/mesa/main/macros.h @@ -202,17 +202,12 @@ do { \ #endif /** - * Copy a 4-element float vector (avoid using FPU registers) - * XXX Could use two 64-bit moves on 64-bit systems + * Copy a 4-element float vector + * memcpy seems to be most efficient */ #define COPY_4FV( DST, SRC ) \ do { \ - const GLuint *_s = (const GLuint *) (SRC); \ - GLuint *_d = (GLuint *) (DST); \ - _d[0] = _s[0]; \ - _d[1] = _s[1]; \ - _d[2] = _s[2]; \ - _d[3] = _s[3]; \ + _mesa_memcpy(DST, SRC, sizeof(GLfloat) * 4); \ } while (0) /** Copy \p SZ elements into a 4-element vector */ -- cgit v1.2.3 From 8d8fd9776e23a34e0d22e489ce1f85eb5e383121 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Fri, 4 Dec 2009 09:52:37 -0500 Subject: radeon: fix polygon stipple fixes fdo bug 25354 Signed-off-by: Alex Deucher --- src/mesa/drivers/dri/radeon/radeon_common.c | 23 ----------------------- src/mesa/drivers/dri/radeon/radeon_common.h | 1 - src/mesa/drivers/dri/radeon/radeon_context.h | 4 ++++ src/mesa/drivers/dri/radeon/radeon_state.c | 25 +++++++++++++++++++++++++ 4 files changed, 29 insertions(+), 24 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c b/src/mesa/drivers/dri/radeon/radeon_common.c index 8032cbcd69..5b2bcfdb24 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common.c +++ b/src/mesa/drivers/dri/radeon/radeon_common.c @@ -262,29 +262,6 @@ void radeonScissor(GLcontext* ctx, GLint x, GLint y, GLsizei w, GLsizei h) } } -void radeonPolygonStipplePreKMS( GLcontext *ctx, const GLubyte *mask ) -{ - radeonContextPtr radeon = RADEON_CONTEXT(ctx); - GLuint i; - drm_radeon_stipple_t stipple; - - /* Must flip pattern upside down. - */ - for ( i = 0 ; i < 32 ; i++ ) { - stipple.mask[31 - i] = ((GLuint *) mask)[i]; - } - - /* TODO: push this into cmd mechanism - */ - radeon_firevertices(radeon); - LOCK_HARDWARE( radeon ); - - drmCommandWrite( radeon->dri.fd, DRM_RADEON_STIPPLE, - &stipple, sizeof(stipple) ); - UNLOCK_HARDWARE( radeon ); -} - - /* ================================================================ * SwapBuffers with client-side throttling */ diff --git a/src/mesa/drivers/dri/radeon/radeon_common.h b/src/mesa/drivers/dri/radeon/radeon_common.h index f3201911ac..a9e1ca49eb 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common.h +++ b/src/mesa/drivers/dri/radeon/radeon_common.h @@ -10,7 +10,6 @@ void radeonRecalcScissorRects(radeonContextPtr radeon); void radeonSetCliprects(radeonContextPtr radeon); void radeonUpdateScissor( GLcontext *ctx ); void radeonScissor(GLcontext* ctx, GLint x, GLint y, GLsizei w, GLsizei h); -void radeonPolygonStipplePreKMS( GLcontext *ctx, const GLubyte *mask ); void radeonWaitForIdleLocked(radeonContextPtr radeon); extern uint32_t radeonGetAge(radeonContextPtr radeon); diff --git a/src/mesa/drivers/dri/radeon/radeon_context.h b/src/mesa/drivers/dri/radeon/radeon_context.h index 4e2c52c835..12ab33a009 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.h +++ b/src/mesa/drivers/dri/radeon/radeon_context.h @@ -331,8 +331,12 @@ struct r100_hw_state { struct radeon_state_atom stp; }; +struct radeon_stipple_state { + GLuint mask[32]; +}; struct r100_state { + struct radeon_stipple_state stipple; struct radeon_texture_state texture; }; diff --git a/src/mesa/drivers/dri/radeon/radeon_state.c b/src/mesa/drivers/dri/radeon/radeon_state.c index 4d0d35ee0c..f6c733ab20 100644 --- a/src/mesa/drivers/dri/radeon/radeon_state.c +++ b/src/mesa/drivers/dri/radeon/radeon_state.c @@ -550,6 +550,31 @@ static void radeonPolygonOffset( GLcontext *ctx, rmesa->hw.zbs.cmd[ZBS_SE_ZBIAS_CONSTANT] = constant.ui32; } +static void radeonPolygonStipplePreKMS( GLcontext *ctx, const GLubyte *mask ) +{ + r100ContextPtr rmesa = R100_CONTEXT(ctx); + GLuint i; + drm_radeon_stipple_t stipple; + + /* Must flip pattern upside down. + */ + for ( i = 0 ; i < 32 ; i++ ) { + rmesa->state.stipple.mask[31 - i] = ((GLuint *) mask)[i]; + } + + /* TODO: push this into cmd mechanism + */ + radeon_firevertices(&rmesa->radeon); + LOCK_HARDWARE( &rmesa->radeon ); + + /* FIXME: Use window x,y offsets into stipple RAM. + */ + stipple.mask = rmesa->state.stipple.mask; + drmCommandWrite( rmesa->radeon.dri.fd, DRM_RADEON_STIPPLE, + &stipple, sizeof(drm_radeon_stipple_t) ); + UNLOCK_HARDWARE( &rmesa->radeon ); +} + static void radeonPolygonMode( GLcontext *ctx, GLenum face, GLenum mode ) { r100ContextPtr rmesa = R100_CONTEXT(ctx); -- cgit v1.2.3 From fe8e18bcd41a19282ba92350a04a34866fda1d7b Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 28 Nov 2009 22:04:06 -0500 Subject: mesa: Fix array out-of-bounds access in _mesa_TexEnvf. _mesa_TexEnvf calls _mesa_TexEnvfv, which uses the param argument as an array. (cherry picked from commit a11d60d14caf8efc07f70af63b57b33273f8cf9b) --- src/mesa/main/texenv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texenv.c b/src/mesa/main/texenv.c index 6d86a4275c..4442fb8cf8 100644 --- a/src/mesa/main/texenv.c +++ b/src/mesa/main/texenv.c @@ -598,7 +598,10 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) void GLAPIENTRY _mesa_TexEnvf( GLenum target, GLenum pname, GLfloat param ) { - _mesa_TexEnvfv( target, pname, ¶m ); + GLfloat p[4]; + p[0] = param; + p[1] = p[2] = p[3] = 0.0; + _mesa_TexEnvfv( target, pname, p ); } -- cgit v1.2.3 From 433f0a82f5a4696e6b0c4061f645485ec8079bb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Sat, 5 Dec 2009 17:20:03 +0100 Subject: radeon: Only get DRI2 front buffer information for glXBindTexImageEXT. --- src/mesa/drivers/dri/r300/r300_texstate.c | 13 +---- src/mesa/drivers/dri/radeon/radeon_common.c | 8 +-- .../drivers/dri/radeon/radeon_common_context.c | 57 ++++++++++++---------- .../drivers/dri/radeon/radeon_common_context.h | 3 +- 4 files changed, 38 insertions(+), 43 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index e6f2c0c1a7..9eaf390b46 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -409,18 +409,7 @@ void r300SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo return; } - radeon_update_renderbuffers(pDRICtx, dPriv); - /* back & depth buffer are useless free them right away */ - rb = (void*)rfb->base.Attachment[BUFFER_DEPTH].Renderbuffer; - if (rb && rb->bo) { - radeon_bo_unref(rb->bo); - rb->bo = NULL; - } - rb = (void*)rfb->base.Attachment[BUFFER_BACK_LEFT].Renderbuffer; - if (rb && rb->bo) { - radeon_bo_unref(rb->bo); - rb->bo = NULL; - } + radeon_update_renderbuffers(pDRICtx, dPriv, GL_TRUE); rb = rfb->color_rb[0]; if (rb->bo == NULL) { /* Failed to BO for the buffer */ diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c b/src/mesa/drivers/dri/radeon/radeon_common.c index 184287aa44..c81e80e820 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common.c +++ b/src/mesa/drivers/dri/radeon/radeon_common.c @@ -840,7 +840,7 @@ void radeonDrawBuffer( GLcontext *ctx, GLenum mode ) */ if (!was_front_buffer_rendering && radeon->is_front_buffer_rendering) { radeon_update_renderbuffers(radeon->dri.context, - radeon->dri.context->driDrawablePriv); + radeon->dri.context->driDrawablePriv, GL_FALSE); } } @@ -857,7 +857,7 @@ void radeonReadBuffer( GLcontext *ctx, GLenum mode ) if (!was_front_buffer_reading && rmesa->is_front_buffer_reading) { radeon_update_renderbuffers(rmesa->dri.context, - rmesa->dri.context->driReadablePriv); + rmesa->dri.context->driReadablePriv, GL_FALSE); } } /* nothing, until we implement h/w glRead/CopyPixels or CopyTexImage */ @@ -908,9 +908,9 @@ void radeon_viewport(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei he if (radeon->is_front_buffer_rendering) { ctx->Driver.Flush(ctx); } - radeon_update_renderbuffers(driContext, driContext->driDrawablePriv); + radeon_update_renderbuffers(driContext, driContext->driDrawablePriv, GL_FALSE); if (driContext->driDrawablePriv != driContext->driReadablePriv) - radeon_update_renderbuffers(driContext, driContext->driReadablePriv); + radeon_update_renderbuffers(driContext, driContext->driReadablePriv, GL_FALSE); } old_viewport = ctx->Driver.Viewport; diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.c b/src/mesa/drivers/dri/radeon/radeon_common_context.c index 71f70d724b..5c68bf5df6 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.c @@ -499,7 +499,8 @@ radeon_bits_per_pixel(const struct radeon_renderbuffer *rb) } void -radeon_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable) +radeon_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable, + GLboolean front_only) { unsigned int attachments[10]; __DRIbuffer *buffers = NULL; @@ -525,7 +526,7 @@ radeon_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable) struct radeon_renderbuffer *stencil_rb; i = 0; - if ((radeon->is_front_buffer_rendering || + if ((front_only || radeon->is_front_buffer_rendering || radeon->is_front_buffer_reading || !draw->color_rb[1]) && draw->color_rb[0]) { @@ -533,23 +534,25 @@ radeon_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable) attachments[i++] = radeon_bits_per_pixel(draw->color_rb[0]); } - if (draw->color_rb[1]) { - attachments[i++] = __DRI_BUFFER_BACK_LEFT; - attachments[i++] = radeon_bits_per_pixel(draw->color_rb[1]); - } + if (!front_only) { + if (draw->color_rb[1]) { + attachments[i++] = __DRI_BUFFER_BACK_LEFT; + attachments[i++] = radeon_bits_per_pixel(draw->color_rb[1]); + } - depth_rb = radeon_get_renderbuffer(&draw->base, BUFFER_DEPTH); - stencil_rb = radeon_get_renderbuffer(&draw->base, BUFFER_STENCIL); - - if ((depth_rb != NULL) && (stencil_rb != NULL)) { - attachments[i++] = __DRI_BUFFER_DEPTH_STENCIL; - attachments[i++] = radeon_bits_per_pixel(depth_rb); - } else if (depth_rb != NULL) { - attachments[i++] = __DRI_BUFFER_DEPTH; - attachments[i++] = radeon_bits_per_pixel(depth_rb); - } else if (stencil_rb != NULL) { - attachments[i++] = __DRI_BUFFER_STENCIL; - attachments[i++] = radeon_bits_per_pixel(stencil_rb); + depth_rb = radeon_get_renderbuffer(&draw->base, BUFFER_DEPTH); + stencil_rb = radeon_get_renderbuffer(&draw->base, BUFFER_STENCIL); + + if ((depth_rb != NULL) && (stencil_rb != NULL)) { + attachments[i++] = __DRI_BUFFER_DEPTH_STENCIL; + attachments[i++] = radeon_bits_per_pixel(depth_rb); + } else if (depth_rb != NULL) { + attachments[i++] = __DRI_BUFFER_DEPTH; + attachments[i++] = radeon_bits_per_pixel(depth_rb); + } else if (stencil_rb != NULL) { + attachments[i++] = __DRI_BUFFER_STENCIL; + attachments[i++] = radeon_bits_per_pixel(stencil_rb); + } } buffers = (*screen->dri2.loader->getBuffersWithFormat)(drawable, @@ -562,12 +565,14 @@ radeon_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable) i = 0; if (draw->color_rb[0]) attachments[i++] = __DRI_BUFFER_FRONT_LEFT; - if (draw->color_rb[1]) - attachments[i++] = __DRI_BUFFER_BACK_LEFT; - if (radeon_get_renderbuffer(&draw->base, BUFFER_DEPTH)) - attachments[i++] = __DRI_BUFFER_DEPTH; - if (radeon_get_renderbuffer(&draw->base, BUFFER_STENCIL)) - attachments[i++] = __DRI_BUFFER_STENCIL; + if (!front_only) { + if (draw->color_rb[1]) + attachments[i++] = __DRI_BUFFER_BACK_LEFT; + if (radeon_get_renderbuffer(&draw->base, BUFFER_DEPTH)) + attachments[i++] = __DRI_BUFFER_DEPTH; + if (radeon_get_renderbuffer(&draw->base, BUFFER_STENCIL)) + attachments[i++] = __DRI_BUFFER_STENCIL; + } buffers = (*screen->dri2.loader->getBuffers)(drawable, &drawable->w, @@ -735,9 +740,9 @@ GLboolean radeonMakeCurrent(__DRIcontextPrivate * driContextPriv, readfb = driReadPriv->driverPrivate; if (driContextPriv->driScreenPriv->dri2.enabled) { - radeon_update_renderbuffers(driContextPriv, driDrawPriv); + radeon_update_renderbuffers(driContextPriv, driDrawPriv, GL_FALSE); if (driDrawPriv != driReadPriv) - radeon_update_renderbuffers(driContextPriv, driReadPriv); + radeon_update_renderbuffers(driContextPriv, driReadPriv, GL_FALSE); _mesa_reference_renderbuffer(&radeon->state.color.rb, &(radeon_get_renderbuffer(&drfb->base, BUFFER_BACK_LEFT)->base)); _mesa_reference_renderbuffer(&radeon->state.depth.rb, diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.h b/src/mesa/drivers/dri/radeon/radeon_common_context.h index ad953ddbb5..49a9ec5610 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.h +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.h @@ -589,7 +589,8 @@ GLboolean radeonInitContext(radeonContextPtr radeon, void radeonCleanupContext(radeonContextPtr radeon); GLboolean radeonUnbindContext(__DRIcontextPrivate * driContextPriv); -void radeon_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable); +void radeon_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable, + GLboolean front_only); GLboolean radeonMakeCurrent(__DRIcontextPrivate * driContextPriv, __DRIdrawablePrivate * driDrawPriv, __DRIdrawablePrivate * driReadPriv); -- cgit v1.2.3 From 01537a84dfe65cd1512d6fbf71e975fad5639432 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Sat, 5 Dec 2009 17:42:50 +0100 Subject: st/mesa: Prefer alpha-less formats for RGB textures. This can e.g. increase the chance of being able to accelerate glCopyTex(Sub)Image from an alpha-less renderbuffer. --- src/mesa/state_tracker/st_format.c | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index 02f80057c2..93125afe9e 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -388,6 +388,33 @@ default_rgba_format(struct pipe_screen *screen, return PIPE_FORMAT_NONE; } +/** + * Find an RGB format supported by the context/winsys. + */ +static enum pipe_format +default_rgb_format(struct pipe_screen *screen, + enum pipe_texture_target target, + unsigned tex_usage, + unsigned geom_flags) +{ + static const enum pipe_format colorFormats[] = { + PIPE_FORMAT_X8R8G8B8_UNORM, + PIPE_FORMAT_B8G8R8X8_UNORM, + PIPE_FORMAT_R8G8B8X8_UNORM, + PIPE_FORMAT_A8R8G8B8_UNORM, + PIPE_FORMAT_B8G8R8A8_UNORM, + PIPE_FORMAT_R8G8B8A8_UNORM, + PIPE_FORMAT_R5G6B5_UNORM + }; + uint i; + for (i = 0; i < Elements(colorFormats); i++) { + if (screen->is_format_supported( screen, colorFormats[i], target, tex_usage, geom_flags )) { + return colorFormats[i]; + } + } + return PIPE_FORMAT_NONE; +} + /** * Find an sRGBA format supported by the context/winsys. */ @@ -472,13 +499,14 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat, case 4: case GL_RGBA: case GL_COMPRESSED_RGBA: - case 3: - case GL_RGB: - case GL_COMPRESSED_RGB: case GL_RGBA8: case GL_RGB10_A2: case GL_RGBA12: return default_rgba_format( screen, target, tex_usage, geom_flags ); + case 3: + case GL_RGB: + case GL_COMPRESSED_RGB: + return default_rgb_format( screen, target, tex_usage, geom_flags ); case GL_RGBA16: if (tex_usage & PIPE_TEXTURE_USAGE_RENDER_TARGET) return default_deep_rgba_format( screen, target, tex_usage, geom_flags ); @@ -500,7 +528,7 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat, case GL_RGB10: case GL_RGB12: case GL_RGB16: - return default_rgba_format( screen, target, tex_usage, geom_flags ); + return default_rgb_format( screen, target, tex_usage, geom_flags ); case GL_RGB5: case GL_RGB4: -- cgit v1.2.3 From 4071d065c2c32a872bb148d108252a2380c42da4 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sun, 29 Nov 2009 18:18:23 -0500 Subject: mesa: Fix array out-of-bounds access by _mesa_TexParameterf. _mesa_TexParameterf calls set_tex_parameteri, which uses the params argument as an array. (cherry picked from commit a201dfb6bf28b89d6f511c2ec9ae0d81ef18511d) --- src/mesa/main/texparam.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 9d1fdd0566..416792f0e9 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -544,8 +544,10 @@ _mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param) case GL_DEPTH_TEXTURE_MODE_ARB: { /* convert float param to int */ - GLint p = (GLint) param; - need_update = set_tex_parameteri(ctx, texObj, pname, &p); + GLint p[4]; + p[0] = (GLint) param; + p[1] = p[2] = p[3] = 0; + need_update = set_tex_parameteri(ctx, texObj, pname, p); } break; default: -- cgit v1.2.3 From ca8a2150c79899bad0f80e132656863822db045e Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sun, 29 Nov 2009 21:17:44 -0500 Subject: mesa: Fix array out-of-bounds access by _mesa_TexParameterf. _mesa_TexParameterf calls set_tex_parameterf, which uses the params argument as an array. (cherry picked from commit 270d36da146b899d39e08f830fe34b63833a3731) --- src/mesa/main/texparam.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 416792f0e9..4ce8c8593a 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -551,8 +551,13 @@ _mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param) } break; default: - /* this will generate an error if pname is illegal */ - need_update = set_tex_parameterf(ctx, texObj, pname, ¶m); + { + /* this will generate an error if pname is illegal */ + GLfloat p[4]; + p[0] = param; + p[1] = p[2] = p[3] = 0.0F; + need_update = set_tex_parameterf(ctx, texObj, pname, p); + } } if (ctx->Driver.TexParameter && need_update) { -- cgit v1.2.3 From d74cd04e6190ebb3a9c53d45cbb2452d92e24ad5 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 28 Nov 2009 23:47:23 -0500 Subject: mesa: Fix array out-of-bounds access by _mesa_TexGeni. _mesa_TexGeni calls _mesa_TexGeniv, which uses the params argument as an array. (cherry picked from commit d55fb7c835b56951f05a058083e7eda264ba192e) --- src/mesa/main/texgen.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texgen.c b/src/mesa/main/texgen.c index e3feb024c3..13b33745b8 100644 --- a/src/mesa/main/texgen.c +++ b/src/mesa/main/texgen.c @@ -213,7 +213,10 @@ _mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param ) void GLAPIENTRY _mesa_TexGeni( GLenum coord, GLenum pname, GLint param ) { - _mesa_TexGeniv( coord, pname, ¶m ); + GLint p[4]; + p[0] = param; + p[1] = p[2] = p[3] = 0; + _mesa_TexGeniv( coord, pname, p ); } -- cgit v1.2.3 From b2953ee1a655a010f36b5fc1b47f8bd8b06ce368 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sun, 29 Nov 2009 00:50:48 -0500 Subject: mesa: Fix array out-of-bounds access by _mesa_TexGenf. _mesa_TexGenf calls _mesa_TexGenfv, which uses the params argument as an array. (cherry picked from commit ca5a7aadb4361e7d053aea8687372cd44cbd8795) --- src/mesa/main/texgen.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texgen.c b/src/mesa/main/texgen.c index 13b33745b8..d3ea7b936b 100644 --- a/src/mesa/main/texgen.c +++ b/src/mesa/main/texgen.c @@ -206,7 +206,10 @@ _mesa_TexGendv(GLenum coord, GLenum pname, const GLdouble *params ) void GLAPIENTRY _mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param ) { - _mesa_TexGenfv(coord, pname, ¶m); + GLfloat p[4]; + p[0] = param; + p[1] = p[2] = p[3] = 0.0F; + _mesa_TexGenfv(coord, pname, p); } -- cgit v1.2.3 From df02bc42b330fe20679dd3e5e83317df72ddd5ca Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Sat, 5 Dec 2009 18:24:41 -0500 Subject: radeon/r200/r600: fix drivers for changes in 433f0a82f5a4696e6b0c4061f645485ec8079bb4 --- src/mesa/drivers/dri/r200/r200_texstate.c | 15 ++------------- src/mesa/drivers/dri/r600/r600_texstate.c | 13 +------------ src/mesa/drivers/dri/radeon/radeon_texstate.c | 15 ++------------- 3 files changed, 5 insertions(+), 38 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r200/r200_texstate.c b/src/mesa/drivers/dri/r200/r200_texstate.c index 7782404a79..e2f9cf0ea8 100644 --- a/src/mesa/drivers/dri/r200/r200_texstate.c +++ b/src/mesa/drivers/dri/r200/r200_texstate.c @@ -797,24 +797,13 @@ void r200SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo return; } - radeon_update_renderbuffers(pDRICtx, dPriv); - /* back & depth buffer are useless free them right away */ - rb = (void*)rfb->base.Attachment[BUFFER_DEPTH].Renderbuffer; - if (rb && rb->bo) { - radeon_bo_unref(rb->bo); - rb->bo = NULL; - } - rb = (void*)rfb->base.Attachment[BUFFER_BACK_LEFT].Renderbuffer; - if (rb && rb->bo) { - radeon_bo_unref(rb->bo); - rb->bo = NULL; - } + radeon_update_renderbuffers(pDRICtx, dPriv, GL_TRUE); rb = rfb->color_rb[0]; if (rb->bo == NULL) { /* Failed to BO for the buffer */ return; } - + _mesa_lock_texture(radeon->glCtx, texObj); if (t->bo) { radeon_bo_unref(t->bo); diff --git a/src/mesa/drivers/dri/r600/r600_texstate.c b/src/mesa/drivers/dri/r600/r600_texstate.c index 4ec315b78c..2a4a6e6ee1 100644 --- a/src/mesa/drivers/dri/r600/r600_texstate.c +++ b/src/mesa/drivers/dri/r600/r600_texstate.c @@ -917,18 +917,7 @@ void r600SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo return; } - radeon_update_renderbuffers(pDRICtx, dPriv); - /* back & depth buffer are useless free them right away */ - rb = (void*)rfb->base.Attachment[BUFFER_DEPTH].Renderbuffer; - if (rb && rb->bo) { - radeon_bo_unref(rb->bo); - rb->bo = NULL; - } - rb = (void*)rfb->base.Attachment[BUFFER_BACK_LEFT].Renderbuffer; - if (rb && rb->bo) { - radeon_bo_unref(rb->bo); - rb->bo = NULL; - } + radeon_update_renderbuffers(pDRICtx, dPriv, GL_TRUE); rb = rfb->color_rb[0]; if (rb->bo == NULL) { /* Failed to BO for the buffer */ diff --git a/src/mesa/drivers/dri/radeon/radeon_texstate.c b/src/mesa/drivers/dri/radeon/radeon_texstate.c index 3cbe3b4725..84ddcfd4fd 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texstate.c +++ b/src/mesa/drivers/dri/radeon/radeon_texstate.c @@ -672,24 +672,13 @@ void radeonSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_ return; } - radeon_update_renderbuffers(pDRICtx, dPriv); - /* back & depth buffer are useless free them right away */ - rb = (void*)rfb->base.Attachment[BUFFER_DEPTH].Renderbuffer; - if (rb && rb->bo) { - radeon_bo_unref(rb->bo); - rb->bo = NULL; - } - rb = (void*)rfb->base.Attachment[BUFFER_BACK_LEFT].Renderbuffer; - if (rb && rb->bo) { - radeon_bo_unref(rb->bo); - rb->bo = NULL; - } + radeon_update_renderbuffers(pDRICtx, dPriv, GL_TRUE); rb = rfb->color_rb[0]; if (rb->bo == NULL) { /* Failed to BO for the buffer */ return; } - + _mesa_lock_texture(radeon->glCtx, texObj); if (t->bo) { radeon_bo_unref(t->bo); -- cgit v1.2.3 From f622b649fb0c55b1640997f9d32ea327743519a1 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 24 Nov 2009 00:57:55 -0500 Subject: dri: Fix potential null pointer deference in dri_put_drawable. (cherry picked from commit 364070b1f2b08d43fb205ec198894a35bec6b2f3) --- src/mesa/drivers/dri/common/dri_util.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index e48e10d7c0..439f66a7b8 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -498,11 +498,11 @@ static void dri_put_drawable(__DRIdrawable *pdp) { __DRIscreenPrivate *psp; - pdp->refcount--; - if (pdp->refcount) - return; - if (pdp) { + pdp->refcount--; + if (pdp->refcount) + return; + psp = pdp->driScreenPriv; (*psp->DriverAPI.DestroyBuffer)(pdp); if (pdp->pClipRects) { -- cgit v1.2.3 From c994f08eb1ec2a4bbaa44fbd6d35e7ff033d5c3c Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 28 Nov 2009 23:22:31 -0500 Subject: dri: Fix potential null pointer dereference in driBindContext. (cherry picked from commit 919898e92fa23ff71a59d86a46ff0886a6f34e4d) --- src/mesa/drivers/dri/common/dri_util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index 439f66a7b8..da81ec9de5 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -167,11 +167,12 @@ static int driBindContext(__DRIcontext *pcp, __DRIdrawable *pdp, __DRIdrawable *prp) { - __DRIscreenPrivate *psp = pcp->driScreenPriv; + __DRIscreenPrivate *psp; /* Bind the drawable to the context */ if (pcp) { + psp = pcp->driScreenPriv; pcp->driDrawablePriv = pdp; pcp->driReadablePriv = prp; if (pdp) { -- cgit v1.2.3 From 8468234bfa98be77cbceecc8e91325c00e4e424b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 7 Dec 2009 08:59:38 -0700 Subject: st/mesa: fix up comment --- src/mesa/state_tracker/st_program.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index d66f45d13e..5c81a033f9 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -49,8 +49,11 @@ #include "st_mesa_to_tgsi.h" #include "cso_cache/cso_context.h" - /* Clean out any old compilations: - */ + + +/** + * Clean out any old compilations: + */ void st_vp_release_varients( struct st_context *st, struct st_vertex_program *stvp ) -- cgit v1.2.3 From 8ce17134431ec27666e8fba2fa4bd22ba3f3ed18 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 7 Dec 2009 09:00:57 -0700 Subject: st/mesa: negate DDY to match GL semantics This fixes the regression from commit 884007546c98b1779bf266ec5111b1e7e2b68b2e Fixes bug 25456 (piglit derivs regression). --- src/mesa/state_tracker/st_mesa_to_tgsi.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c index 5e76f4db4e..bf80274c44 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -396,6 +396,23 @@ static void emit_swz( struct st_translate *t, } +/** + * Negate the value of DDY to match GL semantics where (0,0) is the + * lower-left corner of the window. + * Note that the GL_ARB_fragment_coord_conventions extension will + * effect this someday. + */ +static void emit_ddy( struct st_translate *t, + struct ureg_dst dst, + const struct prog_src_register *SrcReg ) +{ + struct ureg_program *ureg = t->ureg; + struct ureg_src src = translate_src( t, SrcReg ); + if(1) src = ureg_negate( src ); + ureg_DDY( ureg, dst, src ); +} + + static unsigned translate_opcode( unsigned op ) @@ -619,7 +636,9 @@ compile_instruction( ureg_MOV( ureg, dst[0], ureg_imm1f(ureg, 0.5) ); break; - + case OPCODE_DDY: + emit_ddy( t, dst[0], &inst->SrcReg[0] ); + break; default: ureg_insn( ureg, -- cgit v1.2.3 From c90baf444ca91d06ae5be392a04c0c8119cb08dd Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 7 Dec 2009 09:05:40 -0700 Subject: st/mesa: remove debug code --- src/mesa/state_tracker/st_mesa_to_tgsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c index bf80274c44..1611d53e2f 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -408,7 +408,7 @@ static void emit_ddy( struct st_translate *t, { struct ureg_program *ureg = t->ureg; struct ureg_src src = translate_src( t, SrcReg ); - if(1) src = ureg_negate( src ); + src = ureg_negate( src ); ureg_DDY( ureg, dst, src ); } -- cgit v1.2.3 From c36d1aacf4c70d76165c91cd7048c0f9f43b8571 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 7 Dec 2009 20:11:46 +0100 Subject: mesa: fix strict aliasing issues in half-to-float/float-to-half conversions use union instead of casts --- src/mesa/main/imports.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index c9e00cf752..f2ef84f35c 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -460,7 +460,7 @@ _mesa_inv_sqrtf(float n) #if 0 /* not used, see below -BP */ float r3, x3, y3; #endif - union { float f; unsigned int i; } u; + fi_type u; unsigned int magic; /* @@ -649,10 +649,10 @@ _mesa_bitcount(unsigned int n) GLhalfARB _mesa_float_to_half(float val) { - const int flt = *((int *) (void *) &val); - const int flt_m = flt & 0x7fffff; - const int flt_e = (flt >> 23) & 0xff; - const int flt_s = (flt >> 31) & 0x1; + const fi_type fi = {val}; + const int flt_m = fi.i & 0x7fffff; + const int flt_e = (fi.i >> 23) & 0xff; + const int flt_s = (fi.i >> 31) & 0x1; int s, e, m = 0; GLhalfARB result; @@ -739,7 +739,8 @@ _mesa_half_to_float(GLhalfARB val) const int m = val & 0x3ff; const int e = (val >> 10) & 0x1f; const int s = (val >> 15) & 0x1; - int flt_m, flt_e, flt_s, flt; + int flt_m, flt_e, flt_s; + fi_type fi; float result; /* sign bit */ @@ -774,8 +775,8 @@ _mesa_half_to_float(GLhalfARB val) flt_m = m << 13; } - flt = (flt_s << 31) | (flt_e << 23) | flt_m; - result = *((float *) (void *) &flt); + fi.i = (flt_s << 31) | (flt_e << 23) | flt_m; + result = fi.f; return result; } -- cgit v1.2.3 From 3456f9149b3009fcfce80054759d05883d3c4ee5 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 7 Dec 2009 20:35:42 +0100 Subject: gallium/util: fix util_color_[un]pack[-ub] to be strict aliasing safe use pointer to union instead of void pointer. gcc complained a lot, depending what the pointer originally actually was. Looks like it's in fact maybe legal to cast for instance uint pointers to union pointers as long as union contains a uint type, hence use this with some callers, other just use union util_color in the first place. --- src/mesa/state_tracker/st_atom_pixeltransfer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_atom_pixeltransfer.c b/src/mesa/state_tracker/st_atom_pixeltransfer.c index 4b35f59cc2..5e2ae1bb36 100644 --- a/src/mesa/state_tracker/st_atom_pixeltransfer.c +++ b/src/mesa/state_tracker/st_atom_pixeltransfer.c @@ -167,7 +167,7 @@ load_color_map_texture(GLcontext *ctx, struct pipe_texture *pt) ubyte g = ctx->PixelMaps.GtoG.Map8[i * gSize / texSize]; ubyte b = ctx->PixelMaps.BtoB.Map8[j * bSize / texSize]; ubyte a = ctx->PixelMaps.AtoA.Map8[i * aSize / texSize]; - util_pack_color_ub(r, g, b, a, pt->format, dest + k); + util_pack_color_ub(r, g, b, a, pt->format, (union util_color *)(dest + k)); } } -- cgit v1.2.3 From 72362a5cd41d97b770980c28fe6719c556f12ab7 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 7 Dec 2009 21:47:49 +0100 Subject: mesa: fix shader prog_execute strict aliasing violations use unions instead of pointer casts. --- src/mesa/shader/prog_execute.c | 50 +++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 18 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/prog_execute.c b/src/mesa/shader/prog_execute.c index 192d39aed1..038ce0b4f0 100644 --- a/src/mesa/shader/prog_execute.c +++ b/src/mesa/shader/prog_execute.c @@ -54,8 +54,18 @@ * Set x to positive or negative infinity. */ #if defined(USE_IEEE) || defined(_WIN32) -#define SET_POS_INFINITY(x) ( *((GLuint *) (void *)&x) = 0x7F800000 ) -#define SET_NEG_INFINITY(x) ( *((GLuint *) (void *)&x) = 0xFF800000 ) +#define SET_POS_INFINITY(x) \ + do { \ + fi_type fi; \ + fi.i = 0x7F800000; \ + x = fi.f; \ + } while (0) +#define SET_NEG_INFINITY(x) \ + do { \ + fi_type fi; \ + fi.i = 0xFF800000; \ + x = fi.f; \ + } while (0) #elif defined(VMS) #define SET_POS_INFINITY(x) x = __MAXFLOAT #define SET_NEG_INFINITY(x) x = -__MAXFLOAT @@ -1635,11 +1645,12 @@ _mesa_execute_program(GLcontext * ctx, case OPCODE_UP2H: /* unpack two 16-bit floats */ { GLfloat a[4], result[4]; - const GLuint *rawBits = (const GLuint *) a; + fi_type fi; GLhalfNV hx, hy; fetch_vector1(&inst->SrcReg[0], machine, a); - hx = rawBits[0] & 0xffff; - hy = rawBits[0] >> 16; + fi.f = a[0]; + hx = fi.i & 0xffff; + hy = fi.i >> 16; result[0] = result[2] = _mesa_half_to_float(hx); result[1] = result[3] = _mesa_half_to_float(hy); store_vector4(inst, machine, result); @@ -1648,11 +1659,12 @@ _mesa_execute_program(GLcontext * ctx, case OPCODE_UP2US: /* unpack two GLushorts */ { GLfloat a[4], result[4]; - const GLuint *rawBits = (const GLuint *) a; + fi_type fi; GLushort usx, usy; fetch_vector1(&inst->SrcReg[0], machine, a); - usx = rawBits[0] & 0xffff; - usy = rawBits[0] >> 16; + fi.f = a[0]; + usx = fi.i & 0xffff; + usy = fi.i >> 16; result[0] = result[2] = usx * (1.0f / 65535.0f); result[1] = result[3] = usy * (1.0f / 65535.0f); store_vector4(inst, machine, result); @@ -1661,24 +1673,26 @@ _mesa_execute_program(GLcontext * ctx, case OPCODE_UP4B: /* unpack four GLbytes */ { GLfloat a[4], result[4]; - const GLuint *rawBits = (const GLuint *) a; + fi_type fi; fetch_vector1(&inst->SrcReg[0], machine, a); - result[0] = (((rawBits[0] >> 0) & 0xff) - 128) / 127.0F; - result[1] = (((rawBits[0] >> 8) & 0xff) - 128) / 127.0F; - result[2] = (((rawBits[0] >> 16) & 0xff) - 128) / 127.0F; - result[3] = (((rawBits[0] >> 24) & 0xff) - 128) / 127.0F; + fi.f = a[0]; + result[0] = (((fi.i >> 0) & 0xff) - 128) / 127.0F; + result[1] = (((fi.i >> 8) & 0xff) - 128) / 127.0F; + result[2] = (((fi.i >> 16) & 0xff) - 128) / 127.0F; + result[3] = (((fi.i >> 24) & 0xff) - 128) / 127.0F; store_vector4(inst, machine, result); } break; case OPCODE_UP4UB: /* unpack four GLubytes */ { GLfloat a[4], result[4]; - const GLuint *rawBits = (const GLuint *) a; + fi_type fi; fetch_vector1(&inst->SrcReg[0], machine, a); - result[0] = ((rawBits[0] >> 0) & 0xff) / 255.0F; - result[1] = ((rawBits[0] >> 8) & 0xff) / 255.0F; - result[2] = ((rawBits[0] >> 16) & 0xff) / 255.0F; - result[3] = ((rawBits[0] >> 24) & 0xff) / 255.0F; + fi.f = a[0]; + result[0] = ((fi.i >> 0) & 0xff) / 255.0F; + result[1] = ((fi.i >> 8) & 0xff) / 255.0F; + result[2] = ((fi.i >> 16) & 0xff) / 255.0F; + result[3] = ((fi.i >> 24) & 0xff) / 255.0F; store_vector4(inst, machine, result); } break; -- cgit v1.2.3 From 013cf1d63deb9c33089777afbdea85013fd46b49 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Mon, 7 Dec 2009 22:22:57 +0100 Subject: radeon: fix image migration for small compressed textures memcpy would give incorrect results if src rowstride != dst rowstride --- src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c index 0415a50d0b..91f0db958b 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c @@ -437,23 +437,18 @@ static void migrate_image_to_miptree(radeon_mipmap_tree *mt, radeon_miptree_unreference(&image->mt); } else { - /* need to confirm this value is correct */ - if (_mesa_is_format_compressed(image->base.TexFormat)) { - unsigned size = _mesa_format_image_size(image->base.TexFormat, - image->base.Width, - image->base.Height, - image->base.Depth); - memcpy(dest, image->base.Data, size); - } else { - uint32_t srcrowstride; - uint32_t height; + const uint32_t srcrowstride = _mesa_format_row_stride(image->base.TexFormat, image->base.Width); + uint32_t rows = image->base.Height * image->base.Depth; - height = image->base.Height * image->base.Depth; - srcrowstride = image->base.Width * _mesa_get_format_bytes(image->base.TexFormat); - copy_rows(dest, dstlvl->rowstride, image->base.Data, srcrowstride, - height, srcrowstride); + if (_mesa_is_format_compressed(image->base.TexFormat)) { + uint32_t blockWidth, blockHeight; + _mesa_get_format_block_size(image->base.TexFormat, &blockWidth, &blockHeight); + rows = (rows + blockHeight - 1) / blockHeight; } + copy_rows(dest, dstlvl->rowstride, image->base.Data, srcrowstride, + rows, srcrowstride); + _mesa_free_texmemory(image->base.Data); image->base.Data = 0; } -- cgit v1.2.3 From 9921b3048e611398460ef774355b7515bc901240 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Mon, 7 Dec 2009 22:24:41 +0100 Subject: radeon: fix cases when only first image where put directly into miptree. Make sure that minimal width, height and depth of texture image is 1. --- src/mesa/drivers/dri/radeon/radeon_texture.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 00e0658dc5..28690325d1 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -524,9 +524,9 @@ static int image_matches_texture_obj(struct gl_texture_object *texObj, return 0; const unsigned levelDiff = level - texObj->BaseLevel; - const unsigned refWidth = baseImage->Width >> levelDiff; - const unsigned refHeight = baseImage->Height >> levelDiff; - const unsigned refDepth = baseImage->Depth >> levelDiff; + const unsigned refWidth = MAX2(baseImage->Width >> levelDiff, 1); + const unsigned refHeight = MAX2(baseImage->Height >> levelDiff, 1); + const unsigned refDepth = MAX2(baseImage->Depth >> levelDiff, 1); return (texImage->Width == refWidth && texImage->Height == refHeight && -- cgit v1.2.3 From 9dbd47fc6b1cf9ddfb318f2e05df0886cd5fe0df Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 7 Dec 2009 16:59:59 -0800 Subject: mesa: set version string to 7.6.1-rc3 --- src/mesa/main/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index e2fed57080..8a2013229a 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.h @@ -32,7 +32,7 @@ #define MESA_MAJOR 7 #define MESA_MINOR 6 #define MESA_PATCH 1 -#define MESA_VERSION_STRING "7.6.1-rc2" +#define MESA_VERSION_STRING "7.6.1-rc3" /* To make version comparison easy */ #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -- cgit v1.2.3 From bb64c9bcdf9962c4f74d71f49307de1da4c3392b Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 7 Dec 2009 17:06:07 -0800 Subject: Revert "intel: Make RGB renderbuffers use XRGB8888 like we do for RGB system buffers." This reverts commit 4598942b1b88a2a7d5af7febae7e79eedf00e385. XRGB8888 doesn't work as intended. Revert this for now, and we'll revisit it for 7.8 or something. --- src/mesa/drivers/dri/intel/intel_fbo.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index b6e0d823ed..5615040946 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -126,7 +126,7 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_RGB16: rb->Format = MESA_FORMAT_ARGB8888; rb->DataType = GL_UNSIGNED_BYTE; - irb->texformat = MESA_FORMAT_XRGB8888; + irb->texformat = MESA_FORMAT_ARGB8888; /* XXX: Need xrgb8888 */ cpp = 4; break; case GL_RGBA: @@ -314,6 +314,10 @@ intel_create_renderbuffer(gl_format format) irb->Base.DataType = GL_UNSIGNED_BYTE; break; case MESA_FORMAT_XRGB8888: + /* XXX this is a hack since XRGB surfaces don't seem to work + * properly yet. Reading the alpha channel returns 0 instead of 1. + */ + format = MESA_FORMAT_ARGB8888; irb->Base._BaseFormat = GL_RGB; irb->Base.DataType = GL_UNSIGNED_BYTE; break; -- cgit v1.2.3 From ba167f812c44c4bb8c8f844c3d5fbff60bfc93eb Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 7 Dec 2009 17:18:56 -0800 Subject: mesa: set version string to 7.7-rc1 Also modify the Makefile to use the correct version for the tarballs. --- src/mesa/main/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index fddb9a851f..fa233b9f30 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.h @@ -32,7 +32,7 @@ #define MESA_MAJOR 7 #define MESA_MINOR 7 #define MESA_PATCH 0 -#define MESA_VERSION_STRING "7.7-rc1" +#define MESA_VERSION_STRING "7.7-rc2" /* To make version comparison easy */ #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -- cgit v1.2.3 From dc0777d3e3b760d7faa5fb99a189919bde07ca0b Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Wed, 4 Nov 2009 10:00:47 +0200 Subject: r600: reorder state for render_target and blend First time around render targets are not enabled yet (done in r700SendRenderTargetState) so blend state is not emitted for any targets. Affects first glClear in some mesa tests. As a quick fix reorder state emit so that target is set first --- src/mesa/drivers/dri/r600/r700_chip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index 8707a764ac..d8661b4439 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -1250,9 +1250,9 @@ void r600InitAtoms(context_t *context) ALLOC_STATE(poly, always, 10, r700SendPolyState); ALLOC_STATE(cb, cb, 18, r700SendCBState); ALLOC_STATE(clrcmp, always, 6, r700SendCBCLRCMPState); + ALLOC_STATE(cb_target, always, 25, r700SendRenderTargetState); ALLOC_STATE(blnd, blnd, (6 + (R700_MAX_RENDER_TARGETS * 3)), r700SendCBBlendState); ALLOC_STATE(blnd_clr, always, 6, r700SendCBBlendColorState); - ALLOC_STATE(cb_target, always, 25, r700SendRenderTargetState); ALLOC_STATE(sx, always, 9, r700SendSXState); ALLOC_STATE(vgt, always, 41, r700SendVGTState); ALLOC_STATE(spi, always, (59 + R700_MAX_SHADER_EXPORTS), r700SendSPIState); -- cgit v1.2.3 From 369669ff9a7ff7636cadef8e2b13f2f28face98f Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Thu, 3 Dec 2009 12:26:44 +0200 Subject: r600: add support for TXB instruction makes testing other things easier - does not hang the card TODO: enable TEX dependency tracking in vertex programs --- src/mesa/drivers/dri/r600/r700_assembler.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 6ff08e1cfb..be875ae6b8 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -3450,22 +3450,6 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) need_barrier = GL_TRUE; } - switch (pAsm->pILInst[pAsm->uiCurInst].Opcode) - { - case OPCODE_TEX: - break; - case OPCODE_TXB: - radeon_error("do not support TXB yet\n"); - return GL_FALSE; - break; - case OPCODE_TXP: - break; - default: - radeon_error("Internal error: bad texture op (not TEX)\n"); - return GL_FALSE; - break; - } - if (pAsm->pILInst[pAsm->uiCurInst].Opcode == OPCODE_TXP) { GLuint tmp = gethelpr(pAsm); @@ -3644,7 +3628,15 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) } - pAsm->D.dst.opcode = SQ_TEX_INST_SAMPLE; + if(pAsm->pILInst[pAsm->uiCurInst].Opcode == OPCODE_TXB) + { + pAsm->D.dst.opcode = SQ_TEX_INST_SAMPLE_L; + } + else + { + pAsm->D.dst.opcode = SQ_TEX_INST_SAMPLE; + } + pAsm->is_tex = GL_TRUE; if ( GL_TRUE == need_barrier ) { -- cgit v1.2.3 From 94c6ec5809b08676f12628b49dd88ec694d07a48 Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Thu, 3 Dec 2009 18:12:45 +0200 Subject: r600: execute SET funtions on all channels seems assemble_LOGIC was meant for non-condition-code instructions so execute in for all components as previously --- src/mesa/drivers/dri/r600/r700_assembler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index cf64d170ed..fe006ef19c 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -4467,7 +4467,7 @@ GLboolean assemble_LOGIC(r700_AssemblerBase *pAsm, BITS opcode) } pAsm->D.dst.opcode = opcode; - pAsm->D.dst.math = 1; + //pAsm->D.dst.math = 1; if( GL_FALSE == assemble_dst(pAsm) ) { -- cgit v1.2.3 From c1d79a4235fa2edb05e92f9b93a105ff356a4a18 Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Fri, 4 Dec 2009 11:37:15 +0200 Subject: r600: wip glsl - refactor conditional instructions a bit remember the dst register which is used for cond updates when it's time to use the cond codes issue a separate PRED instruction --- src/mesa/drivers/dri/r600/r700_assembler.c | 379 ++++++----------------------- src/mesa/drivers/dri/r600/r700_assembler.h | 1 + 2 files changed, 70 insertions(+), 310 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index fe006ef19c..87c1638de4 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -3557,7 +3557,7 @@ GLboolean assemble_KIL(r700_AssemblerBase *pAsm, GLuint opcode) checkop2(pAsm); pAsm->D.dst.opcode = opcode; - pAsm->D.dst.math = 1; + //pAsm->D.dst.math = 1; setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); pAsm->D.dst.rtype = DST_REG_TEMPORARY; @@ -3567,17 +3567,23 @@ GLboolean assemble_KIL(r700_AssemblerBase *pAsm, GLuint opcode) pAsm->D.dst.writez = 0; pAsm->D.dst.writew = 0; - if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[0].src.reg = 0; + setswizzle_PVSSRC(&(pAsm->S[0].src), SQ_SEL_0); + noneg_PVSSRC(&(pAsm->S[0].src)); + + if( GL_FALSE == assemble_src(pAsm, 0, 1) ) { return GL_FALSE; } - if( GL_FALSE == assemble_src(pAsm, 1, -1) ) + /*if( GL_FALSE == assemble_src(pAsm, 1, -1) ) { return GL_FALSE; } - - if ( GL_FALSE == next_ins2(pAsm) ) + */ + if ( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } @@ -4494,30 +4500,32 @@ GLboolean assemble_LOGIC(r700_AssemblerBase *pAsm, BITS opcode) GLboolean assemble_LOGIC_PRED(r700_AssemblerBase *pAsm, BITS opcode) { - if( GL_FALSE == checkop2(pAsm) ) - { - return GL_FALSE; - } + struct prog_instruction *pILInst = &(pAsm->pILInst[pAsm->uiCurInst]); pAsm->D.dst.opcode = opcode; pAsm->D.dst.math = 1; pAsm->D.dst.predicated = 1; - pAsm->D2.dst2.SaturateMode = pAsm->pILInst[pAsm->uiCurInst].SaturateMode; - if( GL_FALSE == assemble_dst(pAsm) ) - { - return GL_FALSE; - } + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = pAsm->uHelpReg; + pAsm->D.dst.writex = 1; + pAsm->D.dst.writey = pAsm->D.dst.writez = pAsm->D.dst.writew = 0; - if( GL_FALSE == assemble_src(pAsm, 0, -1) ) - { - return GL_FALSE; - } + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[0].src.reg = pAsm->last_cond_register + pAsm->starting_temp_register_number; + pAsm->S[0].src.swizzlex = pILInst->DstReg.CondSwizzle & 0x7; + noneg_PVSSRC(&(pAsm->S[0].src)); - if( GL_FALSE == assemble_src(pAsm, 1, -1) ) - { - return GL_FALSE; - } + pAsm->S[1].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[1].src.reg = pAsm->uHelpReg; + setaddrmode_PVSSRC(&(pAsm->S[1].src), ADDR_ABSOLUTE); + noneg_PVSSRC(&(pAsm->S[1].src)); + pAsm->S[1].src.swizzlex = SQ_SEL_0; + pAsm->S[1].src.swizzley = SQ_SEL_0; + pAsm->S[1].src.swizzlez = SQ_SEL_0; + pAsm->S[1].src.swizzlew = SQ_SEL_0; if( GL_FALSE == next_ins2(pAsm) ) { @@ -5098,6 +5106,11 @@ GLboolean pops(r700_AssemblerBase *pAsm, GLuint pops) GLboolean assemble_IF(r700_AssemblerBase *pAsm, GLboolean bHasElse) { + pAsm->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; + + assemble_LOGIC_PRED(pAsm, SQ_OP2_INST_PRED_SETNE); + + if(GL_FALSE == add_cf_instruction(pAsm) ) { return GL_FALSE; @@ -5242,6 +5255,11 @@ GLboolean assemble_BGNLOOP(r700_AssemblerBase *pAsm) GLboolean assemble_BRK(r700_AssemblerBase *pAsm) { #ifdef USE_CF_FOR_CONTINUE_BREAK + + pAsm->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; + + assemble_LOGIC_PRED(pAsm, SQ_OP2_INST_PRED_SETNE); + unsigned int unFCSP; for(unFCSP=pAsm->FCSP; unFCSP>0; unFCSP--) { @@ -5308,6 +5326,10 @@ GLboolean assemble_BRK(r700_AssemblerBase *pAsm) GLboolean assemble_CONT(r700_AssemblerBase *pAsm) { #ifdef USE_CF_FOR_CONTINUE_BREAK + pAsm->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; + + assemble_LOGIC_PRED(pAsm, SQ_OP2_INST_PRED_SETNE); + unsigned int unFCSP; for(unFCSP=pAsm->FCSP; unFCSP>0; unFCSP--) { @@ -5848,6 +5870,12 @@ GLboolean AssembleInstr(GLuint uiFirstInst, } } #endif + if(pILInst[i].CondUpdate == 1) + { + /* remember dest register used for cond evaluation */ + /* XXX also handle PROGRAM_OUTPUT registers here? */ + pR700AsmCode->last_cond_register = pILInst[i].DstReg.Index; + } switch (pILInst[i].Opcode) { @@ -5918,9 +5946,8 @@ GLboolean AssembleInstr(GLuint uiFirstInst, case OPCODE_KIL: case OPCODE_KIL_NV: - /* done at OPCODE_SE/SGT...etc. */ - /* if ( GL_FALSE == assemble_KIL(pR700AsmCode) ) - return GL_FALSE; */ + if ( GL_FALSE == assemble_KIL(pR700AsmCode, SQ_OP2_INST_KILLGT) ) + return GL_FALSE; break; case OPCODE_LG2: if ( GL_FALSE == assemble_LG2(pR700AsmCode) ) @@ -5983,151 +6010,23 @@ GLboolean AssembleInstr(GLuint uiFirstInst, break; case OPCODE_SEQ: - if(OPCODE_IF == pILInst[i+1].Opcode) - { - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETE) ) - { - return GL_FALSE; - } - } - else if(OPCODE_BRK == pILInst[i+1].Opcode) + if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETE) ) { -#ifdef USE_CF_FOR_CONTINUE_BREAK - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; -#else - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_BREAK; -#endif - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETE) ) - { - return GL_FALSE; - } - } - else if(OPCODE_CONT == pILInst[i+1].Opcode) - { -#ifdef USE_CF_FOR_CONTINUE_BREAK - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; -#else - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_CONTINUE; -#endif - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETE) ) - { - return GL_FALSE; - } - } - else if((OPCODE_KIL == pILInst[i+1].Opcode)||(OPCODE_KIL_NV == pILInst[i+1].Opcode)) - { - if ( GL_FALSE == assemble_KIL(pR700AsmCode, SQ_OP2_INST_KILLE) ) - { - return GL_FALSE; - } - } - else - { - if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETE) ) - { - return GL_FALSE; - } + return GL_FALSE; } break; case OPCODE_SGT: - if(OPCODE_IF == pILInst[i+1].Opcode) - { - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGT) ) - { - return GL_FALSE; - } - } - else if(OPCODE_BRK == pILInst[i+1].Opcode) + if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETGT) ) { -#ifdef USE_CF_FOR_CONTINUE_BREAK - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; -#else - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_BREAK; -#endif - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGT) ) - { - return GL_FALSE; - } - } - else if(OPCODE_CONT == pILInst[i+1].Opcode) - { -#ifdef USE_CF_FOR_CONTINUE_BREAK - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; -#else - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_CONTINUE; -#endif - - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGT) ) - { - return GL_FALSE; - } - } - else if((OPCODE_KIL == pILInst[i+1].Opcode)||(OPCODE_KIL_NV == pILInst[i+1].Opcode)) - { - if ( GL_FALSE == assemble_KIL(pR700AsmCode, SQ_OP2_INST_KILLGT) ) - { - return GL_FALSE; - } - } - else - { - if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETGT) ) - { - return GL_FALSE; - } + return GL_FALSE; } break; case OPCODE_SGE: - if(OPCODE_IF == pILInst[i+1].Opcode) - { - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGE) ) - { - return GL_FALSE; - } - } - else if(OPCODE_BRK == pILInst[i+1].Opcode) - { -#ifdef USE_CF_FOR_CONTINUE_BREAK - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; -#else - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_BREAK; -#endif - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGE) ) - { - return GL_FALSE; - } - } - else if(OPCODE_CONT == pILInst[i+1].Opcode) - { -#ifdef USE_CF_FOR_CONTINUE_BREAK - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; -#else - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_CONTINUE; -#endif - - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGE) ) - { - return GL_FALSE; - } - } - else if((OPCODE_KIL == pILInst[i+1].Opcode)||(OPCODE_KIL_NV == pILInst[i+1].Opcode)) - { - if ( GL_FALSE == assemble_KIL(pR700AsmCode, SQ_OP2_INST_KILLGE) ) - { - return GL_FALSE; - } - } - else - { - if ( GL_FALSE == assemble_SGE(pR700AsmCode) ) - { - return GL_FALSE; - } + if ( GL_FALSE == assemble_SGE(pR700AsmCode) ) + { + return GL_FALSE; } break; @@ -6139,61 +6038,12 @@ GLboolean AssembleInstr(GLuint uiFirstInst, SrcRegSave[1] = pILInst[i].SrcReg[1]; pILInst[i].SrcReg[0] = SrcRegSave[1]; pILInst[i].SrcReg[1] = SrcRegSave[0]; - if(OPCODE_IF == pILInst[i+1].Opcode) - { - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGT) ) - { - pILInst[i].SrcReg[0] = SrcRegSave[0]; - pILInst[i].SrcReg[1] = SrcRegSave[1]; - return GL_FALSE; - } - } - else if(OPCODE_BRK == pILInst[i+1].Opcode) - { -#ifdef USE_CF_FOR_CONTINUE_BREAK - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; -#else - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_BREAK; -#endif - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGT) ) - { - pILInst[i].SrcReg[0] = SrcRegSave[0]; - pILInst[i].SrcReg[1] = SrcRegSave[1]; - return GL_FALSE; - } - } - else if(OPCODE_CONT == pILInst[i+1].Opcode) - { -#ifdef USE_CF_FOR_CONTINUE_BREAK - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; -#else - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_CONTINUE; -#endif - - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGT) ) - { - pILInst[i].SrcReg[0] = SrcRegSave[0]; - pILInst[i].SrcReg[1] = SrcRegSave[1]; - return GL_FALSE; - } - } - else if((OPCODE_KIL == pILInst[i+1].Opcode)||(OPCODE_KIL_NV == pILInst[i+1].Opcode)) + if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETGT) ) { - if ( GL_FALSE == assemble_KIL(pR700AsmCode, SQ_OP2_INST_KILLGT) ) - { - return GL_FALSE; - } + pILInst[i].SrcReg[0] = SrcRegSave[0]; + pILInst[i].SrcReg[1] = SrcRegSave[1]; + return GL_FALSE; } - else - { - if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETGT) ) - { - pILInst[i].SrcReg[0] = SrcRegSave[0]; - pILInst[i].SrcReg[1] = SrcRegSave[1]; - return GL_FALSE; - } - } pILInst[i].SrcReg[0] = SrcRegSave[0]; pILInst[i].SrcReg[1] = SrcRegSave[1]; } @@ -6206,60 +6056,11 @@ GLboolean AssembleInstr(GLuint uiFirstInst, SrcRegSave[1] = pILInst[i].SrcReg[1]; pILInst[i].SrcReg[0] = SrcRegSave[1]; pILInst[i].SrcReg[1] = SrcRegSave[0]; - if(OPCODE_IF == pILInst[i+1].Opcode) + if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETGE) ) { - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGE) ) - { - pILInst[i].SrcReg[0] = SrcRegSave[0]; - pILInst[i].SrcReg[1] = SrcRegSave[1]; - return GL_FALSE; - } - } - else if(OPCODE_BRK == pILInst[i+1].Opcode) - { -#ifdef USE_CF_FOR_CONTINUE_BREAK - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; -#else - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_BREAK; -#endif - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGE) ) - { - pILInst[i].SrcReg[0] = SrcRegSave[0]; - pILInst[i].SrcReg[1] = SrcRegSave[1]; - return GL_FALSE; - } - } - else if(OPCODE_CONT == pILInst[i+1].Opcode) - { -#ifdef USE_CF_FOR_CONTINUE_BREAK - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; -#else - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_CONTINUE; -#endif - - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGE) ) - { - pILInst[i].SrcReg[0] = SrcRegSave[0]; - pILInst[i].SrcReg[1] = SrcRegSave[1]; - return GL_FALSE; - } - } - else if((OPCODE_KIL == pILInst[i+1].Opcode)||(OPCODE_KIL_NV == pILInst[i+1].Opcode)) - { - if ( GL_FALSE == assemble_KIL(pR700AsmCode, SQ_OP2_INST_KILLGE) ) - { - return GL_FALSE; - } - } - else - { - if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETGE) ) - { - pILInst[i].SrcReg[0] = SrcRegSave[0]; - pILInst[i].SrcReg[1] = SrcRegSave[1]; - return GL_FALSE; - } + pILInst[i].SrcReg[0] = SrcRegSave[0]; + pILInst[i].SrcReg[1] = SrcRegSave[1]; + return GL_FALSE; } pILInst[i].SrcReg[0] = SrcRegSave[0]; pILInst[i].SrcReg[1] = SrcRegSave[1]; @@ -6267,51 +6068,9 @@ GLboolean AssembleInstr(GLuint uiFirstInst, break; case OPCODE_SNE: - if(OPCODE_IF == pILInst[i+1].Opcode) - { - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETNE) ) - { - return GL_FALSE; - } - } - else if(OPCODE_BRK == pILInst[i+1].Opcode) + if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETNE) ) { -#ifdef USE_CF_FOR_CONTINUE_BREAK - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; -#else - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_BREAK; -#endif - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETNE) ) - { - return GL_FALSE; - } - } - else if(OPCODE_CONT == pILInst[i+1].Opcode) - { -#ifdef USE_CF_FOR_CONTINUE_BREAK - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; -#else - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_CONTINUE; -#endif - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETNE) ) - { - return GL_FALSE; - } - } - else if((OPCODE_KIL == pILInst[i+1].Opcode)||(OPCODE_KIL_NV == pILInst[i+1].Opcode)) - { - if ( GL_FALSE == assemble_KIL(pR700AsmCode, SQ_OP2_INST_KILLNE) ) - { - return GL_FALSE; - } - } - else - { - if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETNE) ) - { - return GL_FALSE; - } + return GL_FALSE; } break; diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index 130fc89dae..ef1f924add 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -345,6 +345,7 @@ typedef struct r700_AssemblerBase PVSDWORD S[3]; unsigned int uLastPosUpdate; + unsigned int last_cond_register; OUT_FRAGMENT_FMT_0 fp_stOutFmt0; -- cgit v1.2.3 From 323d1fb3910d7e53cb5200ee90849b2231fd96fb Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Fri, 4 Dec 2009 12:58:36 +0200 Subject: r600: quick hack to get KIL_NV working - does condition TR only for now --- src/mesa/drivers/dri/r600/r700_assembler.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 87c1638de4..3738edbc2f 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -3554,7 +3554,10 @@ GLboolean assemble_FRC(r700_AssemblerBase *pAsm) GLboolean assemble_KIL(r700_AssemblerBase *pAsm, GLuint opcode) { - checkop2(pAsm); + struct prog_instruction *pILInst = &(pAsm->pILInst[pAsm->uiCurInst]); + + if(pILInst->Opcode == OPCODE_KIL) + checkop1(pAsm); pAsm->D.dst.opcode = opcode; //pAsm->D.dst.math = 1; @@ -3573,16 +3576,23 @@ GLboolean assemble_KIL(r700_AssemblerBase *pAsm, GLuint opcode) setswizzle_PVSSRC(&(pAsm->S[0].src), SQ_SEL_0); noneg_PVSSRC(&(pAsm->S[0].src)); - if( GL_FALSE == assemble_src(pAsm, 0, 1) ) + if(pILInst->Opcode == OPCODE_KIL_NV) { - return GL_FALSE; + setaddrmode_PVSSRC(&(pAsm->S[1].src), ADDR_ABSOLUTE); + pAsm->S[1].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[1].src.reg = 0; + setswizzle_PVSSRC(&(pAsm->S[1].src), SQ_SEL_1); + neg_PVSSRC(&(pAsm->S[1].src)); } - - /*if( GL_FALSE == assemble_src(pAsm, 1, -1) ) + else { - return GL_FALSE; + if( GL_FALSE == assemble_src(pAsm, 0, 1) ) + { + return GL_FALSE; + } + } - */ + if ( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; -- cgit v1.2.3 From 94723b60cf3dd838dfaf505450db8ef2e089399c Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Fri, 4 Dec 2009 13:53:44 +0200 Subject: r600: implement FRAG_ATTRIB_FACE, glsl/twoside works --- src/mesa/drivers/dri/r600/r700_fragprog.c | 34 ++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_fragprog.c b/src/mesa/drivers/dri/r600/r700_fragprog.c index e9ef6c8695..0cb9707ee6 100644 --- a/src/mesa/drivers/dri/r600/r700_fragprog.c +++ b/src/mesa/drivers/dri/r600/r700_fragprog.c @@ -93,7 +93,7 @@ void Map_Fragment_Program(r700_AssemblerBase *pAsm, pAsm->uiFP_AttributeMap[FRAG_ATTRIB_TEX0 + i] = pAsm->number_used_registers++; } } - + /* order has been taken care of */ #if 1 for(i=VERT_RESULT_VAR0; inumber_used_registers += unMaxVarying + 1; } #endif + unBit = 1 << FRAG_ATTRIB_FACE; + if(mesa_fp->Base.InputsRead & unBit) + { + pAsm->uiFP_AttributeMap[FRAG_ATTRIB_FACE] = pAsm->number_used_registers++; + } /* Map temporary registers (GPRs) */ pAsm->starting_temp_register_number = pAsm->number_used_registers; @@ -451,6 +456,20 @@ GLboolean r700SetupFragmentProgram(GLcontext * ctx) CLEARbit(r700->SPI_INPUT_Z.u32All, PROVIDE_Z_TO_SPI_bit); } + if (mesa_fp->Base.InputsRead & (1 << FRAG_ATTRIB_FACE)) + { + ui += 1; + SETfield(r700->SPI_PS_IN_CONTROL_0.u32All, ui, NUM_INTERP_shift, NUM_INTERP_mask); + SETbit(r700->SPI_PS_IN_CONTROL_1.u32All, FRONT_FACE_ENA_bit); + SETbit(r700->SPI_PS_IN_CONTROL_1.u32All, FRONT_FACE_ALL_BITS_bit); + SETfield(r700->SPI_PS_IN_CONTROL_1.u32All, pAsm->uiFP_AttributeMap[FRAG_ATTRIB_FACE], FRONT_FACE_ADDR_shift, FRONT_FACE_ADDR_mask); + } + else + { + CLEARbit(r700->SPI_PS_IN_CONTROL_1.u32All, FRONT_FACE_ENA_bit); + } + + ui = (unNumOfReg < ui) ? ui : unNumOfReg; SETfield(r700->ps.SQ_PGM_RESOURCES_PS.u32All, ui, NUM_GPRS_shift, NUM_GPRS_mask); @@ -535,6 +554,19 @@ GLboolean r700SetupFragmentProgram(GLcontext * ctx) } } + unBit = 1 << FRAG_ATTRIB_FACE; + if(mesa_fp->Base.InputsRead & unBit) + { + ui = pAsm->uiFP_AttributeMap[FRAG_ATTRIB_FACE]; + SETbit(r700->SPI_PS_INPUT_CNTL[ui].u32All, SEL_CENTROID_bit); + SETfield(r700->SPI_PS_INPUT_CNTL[ui].u32All, ui, + SEMANTIC_shift, SEMANTIC_mask); + if (r700->SPI_INTERP_CONTROL_0.u32All & FLAT_SHADE_ENA_bit) + SETbit(r700->SPI_PS_INPUT_CNTL[ui].u32All, FLAT_SHADE_bit); + else + CLEARbit(r700->SPI_PS_INPUT_CNTL[ui].u32All, FLAT_SHADE_bit); + } + for(i=VERT_RESULT_VAR0; i Date: Fri, 4 Dec 2009 16:36:41 +0200 Subject: r600: glsl - allow specifying texture sampler via uniforms looks kinda hackish, should rethink later --- src/mesa/drivers/dri/r600/r700_assembler.c | 2 +- src/mesa/drivers/dri/r600/r700_assembler.h | 1 + src/mesa/drivers/dri/r600/r700_fragprog.c | 5 +++++ src/mesa/drivers/dri/r600/r700_vertprog.c | 4 ++++ 4 files changed, 11 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 3738edbc2f..158c5fa549 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -4840,7 +4840,7 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) pAsm->need_tex_barrier = GL_TRUE; } // Set src1 to tex unit id - pAsm->S[1].src.reg = pAsm->pILInst[pAsm->uiCurInst].TexSrcUnit; + pAsm->S[1].src.reg = pAsm->SamplerUnits[pAsm->pILInst[pAsm->uiCurInst].TexSrcUnit]; pAsm->S[1].src.rtype = SRC_REG_TEMPORARY; //No sw info from mesa compiler, so hard code here. diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index ef1f924add..48ffef501f 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -416,6 +416,7 @@ typedef struct r700_AssemblerBase SHADER_PIPE_TYPE currentShaderType; struct prog_instruction * pILInst; GLuint uiCurInst; + GLubyte SamplerUnits[MAX_SAMPLERS]; GLboolean bR6xx; /* helper to decide which type of instruction to assemble */ GLboolean is_tex; diff --git a/src/mesa/drivers/dri/r600/r700_fragprog.c b/src/mesa/drivers/dri/r600/r700_fragprog.c index 0cb9707ee6..8eb439a951 100644 --- a/src/mesa/drivers/dri/r600/r700_fragprog.c +++ b/src/mesa/drivers/dri/r600/r700_fragprog.c @@ -308,6 +308,7 @@ GLboolean r700TranslateFragmentShader(struct r700_fragment_program *fp, GLuint number_of_colors_exported; GLboolean z_enabled = GL_FALSE; GLuint unBit; + int i; //Init_Program Init_r700_AssemblerBase( SPT_FP, &(fp->r700AsmCode), &(fp->r700Shader) ); @@ -320,6 +321,10 @@ GLboolean r700TranslateFragmentShader(struct r700_fragment_program *fp, InitShaderProgram(&(fp->r700AsmCode)); + for(i=0; i < MAX_SAMPLERS; i++) + { + fp->r700AsmCode.SamplerUnits[i] = fp->mesa_program.Base.SamplerUnits[i]; + } if( GL_FALSE == AssembleInstr(0, mesa_fp->Base.NumInstructions, &(mesa_fp->Base.Instructions[0]), diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.c b/src/mesa/drivers/dri/r600/r700_vertprog.c index d3d1da7959..759b74dc7e 100644 --- a/src/mesa/drivers/dri/r600/r700_vertprog.c +++ b/src/mesa/drivers/dri/r600/r700_vertprog.c @@ -337,6 +337,10 @@ struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, InitShaderProgram(&(vp->r700AsmCode)); + for(i=0; i < MAX_SAMPLERS; i++) + { + vp->r700AsmCode.SamplerUnits[i] = vp->mesa_program->Base.SamplerUnits[i]; + } if(GL_FALSE == AssembleInstr(0, vp->mesa_program->Base.NumInstructions, &(vp->mesa_program->Base.Instructions[0]), -- cgit v1.2.3 From 17e212e2631cd652c28378399806c3b3bd293e9a Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Mon, 7 Dec 2009 11:51:36 +0200 Subject: r600: add ABS support for source regs to assembler use it in tex cube instruction sequence --- src/mesa/drivers/dri/r600/r700_assembler.c | 27 +++++---------------------- src/mesa/drivers/dri/r600/r700_assembler.h | 7 ++++--- 2 files changed, 9 insertions(+), 25 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 158c5fa549..2f8038adb3 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -2350,8 +2350,8 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) { alu_instruction_ptr->m_Word1_OP2.f6.alu_inst = pAsm->D.dst.opcode; - alu_instruction_ptr->m_Word1_OP2.f6.src0_abs = 0x0; - alu_instruction_ptr->m_Word1_OP2.f6.src1_abs = 0x0; + alu_instruction_ptr->m_Word1_OP2.f6.src0_abs = pAsm->S[0].src.abs; + alu_instruction_ptr->m_Word1_OP2.f6.src1_abs = pAsm->S[1].src.abs; //alu_instruction_ptr->m_Word1_OP2.f6.update_execute_mask = 0x0; //alu_instruction_ptr->m_Word1_OP2.f6.update_pred = 0x0; @@ -2379,8 +2379,8 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) { alu_instruction_ptr->m_Word1_OP2.f.alu_inst = pAsm->D.dst.opcode; - alu_instruction_ptr->m_Word1_OP2.f.src0_abs = 0x0; - alu_instruction_ptr->m_Word1_OP2.f.src1_abs = 0x0; + alu_instruction_ptr->m_Word1_OP2.f.src0_abs = pAsm->S[0].src.abs; + alu_instruction_ptr->m_Word1_OP2.f.src1_abs = pAsm->S[1].src.abs; //alu_instruction_ptr->m_Word1_OP2.f.update_execute_mask = 0x0; //alu_instruction_ptr->m_Word1_OP2.f.update_pred = 0x0; @@ -4721,24 +4721,6 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) return GL_FALSE; } - /* tmp1.z = ABS(tmp1.z) dont have abs support in assembler currently - * have to do explicit instruction - */ - pAsm->D.dst.opcode = SQ_OP2_INST_MAX; - setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); - pAsm->D.dst.rtype = DST_REG_TEMPORARY; - pAsm->D.dst.reg = tmp1; - pAsm->D.dst.writez = 1; - - setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); - pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; - pAsm->S[0].src.reg = tmp1; - noswizzle_PVSSRC(&(pAsm->S[0].src)); - pAsm->S[1].bits = pAsm->S[0].bits; - flipneg_PVSSRC(&(pAsm->S[1].src)); - - next_ins(pAsm); - /* tmp1.z = RCP_e(|tmp1.z|) */ pAsm->D.dst.opcode = SQ_OP2_INST_RECIP_IEEE; pAsm->D.dst.math = 1; @@ -4751,6 +4733,7 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; pAsm->S[0].src.reg = tmp1; pAsm->S[0].src.swizzlex = SQ_SEL_Z; + pAsm->S[0].src.abs = 1; next_ins(pAsm); diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index 48ffef501f..cfa2610a55 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -120,14 +120,15 @@ typedef struct PVSINSTtag typedef struct PVSSRCtag { - BITS rtype:4; + BITS rtype:3; BITS addrmode0:1; - BITS reg:10; //15 (8) + BITS reg:10; //14 (8) BITS swizzlex:3; BITS swizzley:3; BITS swizzlez:3; - BITS swizzlew:3; //27 + BITS swizzlew:3; //26 + BITS abs:1; BITS negx:1; BITS negy:1; BITS negz:1; -- cgit v1.2.3 From 602ba357edd640e0db17911b39d3ecfbf5675230 Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Mon, 7 Dec 2009 13:04:32 +0200 Subject: r600: merge alu_instruction/alu_instruction2 --- src/mesa/drivers/dri/r600/r700_assembler.c | 320 +++-------------------------- src/mesa/drivers/dri/r600/r700_assembler.h | 6 +- 2 files changed, 29 insertions(+), 297 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 2f8038adb3..8155d53eeb 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -1292,6 +1292,15 @@ GLboolean assemble_dst(r700_AssemblerBase *pAsm) pAsm->D.dst.writez = (pILInst->DstReg.WriteMask >> 2) & 0x1; pAsm->D.dst.writew = (pILInst->DstReg.WriteMask >> 3) & 0x1; + if(pILInst->SaturateMode == SATURATE_ZERO_ONE) + { + pAsm->D2.dst2.SaturateMode = 1; + } + else + { + pAsm->D2.dst2.SaturateMode = 0; + } + return GL_TRUE; } @@ -2270,7 +2279,7 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) } //other bits - alu_instruction_ptr->m_Word0.f.index_mode = SQ_INDEX_AR_X; + alu_instruction_ptr->m_Word0.f.index_mode = pAsm->D2.dst2.index_mode; if( (is_single_scalar_operation == GL_TRUE) || (GL_TRUE == bSplitInst) ) @@ -2282,9 +2291,17 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) alu_instruction_ptr->m_Word0.f.last = (scalar_channel_index == 3) ? 1 : 0; } - alu_instruction_ptr->m_Word0.f.pred_sel = 0x0; - alu_instruction_ptr->m_Word1_OP2.f.update_pred = 0x0; - alu_instruction_ptr->m_Word1_OP2.f.update_execute_mask = 0x0; + alu_instruction_ptr->m_Word0.f.pred_sel = (pAsm->D.dst.pred_inv > 0) ? 1 : 0; + if(1 == pAsm->D.dst.predicated) + { + alu_instruction_ptr->m_Word1_OP2.f.update_pred = 0x1; + alu_instruction_ptr->m_Word1_OP2.f.update_execute_mask = 0x1; + } + else + { + alu_instruction_ptr->m_Word1_OP2.f.update_pred = 0x0; + alu_instruction_ptr->m_Word1_OP2.f.update_execute_mask = 0x0; + } // dst if( (pAsm->D.dst.rtype == DST_REG_TEMPORARY) || @@ -2323,7 +2340,7 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) alu_instruction_ptr->m_Word1.f.dst_chan = scalar_channel_index; - alu_instruction_ptr->m_Word1.f.clamp = pAsm->pILInst[pAsm->uiCurInst].SaturateMode; + alu_instruction_ptr->m_Word1.f.clamp = pAsm->D2.dst2.SaturateMode; if (pAsm->D.dst.op3) { @@ -2436,253 +2453,6 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) return GL_TRUE; } -GLboolean assemble_alu_instruction2(r700_AssemblerBase *pAsm) -{ - GLuint number_of_scalar_operations; - GLboolean is_single_scalar_operation; - GLuint scalar_channel_index; - - PVSSRC * pcurrent_source; - int current_source_index; - GLuint contiguous_slots_needed; - - GLuint uNumSrc = r700GetNumOperands(pAsm); - - GLboolean bSplitInst = GL_FALSE; - - if (1 == pAsm->D.dst.math) - { - is_single_scalar_operation = GL_TRUE; - number_of_scalar_operations = 1; - } - else - { - is_single_scalar_operation = GL_FALSE; - number_of_scalar_operations = 4; - } - - contiguous_slots_needed = 0; - - if(GL_TRUE == is_reduction_opcode(&(pAsm->D)) ) - { - contiguous_slots_needed = 4; - } - - initialize(pAsm); - - for (scalar_channel_index=0; - scalar_channel_index < number_of_scalar_operations; - scalar_channel_index++) - { - R700ALUInstruction* alu_instruction_ptr = (R700ALUInstruction*) CALLOC_STRUCT(R700ALUInstruction); - if (alu_instruction_ptr == NULL) - { - return GL_FALSE; - } - Init_R700ALUInstruction(alu_instruction_ptr); - - //src 0 - current_source_index = 0; - pcurrent_source = &(pAsm->S[0].src); - - if (GL_FALSE == assemble_alu_src(alu_instruction_ptr, - current_source_index, - pcurrent_source, - scalar_channel_index) ) - { - return GL_FALSE; - } - - if (uNumSrc > 1) - { - // Process source 1 - current_source_index = 1; - pcurrent_source = &(pAsm->S[current_source_index].src); - - if (GL_FALSE == assemble_alu_src(alu_instruction_ptr, - current_source_index, - pcurrent_source, - scalar_channel_index) ) - { - return GL_FALSE; - } - } - - //other bits - alu_instruction_ptr->m_Word0.f.index_mode = SQ_INDEX_LOOP; - - if( (is_single_scalar_operation == GL_TRUE) - || (GL_TRUE == bSplitInst) ) - { - alu_instruction_ptr->m_Word0.f.last = 1; - } - else - { - alu_instruction_ptr->m_Word0.f.last = (scalar_channel_index == 3) ? 1 : 0; - } - - alu_instruction_ptr->m_Word0.f.pred_sel = (pAsm->D.dst.pred_inv > 0) ? 1 : 0; - if(1 == pAsm->D.dst.predicated) - { - alu_instruction_ptr->m_Word1_OP2.f.update_pred = 0x1; - alu_instruction_ptr->m_Word1_OP2.f.update_execute_mask = 0x1; - } - else - { - alu_instruction_ptr->m_Word1_OP2.f.update_pred = 0x0; - alu_instruction_ptr->m_Word1_OP2.f.update_execute_mask = 0x0; - } - - // dst - if( (pAsm->D.dst.rtype == DST_REG_TEMPORARY) || - (pAsm->D.dst.rtype == DST_REG_OUT) ) - { - alu_instruction_ptr->m_Word1.f.dst_gpr = pAsm->D.dst.reg; - } - else - { - radeon_error("Only temp destination registers supported for ALU dest regs.\n"); - return GL_FALSE; - } - - alu_instruction_ptr->m_Word1.f.dst_rel = SQ_ABSOLUTE; //D.rtype - - if ( is_single_scalar_operation == GL_TRUE ) - { - // Override scalar_channel_index since only one scalar value will be written - if(pAsm->D.dst.writex) - { - scalar_channel_index = 0; - } - else if(pAsm->D.dst.writey) - { - scalar_channel_index = 1; - } - else if(pAsm->D.dst.writez) - { - scalar_channel_index = 2; - } - else if(pAsm->D.dst.writew) - { - scalar_channel_index = 3; - } - } - - alu_instruction_ptr->m_Word1.f.dst_chan = scalar_channel_index; - - alu_instruction_ptr->m_Word1.f.clamp = pAsm->D2.dst2.SaturateMode; - - if (pAsm->D.dst.op3) - { - //op3 - - alu_instruction_ptr->m_Word1_OP3.f.alu_inst = pAsm->D.dst.opcode; - - //There's 3rd src for op3 - current_source_index = 2; - pcurrent_source = &(pAsm->S[current_source_index].src); - - if ( GL_FALSE == assemble_alu_src(alu_instruction_ptr, - current_source_index, - pcurrent_source, - scalar_channel_index) ) - { - return GL_FALSE; - } - } - else - { - //op2 - if (pAsm->bR6xx) - { - alu_instruction_ptr->m_Word1_OP2.f6.alu_inst = pAsm->D.dst.opcode; - - alu_instruction_ptr->m_Word1_OP2.f6.src0_abs = 0x0; - alu_instruction_ptr->m_Word1_OP2.f6.src1_abs = 0x0; - - //alu_instruction_ptr->m_Word1_OP2.f6.update_execute_mask = 0x0; - //alu_instruction_ptr->m_Word1_OP2.f6.update_pred = 0x0; - switch (scalar_channel_index) - { - case 0: - alu_instruction_ptr->m_Word1_OP2.f6.write_mask = pAsm->D.dst.writex; - break; - case 1: - alu_instruction_ptr->m_Word1_OP2.f6.write_mask = pAsm->D.dst.writey; - break; - case 2: - alu_instruction_ptr->m_Word1_OP2.f6.write_mask = pAsm->D.dst.writez; - break; - case 3: - alu_instruction_ptr->m_Word1_OP2.f6.write_mask = pAsm->D.dst.writew; - break; - default: - alu_instruction_ptr->m_Word1_OP2.f6.write_mask = 1; //SQ_SEL_MASK; - break; - } - alu_instruction_ptr->m_Word1_OP2.f6.omod = SQ_ALU_OMOD_OFF; - } - else - { - alu_instruction_ptr->m_Word1_OP2.f.alu_inst = pAsm->D.dst.opcode; - - alu_instruction_ptr->m_Word1_OP2.f.src0_abs = 0x0; - alu_instruction_ptr->m_Word1_OP2.f.src1_abs = 0x0; - - //alu_instruction_ptr->m_Word1_OP2.f.update_execute_mask = 0x0; - //alu_instruction_ptr->m_Word1_OP2.f.update_pred = 0x0; - switch (scalar_channel_index) - { - case 0: - alu_instruction_ptr->m_Word1_OP2.f.write_mask = pAsm->D.dst.writex; - break; - case 1: - alu_instruction_ptr->m_Word1_OP2.f.write_mask = pAsm->D.dst.writey; - break; - case 2: - alu_instruction_ptr->m_Word1_OP2.f.write_mask = pAsm->D.dst.writez; - break; - case 3: - alu_instruction_ptr->m_Word1_OP2.f.write_mask = pAsm->D.dst.writew; - break; - default: - alu_instruction_ptr->m_Word1_OP2.f.write_mask = 1; //SQ_SEL_MASK; - break; - } - alu_instruction_ptr->m_Word1_OP2.f.omod = SQ_ALU_OMOD_OFF; - } - } - - if(GL_FALSE == add_alu_instruction(pAsm, alu_instruction_ptr, contiguous_slots_needed) ) - { - return GL_FALSE; - } - - /* - * Judge the type of current instruction, is it vector or scalar - * instruction. - */ - if (is_single_scalar_operation) - { - if(GL_FALSE == check_scalar(pAsm, alu_instruction_ptr) ) - { - return GL_FALSE; - } - } - else - { - if(GL_FALSE == check_vector(pAsm, alu_instruction_ptr) ) - { - return GL_FALSE; - } - } - - contiguous_slots_needed = 0; - } - - return GL_TRUE; -} - GLboolean assemble_alu_instruction_literal(r700_AssemblerBase *pAsm, GLfloat * pLiteral) { R700ALUInstruction * alu_instruction_ptr; @@ -2987,44 +2757,6 @@ GLboolean next_ins(r700_AssemblerBase *pAsm) pAsm->S[2].bits = 0; pAsm->is_tex = GL_FALSE; pAsm->need_tex_barrier = GL_FALSE; - - return GL_TRUE; -} - -GLboolean next_ins2(r700_AssemblerBase *pAsm) -{ - struct prog_instruction *pILInst = &(pAsm->pILInst[pAsm->uiCurInst]); - - //ALU - if( GL_FALSE == assemble_alu_instruction2(pAsm) ) - { - radeon_error("Error assembling ALU instruction\n"); - return GL_FALSE; - } - - if(pAsm->D.dst.rtype == DST_REG_OUT) - { - if(pAsm->D.dst.op3) - { - // There is no mask for OP3 instructions, so all channels are written - pAsm->pucOutMask[pAsm->D.dst.reg - pAsm->starting_export_register_number] = 0xF; - } - else - { - pAsm->pucOutMask[pAsm->D.dst.reg - pAsm->starting_export_register_number] - |= (unsigned char)pAsm->pILInst[pAsm->uiCurInst].DstReg.WriteMask; - } - } - - //reset for next inst. - pAsm->D.bits = 0; - pAsm->D2.bits = 0; - pAsm->S[0].bits = 0; - pAsm->S[1].bits = 0; - pAsm->S[2].bits = 0; - pAsm->is_tex = GL_FALSE; - pAsm->need_tex_barrier = GL_FALSE; - pAsm->D2.bits = 0; return GL_TRUE; @@ -4537,7 +4269,7 @@ GLboolean assemble_LOGIC_PRED(r700_AssemblerBase *pAsm, BITS opcode) pAsm->S[1].src.swizzlez = SQ_SEL_0; pAsm->S[1].src.swizzlew = SQ_SEL_0; - if( GL_FALSE == next_ins2(pAsm) ) + if( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } @@ -5683,6 +5415,7 @@ GLboolean setRetInLoopFlag(r700_AssemblerBase *pAsm, GLuint flagValue) pAsm->D.dst.predicated = 0; /* in reloc where dislink flag init inst, only one slot alu inst is handled. */ pAsm->D.dst.math = 1; /* TODO : not math really, but one channel op, more generic alu assembler needed */ + pAsm->D2.dst2.index_mode = SQ_INDEX_LOOP; /* Check this ! */ #if 0 pAsm->S[0].src.rtype = SRC_REC_LITERAL; //pAsm->S[0].src.reg = 0; @@ -5707,7 +5440,7 @@ GLboolean setRetInLoopFlag(r700_AssemblerBase *pAsm, GLuint flagValue) pAsm->S[0].src.swizzlez = flagValue; pAsm->S[0].src.swizzlew = flagValue; - if( GL_FALSE == next_ins2(pAsm) ) + if( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } @@ -5735,6 +5468,7 @@ GLboolean testFlag(r700_AssemblerBase *pAsm) pAsm->D2.dst2.literal = 1; pAsm->D2.dst2.SaturateMode = SATURATE_OFF; pAsm->D.dst.predicated = 1; + pAsm->D2.dst2.index_mode = SQ_INDEX_LOOP; /* Check this ! */ pAsm->S[0].src.rtype = DST_REG_TEMPORARY; pAsm->S[0].src.reg = pAsm->flag_reg_index; @@ -5768,7 +5502,7 @@ GLboolean testFlag(r700_AssemblerBase *pAsm) pAsm->S[1].src.swizzlez = SQ_SEL_1; pAsm->S[1].src.swizzlew = SQ_SEL_1; - if( GL_FALSE == next_ins2(pAsm) ) + if( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index cfa2610a55..cb7685464d 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -116,6 +116,7 @@ typedef struct PVSINSTtag { BITS literal :2; BITS SaturateMode :2; + BITS index_mode :3; } PVSINST; typedef struct PVSSRCtag @@ -529,10 +530,7 @@ GLboolean check_vector(r700_AssemblerBase* pAsm, GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm); GLboolean next_ins(r700_AssemblerBase *pAsm); -GLboolean next_ins2(r700_AssemblerBase *pAsm); -GLboolean assemble_alu_instruction2(r700_AssemblerBase *pAsm); - -/* TODO : merge next_ins/2/literal, assemble_alu_instruction/2/literal */ +/* TODO : merge next_ins/literal, assemble_alu_instruction/literal */ GLboolean next_ins_literal(r700_AssemblerBase *pAsm, GLfloat * pLiteral); GLboolean assemble_alu_instruction_literal(r700_AssemblerBase *pAsm, GLfloat * pLiteral); -- cgit v1.2.3 From 4e86cedf5b7ab98dbe59115fc325f9b3172d58be Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Mon, 7 Dec 2009 15:23:40 +0200 Subject: r600: add assembler support for literal(inline) constants and use it in cubemap instruction sequence for testing --- src/mesa/drivers/dri/r600/r700_assembler.c | 67 +++++++++++++++++++++--------- src/mesa/drivers/dri/r600/r700_assembler.h | 3 +- 2 files changed, 49 insertions(+), 21 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 8155d53eeb..c1e3377af6 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -1733,7 +1733,7 @@ GLboolean add_alu_instruction(r700_AssemblerBase* pAsm, } else { - pAsm->cf_current_alu_clause_ptr->m_Word1.f.count++; + pAsm->cf_current_alu_clause_ptr->m_Word1.f.count += (GetInstructionSize(alu_instruction_ptr->m_ShaderInstType) / 2); } // If this clause constains any instruction that is forward dependent on a TEX instruction, @@ -2168,6 +2168,10 @@ GLboolean check_vector(r700_AssemblerBase* pAsm, GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) { + R700ALUInstruction * alu_instruction_ptr; + R700ALUInstructionHalfLiteral * alu_instruction_ptr_hl; + R700ALUInstructionFullLiteral * alu_instruction_ptr_fl; + GLuint number_of_scalar_operations; GLboolean is_single_scalar_operation; GLuint scalar_channel_index; @@ -2238,18 +2242,39 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) contiguous_slots_needed = 4; } + contiguous_slots_needed += pAsm->D2.dst2.literal_slots; + initialize(pAsm); for (scalar_channel_index=0; scalar_channel_index < number_of_scalar_operations; scalar_channel_index++) { - R700ALUInstruction* alu_instruction_ptr = (R700ALUInstruction*) CALLOC_STRUCT(R700ALUInstruction); - if (alu_instruction_ptr == NULL) - { - return GL_FALSE; - } - Init_R700ALUInstruction(alu_instruction_ptr); + if(scalar_channel_index == (number_of_scalar_operations-1)) + { + switch(pAsm->D2.dst2.literal_slots) + { + case 0: + alu_instruction_ptr = (R700ALUInstruction*) CALLOC_STRUCT(R700ALUInstruction); + Init_R700ALUInstruction(alu_instruction_ptr); + break; + case 1: + alu_instruction_ptr_hl = (R700ALUInstructionHalfLiteral*) CALLOC_STRUCT(R700ALUInstructionHalfLiteral); + Init_R700ALUInstructionHalfLiteral(alu_instruction_ptr_hl, pAsm->C[0].f, pAsm->C[1].f); + alu_instruction_ptr = (R700ALUInstruction*)alu_instruction_ptr_hl; + break; + case 2: + alu_instruction_ptr_fl = (R700ALUInstructionFullLiteral*) CALLOC_STRUCT(R700ALUInstructionFullLiteral); + Init_R700ALUInstructionFullLiteral(alu_instruction_ptr_fl,pAsm->C[0].f, pAsm->C[1].f, pAsm->C[2].f, pAsm->C[3].f); + alu_instruction_ptr = (R700ALUInstruction*)alu_instruction_ptr_fl; + break; + }; + } + else + { + alu_instruction_ptr = (R700ALUInstruction*) CALLOC_STRUCT(R700ALUInstruction); + Init_R700ALUInstruction(alu_instruction_ptr); + } //src 0 current_source_index = 0; @@ -2447,12 +2472,12 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) } } - contiguous_slots_needed = 0; + contiguous_slots_needed -= 1; } return GL_TRUE; } - +#if 0 GLboolean assemble_alu_instruction_literal(r700_AssemblerBase *pAsm, GLfloat * pLiteral) { R700ALUInstruction * alu_instruction_ptr; @@ -2705,7 +2730,7 @@ GLboolean assemble_alu_instruction_literal(r700_AssemblerBase *pAsm, GLfloat * p return GL_TRUE; } - +#endif GLboolean next_ins(r700_AssemblerBase *pAsm) { struct prog_instruction *pILInst = &(pAsm->pILInst[pAsm->uiCurInst]); @@ -2758,11 +2783,11 @@ GLboolean next_ins(r700_AssemblerBase *pAsm) pAsm->is_tex = GL_FALSE; pAsm->need_tex_barrier = GL_FALSE; pAsm->D2.bits = 0; - + pAsm->C[0].bits = pAsm->C[1].bits = pAsm->C[2].bits = pAsm->C[3].bits = 0; return GL_TRUE; } -/* not work yet */ +#if 0/* not work yet */ GLboolean next_ins_literal(r700_AssemblerBase *pAsm, GLfloat * pLiteral) { struct prog_instruction *pILInst = &(pAsm->pILInst[pAsm->uiCurInst]); @@ -2784,7 +2809,7 @@ GLboolean next_ins_literal(r700_AssemblerBase *pAsm, GLfloat * pLiteral) pAsm->need_tex_barrier = GL_FALSE; return GL_TRUE; } - +#endif GLboolean assemble_math_function(r700_AssemblerBase* pAsm, BITS opcode) { BITS tmp; @@ -4472,13 +4497,14 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) /* MULADD R0.x, R0.x, PS1, (0x3FC00000, 1.5f).x * MULADD R0.y, R0.y, PS1, (0x3FC00000, 1.5f).x * muladd has no writemask, have to use another temp - * also no support for imm constants, so add 1 here */ pAsm->D.dst.opcode = SQ_OP3_INST_MULADD; pAsm->D.dst.op3 = 1; setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); pAsm->D.dst.rtype = DST_REG_TEMPORARY; pAsm->D.dst.reg = tmp2; + pAsm->D2.dst2.literal_slots = 1; + pAsm->C[0].f = 1.5F; setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; @@ -4489,12 +4515,13 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) pAsm->S[1].src.reg = tmp1; setswizzle_PVSSRC(&(pAsm->S[1].src), SQ_SEL_Z); setaddrmode_PVSSRC(&(pAsm->S[2].src), ADDR_ABSOLUTE); - pAsm->S[2].src.rtype = SRC_REG_TEMPORARY; + /* immediate c 1.5 */ + pAsm->S[2].src.rtype = SRC_REC_LITERAL; pAsm->S[2].src.reg = tmp1; - setswizzle_PVSSRC(&(pAsm->S[2].src), SQ_SEL_1); + setswizzle_PVSSRC(&(pAsm->S[2].src), SQ_SEL_X); next_ins(pAsm); - +#if 0 /* ADD the remaining .5 */ pAsm->D.dst.opcode = SQ_OP2_INST_ADD; setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); @@ -4515,7 +4542,7 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) noswizzle_PVSSRC(&(pAsm->S[1].src)); next_ins(pAsm); - +#endif /* tmp1.xy = temp2.xy */ pAsm->D.dst.opcode = SQ_OP2_INST_MOV; setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); @@ -5410,7 +5437,7 @@ GLboolean setRetInLoopFlag(r700_AssemblerBase *pAsm, GLuint flagValue) pAsm->D.dst.writey = 0; pAsm->D.dst.writez = 0; pAsm->D.dst.writew = 0; - pAsm->D2.dst2.literal = 1; + pAsm->D2.dst2.literal_slots = 1; pAsm->D2.dst2.SaturateMode = SATURATE_OFF; pAsm->D.dst.predicated = 0; /* in reloc where dislink flag init inst, only one slot alu inst is handled. */ @@ -5465,7 +5492,7 @@ GLboolean testFlag(r700_AssemblerBase *pAsm) pAsm->D.dst.writey = 0; pAsm->D.dst.writez = 0; pAsm->D.dst.writew = 0; - pAsm->D2.dst2.literal = 1; + pAsm->D2.dst2.literal_slots = 1; pAsm->D2.dst2.SaturateMode = SATURATE_OFF; pAsm->D.dst.predicated = 1; pAsm->D2.dst2.index_mode = SQ_INDEX_LOOP; /* Check this ! */ diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index cb7685464d..3fe65654ca 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -114,7 +114,7 @@ typedef struct PVSDSTtag typedef struct PVSINSTtag { - BITS literal :2; + BITS literal_slots :2; BITS SaturateMode :2; BITS index_mode :3; } PVSINST; @@ -345,6 +345,7 @@ typedef struct r700_AssemblerBase PVSDWORD D; PVSDWORD D2; PVSDWORD S[3]; + PVSDWORD C[4]; unsigned int uLastPosUpdate; unsigned int last_cond_register; -- cgit v1.2.3 From 2b8b16f6a6ce6091d4939cfb567a65a52757dff0 Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Mon, 7 Dec 2009 16:09:10 +0200 Subject: r600: use the new inline constants feature to fix COS --- src/mesa/drivers/dri/r600/r700_assembler.c | 37 +++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index c1e3377af6..660410f1ad 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -3041,7 +3041,42 @@ GLboolean assemble_CMP(r700_AssemblerBase *pAsm) GLboolean assemble_COS(r700_AssemblerBase *pAsm) { - return assemble_math_function(pAsm, SQ_OP2_INST_COS); + int tmp; + //return assemble_math_function(pAsm, SQ_OP2_INST_COS); + checkop1(pAsm); + + tmp = gethelpr(pAsm); + + pAsm->D.dst.opcode = SQ_OP2_INST_MUL; + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = tmp; + pAsm->D.dst.writex = 1; + + assemble_src(pAsm, 0, -1); + + pAsm->S[1].src.rtype = SRC_REC_LITERAL; + setswizzle_PVSSRC(&(pAsm->S[1].src), SQ_SEL_X); + pAsm->D2.dst2.literal_slots = 1; + pAsm->C[0].f = 1/(3.1415926535 * 2); + pAsm->C[1].f = 0.0F; + next_ins(pAsm); + + pAsm->D.dst.opcode = SQ_OP2_INST_COS; + pAsm->D.dst.math = 1; + + assemble_dst(pAsm); + + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[0].src.reg = tmp; + setswizzle_PVSSRC(&(pAsm->S[0].src), SQ_SEL_X); + noneg_PVSSRC(&(pAsm->S[0].src)); + + next_ins(pAsm); + + return GL_TRUE; + } GLboolean assemble_DOT(r700_AssemblerBase *pAsm) -- cgit v1.2.3 From fbe06a9c2999a802333f8310156d58045d723799 Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Mon, 7 Dec 2009 16:23:07 +0200 Subject: r600: fix SIN also --- src/mesa/drivers/dri/r600/r700_assembler.c | 15 +++++---------- src/mesa/drivers/dri/r600/r700_assembler.h | 3 +-- 2 files changed, 6 insertions(+), 12 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 660410f1ad..caccedabdf 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -3039,10 +3039,9 @@ GLboolean assemble_CMP(r700_AssemblerBase *pAsm) return GL_TRUE; } -GLboolean assemble_COS(r700_AssemblerBase *pAsm) +GLboolean assemble_TRIG(r700_AssemblerBase *pAsm, BITS opcode) { int tmp; - //return assemble_math_function(pAsm, SQ_OP2_INST_COS); checkop1(pAsm); tmp = gethelpr(pAsm); @@ -3062,7 +3061,7 @@ GLboolean assemble_COS(r700_AssemblerBase *pAsm) pAsm->C[1].f = 0.0F; next_ins(pAsm); - pAsm->D.dst.opcode = SQ_OP2_INST_COS; + pAsm->D.dst.opcode = opcode; pAsm->D.dst.math = 1; assemble_dst(pAsm); @@ -3075,6 +3074,7 @@ GLboolean assemble_COS(r700_AssemblerBase *pAsm) next_ins(pAsm); + //TODO - replicate if more channels set in WriteMask return GL_TRUE; } @@ -4192,11 +4192,6 @@ GLboolean assemble_RSQ(r700_AssemblerBase *pAsm) return assemble_math_function(pAsm, SQ_OP2_INST_RECIPSQRT_IEEE); } -GLboolean assemble_SIN(r700_AssemblerBase *pAsm) -{ - return assemble_math_function(pAsm, SQ_OP2_INST_SIN); -} - GLboolean assemble_SCS(r700_AssemblerBase *pAsm) { BITS tmp; @@ -5693,7 +5688,7 @@ GLboolean AssembleInstr(GLuint uiFirstInst, return GL_FALSE; break; case OPCODE_COS: - if ( GL_FALSE == assemble_COS(pR700AsmCode) ) + if ( GL_FALSE == assemble_TRIG(pR700AsmCode, SQ_OP2_INST_COS) ) return GL_FALSE; break; @@ -5790,7 +5785,7 @@ GLboolean AssembleInstr(GLuint uiFirstInst, return GL_FALSE; break; case OPCODE_SIN: - if ( GL_FALSE == assemble_SIN(pR700AsmCode) ) + if ( GL_FALSE == assemble_TRIG(pR700AsmCode, SQ_OP2_INST_SIN) ) return GL_FALSE; break; case OPCODE_SCS: diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index 3fe65654ca..f83206b726 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -548,7 +548,6 @@ GLboolean assemble_ADD(r700_AssemblerBase *pAsm); GLboolean assemble_ARL(r700_AssemblerBase *pAsm); GLboolean assemble_BAD(char *opcode_str); GLboolean assemble_CMP(r700_AssemblerBase *pAsm); -GLboolean assemble_COS(r700_AssemblerBase *pAsm); GLboolean assemble_DOT(r700_AssemblerBase *pAsm); GLboolean assemble_DST(r700_AssemblerBase *pAsm); GLboolean assemble_EX2(r700_AssemblerBase *pAsm); @@ -569,12 +568,12 @@ GLboolean assemble_MUL(r700_AssemblerBase *pAsm); GLboolean assemble_POW(r700_AssemblerBase *pAsm); GLboolean assemble_RCP(r700_AssemblerBase *pAsm); GLboolean assemble_RSQ(r700_AssemblerBase *pAsm); -GLboolean assemble_SIN(r700_AssemblerBase *pAsm); GLboolean assemble_SCS(r700_AssemblerBase *pAsm); GLboolean assemble_SGE(r700_AssemblerBase *pAsm); GLboolean assemble_LOGIC(r700_AssemblerBase *pAsm, BITS opcode); GLboolean assemble_LOGIC_PRED(r700_AssemblerBase *pAsm, BITS opcode); +GLboolean assemble_TRIG(r700_AssemblerBase *pAsm, BITS opcode); GLboolean assemble_SLT(r700_AssemblerBase *pAsm); GLboolean assemble_STP(r700_AssemblerBase *pAsm); -- cgit v1.2.3 From 0f854105f5a430ab36281c9bed530eccb8b8f44c Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Mon, 7 Dec 2009 16:27:05 +0200 Subject: r600: remove (now) dead code --- src/mesa/drivers/dri/r600/r700_assembler.c | 301 +---------------------------- src/mesa/drivers/dri/r600/r700_assembler.h | 4 - 2 files changed, 2 insertions(+), 303 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index caccedabdf..dd1199756d 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -2477,260 +2477,7 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) return GL_TRUE; } -#if 0 -GLboolean assemble_alu_instruction_literal(r700_AssemblerBase *pAsm, GLfloat * pLiteral) -{ - R700ALUInstruction * alu_instruction_ptr; - R700ALUInstructionHalfLiteral * alu_instruction_ptr_hl; - R700ALUInstructionFullLiteral * alu_instruction_ptr_fl; - - GLuint number_of_scalar_operations; - GLboolean is_single_scalar_operation; - GLuint scalar_channel_index; - - GLuint contiguous_slots_needed; - GLuint lastInstruction; - GLuint not_masked[4]; - - GLuint uNumSrc = r700GetNumOperands(pAsm); - - GLboolean bSplitInst = GL_FALSE; - - number_of_scalar_operations = 0; - contiguous_slots_needed = 0; - - if(1 == pAsm->D.dst.writew) - { - lastInstruction = 3; - number_of_scalar_operations++; - not_masked[3] = 1; - } - else - { - not_masked[3] = 0; - } - if(1 == pAsm->D.dst.writez) - { - lastInstruction = 2; - number_of_scalar_operations++; - not_masked[2] = 1; - } - else - { - not_masked[2] = 0; - } - if(1 == pAsm->D.dst.writey) - { - lastInstruction = 1; - number_of_scalar_operations++; - not_masked[1] = 1; - } - else - { - not_masked[1] = 0; - } - if(1 == pAsm->D.dst.writex) - { - lastInstruction = 0; - number_of_scalar_operations++; - not_masked[0] = 1; - } - else - { - not_masked[0] = 0; - } - - if(GL_TRUE == is_reduction_opcode(&(pAsm->D)) ) - { - contiguous_slots_needed = 4; - } - else - { - contiguous_slots_needed = number_of_scalar_operations; - } - - if(1 == pAsm->D2.dst2.literal) - { - contiguous_slots_needed += 1; - } - else if(2 == pAsm->D2.dst2.literal) - { - contiguous_slots_needed += 2; - } - - initialize(pAsm); - - for (scalar_channel_index=0; scalar_channel_index < 4; scalar_channel_index++) - { - if(0 == not_masked[scalar_channel_index]) - { - continue; - } - - if(scalar_channel_index == lastInstruction) - { - switch (pAsm->D2.dst2.literal) - { - case 0: - alu_instruction_ptr = (R700ALUInstruction*) CALLOC_STRUCT(R700ALUInstruction); - if (alu_instruction_ptr == NULL) - { - return GL_FALSE; - } - Init_R700ALUInstruction(alu_instruction_ptr); - break; - case 1: - alu_instruction_ptr_hl = (R700ALUInstructionHalfLiteral*) CALLOC_STRUCT(R700ALUInstructionHalfLiteral); - if (alu_instruction_ptr_hl == NULL) - { - return GL_FALSE; - } - Init_R700ALUInstructionHalfLiteral(alu_instruction_ptr_hl, pLiteral[0], pLiteral[1]); - alu_instruction_ptr = (R700ALUInstruction*)alu_instruction_ptr_hl; - break; - case 2: - alu_instruction_ptr_fl = (R700ALUInstructionFullLiteral*) CALLOC_STRUCT(R700ALUInstructionFullLiteral); - if (alu_instruction_ptr_fl == NULL) - { - return GL_FALSE; - } - Init_R700ALUInstructionFullLiteral(alu_instruction_ptr_fl, pLiteral[0], pLiteral[1], pLiteral[2], pLiteral[3]); - alu_instruction_ptr = (R700ALUInstruction*)alu_instruction_ptr_fl; - break; - default: - break; - }; - } - else - { - alu_instruction_ptr = (R700ALUInstruction*) CALLOC_STRUCT(R700ALUInstruction); - if (alu_instruction_ptr == NULL) - { - return GL_FALSE; - } - Init_R700ALUInstruction(alu_instruction_ptr); - } - - //src 0 - if (GL_FALSE == assemble_alu_src(alu_instruction_ptr, - 0, - &(pAsm->S[0].src), - scalar_channel_index) ) - { - return GL_FALSE; - } - - if (uNumSrc > 1) - { - // Process source 1 - if (GL_FALSE == assemble_alu_src(alu_instruction_ptr, - 1, - &(pAsm->S[1].src), - scalar_channel_index) ) - { - return GL_FALSE; - } - } - - //other bits - alu_instruction_ptr->m_Word0.f.index_mode = SQ_INDEX_LOOP; - - if(scalar_channel_index == lastInstruction) - { - alu_instruction_ptr->m_Word0.f.last = 1; - } - - alu_instruction_ptr->m_Word0.f.pred_sel = 0x0; - if(1 == pAsm->D.dst.predicated) - { - alu_instruction_ptr->m_Word1_OP2.f.update_pred = 0x1; - alu_instruction_ptr->m_Word1_OP2.f.update_execute_mask = 0x1; - } - else - { - alu_instruction_ptr->m_Word1_OP2.f.update_pred = 0; - alu_instruction_ptr->m_Word1_OP2.f.update_execute_mask = 0; - } - - // dst - if( (pAsm->D.dst.rtype == DST_REG_TEMPORARY) || - (pAsm->D.dst.rtype == DST_REG_OUT) ) - { - alu_instruction_ptr->m_Word1.f.dst_gpr = pAsm->D.dst.reg; - } - else - { - radeon_error("Only temp destination registers supported for ALU dest regs.\n"); - return GL_FALSE; - } - - alu_instruction_ptr->m_Word1.f.dst_rel = SQ_ABSOLUTE; //D.rtype - - alu_instruction_ptr->m_Word1.f.dst_chan = scalar_channel_index; - - alu_instruction_ptr->m_Word1.f.clamp = pAsm->D2.dst2.SaturateMode; - - if (pAsm->D.dst.op3) - { - //op3 - alu_instruction_ptr->m_Word1_OP3.f.alu_inst = pAsm->D.dst.opcode; - - //There's 3rd src for op3 - if ( GL_FALSE == assemble_alu_src(alu_instruction_ptr, - 2, - &(pAsm->S[2].src), - scalar_channel_index) ) - { - return GL_FALSE; - } - } - else - { - //op2 - if (pAsm->bR6xx) - { - alu_instruction_ptr->m_Word1_OP2.f6.alu_inst = pAsm->D.dst.opcode; - alu_instruction_ptr->m_Word1_OP2.f6.src0_abs = 0x0; - alu_instruction_ptr->m_Word1_OP2.f6.src1_abs = 0x0; - alu_instruction_ptr->m_Word1_OP2.f6.write_mask = 1; - alu_instruction_ptr->m_Word1_OP2.f6.omod = SQ_ALU_OMOD_OFF; - } - else - { - alu_instruction_ptr->m_Word1_OP2.f.alu_inst = pAsm->D.dst.opcode; - alu_instruction_ptr->m_Word1_OP2.f.src0_abs = 0x0; - alu_instruction_ptr->m_Word1_OP2.f.src1_abs = 0x0; - alu_instruction_ptr->m_Word1_OP2.f.write_mask = 1; - alu_instruction_ptr->m_Word1_OP2.f.omod = SQ_ALU_OMOD_OFF; - } - } - - if(GL_FALSE == add_alu_instruction(pAsm, alu_instruction_ptr, contiguous_slots_needed) ) - { - return GL_FALSE; - } - - if (1 == number_of_scalar_operations) - { - if(GL_FALSE == check_scalar(pAsm, alu_instruction_ptr) ) - { - return GL_FALSE; - } - } - else - { - if(GL_FALSE == check_vector(pAsm, alu_instruction_ptr) ) - { - return GL_FALSE; - } - } - contiguous_slots_needed -= 2; - } - - return GL_TRUE; -} -#endif GLboolean next_ins(r700_AssemblerBase *pAsm) { struct prog_instruction *pILInst = &(pAsm->pILInst[pAsm->uiCurInst]); @@ -2787,29 +2534,6 @@ GLboolean next_ins(r700_AssemblerBase *pAsm) return GL_TRUE; } -#if 0/* not work yet */ -GLboolean next_ins_literal(r700_AssemblerBase *pAsm, GLfloat * pLiteral) -{ - struct prog_instruction *pILInst = &(pAsm->pILInst[pAsm->uiCurInst]); - - //ALU - if( GL_FALSE == assemble_alu_instruction_literal(pAsm, pLiteral) ) - { - radeon_error("Error assembling ALU instruction\n"); - return GL_FALSE; - } - - //reset for next inst. - pAsm->D.bits = 0; - pAsm->D2.bits = 0; - pAsm->S[0].bits = 0; - pAsm->S[1].bits = 0; - pAsm->S[2].bits = 0; - pAsm->is_tex = GL_FALSE; - pAsm->need_tex_barrier = GL_FALSE; - return GL_TRUE; -} -#endif GLboolean assemble_math_function(r700_AssemblerBase* pAsm, BITS opcode) { BITS tmp; @@ -4533,8 +4257,6 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); pAsm->D.dst.rtype = DST_REG_TEMPORARY; pAsm->D.dst.reg = tmp2; - pAsm->D2.dst2.literal_slots = 1; - pAsm->C[0].f = 1.5F; setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; @@ -4546,33 +4268,14 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) setswizzle_PVSSRC(&(pAsm->S[1].src), SQ_SEL_Z); setaddrmode_PVSSRC(&(pAsm->S[2].src), ADDR_ABSOLUTE); /* immediate c 1.5 */ + pAsm->D2.dst2.literal_slots = 1; + pAsm->C[0].f = 1.5F; pAsm->S[2].src.rtype = SRC_REC_LITERAL; pAsm->S[2].src.reg = tmp1; setswizzle_PVSSRC(&(pAsm->S[2].src), SQ_SEL_X); next_ins(pAsm); -#if 0 - /* ADD the remaining .5 */ - pAsm->D.dst.opcode = SQ_OP2_INST_ADD; - setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); - pAsm->D.dst.rtype = DST_REG_TEMPORARY; - pAsm->D.dst.reg = tmp2; - pAsm->D.dst.writex = 1; - pAsm->D.dst.writey = 1; - pAsm->D.dst.writez = 0; - pAsm->D.dst.writew = 0; - setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); - pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; - pAsm->S[0].src.reg = tmp2; - noswizzle_PVSSRC(&(pAsm->S[0].src)); - setaddrmode_PVSSRC(&(pAsm->S[1].src), ADDR_ABSOLUTE); - pAsm->S[1].src.rtype = SRC_REG_TEMPORARY; - pAsm->S[1].src.reg = 252; // SQ_ALU_SRC_0_5 - noswizzle_PVSSRC(&(pAsm->S[1].src)); - - next_ins(pAsm); -#endif /* tmp1.xy = temp2.xy */ pAsm->D.dst.opcode = SQ_OP2_INST_MOV; setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index f83206b726..6dc44017eb 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -531,10 +531,6 @@ GLboolean check_vector(r700_AssemblerBase* pAsm, GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm); GLboolean next_ins(r700_AssemblerBase *pAsm); -/* TODO : merge next_ins/literal, assemble_alu_instruction/literal */ -GLboolean next_ins_literal(r700_AssemblerBase *pAsm, GLfloat * pLiteral); -GLboolean assemble_alu_instruction_literal(r700_AssemblerBase *pAsm, GLfloat * pLiteral); - GLboolean pops(r700_AssemblerBase *pAsm, GLuint pops); GLboolean jumpToOffest(r700_AssemblerBase *pAsm, GLuint pops, GLint offset); GLboolean setRetInLoopFlag(r700_AssemblerBase *pAsm, GLuint flagValue); -- cgit v1.2.3 From 629a648b059d8a2653b6a9cdf7f460533de0e1da Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Mon, 7 Dec 2009 17:22:03 +0200 Subject: r600: and finally fix SCS --- src/mesa/drivers/dri/r600/r700_assembler.c | 97 ++++++++++++++---------------- 1 file changed, 46 insertions(+), 51 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index dd1199756d..aed84fc3bd 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -2237,7 +2237,7 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) contiguous_slots_needed = 0; - if(GL_TRUE == is_reduction_opcode(&(pAsm->D)) ) + if(!is_single_scalar_operation) { contiguous_slots_needed = 4; } @@ -3920,68 +3920,63 @@ GLboolean assemble_SCS(r700_AssemblerBase *pAsm) { BITS tmp; - checkop1(pAsm); - - tmp = gethelpr(pAsm); - - // COS tmp.x, a.x - pAsm->D.dst.opcode = SQ_OP2_INST_COS; - pAsm->D.dst.math = 1; + checkop1(pAsm); - setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); - pAsm->D.dst.rtype = DST_REG_TEMPORARY; - pAsm->D.dst.reg = tmp; - pAsm->D.dst.writex = 1; + tmp = gethelpr(pAsm); + /* tmp.x = src /2*PI */ + pAsm->D.dst.opcode = SQ_OP2_INST_MUL; + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = tmp; + pAsm->D.dst.writex = 1; - if( GL_FALSE == assemble_src(pAsm, 0, -1) ) - { - return GL_FALSE; - } + assemble_src(pAsm, 0, -1); - if ( GL_FALSE == next_ins(pAsm) ) - { - return GL_FALSE; - } + pAsm->S[1].src.rtype = SRC_REC_LITERAL; + setswizzle_PVSSRC(&(pAsm->S[1].src), SQ_SEL_X); + pAsm->D2.dst2.literal_slots = 1; + pAsm->C[0].f = 1/(3.1415926535 * 2); + pAsm->C[1].f = 0.0F; - // SIN tmp.y, a.x - pAsm->D.dst.opcode = SQ_OP2_INST_SIN; - pAsm->D.dst.math = 1; + next_ins(pAsm); - setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); - pAsm->D.dst.rtype = DST_REG_TEMPORARY; - pAsm->D.dst.reg = tmp; - pAsm->D.dst.writey = 1; + // COS dst.x, a.x + pAsm->D.dst.opcode = SQ_OP2_INST_COS; + pAsm->D.dst.math = 1; - if( GL_FALSE == assemble_src(pAsm, 0, -1) ) - { - return GL_FALSE; - } + assemble_dst(pAsm); + /* mask y */ + pAsm->D.dst.writey = 0; - if( GL_FALSE == next_ins(pAsm) ) - { - return GL_FALSE; - } + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[0].src.reg = tmp; + setswizzle_PVSSRC(&(pAsm->S[0].src), SQ_SEL_X); + noneg_PVSSRC(&(pAsm->S[0].src)); - // MOV dst.mask, tmp - pAsm->D.dst.opcode = SQ_OP2_INST_MOV; + if ( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } - if( GL_FALSE == assemble_dst(pAsm) ) - { - return GL_FALSE; - } + // SIN dst.y, a.x + pAsm->D.dst.opcode = SQ_OP2_INST_SIN; + pAsm->D.dst.math = 1; - setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); - pAsm->S[0].src.rtype = DST_REG_TEMPORARY; - pAsm->S[0].src.reg = tmp; + assemble_dst(pAsm); + /* mask x */ + pAsm->D.dst.writex = 0; - noswizzle_PVSSRC(&(pAsm->S[0].src)); - pAsm->S[0].src.swizzlez = SQ_SEL_0; - pAsm->S[0].src.swizzlew = SQ_SEL_0; + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[0].src.reg = tmp; + setswizzle_PVSSRC(&(pAsm->S[0].src), SQ_SEL_X); + noneg_PVSSRC(&(pAsm->S[0].src)); - if ( GL_FALSE == next_ins(pAsm) ) - { - return GL_FALSE; - } + if( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } return GL_TRUE; } -- cgit v1.2.3 From ee1720b99dfb5964962f2346406a4e3e88374a68 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Tue, 8 Dec 2009 19:13:48 +0100 Subject: gallium: fix more potential strict aliasing issues In particular, gcc man page warns that union a_union { int i; double d; }; int f() { double d = 3.0; return ((union a_union *) &d)->i; } "might" not be ok (why not?), even though it doesn't seem to generate any warnings. Hence don't use this and do the extra step to actually use assignment to get the values in/out of the union. This changes parts of 3456f9149b3009fcfce80054759d05883d3c4ee5. --- src/mesa/state_tracker/st_atom_pixeltransfer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_atom_pixeltransfer.c b/src/mesa/state_tracker/st_atom_pixeltransfer.c index 5e2ae1bb36..6a5854e9ba 100644 --- a/src/mesa/state_tracker/st_atom_pixeltransfer.c +++ b/src/mesa/state_tracker/st_atom_pixeltransfer.c @@ -162,12 +162,14 @@ load_color_map_texture(GLcontext *ctx, struct pipe_texture *pt) */ for (i = 0; i < texSize; i++) { for (j = 0; j < texSize; j++) { + union util_color uc; int k = (i * texSize + j); ubyte r = ctx->PixelMaps.RtoR.Map8[j * rSize / texSize]; ubyte g = ctx->PixelMaps.GtoG.Map8[i * gSize / texSize]; ubyte b = ctx->PixelMaps.BtoB.Map8[j * bSize / texSize]; ubyte a = ctx->PixelMaps.AtoA.Map8[i * aSize / texSize]; - util_pack_color_ub(r, g, b, a, pt->format, (union util_color *)(dest + k)); + util_pack_color_ub(r, g, b, a, pt->format, &uc); + *(dest + k) = uc.ui; } } -- cgit v1.2.3 From 54b0ed8360019fc6e0234c2c3413be40fe4d3b59 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 8 Dec 2009 15:03:15 -0700 Subject: vbo: fix array index out of bounds error, and fix evaluator priorities Fixes bug 25525. Plus, the GL_NV_vertex_program evaluators alias and override the convential evaluator maps, so set their state after the conventional maps. --- src/mesa/vbo/vbo_exec_eval.c | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/vbo/vbo_exec_eval.c b/src/mesa/vbo/vbo_exec_eval.c index 0c691b3a5c..a7846213d0 100644 --- a/src/mesa/vbo/vbo_exec_eval.c +++ b/src/mesa/vbo/vbo_exec_eval.c @@ -35,17 +35,20 @@ static void clear_active_eval1( struct vbo_exec_context *exec, GLuint attr ) { + assert(attr < Elements(exec->eval.map1)); exec->eval.map1[attr].map = NULL; } static void clear_active_eval2( struct vbo_exec_context *exec, GLuint attr ) { + assert(attr < Elements(exec->eval.map2)); exec->eval.map2[attr].map = NULL; } static void set_active_eval1( struct vbo_exec_context *exec, GLuint attr, GLuint dim, struct gl_1d_map *map ) { + assert(attr < Elements(exec->eval.map1)); if (!exec->eval.map1[attr].map) { exec->eval.map1[attr].map = map; exec->eval.map1[attr].sz = dim; @@ -55,6 +58,7 @@ static void set_active_eval1( struct vbo_exec_context *exec, GLuint attr, GLuint static void set_active_eval2( struct vbo_exec_context *exec, GLuint attr, GLuint dim, struct gl_2d_map *map ) { + assert(attr < Elements(exec->eval.map2)); if (!exec->eval.map2[attr].map) { exec->eval.map2[attr].map = map; exec->eval.map2[attr].sz = dim; @@ -73,18 +77,6 @@ void vbo_exec_eval_update( struct vbo_exec_context *exec ) clear_active_eval2( exec, attr ); } - /* _NEW_PROGRAM */ - if (ctx->VertexProgram._Enabled) { - for (attr = 0; attr < VBO_ATTRIB_FIRST_MATERIAL; attr++) { - /* _NEW_EVAL */ - if (ctx->Eval.Map1Attrib[attr]) - set_active_eval1( exec, attr, 4, &ctx->EvalMap.Map1Attrib[attr] ); - - if (ctx->Eval.Map2Attrib[attr]) - set_active_eval2( exec, attr, 4, &ctx->EvalMap.Map2Attrib[attr] ); - } - } - if (ctx->Eval.Map1Color4) set_active_eval1( exec, VBO_ATTRIB_COLOR0, 4, &ctx->EvalMap.Map1Color4 ); @@ -125,6 +117,23 @@ void vbo_exec_eval_update( struct vbo_exec_context *exec ) else if (ctx->Eval.Map2Vertex3) set_active_eval2( exec, VBO_ATTRIB_POS, 3, &ctx->EvalMap.Map2Vertex3 ); + /* _NEW_PROGRAM */ + if (ctx->VertexProgram._Enabled) { + /* These are the 16 evaluators which GL_NV_vertex_program defines. + * They alias and override the conventional vertex attributs. + */ + for (attr = 0; attr < 16; attr++) { + /* _NEW_EVAL */ + assert(attr < Elements(ctx->Eval.Map1Attrib)); + if (ctx->Eval.Map1Attrib[attr]) + set_active_eval1( exec, attr, 4, &ctx->EvalMap.Map1Attrib[attr] ); + + assert(attr < Elements(ctx->Eval.Map2Attrib)); + if (ctx->Eval.Map2Attrib[attr]) + set_active_eval2( exec, attr, 4, &ctx->EvalMap.Map2Attrib[attr] ); + } + } + exec->eval.recalculate_maps = 0; } -- cgit v1.2.3 From d88f3b946804f9a3e8cad4f8896e6be488fec2b5 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 8 Dec 2009 14:31:38 -0800 Subject: mesa: Fix array out-of-bounds access by _mesa_TexParameterfv. _mesa_TexParameterfv calls set_tex_parameteri, which uses the params argument as an array. --- src/mesa/main/texparam.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 4ce8c8593a..4c1f690ff1 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -592,8 +592,10 @@ _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params) case GL_DEPTH_TEXTURE_MODE_ARB: { /* convert float param to int */ - GLint p = (GLint) params[0]; - need_update = set_tex_parameteri(ctx, texObj, pname, &p); + GLint p[4]; + p[0] = (GLint) params[0]; + p[1] = p[2] = p[3] = 0; + need_update = set_tex_parameteri(ctx, texObj, pname, p); } break; -- cgit v1.2.3 From a1d46fbea0b40d7edc668ea5993ea4318f37c9f9 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 8 Dec 2009 15:42:13 -0800 Subject: mesa: Fix array out-of-bounds access by _mesa_TexParameteri. _mesa_TexParameteri calls set_tex_parameterf, which uses the params argument as an array. --- src/mesa/main/texparam.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 4c1f690ff1..59c518c7d2 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -644,9 +644,11 @@ _mesa_TexParameteri(GLenum target, GLenum pname, GLint param) case GL_TEXTURE_LOD_BIAS: case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: { - GLfloat fparam = (GLfloat) param; + GLfloat fparam[4]; + fparam[0] = (GLfloat) param; + fparam[1] = fparam[2] = fparam[3] = 0.0F; /* convert int param to float */ - need_update = set_tex_parameterf(ctx, texObj, pname, &fparam); + need_update = set_tex_parameterf(ctx, texObj, pname, fparam); } break; default: -- cgit v1.2.3 From 7f146b38240e1c4efa6d8d0a4e5a0c8346706de5 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 8 Dec 2009 16:04:33 -0800 Subject: mesa: Fix array out-of-bounds access by _mesa_Fogi. _mesa_Fogi calls _mesa_Fogfv, which uses the params argument as an array. --- src/mesa/main/fog.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/fog.c b/src/mesa/main/fog.c index 4323d3db82..99eb141812 100644 --- a/src/mesa/main/fog.c +++ b/src/mesa/main/fog.c @@ -41,8 +41,10 @@ _mesa_Fogf(GLenum pname, GLfloat param) void GLAPIENTRY _mesa_Fogi(GLenum pname, GLint param ) { - GLfloat fparam = (GLfloat) param; - _mesa_Fogfv(pname, &fparam); + GLfloat fparam[4]; + fparam[0] = (GLfloat) param; + fparam[1] = fparam[2] = fparam[3] = 0.0F; + _mesa_Fogfv(pname, fparam); } -- cgit v1.2.3 From dd9eb8774ad7918187afebf8cd3be6f4b80f0f3b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 8 Dec 2009 16:15:07 -0800 Subject: i965: Enable the accelerated ReadPixels path on gen4 along with pre-gen4. Passes piglit pbo-read-argb8888, and doesn't otherwise regress quick.tests. --- src/mesa/drivers/dri/intel/intel_pixel_read.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_pixel_read.c b/src/mesa/drivers/dri/intel/intel_pixel_read.c index 4707500180..20424e2e58 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_read.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_read.c @@ -285,11 +285,11 @@ intelReadPixels(GLcontext * ctx, intelFlush(ctx); -#ifdef I915 if (do_blit_readpixels (ctx, x, y, width, height, format, type, pack, pixels)) return; +#ifdef I915 if (do_texture_readpixels (ctx, x, y, width, height, format, type, pack, pixels)) return; -- cgit v1.2.3 From 3f7c2ac2798b385bed97b6931a1568a7e0223a0a Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 8 Dec 2009 17:25:05 -0800 Subject: mesa: Fix array out-of-bounds access by _mesa_TexParameteri. _mesa_TexParameteri calls set_tex_parameteri, which uses the params argument as an array. --- src/mesa/main/texparam.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 59c518c7d2..1cec4b82fe 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -653,7 +653,12 @@ _mesa_TexParameteri(GLenum target, GLenum pname, GLint param) break; default: /* this will generate an error if pname is illegal */ - need_update = set_tex_parameteri(ctx, texObj, pname, ¶m); + { + GLint iparam[4]; + iparam[0] = param; + iparam[1] = iparam[2] = iparam[3] = 0; + need_update = set_tex_parameteri(ctx, texObj, pname, iparam); + } } if (ctx->Driver.TexParameter && need_update) { -- cgit v1.2.3 From d33bf38d63d233f6a09115acfff230c464d3ee29 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 8 Dec 2009 17:51:07 -0800 Subject: mesa: Fix array out-of-bounds access by _mesa_Fogf. _mesa_Fogf calls _mesa_Fogfv, which uses the params argument as an array. --- src/mesa/main/fog.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/fog.c b/src/mesa/main/fog.c index 99eb141812..269ff3f8b9 100644 --- a/src/mesa/main/fog.c +++ b/src/mesa/main/fog.c @@ -34,7 +34,10 @@ void GLAPIENTRY _mesa_Fogf(GLenum pname, GLfloat param) { - _mesa_Fogfv(pname, ¶m); + GLfloat fparam[4]; + fparam[0] = param; + fparam[1] = fparam[2] = fparam[3] = 0.0F; + _mesa_Fogfv(pname, fparam); } -- cgit v1.2.3 From af16c822a5af8ce0aa7582e8ea44315b62b7356b Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 8 Dec 2009 18:26:05 -0800 Subject: mesa: Fix array out-of-bounds access by _mesa_LightModeli. _mesa_LightModeli calls _mesa_LightModeliv, which uses the params argument as an array. --- src/mesa/main/light.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index 10c89f4368..5a8f9160f6 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -537,7 +537,10 @@ _mesa_LightModeliv( GLenum pname, const GLint *params ) void GLAPIENTRY _mesa_LightModeli( GLenum pname, GLint param ) { - _mesa_LightModeliv( pname, ¶m ); + GLint iparam[4]; + iparam[0] = param; + iparam[1] = iparam[2] = iparam[3] = 0; + _mesa_LightModeliv( pname, iparam ); } -- cgit v1.2.3 From cd6b8dd9e82fedc55d033131fbc0f8ee950567c8 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 9 Dec 2009 10:08:07 -0800 Subject: mesa: Move OES_read_format support from drivers into the core. The assertion is that the correct read type to be using is the native type of the underlying read renderbuffer. For some fallback paths, this may be worse than GL_RGBA/GL_UNSIGNED_BYTE for reads today, but it gets all drivers the expected GL_BGRA/GL_UNSIGNED_BYTE for ARGB8888 or GL_BGR//GL_UNSIGNED_SHORT_5_6_5_REV for rgb565 with no work. This fixes the intel (and other) DRI drivers to report read formats that should hit blit PBO readpixels paths. --- src/mesa/main/context.c | 4 -- src/mesa/main/framebuffer.c | 26 ++++++++++ src/mesa/main/framebuffer.h | 5 ++ src/mesa/main/get.c | 17 ++++--- src/mesa/main/get_gen.py | 5 +- src/mesa/main/mtypes.h | 3 -- src/mesa/sources.mak | 1 - src/mesa/state_tracker/st_cb_get.c | 97 ------------------------------------- src/mesa/state_tracker/st_cb_get.h | 37 -------------- src/mesa/state_tracker/st_context.c | 2 - 10 files changed, 43 insertions(+), 154 deletions(-) delete mode 100644 src/mesa/state_tracker/st_cb_get.c delete mode 100644 src/mesa/state_tracker/st_cb_get.h (limited to 'src/mesa') diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index b5bf46718f..87eae96639 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -564,10 +564,6 @@ _mesa_init_constants(GLcontext *ctx) /* GL_ARB_draw_buffers */ ctx->Const.MaxDrawBuffers = MAX_DRAW_BUFFERS; - /* GL_OES_read_format */ - ctx->Const.ColorReadFormat = GL_RGBA; - ctx->Const.ColorReadType = GL_UNSIGNED_BYTE; - #if FEATURE_EXT_framebuffer_object ctx->Const.MaxColorAttachments = MAX_COLOR_ATTACHMENTS; ctx->Const.MaxRenderbufferSize = MAX_WIDTH; diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index 154dedacd5..d958dbf7d4 100644 --- a/src/mesa/main/framebuffer.c +++ b/src/mesa/main/framebuffer.c @@ -969,3 +969,29 @@ _mesa_dest_buffer_exists(GLcontext *ctx, GLenum format) /* OK */ return GL_TRUE; } + +GLenum +_mesa_get_color_read_format(GLcontext *ctx) +{ + switch (ctx->ReadBuffer->_ColorReadBuffer->Format) { + case MESA_FORMAT_ARGB8888: + return GL_BGRA; + case MESA_FORMAT_RGB565: + return GL_BGR; + default: + return GL_RGBA; + } +} + +GLenum +_mesa_get_color_read_type(GLcontext *ctx) +{ + switch (ctx->ReadBuffer->_ColorReadBuffer->Format) { + case MESA_FORMAT_ARGB8888: + return GL_UNSIGNED_BYTE; + case MESA_FORMAT_RGB565: + return GL_UNSIGNED_SHORT_5_6_5_REV; + default: + return GL_UNSIGNED_BYTE; + } +} diff --git a/src/mesa/main/framebuffer.h b/src/mesa/main/framebuffer.h index 45a4703ba9..ef21dd98e8 100644 --- a/src/mesa/main/framebuffer.h +++ b/src/mesa/main/framebuffer.h @@ -81,5 +81,10 @@ _mesa_source_buffer_exists(GLcontext *ctx, GLenum format); extern GLboolean _mesa_dest_buffer_exists(GLcontext *ctx, GLenum format); +extern GLenum +_mesa_get_color_read_type(GLcontext *ctx); + +extern GLenum +_mesa_get_color_read_format(GLcontext *ctx); #endif /* FRAMEBUFFER_H */ diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 6c5ce02913..3f6b03c88a 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -13,6 +13,7 @@ #include "mtypes.h" #include "state.h" #include "texcompress.h" +#include "framebuffer.h" #define FLOAT_TO_BOOLEAN(X) ( (X) ? GL_TRUE : GL_FALSE ) @@ -1767,11 +1768,11 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) break; case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: CHECK_EXT1(OES_read_format, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Const.ColorReadType); + params[0] = INT_TO_BOOLEAN(_mesa_get_color_read_type(ctx)); break; case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: CHECK_EXT1(OES_read_format, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Const.ColorReadFormat); + params[0] = INT_TO_BOOLEAN(_mesa_get_color_read_format(ctx)); break; case GL_NUM_FRAGMENT_REGISTERS_ATI: CHECK_EXT1(ATI_fragment_shader, "GetBooleanv"); @@ -3602,11 +3603,11 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) break; case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: CHECK_EXT1(OES_read_format, "GetFloatv"); - params[0] = (GLfloat)(ctx->Const.ColorReadType); + params[0] = (GLfloat)(_mesa_get_color_read_type(ctx)); break; case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: CHECK_EXT1(OES_read_format, "GetFloatv"); - params[0] = (GLfloat)(ctx->Const.ColorReadFormat); + params[0] = (GLfloat)(_mesa_get_color_read_format(ctx)); break; case GL_NUM_FRAGMENT_REGISTERS_ATI: CHECK_EXT1(ATI_fragment_shader, "GetFloatv"); @@ -5437,11 +5438,11 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) break; case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: CHECK_EXT1(OES_read_format, "GetIntegerv"); - params[0] = ctx->Const.ColorReadType; + params[0] = _mesa_get_color_read_type(ctx); break; case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: CHECK_EXT1(OES_read_format, "GetIntegerv"); - params[0] = ctx->Const.ColorReadFormat; + params[0] = _mesa_get_color_read_format(ctx); break; case GL_NUM_FRAGMENT_REGISTERS_ATI: CHECK_EXT1(ATI_fragment_shader, "GetIntegerv"); @@ -7273,11 +7274,11 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) break; case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: CHECK_EXT1(OES_read_format, "GetInteger64v"); - params[0] = (GLint64)(ctx->Const.ColorReadType); + params[0] = (GLint64)(_mesa_get_color_read_type(ctx)); break; case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: CHECK_EXT1(OES_read_format, "GetInteger64v"); - params[0] = (GLint64)(ctx->Const.ColorReadFormat); + params[0] = (GLint64)(_mesa_get_color_read_format(ctx)); break; case GL_NUM_FRAGMENT_REGISTERS_ATI: CHECK_EXT1(ATI_fragment_shader, "GetInteger64v"); diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py index 930c3362fa..697c4cfd92 100644 --- a/src/mesa/main/get_gen.py +++ b/src/mesa/main/get_gen.py @@ -942,9 +942,9 @@ StateVars = [ # GL_OES_read_format ( "GL_IMPLEMENTATION_COLOR_READ_TYPE_OES", GLint, - ["ctx->Const.ColorReadType"], "", ["OES_read_format"] ), + ["_mesa_get_color_read_type(ctx)"], "", ["OES_read_format"] ), ( "GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES", GLint, - ["ctx->Const.ColorReadFormat"], "", ["OES_read_format"] ), + ["_mesa_get_color_read_format(ctx)"], "", ["OES_read_format"] ), # GL_ATI_fragment_shader ( "GL_NUM_FRAGMENT_REGISTERS_ATI", GLint, ["6"], "", ["ATI_fragment_shader"] ), @@ -1159,6 +1159,7 @@ def EmitHeader(): #include "mtypes.h" #include "state.h" #include "texcompress.h" +#include "framebuffer.h" #define FLOAT_TO_BOOLEAN(X) ( (X) ? GL_TRUE : GL_FALSE ) diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 881d233ca3..cde2f5fe06 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2355,9 +2355,6 @@ struct gl_constants GLuint MaxDrawBuffers; /**< GL_ARB_draw_buffers */ - GLenum ColorReadFormat; /**< GL_OES_read_format */ - GLenum ColorReadType; /**< GL_OES_read_format */ - GLuint MaxColorAttachments; /**< GL_EXT_framebuffer_object */ GLuint MaxRenderbufferSize; /**< GL_EXT_framebuffer_object */ GLuint MaxSamples; /**< GL_ARB_framebuffer_object */ diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak index 615a5588ea..a0d7dbbace 100644 --- a/src/mesa/sources.mak +++ b/src/mesa/sources.mak @@ -191,7 +191,6 @@ STATETRACKER_SOURCES = \ state_tracker/st_cb_bufferobjects.c \ state_tracker/st_cb_clear.c \ state_tracker/st_cb_flush.c \ - state_tracker/st_cb_get.c \ state_tracker/st_cb_drawpixels.c \ state_tracker/st_cb_fbo.c \ state_tracker/st_cb_feedback.c \ diff --git a/src/mesa/state_tracker/st_cb_get.c b/src/mesa/state_tracker/st_cb_get.c deleted file mode 100644 index e7d7f03bc9..0000000000 --- a/src/mesa/state_tracker/st_cb_get.c +++ /dev/null @@ -1,97 +0,0 @@ -/************************************************************************** - * - * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 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. - * - **************************************************************************/ - - -/** - * glGet functions - * - * \author Brian Paul - */ - -#include "main/imports.h" -#include "main/context.h" - -#include "pipe/p_defines.h" - -#include "st_cb_fbo.h" -#include "st_cb_get.h" - - - -/** - * Examine the current color read buffer format to determine - * which GL pixel format/type combo is the best match. - */ -static void -get_preferred_read_format_type(GLcontext *ctx, GLint *format, GLint *type) -{ - struct gl_framebuffer *fb = ctx->ReadBuffer; - struct st_renderbuffer *strb = st_renderbuffer(fb->_ColorReadBuffer); - - /* defaults */ - *format = ctx->Const.ColorReadFormat; - *type = ctx->Const.ColorReadType; - - if (strb) { - /* XXX could add more cases here... */ - if (strb->format == PIPE_FORMAT_A8R8G8B8_UNORM) { - *format = GL_BGRA; - if (_mesa_little_endian()) - *type = GL_UNSIGNED_INT_8_8_8_8_REV; - else - *type = GL_UNSIGNED_INT_8_8_8_8; - } - } -} - - -/** - * We only intercept the OES preferred ReadPixels format/type. - * Everything else goes to the default _mesa_GetIntegerv. - */ -static GLboolean -st_GetIntegerv(GLcontext *ctx, GLenum pname, GLint *params) -{ - GLint dummy; - - switch (pname) { - case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: - get_preferred_read_format_type(ctx, &dummy, params); - return GL_TRUE; - case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: - get_preferred_read_format_type(ctx, params, &dummy); - return GL_TRUE; - default: - return GL_FALSE; - } -} - - -void st_init_get_functions(struct dd_function_table *functions) -{ - functions->GetIntegerv = st_GetIntegerv; -} diff --git a/src/mesa/state_tracker/st_cb_get.h b/src/mesa/state_tracker/st_cb_get.h deleted file mode 100644 index 8e9f3e9306..0000000000 --- a/src/mesa/state_tracker/st_cb_get.h +++ /dev/null @@ -1,37 +0,0 @@ -/************************************************************************** - * - * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 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. - * - **************************************************************************/ - - -#ifndef ST_CB_GET_H -#define ST_CB_GET_H - - -extern void -st_init_get_functions(struct dd_function_table *functions); - - -#endif diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index f0eddafd33..d18a25ab51 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -51,7 +51,6 @@ #include "st_cb_drawtex.h" #endif #include "st_cb_fbo.h" -#include "st_cb_get.h" #if FEATURE_feedback #include "st_cb_feedback.h" #endif @@ -331,7 +330,6 @@ void st_init_driver_functions(struct dd_function_table *functions) st_init_rasterpos_functions(functions); #endif st_init_fbo_functions(functions); - st_init_get_functions(functions); #if FEATURE_feedback st_init_feedback_functions(functions); #endif -- cgit v1.2.3 From e3fa700c178e11e6735430119232919176ab7b42 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 9 Dec 2009 11:03:49 -0800 Subject: meta: Bind texture to unit 0 for mipmap generation If the active texture unit on entry to mipmap generation is not zero, bind the texture to unit zero. Fixes bug #24219. --- src/mesa/drivers/common/meta.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index a431519143..39b0ab13c6 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -2149,6 +2149,7 @@ _mesa_meta_GenerateMipmap(GLcontext *ctx, GLenum target, const GLenum wrapTSave = texObj->WrapT; const GLenum wrapRSave = texObj->WrapR; const GLuint fboSave = ctx->DrawBuffer->Name; + const GLuint original_active_unit = ctx->Texture.CurrentUnit; GLenum faceTarget; GLuint dstLevel; GLuint border = 0; @@ -2288,6 +2289,9 @@ _mesa_meta_GenerateMipmap(GLcontext *ctx, GLenum target, /* texture is already locked, unlock now */ _mesa_unlock_texture(ctx, texObj); + if (original_active_unit != 0) + _mesa_BindTexture(target, texObj->Name); + for (dstLevel = baseLevel + 1; dstLevel <= maxLevel; dstLevel++) { const struct gl_texture_image *srcImage; const GLuint srcLevel = dstLevel - 1; -- cgit v1.2.3 From 33a120e4761a661736ea64a3efc2e3831ac5600a Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Wed, 9 Dec 2009 10:51:52 +0200 Subject: r600: fix state size prediction after dc0777d3 --- src/mesa/drivers/dri/r600/r700_chip.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index d8661b4439..dacc2ccc4c 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -1134,7 +1134,11 @@ static int check_blnd(GLcontext *ctx, struct radeon_state_atom *atom) count += 3; if (context->radeon.radeonScreen->chip_family > CHIP_FAMILY_R600) { - for (ui = 0; ui < R700_MAX_RENDER_TARGETS; ui++) { + /* targets are enabled in r700SetRenderTarget but state + size is calculated before that. Until MRT's are done + hardcode target0 as enabled. */ + count += 3; + for (ui = 1; ui < R700_MAX_RENDER_TARGETS; ui++) { if (r700->render_target[ui].enabled) count += 3; } -- cgit v1.2.3 From 3de8fff45d04fd7e702cd656ba97cafd348c3981 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 9 Dec 2009 08:30:01 -0700 Subject: mesa: fix baseLevel >= MAX_TEXTURE_LEVELS test This fixes invalid array indexing when baseLevel == MAX_TEXTURE_LEVELS. See bug 25528. --- src/mesa/main/texobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index da55ac8697..85f5f78e50 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -418,7 +418,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, /* Detect cases where the application set the base level to an invalid * value. */ - if ((baseLevel < 0) || (baseLevel > MAX_TEXTURE_LEVELS)) { + if ((baseLevel < 0) || (baseLevel >= MAX_TEXTURE_LEVELS)) { char s[100]; _mesa_sprintf(s, "base level = %d is invalid", baseLevel); incomplete(t, s); -- cgit v1.2.3 From a082d965de228d5035e59245df528af62761652a Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 9 Dec 2009 11:26:24 -0800 Subject: glsl: Remove unused member x from struct slang_operation. --- src/mesa/shader/slang/slang_compile_operation.h | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/slang/slang_compile_operation.h b/src/mesa/shader/slang/slang_compile_operation.h index 58f1edeed8..1f15c19896 100644 --- a/src/mesa/shader/slang/slang_compile_operation.h +++ b/src/mesa/shader/slang/slang_compile_operation.h @@ -127,7 +127,6 @@ typedef struct slang_operation_ * indicate such. num_children indicates number of elements. */ GLboolean array_constructor; - double x; } slang_operation; -- cgit v1.2.3 From 8927b72118f9433aafd0e811cfc1981215eb3c5f Mon Sep 17 00:00:00 2001 From: Richard Li Date: Wed, 9 Dec 2009 15:39:16 -0500 Subject: r600 : add pre-compile mesa shader calling interface, in order to handle complex built-in shader instructions. --- src/mesa/drivers/dri/r600/r700_assembler.c | 407 +++++++++++++++++++++++++++-- src/mesa/drivers/dri/r600/r700_assembler.h | 65 ++++- src/mesa/drivers/dri/r600/r700_fragprog.c | 25 +- src/mesa/drivers/dri/r600/r700_vertprog.c | 25 +- 4 files changed, 498 insertions(+), 24 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index aed84fc3bd..e84f524525 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -32,6 +32,7 @@ #include "main/mtypes.h" #include "main/imports.h" +#include "shader/prog_parameter.h" #include "radeon_debug.h" #include "r600_context.h" @@ -41,6 +42,39 @@ #define USE_CF_FOR_CONTINUE_BREAK 1 #define USE_CF_FOR_POP_AFTER 1 +struct prog_instruction noise1_insts[12] = { + {OPCODE_BGNSUB , {{13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {13, 0, 15, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, + {OPCODE_MOV , {{0, 0, 0, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {0, 0, 2, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, + {OPCODE_MOV , {{8, 0, 0, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {0, 0, 4, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, + {OPCODE_MOV , {{8, 0, 585, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {0, 0, 8, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, + {OPCODE_SGT , {{0, 0, 585, 0, 0, 0}, {8, 0, 1170, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {0, 1, 1, 0, 8, 1672, 0}, 1, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, + {OPCODE_IF , {{13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {13, 0, 15, 0, 7, 0, 0}, 0, 0, 0, 1, 0, 0, 0, 15, 0, 0, 0}, + {OPCODE_MOV , {{0, 0, 1755, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {0, 0, 1, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, + {OPCODE_RET , {{13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {13, 0, 15, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, + {OPCODE_ENDIF , {{13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {13, 0, 15, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, + {OPCODE_MOV , {{0, 0, 1170, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {0, 0, 1, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, + {OPCODE_RET , {{13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {13, 0, 15, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, + {OPCODE_ENDSUB , {{13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {13, 0, 15, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0} +}; +float noise1_const[2][4] = { + {0.300000f, 0.900000f, 0.500000f, 0.300000f} +}; + +COMPILED_SUB noise1_presub = { + &(noise1_insts[0]), + 12, + 2, + 1, + 0, + &(noise1_const[0]), + SWIZZLE_X, + SWIZZLE_X, + SWIZZLE_X, + SWIZZLE_X, + {0,0,0}, + 0 +}; + BITS addrmode_PVSDST(PVSDST * pPVSDST) { return pPVSDST->addrmode0 | ((BITS)pPVSDST->addrmode1 << 1); @@ -330,14 +364,14 @@ GLuint GetSurfaceFormat(GLenum eType, GLuint nChannels, GLuint * pClient_size) return(format); } -unsigned int r700GetNumOperands(r700_AssemblerBase* pAsm) +unsigned int r700GetNumOperands(GLuint opcode, GLuint nIsOp3) { - if(pAsm->D.dst.op3) + if(nIsOp3 > 0) { return 3; } - switch (pAsm->D.dst.opcode) + switch (opcode) { case SQ_OP2_INST_ADD: case SQ_OP2_INST_KILLE: @@ -378,7 +412,7 @@ unsigned int r700GetNumOperands(r700_AssemblerBase* pAsm) return 1; default: radeon_error( - "Need instruction operand number for %x.\n", pAsm->D.dst.opcode); + "Need instruction operand number for %x.\n", opcode); }; return 3; @@ -500,6 +534,11 @@ int Init_r700_AssemblerBase(SHADER_PIPE_TYPE spt, r700_AssemblerBase* pAsm, R700 pAsm->unCFflags = 0; + pAsm->presubs = NULL; + pAsm->unPresubArraySize = 0; + pAsm->unNumPresub = 0; + pAsm->unCurNumILInsts = 0; + return 0; } @@ -2010,7 +2049,7 @@ GLboolean check_scalar(r700_AssemblerBase* pAsm, GLuint swizzle_key; - GLuint number_of_operands = r700GetNumOperands(pAsm); + GLuint number_of_operands = r700GetNumOperands(pAsm->D.dst.opcode, pAsm->D.dst.op3); for (src=0; srcD.dst.opcode, pAsm->D.dst.op3); for (src=0; srcD.dst.opcode, pAsm->D.dst.op3); //GLuint channel_swizzle, j; //GLuint chan_counter[4] = {0, 0, 0, 0}; //PVSSRC * pSource[3]; @@ -4968,7 +5007,7 @@ void add_return_inst(r700_AssemblerBase *pAsm) pAsm->cf_current_cf_clause_ptr->m_Word1.f.barrier = 0x1; } -GLboolean assemble_BGNSUB(r700_AssemblerBase *pAsm, GLint nILindex) +GLboolean assemble_BGNSUB(r700_AssemblerBase *pAsm, GLint nILindex, GLuint uiIL_Shift) { /* Put in sub */ if( (pAsm->unSubArrayPointer + 1) > pAsm->unSubArraySize ) @@ -4983,7 +5022,7 @@ GLboolean assemble_BGNSUB(r700_AssemblerBase *pAsm, GLint nILindex) pAsm->unSubArraySize += 10; } - pAsm->subs[pAsm->unSubArrayPointer].subIL_Offset = nILindex; + pAsm->subs[pAsm->unSubArrayPointer].subIL_Offset = nILindex + uiIL_Shift; pAsm->subs[pAsm->unSubArrayPointer].lstCFInstructions_local.pHead=NULL; pAsm->subs[pAsm->unSubArrayPointer].lstCFInstructions_local.pTail=NULL; pAsm->subs[pAsm->unSubArrayPointer].lstCFInstructions_local.uNumOfNode=0; @@ -5074,9 +5113,13 @@ GLboolean assemble_RET(r700_AssemblerBase *pAsm) GLboolean assemble_CAL(r700_AssemblerBase *pAsm, GLint nILindex, + GLuint uiIL_Shift, GLuint uiNumberInsts, - struct prog_instruction *pILInst) + struct prog_instruction *pILInst, + PRESUB_DESC * pPresubDesc) { + GLint uiIL_Offset; + pAsm->alu_x_opcode = SQ_CF_INST_ALU; if(GL_FALSE == add_cf_instruction(pAsm) ) @@ -5109,8 +5152,12 @@ GLboolean assemble_CAL(r700_AssemblerBase *pAsm, pAsm->unCallerArraySize += 10; } - pAsm->callers[pAsm->unCallerArrayPointer].subIL_Offset = nILindex; - pAsm->callers[pAsm->unCallerArrayPointer].cf_ptr = pAsm->cf_current_cf_clause_ptr; + uiIL_Offset = nILindex + uiIL_Shift; + pAsm->callers[pAsm->unCallerArrayPointer].subIL_Offset = uiIL_Offset; + pAsm->callers[pAsm->unCallerArrayPointer].cf_ptr = pAsm->cf_current_cf_clause_ptr; + + pAsm->callers[pAsm->unCallerArrayPointer].finale_cf_ptr = NULL; + pAsm->callers[pAsm->unCallerArrayPointer].prelude_cf_ptr = NULL; pAsm->unCallerArrayPointer++; @@ -5120,7 +5167,7 @@ GLboolean assemble_CAL(r700_AssemblerBase *pAsm, GLboolean bRet; for(j=0; junSubArrayPointer; j++) { - if(nILindex == pAsm->subs[j].subIL_Offset) + if(uiIL_Offset == pAsm->subs[j].subIL_Offset) { /* compiled before */ max = pAsm->subs[j].unStackDepthMax @@ -5138,7 +5185,7 @@ GLboolean assemble_CAL(r700_AssemblerBase *pAsm, pAsm->callers[pAsm->unCallerArrayPointer - 1].subDescIndex = pAsm->unSubArrayPointer; unSubID = pAsm->unSubArrayPointer; - bRet = AssembleInstr(nILindex, uiNumberInsts, pILInst, pAsm); + bRet = AssembleInstr(nILindex, uiIL_Shift, uiNumberInsts, pILInst, pAsm); if(GL_TRUE == bRet) { @@ -5148,6 +5195,8 @@ GLboolean assemble_CAL(r700_AssemblerBase *pAsm, { pAsm->CALLSTACK[pAsm->CALLSP].max = max; } + + pAsm->subs[unSubID].pPresubDesc = pPresubDesc; } return bRet; @@ -5313,6 +5362,7 @@ GLboolean breakLoopOnFlag(r700_AssemblerBase *pAsm, GLuint unFCSP) } GLboolean AssembleInstr(GLuint uiFirstInst, + GLuint uiIL_Shift, GLuint uiNumberInsts, struct prog_instruction *pILInst, r700_AssemblerBase *pR700AsmCode) @@ -5468,6 +5518,26 @@ GLboolean AssembleInstr(GLuint uiFirstInst, case OPCODE_MUL: if ( GL_FALSE == assemble_MUL(pR700AsmCode) ) return GL_FALSE; + break; + + case OPCODE_NOISE1: + { + callPreSub(pR700AsmCode, + GLSL_NOISE1, + &noise1_presub, + pILInst->DstReg.Index + pR700AsmCode->starting_temp_register_number, + 1); + radeon_error("noise1: not yet supported shader instruction\n"); + }; + break; + case OPCODE_NOISE2: + radeon_error("noise2: not yet supported shader instruction\n"); + break; + case OPCODE_NOISE3: + radeon_error("noise3: not yet supported shader instruction\n"); + break; + case OPCODE_NOISE4: + radeon_error("noise4: not yet supported shader instruction\n"); break; case OPCODE_POW: @@ -5653,7 +5723,7 @@ GLboolean AssembleInstr(GLuint uiFirstInst, break; case OPCODE_BGNSUB: - if( GL_FALSE == assemble_BGNSUB(pR700AsmCode, i) ) + if( GL_FALSE == assemble_BGNSUB(pR700AsmCode, i, uiIL_Shift) ) { return GL_FALSE; } @@ -5668,9 +5738,11 @@ GLboolean AssembleInstr(GLuint uiFirstInst, case OPCODE_CAL: if( GL_FALSE == assemble_CAL(pR700AsmCode, - pILInst[i].BranchTarget, + pILInst[i].BranchTarget, + uiIL_Shift, uiNumberInsts, - pILInst) ) + pILInst, + NULL) ) { return GL_FALSE; } @@ -5707,7 +5779,7 @@ GLboolean InitShaderProgram(r700_AssemblerBase * pAsm) return GL_TRUE; } -GLboolean RelocProgram(r700_AssemblerBase * pAsm) +GLboolean RelocProgram(r700_AssemblerBase * pAsm, struct gl_program * pILProg) { GLuint i; GLuint unCFoffset; @@ -5717,6 +5789,12 @@ GLboolean RelocProgram(r700_AssemblerBase * pAsm) R700ShaderInstruction * pInst; R700ControlFlowGenericClause * pCFInst; + R700ControlFlowALUClause * pCF_ALU; + R700ALUInstruction * pALU; + GLuint unConstOffset = 0; + GLuint unRegOffset; + GLuint unMinRegIndex; + plstCFmain = pAsm->CALLSTACK[0].plstCFInstructions_local; /* remove flags init if they are not used */ @@ -5762,6 +5840,11 @@ GLboolean RelocProgram(r700_AssemblerBase * pAsm) unCFoffset = plstCFmain->uNumOfNode; + if(NULL != pILProg->Parameters) + { + unConstOffset = pILProg->Parameters->NumParameters; + } + /* Reloc subs */ for(i=0; iunSubArrayPointer; i++) { @@ -5799,6 +5882,84 @@ GLboolean RelocProgram(r700_AssemblerBase * pAsm) pInst = pInst->pNextInst; }; + if(NULL != pAsm->subs[i].pPresubDesc) + { + GLuint uNumSrc; + + unMinRegIndex = pAsm->subs[i].pPresubDesc->pCompiledSub->MinRegIndex; + unRegOffset = pAsm->subs[i].pPresubDesc->maxStartReg; + unConstOffset += pAsm->subs[i].pPresubDesc->unConstantsStart; + + pInst = plstCFsub->pHead; + while(pInst) + { + if(SIT_CF_ALU == pInst->m_ShaderInstType) + { + pCF_ALU = (R700ControlFlowALUClause *)pInst; + + pALU = pCF_ALU->m_pLinkedALUInstruction; + for(int j=0; j<=pCF_ALU->m_Word1.f.count; j++) + { + pALU->m_Word1.f.dst_gpr = pALU->m_Word1.f.dst_gpr + unRegOffset - unMinRegIndex; + + if(pALU->m_Word0.f.src0_sel < SQ_ALU_SRC_GPR_SIZE) + { + pALU->m_Word0.f.src0_sel = pALU->m_Word0.f.src0_sel + unRegOffset - unMinRegIndex; + } + else if(pALU->m_Word0.f.src0_sel >= SQ_ALU_SRC_CFILE_BASE) + { + pALU->m_Word0.f.src0_sel += unConstOffset; + } + + if( ((pALU->m_Word1.val >> SQ_ALU_WORD1_OP3_ALU_INST_SHIFT) & 0x0000001F) + >= SQ_OP3_INST_MUL_LIT ) + { /* op3 : 3 srcs */ + if(pALU->m_Word1_OP3.f.src2_sel < SQ_ALU_SRC_GPR_SIZE) + { + pALU->m_Word1_OP3.f.src2_sel = pALU->m_Word1_OP3.f.src2_sel + unRegOffset - unMinRegIndex; + } + else if(pALU->m_Word1_OP3.f.src2_sel >= SQ_ALU_SRC_CFILE_BASE) + { + pALU->m_Word1_OP3.f.src2_sel += unConstOffset; + } + if(pALU->m_Word0.f.src1_sel < SQ_ALU_SRC_GPR_SIZE) + { + pALU->m_Word0.f.src1_sel = pALU->m_Word0.f.src1_sel + unRegOffset - unMinRegIndex; + } + else if(pALU->m_Word0.f.src1_sel >= SQ_ALU_SRC_CFILE_BASE) + { + pALU->m_Word0.f.src1_sel += unConstOffset; + } + } + else + { + if(pAsm->bR6xx) + { + uNumSrc = r700GetNumOperands(pALU->m_Word1_OP2.f6.alu_inst, 0); + } + else + { + uNumSrc = r700GetNumOperands(pALU->m_Word1_OP2.f.alu_inst, 0); + } + if(2 == uNumSrc) + { /* 2 srcs */ + if(pALU->m_Word0.f.src1_sel < SQ_ALU_SRC_GPR_SIZE) + { + pALU->m_Word0.f.src1_sel = pALU->m_Word0.f.src1_sel + unRegOffset - unMinRegIndex; + } + else if(pALU->m_Word0.f.src1_sel >= SQ_ALU_SRC_CFILE_BASE) + { + pALU->m_Word0.f.src1_sel += unConstOffset; + } + } + } + pALU = (R700ALUInstruction*)(pALU->pNextInst); + } + } + pInst = pInst->pNextInst; + }; + } + /* Put sub into main */ plstCFmain->pTail->pNextInst = plstCFsub->pHead; plstCFmain->pTail = plstCFsub->pTail; @@ -5812,11 +5973,216 @@ GLboolean RelocProgram(r700_AssemblerBase * pAsm) { pAsm->callers[i].cf_ptr->m_Word0.f.addr = pAsm->subs[pAsm->callers[i].subDescIndex].unCFoffset; + + if(NULL != pAsm->subs[pAsm->callers[i].subDescIndex].pPresubDesc) + { + unMinRegIndex = pAsm->subs[pAsm->callers[i].subDescIndex].pPresubDesc->pCompiledSub->MinRegIndex; + unRegOffset = pAsm->subs[pAsm->callers[i].subDescIndex].pPresubDesc->maxStartReg; + + if(NULL != pAsm->callers[i].prelude_cf_ptr) + { + pCF_ALU = (R700ControlFlowALUClause * )(pAsm->callers[i].prelude_cf_ptr); + pALU = pCF_ALU->m_pLinkedALUInstruction; + for(int j=0; j<=pCF_ALU->m_Word1.f.count; j++) + { + pALU->m_Word1.f.dst_gpr = pALU->m_Word1.f.dst_gpr + unRegOffset - unMinRegIndex; + pALU = (R700ALUInstruction*)(pALU->pNextInst); + } + } + if(NULL != pAsm->callers[i].finale_cf_ptr) + { + pCF_ALU = (R700ControlFlowALUClause * )(pAsm->callers[i].finale_cf_ptr); + pALU = pCF_ALU->m_pLinkedALUInstruction; + for(int j=0; j<=pCF_ALU->m_Word1.f.count; j++) + { + pALU->m_Word0.f.src0_sel = pALU->m_Word0.f.src0_sel + unRegOffset - unMinRegIndex; + pALU = (R700ALUInstruction*)(pALU->pNextInst); + } + } + } } return GL_TRUE; } +GLboolean callPreSub(r700_AssemblerBase* pAsm, + LOADABLE_SCRIPT_SIGNITURE scriptSigniture, + COMPILED_SUB * pCompiledSub, + GLshort uOutReg, + GLshort uNumValidSrc) +{ + /* save assemble context */ + GLuint starting_temp_register_number_save; + GLuint number_used_registers_save; + GLuint uFirstHelpReg_save; + GLuint uHelpReg_save; + GLuint uiCurInst_save; + struct prog_instruction *pILInst_save; + PRESUB_DESC * pPresubDesc; + GLboolean bRet; + int i; + + R700ControlFlowGenericClause* prelude_cf_ptr = NULL; + + /* copy srcs to presub inputs */ + pAsm->alu_x_opcode = SQ_CF_INST_ALU; + for(i=0; iD.dst.opcode = SQ_OP2_INST_MOV; + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = pCompiledSub->srcRegIndex[i]; + pAsm->D.dst.writex = 1; + pAsm->D.dst.writey = 1; + pAsm->D.dst.writez = 1; + pAsm->D.dst.writew = 1; + + if( GL_FALSE == assemble_src(pAsm, i, 0) ) + { + return GL_FALSE; + } + + next_ins(pAsm); + } + if(uNumValidSrc > 0) + { + prelude_cf_ptr = pAsm->cf_current_alu_clause_ptr; + pAsm->alu_x_opcode = SQ_CF_INST_ALU; + } + + /* browse thro existing presubs. */ + for(i=0; iunNumPresub; i++) + { + if(pAsm->presubs[i].sptSigniture == scriptSigniture) + { + break; + } + } + + if(i == pAsm->unNumPresub) + { /* not loaded yet */ + /* save assemble context */ + number_used_registers_save = pAsm->number_used_registers; + uFirstHelpReg_save = pAsm->uFirstHelpReg; + uHelpReg_save = pAsm->uHelpReg; + starting_temp_register_number_save = pAsm->starting_temp_register_number; + pILInst_save = pAsm->pILInst; + uiCurInst_save = pAsm->uiCurInst; + + /* alloc in presub */ + if( (pAsm->unNumPresub + 1) > pAsm->unPresubArraySize ) + { + pAsm->presubs = (PRESUB_DESC*)_mesa_realloc( (void *)pAsm->presubs, + sizeof(PRESUB_DESC) * pAsm->unPresubArraySize, + sizeof(PRESUB_DESC) * (pAsm->unPresubArraySize + 4) ); + if(NULL == pAsm->presubs) + { + radeon_error("No memeory to allocate built in shader function description structures. \n"); + return GL_FALSE; + } + pAsm->unPresubArraySize += 4; + } + + pPresubDesc = &(pAsm->presubs[i]); + pPresubDesc->sptSigniture = scriptSigniture; + + /* constants offsets need to be final resolved at reloc. */ + if(0 == pAsm->unNumPresub) + { + pPresubDesc->unConstantsStart = 0; + } + else + { + pPresubDesc->unConstantsStart = pAsm->presubs[i-1].unConstantsStart + + pAsm->presubs[i-1].pCompiledSub->NumParameters; + } + + pPresubDesc->pCompiledSub = pCompiledSub; + + pPresubDesc->subIL_Shift = pAsm->unCurNumILInsts; + pPresubDesc->maxStartReg = uFirstHelpReg_save; + pAsm->unCurNumILInsts += pCompiledSub->NumInstructions; + + pAsm->unNumPresub++; + + /* setup new assemble context */ + pAsm->starting_temp_register_number = 0; + pAsm->number_used_registers = pCompiledSub->NumTemporaries; + pAsm->uFirstHelpReg = pAsm->number_used_registers; + pAsm->uHelpReg = pAsm->uFirstHelpReg; + + bRet = assemble_CAL(pAsm, + 0, + pPresubDesc->subIL_Shift, + pCompiledSub->NumInstructions, + pCompiledSub->Instructions, + pPresubDesc); + + + pPresubDesc->number_used_registers = pAsm->number_used_registers; + + /* restore assemble context */ + pAsm->number_used_registers = number_used_registers_save; + pAsm->uFirstHelpReg = uFirstHelpReg_save; + pAsm->uHelpReg = uHelpReg_save; + pAsm->starting_temp_register_number = starting_temp_register_number_save; + pAsm->pILInst = pILInst_save; + pAsm->uiCurInst = uiCurInst_save; + } + else + { /* was loaded */ + pPresubDesc = &(pAsm->presubs[i]); + + bRet = assemble_CAL(pAsm, + 0, + pPresubDesc->subIL_Shift, + pCompiledSub->NumInstructions, + pCompiledSub->Instructions, + pPresubDesc); + } + + if(GL_FALSE == bRet) + { + radeon_error("Shader presub assemble failed. \n"); + } + else + { + /* copy presub output to real dst */ + pAsm->alu_x_opcode = SQ_CF_INST_ALU; + pAsm->D.dst.opcode = SQ_OP2_INST_MOV; + + if( GL_FALSE == assemble_dst(pAsm) ) + { + return GL_FALSE; + } + + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[0].src.reg = pCompiledSub->dstRegIndex; + pAsm->S[0].src.swizzlex = pCompiledSub->outputSwizzleX; + pAsm->S[0].src.swizzley = pCompiledSub->outputSwizzleY; + pAsm->S[0].src.swizzlez = pCompiledSub->outputSwizzleZ; + pAsm->S[0].src.swizzlew = pCompiledSub->outputSwizzleW; + + next_ins(pAsm); + + pAsm->callers[pAsm->unCallerArrayPointer - 1].finale_cf_ptr = pAsm->cf_current_alu_clause_ptr; + pAsm->callers[pAsm->unCallerArrayPointer - 1].prelude_cf_ptr = prelude_cf_ptr; + pAsm->alu_x_opcode = SQ_CF_INST_ALU; + } + + if( (pPresubDesc->number_used_registers + pAsm->uFirstHelpReg) > pAsm->number_used_registers ) + { + pAsm->number_used_registers = pPresubDesc->number_used_registers + pAsm->uFirstHelpReg; + } + if(pAsm->uFirstHelpReg > pPresubDesc->maxStartReg) + { + pPresubDesc->maxStartReg = pAsm->uFirstHelpReg; + } + + return bRet; +} + GLboolean Process_Export(r700_AssemblerBase* pAsm, GLuint type, GLuint export_starting_index, @@ -6174,6 +6540,11 @@ GLboolean Clean_Up_Assembler(r700_AssemblerBase *pR700AsmCode) FREE(pR700AsmCode->callers); } + if(NULL != pR700AsmCode->presubs) + { + FREE(pR700AsmCode->presubs); + } + return GL_TRUE; } diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index 6dc44017eb..6ef945dfda 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -34,6 +34,45 @@ #include "r700_shaderinst.h" #include "r700_shader.h" +typedef enum LOADABLE_SCRIPT_SIGNITURE +{ + GLSL_NOISE1 = 0x10000001, + GLSL_NOISE2 = 0x10000002, + GLSL_NOISE3 = 0x10000003, + GLSL_NOISE4 = 0x10000004 +}LOADABLE_SCRIPT_SIGNITURE; + +typedef struct COMPILED_SUB +{ + struct prog_instruction *Instructions; + GLuint NumInstructions; + GLuint NumTemporaries; + GLuint NumParameters; + GLuint MinRegIndex; + GLfloat (*ParameterValues)[4]; + GLbyte outputSwizzleX; + GLbyte outputSwizzleY; + GLbyte outputSwizzleZ; + GLbyte outputSwizzleW; + GLshort srcRegIndex[3]; + GLushort dstRegIndex; +}COMPILED_SUB; + +typedef struct PRESUB_DESCtag +{ + LOADABLE_SCRIPT_SIGNITURE sptSigniture; + GLint subIL_Shift; + struct prog_src_register InReg[3]; + struct prog_dst_register OutReg; + + GLushort maxStartReg; + GLushort number_used_registers; + + GLuint unConstantsStart; + + COMPILED_SUB * pCompiledSub; +} PRESUB_DESC; + typedef enum SHADER_PIPE_TYPE { SPT_VP = 0, @@ -296,6 +335,7 @@ typedef struct SUB_OFFSET GLint subIL_Offset; GLuint unCFoffset; GLuint unStackDepthMax; + PRESUB_DESC * pPresubDesc; TypedShaderList lstCFInstructions_local; } SUB_OFFSET; @@ -304,6 +344,9 @@ typedef struct CALLER_POINTER GLint subIL_Offset; GLint subDescIndex; R700ControlFlowGenericClause* cf_ptr; + + R700ControlFlowGenericClause* prelude_cf_ptr; + R700ControlFlowGenericClause* finale_cf_ptr; } CALLER_POINTER; #define SQ_MAX_CALL_DEPTH 0x00000020 @@ -437,6 +480,11 @@ typedef struct r700_AssemblerBase GLuint unCFflags; + PRESUB_DESC * presubs; + GLuint unPresubArraySize; + GLuint unNumPresub; + GLuint unCurNumILInsts; + } r700_AssemblerBase; //Internal use @@ -458,7 +506,7 @@ BITS is_depth_component_exported(OUT_FRAGMENT_FMT_0* pFPOutFmt) ; GLboolean is_reduction_opcode(PVSDWORD * dest); GLuint GetSurfaceFormat(GLenum eType, GLuint nChannels, GLuint * pClient_size); -unsigned int r700GetNumOperands(r700_AssemblerBase* pAsm); +unsigned int r700GetNumOperands(GLuint opcode, GLuint nIsOp3); GLboolean IsTex(gl_inst_opcode Opcode); GLboolean IsAlu(gl_inst_opcode Opcode); @@ -585,13 +633,15 @@ GLboolean assemble_BRK(r700_AssemblerBase *pAsm); GLboolean assemble_COND(r700_AssemblerBase *pAsm); GLboolean assemble_ENDLOOP(r700_AssemblerBase *pAsm); -GLboolean assemble_BGNSUB(r700_AssemblerBase *pAsm, GLint nILindex); +GLboolean assemble_BGNSUB(r700_AssemblerBase *pAsm, GLint nILindex, GLuint uiIL_Shift); GLboolean assemble_ENDSUB(r700_AssemblerBase *pAsm); GLboolean assemble_RET(r700_AssemblerBase *pAsm); GLboolean assemble_CAL(r700_AssemblerBase *pAsm, GLint nILindex, + GLuint uiIL_Offest, GLuint uiNumberInsts, - struct prog_instruction *pILInst); + struct prog_instruction *pILInst, + PRESUB_DESC * pPresubDesc); GLboolean Process_Export(r700_AssemblerBase* pAsm, GLuint type, @@ -602,16 +652,23 @@ GLboolean Process_Export(r700_AssemblerBase* pAsm, GLboolean Move_Depth_Exports_To_Correct_Channels(r700_AssemblerBase *pAsm, BITS depth_channel_select); +GLboolean callPreSub(r700_AssemblerBase* pAsm, + LOADABLE_SCRIPT_SIGNITURE scriptSigniture, + /* struct prog_instruction ** pILInstParent, */ + COMPILED_SUB * pCompiledSub, + GLshort uOutReg, + GLshort uNumValidSrc); //Interface GLboolean AssembleInstr(GLuint uiFirstInst, + GLuint uiIL_Shift, GLuint uiNumberInsts, struct prog_instruction *pILInst, r700_AssemblerBase *pR700AsmCode); GLboolean Process_Fragment_Exports(r700_AssemblerBase *pR700AsmCode, GLbitfield OutputsWritten); GLboolean Process_Vertex_Exports(r700_AssemblerBase *pR700AsmCode, GLbitfield OutputsWritten); -GLboolean RelocProgram(r700_AssemblerBase * pAsm); +GLboolean RelocProgram(r700_AssemblerBase * pAsm, struct gl_program * pILProg); GLboolean InitShaderProgram(r700_AssemblerBase * pAsm); int Init_r700_AssemblerBase(SHADER_PIPE_TYPE spt, r700_AssemblerBase* pAsm, R700_Shader* pShader); diff --git a/src/mesa/drivers/dri/r600/r700_fragprog.c b/src/mesa/drivers/dri/r600/r700_fragprog.c index 8eb439a951..d15f013710 100644 --- a/src/mesa/drivers/dri/r600/r700_fragprog.c +++ b/src/mesa/drivers/dri/r600/r700_fragprog.c @@ -325,7 +325,11 @@ GLboolean r700TranslateFragmentShader(struct r700_fragment_program *fp, { fp->r700AsmCode.SamplerUnits[i] = fp->mesa_program.Base.SamplerUnits[i]; } + + fp->r700AsmCode.unCurNumILInsts = mesa_fp->Base.NumInstructions; + if( GL_FALSE == AssembleInstr(0, + 0, mesa_fp->Base.NumInstructions, &(mesa_fp->Base.Instructions[0]), &(fp->r700AsmCode)) ) @@ -338,7 +342,7 @@ GLboolean r700TranslateFragmentShader(struct r700_fragment_program *fp, return GL_FALSE; } - if( GL_FALSE == RelocProgram(&(fp->r700AsmCode)) ) + if( GL_FALSE == RelocProgram(&(fp->r700AsmCode), &(mesa_fp->Base)) ) { return GL_FALSE; } @@ -620,6 +624,25 @@ GLboolean r700SetupFragmentProgram(GLcontext * ctx) } else r700->ps.num_consts = 0; + COMPILED_SUB * pCompiledSub; + GLuint uj; + GLuint unConstOffset = r700->ps.num_consts; + for(ui=0; uiunNumPresub; ui++) + { + pCompiledSub = pAsm->presubs[ui].pCompiledSub; + + r700->ps.num_consts += pCompiledSub->NumParameters; + + for(uj=0; ujNumParameters; uj++) + { + r700->ps.consts[uj + unConstOffset][0].f32All = pCompiledSub->ParameterValues[uj][0]; + r700->ps.consts[uj + unConstOffset][1].f32All = pCompiledSub->ParameterValues[uj][1]; + r700->ps.consts[uj + unConstOffset][2].f32All = pCompiledSub->ParameterValues[uj][2]; + r700->ps.consts[uj + unConstOffset][3].f32All = pCompiledSub->ParameterValues[uj][3]; + } + unConstOffset += pCompiledSub->NumParameters; + } + return GL_TRUE; } diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.c b/src/mesa/drivers/dri/r600/r700_vertprog.c index 759b74dc7e..90fac078ff 100644 --- a/src/mesa/drivers/dri/r600/r700_vertprog.c +++ b/src/mesa/drivers/dri/r600/r700_vertprog.c @@ -341,7 +341,11 @@ struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, { vp->r700AsmCode.SamplerUnits[i] = vp->mesa_program->Base.SamplerUnits[i]; } + + vp->r700AsmCode.unCurNumILInsts = vp->mesa_program->Base.NumInstructions; + if(GL_FALSE == AssembleInstr(0, + 0, vp->mesa_program->Base.NumInstructions, &(vp->mesa_program->Base.Instructions[0]), &(vp->r700AsmCode)) ) @@ -354,7 +358,7 @@ struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, return NULL; } - if( GL_FALSE == RelocProgram(&(vp->r700AsmCode)) ) + if( GL_FALSE == RelocProgram(&(vp->r700AsmCode), &(vp->mesa_program->Base)) ) { return GL_FALSE; } @@ -671,5 +675,24 @@ GLboolean r700SetupVertexProgram(GLcontext * ctx) } else r700->vs.num_consts = 0; + COMPILED_SUB * pCompiledSub; + GLuint uj; + GLuint unConstOffset = r700->vs.num_consts; + for(ui=0; uir700AsmCode.unNumPresub; ui++) + { + pCompiledSub = vp->r700AsmCode.presubs[ui].pCompiledSub; + + r700->vs.num_consts += pCompiledSub->NumParameters; + + for(uj=0; ujNumParameters; uj++) + { + r700->vs.consts[uj + unConstOffset][0].f32All = pCompiledSub->ParameterValues[uj][0]; + r700->vs.consts[uj + unConstOffset][1].f32All = pCompiledSub->ParameterValues[uj][1]; + r700->vs.consts[uj + unConstOffset][2].f32All = pCompiledSub->ParameterValues[uj][2]; + r700->vs.consts[uj + unConstOffset][3].f32All = pCompiledSub->ParameterValues[uj][3]; + } + unConstOffset += pCompiledSub->NumParameters; + } + return GL_TRUE; } -- cgit v1.2.3 From 637970aefdcdd1ee50e3759de384b82e6109a45c Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 9 Dec 2009 12:43:28 -0800 Subject: mesa: Fix array out-of-bounds access by _mesa_LightModelf. _mesa_LightModelf calls _mesa_LightModelfv, which uses the params argument as an array. --- src/mesa/main/light.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index 5a8f9160f6..c1d47de330 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -547,7 +547,10 @@ _mesa_LightModeli( GLenum pname, GLint param ) void GLAPIENTRY _mesa_LightModelf( GLenum pname, GLfloat param ) { - _mesa_LightModelfv( pname, ¶m ); + GLfloat fparam[4]; + fparam[0] = param; + fparam[1] = fparam[2] = fparam[3] = 0.0F; + _mesa_LightModelfv( pname, fparam ); } -- cgit v1.2.3 From 6f2d51b81ff907af9727e90153a46e79e246fc66 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 9 Dec 2009 13:00:22 -0800 Subject: mesa: Fix array out-of-bounds access by _mesa_PointParameterf. _mesa_PointParameterf calls _mesa_PointParameterfv, which uses the params argument as an array. --- src/mesa/main/points.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c index b330544890..9ec21c9b76 100644 --- a/src/mesa/main/points.c +++ b/src/mesa/main/points.c @@ -90,7 +90,10 @@ _mesa_PointParameteriv( GLenum pname, const GLint *params ) void GLAPIENTRY _mesa_PointParameterf( GLenum pname, GLfloat param) { - _mesa_PointParameterfv(pname, ¶m); + GLfloat p[3]; + p[0] = param; + p[1] = p[2] = 0.0F; + _mesa_PointParameterfv(pname, p); } -- cgit v1.2.3 From 348883076bd213ec733a1ba2a4768788e4669c97 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 9 Dec 2009 13:15:05 -0800 Subject: mesa: Fix array out-of-bounds access by _mesa_PointParameteri. _mesa_PointParameteri calls _mesa_PointParameterfv, which uses the params argument as an array. --- src/mesa/main/points.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c index 9ec21c9b76..dcaeccd90d 100644 --- a/src/mesa/main/points.c +++ b/src/mesa/main/points.c @@ -69,8 +69,10 @@ _mesa_PointSize( GLfloat size ) void GLAPIENTRY _mesa_PointParameteri( GLenum pname, GLint param ) { - const GLfloat value = (GLfloat) param; - _mesa_PointParameterfv(pname, &value); + GLfloat p[3]; + p[0] = (GLfloat) param; + p[1] = p[2] = 0.0F; + _mesa_PointParameterfv(pname, p); } -- cgit v1.2.3 From 34528a34c446afea4442f479713e7f926220f128 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 9 Dec 2009 17:11:30 -0800 Subject: mesa: Fix array out-of-bounds access by _mesa_Lightf. --- src/mesa/main/light.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index c1d47de330..d4f3bb9026 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -206,7 +206,10 @@ _mesa_light(GLcontext *ctx, GLuint lnum, GLenum pname, const GLfloat *params) void GLAPIENTRY _mesa_Lightf( GLenum light, GLenum pname, GLfloat param ) { - _mesa_Lightfv( light, pname, ¶m ); + GLfloat fparam[4]; + fparam[0] = param; + fparam[1] = fparam[2] = fparam[3] = 0.0F; + _mesa_Lightfv( light, pname, fparam ); } -- cgit v1.2.3 From 444d1f39108ab4419843f19f76c968cef3398bab Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 9 Dec 2009 17:34:50 -0800 Subject: mesa: Fix array out-of-bounds access by _mesa_Lighti. _mesa_Lighti calls _mesa_Lightiv, which uses the params argument as an array. --- src/mesa/main/light.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index d4f3bb9026..5150926159 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -288,7 +288,10 @@ _mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params ) void GLAPIENTRY _mesa_Lighti( GLenum light, GLenum pname, GLint param ) { - _mesa_Lightiv( light, pname, ¶m ); + GLint iparam[4]; + iparam[0] = param; + iparam[1] = iparam[2] = iparam[3] = 0; + _mesa_Lightiv( light, pname, iparam ); } -- cgit v1.2.3 From b82757880545f8bce471ba8f13c16998888cd4b5 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 9 Dec 2009 17:59:23 -0800 Subject: mesa: Fix array out-of-bounds access by _mesa_TexGend. _mesa_TexGend calls _mesa_TexGenfv, which uses the params argument as an array. --- src/mesa/main/texgen.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texgen.c b/src/mesa/main/texgen.c index d3ea7b936b..f9d38215d6 100644 --- a/src/mesa/main/texgen.c +++ b/src/mesa/main/texgen.c @@ -181,8 +181,10 @@ _mesa_TexGeniv(GLenum coord, GLenum pname, const GLint *params ) void GLAPIENTRY _mesa_TexGend(GLenum coord, GLenum pname, GLdouble param ) { - GLfloat p = (GLfloat) param; - _mesa_TexGenfv( coord, pname, &p ); + GLfloat p[4]; + p[0] = (GLfloat) param; + p[1] = p[2] = p[3] = 0.0F; + _mesa_TexGenfv( coord, pname, p ); } -- cgit v1.2.3 From 05b62960929b78a53465ffcb0739454519ed157a Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 9 Dec 2009 22:34:07 -0800 Subject: mesa: Fix SCons build. Commit cd6b8dd9e82fedc55d033131fbc0f8ee950567c8 deleted src/mesa/state_tracker/st_cb_get.c. --- src/mesa/SConscript | 1 - 1 file changed, 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/SConscript b/src/mesa/SConscript index 309e0e54d0..ca4a9afce5 100644 --- a/src/mesa/SConscript +++ b/src/mesa/SConscript @@ -164,7 +164,6 @@ if env['platform'] != 'winddk': 'state_tracker/st_cb_flush.c', 'state_tracker/st_cb_drawpixels.c', 'state_tracker/st_cb_fbo.c', - 'state_tracker/st_cb_get.c', 'state_tracker/st_cb_feedback.c', 'state_tracker/st_cb_program.c', 'state_tracker/st_cb_queryobj.c', -- cgit v1.2.3 From 51e945ec9c0b803f5e998f87449fb02a7c39ae65 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 10 Dec 2009 09:16:37 -0800 Subject: intel: Attempt to fix up after "Update vertex texture code." The MaxCombinedTextureImageUnits is the total number of samplers that can be bound between vertex, geometry, and fragment, not 0. This should report the correct value on 965 now. Other DRI drivers may also need updating if their MaxVertexTextureImageUnits != 0 (for example, if using the sw vertex pipeline). It's not clear to me if there's going to be a valid value for this limit other than MaxTextureImageUnits + MaxVertexTextureImageUnits (+ MaxGeometryTextureImageUnits eventually). If not, then we should probably just move this into the core at Get time. Bug #25518 (wine regression). Fixes piglit vp-combined-image-units. --- src/mesa/drivers/dri/i915/i915_context.c | 3 +++ src/mesa/drivers/dri/i965/brw_context.c | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c index 7d4c7cfbab..0485be2cc1 100644 --- a/src/mesa/drivers/dri/i915/i915_context.c +++ b/src/mesa/drivers/dri/i915/i915_context.c @@ -143,6 +143,9 @@ i915CreateContext(const __GLcontextModes * mesaVis, ctx->Const.MaxTextureImageUnits = I915_TEX_UNITS; ctx->Const.MaxTextureCoordUnits = I915_TEX_UNITS; ctx->Const.MaxVarying = I915_TEX_UNITS; + ctx->Const.MaxCombinedTextureImageUnits = + ctx->Const.MaxVertexTextureImageUnits + + ctx->Const.MaxTextureImageUnits; /* Advertise the full hardware capabilities. The new memory * manager should cope much better with overload situations: diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 8bdda60697..78bea82949 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -111,7 +111,9 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis, ctx->Const.MaxTextureUnits = MIN2(ctx->Const.MaxTextureCoordUnits, ctx->Const.MaxTextureImageUnits); ctx->Const.MaxVertexTextureImageUnits = 0; /* no vertex shader textures */ - ctx->Const.MaxCombinedTextureImageUnits = 0; + ctx->Const.MaxCombinedTextureImageUnits = + ctx->Const.MaxVertexTextureImageUnits + + ctx->Const.MaxTextureImageUnits; /* Mesa limits textures to 4kx4k; it would be nice to fix that someday */ -- cgit v1.2.3 From cb640c8d40c4ee34160a14d646c244f44a5013f6 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 10 Dec 2009 10:03:16 -0800 Subject: mesa: Fix default (swrast) GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS. The swrast pipeline shouldn't have any problem with all the frag and vert textures being bound at the same time. Note that this may result in DRI drivers that don't set this limit having an improbable return (fragment + vertex < combined), but it seems like it shouldn't cause problems for apps. --- src/mesa/main/config.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h index c5048970cc..2eac1cc2ed 100644 --- a/src/mesa/main/config.h +++ b/src/mesa/main/config.h @@ -243,7 +243,8 @@ /*@{*/ #define MAX_VERTEX_GENERIC_ATTRIBS 16 #define MAX_VERTEX_TEXTURE_IMAGE_UNITS MAX_TEXTURE_IMAGE_UNITS -#define MAX_COMBINED_TEXTURE_IMAGE_UNITS MAX_TEXTURE_IMAGE_UNITS +#define MAX_COMBINED_TEXTURE_IMAGE_UNITS (MAX_VERTEX_TEXTURE_IMAGE_UNITS + \ + MAX_TEXTURE_IMAGE_UNITS) /*@}*/ -- cgit v1.2.3 From dcb4a37fc89924192d923ed6906d2922371b8cb1 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 10 Dec 2009 12:11:09 -0800 Subject: mesa: Fix array out-of-bounds access by _mesa_TexParameteriv. --- src/mesa/main/texparam.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 1cec4b82fe..0f83d226f2 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -700,8 +700,10 @@ _mesa_TexParameteriv(GLenum target, GLenum pname, const GLint *params) case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: { /* convert int param to float */ - GLfloat fparam = (GLfloat) params[0]; - need_update = set_tex_parameterf(ctx, texObj, pname, &fparam); + GLfloat fparams[4]; + fparams[0] = (GLfloat) params[0]; + fparams[1] = fparams[2] = fparams[3] = 0.0F; + need_update = set_tex_parameterf(ctx, texObj, pname, fparams); } break; default: -- cgit v1.2.3 From 51f52edaf186a927a2c8c29ba9dba56d18928a7e Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 10 Dec 2009 12:37:10 -0800 Subject: glsl: Fix array out-of-bounds access by _slang_lookup_constant. --- src/mesa/shader/slang/slang_simplify.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/slang/slang_simplify.c b/src/mesa/shader/slang/slang_simplify.c index b8a21f642c..539c6ff0d1 100644 --- a/src/mesa/shader/slang/slang_simplify.c +++ b/src/mesa/shader/slang/slang_simplify.c @@ -84,10 +84,11 @@ _slang_lookup_constant(const char *name) for (i = 0; info[i].Name; i++) { if (strcmp(info[i].Name, name) == 0) { /* found */ - GLint value = -1; - _mesa_GetIntegerv(info[i].Token, &value); - ASSERT(value >= 0); /* sanity check that glGetFloatv worked */ - return value; + GLint values[4]; + values[0] = -1; + _mesa_GetIntegerv(info[i].Token, values); + ASSERT(values[0] >= 0); /* sanity check that glGetFloatv worked */ + return values[0]; } } return -1; -- cgit v1.2.3 From 539a14a1dd5a0d277b193d9cd2d06423ed98dc8a Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 9 Dec 2009 11:36:45 -0800 Subject: intel: Flush the render/texture cache when finishing render to texture. Back when we were flushing the entire batch at BindFramebuffer, the kernel would notice the domain transition when someone went to texture from it and flush for us. We no longer do the batch flushing every time, so we get to do aggressive flushing until we move batchbuffer handling to libdrm. Fixes piglit fbo-flushing. Bug #25377. No noticeable performance loss on cairo-gl (so this is better than batch flushing). --- src/mesa/drivers/dri/intel/intel_fbo.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 5615040946..679fa2f82a 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -37,6 +37,7 @@ #include "drivers/common/meta.h" #include "intel_context.h" +#include "intel_batchbuffer.h" #include "intel_buffers.h" #include "intel_fbo.h" #include "intel_mipmap_tree.h" @@ -591,6 +592,7 @@ static void intel_finish_render_texture(GLcontext * ctx, struct gl_renderbuffer_attachment *att) { + struct intel_context *intel = intel_context(ctx); struct gl_texture_object *tex_obj = att->Texture; struct gl_texture_image *image = tex_obj->Image[att->CubeMapFace][att->TextureLevel]; @@ -598,8 +600,14 @@ intel_finish_render_texture(GLcontext * ctx, /* Flag that this image may now be validated into the object's miptree. */ intel_image->used_as_render_target = GL_FALSE; -} + /* Since we've (probably) rendered to the texture and will (likely) use + * it in the texture domain later on in this batchbuffer, flush the + * batch. Once again, we wish for a domain tracker in libdrm to cover + * usage inside of a batchbuffer like GEM does in the kernel. + */ + intel_batchbuffer_emit_mi_flush(intel->batch); +} /** * Do additional "completeness" testing of a framebuffer object. -- cgit v1.2.3 From 3078bd136d6ee1d9ad16b4c834cad23b005304a4 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 8 Dec 2009 09:57:27 -0800 Subject: intel: Axe intel_renderbuffer::texformat Since the texformat branch merge, the value of intel_renderbuffer::texformat is just a copy of gl_renderbuffer::Format. --- src/mesa/drivers/dri/i915/i830_vtbl.c | 4 ++-- src/mesa/drivers/dri/i915/i915_vtbl.c | 4 ++-- src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 4 ++-- src/mesa/drivers/dri/intel/intel_blit.c | 4 ++-- src/mesa/drivers/dri/intel/intel_fbo.c | 13 ++----------- src/mesa/drivers/dri/intel/intel_fbo.h | 2 -- src/mesa/drivers/dri/intel/intel_span.c | 6 +++--- 7 files changed, 13 insertions(+), 24 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i830_vtbl.c b/src/mesa/drivers/dri/i915/i830_vtbl.c index a6f554701e..e8c8d5a048 100644 --- a/src/mesa/drivers/dri/i915/i830_vtbl.c +++ b/src/mesa/drivers/dri/i915/i830_vtbl.c @@ -645,7 +645,7 @@ i830_state_draw_region(struct intel_context *intel, DSTORG_VERT_BIAS(0x8) | DEPTH_IS_Z); /* .5 */ if (irb != NULL) { - switch (irb->texformat) { + switch (irb->Base.Format) { case MESA_FORMAT_ARGB8888: case MESA_FORMAT_XRGB8888: value |= DV_PF_8888; @@ -661,7 +661,7 @@ i830_state_draw_region(struct intel_context *intel, break; default: _mesa_problem(ctx, "Bad renderbuffer format: %d\n", - irb->texformat); + irb->Base.Format); } } diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c b/src/mesa/drivers/dri/i915/i915_vtbl.c index 77ba8d5581..ff97e5a944 100644 --- a/src/mesa/drivers/dri/i915/i915_vtbl.c +++ b/src/mesa/drivers/dri/i915/i915_vtbl.c @@ -587,7 +587,7 @@ i915_state_draw_region(struct intel_context *intel, DSTORG_VERT_BIAS(0x8) | /* .5 */ LOD_PRECLAMP_OGL | TEX_DEFAULT_COLOR_OGL); if (irb != NULL) { - switch (irb->texformat) { + switch (irb->Base.Format) { case MESA_FORMAT_ARGB8888: case MESA_FORMAT_XRGB8888: value |= DV_PF_8888; @@ -603,7 +603,7 @@ i915_state_draw_region(struct intel_context *intel, break; default: _mesa_problem(ctx, "Bad renderbuffer format: %d\n", - irb->texformat); + irb->Base.Format); } } diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index 47035cc6fc..b7b6eaec2b 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -537,7 +537,7 @@ brw_update_renderbuffer_surface(struct brw_context *brw, region_bo = region->buffer; key.surface_type = BRW_SURFACE_2D; - switch (irb->texformat) { + switch (irb->Base.Format) { case MESA_FORMAT_ARGB8888: key.surface_format = BRW_SURFACEFORMAT_B8G8R8A8_UNORM; break; @@ -554,7 +554,7 @@ brw_update_renderbuffer_surface(struct brw_context *brw, key.surface_format = BRW_SURFACEFORMAT_B4G4R4A4_UNORM; break; default: - _mesa_problem(ctx, "Bad renderbuffer format: %d\n", irb->texformat); + _mesa_problem(ctx, "Bad renderbuffer format: %d\n", irb->Base.Format); } key.tiling = region->tiling; if (brw->intel.intelScreen->driScrnPriv->dri2.enabled) { diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c index 817223da41..9f638b0ef9 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.c +++ b/src/mesa/drivers/dri/intel/intel_blit.c @@ -496,7 +496,7 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask) CLAMPED_FLOAT_TO_UBYTE(clear[2], color[2]); CLAMPED_FLOAT_TO_UBYTE(clear[3], color[3]); - switch (irb->texformat) { + switch (irb->Base.Format) { case MESA_FORMAT_ARGB8888: case MESA_FORMAT_XRGB8888: clearVal = intel->ClearColor8888; @@ -514,7 +514,7 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask) break; default: _mesa_problem(ctx, "Unexpected renderbuffer format: %d\n", - irb->texformat); + irb->Base.Format); clearVal = 0; } } diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 679fa2f82a..649fd1a78f 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -117,7 +117,6 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_RGB5: rb->Format = MESA_FORMAT_RGB565; rb->DataType = GL_UNSIGNED_BYTE; - irb->texformat = MESA_FORMAT_RGB565; cpp = 2; break; case GL_RGB: @@ -125,9 +124,8 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_RGB10: case GL_RGB12: case GL_RGB16: - rb->Format = MESA_FORMAT_ARGB8888; + rb->Format = MESA_FORMAT_ARGB8888; /* XXX: Need xrgb8888 */ rb->DataType = GL_UNSIGNED_BYTE; - irb->texformat = MESA_FORMAT_ARGB8888; /* XXX: Need xrgb8888 */ cpp = 4; break; case GL_RGBA: @@ -140,7 +138,6 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_RGBA16: rb->Format = MESA_FORMAT_ARGB8888; rb->DataType = GL_UNSIGNED_BYTE; - irb->texformat = MESA_FORMAT_ARGB8888; cpp = 4; break; case GL_STENCIL_INDEX: @@ -152,13 +149,11 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, rb->Format = MESA_FORMAT_S8_Z24; rb->DataType = GL_UNSIGNED_INT_24_8_EXT; cpp = 4; - irb->texformat = MESA_FORMAT_S8_Z24; break; case GL_DEPTH_COMPONENT16: rb->Format = MESA_FORMAT_Z16; rb->DataType = GL_UNSIGNED_SHORT; cpp = 2; - irb->texformat = MESA_FORMAT_Z16; break; case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT24: @@ -166,14 +161,12 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, rb->Format = MESA_FORMAT_S8_Z24; rb->DataType = GL_UNSIGNED_INT_24_8_EXT; cpp = 4; - irb->texformat = MESA_FORMAT_S8_Z24; break; case GL_DEPTH_STENCIL_EXT: case GL_DEPTH24_STENCIL8_EXT: rb->Format = MESA_FORMAT_S8_Z24; rb->DataType = GL_UNSIGNED_INT_24_8_EXT; cpp = 4; - irb->texformat = MESA_FORMAT_S8_Z24; break; default: _mesa_problem(ctx, @@ -347,7 +340,6 @@ intel_create_renderbuffer(gl_format format) irb->Base.Format = format; irb->Base.InternalFormat = irb->Base._BaseFormat; - irb->texformat = format; /* intel-specific methods */ irb->Base.Delete = intel_delete_renderbuffer; @@ -424,7 +416,6 @@ static GLboolean intel_update_wrapper(GLcontext *ctx, struct intel_renderbuffer *irb, struct gl_texture_image *texImage) { - irb->texformat = texImage->TexFormat; gl_format texFormat; if (texImage->TexFormat == MESA_FORMAT_ARGB8888) { @@ -640,7 +631,7 @@ intel_validate_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb) continue; } - switch (irb->texformat) { + switch (irb->Base.Format) { case MESA_FORMAT_ARGB8888: case MESA_FORMAT_XRGB8888: case MESA_FORMAT_RGB565: diff --git a/src/mesa/drivers/dri/intel/intel_fbo.h b/src/mesa/drivers/dri/intel/intel_fbo.h index 50a8a95985..fa43077d6a 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.h +++ b/src/mesa/drivers/dri/intel/intel_fbo.h @@ -62,8 +62,6 @@ struct intel_renderbuffer struct gl_renderbuffer Base; struct intel_region *region; - gl_format texformat; - GLuint vbl_pending; /**< vblank sequence number of pending flip */ uint8_t *span_cache; diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index 3607c7dded..f02fbe9875 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -624,7 +624,7 @@ intel_set_span_functions(struct intel_context *intel, tiling = I915_TILING_NONE; if (intel->intelScreen->kernel_exec_fencing) { - switch (irb->texformat) { + switch (irb->Base.Format) { case MESA_FORMAT_RGB565: intel_gttmap_InitPointers_RGB565(rb); break; @@ -667,13 +667,13 @@ intel_set_span_functions(struct intel_context *intel, default: _mesa_problem(NULL, "Unexpected MesaFormat %d in intelSetSpanFunctions", - irb->texformat); + irb->Base.Format); break; } return; } - switch (irb->texformat) { + switch (irb->Base.Format) { case MESA_FORMAT_RGB565: switch (tiling) { case I915_TILING_NONE: -- cgit v1.2.3 From 4eee46efcb7e1f737b7115caf48ddb3b77408626 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 8 Dec 2009 15:51:18 -0800 Subject: intel: softwareBuffer in intel_alloc_renderbuffer_storage was always false, remove --- src/mesa/drivers/dri/intel/intel_fbo.c | 37 ++++++++++++++-------------------- 1 file changed, 15 insertions(+), 22 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 649fd1a78f..9a304b0351 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -106,8 +106,8 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, { struct intel_context *intel = intel_context(ctx); struct intel_renderbuffer *irb = intel_renderbuffer(rb); - GLboolean softwareBuffer = GL_FALSE; int cpp; + GLuint pitch; ASSERT(rb->Name != 0); @@ -184,32 +184,25 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, } /* allocate new memory region/renderbuffer */ - if (softwareBuffer) { - return _mesa_soft_renderbuffer_storage(ctx, rb, internalFormat, - width, height); - } - else { - /* Choose a pitch to match hardware requirements: - */ - GLuint pitch = ((cpp * width + 63) & ~63) / cpp; - /* alloc hardware renderbuffer */ - DBG("Allocating %d x %d Intel RBO (pitch %d)\n", width, - height, pitch); + /* Choose a pitch to match hardware requirements: + */ + pitch = ((cpp * width + 63) & ~63) / cpp; - irb->region = intel_region_alloc(intel, I915_TILING_NONE, - cpp, width, height, pitch, - GL_TRUE); - if (!irb->region) - return GL_FALSE; /* out of memory? */ + /* alloc hardware renderbuffer */ + DBG("Allocating %d x %d Intel RBO (pitch %d)\n", width, height, pitch); - ASSERT(irb->region->buffer); + irb->region = intel_region_alloc(intel, I915_TILING_NONE, cpp, + width, height, pitch, GL_TRUE); + if (!irb->region) + return GL_FALSE; /* out of memory? */ - rb->Width = width; - rb->Height = height; + ASSERT(irb->region->buffer); - return GL_TRUE; - } + rb->Width = width; + rb->Height = height; + + return GL_TRUE; } -- cgit v1.2.3 From 0f01674a584ea6df96acf91d7cd3b8a9b48ee65e Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 8 Dec 2009 16:06:13 -0800 Subject: intel: Use texformat accessor to get bytes-per-pixel --- src/mesa/drivers/dri/intel/intel_fbo.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 9a304b0351..5a67cb1388 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -117,7 +117,6 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_RGB5: rb->Format = MESA_FORMAT_RGB565; rb->DataType = GL_UNSIGNED_BYTE; - cpp = 2; break; case GL_RGB: case GL_RGB8: @@ -126,7 +125,6 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_RGB16: rb->Format = MESA_FORMAT_ARGB8888; /* XXX: Need xrgb8888 */ rb->DataType = GL_UNSIGNED_BYTE; - cpp = 4; break; case GL_RGBA: case GL_RGBA2: @@ -138,7 +136,6 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_RGBA16: rb->Format = MESA_FORMAT_ARGB8888; rb->DataType = GL_UNSIGNED_BYTE; - cpp = 4; break; case GL_STENCIL_INDEX: case GL_STENCIL_INDEX1_EXT: @@ -148,25 +145,21 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, /* alloc a depth+stencil buffer */ rb->Format = MESA_FORMAT_S8_Z24; rb->DataType = GL_UNSIGNED_INT_24_8_EXT; - cpp = 4; break; case GL_DEPTH_COMPONENT16: rb->Format = MESA_FORMAT_Z16; rb->DataType = GL_UNSIGNED_SHORT; - cpp = 2; break; case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT24: case GL_DEPTH_COMPONENT32: rb->Format = MESA_FORMAT_S8_Z24; rb->DataType = GL_UNSIGNED_INT_24_8_EXT; - cpp = 4; break; case GL_DEPTH_STENCIL_EXT: case GL_DEPTH24_STENCIL8_EXT: rb->Format = MESA_FORMAT_S8_Z24; rb->DataType = GL_UNSIGNED_INT_24_8_EXT; - cpp = 4; break; default: _mesa_problem(ctx, @@ -175,6 +168,7 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, } rb->_BaseFormat = _mesa_base_fbo_format(ctx, internalFormat); + cpp = _mesa_get_format_bytes(rb->Format); intelFlush(ctx); -- cgit v1.2.3 From 430876cd3a70d3b701d136b825518140888f96c8 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 8 Dec 2009 17:03:20 -0800 Subject: intel: name in intel_create_renderbuffer was always 0, remove --- src/mesa/drivers/dri/intel/intel_fbo.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 5a67cb1388..970ffb2e4d 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -278,7 +278,6 @@ intel_create_renderbuffer(gl_format format) GET_CURRENT_CONTEXT(ctx); struct intel_renderbuffer *irb; - const GLuint name = 0; irb = CALLOC_STRUCT(intel_renderbuffer); if (!irb) { @@ -286,7 +285,7 @@ intel_create_renderbuffer(gl_format format) return NULL; } - _mesa_init_renderbuffer(&irb->Base, name); + _mesa_init_renderbuffer(&irb->Base, 0); irb->Base.ClassID = INTEL_RB_CLASS; switch (format) { -- cgit v1.2.3 From ffc1f299e9eaa6eaa4b5586b9fb13132564bd3ae Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 8 Dec 2009 21:10:45 -0800 Subject: spantmp2: Add support for GL_BGR / GL_UNSIGNED_INT_8_8_8_8_REV This is really for MESA_FORMAT_XRGB8888. Clearly spantmp2.h needs some re-work. Any volunteers? --- src/mesa/drivers/dri/common/spantmp2.h | 57 ++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/common/spantmp2.h b/src/mesa/drivers/dri/common/spantmp2.h index 95f97414a9..447f3d15b9 100644 --- a/src/mesa/drivers/dri/common/spantmp2.h +++ b/src/mesa/drivers/dri/common/spantmp2.h @@ -356,6 +356,63 @@ } while (0) # endif +#elif (SPANTMP_PIXEL_FMT == GL_BGR) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV) + +/** + ** GL_BGR, GL_UNSIGNED_INT_8_8_8_8_REV + ** + ** This is really for MESA_FORMAT_XRGB8888. The spantmp code needs to be + ** kicked to the curb, and we need to just code-gen this. + **/ + +#ifndef GET_VALUE +#ifndef GET_PTR +#define GET_PTR(_x, _y) ( buf + (_x) * 4 + (_y) * pitch) +#endif + +#define GET_VALUE(_x, _y) *(volatile GLuint *)(GET_PTR(_x, _y)) +#define PUT_VALUE(_x, _y, _v) *(volatile GLuint *)(GET_PTR(_x, _y)) = (_v) +#endif /* GET_VALUE */ + +# define INIT_MONO_PIXEL(p, color) \ + p = PACK_COLOR_8888(0xff, color[0], color[1], color[2]) + +# define WRITE_RGBA(_x, _y, r, g, b, a) \ + PUT_VALUE(_x, _y, ((r << 16) | \ + (g << 8) | \ + (b << 0) | \ + (0xff << 24))) + +#define WRITE_PIXEL(_x, _y, p) PUT_VALUE(_x, _y, p) + +# if defined( USE_X86_ASM ) +# define READ_RGBA(rgba, _x, _y) \ + do { \ + GLuint p = GET_VALUE(_x, _y); \ + __asm__ __volatile__( "bswap %0; rorl $8, %0" \ + : "=r" (p) : "0" (p) ); \ + ((GLuint *)rgba)[0] = p | 0xff000000; \ + } while (0) +# elif defined( MESA_BIG_ENDIAN ) + /* On PowerPC with GCC 3.4.2 the shift madness below becomes a single + * rotlwi instruction. It also produces good code on SPARC. + */ +# define READ_RGBA( rgba, _x, _y ) \ + do { \ + GLuint p = GET_VALUE(_x, _y); \ + *((uint32_t *) rgba) = (t << 8) | 0xff; \ + } while (0) +# else +# define READ_RGBA( rgba, _x, _y ) \ + do { \ + GLuint p = GET_VALUE(_x, _y); \ + rgba[0] = (p >> 16) & 0xff; \ + rgba[1] = (p >> 8) & 0xff; \ + rgba[2] = (p >> 0) & 0xff; \ + rgba[3] = 0xff; \ + } while (0) +# endif + #else #error SPANTMP_PIXEL_FMT must be set to a valid value! #endif -- cgit v1.2.3 From 4f2b2032f46939b6056f837a086e73f0417183fc Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 8 Dec 2009 21:12:18 -0800 Subject: intel: Use spantmp2 GL_BGR / GL_UNSIGNED_INT_8_8_8_8_REV for XRGB8888 --- src/mesa/drivers/dri/intel/intel_span.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index f02fbe9875..725ba5c97d 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -334,7 +334,7 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb, #include "intel_spantmp.h" /* x8r8g8b8 color span and pixel functions */ -#define INTEL_PIXEL_FMT GL_BGRA +#define INTEL_PIXEL_FMT GL_BGR #define INTEL_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV #define INTEL_READ_VALUE(offset) pread_xrgb8888(irb, offset) #define INTEL_WRITE_VALUE(offset, v) pwrite_xrgb8888(irb, offset, v) -- cgit v1.2.3 From eadd9b8e16e3b1ad35fec54f780a0f94ac43988f Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 8 Dec 2009 21:13:05 -0800 Subject: i965: Fix handling of drawing to MESA_FORMAT_XRGB8888 It turns out that 965 and friends cannot actually render to an xRGB surfaces. Instead, the surface has to be RGBA with writes to alpha disabled and the blend function modified to always use 1.0 for destination alpha. --- src/mesa/drivers/dri/i965/brw_cc.c | 34 ++++++++++++++++++++++++ src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 17 +++++++++--- 2 files changed, 48 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i965/brw_cc.c b/src/mesa/drivers/dri/i965/brw_cc.c index d4ccd28c9e..ab301b9a3a 100644 --- a/src/mesa/drivers/dri/i965/brw_cc.c +++ b/src/mesa/drivers/dri/i965/brw_cc.c @@ -34,6 +34,7 @@ #include "brw_state.h" #include "brw_defines.h" #include "brw_util.h" +#include "intel_fbo.h" #include "main/macros.h" #include "main/enums.h" @@ -89,6 +90,28 @@ struct brw_cc_unit_key { GLenum depth_func; }; +/** + * Modify blend function to force destination alpha to 1.0 + * + * If \c function specifies a blend function that uses destination alpha, + * replace it with a function that hard-wires destination alpha to 1.0. This + * is used when rendering to xRGB targets. + */ +static GLenum +fix_xRGB_alpha(GLenum function) +{ + switch (function) { + case GL_DST_ALPHA: + return GL_ONE; + + case GL_ONE_MINUS_DST_ALPHA: + case GL_SRC_ALPHA_SATURATE: + return GL_ZERO; + } + + return function; +} + static void cc_unit_populate_key(struct brw_context *brw, struct brw_cc_unit_key *key) { @@ -132,6 +155,17 @@ cc_unit_populate_key(struct brw_context *brw, struct brw_cc_unit_key *key) key->blend_dst_rgb = ctx->Color.BlendDstRGB; key->blend_src_a = ctx->Color.BlendSrcA; key->blend_dst_a = ctx->Color.BlendDstA; + + /* If the renderbuffer is XRGB, we have to frob the blend function to + * force the destination alpha to 1.0. This means replacing GL_DST_ALPHA + * with GL_ONE and GL_ONE_MINUS_DST_ALPAH with GL_ZERO. + */ + if (ctx->Visual.alphaBits == 0) { + key->blend_src_rgb = fix_xRGB_alpha(key->blend_src_rgb); + key->blend_src_a = fix_xRGB_alpha(key->blend_src_a); + key->blend_dst_rgb = fix_xRGB_alpha(key->blend_dst_rgb); + key->blend_dst_a = fix_xRGB_alpha(key->blend_dst_a); + } } key->alpha_enabled = ctx->Color.AlphaEnabled; diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index b7b6eaec2b..74cf66f9f8 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -538,11 +538,15 @@ brw_update_renderbuffer_surface(struct brw_context *brw, key.surface_type = BRW_SURFACE_2D; switch (irb->Base.Format) { + /* XRGB and ARGB are treated the same here because the chips in this + * family cannot render to XRGB targets. This means that we have to + * mask writes to alpha (ala glColorMask) and reconfigure the alpha + * blending hardware to use GL_ONE (or GL_ZERO) for cases where + * GL_DST_ALPHA (or GL_ONE_MINUS_DST_ALPHA) is used. + */ case MESA_FORMAT_ARGB8888: - key.surface_format = BRW_SURFACEFORMAT_B8G8R8A8_UNORM; - break; case MESA_FORMAT_XRGB8888: - key.surface_format = BRW_SURFACEFORMAT_B8G8R8X8_UNORM; + key.surface_format = BRW_SURFACEFORMAT_B8G8R8A8_UNORM; break; case MESA_FORMAT_RGB565: key.surface_format = BRW_SURFACEFORMAT_B5G6R5_UNORM; @@ -579,6 +583,13 @@ brw_update_renderbuffer_surface(struct brw_context *brw, /* _NEW_COLOR */ memcpy(key.color_mask, ctx->Color.ColorMask, sizeof(key.color_mask)); + + /* As mentioned above, disable writes to the alpha component when the + * renderbuffer is XRGB. + */ + if (ctx->Visual.alphaBits == 0) + key.color_mask[3] = GL_FALSE; + key.color_blend = (!ctx->Color._LogicOpEnabled && ctx->Color.BlendEnabled); -- cgit v1.2.3 From cbdeb33209e782f011984a4b93cc0d36f567462e Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 8 Dec 2009 21:15:36 -0800 Subject: intel: Make RGB renderbuffers use XRGB8888 like we do for RGB system buffers. --- src/mesa/drivers/dri/intel/intel_fbo.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 970ffb2e4d..608f75b824 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -123,7 +123,7 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_RGB10: case GL_RGB12: case GL_RGB16: - rb->Format = MESA_FORMAT_ARGB8888; /* XXX: Need xrgb8888 */ + rb->Format = MESA_FORMAT_XRGB8888; rb->DataType = GL_UNSIGNED_BYTE; break; case GL_RGBA: @@ -294,10 +294,6 @@ intel_create_renderbuffer(gl_format format) irb->Base.DataType = GL_UNSIGNED_BYTE; break; case MESA_FORMAT_XRGB8888: - /* XXX this is a hack since XRGB surfaces don't seem to work - * properly yet. Reading the alpha channel returns 0 instead of 1. - */ - format = MESA_FORMAT_ARGB8888; irb->Base._BaseFormat = GL_RGB; irb->Base.DataType = GL_UNSIGNED_BYTE; break; -- cgit v1.2.3 From b4a6169412819cc3a027c6a118f0537911145a30 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 8 Dec 2009 23:24:58 -0800 Subject: intel: Make RGB textures use XRGB8888 --- src/mesa/drivers/dri/intel/intel_tex_format.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/intel/intel_tex_format.c b/src/mesa/drivers/dri/intel/intel_tex_format.c index bfa3dba1f5..87efb72cc5 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_format.c +++ b/src/mesa/drivers/dri/intel/intel_tex_format.c @@ -50,8 +50,7 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat, if (format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5) { return MESA_FORMAT_RGB565; } - /* XXX use MESA_FORMAT_XRGB8888 someday */ - return do32bpt ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_RGB565; + return do32bpt ? MESA_FORMAT_XRGB8888 : MESA_FORMAT_RGB565; case GL_RGBA8: case GL_RGB10_A2: @@ -70,8 +69,7 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat, case GL_RGB10: case GL_RGB12: case GL_RGB16: - /* XXX use MESA_FORMAT_XRGB8888 someday */ - return MESA_FORMAT_ARGB8888; + return MESA_FORMAT_XRGB8888; case GL_RGB5: case GL_RGB4: -- cgit v1.2.3 From e624b77eb2d594cde053c73a530836e05227126a Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 8 Dec 2009 23:25:26 -0800 Subject: intel: Remove ARGB internal_format == GL_RGB hacks Now that XRGB is supported, we don't need to hack around cases of an RGBA format buffer with an internal format of GL_RGB. --- src/mesa/drivers/dri/i915/i830_texstate.c | 5 +-- src/mesa/drivers/dri/i915/i915_texstate.c | 5 +-- src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 10 +---- src/mesa/drivers/dri/intel/intel_span.c | 49 +++++++----------------- 4 files changed, 17 insertions(+), 52 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i830_texstate.c b/src/mesa/drivers/dri/i915/i830_texstate.c index f4bbb53b86..ce409b3a60 100644 --- a/src/mesa/drivers/dri/i915/i830_texstate.c +++ b/src/mesa/drivers/dri/i915/i830_texstate.c @@ -55,10 +55,7 @@ translate_texture_format(GLuint mesa_format, GLuint internal_format) case MESA_FORMAT_ARGB4444: return MAPSURF_16BIT | MT_16BIT_ARGB4444; case MESA_FORMAT_ARGB8888: - if (internal_format == GL_RGB) - return MAPSURF_32BIT | MT_32BIT_XRGB8888; - else - return MAPSURF_32BIT | MT_32BIT_ARGB8888; + return MAPSURF_32BIT | MT_32BIT_ARGB8888; case MESA_FORMAT_XRGB8888: return MAPSURF_32BIT | MT_32BIT_XRGB8888; case MESA_FORMAT_YCBCR_REV: diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index d6689af53f..f52ff2bcc4 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -56,10 +56,7 @@ translate_texture_format(gl_format mesa_format, GLuint internal_format, case MESA_FORMAT_ARGB4444: return MAPSURF_16BIT | MT_16BIT_ARGB4444; case MESA_FORMAT_ARGB8888: - if (internal_format == GL_RGB) - return MAPSURF_32BIT | MT_32BIT_XRGB8888; - else - return MAPSURF_32BIT | MT_32BIT_ARGB8888; + return MAPSURF_32BIT | MT_32BIT_ARGB8888; case MESA_FORMAT_XRGB8888: return MAPSURF_32BIT | MT_32BIT_XRGB8888; case MESA_FORMAT_YCBCR_REV: diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index 74cf66f9f8..3f9b1fbfdc 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -94,20 +94,14 @@ static GLuint translate_tex_format( gl_format mesa_format, return BRW_SURFACEFORMAT_R8G8B8_UNORM; case MESA_FORMAT_ARGB8888: - if (internal_format == GL_RGB) - return BRW_SURFACEFORMAT_B8G8R8X8_UNORM; - else - return BRW_SURFACEFORMAT_B8G8R8A8_UNORM; + return BRW_SURFACEFORMAT_B8G8R8A8_UNORM; case MESA_FORMAT_XRGB8888: return BRW_SURFACEFORMAT_B8G8R8X8_UNORM; case MESA_FORMAT_RGBA8888_REV: _mesa_problem(NULL, "unexpected format in i965:translate_tex_format()"); - if (internal_format == GL_RGB) - return BRW_SURFACEFORMAT_R8G8B8X8_UNORM; - else - return BRW_SURFACEFORMAT_R8G8B8A8_UNORM; + return BRW_SURFACEFORMAT_R8G8B8A8_UNORM; case MESA_FORMAT_RGB565: return BRW_SURFACEFORMAT_B5G6R5_UNORM; diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index 725ba5c97d..34c3d9df74 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -638,13 +638,7 @@ intel_set_span_functions(struct intel_context *intel, intel_gttmap_InitPointers_xRGB8888(rb); break; case MESA_FORMAT_ARGB8888: - if (rb->_BaseFormat == GL_RGB) { - /* XXX remove this code someday when we enable XRGB surfaces */ - /* 8888 RGBx */ - intel_gttmap_InitPointers_xRGB8888(rb); - } else { - intel_gttmap_InitPointers_ARGB8888(rb); - } + intel_gttmap_InitPointers_ARGB8888(rb); break; case MESA_FORMAT_Z16: intel_gttmap_InitDepthPointers_z16(rb); @@ -731,35 +725,18 @@ intel_set_span_functions(struct intel_context *intel, } break; case MESA_FORMAT_ARGB8888: - if (rb->_BaseFormat == GL_RGB) { - /* XXX remove this code someday when we enable XRGB surfaces */ - /* 8888 RGBx */ - switch (tiling) { - case I915_TILING_NONE: - default: - intelInitPointers_xRGB8888(rb); - break; - case I915_TILING_X: - intel_XTile_InitPointers_xRGB8888(rb); - break; - case I915_TILING_Y: - intel_YTile_InitPointers_xRGB8888(rb); - break; - } - } else { - /* 8888 RGBA */ - switch (tiling) { - case I915_TILING_NONE: - default: - intelInitPointers_ARGB8888(rb); - break; - case I915_TILING_X: - intel_XTile_InitPointers_ARGB8888(rb); - break; - case I915_TILING_Y: - intel_YTile_InitPointers_ARGB8888(rb); - break; - } + /* 8888 RGBA */ + switch (tiling) { + case I915_TILING_NONE: + default: + intelInitPointers_ARGB8888(rb); + break; + case I915_TILING_X: + intel_XTile_InitPointers_ARGB8888(rb); + break; + case I915_TILING_Y: + intel_YTile_InitPointers_ARGB8888(rb); + break; } break; case MESA_FORMAT_Z16: -- cgit v1.2.3 From d38ffed5236adf3ee83c0bc5bdee0233ce566e01 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 10 Dec 2009 17:50:35 -0800 Subject: glsl: Increase size of array in_slang_lookup_constant from 4 to 16. For some cases, _mesa_GetIntegerv reads up to params[15]. --- src/mesa/shader/slang/slang_simplify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/slang/slang_simplify.c b/src/mesa/shader/slang/slang_simplify.c index 539c6ff0d1..13b9ca3c87 100644 --- a/src/mesa/shader/slang/slang_simplify.c +++ b/src/mesa/shader/slang/slang_simplify.c @@ -84,7 +84,7 @@ _slang_lookup_constant(const char *name) for (i = 0; info[i].Name; i++) { if (strcmp(info[i].Name, name) == 0) { /* found */ - GLint values[4]; + GLint values[16]; values[0] = -1; _mesa_GetIntegerv(info[i].Token, values); ASSERT(values[0] >= 0); /* sanity check that glGetFloatv worked */ -- cgit v1.2.3 From cb1dcb55f9884431a5e2b90e9208b42558a95611 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 10 Dec 2009 18:21:59 -0800 Subject: i915: Add missing break statement in i915_debug_packet. --- src/mesa/drivers/dri/i915/i915_debug.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/i915/i915_debug.c b/src/mesa/drivers/dri/i915/i915_debug.c index f7bb7ea44c..fecfac3033 100644 --- a/src/mesa/drivers/dri/i915/i915_debug.c +++ b/src/mesa/drivers/dri/i915/i915_debug.c @@ -806,6 +806,7 @@ static GLboolean i915_debug_packet( struct debug_stream *stream ) default: return debug(stream, "", 0); } + break; default: assert(0); return 0; -- cgit v1.2.3 From e31df54754e2305b7cc7072053bf5a4e0b477fd6 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 10 Dec 2009 18:32:33 -0800 Subject: mesa: Assign _mesa_lookup_parameter_index return value to GLint. --- src/mesa/shader/prog_parameter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index 2f029b02e5..f22492e029 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -500,7 +500,7 @@ GLfloat * _mesa_lookup_parameter_value(const struct gl_program_parameter_list *paramList, GLsizei nameLen, const char *name) { - GLuint i = _mesa_lookup_parameter_index(paramList, nameLen, name); + GLint i = _mesa_lookup_parameter_index(paramList, nameLen, name); if (i < 0) return NULL; else -- cgit v1.2.3 From 94fba49be97008565c0225bc46894bfd9453bb5e Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 10 Dec 2009 18:51:51 -0800 Subject: mesa: Initialize variable in MatchInstruction. --- src/mesa/shader/nvfragparse.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index 0fd55524ab..b739a6aa07 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -217,6 +217,12 @@ MatchInstruction(const GLubyte *token) const struct instruction_pattern *inst; struct instruction_pattern result; + result.name = NULL; + result.opcode = MAX_OPCODE; /* i.e. invalid instruction */ + result.inputs = 0; + result.outputs = 0; + result.suffixes = 0; + for (inst = Instructions; inst->name; inst++) { if (_mesa_strncmp((const char *) token, inst->name, 3) == 0) { /* matched! */ @@ -247,7 +253,7 @@ MatchInstruction(const GLubyte *token) return result; } } - result.opcode = MAX_OPCODE; /* i.e. invalid instruction */ + return result; } -- cgit v1.2.3 From f7f1211b9b0a8fa0e5f5427b74b4eee4dabf65af Mon Sep 17 00:00:00 2001 From: Aurelien Jarno Date: Fri, 11 Dec 2009 08:46:54 -0700 Subject: sparc: additional preprocessor test for SPARC 64-bit --- src/mesa/sparc/xform.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/sparc/xform.S b/src/mesa/sparc/xform.S index f2b9674bf2..2a7cce41e5 100644 --- a/src/mesa/sparc/xform.S +++ b/src/mesa/sparc/xform.S @@ -17,7 +17,7 @@ #include "sparc_matrix.h" -#if defined(SVR4) || defined(__SVR4) || defined(__svr4__) +#if defined(SVR4) || defined(__SVR4) || defined(__svr4__) || defined(__arch64__) /* Solaris requires this for 64-bit. */ .register %g2, #scratch .register %g3, #scratch -- cgit v1.2.3 From 5076a4f53a2f34cc9116b45951037f639885c7a1 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 11 Dec 2009 09:16:25 -0700 Subject: mesa: check dst reg in _mesa_find_free_register() If a register was only being used as a destination (as will happen when generated condition-codes) we missed its use. So we'd errantly return a register index that was really in-use, not free. Fixes bug 25579. --- src/mesa/shader/program.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index 2cd6eb8a38..18d4ef9759 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -813,9 +813,17 @@ _mesa_find_free_register(const struct gl_program *prog, GLuint regFile) const struct prog_instruction *inst = prog->Instructions + i; const GLuint n = _mesa_num_inst_src_regs(inst->Opcode); - for (k = 0; k < n; k++) { - if (inst->SrcReg[k].File == regFile) { - used[inst->SrcReg[k].Index] = GL_TRUE; + /* check dst reg first */ + if (inst->DstReg.File == regFile) { + used[inst->DstReg.Index] = GL_TRUE; + } + else { + /* check src regs otherwise */ + for (k = 0; k < n; k++) { + if (inst->SrcReg[k].File == regFile) { + used[inst->SrcReg[k].Index] = GL_TRUE; + break; + } } } } -- cgit v1.2.3 From d8f8eca9efaf2f537cf9218e4dd1d742e19ffc76 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 11 Dec 2009 09:40:33 -0700 Subject: mesa: remove unnecessary loop in _mesa_remove_output_reads() --- src/mesa/shader/programopt.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/shader/programopt.c b/src/mesa/shader/programopt.c index f70c75cec8..c5b821d94f 100644 --- a/src/mesa/shader/programopt.c +++ b/src/mesa/shader/programopt.c @@ -528,15 +528,11 @@ _mesa_remove_output_reads(struct gl_program *prog, gl_register_file type) /* look for instructions which write to the varying vars identified above */ for (i = 0; i < prog->NumInstructions; i++) { struct prog_instruction *inst = prog->Instructions + i; - const GLuint numSrc = _mesa_num_inst_src_regs(inst->Opcode); - GLuint j; - for (j = 0; j < numSrc; j++) { - if (inst->DstReg.File == type && - outputMap[inst->DstReg.Index] >= 0) { - /* change inst to write to the temp reg, instead of the varying */ - inst->DstReg.File = PROGRAM_TEMPORARY; - inst->DstReg.Index = outputMap[inst->DstReg.Index]; - } + if (inst->DstReg.File == type && + outputMap[inst->DstReg.Index] >= 0) { + /* change inst to write to the temp reg, instead of the varying */ + inst->DstReg.File = PROGRAM_TEMPORARY; + inst->DstReg.Index = outputMap[inst->DstReg.Index]; } } -- cgit v1.2.3 From e24a8de8ba3b0765852dbcc170f770572bd042ac Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 16 Nov 2009 12:43:32 -0700 Subject: mesa: updated comment --- src/mesa/main/dd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 27ed921761..fdcaf05bac 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -182,7 +182,7 @@ struct dd_function_table { * * This is called by the \c _mesa_store_tex[sub]image[123]d() fallback * functions. The driver should examine \p internalFormat and return a - * pointer to an appropriate gl_texture_format. + * gl_format value. */ GLuint (*ChooseTextureFormat)( GLcontext *ctx, GLint internalFormat, GLenum srcFormat, GLenum srcType ); -- cgit v1.2.3 From 56dce15dcc7b0a869813ef97a0e68b166bac244f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 16 Nov 2009 12:50:54 -0700 Subject: mesa: remove unused ctx->Driver.ActiveTexture() hook --- src/mesa/drivers/common/driverfuncs.c | 1 - src/mesa/drivers/dri/mach64/mach64_tex.c | 1 - src/mesa/main/dd.h | 5 ----- 3 files changed, 7 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index 4ca0e7bcc3..9b271f85e9 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -124,7 +124,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->UnmapTexture = NULL; driver->TextureMemCpy = _mesa_memcpy; driver->IsTextureResident = NULL; - driver->ActiveTexture = NULL; driver->UpdateTexturePalette = NULL; /* imaging */ diff --git a/src/mesa/drivers/dri/mach64/mach64_tex.c b/src/mesa/drivers/dri/mach64/mach64_tex.c index a757362b11..72917ee13b 100644 --- a/src/mesa/drivers/dri/mach64/mach64_tex.c +++ b/src/mesa/drivers/dri/mach64/mach64_tex.c @@ -565,7 +565,6 @@ void mach64InitTextureFuncs( struct dd_function_table *functions ) functions->IsTextureResident = driIsTextureResident; functions->UpdateTexturePalette = NULL; - functions->ActiveTexture = NULL; driInitTextureFormats(); } diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index fdcaf05bac..9a5145cd46 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -537,11 +537,6 @@ struct dd_function_table { GLboolean (*IsTextureResident)( GLcontext *ctx, struct gl_texture_object *t ); - /** - * Called by glActiveTextureARB() to set current texture unit. - */ - void (*ActiveTexture)( GLcontext *ctx, GLuint texUnitNumber ); - /** * Called when the texture's color lookup table is changed. * -- cgit v1.2.3 From 9c01cf425fac3853c65bd732270a015106766865 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 16 Nov 2009 12:54:39 -0700 Subject: mesa: minor reformatting/rewrapping in dd.h --- src/mesa/main/dd.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 9a5145cd46..6dadf5c079 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -761,13 +761,13 @@ struct dd_function_table { /* May return NULL if MESA_MAP_NOWAIT_BIT is set in access: */ - void * (*MapBufferRange)( GLcontext *ctx, GLenum target, - GLintptr offset, GLsizeiptr length, GLbitfield access, + void * (*MapBufferRange)( GLcontext *ctx, GLenum target, GLintptr offset, + GLsizeiptr length, GLbitfield access, struct gl_buffer_object *obj); - void (*FlushMappedBufferRange) (GLcontext *ctx, GLenum target, - GLintptr offset, GLsizeiptr length, - struct gl_buffer_object *obj); + void (*FlushMappedBufferRange)(GLcontext *ctx, GLenum target, + GLintptr offset, GLsizeiptr length, + struct gl_buffer_object *obj); GLboolean (*UnmapBuffer)( GLcontext *ctx, GLenum target, struct gl_buffer_object *obj ); @@ -782,7 +782,8 @@ struct dd_function_table { struct gl_framebuffer * (*NewFramebuffer)(GLcontext *ctx, GLuint name); struct gl_renderbuffer * (*NewRenderbuffer)(GLcontext *ctx, GLuint name); void (*BindFramebuffer)(GLcontext *ctx, GLenum target, - struct gl_framebuffer *fb, struct gl_framebuffer *fbread); + struct gl_framebuffer *drawFb, + struct gl_framebuffer *readFb); void (*FramebufferRenderbuffer)(GLcontext *ctx, struct gl_framebuffer *fb, GLenum attachment, -- cgit v1.2.3 From da73c1ed41c6d2867cca34ca1d481537ec3cb077 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 12 Dec 2009 00:00:34 +0100 Subject: r300: minor texture code refactoring --- src/mesa/drivers/dri/r300/r300_texstate.c | 191 ++++++++++++++++++------------ 1 file changed, 112 insertions(+), 79 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index 9eaf390b46..d80284e1b9 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -51,14 +51,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_tex.h" #include "r300_reg.h" -#define VALID_FORMAT(f) ( ((f) <= MESA_FORMAT_RGBA_DXT5 \ - || ((f) >= MESA_FORMAT_RGBA_FLOAT32 && \ - (f) <= MESA_FORMAT_INTENSITY_FLOAT16)) \ - && tx_table[f].flag ) - -#define _ASSIGN(entry, format) \ - [ MESA_FORMAT_ ## entry ] = { format, 0, 1} - /* * Note that the _REV formats are the same as the non-REV formats. This is * because the REV and non-REV formats are identical as a byte string, but @@ -68,67 +60,121 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * identically. -- paulus */ -static const struct tx_table { - GLuint format, filter, flag; -} tx_table[] = { - /* *INDENT-OFF* */ +static uint32_t translateTexFormat(gl_format mesaFormat) +{ + switch (mesaFormat) + { #ifdef MESA_LITTLE_ENDIAN - _ASSIGN(RGBA8888, R300_EASY_TX_FORMAT(Y, Z, W, X, W8Z8Y8X8)), - _ASSIGN(RGBA8888_REV, R300_EASY_TX_FORMAT(Z, Y, X, W, W8Z8Y8X8)), - _ASSIGN(ARGB8888, R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8)), - _ASSIGN(ARGB8888_REV, R300_EASY_TX_FORMAT(W, Z, Y, X, W8Z8Y8X8)), + case MESA_FORMAT_RGBA8888: + return R300_EASY_TX_FORMAT(Y, Z, W, X, W8Z8Y8X8); + case MESA_FORMAT_RGBA8888_REV: + return R300_EASY_TX_FORMAT(Z, Y, X, W, W8Z8Y8X8); + case MESA_FORMAT_ARGB8888: + return R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8); + case MESA_FORMAT_ARGB8888_REV: + return R300_EASY_TX_FORMAT(W, Z, Y, X, W8Z8Y8X8); #else - _ASSIGN(RGBA8888, R300_EASY_TX_FORMAT(Z, Y, X, W, W8Z8Y8X8)), - _ASSIGN(RGBA8888_REV, R300_EASY_TX_FORMAT(Y, Z, W, X, W8Z8Y8X8)), - _ASSIGN(ARGB8888, R300_EASY_TX_FORMAT(W, Z, Y, X, W8Z8Y8X8)), - _ASSIGN(ARGB8888_REV, R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8)), + case MESA_FORMAT_RGBA8888: + return R300_EASY_TX_FORMAT(Z, Y, X, W, W8Z8Y8X8); + case MESA_FORMAT_RGBA8888_REV: + return R300_EASY_TX_FORMAT(Y, Z, W, X, W8Z8Y8X8); + case MESA_FORMAT_ARGB8888: + return R300_EASY_TX_FORMAT(W, Z, Y, X, W8Z8Y8X8); + case MESA_FORMAT_ARGB8888_REV: + return R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8); #endif - _ASSIGN(XRGB8888, R300_EASY_TX_FORMAT(X, Y, Z, ONE, W8Z8Y8X8)), - _ASSIGN(RGB888, R300_EASY_TX_FORMAT(X, Y, Z, ONE, W8Z8Y8X8)), - _ASSIGN(RGB565, R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z5Y6X5)), - _ASSIGN(RGB565_REV, R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z5Y6X5)), - _ASSIGN(ARGB4444, R300_EASY_TX_FORMAT(X, Y, Z, W, W4Z4Y4X4)), - _ASSIGN(ARGB4444_REV, R300_EASY_TX_FORMAT(X, Y, Z, W, W4Z4Y4X4)), - _ASSIGN(ARGB1555, R300_EASY_TX_FORMAT(X, Y, Z, W, W1Z5Y5X5)), - _ASSIGN(ARGB1555_REV, R300_EASY_TX_FORMAT(X, Y, Z, W, W1Z5Y5X5)), - _ASSIGN(AL88, R300_EASY_TX_FORMAT(X, X, X, Y, Y8X8)), - _ASSIGN(AL88_REV, R300_EASY_TX_FORMAT(X, X, X, Y, Y8X8)), - _ASSIGN(RGB332, R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z3Y3X2)), - _ASSIGN(A8, R300_EASY_TX_FORMAT(ZERO, ZERO, ZERO, X, X8)), - _ASSIGN(L8, R300_EASY_TX_FORMAT(X, X, X, ONE, X8)), - _ASSIGN(I8, R300_EASY_TX_FORMAT(X, X, X, X, X8)), - _ASSIGN(CI8, R300_EASY_TX_FORMAT(X, X, X, X, X8)), - _ASSIGN(YCBCR, R300_EASY_TX_FORMAT(X, Y, Z, ONE, G8R8_G8B8) | R300_TX_FORMAT_YUV_MODE), - _ASSIGN(YCBCR_REV, R300_EASY_TX_FORMAT(X, Y, Z, ONE, G8R8_G8B8) | R300_TX_FORMAT_YUV_MODE), - _ASSIGN(RGB_DXT1, R300_EASY_TX_FORMAT(X, Y, Z, ONE, DXT1)), - _ASSIGN(RGBA_DXT1, R300_EASY_TX_FORMAT(X, Y, Z, W, DXT1)), - _ASSIGN(RGBA_DXT3, R300_EASY_TX_FORMAT(X, Y, Z, W, DXT3)), - _ASSIGN(RGBA_DXT5, R300_EASY_TX_FORMAT(Y, Z, W, X, DXT5)), - _ASSIGN(RGBA_FLOAT32, R300_EASY_TX_FORMAT(Z, Y, X, W, FL_R32G32B32A32)), - _ASSIGN(RGBA_FLOAT16, R300_EASY_TX_FORMAT(Z, Y, X, W, FL_R16G16B16A16)), - _ASSIGN(RGB_FLOAT32, 0xffffffff), - _ASSIGN(RGB_FLOAT16, 0xffffffff), - _ASSIGN(ALPHA_FLOAT32, R300_EASY_TX_FORMAT(ZERO, ZERO, ZERO, X, FL_I32)), - _ASSIGN(ALPHA_FLOAT16, R300_EASY_TX_FORMAT(ZERO, ZERO, ZERO, X, FL_I16)), - _ASSIGN(LUMINANCE_FLOAT32, R300_EASY_TX_FORMAT(X, X, X, ONE, FL_I32)), - _ASSIGN(LUMINANCE_FLOAT16, R300_EASY_TX_FORMAT(X, X, X, ONE, FL_I16)), - _ASSIGN(LUMINANCE_ALPHA_FLOAT32, R300_EASY_TX_FORMAT(X, X, X, Y, FL_I32A32)), - _ASSIGN(LUMINANCE_ALPHA_FLOAT16, R300_EASY_TX_FORMAT(X, X, X, Y, FL_I16A16)), - _ASSIGN(INTENSITY_FLOAT32, R300_EASY_TX_FORMAT(X, X, X, X, FL_I32)), - _ASSIGN(INTENSITY_FLOAT16, R300_EASY_TX_FORMAT(X, X, X, X, FL_I16)), - _ASSIGN(Z16, R300_EASY_TX_FORMAT(X, X, X, X, X16)), - _ASSIGN(Z24_S8, R300_EASY_TX_FORMAT(X, X, X, X, X24_Y8)), - _ASSIGN(S8_Z24, R300_EASY_TX_FORMAT(Y, Y, Y, Y, X24_Y8)), - _ASSIGN(Z32, R300_EASY_TX_FORMAT(X, X, X, X, X32)), - /* EXT_texture_sRGB */ - _ASSIGN(SRGBA8, R300_EASY_TX_FORMAT(Y, Z, W, X, W8Z8Y8X8) | R300_TX_FORMAT_GAMMA), - _ASSIGN(SLA8, R300_EASY_TX_FORMAT(X, X, X, Y, Y8X8) | R300_TX_FORMAT_GAMMA), - _ASSIGN(SL8, R300_EASY_TX_FORMAT(X, X, X, ONE, X8) | R300_TX_FORMAT_GAMMA), - /* *INDENT-ON* */ + case MESA_FORMAT_XRGB8888: + return R300_EASY_TX_FORMAT(X, Y, Z, ONE, W8Z8Y8X8); + case MESA_FORMAT_RGB888: + return R300_EASY_TX_FORMAT(X, Y, Z, ONE, W8Z8Y8X8); + case MESA_FORMAT_RGB565: + return R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z5Y6X5); + case MESA_FORMAT_RGB565_REV: + return R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z5Y6X5); + case MESA_FORMAT_ARGB4444: + return R300_EASY_TX_FORMAT(X, Y, Z, W, W4Z4Y4X4); + case MESA_FORMAT_ARGB4444_REV: + return R300_EASY_TX_FORMAT(X, Y, Z, W, W4Z4Y4X4); + case MESA_FORMAT_ARGB1555: + return R300_EASY_TX_FORMAT(X, Y, Z, W, W1Z5Y5X5); + case MESA_FORMAT_ARGB1555_REV: + return R300_EASY_TX_FORMAT(X, Y, Z, W, W1Z5Y5X5); + case MESA_FORMAT_AL88: + return R300_EASY_TX_FORMAT(X, X, X, Y, Y8X8); + case MESA_FORMAT_AL88_REV: + return R300_EASY_TX_FORMAT(X, X, X, Y, Y8X8); + case MESA_FORMAT_RGB332: + return R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z3Y3X2); + case MESA_FORMAT_A8: + return R300_EASY_TX_FORMAT(ZERO, ZERO, ZERO, X, X8); + case MESA_FORMAT_L8: + return R300_EASY_TX_FORMAT(X, X, X, ONE, X8); + case MESA_FORMAT_I8: + return R300_EASY_TX_FORMAT(X, X, X, X, X8); + case MESA_FORMAT_CI8: + return R300_EASY_TX_FORMAT(X, X, X, X, X8); + case MESA_FORMAT_YCBCR: + return R300_EASY_TX_FORMAT(X, Y, Z, ONE, G8R8_G8B8) | R300_TX_FORMAT_YUV_MODE; + case MESA_FORMAT_YCBCR_REV: + return R300_EASY_TX_FORMAT(X, Y, Z, ONE, G8R8_G8B8) | R300_TX_FORMAT_YUV_MODE; + case MESA_FORMAT_RGB_DXT1: + return R300_EASY_TX_FORMAT(X, Y, Z, ONE, DXT1); + case MESA_FORMAT_RGBA_DXT1: + return R300_EASY_TX_FORMAT(X, Y, Z, W, DXT1); + case MESA_FORMAT_RGBA_DXT3: + return R300_EASY_TX_FORMAT(X, Y, Z, W, DXT3); + case MESA_FORMAT_RGBA_DXT5: + return R300_EASY_TX_FORMAT(Y, Z, W, X, DXT5); + case MESA_FORMAT_RGBA_FLOAT32: + return R300_EASY_TX_FORMAT(Z, Y, X, W, FL_R32G32B32A32); + case MESA_FORMAT_RGBA_FLOAT16: + return R300_EASY_TX_FORMAT(Z, Y, X, W, FL_R16G16B16A16); + case MESA_FORMAT_ALPHA_FLOAT32: + return R300_EASY_TX_FORMAT(ZERO, ZERO, ZERO, X, FL_I32); + case MESA_FORMAT_ALPHA_FLOAT16: + return R300_EASY_TX_FORMAT(ZERO, ZERO, ZERO, X, FL_I16); + case MESA_FORMAT_LUMINANCE_FLOAT32: + return R300_EASY_TX_FORMAT(X, X, X, ONE, FL_I32); + case MESA_FORMAT_LUMINANCE_FLOAT16: + return R300_EASY_TX_FORMAT(X, X, X, ONE, FL_I16); + case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32: + return R300_EASY_TX_FORMAT(X, X, X, Y, FL_I32A32); + case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16: + return R300_EASY_TX_FORMAT(X, X, X, Y, FL_I16A16); + case MESA_FORMAT_INTENSITY_FLOAT32: + return R300_EASY_TX_FORMAT(X, X, X, X, FL_I32); + case MESA_FORMAT_INTENSITY_FLOAT16: + return R300_EASY_TX_FORMAT(X, X, X, X, FL_I16); + case MESA_FORMAT_Z16: + return R300_EASY_TX_FORMAT(X, X, X, X, X16); + case MESA_FORMAT_Z24_S8: + return R300_EASY_TX_FORMAT(X, X, X, X, X24_Y8); + case MESA_FORMAT_S8_Z24: + return R300_EASY_TX_FORMAT(Y, Y, Y, Y, X24_Y8); + case MESA_FORMAT_Z32: + return R300_EASY_TX_FORMAT(X, X, X, X, X32); + /* EXT_texture_sRGB */ + case MESA_FORMAT_SRGBA8: + return R300_EASY_TX_FORMAT(Y, Z, W, X, W8Z8Y8X8) | R300_TX_FORMAT_GAMMA; + case MESA_FORMAT_SLA8: + return R300_EASY_TX_FORMAT(X, X, X, Y, Y8X8) | R300_TX_FORMAT_GAMMA; + case MESA_FORMAT_SL8: + return R300_EASY_TX_FORMAT(X, X, X, ONE, X8) | R300_TX_FORMAT_GAMMA; + case MESA_FORMAT_SRGB_DXT1: + return R300_EASY_TX_FORMAT(X, Y, Z, ONE, DXT1) | R300_TX_FORMAT_GAMMA; + case MESA_FORMAT_SRGBA_DXT1: + return R300_EASY_TX_FORMAT(X, Y, Z, W, DXT1) | R300_TX_FORMAT_GAMMA; + case MESA_FORMAT_SRGBA_DXT3: + return R300_EASY_TX_FORMAT(X, Y, Z, W, DXT3) | R300_TX_FORMAT_GAMMA; + case MESA_FORMAT_SRGBA_DXT5: + return R300_EASY_TX_FORMAT(Y, Z, W, X, DXT5) | R300_TX_FORMAT_GAMMA; + default: + fprintf(stderr, "%s: Invalid format %s", __FUNCTION__, _mesa_get_format_name(mesaFormat)); + assert(0); + return 0; + } }; -#undef _ASSIGN - void r300SetDepthTexMode(struct gl_texture_object *tObj) { static const GLuint formats[3][3] = { @@ -205,19 +251,12 @@ static void setup_hardware_state(r300ContextPtr rmesa, radeonTexObj *t) const struct gl_texture_image *firstImage; firstImage = t->base.Image[0][t->minLod]; - if (!t->image_override - && VALID_FORMAT(firstImage->TexFormat)) { + if (!t->image_override) { if (firstImage->_BaseFormat == GL_DEPTH_COMPONENT) { r300SetDepthTexMode(&t->base); } else { - t->pp_txformat = tx_table[firstImage->TexFormat].format; + t->pp_txformat = translateTexFormat(firstImage->TexFormat); } - - t->pp_txfilter |= tx_table[firstImage->TexFormat].filter; - } else if (!t->image_override) { - _mesa_problem(NULL, "unexpected texture format in %s", - __FUNCTION__); - return; } if (t->image_override && t->bo) @@ -357,18 +396,15 @@ void r300SetTexOffset(__DRIcontext * pDRICtx, GLint texname, switch (depth) { case 32: t->pp_txformat = R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8); - t->pp_txfilter |= tx_table[2].filter; pitch_val /= 4; break; case 24: default: t->pp_txformat = R300_EASY_TX_FORMAT(X, Y, Z, ONE, W8Z8Y8X8); - t->pp_txfilter |= tx_table[4].filter; pitch_val /= 4; break; case 16: t->pp_txformat = R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z5Y6X5); - t->pp_txfilter |= tx_table[5].filter; pitch_val /= 2; break; } @@ -447,18 +483,15 @@ void r300SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo t->pp_txformat = R300_EASY_TX_FORMAT(X, Y, Z, ONE, W8Z8Y8X8); else t->pp_txformat = R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8); - t->pp_txfilter |= tx_table[2].filter; pitch_val /= 4; break; case 3: default: t->pp_txformat = R300_EASY_TX_FORMAT(X, Y, Z, ONE, W8Z8Y8X8); - t->pp_txfilter |= tx_table[4].filter; pitch_val /= 4; break; case 2: t->pp_txformat = R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z5Y6X5); - t->pp_txfilter |= tx_table[5].filter; pitch_val /= 2; break; } -- cgit v1.2.3 From 5ee270820ba8dc7bfc6be5812f02c66f4a76f705 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 7 Nov 2009 20:03:57 +0100 Subject: r300: use _mesa_meta_Clear for buffer clears --- src/mesa/drivers/dri/r300/Makefile | 1 - src/mesa/drivers/dri/r300/r300_cmdbuf.c | 1 - src/mesa/drivers/dri/r300/r300_context.c | 9 +- src/mesa/drivers/dri/r300/r300_emit.c | 1 - src/mesa/drivers/dri/r300/r300_ioctl.c | 782 ------------------------------ src/mesa/drivers/dri/r300/r300_ioctl.h | 44 -- src/mesa/drivers/dri/r300/r300_render.c | 1 - src/mesa/drivers/dri/r300/r300_state.c | 1 - src/mesa/drivers/dri/r300/r300_tex.c | 1 - src/mesa/drivers/dri/r300/r300_texstate.c | 1 - 10 files changed, 8 insertions(+), 834 deletions(-) delete mode 100644 src/mesa/drivers/dri/r300/r300_ioctl.c delete mode 100644 src/mesa/drivers/dri/r300/r300_ioctl.h (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/Makefile b/src/mesa/drivers/dri/r300/Makefile index cb0f715fa0..9fd0133fda 100644 --- a/src/mesa/drivers/dri/r300/Makefile +++ b/src/mesa/drivers/dri/r300/Makefile @@ -45,7 +45,6 @@ DRIVER_SOURCES = \ radeon_screen.c \ r300_context.c \ r300_draw.c \ - r300_ioctl.c \ r300_cmdbuf.c \ r300_state.c \ r300_render.c \ diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index ad8db6e68e..efeeb0646d 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -45,7 +45,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "radeon_drm.h" #include "r300_context.h" -#include "r300_ioctl.h" #include "r300_reg.h" #include "r300_cmdbuf.h" #include "r300_emit.h" diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 5f07b95634..67183c3c2a 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -55,13 +55,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "tnl/t_vp_build.h" #include "drivers/common/driverfuncs.h" +#include "drivers/common/meta.h" #include "r300_context.h" #include "radeon_context.h" #include "radeon_span.h" #include "r300_cmdbuf.h" #include "r300_state.h" -#include "r300_ioctl.h" #include "r300_tex.h" #include "r300_emit.h" #include "r300_swtcl.h" @@ -451,6 +451,13 @@ static void r300InitGLExtensions(GLcontext *ctx) } } +static void r300InitIoctlFuncs(struct dd_function_table *functions) +{ + functions->Clear = _mesa_meta_Clear; + functions->Finish = radeonFinish; + functions->Flush = radeonFlush; +} + /* Create the device specific rendering context. */ GLboolean r300CreateContext(const __GLcontextModes * glVisual, diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index 07e6223087..3759ca2bea 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -49,7 +49,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_context.h" #include "r300_state.h" #include "r300_emit.h" -#include "r300_ioctl.h" #include "r300_render.h" #include "r300_swtcl.h" diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c deleted file mode 100644 index 5cb04e2bb6..0000000000 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ /dev/null @@ -1,782 +0,0 @@ -/* -Copyright (C) The Weather Channel, Inc. 2002. -Copyright (C) 2004 Nicolai Haehnle. -All Rights Reserved. - -The Weather Channel (TM) funded Tungsten Graphics to develop the -initial release of the Radeon 8500 driver under the XFree86 license. -This notice must be preserved. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice (including the -next paragraph) shall be included in all copies or substantial -portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 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 - * - * \author Keith Whitwell - * - * \author Nicolai Haehnle - */ - -#include -#include - -#include "main/glheader.h" -#include "main/imports.h" -#include "main/macros.h" -#include "main/context.h" -#include "main/simple_list.h" -#include "swrast/swrast.h" - -#include "radeon_common.h" -#include "radeon_lock.h" -#include "r300_context.h" -#include "r300_ioctl.h" -#include "r300_cmdbuf.h" -#include "r300_state.h" -#include "r300_vertprog.h" -#include "radeon_reg.h" -#include "r300_emit.h" -#include "r300_context.h" - -#include "vblank.h" - -#define R200_3D_DRAW_IMMD_2 0xC0003500 - -#define CLEARBUFFER_COLOR 0x1 -#define CLEARBUFFER_DEPTH 0x2 -#define CLEARBUFFER_STENCIL 0x4 - -#if 1 - -/** - * Fragment program helper macros - */ - -/* Produce unshifted source selectors */ -#define FP_TMP(idx) (idx) -#define FP_CONST(idx) ((idx) | (1 << 5)) - -/* Produce source/dest selector dword */ -#define FP_SELC_MASK_NO 0 -#define FP_SELC_MASK_X 1 -#define FP_SELC_MASK_Y 2 -#define FP_SELC_MASK_XY 3 -#define FP_SELC_MASK_Z 4 -#define FP_SELC_MASK_XZ 5 -#define FP_SELC_MASK_YZ 6 -#define FP_SELC_MASK_XYZ 7 - -#define FP_SELC(destidx,regmask,outmask,src0,src1,src2) \ - (((destidx) << R300_ALU_DSTC_SHIFT) | \ - (FP_SELC_MASK_##regmask << 23) | \ - (FP_SELC_MASK_##outmask << 26) | \ - ((src0) << R300_ALU_SRC0C_SHIFT) | \ - ((src1) << R300_ALU_SRC1C_SHIFT) | \ - ((src2) << R300_ALU_SRC2C_SHIFT)) - -#define FP_SELA_MASK_NO 0 -#define FP_SELA_MASK_W 1 - -#define FP_SELA(destidx,regmask,outmask,src0,src1,src2) \ - (((destidx) << R300_ALU_DSTA_SHIFT) | \ - (FP_SELA_MASK_##regmask << 23) | \ - (FP_SELA_MASK_##outmask << 24) | \ - ((src0) << R300_ALU_SRC0A_SHIFT) | \ - ((src1) << R300_ALU_SRC1A_SHIFT) | \ - ((src2) << R300_ALU_SRC2A_SHIFT)) - -/* Produce unshifted argument selectors */ -#define FP_ARGC(source) R300_ALU_ARGC_##source -#define FP_ARGA(source) R300_ALU_ARGA_##source -#define FP_ABS(arg) ((arg) | (1 << 6)) -#define FP_NEG(arg) ((arg) ^ (1 << 5)) - -/* Produce instruction dword */ -#define FP_INSTRC(opcode,arg0,arg1,arg2) \ - (R300_ALU_OUTC_##opcode | \ - ((arg0) << R300_ALU_ARG0C_SHIFT) | \ - ((arg1) << R300_ALU_ARG1C_SHIFT) | \ - ((arg2) << R300_ALU_ARG2C_SHIFT)) - -#define FP_INSTRA(opcode,arg0,arg1,arg2) \ - (R300_ALU_OUTA_##opcode | \ - ((arg0) << R300_ALU_ARG0A_SHIFT) | \ - ((arg1) << R300_ALU_ARG1A_SHIFT) | \ - ((arg2) << R300_ALU_ARG2A_SHIFT)) - -#endif - -static void r300EmitClearState(GLcontext * ctx); - -static void r300ClearBuffer(r300ContextPtr r300, int flags, - struct radeon_renderbuffer *rrb, - struct radeon_renderbuffer *rrbd) -{ - BATCH_LOCALS(&r300->radeon); - GLcontext *ctx = r300->radeon.glCtx; - __DRIdrawablePrivate *dPriv = radeon_get_drawable(&r300->radeon); - GLuint cbpitch = 0; - r300ContextPtr rmesa = r300; - - if (RADEON_DEBUG & RADEON_IOCTL) - fprintf(stderr, "%s: buffer %p (%i,%i %ix%i)\n", - __FUNCTION__, rrb, dPriv->x, dPriv->y, - dPriv->w, dPriv->h); - - if (rrb) { - cbpitch = (rrb->pitch / rrb->cpp); - if (rrb->cpp == 4) - cbpitch |= R300_COLOR_FORMAT_ARGB8888; - else - cbpitch |= R300_COLOR_FORMAT_RGB565; - - if (rrb->bo->flags & RADEON_BO_FLAGS_MACRO_TILE){ - cbpitch |= R300_COLOR_TILE_ENABLE; - } - } - - /* TODO in bufmgr */ - cp_wait(&r300->radeon, R300_WAIT_3D | R300_WAIT_3D_CLEAN); - end_3d(&rmesa->radeon); - - if (flags & CLEARBUFFER_COLOR) { - assert(rrb != 0); - BEGIN_BATCH_NO_AUTOSTATE(6); - OUT_BATCH_REGSEQ(R300_RB3D_COLOROFFSET0, 1); - OUT_BATCH_RELOC(0, rrb->bo, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); - OUT_BATCH_REGVAL(R300_RB3D_COLORPITCH0, cbpitch); - END_BATCH(); - } -#if 1 - if (flags & (CLEARBUFFER_DEPTH | CLEARBUFFER_STENCIL)) { - uint32_t zbpitch = (rrbd->pitch / rrbd->cpp); - if (rrbd->bo->flags & RADEON_BO_FLAGS_MACRO_TILE){ - zbpitch |= R300_DEPTHMACROTILE_ENABLE; - } - if (rrbd->bo->flags & RADEON_BO_FLAGS_MICRO_TILE){ - zbpitch |= R300_DEPTHMICROTILE_TILED; - } - BEGIN_BATCH_NO_AUTOSTATE(6); - OUT_BATCH_REGSEQ(R300_ZB_DEPTHOFFSET, 1); - OUT_BATCH_RELOC(0, rrbd->bo, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); - OUT_BATCH_REGSEQ(R300_ZB_DEPTHPITCH, 1); - if (!r300->radeon.radeonScreen->kernel_mm) - OUT_BATCH(zbpitch); - else - OUT_BATCH_RELOC(zbpitch, rrbd->bo, zbpitch, 0, RADEON_GEM_DOMAIN_VRAM, 0); - END_BATCH(); - } -#endif - BEGIN_BATCH_NO_AUTOSTATE(6); - OUT_BATCH_REGSEQ(RB3D_COLOR_CHANNEL_MASK, 1); - if (flags & CLEARBUFFER_COLOR) { - OUT_BATCH((ctx->Color.ColorMask[BCOMP] ? RB3D_COLOR_CHANNEL_MASK_BLUE_MASK0 : 0) | - (ctx->Color.ColorMask[GCOMP] ? RB3D_COLOR_CHANNEL_MASK_GREEN_MASK0 : 0) | - (ctx->Color.ColorMask[RCOMP] ? RB3D_COLOR_CHANNEL_MASK_RED_MASK0 : 0) | - (ctx->Color.ColorMask[ACOMP] ? RB3D_COLOR_CHANNEL_MASK_ALPHA_MASK0 : 0)); - } else { - OUT_BATCH(0); - } - - - { - uint32_t t1, t2; - - t1 = 0x0; - t2 = 0x0; - - if (flags & CLEARBUFFER_DEPTH) { - t1 |= R300_Z_ENABLE | R300_Z_WRITE_ENABLE; - t2 |= - (R300_ZS_ALWAYS << R300_Z_FUNC_SHIFT); - } - - if (flags & CLEARBUFFER_STENCIL) { - t1 |= R300_STENCIL_ENABLE; - t2 |= - (R300_ZS_ALWAYS << - R300_S_FRONT_FUNC_SHIFT) | - (R300_ZS_REPLACE << - R300_S_FRONT_SFAIL_OP_SHIFT) | - (R300_ZS_REPLACE << - R300_S_FRONT_ZPASS_OP_SHIFT) | - (R300_ZS_REPLACE << - R300_S_FRONT_ZFAIL_OP_SHIFT); - } - - OUT_BATCH_REGSEQ(R300_ZB_CNTL, 3); - OUT_BATCH(t1); - OUT_BATCH(t2); - OUT_BATCH(((ctx->Stencil.WriteMask[0] & R300_STENCILREF_MASK) << - R300_STENCILWRITEMASK_SHIFT) | - (ctx->Stencil.Clear & R300_STENCILREF_MASK)); - END_BATCH(); - } - - if (!rmesa->radeon.radeonScreen->kernel_mm) { - BEGIN_BATCH_NO_AUTOSTATE(9); - OUT_BATCH(cmdpacket3(r300->radeon.radeonScreen, R300_CMD_PACKET3_CLEAR)); - OUT_BATCH_FLOAT32(dPriv->w / 2.0); - OUT_BATCH_FLOAT32(dPriv->h / 2.0); - OUT_BATCH_FLOAT32(ctx->Depth.Clear); - OUT_BATCH_FLOAT32(1.0); - OUT_BATCH_FLOAT32(ctx->Color.ClearColor[0]); - OUT_BATCH_FLOAT32(ctx->Color.ClearColor[1]); - OUT_BATCH_FLOAT32(ctx->Color.ClearColor[2]); - OUT_BATCH_FLOAT32(ctx->Color.ClearColor[3]); - END_BATCH(); - } else { - OUT_BATCH(CP_PACKET3(R200_3D_DRAW_IMMD_2, 8)); - OUT_BATCH(R300_PRIM_TYPE_POINT | R300_PRIM_WALK_RING | - (1 << R300_PRIM_NUM_VERTICES_SHIFT)); - OUT_BATCH_FLOAT32(dPriv->w / 2.0); - OUT_BATCH_FLOAT32(dPriv->h / 2.0); - OUT_BATCH_FLOAT32(ctx->Depth.Clear); - OUT_BATCH_FLOAT32(1.0); - OUT_BATCH_FLOAT32(ctx->Color.ClearColor[0]); - OUT_BATCH_FLOAT32(ctx->Color.ClearColor[1]); - OUT_BATCH_FLOAT32(ctx->Color.ClearColor[2]); - OUT_BATCH_FLOAT32(ctx->Color.ClearColor[3]); - } - - r300EmitCacheFlush(rmesa); - cp_wait(&r300->radeon, R300_WAIT_3D | R300_WAIT_3D_CLEAN); - - R300_STATECHANGE(r300, cb); - R300_STATECHANGE(r300, cmk); - R300_STATECHANGE(r300, zs); -} - -static void r300EmitClearState(GLcontext * ctx) -{ - r300ContextPtr r300 = R300_CONTEXT(ctx); - BATCH_LOCALS(&r300->radeon); - __DRIdrawablePrivate *dPriv = radeon_get_drawable(&r300->radeon); - int i; - int has_tcl; - int is_r500 = 0; - GLuint vap_cntl; - - has_tcl = r300->options.hw_tcl_enabled; - - if (r300->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) - is_r500 = 1; - - /* State atom dirty tracking is a little subtle here. - * - * On the one hand, we need to make sure base state is emitted - * here if we start with an empty batch buffer, otherwise clear - * works incorrectly with multiple processes. Therefore, the first - * BEGIN_BATCH cannot be a BEGIN_BATCH_NO_AUTOSTATE. - * - * On the other hand, implicit state emission clears the state atom - * dirty bits, so we have to call R300_STATECHANGE later than the - * first BEGIN_BATCH. - * - * The final trickiness is that, because we change state, we need - * to ensure that any stored swtcl primitives are flushed properly - * before we start changing state. See the R300_NEWPRIM in r300Clear - * for this. - */ - BEGIN_BATCH(31); - OUT_BATCH_REGSEQ(R300_VAP_PROG_STREAM_CNTL_0, 1); - if (!has_tcl) - OUT_BATCH(((((0 << R300_DST_VEC_LOC_SHIFT) | R300_DATA_TYPE_FLOAT_4) << R300_DATA_TYPE_0_SHIFT) | - ((R300_LAST_VEC | (2 << R300_DST_VEC_LOC_SHIFT) | R300_DATA_TYPE_FLOAT_4) << R300_DATA_TYPE_1_SHIFT))); - else - OUT_BATCH(((((0 << R300_DST_VEC_LOC_SHIFT) | R300_DATA_TYPE_FLOAT_4) << R300_DATA_TYPE_0_SHIFT) | - ((R300_LAST_VEC | (1 << R300_DST_VEC_LOC_SHIFT) | R300_DATA_TYPE_FLOAT_4) << R300_DATA_TYPE_1_SHIFT))); - - OUT_BATCH_REGVAL(R300_FG_FOG_BLEND, 0); - OUT_BATCH_REGVAL(R300_VAP_PROG_STREAM_CNTL_EXT_0, - ((((R300_SWIZZLE_SELECT_X << R300_SWIZZLE_SELECT_X_SHIFT) | - (R300_SWIZZLE_SELECT_Y << R300_SWIZZLE_SELECT_Y_SHIFT) | - (R300_SWIZZLE_SELECT_Z << R300_SWIZZLE_SELECT_Z_SHIFT) | - (R300_SWIZZLE_SELECT_W << R300_SWIZZLE_SELECT_W_SHIFT) | - ((R300_WRITE_ENA_X | R300_WRITE_ENA_Y | R300_WRITE_ENA_Z | R300_WRITE_ENA_W) << R300_WRITE_ENA_SHIFT)) - << R300_SWIZZLE0_SHIFT) | - (((R300_SWIZZLE_SELECT_X << R300_SWIZZLE_SELECT_X_SHIFT) | - (R300_SWIZZLE_SELECT_Y << R300_SWIZZLE_SELECT_Y_SHIFT) | - (R300_SWIZZLE_SELECT_Z << R300_SWIZZLE_SELECT_Z_SHIFT) | - (R300_SWIZZLE_SELECT_W << R300_SWIZZLE_SELECT_W_SHIFT) | - ((R300_WRITE_ENA_X | R300_WRITE_ENA_Y | R300_WRITE_ENA_Z | R300_WRITE_ENA_W) << R300_WRITE_ENA_SHIFT)) - << R300_SWIZZLE1_SHIFT))); - - /* R300_VAP_INPUT_CNTL_0, R300_VAP_INPUT_CNTL_1 */ - OUT_BATCH_REGSEQ(R300_VAP_VTX_STATE_CNTL, 2); - OUT_BATCH((R300_SEL_USER_COLOR_0 << R300_COLOR_0_ASSEMBLY_SHIFT)); - OUT_BATCH(R300_INPUT_CNTL_POS | R300_INPUT_CNTL_COLOR | R300_INPUT_CNTL_TC0); - - /* comes from fglrx startup of clear */ - OUT_BATCH_REGSEQ(R300_SE_VTE_CNTL, 2); - OUT_BATCH(R300_VTX_W0_FMT | R300_VPORT_X_SCALE_ENA | - R300_VPORT_X_OFFSET_ENA | R300_VPORT_Y_SCALE_ENA | - R300_VPORT_Y_OFFSET_ENA | R300_VPORT_Z_SCALE_ENA | - R300_VPORT_Z_OFFSET_ENA); - OUT_BATCH(0x8); - - OUT_BATCH_REGVAL(R300_VAP_PSC_SGN_NORM_CNTL, 0xaaaaaaaa); - - OUT_BATCH_REGSEQ(R300_VAP_OUTPUT_VTX_FMT_0, 2); - OUT_BATCH(R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT | - R300_VAP_OUTPUT_VTX_FMT_0__COLOR_0_PRESENT); - OUT_BATCH(0); /* no textures */ - - OUT_BATCH_REGVAL(R300_TX_ENABLE, 0); - - OUT_BATCH_REGSEQ(R300_SE_VPORT_XSCALE, 6); - OUT_BATCH_FLOAT32(1.0); - OUT_BATCH_FLOAT32(dPriv->x); - OUT_BATCH_FLOAT32(1.0); - OUT_BATCH_FLOAT32(dPriv->y); - OUT_BATCH_FLOAT32(1.0); - OUT_BATCH_FLOAT32(0.0); - - OUT_BATCH_REGVAL(R300_FG_ALPHA_FUNC, 0); - - OUT_BATCH_REGSEQ(R300_RB3D_CBLEND, 2); - OUT_BATCH(0x0); - OUT_BATCH(0x0); - END_BATCH(); - - R300_STATECHANGE(r300, vir[0]); - R300_STATECHANGE(r300, fogs); - R300_STATECHANGE(r300, vir[1]); - R300_STATECHANGE(r300, vic); - R300_STATECHANGE(r300, vte); - R300_STATECHANGE(r300, vof); - R300_STATECHANGE(r300, txe); - R300_STATECHANGE(r300, vpt); - R300_STATECHANGE(r300, at); - R300_STATECHANGE(r300, bld); - R300_STATECHANGE(r300, ps); - - if (has_tcl) { - R300_STATECHANGE(r300, vap_clip_cntl); - - BEGIN_BATCH_NO_AUTOSTATE(2); - OUT_BATCH_REGVAL(R300_VAP_CLIP_CNTL, R300_PS_UCP_MODE_CLIP_AS_TRIFAN | R300_CLIP_DISABLE); - END_BATCH(); - } - - BEGIN_BATCH_NO_AUTOSTATE(2); - OUT_BATCH_REGVAL(R300_GA_POINT_SIZE, - ((dPriv->w * 6) << R300_POINTSIZE_X_SHIFT) | - ((dPriv->h * 6) << R300_POINTSIZE_Y_SHIFT)); - END_BATCH(); - - if (!is_r500) { - R300_STATECHANGE(r300, ri); - R300_STATECHANGE(r300, rc); - R300_STATECHANGE(r300, rr); - - BEGIN_BATCH(14); - OUT_BATCH_REGSEQ(R300_RS_IP_0, 8); - for (i = 0; i < 8; ++i) - OUT_BATCH(R300_RS_SEL_T(1) | R300_RS_SEL_R(2) | R300_RS_SEL_Q(3)); - - OUT_BATCH_REGSEQ(R300_RS_COUNT, 2); - OUT_BATCH((1 << R300_IC_COUNT_SHIFT) | R300_HIRES_EN); - OUT_BATCH(0x0); - - OUT_BATCH_REGVAL(R300_RS_INST_0, R300_RS_INST_COL_CN_WRITE); - END_BATCH(); - } else { - R300_STATECHANGE(r300, ri); - R300_STATECHANGE(r300, rc); - R300_STATECHANGE(r300, rr); - - BEGIN_BATCH(14); - OUT_BATCH_REGSEQ(R500_RS_IP_0, 8); - for (i = 0; i < 8; ++i) { - OUT_BATCH((R500_RS_IP_PTR_K0 << R500_RS_IP_TEX_PTR_S_SHIFT) | - (R500_RS_IP_PTR_K0 << R500_RS_IP_TEX_PTR_T_SHIFT) | - (R500_RS_IP_PTR_K0 << R500_RS_IP_TEX_PTR_R_SHIFT) | - (R500_RS_IP_PTR_K1 << R500_RS_IP_TEX_PTR_Q_SHIFT)); - } - - OUT_BATCH_REGSEQ(R300_RS_COUNT, 2); - OUT_BATCH((1 << R300_IC_COUNT_SHIFT) | R300_HIRES_EN); - OUT_BATCH(0x0); - - OUT_BATCH_REGVAL(R500_RS_INST_0, R500_RS_INST_COL_CN_WRITE); - END_BATCH(); - } - - if (!is_r500) { - R300_STATECHANGE(r300, fp); - R300_STATECHANGE(r300, fpi[0]); - R300_STATECHANGE(r300, fpi[1]); - R300_STATECHANGE(r300, fpi[2]); - R300_STATECHANGE(r300, fpi[3]); - - BEGIN_BATCH(17); - OUT_BATCH_REGSEQ(R300_US_CONFIG, 3); - OUT_BATCH(0x0); - OUT_BATCH(0x0); - OUT_BATCH(0x0); - OUT_BATCH_REGSEQ(R300_US_CODE_ADDR_0, 4); - OUT_BATCH(0x0); - OUT_BATCH(0x0); - OUT_BATCH(0x0); - OUT_BATCH(R300_RGBA_OUT); - - OUT_BATCH_REGVAL(R300_US_ALU_RGB_INST_0, - FP_INSTRC(MAD, FP_ARGC(SRC0C_XYZ), FP_ARGC(ONE), FP_ARGC(ZERO))); - OUT_BATCH_REGVAL(R300_US_ALU_RGB_ADDR_0, - FP_SELC(0, NO, XYZ, FP_TMP(0), 0, 0)); - OUT_BATCH_REGVAL(R300_US_ALU_ALPHA_INST_0, - FP_INSTRA(MAD, FP_ARGA(SRC0A), FP_ARGA(ONE), FP_ARGA(ZERO))); - OUT_BATCH_REGVAL(R300_US_ALU_ALPHA_ADDR_0, - FP_SELA(0, NO, W, FP_TMP(0), 0, 0)); - END_BATCH(); - } else { - struct radeon_state_atom r500fp; - uint32_t _cmd[10]; - - R300_STATECHANGE(r300, fp); - R300_STATECHANGE(r300, r500fp); - - BEGIN_BATCH(7); - OUT_BATCH_REGSEQ(R500_US_CONFIG, 2); - OUT_BATCH(R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO); - OUT_BATCH(0x0); - OUT_BATCH_REGSEQ(R500_US_CODE_ADDR, 3); - OUT_BATCH(R500_US_CODE_START_ADDR(0) | R500_US_CODE_END_ADDR(1)); - OUT_BATCH(R500_US_CODE_RANGE_ADDR(0) | R500_US_CODE_RANGE_SIZE(1)); - OUT_BATCH(R500_US_CODE_OFFSET_ADDR(0)); - END_BATCH(); - - r500fp.check = check_r500fp; - r500fp.cmd = _cmd; - r500fp.cmd[0] = cmdr500fp(r300->radeon.radeonScreen, 0, 1, 0, 0); - r500fp.cmd[1] = R500_INST_TYPE_OUT | - R500_INST_TEX_SEM_WAIT | - R500_INST_LAST | - R500_INST_RGB_OMASK_R | - R500_INST_RGB_OMASK_G | - R500_INST_RGB_OMASK_B | - R500_INST_ALPHA_OMASK | - R500_INST_RGB_CLAMP | - R500_INST_ALPHA_CLAMP; - r500fp.cmd[2] = R500_RGB_ADDR0(0) | - R500_RGB_ADDR1(0) | - R500_RGB_ADDR1_CONST | - R500_RGB_ADDR2(0) | - R500_RGB_ADDR2_CONST; - r500fp.cmd[3] = R500_ALPHA_ADDR0(0) | - R500_ALPHA_ADDR1(0) | - R500_ALPHA_ADDR1_CONST | - R500_ALPHA_ADDR2(0) | - R500_ALPHA_ADDR2_CONST; - r500fp.cmd[4] = R500_ALU_RGB_SEL_A_SRC0 | - R500_ALU_RGB_R_SWIZ_A_R | - R500_ALU_RGB_G_SWIZ_A_G | - R500_ALU_RGB_B_SWIZ_A_B | - R500_ALU_RGB_SEL_B_SRC0 | - R500_ALU_RGB_R_SWIZ_B_R | - R500_ALU_RGB_B_SWIZ_B_G | - R500_ALU_RGB_G_SWIZ_B_B; - r500fp.cmd[5] = R500_ALPHA_OP_CMP | - R500_ALPHA_SWIZ_A_A | - R500_ALPHA_SWIZ_B_A; - r500fp.cmd[6] = R500_ALU_RGBA_OP_CMP | - R500_ALU_RGBA_R_SWIZ_0 | - R500_ALU_RGBA_G_SWIZ_0 | - R500_ALU_RGBA_B_SWIZ_0 | - R500_ALU_RGBA_A_SWIZ_0; - - r500fp.cmd[7] = 0; - if (r300->radeon.radeonScreen->kernel_mm) { - emit_r500fp(ctx, &r500fp); - } else { - int dwords = r500fp.check(ctx,&r500fp); - BEGIN_BATCH_NO_AUTOSTATE(dwords); - OUT_BATCH_TABLE(r500fp.cmd, dwords); - END_BATCH(); - } - - } - - BEGIN_BATCH(2); - OUT_BATCH_REGVAL(R300_VAP_PVS_STATE_FLUSH_REG, 0); - END_BATCH(); - - if (has_tcl) { - vap_cntl = ((10 << R300_PVS_NUM_SLOTS_SHIFT) | - (5 << R300_PVS_NUM_CNTLRS_SHIFT) | - (12 << R300_VF_MAX_VTX_NUM_SHIFT)); - if (r300->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) - vap_cntl |= R500_TCL_STATE_OPTIMIZATION; - } else { - vap_cntl = ((10 << R300_PVS_NUM_SLOTS_SHIFT) | - (5 << R300_PVS_NUM_CNTLRS_SHIFT) | - (5 << R300_VF_MAX_VTX_NUM_SHIFT)); - } - - if (r300->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV515) - vap_cntl |= (2 << R300_PVS_NUM_FPUS_SHIFT); - else if ((r300->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV530) || - (r300->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV560) || - (r300->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV570)) - vap_cntl |= (5 << R300_PVS_NUM_FPUS_SHIFT); - else if ((r300->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV410) || - (r300->radeon.radeonScreen->chip_family == CHIP_FAMILY_R420)) - vap_cntl |= (6 << R300_PVS_NUM_FPUS_SHIFT); - else if ((r300->radeon.radeonScreen->chip_family == CHIP_FAMILY_R520) || - (r300->radeon.radeonScreen->chip_family == CHIP_FAMILY_R580)) - vap_cntl |= (8 << R300_PVS_NUM_FPUS_SHIFT); - else - vap_cntl |= (4 << R300_PVS_NUM_FPUS_SHIFT); - - R300_STATECHANGE(r300, vap_cntl); - - BEGIN_BATCH(2); - OUT_BATCH_REGVAL(R300_VAP_CNTL, vap_cntl); - END_BATCH(); - - if (has_tcl) { - struct radeon_state_atom vpu; - uint32_t _cmd[10]; - R300_STATECHANGE(r300, pvs); - R300_STATECHANGE(r300, vap_flush); - R300_STATECHANGE(r300, vpi); - - BEGIN_BATCH(4); - OUT_BATCH_REGSEQ(R300_VAP_PVS_CODE_CNTL_0, 3); - OUT_BATCH((0 << R300_PVS_FIRST_INST_SHIFT) | - (0 << R300_PVS_XYZW_VALID_INST_SHIFT) | - (1 << R300_PVS_LAST_INST_SHIFT)); - OUT_BATCH((0 << R300_PVS_CONST_BASE_OFFSET_SHIFT) | - (0 << R300_PVS_MAX_CONST_ADDR_SHIFT)); - OUT_BATCH(1 << R300_PVS_LAST_VTX_SRC_INST_SHIFT); - END_BATCH(); - - vpu.check = check_vpu; - vpu.cmd = _cmd; - vpu.cmd[0] = cmdvpu(r300->radeon.radeonScreen, 0, 2); - - vpu.cmd[1] = PVS_OP_DST_OPERAND(VE_ADD, GL_FALSE, GL_FALSE, - 0, 0xf, PVS_DST_REG_OUT); - vpu.cmd[2] = PVS_SRC_OPERAND(0, PVS_SRC_SELECT_X, PVS_SRC_SELECT_Y, - PVS_SRC_SELECT_Z, PVS_SRC_SELECT_W, - PVS_SRC_REG_INPUT, NEGATE_NONE); - vpu.cmd[3] = PVS_SRC_OPERAND(0, PVS_SRC_SELECT_FORCE_0, - PVS_SRC_SELECT_FORCE_0, - PVS_SRC_SELECT_FORCE_0, - PVS_SRC_SELECT_FORCE_0, - PVS_SRC_REG_INPUT, NEGATE_NONE); - vpu.cmd[4] = 0x0; - - vpu.cmd[5] = PVS_OP_DST_OPERAND(VE_ADD, GL_FALSE, GL_FALSE, 1, 0xf, - PVS_DST_REG_OUT); - vpu.cmd[6] = PVS_SRC_OPERAND(1, PVS_SRC_SELECT_X, - PVS_SRC_SELECT_Y, PVS_SRC_SELECT_Z, - PVS_SRC_SELECT_W, PVS_SRC_REG_INPUT, - NEGATE_NONE); - vpu.cmd[7] = PVS_SRC_OPERAND(1, PVS_SRC_SELECT_FORCE_0, - PVS_SRC_SELECT_FORCE_0, - PVS_SRC_SELECT_FORCE_0, - PVS_SRC_SELECT_FORCE_0, - PVS_SRC_REG_INPUT, NEGATE_NONE); - vpu.cmd[8] = 0x0; - - if (r300->radeon.radeonScreen->kernel_mm) { - int dwords = r300->hw.vap_flush.check(ctx,&r300->hw.vap_flush); - BEGIN_BATCH_NO_AUTOSTATE(dwords); - OUT_BATCH_TABLE(r300->hw.vap_flush.cmd, dwords); - END_BATCH(); - emit_vpu(ctx, &vpu); - } else { - int dwords = vpu.check(ctx,&vpu); - BEGIN_BATCH_NO_AUTOSTATE(dwords); - OUT_BATCH_TABLE(vpu.cmd, dwords); - END_BATCH(); - } - - } -} - -static int r300KernelClear(GLcontext *ctx, GLuint flags) -{ - r300ContextPtr r300 = R300_CONTEXT(ctx); - __DRIdrawablePrivate *dPriv = radeon_get_drawable(&r300->radeon); - struct radeon_framebuffer *rfb = dPriv->driverPrivate; - struct radeon_renderbuffer *rrb; - struct radeon_renderbuffer *rrbd; - int bits = 0, ret; - - /* Make sure it fits there. */ - radeon_cs_space_reset_bos(r300->radeon.cmdbuf.cs); - - if (flags & BUFFER_BIT_COLOR0) { - rrb = radeon_get_renderbuffer(&rfb->base, BUFFER_COLOR0); - radeon_cs_space_add_persistent_bo(r300->radeon.cmdbuf.cs, - rrb->bo, 0, RADEON_GEM_DOMAIN_VRAM); - } - - if (flags & BUFFER_BIT_FRONT_LEFT) { - rrb = radeon_get_renderbuffer(&rfb->base, BUFFER_FRONT_LEFT); - radeon_cs_space_add_persistent_bo(r300->radeon.cmdbuf.cs, - rrb->bo, 0, RADEON_GEM_DOMAIN_VRAM); - } - - if (flags & BUFFER_BIT_BACK_LEFT) { - rrb = radeon_get_renderbuffer(&rfb->base, BUFFER_BACK_LEFT); - radeon_cs_space_add_persistent_bo(r300->radeon.cmdbuf.cs, - rrb->bo, 0, RADEON_GEM_DOMAIN_VRAM); - } - - rrbd = radeon_get_renderbuffer(&rfb->base, BUFFER_DEPTH); - if (rrbd) { - radeon_cs_space_add_persistent_bo(r300->radeon.cmdbuf.cs, - rrbd->bo, 0, RADEON_GEM_DOMAIN_VRAM); - } - - ret = radeon_cs_space_check(r300->radeon.cmdbuf.cs); - if (ret) - return -1; - - rcommonEnsureCmdBufSpace(&r300->radeon, 421 * 3, __FUNCTION__); - if (flags || bits) - r300EmitClearState(ctx); - - rrbd = radeon_get_renderbuffer(&rfb->base, BUFFER_DEPTH); - if (rrbd && (flags & BUFFER_BIT_DEPTH)) - bits |= CLEARBUFFER_DEPTH; - - if (rrbd && (flags & BUFFER_BIT_STENCIL)) - bits |= CLEARBUFFER_STENCIL; - - if (flags & BUFFER_BIT_COLOR0) { - rrb = radeon_get_renderbuffer(&rfb->base, BUFFER_COLOR0); - r300ClearBuffer(r300, CLEARBUFFER_COLOR, rrb, NULL); - bits = 0; - } - - if (flags & BUFFER_BIT_FRONT_LEFT) { - rrb = radeon_get_renderbuffer(&rfb->base, BUFFER_FRONT_LEFT); - r300ClearBuffer(r300, bits | CLEARBUFFER_COLOR, rrb, rrbd); - bits = 0; - } - - if (flags & BUFFER_BIT_BACK_LEFT) { - rrb = radeon_get_renderbuffer(&rfb->base, BUFFER_BACK_LEFT); - r300ClearBuffer(r300, bits | CLEARBUFFER_COLOR, rrb, rrbd); - bits = 0; - } - - if (bits) - r300ClearBuffer(r300, bits, NULL, rrbd); - - COMMIT_BATCH(); - return 0; -} - -/** - * Buffer clear - */ -static void r300Clear(GLcontext * ctx, GLbitfield mask) -{ - r300ContextPtr r300 = R300_CONTEXT(ctx); - __DRIdrawablePrivate *dPriv = radeon_get_drawable(&r300->radeon); - const GLuint colorMask = *((GLuint *) & ctx->Color.ColorMask); - GLbitfield swrast_mask = 0, tri_mask = 0; - int i, ret; - struct gl_framebuffer *fb = ctx->DrawBuffer; - - if (RADEON_DEBUG & RADEON_IOCTL) - fprintf(stderr, "r300Clear\n"); - - if (!r300->radeon.radeonScreen->driScreen->dri2.enabled) { - LOCK_HARDWARE(&r300->radeon); - UNLOCK_HARDWARE(&r300->radeon); - if (dPriv->numClipRects == 0) - return; - } - - /* Flush swtcl vertices if necessary, because we will change hardware - * state during clear. See also the state-related comment in - * r300EmitClearState. - */ - R300_NEWPRIM(r300); - - if (colorMask == ~0) - tri_mask |= (mask & BUFFER_BITS_COLOR); - else - tri_mask |= (mask & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT)); - - - /* HW stencil */ - if (mask & BUFFER_BIT_STENCIL) { - tri_mask |= BUFFER_BIT_STENCIL; - } - - /* HW depth */ - if (mask & BUFFER_BIT_DEPTH) { - tri_mask |= BUFFER_BIT_DEPTH; - } - - /* If we're doing a tri pass for depth/stencil, include a likely color - * buffer with it. - */ - - for (i = 0; i < BUFFER_COUNT; i++) { - GLuint bufBit = 1 << i; - if ((tri_mask) & bufBit) { - if (!fb->Attachment[i].Renderbuffer->ClassID) { - tri_mask &= ~bufBit; - swrast_mask |= bufBit; - } - } - } - - /* SW fallback clearing */ - swrast_mask = mask & ~tri_mask; - - ret = 0; - if (tri_mask) { - if (r300->radeon.radeonScreen->kernel_mm) - radeonUserClear(ctx, tri_mask); - else { - /* if kernel clear fails due to size restraints fallback */ - ret = r300KernelClear(ctx, tri_mask); - if (ret < 0) - swrast_mask |= tri_mask; - } - } - - if (swrast_mask) { - if (RADEON_DEBUG & RADEON_FALLBACKS) - fprintf(stderr, "%s: swrast clear, mask: %x\n", - __FUNCTION__, swrast_mask); - _swrast_Clear(ctx, swrast_mask); - } -} - -void r300InitIoctlFuncs(struct dd_function_table *functions) -{ - functions->Clear = r300Clear; - functions->Finish = radeonFinish; - functions->Flush = radeonFlush; -} diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.h b/src/mesa/drivers/dri/r300/r300_ioctl.h deleted file mode 100644 index 3abfa71a6e..0000000000 --- a/src/mesa/drivers/dri/r300/r300_ioctl.h +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. - -The Weather Channel (TM) funded Tungsten Graphics to develop the -initial release of the Radeon 8500 driver under the XFree86 license. -This notice must be preserved. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice (including the -next paragraph) shall be included in all copies or substantial -portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 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. - -**************************************************************************/ - -/* - * Authors: - * Keith Whitwell - * Nicolai Haehnle - */ - -#ifndef __R300_IOCTL_H__ -#define __R300_IOCTL_H__ - -#include "r300_context.h" -#include "radeon_drm.h" - -extern void r300InitIoctlFuncs(struct dd_function_table *functions); - -#endif /* __R300_IOCTL_H__ */ diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 4ae593cbe7..02c94250a8 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -68,7 +68,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "tnl/tnl.h" #include "tnl/t_vp_build.h" #include "r300_context.h" -#include "r300_ioctl.h" #include "r300_state.h" #include "r300_reg.h" #include "r300_tex.h" diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index ac20c08e20..da0a9dfb4c 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -55,7 +55,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "tnl/t_vp_build.h" #include "r300_context.h" -#include "r300_ioctl.h" #include "r300_state.h" #include "r300_reg.h" #include "r300_emit.h" diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c index 726b3ff98e..ac3d5b1bec 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.c +++ b/src/mesa/drivers/dri/r300/r300_tex.c @@ -48,7 +48,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_context.h" #include "r300_state.h" -#include "r300_ioctl.h" #include "radeon_mipmap_tree.h" #include "r300_tex.h" diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index d80284e1b9..68b90d3106 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -46,7 +46,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_context.h" #include "r300_state.h" -#include "r300_ioctl.h" #include "radeon_mipmap_tree.h" #include "r300_tex.h" #include "r300_reg.h" -- cgit v1.2.3 From 05fae9fbf6d4409a8718813d9a607afc3c162050 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 7 Nov 2009 21:18:08 +0100 Subject: r300: refactor color buffer setup --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 216 ++++++++++++++++++-------------- src/mesa/drivers/dri/r300/r300_cmdbuf.h | 9 +- 2 files changed, 129 insertions(+), 96 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index efeeb0646d..57641998a4 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -255,110 +255,136 @@ static int check_cb_offset(GLcontext *ctx, struct radeon_state_atom * atom) return dw; } -static void emit_cb_offset(GLcontext *ctx, struct radeon_state_atom * atom) +static void emit_scissor(struct r300_context *r300, + unsigned width, + unsigned height) { - r300ContextPtr r300 = R300_CONTEXT(ctx); - BATCH_LOCALS(&r300->radeon); - struct radeon_renderbuffer *rrb; - uint32_t cbpitch; - uint32_t offset = r300->radeon.state.color.draw_offset; - uint32_t dw = 6; - int i; + int i; + BATCH_LOCALS(&r300->radeon); + if (r300->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) { + BEGIN_BATCH_NO_AUTOSTATE(3); + OUT_BATCH_REGSEQ(R300_SC_SCISSORS_TL, 2); + OUT_BATCH(0); + OUT_BATCH(((width - 1) << R300_SCISSORS_X_SHIFT) | + ((height - 1) << R300_SCISSORS_Y_SHIFT)); + END_BATCH(); + BEGIN_BATCH_NO_AUTOSTATE(16); + for (i = 0; i < 4; i++) { + OUT_BATCH_REGSEQ(R300_SC_CLIPRECT_TL_0 + (i * 8), 2); + OUT_BATCH((0 << R300_CLIPRECT_X_SHIFT) | (0 << R300_CLIPRECT_Y_SHIFT)); + OUT_BATCH(((width - 1) << R300_CLIPRECT_X_SHIFT) | ((height - 1) << R300_CLIPRECT_Y_SHIFT)); + } + OUT_BATCH_REGSEQ(R300_SC_CLIP_RULE, 1); + OUT_BATCH(0xAAAA); + OUT_BATCH_REGSEQ(R300_SC_SCREENDOOR, 1); + OUT_BATCH(0xffffff); + END_BATCH(); + } else { + BEGIN_BATCH_NO_AUTOSTATE(3); + OUT_BATCH_REGSEQ(R300_SC_SCISSORS_TL, 2); + OUT_BATCH((R300_SCISSORS_OFFSET << R300_SCISSORS_X_SHIFT) | + (R300_SCISSORS_OFFSET << R300_SCISSORS_Y_SHIFT)); + OUT_BATCH(((width + R300_SCISSORS_OFFSET - 1) << R300_SCISSORS_X_SHIFT) | + ((height + R300_SCISSORS_OFFSET - 1) << R300_SCISSORS_Y_SHIFT)); + END_BATCH(); + BEGIN_BATCH_NO_AUTOSTATE(16); + for (i = 0; i < 4; i++) { + OUT_BATCH_REGSEQ(R300_SC_CLIPRECT_TL_0 + (i * 8), 2); + OUT_BATCH((R300_SCISSORS_OFFSET << R300_CLIPRECT_X_SHIFT) | (R300_SCISSORS_OFFSET << R300_CLIPRECT_Y_SHIFT)); + OUT_BATCH(((R300_SCISSORS_OFFSET + width - 1) << R300_CLIPRECT_X_SHIFT) | + ((R300_SCISSORS_OFFSET + height - 1) << R300_CLIPRECT_Y_SHIFT)); + } + OUT_BATCH_REGSEQ(R300_SC_CLIP_RULE, 1); + OUT_BATCH(0xAAAA); + OUT_BATCH_REGSEQ(R300_SC_SCREENDOOR, 1); + OUT_BATCH(0xffffff); + END_BATCH(); + } +} - rrb = radeon_get_colorbuffer(&r300->radeon); - if (!rrb || !rrb->bo) { - fprintf(stderr, "no rrb\n"); - return; - } +void r300_emit_cb_setup(struct r300_context *r300, + struct radeon_bo *bo, + uint32_t offset, + GLuint format, + unsigned cpp, + unsigned pitch) +{ + BATCH_LOCALS(&r300->radeon); + uint32_t cbpitch = pitch / cpp; + uint32_t dw = 6; - if (RADEON_DEBUG & RADEON_STATE) - fprintf(stderr,"rrb is %p %d %dx%d\n", rrb, offset, rrb->base.Width, rrb->base.Height); - cbpitch = (rrb->pitch / rrb->cpp); - if (rrb->cpp == 4) - cbpitch |= R300_COLOR_FORMAT_ARGB8888; - else switch (rrb->base.Format) { + assert(offset % 256 == 0); + + switch (format) { case MESA_FORMAT_RGB565: - assert(_mesa_little_endian()); - cbpitch |= R300_COLOR_FORMAT_RGB565; - break; + assert(_mesa_little_endian()); + cbpitch |= R300_COLOR_FORMAT_RGB565; + break; case MESA_FORMAT_RGB565_REV: - assert(!_mesa_little_endian()); - cbpitch |= R300_COLOR_FORMAT_RGB565; - break; + assert(!_mesa_little_endian()); + cbpitch |= R300_COLOR_FORMAT_RGB565; + break; case MESA_FORMAT_ARGB4444: - assert(_mesa_little_endian()); - cbpitch |= R300_COLOR_FORMAT_ARGB4444; - break; + assert(_mesa_little_endian()); + cbpitch |= R300_COLOR_FORMAT_ARGB4444; + break; case MESA_FORMAT_ARGB4444_REV: - assert(!_mesa_little_endian()); - cbpitch |= R300_COLOR_FORMAT_ARGB4444; - break; - case MESA_FORMAT_ARGB1555: - assert(_mesa_little_endian()); - cbpitch |= R300_COLOR_FORMAT_ARGB1555; - break; - case MESA_FORMAT_ARGB1555_REV: - assert(!_mesa_little_endian()); - cbpitch |= R300_COLOR_FORMAT_ARGB1555; - break; - default: - _mesa_problem(ctx, "unexpected format in emit_cb_offset()"); - } + assert(!_mesa_little_endian()); + cbpitch |= R300_COLOR_FORMAT_ARGB4444; + break; + case MESA_FORMAT_ARGB1555: + assert(_mesa_little_endian()); + cbpitch |= R300_COLOR_FORMAT_ARGB1555; + break; + case MESA_FORMAT_ARGB1555_REV: + assert(!_mesa_little_endian()); + cbpitch |= R300_COLOR_FORMAT_ARGB1555; + break; + default: + if (cpp == 4) { + cbpitch |= R300_COLOR_FORMAT_ARGB8888; + } else { + _mesa_problem(r300->radeon.glCtx, "unexpected format in emit_cb_offset()");; + } + break; + } - if (rrb->bo->flags & RADEON_BO_FLAGS_MACRO_TILE) - cbpitch |= R300_COLOR_TILE_ENABLE; + if (bo->flags & RADEON_BO_FLAGS_MACRO_TILE) + cbpitch |= R300_COLOR_TILE_ENABLE; + + if (r300->radeon.radeonScreen->kernel_mm) + dw += 2; + + BEGIN_BATCH_NO_AUTOSTATE(dw); + OUT_BATCH_REGSEQ(R300_RB3D_COLOROFFSET0, 1); + OUT_BATCH_RELOC(offset, bo, offset, 0, RADEON_GEM_DOMAIN_VRAM, 0); + OUT_BATCH_REGSEQ(R300_RB3D_COLORPITCH0, 1); + if (!r300->radeon.radeonScreen->kernel_mm) + OUT_BATCH(cbpitch); + else + OUT_BATCH_RELOC(cbpitch, bo, cbpitch, 0, RADEON_GEM_DOMAIN_VRAM, 0); + END_BATCH(); +} + +static void emit_cb_offset_atom(GLcontext *ctx, struct radeon_state_atom * atom) +{ + r300ContextPtr r300 = R300_CONTEXT(ctx); + struct radeon_renderbuffer *rrb; + uint32_t offset = r300->radeon.state.color.draw_offset; + + rrb = radeon_get_colorbuffer(&r300->radeon); + if (!rrb || !rrb->bo) { + fprintf(stderr, "no rrb\n"); + return; + } + + if (RADEON_DEBUG & RADEON_STATE) + fprintf(stderr,"rrb is %p %d %dx%d\n", rrb, offset, rrb->base.Width, rrb->base.Height); + + r300_emit_cb_setup(r300, rrb->bo, offset, rrb->base.Format, rrb->cpp, rrb->pitch); - if (r300->radeon.radeonScreen->kernel_mm) - dw += 2; - BEGIN_BATCH_NO_AUTOSTATE(dw); - OUT_BATCH_REGSEQ(R300_RB3D_COLOROFFSET0, 1); - OUT_BATCH_RELOC(offset, rrb->bo, offset, 0, RADEON_GEM_DOMAIN_VRAM, 0); - OUT_BATCH_REGSEQ(R300_RB3D_COLORPITCH0, 1); - if (!r300->radeon.radeonScreen->kernel_mm) - OUT_BATCH(cbpitch); - else - OUT_BATCH_RELOC(cbpitch, rrb->bo, cbpitch, 0, RADEON_GEM_DOMAIN_VRAM, 0); - END_BATCH(); if (r300->radeon.radeonScreen->driScreen->dri2.enabled) { - if (r300->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) { - BEGIN_BATCH_NO_AUTOSTATE(3); - OUT_BATCH_REGSEQ(R300_SC_SCISSORS_TL, 2); - OUT_BATCH(0); - OUT_BATCH(((rrb->base.Width - 1) << R300_SCISSORS_X_SHIFT) | - ((rrb->base.Height - 1) << R300_SCISSORS_Y_SHIFT)); - END_BATCH(); - BEGIN_BATCH_NO_AUTOSTATE(16); - for (i = 0; i < 4; i++) { - OUT_BATCH_REGSEQ(R300_SC_CLIPRECT_TL_0 + (i * 8), 2); - OUT_BATCH((0 << R300_CLIPRECT_X_SHIFT) | (0 << R300_CLIPRECT_Y_SHIFT)); - OUT_BATCH(((rrb->base.Width - 1) << R300_CLIPRECT_X_SHIFT) | ((rrb->base.Height - 1) << R300_CLIPRECT_Y_SHIFT)); - } - OUT_BATCH_REGSEQ(R300_SC_CLIP_RULE, 1); - OUT_BATCH(0xAAAA); - OUT_BATCH_REGSEQ(R300_SC_SCREENDOOR, 1); - OUT_BATCH(0xffffff); - END_BATCH(); - } else { - BEGIN_BATCH_NO_AUTOSTATE(3); - OUT_BATCH_REGSEQ(R300_SC_SCISSORS_TL, 2); - OUT_BATCH((R300_SCISSORS_OFFSET << R300_SCISSORS_X_SHIFT) | - (R300_SCISSORS_OFFSET << R300_SCISSORS_Y_SHIFT)); - OUT_BATCH(((rrb->base.Width + R300_SCISSORS_OFFSET - 1) << R300_SCISSORS_X_SHIFT) | - ((rrb->base.Height + R300_SCISSORS_OFFSET - 1) << R300_SCISSORS_Y_SHIFT)); - END_BATCH(); - BEGIN_BATCH_NO_AUTOSTATE(16); - for (i = 0; i < 4; i++) { - OUT_BATCH_REGSEQ(R300_SC_CLIPRECT_TL_0 + (i * 8), 2); - OUT_BATCH((R300_SCISSORS_OFFSET << R300_CLIPRECT_X_SHIFT) | (R300_SCISSORS_OFFSET << R300_CLIPRECT_Y_SHIFT)); - OUT_BATCH(((R300_SCISSORS_OFFSET + rrb->base.Width - 1) << R300_CLIPRECT_X_SHIFT) | - ((R300_SCISSORS_OFFSET + rrb->base.Height - 1) << R300_CLIPRECT_Y_SHIFT)); - } - OUT_BATCH_REGSEQ(R300_SC_CLIP_RULE, 1); - OUT_BATCH(0xAAAA); - OUT_BATCH_REGSEQ(R300_SC_SCREENDOOR, 1); - OUT_BATCH(0xffffff); - END_BATCH(); - } + emit_scissor(r300, rrb->base.Width, rrb->base.Height); } } @@ -693,7 +719,7 @@ void r300InitCmdBuf(r300ContextPtr r300) ALLOC_STATE(rop, always, 2, 0); r300->hw.rop.cmd[0] = cmdpacket0(r300->radeon.radeonScreen, R300_RB3D_ROPCNTL, 1); ALLOC_STATE(cb, cb_offset, R300_CB_CMDSIZE, 0); - r300->hw.cb.emit = &emit_cb_offset; + r300->hw.cb.emit = &emit_cb_offset_atom; ALLOC_STATE(rb3d_dither_ctl, always, 10, 0); r300->hw.rb3d_dither_ctl.cmd[0] = cmdpacket0(r300->radeon.radeonScreen, R300_RB3D_DITHER_CTL, 9); ALLOC_STATE(rb3d_aaresolve_ctl, always, 2, 0); diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.h b/src/mesa/drivers/dri/r300/r300_cmdbuf.h index 1b703e518a..4cde1e2dcf 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.h +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.h @@ -54,4 +54,11 @@ void emit_r500fp(GLcontext *ctx, struct radeon_state_atom * atom); int check_r500fp(GLcontext *ctx, struct radeon_state_atom *atom); int check_r500fp_const(GLcontext *ctx, struct radeon_state_atom *atom); -#endif /* __R300_CMDBUF_H__ */ +void r300_emit_cb_setup(struct r300_context *r300, + struct radeon_bo *bo, + uint32_t offset, + GLuint format, + unsigned cpp, + unsigned pitch); + +#endif /* __R300_CMDBUF_H__ */ -- cgit v1.2.3 From 545a2f4f2d94b663e67cf1e682b49d088dd7ee90 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 7 Nov 2009 19:51:44 +0100 Subject: r300: refactor R500 fragment program emission --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 63 ++++++++++++++++++++------------- src/mesa/drivers/dri/r300/r300_cmdbuf.h | 11 +++--- 2 files changed, 45 insertions(+), 29 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index 57641998a4..09a6a033d1 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -107,32 +107,45 @@ void emit_vpu(GLcontext *ctx, struct radeon_state_atom * atom) END_BATCH(); } -void emit_r500fp(GLcontext *ctx, struct radeon_state_atom * atom) +void r500_emit_fp(struct r300_context *r300, + uint32_t *data, + unsigned len, + uint32_t addr, + unsigned type, + unsigned clamp) { - r300ContextPtr r300 = R300_CONTEXT(ctx); - BATCH_LOCALS(&r300->radeon); - drm_r300_cmd_header_t cmd; - uint32_t addr, ndw, sz; - int type, clamp; + BATCH_LOCALS(&r300->radeon); - ndw = atom->check(ctx, atom); + addr |= (type << 16); + addr |= (clamp << 17); - cmd.u = atom->cmd[0]; - sz = cmd.r500fp.count; - addr = ((cmd.r500fp.adrhi_flags & 1) << 8) | cmd.r500fp.adrlo; - type = !!(cmd.r500fp.adrhi_flags & R500FP_CONSTANT_TYPE); - clamp = !!(cmd.r500fp.adrhi_flags & R500FP_CONSTANT_CLAMP); + BEGIN_BATCH_NO_AUTOSTATE(len + 3); + OUT_BATCH(CP_PACKET0(R500_GA_US_VECTOR_INDEX, 0)); + OUT_BATCH(addr); + OUT_BATCH(CP_PACKET0(R500_GA_US_VECTOR_DATA, len-1) | RADEON_ONE_REG_WR); + OUT_BATCH_TABLE(data, len); + END_BATCH(); +} - addr |= (type << 16); - addr |= (clamp << 17); +static void emit_r500fp_atom(GLcontext *ctx, struct radeon_state_atom * atom) +{ + r300ContextPtr r300 = R300_CONTEXT(ctx); + drm_r300_cmd_header_t cmd; + uint32_t addr, count; + int type, clamp; - BEGIN_BATCH_NO_AUTOSTATE(ndw); - OUT_BATCH(CP_PACKET0(R500_GA_US_VECTOR_INDEX, 0)); - OUT_BATCH(addr); - ndw-=3; - OUT_BATCH(CP_PACKET0(R500_GA_US_VECTOR_DATA, ndw-1) | RADEON_ONE_REG_WR); - OUT_BATCH_TABLE(&atom->cmd[1], ndw); - END_BATCH(); + cmd.u = atom->cmd[0]; + addr = ((cmd.r500fp.adrhi_flags & 1) << 8) | cmd.r500fp.adrlo; + type = !!(cmd.r500fp.adrhi_flags & R500FP_CONSTANT_TYPE); + clamp = !!(cmd.r500fp.adrhi_flags & R500FP_CONSTANT_CLAMP); + + if (type) { + count = r500fp_count(atom->cmd) * 4; + } else { + count = r500fp_count(atom->cmd) * 6; + } + + r500_emit_fp(r300, &atom->cmd[1], count, addr, type, clamp); } static int check_tex_offsets(GLcontext *ctx, struct radeon_state_atom * atom) @@ -480,7 +493,7 @@ static int check_variable(GLcontext *ctx, struct radeon_state_atom *atom) return cnt ? cnt + 1 : 0; } -int check_r500fp(GLcontext *ctx, struct radeon_state_atom *atom) +static int check_r500fp(GLcontext *ctx, struct radeon_state_atom *atom) { int cnt; r300ContextPtr r300 = R300_CONTEXT(ctx); @@ -492,7 +505,7 @@ int check_r500fp(GLcontext *ctx, struct radeon_state_atom *atom) return cnt ? (cnt * 6) + extra : 0; } -int check_r500fp_const(GLcontext *ctx, struct radeon_state_atom *atom) +static int check_r500fp_const(GLcontext *ctx, struct radeon_state_atom *atom) { int cnt; r300ContextPtr r300 = R300_CONTEXT(ctx); @@ -669,13 +682,13 @@ void r300InitCmdBuf(r300ContextPtr r300) r300->hw.r500fp.cmd[R300_FPI_CMD_0] = cmdr500fp(r300->radeon.radeonScreen, 0, 0, 0, 0); if (r300->radeon.radeonScreen->kernel_mm) - r300->hw.r500fp.emit = emit_r500fp; + r300->hw.r500fp.emit = emit_r500fp_atom; ALLOC_STATE(r500fp_const, r500fp_const, R500_FPP_CMDSIZE, 0); r300->hw.r500fp_const.cmd[R300_FPI_CMD_0] = cmdr500fp(r300->radeon.radeonScreen, 0, 0, 1, 0); if (r300->radeon.radeonScreen->kernel_mm) - r300->hw.r500fp_const.emit = emit_r500fp; + r300->hw.r500fp_const.emit = emit_r500fp_atom; } else { ALLOC_STATE(fp, always, R300_FP_CMDSIZE, 0); r300->hw.fp.cmd[R300_FP_CMD_0] = cmdpacket0(r300->radeon.radeonScreen, R300_US_CONFIG, 3); diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.h b/src/mesa/drivers/dri/r300/r300_cmdbuf.h index 4cde1e2dcf..ee2db6e21d 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.h +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.h @@ -44,15 +44,18 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define FIREAOS_BUFSZ (3) #define SCISSORS_BUFSZ (3) -extern void r300InitCmdBuf(r300ContextPtr r300); +void r300InitCmdBuf(r300ContextPtr r300); void r300_emit_scissor(GLcontext *ctx); void emit_vpu(GLcontext *ctx, struct radeon_state_atom * atom); int check_vpu(GLcontext *ctx, struct radeon_state_atom *atom); -void emit_r500fp(GLcontext *ctx, struct radeon_state_atom * atom); -int check_r500fp(GLcontext *ctx, struct radeon_state_atom *atom); -int check_r500fp_const(GLcontext *ctx, struct radeon_state_atom *atom); +void r500_emit_fp(struct r300_context *r300, + uint32_t *data, + unsigned len, + uint32_t addr, + unsigned type, + unsigned clamp); void r300_emit_cb_setup(struct r300_context *r300, struct radeon_bo *bo, -- cgit v1.2.3 From 9975c484ad828c80089c718dcdbdb2040f45b67b Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 7 Nov 2009 21:13:55 +0100 Subject: r300: refactor PVS code and constants emission --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 54 ++++++++++++++++++--------------- src/mesa/drivers/dri/r300/r300_cmdbuf.h | 6 ++-- 2 files changed, 34 insertions(+), 26 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index 09a6a033d1..4b0005e155 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -71,7 +71,7 @@ static unsigned packet0_count(r300ContextPtr r300, uint32_t *pkt) #define vpu_count(ptr) (((drm_r300_cmd_header_t*)(ptr))->vpu.count) #define r500fp_count(ptr) (((drm_r300_cmd_header_t*)(ptr))->r500fp.count) -int check_vpu(GLcontext *ctx, struct radeon_state_atom *atom) +static int check_vpu(GLcontext *ctx, struct radeon_state_atom *atom) { r300ContextPtr r300 = R300_CONTEXT(ctx); int cnt; @@ -85,26 +85,32 @@ int check_vpu(GLcontext *ctx, struct radeon_state_atom *atom) return cnt ? (cnt * 4) + extra : 0; } - -void emit_vpu(GLcontext *ctx, struct radeon_state_atom * atom) +void r300_emit_vpu(struct r300_context *r300, + uint32_t *data, + unsigned len, + uint32_t addr) { - r300ContextPtr r300 = R300_CONTEXT(ctx); - BATCH_LOCALS(&r300->radeon); - drm_r300_cmd_header_t cmd; - uint32_t addr, ndw; + BATCH_LOCALS(&r300->radeon); - cmd.u = atom->cmd[0]; - addr = (cmd.vpu.adrhi << 8) | cmd.vpu.adrlo; - ndw = atom->check(ctx, atom); + BEGIN_BATCH_NO_AUTOSTATE(5 + len); + OUT_BATCH_REGVAL(R300_VAP_PVS_STATE_FLUSH_REG, 0); + OUT_BATCH_REGVAL(R300_VAP_PVS_VECTOR_INDX_REG, addr); + OUT_BATCH(CP_PACKET0(R300_VAP_PVS_UPLOAD_DATA, len-1) | RADEON_ONE_REG_WR); + OUT_BATCH_TABLE(data, len); + END_BATCH(); +} - BEGIN_BATCH_NO_AUTOSTATE(ndw); +static void emit_vpu_state(GLcontext *ctx, struct radeon_state_atom * atom) +{ + r300ContextPtr r300 = R300_CONTEXT(ctx); + drm_r300_cmd_header_t cmd; + uint32_t addr, ndw; - ndw -= 5; - OUT_BATCH_REGVAL(R300_VAP_PVS_VECTOR_INDX_REG, addr); - OUT_BATCH(CP_PACKET0(R300_VAP_PVS_UPLOAD_DATA, ndw-1) | RADEON_ONE_REG_WR); - OUT_BATCH_TABLE(&atom->cmd[1], ndw); - OUT_BATCH_REGVAL(R300_VAP_PVS_STATE_FLUSH_REG, 0); - END_BATCH(); + cmd.u = atom->cmd[0]; + addr = (cmd.vpu.adrhi << 8) | cmd.vpu.adrlo; + ndw = atom->check(ctx, atom); + + r300_emit_vpu(r300, &atom->cmd[1], vpu_count(atom->cmd) * 4, addr); } void r500_emit_fp(struct r300_context *r300, @@ -796,20 +802,20 @@ void r300InitCmdBuf(r300ContextPtr r300) r300->hw.vpi.cmd[0] = cmdvpu(r300->radeon.radeonScreen, R300_PVS_CODE_START, 0); if (r300->radeon.radeonScreen->kernel_mm) - r300->hw.vpi.emit = emit_vpu; + r300->hw.vpi.emit = emit_vpu_state; if (is_r500) { ALLOC_STATE(vpp, vpu, R300_VPP_CMDSIZE, 0); r300->hw.vpp.cmd[0] = cmdvpu(r300->radeon.radeonScreen, R500_PVS_CONST_START, 0); if (r300->radeon.radeonScreen->kernel_mm) - r300->hw.vpp.emit = emit_vpu; + r300->hw.vpp.emit = emit_vpu_state; ALLOC_STATE(vps, vpu, R300_VPS_CMDSIZE, 0); r300->hw.vps.cmd[0] = cmdvpu(r300->radeon.radeonScreen, R500_POINT_VPORT_SCALE_OFFSET, 1); if (r300->radeon.radeonScreen->kernel_mm) - r300->hw.vps.emit = emit_vpu; + r300->hw.vps.emit = emit_vpu_state; for (i = 0; i < 6; i++) { ALLOC_STATE(vpucp[i], vpu, R300_VPUCP_CMDSIZE, 0); @@ -817,20 +823,20 @@ void r300InitCmdBuf(r300ContextPtr r300) cmdvpu(r300->radeon.radeonScreen, R500_PVS_UCP_START + i, 1); if (r300->radeon.radeonScreen->kernel_mm) - r300->hw.vpucp[i].emit = emit_vpu; + r300->hw.vpucp[i].emit = emit_vpu_state; } } else { ALLOC_STATE(vpp, vpu, R300_VPP_CMDSIZE, 0); r300->hw.vpp.cmd[0] = cmdvpu(r300->radeon.radeonScreen, R300_PVS_CONST_START, 0); if (r300->radeon.radeonScreen->kernel_mm) - r300->hw.vpp.emit = emit_vpu; + r300->hw.vpp.emit = emit_vpu_state; ALLOC_STATE(vps, vpu, R300_VPS_CMDSIZE, 0); r300->hw.vps.cmd[0] = cmdvpu(r300->radeon.radeonScreen, R300_POINT_VPORT_SCALE_OFFSET, 1); if (r300->radeon.radeonScreen->kernel_mm) - r300->hw.vps.emit = emit_vpu; + r300->hw.vps.emit = emit_vpu_state; for (i = 0; i < 6; i++) { ALLOC_STATE(vpucp[i], vpu, R300_VPUCP_CMDSIZE, 0); @@ -838,7 +844,7 @@ void r300InitCmdBuf(r300ContextPtr r300) cmdvpu(r300->radeon.radeonScreen, R300_PVS_UCP_START + i, 1); if (r300->radeon.radeonScreen->kernel_mm) - r300->hw.vpucp[i].emit = emit_vpu; + r300->hw.vpucp[i].emit = emit_vpu_state; } } } diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.h b/src/mesa/drivers/dri/r300/r300_cmdbuf.h index ee2db6e21d..0e68da928e 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.h +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.h @@ -47,8 +47,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. void r300InitCmdBuf(r300ContextPtr r300); void r300_emit_scissor(GLcontext *ctx); -void emit_vpu(GLcontext *ctx, struct radeon_state_atom * atom); -int check_vpu(GLcontext *ctx, struct radeon_state_atom *atom); +void r300_emit_vpu(struct r300_context *ctx, + uint32_t *data, + unsigned len, + uint32_t addr); void r500_emit_fp(struct r300_context *r300, uint32_t *data, -- cgit v1.2.3 From bd58253f675cb37b7521f082f80a3fd9cab6eff1 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 7 Nov 2009 22:48:23 +0100 Subject: r300: export translateTexFormat function --- src/mesa/drivers/dri/r300/r300_tex.h | 2 ++ src/mesa/drivers/dri/r300/r300_texstate.c | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_tex.h b/src/mesa/drivers/dri/r300/r300_tex.h index 8a653ea2d1..beb10072e9 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.h +++ b/src/mesa/drivers/dri/r300/r300_tex.h @@ -51,4 +51,6 @@ extern GLboolean r300ValidateBuffers(GLcontext * ctx); extern void r300InitTextureFuncs(struct dd_function_table *functions); +uint32_t r300TranslateTexFormat(gl_format mesaFormat); + #endif /* __r300_TEX_H__ */ diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index 68b90d3106..6db56ba618 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -59,7 +59,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * identically. -- paulus */ -static uint32_t translateTexFormat(gl_format mesaFormat) +uint32_t r300TranslateTexFormat(gl_format mesaFormat) { switch (mesaFormat) { @@ -168,8 +168,6 @@ static uint32_t translateTexFormat(gl_format mesaFormat) case MESA_FORMAT_SRGBA_DXT5: return R300_EASY_TX_FORMAT(Y, Z, W, X, DXT5) | R300_TX_FORMAT_GAMMA; default: - fprintf(stderr, "%s: Invalid format %s", __FUNCTION__, _mesa_get_format_name(mesaFormat)); - assert(0); return 0; } }; @@ -254,7 +252,12 @@ static void setup_hardware_state(r300ContextPtr rmesa, radeonTexObj *t) if (firstImage->_BaseFormat == GL_DEPTH_COMPONENT) { r300SetDepthTexMode(&t->base); } else { - t->pp_txformat = translateTexFormat(firstImage->TexFormat); + t->pp_txformat = r300TranslateTexFormat(firstImage->TexFormat); + if (t->pp_txformat == 0) { + _mesa_problem(rmesa->radeon.glCtx, "%s: Invalid format %s", + __FUNCTION__, _mesa_get_format_name(firstImage->TexFormat)); + _mesa_exit(1); + } } } -- cgit v1.2.3 From 0a0d410bdbbc9ea9b56fca51e077de32d629d20d Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sun, 8 Nov 2009 21:44:24 +0100 Subject: r300: fix wrong assertion --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index 4b0005e155..e1c33bbb2c 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -332,7 +332,7 @@ void r300_emit_cb_setup(struct r300_context *r300, uint32_t cbpitch = pitch / cpp; uint32_t dw = 6; - assert(offset % 256 == 0); + assert(offset % 32 == 0); switch (format) { case MESA_FORMAT_RGB565: -- cgit v1.2.3 From a4df3f9227f1e068792454920d9ec782326da88f Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sun, 8 Nov 2009 22:01:12 +0100 Subject: r300: accelerated blit support --- src/mesa/drivers/dri/r300/Makefile | 1 + src/mesa/drivers/dri/r300/r300_blit.c | 468 +++++++++++++++++++++++++++++++ src/mesa/drivers/dri/r300/r300_blit.h | 46 +++ src/mesa/drivers/dri/r300/r300_context.c | 2 + src/mesa/drivers/dri/r300/r300_context.h | 5 + 5 files changed, 522 insertions(+) create mode 100644 src/mesa/drivers/dri/r300/r300_blit.c create mode 100644 src/mesa/drivers/dri/r300/r300_blit.h (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/Makefile b/src/mesa/drivers/dri/r300/Makefile index 9fd0133fda..b5145d9838 100644 --- a/src/mesa/drivers/dri/r300/Makefile +++ b/src/mesa/drivers/dri/r300/Makefile @@ -43,6 +43,7 @@ RADEON_COMMON_SOURCES = \ DRIVER_SOURCES = \ radeon_screen.c \ + r300_blit.c \ r300_context.c \ r300_draw.c \ r300_cmdbuf.c \ diff --git a/src/mesa/drivers/dri/r300/r300_blit.c b/src/mesa/drivers/dri/r300/r300_blit.c new file mode 100644 index 0000000000..7cb6f36c02 --- /dev/null +++ b/src/mesa/drivers/dri/r300/r300_blit.c @@ -0,0 +1,468 @@ +/* + * Copyright (C) 2009 Maciej Cencora + * + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 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. + * + */ + +#include "radeon_common.h" +#include "r300_context.h" + +#include "r300_blit.h" +#include "r300_cmdbuf.h" +#include "r300_emit.h" +#include "r300_tex.h" +#include "compiler/radeon_compiler.h" +#include "compiler/radeon_opcodes.h" + +/** + * TODO: + * - handle depth buffer + * - r300 fp and rs setup + */ + +static void vp_ins_outs(struct r300_vertex_program_compiler *c) +{ + c->code->inputs[VERT_ATTRIB_POS] = 0; + c->code->inputs[VERT_ATTRIB_TEX0] = 1; + c->code->outputs[VERT_RESULT_HPOS] = 0; + c->code->outputs[VERT_RESULT_TEX0] = 1; +} + +static void fp_allocate_hw_inputs( + struct r300_fragment_program_compiler * c, + void (*allocate)(void * data, unsigned input, unsigned hwreg), + void * mydata) +{ + allocate(mydata, FRAG_ATTRIB_TEX0, 0); +} + +static void create_vertex_program(struct r300_context *r300) +{ + struct r300_vertex_program_compiler compiler; + struct rc_instruction *inst; + + rc_init(&compiler.Base); + + inst = rc_insert_new_instruction(&compiler.Base, compiler.Base.Program.Instructions.Prev); + inst->U.I.Opcode = RC_OPCODE_MOV; + inst->U.I.DstReg.File = RC_FILE_OUTPUT; + inst->U.I.DstReg.Index = VERT_RESULT_HPOS; + inst->U.I.DstReg.RelAddr = 0; + inst->U.I.DstReg.WriteMask = RC_MASK_XYZW; + inst->U.I.SrcReg[0].Abs = 0; + inst->U.I.SrcReg[0].File = RC_FILE_INPUT; + inst->U.I.SrcReg[0].Index = VERT_ATTRIB_POS; + inst->U.I.SrcReg[0].Negate = 0; + inst->U.I.SrcReg[0].RelAddr = 0; + inst->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_XYZW; + + inst = rc_insert_new_instruction(&compiler.Base, compiler.Base.Program.Instructions.Prev); + inst->U.I.Opcode = RC_OPCODE_MOV; + inst->U.I.DstReg.File = RC_FILE_OUTPUT; + inst->U.I.DstReg.Index = VERT_RESULT_TEX0; + inst->U.I.DstReg.RelAddr = 0; + inst->U.I.DstReg.WriteMask = RC_MASK_XYZW; + inst->U.I.SrcReg[0].Abs = 0; + inst->U.I.SrcReg[0].File = RC_FILE_INPUT; + inst->U.I.SrcReg[0].Index = VERT_ATTRIB_TEX0; + inst->U.I.SrcReg[0].Negate = 0; + inst->U.I.SrcReg[0].RelAddr = 0; + inst->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_XYZW; + + compiler.Base.Program.InputsRead = (1 << VERT_ATTRIB_POS) | (1 << VERT_ATTRIB_TEX0); + compiler.RequiredOutputs = compiler.Base.Program.OutputsWritten = (1 << VERT_RESULT_HPOS) | (1 << VERT_RESULT_TEX0); + compiler.SetHwInputOutput = vp_ins_outs; + compiler.code = &r300->blit.vp_code; + + r3xx_compile_vertex_program(&compiler); +} + +static void create_fragment_program(struct r300_context *r300) +{ + struct r300_fragment_program_compiler compiler; + struct rc_instruction *inst; + + rc_init(&compiler.Base); + + inst = rc_insert_new_instruction(&compiler.Base, compiler.Base.Program.Instructions.Prev); + inst->U.I.Opcode = RC_OPCODE_TEX; + inst->U.I.TexSrcTarget = RC_TEXTURE_2D; + inst->U.I.TexSrcUnit = 0; + inst->U.I.DstReg.File = RC_FILE_OUTPUT; + inst->U.I.DstReg.Index = FRAG_RESULT_COLOR; + inst->U.I.DstReg.WriteMask = RC_MASK_XYZW; + inst->U.I.SrcReg[0].Abs = 0; + inst->U.I.SrcReg[0].File = RC_FILE_INPUT; + inst->U.I.SrcReg[0].Index = FRAG_ATTRIB_TEX0; + inst->U.I.SrcReg[0].Negate = 0; + inst->U.I.SrcReg[0].RelAddr = 0; + inst->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_XYZW; + + compiler.Base.Program.InputsRead = (1 << FRAG_ATTRIB_TEX0); + compiler.OutputColor = FRAG_RESULT_COLOR; + compiler.OutputDepth = FRAG_RESULT_DEPTH; + compiler.is_r500 = (r300->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515); + compiler.code = &r300->blit.fp_code; + compiler.AllocateHwInputs = fp_allocate_hw_inputs; + + r3xx_compile_fragment_program(&compiler); +} + +void r300_blit_init(struct r300_context *r300) +{ + create_vertex_program(r300); + create_fragment_program(r300); +} + +static void r500_emit_rs_setup(struct r300_context *r300) +{ + BATCH_LOCALS(&r300->radeon); + + BEGIN_BATCH(7); + OUT_BATCH_REGSEQ(R300_RS_COUNT, 2); + OUT_BATCH((4 << R300_IT_COUNT_SHIFT) | R300_HIRES_EN); + OUT_BATCH(0); + OUT_BATCH_REGVAL(R500_RS_INST_0, + (0 << R500_RS_INST_TEX_ID_SHIFT) | + (0 << R500_RS_INST_TEX_ADDR_SHIFT) | + R500_RS_INST_TEX_CN_WRITE | + R500_RS_INST_COL_CN_NO_WRITE); + OUT_BATCH_REGVAL(R500_RS_IP_0, + (0 << R500_RS_IP_TEX_PTR_S_SHIFT) | + (1 << R500_RS_IP_TEX_PTR_T_SHIFT) | + (2 << R500_RS_IP_TEX_PTR_R_SHIFT) | + (3 << R500_RS_IP_TEX_PTR_Q_SHIFT)); + END_BATCH(); +} + +static void r300_emit_fp_setup(struct r300_context *r300) +{ + assert(0); +} + +static void r300_emit_rs_setup(struct r300_context *r300) +{ + assert(0); +} + +static void r300_emit_tx_setup(struct r300_context *r300, + gl_format mesa_format, + struct radeon_bo *bo, + intptr_t offset, + unsigned width, + unsigned height, + unsigned pitch) +{ + BATCH_LOCALS(&r300->radeon); + + assert(width <= 2048); + assert(height <= 2048); + assert(r300TranslateTexFormat(mesa_format) != 0); + assert(offset % 32 == 0); + + BEGIN_BATCH(17); + OUT_BATCH_REGVAL(R300_TX_FILTER0_0, + (R300_TX_CLAMP_TO_EDGE << R300_TX_WRAP_S_SHIFT) | + (R300_TX_CLAMP_TO_EDGE << R300_TX_WRAP_T_SHIFT) | + (R300_TX_CLAMP_TO_EDGE << R300_TX_WRAP_R_SHIFT) | + R300_TX_MIN_FILTER_MIP_NONE | + R300_TX_MIN_FILTER_LINEAR | + R300_TX_MAG_FILTER_LINEAR | + (0 << 28)); + OUT_BATCH_REGVAL(R300_TX_FILTER1_0, 0); + OUT_BATCH_REGVAL(R300_TX_SIZE_0, + ((width-1) << R300_TX_WIDTHMASK_SHIFT) | + ((height-1) << R300_TX_HEIGHTMASK_SHIFT) | + (0 << R300_TX_DEPTHMASK_SHIFT) | + (0 << R300_TX_MAX_MIP_LEVEL_SHIFT) | + R300_TX_SIZE_TXPITCH_EN); + + OUT_BATCH_REGVAL(R300_TX_FORMAT_0, r300TranslateTexFormat(mesa_format)); + OUT_BATCH_REGVAL(R300_TX_FORMAT2_0, pitch/_mesa_get_format_bytes(mesa_format) - 1); + OUT_BATCH_REGSEQ(R300_TX_OFFSET_0, 1); + OUT_BATCH_RELOC(0, bo, offset, RADEON_GEM_DOMAIN_GTT|RADEON_GEM_DOMAIN_VRAM, 0, 0); + + OUT_BATCH_REGSEQ(R300_TX_INVALTAGS, 2); + OUT_BATCH(0); + OUT_BATCH(1); + + END_BATCH(); +} + +#define EASY_US_FORMAT(FMT, C0, C1, C2, C3, SIGN) \ + (FMT | R500_C0_SEL_##C0 | R500_C1_SEL_##C1 | \ + R500_C2_SEL_##C2 | R500_C3_SEL_##C3 | R500_OUT_SIGN(SIGN)) + +static uint32_t mesa_format_to_us_format(gl_format mesa_format) +{ + switch(mesa_format) + { + case MESA_FORMAT_RGBA8888: // x + return EASY_US_FORMAT(R500_OUT_FMT_C4_8, A, B, G, R, 0); + case MESA_FORMAT_RGB565: // x + case MESA_FORMAT_ARGB1555: // x + case MESA_FORMAT_RGBA8888_REV: // x + return EASY_US_FORMAT(R500_OUT_FMT_C4_8, R, G, B, A, 0); + case MESA_FORMAT_ARGB8888: // x + return EASY_US_FORMAT(R500_OUT_FMT_C4_8, B, G, R, A, 0); + case MESA_FORMAT_ARGB8888_REV: + return EASY_US_FORMAT(R500_OUT_FMT_C4_8, A, R, G, B, 0); + case MESA_FORMAT_XRGB8888: + return EASY_US_FORMAT(R500_OUT_FMT_C4_8, A, R, G, B, 0); + + case MESA_FORMAT_RGB332: + return EASY_US_FORMAT(R500_OUT_FMT_C_3_3_2, A, R, G, B, 0); + + case MESA_FORMAT_RGBA_FLOAT32: + return EASY_US_FORMAT(R500_OUT_FMT_C4_32_FP, R, G, B, A, 0); + case MESA_FORMAT_RGBA_FLOAT16: + return EASY_US_FORMAT(R500_OUT_FMT_C4_16_FP, R, G, B, A, 0); + case MESA_FORMAT_ALPHA_FLOAT32: + return EASY_US_FORMAT(R500_OUT_FMT_C_32_FP, A, A, A, A, 0); + case MESA_FORMAT_ALPHA_FLOAT16: + return EASY_US_FORMAT(R500_OUT_FMT_C_16_FP, A, A, A, A, 0); + + case MESA_FORMAT_SIGNED_RGBA8888: + return EASY_US_FORMAT(R500_OUT_FMT_C4_8, R, G, B, A, 0xf); + case MESA_FORMAT_SIGNED_RGBA8888_REV: + return EASY_US_FORMAT(R500_OUT_FMT_C4_8, A, B, G, R, 0xf); + case MESA_FORMAT_SIGNED_RGBA_16: + return EASY_US_FORMAT(R500_OUT_FMT_C4_16, R, G, B, A, 0xf); + + default: + assert(!"Invalid format for US output\n"); + return 0; + } +} +#undef EASY_US_FORMAT + +static void r500_emit_fp_setup(struct r300_context *r300, + struct r500_fragment_program_code *fp, + gl_format dst_format) +{ + r500_emit_fp(r300, (uint32_t *)fp->inst, (fp->inst_end + 1) * 6, 0, 0, 0); + BATCH_LOCALS(&r300->radeon); + + BEGIN_BATCH(10); + OUT_BATCH_REGSEQ(R500_US_CODE_ADDR, 3); + OUT_BATCH(R500_US_CODE_START_ADDR(0) | R500_US_CODE_END_ADDR(fp->inst_end)); + OUT_BATCH(R500_US_CODE_RANGE_ADDR(0) | R500_US_CODE_RANGE_SIZE(fp->inst_end)); + OUT_BATCH(0); + OUT_BATCH_REGVAL(R500_US_CONFIG, 0); + OUT_BATCH_REGVAL(R500_US_OUT_FMT_0, mesa_format_to_us_format(dst_format)); + OUT_BATCH_REGVAL(R500_US_PIXSIZE, fp->max_temp_idx); + END_BATCH(); +} + +static void emit_pvs_setup(struct r300_context *r300, + uint32_t *vp_code, + unsigned vp_len) +{ + BATCH_LOCALS(&r300->radeon); + + r300_emit_vpu(r300, vp_code, vp_len * 4, R300_PVS_CODE_START); + + BEGIN_BATCH(4); + OUT_BATCH_REGSEQ(R300_VAP_PVS_CODE_CNTL_0, 3); + OUT_BATCH((0 << R300_PVS_FIRST_INST_SHIFT) | + ((vp_len - 1) << R300_PVS_XYZW_VALID_INST_SHIFT) | + ((vp_len - 1)<< R300_PVS_LAST_INST_SHIFT)); + OUT_BATCH(0); + OUT_BATCH((vp_len - 1) << R300_PVS_LAST_VTX_SRC_INST_SHIFT); + END_BATCH(); +} + +static void emit_vap_setup(struct r300_context *r300, unsigned width, unsigned height) +{ + BATCH_LOCALS(&r300->radeon); + + BEGIN_BATCH(12); + OUT_BATCH_REGSEQ(R300_SE_VTE_CNTL, 2); + OUT_BATCH(R300_VTX_XY_FMT | R300_VTX_Z_FMT); + OUT_BATCH(4); + + OUT_BATCH_REGVAL(R300_VAP_PSC_SGN_NORM_CNTL, 0xaaaaaaaa); + OUT_BATCH_REGVAL(R300_VAP_PROG_STREAM_CNTL_0, + ((R300_DATA_TYPE_FLOAT_2 | (0 << R300_DST_VEC_LOC_SHIFT)) << 0) | + (((1 << R300_DST_VEC_LOC_SHIFT) | R300_DATA_TYPE_FLOAT_2 | R300_LAST_VEC) << 16)); + OUT_BATCH_REGVAL(R300_VAP_PROG_STREAM_CNTL_EXT_0, + ((((R300_SWIZZLE_SELECT_X << R300_SWIZZLE_SELECT_X_SHIFT) | + (R300_SWIZZLE_SELECT_Y << R300_SWIZZLE_SELECT_Y_SHIFT) | + (R300_SWIZZLE_SELECT_FP_ZERO << R300_SWIZZLE_SELECT_Z_SHIFT) | + (R300_SWIZZLE_SELECT_FP_ONE << R300_SWIZZLE_SELECT_W_SHIFT) | + (0xf << R300_WRITE_ENA_SHIFT) ) << 0) | + (((R300_SWIZZLE_SELECT_X << R300_SWIZZLE_SELECT_X_SHIFT) | + (R300_SWIZZLE_SELECT_Y << R300_SWIZZLE_SELECT_Y_SHIFT) | + (R300_SWIZZLE_SELECT_FP_ZERO << R300_SWIZZLE_SELECT_Z_SHIFT) | + (R300_SWIZZLE_SELECT_FP_ONE << R300_SWIZZLE_SELECT_W_SHIFT) | + (0xf << R300_WRITE_ENA_SHIFT) ) << 16) ) ); + OUT_BATCH_REGSEQ(R300_VAP_OUTPUT_VTX_FMT_0, 2); + OUT_BATCH(R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT); + OUT_BATCH(R300_VAP_OUTPUT_VTX_FMT_1__4_COMPONENTS); + END_BATCH(); +} + +static GLboolean validate_buffers(struct r300_context *r300, + struct radeon_bo *src_bo, + struct radeon_bo *dst_bo) +{ + int ret; + radeon_cs_space_add_persistent_bo(r300->radeon.cmdbuf.cs, + src_bo, RADEON_GEM_DOMAIN_VRAM, 0); + + radeon_cs_space_add_persistent_bo(r300->radeon.cmdbuf.cs, + dst_bo, 0, RADEON_GEM_DOMAIN_VRAM); + + ret = radeon_cs_space_check_with_bo(r300->radeon.cmdbuf.cs, + first_elem(&r300->radeon.dma.reserved)->bo, + RADEON_GEM_DOMAIN_GTT, 0); + if (ret) + return GL_FALSE; + + return GL_TRUE; +} + +static void emit_draw_packet(struct r300_context *r300, float width, float height) +{ + float verts[] = { 0.0, 0.0, 0.0, 1.0, + 0.0, height, 0.0, 0.0, + width, height, 1.0, 0.0, + width, 0.0, 1.0, 1.0 }; + + BATCH_LOCALS(&r300->radeon); + + BEGIN_BATCH(19); + OUT_BATCH_PACKET3(R300_PACKET3_3D_DRAW_IMMD_2, 16); + OUT_BATCH(R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_EMBEDDED | + (4 << 16) | R300_VAP_VF_CNTL__PRIM_QUADS); + OUT_BATCH_TABLE(verts, 16); + END_BATCH(); +} + +static void other_stuff(struct r300_context *r300) +{ + BATCH_LOCALS(&r300->radeon); + + BEGIN_BATCH(15); + OUT_BATCH_REGVAL(R300_GA_POLY_MODE, + R300_GA_POLY_MODE_FRONT_PTYPE_TRI | R300_GA_POLY_MODE_BACK_PTYPE_TRI); + OUT_BATCH_REGVAL(R300_SU_CULL_MODE, R300_FRONT_FACE_CCW); + OUT_BATCH_REGVAL(R300_FG_FOG_BLEND, 0); + OUT_BATCH_REGVAL(R300_FG_ALPHA_FUNC, 0); + OUT_BATCH_REGSEQ(R300_RB3D_CBLEND, 2); + OUT_BATCH(0x0); + OUT_BATCH(0x0); + OUT_BATCH_REGVAL(R300_VAP_CLIP_CNTL, R300_CLIP_DISABLE); + OUT_BATCH_REGVAL(R300_ZB_CNTL, 0); + END_BATCH(); +} + +static void emit_cb_setup(struct r300_context *r300, + struct radeon_bo *bo, + intptr_t offset, + gl_format mesa_format, + unsigned width, + unsigned height) +{ + BATCH_LOCALS(&r300->radeon); + + unsigned x1, y1, x2, y2; + x1 = 0; + y1 = 0; + x2 = width - 1; + y2 = height - 1; + + if (r300->radeon.radeonScreen->chip_family < CHIP_FAMILY_RV515) { + x1 += R300_SCISSORS_OFFSET; + y1 += R300_SCISSORS_OFFSET; + x2 += R300_SCISSORS_OFFSET; + y2 += R300_SCISSORS_OFFSET; + } + + r300_emit_cb_setup(r300, bo, offset, mesa_format, + _mesa_get_format_bytes(mesa_format), + _mesa_format_row_stride(mesa_format, width)); + + BEGIN_BATCH_NO_AUTOSTATE(3); + OUT_BATCH_REGSEQ(R300_SC_SCISSORS_TL, 2); + OUT_BATCH((x1 << R300_SCISSORS_X_SHIFT)|(y1 << R300_SCISSORS_Y_SHIFT)); + OUT_BATCH((x2 << R300_SCISSORS_X_SHIFT)|(y2 << R300_SCISSORS_Y_SHIFT)); + END_BATCH(); +} + +GLboolean r300_blit(struct r300_context *r300, + struct radeon_bo *src_bo, + intptr_t src_offset, + gl_format src_mesaformat, + unsigned src_pitch, + unsigned src_width, + unsigned src_height, + struct radeon_bo *dst_bo, + intptr_t dst_offset, + gl_format dst_mesaformat, + unsigned dst_width, + unsigned dst_height) +{ + assert(src_width == dst_width); + assert(src_height == dst_height); + + if (0) { + fprintf(stderr, "src: width %d, height %d, pitch %d vs %d, format %s\n", + src_width, src_height, src_pitch, + _mesa_format_row_stride(src_mesaformat, src_width), + _mesa_get_format_name(src_mesaformat)); + fprintf(stderr, "dst: width %d, height %d, pitch %d, format %s\n", + dst_width, dst_height, + _mesa_format_row_stride(dst_mesaformat, dst_width), + _mesa_get_format_name(dst_mesaformat)); + } + + if (!validate_buffers(r300, src_bo, dst_bo)) + return GL_FALSE; + + other_stuff(r300); + + r300_emit_tx_setup(r300, src_mesaformat, src_bo, src_offset, src_width, src_height, src_pitch); + + if (r300->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) { + r500_emit_fp_setup(r300, &r300->blit.fp_code.code.r500, dst_mesaformat); + r500_emit_rs_setup(r300); + } else { + r300_emit_fp_setup(r300); + r300_emit_rs_setup(r300); + } + + emit_pvs_setup(r300, r300->blit.vp_code.body.d, 2); + emit_vap_setup(r300, dst_width, dst_height); + + emit_cb_setup(r300, dst_bo, dst_offset, dst_mesaformat, dst_width, dst_height); + + emit_draw_packet(r300, dst_width, dst_height); + + r300EmitCacheFlush(r300); + + radeonFlush(r300->radeon.glCtx); + + return GL_TRUE; +} \ No newline at end of file diff --git a/src/mesa/drivers/dri/r300/r300_blit.h b/src/mesa/drivers/dri/r300/r300_blit.h new file mode 100644 index 0000000000..29c5aa9514 --- /dev/null +++ b/src/mesa/drivers/dri/r300/r300_blit.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2009 Maciej Cencora + * + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 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. + * + */ + +#ifndef R300_BLIT_H +#define R300_BLIT_H + +void r300_blit_init(struct r300_context *r300); + +GLboolean r300_blit(struct r300_context *r300, + struct radeon_bo *src_bo, + intptr_t src_offset, + gl_format src_mesaformat, + unsigned src_pitch, + unsigned src_width, + unsigned src_height, + struct radeon_bo *dst_bo, + intptr_t dst_offset, + gl_format dst_mesaformat, + unsigned dst_width, + unsigned dst_height); + +#endif // R300_BLIT_H \ No newline at end of file diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 67183c3c2a..6995637288 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -60,6 +60,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_context.h" #include "radeon_context.h" #include "radeon_span.h" +#include "r300_blit.h" #include "r300_cmdbuf.h" #include "r300_state.h" #include "r300_tex.h" @@ -537,6 +538,7 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual, r300InitSwtcl(ctx); } + r300_blit_init(r300); radeon_fbo_init(&r300->radeon); radeonInitSpanFuncs( ctx ); r300InitCmdBuf(r300); diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 518d5cdbf4..198414a6f8 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -533,6 +533,11 @@ struct r300_context { uint32_t fallback; + struct { + struct r300_vertex_program_code vp_code; + struct rX00_fragment_program_code fp_code; + } blit; + DECLARE_RENDERINPUTS(render_inputs_bitset); }; -- cgit v1.2.3 From 7255a5486dcb3acd5d7d267b9f546aff38685555 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sun, 8 Nov 2009 22:01:17 +0100 Subject: r300: use accelerated emit for CopyTex[Sub]Image functions --- src/mesa/drivers/dri/r300/Makefile | 1 + src/mesa/drivers/dri/r300/r300_context.c | 2 + src/mesa/drivers/dri/r300/r300_context.h | 2 + src/mesa/drivers/dri/r300/r300_texcopy.c | 162 +++++++++++++++++++++++++++++++ 4 files changed, 167 insertions(+) create mode 100644 src/mesa/drivers/dri/r300/r300_texcopy.c (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/Makefile b/src/mesa/drivers/dri/r300/Makefile index b5145d9838..409d126ab2 100644 --- a/src/mesa/drivers/dri/r300/Makefile +++ b/src/mesa/drivers/dri/r300/Makefile @@ -50,6 +50,7 @@ DRIVER_SOURCES = \ r300_state.c \ r300_render.c \ r300_tex.c \ + r300_texcopy.c \ r300_texstate.c \ r300_vertprog.c \ r300_fragprog_common.c \ diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 6995637288..05005f61c3 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -93,6 +93,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/remap_helper.h" +void r300_init_texcopy_functions(struct dd_function_table *table); static const struct dri_extension card_extensions[] = { /* *INDENT-OFF* */ @@ -485,6 +486,7 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual, r300_init_vtbl(&r300->radeon); _mesa_init_driver_functions(&functions); + r300_init_texcopy_functions(&functions); r300InitIoctlFuncs(&functions); r300InitStateFuncs(&functions); r300InitTextureFuncs(&functions); diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 198414a6f8..54a92a2e44 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -554,6 +554,8 @@ extern void r300InitShaderFunctions(r300ContextPtr r300); extern void r300InitDraw(GLcontext *ctx); +extern void r300_init_texcopy_functions(struct dd_function_table *table); + #define r300PackFloat32 radeonPackFloat32 #define r300PackFloat24 radeonPackFloat24 diff --git a/src/mesa/drivers/dri/r300/r300_texcopy.c b/src/mesa/drivers/dri/r300/r300_texcopy.c new file mode 100644 index 0000000000..efbe7538b8 --- /dev/null +++ b/src/mesa/drivers/dri/r300/r300_texcopy.c @@ -0,0 +1,162 @@ +/* + * Copyright (C) 2009 Maciej Cencora + * + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN 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. + * + */ + +#include "radeon_common.h" +#include "r300_context.h" + +#include "main/image.h" +#include "main/teximage.h" +#include "main/texstate.h" +#include "drivers/common/meta.h" + +#include "radeon_mipmap_tree.h" +#include "r300_blit.h" +#include
+ +static GLboolean +do_copy_texsubimage(GLcontext *ctx, + GLenum target, GLint level, + struct radeon_tex_obj *tobj, + radeon_texture_image *timg, + GLint dstx, GLint dsty, + GLint x, GLint y, + GLsizei width, GLsizei height) +{ + struct r300_context *r300 = R300_CONTEXT(ctx); + struct radeon_renderbuffer *rrb; + + if (_mesa_get_format_bits(timg->base.TexFormat, GL_DEPTH_BITS) || + _mesa_get_format_bits(timg->base.TexFormat, GL_STENCIL_BITS)) { + rrb = radeon_get_depthbuffer(&r300->radeon); + return GL_FALSE; + } else { + rrb = radeon_get_colorbuffer(&r300->radeon); + } + + assert(rrb && rrb->bo); + assert(timg->mt && timg->mt->bo); + assert(timg->base.Width >= dstx + width); + assert(timg->base.Height >= dsty + height); + assert(tobj->mt == timg->mt); + + intptr_t src_offset = rrb->draw_offset + x * rrb->cpp + y * rrb->pitch; + intptr_t dst_offset = radeon_miptree_image_offset(timg->mt, _mesa_tex_target_to_face(target), level); + dst_offset += dstx * _mesa_get_format_bytes(timg->base.TexFormat) + + dsty * _mesa_format_row_stride(timg->base.TexFormat, timg->base.Width); + + if (0) { + fprintf(stderr, "%s: copying to face %d, level %d\n", + __FUNCTION__, _mesa_tex_target_to_face(target), level); + fprintf(stderr, "to: x %d, y %d, offset %d\n", dstx, dsty, (uint32_t) dst_offset); + fprintf(stderr, "from (%dx%d) width %d, height %d, offset %d, pitch %d, width %d\n", + x, y, width, height, (uint32_t) src_offset, rrb->pitch, rrb->pitch/rrb->cpp); + + } + + /* blit from src buffer to texture */ + return r300_blit(r300, rrb->bo, src_offset, rrb->base.Format, rrb->pitch, + width, height, timg->mt->bo, dst_offset, + timg->base.TexFormat, width, height); +} + +static void +r300CopyTexImage2D(GLcontext *ctx, GLenum target, GLint level, + GLenum internalFormat, + GLint x, GLint y, GLsizei width, GLsizei height, + GLint border) +{ + struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); + struct gl_texture_object *texObj = + _mesa_select_tex_object(ctx, texUnit, target); + struct gl_texture_image *texImage = + _mesa_select_tex_image(ctx, texObj, target, level); + int srcx, srcy, dstx, dsty; + + if (border) + goto fail; + + /* Setup or redefine the texture object, mipmap tree and texture + * image. Don't populate yet. + */ + ctx->Driver.TexImage2D(ctx, target, level, internalFormat, + width, height, border, + GL_RGBA, GL_UNSIGNED_BYTE, NULL, + &ctx->DefaultPacking, texObj, texImage); + + srcx = x; + srcy = y; + dstx = 0; + dsty = 0; + if (!_mesa_clip_copytexsubimage(ctx, + &dstx, &dsty, + &srcx, &srcy, + &width, &height)) { + return; + } + + if (!do_copy_texsubimage(ctx, target, level, + radeon_tex_obj(texObj), (radeon_texture_image *)texImage, + 0, 0, x, y, width, height)) { + goto fail; + } + + return; + +fail: + _mesa_meta_CopyTexImage2D(ctx, target, level, internalFormat, x, y, + width, height, border); +} + +static void +r300CopyTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint x, GLint y, + GLsizei width, GLsizei height) +{ + struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); + struct gl_texture_object *texObj = _mesa_select_tex_object(ctx, texUnit, target); + struct gl_texture_image *texImage = _mesa_select_tex_image(ctx, texObj, target, level); + + assert(target == GL_TEXTURE_2D); + + if (!do_copy_texsubimage(ctx, target, level, + radeon_tex_obj(texObj), (radeon_texture_image *)texImage, + xoffset, yoffset, x, y, width, height)) { + + //DEBUG_FALLBACKS + + _mesa_meta_CopyTexSubImage2D(ctx, target, level, + xoffset, yoffset, x, y, width, height); + } +} + + +void r300_init_texcopy_functions(struct dd_function_table *table) +{ + table->CopyTexImage2D = r300CopyTexImage2D; + table->CopyTexSubImage2D = r300CopyTexSubImage2D; +} \ No newline at end of file -- cgit v1.2.3 From cd5f167353f16fb4f5b349002625b704f3e23778 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Mon, 9 Nov 2009 23:01:35 +0100 Subject: blit WIP --- src/mesa/drivers/dri/r300/r300_blit.c | 15 ++++++++++++--- src/mesa/drivers/dri/r300/r300_texcopy.c | 19 +++++++++++++------ 2 files changed, 25 insertions(+), 9 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_blit.c b/src/mesa/drivers/dri/r300/r300_blit.c index 7cb6f36c02..515a85caa2 100644 --- a/src/mesa/drivers/dri/r300/r300_blit.c +++ b/src/mesa/drivers/dri/r300/r300_blit.c @@ -424,10 +424,16 @@ GLboolean r300_blit(struct r300_context *r300, unsigned dst_width, unsigned dst_height) { - assert(src_width == dst_width); - assert(src_height == dst_height); + //assert(src_width == dst_width); + //assert(src_height == dst_height); - if (0) { + if (src_bo == dst_bo) { + return GL_FALSE; + } + + //return GL_FALSE; + + if (1) { fprintf(stderr, "src: width %d, height %d, pitch %d vs %d, format %s\n", src_width, src_height, src_pitch, _mesa_format_row_stride(src_mesaformat, src_width), @@ -441,6 +447,8 @@ GLboolean r300_blit(struct r300_context *r300, if (!validate_buffers(r300, src_bo, dst_bo)) return GL_FALSE; + rcommonEnsureCmdBufSpace(&r300->radeon, 200, __FUNCTION__); + other_stuff(r300); r300_emit_tx_setup(r300, src_mesaformat, src_bo, src_offset, src_width, src_height, src_pitch); @@ -463,6 +471,7 @@ GLboolean r300_blit(struct r300_context *r300, r300EmitCacheFlush(r300); radeonFlush(r300->radeon.glCtx); + //r300ResetHwState(r300); return GL_TRUE; } \ No newline at end of file diff --git a/src/mesa/drivers/dri/r300/r300_texcopy.c b/src/mesa/drivers/dri/r300/r300_texcopy.c index efbe7538b8..039276eacc 100644 --- a/src/mesa/drivers/dri/r300/r300_texcopy.c +++ b/src/mesa/drivers/dri/r300/r300_texcopy.c @@ -57,29 +57,38 @@ do_copy_texsubimage(GLcontext *ctx, rrb = radeon_get_colorbuffer(&r300->radeon); } + if (!timg->mt) { + radeon_validate_texture_miptree(ctx, &tobj->base); + } + assert(rrb && rrb->bo); - assert(timg->mt && timg->mt->bo); + assert(timg->mt->bo); assert(timg->base.Width >= dstx + width); assert(timg->base.Height >= dsty + height); - assert(tobj->mt == timg->mt); + //assert(tobj->mt == timg->mt); intptr_t src_offset = rrb->draw_offset + x * rrb->cpp + y * rrb->pitch; intptr_t dst_offset = radeon_miptree_image_offset(timg->mt, _mesa_tex_target_to_face(target), level); dst_offset += dstx * _mesa_get_format_bytes(timg->base.TexFormat) + dsty * _mesa_format_row_stride(timg->base.TexFormat, timg->base.Width); - if (0) { + if (src_offset % 32 || dst_offset % 32) { + return GL_FALSE; + } + + if (1) { fprintf(stderr, "%s: copying to face %d, level %d\n", __FUNCTION__, _mesa_tex_target_to_face(target), level); fprintf(stderr, "to: x %d, y %d, offset %d\n", dstx, dsty, (uint32_t) dst_offset); fprintf(stderr, "from (%dx%d) width %d, height %d, offset %d, pitch %d, width %d\n", x, y, width, height, (uint32_t) src_offset, rrb->pitch, rrb->pitch/rrb->cpp); + fprintf(stderr, "src size %d, dst size %d\n", rrb->bo->size, timg->mt->bo->size); } /* blit from src buffer to texture */ return r300_blit(r300, rrb->bo, src_offset, rrb->base.Format, rrb->pitch, - width, height, timg->mt->bo, dst_offset, + rrb->base.Width, rrb->base.Height, timg->mt->bo ? timg->mt->bo : timg->bo, dst_offset, timg->base.TexFormat, width, height); } @@ -141,8 +150,6 @@ r300CopyTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_object *texObj = _mesa_select_tex_object(ctx, texUnit, target); struct gl_texture_image *texImage = _mesa_select_tex_image(ctx, texObj, target, level); - assert(target == GL_TEXTURE_2D); - if (!do_copy_texsubimage(ctx, target, level, radeon_tex_obj(texObj), (radeon_texture_image *)texImage, xoffset, yoffset, x, y, width, height)) { -- cgit v1.2.3 From c1a7cc1e44e2c318eaa1de67893d20774f6fec5f Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Tue, 10 Nov 2009 19:47:04 +0100 Subject: more blit fixes --- src/mesa/drivers/dri/r300/r300_blit.c | 2 ++ src/mesa/drivers/dri/r300/r300_texcopy.c | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_blit.c b/src/mesa/drivers/dri/r300/r300_blit.c index 515a85caa2..b4c4b9c9cc 100644 --- a/src/mesa/drivers/dri/r300/r300_blit.c +++ b/src/mesa/drivers/dri/r300/r300_blit.c @@ -218,6 +218,8 @@ static uint32_t mesa_format_to_us_format(gl_format mesa_format) { switch(mesa_format) { + case MESA_FORMAT_S8_Z24: + case MESA_FORMAT_X8_Z24: case MESA_FORMAT_RGBA8888: // x return EASY_US_FORMAT(R500_OUT_FMT_C4_8, A, B, G, R, 0); case MESA_FORMAT_RGB565: // x diff --git a/src/mesa/drivers/dri/r300/r300_texcopy.c b/src/mesa/drivers/dri/r300/r300_texcopy.c index 039276eacc..1e10c7326c 100644 --- a/src/mesa/drivers/dri/r300/r300_texcopy.c +++ b/src/mesa/drivers/dri/r300/r300_texcopy.c @@ -49,10 +49,8 @@ do_copy_texsubimage(GLcontext *ctx, struct r300_context *r300 = R300_CONTEXT(ctx); struct radeon_renderbuffer *rrb; - if (_mesa_get_format_bits(timg->base.TexFormat, GL_DEPTH_BITS) || - _mesa_get_format_bits(timg->base.TexFormat, GL_STENCIL_BITS)) { + if (_mesa_get_format_bits(timg->base.TexFormat, GL_DEPTH_BITS) > 0) { rrb = radeon_get_depthbuffer(&r300->radeon); - return GL_FALSE; } else { rrb = radeon_get_colorbuffer(&r300->radeon); } -- cgit v1.2.3 From 353966b2da7de6d694285617ee5522ee4f3863ac Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 21 Nov 2009 18:16:29 +0100 Subject: r300: finish blit support for r300 --- src/mesa/drivers/dri/r300/r300_blit.c | 56 ++++++++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 4 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_blit.c b/src/mesa/drivers/dri/r300/r300_blit.c index b4c4b9c9cc..7b256dac78 100644 --- a/src/mesa/drivers/dri/r300/r300_blit.c +++ b/src/mesa/drivers/dri/r300/r300_blit.c @@ -156,14 +156,62 @@ static void r500_emit_rs_setup(struct r300_context *r300) END_BATCH(); } -static void r300_emit_fp_setup(struct r300_context *r300) +static void r300_emit_fp_setup(struct r300_context *r300, + struct r300_fragment_program_code *code) { - assert(0); + unsigned i; + BATCH_LOCALS(&r300->radeon); + + BEGIN_BATCH((code->alu.length + 1) * 4 + code->tex.length + 1 + 9); + + OUT_BATCH_REGSEQ(R300_US_ALU_RGB_INST_0, code->alu.length); + for (i = 0; i < code->alu.length; i++) { + OUT_BATCH(code->alu.inst[i].rgb_inst); + } + OUT_BATCH_REGSEQ(R300_US_ALU_RGB_ADDR_0, code->alu.length); + for (i = 0; i < code->alu.length; i++) { + OUT_BATCH(code->alu.inst[i].rgb_addr); + } + OUT_BATCH_REGSEQ(R300_US_ALU_ALPHA_INST_0, code->alu.length); + for (i = 0; i < code->alu.length; i++) { + OUT_BATCH(code->alu.inst[i].alpha_inst); + } + OUT_BATCH_REGSEQ(R300_US_ALU_ALPHA_ADDR_0, code->alu.length); + for (i = 0; i < code->alu.length; i++) { + OUT_BATCH(code->alu.inst[i].alpha_addr); + } + + OUT_BATCH_REGSEQ(R300_US_TEX_INST_0, code->tex.length); + OUT_BATCH_TABLE(code->tex.inst, code->tex.length); + + OUT_BATCH_REGSEQ(R300_US_CONFIG, 3); + OUT_BATCH(R300_PFS_CNTL_FIRST_NODE_HAS_TEX); + OUT_BATCH(code->pixsize); + OUT_BATCH(code->code_offset); + OUT_BATCH_REGSEQ(R300_US_CODE_ADDR_0, 4); + OUT_BATCH_TABLE(code->code_addr, 4); + END_BATCH(); } static void r300_emit_rs_setup(struct r300_context *r300) { - assert(0); + BATCH_LOCALS(&r300->radeon); + + BEGIN_BATCH(7); + OUT_BATCH_REGSEQ(R300_RS_COUNT, 2); + OUT_BATCH((4 << R300_IT_COUNT_SHIFT) | R300_HIRES_EN); + OUT_BATCH(0); + OUT_BATCH_REGVAL(R300_RS_INST_0, + R300_RS_INST_TEX_ID(0) | + R300_RS_INST_TEX_ADDR(0) | + R300_RS_INST_TEX_CN_WRITE); + OUT_BATCH_REGVAL(R300_RS_IP_0, + R300_RS_TEX_PTR(0) | + R300_RS_SEL_S(R300_RS_SEL_C0) | + R300_RS_SEL_R(R300_RS_SEL_C1) | + R300_RS_SEL_T(R300_RS_SEL_K0) | + R300_RS_SEL_Q(R300_RS_SEL_K1)); + END_BATCH(); } static void r300_emit_tx_setup(struct r300_context *r300, @@ -459,7 +507,7 @@ GLboolean r300_blit(struct r300_context *r300, r500_emit_fp_setup(r300, &r300->blit.fp_code.code.r500, dst_mesaformat); r500_emit_rs_setup(r300); } else { - r300_emit_fp_setup(r300); + r300_emit_fp_setup(r300, &r300->blit.fp_code.code.r300); r300_emit_rs_setup(r300); } -- cgit v1.2.3 From dbd53f8f55cd4201ee230fec44f35e7dd2eea17d Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 21 Nov 2009 21:18:41 +0100 Subject: r300: setup render target format for r300/r400 cards too --- src/mesa/drivers/dri/r300/r300_blit.c | 168 +++++++++++++++++----------------- 1 file changed, 82 insertions(+), 86 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_blit.c b/src/mesa/drivers/dri/r300/r300_blit.c index 7b256dac78..6eb1108f0d 100644 --- a/src/mesa/drivers/dri/r300/r300_blit.c +++ b/src/mesa/drivers/dri/r300/r300_blit.c @@ -35,12 +35,6 @@ #include "compiler/radeon_compiler.h" #include "compiler/radeon_opcodes.h" -/** - * TODO: - * - handle depth buffer - * - r300 fp and rs setup - */ - static void vp_ins_outs(struct r300_vertex_program_compiler *c) { c->code->inputs[VERT_ATTRIB_POS] = 0; @@ -135,85 +129,6 @@ void r300_blit_init(struct r300_context *r300) create_fragment_program(r300); } -static void r500_emit_rs_setup(struct r300_context *r300) -{ - BATCH_LOCALS(&r300->radeon); - - BEGIN_BATCH(7); - OUT_BATCH_REGSEQ(R300_RS_COUNT, 2); - OUT_BATCH((4 << R300_IT_COUNT_SHIFT) | R300_HIRES_EN); - OUT_BATCH(0); - OUT_BATCH_REGVAL(R500_RS_INST_0, - (0 << R500_RS_INST_TEX_ID_SHIFT) | - (0 << R500_RS_INST_TEX_ADDR_SHIFT) | - R500_RS_INST_TEX_CN_WRITE | - R500_RS_INST_COL_CN_NO_WRITE); - OUT_BATCH_REGVAL(R500_RS_IP_0, - (0 << R500_RS_IP_TEX_PTR_S_SHIFT) | - (1 << R500_RS_IP_TEX_PTR_T_SHIFT) | - (2 << R500_RS_IP_TEX_PTR_R_SHIFT) | - (3 << R500_RS_IP_TEX_PTR_Q_SHIFT)); - END_BATCH(); -} - -static void r300_emit_fp_setup(struct r300_context *r300, - struct r300_fragment_program_code *code) -{ - unsigned i; - BATCH_LOCALS(&r300->radeon); - - BEGIN_BATCH((code->alu.length + 1) * 4 + code->tex.length + 1 + 9); - - OUT_BATCH_REGSEQ(R300_US_ALU_RGB_INST_0, code->alu.length); - for (i = 0; i < code->alu.length; i++) { - OUT_BATCH(code->alu.inst[i].rgb_inst); - } - OUT_BATCH_REGSEQ(R300_US_ALU_RGB_ADDR_0, code->alu.length); - for (i = 0; i < code->alu.length; i++) { - OUT_BATCH(code->alu.inst[i].rgb_addr); - } - OUT_BATCH_REGSEQ(R300_US_ALU_ALPHA_INST_0, code->alu.length); - for (i = 0; i < code->alu.length; i++) { - OUT_BATCH(code->alu.inst[i].alpha_inst); - } - OUT_BATCH_REGSEQ(R300_US_ALU_ALPHA_ADDR_0, code->alu.length); - for (i = 0; i < code->alu.length; i++) { - OUT_BATCH(code->alu.inst[i].alpha_addr); - } - - OUT_BATCH_REGSEQ(R300_US_TEX_INST_0, code->tex.length); - OUT_BATCH_TABLE(code->tex.inst, code->tex.length); - - OUT_BATCH_REGSEQ(R300_US_CONFIG, 3); - OUT_BATCH(R300_PFS_CNTL_FIRST_NODE_HAS_TEX); - OUT_BATCH(code->pixsize); - OUT_BATCH(code->code_offset); - OUT_BATCH_REGSEQ(R300_US_CODE_ADDR_0, 4); - OUT_BATCH_TABLE(code->code_addr, 4); - END_BATCH(); -} - -static void r300_emit_rs_setup(struct r300_context *r300) -{ - BATCH_LOCALS(&r300->radeon); - - BEGIN_BATCH(7); - OUT_BATCH_REGSEQ(R300_RS_COUNT, 2); - OUT_BATCH((4 << R300_IT_COUNT_SHIFT) | R300_HIRES_EN); - OUT_BATCH(0); - OUT_BATCH_REGVAL(R300_RS_INST_0, - R300_RS_INST_TEX_ID(0) | - R300_RS_INST_TEX_ADDR(0) | - R300_RS_INST_TEX_CN_WRITE); - OUT_BATCH_REGVAL(R300_RS_IP_0, - R300_RS_TEX_PTR(0) | - R300_RS_SEL_S(R300_RS_SEL_C0) | - R300_RS_SEL_R(R300_RS_SEL_C1) | - R300_RS_SEL_T(R300_RS_SEL_K0) | - R300_RS_SEL_Q(R300_RS_SEL_K1)); - END_BATCH(); -} - static void r300_emit_tx_setup(struct r300_context *r300, gl_format mesa_format, struct radeon_bo *bo, @@ -325,6 +240,87 @@ static void r500_emit_fp_setup(struct r300_context *r300, END_BATCH(); } +static void r500_emit_rs_setup(struct r300_context *r300) +{ + BATCH_LOCALS(&r300->radeon); + + BEGIN_BATCH(7); + OUT_BATCH_REGSEQ(R300_RS_COUNT, 2); + OUT_BATCH((4 << R300_IT_COUNT_SHIFT) | R300_HIRES_EN); + OUT_BATCH(0); + OUT_BATCH_REGVAL(R500_RS_INST_0, + (0 << R500_RS_INST_TEX_ID_SHIFT) | + (0 << R500_RS_INST_TEX_ADDR_SHIFT) | + R500_RS_INST_TEX_CN_WRITE | + R500_RS_INST_COL_CN_NO_WRITE); + OUT_BATCH_REGVAL(R500_RS_IP_0, + (0 << R500_RS_IP_TEX_PTR_S_SHIFT) | + (1 << R500_RS_IP_TEX_PTR_T_SHIFT) | + (2 << R500_RS_IP_TEX_PTR_R_SHIFT) | + (3 << R500_RS_IP_TEX_PTR_Q_SHIFT)); + END_BATCH(); +} + +static void r300_emit_fp_setup(struct r300_context *r300, + struct r300_fragment_program_code *code, + gl_format dst_format) +{ + unsigned i; + BATCH_LOCALS(&r300->radeon); + + BEGIN_BATCH((code->alu.length + 1) * 4 + code->tex.length + 1 + 11); + + OUT_BATCH_REGSEQ(R300_US_ALU_RGB_INST_0, code->alu.length); + for (i = 0; i < code->alu.length; i++) { + OUT_BATCH(code->alu.inst[i].rgb_inst); + } + OUT_BATCH_REGSEQ(R300_US_ALU_RGB_ADDR_0, code->alu.length); + for (i = 0; i < code->alu.length; i++) { + OUT_BATCH(code->alu.inst[i].rgb_addr); + } + OUT_BATCH_REGSEQ(R300_US_ALU_ALPHA_INST_0, code->alu.length); + for (i = 0; i < code->alu.length; i++) { + OUT_BATCH(code->alu.inst[i].alpha_inst); + } + OUT_BATCH_REGSEQ(R300_US_ALU_ALPHA_ADDR_0, code->alu.length); + for (i = 0; i < code->alu.length; i++) { + OUT_BATCH(code->alu.inst[i].alpha_addr); + } + + OUT_BATCH_REGSEQ(R300_US_TEX_INST_0, code->tex.length); + OUT_BATCH_TABLE(code->tex.inst, code->tex.length); + + OUT_BATCH_REGSEQ(R300_US_CONFIG, 3); + OUT_BATCH(R300_PFS_CNTL_FIRST_NODE_HAS_TEX); + OUT_BATCH(code->pixsize); + OUT_BATCH(code->code_offset); + OUT_BATCH_REGSEQ(R300_US_CODE_ADDR_0, 4); + OUT_BATCH_TABLE(code->code_addr, 4); + OUT_BATCH_REGVAL(R500_US_OUT_FMT_0, mesa_format_to_us_format(dst_format)); + END_BATCH(); +} + +static void r300_emit_rs_setup(struct r300_context *r300) +{ + BATCH_LOCALS(&r300->radeon); + + BEGIN_BATCH(7); + OUT_BATCH_REGSEQ(R300_RS_COUNT, 2); + OUT_BATCH((4 << R300_IT_COUNT_SHIFT) | R300_HIRES_EN); + OUT_BATCH(0); + OUT_BATCH_REGVAL(R300_RS_INST_0, + R300_RS_INST_TEX_ID(0) | + R300_RS_INST_TEX_ADDR(0) | + R300_RS_INST_TEX_CN_WRITE); + OUT_BATCH_REGVAL(R300_RS_IP_0, + R300_RS_TEX_PTR(0) | + R300_RS_SEL_S(R300_RS_SEL_C0) | + R300_RS_SEL_R(R300_RS_SEL_C1) | + R300_RS_SEL_T(R300_RS_SEL_K0) | + R300_RS_SEL_Q(R300_RS_SEL_K1)); + END_BATCH(); +} + static void emit_pvs_setup(struct r300_context *r300, uint32_t *vp_code, unsigned vp_len) @@ -507,7 +503,7 @@ GLboolean r300_blit(struct r300_context *r300, r500_emit_fp_setup(r300, &r300->blit.fp_code.code.r500, dst_mesaformat); r500_emit_rs_setup(r300); } else { - r300_emit_fp_setup(r300, &r300->blit.fp_code.code.r300); + r300_emit_fp_setup(r300, &r300->blit.fp_code.code.r300, dst_mesaformat); r300_emit_rs_setup(r300); } -- cgit v1.2.3 From 6b8315494ac84e6b59ae9113653224ed0a546014 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sun, 22 Nov 2009 15:12:24 +0100 Subject: r300: emit number of used colorbuffers to pass radeon cs checker --- src/mesa/drivers/dri/r300/r300_blit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_blit.c b/src/mesa/drivers/dri/r300/r300_blit.c index 6eb1108f0d..4c3d3c8069 100644 --- a/src/mesa/drivers/dri/r300/r300_blit.c +++ b/src/mesa/drivers/dri/r300/r300_blit.c @@ -450,10 +450,11 @@ static void emit_cb_setup(struct r300_context *r300, _mesa_get_format_bytes(mesa_format), _mesa_format_row_stride(mesa_format, width)); - BEGIN_BATCH_NO_AUTOSTATE(3); + BEGIN_BATCH_NO_AUTOSTATE(5); OUT_BATCH_REGSEQ(R300_SC_SCISSORS_TL, 2); OUT_BATCH((x1 << R300_SCISSORS_X_SHIFT)|(y1 << R300_SCISSORS_Y_SHIFT)); OUT_BATCH((x2 << R300_SCISSORS_X_SHIFT)|(y2 << R300_SCISSORS_Y_SHIFT)); + OUT_BATCH_REGVAL(R300_RB3D_CCTL, 0); END_BATCH(); } -- cgit v1.2.3 From 784cca9fa527de771754d76545970f78094b9adf Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 12 Dec 2009 00:50:26 +0100 Subject: r300: disable blit debugging info --- src/mesa/drivers/dri/r300/r300_blit.c | 2 +- src/mesa/drivers/dri/r300/r300_texcopy.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/mesa') diff --git a/src/mesa/drivers/dri/r300/r300_blit.c b/src/mesa/drivers/dri/r300/r300_blit.c index 4c3d3c8069..10e1b3c912 100644 --- a/src/mesa/drivers/dri/r300/r300_blit.c +++ b/src/mesa/drivers/dri/r300/r300_blit.c @@ -480,7 +480,7 @@ GLboolean r300_blit(struct r300_context *r300, //return GL_FALSE; - if (1) { + if (0) { fprintf(stderr, "src: width %d, height %d, pitch %d vs %d, format %s\n", src_width, src_height, src_pitch, _mesa_format_row_stride(src_mesaformat, src_width), diff --git a/src/mesa/drivers/dri/r300/r300_texcopy.c b/src/mesa/drivers/dri/r300/r300_texcopy.c index 1e10c7326c..5e3a724d4e 100644 --- a/src/mesa/drivers/dri/r300/r300_texcopy.c +++ b/src/mesa/drivers/dri/r300/r300_texcopy.c @@ -74,7 +74,7 @@ do_copy_texsubimage(GLcontext *ctx, return GL_FALSE; } - if (1) { + if (0) { fprintf(stderr, "%s: copying to face %d, level %d\n", __FUNCTION__, _mesa_tex_target_to_face(target), level); fprintf(stderr, "to: x %d, y %d, offset %d\n", dstx, dsty, (uint32_t) dst_offset); -- cgit v1.2.3